@wordpress/components 30.1.0 → 30.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -3
- package/build/custom-gradient-picker/serializer.js +14 -0
- package/build/custom-gradient-picker/serializer.js.map +1 -1
- package/build/custom-gradient-picker/utils.js +12 -0
- package/build/custom-gradient-picker/utils.js.map +1 -1
- package/build/date-time/date/index.js +2 -4
- package/build/date-time/date/index.js.map +1 -1
- package/build/date-time/date/styles.js +41 -20
- package/build/date-time/date/styles.js.map +1 -1
- package/build/menu-item/index.js +1 -0
- package/build/menu-item/index.js.map +1 -1
- package/build/validated-form-controls/components/checkbox-control.js +5 -3
- package/build/validated-form-controls/components/checkbox-control.js.map +1 -1
- package/build/validated-form-controls/components/combobox-control.js +5 -3
- package/build/validated-form-controls/components/combobox-control.js.map +1 -1
- package/build/validated-form-controls/components/custom-select-control.js +5 -3
- package/build/validated-form-controls/components/custom-select-control.js.map +1 -1
- package/build/validated-form-controls/components/input-control.js +5 -3
- package/build/validated-form-controls/components/input-control.js.map +1 -1
- package/build/validated-form-controls/components/number-control.js +5 -3
- package/build/validated-form-controls/components/number-control.js.map +1 -1
- package/build/validated-form-controls/components/radio-control.js +5 -3
- package/build/validated-form-controls/components/radio-control.js.map +1 -1
- package/build/validated-form-controls/components/range-control.js +5 -3
- package/build/validated-form-controls/components/range-control.js.map +1 -1
- package/build/validated-form-controls/components/select-control.js +5 -3
- package/build/validated-form-controls/components/select-control.js.map +1 -1
- package/build/validated-form-controls/components/text-control.js +5 -3
- package/build/validated-form-controls/components/text-control.js.map +1 -1
- package/build/validated-form-controls/components/textarea-control.js +5 -3
- package/build/validated-form-controls/components/textarea-control.js.map +1 -1
- package/build/validated-form-controls/components/toggle-control.js +5 -3
- package/build/validated-form-controls/components/toggle-control.js.map +1 -1
- package/build/validated-form-controls/components/toggle-group-control.js +5 -3
- package/build/validated-form-controls/components/toggle-group-control.js.map +1 -1
- package/build/validated-form-controls/components/types.js.map +1 -1
- package/build/validated-form-controls/control-with-error.js +57 -22
- package/build/validated-form-controls/control-with-error.js.map +1 -1
- package/build/validated-form-controls/validity-indicator.js +45 -0
- package/build/validated-form-controls/validity-indicator.js.map +1 -0
- package/build-module/custom-gradient-picker/serializer.js +14 -0
- package/build-module/custom-gradient-picker/serializer.js.map +1 -1
- package/build-module/custom-gradient-picker/utils.js +12 -0
- package/build-module/custom-gradient-picker/utils.js.map +1 -1
- package/build-module/date-time/date/index.js +3 -4
- package/build-module/date-time/date/index.js.map +1 -1
- package/build-module/date-time/date/styles.js +39 -14
- package/build-module/date-time/date/styles.js.map +1 -1
- package/build-module/menu-item/index.js +1 -0
- package/build-module/menu-item/index.js.map +1 -1
- package/build-module/validated-form-controls/components/checkbox-control.js +5 -3
- package/build-module/validated-form-controls/components/checkbox-control.js.map +1 -1
- package/build-module/validated-form-controls/components/combobox-control.js +5 -3
- package/build-module/validated-form-controls/components/combobox-control.js.map +1 -1
- package/build-module/validated-form-controls/components/custom-select-control.js +5 -3
- package/build-module/validated-form-controls/components/custom-select-control.js.map +1 -1
- package/build-module/validated-form-controls/components/input-control.js +5 -3
- package/build-module/validated-form-controls/components/input-control.js.map +1 -1
- package/build-module/validated-form-controls/components/number-control.js +5 -3
- package/build-module/validated-form-controls/components/number-control.js.map +1 -1
- package/build-module/validated-form-controls/components/radio-control.js +5 -3
- package/build-module/validated-form-controls/components/radio-control.js.map +1 -1
- package/build-module/validated-form-controls/components/range-control.js +5 -3
- package/build-module/validated-form-controls/components/range-control.js.map +1 -1
- package/build-module/validated-form-controls/components/select-control.js +5 -3
- package/build-module/validated-form-controls/components/select-control.js.map +1 -1
- package/build-module/validated-form-controls/components/text-control.js +5 -3
- package/build-module/validated-form-controls/components/text-control.js.map +1 -1
- package/build-module/validated-form-controls/components/textarea-control.js +5 -3
- package/build-module/validated-form-controls/components/textarea-control.js.map +1 -1
- package/build-module/validated-form-controls/components/toggle-control.js +5 -3
- package/build-module/validated-form-controls/components/toggle-control.js.map +1 -1
- package/build-module/validated-form-controls/components/toggle-group-control.js +5 -3
- package/build-module/validated-form-controls/components/toggle-group-control.js.map +1 -1
- package/build-module/validated-form-controls/components/types.js.map +1 -1
- package/build-module/validated-form-controls/control-with-error.js +57 -21
- package/build-module/validated-form-controls/control-with-error.js.map +1 -1
- package/build-module/validated-form-controls/validity-indicator.js +37 -0
- package/build-module/validated-form-controls/validity-indicator.js.map +1 -0
- package/build-style/style-rtl.css +37 -25
- package/build-style/style.css +37 -25
- package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/serializer.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/utils.d.ts.map +1 -1
- package/build-types/date-time/date/index.d.ts.map +1 -1
- package/build-types/date-time/date/styles.d.ts +6 -0
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/divider/stories/index.story.d.ts.map +1 -1
- package/build-types/elevation/stories/index.story.d.ts.map +1 -1
- package/build-types/form-token-field/stories/index.story.d.ts +10 -5
- package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
- package/build-types/gradient-picker/stories/index.story.d.ts +2 -1
- package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/grid/stories/index.story.d.ts.map +1 -1
- package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
- package/build-types/heading/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/item-group/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-item/index.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts.map +1 -1
- package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
- package/build-types/spacer/stories/index.story.d.ts.map +1 -1
- package/build-types/surface/stories/index.story.d.ts.map +1 -1
- package/build-types/text/stories/index.story.d.ts.map +1 -1
- package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
- package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/truncate/stories/index.story.d.ts.map +1 -1
- package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/checkbox-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/combobox-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/custom-select-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/input-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/radio-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/select-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/checkbox-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/input-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/number-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts +13 -0
- package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/radio-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/range-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/select-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/text-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/text-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/textarea-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/toggle-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/toggle-group-control.d.ts.map +1 -1
- package/build-types/validated-form-controls/components/types.d.ts +21 -10
- package/build-types/validated-form-controls/components/types.d.ts.map +1 -1
- package/build-types/validated-form-controls/control-with-error.d.ts +4 -5
- package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
- package/build-types/validated-form-controls/validity-indicator.d.ts +5 -0
- package/build-types/validated-form-controls/validity-indicator.d.ts.map +1 -0
- package/build-types/view/stories/index.story.d.ts.map +1 -1
- package/build-types/z-stack/stories/index.story.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/button/style.scss +3 -3
- package/src/calendar/style.scss +22 -22
- package/src/confirm-dialog/stories/index.story.tsx +3 -2
- package/src/custom-gradient-picker/serializer.ts +14 -0
- package/src/custom-gradient-picker/test/serializer.ts +25 -0
- package/src/custom-gradient-picker/utils.ts +10 -0
- package/src/date-time/date/index.tsx +4 -3
- package/src/date-time/date/styles.ts +13 -20
- package/src/divider/stories/index.story.tsx +2 -1
- package/src/elevation/stories/index.story.tsx +2 -1
- package/src/form-token-field/stories/index.story.tsx +15 -7
- package/src/gradient-picker/stories/index.story.tsx +48 -0
- package/src/grid/stories/index.story.tsx +2 -1
- package/src/h-stack/stories/e2e/index.story.tsx +1 -1
- package/src/h-stack/stories/index.story.tsx +3 -2
- package/src/heading/stories/index.story.tsx +3 -2
- package/src/input-control/stories/index.story.tsx +3 -2
- package/src/item-group/stories/index.story.tsx +2 -1
- package/src/menu/stories/index.story.tsx +1 -1
- package/src/menu-item/index.tsx +1 -0
- package/src/number-control/stories/index.story.tsx +3 -2
- package/src/scrollable/stories/index.story.tsx +2 -1
- package/src/spacer/stories/index.story.tsx +2 -1
- package/src/surface/stories/index.story.tsx +2 -1
- package/src/text/stories/index.story.tsx +3 -2
- package/src/toggle-group-control/stories/index.story.tsx +3 -2
- package/src/tools-panel/stories/index.story.tsx +2 -1
- package/src/tree-grid/stories/index.story.tsx +3 -2
- package/src/truncate/stories/index.story.tsx +3 -2
- package/src/unit-control/stories/index.story.tsx +3 -2
- package/src/utils/theme-variables.scss +1 -0
- package/src/v-stack/stories/e2e/index.story.tsx +1 -1
- package/src/v-stack/stories/index.story.tsx +3 -2
- package/src/validated-form-controls/components/checkbox-control.tsx +5 -3
- package/src/validated-form-controls/components/combobox-control.tsx +5 -3
- package/src/validated-form-controls/components/custom-select-control.tsx +5 -3
- package/src/validated-form-controls/components/input-control.tsx +5 -3
- package/src/validated-form-controls/components/number-control.tsx +5 -3
- package/src/validated-form-controls/components/radio-control.tsx +5 -3
- package/src/validated-form-controls/components/range-control.tsx +5 -3
- package/src/validated-form-controls/components/select-control.tsx +5 -3
- package/src/validated-form-controls/components/stories/checkbox-control.story.tsx +19 -7
- package/src/validated-form-controls/components/stories/combobox-control.story.tsx +19 -7
- package/src/validated-form-controls/components/stories/custom-select-control.story.tsx +19 -7
- package/src/validated-form-controls/components/stories/input-control.story.tsx +53 -19
- package/src/validated-form-controls/components/stories/number-control.story.tsx +19 -7
- package/src/validated-form-controls/components/stories/overview.mdx +2 -2
- package/src/validated-form-controls/components/stories/overview.story.tsx +124 -16
- package/src/validated-form-controls/components/stories/radio-control.story.tsx +19 -7
- package/src/validated-form-controls/components/stories/range-control.story.tsx +19 -7
- package/src/validated-form-controls/components/stories/select-control.story.tsx +19 -7
- package/src/validated-form-controls/components/stories/text-control.story.tsx +19 -7
- package/src/validated-form-controls/components/stories/textarea-control.story.tsx +19 -7
- package/src/validated-form-controls/components/stories/toggle-control.story.tsx +19 -7
- package/src/validated-form-controls/components/stories/toggle-group-control.story.tsx +19 -7
- package/src/validated-form-controls/components/text-control.tsx +5 -3
- package/src/validated-form-controls/components/textarea-control.tsx +5 -3
- package/src/validated-form-controls/components/toggle-control.tsx +5 -3
- package/src/validated-form-controls/components/toggle-group-control.tsx +5 -3
- package/src/validated-form-controls/components/types.ts +21 -12
- package/src/validated-form-controls/control-with-error.tsx +77 -26
- package/src/validated-form-controls/style.scss +19 -5
- package/src/validated-form-controls/validity-indicator.tsx +48 -0
- package/src/view/stories/index.story.tsx +2 -1
- package/src/z-stack/stories/index.story.tsx +2 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -12,7 +12,7 @@ import { Flex } from '../../flex';
|
|
|
12
12
|
|
|
13
13
|
const meta: Meta< typeof Divider > = {
|
|
14
14
|
component: Divider,
|
|
15
|
-
title: 'Components
|
|
15
|
+
title: 'Components/Divider',
|
|
16
16
|
argTypes: {
|
|
17
17
|
margin: {
|
|
18
18
|
control: { type: 'text' },
|
|
@@ -32,6 +32,7 @@ const meta: Meta< typeof Divider > = {
|
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
|
+
tags: [ 'status-experimental' ],
|
|
35
36
|
parameters: {
|
|
36
37
|
controls: { expanded: true },
|
|
37
38
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -10,11 +10,12 @@ import { Elevation } from '..';
|
|
|
10
10
|
|
|
11
11
|
const meta: Meta< typeof Elevation > = {
|
|
12
12
|
component: Elevation,
|
|
13
|
-
title: 'Components
|
|
13
|
+
title: 'Components/Elevation',
|
|
14
14
|
argTypes: {
|
|
15
15
|
as: { control: { type: 'text' } },
|
|
16
16
|
borderRadius: { control: { type: 'text' } },
|
|
17
17
|
},
|
|
18
|
+
tags: [ 'status-experimental' ],
|
|
18
19
|
parameters: {
|
|
19
20
|
controls: {
|
|
20
21
|
expanded: true,
|
|
@@ -115,28 +115,36 @@ DropdownSelector.args = {
|
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
|
-
* The rendered
|
|
119
|
-
* render function to the `
|
|
120
|
-
*
|
|
118
|
+
* The rendered content of each token can be customized by passing a
|
|
119
|
+
* render function to the `displayTransform` prop.
|
|
120
|
+
*
|
|
121
|
+
* Similarly, each suggestion can be customized by passing a
|
|
122
|
+
* render function to the `__experimentalRenderItem` prop. (This is still an
|
|
123
|
+
* experimental feature and is subject to change.)
|
|
121
124
|
*/
|
|
122
|
-
export const
|
|
125
|
+
export const WithCustomRenderedItems: StoryFn< typeof FormTokenField > =
|
|
123
126
|
DefaultTemplate.bind( {} );
|
|
124
|
-
|
|
127
|
+
WithCustomRenderedItems.args = {
|
|
125
128
|
...Default.args,
|
|
129
|
+
displayTransform: ( token ) => `📍 ${ token }`,
|
|
126
130
|
__experimentalRenderItem: ( { item } ) => (
|
|
127
131
|
<div>{ `${ item } — a nice place to visit` }</div>
|
|
128
132
|
),
|
|
133
|
+
__experimentalExpandOnFocus: true,
|
|
129
134
|
};
|
|
130
135
|
|
|
131
136
|
/**
|
|
132
137
|
* Only values for which the `__experimentalValidateInput` function returns
|
|
133
138
|
* `true` will be tokenized. (This is still an experimental feature and is
|
|
134
139
|
* subject to change.)
|
|
140
|
+
*
|
|
141
|
+
* In this example, the user can only add tokens that are already in the list.
|
|
135
142
|
*/
|
|
136
|
-
export const
|
|
143
|
+
export const ValidateNewTokens: StoryFn< typeof FormTokenField > =
|
|
137
144
|
DefaultTemplate.bind( {} );
|
|
138
|
-
|
|
145
|
+
ValidateNewTokens.args = {
|
|
139
146
|
...Default.args,
|
|
140
147
|
__experimentalValidateInput: ( input: string ) =>
|
|
141
148
|
continents.includes( input ),
|
|
149
|
+
__experimentalExpandOnFocus: true,
|
|
142
150
|
};
|
|
@@ -64,6 +64,18 @@ const GRADIENTS = [
|
|
|
64
64
|
'linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)',
|
|
65
65
|
slug: 'cool-to-warm-spectrum',
|
|
66
66
|
},
|
|
67
|
+
{
|
|
68
|
+
name: 'HSL blue to purple',
|
|
69
|
+
gradient:
|
|
70
|
+
'linear-gradient(135deg,hsl(200, 100%, 50%) 0%,hsl(280, 100%, 60%) 100%)',
|
|
71
|
+
slug: 'hsl-blue-to-purple',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'HSLA green to red',
|
|
75
|
+
gradient:
|
|
76
|
+
'linear-gradient(135deg,hsla(120, 100%, 40%, 0.85) 0%,hsla(0, 100%, 50%, 0.85) 100%)',
|
|
77
|
+
slug: 'hsla-green-to-red',
|
|
78
|
+
},
|
|
67
79
|
];
|
|
68
80
|
|
|
69
81
|
const Template: StoryFn< typeof GradientPicker > = ( {
|
|
@@ -103,3 +115,39 @@ MultipleOrigins.args = {
|
|
|
103
115
|
{ name: 'Origin 2', gradients: GRADIENTS },
|
|
104
116
|
],
|
|
105
117
|
};
|
|
118
|
+
|
|
119
|
+
export const CSSVariables: StoryFn< typeof GradientPicker > = ( args ) => {
|
|
120
|
+
return (
|
|
121
|
+
<div
|
|
122
|
+
style={ {
|
|
123
|
+
'--red': '#f00',
|
|
124
|
+
'--yellow': '#ff0',
|
|
125
|
+
'--blue': '#00f',
|
|
126
|
+
} }
|
|
127
|
+
>
|
|
128
|
+
<Template { ...args } />
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
CSSVariables.args = {
|
|
133
|
+
...Default.args,
|
|
134
|
+
gradients: [
|
|
135
|
+
{
|
|
136
|
+
name: 'Red to Yellow',
|
|
137
|
+
gradient:
|
|
138
|
+
'linear-gradient(135deg,var(--red) 0%,var(--yellow) 100%)',
|
|
139
|
+
slug: 'red-to-yellow',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'Yellow to Blue',
|
|
143
|
+
gradient:
|
|
144
|
+
'linear-gradient(135deg,var(--yellow) 0%,var(--blue) 100%)',
|
|
145
|
+
slug: 'yellow-to-blue',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'Blue to Red',
|
|
149
|
+
gradient: 'linear-gradient(135deg,var(--blue) 0%,var(--red) 100%)',
|
|
150
|
+
slug: 'blue-to-red',
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
};
|
|
@@ -11,7 +11,7 @@ import { Grid } from '..';
|
|
|
11
11
|
|
|
12
12
|
const meta: Meta< typeof Grid > = {
|
|
13
13
|
component: Grid,
|
|
14
|
-
title: 'Components
|
|
14
|
+
title: 'Components/Grid',
|
|
15
15
|
argTypes: {
|
|
16
16
|
as: { control: { type: 'text' } },
|
|
17
17
|
align: { control: { type: 'text' } },
|
|
@@ -30,6 +30,7 @@ const meta: Meta< typeof Grid > = {
|
|
|
30
30
|
templateColumns: { control: { type: 'text' } },
|
|
31
31
|
templateRows: { control: { type: 'text' } },
|
|
32
32
|
},
|
|
33
|
+
tags: [ 'status-experimental' ],
|
|
33
34
|
parameters: {
|
|
34
35
|
controls: {
|
|
35
36
|
expanded: true,
|
|
@@ -42,8 +42,8 @@ const JUSTIFICATIONS = {
|
|
|
42
42
|
|
|
43
43
|
const meta: Meta< typeof HStack > = {
|
|
44
44
|
component: HStack,
|
|
45
|
-
title: 'Components
|
|
46
|
-
id: 'components-
|
|
45
|
+
title: 'Components/Layout/HStack',
|
|
46
|
+
id: 'components-hstack',
|
|
47
47
|
argTypes: {
|
|
48
48
|
as: {
|
|
49
49
|
control: false,
|
|
@@ -70,6 +70,7 @@ const meta: Meta< typeof HStack > = {
|
|
|
70
70
|
control: { type: 'text' },
|
|
71
71
|
},
|
|
72
72
|
},
|
|
73
|
+
tags: [ 'status-experimental' ],
|
|
73
74
|
parameters: {
|
|
74
75
|
controls: { expanded: true },
|
|
75
76
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -10,8 +10,8 @@ import { Heading } from '..';
|
|
|
10
10
|
|
|
11
11
|
const meta: Meta< typeof Heading > = {
|
|
12
12
|
component: Heading,
|
|
13
|
-
title: 'Components
|
|
14
|
-
id: 'components-
|
|
13
|
+
title: 'Components/Typography/Heading',
|
|
14
|
+
id: 'components-heading',
|
|
15
15
|
argTypes: {
|
|
16
16
|
as: { control: { type: 'text' } },
|
|
17
17
|
color: { control: { type: 'color' } },
|
|
@@ -25,6 +25,7 @@ const meta: Meta< typeof Heading > = {
|
|
|
25
25
|
},
|
|
26
26
|
weight: { control: { type: 'text' } },
|
|
27
27
|
},
|
|
28
|
+
tags: [ 'status-experimental' ],
|
|
28
29
|
parameters: {
|
|
29
30
|
controls: { expanded: true },
|
|
30
31
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -16,8 +16,8 @@ import { InputControlSuffixWrapper } from '../input-suffix-wrapper';
|
|
|
16
16
|
import Button from '../../button';
|
|
17
17
|
|
|
18
18
|
const meta: Meta< typeof InputControl > = {
|
|
19
|
-
title: 'Components
|
|
20
|
-
id: 'components-
|
|
19
|
+
title: 'Components/Selection & Input/Common/InputControl',
|
|
20
|
+
id: 'components-inputcontrol',
|
|
21
21
|
component: InputControl,
|
|
22
22
|
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
23
23
|
subcomponents: { InputControlPrefixWrapper, InputControlSuffixWrapper },
|
|
@@ -30,6 +30,7 @@ const meta: Meta< typeof InputControl > = {
|
|
|
30
30
|
type: { control: { type: 'text' } },
|
|
31
31
|
value: { control: { disable: true } },
|
|
32
32
|
},
|
|
33
|
+
tags: [ 'status-experimental' ],
|
|
33
34
|
parameters: {
|
|
34
35
|
actions: { argTypesRegex: '^on.*' },
|
|
35
36
|
controls: { expanded: true },
|
|
@@ -15,11 +15,12 @@ const meta: Meta< typeof ItemGroup > = {
|
|
|
15
15
|
component: ItemGroup,
|
|
16
16
|
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
17
17
|
subcomponents: { Item },
|
|
18
|
-
title: 'Components
|
|
18
|
+
title: 'Components/ItemGroup',
|
|
19
19
|
argTypes: {
|
|
20
20
|
as: { control: false },
|
|
21
21
|
children: { control: false },
|
|
22
22
|
},
|
|
23
|
+
tags: [ 'status-experimental' ],
|
|
23
24
|
parameters: {
|
|
24
25
|
controls: { expanded: true },
|
|
25
26
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -24,7 +24,7 @@ import type { Props } from '../types';
|
|
|
24
24
|
|
|
25
25
|
const meta: Meta< typeof Menu > = {
|
|
26
26
|
id: 'components-menu',
|
|
27
|
-
title: 'Components
|
|
27
|
+
title: 'Components/Actions/Menu',
|
|
28
28
|
component: Menu,
|
|
29
29
|
subcomponents: {
|
|
30
30
|
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
package/src/menu-item/index.tsx
CHANGED
|
@@ -14,8 +14,8 @@ import { useState } from '@wordpress/element';
|
|
|
14
14
|
import NumberControl from '..';
|
|
15
15
|
|
|
16
16
|
const meta: Meta< typeof NumberControl > = {
|
|
17
|
-
title: 'Components
|
|
18
|
-
id: 'components-
|
|
17
|
+
title: 'Components/Selection & Input/Common/NumberControl',
|
|
18
|
+
id: 'components-numbercontrol',
|
|
19
19
|
component: NumberControl,
|
|
20
20
|
argTypes: {
|
|
21
21
|
onChange: { action: 'onChange' },
|
|
@@ -25,6 +25,7 @@ const meta: Meta< typeof NumberControl > = {
|
|
|
25
25
|
type: { control: { type: 'text' } },
|
|
26
26
|
value: { control: false },
|
|
27
27
|
},
|
|
28
|
+
tags: [ 'status-experimental' ],
|
|
28
29
|
parameters: {
|
|
29
30
|
controls: { expanded: true },
|
|
30
31
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -16,7 +16,7 @@ import { Scrollable } from '..';
|
|
|
16
16
|
|
|
17
17
|
const meta: Meta< typeof Scrollable > = {
|
|
18
18
|
component: Scrollable,
|
|
19
|
-
title: 'Components
|
|
19
|
+
title: 'Components/Scrollable',
|
|
20
20
|
argTypes: {
|
|
21
21
|
as: {
|
|
22
22
|
control: { type: 'text' },
|
|
@@ -25,6 +25,7 @@ const meta: Meta< typeof Scrollable > = {
|
|
|
25
25
|
control: false,
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
|
+
tags: [ 'status-experimental' ],
|
|
28
29
|
parameters: {
|
|
29
30
|
controls: {
|
|
30
31
|
expanded: true,
|
|
@@ -31,7 +31,7 @@ const controls = [
|
|
|
31
31
|
|
|
32
32
|
const meta: Meta< typeof Spacer > = {
|
|
33
33
|
component: Spacer,
|
|
34
|
-
title: 'Components
|
|
34
|
+
title: 'Components/Spacer',
|
|
35
35
|
argTypes: {
|
|
36
36
|
as: { control: { type: 'text' } },
|
|
37
37
|
children: {
|
|
@@ -39,6 +39,7 @@ const meta: Meta< typeof Spacer > = {
|
|
|
39
39
|
},
|
|
40
40
|
...controls,
|
|
41
41
|
},
|
|
42
|
+
tags: [ 'status-experimental' ],
|
|
42
43
|
parameters: {
|
|
43
44
|
controls: {
|
|
44
45
|
expanded: true,
|
|
@@ -11,11 +11,12 @@ import { Text } from '../../text';
|
|
|
11
11
|
|
|
12
12
|
const meta: Meta< typeof Surface > = {
|
|
13
13
|
component: Surface,
|
|
14
|
-
title: 'Components
|
|
14
|
+
title: 'Components/Surface',
|
|
15
15
|
argTypes: {
|
|
16
16
|
children: { control: false },
|
|
17
17
|
as: { control: { type: 'text' } },
|
|
18
18
|
},
|
|
19
|
+
tags: [ 'status-experimental' ],
|
|
19
20
|
parameters: {
|
|
20
21
|
controls: {
|
|
21
22
|
expanded: true,
|
|
@@ -10,8 +10,8 @@ import { Text } from '../component';
|
|
|
10
10
|
|
|
11
11
|
const meta: Meta< typeof Text > = {
|
|
12
12
|
component: Text,
|
|
13
|
-
title: 'Components
|
|
14
|
-
id: 'components-
|
|
13
|
+
title: 'Components/Typography/Text',
|
|
14
|
+
id: 'components-text',
|
|
15
15
|
argTypes: {
|
|
16
16
|
as: { control: { type: 'text' } },
|
|
17
17
|
color: { control: { type: 'color' } },
|
|
@@ -26,6 +26,7 @@ const meta: Meta< typeof Text > = {
|
|
|
26
26
|
},
|
|
27
27
|
weight: { control: { type: 'text' } },
|
|
28
28
|
},
|
|
29
|
+
tags: [ 'status-experimental' ],
|
|
29
30
|
parameters: {
|
|
30
31
|
actions: { argTypesRegex: '^on.*' },
|
|
31
32
|
controls: { expanded: true },
|
|
@@ -27,13 +27,14 @@ const meta: Meta< typeof ToggleGroupControl > = {
|
|
|
27
27
|
component: ToggleGroupControl,
|
|
28
28
|
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
29
29
|
subcomponents: { ToggleGroupControlOption, ToggleGroupControlOptionIcon },
|
|
30
|
-
title: 'Components
|
|
31
|
-
id: 'components-
|
|
30
|
+
title: 'Components/Selection & Input/Common/ToggleGroupControl',
|
|
31
|
+
id: 'components-togglegroupcontrol',
|
|
32
32
|
argTypes: {
|
|
33
33
|
help: { control: { type: 'text' } },
|
|
34
34
|
onChange: { action: 'onChange' },
|
|
35
35
|
value: { control: false },
|
|
36
36
|
},
|
|
37
|
+
tags: [ 'status-experimental' ],
|
|
37
38
|
parameters: {
|
|
38
39
|
controls: { expanded: true },
|
|
39
40
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -26,7 +26,7 @@ import UnitControl from '../../unit-control';
|
|
|
26
26
|
import { createSlotFill, Provider as SlotFillProvider } from '../../slot-fill';
|
|
27
27
|
|
|
28
28
|
const meta: Meta< typeof ToolsPanel > = {
|
|
29
|
-
title: 'Components
|
|
29
|
+
title: 'Components/ToolsPanel',
|
|
30
30
|
component: ToolsPanel,
|
|
31
31
|
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
32
32
|
subcomponents: { ToolsPanelItem },
|
|
@@ -36,6 +36,7 @@ const meta: Meta< typeof ToolsPanel > = {
|
|
|
36
36
|
panelId: { control: false },
|
|
37
37
|
resetAll: { action: 'resetAll' },
|
|
38
38
|
},
|
|
39
|
+
tags: [ 'status-experimental' ],
|
|
39
40
|
parameters: {
|
|
40
41
|
actions: { argTypesRegex: '^on.*' },
|
|
41
42
|
controls: {
|
|
@@ -16,14 +16,15 @@ import { Button } from '../../button';
|
|
|
16
16
|
import InputControl from '../../input-control';
|
|
17
17
|
|
|
18
18
|
const meta: Meta< typeof TreeGrid > = {
|
|
19
|
-
title: 'Components
|
|
20
|
-
id: 'components-
|
|
19
|
+
title: 'Components/Navigation/TreeGrid',
|
|
20
|
+
id: 'components-treegrid',
|
|
21
21
|
component: TreeGrid,
|
|
22
22
|
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
|
|
23
23
|
subcomponents: { TreeGridRow, TreeGridCell },
|
|
24
24
|
argTypes: {
|
|
25
25
|
children: { control: false },
|
|
26
26
|
},
|
|
27
|
+
tags: [ 'status-experimental' ],
|
|
27
28
|
parameters: {
|
|
28
29
|
actions: { argTypesRegex: '^on.*' },
|
|
29
30
|
controls: { expanded: true },
|
|
@@ -10,12 +10,13 @@ import { Truncate } from '..';
|
|
|
10
10
|
|
|
11
11
|
const meta: Meta< typeof Truncate > = {
|
|
12
12
|
component: Truncate,
|
|
13
|
-
title: 'Components
|
|
14
|
-
id: 'components-
|
|
13
|
+
title: 'Components/Typography/Truncate',
|
|
14
|
+
id: 'components-truncate',
|
|
15
15
|
argTypes: {
|
|
16
16
|
children: { control: { type: 'text' } },
|
|
17
17
|
as: { control: { type: 'text' } },
|
|
18
18
|
},
|
|
19
|
+
tags: [ 'status-experimental' ],
|
|
19
20
|
parameters: {
|
|
20
21
|
controls: {
|
|
21
22
|
expanded: true,
|
|
@@ -16,8 +16,8 @@ import { CSS_UNITS } from '../utils';
|
|
|
16
16
|
|
|
17
17
|
const meta: Meta< typeof UnitControl > = {
|
|
18
18
|
component: UnitControl,
|
|
19
|
-
title: 'Components
|
|
20
|
-
id: 'components-
|
|
19
|
+
title: 'Components/Selection & Input/Common/UnitControl',
|
|
20
|
+
id: 'components-unitcontrol',
|
|
21
21
|
argTypes: {
|
|
22
22
|
__unstableInputWidth: { control: { type: 'text' } },
|
|
23
23
|
__unstableStateReducer: { control: false },
|
|
@@ -26,6 +26,7 @@ const meta: Meta< typeof UnitControl > = {
|
|
|
26
26
|
prefix: { control: { type: 'text' } },
|
|
27
27
|
value: { control: false },
|
|
28
28
|
},
|
|
29
|
+
tags: [ 'status-experimental' ],
|
|
29
30
|
parameters: {
|
|
30
31
|
actions: { argTypesRegex: '^on.*' },
|
|
31
32
|
controls: {
|
|
@@ -29,3 +29,4 @@ $components-color-light-gray-placeholder: color-mix(in srgb, $components-color-b
|
|
|
29
29
|
|
|
30
30
|
// Semantic aliases (prefer these over raw gray values when applicable).
|
|
31
31
|
$components-color-border: #{ $components-color-gray-600 };
|
|
32
|
+
$components-color-disabled: #{ $components-color-gray-600 };
|
|
@@ -25,8 +25,8 @@ const ALIGNMENTS = {
|
|
|
25
25
|
|
|
26
26
|
const meta: Meta< typeof VStack > = {
|
|
27
27
|
component: VStack,
|
|
28
|
-
title: 'Components
|
|
29
|
-
id: 'components-
|
|
28
|
+
title: 'Components/Layout/VStack',
|
|
29
|
+
id: 'components-vstack',
|
|
30
30
|
argTypes: {
|
|
31
31
|
alignment: {
|
|
32
32
|
control: { type: 'select' },
|
|
@@ -38,6 +38,7 @@ const meta: Meta< typeof VStack > = {
|
|
|
38
38
|
justify: { control: { type: 'text' } },
|
|
39
39
|
spacing: { control: { type: 'text' } },
|
|
40
40
|
},
|
|
41
|
+
tags: [ 'status-experimental' ],
|
|
41
42
|
parameters: {
|
|
42
43
|
controls: { expanded: true },
|
|
43
44
|
docs: { canvas: { sourceState: 'shown' } },
|
|
@@ -17,7 +17,8 @@ type Value = CheckboxControlProps[ 'checked' ];
|
|
|
17
17
|
const UnforwardedValidatedCheckboxControl = (
|
|
18
18
|
{
|
|
19
19
|
required,
|
|
20
|
-
|
|
20
|
+
onValidate,
|
|
21
|
+
customValidity,
|
|
21
22
|
onChange,
|
|
22
23
|
markWhenOptional,
|
|
23
24
|
...restProps
|
|
@@ -37,9 +38,10 @@ const UnforwardedValidatedCheckboxControl = (
|
|
|
37
38
|
required={ required }
|
|
38
39
|
markWhenOptional={ markWhenOptional }
|
|
39
40
|
ref={ mergedRefs }
|
|
40
|
-
|
|
41
|
-
return
|
|
41
|
+
onValidate={ () => {
|
|
42
|
+
return onValidate?.( valueRef.current );
|
|
42
43
|
} }
|
|
44
|
+
customValidity={ customValidity }
|
|
43
45
|
getValidityTarget={ () =>
|
|
44
46
|
validityTargetRef.current?.querySelector< HTMLInputElement >(
|
|
45
47
|
'input[type="checkbox"]'
|
|
@@ -17,7 +17,8 @@ type Value = ComboboxControlProps[ 'value' ];
|
|
|
17
17
|
const UnforwardedValidatedComboboxControl = (
|
|
18
18
|
{
|
|
19
19
|
required,
|
|
20
|
-
|
|
20
|
+
onValidate,
|
|
21
|
+
customValidity,
|
|
21
22
|
onChange,
|
|
22
23
|
markWhenOptional,
|
|
23
24
|
...restProps
|
|
@@ -50,9 +51,10 @@ const UnforwardedValidatedComboboxControl = (
|
|
|
50
51
|
required={ required }
|
|
51
52
|
markWhenOptional={ markWhenOptional }
|
|
52
53
|
ref={ mergedRefs }
|
|
53
|
-
|
|
54
|
-
return
|
|
54
|
+
onValidate={ () => {
|
|
55
|
+
return onValidate?.( valueRef.current );
|
|
55
56
|
} }
|
|
57
|
+
customValidity={ customValidity }
|
|
56
58
|
getValidityTarget={ () =>
|
|
57
59
|
validityTargetRef.current?.querySelector< HTMLInputElement >(
|
|
58
60
|
'input[role="combobox"]'
|
|
@@ -21,7 +21,8 @@ type Value = CustomSelectControlProps[ 'value' ];
|
|
|
21
21
|
const UnforwardedValidatedCustomSelectControl = (
|
|
22
22
|
{
|
|
23
23
|
required,
|
|
24
|
-
|
|
24
|
+
onValidate,
|
|
25
|
+
customValidity,
|
|
25
26
|
onChange,
|
|
26
27
|
markWhenOptional,
|
|
27
28
|
...restProps
|
|
@@ -43,9 +44,10 @@ const UnforwardedValidatedCustomSelectControl = (
|
|
|
43
44
|
<ControlWithError
|
|
44
45
|
required={ required }
|
|
45
46
|
markWhenOptional={ markWhenOptional }
|
|
46
|
-
|
|
47
|
-
return
|
|
47
|
+
onValidate={ () => {
|
|
48
|
+
return onValidate?.( valueRef.current );
|
|
48
49
|
} }
|
|
50
|
+
customValidity={ customValidity }
|
|
49
51
|
getValidityTarget={ () => validityTargetRef.current }
|
|
50
52
|
>
|
|
51
53
|
<CustomSelectControl
|
|
@@ -17,7 +17,8 @@ type Value = InputControlProps[ 'value' ];
|
|
|
17
17
|
const UnforwardedValidatedInputControl = (
|
|
18
18
|
{
|
|
19
19
|
required,
|
|
20
|
-
|
|
20
|
+
onValidate,
|
|
21
|
+
customValidity,
|
|
21
22
|
onChange,
|
|
22
23
|
markWhenOptional,
|
|
23
24
|
...restProps
|
|
@@ -36,9 +37,10 @@ const UnforwardedValidatedInputControl = (
|
|
|
36
37
|
<ControlWithError
|
|
37
38
|
required={ required }
|
|
38
39
|
markWhenOptional={ markWhenOptional }
|
|
39
|
-
|
|
40
|
-
return
|
|
40
|
+
onValidate={ () => {
|
|
41
|
+
return onValidate?.( valueRef.current );
|
|
41
42
|
} }
|
|
43
|
+
customValidity={ customValidity }
|
|
42
44
|
getValidityTarget={ () => validityTargetRef.current }
|
|
43
45
|
>
|
|
44
46
|
<InputControl
|
|
@@ -17,7 +17,8 @@ type Value = NumberControlProps[ 'value' ];
|
|
|
17
17
|
const UnforwardedValidatedNumberControl = (
|
|
18
18
|
{
|
|
19
19
|
required,
|
|
20
|
-
|
|
20
|
+
onValidate,
|
|
21
|
+
customValidity,
|
|
21
22
|
onChange,
|
|
22
23
|
markWhenOptional,
|
|
23
24
|
...restProps
|
|
@@ -36,9 +37,10 @@ const UnforwardedValidatedNumberControl = (
|
|
|
36
37
|
<ControlWithError
|
|
37
38
|
required={ required }
|
|
38
39
|
markWhenOptional={ markWhenOptional }
|
|
39
|
-
|
|
40
|
-
return
|
|
40
|
+
onValidate={ () => {
|
|
41
|
+
return onValidate?.( valueRef.current );
|
|
41
42
|
} }
|
|
43
|
+
customValidity={ customValidity }
|
|
42
44
|
getValidityTarget={ () => validityTargetRef.current }
|
|
43
45
|
>
|
|
44
46
|
<NumberControl
|
|
@@ -17,7 +17,8 @@ type Value = RadioControlProps[ 'selected' ];
|
|
|
17
17
|
const UnforwardedValidatedRadioControl = (
|
|
18
18
|
{
|
|
19
19
|
required,
|
|
20
|
-
|
|
20
|
+
onValidate,
|
|
21
|
+
customValidity,
|
|
21
22
|
onChange,
|
|
22
23
|
markWhenOptional,
|
|
23
24
|
...restProps
|
|
@@ -35,9 +36,10 @@ const UnforwardedValidatedRadioControl = (
|
|
|
35
36
|
markWhenOptional={ markWhenOptional }
|
|
36
37
|
// TODO: Upstream limitation - RadioControl does not accept a ref.
|
|
37
38
|
ref={ mergedRefs }
|
|
38
|
-
|
|
39
|
-
return
|
|
39
|
+
onValidate={ () => {
|
|
40
|
+
return onValidate?.( valueRef.current );
|
|
40
41
|
} }
|
|
42
|
+
customValidity={ customValidity }
|
|
41
43
|
getValidityTarget={ () =>
|
|
42
44
|
validityTargetRef.current?.querySelector< HTMLInputElement >(
|
|
43
45
|
'input[type="radio"]'
|
|
@@ -17,7 +17,8 @@ type Value = RangeControlProps[ 'value' ];
|
|
|
17
17
|
const UnforwardedValidatedRangeControl = (
|
|
18
18
|
{
|
|
19
19
|
required,
|
|
20
|
-
|
|
20
|
+
onValidate,
|
|
21
|
+
customValidity,
|
|
21
22
|
onChange,
|
|
22
23
|
markWhenOptional,
|
|
23
24
|
...restProps
|
|
@@ -36,9 +37,10 @@ const UnforwardedValidatedRangeControl = (
|
|
|
36
37
|
<ControlWithError
|
|
37
38
|
required={ required }
|
|
38
39
|
markWhenOptional={ markWhenOptional }
|
|
39
|
-
|
|
40
|
-
return
|
|
40
|
+
onValidate={ () => {
|
|
41
|
+
return onValidate?.( valueRef.current );
|
|
41
42
|
} }
|
|
43
|
+
customValidity={ customValidity }
|
|
42
44
|
getValidityTarget={ () => validityTargetRef.current }
|
|
43
45
|
>
|
|
44
46
|
<RangeControl
|
|
@@ -26,7 +26,8 @@ type Value = SelectControlProps[ 'value' ];
|
|
|
26
26
|
const UnforwardedValidatedSelectControl = (
|
|
27
27
|
{
|
|
28
28
|
required,
|
|
29
|
-
|
|
29
|
+
onValidate,
|
|
30
|
+
customValidity,
|
|
30
31
|
onChange,
|
|
31
32
|
markWhenOptional,
|
|
32
33
|
...restProps
|
|
@@ -51,9 +52,10 @@ const UnforwardedValidatedSelectControl = (
|
|
|
51
52
|
<ControlWithError
|
|
52
53
|
required={ required }
|
|
53
54
|
markWhenOptional={ markWhenOptional }
|
|
54
|
-
|
|
55
|
-
return
|
|
55
|
+
onValidate={ () => {
|
|
56
|
+
return onValidate?.( valueRef.current );
|
|
56
57
|
} }
|
|
58
|
+
customValidity={ customValidity }
|
|
57
59
|
getValidityTarget={ () => validityTargetRef.current }
|
|
58
60
|
>
|
|
59
61
|
<SelectControl
|