@wordpress/components 19.12.0 → 19.15.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 (1409) hide show
  1. package/CHANGELOG.md +116 -3
  2. package/CONTRIBUTING.md +94 -12
  3. package/build/alignment-matrix-control/index.js +3 -3
  4. package/build/alignment-matrix-control/index.js.map +1 -1
  5. package/build/alignment-matrix-control/utils.js +1 -7
  6. package/build/alignment-matrix-control/utils.js.map +1 -1
  7. package/build/angle-picker-control/index.js +2 -2
  8. package/build/angle-picker-control/index.js.map +1 -1
  9. package/build/autocomplete/autocompleter-ui.js +4 -2
  10. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  11. package/build/autocomplete/autocompleter-ui.native.js +9 -3
  12. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  13. package/build/autocomplete/get-default-use-items.js +5 -1
  14. package/build/autocomplete/get-default-use-items.js.map +1 -1
  15. package/build/autocomplete/index.js +9 -3
  16. package/build/autocomplete/index.js.map +1 -1
  17. package/build/border-box-control/border-box-control/component.js +2 -1
  18. package/build/border-box-control/border-box-control/component.js.map +1 -1
  19. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  20. package/build/border-box-control/border-box-control-split-controls/component.js +2 -1
  21. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  22. package/build/border-box-control/utils.js.map +1 -1
  23. package/build/border-control/border-control/component.js +40 -4
  24. package/build/border-control/border-control/component.js.map +1 -1
  25. package/build/border-control/border-control/hook.js.map +1 -1
  26. package/build/box-control/all-input-control.js +6 -10
  27. package/build/box-control/all-input-control.js.map +1 -1
  28. package/build/box-control/axial-input-controls.js.map +1 -1
  29. package/build/box-control/index.js +4 -8
  30. package/build/box-control/index.js.map +1 -1
  31. package/build/box-control/input-controls.js +6 -10
  32. package/build/box-control/input-controls.js.map +1 -1
  33. package/build/box-control/unit-control.js +4 -4
  34. package/build/box-control/unit-control.js.map +1 -1
  35. package/build/box-control/utils.js +3 -3
  36. package/build/box-control/utils.js.map +1 -1
  37. package/build/button/index.native.js +1 -3
  38. package/build/button/index.native.js.map +1 -1
  39. package/build/checkbox-control/index.js.map +1 -1
  40. package/build/color-indicator/index.js +27 -10
  41. package/build/color-indicator/index.js.map +1 -1
  42. package/build/color-indicator/types.js +6 -0
  43. package/build/color-indicator/types.js.map +1 -0
  44. package/build/color-palette/index.js +2 -1
  45. package/build/color-palette/index.js.map +1 -1
  46. package/build/color-picker/component.js +6 -9
  47. package/build/color-picker/component.js.map +1 -1
  48. package/build/color-picker/hex-input.js +5 -4
  49. package/build/color-picker/hex-input.js.map +1 -1
  50. package/build/color-picker/index.native.js +35 -34
  51. package/build/color-picker/index.native.js.map +1 -1
  52. package/build/color-picker/input-with-slider.js +4 -3
  53. package/build/color-picker/input-with-slider.js.map +1 -1
  54. package/build/color-picker/styles.js +42 -36
  55. package/build/color-picker/styles.js.map +1 -1
  56. package/build/color-picker/use-deprecated-props.js +22 -31
  57. package/build/color-picker/use-deprecated-props.js.map +1 -1
  58. package/build/combobox-control/index.js +18 -8
  59. package/build/combobox-control/index.js.map +1 -1
  60. package/build/combobox-control/styles.js +39 -0
  61. package/build/combobox-control/styles.js.map +1 -0
  62. package/build/confirm-dialog/component.js.map +1 -1
  63. package/build/custom-gradient-bar/constants.js +1 -3
  64. package/build/custom-gradient-bar/constants.js.map +1 -1
  65. package/build/custom-gradient-bar/control-points.js +15 -8
  66. package/build/custom-gradient-bar/control-points.js.map +1 -1
  67. package/build/custom-gradient-bar/index.js +5 -5
  68. package/build/custom-gradient-bar/index.js.map +1 -1
  69. package/build/custom-gradient-bar/utils.js +5 -7
  70. package/build/custom-gradient-bar/utils.js.map +1 -1
  71. package/build/custom-gradient-picker/index.js +8 -8
  72. package/build/custom-gradient-picker/index.js.map +1 -1
  73. package/build/custom-gradient-picker/index.native.js +8 -9
  74. package/build/custom-gradient-picker/index.native.js.map +1 -1
  75. package/build/custom-gradient-picker/serializer.js +4 -7
  76. package/build/custom-gradient-picker/serializer.js.map +1 -1
  77. package/build/custom-gradient-picker/utils.js.map +1 -1
  78. package/build/custom-select-control/index.js.map +1 -1
  79. package/build/date-time/date/index.js +7 -5
  80. package/build/date-time/date/index.js.map +1 -1
  81. package/build/date-time/date-time/index.js +6 -4
  82. package/build/date-time/date-time/index.js.map +1 -1
  83. package/build/dimension-control/index.js +1 -3
  84. package/build/dimension-control/index.js.map +1 -1
  85. package/build/divider/styles.js +5 -5
  86. package/build/divider/styles.js.map +1 -1
  87. package/build/draggable/index.js.map +1 -1
  88. package/build/draggable/index.native.js +6 -1
  89. package/build/draggable/index.native.js.map +1 -1
  90. package/build/drop-zone/provider.js.map +1 -1
  91. package/build/dropdown/index.js +2 -2
  92. package/build/dropdown/index.js.map +1 -1
  93. package/build/dropdown-menu/index.js +16 -5
  94. package/build/dropdown-menu/index.js.map +1 -1
  95. package/build/dropdown-menu/index.native.js +17 -6
  96. package/build/dropdown-menu/index.native.js.map +1 -1
  97. package/build/duotone-picker/duotone-picker.js +42 -29
  98. package/build/duotone-picker/duotone-picker.js.map +1 -1
  99. package/build/elevation/hook.js +14 -14
  100. package/build/elevation/hook.js.map +1 -1
  101. package/build/external-link/index.js +20 -10
  102. package/build/external-link/index.js.map +1 -1
  103. package/build/external-link/styles/external-link-styles.js +3 -3
  104. package/build/external-link/styles/external-link-styles.js.map +1 -1
  105. package/build/external-link/types.js +6 -0
  106. package/build/external-link/types.js.map +1 -0
  107. package/build/flex/flex/hook.js +9 -5
  108. package/build/flex/flex/hook.js.map +1 -1
  109. package/build/focal-point-picker/controls.js +3 -7
  110. package/build/focal-point-picker/controls.js.map +1 -1
  111. package/build/focal-point-picker/grid.js +2 -7
  112. package/build/focal-point-picker/grid.js.map +1 -1
  113. package/build/focal-point-picker/index.js.map +1 -1
  114. package/build/focal-point-picker/index.native.js +12 -12
  115. package/build/focal-point-picker/index.native.js.map +1 -1
  116. package/build/focal-point-picker/media.js +4 -8
  117. package/build/focal-point-picker/media.js.map +1 -1
  118. package/build/focal-point-picker/tooltip/index.native.js +11 -12
  119. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  120. package/build/font-size-picker/index.js +1 -1
  121. package/build/font-size-picker/index.js.map +1 -1
  122. package/build/form-toggle/index.js +34 -9
  123. package/build/form-toggle/index.js.map +1 -1
  124. package/build/form-toggle/types.js +6 -0
  125. package/build/form-toggle/types.js.map +1 -0
  126. package/build/form-token-field/index.js +344 -360
  127. package/build/form-token-field/index.js.map +1 -1
  128. package/build/form-token-field/styles.js +40 -0
  129. package/build/form-token-field/styles.js.map +1 -0
  130. package/build/form-token-field/suggestions-list.js +22 -21
  131. package/build/form-token-field/suggestions-list.js.map +1 -1
  132. package/build/form-token-field/token-input.js +39 -53
  133. package/build/form-token-field/token-input.js.map +1 -1
  134. package/build/form-token-field/token.js +3 -3
  135. package/build/form-token-field/token.js.map +1 -1
  136. package/build/form-token-field/types.js +6 -0
  137. package/build/form-token-field/types.js.map +1 -0
  138. package/build/gradient-picker/index.js.map +1 -1
  139. package/build/grid/component.js +7 -8
  140. package/build/grid/component.js.map +1 -1
  141. package/build/grid/hook.js +1 -5
  142. package/build/grid/hook.js.map +1 -1
  143. package/build/grid/index.js.map +1 -1
  144. package/build/grid/utils.js +4 -7
  145. package/build/grid/utils.js.map +1 -1
  146. package/build/h-stack/component.js +5 -9
  147. package/build/h-stack/component.js.map +1 -1
  148. package/build/h-stack/hook.js +8 -10
  149. package/build/h-stack/hook.js.map +1 -1
  150. package/build/h-stack/index.js.map +1 -1
  151. package/build/h-stack/utils.js +8 -19
  152. package/build/h-stack/utils.js.map +1 -1
  153. package/build/heading/component.js +0 -1
  154. package/build/heading/component.js.map +1 -1
  155. package/build/heading/hook.js.map +1 -1
  156. package/build/heading/types.js +6 -0
  157. package/build/heading/types.js.map +1 -0
  158. package/build/higher-order/navigate-regions/index.js.map +1 -1
  159. package/build/higher-order/with-focus-return/index.js.map +1 -1
  160. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  161. package/build/icon/index.js.map +1 -1
  162. package/build/input-control/index.js +5 -5
  163. package/build/input-control/index.js.map +1 -1
  164. package/build/input-control/input-field.js +10 -10
  165. package/build/input-control/input-field.js.map +1 -1
  166. package/build/input-control/reducer/reducer.js.map +1 -1
  167. package/build/input-control/utils.js +1 -1
  168. package/build/input-control/utils.js.map +1 -1
  169. package/build/menu-item/index.js +1 -3
  170. package/build/menu-item/index.js.map +1 -1
  171. package/build/menu-items-choice/index.js +3 -7
  172. package/build/menu-items-choice/index.js.map +1 -1
  173. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  174. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  175. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -7
  176. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  177. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  178. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
  179. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  180. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  181. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  182. package/build/mobile/color-settings/index.native.js.map +1 -1
  183. package/build/mobile/focal-point-settings-panel/index.native.js +1 -1
  184. package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  185. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  186. package/build/mobile/gradient/index.native.js.map +1 -1
  187. package/build/mobile/html-text-input/index.native.js.map +1 -1
  188. package/build/mobile/image/index.native.js +4 -2
  189. package/build/mobile/image/index.native.js.map +1 -1
  190. package/build/mobile/inserter-button/index.native.js.map +1 -1
  191. package/build/mobile/link-picker/index.native.js +4 -4
  192. package/build/mobile/link-picker/index.native.js.map +1 -1
  193. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  194. package/build/mobile/media-edit/index.native.js.map +1 -1
  195. package/build/mobile/segmented-control/index.native.js +3 -5
  196. package/build/mobile/segmented-control/index.native.js.map +1 -1
  197. package/build/modal/index.js +18 -4
  198. package/build/modal/index.js.map +1 -1
  199. package/build/navigable-container/container.js +4 -2
  200. package/build/navigable-container/container.js.map +1 -1
  201. package/build/navigation/context.js +12 -16
  202. package/build/navigation/context.js.map +1 -1
  203. package/build/navigation/group/index.js +4 -7
  204. package/build/navigation/group/index.js.map +1 -1
  205. package/build/navigation/index.js +7 -4
  206. package/build/navigation/index.js.map +1 -1
  207. package/build/navigation/item/base.js +6 -3
  208. package/build/navigation/item/base.js.map +1 -1
  209. package/build/navigation/item/index.js +3 -3
  210. package/build/navigation/item/index.js.map +1 -1
  211. package/build/navigation/item/use-navigation-tree-item.js +2 -1
  212. package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
  213. package/build/navigation/menu/menu-title-search.js +1 -7
  214. package/build/navigation/menu/menu-title-search.js.map +1 -1
  215. package/build/navigation/menu/search-no-results-found.js +1 -7
  216. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  217. package/build/navigation/use-navigation-tree-nodes.js +18 -10
  218. package/build/navigation/use-navigation-tree-nodes.js.map +1 -1
  219. package/build/navigation/utils.js +4 -2
  220. package/build/navigation/utils.js.map +1 -1
  221. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  222. package/build/navigator/navigator-button/hook.js.map +1 -1
  223. package/build/navigator/navigator-provider/component.js +1 -1
  224. package/build/navigator/navigator-provider/component.js.map +1 -1
  225. package/build/navigator/navigator-screen/component.js +1 -1
  226. package/build/navigator/navigator-screen/component.js.map +1 -1
  227. package/build/notice/index.js +5 -5
  228. package/build/notice/index.js.map +1 -1
  229. package/build/notice/list.js +4 -2
  230. package/build/notice/list.js.map +1 -1
  231. package/build/panel/body.js +3 -3
  232. package/build/panel/body.js.map +1 -1
  233. package/build/placeholder/index.js +26 -12
  234. package/build/placeholder/index.js.map +1 -1
  235. package/build/popover/index.js +4 -4
  236. package/build/popover/index.js.map +1 -1
  237. package/build/radio-control/index.js +43 -7
  238. package/build/radio-control/index.js.map +1 -1
  239. package/build/radio-control/types.js +6 -0
  240. package/build/radio-control/types.js.map +1 -0
  241. package/build/range-control/index.js +63 -47
  242. package/build/range-control/index.js.map +1 -1
  243. package/build/range-control/input-range.js +11 -17
  244. package/build/range-control/input-range.js.map +1 -1
  245. package/build/range-control/mark.js +5 -7
  246. package/build/range-control/mark.js.map +1 -1
  247. package/build/range-control/rail.js +10 -16
  248. package/build/range-control/rail.js.map +1 -1
  249. package/build/range-control/styles/range-control-styles.js +62 -62
  250. package/build/range-control/styles/range-control-styles.js.map +1 -1
  251. package/build/range-control/tooltip.js +5 -7
  252. package/build/range-control/tooltip.js.map +1 -1
  253. package/build/range-control/types.js +6 -0
  254. package/build/range-control/types.js.map +1 -0
  255. package/build/range-control/utils.js +27 -36
  256. package/build/range-control/utils.js.map +1 -1
  257. package/build/resizable-box/resize-tooltip/index.js +3 -3
  258. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  259. package/build/resizable-box/resize-tooltip/utils.js +5 -13
  260. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  261. package/build/responsive-wrapper/index.js.map +1 -1
  262. package/build/scrollable/component.js +7 -8
  263. package/build/scrollable/component.js.map +1 -1
  264. package/build/scrollable/hook.js +0 -8
  265. package/build/scrollable/hook.js.map +1 -1
  266. package/build/scrollable/index.js.map +1 -1
  267. package/build/scrollable/styles.js +7 -7
  268. package/build/scrollable/styles.js.map +1 -1
  269. package/build/select-control/index.js +5 -3
  270. package/build/select-control/index.js.map +1 -1
  271. package/build/shortcut/index.js +2 -8
  272. package/build/shortcut/index.js.map +1 -1
  273. package/build/slot-fill/fill.js +1 -7
  274. package/build/slot-fill/fill.js.map +1 -1
  275. package/build/slot-fill/index.native.js +6 -8
  276. package/build/slot-fill/index.native.js.map +1 -1
  277. package/build/slot-fill/provider.js +4 -8
  278. package/build/slot-fill/provider.js.map +1 -1
  279. package/build/slot-fill/slot.js +17 -10
  280. package/build/slot-fill/slot.js.map +1 -1
  281. package/build/snackbar/index.js +7 -7
  282. package/build/snackbar/index.js.map +1 -1
  283. package/build/snackbar/list.js +3 -1
  284. package/build/snackbar/list.js.map +1 -1
  285. package/build/spacer/component.js +5 -5
  286. package/build/spacer/component.js.map +1 -1
  287. package/build/spacer/hook.js +2 -2
  288. package/build/spacer/hook.js.map +1 -1
  289. package/build/spacer/index.js.map +1 -1
  290. package/build/spinner/index.js +26 -13
  291. package/build/spinner/index.js.map +1 -1
  292. package/build/spinner/styles.js +10 -10
  293. package/build/spinner/styles.js.map +1 -1
  294. package/build/tab-panel/index.js +3 -1
  295. package/build/tab-panel/index.js.map +1 -1
  296. package/build/text/hook.js +4 -4
  297. package/build/text/hook.js.map +1 -1
  298. package/build/text/utils.js.map +1 -1
  299. package/build/text-highlight/index.js +22 -5
  300. package/build/text-highlight/index.js.map +1 -1
  301. package/build/text-highlight/types.js +6 -0
  302. package/build/text-highlight/types.js.map +1 -0
  303. package/build/tip/index.js +5 -11
  304. package/build/tip/index.js.map +1 -1
  305. package/build/tip/types.js +6 -0
  306. package/build/tip/types.js.map +1 -0
  307. package/build/toggle-control/index.js +1 -3
  308. package/build/toggle-control/index.js.map +1 -1
  309. package/build/toggle-control/index.native.js +1 -7
  310. package/build/toggle-control/index.native.js.map +1 -1
  311. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  312. package/build/toolbar/index.js.map +1 -1
  313. package/build/toolbar-group/index.js +3 -3
  314. package/build/toolbar-group/index.js.map +1 -1
  315. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  316. package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
  317. package/build/tooltip/index.js +2 -1
  318. package/build/tooltip/index.js.map +1 -1
  319. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  320. package/build/tree-select/index.js +59 -6
  321. package/build/tree-select/index.js.map +1 -1
  322. package/build/tree-select/types.js +6 -0
  323. package/build/tree-select/types.js.map +1 -0
  324. package/build/truncate/component.js +7 -8
  325. package/build/truncate/component.js.map +1 -1
  326. package/build/truncate/hook.js +3 -10
  327. package/build/truncate/hook.js.map +1 -1
  328. package/build/truncate/index.js.map +1 -1
  329. package/build/truncate/styles.js +1 -1
  330. package/build/truncate/styles.js.map +1 -1
  331. package/build/truncate/utils.js +3 -16
  332. package/build/truncate/utils.js.map +1 -1
  333. package/build/ui/form-group/form-group-content.js.map +1 -1
  334. package/build/ui/utils/get-valid-children.js.map +1 -1
  335. package/build/unit-control/index.js.map +1 -1
  336. package/build/utils/math.js +17 -7
  337. package/build/utils/math.js.map +1 -1
  338. package/build/utils/unit-values.js.map +1 -1
  339. package/build/utils/values.js.map +1 -1
  340. package/build/v-stack/component.js +9 -9
  341. package/build/v-stack/component.js.map +1 -1
  342. package/build/v-stack/hook.js +0 -5
  343. package/build/v-stack/hook.js.map +1 -1
  344. package/build/v-stack/index.js.map +1 -1
  345. package/build/visually-hidden/component.js +12 -13
  346. package/build/visually-hidden/component.js.map +1 -1
  347. package/build/visually-hidden/index.js.map +1 -1
  348. package/build/visually-hidden/styles.js +3 -1
  349. package/build/visually-hidden/styles.js.map +1 -1
  350. package/build/visually-hidden/types.js +6 -0
  351. package/build/visually-hidden/types.js.map +1 -0
  352. package/build/z-stack/component.js +22 -3
  353. package/build/z-stack/component.js.map +1 -1
  354. package/build/z-stack/types.js +6 -0
  355. package/build/z-stack/types.js.map +1 -0
  356. package/build-module/alignment-matrix-control/index.js +2 -1
  357. package/build-module/alignment-matrix-control/index.js.map +1 -1
  358. package/build-module/alignment-matrix-control/utils.js +1 -6
  359. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  360. package/build-module/angle-picker-control/index.js +1 -1
  361. package/build-module/angle-picker-control/index.js.map +1 -1
  362. package/build-module/autocomplete/autocompleter-ui.js +4 -2
  363. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  364. package/build-module/autocomplete/autocompleter-ui.native.js +9 -3
  365. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  366. package/build-module/autocomplete/get-default-use-items.js +3 -2
  367. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  368. package/build-module/autocomplete/index.js +7 -4
  369. package/build-module/autocomplete/index.js.map +1 -1
  370. package/build-module/border-box-control/border-box-control/component.js +2 -1
  371. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  372. package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  373. package/build-module/border-box-control/border-box-control-split-controls/component.js +2 -1
  374. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  375. package/build-module/border-box-control/utils.js.map +1 -1
  376. package/build-module/border-control/border-control/component.js +38 -3
  377. package/build-module/border-control/border-control/component.js.map +1 -1
  378. package/build-module/border-control/border-control/hook.js.map +1 -1
  379. package/build-module/box-control/all-input-control.js +3 -5
  380. package/build-module/box-control/all-input-control.js.map +1 -1
  381. package/build-module/box-control/axial-input-controls.js.map +1 -1
  382. package/build-module/box-control/index.js +3 -6
  383. package/build-module/box-control/index.js.map +1 -1
  384. package/build-module/box-control/input-controls.js +3 -5
  385. package/build-module/box-control/input-controls.js.map +1 -1
  386. package/build-module/box-control/unit-control.js +3 -1
  387. package/build-module/box-control/unit-control.js.map +1 -1
  388. package/build-module/box-control/utils.js +4 -4
  389. package/build-module/box-control/utils.js.map +1 -1
  390. package/build-module/button/index.native.js +1 -2
  391. package/build-module/button/index.native.js.map +1 -1
  392. package/build-module/checkbox-control/index.js.map +1 -1
  393. package/build-module/color-indicator/index.js +29 -8
  394. package/build-module/color-indicator/index.js.map +1 -1
  395. package/build-module/color-indicator/types.js +2 -0
  396. package/build-module/color-indicator/types.js.map +1 -0
  397. package/build-module/color-palette/index.js +2 -1
  398. package/build-module/color-palette/index.js.map +1 -1
  399. package/build-module/color-picker/component.js +7 -8
  400. package/build-module/color-picker/component.js.map +1 -1
  401. package/build-module/color-picker/hex-input.js +4 -3
  402. package/build-module/color-picker/hex-input.js.map +1 -1
  403. package/build-module/color-picker/index.native.js +36 -35
  404. package/build-module/color-picker/index.native.js.map +1 -1
  405. package/build-module/color-picker/input-with-slider.js +4 -3
  406. package/build-module/color-picker/input-with-slider.js.map +1 -1
  407. package/build-module/color-picker/styles.js +28 -31
  408. package/build-module/color-picker/styles.js.map +1 -1
  409. package/build-module/color-picker/use-deprecated-props.js +22 -31
  410. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  411. package/build-module/combobox-control/index.js +18 -8
  412. package/build-module/combobox-control/index.js.map +1 -1
  413. package/build-module/combobox-control/styles.js +27 -0
  414. package/build-module/combobox-control/styles.js.map +1 -0
  415. package/build-module/confirm-dialog/component.js.map +1 -1
  416. package/build-module/custom-gradient-bar/constants.js +0 -1
  417. package/build-module/custom-gradient-bar/constants.js.map +1 -1
  418. package/build-module/custom-gradient-bar/control-points.js +16 -9
  419. package/build-module/custom-gradient-bar/control-points.js.map +1 -1
  420. package/build-module/custom-gradient-bar/index.js +6 -6
  421. package/build-module/custom-gradient-bar/index.js.map +1 -1
  422. package/build-module/custom-gradient-bar/utils.js +6 -8
  423. package/build-module/custom-gradient-bar/utils.js.map +1 -1
  424. package/build-module/custom-gradient-picker/index.js +8 -7
  425. package/build-module/custom-gradient-picker/index.js.map +1 -1
  426. package/build-module/custom-gradient-picker/index.native.js +8 -8
  427. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  428. package/build-module/custom-gradient-picker/serializer.js +4 -6
  429. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  430. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  431. package/build-module/custom-select-control/index.js.map +1 -1
  432. package/build-module/date-time/date/index.js +7 -4
  433. package/build-module/date-time/date/index.js.map +1 -1
  434. package/build-module/date-time/date-time/index.js +5 -2
  435. package/build-module/date-time/date-time/index.js.map +1 -1
  436. package/build-module/dimension-control/index.js +1 -2
  437. package/build-module/dimension-control/index.js.map +1 -1
  438. package/build-module/divider/styles.js +5 -5
  439. package/build-module/divider/styles.js.map +1 -1
  440. package/build-module/draggable/index.js.map +1 -1
  441. package/build-module/draggable/index.native.js +6 -1
  442. package/build-module/draggable/index.native.js.map +1 -1
  443. package/build-module/drop-zone/provider.js.map +1 -1
  444. package/build-module/dropdown/index.js +2 -2
  445. package/build-module/dropdown/index.js.map +1 -1
  446. package/build-module/dropdown-menu/index.js +16 -4
  447. package/build-module/dropdown-menu/index.js.map +1 -1
  448. package/build-module/dropdown-menu/index.native.js +16 -4
  449. package/build-module/dropdown-menu/index.native.js.map +1 -1
  450. package/build-module/duotone-picker/duotone-picker.js +42 -29
  451. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  452. package/build-module/elevation/hook.js +13 -13
  453. package/build-module/elevation/hook.js.map +1 -1
  454. package/build-module/external-link/index.js +22 -8
  455. package/build-module/external-link/index.js.map +1 -1
  456. package/build-module/external-link/styles/external-link-styles.js +3 -3
  457. package/build-module/external-link/styles/external-link-styles.js.map +1 -1
  458. package/build-module/external-link/types.js +2 -0
  459. package/build-module/external-link/types.js.map +1 -0
  460. package/build-module/flex/flex/hook.js +7 -5
  461. package/build-module/flex/flex/hook.js.map +1 -1
  462. package/build-module/focal-point-picker/controls.js +3 -5
  463. package/build-module/focal-point-picker/controls.js.map +1 -1
  464. package/build-module/focal-point-picker/grid.js +2 -6
  465. package/build-module/focal-point-picker/grid.js.map +1 -1
  466. package/build-module/focal-point-picker/index.js.map +1 -1
  467. package/build-module/focal-point-picker/index.native.js +9 -9
  468. package/build-module/focal-point-picker/index.native.js.map +1 -1
  469. package/build-module/focal-point-picker/media.js +3 -5
  470. package/build-module/focal-point-picker/media.js.map +1 -1
  471. package/build-module/focal-point-picker/tooltip/index.native.js +11 -12
  472. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  473. package/build-module/font-size-picker/index.js +1 -1
  474. package/build-module/font-size-picker/index.js.map +1 -1
  475. package/build-module/form-toggle/index.js +31 -7
  476. package/build-module/form-toggle/index.js.map +1 -1
  477. package/build-module/form-toggle/types.js +2 -0
  478. package/build-module/form-toggle/types.js.map +1 -0
  479. package/build-module/form-token-field/index.js +345 -363
  480. package/build-module/form-token-field/index.js.map +1 -1
  481. package/build-module/form-token-field/styles.js +28 -0
  482. package/build-module/form-token-field/styles.js.map +1 -0
  483. package/build-module/form-token-field/suggestions-list.js +27 -23
  484. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  485. package/build-module/form-token-field/token-input.js +43 -58
  486. package/build-module/form-token-field/token-input.js.map +1 -1
  487. package/build-module/form-token-field/token.js +3 -1
  488. package/build-module/form-token-field/token.js.map +1 -1
  489. package/build-module/form-token-field/types.js +2 -0
  490. package/build-module/form-token-field/types.js.map +1 -0
  491. package/build-module/gradient-picker/index.js.map +1 -1
  492. package/build-module/grid/component.js +7 -8
  493. package/build-module/grid/component.js.map +1 -1
  494. package/build-module/grid/hook.js +1 -5
  495. package/build-module/grid/hook.js.map +1 -1
  496. package/build-module/grid/index.js.map +1 -1
  497. package/build-module/grid/utils.js +3 -8
  498. package/build-module/grid/utils.js.map +1 -1
  499. package/build-module/h-stack/component.js +3 -7
  500. package/build-module/h-stack/component.js.map +1 -1
  501. package/build-module/h-stack/hook.js +10 -12
  502. package/build-module/h-stack/hook.js.map +1 -1
  503. package/build-module/h-stack/index.js.map +1 -1
  504. package/build-module/h-stack/utils.js +8 -20
  505. package/build-module/h-stack/utils.js.map +1 -1
  506. package/build-module/heading/component.js +0 -1
  507. package/build-module/heading/component.js.map +1 -1
  508. package/build-module/heading/hook.js.map +1 -1
  509. package/build-module/heading/types.js +2 -0
  510. package/build-module/heading/types.js.map +1 -0
  511. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  512. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  513. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  514. package/build-module/icon/index.js.map +1 -1
  515. package/build-module/input-control/index.js +2 -1
  516. package/build-module/input-control/index.js.map +1 -1
  517. package/build-module/input-control/input-field.js +2 -1
  518. package/build-module/input-control/input-field.js.map +1 -1
  519. package/build-module/input-control/reducer/reducer.js.map +1 -1
  520. package/build-module/input-control/utils.js +1 -1
  521. package/build-module/input-control/utils.js.map +1 -1
  522. package/build-module/menu-item/index.js +1 -2
  523. package/build-module/menu-item/index.js.map +1 -1
  524. package/build-module/menu-items-choice/index.js +3 -5
  525. package/build-module/menu-items-choice/index.js.map +1 -1
  526. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  527. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  528. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -6
  529. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  530. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  531. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
  532. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  533. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  534. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  535. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  536. package/build-module/mobile/focal-point-settings-panel/index.native.js +2 -2
  537. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  538. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  539. package/build-module/mobile/gradient/index.native.js.map +1 -1
  540. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  541. package/build-module/mobile/image/index.native.js +3 -2
  542. package/build-module/mobile/image/index.native.js.map +1 -1
  543. package/build-module/mobile/inserter-button/index.native.js.map +1 -1
  544. package/build-module/mobile/link-picker/index.native.js +4 -3
  545. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  546. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  547. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  548. package/build-module/mobile/segmented-control/index.native.js +3 -4
  549. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  550. package/build-module/modal/index.js +20 -6
  551. package/build-module/modal/index.js.map +1 -1
  552. package/build-module/navigable-container/container.js +5 -2
  553. package/build-module/navigable-container/container.js.map +1 -1
  554. package/build-module/navigation/context.js +3 -5
  555. package/build-module/navigation/context.js.map +1 -1
  556. package/build-module/navigation/group/index.js +3 -6
  557. package/build-module/navigation/group/index.js.map +1 -1
  558. package/build-module/navigation/index.js +7 -2
  559. package/build-module/navigation/index.js.map +1 -1
  560. package/build-module/navigation/item/base.js +5 -2
  561. package/build-module/navigation/item/base.js.map +1 -1
  562. package/build-module/navigation/item/index.js +3 -1
  563. package/build-module/navigation/item/index.js.map +1 -1
  564. package/build-module/navigation/item/use-navigation-tree-item.js +2 -1
  565. package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
  566. package/build-module/navigation/menu/menu-title-search.js +1 -6
  567. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  568. package/build-module/navigation/menu/search-no-results-found.js +1 -6
  569. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  570. package/build-module/navigation/use-navigation-tree-nodes.js +18 -9
  571. package/build-module/navigation/use-navigation-tree-nodes.js.map +1 -1
  572. package/build-module/navigation/utils.js +2 -2
  573. package/build-module/navigation/utils.js.map +1 -1
  574. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  575. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  576. package/build-module/navigator/navigator-provider/component.js +1 -1
  577. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  578. package/build-module/navigator/navigator-screen/component.js +1 -1
  579. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  580. package/build-module/notice/index.js +2 -1
  581. package/build-module/notice/index.js.map +1 -1
  582. package/build-module/notice/list.js +4 -1
  583. package/build-module/notice/list.js.map +1 -1
  584. package/build-module/panel/body.js +3 -1
  585. package/build-module/panel/body.js.map +1 -1
  586. package/build-module/placeholder/index.js +24 -11
  587. package/build-module/placeholder/index.js.map +1 -1
  588. package/build-module/popover/index.js +4 -4
  589. package/build-module/popover/index.js.map +1 -1
  590. package/build-module/radio-control/index.js +40 -7
  591. package/build-module/radio-control/index.js.map +1 -1
  592. package/build-module/radio-control/types.js +2 -0
  593. package/build-module/radio-control/types.js.map +1 -0
  594. package/build-module/range-control/index.js +57 -41
  595. package/build-module/range-control/index.js.map +1 -1
  596. package/build-module/range-control/input-range.js +7 -11
  597. package/build-module/range-control/input-range.js.map +1 -1
  598. package/build-module/range-control/mark.js +5 -6
  599. package/build-module/range-control/mark.js.map +1 -1
  600. package/build-module/range-control/rail.js +10 -15
  601. package/build-module/range-control/rail.js.map +1 -1
  602. package/build-module/range-control/styles/range-control-styles.js +62 -64
  603. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  604. package/build-module/range-control/tooltip.js +5 -6
  605. package/build-module/range-control/tooltip.js.map +1 -1
  606. package/build-module/range-control/types.js +2 -0
  607. package/build-module/range-control/types.js.map +1 -0
  608. package/build-module/range-control/utils.js +24 -32
  609. package/build-module/range-control/utils.js.map +1 -1
  610. package/build-module/resizable-box/resize-tooltip/index.js +2 -1
  611. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  612. package/build-module/resizable-box/resize-tooltip/utils.js +5 -11
  613. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  614. package/build-module/responsive-wrapper/index.js.map +1 -1
  615. package/build-module/scrollable/component.js +7 -8
  616. package/build-module/scrollable/component.js.map +1 -1
  617. package/build-module/scrollable/hook.js +0 -8
  618. package/build-module/scrollable/hook.js.map +1 -1
  619. package/build-module/scrollable/index.js.map +1 -1
  620. package/build-module/scrollable/styles.js +7 -7
  621. package/build-module/scrollable/styles.js.map +1 -1
  622. package/build-module/select-control/index.js +3 -1
  623. package/build-module/select-control/index.js.map +1 -1
  624. package/build-module/shortcut/index.js +2 -7
  625. package/build-module/shortcut/index.js.map +1 -1
  626. package/build-module/slot-fill/fill.js +1 -6
  627. package/build-module/slot-fill/fill.js.map +1 -1
  628. package/build-module/slot-fill/index.native.js +6 -7
  629. package/build-module/slot-fill/index.native.js.map +1 -1
  630. package/build-module/slot-fill/provider.js +4 -7
  631. package/build-module/slot-fill/provider.js.map +1 -1
  632. package/build-module/slot-fill/slot.js +15 -8
  633. package/build-module/slot-fill/slot.js.map +1 -1
  634. package/build-module/snackbar/index.js +3 -1
  635. package/build-module/snackbar/index.js.map +1 -1
  636. package/build-module/snackbar/list.js +4 -1
  637. package/build-module/snackbar/list.js.map +1 -1
  638. package/build-module/spacer/component.js +3 -4
  639. package/build-module/spacer/component.js.map +1 -1
  640. package/build-module/spacer/hook.js +2 -2
  641. package/build-module/spacer/hook.js.map +1 -1
  642. package/build-module/spacer/index.js.map +1 -1
  643. package/build-module/spinner/index.js +22 -13
  644. package/build-module/spinner/index.js.map +1 -1
  645. package/build-module/spinner/styles.js +10 -10
  646. package/build-module/spinner/styles.js.map +1 -1
  647. package/build-module/tab-panel/index.js +3 -1
  648. package/build-module/tab-panel/index.js.map +1 -1
  649. package/build-module/text/hook.js +4 -4
  650. package/build-module/text/hook.js.map +1 -1
  651. package/build-module/text/utils.js.map +1 -1
  652. package/build-module/text-highlight/index.js +23 -6
  653. package/build-module/text-highlight/index.js.map +1 -1
  654. package/build-module/text-highlight/types.js +2 -0
  655. package/build-module/text-highlight/types.js.map +1 -0
  656. package/build-module/tip/index.js +6 -10
  657. package/build-module/tip/index.js.map +1 -1
  658. package/build-module/tip/types.js +2 -0
  659. package/build-module/tip/types.js.map +1 -0
  660. package/build-module/toggle-control/index.js +1 -2
  661. package/build-module/toggle-control/index.js.map +1 -1
  662. package/build-module/toggle-control/index.native.js +1 -6
  663. package/build-module/toggle-control/index.native.js.map +1 -1
  664. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  665. package/build-module/toolbar/index.js.map +1 -1
  666. package/build-module/toolbar-group/index.js +3 -2
  667. package/build-module/toolbar-group/index.js.map +1 -1
  668. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  669. package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
  670. package/build-module/tooltip/index.js +2 -1
  671. package/build-module/tooltip/index.js.map +1 -1
  672. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  673. package/build-module/tree-select/index.js +56 -6
  674. package/build-module/tree-select/index.js.map +1 -1
  675. package/build-module/tree-select/types.js +2 -0
  676. package/build-module/tree-select/types.js.map +1 -0
  677. package/build-module/truncate/component.js +7 -8
  678. package/build-module/truncate/component.js.map +1 -1
  679. package/build-module/truncate/hook.js +3 -10
  680. package/build-module/truncate/hook.js.map +1 -1
  681. package/build-module/truncate/index.js.map +1 -1
  682. package/build-module/truncate/styles.js +1 -1
  683. package/build-module/truncate/styles.js.map +1 -1
  684. package/build-module/truncate/utils.js +3 -16
  685. package/build-module/truncate/utils.js.map +1 -1
  686. package/build-module/ui/form-group/form-group-content.js.map +1 -1
  687. package/build-module/ui/utils/get-valid-children.js.map +1 -1
  688. package/build-module/unit-control/index.js.map +1 -1
  689. package/build-module/utils/math.js +15 -6
  690. package/build-module/utils/math.js.map +1 -1
  691. package/build-module/utils/unit-values.js.map +1 -1
  692. package/build-module/utils/values.js.map +1 -1
  693. package/build-module/v-stack/component.js +9 -9
  694. package/build-module/v-stack/component.js.map +1 -1
  695. package/build-module/v-stack/hook.js +0 -5
  696. package/build-module/v-stack/hook.js.map +1 -1
  697. package/build-module/v-stack/index.js.map +1 -1
  698. package/build-module/visually-hidden/component.js +12 -13
  699. package/build-module/visually-hidden/component.js.map +1 -1
  700. package/build-module/visually-hidden/index.js.map +1 -1
  701. package/build-module/visually-hidden/styles.js +3 -1
  702. package/build-module/visually-hidden/styles.js.map +1 -1
  703. package/build-module/visually-hidden/types.js +2 -0
  704. package/build-module/visually-hidden/types.js.map +1 -0
  705. package/build-module/z-stack/component.js +21 -2
  706. package/build-module/z-stack/component.js.map +1 -1
  707. package/build-module/z-stack/types.js +2 -0
  708. package/build-module/z-stack/types.js.map +1 -0
  709. package/build-style/style-rtl.css +61 -22
  710. package/build-style/style.css +61 -23
  711. package/build-types/base-control/stories/index.d.ts.map +1 -1
  712. package/build-types/base-field/hook.d.ts +0 -1
  713. package/build-types/base-field/hook.d.ts.map +1 -1
  714. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  715. package/build-types/border-box-control/border-box-control/hook.d.ts +0 -1
  716. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  717. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  718. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +0 -1
  719. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  720. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  721. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +0 -1
  722. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  723. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +0 -1
  724. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  725. package/build-types/border-box-control/utils.d.ts.map +1 -1
  726. package/build-types/border-control/border-control/component.d.ts +36 -2
  727. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  728. package/build-types/border-control/border-control/hook.d.ts +1 -2
  729. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  730. package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
  731. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  732. package/build-types/border-control/border-control-style-picker/hook.d.ts +0 -1
  733. package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -1
  734. package/build-types/border-control/stories/index.d.ts +33 -0
  735. package/build-types/border-control/stories/index.d.ts.map +1 -0
  736. package/build-types/button-group/index.d.ts +1 -1
  737. package/build-types/button-group/index.d.ts.map +1 -1
  738. package/build-types/card/card/hook.d.ts +0 -1
  739. package/build-types/card/card/hook.d.ts.map +1 -1
  740. package/build-types/card/card-body/hook.d.ts +0 -1
  741. package/build-types/card/card-body/hook.d.ts.map +1 -1
  742. package/build-types/card/card-divider/hook.d.ts +0 -1
  743. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  744. package/build-types/card/card-footer/hook.d.ts +0 -1
  745. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  746. package/build-types/card/card-header/hook.d.ts +0 -1
  747. package/build-types/card/card-header/hook.d.ts.map +1 -1
  748. package/build-types/card/card-media/hook.d.ts +0 -1
  749. package/build-types/card/card-media/hook.d.ts.map +1 -1
  750. package/build-types/checkbox-control/index.d.ts.map +1 -1
  751. package/build-types/checkbox-control/stories/index.d.ts.map +1 -1
  752. package/build-types/color-indicator/index.d.ts +16 -5
  753. package/build-types/color-indicator/index.d.ts.map +1 -1
  754. package/build-types/color-indicator/stories/index.d.ts +12 -0
  755. package/build-types/color-indicator/stories/index.d.ts.map +1 -0
  756. package/build-types/color-indicator/test/index.d.ts +2 -0
  757. package/build-types/color-indicator/test/index.d.ts.map +1 -0
  758. package/build-types/color-indicator/types.d.ts +12 -0
  759. package/build-types/color-indicator/types.d.ts.map +1 -0
  760. package/build-types/color-palette/index.d.ts.map +1 -1
  761. package/build-types/color-palette/styles.d.ts +4 -2
  762. package/build-types/color-palette/styles.d.ts.map +1 -1
  763. package/build-types/color-picker/component.d.ts.map +1 -1
  764. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  765. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  766. package/build-types/color-picker/styles.d.ts +48 -32
  767. package/build-types/color-picker/styles.d.ts.map +1 -1
  768. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
  769. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  770. package/build-types/date-time/date/index.d.ts +1 -1
  771. package/build-types/date-time/date/index.d.ts.map +1 -1
  772. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  773. package/build-types/date-time/stories/date-time.d.ts.map +1 -1
  774. package/build-types/date-time/stories/date.d.ts.map +1 -1
  775. package/build-types/date-time/time/styles.d.ts +1 -1
  776. package/build-types/date-time/types.d.ts +6 -0
  777. package/build-types/date-time/types.d.ts.map +1 -1
  778. package/build-types/divider/styles.d.ts.map +1 -1
  779. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  780. package/build-types/elevation/hook.d.ts +0 -1
  781. package/build-types/elevation/hook.d.ts.map +1 -1
  782. package/build-types/external-link/index.d.ts +17 -0
  783. package/build-types/external-link/index.d.ts.map +1 -0
  784. package/build-types/external-link/stories/index.d.ts +12 -0
  785. package/build-types/external-link/stories/index.d.ts.map +1 -0
  786. package/build-types/external-link/styles/external-link-styles.d.ts +10 -0
  787. package/build-types/external-link/styles/external-link-styles.d.ts.map +1 -0
  788. package/build-types/external-link/types.d.ts +15 -0
  789. package/build-types/external-link/types.d.ts.map +1 -0
  790. package/build-types/flex/flex/hook.d.ts +0 -1
  791. package/build-types/flex/flex/hook.d.ts.map +1 -1
  792. package/build-types/flex/flex-block/hook.d.ts +0 -1
  793. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  794. package/build-types/flex/flex-item/hook.d.ts +0 -1
  795. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  796. package/build-types/form-toggle/index.d.ts +29 -0
  797. package/build-types/form-toggle/index.d.ts.map +1 -0
  798. package/build-types/form-toggle/stories/index.d.ts +12 -0
  799. package/build-types/form-toggle/stories/index.d.ts.map +1 -0
  800. package/build-types/form-toggle/test/index.d.ts +2 -0
  801. package/build-types/form-toggle/test/index.d.ts.map +1 -0
  802. package/build-types/form-toggle/types.d.ts +22 -0
  803. package/build-types/form-toggle/types.d.ts.map +1 -0
  804. package/build-types/form-token-field/index.d.ts +15 -0
  805. package/build-types/form-token-field/index.d.ts.map +1 -0
  806. package/build-types/form-token-field/stories/index.d.ts +13 -0
  807. package/build-types/form-token-field/stories/index.d.ts.map +1 -0
  808. package/build-types/form-token-field/styles.d.ts +14 -0
  809. package/build-types/form-token-field/styles.d.ts.map +1 -0
  810. package/build-types/form-token-field/suggestions-list.d.ts +10 -0
  811. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -0
  812. package/build-types/form-token-field/test/lib/fixtures.d.ts +26 -0
  813. package/build-types/form-token-field/test/lib/fixtures.d.ts.map +1 -0
  814. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +21 -0
  815. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +1 -0
  816. package/build-types/form-token-field/token-input.d.ts +12 -0
  817. package/build-types/form-token-field/token-input.d.ts.map +1 -0
  818. package/build-types/form-token-field/token.d.ts +4 -0
  819. package/build-types/form-token-field/token.d.ts.map +1 -0
  820. package/build-types/form-token-field/types.d.ts +183 -0
  821. package/build-types/form-token-field/types.d.ts.map +1 -0
  822. package/build-types/grid/component.d.ts +3 -3
  823. package/build-types/grid/component.d.ts.map +1 -1
  824. package/build-types/grid/hook.d.ts +5 -3
  825. package/build-types/grid/hook.d.ts.map +1 -1
  826. package/build-types/grid/index.d.ts +2 -2
  827. package/build-types/grid/index.d.ts.map +1 -1
  828. package/build-types/grid/stories/index.d.ts +9 -0
  829. package/build-types/grid/stories/index.d.ts.map +1 -0
  830. package/build-types/grid/test/grid.d.ts +2 -0
  831. package/build-types/grid/test/grid.d.ts.map +1 -0
  832. package/build-types/grid/types.d.ts +16 -15
  833. package/build-types/grid/types.d.ts.map +1 -1
  834. package/build-types/grid/utils.d.ts +50 -69
  835. package/build-types/grid/utils.d.ts.map +1 -1
  836. package/build-types/h-stack/component.d.ts +3 -2
  837. package/build-types/h-stack/component.d.ts.map +1 -1
  838. package/build-types/h-stack/hook.d.ts +5 -4
  839. package/build-types/h-stack/hook.d.ts.map +1 -1
  840. package/build-types/h-stack/index.d.ts +2 -2
  841. package/build-types/h-stack/index.d.ts.map +1 -1
  842. package/build-types/h-stack/stories/index.d.ts +9 -0
  843. package/build-types/h-stack/stories/index.d.ts.map +1 -0
  844. package/build-types/h-stack/test/index.d.ts +2 -0
  845. package/build-types/h-stack/test/index.d.ts.map +1 -0
  846. package/build-types/h-stack/utils.d.ts +8 -4
  847. package/build-types/h-stack/utils.d.ts.map +1 -1
  848. package/build-types/heading/component.d.ts +1 -2
  849. package/build-types/heading/component.d.ts.map +1 -1
  850. package/build-types/heading/hook.d.ts +1 -29
  851. package/build-types/heading/hook.d.ts.map +1 -1
  852. package/build-types/heading/stories/index.d.ts.map +1 -1
  853. package/build-types/heading/test/index.d.ts +2 -0
  854. package/build-types/heading/test/index.d.ts.map +1 -0
  855. package/build-types/heading/types.d.ts +16 -0
  856. package/build-types/heading/types.d.ts.map +1 -0
  857. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  858. package/build-types/icon/index.d.ts +1 -1
  859. package/build-types/icon/index.d.ts.map +1 -1
  860. package/build-types/input-control/index.d.ts +1 -1
  861. package/build-types/input-control/index.d.ts.map +1 -1
  862. package/build-types/input-control/input-field.d.ts +1 -1
  863. package/build-types/input-control/input-field.d.ts.map +1 -1
  864. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  865. package/build-types/input-control/stories/index.d.ts +5 -5
  866. package/build-types/input-control/stories/index.d.ts.map +1 -1
  867. package/build-types/item-group/item/hook.d.ts +0 -1
  868. package/build-types/item-group/item/hook.d.ts.map +1 -1
  869. package/build-types/item-group/item-group/hook.d.ts +0 -1
  870. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  871. package/build-types/menu-item/index.d.ts.map +1 -1
  872. package/build-types/navigator/navigator-back-button/hook.d.ts +0 -1
  873. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  874. package/build-types/navigator/navigator-button/hook.d.ts +0 -1
  875. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  876. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  877. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  878. package/build-types/popover/index.d.ts.map +1 -1
  879. package/build-types/radio-control/index.d.ts +31 -0
  880. package/build-types/radio-control/index.d.ts.map +1 -0
  881. package/build-types/radio-control/stories/index.d.ts +12 -0
  882. package/build-types/radio-control/stories/index.d.ts.map +1 -0
  883. package/build-types/radio-control/types.d.ts +29 -0
  884. package/build-types/radio-control/types.d.ts.map +1 -0
  885. package/build-types/range-control/index.d.ts +54 -29
  886. package/build-types/range-control/index.d.ts.map +1 -1
  887. package/build-types/range-control/input-range.d.ts +7 -10
  888. package/build-types/range-control/input-range.d.ts.map +1 -1
  889. package/build-types/range-control/mark.d.ts +4 -7
  890. package/build-types/range-control/mark.d.ts.map +1 -1
  891. package/build-types/range-control/rail.d.ts +4 -9
  892. package/build-types/range-control/rail.d.ts.map +1 -1
  893. package/build-types/range-control/stories/index.d.ts +48 -0
  894. package/build-types/range-control/stories/index.d.ts.map +1 -0
  895. package/build-types/range-control/styles/range-control-styles.d.ts +32 -40
  896. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  897. package/build-types/range-control/test/index.d.ts +2 -0
  898. package/build-types/range-control/test/index.d.ts.map +1 -0
  899. package/build-types/range-control/tooltip.d.ts +4 -11
  900. package/build-types/range-control/tooltip.d.ts.map +1 -1
  901. package/build-types/range-control/types.d.ts +302 -0
  902. package/build-types/range-control/types.d.ts.map +1 -0
  903. package/build-types/range-control/utils.d.ts +15 -33
  904. package/build-types/range-control/utils.d.ts.map +1 -1
  905. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  906. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  907. package/build-types/scrollable/component.d.ts +3 -3
  908. package/build-types/scrollable/component.d.ts.map +1 -1
  909. package/build-types/scrollable/hook.d.ts +5 -3
  910. package/build-types/scrollable/hook.d.ts.map +1 -1
  911. package/build-types/scrollable/index.d.ts +2 -2
  912. package/build-types/scrollable/index.d.ts.map +1 -1
  913. package/build-types/scrollable/stories/index.d.ts +9 -0
  914. package/build-types/scrollable/stories/index.d.ts.map +1 -0
  915. package/build-types/scrollable/styles.d.ts +7 -7
  916. package/build-types/scrollable/styles.d.ts.map +1 -1
  917. package/build-types/scrollable/test/index.d.ts +2 -0
  918. package/build-types/scrollable/test/index.d.ts.map +1 -0
  919. package/build-types/scrollable/types.d.ts +9 -6
  920. package/build-types/scrollable/types.d.ts.map +1 -1
  921. package/build-types/select-control/index.d.ts +1 -1
  922. package/build-types/select-control/index.d.ts.map +1 -1
  923. package/build-types/select-control/stories/index.d.ts +3 -3
  924. package/build-types/select-control/stories/index.d.ts.map +1 -1
  925. package/build-types/shortcut/index.d.ts.map +1 -1
  926. package/build-types/slot-fill/fill.d.ts.map +1 -1
  927. package/build-types/slot-fill/provider.d.ts.map +1 -1
  928. package/build-types/slot-fill/slot.d.ts.map +1 -1
  929. package/build-types/spacer/component.d.ts +3 -4
  930. package/build-types/spacer/component.d.ts.map +1 -1
  931. package/build-types/spacer/hook.d.ts +2 -3
  932. package/build-types/spacer/hook.d.ts.map +1 -1
  933. package/build-types/spacer/index.d.ts +1 -1
  934. package/build-types/spacer/index.d.ts.map +1 -1
  935. package/build-types/spacer/stories/index.d.ts +12 -0
  936. package/build-types/spacer/stories/index.d.ts.map +1 -0
  937. package/build-types/spacer/test/index.d.ts +2 -0
  938. package/build-types/spacer/test/index.d.ts.map +1 -0
  939. package/build-types/spacer/types.d.ts +41 -29
  940. package/build-types/spacer/types.d.ts.map +1 -1
  941. package/build-types/spinner/index.d.ts +16 -15
  942. package/build-types/spinner/index.d.ts.map +1 -1
  943. package/build-types/spinner/stories/index.d.ts +13 -0
  944. package/build-types/spinner/stories/index.d.ts.map +1 -0
  945. package/build-types/spinner/styles.d.ts +4 -3
  946. package/build-types/spinner/styles.d.ts.map +1 -1
  947. package/build-types/surface/hook.d.ts +0 -1
  948. package/build-types/surface/hook.d.ts.map +1 -1
  949. package/build-types/text/hook.d.ts +0 -1
  950. package/build-types/text/hook.d.ts.map +1 -1
  951. package/build-types/text/types.d.ts +1 -1
  952. package/build-types/text/types.d.ts.map +1 -1
  953. package/build-types/text/utils.d.ts.map +1 -1
  954. package/build-types/text-control/index.d.ts +1 -1
  955. package/build-types/text-control/index.d.ts.map +1 -1
  956. package/build-types/text-control/stories/index.d.ts.map +1 -1
  957. package/build-types/text-highlight/index.d.ts +23 -0
  958. package/build-types/text-highlight/index.d.ts.map +1 -0
  959. package/build-types/text-highlight/stories/index.d.ts +12 -0
  960. package/build-types/text-highlight/stories/index.d.ts.map +1 -0
  961. package/build-types/text-highlight/test/index.d.ts +2 -0
  962. package/build-types/text-highlight/test/index.d.ts.map +1 -0
  963. package/build-types/text-highlight/types.d.ts +17 -0
  964. package/build-types/text-highlight/types.d.ts.map +1 -0
  965. package/build-types/tip/index.d.ts +5 -14
  966. package/build-types/tip/index.d.ts.map +1 -1
  967. package/build-types/tip/stories/index.d.ts +12 -0
  968. package/build-types/tip/stories/index.d.ts.map +1 -0
  969. package/build-types/tip/types.d.ts +11 -0
  970. package/build-types/tip/types.d.ts.map +1 -0
  971. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
  972. package/build-types/tools-panel/tools-panel/hook.d.ts +0 -1
  973. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  974. package/build-types/tools-panel/tools-panel-header/hook.d.ts +0 -1
  975. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  976. package/build-types/tools-panel/tools-panel-item/hook.d.ts +0 -1
  977. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  978. package/build-types/tooltip/index.d.ts.map +1 -1
  979. package/build-types/tree-select/index.d.ts +53 -0
  980. package/build-types/tree-select/index.d.ts.map +1 -0
  981. package/build-types/tree-select/stories/index.d.ts +12 -0
  982. package/build-types/tree-select/stories/index.d.ts.map +1 -0
  983. package/build-types/tree-select/types.d.ts +30 -0
  984. package/build-types/tree-select/types.d.ts.map +1 -0
  985. package/build-types/truncate/component.d.ts +3 -3
  986. package/build-types/truncate/component.d.ts.map +1 -1
  987. package/build-types/truncate/hook.d.ts +5 -3
  988. package/build-types/truncate/hook.d.ts.map +1 -1
  989. package/build-types/truncate/index.d.ts +2 -2
  990. package/build-types/truncate/index.d.ts.map +1 -1
  991. package/build-types/truncate/stories/index.d.ts +13 -0
  992. package/build-types/truncate/stories/index.d.ts.map +1 -0
  993. package/build-types/truncate/styles.d.ts +1 -1
  994. package/build-types/truncate/styles.d.ts.map +1 -1
  995. package/build-types/truncate/test/index.d.ts +2 -0
  996. package/build-types/truncate/test/index.d.ts.map +1 -0
  997. package/build-types/truncate/types.d.ts +22 -11
  998. package/build-types/truncate/types.d.ts.map +1 -1
  999. package/build-types/truncate/utils.d.ts +17 -28
  1000. package/build-types/truncate/utils.d.ts.map +1 -1
  1001. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  1002. package/build-types/ui/control-group/hook.d.ts +0 -1
  1003. package/build-types/ui/control-group/hook.d.ts.map +1 -1
  1004. package/build-types/ui/control-label/hook.d.ts +0 -1
  1005. package/build-types/ui/control-label/hook.d.ts.map +1 -1
  1006. package/build-types/ui/form-group/form-group.d.ts +1 -1
  1007. package/build-types/ui/form-group/types.d.ts +1 -1
  1008. package/build-types/ui/form-group/types.d.ts.map +1 -1
  1009. package/build-types/ui/form-group/use-form-group.d.ts +5 -7
  1010. package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
  1011. package/build-types/ui/utils/get-valid-children.d.ts +2 -2
  1012. package/build-types/ui/utils/get-valid-children.d.ts.map +1 -1
  1013. package/build-types/unit-control/index.d.ts +1 -1
  1014. package/build-types/unit-control/index.d.ts.map +1 -1
  1015. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  1016. package/build-types/utils/math.d.ts +10 -0
  1017. package/build-types/utils/math.d.ts.map +1 -1
  1018. package/build-types/utils/unit-values.d.ts.map +1 -1
  1019. package/build-types/utils/values.d.ts.map +1 -1
  1020. package/build-types/v-stack/component.d.ts +5 -4
  1021. package/build-types/v-stack/component.d.ts.map +1 -1
  1022. package/build-types/v-stack/hook.d.ts +5 -4
  1023. package/build-types/v-stack/hook.d.ts.map +1 -1
  1024. package/build-types/v-stack/index.d.ts +2 -2
  1025. package/build-types/v-stack/index.d.ts.map +1 -1
  1026. package/build-types/v-stack/stories/index.d.ts +9 -0
  1027. package/build-types/v-stack/stories/index.d.ts.map +1 -0
  1028. package/build-types/v-stack/test/index.d.ts +2 -0
  1029. package/build-types/v-stack/test/index.d.ts.map +1 -0
  1030. package/build-types/v-stack/types.d.ts +21 -1
  1031. package/build-types/v-stack/types.d.ts.map +1 -1
  1032. package/build-types/visually-hidden/component.d.ts +8 -10
  1033. package/build-types/visually-hidden/component.d.ts.map +1 -1
  1034. package/build-types/visually-hidden/index.d.ts +1 -1
  1035. package/build-types/visually-hidden/index.d.ts.map +1 -1
  1036. package/build-types/visually-hidden/stories/index.d.ts +14 -0
  1037. package/build-types/visually-hidden/stories/index.d.ts.map +1 -0
  1038. package/build-types/visually-hidden/styles.d.ts +5 -2
  1039. package/build-types/visually-hidden/styles.d.ts.map +1 -1
  1040. package/build-types/visually-hidden/test/index.d.ts +2 -0
  1041. package/build-types/visually-hidden/test/index.d.ts.map +1 -0
  1042. package/build-types/visually-hidden/types.d.ts +11 -0
  1043. package/build-types/visually-hidden/types.d.ts.map +1 -0
  1044. package/build-types/z-stack/component.d.ts +18 -28
  1045. package/build-types/z-stack/component.d.ts.map +1 -1
  1046. package/build-types/z-stack/stories/index.d.ts +6 -0
  1047. package/build-types/z-stack/stories/index.d.ts.map +1 -0
  1048. package/build-types/z-stack/types.d.ts +33 -0
  1049. package/build-types/z-stack/types.d.ts.map +1 -0
  1050. package/package.json +18 -17
  1051. package/src/alignment-matrix-control/index.js +2 -1
  1052. package/src/alignment-matrix-control/utils.js +1 -6
  1053. package/src/angle-picker-control/index.js +1 -1
  1054. package/src/autocomplete/autocompleter-ui.js +4 -1
  1055. package/src/autocomplete/autocompleter-ui.native.js +8 -2
  1056. package/src/autocomplete/get-default-use-items.js +3 -2
  1057. package/src/autocomplete/index.js +7 -10
  1058. package/src/base-control/stories/index.tsx +2 -3
  1059. package/src/border-box-control/border-box-control/component.tsx +1 -0
  1060. package/src/border-box-control/border-box-control-linked-button/component.tsx +2 -5
  1061. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -0
  1062. package/src/border-box-control/utils.ts +5 -2
  1063. package/src/border-control/border-control/component.tsx +41 -4
  1064. package/src/border-control/border-control/hook.ts +3 -4
  1065. package/src/border-control/stories/index.tsx +150 -0
  1066. package/src/box-control/all-input-control.js +2 -4
  1067. package/src/box-control/axial-input-controls.js +4 -6
  1068. package/src/box-control/index.js +3 -6
  1069. package/src/box-control/input-controls.js +33 -36
  1070. package/src/box-control/unit-control.js +2 -1
  1071. package/src/box-control/utils.js +4 -4
  1072. package/src/button/README.md +1 -1
  1073. package/src/button/index.native.js +1 -2
  1074. package/src/card/stories/index.js +10 -5
  1075. package/src/checkbox-control/index.tsx +2 -3
  1076. package/src/checkbox-control/stories/index.tsx +2 -3
  1077. package/src/checkbox-control/test/index.tsx +2 -1
  1078. package/src/color-indicator/README.md +7 -9
  1079. package/src/color-indicator/index.tsx +47 -0
  1080. package/src/color-indicator/stories/index.tsx +37 -0
  1081. package/src/color-indicator/test/__snapshots__/index.tsx.snap +11 -0
  1082. package/src/color-indicator/test/{index.js → index.tsx} +4 -4
  1083. package/src/color-indicator/types.ts +12 -0
  1084. package/src/color-palette/index.js +5 -1
  1085. package/src/color-picker/component.tsx +12 -11
  1086. package/src/color-picker/hex-input.tsx +3 -2
  1087. package/src/color-picker/index.native.js +27 -31
  1088. package/src/color-picker/input-with-slider.tsx +4 -2
  1089. package/src/color-picker/styles.ts +20 -6
  1090. package/src/color-picker/use-deprecated-props.ts +24 -43
  1091. package/src/combobox-control/index.js +18 -8
  1092. package/src/combobox-control/stories/index.js +3 -2
  1093. package/src/combobox-control/style.scss +1 -1
  1094. package/src/combobox-control/styles.ts +27 -0
  1095. package/src/confirm-dialog/component.tsx +7 -8
  1096. package/src/custom-gradient-bar/constants.js +2 -2
  1097. package/src/custom-gradient-bar/control-points.js +20 -16
  1098. package/src/custom-gradient-bar/index.js +11 -11
  1099. package/src/custom-gradient-bar/test/utils.js +79 -0
  1100. package/src/custom-gradient-bar/utils.js +6 -18
  1101. package/src/custom-gradient-picker/index.js +4 -11
  1102. package/src/custom-gradient-picker/index.native.js +3 -11
  1103. package/src/custom-gradient-picker/serializer.js +5 -11
  1104. package/src/custom-gradient-picker/style.scss +1 -3
  1105. package/src/custom-gradient-picker/utils.js +4 -3
  1106. package/src/custom-select-control/index.js +2 -1
  1107. package/src/custom-select-control/stories/index.js +1 -2
  1108. package/src/date-time/README.md +7 -0
  1109. package/src/date-time/date/index.tsx +4 -2
  1110. package/src/date-time/date/style.scss +10 -0
  1111. package/src/date-time/date/test/index.tsx +1 -1
  1112. package/src/date-time/date-time/index.tsx +8 -8
  1113. package/src/date-time/stories/date-time.tsx +4 -6
  1114. package/src/date-time/stories/date.tsx +2 -3
  1115. package/src/date-time/time/test/index.tsx +12 -12
  1116. package/src/date-time/types.ts +7 -0
  1117. package/src/dimension-control/README.md +5 -2
  1118. package/src/dimension-control/index.js +1 -2
  1119. package/src/dimension-control/test/index.test.js +7 -7
  1120. package/src/divider/styles.ts +2 -3
  1121. package/src/draggable/index.js +3 -3
  1122. package/src/draggable/index.native.js +12 -4
  1123. package/src/drop-zone/provider.js +1 -2
  1124. package/src/dropdown/index.js +2 -2
  1125. package/src/dropdown-menu/index.js +13 -4
  1126. package/src/dropdown-menu/index.native.js +13 -5
  1127. package/src/duotone-picker/duotone-picker.js +58 -37
  1128. package/src/duotone-picker/style.scss +19 -0
  1129. package/src/elevation/hook.js +11 -11
  1130. package/src/external-link/README.md +18 -0
  1131. package/src/external-link/{index.js → index.tsx} +35 -9
  1132. package/src/external-link/stories/index.tsx +36 -0
  1133. package/src/external-link/styles/{external-link-styles.js → external-link-styles.ts} +0 -0
  1134. package/src/external-link/types.ts +15 -0
  1135. package/src/flex/flex/README.md +5 -10
  1136. package/src/flex/flex/hook.js +4 -1
  1137. package/src/flex/flex-item/README.md +1 -1
  1138. package/src/focal-point-picker/controls.js +1 -5
  1139. package/src/focal-point-picker/grid.js +2 -5
  1140. package/src/focal-point-picker/index.js +2 -8
  1141. package/src/focal-point-picker/index.native.js +9 -9
  1142. package/src/focal-point-picker/media.js +2 -5
  1143. package/src/focal-point-picker/tooltip/index.native.js +10 -11
  1144. package/src/font-size-picker/index.js +3 -1
  1145. package/src/form-toggle/README.md +10 -11
  1146. package/src/form-toggle/index.tsx +71 -0
  1147. package/src/form-toggle/stories/index.tsx +52 -0
  1148. package/src/form-toggle/test/__snapshots__/index.tsx.snap +54 -0
  1149. package/src/form-toggle/test/index.tsx +102 -0
  1150. package/src/form-toggle/types.ts +22 -0
  1151. package/src/form-token-field/index.tsx +715 -0
  1152. package/src/form-token-field/stories/index.tsx +103 -0
  1153. package/src/form-token-field/style.scss +4 -8
  1154. package/src/form-token-field/styles.ts +32 -0
  1155. package/src/form-token-field/{suggestions-list.js → suggestions-list.tsx} +43 -29
  1156. package/src/form-token-field/test/index.js +70 -40
  1157. package/src/form-token-field/test/lib/token-field-wrapper.tsx +71 -0
  1158. package/src/form-token-field/token-input.tsx +76 -0
  1159. package/src/form-token-field/{token.js → token.tsx} +4 -2
  1160. package/src/form-token-field/types.ts +185 -0
  1161. package/src/gradient-picker/index.js +4 -3
  1162. package/src/grid/README.md +33 -19
  1163. package/src/grid/{component.js → component.tsx} +13 -9
  1164. package/src/grid/{hook.js → hook.ts} +5 -5
  1165. package/src/grid/{index.js → index.ts} +0 -0
  1166. package/src/grid/stories/index.tsx +72 -0
  1167. package/src/grid/test/{grid.js → grid.tsx} +4 -4
  1168. package/src/grid/types.ts +16 -17
  1169. package/src/grid/{utils.js → utils.ts} +9 -7
  1170. package/src/guide/style.scss +1 -0
  1171. package/src/h-stack/{component.js → component.tsx} +8 -8
  1172. package/src/h-stack/{hook.js → hook.tsx} +21 -16
  1173. package/src/h-stack/{index.js → index.ts} +0 -0
  1174. package/src/h-stack/stories/index.tsx +92 -0
  1175. package/src/h-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1176. package/src/h-stack/test/{index.js → index.tsx} +0 -0
  1177. package/src/h-stack/{utils.js → utils.ts} +16 -16
  1178. package/src/heading/README.md +4 -3
  1179. package/src/heading/component.tsx +2 -2
  1180. package/src/heading/hook.ts +6 -46
  1181. package/src/heading/stories/index.tsx +5 -1
  1182. package/src/heading/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1183. package/src/heading/test/index.tsx +68 -0
  1184. package/src/heading/types.ts +29 -0
  1185. package/src/higher-order/navigate-regions/README.md +4 -1
  1186. package/src/higher-order/navigate-regions/index.js +7 -5
  1187. package/src/higher-order/with-filters/test/index.js +43 -36
  1188. package/src/higher-order/with-focus-return/index.js +14 -13
  1189. package/src/higher-order/with-spoken-messages/index.js +8 -7
  1190. package/src/higher-order/with-spoken-messages/test/index.js +1 -1
  1191. package/src/icon/index.tsx +3 -3
  1192. package/src/input-control/index.tsx +2 -1
  1193. package/src/input-control/input-field.tsx +2 -1
  1194. package/src/input-control/reducer/reducer.ts +23 -21
  1195. package/src/input-control/test/index.js +106 -31
  1196. package/src/input-control/utils.ts +1 -1
  1197. package/src/item-group/stories/index.js +2 -1
  1198. package/src/menu-item/index.js +1 -2
  1199. package/src/menu-item/test/index.js +2 -1
  1200. package/src/menu-items-choice/index.js +2 -5
  1201. package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -4
  1202. package/src/mobile/bottom-sheet/cell.native.js +2 -3
  1203. package/src/mobile/bottom-sheet/cycle-picker-cell.native.js +3 -5
  1204. package/src/mobile/bottom-sheet/index.native.js +14 -17
  1205. package/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js +2 -7
  1206. package/src/mobile/bottom-sheet/picker-cell.native.js +2 -7
  1207. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +4 -6
  1208. package/src/mobile/color-settings/index.native.js +2 -4
  1209. package/src/mobile/focal-point-settings-panel/index.native.js +2 -2
  1210. package/src/mobile/global-styles-context/index.native.js +8 -7
  1211. package/src/mobile/gradient/index.native.js +12 -9
  1212. package/src/mobile/gradient/test/index.native.js +1 -3
  1213. package/src/mobile/html-text-input/index.native.js +2 -3
  1214. package/src/mobile/image/index.native.js +3 -2
  1215. package/src/mobile/inserter-button/index.native.js +2 -6
  1216. package/src/mobile/link-picker/index.native.js +2 -3
  1217. package/src/mobile/link-settings/image-link-destinations-screen.native.js +6 -2
  1218. package/src/mobile/media-edit/index.native.js +2 -3
  1219. package/src/mobile/segmented-control/index.native.js +9 -9
  1220. package/src/mobile/utils/test/index.native.js +3 -12
  1221. package/src/modal/index.js +22 -3
  1222. package/src/modal/stories/index.js +17 -1
  1223. package/src/modal/style.scss +9 -18
  1224. package/src/navigable-container/container.js +3 -2
  1225. package/src/navigable-container/test/menu.js +1 -2
  1226. package/src/navigable-container/test/tabbable.js +1 -2
  1227. package/src/navigation/context.js +2 -5
  1228. package/src/navigation/group/index.js +8 -3
  1229. package/src/navigation/index.js +5 -1
  1230. package/src/navigation/item/base.js +5 -3
  1231. package/src/navigation/item/index.js +2 -1
  1232. package/src/navigation/item/use-navigation-tree-item.js +2 -0
  1233. package/src/navigation/menu/menu-title-search.js +3 -6
  1234. package/src/navigation/menu/search-no-results-found.js +3 -6
  1235. package/src/navigation/stories/controlled-state.js +1 -1
  1236. package/src/navigation/stories/more-examples.js +2 -3
  1237. package/src/navigation/test/index.js +252 -52
  1238. package/src/navigation/use-navigation-tree-nodes.js +11 -10
  1239. package/src/navigation/utils.js +2 -2
  1240. package/src/navigator/navigator-back-button/hook.ts +14 -12
  1241. package/src/navigator/navigator-button/hook.ts +14 -13
  1242. package/src/navigator/navigator-provider/component.tsx +2 -6
  1243. package/src/navigator/navigator-screen/component.tsx +3 -3
  1244. package/src/notice/index.js +2 -1
  1245. package/src/notice/list.js +3 -1
  1246. package/src/number-control/stories/index.js +24 -24
  1247. package/src/panel/body.js +2 -1
  1248. package/src/placeholder/README.md +7 -6
  1249. package/src/placeholder/index.js +27 -10
  1250. package/src/placeholder/style.scss +23 -0
  1251. package/src/popover/README.md +2 -2
  1252. package/src/popover/index.js +7 -4
  1253. package/src/radio-control/README.md +17 -23
  1254. package/src/radio-control/index.tsx +107 -0
  1255. package/src/radio-control/stories/index.tsx +72 -0
  1256. package/src/radio-control/types.ts +32 -0
  1257. package/src/range-control/README.md +107 -79
  1258. package/src/range-control/{index.js → index.tsx} +81 -49
  1259. package/src/range-control/{input-range.js → input-range.tsx} +13 -12
  1260. package/src/range-control/{mark.js → mark.tsx} +15 -9
  1261. package/src/range-control/{rail.js → rail.tsx} +40 -23
  1262. package/src/range-control/stories/index.tsx +244 -0
  1263. package/src/range-control/styles/{range-control-styles.js → range-control-styles.ts} +28 -24
  1264. package/src/range-control/test/index.tsx +311 -0
  1265. package/src/range-control/{tooltip.js → tooltip.tsx} +19 -14
  1266. package/src/range-control/types.ts +326 -0
  1267. package/src/range-control/utils.ts +132 -0
  1268. package/src/resizable-box/resize-tooltip/index.tsx +2 -1
  1269. package/src/resizable-box/resize-tooltip/utils.ts +3 -8
  1270. package/src/responsive-wrapper/index.js +2 -4
  1271. package/src/sandbox/test/index.js +4 -6
  1272. package/src/scrollable/README.md +14 -8
  1273. package/src/scrollable/{component.js → component.tsx} +13 -10
  1274. package/src/scrollable/{hook.js → hook.ts} +5 -7
  1275. package/src/scrollable/{index.js → index.ts} +0 -0
  1276. package/src/scrollable/stories/{index.js → index.tsx} +29 -34
  1277. package/src/scrollable/{styles.js → styles.ts} +0 -0
  1278. package/src/scrollable/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
  1279. package/src/scrollable/test/index.tsx +34 -0
  1280. package/src/scrollable/types.ts +10 -5
  1281. package/src/select-control/index.tsx +3 -1
  1282. package/src/select-control/stories/index.tsx +3 -4
  1283. package/src/select-control/test/select-control.tsx +22 -15
  1284. package/src/shortcut/index.js +2 -7
  1285. package/src/slot-fill/fill.js +1 -5
  1286. package/src/slot-fill/index.native.js +2 -7
  1287. package/src/slot-fill/provider.js +3 -7
  1288. package/src/slot-fill/slot.js +31 -24
  1289. package/src/slot-fill/test/slot.js +2 -3
  1290. package/src/snackbar/index.js +1 -1
  1291. package/src/snackbar/list.js +2 -1
  1292. package/src/spacer/README.md +43 -37
  1293. package/src/spacer/component.tsx +5 -6
  1294. package/src/spacer/hook.ts +4 -2
  1295. package/src/spacer/index.ts +1 -1
  1296. package/src/spacer/stories/index.tsx +70 -0
  1297. package/src/spacer/test/__snapshots__/{index.js.snap → index.tsx.snap} +1 -0
  1298. package/src/spacer/test/index.tsx +149 -0
  1299. package/src/spacer/types.ts +41 -29
  1300. package/src/spinner/{index.js → index.tsx} +23 -9
  1301. package/src/spinner/stories/index.tsx +32 -0
  1302. package/src/spinner/{styles.js → styles.ts} +0 -0
  1303. package/src/style.scss +1 -0
  1304. package/src/tab-panel/README.md +1 -1
  1305. package/src/tab-panel/index.js +3 -1
  1306. package/src/text/hook.js +4 -1
  1307. package/src/text/types.ts +1 -1
  1308. package/src/text/utils.js +2 -3
  1309. package/src/text-control/stories/index.tsx +4 -6
  1310. package/src/text-highlight/README.md +6 -6
  1311. package/src/text-highlight/index.tsx +49 -0
  1312. package/src/text-highlight/stories/index.tsx +33 -0
  1313. package/src/text-highlight/test/index.tsx +93 -0
  1314. package/src/text-highlight/types.ts +16 -0
  1315. package/src/tip/index.tsx +22 -0
  1316. package/src/tip/stories/index.tsx +33 -0
  1317. package/src/tip/types.ts +11 -0
  1318. package/src/toggle-control/index.js +1 -2
  1319. package/src/toggle-control/index.native.js +2 -6
  1320. package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +2 -4
  1321. package/src/toolbar/index.js +1 -2
  1322. package/src/toolbar-group/index.js +1 -2
  1323. package/src/tools-panel/tools-panel/hook.ts +2 -4
  1324. package/src/tools-panel/tools-panel-header/hook.ts +2 -5
  1325. package/src/tooltip/index.js +1 -0
  1326. package/src/tree-grid/roving-tab-index-item.js +2 -4
  1327. package/src/tree-grid/test/index.js +2 -3
  1328. package/src/tree-select/README.md +2 -2
  1329. package/src/tree-select/index.tsx +99 -0
  1330. package/src/tree-select/stories/index.tsx +80 -0
  1331. package/src/tree-select/types.ts +35 -0
  1332. package/src/truncate/README.md +16 -12
  1333. package/src/truncate/{component.js → component.tsx} +13 -9
  1334. package/src/truncate/{hook.js → hook.ts} +8 -10
  1335. package/src/truncate/{index.js → index.ts} +0 -0
  1336. package/src/truncate/stories/index.tsx +49 -0
  1337. package/src/truncate/{styles.js → styles.ts} +0 -0
  1338. package/src/truncate/test/{index.js → index.tsx} +4 -4
  1339. package/src/truncate/types.ts +28 -10
  1340. package/src/truncate/{utils.js → utils.ts} +19 -19
  1341. package/src/ui/context/wordpress-component.ts +4 -5
  1342. package/src/ui/form-group/form-group-content.js +4 -4
  1343. package/src/ui/form-group/types.ts +1 -1
  1344. package/src/ui/utils/get-valid-children.ts +4 -2
  1345. package/src/unit-control/index.tsx +7 -9
  1346. package/src/unit-control/stories/index.tsx +8 -12
  1347. package/src/unit-control/test/index.tsx +4 -7
  1348. package/src/utils/hooks/stories/use-cx.js +8 -7
  1349. package/src/utils/hooks/test/use-controlled-state.js +2 -1
  1350. package/src/utils/math.js +14 -5
  1351. package/src/utils/test/math.js +22 -1
  1352. package/src/utils/unit-values.ts +2 -1
  1353. package/src/utils/values.js +2 -3
  1354. package/src/v-stack/README.md +6 -18
  1355. package/src/v-stack/{component.js → component.tsx} +15 -10
  1356. package/src/v-stack/{hook.js → hook.ts} +5 -6
  1357. package/src/v-stack/{index.js → index.ts} +0 -0
  1358. package/src/v-stack/stories/index.tsx +41 -0
  1359. package/src/v-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1360. package/src/v-stack/test/{index.js → index.tsx} +0 -0
  1361. package/src/v-stack/types.ts +21 -1
  1362. package/src/visually-hidden/{component.js → component.tsx} +23 -15
  1363. package/src/visually-hidden/{index.js → index.ts} +0 -0
  1364. package/src/visually-hidden/stories/index.tsx +66 -0
  1365. package/src/visually-hidden/{styles.js → styles.ts} +6 -2
  1366. package/src/visually-hidden/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1367. package/src/visually-hidden/test/index.tsx +17 -0
  1368. package/src/visually-hidden/types.ts +11 -0
  1369. package/src/z-stack/README.md +14 -3
  1370. package/src/z-stack/component.tsx +24 -29
  1371. package/src/z-stack/stories/index.tsx +76 -0
  1372. package/src/z-stack/types.ts +33 -0
  1373. package/tsconfig.json +7 -0
  1374. package/tsconfig.tsbuildinfo +1 -1
  1375. package/src/border-control/stories/index.js +0 -119
  1376. package/src/color-indicator/index.js +0 -16
  1377. package/src/color-indicator/stories/index.js +0 -22
  1378. package/src/color-indicator/test/__snapshots__/index.js.snap +0 -13
  1379. package/src/external-link/stories/index.js +0 -23
  1380. package/src/form-toggle/index.js +0 -37
  1381. package/src/form-toggle/stories/index.js +0 -28
  1382. package/src/form-toggle/test/index.js +0 -75
  1383. package/src/form-token-field/index.js +0 -725
  1384. package/src/form-token-field/stories/index.js +0 -102
  1385. package/src/form-token-field/test/lib/token-field-wrapper.js +0 -56
  1386. package/src/form-token-field/token-input.js +0 -81
  1387. package/src/grid/stories/index.js +0 -49
  1388. package/src/h-stack/stories/index.js +0 -22
  1389. package/src/heading/test/index.js +0 -67
  1390. package/src/radio-control/index.js +0 -69
  1391. package/src/radio-control/stories/index.js +0 -41
  1392. package/src/range-control/stories/index.js +0 -180
  1393. package/src/range-control/test/index.js +0 -320
  1394. package/src/range-control/utils.js +0 -132
  1395. package/src/scrollable/test/index.js +0 -31
  1396. package/src/spacer/stories/index.js +0 -59
  1397. package/src/spacer/test/index.js +0 -146
  1398. package/src/spinner/stories/index.js +0 -43
  1399. package/src/text-highlight/index.js +0 -28
  1400. package/src/text-highlight/stories/index.js +0 -28
  1401. package/src/text-highlight/test/index.js +0 -120
  1402. package/src/tip/index.js +0 -24
  1403. package/src/tip/stories/index.js +0 -26
  1404. package/src/tree-select/index.js +0 -48
  1405. package/src/tree-select/stories/index.js +0 -80
  1406. package/src/truncate/stories/index.js +0 -38
  1407. package/src/visually-hidden/stories/index.js +0 -42
  1408. package/src/visually-hidden/test/index.js +0 -19
  1409. package/src/z-stack/stories/index.js +0 -70
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/box-control/axial-input-controls.js"],"names":["groupedSides","AxialInputControls","onChange","onFocus","onHoverOn","onHoverOff","values","selectedUnits","setSelectedUnits","sides","props","createHandleOnFocus","side","event","createHandleOnHoverOn","top","bottom","left","right","createHandleOnHoverOff","createHandleOnChange","next","nextValues","isNumeric","isNaN","parseFloat","nextValue","undefined","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","first","last","only","map","parsedQuantity","parsedUnit","selectedUnit","join","LABELS"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,MAAMA,YAAY,GAAG,CAAE,UAAF,EAAc,YAAd,CAArB;;AAEe,SAASC,kBAAT,OAUX;AAAA,MAVwC;AAC3CC,IAAAA,QAD2C;AAE3CC,IAAAA,OAF2C;AAG3CC,IAAAA,SAH2C;AAI3CC,IAAAA,UAJ2C;AAK3CC,IAAAA,MAL2C;AAM3CC,IAAAA,aAN2C;AAO3CC,IAAAA,gBAP2C;AAQ3CC,IAAAA,KAR2C;AAS3C,OAAGC;AATwC,GAUxC;;AACH,QAAMC,mBAAmB,GAAKC,IAAF,IAAcC,KAAF,IAAa;AACpD,QAAK,CAAEV,OAAP,EAAiB;AAChB;AACA;;AACDA,IAAAA,OAAO,CAAEU,KAAF,EAAS;AAAED,MAAAA;AAAF,KAAT,CAAP;AACA,GALD;;AAOA,QAAME,qBAAqB,GAAKF,IAAF,IAAY,MAAM;AAC/C,QAAK,CAAER,SAAP,EAAmB;AAClB;AACA;;AACD,QAAKQ,IAAI,KAAK,UAAd,EAA2B;AAC1BR,MAAAA,SAAS,CAAE;AACVW,QAAAA,GAAG,EAAE,IADK;AAEVC,QAAAA,MAAM,EAAE;AAFE,OAAF,CAAT;AAIA;;AACD,QAAKJ,IAAI,KAAK,YAAd,EAA6B;AAC5BR,MAAAA,SAAS,CA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AAA,MAAM,EAAGuB,IAAI,KAAKvB,IAHnB;AAIC,MAAA,MAAM,EAAGwB,IAAI,KAAKxB,IAJnB;AAKC,MAAA,KAAK,EAAG,CACP0B,cADO,EAEPE,YAFO,aAEPA,YAFO,cAEPA,YAFO,GAESD,UAFT,EAGNE,IAHM,CAGA,EAHA,CALT;AASC,MAAA,QAAQ,EAAGrB,oBAAoB,CAAER,IAAF,CAThC;AAUC,MAAA,YAAY,EAAGgB,wBAAwB,CAAEhB,IAAF,CAVxC;AAWC,MAAA,OAAO,EAAGD,mBAAmB,CAAEC,IAAF,CAX9B;AAYC,MAAA,SAAS,EAAGE,qBAAqB,CAAEF,IAAF,CAZlC;AAaC,MAAA,UAAU,EAAGO,sBAAsB,CAAEP,IAAF,CAbpC;AAcC,MAAA,KAAK,EAAG8B,eAAQ9B,IAAR,CAdT;AAeC,MAAA,GAAG,EAAGA;AAfP,OADD;AAmBA,GA9BC,CALH,CADD;AAuCA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport UnitControl from './unit-control';\nimport { LABELS } from './utils';\nimport { Layout } from './styles/box-control-styles';\n\nconst groupedSides = [ 'vertical', 'horizontal' ];\n\nexport default function AxialInputControls( {\n\tonChange,\n\tonFocus,\n\tonHoverOn,\n\tonHoverOff,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n} ) {\n\tconst createHandleOnFocus = ( side ) => ( event ) => {\n\t\tif ( ! onFocus ) {\n\t\t\treturn;\n\t\t}\n\t\tonFocus( event, { side } );\n\t};\n\n\tconst createHandleOnHoverOn = ( side ) => () => {\n\t\tif ( ! onHoverOn ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( side === 'vertical' ) {\n\t\t\tonHoverOn( {\n\t\t\t\ttop: true,\n\t\t\t\tbottom: true,\n\t\t\t} );\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tonHoverOn( {\n\t\t\t\tleft: true,\n\t\t\t\tright: true,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst createHandleOnHoverOff = ( side ) => () => {\n\t\tif ( ! onHoverOff ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( side === 'vertical' ) {\n\t\t\tonHoverOff( {\n\t\t\t\ttop: false,\n\t\t\t\tbottom: false,\n\t\t\t} );\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tonHoverOff( {\n\t\t\t\tleft: false,\n\t\t\t\tright: false,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst createHandleOnChange = ( side ) => ( next ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnextValues.top = nextValue;\n\t\t\tnextValues.bottom = nextValue;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnextValues.left = nextValue;\n\t\t\tnextValues.right = nextValue;\n\t\t}\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange = ( side ) => ( next ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnewUnits.top = next;\n\t\t\tnewUnits.bottom = next;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnewUnits.left = next;\n\t\t\tnewUnits.right = next;\n\t\t}\n\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? groupedSides.filter( ( side ) => sides.includes( side ) )\n\t\t: groupedSides;\n\n\tconst first = filteredSides[ 0 ];\n\tconst last = filteredSides[ filteredSides.length - 1 ];\n\tconst only = first === last;\n\n\treturn (\n\t\t<Layout\n\t\t\tgap={ 0 }\n\t\t\talign=\"top\"\n\t\t\tclassName=\"component-box-control__vertical-horizontal-input-controls\"\n\t\t>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [\n\t\t\t\t\tparsedQuantity,\n\t\t\t\t\tparsedUnit,\n\t\t\t\t] = parseQuantityAndUnitFromRawValue(\n\t\t\t\t\tside === 'vertical' ? values.top : values.left\n\t\t\t\t);\n\t\t\t\tconst selectedUnit =\n\t\t\t\t\tside === 'vertical'\n\t\t\t\t\t\t? selectedUnits.top\n\t\t\t\t\t\t: selectedUnits.left;\n\t\t\t\treturn (\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\tisFirst={ first === side }\n\t\t\t\t\t\tisLast={ last === side }\n\t\t\t\t\t\tisOnly={ only === side }\n\t\t\t\t\t\tvalue={ [\n\t\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t].join( '' ) }\n\t\t\t\t\t\tonChange={ createHandleOnChange( side ) }\n\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange( side ) }\n\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\tonHoverOn={ createHandleOnHoverOn( side ) }\n\t\t\t\t\t\tonHoverOff={ createHandleOnHoverOff( side ) }\n\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\tkey={ side }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Layout>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/box-control/axial-input-controls.js"],"names":["groupedSides","AxialInputControls","onChange","onFocus","onHoverOn","onHoverOff","values","selectedUnits","setSelectedUnits","sides","props","createHandleOnFocus","side","event","createHandleOnHoverOn","top","bottom","left","right","createHandleOnHoverOff","createHandleOnChange","next","nextValues","isNumeric","isNaN","parseFloat","nextValue","undefined","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","first","last","only","map","parsedQuantity","parsedUnit","selectedUnit","join","LAB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YC,MAAA,SAAS,EAAGE,qBAAqB,CAAEF,IAAF,CAZlC;AAaC,MAAA,UAAU,EAAGO,sBAAsB,CAAEP,IAAF,CAbpC;AAcC,MAAA,KAAK,EAAG8B,eAAQ9B,IAAR,CAdT;AAeC,MAAA,GAAG,EAAGA;AAfP,OADD;AAmBA,GA5BC,CALH,CADD;AAqCA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport UnitControl from './unit-control';\nimport { LABELS } from './utils';\nimport { Layout } from './styles/box-control-styles';\n\nconst groupedSides = [ 'vertical', 'horizontal' ];\n\nexport default function AxialInputControls( {\n\tonChange,\n\tonFocus,\n\tonHoverOn,\n\tonHoverOff,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n} ) {\n\tconst createHandleOnFocus = ( side ) => ( event ) => {\n\t\tif ( ! onFocus ) {\n\t\t\treturn;\n\t\t}\n\t\tonFocus( event, { side } );\n\t};\n\n\tconst createHandleOnHoverOn = ( side ) => () => {\n\t\tif ( ! onHoverOn ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( side === 'vertical' ) {\n\t\t\tonHoverOn( {\n\t\t\t\ttop: true,\n\t\t\t\tbottom: true,\n\t\t\t} );\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tonHoverOn( {\n\t\t\t\tleft: true,\n\t\t\t\tright: true,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst createHandleOnHoverOff = ( side ) => () => {\n\t\tif ( ! onHoverOff ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( side === 'vertical' ) {\n\t\t\tonHoverOff( {\n\t\t\t\ttop: false,\n\t\t\t\tbottom: false,\n\t\t\t} );\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tonHoverOff( {\n\t\t\t\tleft: false,\n\t\t\t\tright: false,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst createHandleOnChange = ( side ) => ( next ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnextValues.top = nextValue;\n\t\t\tnextValues.bottom = nextValue;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnextValues.left = nextValue;\n\t\t\tnextValues.right = nextValue;\n\t\t}\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange = ( side ) => ( next ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnewUnits.top = next;\n\t\t\tnewUnits.bottom = next;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnewUnits.left = next;\n\t\t\tnewUnits.right = next;\n\t\t}\n\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? groupedSides.filter( ( side ) => sides.includes( side ) )\n\t\t: groupedSides;\n\n\tconst first = filteredSides[ 0 ];\n\tconst last = filteredSides[ filteredSides.length - 1 ];\n\tconst only = first === last;\n\n\treturn (\n\t\t<Layout\n\t\t\tgap={ 0 }\n\t\t\talign=\"top\"\n\t\t\tclassName=\"component-box-control__vertical-horizontal-input-controls\"\n\t\t>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue(\n\t\t\t\t\t\tside === 'vertical' ? values.top : values.left\n\t\t\t\t\t);\n\t\t\t\tconst selectedUnit =\n\t\t\t\t\tside === 'vertical'\n\t\t\t\t\t\t? selectedUnits.top\n\t\t\t\t\t\t: selectedUnits.left;\n\t\t\t\treturn (\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\tisFirst={ first === side }\n\t\t\t\t\t\tisLast={ last === side }\n\t\t\t\t\t\tisOnly={ only === side }\n\t\t\t\t\t\tvalue={ [\n\t\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t].join( '' ) }\n\t\t\t\t\t\tonChange={ createHandleOnChange( side ) }\n\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange( side ) }\n\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\tonHoverOn={ createHandleOnHoverOn( side ) }\n\t\t\t\t\t\tonHoverOff={ createHandleOnHoverOff( side ) }\n\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\tkey={ side }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Layout>\n\t);\n}\n"]}
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
 
