diff --git a/.storybook/docs/stories/Typography.stories.mdx b/.storybook/docs/stories/Typography.stories.mdx index 13549a8dd..1244077bc 100644 --- a/.storybook/docs/stories/Typography.stories.mdx +++ b/.storybook/docs/stories/Typography.stories.mdx @@ -1,4 +1,4 @@ -import { Meta } from "@storybook/addon-docs"; +import { Meta, Unstyled } from "@storybook/addon-docs"; import { Typeset } from "@storybook/addon-docs"; import { fontFamilySansSerif, @@ -42,7 +42,9 @@ import { sampleText="The quick brown fox jumps over the lazy dog" />

Heading Text

- Heading Text 1 - Heading Text 2 - Heading Text 3 + + Heading Text 1 + Heading Text 2 + Heading Text 3 + diff --git a/.storybook/docs/stories/Welcome.stories.mdx b/.storybook/docs/stories/Welcome.stories.mdx index 68b7aa3c7..e8376208d 100644 --- a/.storybook/docs/stories/Welcome.stories.mdx +++ b/.storybook/docs/stories/Welcome.stories.mdx @@ -1,4 +1,4 @@ -import { Meta } from "@storybook/addon-docs"; +import { Meta, Unstyled } from "@storybook/addon-docs"; import { WelcomeBanner, WelcomeCards, WelcomeFooter } from "../index.ts"; @@ -11,6 +11,8 @@ import { WelcomeBanner, WelcomeCards, WelcomeFooter } from "../index.ts"; }} /> - - - + + + + + diff --git a/packages/accordion/accordion.stories.tsx b/packages/accordion/accordion.stories.tsx index e8bfcc73a..6b66c64e7 100644 --- a/packages/accordion/accordion.stories.tsx +++ b/packages/accordion/accordion.stories.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { Flex, FlexItem } from "../styleUtils/layout"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { SecondaryButton } from "../button"; import { Accordion, @@ -31,7 +31,7 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( Panel 1 @@ -50,41 +50,49 @@ const Template: Story = args => ( ); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; -export const AccordionItemExpandedOnRender = Template.bind({}); -AccordionItemExpandedOnRender.args = { initialExpandedItems: ["panel1"] }; +export const AccordionItemExpandedOnRender = { + render: Template, + args: { initialExpandedItems: ["panel1"] } +}; -export const AllowingMultipleAccordionItemsOpen = Template.bind({}); -AllowingMultipleAccordionItemsOpen.args = { allowMultipleExpanded: true }; +export const AllowingMultipleAccordionItemsOpen = { + render: Template, + args: { allowMultipleExpanded: true } +}; -export const InteractiveElementsInTitle = args => ( - - - - {({ getHeading }) => ( - - {getHeading("Panel 1")} - - Action - - - )} - - - Content 1 has focusable content - - - - Panel 2 - Content 2 - - - Panel 3 - Content 3 - - -); +export const InteractiveElementsInTitle = { + render: args => ( + + + + {({ getHeading }) => ( + + {getHeading("Panel 1")} + + Action + + + )} + + + Content 1 has focusable content + + + + Panel 2 + Content 2 + + + Panel 3 + Content 3 + + + ) +}; export const WithChangeHandler = () => { const onChange = expanded => { @@ -112,99 +120,107 @@ export const WithChangeHandler = () => { ); }; -export const WithDisabledAccordionItem = args => ( - - - Panel 1 - Content 1 - - - Panel 2 - Content 2 - - - Panel 3 - Content 3 - - -); +export const WithDisabledAccordionItem = { + render: args => ( + + + Panel 1 + Content 1 + + + Panel 2 + Content 2 + + + Panel 3 + Content 3 + + + ) +}; -export const WithAccordionItemThatHasAppearanceDanger = args => ( - - - Panel 1 - Content 1 - - - Panel 2 - Content 2 - - - Panel 3 - Content 3 - - -); +export const WithAccordionItemThatHasAppearanceDanger = { + render: args => ( + + + Panel 1 + Content 1 + + + Panel 2 + Content 2 + + + Panel 3 + Content 3 + + + ) +}; -export const CustomPaddingSizeOnAccordionItemContent = args => ( - - - Panel 1 - - Content 1 has paddingSize="xxl" - - - - Panel 2 - Content 2 - - - Panel 3 - Content 3 - - -); +export const CustomPaddingSizeOnAccordionItemContent = { + render: args => ( + + + Panel 1 + + Content 1 has paddingSize="xxl" + + + + Panel 2 + Content 2 + + + Panel 3 + Content 3 + + + ) +}; -export const ControlledUsingStatelessAccordion = args => ( - - {({ changeHandler, selectedItems }) => { - return ( - - - - - Panel 1 - Content 1 - - - Panel 2 - Content 2 - - - Panel 3 - Content 3 - - - - - - - - ); - }} - -); +export const ControlledUsingStatelessAccordion = { + render: args => ( + + {({ changeHandler, selectedItems }) => { + return ( + + + + + Panel 1 + Content 1 + + + Panel 2 + Content 2 + + + Panel 3 + Content 3 + + + + + + + + ); + }} + + ) +}; diff --git a/packages/appChrome/stories/AppChrome.stories.tsx b/packages/appChrome/stories/AppChrome.stories.tsx index e34e4d6b2..cd390caf5 100644 --- a/packages/appChrome/stories/AppChrome.stories.tsx +++ b/packages/appChrome/stories/AppChrome.stories.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { action } from "@storybook/addon-actions"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { SidebarBareContent } from "./helpers/StorybookSidebarHelpers"; import AppChrome, { AppChromeProps } from "../components/AppChrome"; @@ -20,7 +20,7 @@ export default { parameters: { controls: { disable: true } } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( @@ -34,530 +34,556 @@ const Template: Story = args => ( /> ); -export const AppChromeBare = Template.bind({}); +export const AppChromeBare = { + render: Template +}; -export const HeaderBarDefault = args => ( - Header content goes here -); +export const HeaderBarDefault = { + render: args => Header content goes here +}; -export const HeaderBarWithCustomColors = args => ( - Header content goes here -); +export const HeaderBarWithCustomColors = { + render: args => ( + Header content goes here + ) +}; -export const SidebarDefault = args => ( - - - -); +export const SidebarDefault = { + render: args => ( + + + + ) +}; -export const SidebarWithItems = args => ( - - - - Lorem Ipsum - - - Dolor Sit - - - Amet Consecutor - - - Adipiscing Edit - - - Praesent Massa - - - -); +export const SidebarWithItems = { + render: args => ( + + + + Lorem Ipsum + + + Dolor Sit + + + Amet Consecutor + + + Adipiscing Edit + + + Praesent Massa + + + + ) +}; -export const SidebarWithItemsWithOnClick = args => ( - - - - Lorem Ipsum - - - Dolor Sit - - - Amet Consecutor - - - Adipiscing Edit - - - Praesent Massa - - - -); +export const SidebarWithItemsWithOnClick = { + render: args => ( + + + + Lorem Ipsum + + + Dolor Sit + + + Amet Consecutor + + + Adipiscing Edit + + + Praesent Massa + + + + ) +}; -export const SidebarWithItemsActive = args => ( - - - - Lorem Ipsum - - - Dolor Sit - - - Amet Consecutor - - - Adipiscing Edit - - - Praesent Massa - - - -); +export const SidebarWithItemsActive = { + render: args => ( + + + + Lorem Ipsum + + + Dolor Sit + + + Amet Consecutor + + + Adipiscing Edit + + + Praesent Massa + + + + ) +}; -export const SidebarWithCustomColors = args => ( - - - - Lorem Ipsum - - - Dolor Sit - - - Amet Consecutor - - - Adipiscing Edit - - - Praesent Massa - - - -); - -export const SidebarItemsWithIcons = args => ( - - - - - Lorem Ipsum - - - - - Dolor Sit - - - - - Amet Consecutor - - - - - Adipiscing Edit - - - - - Praesent Massa - - - - -); - -export const SidebarWithSubmenus = args => ( - - - Lorem ipsum} - key="subOne" - > - - Lorem Ipsum - - - Dolor Sit - - - Dolor Sit} - key="subTwo" - > - - Lorem Ipsum - - - Dolor Sit - - - Amet Consecutor} - key="subThree" - > - - Lorem Ipsum - - - Dolor Sit - - - Adipiscing Edit} - key="subFour" - > - - Lorem Ipsum - - - Dolor Sit - - - Praesent Massa} - key="subFive" - > - - Lorem Ipsum - - - Dolor Sit - - - - -); +export const SidebarWithCustomColors = { + render: args => ( + + + + Lorem Ipsum + + + Dolor Sit + + + Amet Consecutor + + + Adipiscing Edit + + + Praesent Massa + + + + ) +}; -export const SidebarSubmenusWithOnClick = args => ( - - - Lorem ipsum} - key="subOne" - > - - Lorem Ipsum - - - Dolor Sit - - - Dolor Sit} - key="subTwo" - > - - Lorem Ipsum - - - Dolor Sit - - - Amet Consecutor} - key="subThree" - > - - Lorem Ipsum - - - Dolor Sit - - - Adipiscing Edit} - key="subFour" - > - - Lorem Ipsum - - - Dolor Sit - - - Praesent Massa} - key="subFive" - > - - Lorem Ipsum - - - Dolor Sit - - - - -); - -export const SidebarSubmenusActive = args => ( - - - Lorem ipsum} - isOpen={true} - key="subOne" - > - - Lorem Ipsum - - - Dolor Sit - - - Dolor Sit} - key="subTwo" - > - - Lorem Ipsum - - - Dolor Sit - - - Amet Consecutor} - key="subThree" - > - - Lorem Ipsum - - - Dolor Sit - - - Adipiscing Edit} - key="subFour" - > - - Lorem Ipsum - - - Dolor Sit - - - Praesent Massa} - key="subFive" - > - - Lorem Ipsum - - - Dolor Sit - - - - -); - -export const SidebarWSubmenusWithIcons = args => ( - - - ( + + + - Lorem ipsum + Lorem Ipsum - } - menuHasIcon={true} - key="subOne" - > - - Lorem Ipsum - - - Dolor Sit - - - + Dolor Sit - } - menuHasIcon={true} - key="subTwo" - > - - Lorem Ipsum - - - Dolor Sit - - - + Amet Consecutor - } - menuHasIcon={true} - key="subThree" - > - - Lorem Ipsum - - - Dolor Sit - - - + Adipiscing Edit - } - menuHasIcon={true} - key="subFour" - > - - Lorem Ipsum - - - Dolor Sit - - - + Praesent Massa - } - menuHasIcon={true} - key="subFive" - > - - Lorem Ipsum - - - Dolor Sit - - - - -); + + + + ) +}; -export const SidebarWithDisabledItems = args => ( - - - - - Disabled Sidebar Item - - - - Disabled Submenu - - } - menuHasIcon={true} - key="subOne" - disabled={true} - isOpen={false} - > - - Lorem Ipsum - - - Dolor Sit - - - +export const SidebarWithSubmenus = { + render: args => ( + + + Lorem ipsum} + key="subOne" + > + + Lorem Ipsum + + Dolor Sit + + + Dolor Sit} + key="subTwo" + > + + Lorem Ipsum + + + Dolor Sit + + + Amet Consecutor} + key="subThree" + > + + Lorem Ipsum + + + Dolor Sit + + + Adipiscing Edit} + key="subFour" + > + + Lorem Ipsum + + + Dolor Sit + + + Praesent Massa} + key="subFive" + > + + Lorem Ipsum + + + Dolor Sit + + + + + ) +}; + +export const SidebarSubmenusWithOnClick = { + render: args => ( + + + Lorem ipsum} + key="subOne" + > + + Lorem Ipsum + + + Dolor Sit + + + Dolor Sit} + key="subTwo" + > + + Lorem Ipsum + + + Dolor Sit + + + Amet Consecutor} + key="subThree" + > + + Lorem Ipsum + + + Dolor Sit + + + Adipiscing Edit} + key="subFour" + > + + Lorem Ipsum + + + Dolor Sit + + + Praesent Massa} + key="subFive" + > + + Lorem Ipsum + + + Dolor Sit + + + + + ) +}; + +export const SidebarSubmenusActive = { + render: args => ( + + + Lorem ipsum} + isOpen={true} + key="subOne" + > + + Lorem Ipsum + + + Dolor Sit + + + Dolor Sit} + key="subTwo" + > + + Lorem Ipsum + + + Dolor Sit + + + Amet Consecutor} + key="subThree" + > + + Lorem Ipsum + + + Dolor Sit + + + Adipiscing Edit} + key="subFour" + > + + Lorem Ipsum + + + Dolor Sit + + + Praesent Massa} + key="subFive" + > + + Lorem Ipsum + + + Dolor Sit + + + + + ) +}; + +export const SidebarWSubmenusWithIcons = { + render: args => ( + + + + Lorem ipsum + + } + menuHasIcon={true} + key="subOne" + > + + Lorem Ipsum + + + Dolor Sit + + + + Dolor Sit + + } + menuHasIcon={true} + key="subTwo" + > + + Lorem Ipsum + + + Dolor Sit + + + + Amet Consecutor + + } + menuHasIcon={true} + key="subThree" + > + + Lorem Ipsum + + + Dolor Sit + + + + Adipiscing Edit + + } + menuHasIcon={true} + key="subFour" + > + + Lorem Ipsum + + + Dolor Sit + + + + Praesent Massa + + } + menuHasIcon={true} + key="subFive" + > + + Lorem Ipsum + + + Dolor Sit + + + + + ) +}; + +export const SidebarWithDisabledItems = { + render: args => ( + + + + + Disabled Sidebar Item - } - menuHasIcon={true} - key="subTwo" - isOpen={true} - > - - Lorem Ipsum - - + + Disabled Submenu + + } + menuHasIcon={true} + key="subOne" disabled={true} + isOpen={false} > - Disabled Submenu Item - - - - -); + + Lorem Ipsum + + + Dolor Sit + + + + Dolor Sit + + } + menuHasIcon={true} + key="subTwo" + isOpen={true} + > + + Lorem Ipsum + + + Disabled Submenu Item + + + + + ) +}; diff --git a/packages/avatar/stories/avatar.stories.tsx b/packages/avatar/stories/avatar.stories.tsx index 355217c7f..f6d81c862 100644 --- a/packages/avatar/stories/avatar.stories.tsx +++ b/packages/avatar/stories/avatar.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { Avatar } from "../index"; import { iconSizeXs, @@ -24,8 +24,11 @@ export default { } } as Meta; -const Template: Story = args => ( - +const Template: StoryFn = args => ( + ); -export const Default = Template.bind({}); +export const Default = { + render: Template, + args: { src: serviceImg } +}; diff --git a/packages/badge/stories/badge.stories.tsx b/packages/badge/stories/badge.stories.tsx index 9cdad32ae..dcfeca2b6 100644 --- a/packages/badge/stories/badge.stories.tsx +++ b/packages/badge/stories/badge.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { Badge } from "../../index"; import { BadgeProps } from "../components/badge"; @@ -23,7 +23,9 @@ export default { } as Meta; Badge.displayName = "Badge"; -const Template: Story = args => Badge; +const Template: StoryFn = args => Badge; -export const Default = Template.bind({}); -Default.args = { appearance: "default" }; +export const Default = { + render: Template, + args: { appearance: "default" } +}; diff --git a/packages/badge/stories/badgebutton.stories.tsx b/packages/badge/stories/badgebutton.stories.tsx index ff24f594a..2c9643184 100644 --- a/packages/badge/stories/badgebutton.stories.tsx +++ b/packages/badge/stories/badgebutton.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { BadgeButton } from "../../index"; import { BadgeButtonProps } from "../components/badgeButton"; @@ -23,9 +23,11 @@ export default { } as Meta; BadgeButton.displayName = "Badge"; -const Template: Story = args => ( +const Template: StoryFn = args => ( Badge Button ); -export const Default = Template.bind({}); -Default.args = { appearance: "default" }; +export const Default = { + render: Template, + args: { appearance: "default" } +}; diff --git a/packages/badge/stories/colorcodedbadge.stories.tsx b/packages/badge/stories/colorcodedbadge.stories.tsx index fbecce07a..7cb1be723 100644 --- a/packages/badge/stories/colorcodedbadge.stories.tsx +++ b/packages/badge/stories/colorcodedbadge.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { ColorCodedBadge } from "../../index"; import { ColorCodedBadgeProps } from "../components/ColorCodedBadge"; import { SystemIcons } from "../../icons/dist/system-icons-enum"; @@ -21,8 +21,11 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( Color Coded Badge ); -export const Default = Template.bind({}); +export const Default = { + render: Template, + args: { color: textColorPrimary } +}; diff --git a/packages/breadcrumb/stories/Breadcrumb.stories.tsx b/packages/breadcrumb/stories/Breadcrumb.stories.tsx index c272085f6..4c886ad07 100644 --- a/packages/breadcrumb/stories/Breadcrumb.stories.tsx +++ b/packages/breadcrumb/stories/Breadcrumb.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { Breadcrumb, BreadcrumbItem } from "../index"; import { action } from "@storybook/addon-actions"; import { ProductIcons } from "../../icons/dist/product-icons-enum"; @@ -17,7 +17,7 @@ export default { } }; -const Template: Story = args => ( +const Template: StoryFn = args => ( = args => ( ); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; diff --git a/packages/button/stories/DefaultButton.stories.tsx b/packages/button/stories/DefaultButton.stories.tsx index 12de3a72f..752f48d8d 100644 --- a/packages/button/stories/DefaultButton.stories.tsx +++ b/packages/button/stories/DefaultButton.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { PrimaryButton, SecondaryButton, @@ -43,52 +43,66 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( {args.children} ); -export const Standard = Template.bind({}); +export const Standard = { + render: Template +}; -export const _PrimaryButton = args => ( - {args.children} -); +export const _PrimaryButton = { + render: args => {args.children} +}; -export const _SecondaryButton = args => ( - {args.children} -); +export const _SecondaryButton = { + render: args => {args.children} +}; -export const _SuccessButton = args => ( - {args.children} -); +export const _SuccessButton = { + render: args => {args.children} +}; -export const _WarningButton = args => ( - {args.children} -); +export const _WarningButton = { + render: args => {args.children} +}; -export const _DangerButton = args => ( - {args.children} -); +export const _DangerButton = { + render: args => {args.children} +}; + +export const WithIcons = { + render: Template, -export const WithIcons = Template.bind({}); -WithIcons.args = { - iconStart: SystemIcons.Close, - iconEnd: SystemIcons.ArrowRight + args: { + iconStart: SystemIcons.Close, + iconEnd: SystemIcons.ArrowRight + } }; -export const IconOnly = Template.bind({}); -IconOnly.args = { - iconStart: SystemIcons.Close, - ariaLabel: "Close", - children: "" +export const IconOnly = { + render: Template, + + args: { + iconStart: SystemIcons.Close, + ariaLabel: "Close", + children: "" + } }; -export const WithOnFocusAndOnBlur = Template.bind({}); -WithOnFocusAndOnBlur.args = { - onFocus: action("Button focused"), - onBlur: action("Button blurred") +export const WithOnFocusAndOnBlur = { + render: Template, + + args: { + onFocus: action("Button focused"), + onBlur: action("Button blurred") + } }; -export const UsedAsALink = Template.bind({}); -UsedAsALink.args = { - url: "www.d2iq.com" +export const UsedAsALink = { + render: Template, + + args: { + url: "www.d2iq.com" + } }; diff --git a/packages/button/stories/DropdownButton.stories.tsx b/packages/button/stories/DropdownButton.stories.tsx index e1d014197..198e1f21a 100644 --- a/packages/button/stories/DropdownButton.stories.tsx +++ b/packages/button/stories/DropdownButton.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { PrimaryDropdownButton, SecondaryDropdownButton, @@ -29,28 +29,40 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( {args.children} ); -export const _StandardDropdownButton = Template.bind({}); +export const _StandardDropdownButton = { + render: Template +}; -export const _PrimaryDropdownButton = args => ( - {args.children} -); +export const _PrimaryDropdownButton = { + render: args => ( + {args.children} + ) +}; -export const _SecondaryDropdownButton = args => ( - {args.children} -); +export const _SecondaryDropdownButton = { + render: args => ( + {args.children} + ) +}; -export const _SuccessDropdownButton = args => ( - {args.children} -); +export const _SuccessDropdownButton = { + render: args => ( + {args.children} + ) +}; -export const _WarningDropdownButton = args => ( - {args.children} -); +export const _WarningDropdownButton = { + render: args => ( + {args.children} + ) +}; -export const _DangerDropdownButton = args => ( - {args.children} -); +export const _DangerDropdownButton = { + render: args => ( + {args.children} + ) +}; diff --git a/packages/button/stories/ResetButton.stories.tsx b/packages/button/stories/ResetButton.stories.tsx index 3b37b50bf..24d9a60c2 100644 --- a/packages/button/stories/ResetButton.stories.tsx +++ b/packages/button/stories/ResetButton.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { ResetButton } from "../../"; import { Text } from "../../styleUtils/typography"; @@ -8,7 +8,7 @@ export default { component: ResetButton } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => (
{`The `} @@ -18,4 +18,6 @@ const Template: Story = args => (
); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; diff --git a/packages/card/stories/ButtonCard.stories.tsx b/packages/card/stories/ButtonCard.stories.tsx index 167b1cd32..e9680d578 100644 --- a/packages/card/stories/ButtonCard.stories.tsx +++ b/packages/card/stories/ButtonCard.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { action } from "@storybook/addon-actions"; import ButtonCard from "../components/ButtonCard"; @@ -20,40 +20,56 @@ export default { } } as Meta; -const Template: Story = args => default; +const Template: StoryFn = args => default; -export const Default = Template.bind({}); +export const Default = { + render: Template +}; + +export const Active = { + render: Template, -export const Active = Template.bind({}); -Active.args = { - isActive: true + args: { + isActive: true + } }; -export const Disabled = Template.bind({}); -Disabled.args = { - disabled: true +export const Disabled = { + render: Template, + + args: { + disabled: true + } }; -export const WithOnClick = Template.bind({}); -WithOnClick.args = { - onClick: action("button clicked") +export const WithOnClick = { + render: Template, + + args: { + onClick: action("button clicked") + } }; -export const ResponsivePaddingSize = Template.bind({}); -ResponsivePaddingSize.args = { - paddingSize: { - default: "s", - small: "m", - medium: "l", - large: "xl", - jumbo: "xxl" +export const ResponsivePaddingSize = { + render: Template, + + args: { + paddingSize: { + default: "s", + small: "m", + medium: "l", + large: "xl", + jumbo: "xxl" + } } }; -export const AspectRatio = args => ( -
- - I stay at a 2:1 aspect ratio - -
-); +export const AspectRatio = { + render: args => ( +
+ + I stay at a 2:1 aspect ratio + +
+ ) +}; diff --git a/packages/card/stories/Card.stories.tsx b/packages/card/stories/Card.stories.tsx index 800e4df4b..aacb5bce7 100644 --- a/packages/card/stories/Card.stories.tsx +++ b/packages/card/stories/Card.stories.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { ButtonCard, Card, LinkCard } from "../index"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { spacingSizeValues } from "../../storybookHelpers/controlConstants"; export default { @@ -27,49 +27,46 @@ export default { } } as Meta; -const Template: Story = args => {args.children}; +const Template: StoryFn = args => {args.children}; -export const Default = Template.bind({}); -Default.args = { - children: "Card Content" -}; +export const Default = { + render: Template, -export const ResponsivePaddingSize = Default.bind({}); -ResponsivePaddingSize.args = { - paddingSize: { - default: "s", - small: "m", - medium: "l", - large: "xl", - jumbo: "xxl" - }, - children: "Responsive Card Content" + args: { + children: "Card Content" + } }; -export const AspectRatio = args => ( -
- I stay at a 2:1 aspect ratio -
-); +export const ResponsivePaddingSize = { + render: Template, -AspectRatio.args = { aspectRatio: "2:1" }; + args: { + paddingSize: { + default: "s", + small: "m", + medium: "l", + large: "xl", + jumbo: "xxl" + }, + children: "Responsive Card Content" + } +}; -export const DefaultLinkCard = args => ( - - Default Link Card - -); +export const AspectRatio = { + render: Template, -export const WithHeaderImage = Template.bind({}); -WithHeaderImage.args = { - header: { - headerImg: "https://via.placeholder.com/1000", - headerImgAltText: "placeholder image", - size: "m" - }, - children: "Card Content" + args: { aspectRatio: "2:1" } }; -export const DefaultButtonCard = args => ( - Default Button Card -); +export const WithHeaderImage = { + render: Template, + + args: { + header: { + headerImg: "https://via.placeholder.com/1000", + headerImgAltText: "placeholder image", + size: "m" + }, + children: "Card Content" + } +}; diff --git a/packages/card/stories/LinkCard.stories.tsx b/packages/card/stories/LinkCard.stories.tsx index a2138acb3..d9db6463e 100644 --- a/packages/card/stories/LinkCard.stories.tsx +++ b/packages/card/stories/LinkCard.stories.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import LinkCard from "../components/LinkCard"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; export default { title: "Navigation/LinkCard", @@ -15,7 +15,7 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( ( ); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; + +export const ResponsivePaddingSize = { + render: Template, -export const ResponsivePaddingSize = Template.bind({}); -ResponsivePaddingSize.args = { - paddingSize: { - default: "s", - small: "m", - medium: "l", - large: "xl", - jumbo: "xxl" + args: { + paddingSize: { + default: "s", + small: "m", + medium: "l", + large: "xl", + jumbo: "xxl" + } } }; -export const AspectRatio = Template.bind({}); -AspectRatio.args = { - aspectRatio: [2, 1] +export const AspectRatio = { + render: Template, + + args: { + aspectRatio: [2, 1] + } }; diff --git a/packages/checkboxInput/stories/CheckboxInput.stories.tsx b/packages/checkboxInput/stories/CheckboxInput.stories.tsx index bfed5e96d..16cf66239 100644 --- a/packages/checkboxInput/stories/CheckboxInput.stories.tsx +++ b/packages/checkboxInput/stories/CheckboxInput.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import CheckboxInput from "../components/CheckboxInput"; import CheckboxStoryHelper from "../stories/helpers/CheckboxStoryHelper"; import { InputStoryWrapper } from "../../../decorators/inputStoryWrapper"; @@ -35,7 +35,7 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( {({ changeHandler, isChecked }) => ( ( ); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; diff --git a/packages/clickable/stories/clickable.stories.tsx b/packages/clickable/stories/clickable.stories.tsx index 9b44da413..38839d40a 100644 --- a/packages/clickable/stories/clickable.stories.tsx +++ b/packages/clickable/stories/clickable.stories.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import Clickable, { ClickableProps } from "../components/clickable"; import { action } from "@storybook/addon-actions"; @@ -16,10 +16,16 @@ export default { } } as Meta; -const Template: Story = args => ( - +const Template: StoryFn = args => ( + Clickable Text ); -export const Default = Template.bind({}); +export const Default = { + render: Template, + + args: { + action + } +}; diff --git a/packages/clicktocopybutton/stories/ClickToCopyButton.stories.tsx b/packages/clicktocopybutton/stories/ClickToCopyButton.stories.tsx index 70a1b4468..5eaf8ea97 100644 --- a/packages/clicktocopybutton/stories/ClickToCopyButton.stories.tsx +++ b/packages/clicktocopybutton/stories/ClickToCopyButton.stories.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { ClickToCopyButton } from "../"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { textColorPrimary } from "../../design-tokens/build/js/designTokens"; import { spacingSizeValues } from "../../storybookHelpers/controlConstants"; @@ -26,20 +26,26 @@ const onCopyFn = () => { const textToCopy = "Copy This!"; -const Template: Story = args => ( +const Template: StoryFn = args => ( ); -export const Default = Template.bind({}); -Default.args = { color: "red", iconSize: "xs" }; +export const Default = { + render: Template, + args: { iconSize: "xs" } +}; + +export const ShowCustomTooltipContentOnCopy = { + render: Template, -export const ShowCustomTooltipContentOnCopy = Default.bind({}); -ShowCustomTooltipContentOnCopy.args = { - tooltipContent: `"${textToCopy}" copied` + args: { + tooltipContent: `"${textToCopy}" copied` + } }; -export const WithCustomChildren = args => ( - -
{`Click here to copy the text: "${textToCopy}"`}
-
-); +export const WithCustomChildren = { + render: Template, + args: { + children:
{`Click here to copy the text: "${textToCopy}"`}
+ } +}; diff --git a/packages/codesnippet/stories/CodeSnippet.stories.tsx b/packages/codesnippet/stories/CodeSnippet.stories.tsx index ba8544ff3..6fb1fdd21 100644 --- a/packages/codesnippet/stories/CodeSnippet.stories.tsx +++ b/packages/codesnippet/stories/CodeSnippet.stories.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { CodeSnippet } from "../index"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { CodeSnippetProps } from "../components/CodeSnippet"; const snippet = `cd ui-kit && npm start`; @@ -20,34 +20,48 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( {args.children} ); -export const Default = Template.bind({}); -Default.parameters = { - controls: { exclude: ["textToCopy", "onCopy", "copyTooltipContent"] } -}; +export const Default = { + render: Template, -export const TextToCopy = Template.bind({}); -TextToCopy.args = { - textToCopy: snippet -}; -TextToCopy.parameters = { - controls: { exclude: ["copyTooltipContent", "onCopy"] } + parameters: { + controls: { exclude: ["textToCopy", "onCopy", "copyTooltipContent"] } + } }; -export const TextToCopyWithOnCopyCallback = Template.bind({}); -TextToCopyWithOnCopyCallback.args = { - textToCopy: snippet, - onCopy: () => alert("oncopy") +export const TextToCopy = { + render: Template, + + args: { + textToCopy: snippet + }, + + parameters: { + controls: { exclude: ["copyTooltipContent", "onCopy"] } + } }; -TextToCopyWithOnCopyCallback.parameters = { - controls: { exclude: ["copyTooltipContent"] } + +export const TextToCopyWithOnCopyCallback = { + render: Template, + + args: { + textToCopy: snippet, + onCopy: () => alert("oncopy") + }, + + parameters: { + controls: { exclude: ["copyTooltipContent"] } + } }; -export const TextToCopyAndCustomTooltipContentOnCopy = Template.bind({}); -TextToCopyAndCustomTooltipContentOnCopy.args = { - textToCopy: snippet, - copyTooltipContent: `"${snippet}" copied` +export const TextToCopyAndCustomTooltipContentOnCopy = { + render: Template, + + args: { + textToCopy: snippet, + copyTooltipContent: `"${snippet}" copied` + } }; diff --git a/packages/configurationmap/stories/ConfigurationMap.stories.tsx b/packages/configurationmap/stories/ConfigurationMap.stories.tsx index 417a9e817..da01eda13 100644 --- a/packages/configurationmap/stories/ConfigurationMap.stories.tsx +++ b/packages/configurationmap/stories/ConfigurationMap.stories.tsx @@ -1,6 +1,6 @@ import * as React from "react"; import { action } from "@storybook/addon-actions"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { ConfigurationMap, ConfigurationMapSection, @@ -30,7 +30,7 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( @@ -49,27 +49,31 @@ const Template: Story = args => ( ); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; -export const WithDefaultValue = args => ( - - - Heading - - Name - Jane Doe - - - Role - UX Designer - - - City - San Francisco - - - -); +export const WithDefaultValue = { + render: args => ( + + + Heading + + Name + Jane Doe + + + Role + UX Designer + + + City + San Francisco + + + + ) +}; export const MultipleSections = () => ( @@ -122,53 +126,57 @@ export const MultipleSections = () => ( ); -export const WithRowActionShownOnHover = args => ( - - - - Name - Jane Doe - - Action - - - - Role - UX Designer - - Action - - - - City - San Francisco - - Action - - - - -); +export const WithRowActionShownOnHover = { + render: args => ( + + + + Name + Jane Doe + + Action + + + + Role + UX Designer + + Action + + + + City + San Francisco + + Action + + + + + ) +}; -export const WithLongValue = args => ( - - - - Name - Jane Doe - - - Role - UX Designer - - - - {Array(100).fill("VeryLongWord").join("")} - - - {Array(100).fill("VeryLongWord").join("")} - - - - -); +export const WithLongValue = { + render: args => ( + + + + Name + Jane Doe + + + Role + UX Designer + + + + {Array(100).fill("VeryLongWord").join("")} + + + {Array(100).fill("VeryLongWord").join("")} + + + + + ) +}; diff --git a/packages/configurationmap/stories/HashMap.stories.tsx b/packages/configurationmap/stories/HashMap.stories.tsx index f22f0023a..4acd2c244 100644 --- a/packages/configurationmap/stories/HashMap.stories.tsx +++ b/packages/configurationmap/stories/HashMap.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { HashMap } from "../index"; import { configurationMapStoryWrapper } from "./helpers/ConfigurationMapStoryWrapper"; @@ -22,7 +22,7 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( ( /> ); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; -export const WithNestedObjects = args => ( - ( + -); + }} + headline="Jane Doe Info" + {...args} + /> + ) +}; -export const WithRenderKeys = args => ( - -); +export const WithRenderKeys = { + render: args => ( + + ) +}; diff --git a/packages/donutChart/stories/DonutChart.stories.tsx b/packages/donutChart/stories/DonutChart.stories.tsx index 6a0875754..dcd595e52 100644 --- a/packages/donutChart/stories/DonutChart.stories.tsx +++ b/packages/donutChart/stories/DonutChart.stories.tsx @@ -27,28 +27,36 @@ const Template = args => ( ); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; + +export const WithCenterLabelText = { + render: Template, -export const WithCenterLabelText = Template.bind({}); -WithCenterLabelText.args = { - label: "25%", - text: "1 of 4" + args: { + label: "25%", + text: "1 of 4" + } }; -export const MultipleSegments = Template.bind({}); -MultipleSegments.args = { - data: [ - { - percentage: 10, - color: purple - }, - { - percentage: 30, - color: pink - }, - { - percentage: 20, - color: blue - } - ] +export const MultipleSegments = { + render: Template, + + args: { + data: [ + { + percentage: 10, + color: purple + }, + { + percentage: 30, + color: pink + }, + { + percentage: 20, + color: blue + } + ] + } }; diff --git a/packages/dropdownMenu/stories/Dropdown.stories.tsx b/packages/dropdownMenu/stories/Dropdown.stories.tsx index 3caf510d7..974aecdc2 100644 --- a/packages/dropdownMenu/stories/Dropdown.stories.tsx +++ b/packages/dropdownMenu/stories/Dropdown.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { DropdownMenu, DropdownSection, @@ -45,7 +45,7 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( Menu} {...args} @@ -67,97 +67,111 @@ const Template: Story = args => ( ); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; -export const WithDangerousAction = args => ( - Menu} - {...args} - > - - - Edit - - - Scale - - - Restart - - - Stop - - - Delete - - - -); +export const WithDangerousAction = { + render: args => ( + Menu} + {...args} + > + + + Edit + + + Scale + + + Restart + + + Stop + + + Delete + + + + ) +}; -export const WithDisabledAction = args => ( - Menu} - {...args} - > - - - Edit - - - Scale - - - Restart - - - Stop - - - Delete - - - -); +export const WithDisabledAction = { + render: args => ( + Menu} + {...args} + > + + + Edit + + + Scale + + + Restart + + + Stop + + + Delete + + + + ) +}; + +export const InitialIsOpen = { + render: Template, -export const InitialIsOpen = Template.bind({}); -InitialIsOpen.args = { - initialIsOpen: true + args: { + initialIsOpen: true + } }; -export const MenuHasMaxHeight = Template.bind({}); -MenuHasMaxHeight.args = { - menuMaxHeight: 90 +export const MenuHasMaxHeight = { + render: Template, + + args: { + menuMaxHeight: 90 + } }; -export const MenuHasMaxWidth = args => ( - Menu} - {...args} - > - - - Donaudampfschifffahrtselektrizitätenhauptbetriebswerkbauunterbeamtengesellschaft - - - Edit - - - Scale - - - Restart - - - Stop - - - -); +export const MenuHasMaxWidth = { + render: args => ( + Menu} + {...args} + > + + + Donaudampfschifffahrtselektrizitätenhauptbetriebswerkbauunterbeamtengesellschaft + + + Edit + + + Scale + + + Restart + + + Stop + + + + ) +}; const onSelect = selectedItem => { alert(`onSelect called with: @@ -167,220 +181,234 @@ const onSelect = selectedItem => { `); }; -export const WithOnSelectCallback = Template.bind({}); -WithOnSelectCallback.args = { - onSelect +export const WithOnSelectCallback = { + render: Template, + + args: { + onSelect + } }; -export const WithSections = args => ( - Menu} - {...args} - > - - - Edit - - - Scale - - +export const WithSections = { + render: args => ( + Menu} + {...args} + > + + + Edit + + + Scale + + - - - Restart - - - Restart Delay - - + + + Restart + + + Restart Delay + + - - - Pause - - - Stop - - - -); + + + Pause + + + Stop + + + + ) +}; -export const WithIconsAndAvatarsPositionStart = args => ( - Menu} - {...args} - > - - - - Edit - - - - Scale - - - - Restart - - - - Stop - - +export const WithIconsAndAvatarsPositionStart = { + render: args => ( + Menu} + {...args} + > + + + + Edit + + + + Scale + + + + Restart + + + + Stop + + - - - - Grafana - - - - Kibana - - - - Kubernetes - - - -); + + + + Grafana + + + + Kibana + + + + Kubernetes + + + + ) +}; -export const WithIconsAndAvatarsPositionEnd = args => ( - Menu} - {...args} - > - - - - Edit - - - - Scale - - - - Restart - - - - Stop - - +export const WithIconsAndAvatarsPositionEnd = { + render: args => ( + Menu} + {...args} + > + + + + Edit + + + + Scale + + + + Restart + + + + Stop + + - - - - Grafana - - - - Kibana - - - - Kubernetes - - - -); + + + + Grafana + + + + Kibana + + + + Kubernetes + + + + ) +}; -export const WithFooterSection = args => ( - Workspaces} - {...args} - > - - - - Global - - - - - - Default Workspace - - - - Management Cluster Workspace - - - - Workspace 1 - - - - Workspace 2 - - - - Workspace 3 - - - - Workspace 4 - - - - Workspace 5 - - - - Workspace 6 - - - - Workspace 7 - - - - Workspace 8 - - - - Workspace 9 - - - - Workspace 10 - - - - Workspace 11 - - - - Workspace 12 - - - - Workspace 13 - - - - Workspace 14 - - - - Workspace 15 - - +export const WithFooterSection = { + render: args => ( + Workspaces} + {...args} + > + + + + Global + + + + + + Default Workspace + + + + Management Cluster Workspace + + + + Workspace 1 + + + + Workspace 2 + + + + Workspace 3 + + + + Workspace 4 + + + + Workspace 5 + + + + Workspace 6 + + + + Workspace 7 + + + + Workspace 8 + + + + Workspace 9 + + + + Workspace 10 + + + + Workspace 11 + + + + Workspace 12 + + + + Workspace 13 + + + + Workspace 14 + + + + Workspace 15 + + - - - Create Workspace - - - Manage Workspaces - - - -); + + + Create Workspace + + + Manage Workspaces + + + + ) +}; diff --git a/packages/dropdownable/stories/Dropdownable.stories.tsx b/packages/dropdownable/stories/Dropdownable.stories.tsx index d6dec4dfb..b504ed84f 100644 --- a/packages/dropdownable/stories/Dropdownable.stories.tsx +++ b/packages/dropdownable/stories/Dropdownable.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import Dropdownable from "../components/Dropdownable"; import DropdownStory from "./helpers/DropdownStory"; @@ -30,17 +30,21 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( Change dropdown orientation using Controls ); -export const Default = Template.bind({}); -export const WithMultipleDirectionPreferences = args => { - return ( - - Open the dropdown before and after expanding the height - - ); +export const Default = { + render: Template +}; +export const WithMultipleDirectionPreferences = { + render: args => { + return ( + + Open the dropdown before and after expanding the height + + ); + } }; diff --git a/packages/expandable/stories/Expandable.stories.tsx b/packages/expandable/stories/Expandable.stories.tsx index 5b00aca66..9012eda68 100644 --- a/packages/expandable/stories/Expandable.stories.tsx +++ b/packages/expandable/stories/Expandable.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import Expandable from "../components/Expandable"; export default { @@ -7,10 +7,12 @@ export default { component: Expandable } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => (
Check out this exciting content
); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; diff --git a/packages/formStructure/stories/fieldGroup.stories.tsx b/packages/formStructure/stories/fieldGroup.stories.tsx index 8d221804f..e129ff5ae 100644 --- a/packages/formStructure/stories/fieldGroup.stories.tsx +++ b/packages/formStructure/stories/fieldGroup.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { FieldGroup } from ".."; import { TextInput } from "../../textInput"; @@ -16,7 +16,7 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( @@ -24,12 +24,17 @@ const Template: Story = args => ( ); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; + +export const ResponsiveLayout = { + render: Template, -export const ResponsiveLayout = Template.bind({}); -ResponsiveLayout.args = { - direction: { - default: "column", - small: "row" + args: { + direction: { + default: "column", + small: "row" + } } }; diff --git a/packages/formStructure/stories/fieldList.stories.tsx b/packages/formStructure/stories/fieldList.stories.tsx index 7aa3bce7f..c8319d0ab 100644 --- a/packages/formStructure/stories/fieldList.stories.tsx +++ b/packages/formStructure/stories/fieldList.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { action } from "@storybook/addon-actions"; import { FieldList, @@ -47,7 +47,7 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( {({ onRemoveItem, onAddItem, onFieldUpdate, items }) => ( <> @@ -110,10 +110,41 @@ const Template: Story = args => ( ); -export const EditableFieldsControlledInputs = Template.bind({}); +export const EditableFieldsControlledInputs = { + render: Template +}; + +export const DefaultUncontrolledInputs = { + render: args => { + return ( + + + {({ defaultProps, onChange, value }) => ( + + )} + + + {({ defaultProps, onChange, value }) => ( + + )} + + + {({ defaultProps, onChange, value }) => ( + + )} + + + ); + } +}; -export const DefaultUncontrolledInputs = args => { - return ( +export const VariedColumnWidths = { + render: args => ( { )} - + {({ defaultProps, onChange, value }) => ( )} - + {({ defaultProps, onChange, value }) => ( )} - ); + ) }; -export const VariedColumnWidths = args => ( - - - {({ defaultProps, onChange, value }) => ( - - )} - - - {({ defaultProps, onChange, value }) => ( - - )} - - - {({ defaultProps, onChange, value }) => ( - - )} - - -); - -export const DisabledRows = args => ( - - - {({ disabled, defaultProps, onChange, value }) => ( - - )} - - - {({ disabled, defaultProps, onChange, value }) => ( - - )} - - - {({ disabled, defaultProps, onChange, value }) => ( - - )} - - -); +export const DisabledRows = { + render: args => ( + + + {({ disabled, defaultProps, onChange, value }) => ( + + )} + + + {({ disabled, defaultProps, onChange, value }) => ( + + )} + + + {({ disabled, defaultProps, onChange, value }) => ( + + )} + + + ) +}; export const WAddButton = () => ( @@ -263,39 +271,41 @@ export const WAddButton = () => ( ); -export const WithColumnSeparators = args => ( - - - {({ defaultProps, onChange, value }) => ( - - )} - - : - - {({ defaultProps, onChange, value }) => ( - - )} - - 👉 - - {({ defaultProps, onChange, value }) => ( - - )} - - -); +export const WithColumnSeparators = { + render: args => ( + + + {({ defaultProps, onChange, value }) => ( + + )} + + : + + {({ defaultProps, onChange, value }) => ( + + )} + + 👉 + + {({ defaultProps, onChange, value }) => ( + + )} + + + ) +}; diff --git a/packages/formStructure/stories/formStructure.stories.tsx b/packages/formStructure/stories/formStructure.stories.tsx index f30610724..1db65de3e 100644 --- a/packages/formStructure/stories/formStructure.stories.tsx +++ b/packages/formStructure/stories/formStructure.stories.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import { Story, Meta } from "@storybook/react"; +import { StoryFn, Meta } from "@storybook/react"; import { FormMessage, FormSection, @@ -38,149 +38,167 @@ export default { } } as Meta; -const Template: Story = args => ( +const Template: StoryFn = args => ( Form Title
Form sections go here
); -export const Default = Template.bind({}); +export const Default = { + render: Template +}; + +export const _FormMessage = { + render: args => { + return ( + + + Use the Control panel to change the appearance of the message. + + Form Title +
Form sections go here
+
+ ); + } +}; -export const _FormMessage = args => { - return ( +export const _FormSection = { + render: args => ( - - Use the Control panel to change the appearance of the message. - - Form Title -
Form sections go here
+ + + + + + +
- ); + ) }; -export const _FormSection = args => ( - - - - - - - - - -); +export const FormSectionWithHeaderAndFooter = { + render: args => ( + + + + + + + + + + + Here is a caption with supporting info about this section of the + form + + + + + ) +}; -export const FormSectionWithHeaderAndFooter = args => ( - - - - +export const _FormSubSection = { + render: args => ( + + - - - - Here is a caption with supporting info about this section of the form - - - - -); - -export const _FormSubSection = args => ( - - - - - - - -); - -export const RelatedFormSubSectionsGroupedInAFormSection = args => ( - - - - - - - - - - - - - - - - - -); + + + ) +}; -export const ExampleFormLayout = args => ( - - - There are already a bunch of teams. Are you sure you want another one? - - Team Generator - - - -