@wordpress/components 32.4.1-next.v.202603102151.0 → 32.5.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 (228) hide show
  1. package/CHANGELOG.md +19 -1
  2. package/build/alignment-matrix-control/cell.cjs +2 -2
  3. package/build/alignment-matrix-control/cell.cjs.map +1 -1
  4. package/build/alignment-matrix-control/index.cjs +2 -2
  5. package/build/alignment-matrix-control/index.cjs.map +1 -1
  6. package/build/angle-picker-control/angle-circle.cjs +2 -2
  7. package/build/angle-picker-control/angle-circle.cjs.map +1 -1
  8. package/build/combobox-control/index.cjs +5 -1
  9. package/build/combobox-control/index.cjs.map +2 -2
  10. package/build/custom-gradient-picker/index.cjs +9 -1
  11. package/build/custom-gradient-picker/index.cjs.map +2 -2
  12. package/build/date-time/time/index.cjs +1 -1
  13. package/build/date-time/time/index.cjs.map +2 -2
  14. package/build/date-time/utils.cjs +9 -0
  15. package/build/date-time/utils.cjs.map +2 -2
  16. package/build/form-token-field/token-input.cjs +2 -1
  17. package/build/form-token-field/token-input.cjs.map +2 -2
  18. package/build/radio-control/index.cjs +1 -0
  19. package/build/radio-control/index.cjs.map +2 -2
  20. package/build/toggle-group-control/toggle-group-control/as-button-group.cjs +1 -0
  21. package/build/toggle-group-control/toggle-group-control/as-button-group.cjs.map +2 -2
  22. package/build/toggle-group-control/toggle-group-control/component.cjs +15 -9
  23. package/build/toggle-group-control/toggle-group-control/component.cjs.map +3 -3
  24. package/build/toggle-group-control/toggle-group-control/styles.cjs +6 -32
  25. package/build/toggle-group-control/toggle-group-control/styles.cjs.map +3 -3
  26. package/build/validated-form-controls/control-with-error.cjs +26 -3
  27. package/build/validated-form-controls/control-with-error.cjs.map +2 -2
  28. package/build/validated-form-controls/validity-indicator.cjs +2 -0
  29. package/build/validated-form-controls/validity-indicator.cjs.map +2 -2
  30. package/build-module/alignment-matrix-control/cell.mjs +2 -2
  31. package/build-module/alignment-matrix-control/cell.mjs.map +1 -1
  32. package/build-module/alignment-matrix-control/index.mjs +2 -2
  33. package/build-module/alignment-matrix-control/index.mjs.map +1 -1
  34. package/build-module/angle-picker-control/angle-circle.mjs +2 -2
  35. package/build-module/angle-picker-control/angle-circle.mjs.map +1 -1
  36. package/build-module/combobox-control/index.mjs +5 -1
  37. package/build-module/combobox-control/index.mjs.map +2 -2
  38. package/build-module/custom-gradient-picker/index.mjs +10 -2
  39. package/build-module/custom-gradient-picker/index.mjs.map +2 -2
  40. package/build-module/date-time/time/index.mjs +2 -2
  41. package/build-module/date-time/time/index.mjs.map +2 -2
  42. package/build-module/date-time/utils.mjs +8 -0
  43. package/build-module/date-time/utils.mjs.map +2 -2
  44. package/build-module/form-token-field/token-input.mjs +2 -1
  45. package/build-module/form-token-field/token-input.mjs.map +2 -2
  46. package/build-module/radio-control/index.mjs +1 -0
  47. package/build-module/radio-control/index.mjs.map +2 -2
  48. package/build-module/toggle-group-control/toggle-group-control/as-button-group.mjs +1 -0
  49. package/build-module/toggle-group-control/toggle-group-control/as-button-group.mjs.map +2 -2
  50. package/build-module/toggle-group-control/toggle-group-control/component.mjs +17 -11
  51. package/build-module/toggle-group-control/toggle-group-control/component.mjs.map +2 -2
  52. package/build-module/toggle-group-control/toggle-group-control/styles.mjs +6 -21
  53. package/build-module/toggle-group-control/toggle-group-control/styles.mjs.map +2 -2
  54. package/build-module/validated-form-controls/control-with-error.mjs +27 -4
  55. package/build-module/validated-form-controls/control-with-error.mjs.map +2 -2
  56. package/build-module/validated-form-controls/validity-indicator.mjs +2 -0
  57. package/build-module/validated-form-controls/validity-indicator.mjs.map +2 -2
  58. package/build-style/style-rtl.css +14 -8
  59. package/build-style/style.css +14 -8
  60. package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
  61. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  62. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  63. package/build-types/animate/stories/index.story.d.ts +7 -7
  64. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  65. package/build-types/base-control/stories/index.story.d.ts +1 -1
  66. package/build-types/border-box-control/stories/index.story.d.ts +1 -1
  67. package/build-types/border-control/stories/index.story.d.ts +5 -5
  68. package/build-types/box-control/stories/index.story.d.ts +7 -7
  69. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  70. package/build-types/button/stories/e2e/index.story.d.ts +1 -1
  71. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  72. package/build-types/button/stories/index.story.d.ts +7 -7
  73. package/build-types/button/stories/index.story.d.ts.map +1 -1
  74. package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
  75. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  76. package/build-types/combobox-control/index.d.ts.map +1 -1
  77. package/build-types/combobox-control/stories/index.story.d.ts +4 -4
  78. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  79. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  80. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  81. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  82. package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
  83. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  84. package/build-types/custom-gradient-picker/test/index.d.ts +2 -0
  85. package/build-types/custom-gradient-picker/test/index.d.ts.map +1 -0
  86. package/build-types/custom-select-control/stories/index.story.d.ts +3 -3
  87. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  88. package/build-types/custom-select-control-v2/stories/index.story.d.ts +3 -3
  89. package/build-types/date-time/stories/time.story.d.ts +1 -1
  90. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  91. package/build-types/date-time/time/index.d.ts.map +1 -1
  92. package/build-types/date-time/utils.d.ts +9 -0
  93. package/build-types/date-time/utils.d.ts.map +1 -1
  94. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  95. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  96. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
  97. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
  98. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
  99. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
  100. package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
  101. package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
  102. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  103. package/build-types/form-token-field/token-input.d.ts.map +1 -1
  104. package/build-types/guide/stories/index.story.d.ts +1 -1
  105. package/build-types/guide/stories/index.story.d.ts.map +1 -1
  106. package/build-types/icon/stories/index.story.d.ts +4 -4
  107. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  108. package/build-types/input-control/stories/index.story.d.ts +7 -7
  109. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  110. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
  111. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  112. package/build-types/menu-group/stories/index.story.d.ts +1 -1
  113. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  114. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  115. package/build-types/navigation/stories/index.story.d.ts +6 -6
  116. package/build-types/navigation/stories/index.story.d.ts.map +1 -1
  117. package/build-types/notice/stories/index.story.d.ts +5 -5
  118. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  119. package/build-types/number-control/stories/index.story.d.ts +1 -1
  120. package/build-types/palette-edit/stories/index.story.d.ts +2 -2
  121. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  122. package/build-types/progress-bar/stories/index.story.d.ts +1 -1
  123. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  124. package/build-types/query-controls/stories/index.story.d.ts +1 -1
  125. package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
  126. package/build-types/radio-control/index.d.ts.map +1 -1
  127. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  128. package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
  129. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  130. package/build-types/sandbox/stories/index.story.d.ts +1 -1
  131. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  132. package/build-types/search-control/stories/index.story.d.ts +1 -1
  133. package/build-types/select-control/stories/index.story.d.ts +5 -5
  134. package/build-types/shortcut/stories/index.story.d.ts +1 -1
  135. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  136. package/build-types/tab-panel/stories/index.story.d.ts +4 -4
  137. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  138. package/build-types/tabs/stories/index.story.d.ts +7 -7
  139. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  140. package/build-types/text/stories/index.story.d.ts +3 -3
  141. package/build-types/theme/stories/index.story.d.ts +1 -1
  142. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  143. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  144. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  145. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  146. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +0 -4
  147. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  148. package/build-types/toolbar/stories/index.story.d.ts +3 -3
  149. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  150. package/build-types/tooltip/stories/index.story.d.ts +1 -1
  151. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  152. package/build-types/tree-grid/stories/index.story.d.ts +1 -1
  153. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  154. package/build-types/tree-select/stories/index.story.d.ts +1 -1
  155. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  156. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  157. package/build-types/validated-form-controls/control-with-error.d.ts.map +1 -1
  158. package/build-types/validated-form-controls/test/checkbox-control.d.ts +2 -0
  159. package/build-types/validated-form-controls/test/checkbox-control.d.ts.map +1 -0
  160. package/build-types/validated-form-controls/test/combobox-control.d.ts +2 -0
  161. package/build-types/validated-form-controls/test/combobox-control.d.ts.map +1 -0
  162. package/build-types/validated-form-controls/test/custom-select-control.d.ts +2 -0
  163. package/build-types/validated-form-controls/test/custom-select-control.d.ts.map +1 -0
  164. package/build-types/validated-form-controls/test/form-token-field.d.ts +2 -0
  165. package/build-types/validated-form-controls/test/form-token-field.d.ts.map +1 -0
  166. package/build-types/validated-form-controls/test/input-control.d.ts +2 -0
  167. package/build-types/validated-form-controls/test/input-control.d.ts.map +1 -0
  168. package/build-types/validated-form-controls/test/number-control.d.ts +2 -0
  169. package/build-types/validated-form-controls/test/number-control.d.ts.map +1 -0
  170. package/build-types/validated-form-controls/test/radio-control.d.ts +2 -0
  171. package/build-types/validated-form-controls/test/radio-control.d.ts.map +1 -0
  172. package/build-types/validated-form-controls/test/range-control.d.ts +2 -0
  173. package/build-types/validated-form-controls/test/range-control.d.ts.map +1 -0
  174. package/build-types/validated-form-controls/test/select-control.d.ts +2 -0
  175. package/build-types/validated-form-controls/test/select-control.d.ts.map +1 -0
  176. package/build-types/validated-form-controls/test/text-control.d.ts +2 -0
  177. package/build-types/validated-form-controls/test/text-control.d.ts.map +1 -0
  178. package/build-types/validated-form-controls/test/textarea-control.d.ts +2 -0
  179. package/build-types/validated-form-controls/test/textarea-control.d.ts.map +1 -0
  180. package/build-types/validated-form-controls/test/toggle-control.d.ts +2 -0
  181. package/build-types/validated-form-controls/test/toggle-control.d.ts.map +1 -0
  182. package/build-types/validated-form-controls/test/toggle-group-control.d.ts +2 -0
  183. package/build-types/validated-form-controls/test/toggle-group-control.d.ts.map +1 -0
  184. package/build-types/validated-form-controls/validity-indicator.d.ts +2 -1
  185. package/build-types/validated-form-controls/validity-indicator.d.ts.map +1 -1
  186. package/package.json +24 -24
  187. package/src/button/style.scss +16 -5
  188. package/src/button-group/stories/index.story.tsx +1 -1
  189. package/src/combobox-control/index.tsx +6 -0
  190. package/src/combobox-control/stories/index.story.tsx +3 -2
  191. package/src/combobox-control/test/index.tsx +16 -9
  192. package/src/composite/legacy/stories/index.story.tsx +1 -1
  193. package/src/custom-gradient-picker/index.tsx +15 -4
  194. package/src/custom-gradient-picker/test/index.tsx +81 -0
  195. package/src/date-time/test/utils.test.ts +8 -11
  196. package/src/date-time/time/index.tsx +2 -12
  197. package/src/date-time/time/test/index.tsx +69 -0
  198. package/src/date-time/utils.ts +18 -0
  199. package/src/form-token-field/token-input.tsx +7 -1
  200. package/src/guide/style.scss +3 -0
  201. package/src/modal/style.scss +4 -7
  202. package/src/navigation/stories/index.story.tsx +1 -1
  203. package/src/radio-control/index.tsx +1 -0
  204. package/src/radio-control/test/index.tsx +5 -5
  205. package/src/radio-group/stories/index.story.tsx +1 -1
  206. package/src/snackbar/style.scss +1 -1
  207. package/src/toggle-group-control/stories/index.story.tsx +1 -0
  208. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +124 -164
  209. package/src/toggle-group-control/test/index.tsx +54 -0
  210. package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +1 -0
  211. package/src/toggle-group-control/toggle-group-control/component.tsx +13 -8
  212. package/src/toggle-group-control/toggle-group-control/styles.ts +0 -6
  213. package/src/validated-form-controls/control-with-error.tsx +44 -4
  214. package/src/validated-form-controls/test/checkbox-control.tsx +49 -0
  215. package/src/validated-form-controls/test/combobox-control.tsx +61 -0
  216. package/src/validated-form-controls/test/control-with-error.tsx +182 -1
  217. package/src/validated-form-controls/test/custom-select-control.tsx +60 -0
  218. package/src/validated-form-controls/test/form-token-field.tsx +52 -0
  219. package/src/validated-form-controls/test/input-control.tsx +42 -0
  220. package/src/validated-form-controls/test/number-control.tsx +44 -0
  221. package/src/validated-form-controls/test/radio-control.tsx +61 -0
  222. package/src/validated-form-controls/test/range-control.tsx +73 -0
  223. package/src/validated-form-controls/test/select-control.tsx +57 -0
  224. package/src/validated-form-controls/test/text-control.tsx +49 -0
  225. package/src/validated-form-controls/test/textarea-control.tsx +51 -0
  226. package/src/validated-form-controls/test/toggle-control.tsx +49 -0
  227. package/src/validated-form-controls/test/toggle-group-control.tsx +28 -0
  228. package/src/validated-form-controls/validity-indicator.tsx +3 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/test/number-control.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=radio-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/test/radio-control.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=range-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/test/range-control.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=select-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/test/select-control.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=text-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/test/text-control.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=textarea-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textarea-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/test/textarea-control.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=toggle-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/test/toggle-control.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=toggle-group-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle-group-control.d.ts","sourceRoot":"","sources":["../../../src/validated-form-controls/test/toggle-group-control.tsx"],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
