@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
@@ -7,17 +7,15 @@ import type { Meta, StoryObj } from '@storybook/react';
7
7
  * Internal dependencies
8
8
  */
9
9
  import Button from '../../button';
10
- import { Card, CardBody, CardFooter, CardHeader } from '../../card';
11
10
  import { VStack } from '../../v-stack';
12
- import Dropdown from '../../dropdown';
13
11
  import {
14
12
  NavigatorProvider,
15
13
  NavigatorScreen,
16
14
  NavigatorButton,
17
15
  NavigatorBackButton,
18
- NavigatorToParentButton,
19
16
  useNavigator,
20
17
  } from '..';
18
+ import { HStack } from '../../h-stack';
21
19
 
22
20
  const meta: Meta< typeof NavigatorProvider > = {
23
21
  component: NavigatorProvider,
@@ -33,268 +31,106 @@ const meta: Meta< typeof NavigatorProvider > = {
33
31
  controls: { expanded: true },
34
32
  docs: { canvas: { sourceState: 'shown' } },
35
33
  },
34
+ decorators: [
35
+ ( Story ) => {
36
+ return (
37
+ <>
38
+ <style>{ `
39
+ /* These attributes are a private implementation detail of the
40
+ Navigator component. Do not use outside of its source code. */
41
+ [data-wp-component="NavigatorProvider"] {
42
+ height: calc(100vh - 2rem);
43
+ max-height: 250px;
44
+
45
+ }
46
+ [data-wp-component="NavigatorScreen"]:not([data-sticky]) {
47
+ padding: 8px;
48
+ }
49
+ ` }</style>
50
+ <Story />
51
+ </>
52
+ );
53
+ },
54
+ ],
36
55
  };
37
56
  export default meta;
38
57
 
39
58
  export const Default: StoryObj< typeof NavigatorProvider > = {
40
59
  args: {
41
60
  initialPath: '/',
42
- style: { height: '100vh', maxHeight: '450px' },
43
61
  children: (
44
62
  <>
45
63
  <NavigatorScreen path="/">
46
- <Card>
47
- <CardBody>
48
- <p>This is the home screen.</p>
64
+ <h2>This is the home screen.</h2>
49
65
 
50
- <VStack alignment="left">
51
- <NavigatorButton
52
- variant="secondary"
53
- path="/child"
54
- >
55
- Navigate to child screen.
56
- </NavigatorButton>
57
-
58
- <NavigatorButton
59
- variant="secondary"
60
- path="/overflow-child"
61
- >
62
- Navigate to screen with horizontal overflow.
63
- </NavigatorButton>
64
-
65
- <NavigatorButton
66
- variant="secondary"
67
- path="/stickies"
68
- >
69
- Navigate to screen with sticky content.
70
- </NavigatorButton>
66
+ <VStack alignment="left">
67
+ <NavigatorButton variant="primary" path="/child">
68
+ Go to child screen.
69
+ </NavigatorButton>
71
70
 
72
- <NavigatorButton
73
- variant="secondary"
74
- path="/product/1"
75
- >
76
- Navigate to product screen with id 1.
77
- </NavigatorButton>
71
+ <NavigatorButton variant="primary" path="/product/1">
72
+ Go to dynamic path screen with id 1.
73
+ </NavigatorButton>
78
74
 
79
- <Dropdown
80
- renderToggle={ ( {
81
- isOpen,
82
- onToggle,
83
- }: {
84
- // TODO: remove once `Dropdown` is refactored to TypeScript
85
- isOpen: boolean;
86
- onToggle: () => void;
87
- } ) => (
88
- <Button
89
- onClick={ onToggle }
90
- aria-expanded={ isOpen }
91
- variant="primary"
92
- >
93
- Open test dialog
94
- </Button>
95
- ) }
96
- renderContent={ () => (
97
- <Card>
98
- <CardHeader>Go</CardHeader>
99
- <CardBody>Stuff</CardBody>
100
- </Card>
101
- ) }
102
- />
103
- </VStack>
104
- </CardBody>
105
- </Card>
75
+ <NavigatorButton variant="primary" path="/product/2">
76
+ Go to dynamic path screen with id 2.
77
+ </NavigatorButton>
78
+ </VStack>
106
79
  </NavigatorScreen>
107
80
 
108
81
  <NavigatorScreen path="/child">
109
- <Card>
110
- <CardBody>
111
- <p>This is the child screen.</p>
112
- <NavigatorBackButton variant="secondary">
113
- Go back
114
- </NavigatorBackButton>
115
- </CardBody>
116
- </Card>
117
- </NavigatorScreen>
118
-
119
- <NavigatorScreen path="/overflow-child">
120
- <Card>
121
- <CardBody>
122
- <NavigatorBackButton variant="secondary">
123
- Go back
124
- </NavigatorBackButton>
125
- <div
126
- style={ {
127
- display: 'inline-block',
128
- background: 'papayawhip',
129
- } }
130
- >
131
- <span
132
- style={ {
133
- color: 'palevioletred',
134
- whiteSpace: 'nowrap',
135
- fontSize: '42vw',
136
- } }
137
- >
138
- ¯\_(ツ)_/¯
139
- </span>
140
- </div>
141
- </CardBody>
142
- </Card>
82
+ <h2>This is the child screen.</h2>
83
+ <HStack spacing={ 2 } alignment="left">
84
+ <NavigatorBackButton variant="secondary">
85
+ Go back
86
+ </NavigatorBackButton>
87
+
88
+ <NavigatorButton
89
+ variant="primary"
90
+ path="/child/grandchild"
91
+ >
92
+ Go to grand child screen.
93
+ </NavigatorButton>
94
+ </HStack>
143
95
  </NavigatorScreen>
144
96
 
145
- <NavigatorScreen path="/stickies">
146
- <Card>
147
- <CardHeader style={ getStickyStyles( { zIndex: 2 } ) }>
148
- <NavigatorBackButton variant="secondary">
149
- Go back
150
- </NavigatorBackButton>
151
- </CardHeader>
152
- <CardBody>
153
- <div
154
- style={ getStickyStyles( {
155
- top: 69,
156
- bgColor: 'peachpuff',
157
- } ) }
158
- >
159
- <h2>A wild sticky element appears</h2>
160
- </div>
161
- <MetaphorIpsum quantity={ 3 } />
162
- </CardBody>
163
- <CardBody>
164
- <div
165
- style={ getStickyStyles( {
166
- top: 69,
167
- bgColor: 'paleturquoise',
168
- } ) }
169
- >
170
- <h2>Another wild sticky element appears</h2>
171
- </div>
172
- <MetaphorIpsum quantity={ 3 } />
173
- </CardBody>
174
- <CardFooter
175
- style={ getStickyStyles( {
176
- bgColor: 'mistyrose',
177
- } ) }
178
- >
179
- <Button variant="primary">Primary noop</Button>
180
- </CardFooter>
181
- </Card>
97
+ <NavigatorScreen path="/child/grandchild">
98
+ <h2>This is the grand child screen.</h2>
99
+ <NavigatorBackButton variant="secondary">
100
+ Go back
101
+ </NavigatorBackButton>
182
102
  </NavigatorScreen>
183
103
 
184
104
  <NavigatorScreen path="/product/:id">
185
- <ProductDetails />
105
+ <DynamicScreen />
186
106
  </NavigatorScreen>
187
107
  </>
188
108
  ),
189
109
  },
190
110
  };
191
111
 
