@wordpress/components 28.1.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 (451) hide show
  1. package/CHANGELOG.md +179 -120
  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 +58 -36
  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 +33 -15
  23. package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
  24. package/build/custom-select-control-v2/styles.js +92 -65
  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/drop-zone/index.js +16 -79
  44. package/build/drop-zone/index.js.map +1 -1
  45. package/build/dropdown-menu/index.js +1 -0
  46. package/build/dropdown-menu/index.js.map +1 -1
  47. package/build/dropdown-menu-v2/index.js +0 -1
  48. package/build/dropdown-menu-v2/index.js.map +1 -1
  49. package/build/dropdown-menu-v2/styles.js +15 -16
  50. package/build/dropdown-menu-v2/styles.js.map +1 -1
  51. package/build/dropdown-menu-v2/types.js.map +1 -1
  52. package/build/font-size-picker/font-size-picker-select.js +2 -2
  53. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  54. package/build/font-size-picker/index.js +1 -1
  55. package/build/font-size-picker/index.js.map +1 -1
  56. package/build/font-size-picker/utils.js +0 -4
  57. package/build/font-size-picker/utils.js.map +1 -1
  58. package/build/form-token-field/token.js +4 -1
  59. package/build/form-token-field/token.js.map +1 -1
  60. package/build/higher-order/with-spoken-messages/index.js +1 -2
  61. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  62. package/build/lock-unlock.js +1 -1
  63. package/build/lock-unlock.js.map +1 -1
  64. package/build/menu-items-choice/types.js.map +1 -1
  65. package/build/palette-edit/index.js +30 -38
  66. package/build/palette-edit/index.js.map +1 -1
  67. package/build/palette-edit/types.js.map +1 -1
  68. package/build/popover/index.js +0 -4
  69. package/build/popover/index.js.map +1 -1
  70. package/build/popover/utils.js +0 -1
  71. package/build/popover/utils.js.map +1 -1
  72. package/build/private-apis.js +2 -4
  73. package/build/private-apis.js.map +1 -1
  74. package/build/progress-bar/styles.js +19 -13
  75. package/build/progress-bar/styles.js.map +1 -1
  76. package/build/radio-group/context.js +0 -1
  77. package/build/radio-group/context.js.map +1 -1
  78. package/build/radio-group/index.js +0 -1
  79. package/build/radio-group/index.js.map +1 -1
  80. package/build/radio-group/radio.js +0 -1
  81. package/build/radio-group/radio.js.map +1 -1
  82. package/build/range-control/index.js +4 -1
  83. package/build/range-control/index.js.map +1 -1
  84. package/build/range-control/styles/range-control-styles.js +34 -28
  85. package/build/range-control/styles/range-control-styles.js.map +1 -1
  86. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  87. package/build/select-control/index.js +1 -2
  88. package/build/select-control/index.js.map +1 -1
  89. package/build/select-control/styles/select-control-styles.js +13 -8
  90. package/build/select-control/styles/select-control-styles.js.map +1 -1
  91. package/build/tab-panel/index.js +0 -1
  92. package/build/tab-panel/index.js.map +1 -1
  93. package/build/tabs/index.js +0 -1
  94. package/build/tabs/index.js.map +1 -1
  95. package/build/tabs/styles.js +3 -5
  96. package/build/tabs/styles.js.map +1 -1
  97. package/build/tabs/tablist.js +148 -37
  98. package/build/tabs/tablist.js.map +1 -1
  99. package/build/tabs/types.js.map +1 -1
  100. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +0 -2
  101. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  102. package/build/toggle-group-control/toggle-group-control/component.js +0 -2
  103. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  104. package/build/toggle-group-control/toggle-group-control-option-base/component.js +0 -4
  105. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  106. package/build/toolbar/toolbar/toolbar-container.js +0 -1
  107. package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
  108. package/build/toolbar/toolbar/types.js.map +1 -1
  109. package/build/toolbar/toolbar-button/index.js +27 -19
  110. package/build/toolbar/toolbar-button/index.js.map +1 -1
  111. package/build/toolbar/toolbar-button/types.js.map +1 -1
  112. package/build/toolbar/toolbar-context/index.js +0 -1
  113. package/build/toolbar/toolbar-context/index.js.map +1 -1
  114. package/build/toolbar/toolbar-item/index.js +1 -1
  115. package/build/toolbar/toolbar-item/index.js.map +1 -1
  116. package/build/tooltip/index.js +3 -2
  117. package/build/tooltip/index.js.map +1 -1
  118. package/build/tooltip/types.js.map +1 -1
  119. package/build/unit-control/index.js +3 -3
  120. package/build/unit-control/index.js.map +1 -1
  121. package/build/unit-control/styles/unit-control-styles.js +7 -7
  122. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  123. package/build/utils/hooks/use-update-effect.js +4 -1
  124. package/build/utils/hooks/use-update-effect.js.map +1 -1
  125. package/build-module/animation/index.js +0 -1
  126. package/build-module/animation/index.js.map +1 -1
  127. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  128. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  129. package/build-module/autocomplete/index.js.map +1 -1
  130. package/build-module/base-control/index.js +13 -6
  131. package/build-module/base-control/index.js.map +1 -1
  132. package/build-module/border-box-control/border-box-control-visualizer/component.js +0 -4
  133. package/build-module/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  134. package/build-module/button/index.js +5 -3
  135. package/build-module/button/index.js.map +1 -1
  136. package/build-module/button/types.js.map +1 -1
  137. package/build-module/combobox-control/index.js +4 -1
  138. package/build-module/combobox-control/index.js.map +1 -1
  139. package/build-module/composite/current/index.js +0 -3
  140. package/build-module/composite/current/index.js.map +1 -1
  141. package/build-module/custom-select-control-v2/custom-select.js +59 -38
  142. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  143. package/build-module/custom-select-control-v2/default-component/index.js +0 -1
  144. package/build-module/custom-select-control-v2/default-component/index.js.map +1 -1
  145. package/build-module/custom-select-control-v2/item.js +2 -0
  146. package/build-module/custom-select-control-v2/item.js.map +1 -1
  147. package/build-module/custom-select-control-v2/legacy-component/index.js +33 -16
  148. package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
  149. package/build-module/custom-select-control-v2/styles.js +90 -63
  150. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  151. package/build-module/custom-select-control-v2/types.js.map +1 -1
  152. package/build-module/date-time/date-time/index.js +4 -1
  153. package/build-module/date-time/date-time/index.js.map +1 -1
  154. package/build-module/date-time/index.js +2 -1
  155. package/build-module/date-time/index.js.map +1 -1
  156. package/build-module/date-time/time/index.js +65 -149
  157. package/build-module/date-time/time/index.js.map +1 -1
  158. package/build-module/date-time/time-input/index.js +151 -0
  159. package/build-module/date-time/time-input/index.js.map +1 -0
  160. package/build-module/date-time/types.js.map +1 -1
  161. package/build-module/date-time/utils.js +61 -0
  162. package/build-module/date-time/utils.js.map +1 -1
  163. package/build-module/disclosure/index.js +0 -1
  164. package/build-module/disclosure/index.js.map +1 -1
  165. package/build-module/divider/component.js +0 -1
  166. package/build-module/divider/component.js.map +1 -1
  167. package/build-module/divider/types.js.map +1 -1
  168. package/build-module/drop-zone/index.js +17 -80
  169. package/build-module/drop-zone/index.js.map +1 -1
  170. package/build-module/dropdown-menu/index.js +1 -0
  171. package/build-module/dropdown-menu/index.js.map +1 -1
  172. package/build-module/dropdown-menu-v2/index.js +0 -1
  173. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  174. package/build-module/dropdown-menu-v2/styles.js +14 -15
  175. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  176. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  177. package/build-module/font-size-picker/font-size-picker-select.js +1 -1
  178. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  179. package/build-module/font-size-picker/index.js +1 -1
  180. package/build-module/font-size-picker/index.js.map +1 -1
  181. package/build-module/font-size-picker/utils.js +0 -4
  182. package/build-module/font-size-picker/utils.js.map +1 -1
  183. package/build-module/form-token-field/token.js +4 -1
  184. package/build-module/form-token-field/token.js.map +1 -1
  185. package/build-module/higher-order/with-spoken-messages/index.js +1 -2
  186. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  187. package/build-module/lock-unlock.js +1 -1
  188. package/build-module/lock-unlock.js.map +1 -1
  189. package/build-module/menu-items-choice/types.js.map +1 -1
  190. package/build-module/palette-edit/index.js +31 -39
  191. package/build-module/palette-edit/index.js.map +1 -1
  192. package/build-module/palette-edit/types.js.map +1 -1
  193. package/build-module/popover/index.js +0 -3
  194. package/build-module/popover/index.js.map +1 -1
  195. package/build-module/popover/utils.js +0 -1
  196. package/build-module/popover/utils.js.map +1 -1
  197. package/build-module/private-apis.js +2 -4
  198. package/build-module/private-apis.js.map +1 -1
  199. package/build-module/progress-bar/styles.js +21 -13
  200. package/build-module/progress-bar/styles.js.map +1 -1
  201. package/build-module/radio-group/context.js +0 -1
  202. package/build-module/radio-group/context.js.map +1 -1
  203. package/build-module/radio-group/index.js +0 -1
  204. package/build-module/radio-group/index.js.map +1 -1
  205. package/build-module/radio-group/radio.js +0 -1
  206. package/build-module/radio-group/radio.js.map +1 -1
  207. package/build-module/range-control/index.js +4 -1
  208. package/build-module/range-control/index.js.map +1 -1
  209. package/build-module/range-control/styles/range-control-styles.js +34 -28
  210. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  211. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  212. package/build-module/select-control/index.js +2 -3
  213. package/build-module/select-control/index.js.map +1 -1
  214. package/build-module/select-control/styles/select-control-styles.js +12 -7
  215. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  216. package/build-module/tab-panel/index.js +0 -1
  217. package/build-module/tab-panel/index.js.map +1 -1
  218. package/build-module/tabs/index.js +0 -1
  219. package/build-module/tabs/index.js.map +1 -1
  220. package/build-module/tabs/styles.js +3 -4
  221. package/build-module/tabs/styles.js.map +1 -1
  222. package/build-module/tabs/tablist.js +149 -38
  223. package/build-module/tabs/tablist.js.map +1 -1
  224. package/build-module/tabs/types.js.map +1 -1
  225. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +0 -1
  226. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  227. package/build-module/toggle-group-control/toggle-group-control/component.js +0 -1
  228. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  229. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +0 -2
  230. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  231. package/build-module/toolbar/toolbar/toolbar-container.js +0 -1
  232. package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
  233. package/build-module/toolbar/toolbar/types.js.map +1 -1
  234. package/build-module/toolbar/toolbar-button/index.js +27 -19
  235. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  236. package/build-module/toolbar/toolbar-button/types.js.map +1 -1
  237. package/build-module/toolbar/toolbar-context/index.js +0 -1
  238. package/build-module/toolbar/toolbar-context/index.js.map +1 -1
  239. package/build-module/toolbar/toolbar-item/index.js +1 -1
  240. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  241. package/build-module/tooltip/index.js +3 -2
  242. package/build-module/tooltip/index.js.map +1 -1
  243. package/build-module/tooltip/types.js.map +1 -1
  244. package/build-module/unit-control/index.js +3 -3
  245. package/build-module/unit-control/index.js.map +1 -1
  246. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  247. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  248. package/build-module/utils/hooks/use-update-effect.js +4 -1
  249. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  250. package/build-style/style-rtl.css +46 -6
  251. package/build-style/style.css +46 -6
  252. package/build-types/animation/index.d.ts.map +1 -1
  253. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  254. package/build-types/autocomplete/index.d.ts.map +1 -1
  255. package/build-types/base-control/index.d.ts +6 -20
  256. package/build-types/base-control/index.d.ts.map +1 -1
  257. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  258. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
  259. package/build-types/button/deprecated.d.ts +4 -4
  260. package/build-types/button/index.d.ts.map +1 -1
  261. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  262. package/build-types/button/types.d.ts +27 -10
  263. package/build-types/button/types.d.ts.map +1 -1
  264. package/build-types/combobox-control/index.d.ts.map +1 -1
  265. package/build-types/composite/current/index.d.ts.map +1 -1
  266. package/build-types/custom-select-control/stories/index.story.d.ts +15 -0
  267. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  268. package/build-types/custom-select-control-v2/custom-select.d.ts +2 -2
  269. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  270. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
  271. package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
  272. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  273. package/build-types/custom-select-control-v2/stories/default.story.d.ts +6 -3
  274. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
  275. package/build-types/custom-select-control-v2/styles.d.ts +18 -22
  276. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  277. package/build-types/custom-select-control-v2/types.d.ts +13 -2
  278. package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
  279. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  280. package/build-types/date-time/index.d.ts +2 -1
  281. package/build-types/date-time/index.d.ts.map +1 -1
  282. package/build-types/date-time/stories/time-input.story.d.ts +12 -0
  283. package/build-types/date-time/stories/time-input.story.d.ts.map +1 -0
  284. package/build-types/date-time/time/index.d.ts +1 -1
  285. package/build-types/date-time/time/index.d.ts.map +1 -1
  286. package/build-types/date-time/time-input/index.d.ts +5 -0
  287. package/build-types/date-time/time-input/index.d.ts.map +1 -0
  288. package/build-types/date-time/time-input/test/index.d.ts +2 -0
  289. package/build-types/date-time/time-input/test/index.d.ts.map +1 -0
  290. package/build-types/date-time/types.d.ts +54 -0
  291. package/build-types/date-time/types.d.ts.map +1 -1
  292. package/build-types/date-time/utils.d.ts +40 -0
  293. package/build-types/date-time/utils.d.ts.map +1 -1
  294. package/build-types/disclosure/index.d.ts.map +1 -1
  295. package/build-types/divider/component.d.ts.map +1 -1
  296. package/build-types/divider/types.d.ts.map +1 -1
  297. package/build-types/drop-zone/index.d.ts +3 -0
  298. package/build-types/drop-zone/index.d.ts.map +1 -1
  299. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  300. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  301. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  302. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  303. package/build-types/font-size-picker/styles.d.ts +1 -1
  304. package/build-types/font-size-picker/utils.d.ts.map +1 -1
  305. package/build-types/form-token-field/token.d.ts.map +1 -1
  306. package/build-types/higher-order/with-spoken-messages/index.d.ts +1 -2
  307. package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
  308. package/build-types/menu-items-choice/types.d.ts +1 -1
  309. package/build-types/menu-items-choice/types.d.ts.map +1 -1
  310. package/build-types/navigator/navigator-back-button/component.d.ts +1 -1
  311. package/build-types/navigator/navigator-back-button/hook.d.ts +1 -1
  312. package/build-types/navigator/navigator-button/component.d.ts +1 -1
  313. package/build-types/navigator/navigator-button/hook.d.ts +1 -1
  314. package/build-types/navigator/navigator-to-parent-button/component.d.ts +1 -1
  315. package/build-types/palette-edit/index.d.ts.map +1 -1
  316. package/build-types/palette-edit/types.d.ts +1 -3
  317. package/build-types/palette-edit/types.d.ts.map +1 -1
  318. package/build-types/popover/index.d.ts.map +1 -1
  319. package/build-types/popover/utils.d.ts.map +1 -1
  320. package/build-types/private-apis.d.ts.map +1 -1
  321. package/build-types/progress-bar/styles.d.ts.map +1 -1
  322. package/build-types/radio-group/context.d.ts.map +1 -1
  323. package/build-types/radio-group/index.d.ts.map +1 -1
  324. package/build-types/radio-group/radio.d.ts.map +1 -1
  325. package/build-types/range-control/index.d.ts.map +1 -1
  326. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  327. package/build-types/resizable-box/resize-tooltip/utils.d.ts +2 -2
  328. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  329. package/build-types/select-control/index.d.ts.map +1 -1
  330. package/build-types/select-control/styles/select-control-styles.d.ts +5 -0
  331. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  332. package/build-types/tab-panel/index.d.ts.map +1 -1
  333. package/build-types/tabs/index.d.ts.map +1 -1
  334. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  335. package/build-types/tabs/styles.d.ts.map +1 -1
  336. package/build-types/tabs/tablist.d.ts.map +1 -1
  337. package/build-types/tabs/types.d.ts.map +1 -1
  338. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  339. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  340. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  341. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  342. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  343. package/build-types/toolbar/toolbar/types.d.ts +6 -0
  344. package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
  345. package/build-types/toolbar/toolbar-button/index.d.ts +3 -96
  346. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  347. package/build-types/toolbar/toolbar-button/types.d.ts +18 -0
  348. package/build-types/toolbar/toolbar-button/types.d.ts.map +1 -1
  349. package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
  350. package/build-types/toolbar/toolbar-item/index.d.ts +1 -3
  351. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  352. package/build-types/tooltip/index.d.ts.map +1 -1
  353. package/build-types/tooltip/types.d.ts +4 -0
  354. package/build-types/tooltip/types.d.ts.map +1 -1
  355. package/build-types/unit-control/index.d.ts.map +1 -1
  356. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  357. package/build-types/utils/hooks/use-update-effect.d.ts +1 -1
  358. package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
  359. package/package.json +19 -19
  360. package/src/animation/index.tsx +0 -1
  361. package/src/autocomplete/autocompleter-ui.tsx +1 -0
  362. package/src/autocomplete/index.tsx +0 -1
  363. package/src/base-control/index.tsx +16 -6
  364. package/src/base-control/stories/index.story.tsx +0 -1
  365. package/src/border-box-control/border-box-control-visualizer/component.tsx +0 -5
  366. package/src/button/README.md +13 -0
  367. package/src/button/index.tsx +6 -4
  368. package/src/button/stories/e2e/index.story.tsx +2 -1
  369. package/src/button/test/index.tsx +17 -2
  370. package/src/button/types.ts +27 -10
  371. package/src/combobox-control/index.tsx +2 -0
  372. package/src/composite/current/index.ts +0 -2
  373. package/src/custom-select-control/stories/index.story.tsx +32 -3
  374. package/src/custom-select-control/test/index.js +247 -28
  375. package/src/custom-select-control-v2/custom-select.tsx +58 -23
  376. package/src/custom-select-control-v2/default-component/index.tsx +0 -1
  377. package/src/custom-select-control-v2/item.tsx +5 -1
  378. package/src/custom-select-control-v2/legacy-component/index.tsx +45 -16
  379. package/src/custom-select-control-v2/legacy-component/test/index.tsx +261 -43
  380. package/src/custom-select-control-v2/styles.ts +156 -74
  381. package/src/custom-select-control-v2/test/index.tsx +35 -5
  382. package/src/custom-select-control-v2/types.ts +19 -6
  383. package/src/date-time/README.md +8 -0
  384. package/src/date-time/date-time/index.tsx +2 -1
  385. package/src/date-time/index.ts +2 -1
  386. package/src/date-time/stories/time-input.story.tsx +36 -0
  387. package/src/date-time/time/index.tsx +77 -194
  388. package/src/date-time/time/test/index.tsx +61 -0
  389. package/src/date-time/time-input/index.tsx +196 -0
  390. package/src/date-time/time-input/test/index.tsx +171 -0
  391. package/src/date-time/types.ts +63 -0
  392. package/src/date-time/utils.ts +69 -0
  393. package/src/dimension-control/test/__snapshots__/index.test.js.snap +116 -96
  394. package/src/disclosure/index.tsx +0 -1
  395. package/src/divider/component.tsx +0 -1
  396. package/src/divider/types.ts +0 -1
  397. package/src/drop-zone/index.tsx +17 -76
  398. package/src/drop-zone/style.scss +51 -16
  399. package/src/dropdown-menu/index.tsx +1 -0
  400. package/src/dropdown-menu-v2/index.tsx +0 -1
  401. package/src/dropdown-menu-v2/styles.ts +0 -1
  402. package/src/dropdown-menu-v2/types.ts +0 -1
  403. package/src/font-size-picker/font-size-picker-select.tsx +1 -1
  404. package/src/font-size-picker/index.tsx +1 -1
  405. package/src/font-size-picker/test/index.tsx +6 -6
  406. package/src/font-size-picker/utils.ts +0 -5
  407. package/src/form-token-field/token.tsx +2 -0
  408. package/src/higher-order/navigate-regions/style.scss +25 -13
  409. package/src/higher-order/with-spoken-messages/index.tsx +1 -2
  410. package/src/lock-unlock.js +1 -1
  411. package/src/menu-items-choice/types.ts +2 -1
  412. package/src/palette-edit/index.tsx +33 -45
  413. package/src/palette-edit/test/index.tsx +3 -4
  414. package/src/palette-edit/types.ts +1 -3
  415. package/src/popover/index.tsx +0 -2
  416. package/src/popover/utils.ts +0 -1
  417. package/src/private-apis.ts +2 -5
  418. package/src/progress-bar/styles.ts +18 -9
  419. package/src/radio-group/context.tsx +0 -1
  420. package/src/radio-group/index.tsx +0 -1
  421. package/src/radio-group/radio.tsx +0 -1
  422. package/src/range-control/index.tsx +2 -0
  423. package/src/range-control/styles/range-control-styles.ts +6 -2
  424. package/src/resizable-box/resize-tooltip/utils.ts +1 -1
  425. package/src/select-control/index.tsx +3 -4
  426. package/src/select-control/styles/select-control-styles.ts +17 -6
  427. package/src/tab-panel/index.tsx +0 -1
  428. package/src/tabs/index.tsx +0 -1
  429. package/src/tabs/stories/index.story.tsx +25 -18
  430. package/src/tabs/styles.ts +18 -14
  431. package/src/tabs/tablist.tsx +187 -43
  432. package/src/tabs/types.ts +0 -1
  433. package/src/theme/stories/index.story.tsx +2 -0
  434. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +0 -1
  435. package/src/toggle-group-control/toggle-group-control/component.tsx +0 -2
  436. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +0 -2
  437. package/src/toolbar/toolbar/README.md +9 -0
  438. package/src/toolbar/toolbar/style.scss +7 -0
  439. package/src/toolbar/toolbar/toolbar-container.tsx +0 -1
  440. package/src/toolbar/toolbar/types.ts +6 -0
  441. package/src/toolbar/toolbar-button/index.tsx +30 -17
  442. package/src/toolbar/toolbar-button/types.ts +19 -0
  443. package/src/toolbar/toolbar-context/index.ts +0 -1
  444. package/src/toolbar/toolbar-item/index.tsx +1 -1
  445. package/src/tooltip/index.tsx +3 -2
  446. package/src/tooltip/test/index.tsx +18 -0
  447. package/src/tooltip/types.ts +4 -0
  448. package/src/unit-control/index.tsx +3 -2
  449. package/src/unit-control/styles/unit-control-styles.ts +10 -4
  450. package/src/utils/hooks/use-update-effect.js +8 -1
  451. package/tsconfig.tsbuildinfo +1 -1
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- // eslint-disable-next-line no-restricted-imports
5
4
  import * as Ariakit from '@ariakit/react';
