import React from "react"; import { OverlaysProvider } from "@blueprintjs/core"; import { Meta, StoryFn } from "@storybook/react"; import { Card, FlexibleLayoutContainer, FlexibleLayoutItem, Icon, OverflowText, OverviewItem, OverviewItemDepiction, OverviewItemDescription, OverviewItemLine, TitleSubsection, } from "../../../../index"; import { Definitions } from "../../../common/Intent"; import BaseIcon from "../BaseIcon"; import canonicalIcons, { ValidIconName } from "./../canonicalIconNames"; export default { title: "Components/Icon", component: Icon, subcomponents: { BaseIcon }, argTypes: { name: { control: "select", options: [...Object.keys(canonicalIcons)], }, intent: { control: "select", options: [...Object.keys(Definitions)], mapping: { ...Definitions }, }, }, } as Meta; const Template: StoryFn = (args) => ( ); export const Default = Template.bind({}); Default.args = { name: "undefined", title: "This is the title", }; const TemplateSizes: StoryFn = (args) => ( ); export const IconSizes = TemplateSizes.bind({}); IconSizes.args = { name: "undefined", }; /** * Available icons by their canonical names. * If you need another icon then use ` component. */ export const IconsOverview = () => { let section = ""; let separation = <>; return ( {Object.keys(canonicalIcons) .sort() .map((iconName) => { if ( section !== iconName.substring(0, iconName.indexOf("-") > 0 ? iconName.indexOf("-") : iconName.length) ) { section = iconName.substring( 0, iconName.indexOf("-") > 0 ? iconName.indexOf("-") : iconName.length, ); separation = ( {section} ); } else { separation = <>; } return ( {separation} {iconName} ); })} ); };