@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
@@ -61,7 +61,7 @@ function UnforwardedNumberControl(props, forwardedRef) {
61
61
  const baseSpin = ensureNumber(spinFactor) * baseStep;
62
62
  const constrainValue = (value, stepOverride) => {
63
63
  if (!isStepAny) {
64
- value = ensureValidStep(value, min, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep);
64
+ value = ensureValidStep(value, min, stepOverride ?? baseStep);
65
65
  }
66
66
  return `${clamp(value, min, max)}`;
67
67
  };
@@ -163,9 +163,8 @@ function UnforwardedNumberControl(props, forwardedRef) {
163
163
  type: typeProp,
164
164
  value: valueProp,
165
165
  __unstableStateReducer: (state, action) => {
166
- var _stateReducerProp;
167
166
  const baseState = numberControlStateReducer(state, action);
168
- return (_stateReducerProp = stateReducerProp?.(baseState, action)) !== null && _stateReducerProp !== void 0 ? _stateReducerProp : baseState;
167
+ return stateReducerProp?.(baseState, action) ?? baseState;
169
168
  },
170
169
  size,
171
170
  __shouldNotWarnDeprecated36pxSize: true,
@@ -195,6 +194,7 @@ function UnforwardedNumberControl(props, forwardedRef) {
195
194
  });
196
195
  }
197
196
  var NumberControl = forwardRef(UnforwardedNumberControl);
197
+ NumberControl.displayName = "NumberControl";
198
198
  var number_control_default = NumberControl;