192
- function getStickyStyles( {
193
- bottom = 0,
194
- bgColor = 'whitesmoke',
195
- top = 0,
196
- zIndex = 1,
197
- } ): React.CSSProperties {
198
- return {
199
- display: 'flex',
200
- position: 'sticky',
201
- top,
202
- bottom,
203
- zIndex,
204
- backgroundColor: bgColor,
205
- };
206
- }
112
+ function DynamicScreen() {
113
+ const { params } = useNavigator();
207
114
 
208
- function MetaphorIpsum( { quantity }: { quantity: number } ) {
209
- const list = [
210
- 'A loopy clarinet’s year comes with it the thought that the fenny step-son is an ophthalmologist. The literature would have us believe that a glabrate country is not but a rhythm. A beech is a rub from the right perspective. In ancient times few can name an unglossed walrus that isn’t an unspilt trial.',
211
- 'Authors often misinterpret the afterthought as a roseless mother-in-law, when in actuality it feels more like an uncapped thunderstorm. In recent years, some posit the tarry bottle to be less than acerb. They were lost without the unkissed timbale that composed their customer. A donna is a springtime breath.',
212
- 'It’s an undeniable fact, really; their museum was, in this moment, a snotty beef. The swordfishes could be said to resemble prowessed lasagnas. However, the rainier authority comes from a cureless soup. Unfortunately, that is wrong; on the contrary, the cover is a powder.',
213
- ];
214
- quantity = Math.min( list.length, quantity );
215
115
  return (
216
116
  <>
217
- { list.slice( 0, quantity ).map( ( text, key ) => (
218
- <p style={ { maxWidth: '20em' } } key={ key }>
219
- { text }
220
- </p>
221
- ) ) }
117
+ <h2>This is the dynamic screen</h2>
118
+ <p>
119
+ This screen can parse params dynamically. The current id is:{ ' ' }
120
+ { params.id }
121
+ </p>
122
+ <NavigatorBackButton variant="secondary">
123
+ Go back
124
+ </NavigatorBackButton>
222
125
  </>
223
126
  );
224
127
  }
225
128
 
226
- function ProductDetails() {
227
- const { params } = useNavigator();
228
-
229
- return (
230
- <Card>
231
- <CardBody>
232
- <NavigatorBackButton variant="secondary">
233
- Go back
234
- </NavigatorBackButton>
235
- <p>This is the screen for the product with id: { params.id }</p>
236
- </CardBody>
237
- </Card>
238
- );
239
- }
240
-
241
- export const NestedNavigator: StoryObj< typeof NavigatorProvider > = {
129
+ export const WithNestedInitialPath: StoryObj< typeof NavigatorProvider > = {
242
130
  ...Default,
243
131
  args: {
244
132
  ...Default.args,
245
- initialPath: '/child2/grandchild',
246
- children: (
247
- <>
248
- <NavigatorScreen path="/">
249
- <Card>
250
- <CardBody>
251
- <NavigatorButton variant="secondary" path="/child1">
252
- Go to first child.
253
- </NavigatorButton>
254
- <NavigatorButton variant="secondary" path="/child2">
255
- Go to second child.
256
- </NavigatorButton>
257
- </CardBody>
258
- </Card>
259
- </NavigatorScreen>
260
- <NavigatorScreen path="/child1">
261
- <Card>
262
- <CardBody>
263
- This is the first child
264
- <NavigatorToParentButton variant="secondary">
265
- Go back to parent
266
- </NavigatorToParentButton>
267
- </CardBody>
268
- </Card>
269
- </NavigatorScreen>
270
- <NavigatorScreen path="/child2">
271
- <Card>
272
- <CardBody>
273
- This is the second child
274
- <NavigatorToParentButton variant="secondary">
275
- Go back to parent
276
- </NavigatorToParentButton>
277
- <NavigatorButton
278
- variant="secondary"
279
- path="/child2/grandchild"
280
- >
281
- Go to grand child.
282
- </NavigatorButton>
283
- </CardBody>
284
- </Card>
285
- </NavigatorScreen>
286
- <NavigatorScreen path="/child2/grandchild">
287
- <Card>
288
- <CardBody>
289
- This is the grand child
290
- <NavigatorToParentButton variant="secondary">
291
- Go back to parent
292
- </NavigatorToParentButton>
293
- </CardBody>
294
- </Card>
295
- </NavigatorScreen>
296
- </>
297
- ),
133
+ initialPath: '/child/grandchild',
298
134
  },
299
135
  };
300
136
 
@@ -308,6 +144,10 @@ const NavigatorButtonWithSkipFocus = ( {
308
144
  return (
309
145
  <Button
310
146
  { ...props }
147
+ style={ {
148
+ marginInline: '8px',
149
+ ...props.style,
150
+ } }
311
151
  onClick={ ( e: React.MouseEvent< HTMLButtonElement > ) => {
312
152
  goTo( path, { skipFocus: true } );
313
153
  onClick?.( e );
@@ -323,39 +163,28 @@ export const SkipFocus: StoryObj< typeof NavigatorProvider > = {
323
163
  <>
324
164
  <div
325
165
  style={ {
326
- height: 250,
327
- border: '1px solid black',
166
+ height: 150,
167
+ outline: '1px solid black',
168
+ outlineOffset: '-1px',
169
+ marginBlockEnd: '1rem',
328
170
  } }
329
171
  >
330
- <NavigatorScreen
331
- path="/"
332
- style={ {
333
- height: '100%',
334
- } }
335
- >
336
- <h1>Home screen</h1>
337
- <NavigatorButton variant="secondary" path="/child">
172
+ <NavigatorScreen path="/">
173
+ <h2>Home screen</h2>
174
+ <NavigatorButton variant="primary" path="/child">
338
175
  Go to child screen.
339
176
  </NavigatorButton>
340
177
  </NavigatorScreen>
341
- <NavigatorScreen
342
- path="/child"
343
- style={ {
344
- height: '100%',
345
- } }
346
- >
178
+
179
+ <NavigatorScreen path="/child">
347
180
  <h2>Child screen</h2>
348
- <NavigatorToParentButton variant="secondary">
349
- Go to parent screen.
350
- </NavigatorToParentButton>
181
+ <NavigatorBackButton variant="secondary">
182
+ Go back to home screen
183
+ </NavigatorBackButton>
351
184
  </NavigatorScreen>
352
185
  </div>
353
186
 
354
- <NavigatorButtonWithSkipFocus
355
- variant="secondary"
356
- path="/child"
357
- style={ { margin: '1rem 2rem' } }
358
- >
187
+ <NavigatorButtonWithSkipFocus path="/child">
359
188
  Go to child screen, but keep focus on this button
360
189
  </NavigatorButtonWithSkipFocus>
361
190
  </>
@@ -642,6 +642,14 @@ describe( 'Navigator', () => {
642
642
  ).toHaveAttribute( 'id', INVALID_HTML_ATTRIBUTE.escaped );
643
643
  } );
644
644
 
645
+ it( 'should warn if the `path` prop does not follow the required format', () => {
646
+ render( <NavigatorScreen path="not-valid">Test</NavigatorScreen> );
647
+
648
+ expect( console ).toHaveWarnedWith(
649
+ 'wp.components.NavigatorScreen: the `path` should follow a URL-like scheme; it should start with and be separated by the `/` character.'
650
+ );
651
+ } );
652
+
645
653
  it( 'should match correctly paths with named arguments', async () => {
646
654
  const user = userEvent.setup();
647
655
 
@@ -28,7 +28,9 @@ export type NavigateOptions = {
28
28
  */
29
29
  skipFocus?: boolean;
30
30
  /**
31
- * Whether the navigation should replace the current location in the stack.
31
+ * Note: this option is deprecated and currently doesn't have any effect.
32
+ * @deprecated
33
+ * @ignore
32
34
  */
33
35
  replace?: boolean;
34
36
  };
@@ -12,7 +12,7 @@ import type { Navigator } from './types';
12
12
  /**
13
13
  * Retrieves a `navigator` instance.
14
14
  */
15
- function useNavigator(): Navigator {
15
+ export function useNavigator(): Navigator {
16
16
  const { location, params, goTo, goBack, goToParent } =
17
17
  useContext( NavigatorContext );
18
18
 
@@ -24,5 +24,3 @@ function useNavigator(): Navigator {
24
24
  params,
25
25
  };
26
26
  }
27
-
28
- export default useNavigator;
@@ -275,9 +275,9 @@ function PaletteEditListView< T extends Color | Gradient >( {
275
275
  addColorRef,
276
276
  }: PaletteEditListViewProps< T > ) {
277
277
  // When unmounting the component if there are empty elements (the user did not complete the insertion) clean them.
278
- const elementsReference = useRef< typeof elements >();
278
+ const elementsReferenceRef = useRef< typeof elements >();
279
279
  useEffect( () => {
280
- elementsReference.current = elements;
280
+ elementsReferenceRef.current = elements;
281
281
  }, [ elements ] );
282
282
 
283
283
  const debounceOnChange = useDebounce( onChange, 100 );
@@ -1,19 +1,9 @@
1
1
  /**
2
2
  * Internal dependencies
3
3
  */
4
- import { Composite, useCompositeStore } from './composite';
5
4
  import { positionToPlacement as __experimentalPopoverLegacyPositionToPlacement } from './popover/utils';
6
5
  import { createPrivateSlotFill } from './slot-fill';
7
- import {
8
- DropdownMenu as DropdownMenuV2,
9
- DropdownMenuGroup as DropdownMenuGroupV2,
10
- DropdownMenuItem as DropdownMenuItemV2,
11
- DropdownMenuCheckboxItem as DropdownMenuCheckboxItemV2,
12
- DropdownMenuRadioItem as DropdownMenuRadioItemV2,
13
- DropdownMenuSeparator as DropdownMenuSeparatorV2,
14
- DropdownMenuItemLabel as DropdownMenuItemLabelV2,
15
- DropdownMenuItemHelpText as DropdownMenuItemHelpTextV2,
16
- } from './dropdown-menu-v2';
6
+ import { DropdownMenuV2 } from './dropdown-menu-v2';
17
7
  import { ComponentsContext } from './context/context-system-provider';
18
8
  import Theme from './theme';
19
9
  import Tabs from './tabs';
@@ -22,23 +12,11 @@ import { lock } from './lock-unlock';
22
12
 
23
13
  export const privateApis = {};
24
14
  lock( privateApis, {
25
- CompositeV2: Composite,
26
- CompositeGroupV2: Composite.Group,
27
- CompositeItemV2: Composite.Item,
28
- CompositeRowV2: Composite.Row,
29
- useCompositeStoreV2: useCompositeStore,
30
15
  __experimentalPopoverLegacyPositionToPlacement,
31
16
  createPrivateSlotFill,
32
17
  ComponentsContext,
33
18
  Tabs,
34
19
  Theme,
35
20
  DropdownMenuV2,
36
- DropdownMenuGroupV2,
37
- DropdownMenuItemV2,
38
- DropdownMenuCheckboxItemV2,
39
- DropdownMenuRadioItemV2,
40
- DropdownMenuSeparatorV2,
41
- DropdownMenuItemLabelV2,
42
- DropdownMenuItemHelpTextV2,
43
21
  kebabCase,
44
22
  } );
@@ -8,7 +8,7 @@ import styled from '@emotion/styled';
8
8
  * Internal dependencies
9
9
  */
10
10
  import NumberControl from '../../number-control';
11
- import { COLORS, rtl } from '../../utils';
11
+ import { COLORS, rtl, CONFIG } from '../../utils';
12
12
  import { space } from '../../utils/space';
13
13
 
14
14
  import type {
@@ -102,7 +102,7 @@ export const Rail = styled.span`
102
102
  position: absolute;
103
103
  margin-top: ${ ( rangeHeightValue - railHeight ) / 2 }px;
104
104
  top: 0;
105
- border-radius: ${ railHeight }px;
105
+ border-radius: ${ CONFIG.radiusFull };
106
106
 
107
107
  ${ railBackgroundColor };
108
108
  `;
@@ -119,7 +119,7 @@ const trackBackgroundColor = ( { disabled, trackColor }: TrackProps ) => {
119
119
 
120
120
  export const Track = styled.span`
121
121
  background-color: currentColor;
122
- border-radius: ${ railHeight }px;
122
+ border-radius: ${ CONFIG.radiusFull };
123
123
  height: ${ railHeight }px;
124
124
  pointer-events: none;
125
125
  display: block;
@@ -203,7 +203,7 @@ export const ThumbWrapper = styled.span`
203
203
  top: 0;
204
204
  user-select: none;
205
205
  width: ${ thumbSize }px;
206
- border-radius: 50%;
206
+ border-radius: ${ CONFIG.radiusRound };
207
207
 
208
208
  ${ thumbColor };
209
209
  ${ rtl( { marginLeft: -10 } ) };
@@ -221,7 +221,7 @@ const thumbFocus = ( { isFocused }: ThumbProps ) => {
221
221
  position: absolute;
222
222
  background-color: ${ COLORS.theme.accent };
223
223
  opacity: 0.4;
224
- border-radius: 50%;
224
+ border-radius: ${ CONFIG.radiusRound };
225
225
  height: ${ thumbSize + 8 }px;
226
226
  width: ${ thumbSize + 8 }px;
227
227
  top: -4px;
@@ -233,7 +233,7 @@ const thumbFocus = ( { isFocused }: ThumbProps ) => {
233
233
 
234
234
  export const Thumb = styled.span< ThumbProps >`
235
235
  align-items: center;
236
- border-radius: 50%;
236
+ border-radius: ${ CONFIG.radiusRound };
237
237
  height: 100%;
238
238
  outline: 0;
239
239
  position: absolute;
@@ -281,7 +281,7 @@ const tooltipPosition = ( { position }: TooltipProps ) => {
281
281
 
282
282
  export const Tooltip = styled.span< TooltipProps >`
283
283
  background: rgba( 0, 0, 0, 0.8 );
284
- border-radius: 2px;
284
+ border-radius: ${ CONFIG.radiusSmall };
285
285
  color: white;
286
286
  display: inline-block;
287
287
  font-size: 12px;
@@ -7,7 +7,7 @@ import styled from '@emotion/styled';
7
7
  * Internal dependencies
8
8
  */
9
9
  import { Text } from '../../../text';
10
- import { font, COLORS } from '../../../utils';
10
+ import { font, COLORS, CONFIG } from '../../../utils';
11
11
 
12
12
  export const Root = styled.div`
13
13
  bottom: 0;
@@ -31,7 +31,7 @@ export const TooltipWrapper = styled.div`
31
31
 
32
32
  export const Tooltip = styled.div`
33
33
  background: ${ COLORS.theme.foreground };
34
- border-radius: 2px;
34
+ border-radius: ${ CONFIG.radiusSmall };
35
35
  box-sizing: border-box;
36
36
  font-family: ${ font( 'default.fontFamily' ) };
37
37
  font-size: 12px;
@@ -28,7 +28,7 @@ $resize-handler-container-size: $resize-handler-size + ($grid-unit-05 * 2); // M
28
28
  content: "";
29
29
  width: $resize-handler-size;
30
30
  height: $resize-handler-size;
31
- border-radius: 50%;
31
+ border-radius: $radius-round;
32
32
  background: $white;
33
33
  cursor: inherit;
34
34
  position: absolute;
@@ -43,7 +43,7 @@ $resize-handler-container-size: $resize-handler-size + ($grid-unit-05 * 2); // M
43
43
  // This is the "visible" resize handle for side handles - the line
44
44
  .components-resizable-box__side-handle::before {
45
45
  display: block;
46
- border-radius: 2px;
46
+ border-radius: $radius-full;
47
47
  content: "";
48
48
  width: 3px;
49
49
  height: 3px;
@@ -103,7 +103,7 @@ Render a user interface to select multiple users from a list.
103
103
  ```jsx
104
104
  <SelectControl
105
105
  multiple
106
- label={ __( 'Select some users:' ) }
106
+ label={ __( 'User' ) }
107
107
  value={ this.state.users } // e.g: value = [ 'a', 'c' ]
108
108
  onChange={ ( users ) => {
109
109
  this.setState( { users } );
@@ -126,7 +126,7 @@ const [ item, setItem ] = useState( '' );
126
126
  // ...
127
127
 
128
128
  <SelectControl
129
- label={ __( 'Select an item:' ) }
129
+ label={ __( 'My dinosaur' ) }
130
130
  value={ item } // e.g: value = 'a'
131
131
  onChange={ ( selection ) => { setItem( selection ) } }
132
132
  __nextHasNoMarginBottom
@@ -7,7 +7,7 @@ import styled from '@emotion/styled';
7
7
  /**
8
8
  * Internal dependencies
9
9
  */
10
- import { COLORS, rtl } from '../../utils';
10
+ import { COLORS, rtl, CONFIG } from '../../utils';
11
11
  import { space } from '../../utils/space';
12
12
  import type { SelectControlProps } from '../types';
13
13
  import InputControlSuffixWrapper from '../../input-control/input-suffix-wrapper';
@@ -108,10 +108,10 @@ const sizePaddings = ( {
108
108
  selectSize = 'default',
109
109
  }: SelectProps ) => {
110
110
  const padding = {
111
- default: 16,
112
- small: 8,
113
- compact: 8,
114
- '__unstable-large': 16,
111
+ default: CONFIG.controlPaddingX,
112
+ small: CONFIG.controlPaddingXSmall,
113
+ compact: CONFIG.controlPaddingXSmall,
114
+ '__unstable-large': CONFIG.controlPaddingX,
115
115
  };
116
116
 
117
117
  if ( ! __next40pxDefaultSize ) {
@@ -12,17 +12,17 @@ import type { FillComponentProps } from '../types';
12
12
 
13
13
  function useForceUpdate() {
14
14
  const [ , setState ] = useState( {} );
15
- const mounted = useRef( true );
15
+ const mountedRef = useRef( true );
16
16
 
17
17
  useEffect( () => {
18
- mounted.current = true;
18
+ mountedRef.current = true;
19
19
  return () => {
20
- mounted.current = false;
20
+ mountedRef.current = false;
21
21
  };
22
22
  }, [] );
23
23
 
24
24
  return () => {
25
- if ( mounted.current ) {
25
+ if ( mountedRef.current ) {
26
26
  setState( {} );
27
27
  }
28
28
  };