@wordpress/components 28.5.0 → 28.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (968) hide show
  1. package/CHANGELOG.md +159 -0
  2. package/CONTRIBUTING.md +178 -64
  3. package/build/alignment-matrix-control/cell.js +6 -9
  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 +57 -52
  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/angle-picker-control/styles/angle-picker-control-styles.js +4 -4
  15. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  16. package/build/base-control/index.js +54 -41
  17. package/build/base-control/index.js.map +1 -1
  18. package/build/base-control/types.js.map +1 -1
  19. package/build/border-control/border-control/component.js +18 -13
  20. package/build/border-control/border-control/component.js.map +1 -1
  21. package/build/border-control/styles.js +13 -13
  22. package/build/border-control/styles.js.map +1 -1
  23. package/build/checkbox-control/index.js +1 -0
  24. package/build/checkbox-control/index.js.map +1 -1
  25. package/build/circular-option-picker/circular-option-picker-option.js +17 -11
  26. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  27. package/build/circular-option-picker/circular-option-picker.js +17 -14
  28. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  29. package/build/circular-option-picker/types.js.map +1 -1
  30. package/build/clipboard-button/index.js +6 -6
  31. package/build/clipboard-button/index.js.map +1 -1
  32. package/build/color-palette/utils.js +16 -5
  33. package/build/color-palette/utils.js.map +1 -1
  34. package/build/color-picker/color-copy-button.js +8 -8
  35. package/build/color-picker/color-copy-button.js.map +1 -1
  36. package/build/color-picker/hex-input.js +8 -8
  37. package/build/color-picker/hex-input.js.map +1 -1
  38. package/build/color-picker/input-with-slider.js +9 -8
  39. package/build/color-picker/input-with-slider.js.map +1 -1
  40. package/build/color-picker/styles.js +8 -8
  41. package/build/color-picker/styles.js.map +1 -1
  42. package/build/combobox-control/index.js +1 -0
  43. package/build/combobox-control/index.js.map +1 -1
  44. package/build/combobox-control/types.js.map +1 -1
  45. package/build/composite/context.js +19 -0
  46. package/build/composite/context.js.map +1 -0
  47. package/build/composite/group-label.js +33 -0
  48. package/build/composite/group-label.js.map +1 -0
  49. package/build/composite/group.js +33 -0
  50. package/build/composite/group.js.map +1 -0
  51. package/build/composite/hover.js +33 -0
  52. package/build/composite/hover.js.map +1 -0
  53. package/build/composite/index.js +241 -9
  54. package/build/composite/index.js.map +1 -1
  55. package/build/composite/item.js +33 -0
  56. package/build/composite/item.js.map +1 -0
  57. package/build/composite/legacy/index.js +11 -8
  58. package/build/composite/legacy/index.js.map +1 -1
  59. package/build/composite/row.js +33 -0
  60. package/build/composite/row.js.map +1 -0
  61. package/build/composite/store.js +54 -0
  62. package/build/composite/store.js.map +1 -0
  63. package/build/composite/typeahead.js +33 -0
  64. package/build/composite/typeahead.js.map +1 -0
  65. package/build/composite/types.js +6 -0
  66. package/build/composite/types.js.map +1 -0
  67. package/build/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  68. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  69. package/build/custom-select-control/types.js.map +1 -1
  70. package/build/custom-select-control-v2/custom-select.js +3 -2
  71. package/build/custom-select-control-v2/custom-select.js.map +1 -1
  72. package/build/custom-select-control-v2/styles.js +12 -14
  73. package/build/custom-select-control-v2/styles.js.map +1 -1
  74. package/build/date-time/date/styles.js +8 -8
  75. package/build/date-time/date/styles.js.map +1 -1
  76. package/build/date-time/time/index.js +11 -3
  77. package/build/date-time/time/index.js.map +1 -1
  78. package/build/date-time/time/time-input/index.js +17 -19
  79. package/build/date-time/time/time-input/index.js.map +1 -1
  80. package/build/date-time/types.js.map +1 -1
  81. package/build/dimension-control/index.js +31 -9
  82. package/build/dimension-control/index.js.map +1 -1
  83. package/build/dimension-control/types.js.map +1 -1
  84. package/build/draggable/index.js +4 -4
  85. package/build/draggable/index.js.map +1 -1
  86. package/build/dropdown-menu-v2/checkbox-item.js +69 -0
  87. package/build/dropdown-menu-v2/checkbox-item.js.map +1 -0
  88. package/build/dropdown-menu-v2/context.js +17 -0
  89. package/build/dropdown-menu-v2/context.js.map +1 -0
  90. package/build/dropdown-menu-v2/group-label.js +40 -0
  91. package/build/dropdown-menu-v2/group-label.js.map +1 -0
  92. package/build/dropdown-menu-v2/group.js +29 -0
  93. package/build/dropdown-menu-v2/group.js.map +1 -0
  94. package/build/dropdown-menu-v2/index.js +60 -147
  95. package/build/dropdown-menu-v2/index.js.map +1 -1
  96. package/build/dropdown-menu-v2/item-help-text.js +27 -0
  97. package/build/dropdown-menu-v2/item-help-text.js.map +1 -0
  98. package/build/dropdown-menu-v2/item-label.js +27 -0
  99. package/build/dropdown-menu-v2/item-label.js.map +1 -0
  100. package/build/dropdown-menu-v2/item.js +53 -0
  101. package/build/dropdown-menu-v2/item.js.map +1 -0
  102. package/build/dropdown-menu-v2/radio-item.js +79 -0
  103. package/build/dropdown-menu-v2/radio-item.js.map +1 -0
  104. package/build/dropdown-menu-v2/separator.js +30 -0
  105. package/build/dropdown-menu-v2/separator.js.map +1 -0
  106. package/build/dropdown-menu-v2/styles.js +63 -85
  107. package/build/dropdown-menu-v2/styles.js.map +1 -1
  108. package/build/dropdown-menu-v2/types.js.map +1 -1
  109. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js +27 -0
  110. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  111. package/build/focal-point-picker/controls.js +1 -3
  112. package/build/focal-point-picker/controls.js.map +1 -1
  113. package/build/focal-point-picker/index.js +1 -2
  114. package/build/focal-point-picker/index.js.map +1 -1
  115. package/build/focal-point-picker/styles/focal-point-picker-style.js +11 -11
  116. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  117. package/build/focal-point-picker/styles/focal-point-style.js +7 -2
  118. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  119. package/build/focal-point-picker/types.js.map +1 -1
  120. package/build/form-file-upload/types.js.map +1 -1
  121. package/build/form-token-field/types.js.map +1 -1
  122. package/build/index.js +11 -5
  123. package/build/index.js.map +1 -1
  124. package/build/input-control/index.js +2 -2
  125. package/build/input-control/index.js.map +1 -1
  126. package/build/input-control/input-base.js +5 -10
  127. package/build/input-control/input-base.js.map +1 -1
  128. package/build/input-control/input-prefix-wrapper.js +3 -3
  129. package/build/input-control/input-prefix-wrapper.js.map +1 -1
  130. package/build/input-control/input-suffix-wrapper.js +2 -3
  131. package/build/input-control/input-suffix-wrapper.js.map +1 -1
  132. package/build/input-control/reducer/reducer.js +8 -8
  133. package/build/input-control/reducer/reducer.js.map +1 -1
  134. package/build/input-control/styles/input-control-styles.js +75 -45
  135. package/build/input-control/styles/input-control-styles.js.map +1 -1
  136. package/build/input-control/types.js.map +1 -1
  137. package/build/input-control/utils.js +3 -3
  138. package/build/input-control/utils.js.map +1 -1
  139. package/build/item-group/styles.js +11 -11
  140. package/build/item-group/styles.js.map +1 -1
  141. package/build/mobile/utils/alignments.native.js +1 -1
  142. package/build/mobile/utils/alignments.native.js.map +1 -1
  143. package/build/modal/index.js +5 -5
  144. package/build/modal/index.js.map +1 -1
  145. package/build/navigation/index.js +4 -4
  146. package/build/navigation/index.js.map +1 -1
  147. package/build/navigation/styles/navigation-styles.js +13 -13
  148. package/build/navigation/styles/navigation-styles.js.map +1 -1
  149. package/build/navigator/index.js +12 -13
  150. package/build/navigator/index.js.map +1 -1
  151. package/build/navigator/navigator-back-button/component.js +1 -1
  152. package/build/navigator/navigator-back-button/component.js.map +1 -1
  153. package/build/navigator/navigator-back-button/hook.js +5 -11
  154. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  155. package/build/navigator/navigator-button/hook.js +2 -2
  156. package/build/navigator/navigator-button/hook.js.map +1 -1
  157. package/build/navigator/navigator-provider/component.js +116 -76
  158. package/build/navigator/navigator-provider/component.js.map +1 -1
  159. package/build/navigator/navigator-to-parent-button/component.js +13 -40
  160. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  161. package/build/navigator/types.js.map +1 -1
  162. package/build/navigator/use-navigator.js +1 -2
  163. package/build/navigator/use-navigator.js.map +1 -1
  164. package/build/palette-edit/index.js +2 -2
  165. package/build/palette-edit/index.js.map +1 -1
  166. package/build/palette-edit/styles.js +11 -11
  167. package/build/palette-edit/styles.js.map +1 -1
  168. package/build/popover/index.js +6 -1
  169. package/build/popover/index.js.map +1 -1
  170. package/build/private-apis.js +10 -14
  171. package/build/private-apis.js.map +1 -1
  172. package/build/progress-bar/styles.js +5 -5
  173. package/build/progress-bar/styles.js.map +1 -1
  174. package/build/query-controls/index.js +5 -6
  175. package/build/query-controls/index.js.map +1 -1
  176. package/build/query-controls/types.js.map +1 -1
  177. package/build/radio-control/index.js +20 -19
  178. package/build/radio-control/index.js.map +1 -1
  179. package/build/radio-group/radio.js +3 -2
  180. package/build/radio-group/radio.js.map +1 -1
  181. package/build/range-control/index.js +32 -9
  182. package/build/range-control/index.js.map +1 -1
  183. package/build/range-control/styles/range-control-styles.js +31 -31
  184. package/build/range-control/styles/range-control-styles.js.map +1 -1
  185. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  186. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  187. package/build/search-control/index.js +5 -4
  188. package/build/search-control/index.js.map +1 -1
  189. package/build/select-control/index.js +1 -0
  190. package/build/select-control/index.js.map +1 -1
  191. package/build/select-control/styles/select-control-styles.js +12 -12
  192. package/build/select-control/styles/select-control-styles.js.map +1 -1
  193. package/build/slot-fill/bubbles-virtually/fill.js +4 -4
  194. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  195. package/build/snackbar/index.js +4 -4
  196. package/build/snackbar/index.js.map +1 -1
  197. package/build/tab-panel/index.js +3 -2
  198. package/build/tab-panel/index.js.map +1 -1
  199. package/build/tabs/index.js +7 -6
  200. package/build/tabs/index.js.map +1 -1
  201. package/build/tabs/styles.js +3 -3
  202. package/build/tabs/styles.js.map +1 -1
  203. package/build/tabs/tablist.js +6 -4
  204. package/build/tabs/tablist.js.map +1 -1
  205. package/build/tabs/tabpanel.js +6 -1
  206. package/build/tabs/tabpanel.js.map +1 -1
  207. package/build/text/styles.js +7 -7
  208. package/build/text/styles.js.map +1 -1
  209. package/build/text-control/index.js +1 -0
  210. package/build/text-control/index.js.map +1 -1
  211. package/build/textarea-control/index.js +1 -0
  212. package/build/textarea-control/index.js.map +1 -1
  213. package/build/textarea-control/styles/textarea-control-styles.js +8 -2
  214. package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
  215. package/build/toggle-control/index.js +9 -1
  216. package/build/toggle-control/index.js.map +1 -1
  217. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +3 -2
  218. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  219. package/build/toggle-group-control/toggle-group-control/component.js +1 -0
  220. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  221. package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
  222. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  223. package/build/toggle-group-control/toggle-group-control/utils.js +6 -6
  224. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  225. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
  226. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  227. package/build/tools-panel/styles.js +13 -13
  228. package/build/tools-panel/styles.js.map +1 -1
  229. package/build/tools-panel/tools-panel/hook.js +6 -6
  230. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  231. package/build/tooltip/index.js +3 -2
  232. package/build/tooltip/index.js.map +1 -1
  233. package/build/tree-select/index.js +19 -6
  234. package/build/tree-select/index.js.map +1 -1
  235. package/build/unit-control/styles/unit-control-styles.js +7 -7
  236. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  237. package/build/utils/config-values.js +10 -7
  238. package/build/utils/config-values.js.map +1 -1
  239. package/build/utils/hooks/use-update-effect.js +4 -4
  240. package/build/utils/hooks/use-update-effect.js.map +1 -1
  241. package/build-module/alignment-matrix-control/cell.js +4 -7
  242. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  243. package/build-module/alignment-matrix-control/icon.js +31 -19
  244. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  245. package/build-module/alignment-matrix-control/index.js +56 -50
  246. package/build-module/alignment-matrix-control/index.js.map +1 -1
  247. package/build-module/alignment-matrix-control/styles.js +70 -0
  248. package/build-module/alignment-matrix-control/styles.js.map +1 -0
  249. package/build-module/alignment-matrix-control/types.js.map +1 -1
  250. package/build-module/angle-picker-control/angle-circle.js +9 -9
  251. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  252. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +4 -4
  253. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  254. package/build-module/base-control/index.js +54 -42
  255. package/build-module/base-control/index.js.map +1 -1
  256. package/build-module/base-control/types.js.map +1 -1
  257. package/build-module/border-control/border-control/component.js +18 -13
  258. package/build-module/border-control/border-control/component.js.map +1 -1
  259. package/build-module/border-control/styles.js +13 -13
  260. package/build-module/border-control/styles.js.map +1 -1
  261. package/build-module/checkbox-control/index.js +1 -0
  262. package/build-module/checkbox-control/index.js.map +1 -1
  263. package/build-module/circular-option-picker/circular-option-picker-option.js +18 -12
  264. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  265. package/build-module/circular-option-picker/circular-option-picker.js +16 -13
  266. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  267. package/build-module/circular-option-picker/types.js.map +1 -1
  268. package/build-module/clipboard-button/index.js +6 -6
  269. package/build-module/clipboard-button/index.js.map +1 -1
  270. package/build-module/color-palette/utils.js +16 -5
  271. package/build-module/color-palette/utils.js.map +1 -1
  272. package/build-module/color-picker/color-copy-button.js +8 -8
  273. package/build-module/color-picker/color-copy-button.js.map +1 -1
  274. package/build-module/color-picker/hex-input.js +7 -8
  275. package/build-module/color-picker/hex-input.js.map +1 -1
  276. package/build-module/color-picker/input-with-slider.js +8 -8
  277. package/build-module/color-picker/input-with-slider.js.map +1 -1
  278. package/build-module/color-picker/styles.js +8 -8
  279. package/build-module/color-picker/styles.js.map +1 -1
  280. package/build-module/combobox-control/index.js +1 -0
  281. package/build-module/combobox-control/index.js.map +1 -1
  282. package/build-module/combobox-control/types.js.map +1 -1
  283. package/build-module/composite/context.js +12 -0
  284. package/build-module/composite/context.js.map +1 -0
  285. package/build-module/composite/group-label.js +25 -0
  286. package/build-module/composite/group-label.js.map +1 -0
  287. package/build-module/composite/group.js +25 -0
  288. package/build-module/composite/group.js.map +1 -0
  289. package/build-module/composite/hover.js +25 -0
  290. package/build-module/composite/hover.js.map +1 -0
  291. package/build-module/composite/index.js +239 -6
  292. package/build-module/composite/index.js.map +1 -1
  293. package/build-module/composite/item.js +25 -0
  294. package/build-module/composite/item.js.map +1 -0
  295. package/build-module/composite/legacy/index.js +11 -6
  296. package/build-module/composite/legacy/index.js.map +1 -1
  297. package/build-module/composite/row.js +25 -0
  298. package/build-module/composite/row.js.map +1 -0
  299. package/build-module/composite/store.js +46 -0
  300. package/build-module/composite/store.js.map +1 -0
  301. package/build-module/composite/typeahead.js +25 -0
  302. package/build-module/composite/typeahead.js.map +1 -0
  303. package/build-module/composite/types.js +2 -0
  304. package/build-module/composite/types.js.map +1 -0
  305. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +8 -8
  306. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  307. package/build-module/custom-select-control/types.js.map +1 -1
  308. package/build-module/custom-select-control-v2/custom-select.js +2 -1
  309. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  310. package/build-module/custom-select-control-v2/styles.js +12 -14
  311. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  312. package/build-module/date-time/date/styles.js +8 -8
  313. package/build-module/date-time/date/styles.js.map +1 -1
  314. package/build-module/date-time/time/index.js +11 -3
  315. package/build-module/date-time/time/index.js.map +1 -1
  316. package/build-module/date-time/time/time-input/index.js +17 -19
  317. package/build-module/date-time/time/time-input/index.js.map +1 -1
  318. package/build-module/date-time/types.js.map +1 -1
  319. package/build-module/dimension-control/index.js +31 -9
  320. package/build-module/dimension-control/index.js.map +1 -1
  321. package/build-module/dimension-control/types.js.map +1 -1
  322. package/build-module/draggable/index.js +4 -4
  323. package/build-module/draggable/index.js.map +1 -1
  324. package/build-module/dropdown-menu-v2/checkbox-item.js +62 -0
  325. package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -0
  326. package/build-module/dropdown-menu-v2/context.js +11 -0
  327. package/build-module/dropdown-menu-v2/context.js.map +1 -0
  328. package/build-module/dropdown-menu-v2/group-label.js +32 -0
  329. package/build-module/dropdown-menu-v2/group-label.js.map +1 -0
  330. package/build-module/dropdown-menu-v2/group.js +21 -0
  331. package/build-module/dropdown-menu-v2/group.js.map +1 -0
  332. package/build-module/dropdown-menu-v2/index.js +58 -144
  333. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  334. package/build-module/dropdown-menu-v2/item-help-text.js +19 -0
  335. package/build-module/dropdown-menu-v2/item-help-text.js.map +1 -0
  336. package/build-module/dropdown-menu-v2/item-label.js +19 -0
  337. package/build-module/dropdown-menu-v2/item-label.js.map +1 -0
  338. package/build-module/dropdown-menu-v2/item.js +46 -0
  339. package/build-module/dropdown-menu-v2/item.js.map +1 -0
  340. package/build-module/dropdown-menu-v2/radio-item.js +72 -0
  341. package/build-module/dropdown-menu-v2/radio-item.js.map +1 -0
  342. package/build-module/dropdown-menu-v2/separator.js +22 -0
  343. package/build-module/dropdown-menu-v2/separator.js.map +1 -0
  344. package/build-module/dropdown-menu-v2/styles.js +63 -85
  345. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  346. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  347. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js +20 -0
  348. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +1 -0
  349. package/build-module/focal-point-picker/controls.js +1 -3
  350. package/build-module/focal-point-picker/controls.js.map +1 -1
  351. package/build-module/focal-point-picker/index.js +1 -2
  352. package/build-module/focal-point-picker/index.js.map +1 -1
  353. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +11 -11
  354. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  355. package/build-module/focal-point-picker/styles/focal-point-style.js +6 -2
  356. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  357. package/build-module/focal-point-picker/types.js.map +1 -1
  358. package/build-module/form-file-upload/types.js.map +1 -1
  359. package/build-module/form-token-field/types.js.map +1 -1
  360. package/build-module/index.js +3 -2
  361. package/build-module/index.js.map +1 -1
  362. package/build-module/input-control/index.js +2 -2
  363. package/build-module/input-control/index.js.map +1 -1
  364. package/build-module/input-control/input-base.js +6 -11
  365. package/build-module/input-control/input-base.js.map +1 -1
  366. package/build-module/input-control/input-prefix-wrapper.js +4 -3
  367. package/build-module/input-control/input-prefix-wrapper.js.map +1 -1
  368. package/build-module/input-control/input-suffix-wrapper.js +3 -3
  369. package/build-module/input-control/input-suffix-wrapper.js.map +1 -1
  370. package/build-module/input-control/reducer/reducer.js +8 -8
  371. package/build-module/input-control/reducer/reducer.js.map +1 -1
  372. package/build-module/input-control/styles/input-control-styles.js +74 -44
  373. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  374. package/build-module/input-control/types.js.map +1 -1
  375. package/build-module/input-control/utils.js +3 -3
  376. package/build-module/input-control/utils.js.map +1 -1
  377. package/build-module/item-group/styles.js +11 -11
  378. package/build-module/item-group/styles.js.map +1 -1
  379. package/build-module/mobile/utils/alignments.native.js +1 -1
  380. package/build-module/mobile/utils/alignments.native.js.map +1 -1
  381. package/build-module/modal/index.js +5 -5
  382. package/build-module/modal/index.js.map +1 -1
  383. package/build-module/navigation/index.js +4 -4
  384. package/build-module/navigation/index.js.map +1 -1
  385. package/build-module/navigation/styles/navigation-styles.js +14 -14
  386. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  387. package/build-module/navigator/index.js +6 -6
  388. package/build-module/navigator/index.js.map +1 -1
  389. package/build-module/navigator/navigator-back-button/component.js +1 -1
  390. package/build-module/navigator/navigator-back-button/component.js.map +1 -1
  391. package/build-module/navigator/navigator-back-button/hook.js +4 -10
  392. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  393. package/build-module/navigator/navigator-button/hook.js +1 -1
  394. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  395. package/build-module/navigator/navigator-provider/component.js +116 -76
  396. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  397. package/build-module/navigator/navigator-to-parent-button/component.js +12 -41
  398. package/build-module/navigator/navigator-to-parent-button/component.js.map +1 -1
  399. package/build-module/navigator/types.js.map +1 -1
  400. package/build-module/navigator/use-navigator.js +1 -2
  401. package/build-module/navigator/use-navigator.js.map +1 -1
  402. package/build-module/palette-edit/index.js +2 -2
  403. package/build-module/palette-edit/index.js.map +1 -1
  404. package/build-module/palette-edit/styles.js +11 -11
  405. package/build-module/palette-edit/styles.js.map +1 -1
  406. package/build-module/popover/index.js +6 -1
  407. package/build-module/popover/index.js.map +1 -1
  408. package/build-module/private-apis.js +10 -14
  409. package/build-module/private-apis.js.map +1 -1
  410. package/build-module/progress-bar/styles.js +5 -5
  411. package/build-module/progress-bar/styles.js.map +1 -1
  412. package/build-module/query-controls/index.js +5 -6
  413. package/build-module/query-controls/index.js.map +1 -1
  414. package/build-module/query-controls/types.js.map +1 -1
  415. package/build-module/radio-control/index.js +20 -19
  416. package/build-module/radio-control/index.js.map +1 -1
  417. package/build-module/radio-group/radio.js +2 -1
  418. package/build-module/radio-group/radio.js.map +1 -1
  419. package/build-module/range-control/index.js +32 -9
  420. package/build-module/range-control/index.js.map +1 -1
  421. package/build-module/range-control/styles/range-control-styles.js +32 -32
  422. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  423. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +5 -5
  424. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  425. package/build-module/search-control/index.js +5 -4
  426. package/build-module/search-control/index.js.map +1 -1
  427. package/build-module/select-control/index.js +1 -0
  428. package/build-module/select-control/index.js.map +1 -1
  429. package/build-module/select-control/styles/select-control-styles.js +13 -13
  430. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  431. package/build-module/slot-fill/bubbles-virtually/fill.js +4 -4
  432. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  433. package/build-module/snackbar/index.js +4 -4
  434. package/build-module/snackbar/index.js.map +1 -1
  435. package/build-module/tab-panel/index.js +2 -1
  436. package/build-module/tab-panel/index.js.map +1 -1
  437. package/build-module/tabs/index.js +6 -5
  438. package/build-module/tabs/index.js.map +1 -1
  439. package/build-module/tabs/styles.js +4 -4
  440. package/build-module/tabs/styles.js.map +1 -1
  441. package/build-module/tabs/tablist.js +5 -3
  442. package/build-module/tabs/tablist.js.map +1 -1
  443. package/build-module/tabs/tabpanel.js +6 -2
  444. package/build-module/tabs/tabpanel.js.map +1 -1
  445. package/build-module/text/styles.js +7 -7
  446. package/build-module/text/styles.js.map +1 -1
  447. package/build-module/text-control/index.js +1 -0
  448. package/build-module/text-control/index.js.map +1 -1
  449. package/build-module/textarea-control/index.js +1 -0
  450. package/build-module/textarea-control/index.js.map +1 -1
  451. package/build-module/textarea-control/styles/textarea-control-styles.js +9 -2
  452. package/build-module/textarea-control/styles/textarea-control-styles.js.map +1 -1
  453. package/build-module/toggle-control/index.js +9 -1
  454. package/build-module/toggle-control/index.js.map +1 -1
  455. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +2 -1
  456. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  457. package/build-module/toggle-group-control/toggle-group-control/component.js +1 -0
  458. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  459. package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
  460. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  461. package/build-module/toggle-group-control/toggle-group-control/utils.js +6 -6
  462. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  463. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
  464. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  465. package/build-module/tools-panel/styles.js +13 -13
  466. package/build-module/tools-panel/styles.js.map +1 -1
  467. package/build-module/tools-panel/tools-panel/hook.js +6 -6
  468. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  469. package/build-module/tooltip/index.js +2 -1
  470. package/build-module/tooltip/index.js.map +1 -1
  471. package/build-module/tree-select/index.js +19 -6
  472. package/build-module/tree-select/index.js.map +1 -1
  473. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  474. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  475. package/build-module/utils/config-values.js +10 -7
  476. package/build-module/utils/config-values.js.map +1 -1
  477. package/build-module/utils/hooks/use-update-effect.js +4 -4
  478. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  479. package/build-style/style-rtl.css +30 -32
  480. package/build-style/style.css +30 -32
  481. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  482. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  483. package/build-types/alignment-matrix-control/icon.d.ts +1 -1
  484. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  485. package/build-types/alignment-matrix-control/index.d.ts +16 -6
  486. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  487. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  488. package/build-types/alignment-matrix-control/{styles/alignment-matrix-control-styles.d.ts → styles.d.ts} +9 -10
  489. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -0
  490. package/build-types/alignment-matrix-control/types.d.ts +12 -1
  491. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  492. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  493. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  494. package/build-types/base-control/hooks.d.ts +1 -0
  495. package/build-types/base-control/hooks.d.ts.map +1 -1
  496. package/build-types/base-control/index.d.ts +44 -0
  497. package/build-types/base-control/index.d.ts.map +1 -1
  498. package/build-types/base-control/types.d.ts +7 -0
  499. package/build-types/base-control/types.d.ts.map +1 -1
  500. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  501. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  502. package/build-types/checkbox-control/index.d.ts.map +1 -1
  503. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  504. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  505. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  506. package/build-types/circular-option-picker/types.d.ts +2 -3
  507. package/build-types/circular-option-picker/types.d.ts.map +1 -1
  508. package/build-types/color-palette/utils.d.ts.map +1 -1
  509. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  510. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  511. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  512. package/build-types/color-picker/styles.d.ts.map +1 -1
  513. package/build-types/combobox-control/index.d.ts.map +1 -1
  514. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  515. package/build-types/combobox-control/types.d.ts +1 -0
  516. package/build-types/combobox-control/types.d.ts.map +1 -1
  517. package/build-types/composite/context.d.ts +7 -0
  518. package/build-types/composite/context.d.ts.map +1 -0
  519. package/build-types/composite/group-label.d.ts +3 -0
  520. package/build-types/composite/group-label.d.ts.map +1 -0
  521. package/build-types/composite/group.d.ts +3 -0
  522. package/build-types/composite/group.d.ts.map +1 -0
  523. package/build-types/composite/hover.d.ts +3 -0
  524. package/build-types/composite/hover.d.ts.map +1 -0
  525. package/build-types/composite/index.d.ts +185 -1
  526. package/build-types/composite/index.d.ts.map +1 -1
  527. package/build-types/composite/item.d.ts +3 -0
  528. package/build-types/composite/item.d.ts.map +1 -0
  529. package/build-types/composite/legacy/index.d.ts +7 -5
  530. package/build-types/composite/legacy/index.d.ts.map +1 -1
  531. package/build-types/composite/legacy/stories/utils.d.ts +19 -0
  532. package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
  533. package/build-types/composite/row.d.ts +3 -0
  534. package/build-types/composite/row.d.ts.map +1 -0
  535. package/build-types/composite/store.d.ts +25 -0
  536. package/build-types/composite/store.d.ts.map +1 -0
  537. package/build-types/composite/stories/index.story.d.ts +14 -0
  538. package/build-types/composite/stories/index.story.d.ts.map +1 -0
  539. package/build-types/composite/stories/utils.d.ts +29 -0
  540. package/build-types/composite/stories/utils.d.ts.map +1 -0
  541. package/build-types/composite/typeahead.d.ts +3 -0
  542. package/build-types/composite/typeahead.d.ts.map +1 -0
  543. package/build-types/composite/types.d.ts +288 -0
  544. package/build-types/composite/types.d.ts.map +1 -0
  545. package/build-types/custom-select-control/types.d.ts +3 -3
  546. package/build-types/custom-select-control/types.d.ts.map +1 -1
  547. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  548. package/build-types/date-time/date-time/index.d.ts +1 -1
  549. package/build-types/date-time/time/index.d.ts +1 -1
  550. package/build-types/date-time/time/index.d.ts.map +1 -1
  551. package/build-types/date-time/time/time-input/index.d.ts.map +1 -1
  552. package/build-types/date-time/types.d.ts +7 -1
  553. package/build-types/date-time/types.d.ts.map +1 -1
  554. package/build-types/dimension-control/index.d.ts +2 -1
  555. package/build-types/dimension-control/index.d.ts.map +1 -1
  556. package/build-types/dimension-control/stories/index.story.d.ts +13 -1
  557. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  558. package/build-types/dimension-control/types.d.ts +2 -7
  559. package/build-types/dimension-control/types.d.ts.map +1 -1
  560. package/build-types/dropdown-menu-v2/checkbox-item.d.ts +3 -0
  561. package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +1 -0
  562. package/build-types/dropdown-menu-v2/context.d.ts +6 -0
  563. package/build-types/dropdown-menu-v2/context.d.ts.map +1 -0
  564. package/build-types/dropdown-menu-v2/group-label.d.ts +3 -0
  565. package/build-types/dropdown-menu-v2/group-label.d.ts.map +1 -0
  566. package/build-types/dropdown-menu-v2/group.d.ts +3 -0
  567. package/build-types/dropdown-menu-v2/group.d.ts.map +1 -0
  568. package/build-types/dropdown-menu-v2/index.d.ts +39 -18
  569. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  570. package/build-types/dropdown-menu-v2/item-help-text.d.ts +6 -0
  571. package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +1 -0
  572. package/build-types/dropdown-menu-v2/item-label.d.ts +6 -0
  573. package/build-types/dropdown-menu-v2/item-label.d.ts.map +1 -0
  574. package/build-types/dropdown-menu-v2/item.d.ts +3 -0
  575. package/build-types/dropdown-menu-v2/item.d.ts.map +1 -0
  576. package/build-types/dropdown-menu-v2/radio-item.d.ts +3 -0
  577. package/build-types/dropdown-menu-v2/radio-item.d.ts.map +1 -0
  578. package/build-types/dropdown-menu-v2/separator.d.ts +3 -0
  579. package/build-types/dropdown-menu-v2/separator.d.ts.map +1 -0
  580. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +10 -10
  581. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  582. package/build-types/dropdown-menu-v2/styles.d.ts +14 -6
  583. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  584. package/build-types/dropdown-menu-v2/types.d.ts +6 -0
  585. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  586. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts +8 -0
  587. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +1 -0
  588. package/build-types/focal-point-picker/controls.d.ts +1 -1
  589. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  590. package/build-types/focal-point-picker/index.d.ts +1 -1
  591. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  592. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  593. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
  594. package/build-types/focal-point-picker/types.d.ts +2 -2
  595. package/build-types/focal-point-picker/types.d.ts.map +1 -1
  596. package/build-types/form-file-upload/types.d.ts +6 -0
  597. package/build-types/form-file-upload/types.d.ts.map +1 -1
  598. package/build-types/form-token-field/types.d.ts +1 -0
  599. package/build-types/form-token-field/types.d.ts.map +1 -1
  600. package/build-types/index.d.ts +4 -2
  601. package/build-types/index.d.ts.map +1 -1
  602. package/build-types/input-control/input-base.d.ts.map +1 -1
  603. package/build-types/input-control/input-prefix-wrapper.d.ts +2 -2
  604. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
  605. package/build-types/input-control/input-suffix-wrapper.d.ts +2 -2
  606. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
  607. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  608. package/build-types/input-control/stories/index.story.d.ts +9 -0
  609. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  610. package/build-types/input-control/styles/input-control-styles.d.ts +15 -9
  611. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  612. package/build-types/input-control/types.d.ts +23 -6
  613. package/build-types/input-control/types.d.ts.map +1 -1
  614. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  615. package/build-types/navigator/index.d.ts +6 -6
  616. package/build-types/navigator/index.d.ts.map +1 -1
  617. package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
  618. package/build-types/navigator/navigator-back-button/hook.d.ts +2 -2
  619. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  620. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  621. package/build-types/navigator/navigator-to-parent-button/component.d.ts +6 -0
  622. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  623. package/build-types/navigator/stories/index.story.d.ts +1 -1
  624. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  625. package/build-types/navigator/types.d.ts +47 -9
  626. package/build-types/navigator/types.d.ts.map +1 -1
  627. package/build-types/navigator/use-navigator.d.ts +1 -2
  628. package/build-types/navigator/use-navigator.d.ts.map +1 -1
  629. package/build-types/popover/index.d.ts +1 -1
  630. package/build-types/popover/index.d.ts.map +1 -1
  631. package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
  632. package/build-types/private-apis.d.ts.map +1 -1
  633. package/build-types/query-controls/index.d.ts +1 -1
  634. package/build-types/query-controls/index.d.ts.map +1 -1
  635. package/build-types/query-controls/types.d.ts +2 -1
  636. package/build-types/query-controls/types.d.ts.map +1 -1
  637. package/build-types/radio-control/index.d.ts.map +1 -1
  638. package/build-types/radio-group/radio.d.ts.map +1 -1
  639. package/build-types/range-control/index.d.ts.map +1 -1
  640. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  641. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  642. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  643. package/build-types/search-control/index.d.ts.map +1 -1
  644. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  645. package/build-types/select-control/index.d.ts.map +1 -1
  646. package/build-types/select-control/stories/index.story.d.ts +4 -2
  647. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  648. package/build-types/select-control/styles/select-control-styles.d.ts +1 -1
  649. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  650. package/build-types/tab-panel/index.d.ts.map +1 -1
  651. package/build-types/tabs/index.d.ts.map +1 -1
  652. package/build-types/tabs/styles.d.ts.map +1 -1
  653. package/build-types/tabs/tablist.d.ts.map +1 -1
  654. package/build-types/tabs/tabpanel.d.ts +0 -3
  655. package/build-types/tabs/tabpanel.d.ts.map +1 -1
  656. package/build-types/text-control/index.d.ts.map +1 -1
  657. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  658. package/build-types/textarea-control/index.d.ts.map +1 -1
  659. package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -1
  660. package/build-types/toggle-control/index.d.ts.map +1 -1
  661. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  662. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  663. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  664. package/build-types/tooltip/index.d.ts.map +1 -1
  665. package/build-types/tree-select/index.d.ts.map +1 -1
  666. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  667. package/build-types/utils/config-values.d.ts +7 -6
  668. package/package.json +20 -20
  669. package/src/alignment-matrix-control/README.md +1 -5
  670. package/src/alignment-matrix-control/cell.tsx +6 -12
  671. package/src/alignment-matrix-control/icon.tsx +48 -30
  672. package/src/alignment-matrix-control/index.tsx +61 -50
  673. package/src/alignment-matrix-control/stories/index.story.tsx +3 -12
  674. package/src/alignment-matrix-control/styles.ts +113 -0
  675. package/src/alignment-matrix-control/types.ts +12 -1
  676. package/src/angle-picker-control/angle-circle.tsx +11 -9
  677. package/src/angle-picker-control/styles/angle-picker-control-styles.tsx +2 -2
  678. package/src/base-control/README.md +5 -2
  679. package/src/base-control/index.tsx +61 -41
  680. package/src/base-control/types.ts +7 -0
  681. package/src/border-box-control/border-box-control/README.md +7 -0
  682. package/src/border-control/border-control/README.md +7 -0
  683. package/src/border-control/border-control/component.tsx +23 -16
  684. package/src/border-control/styles.ts +1 -1
  685. package/src/button/README.md +7 -0
  686. package/src/button/style.scss +2 -2
  687. package/src/button-group/style.scss +2 -2
  688. package/src/checkbox-control/index.tsx +1 -0
  689. package/src/checkbox-control/stories/index.story.tsx +1 -0
  690. package/src/checkbox-control/test/index.tsx +8 -1
  691. package/src/circular-option-picker/circular-option-picker-option.tsx +19 -20
  692. package/src/circular-option-picker/circular-option-picker.tsx +26 -12
  693. package/src/circular-option-picker/style.scss +3 -3
  694. package/src/circular-option-picker/types.ts +2 -3
  695. package/src/clipboard-button/index.tsx +6 -6
  696. package/src/color-indicator/style.scss +1 -1
  697. package/src/color-palette/style.scss +2 -2
  698. package/src/color-palette/test/utils.ts +21 -2
  699. package/src/color-palette/utils.ts +22 -11
  700. package/src/color-picker/color-copy-button.tsx +10 -8
  701. package/src/color-picker/hex-input.tsx +6 -10
  702. package/src/color-picker/input-with-slider.tsx +7 -10
  703. package/src/color-picker/styles.ts +1 -1
  704. package/src/combobox-control/README.md +8 -0
  705. package/src/combobox-control/index.tsx +1 -0
  706. package/src/combobox-control/stories/index.story.tsx +3 -4
  707. package/src/combobox-control/test/index.tsx +5 -1
  708. package/src/combobox-control/types.ts +1 -0
  709. package/src/composite/README.md +325 -0
  710. package/src/composite/context.ts +14 -0
  711. package/src/composite/group-label.tsx +30 -0
  712. package/src/composite/group.tsx +30 -0
  713. package/src/composite/hover.tsx +30 -0
  714. package/src/composite/index.tsx +257 -0
  715. package/src/composite/item.tsx +30 -0
  716. package/src/composite/legacy/index.tsx +16 -14
  717. package/src/composite/legacy/stories/utils.tsx +19 -0
  718. package/src/composite/row.tsx +30 -0
  719. package/src/composite/store.ts +46 -0
  720. package/src/composite/stories/index.story.tsx +339 -0
  721. package/src/composite/{current/stories → stories}/utils.tsx +22 -7
  722. package/src/composite/typeahead.tsx +30 -0
  723. package/src/composite/types.ts +298 -0
  724. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +10 -10
  725. package/src/custom-gradient-picker/style.scss +3 -22
  726. package/src/custom-select-control/README.md +7 -0
  727. package/src/custom-select-control/test/index.tsx +125 -0
  728. package/src/custom-select-control/types.ts +3 -3
  729. package/src/custom-select-control-v2/custom-select.tsx +2 -1
  730. package/src/custom-select-control-v2/styles.ts +4 -4
  731. package/src/date-time/date/styles.ts +2 -2
  732. package/src/date-time/time/index.tsx +26 -12
  733. package/src/date-time/time/test/index.tsx +3 -6
  734. package/src/date-time/time/time-input/index.tsx +25 -25
  735. package/src/date-time/time/time-input/test/index.tsx +6 -7
  736. package/src/date-time/types.ts +11 -1
  737. package/src/dimension-control/README.md +21 -0
  738. package/src/dimension-control/index.tsx +33 -10
  739. package/src/dimension-control/stories/index.story.tsx +8 -2
  740. package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -32
  741. package/src/dimension-control/test/index.test.js +6 -1
  742. package/src/dimension-control/types.ts +5 -7
  743. package/src/draggable/index.tsx +4 -4
  744. package/src/drop-zone/style.scss +1 -1
  745. package/src/dropdown-menu-v2/README.md +73 -60
  746. package/src/dropdown-menu-v2/checkbox-item.tsx +63 -0
  747. package/src/dropdown-menu-v2/context.tsx +13 -0
  748. package/src/dropdown-menu-v2/group-label.tsx +37 -0
  749. package/src/dropdown-menu-v2/group.tsx +26 -0
  750. package/src/dropdown-menu-v2/index.tsx +61 -199
  751. package/src/dropdown-menu-v2/item-help-text.tsx +23 -0
  752. package/src/dropdown-menu-v2/item-label.tsx +23 -0
  753. package/src/dropdown-menu-v2/item.tsx +50 -0
  754. package/src/dropdown-menu-v2/radio-item.tsx +70 -0
  755. package/src/dropdown-menu-v2/separator.tsx +27 -0
  756. package/src/dropdown-menu-v2/stories/index.story.tsx +295 -262
  757. package/src/dropdown-menu-v2/styles.ts +118 -80
  758. package/src/dropdown-menu-v2/test/index.tsx +159 -132
  759. package/src/dropdown-menu-v2/types.ts +7 -0
  760. package/src/dropdown-menu-v2/use-temporary-focus-visible-fix.ts +22 -0
  761. package/src/focal-point-picker/README.md +9 -1
  762. package/src/focal-point-picker/controls.tsx +1 -3
  763. package/src/focal-point-picker/index.tsx +1 -2
  764. package/src/focal-point-picker/stories/index.story.tsx +3 -0
  765. package/src/focal-point-picker/styles/focal-point-picker-style.ts +1 -1
  766. package/src/focal-point-picker/styles/focal-point-style.ts +6 -1
  767. package/src/focal-point-picker/test/index.tsx +5 -1
  768. package/src/focal-point-picker/types.ts +2 -2
  769. package/src/font-size-picker/README.md +7 -0
  770. package/src/form-file-upload/README.md +8 -0
  771. package/src/form-file-upload/types.ts +6 -0
  772. package/src/form-toggle/style.scss +1 -1
  773. package/src/form-token-field/README.md +1 -0
  774. package/src/form-token-field/style.scss +2 -3
  775. package/src/form-token-field/types.ts +1 -0
  776. package/src/guide/style.scss +0 -1
  777. package/src/index.ts +6 -2
  778. package/src/input-control/README.md +8 -0
  779. package/src/input-control/index.tsx +2 -2
  780. package/src/input-control/input-base.tsx +4 -14
  781. package/src/input-control/input-prefix-wrapper.tsx +8 -4
  782. package/src/input-control/input-suffix-wrapper.tsx +4 -6
  783. package/src/input-control/reducer/reducer.ts +13 -10
  784. package/src/input-control/stories/index.story.tsx +31 -12
  785. package/src/input-control/styles/input-control-styles.tsx +42 -11
  786. package/src/input-control/types.ts +23 -7
  787. package/src/input-control/utils.ts +3 -3
  788. package/src/item-group/styles.ts +4 -4
  789. package/src/item-group/test/__snapshots__/index.js.snap +3 -3
  790. package/src/mobile/utils/alignments.native.js +1 -0
  791. package/src/modal/index.tsx +5 -5
  792. package/src/modal/style.scss +8 -7
  793. package/src/navigation/index.tsx +4 -4
  794. package/src/navigation/styles/navigation-styles.tsx +3 -3
  795. package/src/navigator/index.ts +6 -6
  796. package/src/navigator/navigator-back-button/component.tsx +1 -1
  797. package/src/navigator/navigator-back-button/hook.ts +7 -11
  798. package/src/navigator/navigator-button/hook.ts +1 -1
  799. package/src/navigator/navigator-provider/README.md +37 -36
  800. package/src/navigator/navigator-provider/component.tsx +110 -89
  801. package/src/navigator/navigator-screen/README.md +13 -1
  802. package/src/navigator/navigator-to-parent-button/README.md +2 -0
  803. package/src/navigator/navigator-to-parent-button/component.tsx +14 -43
  804. package/src/navigator/stories/index.story.tsx +82 -253
  805. package/src/navigator/test/index.tsx +136 -6
  806. package/src/navigator/types.ts +47 -10
  807. package/src/navigator/use-navigator.ts +1 -3
  808. package/src/number-control/README.md +8 -0
  809. package/src/palette-edit/index.tsx +2 -2
  810. package/src/palette-edit/styles.ts +5 -5
  811. package/src/placeholder/style.scss +4 -1
  812. package/src/popover/index.tsx +9 -3
  813. package/src/popover/style.scss +2 -2
  814. package/src/popover/test/index.tsx +34 -0
  815. package/src/private-apis.ts +10 -29
  816. package/src/progress-bar/styles.ts +2 -2
  817. package/src/query-controls/README.md +7 -0
  818. package/src/query-controls/index.tsx +5 -6
  819. package/src/query-controls/types.ts +2 -1
  820. package/src/radio-control/index.tsx +28 -20
  821. package/src/radio-control/style.scss +13 -2
  822. package/src/radio-control/test/index.tsx +43 -40
  823. package/src/radio-group/radio.tsx +2 -1
  824. package/src/range-control/README.md +7 -0
  825. package/src/range-control/index.tsx +39 -9
  826. package/src/range-control/stories/index.story.tsx +7 -0
  827. package/src/range-control/styles/range-control-styles.ts +9 -9
  828. package/src/range-control/test/index.tsx +54 -14
  829. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +2 -2
  830. package/src/resizable-box/style.scss +2 -2
  831. package/src/search-control/index.tsx +7 -4
  832. package/src/search-control/stories/index.story.tsx +1 -0
  833. package/src/search-control/test/index.tsx +1 -0
  834. package/src/select-control/README.md +8 -0
  835. package/src/select-control/index.tsx +1 -0
  836. package/src/select-control/stories/index.story.tsx +8 -5
  837. package/src/select-control/styles/select-control-styles.ts +5 -5
  838. package/src/select-control/test/select-control.tsx +12 -6
  839. package/src/slot-fill/bubbles-virtually/fill.tsx +4 -4
  840. package/src/snackbar/index.tsx +4 -4
  841. package/src/snackbar/style.scss +2 -2
  842. package/src/tab-panel/index.tsx +4 -1
  843. package/src/tab-panel/style.scss +1 -2
  844. package/src/tabs/index.tsx +10 -5
  845. package/src/tabs/styles.ts +2 -3
  846. package/src/tabs/tablist.tsx +6 -4
  847. package/src/tabs/tabpanel.tsx +6 -2
  848. package/src/text/styles.ts +1 -1
  849. package/src/text-control/README.md +8 -0
  850. package/src/text-control/index.tsx +1 -0
  851. package/src/text-control/stories/index.story.tsx +3 -1
  852. package/src/text-control/style.scss +3 -2
  853. package/src/text-control/test/text-control.tsx +5 -1
  854. package/src/textarea-control/index.tsx +1 -0
  855. package/src/textarea-control/stories/index.story.tsx +2 -0
  856. package/src/textarea-control/styles/textarea-control-styles.ts +75 -2
  857. package/src/toggle-control/index.tsx +9 -0
  858. package/src/toggle-control/stories/index.story.tsx +1 -0
  859. package/src/toggle-control/test/index.tsx +7 -1
  860. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +8 -24
  861. package/src/toggle-group-control/test/index.tsx +5 -1
  862. package/src/toggle-group-control/toggle-group-control/README.md +7 -0
  863. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +2 -1
  864. package/src/toggle-group-control/toggle-group-control/component.tsx +1 -0
  865. package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
  866. package/src/toggle-group-control/toggle-group-control/utils.ts +7 -7
  867. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +2 -2
  868. package/src/toolbar/toolbar/style.scss +2 -2
  869. package/src/tools-panel/styles.ts +1 -1
  870. package/src/tools-panel/tools-panel/hook.ts +6 -6
  871. package/src/tooltip/index.tsx +2 -1
  872. package/src/tooltip/style.scss +1 -1
  873. package/src/tree-select/index.tsx +16 -5
  874. package/src/tree-select/stories/index.story.tsx +1 -0
  875. package/src/unit-control/README.md +7 -0
  876. package/src/unit-control/styles/unit-control-styles.ts +3 -2
  877. package/src/utils/config-values.js +10 -7
  878. package/src/utils/hooks/use-update-effect.js +4 -4
  879. package/tsconfig.tsbuildinfo +1 -1
  880. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -66
  881. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  882. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -86
  883. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  884. package/build/composite/current/index.js +0 -43
  885. package/build/composite/current/index.js.map +0 -1
  886. package/build/composite/v2.js +0 -17
  887. package/build/composite/v2.js.map +0 -1
  888. package/build/navigator/navigator-back-button/index.js +0 -14
  889. package/build/navigator/navigator-back-button/index.js.map +0 -1
  890. package/build/navigator/navigator-button/index.js +0 -14
  891. package/build/navigator/navigator-button/index.js.map +0 -1
  892. package/build/navigator/navigator-provider/index.js +0 -14
  893. package/build/navigator/navigator-provider/index.js.map +0 -1
  894. package/build/navigator/navigator-screen/index.js +0 -14
  895. package/build/navigator/navigator-screen/index.js.map +0 -1
  896. package/build/navigator/navigator-to-parent-button/index.js +0 -14
  897. package/build/navigator/navigator-to-parent-button/index.js.map +0 -1
  898. package/build/utils/input/base.js +0 -20
  899. package/build/utils/input/base.js.map +0 -1
  900. package/build/utils/input/index.js +0 -17
  901. package/build/utils/input/index.js.map +0 -1
  902. package/build/utils/input/input-control.js +0 -21
  903. package/build/utils/input/input-control.js.map +0 -1
  904. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +0 -63
  905. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +0 -1
  906. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +0 -81
  907. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +0 -1
  908. package/build-module/composite/current/index.js +0 -12
  909. package/build-module/composite/current/index.js.map +0 -1
  910. package/build-module/composite/v2.js +0 -5
  911. package/build-module/composite/v2.js.map +0 -1
  912. package/build-module/navigator/navigator-back-button/index.js +0 -2
  913. package/build-module/navigator/navigator-back-button/index.js.map +0 -1
  914. package/build-module/navigator/navigator-button/index.js +0 -2
  915. package/build-module/navigator/navigator-button/index.js.map +0 -1
  916. package/build-module/navigator/navigator-provider/index.js +0 -2
  917. package/build-module/navigator/navigator-provider/index.js.map +0 -1
  918. package/build-module/navigator/navigator-screen/index.js +0 -2
  919. package/build-module/navigator/navigator-screen/index.js.map +0 -1
  920. package/build-module/navigator/navigator-to-parent-button/index.js +0 -2
  921. package/build-module/navigator/navigator-to-parent-button/index.js.map +0 -1
  922. package/build-module/utils/input/base.js +0 -13
  923. package/build-module/utils/input/base.js.map +0 -1
  924. package/build-module/utils/input/index.js +0 -2
  925. package/build-module/utils/input/index.js.map +0 -1
  926. package/build-module/utils/input/input-control.js +0 -14
  927. package/build-module/utils/input/input-control.js.map +0 -1
  928. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +0 -18
  929. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +0 -1
  930. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +0 -1
  931. package/build-types/composite/current/index.d.ts +0 -12
  932. package/build-types/composite/current/index.d.ts.map +0 -1
  933. package/build-types/composite/current/stories/index.story.d.ts +0 -13
  934. package/build-types/composite/current/stories/index.story.d.ts.map +0 -1
  935. package/build-types/composite/current/stories/utils.d.ts +0 -14
  936. package/build-types/composite/current/stories/utils.d.ts.map +0 -1
  937. package/build-types/composite/v2.d.ts +0 -2
  938. package/build-types/composite/v2.d.ts.map +0 -1
  939. package/build-types/navigator/navigator-back-button/index.d.ts +0 -2
  940. package/build-types/navigator/navigator-back-button/index.d.ts.map +0 -1
  941. package/build-types/navigator/navigator-button/index.d.ts +0 -2
  942. package/build-types/navigator/navigator-button/index.d.ts.map +0 -1
  943. package/build-types/navigator/navigator-provider/index.d.ts +0 -2
  944. package/build-types/navigator/navigator-provider/index.d.ts.map +0 -1
  945. package/build-types/navigator/navigator-screen/index.d.ts +0 -2
  946. package/build-types/navigator/navigator-screen/index.d.ts.map +0 -1
  947. package/build-types/navigator/navigator-to-parent-button/index.d.ts +0 -2
  948. package/build-types/navigator/navigator-to-parent-button/index.d.ts.map +0 -1
  949. package/build-types/utils/input/base.d.ts +0 -3
  950. package/build-types/utils/input/base.d.ts.map +0 -1
  951. package/build-types/utils/input/index.d.ts +0 -2
  952. package/build-types/utils/input/index.d.ts.map +0 -1
  953. package/build-types/utils/input/input-control.d.ts +0 -2
  954. package/build-types/utils/input/input-control.d.ts.map +0 -1
  955. package/src/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.ts +0 -77
  956. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +0 -102
  957. package/src/composite/current/index.ts +0 -20
  958. package/src/composite/current/stories/index.story.tsx +0 -86
  959. package/src/composite/index.ts +0 -7
  960. package/src/composite/v2.ts +0 -4
  961. package/src/navigator/navigator-back-button/index.ts +0 -1
  962. package/src/navigator/navigator-button/index.ts +0 -1
  963. package/src/navigator/navigator-provider/index.ts +0 -1
  964. package/src/navigator/navigator-screen/index.ts +0 -1
  965. package/src/navigator/navigator-to-parent-button/index.ts +0 -1
  966. package/src/utils/input/base.js +0 -30
  967. package/src/utils/input/index.js +0 -1
  968. package/src/utils/input/input-control.js +0 -63
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","useContextSystem","Button","useNavigator","useNavigatorBackButton","props","onClick","as","goToParent","goToParentProp","otherProps","goBack","handleClick","e","preventDefault"],"sources":["@wordpress/components/src/navigator/navigator-back-button/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport Button from '../../button';\nimport useNavigator from '../use-navigator';\nimport type { NavigatorBackButtonHookProps } from '../types';\n\nexport function useNavigatorBackButton(\n\tprops: WordPressComponentProps< NavigatorBackButtonHookProps, 'button' >\n) {\n\tconst {\n\t\tonClick,\n\t\tas = Button,\n\t\tgoToParent: goToParentProp = false,\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorBackButton' );\n\n\tconst { goBack, goToParent } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tif ( goToParentProp ) {\n\t\t\t\t\tgoToParent();\n\t\t\t\t} else {\n\t\t\t\t\tgoBack();\n\t\t\t\t}\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goToParentProp, goToParent, goBack, onClick ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;;AAEA,SAASC,gBAAgB,QAAQ,eAAe;AAChD,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,YAAY,MAAM,kBAAkB;AAG3C,OAAO,SAASC,sBAAsBA,CACrCC,KAAwE,EACvE;EACD,MAAM;IACLC,OAAO;IACPC,EAAE,GAAGL,MAAM;IACXM,UAAU,EAAEC,cAAc,GAAG,KAAK;IAClC,GAAGC;EACJ,CAAC,GAAGT,gBAAgB,CAAEI,KAAK,EAAE,qBAAsB,CAAC;EAEpD,MAAM;IAAEM,MAAM;IAAEH;EAAW,CAAC,GAAGL,YAAY,CAAC,CAAC;EAC7C,MAAMS,WAAyD,GAC9DZ,WAAW,CACRa,CAAC,IAAM;IACRA,CAAC,CAACC,cAAc,CAAC,CAAC;IAClB,IAAKL,cAAc,EAAG;MACrBD,UAAU,CAAC,CAAC;IACb,CAAC,MAAM;MACNG,MAAM,CAAC,CAAC;IACT;IACAL,OAAO,GAAIO,CAAE,CAAC;EACf,CAAC,EACD,CAAEJ,cAAc,EAAED,UAAU,EAAEG,MAAM,EAAEL,OAAO,CAC9C,CAAC;EAEF,OAAO;IACNC,EAAE;IACFD,OAAO,EAAEM,WAAW;IACpB,GAAGF;EACJ,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","useContextSystem","Button","useNavigator","useNavigatorBackButton","props","onClick","as","otherProps","goBack","handleClick","e","preventDefault"],"sources":["@wordpress/components/src/navigator/navigator-back-button/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport Button from '../../button';\nimport { useNavigator } from '../use-navigator';\nimport type { NavigatorBackButtonProps } from '../types';\n\nexport function useNavigatorBackButton(\n\tprops: WordPressComponentProps< NavigatorBackButtonProps, 'button' >\n) {\n\tconst {\n\t\tonClick,\n\t\tas = Button,\n\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorBackButton' );\n\n\tconst { goBack } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tgoBack();\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goBack, onClick ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;;AAEA,SAASC,gBAAgB,QAAQ,eAAe;AAChD,OAAOC,MAAM,MAAM,cAAc;AACjC,SAASC,YAAY,QAAQ,kBAAkB;AAG/C,OAAO,SAASC,sBAAsBA,CACrCC,KAAoE,EACnE;EACD,MAAM;IACLC,OAAO;IACPC,EAAE,GAAGL,MAAM;IAEX,GAAGM;EACJ,CAAC,GAAGP,gBAAgB,CAAEI,KAAK,EAAE,qBAAsB,CAAC;EAEpD,MAAM;IAAEI;EAAO,CAAC,GAAGN,YAAY,CAAC,CAAC;EACjC,MAAMO,WAAyD,GAC9DV,WAAW,CACRW,CAAC,IAAM;IACRA,CAAC,CAACC,cAAc,CAAC,CAAC;IAClBH,MAAM,CAAC,CAAC;IACRH,OAAO,GAAIK,CAAE,CAAC;EACf,CAAC,EACD,CAAEF,MAAM,EAAEH,OAAO,CAClB,CAAC;EAEF,OAAO;IACNC,EAAE;IACFD,OAAO,EAAEI,WAAW;IACpB,GAAGF;EACJ,CAAC;AACF","ignoreList":[]}
@@ -10,7 +10,7 @@ import { escapeAttribute } from '@wordpress/escape-html';
10
10
 
11
11
  import { useContextSystem } from '../../context';
12
12
  import Button from '../../button';
13
- import useNavigator from '../use-navigator';
13
+ import { useNavigator } from '../use-navigator';
14
14
  const cssSelectorForAttribute = (attrName, attrValue) => `[${attrName}="${attrValue}"]`;
15
15
  export function useNavigatorButton(props) {
16
16
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["useCallback","escapeAttribute","useContextSystem","Button","useNavigator","cssSelectorForAttribute","attrName","attrValue","useNavigatorButton","props","path","onClick","as","attributeName","otherProps","escapedPath","goTo","handleClick","e","preventDefault","focusTargetSelector"],"sources":["@wordpress/components/src/navigator/navigator-button/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport Button from '../../button';\nimport useNavigator from '../use-navigator';\nimport type { NavigatorButtonProps } from '../types';\n\nconst cssSelectorForAttribute = ( attrName: string, attrValue: string ) =>\n\t`[${ attrName }=\"${ attrValue }\"]`;\n\nexport function useNavigatorButton(\n\tprops: WordPressComponentProps< NavigatorButtonProps, 'button' >\n) {\n\tconst {\n\t\tpath,\n\t\tonClick,\n\t\tas = Button,\n\t\tattributeName = 'id',\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorButton' );\n\n\tconst escapedPath = escapeAttribute( path );\n\n\tconst { goTo } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tgoTo( escapedPath, {\n\t\t\t\t\tfocusTargetSelector: cssSelectorForAttribute(\n\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\tescapedPath\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goTo, onClick, attributeName, escapedPath ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t\t[ attributeName ]: escapedPath,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,oBAAoB;AAChD,SAASC,eAAe,QAAQ,wBAAwB;;AAExD;AACA;AACA;;AAEA,SAASC,gBAAgB,QAAQ,eAAe;AAChD,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,YAAY,MAAM,kBAAkB;AAG3C,MAAMC,uBAAuB,GAAGA,CAAEC,QAAgB,EAAEC,SAAiB,KACnE,IAAID,QAAU,KAAKC,SAAW,IAAG;AAEnC,OAAO,SAASC,kBAAkBA,CACjCC,KAAgE,EAC/D;EACD,MAAM;IACLC,IAAI;IACJC,OAAO;IACPC,EAAE,GAAGT,MAAM;IACXU,aAAa,GAAG,IAAI;IACpB,GAAGC;EACJ,CAAC,GAAGZ,gBAAgB,CAAEO,KAAK,EAAE,iBAAkB,CAAC;EAEhD,MAAMM,WAAW,GAAGd,eAAe,CAAES,IAAK,CAAC;EAE3C,MAAM;IAAEM;EAAK,CAAC,GAAGZ,YAAY,CAAC,CAAC;EAC/B,MAAMa,WAAyD,GAC9DjB,WAAW,CACRkB,CAAC,IAAM;IACRA,CAAC,CAACC,cAAc,CAAC,CAAC;IAClBH,IAAI,CAAED,WAAW,EAAE;MAClBK,mBAAmB,EAAEf,uBAAuB,CAC3CQ,aAAa,EACbE,WACD;IACD,CAAE,CAAC;IACHJ,OAAO,GAAIO,CAAE,CAAC;EACf,CAAC,EACD,CAAEF,IAAI,EAAEL,OAAO,EAAEE,aAAa,EAAEE,WAAW,CAC5C,CAAC;EAEF,OAAO;IACNH,EAAE;IACFD,OAAO,EAAEM,WAAW;IACpB,GAAGH,UAAU;IACb,CAAED,aAAa,GAAIE;EACpB,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","escapeAttribute","useContextSystem","Button","useNavigator","cssSelectorForAttribute","attrName","attrValue","useNavigatorButton","props","path","onClick","as","attributeName","otherProps","escapedPath","goTo","handleClick","e","preventDefault","focusTargetSelector"],"sources":["@wordpress/components/src/navigator/navigator-button/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { escapeAttribute } from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport Button from '../../button';\nimport { useNavigator } from '../use-navigator';\nimport type { NavigatorButtonProps } from '../types';\n\nconst cssSelectorForAttribute = ( attrName: string, attrValue: string ) =>\n\t`[${ attrName }=\"${ attrValue }\"]`;\n\nexport function useNavigatorButton(\n\tprops: WordPressComponentProps< NavigatorButtonProps, 'button' >\n) {\n\tconst {\n\t\tpath,\n\t\tonClick,\n\t\tas = Button,\n\t\tattributeName = 'id',\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorButton' );\n\n\tconst escapedPath = escapeAttribute( path );\n\n\tconst { goTo } = useNavigator();\n\tconst handleClick: React.MouseEventHandler< HTMLButtonElement > =\n\t\tuseCallback(\n\t\t\t( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tgoTo( escapedPath, {\n\t\t\t\t\tfocusTargetSelector: cssSelectorForAttribute(\n\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\tescapedPath\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t\tonClick?.( e );\n\t\t\t},\n\t\t\t[ goTo, onClick, attributeName, escapedPath ]\n\t\t);\n\n\treturn {\n\t\tas,\n\t\tonClick: handleClick,\n\t\t...otherProps,\n\t\t[ attributeName ]: escapedPath,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,oBAAoB;AAChD,SAASC,eAAe,QAAQ,wBAAwB;;AAExD;AACA;AACA;;AAEA,SAASC,gBAAgB,QAAQ,eAAe;AAChD,OAAOC,MAAM,MAAM,cAAc;AACjC,SAASC,YAAY,QAAQ,kBAAkB;AAG/C,MAAMC,uBAAuB,GAAGA,CAAEC,QAAgB,EAAEC,SAAiB,KACnE,IAAID,QAAU,KAAKC,SAAW,IAAG;AAEnC,OAAO,SAASC,kBAAkBA,CACjCC,KAAgE,EAC/D;EACD,MAAM;IACLC,IAAI;IACJC,OAAO;IACPC,EAAE,GAAGT,MAAM;IACXU,aAAa,GAAG,IAAI;IACpB,GAAGC;EACJ,CAAC,GAAGZ,gBAAgB,CAAEO,KAAK,EAAE,iBAAkB,CAAC;EAEhD,MAAMM,WAAW,GAAGd,eAAe,CAAES,IAAK,CAAC;EAE3C,MAAM;IAAEM;EAAK,CAAC,GAAGZ,YAAY,CAAC,CAAC;EAC/B,MAAMa,WAAyD,GAC9DjB,WAAW,CACRkB,CAAC,IAAM;IACRA,CAAC,CAACC,cAAc,CAAC,CAAC;IAClBH,IAAI,CAAED,WAAW,EAAE;MAClBK,mBAAmB,EAAEf,uBAAuB,CAC3CQ,aAAa,EACbE,WACD;IACD,CAAE,CAAC;IACHJ,OAAO,GAAIO,CAAE,CAAC;EACf,CAAC,EACD,CAAEF,IAAI,EAAEL,OAAO,EAAEE,aAAa,EAAEE,WAAW,CAC5C,CAAC;EAEF,OAAO;IACNH,EAAE;IACFD,OAAO,EAAEM,WAAW;IACpB,GAAGH,UAAU;IACb,CAAED,aAAa,GAAIE;EACpB,CAAC;AACF","ignoreList":[]}
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { useMemo, useReducer } from '@wordpress/element';
9
9
  import isShallowEqual from '@wordpress/is-shallow-equal';
10
+ import warning from '@wordpress/warning';
10
11
 
11
12
  /**
12
13
  * Internal dependencies
@@ -18,11 +19,16 @@ import { patternMatch, findParent } from '../utils/router';
18
19
  import { View } from '../../view';
19
20
  import { NavigatorContext } from '../context';
20
21
  import * as styles from '../styles';
22
+ import deprecated from '@wordpress/deprecated';
21
23
  import { jsx as _jsx } from "react/jsx-runtime";
22
- const MAX_HISTORY_LENGTH = 50;
23
24
  function addScreen({
24
25
  screens
25
26
  }, screen) {
27
+ if (screens.some(s => s.path === screen.path)) {
28
+ globalThis.SCRIPT_DEBUG === true ? warning(`Navigator: a screen with path ${screen.path} already exists.
29
+ The screen with id ${screen.id} will not be added.`) : void 0;
30
+ return screens;
31
+ }
26
32
  return [...screens, screen];
27
33
  }
28
34
  function removeScreen({
@@ -30,72 +36,89 @@ function removeScreen({
30
36
  }, screen) {
31
37
  return screens.filter(s => s.id !== screen.id);
32
38
  }
33
- function goBack({
34
- locationHistory
35
- }) {
36
- if (locationHistory.length <= 1) {
37
- return locationHistory;
38
- }
39
- return [...locationHistory.slice(0, -2), {
40
- ...locationHistory[locationHistory.length - 2],
41
- isBack: true,
42
- hasRestoredFocus: false
43
- }];
44
- }
45
39
  function goTo(state, path, options = {}) {
40
+ var _focusSelectorsCopy2;
46
41
  const {
47
- locationHistory
42
+ focusSelectors
48
43
  } = state;
44
+ const currentLocation = {
45
+ ...state.currentLocation,
46
+ isInitial: false
47
+ };
49
48
  const {
50
- focusTargetSelector,
49
+ // Default assignments
51
50
  isBack = false,
52
51
  skipFocus = false,
53
- replace = false,
52
+ // Extract to avoid forwarding
53
+ replace,
54
+ focusTargetSelector,
55
+ // Rest
54
56
  ...restOptions
55
57
  } = options;
56
- const isNavigatingToSamePath = locationHistory.length > 0 && locationHistory[locationHistory.length - 1].path === path;
57
- if (isNavigatingToSamePath) {
58
- return locationHistory;
58
+ if (currentLocation.path === path) {
59
+ return {
60
+ currentLocation,
61
+ focusSelectors
62
+ };
59
63
  }
60
- const isNavigatingToPreviousPath = isBack && locationHistory.length > 1 && locationHistory[locationHistory.length - 2].path === path;
61
- if (isNavigatingToPreviousPath) {
62
- return goBack(state);
64
+ let focusSelectorsCopy;
65
+ function getFocusSelectorsCopy() {
66
+ var _focusSelectorsCopy;
67
+ focusSelectorsCopy = (_focusSelectorsCopy = focusSelectorsCopy) !== null && _focusSelectorsCopy !== void 0 ? _focusSelectorsCopy : new Map(state.focusSelectors);
68
+ return focusSelectorsCopy;
63
69
  }
64
- const newLocation = {
65
- ...restOptions,
66
- path,
67
- isBack,
68
- hasRestoredFocus: false,
69
- skipFocus
70
- };
71
- if (locationHistory.length === 0) {
72
- return replace ? [] : [newLocation];
70
+
71
+ // Set a focus selector that will be used when navigating
72
+ // back to the current location.
73
+ if (focusTargetSelector && currentLocation.path) {
74
+ getFocusSelectorsCopy().set(currentLocation.path, focusTargetSelector);
73
75
  }
74
- const newLocationHistory = locationHistory.slice(locationHistory.length > MAX_HISTORY_LENGTH - 1 ? 1 : 0, -1);
75
- if (!replace) {
76
- newLocationHistory.push(
77
- // Assign `focusTargetSelector` to the previous location in history
78
- // (the one we just navigated from).
79
- {
80
- ...locationHistory[locationHistory.length - 1],
81
- focusTargetSelector
82
- });
76
+
77
+ // Get the focus selector for the new location.
78
+ let currentFocusSelector;
79
+ if (focusSelectors.get(path)) {
80
+ if (isBack) {
81
+ // Use the found focus selector only when navigating back.
82
+ currentFocusSelector = focusSelectors.get(path);
83
+ }
84
+ // Make a copy of the focusSelectors map to remove the focus selector
85
+ // only if necessary (ie. a focus selector was found).
86
+ getFocusSelectorsCopy().delete(path);
83
87
  }
84
- newLocationHistory.push(newLocation);
85
- return newLocationHistory;
88
+ return {
89
+ currentLocation: {
90
+ ...restOptions,
91
+ path,
92
+ isBack,
93
+ hasRestoredFocus: false,
94
+ focusTargetSelector: currentFocusSelector,
95
+ skipFocus
96
+ },
97
+ focusSelectors: (_focusSelectorsCopy2 = focusSelectorsCopy) !== null && _focusSelectorsCopy2 !== void 0 ? _focusSelectorsCopy2 : focusSelectors
98
+ };
86
99
  }
87
100
  function goToParent(state, options = {}) {
88
101
  const {
89
- locationHistory,
90
- screens
102
+ screens,
103
+ focusSelectors
91
104
  } = state;
92
- const currentPath = locationHistory[locationHistory.length - 1].path;
105
+ const currentLocation = {
106
+ ...state.currentLocation,
107
+ isInitial: false
108
+ };
109
+ const currentPath = currentLocation.path;
93
110
  if (currentPath === undefined) {
94
- return locationHistory;
111
+ return {
112
+ currentLocation,
113
+ focusSelectors
114
+ };
95
115
  }
96
116
  const parentPath = findParent(currentPath, screens);
97
117
  if (parentPath === undefined) {
98
- return locationHistory;
118
+ return {
119
+ currentLocation,
120
+ focusSelectors
121
+ };
99
122
  }
100
123
  return goTo(state, parentPath, {
101
124
  ...options,
@@ -105,8 +128,10 @@ function goToParent(state, options = {}) {
105
128
  function routerReducer(state, action) {
106
129
  let {
107
130
  screens,
108
- locationHistory,
109
- matchedPath
131
+ currentLocation,
132
+ matchedPath,
133
+ focusSelectors,
134
+ ...restState
110
135
  } = state;
111
136
  switch (action.type) {
112
137
  case 'add':
@@ -115,24 +140,27 @@ function routerReducer(state, action) {
115
140
  case 'remove':
116
141
  screens = removeScreen(state, action.screen);
117
142
  break;
118
- case 'goback':
119
- locationHistory = goBack(state);
120
- break;
121
143
  case 'goto':
122
- locationHistory = goTo(state, action.path, action.options);
144
+ ({
145
+ currentLocation,
146
+ focusSelectors
147
+ } = goTo(state, action.path, action.options));
123
148
  break;
124
149
  case 'gotoparent':
125
- locationHistory = goToParent(state, action.options);
150
+ ({
151
+ currentLocation,
152
+ focusSelectors
153
+ } = goToParent(state, action.options));
126
154
  break;
127
155
  }
128
156
 
129
157
  // Return early in case there is no change
130
- if (screens === state.screens && locationHistory === state.locationHistory) {
158
+ if (screens === state.screens && currentLocation === state.currentLocation) {
131
159
  return state;
132
160
  }
133
161
 
134
162
  // Compute the matchedPath
135
- const currentPath = locationHistory.length > 0 ? locationHistory[locationHistory.length - 1].path : undefined;
163
+ const currentPath = currentLocation.path;
136
164
  matchedPath = currentPath !== undefined ? patternMatch(currentPath, screens) : undefined;
137
165
 
138
166
  // If the new match is the same as the previous match,
@@ -141,40 +169,55 @@ function routerReducer(state, action) {
141
169
  matchedPath = state.matchedPath;
142
170
  }
143
171
  return {
172
+ ...restState,
144
173
  screens,
145
- locationHistory,
146
- matchedPath
174
+ currentLocation,
175
+ matchedPath,
176
+ focusSelectors
147
177
  };
148
178
  }
149
179
  function UnconnectedNavigatorProvider(props, forwardedRef) {
150
180
  const {
151
- initialPath,
181
+ initialPath: initialPathProp,
152
182
  children,
153
183
  className,
154
184
  ...otherProps
155
185
  } = useContextSystem(props, 'NavigatorProvider');
156
- const [routerState, dispatch] = useReducer(routerReducer, initialPath, path => ({
186
+ const [routerState, dispatch] = useReducer(routerReducer, initialPathProp, path => ({
157
187
  screens: [],
158
- locationHistory: [{
159
- path
160
- }],
161
- matchedPath: undefined
188
+ currentLocation: {
189
+ path,
190
+ isInitial: true
191
+ },
192
+ matchedPath: undefined,
193
+ focusSelectors: new Map(),
194
+ initialPath: initialPathProp
162
195
  }));
163
196
 
164
197
  // The methods are constant forever, create stable references to them.
165
198
  const methods = useMemo(() => ({
166
- goBack: () => dispatch({
167
- type: 'goback'
199
+ // Note: calling goBack calls `goToParent` internally, as it was established
200
+ // that `goBack` should behave like `goToParent`, and `goToParent` should
201
+ // be marked as deprecated.
202
+ goBack: options => dispatch({
203
+ type: 'gotoparent',
204
+ options
168
205
  }),
169
206
  goTo: (path, options) => dispatch({
170
207
  type: 'goto',
171
208
  path,
172
209
  options
173
210
  }),
174
- goToParent: options => dispatch({
175
- type: 'gotoparent',
176
- options
177
- }),
211
+ goToParent: options => {
212
+ deprecated(`wp.components.useNavigator().goToParent`, {
213
+ since: '6.7',
214
+ alternative: 'wp.components.useNavigator().goBack'
215
+ });
216
+ dispatch({
217
+ type: 'gotoparent',
218
+ options
219
+ });
220
+ },
178
221
  addScreen: screen => dispatch({
179
222
  type: 'add',
180
223
  screen
@@ -185,21 +228,18 @@ function UnconnectedNavigatorProvider(props, forwardedRef) {
185
228
  })
186
229
  }), []);
187
230
  const {
188
- locationHistory,
231
+ currentLocation,
189
232
  matchedPath
190
233
  } = routerState;
191
234
  const navigatorContextValue = useMemo(() => {
192
235
  var _matchedPath$params;
193
236
  return {
194
- location: {
195
- ...locationHistory[locationHistory.length - 1],
196
- isInitial: locationHistory.length === 1
197
- },
237
+ location: currentLocation,
198
238
  params: (_matchedPath$params = matchedPath?.params) !== null && _matchedPath$params !== void 0 ? _matchedPath$params : {},
199
239
  match: matchedPath?.id,
200
240
  ...methods
201
241
  };
202
- }, [locationHistory, matchedPath, methods]);
242
+ }, [currentLocation, matchedPath, methods]);
203
243
  const cx = useCx();
204
244
  const classes = useMemo(() => cx(styles.navigatorProviderWrapper, className), [className, cx]);
205
245
  return /*#__PURE__*/_jsx(View, {
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","useReducer","isShallowEqual","contextConnect","useContextSystem","useCx","patternMatch","findParent","View","NavigatorContext","styles","jsx","_jsx","MAX_HISTORY_LENGTH","addScreen","screens","screen","removeScreen","filter","s","id","goBack","locationHistory","length","slice","isBack","hasRestoredFocus","goTo","state","path","options","focusTargetSelector","skipFocus","replace","restOptions","isNavigatingToSamePath","isNavigatingToPreviousPath","newLocation","newLocationHistory","push","goToParent","currentPath","undefined","parentPath","routerReducer","action","matchedPath","type","params","UnconnectedNavigatorProvider","props","forwardedRef","initialPath","children","className","otherProps","routerState","dispatch","methods","navigatorContextValue","_matchedPath$params","location","isInitial","match","cx","classes","navigatorProviderWrapper","ref","Provider","value","NavigatorProvider"],"sources":["@wordpress/components/src/navigator/navigator-provider/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useReducer } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { patternMatch, findParent } from '../utils/router';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport * as styles from '../styles';\nimport type {\n\tNavigatorProviderProps,\n\tNavigatorLocation,\n\tNavigatorContext as NavigatorContextType,\n\tNavigateOptions,\n\tScreen,\n\tNavigateToParentOptions,\n} from '../types';\n\ntype MatchedPath = ReturnType< typeof patternMatch >;\n\ntype RouterAction =\n\t| { type: 'add' | 'remove'; screen: Screen }\n\t| { type: 'goback' }\n\t| { type: 'goto'; path: string; options?: NavigateOptions }\n\t| { type: 'gotoparent'; options?: NavigateToParentOptions };\n\ntype RouterState = {\n\tscreens: Screen[];\n\tlocationHistory: NavigatorLocation[];\n\tmatchedPath: MatchedPath;\n};\n\nconst MAX_HISTORY_LENGTH = 50;\n\nfunction addScreen( { screens }: RouterState, screen: Screen ) {\n\treturn [ ...screens, screen ];\n}\n\nfunction removeScreen( { screens }: RouterState, screen: Screen ) {\n\treturn screens.filter( ( s ) => s.id !== screen.id );\n}\n\nfunction goBack( { locationHistory }: RouterState ) {\n\tif ( locationHistory.length <= 1 ) {\n\t\treturn locationHistory;\n\t}\n\treturn [\n\t\t...locationHistory.slice( 0, -2 ),\n\t\t{\n\t\t\t...locationHistory[ locationHistory.length - 2 ],\n\t\t\tisBack: true,\n\t\t\thasRestoredFocus: false,\n\t\t},\n\t];\n}\n\nfunction goTo(\n\tstate: RouterState,\n\tpath: string,\n\toptions: NavigateOptions = {}\n) {\n\tconst { locationHistory } = state;\n\tconst {\n\t\tfocusTargetSelector,\n\t\tisBack = false,\n\t\tskipFocus = false,\n\t\treplace = false,\n\t\t...restOptions\n\t} = options;\n\n\tconst isNavigatingToSamePath =\n\t\tlocationHistory.length > 0 &&\n\t\tlocationHistory[ locationHistory.length - 1 ].path === path;\n\tif ( isNavigatingToSamePath ) {\n\t\treturn locationHistory;\n\t}\n\n\tconst isNavigatingToPreviousPath =\n\t\tisBack &&\n\t\tlocationHistory.length > 1 &&\n\t\tlocationHistory[ locationHistory.length - 2 ].path === path;\n\n\tif ( isNavigatingToPreviousPath ) {\n\t\treturn goBack( state );\n\t}\n\n\tconst newLocation = {\n\t\t...restOptions,\n\t\tpath,\n\t\tisBack,\n\t\thasRestoredFocus: false,\n\t\tskipFocus,\n\t};\n\n\tif ( locationHistory.length === 0 ) {\n\t\treturn replace ? [] : [ newLocation ];\n\t}\n\n\tconst newLocationHistory = locationHistory.slice(\n\t\tlocationHistory.length > MAX_HISTORY_LENGTH - 1 ? 1 : 0,\n\t\t-1\n\t);\n\n\tif ( ! replace ) {\n\t\tnewLocationHistory.push(\n\t\t\t// Assign `focusTargetSelector` to the previous location in history\n\t\t\t// (the one we just navigated from).\n\t\t\t{\n\t\t\t\t...locationHistory[ locationHistory.length - 1 ],\n\t\t\t\tfocusTargetSelector,\n\t\t\t}\n\t\t);\n\t}\n\n\tnewLocationHistory.push( newLocation );\n\n\treturn newLocationHistory;\n}\n\nfunction goToParent(\n\tstate: RouterState,\n\toptions: NavigateToParentOptions = {}\n) {\n\tconst { locationHistory, screens } = state;\n\tconst currentPath = locationHistory[ locationHistory.length - 1 ].path;\n\tif ( currentPath === undefined ) {\n\t\treturn locationHistory;\n\t}\n\tconst parentPath = findParent( currentPath, screens );\n\tif ( parentPath === undefined ) {\n\t\treturn locationHistory;\n\t}\n\treturn goTo( state, parentPath, {\n\t\t...options,\n\t\tisBack: true,\n\t} );\n}\n\nfunction routerReducer(\n\tstate: RouterState,\n\taction: RouterAction\n): RouterState {\n\tlet { screens, locationHistory, matchedPath } = state;\n\tswitch ( action.type ) {\n\t\tcase 'add':\n\t\t\tscreens = addScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'remove':\n\t\t\tscreens = removeScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'goback':\n\t\t\tlocationHistory = goBack( state );\n\t\t\tbreak;\n\t\tcase 'goto':\n\t\t\tlocationHistory = goTo( state, action.path, action.options );\n\t\t\tbreak;\n\t\tcase 'gotoparent':\n\t\t\tlocationHistory = goToParent( state, action.options );\n\t\t\tbreak;\n\t}\n\n\t// Return early in case there is no change\n\tif (\n\t\tscreens === state.screens &&\n\t\tlocationHistory === state.locationHistory\n\t) {\n\t\treturn state;\n\t}\n\n\t// Compute the matchedPath\n\tconst currentPath =\n\t\tlocationHistory.length > 0\n\t\t\t? locationHistory[ locationHistory.length - 1 ].path\n\t\t\t: undefined;\n\tmatchedPath =\n\t\tcurrentPath !== undefined\n\t\t\t? patternMatch( currentPath, screens )\n\t\t\t: undefined;\n\n\t// If the new match is the same as the previous match,\n\t// return the previous one to keep immutability.\n\tif (\n\t\tmatchedPath &&\n\t\tstate.matchedPath &&\n\t\tmatchedPath.id === state.matchedPath.id &&\n\t\tisShallowEqual( matchedPath.params, state.matchedPath.params )\n\t) {\n\t\tmatchedPath = state.matchedPath;\n\t}\n\n\treturn { screens, locationHistory, matchedPath };\n}\n\nfunction UnconnectedNavigatorProvider(\n\tprops: WordPressComponentProps< NavigatorProviderProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { initialPath, children, className, ...otherProps } =\n\t\tuseContextSystem( props, 'NavigatorProvider' );\n\n\tconst [ routerState, dispatch ] = useReducer(\n\t\trouterReducer,\n\t\tinitialPath,\n\t\t( path ) => ( {\n\t\t\tscreens: [],\n\t\t\tlocationHistory: [ { path } ],\n\t\t\tmatchedPath: undefined,\n\t\t} )\n\t);\n\n\t// The methods are constant forever, create stable references to them.\n\tconst methods = useMemo(\n\t\t() => ( {\n\t\t\tgoBack: () => dispatch( { type: 'goback' } ),\n\t\t\tgoTo: ( path: string, options?: NavigateOptions ) =>\n\t\t\t\tdispatch( { type: 'goto', path, options } ),\n\t\t\tgoToParent: ( options: NavigateToParentOptions | undefined ) =>\n\t\t\t\tdispatch( { type: 'gotoparent', options } ),\n\t\t\taddScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'add', screen } ),\n\t\t\tremoveScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'remove', screen } ),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { locationHistory, matchedPath } = routerState;\n\n\tconst navigatorContextValue: NavigatorContextType = useMemo(\n\t\t() => ( {\n\t\t\tlocation: {\n\t\t\t\t...locationHistory[ locationHistory.length - 1 ],\n\t\t\t\tisInitial: locationHistory.length === 1,\n\t\t\t},\n\t\t\tparams: matchedPath?.params ?? {},\n\t\t\tmatch: matchedPath?.id,\n\t\t\t...methods,\n\t\t} ),\n\t\t[ locationHistory, matchedPath, methods ]\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() => cx( styles.navigatorProviderWrapper, className ),\n\t\t[ className, cx ]\n\t);\n\n\treturn (\n\t\t<View ref={ forwardedRef } className={ classes } { ...otherProps }>\n\t\t\t<NavigatorContext.Provider value={ navigatorContextValue }>\n\t\t\t\t{ children }\n\t\t\t</NavigatorContext.Provider>\n\t\t</View>\n\t);\n}\n\n/**\n * The `NavigatorProvider` component allows rendering nested views/panels/menus\n * (via the `NavigatorScreen` component and navigate between these different\n * view (via the `NavigatorButton` and `NavigatorBackButton` components or the\n * `useNavigator` hook).\n *\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorProvider = contextConnect(\n\tUnconnectedNavigatorProvider,\n\t'NavigatorProvider'\n);\n\nexport default NavigatorProvider;\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,UAAU,QAAQ,oBAAoB;AACxD,OAAOC,cAAc,MAAM,6BAA6B;;AAExD;AACA;AACA;;AAEA,S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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMiB,iBAAiB,GAAGnE,cAAc,CAC9C8C,4BAA4B,EAC5B,mBACD,CAAC;AAED,eAAeqB,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["useMemo","useReducer","isShallowEqual","warning","contextConnect","useContextSystem","useCx","patternMatch","findParent","View","NavigatorContext","styles","deprecated","jsx","_jsx","addScreen","screens","screen","some","s","path","globalThis","SCRIPT_DEBUG","id","removeScreen","filter","goTo","state","options","_focusSelectorsCopy2","focusSelectors","currentLocation","isInitial","isBack","skipFocus","replace","focusTargetSelector","restOptions","focusSelectorsCopy","getFocusSelectorsCopy","_focusSelectorsCopy","Map","set","currentFocusSelector","get","delete","hasRestoredFocus","goToParent","currentPath","undefined","parentPath","routerReducer","action","matchedPath","restState","type","params","UnconnectedNavigatorProvider","props","forwardedRef","initialPath","initialPathProp","children","className","otherProps","routerState","dispatch","methods","goBack","since","alternative","navigatorContextValue","_matchedPath$params","location","match","cx","classes","navigatorProviderWrapper","ref","Provider","value","NavigatorProvider"],"sources":["@wordpress/components/src/navigator/navigator-provider/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useReducer } from '@wordpress/element';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport { patternMatch, findParent } from '../utils/router';\nimport { View } from '../../view';\nimport { NavigatorContext } from '../context';\nimport * as styles from '../styles';\nimport type {\n\tNavigatorProviderProps,\n\tNavigatorLocation,\n\tNavigatorContext as NavigatorContextType,\n\tNavigateOptions,\n\tScreen,\n\tNavigateToParentOptions,\n} from '../types';\nimport deprecated from '@wordpress/deprecated';\n\ntype MatchedPath = ReturnType< typeof patternMatch >;\n\ntype RouterAction =\n\t| { type: 'add' | 'remove'; screen: Screen }\n\t| { type: 'goto'; path: string; options?: NavigateOptions }\n\t| { type: 'gotoparent'; options?: NavigateToParentOptions };\n\ntype RouterState = {\n\tinitialPath: string;\n\tscreens: Screen[];\n\tcurrentLocation: NavigatorLocation;\n\tmatchedPath: MatchedPath;\n\tfocusSelectors: Map< string, string >;\n};\n\nfunction addScreen( { screens }: RouterState, screen: Screen ) {\n\tif ( screens.some( ( s ) => s.path === screen.path ) ) {\n\t\twarning(\n\t\t\t`Navigator: a screen with path ${ screen.path } already exists.\nThe screen with id ${ screen.id } will not be added.`\n\t\t);\n\t\treturn screens;\n\t}\n\treturn [ ...screens, screen ];\n}\n\nfunction removeScreen( { screens }: RouterState, screen: Screen ) {\n\treturn screens.filter( ( s ) => s.id !== screen.id );\n}\n\nfunction goTo(\n\tstate: RouterState,\n\tpath: string,\n\toptions: NavigateOptions = {}\n) {\n\tconst { focusSelectors } = state;\n\tconst currentLocation = { ...state.currentLocation, isInitial: false };\n\n\tconst {\n\t\t// Default assignments\n\t\tisBack = false,\n\t\tskipFocus = false,\n\t\t// Extract to avoid forwarding\n\t\treplace,\n\t\tfocusTargetSelector,\n\t\t// Rest\n\t\t...restOptions\n\t} = options;\n\n\tif ( currentLocation.path === path ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\n\tlet focusSelectorsCopy: typeof focusSelectors | undefined;\n\tfunction getFocusSelectorsCopy() {\n\t\tfocusSelectorsCopy =\n\t\t\tfocusSelectorsCopy ?? new Map( state.focusSelectors );\n\t\treturn focusSelectorsCopy;\n\t}\n\n\t// Set a focus selector that will be used when navigating\n\t// back to the current location.\n\tif ( focusTargetSelector && currentLocation.path ) {\n\t\tgetFocusSelectorsCopy().set(\n\t\t\tcurrentLocation.path,\n\t\t\tfocusTargetSelector\n\t\t);\n\t}\n\n\t// Get the focus selector for the new location.\n\tlet currentFocusSelector;\n\tif ( focusSelectors.get( path ) ) {\n\t\tif ( isBack ) {\n\t\t\t// Use the found focus selector only when navigating back.\n\t\t\tcurrentFocusSelector = focusSelectors.get( path );\n\t\t}\n\t\t// Make a copy of the focusSelectors map to remove the focus selector\n\t\t// only if necessary (ie. a focus selector was found).\n\t\tgetFocusSelectorsCopy().delete( path );\n\t}\n\n\treturn {\n\t\tcurrentLocation: {\n\t\t\t...restOptions,\n\t\t\tpath,\n\t\t\tisBack,\n\t\t\thasRestoredFocus: false,\n\t\t\tfocusTargetSelector: currentFocusSelector,\n\t\t\tskipFocus,\n\t\t},\n\t\tfocusSelectors: focusSelectorsCopy ?? focusSelectors,\n\t};\n}\n\nfunction goToParent(\n\tstate: RouterState,\n\toptions: NavigateToParentOptions = {}\n) {\n\tconst { screens, focusSelectors } = state;\n\tconst currentLocation = { ...state.currentLocation, isInitial: false };\n\tconst currentPath = currentLocation.path;\n\tif ( currentPath === undefined ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\tconst parentPath = findParent( currentPath, screens );\n\tif ( parentPath === undefined ) {\n\t\treturn { currentLocation, focusSelectors };\n\t}\n\treturn goTo( state, parentPath, {\n\t\t...options,\n\t\tisBack: true,\n\t} );\n}\n\nfunction routerReducer(\n\tstate: RouterState,\n\taction: RouterAction\n): RouterState {\n\tlet {\n\t\tscreens,\n\t\tcurrentLocation,\n\t\tmatchedPath,\n\t\tfocusSelectors,\n\t\t...restState\n\t} = state;\n\tswitch ( action.type ) {\n\t\tcase 'add':\n\t\t\tscreens = addScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'remove':\n\t\t\tscreens = removeScreen( state, action.screen );\n\t\t\tbreak;\n\t\tcase 'goto':\n\t\t\t( { currentLocation, focusSelectors } = goTo(\n\t\t\t\tstate,\n\t\t\t\taction.path,\n\t\t\t\taction.options\n\t\t\t) );\n\t\t\tbreak;\n\t\tcase 'gotoparent':\n\t\t\t( { currentLocation, focusSelectors } = goToParent(\n\t\t\t\tstate,\n\t\t\t\taction.options\n\t\t\t) );\n\t\t\tbreak;\n\t}\n\n\t// Return early in case there is no change\n\tif (\n\t\tscreens === state.screens &&\n\t\tcurrentLocation === state.currentLocation\n\t) {\n\t\treturn state;\n\t}\n\n\t// Compute the matchedPath\n\tconst currentPath = currentLocation.path;\n\tmatchedPath =\n\t\tcurrentPath !== undefined\n\t\t\t? patternMatch( currentPath, screens )\n\t\t\t: undefined;\n\n\t// If the new match is the same as the previous match,\n\t// return the previous one to keep immutability.\n\tif (\n\t\tmatchedPath &&\n\t\tstate.matchedPath &&\n\t\tmatchedPath.id === state.matchedPath.id &&\n\t\tisShallowEqual( matchedPath.params, state.matchedPath.params )\n\t) {\n\t\tmatchedPath = state.matchedPath;\n\t}\n\n\treturn {\n\t\t...restState,\n\t\tscreens,\n\t\tcurrentLocation,\n\t\tmatchedPath,\n\t\tfocusSelectors,\n\t};\n}\n\nfunction UnconnectedNavigatorProvider(\n\tprops: WordPressComponentProps< NavigatorProviderProps, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tinitialPath: initialPathProp,\n\t\tchildren,\n\t\tclassName,\n\t\t...otherProps\n\t} = useContextSystem( props, 'NavigatorProvider' );\n\n\tconst [ routerState, dispatch ] = useReducer(\n\t\trouterReducer,\n\t\tinitialPathProp,\n\t\t( path ) => ( {\n\t\t\tscreens: [],\n\t\t\tcurrentLocation: { path, isInitial: true },\n\t\t\tmatchedPath: undefined,\n\t\t\tfocusSelectors: new Map(),\n\t\t\tinitialPath: initialPathProp,\n\t\t} )\n\t);\n\n\t// The methods are constant forever, create stable references to them.\n\tconst methods = useMemo(\n\t\t() => ( {\n\t\t\t// Note: calling goBack calls `goToParent` internally, as it was established\n\t\t\t// that `goBack` should behave like `goToParent`, and `goToParent` should\n\t\t\t// be marked as deprecated.\n\t\t\tgoBack: ( options: NavigateToParentOptions | undefined ) =>\n\t\t\t\tdispatch( { type: 'gotoparent', options } ),\n\t\t\tgoTo: ( path: string, options?: NavigateOptions ) =>\n\t\t\t\tdispatch( { type: 'goto', path, options } ),\n\t\t\tgoToParent: ( options: NavigateToParentOptions | undefined ) => {\n\t\t\t\tdeprecated( `wp.components.useNavigator().goToParent`, {\n\t\t\t\t\tsince: '6.7',\n\t\t\t\t\talternative: 'wp.components.useNavigator().goBack',\n\t\t\t\t} );\n\t\t\t\tdispatch( { type: 'gotoparent', options } );\n\t\t\t},\n\t\t\taddScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'add', screen } ),\n\t\t\tremoveScreen: ( screen: Screen ) =>\n\t\t\t\tdispatch( { type: 'remove', screen } ),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { currentLocation, matchedPath } = routerState;\n\n\tconst navigatorContextValue: NavigatorContextType = useMemo(\n\t\t() => ( {\n\t\t\tlocation: currentLocation,\n\t\t\tparams: matchedPath?.params ?? {},\n\t\t\tmatch: matchedPath?.id,\n\t\t\t...methods,\n\t\t} ),\n\t\t[ currentLocation, matchedPath, methods ]\n\t);\n\n\tconst cx = useCx();\n\tconst classes = useMemo(\n\t\t() => cx( styles.navigatorProviderWrapper, className ),\n\t\t[ className, cx ]\n\t);\n\n\treturn (\n\t\t<View ref={ forwardedRef } className={ classes } { ...otherProps }>\n\t\t\t<NavigatorContext.Provider value={ navigatorContextValue }>\n\t\t\t\t{ children }\n\t\t\t</NavigatorContext.Provider>\n\t\t</View>\n\t);\n}\n\n/**\n * The `NavigatorProvider` component allows rendering nested views/panels/menus\n * (via the `NavigatorScreen` component and navigate between these different\n * view (via the `NavigatorButton` and `NavigatorBackButton` components or the\n * `useNavigator` hook).\n *\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorBackButton as NavigatorBackButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorBackButton>\n * Go back\n * </NavigatorBackButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorProvider = contextConnect(\n\tUnconnectedNavigatorProvider,\n\t'NavigatorProvider'\n);\n\nexport default NavigatorProvider;\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,UAAU,QAAQ,oBAAoB;AACxD,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;;AAEA,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,eAAe;AAChE,SAASC,KAAK,QAAQ,0BAA0B;AAChD,SAASC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAC1D,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,gBAAgB,QAAQ,YAAY;AAC7C,OAAO,KAAKC,MAAM,MAAM,WAAW;AASnC,OAAOC,UAAU,MAAM,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAiB/C,SAASC,SAASA,CAAE;EAAEC;AAAqB,CAAC,EAAEC,MAAc,EAAG;EAC9D,IAAKD,OAAO,CAACE,IAAI,CAAIC,CAAC,IAAMA,CAAC,CAACC,IAAI,KAAKH,MAAM,CAACG,IAAK,CAAC,EAAG;IACtDC,UAAA,CAAAC,YAAA,YAAAnB,OAAO,CACL,iCAAiCc,MAAM,CAACG,IAAM;AAClD,qBAAsBH,MAAM,CAACM,EAAI,qBAC/B,CAAC;IACD,OAAOP,OAAO;EACf;EACA,OAAO,CAAE,GAAGA,OAAO,EAAEC,MAAM,CAAE;AAC9B;AAEA,SAASO,YAAYA,CAAE;EAAER;AAAqB,CAA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MAAM,cAAAgB,mBAAA,cAAAA,mBAAA,GAAI,CAAC,CAAC;MACjCE,KAAK,EAAErB,WAAW,EAAE9B,EAAE;MACtB,GAAG4C;IACJ,CAAC;EAAA,CAAE,EACH,CAAEpC,eAAe,EAAEsB,WAAW,EAAEc,OAAO,CACxC,CAAC;EAED,MAAMQ,EAAE,GAAGrE,KAAK,CAAC,CAAC;EAClB,MAAMsE,OAAO,GAAG5E,OAAO,CACtB,MAAM2E,EAAE,CAAEhE,MAAM,CAACkE,wBAAwB,EAAEd,SAAU,CAAC,EACtD,CAAEA,SAAS,EAAEY,EAAE,CAChB,CAAC;EAED,oBACC7D,IAAA,CAACL,IAAI;IAACqE,GAAG,EAAGnB,YAAc;IAACI,SAAS,EAAGa,OAAS;IAAA,GAAMZ,UAAU;IAAAF,QAAA,eAC/DhD,IAAA,CAACJ,gBAAgB,CAACqE,QAAQ;MAACC,KAAK,EAAGT,qBAAuB;MAAAT,QAAA,EACvDA;IAAQ,CACgB;EAAC,CACvB,CAAC;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMmB,iBAAiB,GAAG7E,cAAc,CAC9CqD,4BAA4B,EAC5B,mBACD,CAAC;AAED,eAAewB,iBAAiB","ignoreList":[]}
@@ -1,59 +1,30 @@
1
1
  /**
2
- * External dependencies
2
+ * WordPress dependencies
3
3
  */
4
+ import deprecated from '@wordpress/deprecated';
4
5
 
5
6
  /**
6
7
  * Internal dependencies
7
8
  */
8
-
9
+ import { NavigatorBackButton } from '../navigator-back-button/component';
9
10
  import { contextConnect } from '../../context';
10
- import { View } from '../../view';
11
- import { useNavigatorBackButton } from '../navigator-back-button/hook';
12
11
  import { jsx as _jsx } from "react/jsx-runtime";
13
12
  function UnconnectedNavigatorToParentButton(props, forwardedRef) {
14
- const navigatorToParentButtonProps = useNavigatorBackButton({
15
- ...props,
16
- goToParent: true
13
+ deprecated('wp.components.NavigatorToParentButton', {
14
+ since: '6.7',
15
+ alternative: 'wp.components.NavigatorBackButton'
17
16
  });
18
- return /*#__PURE__*/_jsx(View, {
17
+ return /*#__PURE__*/_jsx(NavigatorBackButton, {
19
18
  ref: forwardedRef,
20
- ...navigatorToParentButtonProps
19
+ ...props
21
20
  });
22
21
  }
23
22
 
24
- /*
25
- * The `NavigatorToParentButton` component can be used to navigate to a screen and
26
- * should be used in combination with the `NavigatorProvider`, the
27
- * `NavigatorScreen` and the `NavigatorButton` components (or the `useNavigator`
28
- * hook).
29
- *
30
- * @example
31
- * ```jsx
32
- * import {
33
- * __experimentalNavigatorProvider as NavigatorProvider,
34
- * __experimentalNavigatorScreen as NavigatorScreen,
35
- * __experimentalNavigatorButton as NavigatorButton,
36
- * __experimentalNavigatorToParentButton as NavigatorToParentButton,
37
- * } from '@wordpress/components';
38
- *
39
- * const MyNavigation = () => (
40
- * <NavigatorProvider initialPath="/">
41
- * <NavigatorScreen path="/">
42
- * <p>This is the home screen.</p>
43
- * <NavigatorButton path="/child">
44
- * Navigate to child screen.
45
- * </NavigatorButton>
46
- * </NavigatorScreen>
23
+ /**
24
+ * _Note: this component is deprecated. Please use the `NavigatorBackButton`
25
+ * component instead._
47
26
  *
48
- * <NavigatorScreen path="/child">
49
- * <p>This is the child screen.</p>
50
- * <NavigatorToParentButton>
51
- * Go to parent
52
- * </NavigatorToParentButton>
53
- * </NavigatorScreen>
54
- * </NavigatorProvider>
55
- * );
56
- * ```
27
+ * @deprecated
57
28
  */
58
29
  export const NavigatorToParentButton = contextConnect(UnconnectedNavigatorToParentButton, 'NavigatorToParentButton');
59
30
  export default NavigatorToParentButton;
@@ -1 +1 @@
1
- {"version":3,"names":["contextConnect","View","useNavigatorBackButton","jsx","_jsx","UnconnectedNavigatorToParentButton","props","forwardedRef","navigatorToParentButtonProps","goToParent","ref","NavigatorToParentButton"],"sources":["@wordpress/components/src/navigator/navigator-to-parent-button/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { View } from '../../view';\nimport { useNavigatorBackButton } from '../navigator-back-button/hook';\nimport type { NavigatorToParentButtonProps } from '../types';\n\nfunction UnconnectedNavigatorToParentButton(\n\tprops: WordPressComponentProps< NavigatorToParentButtonProps, 'button' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst navigatorToParentButtonProps = useNavigatorBackButton( {\n\t\t...props,\n\t\tgoToParent: true,\n\t} );\n\n\treturn <View ref={ forwardedRef } { ...navigatorToParentButtonProps } />;\n}\n\n/*\n * The `NavigatorToParentButton` component can be used to navigate to a screen and\n * should be used in combination with the `NavigatorProvider`, the\n * `NavigatorScreen` and the `NavigatorButton` components (or the `useNavigator`\n * hook).\n *\n * @example\n * ```jsx\n * import {\n * __experimentalNavigatorProvider as NavigatorProvider,\n * __experimentalNavigatorScreen as NavigatorScreen,\n * __experimentalNavigatorButton as NavigatorButton,\n * __experimentalNavigatorToParentButton as NavigatorToParentButton,\n * } from '@wordpress/components';\n *\n * const MyNavigation = () => (\n * <NavigatorProvider initialPath=\"/\">\n * <NavigatorScreen path=\"/\">\n * <p>This is the home screen.</p>\n * <NavigatorButton path=\"/child\">\n * Navigate to child screen.\n * </NavigatorButton>\n * </NavigatorScreen>\n *\n * <NavigatorScreen path=\"/child\">\n * <p>This is the child screen.</p>\n * <NavigatorToParentButton>\n * Go to parent\n * </NavigatorToParentButton>\n * </NavigatorScreen>\n * </NavigatorProvider>\n * );\n * ```\n */\nexport const NavigatorToParentButton = contextConnect(\n\tUnconnectedNavigatorToParentButton,\n\t'NavigatorToParentButton'\n);\n\nexport default NavigatorToParentButton;\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,eAAe;AAC9C,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,sBAAsB,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGvE,SAASC,kCAAkCA,CAC1CC,KAAwE,EACxEC,YAAiC,EAChC;EACD,MAAMC,4BAA4B,GAAGN,sBAAsB,CAAE;IAC5D,GAAGI,KAAK;IACRG,UAAU,EAAE;EACb,CAAE,CAAC;EAEH,oBAAOL,IAAA,CAACH,IAAI;IAACS,GAAG,EAAGH,YAAc;IAAA,GAAMC;EAA4B,CAAI,CAAC;AACzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,uBAAuB,GAAGX,cAAc,CACpDK,kCAAkC,EAClC,yBACD,CAAC;AAED,eAAeM,uBAAuB","ignoreList":[]}
1
+ {"version":3,"names":["deprecated","NavigatorBackButton","contextConnect","jsx","_jsx","UnconnectedNavigatorToParentButton","props","forwardedRef","since","alternative","ref","NavigatorToParentButton"],"sources":["@wordpress/components/src/navigator/navigator-to-parent-button/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { NavigatorBackButton } from '../navigator-back-button/component';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport type { NavigatorBackButtonProps } from '../types';\n\nfunction UnconnectedNavigatorToParentButton(\n\tprops: WordPressComponentProps< NavigatorBackButtonProps, 'button' >,\n\tforwardedRef: React.ForwardedRef< any >\n) {\n\tdeprecated( 'wp.components.NavigatorToParentButton', {\n\t\tsince: '6.7',\n\t\talternative: 'wp.components.NavigatorBackButton',\n\t} );\n\n\treturn <NavigatorBackButton ref={ forwardedRef } { ...props } />;\n}\n\n/**\n * _Note: this component is deprecated. Please use the `NavigatorBackButton`\n * component instead._\n *\n * @deprecated\n */\nexport const NavigatorToParentButton = contextConnect(\n\tUnconnectedNavigatorToParentButton,\n\t'NavigatorToParentButton'\n);\n\nexport default NavigatorToParentButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;AACA,SAASC,mBAAmB,QAAQ,oCAAoC;AAExE,SAASC,cAAc,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG/C,SAASC,kCAAkCA,CAC1CC,KAAoE,EACpEC,YAAuC,EACtC;EACDP,UAAU,CAAE,uCAAuC,EAAE;IACpDQ,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE;EACd,CAAE,CAAC;EAEH,oBAAOL,IAAA,CAACH,mBAAmB;IAACS,GAAG,EAAGH,YAAc;IAAA,GAAMD;EAAK,CAAI,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,uBAAuB,GAAGT,cAAc,CACpDG,kCAAkC,EAClC,yBACD,CAAC;AAED,eAAeM,uBAAuB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/navigator/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport type MatchParams = Record< string, string | string[] >;\n\nexport type NavigateOptions = {\n\tfocusTargetSelector?: string;\n\tisBack?: boolean;\n\tskipFocus?: boolean;\n\treplace?: boolean;\n};\n\nexport type NavigateToParentOptions = Omit< NavigateOptions, 'isBack' >;\n\nexport type NavigatorLocation = NavigateOptions & {\n\tisInitial?: boolean;\n\tpath?: string;\n\thasRestoredFocus?: boolean;\n};\n\n// Returned by the `useNavigator` hook.\nexport type Navigator = {\n\tlocation: NavigatorLocation;\n\tparams: MatchParams;\n\tgoTo: ( path: string, options?: NavigateOptions ) => void;\n\tgoBack: () => void;\n\tgoToParent: ( options?: NavigateToParentOptions ) => void;\n};\n\nexport type NavigatorContext = Navigator & {\n\taddScreen: ( screen: Screen ) => void;\n\tremoveScreen: ( screen: Screen ) => void;\n\tmatch?: string;\n};\n\nexport type NavigatorProviderProps = {\n\t/**\n\t * The initial active path.\n\t */\n\tinitialPath: string;\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type NavigatorScreenProps = {\n\t/**\n\t * The screen's path, matched against the current path stored in the navigator.\n\t */\n\tpath: string;\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type NavigatorBackButtonProps = ButtonAsButtonProps;\n\nexport type NavigatorBackButtonHookProps = NavigatorBackButtonProps & {\n\t/**\n\t * Whether we should navigate to the parent screen.\n\t *\n\t * @default 'false'\n\t */\n\tgoToParent?: boolean;\n};\n\nexport type NavigatorToParentButtonProps = NavigatorBackButtonProps;\n\nexport type NavigatorButtonProps = NavigatorBackButtonProps & {\n\t/**\n\t * The path of the screen to navigate to. The value of this prop needs to be\n\t * a valid value for an HTML attribute.\n\t */\n\tpath: string;\n\t/**\n\t * The HTML attribute used to identify the `NavigatorButton`, which is used\n\t * by `Navigator` to restore focus.\n\t *\n\t * @default 'id'\n\t */\n\tattributeName?: string;\n};\n\nexport type Screen = {\n\tid: string;\n\tpath: string;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/navigator/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport type MatchParams = Record< string, string | string[] >;\n\nexport type NavigateOptions = {\n\t/**\n\t * Specify the CSS selector used to restore focus on an given element when\n\t * navigating back. When not provided, the component will attempt to restore\n\t * focus on the element that originated the forward navigation.\n\t */\n\tfocusTargetSelector?: string;\n\t/**\n\t * Whether the navigation is a backwards navigation. This enables focus\n\t * restoration (when possible), and causes the animation to be backwards.\n\t */\n\tisBack?: boolean;\n\t/**\n\t * Opt out of focus management. Useful when the consumer of the component\n\t * wants to manage focus themselves.\n\t */\n\tskipFocus?: boolean;\n\t/**\n\t * Note: this option is deprecated and currently doesn't have any effect.\n\t * @deprecated\n\t * @ignore\n\t */\n\treplace?: boolean;\n};\n\nexport type NavigateToParentOptions = Omit< NavigateOptions, 'isBack' >;\n\nexport type NavigatorLocation = NavigateOptions & {\n\t/**\n\t * Whether the current location is the initial one (ie. first in the stack).\n\t */\n\tisInitial?: boolean;\n\t/**\n\t * The path associated to the location.\n\t */\n\tpath?: string;\n\t/**\n\t * Whether focus was already restored for this location (in case of\n\t * backwards navigation).\n\t */\n\thasRestoredFocus?: boolean;\n};\n\n// Returned by the `useNavigator` hook.\nexport type Navigator = {\n\t/**\n\t * The current location.\n\t */\n\tlocation: NavigatorLocation;\n\t/**\n\t * Params associated with the current location\n\t */\n\tparams: MatchParams;\n\t/**\n\t * Navigate to a new location.\n\t */\n\tgoTo: ( path: string, options?: NavigateOptions ) => void;\n\t/**\n\t * Go back to the parent location (ie. \"/some/path\" will navigate back\n\t * to \"/some\")\n\t */\n\tgoBack: ( options?: NavigateToParentOptions ) => void;\n\t/**\n\t * _Note: This function is deprecated. Please use `goBack` instead._\n\t * @deprecated\n\t * @ignore\n\t */\n\tgoToParent: ( options?: NavigateToParentOptions ) => void;\n};\n\nexport type NavigatorContext = Navigator & {\n\taddScreen: ( screen: Screen ) => void;\n\tremoveScreen: ( screen: Screen ) => void;\n\tmatch?: string;\n};\n\nexport type NavigatorProviderProps = {\n\t/**\n\t * The initial active path.\n\t */\n\tinitialPath: string;\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type NavigatorScreenProps = {\n\t/**\n\t * The screen's path, matched against the current path stored in the navigator.\n\t */\n\tpath: string;\n\t/**\n\t * The children elements.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type NavigatorBackButtonProps = ButtonAsButtonProps;\n\nexport type NavigatorToParentButtonProps = NavigatorBackButtonProps;\n\nexport type NavigatorButtonProps = NavigatorBackButtonProps & {\n\t/**\n\t * The path of the screen to navigate to. The value of this prop needs to be\n\t * a valid value for an HTML attribute.\n\t */\n\tpath: string;\n\t/**\n\t * The HTML attribute used to identify the `NavigatorButton`, which is used\n\t * by `Navigator` to restore focus.\n\t *\n\t * @default 'id'\n\t */\n\tattributeName?: string;\n};\n\nexport type Screen = {\n\tid: string;\n\tpath: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -10,7 +10,7 @@ import { NavigatorContext } from './context';
10
10
  /**
11
11
  * Retrieves a `navigator` instance.
12
12
  */
13
- function useNavigator() {
13
+ export function useNavigator() {
14
14
  const {
15
15
  location,
16
16
  params,
@@ -26,5 +26,4 @@ function useNavigator() {
26
26
  params
27
27
  };
28
28
  }
29
- export default useNavigator;
30
29
  //# sourceMappingURL=use-navigator.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useContext","NavigatorContext","useNavigator","location","params","goTo","goBack","goToParent"],"sources":["@wordpress/components/src/navigator/use-navigator.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { NavigatorContext } from './context';\nimport type { Navigator } from './types';\n\n/**\n * Retrieves a `navigator` instance.\n */\nfunction useNavigator(): Navigator {\n\tconst { location, params, goTo, goBack, goToParent } =\n\t\tuseContext( NavigatorContext );\n\n\treturn {\n\t\tlocation,\n\t\tgoTo,\n\t\tgoBack,\n\t\tgoToParent,\n\t\tparams,\n\t};\n}\n\nexport default useNavigator;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,WAAW;AAG5C;AACA;AACA;AACA,SAASC,YAAYA,CAAA,EAAc;EAClC,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC;EAAW,CAAC,GACnDP,UAAU,CAAEC,gBAAiB,CAAC;EAE/B,OAAO;IACNE,QAAQ;IACRE,IAAI;IACJC,MAAM;IACNC,UAAU;IACVH;EACD,CAAC;AACF;AAEA,eAAeF,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["useContext","NavigatorContext","useNavigator","location","params","goTo","goBack","goToParent"],"sources":["@wordpress/components/src/navigator/use-navigator.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { NavigatorContext } from './context';\nimport type { Navigator } from './types';\n\n/**\n * Retrieves a `navigator` instance.\n */\nexport function useNavigator(): Navigator {\n\tconst { location, params, goTo, goBack, goToParent } =\n\t\tuseContext( NavigatorContext );\n\n\treturn {\n\t\tlocation,\n\t\tgoTo,\n\t\tgoBack,\n\t\tgoToParent,\n\t\tparams,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,WAAW;AAG5C;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAA,EAAc;EACzC,MAAM;IAAEC,QAAQ;IAAEC,MAAM;IAAEC,IAAI;IAAEC,MAAM;IAAEC;EAAW,CAAC,GACnDP,UAAU,CAAEC,gBAAiB,CAAC;EAE/B,OAAO;IACNE,QAAQ;IACRE,IAAI;IACJC,MAAM;IACNC,UAAU;IACVH;EACD,CAAC;AACF","ignoreList":[]}
@@ -202,9 +202,9 @@ function PaletteEditListView({
202
202
  addColorRef
203
203
  }) {
204
204
  // When unmounting the component if there are empty elements (the user did not complete the insertion) clean them.
205
- const elementsReference = useRef();
205
+ const elementsReferenceRef = useRef();
206
206
  useEffect(() => {
207
- elementsReference.current = elements;
207
+ elementsReferenceRef.current = elements;
208
208
  }, [elements]);
209
209
  const debounceOnChange = useDebounce(onChange, 100);
210
210
  return /*#__PURE__*/_jsx(VStack, {