Skip to content

Storybook: Fix control types #67646

New issue

Have a question about this project? Sign up for a free account to open an issue and contact its maintainers and the community.

By clicking “Sign up for ”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on ? Sign in to your account

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Storybook: Update false control types to undefined
  • Loading branch information
@tyxla
tyxla committedDec 5, 2024
commit ccde129911d9ccfc33f1549538a91bee1e379d38
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,13 +16,13 @@ const meta = {
component: AlignmentToolbar,
argTypes: {
value: {
control: { type: false },
control: { type: undefined },
Copy link
Member

Choose a reason for hiding this comment

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

I think we misread the docs 😂 Does this pass?

Suggested change
control: { type: undefined },
control: false,

Copy link
Member Author

Choose a reason for hiding this comment

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

Lol, looks like it does. Updated in e2b13c0

defaultValue: 'undefined',
description: 'The current value of the alignment setting.',
},
onChange: {
action: 'onChange',
control: { type: false },
control: { type: undefined },
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 numberDiff line numberDiff line change
Expand Up@@ -20,13 +20,13 @@ const meta = {
component: AlignmentControl,
argTypes: {
value: {
control: { type: false },
control: { type: undefined },
defaultValue: 'undefined',
description: 'The current value of the alignment setting.',
},
onChange: {
action: 'onChange',
control: { type: false },
control: { type: undefined },
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 numberDiff line numberDiff 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: { type: undefined } },
onChange: { action: 'changed' },
},
};
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@ export default {
title: 'BlockEditor (Private APIs)/DimensionsTool',
component: DimensionsTool,
argTypes: {
panelId: { control: { type: false } },
panelId: { control: { type: undefined } },
onChange: { action: 'changed' },
},
};
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
onChange: { action: 'changed' },
},
};
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
onChange: { action: 'changed' },
},
};
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@ export default {
title: 'BlockEditor (Private APIs)/ResolutionControl',
component: ResolutionTool,
argTypes: {
panelId: { control: { type: false } },
panelId: { control: { type: undefined } },
onChange: { action: 'changed' },
},
};
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,7 @@ export default {
control: 'check',
options: [ 'left', 'center', 'right', 'justify' ],
},
value: { control: { type: false } },
value: { control: { type: undefined } },
},
};

Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
value: { control: { type: undefined } },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
value: { control: { type: undefined } },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,7 @@ const meta: Meta< typeof BaseControl > = {
'BaseControl.VisualLabel': BaseControl.VisualLabel,
},
argTypes: {
children: { control: { type: false } },
children: { control: { type: undefined } },
help: { control: { type: 'text' } },
label: { control: { type: 'text' } },
},
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
},
parameters: {
controls: { expanded: true },
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
},
parameters: {
controls: { expanded: true },
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
},
parameters: {
controls: { expanded: true },
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/card/stories/index.story.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -26,10 +26,10 @@ const meta: Meta< typeof Card > = {
id: 'components-card',
argTypes: {
as: {
control: { type: false },
control: { type: undefined },
},
children: {
control: { type: false },
control: { type: undefined },
},
},
parameters: {
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,7 +24,7 @@ const meta: Meta< typeof CheckboxControl > = {
action: 'onChange',
},
checked: {
control: { type: false },
control: { type: undefined },
},
help: { control: { type: 'text' } },
},
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
options: { control: { type: undefined } },
children: { control: { type: 'text' } },
},
parameters: {
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
onChange: { action: 'onChange', control: { type: undefined } },
value: { control: { type: undefined } },
},
parameters: {
controls: { expanded: true },
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
color: { control: { type: undefined } },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/composite/stories/index.story.tsx
Original file line numberDiff line numberDiff 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: { type: undefined } },
render: { control: { type: undefined } },
setActiveId: { control: { type: undefined } },
focusLoop: {
control: 'select',
options: [ true, false, 'horizontal', 'vertical', 'both' ],
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ const meta: Meta< typeof ConfirmDialog > = {
id: 'components-experimental-confirmdialog',
argTypes: {
isOpen: {
control: { type: false },
control: { type: undefined },
},
},
parameters: {
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
value: { control: { type: undefined } },
},
tags: [ 'status-wip' ],
parameters: {
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
value: { control: { type: undefined } },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
},
parameters: {
controls: { expanded: true },
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/date-time/stories/date.story.tsx
Original file line numberDiff line numberDiff 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: { type: undefined } },
},
parameters: {
controls: { expanded: true },
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/date-time/stories/time.story.tsx
Original file line numberDiff line numberDiff 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: { type: undefined } },
},
parameters: {
controls: { expanded: true },
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
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 numberDiff line numberDiff 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: { type: undefined } },
children: { control: { type: undefined } },
},
parameters: {
controls: {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/divider/stories/index.story.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,7 +24,7 @@ const meta: Meta< typeof Divider > = {
control: { type: 'text' },
},
wrapElement: {
control: { type: false },
control: { type: undefined },
},
ref: {
table: {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/draggable/stories/index.story.tsx
Original file line numberDiff line numberDiff 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: { type: undefined } },
__experimentalDragComponent: { control: { type: undefined } },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
defaultOpen: { control: { type: undefined } },
onToggle: { control: { type: undefined } },
},
};
export default meta;
Expand Down
14 changes: 7 additions & 7 deletions packages/components/src/dropdown/stories/index.story.tsx
Original file line numberDiff line numberDiff 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: { type: undefined } },
renderContent: { control: { type: undefined } },
renderToggle: { control: { type: undefined } },
open: { control: { type: undefined } },
defaultOpen: { control: { type: undefined } },
onToggle: { control: { type: undefined } },
onClose: { control: { type: undefined } },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
},
parameters: {
controls: { expanded: true },
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/flex/stories/index.story.tsx
Original file line numberDiff line numberDiff 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: { type: undefined } },
gap: { control: { type: 'text' } },
justify: { control: { type: 'text' } },
// Disabled isReversed because it's deprecated.
Expand Down
Original file line numberDiff line numberDiff 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: { type: undefined } },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Loading
Loading