199
199
  export {
200
200
  NumberControl,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/number-control/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { plus as plusIcon, reset as resetIcon } from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Input, SpinButton, styles } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, clamp, ensureValidStep } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\nimport { useCx } from '../utils';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nconst noop = () => {};\nfunction UnforwardedNumberControl(props, forwardedRef) {\n const {\n __unstableStateReducer: stateReducerProp,\n className,\n dragDirection = 'n',\n hideHTMLArrows = false,\n spinControls = hideHTMLArrows ? 'none' : 'native',\n isDragEnabled = true,\n isShiftStepEnabled = true,\n label,\n max = Infinity,\n min = -Infinity,\n required = false,\n shiftStep = 10,\n step = 1,\n spinFactor = 1,\n type: typeProp = 'number',\n value: valueProp,\n size = 'default',\n suffix,\n onChange = noop,\n __shouldNotWarnDeprecated36pxSize,\n ...restProps\n } = useDeprecated36pxDefaultSizeProp(props);\n maybeWarnDeprecated36pxSize({\n componentName: 'NumberControl',\n size,\n __next40pxDefaultSize: restProps.__next40pxDefaultSize,\n __shouldNotWarnDeprecated36pxSize\n });\n if (hideHTMLArrows) {\n deprecated('wp.components.NumberControl hideHTMLArrows prop ', {\n alternative: 'spinControls=\"none\"',\n since: '6.2',\n version: '6.3'\n });\n }\n const inputRef = useRef();\n const mergedRef = useMergeRefs([inputRef, forwardedRef]);\n const isStepAny = step === 'any';\n const baseStep = isStepAny ? 1 : ensureNumber(step);\n const baseSpin = ensureNumber(spinFactor) * baseStep;\n const constrainValue = (value, stepOverride) => {\n // When step is not \"any\" the value must be a valid step.\n if (!isStepAny) {\n value = ensureValidStep(value, min, stepOverride !== null && stepOverride !== void 0 ? stepOverride : baseStep);\n }\n return `${clamp(value, min, max)}`;\n };\n const baseValue = constrainValue(0);\n const autoComplete = typeProp === 'number' ? 'off' : undefined;\n const classes = clsx('components-number-control', className);\n const cx = useCx();\n const spinButtonClasses = cx(size === 'small' && styles.smallSpinButtons);\n const spinValue = (value, direction, event) => {\n event?.preventDefault();\n const shift = event?.shiftKey && isShiftStepEnabled;\n const delta = shift ? ensureNumber(shiftStep) * baseSpin : baseSpin;\n let nextValue = isValueEmpty(value) ? baseValue : value;\n if (direction === 'up') {\n nextValue = add(nextValue, delta);\n } else if (direction === 'down') {\n nextValue = subtract(nextValue, delta);\n }\n return constrainValue(nextValue, shift ? delta : undefined);\n };\n\n /**\n * \"Middleware\" function that intercepts updates from InputControl.\n * This allows us to tap into actions to transform the (next) state for\n * InputControl.\n *\n * @return The updated state to apply to InputControl\n */\n const numberControlStateReducer = (state, action) => {\n const nextState = {\n ...state\n };\n const {\n type,\n payload\n } = action;\n const event = payload.event;\n const currentValue = nextState.value;\n\n /**\n * Handles custom UP and DOWN Keyboard events\n */\n if (type === inputControlActionTypes.PRESS_UP || type === inputControlActionTypes.PRESS_DOWN) {\n nextState.value = spinValue(currentValue, type === inputControlActionTypes.PRESS_UP ? 'up' : 'down', event);\n }\n\n /**\n * Handles drag to update events\n */\n if (type === inputControlActionTypes.DRAG && isDragEnabled) {\n const [x, y] = payload.delta;\n const enableShift = payload.shiftKey && isShiftStepEnabled;\n const modifier = enableShift ? ensureNumber(shiftStep) * baseSpin : baseSpin;\n let directionModifier;\n let delta;\n switch (dragDirection) {\n case 'n':\n delta = y;\n directionModifier = -1;\n break;\n case 'e':\n delta = x;\n directionModifier = isRTL() ? -1 : 1;\n break;\n case 's':\n delta = y;\n directionModifier = 1;\n break;\n case 'w':\n delta = x;\n directionModifier = isRTL() ? 1 : -1;\n break;\n }\n if (delta !== 0) {\n delta = Math.ceil(Math.abs(delta)) * Math.sign(delta);\n const distance = delta * modifier * directionModifier;\n nextState.value = constrainValue(\n // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n add(currentValue, distance), enableShift ? modifier : undefined);\n }\n }\n\n /**\n * Handles commit (ENTER key press or blur)\n */\n if (type === inputControlActionTypes.PRESS_ENTER || type === inputControlActionTypes.COMMIT) {\n const applyEmptyValue = required === false && currentValue === '';\n nextState.value = applyEmptyValue ? currentValue :\n // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n constrainValue(currentValue);\n }\n return nextState;\n };\n const buildSpinButtonClickHandler = direction => event => onChange(String(spinValue(valueProp, direction, event)), {\n // Set event.target to the <input> so that consumers can use\n // e.g. event.target.validity.\n event: {\n ...event,\n target: inputRef.current\n }\n });\n return /*#__PURE__*/_jsx(Input, {\n autoComplete: autoComplete,\n inputMode: \"numeric\",\n ...restProps,\n className: classes,\n dragDirection: dragDirection,\n hideHTMLArrows: spinControls !== 'native',\n isDragEnabled: isDragEnabled,\n label: label,\n max: max === Infinity ? undefined : max,\n min: min === -Infinity ? undefined : min,\n ref: mergedRef,\n required: required,\n step: step,\n type: typeProp\n // @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n ,\n value: valueProp,\n __unstableStateReducer: (state, action) => {\n var _stateReducerProp;\n const baseState = numberControlStateReducer(state, action);\n return (_stateReducerProp = stateReducerProp?.(baseState, action)) !== null && _stateReducerProp !== void 0 ? _stateReducerProp : baseState;\n },\n size: size,\n __shouldNotWarnDeprecated36pxSize: true,\n suffix: spinControls === 'custom' ? /*#__PURE__*/_jsxs(_Fragment, {\n children: [suffix, /*#__PURE__*/_jsx(Spacer, {\n marginBottom: 0,\n marginRight: 2,\n children: /*#__PURE__*/_jsxs(HStack, {\n spacing: 1,\n children: [/*#__PURE__*/_jsx(SpinButton, {\n className: spinButtonClasses,\n icon: plusIcon,\n size: \"small\",\n label: __('Increment'),\n onClick: buildSpinButtonClickHandler('up')\n }), /*#__PURE__*/_jsx(SpinButton, {\n className: spinButtonClasses,\n icon: resetIcon,\n size: \"small\",\n label: __('Decrement'),\n onClick: buildSpinButtonClickHandler('down')\n })]\n })\n })]\n }) : suffix,\n onChange: onChange\n });\n}\nexport const NumberControl = forwardRef(UnforwardedNumberControl);\nexport default NumberControl;"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAIjB,SAAS,QAAQ,kBAAkB;AACnC,SAAS,OAAO,UAAU;AAC1B,SAAS,QAAQ,UAAU,SAAS,iBAAiB;AACrD,SAAS,oBAAoB;AAC7B,OA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B,mBAAmB,WAAW,MAAM,OAAO,QAAQ,sBAAsB,SAAS,oBAAoB;AAAA,IACpI;AAAA,IACA;AAAA,IACA,mCAAmC;AAAA,IACnC,QAAQ,iBAAiB,WAAwB,sBAAM,WAAW;AAAA,MAChE,UAAU,CAAC,QAAqB,qBAAK,QAAQ;AAAA,QAC3C,cAAc;AAAA,QACd,aAAa;AAAA,QACb,UAAuB,sBAAM,QAAQ;AAAA,UACnC,SAAS;AAAA,UACT,UAAU,CAAc,qBAAK,YAAY;AAAA,YACvC,WAAW;AAAA,YACX,MAAM;AAAA,YACN,MAAM;AAAA,YACN,OAAO,GAAG,WAAW;AAAA,YACrB,SAAS,4BAA4B,IAAI;AAAA,UAC3C,CAAC,GAAgB,qBAAK,YAAY;AAAA,YAChC,WAAW;AAAA,YACX,MAAM;AAAA,YACN,MAAM;AAAA,YACN,OAAO,GAAG,WAAW;AAAA,YACrB,SAAS,4BAA4B,MAAM;AAAA,UAC7C,CAAC,CAAC;AAAA,QACJ,CAAC;AAAA,MACH,CAAC,CAAC;AAAA,IACJ,CAAC,IAAI;AAAA,IACL;AAAA,EACF,CAAC;AACH;AACO,IAAM,gBAAgB,WAAW,wBAAwB;AAChE,IAAO,yBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { useRef, forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { plus as plusIcon, reset as resetIcon } from '@wordpress/icons';\nimport { useMergeRefs } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { Input, SpinButton, styles } from './styles/number-control-styles';\nimport * as inputControlActionTypes from '../input-control/reducer/actions';\nimport { add, subtract, clamp, ensureValidStep } from '../utils/math';\nimport { ensureNumber, isValueEmpty } from '../utils/values';\nimport { HStack } from '../h-stack';\nimport { Spacer } from '../spacer';\nimport { useCx } from '../utils';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nconst noop = () => {};\nfunction UnforwardedNumberControl(props, forwardedRef) {\n const {\n __unstableStateReducer: stateReducerProp,\n className,\n dragDirection = 'n',\n hideHTMLArrows = false,\n spinControls = hideHTMLArrows ? 'none' : 'native',\n isDragEnabled = true,\n isShiftStepEnabled = true,\n label,\n max = Infinity,\n min = -Infinity,\n required = false,\n shiftStep = 10,\n step = 1,\n spinFactor = 1,\n type: typeProp = 'number',\n value: valueProp,\n size = 'default',\n suffix,\n onChange = noop,\n __shouldNotWarnDeprecated36pxSize,\n ...restProps\n } = useDeprecated36pxDefaultSizeProp(props);\n maybeWarnDeprecated36pxSize({\n componentName: 'NumberControl',\n size,\n __next40pxDefaultSize: restProps.__next40pxDefaultSize,\n __shouldNotWarnDeprecated36pxSize\n });\n if (hideHTMLArrows) {\n deprecated('wp.components.NumberControl hideHTMLArrows prop ', {\n alternative: 'spinControls=\"none\"',\n since: '6.2',\n version: '6.3'\n });\n }\n const inputRef = useRef();\n const mergedRef = useMergeRefs([inputRef, forwardedRef]);\n const isStepAny = step === 'any';\n const baseStep = isStepAny ? 1 : ensureNumber(step);\n const baseSpin = ensureNumber(spinFactor) * baseStep;\n const constrainValue = (value, stepOverride) => {\n // When step is not \"any\" the value must be a valid step.\n if (!isStepAny) {\n value = ensureValidStep(value, min, stepOverride ?? baseStep);\n }\n return `${clamp(value, min, max)}`;\n };\n const baseValue = constrainValue(0);\n const autoComplete = typeProp === 'number' ? 'off' : undefined;\n const classes = clsx('components-number-control', className);\n const cx = useCx();\n const spinButtonClasses = cx(size === 'small' && styles.smallSpinButtons);\n const spinValue = (value, direction, event) => {\n event?.preventDefault();\n const shift = event?.shiftKey && isShiftStepEnabled;\n const delta = shift ? ensureNumber(shiftStep) * baseSpin : baseSpin;\n let nextValue = isValueEmpty(value) ? baseValue : value;\n if (direction === 'up') {\n nextValue = add(nextValue, delta);\n } else if (direction === 'down') {\n nextValue = subtract(nextValue, delta);\n }\n return constrainValue(nextValue, shift ? delta : undefined);\n };\n\n /**\n * \"Middleware\" function that intercepts updates from InputControl.\n * This allows us to tap into actions to transform the (next) state for\n * InputControl.\n *\n * @return The updated state to apply to InputControl\n */\n const numberControlStateReducer = (state, action) => {\n const nextState = {\n ...state\n };\n const {\n type,\n payload\n } = action;\n const event = payload.event;\n const currentValue = nextState.value;\n\n /**\n * Handles custom UP and DOWN Keyboard events\n */\n if (type === inputControlActionTypes.PRESS_UP || type === inputControlActionTypes.PRESS_DOWN) {\n nextState.value = spinValue(currentValue, type === inputControlActionTypes.PRESS_UP ? 'up' : 'down', event);\n }\n\n /**\n * Handles drag to update events\n */\n if (type === inputControlActionTypes.DRAG && isDragEnabled) {\n const [x, y] = payload.delta;\n const enableShift = payload.shiftKey && isShiftStepEnabled;\n const modifier = enableShift ? ensureNumber(shiftStep) * baseSpin : baseSpin;\n let directionModifier;\n let delta;\n switch (dragDirection) {\n case 'n':\n delta = y;\n directionModifier = -1;\n break;\n case 'e':\n delta = x;\n directionModifier = isRTL() ? -1 : 1;\n break;\n case 's':\n delta = y;\n directionModifier = 1;\n break;\n case 'w':\n delta = x;\n directionModifier = isRTL() ? 1 : -1;\n break;\n }\n if (delta !== 0) {\n delta = Math.ceil(Math.abs(delta)) * Math.sign(delta);\n const distance = delta * modifier * directionModifier;\n nextState.value = constrainValue(\n // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n add(currentValue, distance), enableShift ? modifier : undefined);\n }\n }\n\n /**\n * Handles commit (ENTER key press or blur)\n */\n if (type === inputControlActionTypes.PRESS_ENTER || type === inputControlActionTypes.COMMIT) {\n const applyEmptyValue = required === false && currentValue === '';\n nextState.value = applyEmptyValue ? currentValue :\n // @ts-expect-error TODO: Investigate if it's ok for currentValue to be undefined\n constrainValue(currentValue);\n }\n return nextState;\n };\n const buildSpinButtonClickHandler = direction => event => onChange(String(spinValue(valueProp, direction, event)), {\n // Set event.target to the <input> so that consumers can use\n // e.g. event.target.validity.\n event: {\n ...event,\n target: inputRef.current\n }\n });\n return /*#__PURE__*/_jsx(Input, {\n autoComplete: autoComplete,\n inputMode: \"numeric\",\n ...restProps,\n className: classes,\n dragDirection: dragDirection,\n hideHTMLArrows: spinControls !== 'native',\n isDragEnabled: isDragEnabled,\n label: label,\n max: max === Infinity ? undefined : max,\n min: min === -Infinity ? undefined : min,\n ref: mergedRef,\n required: required,\n step: step,\n type: typeProp\n // @ts-expect-error TODO: Resolve discrepancy between `value` types in InputControl based components\n ,\n value: valueProp,\n __unstableStateReducer: (state, action) => {\n const baseState = numberControlStateReducer(state, action);\n return stateReducerProp?.(baseState, action) ?? baseState;\n },\n size: size,\n __shouldNotWarnDeprecated36pxSize: true,\n suffix: spinControls === 'custom' ? /*#__PURE__*/_jsxs(_Fragment, {\n children: [suffix, /*#__PURE__*/_jsx(Spacer, {\n marginBottom: 0,\n marginRight: 2,\n children: /*#__PURE__*/_jsxs(HStack, {\n spacing: 1,\n children: [/*#__PURE__*/_jsx(SpinButton, {\n className: spinButtonClasses,\n icon: plusIcon,\n size: \"small\",\n label: __('Increment'),\n onClick: buildSpinButtonClickHandler('up')\n }), /*#__PURE__*/_jsx(SpinButton, {\n className: spinButtonClasses,\n icon: resetIcon,\n size: \"small\",\n label: __('Decrement'),\n onClick: buildSpinButtonClickHandler('down')\n })]\n })\n })]\n }) : suffix,\n onChange: onChange\n });\n}\nexport const NumberControl = forwardRef(UnforwardedNumberControl);\nNumberControl.displayName = 'NumberControl';\nexport default NumberControl;"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAIjB,SAAS,QAAQ,kBAAkB;AACnC,SAAS,OAAO,UAAU;AAC1B,SAAS,QAAQ,UAAU,SAAS,iBAAiB;AACrD,SAAS,oBAAoB;AAC7B,OAAO,gBAAgB;AAKvB,SAAS,OAAO,YAAY,cAAc;AAC1C,Y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AAwB,sBAAM,WAAW;AAAA,MAChE,UAAU,CAAC,QAAqB,qBAAK,QAAQ;AAAA,QAC3C,cAAc;AAAA,QACd,aAAa;AAAA,QACb,UAAuB,sBAAM,QAAQ;AAAA,UACnC,SAAS;AAAA,UACT,UAAU,CAAc,qBAAK,YAAY;AAAA,YACvC,WAAW;AAAA,YACX,MAAM;AAAA,YACN,MAAM;AAAA,YACN,OAAO,GAAG,WAAW;AAAA,YACrB,SAAS,4BAA4B,IAAI;AAAA,UAC3C,CAAC,GAAgB,qBAAK,YAAY;AAAA,YAChC,WAAW;AAAA,YACX,MAAM;AAAA,YACN,MAAM;AAAA,YACN,OAAO,GAAG,WAAW;AAAA,YACrB,SAAS,4BAA4B,MAAM;AAAA,UAC7C,CAAC,CAAC;AAAA,QACJ,CAAC;AAAA,MACH,CAAC,CAAC;AAAA,IACJ,CAAC,IAAI;AAAA,IACL;AAAA,EACF,CAAC;AACH;AACO,IAAM,gBAAgB,WAAW,wBAAwB;AAChE,cAAc,cAAc;AAC5B,IAAO,yBAAQ;",
6
6
  "names": []
7
7
  }
@@ -37,7 +37,6 @@ function NameInput({
37
37
  function deduplicateElementSlugs(elements) {
38
38
  const slugCounts = {};
39
39
  return elements.map((element) => {
40
- var _newSlug;
41
40
  let newSlug;
42
41
  const {
43
42
  slug
@@ -48,7 +47,7 @@ function deduplicateElementSlugs(elements) {
48
47
  }
49
48
  return {
50
49
  ...element,
51
- slug: (_newSlug = newSlug) !== null && _newSlug !== void 0 ? _newSlug : slug
50
+ slug: newSlug ?? slug
52
51
  };
53
52
  });
54
53
  }
@@ -166,7 +165,7 @@ function Option({
166
165
  onChange: (nextName) => onChange({
167
166
  ...element,
168
167
  name: nextName,
169
- slug: slugPrefix + kebabCase(nextName !== null && nextName !== void 0 ? nextName : "")
168
+ slug: slugPrefix + kebabCase(nextName ?? "")
170
169
  })
171
170
  }) : /* @__PURE__ */ _jsx(NameContainer, {
172
171
  children: element.name.trim().length ? element.name : (
@@ -383,7 +382,7 @@ function PaletteEdit({
383
382
  })
384
383
  );
385
384
  },
386
- element: elements[editingElement !== null && editingElement !== void 0 ? editingElement : -1],
385
+ element: elements[editingElement ?? -1],
387
386
  popoverProps
388
387
  }), !isEditing && (isGradient ? /* @__PURE__ */ _jsx(GradientPicker, {
389
388
  gradients,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/palette-edit/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect, useCallback, useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { lineSolid, moreVertical, plus } from '@wordpress/icons';\nimport { useDebounce } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { ColorPicker } from '../color-picker';\nimport { FlexBlock, FlexItem } from '../flex';\nimport { HStack } from '../h-stack';\nimport { Item, ItemGroup } from '../item-group';\nimport { VStack } from '../v-stack';\nimport GradientPicker from '../gradient-picker';\nimport ColorPalette from '../color-palette';\nimport DropdownMenu from '../dropdown-menu';\nimport Popover from '../popover';\nimport { PaletteActionsContainer, PaletteEditStyles, PaletteHeading, IndicatorStyled, NameContainer, NameInputControl, DoneButton, RemoveButton, PaletteEditContents } from './styles';\nimport { NavigableMenu } from '../navigable-container';\nimport { DEFAULT_GRADIENT } from '../custom-gradient-picker/constants';\nimport CustomGradientPicker from '../custom-gradient-picker';\nimport { kebabCase } from '../utils/strings';\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nconst DEFAULT_COLOR = '#000';\nfunction NameInput({\n value,\n onChange,\n label\n}) {\n return /*#__PURE__*/_jsx(NameInputControl, {\n size: \"compact\",\n label: label,\n hideLabelFromVision: true,\n value: value,\n onChange: onChange\n });\n}\n\n/*\n * Deduplicates the slugs of the provided elements.\n */\nexport function deduplicateElementSlugs(elements) {\n const slugCounts = {};\n return elements.map(element => {\n var _newSlug;\n let newSlug;\n const {\n slug\n } = element;\n slugCounts[slug] = (slugCounts[slug] || 0) + 1;\n if (slugCounts[slug] > 1) {\n newSlug = `${slug}-${slugCounts[slug] - 1}`;\n }\n return {\n ...element,\n slug: (_newSlug = newSlug) !== null && _newSlug !== void 0 ? _newSlug : slug\n };\n });\n}\n\n/**\n * Returns a name and slug for a palette item. The name takes the format \"Color + id\".\n * To ensure there are no duplicate ids, this function checks all slugs.\n * It expects slugs to be in the format: slugPrefix + color- + number.\n * It then sets the id component of the new name based on the incremented id of the highest existing slug id.\n *\n * @param elements An array of color palette items.\n * @param slugPrefix The slug prefix used to match the element slug.\n *\n * @return A name and slug for the new palette item.\n */\nexport function getNameAndSlugForPosition(elements, slugPrefix) {\n const nameRegex = new RegExp(`^${slugPrefix}color-([\\\\d]+)$`);\n const position = elements.reduce((previousValue, currentValue) => {\n if (typeof currentValue?.slug === 'string') {\n const matches = currentValue?.slug.match(nameRegex);\n if (matches) {\n const id = parseInt(matches[1], 10);\n if (id >= previousValue) {\n return id + 1;\n }\n }\n }\n return previousValue;\n }, 1);\n return {\n name: sprintf(/* translators: %d: is an id for a custom color */\n __('Color %d'), position),\n slug: `${slugPrefix}color-${position}`\n };\n}\nfunction ColorPickerPopover({\n isGradient,\n element,\n onChange,\n popoverProps: receivedPopoverProps,\n onClose = () => {}\n}) {\n const popoverProps = useMemo(() => ({\n shift: true,\n offset: 20,\n // Disabling resize as it would otherwise cause the popover to show\n // scrollbars while dragging the color picker's handle close to the\n // popover edge.\n resize: false,\n placement: 'left-start',\n ...receivedPopoverProps,\n className: clsx('components-palette-edit__popover', receivedPopoverProps?.className)\n }), [receivedPopoverProps]);\n return /*#__PURE__*/_jsxs(Popover, {\n ...popoverProps,\n onClose: onClose,\n children: [!isGradient && /*#__PURE__*/_jsx(ColorPicker, {\n color: element.color,\n enableAlpha: true,\n onChange: newColor => {\n onChange({\n ...element,\n color: newColor\n });\n }\n }), isGradient && /*#__PURE__*/_jsx(\"div\", {\n className: \"components-palette-edit__popover-gradient-picker\",\n children: /*#__PURE__*/_jsx(CustomGradientPicker, {\n __experimentalIsRenderedInSidebar: true,\n value: element.gradient,\n onChange: newGradient => {\n onChange({\n ...element,\n gradient: newGradient\n });\n }\n })\n })]\n });\n}\nfunction Option({\n canOnlyChangeValues,\n element,\n onChange,\n onRemove,\n popoverProps: receivedPopoverProps,\n slugPrefix,\n isGradient\n}) {\n const value = isGradient ? element.gradient : element.color;\n const [isEditingColor, setIsEditingColor] = useState(false);\n\n // Use internal state instead of a ref to make sure that the component\n // re-renders when the popover's anchor updates.\n const [popoverAnchor, setPopoverAnchor] = useState(null);\n const popoverProps = useMemo(() => ({\n ...receivedPopoverProps,\n // Use the custom palette color item as the popover anchor.\n anchor: popoverAnchor\n }), [popoverAnchor, receivedPopoverProps]);\n return /*#__PURE__*/_jsxs(Item, {\n ref: setPopoverAnchor,\n size: \"small\",\n children: [/*#__PURE__*/_jsxs(HStack, {\n justify: \"flex-start\",\n children: [/*#__PURE__*/_jsx(Button, {\n size: \"small\",\n onClick: () => {\n setIsEditingColor(true);\n },\n \"aria-label\": sprintf(\n // translators: %s is a color or gradient name, e.g. \"Red\".\n __('Edit: %s'), element.name.trim().length ? element.name : value || ''),\n style: {\n padding: 0\n },\n children: /*#__PURE__*/_jsx(IndicatorStyled, {\n colorValue: value\n })\n }), /*#__PURE__*/_jsx(FlexBlock, {\n children: !canOnlyChangeValues ? /*#__PURE__*/_jsx(NameInput, {\n label: isGradient ? __('Gradient name') : __('Color name'),\n value: element.name,\n onChange: nextName => onChange({\n ...element,\n name: nextName,\n slug: slugPrefix + kebabCase(nextName !== null && nextName !== void 0 ? nextName : '')\n })\n }) : /*#__PURE__*/_jsx(NameContainer, {\n children: element.name.trim().length ? element.name : /* Fall back to non-breaking space to maintain height */\n '\\u00A0'\n })\n }), !canOnlyChangeValues && /*#__PURE__*/_jsx(FlexItem, {\n children: /*#__PURE__*/_jsx(RemoveButton, {\n size: \"small\",\n icon: lineSolid,\n label: sprintf(\n // translators: %s is a color or gradient name, e.g. \"Red\".\n __('Remove color: %s'), element.name.trim().length ? element.name : value || ''),\n onClick: onRemove\n })\n })]\n }), isEditingColor && /*#__PURE__*/_jsx(ColorPickerPopover, {\n isGradient: isGradient,\n onChange: onChange,\n element: element,\n popoverProps: popoverProps,\n onClose: () => setIsEditingColor(false)\n })]\n });\n}\nfunction PaletteEditListView({\n elements,\n onChange,\n canOnlyChangeValues,\n slugPrefix,\n isGradient,\n popoverProps,\n addColorRef\n}) {\n // When unmounting the component if there are empty elements (the user did not complete the insertion) clean them.\n const elementsReferenceRef = useRef();\n useEffect(() => {\n elementsReferenceRef.current = elements;\n }, [elements]);\n const debounceOnChange = useDebounce(updatedElements => onChange(deduplicateElementSlugs(updatedElements)), 100);\n return /*#__PURE__*/_jsx(VStack, {\n spacing: 3,\n children: /*#__PURE__*/_jsx(ItemGroup, {\n isRounded: true,\n isBordered: true,\n isSeparated: true,\n children: elements.map((element, index) => /*#__PURE__*/_jsx(Option, {\n isGradient: isGradient,\n canOnlyChangeValues: canOnlyChangeValues,\n element: element,\n onChange: newElement => {\n debounceOnChange(elements.map((currentElement, currentIndex) => {\n if (currentIndex === index) {\n return newElement;\n }\n return currentElement;\n }));\n },\n onRemove: () => {\n const newElements = elements.filter((_currentElement, currentIndex) => {\n if (currentIndex === index) {\n return false;\n }\n return true;\n });\n onChange(newElements.length ? newElements : undefined);\n addColorRef.current?.focus();\n },\n slugPrefix: slugPrefix,\n popoverProps: popoverProps\n }, index))\n })\n });\n}\nconst EMPTY_ARRAY = [];\n\n/**\n * Allows editing a palette of colors or gradients.\n *\n * ```jsx\n * import { PaletteEdit } from '@wordpress/components';\n * const MyPaletteEdit = () => {\n * const [ controlledColors, setControlledColors ] = useState( colors );\n *\n * return (\n * <PaletteEdit\n * colors={ controlledColors }\n * onChange={ ( newColors?: Color[] ) => {\n * setControlledColors( newColors );\n * } }\n * paletteLabel=\"Here is a label\"\n * />\n * );\n * };\n * ```\n */\nexport function PaletteEdit({\n gradients,\n colors = EMPTY_ARRAY,\n onChange,\n paletteLabel,\n paletteLabelHeadingLevel = 2,\n emptyMessage,\n canOnlyChangeValues,\n canReset,\n slugPrefix = '',\n popoverProps\n}) {\n const isGradient = !!gradients;\n const elements = isGradient ? gradients : colors;\n const [isEditing, setIsEditing] = useState(false);\n const [editingElement, setEditingElement] = useState(null);\n const isAdding = isEditing && !!editingElement && elements[editingElement] && !elements[editingElement].slug;\n const elementsLength = elements.length;\n const hasElements = elementsLength > 0;\n const debounceOnChange = useDebounce(onChange, 100);\n const onSelectPaletteItem = useCallback((value, newEditingElementIndex) => {\n const selectedElement = newEditingElementIndex === undefined ? undefined : elements[newEditingElementIndex];\n const key = isGradient ? 'gradient' : 'color';\n // Ensures that the index returned matches a known element value.\n if (!!selectedElement && selectedElement[key] === value) {\n setEditingElement(newEditingElementIndex);\n } else {\n setIsEditing(true);\n }\n }, [isGradient, elements]);\n const addColorRef = useRef(null);\n return /*#__PURE__*/_jsxs(PaletteEditStyles, {\n children: [/*#__PURE__*/_jsxs(HStack, {\n children: [/*#__PURE__*/_jsx(PaletteHeading, {\n level: paletteLabelHeadingLevel,\n children: paletteLabel\n }), /*#__PURE__*/_jsxs(PaletteActionsContainer, {\n children: [hasElements && isEditing && /*#__PURE__*/_jsx(DoneButton, {\n size: \"small\",\n onClick: () => {\n setIsEditing(false);\n setEditingElement(null);\n },\n children: __('Done')\n }), !canOnlyChangeValues && /*#__PURE__*/_jsx(Button, {\n ref: addColorRef,\n size: \"small\",\n isPressed: isAdding,\n icon: plus,\n label: isGradient ? __('Add gradient') : __('Add color'),\n onClick: () => {\n const {\n name,\n slug\n } = getNameAndSlugForPosition(elements, slugPrefix);\n if (!!gradients) {\n onChange([...gradients, {\n gradient: DEFAULT_GRADIENT,\n name,\n slug\n }]);\n } else {\n onChange([...colors, {\n color: DEFAULT_COLOR,\n name,\n slug\n }]);\n }\n setIsEditing(true);\n setEditingElement(elements.length);\n }\n }), hasElements && (!isEditing || !canOnlyChangeValues || canReset) && /*#__PURE__*/_jsx(DropdownMenu, {\n icon: moreVertical,\n label: isGradient ? __('Gradient options') : __('Color options'),\n toggleProps: {\n size: 'small'\n },\n children: ({\n onClose\n }) => /*#__PURE__*/_jsx(_Fragment, {\n children: /*#__PURE__*/_jsxs(NavigableMenu, {\n role: \"menu\",\n children: [!isEditing && /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n variant: \"tertiary\",\n onClick: () => {\n setIsEditing(true);\n onClose();\n },\n className: \"components-palette-edit__menu-button\",\n children: __('Show details')\n }), !canOnlyChangeValues && /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n variant: \"tertiary\",\n onClick: () => {\n setEditingElement(null);\n setIsEditing(false);\n onChange();\n onClose();\n },\n className: \"components-palette-edit__menu-button\",\n children: isGradient ? __('Remove all gradients') : __('Remove all colors')\n }), canReset && /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n className: \"components-palette-edit__menu-button\",\n variant: \"tertiary\",\n onClick: () => {\n setEditingElement(null);\n onChange();\n onClose();\n },\n children: isGradient ? __('Reset gradient') : __('Reset colors')\n })]\n })\n })\n })]\n })]\n }), hasElements && /*#__PURE__*/_jsxs(PaletteEditContents, {\n children: [isEditing && /*#__PURE__*/_jsx(PaletteEditListView, {\n canOnlyChangeValues: canOnlyChangeValues,\n elements: elements\n // @ts-expect-error TODO: Don't know how to resolve\n ,\n onChange: onChange,\n slugPrefix: slugPrefix,\n isGradient: isGradient,\n popoverProps: popoverProps,\n addColorRef: addColorRef\n }), !isEditing && editingElement !== null && /*#__PURE__*/_jsx(ColorPickerPopover, {\n isGradient: isGradient,\n onClose: () => setEditingElement(null),\n onChange: newElement => {\n debounceOnChange(\n // @ts-expect-error TODO: Don't know how to resolve\n elements.map((currentElement, currentIndex) => {\n if (currentIndex === editingElement) {\n return newElement;\n }\n return currentElement;\n }));\n },\n element: elements[editingElement !== null && editingElement !== void 0 ? editingElement : -1],\n popoverProps: popoverProps\n }), !isEditing && (isGradient ? /*#__PURE__*/_jsx(GradientPicker, {\n gradients: gradients,\n onChange: onSelectPaletteItem,\n clearable: false,\n disableCustomGradients: true\n }) : /*#__PURE__*/_jsx(ColorPalette, {\n colors: colors,\n onChange: onSelectPaletteItem,\n clearable: false,\n disableCustomColors: true\n }))]\n }), !hasElements && emptyMessage && /*#__PURE__*/_jsx(PaletteEditContents, {\n children: emptyMessage\n })]\n });\n}\nexport default PaletteEdit;"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,UAAU,QAAQ,WAAW,aAAa,eAAe;AAClE,SAAS,IAAI,eAAe;AAC5B,SAAS,WAAW,cAAc,YAAY;AAC9C,SAAS,mBAAmB;AAK5B,OAAO,YAAY;AACnB,SAAS,mBAAmB;AAC5B,SAAS,WAAW,gBAAgB;AACpC,SAAS,cAAc;AACvB,SAAS,MAAM,iBAAiB;AAChC,SAAS,cAAc;AACvB,OAAO,oBAAoB;AAC3B,OAAO,kBAAkB;AACzB,OAAO,kBAAkB;AACzB,OAAO,aAAa;AACpB,SAAS,yBAAyB,mBAAmB,gBAAgB,iBAAiB,eAAe,kBAAkB,YAAY,cAAc,2BAA2B;AAC5K,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AACjC,OAAO,0BAA0B;AACjC,SAAS,iBAAiB;AAC1B,SAAS,OAAO,MAAM,QAAQ,OAAO,YAAY,iBAAiB;AAClE,IAAM,gBAAgB;AACtB,SAAS,UAAU;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,SAAoB,qBAAK,kBAAkB;AAAA,IACzC,MAAM;AAAA,IACN;AAAA,IACA,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAKO,SAAS,wBAAwB,UAAU;AAChD,QAAM,aAAa,CAAC;AACpB,SAAO,SAAS,IAAI,aAAW;AAC7B,QAAI;AACJ,QAAI;AACJ,UAAM;AAAA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AC;AAAA,QACH,CAAC,CAAC;AAAA,MACJ,CAAC,CAAC;AAAA,IACJ,CAAC,GAAG,eAA4B,sBAAM,qBAAqB;AAAA,MACzD,UAAU,CAAC,aAA0B,qBAAK,qBAAqB;AAAA,QAC7D;AAAA,QACA;AAAA,QAGA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC,GAAG,CAAC,aAAa,mBAAmB,QAAqB,qBAAK,oBAAoB;AAAA,QACjF;AAAA,QACA,SAAS,MAAM,kBAAkB,IAAI;AAAA,QACrC,UAAU,gBAAc;AACtB;AAAA;AAAA,YAEA,SAAS,IAAI,CAAC,gBAAgB,iBAAiB;AAC7C,kBAAI,iBAAiB,gBAAgB;AACnC,uBAAO;AAAA,cACT;AACA,qBAAO;AAAA,YACT,CAAC;AAAA,UAAC;AAAA,QACJ;AAAA,QACA,SAAS,SAAS,mBAAmB,QAAQ,mBAAmB,SAAS,iBAAiB,EAAE;AAAA,QAC5F;AAAA,MACF,CAAC,GAAG,CAAC,cAAc,aAA0B,qBAAK,gBAAgB;AAAA,QAChE;AAAA,QACA,UAAU;AAAA,QACV,WAAW;AAAA,QACX,wBAAwB;AAAA,MAC1B,CAAC,IAAiB,qBAAK,cAAc;AAAA,QACnC;AAAA,QACA,UAAU;AAAA,QACV,WAAW;AAAA,QACX,qBAAqB;AAAA,MACvB,CAAC,EAAE;AAAA,IACL,CAAC,GAAG,CAAC,eAAe,gBAA6B,qBAAK,qBAAqB;AAAA,MACzE,UAAU;AAAA,IACZ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,uBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useRef, useEffect, useCallback, useMemo } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { lineSolid, moreVertical, plus } from '@wordpress/icons';\nimport { useDebounce } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { ColorPicker } from '../color-picker';\nimport { FlexBlock, FlexItem } from '../flex';\nimport { HStack } from '../h-stack';\nimport { Item, ItemGroup } from '../item-group';\nimport { VStack } from '../v-stack';\nimport GradientPicker from '../gradient-picker';\nimport ColorPalette from '../color-palette';\nimport DropdownMenu from '../dropdown-menu';\nimport Popover from '../popover';\nimport { PaletteActionsContainer, PaletteEditStyles, PaletteHeading, IndicatorStyled, NameContainer, NameInputControl, DoneButton, RemoveButton, PaletteEditContents } from './styles';\nimport { NavigableMenu } from '../navigable-container';\nimport { DEFAULT_GRADIENT } from '../custom-gradient-picker/constants';\nimport CustomGradientPicker from '../custom-gradient-picker';\nimport { kebabCase } from '../utils/strings';\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nconst DEFAULT_COLOR = '#000';\nfunction NameInput({\n value,\n onChange,\n label\n}) {\n return /*#__PURE__*/_jsx(NameInputControl, {\n size: \"compact\",\n label: label,\n hideLabelFromVision: true,\n value: value,\n onChange: onChange\n });\n}\n\n/*\n * Deduplicates the slugs of the provided elements.\n */\nexport function deduplicateElementSlugs(elements) {\n const slugCounts = {};\n return elements.map(element => {\n let newSlug;\n const {\n slug\n } = element;\n slugCounts[slug] = (slugCounts[slug] || 0) + 1;\n if (slugCounts[slug] > 1) {\n newSlug = `${slug}-${slugCounts[slug] - 1}`;\n }\n return {\n ...element,\n slug: newSlug ?? slug\n };\n });\n}\n\n/**\n * Returns a name and slug for a palette item. The name takes the format \"Color + id\".\n * To ensure there are no duplicate ids, this function checks all slugs.\n * It expects slugs to be in the format: slugPrefix + color- + number.\n * It then sets the id component of the new name based on the incremented id of the highest existing slug id.\n *\n * @param elements An array of color palette items.\n * @param slugPrefix The slug prefix used to match the element slug.\n *\n * @return A name and slug for the new palette item.\n */\nexport function getNameAndSlugForPosition(elements, slugPrefix) {\n const nameRegex = new RegExp(`^${slugPrefix}color-([\\\\d]+)$`);\n const position = elements.reduce((previousValue, currentValue) => {\n if (typeof currentValue?.slug === 'string') {\n const matches = currentValue?.slug.match(nameRegex);\n if (matches) {\n const id = parseInt(matches[1], 10);\n if (id >= previousValue) {\n return id + 1;\n }\n }\n }\n return previousValue;\n }, 1);\n return {\n name: sprintf(/* translators: %d: is an id for a custom color */\n __('Color %d'), position),\n slug: `${slugPrefix}color-${position}`\n };\n}\nfunction ColorPickerPopover({\n isGradient,\n element,\n onChange,\n popoverProps: receivedPopoverProps,\n onClose = () => {}\n}) {\n const popoverProps = useMemo(() => ({\n shift: true,\n offset: 20,\n // Disabling resize as it would otherwise cause the popover to show\n // scrollbars while dragging the color picker's handle close to the\n // popover edge.\n resize: false,\n placement: 'left-start',\n ...receivedPopoverProps,\n className: clsx('components-palette-edit__popover', receivedPopoverProps?.className)\n }), [receivedPopoverProps]);\n return /*#__PURE__*/_jsxs(Popover, {\n ...popoverProps,\n onClose: onClose,\n children: [!isGradient && /*#__PURE__*/_jsx(ColorPicker, {\n color: element.color,\n enableAlpha: true,\n onChange: newColor => {\n onChange({\n ...element,\n color: newColor\n });\n }\n }), isGradient && /*#__PURE__*/_jsx(\"div\", {\n className: \"components-palette-edit__popover-gradient-picker\",\n children: /*#__PURE__*/_jsx(CustomGradientPicker, {\n __experimentalIsRenderedInSidebar: true,\n value: element.gradient,\n onChange: newGradient => {\n onChange({\n ...element,\n gradient: newGradient\n });\n }\n })\n })]\n });\n}\nfunction Option({\n canOnlyChangeValues,\n element,\n onChange,\n onRemove,\n popoverProps: receivedPopoverProps,\n slugPrefix,\n isGradient\n}) {\n const value = isGradient ? element.gradient : element.color;\n const [isEditingColor, setIsEditingColor] = useState(false);\n\n // Use internal state instead of a ref to make sure that the component\n // re-renders when the popover's anchor updates.\n const [popoverAnchor, setPopoverAnchor] = useState(null);\n const popoverProps = useMemo(() => ({\n ...receivedPopoverProps,\n // Use the custom palette color item as the popover anchor.\n anchor: popoverAnchor\n }), [popoverAnchor, receivedPopoverProps]);\n return /*#__PURE__*/_jsxs(Item, {\n ref: setPopoverAnchor,\n size: \"small\",\n children: [/*#__PURE__*/_jsxs(HStack, {\n justify: \"flex-start\",\n children: [/*#__PURE__*/_jsx(Button, {\n size: \"small\",\n onClick: () => {\n setIsEditingColor(true);\n },\n \"aria-label\": sprintf(\n // translators: %s is a color or gradient name, e.g. \"Red\".\n __('Edit: %s'), element.name.trim().length ? element.name : value || ''),\n style: {\n padding: 0\n },\n children: /*#__PURE__*/_jsx(IndicatorStyled, {\n colorValue: value\n })\n }), /*#__PURE__*/_jsx(FlexBlock, {\n children: !canOnlyChangeValues ? /*#__PURE__*/_jsx(NameInput, {\n label: isGradient ? __('Gradient name') : __('Color name'),\n value: element.name,\n onChange: nextName => onChange({\n ...element,\n name: nextName,\n slug: slugPrefix + kebabCase(nextName ?? '')\n })\n }) : /*#__PURE__*/_jsx(NameContainer, {\n children: element.name.trim().length ? element.name : /* Fall back to non-breaking space to maintain height */\n '\\u00A0'\n })\n }), !canOnlyChangeValues && /*#__PURE__*/_jsx(FlexItem, {\n children: /*#__PURE__*/_jsx(RemoveButton, {\n size: \"small\",\n icon: lineSolid,\n label: sprintf(\n // translators: %s is a color or gradient name, e.g. \"Red\".\n __('Remove color: %s'), element.name.trim().length ? element.name : value || ''),\n onClick: onRemove\n })\n })]\n }), isEditingColor && /*#__PURE__*/_jsx(ColorPickerPopover, {\n isGradient: isGradient,\n onChange: onChange,\n element: element,\n popoverProps: popoverProps,\n onClose: () => setIsEditingColor(false)\n })]\n });\n}\nfunction PaletteEditListView({\n elements,\n onChange,\n canOnlyChangeValues,\n slugPrefix,\n isGradient,\n popoverProps,\n addColorRef\n}) {\n // When unmounting the component if there are empty elements (the user did not complete the insertion) clean them.\n const elementsReferenceRef = useRef();\n useEffect(() => {\n elementsReferenceRef.current = elements;\n }, [elements]);\n const debounceOnChange = useDebounce(updatedElements => onChange(deduplicateElementSlugs(updatedElements)), 100);\n return /*#__PURE__*/_jsx(VStack, {\n spacing: 3,\n children: /*#__PURE__*/_jsx(ItemGroup, {\n isRounded: true,\n isBordered: true,\n isSeparated: true,\n children: elements.map((element, index) => /*#__PURE__*/_jsx(Option, {\n isGradient: isGradient,\n canOnlyChangeValues: canOnlyChangeValues,\n element: element,\n onChange: newElement => {\n debounceOnChange(elements.map((currentElement, currentIndex) => {\n if (currentIndex === index) {\n return newElement;\n }\n return currentElement;\n }));\n },\n onRemove: () => {\n const newElements = elements.filter((_currentElement, currentIndex) => {\n if (currentIndex === index) {\n return false;\n }\n return true;\n });\n onChange(newElements.length ? newElements : undefined);\n addColorRef.current?.focus();\n },\n slugPrefix: slugPrefix,\n popoverProps: popoverProps\n }, index))\n })\n });\n}\nconst EMPTY_ARRAY = [];\n\n/**\n * Allows editing a palette of colors or gradients.\n *\n * ```jsx\n * import { PaletteEdit } from '@wordpress/components';\n * const MyPaletteEdit = () => {\n * const [ controlledColors, setControlledColors ] = useState( colors );\n *\n * return (\n * <PaletteEdit\n * colors={ controlledColors }\n * onChange={ ( newColors?: Color[] ) => {\n * setControlledColors( newColors );\n * } }\n * paletteLabel=\"Here is a label\"\n * />\n * );\n * };\n * ```\n */\nexport function PaletteEdit({\n gradients,\n colors = EMPTY_ARRAY,\n onChange,\n paletteLabel,\n paletteLabelHeadingLevel = 2,\n emptyMessage,\n canOnlyChangeValues,\n canReset,\n slugPrefix = '',\n popoverProps\n}) {\n const isGradient = !!gradients;\n const elements = isGradient ? gradients : colors;\n const [isEditing, setIsEditing] = useState(false);\n const [editingElement, setEditingElement] = useState(null);\n const isAdding = isEditing && !!editingElement && elements[editingElement] && !elements[editingElement].slug;\n const elementsLength = elements.length;\n const hasElements = elementsLength > 0;\n const debounceOnChange = useDebounce(onChange, 100);\n const onSelectPaletteItem = useCallback((value, newEditingElementIndex) => {\n const selectedElement = newEditingElementIndex === undefined ? undefined : elements[newEditingElementIndex];\n const key = isGradient ? 'gradient' : 'color';\n // Ensures that the index returned matches a known element value.\n if (!!selectedElement && selectedElement[key] === value) {\n setEditingElement(newEditingElementIndex);\n } else {\n setIsEditing(true);\n }\n }, [isGradient, elements]);\n const addColorRef = useRef(null);\n return /*#__PURE__*/_jsxs(PaletteEditStyles, {\n children: [/*#__PURE__*/_jsxs(HStack, {\n children: [/*#__PURE__*/_jsx(PaletteHeading, {\n level: paletteLabelHeadingLevel,\n children: paletteLabel\n }), /*#__PURE__*/_jsxs(PaletteActionsContainer, {\n children: [hasElements && isEditing && /*#__PURE__*/_jsx(DoneButton, {\n size: \"small\",\n onClick: () => {\n setIsEditing(false);\n setEditingElement(null);\n },\n children: __('Done')\n }), !canOnlyChangeValues && /*#__PURE__*/_jsx(Button, {\n ref: addColorRef,\n size: \"small\",\n isPressed: isAdding,\n icon: plus,\n label: isGradient ? __('Add gradient') : __('Add color'),\n onClick: () => {\n const {\n name,\n slug\n } = getNameAndSlugForPosition(elements, slugPrefix);\n if (!!gradients) {\n onChange([...gradients, {\n gradient: DEFAULT_GRADIENT,\n name,\n slug\n }]);\n } else {\n onChange([...colors, {\n color: DEFAULT_COLOR,\n name,\n slug\n }]);\n }\n setIsEditing(true);\n setEditingElement(elements.length);\n }\n }), hasElements && (!isEditing || !canOnlyChangeValues || canReset) && /*#__PURE__*/_jsx(DropdownMenu, {\n icon: moreVertical,\n label: isGradient ? __('Gradient options') : __('Color options'),\n toggleProps: {\n size: 'small'\n },\n children: ({\n onClose\n }) => /*#__PURE__*/_jsx(_Fragment, {\n children: /*#__PURE__*/_jsxs(NavigableMenu, {\n role: \"menu\",\n children: [!isEditing && /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n variant: \"tertiary\",\n onClick: () => {\n setIsEditing(true);\n onClose();\n },\n className: \"components-palette-edit__menu-button\",\n children: __('Show details')\n }), !canOnlyChangeValues && /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n variant: \"tertiary\",\n onClick: () => {\n setEditingElement(null);\n setIsEditing(false);\n onChange();\n onClose();\n },\n className: \"components-palette-edit__menu-button\",\n children: isGradient ? __('Remove all gradients') : __('Remove all colors')\n }), canReset && /*#__PURE__*/_jsx(Button, {\n __next40pxDefaultSize: true,\n className: \"components-palette-edit__menu-button\",\n variant: \"tertiary\",\n onClick: () => {\n setEditingElement(null);\n onChange();\n onClose();\n },\n children: isGradient ? __('Reset gradient') : __('Reset colors')\n })]\n })\n })\n })]\n })]\n }), hasElements && /*#__PURE__*/_jsxs(PaletteEditContents, {\n children: [isEditing && /*#__PURE__*/_jsx(PaletteEditListView, {\n canOnlyChangeValues: canOnlyChangeValues,\n elements: elements\n // @ts-expect-error TODO: Don't know how to resolve\n ,\n onChange: onChange,\n slugPrefix: slugPrefix,\n isGradient: isGradient,\n popoverProps: popoverProps,\n addColorRef: addColorRef\n }), !isEditing && editingElement !== null && /*#__PURE__*/_jsx(ColorPickerPopover, {\n isGradient: isGradient,\n onClose: () => setEditingElement(null),\n onChange: newElement => {\n debounceOnChange(\n // @ts-expect-error TODO: Don't know how to resolve\n elements.map((currentElement, currentIndex) => {\n if (currentIndex === editingElement) {\n return newElement;\n }\n return currentElement;\n }));\n },\n element: elements[editingElement ?? -1],\n popoverProps: popoverProps\n }), !isEditing && (isGradient ? /*#__PURE__*/_jsx(GradientPicker, {\n gradients: gradients,\n onChange: onSelectPaletteItem,\n clearable: false,\n disableCustomGradients: true\n }) : /*#__PURE__*/_jsx(ColorPalette, {\n colors: colors,\n onChange: onSelectPaletteItem,\n clearable: false,\n disableCustomColors: true\n }))]\n }), !hasElements && emptyMessage && /*#__PURE__*/_jsx(PaletteEditContents, {\n children: emptyMessage\n })]\n });\n}\nexport default PaletteEdit;"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,UAAU,QAAQ,WAAW,aAAa,eAAe;AAClE,SAAS,IAAI,eAAe;AAC5B,SAAS,WAAW,cAAc,YAAY;AAC9C,SAAS,mBAAmB;AAK5B,OAAO,YAAY;AACnB,SAAS,mBAAmB;AAC5B,SAAS,WAAW,gBAAgB;AACpC,SAAS,cAAc;AACvB,SAAS,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,QAChE;AAAA,QACA,UAAU;AAAA,QACV,WAAW;AAAA,QACX,wBAAwB;AAAA,MAC1B,CAAC,IAAiB,qBAAK,cAAc;AAAA,QACnC;AAAA,QACA,UAAU;AAAA,QACV,WAAW;AAAA,QACX,qBAAqB;AAAA,MACvB,CAAC,EAAE;AAAA,IACL,CAAC,GAAG,CAAC,eAAe,gBAA6B,qBAAK,qBAAqB;AAAA,MACzE,UAAU;AAAA,IACZ,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,uBAAQ;",
6
6
  "names": []
7
7
  }
@@ -93,6 +93,7 @@ var PanelBodyTitle = forwardRef(({
93
93
  });
94
94
  });
95
95
  var PanelBody = forwardRef(UnforwardedPanelBody);
96
+ PanelBody.displayName = "PanelBody";
96
97
  var body_default = PanelBody;
97
98
  export {
98
99
  PanelBody,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/panel/body.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { chevronUp, chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\n\nimport Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst noop = () => {};\nexport function UnforwardedPanelBody(props, ref) {\n const {\n buttonProps = {},\n children,\n className,\n icon,\n initialOpen,\n onToggle = noop,\n opened,\n title,\n scrollAfterOpen = true\n } = props;\n const [isOpened, setIsOpened] = useControlledState(opened, {\n initial: initialOpen === undefined ? true : initialOpen,\n fallback: false\n });\n const nodeRef = useRef(null);\n\n // Defaults to 'smooth' scrolling\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n const scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';\n const handleOnToggle = event => {\n event.preventDefault();\n const next = !isOpened;\n setIsOpened(next);\n onToggle(next);\n };\n\n // Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.\n const scrollAfterOpenRef = useRef();\n scrollAfterOpenRef.current = scrollAfterOpen;\n // Runs after initial render.\n useUpdateEffect(() => {\n if (isOpened && scrollAfterOpenRef.current && nodeRef.current?.scrollIntoView) {\n /*\n * Scrolls the content into view when visible.\n * This improves the UX when there are multiple stacking <PanelBody />\n * components in a scrollable container.\n */\n nodeRef.current.scrollIntoView({\n inline: 'nearest',\n block: 'nearest',\n behavior: scrollBehavior\n });\n }\n }, [isOpened, scrollBehavior]);\n const classes = clsx('components-panel__body', className, {\n 'is-opened': isOpened\n });\n return /*#__PURE__*/_jsxs(\"div\", {\n className: classes,\n ref: useMergeRefs([nodeRef, ref]),\n children: [/*#__PURE__*/_jsx(PanelBodyTitle, {\n icon: icon,\n isOpened: Boolean(isOpened),\n onClick: handleOnToggle,\n title: title,\n ...buttonProps\n }), typeof children === 'function' ? children({\n opened: Boolean(isOpened)\n }) : isOpened && children]\n });\n}\nconst PanelBodyTitle = forwardRef(({\n isOpened,\n icon,\n title,\n ...props\n}, ref) => {\n if (!title) {\n return null;\n }\n return /*#__PURE__*/_jsx(\"h2\", {\n className: \"components-panel__body-title\",\n children: /*#__PURE__*/_jsxs(Button, {\n __next40pxDefaultSize: true,\n className: \"components-panel__body-toggle\",\n \"aria-expanded\": isOpened,\n ref: ref,\n ...props,\n children: [/*#__PURE__*/_jsx(\"span\", {\n \"aria-hidden\": \"true\",\n children: /*#__PURE__*/_jsx(Icon, {\n className: \"components-panel__arrow\",\n icon: isOpened ? chevronUp : chevronDown\n })\n }), title, icon && /*#__PURE__*/_jsx(Icon, {\n icon: icon,\n className: \"components-panel__icon\",\n size: 20\n })]\n })\n });\n});\nexport const PanelBody = forwardRef(UnforwardedPanelBody);\nexport default PanelBody;"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,kBA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,MAC1B,SAAS;AAAA,MACT;AAAA,MACA,GAAG;AAAA,IACL,CAAC,GAAG,OAAO,aAAa,aAAa,SAAS;AAAA,MAC5C,QAAQ,QAAQ,QAAQ;AAAA,IAC1B,CAAC,IAAI,YAAY,QAAQ;AAAA,EAC3B,CAAC;AACH;AACA,IAAM,iBAAiB,WAAW,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG,QAAQ;AACT,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AACA,SAAoB,qBAAK,MAAM;AAAA,IAC7B,WAAW;AAAA,IACX,UAAuB,sBAAM,QAAQ;AAAA,MACnC,uBAAuB;AAAA,MACvB,WAAW;AAAA,MACX,iBAAiB;AAAA,MACjB;AAAA,MACA,GAAG;AAAA,MACH,UAAU,CAAc,qBAAK,QAAQ;AAAA,QACnC,eAAe;AAAA,QACf,UAAuB,qBAAK,MAAM;AAAA,UAChC,WAAW;AAAA,UACX,MAAM,WAAW,YAAY;AAAA,QAC/B,CAAC;AAAA,MACH,CAAC,GAAG,OAAO,QAAqB,qBAAK,MAAM;AAAA,QACzC;AAAA,QACA,WAAW;AAAA,QACX,MAAM;AAAA,MACR,CAAC,CAAC;AAAA,IACJ,CAAC;AAAA,EACH,CAAC;AACH,CAAC;AACM,IAAM,YAAY,WAAW,oBAAoB;AACxD,IAAO,eAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useReducedMotion, useMergeRefs } from '@wordpress/compose';\nimport { forwardRef, useRef } from '@wordpress/element';\nimport { chevronUp, chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\n\nimport Button from '../button';\nimport Icon from '../icon';\nimport { useControlledState, useUpdateEffect } from '../utils';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst noop = () => {};\nexport function UnforwardedPanelBody(props, ref) {\n const {\n buttonProps = {},\n children,\n className,\n icon,\n initialOpen,\n onToggle = noop,\n opened,\n title,\n scrollAfterOpen = true\n } = props;\n const [isOpened, setIsOpened] = useControlledState(opened, {\n initial: initialOpen === undefined ? true : initialOpen,\n fallback: false\n });\n const nodeRef = useRef(null);\n\n // Defaults to 'smooth' scrolling\n // https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n const scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';\n const handleOnToggle = event => {\n event.preventDefault();\n const next = !isOpened;\n setIsOpened(next);\n onToggle(next);\n };\n\n // Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.\n const scrollAfterOpenRef = useRef();\n scrollAfterOpenRef.current = scrollAfterOpen;\n // Runs after initial render.\n useUpdateEffect(() => {\n if (isOpened && scrollAfterOpenRef.current && nodeRef.current?.scrollIntoView) {\n /*\n * Scrolls the content into view when visible.\n * This improves the UX when there are multiple stacking <PanelBody />\n * components in a scrollable container.\n */\n nodeRef.current.scrollIntoView({\n inline: 'nearest',\n block: 'nearest',\n behavior: scrollBehavior\n });\n }\n }, [isOpened, scrollBehavior]);\n const classes = clsx('components-panel__body', className, {\n 'is-opened': isOpened\n });\n return /*#__PURE__*/_jsxs(\"div\", {\n className: classes,\n ref: useMergeRefs([nodeRef, ref]),\n children: [/*#__PURE__*/_jsx(PanelBodyTitle, {\n icon: icon,\n isOpened: Boolean(isOpened),\n onClick: handleOnToggle,\n title: title,\n ...buttonProps\n }), typeof children === 'function' ? children({\n opened: Boolean(isOpened)\n }) : isOpened && children]\n });\n}\nconst PanelBodyTitle = forwardRef(({\n isOpened,\n icon,\n title,\n ...props\n}, ref) => {\n if (!title) {\n return null;\n }\n return /*#__PURE__*/_jsx(\"h2\", {\n className: \"components-panel__body-title\",\n children: /*#__PURE__*/_jsxs(Button, {\n __next40pxDefaultSize: true,\n className: \"components-panel__body-toggle\",\n \"aria-expanded\": isOpened,\n ref: ref,\n ...props,\n children: [/*#__PURE__*/_jsx(\"span\", {\n \"aria-hidden\": \"true\",\n children: /*#__PURE__*/_jsx(Icon, {\n className: \"components-panel__arrow\",\n icon: isOpened ? chevronUp : chevronDown\n })\n }), title, icon && /*#__PURE__*/_jsx(Icon, {\n icon: icon,\n className: \"components-panel__icon\",\n size: 20\n })]\n })\n });\n});\nexport const PanelBody = forwardRef(UnforwardedPanelBody);\nPanelBody.displayName = 'PanelBody';\nexport default PanelBody;"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,kBAAkB,oBAAoB;AAC/C,SAAS,YAAY,cAAc;AACnC,SAAS,WAAW,mBAAmB;AAMvC,OAAO,YAAY;AACnB,OAAO,UAAU;AACjB,SAAS,oBAAoB,uBAAuB;AACpD,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,IAAM,OAAO,MAAM;AAAC;AACb,SAAS,qBAAqB,OAAO,KAAK;AAC/C,QAAM;AAAA,IACJ,cAAc,CAAC;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,EACpB,IAAI;AACJ,QAAM,CAAC,UAAU,WAAW,IAAI,mBAAmB,QAAQ;AAAA,IACzD,SAAS,gBAAgB,SAAY,OAAO;AAAA,IAC5C,UAAU;AAAA,EACZ,CAAC;AACD,QAAM,UAAU,OAAO,IAAI;AAI3B,QAAM,iBAAiB,iBAAiB,IAAI,SAAS;AACrD,QAAM,iBAAiB,WAAS;AAC9B,UAAM,eAAe;AACrB,UAAM,OAAO,CAAC;AACd,gBAAY,IAAI;AAChB,aAAS,IAAI;AAAA,EACf;AAGA,QAAM,qBAAqB,OAAO;AAClC,qBAAmB,UAAU;AAE7B,kBAAgB,MAAM;AACpB,QAAI,YAAY,mBAAmB,WAAW,QAAQ,SAAS,gBAAgB;AAM7E,cAAQ,QAAQ,eAAe;AAAA,QAC7B,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;A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
18
  });
19
19
  }
20
20
  var Panel = forwardRef(UnforwardedPanel);
21
+ Panel.displayName = "Panel";
21
22
  var panel_default = Panel;
22
23
  export {
23
24
  Panel,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/panel/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport PanelHeader from './header';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction UnforwardedPanel({\n header,\n className,\n children\n}, ref) {\n const classNames = clsx(className, 'components-panel');\n return /*#__PURE__*/_jsxs(\"div\", {\n className: classNames,\n ref: ref,\n children: [header && /*#__PURE__*/_jsx(PanelHeader, {\n label: header\n }), children]\n });\n}\n\n/**\n * `Panel` expands and collapses multiple sections of content.\n *\n * ```jsx\n * import { Panel, PanelBody, PanelRow } from '@wordpress/components';\n * import { more } from '@wordpress/icons';\n *\n * const MyPanel = () => (\n * \t<Panel header=\"My Panel\">\n * \t\t<PanelBody title=\"My Block Settings\" icon={ more } initialOpen={ true }>\n * \t\t\t<PanelRow>My Panel Inputs and Labels</PanelRow>\n * \t\t</PanelBody>\n * \t</Panel>\n * );\n * ```\n */\nexport const Panel = forwardRef(UnforwardedPanel);\nexport default Panel;"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,kBAAkB;AAK3B,OAAO,iBAAiB;AACxB,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AACF,GAAG,KAAK;AACN,QAAM,aAAa,KAAK,WAAW,kBAAkB;AACrD,SAAoB,sBAAM,OAAO;AAAA,IAC/B,WAAW;AAAA,IACX;AAAA,IACA,UAAU,CAAC,UAAuB,qBAAK,aAAa;AAAA,MAClD,OAAO;AAAA,IACT,CAAC,GAAG,QAAQ;AAAA,EACd,CAAC;AACH;AAkBO,IAAM,QAAQ,WAAW,gBAAgB;AAChD,IAAO,gBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport PanelHeader from './header';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction UnforwardedPanel({\n header,\n className,\n children\n}, ref) {\n const classNames = clsx(className, 'components-panel');\n return /*#__PURE__*/_jsxs(\"div\", {\n className: classNames,\n ref: ref,\n children: [header && /*#__PURE__*/_jsx(PanelHeader, {\n label: header\n }), children]\n });\n}\n\n/**\n * `Panel` expands and collapses multiple sections of content.\n *\n * ```jsx\n * import { Panel, PanelBody, PanelRow } from '@wordpress/components';\n * import { more } from '@wordpress/icons';\n *\n * const MyPanel = () => (\n * \t<Panel header=\"My Panel\">\n * \t\t<PanelBody title=\"My Block Settings\" icon={ more } initialOpen={ true }>\n * \t\t\t<PanelRow>My Panel Inputs and Labels</PanelRow>\n * \t\t</PanelBody>\n * \t</Panel>\n * );\n * ```\n */\nexport const Panel = forwardRef(UnforwardedPanel);\nPanel.displayName = 'Panel';\nexport default Panel;"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,kBAAkB;AAK3B,OAAO,iBAAiB;AACxB,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AACF,GAAG,KAAK;AACN,QAAM,aAAa,KAAK,WAAW,kBAAkB;AACrD,SAAoB,sBAAM,OAAO;AAAA,IAC/B,WAAW;AAAA,IACX;AAAA,IACA,UAAU,CAAC,UAAuB,qBAAK,aAAa;AAAA,MAClD,OAAO;AAAA,IACT,CAAC,GAAG,QAAQ;AAAA,EACd,CAAC;AACH;AAkBO,IAAM,QAAQ,WAAW,gBAAgB;AAChD,MAAM,cAAc;AACpB,IAAO,gBAAQ;",
6
6
  "names": []
7
7
  }
@@ -13,6 +13,7 @@ function UnforwardedPanelRow({
13
13
  });
14
14
  }
15
15
  var PanelRow = forwardRef(UnforwardedPanelRow);
16
+ PanelRow.displayName = "PanelRow";
16
17
  var row_default = PanelRow;
17
18
  export {
18
19
  PanelRow,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/panel/row.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedPanelRow({\n className,\n children\n}, ref) {\n return /*#__PURE__*/_jsx(\"div\", {\n className: clsx('components-panel__row', className),\n ref: ref,\n children: children\n });\n}\n\n/**\n * `PanelRow` is a generic container for rows within a `PanelBody`.\n * It is a flex container with a top margin for spacing.\n */\nexport const PanelRow = forwardRef(UnforwardedPanelRow);\nexport default PanelRow;"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,kBAAkB;AAK3B,SAAS,OAAO,YAAY;AAC5B,SAAS,oBAAoB;AAAA,EAC3B;AAAA,EACA;AACF,GAAG,KAAK;AACN,SAAoB,qBAAK,OAAO;AAAA,IAC9B,WAAW,KAAK,yBAAyB,SAAS;AAAA,IAClD;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAMO,IAAM,WAAW,WAAW,mBAAmB;AACtD,IAAO,cAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction UnforwardedPanelRow({\n className,\n children\n}, ref) {\n return /*#__PURE__*/_jsx(\"div\", {\n className: clsx('components-panel__row', className),\n ref: ref,\n children: children\n });\n}\n\n/**\n * `PanelRow` is a generic container for rows within a `PanelBody`.\n * It is a flex container with a top margin for spacing.\n */\nexport const PanelRow = forwardRef(UnforwardedPanelRow);\nPanelRow.displayName = 'PanelRow';\nexport default PanelRow;"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,kBAAkB;AAK3B,SAAS,OAAO,YAAY;AAC5B,SAAS,oBAAoB;AAAA,EAC3B;AAAA,EACA;AACF,GAAG,KAAK;AACN,SAAoB,qBAAK,OAAO;AAAA,IAC9B,WAAW,KAAK,yBAAyB,SAAS;AAAA,IAClD;AAAA,IACA;AAAA,EACF,CAAC;AACH;AAMO,IAAM,WAAW,WAAW,mBAAmB;AACtD,SAAS,cAAc;AACvB,IAAO,cAAQ;",
6
6
  "names": []
7
7
  }
@@ -124,10 +124,9 @@ var UnforwardedPopover = (props, forwardedRef) => {
124
124
  const middleware = [...placementProp === "overlay" ? overlayMiddlewares() : [], offsetMiddleware(offsetProp), computedFlipProp && flipMiddleware(), computedResizeProp && size({
125
125
  padding: OVERFLOW_PADDING,
126
126
  apply(sizeProps) {
127
- var _refs$floating$curren;
128
127
  const {
129
128
  firstElementChild
130
- } = (_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 ? _refs$floating$curren : {};
129
+ } = refs.floating.current ?? {};
131
130
  if (!(firstElementChild instanceof HTMLElement)) {
132
131
  return;
133
132
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/popover/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\n\nimport clsx from 'clsx';\nimport { useFloating, flip as flipMiddleware, shift as shiftMiddleware, limitShift, autoUpdate, arrow, offset as offsetMiddleware, size } from '@floating-ui/react-dom';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useLayoutEffect, forwardRef, createContext, useContext, useMemo, useState, useCallback, createPortal } from '@wordpress/element';\nimport { useReducedMotion, useViewportMatch, useMergeRefs, __experimentalUseDialog as useDialog } from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport { computePopoverPosition, positionToPlacement, placementToMotionAnimationProps, getReferenceElement } from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nexport const SLOT_NAME = 'Popover';\n\n/**\n * Virtual padding to account for overflow boundaries.\n *\n * @type {number}\n */\nconst OVERFLOW_PADDING = 8;\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => /*#__PURE__*/_jsxs(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 100 100\",\n className: \"components-popover__triangle\",\n role: \"presentation\",\n children: [/*#__PURE__*/_jsx(Path, {\n className: \"components-popover__triangle-bg\",\n d: \"M 0 0 L 50 50 L 100 0\"\n }), /*#__PURE__*/_jsx(Path, {\n className: \"components-popover__triangle-border\",\n d: \"M 0 0 L 50 50 L 100 0\",\n vectorEffect: \"non-scaling-stroke\"\n })]\n});\nconst slotNameContext = createContext(undefined);\nslotNameContext.displayName = '__unstableSlotNameContext';\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n let container = document.body.querySelector('.' + fallbackContainerClassname);\n if (!container) {\n container = document.createElement('div');\n container.className = fallbackContainerClassname;\n document.body.append(container);\n }\n return container;\n};\nconst UnforwardedPopover = (props, forwardedRef) => {\n const {\n animate = true,\n headerTitle,\n constrainTabbing,\n onClose,\n children,\n className,\n noArrow = true,\n position,\n placement: placementProp = 'bottom-start',\n offset: offsetProp = 0,\n focusOnMount = 'firstElement',\n anchor,\n expandOnMobile,\n onFocusOutside,\n __unstableSlotName = SLOT_NAME,\n flip = true,\n resize = true,\n shift = false,\n inline = false,\n variant,\n style: contentStyle,\n // Deprecated props\n __unstableForcePosition,\n anchorRef,\n anchorRect,\n getAnchorRect,\n isAlternate,\n // Rest\n ...contentProps\n } = useContextSystem(props, 'Popover');\n let computedFlipProp = flip;\n let computedResizeProp = resize;\n if (__unstableForcePosition !== undefined) {\n deprecated('`__unstableForcePosition` prop in wp.components.Popover', {\n since: '6.1',\n version: '6.3',\n alternative: '`flip={ false }` and `resize={ false }`'\n });\n\n // Back-compat, set the `flip` and `resize` props\n // to `false` to replicate `__unstableForcePosition`.\n computedFlipProp = !__unstableForcePosition;\n computedResizeProp = !__unstableForcePosition;\n }\n if (anchorRef !== undefined) {\n deprecated('`anchorRef` prop in wp.components.Popover', {\n since: '6.1',\n alternative: '`anchor` prop'\n });\n }\n if (anchorRect !== undefined) {\n deprecated('`anchorRect` prop in wp.components.Popover', {\n since: '6.1',\n alternative: '`anchor` prop'\n });\n }\n if (getAnchorRect !== undefined) {\n deprecated('`getAnchorRect` prop in wp.components.Popover', {\n since: '6.1',\n alternative: '`anchor` prop'\n });\n }\n const computedVariant = isAlternate ? 'toolbar' : variant;\n if (isAlternate !== undefined) {\n deprecated('`isAlternate` prop in wp.components.Popover', {\n since: '6.2',\n alternative: \"`variant` prop with the `'toolbar'` value\"\n });\n }\n const arrowRef = useRef(null);\n const [fallbackReferenceElement, setFallbackReferenceElement] = useState(null);\n const anchorRefFallback = useCallback(node => {\n setFallbackReferenceElement(node);\n }, []);\n const isMobileViewport = useViewportMatch('medium', '<');\n const isExpanded = expandOnMobile && isMobileViewport;\n const hasArrow = !isExpanded && !noArrow;\n const normalizedPlacementFromProps = position ? positionToPlacement(position) : placementProp;\n const middleware = [...(placementProp === 'overlay' ? overlayMiddlewares() : []), offsetMiddleware(offsetProp), computedFlipProp && flipMiddleware(), computedResizeProp && size({\n padding: OVERFLOW_PADDING,\n apply(sizeProps) {\n var _refs$floating$curren;\n const {\n firstElementChild\n } = (_refs$floating$curren = refs.floating.current) !== null && _refs$floating$curren !== void 0 ? _refs$floating$curren : {};\n\n // Only HTMLElement instances have the `style` property.\n if (!(firstElementChild instanceof HTMLElement)) {\n return;\n }\n\n // Reduce the height of the popover to the available space.\n Object.assign(firstElementChild.style, {\n maxHeight: `${Math.max(0, sizeProps.availableHeight)}px`,\n overflow: 'auto'\n });\n }\n }), shift && shiftMiddleware({\n crossAxis: true,\n limiter: limitShift(),\n padding: 1 // Necessary to avoid flickering at the edge of the viewport.\n }), arrow({\n element: arrowRef\n })];\n const slotName = useContext(slotNameContext) || __unstableSlotName;\n const slot = useSlot(slotName);\n let onDialogClose;\n if (onClose || onFocusOutside) {\n onDialogClose = (type, event) => {\n // Ideally the popover should have just a single onClose prop and\n // not three props that potentially do the same thing.\n if (type === 'focus-outside') {\n // Check if this blur event is actually relevant to this popover\n const blurTarget = event?.target;\n const referenceElement = refs.reference.current;\n const floatingElement = refs.floating.current;\n\n // Check if blur is from this popover's reference element or its floating content\n const isBlurFromThisPopover = referenceElement && 'contains' in referenceElement && referenceElement.contains(blurTarget) || floatingElement?.contains(blurTarget);\n // Ignore blur events that don't originate from this popover when there's no\n // relatedTarget (next focus target) and focus moves to document.body.\n // This prevents incorrectly closing the popover when clicking on elements\n // that don't accept focus (like clicking outside to empty space).\n const ownerDocument = floatingElement?.ownerDocument;\n if (!isBlurFromThisPopover && !('relatedTarget' in event && event.relatedTarget) && ownerDocument?.activeElement === ownerDocument?.body) {\n return;\n }\n // Call onFocusOutside if defined or call onClose.\n if (onFocusOutside) {\n onFocusOutside(event);\n } else if (onClose) {\n onClose();\n }\n } else if (onClose) {\n // onClose should be called for other event types if it exists.\n onClose();\n }\n };\n }\n const [dialogRef, dialogProps] = useDialog({\n constrainTabbing,\n focusOnMount,\n __unstableOnClose: onDialogClose,\n // @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n onClose: onDialogClose\n });\n const {\n // Positioning coordinates\n x,\n y,\n // Object with \"regular\" refs to both \"reference\" and \"floating\"\n refs,\n // Type of CSS position property to use (absolute or fixed)\n strategy,\n update,\n placement: computedPlacement,\n middlewareData: {\n arrow: arrowData\n }\n } = useFloating({\n placement: normalizedPlacementFromProps === 'overlay' ? undefined : normalizedPlacementFromProps,\n middleware,\n whileElementsMounted: (referenceParam, floatingParam, updateParam) => autoUpdate(referenceParam, floatingParam, updateParam, {\n layoutShift: false,\n animationFrame: true\n })\n });\n const arrowCallbackRef = useCallback(node => {\n arrowRef.current = node;\n update();\n }, [update]);\n\n // When any of the possible anchor \"sources\" change,\n // recompute the reference element (real or virtual) and its owner document.\n\n const anchorRefTop = anchorRef?.top;\n const anchorRefBottom = anchorRef?.bottom;\n const anchorRefStartContainer = anchorRef?.startContainer;\n const anchorRefCurrent = anchorRef?.current;\n useLayoutEffect(() => {\n const resultingReferenceElement = getReferenceElement({\n anchor,\n anchorRef,\n anchorRect,\n getAnchorRect,\n fallbackReferenceElement\n });\n refs.setReference(resultingReferenceElement);\n }, [anchor, anchorRef, anchorRefTop, anchorRefBottom, anchorRefStartContainer, anchorRefCurrent, anchorRect, getAnchorRect, fallbackReferenceElement, refs]);\n const mergedFloatingRef = useMergeRefs([refs.setFloating, dialogRef, forwardedRef]);\n const style = isExpanded ? undefined : {\n position: strategy,\n top: 0,\n left: 0,\n // `x` and `y` are framer-motion specific props and are shorthands\n // for `translateX` and `translateY`. Currently it is not possible\n // to use `translateX` and `translateY` because those values would\n // be overridden by the return value of the\n // `placementToMotionAnimationProps` function.\n x: computePopoverPosition(x),\n y: computePopoverPosition(y)\n };\n const shouldReduceMotion = useReducedMotion();\n const shouldAnimate = animate && !isExpanded && !shouldReduceMotion;\n const [animationFinished, setAnimationFinished] = useState(false);\n const {\n style: motionInlineStyles,\n ...otherMotionProps\n } = useMemo(() => placementToMotionAnimationProps(computedPlacement), [computedPlacement]);\n const animationProps = shouldAnimate ? {\n style: {\n ...contentStyle,\n ...motionInlineStyles,\n ...style\n },\n onAnimationComplete: () => setAnimationFinished(true),\n ...otherMotionProps\n } : {\n animate: false,\n style: {\n ...contentStyle,\n ...style\n }\n };\n\n // When Floating UI has finished positioning and Framer Motion has finished animating\n // the popover, add the `is-positioned` class to signal that all transitions have finished.\n const isPositioned = (!shouldAnimate || animationFinished) && x !== null && y !== null;\n let content = /*#__PURE__*/_jsxs(motion.div, {\n className: clsx(className, {\n 'is-expanded': isExpanded,\n 'is-positioned': isPositioned,\n // Use the 'alternate' classname for 'toolbar' variant for back compat.\n [`is-${computedVariant === 'toolbar' ? 'alternate' : computedVariant}`]: computedVariant\n }),\n ...animationProps,\n ...contentProps,\n ref: mergedFloatingRef,\n ...dialogProps,\n tabIndex: -1,\n children: [isExpanded && /*#__PURE__*/_jsx(ScrollLock, {}), isExpanded && /*#__PURE__*/_jsxs(\"div\", {\n className: \"components-popover__header\",\n children: [/*#__PURE__*/_jsx(\"span\", {\n className: \"components-popover__header-title\",\n children: headerTitle\n }), /*#__PURE__*/_jsx(Button, {\n className: \"components-popover__close\",\n size: \"small\",\n icon: close,\n onClick: onClose,\n label: __('Close')\n })]\n }), /*#__PURE__*/_jsx(\"div\", {\n className: \"components-popover__content\",\n children: children\n }), hasArrow && /*#__PURE__*/_jsx(\"div\", {\n ref: arrowCallbackRef,\n className: ['components-popover__arrow', `is-${computedPlacement.split('-')[0]}`].join(' '),\n style: {\n left: typeof arrowData?.x !== 'undefined' && Number.isFinite(arrowData.x) ? `${arrowData.x}px` : '',\n top: typeof arrowData?.y !== 'undefined' && Number.isFinite(arrowData.y) ? `${arrowData.y}px` : ''\n },\n children: /*#__PURE__*/_jsx(ArrowTriangle, {})\n })]\n });\n const shouldRenderWithinSlot = slot.ref && !inline;\n const hasAnchor = anchorRef || anchorRect || anchor;\n if (shouldRenderWithinSlot) {\n content = /*#__PURE__*/_jsx(Fill, {\n name: slotName,\n children: content\n });\n } else if (!inline) {\n content = createPortal(/*#__PURE__*/_jsx(StyleProvider, {\n document: document,\n children: content\n }), getPopoverFallbackContainer());\n }\n if (hasAnchor) {\n return content;\n }\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(\"span\", {\n ref: anchorRefFallback\n }), content]\n });\n};\n\n// Export the PopoverSlot individually to allow typescript to pick the types up.\nexport const PopoverSlot = forwardRef(({\n name = SLOT_NAME\n}, ref) => {\n return /*#__PURE__*/_jsx(Slot, {\n bubblesVirtually: true,\n name: name,\n className: \"popover-slot\",\n ref: ref\n });\n});\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = Object.assign(contextConnect(UnforwardedPopover, 'Popover'), {\n /**\n * Renders a slot that is used internally by Popover for rendering content.\n */\n Slot: Object.assign(PopoverSlot, {\n displayName: 'Popover.Slot'\n }),\n /**\n * Provides a context to manage popover slot names.\n *\n * This is marked as unstable and should not be used directly.\n */\n __unstableSlotNameProvider: Object.assign(slotNameContext.Provider, {\n displayName: 'Popover.__unstableSlotNameProvider'\n })\n});\nexport default Popover;"],
5
- "mappings": ";AAIA,OAAO,UAAU;AACjB,SAAS,aAAa,QAAQ,gBAAgB,SAAS,iBAAiB,YAAY,YAAY,O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AACT,SAAoB,qBAAK,MAAM;AAAA,IAC7B,kBAAkB;AAAA,IAClB;AAAA,IACA,WAAW;AAAA,IACX;AAAA,EACF,CAAC;AACH,CAAC;AAyBM,IAAM,UAAU,OAAO,OAAO,eAAe,oBAAoB,SAAS,GAAG;AAAA;AAAA;AAAA;AAAA,EAIlF,MAAM,OAAO,OAAO,aAAa;AAAA,IAC/B,aAAa;AAAA,EACf,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMD,4BAA4B,OAAO,OAAO,gBAAgB,UAAU;AAAA,IAClE,aAAa;AAAA,EACf,CAAC;AACH,CAAC;AACD,IAAO,kBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\n\nimport clsx from 'clsx';\nimport { useFloating, flip as flipMiddleware, shift as shiftMiddleware, limitShift, autoUpdate, arrow, offset as offsetMiddleware, size } from '@floating-ui/react-dom';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useLayoutEffect, forwardRef, createContext, useContext, useMemo, useState, useCallback, createPortal } from '@wordpress/element';\nimport { useReducedMotion, useViewportMatch, useMergeRefs, __experimentalUseDialog as useDialog } from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport { computePopoverPosition, positionToPlacement, placementToMotionAnimationProps, getReferenceElement } from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nexport const SLOT_NAME = 'Popover';\n\n/**\n * Virtual padding to account for overflow boundaries.\n *\n * @type {number}\n */\nconst OVERFLOW_PADDING = 8;\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => /*#__PURE__*/_jsxs(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 100 100\",\n className: \"components-popover__triangle\",\n role: \"presentation\",\n children: [/*#__PURE__*/_jsx(Path, {\n className: \"components-popover__triangle-bg\",\n d: \"M 0 0 L 50 50 L 100 0\"\n }), /*#__PURE__*/_jsx(Path, {\n className: \"components-popover__triangle-border\",\n d: \"M 0 0 L 50 50 L 100 0\",\n vectorEffect: \"non-scaling-stroke\"\n })]\n});\nconst slotNameContext = createContext(undefined);\nslotNameContext.displayName = '__unstableSlotNameContext';\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n let container = document.body.querySelector('.' + fallbackContainerClassname);\n if (!container) {\n container = document.createElement('div');\n container.className = fallbackContainerClassname;\n document.body.append(container);\n }\n return container;\n};\nconst UnforwardedPopover = (props, forwardedRef) => {\n const {\n animate = true,\n headerTitle,\n constrainTabbing,\n onClose,\n children,\n className,\n noArrow = true,\n position,\n placement: placementProp = 'bottom-start',\n offset: offsetProp = 0,\n focusOnMount = 'firstElement',\n anchor,\n expandOnMobile,\n onFocusOutside,\n __unstableSlotName = SLOT_NAME,\n flip = true,\n resize = true,\n shift = false,\n inline = false,\n variant,\n style: contentStyle,\n // Deprecated props\n __unstableForcePosition,\n anchorRef,\n anchorRect,\n getAnchorRect,\n isAlternate,\n // Rest\n ...contentProps\n } = useContextSystem(props, 'Popover');\n let computedFlipProp = flip;\n let computedResizeProp = resize;\n if (__unstableForcePosition !== undefined) {\n deprecated('`__unstableForcePosition` prop in wp.components.Popover', {\n since: '6.1',\n version: '6.3',\n alternative: '`flip={ false }` and `resize={ false }`'\n });\n\n // Back-compat, set the `flip` and `resize` props\n // to `false` to replicate `__unstableForcePosition`.\n computedFlipProp = !__unstableForcePosition;\n computedResizeProp = !__unstableForcePosition;\n }\n if (anchorRef !== undefined) {\n deprecated('`anchorRef` prop in wp.components.Popover', {\n since: '6.1',\n alternative: '`anchor` prop'\n });\n }\n if (anchorRect !== undefined) {\n deprecated('`anchorRect` prop in wp.components.Popover', {\n since: '6.1',\n alternative: '`anchor` prop'\n });\n }\n if (getAnchorRect !== undefined) {\n deprecated('`getAnchorRect` prop in wp.components.Popover', {\n since: '6.1',\n alternative: '`anchor` prop'\n });\n }\n const computedVariant = isAlternate ? 'toolbar' : variant;\n if (isAlternate !== undefined) {\n deprecated('`isAlternate` prop in wp.components.Popover', {\n since: '6.2',\n alternative: \"`variant` prop with the `'toolbar'` value\"\n });\n }\n const arrowRef = useRef(null);\n const [fallbackReferenceElement, setFallbackReferenceElement] = useState(null);\n const anchorRefFallback = useCallback(node => {\n setFallbackReferenceElement(node);\n }, []);\n const isMobileViewport = useViewportMatch('medium', '<');\n const isExpanded = expandOnMobile && isMobileViewport;\n const hasArrow = !isExpanded && !noArrow;\n const normalizedPlacementFromProps = position ? positionToPlacement(position) : placementProp;\n const middleware = [...(placementProp === 'overlay' ? overlayMiddlewares() : []), offsetMiddleware(offsetProp), computedFlipProp && flipMiddleware(), computedResizeProp && size({\n padding: OVERFLOW_PADDING,\n apply(sizeProps) {\n const {\n firstElementChild\n } = refs.floating.current ?? {};\n\n // Only HTMLElement instances have the `style` property.\n if (!(firstElementChild instanceof HTMLElement)) {\n return;\n }\n\n // Reduce the height of the popover to the available space.\n Object.assign(firstElementChild.style, {\n maxHeight: `${Math.max(0, sizeProps.availableHeight)}px`,\n overflow: 'auto'\n });\n }\n }), shift && shiftMiddleware({\n crossAxis: true,\n limiter: limitShift(),\n padding: 1 // Necessary to avoid flickering at the edge of the viewport.\n }), arrow({\n element: arrowRef\n })];\n const slotName = useContext(slotNameContext) || __unstableSlotName;\n const slot = useSlot(slotName);\n let onDialogClose;\n if (onClose || onFocusOutside) {\n onDialogClose = (type, event) => {\n // Ideally the popover should have just a single onClose prop and\n // not three props that potentially do the same thing.\n if (type === 'focus-outside') {\n // Check if this blur event is actually relevant to this popover\n const blurTarget = event?.target;\n const referenceElement = refs.reference.current;\n const floatingElement = refs.floating.current;\n\n // Check if blur is from this popover's reference element or its floating content\n const isBlurFromThisPopover = referenceElement && 'contains' in referenceElement && referenceElement.contains(blurTarget) || floatingElement?.contains(blurTarget);\n // Ignore blur events that don't originate from this popover when there's no\n // relatedTarget (next focus target) and focus moves to document.body.\n // This prevents incorrectly closing the popover when clicking on elements\n // that don't accept focus (like clicking outside to empty space).\n const ownerDocument = floatingElement?.ownerDocument;\n if (!isBlurFromThisPopover && !('relatedTarget' in event && event.relatedTarget) && ownerDocument?.activeElement === ownerDocument?.body) {\n return;\n }\n // Call onFocusOutside if defined or call onClose.\n if (onFocusOutside) {\n onFocusOutside(event);\n } else if (onClose) {\n onClose();\n }\n } else if (onClose) {\n // onClose should be called for other event types if it exists.\n onClose();\n }\n };\n }\n const [dialogRef, dialogProps] = useDialog({\n constrainTabbing,\n focusOnMount,\n __unstableOnClose: onDialogClose,\n // @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n onClose: onDialogClose\n });\n const {\n // Positioning coordinates\n x,\n y,\n // Object with \"regular\" refs to both \"reference\" and \"floating\"\n refs,\n // Type of CSS position property to use (absolute or fixed)\n strategy,\n update,\n placement: computedPlacement,\n middlewareData: {\n arrow: arrowData\n }\n } = useFloating({\n placement: normalizedPlacementFromProps === 'overlay' ? undefined : normalizedPlacementFromProps,\n middleware,\n whileElementsMounted: (referenceParam, floatingParam, updateParam) => autoUpdate(referenceParam, floatingParam, updateParam, {\n layoutShift: false,\n animationFrame: true\n })\n });\n const arrowCallbackRef = useCallback(node => {\n arrowRef.current = node;\n update();\n }, [update]);\n\n // When any of the possible anchor \"sources\" change,\n // recompute the reference element (real or virtual) and its owner document.\n\n const anchorRefTop = anchorRef?.top;\n const anchorRefBottom = anchorRef?.bottom;\n const anchorRefStartContainer = anchorRef?.startContainer;\n const anchorRefCurrent = anchorRef?.current;\n useLayoutEffect(() => {\n const resultingReferenceElement = getReferenceElement({\n anchor,\n anchorRef,\n anchorRect,\n getAnchorRect,\n fallbackReferenceElement\n });\n refs.setReference(resultingReferenceElement);\n }, [anchor, anchorRef, anchorRefTop, anchorRefBottom, anchorRefStartContainer, anchorRefCurrent, anchorRect, getAnchorRect, fallbackReferenceElement, refs]);\n const mergedFloatingRef = useMergeRefs([refs.setFloating, dialogRef, forwardedRef]);\n const style = isExpanded ? undefined : {\n position: strategy,\n top: 0,\n left: 0,\n // `x` and `y` are framer-motion specific props and are shorthands\n // for `translateX` and `translateY`. Currently it is not possible\n // to use `translateX` and `translateY` because those values would\n // be overridden by the return value of the\n // `placementToMotionAnimationProps` function.\n x: computePopoverPosition(x),\n y: computePopoverPosition(y)\n };\n const shouldReduceMotion = useReducedMotion();\n const shouldAnimate = animate && !isExpanded && !shouldReduceMotion;\n const [animationFinished, setAnimationFinished] = useState(false);\n const {\n style: motionInlineStyles,\n ...otherMotionProps\n } = useMemo(() => placementToMotionAnimationProps(computedPlacement), [computedPlacement]);\n const animationProps = shouldAnimate ? {\n style: {\n ...contentStyle,\n ...motionInlineStyles,\n ...style\n },\n onAnimationComplete: () => setAnimationFinished(true),\n ...otherMotionProps\n } : {\n animate: false,\n style: {\n ...contentStyle,\n ...style\n }\n };\n\n // When Floating UI has finished positioning and Framer Motion has finished animating\n // the popover, add the `is-positioned` class to signal that all transitions have finished.\n const isPositioned = (!shouldAnimate || animationFinished) && x !== null && y !== null;\n let content = /*#__PURE__*/_jsxs(motion.div, {\n className: clsx(className, {\n 'is-expanded': isExpanded,\n 'is-positioned': isPositioned,\n // Use the 'alternate' classname for 'toolbar' variant for back compat.\n [`is-${computedVariant === 'toolbar' ? 'alternate' : computedVariant}`]: computedVariant\n }),\n ...animationProps,\n ...contentProps,\n ref: mergedFloatingRef,\n ...dialogProps,\n tabIndex: -1,\n children: [isExpanded && /*#__PURE__*/_jsx(ScrollLock, {}), isExpanded && /*#__PURE__*/_jsxs(\"div\", {\n className: \"components-popover__header\",\n children: [/*#__PURE__*/_jsx(\"span\", {\n className: \"components-popover__header-title\",\n children: headerTitle\n }), /*#__PURE__*/_jsx(Button, {\n className: \"components-popover__close\",\n size: \"small\",\n icon: close,\n onClick: onClose,\n label: __('Close')\n })]\n }), /*#__PURE__*/_jsx(\"div\", {\n className: \"components-popover__content\",\n children: children\n }), hasArrow && /*#__PURE__*/_jsx(\"div\", {\n ref: arrowCallbackRef,\n className: ['components-popover__arrow', `is-${computedPlacement.split('-')[0]}`].join(' '),\n style: {\n left: typeof arrowData?.x !== 'undefined' && Number.isFinite(arrowData.x) ? `${arrowData.x}px` : '',\n top: typeof arrowData?.y !== 'undefined' && Number.isFinite(arrowData.y) ? `${arrowData.y}px` : ''\n },\n children: /*#__PURE__*/_jsx(ArrowTriangle, {})\n })]\n });\n const shouldRenderWithinSlot = slot.ref && !inline;\n const hasAnchor = anchorRef || anchorRect || anchor;\n if (shouldRenderWithinSlot) {\n content = /*#__PURE__*/_jsx(Fill, {\n name: slotName,\n children: content\n });\n } else if (!inline) {\n content = createPortal(/*#__PURE__*/_jsx(StyleProvider, {\n document: document,\n children: content\n }), getPopoverFallbackContainer());\n }\n if (hasAnchor) {\n return content;\n }\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [/*#__PURE__*/_jsx(\"span\", {\n ref: anchorRefFallback\n }), content]\n });\n};\n\n// Export the PopoverSlot individually to allow typescript to pick the types up.\nexport const PopoverSlot = forwardRef(({\n name = SLOT_NAME\n}, ref) => {\n return /*#__PURE__*/_jsx(Slot, {\n bubblesVirtually: true,\n name: name,\n className: \"popover-slot\",\n ref: ref\n });\n});\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = Object.assign(contextConnect(UnforwardedPopover, 'Popover'), {\n /**\n * Renders a slot that is used internally by Popover for rendering content.\n */\n Slot: Object.assign(PopoverSlot, {\n displayName: 'Popover.Slot'\n }),\n /**\n * Provides a context to manage popover slot names.\n *\n * This is marked as unstable and should not be used directly.\n */\n __unstableSlotNameProvider: Object.assign(slotNameContext.Provider, {\n displayName: 'Popover.__unstableSlotNameProvider'\n })\n});\nexport default Popover;"],
5
+ "mappings": ";AAIA,OAAO,UAAU;AACjB,SAAS,aAAa,QAAQ,gBAAgB,SAAS,iBAAiB,YAAY,YAAY,OAAO,UAAU,kBAAkB,YAAY;AAC/I,SAAS,cAAc;AAKvB,SAAS,QAAQ,iBAAiB,YAAY,eAAe,YAAY,SAAS,UAAU,aAAa,oBAAoB;AAC7H,SAAS,kBAAkB,kBAAkB,cAAc,2BAA2B,iBAAiB;AACvG,SAAS,aAAa;AACtB,OAAO,gBAAgB;AACvB,SAAS,MAAM,WAAW;AAC1B,SAAS,UAAU;AAKnB,OAAO,YAAY;AACnB,OAAO,gBAAgB;AACvB,SAAS,MAAM,MAAM,eAAe;AACpC,SAAS,wBAAwB,qBAAqB,iCAAiC,2BAA2B;AAClH,SAAS,gBAAgB,wBAAwB;AACjD,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAO9B,SAAS,OAAO,MAAM,QAAQ,OAAO,YAAY,iBAAiB;AAC3D,IAAM,YAAY;AAOzB,IAAM,mBAAmB;AAMzB,IAAM,gBAAgB,MAAmB,sBAAM,KAAK;AAAA,EAClD,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C;AAAA,IAC/C,CAAC,CAAC;AAAA,EACJ,CAAC;AACD,QAAM,yBAAyB,KAAK,OAAO,CAAC;AAC5C,QAAM,YAAY,aAAa,cAAc;AAC7C,MAAI,wBAAwB;AAC1B,cAAuB,qBAAK,MAAM;AAAA,MAChC,MAAM;AAAA,MACN,UAAU;AAAA,IACZ,CAAC;AAAA,EACH,WAAW,CAAC,QAAQ;AAClB,cAAU,aAA0B,qBAAK,eAAe;AAAA,MACtD;AAAA,MACA,UAAU;AAAA,IACZ,CAAC,GAAG,4BAA4B,CAAC;AAAA,EACnC;AACA,MAAI,WAAW;AACb,WAAO;AAAA,EACT;AACA,SAAoB,sBAAM,WAAW;AAAA,IACnC,UAAU,CAAc,qBAAK,QAAQ;AAAA,MACnC,KAAK;AAAA,IACP,CAAC,GAAG,OAAO;AAAA,EACb,CAAC;AACH;AAGO,IAAM,cAAc,WAAW,CAAC;AAAA,EACrC,OAAO;AACT,GAAG,QAAQ;AACT,SAAoB,qBAAK,MAAM;AAAA,IAC7B,kBAAkB;AAAA,IAClB;AAAA,IACA,WAAW;AAAA,IACX;AAAA,EACF,CAAC;AACH,CAAC;AAyBM,IAAM,UAAU,OAAO,OAAO,eAAe,oBAAoB,SAAS,GAAG;AAAA;AAAA;AAAA;AAAA,EAIlF,MAAM,OAAO,OAAO,aAAa;AAAA,IAC/B,aAAa;AAAA,EACf,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMD,4BAA4B,OAAO,OAAO,gBAAgB,UAAU;AAAA,IAClE,aAAa;AAAA,EACf,CAAC;AACH,CAAC;AACD,IAAO,kBAAQ;",
6
6
  "names": []
7
7
  }
@@ -13,10 +13,9 @@ function overlayMiddlewares() {
13
13
  rects,
14
14
  elements
15
15
  }) {
16
- var _elements$floating;
17
16
  const {
18
17
  firstElementChild
19
- } = (_elements$floating = elements.floating) !== null && _elements$floating !== void 0 ? _elements$floating : {};
18
+ } = elements.floating ?? {};
20
19
  if (!(firstElementChild instanceof HTMLElement)) {
21
20
  return;
22
21
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/popover/overlay-middlewares.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\n\nimport { size } from '@floating-ui/react-dom';\nexport function overlayMiddlewares() {\n return [{\n name: 'overlay',\n fn({\n rects\n }) {\n return rects.reference;\n }\n }, size({\n apply({\n rects,\n elements\n }) {\n var _elements$floating;\n const {\n firstElementChild\n } = (_elements$floating = elements.floating) !== null && _elements$floating !== void 0 ? _elements$floating : {};\n\n // Only HTMLElement instances have the `style` property.\n if (!(firstElementChild instanceof HTMLElement)) {\n return;\n }\n\n // Reduce the height of the popover to the available space.\n Object.assign(firstElementChild.style, {\n width: `${rects.reference.width}px`,\n height: `${rects.reference.height}px`\n });\n }\n })];\n}"],
5
- "mappings": ";AAIA,SAAS,YAAY;AACd,SAAS,qBAAqB;AACnC,SAAO,CAAC;AAAA,IACN,MAAM;AAAA,IACN,GAAG;AAAA,MACD;AAAA,IACF,GAAG;AACD,aAAO,MAAM;AAAA,IACf;AAAA,EACF,GAAG,KAAK;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,MACA;AAAA,IACF,GAAG;AACD,UAAI;AACJ,YAAM;AAAA,QACJ;AAAA,MACF,KAAK,qBAAqB,SAAS,cAAc,QAAQ,uBAAuB,SAAS,qBAAqB,CAAC;AAG/G,UAAI,EAAE,6BAA6B,cAAc;AAC/C;AAAA,MACF;AAGA,aAAO,OAAO,kBAAkB,OAAO;AAAA,QACrC,OAAO,GAAG,MAAM,UAAU,KAAK;AAAA,QAC/B,QAAQ,GAAG,MAAM,UAAU,MAAM;AAAA,MACnC,CAAC;AAAA,IACH;AAAA,EACF,CAAC,CAAC;AACJ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\n\nimport { size } from '@floating-ui/react-dom';\nexport function overlayMiddlewares() {\n return [{\n name: 'overlay',\n fn({\n rects\n }) {\n return rects.reference;\n }\n }, size({\n apply({\n rects,\n elements\n }) {\n const {\n firstElementChild\n } = elements.floating ?? {};\n\n // Only HTMLElement instances have the `style` property.\n if (!(firstElementChild instanceof HTMLElement)) {\n return;\n }\n\n // Reduce the height of the popover to the available space.\n Object.assign(firstElementChild.style, {\n width: `${rects.reference.width}px`,\n height: `${rects.reference.height}px`\n });\n }\n })];\n}"],
5
+ "mappings": ";AAIA,SAAS,YAAY;AACd,SAAS,qBAAqB;AACnC,SAAO,CAAC;AAAA,IACN,MAAM;AAAA,IACN,GAAG;AAAA,MACD;AAAA,IACF,GAAG;AACD,aAAO,MAAM;AAAA,IACf;AAAA,EACF,GAAG,KAAK;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,MACA;AAAA,IACF,GAAG;AACD,YAAM;AAAA,QACJ;AAAA,MACF,IAAI,SAAS,YAAY,CAAC;AAG1B,UAAI,EAAE,6BAA6B,cAAc;AAC/C;AAAA,MACF;AAGA,aAAO,OAAO,kBAAkB,OAAO;AAAA,QACrC,OAAO,GAAG,MAAM,UAAU,KAAK;AAAA,QAC/B,QAAQ,GAAG,MAAM,UAAU,MAAM;AAAA,MACnC,CAAC;AAAA,IACH;AAAA,EACF,CAAC,CAAC;AACJ;",
6
6
  "names": []
7
7
  }
@@ -53,10 +53,7 @@ var POSITION_TO_PLACEMENT = {
53
53
  "middle center right": "bottom",
54
54
  "middle center top": "bottom"
55
55
  };
56
- var positionToPlacement = (position) => {
57
- var _POSITION_TO_PLACEMEN;
58
- return (_POSITION_TO_PLACEMEN = POSITION_TO_PLACEMENT[position]) !== null && _POSITION_TO_PLACEMEN !== void 0 ? _POSITION_TO_PLACEMEN : "bottom";
59
- };
56
+ var positionToPlacement = (position) => POSITION_TO_PLACEMENT[position] ?? "bottom";
60
57
  var PLACEMENT_TO_ANIMATION_ORIGIN = {
61
58
  top: {
62
59
  originX: 0.5,
@@ -162,7 +159,6 @@ var getReferenceElement = ({
162
159
  getAnchorRect,
163
160
  fallbackReferenceElement
164
161
  }) => {
165
- var _referenceElement;
166
162
  let referenceElement = null;
167
163
  if (anchor) {
168
164
  referenceElement = anchor;
@@ -187,15 +183,14 @@ var getReferenceElement = ({
187
183
  } else if (getAnchorRect) {
188
184
  referenceElement = {
189
185
  getBoundingClientRect() {
190
- var _rect$x, _rect$y, _rect$width, _rect$height;
191
186
  const rect = getAnchorRect(fallbackReferenceElement);
192
- return new window.DOMRect((_rect$x = rect.x) !== null && _rect$x !== void 0 ? _rect$x : rect.left, (_rect$y = rect.y) !== null && _rect$y !== void 0 ? _rect$y : rect.top, (_rect$width = rect.width) !== null && _rect$width !== void 0 ? _rect$width : rect.right - rect.left, (_rect$height = rect.height) !== null && _rect$height !== void 0 ? _rect$height : rect.bottom - rect.top);
187
+ return new window.DOMRect(rect.x ?? rect.left, rect.y ?? rect.top, rect.width ?? rect.right - rect.left, rect.height ?? rect.bottom - rect.top);
193
188
  }
194
189
  };
195
190
  } else if (fallbackReferenceElement) {
196
191
  referenceElement = fallbackReferenceElement.parentElement;
197
192
  }
198
- return (_referenceElement = referenceElement) !== null && _referenceElement !== void 0 ? _referenceElement : null;
193
+ return referenceElement ?? null;
199
194
  };
200
195
  var computePopoverPosition = (c) => c === null || Number.isNaN(c) ? void 0 : Math.round(c);
201
196
  export {