@wordpress/components 33.0.1-next.v.202604201441.0 → 33.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 (870) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/build/alignment-matrix-control/cell.cjs +79 -5
  3. package/build/alignment-matrix-control/cell.cjs.map +3 -3
  4. package/build/alignment-matrix-control/index.cjs +79 -5
  5. package/build/alignment-matrix-control/index.cjs.map +3 -3
  6. package/build/angle-picker-control/angle-circle.cjs +79 -5
  7. package/build/angle-picker-control/angle-circle.cjs.map +3 -3
  8. package/build/autocomplete/autocompleter-ui.cjs.map +2 -2
  9. package/build/color-palette/index.cjs +14 -8
  10. package/build/color-palette/index.cjs.map +2 -2
  11. package/build/color-palette/utils.cjs +9 -2
  12. package/build/color-palette/utils.cjs.map +2 -2
  13. package/build/color-picker/hex-input.cjs +1 -1
  14. package/build/color-picker/hex-input.cjs.map +2 -2
  15. package/build/custom-gradient-picker/index.cjs.map +2 -2
  16. package/build/focal-point-picker/index.cjs.map +2 -2
  17. package/build/form-token-field/index.cjs +22 -6
  18. package/build/form-token-field/index.cjs.map +3 -3
  19. package/build/form-token-field/token-input.cjs +1 -1
  20. package/build/form-token-field/token-input.cjs.map +2 -2
  21. package/build/menu/popover.cjs +7 -3
  22. package/build/menu/popover.cjs.map +2 -2
  23. package/build/menu/styles.cjs +39 -16
  24. package/build/menu/styles.cjs.map +2 -2
  25. package/build/modal/index.cjs +1 -5
  26. package/build/modal/index.cjs.map +2 -2
  27. package/build/modal/use-modal-exit-animation.cjs +52 -41
  28. package/build/modal/use-modal-exit-animation.cjs.map +2 -2
  29. package/build/palette-edit/index.cjs.map +2 -2
  30. package/build/slot-fill/fill.cjs +2 -2
  31. package/build/slot-fill/fill.cjs.map +2 -2
  32. package/build/style-provider/index.cjs +82 -3
  33. package/build/style-provider/index.cjs.map +4 -4
  34. package/build/text/styles.cjs +7 -7
  35. package/build/text/styles.cjs.map +2 -2
  36. package/build/utils/breakpoint.cjs.map +1 -1
  37. package/build/utils/config-values.cjs +3 -0
  38. package/build/utils/config-values.cjs.map +2 -2
  39. package/build/utils/dropdown-motion.cjs +2 -2
  40. package/build/utils/dropdown-motion.cjs.map +2 -2
  41. package/build/utils/font.cjs.map +1 -1
  42. package/build/visually-hidden/component.cjs +1 -0
  43. package/build/visually-hidden/component.cjs.map +2 -2
  44. package/build-module/alignment-matrix-control/cell.mjs +79 -5
  45. package/build-module/alignment-matrix-control/cell.mjs.map +3 -3
  46. package/build-module/alignment-matrix-control/index.mjs +79 -5
  47. package/build-module/alignment-matrix-control/index.mjs.map +3 -3
  48. package/build-module/angle-picker-control/angle-circle.mjs +79 -5
  49. package/build-module/angle-picker-control/angle-circle.mjs.map +3 -3
  50. package/build-module/autocomplete/autocompleter-ui.mjs.map +2 -2
  51. package/build-module/color-palette/index.mjs +14 -8
  52. package/build-module/color-palette/index.mjs.map +2 -2
  53. package/build-module/color-palette/utils.mjs +9 -2
  54. package/build-module/color-palette/utils.mjs.map +2 -2
  55. package/build-module/color-picker/hex-input.mjs +1 -1
  56. package/build-module/color-picker/hex-input.mjs.map +2 -2
  57. package/build-module/custom-gradient-picker/index.mjs.map +2 -2
  58. package/build-module/focal-point-picker/index.mjs.map +2 -2
  59. package/build-module/form-token-field/index.mjs +22 -6
  60. package/build-module/form-token-field/index.mjs.map +2 -2
  61. package/build-module/form-token-field/token-input.mjs +1 -1
  62. package/build-module/form-token-field/token-input.mjs.map +2 -2
  63. package/build-module/menu/popover.mjs +7 -3
  64. package/build-module/menu/popover.mjs.map +2 -2
  65. package/build-module/menu/styles.mjs +37 -16
  66. package/build-module/menu/styles.mjs.map +2 -2
  67. package/build-module/modal/index.mjs +1 -5
  68. package/build-module/modal/index.mjs.map +2 -2
  69. package/build-module/modal/use-modal-exit-animation.mjs +52 -41
  70. package/build-module/modal/use-modal-exit-animation.mjs.map +2 -2
  71. package/build-module/palette-edit/index.mjs.map +2 -2
  72. package/build-module/slot-fill/fill.mjs +2 -2
  73. package/build-module/slot-fill/fill.mjs.map +2 -2
  74. package/build-module/style-provider/index.mjs +82 -3
  75. package/build-module/style-provider/index.mjs.map +4 -4
  76. package/build-module/text/styles.mjs +7 -7
  77. package/build-module/text/styles.mjs.map +2 -2
  78. package/build-module/utils/breakpoint.mjs.map +1 -1
  79. package/build-module/utils/config-values.mjs +3 -0
  80. package/build-module/utils/config-values.mjs.map +2 -2
  81. package/build-module/utils/dropdown-motion.mjs +2 -2
  82. package/build-module/utils/dropdown-motion.mjs.map +2 -2
  83. package/build-module/utils/font.mjs.map +1 -1
  84. package/build-module/visually-hidden/component.mjs +1 -0
  85. package/build-module/visually-hidden/component.mjs.map +2 -2
  86. package/build-style/style-rtl.css +90 -34
  87. package/build-style/style.css +90 -34
  88. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  89. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  90. package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
  91. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  92. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  93. package/build-types/angle-picker-control/index.d.ts +1 -1
  94. package/build-types/angle-picker-control/index.d.ts.map +1 -1
  95. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  96. package/build-types/angle-picker-control/stories/index.story.d.ts.map +1 -1
  97. package/build-types/animate/index.d.ts.map +1 -1
  98. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  99. package/build-types/autocomplete/autocompleter-ui.d.ts +1 -1
  100. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  101. package/build-types/autocomplete/get-default-use-items.d.ts.map +1 -1
  102. package/build-types/autocomplete/index.d.ts +3 -3
  103. package/build-types/autocomplete/index.d.ts.map +1 -1
  104. package/build-types/badge/index.d.ts.map +1 -1
  105. package/build-types/badge/stories/index.story.d.ts.map +1 -1
  106. package/build-types/base-control/hooks.d.ts +4 -4
  107. package/build-types/base-control/index.d.ts +2 -2
  108. package/build-types/base-control/index.d.ts.map +1 -1
  109. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  110. package/build-types/border-box-control/border-box-control/component.d.ts +4 -4
  111. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  112. package/build-types/border-box-control/border-box-control/hook.d.ts +124 -124
  113. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  114. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  115. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +117 -117
  116. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +4 -4
  117. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  118. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +116 -116
  119. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
  120. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +106 -106
  121. package/build-types/border-box-control/stories/index.story.d.ts +5 -5
  122. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  123. package/build-types/border-box-control/styles.d.ts +3 -3
  124. package/build-types/border-box-control/styles.d.ts.map +1 -1
  125. package/build-types/border-box-control/utils.d.ts.map +1 -1
  126. package/build-types/border-control/border-control/component.d.ts +5 -5
  127. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  128. package/build-types/border-control/border-control/hook.d.ts +129 -129
  129. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  130. package/build-types/border-control/border-control-dropdown/component.d.ts +3 -3
  131. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  132. package/build-types/border-control/border-control-dropdown/hook.d.ts +122 -122
  133. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  134. package/build-types/border-control/border-control-style-picker/component.d.ts +1 -1
  135. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  136. package/build-types/border-control/stories/index.story.d.ts +30 -30
  137. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  138. package/build-types/border-control/styles.d.ts +2 -2
  139. package/build-types/border-control/styles.d.ts.map +1 -1
  140. package/build-types/box-control/index.d.ts +1 -1
  141. package/build-types/box-control/index.d.ts.map +1 -1
  142. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  143. package/build-types/box-control/styles/box-control-styles.d.ts +15 -15
  144. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  145. package/build-types/box-control/utils.d.ts +2 -2
  146. package/build-types/box-control/utils.d.ts.map +1 -1
  147. package/build-types/button/deprecated.d.ts +34 -34
  148. package/build-types/button/deprecated.d.ts.map +1 -1
  149. package/build-types/button/index.d.ts.map +1 -1
  150. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  151. package/build-types/button/stories/index.story.d.ts.map +1 -1
  152. package/build-types/button-group/index.d.ts.map +1 -1
  153. package/build-types/button-group/stories/index.story.d.ts.map +1 -1
  154. package/build-types/calendar/date-calendar/index.d.ts.map +1 -1
  155. package/build-types/calendar/date-range-calendar/index.d.ts +1 -1
  156. package/build-types/calendar/date-range-calendar/index.d.ts.map +1 -1
  157. package/build-types/calendar/stories/date-calendar.story.d.ts.map +1 -1
  158. package/build-types/calendar/stories/date-range-calendar.story.d.ts.map +1 -1
  159. package/build-types/calendar/test/__utils__/index.d.ts.map +1 -1
  160. package/build-types/calendar/utils/constants.d.ts +2 -2
  161. package/build-types/calendar/utils/constants.d.ts.map +1 -1
  162. package/build-types/calendar/utils/use-localization-props.d.ts +3 -3
  163. package/build-types/calendar/utils/use-localization-props.d.ts.map +1 -1
  164. package/build-types/card/card/component.d.ts.map +1 -1
  165. package/build-types/card/card/hook.d.ts +110 -110
  166. package/build-types/card/card-body/component.d.ts.map +1 -1
  167. package/build-types/card/card-body/hook.d.ts +107 -107
  168. package/build-types/card/card-divider/component.d.ts +2 -2
  169. package/build-types/card/card-divider/component.d.ts.map +1 -1
  170. package/build-types/card/card-divider/hook.d.ts +108 -108
  171. package/build-types/card/card-footer/component.d.ts.map +1 -1
  172. package/build-types/card/card-footer/hook.d.ts +113 -113
  173. package/build-types/card/card-header/component.d.ts.map +1 -1
  174. package/build-types/card/card-header/hook.d.ts +113 -113
  175. package/build-types/card/card-media/component.d.ts.map +1 -1
  176. package/build-types/card/card-media/hook.d.ts +106 -106
  177. package/build-types/card/get-padding-by-size.d.ts +1 -1
  178. package/build-types/card/get-padding-by-size.d.ts.map +1 -1
  179. package/build-types/card/stories/index.story.d.ts +0 -6
  180. package/build-types/card/stories/index.story.d.ts.map +1 -1
  181. package/build-types/checkbox-control/index.d.ts.map +1 -1
  182. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  183. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts +1 -1
  184. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  185. package/build-types/circular-option-picker/circular-option-picker.d.ts +8 -0
  186. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  187. package/build-types/circular-option-picker/index.d.ts.map +1 -1
  188. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  189. package/build-types/color-indicator/index.d.ts +1 -1
  190. package/build-types/color-indicator/index.d.ts.map +1 -1
  191. package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
  192. package/build-types/color-palette/index.d.ts.map +1 -1
  193. package/build-types/color-palette/stories/index.story.d.ts +1 -0
  194. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  195. package/build-types/color-palette/styles.d.ts +5 -5
  196. package/build-types/color-palette/types.d.ts +16 -2
  197. package/build-types/color-palette/types.d.ts.map +1 -1
  198. package/build-types/color-palette/utils.d.ts +1 -1
  199. package/build-types/color-palette/utils.d.ts.map +1 -1
  200. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  201. package/build-types/color-picker/color-input.d.ts.map +1 -1
  202. package/build-types/color-picker/component.d.ts +1 -1
  203. package/build-types/color-picker/component.d.ts.map +1 -1
  204. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  205. package/build-types/color-picker/hsl-input.d.ts.map +1 -1
  206. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  207. package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
  208. package/build-types/color-picker/picker.d.ts.map +1 -1
  209. package/build-types/color-picker/rgb-input.d.ts.map +1 -1
  210. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  211. package/build-types/color-picker/styles.d.ts +20 -20
  212. package/build-types/color-picker/styles.d.ts.map +1 -1
  213. package/build-types/combobox-control/index.d.ts.map +1 -1
  214. package/build-types/combobox-control/stories/index.story.d.ts +8 -8
  215. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  216. package/build-types/combobox-control/styles.d.ts +1 -1
  217. package/build-types/composite/index.d.ts +25 -25
  218. package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -1
  219. package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
  220. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  221. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  222. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  223. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  224. package/build-types/context/constants.d.ts +3 -3
  225. package/build-types/context/constants.d.ts.map +1 -1
  226. package/build-types/context/context-system-provider.d.ts +4 -4
  227. package/build-types/context/context-system-provider.d.ts.map +1 -1
  228. package/build-types/context/use-context-system.d.ts +4 -4
  229. package/build-types/context/use-context-system.d.ts.map +1 -1
  230. package/build-types/context/utils.d.ts +2 -2
  231. package/build-types/context/utils.d.ts.map +1 -1
  232. package/build-types/custom-gradient-picker/constants.d.ts +2 -2
  233. package/build-types/custom-gradient-picker/constants.d.ts.map +1 -1
  234. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +1 -1
  235. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  236. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +1 -1
  237. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
  238. package/build-types/custom-gradient-picker/index.d.ts +1 -1
  239. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  240. package/build-types/custom-gradient-picker/serializer.d.ts +3 -3
  241. package/build-types/custom-gradient-picker/serializer.d.ts.map +1 -1
  242. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  243. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +2 -2
  244. package/build-types/custom-select-control/index.d.ts.map +1 -1
  245. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  246. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  247. package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
  248. package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
  249. package/build-types/custom-select-control-v2/stories/index.story.d.ts +6 -6
  250. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  251. package/build-types/custom-select-control-v2/styles.d.ts +6 -6
  252. package/build-types/dashicon/index.d.ts.map +1 -1
  253. package/build-types/date-time/date-picker/index.d.ts +1 -1
  254. package/build-types/date-time/date-picker/index.d.ts.map +1 -1
  255. package/build-types/date-time/date-picker/styles.d.ts +9 -9
  256. package/build-types/date-time/date-picker/use-lilius/index.d.ts.map +1 -1
  257. package/build-types/date-time/date-time/index.d.ts +1 -1
  258. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  259. package/build-types/date-time/date-time/styles.d.ts +4 -4
  260. package/build-types/date-time/index.d.ts.map +1 -1
  261. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  262. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  263. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  264. package/build-types/date-time/time-picker/index.d.ts +1 -1
  265. package/build-types/date-time/time-picker/index.d.ts.map +1 -1
  266. package/build-types/date-time/time-picker/styles.d.ts +28 -28
  267. package/build-types/date-time/time-picker/time-input/index.d.ts +1 -1
  268. package/build-types/date-time/time-picker/time-input/index.d.ts.map +1 -1
  269. package/build-types/date-time/time-picker/timezone.d.ts.map +1 -1
  270. package/build-types/date-time/utils.d.ts.map +1 -1
  271. package/build-types/disabled/context.d.ts.map +1 -1
  272. package/build-types/disabled/index.d.ts +2 -0
  273. package/build-types/disabled/index.d.ts.map +1 -1
  274. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  275. package/build-types/disclosure/index.d.ts.map +1 -1
  276. package/build-types/divider/component.d.ts +2 -2
  277. package/build-types/divider/component.d.ts.map +1 -1
  278. package/build-types/divider/stories/index.story.d.ts.map +1 -1
  279. package/build-types/divider/styles.d.ts +2 -2
  280. package/build-types/draggable/index.d.ts +1 -1
  281. package/build-types/draggable/index.d.ts.map +1 -1
  282. package/build-types/draggable/stories/index.story.d.ts.map +1 -1
  283. package/build-types/drop-zone/index.d.ts.map +1 -1
  284. package/build-types/drop-zone/provider.d.ts +1 -1
  285. package/build-types/drop-zone/provider.d.ts.map +1 -1
  286. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  287. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  288. package/build-types/dropdown/dropdown-content-wrapper.d.ts.map +1 -1
  289. package/build-types/dropdown/index.d.ts.map +1 -1
  290. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  291. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  292. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  293. package/build-types/duotone-picker/color-list-picker/index.d.ts +1 -1
  294. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  295. package/build-types/duotone-picker/custom-duotone-bar.d.ts +1 -1
  296. package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -1
  297. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  298. package/build-types/duotone-picker/duotone-swatch.d.ts.map +1 -1
  299. package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
  300. package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
  301. package/build-types/elevation/component.d.ts.map +1 -1
  302. package/build-types/elevation/hook.d.ts +105 -105
  303. package/build-types/elevation/stories/index.story.d.ts.map +1 -1
  304. package/build-types/external-link/index.d.ts.map +1 -1
  305. package/build-types/external-link/stories/index.story.d.ts.map +1 -1
  306. package/build-types/flex/context.d.ts +2 -2
  307. package/build-types/flex/flex/component.d.ts.map +1 -1
  308. package/build-types/flex/flex/hook.d.ts +108 -108
  309. package/build-types/flex/flex-block/component.d.ts.map +1 -1
  310. package/build-types/flex/flex-block/hook.d.ts +106 -106
  311. package/build-types/flex/flex-item/component.d.ts.map +1 -1
  312. package/build-types/flex/flex-item/hook.d.ts +106 -106
  313. package/build-types/flex/stories/index.story.d.ts.map +1 -1
  314. package/build-types/focal-point-picker/controls.d.ts +1 -1
  315. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  316. package/build-types/focal-point-picker/index.d.ts +16 -11
  317. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  318. package/build-types/focal-point-picker/stories/index.story.d.ts +16 -16
  319. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  320. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +254 -254
  321. package/build-types/focal-point-picker/utils.d.ts.map +1 -1
  322. package/build-types/font-size-picker/constants.d.ts +2 -2
  323. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  324. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  325. package/build-types/font-size-picker/index.d.ts.map +1 -1
  326. package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +1 -1
  327. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  328. package/build-types/font-size-picker/styles.d.ts +5 -5
  329. package/build-types/form-file-upload/index.d.ts.map +1 -1
  330. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  331. package/build-types/form-toggle/index.d.ts +1 -1
  332. package/build-types/form-toggle/index.d.ts.map +1 -1
  333. package/build-types/form-toggle/stories/index.story.d.ts.map +1 -1
  334. package/build-types/form-token-field/index.d.ts.map +1 -1
  335. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  336. package/build-types/form-token-field/styles.d.ts +1 -1
  337. package/build-types/form-token-field/suggestions-list.d.ts +1 -1
  338. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  339. package/build-types/form-token-field/token-input.d.ts +1 -1
  340. package/build-types/form-token-field/token-input.d.ts.map +1 -1
  341. package/build-types/form-token-field/token.d.ts +1 -1
  342. package/build-types/form-token-field/token.d.ts.map +1 -1
  343. package/build-types/form-token-field/types.d.ts +16 -2
  344. package/build-types/form-token-field/types.d.ts.map +1 -1
  345. package/build-types/gradient-picker/index.d.ts.map +1 -1
  346. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  347. package/build-types/grid/component.d.ts.map +1 -1
  348. package/build-types/grid/hook.d.ts +106 -106
  349. package/build-types/grid/stories/index.story.d.ts.map +1 -1
  350. package/build-types/grid/utils.d.ts.map +1 -1
  351. package/build-types/guide/index.d.ts +1 -1
  352. package/build-types/guide/index.d.ts.map +1 -1
  353. package/build-types/guide/page-control.d.ts +1 -1
  354. package/build-types/guide/page-control.d.ts.map +1 -1
  355. package/build-types/guide/stories/index.story.d.ts.map +1 -1
  356. package/build-types/h-stack/component.d.ts +3 -3
  357. package/build-types/h-stack/component.d.ts.map +1 -1
  358. package/build-types/h-stack/hook.d.ts +107 -107
  359. package/build-types/h-stack/stories/e2e/index.story.d.ts.map +1 -1
  360. package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
  361. package/build-types/heading/component.d.ts +4 -4
  362. package/build-types/heading/component.d.ts.map +1 -1
  363. package/build-types/heading/hook.d.ts +107 -107
  364. package/build-types/heading/stories/index.story.d.ts.map +1 -1
  365. package/build-types/higher-order/navigate-regions/index.d.ts.map +1 -1
  366. package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -1
  367. package/build-types/higher-order/with-fallback-styles/index.d.ts +1 -1
  368. package/build-types/higher-order/with-fallback-styles/index.d.ts.map +1 -1
  369. package/build-types/higher-order/with-filters/index.d.ts +2 -2
  370. package/build-types/higher-order/with-focus-outside/index.d.ts.map +1 -1
  371. package/build-types/higher-order/with-focus-return/index.d.ts.map +1 -1
  372. package/build-types/higher-order/with-notices/index.d.ts +3 -3
  373. package/build-types/higher-order/with-notices/index.d.ts.map +1 -1
  374. package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
  375. package/build-types/icon/index.d.ts.map +1 -1
  376. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  377. package/build-types/input-control/backdrop.d.ts.map +1 -1
  378. package/build-types/input-control/index.d.ts.map +1 -1
  379. package/build-types/input-control/input-base.d.ts.map +1 -1
  380. package/build-types/input-control/input-field.d.ts +1 -1
  381. package/build-types/input-control/input-field.d.ts.map +1 -1
  382. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
  383. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
  384. package/build-types/input-control/reducer/reducer.d.ts +9 -9
  385. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  386. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  387. package/build-types/input-control/styles/input-control-styles.d.ts +3 -3
  388. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  389. package/build-types/isolated-event-container/index.d.ts.map +1 -1
  390. package/build-types/item-group/item/component.d.ts.map +1 -1
  391. package/build-types/item-group/item/hook.d.ts +104 -104
  392. package/build-types/item-group/item-group/component.d.ts.map +1 -1
  393. package/build-types/item-group/item-group/hook.d.ts +105 -105
  394. package/build-types/item-group/stories/index.story.d.ts.map +1 -1
  395. package/build-types/item-group/styles.d.ts +1 -1
  396. package/build-types/item-group/styles.d.ts.map +1 -1
  397. package/build-types/keyboard-shortcuts/index.d.ts +1 -1
  398. package/build-types/keyboard-shortcuts/index.d.ts.map +1 -1
  399. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  400. package/build-types/lock-unlock.d.ts +1 -2
  401. package/build-types/lock-unlock.d.ts.map +1 -1
  402. package/build-types/menu/group-label.d.ts +1 -1
  403. package/build-types/menu/group.d.ts +1 -1
  404. package/build-types/menu/index.d.ts +5 -5
  405. package/build-types/menu/index.d.ts.map +1 -1
  406. package/build-types/menu/item-help-text.d.ts +1 -1
  407. package/build-types/menu/item-label.d.ts +1 -1
  408. package/build-types/menu/popover.d.ts.map +1 -1
  409. package/build-types/menu/separator.d.ts +1 -1
  410. package/build-types/menu/stories/index.story.d.ts.map +1 -1
  411. package/build-types/menu/styles.d.ts +23 -8
  412. package/build-types/menu/styles.d.ts.map +1 -1
  413. package/build-types/menu-group/index.d.ts.map +1 -1
  414. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  415. package/build-types/menu-item/index.d.ts +2 -2
  416. package/build-types/menu-item/index.d.ts.map +1 -1
  417. package/build-types/menu-item/stories/index.story.d.ts +8 -8
  418. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  419. package/build-types/menu-items-choice/index.d.ts +1 -1
  420. package/build-types/menu-items-choice/index.d.ts.map +1 -1
  421. package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
  422. package/build-types/mobile/image/constants.d.ts +4 -4
  423. package/build-types/mobile/image/constants.d.ts.map +1 -1
  424. package/build-types/modal/index.d.ts.map +1 -1
  425. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  426. package/build-types/modal/use-modal-exit-animation.d.ts +0 -3
  427. package/build-types/modal/use-modal-exit-animation.d.ts.map +1 -1
  428. package/build-types/navigable-container/container.d.ts +2 -2
  429. package/build-types/navigable-container/container.d.ts.map +1 -1
  430. package/build-types/navigable-container/menu.d.ts +1 -1
  431. package/build-types/navigable-container/menu.d.ts.map +1 -1
  432. package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
  433. package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
  434. package/build-types/navigable-container/tabbable.d.ts +2 -2
  435. package/build-types/navigable-container/tabbable.d.ts.map +1 -1
  436. package/build-types/navigation/back-button/index.d.ts.map +1 -1
  437. package/build-types/navigation/group/index.d.ts +1 -1
  438. package/build-types/navigation/group/index.d.ts.map +1 -1
  439. package/build-types/navigation/index.d.ts +1 -1
  440. package/build-types/navigation/index.d.ts.map +1 -1
  441. package/build-types/navigation/item/index.d.ts.map +1 -1
  442. package/build-types/navigation/item/use-navigation-tree-item.d.ts.map +1 -1
  443. package/build-types/navigation/menu/index.d.ts.map +1 -1
  444. package/build-types/navigation/menu/menu-title-search.d.ts.map +1 -1
  445. package/build-types/navigation/menu/menu-title.d.ts +1 -1
  446. package/build-types/navigation/menu/menu-title.d.ts.map +1 -1
  447. package/build-types/navigation/menu/search-no-results-found.d.ts +1 -1
  448. package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -1
  449. package/build-types/navigation/menu/use-navigation-tree-menu.d.ts.map +1 -1
  450. package/build-types/navigation/stories/index.story.d.ts.map +1 -1
  451. package/build-types/navigation/styles/navigation-styles.d.ts +6 -6
  452. package/build-types/navigation/utils.d.ts.map +1 -1
  453. package/build-types/navigator/index.d.ts +12 -12
  454. package/build-types/navigator/legacy.d.ts +18 -18
  455. package/build-types/navigator/navigator-back-button/component.d.ts +6 -6
  456. package/build-types/navigator/navigator-back-button/hook.d.ts +136 -136
  457. package/build-types/navigator/navigator-button/component.d.ts +6 -6
  458. package/build-types/navigator/navigator-button/hook.d.ts +136 -136
  459. package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts +1 -1
  460. package/build-types/navigator/navigator-screen/use-screen-animate-presence.d.ts.map +1 -1
  461. package/build-types/navigator/navigator-to-parent-button/component.d.ts +6 -6
  462. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  463. package/build-types/navigator/styles.d.ts.map +1 -1
  464. package/build-types/notice/index.d.ts +1 -1
  465. package/build-types/notice/index.d.ts.map +1 -1
  466. package/build-types/notice/list.d.ts +1 -1
  467. package/build-types/notice/list.d.ts.map +1 -1
  468. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  469. package/build-types/number-control/index.d.ts +7 -7
  470. package/build-types/number-control/index.d.ts.map +1 -1
  471. package/build-types/number-control/stories/index.story.d.ts +7 -7
  472. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  473. package/build-types/palette-edit/index.d.ts +1 -1
  474. package/build-types/palette-edit/index.d.ts.map +1 -1
  475. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  476. package/build-types/palette-edit/styles.d.ts +759 -759
  477. package/build-types/panel/body.d.ts.map +1 -1
  478. package/build-types/panel/header.d.ts.map +1 -1
  479. package/build-types/panel/index.d.ts.map +1 -1
  480. package/build-types/panel/row.d.ts.map +1 -1
  481. package/build-types/panel/stories/index.story.d.ts.map +1 -1
  482. package/build-types/placeholder/index.d.ts.map +1 -1
  483. package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
  484. package/build-types/popover/index.d.ts +1 -1
  485. package/build-types/popover/index.d.ts.map +1 -1
  486. package/build-types/popover/overlay-middlewares.d.ts +2 -2
  487. package/build-types/popover/stories/e2e/index.story.d.ts +1 -1
  488. package/build-types/popover/stories/e2e/index.story.d.ts.map +1 -1
  489. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  490. package/build-types/popover/test/utils/index.d.ts.map +1 -1
  491. package/build-types/popover/utils.d.ts +3 -3
  492. package/build-types/popover/utils.d.ts.map +1 -1
  493. package/build-types/progress-bar/index.d.ts +1 -1
  494. package/build-types/progress-bar/index.d.ts.map +1 -1
  495. package/build-types/progress-bar/stories/index.story.d.ts +1 -1
  496. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  497. package/build-types/query-controls/author-select.d.ts +1 -1
  498. package/build-types/query-controls/author-select.d.ts.map +1 -1
  499. package/build-types/query-controls/index.d.ts.map +1 -1
  500. package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
  501. package/build-types/radio-control/index.d.ts.map +1 -1
  502. package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
  503. package/build-types/radio-group/index.d.ts.map +1 -1
  504. package/build-types/radio-group/radio.d.ts +1 -1
  505. package/build-types/radio-group/radio.d.ts.map +1 -1
  506. package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
  507. package/build-types/range-control/index.d.ts +8 -8
  508. package/build-types/range-control/index.d.ts.map +1 -1
  509. package/build-types/range-control/input-range.d.ts +1 -1
  510. package/build-types/range-control/input-range.d.ts.map +1 -1
  511. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  512. package/build-types/range-control/styles/range-control-styles.d.ts +9 -9
  513. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  514. package/build-types/range-control/utils.d.ts +1 -1
  515. package/build-types/range-control/utils.d.ts.map +1 -1
  516. package/build-types/resizable-box/index.d.ts.map +1 -1
  517. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  518. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  519. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +1 -1
  520. package/build-types/resizable-box/resize-tooltip/utils.d.ts +3 -3
  521. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  522. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  523. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  524. package/build-types/responsive-wrapper/index.d.ts +1 -1
  525. package/build-types/responsive-wrapper/index.d.ts.map +1 -1
  526. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  527. package/build-types/sandbox/index.d.ts.map +1 -1
  528. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  529. package/build-types/scroll-lock/index.d.ts.map +1 -1
  530. package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
  531. package/build-types/scrollable/component.d.ts.map +1 -1
  532. package/build-types/scrollable/hook.d.ts +106 -106
  533. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  534. package/build-types/search-control/index.d.ts +9 -9
  535. package/build-types/search-control/index.d.ts.map +1 -1
  536. package/build-types/search-control/stories/index.story.d.ts +9 -9
  537. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  538. package/build-types/select-control/chevron-down.d.ts.map +1 -1
  539. package/build-types/select-control/index.d.ts +1 -1
  540. package/build-types/select-control/index.d.ts.map +1 -1
  541. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  542. package/build-types/select-control/styles/select-control-styles.d.ts +2 -2
  543. package/build-types/shortcut/index.d.ts.map +1 -1
  544. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  545. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
  546. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  547. package/build-types/slot-fill/context.d.ts.map +1 -1
  548. package/build-types/slot-fill/index.d.ts +2 -2
  549. package/build-types/slot-fill/index.d.ts.map +1 -1
  550. package/build-types/slot-fill/provider.d.ts.map +1 -1
  551. package/build-types/slot-fill/slot.d.ts.map +1 -1
  552. package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
  553. package/build-types/snackbar/index.d.ts +3 -3
  554. package/build-types/snackbar/index.d.ts.map +1 -1
  555. package/build-types/snackbar/list.d.ts +1 -1
  556. package/build-types/snackbar/list.d.ts.map +1 -1
  557. package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
  558. package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
  559. package/build-types/spacer/component.d.ts.map +1 -1
  560. package/build-types/spacer/hook.d.ts +106 -106
  561. package/build-types/spacer/stories/index.story.d.ts.map +1 -1
  562. package/build-types/spinner/index.d.ts.map +1 -1
  563. package/build-types/spinner/stories/index.story.d.ts.map +1 -1
  564. package/build-types/style-provider/index.d.ts +0 -3
  565. package/build-types/style-provider/index.d.ts.map +1 -1
  566. package/build-types/style-provider/test/index.d.ts.map +1 -0
  567. package/build-types/surface/component.d.ts.map +1 -1
  568. package/build-types/surface/hook.d.ts +106 -106
  569. package/build-types/surface/stories/index.story.d.ts.map +1 -1
  570. package/build-types/surface/styles.d.ts +1 -1
  571. package/build-types/surface/styles.d.ts.map +1 -1
  572. package/build-types/tab-panel/index.d.ts.map +1 -1
  573. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  574. package/build-types/tabs/index.d.ts +1 -1
  575. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  576. package/build-types/tabs/styles.d.ts +3 -3
  577. package/build-types/tabs/tablist.d.ts +1 -1
  578. package/build-types/text/component.d.ts.map +1 -1
  579. package/build-types/text/hook.d.ts +106 -106
  580. package/build-types/text/stories/index.story.d.ts +3 -3
  581. package/build-types/text/stories/index.story.d.ts.map +1 -1
  582. package/build-types/text/utils.d.ts +1 -1
  583. package/build-types/text/utils.d.ts.map +1 -1
  584. package/build-types/text-control/index.d.ts +3 -3
  585. package/build-types/text-control/index.d.ts.map +1 -1
  586. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  587. package/build-types/text-highlight/index.d.ts +4 -19
  588. package/build-types/text-highlight/index.d.ts.map +1 -1
  589. package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
  590. package/build-types/textarea-control/index.d.ts +3 -3
  591. package/build-types/textarea-control/index.d.ts.map +1 -1
  592. package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
  593. package/build-types/theme/color-algorithms.d.ts +1 -1
  594. package/build-types/theme/color-algorithms.d.ts.map +1 -1
  595. package/build-types/theme/index.d.ts.map +1 -1
  596. package/build-types/theme/stories/index.story.d.ts +1 -1
  597. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  598. package/build-types/theme/styles.d.ts.map +1 -1
  599. package/build-types/tip/index.d.ts.map +1 -1
  600. package/build-types/tip/stories/index.story.d.ts.map +1 -1
  601. package/build-types/toggle-control/index.d.ts +2 -2
  602. package/build-types/toggle-control/index.d.ts.map +1 -1
  603. package/build-types/toggle-control/stories/index.story.d.ts +4 -4
  604. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  605. package/build-types/toggle-group-control/context.d.ts.map +1 -1
  606. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  607. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +1 -1
  608. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +1 -1
  609. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +2 -2
  610. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  611. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +3 -3
  612. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  613. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +2 -2
  614. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  615. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +1 -1
  616. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  617. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +1 -1
  618. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  619. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  620. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  621. package/build-types/toolbar/index.d.ts +6 -6
  622. package/build-types/toolbar/index.d.ts.map +1 -1
  623. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  624. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  625. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  626. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  627. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -1
  628. package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
  629. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts.map +1 -1
  630. package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -1
  631. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -1
  632. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +1 -1
  633. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -1
  634. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  635. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  636. package/build-types/tools-panel/styles.d.ts.map +1 -1
  637. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  638. package/build-types/tools-panel/tools-panel/hook.d.ts +128 -128
  639. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  640. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  641. package/build-types/tools-panel/tools-panel-header/hook.d.ts +116 -116
  642. package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
  643. package/build-types/tools-panel/tools-panel-item/hook.d.ts +108 -108
  644. package/build-types/tooltip/index.d.ts.map +1 -1
  645. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  646. package/build-types/tree-grid/cell.d.ts.map +1 -1
  647. package/build-types/tree-grid/index.d.ts.map +1 -1
  648. package/build-types/tree-grid/item.d.ts.map +1 -1
  649. package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
  650. package/build-types/tree-grid/roving-tab-index.d.ts +1 -1
  651. package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -1
  652. package/build-types/tree-grid/row.d.ts.map +1 -1
  653. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  654. package/build-types/tree-select/index.d.ts.map +1 -1
  655. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  656. package/build-types/truncate/component.d.ts.map +1 -1
  657. package/build-types/truncate/hook.d.ts +106 -106
  658. package/build-types/truncate/stories/index.story.d.ts.map +1 -1
  659. package/build-types/truncate/utils.d.ts +5 -5
  660. package/build-types/truncate/utils.d.ts.map +1 -1
  661. package/build-types/unit-control/index.d.ts +2 -2
  662. package/build-types/unit-control/index.d.ts.map +1 -1
  663. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  664. package/build-types/unit-control/styles/unit-control-styles.d.ts +7 -7
  665. package/build-types/unit-control/unit-select-control.d.ts +1 -1
  666. package/build-types/unit-control/unit-select-control.d.ts.map +1 -1
  667. package/build-types/unit-control/utils.d.ts.map +1 -1
  668. package/build-types/utils/breakpoint-values.d.ts.map +1 -1
  669. package/build-types/utils/breakpoint.d.ts +9 -1
  670. package/build-types/utils/breakpoint.d.ts.map +1 -1
  671. package/build-types/utils/colors-values.d.ts +1 -1
  672. package/build-types/utils/colors-values.d.ts.map +1 -1
  673. package/build-types/utils/colors.d.ts +3 -3
  674. package/build-types/utils/colors.d.ts.map +1 -1
  675. package/build-types/utils/deprecated-36px-size.d.ts +1 -1
  676. package/build-types/utils/deprecated-36px-size.d.ts.map +1 -1
  677. package/build-types/utils/dropdown-motion.d.ts +3 -3
  678. package/build-types/utils/dropdown-motion.d.ts.map +1 -1
  679. package/build-types/utils/font-values.d.ts.map +1 -1
  680. package/build-types/utils/font.d.ts +6 -2
  681. package/build-types/utils/font.d.ts.map +1 -1
  682. package/build-types/utils/get-node-text.d.ts.map +1 -1
  683. package/build-types/utils/hooks/index.d.ts +4 -4
  684. package/build-types/utils/hooks/index.d.ts.map +1 -1
  685. package/build-types/utils/hooks/use-animated-offset-rect.d.ts +1 -1
  686. package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -1
  687. package/build-types/utils/hooks/use-controlled-state.d.ts +2 -8
  688. package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
  689. package/build-types/utils/hooks/use-controlled-value.d.ts +1 -1
  690. package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
  691. package/build-types/utils/hooks/use-update-effect.d.ts +1 -1
  692. package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
  693. package/build-types/utils/index.d.ts +2 -2
  694. package/build-types/utils/index.d.ts.map +1 -1
  695. package/build-types/utils/math.d.ts +5 -5
  696. package/build-types/utils/math.d.ts.map +1 -1
  697. package/build-types/utils/rtl.d.ts +11 -16
  698. package/build-types/utils/rtl.d.ts.map +1 -1
  699. package/build-types/utils/strings.d.ts.map +1 -1
  700. package/build-types/utils/style-mixins.d.ts +9 -9
  701. package/build-types/utils/style-mixins.d.ts.map +1 -1
  702. package/build-types/utils/use-responsive-value.d.ts.map +1 -1
  703. package/build-types/utils/values.d.ts +19 -5
  704. package/build-types/utils/values.d.ts.map +1 -1
  705. package/build-types/utils/with-ignore-ime-events.d.ts.map +1 -1
  706. package/build-types/v-stack/component.d.ts +3 -3
  707. package/build-types/v-stack/component.d.ts.map +1 -1
  708. package/build-types/v-stack/hook.d.ts +107 -107
  709. package/build-types/v-stack/stories/e2e/index.story.d.ts.map +1 -1
  710. package/build-types/v-stack/stories/index.story.d.ts +4 -4
  711. package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
  712. package/build-types/validated-form-controls/components/checkbox-control.d.ts +2 -2
  713. package/build-types/validated-form-controls/components/combobox-control.d.ts +2 -2
  714. package/build-types/validated-form-controls/components/number-control.d.ts +7 -7
  715. package/build-types/validated-form-controls/components/radio-control.d.ts +2 -2
  716. package/build-types/validated-form-controls/components/radio-control.d.ts.map +1 -1
  717. package/build-types/validated-form-controls/components/range-control.d.ts +8 -8
  718. package/build-types/validated-form-controls/components/range-control.d.ts.map +1 -1
  719. package/build-types/validated-form-controls/components/select-control.d.ts +1 -1
  720. package/build-types/validated-form-controls/components/stories/checkbox-control.story.d.ts.map +1 -1
  721. package/build-types/validated-form-controls/components/stories/combobox-control.story.d.ts.map +1 -1
  722. package/build-types/validated-form-controls/components/stories/custom-select-control.story.d.ts.map +1 -1
  723. package/build-types/validated-form-controls/components/stories/form-token-field.story.d.ts.map +1 -1
  724. package/build-types/validated-form-controls/components/stories/input-control.story.d.ts.map +1 -1
  725. package/build-types/validated-form-controls/components/stories/number-control.story.d.ts.map +1 -1
  726. package/build-types/validated-form-controls/components/stories/overview.story.d.ts.map +1 -1
  727. package/build-types/validated-form-controls/components/stories/radio-control.story.d.ts.map +1 -1
  728. package/build-types/validated-form-controls/components/stories/range-control.story.d.ts.map +1 -1
  729. package/build-types/validated-form-controls/components/stories/select-control.story.d.ts.map +1 -1
  730. package/build-types/validated-form-controls/components/stories/text-control.story.d.ts.map +1 -1
  731. package/build-types/validated-form-controls/components/stories/textarea-control.story.d.ts.map +1 -1
  732. package/build-types/validated-form-controls/components/stories/toggle-control.story.d.ts.map +1 -1
  733. package/build-types/validated-form-controls/components/stories/toggle-group-control.story.d.ts.map +1 -1
  734. package/build-types/validated-form-controls/components/text-control.d.ts +3 -3
  735. package/build-types/validated-form-controls/components/textarea-control.d.ts +3 -3
  736. package/build-types/validated-form-controls/components/toggle-control.d.ts +2 -2
  737. package/build-types/validated-form-controls/components/toggle-group-control.d.ts +3 -3
  738. package/build-types/validated-form-controls/control-with-error.d.ts +1 -1
  739. package/build-types/validated-form-controls/validity-indicator.d.ts +1 -1
  740. package/build-types/validated-form-controls/validity-indicator.d.ts.map +1 -1
  741. package/build-types/view/component.d.ts +251 -251
  742. package/build-types/view/component.d.ts.map +1 -1
  743. package/build-types/view/stories/index.story.d.ts.map +1 -1
  744. package/build-types/visually-hidden/component.d.ts.map +1 -1
  745. package/build-types/visually-hidden/stories/index.story.d.ts +0 -6
  746. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
  747. package/build-types/z-stack/component.d.ts.map +1 -1
  748. package/build-types/z-stack/stories/index.story.d.ts.map +1 -1
  749. package/package.json +24 -23
  750. package/src/alignment-matrix-control/stories/index.story.tsx +1 -1
  751. package/src/angle-picker-control/stories/index.story.tsx +1 -1
  752. package/src/autocomplete/autocompleter-ui.tsx +0 -1
  753. package/src/base-control/stories/index.story.tsx +1 -1
  754. package/src/border-box-control/stories/index.story.tsx +1 -1
  755. package/src/border-control/stories/index.story.tsx +1 -1
  756. package/src/button/stories/index.story.tsx +1 -1
  757. package/src/button/style.scss +2 -0
  758. package/src/button-group/style.scss +1 -2
  759. package/src/card/stories/index.story.tsx +2 -9
  760. package/src/checkbox-control/stories/index.story.tsx +1 -1
  761. package/src/circular-option-picker/style.scss +8 -6
  762. package/src/color-indicator/stories/index.story.tsx +1 -1
  763. package/src/color-palette/index.tsx +25 -9
  764. package/src/color-palette/stories/index.story.tsx +21 -3
  765. package/src/color-palette/test/index.tsx +152 -1
  766. package/src/color-palette/test/utils.ts +18 -0
  767. package/src/color-palette/types.ts +19 -2
  768. package/src/color-palette/utils.ts +14 -2
  769. package/src/color-picker/hex-input.tsx +1 -1
  770. package/src/color-picker/stories/index.story.tsx +1 -1
  771. package/src/color-picker/test/index.tsx +24 -2
  772. package/src/combobox-control/stories/index.story.tsx +1 -1
  773. package/src/composite/legacy/test/index.tsx +13 -13
  774. package/src/composite/stories/index.story.tsx +1 -1
  775. package/src/confirm-dialog/stories/index.story.tsx +1 -1
  776. package/src/custom-gradient-picker/index.tsx +0 -1
  777. package/src/custom-select-control/stories/index.story.tsx +1 -1
  778. package/src/disabled/stories/index.story.tsx +1 -1
  779. package/src/drop-zone/stories/index.story.tsx +1 -1
  780. package/src/dropdown/stories/index.story.tsx +1 -1
  781. package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
  782. package/src/duotone-picker/stories/duotone-swatch.story.tsx +1 -1
  783. package/src/external-link/stories/index.story.tsx +2 -2
  784. package/src/external-link/style.scss +34 -2
  785. package/src/focal-point-picker/README.md +12 -8
  786. package/src/focal-point-picker/index.tsx +16 -11
  787. package/src/focal-point-picker/stories/index.story.tsx +1 -1
  788. package/src/font-size-picker/stories/index.story.tsx +1 -1
  789. package/src/form-file-upload/stories/index.story.tsx +1 -1
  790. package/src/form-toggle/stories/index.story.tsx +1 -1
  791. package/src/form-toggle/style.scss +3 -2
  792. package/src/form-token-field/README.md +2 -1
  793. package/src/form-token-field/index.tsx +39 -9
  794. package/src/form-token-field/stories/index.story.tsx +2 -1
  795. package/src/form-token-field/test/index.tsx +70 -10
  796. package/src/form-token-field/token-input.tsx +1 -6
  797. package/src/form-token-field/types.ts +16 -2
  798. package/src/gradient-picker/stories/index.story.tsx +1 -1
  799. package/src/guide/stories/index.story.tsx +1 -1
  800. package/src/higher-order/with-notices/test/index.tsx +12 -10
  801. package/src/icon/stories/index.story.tsx +1 -1
  802. package/src/input-control/stories/index.story.tsx +1 -1
  803. package/src/item-group/stories/index.story.tsx +1 -1
  804. package/src/keyboard-shortcuts/stories/index.story.tsx +1 -1
  805. package/src/menu/popover.tsx +15 -8
  806. package/src/menu/stories/index.story.tsx +1 -1
  807. package/src/menu/styles.ts +25 -15
  808. package/src/menu/test/index.tsx +28 -37
  809. package/src/menu-group/stories/index.story.tsx +1 -1
  810. package/src/menu-item/stories/index.story.tsx +1 -1
  811. package/src/menu-items-choice/stories/index.story.tsx +1 -1
  812. package/src/modal/index.tsx +2 -7
  813. package/src/modal/stories/index.story.tsx +1 -1
  814. package/src/modal/style.scss +68 -24
  815. package/src/modal/use-modal-exit-animation.ts +10 -7
  816. package/src/navigator/stories/index.story.tsx +1 -1
  817. package/src/notice/stories/index.story.tsx +1 -1
  818. package/src/notice/test/__snapshots__/index.tsx.snap +1 -0
  819. package/src/number-control/stories/index.story.tsx +1 -1
  820. package/src/palette-edit/index.tsx +0 -1
  821. package/src/palette-edit/stories/index.story.tsx +1 -1
  822. package/src/panel/stories/index.story.tsx +1 -1
  823. package/src/placeholder/stories/index.story.tsx +1 -1
  824. package/src/popover/stories/index.story.tsx +1 -1
  825. package/src/popover/style.scss +0 -4
  826. package/src/progress-bar/stories/index.story.tsx +1 -1
  827. package/src/query-controls/stories/index.story.tsx +1 -1
  828. package/src/radio-control/stories/index.story.tsx +1 -1
  829. package/src/range-control/stories/index.story.tsx +1 -1
  830. package/src/resizable-box/stories/index.story.tsx +1 -1
  831. package/src/resizable-box/style.scss +4 -5
  832. package/src/sandbox/stories/index.story.tsx +1 -1
  833. package/src/scroll-lock/stories/index.story.tsx +1 -1
  834. package/src/search-control/stories/index.story.tsx +1 -1
  835. package/src/select-control/stories/index.story.tsx +1 -1
  836. package/src/shortcut/stories/index.story.tsx +1 -1
  837. package/src/slot-fill/fill.tsx +2 -2
  838. package/src/slot-fill/stories/index.story.tsx +1 -1
  839. package/src/snackbar/stories/index.story.tsx +1 -1
  840. package/src/spinner/stories/index.story.tsx +1 -1
  841. package/src/style-provider/index.tsx +10 -7
  842. package/src/style-provider/test/index.tsx +38 -0
  843. package/src/tab-panel/style.scss +2 -2
  844. package/src/tabs/stories/index.story.tsx +1 -1
  845. package/src/text/styles.ts +1 -1
  846. package/src/text/test/index.tsx +1 -1
  847. package/src/text-control/stories/index.story.tsx +1 -1
  848. package/src/text-highlight/stories/index.story.tsx +1 -1
  849. package/src/textarea-control/stories/index.story.tsx +1 -1
  850. package/src/toggle-control/stories/index.story.tsx +1 -1
  851. package/src/toggle-group-control/stories/index.story.tsx +1 -1
  852. package/src/toolbar/stories/index.story.tsx +1 -1
  853. package/src/toolbar/toolbar-group/index.tsx +2 -2
  854. package/src/tools-panel/stories/index.story.tsx +1 -1
  855. package/src/tooltip/stories/index.story.tsx +1 -1
  856. package/src/tooltip/test/index.tsx +3 -2
  857. package/src/tree-grid/stories/index.story.tsx +1 -1
  858. package/src/tree-select/stories/index.story.tsx +1 -1
  859. package/src/truncate/stories/index.story.tsx +1 -1
  860. package/src/unit-control/stories/index.story.tsx +1 -1
  861. package/src/utils/breakpoint.js +1 -1
  862. package/src/utils/config-values.js +3 -0
  863. package/src/utils/dropdown-motion.ts +6 -2
  864. package/src/utils/font.js +1 -1
  865. package/src/visually-hidden/component.tsx +1 -0
  866. package/src/visually-hidden/stories/index.story.tsx +2 -9
  867. package/build-types/visually-hidden/test/index.d.ts.map +0 -1
  868. package/src/visually-hidden/test/__snapshots__/index.tsx.snap +0 -12
  869. package/src/visually-hidden/test/index.tsx +0 -17
  870. /package/build-types/{visually-hidden → style-provider}/test/index.d.ts +0 -0
