@wordpress/components 25.15.1-next.79a6196f.0 → 25.16.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 (259) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/build/border-box-control/border-box-control/component.js.map +1 -1
  3. package/build/border-box-control/border-box-control/hook.js +3 -1
  4. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  5. package/build/border-box-control/types.js.map +1 -1
  6. package/build/border-control/border-control/component.js +5 -1
  7. package/build/border-control/border-control/component.js.map +1 -1
  8. package/build/border-control/border-control/hook.js +18 -15
  9. package/build/border-control/border-control/hook.js.map +1 -1
  10. package/build/border-control/border-control-dropdown/component.js +2 -1
  11. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  12. package/build/border-control/border-control-style-picker/component.js +21 -49
  13. package/build/border-control/border-control-style-picker/component.js.map +1 -1
  14. package/build/border-control/styles.js +15 -27
  15. package/build/border-control/styles.js.map +1 -1
  16. package/build/border-control/types.js.map +1 -1
  17. package/build/box-control/all-input-control.js +35 -29
  18. package/build/box-control/all-input-control.js.map +1 -1
  19. package/build/box-control/axial-input-controls.js +40 -54
  20. package/build/box-control/axial-input-controls.js.map +1 -1
  21. package/build/box-control/index.js +21 -24
  22. package/build/box-control/index.js.map +1 -1
  23. package/build/box-control/input-controls.js +45 -37
  24. package/build/box-control/input-controls.js.map +1 -1
  25. package/build/box-control/styles/box-control-styles.js +50 -112
  26. package/build/box-control/styles/box-control-styles.js.map +1 -1
  27. package/build/box-control/types.js.map +1 -1
  28. package/build/box-control/utils.js +123 -8
  29. package/build/box-control/utils.js.map +1 -1
  30. package/build/button/index.js +14 -16
  31. package/build/button/index.js.map +1 -1
  32. package/build/button/types.js.map +1 -1
  33. package/build/color-picker/hsl-input.js +55 -33
  34. package/build/color-picker/hsl-input.js.map +1 -1
  35. package/build/custom-select-control-v2/index.js +3 -2
  36. package/build/custom-select-control-v2/index.js.map +1 -1
  37. package/build/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
  38. package/build/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  39. package/build/theme/styles.js +11 -6
  40. package/build/theme/styles.js.map +1 -1
  41. package/build/toggle-group-control/toggle-group-control/utils.js +7 -1
  42. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  43. package/build/tooltip/index.js +15 -12
  44. package/build/tooltip/index.js.map +1 -1
  45. package/build/tooltip/types.js.map +1 -1
  46. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  47. package/build-module/border-box-control/border-box-control/hook.js +3 -1
  48. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  49. package/build-module/border-box-control/types.js.map +1 -1
  50. package/build-module/border-control/border-control/component.js +5 -1
  51. package/build-module/border-control/border-control/component.js.map +1 -1
  52. package/build-module/border-control/border-control/hook.js +18 -15
  53. package/build-module/border-control/border-control/hook.js.map +1 -1
  54. package/build-module/border-control/border-control-dropdown/component.js +2 -1
  55. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  56. package/build-module/border-control/border-control-style-picker/component.js +21 -48
  57. package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
  58. package/build-module/border-control/styles.js +14 -24
  59. package/build-module/border-control/styles.js.map +1 -1
  60. package/build-module/border-control/types.js.map +1 -1
  61. package/build-module/box-control/all-input-control.js +38 -28
  62. package/build-module/box-control/all-input-control.js.map +1 -1
  63. package/build-module/box-control/axial-input-controls.js +42 -57
  64. package/build-module/box-control/axial-input-controls.js.map +1 -1
  65. package/build-module/box-control/index.js +22 -25
  66. package/build-module/box-control/index.js.map +1 -1
  67. package/build-module/box-control/input-controls.js +47 -40
  68. package/build-module/box-control/input-controls.js.map +1 -1
  69. package/build-module/box-control/styles/box-control-styles.js +45 -105
  70. package/build-module/box-control/styles/box-control-styles.js.map +1 -1
  71. package/build-module/box-control/types.js.map +1 -1
  72. package/build-module/box-control/utils.js +121 -7
  73. package/build-module/box-control/utils.js.map +1 -1
  74. package/build-module/button/index.js +14 -16
  75. package/build-module/button/index.js.map +1 -1
  76. package/build-module/button/types.js.map +1 -1
  77. package/build-module/color-picker/hsl-input.js +55 -33
  78. package/build-module/color-picker/hsl-input.js.map +1 -1
  79. package/build-module/custom-select-control-v2/index.js +3 -2
  80. package/build-module/custom-select-control-v2/index.js.map +1 -1
  81. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
  82. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  83. package/build-module/theme/styles.js +11 -2
  84. package/build-module/theme/styles.js.map +1 -1
  85. package/build-module/toggle-group-control/toggle-group-control/utils.js +7 -1
  86. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  87. package/build-module/tooltip/index.js +16 -13
  88. package/build-module/tooltip/index.js.map +1 -1
  89. package/build-module/tooltip/types.js.map +1 -1
  90. package/build-style/style-rtl.css +6 -4
  91. package/build-style/style.css +6 -4
  92. package/build-types/border-box-control/border-box-control/component.d.ts +1 -0
  93. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  94. package/build-types/border-box-control/border-box-control/hook.d.ts +4 -4
  95. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  96. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +5 -5
  97. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +4 -4
  98. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +4 -4
  99. package/build-types/border-box-control/stories/index.story.d.ts +2 -1
  100. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  101. package/build-types/border-box-control/types.d.ts +6 -0
  102. package/build-types/border-box-control/types.d.ts.map +1 -1
  103. package/build-types/border-control/border-control/component.d.ts +1 -0
  104. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  105. package/build-types/border-control/border-control/hook.d.ts +6 -4
  106. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  107. package/build-types/border-control/border-control-dropdown/component.d.ts +1 -0
  108. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  109. package/build-types/border-control/border-control-dropdown/hook.d.ts +5 -4
  110. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  111. package/build-types/border-control/border-control-style-picker/component.d.ts +3 -4
  112. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  113. package/build-types/border-control/stories/index.story.d.ts +12 -6
  114. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  115. package/build-types/border-control/styles.d.ts +0 -2
  116. package/build-types/border-control/styles.d.ts.map +1 -1
  117. package/build-types/border-control/types.d.ts +12 -1
  118. package/build-types/border-control/types.d.ts.map +1 -1
  119. package/build-types/box-control/all-input-control.d.ts +1 -1
  120. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  121. package/build-types/box-control/axial-input-controls.d.ts +1 -1
  122. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  123. package/build-types/box-control/index.d.ts +1 -1
  124. package/build-types/box-control/index.d.ts.map +1 -1
  125. package/build-types/box-control/input-controls.d.ts +1 -1
  126. package/build-types/box-control/input-controls.d.ts.map +1 -1
  127. package/build-types/box-control/stories/index.story.d.ts +42 -36
  128. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  129. package/build-types/box-control/styles/box-control-styles.d.ts +49 -23
  130. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  131. package/build-types/box-control/types.d.ts +12 -12
  132. package/build-types/box-control/types.d.ts.map +1 -1
  133. package/build-types/box-control/utils.d.ts +2 -1
  134. package/build-types/box-control/utils.d.ts.map +1 -1
  135. package/build-types/button/deprecated.d.ts +3 -3
  136. package/build-types/button/index.d.ts.map +1 -1
  137. package/build-types/button/types.d.ts +7 -3
  138. package/build-types/button/types.d.ts.map +1 -1
  139. package/build-types/card/card/hook.d.ts +4 -4
  140. package/build-types/card/card-body/hook.d.ts +4 -4
  141. package/build-types/card/card-divider/hook.d.ts +4 -4
  142. package/build-types/card/card-footer/hook.d.ts +4 -4
  143. package/build-types/card/card-header/hook.d.ts +4 -4
  144. package/build-types/card/card-media/hook.d.ts +4 -4
  145. package/build-types/color-palette/styles.d.ts +2 -2
  146. package/build-types/color-picker/component.d.ts +1 -1
  147. package/build-types/color-picker/hsl-input.d.ts.map +1 -1
  148. package/build-types/color-picker/stories/index.story.d.ts +1 -1
  149. package/build-types/color-picker/styles.d.ts +3 -3
  150. package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
  151. package/build-types/date-time/date/styles.d.ts +3 -3
  152. package/build-types/date-time/date-time/styles.d.ts +1 -1
  153. package/build-types/date-time/time/styles.d.ts +4 -4
  154. package/build-types/elevation/hook.d.ts +4 -4
  155. package/build-types/flex/flex/hook.d.ts +4 -4
  156. package/build-types/flex/flex-block/hook.d.ts +4 -4
  157. package/build-types/flex/flex-item/hook.d.ts +4 -4
  158. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  159. package/build-types/font-size-picker/styles.d.ts +1 -1
  160. package/build-types/grid/hook.d.ts +4 -4
  161. package/build-types/h-stack/hook.d.ts +4 -4
  162. package/build-types/heading/component.d.ts +1 -1
  163. package/build-types/heading/hook.d.ts +4 -4
  164. package/build-types/item-group/item/hook.d.ts +4 -4
  165. package/build-types/item-group/item-group/hook.d.ts +4 -4
  166. package/build-types/menu-item/index.d.ts +1 -1
  167. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  168. package/build-types/navigation/styles/navigation-styles.d.ts +2 -2
  169. package/build-types/navigator/navigator-back-button/hook.d.ts +4 -4
  170. package/build-types/navigator/navigator-button/hook.d.ts +4 -4
  171. package/build-types/number-control/index.d.ts +1 -1
  172. package/build-types/number-control/stories/index.story.d.ts +1 -1
  173. package/build-types/palette-edit/styles.d.ts +3 -3
  174. package/build-types/range-control/index.d.ts +1 -1
  175. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  176. package/build-types/resizable-box/index.d.ts +1 -1
  177. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  178. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  179. package/build-types/scrollable/hook.d.ts +4 -4
  180. package/build-types/spacer/hook.d.ts +4 -4
  181. package/build-types/surface/hook.d.ts +4 -4
  182. package/build-types/text/hook.d.ts +4 -4
  183. package/build-types/theme/styles.d.ts.map +1 -1
  184. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  185. package/build-types/toggle-group-control/toggle-group-control/utils.d.ts.map +1 -1
  186. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  187. package/build-types/toolbar/toolbar-button/index.d.ts +3 -3
  188. package/build-types/tools-panel/tools-panel/hook.d.ts +4 -4
  189. package/build-types/tools-panel/tools-panel-header/hook.d.ts +4 -4
  190. package/build-types/tools-panel/tools-panel-item/hook.d.ts +4 -4
  191. package/build-types/tooltip/index.d.ts +1 -1
  192. package/build-types/tooltip/index.d.ts.map +1 -1
  193. package/build-types/tooltip/stories/index.story.d.ts +1 -1
  194. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  195. package/build-types/tooltip/types.d.ts +1 -1
  196. package/build-types/tooltip/types.d.ts.map +1 -1
  197. package/build-types/truncate/hook.d.ts +4 -4
  198. package/build-types/unit-control/index.d.ts +1 -1
  199. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  200. package/build-types/v-stack/hook.d.ts +4 -4
  201. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  202. package/package.json +19 -19
  203. package/src/border-box-control/border-box-control/component.tsx +0 -1
  204. package/src/border-box-control/border-box-control/hook.ts +5 -1
  205. package/src/border-box-control/types.ts +6 -0
  206. package/src/border-control/border-control/component.tsx +4 -0
  207. package/src/border-control/border-control/hook.ts +22 -16
  208. package/src/border-control/border-control-dropdown/component.tsx +2 -1
  209. package/src/border-control/border-control-style-picker/component.tsx +31 -66
  210. package/src/border-control/styles.ts +0 -15
  211. package/src/border-control/types.ts +15 -1
  212. package/src/box-control/all-input-control.tsx +57 -34
  213. package/src/box-control/axial-input-controls.tsx +79 -69
  214. package/src/box-control/index.tsx +47 -54
  215. package/src/box-control/input-controls.tsx +114 -83
  216. package/src/box-control/styles/box-control-styles.ts +21 -61
  217. package/src/box-control/test/index.tsx +126 -18
  218. package/src/box-control/types.ts +10 -21
  219. package/src/box-control/utils.ts +43 -8
  220. package/src/button/README.md +1 -1
  221. package/src/button/index.tsx +21 -33
  222. package/src/button/test/index.tsx +122 -0
  223. package/src/button/types.ts +7 -3
  224. package/src/circular-option-picker/test/index.tsx +10 -16
  225. package/src/color-picker/hsl-input.tsx +56 -30
  226. package/src/color-picker/test/index.tsx +190 -16
  227. package/src/custom-select-control-v2/index.tsx +5 -2
  228. package/src/palette-edit/test/index.tsx +326 -10
  229. package/src/slot-fill/bubbles-virtually/use-slot-fills.ts +1 -1
  230. package/src/tabs/test/index.tsx +3 -1
  231. package/src/theme/styles.ts +3 -1
  232. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -6
  233. package/src/toggle-group-control/test/index.tsx +73 -36
  234. package/src/toggle-group-control/toggle-group-control/utils.ts +8 -3
  235. package/src/tooltip/index.tsx +29 -29
  236. package/src/tooltip/test/index.tsx +32 -13
  237. package/src/tooltip/types.ts +1 -1
  238. package/tsconfig.tsbuildinfo +1 -1
  239. package/build/border-control/border-control-style-picker/hook.js +0 -41
  240. package/build/border-control/border-control-style-picker/hook.js.map +0 -1
  241. package/build/box-control/styles/box-control-visualizer-styles.js +0 -93
  242. package/build/box-control/styles/box-control-visualizer-styles.js.map +0 -1
  243. package/build/box-control/unit-control.js +0 -76
  244. package/build/box-control/unit-control.js.map +0 -1
  245. package/build-module/border-control/border-control-style-picker/hook.js +0 -32
  246. package/build-module/border-control/border-control-style-picker/hook.js.map +0 -1
  247. package/build-module/box-control/styles/box-control-visualizer-styles.js +0 -86
  248. package/build-module/box-control/styles/box-control-visualizer-styles.js.map +0 -1
  249. package/build-module/box-control/unit-control.js +0 -68
  250. package/build-module/box-control/unit-control.js.map +0 -1
  251. package/build-types/border-control/border-control-style-picker/hook.d.ts +0 -267
  252. package/build-types/border-control/border-control-style-picker/hook.d.ts.map +0 -1
  253. package/build-types/box-control/styles/box-control-visualizer-styles.d.ts +0 -46
  254. package/build-types/box-control/styles/box-control-visualizer-styles.d.ts.map +0 -1
  255. package/build-types/box-control/unit-control.d.ts +0 -4
  256. package/build-types/box-control/unit-control.d.ts.map +0 -1
  257. package/src/border-control/border-control-style-picker/hook.ts +0 -35
  258. package/src/box-control/styles/box-control-visualizer-styles.ts +0 -75
  259. package/src/box-control/unit-control.tsx +0 -74
