@wordpress/components 28.6.0 → 28.7.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 (588) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/CONTRIBUTING.md +42 -19
  3. package/build/alignment-matrix-control/cell.js +4 -7
  4. package/build/alignment-matrix-control/cell.js.map +1 -1
  5. package/build/alignment-matrix-control/icon.js +31 -19
  6. package/build/alignment-matrix-control/icon.js.map +1 -1
  7. package/build/alignment-matrix-control/index.js +55 -51
  8. package/build/alignment-matrix-control/index.js.map +1 -1
  9. package/build/alignment-matrix-control/styles.js +73 -0
  10. package/build/alignment-matrix-control/styles.js.map +1 -0
  11. package/build/alignment-matrix-control/types.js.map +1 -1
  12. package/build/angle-picker-control/angle-circle.js +9 -9
  13. package/build/angle-picker-control/angle-circle.js.map +1 -1
  14. package/build/border-control/border-control/component.js +18 -13
  15. package/build/border-control/border-control/component.js.map +1 -1
  16. package/build/circular-option-picker/circular-option-picker-option.js +15 -9
  17. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  18. package/build/circular-option-picker/circular-option-picker.js +15 -12
  19. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  20. package/build/circular-option-picker/types.js.map +1 -1
  21. package/build/clipboard-button/index.js +6 -6
  22. package/build/clipboard-button/index.js.map +1 -1
  23. package/build/color-palette/utils.js +1 -2
  24. package/build/color-palette/utils.js.map +1 -1
  25. package/build/color-picker/color-copy-button.js +8 -8
  26. package/build/color-picker/color-copy-button.js.map +1 -1
  27. package/build/color-picker/hex-input.js +8 -8
  28. package/build/color-picker/hex-input.js.map +1 -1
  29. package/build/color-picker/input-with-slider.js +8 -8
  30. package/build/color-picker/input-with-slider.js.map +1 -1
  31. package/build/color-picker/styles.js +8 -8
  32. package/build/color-picker/styles.js.map +1 -1
  33. package/build/combobox-control/types.js.map +1 -1
  34. package/build/composite/group-label.js +33 -0
  35. package/build/composite/group-label.js.map +1 -0
  36. package/build/composite/group.js +33 -0
  37. package/build/composite/group.js.map +1 -0
  38. package/build/composite/hover.js +33 -0
  39. package/build/composite/hover.js.map +1 -0
  40. package/build/composite/index.js +50 -96
  41. package/build/composite/index.js.map +1 -1
  42. package/build/composite/item.js +33 -0
  43. package/build/composite/item.js.map +1 -0
  44. package/build/composite/legacy/index.js +2 -1
  45. package/build/composite/legacy/index.js.map +1 -1
  46. package/build/composite/row.js +33 -0
  47. package/build/composite/row.js.map +1 -0
  48. package/build/composite/store.js +54 -0
  49. package/build/composite/store.js.map +1 -0
  50. package/build/composite/typeahead.js +33 -0
  51. package/build/composite/typeahead.js.map +1 -0
  52. package/build/composite/types.js.map +1 -1
  53. package/build/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  54. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  55. package/build/custom-select-control-v2/styles.js +12 -14
  56. package/build/custom-select-control-v2/styles.js.map +1 -1
  57. package/build/date-time/date/styles.js +8 -8
  58. package/build/date-time/date/styles.js.map +1 -1
  59. package/build/date-time/time/time-input/index.js +17 -19
  60. package/build/date-time/time/time-input/index.js.map +1 -1
  61. package/build/dimension-control/index.js +6 -1
  62. package/build/dimension-control/index.js.map +1 -1
  63. package/build/draggable/index.js +4 -4
  64. package/build/draggable/index.js.map +1 -1
  65. package/build/dropdown-menu-v2/checkbox-item.js +69 -0
  66. package/build/dropdown-menu-v2/checkbox-item.js.map +1 -0
  67. package/build/dropdown-menu-v2/context.js +17 -0
  68. package/build/dropdown-menu-v2/context.js.map +1 -0
  69. package/build/dropdown-menu-v2/group-label.js +40 -0
  70. package/build/dropdown-menu-v2/group-label.js.map +1 -0
  71. package/build/dropdown-menu-v2/group.js +29 -0
  72. package/build/dropdown-menu-v2/group.js.map +1 -0
  73. package/build/dropdown-menu-v2/index.js +58 -146
  74. package/build/dropdown-menu-v2/index.js.map +1 -1
  75. package/build/dropdown-menu-v2/item-help-text.js +27 -0
  76. package/build/dropdown-menu-v2/item-help-text.js.map +1 -0
  77. package/build/dropdown-menu-v2/item-label.js +27 -0
  78. package/build/dropdown-menu-v2/item-label.js.map +1 -0
  79. package/build/dropdown-menu-v2/item.js +53 -0
  80. package/build/dropdown-menu-v2/item.js.map +1 -0
  81. package/build/dropdown-menu-v2/radio-item.js +79 -0
  82. package/build/dropdown-menu-v2/radio-item.js.map +1 -0
  83. package/build/dropdown-menu-v2/separator.js +30 -0
  84. package/build/dropdown-menu-v2/separator.js.map +1 -0
  85. package/build/dropdown-menu-v2/styles.js +54 -78
  86. package/build/dropdown-menu-v2/styles.js.map +1 -1
  87. package/build/dropdown-menu-v2/types.js.map +1 -1
  88. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js +27 -0
  89. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  90. package/build/focal-point-picker/styles/focal-point-style.js +7 -2
  91. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  92. package/build/form-token-field/types.js.map +1 -1
  93. package/build/index.js +6 -0
  94. package/build/index.js.map +1 -1
  95. package/build/input-control/index.js +2 -2
  96. package/build/input-control/index.js.map +1 -1
  97. package/build/input-control/input-base.js +5 -10
  98. package/build/input-control/input-base.js.map +1 -1
  99. package/build/input-control/input-prefix-wrapper.js +3 -3
  100. package/build/input-control/input-prefix-wrapper.js.map +1 -1
  101. package/build/input-control/input-suffix-wrapper.js +2 -3
  102. package/build/input-control/input-suffix-wrapper.js.map +1 -1
  103. package/build/input-control/reducer/reducer.js +8 -8
  104. package/build/input-control/reducer/reducer.js.map +1 -1
  105. package/build/input-control/styles/input-control-styles.js +75 -45
  106. package/build/input-control/styles/input-control-styles.js.map +1 -1
  107. package/build/input-control/types.js.map +1 -1
  108. package/build/input-control/utils.js +3 -3
  109. package/build/input-control/utils.js.map +1 -1
  110. package/build/item-group/styles.js +10 -10
  111. package/build/item-group/styles.js.map +1 -1
  112. package/build/modal/index.js +5 -5
  113. package/build/modal/index.js.map +1 -1
  114. package/build/navigation/index.js +4 -4
  115. package/build/navigation/index.js.map +1 -1
  116. package/build/navigation/styles/navigation-styles.js +13 -13
  117. package/build/navigation/styles/navigation-styles.js.map +1 -1
  118. package/build/navigator/index.js +12 -13
  119. package/build/navigator/index.js.map +1 -1
  120. package/build/navigator/navigator-back-button/hook.js +2 -2
  121. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  122. package/build/navigator/navigator-button/hook.js +2 -2
  123. package/build/navigator/navigator-button/hook.js.map +1 -1
  124. package/build/navigator/navigator-provider/component.js +99 -67
  125. package/build/navigator/navigator-provider/component.js.map +1 -1
  126. package/build/navigator/navigator-to-parent-button/component.js +2 -2
  127. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  128. package/build/navigator/types.js.map +1 -1
  129. package/build/navigator/use-navigator.js +1 -2
  130. package/build/navigator/use-navigator.js.map +1 -1
  131. package/build/palette-edit/index.js +2 -2
  132. package/build/palette-edit/index.js.map +1 -1
  133. package/build/private-apis.js +5 -9
  134. package/build/private-apis.js.map +1 -1
  135. package/build/range-control/styles/range-control-styles.js +30 -30
  136. package/build/range-control/styles/range-control-styles.js.map +1 -1
  137. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  138. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  139. package/build/select-control/styles/select-control-styles.js +12 -12
  140. package/build/select-control/styles/select-control-styles.js.map +1 -1
  141. package/build/slot-fill/bubbles-virtually/fill.js +4 -4
  142. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  143. package/build/snackbar/index.js +4 -4
  144. package/build/snackbar/index.js.map +1 -1
  145. package/build/tabs/index.js +4 -4
  146. package/build/tabs/index.js.map +1 -1
  147. package/build/tabs/styles.js +3 -3
  148. package/build/tabs/styles.js.map +1 -1
  149. package/build/toggle-group-control/toggle-group-control/utils.js +6 -6
  150. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  151. package/build/tools-panel/tools-panel/hook.js +6 -6
  152. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  153. package/build/unit-control/styles/unit-control-styles.js +7 -7
  154. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  155. package/build/utils/config-values.js +6 -4
  156. package/build/utils/config-values.js.map +1 -1
  157. package/build/utils/hooks/use-update-effect.js +4 -4
  158. package/build/utils/hooks/use-update-effect.js.map +1 -1
  159. package/build-module/alignment-matrix-control/cell.js +2 -5
  160. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  161. package/build-module/alignment-matrix-control/icon.js +31 -19
  162. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  163. package/build-module/alignment-matrix-control/index.js +55 -50
  164. package/build-module/alignment-matrix-control/index.js.map +1 -1
  165. package/build-module/alignment-matrix-control/styles.js +70 -0
  166. package/build-module/alignment-matrix-control/styles.js.map +1 -0
  167. package/build-module/alignment-matrix-control/types.js.map +1 -1
  168. package/build-module/angle-picker-control/angle-circle.js +9 -9
  169. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  170. package/build-module/border-control/border-control/component.js +18 -13
  171. package/build-module/border-control/border-control/component.js.map +1 -1
  172. package/build-module/circular-option-picker/circular-option-picker-option.js +16 -10
  173. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  174. package/build-module/circular-option-picker/circular-option-picker.js +16 -13
  175. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  176. package/build-module/circular-option-picker/types.js.map +1 -1
  177. package/build-module/clipboard-button/index.js +6 -6
  178. package/build-module/clipboard-button/index.js.map +1 -1
  179. package/build-module/color-palette/utils.js +1 -2
  180. package/build-module/color-palette/utils.js.map +1 -1
  181. package/build-module/color-picker/color-copy-button.js +8 -8
  182. package/build-module/color-picker/color-copy-button.js.map +1 -1
  183. package/build-module/color-picker/hex-input.js +7 -8
  184. package/build-module/color-picker/hex-input.js.map +1 -1
  185. package/build-module/color-picker/input-with-slider.js +7 -8
  186. package/build-module/color-picker/input-with-slider.js.map +1 -1
  187. package/build-module/color-picker/styles.js +8 -8
  188. package/build-module/color-picker/styles.js.map +1 -1
  189. package/build-module/combobox-control/types.js.map +1 -1
  190. package/build-module/composite/group-label.js +25 -0
  191. package/build-module/composite/group-label.js.map +1 -0
  192. package/build-module/composite/group.js +25 -0
  193. package/build-module/composite/group.js.map +1 -0
  194. package/build-module/composite/hover.js +25 -0
  195. package/build-module/composite/hover.js.map +1 -0
  196. package/build-module/composite/index.js +51 -96
  197. package/build-module/composite/index.js.map +1 -1
  198. package/build-module/composite/item.js +25 -0
  199. package/build-module/composite/item.js.map +1 -0
  200. package/build-module/composite/legacy/index.js +2 -1
  201. package/build-module/composite/legacy/index.js.map +1 -1
  202. package/build-module/composite/row.js +25 -0
  203. package/build-module/composite/row.js.map +1 -0
  204. package/build-module/composite/store.js +46 -0
  205. package/build-module/composite/store.js.map +1 -0
  206. package/build-module/composite/typeahead.js +25 -0
  207. package/build-module/composite/typeahead.js.map +1 -0
  208. package/build-module/composite/types.js.map +1 -1
  209. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  210. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  211. package/build-module/custom-select-control-v2/styles.js +12 -14
  212. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  213. package/build-module/date-time/date/styles.js +8 -8
  214. package/build-module/date-time/date/styles.js.map +1 -1
  215. package/build-module/date-time/time/time-input/index.js +17 -19
  216. package/build-module/date-time/time/time-input/index.js.map +1 -1
  217. package/build-module/dimension-control/index.js +6 -1
  218. package/build-module/dimension-control/index.js.map +1 -1
  219. package/build-module/draggable/index.js +4 -4
  220. package/build-module/draggable/index.js.map +1 -1
  221. package/build-module/dropdown-menu-v2/checkbox-item.js +62 -0
  222. package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -0
  223. package/build-module/dropdown-menu-v2/context.js +11 -0
  224. package/build-module/dropdown-menu-v2/context.js.map +1 -0
  225. package/build-module/dropdown-menu-v2/group-label.js +32 -0
  226. package/build-module/dropdown-menu-v2/group-label.js.map +1 -0
  227. package/build-module/dropdown-menu-v2/group.js +21 -0
  228. package/build-module/dropdown-menu-v2/group.js.map +1 -0
  229. package/build-module/dropdown-menu-v2/index.js +57 -144
  230. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  231. package/build-module/dropdown-menu-v2/item-help-text.js +19 -0
  232. package/build-module/dropdown-menu-v2/item-help-text.js.map +1 -0
  233. package/build-module/dropdown-menu-v2/item-label.js +19 -0
  234. package/build-module/dropdown-menu-v2/item-label.js.map +1 -0
  235. package/build-module/dropdown-menu-v2/item.js +46 -0
  236. package/build-module/dropdown-menu-v2/item.js.map +1 -0
  237. package/build-module/dropdown-menu-v2/radio-item.js +72 -0
  238. package/build-module/dropdown-menu-v2/radio-item.js.map +1 -0
  239. package/build-module/dropdown-menu-v2/separator.js +22 -0
  240. package/build-module/dropdown-menu-v2/separator.js.map +1 -0
  241. package/build-module/dropdown-menu-v2/styles.js +54 -78
  242. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  243. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  244. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js +20 -0
  245. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  246. package/build-module/focal-point-picker/styles/focal-point-style.js +6 -2
  247. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  248. package/build-module/form-token-field/types.js.map +1 -1
  249. package/build-module/index.js +2 -1
  250. package/build-module/index.js.map +1 -1
  251. package/build-module/input-control/index.js +2 -2
  252. package/build-module/input-control/index.js.map +1 -1
  253. package/build-module/input-control/input-base.js +6 -11
  254. package/build-module/input-control/input-base.js.map +1 -1
  255. package/build-module/input-control/input-prefix-wrapper.js +4 -3
  256. package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
  257. package/build-module/input-control/input-suffix-wrapper.js +3 -3
  258. package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
  259. package/build-module/input-control/reducer/reducer.js +8 -8
  260. package/build-module/input-control/reducer/reducer.js.map +1 -1
  261. package/build-module/input-control/styles/input-control-styles.js +74 -44
  262. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  263. package/build-module/input-control/types.js.map +1 -1
  264. package/build-module/input-control/utils.js +3 -3
  265. package/build-module/input-control/utils.js.map +1 -1
  266. package/build-module/item-group/styles.js +10 -10
  267. package/build-module/item-group/styles.js.map +1 -1
  268. package/build-module/modal/index.js +5 -5
  269. package/build-module/modal/index.js.map +1 -1
  270. package/build-module/navigation/index.js +4 -4
  271. package/build-module/navigation/index.js.map +1 -1
  272. package/build-module/navigation/styles/navigation-styles.js +14 -14
  273. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  274. package/build-module/navigator/index.js +6 -6
  275. package/build-module/navigator/index.js.map +1 -1
  276. package/build-module/navigator/navigator-back-button/hook.js +1 -1
  277. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  278. package/build-module/navigator/navigator-button/hook.js +1 -1
  279. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  280. package/build-module/navigator/navigator-provider/component.js +99 -67
  281. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  282. package/build-module/navigator/navigator-to-parent-button/component.js +1 -1
  283. package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
  284. package/build-module/navigator/types.js.map +1 -1
  285. package/build-module/navigator/use-navigator.js +1 -2
  286. package/build-module/navigator/use-navigator.js.map +1 -1
  287. package/build-module/palette-edit/index.js +2 -2
  288. package/build-module/palette-edit/index.js.map +1 -1
  289. package/build-module/private-apis.js +5 -9
  290. package/build-module/private-apis.js.map +1 -1
  291. package/build-module/range-control/styles/range-control-styles.js +31 -31
  292. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  293. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
  294. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  295. package/build-module/select-control/styles/select-control-styles.js +13 -13
  296. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  297. package/build-module/slot-fill/bubbles-virtually/fill.js +4 -4
  298. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  299. package/build-module/snackbar/index.js +4 -4
  300. package/build-module/snackbar/index.js.map +1 -1
  301. package/build-module/tabs/index.js +4 -4
  302. package/build-module/tabs/index.js.map +1 -1
  303. package/build-module/tabs/styles.js +4 -4
  304. package/build-module/tabs/styles.js.map +1 -1
  305. package/build-module/toggle-group-control/toggle-group-control/utils.js +6 -6
  306. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  307. package/build-module/tools-panel/tools-panel/hook.js +6 -6
  308. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  309. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  310. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  311. package/build-module/utils/config-values.js +6 -4
  312. package/build-module/utils/config-values.js.map +1 -1
  313. package/build-module/utils/hooks/use-update-effect.js +4 -4
  314. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  315. package/build-style/style-rtl.css +11 -23
  316. package/build-style/style.css +11 -23
  317. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  318. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  319. package/build-types/alignment-matrix-control/icon.d.ts +1 -1
  320. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  321. package/build-types/alignment-matrix-control/index.d.ts +16 -6
  322. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  323. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  324. package/build-types/alignment-matrix-control/{styles/alignment-matrix-control-styles.d.ts → styles.d.ts} +9 -10
  325. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -0
  326. package/build-types/alignment-matrix-control/types.d.ts +12 -1
  327. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  328. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  329. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  330. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  331. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  332. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  333. package/build-types/circular-option-picker/types.d.ts +2 -2
  334. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  335. package/build-types/color-palette/utils.d.ts.map +1 -1
  336. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  337. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  338. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  339. package/build-types/color-picker/styles.d.ts.map +1 -1
  340. package/build-types/combobox-control/types.d.ts +1 -0
  341. package/build-types/combobox-control/types.d.ts.map +1 -1
  342. package/build-types/composite/group-label.d.ts +3 -0
  343. package/build-types/composite/group-label.d.ts.map +1 -0
  344. package/build-types/composite/group.d.ts +3 -0
  345. package/build-types/composite/group.d.ts.map +1 -0
  346. package/build-types/composite/hover.d.ts +3 -0
  347. package/build-types/composite/hover.d.ts.map +1 -0
  348. package/build-types/composite/index.d.ts +30 -26
  349. package/build-types/composite/index.d.ts.map +1 -1
  350. package/build-types/composite/item.d.ts +3 -0
  351. package/build-types/composite/item.d.ts.map +1 -0
  352. package/build-types/composite/legacy/index.d.ts +1 -4
  353. package/build-types/composite/legacy/index.d.ts.map +1 -1
  354. package/build-types/composite/row.d.ts +3 -0
  355. package/build-types/composite/row.d.ts.map +1 -0
  356. package/build-types/composite/store.d.ts +25 -0
  357. package/build-types/composite/store.d.ts.map +1 -0
  358. package/build-types/composite/stories/index.story.d.ts +1 -0
  359. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  360. package/build-types/composite/typeahead.d.ts +3 -0
  361. package/build-types/composite/typeahead.d.ts.map +1 -0
  362. package/build-types/composite/types.d.ts +2 -2
  363. package/build-types/composite/types.d.ts.map +1 -1
  364. package/build-types/date-time/time/time-input/index.d.ts.map +1 -1
  365. package/build-types/dimension-control/index.d.ts +1 -1
  366. package/build-types/dimension-control/index.d.ts.map +1 -1
  367. package/build-types/dimension-control/stories/index.story.d.ts +5 -0
  368. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  369. package/build-types/dropdown-menu-v2/checkbox-item.d.ts +3 -0
  370. package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +1 -0
  371. package/build-types/dropdown-menu-v2/context.d.ts +6 -0
  372. package/build-types/dropdown-menu-v2/context.d.ts.map +1 -0
  373. package/build-types/dropdown-menu-v2/group-label.d.ts +3 -0
  374. package/build-types/dropdown-menu-v2/group-label.d.ts.map +1 -0
  375. package/build-types/dropdown-menu-v2/group.d.ts +3 -0
  376. package/build-types/dropdown-menu-v2/group.d.ts.map +1 -0
  377. package/build-types/dropdown-menu-v2/index.d.ts +39 -18
  378. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  379. package/build-types/dropdown-menu-v2/item-help-text.d.ts +6 -0
  380. package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +1 -0
  381. package/build-types/dropdown-menu-v2/item-label.d.ts +6 -0
  382. package/build-types/dropdown-menu-v2/item-label.d.ts.map +1 -0
  383. package/build-types/dropdown-menu-v2/item.d.ts +3 -0
  384. package/build-types/dropdown-menu-v2/item.d.ts.map +1 -0
  385. package/build-types/dropdown-menu-v2/radio-item.d.ts +3 -0
  386. package/build-types/dropdown-menu-v2/radio-item.d.ts.map +1 -0
  387. package/build-types/dropdown-menu-v2/separator.d.ts +3 -0
  388. package/build-types/dropdown-menu-v2/separator.d.ts.map +1 -0
  389. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +10 -10
  390. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  391. package/build-types/dropdown-menu-v2/styles.d.ts +14 -6
  392. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  393. package/build-types/dropdown-menu-v2/types.d.ts +6 -0
  394. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  395. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts +8 -0
  396. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +1 -0
  397. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
  398. package/build-types/form-token-field/types.d.ts +1 -0
  399. package/build-types/form-token-field/types.d.ts.map +1 -1
  400. package/build-types/index.d.ts +3 -1
  401. package/build-types/index.d.ts.map +1 -1
  402. package/build-types/input-control/input-base.d.ts.map +1 -1
  403. package/build-types/input-control/input-prefix-wrapper.d.ts +2 -2
  404. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
  405. package/build-types/input-control/input-suffix-wrapper.d.ts +2 -2
  406. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
  407. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  408. package/build-types/input-control/stories/index.story.d.ts +9 -0
  409. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  410. package/build-types/input-control/styles/input-control-styles.d.ts +15 -9
  411. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  412. package/build-types/input-control/types.d.ts +23 -6
  413. package/build-types/input-control/types.d.ts.map +1 -1
  414. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  415. package/build-types/navigator/index.d.ts +6 -6
  416. package/build-types/navigator/index.d.ts.map +1 -1
  417. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  418. package/build-types/navigator/stories/index.story.d.ts +1 -1
  419. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  420. package/build-types/navigator/types.d.ts +3 -1
  421. package/build-types/navigator/types.d.ts.map +1 -1
  422. package/build-types/navigator/use-navigator.d.ts +1 -2
  423. package/build-types/navigator/use-navigator.d.ts.map +1 -1
  424. package/build-types/private-apis.d.ts.map +1 -1
  425. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  426. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  427. package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
  428. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  429. package/build-types/tabs/index.d.ts.map +1 -1
  430. package/build-types/tabs/styles.d.ts.map +1 -1
  431. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  432. package/build-types/utils/config-values.d.ts +3 -3
  433. package/package.json +19 -19
  434. package/src/alignment-matrix-control/README.md +1 -5
  435. package/src/alignment-matrix-control/cell.tsx +3 -9
  436. package/src/alignment-matrix-control/icon.tsx +48 -30
  437. package/src/alignment-matrix-control/index.tsx +60 -50
  438. package/src/alignment-matrix-control/stories/index.story.tsx +3 -12
  439. package/src/alignment-matrix-control/styles.ts +113 -0
  440. package/src/alignment-matrix-control/types.ts +12 -1
  441. package/src/angle-picker-control/angle-circle.tsx +11 -9
  442. package/src/border-control/border-control/component.tsx +23 -16
  443. package/src/circular-option-picker/circular-option-picker-option.tsx +16 -19
  444. package/src/circular-option-picker/circular-option-picker.tsx +26 -12
  445. package/src/circular-option-picker/types.ts +2 -2
  446. package/src/clipboard-button/index.tsx +6 -6
  447. package/src/color-palette/test/utils.ts +21 -2
  448. package/src/color-palette/utils.ts +1 -3
  449. package/src/color-picker/color-copy-button.tsx +10 -8
  450. package/src/color-picker/hex-input.tsx +6 -10
  451. package/src/color-picker/input-with-slider.tsx +6 -10
  452. package/src/color-picker/styles.ts +1 -1
  453. package/src/combobox-control/types.ts +1 -0
  454. package/src/composite/group-label.tsx +30 -0
  455. package/src/composite/group.tsx +30 -0
  456. package/src/composite/hover.tsx +30 -0
  457. package/src/composite/index.tsx +61 -145
  458. package/src/composite/item.tsx +30 -0
  459. package/src/composite/legacy/index.tsx +2 -1
  460. package/src/composite/row.tsx +30 -0
  461. package/src/composite/store.ts +46 -0
  462. package/src/composite/stories/index.story.tsx +138 -265
  463. package/src/composite/typeahead.tsx +30 -0
  464. package/src/composite/types.ts +2 -2
  465. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +10 -10
  466. package/src/custom-gradient-picker/style.scss +2 -21
  467. package/src/custom-select-control-v2/styles.ts +4 -4
  468. package/src/date-time/date/styles.ts +2 -2
  469. package/src/date-time/time/test/index.tsx +3 -6
  470. package/src/date-time/time/time-input/index.tsx +25 -25
  471. package/src/date-time/time/time-input/test/index.tsx +6 -7
  472. package/src/dimension-control/README.md +4 -0
  473. package/src/dimension-control/index.tsx +7 -1
  474. package/src/dimension-control/stories/index.story.tsx +7 -2
  475. package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -16
  476. package/src/dimension-control/test/index.test.js +1 -0
  477. package/src/draggable/index.tsx +4 -4
  478. package/src/dropdown-menu-v2/README.md +73 -60
  479. package/src/dropdown-menu-v2/checkbox-item.tsx +63 -0
  480. package/src/dropdown-menu-v2/context.tsx +13 -0
  481. package/src/dropdown-menu-v2/group-label.tsx +37 -0
  482. package/src/dropdown-menu-v2/group.tsx +26 -0
  483. package/src/dropdown-menu-v2/index.tsx +57 -197
  484. package/src/dropdown-menu-v2/item-help-text.tsx +23 -0
  485. package/src/dropdown-menu-v2/item-label.tsx +23 -0
  486. package/src/dropdown-menu-v2/item.tsx +50 -0
  487. package/src/dropdown-menu-v2/radio-item.tsx +70 -0
  488. package/src/dropdown-menu-v2/separator.tsx +27 -0
  489. package/src/dropdown-menu-v2/stories/index.story.tsx +295 -262
  490. package/src/dropdown-menu-v2/styles.ts +102 -66
  491. package/src/dropdown-menu-v2/test/index.tsx +159 -132
  492. package/src/dropdown-menu-v2/types.ts +7 -0
  493. package/src/dropdown-menu-v2/use-temporary-focus-visible-fix.ts +22 -0
  494. package/src/focal-point-picker/styles/focal-point-style.ts +6 -1
  495. package/src/form-toggle/style.scss +1 -1
  496. package/src/form-token-field/style.scss +2 -3
  497. package/src/form-token-field/types.ts +1 -0
  498. package/src/index.ts +5 -1
  499. package/src/input-control/index.tsx +2 -2
  500. package/src/input-control/input-base.tsx +4 -14
  501. package/src/input-control/input-prefix-wrapper.tsx +8 -4
  502. package/src/input-control/input-suffix-wrapper.tsx +4 -6
  503. package/src/input-control/reducer/reducer.ts +13 -10
  504. package/src/input-control/stories/index.story.tsx +31 -12
  505. package/src/input-control/styles/input-control-styles.tsx +42 -11
  506. package/src/input-control/types.ts +23 -7
  507. package/src/input-control/utils.ts +3 -3
  508. package/src/item-group/styles.ts +3 -3
  509. package/src/item-group/test/__snapshots__/index.js.snap +3 -3
  510. package/src/modal/index.tsx +5 -5
  511. package/src/modal/style.scss +5 -4
  512. package/src/navigation/index.tsx +4 -4
  513. package/src/navigation/styles/navigation-styles.tsx +3 -3
  514. package/src/navigator/index.ts +6 -6
  515. package/src/navigator/navigator-back-button/hook.ts +1 -1
  516. package/src/navigator/navigator-button/hook.ts +1 -1
  517. package/src/navigator/navigator-provider/README.md +2 -3
  518. package/src/navigator/navigator-provider/component.tsx +97 -82
  519. package/src/navigator/navigator-to-parent-button/component.tsx +1 -1
  520. package/src/navigator/stories/index.story.tsx +82 -253
  521. package/src/navigator/types.ts +3 -1
  522. package/src/navigator/use-navigator.ts +1 -3
  523. package/src/palette-edit/index.tsx +2 -2
  524. package/src/private-apis.ts +5 -18
  525. package/src/range-control/styles/range-control-styles.ts +7 -7
  526. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -2
  527. package/src/resizable-box/style.scss +2 -2
  528. package/src/select-control/styles/select-control-styles.ts +5 -5
  529. package/src/slot-fill/bubbles-virtually/fill.tsx +4 -4
  530. package/src/snackbar/index.tsx +4 -4
  531. package/src/tab-panel/style.scss +0 -1
  532. package/src/tabs/index.tsx +8 -4
  533. package/src/tabs/styles.ts +2 -3
  534. package/src/text-control/style.scss +3 -2
  535. package/src/toggle-group-control/toggle-group-control/utils.ts +7 -7
  536. package/src/tools-panel/tools-panel/hook.ts +6 -6
  537. package/src/unit-control/styles/unit-control-styles.ts +2 -1
  538. package/src/utils/config-values.js +6 -4
  539. package/src/utils/hooks/use-update-effect.js +4 -4
  540. package/tsconfig.tsbuildinfo +1 -1
  541. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -66
  542. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  543. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -77
  544. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  545. package/build/navigator/navigator-back-button/index.js +0 -14
  546. package/build/navigator/navigator-back-button/index.js.map +0 -1
  547. package/build/navigator/navigator-button/index.js +0 -14
  548. package/build/navigator/navigator-button/index.js.map +0 -1
  549. package/build/navigator/navigator-provider/index.js +0 -14
  550. package/build/navigator/navigator-provider/index.js.map +0 -1
  551. package/build/navigator/navigator-screen/index.js +0 -14
  552. package/build/navigator/navigator-screen/index.js.map +0 -1
  553. package/build/navigator/navigator-to-parent-button/index.js +0 -14
  554. package/build/navigator/navigator-to-parent-button/index.js.map +0 -1
  555. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -63
  556. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  557. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -72
  558. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  559. package/build-module/navigator/navigator-back-button/index.js +0 -2
  560. package/build-module/navigator/navigator-back-button/index.js.map +0 -1
  561. package/build-module/navigator/navigator-button/index.js +0 -2
  562. package/build-module/navigator/navigator-button/index.js.map +0 -1
  563. package/build-module/navigator/navigator-provider/index.js +0 -2
  564. package/build-module/navigator/navigator-provider/index.js.map +0 -1
  565. package/build-module/navigator/navigator-screen/index.js +0 -2
  566. package/build-module/navigator/navigator-screen/index.js.map +0 -1
  567. package/build-module/navigator/navigator-to-parent-button/index.js +0 -2
  568. package/build-module/navigator/navigator-to-parent-button/index.js.map +0 -1
  569. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +0 -18
  570. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +0 -1
  571. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +0 -1
  572. package/build-types/navigator/navigator-back-button/index.d.ts +0 -2
  573. package/build-types/navigator/navigator-back-button/index.d.ts.map +0 -1
  574. package/build-types/navigator/navigator-button/index.d.ts +0 -2
  575. package/build-types/navigator/navigator-button/index.d.ts.map +0 -1
  576. package/build-types/navigator/navigator-provider/index.d.ts +0 -2
  577. package/build-types/navigator/navigator-provider/index.d.ts.map +0 -1
  578. package/build-types/navigator/navigator-screen/index.d.ts +0 -2
  579. package/build-types/navigator/navigator-screen/index.d.ts.map +0 -1
  580. package/build-types/navigator/navigator-to-parent-button/index.d.ts +0 -2
  581. package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +0 -1
  582. package/src/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.ts +0 -77
  583. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +0 -102
  584. package/src/navigator/navigator-back-button/index.ts +0 -1
  585. package/src/navigator/navigator-button/index.ts +0 -1
  586. package/src/navigator/navigator-provider/index.ts +0 -1
  587. package/src/navigator/navigator-screen/index.ts +0 -1
  588. package/src/navigator/navigator-to-parent-button/index.ts +0 -1
