Skip to content

Commit

Permalink
Storybook: Fix control types (#67646)
Browse files Browse the repository at this point in the history
* Storybook: Update false control types to undefined

* Fix control definition

Co-authored-by: tyxla <[email protected]>
Co-authored-by: mirka <[email protected]>
  • Loading branch information
3 people authored Dec 5, 2024
1 parent c93fd2d commit f45e35d
Show file tree
Hide file tree
Showing 84 changed files with 152 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ const meta = {
component: AlignmentToolbar,
argTypes: {
value: {
control: { type: false },
control: false,
defaultValue: 'undefined',
description: 'The current value of the alignment setting.',
},
onChange: {
action: 'onChange',
control: { type: false },
control: false,
description:
"A callback function invoked when the toolbar's alignment value is changed via an interaction with any of the toolbar's buttons. Called with the new alignment value (ie: `left`, `center`, `right`, `undefined`) as the only argument.",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ const meta = {
component: AlignmentControl,
argTypes: {
value: {
control: { type: false },
control: false,
defaultValue: 'undefined',
description: 'The current value of the alignment setting.',
},
onChange: {
action: 'onChange',
control: { type: false },
control: false,
description:
"A callback function invoked when the toolbar's alignment value is changed via an interaction with any of the toolbar's buttons. Called with the new alignment value (ie: `left`, `center`, `right`, `undefined`) as the only argument.",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
title: 'BlockEditor (Private APIs)/DimensionsTool/AspectRatioTool',
component: AspectRatioTool,
argTypes: {
panelId: { control: { type: false } },
panelId: { control: false },
onChange: { action: 'changed' },
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
title: 'BlockEditor (Private APIs)/DimensionsTool',
component: DimensionsTool,
argTypes: {
panelId: { control: { type: false } },
panelId: { control: false },
onChange: { action: 'changed' },
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
title: 'BlockEditor (Private APIs)/DimensionsTool/ScaleTool',
component: ScaleTool,
argTypes: {
panelId: { control: { type: false } },
panelId: { control: false },
onChange: { action: 'changed' },
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
title: 'BlockEditor (Private APIs)/DimensionsTool/WidthHeightTool',
component: WidthHeightTool,
argTypes: {
panelId: { control: { type: false } },
panelId: { control: false },
onChange: { action: 'changed' },
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default {
title: 'BlockEditor (Private APIs)/ResolutionControl',
component: ResolutionTool,
argTypes: {
panelId: { control: { type: false } },
panelId: { control: false },
onChange: { action: 'changed' },
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {
control: 'check',
options: [ 'left', 'center', 'right', 'justify' ],
},
value: { control: { type: false } },
value: { control: false },
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const meta: Meta< typeof AlignmentMatrixControl > = {
'AlignmentMatrixControl.Icon': AlignmentMatrixControl.Icon,
},
argTypes: {
onChange: { control: { type: false } },
value: { control: { type: false } },
onChange: { control: false },
value: { control: false },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const meta: Meta< typeof AnglePickerControl > = {
title: 'Components/AnglePickerControl',
component: AnglePickerControl,
argTypes: {
as: { control: { type: false } },
value: { control: { type: false } },
as: { control: false },
value: { control: false },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const meta: Meta< typeof BaseControl > = {
'BaseControl.VisualLabel': BaseControl.VisualLabel,
},
argTypes: {
children: { control: { type: false } },
children: { control: false },
help: { control: { type: 'text' } },
label: { control: { type: 'text' } },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const meta: Meta< typeof BorderBoxControl > = {
component: BorderBoxControl,
argTypes: {
onChange: { action: 'onChange' },
value: { control: { type: false } },
value: { control: false },
},
parameters: {
controls: { expanded: true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const meta: Meta< typeof BorderControl > = {
action: 'onChange',
},
width: { control: { type: 'text' } },
value: { control: { type: false } },
value: { control: false },
},
parameters: {
controls: { expanded: true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const meta: Meta< typeof BoxControl > = {
title: 'Components/BoxControl',
component: BoxControl,
argTypes: {
values: { control: { type: false } },
values: { control: false },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const meta: Meta< typeof ButtonGroup > = {
title: 'Components/ButtonGroup',
component: ButtonGroup,
argTypes: {
children: { control: { type: false } },
children: { control: false },
},
parameters: {
controls: { expanded: true },
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/card/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const meta: Meta< typeof Card > = {
id: 'components-card',
argTypes: {
as: {
control: { type: false },
control: false,
},
children: {
control: { type: false },
control: false,
},
},
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const meta: Meta< typeof CheckboxControl > = {
action: 'onChange',
},
checked: {
control: { type: false },
control: false,
},
help: { control: { type: 'text' } },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const meta: Meta< typeof CircularOptionPicker > = {
CircularOptionPicker.DropdownLinkAction,
},
argTypes: {
actions: { control: { type: false } },
options: { control: { type: false } },
actions: { control: false },
options: { control: false },
children: { control: { type: 'text' } },
},
parameters: {
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/color-palette/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const meta: Meta< typeof ColorPalette > = {
id: 'components-colorpalette',
component: ColorPalette,
argTypes: {
as: { control: { type: false } },
onChange: { action: 'onChange', control: { type: false } },
value: { control: { type: false } },
as: { control: false },
onChange: { action: 'onChange', control: false },
value: { control: false },
},
parameters: {
controls: { expanded: true },
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/color-picker/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const meta: Meta< typeof ColorPicker > = {
title: 'Components/Selection & Input/Color/ColorPicker',
id: 'components-colorpicker',
argTypes: {
as: { control: { type: false } },
color: { control: { type: false } },
as: { control: false },
color: { control: false },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const meta: Meta< typeof ComboboxControl > = {
id: 'components-comboboxcontrol',
component: ComboboxControl,
argTypes: {
value: { control: { type: false } },
value: { control: false },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/composite/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ const meta: Meta< typeof Composite > = {
'Composite.Context': Composite.Context,
},
argTypes: {
children: { control: { type: false } },
render: { control: { type: false } },
setActiveId: { control: { type: false } },
children: { control: false },
render: { control: false },
setActiveId: { control: false },
focusLoop: {
control: 'select',
options: [ true, false, 'horizontal', 'vertical', 'both' ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const meta: Meta< typeof ConfirmDialog > = {
id: 'components-experimental-confirmdialog',
argTypes: {
isOpen: {
control: { type: false },
control: false,
},
},
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const meta: Meta< typeof CustomSelectControlV2 > = {
'CustomSelectControlV2.Item': CustomSelectControlV2.Item,
},
argTypes: {
children: { control: { type: false } },
value: { control: { type: false } },
children: { control: false },
value: { control: false },
},
tags: [ 'status-wip' ],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const meta: Meta< typeof CustomSelectControl > = {
component: CustomSelectControl,
id: 'components-customselectcontrol',
argTypes: {
onChange: { control: { type: false } },
value: { control: { type: false } },
onChange: { control: false },
value: { control: false },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const meta: Meta< typeof DateTimePicker > = {
component: DateTimePicker,
argTypes: {
currentDate: { control: 'date' },
onChange: { action: 'onChange', control: { type: false } },
onChange: { action: 'onChange', control: false },
},
parameters: {
controls: { expanded: true },
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/date-time/stories/date.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const meta: Meta< typeof DatePicker > = {
component: DatePicker,
argTypes: {
currentDate: { control: 'date' },
onChange: { action: 'onChange', control: { type: false } },
onChange: { action: 'onChange', control: false },
},
parameters: {
controls: { expanded: true },
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/date-time/stories/time.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const meta: Meta< typeof TimePicker > = {
subcomponents: { 'TimePicker.TimeInput': TimePicker.TimeInput },
argTypes: {
currentTime: { control: 'date' },
onChange: { action: 'onChange', control: { type: false } },
onChange: { action: 'onChange', control: false },
},
parameters: {
controls: { expanded: true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const meta: Meta< typeof DimensionControl > = {
id: 'components-dimensioncontrol',
argTypes: {
onChange: { action: 'onChange' },
value: { control: { type: false } },
value: { control: false },
icon: {
control: { type: 'select' },
options: [ '-', 'desktop', 'tablet', 'mobile' ],
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/disabled/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const meta: Meta< typeof Disabled > = {
id: 'components-disabled',
component: Disabled,
argTypes: {
as: { control: { type: false } },
children: { control: { type: false } },
as: { control: false },
children: { control: false },
},
parameters: {
controls: {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/divider/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const meta: Meta< typeof Divider > = {
control: { type: 'text' },
},
wrapElement: {
control: { type: false },
control: false,
},
ref: {
table: {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/draggable/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const meta: Meta< typeof Draggable > = {
title: 'Components/Utilities/Draggable',
id: 'components-draggable',
argTypes: {
elementId: { control: { type: false } },
__experimentalDragComponent: { control: { type: false } },
elementId: { control: false },
__experimentalDragComponent: { control: false },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/dropdown-menu/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const meta: Meta< typeof DropdownMenu > = {
mapping: { menu, chevronDown, more },
control: { type: 'select' },
},
open: { control: { type: false } },
defaultOpen: { control: { type: false } },
onToggle: { control: { type: false } },
open: { control: false },
defaultOpen: { control: false },
onToggle: { control: false },
},
};
export default meta;
Expand Down
14 changes: 7 additions & 7 deletions packages/components/src/dropdown/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ const meta: Meta< typeof Dropdown > = {
type: 'radio',
},
},
position: { control: { type: false } },
renderContent: { control: { type: false } },
renderToggle: { control: { type: false } },
open: { control: { type: false } },
defaultOpen: { control: { type: false } },
onToggle: { control: { type: false } },
onClose: { control: { type: false } },
position: { control: false },
renderContent: { control: false },
renderToggle: { control: false },
open: { control: false },
defaultOpen: { control: false },
onToggle: { control: false },
onClose: { control: false },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const meta: Meta< typeof DuotonePicker > = {
component: DuotonePicker,
argTypes: {
onChange: { action: 'onChange' },
value: { control: { type: false } },
value: { control: false },
},
parameters: {
controls: { expanded: true },
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/flex/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const meta: Meta< typeof Flex > = {
argTypes: {
align: { control: { type: 'text' } },
as: { control: { type: 'text' } },
children: { control: { type: false } },
children: { control: false },
gap: { control: { type: 'text' } },
justify: { control: { type: 'text' } },
// Disabled isReversed because it's deprecated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const meta: Meta< typeof FontSizePicker > = {
title: 'Components/FontSizePicker',
component: FontSizePicker,
argTypes: {
value: { control: { type: false } },
value: { control: false },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Loading

1 comment on commit f45e35d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in f45e35d.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12184622478
📝 Reported issues:

Please sign in to comment.