@@ -22,14 +22,14 @@ export declare function useVStack(props: WordPressComponentProps<VStackProps, 'd
22
22
  tabIndex?: number | undefined;
23
23
  'aria-activedescendant'?: string | undefined;
24
24
  'aria-atomic'?: (boolean | "false" | "true") | undefined;
25
- 'aria-autocomplete'?: "inline" | "none" | "both" | "list" | undefined;
25
+ 'aria-autocomplete'?: "inline" | "none" | "list" | "both" | undefined;
26
26
  'aria-busy'?: (boolean | "false" | "true") | undefined;
27
27
  'aria-checked'?: boolean | "mixed" | "false" | "true" | undefined;
28
28
  'aria-colcount'?: number | undefined;
29
29
  'aria-colindex'?: number | undefined;
30
30
  'aria-colspan'?: number | undefined;
31
31
  'aria-controls'?: string | undefined;
32
- 'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "location" | "date" | undefined;
32
+ 'aria-current'?: boolean | "time" | "page" | "step" | "false" | "true" | "location" | "date" | undefined;
33
33
  'aria-describedby'?: string | undefined;
34
34
  'aria-details'?: string | undefined;
35
35
  'aria-disabled'?: (boolean | "false" | "true") | undefined;
@@ -231,9 +231,9 @@ export declare function useVStack(props: WordPressComponentProps<VStackProps, 'd
231
231
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
232
232
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
233
233
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
234
- defaultValue?: string | number | readonly string[] | undefined;
235
234
  key?: import("react").Key | null | undefined;
236
235
  defaultChecked?: boolean | undefined;
236
+ defaultValue?: string | number | readonly string[] | undefined;
237
237
  suppressContentEditableWarning?: boolean | undefined;
238
238
  suppressHydrationWarning?: boolean | undefined;
239
239
  accessKey?: string | undefined;
@@ -261,7 +261,7 @@ export declare function useVStack(props: WordPressComponentProps<VStackProps, 'd
261
261
  itemRef?: string | undefined;
262
262
  results?: number | undefined;
263
263
  security?: string | undefined;
264
- unselectable?: "off" | "on" | undefined;
264
+ unselectable?: "on" | "off" | undefined;
265
265
  inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
266
266
  is?: string | undefined;
267
267
  as?: keyof JSX.IntrinsicElements | undefined;
@@ -9,7 +9,7 @@ export default meta;
9
9
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, Omit<import("../../h-stack/types").Props, "spacing" | "alignment"> & {
10
10
  alignment?: "top" | "bottom" | "left" | "center" | "right" | "start" | "end" | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "baseline" | "stretch" | "flex-end" | "flex-start" | "self-end" | "self-start" | "edge" | "bottomLeft" | "bottomRight" | "topLeft" | "topRight" | undefined;
11
11
  spacing?: import("csstype").Property.Width<string | number> | undefined;
12
- } & import("react").RefAttributes<any> & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "children" | "direction" | "expanded" | "spacing" | "wrap" | "justify" | "as" | keyof import("react").RefAttributes<any> | "isReversed" | "alignment"> & {
12
+ } & import("react").RefAttributes<any> & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "children" | "direction" | "expanded" | "spacing" | "as" | "wrap" | "justify" | keyof import("react").RefAttributes<any> | "isReversed" | "alignment"> & {
13
13
  as?: keyof JSX.IntrinsicElements | undefined;
14
14
  }>;
15
15
  //# sourceMappingURL=index.story.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/components",
3
- "version": "25.15.1-next.79a6196f.0",
3
+ "version": "25.16.0",
4
4
  "description": "UI components for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -42,23 +42,23 @@
42
42
  "@types/gradient-parser": "0.1.3",
43
43
  "@types/highlight-words-core": "1.2.1",
44
44
  "@use-gesture/react": "^10.2.24",
45
- "@wordpress/a11y": "^3.48.1-next.79a6196f.0",
46
- "@wordpress/compose": "^6.25.1-next.79a6196f.0",
47
- "@wordpress/date": "^4.48.1-next.79a6196f.0",
48
- "@wordpress/deprecated": "^3.48.1-next.79a6196f.0",
49
- "@wordpress/dom": "^3.48.1-next.79a6196f.0",
50
- "@wordpress/element": "^5.25.1-next.79a6196f.0",
51
- "@wordpress/escape-html": "^2.48.1-next.79a6196f.0",
52
- "@wordpress/hooks": "^3.48.1-next.79a6196f.0",
53
- "@wordpress/html-entities": "^3.48.1-next.79a6196f.0",
54
- "@wordpress/i18n": "^4.48.1-next.79a6196f.0",
55
- "@wordpress/icons": "^9.39.1-next.79a6196f.0",
56
- "@wordpress/is-shallow-equal": "^4.48.1-next.79a6196f.0",
57
- "@wordpress/keycodes": "^3.48.1-next.79a6196f.0",
58
- "@wordpress/primitives": "^3.46.1-next.79a6196f.0",
59
- "@wordpress/private-apis": "^0.30.1-next.79a6196f.0",
60
- "@wordpress/rich-text": "^6.25.1-next.79a6196f.0",
61
- "@wordpress/warning": "^2.48.1-next.79a6196f.0",
45
+ "@wordpress/a11y": "^3.50.0",
46
+ "@wordpress/compose": "^6.27.0",
47
+ "@wordpress/date": "^4.50.0",
48
+ "@wordpress/deprecated": "^3.50.0",
49
+ "@wordpress/dom": "^3.50.0",
50
+ "@wordpress/element": "^5.27.0",
51
+ "@wordpress/escape-html": "^2.50.0",
52
+ "@wordpress/hooks": "^3.50.0",
53
+ "@wordpress/html-entities": "^3.50.0",
54
+ "@wordpress/i18n": "^4.50.0",
55
+ "@wordpress/icons": "^9.41.0",
56
+ "@wordpress/is-shallow-equal": "^4.50.0",
57
+ "@wordpress/keycodes": "^3.50.0",
58
+ "@wordpress/primitives": "^3.48.0",
59
+ "@wordpress/private-apis": "^0.32.0",
60
+ "@wordpress/rich-text": "^6.27.0",
61
+ "@wordpress/warning": "^2.50.0",
62
62
  "change-case": "^4.1.2",
63
63
  "classnames": "^2.3.1",
64
64
  "colord": "^2.7.0",
@@ -88,5 +88,5 @@
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  },
91
- "gitHead": "1e74b942ac0119a22ceaaf5c9594263f3ec516ab"
91
+ "gitHead": "45de2cb4212fed7f2763e95f10300d1ff9d0ec08"
92
92
  }
@@ -89,7 +89,6 @@ const UnconnectedBorderBoxControl = (
89
89
  );
90
90
 
91
91
  const mergedRef = useMergeRefs( [ setPopoverAnchor, forwardedRef ] );
92
-
93
92
  return (
94
93
  <View className={ className } { ...otherProps } ref={ mergedRef }>
95
94
  <BorderLabel
@@ -35,9 +35,13 @@ export function useBorderBoxControl(
35
35
  size = 'default',
36
36
  value,
37
37
  __experimentalIsRenderedInSidebar = false,
38
+ __next40pxDefaultSize,
38
39
  ...otherProps
39
40
  } = useContextSystem( props, 'BorderBoxControl' );
40
41
 
42
+ const computedSize =
43
+ size === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;
44
+
41
45
  const mixedBorders = hasMixedBorders( value );
42
46
  const splitBorders = hasSplitBorders( value );
43
47
 
@@ -133,7 +137,7 @@ export function useBorderBoxControl(
133
137
  onSplitChange,
134
138
  toggleLinked,
135
139
  linkedValue,
136
- size,
140
+ size: computedSize,
137
141
  splitValue,
138
142
  wrapperClassName,
139
143
  __experimentalIsRenderedInSidebar,
@@ -45,6 +45,12 @@ export type BorderBoxControlProps = ColorProps &
45
45
  * properties but for each side; `top`, `right`, `bottom`, and `left`.
46
46
  */
47
47
  value: AnyBorder;
48
+ /**
49
+ * Start opting into the larger default height that will become the default size in a future version.
50
+ *
51
+ * @default false
52
+ */
53
+ __next40pxDefaultSize?: boolean;
48
54
  };
49
55
 
50
56
  export type LinkedButtonProps = Pick< BorderBoxControlProps, 'size' > & {
@@ -38,6 +38,7 @@ const UnconnectedBorderControl = (
38
38
  forwardedRef: React.ForwardedRef< any >
39
39
  ) => {
40
40
  const {
41
+ __next40pxDefaultSize = false,
41
42
  colors,
42
43
  disableCustomColors,
43
44
  disableUnits,
@@ -46,6 +47,7 @@ const UnconnectedBorderControl = (
46
47
  hideLabelFromVision,
47
48
  innerWrapperClassName,
48
49
  inputWidth,
50
+ isStyleSettable,
49
51
  label,
50
52
  onBorderChange,
51
53
  onSliderChange,
@@ -80,6 +82,7 @@ const UnconnectedBorderControl = (
80
82
  disableCustomColors={ disableCustomColors }
81
83
  enableAlpha={ enableAlpha }
82
84
  enableStyle={ enableStyle }
85
+ isStyleSettable={ isStyleSettable }
83
86
  onChange={ onBorderChange }
84
87
  previousStyleSelection={ previousStyleSelection }
85
88
  showDropdownHeader={ showDropdownHeader }
@@ -112,6 +115,7 @@ const UnconnectedBorderControl = (
112
115
  step={ [ 'px', '%' ].includes( widthUnit ) ? 1 : 0.1 }
113
116
  value={ widthValue || undefined }
114
117
  withInputField={ false }
118
+ __next40pxDefaultSize={ __next40pxDefaultSize }
115
119
  />
116
120
  ) }
117
121
  </HStack>
@@ -14,16 +14,12 @@ import { useCx } from '../../utils/hooks/use-cx';
14
14
 
15
15
  import type { Border, BorderControlProps } from '../types';
16
16
 
17
- const sanitizeBorder = ( border?: Border ) => {
18
- const hasNoWidth = border?.width === undefined || border.width === '';
19
- const hasNoColor = border?.color === undefined;
20
-
21
- // If width and color are undefined, unset any style selection as well.
22
- if ( hasNoWidth && hasNoColor ) {
23
- return undefined;
24
- }
25
-
26
- return border;
17
+ // If either width or color are defined, the border is considered valid
18
+ // and a border style can be set as well.
19
+ const isValidBorder = ( border?: Border ) => {
20
+ const hasWidth = border?.width !== undefined && border.width !== '';
21
+ const hasColor = border?.color !== undefined;
22
+ return hasWidth || hasColor;
27
23
  };
28
24
 
29
25
  export function useBorderControl(
@@ -41,9 +37,13 @@ export function useBorderControl(
41
37
  value: border,
42
38
  width,
43
39
  __experimentalIsRenderedInSidebar = false,
40
+ __next40pxDefaultSize,
44
41
  ...otherProps
45
42
  } = useContextSystem( props, 'BorderControl' );
46
43
 
44
+ const computedSize =
45
+ size === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;
46
+
47
47
  const [ widthValue, originalWidthUnit ] = parseQuantityAndUnitFromRawValue(
48
48
  border?.width
49
49
  );
@@ -53,12 +53,16 @@ export function useBorderControl(
53
53
  const [ colorSelection, setColorSelection ] = useState< string >();
54
54
  const [ styleSelection, setStyleSelection ] = useState< string >();
55
55
 
56
+ const isStyleSettable = shouldSanitizeBorder
57
+ ? isValidBorder( border )
58
+ : true;
59
+
56
60
  const onBorderChange = useCallback(
57
61
  ( newBorder?: Border ) => {
58
- if ( shouldSanitizeBorder ) {
59
- return onChange( sanitizeBorder( newBorder ) );
62
+ if ( shouldSanitizeBorder && ! isValidBorder( newBorder ) ) {
63
+ onChange( undefined );
64
+ return;
60
65
  }
61
-
62
66
  onChange( newBorder );
63
67
  },
64
68
  [ onChange, shouldSanitizeBorder ]
@@ -130,10 +134,10 @@ export function useBorderControl(
130
134
  }
131
135
  const innerWrapperClassName = useMemo( () => {
132
136
  const widthStyle = !! wrapperWidth && styles.wrapperWidth;
133
- const heightStyle = styles.wrapperHeight( size );
137
+ const heightStyle = styles.wrapperHeight( computedSize );
134
138
 
135
139
  return cx( styles.innerWrapper(), widthStyle, heightStyle );
136
- }, [ wrapperWidth, cx, size ] );
140
+ }, [ wrapperWidth, cx, computedSize ] );
137
141
 
138
142
  const sliderClassName = useMemo( () => {
139
143
  return cx( styles.borderSlider() );
@@ -147,6 +151,7 @@ export function useBorderControl(
147
151
  enableStyle,
148
152
  innerWrapperClassName,
149
153
  inputWidth: wrapperWidth,
154
+ isStyleSettable,
150
155
  onBorderChange,
151
156
  onSliderChange,
152
157
  onWidthChange,
@@ -155,7 +160,8 @@ export function useBorderControl(
155
160
  value: border,
156
161
  widthUnit,
157
162
  widthValue,
158
- size,
163
+ size: computedSize,
159
164
  __experimentalIsRenderedInSidebar,
165
+ __next40pxDefaultSize,
160
166
  };
161
167
  }
@@ -142,6 +142,7 @@ const BorderControlDropdown = (
142
142
  enableStyle,
143
143
  indicatorClassName,
144
144
  indicatorWrapperClassName,
145
+ isStyleSettable,
145
146
  onReset,
146
147
  onColorChange,
147
148
  onStyleChange,
@@ -218,7 +219,7 @@ const BorderControlDropdown = (
218
219
  clearable={ false }
219
220
  enableAlpha={ enableAlpha }
220
221
  />
221
- { enableStyle && (
222
+ { enableStyle && isStyleSettable && (
222
223
  <BorderControlStylePicker
223
224
  label={ __( 'Style' ) }
224
225
  value={ style }
@@ -7,16 +7,12 @@ import { __ } from '@wordpress/i18n';
7
7
  /**
8
8
  * Internal dependencies
9
9
  */
10
- import Button from '../../button';
11
- import { StyledLabel } from '../../base-control/styles/base-control-styles';
12
- import { View } from '../../view';
13
- import { Flex } from '../../flex';
14
- import { VisuallyHidden } from '../../visually-hidden';
15
- import type { WordPressComponentProps } from '../../context';
16
10
  import { contextConnect } from '../../context';
17
- import { useBorderControlStylePicker } from './hook';
18
-
19
- import type { LabelProps, StylePickerProps } from '../types';
11
+ import type { StylePickerProps } from '../types';
12
+ import {
13
+ ToggleGroupControl,
14
+ ToggleGroupControlOptionIcon,
15
+ } from '../../toggle-group-control';
20
16
 
21
17
  const BORDER_STYLES = [
22
18
  { label: __( 'Solid' ), icon: lineSolid, value: 'solid' },
@@ -24,67 +20,36 @@ const BORDER_STYLES = [
24
20
  { label: __( 'Dotted' ), icon: lineDotted, value: 'dotted' },
25
21
  ];
26
22
 
27
- const Label = ( props: LabelProps ) => {
28
- const { label, hideLabelFromVision } = props;
29
-
30
- if ( ! label ) {
31
- return null;
32
- }
33
-
34
- return hideLabelFromVision ? (
35
- <VisuallyHidden as="label">{ label }</VisuallyHidden>
36
- ) : (
37
- <StyledLabel>{ label }</StyledLabel>
38
- );
39
- };
40
-
41
- const BorderControlStylePicker = (
42
- props: WordPressComponentProps< StylePickerProps, 'div' >,
23
+ function UnconnectedBorderControlStylePicker(
24
+ { onChange, ...restProps }: StylePickerProps,
43
25
  forwardedRef: React.ForwardedRef< any >
44
- ) => {
45
- const {
46
- buttonClassName,
47
- hideLabelFromVision,
48
- label,
49
- onChange,
50
- value,
51
- ...otherProps
52
- } = useBorderControlStylePicker( props );
53
-
26
+ ) {
54
27
  return (
55
- <View { ...otherProps } ref={ forwardedRef }>
56
- <Label
57
- label={ label }
58
- hideLabelFromVision={ hideLabelFromVision }
59
- />
60
- <Flex justify="flex-start" gap={ 1 }>
61
- { BORDER_STYLES.map( ( borderStyle ) => (
62
- <Button
63
- key={ borderStyle.value }
64
- className={ buttonClassName }
65
- icon={ borderStyle.icon }
66
- size="small"
67
- isPressed={ borderStyle.value === value }
68
- onClick={ () =>
69
- onChange(
70
- borderStyle.value === value
71
- ? undefined
72
- : borderStyle.value
73
- )
74
- }
75
- aria-label={ borderStyle.label }
76
- label={ borderStyle.label }
77
- showTooltip={ true }
78
- />
79
- ) ) }
80
- </Flex>
81
- </View>
28
+ <ToggleGroupControl
29
+ __nextHasNoMarginBottom
30
+ __next40pxDefaultSize
31
+ ref={ forwardedRef }
32
+ isDeselectable
33
+ onChange={ ( value ) => {
34
+ onChange?.( value as string | undefined );
35
+ } }
36
+ { ...restProps }
37
+ >
38
+ { BORDER_STYLES.map( ( borderStyle ) => (
39
+ <ToggleGroupControlOptionIcon
40
+ key={ borderStyle.value }
41
+ value={ borderStyle.value }
42
+ icon={ borderStyle.icon }
43
+ label={ borderStyle.label }
44
+ />
45
+ ) ) }
46
+ </ToggleGroupControl>
82
47
  );
83
- };
48
+ }
84
49
 
85
- const ConnectedBorderControlStylePicker = contextConnect(
86
- BorderControlStylePicker,
50
+ const BorderControlStylePicker = contextConnect(
51
+ UnconnectedBorderControlStylePicker,
87
52
  'BorderControlStylePicker'
88
53
  );
89
54
 
90
- export default ConnectedBorderControlStylePicker;
55
+ export default BorderControlStylePicker;
@@ -165,21 +165,6 @@ export const resetButton = css`
165
165
  }
166
166
  `;
167
167
 
168
- export const borderControlStylePicker = css`
169
- ${ StyledLabel } {
170
- ${ labelStyles }
171
- }
172
- `;
173
-
174
- export const borderStyleButton = css`
175
- &&&&& {
176
- min-width: 32px;
177
- width: 32px;
178
- height: 32px;
179
- padding: 4px;
180
- }
181
- `;
182
-
183
168
  export const borderSlider = () => css`
184
169
  flex: 1 1 60%;
185
170
  ${ rtl( { marginRight: space( 3 ) } )() }
@@ -8,6 +8,7 @@ import type { CSSProperties } from 'react';
8
8
  */
9
9
  import type { ColorPaletteProps } from '../color-palette/types';
10
10
  import type { PopoverProps } from '../popover/types';
11
+ import type { ToggleGroupControlProps } from '../toggle-group-control/types';
11
12
 
12
13
  export type Border = {
13
14
  color?: CSSProperties[ 'borderColor' ];
@@ -99,6 +100,12 @@ export type BorderControlProps = ColorProps &
99
100
  * `RangeControl` for additional control over a border's width.
100
101
  */
101
102
  withSlider?: boolean;
103
+ /**
104
+ * Start opting into the larger default height that will become the default size in a future version.
105
+ *
106
+ * @default false
107
+ */
108
+ __next40pxDefaultSize?: boolean;
102
109
  };
103
110
 
104
111
  export type DropdownProps = ColorProps &
@@ -109,6 +116,10 @@ export type DropdownProps = ColorProps &
109
116
  * values for its popover controls.
110
117
  */
111
118
  border?: Border;
119
+ /**
120
+ * Whether a border style can be set, based on the border sanitization settings.
121
+ */
122
+ isStyleSettable: boolean;
112
123
  /**
113
124
  * An internal prop used to control the visibility of the dropdown.
114
125
  */
@@ -131,7 +142,10 @@ export type DropdownProps = ColorProps &
131
142
  showDropdownHeader?: boolean;
132
143
  };
133
144
 
134
- export type StylePickerProps = LabelProps & {
145
+ export type StylePickerProps = Omit<
146
+ ToggleGroupControlProps,
147
+ 'value' | 'onChange' | 'children'
148
+ > & {
135
149
  /**
136
150
  * A callback function invoked when a border style is selected or cleared.
137
151
  */
@@ -1,42 +1,56 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useInstanceId } from '@wordpress/compose';
1
5
  /**
2
6
  * Internal dependencies
3
7
  */
4
8
  import type { UnitControlProps } from '../unit-control/types';
9
+ import {
10
+ FlexedRangeControl,
11
+ StyledUnitControl,
12
+ } from './styles/box-control-styles';
13
+ import { HStack } from '../h-stack';
5
14
  import type { BoxControlInputControlProps } from './types';
6
- import UnitControl from './unit-control';
15
+ import { parseQuantityAndUnitFromRawValue } from '../unit-control';
7
16
  import {
8
17
  LABELS,
9
18
  applyValueToSides,
10
19
  getAllValue,
11
20
  isValuesMixed,
12
21
  isValuesDefined,
22
+ CUSTOM_VALUE_SETTINGS,
13
23
  } from './utils';
14
24
 
15
25
  const noop = () => {};
16
26
 
17
27
  export default function AllInputControl( {
28
+ __next40pxDefaultSize,
18
29
  onChange = noop,
19
30
  onFocus = noop,
20
- onHoverOn = noop,
21
- onHoverOff = noop,
22
31
  values,
23
32
  sides,
24
33
  selectedUnits,
25
34
  setSelectedUnits,
26
35
  ...props
27
36
  }: BoxControlInputControlProps ) {
37
+ const inputId = useInstanceId( AllInputControl, 'box-control-input-all' );
38
+
28
39
  const allValue = getAllValue( values, selectedUnits, sides );
29
40
  const hasValues = isValuesDefined( values );
30
41
  const isMixed = hasValues && isValuesMixed( values, selectedUnits, sides );
31
42
  const allPlaceholder = isMixed ? LABELS.mixed : undefined;
32
43
 
44
+ const [ parsedQuantity, parsedUnit ] =
45
+ parseQuantityAndUnitFromRawValue( allValue );
46
+
33
47
  const handleOnFocus: React.FocusEventHandler< HTMLInputElement > = (
34
48
  event
35
49
  ) => {
36
50
  onFocus( event, { side: 'all' } );
37
51
  };
38
52
 
39
- const handleOnChange: UnitControlProps[ 'onChange' ] = ( next ) => {
53
+ const onValueChange = ( next?: string ) => {
40
54
  const isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );
41
55
  const nextValue = isNumeric ? next : undefined;
42
56
  const nextValues = applyValueToSides( values, nextValue, sides );
@@ -44,6 +58,12 @@ export default function AllInputControl( {
44
58
  onChange( nextValues );
45
59
  };
46
60
 
61
+ const sliderOnChange = ( next?: number ) => {
62
+ onValueChange(
63
+ next !== undefined ? [ next, parsedUnit ].join( '' ) : undefined
64
+ );
65
+ };
66
+
47
67
  // Set selected unit so it can be used as fallback by unlinked controls
48
68
  // when individual sides do not have a value containing a unit.
49
69
  const handleOnUnitChange: UnitControlProps[ 'onUnitChange' ] = ( unit ) => {
@@ -51,36 +71,39 @@ export default function AllInputControl( {
51
71
  setSelectedUnits( newUnits );
52
72
  };
53
73
 
54
- const handleOnHoverOn = () => {
55
- onHoverOn( {
56
- top: true,
57
- bottom: true,
58
- left: true,
59
- right: true,
60
- } );
61
- };
62
-
63
- const handleOnHoverOff = () => {
64
- onHoverOff( {
65
- top: false,
66
- bottom: false,
67
- left: false,
68
- right: false,
69
- } );
70
- };
71
-
72
74
  return (
73
- <UnitControl
74
- { ...props }
75
- disableUnits={ isMixed }
76
- isOnly
77
- value={ allValue }
78
- onChange={ handleOnChange }
79
- onUnitChange={ handleOnUnitChange }
80
- onFocus={ handleOnFocus }
81
- onHoverOn={ handleOnHoverOn }
82
- onHoverOff={ handleOnHoverOff }
83
- placeholder={ allPlaceholder }
84
- />
75
+ <HStack>
76
+ <StyledUnitControl
77
+ { ...props }
78
+ __next40pxDefaultSize={ __next40pxDefaultSize }
79
+ className="component-box-control__unit-control"
80
+ disableUnits={ isMixed }
81
+ id={ inputId }
82
+ isPressEnterToChange
83
+ value={ allValue }
84
+ onChange={ onValueChange }
85
+ onUnitChange={ handleOnUnitChange }
86
+ onFocus={ handleOnFocus }
87
+ placeholder={ allPlaceholder }
88
+ label={ LABELS.all }
89
+ hideLabelFromVision
90
+ />
91
+
92
+ <FlexedRangeControl
93
+ __nextHasNoMarginBottom
94
+ __next40pxDefaultSize={ __next40pxDefaultSize }
95
+ aria-controls={ inputId }
96
+ label={ LABELS.all }
97
+ hideLabelFromVision
98
+ onChange={ sliderOnChange }
99
+ min={ 0 }
100
+ max={ CUSTOM_VALUE_SETTINGS[ parsedUnit ?? 'px' ]?.max ?? 10 }
101
+ step={
102
+ CUSTOM_VALUE_SETTINGS[ parsedUnit ?? 'px' ]?.step ?? 0.1
103
+ }
104
+ value={ parsedQuantity ?? 0 }
105
+ withInputField={ false }
106
+ />
107
+ </HStack>
85
108
  );
86
109
  }