@@ -5,6 +5,7 @@ import { __, _n, sprintf } from "@wordpress/i18n";
5
5
  import { useDebounce, useInstanceId, usePrevious } from "@wordpress/compose";
6
6
  import { speak } from "@wordpress/a11y";
7
7
  import { isShallowEqual } from "@wordpress/is-shallow-equal";
8
+ import deprecated from "@wordpress/deprecated";
8
9
  import Token from "./token.mjs";
9
10
  import TokenInput from "./token-input.mjs";
10
11
  import { TokensAndInputWrapperFlex } from "./styles.mjs";
@@ -46,16 +47,29 @@ function FormTokenField(props) {
46
47
  __experimentalRenderItem,
47
48
  __experimentalExpandOnFocus = false,
48
49
  __experimentalValidateInput = () => true,
49
- __experimentalShowHowTo = true,
50
+ __experimentalShowHowTo,
50
51
  __next40pxDefaultSize = false,
51
52
  __experimentalAutoSelectFirstMatch = false,
52
- tokenizeOnBlur = false
53
+ tokenizeOnBlur = false,
54
+ help
53
55
  } = useDeprecated36pxDefaultSizeProp(props);
54
56
  maybeWarnDeprecated36pxSize({
55
57
  componentName: "FormTokenField",
56
58
  size: void 0,
57
59
  __next40pxDefaultSize
58
60
  });
