-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
82 changed files
with
630 additions
and
3 deletions.
There are no files selected for viewing
Binary file added
BIN
+14.1 KB
...s/components/Banner.test.ts-snapshots/Banner-Critical-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.4 KB
...shots/components/Banner.test.ts-snapshots/Banner-Critical-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14 KB
...omponents/Banner.test.ts-snapshots/Banner-Critical-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.9 KB
...ht/snapshots/components/Banner.test.ts-snapshots/Banner-Critical-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.2 KB
...s/components/Banner.test.ts-snapshots/Banner-Critical-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14 KB
.../components/Banner.test.ts-snapshots/Banner-Critical-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.1 KB
...mponents/Banner.test.ts-snapshots/Banner-Critical-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.9 KB
...t/snapshots/components/Banner.test.ts-snapshots/Banner-Critical-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.9 KB
.../components/Banner.test.ts-snapshots/Banner-Critical-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.7 KB
...ts/components/Banner.test.ts-snapshots/Banner-Dismiss-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.9 KB
...pshots/components/Banner.test.ts-snapshots/Banner-Dismiss-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
...components/Banner.test.ts-snapshots/Banner-Dismiss-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
...ght/snapshots/components/Banner.test.ts-snapshots/Banner-Dismiss-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.7 KB
...ts/components/Banner.test.ts-snapshots/Banner-Dismiss-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.4 KB
...s/components/Banner.test.ts-snapshots/Banner-Dismiss-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
...omponents/Banner.test.ts-snapshots/Banner-Dismiss-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.4 KB
...ht/snapshots/components/Banner.test.ts-snapshots/Banner-Dismiss-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.4 KB
...s/components/Banner.test.ts-snapshots/Banner-Dismiss-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.7 KB
...shots/components/Banner.test.ts-snapshots/Banner-Info-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.9 KB
...snapshots/components/Banner.test.ts-snapshots/Banner-Info-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
...ts/components/Banner.test.ts-snapshots/Banner-Info-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
...wright/snapshots/components/Banner.test.ts-snapshots/Banner-Info-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.7 KB
...shots/components/Banner.test.ts-snapshots/Banner-Info-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.4 KB
...hots/components/Banner.test.ts-snapshots/Banner-Info-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.5 KB
...s/components/Banner.test.ts-snapshots/Banner-Info-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.4 KB
...right/snapshots/components/Banner.test.ts-snapshots/Banner-Info-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
...hots/components/Banner.test.ts-snapshots/Banner-Info-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...ts/components/Banner.test.ts-snapshots/Banner-Success-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.8 KB
...pshots/components/Banner.test.ts-snapshots/Banner-Success-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
...components/Banner.test.ts-snapshots/Banner-Success-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
...ght/snapshots/components/Banner.test.ts-snapshots/Banner-Success-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...ts/components/Banner.test.ts-snapshots/Banner-Success-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
...s/components/Banner.test.ts-snapshots/Banner-Success-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.6 KB
...omponents/Banner.test.ts-snapshots/Banner-Success-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
...ht/snapshots/components/Banner.test.ts-snapshots/Banner-Success-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
...s/components/Banner.test.ts-snapshots/Banner-Success-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.2 KB
.../components/Banner.test.ts-snapshots/Banner-TitleOnly-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
...hots/components/Banner.test.ts-snapshots/Banner-TitleOnly-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
...mponents/Banner.test.ts-snapshots/Banner-TitleOnly-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+13.9 KB
...t/snapshots/components/Banner.test.ts-snapshots/Banner-TitleOnly-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.2 KB
.../components/Banner.test.ts-snapshots/Banner-TitleOnly-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
...components/Banner.test.ts-snapshots/Banner-TitleOnly-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
...ponents/Banner.test.ts-snapshots/Banner-TitleOnly-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
.../snapshots/components/Banner.test.ts-snapshots/Banner-TitleOnly-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+14 KB
...components/Banner.test.ts-snapshots/Banner-TitleOnly-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.8 KB
...ots/components/Banner.test.ts-snapshots/Banner-Upsell-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.9 KB
...apshots/components/Banner.test.ts-snapshots/Banner-Upsell-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
.../components/Banner.test.ts-snapshots/Banner-Upsell-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
...ight/snapshots/components/Banner.test.ts-snapshots/Banner-Upsell-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.8 KB
...ots/components/Banner.test.ts-snapshots/Banner-Upsell-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
...ts/components/Banner.test.ts-snapshots/Banner-Upsell-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.6 KB
...components/Banner.test.ts-snapshots/Banner-Upsell-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
...ght/snapshots/components/Banner.test.ts-snapshots/Banner-Upsell-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.4 KB
...ts/components/Banner.test.ts-snapshots/Banner-Upsell-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
...ts/components/Banner.test.ts-snapshots/Banner-Warning-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...pshots/components/Banner.test.ts-snapshots/Banner-Warning-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.2 KB
...components/Banner.test.ts-snapshots/Banner-Warning-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.2 KB
...ght/snapshots/components/Banner.test.ts-snapshots/Banner-Warning-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
...ts/components/Banner.test.ts-snapshots/Banner-Warning-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.3 KB
...s/components/Banner.test.ts-snapshots/Banner-Warning-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.3 KB
...omponents/Banner.test.ts-snapshots/Banner-Warning-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.3 KB
...ht/snapshots/components/Banner.test.ts-snapshots/Banner-Warning-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.3 KB
...s/components/Banner.test.ts-snapshots/Banner-Warning-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.8 KB
.../components/Banner.test.ts-snapshots/Banner-WithTitle-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+16 KB
...hots/components/Banner.test.ts-snapshots/Banner-WithTitle-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.5 KB
...mponents/Banner.test.ts-snapshots/Banner-WithTitle-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.5 KB
...t/snapshots/components/Banner.test.ts-snapshots/Banner-WithTitle-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.8 KB
.../components/Banner.test.ts-snapshots/Banner-WithTitle-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
...components/Banner.test.ts-snapshots/Banner-WithTitle-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
...ponents/Banner.test.ts-snapshots/Banner-WithTitle-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
.../snapshots/components/Banner.test.ts-snapshots/Banner-WithTitle-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
...components/Banner.test.ts-snapshots/Banner-WithTitle-light-tritanopia-linux.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import {test, expect} from '@playwright/test' | ||
import {visit} from '../test-helpers/storybook' | ||
import {themes} from '../test-helpers/themes' | ||
|
||
const stories = [ | ||
// { | ||
// title: 'Default', | ||
// id: 'drafts-components-banner--default', | ||
// }, | ||
{ | ||
title: 'Critical', | ||
id: 'drafts-components-banner-features--critical', | ||
}, | ||
{ | ||
title: 'Info', | ||
id: 'drafts-components-banner-features--info', | ||
}, | ||
{ | ||
title: 'Success', | ||
id: 'drafts-components-banner-features--success', | ||
}, | ||
{ | ||
title: 'Upsell', | ||
id: 'drafts-components-banner-features--upsell', | ||
}, | ||
{ | ||
title: 'Warning', | ||
id: 'drafts-components-banner-features--warning', | ||
}, | ||
{ | ||
title: 'Dismiss', | ||
id: 'drafts-components-banner-features--dismiss', | ||
}, | ||
{ | ||
title: 'TitleOnly', | ||
id: 'drafts-components-banner-features--title-only', | ||
}, | ||
{ | ||
title: 'WithTitle', | ||
id: 'drafts-components-banner-features--with-title', | ||
}, | ||
{ | ||
title: 'WithActions', | ||
id: 'drafts-components-banner-features--with-actions', | ||
}, | ||
] | ||
|
||
test.describe('Banner', () => { | ||
for (const story of stories) { | ||
test.describe(story.title, () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Banner.${story.title}.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
}) | ||
} | ||
|
||
// Responsive | ||
test('Responsive behavior', async ({page}) => { | ||
await visit(page, { | ||
id: 'drafts-components-banner--default', | ||
}) | ||
|
||
// Small | ||
// await page.setViewportSize({width: 375, height: 667}) | ||
// expect(await page.screenshot()).toMatchSnapshot('Banner.Responsive.Small.png') | ||
|
||
// Medium | ||
// await page.setViewportSize({width: 1024, height: 768}) | ||
// expect(await page.screenshot()).toMatchSnapshot('Banner.Responsive.Medium.png') | ||
|
||
// Large | ||
// await page.setViewportSize({width: 1024, height: 768}) | ||
// expect(await page.screenshot()).toMatchSnapshot('Banner.Responsive.Large.png') | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"id": "banner", | ||
"name": "Banner", | ||
"status": "draft", | ||
"a11yReviewed": false, | ||
"stories": [], | ||
"props": [ | ||
{ | ||
"name": "onDismiss", | ||
"type": "() => void", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "icon", | ||
"type": "", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "title", | ||
"type": "", | ||
"description": "" | ||
}, | ||
{ | ||
"name": "variant", | ||
"type": "", | ||
"description": "" | ||
} | ||
], | ||
"subcomponents": [ | ||
{ | ||
"name": "Banner.Description", | ||
"props": [] | ||
}, | ||
{ | ||
"name": "Banner.Actions", | ||
"props": [] | ||
}, | ||
{ | ||
"name": "Banner.PrimaryAction", | ||
"props": [] | ||
}, | ||
{ | ||
"name": "Banner.SecondaryAction", | ||
"props": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
import {Banner} from '../Banner' | ||
import {action} from '@storybook/addon-actions' | ||
import Link from '../Link' | ||
import type {Meta} from '@storybook/react' | ||
|
||
const meta = { | ||
title: 'Drafts/Components/Banner/Features', | ||
component: Banner, | ||
} satisfies Meta<typeof Banner> | ||
|
||
export default meta | ||
|
||
export const Critical = () => { | ||
return ( | ||
<Banner variant="critical"> | ||
<Banner.Description> | ||
GitHub users are{' '} | ||
<Link inline underline href="#"> | ||
now required | ||
</Link>{' '} | ||
to enable two-factor authentication as an additional security measure. | ||
</Banner.Description> | ||
</Banner> | ||
) | ||
} | ||
|
||
export const Info = () => { | ||
return ( | ||
<Banner onDismiss={action('onDismiss')} variant="info"> | ||
<Banner.Description> | ||
GitHub users are{' '} | ||
<Link inline underline href="#"> | ||
now required | ||
</Link>{' '} | ||
to enable two-factor authentication as an additional security measure. | ||
</Banner.Description> | ||
</Banner> | ||
) | ||
} | ||
|
||
export const Success = () => { | ||
return ( | ||
<Banner onDismiss={action('onDismiss')} variant="success"> | ||
<Banner.Description> | ||
GitHub users are{' '} | ||
<Link inline underline href="#"> | ||
now required | ||
</Link>{' '} | ||
to enable two-factor authentication as an additional security measure. | ||
</Banner.Description> | ||
</Banner> | ||
) | ||
} | ||
|
||
export const Upsell = () => { | ||
return ( | ||
<Banner onDismiss={action('onDismiss')} variant="upsell"> | ||
<Banner.Description> | ||
GitHub users are{' '} | ||
<Link inline underline href="#"> | ||
now required | ||
</Link>{' '} | ||
to enable two-factor authentication as an additional security measure. | ||
</Banner.Description> | ||
</Banner> | ||
) | ||
} | ||
|
||
export const Warning = () => { | ||
return ( | ||
<Banner onDismiss={action('onDismiss')} variant="warning"> | ||
<Banner.Description> | ||
GitHub users are{' '} | ||
<Link inline underline href="#"> | ||
now required | ||
</Link>{' '} | ||
to enable two-factor authentication as an additional security measure. | ||
</Banner.Description> | ||
</Banner> | ||
) | ||
} | ||
|
||
export const Dismiss = () => { | ||
return ( | ||
<Banner onDismiss={action('onDismiss')}> | ||
<Banner.Description> | ||
GitHub users are{' '} | ||
<Link inline underline href="#"> | ||
now required | ||
</Link>{' '} | ||
to enable two-factor authentication as an additional security measure. | ||
</Banner.Description> | ||
</Banner> | ||
) | ||
} | ||
|
||
export const TitleOnly = () => { | ||
return ( | ||
<Banner | ||
title={ | ||
<> | ||
GitHub users are{' '} | ||
<Link inline underline href="#"> | ||
now required | ||
</Link>{' '} | ||
to enable two-factor authentication as an additional security measure. | ||
</> | ||
} | ||
variant="warning" | ||
/> | ||
) | ||
} | ||
|
||
export const WithTitle = () => { | ||
return ( | ||
<Banner title="This is a title" variant="warning"> | ||
<Banner.Description> | ||
GitHub users are{' '} | ||
<Link inline underline href="#"> | ||
now required | ||
</Link>{' '} | ||
to enable two-factor authentication as an additional security measure. | ||
</Banner.Description> | ||
</Banner> | ||
) | ||
} | ||
|
||
export const WithActions = () => { | ||
return ( | ||
<Banner title="This is a title" variant="warning"> | ||
<Banner.Description> | ||
GitHub users are{' '} | ||
<Link inline underline href="#"> | ||
now required | ||
</Link>{' '} | ||
to enable two-factor authentication as an additional security measure. | ||
</Banner.Description> | ||
<Banner.Actions> | ||
<Banner.PrimaryAction>Button</Banner.PrimaryAction> | ||
<Banner.SecondaryAction>Button</Banner.SecondaryAction> | ||
</Banner.Actions> | ||
</Banner> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import type {Meta, StoryObj} from '@storybook/react' | ||
import React from 'react' | ||
import {Button} from '../Button' | ||
import Link from '../Link' | ||
import {Banner} from '../Banner' | ||
import {action} from '@storybook/addon-actions' | ||
|
||
const meta = { | ||
title: 'Drafts/Components/Banner', | ||
component: Banner, | ||
} satisfies Meta<typeof Banner> | ||
|
||
export default meta | ||
|
||
export const Default = () => { | ||
return ( | ||
<Banner title="This is a title" onDismiss={action('onDismiss')}> | ||
<Banner.Description> | ||
GitHub users are{' '} | ||
<Link inline href="#"> | ||
now required | ||
</Link>{' '} | ||
to enable two-factor authentication as an additional security measure. | ||
</Banner.Description> | ||
<Banner.Actions> | ||
<Button>Button</Button> | ||
<Button variant="invisible">Button</Button> | ||
</Banner.Actions> | ||
</Banner> | ||
) | ||
} | ||
|
||
export const Playground: StoryObj<typeof Banner> = { | ||
render: ({onDismiss, variant, ...rest}) => { | ||
return ( | ||
<Banner | ||
{...rest} | ||
title="This is the title" | ||
onDismiss={onDismiss ? action('onDismiss') : undefined} | ||
variant={variant} | ||
> | ||
<Banner.Description> | ||
GitHub users are{' '} | ||
<Link inline underline href="#"> | ||
now required | ||
</Link>{' '} | ||
to enable two-factor authentication as an additional security measure. | ||
</Banner.Description> | ||
</Banner> | ||
) | ||
}, | ||
argTypes: { | ||
onDismiss: { | ||
controls: { | ||
type: 'boolean', | ||
}, | ||
defaultValue: false, | ||
}, | ||
variant: { | ||
controls: { | ||
type: 'radio', | ||
}, | ||
options: ['critical', 'info', 'success', 'upsell', 'warning'], | ||
}, | ||
}, | ||
} |
Oops, something went wrong.