- export declare function ValidityIndicator({ type, message, }: {
1
+ export declare function ValidityIndicator({ id, type, message, }: {
2
+ id?: string;
2
3
  type: 'validating' | 'valid' | 'invalid';
3
4
  message?: string;
4
5
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"validity-indicator.d.ts","sourceRoot":"","sources":["../../src/validated-form-controls/validity-indicator.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,iBAAiB,CAAE,EAClC,IAAI,EACJ,OAAO,GACP,EAAE;IACF,IAAI,EAAE,YAAY,GAAG,OAAO,GAAG,SAAS,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,+BAyBA"}
1
+ {"version":3,"file":"validity-indicator.d.ts","sourceRoot":"","sources":["../../src/validated-form-controls/validity-indicator.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,iBAAiB,CAAE,EAClC,EAAE,EACF,IAAI,EACJ,OAAO,GACP,EAAE;IACF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,YAAY,GAAG,OAAO,GAAG,SAAS,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,+BA0BA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "32.4.1-next.v.202603102151.0+59e17f9ec",
3
+ "version": "32.5.0",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -64,24 +64,24 @@
64
64
  "@types/highlight-words-core": "1.2.1",
65
65
  "@types/react": "^18.3.27",
66
66
  "@use-gesture/react": "^10.3.1",
67
- "@wordpress/a11y": "^4.41.1-next.v.202603102151.0+59e17f9ec",
68
- "@wordpress/base-styles": "^6.17.1-next.v.202603102151.0+59e17f9ec",
69
- "@wordpress/compose": "^7.41.1-next.v.202603102151.0+59e17f9ec",
70
- "@wordpress/date": "^5.41.1-next.v.202603102151.0+59e17f9ec",
71
- "@wordpress/deprecated": "^4.41.1-next.v.202603102151.0+59e17f9ec",
72
- "@wordpress/dom": "^4.41.1-next.v.202603102151.0+59e17f9ec",
73
- "@wordpress/element": "^6.41.1-next.v.202603102151.0+59e17f9ec",
74
- "@wordpress/escape-html": "^3.41.1-next.v.202603102151.0+59e17f9ec",
75
- "@wordpress/hooks": "^4.41.1-next.v.202603102151.0+59e17f9ec",
76
- "@wordpress/html-entities": "^4.41.1-next.v.202603102151.0+59e17f9ec",
77
- "@wordpress/i18n": "^6.14.1-next.v.202603102151.0+59e17f9ec",
78
- "@wordpress/icons": "^12.0.1-next.v.202603102151.0+59e17f9ec",
79
- "@wordpress/is-shallow-equal": "^5.41.1-next.v.202603102151.0+59e17f9ec",
80
- "@wordpress/keycodes": "^4.41.1-next.v.202603102151.0+59e17f9ec",
81
- "@wordpress/primitives": "^4.41.1-next.v.202603102151.0+59e17f9ec",
82
- "@wordpress/private-apis": "^1.41.1-next.v.202603102151.0+59e17f9ec",
83
- "@wordpress/rich-text": "^7.41.1-next.v.202603102151.0+59e17f9ec",
84
- "@wordpress/warning": "^3.41.1-next.v.202603102151.0+59e17f9ec",
67
+ "@wordpress/a11y": "^4.43.0",
68
+ "@wordpress/base-styles": "^6.19.0",
69
+ "@wordpress/compose": "^7.43.0",
70
+ "@wordpress/date": "^5.43.0",
71
+ "@wordpress/deprecated": "^4.43.0",
72
+ "@wordpress/dom": "^4.43.0",
73
+ "@wordpress/element": "^6.43.0",
74
+ "@wordpress/escape-html": "^3.43.0",
75
+ "@wordpress/hooks": "^4.43.0",
76
+ "@wordpress/html-entities": "^4.43.0",
77
+ "@wordpress/i18n": "^6.16.0",
78
+ "@wordpress/icons": "^12.1.0",
79
+ "@wordpress/is-shallow-equal": "^5.43.0",
80
+ "@wordpress/keycodes": "^4.43.0",
81
+ "@wordpress/primitives": "^4.43.0",
82
+ "@wordpress/private-apis": "^1.43.0",
83
+ "@wordpress/rich-text": "^7.43.0",
84
+ "@wordpress/warning": "^3.43.0",
85
85
  "change-case": "^4.1.2",
86
86
  "clsx": "^2.1.1",
87
87
  "colord": "^2.7.0",
@@ -103,13 +103,13 @@
103
103
  },
104
104
  "devDependencies": {
105
105
  "@ariakit/test": "^0.4.13",
106
- "@storybook/addon-docs": "^10.1.11",
107
- "@storybook/react-vite": "^10.1.11",
106
+ "@storybook/addon-docs": "^10.2.8",
107
+ "@storybook/react-vite": "^10.2.8",
108
108
  "@testing-library/jest-dom": "^6.9.1",
109
109
  "@types/jest": "^29.5.14",
110
- "@wordpress/jest-console": "^8.41.1-next.v.202603102151.0+59e17f9ec",
110
+ "@wordpress/jest-console": "^8.43.0",
111
111
  "snapshot-diff": "^0.10.0",
112
- "storybook": "^10.1.11",
112
+ "storybook": "^10.2.8",
113
113
  "timezone-mock": "^1.3.6"
114
114
  },
115
115
  "peerDependencies": {
@@ -119,5 +119,5 @@
119
119
  "publishConfig": {
120
120
  "access": "public"
121
121
  },
122
- "gitHead": "86db21e727d89e8f0dbba9300d2f97fd22b08693"
122
+ "gitHead": "2cea90674d11aa521ec3f71652fb3a6a4c383969"
123
123
  }
@@ -48,11 +48,6 @@
48
48
  box-shadow: 0 0 0 var(--wp-admin-border-width-focus) $components-color-accent;
49
49
  }
50
50
 
51
- // Windows High Contrast mode will show this outline, but not the box-shadow.
52
- &:focus {
53
- outline: 3px solid transparent;
54
- }
55
-
56
51
  /**
57
52
  * Primary button style.
58
53
  */
@@ -276,6 +271,14 @@
276
271
  }
277
272
  }
278
273
 
274
+ // Windows High Contrast mode will show this outline, but not the box-shadow.
275
+ // This rule is placed after variant outline declarations (e.g. is-primary,
276
+ // is-secondary, is-tertiary) to ensure it wins by source order at the same
277
+ // specificity, while not using `:not(:active)` to avoid outline flicker.
278
+ &:focus {
279
+ outline: 3px solid transparent;
280
+ }
281
+
279
282
  &:not(:disabled, [aria-disabled="true"]):active {
280
283
  color: $components-color-foreground;
281
284
  }
@@ -388,6 +391,14 @@
388
391
  }
389
392
  }