61
+ const defaultHelp = tokenizeOnSpace ? __("Separate with commas, spaces, or the Enter key.") : __("Separate with commas or the Enter key.");
62
+ let computedHelp = help !== void 0 ? help : defaultHelp;
63
+ if (typeof __experimentalShowHowTo === "boolean") {
64
+ deprecated("`__experimentalShowHowTo` prop in wp.components.FormTokenField", {
65
+ since: "7.1",
66
+ alternative: "`help` prop",
67
+ hint: "The `help` prop now defaults to the previous how-to text. Pass an empty string to hide it."
68
+ });
69
+ if (__experimentalShowHowTo === false && help === void 0) {
70
+ computedHelp = "";
71
+ }
72
+ }
59
73
  const instanceId = useInstanceId(FormTokenField);
60
74
  const [incompleteTokenValue, setIncompleteTokenValue] = useState("");
61
75
  const [inputOffsetFromEnd, setInputOffsetFromEnd] = useState(0);
@@ -448,6 +462,7 @@ function FormTokenField(props) {
448
462
  }, "token-" + _value);
449
463
  }
450
464
  function renderInput() {
465
+ const describedById = computedHelp ? `components-form-token-input-${instanceId}__help` : void 0;
451
466
  const inputProps = {
452
467
  instanceId,
453
468
  autoCapitalize,
@@ -457,7 +472,8 @@ function FormTokenField(props) {
457
472
  value: incompleteTokenValue,
458
473
  onBlur,
459
474
  isExpanded,
460
- selectedSuggestionIndex
475
+ selectedSuggestionIndex,
476
+ "aria-describedby": describedById
461
477
  };
462
478
  return /* @__PURE__ */ _jsx(TokenInput, {
463
479
  ...inputProps,
@@ -512,10 +528,10 @@ function FormTokenField(props) {
512
528
  onSelect: onSuggestionSelected,
513
529
  __experimentalRenderItem
514
530
  })]
515
- }), __experimentalShowHowTo && /* @__PURE__ */ _jsx(StyledHelp, {
516
- id: `components-form-token-suggestions-howto-${instanceId}`,
531
+ }), computedHelp && /* @__PURE__ */ _jsx(StyledHelp, {
532
+ id: `components-form-token-input-${instanceId}__help`,
517
533
  className: "components-form-token-field__help",
518
- children: tokenizeOnSpace ? __("Separate with commas, spaces, or the Enter key.") : __("Separate with commas or the Enter key.")
534
+ children: computedHelp
519
535
  })]
