@wordpress/components 32.0.1-next.v.0 → 32.1.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 (1188) hide show
  1. package/CHANGELOG.md +15 -2
  2. package/CONTRIBUTING.md +6 -0
  3. package/build/alignment-matrix-control/cell.cjs +6 -121
  4. package/build/alignment-matrix-control/cell.cjs.map +2 -2
  5. package/build/alignment-matrix-control/icon.cjs +2 -3
  6. package/build/alignment-matrix-control/icon.cjs.map +2 -2
  7. package/build/alignment-matrix-control/index.cjs +6 -121
  8. package/build/alignment-matrix-control/index.cjs.map +2 -2
  9. package/build/angle-picker-control/angle-circle.cjs +6 -85
  10. package/build/angle-picker-control/angle-circle.cjs.map +2 -2
  11. package/build/angle-picker-control/index.cjs +1 -0
  12. package/build/angle-picker-control/index.cjs.map +2 -2
  13. package/build/autocomplete/autocompleter-ui.cjs +1 -2
  14. package/build/autocomplete/autocompleter-ui.cjs.map +2 -2
  15. package/build/box-control/index.cjs +15 -7
  16. package/build/box-control/index.cjs.map +2 -2
  17. package/build/box-control/input-control.cjs +8 -12
  18. package/build/box-control/input-control.cjs.map +2 -2
  19. package/build/button/deprecated.cjs +12 -8
  20. package/build/button/deprecated.cjs.map +2 -2
  21. package/build/button/index.cjs +7 -12
  22. package/build/button/index.cjs.map +2 -2
  23. package/build/button-group/index.cjs +1 -0
  24. package/build/button-group/index.cjs.map +2 -2
  25. package/build/calendar/date-calendar/index.cjs +2 -2
  26. package/build/calendar/date-calendar/index.cjs.map +2 -2
  27. package/build/calendar/date-range-calendar/index.cjs +4 -6
  28. package/build/calendar/date-range-calendar/index.cjs.map +2 -2
  29. package/build/card/card/hook.cjs +1 -2
  30. package/build/card/card/hook.cjs.map +2 -2
  31. package/build/circular-option-picker/circular-option-picker-option.cjs +2 -1
  32. package/build/circular-option-picker/circular-option-picker-option.cjs.map +2 -2
  33. package/build/circular-option-picker/circular-option-picker.cjs +1 -0
  34. package/build/circular-option-picker/circular-option-picker.cjs.map +2 -2
  35. package/build/clipboard-button/index.cjs +11 -7
  36. package/build/clipboard-button/index.cjs.map +2 -2
  37. package/build/color-indicator/index.cjs +1 -0
  38. package/build/color-indicator/index.cjs.map +2 -2
  39. package/build/color-palette/index.cjs +1 -0
  40. package/build/color-palette/index.cjs.map +2 -2
  41. package/build/color-palette/utils.cjs +2 -2
  42. package/build/color-palette/utils.cjs.map +2 -2
  43. package/build/combobox-control/index.cjs +2 -3
  44. package/build/combobox-control/index.cjs.map +2 -2
  45. package/build/composite/group-label.cjs +1 -2
  46. package/build/composite/group-label.cjs.map +2 -2
  47. package/build/composite/group.cjs +1 -2
  48. package/build/composite/group.cjs.map +2 -2
  49. package/build/composite/hover.cjs +1 -2
  50. package/build/composite/hover.cjs.map +2 -2
  51. package/build/composite/index.cjs +1 -1
  52. package/build/composite/index.cjs.map +2 -2
  53. package/build/composite/item.cjs +1 -2
  54. package/build/composite/item.cjs.map +2 -2
  55. package/build/composite/legacy/index.cjs +1 -2
  56. package/build/composite/legacy/index.cjs.map +2 -2
  57. package/build/composite/row.cjs +1 -2
  58. package/build/composite/row.cjs.map +2 -2
  59. package/build/composite/typeahead.cjs +1 -2
  60. package/build/composite/typeahead.cjs.map +2 -2
  61. package/build/confirm-dialog/component.cjs +2 -2
  62. package/build/confirm-dialog/component.cjs.map +2 -2
  63. package/build/context/context-system-provider.cjs +1 -1
  64. package/build/context/context-system-provider.cjs.map +2 -2
  65. package/build/custom-gradient-picker/index.cjs +1 -2
  66. package/build/custom-gradient-picker/index.cjs.map +2 -2
  67. package/build/custom-gradient-picker/utils.cjs +1 -1
  68. package/build/custom-gradient-picker/utils.cjs.map +2 -2
  69. package/build/custom-select-control/index.cjs +2 -3
  70. package/build/custom-select-control/index.cjs.map +2 -2
  71. package/build/custom-select-control-v2/custom-select.cjs +1 -1
  72. package/build/custom-select-control-v2/custom-select.cjs.map +2 -2
  73. package/build/custom-select-control-v2/item.cjs +2 -3
  74. package/build/custom-select-control-v2/item.cjs.map +2 -2
  75. package/build/date-time/date/index.cjs +1 -1
  76. package/build/date-time/date/index.cjs.map +2 -2
  77. package/build/date-time/date-time/index.cjs +1 -0
  78. package/build/date-time/date-time/index.cjs.map +2 -2
  79. package/build/date-time/time/index.cjs +2 -2
  80. package/build/date-time/time/index.cjs.map +2 -2
  81. package/build/date-time/utils.cjs +1 -2
  82. package/build/date-time/utils.cjs.map +2 -2
  83. package/build/disclosure/index.cjs +1 -0
  84. package/build/disclosure/index.cjs.map +2 -2
  85. package/build/divider/styles.cjs +2 -2
  86. package/build/divider/styles.cjs.map +2 -2
  87. package/build/dropdown-menu/index.cjs +2 -3
  88. package/build/dropdown-menu/index.cjs.map +2 -2
  89. package/build/duotone-picker/duotone-picker.cjs +1 -1
  90. package/build/duotone-picker/duotone-picker.cjs.map +2 -2
  91. package/build/external-link/index.cjs +1 -0
  92. package/build/external-link/index.cjs.map +2 -2
  93. package/build/flex/flex/hook.cjs +1 -1
  94. package/build/flex/flex/hook.cjs.map +2 -2
  95. package/build/focal-point-picker/index.cjs +1 -2
  96. package/build/focal-point-picker/index.cjs.map +2 -2
  97. package/build/font-size-picker/font-size-picker-select.cjs +1 -2
  98. package/build/font-size-picker/font-size-picker-select.cjs.map +2 -2
  99. package/build/font-size-picker/index.cjs +3 -2
  100. package/build/font-size-picker/index.cjs.map +2 -2
  101. package/build/form-file-upload/index.cjs +9 -5
  102. package/build/form-file-upload/index.cjs.map +2 -2
  103. package/build/form-toggle/index.cjs +1 -0
  104. package/build/form-toggle/index.cjs.map +2 -2
  105. package/build/form-token-field/token-input.cjs +1 -0
  106. package/build/form-token-field/token-input.cjs.map +2 -2
  107. package/build/form-token-field/token.cjs.map +2 -2
  108. package/build/guide/index.cjs +2 -3
  109. package/build/guide/index.cjs.map +2 -2
  110. package/build/higher-order/navigate-regions/index.cjs +10 -9
  111. package/build/higher-order/navigate-regions/index.cjs.map +2 -2
  112. package/build/higher-order/with-fallback-styles/index.cjs +1 -1
  113. package/build/higher-order/with-fallback-styles/index.cjs.map +2 -2
  114. package/build/higher-order/with-focus-outside/index.cjs +1 -1
  115. package/build/higher-order/with-focus-outside/index.cjs.map +2 -2
  116. package/build/higher-order/with-spoken-messages/index.cjs +7 -5
  117. package/build/higher-order/with-spoken-messages/index.cjs.map +2 -2
  118. package/build/input-control/index.cjs +1 -0
  119. package/build/input-control/index.cjs.map +2 -2
  120. package/build/input-control/input-field.cjs +1 -1
  121. package/build/input-control/input-field.cjs.map +2 -2
  122. package/build/input-control/reducer/reducer.cjs +2 -4
  123. package/build/input-control/reducer/reducer.cjs.map +2 -2
  124. package/build/input-control/styles/input-control-styles.cjs +22 -22
  125. package/build/input-control/styles/input-control-styles.cjs.map +2 -2
  126. package/build/keyboard-shortcuts/index.cjs +1 -1
  127. package/build/keyboard-shortcuts/index.cjs.map +2 -2
  128. package/build/menu/index.cjs +1 -1
  129. package/build/menu/index.cjs.map +2 -2
  130. package/build/menu/item.cjs +1 -1
  131. package/build/menu/item.cjs.map +2 -2
  132. package/build/menu/popover.cjs +2 -2
  133. package/build/menu/popover.cjs.map +2 -2
  134. package/build/menu-item/index.cjs +1 -0
  135. package/build/menu-item/index.cjs.map +2 -2
  136. package/build/modal/index.cjs +3 -4
  137. package/build/modal/index.cjs.map +2 -2
  138. package/build/navigable-container/menu.cjs +1 -0
  139. package/build/navigable-container/menu.cjs.map +2 -2
  140. package/build/navigable-container/tabbable.cjs +1 -0
  141. package/build/navigable-container/tabbable.cjs.map +2 -2
  142. package/build/navigation/back-button/index.cjs +1 -0
  143. package/build/navigation/back-button/index.cjs.map +2 -2
  144. package/build/navigator/navigator/component.cjs +8 -13
  145. package/build/navigator/navigator/component.cjs.map +2 -2
  146. package/build/navigator/navigator-screen/component.cjs +1 -1
  147. package/build/navigator/navigator-screen/component.cjs.map +2 -2
  148. package/build/number-control/index.cjs +3 -3
  149. package/build/number-control/index.cjs.map +2 -2
  150. package/build/palette-edit/index.cjs +3 -4
  151. package/build/palette-edit/index.cjs.map +2 -2
  152. package/build/panel/body.cjs +1 -0
  153. package/build/panel/body.cjs.map +2 -2
  154. package/build/panel/index.cjs +1 -0
  155. package/build/panel/index.cjs.map +2 -2
  156. package/build/panel/row.cjs +1 -0
  157. package/build/panel/row.cjs.map +2 -2
  158. package/build/popover/index.cjs +1 -2
  159. package/build/popover/index.cjs.map +2 -2
  160. package/build/popover/overlay-middlewares.cjs +1 -2
  161. package/build/popover/overlay-middlewares.cjs.map +2 -2
  162. package/build/popover/utils.cjs +3 -8
  163. package/build/popover/utils.cjs.map +2 -2
  164. package/build/private-apis.cjs +1 -0
  165. package/build/private-apis.cjs.map +2 -2
  166. package/build/progress-bar/index.cjs +1 -0
  167. package/build/progress-bar/index.cjs.map +2 -2
  168. package/build/radio-group/index.cjs +2 -1
  169. package/build/radio-group/index.cjs.map +2 -2
  170. package/build/radio-group/radio.cjs +9 -4
  171. package/build/radio-group/radio.cjs.map +2 -2
  172. package/build/range-control/index.cjs +5 -4
  173. package/build/range-control/index.cjs.map +2 -2
  174. package/build/range-control/utils.cjs +1 -1
  175. package/build/range-control/utils.cjs.map +2 -2
  176. package/build/resizable-box/index.cjs +1 -0
  177. package/build/resizable-box/index.cjs.map +2 -2
  178. package/build/search-control/index.cjs +4 -3
  179. package/build/search-control/index.cjs.map +2 -2
  180. package/build/select-control/index.cjs +1 -0
  181. package/build/select-control/index.cjs.map +2 -2
  182. package/build/slot-fill/bubbles-virtually/slot.cjs +17 -5
  183. package/build/slot-fill/bubbles-virtually/slot.cjs.map +2 -2
  184. package/build/slot-fill/bubbles-virtually/use-slot-fills.cjs +17 -4
  185. package/build/slot-fill/bubbles-virtually/use-slot-fills.cjs.map +2 -2
  186. package/build/slot-fill/bubbles-virtually/use-slot.cjs +7 -3
  187. package/build/slot-fill/bubbles-virtually/use-slot.cjs.map +2 -2
  188. package/build/slot-fill/context.cjs +17 -6
  189. package/build/slot-fill/context.cjs.map +3 -3
  190. package/build/slot-fill/fill.cjs +28 -4
  191. package/build/slot-fill/fill.cjs.map +4 -4
  192. package/build/slot-fill/index.cjs +8 -23
  193. package/build/slot-fill/index.cjs.map +3 -3
  194. package/build/slot-fill/provider.cjs +33 -17
  195. package/build/slot-fill/provider.cjs.map +2 -2
  196. package/build/slot-fill/slot.cjs +8 -6
  197. package/build/slot-fill/slot.cjs.map +2 -2
  198. package/build/snackbar/index.cjs +1 -0
  199. package/build/snackbar/index.cjs.map +2 -2
  200. package/build/spinner/index.cjs +1 -0
  201. package/build/spinner/index.cjs.map +2 -2
  202. package/build/tab-panel/index.cjs +1 -0
  203. package/build/tab-panel/index.cjs.map +2 -2
  204. package/build/tabs/tab.cjs +1 -2
  205. package/build/tabs/tab.cjs.map +2 -2
  206. package/build/tabs/tablist.cjs +7 -11
  207. package/build/tabs/tablist.cjs.map +2 -2
  208. package/build/text-control/index.cjs +1 -0
  209. package/build/text-control/index.cjs.map +2 -2
  210. package/build/text-highlight/index.cjs +1 -0
  211. package/build/text-highlight/index.cjs.map +2 -2
  212. package/build/textarea-control/index.cjs +1 -0
  213. package/build/textarea-control/index.cjs.map +2 -2
  214. package/build/toggle-control/index.cjs +1 -0
  215. package/build/toggle-control/index.cjs.map +2 -2
  216. package/build/toggle-group-control/toggle-group-control/as-button-group.cjs +1 -0
  217. package/build/toggle-group-control/toggle-group-control/as-button-group.cjs.map +2 -2
  218. package/build/toggle-group-control/toggle-group-control/as-radio-group.cjs +2 -1
  219. package/build/toggle-group-control/toggle-group-control/as-radio-group.cjs.map +2 -2
  220. package/build/toggle-group-control/toggle-group-control/utils.cjs +1 -1
  221. package/build/toggle-group-control/toggle-group-control/utils.cjs.map +2 -2
  222. package/build/toggle-group-control/toggle-group-control-option/component.cjs +1 -0
  223. package/build/toggle-group-control/toggle-group-control-option/component.cjs.map +2 -2
  224. package/build/toggle-group-control/toggle-group-control-option-icon/component.cjs +1 -0
  225. package/build/toggle-group-control/toggle-group-control-option-icon/component.cjs.map +2 -2
  226. package/build/toolbar/toolbar/index.cjs +1 -0
  227. package/build/toolbar/toolbar/index.cjs.map +2 -2
  228. package/build/toolbar/toolbar/toolbar-container.cjs +1 -0
  229. package/build/toolbar/toolbar/toolbar-container.cjs.map +2 -2
  230. package/build/toolbar/toolbar-button/index.cjs +1 -0
  231. package/build/toolbar/toolbar-button/index.cjs.map +2 -2
  232. package/build/toolbar/toolbar-dropdown-menu/index.cjs +1 -0
  233. package/build/toolbar/toolbar-dropdown-menu/index.cjs.map +2 -2
  234. package/build/toolbar/toolbar-item/index.cjs +1 -0
  235. package/build/toolbar/toolbar-item/index.cjs.map +2 -2
  236. package/build/tooltip/index.cjs +1 -0
  237. package/build/tooltip/index.cjs.map +2 -2
  238. package/build/tree-grid/cell.cjs +1 -0
  239. package/build/tree-grid/cell.cjs.map +2 -2
  240. package/build/tree-grid/index.cjs +2 -2
  241. package/build/tree-grid/index.cjs.map +2 -2
  242. package/build/tree-grid/item.cjs +1 -0
  243. package/build/tree-grid/item.cjs.map +2 -2
  244. package/build/tree-grid/roving-tab-index-item.cjs +1 -0
  245. package/build/tree-grid/roving-tab-index-item.cjs.map +2 -2
  246. package/build/tree-grid/row.cjs +1 -0
  247. package/build/tree-grid/row.cjs.map +2 -2
  248. package/build/tree-select/index.cjs +12 -8
  249. package/build/tree-select/index.cjs.map +2 -2
  250. package/build/unit-control/index.cjs +5 -5
  251. package/build/unit-control/index.cjs.map +2 -2
  252. package/build/unit-control/utils.cjs +2 -2
  253. package/build/unit-control/utils.cjs.map +2 -2
  254. package/build/utils/dropdown-motion.cjs.map +2 -2
  255. package/build/utils/element-rect.cjs +3 -4
  256. package/build/utils/element-rect.cjs.map +2 -2
  257. package/build/utils/font.cjs +1 -2
  258. package/build/utils/font.cjs.map +2 -2
  259. package/build/utils/strings.cjs +1 -2
  260. package/build/utils/strings.cjs.map +2 -2
  261. package/build/utils/use-deprecated-props.cjs +1 -1
  262. package/build/utils/use-deprecated-props.cjs.map +2 -2
  263. package/build/utils/values.cjs +1 -2
  264. package/build/utils/values.cjs.map +2 -2
  265. package/build/validated-form-controls/components/checkbox-control.cjs +1 -0
  266. package/build/validated-form-controls/components/checkbox-control.cjs.map +2 -2
  267. package/build/validated-form-controls/components/combobox-control.cjs +2 -1
  268. package/build/validated-form-controls/components/combobox-control.cjs.map +2 -2
  269. package/build/validated-form-controls/components/custom-select-control.cjs +1 -0
  270. package/build/validated-form-controls/components/custom-select-control.cjs.map +2 -2
  271. package/build/validated-form-controls/components/form-token-field.cjs +1 -0
  272. package/build/validated-form-controls/components/form-token-field.cjs.map +2 -2
  273. package/build/validated-form-controls/components/input-control.cjs +1 -0
  274. package/build/validated-form-controls/components/input-control.cjs.map +2 -2
  275. package/build/validated-form-controls/components/number-control.cjs +1 -0
  276. package/build/validated-form-controls/components/number-control.cjs.map +2 -2
  277. package/build/validated-form-controls/components/radio-control.cjs +1 -0
  278. package/build/validated-form-controls/components/radio-control.cjs.map +2 -2
  279. package/build/validated-form-controls/components/range-control.cjs +1 -0
  280. package/build/validated-form-controls/components/range-control.cjs.map +2 -2
  281. package/build/validated-form-controls/components/select-control.cjs +1 -0
  282. package/build/validated-form-controls/components/select-control.cjs.map +2 -2
  283. package/build/validated-form-controls/components/text-control.cjs +1 -0
  284. package/build/validated-form-controls/components/text-control.cjs.map +2 -2
  285. package/build/validated-form-controls/components/textarea-control.cjs +1 -0
  286. package/build/validated-form-controls/components/textarea-control.cjs.map +2 -2
  287. package/build/validated-form-controls/components/toggle-control.cjs +2 -1
  288. package/build/validated-form-controls/components/toggle-control.cjs.map +2 -2
  289. package/build/validated-form-controls/components/toggle-group-control.cjs +1 -0
  290. package/build/validated-form-controls/components/toggle-group-control.cjs.map +2 -2
  291. package/build/validated-form-controls/control-with-error.cjs +4 -6
  292. package/build/validated-form-controls/control-with-error.cjs.map +2 -2
  293. package/build-module/alignment-matrix-control/cell.mjs +6 -121
  294. package/build-module/alignment-matrix-control/cell.mjs.map +2 -2
  295. package/build-module/alignment-matrix-control/icon.mjs +2 -3
  296. package/build-module/alignment-matrix-control/icon.mjs.map +2 -2
  297. package/build-module/alignment-matrix-control/index.mjs +6 -121
  298. package/build-module/alignment-matrix-control/index.mjs.map +2 -2
  299. package/build-module/angle-picker-control/angle-circle.mjs +6 -85
  300. package/build-module/angle-picker-control/angle-circle.mjs.map +2 -2
  301. package/build-module/angle-picker-control/index.mjs +1 -0
  302. package/build-module/angle-picker-control/index.mjs.map +2 -2
  303. package/build-module/autocomplete/autocompleter-ui.mjs +1 -2
  304. package/build-module/autocomplete/autocompleter-ui.mjs.map +2 -2
  305. package/build-module/box-control/index.mjs +15 -7
  306. package/build-module/box-control/index.mjs.map +2 -2
  307. package/build-module/box-control/input-control.mjs +8 -12
  308. package/build-module/box-control/input-control.mjs.map +2 -2
  309. package/build-module/button/deprecated.mjs +12 -8
  310. package/build-module/button/deprecated.mjs.map +2 -2
  311. package/build-module/button/index.mjs +7 -12
  312. package/build-module/button/index.mjs.map +2 -2
  313. package/build-module/button-group/index.mjs +1 -0
  314. package/build-module/button-group/index.mjs.map +2 -2
  315. package/build-module/calendar/date-calendar/index.mjs +2 -2
  316. package/build-module/calendar/date-calendar/index.mjs.map +2 -2
  317. package/build-module/calendar/date-range-calendar/index.mjs +4 -6
  318. package/build-module/calendar/date-range-calendar/index.mjs.map +2 -2
  319. package/build-module/card/card/hook.mjs +1 -2
  320. package/build-module/card/card/hook.mjs.map +2 -2
  321. package/build-module/circular-option-picker/circular-option-picker-option.mjs +2 -1
  322. package/build-module/circular-option-picker/circular-option-picker-option.mjs.map +2 -2
  323. package/build-module/circular-option-picker/circular-option-picker.mjs +1 -0
  324. package/build-module/circular-option-picker/circular-option-picker.mjs.map +2 -2
  325. package/build-module/clipboard-button/index.mjs +11 -7
  326. package/build-module/clipboard-button/index.mjs.map +2 -2
  327. package/build-module/color-indicator/index.mjs +1 -0
  328. package/build-module/color-indicator/index.mjs.map +2 -2
  329. package/build-module/color-palette/index.mjs +1 -0
  330. package/build-module/color-palette/index.mjs.map +2 -2
  331. package/build-module/color-palette/utils.mjs +2 -2
  332. package/build-module/color-palette/utils.mjs.map +2 -2
  333. package/build-module/combobox-control/index.mjs +2 -3
  334. package/build-module/combobox-control/index.mjs.map +2 -2
  335. package/build-module/composite/group-label.mjs +1 -2
  336. package/build-module/composite/group-label.mjs.map +2 -2
  337. package/build-module/composite/group.mjs +1 -2
  338. package/build-module/composite/group.mjs.map +2 -2
  339. package/build-module/composite/hover.mjs +1 -2
  340. package/build-module/composite/hover.mjs.map +2 -2
  341. package/build-module/composite/index.mjs +1 -1
  342. package/build-module/composite/index.mjs.map +2 -2
  343. package/build-module/composite/item.mjs +1 -2
  344. package/build-module/composite/item.mjs.map +2 -2
  345. package/build-module/composite/legacy/index.mjs +1 -2
  346. package/build-module/composite/legacy/index.mjs.map +2 -2
  347. package/build-module/composite/row.mjs +1 -2
  348. package/build-module/composite/row.mjs.map +2 -2
  349. package/build-module/composite/typeahead.mjs +1 -2
  350. package/build-module/composite/typeahead.mjs.map +2 -2
  351. package/build-module/confirm-dialog/component.mjs +2 -2
  352. package/build-module/confirm-dialog/component.mjs.map +2 -2
  353. package/build-module/context/context-system-provider.mjs +1 -1
  354. package/build-module/context/context-system-provider.mjs.map +2 -2
  355. package/build-module/custom-gradient-picker/index.mjs +1 -2
  356. package/build-module/custom-gradient-picker/index.mjs.map +2 -2
  357. package/build-module/custom-gradient-picker/utils.mjs +1 -1
  358. package/build-module/custom-gradient-picker/utils.mjs.map +2 -2
  359. package/build-module/custom-select-control/index.mjs +2 -3
  360. package/build-module/custom-select-control/index.mjs.map +2 -2
  361. package/build-module/custom-select-control-v2/custom-select.mjs +1 -1
  362. package/build-module/custom-select-control-v2/custom-select.mjs.map +2 -2
  363. package/build-module/custom-select-control-v2/item.mjs +2 -3
  364. package/build-module/custom-select-control-v2/item.mjs.map +2 -2
  365. package/build-module/date-time/date/index.mjs +1 -1
  366. package/build-module/date-time/date/index.mjs.map +2 -2
  367. package/build-module/date-time/date-time/index.mjs +1 -0
  368. package/build-module/date-time/date-time/index.mjs.map +2 -2
  369. package/build-module/date-time/time/index.mjs +2 -2
  370. package/build-module/date-time/time/index.mjs.map +2 -2
  371. package/build-module/date-time/utils.mjs +1 -2
  372. package/build-module/date-time/utils.mjs.map +2 -2
  373. package/build-module/disclosure/index.mjs +1 -0
  374. package/build-module/disclosure/index.mjs.map +2 -2
  375. package/build-module/divider/styles.mjs +2 -2
  376. package/build-module/divider/styles.mjs.map +2 -2
  377. package/build-module/dropdown-menu/index.mjs +2 -3
  378. package/build-module/dropdown-menu/index.mjs.map +2 -2
  379. package/build-module/duotone-picker/duotone-picker.mjs +1 -1
  380. package/build-module/duotone-picker/duotone-picker.mjs.map +2 -2
  381. package/build-module/external-link/index.mjs +1 -0
  382. package/build-module/external-link/index.mjs.map +2 -2
  383. package/build-module/flex/flex/hook.mjs +1 -1
  384. package/build-module/flex/flex/hook.mjs.map +2 -2
  385. package/build-module/focal-point-picker/index.mjs +1 -2
  386. package/build-module/focal-point-picker/index.mjs.map +2 -2
  387. package/build-module/font-size-picker/font-size-picker-select.mjs +1 -2
  388. package/build-module/font-size-picker/font-size-picker-select.mjs.map +2 -2
  389. package/build-module/font-size-picker/index.mjs +3 -2
  390. package/build-module/font-size-picker/index.mjs.map +2 -2
  391. package/build-module/form-file-upload/index.mjs +9 -5
  392. package/build-module/form-file-upload/index.mjs.map +2 -2
  393. package/build-module/form-toggle/index.mjs +1 -0
  394. package/build-module/form-toggle/index.mjs.map +2 -2
  395. package/build-module/form-token-field/token-input.mjs +1 -0
  396. package/build-module/form-token-field/token-input.mjs.map +2 -2
  397. package/build-module/form-token-field/token.mjs.map +2 -2
  398. package/build-module/guide/index.mjs +2 -3
  399. package/build-module/guide/index.mjs.map +2 -2
  400. package/build-module/higher-order/navigate-regions/index.mjs +10 -9
  401. package/build-module/higher-order/navigate-regions/index.mjs.map +2 -2
  402. package/build-module/higher-order/with-fallback-styles/index.mjs +1 -1
  403. package/build-module/higher-order/with-fallback-styles/index.mjs.map +2 -2
  404. package/build-module/higher-order/with-focus-outside/index.mjs +1 -1
  405. package/build-module/higher-order/with-focus-outside/index.mjs.map +2 -2
  406. package/build-module/higher-order/with-spoken-messages/index.mjs +7 -5
  407. package/build-module/higher-order/with-spoken-messages/index.mjs.map +2 -2
  408. package/build-module/input-control/index.mjs +1 -0
  409. package/build-module/input-control/index.mjs.map +2 -2
  410. package/build-module/input-control/input-field.mjs +1 -1
  411. package/build-module/input-control/input-field.mjs.map +2 -2
  412. package/build-module/input-control/reducer/reducer.mjs +2 -4
  413. package/build-module/input-control/reducer/reducer.mjs.map +2 -2
  414. package/build-module/input-control/styles/input-control-styles.mjs +22 -22
  415. package/build-module/input-control/styles/input-control-styles.mjs.map +2 -2
  416. package/build-module/keyboard-shortcuts/index.mjs +1 -1
  417. package/build-module/keyboard-shortcuts/index.mjs.map +2 -2
  418. package/build-module/menu/index.mjs +1 -1
  419. package/build-module/menu/index.mjs.map +2 -2
  420. package/build-module/menu/item.mjs +1 -1
  421. package/build-module/menu/item.mjs.map +2 -2
  422. package/build-module/menu/popover.mjs +2 -2
  423. package/build-module/menu/popover.mjs.map +2 -2
  424. package/build-module/menu-item/index.mjs +1 -0
  425. package/build-module/menu-item/index.mjs.map +2 -2
  426. package/build-module/modal/index.mjs +3 -4
  427. package/build-module/modal/index.mjs.map +2 -2
  428. package/build-module/navigable-container/menu.mjs +1 -0
  429. package/build-module/navigable-container/menu.mjs.map +2 -2
  430. package/build-module/navigable-container/tabbable.mjs +1 -0
  431. package/build-module/navigable-container/tabbable.mjs.map +2 -2
  432. package/build-module/navigation/back-button/index.mjs +1 -0
  433. package/build-module/navigation/back-button/index.mjs.map +2 -2
  434. package/build-module/navigator/navigator/component.mjs +8 -13
  435. package/build-module/navigator/navigator/component.mjs.map +2 -2
  436. package/build-module/navigator/navigator-screen/component.mjs +1 -1
  437. package/build-module/navigator/navigator-screen/component.mjs.map +2 -2
  438. package/build-module/number-control/index.mjs +3 -3
  439. package/build-module/number-control/index.mjs.map +2 -2
  440. package/build-module/palette-edit/index.mjs +3 -4
  441. package/build-module/palette-edit/index.mjs.map +2 -2
  442. package/build-module/panel/body.mjs +1 -0
  443. package/build-module/panel/body.mjs.map +2 -2
  444. package/build-module/panel/index.mjs +1 -0
  445. package/build-module/panel/index.mjs.map +2 -2
  446. package/build-module/panel/row.mjs +1 -0
  447. package/build-module/panel/row.mjs.map +2 -2
  448. package/build-module/popover/index.mjs +1 -2
  449. package/build-module/popover/index.mjs.map +2 -2
  450. package/build-module/popover/overlay-middlewares.mjs +1 -2
  451. package/build-module/popover/overlay-middlewares.mjs.map +2 -2
  452. package/build-module/popover/utils.mjs +3 -8
  453. package/build-module/popover/utils.mjs.map +2 -2
  454. package/build-module/private-apis.mjs +2 -1
  455. package/build-module/private-apis.mjs.map +2 -2
  456. package/build-module/progress-bar/index.mjs +1 -0
  457. package/build-module/progress-bar/index.mjs.map +2 -2
  458. package/build-module/radio-group/index.mjs +2 -1
  459. package/build-module/radio-group/index.mjs.map +2 -2
  460. package/build-module/radio-group/radio.mjs +9 -4
  461. package/build-module/radio-group/radio.mjs.map +2 -2
  462. package/build-module/range-control/index.mjs +5 -4
  463. package/build-module/range-control/index.mjs.map +2 -2
  464. package/build-module/range-control/utils.mjs +1 -1
  465. package/build-module/range-control/utils.mjs.map +2 -2
  466. package/build-module/resizable-box/index.mjs +1 -0
  467. package/build-module/resizable-box/index.mjs.map +2 -2
  468. package/build-module/search-control/index.mjs +4 -3
  469. package/build-module/search-control/index.mjs.map +2 -2
  470. package/build-module/select-control/index.mjs +1 -0
  471. package/build-module/select-control/index.mjs.map +2 -2
  472. package/build-module/slot-fill/bubbles-virtually/slot.mjs +16 -4
  473. package/build-module/slot-fill/bubbles-virtually/slot.mjs.map +2 -2
  474. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.mjs +17 -4
  475. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.mjs.map +2 -2
  476. package/build-module/slot-fill/bubbles-virtually/use-slot.mjs +6 -2
  477. package/build-module/slot-fill/bubbles-virtually/use-slot.mjs.map +2 -2
  478. package/build-module/slot-fill/context.mjs +7 -2
  479. package/build-module/slot-fill/context.mjs.map +2 -2
  480. package/build-module/slot-fill/fill.mjs +29 -5
  481. package/build-module/slot-fill/fill.mjs.map +3 -3
  482. package/build-module/slot-fill/index.mjs +7 -21
  483. package/build-module/slot-fill/index.mjs.map +2 -2
  484. package/build-module/slot-fill/provider.mjs +33 -17
  485. package/build-module/slot-fill/provider.mjs.map +2 -2
  486. package/build-module/slot-fill/slot.mjs +8 -6
  487. package/build-module/slot-fill/slot.mjs.map +2 -2
  488. package/build-module/snackbar/index.mjs +1 -0
  489. package/build-module/snackbar/index.mjs.map +2 -2
  490. package/build-module/spinner/index.mjs +1 -0
  491. package/build-module/spinner/index.mjs.map +2 -2
  492. package/build-module/tab-panel/index.mjs +1 -0
  493. package/build-module/tab-panel/index.mjs.map +2 -2
  494. package/build-module/tabs/tab.mjs +1 -2
  495. package/build-module/tabs/tab.mjs.map +2 -2
  496. package/build-module/tabs/tablist.mjs +7 -11
  497. package/build-module/tabs/tablist.mjs.map +2 -2
  498. package/build-module/text-control/index.mjs +1 -0
  499. package/build-module/text-control/index.mjs.map +2 -2
  500. package/build-module/text-highlight/index.mjs +1 -0
  501. package/build-module/text-highlight/index.mjs.map +2 -2
  502. package/build-module/textarea-control/index.mjs +1 -0
  503. package/build-module/textarea-control/index.mjs.map +2 -2
  504. package/build-module/toggle-control/index.mjs +1 -0
  505. package/build-module/toggle-control/index.mjs.map +2 -2
  506. package/build-module/toggle-group-control/toggle-group-control/as-button-group.mjs +1 -0
  507. package/build-module/toggle-group-control/toggle-group-control/as-button-group.mjs.map +2 -2
  508. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.mjs +2 -1
  509. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.mjs.map +2 -2
  510. package/build-module/toggle-group-control/toggle-group-control/utils.mjs +1 -1
  511. package/build-module/toggle-group-control/toggle-group-control/utils.mjs.map +2 -2
  512. package/build-module/toggle-group-control/toggle-group-control-option/component.mjs +1 -0
  513. package/build-module/toggle-group-control/toggle-group-control-option/component.mjs.map +2 -2
  514. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.mjs +1 -0
  515. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.mjs.map +2 -2
  516. package/build-module/toolbar/toolbar/index.mjs +1 -0
  517. package/build-module/toolbar/toolbar/index.mjs.map +2 -2
  518. package/build-module/toolbar/toolbar/toolbar-container.mjs +1 -0
  519. package/build-module/toolbar/toolbar/toolbar-container.mjs.map +2 -2
  520. package/build-module/toolbar/toolbar-button/index.mjs +1 -0
  521. package/build-module/toolbar/toolbar-button/index.mjs.map +2 -2
  522. package/build-module/toolbar/toolbar-dropdown-menu/index.mjs +1 -0
  523. package/build-module/toolbar/toolbar-dropdown-menu/index.mjs.map +2 -2
  524. package/build-module/toolbar/toolbar-item/index.mjs +1 -0
  525. package/build-module/toolbar/toolbar-item/index.mjs.map +2 -2
  526. package/build-module/tooltip/index.mjs +1 -0
  527. package/build-module/tooltip/index.mjs.map +2 -2
  528. package/build-module/tree-grid/cell.mjs +1 -0
  529. package/build-module/tree-grid/cell.mjs.map +2 -2
  530. package/build-module/tree-grid/index.mjs +2 -2
  531. package/build-module/tree-grid/index.mjs.map +2 -2
  532. package/build-module/tree-grid/item.mjs +1 -0
  533. package/build-module/tree-grid/item.mjs.map +2 -2
  534. package/build-module/tree-grid/roving-tab-index-item.mjs +1 -0
  535. package/build-module/tree-grid/roving-tab-index-item.mjs.map +2 -2
  536. package/build-module/tree-grid/row.mjs +1 -0
  537. package/build-module/tree-grid/row.mjs.map +2 -2
  538. package/build-module/tree-select/index.mjs +12 -8
  539. package/build-module/tree-select/index.mjs.map +2 -2
  540. package/build-module/unit-control/index.mjs +5 -5
  541. package/build-module/unit-control/index.mjs.map +2 -2
  542. package/build-module/unit-control/utils.mjs +2 -2
  543. package/build-module/unit-control/utils.mjs.map +2 -2
  544. package/build-module/utils/dropdown-motion.mjs.map +2 -2
  545. package/build-module/utils/element-rect.mjs +3 -4
  546. package/build-module/utils/element-rect.mjs.map +2 -2
  547. package/build-module/utils/font.mjs +1 -2
  548. package/build-module/utils/font.mjs.map +2 -2
  549. package/build-module/utils/strings.mjs +1 -2
  550. package/build-module/utils/strings.mjs.map +2 -2
  551. package/build-module/utils/use-deprecated-props.mjs +1 -1
  552. package/build-module/utils/use-deprecated-props.mjs.map +2 -2
  553. package/build-module/utils/values.mjs +1 -2
  554. package/build-module/utils/values.mjs.map +2 -2
  555. package/build-module/validated-form-controls/components/checkbox-control.mjs +1 -0
  556. package/build-module/validated-form-controls/components/checkbox-control.mjs.map +2 -2
  557. package/build-module/validated-form-controls/components/combobox-control.mjs +2 -1
  558. package/build-module/validated-form-controls/components/combobox-control.mjs.map +2 -2
  559. package/build-module/validated-form-controls/components/custom-select-control.mjs +1 -0
  560. package/build-module/validated-form-controls/components/custom-select-control.mjs.map +2 -2
  561. package/build-module/validated-form-controls/components/form-token-field.mjs +1 -0
  562. package/build-module/validated-form-controls/components/form-token-field.mjs.map +2 -2
  563. package/build-module/validated-form-controls/components/input-control.mjs +1 -0
  564. package/build-module/validated-form-controls/components/input-control.mjs.map +2 -2
  565. package/build-module/validated-form-controls/components/number-control.mjs +1 -0
  566. package/build-module/validated-form-controls/components/number-control.mjs.map +2 -2
  567. package/build-module/validated-form-controls/components/radio-control.mjs +1 -0
  568. package/build-module/validated-form-controls/components/radio-control.mjs.map +2 -2
  569. package/build-module/validated-form-controls/components/range-control.mjs +1 -0
  570. package/build-module/validated-form-controls/components/range-control.mjs.map +2 -2
  571. package/build-module/validated-form-controls/components/select-control.mjs +1 -0
  572. package/build-module/validated-form-controls/components/select-control.mjs.map +2 -2
  573. package/build-module/validated-form-controls/components/text-control.mjs +1 -0
  574. package/build-module/validated-form-controls/components/text-control.mjs.map +2 -2
  575. package/build-module/validated-form-controls/components/textarea-control.mjs +1 -0
  576. package/build-module/validated-form-controls/components/textarea-control.mjs.map +2 -2
  577. package/build-module/validated-form-controls/components/toggle-control.mjs +2 -1
  578. package/build-module/validated-form-controls/components/toggle-control.mjs.map +2 -2
  579. package/build-module/validated-form-controls/components/toggle-group-control.mjs +1 -0
  580. package/build-module/validated-form-controls/components/toggle-group-control.mjs.map +2 -2
  581. package/build-module/validated-form-controls/control-with-error.mjs +4 -6
  582. package/build-module/validated-form-controls/control-with-error.mjs.map +2 -2
  583. package/build-types/alignment-matrix-control/stories/index.story.d.ts +2 -2
  584. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  585. package/build-types/angle-picker-control/index.d.ts.map +1 -1
  586. package/build-types/angle-picker-control/stories/index.story.d.ts +2 -2
  587. package/build-types/angle-picker-control/stories/index.story.d.ts.map +1 -1
  588. package/build-types/animate/stories/index.story.d.ts +8 -8
  589. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  590. package/build-types/badge/stories/index.story.d.ts +1 -1
  591. package/build-types/badge/stories/index.story.d.ts.map +1 -1
  592. package/build-types/base-control/stories/index.story.d.ts +2 -2
  593. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  594. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  595. package/build-types/border-box-control/stories/index.story.d.ts +2 -2
  596. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  597. package/build-types/border-control/stories/index.story.d.ts +6 -6
  598. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  599. package/build-types/box-control/index.d.ts.map +1 -1
  600. package/build-types/box-control/stories/index.story.d.ts +8 -8
  601. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  602. package/build-types/button/deprecated.d.ts.map +1 -1
  603. package/build-types/button/index.d.ts +1 -1
  604. package/build-types/button/index.d.ts.map +1 -1
  605. package/build-types/button/stories/e2e/index.story.d.ts +2 -2
  606. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  607. package/build-types/button/stories/index.story.d.ts +9 -9
  608. package/build-types/button/stories/index.story.d.ts.map +1 -1
  609. package/build-types/button-group/index.d.ts.map +1 -1
  610. package/build-types/button-group/stories/index.story.d.ts +1 -1
  611. package/build-types/button-group/stories/index.story.d.ts.map +1 -1
  612. package/build-types/calendar/stories/date-calendar.story.d.ts +1 -1
  613. package/build-types/calendar/stories/date-calendar.story.d.ts.map +1 -1
  614. package/build-types/calendar/stories/date-range-calendar.story.d.ts +1 -1
  615. package/build-types/calendar/stories/date-range-calendar.story.d.ts.map +1 -1
  616. package/build-types/card/stories/index.story.d.ts +1 -1
  617. package/build-types/card/stories/index.story.d.ts.map +1 -1
  618. package/build-types/checkbox-control/stories/index.story.d.ts +1 -1
  619. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  620. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  621. package/build-types/circular-option-picker/circular-option-picker.d.ts +1 -0
  622. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  623. package/build-types/circular-option-picker/stories/index.story.d.ts +6 -6
  624. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  625. package/build-types/clipboard-button/index.d.ts.map +1 -1
  626. package/build-types/clipboard-button/types.d.ts +1 -0
  627. package/build-types/clipboard-button/types.d.ts.map +1 -1
  628. package/build-types/color-indicator/index.d.ts.map +1 -1
  629. package/build-types/color-indicator/stories/index.story.d.ts +1 -1
  630. package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
  631. package/build-types/color-palette/index.d.ts.map +1 -1
  632. package/build-types/color-palette/stories/index.story.d.ts +4 -4
  633. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  634. package/build-types/color-picker/stories/index.story.d.ts +1 -1
  635. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  636. package/build-types/combobox-control/stories/index.story.d.ts +5 -5
  637. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  638. package/build-types/composite/legacy/stories/index.story.d.ts +1 -1
  639. package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -1
  640. package/build-types/composite/legacy/stories/utils.d.ts +1 -1
  641. package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
  642. package/build-types/composite/stories/index.story.d.ts +1 -1
  643. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  644. package/build-types/confirm-dialog/stories/index.story.d.ts +3 -3
  645. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  646. package/build-types/custom-gradient-picker/stories/index.story.d.ts +2 -2
  647. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  648. package/build-types/custom-select-control/stories/index.story.d.ts +4 -4
  649. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  650. package/build-types/custom-select-control-v2/stories/index.story.d.ts +4 -4
  651. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  652. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  653. package/build-types/date-time/stories/date-time.story.d.ts +1 -1
  654. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  655. package/build-types/date-time/stories/date.story.d.ts +1 -1
  656. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  657. package/build-types/date-time/stories/time.story.d.ts +2 -2
  658. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  659. package/build-types/disabled/stories/index.story.d.ts +1 -1
  660. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  661. package/build-types/disclosure/index.d.ts.map +1 -1
  662. package/build-types/divider/stories/index.story.d.ts +1 -1
  663. package/build-types/divider/stories/index.story.d.ts.map +1 -1
  664. package/build-types/draggable/stories/index.story.d.ts +1 -1
  665. package/build-types/draggable/stories/index.story.d.ts.map +1 -1
  666. package/build-types/drop-zone/stories/index.story.d.ts +2 -2
  667. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  668. package/build-types/dropdown/stories/index.story.d.ts +1 -1
  669. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  670. package/build-types/dropdown-menu/stories/index.story.d.ts +1 -1
  671. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  672. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +2 -2
  673. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
  674. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +4 -4
  675. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
  676. package/build-types/elevation/stories/index.story.d.ts +1 -1
  677. package/build-types/elevation/stories/index.story.d.ts.map +1 -1
  678. package/build-types/external-link/index.d.ts.map +1 -1
  679. package/build-types/external-link/stories/index.story.d.ts +1 -1
  680. package/build-types/external-link/stories/index.story.d.ts.map +1 -1
  681. package/build-types/flex/stories/index.story.d.ts +1 -1
  682. package/build-types/flex/stories/index.story.d.ts.map +1 -1
  683. package/build-types/focal-point-picker/stories/index.story.d.ts +5 -5
  684. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  685. package/build-types/font-size-picker/index.d.ts.map +1 -1
  686. package/build-types/font-size-picker/stories/e2e/index.story.d.ts +1 -1
  687. package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +1 -1
  688. package/build-types/font-size-picker/stories/index.story.d.ts +1 -1
  689. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  690. package/build-types/form-file-upload/index.d.ts.map +1 -1
  691. package/build-types/form-file-upload/stories/index.story.d.ts +6 -6
  692. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  693. package/build-types/form-toggle/index.d.ts.map +1 -1
  694. package/build-types/form-toggle/stories/index.story.d.ts +1 -1
  695. package/build-types/form-toggle/stories/index.story.d.ts.map +1 -1
  696. package/build-types/form-token-field/stories/index.story.d.ts +1 -1
  697. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  698. package/build-types/form-token-field/token-input.d.ts.map +1 -1
  699. package/build-types/gradient-picker/stories/index.story.d.ts +4 -4
  700. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  701. package/build-types/grid/stories/index.story.d.ts +1 -1
  702. package/build-types/grid/stories/index.story.d.ts.map +1 -1
  703. package/build-types/guide/stories/index.story.d.ts +2 -2
  704. package/build-types/guide/stories/index.story.d.ts.map +1 -1
  705. package/build-types/h-stack/stories/e2e/index.story.d.ts +1 -1
  706. package/build-types/h-stack/stories/e2e/index.story.d.ts.map +1 -1
  707. package/build-types/h-stack/stories/index.story.d.ts +1 -1
  708. package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
  709. package/build-types/heading/stories/index.story.d.ts +1 -1
  710. package/build-types/heading/stories/index.story.d.ts.map +1 -1
  711. package/build-types/higher-order/navigate-regions/index.d.ts.map +1 -1
  712. package/build-types/higher-order/with-focus-outside/index.d.ts.map +1 -1
  713. package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
  714. package/build-types/icon/stories/index.story.d.ts +5 -5
  715. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  716. package/build-types/input-control/index.d.ts.map +1 -1
  717. package/build-types/input-control/stories/index.story.d.ts +8 -8
  718. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  719. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  720. package/build-types/item-group/stories/index.story.d.ts +1 -1
  721. package/build-types/item-group/stories/index.story.d.ts.map +1 -1
  722. package/build-types/keyboard-shortcuts/stories/index.story.d.ts +2 -2
  723. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  724. package/build-types/menu/stories/index.story.d.ts +1 -1
  725. package/build-types/menu/stories/index.story.d.ts.map +1 -1
  726. package/build-types/menu-group/stories/index.story.d.ts +2 -2
  727. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  728. package/build-types/menu-item/index.d.ts.map +1 -1
  729. package/build-types/menu-item/stories/index.story.d.ts +5 -5
  730. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  731. package/build-types/menu-items-choice/stories/index.story.d.ts +1 -1
  732. package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
  733. package/build-types/modal/index.d.ts.map +1 -1
  734. package/build-types/modal/stories/index.story.d.ts +1 -1
  735. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  736. package/build-types/navigable-container/menu.d.ts.map +1 -1
  737. package/build-types/navigable-container/stories/navigable-menu.story.d.ts +1 -1
  738. package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
  739. package/build-types/navigable-container/stories/tabbable-container.story.d.ts +1 -1
  740. package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
  741. package/build-types/navigable-container/tabbable.d.ts.map +1 -1
  742. package/build-types/navigation/back-button/index.d.ts.map +1 -1
  743. package/build-types/navigation/stories/index.story.d.ts +7 -7
  744. package/build-types/navigation/stories/index.story.d.ts.map +1 -1
  745. package/build-types/navigation/stories/utils/controlled-state.d.ts +1 -1
  746. package/build-types/navigation/stories/utils/controlled-state.d.ts.map +1 -1
  747. package/build-types/navigation/stories/utils/default.d.ts +1 -1
  748. package/build-types/navigation/stories/utils/default.d.ts.map +1 -1
  749. package/build-types/navigation/stories/utils/group.d.ts +1 -1
  750. package/build-types/navigation/stories/utils/group.d.ts.map +1 -1
  751. package/build-types/navigation/stories/utils/hide-if-empty.d.ts +1 -1
  752. package/build-types/navigation/stories/utils/hide-if-empty.d.ts.map +1 -1
  753. package/build-types/navigation/stories/utils/more-examples.d.ts +1 -1
  754. package/build-types/navigation/stories/utils/more-examples.d.ts.map +1 -1
  755. package/build-types/navigation/stories/utils/search.d.ts +1 -1
  756. package/build-types/navigation/stories/utils/search.d.ts.map +1 -1
  757. package/build-types/navigator/stories/index.story.d.ts +1 -1
  758. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  759. package/build-types/notice/stories/index.story.d.ts +6 -6
  760. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  761. package/build-types/number-control/index.d.ts.map +1 -1
  762. package/build-types/number-control/stories/index.story.d.ts +2 -2
  763. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  764. package/build-types/palette-edit/stories/index.story.d.ts +3 -3
  765. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  766. package/build-types/panel/body.d.ts.map +1 -1
  767. package/build-types/panel/index.d.ts.map +1 -1
  768. package/build-types/panel/row.d.ts.map +1 -1
  769. package/build-types/panel/stories/index.story.d.ts +1 -1
  770. package/build-types/panel/stories/index.story.d.ts.map +1 -1
  771. package/build-types/placeholder/stories/index.story.d.ts +1 -1
  772. package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
  773. package/build-types/popover/stories/index.story.d.ts +1 -1
  774. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  775. package/build-types/private-apis.d.ts.map +1 -1
  776. package/build-types/progress-bar/index.d.ts.map +1 -1
  777. package/build-types/progress-bar/stories/index.story.d.ts +2 -2
  778. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  779. package/build-types/query-controls/stories/index.story.d.ts +2 -2
  780. package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
  781. package/build-types/radio-control/stories/index.story.d.ts +1 -1
  782. package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
  783. package/build-types/radio-group/index.d.ts.map +1 -1
  784. package/build-types/radio-group/radio.d.ts.map +1 -1
  785. package/build-types/radio-group/stories/index.story.d.ts +1 -1
  786. package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
  787. package/build-types/range-control/index.d.ts.map +1 -1
  788. package/build-types/range-control/stories/index.story.d.ts +1 -1
  789. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  790. package/build-types/resizable-box/index.d.ts.map +1 -1
  791. package/build-types/resizable-box/stories/index.story.d.ts +3 -3
  792. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  793. package/build-types/responsive-wrapper/stories/index.story.d.ts +2 -2
  794. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  795. package/build-types/sandbox/stories/index.story.d.ts +2 -2
  796. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  797. package/build-types/scroll-lock/stories/index.story.d.ts +1 -1
  798. package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
  799. package/build-types/scrollable/stories/index.story.d.ts +1 -1
  800. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  801. package/build-types/search-control/index.d.ts.map +1 -1
  802. package/build-types/search-control/stories/index.story.d.ts +2 -2
  803. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  804. package/build-types/select-control/index.d.ts.map +1 -1
  805. package/build-types/select-control/stories/index.story.d.ts +6 -6
  806. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  807. package/build-types/shortcut/stories/index.story.d.ts +2 -2
  808. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  809. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  810. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
  811. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
  812. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts +2 -3
  813. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  814. package/build-types/slot-fill/context.d.ts +2 -2
  815. package/build-types/slot-fill/context.d.ts.map +1 -1
  816. package/build-types/slot-fill/fill.d.ts +1 -1
  817. package/build-types/slot-fill/fill.d.ts.map +1 -1
  818. package/build-types/slot-fill/index.d.ts +3 -4
  819. package/build-types/slot-fill/index.d.ts.map +1 -1
  820. package/build-types/slot-fill/provider.d.ts.map +1 -1
  821. package/build-types/slot-fill/stories/index.story.d.ts +1 -1
  822. package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
  823. package/build-types/slot-fill/types.d.ts +23 -25
  824. package/build-types/slot-fill/types.d.ts.map +1 -1
  825. package/build-types/snackbar/index.d.ts.map +1 -1
  826. package/build-types/snackbar/stories/index.story.d.ts +1 -1
  827. package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
  828. package/build-types/snackbar/stories/list.story.d.ts +1 -1
  829. package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
  830. package/build-types/spacer/stories/index.story.d.ts +1 -1
  831. package/build-types/spacer/stories/index.story.d.ts.map +1 -1
  832. package/build-types/spinner/index.d.ts.map +1 -1
  833. package/build-types/spinner/stories/index.story.d.ts +1 -1
  834. package/build-types/spinner/stories/index.story.d.ts.map +1 -1
  835. package/build-types/surface/stories/index.story.d.ts +1 -1
  836. package/build-types/surface/stories/index.story.d.ts.map +1 -1
  837. package/build-types/tab-panel/index.d.ts.map +1 -1
  838. package/build-types/tab-panel/stories/index.story.d.ts +5 -5
  839. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  840. package/build-types/tabs/stories/index.story.d.ts +8 -8
  841. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  842. package/build-types/text/stories/index.story.d.ts +4 -4
  843. package/build-types/text/stories/index.story.d.ts.map +1 -1
  844. package/build-types/text-control/index.d.ts.map +1 -1
  845. package/build-types/text-control/stories/index.story.d.ts +1 -1
  846. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  847. package/build-types/text-highlight/index.d.ts +4 -1
  848. package/build-types/text-highlight/index.d.ts.map +1 -1
  849. package/build-types/text-highlight/stories/index.story.d.ts +1 -1
  850. package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
  851. package/build-types/textarea-control/index.d.ts.map +1 -1
  852. package/build-types/textarea-control/stories/index.story.d.ts +1 -1
  853. package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
  854. package/build-types/theme/stories/index.story.d.ts +2 -2
  855. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  856. package/build-types/tip/stories/index.story.d.ts +1 -1
  857. package/build-types/tip/stories/index.story.d.ts.map +1 -1
  858. package/build-types/toggle-control/index.d.ts.map +1 -1
  859. package/build-types/toggle-control/stories/index.story.d.ts +3 -3
  860. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  861. package/build-types/toggle-group-control/stories/index.story.d.ts +1 -1
  862. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  863. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  864. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  865. package/build-types/toolbar/stories/index.story.d.ts +4 -4
  866. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  867. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  868. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  869. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  870. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts.map +1 -1
  871. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  872. package/build-types/tools-panel/stories/index.story.d.ts +1 -1
  873. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  874. package/build-types/tooltip/index.d.ts.map +1 -1
  875. package/build-types/tooltip/stories/index.story.d.ts +2 -2
  876. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  877. package/build-types/tree-grid/cell.d.ts.map +1 -1
  878. package/build-types/tree-grid/index.d.ts.map +1 -1
  879. package/build-types/tree-grid/item.d.ts.map +1 -1
  880. package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
  881. package/build-types/tree-grid/row.d.ts.map +1 -1
  882. package/build-types/tree-grid/stories/index.story.d.ts +2 -2
  883. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  884. package/build-types/tree-select/index.d.ts.map +1 -1
  885. package/build-types/tree-select/stories/index.story.d.ts +2 -2
  886. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  887. package/build-types/truncate/stories/index.story.d.ts +1 -1
  888. package/build-types/truncate/stories/index.story.d.ts.map +1 -1
  889. package/build-types/unit-control/index.d.ts.map +1 -1
  890. package/build-types/unit-control/stories/index.story.d.ts +1 -1
  891. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  892. package/build-types/utils/dropdown-motion.d.ts.map +1 -1
  893. package/build-types/v-stack/stories/e2e/index.story.d.ts +1 -1
  894. package/build-types/v-stack/stories/e2e/index.story.d.ts.map +1 -1
  895. package/build-types/v-stack/stories/index.story.d.ts +2 -2
  896. package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
  897. package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
  898. package/build-types/validated-form-controls/components/stories/checkbox-control.story.d.ts +1 -1
  899. package/build-types/validated-form-controls/components/stories/checkbox-control.story.d.ts.map +1 -1
  900. package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts +1 -1
  901. package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts.map +1 -1
  902. package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts +1 -1
  903. package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts.map +1 -1
  904. package/build-types/validated-form-controls/components/stories/form-token-field.story.d.ts +1 -1
  905. package/build-types/validated-form-controls/components/stories/form-token-field.story.d.ts.map +1 -1
  906. package/build-types/validated-form-controls/components/stories/input-control.story.d.ts +1 -1
  907. package/build-types/validated-form-controls/components/stories/input-control.story.d.ts.map +1 -1
  908. package/build-types/validated-form-controls/components/stories/number-control.story.d.ts +1 -1
  909. package/build-types/validated-form-controls/components/stories/number-control.story.d.ts.map +1 -1
  910. package/build-types/validated-form-controls/components/stories/overview.story.d.ts +1 -1
  911. package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +1 -1
  912. package/build-types/validated-form-controls/components/stories/radio-control.story.d.ts +1 -1
  913. package/build-types/validated-form-controls/components/stories/radio-control.story.d.ts.map +1 -1
  914. package/build-types/validated-form-controls/components/stories/range-control.story.d.ts +1 -1
  915. package/build-types/validated-form-controls/components/stories/range-control.story.d.ts.map +1 -1
  916. package/build-types/validated-form-controls/components/stories/select-control.story.d.ts +1 -1
  917. package/build-types/validated-form-controls/components/stories/select-control.story.d.ts.map +1 -1
  918. package/build-types/validated-form-controls/components/stories/story-utils.d.ts +1 -1
  919. package/build-types/validated-form-controls/components/stories/story-utils.d.ts.map +1 -1
  920. package/build-types/validated-form-controls/components/stories/text-control.story.d.ts +1 -1
  921. package/build-types/validated-form-controls/components/stories/text-control.story.d.ts.map +1 -1
  922. package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts +1 -1
  923. package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts.map +1 -1
  924. package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts +1 -1
  925. package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts.map +1 -1
  926. package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts +1 -1
  927. package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts.map +1 -1
  928. package/build-types/view/stories/index.story.d.ts +1 -1
  929. package/build-types/view/stories/index.story.d.ts.map +1 -1
  930. package/build-types/visually-hidden/stories/index.story.d.ts +1 -1
  931. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
  932. package/build-types/z-stack/stories/index.story.d.ts +1 -1
  933. package/build-types/z-stack/stories/index.story.d.ts.map +1 -1
  934. package/package.json +26 -24
  935. package/src/alignment-matrix-control/stories/index.story.tsx +1 -1
  936. package/src/angle-picker-control/index.tsx +1 -0
  937. package/src/angle-picker-control/stories/index.story.tsx +1 -1
  938. package/src/animate/stories/index.story.tsx +1 -1
  939. package/src/badge/stories/index.story.tsx +1 -1
  940. package/src/base-control/stories/index.story.tsx +4 -2
  941. package/src/border-box-control/border-box-control-split-controls/component.tsx +9 -0
  942. package/src/border-box-control/stories/index.story.tsx +3 -1
  943. package/src/border-box-control/test/index.tsx +51 -20
  944. package/src/border-control/stories/index.story.tsx +2 -1
  945. package/src/border-control/test/index.js +37 -34
  946. package/src/box-control/index.tsx +6 -0
  947. package/src/box-control/stories/index.story.tsx +3 -2
  948. package/src/button/deprecated.tsx +2 -0
  949. package/src/button/index.tsx +16 -15
  950. package/src/button/stories/e2e/index.story.tsx +9 -5
  951. package/src/button/stories/index.story.tsx +14 -11
  952. package/src/button/test/index.tsx +0 -5
  953. package/src/button-group/index.tsx +1 -0
  954. package/src/button-group/stories/index.story.tsx +5 -3
  955. package/src/calendar/stories/date-calendar.story.tsx +1 -1
  956. package/src/calendar/stories/date-range-calendar.story.tsx +1 -1
  957. package/src/card/stories/index.story.tsx +4 -2
  958. package/src/checkbox-control/stories/index.story.tsx +1 -1
  959. package/src/circular-option-picker/circular-option-picker-option.tsx +2 -1
  960. package/src/circular-option-picker/circular-option-picker.tsx +2 -0
  961. package/src/circular-option-picker/stories/index.story.tsx +1 -1
  962. package/src/clipboard-button/index.tsx +2 -0
  963. package/src/clipboard-button/types.ts +1 -0
  964. package/src/color-indicator/index.tsx +1 -0
  965. package/src/color-indicator/stories/index.story.tsx +1 -1
  966. package/src/color-palette/index.tsx +1 -0
  967. package/src/color-palette/stories/index.story.tsx +1 -1
  968. package/src/color-picker/stories/index.story.tsx +1 -1
  969. package/src/combobox-control/index.tsx +1 -1
  970. package/src/combobox-control/stories/index.story.tsx +2 -1
  971. package/src/composite/legacy/stories/index.story.tsx +1 -1
  972. package/src/composite/legacy/stories/utils.tsx +1 -1
  973. package/src/composite/stories/index.story.tsx +1 -1
  974. package/src/confirm-dialog/stories/index.story.tsx +6 -2
  975. package/src/custom-gradient-picker/stories/index.story.tsx +1 -1
  976. package/src/custom-select-control/stories/index.story.tsx +2 -1
  977. package/src/custom-select-control-v2/stories/index.story.tsx +1 -1
  978. package/src/date-time/date-time/index.tsx +1 -0
  979. package/src/date-time/stories/date-time.story.tsx +1 -1
  980. package/src/date-time/stories/date.story.tsx +1 -1
  981. package/src/date-time/stories/time.story.tsx +1 -1
  982. package/src/disabled/stories/index.story.tsx +1 -1
  983. package/src/disclosure/index.tsx +1 -0
  984. package/src/divider/stories/index.story.tsx +1 -1
  985. package/src/draggable/stories/index.story.tsx +1 -1
  986. package/src/drop-zone/stories/index.story.tsx +1 -1
  987. package/src/dropdown/stories/index.story.tsx +2 -1
  988. package/src/dropdown-menu/stories/index.story.tsx +1 -1
  989. package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
  990. package/src/duotone-picker/stories/duotone-swatch.story.tsx +1 -1
  991. package/src/elevation/stories/index.story.tsx +1 -1
  992. package/src/external-link/index.tsx +1 -0
  993. package/src/external-link/stories/index.story.tsx +1 -1
  994. package/src/flex/stories/index.story.tsx +1 -1
  995. package/src/focal-point-picker/stories/index.story.tsx +1 -1
  996. package/src/font-size-picker/index.tsx +1 -0
  997. package/src/font-size-picker/stories/e2e/index.story.tsx +3 -1
  998. package/src/font-size-picker/stories/index.story.tsx +2 -1
  999. package/src/form-file-upload/index.tsx +2 -0
  1000. package/src/form-file-upload/stories/index.story.tsx +2 -2
  1001. package/src/form-toggle/index.tsx +1 -0
  1002. package/src/form-toggle/stories/index.story.tsx +1 -1
  1003. package/src/form-token-field/stories/index.story.tsx +3 -1
  1004. package/src/form-token-field/token-input.tsx +1 -0
  1005. package/src/form-token-field/token.tsx +2 -2
  1006. package/src/gradient-picker/stories/index.story.tsx +1 -1
  1007. package/src/grid/stories/index.story.tsx +1 -1
  1008. package/src/guide/stories/index.story.tsx +6 -2
  1009. package/src/h-stack/stories/e2e/index.story.tsx +1 -1
  1010. package/src/h-stack/stories/index.story.tsx +1 -1
  1011. package/src/heading/stories/index.story.tsx +1 -1
  1012. package/src/higher-order/navigate-regions/index.tsx +7 -5
  1013. package/src/higher-order/with-fallback-styles/index.tsx +1 -1
  1014. package/src/higher-order/with-focus-outside/index.tsx +25 -24
  1015. package/src/higher-order/with-spoken-messages/index.tsx +10 -7
  1016. package/src/icon/stories/index.story.tsx +1 -1
  1017. package/src/input-control/index.tsx +1 -0
  1018. package/src/input-control/stories/index.story.tsx +3 -2
  1019. package/src/input-control/styles/input-control-styles.tsx +0 -4
  1020. package/src/item-group/stories/index.story.tsx +1 -1
  1021. package/src/keyboard-shortcuts/stories/index.story.tsx +1 -1
  1022. package/src/menu/stories/index.story.tsx +5 -2
  1023. package/src/menu-group/stories/index.story.tsx +1 -1
  1024. package/src/menu-item/index.tsx +1 -0
  1025. package/src/menu-item/stories/index.story.tsx +1 -1
  1026. package/src/menu-items-choice/stories/index.story.tsx +1 -1
  1027. package/src/modal/index.tsx +1 -0
  1028. package/src/modal/stories/index.story.tsx +11 -3
  1029. package/src/navigable-container/menu.tsx +1 -0
  1030. package/src/navigable-container/stories/navigable-menu.story.tsx +1 -1
  1031. package/src/navigable-container/stories/tabbable-container.story.tsx +1 -1
  1032. package/src/navigable-container/tabbable.tsx +1 -0
  1033. package/src/navigation/back-button/index.tsx +1 -0
  1034. package/src/navigation/stories/index.story.tsx +1 -1
  1035. package/src/navigation/stories/utils/controlled-state.tsx +4 -1
  1036. package/src/navigation/stories/utils/default.tsx +1 -1
  1037. package/src/navigation/stories/utils/group.tsx +1 -1
  1038. package/src/navigation/stories/utils/hide-if-empty.tsx +1 -1
  1039. package/src/navigation/stories/utils/more-examples.tsx +1 -1
  1040. package/src/navigation/stories/utils/search.tsx +1 -1
  1041. package/src/navigator/stories/index.story.tsx +2 -1
  1042. package/src/navigator/test/index.tsx +1 -1
  1043. package/src/notice/stories/index.story.tsx +1 -1
  1044. package/src/number-control/index.tsx +1 -0
  1045. package/src/number-control/stories/index.story.tsx +2 -1
  1046. package/src/palette-edit/stories/index.story.tsx +1 -1
  1047. package/src/panel/body.tsx +1 -0
  1048. package/src/panel/index.tsx +1 -0
  1049. package/src/panel/row.tsx +1 -0
  1050. package/src/panel/stories/index.story.tsx +1 -1
  1051. package/src/placeholder/stories/index.story.tsx +1 -1
  1052. package/src/popover/stories/index.story.tsx +9 -2
  1053. package/src/private-apis.ts +2 -0
  1054. package/src/progress-bar/index.tsx +1 -0
  1055. package/src/progress-bar/stories/index.story.tsx +1 -1
  1056. package/src/query-controls/stories/index.story.tsx +1 -1
  1057. package/src/radio-control/stories/index.story.tsx +1 -1
  1058. package/src/radio-group/index.tsx +1 -0
  1059. package/src/radio-group/radio.tsx +3 -0
  1060. package/src/radio-group/stories/index.story.tsx +1 -1
  1061. package/src/range-control/index.tsx +1 -0
  1062. package/src/range-control/stories/index.story.tsx +5 -1
  1063. package/src/resizable-box/index.tsx +1 -0
  1064. package/src/resizable-box/stories/index.story.tsx +1 -1
  1065. package/src/responsive-wrapper/stories/index.story.tsx +1 -1
  1066. package/src/sandbox/stories/index.story.tsx +1 -1
  1067. package/src/scroll-lock/stories/index.story.tsx +6 -2
  1068. package/src/scrollable/stories/index.story.tsx +1 -1
  1069. package/src/search-control/index.tsx +1 -0
  1070. package/src/search-control/stories/index.story.tsx +1 -1
  1071. package/src/select-control/index.tsx +3 -0
  1072. package/src/select-control/stories/index.story.tsx +3 -1
  1073. package/src/shortcut/stories/index.story.tsx +1 -1
  1074. package/src/slot-fill/bubbles-virtually/slot.tsx +16 -9
  1075. package/src/slot-fill/bubbles-virtually/use-slot-fills.ts +30 -4
  1076. package/src/slot-fill/bubbles-virtually/use-slot.ts +7 -3
  1077. package/src/slot-fill/context.ts +15 -4
  1078. package/src/slot-fill/fill.tsx +74 -0
  1079. package/src/slot-fill/index.tsx +17 -33
  1080. package/src/slot-fill/provider.tsx +49 -35
  1081. package/src/slot-fill/slot.tsx +4 -4
  1082. package/src/slot-fill/stories/index.story.tsx +1 -1
  1083. package/src/slot-fill/test/__snapshots__/slot.js.snap +14 -0
  1084. package/src/slot-fill/test/slot.js +24 -1
  1085. package/src/slot-fill/types.ts +16 -32
  1086. package/src/snackbar/index.tsx +1 -0
  1087. package/src/snackbar/stories/index.story.tsx +1 -1
  1088. package/src/snackbar/stories/list.story.tsx +1 -1
  1089. package/src/spacer/stories/index.story.tsx +1 -1
  1090. package/src/spinner/index.tsx +1 -0
  1091. package/src/spinner/stories/index.story.tsx +1 -1
  1092. package/src/surface/stories/index.story.tsx +1 -1
  1093. package/src/tab-panel/index.tsx +1 -0
  1094. package/src/tab-panel/stories/index.story.tsx +1 -1
  1095. package/src/tabs/stories/index.story.tsx +11 -3
  1096. package/src/text/stories/index.story.tsx +1 -1
  1097. package/src/text-control/index.tsx +1 -0
  1098. package/src/text-control/stories/index.story.tsx +2 -1
  1099. package/src/text-highlight/index.tsx +2 -0
  1100. package/src/text-highlight/stories/index.story.tsx +1 -1
  1101. package/src/textarea-control/index.tsx +1 -0
  1102. package/src/textarea-control/stories/index.story.tsx +1 -1
  1103. package/src/theme/stories/index.story.tsx +8 -4
  1104. package/src/tip/stories/index.story.tsx +1 -1
  1105. package/src/toggle-control/index.tsx +1 -0
  1106. package/src/toggle-control/stories/index.story.tsx +1 -1
  1107. package/src/toggle-group-control/stories/index.story.tsx +1 -1
  1108. package/src/toggle-group-control/toggle-group-control/as-button-group.tsx +1 -0
  1109. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +1 -0
  1110. package/src/toggle-group-control/toggle-group-control-option/component.tsx +1 -0
  1111. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -0
  1112. package/src/toolbar/stories/index.story.tsx +1 -1
  1113. package/src/toolbar/toolbar/index.tsx +1 -0
  1114. package/src/toolbar/toolbar/toolbar-container.tsx +1 -0
  1115. package/src/toolbar/toolbar-button/index.tsx +1 -0
  1116. package/src/toolbar/toolbar-dropdown-menu/index.tsx +1 -0
  1117. package/src/toolbar/toolbar-item/index.tsx +1 -0
  1118. package/src/tools-panel/stories/index.story.tsx +1 -1
  1119. package/src/tooltip/index.tsx +1 -0
  1120. package/src/tooltip/stories/index.story.tsx +14 -4
  1121. package/src/tree-grid/cell.tsx +1 -0
  1122. package/src/tree-grid/index.tsx +1 -0
  1123. package/src/tree-grid/item.tsx +1 -0
  1124. package/src/tree-grid/roving-tab-index-item.tsx +1 -0
  1125. package/src/tree-grid/row.tsx +1 -0
  1126. package/src/tree-grid/stories/index.story.tsx +6 -2
  1127. package/src/tree-select/index.tsx +2 -0
  1128. package/src/tree-select/stories/index.story.tsx +2 -1
  1129. package/src/truncate/stories/index.story.tsx +1 -1
  1130. package/src/unit-control/index.tsx +1 -0
  1131. package/src/unit-control/stories/index.story.tsx +3 -1
  1132. package/src/utils/dropdown-motion.ts +1 -0
  1133. package/src/v-stack/stories/e2e/index.story.tsx +1 -1
  1134. package/src/v-stack/stories/index.story.tsx +1 -1
  1135. package/src/validated-form-controls/components/checkbox-control.tsx +1 -0
  1136. package/src/validated-form-controls/components/combobox-control.tsx +1 -0
  1137. package/src/validated-form-controls/components/custom-select-control.tsx +1 -0
  1138. package/src/validated-form-controls/components/form-token-field.tsx +1 -0
  1139. package/src/validated-form-controls/components/input-control.tsx +1 -0
  1140. package/src/validated-form-controls/components/number-control.tsx +1 -0
  1141. package/src/validated-form-controls/components/radio-control.tsx +1 -0
  1142. package/src/validated-form-controls/components/range-control.tsx +1 -0
  1143. package/src/validated-form-controls/components/select-control.tsx +1 -0
  1144. package/src/validated-form-controls/components/stories/checkbox-control.story.tsx +1 -1
  1145. package/src/validated-form-controls/components/stories/combobox-control.story.tsx +1 -1
  1146. package/src/validated-form-controls/components/stories/custom-select-control.story.tsx +1 -1
  1147. package/src/validated-form-controls/components/stories/form-token-field.story.tsx +1 -1
  1148. package/src/validated-form-controls/components/stories/input-control.story.tsx +1 -1
  1149. package/src/validated-form-controls/components/stories/number-control.story.tsx +1 -1
  1150. package/src/validated-form-controls/components/stories/overview.story.tsx +1 -1
  1151. package/src/validated-form-controls/components/stories/radio-control.story.tsx +1 -1
  1152. package/src/validated-form-controls/components/stories/range-control.story.tsx +1 -1
  1153. package/src/validated-form-controls/components/stories/select-control.story.tsx +1 -1
  1154. package/src/validated-form-controls/components/stories/story-utils.tsx +1 -1
  1155. package/src/validated-form-controls/components/stories/text-control.story.tsx +1 -1
  1156. package/src/validated-form-controls/components/stories/textarea-control.story.tsx +1 -1
  1157. package/src/validated-form-controls/components/stories/toggle-control.story.tsx +1 -1
  1158. package/src/validated-form-controls/components/stories/toggle-group-control.story.tsx +1 -1
  1159. package/src/validated-form-controls/components/text-control.tsx +1 -0
  1160. package/src/validated-form-controls/components/textarea-control.tsx +1 -0
  1161. package/src/validated-form-controls/components/toggle-control.tsx +1 -0
  1162. package/src/validated-form-controls/components/toggle-group-control.tsx +1 -0
  1163. package/src/validated-form-controls/control-with-error.tsx +1 -0
  1164. package/src/view/stories/index.story.tsx +1 -1
  1165. package/src/visually-hidden/stories/index.story.tsx +1 -1
  1166. package/src/z-stack/stories/index.story.tsx +1 -1
  1167. package/build/slot-fill/bubbles-virtually/fill.cjs +0 -63
  1168. package/build/slot-fill/bubbles-virtually/fill.cjs.map +0 -7
  1169. package/build/slot-fill/bubbles-virtually/slot-fill-context.cjs +0 -59
  1170. package/build/slot-fill/bubbles-virtually/slot-fill-context.cjs.map +0 -7
  1171. package/build/slot-fill/bubbles-virtually/slot-fill-provider.cjs +0 -105
  1172. package/build/slot-fill/bubbles-virtually/slot-fill-provider.cjs.map +0 -7
  1173. package/build-module/slot-fill/bubbles-virtually/fill.mjs +0 -32
  1174. package/build-module/slot-fill/bubbles-virtually/fill.mjs.map +0 -7
  1175. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.mjs +0 -28
  1176. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.mjs.map +0 -7
  1177. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.mjs +0 -74
  1178. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.mjs.map +0 -7
  1179. package/build-types/slot-fill/bubbles-virtually/fill.d.ts +0 -3
  1180. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +0 -1
  1181. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts +0 -7
  1182. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +0 -1
  1183. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts +0 -3
  1184. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +0 -1
  1185. package/src/slot-fill/bubbles-virtually/fill.tsx +0 -50
  1186. package/src/slot-fill/bubbles-virtually/slot-fill-context.ts +0 -34
  1187. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +0 -106
  1188. package/src/slot-fill/fill.ts +0 -32
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/flex/flex/hook.ts"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\n\nimport { useContextSystem } from '../../context';\nimport { useResponsiveValue } from '../../utils/use-responsive-value';\nimport { space } from '../../utils/space';\nimport * as styles from '../styles';\nimport { useCx } from '../../utils';\nfunction useDeprecatedProps(props) {\n const {\n isReversed,\n ...otherProps\n } = props;\n if (typeof isReversed !== 'undefined') {\n deprecated('Flex isReversed', {\n alternative: 'Flex direction=\"row-reverse\" or \"column-reverse\"',\n since: '5.9'\n });\n return {\n ...otherProps,\n direction: isReversed ? 'row-reverse' : 'row'\n };\n }\n return otherProps;\n}\nexport function useFlex(props) {\n const {\n align,\n className,\n direction: directionProp = 'row',\n expanded = true,\n gap = 2,\n justify = 'space-between',\n wrap = false,\n ...otherProps\n } = useContextSystem(useDeprecatedProps(props), 'Flex');\n const directionAsArray = Array.isArray(directionProp) ? directionProp : [directionProp];\n const direction = useResponsiveValue(directionAsArray);\n const isColumn = typeof direction === 'string' && !!direction.includes('column');\n const cx = useCx();\n const classes = useMemo(() => {\n const base = /*#__PURE__*/css({\n alignItems: align !== null && align !== void 0 ? align : isColumn ? 'normal' : 'center',\n flexDirection: direction,\n flexWrap: wrap ? 'wrap' : undefined,\n gap: space(gap),\n justifyContent: justify,\n height: isColumn && expanded ? '100%' : undefined,\n width: !isColumn && expanded ? '100%' : undefined\n }, process.env.NODE_ENV === \"production\" ? \"\" : \";label:base;\", process.env.NODE_ENV === \"production\" ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhvb2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0VlIiwiZmlsZSI6Imhvb2sudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1x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== */\");\n return cx(styles.Flex, base, isColumn ? styles.ItemsColumn : styles.ItemsRow, className);\n }, [align, className, cx, direction, expanded, gap, isColumn, justify, wrap]);\n return {\n ...otherProps,\n className: classes,\n isColumn\n };\n}"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAoB;AAKpB,qBAAwB;AACxB,wBAAuB;AAMvB,qBAAiC;AACjC,kCAAmC;AACnC,mBAAsB;AACtB,aAAwB;AACxB,mBAAsB;AACtB,SAAS,mBAAmB,OAAO;AACjC,QAAM;AAAA,IACJ;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,MAAI,OAAO,eAAe,aAAa;AACrC,0BAAAA,SAAW,mBAAmB;AAAA,MAC5B,aAAa;AAAA,MACb,OAAO;AAAA,IACT,CAAC;AACD,WAAO;AAAA,MACL,GAAG;AAAA,MACH,WAAW,aAAa,gBAAgB;AAAA,IAC1C;AAAA,EACF;AACA,SAAO;AACT;AACO,SAAS,QAAQ,OAAO;AAC7B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,IACP,GAAG;AAAA,EACL,QAAI,iCAAiB,mBAAmB,KAAK,GAAG,MAAM;AACtD,QAAM,mBAAmB,MAAM,QAAQ,aAAa,IAAI,gBAAgB,CAAC,aAAa;AACtF,QAAM,gBAAY,gDAAmB,gBAAgB;AACrD,QAAM,WAAW,OAAO,cAAc,YAAY,CAAC,CAAC,UAAU,SAAS,QAAQ;AAC/E,QAAM,SAAK,oBAAM;AACjB,QAAM,cAAU,wBAAQ,MAAM;AAC5B,UAAM,OAAoB,sCAAI;AAAA,MAC5B,YAAY,UAAU,QAAQ,UAAU,SAAS,QAAQ,WAAW,WAAW;AAAA,MAC/E,eAAe;AAAA,MACf,UAAU,OAAO,SAAS;AAAA,MAC1B,SAAK,oBAAM,GAAG;AAAA,MACd,gBAAgB;AAAA,MAChB,QAAQ,YAAY,WAAW,SAAS;AAAA,MACxC,OAAO,CAAC,YAAY,WAAW,SAAS;AAAA,IAC1C,GAAG,QAAQ,IAAI,aAAa,eAAe,KAAK,gBAAgB,QAAQ,IAAI,aAAa,eAAe,KAAK,i4GAAi4G;AAC9+G,WAAO,GAAU,aAAM,MAAM,WAAkB,qBAAqB,iBAAU,SAAS;AAAA,EACzF,GAAG,CAAC,OAAO,WAAW,IAAI,WAAW,UAAU,KAAK,UAAU,SAAS,IAAI,CAAC;AAC5E,SAAO;AAAA,IACL,GAAG;AAAA,IACH,WAAW;AAAA,IACX;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\n\nimport { useContextSystem } from '../../context';\nimport { useResponsiveValue } from '../../utils/use-responsive-value';\nimport { space } from '../../utils/space';\nimport * as styles from '../styles';\nimport { useCx } from '../../utils';\nfunction useDeprecatedProps(props) {\n const {\n isReversed,\n ...otherProps\n } = props;\n if (typeof isReversed !== 'undefined') {\n deprecated('Flex isReversed', {\n alternative: 'Flex direction=\"row-reverse\" or \"column-reverse\"',\n since: '5.9'\n });\n return {\n ...otherProps,\n direction: isReversed ? 'row-reverse' : 'row'\n };\n }\n return otherProps;\n}\nexport function useFlex(props) {\n const {\n align,\n className,\n direction: directionProp = 'row',\n expanded = true,\n gap = 2,\n justify = 'space-between',\n wrap = false,\n ...otherProps\n } = useContextSystem(useDeprecatedProps(props), 'Flex');\n const directionAsArray = Array.isArray(directionProp) ? directionProp : [directionProp];\n const direction = useResponsiveValue(directionAsArray);\n const isColumn = typeof direction === 'string' && !!direction.includes('column');\n const cx = useCx();\n const classes = useMemo(() => {\n const base = /*#__PURE__*/css({\n alignItems: align ?? (isColumn ? 'normal' : 'center'),\n flexDirection: direction,\n flexWrap: wrap ? 'wrap' : undefined,\n gap: space(gap),\n justifyContent: justify,\n height: isColumn && expanded ? '100%' : undefined,\n width: !isColumn && expanded ? '100%' : undefined\n }, process.env.NODE_ENV === \"production\" ? \"\" : \";label:base;\", process.env.NODE_ENV === \"production\" ? \"\" : \"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImhvb2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0VlIiwiZmlsZSI6Imhvb2sudHMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbi8qKlxuICogV29yZFByZXNzIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyB1c2VNZW1vIH0gZnJvbSAnQHdvcmRwcmVzcy9lbGVtZW50JztcbmltcG9ydCBkZXByZWNhdGVkIGZyb20gJ0B3b3JkcHJlc3MvZGVwcmVjYXRlZCc7XG5cbi8qKlxuICogSW50ZXJuYWwgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB0eXBlIHsgV29yZFByZXNzQ29tcG9uZW50UHJvcHMgfSBmcm9tICcuLi8uLi9jb250ZXh0JztcbmltcG9ydCB7IHVzZUNvbnRleHRTeXN0ZW0gfSBmcm9tICcuLi8uLi9jb250ZXh0JztcbmltcG9ydCB7IHVzZVJlc3BvbnNpdmVWYWx1ZSB9IGZyb20gJy4uLy4uL3V0aWxzL3VzZS1yZXNwb25zaXZlLXZhbHVlJztcbmltcG9ydCB7IHNwYWNlIH0gZnJvbSAnLi4vLi4vdXRpbHMvc3BhY2UnO1xuaW1wb3J0ICogYXMgc3R5bGVzIGZyb20gJy4uL3N0eWxlcyc7XG5pbXBvcnQgeyB1c2VDeCB9IGZyb20gJy4uLy4uL3V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Sxcblx0XHRcdGlzQ29sdW1uID8gc3R5bGVzLkl0ZW1zQ29sdW1uIDogc3R5bGVzLkl0ZW1zUm93LFxuXHRcdFx0Y2xhc3NOYW1lXG5cdFx0KTtcblx0fSwgW1xuXHRcdGFsaWduLFxuXHRcdGNsYXNzTmFtZSxcblx0XHRjeCxcblx0XHRkaXJlY3Rpb24sXG5cdFx0ZXhwYW5kZWQsXG5cdFx0Z2FwLFxuXHRcdGlzQ29sdW1uLFxuXHRcdGp1c3RpZnksXG5cdFx0d3JhcCxcblx0XSApO1xuXG5cdHJldHVybiB7IC4uLm90aGVyUHJvcHMsIGNsYXNzTmFtZTogY2xhc3NlcywgaXNDb2x1bW4gfTtcbn1cbiJdfQ== */\");\n return cx(styles.Flex, base, isColumn ? styles.ItemsColumn : styles.ItemsRow, className);\n }, [align, className, cx, direction, expanded, gap, isColumn, justify, wrap]);\n return {\n ...otherProps,\n className: classes,\n isColumn\n };\n}"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAoB;AAKpB,qBAAwB;AACxB,wBAAuB;AAMvB,qBAAiC;AACjC,kCAAmC;AACnC,mBAAsB;AACtB,aAAwB;AACxB,mBAAsB;AACtB,SAAS,mBAAmB,OAAO;AACjC,QAAM;AAAA,IACJ;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,MAAI,OAAO,eAAe,aAAa;AACrC,0BAAAA,SAAW,mBAAmB;AAAA,MAC5B,aAAa;AAAA,MACb,OAAO;AAAA,IACT,CAAC;AACD,WAAO;AAAA,MACL,GAAG;AAAA,MACH,WAAW,aAAa,gBAAgB;AAAA,IAC1C;AAAA,EACF;AACA,SAAO;AACT;AACO,SAAS,QAAQ,OAAO;AAC7B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,IACP,GAAG;AAAA,EACL,QAAI,iCAAiB,mBAAmB,KAAK,GAAG,MAAM;AACtD,QAAM,mBAAmB,MAAM,QAAQ,aAAa,IAAI,gBAAgB,CAAC,aAAa;AACtF,QAAM,gBAAY,gDAAmB,gBAAgB;AACrD,QAAM,WAAW,OAAO,cAAc,YAAY,CAAC,CAAC,UAAU,SAAS,QAAQ;AAC/E,QAAM,SAAK,oBAAM;AACjB,QAAM,cAAU,wBAAQ,MAAM;AAC5B,UAAM,OAAoB,sCAAI;AAAA,MAC5B,YAAY,UAAU,WAAW,WAAW;AAAA,MAC5C,eAAe;AAAA,MACf,UAAU,OAAO,SAAS;AAAA,MAC1B,SAAK,oBAAM,GAAG;AAAA,MACd,gBAAgB;AAAA,MAChB,QAAQ,YAAY,WAAW,SAAS;AAAA,MACxC,OAAO,CAAC,YAAY,WAAW,SAAS;AAAA,IAC1C,GAAG,QAAQ,IAAI,aAAa,eAAe,KAAK,gBAAgB,QAAQ,IAAI,aAAa,eAAe,KAAK,i4GAAi4G;AAC9+G,WAAO,GAAU,aAAM,MAAM,WAAkB,qBAAqB,iBAAU,SAAS;AAAA,EACzF,GAAG,CAAC,OAAO,WAAW,IAAI,WAAW,UAAU,KAAK,UAAU,SAAS,IAAI,CAAC;AAC5E,SAAO;AAAA,IACL,GAAG;AAAA,IACH,WAAW;AAAA,IACX;AAAA,EACF;AACF;",
6
6
  "names": ["deprecated"]
7
7
  }
@@ -156,8 +156,7 @@ function FocalPointPicker({
156
156
  });
157
157
  };
158
158
  const getFinalValue = (value) => {
159
- var _resolvePoint;
160
- const resolvedValue = (_resolvePoint = resolvePoint?.(value)) !== null && _resolvePoint !== void 0 ? _resolvePoint : value;
159
+ const resolvedValue = resolvePoint?.(value) ?? value;
161
160
  resolvedValue.x = Math.max(0, Math.min(resolvedValue.x, 1));
162
161
  resolvedValue.y = Math.max(0, Math.min(resolvedValue.y, 1));
163
162
  const roundToTwoDecimalPlaces = (n) => Math.round(n * 100) / 100;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/focal-point-picker/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { __experimentalUseDragging as useDragging, useIsomorphicLayoutEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Controls from './controls';\nimport FocalPoint from './focal-point';\nimport Grid from './grid';\nimport Media from './media';\nimport { Container, MediaWrapper, MediaContainer } from './styles/focal-point-picker-style';\nimport { INITIAL_BOUNDS } from './utils';\nimport { useUpdateEffect } from '../utils/hooks';\nimport { StyledLabel, StyledHelp } from '../base-control/styles/base-control-styles';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GRID_OVERLAY_TIMEOUT = 600;\n\n/**\n * Focal Point Picker is a component which creates a UI for identifying the most important visual point of an image.\n *\n * This component addresses a specific problem: with large background images it is common to see undesirable crops,\n * especially when viewing on smaller viewports such as mobile phones. This component allows the selection of\n * the point with the most important visual information and returns it as a pair of numbers between 0 and 1.\n * This value can be easily converted into the CSS `background-position` attribute, and will ensure that the\n * focal point is never cropped out, regardless of viewport.\n *\n * - Example focal point picker value: `{ x: 0.5, y: 0.1 }`\n * - Corresponding CSS: `background-position: 50% 10%;`\n *\n * ```jsx\n * import { FocalPointPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ focalPoint, setFocalPoint ] = useState( {\n * \t\tx: 0.5,\n * \t\ty: 0.5,\n * \t} );\n *\n * \tconst url = '/path/to/image';\n *\n * \t// Example function to render the CSS styles based on Focal Point Picker value\n * \tconst style = {\n * \t\tbackgroundImage: `url(${ url })`,\n * \t\tbackgroundPosition: `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%`,\n * \t};\n *\n * \treturn (\n * \t\t<>\n * \t\t\t<FocalPointPicker\n * \t\t\t\turl={ url }\n * \t\t\t\tvalue={ focalPoint }\n * \t\t\t\tonDragStart={ setFocalPoint }\n * \t\t\t\tonDrag={ setFocalPoint }\n * \t\t\t\tonChange={ setFocalPoint }\n * \t\t\t/>\n * \t\t\t<div style={ style } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nexport function FocalPointPicker({\n // Prevent passing to internal component.\n __nextHasNoMarginBottom: _,\n autoPlay = true,\n className,\n help,\n hideLabelFromVision,\n label,\n onChange,\n onDrag,\n onDragEnd,\n onDragStart,\n resolvePoint,\n url,\n value: valueProp = {\n x: 0.5,\n y: 0.5\n },\n ...restProps\n}) {\n const [point, setPoint] = useState(valueProp);\n const [showGridOverlay, setShowGridOverlay] = useState(false);\n const {\n startDrag,\n endDrag,\n isDragging\n } = useDragging({\n onDragStart: event => {\n dragAreaRef.current?.focus();\n const value = getValueWithinDragArea(event);\n\n // `value` can technically be undefined if getValueWithinDragArea() is\n // called before dragAreaRef is set, but this shouldn't happen in reality.\n if (!value) {\n return;\n }\n onDragStart?.(value, event);\n setPoint(value);\n },\n onDragMove: event => {\n // Prevents text-selection when dragging.\n event.preventDefault();\n const value = getValueWithinDragArea(event);\n if (!value) {\n return;\n }\n onDrag?.(value, event);\n setPoint(value);\n },\n onDragEnd: () => {\n onDragEnd?.();\n onChange?.(point);\n }\n });\n\n // Uses the internal point while dragging or else the value from props.\n const {\n x,\n y\n } = isDragging ? point : valueProp;\n const dragAreaRef = useRef(null);\n const [bounds, setBounds] = useState(INITIAL_BOUNDS);\n const refUpdateBounds = useRef(() => {\n if (!dragAreaRef.current) {\n return;\n }\n const {\n clientWidth: width,\n clientHeight: height\n } = dragAreaRef.current;\n // Falls back to initial bounds if the ref has no size. Since styles\n // give the drag area dimensions even when the media has not loaded\n // this should only happen in unit tests (jsdom).\n setBounds(width > 0 && height > 0 ? {\n width,\n height\n } : {\n ...INITIAL_BOUNDS\n });\n });\n useEffect(() => {\n const updateBounds = refUpdateBounds.current;\n if (!dragAreaRef.current) {\n return;\n }\n const {\n defaultView\n } = dragAreaRef.current.ownerDocument;\n defaultView?.addEventListener('resize', updateBounds);\n return () => defaultView?.removeEventListener('resize', updateBounds);\n }, []);\n\n // Updates the bounds to cover cases of unspecified media or load failures.\n useIsomorphicLayoutEffect(() => void refUpdateBounds.current(), []);\n\n // TODO: Consider refactoring getValueWithinDragArea() into a pure function.\n // https://github.com/WordPress/gutenberg/pull/43872#discussion_r963455173\n const getValueWithinDragArea = ({\n clientX,\n clientY,\n shiftKey\n }) => {\n if (!dragAreaRef.current) {\n return;\n }\n const {\n top,\n left\n } = dragAreaRef.current.getBoundingClientRect();\n let nextX = (clientX - left) / bounds.width;\n let nextY = (clientY - top) / bounds.height;\n // Enables holding shift to jump values by 10%.\n if (shiftKey) {\n nextX = Math.round(nextX / 0.1) * 0.1;\n nextY = Math.round(nextY / 0.1) * 0.1;\n }\n return getFinalValue({\n x: nextX,\n y: nextY\n });\n };\n const getFinalValue = value => {\n var _resolvePoint;\n const resolvedValue = (_resolvePoint = resolvePoint?.(value)) !== null && _resolvePoint !== void 0 ? _resolvePoint : value;\n resolvedValue.x = Math.max(0, Math.min(resolvedValue.x, 1));\n resolvedValue.y = Math.max(0, Math.min(resolvedValue.y, 1));\n const roundToTwoDecimalPlaces = n => Math.round(n * 1e2) / 1e2;\n return {\n x: roundToTwoDecimalPlaces(resolvedValue.x),\n y: roundToTwoDecimalPlaces(resolvedValue.y)\n };\n };\n const arrowKeyStep = event => {\n const {\n code,\n shiftKey\n } = event;\n if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(code)) {\n return;\n }\n event.preventDefault();\n const value = {\n x,\n y\n };\n const step = shiftKey ? 0.1 : 0.01;\n const delta = code === 'ArrowUp' || code === 'ArrowLeft' ? -1 * step : step;\n const axis = code === 'ArrowUp' || code === 'ArrowDown' ? 'y' : 'x';\n value[axis] = value[axis] + delta;\n onChange?.(getFinalValue(value));\n };\n const focalPointPosition = {\n left: x !== undefined ? x * bounds.width : 0.5 * bounds.width,\n top: y !== undefined ? y * bounds.height : 0.5 * bounds.height\n };\n const classes = clsx('components-focal-point-picker-control', className);\n const Label = hideLabelFromVision ? VisuallyHidden : StyledLabel;\n useUpdateEffect(() => {\n setShowGridOverlay(true);\n const timeout = window.setTimeout(() => {\n setShowGridOverlay(false);\n }, GRID_OVERLAY_TIMEOUT);\n return () => window.clearTimeout(timeout);\n }, [x, y]);\n return /*#__PURE__*/_jsxs(Container, {\n ...restProps,\n as: \"fieldset\",\n className: classes,\n children: [!!label && /*#__PURE__*/_jsx(Label, {\n as: \"legend\",\n children: label\n }), /*#__PURE__*/_jsx(MediaWrapper, {\n className: \"components-focal-point-picker-wrapper\",\n children: /*#__PURE__*/_jsxs(MediaContainer, {\n className: \"components-focal-point-picker\",\n onKeyDown: arrowKeyStep,\n onMouseDown: startDrag,\n onBlur: () => {\n if (isDragging) {\n endDrag();\n }\n },\n ref: dragAreaRef,\n role: \"button\",\n tabIndex: -1,\n children: [/*#__PURE__*/_jsx(Grid, {\n bounds: bounds,\n showOverlay: showGridOverlay\n }), /*#__PURE__*/_jsx(Media, {\n alt: __('Media preview'),\n autoPlay: autoPlay,\n onLoad: refUpdateBounds.current,\n src: url\n }), /*#__PURE__*/_jsx(FocalPoint, {\n ...focalPointPosition,\n isDragging: isDragging\n })]\n })\n }), /*#__PURE__*/_jsx(Controls, {\n hasHelpText: !!help,\n point: {\n x,\n y\n },\n onChange: value => {\n onChange?.(getFinalValue(value));\n }\n }), !!help && /*#__PURE__*/_jsx(StyledHelp, {\n children: help\n })]\n });\n}\nexport default FocalPointPicker;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAIjB,kBAAmB;AACnB,qBAA4C;AAC5C,qBAAoF;AAKpF,sBAAqB;AACrB,yBAAuB;AACvB,kBA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KAAK,OAAO;AAAA,MAC7C,IAAI;AAAA,MACJ,UAAU;AAAA,IACZ,CAAC,GAAgB,uCAAAA,KAAK,8CAAc;AAAA,MAClC,WAAW;AAAA,MACX,UAAuB,uCAAAD,MAAM,gDAAgB;AAAA,QAC3C,WAAW;AAAA,QACX,WAAW;AAAA,QACX,aAAa;AAAA,QACb,QAAQ,MAAM;AACZ,cAAI,YAAY;AACd,oBAAQ;AAAA,UACV;AAAA,QACF;AAAA,QACA,KAAK;AAAA,QACL,MAAM;AAAA,QACN,UAAU;AAAA,QACV,UAAU,CAAc,uCAAAC,KAAK,YAAAC,SAAM;AAAA,UACjC;AAAA,UACA,aAAa;AAAA,QACf,CAAC,GAAgB,uCAAAD,KAAK,aAAAE,SAAO;AAAA,UAC3B,SAAK,gBAAG,eAAe;AAAA,UACvB;AAAA,UACA,QAAQ,gBAAgB;AAAA,UACxB,KAAK;AAAA,QACP,CAAC,GAAgB,uCAAAF,KAAK,mBAAAG,SAAY;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QACF,CAAC,CAAC;AAAA,MACJ,CAAC;AAAA,IACH,CAAC,GAAgB,uCAAAH,KAAK,gBAAAI,SAAU;AAAA,MAC9B,aAAa,CAAC,CAAC;AAAA,MACf,OAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,MACA,UAAU,WAAS;AACjB,mBAAW,cAAc,KAAK,CAAC;AAAA,MACjC;AAAA,IACF,CAAC,GAAG,CAAC,CAAC,QAAqB,uCAAAJ,KAAK,uCAAY;AAAA,MAC1C,UAAU;AAAA,IACZ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,6BAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { __experimentalUseDragging as useDragging, useIsomorphicLayoutEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Controls from './controls';\nimport FocalPoint from './focal-point';\nimport Grid from './grid';\nimport Media from './media';\nimport { Container, MediaWrapper, MediaContainer } from './styles/focal-point-picker-style';\nimport { INITIAL_BOUNDS } from './utils';\nimport { useUpdateEffect } from '../utils/hooks';\nimport { StyledLabel, StyledHelp } from '../base-control/styles/base-control-styles';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GRID_OVERLAY_TIMEOUT = 600;\n\n/**\n * Focal Point Picker is a component which creates a UI for identifying the most important visual point of an image.\n *\n * This component addresses a specific problem: with large background images it is common to see undesirable crops,\n * especially when viewing on smaller viewports such as mobile phones. This component allows the selection of\n * the point with the most important visual information and returns it as a pair of numbers between 0 and 1.\n * This value can be easily converted into the CSS `background-position` attribute, and will ensure that the\n * focal point is never cropped out, regardless of viewport.\n *\n * - Example focal point picker value: `{ x: 0.5, y: 0.1 }`\n * - Corresponding CSS: `background-position: 50% 10%;`\n *\n * ```jsx\n * import { FocalPointPicker } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ focalPoint, setFocalPoint ] = useState( {\n * \t\tx: 0.5,\n * \t\ty: 0.5,\n * \t} );\n *\n * \tconst url = '/path/to/image';\n *\n * \t// Example function to render the CSS styles based on Focal Point Picker value\n * \tconst style = {\n * \t\tbackgroundImage: `url(${ url })`,\n * \t\tbackgroundPosition: `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%`,\n * \t};\n *\n * \treturn (\n * \t\t<>\n * \t\t\t<FocalPointPicker\n * \t\t\t\turl={ url }\n * \t\t\t\tvalue={ focalPoint }\n * \t\t\t\tonDragStart={ setFocalPoint }\n * \t\t\t\tonDrag={ setFocalPoint }\n * \t\t\t\tonChange={ setFocalPoint }\n * \t\t\t/>\n * \t\t\t<div style={ style } />\n * \t\t</>\n * \t);\n * };\n * ```\n */\nexport function FocalPointPicker({\n // Prevent passing to internal component.\n __nextHasNoMarginBottom: _,\n autoPlay = true,\n className,\n help,\n hideLabelFromVision,\n label,\n onChange,\n onDrag,\n onDragEnd,\n onDragStart,\n resolvePoint,\n url,\n value: valueProp = {\n x: 0.5,\n y: 0.5\n },\n ...restProps\n}) {\n const [point, setPoint] = useState(valueProp);\n const [showGridOverlay, setShowGridOverlay] = useState(false);\n const {\n startDrag,\n endDrag,\n isDragging\n } = useDragging({\n onDragStart: event => {\n dragAreaRef.current?.focus();\n const value = getValueWithinDragArea(event);\n\n // `value` can technically be undefined if getValueWithinDragArea() is\n // called before dragAreaRef is set, but this shouldn't happen in reality.\n if (!value) {\n return;\n }\n onDragStart?.(value, event);\n setPoint(value);\n },\n onDragMove: event => {\n // Prevents text-selection when dragging.\n event.preventDefault();\n const value = getValueWithinDragArea(event);\n if (!value) {\n return;\n }\n onDrag?.(value, event);\n setPoint(value);\n },\n onDragEnd: () => {\n onDragEnd?.();\n onChange?.(point);\n }\n });\n\n // Uses the internal point while dragging or else the value from props.\n const {\n x,\n y\n } = isDragging ? point : valueProp;\n const dragAreaRef = useRef(null);\n const [bounds, setBounds] = useState(INITIAL_BOUNDS);\n const refUpdateBounds = useRef(() => {\n if (!dragAreaRef.current) {\n return;\n }\n const {\n clientWidth: width,\n clientHeight: height\n } = dragAreaRef.current;\n // Falls back to initial bounds if the ref has no size. Since styles\n // give the drag area dimensions even when the media has not loaded\n // this should only happen in unit tests (jsdom).\n setBounds(width > 0 && height > 0 ? {\n width,\n height\n } : {\n ...INITIAL_BOUNDS\n });\n });\n useEffect(() => {\n const updateBounds = refUpdateBounds.current;\n if (!dragAreaRef.current) {\n return;\n }\n const {\n defaultView\n } = dragAreaRef.current.ownerDocument;\n defaultView?.addEventListener('resize', updateBounds);\n return () => defaultView?.removeEventListener('resize', updateBounds);\n }, []);\n\n // Updates the bounds to cover cases of unspecified media or load failures.\n useIsomorphicLayoutEffect(() => void refUpdateBounds.current(), []);\n\n // TODO: Consider refactoring getValueWithinDragArea() into a pure function.\n // https://github.com/WordPress/gutenberg/pull/43872#discussion_r963455173\n const getValueWithinDragArea = ({\n clientX,\n clientY,\n shiftKey\n }) => {\n if (!dragAreaRef.current) {\n return;\n }\n const {\n top,\n left\n } = dragAreaRef.current.getBoundingClientRect();\n let nextX = (clientX - left) / bounds.width;\n let nextY = (clientY - top) / bounds.height;\n // Enables holding shift to jump values by 10%.\n if (shiftKey) {\n nextX = Math.round(nextX / 0.1) * 0.1;\n nextY = Math.round(nextY / 0.1) * 0.1;\n }\n return getFinalValue({\n x: nextX,\n y: nextY\n });\n };\n const getFinalValue = value => {\n const resolvedValue = resolvePoint?.(value) ?? value;\n resolvedValue.x = Math.max(0, Math.min(resolvedValue.x, 1));\n resolvedValue.y = Math.max(0, Math.min(resolvedValue.y, 1));\n const roundToTwoDecimalPlaces = n => Math.round(n * 1e2) / 1e2;\n return {\n x: roundToTwoDecimalPlaces(resolvedValue.x),\n y: roundToTwoDecimalPlaces(resolvedValue.y)\n };\n };\n const arrowKeyStep = event => {\n const {\n code,\n shiftKey\n } = event;\n if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(code)) {\n return;\n }\n event.preventDefault();\n const value = {\n x,\n y\n };\n const step = shiftKey ? 0.1 : 0.01;\n const delta = code === 'ArrowUp' || code === 'ArrowLeft' ? -1 * step : step;\n const axis = code === 'ArrowUp' || code === 'ArrowDown' ? 'y' : 'x';\n value[axis] = value[axis] + delta;\n onChange?.(getFinalValue(value));\n };\n const focalPointPosition = {\n left: x !== undefined ? x * bounds.width : 0.5 * bounds.width,\n top: y !== undefined ? y * bounds.height : 0.5 * bounds.height\n };\n const classes = clsx('components-focal-point-picker-control', className);\n const Label = hideLabelFromVision ? VisuallyHidden : StyledLabel;\n useUpdateEffect(() => {\n setShowGridOverlay(true);\n const timeout = window.setTimeout(() => {\n setShowGridOverlay(false);\n }, GRID_OVERLAY_TIMEOUT);\n return () => window.clearTimeout(timeout);\n }, [x, y]);\n return /*#__PURE__*/_jsxs(Container, {\n ...restProps,\n as: \"fieldset\",\n className: classes,\n children: [!!label && /*#__PURE__*/_jsx(Label, {\n as: \"legend\",\n children: label\n }), /*#__PURE__*/_jsx(MediaWrapper, {\n className: \"components-focal-point-picker-wrapper\",\n children: /*#__PURE__*/_jsxs(MediaContainer, {\n className: \"components-focal-point-picker\",\n onKeyDown: arrowKeyStep,\n onMouseDown: startDrag,\n onBlur: () => {\n if (isDragging) {\n endDrag();\n }\n },\n ref: dragAreaRef,\n role: \"button\",\n tabIndex: -1,\n children: [/*#__PURE__*/_jsx(Grid, {\n bounds: bounds,\n showOverlay: showGridOverlay\n }), /*#__PURE__*/_jsx(Media, {\n alt: __('Media preview'),\n autoPlay: autoPlay,\n onLoad: refUpdateBounds.current,\n src: url\n }), /*#__PURE__*/_jsx(FocalPoint, {\n ...focalPointPosition,\n isDragging: isDragging\n })]\n })\n }), /*#__PURE__*/_jsx(Controls, {\n hasHelpText: !!help,\n point: {\n x,\n y\n },\n onChange: value => {\n onChange?.(getFinalValue(value));\n }\n }), !!help && /*#__PURE__*/_jsx(StyledHelp, {\n children: help\n })]\n });\n}\nexport default FocalPointPicker;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAIjB,kBAAmB;AACnB,qBAA4C;AAC5C,qBAAoF;AAKpF,sBAAqB;AACrB,yBAAuB;AACvB,kBAAiB;AACjB,mBAAkB;AAClB,sCAAwD;AACxD,mBAA+B;AAC/B,mBAAgC;AAChC,iCAAwC;AACxC,6BAA+B;AAC/B,yBAA2C;AAC3C,IAAM,uBAAuB;AA+CtB,SAAS,iBAAiB;AAAA;AAAA,EAE/B,yBAAyB;AAAA,EACzB,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO,YAAY;AAA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AM;AAAA,UACjC;AAAA,UACA,aAAa;AAAA,QACf,CAAC,GAAgB,uCAAAD,KAAK,aAAAE,SAAO;AAAA,UAC3B,SAAK,gBAAG,eAAe;AAAA,UACvB;AAAA,UACA,QAAQ,gBAAgB;AAAA,UACxB,KAAK;AAAA,QACP,CAAC,GAAgB,uCAAAF,KAAK,mBAAAG,SAAY;AAAA,UAChC,GAAG;AAAA,UACH;AAAA,QACF,CAAC,CAAC;AAAA,MACJ,CAAC;AAAA,IACH,CAAC,GAAgB,uCAAAH,KAAK,gBAAAI,SAAU;AAAA,MAC9B,aAAa,CAAC,CAAC;AAAA,MACf,OAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,MACA,UAAU,WAAS;AACjB,mBAAW,cAAc,KAAK,CAAC;AAAA,MACjC;AAAA,IACF,CAAC,GAAG,CAAC,CAAC,QAAqB,uCAAAJ,KAAK,uCAAY;AAAA,MAC1C,UAAU;AAAA,IACZ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,6BAAQ;",
6
6
  "names": ["useDragging", "clsx", "_jsxs", "_jsx", "Grid", "Media", "FocalPoint", "Controls"]
7
7
  }
@@ -52,7 +52,6 @@ var FontSizePickerSelect = (props) => {
52
52
  };
53
53
  })];
54
54
  const selectedOption = (0, import_element.useMemo)(() => {
55
- var _options$find;
56
55
  if (value === void 0) {
57
56
  return DEFAULT_OPTION;
58
57
  }
@@ -62,7 +61,7 @@ var FontSizePickerSelect = (props) => {
62
61
  return optionBySlug;
63
62
  }
64
63
  }
65
- return (_options$find = options.find((option) => option.value === value)) !== null && _options$find !== void 0 ? _options$find : DEFAULT_OPTION;
64
+ return options.find((option) => option.value === value) ?? DEFAULT_OPTION;
66
65
  }, [value, valueMode, options]);
67
66
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styles.StyledCustomSelectControl, {
68
67
  __next40pxDefaultSize,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/font-size-picker/font-size-picker-select.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { generateFontSizeHint } from './utils';\nimport { StyledCustomSelectControl } from './styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst DEFAULT_OPTION = {\n key: 'default',\n name: __('Default'),\n value: undefined\n};\nconst FontSizePickerSelect = props => {\n const {\n __next40pxDefaultSize,\n fontSizes,\n value,\n size,\n valueMode = 'literal',\n onChange\n } = props;\n const options = [DEFAULT_OPTION, ...fontSizes.map(fontSize => {\n const hint = generateFontSizeHint(fontSize);\n return {\n key: fontSize.slug,\n name: fontSize.name || fontSize.slug,\n value: fontSize.size,\n hint\n };\n })];\n const selectedOption = useMemo(() => {\n var _options$find;\n if (value === undefined) {\n return DEFAULT_OPTION;\n }\n\n // If valueMode is 'slug', find by slug\n if (valueMode === 'slug') {\n const optionBySlug = options.find(option => option.key === value);\n if (optionBySlug) {\n return optionBySlug;\n }\n }\n\n // If valueMode is 'literal', find by value (size)\n return (_options$find = options.find(option => option.value === value)) !== null && _options$find !== void 0 ? _options$find : DEFAULT_OPTION;\n }, [value, valueMode, options]);\n return /*#__PURE__*/_jsx(StyledCustomSelectControl, {\n __next40pxDefaultSize: __next40pxDefaultSize,\n __shouldNotWarnDeprecated36pxSize: true,\n className: \"components-font-size-picker__select\",\n label: __('Font size'),\n hideLabelFromVision: true,\n describedBy: sprintf(\n // translators: %s: Currently selected font size.\n __('Currently selected font size: %s'), selectedOption.name),\n options: options,\n value: selectedOption,\n showSelectedHint: true,\n onChange: ({\n selectedItem\n }) => {\n // Find the corresponding FontSize object\n const matchingFontSize = selectedItem.key === 'default' ? undefined : fontSizes.find(fontSize => fontSize.slug === selectedItem.key);\n onChange(selectedItem.value, matchingFontSize);\n },\n size: size\n });\n};\nexport default FontSizePickerSelect;"],
5
- "mappings": ";;;;;;;;;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AC;AAAA,MACT;AAAA,IACF,MAAM;AAEJ,YAAM,mBAAmB,aAAa,QAAQ,YAAY,SAAY,UAAU,KAAK,cAAY,SAAS,SAAS,aAAa,GAAG;AACnI,eAAS,aAAa,OAAO,gBAAgB;AAAA,IAC/C;AAAA,IACA;AAAA,EACF,CAAC;AACH;AACA,IAAO,kCAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { generateFontSizeHint } from './utils';\nimport { StyledCustomSelectControl } from './styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst DEFAULT_OPTION = {\n key: 'default',\n name: __('Default'),\n value: undefined\n};\nconst FontSizePickerSelect = props => {\n const {\n __next40pxDefaultSize,\n fontSizes,\n value,\n size,\n valueMode = 'literal',\n onChange\n } = props;\n const options = [DEFAULT_OPTION, ...fontSizes.map(fontSize => {\n const hint = generateFontSizeHint(fontSize);\n return {\n key: fontSize.slug,\n name: fontSize.name || fontSize.slug,\n value: fontSize.size,\n hint\n };\n })];\n const selectedOption = useMemo(() => {\n if (value === undefined) {\n return DEFAULT_OPTION;\n }\n\n // If valueMode is 'slug', find by slug\n if (valueMode === 'slug') {\n const optionBySlug = options.find(option => option.key === value);\n if (optionBySlug) {\n return optionBySlug;\n }\n }\n\n // If valueMode is 'literal', find by value (size)\n return options.find(option => option.value === value) ?? DEFAULT_OPTION;\n }, [value, valueMode, options]);\n return /*#__PURE__*/_jsx(StyledCustomSelectControl, {\n __next40pxDefaultSize: __next40pxDefaultSize,\n __shouldNotWarnDeprecated36pxSize: true,\n className: \"components-font-size-picker__select\",\n label: __('Font size'),\n hideLabelFromVision: true,\n describedBy: sprintf(\n // translators: %s: Currently selected font size.\n __('Currently selected font size: %s'), selectedOption.name),\n options: options,\n value: selectedOption,\n showSelectedHint: true,\n onChange: ({\n selectedItem\n }) => {\n // Find the corresponding FontSize object\n const matchingFontSize = selectedItem.key === 'default' ? undefined : fontSizes.find(fontSize => fontSize.slug === selectedItem.key);\n onChange(selectedItem.value, matchingFontSize);\n },\n size: size\n });\n};\nexport default FontSizePickerSelect;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4B;AAC5B,qBAAwB;AAMxB,mBAAqC;AACrC,oBAA0C;AAC1C,yBAA4B;AAC5B,IAAM,iBAAiB;AAAA,EACrB,KAAK;AAAA,EACL,UAAM,gBAAG,SAAS;AAAA,EAClB,OAAO;AACT;AACA,IAAM,uBAAuB,WAAS;AACpC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,EACF,IAAI;AACJ,QAAM,UAAU,CAAC,gBAAgB,GAAG,UAAU,IAAI,cAAY;AAC5D,UAAM,WAAO,mCAAqB,QAAQ;AAC1C,WAAO;AAAA,MACL,KAAK,SAAS;AAAA,MACd,MAAM,SAAS,QAAQ,SAAS;AAAA,MAChC,OAAO,SAAS;AAAA,MAChB;AAAA,IACF;AAAA,EACF,CAAC,CAAC;AACF,QAAM,qBAAiB,wBAAQ,MAAM;AACnC,QAAI,UAAU,QAAW;AACvB,aAAO;AAAA,IACT;AAGA,QAAI,cAAc,QAAQ;AACxB,YAAM,eAAe,QAAQ,KAAK,YAAU,OAAO,QAAQ,KAAK;AAChE,UAAI,cAAc;AAChB,eAAO;AAAA,MACT;AAAA,IACF;AAGA,WAAO,QAAQ,KAAK,YAAU,OAAO,UAAU,KAAK,KAAK;AAAA,EAC3D,GAAG,CAAC,OAAO,WAAW,OAAO,CAAC;AAC9B,SAAoB,uCAAAA,KAAK,yCAA2B;AAAA,IAClD;AAAA,IACA,mCAAmC;AAAA,IACnC,WAAW;AAAA,IACX,WAAO,gBAAG,WAAW;AAAA,IACrB,qBAAqB;AAAA,IACrB,iBAAa;AAAA;AAAA,UAEb,gBAAG,kCAAkC;AAAA,MAAG,eAAe;AAAA,IAAI;AAAA,IAC3D;AAAA,IACA,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,UAAU,CAAC;AAAA,MACT;AAAA,IACF,MAAM;AAEJ,YAAM,mBAAmB,aAAa,QAAQ,YAAY,SAAY,UAAU,KAAK,cAAY,SAAS,SAAS,aAAa,GAAG;AACnI,eAAS,aAAa,OAAO,gBAAgB;AAAA,IAC/C;AAAA,IACA;AAAA,EACF,CAAC;AACH;AACA,IAAO,kCAAQ;",
6
6
  "names": ["_jsx"]
7
7
  }
@@ -155,7 +155,7 @@ var UnforwardedFontSizePicker = (props, ref) => {
155
155
  label: (0, import_i18n.__)("Font size"),
156
156
  labelPosition: "top",
157
157
  hideLabelFromVision: true,
158
- value: hasUnits ? `${valueQuantity !== null && valueQuantity !== void 0 ? valueQuantity : ""}${valueUnit !== null && valueUnit !== void 0 ? valueUnit : ""}` : resolvedValueForControls,
158
+ value: hasUnits ? `${valueQuantity ?? ""}${valueUnit ?? ""}` : resolvedValueForControls,
159
159
  onChange: (newValue) => {
160
160
  setUserRequestedCustom(true);
161
161
  if (newValue === void 0 || newValue === "") {
@@ -187,7 +187,7 @@ var UnforwardedFontSizePicker = (props, ref) => {
187
187
  if (newValue === void 0) {
188
188
  onChange?.(void 0);
189
189
  } else if (hasUnits) {
190
- onChange?.(newValue + (valueUnit !== null && valueUnit !== void 0 ? valueUnit : "px"));
190
+ onChange?.(newValue + (valueUnit ?? "px"));
191
191
  } else {
192
192
  onChange?.(newValue);
193
193
  }
@@ -215,6 +215,7 @@ var UnforwardedFontSizePicker = (props, ref) => {
215
215
  });
216
216
  };
217
217
  var FontSizePicker = (0, import_element.forwardRef)(UnforwardedFontSizePicker);
218
+ FontSizePicker.displayName = "FontSizePicker";
218
219
  var font_size_picker_default = FontSizePicker;
219
220
  // Annotate the CommonJS export names for ESM import in node:
220
221
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/font-size-picker/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\nimport { useState, forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { Button } from '../button';\nimport RangeControl from '../range-control';\nimport { Flex, FlexItem } from '../flex';\nimport { default as UnitControl, parseQuantityAndUnitFromRawValue, useCustomUnits } from '../unit-control';\nimport { Container, Header, HeaderLabel, HeaderToggle } from './styles';\nimport { Spacer } from '../spacer';\nimport FontSizePickerSelect from './font-size-picker-select';\nimport FontSizePickerToggleGroup from './font-size-picker-toggle-group';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst DEFAULT_UNITS = ['px', 'em', 'rem', 'vw', 'vh'];\nconst MAX_TOGGLE_GROUP_SIZES = 5;\nconst UnforwardedFontSizePicker = (props, ref) => {\n const {\n __next40pxDefaultSize = false,\n fallbackFontSize,\n fontSizes = [],\n disableCustomFontSizes = false,\n onChange,\n size = 'default',\n units: unitsProp = DEFAULT_UNITS,\n value,\n valueMode = 'literal',\n withSlider = false,\n withReset = true\n } = props;\n const labelId = useInstanceId(UnforwardedFontSizePicker, 'font-size-picker-label');\n const units = useCustomUnits({\n availableUnits: unitsProp\n });\n const selectedFontSize = (() => {\n if (!value) {\n return undefined;\n }\n\n // If valueMode is 'slug', find by slug\n if (valueMode === 'slug') {\n return fontSizes.find(fontSize => fontSize.slug === value);\n }\n\n // If valueMode is 'literal', find by size value\n return fontSizes.find(fontSize => fontSize.size === value);\n })();\n const isCustomValue = !!value && !selectedFontSize;\n\n // Initially request a custom picker if the value is not from the predef list.\n const [userRequestedCustom, setUserRequestedCustom] = useState(isCustomValue);\n\n // Resolve the literal value to use in custom controls when operating in slug mode.\n // When `valueMode` is 'slug', the `value` prop contains the slug of the\n // selected preset. In that case, the custom input should reflect the preset's\n // actual size value so it pre-populates correctly after clicking \"Set custom size\".\n const resolvedValueForControls = valueMode === 'slug' ? selectedFontSize?.size : value;\n let currentPickerType;\n if (!disableCustomFontSizes && userRequestedCustom) {\n // While showing the custom value picker, switch back to predef only if\n // `disableCustomFontSizes` is set to `true`.\n currentPickerType = 'custom';\n } else {\n currentPickerType = fontSizes.length > MAX_TOGGLE_GROUP_SIZES ? 'select' : 'togglegroup';\n }\n if (fontSizes.length === 0 && disableCustomFontSizes) {\n return null;\n }\n\n // If neither the value or first font size is a string, then FontSizePicker\n // operates in a legacy \"unitless\" mode where UnitControl can only be used\n // to select px values and onChange() is always called with number values.\n const hasUnits = typeof resolvedValueForControls === 'string' || typeof fontSizes[0]?.size === 'string';\n const [valueQuantity, valueUnit] = parseQuantityAndUnitFromRawValue(resolvedValueForControls, units);\n const isValueUnitRelative = !!valueUnit && ['em', 'rem', 'vw', 'vh'].includes(valueUnit);\n const isDisabled = value === undefined;\n maybeWarnDeprecated36pxSize({\n componentName: 'FontSizePicker',\n __next40pxDefaultSize,\n size\n });\n return /*#__PURE__*/_jsxs(Container, {\n ref: ref,\n className: \"components-font-size-picker\"\n // This Container component renders a fieldset element that needs to be labeled.\n ,\n \"aria-labelledby\": labelId,\n children: [/*#__PURE__*/_jsx(Spacer, {\n children: /*#__PURE__*/_jsxs(Header, {\n className: \"components-font-size-picker__header\",\n children: [/*#__PURE__*/_jsx(HeaderLabel, {\n id: labelId,\n children: __('Font size')\n }), !disableCustomFontSizes && /*#__PURE__*/_jsx(HeaderToggle, {\n label: currentPickerType === 'custom' ? __('Use size preset') : __('Set custom size'),\n icon: settings,\n onClick: () => setUserRequestedCustom(!userRequestedCustom),\n isPressed: currentPickerType === 'custom',\n size: \"small\"\n })]\n })\n }), /*#__PURE__*/_jsxs(\"div\", {\n children: [currentPickerType === 'select' && /*#__PURE__*/_jsx(FontSizePickerSelect, {\n __next40pxDefaultSize: __next40pxDefaultSize,\n fontSizes: fontSizes,\n value: value,\n valueMode: valueMode,\n disableCustomFontSizes: disableCustomFontSizes,\n size: size,\n onChange: (newValue, selectedItem) => {\n if (newValue === undefined) {\n onChange?.(undefined, selectedItem);\n } else {\n onChange?.(hasUnits ? newValue : Number(newValue), selectedItem);\n }\n },\n onSelectCustom: () => setUserRequestedCustom(true)\n }), currentPickerType === 'togglegroup' && /*#__PURE__*/_jsx(FontSizePickerToggleGroup, {\n fontSizes: fontSizes,\n value: value,\n valueMode: valueMode,\n __next40pxDefaultSize: __next40pxDefaultSize,\n size: size,\n onChange: (newValue, selectedItem) => {\n if (newValue === undefined) {\n onChange?.(undefined, selectedItem);\n } else {\n onChange?.(hasUnits ? newValue : Number(newValue), selectedItem);\n }\n }\n }), currentPickerType === 'custom' && /*#__PURE__*/_jsxs(Flex, {\n className: \"components-font-size-picker__custom-size-control\",\n children: [/*#__PURE__*/_jsx(FlexItem, {\n isBlock: true,\n children: /*#__PURE__*/_jsx(UnitControl, {\n __next40pxDefaultSize: __next40pxDefaultSize,\n __shouldNotWarnDeprecated36pxSize: true,\n label: __('Font size'),\n labelPosition: \"top\",\n hideLabelFromVision: true,\n value: hasUnits ? `${valueQuantity !== null && valueQuantity !== void 0 ? valueQuantity : ''}${valueUnit !== null && valueUnit !== void 0 ? valueUnit : ''}` : resolvedValueForControls,\n onChange: newValue => {\n setUserRequestedCustom(true);\n\n // Treat clearing the input (empty string) as a reset\n if (newValue === undefined || newValue === '') {\n onChange?.(undefined);\n } else {\n onChange?.(hasUnits ? newValue : parseInt(newValue, 10));\n }\n },\n size: size,\n units: hasUnits ? units : [],\n min: 0\n })\n }), withSlider && /*#__PURE__*/_jsx(FlexItem, {\n isBlock: true,\n children: /*#__PURE__*/_jsx(Spacer, {\n marginX: 2,\n marginBottom: 0,\n children: /*#__PURE__*/_jsx(RangeControl, {\n __next40pxDefaultSize: __next40pxDefaultSize,\n __shouldNotWarnDeprecated36pxSize: true,\n className: \"components-font-size-picker__custom-input\",\n label: __('Font size'),\n hideLabelFromVision: true,\n value: valueQuantity,\n initialPosition: fallbackFontSize,\n withInputField: false,\n onChange: newValue => {\n setUserRequestedCustom(true);\n if (newValue === undefined) {\n onChange?.(undefined);\n } else if (hasUnits) {\n onChange?.(newValue + (valueUnit !== null && valueUnit !== void 0 ? valueUnit : 'px'));\n } else {\n onChange?.(newValue);\n }\n },\n min: 0,\n max: isValueUnitRelative ? 10 : 100,\n step: isValueUnitRelative ? 0.1 : 1\n })\n })\n }), withReset && /*#__PURE__*/_jsx(FlexItem, {\n children: /*#__PURE__*/_jsx(Button, {\n disabled: isDisabled,\n accessibleWhenDisabled: true,\n onClick: () => {\n onChange?.(undefined);\n },\n variant: \"secondary\",\n __next40pxDefaultSize: true,\n size: size === '__unstable-large' || props.__next40pxDefaultSize ? 'default' : 'small',\n children: __('Reset')\n })\n })]\n })]\n })]\n });\n};\nexport const FontSizePicker = forwardRef(UnforwardedFontSizePicker);\nexport default FontSizePicker;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,kBAAmB;AACnB,mBAAyB;AACzB,qBAAqC;AACrC,qBAA8B;AAK9B,oBAAuB;AACvB,2BAAyB;AACzB,kBAA+B;AAC/B,0BAAyF;AACzF,oBAA6D;AAC7D,oBAAuB;AACvB,qCAAiC;AACjC,2CAAsC;AACtC,kCAA4C;AAC5C,yBAA2C;AAC3C,IAAM,gBAAgB,CAAC,MAAM,MAAM,OAAO,MAAM,IAAI;AACpD,IAAM,yBAAyB;AAC/B,IAAM,4BAA4B,CAAC,OAAO,QAAQ;AAChD,QAAM;AAAA,IACJ,wBAAwB;AAAA,IACxB;AAAA,IACA,YAAY,CAAC;AAAA,IACb,yBAAyB;AAAA,IACzB;AAAA,IACA,OAAO;AAAA,IACP,OAAO,YAAY;AAAA,IACnB;AAAA,IACA,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,YAAY;AAAA,EACd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,KAAK,sBAAU;AAAA,UAC3C,UAAuB,uCAAAA,KAAK,sBAAQ;AAAA,YAClC,UAAU;AAAA,YACV,wBAAwB;AAAA,YACxB,SAAS,MAAM;AACb,yBAAW,MAAS;AAAA,YACtB;AAAA,YACA,SAAS;AAAA,YACT,uBAAuB;AAAA,YACvB,MAAM,SAAS,sBAAsB,MAAM,wBAAwB,YAAY;AAAA,YAC/E,cAAU,gBAAG,OAAO;AAAA,UACtB,CAAC;AAAA,QACH,CAAC,CAAC;AAAA,MACJ,CAAC,CAAC;AAAA,IACJ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACO,IAAM,qBAAiB,2BAAW,yBAAyB;AAClE,IAAO,2BAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\nimport { useState, forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { Button } from '../button';\nimport RangeControl from '../range-control';\nimport { Flex, FlexItem } from '../flex';\nimport { default as UnitControl, parseQuantityAndUnitFromRawValue, useCustomUnits } from '../unit-control';\nimport { Container, Header, HeaderLabel, HeaderToggle } from './styles';\nimport { Spacer } from '../spacer';\nimport FontSizePickerSelect from './font-size-picker-select';\nimport FontSizePickerToggleGroup from './font-size-picker-toggle-group';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst DEFAULT_UNITS = ['px', 'em', 'rem', 'vw', 'vh'];\nconst MAX_TOGGLE_GROUP_SIZES = 5;\nconst UnforwardedFontSizePicker = (props, ref) => {\n const {\n __next40pxDefaultSize = false,\n fallbackFontSize,\n fontSizes = [],\n disableCustomFontSizes = false,\n onChange,\n size = 'default',\n units: unitsProp = DEFAULT_UNITS,\n value,\n valueMode = 'literal',\n withSlider = false,\n withReset = true\n } = props;\n const labelId = useInstanceId(UnforwardedFontSizePicker, 'font-size-picker-label');\n const units = useCustomUnits({\n availableUnits: unitsProp\n });\n const selectedFontSize = (() => {\n if (!value) {\n return undefined;\n }\n\n // If valueMode is 'slug', find by slug\n if (valueMode === 'slug') {\n return fontSizes.find(fontSize => fontSize.slug === value);\n }\n\n // If valueMode is 'literal', find by size value\n return fontSizes.find(fontSize => fontSize.size === value);\n })();\n const isCustomValue = !!value && !selectedFontSize;\n\n // Initially request a custom picker if the value is not from the predef list.\n const [userRequestedCustom, setUserRequestedCustom] = useState(isCustomValue);\n\n // Resolve the literal value to use in custom controls when operating in slug mode.\n // When `valueMode` is 'slug', the `value` prop contains the slug of the\n // selected preset. In that case, the custom input should reflect the preset's\n // actual size value so it pre-populates correctly after clicking \"Set custom size\".\n const resolvedValueForControls = valueMode === 'slug' ? selectedFontSize?.size : value;\n let currentPickerType;\n if (!disableCustomFontSizes && userRequestedCustom) {\n // While showing the custom value picker, switch back to predef only if\n // `disableCustomFontSizes` is set to `true`.\n currentPickerType = 'custom';\n } else {\n currentPickerType = fontSizes.length > MAX_TOGGLE_GROUP_SIZES ? 'select' : 'togglegroup';\n }\n if (fontSizes.length === 0 && disableCustomFontSizes) {\n return null;\n }\n\n // If neither the value or first font size is a string, then FontSizePicker\n // operates in a legacy \"unitless\" mode where UnitControl can only be used\n // to select px values and onChange() is always called with number values.\n const hasUnits = typeof resolvedValueForControls === 'string' || typeof fontSizes[0]?.size === 'string';\n const [valueQuantity, valueUnit] = parseQuantityAndUnitFromRawValue(resolvedValueForControls, units);\n const isValueUnitRelative = !!valueUnit && ['em', 'rem', 'vw', 'vh'].includes(valueUnit);\n const isDisabled = value === undefined;\n maybeWarnDeprecated36pxSize({\n componentName: 'FontSizePicker',\n __next40pxDefaultSize,\n size\n });\n return /*#__PURE__*/_jsxs(Container, {\n ref: ref,\n className: \"components-font-size-picker\"\n // This Container component renders a fieldset element that needs to be labeled.\n ,\n \"aria-labelledby\": labelId,\n children: [/*#__PURE__*/_jsx(Spacer, {\n children: /*#__PURE__*/_jsxs(Header, {\n className: \"components-font-size-picker__header\",\n children: [/*#__PURE__*/_jsx(HeaderLabel, {\n id: labelId,\n children: __('Font size')\n }), !disableCustomFontSizes && /*#__PURE__*/_jsx(HeaderToggle, {\n label: currentPickerType === 'custom' ? __('Use size preset') : __('Set custom size'),\n icon: settings,\n onClick: () => setUserRequestedCustom(!userRequestedCustom),\n isPressed: currentPickerType === 'custom',\n size: \"small\"\n })]\n })\n }), /*#__PURE__*/_jsxs(\"div\", {\n children: [currentPickerType === 'select' && /*#__PURE__*/_jsx(FontSizePickerSelect, {\n __next40pxDefaultSize: __next40pxDefaultSize,\n fontSizes: fontSizes,\n value: value,\n valueMode: valueMode,\n disableCustomFontSizes: disableCustomFontSizes,\n size: size,\n onChange: (newValue, selectedItem) => {\n if (newValue === undefined) {\n onChange?.(undefined, selectedItem);\n } else {\n onChange?.(hasUnits ? newValue : Number(newValue), selectedItem);\n }\n },\n onSelectCustom: () => setUserRequestedCustom(true)\n }), currentPickerType === 'togglegroup' && /*#__PURE__*/_jsx(FontSizePickerToggleGroup, {\n fontSizes: fontSizes,\n value: value,\n valueMode: valueMode,\n __next40pxDefaultSize: __next40pxDefaultSize,\n size: size,\n onChange: (newValue, selectedItem) => {\n if (newValue === undefined) {\n onChange?.(undefined, selectedItem);\n } else {\n onChange?.(hasUnits ? newValue : Number(newValue), selectedItem);\n }\n }\n }), currentPickerType === 'custom' && /*#__PURE__*/_jsxs(Flex, {\n className: \"components-font-size-picker__custom-size-control\",\n children: [/*#__PURE__*/_jsx(FlexItem, {\n isBlock: true,\n children: /*#__PURE__*/_jsx(UnitControl, {\n __next40pxDefaultSize: __next40pxDefaultSize,\n __shouldNotWarnDeprecated36pxSize: true,\n label: __('Font size'),\n labelPosition: \"top\",\n hideLabelFromVision: true,\n value: hasUnits ? `${valueQuantity ?? ''}${valueUnit ?? ''}` : resolvedValueForControls,\n onChange: newValue => {\n setUserRequestedCustom(true);\n\n // Treat clearing the input (empty string) as a reset\n if (newValue === undefined || newValue === '') {\n onChange?.(undefined);\n } else {\n onChange?.(hasUnits ? newValue : parseInt(newValue, 10));\n }\n },\n size: size,\n units: hasUnits ? units : [],\n min: 0\n })\n }), withSlider && /*#__PURE__*/_jsx(FlexItem, {\n isBlock: true,\n children: /*#__PURE__*/_jsx(Spacer, {\n marginX: 2,\n marginBottom: 0,\n children: /*#__PURE__*/_jsx(RangeControl, {\n __next40pxDefaultSize: __next40pxDefaultSize,\n __shouldNotWarnDeprecated36pxSize: true,\n className: \"components-font-size-picker__custom-input\",\n label: __('Font size'),\n hideLabelFromVision: true,\n value: valueQuantity,\n initialPosition: fallbackFontSize,\n withInputField: false,\n onChange: newValue => {\n setUserRequestedCustom(true);\n if (newValue === undefined) {\n onChange?.(undefined);\n } else if (hasUnits) {\n onChange?.(newValue + (valueUnit ?? 'px'));\n } else {\n onChange?.(newValue);\n }\n },\n min: 0,\n max: isValueUnitRelative ? 10 : 100,\n step: isValueUnitRelative ? 0.1 : 1\n })\n })\n }), withReset && /*#__PURE__*/_jsx(FlexItem, {\n children: /*#__PURE__*/_jsx(Button, {\n disabled: isDisabled,\n accessibleWhenDisabled: true,\n onClick: () => {\n onChange?.(undefined);\n },\n variant: \"secondary\",\n __next40pxDefaultSize: true,\n size: size === '__unstable-large' || props.__next40pxDefaultSize ? 'default' : 'small',\n children: __('Reset')\n })\n })]\n })]\n })]\n });\n};\nexport const FontSizePicker = forwardRef(UnforwardedFontSizePicker);\nFontSizePicker.displayName = 'FontSizePicker';\nexport default FontSizePicker;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,kBAAmB;AACnB,mBAAyB;AACzB,qBAAqC;AACrC,qBAA8B;AAK9B,oBAAuB;AACvB,2BAAyB;AACzB,kBAA+B;AAC/B,0BAAyF;AACzF,oBAA6D;AAC7D,oBAAuB;AACvB,qCAAiC;AACjC,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B,6BAAW,MAAS;AAAA,gBACtB,WAAW,UAAU;AACnB,6BAAW,YAAY,aAAa,KAAK;AAAA,gBAC3C,OAAO;AACL,6BAAW,QAAQ;AAAA,gBACrB;AAAA,cACF;AAAA,cACA,KAAK;AAAA,cACL,KAAK,sBAAsB,KAAK;AAAA,cAChC,MAAM,sBAAsB,MAAM;AAAA,YACpC,CAAC;AAAA,UACH,CAAC;AAAA,QACH,CAAC,GAAG,aAA0B,uCAAAJ,KAAK,sBAAU;AAAA,UAC3C,UAAuB,uCAAAA,KAAK,sBAAQ;AAAA,YAClC,UAAU;AAAA,YACV,wBAAwB;AAAA,YACxB,SAAS,MAAM;AACb,yBAAW,MAAS;AAAA,YACtB;AAAA,YACA,SAAS;AAAA,YACT,uBAAuB;AAAA,YACvB,MAAM,SAAS,sBAAsB,MAAM,wBAAwB,YAAY;AAAA,YAC/E,cAAU,gBAAG,OAAO;AAAA,UACtB,CAAC;AAAA,QACH,CAAC,CAAC;AAAA,MACJ,CAAC,CAAC;AAAA,IACJ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACO,IAAM,qBAAiB,2BAAW,yBAAyB;AAClE,eAAe,cAAc;AAC7B,IAAO,2BAAQ;",
6
6
  "names": ["_jsxs", "_jsx", "FontSizePickerSelect", "FontSizePickerToggleGroup", "UnitControl", "RangeControl"]
7
7
  }
@@ -61,11 +61,15 @@ function FormFileUpload({
61
61
  }
62
62
  const ui = render ? render({
63
63
  openFileDialog
64
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.default, {
65
- onClick: openFileDialog,
66
- ...props,
67
- children
68
- });
64
+ }) : (
65
+ // Disable reason: the parent component already takes care of the `__next40pxDefaultSize` prop.
66
+ // eslint-disable-next-line @wordpress/components-no-missing-40px-size-prop
67
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_button.default, {
68
+ onClick: openFileDialog,
69
+ ...props,
70
+ children
71
+ })
72
+ );
69
73
  const compatAccept = accept?.includes("audio/*") ? `${accept}, audio/mp3, audio/x-m4a, audio/x-m4b, audio/x-m4p, audio/x-wav, audio/webm` : accept;
70
74
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
71
75
  className: "components-form-file-upload",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/form-file-upload/index.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\n/**\n * FormFileUpload allows users to select files from their local device.\n *\n * ```jsx\n * import { FormFileUpload } from '@wordpress/components';\n *\n * const MyFormFileUpload = () => (\n * <FormFileUpload\n * __next40pxDefaultSize\n * accept=\"image/*\"\n * onChange={ ( event ) => console.log( event.currentTarget.files ) }\n * >\n * Upload\n * </FormFileUpload>\n * );\n * ```\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function FormFileUpload({\n accept,\n children,\n multiple = false,\n onChange,\n onClick,\n render,\n ...props\n}) {\n const ref = useRef(null);\n const openFileDialog = () => {\n ref.current?.click();\n };\n if (!render) {\n maybeWarnDeprecated36pxSize({\n componentName: 'FormFileUpload',\n __next40pxDefaultSize: props.__next40pxDefaultSize,\n // @ts-expect-error - We don't \"officially\" support all Button props but this likely happens.\n size: props.size\n });\n }\n const ui = render ? render({\n openFileDialog\n }) : /*#__PURE__*/_jsx(Button, {\n onClick: openFileDialog,\n ...props,\n children: children\n });\n\n // iOS browsers may not reliably handle 'audio/*' in the accept attribute.\n // Adding explicit audio MIME types improves compatibility across all devices.\n const compatAccept = accept?.includes('audio/*') ? `${accept}, audio/mp3, audio/x-m4a, audio/x-m4b, audio/x-m4p, audio/x-wav, audio/webm` : accept;\n return /*#__PURE__*/_jsxs(\"div\", {\n className: \"components-form-file-upload\",\n children: [ui, /*#__PURE__*/_jsx(\"input\", {\n type: \"file\",\n ref: ref,\n multiple: multiple,\n style: {\n display: 'none'\n },\n accept: compatAccept,\n onChange: onChange,\n onClick: onClick,\n \"data-testid\": \"form-file-upload-input\"\n })]\n });\n}\nexport default FormFileUpload;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAuB;AAKvB,oBAAmB;AACnB,kCAA4C;AAmB5C,yBAA2C;AACpC,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,UAAM,uBAAO,IAAI;AACvB,QAAM,iBAAiB,MAAM;AAC3B,QAAI,SAAS,MAAM;AAAA,EACrB;AACA,MAAI,CAAC,QAAQ;AACX,iEAA4B;AAAA,MAC1B,eAAe;AAAA,MACf,uBAAuB,MAAM;AAAA;AAAA,MAE7B,MAAM,MAAM;AAAA,IACd,CAAC;AAAA,EACH;AACA,QAAM,KAAK,SAAS,OAAO;AAAA,IACzB;AAAA,EACF,CAAC,IAAiB,uCAAAA,KAAK,cAAAC,SAAQ;AAAA,IAC7B,SAAS;AAAA,IACT,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AAID,QAAM,eAAe,QAAQ,SAAS,SAAS,IAAI,GAAG,MAAM,gFAAgF;AAC5I,SAAoB,uCAAAC,MAAM,OAAO;AAAA,IAC/B,WAAW;AAAA,IACX,UAAU,CAAC,IAAiB,uCAAAF,KAAK,SAAS;AAAA,MACxC,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA,eAAe;AAAA,IACjB,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,2BAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\n\n/**\n * FormFileUpload allows users to select files from their local device.\n *\n * ```jsx\n * import { FormFileUpload } from '@wordpress/components';\n *\n * const MyFormFileUpload = () => (\n * <FormFileUpload\n * __next40pxDefaultSize\n * accept=\"image/*\"\n * onChange={ ( event ) => console.log( event.currentTarget.files ) }\n * >\n * Upload\n * </FormFileUpload>\n * );\n * ```\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function FormFileUpload({\n accept,\n children,\n multiple = false,\n onChange,\n onClick,\n render,\n ...props\n}) {\n const ref = useRef(null);\n const openFileDialog = () => {\n ref.current?.click();\n };\n if (!render) {\n maybeWarnDeprecated36pxSize({\n componentName: 'FormFileUpload',\n __next40pxDefaultSize: props.__next40pxDefaultSize,\n // @ts-expect-error - We don't \"officially\" support all Button props but this likely happens.\n size: props.size\n });\n }\n const ui = render ? render({\n openFileDialog\n }) :\n /*#__PURE__*/\n // Disable reason: the parent component already takes care of the `__next40pxDefaultSize` prop.\n // eslint-disable-next-line @wordpress/components-no-missing-40px-size-prop\n _jsx(Button, {\n onClick: openFileDialog,\n ...props,\n children: children\n });\n\n // iOS browsers may not reliably handle 'audio/*' in the accept attribute.\n // Adding explicit audio MIME types improves compatibility across all devices.\n const compatAccept = accept?.includes('audio/*') ? `${accept}, audio/mp3, audio/x-m4a, audio/x-m4b, audio/x-m4p, audio/x-wav, audio/webm` : accept;\n return /*#__PURE__*/_jsxs(\"div\", {\n className: \"components-form-file-upload\",\n children: [ui, /*#__PURE__*/_jsx(\"input\", {\n type: \"file\",\n ref: ref,\n multiple: multiple,\n style: {\n display: 'none'\n },\n accept: compatAccept,\n onChange: onChange,\n onClick: onClick,\n \"data-testid\": \"form-file-upload-input\"\n })]\n });\n}\nexport default FormFileUpload;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAuB;AAKvB,oBAAmB;AACnB,kCAA4C;AAmB5C,yBAA2C;AACpC,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,UAAM,uBAAO,IAAI;AACvB,QAAM,iBAAiB,MAAM;AAC3B,QAAI,SAAS,MAAM;AAAA,EACrB;AACA,MAAI,CAAC,QAAQ;AACX,iEAA4B;AAAA,MAC1B,eAAe;AAAA,MACf,uBAAuB,MAAM;AAAA;AAAA,MAE7B,MAAM,MAAM;AAAA,IACd,CAAC;AAAA,EACH;AACA,QAAM,KAAK,SAAS,OAAO;AAAA,IACzB;AAAA,EACF,CAAC;AAAA;AAAA;AAAA,IAID,uCAAAA,KAAK,cAAAC,SAAQ;AAAA,MACX,SAAS;AAAA,MACT,GAAG;AAAA,MACH;AAAA,IACF,CAAC;AAAA;AAID,QAAM,eAAe,QAAQ,SAAS,SAAS,IAAI,GAAG,MAAM,gFAAgF;AAC5I,SAAoB,uCAAAC,MAAM,OAAO;AAAA,IAC/B,WAAW;AAAA,IACX,UAAU,CAAC,IAAiB,uCAAAF,KAAK,SAAS;AAAA,MACxC,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA,eAAe;AAAA,IACjB,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,2BAAQ;",
6
6
  "names": ["_jsx", "Button", "_jsxs"]
7
7
  }
@@ -77,6 +77,7 @@ function UnforwardedFormToggle(props, ref) {
77
77
  });
78
78
  }
79
79
  var FormToggle = (0, import_element.forwardRef)(UnforwardedFormToggle);
80
+ FormToggle.displayName = "FormToggle";
80
81
  var form_toggle_default = FormToggle;
81
82
  // Annotate the CommonJS export names for ESM import in node:
82
83
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/form-toggle/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const noop = () => {};\nfunction UnforwardedFormToggle(props, ref) {\n const {\n className,\n checked,\n id,\n disabled,\n onChange = noop,\n onClick,\n ...additionalProps\n } = props;\n const wrapperClasses = clsx('components-form-toggle', className, {\n 'is-checked': checked,\n 'is-disabled': disabled\n });\n return /*#__PURE__*/_jsxs(\"span\", {\n className: wrapperClasses,\n children: [/*#__PURE__*/_jsx(\"input\", {\n className: \"components-form-toggle__input\",\n id: id,\n type: \"checkbox\",\n checked: checked,\n onChange: onChange,\n disabled: disabled,\n onClick: event => {\n // Compat code for Safari to ensure that the toggle is focused when clicked.\n event.currentTarget.focus();\n onClick?.(event);\n },\n ...additionalProps,\n ref: ref\n }), /*#__PURE__*/_jsx(\"span\", {\n className: \"components-form-toggle__track\"\n }), /*#__PURE__*/_jsx(\"span\", {\n className: \"components-form-toggle__thumb\"\n })]\n });\n}\n\n/**\n * FormToggle switches a single setting on or off.\n *\n * ```jsx\n * import { FormToggle } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyFormToggle = () => {\n * const [ isChecked, setChecked ] = useState( true );\n *\n * return (\n * <FormToggle\n * checked={ isChecked }\n * onChange={ () => setChecked( ( state ) => ! state ) }\n * />\n * );\n * };\n * ```\n */\nexport const FormToggle = forwardRef(UnforwardedFormToggle);\nexport default FormToggle;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAIjB,qBAA2B;AAK3B,yBAA2C;AACpC,IAAM,OAAO,MAAM;AAAC;AAC3B,SAAS,sBAAsB,OAAO,KAAK;AACzC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,qBAAiB,YAAAA,SAAK,0BAA0B,WAAW;AAAA,IAC/D,cAAc;AAAA,IACd,eAAe;AAAA,EACjB,CAAC;AACD,SAAoB,uCAAAC,MAAM,QAAQ;AAAA,IAChC,WAAW;AAAA,IACX,UAAU,CAAc,uCAAAC,KAAK,SAAS;AAAA,MACpC,WAAW;AAAA,MACX;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,WAAS;AAEhB,cAAM,cAAc,MAAM;AAC1B,kBAAU,KAAK;AAAA,MACjB;AAAA,MACA,GAAG;AAAA,MACH;AAAA,IACF,CAAC,GAAgB,uCAAAA,KAAK,QAAQ;AAAA,MAC5B,WAAW;AAAA,IACb,CAAC,GAAgB,uCAAAA,KAAK,QAAQ;AAAA,MAC5B,WAAW;AAAA,IACb,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AAqBO,IAAM,iBAAa,2BAAW,qBAAqB;AAC1D,IAAO,sBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const noop = () => {};\nfunction UnforwardedFormToggle(props, ref) {\n const {\n className,\n checked,\n id,\n disabled,\n onChange = noop,\n onClick,\n ...additionalProps\n } = props;\n const wrapperClasses = clsx('components-form-toggle', className, {\n 'is-checked': checked,\n 'is-disabled': disabled\n });\n return /*#__PURE__*/_jsxs(\"span\", {\n className: wrapperClasses,\n children: [/*#__PURE__*/_jsx(\"input\", {\n className: \"components-form-toggle__input\",\n id: id,\n type: \"checkbox\",\n checked: checked,\n onChange: onChange,\n disabled: disabled,\n onClick: event => {\n // Compat code for Safari to ensure that the toggle is focused when clicked.\n event.currentTarget.focus();\n onClick?.(event);\n },\n ...additionalProps,\n ref: ref\n }), /*#__PURE__*/_jsx(\"span\", {\n className: \"components-form-toggle__track\"\n }), /*#__PURE__*/_jsx(\"span\", {\n className: \"components-form-toggle__thumb\"\n })]\n });\n}\n\n/**\n * FormToggle switches a single setting on or off.\n *\n * ```jsx\n * import { FormToggle } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyFormToggle = () => {\n * const [ isChecked, setChecked ] = useState( true );\n *\n * return (\n * <FormToggle\n * checked={ isChecked }\n * onChange={ () => setChecked( ( state ) => ! state ) }\n * />\n * );\n * };\n * ```\n */\nexport const FormToggle = forwardRef(UnforwardedFormToggle);\nFormToggle.displayName = 'FormToggle';\nexport default FormToggle;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAIjB,qBAA2B;AAK3B,yBAA2C;AACpC,IAAM,OAAO,MAAM;AAAC;AAC3B,SAAS,sBAAsB,OAAO,KAAK;AACzC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,qBAAiB,YAAAA,SAAK,0BAA0B,WAAW;AAAA,IAC/D,cAAc;AAAA,IACd,eAAe;AAAA,EACjB,CAAC;AACD,SAAoB,uCAAAC,MAAM,QAAQ;AAAA,IAChC,WAAW;AAAA,IACX,UAAU,CAAc,uCAAAC,KAAK,SAAS;AAAA,MACpC,WAAW;AAAA,MACX;AAAA,MACA,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,WAAS;AAEhB,cAAM,cAAc,MAAM;AAC1B,kBAAU,KAAK;AAAA,MACjB;AAAA,MACA,GAAG;AAAA,MACH;AAAA,IACF,CAAC,GAAgB,uCAAAA,KAAK,QAAQ;AAAA,MAC5B,WAAW;AAAA,IACb,CAAC,GAAgB,uCAAAA,KAAK,QAAQ;AAAA,MAC5B,WAAW;AAAA,IACb,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AAqBO,IAAM,iBAAa,2BAAW,qBAAqB;AAC1D,WAAW,cAAc;AACzB,IAAO,sBAAQ;",
6
6
  "names": ["clsx", "_jsxs", "_jsx"]
7
7
  }
@@ -94,6 +94,7 @@ function UnForwardedTokenInput(props, ref) {
94
94
  });
95
95
  }
96
96
  var TokenInput = (0, import_element.forwardRef)(UnForwardedTokenInput);
97
+ TokenInput.displayName = "TokenInput";
97
98
  var token_input_default = TokenInput;
98
99
  // Annotate the CommonJS export names for ESM import in node:
99
100
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/form-token-field/token-input.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function UnForwardedTokenInput(props, ref) {\n const {\n value,\n isExpanded,\n instanceId,\n selectedSuggestionIndex,\n className,\n onChange,\n onFocus,\n onBlur,\n ...restProps\n } = props;\n const [hasFocus, setHasFocus] = useState(false);\n const size = value ? value.length + 1 : 0;\n const onChangeHandler = event => {\n if (onChange) {\n onChange({\n value: event.target.value\n });\n }\n };\n const onFocusHandler = e => {\n setHasFocus(true);\n onFocus?.(e);\n };\n const onBlurHandler = e => {\n setHasFocus(false);\n onBlur?.(e);\n };\n return /*#__PURE__*/_jsx(\"input\", {\n ref: ref,\n id: `components-form-token-input-${instanceId}`,\n type: \"text\",\n ...restProps,\n value: value || '',\n onChange: onChangeHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler,\n size: size,\n className: clsx(className, 'components-form-token-field__input'),\n autoComplete: \"off\",\n role: \"combobox\",\n \"aria-expanded\": isExpanded,\n \"aria-autocomplete\": \"list\",\n \"aria-owns\": isExpanded ? `components-form-token-suggestions-${instanceId}` : undefined,\n \"aria-activedescendant\":\n // Only add the `aria-activedescendant` attribute when:\n // - the user is actively interacting with the input (`hasFocus`)\n // - there is a selected suggestion (`selectedSuggestionIndex !== -1`)\n // - the list of suggestions are rendered in the DOM (`isExpanded`)\n hasFocus && selectedSuggestionIndex !== -1 && isExpanded ? `components-form-token-suggestions-${instanceId}-${selectedSuggestionIndex}` : undefined,\n \"aria-describedby\": `components-form-token-suggestions-howto-${instanceId}`\n });\n}\nexport const TokenInput = forwardRef(UnForwardedTokenInput);\nexport default TokenInput;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAIjB,qBAAqC;AAKrC,yBAA4B;AACrB,SAAS,sBAAsB,OAAO,KAAK;AAChD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,CAAC,UAAU,WAAW,QAAI,yBAAS,KAAK;AAC9C,QAAM,OAAO,QAAQ,MAAM,SAAS,IAAI;AACxC,QAAM,kBAAkB,WAAS;AAC/B,QAAI,UAAU;AACZ,eAAS;AAAA,QACP,OAAO,MAAM,OAAO;AAAA,MACtB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,iBAAiB,OAAK;AAC1B,gBAAY,IAAI;AAChB,cAAU,CAAC;AAAA,EACb;AACA,QAAM,gBAAgB,OAAK;AACzB,gBAAY,KAAK;AACjB,aAAS,CAAC;AAAA,EACZ;AACA,SAAoB,uCAAAA,KAAK,SAAS;AAAA,IAChC;AAAA,IACA,IAAI,+BAA+B,UAAU;AAAA,IAC7C,MAAM;AAAA,IACN,GAAG;AAAA,IACH,OAAO,SAAS;AAAA,IAChB,UAAU;AAAA,IACV,SAAS;AAAA,IACT,QAAQ;AAAA,IACR;AAAA,IACA,eAAW,YAAAC,SAAK,WAAW,oCAAoC;AAAA,IAC/D,cAAc;AAAA,IACd,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,aAAa,aAAa,qCAAqC,UAAU,KAAK;AAAA,IAC9E;AAAA;AAAA;AAAA;AAAA;AAAA,MAKA,YAAY,4BAA4B,MAAM,aAAa,qCAAqC,UAAU,IAAI,uBAAuB,KAAK;AAAA;AAAA,IAC1I,oBAAoB,2CAA2C,UAAU;AAAA,EAC3E,CAAC;AACH;AACO,IAAM,iBAAa,2BAAW,qBAAqB;AAC1D,IAAO,sBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function UnForwardedTokenInput(props, ref) {\n const {\n value,\n isExpanded,\n instanceId,\n selectedSuggestionIndex,\n className,\n onChange,\n onFocus,\n onBlur,\n ...restProps\n } = props;\n const [hasFocus, setHasFocus] = useState(false);\n const size = value ? value.length + 1 : 0;\n const onChangeHandler = event => {\n if (onChange) {\n onChange({\n value: event.target.value\n });\n }\n };\n const onFocusHandler = e => {\n setHasFocus(true);\n onFocus?.(e);\n };\n const onBlurHandler = e => {\n setHasFocus(false);\n onBlur?.(e);\n };\n return /*#__PURE__*/_jsx(\"input\", {\n ref: ref,\n id: `components-form-token-input-${instanceId}`,\n type: \"text\",\n ...restProps,\n value: value || '',\n onChange: onChangeHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler,\n size: size,\n className: clsx(className, 'components-form-token-field__input'),\n autoComplete: \"off\",\n role: \"combobox\",\n \"aria-expanded\": isExpanded,\n \"aria-autocomplete\": \"list\",\n \"aria-owns\": isExpanded ? `components-form-token-suggestions-${instanceId}` : undefined,\n \"aria-activedescendant\":\n // Only add the `aria-activedescendant` attribute when:\n // - the user is actively interacting with the input (`hasFocus`)\n // - there is a selected suggestion (`selectedSuggestionIndex !== -1`)\n // - the list of suggestions are rendered in the DOM (`isExpanded`)\n hasFocus && selectedSuggestionIndex !== -1 && isExpanded ? `components-form-token-suggestions-${instanceId}-${selectedSuggestionIndex}` : undefined,\n \"aria-describedby\": `components-form-token-suggestions-howto-${instanceId}`\n });\n}\nexport const TokenInput = forwardRef(UnForwardedTokenInput);\nTokenInput.displayName = 'TokenInput';\nexport default TokenInput;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAIjB,qBAAqC;AAKrC,yBAA4B;AACrB,SAAS,sBAAsB,OAAO,KAAK;AAChD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,CAAC,UAAU,WAAW,QAAI,yBAAS,KAAK;AAC9C,QAAM,OAAO,QAAQ,MAAM,SAAS,IAAI;AACxC,QAAM,kBAAkB,WAAS;AAC/B,QAAI,UAAU;AACZ,eAAS;AAAA,QACP,OAAO,MAAM,OAAO;AAAA,MACtB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,iBAAiB,OAAK;AAC1B,gBAAY,IAAI;AAChB,cAAU,CAAC;AAAA,EACb;AACA,QAAM,gBAAgB,OAAK;AACzB,gBAAY,KAAK;AACjB,aAAS,CAAC;AAAA,EACZ;AACA,SAAoB,uCAAAA,KAAK,SAAS;AAAA,IAChC;AAAA,IACA,IAAI,+BAA+B,UAAU;AAAA,IAC7C,MAAM;AAAA,IACN,GAAG;AAAA,IACH,OAAO,SAAS;AAAA,IAChB,UAAU;AAAA,IACV,SAAS;AAAA,IACT,QAAQ;AAAA,IACR;AAAA,IACA,eAAW,YAAAC,SAAK,WAAW,oCAAoC;AAAA,IAC/D,cAAc;AAAA,IACd,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,aAAa,aAAa,qCAAqC,UAAU,KAAK;AAAA,IAC9E;AAAA;AAAA;AAAA;AAAA;AAAA,MAKA,YAAY,4BAA4B,MAAM,aAAa,qCAAqC,UAAU,IAAI,uBAAuB,KAAK;AAAA;AAAA,IAC1I,oBAAoB,2CAA2C,UAAU;AAAA,EAC3E,CAAC;AACH;AACO,IAAM,iBAAa,2BAAW,qBAAqB;AAC1D,WAAW,cAAc;AACzB,IAAO,sBAAQ;",
6
6
  "names": ["_jsx", "clsx"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/form-token-field/token.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst noop = () => {};\nexport default function Token({\n value,\n status,\n title,\n displayTransform,\n isBorderless = false,\n disabled = false,\n onClickRemove = noop,\n onMouseEnter,\n onMouseLeave,\n messages,\n termPosition,\n termsCount\n}) {\n const instanceId = useInstanceId(Token);\n const tokenClasses = clsx('components-form-token-field__token', {\n 'is-error': 'error' === status,\n 'is-success': 'success' === status,\n 'is-validating': 'validating' === status,\n 'is-borderless': isBorderless,\n 'is-disabled': disabled\n });\n const onClick = () => onClickRemove({\n value\n });\n const transformedValue = displayTransform(value);\n const termPositionAndCount = sprintf(/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */\n __('%1$s (%2$d of %3$d)'), transformedValue, termPosition, termsCount);\n return /*#__PURE__*/_jsxs(\"span\", {\n className: tokenClasses,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n title: title,\n children: [/*#__PURE__*/_jsxs(\"span\", {\n className: \"components-form-token-field__token-text\",\n id: `components-form-token-field__token-text-${instanceId}`,\n children: [/*#__PURE__*/_jsx(VisuallyHidden, {\n as: \"span\",\n children: termPositionAndCount\n }), /*#__PURE__*/_jsx(\"span\", {\n \"aria-hidden\": \"true\",\n children: transformedValue\n })]\n }), /*#__PURE__*/_jsx(Button, {\n className: \"components-form-token-field__remove-token\",\n size: \"small\",\n icon: closeSmall,\n onClick: !disabled ? onClick : undefined\n // Disable reason: Even when FormTokenField itself is accessibly disabled, token reset buttons shouldn't be in the tab sequence.\n // eslint-disable-next-line no-restricted-syntax\n ,\n disabled: disabled,\n label: messages.remove,\n \"aria-describedby\": `components-form-token-field__token-text-${instanceId}`\n })]\n });\n}"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAA8B;AAC9B,kBAA4B;AAC5B,mBAA2B;AAK3B,oBAAmB;AACnB,6BAA+B;AAC/B,yBAA2C;AAC3C,IAAM,OAAO,MAAM;AAAC;AACL,SAAR,MAAuB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,iBAAa,8BAAc,KAAK;AACtC,QAAM,mBAAe,YAAAA,SAAK,sCAAsC;AAAA,IAC9D,YAAY,YAAY;AAAA,IACxB,cAAc,cAAc;AAAA,IAC5B,iBAAiB,iBAAiB;AAAA,IAClC,iBAAiB;AAAA,IACjB,eAAe;AAAA,EACjB,CAAC;AACD,QAAM,UAAU,MAAM,cAAc;AAAA,IAClC;AAAA,EACF,CAAC;AACD,QAAM,mBAAmB,iBAAiB,KAAK;AAC/C,QAAM,2BAAuB;AAAA;AAAA,QAC7B,gBAAG,qBAAqB;AAAA,IAAG;AAAA,IAAkB;AAAA,IAAc;AAAA,EAAU;AACrE,SAAoB,uCAAAC,MAAM,QAAQ;AAAA,IAChC,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,CAAc,uCAAAA,MAAM,QAAQ;AAAA,MACpC,WAAW;AAAA,MACX,IAAI,2CAA2C,UAAU;AAAA,MACzD,UAAU,CAAc,uCAAAC,KAAK,uCAAgB;AAAA,QAC3C,IAAI;AAAA,QACJ,UAAU;AAAA,MACZ,CAAC,GAAgB,uCAAAA,KAAK,QAAQ;AAAA,QAC5B,eAAe;AAAA,QACf,UAAU;AAAA,MACZ,CAAC,CAAC;AAAA,IACJ,CAAC,GAAgB,uCAAAA,KAAK,cAAAC,SAAQ;AAAA,MAC5B,WAAW;AAAA,MACX,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS,CAAC,WAAW,UAAU;AAAA,MAI/B;AAAA,MACA,OAAO,SAAS;AAAA,MAChB,oBAAoB,2CAA2C,UAAU;AAAA,IAC3E,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst noop = () => {};\nexport default function Token({\n value,\n status,\n title,\n displayTransform,\n isBorderless = false,\n disabled = false,\n onClickRemove = noop,\n onMouseEnter,\n onMouseLeave,\n messages,\n termPosition,\n termsCount\n}) {\n const instanceId = useInstanceId(Token);\n const tokenClasses = clsx('components-form-token-field__token', {\n 'is-error': 'error' === status,\n 'is-success': 'success' === status,\n 'is-validating': 'validating' === status,\n 'is-borderless': isBorderless,\n 'is-disabled': disabled\n });\n const onClick = () => onClickRemove({\n value\n });\n const transformedValue = displayTransform(value);\n const termPositionAndCount = sprintf(/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */\n __('%1$s (%2$d of %3$d)'), transformedValue, termPosition, termsCount);\n return /*#__PURE__*/_jsxs(\"span\", {\n className: tokenClasses,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n title: title,\n children: [/*#__PURE__*/_jsxs(\"span\", {\n className: \"components-form-token-field__token-text\",\n id: `components-form-token-field__token-text-${instanceId}`,\n children: [/*#__PURE__*/_jsx(VisuallyHidden, {\n as: \"span\",\n children: termPositionAndCount\n }), /*#__PURE__*/_jsx(\"span\", {\n \"aria-hidden\": \"true\",\n children: transformedValue\n })]\n }), /*#__PURE__*/_jsx(Button, {\n className: \"components-form-token-field__remove-token\",\n size: \"small\",\n icon: closeSmall,\n onClick: !disabled ? onClick : undefined,\n disabled: disabled,\n label: messages.remove,\n \"aria-describedby\": `components-form-token-field__token-text-${instanceId}`\n })]\n });\n}"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAA8B;AAC9B,kBAA4B;AAC5B,mBAA2B;AAK3B,oBAAmB;AACnB,6BAA+B;AAC/B,yBAA2C;AAC3C,IAAM,OAAO,MAAM;AAAC;AACL,SAAR,MAAuB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,iBAAa,8BAAc,KAAK;AACtC,QAAM,mBAAe,YAAAA,SAAK,sCAAsC;AAAA,IAC9D,YAAY,YAAY;AAAA,IACxB,cAAc,cAAc;AAAA,IAC5B,iBAAiB,iBAAiB;AAAA,IAClC,iBAAiB;AAAA,IACjB,eAAe;AAAA,EACjB,CAAC;AACD,QAAM,UAAU,MAAM,cAAc;AAAA,IAClC;AAAA,EACF,CAAC;AACD,QAAM,mBAAmB,iBAAiB,KAAK;AAC/C,QAAM,2BAAuB;AAAA;AAAA,QAC7B,gBAAG,qBAAqB;AAAA,IAAG;AAAA,IAAkB;AAAA,IAAc;AAAA,EAAU;AACrE,SAAoB,uCAAAC,MAAM,QAAQ;AAAA,IAChC,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,CAAc,uCAAAA,MAAM,QAAQ;AAAA,MACpC,WAAW;AAAA,MACX,IAAI,2CAA2C,UAAU;AAAA,MACzD,UAAU,CAAc,uCAAAC,KAAK,uCAAgB;AAAA,QAC3C,IAAI;AAAA,QACJ,UAAU;AAAA,MACZ,CAAC,GAAgB,uCAAAA,KAAK,QAAQ;AAAA,QAC5B,eAAe;AAAA,QACf,UAAU;AAAA,MACZ,CAAC,CAAC;AAAA,IACJ,CAAC,GAAgB,uCAAAA,KAAK,cAAAC,SAAQ;AAAA,MAC5B,WAAW;AAAA,MACX,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS,CAAC,WAAW,UAAU;AAAA,MAC/B;AAAA,MACA,OAAO,SAAS;AAAA,MAChB,oBAAoB,2CAA2C,UAAU;AAAA,IAC3E,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;",
6
6
  "names": ["clsx", "_jsxs", "_jsx", "Button"]
7
7
  }
@@ -68,10 +68,9 @@ function Guide({
68
68
  }
69
69
  }, [children]);
70
70
  if (import_element.Children.count(children)) {
71
- var _Children$map;
72
- pages = (_Children$map = import_element.Children.map(children, (child) => ({
71
+ pages = import_element.Children.map(children, (child) => ({
73
72
  content: child
74
- }))) !== null && _Children$map !== void 0 ? _Children$map : [];
73
+ })) ?? [];
75
74
  }
76
75
  const canGoBack = currentPage > 0;
77
76
  const canGoForward = currentPage < pages.length - 1;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/guide/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect, Children, useRef } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Modal from '../modal';\nimport Button from '../button';\nimport PageControl from './page-control';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * `Guide` is a React component that renders a _user guide_ in a modal. The guide consists of several pages which the user can step through one by one. The guide is finished when the modal is closed or when the user clicks _Finish_ on the last page of the guide.\n *\n * ```jsx\n * function MyTutorial() {\n * \tconst [ isOpen, setIsOpen ] = useState( true );\n *\n * \tif ( ! isOpen ) {\n * \t\treturn null;\n * \t}\n *\n * \treturn (\n * \t\t<Guide\n * \t\t\tonFinish={ () => setIsOpen( false ) }\n * \t\t\tpages={ [\n * \t\t\t\t{\n * \t\t\t\t\tcontent: <p>Welcome to the ACME Store!</p>,\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\timage: <img src=\"https://acmestore.com/add-to-cart.png\" />,\n * \t\t\t\t\tcontent: (\n * \t\t\t\t\t\t<p>\n * \t\t\t\t\t\t\tClick <i>Add to Cart</i> to buy a product.\n * \t\t\t\t\t\t</p>\n * \t\t\t\t\t),\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\nfunction Guide({\n children,\n className,\n contentLabel,\n finishButtonText = __('Finish'),\n nextButtonText = __('Next'),\n previousButtonText = __('Previous'),\n onFinish,\n pages = []\n}) {\n const ref = useRef(null);\n const [currentPage, setCurrentPage] = useState(0);\n useEffect(() => {\n // Place focus at the top of the guide on mount and when the page changes.\n const frame = ref.current?.querySelector('.components-guide');\n if (frame instanceof HTMLElement) {\n frame.focus();\n }\n }, [currentPage]);\n useEffect(() => {\n if (Children.count(children)) {\n deprecated('Passing children to <Guide>', {\n since: '5.5',\n alternative: 'the `pages` prop'\n });\n }\n }, [children]);\n if (Children.count(children)) {\n var _Children$map;\n pages = (_Children$map = Children.map(children, child => ({\n content: child\n }))) !== null && _Children$map !== void 0 ? _Children$map : [];\n }\n const canGoBack = currentPage > 0;\n const canGoForward = currentPage < pages.length - 1;\n const goBack = () => {\n if (canGoBack) {\n setCurrentPage(currentPage - 1);\n }\n };\n const goForward = () => {\n if (canGoForward) {\n setCurrentPage(currentPage + 1);\n }\n };\n if (pages.length === 0) {\n return null;\n }\n return /*#__PURE__*/_jsx(Modal, {\n className: clsx('components-guide', className),\n contentLabel: contentLabel,\n isDismissible: pages.length > 1,\n onRequestClose: onFinish,\n onKeyDown: event => {\n if (event.code === 'ArrowLeft') {\n goBack();\n // Do not scroll the modal's contents.\n event.preventDefault();\n } else if (event.code === 'ArrowRight') {\n goForward();\n // Do not scroll the modal's contents.\n event.preventDefault();\n }\n },\n ref: ref,\n children: /*#__PURE__*/_jsxs(\"div\", {\n className: \"components-guide__container\",\n children: [/*#__PURE__*/_jsxs(\"div\", {\n className: \"components-guide__page\",\n children: [pages[currentPage].image, pages.length > 1 && /*#__PURE__*/_jsx(PageControl, {\n currentPage: currentPage,\n numberOfPages: pages.length,\n setCurrentPage: setCurrentPage\n }), pages[currentPage].content]\n }), /*#__PURE__*/_jsxs(\"div\", {\n className: \"components-guide__footer\",\n children: [canGoBack && /*#__PURE__*/_jsx(Button, {\n className: \"components-guide__back-button\",\n variant: \"tertiary\",\n onClick: goBack,\n __next40pxDefaultSize: true,\n children: previousButtonText\n }), canGoForward && /*#__PURE__*/_jsx(Button, {\n className: \"components-guide__forward-button\",\n variant: \"primary\",\n onClick: goForward,\n __next40pxDefaultSize: true,\n children: nextButtonText\n }), !canGoForward && /*#__PURE__*/_jsx(Button, {\n className: \"components-guide__finish-button\",\n variant: \"primary\",\n onClick: onFinish,\n __next40pxDefaultSize: true,\n children: finishButtonText\n })]\n })]\n })\n });\n}\nexport default Guide;"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAAsD;AACtD,wBAAuB;AACvB,kBAAmB;AAKnB,mBAAkB;AAClB,oBAAmB;AACnB,0BAAwB;AACxB,yBAA2C;AAiC3C,SAAS,MAAM;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA,uBAAmB,gBAAG,QAAQ;AAAA,EAC9B,qBAAiB,gBAAG,MAAM;AAAA,EAC1B,yBAAqB,gBAAG,UAAU;AAAA,EAClC;AAAA,EACA,QAAQ,CAAC;AACX,GAAG;AACD,QAAM,UAAM,uBAAO,IAAI;AACvB,QAAM,CAAC,aAAa,cAAc,QAAI,yBAAS,CAAC;AAChD,gCAAU,MAAM;AAEd,UAAM,QAAQ,IAAI,SAAS,cAAc,mBAAmB;AAC5D,QAAI,iBAAiB,aAAa;AAChC,YAAM,MAAM;AAAA,IACd;AAAA,EACF,GAAG,CAAC,WAAW,CAAC;AAChB,gCAAU,MAAM;AACd,QAAI,wBAAS,MAAM,QAAQ,GAAG;AAC5B,4BAAAA,SAAW,+BAA+B;AAAA,QACxC,OAAO;AAAA,QACP,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AACb,MAAI,wBAAS,MAAM,QAAQ,GAAG;AAC5B,QAAI;AACJ,aAAS,gBAAgB,wBAAS,IAAI,UAAU,YAAU;AAAA,MACxD,SAAS;AAAA,IACX,EAAE,OAAO,QAAQ,kBAAkB,SAAS,gBAAgB,CAAC;AAAA,EAC/D;AACA,QAAM,YAAY,cAAc;AAChC,QAAM,eAAe,cAAc,MAAM,SAAS;AAClD,QAAM,SAAS,MAAM;AACnB,QAAI,WAAW;AACb,q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AAL,KAAK,cAAAK,SAAQ;AAAA,UAC7C,WAAW;AAAA,UACX,SAAS;AAAA,UACT,SAAS;AAAA,UACT,uBAAuB;AAAA,UACvB,UAAU;AAAA,QACZ,CAAC,CAAC;AAAA,MACJ,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA,EACH,CAAC;AACH;AACA,IAAO,gBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useEffect, Children, useRef } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Modal from '../modal';\nimport Button from '../button';\nimport PageControl from './page-control';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\n/**\n * `Guide` is a React component that renders a _user guide_ in a modal. The guide consists of several pages which the user can step through one by one. The guide is finished when the modal is closed or when the user clicks _Finish_ on the last page of the guide.\n *\n * ```jsx\n * function MyTutorial() {\n * \tconst [ isOpen, setIsOpen ] = useState( true );\n *\n * \tif ( ! isOpen ) {\n * \t\treturn null;\n * \t}\n *\n * \treturn (\n * \t\t<Guide\n * \t\t\tonFinish={ () => setIsOpen( false ) }\n * \t\t\tpages={ [\n * \t\t\t\t{\n * \t\t\t\t\tcontent: <p>Welcome to the ACME Store!</p>,\n * \t\t\t\t},\n * \t\t\t\t{\n * \t\t\t\t\timage: <img src=\"https://acmestore.com/add-to-cart.png\" />,\n * \t\t\t\t\tcontent: (\n * \t\t\t\t\t\t<p>\n * \t\t\t\t\t\t\tClick <i>Add to Cart</i> to buy a product.\n * \t\t\t\t\t\t</p>\n * \t\t\t\t\t),\n * \t\t\t\t},\n * \t\t\t] }\n * \t\t/>\n * \t);\n * }\n * ```\n */\nfunction Guide({\n children,\n className,\n contentLabel,\n finishButtonText = __('Finish'),\n nextButtonText = __('Next'),\n previousButtonText = __('Previous'),\n onFinish,\n pages = []\n}) {\n const ref = useRef(null);\n const [currentPage, setCurrentPage] = useState(0);\n useEffect(() => {\n // Place focus at the top of the guide on mount and when the page changes.\n const frame = ref.current?.querySelector('.components-guide');\n if (frame instanceof HTMLElement) {\n frame.focus();\n }\n }, [currentPage]);\n useEffect(() => {\n if (Children.count(children)) {\n deprecated('Passing children to <Guide>', {\n since: '5.5',\n alternative: 'the `pages` prop'\n });\n }\n }, [children]);\n if (Children.count(children)) {\n pages = Children.map(children, child => ({\n content: child\n })) ?? [];\n }\n const canGoBack = currentPage > 0;\n const canGoForward = currentPage < pages.length - 1;\n const goBack = () => {\n if (canGoBack) {\n setCurrentPage(currentPage - 1);\n }\n };\n const goForward = () => {\n if (canGoForward) {\n setCurrentPage(currentPage + 1);\n }\n };\n if (pages.length === 0) {\n return null;\n }\n return /*#__PURE__*/_jsx(Modal, {\n className: clsx('components-guide', className),\n contentLabel: contentLabel,\n isDismissible: pages.length > 1,\n onRequestClose: onFinish,\n onKeyDown: event => {\n if (event.code === 'ArrowLeft') {\n goBack();\n // Do not scroll the modal's contents.\n event.preventDefault();\n } else if (event.code === 'ArrowRight') {\n goForward();\n // Do not scroll the modal's contents.\n event.preventDefault();\n }\n },\n ref: ref,\n children: /*#__PURE__*/_jsxs(\"div\", {\n className: \"components-guide__container\",\n children: [/*#__PURE__*/_jsxs(\"div\", {\n className: \"components-guide__page\",\n children: [pages[currentPage].image, pages.length > 1 && /*#__PURE__*/_jsx(PageControl, {\n currentPage: currentPage,\n numberOfPages: pages.length,\n setCurrentPage: setCurrentPage\n }), pages[currentPage].content]\n }), /*#__PURE__*/_jsxs(\"div\", {\n className: \"components-guide__footer\",\n children: [canGoBack && /*#__PURE__*/_jsx(Button, {\n className: \"components-guide__back-button\",\n variant: \"tertiary\",\n onClick: goBack,\n __next40pxDefaultSize: true,\n children: previousButtonText\n }), canGoForward && /*#__PURE__*/_jsx(Button, {\n className: \"components-guide__forward-button\",\n variant: \"primary\",\n onClick: goForward,\n __next40pxDefaultSize: true,\n children: nextButtonText\n }), !canGoForward && /*#__PURE__*/_jsx(Button, {\n className: \"components-guide__finish-button\",\n variant: \"primary\",\n onClick: onFinish,\n __next40pxDefaultSize: true,\n children: finishButtonText\n })]\n })]\n })\n });\n}\nexport default Guide;"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,qBAAsD;AACtD,wBAAuB;AACvB,kBAAmB;AAKnB,mBAAkB;AAClB,oBAAmB;AACnB,0BAAwB;AACxB,yBAA2C;AAiC3C,SAAS,MAAM;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA,uBAAmB,gBAAG,QAAQ;AAAA,EAC9B,qBAAiB,gBAAG,MAAM;AAAA,EAC1B,yBAAqB,gBAAG,UAAU;AAAA,EAClC;AAAA,EACA,QAAQ,CAAC;AACX,GAAG;AACD,QAAM,UAAM,uBAAO,IAAI;AACvB,QAAM,CAAC,aAAa,cAAc,QAAI,yBAAS,CAAC;AAChD,gCAAU,MAAM;AAEd,UAAM,QAAQ,IAAI,SAAS,cAAc,mBAAmB;AAC5D,QAAI,iBAAiB,aAAa;AAChC,YAAM,MAAM;AAAA,IACd;AAAA,EACF,GAAG,CAAC,WAAW,CAAC;AAChB,gCAAU,MAAM;AACd,QAAI,wBAAS,MAAM,QAAQ,GAAG;AAC5B,4BAAAA,SAAW,+BAA+B;AAAA,QACxC,OAAO;AAAA,QACP,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AACb,MAAI,wBAAS,MAAM,QAAQ,GAAG;AAC5B,YAAQ,wBAAS,IAAI,UAAU,YAAU;AAAA,MACvC,SAAS;AAAA,IACX,EAAE,KAAK,CAAC;AAAA,EACV;AACA,QAAM,YAAY,cAAc;AAChC,QAAM,eAAe,cAAc,MAAM,SAAS;AAClD,QAAM,SAAS,MAAM;AACnB,QAAI,WAAW;AACb,qBAAe,cAAc,CAAC;AAAA,IA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AAA,UAC7C,WAAW;AAAA,UACX,SAAS;AAAA,UACT,SAAS;AAAA,UACT,uBAAuB;AAAA,UACvB,UAAU;AAAA,QACZ,CAAC,CAAC;AAAA,MACJ,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA,EACH,CAAC;AACH;AACA,IAAO,gBAAQ;",
6
6
  "names": ["deprecated", "_jsx", "Modal", "clsx", "_jsxs", "PageControl", "Button"]
7
7
  }
@@ -51,8 +51,7 @@ function useNavigateRegions(shortcuts = defaultShortcuts) {
51
51
  const ref = (0, import_element.useRef)(null);
52
52
  const [isFocusingRegions, setIsFocusingRegions] = (0, import_element.useState)(false);
53
53
  function focusRegion(offset) {
54
- var _ref$current$querySel;
55
- const regions = Array.from((_ref$current$querySel = ref.current?.querySelectorAll('[role="region"][tabindex="-1"]')) !== null && _ref$current$querySel !== void 0 ? _ref$current$querySel : []);
54
+ const regions = Array.from(ref.current?.querySelectorAll('[role="region"][tabindex="-1"]') ?? []);
56
55
  if (!regions.length) {
57
56
  return;
58
57
  }
@@ -99,15 +98,17 @@ function useNavigateRegions(shortcuts = defaultShortcuts) {
99
98
  }
100
99
  };
101
100
  }
102
- var navigate_regions_default = (0, import_compose.createHigherOrderComponent)((Component) => ({
101
+ var navigate_regions_default = (0, import_compose.createHigherOrderComponent)((Component) => function NavigateRegions({
103
102
  shortcuts,
104
103
  ...props
105
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
106
- ...useNavigateRegions(shortcuts),
107
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
108
- ...props
109
- })
110
- }), "navigateRegions");
104
+ }) {
105
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
106
+ ...useNavigateRegions(shortcuts),
107
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {
108
+ ...props
109
+ })
110
+ });
111
+ }, "navigateRegions");
111
112
  // Annotate the CommonJS export names for ESM import in node:
112
113
  0 && (module.exports = {
113
114
  useNavigateRegions
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/higher-order/navigate-regions/index.tsx"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useState, useRef } from '@wordpress/element';\nimport { createHigherOrderComponent, useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { isKeyboardEvent } from '@wordpress/keycodes';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst defaultShortcuts = {\n previous: [{\n modifier: 'ctrlShift',\n character: '`'\n }, {\n modifier: 'ctrlShift',\n character: '~'\n }, {\n modifier: 'access',\n character: 'p'\n }],\n next: [{\n modifier: 'ctrl',\n character: '`'\n }, {\n modifier: 'access',\n character: 'n'\n }]\n};\nexport function useNavigateRegions(shortcuts = defaultShortcuts) {\n const ref = useRef(null);\n const [isFocusingRegions, setIsFocusingRegions] = useState(false);\n function focusRegion(offset) {\n var _ref$current$querySel;\n const regions = Array.from((_ref$current$querySel = ref.current?.querySelectorAll('[role=\"region\"][tabindex=\"-1\"]')) !== null && _ref$current$querySel !== void 0 ? _ref$current$querySel : []);\n if (!regions.length) {\n return;\n }\n let nextRegion = regions[0];\n // Based off the current element, use closest to determine the wrapping region since this operates up the DOM. Also, match tabindex to avoid edge cases with regions we do not want.\n const wrappingRegion = ref.current?.ownerDocument?.activeElement?.closest('[role=\"region\"][tabindex=\"-1\"]');\n const selectedIndex = wrappingRegion ? regions.indexOf(wrappingRegion) : -1;\n if (selectedIndex !== -1) {\n let nextIndex = selectedIndex + offset;\n nextIndex = nextIndex === -1 ? regions.length - 1 : nextIndex;\n nextIndex = nextIndex === regions.length ? 0 : nextIndex;\n nextRegion = regions[nextIndex];\n }\n nextRegion.focus();\n setIsFocusingRegions(true);\n }\n const clickRef = useRefEffect(element => {\n function onClick() {\n setIsFocusingRegions(false);\n }\n element.addEventListener('click', onClick);\n return () => {\n element.removeEventListener('click', onClick);\n };\n }, [setIsFocusingRegions]);\n return {\n ref: useMergeRefs([ref, clickRef]),\n className: isFocusingRegions ? 'is-focusing-regions' : '',\n onKeyDown(event) {\n if (shortcuts.previous.some(({\n modifier,\n character\n }) => {\n return isKeyboardEvent[modifier](event, character);\n })) {\n focusRegion(-1);\n } else if (shortcuts.next.some(({\n modifier,\n character\n }) => {\n return isKeyboardEvent[modifier](event, character);\n })) {\n focusRegion(1);\n }\n }\n };\n}\n\n/**\n * `navigateRegions` is a React [higher-order component](https://facebook.github.io/react/docs/higher-order-components.html)\n * adding keyboard navigation to switch between the different DOM elements marked as \"regions\" (role=\"region\").\n * These regions should be focusable (By adding a tabIndex attribute for example). For better accessibility,\n * these elements must be properly labelled to briefly describe the purpose of the content in the region.\n * For more details, see \"Landmark Roles\" in the [WAI-ARIA specification](https://www.w3.org/TR/wai-aria/)\n * and \"Landmark Regions\" in the [ARIA Authoring Practices Guide](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/).\n *\n * ```jsx\n * import { navigateRegions } from '@wordpress/components';\n *\n * const MyComponentWithNavigateRegions = navigateRegions( () => (\n * \t<div>\n * \t\t<div role=\"region\" tabIndex=\"-1\" aria-label=\"Header\">\n * \t\t\tHeader\n * \t\t</div>\n * \t\t<div role=\"region\" tabIndex=\"-1\" aria-label=\"Content\">\n * \t\t\tContent\n * \t\t</div>\n * \t\t<div role=\"region\" tabIndex=\"-1\" aria-label=\"Sidebar\">\n * \t\t\tSidebar\n * \t\t</div>\n * \t</div>\n * ) );\n * ```\n */\nexport default createHigherOrderComponent(Component => ({\n shortcuts,\n ...props\n}) => /*#__PURE__*/_jsx(\"div\", {\n ...useNavigateRegions(shortcuts),\n children: /*#__PURE__*/_jsx(Component, {\n ...props\n })\n}), 'navigateRegions');"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAiC;AACjC,qBAAuE;AACvE,sBAAgC;AAChC,yBAA4B;AAC5B,IAAM,mBAAmB;AAAA,EACvB,UAAU,CAAC;AAAA,IACT,UA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AQ,CAAC;AAAA,IACjC,WAAW,oBAAoB,wBAAwB;AAAA,IACvD,UAAU,OAAO;AACf,UAAI,UAAU,SAAS,KAAK,CAAC;AAAA,QAC3B;AAAA,QACA;AAAA,MACF,MAAM;AACJ,eAAO,gCAAgB,QAAQ,EAAE,OAAO,SAAS;AAAA,MACnD,CAAC,GAAG;AACF,oBAAY,EAAE;AAAA,MAChB,WAAW,UAAU,KAAK,KAAK,CAAC;AAAA,QAC9B;AAAA,QACA;AAAA,MACF,MAAM;AACJ,eAAO,gCAAgB,QAAQ,EAAE,OAAO,SAAS;AAAA,MACnD,CAAC,GAAG;AACF,oBAAY,CAAC;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;AA4BA,IAAO,+BAAQ,2CAA2B,eAAa,CAAC;AAAA,EACtD;AAAA,EACA,GAAG;AACL,MAAmB,uCAAAA,KAAK,OAAO;AAAA,EAC7B,GAAG,mBAAmB,SAAS;AAAA,EAC/B,UAAuB,uCAAAA,KAAK,WAAW;AAAA,IACrC,GAAG;AAAA,EACL,CAAC;AACH,CAAC,GAAG,iBAAiB;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useState, useRef } from '@wordpress/element';\nimport { createHigherOrderComponent, useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { isKeyboardEvent } from '@wordpress/keycodes';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst defaultShortcuts = {\n previous: [{\n modifier: 'ctrlShift',\n character: '`'\n }, {\n modifier: 'ctrlShift',\n character: '~'\n }, {\n modifier: 'access',\n character: 'p'\n }],\n next: [{\n modifier: 'ctrl',\n character: '`'\n }, {\n modifier: 'access',\n character: 'n'\n }]\n};\nexport function useNavigateRegions(shortcuts = defaultShortcuts) {\n const ref = useRef(null);\n const [isFocusingRegions, setIsFocusingRegions] = useState(false);\n function focusRegion(offset) {\n const regions = Array.from(ref.current?.querySelectorAll('[role=\"region\"][tabindex=\"-1\"]') ?? []);\n if (!regions.length) {\n return;\n }\n let nextRegion = regions[0];\n // Based off the current element, use closest to determine the wrapping region since this operates up the DOM. Also, match tabindex to avoid edge cases with regions we do not want.\n const wrappingRegion = ref.current?.ownerDocument?.activeElement?.closest('[role=\"region\"][tabindex=\"-1\"]');\n const selectedIndex = wrappingRegion ? regions.indexOf(wrappingRegion) : -1;\n if (selectedIndex !== -1) {\n let nextIndex = selectedIndex + offset;\n nextIndex = nextIndex === -1 ? regions.length - 1 : nextIndex;\n nextIndex = nextIndex === regions.length ? 0 : nextIndex;\n nextRegion = regions[nextIndex];\n }\n nextRegion.focus();\n setIsFocusingRegions(true);\n }\n const clickRef = useRefEffect(element => {\n function onClick() {\n setIsFocusingRegions(false);\n }\n element.addEventListener('click', onClick);\n return () => {\n element.removeEventListener('click', onClick);\n };\n }, [setIsFocusingRegions]);\n return {\n ref: useMergeRefs([ref, clickRef]),\n className: isFocusingRegions ? 'is-focusing-regions' : '',\n onKeyDown(event) {\n if (shortcuts.previous.some(({\n modifier,\n character\n }) => {\n return isKeyboardEvent[modifier](event, character);\n })) {\n focusRegion(-1);\n } else if (shortcuts.next.some(({\n modifier,\n character\n }) => {\n return isKeyboardEvent[modifier](event, character);\n })) {\n focusRegion(1);\n }\n }\n };\n}\n\n/**\n * `navigateRegions` is a React [higher-order component](https://facebook.github.io/react/docs/higher-order-components.html)\n * adding keyboard navigation to switch between the different DOM elements marked as \"regions\" (role=\"region\").\n * These regions should be focusable (By adding a tabIndex attribute for example). For better accessibility,\n * these elements must be properly labelled to briefly describe the purpose of the content in the region.\n * For more details, see \"Landmark Roles\" in the [WAI-ARIA specification](https://www.w3.org/TR/wai-aria/)\n * and \"Landmark Regions\" in the [ARIA Authoring Practices Guide](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/).\n *\n * ```jsx\n * import { navigateRegions } from '@wordpress/components';\n *\n * const MyComponentWithNavigateRegions = navigateRegions( () => (\n * \t<div>\n * \t\t<div role=\"region\" tabIndex=\"-1\" aria-label=\"Header\">\n * \t\t\tHeader\n * \t\t</div>\n * \t\t<div role=\"region\" tabIndex=\"-1\" aria-label=\"Content\">\n * \t\t\tContent\n * \t\t</div>\n * \t\t<div role=\"region\" tabIndex=\"-1\" aria-label=\"Sidebar\">\n * \t\t\tSidebar\n * \t\t</div>\n * \t</div>\n * ) );\n * ```\n */\nexport default createHigherOrderComponent(Component => function NavigateRegions({\n shortcuts,\n ...props\n}) {\n return /*#__PURE__*/_jsx(\"div\", {\n ...useNavigateRegions(shortcuts),\n children: /*#__PURE__*/_jsx(Component, {\n ...props\n })\n });\n}, 'navigateRegions');"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAiC;AACjC,qBAAuE;AACvE,sBAAgC;AAChC,yBAA4B;AAC5B,IAAM,mBAAmB;AAAA,EACvB,UAAU,CAAC;AAAA,IACT,UAAU;AAAA,IACV,WAAW;AAAA,EACb,GAAG;AAAA,IACD,UAAU;AAAA,IACV,WAAW;AAAA,EACb,GAAG;AAAA,IACD,UAAU;AAAA,IACV,WAAW;AAAA,EACb,CAAC;AAAA,EACD,MAAM,CAAC;AAAA,IACL,UAAU;AAAA,IACV,WAAW;AAAA,EACb,GAAG;AAAA,IACD,UAAU;AAAA,IACV,WAAW;AAAA,EACb,CAAC;AACH;AACO,SAAS,mBAAmB,YAAY,kBAAkB;AAC/D,QAAM,UAAM,uBAAO,IAAI;AACvB,QAAM,CAAC,mBAAmB,oBAAoB,QAAI,yBAAS,KAAK;AAChE,WAAS,YAAY,QAAQ;AAC3B,UAAM,UAAU,MAAM,KAAK,IAAI,SAAS,iBAAiB,gCAAgC,KAAK,CAAC,CAAC;AAChG,QAAI,CAAC,QAAQ,QAAQ;AACnB;AAAA,IACF;AACA,QAAI,aAAa,QAAQ,CAAC;AAE1B,UAAM,iBAAiB,IAAI,SAAS,eAAe,eAAe,QAAQ,gCAAgC;AAC1G,UAAM,gBAAgB,iBAAiB,QAAQ,QAAQ,cAAc,I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
7
  }
@@ -38,7 +38,7 @@ var import_element = require("@wordpress/element");
38
38
  var import_compose = require("@wordpress/compose");
39
39
  var import_jsx_runtime = require("react/jsx-runtime");
40
40
  var with_fallback_styles_default = (mapNodeToProps) => (0, import_compose.createHigherOrderComponent)((WrappedComponent) => {
41
- return class extends import_element.Component {
41
+ return class WithFallbackStyles extends import_element.Component {
42
42
  constructor(props) {
43
43
  super(props);
44
44
  this.nodeRef = this.props.node;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/higher-order/with-fallback-styles/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default mapNodeToProps => createHigherOrderComponent(WrappedComponent => {\n return class extends Component {\n constructor(props) {\n super(props);\n this.nodeRef = this.props.node;\n this.state = {\n fallbackStyles: undefined,\n grabStylesCompleted: false\n };\n this.bindRef = this.bindRef.bind(this);\n }\n bindRef(node) {\n if (!node) {\n return;\n }\n this.nodeRef = node;\n }\n componentDidMount() {\n this.grabFallbackStyles();\n }\n componentDidUpdate() {\n this.grabFallbackStyles();\n }\n grabFallbackStyles() {\n const {\n grabStylesCompleted,\n fallbackStyles\n } = this.state;\n if (this.nodeRef && !grabStylesCompleted) {\n const newFallbackStyles = mapNodeToProps(this.nodeRef, this.props);\n if (!fastDeepEqual(newFallbackStyles, fallbackStyles)) {\n this.setState({\n fallbackStyles: newFallbackStyles,\n grabStylesCompleted: Object.values(newFallbackStyles).every(Boolean)\n });\n }\n }\n }\n render() {\n const wrappedComponent = /*#__PURE__*/_jsx(WrappedComponent, {\n ...this.props,\n ...this.state.fallbackStyles\n });\n return this.props.node ? wrappedComponent : /*#__PURE__*/_jsxs(\"div\", {\n ref: this.bindRef,\n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AAK,KAAK;AAAA,QACV,UAAU,CAAC,KAAK,kBAAkB,GAAG;AAAA,MACvC,CAAC;AAAA,IACH;AAAA,EACF;AACF,GAAG,oBAAoB;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport fastDeepEqual from 'fast-deep-equal/es6/index.js';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default mapNodeToProps => createHigherOrderComponent(WrappedComponent => {\n return class WithFallbackStyles extends Component {\n constructor(props) {\n super(props);\n this.nodeRef = this.props.node;\n this.state = {\n fallbackStyles: undefined,\n grabStylesCompleted: false\n };\n this.bindRef = this.bindRef.bind(this);\n }\n bindRef(node) {\n if (!node) {\n return;\n }\n this.nodeRef = node;\n }\n componentDidMount() {\n this.grabFallbackStyles();\n }\n componentDidUpdate() {\n this.grabFallbackStyles();\n }\n grabFallbackStyles() {\n const {\n grabStylesCompleted,\n fallbackStyles\n } = this.state;\n if (this.nodeRef && !grabStylesCompleted) {\n const newFallbackStyles = mapNodeToProps(this.nodeRef, this.props);\n if (!fastDeepEqual(newFallbackStyles, fallbackStyles)) {\n this.setState({\n fallbackStyles: newFallbackStyles,\n grabStylesCompleted: Object.values(newFallbackStyles).every(Boolean)\n });\n }\n }\n }\n render() {\n const wrappedComponent = /*#__PURE__*/_jsx(WrappedComponent, {\n ...this.props,\n ...this.state.fallbackStyles\n });\n return this.props.node ? wrappedComponent : /*#__PURE__*/_jsxs(\"div\", {\n ref: this.bindRef,\n children: [\" \", wrappedComponent, \" \"]\n });\n }\n };\n}, 'withFallbackStyles');"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iBAA0B;AAK1B,qBAA0B;AAC1B,qBAA2C;AAC3C,yBAA2C;AAC3C,IAAO,+BAAQ,wBAAkB,2CAA2B,sBAAoB;AAC9E,SAAO,MAAM,2BAA2B,yBAAU;AAAA,IAChD,YAAY,OAAO;AACjB,YAAM,KAAK;AACX,WAAK,UAAU,KAAK,MAAM;AAC1B,WAAK,QAAQ;AAAA,QACX,gBAAgB;AAAA,QAChB,qBAAqB;AAAA,MACvB;AACA,WAAK,UAAU,KAAK,QAAQ,KAAK,IAAI;AAAA,IACvC;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,CAAC,MAAM;AACT;AAAA,MACF;AACA,WAAK,UAAU;AAAA,IACjB;AAAA,IACA,oBAAoB;AAClB,WAAK,mBAAmB;AAAA,IAC1B;AAAA,IACA,qBAAqB;AACnB,WAAK,mBAAmB;AAAA,IAC1B;AAAA,IACA,qBAAqB;AACnB,YAAM;AAAA,QACJ;AAAA,QACA;AAAA,MACF,IAAI,KAAK;AACT,UAAI,KAAK,WAAW,CAAC,qBAAqB;AACxC,cAAM,oBAAoB,eAAe,KAAK,SAAS,KAAK,KAAK;AACjE,YAAI,KAAC,WAAAA,SAAc,mBAAmB,cAAc,GAAG;AACrD,eAAK,SAAS;AAAA,YACZ,gBAAgB;AAAA,YAChB,qBAAqB,OAAO,OAAO,iBAAiB,EAAE,MAAM,OAAO;AAAA,UACrE,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,IACA,SAAS;AACP,YAAM,mBAAgC,uCAAAC,KAAK,kBAAkB;AAAA,QAC3D,GAAG,KAAK;AAAA,QACR,GAAG,KAAK,MAAM;AAAA,MAChB,CAAC;AACD,aAAO,KAAK,MAAM,OAAO,mBAAgC,uCAAAC,MAAM,OAAO;AAAA,QACpE,KAAK,KAAK;AAAA,QACV,UAAU,CAAC,KAAK,kBAAkB,GAAG;AAAA,MACvC,CAAC;AAAA,IACH;AAAA,EACF;AACF,GAAG,oBAAoB;",
6
6
  "names": ["fastDeepEqual", "_jsx", "_jsxs"]
7
7
  }
@@ -26,7 +26,7 @@ module.exports = __toCommonJS(with_focus_outside_exports);
26
26
  var import_element = require("@wordpress/element");
27
27
  var import_compose = require("@wordpress/compose");
28
28
  var import_jsx_runtime = require("react/jsx-runtime");
29
- var with_focus_outside_default = (0, import_compose.createHigherOrderComponent)((WrappedComponent) => (props) => {
29
+ var with_focus_outside_default = (0, import_compose.createHigherOrderComponent)((WrappedComponent) => function WithFocusOutside(props) {
30
30
  const [handleFocusOutside, setHandleFocusOutside] = (0, import_element.useState)(void 0);
31
31
  const bindFocusOutsideHandler = (0, import_element.useCallback)((node) => setHandleFocusOutside(() => node?.handleFocusOutside ? node.handleFocusOutside.bind(node) : void 0), []);
32
32
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {