Skip to content

Commit

Permalink
fix: correct misaligned types in story files
Browse files Browse the repository at this point in the history
  • Loading branch information
booc0mtaco committed Aug 17, 2023
1 parent a89347e commit 05d0836
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
9 changes: 3 additions & 6 deletions src/components/Select/Select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ export const OpenByDefault: StoryObj = {
play: selectCat,
};

export const WithSelectedOption: StoryObj = {
export const WithSelectedOption: StoryObj<typeof Select> = {
parameters: {
docs: {
source: {
Expand All @@ -421,14 +421,11 @@ export const WithSelectedOption: StoryObj = {
},
},
},
args: {
value: exampleOptions[0],
},
render: ({ value }) => (
render: () => (
<InteractiveExampleUsingChildren
aria-label="Favorite Animal"
labelComponent={<Select.Label>Favorite Animal</Select.Label>}
value={value}
value={exampleOptions[0]}
/>
),
};
16 changes: 9 additions & 7 deletions src/components/Toggle/Toggle.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const InteractiveToggle = ({ checked = false, onChange, ...other }: Args) => {
);
};

export default {
const meta: Meta<typeof Toggle> = {
title: 'Components/Toggle',
component: Toggle,
args: {
Expand All @@ -30,30 +30,32 @@ export default {
badges: ['1.0', BADGE.BETA],
},
render: (args) => <InteractiveToggle {...args} />,
} as Meta<Args>;
};

export default meta;
type Args = React.ComponentProps<typeof Toggle>;
type Story = StoryObj<typeof Toggle>;

export const Default: StoryObj<Args> = {};
export const Default: Story = {};

export const CheckedTrue: StoryObj<Args> = {
export const CheckedTrue: Story = {
args: {
checked: true,
},
};
export const Disabled: StoryObj<Args> = {
export const Disabled: Story = {
args: {
disabled: true,
},
};
export const WithoutLabel: StoryObj<Args> = {
export const WithoutLabel: Story = {
args: {
label: undefined,
'aria-label': 'Lorem ipsum',
},
};

export const CustomPositioning: StoryObj<Args> = {
export const CustomPositioning: Story = {
parameters: {
docs: {
source: {
Expand Down

0 comments on commit 05d0836

Please sign in to comment.