@wordpress/components 28.6.0 → 28.8.1-next.5368f64a9.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 (644) hide show
  1. package/CHANGELOG.md +107 -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/context.js +1 -1
  35. package/build/composite/context.js.map +1 -1
  36. package/build/composite/group-label.js +33 -0
  37. package/build/composite/group-label.js.map +1 -0
  38. package/build/composite/group.js +33 -0
  39. package/build/composite/group.js.map +1 -0
  40. package/build/composite/hover.js +33 -0
  41. package/build/composite/hover.js.map +1 -0
  42. package/build/composite/index.js +63 -118
  43. package/build/composite/index.js.map +1 -1
  44. package/build/composite/item.js +33 -0
  45. package/build/composite/item.js.map +1 -0
  46. package/build/composite/legacy/index.js +59 -7
  47. package/build/composite/legacy/index.js.map +1 -1
  48. package/build/composite/row.js +33 -0
  49. package/build/composite/row.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/index.js +1 -1
  58. package/build/date-time/date/index.js.map +1 -1
  59. package/build/date-time/date/styles.js +37 -26
  60. package/build/date-time/date/styles.js.map +1 -1
  61. package/build/date-time/date/use-lilius/index.js +163 -0
  62. package/build/date-time/date/use-lilius/index.js.map +1 -0
  63. package/build/date-time/time/time-input/index.js +17 -19
  64. package/build/date-time/time/time-input/index.js.map +1 -1
  65. package/build/dimension-control/index.js +6 -1
  66. package/build/dimension-control/index.js.map +1 -1
  67. package/build/draggable/index.js +4 -4
  68. package/build/draggable/index.js.map +1 -1
  69. package/build/dropdown-menu-v2/checkbox-item.js +69 -0
  70. package/build/dropdown-menu-v2/checkbox-item.js.map +1 -0
  71. package/build/dropdown-menu-v2/context.js +17 -0
  72. package/build/dropdown-menu-v2/context.js.map +1 -0
  73. package/build/dropdown-menu-v2/group-label.js +40 -0
  74. package/build/dropdown-menu-v2/group-label.js.map +1 -0
  75. package/build/dropdown-menu-v2/group.js +29 -0
  76. package/build/dropdown-menu-v2/group.js.map +1 -0
  77. package/build/dropdown-menu-v2/index.js +58 -146
  78. package/build/dropdown-menu-v2/index.js.map +1 -1
  79. package/build/dropdown-menu-v2/item-help-text.js +27 -0
  80. package/build/dropdown-menu-v2/item-help-text.js.map +1 -0
  81. package/build/dropdown-menu-v2/item-label.js +27 -0
  82. package/build/dropdown-menu-v2/item-label.js.map +1 -0
  83. package/build/dropdown-menu-v2/item.js +53 -0
  84. package/build/dropdown-menu-v2/item.js.map +1 -0
  85. package/build/dropdown-menu-v2/radio-item.js +79 -0
  86. package/build/dropdown-menu-v2/radio-item.js.map +1 -0
  87. package/build/dropdown-menu-v2/separator.js +30 -0
  88. package/build/dropdown-menu-v2/separator.js.map +1 -0
  89. package/build/dropdown-menu-v2/styles.js +54 -78
  90. package/build/dropdown-menu-v2/styles.js.map +1 -1
  91. package/build/dropdown-menu-v2/types.js.map +1 -1
  92. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js +27 -0
  93. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  94. package/build/focal-point-picker/styles/focal-point-style.js +7 -2
  95. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  96. package/build/form-token-field/types.js.map +1 -1
  97. package/build/index.js +13 -0
  98. package/build/index.js.map +1 -1
  99. package/build/input-control/index.js +2 -2
  100. package/build/input-control/index.js.map +1 -1
  101. package/build/input-control/input-base.js +5 -10
  102. package/build/input-control/input-base.js.map +1 -1
  103. package/build/input-control/input-prefix-wrapper.js +3 -3
  104. package/build/input-control/input-prefix-wrapper.js.map +1 -1
  105. package/build/input-control/input-suffix-wrapper.js +2 -3
  106. package/build/input-control/input-suffix-wrapper.js.map +1 -1
  107. package/build/input-control/reducer/reducer.js +8 -8
  108. package/build/input-control/reducer/reducer.js.map +1 -1
  109. package/build/input-control/styles/input-control-styles.js +75 -45
  110. package/build/input-control/styles/input-control-styles.js.map +1 -1
  111. package/build/input-control/types.js.map +1 -1
  112. package/build/input-control/utils.js +3 -3
  113. package/build/input-control/utils.js.map +1 -1
  114. package/build/item-group/styles.js +10 -10
  115. package/build/item-group/styles.js.map +1 -1
  116. package/build/modal/index.js +16 -9
  117. package/build/modal/index.js.map +1 -1
  118. package/build/navigation/index.js +4 -4
  119. package/build/navigation/index.js.map +1 -1
  120. package/build/navigation/styles/navigation-styles.js +13 -13
  121. package/build/navigation/styles/navigation-styles.js.map +1 -1
  122. package/build/navigator/index.js +12 -13
  123. package/build/navigator/index.js.map +1 -1
  124. package/build/navigator/navigator-back-button/hook.js +2 -2
  125. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  126. package/build/navigator/navigator-button/hook.js +2 -2
  127. package/build/navigator/navigator-button/hook.js.map +1 -1
  128. package/build/navigator/navigator-provider/component.js +99 -67
  129. package/build/navigator/navigator-provider/component.js.map +1 -1
  130. package/build/navigator/navigator-screen/component.js +5 -0
  131. package/build/navigator/navigator-screen/component.js.map +1 -1
  132. package/build/navigator/navigator-to-parent-button/component.js +2 -2
  133. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  134. package/build/navigator/types.js.map +1 -1
  135. package/build/navigator/use-navigator.js +1 -2
  136. package/build/navigator/use-navigator.js.map +1 -1
  137. package/build/palette-edit/index.js +2 -2
  138. package/build/palette-edit/index.js.map +1 -1
  139. package/build/private-apis.js +1 -14
  140. package/build/private-apis.js.map +1 -1
  141. package/build/range-control/styles/range-control-styles.js +30 -30
  142. package/build/range-control/styles/range-control-styles.js.map +1 -1
  143. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  144. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  145. package/build/select-control/styles/select-control-styles.js +12 -12
  146. package/build/select-control/styles/select-control-styles.js.map +1 -1
  147. package/build/slot-fill/bubbles-virtually/fill.js +4 -4
  148. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  149. package/build/slot-fill/index.js +1 -0
  150. package/build/slot-fill/index.js.map +1 -1
  151. package/build/snackbar/index.js +4 -4
  152. package/build/snackbar/index.js.map +1 -1
  153. package/build/tabs/index.js +4 -4
  154. package/build/tabs/index.js.map +1 -1
  155. package/build/tabs/styles.js +3 -3
  156. package/build/tabs/styles.js.map +1 -1
  157. package/build/tabs/tablist.js +5 -4
  158. package/build/tabs/tablist.js.map +1 -1
  159. package/build/toggle-group-control/toggle-group-control/utils.js +6 -6
  160. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  161. package/build/tools-panel/tools-panel/hook.js +6 -6
  162. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  163. package/build/unit-control/styles/unit-control-styles.js +7 -7
  164. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  165. package/build/utils/config-values.js +6 -4
  166. package/build/utils/config-values.js.map +1 -1
  167. package/build/utils/element-rect.js +73 -105
  168. package/build/utils/element-rect.js.map +1 -1
  169. package/build/utils/hooks/use-update-effect.js +4 -4
  170. package/build/utils/hooks/use-update-effect.js.map +1 -1
  171. package/build-module/alignment-matrix-control/cell.js +2 -5
  172. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  173. package/build-module/alignment-matrix-control/icon.js +31 -19
  174. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  175. package/build-module/alignment-matrix-control/index.js +55 -50
  176. package/build-module/alignment-matrix-control/index.js.map +1 -1
  177. package/build-module/alignment-matrix-control/styles.js +70 -0
  178. package/build-module/alignment-matrix-control/styles.js.map +1 -0
  179. package/build-module/alignment-matrix-control/types.js.map +1 -1
  180. package/build-module/angle-picker-control/angle-circle.js +9 -9
  181. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  182. package/build-module/border-control/border-control/component.js +18 -13
  183. package/build-module/border-control/border-control/component.js.map +1 -1
  184. package/build-module/circular-option-picker/circular-option-picker-option.js +16 -10
  185. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  186. package/build-module/circular-option-picker/circular-option-picker.js +16 -13
  187. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  188. package/build-module/circular-option-picker/types.js.map +1 -1
  189. package/build-module/clipboard-button/index.js +6 -6
  190. package/build-module/clipboard-button/index.js.map +1 -1
  191. package/build-module/color-palette/utils.js +1 -2
  192. package/build-module/color-palette/utils.js.map +1 -1
  193. package/build-module/color-picker/color-copy-button.js +8 -8
  194. package/build-module/color-picker/color-copy-button.js.map +1 -1
  195. package/build-module/color-picker/hex-input.js +7 -8
  196. package/build-module/color-picker/hex-input.js.map +1 -1
  197. package/build-module/color-picker/input-with-slider.js +7 -8
  198. package/build-module/color-picker/input-with-slider.js.map +1 -1
  199. package/build-module/color-picker/styles.js +8 -8
  200. package/build-module/color-picker/styles.js.map +1 -1
  201. package/build-module/combobox-control/types.js.map +1 -1
  202. package/build-module/composite/context.js +1 -1
  203. package/build-module/composite/context.js.map +1 -1
  204. package/build-module/composite/group-label.js +25 -0
  205. package/build-module/composite/group-label.js.map +1 -0
  206. package/build-module/composite/group.js +25 -0
  207. package/build-module/composite/group.js.map +1 -0
  208. package/build-module/composite/hover.js +25 -0
  209. package/build-module/composite/hover.js.map +1 -0
  210. package/build-module/composite/index.js +64 -118
  211. package/build-module/composite/index.js.map +1 -1
  212. package/build-module/composite/item.js +25 -0
  213. package/build-module/composite/item.js.map +1 -0
  214. package/build-module/composite/legacy/index.js +57 -8
  215. package/build-module/composite/legacy/index.js.map +1 -1
  216. package/build-module/composite/row.js +25 -0
  217. package/build-module/composite/row.js.map +1 -0
  218. package/build-module/composite/typeahead.js +25 -0
  219. package/build-module/composite/typeahead.js.map +1 -0
  220. package/build-module/composite/types.js.map +1 -1
  221. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  222. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  223. package/build-module/custom-select-control-v2/styles.js +12 -14
  224. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  225. package/build-module/date-time/date/index.js +1 -2
  226. package/build-module/date-time/date/index.js.map +1 -1
  227. package/build-module/date-time/date/styles.js +33 -26
  228. package/build-module/date-time/date/styles.js.map +1 -1
  229. package/build-module/date-time/date/use-lilius/index.js +158 -0
  230. package/build-module/date-time/date/use-lilius/index.js.map +1 -0
  231. package/build-module/date-time/time/time-input/index.js +17 -19
  232. package/build-module/date-time/time/time-input/index.js.map +1 -1
  233. package/build-module/dimension-control/index.js +6 -1
  234. package/build-module/dimension-control/index.js.map +1 -1
  235. package/build-module/draggable/index.js +4 -4
  236. package/build-module/draggable/index.js.map +1 -1
  237. package/build-module/dropdown-menu-v2/checkbox-item.js +62 -0
  238. package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -0
  239. package/build-module/dropdown-menu-v2/context.js +11 -0
  240. package/build-module/dropdown-menu-v2/context.js.map +1 -0
  241. package/build-module/dropdown-menu-v2/group-label.js +32 -0
  242. package/build-module/dropdown-menu-v2/group-label.js.map +1 -0
  243. package/build-module/dropdown-menu-v2/group.js +21 -0
  244. package/build-module/dropdown-menu-v2/group.js.map +1 -0
  245. package/build-module/dropdown-menu-v2/index.js +57 -144
  246. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  247. package/build-module/dropdown-menu-v2/item-help-text.js +19 -0
  248. package/build-module/dropdown-menu-v2/item-help-text.js.map +1 -0
  249. package/build-module/dropdown-menu-v2/item-label.js +19 -0
  250. package/build-module/dropdown-menu-v2/item-label.js.map +1 -0
  251. package/build-module/dropdown-menu-v2/item.js +46 -0
  252. package/build-module/dropdown-menu-v2/item.js.map +1 -0
  253. package/build-module/dropdown-menu-v2/radio-item.js +72 -0
  254. package/build-module/dropdown-menu-v2/radio-item.js.map +1 -0
  255. package/build-module/dropdown-menu-v2/separator.js +22 -0
  256. package/build-module/dropdown-menu-v2/separator.js.map +1 -0
  257. package/build-module/dropdown-menu-v2/styles.js +54 -78
  258. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  259. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  260. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js +20 -0
  261. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  262. package/build-module/focal-point-picker/styles/focal-point-style.js +6 -2
  263. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  264. package/build-module/form-token-field/types.js.map +1 -1
  265. package/build-module/index.js +3 -1
  266. package/build-module/index.js.map +1 -1
  267. package/build-module/input-control/index.js +2 -2
  268. package/build-module/input-control/index.js.map +1 -1
  269. package/build-module/input-control/input-base.js +6 -11
  270. package/build-module/input-control/input-base.js.map +1 -1
  271. package/build-module/input-control/input-prefix-wrapper.js +4 -3
  272. package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
  273. package/build-module/input-control/input-suffix-wrapper.js +3 -3
  274. package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
  275. package/build-module/input-control/reducer/reducer.js +8 -8
  276. package/build-module/input-control/reducer/reducer.js.map +1 -1
  277. package/build-module/input-control/styles/input-control-styles.js +74 -44
  278. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  279. package/build-module/input-control/types.js.map +1 -1
  280. package/build-module/input-control/utils.js +3 -3
  281. package/build-module/input-control/utils.js.map +1 -1
  282. package/build-module/item-group/styles.js +10 -10
  283. package/build-module/item-group/styles.js.map +1 -1
  284. package/build-module/modal/index.js +17 -9
  285. package/build-module/modal/index.js.map +1 -1
  286. package/build-module/navigation/index.js +4 -4
  287. package/build-module/navigation/index.js.map +1 -1
  288. package/build-module/navigation/styles/navigation-styles.js +14 -14
  289. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  290. package/build-module/navigator/index.js +6 -6
  291. package/build-module/navigator/index.js.map +1 -1
  292. package/build-module/navigator/navigator-back-button/hook.js +1 -1
  293. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  294. package/build-module/navigator/navigator-button/hook.js +1 -1
  295. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  296. package/build-module/navigator/navigator-provider/component.js +99 -67
  297. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  298. package/build-module/navigator/navigator-screen/component.js +4 -0
  299. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  300. package/build-module/navigator/navigator-to-parent-button/component.js +1 -1
  301. package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
  302. package/build-module/navigator/types.js.map +1 -1
  303. package/build-module/navigator/use-navigator.js +1 -2
  304. package/build-module/navigator/use-navigator.js.map +1 -1
  305. package/build-module/palette-edit/index.js +2 -2
  306. package/build-module/palette-edit/index.js.map +1 -1
  307. package/build-module/private-apis.js +1 -14
  308. package/build-module/private-apis.js.map +1 -1
  309. package/build-module/range-control/styles/range-control-styles.js +31 -31
  310. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  311. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
  312. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  313. package/build-module/select-control/styles/select-control-styles.js +13 -13
  314. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  315. package/build-module/slot-fill/bubbles-virtually/fill.js +4 -4
  316. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  317. package/build-module/slot-fill/index.js +1 -0
  318. package/build-module/slot-fill/index.js.map +1 -1
  319. package/build-module/snackbar/index.js +4 -4
  320. package/build-module/snackbar/index.js.map +1 -1
  321. package/build-module/tabs/index.js +4 -4
  322. package/build-module/tabs/index.js.map +1 -1
  323. package/build-module/tabs/styles.js +4 -4
  324. package/build-module/tabs/styles.js.map +1 -1
  325. package/build-module/tabs/tablist.js +5 -4
  326. package/build-module/tabs/tablist.js.map +1 -1
  327. package/build-module/toggle-group-control/toggle-group-control/utils.js +6 -6
  328. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  329. package/build-module/tools-panel/tools-panel/hook.js +6 -6
  330. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  331. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  332. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  333. package/build-module/utils/config-values.js +6 -4
  334. package/build-module/utils/config-values.js.map +1 -1
  335. package/build-module/utils/element-rect.js +74 -105
  336. package/build-module/utils/element-rect.js.map +1 -1
  337. package/build-module/utils/hooks/use-update-effect.js +4 -4
  338. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  339. package/build-style/style-rtl.css +11 -27
  340. package/build-style/style.css +11 -27
  341. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  342. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  343. package/build-types/alignment-matrix-control/icon.d.ts +1 -1
  344. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  345. package/build-types/alignment-matrix-control/index.d.ts +16 -6
  346. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  347. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  348. package/build-types/alignment-matrix-control/{styles/alignment-matrix-control-styles.d.ts → styles.d.ts} +9 -10
  349. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -0
  350. package/build-types/alignment-matrix-control/types.d.ts +12 -1
  351. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  352. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  353. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  354. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  355. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  356. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  357. package/build-types/circular-option-picker/types.d.ts +2 -2
  358. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  359. package/build-types/color-palette/utils.d.ts.map +1 -1
  360. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  361. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  362. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  363. package/build-types/color-picker/styles.d.ts.map +1 -1
  364. package/build-types/combobox-control/types.d.ts +1 -0
  365. package/build-types/combobox-control/types.d.ts.map +1 -1
  366. package/build-types/composite/context.d.ts.map +1 -1
  367. package/build-types/composite/group-label.d.ts +3 -0
  368. package/build-types/composite/group-label.d.ts.map +1 -0
  369. package/build-types/composite/group.d.ts +3 -0
  370. package/build-types/composite/group.d.ts.map +1 -0
  371. package/build-types/composite/hover.d.ts +3 -0
  372. package/build-types/composite/hover.d.ts.map +1 -0
  373. package/build-types/composite/index.d.ts +63 -47
  374. package/build-types/composite/index.d.ts.map +1 -1
  375. package/build-types/composite/item.d.ts +3 -0
  376. package/build-types/composite/item.d.ts.map +1 -0
  377. package/build-types/composite/legacy/index.d.ts +23 -3
  378. package/build-types/composite/legacy/index.d.ts.map +1 -1
  379. package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -1
  380. package/build-types/composite/row.d.ts +3 -0
  381. package/build-types/composite/row.d.ts.map +1 -0
  382. package/build-types/composite/stories/index.story.d.ts +9 -8
  383. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  384. package/build-types/composite/typeahead.d.ts +3 -0
  385. package/build-types/composite/typeahead.d.ts.map +1 -0
  386. package/build-types/composite/types.d.ts +12 -11
  387. package/build-types/composite/types.d.ts.map +1 -1
  388. package/build-types/date-time/date/index.d.ts +0 -3
  389. package/build-types/date-time/date/index.d.ts.map +1 -1
  390. package/build-types/date-time/date/styles.d.ts.map +1 -1
  391. package/build-types/date-time/date/test/use-lilius.d.ts +2 -0
  392. package/build-types/date-time/date/test/use-lilius.d.ts.map +1 -0
  393. package/build-types/date-time/date/use-lilius/index.d.ts +169 -0
  394. package/build-types/date-time/date/use-lilius/index.d.ts.map +1 -0
  395. package/build-types/date-time/time/time-input/index.d.ts.map +1 -1
  396. package/build-types/dimension-control/index.d.ts +1 -1
  397. package/build-types/dimension-control/index.d.ts.map +1 -1
  398. package/build-types/dimension-control/stories/index.story.d.ts +5 -0
  399. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  400. package/build-types/dropdown-menu-v2/checkbox-item.d.ts +3 -0
  401. package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +1 -0
  402. package/build-types/dropdown-menu-v2/context.d.ts +6 -0
  403. package/build-types/dropdown-menu-v2/context.d.ts.map +1 -0
  404. package/build-types/dropdown-menu-v2/group-label.d.ts +3 -0
  405. package/build-types/dropdown-menu-v2/group-label.d.ts.map +1 -0
  406. package/build-types/dropdown-menu-v2/group.d.ts +3 -0
  407. package/build-types/dropdown-menu-v2/group.d.ts.map +1 -0
  408. package/build-types/dropdown-menu-v2/index.d.ts +39 -18
  409. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  410. package/build-types/dropdown-menu-v2/item-help-text.d.ts +6 -0
  411. package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +1 -0
  412. package/build-types/dropdown-menu-v2/item-label.d.ts +6 -0
  413. package/build-types/dropdown-menu-v2/item-label.d.ts.map +1 -0
  414. package/build-types/dropdown-menu-v2/item.d.ts +3 -0
  415. package/build-types/dropdown-menu-v2/item.d.ts.map +1 -0
  416. package/build-types/dropdown-menu-v2/radio-item.d.ts +3 -0
  417. package/build-types/dropdown-menu-v2/radio-item.d.ts.map +1 -0
  418. package/build-types/dropdown-menu-v2/separator.d.ts +3 -0
  419. package/build-types/dropdown-menu-v2/separator.d.ts.map +1 -0
  420. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +10 -10
  421. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  422. package/build-types/dropdown-menu-v2/styles.d.ts +14 -6
  423. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  424. package/build-types/dropdown-menu-v2/types.d.ts +6 -0
  425. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  426. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts +8 -0
  427. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +1 -0
  428. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
  429. package/build-types/form-token-field/types.d.ts +1 -0
  430. package/build-types/form-token-field/types.d.ts.map +1 -1
  431. package/build-types/index.d.ts +4 -1
  432. package/build-types/index.d.ts.map +1 -1
  433. package/build-types/input-control/input-base.d.ts.map +1 -1
  434. package/build-types/input-control/input-prefix-wrapper.d.ts +2 -2
  435. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
  436. package/build-types/input-control/input-suffix-wrapper.d.ts +2 -2
  437. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
  438. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  439. package/build-types/input-control/stories/index.story.d.ts +9 -0
  440. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  441. package/build-types/input-control/styles/input-control-styles.d.ts +15 -9
  442. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  443. package/build-types/input-control/types.d.ts +23 -6
  444. package/build-types/input-control/types.d.ts.map +1 -1
  445. package/build-types/modal/index.d.ts.map +1 -1
  446. package/build-types/modal/stories/index.story.d.ts +3 -0
  447. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  448. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  449. package/build-types/navigator/index.d.ts +6 -6
  450. package/build-types/navigator/index.d.ts.map +1 -1
  451. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  452. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  453. package/build-types/navigator/stories/index.story.d.ts +1 -1
  454. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  455. package/build-types/navigator/types.d.ts +3 -1
  456. package/build-types/navigator/types.d.ts.map +1 -1
  457. package/build-types/navigator/use-navigator.d.ts +1 -2
  458. package/build-types/navigator/use-navigator.d.ts.map +1 -1
  459. package/build-types/private-apis.d.ts.map +1 -1
  460. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  461. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  462. package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
  463. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  464. package/build-types/slot-fill/index.d.ts +3 -0
  465. package/build-types/slot-fill/index.d.ts.map +1 -1
  466. package/build-types/tabs/index.d.ts.map +1 -1
  467. package/build-types/tabs/styles.d.ts.map +1 -1
  468. package/build-types/tabs/tablist.d.ts.map +1 -1
  469. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  470. package/build-types/utils/config-values.d.ts +3 -3
  471. package/build-types/utils/element-rect.d.ts +32 -74
  472. package/build-types/utils/element-rect.d.ts.map +1 -1
  473. package/package.json +19 -20
  474. package/src/alignment-matrix-control/README.md +1 -5
  475. package/src/alignment-matrix-control/cell.tsx +3 -9
  476. package/src/alignment-matrix-control/icon.tsx +48 -30
  477. package/src/alignment-matrix-control/index.tsx +60 -50
  478. package/src/alignment-matrix-control/stories/index.story.tsx +3 -12
  479. package/src/alignment-matrix-control/styles.ts +113 -0
  480. package/src/alignment-matrix-control/types.ts +12 -1
  481. package/src/angle-picker-control/angle-circle.tsx +11 -9
  482. package/src/border-control/border-control/component.tsx +23 -16
  483. package/src/circular-option-picker/circular-option-picker-option.tsx +16 -19
  484. package/src/circular-option-picker/circular-option-picker.tsx +26 -12
  485. package/src/circular-option-picker/types.ts +2 -2
  486. package/src/clipboard-button/index.tsx +6 -6
  487. package/src/color-palette/test/utils.ts +21 -2
  488. package/src/color-palette/utils.ts +1 -3
  489. package/src/color-picker/color-copy-button.tsx +10 -8
  490. package/src/color-picker/hex-input.tsx +6 -10
  491. package/src/color-picker/input-with-slider.tsx +6 -10
  492. package/src/color-picker/styles.ts +1 -1
  493. package/src/combobox-control/types.ts +1 -0
  494. package/src/composite/README.md +5 -24
  495. package/src/composite/{context.ts → context.tsx} +1 -2
  496. package/src/composite/group-label.tsx +30 -0
  497. package/src/composite/group.tsx +30 -0
  498. package/src/composite/hover.tsx +30 -0
  499. package/src/composite/index.tsx +71 -166
  500. package/src/composite/item.tsx +30 -0
  501. package/src/composite/legacy/index.tsx +73 -11
  502. package/src/composite/legacy/stories/index.story.tsx +2 -1
  503. package/src/composite/legacy/test/index.tsx +57 -1
  504. package/src/composite/row.tsx +30 -0
  505. package/src/composite/stories/index.story.tsx +254 -365
  506. package/src/composite/typeahead.tsx +30 -0
  507. package/src/composite/types.ts +14 -16
  508. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +10 -10
  509. package/src/custom-gradient-picker/style.scss +2 -21
  510. package/src/custom-select-control-v2/styles.ts +4 -4
  511. package/src/date-time/date/index.tsx +1 -1
  512. package/src/date-time/date/styles.ts +33 -13
  513. package/src/date-time/date/test/use-lilius.ts +417 -0
  514. package/src/date-time/date/use-lilius/index.ts +394 -0
  515. package/src/date-time/time/test/index.tsx +3 -6
  516. package/src/date-time/time/time-input/index.tsx +25 -25
  517. package/src/date-time/time/time-input/test/index.tsx +6 -7
  518. package/src/dimension-control/README.md +4 -0
  519. package/src/dimension-control/index.tsx +7 -1
  520. package/src/dimension-control/stories/index.story.tsx +7 -2
  521. package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -16
  522. package/src/dimension-control/test/index.test.js +1 -0
  523. package/src/draggable/index.tsx +4 -4
  524. package/src/dropdown-menu-v2/README.md +73 -60
  525. package/src/dropdown-menu-v2/checkbox-item.tsx +63 -0
  526. package/src/dropdown-menu-v2/context.tsx +13 -0
  527. package/src/dropdown-menu-v2/group-label.tsx +37 -0
  528. package/src/dropdown-menu-v2/group.tsx +26 -0
  529. package/src/dropdown-menu-v2/index.tsx +57 -197
  530. package/src/dropdown-menu-v2/item-help-text.tsx +23 -0
  531. package/src/dropdown-menu-v2/item-label.tsx +23 -0
  532. package/src/dropdown-menu-v2/item.tsx +50 -0
  533. package/src/dropdown-menu-v2/radio-item.tsx +70 -0
  534. package/src/dropdown-menu-v2/separator.tsx +27 -0
  535. package/src/dropdown-menu-v2/stories/index.story.tsx +295 -262
  536. package/src/dropdown-menu-v2/styles.ts +102 -66
  537. package/src/dropdown-menu-v2/test/index.tsx +159 -132
  538. package/src/dropdown-menu-v2/types.ts +7 -0
  539. package/src/dropdown-menu-v2/use-temporary-focus-visible-fix.ts +22 -0
  540. package/src/focal-point-picker/styles/focal-point-style.ts +6 -1
  541. package/src/form-toggle/style.scss +1 -1
  542. package/src/form-token-field/style.scss +2 -3
  543. package/src/form-token-field/types.ts +1 -0
  544. package/src/index.ts +6 -1
  545. package/src/input-control/index.tsx +2 -2
  546. package/src/input-control/input-base.tsx +4 -14
  547. package/src/input-control/input-prefix-wrapper.tsx +8 -4
  548. package/src/input-control/input-suffix-wrapper.tsx +4 -6
  549. package/src/input-control/reducer/reducer.ts +13 -10
  550. package/src/input-control/stories/index.story.tsx +31 -12
  551. package/src/input-control/styles/input-control-styles.tsx +42 -11
  552. package/src/input-control/types.ts +23 -7
  553. package/src/input-control/utils.ts +3 -3
  554. package/src/item-group/styles.ts +3 -3
  555. package/src/item-group/test/__snapshots__/index.js.snap +3 -3
  556. package/src/modal/index.tsx +21 -12
  557. package/src/modal/stories/index.story.tsx +8 -14
  558. package/src/modal/style.scss +5 -9
  559. package/src/navigation/index.tsx +4 -4
  560. package/src/navigation/styles/navigation-styles.tsx +3 -3
  561. package/src/navigator/index.ts +6 -6
  562. package/src/navigator/navigator-back-button/hook.ts +1 -1
  563. package/src/navigator/navigator-button/hook.ts +1 -1
  564. package/src/navigator/navigator-provider/README.md +2 -3
  565. package/src/navigator/navigator-provider/component.tsx +97 -82
  566. package/src/navigator/navigator-screen/component.tsx +7 -0
  567. package/src/navigator/navigator-to-parent-button/component.tsx +1 -1
  568. package/src/navigator/stories/index.story.tsx +82 -253
  569. package/src/navigator/test/index.tsx +8 -0
  570. package/src/navigator/types.ts +3 -1
  571. package/src/navigator/use-navigator.ts +1 -3
  572. package/src/palette-edit/index.tsx +2 -2
  573. package/src/private-apis.ts +1 -23
  574. package/src/range-control/styles/range-control-styles.ts +7 -7
  575. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -2
  576. package/src/resizable-box/style.scss +2 -2
  577. package/src/select-control/README.md +2 -2
  578. package/src/select-control/styles/select-control-styles.ts +5 -5
  579. package/src/slot-fill/bubbles-virtually/fill.tsx +4 -4
  580. package/src/slot-fill/index.tsx +1 -0
  581. package/src/snackbar/index.tsx +4 -4
  582. package/src/tab-panel/style.scss +0 -1
  583. package/src/tabs/index.tsx +8 -4
  584. package/src/tabs/styles.ts +42 -14
  585. package/src/tabs/tablist.tsx +5 -4
  586. package/src/text-control/style.scss +3 -2
  587. package/src/toggle-group-control/toggle-group-control/utils.ts +7 -7
  588. package/src/tools-panel/tools-panel/hook.ts +6 -6
  589. package/src/unit-control/styles/unit-control-styles.ts +2 -1
  590. package/src/utils/config-values.js +6 -4
  591. package/src/utils/element-rect.ts +93 -130
  592. package/src/utils/hooks/use-update-effect.js +4 -4
  593. package/tsconfig.tsbuildinfo +1 -1
  594. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -66
  595. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  596. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -77
  597. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  598. package/build/navigator/navigator-back-button/index.js +0 -14
  599. package/build/navigator/navigator-back-button/index.js.map +0 -1
  600. package/build/navigator/navigator-button/index.js +0 -14
  601. package/build/navigator/navigator-button/index.js.map +0 -1
  602. package/build/navigator/navigator-provider/index.js +0 -14
  603. package/build/navigator/navigator-provider/index.js.map +0 -1
  604. package/build/navigator/navigator-screen/index.js +0 -14
  605. package/build/navigator/navigator-screen/index.js.map +0 -1
  606. package/build/navigator/navigator-to-parent-button/index.js +0 -14
  607. package/build/navigator/navigator-to-parent-button/index.js.map +0 -1
  608. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -63
  609. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  610. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -72
  611. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  612. package/build-module/navigator/navigator-back-button/index.js +0 -2
  613. package/build-module/navigator/navigator-back-button/index.js.map +0 -1
  614. package/build-module/navigator/navigator-button/index.js +0 -2
  615. package/build-module/navigator/navigator-button/index.js.map +0 -1
  616. package/build-module/navigator/navigator-provider/index.js +0 -2
  617. package/build-module/navigator/navigator-provider/index.js.map +0 -1
  618. package/build-module/navigator/navigator-screen/index.js +0 -2
  619. package/build-module/navigator/navigator-screen/index.js.map +0 -1
  620. package/build-module/navigator/navigator-to-parent-button/index.js +0 -2
  621. package/build-module/navigator/navigator-to-parent-button/index.js.map +0 -1
  622. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +0 -18
  623. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +0 -1
  624. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +0 -1
  625. package/build-types/composite/stories/utils.d.ts +0 -29
  626. package/build-types/composite/stories/utils.d.ts.map +0 -1
  627. package/build-types/navigator/navigator-back-button/index.d.ts +0 -2
  628. package/build-types/navigator/navigator-back-button/index.d.ts.map +0 -1
  629. package/build-types/navigator/navigator-button/index.d.ts +0 -2
  630. package/build-types/navigator/navigator-button/index.d.ts.map +0 -1
  631. package/build-types/navigator/navigator-provider/index.d.ts +0 -2
  632. package/build-types/navigator/navigator-provider/index.d.ts.map +0 -1
  633. package/build-types/navigator/navigator-screen/index.d.ts +0 -2
  634. package/build-types/navigator/navigator-screen/index.d.ts.map +0 -1
  635. package/build-types/navigator/navigator-to-parent-button/index.d.ts +0 -2
  636. package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +0 -1
  637. package/src/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.ts +0 -77
  638. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +0 -102
  639. package/src/composite/stories/utils.tsx +0 -76
  640. package/src/navigator/navigator-back-button/index.ts +0 -1
  641. package/src/navigator/navigator-button/index.ts +0 -1
  642. package/src/navigator/navigator-provider/index.ts +0 -1
  643. package/src/navigator/navigator-screen/index.ts +0 -1
  644. package/src/navigator/navigator-to-parent-button/index.ts +0 -1
