-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Storybook type annotations (#1091)
## What are you changing? - Updates type annotations in Source Storybook stories. ## Why? - All of the stories have a number of type errors. Whilst these (mostly) don't prevent the stories from running or rendering in Chromatic, the errors create a lot of visual noise in the code editor and can cause confusion when working on them.
- Loading branch information
Showing
57 changed files
with
1,040 additions
and
689 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
.../source-react-components-development-kitchen/.storybook/preview/FocusManagerDecorator.tsx
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
3 changes: 2 additions & 1 deletion
3
...source-react-components-development-kitchen/.storybook/preview/ThemeProviderDecorator.tsx
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
26 changes: 16 additions & 10 deletions
26
...ardian/source-react-components-development-kitchen/src/age-warning/AgeWarning.stories.tsx
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 |
---|---|---|
@@ -1,36 +1,42 @@ | ||
import type { Story } from '@storybook/react'; | ||
import type { Meta, StoryFn } from '@storybook/react'; | ||
import type { AgeWarningProps } from './AgeWarning'; | ||
import { AgeWarning } from './AgeWarning'; | ||
|
||
export default { | ||
const meta: Meta<typeof AgeWarning> = { | ||
component: AgeWarning, | ||
title: 'AgeWarning', | ||
}; | ||
|
||
const Template: Story<AgeWarningProps> = (args: AgeWarningProps) => ( | ||
export default meta; | ||
|
||
const Template: StoryFn<typeof AgeWarning> = (args: AgeWarningProps) => ( | ||
<AgeWarning {...args} /> | ||
); | ||
|
||
export const ageWarning = Template.bind({}); | ||
export const ageWarning: StoryFn<typeof AgeWarning> = Template.bind({}); | ||
ageWarning.args = { age: '10 years old' }; | ||
|
||
export const smallWarning = Template.bind({}); | ||
export const smallWarning: StoryFn<typeof AgeWarning> = Template.bind({}); | ||
smallWarning.args = { age: '5 months old', size: 'small' }; | ||
|
||
export const screenReaderVersion = Template.bind({}); | ||
export const screenReaderVersion: StoryFn<typeof AgeWarning> = Template.bind( | ||
{}, | ||
); | ||
screenReaderVersion.args = { | ||
age: '20 million years old', | ||
isScreenReader: true, | ||
}; | ||
|
||
export const missingOldText = Template.bind({}); | ||
export const missingOldText: StoryFn<typeof AgeWarning> = Template.bind({}); | ||
missingOldText.args = { age: '5 years' }; | ||
|
||
export const emptyWarningPrefix = Template.bind({}); | ||
export const emptyWarningPrefix: StoryFn<typeof AgeWarning> = Template.bind({}); | ||
emptyWarningPrefix.args = { age: '5 years', warningPrefix: '' }; | ||
|
||
export const customWarningPrefix = Template.bind({}); | ||
export const customWarningPrefix: StoryFn<typeof AgeWarning> = Template.bind( | ||
{}, | ||
); | ||
customWarningPrefix.args = { age: '5 years', warningPrefix: 'This book is ' }; | ||
|
||
export const supportsDarkMode = Template.bind({}); | ||
export const supportsDarkMode: StoryFn<typeof AgeWarning> = Template.bind({}); | ||
supportsDarkMode.args = { age: '10 years old', supportsDarkMode: true }; |
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
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
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
Oops, something went wrong.