@wordpress/components 28.2.0 → 28.3.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 (424) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/build/animation/index.js.map +1 -1
  3. package/build/autocomplete/autocompleter-ui.js +1 -0
  4. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  5. package/build/autocomplete/index.js.map +1 -1
  6. package/build/base-control/index.js +14 -7
  7. package/build/base-control/index.js.map +1 -1
  8. package/build/border-box-control/border-box-control-visualizer/component.js +0 -4
  9. package/build/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  10. package/build/button/index.js +5 -3
  11. package/build/button/index.js.map +1 -1
  12. package/build/button/types.js.map +1 -1
  13. package/build/combobox-control/index.js +4 -1
  14. package/build/combobox-control/index.js.map +1 -1
  15. package/build/composite/current/index.js.map +1 -1
  16. package/build/custom-select-control-v2/custom-select.js +57 -33
  17. package/build/custom-select-control-v2/custom-select.js.map +1 -1
  18. package/build/custom-select-control-v2/default-component/index.js +0 -1
  19. package/build/custom-select-control-v2/default-component/index.js.map +1 -1
  20. package/build/custom-select-control-v2/item.js +2 -0
  21. package/build/custom-select-control-v2/item.js.map +1 -1
  22. package/build/custom-select-control-v2/legacy-component/index.js +18 -6
  23. package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
  24. package/build/custom-select-control-v2/styles.js +90 -78
  25. package/build/custom-select-control-v2/styles.js.map +1 -1
  26. package/build/custom-select-control-v2/types.js.map +1 -1
  27. package/build/date-time/date-time/index.js +3 -1
  28. package/build/date-time/date-time/index.js.map +1 -1
  29. package/build/date-time/index.js +7 -0
  30. package/build/date-time/index.js.map +1 -1
  31. package/build/date-time/time/index.js +62 -145
  32. package/build/date-time/time/index.js.map +1 -1
  33. package/build/date-time/time-input/index.js +159 -0
  34. package/build/date-time/time-input/index.js.map +1 -0
  35. package/build/date-time/types.js.map +1 -1
  36. package/build/date-time/utils.js +64 -0
  37. package/build/date-time/utils.js.map +1 -1
  38. package/build/disclosure/index.js +0 -1
  39. package/build/disclosure/index.js.map +1 -1
  40. package/build/divider/component.js +0 -1
  41. package/build/divider/component.js.map +1 -1
  42. package/build/divider/types.js.map +1 -1
  43. package/build/dropdown-menu/index.js +1 -0
  44. package/build/dropdown-menu/index.js.map +1 -1
  45. package/build/dropdown-menu-v2/index.js +0 -1
  46. package/build/dropdown-menu-v2/index.js.map +1 -1
  47. package/build/dropdown-menu-v2/styles.js +15 -16
  48. package/build/dropdown-menu-v2/styles.js.map +1 -1
  49. package/build/dropdown-menu-v2/types.js.map +1 -1
  50. package/build/font-size-picker/font-size-picker-select.js +2 -2
  51. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  52. package/build/font-size-picker/index.js +1 -1
  53. package/build/font-size-picker/index.js.map +1 -1
  54. package/build/font-size-picker/utils.js +0 -4
  55. package/build/font-size-picker/utils.js.map +1 -1
  56. package/build/form-token-field/token.js +4 -1
  57. package/build/form-token-field/token.js.map +1 -1
  58. package/build/higher-order/with-spoken-messages/index.js +1 -2
  59. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  60. package/build/menu-items-choice/types.js.map +1 -1
  61. package/build/popover/index.js +0 -4
  62. package/build/popover/index.js.map +1 -1
  63. package/build/popover/utils.js +0 -1
  64. package/build/popover/utils.js.map +1 -1
  65. package/build/private-apis.js +2 -4
  66. package/build/private-apis.js.map +1 -1
  67. package/build/progress-bar/styles.js +19 -13
  68. package/build/progress-bar/styles.js.map +1 -1
  69. package/build/radio-group/context.js +0 -1
  70. package/build/radio-group/context.js.map +1 -1
  71. package/build/radio-group/index.js +0 -1
  72. package/build/radio-group/index.js.map +1 -1
  73. package/build/radio-group/radio.js +0 -1
  74. package/build/radio-group/radio.js.map +1 -1
  75. package/build/range-control/index.js +4 -1
  76. package/build/range-control/index.js.map +1 -1
  77. package/build/range-control/styles/range-control-styles.js +34 -28
  78. package/build/range-control/styles/range-control-styles.js.map +1 -1
  79. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  80. package/build/select-control/index.js +1 -2
  81. package/build/select-control/index.js.map +1 -1
  82. package/build/select-control/styles/select-control-styles.js +13 -8
  83. package/build/select-control/styles/select-control-styles.js.map +1 -1
  84. package/build/tab-panel/index.js +0 -1
  85. package/build/tab-panel/index.js.map +1 -1
  86. package/build/tabs/index.js +0 -1
  87. package/build/tabs/index.js.map +1 -1
  88. package/build/tabs/styles.js +3 -5
  89. package/build/tabs/styles.js.map +1 -1
  90. package/build/tabs/tablist.js +148 -37
  91. package/build/tabs/tablist.js.map +1 -1
  92. package/build/tabs/types.js.map +1 -1
  93. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +0 -2
  94. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  95. package/build/toggle-group-control/toggle-group-control/component.js +0 -2
  96. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  97. package/build/toggle-group-control/toggle-group-control-option-base/component.js +0 -4
  98. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  99. package/build/toolbar/toolbar/toolbar-container.js +0 -1
  100. package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
  101. package/build/toolbar/toolbar/types.js.map +1 -1
  102. package/build/toolbar/toolbar-button/index.js +27 -19
  103. package/build/toolbar/toolbar-button/index.js.map +1 -1
  104. package/build/toolbar/toolbar-button/types.js.map +1 -1
  105. package/build/toolbar/toolbar-context/index.js +0 -1
  106. package/build/toolbar/toolbar-context/index.js.map +1 -1
  107. package/build/toolbar/toolbar-item/index.js +1 -1
  108. package/build/toolbar/toolbar-item/index.js.map +1 -1
  109. package/build/tooltip/index.js +3 -2
  110. package/build/tooltip/index.js.map +1 -1
  111. package/build/tooltip/types.js.map +1 -1
  112. package/build/unit-control/index.js +3 -3
  113. package/build/unit-control/index.js.map +1 -1
  114. package/build/unit-control/styles/unit-control-styles.js +7 -7
  115. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  116. package/build/utils/hooks/use-update-effect.js +4 -1
  117. package/build/utils/hooks/use-update-effect.js.map +1 -1
  118. package/build-module/animation/index.js +0 -1
  119. package/build-module/animation/index.js.map +1 -1
  120. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  121. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  122. package/build-module/autocomplete/index.js.map +1 -1
  123. package/build-module/base-control/index.js +13 -6
  124. package/build-module/base-control/index.js.map +1 -1
  125. package/build-module/border-box-control/border-box-control-visualizer/component.js +0 -4
  126. package/build-module/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  127. package/build-module/button/index.js +5 -3
  128. package/build-module/button/index.js.map +1 -1
  129. package/build-module/button/types.js.map +1 -1
  130. package/build-module/combobox-control/index.js +4 -1
  131. package/build-module/combobox-control/index.js.map +1 -1
  132. package/build-module/composite/current/index.js +0 -3
  133. package/build-module/composite/current/index.js.map +1 -1
  134. package/build-module/custom-select-control-v2/custom-select.js +58 -35
  135. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  136. package/build-module/custom-select-control-v2/default-component/index.js +0 -1
  137. package/build-module/custom-select-control-v2/default-component/index.js.map +1 -1
  138. package/build-module/custom-select-control-v2/item.js +2 -0
  139. package/build-module/custom-select-control-v2/item.js.map +1 -1
  140. package/build-module/custom-select-control-v2/legacy-component/index.js +18 -6
  141. package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
  142. package/build-module/custom-select-control-v2/styles.js +88 -76
  143. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  144. package/build-module/custom-select-control-v2/types.js.map +1 -1
  145. package/build-module/date-time/date-time/index.js +4 -1
  146. package/build-module/date-time/date-time/index.js.map +1 -1
  147. package/build-module/date-time/index.js +2 -1
  148. package/build-module/date-time/index.js.map +1 -1
  149. package/build-module/date-time/time/index.js +65 -149
  150. package/build-module/date-time/time/index.js.map +1 -1
  151. package/build-module/date-time/time-input/index.js +151 -0
  152. package/build-module/date-time/time-input/index.js.map +1 -0
  153. package/build-module/date-time/types.js.map +1 -1
  154. package/build-module/date-time/utils.js +61 -0
  155. package/build-module/date-time/utils.js.map +1 -1
  156. package/build-module/disclosure/index.js +0 -1
  157. package/build-module/disclosure/index.js.map +1 -1
  158. package/build-module/divider/component.js +0 -1
  159. package/build-module/divider/component.js.map +1 -1
  160. package/build-module/divider/types.js.map +1 -1
  161. package/build-module/dropdown-menu/index.js +1 -0
  162. package/build-module/dropdown-menu/index.js.map +1 -1
  163. package/build-module/dropdown-menu-v2/index.js +0 -1
  164. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  165. package/build-module/dropdown-menu-v2/styles.js +14 -15
  166. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  167. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  168. package/build-module/font-size-picker/font-size-picker-select.js +1 -1
  169. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  170. package/build-module/font-size-picker/index.js +1 -1
  171. package/build-module/font-size-picker/index.js.map +1 -1
  172. package/build-module/font-size-picker/utils.js +0 -4
  173. package/build-module/font-size-picker/utils.js.map +1 -1
  174. package/build-module/form-token-field/token.js +4 -1
  175. package/build-module/form-token-field/token.js.map +1 -1
  176. package/build-module/higher-order/with-spoken-messages/index.js +1 -2
  177. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  178. package/build-module/menu-items-choice/types.js.map +1 -1
  179. package/build-module/popover/index.js +0 -3
  180. package/build-module/popover/index.js.map +1 -1
  181. package/build-module/popover/utils.js +0 -1
  182. package/build-module/popover/utils.js.map +1 -1
  183. package/build-module/private-apis.js +2 -4
  184. package/build-module/private-apis.js.map +1 -1
  185. package/build-module/progress-bar/styles.js +21 -13
  186. package/build-module/progress-bar/styles.js.map +1 -1
  187. package/build-module/radio-group/context.js +0 -1
  188. package/build-module/radio-group/context.js.map +1 -1
  189. package/build-module/radio-group/index.js +0 -1
  190. package/build-module/radio-group/index.js.map +1 -1
  191. package/build-module/radio-group/radio.js +0 -1
  192. package/build-module/radio-group/radio.js.map +1 -1
  193. package/build-module/range-control/index.js +4 -1
  194. package/build-module/range-control/index.js.map +1 -1
  195. package/build-module/range-control/styles/range-control-styles.js +34 -28
  196. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  197. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  198. package/build-module/select-control/index.js +2 -3
  199. package/build-module/select-control/index.js.map +1 -1
  200. package/build-module/select-control/styles/select-control-styles.js +12 -7
  201. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  202. package/build-module/tab-panel/index.js +0 -1
  203. package/build-module/tab-panel/index.js.map +1 -1
  204. package/build-module/tabs/index.js +0 -1
  205. package/build-module/tabs/index.js.map +1 -1
  206. package/build-module/tabs/styles.js +3 -4
  207. package/build-module/tabs/styles.js.map +1 -1
  208. package/build-module/tabs/tablist.js +149 -38
  209. package/build-module/tabs/tablist.js.map +1 -1
  210. package/build-module/tabs/types.js.map +1 -1
  211. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +0 -1
  212. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  213. package/build-module/toggle-group-control/toggle-group-control/component.js +0 -1
  214. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  215. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +0 -2
  216. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  217. package/build-module/toolbar/toolbar/toolbar-container.js +0 -1
  218. package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
  219. package/build-module/toolbar/toolbar/types.js.map +1 -1
  220. package/build-module/toolbar/toolbar-button/index.js +27 -19
  221. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  222. package/build-module/toolbar/toolbar-button/types.js.map +1 -1
  223. package/build-module/toolbar/toolbar-context/index.js +0 -1
  224. package/build-module/toolbar/toolbar-context/index.js.map +1 -1
  225. package/build-module/toolbar/toolbar-item/index.js +1 -1
  226. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  227. package/build-module/tooltip/index.js +3 -2
  228. package/build-module/tooltip/index.js.map +1 -1
  229. package/build-module/tooltip/types.js.map +1 -1
  230. package/build-module/unit-control/index.js +3 -3
  231. package/build-module/unit-control/index.js.map +1 -1
  232. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  233. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  234. package/build-module/utils/hooks/use-update-effect.js +4 -1
  235. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  236. package/build-style/style-rtl.css +18 -0
  237. package/build-style/style.css +18 -0
  238. package/build-types/animation/index.d.ts.map +1 -1
  239. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  240. package/build-types/autocomplete/index.d.ts.map +1 -1
  241. package/build-types/base-control/index.d.ts +6 -20
  242. package/build-types/base-control/index.d.ts.map +1 -1
  243. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  244. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
  245. package/build-types/button/deprecated.d.ts +4 -4
  246. package/build-types/button/index.d.ts.map +1 -1
  247. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  248. package/build-types/button/types.d.ts +27 -10
  249. package/build-types/button/types.d.ts.map +1 -1
  250. package/build-types/combobox-control/index.d.ts.map +1 -1
  251. package/build-types/composite/current/index.d.ts.map +1 -1
  252. package/build-types/custom-select-control-v2/custom-select.d.ts +2 -2
  253. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  254. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
  255. package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
  256. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  257. package/build-types/custom-select-control-v2/stories/default.story.d.ts +6 -3
  258. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
  259. package/build-types/custom-select-control-v2/styles.d.ts +18 -26
  260. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  261. package/build-types/custom-select-control-v2/types.d.ts +12 -2
  262. package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
  263. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  264. package/build-types/date-time/index.d.ts +2 -1
  265. package/build-types/date-time/index.d.ts.map +1 -1
  266. package/build-types/date-time/stories/time-input.story.d.ts +12 -0
  267. package/build-types/date-time/stories/time-input.story.d.ts.map +1 -0
  268. package/build-types/date-time/time/index.d.ts +1 -1
  269. package/build-types/date-time/time/index.d.ts.map +1 -1
  270. package/build-types/date-time/time-input/index.d.ts +5 -0
  271. package/build-types/date-time/time-input/index.d.ts.map +1 -0
  272. package/build-types/date-time/time-input/test/index.d.ts +2 -0
  273. package/build-types/date-time/time-input/test/index.d.ts.map +1 -0
  274. package/build-types/date-time/types.d.ts +54 -0
  275. package/build-types/date-time/types.d.ts.map +1 -1
  276. package/build-types/date-time/utils.d.ts +40 -0
  277. package/build-types/date-time/utils.d.ts.map +1 -1
  278. package/build-types/disclosure/index.d.ts.map +1 -1
  279. package/build-types/divider/component.d.ts.map +1 -1
  280. package/build-types/divider/types.d.ts.map +1 -1
  281. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  282. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  283. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  284. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  285. package/build-types/font-size-picker/styles.d.ts +1 -1
  286. package/build-types/font-size-picker/utils.d.ts.map +1 -1
  287. package/build-types/form-token-field/token.d.ts.map +1 -1
  288. package/build-types/higher-order/with-spoken-messages/index.d.ts +1 -2
  289. package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
  290. package/build-types/menu-items-choice/types.d.ts +1 -1
  291. package/build-types/menu-items-choice/types.d.ts.map +1 -1
  292. package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
  293. package/build-types/navigator/navigator-back-button/hook.d.ts +1 -1
  294. package/build-types/navigator/navigator-button/component.d.ts +1 -1
  295. package/build-types/navigator/navigator-button/hook.d.ts +1 -1
  296. package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -1
  297. package/build-types/popover/index.d.ts.map +1 -1
  298. package/build-types/popover/utils.d.ts.map +1 -1
  299. package/build-types/private-apis.d.ts.map +1 -1
  300. package/build-types/progress-bar/styles.d.ts.map +1 -1
  301. package/build-types/radio-group/context.d.ts.map +1 -1
  302. package/build-types/radio-group/index.d.ts.map +1 -1
  303. package/build-types/radio-group/radio.d.ts.map +1 -1
  304. package/build-types/range-control/index.d.ts.map +1 -1
  305. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  306. package/build-types/resizable-box/resize-tooltip/utils.d.ts +2 -2
  307. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  308. package/build-types/select-control/index.d.ts.map +1 -1
  309. package/build-types/select-control/styles/select-control-styles.d.ts +5 -0
  310. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  311. package/build-types/tab-panel/index.d.ts.map +1 -1
  312. package/build-types/tabs/index.d.ts.map +1 -1
  313. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  314. package/build-types/tabs/styles.d.ts.map +1 -1
  315. package/build-types/tabs/tablist.d.ts.map +1 -1
  316. package/build-types/tabs/types.d.ts.map +1 -1
  317. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  318. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  319. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  320. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  321. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  322. package/build-types/toolbar/toolbar/types.d.ts +6 -0
  323. package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
  324. package/build-types/toolbar/toolbar-button/index.d.ts +3 -96
  325. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  326. package/build-types/toolbar/toolbar-button/types.d.ts +18 -0
  327. package/build-types/toolbar/toolbar-button/types.d.ts.map +1 -1
  328. package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
  329. package/build-types/toolbar/toolbar-item/index.d.ts +1 -3
  330. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  331. package/build-types/tooltip/index.d.ts.map +1 -1
  332. package/build-types/tooltip/types.d.ts +4 -0
  333. package/build-types/tooltip/types.d.ts.map +1 -1
  334. package/build-types/unit-control/index.d.ts.map +1 -1
  335. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  336. package/build-types/utils/hooks/use-update-effect.d.ts +1 -1
  337. package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
  338. package/package.json +19 -19
  339. package/src/animation/index.tsx +0 -1
  340. package/src/autocomplete/autocompleter-ui.tsx +1 -0
  341. package/src/autocomplete/index.tsx +0 -1
  342. package/src/base-control/index.tsx +16 -6
  343. package/src/base-control/stories/index.story.tsx +0 -1
  344. package/src/border-box-control/border-box-control-visualizer/component.tsx +0 -5
  345. package/src/button/README.md +13 -0
  346. package/src/button/index.tsx +6 -4
  347. package/src/button/stories/e2e/index.story.tsx +2 -1
  348. package/src/button/test/index.tsx +17 -2
  349. package/src/button/types.ts +27 -10
  350. package/src/combobox-control/index.tsx +2 -0
  351. package/src/composite/current/index.ts +0 -2
  352. package/src/custom-select-control/test/index.js +42 -6
  353. package/src/custom-select-control-v2/custom-select.tsx +57 -22
  354. package/src/custom-select-control-v2/default-component/index.tsx +0 -1
  355. package/src/custom-select-control-v2/item.tsx +5 -1
  356. package/src/custom-select-control-v2/legacy-component/index.tsx +28 -7
  357. package/src/custom-select-control-v2/legacy-component/test/index.tsx +44 -8
  358. package/src/custom-select-control-v2/styles.ts +153 -83
  359. package/src/custom-select-control-v2/test/index.tsx +35 -5
  360. package/src/custom-select-control-v2/types.ts +18 -6
  361. package/src/date-time/README.md +8 -0
  362. package/src/date-time/date-time/index.tsx +2 -1
  363. package/src/date-time/index.ts +2 -1
  364. package/src/date-time/stories/time-input.story.tsx +36 -0
  365. package/src/date-time/time/index.tsx +77 -194
  366. package/src/date-time/time/test/index.tsx +61 -0
  367. package/src/date-time/time-input/index.tsx +196 -0
  368. package/src/date-time/time-input/test/index.tsx +171 -0
  369. package/src/date-time/types.ts +63 -0
  370. package/src/date-time/utils.ts +69 -0
  371. package/src/dimension-control/test/__snapshots__/index.test.js.snap +116 -96
  372. package/src/disclosure/index.tsx +0 -1
  373. package/src/divider/component.tsx +0 -1
  374. package/src/divider/types.ts +0 -1
  375. package/src/dropdown-menu/index.tsx +1 -0
  376. package/src/dropdown-menu-v2/index.tsx +0 -1
  377. package/src/dropdown-menu-v2/styles.ts +0 -1
  378. package/src/dropdown-menu-v2/types.ts +0 -1
  379. package/src/font-size-picker/font-size-picker-select.tsx +1 -1
  380. package/src/font-size-picker/index.tsx +1 -1
  381. package/src/font-size-picker/test/index.tsx +6 -6
  382. package/src/font-size-picker/utils.ts +0 -5
  383. package/src/form-token-field/token.tsx +2 -0
  384. package/src/higher-order/navigate-regions/style.scss +25 -13
  385. package/src/higher-order/with-spoken-messages/index.tsx +1 -2
  386. package/src/menu-items-choice/types.ts +2 -1
  387. package/src/palette-edit/test/index.tsx +1 -0
  388. package/src/popover/index.tsx +0 -2
  389. package/src/popover/utils.ts +0 -1
  390. package/src/private-apis.ts +2 -5
  391. package/src/progress-bar/styles.ts +18 -9
  392. package/src/radio-group/context.tsx +0 -1
  393. package/src/radio-group/index.tsx +0 -1
  394. package/src/radio-group/radio.tsx +0 -1
  395. package/src/range-control/index.tsx +2 -0
  396. package/src/range-control/styles/range-control-styles.ts +6 -2
  397. package/src/resizable-box/resize-tooltip/utils.ts +1 -1
  398. package/src/select-control/index.tsx +3 -4
  399. package/src/select-control/styles/select-control-styles.ts +17 -6
  400. package/src/tab-panel/index.tsx +0 -1
  401. package/src/tabs/index.tsx +0 -1
  402. package/src/tabs/stories/index.story.tsx +25 -18
  403. package/src/tabs/styles.ts +18 -14
  404. package/src/tabs/tablist.tsx +187 -43
  405. package/src/tabs/types.ts +0 -1
  406. package/src/theme/stories/index.story.tsx +2 -0
  407. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +0 -1
  408. package/src/toggle-group-control/toggle-group-control/component.tsx +0 -2
  409. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +0 -2
  410. package/src/toolbar/toolbar/README.md +9 -0
  411. package/src/toolbar/toolbar/style.scss +7 -0
  412. package/src/toolbar/toolbar/toolbar-container.tsx +0 -1
  413. package/src/toolbar/toolbar/types.ts +6 -0
  414. package/src/toolbar/toolbar-button/index.tsx +30 -17
  415. package/src/toolbar/toolbar-button/types.ts +19 -0
  416. package/src/toolbar/toolbar-context/index.ts +0 -1
  417. package/src/toolbar/toolbar-item/index.tsx +1 -1
  418. package/src/tooltip/index.tsx +3 -2
  419. package/src/tooltip/test/index.tsx +18 -0
  420. package/src/tooltip/types.ts +4 -0
  421. package/src/unit-control/index.tsx +3 -2
  422. package/src/unit-control/styles/unit-control-styles.ts +10 -4
  423. package/src/utils/hooks/use-update-effect.js +8 -1
  424. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","css","keyframes","COLORS","font","rtl","CONFIG","space","Icon","Truncate","ANIMATION_PARAMS","SLIDE_AMOUNT","DURATION","EASING","CONTENT_WRAPPER_PADDING","ITEM_PADDING_BLOCK","ITEM_PADDING_INLINE","DEFAULT_BORDER_COLOR","gray","DIVIDER_COLOR","TOOLBAR_VARIANT_BORDER_COLOR","DEFAULT_BOX_SHADOW","borderWidth","popoverShadow","TOOLBAR_VARIANT_BOX_SHADOW","GRID_TEMPLATE_COLS","slideUpAndFade","opacity","transform","slideRightAndFade","slideDownAndFade","slideLeftAndFade","DropdownMenu","_styled","Menu","process","env","NODE_ENV","target","label","ui","background","props","variant","baseItem","radiusBlockUi","textDisabled","theme","accent","white","DropdownMenuItem","MenuItem","DropdownMenuCheckboxItem","MenuItemCheckbox","DropdownMenuRadioItem","MenuItemRadio","ItemPrefixWrapper","DropdownMenuItemContentWrapper","DropdownMenuItemChildrenWrapper","ItemSuffixWrapper","DropdownMenuGroup","MenuGroup","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","DropdownMenuSeparator","MenuSeparator","SubmenuChevronIcon","DropdownMenuItemLabel","DropdownMenuItemHelpText"],"sources":["@wordpress/components/src/dropdown-menu-v2/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\nimport { css, keyframes } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, font, rtl, CONFIG } from '../utils';\nimport { space } from '../utils/space';\nimport Icon from '../icon';\nimport { Truncate } from '../truncate';\nimport type { DropdownMenuContext } from './types';\n\nconst ANIMATION_PARAMS = {\n\tSLIDE_AMOUNT: '2px',\n\tDURATION: '400ms',\n\tEASING: 'cubic-bezier( 0.16, 1, 0.3, 1 )',\n};\n\nconst CONTENT_WRAPPER_PADDING = space( 1 );\nconst ITEM_PADDING_BLOCK = space( 2 );\nconst ITEM_PADDING_INLINE = space( 3 );\n\n// TODO:\n// - those values are different from saved variables?\n// - should bring this into the config, and make themeable\n// - border color and divider color are different?\nconst DEFAULT_BORDER_COLOR = COLORS.gray[ 300 ];\nconst DIVIDER_COLOR = COLORS.gray[ 200 ];\nconst TOOLBAR_VARIANT_BORDER_COLOR = COLORS.gray[ '900' ];\nconst DEFAULT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ DEFAULT_BORDER_COLOR }, ${ CONFIG.popoverShadow }`;\nconst TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ TOOLBAR_VARIANT_BORDER_COLOR }`;\n\nconst GRID_TEMPLATE_COLS = 'minmax( 0, max-content ) 1fr';\n\nconst slideUpAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateY(${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateY(0)' },\n} );\n\nconst slideRightAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateX(-${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateX(0)' },\n} );\n\nconst slideDownAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateY(-${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateY(0)' },\n} );\n\nconst slideLeftAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateX(${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateX(0)' },\n} );\n\nexport const DropdownMenu = styled( Ariakit.Menu )<\n\tPick< DropdownMenuContext, 'variant' >\n>`\n\tposition: relative;\n\t/* Same as popover component */\n\t/* TODO: is there a way to read the sass variable? */\n\tz-index: 1000000;\n\n\tdisplay: grid;\n\tgrid-template-columns: ${ GRID_TEMPLATE_COLS };\n\tgrid-template-rows: auto;\n\n\tbox-sizing: border-box;\n\tmin-width: 160px;\n\tmax-width: 320px;\n\tmax-height: var( --popover-available-height );\n\tpadding: ${ CONTENT_WRAPPER_PADDING };\n\n\tbackground-color: ${ COLORS.ui.background };\n\tborder-radius: 4px;\n\t${ ( props ) => css`\n\t\tbox-shadow: ${ props.variant === 'toolbar'\n\t\t\t? TOOLBAR_VARIANT_BOX_SHADOW\n\t\t\t: DEFAULT_BOX_SHADOW };\n\t` }\n\n\toverscroll-behavior: contain;\n\toverflow: auto;\n\n\t/* Only visible in Windows High Contrast mode */\n\toutline: 2px solid transparent !important;\n\n\t/* Animation */\n\tanimation-duration: ${ ANIMATION_PARAMS.DURATION };\n\tanimation-timing-function: ${ ANIMATION_PARAMS.EASING };\n\twill-change: transform, opacity;\n\t/* Default animation.*/\n\tanimation-name: ${ slideDownAndFade };\n\n\t&[data-side='right'] {\n\t\tanimation-name: ${ slideLeftAndFade };\n\t}\n\t&[data-side='bottom'] {\n\t\tanimation-name: ${ slideUpAndFade };\n\t}\n\t&[data-side='left'] {\n\t\tanimation-name: ${ slideRightAndFade };\n\t}\n\t@media ( prefers-reduced-motion ) {\n\t\tanimation-duration: 0s;\n\t}\n`;\n\nconst baseItem = css`\n\tall: unset;\n\n\tposition: relative;\n\tmin-height: ${ space( 10 ) };\n\tbox-sizing: border-box;\n\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tdisplay: grid;\n\tgrid-template-columns: ${ GRID_TEMPLATE_COLS };\n\talign-items: center;\n\n\t@supports ( grid-template-columns: subgrid ) {\n\t\t/*\n\t\t * Define a grid layout which inherits the same columns configuration\n\t\t * from the parent layout (ie. subgrid). This allows the menu\n\t\t * to synchronize the indentation of all its items.\n\t\t */\n\t\tgrid-template-columns: subgrid;\n\t}\n\n\tfont-size: ${ font( 'default.fontSize' ) };\n\tfont-family: inherit;\n\tfont-weight: normal;\n\tline-height: 20px;\n\n\tcolor: ${ COLORS.gray[ 900 ] };\n\tborder-radius: ${ CONFIG.radiusBlockUi };\n\n\tpadding-block: ${ ITEM_PADDING_BLOCK };\n\tpadding-inline: ${ ITEM_PADDING_INLINE };\n\n\t/*\n\t * Make sure that, when an item is scrolled into view (eg. while using the\n\t * keyboard to move focus), the whole item comes into view\n\t */\n\tscroll-margin: ${ CONTENT_WRAPPER_PADDING };\n\n\tuser-select: none;\n\toutline: none;\n\n\t&[aria-disabled='true'] {\n\t\tcolor: ${ COLORS.ui.textDisabled };\n\t\tcursor: not-allowed;\n\t}\n\n\t/* Hover */\n\t&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t) {\n\t\tbackground-color: ${ COLORS.theme.accent };\n\t\tcolor: ${ COLORS.white };\n\t}\n\n\t/* Keyboard focus (focus-visible) */\n\t&[data-focus-visible] {\n\t\tbox-shadow: 0 0 0 1.5px ${ COLORS.theme.accent };\n\n\t\t/* Only visible in Windows High Contrast mode */\n\t\toutline: 2px solid transparent;\n\t}\n\n\t/* Active (ie. pressed, mouse down) */\n\t&:active,\n\t&[data-active] {\n\t\t/* TODO: should there be a visual active state? */\n\t}\n\n\t/* When the item is the trigger of an open submenu */\n\t${ DropdownMenu }:not(:focus) &:not(:focus)[aria-expanded=\"true\"] {\n\t\tbackground-color: ${ COLORS.gray[ 100 ] };\n\t\tcolor: ${ COLORS.gray[ 900 ] };\n\t}\n\n\tsvg {\n\t\tfill: currentColor;\n\t}\n`;\n\nexport const DropdownMenuItem = styled( Ariakit.MenuItem )`\n\t${ baseItem };\n`;\n\nexport const DropdownMenuCheckboxItem = styled( Ariakit.MenuItemCheckbox )`\n\t${ baseItem };\n`;\n\nexport const DropdownMenuRadioItem = styled( Ariakit.MenuItemRadio )`\n\t${ baseItem };\n`;\n\nexport const ItemPrefixWrapper = styled.span`\n\t/* Always occupy the first column, even when auto-collapsing */\n\tgrid-column: 1;\n\n\t/*\n\t * Even when the item is not checked, occupy the same screen space to avoid\n\t * the space collapside when no items are checked.\n\t */\n\t${ DropdownMenuCheckboxItem } > &,\n\t${ DropdownMenuRadioItem } > & {\n\t\t/* Same width as the check icons */\n\t\tmin-width: ${ space( 6 ) };\n\t}\n\n\t${ DropdownMenuCheckboxItem } > &,\n\t${ DropdownMenuRadioItem } > &,\n\t&:not( :empty ) {\n\t\tmargin-inline-end: ${ space( 2 ) };\n\t}\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\n\tcolor: ${ COLORS.gray[ '700' ] };\n\n\t/*\n\t* When the parent menu item is active, except when it's a non-focused/hovered\n\t* submenu trigger (in that case, color should not be inherited)\n\t*/\n\t[data-active-item]:not( [data-focus-visible] ) > &,\n\t/* When the parent menu item is disabled */\n\t[aria-disabled='true'] > & {\n\t\tcolor: inherit;\n\t}\n`;\n\nexport const DropdownMenuItemContentWrapper = styled.div`\n\t/*\n\t * Always occupy the second column, since the first column\n\t * is taken by the prefix wrapper (when displayed).\n\t */\n\tgrid-column: 2;\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: ${ space( 3 ) };\n\n\tpointer-events: none;\n`;\n\nexport const DropdownMenuItemChildrenWrapper = styled.div`\n\tflex: 1;\n\n\tdisplay: inline-flex;\n\tflex-direction: column;\n\tgap: ${ space( 1 ) };\n`;\n\nexport const ItemSuffixWrapper = styled.span`\n\tflex: 0 1 fit-content;\n\tmin-width: 0;\n\twidth: fit-content;\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: ${ space( 3 ) };\n\n\tcolor: ${ COLORS.gray[ '700' ] };\n\n\t/*\n\t * When the parent menu item is active, except when it's a non-focused/hovered\n\t * submenu trigger (in that case, color should not be inherited)\n\t */\n\t[data-active-item]:not( [data-focus-visible] ) *:not(${ DropdownMenu }) &,\n\t/* When the parent menu item is disabled */\n\t[aria-disabled='true'] *:not(${ DropdownMenu }) & {\n\t\tcolor: inherit;\n\t}\n`;\n\nexport const DropdownMenuGroup = styled( Ariakit.MenuGroup )`\n\t/* Ignore this element when calculating the layout. Useful for subgrid */\n\tdisplay: contents;\n`;\n\nexport const DropdownMenuSeparator = styled( Ariakit.MenuSeparator )<\n\tPick< DropdownMenuContext, 'variant' >\n>`\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tborder: none;\n\theight: ${ CONFIG.borderWidth };\n\tbackground-color: ${ ( props ) =>\n\t\tprops.variant === 'toolbar'\n\t\t\t? TOOLBAR_VARIANT_BORDER_COLOR\n\t\t\t: DIVIDER_COLOR };\n\t/* Align with menu items' content */\n\tmargin-block: ${ space( 2 ) };\n\tmargin-inline: ${ ITEM_PADDING_INLINE };\n\n\t/* Only visible in Windows High Contrast mode */\n\toutline: 2px solid transparent;\n`;\n\nexport const SubmenuChevronIcon = styled( Icon )`\n\twidth: ${ space( 1.5 ) };\n\t${ rtl(\n\t\t{\n\t\t\ttransform: `scaleX(1)`,\n\t\t},\n\t\t{\n\t\t\ttransform: `scaleX(-1)`,\n\t\t}\n\t) };\n`;\n\nexport const DropdownMenuItemLabel = styled( Truncate )`\n\tfont-size: ${ font( 'default.fontSize' ) };\n\tline-height: 20px;\n\tcolor: inherit;\n`;\n\nexport const DropdownMenuItemHelpText = styled( Truncate )`\n\tfont-size: ${ font( 'helpText.fontSize' ) };\n\tline-height: 16px;\n\tcolor: ${ COLORS.gray[ '700' ] };\n\n\t[data-active-item]:not( [data-focus-visible] ) *:not( ${ DropdownMenu } ) &,\n\t[aria-disabled='true'] *:not( ${ DropdownMenu } ) & {\n\t\tcolor: inherit;\n\t}\n`;\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,SAASC,GAAG,EAAEC,SAAS,QAAQ,gBAAgB;AAG/C;AACA;AACA;AACA,SAASC,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,MAAM,QAAQ,UAAU;AACpD,SAASC,KAAK,QAAQ,gBAAgB;AACtC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,QAAQ,QAAQ,aAAa;AAGtC,MAAMC,gBAAgB,GAAG;EACxBC,YAAY,EAAE,KAAK;EACnBC,QAAQ,EAAE,OAAO;EACjBC,MAAM,EAAE;AACT,CAAC;AAED,MAAMC,uBAAuB,GAAGP,KAAK,CAAE,CAAE,CAAC;AAC1C,MAAMQ,kBAAkB,GAAGR,KAAK,CAAE,CAAE,CAAC;AACrC,MAAMS,mBAAmB,GAAGT,KAAK,CAAE,CAAE,CAAC;;AAEtC;AACA;AACA;AACA;AACA,MAAMU,oBAAoB,GAAGd,MAAM,CAACe,IAAI,CAAE,GAAG,CAAE;AAC/C,MAAMC,aAAa,GAAGhB,MAAM,CAACe,IAAI,CAAE,GAAG,CAAE;AACxC,MAAME,4BAA4B,GAAGjB,MAAM,CAACe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MAAMgC,kBAAkB,gBAAGpC,OAAA,CAAQzB,IAAI,EAAA2B,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,WACrChC,KAAK,CAAE,GAAI,CAAC,OACnBF,GAAG,CACL;EACCuB,SAAS,EAAG;AACb,CAAC,EACD;EACCA,SAAS,EAAG;AACb,CACD,CAAC,SAAAO,OAAA,CAAAC,GAAA,CAAAC,QAAA,gxZACD;AAED,OAAO,MAAMiC,qBAAqB,gBAAGrC,OAAA,CAAQxB,QAAQ,EAAA0B,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,eACxCnC,IAAI,CAAE,kBAAmB,CAAC,wCAAA+B,OAAA,CAAAC,GAAA,CAAAC,QAAA,gxZAGxC;AAED,OAAO,MAAMkC,wBAAwB,gBAAGtC,OAAA,CAAQxB,QAAQ,EAAA0B,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,eAC3CnC,IAAI,CAAE,mBAAoB,CAAC,8BAE/BD,MAAM,CAACe,IAAI,CAAE,KAAK,CAAE,6DAE2Bc,YAAY,yCACpCA,YAAY,4BAAAG,OAAA,CAAAC,GAAA,CAAAC,QAAA,gxZAG7C","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","css","keyframes","COLORS","font","rtl","CONFIG","space","Icon","Truncate","ANIMATION_PARAMS","SLIDE_AMOUNT","DURATION","EASING","CONTENT_WRAPPER_PADDING","ITEM_PADDING_BLOCK","ITEM_PADDING_INLINE","DEFAULT_BORDER_COLOR","gray","DIVIDER_COLOR","TOOLBAR_VARIANT_BORDER_COLOR","DEFAULT_BOX_SHADOW","borderWidth","popoverShadow","TOOLBAR_VARIANT_BOX_SHADOW","GRID_TEMPLATE_COLS","slideUpAndFade","opacity","transform","slideRightAndFade","slideDownAndFade","slideLeftAndFade","DropdownMenu","_styled","Menu","process","env","NODE_ENV","target","label","ui","background","props","variant","baseItem","radiusBlockUi","textDisabled","theme","accent","white","DropdownMenuItem","MenuItem","DropdownMenuCheckboxItem","MenuItemCheckbox","DropdownMenuRadioItem","MenuItemRadio","ItemPrefixWrapper","DropdownMenuItemContentWrapper","DropdownMenuItemChildrenWrapper","ItemSuffixWrapper","DropdownMenuGroup","MenuGroup","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","DropdownMenuSeparator","MenuSeparator","SubmenuChevronIcon","DropdownMenuItemLabel","DropdownMenuItemHelpText"],"sources":["@wordpress/components/src/dropdown-menu-v2/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport { css, keyframes } from '@emotion/react';\nimport styled from '@emotion/styled';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, font, rtl, CONFIG } from '../utils';\nimport { space } from '../utils/space';\nimport Icon from '../icon';\nimport { Truncate } from '../truncate';\nimport type { DropdownMenuContext } from './types';\n\nconst ANIMATION_PARAMS = {\n\tSLIDE_AMOUNT: '2px',\n\tDURATION: '400ms',\n\tEASING: 'cubic-bezier( 0.16, 1, 0.3, 1 )',\n};\n\nconst CONTENT_WRAPPER_PADDING = space( 1 );\nconst ITEM_PADDING_BLOCK = space( 2 );\nconst ITEM_PADDING_INLINE = space( 3 );\n\n// TODO:\n// - those values are different from saved variables?\n// - should bring this into the config, and make themeable\n// - border color and divider color are different?\nconst DEFAULT_BORDER_COLOR = COLORS.gray[ 300 ];\nconst DIVIDER_COLOR = COLORS.gray[ 200 ];\nconst TOOLBAR_VARIANT_BORDER_COLOR = COLORS.gray[ '900' ];\nconst DEFAULT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ DEFAULT_BORDER_COLOR }, ${ CONFIG.popoverShadow }`;\nconst TOOLBAR_VARIANT_BOX_SHADOW = `0 0 0 ${ CONFIG.borderWidth } ${ TOOLBAR_VARIANT_BORDER_COLOR }`;\n\nconst GRID_TEMPLATE_COLS = 'minmax( 0, max-content ) 1fr';\n\nconst slideUpAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateY(${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateY(0)' },\n} );\n\nconst slideRightAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateX(-${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateX(0)' },\n} );\n\nconst slideDownAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateY(-${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateY(0)' },\n} );\n\nconst slideLeftAndFade = keyframes( {\n\t'0%': {\n\t\topacity: 0,\n\t\ttransform: `translateX(${ ANIMATION_PARAMS.SLIDE_AMOUNT })`,\n\t},\n\t'100%': { opacity: 1, transform: 'translateX(0)' },\n} );\n\nexport const DropdownMenu = styled( Ariakit.Menu )<\n\tPick< DropdownMenuContext, 'variant' >\n>`\n\tposition: relative;\n\t/* Same as popover component */\n\t/* TODO: is there a way to read the sass variable? */\n\tz-index: 1000000;\n\n\tdisplay: grid;\n\tgrid-template-columns: ${ GRID_TEMPLATE_COLS };\n\tgrid-template-rows: auto;\n\n\tbox-sizing: border-box;\n\tmin-width: 160px;\n\tmax-width: 320px;\n\tmax-height: var( --popover-available-height );\n\tpadding: ${ CONTENT_WRAPPER_PADDING };\n\n\tbackground-color: ${ COLORS.ui.background };\n\tborder-radius: 4px;\n\t${ ( props ) => css`\n\t\tbox-shadow: ${ props.variant === 'toolbar'\n\t\t\t? TOOLBAR_VARIANT_BOX_SHADOW\n\t\t\t: DEFAULT_BOX_SHADOW };\n\t` }\n\n\toverscroll-behavior: contain;\n\toverflow: auto;\n\n\t/* Only visible in Windows High Contrast mode */\n\toutline: 2px solid transparent !important;\n\n\t/* Animation */\n\tanimation-duration: ${ ANIMATION_PARAMS.DURATION };\n\tanimation-timing-function: ${ ANIMATION_PARAMS.EASING };\n\twill-change: transform, opacity;\n\t/* Default animation.*/\n\tanimation-name: ${ slideDownAndFade };\n\n\t&[data-side='right'] {\n\t\tanimation-name: ${ slideLeftAndFade };\n\t}\n\t&[data-side='bottom'] {\n\t\tanimation-name: ${ slideUpAndFade };\n\t}\n\t&[data-side='left'] {\n\t\tanimation-name: ${ slideRightAndFade };\n\t}\n\t@media ( prefers-reduced-motion ) {\n\t\tanimation-duration: 0s;\n\t}\n`;\n\nconst baseItem = css`\n\tall: unset;\n\n\tposition: relative;\n\tmin-height: ${ space( 10 ) };\n\tbox-sizing: border-box;\n\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tdisplay: grid;\n\tgrid-template-columns: ${ GRID_TEMPLATE_COLS };\n\talign-items: center;\n\n\t@supports ( grid-template-columns: subgrid ) {\n\t\t/*\n\t\t * Define a grid layout which inherits the same columns configuration\n\t\t * from the parent layout (ie. subgrid). This allows the menu\n\t\t * to synchronize the indentation of all its items.\n\t\t */\n\t\tgrid-template-columns: subgrid;\n\t}\n\n\tfont-size: ${ font( 'default.fontSize' ) };\n\tfont-family: inherit;\n\tfont-weight: normal;\n\tline-height: 20px;\n\n\tcolor: ${ COLORS.gray[ 900 ] };\n\tborder-radius: ${ CONFIG.radiusBlockUi };\n\n\tpadding-block: ${ ITEM_PADDING_BLOCK };\n\tpadding-inline: ${ ITEM_PADDING_INLINE };\n\n\t/*\n\t * Make sure that, when an item is scrolled into view (eg. while using the\n\t * keyboard to move focus), the whole item comes into view\n\t */\n\tscroll-margin: ${ CONTENT_WRAPPER_PADDING };\n\n\tuser-select: none;\n\toutline: none;\n\n\t&[aria-disabled='true'] {\n\t\tcolor: ${ COLORS.ui.textDisabled };\n\t\tcursor: not-allowed;\n\t}\n\n\t/* Hover */\n\t&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t) {\n\t\tbackground-color: ${ COLORS.theme.accent };\n\t\tcolor: ${ COLORS.white };\n\t}\n\n\t/* Keyboard focus (focus-visible) */\n\t&[data-focus-visible] {\n\t\tbox-shadow: 0 0 0 1.5px ${ COLORS.theme.accent };\n\n\t\t/* Only visible in Windows High Contrast mode */\n\t\toutline: 2px solid transparent;\n\t}\n\n\t/* Active (ie. pressed, mouse down) */\n\t&:active,\n\t&[data-active] {\n\t\t/* TODO: should there be a visual active state? */\n\t}\n\n\t/* When the item is the trigger of an open submenu */\n\t${ DropdownMenu }:not(:focus) &:not(:focus)[aria-expanded=\"true\"] {\n\t\tbackground-color: ${ COLORS.gray[ 100 ] };\n\t\tcolor: ${ COLORS.gray[ 900 ] };\n\t}\n\n\tsvg {\n\t\tfill: currentColor;\n\t}\n`;\n\nexport const DropdownMenuItem = styled( Ariakit.MenuItem )`\n\t${ baseItem };\n`;\n\nexport const DropdownMenuCheckboxItem = styled( Ariakit.MenuItemCheckbox )`\n\t${ baseItem };\n`;\n\nexport const DropdownMenuRadioItem = styled( Ariakit.MenuItemRadio )`\n\t${ baseItem };\n`;\n\nexport const ItemPrefixWrapper = styled.span`\n\t/* Always occupy the first column, even when auto-collapsing */\n\tgrid-column: 1;\n\n\t/*\n\t * Even when the item is not checked, occupy the same screen space to avoid\n\t * the space collapside when no items are checked.\n\t */\n\t${ DropdownMenuCheckboxItem } > &,\n\t${ DropdownMenuRadioItem } > & {\n\t\t/* Same width as the check icons */\n\t\tmin-width: ${ space( 6 ) };\n\t}\n\n\t${ DropdownMenuCheckboxItem } > &,\n\t${ DropdownMenuRadioItem } > &,\n\t&:not( :empty ) {\n\t\tmargin-inline-end: ${ space( 2 ) };\n\t}\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\n\tcolor: ${ COLORS.gray[ '700' ] };\n\n\t/*\n\t* When the parent menu item is active, except when it's a non-focused/hovered\n\t* submenu trigger (in that case, color should not be inherited)\n\t*/\n\t[data-active-item]:not( [data-focus-visible] ) > &,\n\t/* When the parent menu item is disabled */\n\t[aria-disabled='true'] > & {\n\t\tcolor: inherit;\n\t}\n`;\n\nexport const DropdownMenuItemContentWrapper = styled.div`\n\t/*\n\t * Always occupy the second column, since the first column\n\t * is taken by the prefix wrapper (when displayed).\n\t */\n\tgrid-column: 2;\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: ${ space( 3 ) };\n\n\tpointer-events: none;\n`;\n\nexport const DropdownMenuItemChildrenWrapper = styled.div`\n\tflex: 1;\n\n\tdisplay: inline-flex;\n\tflex-direction: column;\n\tgap: ${ space( 1 ) };\n`;\n\nexport const ItemSuffixWrapper = styled.span`\n\tflex: 0 1 fit-content;\n\tmin-width: 0;\n\twidth: fit-content;\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: ${ space( 3 ) };\n\n\tcolor: ${ COLORS.gray[ '700' ] };\n\n\t/*\n\t * When the parent menu item is active, except when it's a non-focused/hovered\n\t * submenu trigger (in that case, color should not be inherited)\n\t */\n\t[data-active-item]:not( [data-focus-visible] ) *:not(${ DropdownMenu }) &,\n\t/* When the parent menu item is disabled */\n\t[aria-disabled='true'] *:not(${ DropdownMenu }) & {\n\t\tcolor: inherit;\n\t}\n`;\n\nexport const DropdownMenuGroup = styled( Ariakit.MenuGroup )`\n\t/* Ignore this element when calculating the layout. Useful for subgrid */\n\tdisplay: contents;\n`;\n\nexport const DropdownMenuSeparator = styled( Ariakit.MenuSeparator )<\n\tPick< DropdownMenuContext, 'variant' >\n>`\n\t/* Occupy the width of all grid columns (ie. full width) */\n\tgrid-column: 1 / -1;\n\n\tborder: none;\n\theight: ${ CONFIG.borderWidth };\n\tbackground-color: ${ ( props ) =>\n\t\tprops.variant === 'toolbar'\n\t\t\t? TOOLBAR_VARIANT_BORDER_COLOR\n\t\t\t: DIVIDER_COLOR };\n\t/* Align with menu items' content */\n\tmargin-block: ${ space( 2 ) };\n\tmargin-inline: ${ ITEM_PADDING_INLINE };\n\n\t/* Only visible in Windows High Contrast mode */\n\toutline: 2px solid transparent;\n`;\n\nexport const SubmenuChevronIcon = styled( Icon )`\n\twidth: ${ space( 1.5 ) };\n\t${ rtl(\n\t\t{\n\t\t\ttransform: `scaleX(1)`,\n\t\t},\n\t\t{\n\t\t\ttransform: `scaleX(-1)`,\n\t\t}\n\t) };\n`;\n\nexport const DropdownMenuItemLabel = styled( Truncate )`\n\tfont-size: ${ font( 'default.fontSize' ) };\n\tline-height: 20px;\n\tcolor: inherit;\n`;\n\nexport const DropdownMenuItemHelpText = styled( Truncate )`\n\tfont-size: ${ font( 'helpText.fontSize' ) };\n\tline-height: 16px;\n\tcolor: ${ COLORS.gray[ '700' ] };\n\n\t[data-active-item]:not( [data-focus-visible] ) *:not( ${ DropdownMenu } ) &,\n\t[aria-disabled='true'] *:not( ${ DropdownMenu } ) & {\n\t\tcolor: inherit;\n\t}\n`;\n"],"mappings":";;AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,SAASC,GAAG,EAAEC,SAAS,QAAQ,gBAAgB;AAG/C;AACA;AACA;AACA,SAASC,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,MAAM,QAAQ,UAAU;AACpD,SAASC,KAAK,QAAQ,gBAAgB;AACtC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,QAAQ,QAAQ,aAAa;AAGtC,MAAMC,gBAAgB,GAAG;EACxBC,YAAY,EAAE,KAAK;EACnBC,QAAQ,EAAE,OAAO;EACjBC,MAAM,EAAE;AACT,CAAC;AAED,MAAMC,uBAAuB,GAAGP,KAAK,CAAE,CAAE,CAAC;AAC1C,MAAMQ,kBAAkB,GAAGR,KAAK,CAAE,CAAE,CAAC;AACrC,MAAMS,mBAAmB,GAAGT,KAAK,CAAE,CAAE,CAAC;;AAEtC;AACA;A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BA,KAAK,CAACC,OAAO,KAAK,SAAS,GACxBvB,4BAA4B,GAC5BD,aAAa,oBAEAZ,KAAK,CAAE,CAAE,CAAC,qBACTS,mBAAmB,uCAAAmB,OAAA,CAAAC,GAAA,CAAAC,QAAA,4sZAIrC;AAED,OAAO,MAAMgC,kBAAkB,gBAAGpC,OAAA,CAAQzB,IAAI,EAAA2B,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,WACrChC,KAAK,CAAE,GAAI,CAAC,OACnBF,GAAG,CACL;EACCuB,SAAS,EAAG;AACb,CAAC,EACD;EACCA,SAAS,EAAG;AACb,CACD,CAAC,SAAAO,OAAA,CAAAC,GAAA,CAAAC,QAAA,4sZACD;AAED,OAAO,MAAMiC,qBAAqB,gBAAGrC,OAAA,CAAQxB,QAAQ,EAAA0B,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,eACxCnC,IAAI,CAAE,kBAAmB,CAAC,wCAAA+B,OAAA,CAAAC,GAAA,CAAAC,QAAA,4sZAGxC;AAED,OAAO,MAAMkC,wBAAwB,gBAAGtC,OAAA,CAAQxB,QAAQ,EAAA0B,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,eAC3CnC,IAAI,CAAE,mBAAoB,CAAC,8BAE/BD,MAAM,CAACe,IAAI,CAAE,KAAK,CAAE,6DAE2Bc,YAAY,yCACpCA,YAAY,4BAAAG,OAAA,CAAAC,GAAA,CAAAC,QAAA,4sZAG7C","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/dropdown-menu-v2/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type * as Ariakit from '@ariakit/react';\nimport type { Placement } from '@floating-ui/react-dom';\n\nexport interface DropdownMenuContext {\n\t/**\n\t * The ariakit store shared across all DropdownMenu subcomponents.\n\t */\n\tstore: Ariakit.MenuStore;\n\t/**\n\t * The variant used by the underlying menu popover.\n\t */\n\tvariant?: 'toolbar';\n}\n\nexport interface DropdownMenuProps {\n\t/**\n\t * The trigger button.\n\t */\n\ttrigger: React.ReactElement;\n\t/**\n\t * The contents of the dropdown.\n\t */\n\tchildren?: React.ReactNode;\n\t/**\n\t * The open state of the dropdown menu when it is initially rendered. Use when\n\t * not wanting to control its open state.\n\t *\n\t * @default false\n\t */\n\tdefaultOpen?: boolean;\n\t/**\n\t * The controlled open state of the dropdown menu. Must be used in conjunction\n\t * with `onOpenChange`.\n\t */\n\topen?: boolean;\n\t/**\n\t * Event handler called when the open state of the dropdown menu changes.\n\t */\n\tonOpenChange?: ( open: boolean ) => void;\n\t/**\n\t * The modality of the dropdown menu. When set to true, interaction with\n\t * outside elements will be disabled and only menu content will be visible to\n\t * screen readers.\n\t *\n\t * @default true\n\t */\n\tmodal?: boolean;\n\t/**\n\t * The placement of the dropdown menu popover.\n\t *\n\t * @default 'bottom-start' for root-level menus, 'right-start' for nested menus\n\t */\n\tplacement?: Placement;\n\t/**\n\t * The distance between the popover and the anchor element.\n\t *\n\t * @default 8 for root-level menus, 16 for nested menus\n\t */\n\tgutter?: number;\n\t/**\n\t * The skidding of the popover along the anchor element. Can be set to\n\t * negative values to make the popover shift to the opposite side.\n\t *\n\t * @default 0 for root-level menus, -8 for nested menus\n\t */\n\tshift?: number;\n\t/**\n\t * Determines whether the menu popover will be hidden when the user presses\n\t * the Escape key.\n\t *\n\t * @default `( event ) => { event.preventDefault(); return true; }`\n\t */\n\thideOnEscape?:\n\t\t| boolean\n\t\t| ( (\n\t\t\t\tevent: KeyboardEvent | React.KeyboardEvent< Element >\n\t\t ) => boolean );\n}\n\nexport interface DropdownMenuGroupProps {\n\t/**\n\t * The contents of the dropdown menu group.\n\t */\n\tchildren: React.ReactNode;\n}\n\nexport interface DropdownMenuItemProps {\n\t/**\n\t * The contents of the menu item.\n\t */\n\tchildren: React.ReactNode;\n\t/**\n\t * The contents of the menu item's prefix.\n\t */\n\tprefix?: React.ReactNode;\n\t/**\n\t * The contents of the menu item's suffix.\n\t */\n\tsuffix?: React.ReactNode;\n\t/**\n\t * Whether to hide the parent menu when the item is clicked.\n\t *\n\t * @default true\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * Determines if the element is disabled.\n\t */\n\tdisabled?: boolean;\n}\n\nexport interface DropdownMenuCheckboxItemProps\n\textends Omit< DropdownMenuItemProps, 'prefix' | 'hideOnClick' > {\n\t/**\n\t * Whether to hide the dropdown menu when the item is clicked.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * The checkbox menu item's name.\n\t */\n\tname: string;\n\t/**\n\t * The checkbox item's value, useful when using multiple checkbox menu items\n\t * associated to the same `name`.\n\t */\n\tvalue?: string;\n\t/**\n\t * The controlled checked state of the checkbox menu item.\n\t */\n\tchecked?: boolean;\n\t/**\n\t * The checked state of the checkbox menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t */\n\tdefaultChecked?: boolean;\n\t/**\n\t * Event handler called when the checked state of the checkbox menu item changes.\n\t */\n\tonChange?: ( event: React.ChangeEvent< HTMLInputElement > ) => void;\n}\n\nexport interface DropdownMenuRadioItemProps\n\textends Omit< DropdownMenuItemProps, 'prefix' | 'hideOnClick' > {\n\t/**\n\t * Whether to hide the dropdown menu when the item is clicked.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * The radio item's name.\n\t */\n\tname: string;\n\t/**\n\t * The radio item's value.\n\t */\n\tvalue: string | number;\n\t/**\n\t * The controlled checked state of the radio menu item.\n\t */\n\tchecked?: boolean;\n\t/**\n\t * The checked state of the radio menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t */\n\tdefaultChecked?: boolean;\n\t/**\n\t * Event handler called when the checked radio menu item changes.\n\t */\n\tonChange?: ( event: React.ChangeEvent< HTMLInputElement > ) => void;\n}\n\nexport interface DropdownMenuSeparatorProps {}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/dropdown-menu-v2/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type * as Ariakit from '@ariakit/react';\nimport type { Placement } from '@floating-ui/react-dom';\n\nexport interface DropdownMenuContext {\n\t/**\n\t * The ariakit store shared across all DropdownMenu subcomponents.\n\t */\n\tstore: Ariakit.MenuStore;\n\t/**\n\t * The variant used by the underlying menu popover.\n\t */\n\tvariant?: 'toolbar';\n}\n\nexport interface DropdownMenuProps {\n\t/**\n\t * The trigger button.\n\t */\n\ttrigger: React.ReactElement;\n\t/**\n\t * The contents of the dropdown.\n\t */\n\tchildren?: React.ReactNode;\n\t/**\n\t * The open state of the dropdown menu when it is initially rendered. Use when\n\t * not wanting to control its open state.\n\t *\n\t * @default false\n\t */\n\tdefaultOpen?: boolean;\n\t/**\n\t * The controlled open state of the dropdown menu. Must be used in conjunction\n\t * with `onOpenChange`.\n\t */\n\topen?: boolean;\n\t/**\n\t * Event handler called when the open state of the dropdown menu changes.\n\t */\n\tonOpenChange?: ( open: boolean ) => void;\n\t/**\n\t * The modality of the dropdown menu. When set to true, interaction with\n\t * outside elements will be disabled and only menu content will be visible to\n\t * screen readers.\n\t *\n\t * @default true\n\t */\n\tmodal?: boolean;\n\t/**\n\t * The placement of the dropdown menu popover.\n\t *\n\t * @default 'bottom-start' for root-level menus, 'right-start' for nested menus\n\t */\n\tplacement?: Placement;\n\t/**\n\t * The distance between the popover and the anchor element.\n\t *\n\t * @default 8 for root-level menus, 16 for nested menus\n\t */\n\tgutter?: number;\n\t/**\n\t * The skidding of the popover along the anchor element. Can be set to\n\t * negative values to make the popover shift to the opposite side.\n\t *\n\t * @default 0 for root-level menus, -8 for nested menus\n\t */\n\tshift?: number;\n\t/**\n\t * Determines whether the menu popover will be hidden when the user presses\n\t * the Escape key.\n\t *\n\t * @default `( event ) => { event.preventDefault(); return true; }`\n\t */\n\thideOnEscape?:\n\t\t| boolean\n\t\t| ( (\n\t\t\t\tevent: KeyboardEvent | React.KeyboardEvent< Element >\n\t\t ) => boolean );\n}\n\nexport interface DropdownMenuGroupProps {\n\t/**\n\t * The contents of the dropdown menu group.\n\t */\n\tchildren: React.ReactNode;\n}\n\nexport interface DropdownMenuItemProps {\n\t/**\n\t * The contents of the menu item.\n\t */\n\tchildren: React.ReactNode;\n\t/**\n\t * The contents of the menu item's prefix.\n\t */\n\tprefix?: React.ReactNode;\n\t/**\n\t * The contents of the menu item's suffix.\n\t */\n\tsuffix?: React.ReactNode;\n\t/**\n\t * Whether to hide the parent menu when the item is clicked.\n\t *\n\t * @default true\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * Determines if the element is disabled.\n\t */\n\tdisabled?: boolean;\n}\n\nexport interface DropdownMenuCheckboxItemProps\n\textends Omit< DropdownMenuItemProps, 'prefix' | 'hideOnClick' > {\n\t/**\n\t * Whether to hide the dropdown menu when the item is clicked.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * The checkbox menu item's name.\n\t */\n\tname: string;\n\t/**\n\t * The checkbox item's value, useful when using multiple checkbox menu items\n\t * associated to the same `name`.\n\t */\n\tvalue?: string;\n\t/**\n\t * The controlled checked state of the checkbox menu item.\n\t */\n\tchecked?: boolean;\n\t/**\n\t * The checked state of the checkbox menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t */\n\tdefaultChecked?: boolean;\n\t/**\n\t * Event handler called when the checked state of the checkbox menu item changes.\n\t */\n\tonChange?: ( event: React.ChangeEvent< HTMLInputElement > ) => void;\n}\n\nexport interface DropdownMenuRadioItemProps\n\textends Omit< DropdownMenuItemProps, 'prefix' | 'hideOnClick' > {\n\t/**\n\t * Whether to hide the dropdown menu when the item is clicked.\n\t *\n\t * @default false\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * The radio item's name.\n\t */\n\tname: string;\n\t/**\n\t * The radio item's value.\n\t */\n\tvalue: string | number;\n\t/**\n\t * The controlled checked state of the radio menu item.\n\t */\n\tchecked?: boolean;\n\t/**\n\t * The checked state of the radio menu item when it is initially rendered.\n\t * Use when not wanting to control its checked state.\n\t */\n\tdefaultChecked?: boolean;\n\t/**\n\t * Event handler called when the checked radio menu item changes.\n\t */\n\tonChange?: ( event: React.ChangeEvent< HTMLInputElement > ) => void;\n}\n\nexport interface DropdownMenuSeparatorProps {}\n"],"mappings":"","ignoreList":[]}