390
393
 
394
+ // Hide focus outline on :active to provide click feedback in forced-colors
395
+ // mode, where box-shadow is not visible. Higher specificity (0,3,0)
396
+ // ensures this wins over variant outline declarations. Placed after
397
+ // .is-pressed to also win by source order at equal specificity (0,3,0).
398
+ &:focus:active {
399
+ outline: none;
400
+ }
401
+
391
402
  svg {
392
403
  fill: currentColor;
393
404
  outline: none;
@@ -16,7 +16,7 @@ import Button from '../../button';
16
16
  * This component is deprecated. Use `ToggleGroupControl` instead.
17
17
  */
18
18
  const meta: Meta< typeof ButtonGroup > = {
19
- title: 'Components (Deprecated)/ButtonGroup',
19
+ title: 'Components/Deprecated/ButtonGroup',
20
20
  id: 'components-buttongroup',
21
21
  component: ButtonGroup,
22
22
  argTypes: {
@@ -358,6 +358,12 @@ function ComboboxControl( props: ComboboxControlProps ) {
358
358
  matchingSuggestions
359
359
  ) }
360
360
  onChange={ onInputChange }
361
+ aria-describedby={
362
+ help
363
+ ? // TODO: Refactor `TokenInput` to not use hardcoded IDs.
364
+ `components-form-token-input-${ instanceId }__help`
365
+ : undefined
366
+ }
361
367
  />
362
368
  </FlexBlock>
363
369
  { isLoading && <Spinner /> }
@@ -88,8 +88,9 @@ const Template: StoryFn< typeof ComboboxControl > = ( {
88
88
  export const Default = Template.bind( {} );
89
89
  Default.args = {
90
90
  __next40pxDefaultSize: true,
91
- label: 'Select a country',
91
+ label: 'Country',
92
92
  options: countryOptions,
93
+ help: 'Help text to describe the control.',
93
94
  };
94
95
 
95
96
  /**
@@ -100,7 +101,7 @@ Default.args = {
100
101
  export const WithCustomRenderItem = Template.bind( {} );
101
102
  WithCustomRenderItem.args = {
102
103
  ...Default.args,
103
- label: 'Select an author',
104
+ label: 'Author',
104
105
  options: [
105
106
  {
106
107
  value: 'parsley',
@@ -92,8 +92,8 @@ describe.each( [
92
92
  render(
93
93
  <Component options={ timezones } label={ defaultLabelText } />
94
94
  );
95
- const label = getLabel( defaultLabelText );
96
- expect( label ).toBeVisible();
95
+ expect( getLabel( defaultLabelText ) ).toBeVisible();
96
+ expect( getInput( defaultLabelText ) ).toBeVisible();
97
97
  } );
98
98
 
99
99
  it( 'should render with hidden label', () => {
@@ -104,13 +104,7 @@ describe.each( [
104
104
  hideLabelFromVision
105
105
  />
106
106
  );
107
- const label = getLabel( defaultLabelText );
108
-
109
- expect( label ).toBeInTheDocument();
110
- expect( label ).toHaveAttribute(
111
- 'data-wp-component',
112
- 'VisuallyHidden'
113
- );
107
+ expect( getInput( defaultLabelText ) ).toBeVisible();
114
108
  } );
115
109
 
116
110
  it( 'should render with the correct options', async () => {
@@ -451,6 +445,19 @@ describe.each( [
451
445
  expect( input ).toHaveFocus();
452
446
  } );
453
447
 
448
+ it( 'should associate the `help` text with the combobox accessibly', () => {
449
+ render(
450
+ <Component
451
+ options={ timezones }
452
+ label={ defaultLabelText }
453
+ help="Help text"
454
+ />
455
+ );
456
+ expect( getInput( defaultLabelText ) ).toHaveAccessibleDescription(
457
+ 'Help text'
458
+ );
459
+ } );
460
+
454
461
  it( 'should reset input when pressing the Reset button with the Spacebar key', async () => {
455
462
  const user = await userEvent.setup();
456
463
  const targetOption = timezones[ 13 ];
@@ -15,7 +15,7 @@ import {
15
15
  import { UseCompositeStatePlaceholder, transform } from './utils';
16
16
 
17
17
  const meta: Meta< typeof UseCompositeStatePlaceholder > = {
18
- title: 'Components (Deprecated)/Composite (Unstable)',
18
+ title: 'Components/Deprecated/Composite (Unstable)',
19
19
  id: 'components-composite-unstable',
20
20
  component: UseCompositeStatePlaceholder,
21
21
  subcomponents: {
@@ -7,6 +7,7 @@ import { type LinearGradientNode } from 'gradient-parser';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { __ } from '@wordpress/i18n';
10
+ import { useRef } from '@wordpress/element';
10
11
 
11
12
  /**
12
13
  * Internal dependencies
@@ -25,8 +26,8 @@ import {
25
26
  import { serializeGradient } from './serializer';
26
27
  import {
27
28
  DEFAULT_LINEAR_GRADIENT_ANGLE,
28
- HORIZONTAL_GRADIENT_ORIENTATION,
29
29
  GRADIENT_OPTIONS,
30
+ HORIZONTAL_GRADIENT_ORIENTATION,
30
31
  } from './constants';
31
32
  import {
32
33
  AccessoryWrapper,
@@ -70,14 +71,24 @@ const GradientTypePicker = ( {
70
71
  onChange,
71
72
  }: GradientTypePickerProps ) => {
72
73
  const { type } = gradientAST;
74
+ const lastLinearOrientationAngle = useRef(
75
+ Number( HORIZONTAL_GRADIENT_ORIENTATION.value )
76
+ );
77
+
78
+ if ( type === 'linear-gradient' && gradientAST.orientation ) {
79
+ lastLinearOrientationAngle.current = Number(
80
+ gradientAST.orientation.value
81
+ );
82
+ }
73
83
 
74
84
  const onSetLinearGradient = () => {
75
85
  onChange(
76
86
  serializeGradient( {
77
87
  ...gradientAST,
78
- orientation: gradientAST.orientation
79
- ? undefined
80
- : HORIZONTAL_GRADIENT_ORIENTATION,
88
+ orientation: {
89
+ type: 'angular' as const,
90
+ value: `${ lastLinearOrientationAngle.current }`,
91
+ },
81
92
  type: 'linear-gradient',
82
93
  } satisfies LinearGradientNode )
83
94
  );
@@ -0,0 +1,81 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render, screen } from '@testing-library/react';
5
+ import userEvent from '@testing-library/user-event';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import CustomGradientPicker from '../';
11
+
12
+ describe( 'CustomGradientPicker', () => {
13
+ describe( 'GradientTypePicker angle persistence', () => {
14
+ it( 'should restore the previous linear angle when switching from radial back to linear', async () => {
15
+ const user = userEvent.setup();
16
+ const onChange = jest.fn();
17
+
18
+ render(
19
+ <CustomGradientPicker
20
+ value="linear-gradient(125deg,rgb(0,0,0) 0%,rgb(255,255,255) 100%)"
21
+ onChange={ onChange }
22
+ />
23
+ );
24
+
25
+ const typeSelect = screen.getByRole( 'combobox', {
26
+ name: /type/i,
27
+ } );
28
+ await user.selectOptions( typeSelect, 'radial-gradient' );
29
+ await user.selectOptions( typeSelect, 'linear-gradient' );
30
+
31
+ // Verify the angle from before the radial switch is restored, not the default
32
+ const lastCall =
33
+ onChange.mock.calls[ onChange.mock.calls.length - 1 ][ 0 ];
34
+ expect( lastCall ).toContain( '125deg' );
35
+ } );
36
+
37
+ it( 'should use HORIZONTAL_GRADIENT_ORIENTATION when no prior linear angle exists', async () => {
38
+ const user = userEvent.setup();
39
+ const onChange = jest.fn();
40
+
41
+ // Start with a radial gradient so there is no previous linear angle in the ref
42
+ render(
43
+ <CustomGradientPicker
44
+ value="radial-gradient(rgb(0,0,0) 0%, rgb(255,255,255) 100%)"
45
+ onChange={ onChange }
46
+ />
47
+ );
48
+
49
+ const typeSelect = screen.getByRole( 'combobox', {
50
+ name: /type/i,
51
+ } );
52
+ await user.selectOptions( typeSelect, 'linear-gradient' );
53
+
54
+ const lastCall =
55
+ onChange.mock.calls[ onChange.mock.calls.length - 1 ][ 0 ];
56
+ expect( lastCall ).toContain( '90deg' );
57
+ } );
58
+
59
+ it( 'should not restore angle when switching to radial', async () => {
60
+ const user = userEvent.setup();
61
+ const onChange = jest.fn();
62
+
63
+ render(
64
+ <CustomGradientPicker
65
+ value="linear-gradient(45deg, rgb(0,0,0) 0%, rgb(255,255,255) 100%)"
66
+ onChange={ onChange }
67
+ />
68
+ );
69
+
70
+ const typeSelect = screen.getByRole( 'combobox', {
71
+ name: /type/i,
72
+ } );
73
+ await user.selectOptions( typeSelect, 'radial-gradient' );
74
+
75
+ // Radial gradients have no orientation, so deg should not appear in the output
76
+ const lastCall =
77
+ onChange.mock.calls[ onChange.mock.calls.length - 1 ][ 0 ];
78
+ expect( lastCall ).not.toContain( 'deg' );
79
+ } );
80
+ } );
81
+ } );
@@ -1,17 +1,14 @@
1
- /**
2
- * External dependencies
3
- */
4
1
  import timezoneMock from 'timezone-mock';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
2
  import { getSettings, setSettings, type DateSettings } from '@wordpress/date';
3
+ import { inputToDate, getDaysInMonth } from '../utils';
10
4
 
11
- /**
12
- * Internal dependencies
13
- */
14
- import { inputToDate } from '../utils';
5
+ describe( 'getDaysInMonth', () => {
6
+ it( 'should return the number of days in the month', () => {
7
+ expect( getDaysInMonth( 2026, 0 ) ).toBe( 31 );
8
+ expect( getDaysInMonth( 2026, 1 ) ).toBe( 28 );
9
+ expect( getDaysInMonth( 2028, 1 ) ).toBe( 29 );
10
+ } );
11
+ } );
15
12
 
16
13
  describe( 'inputToDate', () => {
17
14
  let originalSettings: DateSettings;
@@ -1,18 +1,7 @@
1
- /**
2
- * External dependencies
3
- */
4
1
  import { startOfMinute } from 'date-fns';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
2
  import { useState, useMemo, useEffect } from '@wordpress/element';
10
3
  import { __ } from '@wordpress/i18n';
11
4
  import { date as formatDate } from '@wordpress/date';
12
-
13
- /**
14
- * Internal dependencies
15
- */
16
5
  import BaseControl from '../../base-control';
17
6
  import { VisuallyHidden } from '../../visually-hidden';
18
7
  import SelectControl from '../../select-control';
@@ -33,6 +22,7 @@ import {
33
22
  buildPadInputStateReducer,
34
23
  validateInputElementTarget,
35
24
  setInConfiguredTimezone,
25
+ getDaysInMonth,
36
26
  } from '../utils';
37
27
  import { TIMEZONELESS_FORMAT } from '../constants';
38
28
  import { TimeInput } from './time-input';
@@ -150,7 +140,7 @@ export function TimePicker( {
150
140
  value={ day }
151
141
  step={ 1 }
152
142
  min={ 1 }
153
- max={ 31 }
143
+ max={ getDaysInMonth( Number( year ), Number( month ) - 1 ) }
154
144
  required
155
145
  spinControls="none"
156
146
  isPressEnterToChange
@@ -158,6 +158,75 @@ describe( 'TimePicker', () => {
158
158
  expect( onChangeSpy ).toHaveBeenCalledWith( '1986-10-18T11:59:00' );
159
159
  } );
160
160
 
161
+ it( 'should call onChange with a bounded day if out of bounds', async () => {
162
+ const user = userEvent.setup();
163
+
164
+ const onChangeSpy = jest.fn();
165
+
166
+ render(
167
+ <TimePicker
168
+ currentTime="2026-02-05T00:00:00"
169
+ onChange={ onChangeSpy }
170
+ is12Hour
171
+ />
172
+ );
173
+
174
+ const dayInput = screen.getByLabelText( 'Day' );
175
+
176
+ await user.clear( dayInput );
177
+ await user.type( dayInput, '30' );
178
+ await user.keyboard( '{Tab}' );
179
+
180
+ expect( onChangeSpy ).toHaveBeenCalledWith( '2026-02-28T00:00:00' );
181
+ expect( dayInput ).toHaveValue( 28 );
182
+ } );
183
+
184
+ it( 'should clamp day when switching months', async () => {
185
+ const user = userEvent.setup();
186
+
187
+ const onChangeSpy = jest.fn();
188
+
189
+ render(
190
+ <TimePicker
191
+ currentTime="2026-03-31T00:00:00"
192
+ onChange={ onChangeSpy }
193
+ is12Hour
194
+ />
195
+ );
196
+
197
+ const monthSelect = screen.getByLabelText( 'Month' );
198
+ const dayInput = screen.getByLabelText( 'Day' );
199
+
200
+ await user.selectOptions( monthSelect, '02' );
201
+
202
+ expect( onChangeSpy ).toHaveBeenCalledWith( '2026-02-28T00:00:00' );
203
+ expect( dayInput ).toHaveValue( 28 );
204
+ } );
205
+
206
+ it( 'should clamp day when switching year from leap to non-leap', async () => {
207
+ const user = userEvent.setup();
208
+
209
+ const onChangeSpy = jest.fn();
210
+
211
+ render(
212
+ <TimePicker
213
+ currentTime="2028-02-29T00:00:00"
214
+ onChange={ onChangeSpy }
215
+ is12Hour
216
+ />
217
+ );
218
+
219
+ const dayInput = screen.getByLabelText( 'Day' );
220
+ const yearInput = screen.getByLabelText( 'Year' );
221
+
222
+ await user.clear( yearInput );
223
+ await user.type( yearInput, '2026' );
224
+ await user.keyboard( '{Tab}' );
225
+
226
+ expect( onChangeSpy ).toHaveBeenCalledWith( '2026-02-28T00:00:00' );
227
+ expect( dayInput ).toHaveValue( 28 );
228
+ } );
229
+
161
230
  it( 'should switch to PM correctly', async () => {
162
231
  const user = userEvent.setup();
163
232
 
@@ -110,6 +110,19 @@ export function buildPadInputStateReducer( pad: number ) {
110
110
  };
111
111
  }
112
112
 
113
+ /**
114
+ * Returns the number of days in a month.
115
+ *
116
+ * @param year The year
117
+ * @param month The month, zero-indexed (0-11)
118
+ *
119
+ * @return The number of days in the month
120
+ */
121
+ export const getDaysInMonth = ( year: number, month: number ) =>
122
+ // Take advantage of JavaScript's built-in date wrapping logic, where day 0
123
+ // of the next month is interpreted as the last day of the preceding month.
124
+ new Date( year, month + 1, 0 ).getDate();
125
+
113
126
  /**
114
127
  * Updates specific date fields in the configured timezone and returns a new
115
128
  * UTC date.
@@ -139,6 +152,11 @@ export function setInConfiguredTimezone(
139
152
  ...updates,
140
153
  };
141
154
 
155
+ // Clamp the day to the last valid day of the month, to avoid producing
156
+ // invalid date strings (e.g. "2026-02-31").
157
+ const daysInMonth = getDaysInMonth( values.year, values.month );
158
+ values.date = Math.min( values.date, daysInMonth );
159
+
142
160
  const year = String( values.year ).padStart( 4, '0' );
143
161
  const month = String( values.month + 1 ).padStart( 2, '0' );
144
162
  const day = String( values.date ).padStart( 2, '0' );
@@ -28,6 +28,7 @@ export function UnForwardedTokenInput(
28
28
  onChange,
29
29
  onFocus,
30
30
  onBlur,
31
+ 'aria-describedby': ariaDescribedBy,
31
32
  ...restProps
32
33
  } = props;
33
34
 
@@ -86,7 +87,12 @@ export function UnForwardedTokenInput(
86
87
  ? `components-form-token-suggestions-${ instanceId }-${ selectedSuggestionIndex }`
87
88
  : undefined
88
89
  }
89
- aria-describedby={ `components-form-token-suggestions-howto-${ instanceId }` }
90
+ aria-describedby={ [
91
+ `components-form-token-suggestions-howto-${ instanceId }`,
92
+ ariaDescribedBy,
93
+ ]
94
+ .filter( Boolean )
95
+ .join( ' ' ) }
90
96
  />
91
97
  );
92
98
  }
@@ -6,9 +6,11 @@
6
6
 
7
7
  .components-guide {
8
8
  $image-height: 300px;
9
+ // TODO: Replace with a --wpds-dimension-surface-width-* token.
9
10
  $image-width: 320px;
10
11
 
11
12
  @include break-small() {
13
+ // TODO: Replace with a --wpds-dimension-surface-width-* token.
12
14
  width: 600px;
13
15
  }
14
16
 
@@ -86,6 +88,7 @@
86
88
 
87
89
  .components-modal__frame.components-guide {
88
90
  border: none;
91
+ // TODO: Replace with a --wpds-dimension-surface-width-* token.
89
92
  min-width: 312px;
90
93
  max-height: 575px;
91
94
 
@@ -65,7 +65,7 @@
65
65
  border-radius: $radius-large;
66
66
  margin: auto;
67
67
  width: auto;
68
- min-width: $modal-min-width;
68
+ min-width: var(--wpds-dimension-surface-width-sm);
69
69
  max-width: calc(100% - #{$grid-unit-20 * 2});
70
70
  max-height: calc(100% - #{$header-height * 2});
71
71
 
@@ -88,17 +88,14 @@
88
88
  width: 100%;
89
89
  }
90
90
 
91
- // The following widths were selected to align with existing baselines
92
- // found elsewhere in the editor.
93
- // See https://github.com/WordPress/gutenberg/pull/54471#issuecomment-1723818809
94
91
  &.has-size-small {
95
- max-width: $modal-width-small;
92
+ max-width: var(--wpds-dimension-surface-width-md);
96
93
  }
97
94
  &.has-size-medium {
98
- max-width: $modal-width-medium;
95
+ max-width: var(--wpds-dimension-surface-width-lg);
99
96
  }
100
97
  &.has-size-large {
101
- max-width: $modal-width-large;
98
+ max-width: var(--wpds-dimension-surface-width-2xl);
102
99
  }
103
100
 
104
101
  }