chore: clean up switch stories (#26057)

## Description
Clean up switch stories

---------

Co-authored-by: Valera Melnikov <melnikov.vv@greendatasoft.ru>
This commit is contained in:
Valera Melnikov 2023-08-04 21:56:45 +03:00 committed by GitHub
parent fa1eefa4d0
commit 65a662ee48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 130 additions and 135 deletions

View File

@ -6,9 +6,11 @@ on:
- release
paths:
- 'app/client/packages/design-system/**'
- 'app/client/packages/storybook/**'
pull_request:
paths:
- 'app/client/packages/design-system/**'
- 'app/client/packages/storybook/**'
jobs:
chromatic-deployment:

View File

@ -6,9 +6,11 @@ on:
- release
paths:
- 'app/client/packages/design-system/**'
- 'app/client/packages/storybook/**'
pull_request:
paths:
- 'app/client/packages/design-system/**'
- 'app/client/packages/storybook/**'
jobs:
chromatic-deployment:

View File

@ -21,72 +21,74 @@ Switch is a component that allows the user to select one or more options from a
<Story name="Switch">{Template.bind({})}</Story>
</Canvas>
<ArgsTable story="Switch" of={Switch} />
### States
<Canvas>
<Story
name="State - unchecked"
args={{
children: "Unchecked",
}}
>
{Template.bind({})}
</Story>
<Story
name="State - Default Checked"
args={{
defaultSelected: true,
children: "Checked",
}}
>
{Template.bind({})}
</Story>
<Story
name="State - Disabled"
args={{
defaultSelected: true,
children: "Disabled",
isDisabled: true,
}}
>
{Template.bind({})}
</Story>
<Story
name="State - Disabled unchecked"
args={{
children: "Disabled unchecked",
isDisabled: true,
}}
>
{Template.bind({})}
</Story>
</Canvas>
<Story
name="State - unchecked"
args={{
children: "Unchecked",
}}
>
{Template.bind({})}
</Story>
<Story
name="State - Default Checked"
args={{
defaultSelected: true,
children: "Checked",
}}
>
{Template.bind({})}
</Story>
<Story
name="State - Disabled"
args={{
defaultSelected: true,
children: "Disabled",
isDisabled: true,
}}
>
{Template.bind({})}
</Story>
<Story
name="State - Disabled unchecked"
args={{
children: "Disabled unchecked",
isDisabled: true,
}}
>
{Template.bind({})}
</Story>
### Label Position
<Canvas>
<Story
parameters={{
width: 250,
}}
name="Label Position - Left"
args={{
labelPosition: "left",
children: "Label Position - Left",
}}
>
{Template.bind({})}
</Story>
<Story
parameters={{
width: 250,
}}
name="Label Position - Right"
args={{
labelPosition: "right",
children: "Label Position - Right",
}}
>
{Template.bind({})}
</Story>
</Canvas>
<Story
parameters={{
width: 250,
}}
name="Label Position - Left"
args={{
labelPosition: "left",
children: "Label Position - Left",
}}
>
{Template.bind({})}
</Story>
<Story
parameters={{
width: 250,
}}
name="Label Position - Right"
args={{
labelPosition: "right",
children: "Label Position - Right",
}}
>
{Template.bind({})}
</Story>

View File

@ -31,89 +31,78 @@ Switch Group is a group of checkboxes that can be selected together.
# Orientation
<Canvas>
<Story
args={{
orientation: "vertical",
}}
name="Orientation - Vertical"
>
{Template.bind({})}
</Story>
<Story
args={{
orientation: "horizontal",
}}
name="Orientation - Horizontal"
>
{Template.bind({})}
</Story>
</Canvas>
<Story
args={{
orientation: "vertical",
}}
name="Orientation - Vertical"
>
{Template.bind({})}
</Story>
<Story
args={{
orientation: "horizontal",
}}
name="Orientation - Horizontal"
>
{Template.bind({})}
</Story>
# Emphasized
<Canvas>
<Story
args={{
isEmphasized: true,
}}
name="Is Emphasised"
>
{Template.bind({})}
</Story>
</Canvas>
<Story
args={{
isEmphasized: true,
}}
name="Is Emphasised"
>
{Template.bind({})}
</Story>
# Label Position and Alignment
<Canvas>
<Story
args={{
labelPosition: "side",
labelWidth: "100px",
errorMessage: "This is a description",
}}
name="Label Position - Side"
>
{Template.bind({})}
</Story>
</Canvas>
<Story
args={{
labelPosition: "side",
labelWidth: "100px",
errorMessage: "This is a description",
}}
name="Label Position - Side"
>
{Template.bind({})}
</Story>
# Is Disabled
<Canvas>
<Story
args={{
isDisabled: true,
}}
name="Is Disabled"
>
{Template.bind({})}
</Story>
</Canvas>
<Story
args={{
isDisabled: true,
}}
name="Is Disabled"
>
{Template.bind({})}
</Story>
# Is Required
<Canvas>
<Story
args={{
isRequired: true,
}}
name="Is Required"
>
{Template.bind({})}
</Story>
</Canvas>
<Story
args={{
isRequired: true,
}}
name="Is Required"
>
{Template.bind({})}
</Story>
# Invalid State
<Canvas>
<Story
args={{
validationState: "invalid",
errorMessage: "This is a error message",
}}
name="Invalid State"
>
{Template.bind({})}
</Story>
</Canvas>
<Story
args={{
validationState: "invalid",
errorMessage: "This is a error message",
}}
name="Invalid State"
>
{Template.bind({})}
</Story>