Skip to content

Commit 4b353d4

Browse files
authored
docs: hide mode and theme props, unhide children props
Automatically hides `mode` and `theme` props from the props table. Unhides `children` prop from props table when it doesn't have an associated jsdoc. Hides the `as` prop on button stories where the type is actually `as?: never`
1 parent ed3b2d9 commit 4b353d4

File tree

9 files changed

+44
-31
lines changed

9 files changed

+44
-31
lines changed

packages/styleguide/.storybook/main.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ const config: StorybookConfig = {
2525

2626
typescript: {
2727
reactDocgen: 'react-docgen-typescript',
28+
reactDocgenTypescriptOptions: {
29+
skipChildrenPropWithoutDoc: false,
30+
shouldRemoveUndefinedFromOptional: true,
31+
propFilter: (prop) => {
32+
if (prop.parent && /node_modules/.test(prop.parent.fileName)) {
33+
return false;
34+
}
35+
if (['mode', 'theme'].includes(prop.name)) {
36+
return false;
37+
}
38+
return true;
39+
},
40+
},
2841
},
2942

3043
webpackFinal(config) {

packages/styleguide/src/lib/Atoms/Buttons/CTAButton/CTAButton.stories.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,17 @@ const meta: Meta<typeof CTAButton> = {
1212
href: {
1313
description: 'If defined, component will use an anchor tag',
1414
},
15-
mode: {
16-
control: {
17-
type: 'select',
18-
options: ['dark', 'light'],
19-
},
20-
},
2115
size: {
2216
control: {
2317
type: 'select',
2418
options: ['normal', 'small', 'large'],
2519
},
2620
},
21+
as: {
22+
table: {
23+
disable: true,
24+
},
25+
},
2726
},
2827
};
2928

packages/styleguide/src/lib/Atoms/Buttons/FillButton/FillButton.stories.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ const meta: Meta<typeof FillButton> = {
1313
href: {
1414
description: 'If defined, component will use an anchor tag',
1515
},
16-
mode: {
17-
control: {
18-
type: 'select',
19-
options: ['dark', 'light'],
20-
},
21-
},
2216
size: {
2317
control: {
2418
type: 'select',
@@ -30,6 +24,11 @@ const meta: Meta<typeof FillButton> = {
3024
options: [SearchIcon],
3125
},
3226
},
27+
as: {
28+
table: {
29+
disable: true,
30+
},
31+
},
3332
},
3433
};
3534

packages/styleguide/src/lib/Atoms/Buttons/IconButton/IconButton.stories.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ const meta: Meta<typeof IconButton> = {
1616
href: {
1717
description: 'If defined, component will use an anchor tag',
1818
},
19-
mode: {
20-
control: {
21-
type: 'select',
22-
options: ['dark', 'light'],
23-
},
24-
},
2519
size: {
2620
control: {
2721
type: 'select',
@@ -35,6 +29,11 @@ const meta: Meta<typeof IconButton> = {
3529
options: Object.keys(icons),
3630
mapping: icons,
3731
},
32+
as: {
33+
table: {
34+
disable: true,
35+
},
36+
},
3837
},
3938
};
4039

packages/styleguide/src/lib/Atoms/Buttons/StrokeButton/StrokeButton.stories.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ const meta: Meta<typeof StrokeButton> = {
1313
href: {
1414
description: 'If defined, component will use an anchor tag',
1515
},
16-
mode: {
17-
control: {
18-
type: 'select',
19-
options: ['dark', 'light'],
20-
},
21-
},
2216
size: {
2317
control: {
2418
type: 'select',
@@ -30,6 +24,11 @@ const meta: Meta<typeof StrokeButton> = {
3024
options: [SearchIcon],
3125
},
3226
},
27+
as: {
28+
table: {
29+
disable: true,
30+
},
31+
},
3332
},
3433
};
3534

packages/styleguide/src/lib/Atoms/Buttons/TextButton/TextButton.stories.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ const meta: Meta<typeof TextButton> = {
1313
href: {
1414
description: 'If defined, component will use an anchor tag',
1515
},
16-
mode: {
17-
control: {
18-
type: 'select',
19-
options: ['dark', 'light'],
20-
},
21-
},
2216
size: {
2317
control: {
2418
type: 'select',
@@ -30,6 +24,11 @@ const meta: Meta<typeof TextButton> = {
3024
options: [SearchIcon],
3125
},
3226
},
27+
as: {
28+
table: {
29+
disable: true,
30+
},
31+
},
3332
},
3433
};
3534

packages/styleguide/src/lib/Atoms/RadialProgress/RadialProgress.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const meta: Meta<typeof RadialProgress> = {
88
strokeWidth: 10,
99
value: 30,
1010
size: 120,
11+
children: '',
1112
},
1213
};
1314

packages/styleguide/src/lib/Layouts/Boxes/Box/Box.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ type Story = StoryObj<typeof Box>;
1111

1212
export const Default: Story = {
1313
args: {
14-
as: 'div',
1514
children: 'Hello work, I am a box!',
1615
},
1716
};

packages/styleguide/src/lib/Organisms/ConnectedForm/SubmitButton/SubmitButton.stories.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ const meta: Meta<typeof SubmitButton> = {
1616
type: 'boolean',
1717
},
1818
},
19+
as: {
20+
table: {
21+
disable: true,
22+
},
23+
},
1924
},
2025
};
2126

0 commit comments

Comments
 (0)