Skip to content

Commit

Permalink
chore: Make Text Input and Text Area uncontrolled in stories (#1533)
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Smedinga <[email protected]>
  • Loading branch information
alimpens and VincentSmedinga authored Aug 26, 2024
1 parent 2ccc1bc commit d4da3f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
3 changes: 0 additions & 3 deletions storybook/src/components/OrderedList/OrderedList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ const meta = {
reversed: {
control: 'boolean',
description: 'Numbers the items from the highest value down.',
table: {
defaultValue: { summary: 'false' },
},
},
start: {
control: 'number',
Expand Down
8 changes: 4 additions & 4 deletions storybook/src/components/TextArea/TextArea.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const meta = {
title: 'Components/Forms/Text Area',
component: TextArea,
args: {
value: paragraph,
defaultValue: paragraph,
disabled: false,
invalid: false,
},
Expand All @@ -24,6 +24,9 @@ const meta = {
},
description: 'The width, expressed in the average number of characters.',
},
defaultValue: {
table: { disable: true },
},
disabled: {
description: 'Prevents interaction. Avoid if possible.',
},
Expand All @@ -40,9 +43,6 @@ const meta = {
},
description: 'The number of lines to show',
},
value: {
description: 'The value of the field.',
},
},
} satisfies Meta<typeof TextArea>

Expand Down
16 changes: 8 additions & 8 deletions storybook/src/components/TextInput/TextInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ const meta = {
invalid: false,
},
argTypes: {
defaultValue: {
table: { disable: true },
},
disabled: {
description: 'Prevents interaction. Avoid if possible.',
},
invalid: {
description: 'Whether the value fails a validation rule.',
},
value: {
description: 'The value of the field.',
},
},
} satisfies Meta<typeof TextInput>

Expand All @@ -34,22 +34,22 @@ export const Default: Story = {}

export const EmailAddress: Story = {
args: {
defaultValue: '[email protected]',
type: 'email',
value: '[email protected]',
},
}

export const WebAddress: Story = {
args: {
defaultValue: 'https://designsystem.amsterdam/',
type: 'url',
value: 'https://designsystem.amsterdam/',
},
}

export const PhoneNumber: Story = {
args: {
defaultValue: '14020',
type: 'tel',
value: '14020',
},
}

Expand All @@ -61,14 +61,14 @@ export const Placeholder: Story = {

export const Invalid: Story = {
args: {
defaultValue: 'Invalid value',
invalid: true,
value: 'Invalid value',
},
}

export const Disabled: Story = {
args: {
defaultValue: 'Disabled input',
disabled: true,
value: 'Disabled input',
},
}

0 comments on commit d4da3f7

Please sign in to comment.