Skip to content

Commit 4386b21

Browse files
Reid Barberreidbarber
authored andcommitted
Clean up docs build props tables (#182)
* clean up storybook docs prop tables * remove designs addon * add Events category to CheckboxGroup --------- Co-authored-by: Reid Barber <[email protected]>
1 parent 3a39778 commit 4386b21

31 files changed

+151
-38
lines changed

.storybook-s2/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ const config: StorybookConfig = {
2424
"@storybook/addon-essentials",
2525
"@storybook/addon-interactions",
2626
// "@storybook/addon-styling-webpack",
27-
// re-enable when we get single components in Figma
28-
"@storybook/addon-designs",
2927
"storybook-dark-mode"
3028
],
3129
framework: {

.storybook-s2/preview.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import '../src/page';
2-
import {themes} from '@storybook/theming';
2+
import { themes } from '@storybook/theming';
33
import { DARK_MODE_EVENT_NAME } from 'storybook-dark-mode';
44
import { store } from 'storybook-dark-mode/dist/esm/Tool';
55
import { addons } from '@storybook/preview-api';
@@ -17,6 +17,7 @@ const preview = {
1717
actions: { argTypesRegex: "^on[A-Z].*" },
1818
controls: {
1919
matchers: {},
20+
exclude: ['key', 'ref']
2021
},
2122
docs: {
2223
container: (props) => {
@@ -62,6 +63,20 @@ const preview = {
6263
brandImage: new URL('raw:logo-dark.svg', import.meta.url).toString()
6364
}
6465
}
66+
},
67+
argTypes: {
68+
styles: {
69+
table: {category: 'Styles'},
70+
control: {disable: true},
71+
},
72+
UNSAFE_className: {
73+
table: {category: 'Styles'},
74+
control: {disable: true},
75+
},
76+
UNSAFE_style: {
77+
table: {category: 'Styles'},
78+
control: {disable: true},
79+
}
6580
}
6681
};
6782

@@ -79,7 +94,7 @@ export const parameters = {
7994
]
8095
}
8196
},
82-
layout: 'fullscreen'
97+
layout: 'fullscreen',
8398
};
8499

85100
export default preview;

packages/@react-spectrum/s2/stories/ActionButton.stories.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import type {Meta, StoryObj} from '@storybook/react';
1414
import {ActionButton, Text} from '../src';
1515
import NewIcon from '../s2wf-icons/assets/svg/S2_Icon_New_20_N.svg';
16-
import {StaticColorDecorator} from './utils';
16+
import {StaticColorDecorator, categorizeArgTypes} from './utils';
1717
import {style} from '../style/spectrum-theme' with { type: 'macro' };
1818
import './unsafe.css';
1919

@@ -23,7 +23,10 @@ const meta: Meta<typeof ActionButton> = {
2323
layout: 'centered'
2424
},
2525
decorators: [StaticColorDecorator],
26-
tags: ['autodocs']
26+
tags: ['autodocs'],
27+
argTypes: {
28+
...categorizeArgTypes('Events', ['onPress', 'onPressChange', 'onPressEnd', 'onPressStart', 'onPressUp'])
29+
}
2730
};
2831

2932
export default meta;

packages/@react-spectrum/s2/stories/ActionMenu.stories.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@
1313
import {ActionMenu, MenuItem} from '../src';
1414

1515
import type {Meta, StoryObj} from '@storybook/react';
16+
import {categorizeArgTypes} from './utils';
1617

1718
const meta: Meta<typeof ActionMenu> = {
1819
component: ActionMenu,
1920
parameters: {
2021
layout: 'centered'
2122
},
22-
tags: ['autodocs']
23+
tags: ['autodocs'],
24+
argTypes: {
25+
...categorizeArgTypes('Events', ['onAction', 'onOpenChange'])
26+
}
2327
};
2428

2529
export default meta;

packages/@react-spectrum/s2/stories/Breadcrumbs.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ const meta: Meta<typeof Breadcrumbs> = {
2222
argTypes: {
2323
size: {
2424
control: 'radio',
25-
options: [undefined, 'M', 'L']
25+
options: ['M', 'L']
2626
},
2727
isDisabled: {
2828
control: {type: 'boolean'}
2929
},
3030
isMultiline: {
3131
control: {type: 'boolean'}
32+
},
33+
onAction: {
34+
table: {category: 'Events'}
3235
}
3336
},
3437
tags: ['autodocs']

packages/@react-spectrum/s2/stories/Button.stories.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ import type {Meta, StoryObj} from '@storybook/react';
1414
import NewIcon from '../s2wf-icons/assets/svg/S2_Icon_New_20_N.svg';
1515
import {Button, Text} from '../src';
1616
import {style} from '../style/spectrum-theme' with { type: 'macro' };
17-
import {StaticColorDecorator} from './utils';
17+
import {StaticColorDecorator, categorizeArgTypes} from './utils';
1818

1919
const meta: Meta<typeof Button> = {
2020
component: Button,
2121
parameters: {
2222
layout: 'centered'
2323
},
2424
decorators: [StaticColorDecorator],
25-
tags: ['autodocs']
25+
tags: ['autodocs'],
26+
argTypes: {
27+
...categorizeArgTypes('Events', ['onPress', 'onPressChange', 'onPressEnd', 'onPressStart', 'onPressUp'])
28+
}
2629
};
2730

2831
export default meta;

packages/@react-spectrum/s2/stories/Checkbox.stories.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ const meta: Meta<typeof Checkbox> = {
1919
parameters: {
2020
layout: 'centered'
2121
},
22-
tags: ['autodocs']
22+
tags: ['autodocs'],
23+
argTypes: {
24+
inputRef: {control: {disable: true}},
25+
onChange: {table: {category: 'Events'}}
26+
}
2327
};
2428

2529
export default meta;

packages/@react-spectrum/s2/stories/CheckboxGroup.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ const meta: Meta<typeof CheckboxGroup> = {
1818
parameters: {
1919
layout: 'centered'
2020
},
21-
tags: ['autodocs']
21+
tags: ['autodocs'],
22+
argTypes: {
23+
onChange: {table: {category: 'Events'}}
24+
}
2225
};
2326

2427
export default meta;

packages/@react-spectrum/s2/stories/ColorArea.stories.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212

1313
import {ColorArea} from '../src/ColorArea';
1414
import type {Meta} from '@storybook/react';
15+
import {categorizeArgTypes} from './utils';
1516

1617
const meta: Meta<typeof ColorArea> = {
1718
component: ColorArea,
1819
parameters: {
1920
layout: 'centered'
2021
},
21-
tags: ['autodocs']
22+
tags: ['autodocs'],
23+
argTypes: {
24+
...categorizeArgTypes('Events', ['onChange', 'onChangeEnd'])
25+
}
2226
};
2327

2428
export default meta;

packages/@react-spectrum/s2/stories/ColorField.stories.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ const meta: Meta<typeof ColorField> = {
1818
parameters: {
1919
layout: 'centered'
2020
},
21-
tags: ['autodocs']
21+
tags: ['autodocs'],
22+
argTypes: {
23+
onChange: {table: {category: 'Events'}}
24+
}
2225
};
2326

2427
export default meta;

0 commit comments

Comments
 (0)