@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.
Files changed (211) hide show
  1. package/CHANGELOG.md +19 -3
  2. package/build/custom-gradient-picker/serializer.js +14 -0
  3. package/build/custom-gradient-picker/serializer.js.map +1 -1
  4. package/build/custom-gradient-picker/utils.js +12 -0
  5. package/build/custom-gradient-picker/utils.js.map +1 -1
  6. package/build/date-time/date/index.js +2 -4
  7. package/build/date-time/date/index.js.map +1 -1
  8. package/build/date-time/date/styles.js +41 -20
  9. package/build/date-time/date/styles.js.map +1 -1
  10. package/build/menu-item/index.js +1 -0
  11. package/build/menu-item/index.js.map +1 -1
  12. package/build/validated-form-controls/components/checkbox-control.js +5 -3
  13. package/build/validated-form-controls/components/checkbox-control.js.map +1 -1
  14. package/build/validated-form-controls/components/combobox-control.js +5 -3
  15. package/build/validated-form-controls/components/combobox-control.js.map +1 -1
  16. package/build/validated-form-controls/components/custom-select-control.js +5 -3
  17. package/build/validated-form-controls/components/custom-select-control.js.map +1 -1
  18. package/build/validated-form-controls/components/input-control.js +5 -3
  19. package/build/validated-form-controls/components/input-control.js.map +1 -1
  20. package/build/validated-form-controls/components/number-control.js +5 -3
  21. package/build/validated-form-controls/components/number-control.js.map +1 -1
  22. package/build/validated-form-controls/components/radio-control.js +5 -3
  23. package/build/validated-form-controls/components/radio-control.js.map +1 -1
  24. package/build/validated-form-controls/components/range-control.js +5 -3
  25. package/build/validated-form-controls/components/range-control.js.map +1 -1
  26. package/build/validated-form-controls/components/select-control.js +5 -3
  27. package/build/validated-form-controls/components/select-control.js.map +1 -1
  28. package/build/validated-form-controls/components/text-control.js +5 -3
  29. package/build/validated-form-controls/components/text-control.js.map +1 -1
  30. package/build/validated-form-controls/components/textarea-control.js +5 -3
  31. package/build/validated-form-controls/components/textarea-control.js.map +1 -1
  32. package/build/validated-form-controls/components/toggle-control.js +5 -3
  33. package/build/validated-form-controls/components/toggle-control.js.map +1 -1
  34. package/build/validated-form-controls/components/toggle-group-control.js +5 -3
  35. package/build/validated-form-controls/components/toggle-group-control.js.map +1 -1
  36. package/build/validated-form-controls/components/types.js.map +1 -1
  37. package/build/validated-form-controls/control-with-error.js +57 -22
  38. package/build/validated-form-controls/control-with-error.js.map +1 -1
  39. package/build/validated-form-controls/validity-indicator.js +45 -0
  40. package/build/validated-form-controls/validity-indicator.js.map +1 -0
  41. package/build-module/custom-gradient-picker/serializer.js +14 -0
  42. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  43. package/build-module/custom-gradient-picker/utils.js +12 -0
  44. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  45. package/build-module/date-time/date/index.js +3 -4
  46. package/build-module/date-time/date/index.js.map +1 -1
  47. package/build-module/date-time/date/styles.js +39 -14
  48. package/build-module/date-time/date/styles.js.map +1 -1
  49. package/build-module/menu-item/index.js +1 -0
  50. package/build-module/menu-item/index.js.map +1 -1
  51. package/build-module/validated-form-controls/components/checkbox-control.js +5 -3
  52. package/build-module/validated-form-controls/components/checkbox-control.js.map +1 -1
  53. package/build-module/validated-form-controls/components/combobox-control.js +5 -3
  54. package/build-module/validated-form-controls/components/combobox-control.js.map +1 -1
  55. package/build-module/validated-form-controls/components/custom-select-control.js +5 -3
  56. package/build-module/validated-form-controls/components/custom-select-control.js.map +1 -1
  57. package/build-module/validated-form-controls/components/input-control.js +5 -3
  58. package/build-module/validated-form-controls/components/input-control.js.map +1 -1
  59. package/build-module/validated-form-controls/components/number-control.js +5 -3
  60. package/build-module/validated-form-controls/components/number-control.js.map +1 -1
  61. package/build-module/validated-form-controls/components/radio-control.js +5 -3
  62. package/build-module/validated-form-controls/components/radio-control.js.map +1 -1
  63. package/build-module/validated-form-controls/components/range-control.js +5 -3
  64. package/build-module/validated-form-controls/components/range-control.js.map +1 -1
  65. package/build-module/validated-form-controls/components/select-control.js +5 -3
  66. package/build-module/validated-form-controls/components/select-control.js.map +1 -1
  67. package/build-module/validated-form-controls/components/text-control.js +5 -3
  68. package/build-module/validated-form-controls/components/text-control.js.map +1 -1
  69. package/build-module/validated-form-controls/components/textarea-control.js +5 -3
  70. package/build-module/validated-form-controls/components/textarea-control.js.map +1 -1
  71. package/build-module/validated-form-controls/components/toggle-control.js +5 -3
  72. package/build-module/validated-form-controls/components/toggle-control.js.map +1 -1
  73. package/build-module/validated-form-controls/components/toggle-group-control.js +5 -3
  74. package/build-module/validated-form-controls/components/toggle-group-control.js.map +1 -1
  75. package/build-module/validated-form-controls/components/types.js.map +1 -1
  76. package/build-module/validated-form-controls/control-with-error.js +57 -21
  77. package/build-module/validated-form-controls/control-with-error.js.map +1 -1
  78. package/build-module/validated-form-controls/validity-indicator.js +37 -0
  79. package/build-module/validated-form-controls/validity-indicator.js.map +1 -0
  80. package/build-style/style-rtl.css +37 -25
  81. package/build-style/style.css +37 -25
  82. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  83. package/build-types/custom-gradient-picker/serializer.d.ts.map +1 -1
  84. package/build-types/custom-gradient-picker/utils.d.ts.map +1 -1
  85. package/build-types/date-time/date/index.d.ts.map +1 -1
  86. package/build-types/date-time/date/styles.d.ts +6 -0
  87. package/build-types/date-time/date/styles.d.ts.map +1 -1
  88. package/build-types/divider/stories/index.story.d.ts.map +1 -1
  89. package/build-types/elevation/stories/index.story.d.ts.map +1 -1
  90. package/build-types/form-token-field/stories/index.story.d.ts +10 -5
  91. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  92. package/build-types/gradient-picker/stories/index.story.d.ts +2 -1
  93. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  94. package/build-types/grid/stories/index.story.d.ts.map +1 -1
  95. package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
  96. package/build-types/heading/stories/index.story.d.ts.map +1 -1
  97. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  98. package/build-types/item-group/stories/index.story.d.ts.map +1 -1
  99. package/build-types/menu-item/index.d.ts.map +1 -1
  100. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  101. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  102. package/build-types/spacer/stories/index.story.d.ts.map +1 -1
  103. package/build-types/surface/stories/index.story.d.ts.map +1 -1
  104. package/build-types/text/stories/index.story.d.ts.map +1 -1
  105. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  106. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  107. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  108. package/build-types/truncate/stories/index.story.d.ts.map +1 -1
  109. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  110. package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
  111. package/build-types/validated-form-controls/components/checkbox-control.d.ts.map +1 -1
  112. package/build-types/validated-form-controls/components/combobox-control.d.ts.map +1 -1
  113. package/build-types/validated-form-controls/components/custom-select-control.d.ts.map +1 -1
  114. package/build-types/validated-form-controls/components/input-control.d.ts.map +1 -1
  115. package/build-types/validated-form-controls/components/number-control.d.ts.map +1 -1
  116. package/build-types/validated-form-controls/components/radio-control.d.ts.map +1 -1
  117. package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
  118. package/build-types/validated-form-controls/components/select-control.d.ts.map +1 -1
  119. package/build-types/validated-form-controls/components/stories/checkbox-control.story.d.ts.map +1 -1
  120. package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts.map +1 -1
  121. package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts.map +1 -1
  122. package/build-types/validated-form-controls/components/stories/input-control.story.d.ts.map +1 -1
  123. package/build-types/validated-form-controls/components/stories/number-control.story.d.ts.map +1 -1
  124. package/build-types/validated-form-controls/components/stories/overview.story.d.ts +13 -0
  125. package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +1 -1
  126. package/build-types/validated-form-controls/components/stories/radio-control.story.d.ts.map +1 -1
  127. package/build-types/validated-form-controls/components/stories/range-control.story.d.ts.map +1 -1
  128. package/build-types/validated-form-controls/components/stories/select-control.story.d.ts.map +1 -1
  129. package/build-types/validated-form-controls/components/stories/text-control.story.d.ts.map +1 -1
  130. package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts.map +1 -1
  131. package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts.map +1 -1
  132. package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts.map +1 -1
  133. package/build-types/validated-form-controls/components/text-control.d.ts.map +1 -1
  134. package/build-types/validated-form-controls/components/textarea-control.d.ts.map +1 -1
  135. package/build-types/validated-form-controls/components/toggle-control.d.ts.map +1 -1
  136. package/build-types/validated-form-controls/components/toggle-group-control.d.ts.map +1 -1
  137. package/build-types/validated-form-controls/components/types.d.ts +21 -10
  138. package/build-types/validated-form-controls/components/types.d.ts.map +1 -1
  139. package/build-types/validated-form-controls/control-with-error.d.ts +4 -5
  140. package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
  141. package/build-types/validated-form-controls/validity-indicator.d.ts +5 -0
  142. package/build-types/validated-form-controls/validity-indicator.d.ts.map +1 -0
  143. package/build-types/view/stories/index.story.d.ts.map +1 -1
  144. package/build-types/z-stack/stories/index.story.d.ts.map +1 -1
  145. package/package.json +21 -21
  146. package/src/button/style.scss +3 -3
  147. package/src/calendar/style.scss +22 -22
  148. package/src/confirm-dialog/stories/index.story.tsx +3 -2
  149. package/src/custom-gradient-picker/serializer.ts +14 -0
  150. package/src/custom-gradient-picker/test/serializer.ts +25 -0
  151. package/src/custom-gradient-picker/utils.ts +10 -0
  152. package/src/date-time/date/index.tsx +4 -3
  153. package/src/date-time/date/styles.ts +13 -20
  154. package/src/divider/stories/index.story.tsx +2 -1
  155. package/src/elevation/stories/index.story.tsx +2 -1
  156. package/src/form-token-field/stories/index.story.tsx +15 -7
  157. package/src/gradient-picker/stories/index.story.tsx +48 -0
  158. package/src/grid/stories/index.story.tsx +2 -1
  159. package/src/h-stack/stories/e2e/index.story.tsx +1 -1
  160. package/src/h-stack/stories/index.story.tsx +3 -2
  161. package/src/heading/stories/index.story.tsx +3 -2
  162. package/src/input-control/stories/index.story.tsx +3 -2
  163. package/src/item-group/stories/index.story.tsx +2 -1
  164. package/src/menu/stories/index.story.tsx +1 -1
  165. package/src/menu-item/index.tsx +1 -0
  166. package/src/number-control/stories/index.story.tsx +3 -2
  167. package/src/scrollable/stories/index.story.tsx +2 -1
  168. package/src/spacer/stories/index.story.tsx +2 -1
  169. package/src/surface/stories/index.story.tsx +2 -1
  170. package/src/text/stories/index.story.tsx +3 -2
  171. package/src/toggle-group-control/stories/index.story.tsx +3 -2
  172. package/src/tools-panel/stories/index.story.tsx +2 -1
  173. package/src/tree-grid/stories/index.story.tsx +3 -2
  174. package/src/truncate/stories/index.story.tsx +3 -2
  175. package/src/unit-control/stories/index.story.tsx +3 -2
  176. package/src/utils/theme-variables.scss +1 -0
  177. package/src/v-stack/stories/e2e/index.story.tsx +1 -1
  178. package/src/v-stack/stories/index.story.tsx +3 -2
  179. package/src/validated-form-controls/components/checkbox-control.tsx +5 -3
  180. package/src/validated-form-controls/components/combobox-control.tsx +5 -3
  181. package/src/validated-form-controls/components/custom-select-control.tsx +5 -3
  182. package/src/validated-form-controls/components/input-control.tsx +5 -3
  183. package/src/validated-form-controls/components/number-control.tsx +5 -3
  184. package/src/validated-form-controls/components/radio-control.tsx +5 -3
  185. package/src/validated-form-controls/components/range-control.tsx +5 -3
  186. package/src/validated-form-controls/components/select-control.tsx +5 -3
  187. package/src/validated-form-controls/components/stories/checkbox-control.story.tsx +19 -7
  188. package/src/validated-form-controls/components/stories/combobox-control.story.tsx +19 -7
  189. package/src/validated-form-controls/components/stories/custom-select-control.story.tsx +19 -7
  190. package/src/validated-form-controls/components/stories/input-control.story.tsx +53 -19
  191. package/src/validated-form-controls/components/stories/number-control.story.tsx +19 -7
  192. package/src/validated-form-controls/components/stories/overview.mdx +2 -2
  193. package/src/validated-form-controls/components/stories/overview.story.tsx +124 -16
  194. package/src/validated-form-controls/components/stories/radio-control.story.tsx +19 -7
  195. package/src/validated-form-controls/components/stories/range-control.story.tsx +19 -7
  196. package/src/validated-form-controls/components/stories/select-control.story.tsx +19 -7
  197. package/src/validated-form-controls/components/stories/text-control.story.tsx +19 -7
  198. package/src/validated-form-controls/components/stories/textarea-control.story.tsx +19 -7
  199. package/src/validated-form-controls/components/stories/toggle-control.story.tsx +19 -7
  200. package/src/validated-form-controls/components/stories/toggle-group-control.story.tsx +19 -7
  201. package/src/validated-form-controls/components/text-control.tsx +5 -3
  202. package/src/validated-form-controls/components/textarea-control.tsx +5 -3
  203. package/src/validated-form-controls/components/toggle-control.tsx +5 -3
  204. package/src/validated-form-controls/components/toggle-group-control.tsx +5 -3
  205. package/src/validated-form-controls/components/types.ts +21 -12
  206. package/src/validated-form-controls/control-with-error.tsx +77 -26
  207. package/src/validated-form-controls/style.scss +19 -5
  208. package/src/validated-form-controls/validity-indicator.tsx +48 -0
  209. package/src/view/stories/index.story.tsx +2 -1
  210. package/src/z-stack/stories/index.story.tsx +2 -1
  211. 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 (Experimental)/Divider',
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 (Experimental)/Elevation',
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 output of each suggestion can be customized by passing a
119
- * render function to the `__experimentalRenderItem` prop. (This is still an experimental feature
120
- * and is subject to change.)
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 WithCustomRenderItem: StoryFn< typeof FormTokenField > =
125
+ export const WithCustomRenderedItems: StoryFn< typeof FormTokenField > =
123
126
  DefaultTemplate.bind( {} );
