@wordpress/components 28.13.1-next.082ed6819.0 → 29.0.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 (1020) hide show
  1. package/CHANGELOG.md +53 -2
  2. package/CONTRIBUTING.md +16 -16
  3. package/build/alignment-matrix-control/icon.js +1 -0
  4. package/build/alignment-matrix-control/icon.js.map +1 -1
  5. package/build/alignment-matrix-control/index.js +1 -0
  6. package/build/alignment-matrix-control/index.js.map +1 -1
  7. package/build/angle-picker-control/index.js +1 -1
  8. package/build/angle-picker-control/index.js.map +1 -1
  9. package/build/animation/index.js +0 -6
  10. package/build/animation/index.js.map +1 -1
  11. package/build/autocomplete/autocompleter-ui.js +1 -0
  12. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  13. package/build/autocomplete/autocompleter-ui.native.js +1 -0
  14. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  15. package/build/autocomplete/get-default-use-items.js +1 -0
  16. package/build/autocomplete/get-default-use-items.js.map +1 -1
  17. package/build/border-box-control/border-box-control-split-controls/component.js +1 -1
  18. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  19. package/build/border-box-control/utils.js +1 -0
  20. package/build/border-box-control/utils.js.map +1 -1
  21. package/build/border-control/border-control/component.js +2 -0
  22. package/build/border-control/border-control/component.js.map +1 -1
  23. package/build/border-control/border-control-dropdown/component.js +1 -0
  24. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  25. package/build/border-control/border-control-style-picker/component.js +1 -0
  26. package/build/border-control/border-control-style-picker/component.js.map +1 -1
  27. package/build/box-control/index.js +35 -28
  28. package/build/box-control/index.js.map +1 -1
  29. package/build/box-control/input-control.js +161 -0
  30. package/build/box-control/input-control.js.map +1 -0
  31. package/build/box-control/types.js.map +1 -1
  32. package/build/box-control/utils.js +51 -48
  33. package/build/box-control/utils.js.map +1 -1
  34. package/build/button/index.native.js +1 -0
  35. package/build/button/index.native.js.map +1 -1
  36. package/build/button/types.js.map +1 -1
  37. package/build/circular-option-picker/circular-option-picker-actions.js +1 -0
  38. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  39. package/build/circular-option-picker/circular-option-picker-option.js +1 -0
  40. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  41. package/build/clipboard-button/index.js +5 -3
  42. package/build/clipboard-button/index.js.map +1 -1
  43. package/build/color-indicator/index.native.js +1 -0
  44. package/build/color-indicator/index.native.js.map +1 -1
  45. package/build/color-palette/index.js +1 -0
  46. package/build/color-palette/index.js.map +1 -1
  47. package/build/color-palette/utils.js +1 -0
  48. package/build/color-palette/utils.js.map +1 -1
  49. package/build/color-picker/input-with-slider.js +2 -2
  50. package/build/color-picker/input-with-slider.js.map +1 -1
  51. package/build/combobox-control/index.js +1 -0
  52. package/build/combobox-control/index.js.map +1 -1
  53. package/build/composite/item.js +0 -9
  54. package/build/composite/item.js.map +1 -1
  55. package/build/composite/legacy/index.js +1 -0
  56. package/build/composite/legacy/index.js.map +1 -1
  57. package/build/custom-gradient-picker/gradient-bar/control-points.js +3 -0
  58. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  59. package/build/custom-gradient-picker/gradient-bar/index.js +1 -0
  60. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  61. package/build/custom-gradient-picker/gradient-bar/utils.js +1 -0
  62. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  63. package/build/custom-gradient-picker/index.js +3 -0
  64. package/build/custom-gradient-picker/index.js.map +1 -1
  65. package/build/custom-gradient-picker/serializer.js +1 -0
  66. package/build/custom-gradient-picker/serializer.js.map +1 -1
  67. package/build/custom-gradient-picker/types.js.map +1 -1
  68. package/build/custom-gradient-picker/utils.js +1 -0
  69. package/build/custom-gradient-picker/utils.js.map +1 -1
  70. package/build/custom-select-control/index.js +11 -2
  71. package/build/custom-select-control/index.js.map +1 -1
  72. package/build/custom-select-control/types.js.map +1 -1
  73. package/build/dashicon/index.js +1 -0
  74. package/build/dashicon/index.js.map +1 -1
  75. package/build/date-time/date/index.js +1 -0
  76. package/build/date-time/date/index.js.map +1 -1
  77. package/build/date-time/date/use-lilius/index.js +1 -0
  78. package/build/date-time/date/use-lilius/index.js.map +1 -1
  79. package/build/date-time/time/index.js +1 -0
  80. package/build/date-time/time/index.js.map +1 -1
  81. package/build/dimension-control/index.js +1 -0
  82. package/build/dimension-control/index.js.map +1 -1
  83. package/build/dimension-control/sizes.js +1 -0
  84. package/build/dimension-control/sizes.js.map +1 -1
  85. package/build/draggable/index.js +1 -0
  86. package/build/draggable/index.js.map +1 -1
  87. package/build/draggable/index.native.js +1 -0
  88. package/build/draggable/index.native.js.map +1 -1
  89. package/build/drop-zone/index.js +19 -13
  90. package/build/drop-zone/index.js.map +1 -1
  91. package/build/drop-zone/types.js.map +1 -1
  92. package/build/dropdown-menu/index.js +2 -0
  93. package/build/dropdown-menu/index.js.map +1 -1
  94. package/build/dropdown-menu/index.native.js +1 -0
  95. package/build/dropdown-menu/index.native.js.map +1 -1
  96. package/build/duotone-picker/color-list-picker/index.js +10 -14
  97. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  98. package/build/duotone-picker/duotone-picker.js +1 -0
  99. package/build/duotone-picker/duotone-picker.js.map +1 -1
  100. package/build/duotone-picker/utils.js +1 -0
  101. package/build/duotone-picker/utils.js.map +1 -1
  102. package/build/font-size-picker/font-size-picker-select.js +2 -0
  103. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  104. package/build/font-size-picker/font-size-picker-toggle-group.js +1 -0
  105. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  106. package/build/font-size-picker/index.js +2 -0
  107. package/build/font-size-picker/index.js.map +1 -1
  108. package/build/font-size-picker/index.native.js +1 -0
  109. package/build/font-size-picker/index.native.js.map +1 -1
  110. package/build/font-size-picker/utils.js +1 -0
  111. package/build/font-size-picker/utils.js.map +1 -1
  112. package/build/form-file-upload/index.js +11 -1
  113. package/build/form-file-upload/index.js.map +1 -1
  114. package/build/form-file-upload/types.js.map +1 -1
  115. package/build/form-token-field/index.js +6 -0
  116. package/build/form-token-field/index.js.map +1 -1
  117. package/build/form-token-field/suggestions-list.js +1 -0
  118. package/build/form-token-field/suggestions-list.js.map +1 -1
  119. package/build/gradient-picker/index.js +3 -0
  120. package/build/gradient-picker/index.js.map +1 -1
  121. package/build/gradient-picker/types.js.map +1 -1
  122. package/build/guide/index.js +1 -0
  123. package/build/guide/index.js.map +1 -1
  124. package/build/guide/page-control.js +1 -0
  125. package/build/guide/page-control.js.map +1 -1
  126. package/build/h-stack/hook.js +1 -0
  127. package/build/h-stack/hook.js.map +1 -1
  128. package/build/higher-order/navigate-regions/index.js +1 -0
  129. package/build/higher-order/navigate-regions/index.js.map +1 -1
  130. package/build/higher-order/with-fallback-styles/index.js +1 -0
  131. package/build/higher-order/with-fallback-styles/index.js.map +1 -1
  132. package/build/higher-order/with-filters/index.js +1 -0
  133. package/build/higher-order/with-filters/index.js.map +1 -1
  134. package/build/higher-order/with-notices/index.js +1 -0
  135. package/build/higher-order/with-notices/index.js.map +1 -1
  136. package/build/icon/index.js +9 -0
  137. package/build/icon/index.js.map +1 -1
  138. package/build/index.js +0 -6
  139. package/build/index.js.map +1 -1
  140. package/build/keyboard-shortcuts/index.js +1 -0
  141. package/build/keyboard-shortcuts/index.js.map +1 -1
  142. package/build/menu/checkbox-item.js +5 -9
  143. package/build/menu/checkbox-item.js.map +1 -1
  144. package/build/menu/group-label.js +4 -1
  145. package/build/menu/group-label.js.map +1 -1
  146. package/build/menu/group.js +4 -1
  147. package/build/menu/group.js.map +1 -1
  148. package/build/menu/item-help-text.js +5 -0
  149. package/build/menu/item-help-text.js.map +1 -1
  150. package/build/menu/item-label.js +5 -0
  151. package/build/menu/item-label.js.map +1 -1
  152. package/build/menu/item.js +4 -8
  153. package/build/menu/item.js.map +1 -1
  154. package/build/menu/radio-item.js +5 -9
  155. package/build/menu/radio-item.js.map +1 -1
  156. package/build/menu/separator.js +5 -2
  157. package/build/menu/separator.js.map +1 -1
  158. package/build/menu/styles.js +16 -16
  159. package/build/menu/styles.js.map +1 -1
  160. package/build/menu-items-choice/index.js +1 -0
  161. package/build/menu-items-choice/index.js.map +1 -1
  162. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
  163. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  164. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
  165. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  166. package/build/mobile/bottom-sheet/picker-cell.native.js +1 -0
  167. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  168. package/build/mobile/bottom-sheet-select-control/index.native.js +1 -0
  169. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  170. package/build/mobile/color-settings/palette.screen.native.js +1 -0
  171. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  172. package/build/mobile/gradient/index.native.js +1 -0
  173. package/build/mobile/gradient/index.native.js.map +1 -1
  174. package/build/mobile/media-edit/index.native.js +1 -0
  175. package/build/mobile/media-edit/index.native.js.map +1 -1
  176. package/build/mobile/picker/index.android.js +1 -0
  177. package/build/mobile/picker/index.android.js.map +1 -1
  178. package/build/mobile/picker/index.ios.js +1 -0
  179. package/build/mobile/picker/index.ios.js.map +1 -1
  180. package/build/mobile/segmented-control/index.native.js +1 -0
  181. package/build/mobile/segmented-control/index.native.js.map +1 -1
  182. package/build/mobile/utils/get-px-from-css-unit.native.js +1 -0
  183. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  184. package/build/modal/aria-helper.js +0 -1
  185. package/build/modal/aria-helper.js.map +1 -1
  186. package/build/modal/index.js +0 -1
  187. package/build/modal/index.js.map +1 -1
  188. package/build/navigable-container/container.js +1 -0
  189. package/build/navigable-container/container.js.map +1 -1
  190. package/build/navigation/group/index.js +1 -0
  191. package/build/navigation/group/index.js.map +1 -1
  192. package/build/navigation/menu/menu-title-search.js +1 -0
  193. package/build/navigation/menu/menu-title-search.js.map +1 -1
  194. package/build/navigation/menu/search-no-results-found.js +1 -0
  195. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  196. package/build/navigation/styles/navigation-styles.js +12 -12
  197. package/build/navigation/styles/navigation-styles.js.map +1 -1
  198. package/build/navigator/navigator/component.js +1 -0
  199. package/build/navigator/navigator/component.js.map +1 -1
  200. package/build/navigator/navigator-screen/component.js +1 -0
  201. package/build/navigator/navigator-screen/component.js.map +1 -1
  202. package/build/navigator/utils/router.js +1 -0
  203. package/build/navigator/utils/router.js.map +1 -1
  204. package/build/notice/index.js +1 -0
  205. package/build/notice/index.js.map +1 -1
  206. package/build/notice/list.js +1 -0
  207. package/build/notice/list.js.map +1 -1
  208. package/build/notice/list.native.js +1 -0
  209. package/build/notice/list.native.js.map +1 -1
  210. package/build/number-control/index.js +8 -0
  211. package/build/number-control/index.js.map +1 -1
  212. package/build/number-control/types.js.map +1 -1
  213. package/build/palette-edit/index.js +1 -0
  214. package/build/palette-edit/index.js.map +1 -1
  215. package/build/panel/actions.native.js +1 -0
  216. package/build/panel/actions.native.js.map +1 -1
  217. package/build/query-controls/index.js +1 -0
  218. package/build/query-controls/index.js.map +1 -1
  219. package/build/query-controls/terms.js +1 -0
  220. package/build/query-controls/terms.js.map +1 -1
  221. package/build/radio-control/index.js +1 -0
  222. package/build/radio-control/index.js.map +1 -1
  223. package/build/radio-control/index.native.js +1 -0
  224. package/build/radio-control/index.native.js.map +1 -1
  225. package/build/range-control/index.js +2 -1
  226. package/build/range-control/index.js.map +1 -1
  227. package/build/range-control/mark.js +0 -1
  228. package/build/range-control/mark.js.map +1 -1
  229. package/build/range-control/rail.js +1 -0
  230. package/build/range-control/rail.js.map +1 -1
  231. package/build/range-control/styles/range-control-styles.js +33 -45
  232. package/build/range-control/styles/range-control-styles.js.map +1 -1
  233. package/build/resizable-box/index.js +10 -1
  234. package/build/resizable-box/index.js.map +1 -1
  235. package/build/sandbox/index.js +1 -0
  236. package/build/sandbox/index.js.map +1 -1
  237. package/build/sandbox/index.native.js +1 -0
  238. package/build/sandbox/index.native.js.map +1 -1
  239. package/build/search-control/index.native.js +1 -0
  240. package/build/search-control/index.native.js.map +1 -1
  241. package/build/select-control/index.js +1 -0
  242. package/build/select-control/index.js.map +1 -1
  243. package/build/slot-fill/bubbles-virtually/fill.js +8 -12
  244. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  245. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +7 -10
  246. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  247. package/build/slot-fill/bubbles-virtually/slot.js +4 -10
  248. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  249. package/build/slot-fill/provider.js +1 -0
  250. package/build/slot-fill/provider.js.map +1 -1
  251. package/build/slot-fill/slot.js +1 -0
  252. package/build/slot-fill/slot.js.map +1 -1
  253. package/build/slot-fill/types.js.map +1 -1
  254. package/build/snackbar/index.js +1 -0
  255. package/build/snackbar/index.js.map +1 -1
  256. package/build/snackbar/list.js +1 -0
  257. package/build/snackbar/list.js.map +1 -1
  258. package/build/style-provider/index.js +0 -1
  259. package/build/style-provider/index.js.map +1 -1
  260. package/build/tab-panel/index.js +1 -0
  261. package/build/tab-panel/index.js.map +1 -1
  262. package/build/tabs/index.js +1 -0
  263. package/build/tabs/index.js.map +1 -1
  264. package/build/tabs/tab.js +0 -17
  265. package/build/tabs/tab.js.map +1 -1
  266. package/build/text/utils.js +1 -0
  267. package/build/text/utils.js.map +1 -1
  268. package/build/theme/color-algorithms.js +1 -0
  269. package/build/theme/color-algorithms.js.map +1 -1
  270. package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
  271. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  272. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
  273. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  274. package/build/toolbar/toolbar-button/index.js +2 -0
  275. package/build/toolbar/toolbar-button/index.js.map +1 -1
  276. package/build/toolbar/toolbar-group/index.js +1 -0
  277. package/build/toolbar/toolbar-group/index.js.map +1 -1
  278. package/build/tools-panel/tools-panel/component.js +2 -0
  279. package/build/tools-panel/tools-panel/component.js.map +1 -1
  280. package/build/tools-panel/tools-panel/hook.js +1 -0
  281. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  282. package/build/tools-panel/tools-panel-header/component.js +1 -0
  283. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  284. package/build/tree-grid/cell.js +4 -1
  285. package/build/tree-grid/cell.js.map +1 -1
  286. package/build/tree-grid/index.js +1 -0
  287. package/build/tree-grid/index.js.map +1 -1
  288. package/build/tree-grid/types.js.map +1 -1
  289. package/build/tree-select/index.js +1 -0
  290. package/build/tree-select/index.js.map +1 -1
  291. package/build/unit-control/index.js +11 -1
  292. package/build/unit-control/index.js.map +1 -1
  293. package/build/unit-control/index.native.js +1 -0
  294. package/build/unit-control/index.native.js.map +1 -1
  295. package/build/unit-control/types.js.map +1 -1
  296. package/build/unit-control/unit-select-control.js +1 -0
  297. package/build/unit-control/unit-select-control.js.map +1 -1
  298. package/build/unit-control/utils.js +1 -0
  299. package/build/unit-control/utils.js.map +1 -1
  300. package/build/utils/colors-values.js +3 -0
  301. package/build/utils/colors-values.js.map +1 -1
  302. package/build/utils/config-values.js +0 -1
  303. package/build/utils/config-values.js.map +1 -1
  304. package/build/utils/get-valid-children.js +1 -0
  305. package/build/utils/get-valid-children.js.map +1 -1
  306. package/build/utils/hooks/use-animated-offset-rect.js +1 -0
  307. package/build/utils/hooks/use-animated-offset-rect.js.map +1 -1
  308. package/build/utils/hooks/use-cx.js +1 -0
  309. package/build/utils/hooks/use-cx.js.map +1 -1
  310. package/build/utils/math.js +1 -0
  311. package/build/utils/math.js.map +1 -1
  312. package/build/utils/rtl.js +1 -0
  313. package/build/utils/rtl.js.map +1 -1
  314. package/build/utils/values.js +1 -0
  315. package/build/utils/values.js.map +1 -1
  316. package/build/z-stack/component.js +1 -0
  317. package/build/z-stack/component.js.map +1 -1
  318. package/build-module/alignment-matrix-control/icon.js +1 -0
  319. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  320. package/build-module/alignment-matrix-control/index.js +1 -0
  321. package/build-module/alignment-matrix-control/index.js.map +1 -1
  322. package/build-module/angle-picker-control/index.js +1 -1
  323. package/build-module/angle-picker-control/index.js.map +1 -1
  324. package/build-module/animation/index.js +1 -1
  325. package/build-module/animation/index.js.map +1 -1
  326. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  327. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  328. package/build-module/autocomplete/autocompleter-ui.native.js +1 -0
  329. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  330. package/build-module/autocomplete/get-default-use-items.js +1 -0
  331. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  332. package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -1
  333. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  334. package/build-module/border-box-control/utils.js +1 -0
  335. package/build-module/border-box-control/utils.js.map +1 -1
  336. package/build-module/border-control/border-control/component.js +2 -0
  337. package/build-module/border-control/border-control/component.js.map +1 -1
  338. package/build-module/border-control/border-control-dropdown/component.js +1 -0
  339. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  340. package/build-module/border-control/border-control-style-picker/component.js +1 -0
  341. package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
  342. package/build-module/box-control/index.js +37 -30
  343. package/build-module/box-control/index.js.map +1 -1
  344. package/build-module/box-control/input-control.js +153 -0
  345. package/build-module/box-control/input-control.js.map +1 -0
  346. package/build-module/box-control/types.js.map +1 -1
  347. package/build-module/box-control/utils.js +48 -46
  348. package/build-module/box-control/utils.js.map +1 -1
  349. package/build-module/button/index.native.js +1 -0
  350. package/build-module/button/index.native.js.map +1 -1
  351. package/build-module/button/types.js.map +1 -1
  352. package/build-module/circular-option-picker/circular-option-picker-actions.js +1 -0
  353. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  354. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -0
  355. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  356. package/build-module/clipboard-button/index.js +5 -3
  357. package/build-module/clipboard-button/index.js.map +1 -1
  358. package/build-module/color-indicator/index.native.js +1 -0
  359. package/build-module/color-indicator/index.native.js.map +1 -1
  360. package/build-module/color-palette/index.js +1 -0
  361. package/build-module/color-palette/index.js.map +1 -1
  362. package/build-module/color-palette/utils.js +1 -0
  363. package/build-module/color-palette/utils.js.map +1 -1
  364. package/build-module/color-picker/input-with-slider.js +2 -2
  365. package/build-module/color-picker/input-with-slider.js.map +1 -1
  366. package/build-module/combobox-control/index.js +1 -0
  367. package/build-module/combobox-control/index.js.map +1 -1
  368. package/build-module/composite/item.js +0 -9
  369. package/build-module/composite/item.js.map +1 -1
  370. package/build-module/composite/legacy/index.js +1 -0
  371. package/build-module/composite/legacy/index.js.map +1 -1
  372. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +3 -0
  373. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  374. package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -0
  375. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  376. package/build-module/custom-gradient-picker/gradient-bar/utils.js +1 -0
  377. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  378. package/build-module/custom-gradient-picker/index.js +3 -0
  379. package/build-module/custom-gradient-picker/index.js.map +1 -1
  380. package/build-module/custom-gradient-picker/serializer.js +1 -0
  381. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  382. package/build-module/custom-gradient-picker/types.js.map +1 -1
  383. package/build-module/custom-gradient-picker/utils.js +1 -0
  384. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  385. package/build-module/custom-select-control/index.js +11 -2
  386. package/build-module/custom-select-control/index.js.map +1 -1
  387. package/build-module/custom-select-control/types.js.map +1 -1
  388. package/build-module/dashicon/index.js +1 -0
  389. package/build-module/dashicon/index.js.map +1 -1
  390. package/build-module/date-time/date/index.js +1 -0
  391. package/build-module/date-time/date/index.js.map +1 -1
  392. package/build-module/date-time/date/use-lilius/index.js +1 -0
  393. package/build-module/date-time/date/use-lilius/index.js.map +1 -1
  394. package/build-module/date-time/time/index.js +1 -0
  395. package/build-module/date-time/time/index.js.map +1 -1
  396. package/build-module/dimension-control/index.js +1 -0
  397. package/build-module/dimension-control/index.js.map +1 -1
  398. package/build-module/dimension-control/sizes.js +1 -0
  399. package/build-module/dimension-control/sizes.js.map +1 -1
  400. package/build-module/draggable/index.js +1 -0
  401. package/build-module/draggable/index.js.map +1 -1
  402. package/build-module/draggable/index.native.js +1 -0
  403. package/build-module/draggable/index.native.js.map +1 -1
  404. package/build-module/drop-zone/index.js +19 -13
  405. package/build-module/drop-zone/index.js.map +1 -1
  406. package/build-module/drop-zone/types.js.map +1 -1
  407. package/build-module/dropdown-menu/index.js +2 -0
  408. package/build-module/dropdown-menu/index.js.map +1 -1
  409. package/build-module/dropdown-menu/index.native.js +1 -0
  410. package/build-module/dropdown-menu/index.native.js.map +1 -1
  411. package/build-module/duotone-picker/color-list-picker/index.js +11 -15
  412. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  413. package/build-module/duotone-picker/duotone-picker.js +1 -0
  414. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  415. package/build-module/duotone-picker/utils.js +1 -0
  416. package/build-module/duotone-picker/utils.js.map +1 -1
  417. package/build-module/font-size-picker/font-size-picker-select.js +2 -0
  418. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  419. package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -0
  420. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  421. package/build-module/font-size-picker/index.js +2 -0
  422. package/build-module/font-size-picker/index.js.map +1 -1
  423. package/build-module/font-size-picker/index.native.js +1 -0
  424. package/build-module/font-size-picker/index.native.js.map +1 -1
  425. package/build-module/font-size-picker/utils.js +1 -0
  426. package/build-module/font-size-picker/utils.js.map +1 -1
  427. package/build-module/form-file-upload/index.js +13 -2
  428. package/build-module/form-file-upload/index.js.map +1 -1
  429. package/build-module/form-file-upload/types.js.map +1 -1
  430. package/build-module/form-token-field/index.js +6 -0
  431. package/build-module/form-token-field/index.js.map +1 -1
  432. package/build-module/form-token-field/suggestions-list.js +1 -0
  433. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  434. package/build-module/gradient-picker/index.js +3 -0
  435. package/build-module/gradient-picker/index.js.map +1 -1
  436. package/build-module/gradient-picker/types.js.map +1 -1
  437. package/build-module/guide/index.js +1 -0
  438. package/build-module/guide/index.js.map +1 -1
  439. package/build-module/guide/page-control.js +1 -0
  440. package/build-module/guide/page-control.js.map +1 -1
  441. package/build-module/h-stack/hook.js +1 -0
  442. package/build-module/h-stack/hook.js.map +1 -1
  443. package/build-module/higher-order/navigate-regions/index.js +1 -0
  444. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  445. package/build-module/higher-order/with-fallback-styles/index.js +1 -0
  446. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  447. package/build-module/higher-order/with-filters/index.js +1 -0
  448. package/build-module/higher-order/with-filters/index.js.map +1 -1
  449. package/build-module/higher-order/with-notices/index.js +1 -0
  450. package/build-module/higher-order/with-notices/index.js.map +1 -1
  451. package/build-module/icon/index.js +9 -0
  452. package/build-module/icon/index.js.map +1 -1
  453. package/build-module/index.js +1 -1
  454. package/build-module/index.js.map +1 -1
  455. package/build-module/keyboard-shortcuts/index.js +1 -0
  456. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  457. package/build-module/menu/checkbox-item.js +5 -9
  458. package/build-module/menu/checkbox-item.js.map +1 -1
  459. package/build-module/menu/group-label.js +4 -1
  460. package/build-module/menu/group-label.js.map +1 -1
  461. package/build-module/menu/group.js +4 -1
  462. package/build-module/menu/group.js.map +1 -1
  463. package/build-module/menu/item-help-text.js +6 -1
  464. package/build-module/menu/item-help-text.js.map +1 -1
  465. package/build-module/menu/item-label.js +6 -1
  466. package/build-module/menu/item-label.js.map +1 -1
  467. package/build-module/menu/item.js +4 -8
  468. package/build-module/menu/item.js.map +1 -1
  469. package/build-module/menu/radio-item.js +5 -9
  470. package/build-module/menu/radio-item.js.map +1 -1
  471. package/build-module/menu/separator.js +5 -2
  472. package/build-module/menu/separator.js.map +1 -1
  473. package/build-module/menu/styles.js +16 -16
  474. package/build-module/menu/styles.js.map +1 -1
  475. package/build-module/menu-items-choice/index.js +1 -0
  476. package/build-module/menu-items-choice/index.js.map +1 -1
  477. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
  478. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  479. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
  480. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  481. package/build-module/mobile/bottom-sheet/picker-cell.native.js +1 -0
  482. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  483. package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -0
  484. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  485. package/build-module/mobile/color-settings/palette.screen.native.js +1 -0
  486. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  487. package/build-module/mobile/gradient/index.native.js +1 -0
  488. package/build-module/mobile/gradient/index.native.js.map +1 -1
  489. package/build-module/mobile/media-edit/index.native.js +1 -0
  490. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  491. package/build-module/mobile/picker/index.android.js +1 -0
  492. package/build-module/mobile/picker/index.android.js.map +1 -1
  493. package/build-module/mobile/picker/index.ios.js +1 -0
  494. package/build-module/mobile/picker/index.ios.js.map +1 -1
  495. package/build-module/mobile/segmented-control/index.native.js +1 -0
  496. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  497. package/build-module/mobile/utils/get-px-from-css-unit.native.js +1 -0
  498. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  499. package/build-module/modal/aria-helper.js +0 -1
  500. package/build-module/modal/aria-helper.js.map +1 -1
  501. package/build-module/modal/index.js +0 -1
  502. package/build-module/modal/index.js.map +1 -1
  503. package/build-module/navigable-container/container.js +1 -0
  504. package/build-module/navigable-container/container.js.map +1 -1
  505. package/build-module/navigation/group/index.js +1 -0
  506. package/build-module/navigation/group/index.js.map +1 -1
  507. package/build-module/navigation/menu/menu-title-search.js +1 -0
  508. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  509. package/build-module/navigation/menu/search-no-results-found.js +1 -0
  510. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  511. package/build-module/navigation/styles/navigation-styles.js +12 -12
  512. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  513. package/build-module/navigator/navigator/component.js +1 -0
  514. package/build-module/navigator/navigator/component.js.map +1 -1
  515. package/build-module/navigator/navigator-screen/component.js +1 -0
  516. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  517. package/build-module/navigator/utils/router.js +1 -0
  518. package/build-module/navigator/utils/router.js.map +1 -1
  519. package/build-module/notice/index.js +1 -0
  520. package/build-module/notice/index.js.map +1 -1
  521. package/build-module/notice/list.js +1 -0
  522. package/build-module/notice/list.js.map +1 -1
  523. package/build-module/notice/list.native.js +1 -0
  524. package/build-module/notice/list.native.js.map +1 -1
  525. package/build-module/number-control/index.js +8 -0
  526. package/build-module/number-control/index.js.map +1 -1
  527. package/build-module/number-control/types.js.map +1 -1
  528. package/build-module/palette-edit/index.js +1 -0
  529. package/build-module/palette-edit/index.js.map +1 -1
  530. package/build-module/panel/actions.native.js +1 -0
  531. package/build-module/panel/actions.native.js.map +1 -1
  532. package/build-module/query-controls/index.js +1 -0
  533. package/build-module/query-controls/index.js.map +1 -1
  534. package/build-module/query-controls/terms.js +1 -0
  535. package/build-module/query-controls/terms.js.map +1 -1
  536. package/build-module/radio-control/index.js +1 -0
  537. package/build-module/radio-control/index.js.map +1 -1
  538. package/build-module/radio-control/index.native.js +1 -0
  539. package/build-module/radio-control/index.native.js.map +1 -1
  540. package/build-module/range-control/index.js +2 -1
  541. package/build-module/range-control/index.js.map +1 -1
  542. package/build-module/range-control/mark.js +0 -1
  543. package/build-module/range-control/mark.js.map +1 -1
  544. package/build-module/range-control/rail.js +1 -0
  545. package/build-module/range-control/rail.js.map +1 -1
  546. package/build-module/range-control/styles/range-control-styles.js +33 -45
  547. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  548. package/build-module/resizable-box/index.js +10 -1
  549. package/build-module/resizable-box/index.js.map +1 -1
  550. package/build-module/sandbox/index.js +1 -0
  551. package/build-module/sandbox/index.js.map +1 -1
  552. package/build-module/sandbox/index.native.js +1 -0
  553. package/build-module/sandbox/index.native.js.map +1 -1
  554. package/build-module/search-control/index.native.js +1 -0
  555. package/build-module/search-control/index.native.js.map +1 -1
  556. package/build-module/select-control/index.js +1 -0
  557. package/build-module/select-control/index.js.map +1 -1
  558. package/build-module/slot-fill/bubbles-virtually/fill.js +9 -13
  559. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  560. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +7 -10
  561. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  562. package/build-module/slot-fill/bubbles-virtually/slot.js +4 -10
  563. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  564. package/build-module/slot-fill/provider.js +1 -0
  565. package/build-module/slot-fill/provider.js.map +1 -1
  566. package/build-module/slot-fill/slot.js +1 -0
  567. package/build-module/slot-fill/slot.js.map +1 -1
  568. package/build-module/slot-fill/types.js.map +1 -1
  569. package/build-module/snackbar/index.js +1 -0
  570. package/build-module/snackbar/index.js.map +1 -1
  571. package/build-module/snackbar/list.js +1 -0
  572. package/build-module/snackbar/list.js.map +1 -1
  573. package/build-module/style-provider/index.js +0 -1
  574. package/build-module/style-provider/index.js.map +1 -1
  575. package/build-module/tab-panel/index.js +1 -0
  576. package/build-module/tab-panel/index.js.map +1 -1
  577. package/build-module/tabs/index.js +1 -0
  578. package/build-module/tabs/index.js.map +1 -1
  579. package/build-module/tabs/tab.js +0 -15
  580. package/build-module/tabs/tab.js.map +1 -1
  581. package/build-module/text/utils.js +1 -0
  582. package/build-module/text/utils.js.map +1 -1
  583. package/build-module/theme/color-algorithms.js +1 -0
  584. package/build-module/theme/color-algorithms.js.map +1 -1
  585. package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
  586. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  587. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
  588. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  589. package/build-module/toolbar/toolbar-button/index.js +2 -0
  590. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  591. package/build-module/toolbar/toolbar-group/index.js +1 -0
  592. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  593. package/build-module/tools-panel/tools-panel/component.js +2 -0
  594. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  595. package/build-module/tools-panel/tools-panel/hook.js +1 -0
  596. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  597. package/build-module/tools-panel/tools-panel-header/component.js +1 -0
  598. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  599. package/build-module/tree-grid/cell.js +4 -1
  600. package/build-module/tree-grid/cell.js.map +1 -1
  601. package/build-module/tree-grid/index.js +1 -0
  602. package/build-module/tree-grid/index.js.map +1 -1
  603. package/build-module/tree-grid/types.js.map +1 -1
  604. package/build-module/tree-select/index.js +1 -0
  605. package/build-module/tree-select/index.js.map +1 -1
  606. package/build-module/unit-control/index.js +11 -1
  607. package/build-module/unit-control/index.js.map +1 -1
  608. package/build-module/unit-control/index.native.js +1 -0
  609. package/build-module/unit-control/index.native.js.map +1 -1
  610. package/build-module/unit-control/types.js.map +1 -1
  611. package/build-module/unit-control/unit-select-control.js +1 -0
  612. package/build-module/unit-control/unit-select-control.js.map +1 -1
  613. package/build-module/unit-control/utils.js +1 -0
  614. package/build-module/unit-control/utils.js.map +1 -1
  615. package/build-module/utils/colors-values.js +3 -0
  616. package/build-module/utils/colors-values.js.map +1 -1
  617. package/build-module/utils/config-values.js +0 -1
  618. package/build-module/utils/config-values.js.map +1 -1
  619. package/build-module/utils/get-valid-children.js +1 -0
  620. package/build-module/utils/get-valid-children.js.map +1 -1
  621. package/build-module/utils/hooks/use-animated-offset-rect.js +1 -0
  622. package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -1
  623. package/build-module/utils/hooks/use-cx.js +1 -0
  624. package/build-module/utils/hooks/use-cx.js.map +1 -1
  625. package/build-module/utils/math.js +1 -0
  626. package/build-module/utils/math.js.map +1 -1
  627. package/build-module/utils/rtl.js +1 -0
  628. package/build-module/utils/rtl.js.map +1 -1
  629. package/build-module/utils/values.js +1 -0
  630. package/build-module/utils/values.js.map +1 -1
  631. package/build-module/z-stack/component.js +1 -0
  632. package/build-module/z-stack/component.js.map +1 -1
  633. package/build-style/style-rtl.css +15 -11
  634. package/build-style/style.css +15 -11
  635. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -1
  636. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  637. package/build-types/animation/index.d.ts +1 -1
  638. package/build-types/animation/index.d.ts.map +1 -1
  639. package/build-types/base-control/hooks.d.ts +4 -4
  640. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  641. package/build-types/border-box-control/border-box-control/hook.d.ts +83 -83
  642. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +93 -93
  643. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +83 -83
  644. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +83 -83
  645. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  646. package/build-types/border-control/border-control/hook.d.ts +83 -83
  647. package/build-types/border-control/border-control-dropdown/hook.d.ts +83 -83
  648. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  649. package/build-types/box-control/index.d.ts +14 -13
  650. package/build-types/box-control/index.d.ts.map +1 -1
  651. package/build-types/box-control/input-control.d.ts +3 -0
  652. package/build-types/box-control/input-control.d.ts.map +1 -0
  653. package/build-types/box-control/stories/index.story.d.ts +852 -816
  654. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  655. package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -1
  656. package/build-types/box-control/styles/box-control-styles.d.ts +3 -2
  657. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  658. package/build-types/box-control/types.d.ts +25 -3
  659. package/build-types/box-control/types.d.ts.map +1 -1
  660. package/build-types/box-control/utils.d.ts +23 -15
  661. package/build-types/box-control/utils.d.ts.map +1 -1
  662. package/build-types/button/stories/index.story.d.ts +18 -0
  663. package/build-types/button/stories/index.story.d.ts.map +1 -1
  664. package/build-types/button/types.d.ts +6 -4
  665. package/build-types/button/types.d.ts.map +1 -1
  666. package/build-types/card/card/hook.d.ts +83 -83
  667. package/build-types/card/card-body/hook.d.ts +83 -83
  668. package/build-types/card/card-divider/hook.d.ts +84 -84
  669. package/build-types/card/card-footer/hook.d.ts +83 -83
  670. package/build-types/card/card-header/hook.d.ts +83 -83
  671. package/build-types/card/card-media/hook.d.ts +83 -83
  672. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  673. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  674. package/build-types/clipboard-button/index.d.ts.map +1 -1
  675. package/build-types/color-picker/styles.d.ts +3 -2
  676. package/build-types/color-picker/styles.d.ts.map +1 -1
  677. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  678. package/build-types/composite/index.d.ts.map +1 -1
  679. package/build-types/composite/item.d.ts.map +1 -1
  680. package/build-types/context/constants.d.ts.map +1 -1
  681. package/build-types/context/get-styled-class-name-from-key.d.ts +1 -9
  682. package/build-types/context/get-styled-class-name-from-key.d.ts.map +1 -1
  683. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  684. package/build-types/custom-gradient-picker/index.d.ts +1 -1
  685. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  686. package/build-types/custom-gradient-picker/types.d.ts +6 -0
  687. package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
  688. package/build-types/custom-select-control/index.d.ts.map +1 -1
  689. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  690. package/build-types/custom-select-control/types.d.ts +7 -0
  691. package/build-types/custom-select-control/types.d.ts.map +1 -1
  692. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  693. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  694. package/build-types/date-time/date/styles.d.ts.map +1 -1
  695. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  696. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  697. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  698. package/build-types/date-time/time/styles.d.ts +8 -4
  699. package/build-types/date-time/time/styles.d.ts.map +1 -1
  700. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  701. package/build-types/drop-zone/index.d.ts +1 -1
  702. package/build-types/drop-zone/index.d.ts.map +1 -1
  703. package/build-types/drop-zone/types.d.ts +5 -0
  704. package/build-types/drop-zone/types.d.ts.map +1 -1
  705. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  706. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  707. package/build-types/elevation/hook.d.ts +83 -83
  708. package/build-types/flex/flex/hook.d.ts +83 -83
  709. package/build-types/flex/flex-block/hook.d.ts +83 -83
  710. package/build-types/flex/flex-item/hook.d.ts +83 -83
  711. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  712. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +2 -1
  713. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  714. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  715. package/build-types/font-size-picker/index.d.ts.map +1 -1
  716. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  717. package/build-types/form-file-upload/index.d.ts +2 -1
  718. package/build-types/form-file-upload/index.d.ts.map +1 -1
  719. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  720. package/build-types/form-file-upload/types.d.ts +10 -8
  721. package/build-types/form-file-upload/types.d.ts.map +1 -1
  722. package/build-types/form-token-field/index.d.ts.map +1 -1
  723. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  724. package/build-types/gradient-picker/index.d.ts +1 -1
  725. package/build-types/gradient-picker/index.d.ts.map +1 -1
  726. package/build-types/gradient-picker/types.d.ts +6 -0
  727. package/build-types/gradient-picker/types.d.ts.map +1 -1
  728. package/build-types/grid/hook.d.ts +83 -83
  729. package/build-types/h-stack/hook.d.ts +83 -83
  730. package/build-types/heading/hook.d.ts +82 -82
  731. package/build-types/higher-order/with-fallback-styles/index.d.ts +2 -2
  732. package/build-types/higher-order/with-filters/index.d.ts +4 -4
  733. package/build-types/icon/index.d.ts +23 -7
  734. package/build-types/icon/index.d.ts.map +1 -1
  735. package/build-types/icon/stories/index.story.d.ts +7 -1
  736. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  737. package/build-types/index.d.ts +1 -1
  738. package/build-types/index.d.ts.map +1 -1
  739. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  740. package/build-types/item-group/item/hook.d.ts +83 -83
  741. package/build-types/item-group/item-group/hook.d.ts +83 -83
  742. package/build-types/lock-unlock.d.ts +2 -2
  743. package/build-types/menu/checkbox-item.d.ts.map +1 -1
  744. package/build-types/menu/group-label.d.ts.map +1 -1
  745. package/build-types/menu/group.d.ts.map +1 -1
  746. package/build-types/menu/index.d.ts.map +1 -1
  747. package/build-types/menu/item-help-text.d.ts.map +1 -1
  748. package/build-types/menu/item-label.d.ts.map +1 -1
  749. package/build-types/menu/item.d.ts.map +1 -1
  750. package/build-types/menu/radio-item.d.ts.map +1 -1
  751. package/build-types/menu/separator.d.ts.map +1 -1
  752. package/build-types/menu/styles.d.ts.map +1 -1
  753. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  754. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  755. package/build-types/navigator/navigator-back-button/hook.d.ts +92 -92
  756. package/build-types/navigator/navigator-button/hook.d.ts +92 -92
  757. package/build-types/number-control/index.d.ts +2 -1
  758. package/build-types/number-control/index.d.ts.map +1 -1
  759. package/build-types/number-control/stories/index.story.d.ts +2 -1
  760. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  761. package/build-types/number-control/types.d.ts +7 -0
  762. package/build-types/number-control/types.d.ts.map +1 -1
  763. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  764. package/build-types/progress-bar/styles.d.ts.map +1 -1
  765. package/build-types/range-control/index.d.ts +1 -1
  766. package/build-types/range-control/index.d.ts.map +1 -1
  767. package/build-types/range-control/mark.d.ts.map +1 -1
  768. package/build-types/range-control/styles/range-control-styles.d.ts +4 -3
  769. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  770. package/build-types/resizable-box/index.d.ts.map +1 -1
  771. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  772. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  773. package/build-types/scrollable/hook.d.ts +83 -83
  774. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  775. package/build-types/select-control/index.d.ts.map +1 -1
  776. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  777. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  778. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  779. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  780. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  781. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
  782. package/build-types/slot-fill/types.d.ts +4 -3
  783. package/build-types/slot-fill/types.d.ts.map +1 -1
  784. package/build-types/spacer/hook.d.ts +83 -83
  785. package/build-types/spinner/styles.d.ts.map +1 -1
  786. package/build-types/surface/hook.d.ts +83 -83
  787. package/build-types/tabs/tab.d.ts +3 -0
  788. package/build-types/tabs/tab.d.ts.map +1 -1
  789. package/build-types/text/hook.d.ts +83 -83
  790. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  791. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  792. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  793. package/build-types/tools-panel/tools-panel/component.d.ts +2 -0
  794. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  795. package/build-types/tools-panel/tools-panel/hook.d.ts +83 -83
  796. package/build-types/tools-panel/tools-panel-header/hook.d.ts +83 -83
  797. package/build-types/tools-panel/tools-panel-item/hook.d.ts +83 -83
  798. package/build-types/tree-grid/cell.d.ts.map +1 -1
  799. package/build-types/tree-grid/types.d.ts +1 -1
  800. package/build-types/tree-grid/types.d.ts.map +1 -1
  801. package/build-types/truncate/hook.d.ts +83 -83
  802. package/build-types/unit-control/index.d.ts +3 -2
  803. package/build-types/unit-control/index.d.ts.map +1 -1
  804. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  805. package/build-types/unit-control/styles/unit-control-styles.d.ts +2 -1
  806. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  807. package/build-types/unit-control/types.d.ts +7 -0
  808. package/build-types/unit-control/types.d.ts.map +1 -1
  809. package/build-types/utils/colors-values.d.ts +3 -0
  810. package/build-types/utils/colors-values.d.ts.map +1 -1
  811. package/build-types/utils/config-values.d.ts +0 -1
  812. package/build-types/utils/hooks/use-controlled-state.d.ts +1 -1
  813. package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
  814. package/build-types/utils/rtl.d.ts +1 -1
  815. package/build-types/utils/rtl.d.ts.map +1 -1
  816. package/build-types/v-stack/hook.d.ts +83 -83
  817. package/build-types/z-stack/styles.d.ts.map +1 -1
  818. package/package.json +20 -20
  819. package/src/alignment-matrix-control/stories/index.story.tsx +2 -2
  820. package/src/angle-picker-control/index.tsx +1 -1
  821. package/src/angle-picker-control/stories/index.story.tsx +2 -2
  822. package/src/animation/index.tsx +0 -1
  823. package/src/base-control/stories/index.story.tsx +1 -1
  824. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -1
  825. package/src/border-box-control/stories/index.story.tsx +1 -1
  826. package/src/border-control/border-control/component.tsx +2 -0
  827. package/src/border-control/stories/index.story.tsx +1 -1
  828. package/src/box-control/README.md +80 -60
  829. package/src/box-control/docs-manifest.json +5 -0
  830. package/src/box-control/index.tsx +47 -29
  831. package/src/box-control/input-control.tsx +197 -0
  832. package/src/box-control/stories/index.story.tsx +2 -1
  833. package/src/box-control/test/index.tsx +33 -26
  834. package/src/box-control/types.ts +80 -55
  835. package/src/box-control/utils.ts +62 -60
  836. package/src/button/README.md +108 -219
  837. package/src/button/docs-manifest.json +5 -0
  838. package/src/button/stories/best-practices.mdx +31 -0
  839. package/src/button/stories/index.story.tsx +18 -0
  840. package/src/button/types.ts +6 -4
  841. package/src/button-group/stories/index.story.tsx +1 -1
  842. package/src/card/stories/index.story.tsx +2 -2
  843. package/src/checkbox-control/stories/index.story.tsx +1 -1
  844. package/src/circular-option-picker/circular-option-picker-actions.tsx +1 -0
  845. package/src/circular-option-picker/circular-option-picker-option.tsx +1 -0
  846. package/src/circular-option-picker/stories/index.story.tsx +2 -2
  847. package/src/circular-option-picker/style.scss +2 -2
  848. package/src/clipboard-button/index.tsx +5 -3
  849. package/src/color-palette/stories/index.story.tsx +3 -3
  850. package/src/color-picker/input-with-slider.tsx +1 -1
  851. package/src/color-picker/stories/index.story.tsx +2 -2
  852. package/src/combobox-control/stories/index.story.tsx +1 -1
  853. package/src/composite/item.tsx +1 -19
  854. package/src/composite/stories/index.story.tsx +3 -3
  855. package/src/confirm-dialog/stories/index.story.tsx +1 -1
  856. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +2 -0
  857. package/src/custom-gradient-picker/index.tsx +2 -0
  858. package/src/custom-gradient-picker/style.scss +1 -1
  859. package/src/custom-gradient-picker/types.ts +6 -0
  860. package/src/custom-select-control/README.md +2 -0
  861. package/src/custom-select-control/index.tsx +11 -2
  862. package/src/custom-select-control/stories/index.story.tsx +3 -2
  863. package/src/custom-select-control/test/index.tsx +13 -9
  864. package/src/custom-select-control/types.ts +7 -0
  865. package/src/custom-select-control-v2/stories/index.story.tsx +2 -2
  866. package/src/date-time/stories/date-time.story.tsx +4 -1
  867. package/src/date-time/stories/date.story.tsx +4 -1
  868. package/src/date-time/stories/time.story.tsx +4 -1
  869. package/src/dimension-control/stories/index.story.tsx +1 -1
  870. package/src/disabled/stories/index.story.tsx +3 -3
  871. package/src/divider/stories/index.story.tsx +1 -1
  872. package/src/draggable/stories/index.story.tsx +2 -2
  873. package/src/drop-zone/index.tsx +21 -24
  874. package/src/drop-zone/types.ts +5 -0
  875. package/src/dropdown/stories/index.story.tsx +7 -7
  876. package/src/dropdown-menu/index.tsx +4 -1
  877. package/src/dropdown-menu/stories/index.story.tsx +3 -3
  878. package/src/dropdown-menu/style.scss +1 -1
  879. package/src/duotone-picker/color-list-picker/index.tsx +8 -8
  880. package/src/duotone-picker/color-list-picker/style.scss +0 -6
  881. package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
  882. package/src/flex/stories/index.story.tsx +1 -1
  883. package/src/font-size-picker/font-size-picker-select.tsx +1 -0
  884. package/src/font-size-picker/index.tsx +1 -0
  885. package/src/font-size-picker/stories/index.story.tsx +1 -1
  886. package/src/form-file-upload/README.md +58 -48
  887. package/src/form-file-upload/docs-manifest.json +5 -0
  888. package/src/form-file-upload/index.tsx +12 -1
  889. package/src/form-file-upload/stories/index.story.tsx +4 -3
  890. package/src/form-file-upload/test/index.tsx +5 -1
  891. package/src/form-file-upload/types.ts +10 -8
  892. package/src/form-token-field/README.md +1 -0
  893. package/src/form-token-field/index.tsx +7 -0
  894. package/src/form-token-field/stories/index.story.tsx +4 -2
  895. package/src/form-token-field/test/index.tsx +5 -1
  896. package/src/gradient-picker/README.md +8 -0
  897. package/src/gradient-picker/index.tsx +2 -0
  898. package/src/gradient-picker/stories/index.story.tsx +1 -1
  899. package/src/gradient-picker/types.ts +6 -0
  900. package/src/grid/stories/index.story.tsx +1 -1
  901. package/src/h-stack/stories/index.story.tsx +2 -2
  902. package/src/icon/README.md +22 -65
  903. package/src/icon/docs-manifest.json +5 -0
  904. package/src/icon/index.tsx +28 -13
  905. package/src/icon/stories/index.story.tsx +50 -8
  906. package/src/index.ts +1 -5
  907. package/src/input-control/stories/index.story.tsx +4 -4
  908. package/src/item-group/stories/index.story.tsx +2 -2
  909. package/src/menu/checkbox-item.tsx +9 -7
  910. package/src/menu/group-label.tsx +8 -1
  911. package/src/menu/group.tsx +8 -1
  912. package/src/menu/item-help-text.tsx +10 -1
  913. package/src/menu/item-label.tsx +10 -1
  914. package/src/menu/item.tsx +8 -6
  915. package/src/menu/radio-item.tsx +9 -7
  916. package/src/menu/separator.tsx +9 -2
  917. package/src/menu/stories/index.story.tsx +2 -2
  918. package/src/menu/styles.ts +1 -1
  919. package/src/menu-group/stories/index.story.tsx +1 -1
  920. package/src/menu-item/stories/index.story.tsx +1 -1
  921. package/src/menu-items-choice/stories/index.story.tsx +1 -1
  922. package/src/menu-items-choice/style.scss +1 -0
  923. package/src/modal/stories/index.story.tsx +2 -2
  924. package/src/modal/test/index.tsx +2 -1
  925. package/src/navigable-container/stories/navigable-menu.story.tsx +1 -1
  926. package/src/navigable-container/stories/tabbable-container.story.tsx +1 -1
  927. package/src/navigation/stories/index.story.tsx +4 -4
  928. package/src/navigation/styles/navigation-styles.tsx +3 -2
  929. package/src/navigator/stories/index.story.tsx +3 -3
  930. package/src/number-control/README.md +2 -1
  931. package/src/number-control/index.tsx +9 -0
  932. package/src/number-control/stories/index.story.tsx +2 -1
  933. package/src/number-control/test/index.tsx +5 -1
  934. package/src/number-control/types.ts +7 -0
  935. package/src/panel/stories/index.story.tsx +1 -1
  936. package/src/placeholder/stories/index.story.tsx +3 -3
  937. package/src/popover/stories/index.story.tsx +11 -9
  938. package/src/query-controls/stories/index.story.tsx +6 -6
  939. package/src/radio-control/stories/index.story.tsx +1 -1
  940. package/src/radio-group/stories/index.story.tsx +3 -3
  941. package/src/range-control/index.tsx +1 -0
  942. package/src/range-control/mark.tsx +0 -1
  943. package/src/range-control/stories/index.story.tsx +7 -7
  944. package/src/range-control/styles/range-control-styles.ts +18 -19
  945. package/src/resizable-box/index.tsx +10 -0
  946. package/src/resizable-box/stories/index.story.tsx +1 -1
  947. package/src/resizable-box/style.scss +8 -0
  948. package/src/responsive-wrapper/stories/index.story.tsx +1 -1
  949. package/src/sandbox/stories/index.story.tsx +1 -1
  950. package/src/scrollable/stories/index.story.tsx +2 -1
  951. package/src/search-control/stories/index.story.tsx +1 -1
  952. package/src/select-control/stories/index.story.tsx +1 -1
  953. package/src/slot-fill/bubbles-virtually/fill.tsx +7 -11
  954. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +2 -13
  955. package/src/slot-fill/bubbles-virtually/slot.tsx +4 -7
  956. package/src/slot-fill/stories/index.story.tsx +2 -2
  957. package/src/slot-fill/types.ts +4 -3
  958. package/src/snackbar/stories/index.story.tsx +4 -4
  959. package/src/snackbar/stories/list.story.tsx +2 -2
  960. package/src/surface/stories/index.story.tsx +1 -1
  961. package/src/tabs/tab.tsx +0 -18
  962. package/src/tabs/test/index.tsx +1492 -947
  963. package/src/text-control/stories/index.story.tsx +1 -1
  964. package/src/textarea-control/stories/index.story.tsx +1 -1
  965. package/src/theme/stories/index.story.tsx +1 -1
  966. package/src/toggle-control/stories/index.story.tsx +1 -1
  967. package/src/toggle-group-control/stories/index.story.tsx +1 -1
  968. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +22 -22
  969. package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
  970. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +6 -6
  971. package/src/toolbar/stories/index.story.tsx +1 -1
  972. package/src/toolbar/toolbar-button/index.tsx +2 -0
  973. package/src/tools-panel/stories/index.story.tsx +15 -3
  974. package/src/tools-panel/test/index.tsx +0 -17
  975. package/src/tools-panel/tools-panel/README.md +4 -0
  976. package/src/tools-panel/tools-panel/component.tsx +2 -0
  977. package/src/tooltip/stories/index.story.tsx +1 -1
  978. package/src/tree-grid/cell.tsx +5 -1
  979. package/src/tree-grid/stories/index.story.tsx +1 -1
  980. package/src/tree-grid/types.ts +1 -1
  981. package/src/tree-select/stories/index.story.tsx +1 -1
  982. package/src/unit-control/README.md +3 -3
  983. package/src/unit-control/index.tsx +11 -1
  984. package/src/unit-control/stories/index.story.tsx +5 -4
  985. package/src/unit-control/test/index.tsx +5 -1
  986. package/src/unit-control/types.ts +7 -0
  987. package/src/utils/colors-values.js +3 -0
  988. package/src/utils/config-values.js +0 -1
  989. package/src/view/stories/index.story.tsx +1 -1
  990. package/src/visually-hidden/stories/index.story.tsx +1 -1
  991. package/src/z-stack/stories/index.story.tsx +1 -1
  992. package/tsconfig.tsbuildinfo +1 -1
  993. package/build/box-control/all-input-control.js +0 -90
  994. package/build/box-control/all-input-control.js.map +0 -1
  995. package/build/box-control/axial-input-controls.js +0 -124
  996. package/build/box-control/axial-input-controls.js.map +0 -1
  997. package/build/box-control/input-controls.js +0 -132
  998. package/build/box-control/input-controls.js.map +0 -1
  999. package/build/menu/use-temporary-focus-visible-fix.js +0 -27
  1000. package/build/menu/use-temporary-focus-visible-fix.js.map +0 -1
  1001. package/build-module/box-control/all-input-control.js +0 -83
  1002. package/build-module/box-control/all-input-control.js.map +0 -1
  1003. package/build-module/box-control/axial-input-controls.js +0 -115
  1004. package/build-module/box-control/axial-input-controls.js.map +0 -1
  1005. package/build-module/box-control/input-controls.js +0 -123
  1006. package/build-module/box-control/input-controls.js.map +0 -1
  1007. package/build-module/menu/use-temporary-focus-visible-fix.js +0 -20
  1008. package/build-module/menu/use-temporary-focus-visible-fix.js.map +0 -1
  1009. package/build-types/box-control/all-input-control.d.ts +0 -3
  1010. package/build-types/box-control/all-input-control.d.ts.map +0 -1
  1011. package/build-types/box-control/axial-input-controls.d.ts +0 -3
  1012. package/build-types/box-control/axial-input-controls.d.ts.map +0 -1
  1013. package/build-types/box-control/input-controls.d.ts +0 -3
  1014. package/build-types/box-control/input-controls.d.ts.map +0 -1
  1015. package/build-types/menu/use-temporary-focus-visible-fix.d.ts +0 -8
  1016. package/build-types/menu/use-temporary-focus-visible-fix.d.ts.map +0 -1
  1017. package/src/box-control/all-input-control.tsx +0 -109
  1018. package/src/box-control/axial-input-controls.tsx +0 -164
  1019. package/src/box-control/input-controls.tsx +0 -166
  1020. package/src/menu/use-temporary-focus-visible-fix.ts +0 -22
