Skip to content

Commit

Permalink
Storybook: Update control types from null to undefined (#67581)
Browse files Browse the repository at this point in the history
* control type null => undefined

* undefined -> false

* Also disable NumberControl value control

Co-authored-by: tyxla <[email protected]>
Co-authored-by: mirka <[email protected]>
  • Loading branch information
3 people authored Dec 5, 2024
1 parent 1418350 commit c93fd2d
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: null },
control: { type: false },
defaultValue: 'undefined',
description: 'The current value of the alignment setting.',
},
onChange: {
action: 'onChange',
control: { type: null },
control: { type: 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: null },
control: { type: false },
defaultValue: 'undefined',
description: 'The current value of the alignment setting.',
},
onChange: {
action: 'onChange',
control: { type: null },
control: { type: 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: null } },
panelId: { control: { type: 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: null } },
panelId: { control: { type: 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: null } },
panelId: { control: { type: 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: null } },
panelId: { control: { type: 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: null } },
panelId: { control: { type: 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: null } },
value: { control: { type: 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: null } },
value: { control: { type: null } },
onChange: { control: { type: false } },
value: { control: { type: 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: null } },
value: { control: { type: null } },
as: { control: { type: false } },
value: { control: { type: 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: null } },
children: { control: { type: 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: null } },
value: { control: { type: 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: null } },
value: { control: { type: 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: null } },
values: { control: { type: 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: null } },
children: { control: { type: 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: null },
control: { type: false },
},
children: {
control: { type: null },
control: { type: 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: null },
control: { type: 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: null } },
options: { control: { type: null } },
actions: { control: { type: false } },
options: { control: { type: 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: null } },
onChange: { action: 'onChange', control: { type: null } },
value: { control: { type: null } },
as: { control: { type: false } },
onChange: { action: 'onChange', control: { type: false } },
value: { control: { type: 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: null } },
color: { control: { type: null } },
as: { control: { type: false } },
color: { control: { type: 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: null } },
value: { control: { type: 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: null } },
render: { control: { type: null } },
setActiveId: { control: { type: null } },
children: { control: { type: false } },
render: { control: { type: false } },
setActiveId: { control: { type: 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: null },
control: { type: 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: null } },
value: { control: { type: null } },
children: { control: { type: false } },
value: { control: { type: 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: null } },
value: { control: { type: null } },
onChange: { control: { type: false } },
value: { control: { type: 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: null } },
onChange: { action: 'onChange', control: { type: 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: null } },
onChange: { action: 'onChange', control: { type: 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: null } },
onChange: { action: 'onChange', control: { type: 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: null } },
value: { control: { type: 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: null } },
children: { control: { type: null } },
as: { control: { type: false } },
children: { control: { type: 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: null },
control: { type: 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: null } },
__experimentalDragComponent: { control: { type: null } },
elementId: { control: { type: false } },
__experimentalDragComponent: { control: { type: 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: null } },
defaultOpen: { control: { type: null } },
onToggle: { control: { type: null } },
open: { control: { type: false } },
defaultOpen: { control: { type: false } },
onToggle: { control: { type: 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: null } },
renderContent: { control: { type: null } },
renderToggle: { control: { type: null } },
open: { control: { type: null } },
defaultOpen: { control: { type: null } },
onToggle: { control: { type: null } },
onClose: { control: { type: null } },
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 } },
},
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: null } },
value: { control: { type: 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: null } },
children: { control: { type: 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: null } },
value: { control: { type: false } },
},
parameters: {
actions: { argTypesRegex: '^on.*' },
Expand Down
Loading

0 comments on commit c93fd2d

Please sign in to comment.