diff --git a/src/components/NoticeBar.stories.ts b/src/components/NoticeBar.stories.ts index 1f59c2f..d9ba9e9 100644 --- a/src/components/NoticeBar.stories.ts +++ b/src/components/NoticeBar.stories.ts @@ -11,65 +11,71 @@ const meta: Meta = { component: NoticeBar, // This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/writing-docs/autodocs tags: ['autodocs'], + argTypes: { + type: { control: 'select', options: Object.values(NoticeBarTypes) }, + default: { control: 'text' }, + }, args: { default: 'Hello World!', + type: NoticeBarTypes.Info, }, }; export default meta; type Story = StoryObj; -export const Info: Story = { +export const Standard: Story = { args: { default: 'You have 10,000 new emails.', - type: NoticeBarTypes.Info, + }, + parameters: { + docs: { + source: { + code: 'You have 10,000 new emails.', + }, + }, }, }; -export const InfoWithCTA: Story = { - args: { - default: 'You have 10,000 new emails.', - type: NoticeBarTypes.Info, - }, - render: (args) => ({ +export const CTAControls: Story = { + render: () => ({ components: { NoticeBar, PrimaryButton, LinkButton }, - setup() { - return { args }; - }, template: ` - - {{ args.default }} + + This form is dirty. - + `, }), -}; - -export const Success: Story = { - args: { - default: 'You have 10,000 new emails.', - type: NoticeBarTypes.Success, - }, -}; - -export const Warning: Story = { - args: { - default: 'You have 10,000 new emails.', - type: NoticeBarTypes.Warning, + parameters: { + docs: { + source: { + code: '\n This form is dirty.\n\n \n', + }, + }, }, }; -export const Critical: Story = { - args: { - default: 'You have 10,000 new emails.', - type: NoticeBarTypes.Critical, +export const Type: Story = { + render: () => ({ + components: { NoticeBar, PrimaryButton, LinkButton }, + template: `
+ You have unread emails. + You have no new emails. + You have 10 new emails. + You have 10,000 new emails. +
+ `, + }), + parameters: { + docs: { + source: { + code: 'You have unread emails.\nYou have no new emails.\nYou have 10 new emails.\nYou have 10,000 new emails.', + }, + }, }, };