@@ -0,0 +1,161 @@
1
+ /* wp:polyfill */
2
+ "use strict";
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = BoxInputControl;
9
+ var _compose = require("@wordpress/compose");
10
+ var _i18n = require("@wordpress/i18n");
11
+ var _tooltip = _interopRequireDefault(require("../tooltip"));
12
+ var _utils = require("../unit-control/utils");
13
+ var _utils2 = require("./utils");
14
+ var _boxControlStyles = require("./styles/box-control-styles");
15
+ var _jsxRuntime = require("react/jsx-runtime");
16
+ /**
17
+ * WordPress dependencies
18
+ */
19
+
20
+ /**
21
+ * Internal dependencies
22
+ */
23
+
24
+ const noop = () => {};
25
+ function getSidesToModify(side, sides, isAlt) {
26
+ const allowedSides = (0, _utils2.getAllowedSides)(sides);
27
+ let modifiedSides = [];
28
+ switch (side) {
29
+ case 'all':
30
+ modifiedSides = ['top', 'bottom', 'left', 'right'];
31
+ break;
32
+ case 'horizontal':
33
+ modifiedSides = ['left', 'right'];
34
+ break;
35
+ case 'vertical':
36
+ modifiedSides = ['top', 'bottom'];
37
+ break;
38
+ default:
39
+ modifiedSides = [side];
40
+ }
41
+ if (isAlt) {
42
+ switch (side) {
43
+ case 'top':
44
+ modifiedSides.push('bottom');
45
+ break;
46
+ case 'bottom':
47
+ modifiedSides.push('top');
48
+ break;
49
+ case 'left':
50
+ modifiedSides.push('left');
51
+ break;
52
+ case 'right':
53
+ modifiedSides.push('right');
54
+ break;
55
+ }
56
+ }
57
+ return modifiedSides.filter(s => allowedSides.has(s));
58
+ }
59
+ function BoxInputControl({
60
+ __next40pxDefaultSize,
61
+ onChange = noop,
62
+ onFocus = noop,
63
+ values,
64
+ selectedUnits,
65
+ setSelectedUnits,
66
+ sides,
67
+ side,
68
+ ...props
69
+ }) {
70
+ var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2;
71
+ const defaultValuesToModify = getSidesToModify(side, sides);
72
+ const handleOnFocus = event => {
73
+ onFocus(event, {
74
+ side
75
+ });
76
+ };
77
+ const handleOnChange = nextValues => {
78
+ onChange(nextValues);
79
+ };
80
+ const handleOnValueChange = (next, extra) => {
81
+ const nextValues = {
82
+ ...values
83
+ };
84
+ const isNumeric = next !== undefined && !isNaN(parseFloat(next));
85
+ const nextValue = isNumeric ? next : undefined;
86
+ const modifiedSides = getSidesToModify(side, sides,
87
+ /**
88
+ * Supports changing pair sides. For example, holding the ALT key
89
+ * when changing the TOP will also update BOTTOM.
90
+ */
91
+ // @ts-expect-error - TODO: event.altKey is only present when the change event was
92
+ // triggered by a keyboard event. Should this feature be implemented differently so
93
+ // it also works with drag events?
94
+ !!extra?.event.altKey);
95
+ modifiedSides.forEach(modifiedSide => {
96
+ nextValues[modifiedSide] = nextValue;
97
+ });
98
+ handleOnChange(nextValues);
99
+ };
100
+ const handleOnUnitChange = next => {
101
+ const newUnits = {
102
+ ...selectedUnits
103
+ };
104
+ defaultValuesToModify.forEach(modifiedSide => {
105
+ newUnits[modifiedSide] = next;
106
+ });
107
+ setSelectedUnits(newUnits);
108
+ };
109
+ const mergedValue = (0, _utils2.getMergedValue)(values, defaultValuesToModify);
110
+ const hasValues = (0, _utils2.isValuesDefined)(values);
111
+ const isMixed = hasValues && defaultValuesToModify.length > 1 && (0, _utils2.isValueMixed)(values, defaultValuesToModify);
112
+ const [parsedQuantity, parsedUnit] = (0, _utils.parseQuantityAndUnitFromRawValue)(mergedValue);
113
+ const computedUnit = hasValues ? parsedUnit : selectedUnits[defaultValuesToModify[0]];
114
+ const generatedId = (0, _compose.useInstanceId)(BoxInputControl, 'box-control-input');
115
+ const inputId = [generatedId, side].join('-');
116
+ const isMixedUnit = defaultValuesToModify.length > 1 && mergedValue === undefined && defaultValuesToModify.some(s => selectedUnits[s] !== computedUnit);
117
+ const usedValue = mergedValue === undefined && computedUnit ? computedUnit : mergedValue;
118
+ const mixedPlaceholder = isMixed || isMixedUnit ? (0, _i18n.__)('Mixed') : undefined;
119
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_boxControlStyles.InputWrapper, {
120
+ expanded: true,
121
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.FlexedBoxControlIcon, {
122
+ side: side,
123
+ sides: sides
124
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.default, {
125
+ placement: "top-end",
126
+ text: _utils2.LABELS[side],
127
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.StyledUnitControl, {
128
+ ...props,
129
+ __shouldNotWarnDeprecated36pxSize: true,
130
+ __next40pxDefaultSize: __next40pxDefaultSize,
131
+ className: "component-box-control__unit-control",
132
+ id: inputId,
133
+ isPressEnterToChange: true,
134
+ disableUnits: isMixed || isMixedUnit,
135
+ value: usedValue,
136
+ onChange: handleOnValueChange,
137
+ onUnitChange: handleOnUnitChange,
138
+ onFocus: handleOnFocus,
139
+ label: _utils2.LABELS[side],
140
+ placeholder: mixedPlaceholder,
141
+ hideLabelFromVision: true
142
+ })
143
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.FlexedRangeControl, {
144
+ __nextHasNoMarginBottom: true,
145
+ __next40pxDefaultSize: __next40pxDefaultSize,
146
+ __shouldNotWarnDeprecated36pxSize: true,
147
+ "aria-controls": inputId,
148
+ label: _utils2.LABELS[side],
149
+ hideLabelFromVision: true,
150
+ onChange: newValue => {
151
+ handleOnValueChange(newValue !== undefined ? [newValue, computedUnit].join('') : undefined);
152
+ },
153
+ min: 0,
154
+ max: (_CUSTOM_VALUE_SETTING = _utils2.CUSTOM_VALUE_SETTINGS[computedUnit !== null && computedUnit !== void 0 ? computedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10,
155
+ step: (_CUSTOM_VALUE_SETTING2 = _utils2.CUSTOM_VALUE_SETTINGS[computedUnit !== null && computedUnit !== void 0 ? computedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1,
156
+ value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0,
157
+ withInputField: false
158
+ })]
159
+ }, `box-control-${side}`);
160
+ }
161
+ //# sourceMappingURL=input-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_compose","require","_i18n","_tooltip","_interopRequireDefault","_utils","_utils2","_boxControlStyles","_jsxRuntime","noop","getSidesToModify","side","sides","isAlt","allowedSides","getAllowedSides","modifiedSides","push","filter","s","has","BoxInputControl","__next40pxDefaultSize","onChange","onFocus","values","selectedUnits","setSelectedUnits","props","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","defaultValuesToModify","handleOnFocus","event","handleOnChange","nextValues","handleOnValueChange","next","extra","isNumeric","undefined","isNaN","parseFloat","nextValue","altKey","forEach","modifiedSide","handleOnUnitChange","newUnits","mergedValue","getMergedValue","hasValues","isValuesDefined","isMixed","length","isValueMixed","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","computedUnit","generatedId","useInstanceId","inputId","join","isMixedUnit","some","usedValue","mixedPlaceholder","__","jsxs","InputWrapper","expanded","children","jsx","FlexedBoxControlIcon","default","placement","text","LABELS","StyledUnitControl","__shouldNotWarnDeprecated36pxSize","className","id","isPressEnterToChange","disableUnits","value","onUnitChange","label","placeholder","hideLabelFromVision","FlexedRangeControl","__nextHasNoMarginBottom","newValue","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/input-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport {\n\tCUSTOM_VALUE_SETTINGS,\n\tgetAllowedSides,\n\tgetMergedValue,\n\tisValueMixed,\n\tisValuesDefined,\n\tLABELS,\n} from './utils';\nimport {\n\tFlexedBoxControlIcon,\n\tFlexedRangeControl,\n\tInputWrapper,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps, BoxControlValue } from './types';\n\nconst noop = () => {};\n\nfunction getSidesToModify(\n\tside: BoxControlInputControlProps[ 'side' ],\n\tsides: BoxControlInputControlProps[ 'sides' ],\n\tisAlt?: boolean\n) {\n\tconst allowedSides = getAllowedSides( sides );\n\n\tlet modifiedSides: ( keyof BoxControlValue )[] = [];\n\tswitch ( side ) {\n\t\tcase 'all':\n\t\t\tmodifiedSides = [ 'top', 'bottom', 'left', 'right' ];\n\t\t\tbreak;\n\t\tcase 'horizontal':\n\t\t\tmodifiedSides = [ 'left', 'right' ];\n\t\t\tbreak;\n\t\tcase 'vertical':\n\t\t\tmodifiedSides = [ 'top', 'bottom' ];\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tmodifiedSides = [ side ];\n\t}\n\n\tif ( isAlt ) {\n\t\tswitch ( side ) {\n\t\t\tcase 'top':\n\t\t\t\tmodifiedSides.push( 'bottom' );\n\t\t\t\tbreak;\n\t\t\tcase 'bottom':\n\t\t\t\tmodifiedSides.push( 'top' );\n\t\t\t\tbreak;\n\t\t\tcase 'left':\n\t\t\t\tmodifiedSides.push( 'left' );\n\t\t\t\tbreak;\n\t\t\tcase 'right':\n\t\t\t\tmodifiedSides.push( 'right' );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn modifiedSides.filter( ( s ) => allowedSides.has( s ) );\n}\n\nexport default function BoxInputControl( {\n\t__next40pxDefaultSize,\n\tonChange = noop,\n\tonFocus = noop,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\tside,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst defaultValuesToModify = getSidesToModify( side, sides );\n\n\tconst handleOnFocus = ( event: React.FocusEvent< HTMLInputElement > ) => {\n\t\tonFocus( event, { side } );\n\t};\n\n\tconst handleOnChange = ( nextValues: BoxControlValue ) => {\n\t\tonChange( nextValues );\n\t};\n\n\tconst handleOnValueChange = (\n\t\tnext?: string,\n\t\textra?: { event: React.SyntheticEvent< Element, Event > }\n\t) => {\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\t\tconst modifiedSides = getSidesToModify(\n\t\t\tside,\n\t\t\tsides,\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\t// @ts-expect-error - TODO: event.altKey is only present when the change event was\n\t\t\t// triggered by a keyboard event. Should this feature be implemented differently so\n\t\t\t// it also works with drag events?\n\t\t\t!! extra?.event.altKey\n\t\t);\n\n\t\tmodifiedSides.forEach( ( modifiedSide ) => {\n\t\t\tnextValues[ modifiedSide ] = nextValue;\n\t\t} );\n\n\t\thandleOnChange( nextValues );\n\t};\n\n\tconst handleOnUnitChange = ( next?: string ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\t\tdefaultValuesToModify.forEach( ( modifiedSide ) => {\n\t\t\tnewUnits[ modifiedSide ] = next;\n\t\t} );\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\tconst mergedValue = getMergedValue( values, defaultValuesToModify );\n\tconst hasValues = isValuesDefined( values );\n\tconst isMixed =\n\t\thasValues &&\n\t\tdefaultValuesToModify.length > 1 &&\n\t\tisValueMixed( values, defaultValuesToModify );\n\tconst [ parsedQuantity, parsedUnit ] =\n\t\tparseQuantityAndUnitFromRawValue( mergedValue );\n\tconst computedUnit = hasValues\n\t\t? parsedUnit\n\t\t: selectedUnits[ defaultValuesToModify[ 0 ] ];\n\tconst generatedId = useInstanceId( BoxInputControl, 'box-control-input' );\n\tconst inputId = [ generatedId, side ].join( '-' );\n\tconst isMixedUnit =\n\t\tdefaultValuesToModify.length > 1 &&\n\t\tmergedValue === undefined &&\n\t\tdefaultValuesToModify.some(\n\t\t\t( s ) => selectedUnits[ s ] !== computedUnit\n\t\t);\n\tconst usedValue =\n\t\tmergedValue === undefined && computedUnit ? computedUnit : mergedValue;\n\tconst mixedPlaceholder = isMixed || isMixedUnit ? __( 'Mixed' ) : undefined;\n\n\treturn (\n\t\t<InputWrapper key={ `box-control-${ side }` } expanded>\n\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t<Tooltip placement=\"top-end\" text={ LABELS[ side ] }>\n\t\t\t\t<StyledUnitControl\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\tid={ inputId }\n\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\tdisableUnits={ isMixed || isMixedUnit }\n\t\t\t\t\tvalue={ usedValue }\n\t\t\t\t\tonChange={ handleOnValueChange }\n\t\t\t\t\tonUnitChange={ handleOnUnitChange }\n\t\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\tplaceholder={ mixedPlaceholder }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\n\t\t\t<FlexedRangeControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\taria-controls={ inputId }\n\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\thideLabelFromVision\n\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t\t\t? [ newValue, computedUnit ].join( '' )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t\tmin={ 0 }\n\t\t\t\tmax={ CUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]?.max ?? 10 }\n\t\t\t\tstep={\n\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]?.step ?? 0.1\n\t\t\t\t}\n\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\twithInputField={ false }\n\t\t\t/>\n\t\t</InputWrapper>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAQA,IAAAM,iBAAA,GAAAN,OAAA;AAKqC,IAAAO,WAAA,GAAAP,OAAA;AAxBrC;AACA;AACA;;AAIA;AACA;AACA;;AAmBA,MAAMQ,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,gBAAgBA,CACxBC,IAA2C,EAC3C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AgBtF,IAAI,EA2C1B,CAAC;AAEjB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/box-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { UnitControlProps } from '../unit-control/types';\nimport type { LABELS } from './utils';\n\nexport type BoxControlValue = {\n\ttop?: string;\n\tright?: string;\n\tbottom?: string;\n\tleft?: string;\n};\n\nexport type CustomValueUnits = {\n\t[ key: string ]: { max: number; step: number };\n};\n\ntype UnitControlPassthroughProps = Omit<\n\tUnitControlProps,\n\t'label' | 'onChange' | 'onFocus' | 'onMouseOver' | 'onMouseOut' | 'units'\n>;\n\nexport type BoxControlProps = Pick<\n\tUnitControlProps,\n\t'onMouseOver' | 'onMouseOut' | 'units'\n> & {\n\t/**\n\t * If this property is true, a button to reset the box control is rendered.\n\t *\n\t * @default true\n\t */\n\tallowReset?: boolean;\n\t/**\n\t * The id to use as a base for the unique HTML id attribute of the control.\n\t */\n\tid?: string;\n\t/**\n\t * Props for the internal `UnitControl` components.\n\t *\n\t * @default { min: 0 }\n\t */\n\tinputProps?: UnitControlPassthroughProps;\n\t/**\n\t * Heading label for the control.\n\t *\n\t * @default __( 'Box Control' )\n\t */\n\tlabel?: string;\n\t/**\n\t * A callback function when an input value changes.\n\t */\n\tonChange: ( next: BoxControlValue ) => void;\n\t/**\n\t * The `top`, `right`, `bottom`, and `left` box dimension values to use when the control is reset.\n\t *\n\t * @default { top: undefined, right: undefined, bottom: undefined, left: undefined }\n\t */\n\tresetValues?: BoxControlValue;\n\t/**\n\t * Collection of sides to allow control of. If omitted or empty, all sides will be available.\n\t */\n\tsides?: readonly ( keyof BoxControlValue | 'horizontal' | 'vertical' )[];\n\t/**\n\t * If this property is true, when the box control is unlinked, vertical and horizontal controls\n\t * can be used instead of updating individual sides.\n\t *\n\t * @default false\n\t */\n\tsplitOnAxis?: boolean;\n\t/**\n\t * The current values of the control, expressed as an object of `top`, `right`, `bottom`, and `left` values.\n\t */\n\tvalues?: BoxControlValue;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n};\n\nexport type BoxControlInputControlProps = UnitControlPassthroughProps & {\n\tonChange?: ( nextValues: BoxControlValue ) => void;\n\tonFocus?: (\n\t\t_event: React.FocusEvent< HTMLInputElement >,\n\t\t{ side }: { side: keyof typeof LABELS }\n\t) => void;\n\tonHoverOff?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tonHoverOn?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tselectedUnits: BoxControlValue;\n\tsetSelectedUnits: React.Dispatch< React.SetStateAction< BoxControlValue > >;\n\tsides: BoxControlProps[ 'sides' ];\n\tvalues: BoxControlValue;\n};\n\nexport type BoxControlIconProps = {\n\t/**\n\t * @default 24\n\t */\n\tsize?: number;\n\t/**\n\t * @default 'all'\n\t */\n\tside?: keyof typeof LABELS;\n\tsides?: BoxControlProps[ 'sides' ];\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/box-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { UnitControlProps } from '../unit-control/types';\nimport type { LABELS } from './utils';\n\nexport type BoxControlValue = {\n\ttop?: string;\n\tright?: string;\n\tbottom?: string;\n\tleft?: string;\n};\n\nexport type CustomValueUnits = {\n\t[ key: string ]: { max: number; step: number };\n};\n\ntype UnitControlPassthroughProps = Omit<\n\tUnitControlProps,\n\t'label' | 'onChange' | 'onFocus' | 'units'\n>;\n\ntype DeprecatedBoxControlProps = {\n\t/**\n\t * @deprecated Pass to the `inputProps` prop instead.\n\t * @ignore\n\t */\n\tonMouseOver?: UnitControlProps[ 'onMouseOver' ];\n\t/**\n\t * @deprecated Pass to the `inputProps` prop instead.\n\t * @ignore\n\t */\n\tonMouseOut?: UnitControlProps[ 'onMouseOut' ];\n};\n\nexport type BoxControlProps = Pick< UnitControlProps, 'units' > &\n\tDeprecatedBoxControlProps & {\n\t\t/**\n\t\t * If this property is true, a button to reset the box control is rendered.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tallowReset?: boolean;\n\t\t/**\n\t\t * The id to use as a base for the unique HTML id attribute of the control.\n\t\t */\n\t\tid?: string;\n\t\t/**\n\t\t * Props for the internal `UnitControl` components.\n\t\t *\n\t\t * @default { min: 0 }\n\t\t */\n\t\tinputProps?: UnitControlPassthroughProps;\n\t\t/**\n\t\t * Heading label for the control.\n\t\t *\n\t\t * @default __( 'Box Control' )\n\t\t */\n\t\tlabel?: string;\n\t\t/**\n\t\t * A callback function when an input value changes.\n\t\t */\n\t\tonChange: ( next: BoxControlValue ) => void;\n\t\t/**\n\t\t * The `top`, `right`, `bottom`, and `left` box dimension values to use when the control is reset.\n\t\t *\n\t\t * @default { top: undefined, right: undefined, bottom: undefined, left: undefined }\n\t\t */\n\t\tresetValues?: BoxControlValue;\n\t\t/**\n\t\t * Collection of sides to allow control of. If omitted or empty, all sides will be available.\n\t\t *\n\t\t * Allowed values are \"top\", \"right\", \"bottom\", \"left\", \"vertical\", and \"horizontal\".\n\t\t */\n\t\tsides?: readonly (\n\t\t\t| keyof BoxControlValue\n\t\t\t| 'horizontal'\n\t\t\t| 'vertical'\n\t\t)[];\n\t\t/**\n\t\t * If this property is true, when the box control is unlinked, vertical and horizontal controls\n\t\t * can be used instead of updating individual sides.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\tsplitOnAxis?: boolean;\n\t\t/**\n\t\t * The current values of the control, expressed as an object of `top`, `right`, `bottom`, and `left` values.\n\t\t */\n\t\tvalues?: BoxControlValue;\n\t\t/**\n\t\t * Start opting into the larger default height that will become the default size in a future version.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\t__next40pxDefaultSize?: boolean;\n\t};\n\nexport type BoxControlInputControlProps = UnitControlPassthroughProps & {\n\tonChange?: ( nextValues: BoxControlValue ) => void;\n\tonFocus?: (\n\t\t_event: React.FocusEvent< HTMLInputElement >,\n\t\t{ side }: { side: keyof typeof LABELS }\n\t) => void;\n\tonHoverOff?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tonHoverOn?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tselectedUnits: BoxControlValue;\n\tsetSelectedUnits: React.Dispatch< React.SetStateAction< BoxControlValue > >;\n\tvalues: BoxControlValue;\n\t/**\n\t * Collection of sides to allow control of. If omitted or empty, all sides will be available.\n\t */\n\tsides: BoxControlProps[ 'sides' ];\n\t/**\n\t * Side represents the current side being rendered by the input.\n\t * It can be a concrete side like: left, right, top, bottom or a combined one like: horizontal, vertical.\n\t */\n\tside: keyof typeof LABELS;\n};\n\nexport type BoxControlIconProps = {\n\t/**\n\t * @default 24\n\t */\n\tsize?: number;\n\t/**\n\t * @default 'all'\n\t */\n\tside?: keyof typeof LABELS;\n\tsides?: BoxControlProps[ 'sides' ];\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,18 +1,21 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.LABELS = exports.DEFAULT_VALUES = exports.CUSTOM_VALUE_SETTINGS = exports.ALL_SIDES = void 0;
7
9
  exports.applyValueToSides = applyValueToSides;
8
10
  exports.getAllUnitFallback = getAllUnitFallback;
9
- exports.getAllValue = getAllValue;
11
+ exports.getAllowedSides = getAllowedSides;
10
12
  exports.getInitialSide = getInitialSide;
13
+ exports.getMergedValue = getMergedValue;
14
+ exports.isValueMixed = isValueMixed;
11
15
  exports.isValuesDefined = isValuesDefined;
12
- exports.isValuesMixed = isValuesMixed;
13
16
  exports.normalizeSides = normalizeSides;
14
17
  var _i18n = require("@wordpress/i18n");
15
- var _utils = require("../unit-control/utils");
18
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
16
19
  /**
17
20
  * WordPress dependencies
18
21
  */
@@ -141,7 +144,6 @@ const LABELS = exports.LABELS = {
141
144
  bottom: (0, _i18n.__)('Bottom side'),
142
145
  left: (0, _i18n.__)('Left side'),
143
146
  right: (0, _i18n.__)('Right side'),
144
- mixed: (0, _i18n.__)('Mixed'),
145
147
  vertical: (0, _i18n.__)('Top and bottom sides'),
146
148
  horizontal: (0, _i18n.__)('Left and right sides')
147
149
  };
@@ -165,43 +167,31 @@ function mode(arr) {
165
167
  }
166
168
 
167
169
  /**
168
- * Gets the 'all' input value and unit from values data.
170
+ * Gets the merged input value and unit from values data.
169
171
  *
170
172
  * @param values Box values.
171
- * @param selectedUnits Box units.
172
173
  * @param availableSides Available box sides to evaluate.
173
174
  *
174
175
  * @return A value + unit for the 'all' input.
175
176
  */
176
- function getAllValue(values = {}, selectedUnits, availableSides = ALL_SIDES) {
177
+ function getMergedValue(values = {}, availableSides = ALL_SIDES) {
177
178
  const sides = normalizeSides(availableSides);
178
- const parsedQuantitiesAndUnits = sides.map(side => (0, _utils.parseQuantityAndUnitFromRawValue)(values[side]));
179
- const allParsedQuantities = parsedQuantitiesAndUnits.map(value => {
180
- var _value$;
181
- return (_value$ = value[0]) !== null && _value$ !== void 0 ? _value$ : '';
182
- });
183
- const allParsedUnits = parsedQuantitiesAndUnits.map(value => value[1]);
184
- const commonQuantity = allParsedQuantities.every(v => v === allParsedQuantities[0]) ? allParsedQuantities[0] : '';
185
-
186
- /**
187
- * The typeof === 'number' check is important. On reset actions, the incoming value
188
- * may be null or an empty string.
189
- *
190
- * Also, the value may also be zero (0), which is considered a valid unit value.
191
- *
192
- * typeof === 'number' is more specific for these cases, rather than relying on a
193
- * simple truthy check.
194
- */
195
- let commonUnit;
196
- if (typeof commonQuantity === 'number') {
197
- commonUnit = mode(allParsedUnits);
198
- } else {
199
- var _getAllUnitFallback;
200
- // Set meaningful unit selection if no commonQuantity and user has previously
201
- // selected units without assigning values while controls were unlinked.
202
- commonUnit = (_getAllUnitFallback = getAllUnitFallback(selectedUnits)) !== null && _getAllUnitFallback !== void 0 ? _getAllUnitFallback : mode(allParsedUnits);
179
+ if (sides.every(side => values[side] === values[sides[0]])) {
180
+ return values[sides[0]];
203
181
  }
204
- return [commonQuantity, commonUnit].join('');
182
+ return undefined;
183
+ }
184
+
185
+ /**
186
+ * Checks if the values are mixed.
187
+ *
188
+ * @param values Box values.
189
+ * @param availableSides Available box sides to evaluate.
190
+ * @return Whether the values are mixed.
191
+ */
192
+ function isValueMixed(values = {}, availableSides = ALL_SIDES) {
193
+ const sides = normalizeSides(availableSides);
194
+ return sides.some(side => values[side] !== values[sides[0]]);
205
195
  }
206
196
 
207
197
  /**
@@ -218,21 +208,6 @@ function getAllUnitFallback(selectedUnits) {
218
208
  return mode(filteredUnits);
219
209
  }
220
210
 
221
- /**
222
- * Checks to determine if values are mixed.
223
- *
224
- * @param values Box values.
225
- * @param selectedUnits Box units.
226
- * @param sides Available box sides to evaluate.
227
- *
228
- * @return Whether values are mixed.
229
- */
230
- function isValuesMixed(values = {}, selectedUnits, sides = ALL_SIDES) {
231
- const allValue = getAllValue(values, selectedUnits, sides);
232
- const isMixed = isNaN(parseFloat(allValue));
233
- return isMixed;
234
- }
235
-
236
211
  /**
237
212
  * Checks to determine if values are defined.
238
213
  *
@@ -293,6 +268,8 @@ function normalizeSides(sides) {
293
268
  * Applies a value to an object representing top, right, bottom and left sides
294
269
  * while taking into account any custom side configuration.
295
270
  *
271
+ * @deprecated
272
+ *
296
273
  * @param currentValues The current values for each side.
297
274
  * @param newValue The value to apply to the sides object.
298
275
  * @param sides Array defining valid sides.
@@ -300,6 +277,10 @@ function normalizeSides(sides) {
300
277
  * @return Object containing the updated values for each side.
301
278
  */
302
279
  function applyValueToSides(currentValues, newValue, sides) {
280
+ (0, _deprecated.default)('applyValueToSides', {
281
+ since: '6.8',
282
+ version: '7.0'
283
+ });
303
284
  const newValues = {
304
285
  ...currentValues
305
286
  };
@@ -320,4 +301,26 @@ function applyValueToSides(currentValues, newValue, sides) {
320
301
  }
321
302
  return newValues;
322
303
  }
304
+
305
+ /**
306
+ * Return the allowed sides based on the sides configuration.
307
+ *
308
+ * @param sides Sides configuration.
309
+ * @return Allowed sides.
310
+ */
311
+ function getAllowedSides(sides) {
312
+ const allowedSides = new Set(!sides ? ALL_SIDES : []);
313
+ sides?.forEach(allowedSide => {
314
+ if (allowedSide === 'vertical') {
315
+ allowedSides.add('top');
316
+ allowedSides.add('bottom');
317
+ } else if (allowedSide === 'horizontal') {
318
+ allowedSides.add('right');
319
+ allowedSides.add('left');
320
+ } else {
321
+ allowedSides.add(allowedSide);
322
+ }
323
+ });
324
+ return allowedSides;
325
+ }
323
326
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_utils","CUSTOM_VALUE_SETTINGS","exports","px","max","step","vw","vh","em","rm","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","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","parseQuantityAndUnitFromRawValue","allParsedQuantities","value","_value$","allParsedUnits","commonQuantity","every","commonUnit","_getAllUnitFallback","getAllUnitFallback","join","filteredUnits","Object","Boolean","isValuesMixed","allValue","isMixed","isNaN","parseFloat","isValuesDefined","test","getInitialSide","isLinked","splitOnAxis","initialSide","filteredSides","includes","push","newSides","applyValueToSides","currentValues","newValue","newValues","forEach"],"sources":["@wordpress/components/src/box-control/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport type {\n\tBoxControlProps,\n\tBoxControlValue,\n\tCustomValueUnits,\n} from './types';\n\nexport const CUSTOM_VALUE_SETTINGS: CustomValueUnits = {\n\tpx: { max: 300, step: 1 },\n\t'%': { max: 100, step: 1 },\n\tvw: { max: 100, step: 1 },\n\tvh: { max: 100, step: 1 },\n\tem: { max: 10, step: 0.1 },\n\trm: { max: 10, step: 0.1 },\n\tsvw: { max: 100, step: 1 },\n\tlvw: { max: 100, step: 1 },\n\tdvw: { max: 100, step: 1 },\n\tsvh: { max: 100, step: 1 },\n\tlvh: { max: 100, step: 1 },\n\tdvh: { max: 100, step: 1 },\n\tvi: { max: 100, step: 1 },\n\tsvi: { max: 100, step: 1 },\n\tlvi: { max: 100, step: 1 },\n\tdvi: { max: 100, step: 1 },\n\tvb: { max: 100, step: 1 },\n\tsvb: { max: 100, step: 1 },\n\tlvb: { max: 100, step: 1 },\n\tdvb: { max: 100, step: 1 },\n\tvmin: { max: 100, step: 1 },\n\tsvmin: { max: 100, step: 1 },\n\tlvmin: { max: 100, step: 1 },\n\tdvmin: { max: 100, step: 1 },\n\tvmax: { max: 100, step: 1 },\n\tsvmax: { max: 100, step: 1 },\n\tlvmax: { max: 100, step: 1 },\n\tdvmax: { max: 100, step: 1 },\n};\n\nexport const LABELS = {\n\tall: __( 'All sides' ),\n\ttop: __( 'Top side' ),\n\tbottom: __( 'Bottom side' ),\n\tleft: __( 'Left side' ),\n\tright: __( 'Right side' ),\n\tmixed: __( 'Mixed' ),\n\tvertical: __( 'Top and bottom sides' ),\n\thorizontal: __( 'Left and right sides' ),\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' ] as const;\n\n/**\n * Gets an items with the most occurrence within an array\n * https://stackoverflow.com/a/20762713\n *\n * @param arr Array of items to check.\n * @return The item with the most occurrences.\n */\nfunction mode< T >( arr: T[] ) {\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 values Box values.\n * @param selectedUnits Box units.\n * @param availableSides Available box sides to evaluate.\n *\n * @return A value + unit for the 'all' input.\n */\nexport function getAllValue(\n\tvalues: BoxControlValue = {},\n\tselectedUnits?: BoxControlValue,\n\tavailableSides: BoxControlProps[ 'sides' ] = 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 selectedUnits Current unit selections for individual sides.\n * @return Most common unit selection.\n */\nexport function getAllUnitFallback( selectedUnits?: BoxControlValue ) {\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 values Box values.\n * @param selectedUnits Box units.\n * @param sides Available box sides to evaluate.\n *\n * @return Whether values are mixed.\n */\nexport function isValuesMixed(\n\tvalues: BoxControlValue = {},\n\tselectedUnits?: BoxControlValue,\n\tsides: BoxControlProps[ 'sides' ] = ALL_SIDES\n) {\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 values Box values.\n *\n * @return Whether values are mixed.\n */\nexport function isValuesDefined( values?: BoxControlValue ) {\n\treturn (\n\t\tvalues &&\n\t\tObject.values( values ).filter(\n\t\t\t// Switching units when input is empty causes values only\n\t\t\t// containing units. This gives false positive on mixed values\n\t\t\t// unless filtered.\n\t\t\t( value ) => !! value && /\\d/.test( value )\n\t\t).length > 0\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 isLinked Whether the box control's fields are linked.\n * @param splitOnAxis Whether splitting by horizontal or vertical axis.\n * @return The initial side.\n */\nexport function getInitialSide( isLinked: boolean, splitOnAxis: boolean ) {\n\tlet initialSide: keyof typeof LABELS = '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 sides Available sides for box control.\n * @return Normalized sides configuration.\n */\nexport function normalizeSides( sides: BoxControlProps[ 'sides' ] ) {\n\tconst filteredSides: ( keyof BoxControlValue )[] = [];\n\n\tif ( ! sides?.length ) {\n\t\treturn ALL_SIDES;\n\t}\n\n\tif ( sides.includes( 'vertical' ) ) {\n\t\tfilteredSides.push( ...( [ 'top', 'bottom' ] as const ) );\n\t} else if ( sides.includes( 'horizontal' ) ) {\n\t\tfilteredSides.push( ...( [ 'left', 'right' ] as const ) );\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\n/**\n * Applies a value to an object representing top, right, bottom and left sides\n * while taking into account any custom side configuration.\n *\n * @param currentValues The current values for each side.\n * @param newValue The value to apply to the sides object.\n * @param sides Array defining valid sides.\n *\n * @return Object containing the updated values for each side.\n */\nexport function applyValueToSides(\n\tcurrentValues: BoxControlValue,\n\tnewValue?: string,\n\tsides?: BoxControlProps[ 'sides' ]\n): BoxControlValue {\n\tconst newValues = { ...currentValues };\n\n\tif ( sides?.length ) {\n\t\tsides.forEach( ( side ) => {\n\t\t\tif ( side === 'vertical' ) {\n\t\t\t\tnewValues.top = newValue;\n\t\t\t\tnewValues.bottom = newValue;\n\t\t\t} else if ( side === 'horizontal' ) {\n\t\t\t\tnewValues.left = newValue;\n\t\t\t\tnewValues.right = newValue;\n\t\t\t} else {\n\t\t\t\tnewValues[ side ] = newValue;\n\t\t\t}\n\t\t} );\n\t} else {\n\t\tALL_SIDES.forEach( ( side ) => ( newValues[ side ] = newValue ) );\n\t}\n\n\treturn newValues;\n}\n"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAQO,MAAME,qBAAuC,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACtDE,EAAE,EAAE;IAAEC,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EACzB,GAAG,EAAE;IAAED,GAAG,EAAE,GAAG;IAA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QAAS,CAAC;EAClC;EAEA,OAAOH,aAAa;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,iBAAiBA,CAChCC,aAA8B,EAC9BC,QAAiB,EACjBpC,KAAkC,EAChB;EAClB,MAAMqC,SAAS,GAAG;IAAE,GAAGF;EAAc,CAAC;EAEtC,IAAKnC,KAAK,EAAEN,MAAM,EAAG;IACpBM,KAAK,CAACsC,OAAO,CAAIlC,IAAI,IAAM;MAC1B,IAAKA,IAAI,KAAK,UAAU,EAAG;QAC1BiC,SAAS,CAAC5D,GAAG,GAAG2D,QAAQ;QACxBC,SAAS,CAAC3D,MAAM,GAAG0D,QAAQ;MAC5B,CAAC,MAAM,IAAKhC,IAAI,KAAK,YAAY,EAAG;QACnCiC,SAAS,CAAC1D,IAAI,GAAGyD,QAAQ;QACzBC,SAAS,CAACzD,KAAK,GAAGwD,QAAQ;MAC3B,CAAC,MAAM;QACNC,SAAS,CAAEjC,IAAI,CAAE,GAAGgC,QAAQ;MAC7B;IACD,CAAE,CAAC;EACJ,CAAC,MAAM;IACNlD,SAAS,CAACoD,OAAO,CAAIlC,IAAI,IAAQiC,SAAS,CAAEjC,IAAI,CAAE,GAAGgC,QAAW,CAAC;EAClE;EAEA,OAAOC,SAAS;AACjB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_deprecated","_interopRequireDefault","CUSTOM_VALUE_SETTINGS","exports","px","max","step","vw","vh","em","rm","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","LABELS","all","__","top","bottom","left","right","vertical","horizontal","DEFAULT_VALUES","undefined","ALL_SIDES","mode","arr","sort","a","b","filter","v","length","pop","getMergedValue","values","availableSides","sides","normalizeSides","every","side","isValueMixed","some","getAllUnitFallback","selectedUnits","filteredUnits","Object","Boolean","isValuesDefined","value","test","getInitialSide","isLinked","splitOnAxis","initialSide","filteredSides","includes","push","newSides","applyValueToSides","currentValues","newValue","deprecated","since","version","newValues","forEach","getAllowedSides","allowedSides","Set","allowedSide","add"],"sources":["@wordpress/components/src/box-control/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tBoxControlInputControlProps,\n\tBoxControlProps,\n\tBoxControlValue,\n\tCustomValueUnits,\n} from './types';\nimport deprecated from '@wordpress/deprecated';\n\nexport const CUSTOM_VALUE_SETTINGS: CustomValueUnits = {\n\tpx: { max: 300, step: 1 },\n\t'%': { max: 100, step: 1 },\n\tvw: { max: 100, step: 1 },\n\tvh: { max: 100, step: 1 },\n\tem: { max: 10, step: 0.1 },\n\trm: { max: 10, step: 0.1 },\n\tsvw: { max: 100, step: 1 },\n\tlvw: { max: 100, step: 1 },\n\tdvw: { max: 100, step: 1 },\n\tsvh: { max: 100, step: 1 },\n\tlvh: { max: 100, step: 1 },\n\tdvh: { max: 100, step: 1 },\n\tvi: { max: 100, step: 1 },\n\tsvi: { max: 100, step: 1 },\n\tlvi: { max: 100, step: 1 },\n\tdvi: { max: 100, step: 1 },\n\tvb: { max: 100, step: 1 },\n\tsvb: { max: 100, step: 1 },\n\tlvb: { max: 100, step: 1 },\n\tdvb: { max: 100, step: 1 },\n\tvmin: { max: 100, step: 1 },\n\tsvmin: { max: 100, step: 1 },\n\tlvmin: { max: 100, step: 1 },\n\tdvmin: { max: 100, step: 1 },\n\tvmax: { max: 100, step: 1 },\n\tsvmax: { max: 100, step: 1 },\n\tlvmax: { max: 100, step: 1 },\n\tdvmax: { max: 100, step: 1 },\n};\n\nexport const LABELS = {\n\tall: __( 'All sides' ),\n\ttop: __( 'Top side' ),\n\tbottom: __( 'Bottom side' ),\n\tleft: __( 'Left side' ),\n\tright: __( 'Right side' ),\n\tvertical: __( 'Top and bottom sides' ),\n\thorizontal: __( 'Left and right sides' ),\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' ] as const;\n\n/**\n * Gets an items with the most occurrence within an array\n * https://stackoverflow.com/a/20762713\n *\n * @param arr Array of items to check.\n * @return The item with the most occurrences.\n */\nfunction mode< T >( arr: T[] ) {\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 merged input value and unit from values data.\n *\n * @param values Box values.\n * @param availableSides Available box sides to evaluate.\n *\n * @return A value + unit for the 'all' input.\n */\nexport function getMergedValue(\n\tvalues: BoxControlValue = {},\n\tavailableSides: BoxControlProps[ 'sides' ] = ALL_SIDES\n) {\n\tconst sides = normalizeSides( availableSides );\n\tif (\n\t\tsides.every(\n\t\t\t( side: keyof BoxControlValue ) =>\n\t\t\t\tvalues[ side ] === values[ sides[ 0 ] ]\n\t\t)\n\t) {\n\t\treturn values[ sides[ 0 ] ];\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Checks if the values are mixed.\n *\n * @param values Box values.\n * @param availableSides Available box sides to evaluate.\n * @return Whether the values are mixed.\n */\nexport function isValueMixed(\n\tvalues: BoxControlValue = {},\n\tavailableSides: BoxControlProps[ 'sides' ] = ALL_SIDES\n) {\n\tconst sides = normalizeSides( availableSides );\n\treturn sides.some(\n\t\t( side: keyof BoxControlValue ) =>\n\t\t\tvalues[ side ] !== values[ sides[ 0 ] ]\n\t);\n}\n\n/**\n * Determine the most common unit selection to use as a fallback option.\n *\n * @param selectedUnits Current unit selections for individual sides.\n * @return Most common unit selection.\n */\nexport function getAllUnitFallback( selectedUnits?: BoxControlValue ) {\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 defined.\n *\n * @param values Box values.\n *\n * @return Whether values are mixed.\n */\nexport function isValuesDefined( values?: BoxControlValue ) {\n\treturn (\n\t\tvalues &&\n\t\tObject.values( values ).filter(\n\t\t\t// Switching units when input is empty causes values only\n\t\t\t// containing units. This gives false positive on mixed values\n\t\t\t// unless filtered.\n\t\t\t( value ) => !! value && /\\d/.test( value )\n\t\t).length > 0\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 isLinked Whether the box control's fields are linked.\n * @param splitOnAxis Whether splitting by horizontal or vertical axis.\n * @return The initial side.\n */\nexport function getInitialSide( isLinked: boolean, splitOnAxis: boolean ) {\n\tlet initialSide: keyof typeof LABELS = '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 sides Available sides for box control.\n * @return Normalized sides configuration.\n */\nexport function normalizeSides( sides: BoxControlProps[ 'sides' ] ) {\n\tconst filteredSides: ( keyof BoxControlValue )[] = [];\n\n\tif ( ! sides?.length ) {\n\t\treturn ALL_SIDES;\n\t}\n\n\tif ( sides.includes( 'vertical' ) ) {\n\t\tfilteredSides.push( ...( [ 'top', 'bottom' ] as const ) );\n\t} else if ( sides.includes( 'horizontal' ) ) {\n\t\tfilteredSides.push( ...( [ 'left', 'right' ] as const ) );\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\n/**\n * Applies a value to an object representing top, right, bottom and left sides\n * while taking into account any custom side configuration.\n *\n * @deprecated\n *\n * @param currentValues The current values for each side.\n * @param newValue The value to apply to the sides object.\n * @param sides Array defining valid sides.\n *\n * @return Object containing the updated values for each side.\n */\nexport function applyValueToSides(\n\tcurrentValues: BoxControlValue,\n\tnewValue?: string,\n\tsides?: BoxControlProps[ 'sides' ]\n): BoxControlValue {\n\tdeprecated( 'applyValueToSides', {\n\t\tsince: '6.8',\n\t\tversion: '7.0',\n\t} );\n\tconst newValues = { ...currentValues };\n\n\tif ( sides?.length ) {\n\t\tsides.forEach( ( side ) => {\n\t\t\tif ( side === 'vertical' ) {\n\t\t\t\tnewValues.top = newValue;\n\t\t\t\tnewValues.bottom = newValue;\n\t\t\t} else if ( side === 'horizontal' ) {\n\t\t\t\tnewValues.left = newValue;\n\t\t\t\tnewValues.right = newValue;\n\t\t\t} else {\n\t\t\t\tnewValues[ side ] = newValue;\n\t\t\t}\n\t\t} );\n\t} else {\n\t\tALL_SIDES.forEach( ( side ) => ( newValues[ side ] = newValue ) );\n\t}\n\n\treturn newValues;\n}\n\n/**\n * Return the allowed sides based on the sides configuration.\n *\n * @param sides Sides configuration.\n * @return Allowed sides.\n */\nexport function getAllowedSides(\n\tsides: BoxControlInputControlProps[ 'sides' ]\n) {\n\tconst allowedSides: Set< keyof BoxControlValue > = new Set(\n\t\t! sides ? ALL_SIDES : []\n\t);\n\tsides?.forEach( ( allowedSide ) => {\n\t\tif ( allowedSide === 'vertical' ) {\n\t\t\tallowedSides.add( 'top' );\n\t\t\tallowedSides.add( 'bottom' );\n\t\t} else if ( allowedSide === 'horizontal' ) {\n\t\t\tallowedSides.add( 'right' );\n\t\t\tallowedSides.add( 'left' );\n\t\t} else {\n\t\t\tallowedSides.add( allowedSide );\n\t\t}\n\t} );\n\treturn allowedSides;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAWA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AASO,MAAMG,qBAAuC,GAAAC,OAAA,CAAA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AI,CAAE,GAAGqB,QAAQ;MAC7B;IACD,CAAE,CAAC;EACJ,CAAC,MAAM;IACNrC,SAAS,CAAC0C,OAAO,CAAI1B,IAAI,IAAQyB,SAAS,CAAEzB,IAAI,CAAE,GAAGqB,QAAW,CAAC;EAClE;EAEA,OAAOI,SAAS;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAC9B9B,KAA6C,EAC5C;EACD,MAAM+B,YAA0C,GAAG,IAAIC,GAAG,CACzD,CAAEhC,KAAK,GAAGb,SAAS,GAAG,EACvB,CAAC;EACDa,KAAK,EAAE6B,OAAO,CAAII,WAAW,IAAM;IAClC,IAAKA,WAAW,KAAK,UAAU,EAAG;MACjCF,YAAY,CAACG,GAAG,CAAE,KAAM,CAAC;MACzBH,YAAY,CAACG,GAAG,CAAE,QAAS,CAAC;IAC7B,CAAC,MAAM,IAAKD,WAAW,KAAK,YAAY,EAAG;MAC1CF,YAAY,CAACG,GAAG,CAAE,OAAQ,CAAC;MAC3BH,YAAY,CAACG,GAAG,CAAE,MAAO,CAAC;IAC3B,CAAC,MAAM;MACNH,YAAY,CAACG,GAAG,CAAED,WAAY,CAAC;IAChC;EACD,CAAE,CAAC;EACH,OAAOF,YAAY;AACpB","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_reactNativeGestureHandler","_element","_compose","_tooltip","_interopRequireDefault","_icon","_style","_jsxRuntime","isAndroid","Platform","OS","marginBottom","marginLeft","styles","StyleSheet","create","container","flex","padding","justifyContent","alignItems","buttonInactive","flexDirection","fixedRatio","aspectRatio","buttonActive","borderRadius","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","hitSlop","preferredColorScheme","usePreferredColorScheme","isDisabled","containerStyle","buttonActiveColorStyles","usePreferredColorSchemeStyle","style","buttonViewStyle","opacity","backgroundColor","states","push","newChildren","Children","map","child","cloneElement","colorScheme","shouldShowTooltip","Array","isArray","length","newIcon","jsx","default","size","longPressHandler","useCallback","nativeEvent","state","State","ACTIVE","element","TouchableOpacity","activeOpacity","accessible","accessibilityLabel","accessibilityStates","accessibilityRole","accessibilityHint","onPress","LongPressGestureHandler","minDurationMs","maxDist","onHandlerStateChange","View","jsxs","Text","text","position","visible","_default","exports"],"sources":["@wordpress/components/src/button/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tStyleSheet,\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';\nimport style from './style.scss';\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},\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\thitSlop,\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 buttonActiveColorStyles = usePreferredColorSchemeStyle(\n\t\tstyle[ 'components-button-light--active' ],\n\t\tstyle[ 'components-button-dark--active' ]\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 ? buttonActiveColorStyles : {} ),\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\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\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\thitSlop={ hitSlop }\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"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,0BAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAQA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,KAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,MAAA,GAAAF,sBAAA,CAAAL,OAAA;AAAiC,IAAAQ,WAAA,GAAAR,OAAA;AA1BjC;AACA;AACA;;AAUA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,MAAMS,SAAS,GAAGC,qBAAQ,CAACC,EAAE,KAAK,SAAS;AAC3C,MAAMC,YAAY,GAAGH,SAAS,GAAG,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Z,MAAM,EAAGA,MAAQ;IACjBS,OAAO,EAAGA,OAAS;IAAAjB,QAAA,eAEnB,IAAA7B,WAAA,CAAAsE,GAAA,EAAC7E,0BAAA,CAAA+F,uBAAuB;MACvBC,aAAa,EAAG,GAAK;MACrBC,OAAO,EAAG,GAAK;MACfC,oBAAoB,EAAGlB,gBAAkB;MAAA5C,QAAA,eAEzC,IAAA7B,WAAA,CAAAsE,GAAA,EAAC/E,YAAA,CAAAqG,IAAI;QAACvC,KAAK,EAAGC,eAAiB;QAAAzB,QAAA,eAC9B,IAAA7B,WAAA,CAAA6F,IAAA,EAACtG,YAAA,CAAAqG,IAAI;UAACvC,KAAK,EAAG;YAAEtC,aAAa,EAAE;UAAM,CAAG;UAAAc,QAAA,GACrCwC,OAAO,EACPV,WAAW,EACXvB,SAAS,iBACV,IAAApC,WAAA,CAAAsE,GAAA,EAAC/E,YAAA,CAAAuG,IAAI;YACJzC,KAAK,EACJnB,SAAS,GACN5B,MAAM,CAACoB,eAAe,GACtBN,iBACH;YAAAS,QAAA,EAECO;UAAS,CACN,CACN;QAAA,CACI;MAAC,CACF;IAAC,CACiB;EAAC,CACT,CAClB;EAED,IAAK,CAAE6B,iBAAiB,EAAG;IAC1B,OAAOc,OAAO;EACf;EAEA,oBACC,IAAA/E,WAAA,CAAAsE,GAAA,EAAC1E,QAAA,CAAA2E,OAAO;IACPwB,IAAI,EAAGtD,KAAO;IACdC,QAAQ,EAAGA,QAAU;IACrBsD,QAAQ,EAAGrD,eAAiB;IAC5BsD,OAAO,EAAGzD,WAAW,KAAK,IAAM;IAAAX,QAAA,EAE9BkD;EAAO,CACD,CAAC;AAEZ;AAAC,IAAAmB,QAAA,GAAAC,OAAA,CAAA5B,OAAA,GAEc5C,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_reactNativeGestureHandler","_element","_compose","_tooltip","_interopRequireDefault","_icon","_style","_jsxRuntime","isAndroid","Platform","OS","marginBottom","marginLeft","styles","StyleSheet","create","container","flex","padding","justifyContent","alignItems","buttonInactive","flexDirection","fixedRatio","aspectRatio","buttonActive","borderRadius","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","hitSlop","preferredColorScheme","usePreferredColorScheme","isDisabled","containerStyle","buttonActiveColorStyles","usePreferredColorSchemeStyle","style","buttonViewStyle","opacity","backgroundColor","states","push","newChildren","Children","map","child","cloneElement","colorScheme","shouldShowTooltip","Array","isArray","length","newIcon","jsx","default","size","longPressHandler","useCallback","nativeEvent","state","State","ACTIVE","element","TouchableOpacity","activeOpacity","accessible","accessibilityLabel","accessibilityStates","accessibilityRole","accessibilityHint","onPress","LongPressGestureHandler","minDurationMs","maxDist","onHandlerStateChange","View","jsxs","Text","text","position","visible","_default","exports"],"sources":["@wordpress/components/src/button/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tStyleSheet,\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';\nimport style from './style.scss';\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},\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\thitSlop,\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 buttonActiveColorStyles = usePreferredColorSchemeStyle(\n\t\tstyle[ 'components-button-light--active' ],\n\t\tstyle[ 'components-button-dark--active' ]\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 ? buttonActiveColorStyles : {} ),\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\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\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\thitSlop={ hitSlop }\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"],"mappings":";;;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,0BAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAQA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,KAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,MAAA,GAAAF,sBAAA,CAAAL,OAA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GAAAC,OAAA,CAAA5B,OAAA,GAEc5C,MAAM","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/button/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Props as IconProps } from '../icon';\nimport type { PopoverProps } from '../popover/types';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\n\nexport type ButtonProps =\n\t| WordPressComponentProps< ButtonAsButtonProps, 'button', false >\n\t| WordPressComponentProps< ButtonAsAnchorProps, 'a', false >;\n\nexport type ButtonAsButtonProps = BaseButtonProps & _ButtonProps;\nexport type ButtonAsAnchorProps = BaseButtonProps & AnchorProps;\n\ntype BaseButtonProps = {\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * Whether to keep the button focusable when disabled.\n\t *\n\t * In most cases, it is recommended to set this to `true`. Disabling a control without maintaining focusability\n\t * can cause accessibility issues, by hiding their presence from screen reader users,\n\t * or by preventing focus from returning to a trigger element.\n\t *\n\t * Learn more about the [focusability of disabled controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols)\n\t * in the WAI-ARIA Authoring Practices Guide.\n\t *\n\t * @default false\n\t */\n\taccessibleWhenDisabled?: boolean;\n\t/**\n\t * The button's children.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * A visually hidden accessible description for the button.\n\t */\n\tdescription?: string;\n\t/**\n\t * If provided, renders an Icon component inside the button.\n\t */\n\ticon?: IconProps[ 'icon' ];\n\t/**\n\t * If provided with `icon`, sets the position of icon relative to the `text`.\n\t *\n\t * @default 'left'\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * If provided with `icon`, sets the icon size.\n\t * Please refer to the Icon component for more details regarding\n\t * the default value of its `size` prop.\n\t */\n\ticonSize?: IconProps[ 'size' ];\n\t/**\n\t * Indicates activity while a action is being performed.\n\t */\n\tisBusy?: boolean;\n\t/**\n\t * Renders a red text-based button style to indicate destructive behavior.\n\t */\n\tisDestructive?: boolean;\n\t/**\n\t * Renders a pressed button style.\n\t */\n\tisPressed?: boolean;\n\t/**\n\t * Sets the `aria-label` of the component, if none is provided.\n\t * Sets the Tooltip content if `showTooltip` is provided.\n\t */\n\tlabel?: string;\n\t/**\n\t * If provided with `showTooltip`, appends the Shortcut label to the tooltip content.\n\t * If an object is provided, it should contain `display` and `ariaLabel` keys.\n\t */\n\tshortcut?: string | { display: string; ariaLabel: string };\n\t/**\n\t * If provided, renders a Tooltip component for the button.\n\t */\n\tshowTooltip?: boolean;\n\t/**\n\t * The size of the button.\n\t *\n\t * - `'default'`: For normal text-label buttons, unless it is a toggle button.\n\t * - `'compact'`: For toggle buttons, icon buttons, and buttons when used in context of either.\n\t * - `'small'`: For icon buttons associated with more advanced or auxiliary features.\n\t *\n\t * If the deprecated `isSmall` prop is also defined, this prop will take precedence.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'compact' | 'small';\n\t/**\n\t * If provided, displays the given text inside the button. If the button contains children elements, the text is displayed before them.\n\t */\n\ttext?: string;\n\t/**\n\t * If provided with `showTooltip`, sets the position of the tooltip.\n\t * Please refer to the Tooltip component for more details regarding the defaults.\n\t */\n\ttooltipPosition?: PopoverProps[ 'position' ];\n\t/**\n\t * Specifies the button's style.\n\t * The accepted values are:\n\t * 'primary' (the primary button styles)\n\t * 'secondary' (the default button styles)\n\t * 'tertiary' (the text-based button styles)\n\t * 'link' (the link button styles)\n\t */\n\tvariant?: 'primary' | 'secondary' | 'tertiary' | 'link';\n};\n\ntype _ButtonProps = {\n\t/**\n\t * Whether the button is disabled. If `true`, this will force a `button` element\n\t * to be rendered, even when an `href` is given.\n\t *\n\t * In most cases, it is recommended to also set the `accessibleWhenDisabled` prop to `true`.\n\t */\n\tdisabled?: boolean;\n};\n\ntype AnchorProps = {\n\t/**\n\t * Whether the button is disabled. If `true`, this will force a `button` element\n\t * to be rendered, even when an `href` is given.\n\t *\n\t * In most cases, it is recommended to also set the `accessibleWhenDisabled` prop to `true`.\n\t */\n\tdisabled?: false;\n\t/**\n\t * If provided, renders `a` instead of `button`.\n\t */\n\thref: string;\n\t/**\n\t * If provided with `href`, sets the `target` attribute to the `a`.\n\t */\n\ttarget?: string;\n};\n\nexport type DeprecatedButtonProps = {\n\t/**\n\t * Whether to keep the button focusable when disabled.\n\t *\n\t * @default false\n\t * @deprecated Use the `accessibleWhenDisabled` prop instead.\n\t * @ignore\n\t */\n\t__experimentalIsFocusable?: boolean;\n\t/**\n\t * Gives the button a default style.\n\t *\n\t * @deprecated Use the `'secondary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisDefault?: boolean;\n\t/**\n\t * Gives the button a link style.\n\t *\n\t * @deprecated Use the `'link'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisLink?: boolean;\n\t/**\n\t * Gives the button a primary style.\n\t *\n\t * @deprecated Use the `'primary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisPrimary?: boolean;\n\t/**\n\t * Gives the button a default style.\n\t *\n\t * @deprecated Use the `'secondary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisSecondary?: boolean;\n\t/**\n\t * Gives the button a text-based style.\n\t *\n\t * @deprecated Use the `'tertiary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisTertiary?: boolean;\n\t/**\n\t * Decreases the size of the button.\n\t *\n\t * @deprecated Use the `'small'` value on the `size` prop instead.\n\t * @ignore\n\t */\n\tisSmall?: boolean;\n\t/**\n\t * A visually hidden accessible description for the button.\n\t *\n\t * @deprecated Use the `description` prop instead.\n\t * @ignore\n\t */\n\tdescribedBy?: string;\n};\n\nexport type DeprecatedIconButtonProps = {\n\tlabelPosition: ButtonProps[ 'tooltipPosition' ];\n\tshowTooltip?: boolean;\n\tsize: ButtonProps[ 'iconSize' ];\n\tlabel: ButtonProps[ 'label' ];\n\ttooltip: ButtonProps[ 'label' ];\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/button/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Props as IconProps } from '../icon';\nimport type { PopoverProps } from '../popover/types';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\n\nexport type ButtonProps =\n\t| WordPressComponentProps< ButtonAsButtonProps, 'button', false >\n\t| WordPressComponentProps< ButtonAsAnchorProps, 'a', false >;\n\nexport type ButtonAsButtonProps = BaseButtonProps & _ButtonProps;\nexport type ButtonAsAnchorProps = BaseButtonProps & AnchorProps;\n\ntype BaseButtonProps = {\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * Whether to keep the button focusable when disabled.\n\t *\n\t * In most cases, it is recommended to set this to `true`. Disabling a control without maintaining focusability\n\t * can cause accessibility issues, by hiding their presence from screen reader users,\n\t * or by preventing focus from returning to a trigger element.\n\t *\n\t * Learn more about the [focusability of disabled controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols)\n\t * in the WAI-ARIA Authoring Practices Guide.\n\t *\n\t * @default false\n\t */\n\taccessibleWhenDisabled?: boolean;\n\t/**\n\t * The button's children.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * A visually hidden accessible description for the button.\n\t */\n\tdescription?: string;\n\t/**\n\t * If provided, renders an Icon component inside the button.\n\t */\n\ticon?: IconProps[ 'icon' ];\n\t/**\n\t * If provided with `icon`, sets the position of icon relative to the `text`.\n\t *\n\t * @default 'left'\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * If provided with `icon`, sets the icon size.\n\t * Please refer to the Icon component for more details regarding\n\t * the default value of its `size` prop.\n\t */\n\ticonSize?: IconProps[ 'size' ];\n\t/**\n\t * Indicates activity while a action is being performed.\n\t */\n\tisBusy?: boolean;\n\t/**\n\t * Renders a red text-based button style to indicate destructive behavior.\n\t */\n\tisDestructive?: boolean;\n\t/**\n\t * Renders a pressed button style.\n\t */\n\tisPressed?: boolean;\n\t/**\n\t * Sets the `aria-label` of the component, if none is provided.\n\t * Sets the Tooltip content if `showTooltip` is provided.\n\t */\n\tlabel?: string;\n\t/**\n\t * If provided with `showTooltip`, appends the Shortcut label to the tooltip content.\n\t * If an object is provided, it should contain `display` and `ariaLabel` keys.\n\t */\n\tshortcut?: string | { display: string; ariaLabel: string };\n\t/**\n\t * If provided, renders a Tooltip component for the button.\n\t */\n\tshowTooltip?: boolean;\n\t/**\n\t * The size of the button.\n\t *\n\t * - `'default'`: For normal text-label buttons, unless it is a toggle button.\n\t * - `'compact'`: For toggle buttons, icon buttons, and buttons when used in context of either.\n\t * - `'small'`: For icon buttons associated with more advanced or auxiliary features.\n\t *\n\t * If the deprecated `isSmall` prop is also defined, this prop will take precedence.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'compact' | 'small';\n\t/**\n\t * If provided, displays the given text inside the button. If the button contains children elements, the text is displayed before them.\n\t */\n\ttext?: string;\n\t/**\n\t * If provided with `showTooltip`, sets the position of the tooltip.\n\t * Please refer to the Tooltip component for more details regarding the defaults.\n\t */\n\ttooltipPosition?: PopoverProps[ 'position' ];\n\t/**\n\t * Specifies the button's style.\n\t *\n\t * The accepted values are:\n\t *\n\t * 1. `'primary'` (the primary button styles)\n\t * 2. `'secondary'` (the default button styles)\n\t * 3. `'tertiary'` (the text-based button styles)\n\t * 4. `'link'` (the link button styles)\n\t */\n\tvariant?: 'primary' | 'secondary' | 'tertiary' | 'link';\n};\n\ntype _ButtonProps = {\n\t/**\n\t * Whether the button is disabled. If `true`, this will force a `button` element\n\t * to be rendered, even when an `href` is given.\n\t *\n\t * In most cases, it is recommended to also set the `accessibleWhenDisabled` prop to `true`.\n\t */\n\tdisabled?: boolean;\n};\n\ntype AnchorProps = {\n\t/**\n\t * Whether the button is disabled. If `true`, this will force a `button` element\n\t * to be rendered, even when an `href` is given.\n\t *\n\t * In most cases, it is recommended to also set the `accessibleWhenDisabled` prop to `true`.\n\t */\n\tdisabled?: false;\n\t/**\n\t * If provided, renders `a` instead of `button`.\n\t */\n\thref: string;\n\t/**\n\t * If provided with `href`, sets the `target` attribute to the `a`.\n\t */\n\ttarget?: string;\n};\n\nexport type DeprecatedButtonProps = {\n\t/**\n\t * Whether to keep the button focusable when disabled.\n\t *\n\t * @default false\n\t * @deprecated Use the `accessibleWhenDisabled` prop instead.\n\t * @ignore\n\t */\n\t__experimentalIsFocusable?: boolean;\n\t/**\n\t * Gives the button a default style.\n\t *\n\t * @deprecated Use the `'secondary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisDefault?: boolean;\n\t/**\n\t * Gives the button a link style.\n\t *\n\t * @deprecated Use the `'link'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisLink?: boolean;\n\t/**\n\t * Gives the button a primary style.\n\t *\n\t * @deprecated Use the `'primary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisPrimary?: boolean;\n\t/**\n\t * Gives the button a default style.\n\t *\n\t * @deprecated Use the `'secondary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisSecondary?: boolean;\n\t/**\n\t * Gives the button a text-based style.\n\t *\n\t * @deprecated Use the `'tertiary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisTertiary?: boolean;\n\t/**\n\t * Decreases the size of the button.\n\t *\n\t * @deprecated Use the `'small'` value on the `size` prop instead.\n\t * @ignore\n\t */\n\tisSmall?: boolean;\n\t/**\n\t * A visually hidden accessible description for the button.\n\t *\n\t * @deprecated Use the `description` prop instead.\n\t * @ignore\n\t */\n\tdescribedBy?: string;\n};\n\nexport type DeprecatedIconButtonProps = {\n\tlabelPosition: ButtonProps[ 'tooltipPosition' ];\n\tshowTooltip?: boolean;\n\tsize: ButtonProps[ 'iconSize' ];\n\tlabel: ButtonProps[ 'label' ];\n\ttooltip: ButtonProps[ 'label' ];\n};\n"],"mappings":"","ignoreList":[]}
@@ -46,6 +46,7 @@ function ButtonAction({
46
46
  ...additionalProps
47
47
  }) {
48
48
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
49
+ __next40pxDefaultSize: true,
49
50
  className: (0, _clsx.default)('components-circular-option-picker__clear', className),
50
51
  variant: "tertiary",
51
52
  ...additionalProps,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_button","_dropdown","_jsxRuntime","DropdownLinkAction","buttonProps","className","dropdownProps","linkText","jsx","default","clsx","renderToggle","isOpen","onToggle","onClick","variant","children","ButtonAction","additionalProps"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-actions.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport type { DropdownLinkActionProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport function DropdownLinkAction( {\n\tbuttonProps,\n\tclassName,\n\tdropdownProps,\n\tlinkText,\n}: DropdownLinkActionProps ) {\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__dropdown-link-action',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t>\n\t\t\t\t\t{ linkText }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ ...dropdownProps }\n\t\t/>\n\t);\n}\n\nexport function ButtonAction( {\n\tclassName,\n\tchildren,\n\t...additionalProps\n}: WordPressComponentProps< ButtonAsButtonProps, 'button', false > ) {\n\treturn (\n\t\t<Button\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__clear',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tvariant=\"tertiary\"\n\t\t\t{ ...additionalProps }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAmC,IAAAG,WAAA,GAAAH,OAAA;AATnC;AACA;AACA;;AAGA;AACA;AACA;;AAOO,SAASI,kBAAkBA,CAAE;EACnCC,WAAW;EACXC,SAAS;EACTC,aAAa;EACbC;AACwB,CAAC,EAAG;EAC5B,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACP,SAAA,CAAAQ,OAAQ;IACRJ,SAAS,EAAG,IAAAK,aAAI,EACf,yDAAyD,EACzDL,SACD,CAAG;IACHM,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpC,IAAAX,WAAA,CAAAM,GAAA,EAACR,OAAA,CAAAS,OAAM;MACN,iBAAgBG,MAAQ;MACxB,iBAAc,MAAM;MACpBE,OAAO,EAAGD,QAAU;MACpBE,OAAO,EAAC,MAAM;MAAA,GACTX,WAAW;MAAAY,QAAA,EAEdT;IAAQ,CACH,CACN;IAAA,GACED;EAAa,CAClB,CAAC;AAEJ;AAEO,SAASW,YAAYA,CAAE;EAC7BZ,SAAS;EACTW,QAAQ;EACR,GAAGE;AAC6D,CAAC,EAAG;EACpE,oBACC,IAAAhB,WAAA,CAAAM,GAAA,EAACR,OAAA,CAAAS,OAAM;IACNJ,SAAS,EAAG,IAAAK,aAAI,EACf,0CAA0C,EAC1CL,SACD,CAAG;IACHU,OAAO,EAAC,UAAU;IAAA,GACbG,eAAe;IAAAF,QAAA,EAElBA;EAAQ,CACH,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_button","_dropdown","_jsxRuntime","DropdownLinkAction","buttonProps","className","dropdownProps","linkText","jsx","default","clsx","renderToggle","isOpen","onToggle","onClick","variant","children","ButtonAction","additionalProps","__next40pxDefaultSize"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-actions.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport type { DropdownLinkActionProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport function DropdownLinkAction( {\n\tbuttonProps,\n\tclassName,\n\tdropdownProps,\n\tlinkText,\n}: DropdownLinkActionProps ) {\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__dropdown-link-action',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t>\n\t\t\t\t\t{ linkText }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ ...dropdownProps }\n\t\t/>\n\t);\n}\n\nexport function ButtonAction( {\n\tclassName,\n\tchildren,\n\t...additionalProps\n}: WordPressComponentProps< ButtonAsButtonProps, 'button', false > ) {\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__clear',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tvariant=\"tertiary\"\n\t\t\t{ ...additionalProps }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAmC,IAAAG,WAAA,GAAAH,OAAA;AATnC;AACA;AACA;;AAGA;AACA;AACA;;AAOO,SAASI,kBAAkBA,CAAE;EACnCC,WAAW;EACXC,SAAS;EACTC,aAAa;EACbC;AACwB,CAAC,EAAG;EAC5B,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACP,SAAA,CAAAQ,OAAQ;IACRJ,SAAS,EAAG,IAAAK,aAAI,EACf,yDAAyD,EACzDL,SACD,CAAG;IACHM,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpC,IAAAX,WAAA,CAAAM,GAAA,EAACR,OAAA,CAAAS,OAAM;MACN,iBAAgBG,MAAQ;MACxB,iBAAc,MAAM;MACpBE,OAAO,EAAGD,QAAU;MACpBE,OAAO,EAAC,MAAM;MAAA,GACTX,WAAW;MAAAY,QAAA,EAEdT;IAAQ,CACH,CACN;IAAA,GACED;EAAa,CAClB,CAAC;AAEJ;AAEO,SAASW,YAAYA,CAAE;EAC7BZ,SAAS;EACTW,QAAQ;EACR,GAAGE;AAC6D,CAAC,EAAG;EACpE,oBACC,IAAAhB,WAAA,CAAAM,GAAA,EAACR,OAAA,CAAAS,OAAM;IACNU,qBAAqB;IACrBd,SAAS,EAAG,IAAAK,aAAI,EACf,0CAA0C,EAC1CL,SACD,CAAG;IACHU,OAAO,EAAC,UAAU;IAAA,GACbG,eAAe;IAAAF,QAAA,EAElBA;EAAQ,CACH,CAAC;AAEX","ignoreList":[]}
@@ -82,6 +82,7 @@ function Option({
82
82
  const commonProps = {
83
83
  id,
84
84
  className: 'components-circular-option-picker__option',
85
+ __next40pxDefaultSize: true,
85
86
  ...additionalProps
86
87
  };
87
88
  const isListbox = setActiveId !== undefined;