6
5
  /**
7
6
  * WordPress dependencies
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","forwardRef","isRTL","ToolbarContext","jsx","_jsx","UnforwardedToolbarContainer","label","props","ref","toolbarStore","useToolbarStore","focusLoop","rtl","Provider","value","children","Toolbar","store","ToolbarContainer"],"sources":["@wordpress/components/src/toolbar/toolbar/toolbar-container.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ToolbarContext from '../toolbar-context';\nimport type { ToolbarProps } from './types';\nimport type { WordPressComponentProps } from '../../context';\n\nfunction UnforwardedToolbarContainer(\n\t{ label, ...props }: WordPressComponentProps< ToolbarProps, 'div', false >,\n\tref: ForwardedRef< any >\n) {\n\tconst toolbarStore = Ariakit.useToolbarStore( {\n\t\tfocusLoop: true,\n\t\trtl: isRTL(),\n\t} );\n\n\treturn (\n\t\t// This will provide state for `ToolbarButton`'s\n\t\t<ToolbarContext.Provider value={ toolbarStore }>\n\t\t\t<Ariakit.Toolbar\n\t\t\t\tref={ ref }\n\t\t\t\taria-label={ label }\n\t\t\t\tstore={ toolbarStore }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t</ToolbarContext.Provider>\n\t);\n}\n\nexport const ToolbarContainer = forwardRef( UnforwardedToolbarContainer );\nexport default ToolbarContainer;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AAGzC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIhD,SAASC,2BAA2BA,CACnC;EAAEC,KAAK;EAAE,GAAGC;AAA6D,CAAC,EAC1EC,GAAwB,EACvB;EACD,MAAMC,YAAY,GAAGV,OAAO,CAACW,eAAe,CAAE;IAC7CC,SAAS,EAAE,IAAI;IACfC,GAAG,EAAEX,KAAK,CAAC;EACZ,CAAE,CAAC;EAEH;IAAA;IACC;IACAG,IAAA,CAACF,cAAc,CAACW,QAAQ;MAACC,KAAK,EAAGL,YAAc;MAAAM,QAAA,eAC9CX,IAAA,CAACL,OAAO,CAACiB,OAAO;QACfR,GAAG,EAAGA,GAAK;QACX,cAAaF,KAAO;QACpBW,KAAK,EAAGR,YAAc;QAAA,GACjBF;MAAK,CACV;IAAC,CACsB;EAAC;AAE5B;AAEA,OAAO,MAAMW,gBAAgB,GAAGlB,UAAU,CAAEK,2BAA4B,CAAC;AACzE,eAAea,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","forwardRef","isRTL","ToolbarContext","jsx","_jsx","UnforwardedToolbarContainer","label","props","ref","toolbarStore","useToolbarStore","focusLoop","rtl","Provider","value","children","Toolbar","store","ToolbarContainer"],"sources":["@wordpress/components/src/toolbar/toolbar/toolbar-container.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ToolbarContext from '../toolbar-context';\nimport type { ToolbarProps } from './types';\nimport type { WordPressComponentProps } from '../../context';\n\nfunction UnforwardedToolbarContainer(\n\t{ label, ...props }: WordPressComponentProps< ToolbarProps, 'div', false >,\n\tref: ForwardedRef< any >\n) {\n\tconst toolbarStore = Ariakit.useToolbarStore( {\n\t\tfocusLoop: true,\n\t\trtl: isRTL(),\n\t} );\n\n\treturn (\n\t\t// This will provide state for `ToolbarButton`'s\n\t\t<ToolbarContext.Provider value={ toolbarStore }>\n\t\t\t<Ariakit.Toolbar\n\t\t\t\tref={ ref }\n\t\t\t\taria-label={ label }\n\t\t\t\tstore={ toolbarStore }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t</ToolbarContext.Provider>\n\t);\n}\n\nexport const ToolbarContainer = forwardRef( UnforwardedToolbarContainer );\nexport default ToolbarContainer;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AAGzC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIhD,SAASC,2BAA2BA,CACnC;EAAEC,KAAK;EAAE,GAAGC;AAA6D,CAAC,EAC1EC,GAAwB,EACvB;EACD,MAAMC,YAAY,GAAGV,OAAO,CAACW,eAAe,CAAE;IAC7CC,SAAS,EAAE,IAAI;IACfC,GAAG,EAAEX,KAAK,CAAC;EACZ,CAAE,CAAC;EAEH;IAAA;IACC;IACAG,IAAA,CAACF,cAAc,CAACW,QAAQ;MAACC,KAAK,EAAGL,YAAc;MAAAM,QAAA,eAC9CX,IAAA,CAACL,OAAO,CAACiB,OAAO;QACfR,GAAG,EAAGA,GAAK;QACX,cAAaF,KAAO;QACpBW,KAAK,EAAGR,YAAc;QAAA,GACjBF;MAAK,CACV;IAAC,CACsB;EAAC;AAE5B;AAEA,OAAO,MAAMW,gBAAgB,GAAGlB,UAAU,CAAEK,2BAA4B,CAAC;AACzE,eAAea,gBAAgB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/toolbar/toolbar/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type ToolbarProps = {\n\t/**\n\t * Children to be rendered inside the toolbar.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An accessible label for the toolbar.\n\t */\n\tlabel: string;\n\t/**\n\t * Specifies the toolbar's style.\n\t *\n\t * Leave undefined for the default style. Or `'unstyled'` which\n\t * removes the border from the toolbar, but keeps the default\n\t * popover style.\n\t *\n\t * @default undefined\n\t */\n\tvariant?: 'unstyled' | undefined;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/toolbar/toolbar/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type ToolbarProps = {\n\t/**\n\t * Children to be rendered inside the toolbar.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An accessible label for the toolbar.\n\t */\n\tlabel: string;\n\t/**\n\t * Specifies the toolbar's style.\n\t *\n\t * Leave undefined for the default style. Or `'unstyled'` which\n\t * removes the border from the toolbar, but keeps the default\n\t * popover style.\n\t *\n\t * @default undefined\n\t */\n\tvariant?: 'unstyled' | undefined;\n\t/**\n\t * Orientation of the toolbar keyboard interactions.\n\t *\n\t * @default 'horizontal'\n\t */\n\torientation?: 'horizontal' | 'vertical';\n};\n"],"mappings":"","ignoreList":[]}
@@ -15,39 +15,48 @@ import ToolbarItem from '../toolbar-item';
15
15
  import ToolbarContext from '../toolbar-context';
