Skip to content

Commit

Permalink
add storybook documentation for Toggle component
Browse files Browse the repository at this point in the history
update checkbox snapshots

add changefile

update Toggle documentation

use toggleArgTypes for story args
  • Loading branch information
trenaryja committed Jul 11, 2023
1 parent ef1004c commit c1f153b
Show file tree
Hide file tree
Showing 12 changed files with 333 additions and 73 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "pcln-design-system",
"comment": "add documentation for Toggle component",
"type": "patch"
}
],
"packageName": "pcln-design-system"
}
4 changes: 2 additions & 2 deletions packages/core/src/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import alignmentImage from './Button.Image.Alignment.png'
import groupsImage from './Button.Image.Groups.png'
import heroImage from './Button.Image.Hero.png'
import responsiveLayoutImage from './Button.Image.ResponsiveLayout.png'
import buttonStates from './Button.Image.States.png'
import statesImage from './Button.Image.States.png'

type ButtonStory = StoryObj<IButtonProps>

Expand Down Expand Up @@ -327,7 +327,7 @@ const meta: Meta<typeof Button> = {
element.
</Text>
<Flex my={4} borderRadius='xl' bg='primary.light'>
<Image src={buttonStates} />
<Image src={statesImage} />
</Flex>

<StoryHeading storyName='Disabled' storyTitle={meta.title} />
Expand Down
60 changes: 30 additions & 30 deletions packages/core/src/Checkbox/__snapshots__/Checkbox.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ exports[`Checkbox renders disabled with defaultChecked 1`] = `
outline: none;
}
.c0 {
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
line-height: 1.4;
font-weight: 500;
}
.c0 * {
box-sizing: border-box;
}
.c1 {
display: -webkit-inline-box;
display: -webkit-inline-flex;
Expand Down Expand Up @@ -120,6 +110,16 @@ exports[`Checkbox renders disabled with defaultChecked 1`] = `
z-index: 0;
}
.c0 {
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
line-height: 1.4;
font-weight: 500;
}
.c0 * {
box-sizing: border-box;
}
<div
class="c0"
>
Expand Down Expand Up @@ -217,16 +217,6 @@ exports[`Checkbox renders disabled with disabled prop 1`] = `
outline: none;
}
.c0 {
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
line-height: 1.4;
font-weight: 500;
}
.c0 * {
box-sizing: border-box;
}
.c1 {
display: -webkit-inline-box;
display: -webkit-inline-flex;
Expand Down Expand Up @@ -315,6 +305,16 @@ exports[`Checkbox renders disabled with disabled prop 1`] = `
z-index: 0;
}
.c0 {
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
line-height: 1.4;
font-weight: 500;
}
.c0 * {
box-sizing: border-box;
}
<div
class="c0"
>
Expand Down Expand Up @@ -411,16 +411,6 @@ exports[`Checkbox renders without the theme passed specifically 1`] = `
outline: none;
}
.c0 {
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
line-height: 1.4;
font-weight: 500;
}
.c0 * {
box-sizing: border-box;
}
.c1 {
display: -webkit-inline-box;
display: -webkit-inline-flex;
Expand Down Expand Up @@ -509,6 +499,16 @@ exports[`Checkbox renders without the theme passed specifically 1`] = `
z-index: 0;
}
.c0 {
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
line-height: 1.4;
font-weight: 500;
}
.c0 * {
box-sizing: border-box;
}
<div
class="c0"
>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/src/Toggle/Toggle.Image.Hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/src/Toggle/Toggle.Image.States.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/core/src/Toggle/Toggle.Image.Usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions packages/core/src/Toggle/Toggle.stories.args.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ArgTypes } from '@storybook/react'
import type { IToggleProps } from '..'

export const toggleArgTypes: Partial<ArgTypes<IToggleProps>> = {
isOn: {
type: 'boolean',
},
disabled: {
type: 'boolean',
defaultValue: false,
},
}
Loading

0 comments on commit c1f153b

Please sign in to comment.