@wordpress/components 28.9.0 → 28.11.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 (1108) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/build/alignment-matrix-control/icon.js.map +1 -1
  3. package/build/alignment-matrix-control/types.js.map +1 -1
  4. package/build/alignment-matrix-control/utils.js.map +1 -1
  5. package/build/angle-picker-control/angle-circle.js.map +1 -1
  6. package/build/autocomplete/autocompleter-ui.js +5 -9
  7. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  8. package/build/autocomplete/autocompleter-ui.native.js +2 -4
  9. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  10. package/build/autocomplete/get-default-use-items.js.map +1 -1
  11. package/build/autocomplete/index.js +5 -5
  12. package/build/autocomplete/index.js.map +1 -1
  13. package/build/base-control/hooks.js.map +1 -1
  14. package/build/base-control/index.js.map +1 -1
  15. package/build/base-control/types.js.map +1 -1
  16. package/build/border-box-control/border-box-control/component.js +1 -0
  17. package/build/border-box-control/border-box-control/component.js.map +1 -1
  18. package/build/border-box-control/border-box-control/hook.js +6 -0
  19. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  20. package/build/border-box-control/styles.js.map +1 -1
  21. package/build/border-box-control/utils.js.map +1 -1
  22. package/build/border-control/border-control/component.js +1 -0
  23. package/build/border-control/border-control/component.js.map +1 -1
  24. package/build/border-control/border-control/hook.js +6 -0
  25. package/build/border-control/border-control/hook.js.map +1 -1
  26. package/build/border-control/border-control-dropdown/component.js +12 -12
  27. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  28. package/build/border-control/styles.js.map +1 -1
  29. package/build/box-control/axial-input-controls.js.map +1 -1
  30. package/build/box-control/icon.js.map +1 -1
  31. package/build/box-control/index.js.map +1 -1
  32. package/build/box-control/input-controls.js.map +1 -1
  33. package/build/button/index.native.js +1 -1
  34. package/build/button/index.native.js.map +1 -1
  35. package/build/card/card/component.js +1 -1
  36. package/build/card/card/component.js.map +1 -1
  37. package/build/card/styles.js.map +1 -1
  38. package/build/color-palette/index.js +1 -1
  39. package/build/color-palette/index.js.map +1 -1
  40. package/build/color-palette/index.native.js +3 -3
  41. package/build/color-palette/index.native.js.map +1 -1
  42. package/build/color-picker/index.native.js +0 -1
  43. package/build/color-picker/index.native.js.map +1 -1
  44. package/build/color-picker/styles.js.map +1 -1
  45. package/build/combobox-control/index.js +1 -1
  46. package/build/combobox-control/index.js.map +1 -1
  47. package/build/composite/legacy/index.js +5 -2
  48. package/build/composite/legacy/index.js.map +1 -1
  49. package/build/context/context-connect.js +1 -0
  50. package/build/context/context-connect.js.map +1 -1
  51. package/build/context/context-system-provider.js +1 -1
  52. package/build/context/context-system-provider.js.map +1 -1
  53. package/build/context/get-styled-class-name-from-key.js.map +1 -1
  54. package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -1
  55. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  56. package/build/custom-gradient-picker/index.js.map +1 -1
  57. package/build/custom-gradient-picker/serializer.js.map +1 -1
  58. package/build/custom-gradient-picker/utils.js.map +1 -1
  59. package/build/custom-select-control-v2/styles.js.map +1 -1
  60. package/build/dashicon/index.js.map +1 -1
  61. package/build/date-time/date/index.js +0 -1
  62. package/build/date-time/date/index.js.map +1 -1
  63. package/build/date-time/date/styles.js.map +1 -1
  64. package/build/date-time/time/timezone.js.map +1 -1
  65. package/build/draggable/index.js.map +1 -1
  66. package/build/drop-zone/index.js +1 -2
  67. package/build/drop-zone/index.js.map +1 -1
  68. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  69. package/build/duotone-picker/utils.js.map +1 -1
  70. package/build/elevation/hook.js.map +1 -1
  71. package/build/external-link/index.js +20 -23
  72. package/build/external-link/index.js.map +1 -1
  73. package/build/focal-point-picker/index.js.map +1 -1
  74. package/build/focal-point-picker/index.native.js.map +1 -1
  75. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  76. package/build/font-size-picker/index.js.map +1 -1
  77. package/build/font-size-picker/index.native.js +6 -6
  78. package/build/font-size-picker/index.native.js.map +1 -1
  79. package/build/form-token-field/index.js +2 -4
  80. package/build/form-token-field/index.js.map +1 -1
  81. package/build/form-token-field/suggestions-list.js +7 -3
  82. package/build/form-token-field/suggestions-list.js.map +1 -1
  83. package/build/form-token-field/token-input.js.map +1 -1
  84. package/build/form-token-field/token.js +1 -1
  85. package/build/form-token-field/token.js.map +1 -1
  86. package/build/gradient-picker/index.js.map +1 -1
  87. package/build/grid/hook.js.map +1 -1
  88. package/build/guide/page-control.js +1 -1
  89. package/build/guide/page-control.js.map +1 -1
  90. package/build/h-stack/hook.js.map +1 -1
  91. package/build/heading/hook.js.map +1 -1
  92. package/build/input-control/index.js.map +1 -1
  93. package/build/input-control/input-base.js.map +1 -1
  94. package/build/input-control/styles/input-control-styles.js.map +1 -1
  95. package/build/item-group/styles.js.map +1 -1
  96. package/build/{dropdown-menu-v2 → menu}/checkbox-item.js +8 -8
  97. package/build/menu/checkbox-item.js.map +1 -0
  98. package/build/{dropdown-menu-v2 → menu}/context.js +2 -2
  99. package/build/menu/context.js.map +1 -0
  100. package/build/{dropdown-menu-v2 → menu}/group-label.js +5 -5
  101. package/build/menu/group-label.js.map +1 -0
  102. package/build/{dropdown-menu-v2 → menu}/group.js +5 -5
  103. package/build/menu/group.js.map +1 -0
  104. package/build/{dropdown-menu-v2 → menu}/index.js +38 -38
  105. package/build/menu/index.js.map +1 -0
  106. package/build/{dropdown-menu-v2 → menu}/item-help-text.js +3 -3
  107. package/build/menu/item-help-text.js.map +1 -0
  108. package/build/{dropdown-menu-v2 → menu}/item-label.js +3 -3
  109. package/build/menu/item-label.js.map +1 -0
  110. package/build/{dropdown-menu-v2 → menu}/item.js +7 -7
  111. package/build/menu/item.js.map +1 -0
  112. package/build/{dropdown-menu-v2 → menu}/radio-item.js +8 -8
  113. package/build/menu/radio-item.js.map +1 -0
  114. package/build/{dropdown-menu-v2 → menu}/separator.js +6 -6
  115. package/build/menu/separator.js.map +1 -0
  116. package/build/menu/styles.js +150 -0
  117. package/build/menu/styles.js.map +1 -0
  118. package/build/menu/types.js.map +1 -0
  119. package/build/menu/use-temporary-focus-visible-fix.js.map +1 -0
  120. package/build/menu-group/index.js.map +1 -1
  121. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
  122. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  123. package/build/mobile/bottom-sheet/cell.native.js +4 -4
  124. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  125. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  126. package/build/mobile/bottom-sheet/range-cell.native.js +1 -1
  127. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  128. package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  129. package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
  130. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  131. package/build/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
  132. package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  133. package/build/mobile/bottom-sheet/switch-cell.native.js +4 -4
  134. package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  135. package/build/mobile/bottom-sheet-select-control/index.native.js +2 -2
  136. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  137. package/build/mobile/color-settings/index.native.js +1 -3
  138. package/build/mobile/color-settings/index.native.js.map +1 -1
  139. package/build/mobile/color-settings/picker-screen.native.js +1 -3
  140. package/build/mobile/color-settings/picker-screen.native.js.map +1 -1
  141. package/build/mobile/cycle-select-control/index.native.js.map +1 -1
  142. package/build/mobile/gradient/index.native.js.map +1 -1
  143. package/build/mobile/image/index.native.js +1 -3
  144. package/build/mobile/image/index.native.js.map +1 -1
  145. package/build/mobile/keyboard-avoiding-view/index.ios.js +1 -3
  146. package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  147. package/build/mobile/link-picker/index.native.js +1 -1
  148. package/build/mobile/link-picker/index.native.js.map +1 -1
  149. package/build/mobile/link-picker/link-picker-results.native.js +2 -5
  150. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  151. package/build/mobile/link-picker/link-picker-screen.native.js +1 -3
  152. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  153. package/build/mobile/link-settings/index.native.js +6 -18
  154. package/build/mobile/link-settings/index.native.js.map +1 -1
  155. package/build/mobile/link-settings/link-settings-screen.native.js +1 -3
  156. package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  157. package/build/mobile/picker/index.android.js.map +1 -1
  158. package/build/mobile/segmented-control/index.native.js +2 -6
  159. package/build/mobile/segmented-control/index.native.js.map +1 -1
  160. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  161. package/build/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  162. package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  163. package/build/modal/aria-helper.js +2 -1
  164. package/build/modal/aria-helper.js.map +1 -1
  165. package/build/modal/index.js +2 -1
  166. package/build/modal/index.js.map +1 -1
  167. package/build/modal/use-modal-exit-animation.js.map +1 -1
  168. package/build/navigation/group/index.js.map +1 -1
  169. package/build/navigation/index.js +1 -2
  170. package/build/navigation/index.js.map +1 -1
  171. package/build/navigation/item/base.js.map +1 -1
  172. package/build/navigation/item/use-navigation-tree-item.js +2 -2
  173. package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
  174. package/build/navigation/menu/index.js.map +1 -1
  175. package/build/navigation/menu/menu-title-search.js +4 -4
  176. package/build/navigation/menu/menu-title-search.js.map +1 -1
  177. package/build/navigation/menu/menu-title.js.map +1 -1
  178. package/build/navigation/menu/use-navigation-tree-menu.js +2 -2
  179. package/build/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  180. package/build/navigation/styles/navigation-styles.js.map +1 -1
  181. package/build/navigator/navigator/component.js.map +1 -1
  182. package/build/navigator/navigator-button/hook.js.map +1 -1
  183. package/build/number-control/styles/number-control-styles.js.map +1 -1
  184. package/build/palette-edit/index.js +29 -4
  185. package/build/palette-edit/index.js.map +1 -1
  186. package/build/palette-edit/styles.js +13 -28
  187. package/build/palette-edit/styles.js.map +1 -1
  188. package/build/popover/index.js +1 -1
  189. package/build/popover/index.js.map +1 -1
  190. package/build/popover/overlay-middlewares.js.map +1 -1
  191. package/build/popover/utils.js.map +1 -1
  192. package/build/private-apis.js +4 -4
  193. package/build/private-apis.js.map +1 -1
  194. package/build/progress-bar/index.js.map +1 -1
  195. package/build/progress-bar/styles.js.map +1 -1
  196. package/build/query-controls/index.js.map +1 -1
  197. package/build/query-controls/index.native.js.map +1 -1
  198. package/build/radio-control/index.js.map +1 -1
  199. package/build/radio-control/index.native.js.map +1 -1
  200. package/build/radio-group/index.js +3 -1
  201. package/build/radio-group/index.js.map +1 -1
  202. package/build/range-control/index.js.map +1 -1
  203. package/build/range-control/index.native.js.map +1 -1
  204. package/build/range-control/rail.js.map +1 -1
  205. package/build/range-control/styles/range-control-styles.js +32 -32
  206. package/build/range-control/styles/range-control-styles.js.map +1 -1
  207. package/build/range-control/tooltip.js +1 -1
  208. package/build/range-control/tooltip.js.map +1 -1
  209. package/build/range-control/utils.js.map +1 -1
  210. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  211. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  212. package/build/responsive-wrapper/index.js.map +1 -1
  213. package/build/sandbox/index.js +3 -6
  214. package/build/sandbox/index.js.map +1 -1
  215. package/build/sandbox/index.native.js +1 -3
  216. package/build/sandbox/index.native.js.map +1 -1
  217. package/build/search-control/index.js +6 -0
  218. package/build/search-control/index.js.map +1 -1
  219. package/build/search-control/index.native.js +1 -3
  220. package/build/search-control/index.native.js.map +1 -1
  221. package/build/search-control/types.js.map +1 -1
  222. package/build/select-control/index.js.map +1 -1
  223. package/build/select-control/index.native.js.map +1 -1
  224. package/build/slot-fill/bubbles-virtually/slot.js +1 -2
  225. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  226. package/build/slot-fill/fill.js +3 -6
  227. package/build/slot-fill/fill.js.map +1 -1
  228. package/build/slot-fill/index.js.map +1 -1
  229. package/build/spacer/hook.js +5 -3
  230. package/build/spacer/hook.js.map +1 -1
  231. package/build/spinner/styles.js.map +1 -1
  232. package/build/style-provider/index.js +1 -0
  233. package/build/style-provider/index.js.map +1 -1
  234. package/build/surface/hook.js.map +1 -1
  235. package/build/surface/styles.js.map +1 -1
  236. package/build/tab-panel/index.js +4 -1
  237. package/build/tab-panel/index.js.map +1 -1
  238. package/build/tabs/index.js +48 -113
  239. package/build/tabs/index.js.map +1 -1
  240. package/build/tabs/styles.js +31 -13
  241. package/build/tabs/styles.js.map +1 -1
  242. package/build/tabs/tab.js +30 -8
  243. package/build/tabs/tab.js.map +1 -1
  244. package/build/tabs/tablist.js +67 -56
  245. package/build/tabs/tablist.js.map +1 -1
  246. package/build/tabs/tabpanel.js.map +1 -1
  247. package/build/tabs/types.js.map +1 -1
  248. package/build/text/get-line-height.js.map +1 -1
  249. package/build/text/styles/text-mixins.native.js.map +1 -1
  250. package/build/text/utils.js.map +1 -1
  251. package/build/text-control/index.native.js.map +1 -1
  252. package/build/text-highlight/index.js.map +1 -1
  253. package/build/textarea-control/index.js.map +1 -1
  254. package/build/theme/color-algorithms.js.map +1 -1
  255. package/build/theme/styles.js.map +1 -1
  256. package/build/toggle-control/index.js.map +1 -1
  257. package/build/toggle-control/index.native.js.map +1 -1
  258. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +9 -1
  259. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  260. package/build/toggle-group-control/toggle-group-control/component.js +4 -61
  261. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  262. package/build/toggle-group-control/toggle-group-control-option-base/component.js +10 -10
  263. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  264. package/build/toggle-group-control/types.js.map +1 -1
  265. package/build/toolbar/toolbar/index.js +3 -0
  266. package/build/toolbar/toolbar/index.js.map +1 -1
  267. package/build/tools-panel/styles.js.map +1 -1
  268. package/build/tools-panel/tools-panel-header/component.js +1 -1
  269. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  270. package/build/tools-panel/tools-panel-item/hook.js +0 -2
  271. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  272. package/build/tooltip/index.js +5 -1
  273. package/build/tooltip/index.js.map +1 -1
  274. package/build/tooltip/index.native.js +5 -15
  275. package/build/tooltip/index.native.js.map +1 -1
  276. package/build/unit-control/index.js.map +1 -1
  277. package/build/unit-control/index.native.js +2 -6
  278. package/build/unit-control/index.native.js.map +1 -1
  279. package/build/unit-control/utils.js.map +1 -1
  280. package/build/utils/breakpoint.js.map +1 -1
  281. package/build/utils/colors-values.js.map +1 -1
  282. package/build/utils/config-values.js.map +1 -1
  283. package/build/utils/deprecated-36px-size.js +27 -0
  284. package/build/utils/deprecated-36px-size.js.map +1 -0
  285. package/build/utils/element-rect.js +13 -2
  286. package/build/utils/element-rect.js.map +1 -1
  287. package/build/utils/font-size.js.map +1 -1
  288. package/build/utils/hooks/use-animated-offset-rect.js +81 -0
  289. package/build/utils/hooks/use-animated-offset-rect.js.map +1 -0
  290. package/build/utils/hooks/use-cx.js.map +1 -1
  291. package/build/utils/hooks/use-update-effect.js +0 -2
  292. package/build/utils/hooks/use-update-effect.js.map +1 -1
  293. package/build/utils/math.js +2 -2
  294. package/build/utils/math.js.map +1 -1
  295. package/build/utils/space.js.map +1 -1
  296. package/build/utils/unit-values.js.map +1 -1
  297. package/build/utils/use-responsive-value.js.map +1 -1
  298. package/build-module/alignment-matrix-control/cell.js +1 -2
  299. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  300. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  301. package/build-module/alignment-matrix-control/types.js.map +1 -1
  302. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  303. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  304. package/build-module/angle-picker-control/index.js +1 -2
  305. package/build-module/angle-picker-control/index.js.map +1 -1
  306. package/build-module/autocomplete/autocompleter-ui.js +6 -12
  307. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  308. package/build-module/autocomplete/autocompleter-ui.native.js +3 -6
  309. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  310. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  311. package/build-module/autocomplete/index.js +6 -8
  312. package/build-module/autocomplete/index.js.map +1 -1
  313. package/build-module/base-control/hooks.js.map +1 -1
  314. package/build-module/base-control/index.js +1 -2
  315. package/build-module/base-control/index.js.map +1 -1
  316. package/build-module/base-control/index.native.js +1 -2
  317. package/build-module/base-control/index.native.js.map +1 -1
  318. package/build-module/base-control/types.js.map +1 -1
  319. package/build-module/border-box-control/border-box-control/component.js +2 -2
  320. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  321. package/build-module/border-box-control/border-box-control/hook.js +6 -0
  322. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  323. package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -2
  324. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  325. package/build-module/border-box-control/styles.js.map +1 -1
  326. package/build-module/border-box-control/utils.js.map +1 -1
  327. package/build-module/border-control/border-control/component.js +2 -2
  328. package/build-module/border-control/border-control/component.js.map +1 -1
  329. package/build-module/border-control/border-control/hook.js +7 -0
  330. package/build-module/border-control/border-control/hook.js.map +1 -1
  331. package/build-module/border-control/border-control-dropdown/component.js +13 -15
  332. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  333. package/build-module/border-control/styles.js.map +1 -1
  334. package/build-module/box-control/all-input-control.js +1 -3
  335. package/build-module/box-control/all-input-control.js.map +1 -1
  336. package/build-module/box-control/axial-input-controls.js +1 -3
  337. package/build-module/box-control/axial-input-controls.js.map +1 -1
  338. package/build-module/box-control/icon.js +1 -2
  339. package/build-module/box-control/icon.js.map +1 -1
  340. package/build-module/box-control/index.js +1 -2
  341. package/build-module/box-control/index.js.map +1 -1
  342. package/build-module/box-control/input-controls.js +1 -3
  343. package/build-module/box-control/input-controls.js.map +1 -1
  344. package/build-module/button/index.js +1 -3
  345. package/build-module/button/index.js.map +1 -1
  346. package/build-module/button/index.native.js +2 -3
  347. package/build-module/button/index.native.js.map +1 -1
  348. package/build-module/card/card/component.js +2 -3
  349. package/build-module/card/card/component.js.map +1 -1
  350. package/build-module/card/styles.js.map +1 -1
  351. package/build-module/checkbox-control/index.js +1 -2
  352. package/build-module/checkbox-control/index.js.map +1 -1
  353. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -2
  354. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  355. package/build-module/circular-option-picker/circular-option-picker.js +1 -2
  356. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  357. package/build-module/color-indicator/index.native.js +1 -2
  358. package/build-module/color-indicator/index.native.js.map +1 -1
  359. package/build-module/color-palette/index.js +2 -3
  360. package/build-module/color-palette/index.js.map +1 -1
  361. package/build-module/color-palette/index.native.js +4 -6
  362. package/build-module/color-palette/index.native.js.map +1 -1
  363. package/build-module/color-picker/component.js +1 -2
  364. package/build-module/color-picker/component.js.map +1 -1
  365. package/build-module/color-picker/hsl-input.js +1 -3
  366. package/build-module/color-picker/hsl-input.js.map +1 -1
  367. package/build-module/color-picker/hsv-color-picker.native.js +1 -2
  368. package/build-module/color-picker/hsv-color-picker.native.js.map +1 -1
  369. package/build-module/color-picker/hue-picker.native.js +1 -2
  370. package/build-module/color-picker/hue-picker.native.js.map +1 -1
  371. package/build-module/color-picker/index.native.js +1 -4
  372. package/build-module/color-picker/index.native.js.map +1 -1
  373. package/build-module/color-picker/input-with-slider.js +1 -2
  374. package/build-module/color-picker/input-with-slider.js.map +1 -1
  375. package/build-module/color-picker/rgb-input.js +1 -3
  376. package/build-module/color-picker/rgb-input.js.map +1 -1
  377. package/build-module/color-picker/saturation-picker.native.js +1 -2
  378. package/build-module/color-picker/saturation-picker.native.js.map +1 -1
  379. package/build-module/color-picker/styles.js.map +1 -1
  380. package/build-module/combobox-control/index.js +2 -3
  381. package/build-module/combobox-control/index.js.map +1 -1
  382. package/build-module/composite/legacy/index.js +5 -2
  383. package/build-module/composite/legacy/index.js.map +1 -1
  384. package/build-module/confirm-dialog/component.js +1 -3
  385. package/build-module/confirm-dialog/component.js.map +1 -1
  386. package/build-module/context/context-connect.js +1 -0
  387. package/build-module/context/context-connect.js.map +1 -1
  388. package/build-module/context/context-system-provider.js +1 -1
  389. package/build-module/context/context-system-provider.js.map +1 -1
  390. package/build-module/context/get-styled-class-name-from-key.js.map +1 -1
  391. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +2 -4
  392. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  393. package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -2
  394. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  395. package/build-module/custom-gradient-picker/index.js +1 -2
  396. package/build-module/custom-gradient-picker/index.js.map +1 -1
  397. package/build-module/custom-gradient-picker/index.native.js +1 -3
  398. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  399. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  400. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  401. package/build-module/custom-select-control/index.js +1 -3
  402. package/build-module/custom-select-control/index.js.map +1 -1
  403. package/build-module/custom-select-control-v2/custom-select.js +1 -2
  404. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  405. package/build-module/custom-select-control-v2/item.js +1 -2
  406. package/build-module/custom-select-control-v2/item.js.map +1 -1
  407. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  408. package/build-module/dashicon/index.js.map +1 -1
  409. package/build-module/date-time/date/index.js +1 -3
  410. package/build-module/date-time/date/index.js.map +1 -1
  411. package/build-module/date-time/date/styles.js.map +1 -1
  412. package/build-module/date-time/date-time/index.js +1 -3
  413. package/build-module/date-time/date-time/index.js.map +1 -1
  414. package/build-module/date-time/time/index.js +1 -2
  415. package/build-module/date-time/time/index.js.map +1 -1
  416. package/build-module/date-time/time/time-input/index.js +1 -2
  417. package/build-module/date-time/time/time-input/index.js.map +1 -1
  418. package/build-module/date-time/time/timezone.js.map +1 -1
  419. package/build-module/dimension-control/index.js +1 -3
  420. package/build-module/dimension-control/index.js.map +1 -1
  421. package/build-module/draggable/index.js +1 -3
  422. package/build-module/draggable/index.js.map +1 -1
  423. package/build-module/drop-zone/index.js +2 -4
  424. package/build-module/drop-zone/index.js.map +1 -1
  425. package/build-module/dropdown/index.js +1 -2
  426. package/build-module/dropdown/index.js.map +1 -1
  427. package/build-module/dropdown/index.native.js +1 -2
  428. package/build-module/dropdown/index.native.js.map +1 -1
  429. package/build-module/dropdown-menu/index.js +1 -2
  430. package/build-module/dropdown-menu/index.js.map +1 -1
  431. package/build-module/dropdown-menu/index.native.js +1 -2
  432. package/build-module/dropdown-menu/index.native.js.map +1 -1
  433. package/build-module/duotone-picker/color-list-picker/index.js +1 -3
  434. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  435. package/build-module/duotone-picker/duotone-picker.js +1 -2
  436. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  437. package/build-module/duotone-picker/utils.js.map +1 -1
  438. package/build-module/elevation/hook.js.map +1 -1
  439. package/build-module/external-link/index.js +21 -25
  440. package/build-module/external-link/index.js.map +1 -1
  441. package/build-module/external-link/index.native.js +1 -2
  442. package/build-module/external-link/index.native.js.map +1 -1
  443. package/build-module/focal-point-picker/controls.js +1 -2
  444. package/build-module/focal-point-picker/controls.js.map +1 -1
  445. package/build-module/focal-point-picker/focal-point.native.js +1 -2
  446. package/build-module/focal-point-picker/focal-point.native.js.map +1 -1
  447. package/build-module/focal-point-picker/grid.js +1 -2
  448. package/build-module/focal-point-picker/grid.js.map +1 -1
  449. package/build-module/focal-point-picker/index.js +1 -2
  450. package/build-module/focal-point-picker/index.js.map +1 -1
  451. package/build-module/focal-point-picker/index.native.js +1 -2
  452. package/build-module/focal-point-picker/index.native.js.map +1 -1
  453. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  454. package/build-module/focal-point-picker/tooltip/index.native.js +1 -2
  455. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  456. package/build-module/font-size-picker/index.js +1 -2
  457. package/build-module/font-size-picker/index.js.map +1 -1
  458. package/build-module/font-size-picker/index.native.js +8 -10
  459. package/build-module/font-size-picker/index.native.js.map +1 -1
  460. package/build-module/form-file-upload/index.js +1 -2
  461. package/build-module/form-file-upload/index.js.map +1 -1
  462. package/build-module/form-toggle/index.js +1 -2
  463. package/build-module/form-toggle/index.js.map +1 -1
  464. package/build-module/form-token-field/index.js +3 -6
  465. package/build-module/form-token-field/index.js.map +1 -1
  466. package/build-module/form-token-field/suggestions-list.js +8 -5
  467. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  468. package/build-module/form-token-field/token-input.js.map +1 -1
  469. package/build-module/form-token-field/token.js +2 -3
  470. package/build-module/form-token-field/token.js.map +1 -1
  471. package/build-module/gradient-picker/index.js +1 -2
  472. package/build-module/gradient-picker/index.js.map +1 -1
  473. package/build-module/grid/hook.js.map +1 -1
  474. package/build-module/guide/index.js +1 -2
  475. package/build-module/guide/index.js.map +1 -1
  476. package/build-module/guide/page-control.js +1 -1
  477. package/build-module/guide/page-control.js.map +1 -1
  478. package/build-module/h-stack/hook.js.map +1 -1
  479. package/build-module/heading/hook.js.map +1 -1
  480. package/build-module/higher-order/with-fallback-styles/index.js +3 -4
  481. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  482. package/build-module/input-control/index.js.map +1 -1
  483. package/build-module/input-control/input-base.js +1 -2
  484. package/build-module/input-control/input-base.js.map +1 -1
  485. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  486. package/build-module/item-group/styles.js.map +1 -1
  487. package/build-module/keyboard-shortcuts/index.js +1 -3
  488. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  489. package/build-module/{dropdown-menu-v2 → menu}/checkbox-item.js +9 -10
  490. package/build-module/menu/checkbox-item.js.map +1 -0
  491. package/build-module/{dropdown-menu-v2 → menu}/context.js +1 -1
  492. package/build-module/menu/context.js.map +1 -0
  493. package/build-module/{dropdown-menu-v2 → menu}/group-label.js +5 -5
  494. package/build-module/menu/group-label.js.map +1 -0
  495. package/build-module/menu/group.js +21 -0
  496. package/build-module/menu/group.js.map +1 -0
  497. package/build-module/{dropdown-menu-v2 → menu}/index.js +47 -49
  498. package/build-module/menu/index.js.map +1 -0
  499. package/build-module/{dropdown-menu-v2 → menu}/item-help-text.js +2 -2
  500. package/build-module/menu/item-help-text.js.map +1 -0
  501. package/build-module/{dropdown-menu-v2 → menu}/item-label.js +2 -2
  502. package/build-module/menu/item-label.js.map +1 -0
  503. package/build-module/{dropdown-menu-v2 → menu}/item.js +8 -9
  504. package/build-module/menu/item.js.map +1 -0
  505. package/build-module/{dropdown-menu-v2 → menu}/radio-item.js +9 -10
  506. package/build-module/menu/radio-item.js.map +1 -0
  507. package/build-module/menu/separator.js +22 -0
  508. package/build-module/menu/separator.js.map +1 -0
  509. package/build-module/menu/styles.js +143 -0
  510. package/build-module/menu/styles.js.map +1 -0
  511. package/build-module/menu/types.js.map +1 -0
  512. package/build-module/menu/use-temporary-focus-visible-fix.js.map +1 -0
  513. package/build-module/menu-group/index.js +1 -2
  514. package/build-module/menu-group/index.js.map +1 -1
  515. package/build-module/menu-item/index.js +1 -2
  516. package/build-module/menu-item/index.js.map +1 -1
  517. package/build-module/menu-items-choice/index.js +1 -2
  518. package/build-module/menu-items-choice/index.js.map +1 -1
  519. package/build-module/mobile/badge/index.native.js +1 -3
  520. package/build-module/mobile/badge/index.native.js.map +1 -1
  521. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +4 -7
  522. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  523. package/build-module/mobile/bottom-sheet/cell.native.js +5 -6
  524. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  525. package/build-module/mobile/bottom-sheet/color-cell.native.js +1 -2
  526. package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
  527. package/build-module/mobile/bottom-sheet/index.native.js +1 -3
  528. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  529. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -2
  530. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  531. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -2
  532. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  533. package/build-module/mobile/bottom-sheet/range-cell.native.js +2 -3
  534. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  535. package/build-module/mobile/bottom-sheet/range-text-input.native.js +1 -2
  536. package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  537. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +2 -3
  538. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  539. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js +1 -2
  540. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
  541. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js +1 -2
  542. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
  543. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +2 -6
  544. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  545. package/build-module/mobile/bottom-sheet/switch-cell.native.js +4 -4
  546. package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  547. package/build-module/mobile/bottom-sheet-select-control/index.native.js +3 -5
  548. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  549. package/build-module/mobile/bottom-sheet-text-control/index.native.js +1 -3
  550. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  551. package/build-module/mobile/color-settings/gradient-picker-screen.native.js +1 -2
  552. package/build-module/mobile/color-settings/gradient-picker-screen.native.js.map +1 -1
  553. package/build-module/mobile/color-settings/index.native.js +2 -5
  554. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  555. package/build-module/mobile/color-settings/palette.screen.native.js +1 -3
  556. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  557. package/build-module/mobile/color-settings/picker-screen.native.js +1 -3
  558. package/build-module/mobile/color-settings/picker-screen.native.js.map +1 -1
  559. package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
  560. package/build-module/mobile/focal-point-settings-panel/index.native.js +1 -2
  561. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  562. package/build-module/mobile/gradient/index.native.js +1 -2
  563. package/build-module/mobile/gradient/index.native.js.map +1 -1
  564. package/build-module/mobile/html-text-input/index.native.js +1 -2
  565. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  566. package/build-module/mobile/image/icon-retry.native.js +1 -2
  567. package/build-module/mobile/image/icon-retry.native.js.map +1 -1
  568. package/build-module/mobile/image/image-editing-button.native.js +1 -2
  569. package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
  570. package/build-module/mobile/image/index.native.js +2 -6
  571. package/build-module/mobile/image/index.native.js.map +1 -1
  572. package/build-module/mobile/keyboard-avoiding-view/index.ios.js +2 -5
  573. package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  574. package/build-module/mobile/link-picker/index.native.js +2 -3
  575. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  576. package/build-module/mobile/link-picker/link-picker-results.native.js +2 -5
  577. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  578. package/build-module/mobile/link-picker/link-picker-screen.native.js +1 -3
  579. package/build-module/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  580. package/build-module/mobile/link-settings/index.native.js +7 -21
  581. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  582. package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -2
  583. package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  584. package/build-module/mobile/link-settings/link-settings-screen.native.js +1 -3
  585. package/build-module/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  586. package/build-module/mobile/picker/index.android.js +1 -2
  587. package/build-module/mobile/picker/index.android.js.map +1 -1
  588. package/build-module/mobile/segmented-control/index.native.js +3 -8
  589. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  590. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  591. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  592. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  593. package/build-module/modal/aria-helper.js +2 -1
  594. package/build-module/modal/aria-helper.js.map +1 -1
  595. package/build-module/modal/index.js +3 -4
  596. package/build-module/modal/index.js.map +1 -1
  597. package/build-module/modal/use-modal-exit-animation.js.map +1 -1
  598. package/build-module/navigation/back-button/index.js +1 -2
  599. package/build-module/navigation/back-button/index.js.map +1 -1
  600. package/build-module/navigation/group/index.js +1 -2
  601. package/build-module/navigation/group/index.js.map +1 -1
  602. package/build-module/navigation/index.js +1 -2
  603. package/build-module/navigation/index.js.map +1 -1
  604. package/build-module/navigation/item/base-content.js +1 -3
  605. package/build-module/navigation/item/base-content.js.map +1 -1
  606. package/build-module/navigation/item/base.js.map +1 -1
  607. package/build-module/navigation/item/index.js +1 -2
  608. package/build-module/navigation/item/index.js.map +1 -1
  609. package/build-module/navigation/item/use-navigation-tree-item.js +2 -2
  610. package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
  611. package/build-module/navigation/menu/index.js +1 -2
  612. package/build-module/navigation/menu/index.js.map +1 -1
  613. package/build-module/navigation/menu/menu-title-search.js +4 -4
  614. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  615. package/build-module/navigation/menu/menu-title.js +1 -2
  616. package/build-module/navigation/menu/menu-title.js.map +1 -1
  617. package/build-module/navigation/menu/search-no-results-found.js +1 -2
  618. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  619. package/build-module/navigation/menu/use-navigation-tree-menu.js +2 -2
  620. package/build-module/navigation/menu/use-navigation-tree-menu.js.map +1 -1
  621. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  622. package/build-module/navigator/navigator/component.js.map +1 -1
  623. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  624. package/build-module/notice/index.js +1 -2
  625. package/build-module/notice/index.js.map +1 -1
  626. package/build-module/notice/index.native.js +1 -3
  627. package/build-module/notice/index.native.js.map +1 -1
  628. package/build-module/number-control/index.js +1 -3
  629. package/build-module/number-control/index.js.map +1 -1
  630. package/build-module/number-control/styles/number-control-styles.js.map +1 -1
  631. package/build-module/palette-edit/index.js +31 -9
  632. package/build-module/palette-edit/index.js.map +1 -1
  633. package/build-module/palette-edit/styles.js +13 -29
  634. package/build-module/palette-edit/styles.js.map +1 -1
  635. package/build-module/panel/actions.native.js +1 -2
  636. package/build-module/panel/actions.native.js.map +1 -1
  637. package/build-module/panel/body.js +1 -2
  638. package/build-module/panel/body.js.map +1 -1
  639. package/build-module/panel/body.native.js +1 -2
  640. package/build-module/panel/body.native.js.map +1 -1
  641. package/build-module/panel/header.js +1 -2
  642. package/build-module/panel/header.js.map +1 -1
  643. package/build-module/panel/index.js +1 -2
  644. package/build-module/panel/index.js.map +1 -1
  645. package/build-module/placeholder/index.js +1 -2
  646. package/build-module/placeholder/index.js.map +1 -1
  647. package/build-module/popover/index.js +2 -4
  648. package/build-module/popover/index.js.map +1 -1
  649. package/build-module/popover/overlay-middlewares.js.map +1 -1
  650. package/build-module/popover/utils.js.map +1 -1
  651. package/build-module/private-apis.js +3 -3
  652. package/build-module/private-apis.js.map +1 -1
  653. package/build-module/progress-bar/index.js +1 -2
  654. package/build-module/progress-bar/index.js.map +1 -1
  655. package/build-module/progress-bar/styles.js.map +1 -1
  656. package/build-module/query-controls/index.js.map +1 -1
  657. package/build-module/query-controls/index.native.js +1 -3
  658. package/build-module/query-controls/index.native.js.map +1 -1
  659. package/build-module/radio-control/index.js +1 -2
  660. package/build-module/radio-control/index.js.map +1 -1
  661. package/build-module/radio-control/index.native.js +1 -2
  662. package/build-module/radio-control/index.native.js.map +1 -1
  663. package/build-module/radio-group/index.js +3 -1
  664. package/build-module/radio-group/index.js.map +1 -1
  665. package/build-module/range-control/index.js +1 -2
  666. package/build-module/range-control/index.js.map +1 -1
  667. package/build-module/range-control/index.native.js.map +1 -1
  668. package/build-module/range-control/mark.js +1 -3
  669. package/build-module/range-control/mark.js.map +1 -1
  670. package/build-module/range-control/rail.js +1 -3
  671. package/build-module/range-control/rail.js.map +1 -1
  672. package/build-module/range-control/styles/range-control-styles.js +32 -32
  673. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  674. package/build-module/range-control/tooltip.js +1 -1
  675. package/build-module/range-control/tooltip.js.map +1 -1
  676. package/build-module/range-control/utils.js.map +1 -1
  677. package/build-module/resizable-box/index.js +1 -2
  678. package/build-module/resizable-box/index.js.map +1 -1
  679. package/build-module/resizable-box/resize-tooltip/index.js +1 -2
  680. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  681. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  682. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  683. package/build-module/responsive-wrapper/index.js.map +1 -1
  684. package/build-module/sandbox/index.js +4 -8
  685. package/build-module/sandbox/index.js.map +1 -1
  686. package/build-module/sandbox/index.native.js +2 -5
  687. package/build-module/sandbox/index.native.js.map +1 -1
  688. package/build-module/search-control/index.js +6 -0
  689. package/build-module/search-control/index.js.map +1 -1
  690. package/build-module/search-control/index.native.js +2 -5
  691. package/build-module/search-control/index.native.js.map +1 -1
  692. package/build-module/search-control/types.js.map +1 -1
  693. package/build-module/select-control/index.js.map +1 -1
  694. package/build-module/select-control/index.native.js.map +1 -1
  695. package/build-module/slot-fill/bubbles-virtually/slot.js +1 -2
  696. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  697. package/build-module/slot-fill/fill.js +3 -6
  698. package/build-module/slot-fill/fill.js.map +1 -1
  699. package/build-module/slot-fill/index.js +1 -3
  700. package/build-module/slot-fill/index.js.map +1 -1
  701. package/build-module/slot-fill/slot.js +1 -2
  702. package/build-module/slot-fill/slot.js.map +1 -1
  703. package/build-module/snackbar/index.js +1 -2
  704. package/build-module/snackbar/index.js.map +1 -1
  705. package/build-module/snackbar/list.js +1 -2
  706. package/build-module/snackbar/list.js.map +1 -1
  707. package/build-module/spacer/hook.js +5 -3
  708. package/build-module/spacer/hook.js.map +1 -1
  709. package/build-module/spinner/index.js +1 -2
  710. package/build-module/spinner/index.js.map +1 -1
  711. package/build-module/spinner/styles.js.map +1 -1
  712. package/build-module/style-provider/index.js +1 -0
  713. package/build-module/style-provider/index.js.map +1 -1
  714. package/build-module/surface/hook.js.map +1 -1
  715. package/build-module/surface/styles.js.map +1 -1
  716. package/build-module/tab-panel/index.js +5 -3
  717. package/build-module/tab-panel/index.js.map +1 -1
  718. package/build-module/tabs/index.js +47 -112
  719. package/build-module/tabs/index.js.map +1 -1
  720. package/build-module/tabs/styles.js +29 -7
  721. package/build-module/tabs/styles.js.map +1 -1
  722. package/build-module/tabs/tab.js +30 -10
  723. package/build-module/tabs/tab.js.map +1 -1
  724. package/build-module/tabs/tablist.js +67 -56
  725. package/build-module/tabs/tablist.js.map +1 -1
  726. package/build-module/tabs/tabpanel.js.map +1 -1
  727. package/build-module/tabs/types.js.map +1 -1
  728. package/build-module/text/get-line-height.js.map +1 -1
  729. package/build-module/text/styles/text-mixins.native.js.map +1 -1
  730. package/build-module/text/utils.js.map +1 -1
  731. package/build-module/text-control/index.native.js.map +1 -1
  732. package/build-module/text-highlight/index.js +1 -2
  733. package/build-module/text-highlight/index.js.map +1 -1
  734. package/build-module/textarea-control/index.js.map +1 -1
  735. package/build-module/theme/color-algorithms.js.map +1 -1
  736. package/build-module/theme/styles.js.map +1 -1
  737. package/build-module/tip/index.js +1 -2
  738. package/build-module/tip/index.js.map +1 -1
  739. package/build-module/toggle-control/index.js +1 -2
  740. package/build-module/toggle-control/index.js.map +1 -1
  741. package/build-module/toggle-control/index.native.js.map +1 -1
  742. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +10 -2
  743. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  744. package/build-module/toggle-group-control/toggle-group-control/component.js +6 -66
  745. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  746. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +11 -12
  747. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  748. package/build-module/toggle-group-control/types.js.map +1 -1
  749. package/build-module/toolbar/toolbar/index.js +3 -0
  750. package/build-module/toolbar/toolbar/index.js.map +1 -1
  751. package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js +2 -2
  752. package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js.map +1 -1
  753. package/build-module/toolbar/toolbar-group/index.js +1 -2
  754. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  755. package/build-module/tools-panel/styles.js.map +1 -1
  756. package/build-module/tools-panel/tools-panel/component.js +1 -2
  757. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  758. package/build-module/tools-panel/tools-panel-header/component.js +2 -4
  759. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  760. package/build-module/tools-panel/tools-panel-item/hook.js +0 -2
  761. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  762. package/build-module/tooltip/index.js +6 -3
  763. package/build-module/tooltip/index.js.map +1 -1
  764. package/build-module/tooltip/index.native.js +6 -18
  765. package/build-module/tooltip/index.native.js.map +1 -1
  766. package/build-module/tree-grid/cell.js +1 -2
  767. package/build-module/tree-grid/cell.js.map +1 -1
  768. package/build-module/unit-control/index.js.map +1 -1
  769. package/build-module/unit-control/index.native.js +3 -9
  770. package/build-module/unit-control/index.native.js.map +1 -1
  771. package/build-module/unit-control/utils.js.map +1 -1
  772. package/build-module/utils/breakpoint.js.map +1 -1
  773. package/build-module/utils/colors-values.js.map +1 -1
  774. package/build-module/utils/config-values.js.map +1 -1
  775. package/build-module/utils/deprecated-36px-size.js +19 -0
  776. package/build-module/utils/deprecated-36px-size.js.map +1 -0
  777. package/build-module/utils/element-rect.js +13 -2
  778. package/build-module/utils/element-rect.js.map +1 -1
  779. package/build-module/utils/font-size.js.map +1 -1
  780. package/build-module/utils/hooks/use-animated-offset-rect.js +75 -0
  781. package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -0
  782. package/build-module/utils/hooks/use-cx.js.map +1 -1
  783. package/build-module/utils/hooks/use-update-effect.js +0 -2
  784. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  785. package/build-module/utils/math.js +2 -2
  786. package/build-module/utils/math.js.map +1 -1
  787. package/build-module/utils/space.js.map +1 -1
  788. package/build-module/utils/unit-values.js.map +1 -1
  789. package/build-module/utils/use-responsive-value.js.map +1 -1
  790. package/build-style/style-rtl.css +14 -11
  791. package/build-style/style.css +14 -11
  792. package/build-types/alignment-matrix-control/types.d.ts +2 -0
  793. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  794. package/build-types/animate/stories/index.story.d.ts.map +1 -1
  795. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  796. package/build-types/autocomplete/index.d.ts.map +1 -1
  797. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  798. package/build-types/base-control/types.d.ts +3 -0
  799. package/build-types/base-control/types.d.ts.map +1 -1
  800. package/build-types/border-box-control/border-box-control/component.d.ts +1 -0
  801. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  802. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  803. package/build-types/border-control/border-control/component.d.ts +1 -0
  804. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  805. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  806. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  807. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  808. package/build-types/button/stories/index.story.d.ts.map +1 -1
  809. package/build-types/card/stories/index.story.d.ts.map +1 -1
  810. package/build-types/composite/legacy/index.d.ts.map +1 -1
  811. package/build-types/composite/stories/index.story.d.ts.map +1 -1
  812. package/build-types/date-time/date/index.d.ts.map +1 -1
  813. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  814. package/build-types/draggable/stories/index.story.d.ts.map +1 -1
  815. package/build-types/drop-zone/index.d.ts.map +1 -1
  816. package/build-types/form-token-field/index.d.ts.map +1 -1
  817. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  818. package/build-types/item-group/stories/index.story.d.ts +1 -1
  819. package/build-types/item-group/stories/index.story.d.ts.map +1 -1
  820. package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
  821. package/build-types/menu/checkbox-item.d.ts +3 -0
  822. package/build-types/menu/checkbox-item.d.ts.map +1 -0
  823. package/build-types/menu/context.d.ts +6 -0
  824. package/build-types/menu/context.d.ts.map +1 -0
  825. package/build-types/menu/group-label.d.ts +3 -0
  826. package/build-types/menu/group-label.d.ts.map +1 -0
  827. package/build-types/menu/group.d.ts +3 -0
  828. package/build-types/menu/group.d.ts.map +1 -0
  829. package/build-types/menu/index.d.ts +40 -0
  830. package/build-types/menu/index.d.ts.map +1 -0
  831. package/build-types/{dropdown-menu-v2 → menu}/item-help-text.d.ts +1 -1
  832. package/build-types/menu/item-help-text.d.ts.map +1 -0
  833. package/build-types/{dropdown-menu-v2 → menu}/item-label.d.ts +1 -1
  834. package/build-types/menu/item-label.d.ts.map +1 -0
  835. package/build-types/menu/item.d.ts +3 -0
  836. package/build-types/menu/item.d.ts.map +1 -0
  837. package/build-types/menu/radio-item.d.ts +3 -0
  838. package/build-types/menu/radio-item.d.ts.map +1 -0
  839. package/build-types/menu/separator.d.ts +3 -0
  840. package/build-types/menu/separator.d.ts.map +1 -0
  841. package/build-types/menu/stories/index.story.d.ts +16 -0
  842. package/build-types/menu/stories/index.story.d.ts.map +1 -0
  843. package/build-types/{dropdown-menu-v2 → menu}/styles.d.ts +13 -13
  844. package/build-types/menu/styles.d.ts.map +1 -0
  845. package/build-types/menu/test/index.d.ts.map +1 -0
  846. package/build-types/{dropdown-menu-v2 → menu}/types.d.ts +22 -21
  847. package/build-types/menu/types.d.ts.map +1 -0
  848. package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +1 -0
  849. package/build-types/modal/aria-helper.d.ts.map +1 -1
  850. package/build-types/navigable-container/stories/navigable-menu.story.d.ts.map +1 -1
  851. package/build-types/navigable-container/stories/tabbable-container.story.d.ts.map +1 -1
  852. package/build-types/navigation/index.d.ts.map +1 -1
  853. package/build-types/palette-edit/index.d.ts +3 -0
  854. package/build-types/palette-edit/index.d.ts.map +1 -1
  855. package/build-types/palette-edit/styles.d.ts +0 -256
  856. package/build-types/palette-edit/styles.d.ts.map +1 -1
  857. package/build-types/panel/stories/index.story.d.ts.map +1 -1
  858. package/build-types/radio-group/index.d.ts.map +1 -1
  859. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  860. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  861. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  862. package/build-types/sandbox/index.d.ts.map +1 -1
  863. package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
  864. package/build-types/scroll-lock/stories/index.story.d.ts.map +1 -1
  865. package/build-types/search-control/index.d.ts.map +1 -1
  866. package/build-types/search-control/stories/index.story.d.ts +0 -8
  867. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  868. package/build-types/search-control/types.d.ts +3 -0
  869. package/build-types/search-control/types.d.ts.map +1 -1
  870. package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
  871. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  872. package/build-types/slot-fill/fill.d.ts.map +1 -1
  873. package/build-types/slot-fill/stories/index.story.d.ts.map +1 -1
  874. package/build-types/spacer/hook.d.ts.map +1 -1
  875. package/build-types/tab-panel/index.d.ts.map +1 -1
  876. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  877. package/build-types/tabs/index.d.ts +21 -8
  878. package/build-types/tabs/index.d.ts.map +1 -1
  879. package/build-types/tabs/stories/index.story.d.ts +1 -1
  880. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  881. package/build-types/tabs/styles.d.ts +13 -3
  882. package/build-types/tabs/styles.d.ts.map +1 -1
  883. package/build-types/tabs/tab.d.ts +0 -3
  884. package/build-types/tabs/tab.d.ts.map +1 -1
  885. package/build-types/tabs/tablist.d.ts.map +1 -1
  886. package/build-types/tabs/types.d.ts +85 -48
  887. package/build-types/tabs/types.d.ts.map +1 -1
  888. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  889. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  890. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  891. package/build-types/toggle-group-control/types.d.ts +1 -0
  892. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  893. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  894. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  895. package/build-types/tooltip/index.d.ts.map +1 -1
  896. package/build-types/utils/deprecated-36px-size.d.ts +6 -0
  897. package/build-types/utils/deprecated-36px-size.d.ts.map +1 -0
  898. package/build-types/utils/element-rect.d.ts +1 -1
  899. package/build-types/utils/element-rect.d.ts.map +1 -1
  900. package/build-types/utils/hooks/use-animated-offset-rect.d.ts +69 -0
  901. package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -0
  902. package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
  903. package/build-types/visually-hidden/stories/index.story.d.ts.map +1 -1
  904. package/package.json +21 -20
  905. package/schemas/docs-manifest.json +38 -0
  906. package/src/alignment-matrix-control/README.md +45 -36
  907. package/src/alignment-matrix-control/docs-manifest.json +12 -0
  908. package/src/alignment-matrix-control/types.ts +2 -0
  909. package/src/angle-picker-control/README.md +35 -23
  910. package/src/angle-picker-control/docs-manifest.json +5 -0
  911. package/src/animate/stories/index.story.tsx +2 -1
  912. package/src/autocomplete/autocompleter-ui.native.js +2 -4
  913. package/src/autocomplete/autocompleter-ui.tsx +2 -6
  914. package/src/autocomplete/index.tsx +4 -5
  915. package/src/base-control/README.md +58 -47
  916. package/src/base-control/docs-manifest.json +12 -0
  917. package/src/base-control/stories/index.story.tsx +4 -0
  918. package/src/base-control/types.ts +3 -0
  919. package/src/border-box-control/border-box-control/README.md +1 -0
  920. package/src/border-box-control/border-box-control/component.tsx +1 -0
  921. package/src/border-box-control/border-box-control/hook.ts +7 -0
  922. package/src/border-box-control/stories/index.story.tsx +1 -0
  923. package/src/border-box-control/test/index.tsx +1 -0
  924. package/src/border-control/border-control/README.md +1 -0
  925. package/src/border-control/border-control/component.tsx +1 -0
  926. package/src/border-control/border-control/hook.ts +7 -1
  927. package/src/border-control/border-control-dropdown/component.tsx +24 -12
  928. package/src/border-control/stories/index.story.tsx +1 -0
  929. package/src/border-control/test/index.js +1 -0
  930. package/src/button/stories/index.story.tsx +2 -1
  931. package/src/button/style.scss +5 -1
  932. package/src/card/stories/index.story.tsx +2 -1
  933. package/src/color-palette/index.native.js +1 -2
  934. package/src/color-palette/index.tsx +1 -1
  935. package/src/color-palette/style.scss +2 -4
  936. package/src/color-picker/index.native.js +0 -1
  937. package/src/composite/legacy/index.tsx +5 -2
  938. package/src/composite/stories/index.story.tsx +2 -1
  939. package/src/composite/test/index.tsx +629 -38
  940. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +1 -1
  941. package/src/date-time/date/index.tsx +0 -1
  942. package/src/disabled/stories/index.story.tsx +2 -1
  943. package/src/draggable/stories/index.story.tsx +2 -1
  944. package/src/drop-zone/index.tsx +1 -2
  945. package/src/drop-zone/style.scss +1 -1
  946. package/src/font-size-picker/index.native.js +7 -7
  947. package/src/form-token-field/index.tsx +0 -3
  948. package/src/form-token-field/style.scss +4 -1
  949. package/src/form-token-field/suggestions-list.tsx +6 -0
  950. package/src/item-group/stories/index.story.tsx +8 -4
  951. package/src/keyboard-shortcuts/stories/index.story.tsx +2 -1
  952. package/src/{dropdown-menu-v2 → menu}/README.md +34 -34
  953. package/src/{dropdown-menu-v2 → menu}/checkbox-item.tsx +14 -14
  954. package/src/menu/context.tsx +13 -0
  955. package/src/{dropdown-menu-v2 → menu}/group-label.tsx +8 -8
  956. package/src/menu/group.tsx +26 -0
  957. package/src/{dropdown-menu-v2 → menu}/index.tsx +65 -70
  958. package/src/{dropdown-menu-v2 → menu}/item-help-text.tsx +3 -7
  959. package/src/{dropdown-menu-v2 → menu}/item-label.tsx +3 -7
  960. package/src/{dropdown-menu-v2 → menu}/item.tsx +13 -13
  961. package/src/{dropdown-menu-v2 → menu}/radio-item.tsx +14 -14
  962. package/src/menu/separator.tsx +27 -0
  963. package/src/menu/stories/index.story.tsx +542 -0
  964. package/src/{dropdown-menu-v2 → menu}/styles.ts +17 -17
  965. package/src/{dropdown-menu-v2 → menu}/test/index.tsx +145 -225
  966. package/src/{dropdown-menu-v2 → menu}/types.ts +24 -23
  967. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +3 -5
  968. package/src/mobile/bottom-sheet/range-cell.native.js +1 -1
  969. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
  970. package/src/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
  971. package/src/mobile/bottom-sheet-select-control/index.native.js +2 -2
  972. package/src/mobile/color-settings/index.native.js +1 -3
  973. package/src/mobile/color-settings/picker-screen.native.js +1 -3
  974. package/src/mobile/image/index.native.js +1 -3
  975. package/src/mobile/keyboard-avoiding-view/index.ios.js +1 -3
  976. package/src/mobile/link-picker/link-picker-results.native.js +2 -5
  977. package/src/mobile/link-picker/link-picker-screen.native.js +1 -3
  978. package/src/mobile/link-settings/index.native.js +6 -18
  979. package/src/mobile/link-settings/link-settings-screen.native.js +1 -3
  980. package/src/mobile/segmented-control/index.native.js +2 -6
  981. package/src/mobile/utils/use-unit-converter-to-mobile.native.js +2 -6
  982. package/src/modal/aria-helper.ts +1 -0
  983. package/src/navigable-container/stories/navigable-menu.story.tsx +2 -1
  984. package/src/navigable-container/stories/tabbable-container.story.tsx +2 -1
  985. package/src/navigation/index.tsx +1 -2
  986. package/src/navigation/item/use-navigation-tree-item.tsx +2 -2
  987. package/src/navigation/menu/menu-title-search.tsx +2 -2
  988. package/src/navigation/menu/use-navigation-tree-menu.tsx +2 -2
  989. package/src/palette-edit/index.tsx +34 -10
  990. package/src/palette-edit/styles.ts +1 -67
  991. package/src/palette-edit/test/index.tsx +50 -1
  992. package/src/panel/stories/index.story.tsx +2 -1
  993. package/src/private-apis.ts +3 -3
  994. package/src/radio-group/index.tsx +2 -0
  995. package/src/range-control/styles/range-control-styles.ts +19 -10
  996. package/src/range-control/tooltip.tsx +1 -1
  997. package/src/resizable-box/stories/index.story.tsx +2 -1
  998. package/src/sandbox/index.native.js +1 -3
  999. package/src/sandbox/index.tsx +3 -6
  1000. package/src/sandbox/stories/index.story.tsx +2 -1
  1001. package/src/scroll-lock/stories/index.story.tsx +2 -1
  1002. package/src/search-control/README.md +2 -0
  1003. package/src/search-control/index.native.js +1 -3
  1004. package/src/search-control/index.tsx +7 -0
  1005. package/src/search-control/stories/index.story.tsx +0 -15
  1006. package/src/search-control/test/index.tsx +4 -1
  1007. package/src/search-control/types.ts +3 -0
  1008. package/src/shortcut/stories/index.story.tsx +2 -1
  1009. package/src/slot-fill/bubbles-virtually/slot.tsx +1 -2
  1010. package/src/slot-fill/fill.ts +3 -6
  1011. package/src/slot-fill/stories/index.story.tsx +2 -1
  1012. package/src/spacer/hook.ts +3 -2
  1013. package/src/tab-panel/index.tsx +3 -0
  1014. package/src/tab-panel/stories/index.story.tsx +2 -1
  1015. package/src/tab-panel/style.scss +1 -3
  1016. package/src/tabs/README.md +63 -21
  1017. package/src/tabs/index.tsx +112 -189
  1018. package/src/tabs/stories/index.story.tsx +5 -2
  1019. package/src/tabs/styles.ts +123 -46
  1020. package/src/tabs/tab.tsx +31 -5
  1021. package/src/tabs/tablist.tsx +74 -59
  1022. package/src/tabs/test/index.tsx +131 -118
  1023. package/src/tabs/types.ts +89 -49
  1024. package/src/theme/stories/index.story.tsx +2 -1
  1025. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -6
  1026. package/src/toggle-group-control/test/index.tsx +39 -0
  1027. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +11 -1
  1028. package/src/toggle-group-control/toggle-group-control/component.tsx +4 -98
  1029. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +15 -15
  1030. package/src/toggle-group-control/types.ts +1 -0
  1031. package/src/toolbar/toolbar/index.tsx +3 -0
  1032. package/src/tools-panel/tools-panel-header/component.tsx +1 -1
  1033. package/src/tools-panel/tools-panel-item/hook.ts +0 -2
  1034. package/src/tooltip/index.native.js +5 -15
  1035. package/src/tooltip/index.tsx +8 -1
  1036. package/src/tooltip/test/index.tsx +78 -0
  1037. package/src/unit-control/index.native.js +2 -6
  1038. package/src/utils/deprecated-36px-size.ts +24 -0
  1039. package/src/utils/element-rect.ts +14 -2
  1040. package/src/utils/hooks/use-animated-offset-rect.ts +119 -0
  1041. package/src/utils/hooks/use-update-effect.js +0 -2
  1042. package/src/visually-hidden/stories/index.story.tsx +2 -1
  1043. package/tsconfig.tsbuildinfo +1 -1
  1044. package/build/dropdown-menu-v2/checkbox-item.js.map +0 -1
  1045. package/build/dropdown-menu-v2/context.js.map +0 -1
  1046. package/build/dropdown-menu-v2/group-label.js.map +0 -1
  1047. package/build/dropdown-menu-v2/group.js.map +0 -1
  1048. package/build/dropdown-menu-v2/index.js.map +0 -1
  1049. package/build/dropdown-menu-v2/item-help-text.js.map +0 -1
  1050. package/build/dropdown-menu-v2/item-label.js.map +0 -1
  1051. package/build/dropdown-menu-v2/item.js.map +0 -1
  1052. package/build/dropdown-menu-v2/radio-item.js.map +0 -1
  1053. package/build/dropdown-menu-v2/separator.js.map +0 -1
  1054. package/build/dropdown-menu-v2/styles.js +0 -150
  1055. package/build/dropdown-menu-v2/styles.js.map +0 -1
  1056. package/build/dropdown-menu-v2/types.js.map +0 -1
  1057. package/build/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
  1058. package/build-module/dropdown-menu-v2/checkbox-item.js.map +0 -1
  1059. package/build-module/dropdown-menu-v2/context.js.map +0 -1
  1060. package/build-module/dropdown-menu-v2/group-label.js.map +0 -1
  1061. package/build-module/dropdown-menu-v2/group.js +0 -21
  1062. package/build-module/dropdown-menu-v2/group.js.map +0 -1
  1063. package/build-module/dropdown-menu-v2/index.js.map +0 -1
  1064. package/build-module/dropdown-menu-v2/item-help-text.js.map +0 -1
  1065. package/build-module/dropdown-menu-v2/item-label.js.map +0 -1
  1066. package/build-module/dropdown-menu-v2/item.js.map +0 -1
  1067. package/build-module/dropdown-menu-v2/radio-item.js.map +0 -1
  1068. package/build-module/dropdown-menu-v2/separator.js +0 -22
  1069. package/build-module/dropdown-menu-v2/separator.js.map +0 -1
  1070. package/build-module/dropdown-menu-v2/styles.js +0 -143
  1071. package/build-module/dropdown-menu-v2/styles.js.map +0 -1
  1072. package/build-module/dropdown-menu-v2/types.js.map +0 -1
  1073. package/build-module/dropdown-menu-v2/use-temporary-focus-visible-fix.js.map +0 -1
  1074. package/build-types/dropdown-menu-v2/checkbox-item.d.ts +0 -3
  1075. package/build-types/dropdown-menu-v2/checkbox-item.d.ts.map +0 -1
  1076. package/build-types/dropdown-menu-v2/context.d.ts +0 -6
  1077. package/build-types/dropdown-menu-v2/context.d.ts.map +0 -1
  1078. package/build-types/dropdown-menu-v2/group-label.d.ts +0 -3
  1079. package/build-types/dropdown-menu-v2/group-label.d.ts.map +0 -1
  1080. package/build-types/dropdown-menu-v2/group.d.ts +0 -3
  1081. package/build-types/dropdown-menu-v2/group.d.ts.map +0 -1
  1082. package/build-types/dropdown-menu-v2/index.d.ts +0 -40
  1083. package/build-types/dropdown-menu-v2/index.d.ts.map +0 -1
  1084. package/build-types/dropdown-menu-v2/item-help-text.d.ts.map +0 -1
  1085. package/build-types/dropdown-menu-v2/item-label.d.ts.map +0 -1
  1086. package/build-types/dropdown-menu-v2/item.d.ts +0 -3
  1087. package/build-types/dropdown-menu-v2/item.d.ts.map +0 -1
  1088. package/build-types/dropdown-menu-v2/radio-item.d.ts +0 -3
  1089. package/build-types/dropdown-menu-v2/radio-item.d.ts.map +0 -1
  1090. package/build-types/dropdown-menu-v2/separator.d.ts +0 -3
  1091. package/build-types/dropdown-menu-v2/separator.d.ts.map +0 -1
  1092. package/build-types/dropdown-menu-v2/stories/index.story.d.ts +0 -16
  1093. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +0 -1
  1094. package/build-types/dropdown-menu-v2/styles.d.ts.map +0 -1
  1095. package/build-types/dropdown-menu-v2/test/index.d.ts.map +0 -1
  1096. package/build-types/dropdown-menu-v2/types.d.ts.map +0 -1
  1097. package/build-types/dropdown-menu-v2/use-temporary-focus-visible-fix.d.ts.map +0 -1
  1098. package/src/dropdown-menu-v2/context.tsx +0 -13
  1099. package/src/dropdown-menu-v2/group.tsx +0 -26
  1100. package/src/dropdown-menu-v2/separator.tsx +0 -27
  1101. package/src/dropdown-menu-v2/stories/index.story.tsx +0 -639
  1102. /package/build/{dropdown-menu-v2 → menu}/types.js +0 -0
  1103. /package/build/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
  1104. /package/build-module/{dropdown-menu-v2 → menu}/types.js +0 -0
  1105. /package/build-module/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.js +0 -0
  1106. /package/build-types/{dropdown-menu-v2 → menu}/test/index.d.ts +0 -0
  1107. /package/build-types/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.d.ts +0 -0
  1108. /package/src/{dropdown-menu-v2 → menu}/use-temporary-focus-visible-fix.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_element","_compose","_slotFill","_style","_interopRequireDefault","_jsxRuntime","RIGHT_ALIGN_ARROW_OFFSET","TOOLTIP_VERTICAL_OFFSET","TooltipContext","createContext","onHandleScreenTouch","Fill","Slot","createSlotFill","useKeyboardVisibility","keyboardVisible","setKeyboardVisible","useState","previousKeyboardVisible","usePrevious","useEffect","showListener","Keyboard","addListener","keyboardHideEvent","Platform","select","android","ios","hideListener","remove","Tooltip","children","position","text","visible","initialVisible","referenceElementRef","useRef","animationValue","Animated","Value","current","horizontalPosition","split","setVisible","animating","setAnimating","hidden","previousVisible","referenceLayout","setReferenceLayout","height","width","x","y","tooltipLayout","setTooltipLayout","useContext","startAnimation","getReferenceElementPosition","frameListener","timing","toValue","duration","useNativeDriver","delay","easing","Easing","out","quad","start","tooltipStyles","styles","tooltip","left","Math","floor","top","tooltipBoxStyles","tooltip__box","elevation","opacity","shadowColor","tooltip__shadow","color","shadowOffset","shadowOpacity","shadowRadius","transform","translateY","interpolate","inputRange","outputRange","arrowStyles","tooltip__arrow","requestAnimationFrame","measure","_x","_y","pageX","pageY","getTooltipLayout","nativeEvent","layout","jsxs","Fragment","cloneElement","ref","onLayout","jsx","View","style","Text","tooltip__text","TooltipSlot","rest","handleScreenTouch","setHandleScreenTouch","callback","handleTouchStart","value","useMemo","Provider","onTouchStart","undefined","pointerEvents","StyleSheet","absoluteFill","testID","_default","exports","default"],"sources":["@wordpress/components/src/tooltip/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tAnimated,\n\tEasing,\n\tKeyboard,\n\tPlatform,\n\tStyleSheet,\n\tText,\n\tView,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcloneElement,\n\tcreateContext,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { createSlotFill } from '../slot-fill';\nimport styles from './style.scss';\n\nconst RIGHT_ALIGN_ARROW_OFFSET = 16;\nconst TOOLTIP_VERTICAL_OFFSET = 2;\n\nconst TooltipContext = createContext( {\n\tonHandleScreenTouch: () => {},\n} );\nconst { Fill, Slot } = createSlotFill( 'Tooltip' );\n\nconst useKeyboardVisibility = () => {\n\tconst [ keyboardVisible, setKeyboardVisible ] = useState( false );\n\tconst previousKeyboardVisible = usePrevious( keyboardVisible );\n\n\tuseEffect( () => {\n\t\tconst showListener = Keyboard.addListener( 'keyboardDidShow', () => {\n\t\t\tif ( previousKeyboardVisible !== true ) {\n\t\t\t\tsetKeyboardVisible( true );\n\t\t\t}\n\t\t} );\n\t\tconst keyboardHideEvent = Platform.select( {\n\t\t\tandroid: 'keyboardDidHide',\n\t\t\tios: 'keyboardWillHide',\n\t\t} );\n\t\tconst hideListener = Keyboard.addListener( keyboardHideEvent, () => {\n\t\t\tif ( previousKeyboardVisible !== false ) {\n\t\t\t\tsetKeyboardVisible( false );\n\t\t\t}\n\t\t} );\n\t\treturn () => {\n\t\t\tshowListener.remove();\n\t\t\thideListener.remove();\n\t\t};\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\treturn keyboardVisible;\n};\n\nconst Tooltip = ( {\n\tchildren,\n\tposition = 'top',\n\ttext,\n\tvisible: initialVisible = false,\n} ) => {\n\tconst referenceElementRef = useRef( null );\n\tconst animationValue = useRef( new Animated.Value( 0 ) ).current;\n\tconst [ , horizontalPosition = 'center' ] = position.split( ' ' );\n\tconst [ visible, setVisible ] = useState( initialVisible );\n\tconst [ animating, setAnimating ] = useState( false );\n\tconst hidden = ! visible && ! animating;\n\tconst previousVisible = usePrevious( visible );\n\tconst [ referenceLayout, setReferenceLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t\tx: 0,\n\t\ty: 0,\n\t} );\n\tconst [ tooltipLayout, setTooltipLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t} );\n\tconst { onHandleScreenTouch } = useContext( TooltipContext );\n\tconst keyboardVisible = useKeyboardVisibility();\n\n\t// Register callback to dismiss the tooltip whenever the screen is touched.\n\tuseEffect( () => {\n\t\tif ( visible ) {\n\t\t\tonHandleScreenTouch( () => {\n\t\t\t\tsetAnimating( true );\n\t\t\t\tsetVisible( false );\n\t\t\t} );\n\t\t}\n\t\treturn () => onHandleScreenTouch( null );\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible ] );\n\n\t// Manage visibility animation.\n\tuseEffect( () => {\n\t\tif (\n\t\t\t// Initial render and visibility enabled, animate show.\n\t\t\t( typeof previousVisible === 'undefined' && visible ) ||\n\t\t\t// Previously visible, animate hide\n\t\t\t( previousVisible && previousVisible !== visible )\n\t\t) {\n\t\t\tsetAnimating( true );\n\t\t\tstartAnimation();\n\t\t}\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible ] );\n\n\t// Manage tooltip visibility and position in relation to keyboard.\n\tuseEffect( () => {\n\t\tif ( ! visible ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update tooltip position if keyboard is visible.\n\t\tif ( keyboardVisible ) {\n\t\t\tgetReferenceElementPosition();\n\t\t}\n\n\t\t// Hide tooltip if keyboard hides\n\t\tif ( typeof previousVisible !== 'undefined' && ! keyboardVisible ) {\n\t\t\tsetAnimating( true );\n\t\t\tsetVisible( false );\n\t\t}\n\t\t// Disable reason: deferring this refactor to the native team.\n\t\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ visible, keyboardVisible ] );\n\n\t// Manage tooltip position during keyboard frame changes.\n\tuseEffect( () => {\n\t\tconst frameListener = Keyboard.addListener(\n\t\t\t'keyboardWillChangeFrame',\n\t\t\t() => {\n\t\t\t\tif ( visible ) {\n\t\t\t\t\tgetReferenceElementPosition();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tframeListener.remove();\n\t\t};\n\t}, [ visible ] );\n\n\tconst startAnimation = () => {\n\t\tAnimated.timing( animationValue, {\n\t\t\ttoValue: visible ? 1 : 0,\n\t\t\tduration: visible ? 300 : 150,\n\t\t\tuseNativeDriver: true,\n\t\t\tdelay: visible ? 500 : 0,\n\t\t\teasing: Easing.out( Easing.quad ),\n\t\t} ).start( () => {\n\t\t\tsetAnimating( false );\n\t\t} );\n\t};\n\n\tconst tooltipStyles = [\n\t\tstyles.tooltip,\n\t\t{\n\t\t\tleft:\n\t\t\t\treferenceLayout.x +\n\t\t\t\tMath.floor( referenceLayout.width / 2 ) -\n\t\t\t\t( horizontalPosition === 'right'\n\t\t\t\t\t? RIGHT_ALIGN_ARROW_OFFSET\n\t\t\t\t\t: Math.floor( tooltipLayout.width / 2 ) ),\n\t\t\ttop:\n\t\t\t\treferenceLayout.y -\n\t\t\t\ttooltipLayout.height -\n\t\t\t\tTOOLTIP_VERTICAL_OFFSET,\n\t\t},\n\t];\n\tconst tooltipBoxStyles = [\n\t\tstyles.tooltip__box,\n\t\thorizontalPosition === 'right' && styles[ 'tooltip--rightAlign' ],\n\t\t{\n\t\t\televation: 2,\n\t\t\topacity: animationValue,\n\t\t\tshadowColor: styles.tooltip__shadow?.color,\n\t\t\tshadowOffset: { height: 2, width: 0 },\n\t\t\tshadowOpacity: 0.25,\n\t\t\tshadowRadius: 2,\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: animationValue.interpolate( {\n\t\t\t\t\t\tinputRange: [ 0, 1 ],\n\t\t\t\t\t\toutputRange: [ visible ? 4 : -8, -8 ],\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t];\n\tconst arrowStyles = [\n\t\tstyles.tooltip__arrow,\n\t\thorizontalPosition === 'right' &&\n\t\t\tstyles[ 'tooltip__arrow--rightAlign' ],\n\t];\n\n\tconst getReferenceElementPosition = () => {\n\t\t// rAF allows render to complete before calculating layout\n\t\t// eslint-disable-next-line no-undef\n\t\trequestAnimationFrame( () => {\n\t\t\tif ( ! referenceElementRef.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treferenceElementRef.current.measure(\n\t\t\t\t( _x, _y, width, height, pageX, pageY ) => {\n\t\t\t\t\tsetReferenceLayout( {\n\t\t\t\t\t\theight,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\tx: pageX,\n\t\t\t\t\t\ty: pageY,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t);\n\t\t} );\n\t};\n\tconst getTooltipLayout = ( { nativeEvent } ) => {\n\t\tconst { height, width } = nativeEvent.layout;\n\t\tsetTooltipLayout( { height, width } );\n\t};\n\n\tif ( hidden ) {\n\t\treturn children;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ cloneElement( children, {\n\t\t\t\tref: referenceElementRef,\n\t\t\t\tonLayout: getReferenceElementPosition,\n\t\t\t} ) }\n\t\t\t<Fill>\n\t\t\t\t<View onLayout={ getTooltipLayout } style={ tooltipStyles }>\n\t\t\t\t\t<Animated.View style={ tooltipBoxStyles }>\n\t\t\t\t\t\t<Text style={ styles.tooltip__text }>{ text }</Text>\n\t\t\t\t\t\t<View style={ arrowStyles } />\n\t\t\t\t\t</Animated.View>\n\t\t\t\t</View>\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nconst TooltipSlot = ( { children, ...rest } ) => {\n\tconst [ handleScreenTouch, setHandleScreenTouch ] = useState( null );\n\tconst onHandleScreenTouch = ( callback ) => {\n\t\t// Must use function to set state below as `callback` is a function itself.\n\t\tsetHandleScreenTouch( () => callback );\n\t};\n\tconst handleTouchStart = () => {\n\t\thandleScreenTouch();\n\t\tsetHandleScreenTouch( null );\n\t};\n\t// Memoize context value to avoid unnecessary rerenders of the Provider's children\n\t// Disable reason: deferring this refactor to the native team.\n\t// see https://github.com/WordPress/gutenberg/pull/41166\n\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\tconst value = useMemo( () => ( { onHandleScreenTouch } ) );\n\n\treturn (\n\t\t<TooltipContext.Provider value={ value }>\n\t\t\t<View\n\t\t\t\tonTouchStart={\n\t\t\t\t\ttypeof handleScreenTouch === 'function'\n\t\t\t\t\t\t? handleTouchStart\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tpointerEvents=\"box-none\"\n\t\t\t\tstyle={ StyleSheet.absoluteFill }\n\t\t\t\ttestID=\"tooltip-overlay\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<Slot { ...rest } />\n\t\t\t</View>\n\t\t</TooltipContext.Provider>\n\t);\n};\n\nTooltip.Slot = TooltipSlot;\n\nexport default Tooltip;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAaA,IAAAC,QAAA,GAAAD,OAAA;AASA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAkC,IAAAM,WAAA,GAAAN,OAAA;AA/BlC;AACA;AACA;;AAWA;AACA;AACA;;AAYA;AACA;AACA;;AAIA,MAAMO,wBAAwB,GAAG,EAAE;AACnC,MAAMC,uBAAuB,GAAG,CAAC;AAEjC,MAAMC,cAAc,GAAG,IAAAC,sBAAa,EAAE;EACrCC,mBAAmB,EAAEA,CAAA,KAAM,CAAC;AAC7B,CAAE,CAAC;AACH,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,wBAAc,EAAE,SAAU,CAAC;AAElD,MAAMC,qBAAqB,GAA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Aa,CAAE,CAAC;QAAA,CAChB;MAAC,CACX;IAAC,CACF,CAAC;EAAA,CACN,CAAC;AAEL,CAAC;AAED,MAAMqB,WAAW,GAAGA,CAAE;EAAEnF,QAAQ;EAAE,GAAGoF;AAAK,CAAC,KAAM;EAChD,MAAM,CAAEC,iBAAiB,EAAEC,oBAAoB,CAAE,GAAG,IAAArG,iBAAQ,EAAE,IAAK,CAAC;EACpE,MAAMP,mBAAmB,GAAK6G,QAAQ,IAAM;IAC3C;IACAD,oBAAoB,CAAE,MAAMC,QAAS,CAAC;EACvC,CAAC;EACD,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;IAC9BH,iBAAiB,CAAC,CAAC;IACnBC,oBAAoB,CAAE,IAAK,CAAC;EAC7B,CAAC;EACD;EACA;EACA;EACA;EACA,MAAMG,KAAK,GAAG,IAAAC,gBAAO,EAAE,OAAQ;IAAEhH;EAAoB,CAAC,CAAG,CAAC;EAE1D,oBACC,IAAAL,WAAA,CAAAyG,GAAA,EAACtG,cAAc,CAACmH,QAAQ;IAACF,KAAK,EAAGA,KAAO;IAAAzF,QAAA,eACvC,IAAA3B,WAAA,CAAAoG,IAAA,EAAC3G,YAAA,CAAAiH,IAAI;MACJa,YAAY,EACX,OAAOP,iBAAiB,KAAK,UAAU,GACpCG,gBAAgB,GAChBK,SACH;MACDC,aAAa,EAAC,UAAU;MACxBd,KAAK,EAAGe,uBAAU,CAACC,YAAc;MACjCC,MAAM,EAAC,iBAAiB;MAAAjG,QAAA,GAEtBA,QAAQ,eACV,IAAA3B,WAAA,CAAAyG,GAAA,EAAClG,IAAI;QAAA,GAAMwG;MAAI,CAAI,CAAC;IAAA,CACf;EAAC,CACiB,CAAC;AAE5B,CAAC;AAEDrF,OAAO,CAACnB,IAAI,GAAGuG,WAAW;AAAC,IAAAe,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEZrG,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_element","_compose","_slotFill","_style","_interopRequireDefault","_jsxRuntime","RIGHT_ALIGN_ARROW_OFFSET","TOOLTIP_VERTICAL_OFFSET","TooltipContext","createContext","onHandleScreenTouch","Fill","Slot","createSlotFill","useKeyboardVisibility","keyboardVisible","setKeyboardVisible","useState","previousKeyboardVisible","usePrevious","useEffect","showListener","Keyboard","addListener","keyboardHideEvent","Platform","select","android","ios","hideListener","remove","Tooltip","children","position","text","visible","initialVisible","referenceElementRef","useRef","animationValue","Animated","Value","current","horizontalPosition","split","setVisible","animating","setAnimating","hidden","previousVisible","referenceLayout","setReferenceLayout","height","width","x","y","tooltipLayout","setTooltipLayout","useContext","startAnimation","getReferenceElementPosition","frameListener","timing","toValue","duration","useNativeDriver","delay","easing","Easing","out","quad","start","tooltipStyles","styles","tooltip","left","Math","floor","top","tooltipBoxStyles","tooltip__box","elevation","opacity","shadowColor","tooltip__shadow","color","shadowOffset","shadowOpacity","shadowRadius","transform","translateY","interpolate","inputRange","outputRange","arrowStyles","tooltip__arrow","requestAnimationFrame","measure","_x","_y","pageX","pageY","getTooltipLayout","nativeEvent","layout","jsxs","Fragment","cloneElement","ref","onLayout","jsx","View","style","Text","tooltip__text","TooltipSlot","rest","handleScreenTouch","setHandleScreenTouch","callback","handleTouchStart","value","useMemo","Provider","onTouchStart","undefined","pointerEvents","StyleSheet","absoluteFill","testID","_default","exports","default"],"sources":["@wordpress/components/src/tooltip/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tAnimated,\n\tEasing,\n\tKeyboard,\n\tPlatform,\n\tStyleSheet,\n\tText,\n\tView,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tcloneElement,\n\tcreateContext,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { createSlotFill } from '../slot-fill';\nimport styles from './style.scss';\n\nconst RIGHT_ALIGN_ARROW_OFFSET = 16;\nconst TOOLTIP_VERTICAL_OFFSET = 2;\n\nconst TooltipContext = createContext( {\n\tonHandleScreenTouch: () => {},\n} );\nconst { Fill, Slot } = createSlotFill( 'Tooltip' );\n\nconst useKeyboardVisibility = () => {\n\tconst [ keyboardVisible, setKeyboardVisible ] = useState( false );\n\tconst previousKeyboardVisible = usePrevious( keyboardVisible );\n\n\tuseEffect( () => {\n\t\tconst showListener = Keyboard.addListener( 'keyboardDidShow', () => {\n\t\t\tif ( previousKeyboardVisible !== true ) {\n\t\t\t\tsetKeyboardVisible( true );\n\t\t\t}\n\t\t} );\n\t\tconst keyboardHideEvent = Platform.select( {\n\t\t\tandroid: 'keyboardDidHide',\n\t\t\tios: 'keyboardWillHide',\n\t\t} );\n\t\tconst hideListener = Keyboard.addListener( keyboardHideEvent, () => {\n\t\t\tif ( previousKeyboardVisible !== false ) {\n\t\t\t\tsetKeyboardVisible( false );\n\t\t\t}\n\t\t} );\n\t\treturn () => {\n\t\t\tshowListener.remove();\n\t\t\thideListener.remove();\n\t\t};\n\t\t// See https://github.com/WordPress/gutenberg/pull/41166\n\t}, [] );\n\n\treturn keyboardVisible;\n};\n\nconst Tooltip = ( {\n\tchildren,\n\tposition = 'top',\n\ttext,\n\tvisible: initialVisible = false,\n} ) => {\n\tconst referenceElementRef = useRef( null );\n\tconst animationValue = useRef( new Animated.Value( 0 ) ).current;\n\tconst [ , horizontalPosition = 'center' ] = position.split( ' ' );\n\tconst [ visible, setVisible ] = useState( initialVisible );\n\tconst [ animating, setAnimating ] = useState( false );\n\tconst hidden = ! visible && ! animating;\n\tconst previousVisible = usePrevious( visible );\n\tconst [ referenceLayout, setReferenceLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t\tx: 0,\n\t\ty: 0,\n\t} );\n\tconst [ tooltipLayout, setTooltipLayout ] = useState( {\n\t\theight: 0,\n\t\twidth: 0,\n\t} );\n\tconst { onHandleScreenTouch } = useContext( TooltipContext );\n\tconst keyboardVisible = useKeyboardVisibility();\n\n\t// Register callback to dismiss the tooltip whenever the screen is touched.\n\tuseEffect( () => {\n\t\tif ( visible ) {\n\t\t\tonHandleScreenTouch( () => {\n\t\t\t\tsetAnimating( true );\n\t\t\t\tsetVisible( false );\n\t\t\t} );\n\t\t}\n\t\treturn () => onHandleScreenTouch( null );\n\t\t// See https://github.com/WordPress/gutenberg/pull/41166\n\t}, [ visible ] );\n\n\t// Manage visibility animation.\n\tuseEffect( () => {\n\t\tif (\n\t\t\t// Initial render and visibility enabled, animate show.\n\t\t\t( typeof previousVisible === 'undefined' && visible ) ||\n\t\t\t// Previously visible, animate hide\n\t\t\t( previousVisible && previousVisible !== visible )\n\t\t) {\n\t\t\tsetAnimating( true );\n\t\t\tstartAnimation();\n\t\t}\n\t\t// See https://github.com/WordPress/gutenberg/pull/41166\n\t}, [ visible ] );\n\n\t// Manage tooltip visibility and position in relation to keyboard.\n\tuseEffect( () => {\n\t\tif ( ! visible ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update tooltip position if keyboard is visible.\n\t\tif ( keyboardVisible ) {\n\t\t\tgetReferenceElementPosition();\n\t\t}\n\n\t\t// Hide tooltip if keyboard hides\n\t\tif ( typeof previousVisible !== 'undefined' && ! keyboardVisible ) {\n\t\t\tsetAnimating( true );\n\t\t\tsetVisible( false );\n\t\t}\n\t\t// See https://github.com/WordPress/gutenberg/pull/41166\n\t}, [ visible, keyboardVisible ] );\n\n\t// Manage tooltip position during keyboard frame changes.\n\tuseEffect( () => {\n\t\tconst frameListener = Keyboard.addListener(\n\t\t\t'keyboardWillChangeFrame',\n\t\t\t() => {\n\t\t\t\tif ( visible ) {\n\t\t\t\t\tgetReferenceElementPosition();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn () => {\n\t\t\tframeListener.remove();\n\t\t};\n\t}, [ visible ] );\n\n\tconst startAnimation = () => {\n\t\tAnimated.timing( animationValue, {\n\t\t\ttoValue: visible ? 1 : 0,\n\t\t\tduration: visible ? 300 : 150,\n\t\t\tuseNativeDriver: true,\n\t\t\tdelay: visible ? 500 : 0,\n\t\t\teasing: Easing.out( Easing.quad ),\n\t\t} ).start( () => {\n\t\t\tsetAnimating( false );\n\t\t} );\n\t};\n\n\tconst tooltipStyles = [\n\t\tstyles.tooltip,\n\t\t{\n\t\t\tleft:\n\t\t\t\treferenceLayout.x +\n\t\t\t\tMath.floor( referenceLayout.width / 2 ) -\n\t\t\t\t( horizontalPosition === 'right'\n\t\t\t\t\t? RIGHT_ALIGN_ARROW_OFFSET\n\t\t\t\t\t: Math.floor( tooltipLayout.width / 2 ) ),\n\t\t\ttop:\n\t\t\t\treferenceLayout.y -\n\t\t\t\ttooltipLayout.height -\n\t\t\t\tTOOLTIP_VERTICAL_OFFSET,\n\t\t},\n\t];\n\tconst tooltipBoxStyles = [\n\t\tstyles.tooltip__box,\n\t\thorizontalPosition === 'right' && styles[ 'tooltip--rightAlign' ],\n\t\t{\n\t\t\televation: 2,\n\t\t\topacity: animationValue,\n\t\t\tshadowColor: styles.tooltip__shadow?.color,\n\t\t\tshadowOffset: { height: 2, width: 0 },\n\t\t\tshadowOpacity: 0.25,\n\t\t\tshadowRadius: 2,\n\t\t\ttransform: [\n\t\t\t\t{\n\t\t\t\t\ttranslateY: animationValue.interpolate( {\n\t\t\t\t\t\tinputRange: [ 0, 1 ],\n\t\t\t\t\t\toutputRange: [ visible ? 4 : -8, -8 ],\n\t\t\t\t\t} ),\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t];\n\tconst arrowStyles = [\n\t\tstyles.tooltip__arrow,\n\t\thorizontalPosition === 'right' &&\n\t\t\tstyles[ 'tooltip__arrow--rightAlign' ],\n\t];\n\n\tconst getReferenceElementPosition = () => {\n\t\t// rAF allows render to complete before calculating layout\n\t\t// eslint-disable-next-line no-undef\n\t\trequestAnimationFrame( () => {\n\t\t\tif ( ! referenceElementRef.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treferenceElementRef.current.measure(\n\t\t\t\t( _x, _y, width, height, pageX, pageY ) => {\n\t\t\t\t\tsetReferenceLayout( {\n\t\t\t\t\t\theight,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\tx: pageX,\n\t\t\t\t\t\ty: pageY,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t);\n\t\t} );\n\t};\n\tconst getTooltipLayout = ( { nativeEvent } ) => {\n\t\tconst { height, width } = nativeEvent.layout;\n\t\tsetTooltipLayout( { height, width } );\n\t};\n\n\tif ( hidden ) {\n\t\treturn children;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ cloneElement( children, {\n\t\t\t\tref: referenceElementRef,\n\t\t\t\tonLayout: getReferenceElementPosition,\n\t\t\t} ) }\n\t\t\t<Fill>\n\t\t\t\t<View onLayout={ getTooltipLayout } style={ tooltipStyles }>\n\t\t\t\t\t<Animated.View style={ tooltipBoxStyles }>\n\t\t\t\t\t\t<Text style={ styles.tooltip__text }>{ text }</Text>\n\t\t\t\t\t\t<View style={ arrowStyles } />\n\t\t\t\t\t</Animated.View>\n\t\t\t\t</View>\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nconst TooltipSlot = ( { children, ...rest } ) => {\n\tconst [ handleScreenTouch, setHandleScreenTouch ] = useState( null );\n\tconst onHandleScreenTouch = ( callback ) => {\n\t\t// Must use function to set state below as `callback` is a function itself.\n\t\tsetHandleScreenTouch( () => callback );\n\t};\n\tconst handleTouchStart = () => {\n\t\thandleScreenTouch();\n\t\tsetHandleScreenTouch( null );\n\t};\n\t// Memoize context value to avoid unnecessary rerenders of the Provider's children\n\t// See https://github.com/WordPress/gutenberg/pull/41166\n\tconst value = useMemo( () => ( { onHandleScreenTouch } ) );\n\n\treturn (\n\t\t<TooltipContext.Provider value={ value }>\n\t\t\t<View\n\t\t\t\tonTouchStart={\n\t\t\t\t\ttypeof handleScreenTouch === 'function'\n\t\t\t\t\t\t? handleTouchStart\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tpointerEvents=\"box-none\"\n\t\t\t\tstyle={ StyleSheet.absoluteFill }\n\t\t\t\ttestID=\"tooltip-overlay\"\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<Slot { ...rest } />\n\t\t\t</View>\n\t\t</TooltipContext.Provider>\n\t);\n};\n\nTooltip.Slot = TooltipSlot;\n\nexport default Tooltip;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAaA,IAAAC,QAAA,GAAAD,OAAA;AASA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAkC,IAAAM,WAAA,GAAAN,OAAA;AA/BlC;AACA;AACA;;AAWA;AACA;AACA;;AAYA;AACA;AACA;;AAIA,MAAMO,wBAAwB,GAAG,EAAE;AACnC,MAAMC,uBAAuB,GAAG,CAAC;AAEjC,MAAMC,cAAc,GAAG,IAAAC,sBAAa,EAAE;EACrCC,mBAAmB,EAAEA,CAAA,KAAM,CAAC;AAC7B,CAAE,CAAC;AACH,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAG,IAAAC,wBAAc,EAAE,SAAU,CAAC;AAElD,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACnC,MAAM,CAAEC,eAAe,EAAEC,kBAAkB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EACjE,MAAMC,uBAAuB,GAAG,IAAAC,oBAAW,EAAEJ,eAAgB,CAAC;EAE9D,IAAAK,kBAAS,EAAE,MAAM;IAChB,MAAMC,YAAY,GAAGC,qBAAQ,CAACC,WAAW,CAAE,iBAAiB,EAAE,MAAM;MACnE,IAAKL,uBAAuB,KAAK,IAAI,EAAG;QACvCF,kBAAkB,CAAE,IAAK,CAAC;MAC3B;IACD,CAAE,CAAC;IACH,MAAMQ,iBAAiB,GAAGC,qBAAQ,CAACC,MAAM,CAAE;MAC1CC,OAAO,EAAE,iBAAiB;MAC1BC,GA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,IAAAC,gBAAO,EAAE,OAAQ;IAAEhH;EAAoB,CAAC,CAAG,CAAC;EAE1D,oBACC,IAAAL,WAAA,CAAAyG,GAAA,EAACtG,cAAc,CAACmH,QAAQ;IAACF,KAAK,EAAGA,KAAO;IAAAzF,QAAA,eACvC,IAAA3B,WAAA,CAAAoG,IAAA,EAAC3G,YAAA,CAAAiH,IAAI;MACJa,YAAY,EACX,OAAOP,iBAAiB,KAAK,UAAU,GACpCG,gBAAgB,GAChBK,SACH;MACDC,aAAa,EAAC,UAAU;MACxBd,KAAK,EAAGe,uBAAU,CAACC,YAAc;MACjCC,MAAM,EAAC,iBAAiB;MAAAjG,QAAA,GAEtBA,QAAQ,eACV,IAAA3B,WAAA,CAAAyG,GAAA,EAAClG,IAAI;QAAA,GAAMwG;MAAI,CAAI,CAAC;IAAA,CACf;EAAC,CACiB,CAAC;AAE5B,CAAC;AAEDrF,OAAO,CAACnB,IAAI,GAAGuG,WAAW;AAAC,IAAAe,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEZrG,OAAO","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_deprecated","_element","_i18n","_unitControlStyles","_unitSelectControl","_utils","_hooks","_strings","_useDeprecatedProps","_jsxRuntime","UnforwardedUnitControl","unitControlProps","forwardedRef","__unstableStateReducer","autoComplete","children","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","onChangeProp","onUnitChange","size","unit","unitProp","units","unitsProp","CSS_UNITS","value","valueProp","onFocus","onFocusProp","props","useDeprecated36pxDefaultSizeProp","deprecated","since","hint","version","nonNullValueProp","undefined","reFirstCharacterOfUnits","useMemo","list","getUnitsWithCurrentUnit","firstUnitValue","rest","firstCharacters","reduce","carry","first","escapeRegExp","substring","includes","RegExp","parsedQuantity","parsedUnit","getParsedQuantityAndUnit","setUnit","useControlledState","length","initial","fallback","useEffect","classes","clsx","handleOnQuantityChange","nextQuantityValue","changeProps","onChangeValue","getValidParsedQuantityAndUnit","join","handleOnUnitChange","nextUnitValue","data","nextValue","default","handleOnKeyDown","event","onKeyDown","metaKey","ctrlKey","test","key","refInputSuffix","current","focus","useRef","inputSuffix","jsx","ref","__","__next40pxDefaultSize","onBlur","step","_activeUnit$step","activeUnit","find","option","ValueInput","spinControls","suffix","type","UnitControl","exports","forwardRef","_default"],"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":";;;;;;;;;;;;;;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAMA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAMA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAEA,IAAAS,mBAAA,GAAAT,OAAA;AAAiF,IAAAU,WAAA,GAAAV,OAAA;AA5BjF;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;;AAeA,SAASW,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;IACtBC,YAAY;IACZC,IAAI,GAAG,SAAS;IAChBC,IAAI,EAAEC,QAAQ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A;AACO,MAAM6F,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAAE,mBAAU,EAAElG,sBAAuB,CAAC;AAAC,IAAAmG,QAAA,GAAAF,OAAA,CAAA5B,OAAA,GAGjD2B,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_deprecated","_element","_i18n","_unitControlStyles","_unitSelectControl","_utils","_hooks","_strings","_useDeprecatedProps","_jsxRuntime","UnforwardedUnitControl","unitControlProps","forwardedRef","__unstableStateReducer","autoComplete","children","className","disabled","disableUnits","isPressEnterToChange","isResetValueOnUnitChange","isUnitSelectTabbable","label","onChange","onChangeProp","onUnitChange","size","unit","unitProp","units","unitsProp","CSS_UNITS","value","valueProp","onFocus","onFocusProp","props","useDeprecated36pxDefaultSizeProp","deprecated","since","hint","version","nonNullValueProp","undefined","reFirstCharacterOfUnits","useMemo","list","getUnitsWithCurrentUnit","firstUnitValue","rest","firstCharacters","reduce","carry","first","escapeRegExp","substring","includes","RegExp","parsedQuantity","parsedUnit","getParsedQuantityAndUnit","setUnit","useControlledState","length","initial","fallback","useEffect","classes","clsx","handleOnQuantityChange","nextQuantityValue","changeProps","onChangeValue","getValidParsedQuantityAndUnit","join","handleOnUnitChange","nextUnitValue","data","nextValue","default","handleOnKeyDown","event","onKeyDown","metaKey","ctrlKey","test","key","refInputSuffix","current","focus","useRef","inputSuffix","jsx","ref","__","__next40pxDefaultSize","onBlur","step","_activeUnit$step","activeUnit","find","option","ValueInput","spinControls","suffix","type","UnitControl","exports","forwardRef","_default"],"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":";;;;;;;;;;;;;;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,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I,CAAC;EAC7B;EAEA,oBACC,IAAAzF,WAAA,CAAAmF,GAAA,EAACzF,kBAAA,CAAAmG,UAAU;IAAA,GACLlE,KAAK;IACVtB,YAAY,EAAGA,YAAc;IAC7BE,SAAS,EAAGmD,OAAS;IACrBlD,QAAQ,EAAGA,QAAU;IACrBsF,YAAY,EAAC,MAAM;IACnBpF,oBAAoB,EAAGA,oBAAsB;IAC7CG,KAAK,EAAGA,KAAO;IACf4D,SAAS,EAAGF,eAAiB;IAC7BzD,QAAQ,EAAG8C,sBAAwB;IACnCwB,GAAG,EAAGjF,YAAc;IACpBc,IAAI,EAAGA,IAAM;IACb8E,MAAM,EAAGb,WAAa;IACtBc,IAAI,EAAGtF,oBAAoB,GAAG,MAAM,GAAG,QAAU;IACjDa,KAAK,EAAG0B,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,EAAI;IAC9BuC,IAAI,EAAGA,IAAM;IACb/D,OAAO,EAAGC,WAAa;IACvBtB,sBAAsB,EAAGA;EAAwB,CACjD,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM6F,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAAE,mBAAU,EAAElG,sBAAuB,CAAC;AAAC,IAAAmG,QAAA,GAAAF,OAAA,CAAA5B,OAAA,GAGjD2B,WAAW","ignoreList":[]}
@@ -54,10 +54,8 @@ function UnitControl({
54
54
  if (pickerRef?.current) {
55
55
  pickerRef.current.presentPicker();
56
56
  }
57
- // Disable reason: this should be fixed by the native team.
58
- // It would be great if this could be done in the context of
57
+ // It would be great if the deps could be addressed in the context of
59
58
  // https://github.com/WordPress/gutenberg/pull/39218
60
- // eslint-disable-next-line react-hooks/exhaustive-deps
61
59
  }, [pickerRef?.current]);
62
60
  const currentInputValue = currentInput === null ? value : currentInput;
63
61
  const initialControlValue = isFinite(currentInputValue) ? currentInputValue : initialPosition;
@@ -86,10 +84,8 @@ function UnitControl({
86
84
  return unitButton;
87
85
  }, [onPickerPresent, accessibilityLabel, accessibilityHint, unitButtonTextStyle, unit, units]);
88
86
  const getAnchor = (0, _element.useCallback)(() => anchorNodeRef?.current ? (0, _reactNative.findNodeHandle)(anchorNodeRef?.current) : undefined,
89
- // Disable reason: this should be fixed by the native team.
90
- // It would be great if this could be done in the context of
87
+ // It would be great if the deps could be addressed in the context of
91
88
  // https://github.com/WordPress/gutenberg/pull/39218
92
- // eslint-disable-next-line react-hooks/exhaustive-deps
93
89
  [anchorNodeRef?.current]);
94
90
  const getDecimal = step => {
95
91
  // Return the decimal offset based on the step size.
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_rangeCell","_interopRequireDefault","_stepperCell","_picker","_style","_utils","_element","_compose","_i18n","_jsxRuntime","UnitControl","currentInput","label","value","onChange","onUnitChange","initialPosition","min","max","separatorType","units","CSS_UNITS","unit","getStylesFromColorScheme","props","pickerRef","useRef","anchorNodeRef","onPickerPresent","useCallback","current","presentPicker","currentInputValue","initialControlValue","isFinite","unitButtonTextStyle","styles","unitButtonText","unitButtonTextDark","accessibilityLabel","sprintf","__","accessibilityHint","Platform","OS","renderUnitButton","useMemo","unitButton","jsx","View","style","children","Text","hasUnits","length","TouchableWithoutFeedback","onPress","accessibilityRole","getAnchor","findNodeHandle","undefined","getDecimal","step","stepToString","splitStep","toString","split","renderUnitPicker","jsxs","unitMenu","ref","default","options","hideCancelButton","leftAlign","_activeUnit$step","activeUnit","find","option","decimalNum","Fragment","defaultValue","shouldDisplayTextInput","openUnitPicker","unitLabel","getAccessibleLabelForUnit","minimumValue","maximumValue","_default","exports","memo","withPreferredColorScheme"],"sources":["@wordpress/components/src/unit-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tText,\n\tView,\n\tTouchableWithoutFeedback,\n\tPlatform,\n\tfindNodeHandle,\n} from 'react-native';\n\n/**\n * Internal dependencies\n */\nimport RangeCell from '../mobile/bottom-sheet/range-cell';\nimport StepperCell from '../mobile/bottom-sheet/stepper-cell';\nimport Picker from '../mobile/picker';\nimport styles from './style.scss';\nimport { CSS_UNITS, hasUnits, getAccessibleLabelForUnit } from './utils';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useCallback, useMemo, memo } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\n\nfunction UnitControl( {\n\tcurrentInput,\n\tlabel,\n\tvalue,\n\tonChange,\n\tonUnitChange,\n\tinitialPosition,\n\tmin,\n\tmax,\n\tseparatorType,\n\tunits = CSS_UNITS,\n\tunit,\n\tgetStylesFromColorScheme,\n\t...props\n} ) {\n\tconst pickerRef = useRef();\n\tconst anchorNodeRef = useRef();\n\n\tconst onPickerPresent = useCallback( () => {\n\t\tif ( pickerRef?.current ) {\n\t\t\tpickerRef.current.presentPicker();\n\t\t}\n\t\t// Disable reason: this should be fixed by the native team.\n\t\t// It would be great if this could be done in the context of\n\t\t// https://github.com/WordPress/gutenberg/pull/39218\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ pickerRef?.current ] );\n\n\tconst currentInputValue = currentInput === null ? value : currentInput;\n\tconst initialControlValue = isFinite( currentInputValue )\n\t\t? currentInputValue\n\t\t: initialPosition;\n\n\tconst unitButtonTextStyle = getStylesFromColorScheme(\n\t\tstyles.unitButtonText,\n\t\tstyles.unitButtonTextDark\n\t);\n\n\t/* translators: accessibility text. Inform about current unit value. %s: Current unit value. */\n\tconst accessibilityLabel = sprintf( __( 'Current unit is %s' ), unit );\n\n\tconst accessibilityHint =\n\t\tPlatform.OS === 'ios'\n\t\t\t? __( 'Double tap to open Action Sheet with available options' )\n\t\t\t: __( 'Double tap to open Bottom Sheet with available options' );\n\n\tconst renderUnitButton = useMemo( () => {\n\t\tconst unitButton = (\n\t\t\t<View style={ styles.unitButton }>\n\t\t\t\t<Text style={ unitButtonTextStyle }>{ unit }</Text>\n\t\t\t</View>\n\t\t);\n\n\t\tif ( hasUnits( units ) && units?.length > 1 ) {\n\t\t\treturn (\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\tonPress={ onPickerPresent }\n\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t\t>\n\t\t\t\t\t{ unitButton }\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t);\n\t\t}\n\n\t\treturn unitButton;\n\t}, [\n\t\tonPickerPresent,\n\t\taccessibilityLabel,\n\t\taccessibilityHint,\n\t\tunitButtonTextStyle,\n\t\tunit,\n\t\tunits,\n\t] );\n\n\tconst getAnchor = useCallback(\n\t\t() =>\n\t\t\tanchorNodeRef?.current\n\t\t\t\t? findNodeHandle( anchorNodeRef?.current )\n\t\t\t\t: undefined,\n\t\t// Disable reason: this should be fixed by the native team.\n\t\t// It would be great if this could be done in the context of\n\t\t// https://github.com/WordPress/gutenberg/pull/39218\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ anchorNodeRef?.current ]\n\t);\n\n\tconst getDecimal = ( step ) => {\n\t\t// Return the decimal offset based on the step size.\n\t\t// if step size is 0.1 we expect the offset to be 1.\n\t\t// for example 12 + 0.1 we would expect the see 12.1 (not 12.10 or 12 );\n\t\t// steps are defined in the CSS_UNITS and they vary from unit to unit.\n\t\tconst stepToString = step;\n\t\tconst splitStep = stepToString.toString().split( '.' );\n\t\treturn splitStep[ 1 ] ? splitStep[ 1 ].length : 0;\n\t};\n\n\tconst renderUnitPicker = useCallback( () => {\n\t\t// Keeping for legacy reasons, although `false` should not be a valid\n\t\t// value for the `units` prop anymore.\n\t\tif ( units === false ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View style={ styles.unitMenu } ref={ anchorNodeRef }>\n\t\t\t\t{ renderUnitButton }\n\t\t\t\t{ hasUnits( units ) && units?.length > 1 ? (\n\t\t\t\t\t<Picker\n\t\t\t\t\t\tref={ pickerRef }\n\t\t\t\t\t\toptions={ units }\n\t\t\t\t\t\tonChange={ onUnitChange }\n\t\t\t\t\t\thideCancelButton\n\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\tgetAnchor={ getAnchor }\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t</View>\n\t\t);\n\t}, [ pickerRef, units, onUnitChange, getAnchor, renderUnitButton ] );\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\tconst decimalNum = getDecimal( step );\n\n\treturn (\n\t\t<>\n\t\t\t{ unit !== '%' ? (\n\t\t\t\t<StepperCell\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tmax={ max }\n\t\t\t\t\tmin={ min }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tseparatorType={ separatorType }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tstep={ step }\n\t\t\t\t\tdefaultValue={ initialControlValue }\n\t\t\t\t\tshouldDisplayTextInput\n\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\topenUnitPicker={ onPickerPresent }\n\t\t\t\t\tunitLabel={ getAccessibleLabelForUnit( unit ) }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ renderUnitPicker() }\n\t\t\t\t</StepperCell>\n\t\t\t) : (\n\t\t\t\t<RangeCell\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tminimumValue={ min }\n\t\t\t\t\tmaximumValue={ max }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tstep={ step }\n\t\t\t\t\tunit={ unit }\n\t\t\t\t\tdefaultValue={ initialControlValue }\n\t\t\t\t\tseparatorType={ separatorType }\n\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\topenUnitPicker={ onPickerPresent }\n\t\t\t\t\tunitLabel={ getAccessibleLabelForUnit( unit ) }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ renderUnitPicker() }\n\t\t\t\t</RangeCell>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport { useCustomUnits } from './utils';\nexport default memo( withPreferredColorScheme( UnitControl ) );\n"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAWA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAKA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AAA8C,IAAAU,WAAA,GAAAV,OAAA;AAzB9C;AACA;AACA;;AASA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,SAASW,WAAWA,CAAE;EACrBC,YAAY;EACZC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,YAAY;EACZC,eAAe;EACfC,GAAG;EACHC,GAAG;EACHC,aAAa;EACbC,KAAK,GAAGC,gBAAS;EACjBC,IAAI;EACJC,wBAAwB;EACxB,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,SAAS,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC1B,MAAMC,aAAa,GAAG,IAAAD,eAAM,EAAC,CAAC;EAE9B,MAAME,eAAe,GAAG,IAAAC,oBAAW,EAAE,MAAM;IAC1C,IAAKJ,SAAS,EAAEK,OAAO,EAAG;MACzBL,SAAS,CAACK,OAAO,CAACC,aAAa,CAAC,CAAC;IAClC;IACA;IACA;IACA;IACA;EACD,CAAC,EAAE,CAAEN,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rE,GAAK;MACpBL,KAAK,EAAGA,KAAO;MACfiD,IAAI,EAAGA,IAAM;MACbxC,IAAI,EAAGA,IAAM;MACb2D,YAAY,EAAGhD,mBAAqB;MACpCd,aAAa,EAAGA,aAAe;MAC/B4D,UAAU,EAAGA,UAAY;MACzBI,cAAc,EAAGvD,eAAiB;MAClCwD,SAAS,EAAG,IAAAC,gCAAyB,EAAE/D,IAAK,CAAG;MAAA,GAC1CE,KAAK;MAAA2B,QAAA,EAERgB,gBAAgB,CAAC;IAAC,CACV;EACX,CACA,CAAC;AAEL;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAlB,OAAA,GAGc,IAAAmB,aAAI,EAAE,IAAAC,iCAAwB,EAAEjF,WAAY,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_rangeCell","_interopRequireDefault","_stepperCell","_picker","_style","_utils","_element","_compose","_i18n","_jsxRuntime","UnitControl","currentInput","label","value","onChange","onUnitChange","initialPosition","min","max","separatorType","units","CSS_UNITS","unit","getStylesFromColorScheme","props","pickerRef","useRef","anchorNodeRef","onPickerPresent","useCallback","current","presentPicker","currentInputValue","initialControlValue","isFinite","unitButtonTextStyle","styles","unitButtonText","unitButtonTextDark","accessibilityLabel","sprintf","__","accessibilityHint","Platform","OS","renderUnitButton","useMemo","unitButton","jsx","View","style","children","Text","hasUnits","length","TouchableWithoutFeedback","onPress","accessibilityRole","getAnchor","findNodeHandle","undefined","getDecimal","step","stepToString","splitStep","toString","split","renderUnitPicker","jsxs","unitMenu","ref","default","options","hideCancelButton","leftAlign","_activeUnit$step","activeUnit","find","option","decimalNum","Fragment","defaultValue","shouldDisplayTextInput","openUnitPicker","unitLabel","getAccessibleLabelForUnit","minimumValue","maximumValue","_default","exports","memo","withPreferredColorScheme"],"sources":["@wordpress/components/src/unit-control/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tText,\n\tView,\n\tTouchableWithoutFeedback,\n\tPlatform,\n\tfindNodeHandle,\n} from 'react-native';\n\n/**\n * Internal dependencies\n */\nimport RangeCell from '../mobile/bottom-sheet/range-cell';\nimport StepperCell from '../mobile/bottom-sheet/stepper-cell';\nimport Picker from '../mobile/picker';\nimport styles from './style.scss';\nimport { CSS_UNITS, hasUnits, getAccessibleLabelForUnit } from './utils';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useCallback, useMemo, memo } from '@wordpress/element';\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\n\nfunction UnitControl( {\n\tcurrentInput,\n\tlabel,\n\tvalue,\n\tonChange,\n\tonUnitChange,\n\tinitialPosition,\n\tmin,\n\tmax,\n\tseparatorType,\n\tunits = CSS_UNITS,\n\tunit,\n\tgetStylesFromColorScheme,\n\t...props\n} ) {\n\tconst pickerRef = useRef();\n\tconst anchorNodeRef = useRef();\n\n\tconst onPickerPresent = useCallback( () => {\n\t\tif ( pickerRef?.current ) {\n\t\t\tpickerRef.current.presentPicker();\n\t\t}\n\t\t// It would be great if the deps could be addressed in the context of\n\t\t// https://github.com/WordPress/gutenberg/pull/39218\n\t}, [ pickerRef?.current ] );\n\n\tconst currentInputValue = currentInput === null ? value : currentInput;\n\tconst initialControlValue = isFinite( currentInputValue )\n\t\t? currentInputValue\n\t\t: initialPosition;\n\n\tconst unitButtonTextStyle = getStylesFromColorScheme(\n\t\tstyles.unitButtonText,\n\t\tstyles.unitButtonTextDark\n\t);\n\n\t/* translators: accessibility text. Inform about current unit value. %s: Current unit value. */\n\tconst accessibilityLabel = sprintf( __( 'Current unit is %s' ), unit );\n\n\tconst accessibilityHint =\n\t\tPlatform.OS === 'ios'\n\t\t\t? __( 'Double tap to open Action Sheet with available options' )\n\t\t\t: __( 'Double tap to open Bottom Sheet with available options' );\n\n\tconst renderUnitButton = useMemo( () => {\n\t\tconst unitButton = (\n\t\t\t<View style={ styles.unitButton }>\n\t\t\t\t<Text style={ unitButtonTextStyle }>{ unit }</Text>\n\t\t\t</View>\n\t\t);\n\n\t\tif ( hasUnits( units ) && units?.length > 1 ) {\n\t\t\treturn (\n\t\t\t\t<TouchableWithoutFeedback\n\t\t\t\t\tonPress={ onPickerPresent }\n\t\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\t\taccessibilityHint={ accessibilityHint }\n\t\t\t\t>\n\t\t\t\t\t{ unitButton }\n\t\t\t\t</TouchableWithoutFeedback>\n\t\t\t);\n\t\t}\n\n\t\treturn unitButton;\n\t}, [\n\t\tonPickerPresent,\n\t\taccessibilityLabel,\n\t\taccessibilityHint,\n\t\tunitButtonTextStyle,\n\t\tunit,\n\t\tunits,\n\t] );\n\n\tconst getAnchor = useCallback(\n\t\t() =>\n\t\t\tanchorNodeRef?.current\n\t\t\t\t? findNodeHandle( anchorNodeRef?.current )\n\t\t\t\t: undefined,\n\t\t// It would be great if the deps could be addressed in the context of\n\t\t// https://github.com/WordPress/gutenberg/pull/39218\n\t\t[ anchorNodeRef?.current ]\n\t);\n\n\tconst getDecimal = ( step ) => {\n\t\t// Return the decimal offset based on the step size.\n\t\t// if step size is 0.1 we expect the offset to be 1.\n\t\t// for example 12 + 0.1 we would expect the see 12.1 (not 12.10 or 12 );\n\t\t// steps are defined in the CSS_UNITS and they vary from unit to unit.\n\t\tconst stepToString = step;\n\t\tconst splitStep = stepToString.toString().split( '.' );\n\t\treturn splitStep[ 1 ] ? splitStep[ 1 ].length : 0;\n\t};\n\n\tconst renderUnitPicker = useCallback( () => {\n\t\t// Keeping for legacy reasons, although `false` should not be a valid\n\t\t// value for the `units` prop anymore.\n\t\tif ( units === false ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<View style={ styles.unitMenu } ref={ anchorNodeRef }>\n\t\t\t\t{ renderUnitButton }\n\t\t\t\t{ hasUnits( units ) && units?.length > 1 ? (\n\t\t\t\t\t<Picker\n\t\t\t\t\t\tref={ pickerRef }\n\t\t\t\t\t\toptions={ units }\n\t\t\t\t\t\tonChange={ onUnitChange }\n\t\t\t\t\t\thideCancelButton\n\t\t\t\t\t\tleftAlign\n\t\t\t\t\t\tgetAnchor={ getAnchor }\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t</View>\n\t\t);\n\t}, [ pickerRef, units, onUnitChange, getAnchor, renderUnitButton ] );\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\tconst decimalNum = getDecimal( step );\n\n\treturn (\n\t\t<>\n\t\t\t{ unit !== '%' ? (\n\t\t\t\t<StepperCell\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tmax={ max }\n\t\t\t\t\tmin={ min }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tseparatorType={ separatorType }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tstep={ step }\n\t\t\t\t\tdefaultValue={ initialControlValue }\n\t\t\t\t\tshouldDisplayTextInput\n\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\topenUnitPicker={ onPickerPresent }\n\t\t\t\t\tunitLabel={ getAccessibleLabelForUnit( unit ) }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ renderUnitPicker() }\n\t\t\t\t</StepperCell>\n\t\t\t) : (\n\t\t\t\t<RangeCell\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tminimumValue={ min }\n\t\t\t\t\tmaximumValue={ max }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tstep={ step }\n\t\t\t\t\tunit={ unit }\n\t\t\t\t\tdefaultValue={ initialControlValue }\n\t\t\t\t\tseparatorType={ separatorType }\n\t\t\t\t\tdecimalNum={ decimalNum }\n\t\t\t\t\topenUnitPicker={ onPickerPresent }\n\t\t\t\t\tunitLabel={ getAccessibleLabelForUnit( unit ) }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t{ renderUnitPicker() }\n\t\t\t\t</RangeCell>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport { useCustomUnits } from './utils';\nexport default memo( withPreferredColorScheme( UnitControl ) );\n"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAWA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAKA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AAA8C,IAAAU,WAAA,GAAAV,OAAA;AAzB9C;AACA;AACA;;AASA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,SAASW,WAAWA,CAAE;EACrBC,YAAY;EACZC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,YAAY;EACZC,eAAe;EACfC,GAAG;EACHC,GAAG;EACHC,aAAa;EACbC,KAAK,GAAGC,gBAAS;EACjBC,IAAI;EACJC,wBAAwB;EACxB,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,SAAS,GAAG,IAAAC,eAAM,EAAC,CAAC;EAC1B,MAAMC,aAAa,GAAG,IAAAD,eAAM,EAAC,CAAC;EAE9B,MAAME,eAAe,GAAG,IAAAC,oBAAW,EAAE,MAAM;IAC1C,IAAKJ,SAAS,EAAEK,OAAO,EAAG;MACzBL,SAAS,CAACK,OAAO,CAACC,aAAa,CAAC,CAAC;IAClC;IACA;IACA;EACD,CAAC,EAAE,CAAEN,SAAS,EAAEK,OAAO,CAAG,CAAC;EAE3B,MAAME,iBAAiB,GAAGrB,YA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I,EAAGA,IAAM;MACb2D,YAAY,EAAGhD,mBAAqB;MACpCd,aAAa,EAAGA,aAAe;MAC/B4D,UAAU,EAAGA,UAAY;MACzBI,cAAc,EAAGvD,eAAiB;MAClCwD,SAAS,EAAG,IAAAC,gCAAyB,EAAE/D,IAAK,CAAG;MAAA,GAC1CE,KAAK;MAAA2B,QAAA,EAERgB,gBAAgB,CAAC;IAAC,CACV;EACX,CACA,CAAC;AAEL;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAlB,OAAA,GAGc,IAAAmB,aAAI,EAAE,IAAAC,iCAAwB,EAAEjF,WAAY,CAAE,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_element","isWeb","Platform","OS","allUnits","px","value","label","__","a11yLabel","step","em","_x","rem","vw","vh","vmin","vmax","ch","ex","cm","mm","in","pc","pt","svw","svh","svi","svb","svmin","lvw","lvh","lvi","lvb","lvmin","dvw","dvh","dvi","dvb","dvmin","dvmax","svmax","lvmax","ALL_CSS_UNITS","exports","Object","values","CSS_UNITS","DEFAULT_UNIT","getParsedQuantityAndUnit","rawValue","fallbackUnit","allowedUnits","initialValue","parseQuantityAndUnitFromRawValue","hasUnits","units","Array","isArray","length","trimmedValue","quantityToReturn","trim","parsedQuantity","parseFloat","isFinite","undefined","unitMatch","match","matchedUnit","toLowerCase","unitToReturn","find","item","getValidParsedQuantityAndUnit","fallbackQuantity","parsedUnit","getAccessibleLabelForUnit","unit","filterUnitsWithSettings","allowedUnitValues","availableUnits","filter","includes","useCustomUnits","defaultValues","customUnitsToReturn","forEach","i","parsedDefaultValue","default","getUnitsWithCurrentUnit","legacyUnit","unitsToReturn","currentUnit","some","unshift"],"sources":["@wordpress/components/src/unit-control/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WPUnitControlUnit } from './types';\n\nconst isWeb = Platform.OS === 'web';\n\nconst allUnits: Record< string, WPUnitControlUnit > = {\n\tpx: {\n\t\tvalue: 'px',\n\t\tlabel: isWeb ? 'px' : __( 'Pixels (px)' ),\n\t\ta11yLabel: __( 'Pixels (px)' ),\n\t\tstep: 1,\n\t},\n\t'%': {\n\t\tvalue: '%',\n\t\tlabel: isWeb ? '%' : __( 'Percentage (%)' ),\n\t\ta11yLabel: __( 'Percent (%)' ),\n\t\tstep: 0.1,\n\t},\n\tem: {\n\t\tvalue: 'em',\n\t\tlabel: isWeb ? 'em' : __( 'Relative to parent font size (em)' ),\n\t\ta11yLabel: _x( 'ems', 'Relative to parent font size (em)' ),\n\t\tstep: 0.01,\n\t},\n\trem: {\n\t\tvalue: 'rem',\n\t\tlabel: isWeb ? 'rem' : __( 'Relative to root font size (rem)' ),\n\t\ta11yLabel: _x( 'rems', 'Relative to root font size (rem)' ),\n\t\tstep: 0.01,\n\t},\n\tvw: {\n\t\tvalue: 'vw',\n\t\tlabel: isWeb ? 'vw' : __( 'Viewport width (vw)' ),\n\t\ta11yLabel: __( 'Viewport width (vw)' ),\n\t\tstep: 0.1,\n\t},\n\tvh: {\n\t\tvalue: 'vh',\n\t\tlabel: isWeb ? 'vh' : __( 'Viewport height (vh)' ),\n\t\ta11yLabel: __( 'Viewport height (vh)' ),\n\t\tstep: 0.1,\n\t},\n\tvmin: {\n\t\tvalue: 'vmin',\n\t\tlabel: isWeb ? 'vmin' : __( 'Viewport smallest dimension (vmin)' ),\n\t\ta11yLabel: __( 'Viewport smallest dimension (vmin)' ),\n\t\tstep: 0.1,\n\t},\n\tvmax: {\n\t\tvalue: 'vmax',\n\t\tlabel: isWeb ? 'vmax' : __( 'Viewport largest dimension (vmax)' ),\n\t\ta11yLabel: __( 'Viewport largest dimension (vmax)' ),\n\t\tstep: 0.1,\n\t},\n\tch: {\n\t\tvalue: 'ch',\n\t\tlabel: isWeb ? 'ch' : __( 'Width of the zero (0) character (ch)' ),\n\t\ta11yLabel: __( 'Width of the zero (0) character (ch)' ),\n\t\tstep: 0.01,\n\t},\n\tex: {\n\t\tvalue: 'ex',\n\t\tlabel: isWeb ? 'ex' : __( 'x-height of the font (ex)' ),\n\t\ta11yLabel: __( 'x-height of the font (ex)' ),\n\t\tstep: 0.01,\n\t},\n\tcm: {\n\t\tvalue: 'cm',\n\t\tlabel: isWeb ? 'cm' : __( 'Centimeters (cm)' ),\n\t\ta11yLabel: __( 'Centimeters (cm)' ),\n\t\tstep: 0.001,\n\t},\n\tmm: {\n\t\tvalue: 'mm',\n\t\tlabel: isWeb ? 'mm' : __( 'Millimeters (mm)' ),\n\t\ta11yLabel: __( 'Millimeters (mm)' ),\n\t\tstep: 0.1,\n\t},\n\tin: {\n\t\tvalue: 'in',\n\t\tlabel: isWeb ? 'in' : __( 'Inches (in)' ),\n\t\ta11yLabel: __( 'Inches (in)' ),\n\t\tstep: 0.001,\n\t},\n\tpc: {\n\t\tvalue: 'pc',\n\t\tlabel: isWeb ? 'pc' : __( 'Picas (pc)' ),\n\t\ta11yLabel: __( 'Picas (pc)' ),\n\t\tstep: 1,\n\t},\n\tpt: {\n\t\tvalue: 'pt',\n\t\tlabel: isWeb ? 'pt' : __( 'Points (pt)' ),\n\t\ta11yLabel: __( 'Points (pt)' ),\n\t\tstep: 1,\n\t},\n\tsvw: {\n\t\tvalue: 'svw',\n\t\tlabel: isWeb ? 'svw' : __( 'Small viewport width (svw)' ),\n\t\ta11yLabel: __( 'Small viewport width (svw)' ),\n\t\tstep: 0.1,\n\t},\n\tsvh: {\n\t\tvalue: 'svh',\n\t\tlabel: isWeb ? 'svh' : __( 'Small viewport height (svh)' ),\n\t\ta11yLabel: __( 'Small viewport height (svh)' ),\n\t\tstep: 0.1,\n\t},\n\tsvi: {\n\t\tvalue: 'svi',\n\t\tlabel: isWeb\n\t\t\t? 'svi'\n\t\t\t: __( 'Viewport smallest size in the inline direction (svi)' ),\n\t\ta11yLabel: __( 'Small viewport width or height (svi)' ),\n\t\tstep: 0.1,\n\t},\n\tsvb: {\n\t\tvalue: 'svb',\n\t\tlabel: isWeb\n\t\t\t? 'svb'\n\t\t\t: __( 'Viewport smallest size in the block direction (svb)' ),\n\t\ta11yLabel: __( 'Small viewport width or height (svb)' ),\n\t\tstep: 0.1,\n\t},\n\tsvmin: {\n\t\tvalue: 'svmin',\n\t\tlabel: isWeb\n\t\t\t? 'svmin'\n\t\t\t: __( 'Small viewport smallest dimension (svmin)' ),\n\t\ta11yLabel: __( 'Small viewport smallest dimension (svmin)' ),\n\t\tstep: 0.1,\n\t},\n\tlvw: {\n\t\tvalue: 'lvw',\n\t\tlabel: isWeb ? 'lvw' : __( 'Large viewport width (lvw)' ),\n\t\ta11yLabel: __( 'Large viewport width (lvw)' ),\n\t\tstep: 0.1,\n\t},\n\tlvh: {\n\t\tvalue: 'lvh',\n\t\tlabel: isWeb ? 'lvh' : __( 'Large viewport height (lvh)' ),\n\t\ta11yLabel: __( 'Large viewport height (lvh)' ),\n\t\tstep: 0.1,\n\t},\n\tlvi: {\n\t\tvalue: 'lvi',\n\t\tlabel: isWeb ? 'lvi' : __( 'Large viewport width or height (lvi)' ),\n\t\ta11yLabel: __( 'Large viewport width or height (lvi)' ),\n\t\tstep: 0.1,\n\t},\n\tlvb: {\n\t\tvalue: 'lvb',\n\t\tlabel: isWeb ? 'lvb' : __( 'Large viewport width or height (lvb)' ),\n\t\ta11yLabel: __( 'Large viewport width or height (lvb)' ),\n\t\tstep: 0.1,\n\t},\n\tlvmin: {\n\t\tvalue: 'lvmin',\n\t\tlabel: isWeb\n\t\t\t? 'lvmin'\n\t\t\t: __( 'Large viewport smallest dimension (lvmin)' ),\n\t\ta11yLabel: __( 'Large viewport smallest dimension (lvmin)' ),\n\t\tstep: 0.1,\n\t},\n\tdvw: {\n\t\tvalue: 'dvw',\n\t\tlabel: isWeb ? 'dvw' : __( 'Dynamic viewport width (dvw)' ),\n\t\ta11yLabel: __( 'Dynamic viewport width (dvw)' ),\n\t\tstep: 0.1,\n\t},\n\tdvh: {\n\t\tvalue: 'dvh',\n\t\tlabel: isWeb ? 'dvh' : __( 'Dynamic viewport height (dvh)' ),\n\t\ta11yLabel: __( 'Dynamic viewport height (dvh)' ),\n\t\tstep: 0.1,\n\t},\n\tdvi: {\n\t\tvalue: 'dvi',\n\t\tlabel: isWeb ? 'dvi' : __( 'Dynamic viewport width or height (dvi)' ),\n\t\ta11yLabel: __( 'Dynamic viewport width or height (dvi)' ),\n\t\tstep: 0.1,\n\t},\n\tdvb: {\n\t\tvalue: 'dvb',\n\t\tlabel: isWeb ? 'dvb' : __( 'Dynamic viewport width or height (dvb)' ),\n\t\ta11yLabel: __( 'Dynamic viewport width or height (dvb)' ),\n\t\tstep: 0.1,\n\t},\n\tdvmin: {\n\t\tvalue: 'dvmin',\n\t\tlabel: isWeb\n\t\t\t? 'dvmin'\n\t\t\t: __( 'Dynamic viewport smallest dimension (dvmin)' ),\n\t\ta11yLabel: __( 'Dynamic viewport smallest dimension (dvmin)' ),\n\t\tstep: 0.1,\n\t},\n\tdvmax: {\n\t\tvalue: 'dvmax',\n\t\tlabel: isWeb\n\t\t\t? 'dvmax'\n\t\t\t: __( 'Dynamic viewport largest dimension (dvmax)' ),\n\t\ta11yLabel: __( 'Dynamic viewport largest dimension (dvmax)' ),\n\t\tstep: 0.1,\n\t},\n\tsvmax: {\n\t\tvalue: 'svmax',\n\t\tlabel: isWeb\n\t\t\t? 'svmax'\n\t\t\t: __( 'Small viewport largest dimension (svmax)' ),\n\t\ta11yLabel: __( 'Small viewport largest dimension (svmax)' ),\n\t\tstep: 0.1,\n\t},\n\tlvmax: {\n\t\tvalue: 'lvmax',\n\t\tlabel: isWeb\n\t\t\t? 'lvmax'\n\t\t\t: __( 'Large viewport largest dimension (lvmax)' ),\n\t\ta11yLabel: __( 'Large viewport largest dimension (lvmax)' ),\n\t\tstep: 0.1,\n\t},\n};\n\n/**\n * An array of all available CSS length units.\n */\nexport const ALL_CSS_UNITS = Object.values( allUnits );\n\n/**\n * Units of measurements. `a11yLabel` is used by screenreaders.\n */\nexport const CSS_UNITS = [\n\tallUnits.px,\n\tallUnits[ '%' ],\n\tallUnits.em,\n\tallUnits.rem,\n\tallUnits.vw,\n\tallUnits.vh,\n];\n\nexport const DEFAULT_UNIT = allUnits.px;\n\n/**\n * Handles legacy value + unit handling.\n * This component use to manage both incoming value and units separately.\n *\n * Moving forward, ideally the value should be a string that contains both\n * the value and unit, example: '10px'\n *\n * @param rawValue The raw value as a string (may or may not contain the unit)\n * @param fallbackUnit The unit used as a fallback, if not unit is detected in the `value`\n * @param allowedUnits Units to derive from.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly. The unit can be `undefined` in case the unit parse\n * from the raw value could not be matched against the list of allowed units.\n */\nexport function getParsedQuantityAndUnit(\n\trawValue?: string | number,\n\tfallbackUnit?: string,\n\tallowedUnits?: WPUnitControlUnit[]\n): [ number | undefined, string | undefined ] {\n\tconst initialValue = fallbackUnit\n\t\t? `${ rawValue ?? '' }${ fallbackUnit }`\n\t\t: rawValue;\n\n\treturn parseQuantityAndUnitFromRawValue( initialValue, allowedUnits );\n}\n\n/**\n * Checks if units are defined.\n *\n * @param units List of units.\n * @return Whether the list actually contains any units.\n */\nexport function hasUnits(\n\tunits?: WPUnitControlUnit[]\n): units is WPUnitControlUnit[] {\n\t// Although the `isArray` check shouldn't be necessary (given the signature of\n\t// this typed function), it's better to stay on the side of caution, since\n\t// this function may be called from un-typed environments.\n\treturn Array.isArray( units ) && !! units.length;\n}\n\n/**\n * Parses a quantity and unit from a raw string value, given a list of allowed\n * units and otherwise falling back to the default unit.\n *\n * @param rawValue The raw value as a string (may or may not contain the unit)\n * @param allowedUnits Units to derive from.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly. The unit can be `undefined` in case the unit parsed\n * from the raw value could not be matched against the list of allowed units.\n */\nexport function parseQuantityAndUnitFromRawValue(\n\trawValue?: string | number,\n\tallowedUnits: WPUnitControlUnit[] = ALL_CSS_UNITS\n): [ number | undefined, string | undefined ] {\n\tlet trimmedValue;\n\tlet quantityToReturn;\n\n\tif ( typeof rawValue !== 'undefined' || rawValue === null ) {\n\t\ttrimmedValue = `${ rawValue }`.trim();\n\t\tconst parsedQuantity = parseFloat( trimmedValue );\n\t\tquantityToReturn = ! isFinite( parsedQuantity )\n\t\t\t? undefined\n\t\t\t: parsedQuantity;\n\t}\n\n\tconst unitMatch = trimmedValue?.match( /[\\d.\\-\\+]*\\s*(.*)/ );\n\tconst matchedUnit = unitMatch?.[ 1 ]?.toLowerCase();\n\tlet unitToReturn: string | undefined;\n\tif ( hasUnits( allowedUnits ) ) {\n\t\tconst match = allowedUnits.find(\n\t\t\t( item ) => item.value === matchedUnit\n\t\t);\n\t\tunitToReturn = match?.value;\n\t} else {\n\t\tunitToReturn = DEFAULT_UNIT.value;\n\t}\n\n\treturn [ quantityToReturn, unitToReturn ];\n}\n\n/**\n * Parses quantity and unit from a raw value. Validates parsed value, using fallback\n * value if invalid.\n *\n * @param rawValue The next value.\n * @param allowedUnits Units to derive from.\n * @param fallbackQuantity The fallback quantity, used in case it's not possible to parse a valid quantity from the raw value.\n * @param fallbackUnit The fallback unit, used in case it's not possible to parse a valid unit from the raw value.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly, and the `fallbackQuantity` was also `undefined`. The\n * unit can be `undefined` only if the unit parsed from the raw value could not be matched against\n * the list of allowed units, the `fallbackQuantity` is also `undefined` and the list of\n * `allowedUnits` is passed empty.\n */\nexport function getValidParsedQuantityAndUnit(\n\trawValue: string | number,\n\tallowedUnits?: WPUnitControlUnit[],\n\tfallbackQuantity?: number,\n\tfallbackUnit?: string\n): [ number | undefined, string | undefined ] {\n\tconst [ parsedQuantity, parsedUnit ] = parseQuantityAndUnitFromRawValue(\n\t\trawValue,\n\t\tallowedUnits\n\t);\n\n\t// The parsed value from `parseQuantityAndUnitFromRawValue` should now be\n\t// either a real number or undefined. If undefined, use the fallback value.\n\tconst quantityToReturn = parsedQuantity ?? fallbackQuantity;\n\n\t// If no unit is parsed from the raw value, or if the fallback unit is not\n\t// defined, use the first value from the list of allowed units as fallback.\n\tlet unitToReturn = parsedUnit || fallbackUnit;\n\n\tif ( ! unitToReturn && hasUnits( allowedUnits ) ) {\n\t\tunitToReturn = allowedUnits[ 0 ].value;\n\t}\n\n\treturn [ quantityToReturn, unitToReturn ];\n}\n\n/**\n * Takes a unit value and finds the matching accessibility label for the\n * unit abbreviation.\n *\n * @param unit Unit value (example: `px`)\n * @return a11y label for the unit abbreviation\n */\nexport function getAccessibleLabelForUnit( unit: string ): string | undefined {\n\tconst match = ALL_CSS_UNITS.find( ( item ) => item.value === unit );\n\treturn match?.a11yLabel ? match?.a11yLabel : match?.value;\n}\n\n/**\n * Filters available units based on values defined a list of allowed unit values.\n *\n * @param allowedUnitValues Collection of allowed unit value strings.\n * @param availableUnits Collection of available unit objects.\n * @return Filtered units.\n */\nexport function filterUnitsWithSettings(\n\tallowedUnitValues: string[] = [],\n\tavailableUnits: WPUnitControlUnit[]\n): WPUnitControlUnit[] {\n\t// Although the `isArray` check shouldn't be necessary (given the signature of\n\t// this typed function), it's better to stay on the side of caution, since\n\t// this function may be called from un-typed environments.\n\treturn Array.isArray( availableUnits )\n\t\t? availableUnits.filter( ( unit ) =>\n\t\t\t\tallowedUnitValues.includes( unit.value )\n\t\t )\n\t\t: [];\n}\n\n/**\n * Custom hook to retrieve and consolidate units setting from add_theme_support().\n * TODO: ideally this hook shouldn't be needed\n * https://github.com/WordPress/gutenberg/pull/31822#discussion_r633280823\n *\n * @param args An object containing units, settingPath & defaultUnits.\n * @param args.units Collection of all potentially available units.\n * @param args.availableUnits Collection of unit value strings for filtering available units.\n * @param args.defaultValues Collection of default values for defined units. Example: `{ px: 350, em: 15 }`.\n *\n * @return Filtered list of units, with their default values updated following the `defaultValues`\n * argument's property.\n */\nexport const useCustomUnits = ( {\n\tunits = ALL_CSS_UNITS,\n\tavailableUnits = [],\n\tdefaultValues,\n}: {\n\tunits?: WPUnitControlUnit[];\n\tavailableUnits?: string[];\n\tdefaultValues?: Record< string, number >;\n} ): WPUnitControlUnit[] => {\n\tconst customUnitsToReturn = filterUnitsWithSettings(\n\t\tavailableUnits,\n\t\tunits\n\t);\n\n\tif ( defaultValues ) {\n\t\tcustomUnitsToReturn.forEach( ( unit, i ) => {\n\t\t\tif ( defaultValues[ unit.value ] ) {\n\t\t\t\tconst [ parsedDefaultValue ] = parseQuantityAndUnitFromRawValue(\n\t\t\t\t\tdefaultValues[ unit.value ]\n\t\t\t\t);\n\n\t\t\t\tcustomUnitsToReturn[ i ].default = parsedDefaultValue;\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn customUnitsToReturn;\n};\n\n/**\n * Get available units with the unit for the currently selected value\n * prepended if it is not available in the list of units.\n *\n * This is useful to ensure that the current value's unit is always\n * accurately displayed in the UI, even if the intention is to hide\n * the availability of that unit.\n *\n * @param rawValue Selected value to parse.\n * @param legacyUnit Legacy unit value, if rawValue needs it appended.\n * @param units List of available units.\n *\n * @return A collection of units containing the unit for the current value.\n */\nexport function getUnitsWithCurrentUnit(\n\trawValue?: string | number,\n\tlegacyUnit?: string,\n\tunits: WPUnitControlUnit[] = ALL_CSS_UNITS\n): WPUnitControlUnit[] {\n\tconst unitsToReturn = Array.isArray( units ) ? [ ...units ] : [];\n\tconst [ , currentUnit ] = getParsedQuantityAndUnit(\n\t\trawValue,\n\t\tlegacyUnit,\n\t\tALL_CSS_UNITS\n\t);\n\n\tif (\n\t\tcurrentUnit &&\n\t\t! unitsToReturn.some( ( unit ) => unit.value === currentUnit )\n\t) {\n\t\tif ( allUnits[ currentUnit ] ) {\n\t\t\tunitsToReturn.unshift( allUnits[ currentUnit ] );\n\t\t}\n\t}\n\n\treturn unitsToReturn;\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA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C9BD,aAAa,CAACG,OAAO,CAAE5F,QAAQ,CAAE0F,WAAW,CAAG,CAAC;IACjD;EACD;EAEA,OAAOD,aAAa;AACrB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_element","isWeb","Platform","OS","allUnits","px","value","label","__","a11yLabel","step","em","_x","rem","vw","vh","vmin","vmax","ch","ex","cm","mm","in","pc","pt","svw","svh","svi","svb","svmin","lvw","lvh","lvi","lvb","lvmin","dvw","dvh","dvi","dvb","dvmin","dvmax","svmax","lvmax","ALL_CSS_UNITS","exports","Object","values","CSS_UNITS","DEFAULT_UNIT","getParsedQuantityAndUnit","rawValue","fallbackUnit","allowedUnits","initialValue","parseQuantityAndUnitFromRawValue","hasUnits","units","Array","isArray","length","trimmedValue","quantityToReturn","trim","parsedQuantity","parseFloat","isFinite","undefined","unitMatch","match","matchedUnit","toLowerCase","unitToReturn","find","item","getValidParsedQuantityAndUnit","fallbackQuantity","parsedUnit","getAccessibleLabelForUnit","unit","filterUnitsWithSettings","allowedUnitValues","availableUnits","filter","includes","useCustomUnits","defaultValues","customUnitsToReturn","forEach","i","parsedDefaultValue","default","getUnitsWithCurrentUnit","legacyUnit","unitsToReturn","currentUnit","some","unshift"],"sources":["@wordpress/components/src/unit-control/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { Platform } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WPUnitControlUnit } from './types';\n\nconst isWeb = Platform.OS === 'web';\n\nconst allUnits: Record< string, WPUnitControlUnit > = {\n\tpx: {\n\t\tvalue: 'px',\n\t\tlabel: isWeb ? 'px' : __( 'Pixels (px)' ),\n\t\ta11yLabel: __( 'Pixels (px)' ),\n\t\tstep: 1,\n\t},\n\t'%': {\n\t\tvalue: '%',\n\t\tlabel: isWeb ? '%' : __( 'Percentage (%)' ),\n\t\ta11yLabel: __( 'Percent (%)' ),\n\t\tstep: 0.1,\n\t},\n\tem: {\n\t\tvalue: 'em',\n\t\tlabel: isWeb ? 'em' : __( 'Relative to parent font size (em)' ),\n\t\ta11yLabel: _x( 'ems', 'Relative to parent font size (em)' ),\n\t\tstep: 0.01,\n\t},\n\trem: {\n\t\tvalue: 'rem',\n\t\tlabel: isWeb ? 'rem' : __( 'Relative to root font size (rem)' ),\n\t\ta11yLabel: _x( 'rems', 'Relative to root font size (rem)' ),\n\t\tstep: 0.01,\n\t},\n\tvw: {\n\t\tvalue: 'vw',\n\t\tlabel: isWeb ? 'vw' : __( 'Viewport width (vw)' ),\n\t\ta11yLabel: __( 'Viewport width (vw)' ),\n\t\tstep: 0.1,\n\t},\n\tvh: {\n\t\tvalue: 'vh',\n\t\tlabel: isWeb ? 'vh' : __( 'Viewport height (vh)' ),\n\t\ta11yLabel: __( 'Viewport height (vh)' ),\n\t\tstep: 0.1,\n\t},\n\tvmin: {\n\t\tvalue: 'vmin',\n\t\tlabel: isWeb ? 'vmin' : __( 'Viewport smallest dimension (vmin)' ),\n\t\ta11yLabel: __( 'Viewport smallest dimension (vmin)' ),\n\t\tstep: 0.1,\n\t},\n\tvmax: {\n\t\tvalue: 'vmax',\n\t\tlabel: isWeb ? 'vmax' : __( 'Viewport largest dimension (vmax)' ),\n\t\ta11yLabel: __( 'Viewport largest dimension (vmax)' ),\n\t\tstep: 0.1,\n\t},\n\tch: {\n\t\tvalue: 'ch',\n\t\tlabel: isWeb ? 'ch' : __( 'Width of the zero (0) character (ch)' ),\n\t\ta11yLabel: __( 'Width of the zero (0) character (ch)' ),\n\t\tstep: 0.01,\n\t},\n\tex: {\n\t\tvalue: 'ex',\n\t\tlabel: isWeb ? 'ex' : __( 'x-height of the font (ex)' ),\n\t\ta11yLabel: __( 'x-height of the font (ex)' ),\n\t\tstep: 0.01,\n\t},\n\tcm: {\n\t\tvalue: 'cm',\n\t\tlabel: isWeb ? 'cm' : __( 'Centimeters (cm)' ),\n\t\ta11yLabel: __( 'Centimeters (cm)' ),\n\t\tstep: 0.001,\n\t},\n\tmm: {\n\t\tvalue: 'mm',\n\t\tlabel: isWeb ? 'mm' : __( 'Millimeters (mm)' ),\n\t\ta11yLabel: __( 'Millimeters (mm)' ),\n\t\tstep: 0.1,\n\t},\n\tin: {\n\t\tvalue: 'in',\n\t\tlabel: isWeb ? 'in' : __( 'Inches (in)' ),\n\t\ta11yLabel: __( 'Inches (in)' ),\n\t\tstep: 0.001,\n\t},\n\tpc: {\n\t\tvalue: 'pc',\n\t\tlabel: isWeb ? 'pc' : __( 'Picas (pc)' ),\n\t\ta11yLabel: __( 'Picas (pc)' ),\n\t\tstep: 1,\n\t},\n\tpt: {\n\t\tvalue: 'pt',\n\t\tlabel: isWeb ? 'pt' : __( 'Points (pt)' ),\n\t\ta11yLabel: __( 'Points (pt)' ),\n\t\tstep: 1,\n\t},\n\tsvw: {\n\t\tvalue: 'svw',\n\t\tlabel: isWeb ? 'svw' : __( 'Small viewport width (svw)' ),\n\t\ta11yLabel: __( 'Small viewport width (svw)' ),\n\t\tstep: 0.1,\n\t},\n\tsvh: {\n\t\tvalue: 'svh',\n\t\tlabel: isWeb ? 'svh' : __( 'Small viewport height (svh)' ),\n\t\ta11yLabel: __( 'Small viewport height (svh)' ),\n\t\tstep: 0.1,\n\t},\n\tsvi: {\n\t\tvalue: 'svi',\n\t\tlabel: isWeb\n\t\t\t? 'svi'\n\t\t\t: __( 'Viewport smallest size in the inline direction (svi)' ),\n\t\ta11yLabel: __( 'Small viewport width or height (svi)' ),\n\t\tstep: 0.1,\n\t},\n\tsvb: {\n\t\tvalue: 'svb',\n\t\tlabel: isWeb\n\t\t\t? 'svb'\n\t\t\t: __( 'Viewport smallest size in the block direction (svb)' ),\n\t\ta11yLabel: __( 'Small viewport width or height (svb)' ),\n\t\tstep: 0.1,\n\t},\n\tsvmin: {\n\t\tvalue: 'svmin',\n\t\tlabel: isWeb\n\t\t\t? 'svmin'\n\t\t\t: __( 'Small viewport smallest dimension (svmin)' ),\n\t\ta11yLabel: __( 'Small viewport smallest dimension (svmin)' ),\n\t\tstep: 0.1,\n\t},\n\tlvw: {\n\t\tvalue: 'lvw',\n\t\tlabel: isWeb ? 'lvw' : __( 'Large viewport width (lvw)' ),\n\t\ta11yLabel: __( 'Large viewport width (lvw)' ),\n\t\tstep: 0.1,\n\t},\n\tlvh: {\n\t\tvalue: 'lvh',\n\t\tlabel: isWeb ? 'lvh' : __( 'Large viewport height (lvh)' ),\n\t\ta11yLabel: __( 'Large viewport height (lvh)' ),\n\t\tstep: 0.1,\n\t},\n\tlvi: {\n\t\tvalue: 'lvi',\n\t\tlabel: isWeb ? 'lvi' : __( 'Large viewport width or height (lvi)' ),\n\t\ta11yLabel: __( 'Large viewport width or height (lvi)' ),\n\t\tstep: 0.1,\n\t},\n\tlvb: {\n\t\tvalue: 'lvb',\n\t\tlabel: isWeb ? 'lvb' : __( 'Large viewport width or height (lvb)' ),\n\t\ta11yLabel: __( 'Large viewport width or height (lvb)' ),\n\t\tstep: 0.1,\n\t},\n\tlvmin: {\n\t\tvalue: 'lvmin',\n\t\tlabel: isWeb\n\t\t\t? 'lvmin'\n\t\t\t: __( 'Large viewport smallest dimension (lvmin)' ),\n\t\ta11yLabel: __( 'Large viewport smallest dimension (lvmin)' ),\n\t\tstep: 0.1,\n\t},\n\tdvw: {\n\t\tvalue: 'dvw',\n\t\tlabel: isWeb ? 'dvw' : __( 'Dynamic viewport width (dvw)' ),\n\t\ta11yLabel: __( 'Dynamic viewport width (dvw)' ),\n\t\tstep: 0.1,\n\t},\n\tdvh: {\n\t\tvalue: 'dvh',\n\t\tlabel: isWeb ? 'dvh' : __( 'Dynamic viewport height (dvh)' ),\n\t\ta11yLabel: __( 'Dynamic viewport height (dvh)' ),\n\t\tstep: 0.1,\n\t},\n\tdvi: {\n\t\tvalue: 'dvi',\n\t\tlabel: isWeb ? 'dvi' : __( 'Dynamic viewport width or height (dvi)' ),\n\t\ta11yLabel: __( 'Dynamic viewport width or height (dvi)' ),\n\t\tstep: 0.1,\n\t},\n\tdvb: {\n\t\tvalue: 'dvb',\n\t\tlabel: isWeb ? 'dvb' : __( 'Dynamic viewport width or height (dvb)' ),\n\t\ta11yLabel: __( 'Dynamic viewport width or height (dvb)' ),\n\t\tstep: 0.1,\n\t},\n\tdvmin: {\n\t\tvalue: 'dvmin',\n\t\tlabel: isWeb\n\t\t\t? 'dvmin'\n\t\t\t: __( 'Dynamic viewport smallest dimension (dvmin)' ),\n\t\ta11yLabel: __( 'Dynamic viewport smallest dimension (dvmin)' ),\n\t\tstep: 0.1,\n\t},\n\tdvmax: {\n\t\tvalue: 'dvmax',\n\t\tlabel: isWeb\n\t\t\t? 'dvmax'\n\t\t\t: __( 'Dynamic viewport largest dimension (dvmax)' ),\n\t\ta11yLabel: __( 'Dynamic viewport largest dimension (dvmax)' ),\n\t\tstep: 0.1,\n\t},\n\tsvmax: {\n\t\tvalue: 'svmax',\n\t\tlabel: isWeb\n\t\t\t? 'svmax'\n\t\t\t: __( 'Small viewport largest dimension (svmax)' ),\n\t\ta11yLabel: __( 'Small viewport largest dimension (svmax)' ),\n\t\tstep: 0.1,\n\t},\n\tlvmax: {\n\t\tvalue: 'lvmax',\n\t\tlabel: isWeb\n\t\t\t? 'lvmax'\n\t\t\t: __( 'Large viewport largest dimension (lvmax)' ),\n\t\ta11yLabel: __( 'Large viewport largest dimension (lvmax)' ),\n\t\tstep: 0.1,\n\t},\n};\n\n/**\n * An array of all available CSS length units.\n */\nexport const ALL_CSS_UNITS = Object.values( allUnits );\n\n/**\n * Units of measurements. `a11yLabel` is used by screenreaders.\n */\nexport const CSS_UNITS = [\n\tallUnits.px,\n\tallUnits[ '%' ],\n\tallUnits.em,\n\tallUnits.rem,\n\tallUnits.vw,\n\tallUnits.vh,\n];\n\nexport const DEFAULT_UNIT = allUnits.px;\n\n/**\n * Handles legacy value + unit handling.\n * This component use to manage both incoming value and units separately.\n *\n * Moving forward, ideally the value should be a string that contains both\n * the value and unit, example: '10px'\n *\n * @param rawValue The raw value as a string (may or may not contain the unit)\n * @param fallbackUnit The unit used as a fallback, if not unit is detected in the `value`\n * @param allowedUnits Units to derive from.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly. The unit can be `undefined` in case the unit parse\n * from the raw value could not be matched against the list of allowed units.\n */\nexport function getParsedQuantityAndUnit(\n\trawValue?: string | number,\n\tfallbackUnit?: string,\n\tallowedUnits?: WPUnitControlUnit[]\n): [ number | undefined, string | undefined ] {\n\tconst initialValue = fallbackUnit\n\t\t? `${ rawValue ?? '' }${ fallbackUnit }`\n\t\t: rawValue;\n\n\treturn parseQuantityAndUnitFromRawValue( initialValue, allowedUnits );\n}\n\n/**\n * Checks if units are defined.\n *\n * @param units List of units.\n * @return Whether the list actually contains any units.\n */\nexport function hasUnits(\n\tunits?: WPUnitControlUnit[]\n): units is WPUnitControlUnit[] {\n\t// Although the `isArray` check shouldn't be necessary (given the signature of\n\t// this typed function), it's better to stay on the side of caution, since\n\t// this function may be called from un-typed environments.\n\treturn Array.isArray( units ) && !! units.length;\n}\n\n/**\n * Parses a quantity and unit from a raw string value, given a list of allowed\n * units and otherwise falling back to the default unit.\n *\n * @param rawValue The raw value as a string (may or may not contain the unit)\n * @param allowedUnits Units to derive from.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly. The unit can be `undefined` in case the unit parsed\n * from the raw value could not be matched against the list of allowed units.\n */\nexport function parseQuantityAndUnitFromRawValue(\n\trawValue?: string | number,\n\tallowedUnits: WPUnitControlUnit[] = ALL_CSS_UNITS\n): [ number | undefined, string | undefined ] {\n\tlet trimmedValue;\n\tlet quantityToReturn;\n\n\tif ( typeof rawValue !== 'undefined' || rawValue === null ) {\n\t\ttrimmedValue = `${ rawValue }`.trim();\n\t\tconst parsedQuantity = parseFloat( trimmedValue );\n\t\tquantityToReturn = ! isFinite( parsedQuantity )\n\t\t\t? undefined\n\t\t\t: parsedQuantity;\n\t}\n\n\tconst unitMatch = trimmedValue?.match( /[\\d.\\-\\+]*\\s*(.*)/ );\n\tconst matchedUnit = unitMatch?.[ 1 ]?.toLowerCase();\n\tlet unitToReturn: string | undefined;\n\tif ( hasUnits( allowedUnits ) ) {\n\t\tconst match = allowedUnits.find(\n\t\t\t( item ) => item.value === matchedUnit\n\t\t);\n\t\tunitToReturn = match?.value;\n\t} else {\n\t\tunitToReturn = DEFAULT_UNIT.value;\n\t}\n\n\treturn [ quantityToReturn, unitToReturn ];\n}\n\n/**\n * Parses quantity and unit from a raw value. Validates parsed value, using fallback\n * value if invalid.\n *\n * @param rawValue The next value.\n * @param allowedUnits Units to derive from.\n * @param fallbackQuantity The fallback quantity, used in case it's not possible to parse a valid quantity from the raw value.\n * @param fallbackUnit The fallback unit, used in case it's not possible to parse a valid unit from the raw value.\n * @return The extracted quantity and unit. The quantity can be `undefined` in case the raw value\n * could not be parsed to a number correctly, and the `fallbackQuantity` was also `undefined`. The\n * unit can be `undefined` only if the unit parsed from the raw value could not be matched against\n * the list of allowed units, the `fallbackQuantity` is also `undefined` and the list of\n * `allowedUnits` is passed empty.\n */\nexport function getValidParsedQuantityAndUnit(\n\trawValue: string | number,\n\tallowedUnits?: WPUnitControlUnit[],\n\tfallbackQuantity?: number,\n\tfallbackUnit?: string\n): [ number | undefined, string | undefined ] {\n\tconst [ parsedQuantity, parsedUnit ] = parseQuantityAndUnitFromRawValue(\n\t\trawValue,\n\t\tallowedUnits\n\t);\n\n\t// The parsed value from `parseQuantityAndUnitFromRawValue` should now be\n\t// either a real number or undefined. If undefined, use the fallback value.\n\tconst quantityToReturn = parsedQuantity ?? fallbackQuantity;\n\n\t// If no unit is parsed from the raw value, or if the fallback unit is not\n\t// defined, use the first value from the list of allowed units as fallback.\n\tlet unitToReturn = parsedUnit || fallbackUnit;\n\n\tif ( ! unitToReturn && hasUnits( allowedUnits ) ) {\n\t\tunitToReturn = allowedUnits[ 0 ].value;\n\t}\n\n\treturn [ quantityToReturn, unitToReturn ];\n}\n\n/**\n * Takes a unit value and finds the matching accessibility label for the\n * unit abbreviation.\n *\n * @param unit Unit value (example: `px`)\n * @return a11y label for the unit abbreviation\n */\nexport function getAccessibleLabelForUnit( unit: string ): string | undefined {\n\tconst match = ALL_CSS_UNITS.find( ( item ) => item.value === unit );\n\treturn match?.a11yLabel ? match?.a11yLabel : match?.value;\n}\n\n/**\n * Filters available units based on values defined a list of allowed unit values.\n *\n * @param allowedUnitValues Collection of allowed unit value strings.\n * @param availableUnits Collection of available unit objects.\n * @return Filtered units.\n */\nexport function filterUnitsWithSettings(\n\tallowedUnitValues: string[] = [],\n\tavailableUnits: WPUnitControlUnit[]\n): WPUnitControlUnit[] {\n\t// Although the `isArray` check shouldn't be necessary (given the signature of\n\t// this typed function), it's better to stay on the side of caution, since\n\t// this function may be called from un-typed environments.\n\treturn Array.isArray( availableUnits )\n\t\t? availableUnits.filter( ( unit ) =>\n\t\t\t\tallowedUnitValues.includes( unit.value )\n\t\t )\n\t\t: [];\n}\n\n/**\n * Custom hook to retrieve and consolidate units setting from add_theme_support().\n * TODO: ideally this hook shouldn't be needed\n * https://github.com/WordPress/gutenberg/pull/31822#discussion_r633280823\n *\n * @param args An object containing units, settingPath & defaultUnits.\n * @param args.units Collection of all potentially available units.\n * @param args.availableUnits Collection of unit value strings for filtering available units.\n * @param args.defaultValues Collection of default values for defined units. Example: `{ px: 350, em: 15 }`.\n *\n * @return Filtered list of units, with their default values updated following the `defaultValues`\n * argument's property.\n */\nexport const useCustomUnits = ( {\n\tunits = ALL_CSS_UNITS,\n\tavailableUnits = [],\n\tdefaultValues,\n}: {\n\tunits?: WPUnitControlUnit[];\n\tavailableUnits?: string[];\n\tdefaultValues?: Record< string, number >;\n} ): WPUnitControlUnit[] => {\n\tconst customUnitsToReturn = filterUnitsWithSettings(\n\t\tavailableUnits,\n\t\tunits\n\t);\n\n\tif ( defaultValues ) {\n\t\tcustomUnitsToReturn.forEach( ( unit, i ) => {\n\t\t\tif ( defaultValues[ unit.value ] ) {\n\t\t\t\tconst [ parsedDefaultValue ] = parseQuantityAndUnitFromRawValue(\n\t\t\t\t\tdefaultValues[ unit.value ]\n\t\t\t\t);\n\n\t\t\t\tcustomUnitsToReturn[ i ].default = parsedDefaultValue;\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn customUnitsToReturn;\n};\n\n/**\n * Get available units with the unit for the currently selected value\n * prepended if it is not available in the list of units.\n *\n * This is useful to ensure that the current value's unit is always\n * accurately displayed in the UI, even if the intention is to hide\n * the availability of that unit.\n *\n * @param rawValue Selected value to parse.\n * @param legacyUnit Legacy unit value, if rawValue needs it appended.\n * @param units List of available units.\n *\n * @return A collection of units containing the unit for the current value.\n */\nexport function getUnitsWithCurrentUnit(\n\trawValue?: string | number,\n\tlegacyUnit?: string,\n\tunits: WPUnitControlUnit[] = ALL_CSS_UNITS\n): WPUnitControlUnit[] {\n\tconst unitsToReturn = Array.isArray( units ) ? [ ...units ] : [];\n\tconst [ , currentUnit ] = getParsedQuantityAndUnit(\n\t\trawValue,\n\t\tlegacyUnit,\n\t\tALL_CSS_UNITS\n\t);\n\n\tif (\n\t\tcurrentUnit &&\n\t\t! unitsToReturn.some( ( unit ) => unit.value === currentUnit )\n\t) {\n\t\tif ( allUnits[ currentUnit ] ) {\n\t\t\tunitsToReturn.unshift( allUnits[ currentUnit ] );\n\t\t}\n\t}\n\n\treturn unitsToReturn;\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;;AAGA,MAAME,KAAK,GAAGC,iBAAQ,CAACC,EAAE,KAAK,KAAK;AAEnC,MAAMC,QAA6C,GAAG;EACrDC,EAAE,EAAE;IACHC,KAAK,EAAE,IAAI;IACXC,KAAK,EAAEN,KAAK,GAAG,IAAI,GAAG,IAAAO,QAAE,EAAE,aAAc,CAAC;IACzCC,SAAS,EAAE,IAAAD,QAAE,EAAE,aAAc,CAAC;IAC9BE,IAAI,EAAE;EACP,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;IACpBC,mBAAmB,CAACC,OAAO,CAAE,CAAET,IAAI,EAAEU,CAAC,KAAM;MAC3C,IAAKH,aAAa,CAAEP,IAAI,CAACxE,KAAK,CAAE,EAAG;QAClC,MAAM,CAAEmF,kBAAkB,CAAE,GAAGnC,gCAAgC,CAC9D+B,aAAa,CAAEP,IAAI,CAACxE,KAAK,CAC1B,CAAC;QAEDgF,mBAAmB,CAAEE,CAAC,CAAE,CAACE,OAAO,GAAGD,kBAAkB;MACtD;IACD,CAAE,CAAC;EACJ;EAEA,OAAOH,mBAAmB;AAC3B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAbA1C,OAAA,CAAAwC,cAAA,GAAAA,cAAA;AAcO,SAASO,uBAAuBA,CACtCzC,QAA0B,EAC1B0C,UAAmB,EACnBpC,KAA0B,GAAGb,aAAa,EACpB;EACtB,MAAMkD,aAAa,GAAGpC,KAAK,CAACC,OAAO,CAAEF,KAAM,CAAC,GAAG,CAAE,GAAGA,KAAK,CAAE,GAAG,EAAE;EAChE,MAAM,GAAIsC,WAAW,CAAE,GAAG7C,wBAAwB,CACjDC,QAAQ,EACR0C,UAAU,EACVjD,aACD,CAAC;EAED,IACCmD,WAAW,IACX,CAAED,aAAa,CAACE,IAAI,CAAIjB,IAAI,IAAMA,IAAI,CAACxE,KAAK,KAAKwF,WAAY,CAAC,EAC7D;IACD,IAAK1F,QAAQ,CAAE0F,WAAW,CAAE,EAAG;MAC9BD,aAAa,CAACG,OAAO,CAAE5F,QAAQ,CAAE0F,WAAW,CAAG,CAAC;IACjD;EACD;EAEA,OAAOD,aAAa;AACrB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_breakpointValues","_interopRequireDefault","require","breakpoint","point","breakpoints","exports"],"sources":["@wordpress/components/src/utils/breakpoint.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport breakpoints from './breakpoint-values';\n\n/**\n * @param {keyof breakpoints} point\n * @return {string} Media query declaration.\n */\nexport const breakpoint = ( point ) =>\n\t`@media (min-width: ${ breakpoints[ point ] })`;\n"],"mappings":";;;;;;;AAGA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACO,MAAMC,UAAU,GAAKC,KAAK,IAC/B,sBAAsBC,yBAAW,CAAED,KAAK,CAAI,GAAE;AAACE,OAAA,CAAAH,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_breakpointValues","_interopRequireDefault","require","breakpoint","point","breakpoints","exports"],"sources":["@wordpress/components/src/utils/breakpoint.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport breakpoints from './breakpoint-values';\n\n/**\n * @param {keyof breakpoints} point\n * @return {string} Media query declaration.\n */\nexport const breakpoint = ( point ) =>\n\t`@media (min-width: ${ breakpoints[ point ] })`;\n"],"mappings":";;;;;;;AAGA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACO,MAAMC,UAAU,GAAKC,KAAK,IAChC,sBAAuBC,yBAAW,CAAED,KAAK,CAAE,GAAI;AAACE,OAAA,CAAAH,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["white","GRAY","ALERT","yellow","red","green","THEME","accent","accentDarker10","accentDarker20","accentInverted","background","foreground","foregroundInverted","gray","UI","backgroundDisabled","border","borderHover","borderFocus","borderDisabled","textDisabled","darkGrayPlaceholder","lightGrayPlaceholder","COLORS","exports","Object","freeze","alert","theme","ui","_default","default"],"sources":["@wordpress/components/src/utils/colors-values.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nconst white = '#fff';\n\n// Matches the grays in @wordpress/base-styles\nconst GRAY = {\n\t900: '#1e1e1e',\n\t800: '#2f2f2f',\n\t/** Meets 4.6:1 text contrast against white. */\n\t700: '#757575',\n\t/** Meets 3:1 UI or large text contrast against white. */\n\t600: '#949494',\n\t400: '#ccc',\n\t/** Used for most borders. */\n\t300: '#ddd',\n\t/** Used sparingly for light borders. */\n\t200: '#e0e0e0',\n\t/** Used for light gray backgrounds. */\n\t100: '#f0f0f0',\n};\n\n// Matches @wordpress/base-styles\nconst ALERT = {\n\tyellow: '#f0b849',\n\tred: '#d94f4f',\n\tgreen: '#4ab866',\n};\n\n// Should match packages/components/src/utils/theme-variables.scss\nconst THEME = {\n\taccent: `var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))`,\n\taccentDarker10: `var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6))`,\n\taccentDarker20: `var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #183ad6))`,\n\t/** Used when placing text on the accent color. */\n\taccentInverted: `var(--wp-components-color-accent-inverted, ${ white })`,\n\n\tbackground: `var(--wp-components-color-background, ${ white })`,\n\n\tforeground: `var(--wp-components-color-foreground, ${ GRAY[ 900 ] })`,\n\t/** Used when placing text on the foreground color. */\n\tforegroundInverted: `var(--wp-components-color-foreground-inverted, ${ white })`,\n\n\tgray: {\n\t\t/** @deprecated Use `COLORS.theme.foreground` instead. */\n\t\t900: `var(--wp-components-color-foreground, ${ GRAY[ 900 ] })`,\n\t\t800: `var(--wp-components-color-gray-800, ${ GRAY[ 800 ] })`,\n\t\t700: `var(--wp-components-color-gray-700, ${ GRAY[ 700 ] })`,\n\t\t600: `var(--wp-components-color-gray-600, ${ GRAY[ 600 ] })`,\n\t\t400: `var(--wp-components-color-gray-400, ${ GRAY[ 400 ] })`,\n\t\t300: `var(--wp-components-color-gray-300, ${ GRAY[ 300 ] })`,\n\t\t200: `var(--wp-components-color-gray-200, ${ GRAY[ 200 ] })`,\n\t\t100: `var(--wp-components-color-gray-100, ${ GRAY[ 100 ] })`,\n\t},\n};\n\nconst UI = {\n\tbackground: THEME.background,\n\tbackgroundDisabled: THEME.gray[ 100 ],\n\tborder: THEME.gray[ 600 ],\n\tborderHover: THEME.gray[ 700 ],\n\tborderFocus: THEME.accent,\n\tborderDisabled: THEME.gray[ 400 ],\n\ttextDisabled: THEME.gray[ 600 ],\n\n\t// Matches @wordpress/base-styles\n\tdarkGrayPlaceholder: `color-mix(in srgb, ${ THEME.foreground }, transparent 38%)`,\n\tlightGrayPlaceholder: `color-mix(in srgb, ${ THEME.background }, transparent 35%)`,\n};\n\nexport const COLORS = Object.freeze( {\n\t/**\n\t * The main gray color object.\n\t *\n\t * @deprecated Use semantic aliases in `COLORS.ui` or theme-ready variables in `COLORS.theme.gray`.\n\t */\n\tgray: GRAY, // TODO: Stop exporting this when everything is migrated to `theme` or `ui`\n\twhite,\n\talert: ALERT,\n\t/**\n\t * Theme-ready variables with fallbacks.\n\t *\n\t * Prefer semantic aliases in `COLORS.ui` when applicable.\n\t */\n\ttheme: THEME,\n\t/**\n\t * Semantic aliases (prefer these over raw variables when applicable).\n\t */\n\tui: UI,\n} );\n\nexport default COLORS;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA,MAAMA,KAAK,GAAG,MAAM;;AAEpB;AACA,MAAMC,IAAI,GAAG;EACZ,GAAG,EAAE,SAAS;EACd,GAAG,EAAE,SAAS;EACd;EACA,GAAG,EAAE,SAAS;EACd;EACA,GAAG,EAAE,SAAS;EACd,GAAG,EAAE,MAAM;EACX;EACA,GAAG,EAAE,MAAM;EACX;EACA,GAAG,EAAE,SAAS;EACd;EACA,GAAG,EAAE;AACN,CAAC;;AAED;AACA,MAAMC,KAAK,GAAG;EACbC,MAAM,EAAE,SAAS;EACjBC,GAAG,EAAE,SAAS;EACdC,KAAK,EAAE;AACR,CAAC;;AAED;AACA,MAAMC,KAAK,GAAG;EACbC,MAAM,EAAG,yEAAwE;EACjFC,cAAc,EAAG,6FAA4F;EAC7GC,cAAc,EAAG,6FAA4F;EAC7G;EACAC,cAAc,EAAG,8CAA8CV,KAAO,GAAE;EAExEW,UAAU,EAAG,yCAAyCX,KAAO,GAAE;EAE/DY,UAAU,E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IAAI,EAAEb,IAAI;EAAE;EACZD,KAAK;EACL4B,KAAK,EAAE1B,KAAK;EACZ;AACD;AACA;AACA;AACA;EACC2B,KAAK,EAAEvB,KAAK;EACZ;AACD;AACA;EACCwB,EAAE,EAAEf;AACL,CAAE,CAAC;AAAC,IAAAgB,QAAA,GAAAN,OAAA,CAAAO,OAAA,GAEWR,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["white","GRAY","ALERT","yellow","red","green","THEME","accent","accentDarker10","accentDarker20","accentInverted","background","foreground","foregroundInverted","gray","UI","backgroundDisabled","border","borderHover","borderFocus","borderDisabled","textDisabled","darkGrayPlaceholder","lightGrayPlaceholder","COLORS","exports","Object","freeze","alert","theme","ui","_default","default"],"sources":["@wordpress/components/src/utils/colors-values.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nconst white = '#fff';\n\n// Matches the grays in @wordpress/base-styles\nconst GRAY = {\n\t900: '#1e1e1e',\n\t800: '#2f2f2f',\n\t/** Meets 4.6:1 text contrast against white. */\n\t700: '#757575',\n\t/** Meets 3:1 UI or large text contrast against white. */\n\t600: '#949494',\n\t400: '#ccc',\n\t/** Used for most borders. */\n\t300: '#ddd',\n\t/** Used sparingly for light borders. */\n\t200: '#e0e0e0',\n\t/** Used for light gray backgrounds. */\n\t100: '#f0f0f0',\n};\n\n// Matches @wordpress/base-styles\nconst ALERT = {\n\tyellow: '#f0b849',\n\tred: '#d94f4f',\n\tgreen: '#4ab866',\n};\n\n// Should match packages/components/src/utils/theme-variables.scss\nconst THEME = {\n\taccent: `var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))`,\n\taccentDarker10: `var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6))`,\n\taccentDarker20: `var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #183ad6))`,\n\t/** Used when placing text on the accent color. */\n\taccentInverted: `var(--wp-components-color-accent-inverted, ${ white })`,\n\n\tbackground: `var(--wp-components-color-background, ${ white })`,\n\n\tforeground: `var(--wp-components-color-foreground, ${ GRAY[ 900 ] })`,\n\t/** Used when placing text on the foreground color. */\n\tforegroundInverted: `var(--wp-components-color-foreground-inverted, ${ white })`,\n\n\tgray: {\n\t\t/** @deprecated Use `COLORS.theme.foreground` instead. */\n\t\t900: `var(--wp-components-color-foreground, ${ GRAY[ 900 ] })`,\n\t\t800: `var(--wp-components-color-gray-800, ${ GRAY[ 800 ] })`,\n\t\t700: `var(--wp-components-color-gray-700, ${ GRAY[ 700 ] })`,\n\t\t600: `var(--wp-components-color-gray-600, ${ GRAY[ 600 ] })`,\n\t\t400: `var(--wp-components-color-gray-400, ${ GRAY[ 400 ] })`,\n\t\t300: `var(--wp-components-color-gray-300, ${ GRAY[ 300 ] })`,\n\t\t200: `var(--wp-components-color-gray-200, ${ GRAY[ 200 ] })`,\n\t\t100: `var(--wp-components-color-gray-100, ${ GRAY[ 100 ] })`,\n\t},\n};\n\nconst UI = {\n\tbackground: THEME.background,\n\tbackgroundDisabled: THEME.gray[ 100 ],\n\tborder: THEME.gray[ 600 ],\n\tborderHover: THEME.gray[ 700 ],\n\tborderFocus: THEME.accent,\n\tborderDisabled: THEME.gray[ 400 ],\n\ttextDisabled: THEME.gray[ 600 ],\n\n\t// Matches @wordpress/base-styles\n\tdarkGrayPlaceholder: `color-mix(in srgb, ${ THEME.foreground }, transparent 38%)`,\n\tlightGrayPlaceholder: `color-mix(in srgb, ${ THEME.background }, transparent 35%)`,\n};\n\nexport const COLORS = Object.freeze( {\n\t/**\n\t * The main gray color object.\n\t *\n\t * @deprecated Use semantic aliases in `COLORS.ui` or theme-ready variables in `COLORS.theme.gray`.\n\t */\n\tgray: GRAY, // TODO: Stop exporting this when everything is migrated to `theme` or `ui`\n\twhite,\n\talert: ALERT,\n\t/**\n\t * Theme-ready variables with fallbacks.\n\t *\n\t * Prefer semantic aliases in `COLORS.ui` when applicable.\n\t */\n\ttheme: THEME,\n\t/**\n\t * Semantic aliases (prefer these over raw variables when applicable).\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,CAAE,GAAG,CAAE;EACzD;AACD,CAAC;AAED,MAAMc,EAAE,GAAG;EACVJ,UAAU,EAAEL,KAAK,CAACK,UAAU;EAC5BK,kBAAkB,EAAEV,KAAK,CAACQ,IAAI,CAAE,GAAG,CAAE;EACrCG,MAAM,EAAEX,KAAK,CAACQ,IAAI,CAAE,GAAG,CAAE;EACzBI,WAAW,EAAEZ,KAAK,CAACQ,IAAI,CAAE,GAAG,CAAE;EAC9BK,WAAW,EAAEb,KAAK,CAACC,MAAM;EACzBa,cAAc,EAAEd,KAAK,CAACQ,IAAI,CAAE,GAAG,CAAE;EACjCO,YAAY,EAAEf,KAAK,CAACQ,IAAI,CAAE,GAAG,CAAE;EAE/B;EACAQ,mBAAmB,EAAE,sBAAuBhB,KAAK,CAACM,UAAU,oBAAqB;EACjFW,oBAAoB,EAAE,sBAAuBjB,KAAK,CAACK,UAAU;AAC9D,CAAC;AAEM,MAAMa,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAGE,MAAM,CAACC,MAAM,CAAE;EACpC;AACD;AACA;AACA;AACA;EACCb,IAAI,EAAEb,IAAI;EAAE;EACZD,KAAK;EACL4B,KAAK,EAAE1B,KAAK;EACZ;AACD;AACA;AACA;AACA;EACC2B,KAAK,EAAEvB,KAAK;EACZ;AACD;AACA;EACCwB,EAAE,EAAEf;AACL,CAAE,CAAC;AAAC,IAAAgB,QAAA,GAAAN,OAAA,CAAAO,OAAA,GAEWR,MAAM","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_space","require","_colorsValues","CONTROL_HEIGHT","CONTROL_PROPS","controlPaddingX","controlPaddingXSmall","controlPaddingXLarge","controlBackgroundColor","COLORS","white","controlBoxShadowFocus","theme","accent","controlHeight","controlHeightXSmall","controlHeightSmall","controlHeightLarge","controlHeightXLarge","_default","exports","default","Object","assign","colorDivider","colorScrollbarThumb","colorScrollbarThumbHover","colorScrollbarTrack","elevationIntensity","radiusXSmall","radiusSmall","radiusMedium","radiusLarge","radiusFull","radiusRound","borderWidth","borderWidthFocus","borderWidthTab","spinnerSize","fontSize","fontSizeH1","fontSizeH2","fontSizeH3","fontSizeH4","fontSizeH5","fontSizeH6","fontSizeInputMobile","fontSizeMobile","fontSizeSmall","fontSizeXSmall","fontLineHeightBase","fontWeight","fontWeightHeading","gridBase","cardPaddingXSmall","space","cardPaddingSmall","cardPaddingMedium","cardPaddingLarge","elevationXSmall","elevationSmall","elevationMedium","elevationLarge","surfaceBackgroundColor","surfaceBackgroundSubtleColor","surfaceBackgroundTintColor","surfaceBorderColor","surfaceBorderBoldColor","surfaceBorderSubtleColor","surfaceBackgroundTertiaryColor","surfaceColor","transitionDuration","transitionDurationFast","transitionDurationFaster","transitionDurationFastest","transitionTimingFunction","transitionTimingFunctionControl"],"sources":["@wordpress/components/src/utils/config-values.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { space } from './space';\nimport { COLORS } from './colors-values';\n\nconst CONTROL_HEIGHT = '36px';\n\nconst CONTROL_PROPS = {\n\t// These values should be shared with TextControl.\n\tcontrolPaddingX: 12,\n\tcontrolPaddingXSmall: 8,\n\tcontrolPaddingXLarge: 12 * 1.3334, // TODO: Deprecate\n\n\tcontrolBackgroundColor: COLORS.white,\n\tcontrolBoxShadowFocus: `0 0 0 0.5px ${ COLORS.theme.accent }`,\n\tcontrolHeight: CONTROL_HEIGHT,\n\tcontrolHeightXSmall: `calc( ${ CONTROL_HEIGHT } * 0.6 )`,\n\tcontrolHeightSmall: `calc( ${ CONTROL_HEIGHT } * 0.8 )`,\n\tcontrolHeightLarge: `calc( ${ CONTROL_HEIGHT } * 1.2 )`,\n\tcontrolHeightXLarge: `calc( ${ CONTROL_HEIGHT } * 1.4 )`,\n};\n\n// Using Object.assign to avoid creating circular references when emitting\n// TypeScript type declarations.\nexport default Object.assign( {}, CONTROL_PROPS, {\n\tcolorDivider: 'rgba(0, 0, 0, 0.1)',\n\tcolorScrollbarThumb: 'rgba(0, 0, 0, 0.2)',\n\tcolorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)',\n\tcolorScrollbarTrack: 'rgba(0, 0, 0, 0.04)',\n\televationIntensity: 1,\n\tradiusXSmall: '1px',\n\tradiusSmall: '2px',\n\tradiusMedium: '4px',\n\tradiusLarge: '8px',\n\tradiusFull: '9999px',\n\tradiusRound: '50%',\n\tborderWidth: '1px',\n\tborderWidthFocus: '1.5px',\n\tborderWidthTab: '4px',\n\tspinnerSize: 16,\n\tfontSize: '13px',\n\tfontSizeH1: 'calc(2.44 * 13px)',\n\tfontSizeH2: 'calc(1.95 * 13px)',\n\tfontSizeH3: 'calc(1.56 * 13px)',\n\tfontSizeH4: 'calc(1.25 * 13px)',\n\tfontSizeH5: '13px',\n\tfontSizeH6: 'calc(0.8 * 13px)',\n\tfontSizeInputMobile: '16px',\n\tfontSizeMobile: '15px',\n\tfontSizeSmall: 'calc(0.92 * 13px)',\n\tfontSizeXSmall: 'calc(0.75 * 13px)',\n\tfontLineHeightBase: '1.4',\n\tfontWeight: 'normal',\n\tfontWeightHeading: '600',\n\tgridBase: '4px',\n\tcardPaddingXSmall: `${ space( 2 ) }`,\n\tcardPaddingSmall: `${ space( 4 ) }`,\n\tcardPaddingMedium: `${ space( 4 ) } ${ space( 6 ) }`,\n\tcardPaddingLarge: `${ space( 6 ) } ${ space( 8 ) }`,\n\televationXSmall: `0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)`,\n\televationSmall: `0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)`,\n\televationMedium: `0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)`,\n\televationLarge: `0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)`,\n\tsurfaceBackgroundColor: COLORS.white,\n\tsurfaceBackgroundSubtleColor: '#F3F3F3',\n\tsurfaceBackgroundTintColor: '#F5F5F5',\n\tsurfaceBorderColor: 'rgba(0, 0, 0, 0.1)',\n\tsurfaceBorderBoldColor: 'rgba(0, 0, 0, 0.15)',\n\tsurfaceBorderSubtleColor: 'rgba(0, 0, 0, 0.05)',\n\tsurfaceBackgroundTertiaryColor: COLORS.white,\n\tsurfaceColor: COLORS.white,\n\ttransitionDuration: '200ms',\n\ttransitionDurationFast: '160ms',\n\ttransitionDurationFaster: '120ms',\n\ttransitionDurationFastest: '100ms',\n\ttransitionTimingFunction: 'cubic-bezier(0.08, 0.52, 0.52, 1)',\n\ttransitionTimingFunctionControl: 'cubic-bezier(0.12, 0.8, 0.32, 1)',\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,cAAc,GAAG,MAAM;AAE7B,MAAMC,aAAa,GAAG;EACrB;EACAC,eAAe,EAAE,EAAE;EACnBC,oBAAoB,EAAE,CAAC;EACvBC,oBAAoB,EAAE,EAAE,GAAG,MAAM;EAAE;;EAEnCC,sBAAsB,EAAEC,oBAAM,CAACC,KAAK;EACpCC,qBAAqB,EAAG,eAAeF,oBAAM,CAACG,KAAK,CAACC,MAAQ,EAAC;EAC7DC,aAAa,EAAEX,cAAc;EAC7BY,mBAAmB,EAAG,SAASZ,cAAgB,UAAS;EACxDa,kBAAkB,EAAG,SAASb,cAAgB,UAAS;EACvDc,kBAAkB,EAAG,SAASd,cAAgB,UAAS;EACvDe,mBAAmB,EAAG,SAASf,cAAgB;AAChD,CAAC;;AAED;AACA;AAAA,IAAAgB,QAAA,GAAAC,OAAA,CA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eAAe,EAAG,4HAA2H;EAC7IC,cAAc,EAAG,4HAA2H;EAC5IC,eAAe,EAAG,gIAA+H;EACjJC,cAAc,EAAG,mIAAkI;EACnJC,sBAAsB,EAAEtD,oBAAM,CAACC,KAAK;EACpCsD,4BAA4B,EAAE,SAAS;EACvCC,0BAA0B,EAAE,SAAS;EACrCC,kBAAkB,EAAE,oBAAoB;EACxCC,sBAAsB,EAAE,qBAAqB;EAC7CC,wBAAwB,EAAE,qBAAqB;EAC/CC,8BAA8B,EAAE5D,oBAAM,CAACC,KAAK;EAC5C4D,YAAY,EAAE7D,oBAAM,CAACC,KAAK;EAC1B6D,kBAAkB,EAAE,OAAO;EAC3BC,sBAAsB,EAAE,OAAO;EAC/BC,wBAAwB,EAAE,OAAO;EACjCC,yBAAyB,EAAE,OAAO;EAClCC,wBAAwB,EAAE,mCAAmC;EAC7DC,+BAA+B,EAAE;AAClC,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_space","require","_colorsValues","CONTROL_HEIGHT","CONTROL_PROPS","controlPaddingX","controlPaddingXSmall","controlPaddingXLarge","controlBackgroundColor","COLORS","white","controlBoxShadowFocus","theme","accent","controlHeight","controlHeightXSmall","controlHeightSmall","controlHeightLarge","controlHeightXLarge","_default","exports","default","Object","assign","colorDivider","colorScrollbarThumb","colorScrollbarThumbHover","colorScrollbarTrack","elevationIntensity","radiusXSmall","radiusSmall","radiusMedium","radiusLarge","radiusFull","radiusRound","borderWidth","borderWidthFocus","borderWidthTab","spinnerSize","fontSize","fontSizeH1","fontSizeH2","fontSizeH3","fontSizeH4","fontSizeH5","fontSizeH6","fontSizeInputMobile","fontSizeMobile","fontSizeSmall","fontSizeXSmall","fontLineHeightBase","fontWeight","fontWeightHeading","gridBase","cardPaddingXSmall","space","cardPaddingSmall","cardPaddingMedium","cardPaddingLarge","elevationXSmall","elevationSmall","elevationMedium","elevationLarge","surfaceBackgroundColor","surfaceBackgroundSubtleColor","surfaceBackgroundTintColor","surfaceBorderColor","surfaceBorderBoldColor","surfaceBorderSubtleColor","surfaceBackgroundTertiaryColor","surfaceColor","transitionDuration","transitionDurationFast","transitionDurationFaster","transitionDurationFastest","transitionTimingFunction","transitionTimingFunctionControl"],"sources":["@wordpress/components/src/utils/config-values.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { space } from './space';\nimport { COLORS } from './colors-values';\n\nconst CONTROL_HEIGHT = '36px';\n\nconst CONTROL_PROPS = {\n\t// These values should be shared with TextControl.\n\tcontrolPaddingX: 12,\n\tcontrolPaddingXSmall: 8,\n\tcontrolPaddingXLarge: 12 * 1.3334, // TODO: Deprecate\n\n\tcontrolBackgroundColor: COLORS.white,\n\tcontrolBoxShadowFocus: `0 0 0 0.5px ${ COLORS.theme.accent }`,\n\tcontrolHeight: CONTROL_HEIGHT,\n\tcontrolHeightXSmall: `calc( ${ CONTROL_HEIGHT } * 0.6 )`,\n\tcontrolHeightSmall: `calc( ${ CONTROL_HEIGHT } * 0.8 )`,\n\tcontrolHeightLarge: `calc( ${ CONTROL_HEIGHT } * 1.2 )`,\n\tcontrolHeightXLarge: `calc( ${ CONTROL_HEIGHT } * 1.4 )`,\n};\n\n// Using Object.assign to avoid creating circular references when emitting\n// TypeScript type declarations.\nexport default Object.assign( {}, CONTROL_PROPS, {\n\tcolorDivider: 'rgba(0, 0, 0, 0.1)',\n\tcolorScrollbarThumb: 'rgba(0, 0, 0, 0.2)',\n\tcolorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)',\n\tcolorScrollbarTrack: 'rgba(0, 0, 0, 0.04)',\n\televationIntensity: 1,\n\tradiusXSmall: '1px',\n\tradiusSmall: '2px',\n\tradiusMedium: '4px',\n\tradiusLarge: '8px',\n\tradiusFull: '9999px',\n\tradiusRound: '50%',\n\tborderWidth: '1px',\n\tborderWidthFocus: '1.5px',\n\tborderWidthTab: '4px',\n\tspinnerSize: 16,\n\tfontSize: '13px',\n\tfontSizeH1: 'calc(2.44 * 13px)',\n\tfontSizeH2: 'calc(1.95 * 13px)',\n\tfontSizeH3: 'calc(1.56 * 13px)',\n\tfontSizeH4: 'calc(1.25 * 13px)',\n\tfontSizeH5: '13px',\n\tfontSizeH6: 'calc(0.8 * 13px)',\n\tfontSizeInputMobile: '16px',\n\tfontSizeMobile: '15px',\n\tfontSizeSmall: 'calc(0.92 * 13px)',\n\tfontSizeXSmall: 'calc(0.75 * 13px)',\n\tfontLineHeightBase: '1.4',\n\tfontWeight: 'normal',\n\tfontWeightHeading: '600',\n\tgridBase: '4px',\n\tcardPaddingXSmall: `${ space( 2 ) }`,\n\tcardPaddingSmall: `${ space( 4 ) }`,\n\tcardPaddingMedium: `${ space( 4 ) } ${ space( 6 ) }`,\n\tcardPaddingLarge: `${ space( 6 ) } ${ space( 8 ) }`,\n\televationXSmall: `0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)`,\n\televationSmall: `0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)`,\n\televationMedium: `0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)`,\n\televationLarge: `0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)`,\n\tsurfaceBackgroundColor: COLORS.white,\n\tsurfaceBackgroundSubtleColor: '#F3F3F3',\n\tsurfaceBackgroundTintColor: '#F5F5F5',\n\tsurfaceBorderColor: 'rgba(0, 0, 0, 0.1)',\n\tsurfaceBorderBoldColor: 'rgba(0, 0, 0, 0.15)',\n\tsurfaceBorderSubtleColor: 'rgba(0, 0, 0, 0.05)',\n\tsurfaceBackgroundTertiaryColor: COLORS.white,\n\tsurfaceColor: COLORS.white,\n\ttransitionDuration: '200ms',\n\ttransitionDurationFast: '160ms',\n\ttransitionDurationFaster: '120ms',\n\ttransitionDurationFastest: '100ms',\n\ttransitionTimingFunction: 'cubic-bezier(0.08, 0.52, 0.52, 1)',\n\ttransitionTimingFunctionControl: 'cubic-bezier(0.12, 0.8, 0.32, 1)',\n} );\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,cAAc,GAAG,MAAM;AAE7B,MAAMC,aAAa,GAAG;EACrB;EACAC,eAAe,EAAE,EAAE;EACnBC,oBAAoB,EAAE,CAAC;EACvBC,oBAAoB,EAAE,EAAE,GAAG,MAAM;EAAE;;EAEnCC,sBAAsB,EAAEC,oBAAM,CAACC,KAAK;EACpCC,qBAAqB,EAAE,eAAgBF,oBAAM,CAACG,KAAK,CAACC,MAAM,EAAG;EAC7DC,aAAa,EAAEX,cAAc;EAC7BY,mBAAmB,EAAE,SAAUZ,cAAc,UAAW;EACxDa,kBAAkB,EAAE,SAAUb,cAAc,UAAW;EACvDc,kBAAkB,EAAE,SAAUd,cAAc,UAAW;EACvDe,mBAAmB,EAAE,SAAUf,cAAc;AAC9C,CAAC;;AAED;AACA;AAAA,IAAAgB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACeC,MAAM,CAACC,MAAM,CAAE,CAAC,CAAC,EAAEnB,aAAa,EAAE;EAChDoB,YAAY,EAAE,oBAAoB;EAClCC,mBAAmB,EAAE,oBAAoB;EACzCC,wBAAwB,EAAE,oBAAoB;EAC9CC,mBAAmB,EAAE,qBAAqB;EAC1CC,kBAAkB,EAAE,CAAC;EACrBC,YAAY,EAAE,KAAK;EACnBC,WAAW,EAAE,KAAK;EAClBC,YAAY,EAAE,KAAK;EACnBC,WAAW,EAAE,KAAK;EAClBC,UAAU,EAAE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EAC5C4D,YAAY,EAAE7D,oBAAM,CAACC,KAAK;EAC1B6D,kBAAkB,EAAE,OAAO;EAC3BC,sBAAsB,EAAE,OAAO;EAC/BC,wBAAwB,EAAE,OAAO;EACjCC,yBAAyB,EAAE,OAAO;EAClCC,wBAAwB,EAAE,mCAAmC;EAC7DC,+BAA+B,EAAE;AAClC,CAAE,CAAC","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.maybeWarnDeprecated36pxSize = maybeWarnDeprecated36pxSize;
8
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
9
+ /**
10
+ * WordPress dependencies
11
+ */
12
+
13
+ function maybeWarnDeprecated36pxSize({
14
+ componentName,
15
+ __next40pxDefaultSize,
16
+ size
17
+ }) {
18
+ if (__next40pxDefaultSize || size !== 'default') {
19
+ return;
20
+ }
21
+ (0, _deprecated.default)(`36px default size for wp.components.${componentName}`, {
22
+ since: '6.8',
23
+ version: '7.1',
24
+ hint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.'
25
+ });
26
+ }
27
+ //# sourceMappingURL=deprecated-36px-size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_deprecated","_interopRequireDefault","require","maybeWarnDeprecated36pxSize","componentName","__next40pxDefaultSize","size","deprecated","since","version","hint"],"sources":["@wordpress/components/src/utils/deprecated-36px-size.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\nexport function maybeWarnDeprecated36pxSize( {\n\tcomponentName,\n\t__next40pxDefaultSize,\n\tsize,\n}: {\n\tcomponentName: string;\n\t__next40pxDefaultSize: boolean | undefined;\n\tsize: string;\n} ) {\n\tif ( __next40pxDefaultSize || size !== 'default' ) {\n\t\treturn;\n\t}\n\n\tdeprecated( `36px default size for wp.components.${ componentName }`, {\n\t\tsince: '6.8',\n\t\tversion: '7.1',\n\t\thint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.',\n\t} );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGO,SAASC,2BAA2BA,CAAE;EAC5CC,aAAa;EACbC,qBAAqB;EACrBC;AAKD,CAAC,EAAG;EACH,IAAKD,qBAAqB,IAAIC,IAAI,KAAK,SAAS,EAAG;IAClD;EACD;EAEA,IAAAC,mBAAU,EAAE,uCAAwCH,aAAa,EAAG,EAAE;IACrEI,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE,KAAK;IACdC,IAAI,EAAE;EACP,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -96,11 +96,13 @@ const POLL_RATE = 100;
96
96
  * to measure again after a frame, and if that fails, it will poll every 100
97
97
  * milliseconds until it succeeds.
98
98
  */
99
- function useTrackElementOffsetRect(targetElement) {
99
+ function useTrackElementOffsetRect(targetElement, deps = []) {
100
100
  const [indicatorPosition, setIndicatorPosition] = (0, _element.useState)(NULL_ELEMENT_OFFSET_RECT);
101
101
  const intervalRef = (0, _element.useRef)();
102
102
  const measure = (0, _compose.useEvent)(() => {
103
- if (targetElement) {
103
+ // Check that the targetElement is still attached to the DOM, in case
104
+ // it was removed since the last `measure` call.
105
+ if (targetElement && targetElement.isConnected) {
104
106
  const elementOffsetRect = getElementOffsetRect(targetElement);
105
107
  if (elementOffsetRect) {
106
108
  setIndicatorPosition(elementOffsetRect);
@@ -127,6 +129,15 @@ function useTrackElementOffsetRect(targetElement) {
127
129
  setIndicatorPosition(NULL_ELEMENT_OFFSET_RECT);
128
130
  }
129
131
  }, [setElement, targetElement]);
132
+
133
+ // Escape hatch to force a remeasurement when something else changes rather
134
+ // than the target elements' ref or size (for example, the target element
135
+ // can change its position within the tablist).
136
+ (0, _element.useLayoutEffect)(() => {
137
+ measure();
138
+ // `measure` is a stable function, so it's safe to omit it from the deps array.
139
+ // deps can't be statically analyzed by ESLint
140
+ }, deps);
130
141
  return indicatorPosition;
131
142
  }
132
143