16
16
  import ToolbarButtonContainer from './toolbar-button-container';
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
- function UnforwardedToolbarButton({
19
- children,
20
- className,
21
- containerClassName,
22
- extraProps,
23
- isActive,
18
+ function useDeprecatedProps({
24
19
  isDisabled,
25
- title,
26
- ...props
27
- }, ref) {
20
+ ...otherProps
21
+ }) {
22
+ return {
23
+ disabled: isDisabled,
24
+ ...otherProps
25
+ };
26
+ }
27
+ function UnforwardedToolbarButton(props, ref) {
28
+ const {
29
+ children,
30
+ className,
31
+ containerClassName,
32
+ extraProps,
33
+ isActive,
34
+ title,
35
+ ...restProps
36
+ } = useDeprecatedProps(props);
28
37
  const accessibleToolbarState = useContext(ToolbarContext);
29
38
  if (!accessibleToolbarState) {
30
39
  return /*#__PURE__*/_jsx(ToolbarButtonContainer, {
31
40
  className: containerClassName,
32
41
  children: /*#__PURE__*/_jsx(Button, {
33
42
  ref: ref,
34
- icon: props.icon,
43
+ icon: restProps.icon,
35
44
  label: title,
36
- shortcut: props.shortcut,
37
- "data-subscript": props.subscript,
45
+ shortcut: restProps.shortcut,
46
+ "data-subscript": restProps.subscript,
38
47
  onClick: event => {
39
48
  event.stopPropagation();
40
- // TODO: Possible bug; maybe use onClick instead of props.onClick.
41
- if (props.onClick) {
42
- props.onClick(event);
49
+ // TODO: Possible bug; maybe use onClick instead of restProps.onClick.
50
+ if (restProps.onClick) {
51
+ restProps.onClick(event);
43
52
  }
44
53
  },
45
54
  className: clsx('components-toolbar__control', className),
46
55
  isPressed: isActive,
47
- disabled: isDisabled,
56
+ accessibleWhenDisabled: true,
48
57
  "data-toolbar-item": true,
49
58
  ...extraProps,
50
- ...props,
59
+ ...restProps,
51
60
  children: children
52
61
  })
53
62
  });
@@ -59,12 +68,11 @@ function UnforwardedToolbarButton({
59
68
  return /*#__PURE__*/_jsx(ToolbarItem, {
60
69
  className: clsx('components-toolbar-button', className),
61
70
  ...extraProps,
62
- ...props,
71
+ ...restProps,
63
72
  ref: ref,
64
73
  children: toolbarItemProps => /*#__PURE__*/_jsx(Button, {
65
74
  label: title,
66
75
  isPressed: isActive,
67
- disabled: isDisabled,
68
76
  ...toolbarItemProps,
69
77
  children: children
70
78
  })
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useContext","forwardRef","Button","ToolbarItem","ToolbarContext","ToolbarButtonContainer","jsx","_jsx","UnforwardedToolbarButton","children","className","containerClassName","extraProps","isActive","isDisabled","title","props","ref","accessibleToolbarState","icon","label","shortcut","subscript","onClick","event","stopPropagation","isPressed","disabled","toolbarItemProps","ToolbarButton"],"sources":["@wordpress/components/src/toolbar/toolbar-button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef, MouseEvent as ReactMouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport ToolbarItem from '../toolbar-item';\nimport ToolbarContext from '../toolbar-context';\nimport ToolbarButtonContainer from './toolbar-button-container';\nimport type { ToolbarButtonProps } from './types';\nimport type { WordPressComponentProps } from '../../context';\n\nfunction UnforwardedToolbarButton(\n\t{\n\t\tchildren,\n\t\tclassName,\n\t\tcontainerClassName,\n\t\textraProps,\n\t\tisActive,\n\t\tisDisabled,\n\t\ttitle,\n\t\t...props\n\t}: WordPressComponentProps< ToolbarButtonProps, typeof Button, false >,\n\tref: ForwardedRef< any >\n) {\n\tconst accessibleToolbarState = useContext( ToolbarContext );\n\n\tif ( ! accessibleToolbarState ) {\n\t\treturn (\n\t\t\t<ToolbarButtonContainer className={ containerClassName }>\n\t\t\t\t<Button\n\t\t\t\t\tref={ ref }\n\t\t\t\t\ticon={ props.icon }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tshortcut={ props.shortcut }\n\t\t\t\t\tdata-subscript={ props.subscript }\n\t\t\t\t\tonClick={ (\n\t\t\t\t\t\tevent: ReactMouseEvent<\n\t\t\t\t\t\t\tHTMLButtonElement & HTMLAnchorElement,\n\t\t\t\t\t\t\tMouseEvent\n\t\t\t\t\t\t>\n\t\t\t\t\t) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t// TODO: Possible bug; maybe use onClick instead of props.onClick.\n\t\t\t\t\t\tif ( props.onClick ) {\n\t\t\t\t\t\t\tprops.onClick( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-toolbar__control',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\tdata-toolbar-item\n\t\t\t\t\t{ ...extraProps }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</Button>\n\t\t\t</ToolbarButtonContainer>\n\t\t);\n\t}\n\n\t// ToobarItem will pass all props to the render prop child, which will pass\n\t// all props to Button. This means that ToolbarButton has the same API as\n\t// Button.\n\treturn (\n\t\t<ToolbarItem\n\t\t\tclassName={ clsx( 'components-toolbar-button', className ) }\n\t\t\t{ ...extraProps }\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ ( toolbarItemProps ) => (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\t{ ...toolbarItemProps }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</ToolbarItem>\n\t);\n}\n\n/**\n * ToolbarButton can be used to add actions to a toolbar, usually inside a Toolbar\n * or ToolbarGroup when used to create general interfaces.\n *\n * ```jsx\n * import { Toolbar, ToolbarButton } from '@wordpress/components';\n * import { edit } from '@wordpress/icons';\n *\n * function MyToolbar() {\n * return (\n *\t\t<Toolbar label=\"Options\">\n *\t\t\t<ToolbarButton\n *\t\t\t\ticon={ edit }\n *\t\t\t\tlabel=\"Edit\"\n *\t\t\t\tonClick={ () => alert( 'Editing' ) }\n *\t\t\t/>\n *\t\t</Toolbar>\n * );\n * }\n * ```\n */\nexport const ToolbarButton = forwardRef( UnforwardedToolbarButton );\nexport default ToolbarButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,sBAAsB,MAAM,4BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIhE,SAASC,wBAAwBA,CAChC;EACCC,QAAQ;EACRC,SAAS;EACTC,kBAAkB;EAClBC,UAAU;EACVC,QAAQ;EACRC,UAAU;EACVC,KAAK;EACL,GAAGC;AACiE,CAAC,EACtEC,GAAwB,EACvB;EACD,MAAMC,sBAAsB,GAAGlB,UAAU,CAAEI,cAAe,CAAC;EAE3D,IAAK,CAAEc,sBAAsB,EAAG;IAC/B,oBACCX,IAAA,CAACF,sBAAsB;MAACK,SAAS,EAAGC,kBAAoB;MAAAF,QAAA,eACvDF,IAAA,CAACL,MAAM;QACNe,GAAG,EAAGA,GAAK;QACXE,IAAI,EAAGH,KAAK,CAACG,IAAM;QACnBC,KAAK,EAAGL,KAAO;QACfM,QAAQ,EAAGL,KAAK,CAACK,QAAU;QAC3B,kBAAiBL,KAAK,CAACM,SAAW;QAClCC,OAAO,EACNC,KAGC,IACG;UACJA,KAAK,CAACC,eAAe,CAAC,CAAC;UACvB;UACA,IAAKT,KAAK,CAACO,OAAO,EAAG;YACpBP,KAAK,CAACO,OAAO,CAAEC,KAAM,CAAC;UACvB;QACD,CAAG;QACHd,SAAS,EAAGX,IAAI,CACf,6BAA6B,EAC7BW,SACD,CAAG;QACHgB,SAAS,EAAGb,QAAU;QACtBc,QAAQ,EAAGb,UAAY;QACvB,yBAAiB;QAAA,GACZF,UAAU;QAAA,GACVI,KAAK;QAAAP,QAAA,EAERA;MAAQ,CACH;IAAC,CACc,CAAC;EAE3B;;EAEA;EACA;EACA;EACA,oBACCF,IAAA,CAACJ,WAAW;IACXO,SAAS,EAAGX,IAAI,CAAE,2BAA2B,EAAEW,SAAU,CAAG;IAAA,GACvDE,UAAU;IAAA,GACVI,KAAK;IACVC,GAAG,EAAGA,GAAK;IAAAR,QAAA,EAEPmB,gBAAgB,iBACnBrB,IAAA,CAACL,MAAM;MACNkB,KAAK,EAAGL,KAAO;MACfW,SAAS,EAAGb,QAAU;MACtBc,QAAQ,EAAGb,UAAY;MAAA,GAClBc,gBAAgB;MAAAnB,QAAA,EAEnBA;IAAQ,CACH;EACR,CACW,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMoB,aAAa,GAAG5B,UAAU,CAAEO,wBAAyB,CAAC;AACnE,eAAeqB,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useContext","forwardRef","Button","ToolbarItem","ToolbarContext","ToolbarButtonContainer","jsx","_jsx","useDeprecatedProps","isDisabled","otherProps","disabled","UnforwardedToolbarButton","props","ref","children","className","containerClassName","extraProps","isActive","title","restProps","accessibleToolbarState","icon","label","shortcut","subscript","onClick","event","stopPropagation","isPressed","accessibleWhenDisabled","toolbarItemProps","ToolbarButton"],"sources":["@wordpress/components/src/toolbar/toolbar-button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef, MouseEvent as ReactMouseEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '../../button';\nimport ToolbarItem from '../toolbar-item';\nimport ToolbarContext from '../toolbar-context';\nimport ToolbarButtonContainer from './toolbar-button-container';\nimport type { ToolbarButtonOverriddenProps, ToolbarButtonProps } from './types';\nimport type { WordPressComponentProps } from '../../context';\n\nfunction useDeprecatedProps( {\n\tisDisabled,\n\t...otherProps\n}: React.ComponentProps< typeof ToolbarButton > ) {\n\treturn {\n\t\tdisabled: isDisabled,\n\t\t...otherProps,\n\t};\n}\n\nfunction UnforwardedToolbarButton(\n\tprops: Omit<\n\t\tWordPressComponentProps< ToolbarButtonProps, typeof Button, false >,\n\t\t'accessibleWhenDisabled' // By default, ToolbarButton will be focusable when disabled.\n\t> &\n\t\tToolbarButtonOverriddenProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tcontainerClassName,\n\t\textraProps,\n\t\tisActive,\n\t\ttitle,\n\t\t...restProps\n\t} = useDeprecatedProps( props );\n\tconst accessibleToolbarState = useContext( ToolbarContext );\n\n\tif ( ! accessibleToolbarState ) {\n\t\treturn (\n\t\t\t<ToolbarButtonContainer className={ containerClassName }>\n\t\t\t\t<Button\n\t\t\t\t\tref={ ref }\n\t\t\t\t\ticon={ restProps.icon }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tshortcut={ restProps.shortcut }\n\t\t\t\t\tdata-subscript={ restProps.subscript }\n\t\t\t\t\tonClick={ (\n\t\t\t\t\t\tevent: ReactMouseEvent<\n\t\t\t\t\t\t\tHTMLButtonElement & HTMLAnchorElement,\n\t\t\t\t\t\t\tMouseEvent\n\t\t\t\t\t\t>\n\t\t\t\t\t) => {\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t// TODO: Possible bug; maybe use onClick instead of restProps.onClick.\n\t\t\t\t\t\tif ( restProps.onClick ) {\n\t\t\t\t\t\t\trestProps.onClick( event );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-toolbar__control',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdata-toolbar-item\n\t\t\t\t\t{ ...extraProps }\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</Button>\n\t\t\t</ToolbarButtonContainer>\n\t\t);\n\t}\n\n\t// ToobarItem will pass all props to the render prop child, which will pass\n\t// all props to Button. This means that ToolbarButton has the same API as\n\t// Button.\n\treturn (\n\t\t<ToolbarItem\n\t\t\tclassName={ clsx( 'components-toolbar-button', className ) }\n\t\t\t{ ...extraProps }\n\t\t\t{ ...restProps }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ ( toolbarItemProps ) => (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tisPressed={ isActive }\n\t\t\t\t\t{ ...toolbarItemProps }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</ToolbarItem>\n\t);\n}\n\n/**\n * ToolbarButton can be used to add actions to a toolbar, usually inside a Toolbar\n * or ToolbarGroup when used to create general interfaces.\n *\n * ```jsx\n * import { Toolbar, ToolbarButton } from '@wordpress/components';\n * import { edit } from '@wordpress/icons';\n *\n * function MyToolbar() {\n * return (\n *\t\t<Toolbar label=\"Options\">\n *\t\t\t<ToolbarButton\n *\t\t\t\ticon={ edit }\n *\t\t\t\tlabel=\"Edit\"\n *\t\t\t\tonClick={ () => alert( 'Editing' ) }\n *\t\t\t/>\n *\t\t</Toolbar>\n * );\n * }\n * ```\n */\nexport const ToolbarButton = forwardRef( UnforwardedToolbarButton );\nexport default ToolbarButton;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;AACA,OAAOC,MAAM,MAAM,cAAc;AACjC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,sBAAsB,M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SAAU,CAAG;IAAA,GACvDE,UAAU;IAAA,GACVG,SAAS;IACdP,GAAG,EAAGA,GAAK;IAAAC,QAAA,EAEPiB,gBAAgB,iBACnBzB,IAAA,CAACL,MAAM;MACNsB,KAAK,EAAGJ,KAAO;MACfU,SAAS,EAAGX,QAAU;MAAA,GACjBa,gBAAgB;MAAAjB,QAAA,EAEnBA;IAAQ,CACH;EACR,CACW,CAAC;AAEhB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMkB,aAAa,GAAGhC,UAAU,CAAEW,wBAAyB,CAAC;AACnE,eAAeqB,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/toolbar/toolbar-button/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type ToolbarButtonProps = {\n\t/**\n\t * Children to be rendered inside the button.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An optional class name for the button container.\n\t */\n\tcontainerClassName?: string;\n\t/**\n\t * Additional props to be passed alongside props.\n\t */\n\textraProps?: any;\n\t/**\n\t * Indicates if the button is active.\n\t */\n\tisActive?: boolean;\n\t/**\n\t * Indicates if the button is disabled.\n\t */\n\tisDisabled?: boolean;\n\t/**\n\t * An optional subscript for the button.\n\t */\n\tsubscript?: string;\n\t/**\n\t * An optional title/label for the button.\n\t */\n\ttitle?: string;\n};\n\nexport type ToolbarButtonContainerProps = {\n\t/**\n\t * Children to be rendered inside the button container.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An optional class name for the button container.\n\t */\n\tclassName?: string;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/toolbar/toolbar-button/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type ToolbarButtonProps = {\n\t/**\n\t * Children to be rendered inside the button.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An optional class name for the button container.\n\t */\n\tcontainerClassName?: string;\n\t/**\n\t * Additional props to be passed alongside props.\n\t */\n\textraProps?: any;\n\t/**\n\t * Indicates if the button is active.\n\t */\n\tisActive?: boolean;\n\t/**\n\t * Indicates if the button is disabled.\n\t *\n\t * @deprecated Use `disabled` instead.\n\t * @ignore\n\t */\n\tisDisabled?: boolean;\n\t/**\n\t * An optional subscript for the button.\n\t */\n\tsubscript?: string;\n\t/**\n\t * An optional title/label for the button.\n\t */\n\ttitle?: string;\n};\n\nexport type ToolbarButtonOverriddenProps = {\n\t/**\n\t * Whether to keep the button focusable when disabled.\n\t *\n\t * In most cases, it is recommended to set this to `true`. Disabling a control without maintaining focusability\n\t * can cause accessibility issues, by hiding their presence from screen reader users,\n\t * or by preventing focus from returning to a trigger element.\n\t *\n\t * Learn more about the [focusability of disabled controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols)\n\t * in the WAI-ARIA Authoring Practices Guide.\n\t *\n\t * @default true\n\t */\n\taccessibleWhenDisabled?: boolean;\n};\n\nexport type ToolbarButtonContainerProps = {\n\t/**\n\t * Children to be rendered inside the button container.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An optional class name for the button container.\n\t */\n\tclassName?: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- // eslint-disable-next-line no-restricted-imports
5
4
 
6
5
  /**
7
6
  * WordPress dependencies
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","ToolbarContext","undefined"],"sources":["@wordpress/components/src/toolbar/toolbar-context/index.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nconst ToolbarContext = createContext< Ariakit.ToolbarStore | undefined >(\n\tundefined\n);\n\nexport default ToolbarContext;\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAElD,MAAMC,cAAc,GAAGD,aAAa,CACnCE,SACD,CAAC;AAED,eAAeD,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["createContext","ToolbarContext","undefined"],"sources":["@wordpress/components/src/toolbar/toolbar-context/index.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nconst ToolbarContext = createContext< Ariakit.ToolbarStore | undefined >(\n\tundefined\n);\n\nexport default ToolbarContext;\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAElD,MAAMC,cAAc,GAAGD,aAAa,CACnCE,SACD,CAAC;AAED,eAAeD,cAAc","ignoreList":[]}
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- // eslint-disable-next-line no-restricted-imports
5
4
  import * as Ariakit from '@ariakit/react';
6
5
  /**
7
6
  * WordPress dependencies
@@ -46,6 +45,7 @@ function ToolbarItem({
46
45
  children: children
47
46
  });
48
47
  return /*#__PURE__*/_jsx(Ariakit.ToolbarItem, {
48
+ accessibleWhenDisabled: true,
49
49
  ...allProps,
50
50
  store: accessibleToolbarStore,
51
51
  render: render
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","forwardRef","useContext","warning","ToolbarContext","jsx","_jsx","ToolbarItem","children","as","Component","props","ref","accessibleToolbarStore","isRenderProp","globalThis","SCRIPT_DEBUG","allProps","render","store"],"sources":["@wordpress/components/src/toolbar/toolbar-item/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport ToolbarContext from '../toolbar-context';\nimport type { ToolbarItemProps } from './types';\n\nfunction ToolbarItem(\n\t{ children, as: Component, ...props }: ToolbarItemProps,\n\tref: ForwardedRef< any >\n) {\n\tconst accessibleToolbarStore = useContext( ToolbarContext );\n\tconst isRenderProp = typeof children === 'function';\n\n\tif ( ! isRenderProp && ! Component ) {\n\t\twarning(\n\t\t\t'`ToolbarItem` is a generic headless component. You must pass either a `children` prop as a function or an `as` prop as a component. ' +\n\t\t\t\t'See https://developer.wordpress.org/block-editor/components/toolbar-item/'\n\t\t);\n\t\treturn null;\n\t}\n\n\tconst allProps = { ...props, ref, 'data-toolbar-item': true };\n\n\tif ( ! accessibleToolbarStore ) {\n\t\tif ( Component ) {\n\t\t\treturn <Component { ...allProps }>{ children }</Component>;\n\t\t}\n\t\tif ( ! isRenderProp ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn children( allProps );\n\t}\n\n\tconst render = isRenderProp\n\t\t? children\n\t\t: Component && <Component>{ children }</Component>;\n\n\treturn (\n\t\t<Ariakit.ToolbarItem\n\t\t\t{ ...allProps }\n\t\t\tstore={ accessibleToolbarStore }\n\t\t\trender={ render }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( ToolbarItem );\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AAGzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGhD,SAASC,WAAWA,CACnB;EAAEC,QAAQ;EAAEC,EAAE,EAAEC,SAAS;EAAE,GAAGC;AAAwB,CAAC,EACvDC,GAAwB,EACvB;EACD,MAAMC,sBAAsB,GAAGX,UAAU,CAAEE,cAAe,CAAC;EAC3D,MAAMU,YAAY,GAAG,OAAON,QAAQ,KAAK,UAAU;EAEnD,IAAK,CAAEM,YAAY,IAAI,CAAEJ,SAAS,EAAG;IACpCK,UAAA,CAAAC,YAAA,YAAAb,OAAO,CACN,sIAAsI,GACrI,2EACF,CAAC;IACD,OAAO,IAAI;EACZ;EAEA,MAAMc,QAAQ,GAAG;IAAE,GAAGN,KAAK;IAAEC,GAAG;IAAE,mBAAmB,EAAE;EAAK,CAAC;EAE7D,IAAK,CAAEC,sBAAsB,EAAG;IAC/B,IAAKH,SAAS,EAAG;MAChB,oBAAOJ,IAAA,CAACI,SAAS;QAAA,GAAMO,QAAQ;QAAAT,QAAA,EAAKA;MAAQ,CAAa,CAAC;IAC3D;IACA,IAAK,CAAEM,YAAY,EAAG;MACrB,OAAO,IAAI;IACZ;IACA,OAAON,QAAQ,CAAES,QAAS,CAAC;EAC5B;EAEA,MAAMC,MAAM,GAAGJ,YAAY,GACxBN,QAAQ,GACRE,SAAS,iBAAIJ,IAAA,CAACI,SAAS;IAAAF,QAAA,EAAGA;EAAQ,CAAa,CAAC;EAEnD,oBACCF,IAAA,CAACN,OAAO,CAACO,WAAW;IAAA,GACdU,QAAQ;IACbE,KAAK,EAAGN,sBAAwB;IAChCK,MAAM,EAAGA;EAAQ,CACjB,CAAC;AAEJ;AAEA,eAAejB,UAAU,CAAEM,WAAY,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","forwardRef","useContext","warning","ToolbarContext","jsx","_jsx","ToolbarItem","children","as","Component","props","ref","accessibleToolbarStore","isRenderProp","globalThis","SCRIPT_DEBUG","allProps","render","accessibleWhenDisabled","store"],"sources":["@wordpress/components/src/toolbar/toolbar-item/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport ToolbarContext from '../toolbar-context';\nimport type { ToolbarItemProps } from './types';\n\nfunction ToolbarItem(\n\t{ children, as: Component, ...props }: ToolbarItemProps,\n\tref: ForwardedRef< any >\n) {\n\tconst accessibleToolbarStore = useContext( ToolbarContext );\n\tconst isRenderProp = typeof children === 'function';\n\n\tif ( ! isRenderProp && ! Component ) {\n\t\twarning(\n\t\t\t'`ToolbarItem` is a generic headless component. You must pass either a `children` prop as a function or an `as` prop as a component. ' +\n\t\t\t\t'See https://developer.wordpress.org/block-editor/components/toolbar-item/'\n\t\t);\n\t\treturn null;\n\t}\n\n\tconst allProps = { ...props, ref, 'data-toolbar-item': true };\n\n\tif ( ! accessibleToolbarStore ) {\n\t\tif ( Component ) {\n\t\t\treturn <Component { ...allProps }>{ children }</Component>;\n\t\t}\n\t\tif ( ! isRenderProp ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn children( allProps );\n\t}\n\n\tconst render = isRenderProp\n\t\t? children\n\t\t: Component && <Component>{ children }</Component>;\n\n\treturn (\n\t\t<Ariakit.ToolbarItem\n\t\t\taccessibleWhenDisabled\n\t\t\t{ ...allProps }\n\t\t\tstore={ accessibleToolbarStore }\n\t\t\trender={ render }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( ToolbarItem );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AAGzC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGhD,SAASC,WAAWA,CACnB;EAAEC,QAAQ;EAAEC,EAAE,EAAEC,SAAS;EAAE,GAAGC;AAAwB,CAAC,EACvDC,GAAwB,EACvB;EACD,MAAMC,sBAAsB,GAAGX,UAAU,CAAEE,cAAe,CAAC;EAC3D,MAAMU,YAAY,GAAG,OAAON,QAAQ,KAAK,UAAU;EAEnD,IAAK,CAAEM,YAAY,IAAI,CAAEJ,SAAS,EAAG;IACpCK,UAAA,CAAAC,YAAA,YAAAb,OAAO,CACN,sIAAsI,GACrI,2EACF,CAAC;IACD,OAAO,IAAI;EACZ;EAEA,MAAMc,QAAQ,GAAG;IAAE,GAAGN,KAAK;IAAEC,GAAG;IAAE,mBAAmB,EAAE;EAAK,CAAC;EAE7D,IAAK,CAAEC,sBAAsB,EAAG;IAC/B,IAAKH,SAAS,EAAG;MAChB,oBAAOJ,IAAA,CAACI,SAAS;QAAA,GAAMO,QAAQ;QAAAT,QAAA,EAAKA;MAAQ,CAAa,CAAC;IAC3D;IACA,IAAK,CAAEM,YAAY,EAAG;MACrB,OAAO,IAAI;IACZ;IACA,OAAON,QAAQ,CAAES,QAAS,CAAC;EAC5B;EAEA,MAAMC,MAAM,GAAGJ,YAAY,GACxBN,QAAQ,GACRE,SAAS,iBAAIJ,IAAA,CAACI,SAAS;IAAAF,QAAA,EAAGA;EAAQ,CAAa,CAAC;EAEnD,oBACCF,IAAA,CAACN,OAAO,CAACO,WAAW;IACnBY,sBAAsB;IAAA,GACjBF,QAAQ;IACbG,KAAK,EAAGP,sBAAwB;IAChCK,MAAM,EAAGA;EAAQ,CACjB,CAAC;AAEJ;AAEA,eAAejB,UAAU,CAAEM,WAAY,CAAC","ignoreList":[]}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- // eslint-disable-next-line no-restricted-imports
5
4
  import * as Ariakit from '@ariakit/react';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -33,6 +33,7 @@ const CONTEXT_VALUE = {
33
33
  function UnforwardedTooltip(props, ref) {
34
34
  const {
35
35
  children,
36
+ className,
36
37
  delay = TOOLTIP_DELAY,
37
38
  hideOnClick = true,
38
39
  placement,
@@ -90,7 +91,7 @@ function UnforwardedTooltip(props, ref) {
90
91
  children: isOnlyChild ? undefined : children
91
92
  }), isOnlyChild && (text || shortcut) && /*#__PURE__*/_jsxs(Ariakit.Tooltip, {
92
93
  ...restProps,
93
- className: "components-tooltip",
94
+ className: clsx('components-tooltip', className),
94
95
  unmountOnHide: true,
95
96
  gutter: 4,
96
97
  id: describedById,
@@ -1 +1 @@
1
- {"version":3,"names":["Ariakit","useInstanceId","Children","useContext","createContext","forwardRef","deprecated","Shortcut","positionToPlacement","jsx","_jsx","jsxs","_jsxs","TooltipInternalContext","isNestedInTooltip","TOOLTIP_DELAY","CONTEXT_VALUE","UnforwardedTooltip","props","ref","children","delay","hideOnClick","placement","position","shortcut","text","restProps","baseId","Tooltip","describedById","undefined","isOnlyChild","count","process","env","NODE_ENV","console","error","computedPlacement","since","alternative","tooltipStore","useTooltipStore","showTimeout","Role","render","Provider","value","TooltipAnchor","onClick","hide","store","className","unmountOnHide","gutter","id","overflowPadding"],"sources":["@wordpress/components/src/tooltip/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tChildren,\n\tuseContext,\n\tcreateContext,\n\tforwardRef,\n} from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tTooltipProps,\n\tTooltipInternalContext as TooltipInternalContextType,\n} from './types';\nimport Shortcut from '../shortcut';\nimport { positionToPlacement } from '../popover/utils';\n\nconst TooltipInternalContext = createContext< TooltipInternalContextType >( {\n\tisNestedInTooltip: false,\n} );\n\n/**\n * Time over anchor to wait before showing tooltip\n */\nexport const TOOLTIP_DELAY = 700;\n\nconst CONTEXT_VALUE = {\n\tisNestedInTooltip: true,\n};\n\nfunction UnforwardedTooltip(\n\tprops: TooltipProps,\n\tref: React.ForwardedRef< any >\n) {\n\tconst {\n\t\tchildren,\n\t\tdelay = TOOLTIP_DELAY,\n\t\thideOnClick = true,\n\t\tplacement,\n\t\tposition,\n\t\tshortcut,\n\t\ttext,\n\n\t\t...restProps\n\t} = props;\n\n\tconst { isNestedInTooltip } = useContext( TooltipInternalContext );\n\n\tconst baseId = useInstanceId( Tooltip, 'tooltip' );\n\tconst describedById = text || shortcut ? baseId : undefined;\n\n\tconst isOnlyChild = Children.count( children ) === 1;\n\t// console error if more than one child element is added\n\tif ( ! isOnlyChild ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'wp-components.Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\t}\n\n\t// Compute tooltip's placement:\n\t// - give priority to `placement` prop, if defined\n\t// - otherwise, compute it from the legacy `position` prop (if defined)\n\t// - finally, fallback to the default placement: 'bottom'\n\tlet computedPlacement;\n\tif ( placement !== undefined ) {\n\t\tcomputedPlacement = placement;\n\t} else if ( position !== undefined ) {\n\t\tcomputedPlacement = positionToPlacement( position );\n\t\tdeprecated( '`position` prop in wp.components.tooltip', {\n\t\t\tsince: '6.4',\n\t\t\talternative: '`placement` prop',\n\t\t} );\n\t}\n\tcomputedPlacement = computedPlacement || 'bottom';\n\n\tconst tooltipStore = Ariakit.useTooltipStore( {\n\t\tplacement: computedPlacement,\n\t\tshowTimeout: delay,\n\t} );\n\n\tif ( isNestedInTooltip ) {\n\t\treturn isOnlyChild ? (\n\t\t\t<Ariakit.Role { ...restProps } render={ children } />\n\t\t) : (\n\t\t\tchildren\n\t\t);\n\t}\n\n\treturn (\n\t\t<TooltipInternalContext.Provider value={ CONTEXT_VALUE }>\n\t\t\t<Ariakit.TooltipAnchor\n\t\t\t\tonClick={ hideOnClick ? tooltipStore.hide : undefined }\n\t\t\t\tstore={ tooltipStore }\n\t\t\t\trender={ isOnlyChild ? children : undefined }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t{ isOnlyChild ? undefined : children }\n\t\t\t</Ariakit.TooltipAnchor>\n\t\t\t{ isOnlyChild && ( text || shortcut ) && (\n\t\t\t\t<Ariakit.Tooltip\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t\tclassName=\"components-tooltip\"\n\t\t\t\t\tunmountOnHide\n\t\t\t\t\tgutter={ 4 }\n\t\t\t\t\tid={ describedById }\n\t\t\t\t\toverflowPadding={ 0.5 }\n\t\t\t\t\tstore={ tooltipStore }\n\t\t\t\t>\n\t\t\t\t\t{ text }\n\t\t\t\t\t{ shortcut && (\n\t\t\t\t\t\t<Shortcut\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\ttext ? 'components-tooltip__shortcut' : ''\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Ariakit.Tooltip>\n\t\t\t) }\n\t\t</TooltipInternalContext.Provider>\n\t);\n}\n\nexport const Tooltip = forwardRef( UnforwardedTooltip );\n\nexport default Tooltip;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SACCC,QAAQ,EACRC,UAAU,EACVC,aAAa,EACbC,UAAU,QACJ,oBAAoB;AAC3B,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;;AAKA,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAASC,mBAAmB,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEvD,MAAMC,sBAAsB,GAAGT,aAAa,CAAgC;EAC3EU,iBAAiB,EAAE;AACpB,CAAE,CAAC;;AAEH;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAG,GAAG;AAEhC,MAAMC,aAAa,GAAG;EACrBF,iBAAiB,EAAE;AACpB,CAAC;AAED,SAASG,kBAAkBA,CAC1BC,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,GAAMlB,SAAS;MAAGmB,MAAM,EAAG1B;IAAU,CAAE,CAAC,GAErDA,QACA;EACF;EAEA,oBACCR,KAAA,CAACC,sBAAsB,CAACkC,QAAQ;IAACC,KAAK,EAAGhC,aAAe;IAAAI,QAAA,gBACvDV,IAAA,CAACV,OAAO,CAACiD,aAAa;MACrBC,OAAO,EAAG5B,WAAW,GAAGoB,YAAY,CAACS,IAAI,GAAGpB,SAAW;MACvDqB,KAAK,EAAGV,YAAc;MACtBI,MAAM,EAAGd,WAAW,GAAGZ,QAAQ,GAAGW,SAAW;MAC7CZ,GAAG,EAAGA,GAAK;MAAAC,QAAA,EAETY,WAAW,GAAGD,SAAS,GAAGX;IAAQ,CACd,CAAC,EACtBY,WAAW,KAAMN,IAAI,IAAID,QAAQ,CAAE,iBACpCb,KAAA,CAACZ,OAAO,CAAC6B,OAAO;MAAA,GACVF,SAAS;MACd0B,SAAS,EAAC,oBAAoB;MAC9BC,aAAa;MACbC,MAAM,EAAG,CAAG;MACZC,EAAE,EAAG1B,aAAe;MACpB2B,eAAe,EAAG,GAAK;MACvBL,KAAK,EAAGV,YAAc;MAAAtB,QAAA,GAEpBM,IAAI,EACJD,QAAQ,iBACTf,IAAA,CAACH,QAAQ;QACR8C,SAAS,EACR3B,IAAI,GAAG,8BAA8B,GAAG,EACxC;QACDD,QAAQ,EAAGA;MAAU,CACrB,CACD;IAAA,CACe,CACjB;EAAA,CAC+B,CAAC;AAEpC;AAEA,OAAO,MAAMI,OAAO,GAAGxB,UAAU,CAAEY,kBAAmB,CAAC;AAEvD,eAAeY,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["Ariakit","clsx","useInstanceId","Children","useContext","createContext","forwardRef","deprecated","Shortcut","positionToPlacement","jsx","_jsx","jsxs","_jsxs","TooltipInternalContext","isNestedInTooltip","TOOLTIP_DELAY","CONTEXT_VALUE","UnforwardedTooltip","props","ref","children","className","delay","hideOnClick","placement","position","shortcut","text","restProps","baseId","Tooltip","describedById","undefined","isOnlyChild","count","process","env","NODE_ENV","console","error","computedPlacement","since","alternative","tooltipStore","useTooltipStore","showTimeout","Role","render","Provider","value","TooltipAnchor","onClick","hide","store","unmountOnHide","gutter","id","overflowPadding"],"sources":["@wordpress/components/src/tooltip/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as Ariakit from '@ariakit/react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tChildren,\n\tuseContext,\n\tcreateContext,\n\tforwardRef,\n} from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tTooltipProps,\n\tTooltipInternalContext as TooltipInternalContextType,\n} from './types';\nimport Shortcut from '../shortcut';\nimport { positionToPlacement } from '../popover/utils';\n\nconst TooltipInternalContext = createContext< TooltipInternalContextType >( {\n\tisNestedInTooltip: false,\n} );\n\n/**\n * Time over anchor to wait before showing tooltip\n */\nexport const TOOLTIP_DELAY = 700;\n\nconst CONTEXT_VALUE = {\n\tisNestedInTooltip: true,\n};\n\nfunction UnforwardedTooltip(\n\tprops: TooltipProps,\n\tref: React.ForwardedRef< any >\n) {\n\tconst {\n\t\tchildren,\n\t\tclassName,\n\t\tdelay = TOOLTIP_DELAY,\n\t\thideOnClick = true,\n\t\tplacement,\n\t\tposition,\n\t\tshortcut,\n\t\ttext,\n\n\t\t...restProps\n\t} = props;\n\n\tconst { isNestedInTooltip } = useContext( TooltipInternalContext );\n\n\tconst baseId = useInstanceId( Tooltip, 'tooltip' );\n\tconst describedById = text || shortcut ? baseId : undefined;\n\n\tconst isOnlyChild = Children.count( children ) === 1;\n\t// console error if more than one child element is added\n\tif ( ! isOnlyChild ) {\n\t\tif ( 'development' === process.env.NODE_ENV ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error(\n\t\t\t\t'wp-components.Tooltip should be called with only a single child element.'\n\t\t\t);\n\t\t}\n\t}\n\n\t// Compute tooltip's placement:\n\t// - give priority to `placement` prop, if defined\n\t// - otherwise, compute it from the legacy `position` prop (if defined)\n\t// - finally, fallback to the default placement: 'bottom'\n\tlet computedPlacement;\n\tif ( placement !== undefined ) {\n\t\tcomputedPlacement = placement;\n\t} else if ( position !== undefined ) {\n\t\tcomputedPlacement = positionToPlacement( position );\n\t\tdeprecated( '`position` prop in wp.components.tooltip', {\n\t\t\tsince: '6.4',\n\t\t\talternative: '`placement` prop',\n\t\t} );\n\t}\n\tcomputedPlacement = computedPlacement || 'bottom';\n\n\tconst tooltipStore = Ariakit.useTooltipStore( {\n\t\tplacement: computedPlacement,\n\t\tshowTimeout: delay,\n\t} );\n\n\tif ( isNestedInTooltip ) {\n\t\treturn isOnlyChild ? (\n\t\t\t<Ariakit.Role { ...restProps } render={ children } />\n\t\t) : (\n\t\t\tchildren\n\t\t);\n\t}\n\n\treturn (\n\t\t<TooltipInternalContext.Provider value={ CONTEXT_VALUE }>\n\t\t\t<Ariakit.TooltipAnchor\n\t\t\t\tonClick={ hideOnClick ? tooltipStore.hide : undefined }\n\t\t\t\tstore={ tooltipStore }\n\t\t\t\trender={ isOnlyChild ? children : undefined }\n\t\t\t\tref={ ref }\n\t\t\t>\n\t\t\t\t{ isOnlyChild ? undefined : children }\n\t\t\t</Ariakit.TooltipAnchor>\n\t\t\t{ isOnlyChild && ( text || shortcut ) && (\n\t\t\t\t<Ariakit.Tooltip\n\t\t\t\t\t{ ...restProps }\n\t\t\t\t\tclassName={ clsx( 'components-tooltip', className ) }\n\t\t\t\t\tunmountOnHide\n\t\t\t\t\tgutter={ 4 }\n\t\t\t\t\tid={ describedById }\n\t\t\t\t\toverflowPadding={ 0.5 }\n\t\t\t\t\tstore={ tooltipStore }\n\t\t\t\t>\n\t\t\t\t\t{ text }\n\t\t\t\t\t{ shortcut && (\n\t\t\t\t\t\t<Shortcut\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\ttext ? 'components-tooltip__shortcut' : ''\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tshortcut={ shortcut }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Ariakit.Tooltip>\n\t\t\t) }\n\t\t</TooltipInternalContext.Provider>\n\t);\n}\n\nexport const Tooltip = forwardRef( UnforwardedTooltip );\n\nexport default Tooltip;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,OAAO,MAAM,gBAAgB;AACzC,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SACCC,QAAQ,EACRC,UAAU,EACVC,aAAa,EACbC,UAAU,QACJ,oBAAoB;AAC3B,OAAOC,UAAU,MAAM,uBAAuB;;AAE9C;AACA;AACA;;AAKA,OAAOC,QAAQ,MAAM,aAAa;AAClC,SAASC,mBAAmB,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEvD,MAAMC,sBAAsB,GAAGT,aAAa,CAAgC;EAC3EU,iBAAiB,EAAE;AACpB,CAAE,CAAC;;AAEH;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAG,GAAG;AAEhC,MAAMC,aAAa,GAAG;EACrBF,iBAAiB,EAAE;AACpB,CAAC;AAED,SAASG,kBAAkBA,CAC1BC,KAAmB,EACnBC,GAA8B,EAC7B;EACD,MAAM;IACLC,QAAQ;IACRC,SAAS;IACTC,KAAK,GAAGP,aAAa;IACrBQ,WAAW,GAAG,IAAI;IAClBC,SAAS;IACTC,QAAQ;IACRC,QAAQ;IACRC,IAAI;IAEJ,GAAGC;EACJ,CAAC,GAAGV,KAAK;EAET,MAAM;IAAEJ;EAAkB,CAAC,GAAGX,UAAU,CAAEU,sBAAuB,CAAC;EAElE,MAAMgB,MAAM,GAAG5B,aAAa,CAAE6B,OAAO,EAAE,SAAU,CAAC;EAClD,MAAMC,aAAa,GAAGJ,IAAI,IAAID,QAAQ,GAAGG,MAAM,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AA,EAETa,WAAW,GAAGD,SAAS,GAAGZ;IAAQ,CACd,CAAC,EACtBa,WAAW,KAAMN,IAAI,IAAID,QAAQ,CAAE,iBACpCd,KAAA,CAACb,OAAO,CAAC+B,OAAO;MAAA,GACVF,SAAS;MACdP,SAAS,EAAGrB,IAAI,CAAE,oBAAoB,EAAEqB,SAAU,CAAG;MACrDiC,aAAa;MACbC,MAAM,EAAG,CAAG;MACZC,EAAE,EAAGzB,aAAe;MACpB0B,eAAe,EAAG,GAAK;MACvBJ,KAAK,EAAGV,YAAc;MAAAvB,QAAA,GAEpBO,IAAI,EACJD,QAAQ,iBACThB,IAAA,CAACH,QAAQ;QACRc,SAAS,EACRM,IAAI,GAAG,8BAA8B,GAAG,EACxC;QACDD,QAAQ,EAAGA;MAAU,CACrB,CACD;IAAA,CACe,CACjB;EAAA,CAC+B,CAAC;AAEpC;AAEA,OAAO,MAAMI,OAAO,GAAGzB,UAAU,CAAEY,kBAAmB,CAAC;AAEvD,eAAea,OAAO","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/tooltip/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { Placement } from '@floating-ui/react-dom';\n\n/**\n * Internal dependencies\n */\nimport type { PopoverProps } from '../popover/types';\nimport type { ShortcutProps } from '../shortcut/types';\n\nexport type TooltipProps = {\n\t/**\n\t * The anchor for the tooltip.\n\t *\n\t * **Note**: Accepts only one child element.\n\t */\n\tchildren: React.ReactElement;\n\t/**\n\t * Option to hide the tooltip when the anchor is clicked.\n\t *\n\t * @default true\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * The amount of time in milliseconds to wait before showing the tooltip.\n\t *\n\t * @default 700\n\t */\n\tdelay?: number;\n\t/**\n\t * Where the tooltip should be positioned relative to its parent.\n\t *\n\t * @default bottom\n\t */\n\tplacement?: Placement;\n\t/**\n\t * _Note: this prop is deprecated. Please use the `placement` prop instead._\n\t *\n\t * Legacy way of specifying the tooltip's position relative to its parent.\n\t *\n\t * Specify y- and x-axis as a space-separated string. Supports `\"top\"`,\n\t * `\"bottom\"` y axis, and `\"left\"`, `\"center\"`, `\"right\"` x axis.\n\t *\n\t * @deprecated\n\t * @default bottom\n\t */\n\tposition?: PopoverProps[ 'position' ];\n\t/**\n\t * An option for adding accessible keyboard shortcuts.\n\t *\n\t * If shortcut is a string, it is expecting the display text. If shortcut is an\n\t * object, it will accept the properties of `display` (string) and `ariaLabel`\n\t * (string).\n\t */\n\tshortcut?: ShortcutProps[ 'shortcut' ];\n\t/**\n\t * The text shown in the tooltip when anchor element is focused or hovered.\n\t */\n\ttext?: string;\n};\n\nexport type TooltipInternalContext = {\n\tisNestedInTooltip: boolean;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/tooltip/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { Placement } from '@floating-ui/react-dom';\n\n/**\n * Internal dependencies\n */\nimport type { PopoverProps } from '../popover/types';\nimport type { ShortcutProps } from '../shortcut/types';\n\nexport type TooltipProps = {\n\t/**\n\t * The anchor for the tooltip.\n\t *\n\t * **Note**: Accepts only one child element.\n\t */\n\tchildren: React.ReactElement;\n\t/**\n\t * Custom class name for the tooltip.\n\t */\n\tclassName?: string;\n\t/**\n\t * Option to hide the tooltip when the anchor is clicked.\n\t *\n\t * @default true\n\t */\n\thideOnClick?: boolean;\n\t/**\n\t * The amount of time in milliseconds to wait before showing the tooltip.\n\t *\n\t * @default 700\n\t */\n\tdelay?: number;\n\t/**\n\t * Where the tooltip should be positioned relative to its parent.\n\t *\n\t * @default bottom\n\t */\n\tplacement?: Placement;\n\t/**\n\t * _Note: this prop is deprecated. Please use the `placement` prop instead._\n\t *\n\t * Legacy way of specifying the tooltip's position relative to its parent.\n\t *\n\t * Specify y- and x-axis as a space-separated string. Supports `\"top\"`,\n\t * `\"bottom\"` y axis, and `\"left\"`, `\"center\"`, `\"right\"` x axis.\n\t *\n\t * @deprecated\n\t * @default bottom\n\t */\n\tposition?: PopoverProps[ 'position' ];\n\t/**\n\t * An option for adding accessible keyboard shortcuts.\n\t *\n\t * If shortcut is a string, it is expecting the display text. If shortcut is an\n\t * object, it will accept the properties of `display` (string) and `ariaLabel`\n\t * (string).\n\t */\n\tshortcut?: ShortcutProps[ 'shortcut' ];\n\t/**\n\t * The text shown in the tooltip when anchor element is focused or hovered.\n\t */\n\ttext?: string;\n};\n\nexport type TooltipInternalContext = {\n\tisNestedInTooltip: boolean;\n};\n"],"mappings":"","ignoreList":[]}
@@ -112,10 +112,10 @@ function UnforwardedUnitControl(unitControlProps, forwardedRef) {
112
112
  if (!disableUnits && isUnitSelectTabbable && units.length) {
113
113
  handleOnKeyDown = event => {
114
114
  props.onKeyDown?.(event);
115
- // Unless the meta key was pressed (to avoid interfering with
116
- // shortcuts, e.g. pastes), moves focus to the unit select if a key
115
+ // Unless the meta or ctrl key was pressed (to avoid interfering with
116
+ // shortcuts, e.g. pastes), move focus to the unit select if a key
117
117
  // matches the first character of a unit.
118
- if (!event.metaKey && reFirstCharacterOfUnits.test(event.key)) {
118
+ if (!event.metaKey && !event.ctrlKey && reFirstCharacterOfUnits.test(event.key)) {
119
119
  refInputSuffix.current?.focus();
120
120
  }
121
121
  };
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","deprecated","forwardRef","useMemo","useRef","useEffect","__","ValueInput","UnitSelectControl","CSS_UNITS","getParsedQuantityAndUnit","getUnitsWithCurrentUnit","getValidParsedQuantityAndUnit","useControlledState","escapeRegExp","useDeprecated36pxDefaultSizeProp","jsx","_jsx","UnforwardedUnitControl","unitControlProps","forwardedRef","__unstableStateReducer","autoComplete","children","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","onChangeProp","onUnitChange","size","unit","unitProp","units","unitsProp","value","valueProp","onFocus","onFocusProp","props","since","hint","version","nonNullValueProp","undefined","reFirstCharacterOfUnits","list","firstUnitValue","rest","firstCharacters","reduce","carry","first","substring","includes","RegExp","parsedQuantity","parsedUnit","setUnit","length","initial","fallback","classes","handleOnQuantityChange","nextQuantityValue","changeProps","onChangeValue","join","handleOnUnitChange","nextUnitValue","data","nextValue","default","handleOnKeyDown","event","onKeyDown","metaKey","test","key","refInputSuffix","current","focus","inputSuffix","ref","__next40pxDefaultSize","onBlur","step","_activeUnit$step","activeUnit","find","option","spinControls","suffix","type","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits"],"sources":["@wordpress/components/src/unit-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { KeyboardEvent, ForwardedRef, SyntheticEvent } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport {\n\tCSS_UNITS,\n\tgetParsedQuantityAndUnit,\n\tgetUnitsWithCurrentUnit,\n\tgetValidParsedQuantityAndUnit,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport { escapeRegExp } from '../utils/strings';\nimport type { UnitControlProps, UnitControlOnChangeCallback } from './types';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\n\nfunction UnforwardedUnitControl(\n\tunitControlProps: WordPressComponentProps<\n\t\tUnitControlProps,\n\t\t'input',\n\t\tfalse\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer,\n\t\tautoComplete = 'off',\n\t\t// @ts-expect-error Ensure that children is omitted from restProps\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled = false,\n\t\tdisableUnits = false,\n\t\tisPressEnterToChange = false,\n\t\tisResetValueOnUnitChange = false,\n\t\tisUnitSelectTabbable = true,\n\t\tlabel,\n\t\tonChange: onChangeProp,\n\t\tonUnitChange,\n\t\tsize = 'default',\n\t\tunit: unitProp,\n\t\tunits: unitsProp = CSS_UNITS,\n\t\tvalue: valueProp,\n\t\tonFocus: onFocusProp,\n\t\t...props\n\t} = useDeprecated36pxDefaultSizeProp( unitControlProps );\n\n\tif ( 'unit' in unitControlProps ) {\n\t\tdeprecated( 'UnitControl unit prop', {\n\t\t\tsince: '5.6',\n\t\t\thint: 'The unit should be provided within the `value` prop.',\n\t\t\tversion: '6.2',\n\t\t} );\n\t}\n\n\t// The `value` prop, in theory, should not be `null`, but the following line\n\t// ensures it fallback to `undefined` in case a consumer of `UnitControl`\n\t// still passes `null` as a `value`.\n\tconst nonNullValueProp = valueProp ?? undefined;\n\tconst [ units, reFirstCharacterOfUnits ] = useMemo( () => {\n\t\tconst list = getUnitsWithCurrentUnit(\n\t\t\tnonNullValueProp,\n\t\t\tunitProp,\n\t\t\tunitsProp\n\t\t);\n\t\tconst [ { value: firstUnitValue = '' } = {}, ...rest ] = list;\n\t\tconst firstCharacters = rest.reduce(\n\t\t\t( carry, { value } ) => {\n\t\t\t\tconst first = escapeRegExp( value?.substring( 0, 1 ) || '' );\n\t\t\t\treturn carry.includes( first )\n\t\t\t\t\t? carry\n\t\t\t\t\t: `${ carry }|${ first }`;\n\t\t\t},\n\t\t\tescapeRegExp( firstUnitValue.substring( 0, 1 ) )\n\t\t);\n\t\treturn [ list, new RegExp( `^(?:${ firstCharacters })$`, 'i' ) ];\n\t}, [ nonNullValueProp, unitProp, unitsProp ] );\n\tconst [ parsedQuantity, parsedUnit ] = getParsedQuantityAndUnit(\n\t\tnonNullValueProp,\n\t\tunitProp,\n\t\tunits\n\t);\n\n\tconst [ unit, setUnit ] = useControlledState< string | undefined >(\n\t\tunits.length === 1 ? units[ 0 ].value : unitProp,\n\t\t{\n\t\t\tinitial: parsedUnit,\n\t\t\tfallback: '',\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tif ( parsedUnit !== undefined ) {\n\t\t\tsetUnit( parsedUnit );\n\t\t}\n\t}, [ parsedUnit, setUnit ] );\n\n\tconst classes = clsx(\n\t\t'components-unit-control',\n\t\t// This class is added for legacy purposes to maintain it on the outer\n\t\t// wrapper. See: https://github.com/WordPress/gutenberg/pull/45139\n\t\t'components-unit-control-wrapper',\n\t\tclassName\n\t);\n\n\tconst handleOnQuantityChange = (\n\t\tnextQuantityValue: number | string | undefined,\n\t\tchangeProps: {\n\t\t\tevent: SyntheticEvent;\n\t\t}\n\t) => {\n\t\tif (\n\t\t\tnextQuantityValue === '' ||\n\t\t\ttypeof nextQuantityValue === 'undefined' ||\n\t\t\tnextQuantityValue === null\n\t\t) {\n\t\t\tonChangeProp?.( '', changeProps );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Customizing the onChange callback.\n\t\t * This allows as to broadcast a combined value+unit to onChange.\n\t\t */\n\t\tconst onChangeValue = getValidParsedQuantityAndUnit(\n\t\t\tnextQuantityValue,\n\t\t\tunits,\n\t\t\tparsedQuantity,\n\t\t\tunit\n\t\t).join( '' );\n\n\t\tonChangeProp?.( onChangeValue, changeProps );\n\t};\n\n\tconst handleOnUnitChange: UnitControlOnChangeCallback = (\n\t\tnextUnitValue,\n\t\tchangeProps\n\t) => {\n\t\tconst { data } = changeProps;\n\n\t\tlet nextValue = `${ parsedQuantity ?? '' }${ nextUnitValue }`;\n\n\t\tif ( isResetValueOnUnitChange && data?.default !== undefined ) {\n\t\t\tnextValue = `${ data.default }${ nextUnitValue }`;\n\t\t}\n\n\t\tonChangeProp?.( nextValue, changeProps );\n\t\tonUnitChange?.( nextUnitValue, changeProps );\n\n\t\tsetUnit( nextUnitValue );\n\t};\n\n\tlet handleOnKeyDown;\n\tif ( ! disableUnits && isUnitSelectTabbable && units.length ) {\n\t\thandleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\t\tprops.onKeyDown?.( event );\n\t\t\t// Unless the meta key was pressed (to avoid interfering with\n\t\t\t// shortcuts, e.g. pastes), moves focus to the unit select if a key\n\t\t\t// matches the first character of a unit.\n\t\t\tif (\n\t\t\t\t! event.metaKey &&\n\t\t\t\treFirstCharacterOfUnits.test( event.key )\n\t\t\t) {\n\t\t\t\trefInputSuffix.current?.focus();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst refInputSuffix = useRef< HTMLSelectElement >( null );\n\tconst inputSuffix = ! disableUnits ? (\n\t\t<UnitSelectControl\n\t\t\tref={ refInputSuffix }\n\t\t\taria-label={ __( 'Select unit' ) }\n\t\t\tdisabled={ disabled }\n\t\t\tisUnitSelectTabbable={ isUnitSelectTabbable }\n\t\t\tonChange={ handleOnUnitChange }\n\t\t\tsize={\n\t\t\t\t[ 'small', 'compact' ].includes( size ) ||\n\t\t\t\t( size === 'default' && ! props.__next40pxDefaultSize )\n\t\t\t\t\t? 'small'\n\t\t\t\t\t: 'default'\n\t\t\t}\n\t\t\tunit={ unit }\n\t\t\tunits={ units }\n\t\t\tonFocus={ onFocusProp }\n\t\t\tonBlur={ unitControlProps.onBlur }\n\t\t/>\n\t) : null;\n\n\tlet step = props.step;\n\n\t/*\n\t * If no step prop has been passed, lookup the active unit and\n\t * try to get step from `units`, or default to a value of `1`\n\t */\n\tif ( ! step && units ) {\n\t\tconst activeUnit = units.find( ( option ) => option.value === unit );\n\t\tstep = activeUnit?.step ?? 1;\n\t}\n\n\treturn (\n\t\t<ValueInput\n\t\t\t{ ...props }\n\t\t\tautoComplete={ autoComplete }\n\t\t\tclassName={ classes }\n\t\t\tdisabled={ disabled }\n\t\t\tspinControls=\"none\"\n\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\tlabel={ label }\n\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\tonChange={ handleOnQuantityChange }\n\t\t\tref={ forwardedRef }\n\t\t\tsize={ size }\n\t\t\tsuffix={ inputSuffix }\n\t\t\ttype={ isPressEnterToChange ? 'text' : 'number' }\n\t\t\tvalue={ parsedQuantity ?? '' }\n\t\t\tstep={ step }\n\t\t\tonFocus={ onFocusProp }\n\t\t\t__unstableStateReducer={ __unstableStateReducer }\n\t\t/>\n\t);\n}\n\n/**\n * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).\n *\n *\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nexport const UnitControl = forwardRef( UnforwardedUnitControl );\n\nexport { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';\nexport default UnitControl;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,OAAO,EAAEC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AAC3E,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,SAASC,UAAU,QAAQ,8BAA8B;AACzD,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SACCC,SAAS,EACTC,wBAAwB,EACxBC,uBAAuB,EACvBC,6BAA6B,QACvB,SAAS;AAChB,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,SAASC,YAAY,QAAQ,kBAAkB;AAE/C,SAASC,gCAAgC,QAAQ,+BAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEjF,SAASC,sBAAsBA,CAC9BC,gBAIC,EACDC,YAAiC,EAChC;EACD,MAAM;IACLC,sBAAsB;IACtBC,YAAY,GAAG,KAAK;IACpB;IACAC,QAAQ;IACRC,SAAS;IACTC,QAAQ,GAAG,KAAK;IAChBC,YAAY,GAAG,KAAK;IACpBC,oBAAoB,GAAG,KAAK;IAC5BC,wBAAwB,GAAG,KAAK;IAChCC,oBAAoB,GAAG,IAAI;IAC3BC,KAAK;IACLC,QAAQ,EAAEC,YAAY;IACt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,SAAS;AAC1E,eAAeF,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["clsx","deprecated","forwardRef","useMemo","useRef","useEffect","__","ValueInput","UnitSelectControl","CSS_UNITS","getParsedQuantityAndUnit","getUnitsWithCurrentUnit","getValidParsedQuantityAndUnit","useControlledState","escapeRegExp","useDeprecated36pxDefaultSizeProp","jsx","_jsx","UnforwardedUnitControl","unitControlProps","forwardedRef","__unstableStateReducer","autoComplete","children","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","onChangeProp","onUnitChange","size","unit","unitProp","units","unitsProp","value","valueProp","onFocus","onFocusProp","props","since","hint","version","nonNullValueProp","undefined","reFirstCharacterOfUnits","list","firstUnitValue","rest","firstCharacters","reduce","carry","first","substring","includes","RegExp","parsedQuantity","parsedUnit","setUnit","length","initial","fallback","classes","handleOnQuantityChange","nextQuantityValue","changeProps","onChangeValue","join","handleOnUnitChange","nextUnitValue","data","nextValue","default","handleOnKeyDown","event","onKeyDown","metaKey","ctrlKey","test","key","refInputSuffix","current","focus","inputSuffix","ref","__next40pxDefaultSize","onBlur","step","_activeUnit$step","activeUnit","find","option","spinControls","suffix","type","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits"],"sources":["@wordpress/components/src/unit-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { KeyboardEvent, ForwardedRef, SyntheticEvent } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef, useMemo, useRef, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport { ValueInput } from './styles/unit-control-styles';\nimport UnitSelectControl from './unit-select-control';\nimport {\n\tCSS_UNITS,\n\tgetParsedQuantityAndUnit,\n\tgetUnitsWithCurrentUnit,\n\tgetValidParsedQuantityAndUnit,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport { escapeRegExp } from '../utils/strings';\nimport type { UnitControlProps, UnitControlOnChangeCallback } from './types';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\n\nfunction UnforwardedUnitControl(\n\tunitControlProps: WordPressComponentProps<\n\t\tUnitControlProps,\n\t\t'input',\n\t\tfalse\n\t>,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\t__unstableStateReducer,\n\t\tautoComplete = 'off',\n\t\t// @ts-expect-error Ensure that children is omitted from restProps\n\t\tchildren,\n\t\tclassName,\n\t\tdisabled = false,\n\t\tdisableUnits = false,\n\t\tisPressEnterToChange = false,\n\t\tisResetValueOnUnitChange = false,\n\t\tisUnitSelectTabbable = true,\n\t\tlabel,\n\t\tonChange: onChangeProp,\n\t\tonUnitChange,\n\t\tsize = 'default',\n\t\tunit: unitProp,\n\t\tunits: unitsProp = CSS_UNITS,\n\t\tvalue: valueProp,\n\t\tonFocus: onFocusProp,\n\t\t...props\n\t} = useDeprecated36pxDefaultSizeProp( unitControlProps );\n\n\tif ( 'unit' in unitControlProps ) {\n\t\tdeprecated( 'UnitControl unit prop', {\n\t\t\tsince: '5.6',\n\t\t\thint: 'The unit should be provided within the `value` prop.',\n\t\t\tversion: '6.2',\n\t\t} );\n\t}\n\n\t// The `value` prop, in theory, should not be `null`, but the following line\n\t// ensures it fallback to `undefined` in case a consumer of `UnitControl`\n\t// still passes `null` as a `value`.\n\tconst nonNullValueProp = valueProp ?? undefined;\n\tconst [ units, reFirstCharacterOfUnits ] = useMemo( () => {\n\t\tconst list = getUnitsWithCurrentUnit(\n\t\t\tnonNullValueProp,\n\t\t\tunitProp,\n\t\t\tunitsProp\n\t\t);\n\t\tconst [ { value: firstUnitValue = '' } = {}, ...rest ] = list;\n\t\tconst firstCharacters = rest.reduce(\n\t\t\t( carry, { value } ) => {\n\t\t\t\tconst first = escapeRegExp( value?.substring( 0, 1 ) || '' );\n\t\t\t\treturn carry.includes( first )\n\t\t\t\t\t? carry\n\t\t\t\t\t: `${ carry }|${ first }`;\n\t\t\t},\n\t\t\tescapeRegExp( firstUnitValue.substring( 0, 1 ) )\n\t\t);\n\t\treturn [ list, new RegExp( `^(?:${ firstCharacters })$`, 'i' ) ];\n\t}, [ nonNullValueProp, unitProp, unitsProp ] );\n\tconst [ parsedQuantity, parsedUnit ] = getParsedQuantityAndUnit(\n\t\tnonNullValueProp,\n\t\tunitProp,\n\t\tunits\n\t);\n\n\tconst [ unit, setUnit ] = useControlledState< string | undefined >(\n\t\tunits.length === 1 ? units[ 0 ].value : unitProp,\n\t\t{\n\t\t\tinitial: parsedUnit,\n\t\t\tfallback: '',\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tif ( parsedUnit !== undefined ) {\n\t\t\tsetUnit( parsedUnit );\n\t\t}\n\t}, [ parsedUnit, setUnit ] );\n\n\tconst classes = clsx(\n\t\t'components-unit-control',\n\t\t// This class is added for legacy purposes to maintain it on the outer\n\t\t// wrapper. See: https://github.com/WordPress/gutenberg/pull/45139\n\t\t'components-unit-control-wrapper',\n\t\tclassName\n\t);\n\n\tconst handleOnQuantityChange = (\n\t\tnextQuantityValue: number | string | undefined,\n\t\tchangeProps: {\n\t\t\tevent: SyntheticEvent;\n\t\t}\n\t) => {\n\t\tif (\n\t\t\tnextQuantityValue === '' ||\n\t\t\ttypeof nextQuantityValue === 'undefined' ||\n\t\t\tnextQuantityValue === null\n\t\t) {\n\t\t\tonChangeProp?.( '', changeProps );\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Customizing the onChange callback.\n\t\t * This allows as to broadcast a combined value+unit to onChange.\n\t\t */\n\t\tconst onChangeValue = getValidParsedQuantityAndUnit(\n\t\t\tnextQuantityValue,\n\t\t\tunits,\n\t\t\tparsedQuantity,\n\t\t\tunit\n\t\t).join( '' );\n\n\t\tonChangeProp?.( onChangeValue, changeProps );\n\t};\n\n\tconst handleOnUnitChange: UnitControlOnChangeCallback = (\n\t\tnextUnitValue,\n\t\tchangeProps\n\t) => {\n\t\tconst { data } = changeProps;\n\n\t\tlet nextValue = `${ parsedQuantity ?? '' }${ nextUnitValue }`;\n\n\t\tif ( isResetValueOnUnitChange && data?.default !== undefined ) {\n\t\t\tnextValue = `${ data.default }${ nextUnitValue }`;\n\t\t}\n\n\t\tonChangeProp?.( nextValue, changeProps );\n\t\tonUnitChange?.( nextUnitValue, changeProps );\n\n\t\tsetUnit( nextUnitValue );\n\t};\n\n\tlet handleOnKeyDown;\n\tif ( ! disableUnits && isUnitSelectTabbable && units.length ) {\n\t\thandleOnKeyDown = ( event: KeyboardEvent< HTMLInputElement > ) => {\n\t\t\tprops.onKeyDown?.( event );\n\t\t\t// Unless the meta or ctrl key was pressed (to avoid interfering with\n\t\t\t// shortcuts, e.g. pastes), move focus to the unit select if a key\n\t\t\t// matches the first character of a unit.\n\t\t\tif (\n\t\t\t\t! event.metaKey &&\n\t\t\t\t! event.ctrlKey &&\n\t\t\t\treFirstCharacterOfUnits.test( event.key )\n\t\t\t) {\n\t\t\t\trefInputSuffix.current?.focus();\n\t\t\t}\n\t\t};\n\t}\n\n\tconst refInputSuffix = useRef< HTMLSelectElement >( null );\n\tconst inputSuffix = ! disableUnits ? (\n\t\t<UnitSelectControl\n\t\t\tref={ refInputSuffix }\n\t\t\taria-label={ __( 'Select unit' ) }\n\t\t\tdisabled={ disabled }\n\t\t\tisUnitSelectTabbable={ isUnitSelectTabbable }\n\t\t\tonChange={ handleOnUnitChange }\n\t\t\tsize={\n\t\t\t\t[ 'small', 'compact' ].includes( size ) ||\n\t\t\t\t( size === 'default' && ! props.__next40pxDefaultSize )\n\t\t\t\t\t? 'small'\n\t\t\t\t\t: 'default'\n\t\t\t}\n\t\t\tunit={ unit }\n\t\t\tunits={ units }\n\t\t\tonFocus={ onFocusProp }\n\t\t\tonBlur={ unitControlProps.onBlur }\n\t\t/>\n\t) : null;\n\n\tlet step = props.step;\n\n\t/*\n\t * If no step prop has been passed, lookup the active unit and\n\t * try to get step from `units`, or default to a value of `1`\n\t */\n\tif ( ! step && units ) {\n\t\tconst activeUnit = units.find( ( option ) => option.value === unit );\n\t\tstep = activeUnit?.step ?? 1;\n\t}\n\n\treturn (\n\t\t<ValueInput\n\t\t\t{ ...props }\n\t\t\tautoComplete={ autoComplete }\n\t\t\tclassName={ classes }\n\t\t\tdisabled={ disabled }\n\t\t\tspinControls=\"none\"\n\t\t\tisPressEnterToChange={ isPressEnterToChange }\n\t\t\tlabel={ label }\n\t\t\tonKeyDown={ handleOnKeyDown }\n\t\t\tonChange={ handleOnQuantityChange }\n\t\t\tref={ forwardedRef }\n\t\t\tsize={ size }\n\t\t\tsuffix={ inputSuffix }\n\t\t\ttype={ isPressEnterToChange ? 'text' : 'number' }\n\t\t\tvalue={ parsedQuantity ?? '' }\n\t\t\tstep={ step }\n\t\t\tonFocus={ onFocusProp }\n\t\t\t__unstableStateReducer={ __unstableStateReducer }\n\t\t/>\n\t);\n}\n\n/**\n * `UnitControl` allows the user to set a numeric quantity as well as a unit (e.g. `px`).\n *\n *\n * ```jsx\n * import { __experimentalUnitControl as UnitControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * const [ value, setValue ] = useState( '10px' );\n *\n * return <UnitControl onChange={ setValue } value={ value } />;\n * };\n * ```\n */\nexport const UnitControl = forwardRef( UnforwardedUnitControl );\n\nexport { parseQuantityAndUnitFromRawValue, useCustomUnits } from './utils';\nexport default UnitControl;\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,OAAO,EAAEC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AAC3E,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;;AAEA,SAASC,UAAU,QAAQ,8BAA8B;AACzD,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SACCC,SAAS,EAC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