@@ -6,7 +6,7 @@ import { __, sprintf } from '@wordpress/i18n';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
- import CustomSelectControl from '../custom-select-control';
9
+ import CustomSelectControl from '../custom-select-control-v2/legacy-component';
10
10
  import { parseQuantityAndUnitFromRawValue } from '../unit-control';
11
11
  import { getCommonSizeUnit, isSimpleCssValue } from './utils';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","CustomSelectControl","parseQuantityAndUnitFromRawValue","getCommonSizeUnit","isSimpleCssValue","jsx","_jsx","DEFAULT_OPTION","key","name","value","undefined","CUSTOM_OPTION","FontSizePickerSelect","props","_options$find","__next40pxDefaultSize","fontSizes","disableCustomFontSizes","size","onChange","onSelectCustom","areAllSizesSameUnit","options","map","fontSize","hint","quantity","String","slug","__experimentalHint","selectedOption","find","option","className","label","hideLabelFromVision","describedBy","__experimentalShowSelectedHint","selectedItem"],"sources":["@wordpress/components/src/font-size-picker/font-size-picker-select.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CustomSelectControl from '../custom-select-control';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control';\nimport type {\n\tFontSizePickerSelectProps,\n\tFontSizePickerSelectOption,\n} from './types';\nimport { getCommonSizeUnit, isSimpleCssValue } from './utils';\n\nconst DEFAULT_OPTION: FontSizePickerSelectOption = {\n\tkey: 'default',\n\tname: __( 'Default' ),\n\tvalue: undefined,\n};\n\nconst CUSTOM_OPTION: FontSizePickerSelectOption = {\n\tkey: 'custom',\n\tname: __( 'Custom' ),\n};\n\nconst FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tfontSizes,\n\t\tvalue,\n\t\tdisableCustomFontSizes,\n\t\tsize,\n\t\tonChange,\n\t\tonSelectCustom,\n\t} = props;\n\n\tconst areAllSizesSameUnit = !! getCommonSizeUnit( fontSizes );\n\n\tconst options: FontSizePickerSelectOption[] = [\n\t\tDEFAULT_OPTION,\n\t\t...fontSizes.map( ( fontSize ) => {\n\t\t\tlet hint;\n\t\t\tif ( areAllSizesSameUnit ) {\n\t\t\t\tconst [ quantity ] = parseQuantityAndUnitFromRawValue(\n\t\t\t\t\tfontSize.size\n\t\t\t\t);\n\t\t\t\tif ( quantity !== undefined ) {\n\t\t\t\t\thint = String( quantity );\n\t\t\t\t}\n\t\t\t} else if ( isSimpleCssValue( fontSize.size ) ) {\n\t\t\t\thint = String( fontSize.size );\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tkey: fontSize.slug,\n\t\t\t\tname: fontSize.name || fontSize.slug,\n\t\t\t\tvalue: fontSize.size,\n\t\t\t\t__experimentalHint: hint,\n\t\t\t};\n\t\t} ),\n\t\t...( disableCustomFontSizes ? [] : [ CUSTOM_OPTION ] ),\n\t];\n\n\tconst selectedOption = value\n\t\t? options.find( ( option ) => option.value === value ) ?? CUSTOM_OPTION\n\t\t: DEFAULT_OPTION;\n\n\treturn (\n\t\t<CustomSelectControl\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tclassName=\"components-font-size-picker__select\"\n\t\t\tlabel={ __( 'Font size' ) }\n\t\t\thideLabelFromVision\n\t\t\tdescribedBy={ sprintf(\n\t\t\t\t// translators: %s: Currently selected font size.\n\t\t\t\t__( 'Currently selected font size: %s' ),\n\t\t\t\tselectedOption.name\n\t\t\t) }\n\t\t\toptions={ options }\n\t\t\tvalue={ selectedOption }\n\t\t\t__experimentalShowSelectedHint\n\t\t\tonChange={ ( {\n\t\t\t\tselectedItem,\n\t\t\t}: {\n\t\t\t\tselectedItem: FontSizePickerSelectOption;\n\t\t\t} ) => {\n\t\t\t\tif ( selectedItem === CUSTOM_OPTION ) {\n\t\t\t\t\tonSelectCustom();\n\t\t\t\t} else {\n\t\t\t\t\tonChange( selectedItem.value );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t/>\n\t);\n};\n\nexport default FontSizePickerSelect;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,SAASC,gCAAgC,QAAQ,iBAAiB;AAKlE,SAASC,iBAAiB,EAAEC,gBAAgB,QAAQ,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9D,MAAMC,cAA0C,GAAG;EAClDC,GAAG,EAAE,SAAS;EACdC,IAAI,EAAEV,EAAE,CAAE,SAAU,CAAC;EACrBW,KAAK,EAAEC;AACR,CAAC;AAED,MAAMC,aAAyC,GAAG;EACjDJ,GAAG,EAAE,QAAQ;EACbC,IAAI,EAAEV,EAAE,CAAE,QAAS;AACpB,CAAC;AAED,MAAMc,oBAAoB,GAAKC,KAAgC,IAAM;EAAA,IAAAC,aAAA;EACpE,MAAM;IACLC,qBAAqB;IACrBC,SAAS;IACTP,KAAK;IACLQ,sBAAsB;IACtBC,IAAI;IACJC,QAAQ;IACRC;EACD,CAAC,GAAGP,KAAK;EAET,MAAMQ,mBAAmB,GAAG,CAAC,CAAEnB,iBAAiB,CAAEc,SAAU,CAAC;EAE7D,MAAMM,OAAqC,GAAG,CAC7ChB,cAAc,EACd,GAAGU,SAAS,CAACO,GAAG,CAAIC,QAAQ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N,IAAKA,YAAY,KAAK3B,aAAa,EAAG;QACrCS,cAAc,CAAC,CAAC;MACjB,CAAC,MAAM;QACND,QAAQ,CAAEmB,YAAY,CAAC7B,KAAM,CAAC;MAC/B;IACD,CAAG;IACHS,IAAI,EAAGA;EAAM,CACb,CAAC;AAEJ,CAAC;AAED,eAAeN,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","CustomSelectControl","parseQuantityAndUnitFromRawValue","getCommonSizeUnit","isSimpleCssValue","jsx","_jsx","DEFAULT_OPTION","key","name","value","undefined","CUSTOM_OPTION","FontSizePickerSelect","props","_options$find","__next40pxDefaultSize","fontSizes","disableCustomFontSizes","size","onChange","onSelectCustom","areAllSizesSameUnit","options","map","fontSize","hint","quantity","String","slug","__experimentalHint","selectedOption","find","option","className","label","hideLabelFromVision","describedBy","__experimentalShowSelectedHint","selectedItem"],"sources":["@wordpress/components/src/font-size-picker/font-size-picker-select.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CustomSelectControl from '../custom-select-control-v2/legacy-component';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control';\nimport type {\n\tFontSizePickerSelectProps,\n\tFontSizePickerSelectOption,\n} from './types';\nimport { getCommonSizeUnit, isSimpleCssValue } from './utils';\n\nconst DEFAULT_OPTION: FontSizePickerSelectOption = {\n\tkey: 'default',\n\tname: __( 'Default' ),\n\tvalue: undefined,\n};\n\nconst CUSTOM_OPTION: FontSizePickerSelectOption = {\n\tkey: 'custom',\n\tname: __( 'Custom' ),\n};\n\nconst FontSizePickerSelect = ( props: FontSizePickerSelectProps ) => {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tfontSizes,\n\t\tvalue,\n\t\tdisableCustomFontSizes,\n\t\tsize,\n\t\tonChange,\n\t\tonSelectCustom,\n\t} = props;\n\n\tconst areAllSizesSameUnit = !! getCommonSizeUnit( fontSizes );\n\n\tconst options: FontSizePickerSelectOption[] = [\n\t\tDEFAULT_OPTION,\n\t\t...fontSizes.map( ( fontSize ) => {\n\t\t\tlet hint;\n\t\t\tif ( areAllSizesSameUnit ) {\n\t\t\t\tconst [ quantity ] = parseQuantityAndUnitFromRawValue(\n\t\t\t\t\tfontSize.size\n\t\t\t\t);\n\t\t\t\tif ( quantity !== undefined ) {\n\t\t\t\t\thint = String( quantity );\n\t\t\t\t}\n\t\t\t} else if ( isSimpleCssValue( fontSize.size ) ) {\n\t\t\t\thint = String( fontSize.size );\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tkey: fontSize.slug,\n\t\t\t\tname: fontSize.name || fontSize.slug,\n\t\t\t\tvalue: fontSize.size,\n\t\t\t\t__experimentalHint: hint,\n\t\t\t};\n\t\t} ),\n\t\t...( disableCustomFontSizes ? [] : [ CUSTOM_OPTION ] ),\n\t];\n\n\tconst selectedOption = value\n\t\t? options.find( ( option ) => option.value === value ) ?? CUSTOM_OPTION\n\t\t: DEFAULT_OPTION;\n\n\treturn (\n\t\t<CustomSelectControl\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tclassName=\"components-font-size-picker__select\"\n\t\t\tlabel={ __( 'Font size' ) }\n\t\t\thideLabelFromVision\n\t\t\tdescribedBy={ sprintf(\n\t\t\t\t// translators: %s: Currently selected font size.\n\t\t\t\t__( 'Currently selected font size: %s' ),\n\t\t\t\tselectedOption.name\n\t\t\t) }\n\t\t\toptions={ options }\n\t\t\tvalue={ selectedOption }\n\t\t\t__experimentalShowSelectedHint\n\t\t\tonChange={ ( {\n\t\t\t\tselectedItem,\n\t\t\t}: {\n\t\t\t\tselectedItem: FontSizePickerSelectOption;\n\t\t\t} ) => {\n\t\t\t\tif ( selectedItem === CUSTOM_OPTION ) {\n\t\t\t\t\tonSelectCustom();\n\t\t\t\t} else {\n\t\t\t\t\tonChange( selectedItem.value );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tsize={ size }\n\t\t/>\n\t);\n};\n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AAEiB,QAAQ,CAACI,IAAI;MAClBpB,IAAI,EAAEgB,QAAQ,CAAChB,IAAI,IAAIgB,QAAQ,CAACI,IAAI;MACpCnB,KAAK,EAAEe,QAAQ,CAACN,IAAI;MACpBW,kBAAkB,EAAEJ;IACrB,CAAC;EACF,CAAE,CAAC,EACH,IAAKR,sBAAsB,GAAG,EAAE,GAAG,CAAEN,aAAa,CAAE,CAAE,CACtD;EAED,MAAMmB,cAAc,GAAGrB,KAAK,IAAAK,aAAA,GACzBQ,OAAO,CAACS,IAAI,CAAIC,MAAM,IAAMA,MAAM,CAACvB,KAAK,KAAKA,KAAM,CAAC,cAAAK,aAAA,cAAAA,aAAA,GAAIH,aAAa,GACrEL,cAAc;EAEjB,oBACCD,IAAA,CAACL,mBAAmB;IACnBe,qBAAqB,EAAGA,qBAAuB;IAC/CkB,SAAS,EAAC,qCAAqC;IAC/CC,KAAK,EAAGpC,EAAE,CAAE,WAAY,CAAG;IAC3BqC,mBAAmB;IACnBC,WAAW,EAAGrC,OAAO;IACpB;IACAD,EAAE,CAAE,kCAAmC,CAAC,EACxCgC,cAAc,CAACtB,IAChB,CAAG;IACHc,OAAO,EAAGA,OAAS;IACnBb,KAAK,EAAGqB,cAAgB;IACxBO,8BAA8B;IAC9BlB,QAAQ,EAAGA,CAAE;MACZmB;IAGD,CAAC,KAAM;MACN,IAAKA,YAAY,KAAK3B,aAAa,EAAG;QACrCS,cAAc,CAAC,CAAC;MACjB,CAAC,MAAM;QACND,QAAQ,CAAEmB,YAAY,CAAC7B,KAAM,CAAC;MAC/B;IACD,CAAG;IACHS,IAAI,EAAGA;EAAM,CACb,CAAC;AAEJ,CAAC;AAED,eAAeN,oBAAoB","ignoreList":[]}
