Skip to content

Commit f2837cf

Browse files
chore: enable size controls for 2nd-gen components (#5933)
1 parent ae61361 commit f2837cf

File tree

5 files changed

+25
-47
lines changed

5 files changed

+25
-47
lines changed

2nd-gen/packages/swc/cem.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
*/
1212

1313
export default {
14-
globs: ['components/**/*.ts', '../core/components/**/*.ts'],
14+
globs: [
15+
'components/**/*.ts',
16+
'../core/components/**/*.ts',
17+
'../core/shared/**/*.ts',
18+
],
1519
exclude: ['**/*.stories.ts', '**/*.test.ts', '**/*.spec.ts'],
1620
outdir: '.storybook',
1721
litelement: true,

2nd-gen/packages/swc/components/badge/stories/badge.stories.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,11 @@ argTypes.fixed = {
3737
options: [undefined, ...Badge.FIXED_VALUES],
3838
};
3939

40-
/*
41-
* @todo This is properly configuring the Select, but the control doesn't
42-
* seem to work; need to investigate.
43-
*/
44-
45-
// argTypes.size = {
46-
// ...argTypes.size,
47-
// control: { type: 'select' },
48-
// options: Badge.VALID_SIZES,
49-
// };
40+
argTypes.size = {
41+
...argTypes.size,
42+
control: { type: 'select' },
43+
options: Badge.VALID_SIZES,
44+
};
5045

5146
args['default-slot'] = 'Badge';
5247

2nd-gen/packages/swc/components/divider/stories/divider.stories.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,11 @@ import '@adobe/swc/divider';
2424

2525
const { events, args, argTypes, template } = getStorybookHelpers('swc-divider');
2626

27-
/*
28-
* @todo This is properly configuring the Select, but the control doesn't
29-
* seem to work; need to investigate.
30-
*/
31-
32-
// argTypes.size = {
33-
// ...argTypes.size,
34-
// control: { type: 'select' },
35-
// options: Divider.VALID_SIZES,
36-
// };
27+
argTypes.size = {
28+
...argTypes.size,
29+
control: { type: 'select' },
30+
options: Divider.VALID_SIZES,
31+
};
3732

3833
argTypes['static-color'] = {
3934
...argTypes['static-color'],

2nd-gen/packages/swc/components/progress-circle/stories/progress-circle.stories.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,11 @@ const { events, args, argTypes, template } = getStorybookHelpers(
3535
// control: { type: 'range', min: 0, max: 100, step: 1 },
3636
// };
3737

38-
/*
39-
* @todo This is properly configuring the Select, but the control doesn't
40-
* seem to work; need to investigate.
41-
*/
42-
// argTypes.size = {
43-
// ...argTypes.size,
44-
// control: { type: 'select' },
45-
// options: ProgressCircle.VALID_SIZES,
46-
// };
38+
argTypes.size = {
39+
...argTypes.size,
40+
control: { type: 'select' },
41+
options: ProgressCircle.VALID_SIZES,
42+
};
4743

4844
argTypes['static-color'] = {
4945
...argTypes['static-color'],

2nd-gen/packages/swc/components/status-light/stories/status-light.stories.ts

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,11 @@ argTypes.variant = {
3030
options: StatusLight.VARIANTS,
3131
};
3232

33-
/*
34-
* @todo This is properly configuring the Select, but the control doesn't
35-
* seem to work; need to investigate.
36-
*
37-
* We may have to explicitly bind the args to the component (particularly
38-
* helpful for the size property) so the Storybook controls work as expected.
39-
*
40-
* i.e. render: (args) =>
41-
html`<swc-status-light .size=${args.size} variant=${args.variant}
42-
>${args['default-slot']}</swc-status-light
43-
>`,
44-
*/
45-
// argTypes.size = {
46-
// ...argTypes.size,
47-
// control: { type: 'select' },
48-
// options: StatusLight.VALID_SIZES,
49-
// };
33+
argTypes.size = {
34+
...argTypes.size,
35+
control: { type: 'select' },
36+
options: StatusLight.VALID_SIZES,
37+
};
5038

5139
args['default-slot'] = 'Status light';
5240
args.size = 'm';

0 commit comments

Comments
 (0)