@@ -1,25 +1,23 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import type { Meta, StoryFn } from '@storybook/react';
4
+ import type { Meta, StoryObj } from '@storybook/react';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { isRTL } from '@wordpress/i18n';
9
+ import { useContext, useMemo } from '@wordpress/element';
10
10
 
11
11
  /**
12
12
  * Internal dependencies
13
13
  */
14
- import { Composite, useCompositeStore } from '..';
15
- import { UseCompositeStorePlaceholder, transform } from './utils';
14
+ import { createSlotFill, Provider as SlotFillProvider } from '../../slot-fill';
15
+ import { Composite } from '..';
16
16
 
17
- const meta: Meta< typeof UseCompositeStorePlaceholder > = {
18
- title: 'Components/Composite (V2)',
19
- component: UseCompositeStorePlaceholder,
17
+ const meta: Meta< typeof Composite > = {
18
+ title: 'Components/Composite',
19
+ component: Composite,
20
20
  subcomponents: {
21
- // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
22
- Composite,
23
21
  // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
24
22
  'Composite.Group': Composite.Group,
25
23
  // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
@@ -32,285 +30,26 @@ const meta: Meta< typeof UseCompositeStorePlaceholder > = {
32
30
  'Composite.Hover': Composite.Hover,
33
31
  // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
34
32
  'Composite.Typeahead': Composite.Typeahead,
33
+ // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170
34
+ 'Composite.Context': Composite.Context,
35
35
  },
36
36
  argTypes: {
37
- activeId: { control: 'text' },
38
- defaultActiveId: { control: 'text' },
37
+ children: { control: { type: null } },
38
+ render: { control: { type: null } },
39
39
  setActiveId: { control: { type: null } },
40
40
  focusLoop: {
41
41
  control: 'select',
42
42
  options: [ true, false, 'horizontal', 'vertical', 'both' ],
43
43
  },
44
- focusShift: { control: 'boolean' },
45
- focusWrap: { control: 'boolean' },
46
- virtualFocus: { control: 'boolean' },
47
- rtl: { control: 'boolean' },
48
- orientation: {
44
+ focusWrap: {
49
45
  control: 'select',
50
- options: [ 'horizontal', 'vertical', 'both' ],
46
+ options: [ true, false, 'horizontal', 'vertical', 'both' ],
51
47
  },
52
48
  },
53
- tags: [ 'status-private' ],
54
49
  parameters: {
55
50
  controls: { expanded: true },
56
51
  docs: {
57
52
  canvas: { sourceState: 'shown' },
58
- 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
53
  },
315
54
  },
316
55
  decorators: [
@@ -351,116 +90,266 @@ make disabled elements still accessible via keyboard.
351
90
  };
352
91
  export default meta;
353
92
 
354
- export const Default: StoryFn< typeof UseCompositeStorePlaceholder > = (
355
- storeProps
356
- ) => {
357
- const rtl = isRTL();
358
- const store = useCompositeStore( { rtl, ...storeProps } );
93
+ export const Default: StoryObj< typeof Composite > = {
94
+ args: {
95
+ children: (
96
+ <>
97
+ <Composite.Item>Item one</Composite.Item>
98
+ <Composite.Item>Item two</Composite.Item>
99
+ <Composite.Item>Item three</Composite.Item>
100
+ </>
101
+ ),
102
+ },
103
+ };
359
104
 
360
- return (
361
- <Composite store={ store }>
362
- <Composite.Item>Item one</Composite.Item>
363
- <Composite.Item>Item two</Composite.Item>
364
- <Composite.Item>Item three</Composite.Item>
365
- </Composite>
366
- );
105
+ export const Groups: StoryObj< typeof Composite > = {
106
+ ...Default,
107
+ args: {
108
+ ...Default.args,
109
+ children: (
110
+ <>
111
+ <Composite.Group>
112
+ <Composite.GroupLabel>Group one</Composite.GroupLabel>
113
+ <Composite.Item>Item 1.1</Composite.Item>
114
+ <Composite.Item>Item 1.2</Composite.Item>
115
+ </Composite.Group>
116
+ <Composite.Group>
117
+ <Composite.GroupLabel>Group two</Composite.GroupLabel>
118
+ <Composite.Item>Item 2.1</Composite.Item>
119
+ <Composite.Item>Item 2.1</Composite.Item>
120
+ </Composite.Group>
121
+ </>
122
+ ),
123
+ },
367
124
  };
368
125
 
369
- export const Groups: StoryFn< typeof UseCompositeStorePlaceholder > = (
370
- storeProps
371
- ) => {
372
- const rtl = isRTL();
373
- const store = useCompositeStore( { rtl, ...storeProps } );
126
+ export const Grid: StoryObj< typeof Composite > = {
127
+ ...Default,
128
+ args: {
129
+ ...Default.args,
130
+ role: 'grid',
131
+ 'aria-label': 'Composite',
132
+ children: (
133
+ <>
134
+ <Composite.Row role="row">
135
+ <Composite.Item role="gridcell">Item A1</Composite.Item>
136
+ <Composite.Item role="gridcell">Item A2</Composite.Item>
137
+ <Composite.Item role="gridcell">Item A3</Composite.Item>
138
+ </Composite.Row>
139
+ <Composite.Row role="row">
140
+ <Composite.Item role="gridcell">Item B1</Composite.Item>
141
+ <Composite.Item role="gridcell">Item B2</Composite.Item>
142
+ <Composite.Item role="gridcell">Item B3</Composite.Item>
143
+ </Composite.Row>
144
+ <Composite.Row role="row">
145
+ <Composite.Item role="gridcell">Item C1</Composite.Item>
146
+ <Composite.Item role="gridcell">Item C2</Composite.Item>
147
+ <Composite.Item role="gridcell">Item C3</Composite.Item>
148
+ </Composite.Row>
149
+ </>
150
+ ),
151
+ },
152
+ };
374
153
 
375
- return (
376
- <Composite store={ store }>
377
- <Composite.Group>
378
- <Composite.GroupLabel>Group one</Composite.GroupLabel>
379
- <Composite.Item>Item 1.1</Composite.Item>
380
- <Composite.Item>Item 1.2</Composite.Item>
381
- </Composite.Group>
382
- <Composite.Group>
383
- <Composite.GroupLabel>Group two</Composite.GroupLabel>
384
- <Composite.Item>Item 2.1</Composite.Item>
385
- <Composite.Item>Item 2.1</Composite.Item>
386
- </Composite.Group>
387
- </Composite>
388
- );
154
+ export const Hover: StoryObj< typeof Composite > = {
155
+ ...Default,
156
+ args: {
157
+ ...Default.args,
158
+ children: (
159
+ <>
160
+ <Composite.Hover render={ <Composite.Item /> }>
161
+ Hover item one
162
+ </Composite.Hover>
163
+ <Composite.Hover render={ <Composite.Item /> }>
164
+ Hover item two
165
+ </Composite.Hover>
166
+ <Composite.Hover render={ <Composite.Item /> }>
167
+ Hover item three
168
+ </Composite.Hover>
169
+ </>
170
+ ),
171
+ },
172
+ parameters: {
173
+ docs: {
174
+ description: {
175
+ story: 'Elements in the composite widget will receive focus on mouse move and lose focus to the composite base element on mouse leave.',
176
+ },
177
+ },
178
+ },
179
+ };
180
+
181
+ export const Typeahead: StoryObj< typeof Composite > = {
182
+ args: {
183
+ ...Default.args,
184
+ render: <Composite.Typeahead />,
185
+ children: (
186
+ <>
187
+ <Composite.Item>Apple</Composite.Item>
188
+ <Composite.Item>Banana</Composite.Item>
189
+ <Composite.Item>Peach</Composite.Item>
190
+ </>
191
+ ),
192
+ },
193
+ parameters: {
194
+ docs: {
195
+ description: {
196
+ story: 'When focus in on the composite widget, hitting printable character keys will move focus to the next composite item that begins with the input characters.',
197
+ },
198
+ },
199
+ },
389
200
  };
390
201
 
391
- export const Grid: StoryFn< typeof UseCompositeStorePlaceholder > = (
392
- storeProps
393
- ) => {
394
- const rtl = isRTL();
395
- const store = useCompositeStore( { rtl, ...storeProps } );
202
+ const ExampleSlotFill = createSlotFill( 'Example' );
203
+
204
+ const Slot = () => {
205
+ const compositeContext = useContext( Composite.Context );
206
+
207
+ // Forward the Slot's composite context to the Fill via fillProps, so that
208
+ // Composite components rendered inside the Fill can work as expected.
209
+ const fillProps = useMemo(
210
+ () => ( {
211
+ forwardedContext: [
212
+ [ Composite.Context.Provider, { value: compositeContext } ],
213
+ ],
214
+ } ),
215
+ [ compositeContext ]
216
+ );
396
217
 
397
218
  return (
398
- <Composite role="grid" store={ store } aria-label="Composite">
399
- <Composite.Row role="row">
400
- <Composite.Item role="gridcell">Item A1</Composite.Item>
401
- <Composite.Item role="gridcell">Item A2</Composite.Item>
402
- <Composite.Item role="gridcell">Item A3</Composite.Item>
403
- </Composite.Row>
404
- <Composite.Row role="row">
405
- <Composite.Item role="gridcell">Item B1</Composite.Item>
406
- <Composite.Item role="gridcell">Item B2</Composite.Item>
407
- <Composite.Item role="gridcell">Item B3</Composite.Item>
408
- </Composite.Row>
409
- <Composite.Row role="row">
410
- <Composite.Item role="gridcell">Item C1</Composite.Item>
411
- <Composite.Item role="gridcell">Item C2</Composite.Item>
412
- <Composite.Item role="gridcell">Item C3</Composite.Item>
413
- </Composite.Row>
414
- </Composite>
219
+ <ExampleSlotFill.Slot
220
+ fillProps={ fillProps }
221
+ bubblesVirtually
222
+ style={ { display: 'contents' } }
223
+ />
415
224
  );
416
225
  };
417
226
 
418
- export const Hover: StoryFn< typeof UseCompositeStorePlaceholder > = (
419
- storeProps
420
- ) => {
421
- const rtl = isRTL();
422
- const store = useCompositeStore( { rtl, ...storeProps } );
227
+ type ForwardedContextTuple< P = {} > = [
228
+ React.ComponentType< React.PropsWithChildren< P > >,
229
+ P,
230
+ ];
231
+
232
+ const Fill = ( { children }: { children: React.ReactNode } ) => {
233
+ const innerMarkup = <>{ children }</>;
423
234
 
424
235
  return (
425
- <Composite store={ store }>
426
- <Composite.Hover render={ <Composite.Item /> }>
427
- Hover item one
428
- </Composite.Hover>
429
- <Composite.Hover render={ <Composite.Item /> }>
430
- Hover item two
431
- </Composite.Hover>
432
- <Composite.Hover render={ <Composite.Item /> }>
433
- Hover item three
434
- </Composite.Hover>
435
- </Composite>
236
+ <ExampleSlotFill.Fill>
237
+ { ( fillProps: { forwardedContext?: ForwardedContextTuple[] } ) => {
238
+ const { forwardedContext = [] } = fillProps;
239
+
240
+ // Render all context providers forwarded by the Slot via fillProps.
241
+ return forwardedContext.reduce(
242
+ ( inner: JSX.Element, [ Provider, props ] ) => (
243
+ <Provider { ...props }>{ inner }</Provider>
244
+ ),
245
+ innerMarkup
246
+ );
247
+ } }
248
+ </ExampleSlotFill.Fill>
436
249
  );
437
250
  };
438
- Hover.parameters = {
439
- docs: {
440
- description: {
441
- story: 'Elements in the composite widget will receive focus on mouse move and lose focus to the composite base element on mouse leave.',
442
- },
251
+
252
+ export const WithSlotFill: StoryObj< typeof Composite > = {
253
+ ...Default,
254
+ args: {
255
+ ...Default.args,
256
+ children: (
257
+ <>
258
+ <Composite.Item>Item one (direct child)</Composite.Item>
259
+ <Slot />
260
+ <Composite.Item>Item four (direct child)</Composite.Item>
261
+ </>
262
+ ),
443
263
  },
444
- };
264
+ decorators: [
265
+ ( Story ) => {
266
+ return (
267
+ <SlotFillProvider>
268
+ <Story />
445
269
 
446
- export const Typeahead: StoryFn< typeof UseCompositeStorePlaceholder > = (
447
- storeProps
448
- ) => {
449
- const rtl = isRTL();
450
- const store = useCompositeStore( { rtl, ...storeProps } );
270
+ <Fill>
271
+ <Composite.Item>
272
+ Item two (from slot fill)
273
+ </Composite.Item>
274
+ <Composite.Item>
275
+ Item three (from slot fill)
276
+ </Composite.Item>
277
+ </Fill>
278
+ </SlotFillProvider>
279
+ );
280
+ },
281
+ ],
282
+ parameters: {
283
+ docs: {
284
+ description: {
285
+ story: 'When rendering Composite components across a SlotFill, the Composite.Context should be manually forwarded from the Slot to the Fill component.',
286
+ },
287
+ source: {
288
+ transform: ( code: string ) => {
289
+ return `const ExampleSlotFill = createSlotFill( 'Example' );
290
+
291
+ const Slot = () => {
292
+ const compositeContext = useContext( Composite.Context );
293
+
294
+ // Forward the Slot's composite context to the Fill via fillProps, so that
295
+ // Composite components rendered inside the Fill can work as expected.
296
+ const fillProps = useMemo(
297
+ () => ( {
298
+ forwardedContext: [
299
+ [ Composite.Context.Provider, { value: compositeContext } ],
300
+ ],
301
+ } ),
302
+ [ compositeContext ]
303
+ );
304
+
305
+ return (
306
+ <ExampleSlotFill.Slot
307
+ fillProps={ fillProps }
308
+ bubblesVirtually
309
+ style={ { display: 'contents' } }
310
+ />
311
+ );
312
+ };
451
313
 
452
- return (
453
- <Composite store={ store } render={ <Composite.Typeahead /> }>
454
- <Composite.Item>Apple</Composite.Item>
455
- <Composite.Item>Banana</Composite.Item>
456
- <Composite.Item>Peach</Composite.Item>
457
- </Composite>
458
- );
314
+ const Fill = ( { children } ) => {
315
+ const innerMarkup = <>{ children }</>;
316
+
317
+ return (
318
+ <ExampleSlotFill.Fill>
319
+ { ( fillProps ) => {
320
+ const { forwardedContext = [] } = fillProps;
321
+
322
+ // Render all context providers forwarded by the Slot via fillProps.
323
+ return forwardedContext.reduce(
324
+ ( inner, [ Provider, props ] ) => (
325
+ <Provider { ...props }>{ inner }</Provider>
326
+ ),
327
+ innerMarkup
328
+ );
329
+ } }
330
+ </ExampleSlotFill.Fill>
331
+ );
459
332
  };
460
- Typeahead.parameters = {
461
- docs: {
462
- description: {
463
- story: 'When focus in on the composite widget, hitting printable character keys will move focus to the next composite item that begins with the input characters.',
333
+
334
+ // In a separate component:
335
+
336
+ <SlotFillProvider>
337
+ ${
338
+ // Add one level of indentation to match the surrounding code.
339
+ code.replaceAll( '\n', '\n ' )
340
+ }
341
+
342
+ <Fill>
343
+ <Composite.Item>
344
+ Item two (from slot fill)
345
+ </Composite.Item>
346
+ <Composite.Item>
347
+ Item three (from slot fill)
348
+ </Composite.Item>
349
+ </Fill>
350
+ </SlotFillProvider>`;
351
+ },
352
+ },
464
353
  },
465
354
  },
466
355
  };