124
- WithCustomRenderItem.args = {
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 WithValidatedInput: StoryFn< typeof FormTokenField > =
143
+ export const ValidateNewTokens: StoryFn< typeof FormTokenField > =
137
144
  DefaultTemplate.bind( {} );
138
- WithValidatedInput.args = {
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 (Experimental)/Grid',
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,
@@ -11,7 +11,7 @@ import { HStack } from '../..';
11
11
 
12
12
  const meta: Meta< typeof HStack > = {
13
13
  component: HStack,
14
- title: 'Components (Experimental)/HStack',
14
+ title: 'Components/HStack',
15
15
  };
16
16
  export default meta;
17
17
 
@@ -42,8 +42,8 @@ const JUSTIFICATIONS = {
42
42
 
43
43
  const meta: Meta< typeof HStack > = {
44
44
  component: HStack,
45
- title: 'Components (Experimental)/Layout/HStack',
46
- id: 'components-experimental-hstack',
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 (Experimental)/Typography/Heading',
14
- id: 'components-experimental-heading',
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 (Experimental)/Selection & Input/InputControl',
20
- id: 'components-experimental-inputcontrol',
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 (Experimental)/ItemGroup',
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 (Experimental)/Actions/Menu',
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
@@ -67,6 +67,7 @@ function UnforwardedMenuItem(
67
67
  role={ role }
68
68
  icon={ iconPosition === 'left' ? icon : undefined }
69
69
  className={ className }
70
+ accessibleWhenDisabled
70
71
  { ...buttonProps }
71
72
  >
72
73
  <span className="components-menu-item__item">{ children }</span>
@@ -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 (Experimental)/Selection & Input/NumberControl',
18
- id: 'components-experimental-numbercontrol',
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 (Experimental)/Scrollable',
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 (Experimental)/Spacer',
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 (Experimental)/Surface',
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 (Experimental)/Typography/Text',
14
- id: 'components-experimental-text',
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 (Experimental)/Selection & Input/ToggleGroupControl',
31
- id: 'components-experimental-togglegroupcontrol',
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 (Experimental)/ToolsPanel',
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 (Experimental)/Navigation/TreeGrid',
20
- id: 'components-experimental-treegrid',
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 (Experimental)/Typography/Truncate',
14
- id: 'components-experimental-truncate',
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 (Experimental)/Selection & Input/UnitControl',
20
- id: 'components-experimental-unitcontrol',
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 };
@@ -11,7 +11,7 @@ import { VStack } from '../..';
11
11
 
12
12
  const meta: Meta< typeof VStack > = {
13
13
  component: VStack,
14
- title: 'Components (Experimental)/VStack',
14
+ title: 'Components/VStack',
15
15
  };
16
16
  export default meta;
17
17
 
@@ -25,8 +25,8 @@ const ALIGNMENTS = {
25
25
 
26
26
  const meta: Meta< typeof VStack > = {
27
27
  component: VStack,
28
- title: 'Components (Experimental)/Layout/VStack',
29
- id: 'components-experimental-vstack',
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
- customValidator,
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
- customValidator={ () => {
41
- return customValidator?.( valueRef.current );
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
- customValidator,
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
- customValidator={ () => {
54
- return customValidator?.( valueRef.current );
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
- customValidator,
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
- customValidator={ () => {
47
- return customValidator?.( valueRef.current );
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
- customValidator,
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
- customValidator={ () => {
40
- return customValidator?.( valueRef.current );
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
- customValidator,
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
- customValidator={ () => {
40
- return customValidator?.( valueRef.current );
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
- customValidator,
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
- customValidator={ () => {
39
- return customValidator?.( valueRef.current );
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
- customValidator,
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
- customValidator={ () => {
40
- return customValidator?.( valueRef.current );
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
- customValidator,
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
- customValidator={ () => {
55
- return customValidator?.( valueRef.current );
55
+ onValidate={ () => {
56
+ return onValidate?.( valueRef.current );
56
57
  } }
58
+ customValidity={ customValidity }
57
59
  getValidityTarget={ () => validityTargetRef.current }
58
60
  >
59
61
  <SelectControl