520
536
  });
521
537
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/form-token-field/index.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useDebounce, useInstanceId, usePrevious } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { isShallowEqual } from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport Token from './token';\nimport TokenInput from './token-input';\nimport { TokensAndInputWrapperFlex } from './styles';\nimport SuggestionsList from './suggestions-list';\nimport { FlexItem } from '../flex';\nimport { StyledHelp, StyledLabel } from '../base-control/styles/base-control-styles';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst identity = value => value;\n\n/**\n * A `FormTokenField` is a field similar to the tags and categories fields in the interim editor chrome,\n * or the \"to\" field in Mail on OS X. Tokens can be entered by typing them or selecting them from a list of suggested tokens.\n *\n * Up to one hundred suggestions that match what the user has typed so far will be shown from which the user can pick from (auto-complete).\n * Tokens are separated by the \",\" character. Suggestions can be selected with the up or down arrows and added with the tab or enter key.\n *\n * The `value` property is handled in a manner similar to controlled form components.\n * See [Forms](https://react.dev/reference/react-dom/components#form-components) in the React Documentation for more information.\n */\nexport function FormTokenField(props) {\n const {\n autoCapitalize,\n autoComplete,\n maxLength,\n placeholder,\n label = __('Add item'),\n className,\n suggestions = [],\n maxSuggestions = 100,\n value = [],\n displayTransform = identity,\n saveTransform = token => token.trim(),\n onChange = () => {},\n onInputChange = () => {},\n onFocus = undefined,\n isBorderless = false,\n disabled = false,\n tokenizeOnSpace = false,\n messages = {\n added: __('Item added.'),\n removed: __('Item removed.'),\n remove: __('Remove item'),\n __experimentalInvalid: __('Invalid item')\n },\n __experimentalRenderItem,\n __experimentalExpandOnFocus = false,\n __experimentalValidateInput = () => true,\n __experimentalShowHowTo = true,\n __next40pxDefaultSize = false,\n __experimentalAutoSelectFirstMatch = false,\n tokenizeOnBlur = false\n } = useDeprecated36pxDefaultSizeProp(props);\n maybeWarnDeprecated36pxSize({\n componentName: 'FormTokenField',\n size: undefined,\n __next40pxDefaultSize\n });\n const instanceId = useInstanceId(FormTokenField);\n\n // We reset to these initial values again in the onBlur\n const [incompleteTokenValue, setIncompleteTokenValue] = useState('');\n const [inputOffsetFromEnd, setInputOffsetFromEnd] = useState(0);\n const [isActive, setIsActive] = useState(false);\n const [isExpanded, setIsExpanded] = useState(false);\n const [selectedSuggestionIndex, setSelectedSuggestionIndex] = useState(-1);\n const [selectedSuggestionScroll, setSelectedSuggestionScroll] = useState(false);\n const prevSuggestions = usePrevious(suggestions);\n const prevValue = usePrevious(value);\n const input = useRef(null);\n const tokensAndInput = useRef(null);\n const debouncedSpeak = useDebounce(speak, 500);\n useEffect(() => {\n // Make sure to focus the input when the isActive state is true.\n if (isActive && !hasFocus()) {\n focus();\n }\n }, [isActive]);\n useEffect(() => {\n const suggestionsDidUpdate = !isShallowEqual(suggestions, prevSuggestions || []);\n if (suggestionsDidUpdate || value !== prevValue) {\n updateSuggestions(suggestionsDidUpdate);\n }\n\n // TODO: updateSuggestions() should first be refactored so its actual deps are clearer.\n }, [suggestions, prevSuggestions, value, prevValue]);\n useEffect(() => {\n updateSuggestions();\n }, [incompleteTokenValue]);\n useEffect(() => {\n updateSuggestions();\n }, [__experimentalAutoSelectFirstMatch]);\n if (disabled && isActive) {\n setIsActive(false);\n setIncompleteTokenValue('');\n }\n function focus() {\n input.current?.focus();\n }\n function hasFocus() {\n return input.current === input.current?.ownerDocument.activeElement;\n }\n function onFocusHandler(event) {\n // If focus is on the input or on the container, set the isActive state to true.\n if (hasFocus() || event.target === tokensAndInput.current) {\n setIsActive(true);\n setIsExpanded(__experimentalExpandOnFocus || isExpanded);\n } else {\n /*\n * Otherwise, focus is on one of the token \"remove\" buttons and we\n * set the isActive state to false to prevent the input to be\n * re-focused, see componentDidUpdate().\n */\n setIsActive(false);\n }\n if ('function' === typeof onFocus) {\n onFocus(event);\n }\n }\n function onBlur(event) {\n if (inputHasValidValue() && __experimentalValidateInput(incompleteTokenValue)) {\n setIsActive(false);\n if (tokenizeOnBlur && inputHasValidValue()) {\n addNewToken(incompleteTokenValue);\n }\n } else {\n // Reset to initial state\n setIncompleteTokenValue('');\n setInputOffsetFromEnd(0);\n setIsActive(false);\n if (__experimentalExpandOnFocus) {\n // If `__experimentalExpandOnFocus` is true, don't close the suggestions list when\n // the user clicks on it (`tokensAndInput` will be the element that caused the blur).\n const hasFocusWithin = event.relatedTarget === tokensAndInput.current;\n setIsExpanded(hasFocusWithin);\n } else {\n // Else collapse the suggestion list. This will result in the suggestion list closing\n // after a suggestion has been submitted since that causes a blur.\n setIsExpanded(false);\n }\n setSelectedSuggestionIndex(-1);\n setSelectedSuggestionScroll(false);\n }\n }\n function onKeyDown(event) {\n let preventDefault = false;\n if (event.defaultPrevented) {\n return;\n }\n switch (event.key) {\n case 'Backspace':\n preventDefault = handleDeleteKey(deleteTokenBeforeInput);\n break;\n case 'Enter':\n preventDefault = addCurrentToken();\n break;\n case 'ArrowLeft':\n preventDefault = handleLeftArrowKey();\n break;\n case 'ArrowUp':\n preventDefault = handleUpArrowKey();\n break;\n case 'ArrowRight':\n preventDefault = handleRightArrowKey();\n break;\n case 'ArrowDown':\n preventDefault = handleDownArrowKey();\n break;\n case 'Delete':\n preventDefault = handleDeleteKey(deleteTokenAfterInput);\n break;\n case 'Space':\n if (tokenizeOnSpace) {\n preventDefault = addCurrentToken();\n }\n break;\n case 'Escape':\n preventDefault = handleEscapeKey(event);\n break;\n case 'Tab':\n preventDefault = handleTabKey(event);\n break;\n default:\n break;\n }\n if (preventDefault) {\n event.preventDefault();\n }\n }\n function onKeyPress(event) {\n let preventDefault = false;\n switch (event.key) {\n case ',':\n preventDefault = handleCommaKey();\n break;\n default:\n break;\n }\n if (preventDefault) {\n event.preventDefault();\n }\n }\n function onContainerTouched(event) {\n // Prevent clicking/touching the tokensAndInput container from blurring\n // the input and adding the current token.\n if (event.target === tokensAndInput.current && isActive) {\n event.preventDefault();\n }\n }\n function onTokenClickRemove(event) {\n deleteToken(event.value);\n focus();\n }\n function onSuggestionHovered(suggestion) {\n const index = getMatchingSuggestions().indexOf(suggestion);\n if (index >= 0) {\n setSelectedSuggestionIndex(index);\n setSelectedSuggestionScroll(false);\n }\n }\n function onSuggestionSelected(suggestion) {\n addNewToken(suggestion);\n }\n function onInputChangeHandler(event) {\n const text = event.value;\n const separator = tokenizeOnSpace ? /[ ,\\t]+/ : /[,\\t]+/;\n const items = text.split(separator);\n const tokenValue = items[items.length - 1] || '';\n if (items.length > 1) {\n addNewTokens(items.slice(0, -1));\n }\n setIncompleteTokenValue(tokenValue);\n onInputChange(tokenValue);\n }\n function handleDeleteKey(_deleteToken) {\n let preventDefault = false;\n if (hasFocus() && isInputEmpty()) {\n _deleteToken();\n preventDefault = true;\n }\n return preventDefault;\n }\n function handleLeftArrowKey() {\n let preventDefault = false;\n if (isInputEmpty()) {\n moveInputBeforePreviousToken();\n preventDefault = true;\n }\n return preventDefault;\n }\n function handleRightArrowKey() {\n let preventDefault = false;\n if (isInputEmpty()) {\n moveInputAfterNextToken();\n preventDefault = true;\n }\n return preventDefault;\n }\n function handleUpArrowKey() {\n setSelectedSuggestionIndex(index => {\n return (index === 0 ? getMatchingSuggestions(incompleteTokenValue, suggestions, value, maxSuggestions, saveTransform).length : index) - 1;\n });\n setSelectedSuggestionScroll(true);\n return true; // PreventDefault.\n }\n function handleDownArrowKey() {\n setSelectedSuggestionIndex(index => {\n return (index + 1) % getMatchingSuggestions(incompleteTokenValue, suggestions, value, maxSuggestions, saveTransform).length;\n });\n setSelectedSuggestionScroll(true);\n return true; // PreventDefault.\n }\n function collapseSuggestionsList(event) {\n if (event.target instanceof HTMLInputElement) {\n setIncompleteTokenValue(event.target.value);\n setIsExpanded(false);\n setSelectedSuggestionIndex(-1);\n setSelectedSuggestionScroll(false);\n }\n }\n function handleEscapeKey(event) {\n collapseSuggestionsList(event);\n return true; // PreventDefault.\n }\n function handleTabKey(event) {\n collapseSuggestionsList(event);\n return false; // Do not prevent the default behavior.\n }\n function handleCommaKey() {\n if (inputHasValidValue()) {\n addNewToken(incompleteTokenValue);\n }\n return true; // PreventDefault.\n }\n function moveInputToIndex(index) {\n setInputOffsetFromEnd(value.length - Math.max(index, -1) - 1);\n }\n function moveInputBeforePreviousToken() {\n setInputOffsetFromEnd(prevInputOffsetFromEnd => {\n return Math.min(prevInputOffsetFromEnd + 1, value.length);\n });\n }\n function moveInputAfterNextToken() {\n setInputOffsetFromEnd(prevInputOffsetFromEnd => {\n return Math.max(prevInputOffsetFromEnd - 1, 0);\n });\n }\n function deleteTokenBeforeInput() {\n const index = getIndexOfInput() - 1;\n if (index > -1) {\n deleteToken(value[index]);\n }\n }\n function deleteTokenAfterInput() {\n const index = getIndexOfInput();\n if (index < value.length) {\n deleteToken(value[index]);\n // Update input offset since it's the offset from the last token.\n moveInputToIndex(index);\n }\n }\n function addCurrentToken() {\n let preventDefault = false;\n const selectedSuggestion = getSelectedSuggestion();\n if (selectedSuggestion) {\n addNewToken(selectedSuggestion);\n preventDefault = true;\n } else if (inputHasValidValue()) {\n addNewToken(incompleteTokenValue);\n preventDefault = true;\n }\n return preventDefault;\n }\n function addNewTokens(tokens) {\n const tokensToAdd = [...new Set(tokens.map(saveTransform).filter(Boolean).filter(token => !valueContainsToken(token)))];\n if (tokensToAdd.length > 0) {\n const newValue = [...value];\n newValue.splice(getIndexOfInput(), 0, ...tokensToAdd);\n onChange(newValue);\n }\n }\n function addNewToken(token) {\n if (!__experimentalValidateInput(token)) {\n speak(messages.__experimentalInvalid, 'assertive');\n return;\n }\n addNewTokens([token]);\n speak(messages.added, 'assertive');\n setIncompleteTokenValue('');\n setSelectedSuggestionIndex(-1);\n setSelectedSuggestionScroll(false);\n setIsExpanded(!__experimentalExpandOnFocus);\n if (isActive && !tokenizeOnBlur) {\n focus();\n }\n }\n function deleteToken(token) {\n const newTokens = value.filter(item => {\n return getTokenValue(item) !== getTokenValue(token);\n });\n onChange(newTokens);\n speak(messages.removed, 'assertive');\n }\n function getTokenValue(token) {\n if ('object' === typeof token) {\n return token.value;\n }\n return token;\n }\n function getMatchingSuggestions(searchValue = incompleteTokenValue, _suggestions = suggestions, _value = value, _maxSuggestions = maxSuggestions, _saveTransform = saveTransform) {\n let match = _saveTransform(searchValue);\n const startsWithMatch = [];\n const containsMatch = [];\n const normalizedValue = _value.map(item => {\n if (typeof item === 'string') {\n return item;\n }\n return item.value;\n });\n if (match.length === 0) {\n _suggestions = _suggestions.filter(suggestion => !normalizedValue.includes(suggestion));\n } else {\n match = match.normalize('NFKC').toLocaleLowerCase();\n _suggestions.forEach(suggestion => {\n const index = suggestion.normalize('NFKC').toLocaleLowerCase().indexOf(match);\n if (normalizedValue.indexOf(suggestion) === -1) {\n if (index === 0) {\n startsWithMatch.push(suggestion);\n } else if (index > 0) {\n containsMatch.push(suggestion);\n }\n }\n });\n _suggestions = startsWithMatch.concat(containsMatch);\n }\n return _suggestions.slice(0, _maxSuggestions);\n }\n function getSelectedSuggestion() {\n if (selectedSuggestionIndex !== -1) {\n return getMatchingSuggestions()[selectedSuggestionIndex];\n }\n return undefined;\n }\n function valueContainsToken(token) {\n return value.some(item => {\n return getTokenValue(token) === getTokenValue(item);\n });\n }\n function getIndexOfInput() {\n return value.length - inputOffsetFromEnd;\n }\n function isInputEmpty() {\n return incompleteTokenValue.length === 0;\n }\n function inputHasValidValue() {\n return saveTransform(incompleteTokenValue).length > 0;\n }\n function updateSuggestions(resetSelectedSuggestion = true) {\n const inputHasMinimumChars = incompleteTokenValue.trim().length > 1;\n const matchingSuggestions = getMatchingSuggestions(incompleteTokenValue);\n const hasMatchingSuggestions = matchingSuggestions.length > 0;\n const shouldExpandIfFocuses = hasFocus() && __experimentalExpandOnFocus;\n setIsExpanded(shouldExpandIfFocuses || inputHasMinimumChars && hasMatchingSuggestions);\n if (resetSelectedSuggestion) {\n if (__experimentalAutoSelectFirstMatch && inputHasMinimumChars && hasMatchingSuggestions) {\n setSelectedSuggestionIndex(0);\n setSelectedSuggestionScroll(true);\n } else {\n setSelectedSuggestionIndex(-1);\n setSelectedSuggestionScroll(false);\n }\n }\n if (inputHasMinimumChars) {\n const message = hasMatchingSuggestions ? sprintf(/* translators: %d: number of results. */\n _n('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length) : __('No results.');\n debouncedSpeak(message, 'assertive');\n }\n }\n function renderTokensAndInput() {\n const components = value.map(renderToken);\n components.splice(getIndexOfInput(), 0, renderInput());\n return components;\n }\n function renderToken(token, index, tokens) {\n const _value = getTokenValue(token);\n const status = typeof token !== 'string' ? token.status : undefined;\n const termPosition = index + 1;\n const termsCount = tokens.length;\n return /*#__PURE__*/_jsx(FlexItem, {\n children: /*#__PURE__*/_jsx(Token, {\n value: _value,\n status: status,\n title: typeof token !== 'string' ? token.title : undefined,\n displayTransform: displayTransform,\n onClickRemove: onTokenClickRemove,\n isBorderless: typeof token !== 'string' && token.isBorderless || isBorderless,\n onMouseEnter: typeof token !== 'string' ? token.onMouseEnter : undefined,\n onMouseLeave: typeof token !== 'string' ? token.onMouseLeave : undefined,\n disabled: 'error' !== status && disabled,\n messages: messages,\n termsCount: termsCount,\n termPosition: termPosition\n })\n }, 'token-' + _value);\n }\n function renderInput() {\n const inputProps = {\n instanceId,\n autoCapitalize,\n autoComplete,\n placeholder: value.length === 0 ? placeholder : '',\n disabled,\n value: incompleteTokenValue,\n onBlur,\n isExpanded,\n selectedSuggestionIndex\n };\n return /*#__PURE__*/_jsx(TokenInput, {\n ...inputProps,\n onChange: !(maxLength && value.length >= maxLength) ? onInputChangeHandler : undefined,\n ref: input\n }, \"input\");\n }\n const classes = clsx(className, 'components-form-token-field__input-container', {\n 'is-active': isActive,\n 'is-disabled': disabled\n });\n let tokenFieldProps = {\n className: 'components-form-token-field',\n tabIndex: -1\n };\n const matchingSuggestions = getMatchingSuggestions();\n if (!disabled) {\n tokenFieldProps = Object.assign({}, tokenFieldProps, {\n onKeyDown: withIgnoreIMEEvents(onKeyDown),\n onKeyPress,\n onFocus: onFocusHandler\n });\n }\n\n // Disable reason: There is no appropriate role which describes the\n // input container intended accessible usability.\n // TODO: Refactor click detection to use blur to stop propagation.\n /* eslint-disable jsx-a11y/no-static-element-interactions */\n return /*#__PURE__*/_jsxs(\"div\", {\n ...tokenFieldProps,\n children: [label && /*#__PURE__*/_jsx(StyledLabel, {\n htmlFor: `components-form-token-input-${instanceId}`,\n className: \"components-form-token-field__label\",\n children: label\n }), /*#__PURE__*/_jsxs(\"div\", {\n ref: tokensAndInput,\n className: classes,\n tabIndex: -1,\n onMouseDown: onContainerTouched,\n onTouchStart: onContainerTouched,\n children: [/*#__PURE__*/_jsx(TokensAndInputWrapperFlex, {\n justify: \"flex-start\",\n align: \"center\",\n gap: 1,\n wrap: true,\n __next40pxDefaultSize: __next40pxDefaultSize,\n hasTokens: !!value.length,\n children: renderTokensAndInput()\n }), isExpanded && /*#__PURE__*/_jsx(SuggestionsList, {\n instanceId: instanceId,\n match: saveTransform(incompleteTokenValue),\n displayTransform: displayTransform,\n suggestions: matchingSuggestions,\n selectedIndex: selectedSuggestionIndex,\n scrollIntoView: selectedSuggestionScroll,\n onHover: onSuggestionHovered,\n onSelect: onSuggestionSelected,\n __experimentalRenderItem: __experimentalRenderItem\n })]\n }), __experimentalShowHowTo && /*#__PURE__*/_jsx(StyledHelp, {\n id: `components-form-token-suggestions-howto-${instanceId}`,\n className: \"components-form-token-field__help\",\n children: tokenizeOnSpace ? __('Separate with commas, spaces, or the Enter key.') : __('Separate with commas or the Enter key.')\n })]\n });\n /* eslint-enable jsx-a11y/no-static-element-interactions */\n}\nexport default FormTokenField;"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAIjB,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,aAAa,eAAe,mBAAmB;AACxD,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAK/B,OAAO,WAAW;AAClB,OAAO,gBAAgB;AACvB,SAAS,iCAAiC;AAC1C,OAAO,qBAAqB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,YAAY,mBAAmB;AACxC,SAAS,wCAAwC;AACjD,SAAS,2BAA2B;AACpC,SAAS,mCAAmC;AAC5C,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,IAAM,WAAW,WAAS;AAYnB,SAAS,eAAe,OAAO;AACpC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ,GAAG,UAAU;AAAA,IACrB;AAAA,IACA,cAAc,CAAC;AAAA,IACf,iBAAiB;AAAA,IACjB,QAAQ,CAAC;AAAA,IACT,mBAAmB;AAAA,IACnB,gBAAgB,WAAS,MAAM,KAAK;AA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,iDAAiD,IAAI,GAAG,wCAAwC;AAAA,IACjI,CAAC,CAAC;AAAA,EACJ,CAAC;AAEH;AACA,IAAO,2BAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useDebounce, useInstanceId, usePrevious } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { isShallowEqual } from '@wordpress/is-shallow-equal';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport Token from './token';\nimport TokenInput from './token-input';\nimport { TokensAndInputWrapperFlex } from './styles';\nimport SuggestionsList from './suggestions-list';\nimport { FlexItem } from '../flex';\nimport { StyledHelp, StyledLabel } from '../base-control/styles/base-control-styles';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst identity = value => value;\n\n/**\n * A `FormTokenField` is a field similar to the tags and categories fields in the interim editor chrome,\n * or the \"to\" field in Mail on OS X. Tokens can be entered by typing them or selecting them from a list of suggested tokens.\n *\n * Up to one hundred suggestions that match what the user has typed so far will be shown from which the user can pick from (auto-complete).\n * Tokens are separated by the \",\" character. Suggestions can be selected with the up or down arrows and added with the tab or enter key.\n *\n * The `value` property is handled in a manner similar to controlled form components.\n * See [Forms](https://react.dev/reference/react-dom/components#form-components) in the React Documentation for more information.\n */\nexport function FormTokenField(props) {\n const {\n autoCapitalize,\n autoComplete,\n maxLength,\n placeholder,\n label = __('Add item'),\n className,\n suggestions = [],\n maxSuggestions = 100,\n value = [],\n displayTransform = identity,\n saveTransform = token => token.trim(),\n onChange = () => {},\n onInputChange = () => {},\n onFocus = undefined,\n isBorderless = false,\n disabled = false,\n tokenizeOnSpace = false,\n messages = {\n added: __('Item added.'),\n removed: __('Item removed.'),\n remove: __('Remove item'),\n __experimentalInvalid: __('Invalid item')\n },\n __experimentalRenderItem,\n __experimentalExpandOnFocus = false,\n __experimentalValidateInput = () => true,\n __experimentalShowHowTo,\n __next40pxDefaultSize = false,\n __experimentalAutoSelectFirstMatch = false,\n tokenizeOnBlur = false,\n help\n } = useDeprecated36pxDefaultSizeProp(props);\n maybeWarnDeprecated36pxSize({\n componentName: 'FormTokenField',\n size: undefined,\n __next40pxDefaultSize\n });\n const defaultHelp = tokenizeOnSpace ? __('Separate with commas, spaces, or the Enter key.') : __('Separate with commas or the Enter key.');\n let computedHelp = help !== undefined ? help : defaultHelp;\n if (typeof __experimentalShowHowTo === 'boolean') {\n deprecated('`__experimentalShowHowTo` prop in wp.components.FormTokenField', {\n since: '7.1',\n alternative: '`help` prop',\n hint: 'The `help` prop now defaults to the previous how-to text. Pass an empty string to hide it.'\n });\n if (__experimentalShowHowTo === false && help === undefined) {\n computedHelp = '';\n }\n }\n const instanceId = useInstanceId(FormTokenField);\n\n // We reset to these initial values again in the onBlur\n const [incompleteTokenValue, setIncompleteTokenValue] = useState('');\n const [inputOffsetFromEnd, setInputOffsetFromEnd] = useState(0);\n const [isActive, setIsActive] = useState(false);\n const [isExpanded, setIsExpanded] = useState(false);\n const [selectedSuggestionIndex, setSelectedSuggestionIndex] = useState(-1);\n const [selectedSuggestionScroll, setSelectedSuggestionScroll] = useState(false);\n const prevSuggestions = usePrevious(suggestions);\n const prevValue = usePrevious(value);\n const input = useRef(null);\n const tokensAndInput = useRef(null);\n const debouncedSpeak = useDebounce(speak, 500);\n useEffect(() => {\n // Make sure to focus the input when the isActive state is true.\n if (isActive && !hasFocus()) {\n focus();\n }\n }, [isActive]);\n useEffect(() => {\n const suggestionsDidUpdate = !isShallowEqual(suggestions, prevSuggestions || []);\n if (suggestionsDidUpdate || value !== prevValue) {\n updateSuggestions(suggestionsDidUpdate);\n }\n\n // TODO: updateSuggestions() should first be refactored so its actual deps are clearer.\n }, [suggestions, prevSuggestions, value, prevValue]);\n useEffect(() => {\n updateSuggestions();\n }, [incompleteTokenValue]);\n useEffect(() => {\n updateSuggestions();\n }, [__experimentalAutoSelectFirstMatch]);\n if (disabled && isActive) {\n setIsActive(false);\n setIncompleteTokenValue('');\n }\n function focus() {\n input.current?.focus();\n }\n function hasFocus() {\n return input.current === input.current?.ownerDocument.activeElement;\n }\n function onFocusHandler(event) {\n // If focus is on the input or on the container, set the isActive state to true.\n if (hasFocus() || event.target === tokensAndInput.current) {\n setIsActive(true);\n setIsExpanded(__experimentalExpandOnFocus || isExpanded);\n } else {\n /*\n * Otherwise, focus is on one of the token \"remove\" buttons and we\n * set the isActive state to false to prevent the input to be\n * re-focused, see componentDidUpdate().\n */\n setIsActive(false);\n }\n if ('function' === typeof onFocus) {\n onFocus(event);\n }\n }\n function onBlur(event) {\n if (inputHasValidValue() && __experimentalValidateInput(incompleteTokenValue)) {\n setIsActive(false);\n if (tokenizeOnBlur && inputHasValidValue()) {\n addNewToken(incompleteTokenValue);\n }\n } else {\n // Reset to initial state\n setIncompleteTokenValue('');\n setInputOffsetFromEnd(0);\n setIsActive(false);\n if (__experimentalExpandOnFocus) {\n // If `__experimentalExpandOnFocus` is true, don't close the suggestions list when\n // the user clicks on it (`tokensAndInput` will be the element that caused the blur).\n const hasFocusWithin = event.relatedTarget === tokensAndInput.current;\n setIsExpanded(hasFocusWithin);\n } else {\n // Else collapse the suggestion list. This will result in the suggestion list closing\n // after a suggestion has been submitted since that causes a blur.\n setIsExpanded(false);\n }\n setSelectedSuggestionIndex(-1);\n setSelectedSuggestionScroll(false);\n }\n }\n function onKeyDown(event) {\n let preventDefault = false;\n if (event.defaultPrevented) {\n return;\n }\n switch (event.key) {\n case 'Backspace':\n preventDefault = handleDeleteKey(deleteTokenBeforeInput);\n break;\n case 'Enter':\n preventDefault = addCurrentToken();\n break;\n case 'ArrowLeft':\n preventDefault = handleLeftArrowKey();\n break;\n case 'ArrowUp':\n preventDefault = handleUpArrowKey();\n break;\n case 'ArrowRight':\n preventDefault = handleRightArrowKey();\n break;\n case 'ArrowDown':\n preventDefault = handleDownArrowKey();\n break;\n case 'Delete':\n preventDefault = handleDeleteKey(deleteTokenAfterInput);\n break;\n case 'Space':\n if (tokenizeOnSpace) {\n preventDefault = addCurrentToken();\n }\n break;\n case 'Escape':\n preventDefault = handleEscapeKey(event);\n break;\n case 'Tab':\n preventDefault = handleTabKey(event);\n break;\n default:\n break;\n }\n if (preventDefault) {\n event.preventDefault();\n }\n }\n function onKeyPress(event) {\n let preventDefault = false;\n switch (event.key) {\n case ',':\n preventDefault = handleCommaKey();\n break;\n default:\n break;\n }\n if (preventDefault) {\n event.preventDefault();\n }\n }\n function onContainerTouched(event) {\n // Prevent clicking/touching the tokensAndInput container from blurring\n // the input and adding the current token.\n if (event.target === tokensAndInput.current && isActive) {\n event.preventDefault();\n }\n }\n function onTokenClickRemove(event) {\n deleteToken(event.value);\n focus();\n }\n function onSuggestionHovered(suggestion) {\n const index = getMatchingSuggestions().indexOf(suggestion);\n if (index >= 0) {\n setSelectedSuggestionIndex(index);\n setSelectedSuggestionScroll(false);\n }\n }\n function onSuggestionSelected(suggestion) {\n addNewToken(suggestion);\n }\n function onInputChangeHandler(event) {\n const text = event.value;\n const separator = tokenizeOnSpace ? /[ ,\\t]+/ : /[,\\t]+/;\n const items = text.split(separator);\n const tokenValue = items[items.length - 1] || '';\n if (items.length > 1) {\n addNewTokens(items.slice(0, -1));\n }\n setIncompleteTokenValue(tokenValue);\n onInputChange(tokenValue);\n }\n function handleDeleteKey(_deleteToken) {\n let preventDefault = false;\n if (hasFocus() && isInputEmpty()) {\n _deleteToken();\n preventDefault = true;\n }\n return preventDefault;\n }\n function handleLeftArrowKey() {\n let preventDefault = false;\n if (isInputEmpty()) {\n moveInputBeforePreviousToken();\n preventDefault = true;\n }\n return preventDefault;\n }\n function handleRightArrowKey() {\n let preventDefault = false;\n if (isInputEmpty()) {\n moveInputAfterNextToken();\n preventDefault = true;\n }\n return preventDefault;\n }\n function handleUpArrowKey() {\n setSelectedSuggestionIndex(index => {\n return (index === 0 ? getMatchingSuggestions(incompleteTokenValue, suggestions, value, maxSuggestions, saveTransform).length : index) - 1;\n });\n setSelectedSuggestionScroll(true);\n return true; // PreventDefault.\n }\n function handleDownArrowKey() {\n setSelectedSuggestionIndex(index => {\n return (index + 1) % getMatchingSuggestions(incompleteTokenValue, suggestions, value, maxSuggestions, saveTransform).length;\n });\n setSelectedSuggestionScroll(true);\n return true; // PreventDefault.\n }\n function collapseSuggestionsList(event) {\n if (event.target instanceof HTMLInputElement) {\n setIncompleteTokenValue(event.target.value);\n setIsExpanded(false);\n setSelectedSuggestionIndex(-1);\n setSelectedSuggestionScroll(false);\n }\n }\n function handleEscapeKey(event) {\n collapseSuggestionsList(event);\n return true; // PreventDefault.\n }\n function handleTabKey(event) {\n collapseSuggestionsList(event);\n return false; // Do not prevent the default behavior.\n }\n function handleCommaKey() {\n if (inputHasValidValue()) {\n addNewToken(incompleteTokenValue);\n }\n return true; // PreventDefault.\n }\n function moveInputToIndex(index) {\n setInputOffsetFromEnd(value.length - Math.max(index, -1) - 1);\n }\n function moveInputBeforePreviousToken() {\n setInputOffsetFromEnd(prevInputOffsetFromEnd => {\n return Math.min(prevInputOffsetFromEnd + 1, value.length);\n });\n }\n function moveInputAfterNextToken() {\n setInputOffsetFromEnd(prevInputOffsetFromEnd => {\n return Math.max(prevInputOffsetFromEnd - 1, 0);\n });\n }\n function deleteTokenBeforeInput() {\n const index = getIndexOfInput() - 1;\n if (index > -1) {\n deleteToken(value[index]);\n }\n }\n function deleteTokenAfterInput() {\n const index = getIndexOfInput();\n if (index < value.length) {\n deleteToken(value[index]);\n // Update input offset since it's the offset from the last token.\n moveInputToIndex(index);\n }\n }\n function addCurrentToken() {\n let preventDefault = false;\n const selectedSuggestion = getSelectedSuggestion();\n if (selectedSuggestion) {\n addNewToken(selectedSuggestion);\n preventDefault = true;\n } else if (inputHasValidValue()) {\n addNewToken(incompleteTokenValue);\n preventDefault = true;\n }\n return preventDefault;\n }\n function addNewTokens(tokens) {\n const tokensToAdd = [...new Set(tokens.map(saveTransform).filter(Boolean).filter(token => !valueContainsToken(token)))];\n if (tokensToAdd.length > 0) {\n const newValue = [...value];\n newValue.splice(getIndexOfInput(), 0, ...tokensToAdd);\n onChange(newValue);\n }\n }\n function addNewToken(token) {\n if (!__experimentalValidateInput(token)) {\n speak(messages.__experimentalInvalid, 'assertive');\n return;\n }\n addNewTokens([token]);\n speak(messages.added, 'assertive');\n setIncompleteTokenValue('');\n setSelectedSuggestionIndex(-1);\n setSelectedSuggestionScroll(false);\n setIsExpanded(!__experimentalExpandOnFocus);\n if (isActive && !tokenizeOnBlur) {\n focus();\n }\n }\n function deleteToken(token) {\n const newTokens = value.filter(item => {\n return getTokenValue(item) !== getTokenValue(token);\n });\n onChange(newTokens);\n speak(messages.removed, 'assertive');\n }\n function getTokenValue(token) {\n if ('object' === typeof token) {\n return token.value;\n }\n return token;\n }\n function getMatchingSuggestions(searchValue = incompleteTokenValue, _suggestions = suggestions, _value = value, _maxSuggestions = maxSuggestions, _saveTransform = saveTransform) {\n let match = _saveTransform(searchValue);\n const startsWithMatch = [];\n const containsMatch = [];\n const normalizedValue = _value.map(item => {\n if (typeof item === 'string') {\n return item;\n }\n return item.value;\n });\n if (match.length === 0) {\n _suggestions = _suggestions.filter(suggestion => !normalizedValue.includes(suggestion));\n } else {\n match = match.normalize('NFKC').toLocaleLowerCase();\n _suggestions.forEach(suggestion => {\n const index = suggestion.normalize('NFKC').toLocaleLowerCase().indexOf(match);\n if (normalizedValue.indexOf(suggestion) === -1) {\n if (index === 0) {\n startsWithMatch.push(suggestion);\n } else if (index > 0) {\n containsMatch.push(suggestion);\n }\n }\n });\n _suggestions = startsWithMatch.concat(containsMatch);\n }\n return _suggestions.slice(0, _maxSuggestions);\n }\n function getSelectedSuggestion() {\n if (selectedSuggestionIndex !== -1) {\n return getMatchingSuggestions()[selectedSuggestionIndex];\n }\n return undefined;\n }\n function valueContainsToken(token) {\n return value.some(item => {\n return getTokenValue(token) === getTokenValue(item);\n });\n }\n function getIndexOfInput() {\n return value.length - inputOffsetFromEnd;\n }\n function isInputEmpty() {\n return incompleteTokenValue.length === 0;\n }\n function inputHasValidValue() {\n return saveTransform(incompleteTokenValue).length > 0;\n }\n function updateSuggestions(resetSelectedSuggestion = true) {\n const inputHasMinimumChars = incompleteTokenValue.trim().length > 1;\n const matchingSuggestions = getMatchingSuggestions(incompleteTokenValue);\n const hasMatchingSuggestions = matchingSuggestions.length > 0;\n const shouldExpandIfFocuses = hasFocus() && __experimentalExpandOnFocus;\n setIsExpanded(shouldExpandIfFocuses || inputHasMinimumChars && hasMatchingSuggestions);\n if (resetSelectedSuggestion) {\n if (__experimentalAutoSelectFirstMatch && inputHasMinimumChars && hasMatchingSuggestions) {\n setSelectedSuggestionIndex(0);\n setSelectedSuggestionScroll(true);\n } else {\n setSelectedSuggestionIndex(-1);\n setSelectedSuggestionScroll(false);\n }\n }\n if (inputHasMinimumChars) {\n const message = hasMatchingSuggestions ? sprintf(/* translators: %d: number of results. */\n _n('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length) : __('No results.');\n debouncedSpeak(message, 'assertive');\n }\n }\n function renderTokensAndInput() {\n const components = value.map(renderToken);\n components.splice(getIndexOfInput(), 0, renderInput());\n return components;\n }\n function renderToken(token, index, tokens) {\n const _value = getTokenValue(token);\n const status = typeof token !== 'string' ? token.status : undefined;\n const termPosition = index + 1;\n const termsCount = tokens.length;\n return /*#__PURE__*/_jsx(FlexItem, {\n children: /*#__PURE__*/_jsx(Token, {\n value: _value,\n status: status,\n title: typeof token !== 'string' ? token.title : undefined,\n displayTransform: displayTransform,\n onClickRemove: onTokenClickRemove,\n isBorderless: typeof token !== 'string' && token.isBorderless || isBorderless,\n onMouseEnter: typeof token !== 'string' ? token.onMouseEnter : undefined,\n onMouseLeave: typeof token !== 'string' ? token.onMouseLeave : undefined,\n disabled: 'error' !== status && disabled,\n messages: messages,\n termsCount: termsCount,\n termPosition: termPosition\n })\n }, 'token-' + _value);\n }\n function renderInput() {\n const describedById = computedHelp ? `components-form-token-input-${instanceId}__help` : undefined;\n const inputProps = {\n instanceId,\n autoCapitalize,\n autoComplete,\n placeholder: value.length === 0 ? placeholder : '',\n disabled,\n value: incompleteTokenValue,\n onBlur,\n isExpanded,\n selectedSuggestionIndex,\n 'aria-describedby': describedById\n };\n return /*#__PURE__*/_jsx(TokenInput, {\n ...inputProps,\n onChange: !(maxLength && value.length >= maxLength) ? onInputChangeHandler : undefined,\n ref: input\n }, \"input\");\n }\n const classes = clsx(className, 'components-form-token-field__input-container', {\n 'is-active': isActive,\n 'is-disabled': disabled\n });\n let tokenFieldProps = {\n className: 'components-form-token-field',\n tabIndex: -1\n };\n const matchingSuggestions = getMatchingSuggestions();\n if (!disabled) {\n tokenFieldProps = Object.assign({}, tokenFieldProps, {\n onKeyDown: withIgnoreIMEEvents(onKeyDown),\n onKeyPress,\n onFocus: onFocusHandler\n });\n }\n\n // Disable reason: There is no appropriate role which describes the\n // input container intended accessible usability.\n // TODO: Refactor click detection to use blur to stop propagation.\n /* eslint-disable jsx-a11y/no-static-element-interactions */\n return /*#__PURE__*/_jsxs(\"div\", {\n ...tokenFieldProps,\n children: [label && /*#__PURE__*/_jsx(StyledLabel, {\n htmlFor: `components-form-token-input-${instanceId}`,\n className: \"components-form-token-field__label\",\n children: label\n }), /*#__PURE__*/_jsxs(\"div\", {\n ref: tokensAndInput,\n className: classes,\n tabIndex: -1,\n onMouseDown: onContainerTouched,\n onTouchStart: onContainerTouched,\n children: [/*#__PURE__*/_jsx(TokensAndInputWrapperFlex, {\n justify: \"flex-start\",\n align: \"center\",\n gap: 1,\n wrap: true,\n __next40pxDefaultSize: __next40pxDefaultSize,\n hasTokens: !!value.length,\n children: renderTokensAndInput()\n }), isExpanded && /*#__PURE__*/_jsx(SuggestionsList, {\n instanceId: instanceId,\n match: saveTransform(incompleteTokenValue),\n displayTransform: displayTransform,\n suggestions: matchingSuggestions,\n selectedIndex: selectedSuggestionIndex,\n scrollIntoView: selectedSuggestionScroll,\n onHover: onSuggestionHovered,\n onSelect: onSuggestionSelected,\n __experimentalRenderItem: __experimentalRenderItem\n })]\n }), computedHelp && /*#__PURE__*/_jsx(StyledHelp, {\n id: `components-form-token-input-${instanceId}__help`,\n className: \"components-form-token-field__help\",\n children: computedHelp\n })]\n });\n /* eslint-enable jsx-a11y/no-static-element-interactions */\n}\nexport default FormTokenField;"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAIjB,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,aAAa,eAAe,mBAAmB;AACxD,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAC/B,OAAO,gBAAgB;AAKvB,OAAO,WAAW;AAClB,OAAO,gBAAgB;AACvB,SAAS,iCAAiC;AAC1C,OAAO,qBAAqB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,YAAY,mBAAmB;AACxC,SAAS,wCAAwC;AACjD,SAAS,2BAA2B;AACpC,SAAS,mCAAmC;AAC5C,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,IAAM,WAAW,WAAS;AAYnB,SAAS,eAAe,OAAO;AACpC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ,GAAG,UAAU;AAAA,IACrB;AAAA,IACA,cAAc,CAAC;AAAA,IACf,iBAAiB;AAAA,IACjB,QAAQ,CAAC;AAAA,IACT,mBAAmB;AAAA,IACnB,gBAAgB,WAAS,MAAM,KAAK;AAAA,IACpC,WAAW,MAAM;AAAA,IAAC;AAAA,IAClB,gBAAgB,MAAM;AAAA,IAAC;AAAA,IACvB,UAAU;AAAA,IACV,eAAe;AAAA,IACf,WAAW;AAAA,IACX,kBAAk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eAAe;AAAA,QACf,gBAAgB;AAAA,QAChB,SAAS;AAAA,QACT,UAAU;AAAA,QACV;AAAA,MACF,CAAC,CAAC;AAAA,IACJ,CAAC,GAAG,gBAA6B,qBAAK,YAAY;AAAA,MAChD,IAAI,+BAA+B,UAAU;AAAA,MAC7C,WAAW;AAAA,MACX,UAAU;AAAA,IACZ,CAAC,CAAC;AAAA,EACJ,CAAC;AAEH;AACA,IAAO,2BAAQ;",
6
6
  "names": ["matchingSuggestions"]
7
7
  }
