Skip to content

Commit 69be0b1

Browse files
committed
add storybook documentation for Toggle component
1 parent ef1004c commit 69be0b1

File tree

14 files changed

+339
-76
lines changed

14 files changed

+339
-76
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "pcln-design-system",
5+
"comment": "add documentation for Toggle component",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "pcln-design-system"
10+
}

packages/core/src/Button/Button.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import alignmentImage from './Button.Image.Alignment.png'
2828
import groupsImage from './Button.Image.Groups.png'
2929
import heroImage from './Button.Image.Hero.png'
3030
import responsiveLayoutImage from './Button.Image.ResponsiveLayout.png'
31-
import buttonStates from './Button.Image.States.png'
31+
import statesImage from './Button.Image.States.png'
3232

3333
type ButtonStory = StoryObj<IButtonProps>
3434

@@ -327,7 +327,7 @@ const meta: Meta<typeof Button> = {
327327
element.
328328
</Text>
329329
<Flex my={4} borderRadius='xl' bg='primary.light'>
330-
<Image src={buttonStates} />
330+
<Image src={statesImage} />
331331
</Flex>
332332

333333
<StoryHeading storyName='Disabled' storyTitle={meta.title} />

packages/core/src/Checkbox/__snapshots__/Checkbox.spec.tsx.snap

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ exports[`Checkbox renders disabled with defaultChecked 1`] = `
2222
outline: none;
2323
}
2424
25-
.c0 {
26-
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
27-
line-height: 1.4;
28-
font-weight: 500;
29-
}
30-
31-
.c0 * {
32-
box-sizing: border-box;
33-
}
34-
3525
.c1 {
3626
display: -webkit-inline-box;
3727
display: -webkit-inline-flex;
@@ -120,6 +110,16 @@ exports[`Checkbox renders disabled with defaultChecked 1`] = `
120110
z-index: 0;
121111
}
122112
113+
.c0 {
114+
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
115+
line-height: 1.4;
116+
font-weight: 500;
117+
}
118+
119+
.c0 * {
120+
box-sizing: border-box;
121+
}
122+
123123
<div
124124
class="c0"
125125
>
@@ -217,16 +217,6 @@ exports[`Checkbox renders disabled with disabled prop 1`] = `
217217
outline: none;
218218
}
219219
220-
.c0 {
221-
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
222-
line-height: 1.4;
223-
font-weight: 500;
224-
}
225-
226-
.c0 * {
227-
box-sizing: border-box;
228-
}
229-
230220
.c1 {
231221
display: -webkit-inline-box;
232222
display: -webkit-inline-flex;
@@ -315,6 +305,16 @@ exports[`Checkbox renders disabled with disabled prop 1`] = `
315305
z-index: 0;
316306
}
317307
308+
.c0 {
309+
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
310+
line-height: 1.4;
311+
font-weight: 500;
312+
}
313+
314+
.c0 * {
315+
box-sizing: border-box;
316+
}
317+
318318
<div
319319
class="c0"
320320
>
@@ -411,16 +411,6 @@ exports[`Checkbox renders without the theme passed specifically 1`] = `
411411
outline: none;
412412
}
413413
414-
.c0 {
415-
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
416-
line-height: 1.4;
417-
font-weight: 500;
418-
}
419-
420-
.c0 * {
421-
box-sizing: border-box;
422-
}
423-
424414
.c1 {
425415
display: -webkit-inline-box;
426416
display: -webkit-inline-flex;
@@ -509,6 +499,16 @@ exports[`Checkbox renders without the theme passed specifically 1`] = `
509499
z-index: 0;
510500
}
511501
502+
.c0 {
503+
font-family: 'Montserrat','Helvetica Neue',Helvetica,Arial,sans-serif;
504+
line-height: 1.4;
505+
font-weight: 500;
506+
}
507+
508+
.c0 * {
509+
box-sizing: border-box;
510+
}
511+
512512
<div
513513
class="c0"
514514
>

packages/core/src/DocsUtils/DoDont/DoDont.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
2-
3-
import { Box, createTheme, Text } from '../..'
2+
import { Box, Text } from '../..'
3+
import { createTheme } from '../../utils'
44

55
const theme = createTheme()
66

packages/core/src/DocsUtils/TableOfContents/TableOfContents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const TableOfContents = ({ links }: TableOfContentsProps) => (
1616
const id = kebabCase(link)
1717
return (
1818
<Link key={id} onClick={() => scrollTo(id)}>
19-
<li>{link}</li>
19+
<li style={{ color: 'inherit' }}>{link}</li>
2020
</Link>
2121
)
2222
})}
38.3 KB
Loading
89.1 KB
Loading
83.3 KB
Loading
29.6 KB
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { ArgTypes } from '@storybook/react'
2+
import type { IToggleProps } from '..'
3+
4+
export const toggleArgTypes: Partial<ArgTypes<IToggleProps>> = {
5+
isOn: {
6+
type: 'boolean',
7+
},
8+
disabled: {
9+
type: 'boolean',
10+
defaultValue: false,
11+
},
12+
height: {
13+
type: 'number',
14+
},
15+
}

0 commit comments

Comments
 (0)