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:
parent
fa1eefa4d0
commit
65a662ee48
2
.github/workflows/build-chromatic.yml
vendored
2
.github/workflows/build-chromatic.yml
vendored
|
|
@ -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:
|
||||
|
|
|
|||
2
.github/workflows/build-storybook.yml
vendored
2
.github/workflows/build-storybook.yml
vendored
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user