14
- var _lodash = require("lodash");
15
-
16
14
  var _compose = require("@wordpress/compose");
17
15
 
18
16
  var _i18n = require("@wordpress/i18n");
@@ -41,10 +39,6 @@ var _utils2 = require("./utils");
41
39
 
42
40
  var _hooks = require("../utils/hooks");
43
41
 
44
- /**
45
- * External dependencies
46
- */
47
-
48
42
  /**
49
43
  * WordPress dependencies
50
44
  */
@@ -56,6 +50,8 @@ const defaultInputProps = {
56
50
  min: 0
57
51
  };
58
52
 
53
+ const noop = () => {};
54
+
59
55
  function useUniqueId(idProp) {
60
56
  const instanceId = (0, _compose.useInstanceId)(BoxControl, 'inspector-box-control');
61
57
  return idProp || instanceId;
@@ -65,7 +61,7 @@ function BoxControl(_ref) {
65
61
  let {
66
62
  id: idProp,
67
63
  inputProps = defaultInputProps,
68
- onChange = _lodash.noop,
64
+ onChange = noop,
69
65
  label = (0, _i18n.__)('Box Control'),
70
66
  values: valuesProp,
71
67
  units,
@@ -132,7 +128,7 @@ function BoxControl(_ref) {
132
128
  };
133
129
  return (0, _element.createElement)(_boxControlStyles.Root, {
134
130
  id: id,
135
- role: "region",
131
+ role: "group",
136
132
  "aria-labelledby": headingId
137
133
  }, (0, _element.createElement)(_boxControlStyles.Header, {
138
134
  className: "component-box-control__header"
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/box-control/index.js"],"names":["defaultInputProps","min","useUniqueId","idProp","instanceId","BoxControl","id","inputProps","onChange","noop","label","values","valuesProp","units","sides","splitOnAxis","allowReset","resetValues","DEFAULT_VALUES","setValues","fallback","inputValues","hasInitialValue","hasOneSide","length","isDirty","setIsDirty","isLinked","setIsLinked","side","setSide","selectedUnits","setSelectedUnits","top","right","bottom","left","headingId","toggleLinked","handleOnFocus","event","nextSide","handleOnChange","nextValues","handleOnReset","inputControlProps","onFocus"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAMA;;AAnCA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAuBA,MAAMA,iBAAiB,GAAG;AACzBC,EAAAA,GAAG,EAAE;AADoB,CAA1B;;AAIA,SAASC,WAAT,CAAsBC,MAAtB,EAA+B;AAC9B,QAAMC,UAAU,GAAG,4BAAeC,UAAf,EAA2B,uBAA3B,CAAnB;AAEA,SAAOF,MAAM,IAAIC,UAAjB;AACA;;AACc,SAASC,UAAT,OAWX;AAAA,MAXgC;AACnCC,IAAAA,EAAE,EAAEH,MAD+B;AAEnCI,IAAAA,UAAU,GAAGP,iBAFsB;AAGnCQ,IAAAA,QAAQ,GAAGC,YAHwB;AAInCC,IAAAA,KAAK,GAAG,cAAI,aAAJ,CAJ2B;AAKnCC,IAAAA,MAAM,EAAEC,UAL2B;AAMnCC,IAAAA,KANmC;AAOnCC,IAAAA,KAPmC;AAQnCC,IAAAA,WAAW,GAAG,KARqB;AASnCC,IAAAA,UAAU,GAAG,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,cAAD,QACC,4BAAC,UAAD;AACC,IAAA,EAAE,EAAGA,SADN;AAEC,IAAA,SAAS,EAAC;AAFX,KAIG3B,KAJH,CADD,CADD,EASGM,UAAU,IACX,4BAAC,cAAD,QACC,4BAAC,eAAD;AACC,IAAA,SAAS,EAAC,qCADX;AAEC,IAAA,WAAW,MAFZ;AAGC,IAAA,OAAO,MAHR;AAIC,IAAA,OAAO,EAAG4B,aAJX;AAKC,IAAA,QAAQ,EAAG,CAAEnB;AALd,KAOG,cAAI,OAAJ,CAPH,CADD,CAVF,CADD,EAwBC,4BAAC,sCAAD;AAAsB,IAAA,SAAS,EAAC;AAAhC,KACC,4BAAC,cAAD,QACC,4BAAC,aAAD;AAAgB,IAAA,IAAI,EAAGI,IAAvB;AAA8B,IAAA,KAAK,EAAGf;AAAtC,IADD,CADD,EAIGa,QAAQ,IACT,4BAAC,eAAD,QACC,4BAAC,wBAAD;AACC,kBAAajB;AADd,KAEMmC,iBAFN,EADD,CALF,EAYG,CAAElB,QAAF,IAAcZ,WAAd,IACD,4BAAC,eAAD,QACC,4BAAC,2BAAD,EAAyB8B,iBAAzB,CADD,CAbF,EAiBG,CAAEtB,UAAF,IACD,4BAAC,cAAD,QACC,4BAAC,qBAAD;AACC,IAAA,OAAO,EAAGe,YADX;AAEC,IAAA,QAAQ,EAAGX;AAFZ,IADD,CAlBF,CAxBD,EAkDG,CAAEA,QAAF,IAAc,CAAEZ,WAAhB,IACD,4BAAC,sBAAD,EAAoB8B,iBAApB,CAnDF,CADD;AAwDA","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { FlexItem, FlexBlock } from '../flex';\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport AxialInputControls from './axial-input-controls';\nimport BoxControlIcon from './icon';\nimport { Text } from '../text';\nimport LinkedButton from './linked-button';\nimport {\n\tRoot,\n\tHeader,\n\tHeaderControlWrapper,\n} from './styles/box-control-styles';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport {\n\tDEFAULT_VALUES,\n\tgetInitialSide,\n\tisValuesMixed,\n\tisValuesDefined,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\n\nconst defaultInputProps = {\n\tmin: 0,\n};\n\nfunction useUniqueId( idProp ) {\n\tconst instanceId = useInstanceId( BoxControl, 'inspector-box-control' );\n\n\treturn idProp || instanceId;\n}\nexport default function BoxControl( {\n\tid: idProp,\n\tinputProps = defaultInputProps,\n\tonChange = noop,\n\tlabel = __( 'Box Control' ),\n\tvalues: valuesProp,\n\tunits,\n\tsides,\n\tsplitOnAxis = false,\n\tallowReset = true,\n\tresetValues = DEFAULT_VALUES,\n} ) {\n\tconst [ values, setValues ] = useControlledState( valuesProp, {\n\t\tfallback: DEFAULT_VALUES,\n\t} );\n\tconst inputValues = values || DEFAULT_VALUES;\n\tconst hasInitialValue = isValuesDefined( valuesProp );\n\tconst hasOneSide = sides?.length === 1;\n\n\tconst [ isDirty, setIsDirty ] = useState( hasInitialValue );\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasInitialValue || ! isValuesMixed( inputValues ) || hasOneSide\n\t);\n\n\tconst [ side, setSide ] = useState(\n\t\tgetInitialSide( isLinked, splitOnAxis )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState( {\n\t\ttop: parseQuantityAndUnitFromRawValue( valuesProp?.top )[ 1 ],\n\t\tright: parseQuantityAndUnitFromRawValue( valuesProp?.right )[ 1 ],\n\t\tbottom: parseQuantityAndUnitFromRawValue( valuesProp?.bottom )[ 1 ],\n\t\tleft: parseQuantityAndUnitFromRawValue( valuesProp?.left )[ 1 ],\n\t} );\n\n\tconst id = useUniqueId( idProp );\n\tconst headingId = `${ id }-heading`;\n\n\tconst toggleLinked = () => {\n\t\tsetIsLinked( ! isLinked );\n\t\tsetSide( getInitialSide( ! isLinked, splitOnAxis ) );\n\t};\n\n\tconst handleOnFocus = ( event, { side: nextSide } ) => {\n\t\tsetSide( nextSide );\n\t};\n\n\tconst handleOnChange = ( nextValues ) => {\n\t\tonChange( nextValues );\n\t\tsetValues( nextValues );\n\t\tsetIsDirty( true );\n\t};\n\n\tconst handleOnReset = () => {\n\t\tonChange( resetValues );\n\t\tsetValues( resetValues );\n\t\tsetSelectedUnits( resetValues );\n\t\tsetIsDirty( false );\n\t};\n\n\tconst inputControlProps = {\n\t\t...inputProps,\n\t\tonChange: handleOnChange,\n\t\tonFocus: handleOnFocus,\n\t\tisLinked,\n\t\tunits,\n\t\tselectedUnits,\n\t\tsetSelectedUnits,\n\t\tsides,\n\t\tvalues: inputValues,\n\t};\n\n\treturn (\n\t\t<Root id={ id } role=\"region\" aria-labelledby={ headingId }>\n\t\t\t<Header className=\"component-box-control__header\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tid={ headingId }\n\t\t\t\t\t\tclassName=\"component-box-control__label\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Text>\n\t\t\t\t</FlexItem>\n\t\t\t\t{ allowReset && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"component-box-control__reset-button\"\n\t\t\t\t\t\t\tisSecondary\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</Header>\n\t\t\t<HeaderControlWrapper className=\"component-box-control__header-control-wrapper\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<BoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t</FlexItem>\n\t\t\t\t{ isLinked && (\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<AllInputControl\n\t\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\t\t{ ...inputControlProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t) }\n\t\t\t\t{ ! isLinked && splitOnAxis && (\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<AxialInputControls { ...inputControlProps } />\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t) }\n\t\t\t\t{ ! hasOneSide && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<LinkedButton\n\t\t\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</HeaderControlWrapper>\n\t\t\t{ ! isLinked && ! splitOnAxis && (\n\t\t\t\t<InputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t</Root>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/box-control/index.js"],"names":["defaultInputProps","min","noop","useUniqueId","idProp","instanceId","BoxControl","id","inputProps","onChange","label","values","valuesProp","units","sides","splitOnAxis","allowReset","resetValues","DEFAULT_VALUES","setValues","fallback","inputValues","hasInitialValue","hasOneSide","length","isDirty","setIsDirty","isLinked","setIsLinked","side","setSide","selectedUnits","setSelectedUnits","top","right","bottom","left","headingId","toggleLinked","handleOnFocus","event","nextSide","handleOnChange","nextValues","handleOnReset","inputControlProps","onFocus"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAMA;;AA9BA;AACA;AACA;;AAKA;AACA;AACA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,WAAd,IACD,4BAAC,eAAD,QACC,4BAAC,2BAAD,EAAyB8B,iBAAzB,CADD,CAbF,EAiBG,CAAEtB,UAAF,IACD,4BAAC,cAAD,QACC,4BAAC,qBAAD;AACC,IAAA,OAAO,EAAGe,YADX;AAEC,IAAA,QAAQ,EAAGX;AAFZ,IADD,CAlBF,CAxBD,EAkDG,CAAEA,QAAF,IAAc,CAAEZ,WAAhB,IACD,4BAAC,sBAAD,EAAoB8B,iBAApB,CAnDF,CADD;AAwDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { FlexItem, FlexBlock } from '../flex';\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport AxialInputControls from './axial-input-controls';\nimport BoxControlIcon from './icon';\nimport { Text } from '../text';\nimport LinkedButton from './linked-button';\nimport {\n\tRoot,\n\tHeader,\n\tHeaderControlWrapper,\n} from './styles/box-control-styles';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport {\n\tDEFAULT_VALUES,\n\tgetInitialSide,\n\tisValuesMixed,\n\tisValuesDefined,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\n\nconst defaultInputProps = {\n\tmin: 0,\n};\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp ) {\n\tconst instanceId = useInstanceId( BoxControl, 'inspector-box-control' );\n\n\treturn idProp || instanceId;\n}\nexport default function BoxControl( {\n\tid: idProp,\n\tinputProps = defaultInputProps,\n\tonChange = noop,\n\tlabel = __( 'Box Control' ),\n\tvalues: valuesProp,\n\tunits,\n\tsides,\n\tsplitOnAxis = false,\n\tallowReset = true,\n\tresetValues = DEFAULT_VALUES,\n} ) {\n\tconst [ values, setValues ] = useControlledState( valuesProp, {\n\t\tfallback: DEFAULT_VALUES,\n\t} );\n\tconst inputValues = values || DEFAULT_VALUES;\n\tconst hasInitialValue = isValuesDefined( valuesProp );\n\tconst hasOneSide = sides?.length === 1;\n\n\tconst [ isDirty, setIsDirty ] = useState( hasInitialValue );\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasInitialValue || ! isValuesMixed( inputValues ) || hasOneSide\n\t);\n\n\tconst [ side, setSide ] = useState(\n\t\tgetInitialSide( isLinked, splitOnAxis )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState( {\n\t\ttop: parseQuantityAndUnitFromRawValue( valuesProp?.top )[ 1 ],\n\t\tright: parseQuantityAndUnitFromRawValue( valuesProp?.right )[ 1 ],\n\t\tbottom: parseQuantityAndUnitFromRawValue( valuesProp?.bottom )[ 1 ],\n\t\tleft: parseQuantityAndUnitFromRawValue( valuesProp?.left )[ 1 ],\n\t} );\n\n\tconst id = useUniqueId( idProp );\n\tconst headingId = `${ id }-heading`;\n\n\tconst toggleLinked = () => {\n\t\tsetIsLinked( ! isLinked );\n\t\tsetSide( getInitialSide( ! isLinked, splitOnAxis ) );\n\t};\n\n\tconst handleOnFocus = ( event, { side: nextSide } ) => {\n\t\tsetSide( nextSide );\n\t};\n\n\tconst handleOnChange = ( nextValues ) => {\n\t\tonChange( nextValues );\n\t\tsetValues( nextValues );\n\t\tsetIsDirty( true );\n\t};\n\n\tconst handleOnReset = () => {\n\t\tonChange( resetValues );\n\t\tsetValues( resetValues );\n\t\tsetSelectedUnits( resetValues );\n\t\tsetIsDirty( false );\n\t};\n\n\tconst inputControlProps = {\n\t\t...inputProps,\n\t\tonChange: handleOnChange,\n\t\tonFocus: handleOnFocus,\n\t\tisLinked,\n\t\tunits,\n\t\tselectedUnits,\n\t\tsetSelectedUnits,\n\t\tsides,\n\t\tvalues: inputValues,\n\t};\n\n\treturn (\n\t\t<Root id={ id } role=\"group\" aria-labelledby={ headingId }>\n\t\t\t<Header className=\"component-box-control__header\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tid={ headingId }\n\t\t\t\t\t\tclassName=\"component-box-control__label\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Text>\n\t\t\t\t</FlexItem>\n\t\t\t\t{ allowReset && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"component-box-control__reset-button\"\n\t\t\t\t\t\t\tisSecondary\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</Header>\n\t\t\t<HeaderControlWrapper className=\"component-box-control__header-control-wrapper\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<BoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t</FlexItem>\n\t\t\t\t{ isLinked && (\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<AllInputControl\n\t\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\t\t{ ...inputControlProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t) }\n\t\t\t\t{ ! isLinked && splitOnAxis && (\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<AxialInputControls { ...inputControlProps } />\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t) }\n\t\t\t\t{ ! hasOneSide && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<LinkedButton\n\t\t\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</HeaderControlWrapper>\n\t\t\t{ ! isLinked && ! splitOnAxis && (\n\t\t\t\t<InputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t</Root>\n\t);\n}\n"]}
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
 
14
- var _lodash = require("lodash");
15
-
16
14
  var _unitControl = _interopRequireDefault(require("./unit-control"));
17
15
 
18
16
  var _utils = require("../unit-control/utils");
@@ -21,19 +19,17 @@ var _utils2 = require("./utils");
21
19
 
22
20
  var _boxControlStyles = require("./styles/box-control-styles");
23
21
 
24
- /**
25
- * External dependencies
26
- */
27
-
28
22
  /**
29
23
  * Internal dependencies
30
24
  */
25
+ const noop = () => {};
26
+
31
27
  function BoxInputControls(_ref) {
32
28
  let {
33
- onChange = _lodash.noop,
34
- onFocus = _lodash.noop,
35
- onHoverOn = _lodash.noop,
36
- onHoverOff = _lodash.noop,
29
+ onChange = noop,
30
+ onFocus = noop,
31
+ onHoverOn = noop,
32
+ onHoverOff = noop,
37
33
  values,
38
34
  selectedUnits,
39
35
  setSelectedUnits,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/box-control/input-controls.js"],"names":["BoxInputControls","onChange","noop","onFocus","onHoverOn","onHoverOff","values","selectedUnits","setSelectedUnits","sides","props","createHandleOnFocus","side","event","createHandleOnHoverOn","createHandleOnHoverOff","handleOnChange","nextValues","createHandleOnChange","next","altKey","isNumeric","isNaN","parseFloat","nextValue","undefined","bottom","top","right","left","createHandleOnUnitChange","newUnits","filteredSides","length","ALL_SIDES","filter","includes","first","last","only","map","parsedQuantity","parsedUnit","computedUnit","join","LABELS"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMe,SAASA,gBAAT,OAUX;AAAA,MAVsC;AACzCC,IAAAA,QAAQ,GAAGC,YAD8B;AAEzCC,IAAAA,OAAO,GAAGD,YA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GAClB8B,UADkB,GAElBnC,aAAa,CAAEK,IAAF,CAFhB;AAIA,WACC,4BAAC,oBAAD,6BACMF,KADN;AAEC,MAAA,OAAO,EAAG2B,KAAK,KAAKzB,IAFrB;AAGC,MAAA,MAAM,EAAG0B,IAAI,KAAK1B,IAHnB;AAIC,MAAA,MAAM,EAAG2B,IAAI,KAAK3B,IAJnB;AAKC,MAAA,KAAK,EAAG,CAAE6B,cAAF,EAAkBE,YAAlB,EAAiCC,IAAjC,CACP,EADO,CALT;AAQC,MAAA,QAAQ,EAAG1B,oBAAoB,CAAEN,IAAF,CARhC;AASC,MAAA,YAAY,EAAGkB,wBAAwB,CAAElB,IAAF,CATxC;AAUC,MAAA,OAAO,EAAGD,mBAAmB,CAAEC,IAAF,CAV9B;AAWC,MAAA,SAAS,EAAGE,qBAAqB,CAAEF,IAAF,CAXlC;AAYC,MAAA,UAAU,EAAGG,sBAAsB,CAAEH,IAAF,CAZpC;AAaC,MAAA,KAAK,EAAGiC,eAAQjC,IAAR,CAbT;AAcC,MAAA,GAAG,EAAI,eAAeA,IAAM;AAd7B,OADD;AAkBA,GA5BC,CALH,CADD,CADD;AAuCA","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport UnitControl from './unit-control';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { ALL_SIDES, LABELS } from './utils';\nimport { LayoutContainer, Layout } from './styles/box-control-styles';\n\nexport default function BoxInputControls( {\n\tonChange = noop,\n\tonFocus = noop,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n} ) {\n\tconst createHandleOnFocus = ( side ) => ( event ) => {\n\t\tonFocus( event, { side } );\n\t};\n\n\tconst createHandleOnHoverOn = ( side ) => () => {\n\t\tonHoverOn( { [ side ]: true } );\n\t};\n\n\tconst createHandleOnHoverOff = ( side ) => () => {\n\t\tonHoverOff( { [ side ]: false } );\n\t};\n\n\tconst handleOnChange = ( nextValues ) => {\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnChange = ( side ) => ( next, { event } ) => {\n\t\tconst { altKey } = event;\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tnextValues[ side ] = nextValue;\n\n\t\t/**\n\t\t * Supports changing pair sides. For example, holding the ALT key\n\t\t * when changing the TOP will also update BOTTOM.\n\t\t */\n\t\tif ( altKey ) {\n\t\t\tswitch ( side ) {\n\t\t\t\tcase 'top':\n\t\t\t\t\tnextValues.bottom = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bottom':\n\t\t\t\t\tnextValues.top = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'left':\n\t\t\t\t\tnextValues.right = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'right':\n\t\t\t\t\tnextValues.left = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\thandleOnChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange = ( side ) => ( next ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\t\tnewUnits[ side ] = next;\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? ALL_SIDES.filter( ( side ) => sides.includes( side ) )\n\t\t: ALL_SIDES;\n\n\tconst first = filteredSides[ 0 ];\n\tconst last = filteredSides[ filteredSides.length - 1 ];\n\tconst only = first === last && first;\n\n\treturn (\n\t\t<LayoutContainer className=\"component-box-control__input-controls-wrapper\">\n\t\t\t<Layout\n\t\t\t\tgap={ 0 }\n\t\t\t\talign=\"top\"\n\t\t\t\tclassName=\"component-box-control__input-controls\"\n\t\t\t>\n\t\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\t\tconst [\n\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\tparsedUnit,\n\t\t\t\t\t] = parseQuantityAndUnitFromRawValue( values[ side ] );\n\n\t\t\t\t\tconst computedUnit = values[ side ]\n\t\t\t\t\t\t? parsedUnit\n\t\t\t\t\t\t: selectedUnits[ side ];\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\tisFirst={ first === side }\n\t\t\t\t\t\t\tisLast={ last === side }\n\t\t\t\t\t\t\tisOnly={ only === side }\n\t\t\t\t\t\t\tvalue={ [ parsedQuantity, computedUnit ].join(\n\t\t\t\t\t\t\t\t''\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonChange={ createHandleOnChange( side ) }\n\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange( side ) }\n\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\tonHoverOn={ createHandleOnHoverOn( side ) }\n\t\t\t\t\t\t\tonHoverOff={ createHandleOnHoverOff( side ) }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\tkey={ `box-control-${ side }` }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</Layout>\n\t\t</LayoutContainer>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/box-control/input-controls.js"],"names":["noop","BoxInputControls","onChange","onFocus","onHoverOn","onHoverOff","values","selectedUnits","setSelectedUnits","sides","props","createHandleOnFocus","side","event","createHandleOnHoverOn","createHandleOnHoverOff","handleOnChange","nextValues","createHandleOnChange","next","altKey","isNumeric","isNaN","parseFloat","nextValue","undefined","bottom","top","right","left","createHandleOnUnitChange","newUnits","filteredSides","length","ALL_SIDES","filter","includes","first","last","only","map","parsedQuantity","parsedUnit","computedUnit","join","LABELS"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,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;AAChC,UAAM,CAAE6B,cAAF,EAAkBC,UAAlB,IACL,6CAAkCpC,MAAM,CAAEM,IAAF,CAAxC,CADD;AAGA,UAAM+B,YAAY,GAAGrC,MAAM,CAAEM,IAAF,CAAN,GAClB8B,UADkB,GAElBnC,aAAa,CAAEK,IAAF,CAFhB;AAIA,WACC,4BAAC,oBAAD,6BACMF,KADN;AAEC,MAAA,OAAO,EAAG2B,KAAK,KAAKzB,IAFrB;AAGC,MAAA,MAAM,EAAG0B,IAAI,KAAK1B,IAHnB;AAIC,MAAA,MAAM,EAAG2B,IAAI,KAAK3B,IAJnB;AAKC,MAAA,KAAK,EAAG,CAAE6B,cAAF,EAAkBE,YAAlB,EAAiCC,IAAjC,CACP,EADO,CALT;AAQC,MAAA,QAAQ,EAAG1B,oBAAoB,CAAEN,IAAF,CARhC;AASC,MAAA,YAAY,EAAGkB,wBAAwB,CAAElB,IAAF,CATxC;AAUC,MAAA,OAAO,EAAGD,mBAAmB,CAAEC,IAAF,CAV9B;AAWC,MAAA,SAAS,EAAGE,qBAAqB,CAAEF,IAAF,CAXlC;AAYC,MAAA,UAAU,EAAGG,sBAAsB,CAAEH,IAAF,CAZpC;AAaC,MAAA,KAAK,EAAGiC,eAAQjC,IAAR,CAbT;AAcC,MAAA,GAAG,EAAI,eAAeA,IAAM;AAd7B,OADD;AAkBA,GA1BC,CALH,CADD,CADD;AAqCA","sourcesContent":["/**\n * Internal dependencies\n */\nimport UnitControl from './unit-control';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { ALL_SIDES, LABELS } from './utils';\nimport { LayoutContainer, Layout } from './styles/box-control-styles';\n\nconst noop = () => {};\n\nexport default function BoxInputControls( {\n\tonChange = noop,\n\tonFocus = noop,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n} ) {\n\tconst createHandleOnFocus = ( side ) => ( event ) => {\n\t\tonFocus( event, { side } );\n\t};\n\n\tconst createHandleOnHoverOn = ( side ) => () => {\n\t\tonHoverOn( { [ side ]: true } );\n\t};\n\n\tconst createHandleOnHoverOff = ( side ) => () => {\n\t\tonHoverOff( { [ side ]: false } );\n\t};\n\n\tconst handleOnChange = ( nextValues ) => {\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnChange =\n\t\t( side ) =>\n\t\t( next, { event } ) => {\n\t\t\tconst { altKey } = event;\n\t\t\tconst nextValues = { ...values };\n\t\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\t\tnextValues[ side ] = nextValue;\n\n\t\t\t/**\n\t\t\t * Supports changing pair sides. For example, holding the ALT key\n\t\t\t * when changing the TOP will also update BOTTOM.\n\t\t\t */\n\t\t\tif ( altKey ) {\n\t\t\t\tswitch ( side ) {\n\t\t\t\t\tcase 'top':\n\t\t\t\t\t\tnextValues.bottom = nextValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bottom':\n\t\t\t\t\t\tnextValues.top = nextValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'left':\n\t\t\t\t\t\tnextValues.right = nextValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'right':\n\t\t\t\t\t\tnextValues.left = nextValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\thandleOnChange( nextValues );\n\t\t};\n\n\tconst createHandleOnUnitChange = ( side ) => ( next ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\t\tnewUnits[ side ] = next;\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? ALL_SIDES.filter( ( side ) => sides.includes( side ) )\n\t\t: ALL_SIDES;\n\n\tconst first = filteredSides[ 0 ];\n\tconst last = filteredSides[ filteredSides.length - 1 ];\n\tconst only = first === last && first;\n\n\treturn (\n\t\t<LayoutContainer className=\"component-box-control__input-controls-wrapper\">\n\t\t\t<Layout\n\t\t\t\tgap={ 0 }\n\t\t\t\talign=\"top\"\n\t\t\t\tclassName=\"component-box-control__input-controls\"\n\t\t\t>\n\t\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\t\tparseQuantityAndUnitFromRawValue( values[ side ] );\n\n\t\t\t\t\tconst computedUnit = values[ side ]\n\t\t\t\t\t\t? parsedUnit\n\t\t\t\t\t\t: selectedUnits[ side ];\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\tisFirst={ first === side }\n\t\t\t\t\t\t\tisLast={ last === side }\n\t\t\t\t\t\t\tisOnly={ only === side }\n\t\t\t\t\t\t\tvalue={ [ parsedQuantity, computedUnit ].join(\n\t\t\t\t\t\t\t\t''\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonChange={ createHandleOnChange( side ) }\n\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange( side ) }\n\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\tonHoverOn={ createHandleOnHoverOn( side ) }\n\t\t\t\t\t\t\tonHoverOff={ createHandleOnHoverOff( side ) }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\tkey={ `box-control-${ side }` }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</Layout>\n\t\t</LayoutContainer>\n\t);\n}\n"]}
@@ -11,8 +11,6 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
 
14
- var _lodash = require("lodash");
15
-
16
14
  var _react = require("@use-gesture/react");
17
15
 
18
16
  var _tooltip = _interopRequireDefault(require("../tooltip"));
@@ -26,13 +24,15 @@ var _boxControlStyles = require("./styles/box-control-styles");
26
24
  /**
27
25
  * Internal dependencies
28
26
  */
27
+ const noop = () => {};
28
+
29
29
  function BoxUnitControl(_ref) {
30
30
  let {
31
31
  isFirst,
32
32
  isLast,
33
33
  isOnly,
34
- onHoverOn = _lodash.noop,
35
- onHoverOff = _lodash.noop,
34
+ onHoverOn = noop,
35
+ onHoverOff = noop,
36
36
  label,
37
37
  value,
38
38
  ...props
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/box-control/unit-control.js"],"names":["BoxUnitControl","isFirst","isLast","isOnly","onHoverOn","noop","onHoverOff","label","value","props","bindHoverGesture","event","state","hovering","Tooltip","children","text"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAVA;AACA;AACA;;AAIA;AACA;AACA;AAIe,SAASA,cAAT,OASX;AAAA,MAToC;AACvCC,IAAAA,OADuC;AAEvCC,IAAAA,MAFuC;AAGvCC,IAAAA,MAHuC;AAIvCC,IAAAA,SAAS,GAAGC,YAJ2B;AAKvCC,IAAAA,UAAU,GAAGD,YAL0B;AAMvCE,IAAAA,KANuC;AAOvCC,IAAAA,KAPuC;AAQvC,OAAGC;AARoC,GASpC;AACH,QAAMC,gBAAgB,GAAG,qBAAU,SAA2B;AAAA,QAAzB;AAAEC,MAAAA,KAAF;AAAS,SAAGC;AAAZ,KAAyB;;AAC7D,QAAKA,KAAK,CAACC,QAAX,EAAsB;AACrBT,MAAAA,SAAS,CAAEO,KAAF,EAASC,KAAT,CAAT;AACA,KAFD,MAEO;AACNN,MAAAA,UAAU,CAAEK,KAAF,EAASC,KAAT,CAAV;AACA;AACD,GANwB,CAAzB;AAQA,SACC,4BAAC,oCAAD,EAAyBF,gBAAgB,EAAzC,EACC,4BAAC,OAAD;AAAS,IAAA,IAAI,EAAGH;AAAhB,KACC,4BAAC,6BAAD;AACC,kBAAaA,KADd;AAEC,IAAA,SAAS,EAAC,qCAFX;AAGC,IAAA,cAAc,MAHf;AAIC,IAAA,OAAO,EAAGN,OAJX;AAKC,IAAA,MAAM,EAAGC,MALV;AAMC,IAAA,MAAM,EAAGC,MANV;AAOC,IAAA,oBAAoB,MAPrB;AAQC,IAAA,wBAAwB,EAAG,KAR5B;AASC,IAAA,KAAK,EAAGK;AATT,KAUMC,KAVN,EADD,CADD,CADD;AAkBA;;AAED,SAASK,OAAT,QAAuC;AAAA,MAArB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAqB;AACtC,MAAK,CAAEA,IAAP,EAAc,OAAOD,QAAP;AAEd;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AACC,SACC,4BAAC,gBAAD;AAAa,IAAA,IAAI,EAAGC,IAApB;AAA2B,IAAA,QAAQ,EAAC;AAApC,KACC,yCAAOD,QAAP,CADD,CADD;AAKA","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\nimport { useHover } from '@use-gesture/react';\n\n/**\n * Internal dependencies\n */\nimport BaseTooltip from '../tooltip';\nimport { UnitControlWrapper, UnitControl } from './styles/box-control-styles';\n\nexport default function BoxUnitControl( {\n\tisFirst,\n\tisLast,\n\tisOnly,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tlabel,\n\tvalue,\n\t...props\n} ) {\n\tconst bindHoverGesture = useHover( ( { event, ...state } ) => {\n\t\tif ( state.hovering ) {\n\t\t\tonHoverOn( event, state );\n\t\t} else {\n\t\t\tonHoverOff( event, state );\n\t\t}\n\t} );\n\n\treturn (\n\t\t<UnitControlWrapper { ...bindHoverGesture() }>\n\t\t\t<Tooltip text={ label }>\n\t\t\t\t<UnitControl\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\thideHTMLArrows\n\t\t\t\t\tisFirst={ isFirst }\n\t\t\t\t\tisLast={ isLast }\n\t\t\t\t\tisOnly={ isOnly }\n\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\tisResetValueOnUnitChange={ false }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t</UnitControlWrapper>\n\t);\n}\n\nfunction Tooltip( { children, text } ) {\n\tif ( ! text ) return children;\n\n\t/**\n\t * Wrapping the children in a `<div />` as Tooltip as it attempts\n\t * to render the <UnitControl />. Using a plain `<div />` appears to\n\t * resolve this issue.\n\t *\n\t * Originally discovered and referenced here:\n\t * https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026\n\t */\n\treturn (\n\t\t<BaseTooltip text={ text } position=\"top\">\n\t\t\t<div>{ children }</div>\n\t\t</BaseTooltip>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/box-control/unit-control.js"],"names":["noop","BoxUnitControl","isFirst","isLast","isOnly","onHoverOn","onHoverOff","label","value","props","bindHoverGesture","event","state","hovering","Tooltip","children","text"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEe,SAASC,cAAT,OASX;AAAA,MAToC;AACvCC,IAAAA,OADuC;AAEvCC,IAAAA,MAFuC;AAGvCC,IAAAA,MAHuC;AAIvCC,IAAAA,SAAS,GAAGL,IAJ2B;AAKvCM,IAAAA,UAAU,GAAGN,IAL0B;AAMvCO,IAAAA,KANuC;AAOvCC,IAAAA,KAPuC;AAQvC,OAAGC;AARoC,GASpC;AACH,QAAMC,gBAAgB,GAAG,qBAAU,SAA2B;AAAA,QAAzB;AAAEC,MAAAA,KAAF;AAAS,SAAGC;AAAZ,KAAyB;;AAC7D,QAAKA,KAAK,CAACC,QAAX,EAAsB;AACrBR,MAAAA,SAAS,CAAEM,KAAF,EAASC,KAAT,CAAT;AACA,KAFD,MAEO;AACNN,MAAAA,UAAU,CAAEK,KAAF,EAASC,KAAT,CAAV;AACA;AACD,GANwB,CAAzB;AAQA,SACC,4BAAC,oCAAD,EAAyBF,gBAAgB,EAAzC,EACC,4BAAC,OAAD;AAAS,IAAA,IAAI,EAAGH;AAAhB,KACC,4BAAC,6BAAD;AACC,kBAAaA,KADd;AAEC,IAAA,SAAS,EAAC,qCAFX;AAGC,IAAA,cAAc,MAHf;AAIC,IAAA,OAAO,EAAGL,OAJX;AAKC,IAAA,MAAM,EAAGC,MALV;AAMC,IAAA,MAAM,EAAGC,MANV;AAOC,IAAA,oBAAoB,MAPrB;AAQC,IAAA,wBAAwB,EAAG,KAR5B;AASC,IAAA,KAAK,EAAGI;AATT,KAUMC,KAVN,EADD,CADD,CADD;AAkBA;;AAED,SAASK,OAAT,QAAuC;AAAA,MAArB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAqB;AACtC,MAAK,CAAEA,IAAP,EAAc,OAAOD,QAAP;AAEd;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AACC,SACC,4BAAC,gBAAD;AAAa,IAAA,IAAI,EAAGC,IAApB;AAA2B,IAAA,QAAQ,EAAC;AAApC,KACC,yCAAOD,QAAP,CADD,CADD;AAKA","sourcesContent":["/**\n * External dependencies\n */\nimport { useHover } from '@use-gesture/react';\n\n/**\n * Internal dependencies\n */\nimport BaseTooltip from '../tooltip';\nimport { UnitControlWrapper, UnitControl } from './styles/box-control-styles';\n\nconst noop = () => {};\n\nexport default function BoxUnitControl( {\n\tisFirst,\n\tisLast,\n\tisOnly,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tlabel,\n\tvalue,\n\t...props\n} ) {\n\tconst bindHoverGesture = useHover( ( { event, ...state } ) => {\n\t\tif ( state.hovering ) {\n\t\t\tonHoverOn( event, state );\n\t\t} else {\n\t\t\tonHoverOff( event, state );\n\t\t}\n\t} );\n\n\treturn (\n\t\t<UnitControlWrapper { ...bindHoverGesture() }>\n\t\t\t<Tooltip text={ label }>\n\t\t\t\t<UnitControl\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\thideHTMLArrows\n\t\t\t\t\tisFirst={ isFirst }\n\t\t\t\t\tisLast={ isLast }\n\t\t\t\t\tisOnly={ isOnly }\n\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\tisResetValueOnUnitChange={ false }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t</UnitControlWrapper>\n\t);\n}\n\nfunction Tooltip( { children, text } ) {\n\tif ( ! text ) return children;\n\n\t/**\n\t * Wrapping the children in a `<div />` as Tooltip as it attempts\n\t * to render the <UnitControl />. Using a plain `<div />` appears to\n\t * resolve this issue.\n\t *\n\t * Originally discovered and referenced here:\n\t * https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026\n\t */\n\treturn (\n\t\t<BaseTooltip text={ text } position=\"top\">\n\t\t\t<div>{ children }</div>\n\t\t</BaseTooltip>\n\t);\n}\n"]}
@@ -85,18 +85,18 @@ function getAllValue() {
85
85
  const allParsedUnits = parsedQuantitiesAndUnits.map(value => value[1]);
86
86
  const commonQuantity = allParsedQuantities.every(v => v === allParsedQuantities[0]) ? allParsedQuantities[0] : '';
87
87
  /**
88
- * The isNumber check is important. On reset actions, the incoming value
88
+ * The typeof === 'number' check is important. On reset actions, the incoming value
89
89
  * may be null or an empty string.
90
90
  *
91
91
  * Also, the value may also be zero (0), which is considered a valid unit value.
92
92
  *
93
- * isNumber() is more specific for these cases, rather than relying on a
93
+ * typeof === 'number' is more specific for these cases, rather than relying on a
94
94
  * simple truthy check.
95
95
  */
96
96
 
97
97
  let commonUnit;
98
98
 
99
- if ((0, _lodash.isNumber)(commonQuantity)) {
99
+ if (typeof commonQuantity === 'number') {
100
100
  commonUnit = mode(allParsedUnits);
101
101
  } else {
102
102
  var _getAllUnitFallback;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/box-control/utils.js"],"names":["LABELS","all","top","bottom","left","right","mixed","vertical","horizontal","DEFAULT_VALUES","undefined","ALL_SIDES","mode","arr","sort","a","b","filter","v","length","pop","getAllValue","values","selectedUnits","availableSides","sides","normalizeSides","parsedQuantitiesAndUnits","map","side","allParsedQuantities","value","allParsedUnits","commonQuantity","every","commonUnit","getAllUnitFallback","join","filteredUnits","Object","Boolean","isValuesMixed","allValue","isMixed","isNaN","parseFloat","isValuesDefined","test","getInitialSide","isLinked","splitOnAxis","initialSide","filteredSides","includes","push","newSides"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGO,MAAMA,MAAM,GAAG;AACrBC,EAAAA,GAAG,EAAE,cAAI,KAAJ,CADgB;AAErBC,EAAAA,GAAG,EAAE,cAAI,KAAJ,CAFgB;AAGrBC,EAAAA,MAAM,EAAE,cAAI,QAAJ,CAHa;AAIrBC,EAAAA,IAAI,EAAE,cAAI,MAAJ,CAJe;AAKrBC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CALc;AAMrBC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CANc;AAOrBC,EAAAA,QAAQ,EAAE,cAAI,UAAJ,CAPW;AAQrBC,EAAAA,UAAU,EAAE,cAAI,YAAJ;AARS,CAAf;;AAWA,MAAMC,cAAc,GAAG;AAC7BP,EAAAA,GAAG,EAAEQ,SADwB;AAE7BL,EAAAA,KAAK,EAAEK,SAFsB;AAG7BP,EAAAA,MAAM,EAAEO,SAHqB;AAI7BN,EAAAA,IAAI,EAAEM;AAJuB,CAAvB;;AAOA,MAAMC,SAAS,GAAG,CAAE,KAAF,EAAS,OAAT,EAAkB,QAAlB,EAA4B,MAA5B,CAAlB;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACA,SAASC,IAAT,CAAeC,GAAf,EAAqB;AACpB,SAAOA,GAAG,CACRC,IADK,CAEL,CAAEC,CAAF,EAAKC,CAAL,KACCH,GAAG,CAACI,MAAJ,CAAcC,CAAF,IAASA,CAAC,KAAKH,CAA3B,EAA+BI,MAA/B,GACAN,GAAG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D,KAAzB,EAAiC;AACvC,QAAM2B,aAAa,GAAG,EAAtB;;AAEA,MAAK,EAAE3B,KAAF,aAAEA,KAAF,eAAEA,KAAK,CAAEN,MAAT,CAAL,EAAuB;AACtB,WAAOR,SAAP;AACA;;AAED,MAAKc,KAAK,CAAC4B,QAAN,CAAgB,UAAhB,CAAL,EAAoC;AACnCD,IAAAA,aAAa,CAACE,IAAd,CAAoB,GAAG,CAAE,KAAF,EAAS,QAAT,CAAvB;AACA,GAFD,MAEO,IAAK7B,KAAK,CAAC4B,QAAN,CAAgB,YAAhB,CAAL,EAAsC;AAC5CD,IAAAA,aAAa,CAACE,IAAd,CAAoB,GAAG,CAAE,MAAF,EAAU,OAAV,CAAvB;AACA,GAFM,MAEA;AACN,UAAMC,QAAQ,GAAG5C,SAAS,CAACM,MAAV,CAAoBY,IAAF,IAAYJ,KAAK,CAAC4B,QAAN,CAAgBxB,IAAhB,CAA9B,CAAjB;AACAuB,IAAAA,aAAa,CAACE,IAAd,CAAoB,GAAGC,QAAvB;AACA;;AAED,SAAOH,aAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty, isNumber } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\n\nexport const LABELS = {\n\tall: __( 'All' ),\n\ttop: __( 'Top' ),\n\tbottom: __( 'Bottom' ),\n\tleft: __( 'Left' ),\n\tright: __( 'Right' ),\n\tmixed: __( 'Mixed' ),\n\tvertical: __( 'Vertical' ),\n\thorizontal: __( 'Horizontal' ),\n};\n\nexport const DEFAULT_VALUES = {\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\n\n/**\n * Gets an items with the most occurrence within an array\n * https://stackoverflow.com/a/20762713\n *\n * @param {Array<any>} arr Array of items to check.\n * @return {any} The item with the most occurrences.\n */\nfunction mode( arr ) {\n\treturn arr\n\t\t.sort(\n\t\t\t( a, b ) =>\n\t\t\t\tarr.filter( ( v ) => v === a ).length -\n\t\t\t\tarr.filter( ( v ) => v === b ).length\n\t\t)\n\t\t.pop();\n}\n\n/**\n * Gets the 'all' input value and unit from values data.\n *\n * @param {Object} values Box values.\n * @param {Object} selectedUnits Box units.\n * @param {Array} availableSides Available box sides to evaluate.\n *\n * @return {string} A value + unit for the 'all' input.\n */\nexport function getAllValue(\n\tvalues = {},\n\tselectedUnits,\n\tavailableSides = ALL_SIDES\n) {\n\tconst sides = normalizeSides( availableSides );\n\tconst parsedQuantitiesAndUnits = sides.map( ( side ) =>\n\t\tparseQuantityAndUnitFromRawValue( values[ side ] )\n\t);\n\tconst allParsedQuantities = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 0 ] ?? ''\n\t);\n\tconst allParsedUnits = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 1 ]\n\t);\n\n\tconst commonQuantity = allParsedQuantities.every(\n\t\t( v ) => v === allParsedQuantities[ 0 ]\n\t)\n\t\t? allParsedQuantities[ 0 ]\n\t\t: '';\n\n\t/**\n\t * The isNumber check is important. On reset actions, the incoming value\n\t * may be null or an empty string.\n\t *\n\t * Also, the value may also be zero (0), which is considered a valid unit value.\n\t *\n\t * isNumber() is more specific for these cases, rather than relying on a\n\t * simple truthy check.\n\t */\n\tlet commonUnit;\n\tif ( isNumber( commonQuantity ) ) {\n\t\tcommonUnit = mode( allParsedUnits );\n\t} else {\n\t\t// Set meaningful unit selection if no commonQuantity and user has previously\n\t\t// selected units without assigning values while controls were unlinked.\n\t\tcommonUnit =\n\t\t\tgetAllUnitFallback( selectedUnits ) ?? mode( allParsedUnits );\n\t}\n\n\treturn [ commonQuantity, commonUnit ].join( '' );\n}\n\n/**\n * Determine the most common unit selection to use as a fallback option.\n *\n * @param {Object} selectedUnits Current unit selections for individual sides.\n * @return {string} Most common unit selection.\n */\nexport function getAllUnitFallback( selectedUnits ) {\n\tif ( ! selectedUnits || typeof selectedUnits !== 'object' ) {\n\t\treturn undefined;\n\t}\n\n\tconst filteredUnits = Object.values( selectedUnits ).filter( Boolean );\n\n\treturn mode( filteredUnits );\n}\n\n/**\n * Checks to determine if values are mixed.\n *\n * @param {Object} values Box values.\n * @param {Object} selectedUnits Box units.\n * @param {Array} sides Available box sides to evaluate.\n *\n * @return {boolean} Whether values are mixed.\n */\nexport function isValuesMixed( values = {}, selectedUnits, sides = ALL_SIDES ) {\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst isMixed = isNaN( parseFloat( allValue ) );\n\n\treturn isMixed;\n}\n\n/**\n * Checks to determine if values are defined.\n *\n * @param {Object} values Box values.\n *\n * @return {boolean} Whether values are mixed.\n */\nexport function isValuesDefined( values ) {\n\treturn (\n\t\tvalues !== undefined &&\n\t\t! isEmpty(\n\t\t\tObject.values( values ).filter(\n\t\t\t\t// Switching units when input is empty causes values only\n\t\t\t\t// containing units. This gives false positive on mixed values\n\t\t\t\t// unless filtered.\n\t\t\t\t( value ) => !! value && /\\d/.test( value )\n\t\t\t)\n\t\t)\n\t);\n}\n\n/**\n * Get initial selected side, factoring in whether the sides are linked,\n * and whether the vertical / horizontal directions are grouped via splitOnAxis.\n *\n * @param {boolean} isLinked Whether the box control's fields are linked.\n * @param {boolean} splitOnAxis Whether splitting by horizontal or vertical axis.\n * @return {string} The initial side.\n */\nexport function getInitialSide( isLinked, splitOnAxis ) {\n\tlet initialSide = 'all';\n\n\tif ( ! isLinked ) {\n\t\tinitialSide = splitOnAxis ? 'vertical' : 'top';\n\t}\n\n\treturn initialSide;\n}\n\n/**\n * Normalizes provided sides configuration to an array containing only top,\n * right, bottom and left. This essentially just maps `horizontal` or `vertical`\n * to their appropriate sides to facilitate correctly determining value for\n * all input control.\n *\n * @param {Array} sides Available sides for box control.\n * @return {Array} Normalized sides configuration.\n */\nexport function normalizeSides( sides ) {\n\tconst filteredSides = [];\n\n\tif ( ! sides?.length ) {\n\t\treturn ALL_SIDES;\n\t}\n\n\tif ( sides.includes( 'vertical' ) ) {\n\t\tfilteredSides.push( ...[ 'top', 'bottom' ] );\n\t} else if ( sides.includes( 'horizontal' ) ) {\n\t\tfilteredSides.push( ...[ 'left', 'right' ] );\n\t} else {\n\t\tconst newSides = ALL_SIDES.filter( ( side ) => sides.includes( side ) );\n\t\tfilteredSides.push( ...newSides );\n\t}\n\n\treturn filteredSides;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/box-control/utils.js"],"names":["LABELS","all","top","bottom","left","right","mixed","vertical","horizontal","DEFAULT_VALUES","undefined","ALL_SIDES","mode","arr","sort","a","b","filter","v","length","pop","getAllValue","values","selectedUnits","availableSides","sides","normalizeSides","parsedQuantitiesAndUnits","map","side","allParsedQuantities","value","allParsedUnits","commonQuantity","every","commonUnit","getAllUnitFallback","join","filteredUnits","Object","Boolean","isValuesMixed","allValue","isMixed","isNaN","parseFloat","isValuesDefined","test","getInitialSide","isLinked","splitOnAxis","initialSide","filteredSides","includes","push","newSides"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGO,MAAMA,MAAM,GAAG;AACrBC,EAAAA,GAAG,EAAE,cAAI,KAAJ,CADgB;AAErBC,EAAAA,GAAG,EAAE,cAAI,KAAJ,CAFgB;AAGrBC,EAAAA,MAAM,EAAE,cAAI,QAAJ,CAHa;AAIrBC,EAAAA,IAAI,EAAE,cAAI,MAAJ,CAJe;AAKrBC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CALc;AAMrBC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CANc;AAOrBC,EAAAA,QAAQ,EAAE,cAAI,UAAJ,CAPW;AAQrBC,EAAAA,UAAU,EAAE,cAAI,YAAJ;AARS,CAAf;;AAWA,MAAMC,cAAc,GAAG;AAC7BP,EAAAA,GAAG,EAAEQ,SADwB;AAE7BL,EAAA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ACEc,EAAAA,KAAF,IAAa,CAAC,CAAEA,KAAH,IAAY,KAAKgB,IAAL,CAAWhB,KAAX,CAJ1B,CADC,CAFH;AAWA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASiB,cAAT,CAAyBC,QAAzB,EAAmCC,WAAnC,EAAiD;AACvD,MAAIC,WAAW,GAAG,KAAlB;;AAEA,MAAK,CAAEF,QAAP,EAAkB;AACjBE,IAAAA,WAAW,GAAGD,WAAW,GAAG,UAAH,GAAgB,KAAzC;AACA;;AAED,SAAOC,WAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASzB,cAAT,CAAyBD,KAAzB,EAAiC;AACvC,QAAM2B,aAAa,GAAG,EAAtB;;AAEA,MAAK,EAAE3B,KAAF,aAAEA,KAAF,eAAEA,KAAK,CAAEN,MAAT,CAAL,EAAuB;AACtB,WAAOR,SAAP;AACA;;AAED,MAAKc,KAAK,CAAC4B,QAAN,CAAgB,UAAhB,CAAL,EAAoC;AACnCD,IAAAA,aAAa,CAACE,IAAd,CAAoB,GAAG,CAAE,KAAF,EAAS,QAAT,CAAvB;AACA,GAFD,MAEO,IAAK7B,KAAK,CAAC4B,QAAN,CAAgB,YAAhB,CAAL,EAAsC;AAC5CD,IAAAA,aAAa,CAACE,IAAd,CAAoB,GAAG,CAAE,MAAF,EAAU,OAAV,CAAvB;AACA,GAFM,MAEA;AACN,UAAMC,QAAQ,GAAG5C,SAAS,CAACM,MAAV,CAAoBY,IAAF,IAAYJ,KAAK,CAAC4B,QAAN,CAAgBxB,IAAhB,CAA9B,CAAjB;AACAuB,IAAAA,aAAa,CAACE,IAAd,CAAoB,GAAGC,QAAvB;AACA;;AAED,SAAOH,aAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\n\nexport const LABELS = {\n\tall: __( 'All' ),\n\ttop: __( 'Top' ),\n\tbottom: __( 'Bottom' ),\n\tleft: __( 'Left' ),\n\tright: __( 'Right' ),\n\tmixed: __( 'Mixed' ),\n\tvertical: __( 'Vertical' ),\n\thorizontal: __( 'Horizontal' ),\n};\n\nexport const DEFAULT_VALUES = {\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\n\n/**\n * Gets an items with the most occurrence within an array\n * https://stackoverflow.com/a/20762713\n *\n * @param {Array<any>} arr Array of items to check.\n * @return {any} The item with the most occurrences.\n */\nfunction mode( arr ) {\n\treturn arr\n\t\t.sort(\n\t\t\t( a, b ) =>\n\t\t\t\tarr.filter( ( v ) => v === a ).length -\n\t\t\t\tarr.filter( ( v ) => v === b ).length\n\t\t)\n\t\t.pop();\n}\n\n/**\n * Gets the 'all' input value and unit from values data.\n *\n * @param {Object} values Box values.\n * @param {Object} selectedUnits Box units.\n * @param {Array} availableSides Available box sides to evaluate.\n *\n * @return {string} A value + unit for the 'all' input.\n */\nexport function getAllValue(\n\tvalues = {},\n\tselectedUnits,\n\tavailableSides = ALL_SIDES\n) {\n\tconst sides = normalizeSides( availableSides );\n\tconst parsedQuantitiesAndUnits = sides.map( ( side ) =>\n\t\tparseQuantityAndUnitFromRawValue( values[ side ] )\n\t);\n\tconst allParsedQuantities = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 0 ] ?? ''\n\t);\n\tconst allParsedUnits = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 1 ]\n\t);\n\n\tconst commonQuantity = allParsedQuantities.every(\n\t\t( v ) => v === allParsedQuantities[ 0 ]\n\t)\n\t\t? allParsedQuantities[ 0 ]\n\t\t: '';\n\n\t/**\n\t * The typeof === 'number' check is important. On reset actions, the incoming value\n\t * may be null or an empty string.\n\t *\n\t * Also, the value may also be zero (0), which is considered a valid unit value.\n\t *\n\t * typeof === 'number' is more specific for these cases, rather than relying on a\n\t * simple truthy check.\n\t */\n\tlet commonUnit;\n\tif ( typeof commonQuantity === 'number' ) {\n\t\tcommonUnit = mode( allParsedUnits );\n\t} else {\n\t\t// Set meaningful unit selection if no commonQuantity and user has previously\n\t\t// selected units without assigning values while controls were unlinked.\n\t\tcommonUnit =\n\t\t\tgetAllUnitFallback( selectedUnits ) ?? mode( allParsedUnits );\n\t}\n\n\treturn [ commonQuantity, commonUnit ].join( '' );\n}\n\n/**\n * Determine the most common unit selection to use as a fallback option.\n *\n * @param {Object} selectedUnits Current unit selections for individual sides.\n * @return {string} Most common unit selection.\n */\nexport function getAllUnitFallback( selectedUnits ) {\n\tif ( ! selectedUnits || typeof selectedUnits !== 'object' ) {\n\t\treturn undefined;\n\t}\n\n\tconst filteredUnits = Object.values( selectedUnits ).filter( Boolean );\n\n\treturn mode( filteredUnits );\n}\n\n/**\n * Checks to determine if values are mixed.\n *\n * @param {Object} values Box values.\n * @param {Object} selectedUnits Box units.\n * @param {Array} sides Available box sides to evaluate.\n *\n * @return {boolean} Whether values are mixed.\n */\nexport function isValuesMixed( values = {}, selectedUnits, sides = ALL_SIDES ) {\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst isMixed = isNaN( parseFloat( allValue ) );\n\n\treturn isMixed;\n}\n\n/**\n * Checks to determine if values are defined.\n *\n * @param {Object} values Box values.\n *\n * @return {boolean} Whether values are mixed.\n */\nexport function isValuesDefined( values ) {\n\treturn (\n\t\tvalues !== undefined &&\n\t\t! isEmpty(\n\t\t\tObject.values( values ).filter(\n\t\t\t\t// Switching units when input is empty causes values only\n\t\t\t\t// containing units. This gives false positive on mixed values\n\t\t\t\t// unless filtered.\n\t\t\t\t( value ) => !! value && /\\d/.test( value )\n\t\t\t)\n\t\t)\n\t);\n}\n\n/**\n * Get initial selected side, factoring in whether the sides are linked,\n * and whether the vertical / horizontal directions are grouped via splitOnAxis.\n *\n * @param {boolean} isLinked Whether the box control's fields are linked.\n * @param {boolean} splitOnAxis Whether splitting by horizontal or vertical axis.\n * @return {string} The initial side.\n */\nexport function getInitialSide( isLinked, splitOnAxis ) {\n\tlet initialSide = 'all';\n\n\tif ( ! isLinked ) {\n\t\tinitialSide = splitOnAxis ? 'vertical' : 'top';\n\t}\n\n\treturn initialSide;\n}\n\n/**\n * Normalizes provided sides configuration to an array containing only top,\n * right, bottom and left. This essentially just maps `horizontal` or `vertical`\n * to their appropriate sides to facilitate correctly determining value for\n * all input control.\n *\n * @param {Array} sides Available sides for box control.\n * @return {Array} Normalized sides configuration.\n */\nexport function normalizeSides( sides ) {\n\tconst filteredSides = [];\n\n\tif ( ! sides?.length ) {\n\t\treturn ALL_SIDES;\n\t}\n\n\tif ( sides.includes( 'vertical' ) ) {\n\t\tfilteredSides.push( ...[ 'top', 'bottom' ] );\n\t} else if ( sides.includes( 'horizontal' ) ) {\n\t\tfilteredSides.push( ...[ 'left', 'right' ] );\n\t} else {\n\t\tconst newSides = ALL_SIDES.filter( ( side ) => sides.includes( side ) );\n\t\tfilteredSides.push( ...newSides );\n\t}\n\n\treturn filteredSides;\n}\n"]}
@@ -12,8 +12,6 @@ var _element = require("@wordpress/element");
12
12
 
13
13
  var _reactNative = require("react-native");
14
14
 
15
- var _lodash = require("lodash");
16
-
17
15
  var _reactNativeGestureHandler = require("react-native-gesture-handler");
18
16
 
19
17
  var _compose = require("@wordpress/compose");
@@ -145,7 +143,7 @@ function Button(props) {
145
143
  showTooltip && label || // There's a shortcut or...
146
144
  shortcut || // There's a label and...
147
145
  !!label && ( // The children are empty and...
148
- !children || (0, _lodash.isArray)(children) && !children.length) && // The tooltip is not explicitly disabled.
146
+ !children || Array.isArray(children) && !children.length) && // The tooltip is not explicitly disabled.
149
147
  false !== showTooltip);
150
148
  const newIcon = icon ? (0, _element.cloneElement)((0, _element.createElement)(_icon.default, {
151
149
  icon: icon,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/button/index.native.js"],"names":["isAndroid","Platform","OS","marginBottom","marginLeft","styles","StyleSheet","create","container","flex","padding","justifyContent","alignItems","buttonInactive","flexDirection","fixedRatio","aspectRatio","buttonActive","borderRadius","borderColor","backgroundColor","subscriptInactive","color","fontWeight","fontSize","alignSelf","subscriptInactiveDark","subscriptActive","Button","props","children","onClick","onLongPress","disabled","hint","isPressed","ariaDisabled","subscript","testID","icon","iconSize","showTooltip","label","shortcut","tooltipPosition","isActiveStyle","customContainerStyles","preferredColorScheme","isDisabled","containerStyle","buttonViewStyle","opacity","states","push","newChildren","Children","map","child","colorScheme","shouldShowTooltip","length","newIcon","longPressHandler","nativeEvent","state","State","ACTIVE","element"],"mappings":";;;;;;;;;;AAgBA;;AAbA;;AAOA;;AACA;;AAMA;;AAQA;;AACA;;AA1BA;AACA;AACA;;AAWA;AACA;AACA;;AAOA;AACA;AACA;AAIA,MAAMA,SAAS,GAAGC,sBAASC,EAAT,KAAgB,SAAlC;AACA,MAAMC,YAAY,GAAGH,SAAS,GAAG,CAAC,GAAJ,GAAU,CAAxC;AACA,MAAMI,UAAU,GAAG,CAAC,CAApB;;AAEA,MAAMC,MAAM,GAAGC,wBAAWC,MAAX,CAAmB;AACjCC,EAAAA,SAAS,EAAE;AACVC,IAAAA,IAAI,EAAE,CADI;AAEVC,IAAAA,OAAO,EAAE,CAFC;AAGVC,IAAAA,cAAc,EAAE,QAHN;AAIVC,IAAAA,UAAU,EAAE;AAJF,GADsB;AAOjCC,EAAAA,cAAc,EAAE;AACfJ,IAAAA,IAAI,EAAE,CADS;AAEfK,IAAAA,aAAa,EAAE,KAFA;AAGfH,IAAAA,cAAc,EAAE,QAHD;AAIfC,IAAAA,UAAU,EAAE;AAJG,GAPiB;AAajCG,EAAAA,UAAU,EAAE;AACXC,IAAAA,WAAW,EAAE;AADF,GAbqB;AAgBjCC,EAAAA,YAAY,EAAE;AACbR,IAAAA,IAAI,EAAE,CADO;AAEbK,IAAAA,aAAa,EAAE,KAFF;AAGbH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;AAAjB;AAAd,KACG+C,OADH,EAEGP,WAFH,EAGGjB,SAAS,IACV,4BAAC,iBAAD;AACC,IAAA,KAAK,EACJF,SAAS,GACN9B,MAAM,CAACsB,eADD,GAENN;AAJL,KAOGgB,SAPH,CAJF,CADD,CALD,CAZD,CADD;;AAuCA,MAAK,CAAEsB,iBAAP,EAA2B;AAC1B,WAAOQ,OAAP;AACA;;AAED,SACC,4BAAC,gBAAD;AACC,IAAA,IAAI,EAAGzB,KADR;AAEC,IAAA,QAAQ,EAAGC,QAFZ;AAGC,IAAA,QAAQ,EAAGC,eAHZ;AAIC,IAAA,OAAO,EAAGH,WAAW,KAAK;AAJ3B,KAMG0B,OANH,CADD;AAUA;;eAEcvC,M","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tStyleSheet,\n\tTouchableOpacity,\n\tText,\n\tView,\n\tPlatform,\n} from 'react-native';\nimport { isArray } from 'lodash';\nimport { LongPressGestureHandler, State } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, useCallback } from '@wordpress/element';\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\n\nconst isAndroid = Platform.OS === 'android';\nconst marginBottom = isAndroid ? -0.5 : 0;\nconst marginLeft = -3;\n\nconst styles = StyleSheet.create( {\n\tcontainer: {\n\t\tflex: 1,\n\t\tpadding: 3,\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tbuttonInactive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tfixedRatio: {\n\t\taspectRatio: 1,\n\t},\n\tbuttonActive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t\tborderRadius: 6,\n\t\tborderColor: '#2e4453',\n\t\tbackgroundColor: '#2e4453',\n\t},\n\tsubscriptInactive: {\n\t\tcolor: '#7b9ab1', // $toolbar-button.\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n\tsubscriptInactiveDark: {\n\t\tcolor: '#a7aaad', // $gray_20.\n\t},\n\tsubscriptActive: {\n\t\tcolor: 'white',\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n} );\n\nexport function Button( props ) {\n\tconst {\n\t\tchildren,\n\t\tonClick,\n\t\tonLongPress,\n\t\tdisabled,\n\t\thint,\n\t\tfixedRatio = true,\n\t\tisPressed,\n\t\t'aria-disabled': ariaDisabled,\n\t\t'data-subscript': subscript,\n\t\ttestID,\n\t\ticon,\n\t\ticonSize,\n\t\tshowTooltip,\n\t\tlabel,\n\t\tshortcut,\n\t\ttooltipPosition,\n\t\tisActiveStyle,\n\t\tcustomContainerStyles,\n\t} = props;\n\tconst preferredColorScheme = usePreferredColorScheme();\n\n\tconst isDisabled = ariaDisabled || disabled;\n\n\tconst containerStyle = [\n\t\tstyles.container,\n\t\tcustomContainerStyles && { ...customContainerStyles },\n\t];\n\n\tconst buttonViewStyle = {\n\t\topacity: isDisabled ? 0.3 : 1,\n\t\t...( fixedRatio && styles.fixedRatio ),\n\t\t...( isPressed ? styles.buttonActive : styles.buttonInactive ),\n\t\t...( isPressed &&\n\t\t\tisActiveStyle?.borderRadius && {\n\t\t\t\tborderRadius: isActiveStyle.borderRadius,\n\t\t\t} ),\n\t\t...( isActiveStyle?.backgroundColor && {\n\t\t\tbackgroundColor: isActiveStyle.backgroundColor,\n\t\t} ),\n\t};\n\n\tconst states = [];\n\tif ( isPressed ) {\n\t\tstates.push( 'selected' );\n\t}\n\n\tif ( isDisabled ) {\n\t\tstates.push( 'disabled' );\n\t}\n\n\tconst subscriptInactive = usePreferredColorSchemeStyle(\n\t\tstyles.subscriptInactive,\n\t\tstyles.subscriptInactiveDark\n\t);\n\n\tconst newChildren = Children.map( children, ( child ) => {\n\t\treturn child\n\t\t\t? cloneElement( child, {\n\t\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\t\tisPressed,\n\t\t\t } )\n\t\t\t: child;\n\t} );\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! isDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t( ! children ||\n\t\t\t\t\t( isArray( children ) && ! children.length ) ) &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst newIcon = icon\n\t\t? cloneElement( <Icon icon={ icon } size={ iconSize } />, {\n\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\tisPressed,\n\t\t } )\n\t\t: null;\n\n\tconst longPressHandler = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tif ( nativeEvent.state === State.ACTIVE && onLongPress ) {\n\t\t\t\tonLongPress();\n\t\t\t}\n\t\t},\n\t\t[ onLongPress ]\n\t);\n\n\tconst element = (\n\t\t<TouchableOpacity\n\t\t\tactiveOpacity={ 0.7 }\n\t\t\taccessible={ true }\n\t\t\taccessibilityLabel={ label }\n\t\t\taccessibilityStates={ states }\n\t\t\taccessibilityRole={ 'button' }\n\t\t\taccessibilityHint={ hint }\n\t\t\tonPress={ onClick }\n\t\t\tstyle={ containerStyle }\n\t\t\tdisabled={ isDisabled }\n\t\t\ttestID={ testID }\n\t\t>\n\t\t\t<LongPressGestureHandler\n\t\t\t\tminDurationMs={ 500 }\n\t\t\t\tmaxDist={ 150 }\n\t\t\t\tonHandlerStateChange={ longPressHandler }\n\t\t\t>\n\t\t\t\t<View style={ buttonViewStyle }>\n\t\t\t\t\t<View style={ { flexDirection: 'row' } }>\n\t\t\t\t\t\t{ newIcon }\n\t\t\t\t\t\t{ newChildren }\n\t\t\t\t\t\t{ subscript && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tisPressed\n\t\t\t\t\t\t\t\t\t\t? styles.subscriptActive\n\t\t\t\t\t\t\t\t\t\t: subscriptInactive\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ subscript }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</LongPressGestureHandler>\n\t\t</TouchableOpacity>\n\t);\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn element;\n\t}\n\n\treturn (\n\t\t<Tooltip\n\t\t\ttext={ label }\n\t\t\tshortcut={ shortcut }\n\t\t\tposition={ tooltipPosition }\n\t\t\tvisible={ showTooltip === true }\n\t\t>\n\t\t\t{ element }\n\t\t</Tooltip>\n\t);\n}\n\nexport default Button;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/button/index.native.js"],"names":["isAndroid","Platform","OS","marginBottom","marginLeft","styles","StyleSheet","create","container","flex","padding","justifyContent","alignItems","buttonInactive","flexDirection","fixedRatio","aspectRatio","buttonActive","borderRadius","borderColor","backgroundColor","subscriptInactive","color","fontWeight","fontSize","alignSelf","subscriptInactiveDark","subscriptActive","Button","props","children","onClick","onLongPress","disabled","hint","isPressed","ariaDisabled","subscript","testID","icon","iconSize","showTooltip","label","shortcut","tooltipPosition","isActiveStyle","customContainerStyles","preferredColorScheme","isDisabled","containerStyle","buttonViewStyle","opacity","states","push","newChildren","Children","map","child","colorScheme","shouldShowTooltip","Array","isArray","length","newIcon","longPressHandler","nativeEvent","state","State","ACTIVE","element"],"mappings":";;;;;;;;;;AAeA;;AAZA;;AAOA;;AAMA;;AAQA;;AACA;;AAzBA;AACA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yleSheet,\n\tTouchableOpacity,\n\tText,\n\tView,\n\tPlatform,\n} from 'react-native';\nimport { LongPressGestureHandler, State } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, useCallback } from '@wordpress/element';\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\n\nconst isAndroid = Platform.OS === 'android';\nconst marginBottom = isAndroid ? -0.5 : 0;\nconst marginLeft = -3;\n\nconst styles = StyleSheet.create( {\n\tcontainer: {\n\t\tflex: 1,\n\t\tpadding: 3,\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tbuttonInactive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tfixedRatio: {\n\t\taspectRatio: 1,\n\t},\n\tbuttonActive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t\tborderRadius: 6,\n\t\tborderColor: '#2e4453',\n\t\tbackgroundColor: '#2e4453',\n\t},\n\tsubscriptInactive: {\n\t\tcolor: '#7b9ab1', // $toolbar-button.\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n\tsubscriptInactiveDark: {\n\t\tcolor: '#a7aaad', // $gray_20.\n\t},\n\tsubscriptActive: {\n\t\tcolor: 'white',\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n} );\n\nexport function Button( props ) {\n\tconst {\n\t\tchildren,\n\t\tonClick,\n\t\tonLongPress,\n\t\tdisabled,\n\t\thint,\n\t\tfixedRatio = true,\n\t\tisPressed,\n\t\t'aria-disabled': ariaDisabled,\n\t\t'data-subscript': subscript,\n\t\ttestID,\n\t\ticon,\n\t\ticonSize,\n\t\tshowTooltip,\n\t\tlabel,\n\t\tshortcut,\n\t\ttooltipPosition,\n\t\tisActiveStyle,\n\t\tcustomContainerStyles,\n\t} = props;\n\tconst preferredColorScheme = usePreferredColorScheme();\n\n\tconst isDisabled = ariaDisabled || disabled;\n\n\tconst containerStyle = [\n\t\tstyles.container,\n\t\tcustomContainerStyles && { ...customContainerStyles },\n\t];\n\n\tconst buttonViewStyle = {\n\t\topacity: isDisabled ? 0.3 : 1,\n\t\t...( fixedRatio && styles.fixedRatio ),\n\t\t...( isPressed ? styles.buttonActive : styles.buttonInactive ),\n\t\t...( isPressed &&\n\t\t\tisActiveStyle?.borderRadius && {\n\t\t\t\tborderRadius: isActiveStyle.borderRadius,\n\t\t\t} ),\n\t\t...( isActiveStyle?.backgroundColor && {\n\t\t\tbackgroundColor: isActiveStyle.backgroundColor,\n\t\t} ),\n\t};\n\n\tconst states = [];\n\tif ( isPressed ) {\n\t\tstates.push( 'selected' );\n\t}\n\n\tif ( isDisabled ) {\n\t\tstates.push( 'disabled' );\n\t}\n\n\tconst subscriptInactive = usePreferredColorSchemeStyle(\n\t\tstyles.subscriptInactive,\n\t\tstyles.subscriptInactiveDark\n\t);\n\n\tconst newChildren = Children.map( children, ( child ) => {\n\t\treturn child\n\t\t\t? cloneElement( child, {\n\t\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\t\tisPressed,\n\t\t\t } )\n\t\t\t: child;\n\t} );\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! isDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t( ! children ||\n\t\t\t\t\t( Array.isArray( children ) && ! children.length ) ) &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst newIcon = icon\n\t\t? cloneElement( <Icon icon={ icon } size={ iconSize } />, {\n\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\tisPressed,\n\t\t } )\n\t\t: null;\n\n\tconst longPressHandler = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tif ( nativeEvent.state === State.ACTIVE && onLongPress ) {\n\t\t\t\tonLongPress();\n\t\t\t}\n\t\t},\n\t\t[ onLongPress ]\n\t);\n\n\tconst element = (\n\t\t<TouchableOpacity\n\t\t\tactiveOpacity={ 0.7 }\n\t\t\taccessible={ true }\n\t\t\taccessibilityLabel={ label }\n\t\t\taccessibilityStates={ states }\n\t\t\taccessibilityRole={ 'button' }\n\t\t\taccessibilityHint={ hint }\n\t\t\tonPress={ onClick }\n\t\t\tstyle={ containerStyle }\n\t\t\tdisabled={ isDisabled }\n\t\t\ttestID={ testID }\n\t\t>\n\t\t\t<LongPressGestureHandler\n\t\t\t\tminDurationMs={ 500 }\n\t\t\t\tmaxDist={ 150 }\n\t\t\t\tonHandlerStateChange={ longPressHandler }\n\t\t\t>\n\t\t\t\t<View style={ buttonViewStyle }>\n\t\t\t\t\t<View style={ { flexDirection: 'row' } }>\n\t\t\t\t\t\t{ newIcon }\n\t\t\t\t\t\t{ newChildren }\n\t\t\t\t\t\t{ subscript && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tisPressed\n\t\t\t\t\t\t\t\t\t\t? styles.subscriptActive\n\t\t\t\t\t\t\t\t\t\t: subscriptInactive\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ subscript }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</LongPressGestureHandler>\n\t\t</TouchableOpacity>\n\t);\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn element;\n\t}\n\n\treturn (\n\t\t<Tooltip\n\t\t\ttext={ label }\n\t\t\tshortcut={ shortcut }\n\t\t\tposition={ tooltipPosition }\n\t\t\tvisible={ showTooltip === true }\n\t\t>\n\t\t\t{ element }\n\t\t</Tooltip>\n\t);\n}\n\nexport default Button;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/checkbox-control/index.tsx"],"names":["CheckboxControl","props","label","className","heading","checked","indeterminate","help","onChange","additionalProps","alternative","since","showCheckedIcon","setShowCheckedIcon","showIndeterminateIcon","setShowIndeterminateIcon","ref","node","matches","instanceId","id","onChangeValue","event","target","undefined","reset","check"],"mappings":";;;;;;;;;;AASA;;;;AANA;;AAOA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAT,EACN;AACA;AACAC,KAHM,EAOL;AACD,QAAM;AACLC,IAAAA,KADK;AAELC,IAAAA,SAFK;AAGLC,IAAAA,OAHK;AAILC,IAAAA,OAJK;AAKLC,IAAAA,aALK;AAMLC,IAAAA,IANK;AAOLC,IAAAA,QAPK;AAQL,OAAGC;AARE,MASFR,KATJ;;AAWA,MAAKG,OAAL,EAAe;AACd,6BAAY,qCAAZ,EAAmD;AAClDM,MAAAA,WAAW,EAAE,2CADqC;AAElDC,MAAAA,KAAK,EAAE;AAF2C,KAAnD;AAIA;;AAED,QAAM,CAAEC,eAAF,EAAmBC,kBAAnB,IAA0C,uBAAU,KAAV,CAAhD;AACA,QAAM,CAAEC,qBAAF,EAAyBC,wBAAzB,IAAsD,uBAC3D,KAD2D,CAA5D,CApBC,CAwBD;AACA;;AACA,QAAMC,GAAG,GAAG,2BACTC,IAAF,IAAY;AACX,QAAK,CAAEA,IAAP,EAAc;AACb;AACA,KAHU,CAKX;;;A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EAAC;AAHN,IADgB,GAMb,IAzBL,CAND,EAiCC;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,OAAO,EAAGN;AAFX,KAIGlB,KAJH,CAjCD,CADD;AA0CA;;eAEcF,e","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useInstanceId, useRefEffect } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\nimport { Icon, check, reset } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { CheckboxControlProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * Checkboxes allow the user to select one or more items from a set.\n *\n * ```jsx\n * import { CheckboxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCheckboxControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <CheckboxControl\n * label=\"Is author\"\n * help=\"Is the user a author or not?\"\n * checked={ isChecked }\n * onChange={ setChecked }\n * />\n * );\n * };\n * ```\n */\nexport function CheckboxControl(\n\t// ref is omitted until we have `WordPressComponentPropsWithoutRef` or add\n\t// ref forwarding to CheckboxControl.\n\tprops: Omit<\n\t\tWordPressComponentProps< CheckboxControlProps, 'input', false >,\n\t\t'ref'\n\t>\n) {\n\tconst {\n\t\tlabel,\n\t\tclassName,\n\t\theading,\n\t\tchecked,\n\t\tindeterminate,\n\t\thelp,\n\t\tonChange,\n\t\t...additionalProps\n\t} = props;\n\n\tif ( heading ) {\n\t\tdeprecated( '`heading` prop in `CheckboxControl`', {\n\t\t\talternative: 'a separate element to implement a heading',\n\t\t\tsince: '5.8',\n\t\t} );\n\t}\n\n\tconst [ showCheckedIcon, setShowCheckedIcon ] = useState( false );\n\tconst [ showIndeterminateIcon, setShowIndeterminateIcon ] = useState(\n\t\tfalse\n\t);\n\n\t// Run the following callback every time the `ref` (and the additional\n\t// dependencies) change.\n\tconst ref = useRefEffect< HTMLInputElement >(\n\t\t( node ) => {\n\t\t\tif ( ! node ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// It cannot be set using an HTML attribute.\n\t\t\tnode.indeterminate = !! indeterminate;\n\n\t\t\tsetShowCheckedIcon( node.matches( ':checked' ) );\n\t\t\tsetShowIndeterminateIcon( node.matches( ':indeterminate' ) );\n\t\t},\n\t\t[ checked, indeterminate ]\n\t);\n\tconst instanceId = useInstanceId( CheckboxControl );\n\tconst id = `inspector-checkbox-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.checked );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tlabel={ heading }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ classnames( 'components-checkbox-control', className ) }\n\t\t>\n\t\t\t<span className=\"components-checkbox-control__input-container\">\n\t\t\t\t<input\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tclassName=\"components-checkbox-control__input\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tvalue=\"1\"\n\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\tchecked={ checked }\n\t\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t/>\n\t\t\t\t{ showIndeterminateIcon ? (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ reset }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__indeterminate\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t\t{ showCheckedIcon ? (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__checked\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t</span>\n\t\t\t<label\n\t\t\t\tclassName=\"components-checkbox-control__label\"\n\t\t\t\thtmlFor={ id }\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t</BaseControl>\n\t);\n}\n\nexport default CheckboxControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/checkbox-control/index.tsx"],"names":["CheckboxControl","props","label","className","heading","checked","indeterminate","help","onChange","additionalProps","alternative","since","showCheckedIcon","setShowCheckedIcon","showIndeterminateIcon","setShowIndeterminateIcon","ref","node","matches","instanceId","id","onChangeValue","event","target","undefined","reset","check"],"mappings":";;;;;;;;;;AASA;;;;AANA;;AAOA;;AACA;;AACA;;AAKA;;AAjBA;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAT,EACN;AACA;AACAC,KAHM,EAOL;AACD,QAAM;AACLC,IAAAA,KADK;AAELC,IAAAA,SAFK;AAGLC,IAAAA,OAHK;AAILC,IAAAA,OAJK;AAKLC,IAAAA,aALK;AAMLC,IAAAA,IANK;AAOLC,IAAAA,QAPK;AAQL,OAAGC;AARE,MASFR,KATJ;;AAWA,MAAKG,OAAL,EAAe;AACd,6BAAY,qCAAZ,EAAmD;AAClDM,MAAAA,WAAW,EAAE,2CADqC;AAElDC,MAAAA,KAAK,EAAE;AAF2C,KAAnD;AAIA;;AAED,QAAM,CAAEC,eAAF,EAAmBC,kBAAnB,IAA0C,uBAAU,KAAV,CAAhD;AACA,QAAM,CAAEC,qBAAF,EAAyBC,wBAAzB,IACL,uBAAU,KAAV,CADD,CApBC,CAuBD;AACA;;AACA,QAAMC,GAAG,GAAG,2BACTC,IAAF,IAAY;AACX,QAAK,CAAEA,IAAP,EAAc;AACb;AACA,KAHU,CAKX;;;AACAA,IAAAA,IAAI,CAACX,aAAL,GAAqB,CAAC,CAAEA,aAAxB;AA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EAAC,oCADX;AAEC,IAAA,OAAO,EAAGN;AAFX,KAIGlB,KAJH,CAjCD,CADD;AA0CA;;eAEcF,e","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useInstanceId, useRefEffect } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\nimport { Icon, check, reset } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { CheckboxControlProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * Checkboxes allow the user to select one or more items from a set.\n *\n * ```jsx\n * import { CheckboxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCheckboxControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <CheckboxControl\n * label=\"Is author\"\n * help=\"Is the user a author or not?\"\n * checked={ isChecked }\n * onChange={ setChecked }\n * />\n * );\n * };\n * ```\n */\nexport function CheckboxControl(\n\t// ref is omitted until we have `WordPressComponentPropsWithoutRef` or add\n\t// ref forwarding to CheckboxControl.\n\tprops: Omit<\n\t\tWordPressComponentProps< CheckboxControlProps, 'input', false >,\n\t\t'ref'\n\t>\n) {\n\tconst {\n\t\tlabel,\n\t\tclassName,\n\t\theading,\n\t\tchecked,\n\t\tindeterminate,\n\t\thelp,\n\t\tonChange,\n\t\t...additionalProps\n\t} = props;\n\n\tif ( heading ) {\n\t\tdeprecated( '`heading` prop in `CheckboxControl`', {\n\t\t\talternative: 'a separate element to implement a heading',\n\t\t\tsince: '5.8',\n\t\t} );\n\t}\n\n\tconst [ showCheckedIcon, setShowCheckedIcon ] = useState( false );\n\tconst [ showIndeterminateIcon, setShowIndeterminateIcon ] =\n\t\tuseState( false );\n\n\t// Run the following callback every time the `ref` (and the additional\n\t// dependencies) change.\n\tconst ref = useRefEffect< HTMLInputElement >(\n\t\t( node ) => {\n\t\t\tif ( ! node ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// It cannot be set using an HTML attribute.\n\t\t\tnode.indeterminate = !! indeterminate;\n\n\t\t\tsetShowCheckedIcon( node.matches( ':checked' ) );\n\t\t\tsetShowIndeterminateIcon( node.matches( ':indeterminate' ) );\n\t\t},\n\t\t[ checked, indeterminate ]\n\t);\n\tconst instanceId = useInstanceId( CheckboxControl );\n\tconst id = `inspector-checkbox-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.checked );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tlabel={ heading }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ classnames( 'components-checkbox-control', className ) }\n\t\t>\n\t\t\t<span className=\"components-checkbox-control__input-container\">\n\t\t\t\t<input\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tclassName=\"components-checkbox-control__input\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tvalue=\"1\"\n\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\tchecked={ checked }\n\t\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t/>\n\t\t\t\t{ showIndeterminateIcon ? (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ reset }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__indeterminate\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t\t{ showCheckedIcon ? (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__checked\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t</span>\n\t\t\t<label\n\t\t\t\tclassName=\"components-checkbox-control__label\"\n\t\t\t\thtmlFor={ id }\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t</BaseControl>\n\t);\n}\n\nexport default CheckboxControl;\n"]}
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.default = exports.ColorIndicator = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
@@ -13,25 +13,42 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
13
13
 
14
14
  var _classnames = _interopRequireDefault(require("classnames"));
15
15
 
16
- // @ts-nocheck
17
-
18
16
  /**
19
17
  * External dependencies
20
18
  */
21
- const ColorIndicator = _ref => {
22
- let {
19
+
20
+ /**
21
+ * WordPress dependencies
22
+ */
23
+ function UnforwardedColorIndicator(props, forwardedRef) {
24
+ const {
23
25
  className,
24
26
  colorValue,
25
- ...props
26
- } = _ref;
27
+ ...additionalProps
28
+ } = props;
27
29
  return (0, _element.createElement)("span", (0, _extends2.default)({
28
30
  className: (0, _classnames.default)('component-color-indicator', className),
29
31
  style: {
30
32
  background: colorValue
31
- }
32
- }, props));
33
- };
33
+ },
34
+ ref: forwardedRef
35
+ }, additionalProps));
36
+ }
37
+ /**
38
+ * ColorIndicator is a React component that renders a specific color in a
39
+ * circle. It's often used to summarize a collection of used colors in a child
40
+ * component.
41
+ *
42
+ * ```jsx
43
+ * import { ColorIndicator } from '@wordpress/components';
44
+ *
45
+ * const MyColorIndicator = () => <ColorIndicator colorValue="#0073aa" />;
46
+ * ```
47
+ */
48
+
34
49
 
50
+ const ColorIndicator = (0, _element.forwardRef)(UnforwardedColorIndicator);
51
+ exports.ColorIndicator = ColorIndicator;
35
52
  var _default = ColorIndicator;
36
53
  exports.default = _default;
37
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/color-indicator/index.js"],"names":["ColorIndicator","className","colorValue","props","background"],"mappings":";;;;;;;;;;;;;AAKA;;AALA;;AAEA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG;AAAA,MAAE;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,UAAb;AAAyB,OAAGC;AAA5B,GAAF;AAAA,SACtB;AACC,IAAA,SAAS,EAAG,yBAAY,2BAAZ,EAAyCF,SAAzC,CADb;AAEC,IAAA,KAAK,EAAG;AAAEG,MAAAA,UAAU,EAAEF;AAAd;AAFT,KAGMC,KAHN,EADsB;AAAA,CAAvB;;eAQeH,c","sourcesContent":["// @ts-nocheck\n\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\nconst ColorIndicator = ( { className, colorValue, ...props } ) => (\n\t<span\n\t\tclassName={ classnames( 'component-color-indicator', className ) }\n\t\tstyle={ { background: colorValue } }\n\t\t{ ...props }\n\t/>\n);\n\nexport default ColorIndicator;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/color-indicator/index.tsx"],"names":["UnforwardedColorIndicator","props","forwardedRef","className","colorValue","additionalProps","background","ColorIndicator"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAHA;AACA;AACA;;AAIA;AACA;AACA;AASA,SAASA,yBAAT,CACCC,KADD,EAECC,YAFD,EAGE;AACD,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,UAAb;AAAyB,OAAGC;AAA5B,MAAgDJ,KAAtD;AAEA,SACC;AACC,IAAA,SAAS,EAAG,yBAAY,2BAAZ,EAAyCE,SAAzC,CADb;AAEC,IAAA,KAAK,EAAG;AAAEG,MAAAA,UAAU,EAAEF;AAAd,KAFT;AAGC,IAAA,GAAG,EAAGF;AAHP,KAIMG,eAJN,EADD;AAQA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAME,cAAc,GAAG,yBAAYP,yBAAZ,CAAvB;;eAEQO,c","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../ui/context';\nimport type { ColorIndicatorProps } from './types';\n\nfunction UnforwardedColorIndicator(\n\tprops: WordPressComponentProps< ColorIndicatorProps, 'span', false >,\n\tforwardedRef: ForwardedRef< HTMLSpanElement >\n) {\n\tconst { className, colorValue, ...additionalProps } = props;\n\n\treturn (\n\t\t<span\n\t\t\tclassName={ classnames( 'component-color-indicator', className ) }\n\t\t\tstyle={ { background: colorValue } }\n\t\t\tref={ forwardedRef }\n\t\t\t{ ...additionalProps }\n\t\t/>\n\t);\n}\n\n/**\n * ColorIndicator is a React component that renders a specific color in a\n * circle. It's often used to summarize a collection of used colors in a child\n * component.\n *\n * ```jsx\n * import { ColorIndicator } from '@wordpress/components';\n *\n * const MyColorIndicator = () => <ColorIndicator colorValue=\"#0073aa\" />;\n * ```\n */\nexport const ColorIndicator = forwardRef( UnforwardedColorIndicator );\n\nexport default ColorIndicator;\n"]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -133,7 +133,8 @@ function CustomColorPickerDropdown(_ref5) {
133
133
  contentClassName: "components-color-palette__custom-color-dropdown-content",
134
134
  popoverProps: isRenderedInSidebar ? {
135
135
  placement: 'left-start',
136
- offset: 20
136
+ offset: 20,
137
+ __unstableShift: true
137
138
  } : undefined
138
139
  }, props));
139
140
  }