@@ -177,7 +177,7 @@ const UnforwardedFontSizePicker = (props, ref) => {
177
177
  }), withReset && /*#__PURE__*/_jsx(FlexItem, {
178
178
  children: /*#__PURE__*/_jsx(Button, {
179
179
  disabled: isDisabled,
180
- __experimentalIsFocusable: true,
180
+ accessibleWhenDisabled: true,
181
181
  onClick: () => {
182
182
  onChange?.(undefined);
183
183
  },
@@ -1 +1 @@
1
- {"version":3,"names":["__","settings","useState","useMemo","forwardRef","Button","RangeControl","Flex","FlexItem","default","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits","VisuallyHidden","getCommonSizeUnit","Container","Header","HeaderHint","HeaderLabel","HeaderToggle","Spacer","FontSizePickerSelect","FontSizePickerToggleGroup","T_SHIRT_NAMES","jsx","_jsx","jsxs","_jsxs","DEFAULT_UNITS","UnforwardedFontSizePicker","props","ref","__next40pxDefaultSize","fallbackFontSize","fontSizes","disableCustomFontSizes","onChange","size","units","unitsProp","value","withSlider","withReset","availableUnits","shouldUseSelectControl","length","selectedFontSize","find","fontSize","isCustomValue","showCustomValueControl","setShowCustomValueControl","headerHint","name","indexOf","commonUnit","hasUnits","valueQuantity","valueUnit","isValueUnitRelative","includes","isDisabled","undefined","className","children","as","label","icon","onClick","isPressed","newValue","Number","onSelectCustom","isBlock","labelPosition","hideLabelFromVision","parseInt","min","marginX","marginBottom","__nextHasNoMarginBottom","initialPosition","withInputField","max","step","disabled","__experimentalIsFocusable","variant","FontSizePicker"],"sources":["@wordpress/components/src/font-size-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\nimport { useState, useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Button } from '../button';\nimport RangeControl from '../range-control';\nimport { Flex, FlexItem } from '../flex';\nimport {\n\tdefault as UnitControl,\n\tparseQuantityAndUnitFromRawValue,\n\tuseCustomUnits,\n} from '../unit-control';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { getCommonSizeUnit } from './utils';\nimport type { FontSizePickerProps } from './types';\nimport {\n\tContainer,\n\tHeader,\n\tHeaderHint,\n\tHeaderLabel,\n\tHeaderToggle,\n} from './styles';\nimport { Spacer } from '../spacer';\nimport FontSizePickerSelect from './font-size-picker-select';\nimport FontSizePickerToggleGroup from './font-size-picker-toggle-group';\nimport { T_SHIRT_NAMES } from './constants';\n\nconst DEFAULT_UNITS = [ 'px', 'em', 'rem', 'vw', 'vh' ];\n\nconst UnforwardedFontSizePicker = (\n\tprops: FontSizePickerProps,\n\tref: ForwardedRef< any >\n) => {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\tfallbackFontSize,\n\t\tfontSizes = [],\n\t\tdisableCustomFontSizes = false,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tunits: unitsProp = DEFAULT_UNITS,\n\t\tvalue,\n\t\twithSlider = false,\n\t\twithReset = true,\n\t} = props;\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: unitsProp,\n\t} );\n\n\tconst shouldUseSelectControl = fontSizes.length > 5;\n\tconst selectedFontSize = fontSizes.find(\n\t\t( fontSize ) => fontSize.size === value\n\t);\n\tconst isCustomValue = !! value && ! selectedFontSize;\n\n\tconst [ showCustomValueControl, setShowCustomValueControl ] = useState(\n\t\t! disableCustomFontSizes && isCustomValue\n\t);\n\n\tconst headerHint = useMemo( () => {\n\t\tif ( showCustomValueControl ) {\n\t\t\treturn __( 'Custom' );\n\t\t}\n\n\t\tif ( ! shouldUseSelectControl ) {\n\t\t\tif ( selectedFontSize ) {\n\t\t\t\treturn (\n\t\t\t\t\tselectedFontSize.name ||\n\t\t\t\t\tT_SHIRT_NAMES[ fontSizes.indexOf( selectedFontSize ) ]\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\tconst commonUnit = getCommonSizeUnit( fontSizes );\n\t\tif ( commonUnit ) {\n\t\t\treturn `(${ commonUnit })`;\n\t\t}\n\n\t\treturn '';\n\t}, [\n\t\tshowCustomValueControl,\n\t\tshouldUseSelectControl,\n\t\tselectedFontSize,\n\t\tfontSizes,\n\t] );\n\n\tif ( fontSizes.length === 0 && disableCustomFontSizes ) {\n\t\treturn null;\n\t}\n\n\t// If neither the value or first font size is a string, then FontSizePicker\n\t// operates in a legacy \"unitless\" mode where UnitControl can only be used\n\t// to select px values and onChange() is always called with number values.\n\tconst hasUnits =\n\t\ttypeof value === 'string' || typeof fontSizes[ 0 ]?.size === 'string';\n\n\tconst [ valueQuantity, valueUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tvalue,\n\t\tunits\n\t);\n\tconst isValueUnitRelative =\n\t\t!! valueUnit && [ 'em', 'rem', 'vw', 'vh' ].includes( valueUnit );\n\tconst isDisabled = value === undefined;\n\n\treturn (\n\t\t<Container ref={ ref } className=\"components-font-size-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Font size' ) }</VisuallyHidden>\n\t\t\t<Spacer>\n\t\t\t\t<Header className=\"components-font-size-picker__header\">\n\t\t\t\t\t<HeaderLabel\n\t\t\t\t\t\taria-label={ `${ __( 'Size' ) } ${ headerHint || '' }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Size' ) }\n\t\t\t\t\t\t{ headerHint && (\n\t\t\t\t\t\t\t<HeaderHint className=\"components-font-size-picker__header__hint\">\n\t\t\t\t\t\t\t\t{ headerHint }\n\t\t\t\t\t\t\t</HeaderHint>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HeaderLabel>\n\t\t\t\t\t{ ! disableCustomFontSizes && (\n\t\t\t\t\t\t<HeaderToggle\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tshowCustomValueControl\n\t\t\t\t\t\t\t\t\t? __( 'Use size preset' )\n\t\t\t\t\t\t\t\t\t: __( 'Set custom size' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ settings }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetShowCustomValueControl(\n\t\t\t\t\t\t\t\t\t! showCustomValueControl\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisPressed={ showCustomValueControl }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Header>\n\t\t\t</Spacer>\n\t\t\t<div>\n\t\t\t\t{ !! fontSizes.length &&\n\t\t\t\t\tshouldUseSelectControl &&\n\t\t\t\t\t! showCustomValueControl && (\n\t\t\t\t\t\t<FontSizePickerSelect\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t: Number( newValue ),\n\t\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonSelectCustom={ () =>\n\t\t\t\t\t\t\t\tsetShowCustomValueControl( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t{ ! shouldUseSelectControl && ! showCustomValueControl && (\n\t\t\t\t\t<FontSizePickerToggleGroup\n\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\thasUnits ? newValue : Number( newValue ),\n\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! disableCustomFontSizes && showCustomValueControl && (\n\t\t\t\t\t<Flex className=\"components-font-size-picker__custom-size-control\">\n\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t\t: parseInt( newValue, 10 )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\tunits={ hasUnits ? units : [] }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t{ withSlider && (\n\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t<Spacer marginX={ 2 } marginBottom={ 0 }>\n\t\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize={\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tclassName=\"components-font-size-picker__custom-input\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom Size' ) }\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tvalue={ valueQuantity }\n\t\t\t\t\t\t\t\t\t\tinitialPosition={ fallbackFontSize }\n\t\t\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t\t\t} else if ( hasUnits ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewValue +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( valueUnit ?? 'px' )\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( newValue );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tmax={ isValueUnitRelative ? 10 : 100 }\n\t\t\t\t\t\t\t\t\t\tstep={ isValueUnitRelative ? 0.1 : 1 }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ withReset && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\t\t\tsize === '__unstable-large' ||\n\t\t\t\t\t\t\t\t\t\tprops.__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t: 'small'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Flex>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</Container>\n\t);\n};\n\nexport const FontSizePicker = forwardRef( UnforwardedFontSizePicker );\n\nexport default FontSizePicker;\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SAASC,QAAQ,EAAEC,OAAO,EAAEC,UAAU,QAAQ,oBAAoB;;AAElE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,IAAI,EAAEC,QAAQ,QAAQ,SAAS;AACxC,SACCC,OAAO,IAAIC,WAAW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A,KAAM;cACfhC,QAAQ,GAAI0B,SAAU,CAAC;YACxB,CAAG;YACHyB,OAAO,EAAC,WAAW;YACnBvD,qBAAqB;YACrBK,IAAI,EACHA,IAAI,KAAK,kBAAkB,IAC3BP,KAAK,CAACE,qBAAqB,GACxB,SAAS,GACT,OACH;YAAAgC,QAAA,EAEChE,EAAE,CAAE,OAAQ;UAAC,CACR;QAAC,CACA,CACV;MAAA,CACI,CACN;IAAA,CACG,CAAC;EAAA,CACI,CAAC;AAEd,CAAC;AAED,OAAO,MAAMwF,cAAc,GAAGpF,UAAU,CAAEyB,yBAA0B,CAAC;AAErE,eAAe2D,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["__","settings","useState","useMemo","forwardRef","Button","RangeControl","Flex","FlexItem","default","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits","VisuallyHidden","getCommonSizeUnit","Container","Header","HeaderHint","HeaderLabel","HeaderToggle","Spacer","FontSizePickerSelect","FontSizePickerToggleGroup","T_SHIRT_NAMES","jsx","_jsx","jsxs","_jsxs","DEFAULT_UNITS","UnforwardedFontSizePicker","props","ref","__next40pxDefaultSize","fallbackFontSize","fontSizes","disableCustomFontSizes","onChange","size","units","unitsProp","value","withSlider","withReset","availableUnits","shouldUseSelectControl","length","selectedFontSize","find","fontSize","isCustomValue","showCustomValueControl","setShowCustomValueControl","headerHint","name","indexOf","commonUnit","hasUnits","valueQuantity","valueUnit","isValueUnitRelative","includes","isDisabled","undefined","className","children","as","label","icon","onClick","isPressed","newValue","Number","onSelectCustom","isBlock","labelPosition","hideLabelFromVision","parseInt","min","marginX","marginBottom","__nextHasNoMarginBottom","initialPosition","withInputField","max","step","disabled","accessibleWhenDisabled","variant","FontSizePicker"],"sources":["@wordpress/components/src/font-size-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\nimport { useState, useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Button } from '../button';\nimport RangeControl from '../range-control';\nimport { Flex, FlexItem } from '../flex';\nimport {\n\tdefault as UnitControl,\n\tparseQuantityAndUnitFromRawValue,\n\tuseCustomUnits,\n} from '../unit-control';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { getCommonSizeUnit } from './utils';\nimport type { FontSizePickerProps } from './types';\nimport {\n\tContainer,\n\tHeader,\n\tHeaderHint,\n\tHeaderLabel,\n\tHeaderToggle,\n} from './styles';\nimport { Spacer } from '../spacer';\nimport FontSizePickerSelect from './font-size-picker-select';\nimport FontSizePickerToggleGroup from './font-size-picker-toggle-group';\nimport { T_SHIRT_NAMES } from './constants';\n\nconst DEFAULT_UNITS = [ 'px', 'em', 'rem', 'vw', 'vh' ];\n\nconst UnforwardedFontSizePicker = (\n\tprops: FontSizePickerProps,\n\tref: ForwardedRef< any >\n) => {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\tfallbackFontSize,\n\t\tfontSizes = [],\n\t\tdisableCustomFontSizes = false,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tunits: unitsProp = DEFAULT_UNITS,\n\t\tvalue,\n\t\twithSlider = false,\n\t\twithReset = true,\n\t} = props;\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: unitsProp,\n\t} );\n\n\tconst shouldUseSelectControl = fontSizes.length > 5;\n\tconst selectedFontSize = fontSizes.find(\n\t\t( fontSize ) => fontSize.size === value\n\t);\n\tconst isCustomValue = !! value && ! selectedFontSize;\n\n\tconst [ showCustomValueControl, setShowCustomValueControl ] = useState(\n\t\t! disableCustomFontSizes && isCustomValue\n\t);\n\n\tconst headerHint = useMemo( () => {\n\t\tif ( showCustomValueControl ) {\n\t\t\treturn __( 'Custom' );\n\t\t}\n\n\t\tif ( ! shouldUseSelectControl ) {\n\t\t\tif ( selectedFontSize ) {\n\t\t\t\treturn (\n\t\t\t\t\tselectedFontSize.name ||\n\t\t\t\t\tT_SHIRT_NAMES[ fontSizes.indexOf( selectedFontSize ) ]\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\tconst commonUnit = getCommonSizeUnit( fontSizes );\n\t\tif ( commonUnit ) {\n\t\t\treturn `(${ commonUnit })`;\n\t\t}\n\n\t\treturn '';\n\t}, [\n\t\tshowCustomValueControl,\n\t\tshouldUseSelectControl,\n\t\tselectedFontSize,\n\t\tfontSizes,\n\t] );\n\n\tif ( fontSizes.length === 0 && disableCustomFontSizes ) {\n\t\treturn null;\n\t}\n\n\t// If neither the value or first font size is a string, then FontSizePicker\n\t// operates in a legacy \"unitless\" mode where UnitControl can only be used\n\t// to select px values and onChange() is always called with number values.\n\tconst hasUnits =\n\t\ttypeof value === 'string' || typeof fontSizes[ 0 ]?.size === 'string';\n\n\tconst [ valueQuantity, valueUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tvalue,\n\t\tunits\n\t);\n\tconst isValueUnitRelative =\n\t\t!! valueUnit && [ 'em', 'rem', 'vw', 'vh' ].includes( valueUnit );\n\tconst isDisabled = value === undefined;\n\n\treturn (\n\t\t<Container ref={ ref } className=\"components-font-size-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Font size' ) }</VisuallyHidden>\n\t\t\t<Spacer>\n\t\t\t\t<Header className=\"components-font-size-picker__header\">\n\t\t\t\t\t<HeaderLabel\n\t\t\t\t\t\taria-label={ `${ __( 'Size' ) } ${ headerHint || '' }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Size' ) }\n\t\t\t\t\t\t{ headerHint && (\n\t\t\t\t\t\t\t<HeaderHint className=\"components-font-size-picker__header__hint\">\n\t\t\t\t\t\t\t\t{ headerHint }\n\t\t\t\t\t\t\t</HeaderHint>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HeaderLabel>\n\t\t\t\t\t{ ! disableCustomFontSizes && (\n\t\t\t\t\t\t<HeaderToggle\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tshowCustomValueControl\n\t\t\t\t\t\t\t\t\t? __( 'Use size preset' )\n\t\t\t\t\t\t\t\t\t: __( 'Set custom size' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ settings }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetShowCustomValueControl(\n\t\t\t\t\t\t\t\t\t! showCustomValueControl\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisPressed={ showCustomValueControl }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Header>\n\t\t\t</Spacer>\n\t\t\t<div>\n\t\t\t\t{ !! fontSizes.length &&\n\t\t\t\t\tshouldUseSelectControl &&\n\t\t\t\t\t! showCustomValueControl && (\n\t\t\t\t\t\t<FontSizePickerSelect\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t: Number( newValue ),\n\t\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonSelectCustom={ () =>\n\t\t\t\t\t\t\t\tsetShowCustomValueControl( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t{ ! shouldUseSelectControl && ! showCustomValueControl && (\n\t\t\t\t\t<FontSizePickerToggleGroup\n\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\thasUnits ? newValue : Number( newValue ),\n\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! disableCustomFontSizes && showCustomValueControl && (\n\t\t\t\t\t<Flex className=\"components-font-size-picker__custom-size-control\">\n\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t\t: parseInt( newValue, 10 )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\tunits={ hasUnits ? units : [] }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t{ withSlider && (\n\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t<Spacer marginX={ 2 } marginBottom={ 0 }>\n\t\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize={\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tclassName=\"components-font-size-picker__custom-input\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom Size' ) }\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tvalue={ valueQuantity }\n\t\t\t\t\t\t\t\t\t\tinitialPosition={ fallbackFontSize }\n\t\t\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t\t\t} else if ( hasUnits ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewValue +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( valueUnit ?? 'px' )\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( newValue );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tmax={ isValueUnitRelative ? 10 : 100 }\n\t\t\t\t\t\t\t\t\t\tstep={ isValueUnitRelative ? 0.1 : 1 }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ withReset && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\t\t\tsize === '__unstable-large' ||\n\t\t\t\t\t\t\t\t\t\tprops.__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t: 'small'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Flex>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</Container>\n\t);\n};\n\nexport const FontSizePicker = forwardRef( UnforwardedFontSizePicker );\n\nexport default F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AAC;gBACvB;cACD,CAAG;cACHO,GAAG,EAAG,CAAG;cACTM,GAAG,EAAGxB,mBAAmB,GAAG,EAAE,GAAG,GAAK;cACtCyB,IAAI,EAAGzB,mBAAmB,GAAG,GAAG,GAAG;YAAG,CACtC;UAAC,CACK;QAAC,CACA,CACV,EACCjB,SAAS,iBACVjB,IAAA,CAACjB,QAAQ;UAAAwD,QAAA,eACRvC,IAAA,CAACpB,MAAM;YACNgF,QAAQ,EAAGxB,UAAY;YACvByB,sBAAsB;YACtBlB,OAAO,EAAGA,CAAA,KAAM;cACfhC,QAAQ,GAAI0B,SAAU,CAAC;YACxB,CAAG;YACHyB,OAAO,EAAC,WAAW;YACnBvD,qBAAqB;YACrBK,IAAI,EACHA,IAAI,KAAK,kBAAkB,IAC3BP,KAAK,CAACE,qBAAqB,GACxB,SAAS,GACT,OACH;YAAAgC,QAAA,EAEChE,EAAE,CAAE,OAAQ;UAAC,CACR;QAAC,CACA,CACV;MAAA,CACI,CACN;IAAA,CACG,CAAC;EAAA,CACI,CAAC;AAEd,CAAC;AAED,OAAO,MAAMwF,cAAc,GAAGpF,UAAU,CAAEyB,yBAA0B,CAAC;AAErE,eAAe2D,cAAc","ignoreList":[]}
@@ -1,7 +1,3 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
-
5
1
  /**
6
2
  * Internal dependencies
7
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["parseQuantityAndUnitFromRawValue","isSimpleCssValue","value","sizeRegex","test","String","getCommonSizeUnit","fontSizes","firstFontSize","otherFontSizes","firstUnit","size","areAllSizesSameUnit","every","fontSize","unit"],"sources":["@wordpress/components/src/font-size-picker/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { FontSizePickerProps, FontSize } from './types';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control';\n\n/**\n * Some themes use css vars for their font sizes, so until we\n * have the way of calculating them don't display them.\n *\n * @param value The value that is checked.\n * @return Whether the value is a simple css value.\n */\nexport function isSimpleCssValue(\n\tvalue: NonNullable< FontSizePickerProps[ 'value' ] >\n) {\n\tconst sizeRegex =\n\t\t/^[\\d\\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;\n\treturn sizeRegex.test( String( value ) );\n}\n\n/**\n * If all of the given font sizes have the same unit (e.g. 'px'), return that\n * unit. Otherwise return null.\n *\n * @param fontSizes List of font sizes.\n * @return The common unit, or null.\n */\nexport function getCommonSizeUnit( fontSizes: FontSize[] ) {\n\tconst [ firstFontSize, ...otherFontSizes ] = fontSizes;\n\tif ( ! firstFontSize ) {\n\t\treturn null;\n\t}\n\tconst [ , firstUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tfirstFontSize.size\n\t);\n\tconst areAllSizesSameUnit = otherFontSizes.every( ( fontSize ) => {\n\t\tconst [ , unit ] = parseQuantityAndUnitFromRawValue( fontSize.size );\n\t\treturn unit === firstUnit;\n\t} );\n\treturn areAllSizesSameUnit ? firstUnit : null;\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;;AAEA,SAASA,gCAAgC,QAAQ,iBAAiB;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAC/BC,KAAoD,EACnD;EACD,MAAMC,SAAS,GACd,oIAAoI;EACrI,OAAOA,SAAS,CAACC,IAAI,CAAEC,MAAM,CAAEH,KAAM,CAAE,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,iBAAiBA,CAAEC,SAAqB,EAAG;EAC1D,MAAM,CAAEC,aAAa,EAAE,GAAGC,cAAc,CAAE,GAAGF,SAAS;EACtD,IAAK,CAAEC,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EACA,MAAM,GAAIE,SAAS,CAAE,GAAGV,gCAAgC,CACvDQ,aAAa,CAACG,IACf,CAAC;EACD,MAAMC,mBAAmB,GAAGH,cAAc,CAACI,KAAK,CAAIC,QAAQ,IAAM;IACjE,MAAM,GAAIC,IAAI,CAAE,GAAGf,gCAAgC,CAAEc,QAAQ,CAACH,IAAK,CAAC;IACpE,OAAOI,IAAI,KAAKL,SAAS;EAC1B,CAAE,CAAC;EACH,OAAOE,mBAAmB,GAAGF,SAAS,GAAG,IAAI;AAC9C","ignoreList":[]}
1
+ {"version":3,"names":["parseQuantityAndUnitFromRawValue","isSimpleCssValue","value","sizeRegex","test","String","getCommonSizeUnit","fontSizes","firstFontSize","otherFontSizes","firstUnit","size","areAllSizesSameUnit","every","fontSize","unit"],"sources":["@wordpress/components/src/font-size-picker/utils.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { FontSizePickerProps, FontSize } from './types';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control';\n\n/**\n * Some themes use css vars for their font sizes, so until we\n * have the way of calculating them don't display them.\n *\n * @param value The value that is checked.\n * @return Whether the value is a simple css value.\n */\nexport function isSimpleCssValue(\n\tvalue: NonNullable< FontSizePickerProps[ 'value' ] >\n) {\n\tconst sizeRegex =\n\t\t/^[\\d\\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;\n\treturn sizeRegex.test( String( value ) );\n}\n\n/**\n * If all of the given font sizes have the same unit (e.g. 'px'), return that\n * unit. Otherwise return null.\n *\n * @param fontSizes List of font sizes.\n * @return The common unit, or null.\n */\nexport function getCommonSizeUnit( fontSizes: FontSize[] ) {\n\tconst [ firstFontSize, ...otherFontSizes ] = fontSizes;\n\tif ( ! firstFontSize ) {\n\t\treturn null;\n\t}\n\tconst [ , firstUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tfirstFontSize.size\n\t);\n\tconst areAllSizesSameUnit = otherFontSizes.every( ( fontSize ) => {\n\t\tconst [ , unit ] = parseQuantityAndUnitFromRawValue( fontSize.size );\n\t\treturn unit === firstUnit;\n\t} );\n\treturn areAllSizesSameUnit ? firstUnit : null;\n}\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,gCAAgC,QAAQ,iBAAiB;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAC/BC,KAAoD,EACnD;EACD,MAAMC,SAAS,GACd,oIAAoI;EACrI,OAAOA,SAAS,CAACC,IAAI,CAAEC,MAAM,CAAEH,KAAM,CAAE,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,iBAAiBA,CAAEC,SAAqB,EAAG;EAC1D,MAAM,CAAEC,aAAa,EAAE,GAAGC,cAAc,CAAE,GAAGF,SAAS;EACtD,IAAK,CAAEC,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EACA,MAAM,GAAIE,SAAS,CAAE,GAAGV,gCAAgC,CACvDQ,aAAa,CAACG,IACf,CAAC;EACD,MAAMC,mBAAmB,GAAGH,cAAc,CAACI,KAAK,CAAIC,QAAQ,IAAM;IACjE,MAAM,GAAIC,IAAI,CAAE,GAAGf,gCAAgC,CAAEc,QAAQ,CAACH,IAAK,CAAC;IACpE,OAAOI,IAAI,KAAKL,SAAS;EAC1B,CAAE,CAAC;EACH,OAAOE,mBAAmB,GAAGF,SAAS,GAAG,IAAI;AAC9C","ignoreList":[]}
@@ -64,7 +64,10 @@ export default function Token({
64
64
  }), /*#__PURE__*/_jsx(Button, {
65
65
  className: "components-form-token-field__remove-token",
66
66
  icon: closeSmall,
67
- onClick: !disabled ? onClick : undefined,
67
+ onClick: !disabled ? onClick : undefined
68
+ // Disable reason: Even when FormTokenField itself is accessibly disabled, token reset buttons shouldn't be in the tab sequence.
69
+ // eslint-disable-next-line no-restricted-syntax
70
+ ,
68
71
  disabled: disabled,
69
72
  label: messages.remove,
70
73
  "aria-describedby": `components-form-token-field__token-text-${instanceId}`
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useInstanceId","__","sprintf","closeSmall","Button","VisuallyHidden","jsx","_jsx","jsxs","_jsxs","noop","Token","value","status","title","displayTransform","isBorderless","disabled","onClickRemove","onMouseEnter","onMouseLeave","messages","termPosition","termsCount","instanceId","tokenClasses","onClick","transformedValue","termPositionAndCount","className","children","id","as","icon","undefined","label","remove"],"sources":["@wordpress/components/src/form-token-field/token.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { TokenProps } from './types';\n\nconst noop = () => {};\n\nexport default function Token( {\n\tvalue,\n\tstatus,\n\ttitle,\n\tdisplayTransform,\n\tisBorderless = false,\n\tdisabled = false,\n\tonClickRemove = noop,\n\tonMouseEnter,\n\tonMouseLeave,\n\tmessages,\n\ttermPosition,\n\ttermsCount,\n}: TokenProps ) {\n\tconst instanceId = useInstanceId( Token );\n\tconst tokenClasses = clsx( 'components-form-token-field__token', {\n\t\t'is-error': 'error' === status,\n\t\t'is-success': 'success' === status,\n\t\t'is-validating': 'validating' === status,\n\t\t'is-borderless': isBorderless,\n\t\t'is-disabled': disabled,\n\t} );\n\n\tconst onClick = () => onClickRemove( { value } );\n\n\tconst transformedValue = displayTransform( value );\n\tconst termPositionAndCount = sprintf(\n\t\t/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */\n\t\t__( '%1$s (%2$s of %3$s)' ),\n\t\ttransformedValue,\n\t\ttermPosition,\n\t\ttermsCount\n\t);\n\n\treturn (\n\t\t<span\n\t\t\tclassName={ tokenClasses }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\ttitle={ title }\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"components-form-token-field__token-text\"\n\t\t\t\tid={ `components-form-token-field__token-text-${ instanceId }` }\n\t\t\t>\n\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t{ termPositionAndCount }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<span aria-hidden=\"true\">{ transformedValue }</span>\n\t\t\t</span>\n\n\t\t\t<Button\n\t\t\t\tclassName=\"components-form-token-field__remove-token\"\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tonClick={ ! disabled ? onClick : undefined }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tlabel={ messages.remove }\n\t\t\t\taria-describedby={ `components-form-token-field__token-text-${ instanceId }` }\n\t\t\t/>\n\t\t</span>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,UAAU,QAAQ,kBAAkB;;AAE7C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,cAAc,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAGpD,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,eAAe,SAASC,KAAKA,CAAE;EAC9BC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC,gBAAgB;EAChBC,YAAY,GAAG,KAAK;EACpBC,QAAQ,GAAG,KAAK;EAChBC,aAAa,GAAGR,IAAI;EACpBS,YAAY;EACZC,YAAY;EACZC,QAAQ;EACRC,YAAY;EACZC;AACW,CAAC,EAAG;EACf,MAAMC,UAAU,GAAGxB,aAAa,CAAEW,KAAM,CAAC;EACzC,MAAMc,YAAY,GAAG1B,IAAI,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button","VisuallyHidden","jsx","_jsx","jsxs","_jsxs","noop","Token","value","status","title","displayTransform","isBorderless","disabled","onClickRemove","onMouseEnter","onMouseLeave","messages","termPosition","termsCount","instanceId","tokenClasses","onClick","transformedValue","termPositionAndCount","className","children","id","as","icon","undefined","label","remove"],"sources":["@wordpress/components/src/form-token-field/token.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { TokenProps } from './types';\n\nconst noop = () => {};\n\nexport default function Token( {\n\tvalue,\n\tstatus,\n\ttitle,\n\tdisplayTransform,\n\tisBorderless = false,\n\tdisabled = false,\n\tonClickRemove = noop,\n\tonMouseEnter,\n\tonMouseLeave,\n\tmessages,\n\ttermPosition,\n\ttermsCount,\n}: TokenProps ) {\n\tconst instanceId = useInstanceId( Token );\n\tconst tokenClasses = clsx( 'components-form-token-field__token', {\n\t\t'is-error': 'error' === status,\n\t\t'is-success': 'success' === status,\n\t\t'is-validating': 'validating' === status,\n\t\t'is-borderless': isBorderless,\n\t\t'is-disabled': disabled,\n\t} );\n\n\tconst onClick = () => onClickRemove( { value } );\n\n\tconst transformedValue = displayTransform( value );\n\tconst termPositionAndCount = sprintf(\n\t\t/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */\n\t\t__( '%1$s (%2$s of %3$s)' ),\n\t\ttransformedValue,\n\t\ttermPosition,\n\t\ttermsCount\n\t);\n\n\treturn (\n\t\t<span\n\t\t\tclassName={ tokenClasses }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\ttitle={ title }\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"components-form-token-field__token-text\"\n\t\t\t\tid={ `components-form-token-field__token-text-${ instanceId }` }\n\t\t\t>\n\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t{ termPositionAndCount }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<span aria-hidden=\"true\">{ transformedValue }</span>\n\t\t\t</span>\n\n\t\t\t<Button\n\t\t\t\tclassName=\"components-form-token-field__remove-token\"\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tonClick={ ! disabled ? onClick : undefined }\n\t\t\t\t// Disable reason: Even when FormTokenField itself is accessibly disabled, token reset buttons shouldn't be in the tab sequence.\n\t\t\t\t// eslint-disable-next-line no-restricted-syntax\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tlabel={ messages.remove }\n\t\t\t\taria-describedby={ `components-form-token-field__token-text-${ instanceId }` }\n\t\t\t/>\n\t\t</span>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,UAAU,QAAQ,kBAAkB;;AAE7C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,cAAc,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAGpD,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,eAAe,SAASC,KAAKA,CAAE;EAC9BC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC,gBAAgB;EAChBC,YAAY,GAAG,KAAK;EACpBC,QAAQ,GAAG,KAAK;EAChBC,aAAa,GAAGR,IAAI;EACpBS,YAAY;EACZC,YAAY;EACZC,QAAQ;EACRC,YAAY;EACZC;AACW,CAAC,EAAG;EACf,MAAMC,UAAU,GAAGxB,aAAa,CAAEW,KAAM,CAAC;EACzC,MAAMc,YAAY,GAAG1B,IAAI,CAAE,oCAA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@typedef {import('react').ComponentType} ComponentType */
8
8
 
9
9
  /**
10
- * A Higher Order Component used to be provide speak and debounced speak
11
- * functions.
10
+ * A Higher Order Component used to provide speak and debounced speak functions.
12
11
  *
13
12
  * @see https://developer.wordpress.org/block-editor/packages/packages-a11y/#speak
14
13
  *
@@ -1 +1 @@
1
- {"version":3,"names":["createHigherOrderComponent","useDebounce","speak","jsx","_jsx","Component","props","debouncedSpeak"],"sources":["@wordpress/components/src/higher-order/with-spoken-messages/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\n\n/** @typedef {import('react').ComponentType} ComponentType */\n\n/**\n * A Higher Order Component used to be provide speak and debounced speak\n * functions.\n *\n * @see https://developer.wordpress.org/block-editor/packages/packages-a11y/#speak\n *\n * @param {ComponentType} Component The component to be wrapped.\n *\n * @return {ComponentType} The wrapped component.\n */\nexport default createHigherOrderComponent(\n\t( Component ) => ( props ) => (\n\t\t<Component\n\t\t\t{ ...props }\n\t\t\tspeak={ speak }\n\t\t\tdebouncedSpeak={ useDebounce( speak, 500 ) }\n\t\t/>\n\t),\n\t'withSpokenMessages'\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAA0B,EAAEC,WAAW,QAAQ,oBAAoB;AAC5E,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AATA,SAAAC,GAAA,IAAAC,IAAA;AAUA,eAAeJ,0BAA0B,CACtCK,SAAS,IAAQC,KAAK,iBACvBF,IAAA,CAACC,SAAS;EAAA,GACJC,KAAK;EACVJ,KAAK,EAAGA,KAAO;EACfK,cAAc,EAAGN,WAAW,CAAEC,KAAK,EAAE,GAAI;AAAG,CAC5C,CACD,EACD,oBACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["createHigherOrderComponent","useDebounce","speak","jsx","_jsx","Component","props","debouncedSpeak"],"sources":["@wordpress/components/src/higher-order/with-spoken-messages/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\n\n/** @typedef {import('react').ComponentType} ComponentType */\n\n/**\n * A Higher Order Component used to provide speak and debounced speak functions.\n *\n * @see https://developer.wordpress.org/block-editor/packages/packages-a11y/#speak\n *\n * @param {ComponentType} Component The component to be wrapped.\n *\n * @return {ComponentType} The wrapped component.\n */\nexport default createHigherOrderComponent(\n\t( Component ) => ( props ) => (\n\t\t<Component\n\t\t\t{ ...props }\n\t\t\tspeak={ speak }\n\t\t\tdebouncedSpeak={ useDebounce( speak, 500 ) }\n\t\t/>\n\t),\n\t'withSpokenMessages'\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAA0B,EAAEC,WAAW,QAAQ,oBAAoB;AAC5E,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARA,SAAAC,GAAA,IAAAC,IAAA;AASA,eAAeJ,0BAA0B,CACtCK,SAAS,IAAQC,KAAK,iBACvBF,IAAA,CAACC,SAAS;EAAA,GACJC,KAAK;EACVJ,KAAK,EAAGA,KAAO;EACfK,cAAc,EAAGN,WAAW,CAAEC,KAAK,EAAE,GAAI;AAAG,CAC5C,CACD,EACD,oBACD,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/menu-items-choice/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { ShortcutProps } from '../shortcut/types';\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport type MenuItemsChoiceProps = {\n\t/**\n\t * Array of choices.\n\t *\n\t * @default []\n\t */\n\tchoices: readonly MenuItemChoice[];\n\t/**\n\t * Value of currently selected choice (should match a `value` property\n\t * from a choice in `choices`).\n\t */\n\tvalue: string;\n\t/**\n\t * Callback function to be called with the selected choice when user\n\t * selects a new choice.\n\t */\n\tonSelect( value: string ): void;\n\t/**\n\t * Callback function to be called with a choice when user\n\t * hovers over a new choice (will be empty on mouse leave).\n\t *\n\t * @default noop\n\t */\n\tonHover: ( value: string | null ) => void;\n};\n\nexport type MenuItemChoice = {\n\t/**\n\t * Human-readable label for choice.\n\t */\n\tlabel: string;\n\t/**\n\t * Unique value for choice.\n\t */\n\tvalue: string;\n\t/**\n\t * Whether the menu item is disabled.\n\t */\n\tdisabled?: ButtonAsButtonProps[ 'disabled' ];\n\t/**\n\t * Additional information which will be rendered below the given label.\n\t */\n\tinfo?: string;\n\t/**\n\t * Optional keyboard sequence to trigger choice with keyboard shortcut\n\t * (e.g. `ctrl+s`).\n\t */\n\tshortcut?: ShortcutProps[ 'shortcut' ];\n\t/**\n\t * Aria compliant label.\n\t */\n\t[ 'aria-label' ]?: string;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/menu-items-choice/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { ShortcutProps } from '../shortcut/types';\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport type MenuItemsChoiceProps = {\n\t/**\n\t * Array of choices.\n\t *\n\t * @default []\n\t */\n\tchoices: readonly MenuItemChoice[];\n\t/**\n\t * Value of currently selected choice (should match a `value` property\n\t * from a choice in `choices`).\n\t */\n\tvalue: string;\n\t/**\n\t * Callback function to be called with the selected choice when user\n\t * selects a new choice.\n\t */\n\tonSelect: ( value: string ) => void;\n\n\t/**\n\t * Callback function to be called with a choice when user\n\t * hovers over a new choice (will be empty on mouse leave).\n\t *\n\t * @default noop\n\t */\n\tonHover: ( value: string | null ) => void;\n};\n\nexport type MenuItemChoice = {\n\t/**\n\t * Human-readable label for choice.\n\t */\n\tlabel: string;\n\t/**\n\t * Unique value for choice.\n\t */\n\tvalue: string;\n\t/**\n\t * Whether the menu item is disabled.\n\t */\n\tdisabled?: ButtonAsButtonProps[ 'disabled' ];\n\t/**\n\t * Additional information which will be rendered below the given label.\n\t */\n\tinfo?: string;\n\t/**\n\t * Optional keyboard sequence to trigger choice with keyboard shortcut\n\t * (e.g. `ctrl+s`).\n\t */\n\tshortcut?: ShortcutProps[ 'shortcut' ];\n\t/**\n\t * Aria compliant label.\n\t */\n\t[ 'aria-label' ]?: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -4,9 +4,6 @@
4
4
 
5
5
  import clsx from 'clsx';
6
6
  import { useFloating, flip as flipMiddleware, shift as shiftMiddleware, limitShift, autoUpdate, arrow, offset as offsetMiddleware, size } from '@floating-ui/react-dom';
7
- // eslint-disable-next-line no-restricted-imports
8
-
9
- // eslint-disable-next-line no-restricted-imports
10
7
  import { motion } from 'framer-motion';
11
8
 
12
9
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useFloating","flip","flipMiddleware","shift","shiftMiddleware","limitShift","autoUpdate","arrow","offset","offsetMiddleware","size","motion","useRef","useLayoutEffect","forwardRef","createContext","useContext","useMemo","useState","useCallback","createPortal","useReducedMotion","useViewportMatch","useMergeRefs","__experimentalUseDialog","useDialog","close","deprecated","Path","SVG","Button","ScrollLock","Slot","Fill","useSlot","computePopoverPosition","positionToPlacement","placementToMotionAnimationProps","getReferenceElement","contextConnect","useContextSystem","overlayMiddlewares","StyleProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SLOT_NAME","ArrowTriangle","xmlns","viewBox","className","role","children","d","vectorEffect","slotNameContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","resize","inline","variant","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","computedFlipProp","computedResizeProp","since","version","alternative","computedVariant","arrowRef","fallbackReferenceElement","setFallbackReferenceElement","anchorRefFallback","node","isMobileViewport","isExpanded","hasArrow","normalizedPlacementFromProps","middleware","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","style","maxHeight","availableHeight","overflow","crossAxis","limiter","padding","element","slotName","slot","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","whileElementsMounted","referenceParam","floatingParam","updateParam","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","resultingReferenceElement","setReference","mergedFloatingRef","setFloating","left","shouldReduceMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","animationProps","onAnimationComplete","isPositioned","content","div","ref","tabIndex","icon","onClick","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","name","Popover","PopoverSlot","bubblesVirtually","__unstableSlotNameProvider","Provider"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\n// eslint-disable-next-line no-restricted-imports\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\n// eslint-disable-next-line no-restricted-imports\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children`, which are re-defined in `PopoverProps`).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle,\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = contextConnect( UnforwardedPopover, 'Popover' );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\n// @ts-expect-error For Legacy Reasons\nPopover.Slot = forwardRef( PopoverSlot );\n// @ts-expect-error For Legacy Reasons\nPopover.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default Popover;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;AACvB,SACCC,WAAW,EACXC,IAAI,IAAIC,cAAc,EACtBC,KAAK,IAAIC,eAAe,EACxBC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,MAAM,IAAIC,gBAAgB,EAC1BC,IAAI,QACE,wBAAwB;AAC/B;;AAEA;AACA,SAASC,MAAM,QAAQ,eAAe;;AAEtC;AACA;AACA;AACA,SACCC,MAAM,EACNC,eAAe,EACfC,UAAU,EACVC,aAAa,EACbC,UAAU,EACVC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,YAAY,QACN,oBAAoB;AAC3B,SACCC,gBAAgB,EAChBC,gBAAgB,EAChBC,YAAY,EACZC,uBAAuB,IAAIC,SAAS,QAC9B,oBAAoB;AAC3B,SAASC,KAAK,QAAQ,kBAAkB;AACxC,OAAOC,UAAU,MAAM,uBA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0J,gBAAgB;IAChBH,IAAI,EAAGA,IAAM;IACblI,SAAS,EAAC,cAAc;IACxBwH,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;;AAEA;AACAW,OAAO,CAACxJ,IAAI,GAAGlB,UAAU,CAAE2K,WAAY,CAAC;AACxC;AACAD,OAAO,CAACG,0BAA0B,GAAGjI,eAAe,CAACkI,QAAQ;AAE7D,eAAeJ,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useFloating","flip","flipMiddleware","shift","shiftMiddleware","limitShift","autoUpdate","arrow","offset","offsetMiddleware","size","motion","useRef","useLayoutEffect","forwardRef","createContext","useContext","useMemo","useState","useCallback","createPortal","useReducedMotion","useViewportMatch","useMergeRefs","__experimentalUseDialog","useDialog","close","deprecated","Path","SVG","Button","ScrollLock","Slot","Fill","useSlot","computePopoverPosition","positionToPlacement","placementToMotionAnimationProps","getReferenceElement","contextConnect","useContextSystem","overlayMiddlewares","StyleProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","SLOT_NAME","ArrowTriangle","xmlns","viewBox","className","role","children","d","vectorEffect","slotNameContext","undefined","fallbackContainerClassname","getPopoverFallbackContainer","container","document","body","querySelector","createElement","append","UnforwardedPopover","props","forwardedRef","animate","headerTitle","constrainTabbing","onClose","noArrow","position","placement","placementProp","offsetProp","focusOnMount","anchor","expandOnMobile","onFocusOutside","__unstableSlotName","resize","inline","variant","__unstableForcePosition","anchorRef","anchorRect","getAnchorRect","isAlternate","contentProps","computedFlipProp","computedResizeProp","since","version","alternative","computedVariant","arrowRef","fallbackReferenceElement","setFallbackReferenceElement","anchorRefFallback","node","isMobileViewport","isExpanded","hasArrow","normalizedPlacementFromProps","middleware","apply","sizeProps","_refs$floating$curren","firstElementChild","refs","floating","current","HTMLElement","Object","assign","style","maxHeight","availableHeight","overflow","crossAxis","limiter","padding","element","slotName","slot","onDialogClose","type","event","dialogRef","dialogProps","__unstableOnClose","x","y","strategy","update","computedPlacement","middlewareData","arrowData","whileElementsMounted","referenceParam","floatingParam","updateParam","layoutShift","animationFrame","arrowCallbackRef","anchorRefTop","top","anchorRefBottom","bottom","anchorRefStartContainer","startContainer","anchorRefCurrent","resultingReferenceElement","setReference","mergedFloatingRef","setFloating","left","shouldReduceMotion","shouldAnimate","animationFinished","setAnimationFinished","motionInlineStyles","otherMotionProps","animationProps","onAnimationComplete","isPositioned","content","div","ref","tabIndex","icon","onClick","split","join","Number","isFinite","shouldRenderWithinSlot","hasAnchor","name","Popover","PopoverSlot","bubblesVirtually","__unstableSlotNameProvider","Provider"],"sources":["@wordpress/components/src/popover/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef, SyntheticEvent, RefCallback } from 'react';\nimport clsx from 'clsx';\nimport {\n\tuseFloating,\n\tflip as flipMiddleware,\n\tshift as shiftMiddleware,\n\tlimitShift,\n\tautoUpdate,\n\tarrow,\n\toffset as offsetMiddleware,\n\tsize,\n} from '@floating-ui/react-dom';\nimport type { HTMLMotionProps, MotionProps } from 'framer-motion';\nimport { motion } from 'framer-motion';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseRef,\n\tuseLayoutEffect,\n\tforwardRef,\n\tcreateContext,\n\tuseContext,\n\tuseMemo,\n\tuseState,\n\tuseCallback,\n\tcreatePortal,\n} from '@wordpress/element';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tuseMergeRefs,\n\t__experimentalUseDialog as useDialog,\n} from '@wordpress/compose';\nimport { close } from '@wordpress/icons';\nimport deprecated from '@wordpress/deprecated';\nimport { Path, SVG } from '@wordpress/primitives';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport ScrollLock from '../scroll-lock';\nimport { Slot, Fill, useSlot } from '../slot-fill';\nimport {\n\tcomputePopoverPosition,\n\tpositionToPlacement,\n\tplacementToMotionAnimationProps,\n\tgetReferenceElement,\n} from './utils';\nimport { contextConnect, useContextSystem } from '../context';\nimport type { WordPressComponentProps } from '../context';\nimport type {\n\tPopoverProps,\n\tPopoverAnchorRefReference,\n\tPopoverAnchorRefTopBottom,\n} from './types';\nimport { overlayMiddlewares } from './overlay-middlewares';\nimport { StyleProvider } from '../style-provider';\n\n/**\n * Name of slot in which popover should fill.\n *\n * @type {string}\n */\nexport const SLOT_NAME = 'Popover';\n\n// An SVG displaying a triangle facing down, filled with a solid\n// color and bordered in such a way to create an arrow-like effect.\n// Keeping the SVG's viewbox squared simplify the arrow positioning\n// calculations.\nconst ArrowTriangle = () => (\n\t<SVG\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 100 100\"\n\t\tclassName=\"components-popover__triangle\"\n\t\trole=\"presentation\"\n\t>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-bg\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t/>\n\t\t<Path\n\t\t\tclassName=\"components-popover__triangle-border\"\n\t\t\td=\"M 0 0 L 50 50 L 100 0\"\n\t\t\tvectorEffect=\"non-scaling-stroke\"\n\t\t/>\n\t</SVG>\n);\n\nconst slotNameContext = createContext< string | undefined >( undefined );\n\nconst fallbackContainerClassname = 'components-popover__fallback-container';\nconst getPopoverFallbackContainer = () => {\n\tlet container = document.body.querySelector(\n\t\t'.' + fallbackContainerClassname\n\t);\n\tif ( ! container ) {\n\t\tcontainer = document.createElement( 'div' );\n\t\tcontainer.className = fallbackContainerClassname;\n\t\tdocument.body.append( container );\n\t}\n\n\treturn container;\n};\n\nconst UnforwardedPopover = (\n\tprops: Omit<\n\t\tWordPressComponentProps< PopoverProps, 'div', false >,\n\t\t// To avoid overlaps between the standard HTML attributes and the props\n\t\t// expected by `framer-motion`, omit all framer motion props from popover\n\t\t// props (except for `animate` and `children`, which are re-defined in `PopoverProps`).\n\t\tkeyof Omit< MotionProps, 'animate' | 'children' >\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) => {\n\tconst {\n\t\tanimate = true,\n\t\theaderTitle,\n\t\tconstrainTabbing,\n\t\tonClose,\n\t\tchildren,\n\t\tclassName,\n\t\tnoArrow = true,\n\t\tposition,\n\t\tplacement: placementProp = 'bottom-start',\n\t\toffset: offsetProp = 0,\n\t\tfocusOnMount = 'firstElement',\n\t\tanchor,\n\t\texpandOnMobile,\n\t\tonFocusOutside,\n\t\t__unstableSlotName = SLOT_NAME,\n\t\tflip = true,\n\t\tresize = true,\n\t\tshift = false,\n\t\tinline = false,\n\t\tvariant,\n\n\t\t// Deprecated props\n\t\t__unstableForcePosition,\n\t\tanchorRef,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tisAlternate,\n\n\t\t// Rest\n\t\t...contentProps\n\t} = useContextSystem( props, 'Popover' );\n\n\tlet computedFlipProp = flip;\n\tlet computedResizeProp = resize;\n\tif ( __unstableForcePosition !== undefined ) {\n\t\tdeprecated( '`__unstableForcePosition` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\tversion: '6.3',\n\t\t\talternative: '`flip={ false }` and `resize={ false }`',\n\t\t} );\n\n\t\t// Back-compat, set the `flip` and `resize` props\n\t\t// to `false` to replicate `__unstableForcePosition`.\n\t\tcomputedFlipProp = ! __unstableForcePosition;\n\t\tcomputedResizeProp = ! __unstableForcePosition;\n\t}\n\n\tif ( anchorRef !== undefined ) {\n\t\tdeprecated( '`anchorRef` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( anchorRect !== undefined ) {\n\t\tdeprecated( '`anchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tif ( getAnchorRect !== undefined ) {\n\t\tdeprecated( '`getAnchorRect` prop in wp.components.Popover', {\n\t\t\tsince: '6.1',\n\t\t\talternative: '`anchor` prop',\n\t\t} );\n\t}\n\n\tconst computedVariant = isAlternate ? 'toolbar' : variant;\n\tif ( isAlternate !== undefined ) {\n\t\tdeprecated( '`isAlternate` prop in wp.components.Popover', {\n\t\t\tsince: '6.2',\n\t\t\talternative: \"`variant` prop with the `'toolbar'` value\",\n\t\t} );\n\t}\n\n\tconst arrowRef = useRef< HTMLElement | null >( null );\n\n\tconst [ fallbackReferenceElement, setFallbackReferenceElement ] =\n\t\tuseState< HTMLSpanElement | null >( null );\n\n\tconst anchorRefFallback: RefCallback< HTMLSpanElement > = useCallback(\n\t\t( node ) => {\n\t\t\tsetFallbackReferenceElement( node );\n\t\t},\n\t\t[]\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isExpanded = expandOnMobile && isMobileViewport;\n\tconst hasArrow = ! isExpanded && ! noArrow;\n\tconst normalizedPlacementFromProps = position\n\t\t? positionToPlacement( position )\n\t\t: placementProp;\n\n\tconst middleware = [\n\t\t...( placementProp === 'overlay' ? overlayMiddlewares() : [] ),\n\t\toffsetMiddleware( offsetProp ),\n\t\tcomputedFlipProp && flipMiddleware(),\n\t\tcomputedResizeProp &&\n\t\t\tsize( {\n\t\t\t\tapply( sizeProps ) {\n\t\t\t\t\tconst { firstElementChild } = refs.floating.current ?? {};\n\n\t\t\t\t\t// Only HTMLElement instances have the `style` property.\n\t\t\t\t\tif ( ! ( firstElementChild instanceof HTMLElement ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Reduce the height of the popover to the available space.\n\t\t\t\t\tObject.assign( firstElementChild.style, {\n\t\t\t\t\t\tmaxHeight: `${ sizeProps.availableHeight }px`,\n\t\t\t\t\t\toverflow: 'auto',\n\t\t\t\t\t} );\n\t\t\t\t},\n\t\t\t} ),\n\t\tshift &&\n\t\t\tshiftMiddleware( {\n\t\t\t\tcrossAxis: true,\n\t\t\t\tlimiter: limitShift(),\n\t\t\t\tpadding: 1, // Necessary to avoid flickering at the edge of the viewport.\n\t\t\t} ),\n\t\tarrow( { element: arrowRef } ),\n\t];\n\tconst slotName = useContext( slotNameContext ) || __unstableSlotName;\n\tconst slot = useSlot( slotName );\n\n\tlet onDialogClose;\n\n\tif ( onClose || onFocusOutside ) {\n\t\tonDialogClose = ( type: string | undefined, event: SyntheticEvent ) => {\n\t\t\t// Ideally the popover should have just a single onClose prop and\n\t\t\t// not three props that potentially do the same thing.\n\t\t\tif ( type === 'focus-outside' && onFocusOutside ) {\n\t\t\t\tonFocusOutside( event );\n\t\t\t} else if ( onClose ) {\n\t\t\t\tonClose();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst [ dialogRef, dialogProps ] = useDialog( {\n\t\tconstrainTabbing,\n\t\tfocusOnMount,\n\t\t__unstableOnClose: onDialogClose,\n\t\t// @ts-expect-error The __unstableOnClose property needs to be deprecated first (see https://github.com/WordPress/gutenberg/pull/27675)\n\t\tonClose: onDialogClose,\n\t} );\n\n\tconst {\n\t\t// Positioning coordinates\n\t\tx,\n\t\ty,\n\t\t// Object with \"regular\" refs to both \"reference\" and \"floating\"\n\t\trefs,\n\t\t// Type of CSS position property to use (absolute or fixed)\n\t\tstrategy,\n\t\tupdate,\n\t\tplacement: computedPlacement,\n\t\tmiddlewareData: { arrow: arrowData },\n\t} = useFloating( {\n\t\tplacement:\n\t\t\tnormalizedPlacementFromProps === 'overlay'\n\t\t\t\t? undefined\n\t\t\t\t: normalizedPlacementFromProps,\n\t\tmiddleware,\n\t\twhileElementsMounted: ( referenceParam, floatingParam, updateParam ) =>\n\t\t\tautoUpdate( referenceParam, floatingParam, updateParam, {\n\t\t\t\tlayoutShift: false,\n\t\t\t\tanimationFrame: true,\n\t\t\t} ),\n\t} );\n\n\tconst arrowCallbackRef = useCallback(\n\t\t( node: HTMLElement | null ) => {\n\t\t\tarrowRef.current = node;\n\t\t\tupdate();\n\t\t},\n\t\t[ update ]\n\t);\n\n\t// When any of the possible anchor \"sources\" change,\n\t// recompute the reference element (real or virtual) and its owner document.\n\n\tconst anchorRefTop = ( anchorRef as PopoverAnchorRefTopBottom | undefined )\n\t\t?.top;\n\tconst anchorRefBottom = (\n\t\tanchorRef as PopoverAnchorRefTopBottom | undefined\n\t )?.bottom;\n\tconst anchorRefStartContainer = ( anchorRef as Range | undefined )\n\t\t?.startContainer;\n\tconst anchorRefCurrent = ( anchorRef as PopoverAnchorRefReference )\n\t\t?.current;\n\n\tuseLayoutEffect( () => {\n\t\tconst resultingReferenceElement = getReferenceElement( {\n\t\t\tanchor,\n\t\t\tanchorRef,\n\t\t\tanchorRect,\n\t\t\tgetAnchorRect,\n\t\t\tfallbackReferenceElement,\n\t\t} );\n\n\t\trefs.setReference( resultingReferenceElement );\n\t}, [\n\t\tanchor,\n\t\tanchorRef,\n\t\tanchorRefTop,\n\t\tanchorRefBottom,\n\t\tanchorRefStartContainer,\n\t\tanchorRefCurrent,\n\t\tanchorRect,\n\t\tgetAnchorRect,\n\t\tfallbackReferenceElement,\n\t\trefs,\n\t] );\n\n\tconst mergedFloatingRef = useMergeRefs( [\n\t\trefs.setFloating,\n\t\tdialogRef,\n\t\tforwardedRef,\n\t] );\n\n\tconst style = isExpanded\n\t\t? undefined\n\t\t: {\n\t\t\t\tposition: strategy,\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\t// `x` and `y` are framer-motion specific props and are shorthands\n\t\t\t\t// for `translateX` and `translateY`. Currently it is not possible\n\t\t\t\t// to use `translateX` and `translateY` because those values would\n\t\t\t\t// be overridden by the return value of the\n\t\t\t\t// `placementToMotionAnimationProps` function.\n\t\t\t\tx: computePopoverPosition( x ),\n\t\t\t\ty: computePopoverPosition( y ),\n\t\t };\n\n\tconst shouldReduceMotion = useReducedMotion();\n\tconst shouldAnimate = animate && ! isExpanded && ! shouldReduceMotion;\n\n\tconst [ animationFinished, setAnimationFinished ] = useState( false );\n\n\tconst { style: motionInlineStyles, ...otherMotionProps } = useMemo(\n\t\t() => placementToMotionAnimationProps( computedPlacement ),\n\t\t[ computedPlacement ]\n\t);\n\n\tconst animationProps: HTMLMotionProps< 'div' > = shouldAnimate\n\t\t? {\n\t\t\t\tstyle: {\n\t\t\t\t\t...motionInlineStyles,\n\t\t\t\t\t...style,\n\t\t\t\t},\n\t\t\t\tonAnimationComplete: () => setAnimationFinished( true ),\n\t\t\t\t...otherMotionProps,\n\t\t }\n\t\t: {\n\t\t\t\tanimate: false,\n\t\t\t\tstyle,\n\t\t };\n\n\t// When Floating UI has finished positioning and Framer Motion has finished animating\n\t// the popover, add the `is-positioned` class to signal that all transitions have finished.\n\tconst isPositioned =\n\t\t( ! shouldAnimate || animationFinished ) && x !== null && y !== null;\n\n\tlet content = (\n\t\t<motion.div\n\t\t\tclassName={ clsx( className, {\n\t\t\t\t'is-expanded': isExpanded,\n\t\t\t\t'is-positioned': isPositioned,\n\t\t\t\t// Use the 'alternate' classname for 'toolbar' variant for back compat.\n\t\t\t\t[ `is-${\n\t\t\t\t\tcomputedVariant === 'toolbar'\n\t\t\t\t\t\t? 'alternate'\n\t\t\t\t\t\t: computedVariant\n\t\t\t\t}` ]: computedVariant,\n\t\t\t} ) }\n\t\t\t{ ...animationProps }\n\t\t\t{ ...contentProps }\n\t\t\tref={ mergedFloatingRef }\n\t\t\t{ ...dialogProps }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ /* Prevents scroll on the document */ }\n\t\t\t{ isExpanded && <ScrollLock /> }\n\t\t\t{ isExpanded && (\n\t\t\t\t<div className=\"components-popover__header\">\n\t\t\t\t\t<span className=\"components-popover__header-title\">\n\t\t\t\t\t\t{ headerTitle }\n\t\t\t\t\t</span>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"components-popover__close\"\n\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"components-popover__content\">{ children }</div>\n\t\t\t{ hasArrow && (\n\t\t\t\t<div\n\t\t\t\t\tref={ arrowCallbackRef }\n\t\t\t\t\tclassName={ [\n\t\t\t\t\t\t'components-popover__arrow',\n\t\t\t\t\t\t`is-${ computedPlacement.split( '-' )[ 0 ] }`,\n\t\t\t\t\t].join( ' ' ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tleft:\n\t\t\t\t\t\t\ttypeof arrowData?.x !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.x )\n\t\t\t\t\t\t\t\t? `${ arrowData.x }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t\ttop:\n\t\t\t\t\t\t\ttypeof arrowData?.y !== 'undefined' &&\n\t\t\t\t\t\t\tNumber.isFinite( arrowData.y )\n\t\t\t\t\t\t\t\t? `${ arrowData.y }px`\n\t\t\t\t\t\t\t\t: '',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<ArrowTriangle />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</motion.div>\n\t);\n\n\tconst shouldRenderWithinSlot = slot.ref && ! inline;\n\tconst hasAnchor = anchorRef || anchorRect || anchor;\n\n\tif ( shouldRenderWithinSlot ) {\n\t\tcontent = <Fill name={ slotName }>{ content }</Fill>;\n\t} else if ( ! inline ) {\n\t\tcontent = createPortal(\n\t\t\t<StyleProvider document={ document }>{ content }</StyleProvider>,\n\t\t\tgetPopoverFallbackContainer()\n\t\t);\n\t}\n\n\tif ( hasAnchor ) {\n\t\treturn content;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<span ref={ anchorRefFallback } />\n\t\t\t{ content }\n\t\t</>\n\t);\n};\n\n/**\n * `Popover` renders its content in a floating modal. If no explicit anchor is passed via props, it anchors to its parent element by default.\n *\n * ```jsx\n * import { Button, Popover } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyPopover = () => {\n * \tconst [ isVisible, setIsVisible ] = useState( false );\n * \tconst toggleVisible = () => {\n * \t\tsetIsVisible( ( state ) => ! state );\n * \t};\n *\n * \treturn (\n * \t\t<Button variant=\"secondary\" onClick={ toggleVisible }>\n * \t\t\tToggle Popover!\n * \t\t\t{ isVisible && <Popover>Popover is toggled!</Popover> }\n * \t\t</Button>\n * \t);\n * };\n * ```\n *\n */\nexport const Popover = contextConnect( UnforwardedPopover, 'Popover' );\n\nfunction PopoverSlot(\n\t{ name = SLOT_NAME }: { name?: string },\n\tref: ForwardedRef< any >\n) {\n\treturn (\n\t\t<Slot\n\t\t\tbubblesVirtually\n\t\t\tname={ name }\n\t\t\tclassName=\"popover-slot\"\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\n// @ts-expect-error For Legacy Reasons\nPopover.Slot = forwardRef( PopoverSlot );\n// @ts-expect-error For Legacy Reasons\nPopover.__unstableSlotNameProvider = slotNameContext.Provider;\n\nexport default Popover;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;AACvB,SACCC,WAAW,EACXC,IAAI,IAAIC,cAAc,EACtBC,KAAK,IAAIC,eAAe,EACxBC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,MAAM,IAAIC,gBAAgB,EAC1BC,IAAI,QACE,wBAAwB;AAE/B,SAASC,MAAM,QAAQ,eAAe;;AAEtC;AACA;AACA;AACA,SACCC,MAAM,EACNC,eAAe,EACfC,UAAU,EACVC,aAAa,EACbC,UAAU,EACVC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,YAAY,QACN,oBAAoB;AAC3B,SACCC,gBAAgB,EAChBC,gBAAgB,EAChBC,YAAY,EACZC,uBAAuB,IAAIC,SAAS,QAC9B,oBAAoB;AAC3B,SAASC,KAAK,QAAQ,kBAAkB;AACxC,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,IAAI,EAAEC,GAAG,QAAQ,uBAAuB;;AAEjD;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,UAAU,MAAM,gBAAgB;AACvC,SAASC,IAAI,EAAEC,IAAI,EAAEC,OAAO,QAAQ,cAAc;AAClD,SACCC,sBAAsB,EACtBC,mBAAmB,EACnBC,+BAA+B,EAC/BC,mBAAmB,QACb,SAAS;AAChB,SAASC,cAAc,EA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1
  /**
2
2
  * External dependencies
3
3
  */
4
- // eslint-disable-next-line no-restricted-imports
5
4
 
6
5
  /**
7
6
  * Internal dependencies