Skip to content

Commit 2830de7

Browse files
authored
fix: use controls exclude for fixed story props (#22163)
* fix: use controls exclude for fixed story props * fix: remove unnecessary story controls
1 parent c466ab9 commit 2830de7

16 files changed

Lines changed: 112 additions & 164 deletions

File tree

packages/react/src/components/Accordion/Accordion.stories.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2023
2+
* Copyright IBM Corp. 2016, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.
@@ -251,6 +251,11 @@ Skeleton.args = {
251251
isFlush: false,
252252
ordered: false,
253253
};
254+
Skeleton.parameters = {
255+
controls: {
256+
exclude: ['disabled', 'size'],
257+
},
258+
};
254259

255260
Skeleton.argTypes = {
256261
align: {
@@ -263,19 +268,9 @@ Skeleton.argTypes = {
263268
className: {
264269
control: false,
265270
},
266-
disabled: {
267-
table: {
268-
disable: true,
269-
},
270-
},
271271
isFlush: {
272272
control: {
273273
type: 'boolean',
274274
},
275275
},
276-
size: {
277-
table: {
278-
disable: true,
279-
},
280-
},
281276
};

packages/react/src/components/ComposedModal/ComposedModalPresence.featureflag.stories.js

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2025
2+
* Copyright IBM Corp. 2016, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.
@@ -96,41 +96,21 @@ export const EnablePresence = (args) => {
9696
);
9797
};
9898
EnablePresence.storyName = 'enable-presence';
99-
EnablePresence.argTypes = {
100-
children: {
101-
table: {
102-
disable: true,
103-
},
104-
},
105-
className: {
106-
table: {
107-
disable: true,
108-
},
109-
},
110-
containerClassName: {
111-
table: {
112-
disable: true,
113-
},
114-
},
115-
launcherButtonRef: {
116-
table: {
117-
disable: true,
118-
},
99+
EnablePresence.parameters = {
100+
controls: {
101+
exclude: [
102+
'containerClassName',
103+
'launcherButtonRef',
104+
'selectorPrimaryFocus',
105+
'selectorsFloatingMenus',
106+
],
119107
},
108+
};
109+
EnablePresence.argTypes = {
120110
onClose: {
121111
action: 'onClose',
122112
},
123113
onKeyDown: {
124114
action: 'onKeyDown',
125115
},
126-
selectorPrimaryFocus: {
127-
table: {
128-
disable: true,
129-
},
130-
},
131-
selectorsFloatingMenus: {
132-
table: {
133-
disable: true,
134-
},
135-
},
136116
};

packages/react/src/components/Modal/ModalPresence.featureflag.stories.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2025
2+
* Copyright IBM Corp. 2016, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.
@@ -23,11 +23,9 @@ export default {
2323
title: 'Components/Modal/Feature Flags',
2424
component: Modal,
2525
tags: ['!autodocs'],
26-
argTypes: {
27-
launcherButtonRef: {
28-
table: {
29-
disable: true,
30-
},
26+
parameters: {
27+
controls: {
28+
exclude: ['launcherButtonRef'],
3129
},
3230
},
3331
};

packages/react/src/components/MultiSelect/MultiSelect.stories.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2025
2+
* Copyright IBM Corp. 2016, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.
@@ -191,12 +191,6 @@ const sharedArgs = {
191191
};
192192

193193
const filterableArgTypes = {
194-
label: {
195-
control: false,
196-
table: {
197-
disable: true,
198-
},
199-
},
200194
placeholder: {
201195
control: {
202196
type: 'text',
@@ -380,6 +374,11 @@ FilterableWithSelectAll.args = { ...sharedArgs };
380374
FilterableWithSelectAll.argTypes = {
381375
...filterableArgTypes,
382376
};
377+
FilterableWithSelectAll.parameters = {
378+
controls: {
379+
exclude: ['label'],
380+
},
381+
};
383382
Filterable.argTypes = {
384383
...filterableArgTypes,
385384
onChange: {
@@ -389,6 +388,11 @@ Filterable.argTypes = {
389388
action: 'onMenuChange',
390389
},
391390
};
391+
Filterable.parameters = {
392+
controls: {
393+
exclude: ['label'],
394+
},
395+
};
392396

393397
export const WithLayerMultiSelect = (args) => (
394398
<WithLayer>
@@ -432,6 +436,11 @@ _FilterableWithLayer.args = { ...sharedArgs };
432436
_FilterableWithLayer.argTypes = {
433437
...filterableArgTypes,
434438
};
439+
_FilterableWithLayer.parameters = {
440+
controls: {
441+
exclude: ['label'],
442+
},
443+
};
435444
export const _Controlled = (args) => {
436445
const [selectedItems, setSelectedItems] = useState(
437446
items.filter((item) => item.id === 'downshift-1-item-0')
@@ -601,6 +610,11 @@ FilterableWithAILabel.args = { ...sharedArgs };
601610
FilterableWithAILabel.argTypes = {
602611
...filterableArgTypes,
603612
};
613+
FilterableWithAILabel.parameters = {
614+
controls: {
615+
exclude: ['label'],
616+
},
617+
};
604618
export const ExperimentalAutoAlign = (args) => {
605619
const ref = useRef();
606620
useEffect(() => {

packages/react/src/components/Popover/Popover.stories.js

Lines changed: 19 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2016, 2025
2+
* Copyright IBM Corp. 2016, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.
@@ -161,26 +161,9 @@ export const TabTip = (args) => {
161161
);
162162
};
163163

164-
TabTip.argTypes = {
165-
align: {
166-
table: {
167-
disable: true,
168-
},
169-
},
170-
autoAlign: {
171-
table: {
172-
disable: true,
173-
},
174-
},
175-
highContrast: {
176-
table: {
177-
disable: true,
178-
},
179-
},
180-
caret: {
181-
table: {
182-
disable: true,
183-
},
164+
TabTip.parameters = {
165+
controls: {
166+
exclude: ['align', 'autoAlign', 'caret', 'highContrast'],
184167
},
185168
};
186169

@@ -192,13 +175,13 @@ Default.args = {
192175
highContrast: false,
193176
open: true,
194177
};
178+
Default.parameters = {
179+
controls: {
180+
exclude: ['isTabTip'],
181+
},
182+
};
195183

196184
Default.argTypes = {
197-
isTabTip: {
198-
table: {
199-
disable: true,
200-
},
201-
},
202185
align: {
203186
options: [
204187
'top',
@@ -255,21 +238,6 @@ Default.story = {
255238
};
256239

257240
const autoAlignArgTypes = {
258-
autoAlign: {
259-
table: {
260-
disable: true,
261-
},
262-
},
263-
highContrast: {
264-
table: {
265-
disable: true,
266-
},
267-
},
268-
isTabTip: {
269-
table: {
270-
disable: true,
271-
},
272-
},
273241
caret: {
274242
control: {
275243
type: 'boolean',
@@ -350,6 +318,11 @@ export const ExperimentalAutoAlign = (args) => {
350318
};
351319

352320
ExperimentalAutoAlign.argTypes = autoAlignArgTypes;
321+
ExperimentalAutoAlign.parameters = {
322+
controls: {
323+
exclude: ['autoAlign', 'highContrast', 'isTabTip'],
324+
},
325+
};
353326
export const ExperimentalAutoAlignBoundary = (args) => {
354327
const [open, setOpen] = useState(true);
355328
const ref = useRef();
@@ -424,6 +397,11 @@ export const ExperimentalAutoAlignBoundary = (args) => {
424397
};
425398

426399
ExperimentalAutoAlignBoundary.argTypes = autoAlignArgTypes;
400+
ExperimentalAutoAlignBoundary.parameters = {
401+
controls: {
402+
exclude: ['autoAlign', 'highContrast', 'isTabTip'],
403+
},
404+
};
427405

428406
export const TabTipExperimentalAutoAlign = () => {
429407
const [open, setOpen] = useState(true);

packages/react/src/components/Tooltip/DefinitionTooltip.stories.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,9 @@ WithLargeText.argTypes = {
165165
type: 'text',
166166
},
167167
},
168-
id: {
169-
table: { disable: true },
170-
},
171168
openOnHover: {
172169
control: {
173170
type: 'boolean',
174171
},
175172
},
176-
tooltipText: {
177-
table: {
178-
disable: true,
179-
},
180-
},
181-
triggerClassName: {
182-
table: {
183-
disable: true,
184-
},
185-
},
186173
};

packages/web-components/src/components/accordion/accordion.stories.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright IBM Corp. 2019, 2025
2+
* Copyright IBM Corp. 2019, 2026
33
*
44
* This source code is licensed under the Apache-2.0 license found in the
55
* LICENSE file in the root directory of this source tree.
@@ -50,21 +50,20 @@ const argTypes = {
5050
},
5151
onBeforeToggle: {
5252
action: `${prefix}-accordion-item-beingtoggled`,
53-
table: {
54-
disable: true,
55-
},
5653
},
5754
onToggle: {
5855
action: `${prefix}-accordion-item-toggled`,
59-
table: {
60-
disable: true,
61-
},
6256
},
6357
};
6458

6559
export const Default = {
6660
args,
6761
argTypes,
62+
parameters: {
63+
controls: {
64+
exclude: ['onBeforeToggle', 'onToggle'],
65+
},
66+
},
6867
render: ({
6968
alignment,
7069
isFlush,

packages/web-components/src/components/ai-label/ai-label.stories.ts

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -199,20 +199,13 @@ export const Inline = {
199199
// hence the arg value is set even though the prop can’t be updated from controls.
200200
kind: 'inline',
201201
},
202+
parameters: {
203+
controls: {
204+
exclude: ['defaultOpen', 'kind'],
205+
},
206+
},
202207
argTypes: {
203208
...argTypes,
204-
kind: {
205-
...argTypes.kind,
206-
table: {
207-
disable: true,
208-
},
209-
},
210-
defaultOpen: {
211-
...argTypes.kind,
212-
table: {
213-
disable: true,
214-
},
215-
},
216209
size: {
217210
control: 'select',
218211
description:
@@ -261,20 +254,13 @@ export const InlineWithContent = {
261254
kind: 'inline',
262255
aiTextLabel: 'Text goes here',
263256
},
257+
parameters: {
258+
controls: {
259+
exclude: ['defaultOpen', 'kind'],
260+
},
261+
},
264262
argTypes: {
265263
...argTypes,
266-
kind: {
267-
...argTypes.kind,
268-
table: {
269-
disable: true,
270-
},
271-
},
272-
defaultOpen: {
273-
...argTypes.kind,
274-
table: {
275-
disable: true,
276-
},
277-
},
278264
size: {
279265
control: 'select',
280266
description:

0 commit comments

Comments
 (0)