@@ -1,17 +1,20 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { Meta, StoryFn } from '@storybook/react';
4
+ import type { Meta, StoryFn, StoryContext } from '@storybook/react';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { isRTL } from '@wordpress/i18n';
10
+ import { useContext, useMemo } from '@wordpress/element';
10
11
 
11
12
  /**
12
13
  * Internal dependencies
13
14
  */
14
- import { Composite, useCompositeStore } from '..';
15
+ import { createSlotFill, Provider as SlotFillProvider } from '../../slot-fill';
16
+ import { Composite } from '..';
17
+ import { useCompositeStore } from '../store';
15
18
  import { UseCompositeStorePlaceholder, transform } from './utils';
16
19
 
17
20
  const meta: Meta< typeof UseCompositeStorePlaceholder > = {
@@ -34,20 +37,14 @@ const meta: Meta< typeof UseCompositeStorePlaceholder > = {
34
37
  'Composite.Typeahead': Composite.Typeahead,
35
38
  },
36
39
  argTypes: {
37
- activeId: { control: 'text' },
38
- defaultActiveId: { control: 'text' },
39
40
  setActiveId: { control: { type: null } },
40
41
  focusLoop: {
41
42
  control: 'select',
42
43
  options: [ true, false, 'horizontal', 'vertical', 'both' ],
43
44
  },
44
- focusShift: { control: 'boolean' },
45
- focusWrap: { control: 'boolean' },
46
- virtualFocus: { control: 'boolean' },
47
- rtl: { control: 'boolean' },
48
- orientation: {
45
+ focusWrap: {
49
46
  control: 'select',
50
- options: [ 'horizontal', 'vertical', 'both' ],
47
+ options: [ true, false, 'horizontal', 'vertical', 'both' ],
51
48
  },
52
49
  },
53
50
  tags: [ 'status-private' ],
@@ -56,261 +53,6 @@ const meta: Meta< typeof UseCompositeStorePlaceholder > = {
56
53
  docs: {
57
54
  canvas: { sourceState: 'shown' },
58
55
  source: { transform },
59
- extractArgTypes: ( component: React.FunctionComponent ) => {
60
- const commonArgTypes = {
61
- render: {
62
- name: 'render',
63
- description:
64
- 'Allows the component to be rendered as a different HTML element or React component. The value can be a React element or a function that takes in the original component props and gives back a React element with the props merged.',
65
- table: {
66
- type: {
67
- summary:
68
- 'RenderProp<React.HTMLAttributes<any> & { ref?: React.Ref<any> | undefined; }> | React.ReactElement<any, string | React.JSXElementConstructor<any>>',
69
- },
70
- },
71
- },
72
- children: {
73
- name: 'children',
74
- description: 'The contents of the component.',
75
- table: { type: { summary: 'React.ReactNode' } },
76
- },
77
- };
78
- const accessibleWhenDisabled = {
79
- name: 'accessibleWhenDisabled',
80
- description: `Indicates whether the element should be focusable even when it is
81
- \`disabled\`.
82
-
83
- This is important when discoverability is a concern. For example:
84
-
85
- > A toolbar in an editor contains a set of special smart paste functions
86
- > that are disabled when the clipboard is empty or when the function is not
87
- > applicable to the current content of the clipboard. It could be helpful to
88
- > keep the disabled buttons focusable if the ability to discover their
89
- > functionality is primarily via their presence on the toolbar.
90
-
91
- Learn more on [Focusability of disabled
92
- controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols).`,
93
- table: {
94
- type: {
95
- summary: 'boolean',
96
- },
97
- },
98
- };
99
-
100
- const argTypes = {
101
- useCompositeStore: {
102
- activeId: {
103
- name: 'activeId',
104
- description: `The current active item \`id\`. The active item is the element within the composite widget that has either DOM or virtual focus (in case the \`virtualFocus\` prop is enabled).
105
- - \`null\` represents the base composite element (the one with a [composite role](https://w3c.github.io/aria/#composite)). Users will be able to navigate out of it using arrow keys.
106
- - If \`activeId\` is initially set to \`null\`, the base composite element itself will have focus and users will be able to navigate to it using arrow keys.`,
107
- table: { type: { summary: 'string | null' } },
108
- },
109
- defaultActiveId: {
110
- name: 'defaultActiveId',
111
- description:
112
- 'The composite item id that should be active by default when the composite widget is rendered. If `null`, the composite element itself will have focus and users will be able to navigate to it using arrow keys. If `undefined`, the first enabled item will be focused.',
113
- table: { type: { summary: 'string | null' } },
114
- },
115
- setActiveId: {
116
- name: 'setActiveId',
117
- description:
118
- 'A callback that gets called when the `activeId` state changes.',
119
- table: {
120
- type: {
121
- summary:
122
- '((activeId: string | null | undefined) => void)',
123
- },
124
- },
125
- },
126
- focusLoop: {
127
- name: 'focusLoop',
128
- description: `On one-dimensional composite widgets:
129
-
130
- - \`true\` loops from the last item to the first item and vice-versa.
131
- - \`horizontal\` loops only if \`orientation\` is \`horizontal\` or not set.
132
- - \`vertical\` loops only if \`orientation\` is \`vertical\` or not set.
133
- - If \`activeId\` is initially set to \`null\`, the composite element will be focused in between the last and first items.
134
-
135
- On two-dimensional composite widgets (ie. when using \`CompositeRow\`):
136
-
137
- - \`true\` loops from the last row/column item to the first item in the same row/column and vice-versa. If it's the last item in the last row, it moves to the first item in the first row and vice-versa.
138
- - \`horizontal\` loops only from the last row item to the first item in the same row.
139
- - \`vertical\` loops only from the last column item to the first item in the column row.
140
- - If \`activeId\` is initially set to \`null\`, vertical loop will have no effect as moving down from the last row or up from the first row will focus on the composite element.
141
- - If \`focusWrap\` matches the value of \`focusLoop\`, it'll wrap between the last item in the last row or column and the first item in the first row or column and vice-versa.`,
142
- table: {
143
- defaultValue: {
144
- summary: 'false',
145
- },
146
- type: {
147
- summary:
148
- "boolean | 'horizontal' | 'vertical' | 'both'",
149
- },
150
- },
151
- },
152
- focusShift: {
153
- name: 'focusShift',
154
- description: `**Works only on two-dimensional composite widgets**.
155
-
156
- If enabled, moving up or down when there's no next item or when the next item is disabled will shift to the item right before it.`,
157
- table: {
158
- defaultValue: {
159
- summary: 'false',
160
- },
161
- type: {
162
- summary: 'boolean',
163
- },
164
- },
165
- },
166
- focusWrap: {
167
- name: 'focusWrap',
168
- description: `**Works only on two-dimensional composite widgets**.
169
-
170
- If enabled, moving to the next item from the last one in a row or column
171
- will focus on the first item in the next row or column and vice-versa.
172
-
173
- - \`true\` wraps between rows and columns.
174
- - \`horizontal\` wraps only between rows.
175
- - \`vertical\` wraps only between columns.
176
- - If \`focusLoop\` matches the value of \`focusWrap\`, it'll wrap between the
177
- last item in the last row or column and the first item in the first row or
178
- column and vice-versa.`,
179
- table: {
180
- defaultValue: {
181
- summary: 'false',
182
- },
183
- type: {
184
- summary: 'boolean',
185
- },
186
- },
187
- },
188
- virtualFocus: {
189
- name: 'virtualFocus',
190
- description: `If enabled, the composite element will act as an [\`aria-activedescendant\`](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_focus_activedescendant)
191
- container instead of [roving tabindex](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_roving_tabindex). DOM focus will remain on the composite element while its items receive
192
- virtual focus.
193
-
194
- In both scenarios, the item in focus will carry the \`data-active-item\` attribute.`,
195
- table: {
196
- defaultValue: {
197
- summary: 'false',
198
- },
199
- type: {
200
- summary: 'boolean',
201
- },
202
- },
203
- },
204
- orientation: {
205
- name: 'orientation',
206
- description: `Defines the orientation of the composite widget. If the composite has a single row or column (one-dimensional), the \`orientation\` value determines which arrow keys can be used to move focus:
207
-
208
- - \`both\`: all arrow keys work.
209
- - \`horizontal\`: only left and right arrow keys work.
210
- - \`vertical\`: only up and down arrow keys work.
211
-
212
- It doesn't have any effect on two-dimensional composites.`,
213
- table: {
214
- defaultValue: {
215
- summary: "'both'",
216
- },
217
- type: {
218
- summary:
219
- "'horizontal' | 'vertical' | 'both'",
220
- },
221
- },
222
- },
223
- rtl: {
224
- name: 'rtl',
225
- description: `Determines how the \`store\`'s \`next\` and \`previous\` functions will behave. If \`rtl\` is set to \`true\`, they will be inverted.
226
-
227
- This only affects the composite widget behavior. You still need to set \`dir="rtl"\` on HTML/CSS.`,
228
- table: {
229
- defaultValue: {
230
- summary: 'false',
231
- },
232
- type: {
233
- summary: 'boolean',
234
- },
235
- },
236
- },
237
- },
238
- Composite: {
239
- ...commonArgTypes,
240
- store: {
241
- name: 'store',
242
- description:
243
- 'Object returned by the `useCompositeStore` hook.',
244
- table: {
245
- type: {
246
- summary:
247
- 'CompositeStore<CompositeStoreItem>',
248
- },
249
- },
250
- type: { required: true },
251
- },
252
- focusable: {
253
- name: 'focusable',
254
- description: `Makes the component a focusable element. When this element gains keyboard focus, it gets a \`data-focus-visible\` attribute and triggers the \`onFocusVisible\` prop.
255
-
256
- The component supports the \`disabled\` prop even for those elements not supporting the native \`disabled\` attribute. Disabled elements may be still accessible via keyboard by using the the \`accessibleWhenDisabled\` prop.
257
-
258
- Non-native focusable elements will lose their focusability entirely. However, native focusable elements will retain their inherent focusability.`,
259
- table: {
260
- type: {
261
- summary: 'boolean',
262
- },
263
- },
264
- },
265
- disabled: {
266
- name: 'disabled',
267
- description: `Determines if the element is disabled. This sets the \`aria-disabled\` attribute accordingly, enabling support for all elements, including those that don't support the native \`disabled\` attribute.
268
-
269
- This feature can be combined with the \`accessibleWhenDisabled\` prop to
270
- make disabled elements still accessible via keyboard.
271
-
272
- **Note**: For this prop to work, the \`focusable\` prop must be set to
273
- \`true\`, if it's not set by default.`,
274
- table: {
275
- defaultValue: {
276
- summary: 'false',
277
- },
278
- type: {
279
- summary: 'boolean',
280
- },
281
- },
282
- },
283
- accessibleWhenDisabled,
284
- onFocusVisible: {
285
- name: 'onFocusVisible',
286
- description: `Custom event handler invoked when the element gains focus through keyboard interaction or a key press occurs while the element is in focus. This is the programmatic equivalent of the \`data-focus-visible\` attribute.
287
-
288
- **Note**: For this prop to work, the \`focusable\` prop must be set to \`true\` if it's not set by default.`,
289
- table: {
290
- type: {
291
- summary:
292
- '(event: SyntheticEvent<HTMLElement>) => void',
293
- },
294
- },
295
- },
296
- },
297
- 'Composite.Group': commonArgTypes,
298
- 'Composite.GroupLabel': commonArgTypes,
299
- 'Composite.Row': commonArgTypes,
300
- 'Composite.Item': {
301
- ...commonArgTypes,
302
- accessibleWhenDisabled,
303
- },
304
- 'Composite.Hover': commonArgTypes,
305
- 'Composite.Typeahead': commonArgTypes,
306
- };
307
-
308
- const name = component.displayName ?? '';
309
-
310
- return name in argTypes
311
- ? argTypes[ name as keyof typeof argTypes ]
312
- : {};
313
- },
314
56
  },
315
57
  },
316
58
  decorators: [
@@ -464,3 +206,134 @@ Typeahead.parameters = {
464
206
  },
465
207
  },
466
208
  };
209
+
210
+ const ExampleSlotFill = createSlotFill( 'Example' );
211
+
212
+ const Slot = () => {
213
+ const compositeContext = useContext( Composite.Context );
214
+
215
+ // Forward the Slot's composite context to the Fill via fillProps, so that
216
+ // Composite components rendered inside the Fill can work as expected.
217
+ const fillProps = useMemo(
218
+ () => ( {
219
+ forwardedContext: [
220
+ [ Composite.Context.Provider, { value: compositeContext } ],
221
+ ],
222
+ } ),
223
+ [ compositeContext ]
224
+ );
225
+
226
+ return (
227
+ <ExampleSlotFill.Slot
228
+ fillProps={ fillProps }
229
+ bubblesVirtually
230
+ style={ { display: 'contents' } }
231
+ />
232
+ );
233
+ };
234
+
235
+ type ForwardedContextTuple< P = {} > = [
236
+ React.ComponentType< React.PropsWithChildren< P > >,
237
+ P,
238
+ ];
239
+
240
+ const Fill = ( { children }: { children: React.ReactNode } ) => {
241
+ const innerMarkup = <>{ children }</>;
242
+
243
+ return (
244
+ <ExampleSlotFill.Fill>
245
+ { ( fillProps: { forwardedContext?: ForwardedContextTuple[] } ) => {
246
+ const { forwardedContext = [] } = fillProps;
247
+
248
+ // Render all context providers forwarded by the Slot via fillProps.
249
+ return forwardedContext.reduce(
250
+ ( inner: JSX.Element, [ Provider, props ] ) => (
251
+ <Provider { ...props }>{ inner }</Provider>
252
+ ),
253
+ innerMarkup
254
+ );
255
+ } }
256
+ </ExampleSlotFill.Fill>
257
+ );
258
+ };
259
+
260
+ export const WithSlotFill: StoryFn< typeof UseCompositeStorePlaceholder > = (
261
+ props
262
+ ) => {
263
+ return (
264
+ <SlotFillProvider>
265
+ <Composite { ...props }>
266
+ <Composite.Item>Item one (direct child)</Composite.Item>
267
+ <Slot />
268
+ <Composite.Item>Item four (direct child)</Composite.Item>
269
+ </Composite>
270
+
271
+ <Fill>
272
+ <Composite.Item>Item two (from slot fill)</Composite.Item>
273
+ <Composite.Item>Item three (from slot fill)</Composite.Item>
274
+ </Fill>
275
+ </SlotFillProvider>
276
+ );
277
+ };
278
+ WithSlotFill.args = {
279
+ ...Default.args,
280
+ };
281
+ WithSlotFill.parameters = {
282
+ docs: {
283
+ description: {
284
+ story: 'When rendering Composite components across a SlotFill, the Composite.Context should be manually forwarded from the Slot to the Fill component.',
285
+ },
286
+ source: {
287
+ transform: ( code: string, storyContext: StoryContext ) => {
288
+ return `const ExampleSlotFill = createSlotFill( 'Example' );
289
+
290
+ const Slot = () => {
291
+ const compositeContext = useContext( Composite.Context );
292
+
293
+ // Forward the Slot's composite context to the Fill via fillProps, so that
294
+ // Composite components rendered inside the Fill can work as expected.
295
+ const fillProps = useMemo(
296
+ () => ( {
297
+ forwardedContext: [
298
+ [ Composite.Context.Provider, { value: compositeContext } ],
299
+ ],
300
+ } ),
301
+ [ compositeContext ]
302
+ );
303
+
304
+ return (
305
+ <ExampleSlotFill.Slot
306
+ fillProps={ fillProps }
307
+ bubblesVirtually
308
+ style={ { display: 'contents' } }
309
+ />
310
+ );
311
+ };
312
+
313
+ const Fill = ( { children } ) => {
314
+ const innerMarkup = <>{ children }</>;
315
+
316
+ return (
317
+ <ExampleSlotFill.Fill>
318
+ { ( fillProps ) => {
319
+ const { forwardedContext = [] } = fillProps;
320
+
321
+ // Render all context providers forwarded by the Slot via fillProps.
322
+ return forwardedContext.reduce(
323
+ ( inner, [ Provider, props ] ) => (
324
+ <Provider { ...props }>{ inner }</Provider>
325
+ ),
326
+ innerMarkup
327
+ );
328
+ } }
329
+ </ExampleSlotFill.Fill>
330
+ );
331
+ };
332
+
333
+ // In a separate component:
334
+
335
+ ${ transform( code, storyContext ) }`;
336
+ },
337
+ },
338
+ },
339
+ };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import * as Ariakit from '@ariakit/react';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { forwardRef } from '@wordpress/element';
10
+
11
+ /**
12
+ * Internal dependencies
13
+ */
14
+ import type { WordPressComponentProps } from '../context';
15
+ import { useCompositeContext } from './context';
16
+ import type { CompositeTypeaheadProps } from './types';
17
+
18
+ export const CompositeTypeahead = forwardRef<
19
+ HTMLDivElement,
20
+ WordPressComponentProps< CompositeTypeaheadProps, 'div', false >
21
+ >( function CompositeTypeahead( props, ref ) {
22
+ const context = useCompositeContext();
23
+ return (
24
+ <Ariakit.CompositeTypeahead
25
+ store={ context?.store }
26
+ { ...props }
27
+ ref={ ref }
28
+ />
29
+ );
30
+ } );
@@ -128,11 +128,11 @@ export type CompositeStoreProps = {
128
128
  rtl?: Ariakit.CompositeStoreProps[ 'rtl' ];
129
129
  };
130
130
 
131
- export type CompositeProps = {
131
+ export type CompositeProps = CompositeStoreProps & {
132
132
  /**
133
133
  * Object returned by the `useCompositeStore` hook.
134
134
  */
135
- store: Ariakit.CompositeStore;
135
+ store?: Ariakit.CompositeStore;
136
136
  /**
137
137
  * Allows the component to be rendered as a different HTML element or React
138
138
  * component. The value can be a React element or a function that takes in the
@@ -128,11 +128,11 @@ function ControlPoints( {
128
128
  onStopControlPointChange,
129
129
  __experimentalIsRenderedInSidebar,
130
130
  }: ControlPointsProps ) {
131
- const controlPointMoveState = useRef< ControlPointMoveState >();
131
+ const controlPointMoveStateRef = useRef< ControlPointMoveState >();
132
132
 
133
133
  const onMouseMove = ( event: MouseEvent ) => {
134
134
  if (
135
- controlPointMoveState.current === undefined ||
135
+ controlPointMoveStateRef.current === undefined ||
136
136
  gradientPickerDomRef.current === null
137
137
  ) {
138
138
  return;
@@ -144,14 +144,14 @@ function ControlPoints( {
144
144
  );
145
145
 
146
146
  const { initialPosition, index, significantMoveHappened } =
147
- controlPointMoveState.current;
147
+ controlPointMoveStateRef.current;
148
148
 
149
149
  if (
150
150
  ! significantMoveHappened &&
151
151
  Math.abs( initialPosition - relativePosition ) >=
152
152
  MINIMUM_SIGNIFICANT_MOVE
153
153
  ) {
154
- controlPointMoveState.current.significantMoveHappened = true;
154
+ controlPointMoveStateRef.current.significantMoveHappened = true;
155
155
  }
156
156
 
157
157
  onChange(
@@ -163,13 +163,13 @@ function ControlPoints( {
163
163
  if (
164
164
  window &&
165
165
  window.removeEventListener &&
166
- controlPointMoveState.current &&
167
- controlPointMoveState.current.listenersActivated
166
+ controlPointMoveStateRef.current &&
167
+ controlPointMoveStateRef.current.listenersActivated
168
168
  ) {
169
169
  window.removeEventListener( 'mousemove', onMouseMove );
170
170
  window.removeEventListener( 'mouseup', cleanEventListeners );
171
171
  onStopControlPointChange();
172
- controlPointMoveState.current.listenersActivated = false;
172
+ controlPointMoveStateRef.current.listenersActivated = false;
173
173
  }
174
174
  };
175
175
 
@@ -202,8 +202,8 @@ function ControlPoints( {
202
202
  key={ index }
203
203
  onClick={ () => {
204
204
  if (
205
- controlPointMoveState.current &&
206
- controlPointMoveState.current
205
+ controlPointMoveStateRef.current &&
206
+ controlPointMoveStateRef.current
207
207
  .significantMoveHappened
208
208
  ) {
209
209
  return;
@@ -220,7 +220,7 @@ function ControlPoints( {
220
220
  window &&
221
221
  window.addEventListener
222
222
  ) {
223
- controlPointMoveState.current = {
223
+ controlPointMoveStateRef.current = {
224
224
  initialPosition,
225
225
  index,
226
226
  significantMoveHappened: false,
@@ -48,7 +48,7 @@ $components-custom-gradient-picker__padding: $grid-unit-20; // 48px container, 1
48
48
  height: inherit;
49
49
  width: inherit;
50
50
  min-width: $grid-unit-20;
51
- border-radius: 50%;
51
+ border-radius: $radius-round;
52
52
 
53
53
  background: $white;
54
54
  padding: 2px;
@@ -65,7 +65,7 @@ $components-custom-gradient-picker__padding: $grid-unit-20; // 48px container, 1
65
65
  // Same size as the .components-custom-gradient-picker__control-point-dropdown parent
66
66
  height: inherit;
67
67
  width: inherit;
68
- border-radius: 50%;
68
+ border-radius: $radius-round;
69
69
  padding: 0;
70
70
 
71
71
  // Shadow and stroke.
@@ -100,25 +100,6 @@ $components-custom-gradient-picker__padding: $grid-unit-20; // 48px container, 1
100
100
  height: 20px;
101
101
  }
102
102
 
103
- .components-custom-gradient-picker .components-custom-gradient-picker__toolbar {
104
- border: none;
105
-
106
- // Work-around to target the inner button containers rendered by <ToolbarGroup />
107
- > div + div {
108
- margin-left: 1px;
109
- }
110
-
111
- button {
112
- &.is-pressed {
113
- > svg {
114
- background: $white;
115
- border: $border-width solid $gray-600;
116
- border-radius: 2px;
117
- }
118
- }
119
- }
120
- }
121
-
122
103
  .components-custom-gradient-picker__ui-line {
123
104
  position: relative;
124
105
  z-index: 0;
@@ -21,9 +21,9 @@ const ANIMATION_PARAMS = {
21
21
  };
22
22
 
23
23
  const INLINE_PADDING = {
24
- compact: 8, // space(2)
25
- small: 8, // space(2)
26
- default: 16, // space(4)
24
+ compact: CONFIG.controlPaddingXSmall,
25
+ small: CONFIG.controlPaddingXSmall,
26
+ default: CONFIG.controlPaddingX,
27
27
  };
28
28
 
29
29
  const getSelectSize = (
@@ -118,7 +118,7 @@ export const SelectPopover = styled( Ariakit.SelectPopover )`
118
118
  flex-direction: column;
119
119
 
120
120
  background-color: ${ COLORS.theme.background };
121
- border-radius: 2px;
121
+ border-radius: ${ CONFIG.radiusSmall };
122
122
  border: 1px solid ${ COLORS.theme.foreground };
123
123
 
124
124
  /* z-index(".components-popover") */
@@ -83,7 +83,7 @@ export const DayButton = styled( Button, {
83
83
  ` }
84
84
 
85
85
  &&& {
86
- border-radius: 100%;
86
+ border-radius: ${ CONFIG.radiusRound };
87
87
  height: ${ space( 7 ) };
88
88
  width: ${ space( 7 ) };
89
89
 
@@ -107,7 +107,7 @@ export const DayButton = styled( Button, {
107
107
  `
108
108
  ::before {
109
109
  background: ${ props.isSelected ? COLORS.white : COLORS.theme.accent };
110
- border-radius: 2px;
110
+ border-radius: ${ CONFIG.radiusRound };
111
111
  bottom: 2px;
112
112
  content: " ";
113
113
  height: 4px;
@@ -281,12 +281,9 @@ describe( 'TimePicker', () => {
281
281
  expect(
282
282
  ( screen.getByLabelText( 'Minutes' ) as HTMLInputElement ).value
283
283
  ).toBe( '00' );
284
- /**
285
- * This is not ideal, but best of we can do for now until we refactor
286
- * AM/PM into accessible elements, like radio buttons.
287
- */
288
- expect( screen.getByText( 'AM' ) ).not.toHaveClass( 'is-primary' );
289
- expect( screen.getByText( 'PM' ) ).toHaveClass( 'is-primary' );
284
+
285
+ expect( screen.getByRole( 'radio', { name: 'AM' } ) ).not.toBeChecked();
286
+ expect( screen.getByRole( 'radio', { name: 'PM' } ) ).toBeChecked();
290
287
  } );
291
288
 
292
289
  it( 'should have different layouts/orders for 12/24 hour formats', () => {