@@ -55,7 +55,7 @@ function UnForwardedTokenInput(props, ref) {
55
55
  // - the list of suggestions are rendered in the DOM (`isExpanded`)
56
56
  hasFocus && selectedSuggestionIndex !== -1 && isExpanded ? `components-form-token-suggestions-${instanceId}-${selectedSuggestionIndex}` : void 0
57
57
  ),
58
- "aria-describedby": [`components-form-token-suggestions-howto-${instanceId}`, ariaDescribedBy].filter(Boolean).join(" ")
58
+ "aria-describedby": ariaDescribedBy
59
59
  });
60
60
  }
61
61
  var TokenInput = forwardRef(UnForwardedTokenInput);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/form-token-field/token-input.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function UnForwardedTokenInput(props, ref) {\n const {\n value,\n isExpanded,\n instanceId,\n selectedSuggestionIndex,\n className,\n onChange,\n onFocus,\n onBlur,\n 'aria-describedby': ariaDescribedBy,\n ...restProps\n } = props;\n const [hasFocus, setHasFocus] = useState(false);\n const size = value ? value.length + 1 : 0;\n const onChangeHandler = event => {\n if (onChange) {\n onChange({\n value: event.target.value\n });\n }\n };\n const onFocusHandler = e => {\n setHasFocus(true);\n onFocus?.(e);\n };\n const onBlurHandler = e => {\n setHasFocus(false);\n onBlur?.(e);\n };\n return /*#__PURE__*/_jsx(\"input\", {\n ref: ref,\n id: `components-form-token-input-${instanceId}`,\n type: \"text\",\n ...restProps,\n value: value || '',\n onChange: onChangeHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler,\n size: size,\n className: clsx(className, 'components-form-token-field__input'),\n autoComplete: \"off\",\n role: \"combobox\",\n \"aria-expanded\": isExpanded,\n \"aria-autocomplete\": \"list\",\n \"aria-owns\": isExpanded ? `components-form-token-suggestions-${instanceId}` : undefined,\n \"aria-activedescendant\":\n // Only add the `aria-activedescendant` attribute when:\n // - the user is actively interacting with the input (`hasFocus`)\n // - there is a selected suggestion (`selectedSuggestionIndex !== -1`)\n // - the list of suggestions are rendered in the DOM (`isExpanded`)\n hasFocus && selectedSuggestionIndex !== -1 && isExpanded ? `components-form-token-suggestions-${instanceId}-${selectedSuggestionIndex}` : undefined,\n \"aria-describedby\": [`components-form-token-suggestions-howto-${instanceId}`, ariaDescribedBy].filter(Boolean).join(' ')\n });\n}\nexport const TokenInput = forwardRef(UnForwardedTokenInput);\nTokenInput.displayName = 'TokenInput';\nexport default TokenInput;"],
5
- "mappings": ";AAGA,OAAO,UAAU;AAIjB,SAAS,YAAY,gBAAgB;AAKrC,SAAS,OAAO,YAAY;AACrB,SAAS,sBAAsB,OAAO,KAAK;AAChD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,OAAO,QAAQ,MAAM,SAAS,IAAI;AACxC,QAAM,kBAAkB,WAAS;AAC/B,QAAI,UAAU;AACZ,eAAS;AAAA,QACP,OAAO,MAAM,OAAO;AAAA,MACtB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,iBAAiB,OAAK;AAC1B,gBAAY,IAAI;AAChB,cAAU,CAAC;AAAA,EACb;AACA,QAAM,gBAAgB,OAAK;AACzB,gBAAY,KAAK;AACjB,aAAS,CAAC;AAAA,EACZ;AACA,SAAoB,qBAAK,SAAS;AAAA,IAChC;AAAA,IACA,IAAI,+BAA+B,UAAU;AAAA,IAC7C,MAAM;AAAA,IACN,GAAG;AAAA,IACH,OAAO,SAAS;AAAA,IAChB,UAAU;AAAA,IACV,SAAS;AAAA,IACT,QAAQ;AAAA,IACR;AAAA,IACA,WAAW,KAAK,WAAW,oCAAoC;AAAA,IAC/D,cAAc;AAAA,IACd,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,aAAa,aAAa,qCAAqC,UAAU,KAAK;AAAA,IAC9E;AAAA;AAAA;AAAA;AAAA;AAAA,MAKA,YAAY,4BAA4B,MAAM,aAAa,qCAAqC,UAAU,IAAI,uBAAuB,KAAK;AAAA;AAAA,IAC1I,oBAAoB,CAAC,2CAA2C,UAAU,IAAI,eAAe,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,EACzH,CAAC;AACH;AACO,IAAM,aAAa,WAAW,qBAAqB;AAC1D,WAAW,cAAc;AACzB,IAAO,sBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function UnForwardedTokenInput(props, ref) {\n const {\n value,\n isExpanded,\n instanceId,\n selectedSuggestionIndex,\n className,\n onChange,\n onFocus,\n onBlur,\n 'aria-describedby': ariaDescribedBy,\n ...restProps\n } = props;\n const [hasFocus, setHasFocus] = useState(false);\n const size = value ? value.length + 1 : 0;\n const onChangeHandler = event => {\n if (onChange) {\n onChange({\n value: event.target.value\n });\n }\n };\n const onFocusHandler = e => {\n setHasFocus(true);\n onFocus?.(e);\n };\n const onBlurHandler = e => {\n setHasFocus(false);\n onBlur?.(e);\n };\n return /*#__PURE__*/_jsx(\"input\", {\n ref: ref,\n id: `components-form-token-input-${instanceId}`,\n type: \"text\",\n ...restProps,\n value: value || '',\n onChange: onChangeHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler,\n size: size,\n className: clsx(className, 'components-form-token-field__input'),\n autoComplete: \"off\",\n role: \"combobox\",\n \"aria-expanded\": isExpanded,\n \"aria-autocomplete\": \"list\",\n \"aria-owns\": isExpanded ? `components-form-token-suggestions-${instanceId}` : undefined,\n \"aria-activedescendant\":\n // Only add the `aria-activedescendant` attribute when:\n // - the user is actively interacting with the input (`hasFocus`)\n // - there is a selected suggestion (`selectedSuggestionIndex !== -1`)\n // - the list of suggestions are rendered in the DOM (`isExpanded`)\n hasFocus && selectedSuggestionIndex !== -1 && isExpanded ? `components-form-token-suggestions-${instanceId}-${selectedSuggestionIndex}` : undefined,\n \"aria-describedby\": ariaDescribedBy\n });\n}\nexport const TokenInput = forwardRef(UnForwardedTokenInput);\nTokenInput.displayName = 'TokenInput';\nexport default TokenInput;"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAIjB,SAAS,YAAY,gBAAgB;AAKrC,SAAS,OAAO,YAAY;AACrB,SAAS,sBAAsB,OAAO,KAAK;AAChD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,KAAK;AAC9C,QAAM,OAAO,QAAQ,MAAM,SAAS,IAAI;AACxC,QAAM,kBAAkB,WAAS;AAC/B,QAAI,UAAU;AACZ,eAAS;AAAA,QACP,OAAO,MAAM,OAAO;AAAA,MACtB,CAAC;AAAA,IACH;AAAA,EACF;AACA,QAAM,iBAAiB,OAAK;AAC1B,gBAAY,IAAI;AAChB,cAAU,CAAC;AAAA,EACb;AACA,QAAM,gBAAgB,OAAK;AACzB,gBAAY,KAAK;AACjB,aAAS,CAAC;AAAA,EACZ;AACA,SAAoB,qBAAK,SAAS;AAAA,IAChC;AAAA,IACA,IAAI,+BAA+B,UAAU;AAAA,IAC7C,MAAM;AAAA,IACN,GAAG;AAAA,IACH,OAAO,SAAS;AAAA,IAChB,UAAU;AAAA,IACV,SAAS;AAAA,IACT,QAAQ;AAAA,IACR;AAAA,IACA,WAAW,KAAK,WAAW,oCAAoC;AAAA,IAC/D,cAAc;AAAA,IACd,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,qBAAqB;AAAA,IACrB,aAAa,aAAa,qCAAqC,UAAU,KAAK;AAAA,IAC9E;AAAA;AAAA;AAAA;AAAA;AAAA,MAKA,YAAY,4BAA4B,MAAM,aAAa,qCAAqC,UAAU,IAAI,uBAAuB,KAAK;AAAA;AAAA,IAC1I,oBAAoB;AAAA,EACtB,CAAC;AACH;AACO,IAAM,aAAa,WAAW,qBAAqB;AAC1D,WAAW,cAAc;AACzB,IAAO,sBAAQ;",
6
6
  "names": []
7
7
  }
@@ -6,7 +6,6 @@ import { Context } from "./context.mjs";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  var Popover = forwardRef(function Popover2({
8
8
  gutter,
9
- children,
10
9
  shift,
11
10
  modal = true,
12
11
  ...otherProps
@@ -27,6 +26,12 @@ var Popover = forwardRef(function Popover2({
27
26
  if (!menuContext?.store) {
28
27
  throw new Error("Menu.Popover can only be rendered inside a Menu component");
29
28
  }
29
+ const renderMenu = useCallback((htmlProps) => /* @__PURE__ */ _jsx(Styled.MenuMotionRoot, {
30
+ children: /* @__PURE__ */ _jsx(Styled.MenuSurface, {
31
+ ...htmlProps,
32
+ variant: menuContext.variant
33
+ })
34
+ }), [menuContext.variant]);
30
35
  return /* @__PURE__ */ _jsx(Styled.Menu, {
31
36
  ...otherProps,
32
37
  ref,
@@ -40,8 +45,7 @@ var Popover = forwardRef(function Popover2({
40
45
  wrapperProps,
41
46
  hideOnEscape,
42
47
  unmountOnHide: true,
43
- variant: menuContext.variant,
44
- children
48
+ render: renderMenu
45
49
  });
46
50
  });
47
51
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/menu/popover.tsx"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo, forwardRef, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport * as Styled from './styles';\nimport { Context } from './context';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const Popover = forwardRef(function Popover({\n gutter,\n children,\n shift,\n modal = true,\n ...otherProps\n}, ref) {\n const menuContext = useContext(Context);\n\n // Extract the side from the applied placement \u2014 useful for animations.\n // Using `currentPlacement` instead of `placement` to make sure that we\n // use the final computed placement (including \"flips\" etc).\n const appliedPlacementSide = Ariakit.useStoreState(menuContext?.store, 'currentPlacement')?.split('-')[0];\n const hideOnEscape = useCallback(event => {\n // Pressing Escape can cause unexpected consequences (ie. exiting\n // full screen mode on MacOs, close parent modals...).\n event.preventDefault();\n // Returning `true` causes the menu to hide.\n return true;\n }, []);\n const computedDirection = Ariakit.useStoreState(menuContext?.store, 'rtl') ? 'rtl' : 'ltr';\n const wrapperProps = useMemo(() => ({\n dir: computedDirection,\n style: {\n direction: computedDirection\n }\n }), [computedDirection]);\n if (!menuContext?.store) {\n throw new Error('Menu.Popover can only be rendered inside a Menu component');\n }\n return /*#__PURE__*/_jsx(Styled.Menu, {\n ...otherProps,\n ref: ref,\n modal: modal,\n store: menuContext.store\n // Root menu has an 8px distance from its trigger,\n // otherwise 0 (which causes the submenu to slightly overlap)\n ,\n gutter: gutter ?? (menuContext.store.parent ? 0 : 8)\n // Align nested menu by the same (but opposite) amount\n // as the menu container's padding.\n ,\n shift: shift ?? (menuContext.store.parent ? -4 : 0),\n hideOnHoverOutside: false,\n \"data-side\": appliedPlacementSide,\n \"data-submenu\": !!menuContext.store.parent || undefined,\n wrapperProps: wrapperProps,\n hideOnEscape: hideOnEscape,\n unmountOnHide: true,\n variant: menuContext.variant,\n children: children\n });\n});"],
5
- "mappings": ";AAGA,YAAY,aAAa;AAKzB,SAAS,YAAY,SAAS,YAAY,mBAAmB;AAM7D,YAAY,YAAY;AACxB,SAAS,eAAe;AACxB,SAAS,OAAO,YAAY;AACrB,IAAM,UAAU,WAAW,SAASA,SAAQ;AAAA,EACjD;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAAG,KAAK;AACN,QAAM,cAAc,WAAW,OAAO;AAKtC,QAAM,uBAA+B,sBAAc,aAAa,OAAO,kBAAkB,GAAG,MAAM,GAAG,EAAE,CAAC;AACxG,QAAM,eAAe,YAAY,WAAS;AAGxC,UAAM,eAAe;AAErB,WAAO;AAAA,EACT,GAAG,CAAC,CAAC;AACL,QAAM,oBAA4B,sBAAc,aAAa,OAAO,KAAK,IAAI,QAAQ;AACrF,QAAM,eAAe,QAAQ,OAAO;AAAA,IAClC,KAAK;AAAA,IACL,OAAO;AAAA,MACL,WAAW;AAAA,IACb;AAAA,EACF,IAAI,CAAC,iBAAiB,CAAC;AACvB,MAAI,CAAC,aAAa,OAAO;AACvB,UAAM,IAAI,MAAM,2DAA2D;AAAA,EAC7E;AACA,SAAoB,qBAAY,aAAM;AAAA,IACpC,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA,OAAO,YAAY;AAAA,IAInB,QAAQ,WAAW,YAAY,MAAM,SAAS,IAAI;AAAA,IAIlD,OAAO,UAAU,YAAY,MAAM,SAAS,KAAK;AAAA,IACjD,oBAAoB;AAAA,IACpB,aAAa;AAAA,IACb,gBAAgB,CAAC,CAAC,YAAY,MAAM,UAAU;AAAA,IAC9C;AAAA,IACA;AAAA,IACA,eAAe;AAAA,IACf,SAAS,YAAY;AAAA,IACrB;AAAA,EACF,CAAC;AACH,CAAC;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, useMemo, forwardRef, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport * as Styled from './styles';\nimport { Context } from './context';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const Popover = forwardRef(function Popover({\n gutter,\n shift,\n modal = true,\n ...otherProps\n}, ref) {\n const menuContext = useContext(Context);\n\n // Extract the side from the applied placement \u2014 useful for animations.\n // Using `currentPlacement` instead of `placement` to make sure that we\n // use the final computed placement (including \"flips\" etc).\n const appliedPlacementSide = Ariakit.useStoreState(menuContext?.store, 'currentPlacement')?.split('-')[0];\n const hideOnEscape = useCallback(event => {\n // Pressing Escape can cause unexpected consequences (ie. exiting\n // full screen mode on MacOs, close parent modals...).\n event.preventDefault();\n // Returning `true` causes the menu to hide.\n return true;\n }, []);\n const computedDirection = Ariakit.useStoreState(menuContext?.store, 'rtl') ? 'rtl' : 'ltr';\n const wrapperProps = useMemo(() => ({\n dir: computedDirection,\n style: {\n direction: computedDirection\n }\n }), [computedDirection]);\n if (!menuContext?.store) {\n throw new Error('Menu.Popover can only be rendered inside a Menu component');\n }\n const renderMenu = useCallback(htmlProps => /*#__PURE__*/_jsx(Styled.MenuMotionRoot, {\n children: /*#__PURE__*/_jsx(Styled.MenuSurface, {\n ...htmlProps,\n variant: menuContext.variant\n })\n }), [menuContext.variant]);\n return /*#__PURE__*/_jsx(Styled.Menu, {\n ...otherProps,\n ref: ref,\n modal: modal,\n store: menuContext.store\n // Root menu has an 8px distance from its trigger,\n // otherwise 0 (which causes the submenu to slightly overlap)\n ,\n gutter: gutter ?? (menuContext.store.parent ? 0 : 8)\n // Align nested menu by the same (but opposite) amount\n // as the menu container's padding.\n ,\n shift: shift ?? (menuContext.store.parent ? -4 : 0),\n hideOnHoverOutside: false,\n \"data-side\": appliedPlacementSide,\n \"data-submenu\": !!menuContext.store.parent || undefined,\n wrapperProps: wrapperProps,\n hideOnEsc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