@wordpress/components 28.14.1-next.cd6172eb0.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 (747) hide show
  1. package/CHANGELOG.md +16 -9
  2. package/build/alignment-matrix-control/icon.js +1 -0
  3. package/build/alignment-matrix-control/icon.js.map +1 -1
  4. package/build/alignment-matrix-control/index.js +1 -0
  5. package/build/alignment-matrix-control/index.js.map +1 -1
  6. package/build/animation/index.js +0 -6
  7. package/build/animation/index.js.map +1 -1
  8. package/build/autocomplete/autocompleter-ui.js +1 -0
  9. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  10. package/build/autocomplete/autocompleter-ui.native.js +1 -0
  11. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  12. package/build/autocomplete/get-default-use-items.js +1 -0
  13. package/build/autocomplete/get-default-use-items.js.map +1 -1
  14. package/build/autocomplete/index.js +1 -0
  15. package/build/autocomplete/index.js.map +1 -1
  16. package/build/border-box-control/utils.js +1 -0
  17. package/build/border-box-control/utils.js.map +1 -1
  18. package/build/border-control/border-control-dropdown/component.js +1 -0
  19. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  20. package/build/border-control/border-control-style-picker/component.js +1 -0
  21. package/build/border-control/border-control-style-picker/component.js.map +1 -1
  22. package/build/box-control/index.js +13 -13
  23. package/build/box-control/index.js.map +1 -1
  24. package/build/box-control/input-control.js +161 -0
  25. package/build/box-control/input-control.js.map +1 -0
  26. package/build/box-control/types.js.map +1 -1
  27. package/build/box-control/utils.js +51 -48
  28. package/build/box-control/utils.js.map +1 -1
  29. package/build/button/index.native.js +1 -0
  30. package/build/button/index.native.js.map +1 -1
  31. package/build/button/types.js.map +1 -1
  32. package/build/color-indicator/index.native.js +1 -0
  33. package/build/color-indicator/index.native.js.map +1 -1
  34. package/build/color-palette/index.js +1 -0
  35. package/build/color-palette/index.js.map +1 -1
  36. package/build/color-palette/index.native.js +1 -0
  37. package/build/color-palette/index.native.js.map +1 -1
  38. package/build/color-palette/utils.js +1 -0
  39. package/build/color-palette/utils.js.map +1 -1
  40. package/build/combobox-control/index.js +1 -0
  41. package/build/combobox-control/index.js.map +1 -1
  42. package/build/composite/legacy/index.js +1 -0
  43. package/build/composite/legacy/index.js.map +1 -1
  44. package/build/context/context-connect.js +1 -0
  45. package/build/context/context-connect.js.map +1 -1
  46. package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -0
  47. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  48. package/build/custom-gradient-picker/gradient-bar/index.js +1 -0
  49. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  50. package/build/custom-gradient-picker/gradient-bar/utils.js +1 -0
  51. package/build/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  52. package/build/custom-gradient-picker/index.js +1 -0
  53. package/build/custom-gradient-picker/index.js.map +1 -1
  54. package/build/custom-gradient-picker/serializer.js +1 -0
  55. package/build/custom-gradient-picker/serializer.js.map +1 -1
  56. package/build/custom-gradient-picker/utils.js +1 -0
  57. package/build/custom-gradient-picker/utils.js.map +1 -1
  58. package/build/custom-select-control/index.js +3 -2
  59. package/build/custom-select-control/index.js.map +1 -1
  60. package/build/dashicon/index.js +1 -0
  61. package/build/dashicon/index.js.map +1 -1
  62. package/build/date-time/date/index.js +1 -0
  63. package/build/date-time/date/index.js.map +1 -1
  64. package/build/date-time/date/use-lilius/index.js +1 -0
  65. package/build/date-time/date/use-lilius/index.js.map +1 -1
  66. package/build/date-time/time/index.js +1 -0
  67. package/build/date-time/time/index.js.map +1 -1
  68. package/build/dimension-control/index.js +1 -0
  69. package/build/dimension-control/index.js.map +1 -1
  70. package/build/dimension-control/sizes.js +1 -0
  71. package/build/dimension-control/sizes.js.map +1 -1
  72. package/build/draggable/index.js +1 -0
  73. package/build/draggable/index.js.map +1 -1
  74. package/build/draggable/index.native.js +1 -0
  75. package/build/draggable/index.native.js.map +1 -1
  76. package/build/dropdown-menu/index.js +1 -0
  77. package/build/dropdown-menu/index.js.map +1 -1
  78. package/build/dropdown-menu/index.native.js +1 -0
  79. package/build/dropdown-menu/index.native.js.map +1 -1
  80. package/build/duotone-picker/color-list-picker/index.js +1 -0
  81. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  82. package/build/duotone-picker/duotone-picker.js +1 -0
  83. package/build/duotone-picker/duotone-picker.js.map +1 -1
  84. package/build/duotone-picker/utils.js +1 -0
  85. package/build/duotone-picker/utils.js.map +1 -1
  86. package/build/external-link/index.js +1 -0
  87. package/build/external-link/index.js.map +1 -1
  88. package/build/font-size-picker/font-size-picker-select.js +1 -0
  89. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  90. package/build/font-size-picker/font-size-picker-toggle-group.js +1 -0
  91. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  92. package/build/font-size-picker/index.js +1 -0
  93. package/build/font-size-picker/index.js.map +1 -1
  94. package/build/font-size-picker/index.native.js +1 -0
  95. package/build/font-size-picker/index.native.js.map +1 -1
  96. package/build/font-size-picker/utils.js +1 -0
  97. package/build/font-size-picker/utils.js.map +1 -1
  98. package/build/form-token-field/index.js +1 -0
  99. package/build/form-token-field/index.js.map +1 -1
  100. package/build/form-token-field/suggestions-list.js +1 -0
  101. package/build/form-token-field/suggestions-list.js.map +1 -1
  102. package/build/gradient-picker/index.js +1 -0
  103. package/build/gradient-picker/index.js.map +1 -1
  104. package/build/guide/index.js +1 -0
  105. package/build/guide/index.js.map +1 -1
  106. package/build/guide/page-control.js +1 -0
  107. package/build/guide/page-control.js.map +1 -1
  108. package/build/h-stack/hook.js +1 -0
  109. package/build/h-stack/hook.js.map +1 -1
  110. package/build/higher-order/navigate-regions/index.js +1 -0
  111. package/build/higher-order/navigate-regions/index.js.map +1 -1
  112. package/build/higher-order/with-fallback-styles/index.js +1 -0
  113. package/build/higher-order/with-fallback-styles/index.js.map +1 -1
  114. package/build/higher-order/with-filters/index.js +1 -0
  115. package/build/higher-order/with-filters/index.js.map +1 -1
  116. package/build/higher-order/with-notices/index.js +1 -0
  117. package/build/higher-order/with-notices/index.js.map +1 -1
  118. package/build/index.js +0 -6
  119. package/build/index.js.map +1 -1
  120. package/build/keyboard-shortcuts/index.js +1 -0
  121. package/build/keyboard-shortcuts/index.js.map +1 -1
  122. package/build/menu/styles.js +16 -16
  123. package/build/menu/styles.js.map +1 -1
  124. package/build/menu-items-choice/index.js +1 -0
  125. package/build/menu-items-choice/index.js.map +1 -1
  126. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
  127. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  128. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
  129. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  130. package/build/mobile/bottom-sheet/picker-cell.native.js +1 -0
  131. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  132. package/build/mobile/bottom-sheet-select-control/index.native.js +1 -0
  133. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  134. package/build/mobile/color-settings/palette.screen.native.js +1 -0
  135. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  136. package/build/mobile/gradient/index.native.js +1 -0
  137. package/build/mobile/gradient/index.native.js.map +1 -1
  138. package/build/mobile/media-edit/index.native.js +1 -0
  139. package/build/mobile/media-edit/index.native.js.map +1 -1
  140. package/build/mobile/picker/index.android.js +1 -0
  141. package/build/mobile/picker/index.android.js.map +1 -1
  142. package/build/mobile/picker/index.ios.js +1 -0
  143. package/build/mobile/picker/index.ios.js.map +1 -1
  144. package/build/mobile/segmented-control/index.native.js +1 -0
  145. package/build/mobile/segmented-control/index.native.js.map +1 -1
  146. package/build/mobile/utils/get-px-from-css-unit.native.js +1 -0
  147. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  148. package/build/navigable-container/container.js +1 -0
  149. package/build/navigable-container/container.js.map +1 -1
  150. package/build/navigation/group/index.js +1 -0
  151. package/build/navigation/group/index.js.map +1 -1
  152. package/build/navigation/menu/menu-title-search.js +1 -0
  153. package/build/navigation/menu/menu-title-search.js.map +1 -1
  154. package/build/navigation/menu/search-no-results-found.js +1 -0
  155. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  156. package/build/navigation/styles/navigation-styles.js +12 -12
  157. package/build/navigation/styles/navigation-styles.js.map +1 -1
  158. package/build/navigator/navigator/component.js +1 -0
  159. package/build/navigator/navigator/component.js.map +1 -1
  160. package/build/navigator/navigator-screen/component.js +1 -0
  161. package/build/navigator/navigator-screen/component.js.map +1 -1
  162. package/build/navigator/utils/router.js +1 -0
  163. package/build/navigator/utils/router.js.map +1 -1
  164. package/build/notice/index.js +1 -0
  165. package/build/notice/index.js.map +1 -1
  166. package/build/notice/list.js +1 -0
  167. package/build/notice/list.js.map +1 -1
  168. package/build/notice/list.native.js +1 -0
  169. package/build/notice/list.native.js.map +1 -1
  170. package/build/palette-edit/index.js +1 -0
  171. package/build/palette-edit/index.js.map +1 -1
  172. package/build/panel/actions.native.js +1 -0
  173. package/build/panel/actions.native.js.map +1 -1
  174. package/build/query-controls/index.js +1 -0
  175. package/build/query-controls/index.js.map +1 -1
  176. package/build/query-controls/terms.js +1 -0
  177. package/build/query-controls/terms.js.map +1 -1
  178. package/build/radio-control/index.js +1 -0
  179. package/build/radio-control/index.js.map +1 -1
  180. package/build/radio-control/index.native.js +1 -0
  181. package/build/radio-control/index.native.js.map +1 -1
  182. package/build/range-control/mark.js +0 -1
  183. package/build/range-control/mark.js.map +1 -1
  184. package/build/range-control/rail.js +1 -0
  185. package/build/range-control/rail.js.map +1 -1
  186. package/build/range-control/styles/range-control-styles.js +33 -45
  187. package/build/range-control/styles/range-control-styles.js.map +1 -1
  188. package/build/resizable-box/index.js +1 -0
  189. package/build/resizable-box/index.js.map +1 -1
  190. package/build/sandbox/index.js +1 -0
  191. package/build/sandbox/index.js.map +1 -1
  192. package/build/sandbox/index.native.js +1 -0
  193. package/build/sandbox/index.native.js.map +1 -1
  194. package/build/search-control/index.native.js +1 -0
  195. package/build/search-control/index.native.js.map +1 -1
  196. package/build/select-control/index.js +1 -0
  197. package/build/select-control/index.js.map +1 -1
  198. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -0
  199. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  200. package/build/slot-fill/provider.js +1 -0
  201. package/build/slot-fill/provider.js.map +1 -1
  202. package/build/slot-fill/slot.js +1 -0
  203. package/build/slot-fill/slot.js.map +1 -1
  204. package/build/snackbar/index.js +1 -0
  205. package/build/snackbar/index.js.map +1 -1
  206. package/build/snackbar/list.js +1 -0
  207. package/build/snackbar/list.js.map +1 -1
  208. package/build/tab-panel/index.js +1 -0
  209. package/build/tab-panel/index.js.map +1 -1
  210. package/build/tabs/index.js +1 -0
  211. package/build/tabs/index.js.map +1 -1
  212. package/build/text/utils.js +1 -0
  213. package/build/text/utils.js.map +1 -1
  214. package/build/theme/color-algorithms.js +1 -0
  215. package/build/theme/color-algorithms.js.map +1 -1
  216. package/build/toggle-group-control/toggle-group-control/styles.js +7 -7
  217. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  218. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
  219. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  220. package/build/toolbar/toolbar-group/index.js +1 -0
  221. package/build/toolbar/toolbar-group/index.js.map +1 -1
  222. package/build/tools-panel/tools-panel/hook.js +1 -0
  223. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  224. package/build/tools-panel/tools-panel-header/component.js +1 -0
  225. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  226. package/build/tree-grid/cell.js +4 -1
  227. package/build/tree-grid/cell.js.map +1 -1
  228. package/build/tree-grid/index.js +1 -0
  229. package/build/tree-grid/index.js.map +1 -1
  230. package/build/tree-grid/types.js.map +1 -1
  231. package/build/tree-select/index.js +1 -0
  232. package/build/tree-select/index.js.map +1 -1
  233. package/build/unit-control/index.js +1 -0
  234. package/build/unit-control/index.js.map +1 -1
  235. package/build/unit-control/index.native.js +1 -0
  236. package/build/unit-control/index.native.js.map +1 -1
  237. package/build/unit-control/unit-select-control.js +1 -0
  238. package/build/unit-control/unit-select-control.js.map +1 -1
  239. package/build/unit-control/utils.js +1 -0
  240. package/build/unit-control/utils.js.map +1 -1
  241. package/build/utils/colors-values.js +3 -0
  242. package/build/utils/colors-values.js.map +1 -1
  243. package/build/utils/config-values.js +0 -1
  244. package/build/utils/config-values.js.map +1 -1
  245. package/build/utils/get-valid-children.js +1 -0
  246. package/build/utils/get-valid-children.js.map +1 -1
  247. package/build/utils/hooks/use-animated-offset-rect.js +1 -0
  248. package/build/utils/hooks/use-animated-offset-rect.js.map +1 -1
  249. package/build/utils/hooks/use-cx.js +1 -0
  250. package/build/utils/hooks/use-cx.js.map +1 -1
  251. package/build/utils/math.js +1 -0
  252. package/build/utils/math.js.map +1 -1
  253. package/build/utils/rtl.js +1 -0
  254. package/build/utils/rtl.js.map +1 -1
  255. package/build/utils/values.js +1 -0
  256. package/build/utils/values.js.map +1 -1
  257. package/build/z-stack/component.js +1 -0
  258. package/build/z-stack/component.js.map +1 -1
  259. package/build-module/alignment-matrix-control/icon.js +1 -0
  260. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  261. package/build-module/alignment-matrix-control/index.js +1 -0
  262. package/build-module/alignment-matrix-control/index.js.map +1 -1
  263. package/build-module/animation/index.js +1 -1
  264. package/build-module/animation/index.js.map +1 -1
  265. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  266. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  267. package/build-module/autocomplete/autocompleter-ui.native.js +1 -0
  268. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  269. package/build-module/autocomplete/get-default-use-items.js +1 -0
  270. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  271. package/build-module/autocomplete/index.js +1 -0
  272. package/build-module/autocomplete/index.js.map +1 -1
  273. package/build-module/border-box-control/utils.js +1 -0
  274. package/build-module/border-box-control/utils.js.map +1 -1
  275. package/build-module/border-control/border-control-dropdown/component.js +1 -0
  276. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  277. package/build-module/border-control/border-control-style-picker/component.js +1 -0
  278. package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
  279. package/build-module/box-control/index.js +15 -15
  280. package/build-module/box-control/index.js.map +1 -1
  281. package/build-module/box-control/input-control.js +153 -0
  282. package/build-module/box-control/input-control.js.map +1 -0
  283. package/build-module/box-control/types.js.map +1 -1
  284. package/build-module/box-control/utils.js +48 -46
  285. package/build-module/box-control/utils.js.map +1 -1
  286. package/build-module/button/index.native.js +1 -0
  287. package/build-module/button/index.native.js.map +1 -1
  288. package/build-module/button/types.js.map +1 -1
  289. package/build-module/color-indicator/index.native.js +1 -0
  290. package/build-module/color-indicator/index.native.js.map +1 -1
  291. package/build-module/color-palette/index.js +1 -0
  292. package/build-module/color-palette/index.js.map +1 -1
  293. package/build-module/color-palette/index.native.js +1 -0
  294. package/build-module/color-palette/index.native.js.map +1 -1
  295. package/build-module/color-palette/utils.js +1 -0
  296. package/build-module/color-palette/utils.js.map +1 -1
  297. package/build-module/combobox-control/index.js +1 -0
  298. package/build-module/combobox-control/index.js.map +1 -1
  299. package/build-module/composite/legacy/index.js +1 -0
  300. package/build-module/composite/legacy/index.js.map +1 -1
  301. package/build-module/context/context-connect.js +1 -0
  302. package/build-module/context/context-connect.js.map +1 -1
  303. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -0
  304. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  305. package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -0
  306. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  307. package/build-module/custom-gradient-picker/gradient-bar/utils.js +1 -0
  308. package/build-module/custom-gradient-picker/gradient-bar/utils.js.map +1 -1
  309. package/build-module/custom-gradient-picker/index.js +1 -0
  310. package/build-module/custom-gradient-picker/index.js.map +1 -1
  311. package/build-module/custom-gradient-picker/serializer.js +1 -0
  312. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  313. package/build-module/custom-gradient-picker/utils.js +1 -0
  314. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  315. package/build-module/custom-select-control/index.js +3 -2
  316. package/build-module/custom-select-control/index.js.map +1 -1
  317. package/build-module/dashicon/index.js +1 -0
  318. package/build-module/dashicon/index.js.map +1 -1
  319. package/build-module/date-time/date/index.js +1 -0
  320. package/build-module/date-time/date/index.js.map +1 -1
  321. package/build-module/date-time/date/use-lilius/index.js +1 -0
  322. package/build-module/date-time/date/use-lilius/index.js.map +1 -1
  323. package/build-module/date-time/time/index.js +1 -0
  324. package/build-module/date-time/time/index.js.map +1 -1
  325. package/build-module/dimension-control/index.js +1 -0
  326. package/build-module/dimension-control/index.js.map +1 -1
  327. package/build-module/dimension-control/sizes.js +1 -0
  328. package/build-module/dimension-control/sizes.js.map +1 -1
  329. package/build-module/draggable/index.js +1 -0
  330. package/build-module/draggable/index.js.map +1 -1
  331. package/build-module/draggable/index.native.js +1 -0
  332. package/build-module/draggable/index.native.js.map +1 -1
  333. package/build-module/dropdown-menu/index.js +1 -0
  334. package/build-module/dropdown-menu/index.js.map +1 -1
  335. package/build-module/dropdown-menu/index.native.js +1 -0
  336. package/build-module/dropdown-menu/index.native.js.map +1 -1
  337. package/build-module/duotone-picker/color-list-picker/index.js +1 -0
  338. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  339. package/build-module/duotone-picker/duotone-picker.js +1 -0
  340. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  341. package/build-module/duotone-picker/utils.js +1 -0
  342. package/build-module/duotone-picker/utils.js.map +1 -1
  343. package/build-module/external-link/index.js +1 -0
  344. package/build-module/external-link/index.js.map +1 -1
  345. package/build-module/font-size-picker/font-size-picker-select.js +1 -0
  346. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  347. package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -0
  348. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  349. package/build-module/font-size-picker/index.js +1 -0
  350. package/build-module/font-size-picker/index.js.map +1 -1
  351. package/build-module/font-size-picker/index.native.js +1 -0
  352. package/build-module/font-size-picker/index.native.js.map +1 -1
  353. package/build-module/font-size-picker/utils.js +1 -0
  354. package/build-module/font-size-picker/utils.js.map +1 -1
  355. package/build-module/form-token-field/index.js +1 -0
  356. package/build-module/form-token-field/index.js.map +1 -1
  357. package/build-module/form-token-field/suggestions-list.js +1 -0
  358. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  359. package/build-module/gradient-picker/index.js +1 -0
  360. package/build-module/gradient-picker/index.js.map +1 -1
  361. package/build-module/guide/index.js +1 -0
  362. package/build-module/guide/index.js.map +1 -1
  363. package/build-module/guide/page-control.js +1 -0
  364. package/build-module/guide/page-control.js.map +1 -1
  365. package/build-module/h-stack/hook.js +1 -0
  366. package/build-module/h-stack/hook.js.map +1 -1
  367. package/build-module/higher-order/navigate-regions/index.js +1 -0
  368. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  369. package/build-module/higher-order/with-fallback-styles/index.js +1 -0
  370. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  371. package/build-module/higher-order/with-filters/index.js +1 -0
  372. package/build-module/higher-order/with-filters/index.js.map +1 -1
  373. package/build-module/higher-order/with-notices/index.js +1 -0
  374. package/build-module/higher-order/with-notices/index.js.map +1 -1
  375. package/build-module/index.js +1 -1
  376. package/build-module/index.js.map +1 -1
  377. package/build-module/keyboard-shortcuts/index.js +1 -0
  378. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  379. package/build-module/menu/styles.js +16 -16
  380. package/build-module/menu/styles.js.map +1 -1
  381. package/build-module/menu-items-choice/index.js +1 -0
  382. package/build-module/menu-items-choice/index.js.map +1 -1
  383. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +1 -0
  384. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  385. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -0
  386. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  387. package/build-module/mobile/bottom-sheet/picker-cell.native.js +1 -0
  388. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  389. package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -0
  390. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  391. package/build-module/mobile/color-settings/palette.screen.native.js +1 -0
  392. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  393. package/build-module/mobile/gradient/index.native.js +1 -0
  394. package/build-module/mobile/gradient/index.native.js.map +1 -1
  395. package/build-module/mobile/media-edit/index.native.js +1 -0
  396. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  397. package/build-module/mobile/picker/index.android.js +1 -0
  398. package/build-module/mobile/picker/index.android.js.map +1 -1
  399. package/build-module/mobile/picker/index.ios.js +1 -0
  400. package/build-module/mobile/picker/index.ios.js.map +1 -1
  401. package/build-module/mobile/segmented-control/index.native.js +1 -0
  402. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  403. package/build-module/mobile/utils/get-px-from-css-unit.native.js +1 -0
  404. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  405. package/build-module/navigable-container/container.js +1 -0
  406. package/build-module/navigable-container/container.js.map +1 -1
  407. package/build-module/navigation/group/index.js +1 -0
  408. package/build-module/navigation/group/index.js.map +1 -1
  409. package/build-module/navigation/menu/menu-title-search.js +1 -0
  410. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  411. package/build-module/navigation/menu/search-no-results-found.js +1 -0
  412. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  413. package/build-module/navigation/styles/navigation-styles.js +12 -12
  414. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  415. package/build-module/navigator/navigator/component.js +1 -0
  416. package/build-module/navigator/navigator/component.js.map +1 -1
  417. package/build-module/navigator/navigator-screen/component.js +1 -0
  418. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  419. package/build-module/navigator/utils/router.js +1 -0
  420. package/build-module/navigator/utils/router.js.map +1 -1
  421. package/build-module/notice/index.js +1 -0
  422. package/build-module/notice/index.js.map +1 -1
  423. package/build-module/notice/list.js +1 -0
  424. package/build-module/notice/list.js.map +1 -1
  425. package/build-module/notice/list.native.js +1 -0
  426. package/build-module/notice/list.native.js.map +1 -1
  427. package/build-module/palette-edit/index.js +1 -0
  428. package/build-module/palette-edit/index.js.map +1 -1
  429. package/build-module/panel/actions.native.js +1 -0
  430. package/build-module/panel/actions.native.js.map +1 -1
  431. package/build-module/query-controls/index.js +1 -0
  432. package/build-module/query-controls/index.js.map +1 -1
  433. package/build-module/query-controls/terms.js +1 -0
  434. package/build-module/query-controls/terms.js.map +1 -1
  435. package/build-module/radio-control/index.js +1 -0
  436. package/build-module/radio-control/index.js.map +1 -1
  437. package/build-module/radio-control/index.native.js +1 -0
  438. package/build-module/radio-control/index.native.js.map +1 -1
  439. package/build-module/range-control/mark.js +0 -1
  440. package/build-module/range-control/mark.js.map +1 -1
  441. package/build-module/range-control/rail.js +1 -0
  442. package/build-module/range-control/rail.js.map +1 -1
  443. package/build-module/range-control/styles/range-control-styles.js +33 -45
  444. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  445. package/build-module/resizable-box/index.js +1 -0
  446. package/build-module/resizable-box/index.js.map +1 -1
  447. package/build-module/sandbox/index.js +1 -0
  448. package/build-module/sandbox/index.js.map +1 -1
  449. package/build-module/sandbox/index.native.js +1 -0
  450. package/build-module/sandbox/index.native.js.map +1 -1
  451. package/build-module/search-control/index.native.js +1 -0
  452. package/build-module/search-control/index.native.js.map +1 -1
  453. package/build-module/select-control/index.js +1 -0
  454. package/build-module/select-control/index.js.map +1 -1
  455. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -0
  456. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  457. package/build-module/slot-fill/provider.js +1 -0
  458. package/build-module/slot-fill/provider.js.map +1 -1
  459. package/build-module/slot-fill/slot.js +1 -0
  460. package/build-module/slot-fill/slot.js.map +1 -1
  461. package/build-module/snackbar/index.js +1 -0
  462. package/build-module/snackbar/index.js.map +1 -1
  463. package/build-module/snackbar/list.js +1 -0
  464. package/build-module/snackbar/list.js.map +1 -1
  465. package/build-module/tab-panel/index.js +1 -0
  466. package/build-module/tab-panel/index.js.map +1 -1
  467. package/build-module/tabs/index.js +1 -0
  468. package/build-module/tabs/index.js.map +1 -1
  469. package/build-module/text/utils.js +1 -0
  470. package/build-module/text/utils.js.map +1 -1
  471. package/build-module/theme/color-algorithms.js +1 -0
  472. package/build-module/theme/color-algorithms.js.map +1 -1
  473. package/build-module/toggle-group-control/toggle-group-control/styles.js +7 -7
  474. package/build-module/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  475. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +8 -8
  476. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  477. package/build-module/toolbar/toolbar-group/index.js +1 -0
  478. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  479. package/build-module/tools-panel/tools-panel/hook.js +1 -0
  480. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  481. package/build-module/tools-panel/tools-panel-header/component.js +1 -0
  482. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  483. package/build-module/tree-grid/cell.js +4 -1
  484. package/build-module/tree-grid/cell.js.map +1 -1
  485. package/build-module/tree-grid/index.js +1 -0
  486. package/build-module/tree-grid/index.js.map +1 -1
  487. package/build-module/tree-grid/types.js.map +1 -1
  488. package/build-module/tree-select/index.js +1 -0
  489. package/build-module/tree-select/index.js.map +1 -1
  490. package/build-module/unit-control/index.js +1 -0
  491. package/build-module/unit-control/index.js.map +1 -1
  492. package/build-module/unit-control/index.native.js +1 -0
  493. package/build-module/unit-control/index.native.js.map +1 -1
  494. package/build-module/unit-control/unit-select-control.js +1 -0
  495. package/build-module/unit-control/unit-select-control.js.map +1 -1
  496. package/build-module/unit-control/utils.js +1 -0
  497. package/build-module/unit-control/utils.js.map +1 -1
  498. package/build-module/utils/colors-values.js +3 -0
  499. package/build-module/utils/colors-values.js.map +1 -1
  500. package/build-module/utils/config-values.js +0 -1
  501. package/build-module/utils/config-values.js.map +1 -1
  502. package/build-module/utils/get-valid-children.js +1 -0
  503. package/build-module/utils/get-valid-children.js.map +1 -1
  504. package/build-module/utils/hooks/use-animated-offset-rect.js +1 -0
  505. package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -1
  506. package/build-module/utils/hooks/use-cx.js +1 -0
  507. package/build-module/utils/hooks/use-cx.js.map +1 -1
  508. package/build-module/utils/math.js +1 -0
  509. package/build-module/utils/math.js.map +1 -1
  510. package/build-module/utils/rtl.js +1 -0
  511. package/build-module/utils/rtl.js.map +1 -1
  512. package/build-module/utils/values.js +1 -0
  513. package/build-module/utils/values.js.map +1 -1
  514. package/build-module/z-stack/component.js +1 -0
  515. package/build-module/z-stack/component.js.map +1 -1
  516. package/build-style/style-rtl.css +3 -3
  517. package/build-style/style.css +3 -3
  518. package/build-types/alignment-matrix-control/styles.d.ts.map +1 -1
  519. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  520. package/build-types/animation/index.d.ts +1 -1
  521. package/build-types/animation/index.d.ts.map +1 -1
  522. package/build-types/base-control/hooks.d.ts +4 -4
  523. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  524. package/build-types/border-box-control/border-box-control/hook.d.ts +83 -83
  525. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +93 -93
  526. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +83 -83
  527. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +83 -83
  528. package/build-types/border-control/border-control/hook.d.ts +83 -83
  529. package/build-types/border-control/border-control-dropdown/hook.d.ts +83 -83
  530. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  531. package/build-types/box-control/index.d.ts.map +1 -1
  532. package/build-types/box-control/input-control.d.ts +3 -0
  533. package/build-types/box-control/input-control.d.ts.map +1 -0
  534. package/build-types/box-control/stories/index.story.d.ts +816 -816
  535. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  536. package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -1
  537. package/build-types/box-control/types.d.ts +9 -1
  538. package/build-types/box-control/types.d.ts.map +1 -1
  539. package/build-types/box-control/utils.d.ts +23 -15
  540. package/build-types/box-control/utils.d.ts.map +1 -1
  541. package/build-types/button/stories/index.story.d.ts +18 -0
  542. package/build-types/button/stories/index.story.d.ts.map +1 -1
  543. package/build-types/button/types.d.ts +6 -4
  544. package/build-types/button/types.d.ts.map +1 -1
  545. package/build-types/card/card/hook.d.ts +83 -83
  546. package/build-types/card/card-body/hook.d.ts +83 -83
  547. package/build-types/card/card-divider/hook.d.ts +84 -84
  548. package/build-types/card/card-footer/hook.d.ts +83 -83
  549. package/build-types/card/card-header/hook.d.ts +83 -83
  550. package/build-types/card/card-media/hook.d.ts +83 -83
  551. package/build-types/color-picker/styles.d.ts.map +1 -1
  552. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  553. package/build-types/composite/index.d.ts.map +1 -1
  554. package/build-types/context/constants.d.ts.map +1 -1
  555. package/build-types/context/get-styled-class-name-from-key.d.ts +1 -9
  556. package/build-types/context/get-styled-class-name-from-key.d.ts.map +1 -1
  557. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  558. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  559. package/build-types/date-time/date/styles.d.ts.map +1 -1
  560. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  561. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  562. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  563. package/build-types/date-time/time/styles.d.ts.map +1 -1
  564. package/build-types/dimension-control/stories/index.story.d.ts.map +1 -1
  565. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  566. package/build-types/elevation/hook.d.ts +83 -83
  567. package/build-types/flex/flex/hook.d.ts +83 -83
  568. package/build-types/flex/flex-block/hook.d.ts +83 -83
  569. package/build-types/flex/flex-item/hook.d.ts +83 -83
  570. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  571. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  572. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  573. package/build-types/grid/hook.d.ts +83 -83
  574. package/build-types/h-stack/hook.d.ts +83 -83
  575. package/build-types/heading/hook.d.ts +82 -82
  576. package/build-types/higher-order/with-fallback-styles/index.d.ts +2 -2
  577. package/build-types/higher-order/with-filters/index.d.ts +4 -4
  578. package/build-types/index.d.ts +1 -1
  579. package/build-types/index.d.ts.map +1 -1
  580. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  581. package/build-types/item-group/item/hook.d.ts +83 -83
  582. package/build-types/item-group/item-group/hook.d.ts +83 -83
  583. package/build-types/menu/styles.d.ts.map +1 -1
  584. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  585. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  586. package/build-types/navigator/navigator-back-button/hook.d.ts +92 -92
  587. package/build-types/navigator/navigator-button/hook.d.ts +92 -92
  588. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  589. package/build-types/progress-bar/styles.d.ts.map +1 -1
  590. package/build-types/range-control/mark.d.ts.map +1 -1
  591. package/build-types/range-control/styles/range-control-styles.d.ts +2 -2
  592. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  593. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  594. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  595. package/build-types/scrollable/hook.d.ts +83 -83
  596. package/build-types/scrollable/stories/index.story.d.ts.map +1 -1
  597. package/build-types/select-control/index.d.ts.map +1 -1
  598. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  599. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  600. package/build-types/spacer/hook.d.ts +83 -83
  601. package/build-types/spinner/styles.d.ts.map +1 -1
  602. package/build-types/surface/hook.d.ts +83 -83
  603. package/build-types/text/hook.d.ts +83 -83
  604. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  605. package/build-types/tools-panel/tools-panel/hook.d.ts +83 -83
  606. package/build-types/tools-panel/tools-panel-header/hook.d.ts +83 -83
  607. package/build-types/tools-panel/tools-panel-item/hook.d.ts +83 -83
  608. package/build-types/tree-grid/cell.d.ts.map +1 -1
  609. package/build-types/tree-grid/types.d.ts +1 -1
  610. package/build-types/tree-grid/types.d.ts.map +1 -1
  611. package/build-types/truncate/hook.d.ts +83 -83
  612. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  613. package/build-types/utils/colors-values.d.ts +3 -0
  614. package/build-types/utils/colors-values.d.ts.map +1 -1
  615. package/build-types/utils/config-values.d.ts +0 -1
  616. package/build-types/utils/hooks/use-controlled-state.d.ts +1 -1
  617. package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
  618. package/build-types/utils/rtl.d.ts +1 -1
  619. package/build-types/utils/rtl.d.ts.map +1 -1
  620. package/build-types/v-stack/hook.d.ts +83 -83
  621. package/build-types/z-stack/styles.d.ts.map +1 -1
  622. package/package.json +19 -19
  623. package/src/alignment-matrix-control/stories/index.story.tsx +2 -2
  624. package/src/angle-picker-control/stories/index.story.tsx +2 -2
  625. package/src/animation/index.tsx +0 -1
  626. package/src/base-control/stories/index.story.tsx +1 -1
  627. package/src/border-box-control/stories/index.story.tsx +1 -1
  628. package/src/border-control/stories/index.story.tsx +1 -1
  629. package/src/box-control/index.tsx +24 -14
  630. package/src/box-control/input-control.tsx +197 -0
  631. package/src/box-control/stories/index.story.tsx +1 -1
  632. package/src/box-control/types.ts +9 -1
  633. package/src/box-control/utils.ts +62 -60
  634. package/src/button/README.md +108 -219
  635. package/src/button/docs-manifest.json +5 -0
  636. package/src/button/stories/best-practices.mdx +31 -0
  637. package/src/button/stories/index.story.tsx +18 -0
  638. package/src/button/types.ts +6 -4
  639. package/src/button-group/stories/index.story.tsx +1 -1
  640. package/src/card/stories/index.story.tsx +2 -2
  641. package/src/checkbox-control/stories/index.story.tsx +1 -1
  642. package/src/circular-option-picker/stories/index.story.tsx +2 -2
  643. package/src/color-palette/stories/index.story.tsx +3 -3
  644. package/src/color-picker/stories/index.story.tsx +2 -2
  645. package/src/combobox-control/stories/index.story.tsx +1 -1
  646. package/src/composite/stories/index.story.tsx +3 -3
  647. package/src/confirm-dialog/stories/index.story.tsx +1 -1
  648. package/src/custom-select-control/index.tsx +2 -2
  649. package/src/custom-select-control/stories/index.story.tsx +2 -2
  650. package/src/custom-select-control-v2/stories/index.story.tsx +2 -2
  651. package/src/date-time/stories/date-time.story.tsx +4 -1
  652. package/src/date-time/stories/date.story.tsx +4 -1
  653. package/src/date-time/stories/time.story.tsx +4 -1
  654. package/src/dimension-control/stories/index.story.tsx +1 -1
  655. package/src/disabled/stories/index.story.tsx +3 -3
  656. package/src/divider/stories/index.story.tsx +1 -1
  657. package/src/draggable/stories/index.story.tsx +2 -2
  658. package/src/dropdown/stories/index.story.tsx +7 -7
  659. package/src/dropdown-menu/index.tsx +3 -1
  660. package/src/dropdown-menu/stories/index.story.tsx +3 -3
  661. package/src/duotone-picker/stories/duotone-picker.story.tsx +1 -1
  662. package/src/flex/stories/index.story.tsx +1 -1
  663. package/src/font-size-picker/stories/index.story.tsx +1 -1
  664. package/src/form-file-upload/stories/index.story.tsx +3 -3
  665. package/src/form-token-field/stories/index.story.tsx +2 -2
  666. package/src/gradient-picker/stories/index.story.tsx +1 -1
  667. package/src/grid/stories/index.story.tsx +1 -1
  668. package/src/h-stack/stories/index.story.tsx +2 -2
  669. package/src/index.ts +1 -5
  670. package/src/input-control/stories/index.story.tsx +4 -4
  671. package/src/item-group/stories/index.story.tsx +2 -2
  672. package/src/menu/stories/index.story.tsx +2 -2
  673. package/src/menu/styles.ts +1 -1
  674. package/src/menu-group/stories/index.story.tsx +1 -1
  675. package/src/menu-item/stories/index.story.tsx +1 -1
  676. package/src/menu-items-choice/stories/index.story.tsx +1 -1
  677. package/src/modal/stories/index.story.tsx +2 -2
  678. package/src/modal/test/index.tsx +2 -1
  679. package/src/navigable-container/stories/navigable-menu.story.tsx +1 -1
  680. package/src/navigable-container/stories/tabbable-container.story.tsx +1 -1
  681. package/src/navigation/stories/index.story.tsx +4 -4
  682. package/src/navigation/styles/navigation-styles.tsx +3 -2
  683. package/src/navigator/stories/index.story.tsx +3 -3
  684. package/src/number-control/stories/index.story.tsx +1 -1
  685. package/src/panel/stories/index.story.tsx +1 -1
  686. package/src/placeholder/stories/index.story.tsx +3 -3
  687. package/src/popover/stories/index.story.tsx +11 -9
  688. package/src/query-controls/stories/index.story.tsx +6 -6
  689. package/src/radio-control/stories/index.story.tsx +1 -1
  690. package/src/radio-group/stories/index.story.tsx +3 -3
  691. package/src/range-control/mark.tsx +0 -1
  692. package/src/range-control/stories/index.story.tsx +7 -7
  693. package/src/range-control/styles/range-control-styles.ts +18 -19
  694. package/src/resizable-box/stories/index.story.tsx +1 -1
  695. package/src/responsive-wrapper/stories/index.story.tsx +1 -1
  696. package/src/sandbox/stories/index.story.tsx +1 -1
  697. package/src/scrollable/stories/index.story.tsx +2 -1
  698. package/src/search-control/stories/index.story.tsx +1 -1
  699. package/src/select-control/stories/index.story.tsx +1 -1
  700. package/src/slot-fill/stories/index.story.tsx +2 -2
  701. package/src/snackbar/stories/index.story.tsx +4 -4
  702. package/src/snackbar/stories/list.story.tsx +2 -2
  703. package/src/surface/stories/index.story.tsx +1 -1
  704. package/src/text-control/stories/index.story.tsx +1 -1
  705. package/src/textarea-control/stories/index.story.tsx +1 -1
  706. package/src/theme/stories/index.story.tsx +1 -1
  707. package/src/toggle-control/stories/index.story.tsx +1 -1
  708. package/src/toggle-group-control/stories/index.story.tsx +1 -1
  709. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +22 -22
  710. package/src/toggle-group-control/toggle-group-control/styles.ts +1 -1
  711. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +6 -6
  712. package/src/toolbar/stories/index.story.tsx +1 -1
  713. package/src/tools-panel/stories/index.story.tsx +3 -3
  714. package/src/tools-panel/test/index.tsx +0 -17
  715. package/src/tooltip/stories/index.story.tsx +1 -1
  716. package/src/tree-grid/cell.tsx +5 -1
  717. package/src/tree-grid/stories/index.story.tsx +1 -1
  718. package/src/tree-grid/types.ts +1 -1
  719. package/src/tree-select/stories/index.story.tsx +1 -1
  720. package/src/unit-control/stories/index.story.tsx +4 -4
  721. package/src/utils/colors-values.js +3 -0
  722. package/src/utils/config-values.js +0 -1
  723. package/src/view/stories/index.story.tsx +1 -1
  724. package/src/visually-hidden/stories/index.story.tsx +1 -1
  725. package/src/z-stack/stories/index.story.tsx +1 -1
  726. package/tsconfig.tsbuildinfo +1 -1
  727. package/build/box-control/all-input-control.js +0 -91
  728. package/build/box-control/all-input-control.js.map +0 -1
  729. package/build/box-control/axial-input-controls.js +0 -125
  730. package/build/box-control/axial-input-controls.js.map +0 -1
  731. package/build/box-control/input-controls.js +0 -133
  732. package/build/box-control/input-controls.js.map +0 -1
  733. package/build-module/box-control/all-input-control.js +0 -84
  734. package/build-module/box-control/all-input-control.js.map +0 -1
  735. package/build-module/box-control/axial-input-controls.js +0 -116
  736. package/build-module/box-control/axial-input-controls.js.map +0 -1
  737. package/build-module/box-control/input-controls.js +0 -124
  738. package/build-module/box-control/input-controls.js.map +0 -1
  739. package/build-types/box-control/all-input-control.d.ts +0 -3
  740. package/build-types/box-control/all-input-control.d.ts.map +0 -1
  741. package/build-types/box-control/axial-input-controls.d.ts +0 -3
  742. package/build-types/box-control/axial-input-controls.d.ts.map +0 -1
  743. package/build-types/box-control/input-controls.d.ts +0 -3
  744. package/build-types/box-control/input-controls.d.ts.map +0 -1
  745. package/src/box-control/all-input-control.tsx +0 -110
  746. package/src/box-control/axial-input-controls.tsx +0 -165
  747. package/src/box-control/input-controls.tsx +0 -167
@@ -1,91 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = AllInputControl;
7
- var _compose = require("@wordpress/compose");
8
- var _boxControlStyles = require("./styles/box-control-styles");
9
- var _unitControl = require("../unit-control");
10
- var _utils = require("./utils");
11
- var _jsxRuntime = require("react/jsx-runtime");
12
- /**
13
- * WordPress dependencies
14
- */
15
-
16
- /**
17
- * Internal dependencies
18
- */
19
-
20
- const noop = () => {};
21
- function AllInputControl({
22
- __next40pxDefaultSize,
23
- onChange = noop,
24
- onFocus = noop,
25
- values,
26
- sides,
27
- selectedUnits,
28
- setSelectedUnits,
29
- ...props
30
- }) {
31
- var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2;
32
- const inputId = (0, _compose.useInstanceId)(AllInputControl, 'box-control-input-all');
33
- const allValue = (0, _utils.getAllValue)(values, selectedUnits, sides);
34
- const hasValues = (0, _utils.isValuesDefined)(values);
35
- const isMixed = hasValues && (0, _utils.isValuesMixed)(values, selectedUnits, sides);
36
- const allPlaceholder = isMixed ? _utils.LABELS.mixed : undefined;
37
- const [parsedQuantity, parsedUnit] = (0, _unitControl.parseQuantityAndUnitFromRawValue)(allValue);
38
- const handleOnFocus = event => {
39
- onFocus(event, {
40
- side: 'all'
41
- });
42
- };
43
- const onValueChange = next => {
44
- const isNumeric = next !== undefined && !isNaN(parseFloat(next));
45
- const nextValue = isNumeric ? next : undefined;
46
- const nextValues = (0, _utils.applyValueToSides)(values, nextValue, sides);
47
- onChange(nextValues);
48
- };
49
- const sliderOnChange = next => {
50
- onValueChange(next !== undefined ? [next, parsedUnit].join('') : undefined);
51
- };
52
-
53
- // Set selected unit so it can be used as fallback by unlinked controls
54
- // when individual sides do not have a value containing a unit.
55
- const handleOnUnitChange = unit => {
56
- const newUnits = (0, _utils.applyValueToSides)(selectedUnits, unit, sides);
57
- setSelectedUnits(newUnits);
58
- };
59
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
60
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.StyledUnitControl, {
61
- ...props,
62
- __shouldNotWarnDeprecated36pxSize: true,
63
- __next40pxDefaultSize: __next40pxDefaultSize,
64
- className: "component-box-control__unit-control",
65
- disableUnits: isMixed,
66
- id: inputId,
67
- isPressEnterToChange: true,
68
- value: allValue,
69
- onChange: onValueChange,
70
- onUnitChange: handleOnUnitChange,
71
- onFocus: handleOnFocus,
72
- placeholder: allPlaceholder,
73
- label: _utils.LABELS.all,
74
- hideLabelFromVision: true
75
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.FlexedRangeControl, {
76
- __nextHasNoMarginBottom: true,
77
- __next40pxDefaultSize: __next40pxDefaultSize,
78
- __shouldNotWarnDeprecated36pxSize: true,
79
- "aria-controls": inputId,
80
- label: _utils.LABELS.all,
81
- hideLabelFromVision: true,
82
- onChange: sliderOnChange,
83
- min: 0,
84
- max: (_CUSTOM_VALUE_SETTING = _utils.CUSTOM_VALUE_SETTINGS[parsedUnit !== null && parsedUnit !== void 0 ? parsedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10,
85
- step: (_CUSTOM_VALUE_SETTING2 = _utils.CUSTOM_VALUE_SETTINGS[parsedUnit !== null && parsedUnit !== void 0 ? parsedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1,
86
- value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0,
87
- withInputField: false
88
- })]
89
- });
90
- }
91
- //# sourceMappingURL=all-input-control.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_compose","require","_boxControlStyles","_unitControl","_utils","_jsxRuntime","noop","AllInputControl","__next40pxDefaultSize","onChange","onFocus","values","sides","selectedUnits","setSelectedUnits","props","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","inputId","useInstanceId","allValue","getAllValue","hasValues","isValuesDefined","isMixed","isValuesMixed","allPlaceholder","LABELS","mixed","undefined","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","handleOnFocus","event","side","onValueChange","next","isNumeric","isNaN","parseFloat","nextValue","nextValues","applyValueToSides","sliderOnChange","join","handleOnUnitChange","unit","newUnits","jsxs","Fragment","children","jsx","StyledUnitControl","__shouldNotWarnDeprecated36pxSize","className","disableUnits","id","isPressEnterToChange","value","onUnitChange","placeholder","label","all","hideLabelFromVision","FlexedRangeControl","__nextHasNoMarginBottom","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/all-input-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport type { UnitControlProps } from '../unit-control/types';\nimport {\n\tFlexedRangeControl,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps } from './types';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control';\nimport {\n\tLABELS,\n\tapplyValueToSides,\n\tgetAllValue,\n\tisValuesMixed,\n\tisValuesDefined,\n\tCUSTOM_VALUE_SETTINGS,\n} from './utils';\n\nconst noop = () => {};\n\nexport default function AllInputControl( {\n\t__next40pxDefaultSize,\n\tonChange = noop,\n\tonFocus = noop,\n\tvalues,\n\tsides,\n\tselectedUnits,\n\tsetSelectedUnits,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst inputId = useInstanceId( AllInputControl, 'box-control-input-all' );\n\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst hasValues = isValuesDefined( values );\n\tconst isMixed = hasValues && isValuesMixed( values, selectedUnits, sides );\n\tconst allPlaceholder = isMixed ? LABELS.mixed : undefined;\n\n\tconst [ parsedQuantity, parsedUnit ] =\n\t\tparseQuantityAndUnitFromRawValue( allValue );\n\n\tconst handleOnFocus: React.FocusEventHandler< HTMLInputElement > = (\n\t\tevent\n\t) => {\n\t\tonFocus( event, { side: 'all' } );\n\t};\n\n\tconst onValueChange = ( next?: string ) => {\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\t\tconst nextValues = applyValueToSides( values, nextValue, sides );\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst sliderOnChange = ( next?: number ) => {\n\t\tonValueChange(\n\t\t\tnext !== undefined ? [ next, parsedUnit ].join( '' ) : undefined\n\t\t);\n\t};\n\n\t// Set selected unit so it can be used as fallback by unlinked controls\n\t// when individual sides do not have a value containing a unit.\n\tconst handleOnUnitChange: UnitControlProps[ 'onUnitChange' ] = ( unit ) => {\n\t\tconst newUnits = applyValueToSides( selectedUnits, unit, sides );\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StyledUnitControl\n\t\t\t\t{ ...props }\n\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\tdisableUnits={ isMixed }\n\t\t\t\tid={ inputId }\n\t\t\t\tisPressEnterToChange\n\t\t\t\tvalue={ allValue }\n\t\t\t\tonChange={ onValueChange }\n\t\t\t\tonUnitChange={ handleOnUnitChange }\n\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\tplaceholder={ allPlaceholder }\n\t\t\t\tlabel={ LABELS.all }\n\t\t\t\thideLabelFromVision\n\t\t\t/>\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.all }\n\t\t\t\thideLabelFromVision\n\t\t\t\tonChange={ sliderOnChange }\n\t\t\t\tmin={ 0 }\n\t\t\t\tmax={ CUSTOM_VALUE_SETTINGS[ parsedUnit ?? 'px' ]?.max ?? 10 }\n\t\t\t\tstep={\n\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ parsedUnit ?? '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</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAD,OAAA;AAKA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAOiB,IAAAI,WAAA,GAAAJ,OAAA;AArBjB;AACA;AACA;;AAEA;AACA;AACA;;AAiBA,MAAMK,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEN,SAASC,eAAeA,CAAE;EACxCC,qBAAqB;EACrBC,QAAQ,GAAGH,IAAI;EACfI,OAAO,GAAGJ,IAAI;EACdK,MAAM;EACNC,KAAK;EACLC,aAAa;EACbC,gBAAgB;EAChB,GAAGC;AACyB,CAAC,EAAG;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EAChC,MAAMC,OAAO,GAAG,IAAAC,sBAAa,EAAEZ,eAAe,EAAE,uBAAwB,CAAC;EAEzE,MAAMa,QAAQ,GAAG,IAAAC,kBAAW,EAAEV,MAAM,EAAEE,aAAa,EAAED,KAAM,CAAC;EAC5D,MAAMU,SAAS,GAAG,IAAAC,sBAAe,EAAEZ,MAAO,CAAC;EAC3C,MAAMa,OAAO,GAAGF,SAAS,IAAI,IAAAG,oBAAa,EAAEd,MAAM,EAAEE,aAAa,EAAED,KAAM,CAAC;EAC1E,MAAMc,cAAc,G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,EAAGhC,OAAS;MACxBiC,EAAE,EAAGvC,OAAS;MACdwC,oBAAoB;MACpBC,KAAK,EAAGvC,QAAU;MAClBX,QAAQ,EAAG2B,aAAe;MAC1BwB,YAAY,EAAGd,kBAAoB;MACnCpC,OAAO,EAAGuB,aAAe;MACzB4B,WAAW,EAAGnC,cAAgB;MAC9BoC,KAAK,EAAGnC,aAAM,CAACoC,GAAK;MACpBC,mBAAmB;IAAA,CACnB,CAAC,eAEF,IAAA3D,WAAA,CAAA+C,GAAA,EAAClD,iBAAA,CAAA+D,kBAAkB;MAClBC,uBAAuB;MACvB1D,qBAAqB,EAAGA,qBAAuB;MAC/C8C,iCAAiC;MACjC,iBAAgBpC,OAAS;MACzB4C,KAAK,EAAGnC,aAAM,CAACoC,GAAK;MACpBC,mBAAmB;MACnBvD,QAAQ,EAAGmC,cAAgB;MAC3BuB,GAAG,EAAG,CAAG;MACTC,GAAG,GAAApD,qBAAA,GAAGqD,4BAAqB,CAAEtC,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,IAAI,CAAE,EAAEqC,GAAG,cAAApD,qBAAA,cAAAA,qBAAA,GAAI,EAAI;MAC9DsD,IAAI,GAAArD,sBAAA,GACHoD,4BAAqB,CAAEtC,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,IAAI,CAAE,EAAEuC,IAAI,cAAArD,sBAAA,cAAAA,sBAAA,GAAI,GACrD;MACD0C,KAAK,EAAG7B,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAG;MAC7ByC,cAAc,EAAG;IAAO,CACxB,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
@@ -1,125 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = AxialInputControls;
8
- var _compose = require("@wordpress/compose");
9
- var _utils = require("../unit-control/utils");
10
- var _tooltip = _interopRequireDefault(require("../tooltip"));
11
- var _utils2 = require("./utils");
12
- var _boxControlStyles = require("./styles/box-control-styles");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- var _react = require("react");
15
- /**
16
- * WordPress dependencies
17
- */
18
-
19
- /**
20
- * Internal dependencies
21
- */
22
-
23
- const groupedSides = ['vertical', 'horizontal'];
24
- function AxialInputControls({
25
- __next40pxDefaultSize,
26
- onChange,
27
- onFocus,
28
- values,
29
- selectedUnits,
30
- setSelectedUnits,
31
- sides,
32
- ...props
33
- }) {
34
- const generatedId = (0, _compose.useInstanceId)(AxialInputControls, `box-control-input`);
35
- const createHandleOnFocus = side => event => {
36
- if (!onFocus) {
37
- return;
38
- }
39
- onFocus(event, {
40
- side
41
- });
42
- };
43
- const handleOnValueChange = (side, next) => {
44
- if (!onChange) {
45
- return;
46
- }
47
- const nextValues = {
48
- ...values
49
- };
50
- const isNumeric = next !== undefined && !isNaN(parseFloat(next));
51
- const nextValue = isNumeric ? next : undefined;
52
- if (side === 'vertical') {
53
- nextValues.top = nextValue;
54
- nextValues.bottom = nextValue;
55
- }
56
- if (side === 'horizontal') {
57
- nextValues.left = nextValue;
58
- nextValues.right = nextValue;
59
- }
60
- onChange(nextValues);
61
- };
62
- const createHandleOnUnitChange = side => next => {
63
- const newUnits = {
64
- ...selectedUnits
65
- };
66
- if (side === 'vertical') {
67
- newUnits.top = next;
68
- newUnits.bottom = next;
69
- }
70
- if (side === 'horizontal') {
71
- newUnits.left = next;
72
- newUnits.right = next;
73
- }
74
- setSelectedUnits(newUnits);
75
- };
76
-
77
- // Filter sides if custom configuration provided, maintaining default order.
78
- const filteredSides = sides?.length ? groupedSides.filter(side => sides.includes(side)) : groupedSides;
79
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
80
- children: filteredSides.map(side => {
81
- var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2;
82
- const [parsedQuantity, parsedUnit] = (0, _utils.parseQuantityAndUnitFromRawValue)(side === 'vertical' ? values.top : values.left);
83
- const selectedUnit = side === 'vertical' ? selectedUnits.top : selectedUnits.left;
84
- const inputId = [generatedId, side].join('-');
85
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_boxControlStyles.InputWrapper, {
86
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.FlexedBoxControlIcon, {
87
- side: side,
88
- sides: sides
89
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.default, {
90
- placement: "top-end",
91
- text: _utils2.LABELS[side],
92
- children: /*#__PURE__*/(0, _react.createElement)(_boxControlStyles.StyledUnitControl, {
93
- ...props,
94
- __shouldNotWarnDeprecated36pxSize: true,
95
- __next40pxDefaultSize: __next40pxDefaultSize,
96
- className: "component-box-control__unit-control",
97
- id: inputId,
98
- isPressEnterToChange: true,
99
- value: [parsedQuantity, selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : parsedUnit].join(''),
100
- onChange: newValue => handleOnValueChange(side, newValue),
101
- onUnitChange: createHandleOnUnitChange(side),
102
- onFocus: createHandleOnFocus(side),
103
- label: _utils2.LABELS[side],
104
- hideLabelFromVision: true,
105
- key: side
106
- })
107
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.FlexedRangeControl, {
108
- __nextHasNoMarginBottom: true,
109
- __next40pxDefaultSize: __next40pxDefaultSize,
110
- __shouldNotWarnDeprecated36pxSize: true,
111
- "aria-controls": inputId,
112
- label: _utils2.LABELS[side],
113
- hideLabelFromVision: true,
114
- onChange: newValue => handleOnValueChange(side, newValue !== undefined ? [newValue, selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : parsedUnit].join('') : undefined),
115
- min: 0,
116
- max: (_CUSTOM_VALUE_SETTING = _utils2.CUSTOM_VALUE_SETTINGS[selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10,
117
- step: (_CUSTOM_VALUE_SETTING2 = _utils2.CUSTOM_VALUE_SETTINGS[selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1,
118
- value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0,
119
- withInputField: false
120
- })]
121
- }, side);
122
- })
123
- });
124
- }
125
- //# sourceMappingURL=axial-input-controls.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_compose","require","_utils","_tooltip","_interopRequireDefault","_utils2","_boxControlStyles","_jsxRuntime","_react","groupedSides","AxialInputControls","__next40pxDefaultSize","onChange","onFocus","values","selectedUnits","setSelectedUnits","sides","props","generatedId","useInstanceId","createHandleOnFocus","side","event","handleOnValueChange","next","nextValues","isNumeric","undefined","isNaN","parseFloat","nextValue","top","bottom","left","right","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","jsx","Fragment","children","map","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","selectedUnit","inputId","join","jsxs","InputWrapper","FlexedBoxControlIcon","default","placement","text","LABELS","createElement","StyledUnitControl","__shouldNotWarnDeprecated36pxSize","className","id","isPressEnterToChange","value","newValue","onUnitChange","label","hideLabelFromVision","key","FlexedRangeControl","__nextHasNoMarginBottom","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/axial-input-controls.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport Tooltip from '../tooltip';\nimport { CUSTOM_VALUE_SETTINGS, LABELS } from './utils';\nimport {\n\tFlexedBoxControlIcon,\n\tFlexedRangeControl,\n\tInputWrapper,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps } from './types';\n\nconst groupedSides = [ 'vertical', 'horizontal' ] as const;\ntype GroupedSide = ( typeof groupedSides )[ number ];\n\nexport default function AxialInputControls( {\n\t__next40pxDefaultSize,\n\tonChange,\n\tonFocus,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst generatedId = useInstanceId(\n\t\tAxialInputControls,\n\t\t`box-control-input`\n\t);\n\n\tconst createHandleOnFocus =\n\t\t( side: GroupedSide ) =>\n\t\t( event: React.FocusEvent< HTMLInputElement > ) => {\n\t\t\tif ( ! onFocus ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonFocus( event, { side } );\n\t\t};\n\n\tconst handleOnValueChange = ( side: GroupedSide, next?: string ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnextValues.top = nextValue;\n\t\t\tnextValues.bottom = nextValue;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnextValues.left = nextValue;\n\t\t\tnextValues.right = nextValue;\n\t\t}\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange =\n\t\t( side: GroupedSide ) => ( next?: string ) => {\n\t\t\tconst newUnits = { ...selectedUnits };\n\n\t\t\tif ( side === 'vertical' ) {\n\t\t\t\tnewUnits.top = next;\n\t\t\t\tnewUnits.bottom = next;\n\t\t\t}\n\n\t\t\tif ( side === 'horizontal' ) {\n\t\t\t\tnewUnits.left = next;\n\t\t\t\tnewUnits.right = next;\n\t\t\t}\n\n\t\t\tsetSelectedUnits( newUnits );\n\t\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? groupedSides.filter( ( side ) => sides.includes( side ) )\n\t\t: groupedSides;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue(\n\t\t\t\t\t\tside === 'vertical' ? values.top : values.left\n\t\t\t\t\t);\n\t\t\t\tconst selectedUnit =\n\t\t\t\t\tside === 'vertical'\n\t\t\t\t\t\t? selectedUnits.top\n\t\t\t\t\t\t: selectedUnits.left;\n\n\t\t\t\tconst inputId = [ generatedId, side ].join( '-' );\n\n\t\t\t\treturn (\n\t\t\t\t\t<InputWrapper key={ side }>\n\t\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t\t<Tooltip placement=\"top-end\" text={ LABELS[ side ] }>\n\t\t\t\t\t\t\t<StyledUnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\t\t\t\tid={ inputId }\n\t\t\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\t\t\tvalue={ [\n\t\t\t\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t\t\t].join( '' ) }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\t\thandleOnValueChange( side, newValue )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tside\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tkey={ side }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<FlexedRangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t\t\taria-controls={ inputId }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t\t\t\tnewValue,\n\t\t\t\t\t\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t\t\t\t\t ].join( '' )\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ selectedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.max ?? 10\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ selectedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InputWrapper>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,O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AI,CAAE,EAAG,CAAC,GACZzB,SACJ,CACA;UACD+C,GAAG,EAAG,CAAG;UACTC,GAAG,GAAA9B,qBAAA,GACF+B,6BAAqB,CAAE1B,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,IAAI,CAAE,EAC1CyB,GAAG,cAAA9B,qBAAA,cAAAA,qBAAA,GAAI,EACV;UACDgC,IAAI,GAAA/B,sBAAA,GACH8B,6BAAqB,CAAE1B,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,IAAI,CAAE,EAC1C2B,IAAI,cAAA/B,sBAAA,cAAAA,sBAAA,GAAI,GACX;UACDoB,KAAK,EAAGnB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAG;UAC7B+B,cAAc,EAAG;QAAO,CACxB,CAAC;MAAA,GAvDiBzD,IAwDN,CAAC;IAEjB,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
@@ -1,133 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = BoxInputControls;
8
- var _compose = require("@wordpress/compose");
9
- var _tooltip = _interopRequireDefault(require("../tooltip"));
10
- var _utils = require("../unit-control/utils");
11
- var _utils2 = require("./utils");
12
- var _boxControlStyles = require("./styles/box-control-styles");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * WordPress dependencies
16
- */
17
-
18
- /**
19
- * Internal dependencies
20
- */
21
-
22
- const noop = () => {};
23
- function BoxInputControls({
24
- __next40pxDefaultSize,
25
- onChange = noop,
26
- onFocus = noop,
27
- values,
28
- selectedUnits,
29
- setSelectedUnits,
30
- sides,
31
- ...props
32
- }) {
33
- const generatedId = (0, _compose.useInstanceId)(BoxInputControls, 'box-control-input');
34
- const createHandleOnFocus = side => event => {
35
- onFocus(event, {
36
- side
37
- });
38
- };
39
- const handleOnChange = nextValues => {
40
- onChange(nextValues);
41
- };
42
- const handleOnValueChange = (side, next, extra) => {
43
- const nextValues = {
44
- ...values
45
- };
46
- const isNumeric = next !== undefined && !isNaN(parseFloat(next));
47
- const nextValue = isNumeric ? next : undefined;
48
- nextValues[side] = nextValue;
49
-
50
- /**
51
- * Supports changing pair sides. For example, holding the ALT key
52
- * when changing the TOP will also update BOTTOM.
53
- */
54
- // @ts-expect-error - TODO: event.altKey is only present when the change event was
55
- // triggered by a keyboard event. Should this feature be implemented differently so
56
- // it also works with drag events?
57
- if (extra?.event.altKey) {
58
- switch (side) {
59
- case 'top':
60
- nextValues.bottom = nextValue;
61
- break;
62
- case 'bottom':
63
- nextValues.top = nextValue;
64
- break;
65
- case 'left':
66
- nextValues.right = nextValue;
67
- break;
68
- case 'right':
69
- nextValues.left = nextValue;
70
- break;
71
- }
72
- }
73
- handleOnChange(nextValues);
74
- };
75
- const createHandleOnUnitChange = side => next => {
76
- const newUnits = {
77
- ...selectedUnits
78
- };
79
- newUnits[side] = next;
80
- setSelectedUnits(newUnits);
81
- };
82
-
83
- // Filter sides if custom configuration provided, maintaining default order.
84
- const filteredSides = sides?.length ? _utils2.ALL_SIDES.filter(side => sides.includes(side)) : _utils2.ALL_SIDES;
85
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
86
- children: filteredSides.map(side => {
87
- var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2;
88
- const [parsedQuantity, parsedUnit] = (0, _utils.parseQuantityAndUnitFromRawValue)(values[side]);
89
- const computedUnit = values[side] ? parsedUnit : selectedUnits[side];
90
- const inputId = [generatedId, side].join('-');
91
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_boxControlStyles.InputWrapper, {
92
- expanded: true,
93
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.FlexedBoxControlIcon, {
94
- side: side,
95
- sides: sides
96
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.default, {
97
- placement: "top-end",
98
- text: _utils2.LABELS[side],
99
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.StyledUnitControl, {
100
- ...props,
101
- __shouldNotWarnDeprecated36pxSize: true,
102
- __next40pxDefaultSize: __next40pxDefaultSize,
103
- className: "component-box-control__unit-control",
104
- id: inputId,
105
- isPressEnterToChange: true,
106
- value: [parsedQuantity, computedUnit].join(''),
107
- onChange: (nextValue, extra) => handleOnValueChange(side, nextValue, extra),
108
- onUnitChange: createHandleOnUnitChange(side),
109
- onFocus: createHandleOnFocus(side),
110
- label: _utils2.LABELS[side],
111
- hideLabelFromVision: true
112
- })
113
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.FlexedRangeControl, {
114
- __nextHasNoMarginBottom: true,
115
- __next40pxDefaultSize: __next40pxDefaultSize,
116
- __shouldNotWarnDeprecated36pxSize: true,
117
- "aria-controls": inputId,
118
- label: _utils2.LABELS[side],
119
- hideLabelFromVision: true,
120
- onChange: newValue => {
121
- handleOnValueChange(side, newValue !== undefined ? [newValue, computedUnit].join('') : undefined);
122
- },
123
- min: 0,
124
- 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,
125
- 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,
126
- value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0,
127
- withInputField: false
128
- })]
129
- }, `box-control-${side}`);
130
- })
131
- });
132
- }
133
- //# sourceMappingURL=input-controls.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_compose","require","_tooltip","_interopRequireDefault","_utils","_utils2","_boxControlStyles","_jsxRuntime","noop","BoxInputControls","__next40pxDefaultSize","onChange","onFocus","values","selectedUnits","setSelectedUnits","sides","props","generatedId","useInstanceId","createHandleOnFocus","side","event","handleOnChange","nextValues","handleOnValueChange","next","extra","isNumeric","undefined","isNaN","parseFloat","nextValue","altKey","bottom","top","right","left","createHandleOnUnitChange","newUnits","filteredSides","length","ALL_SIDES","filter","includes","jsx","Fragment","children","map","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","computedUnit","inputId","join","jsxs","InputWrapper","expanded","FlexedBoxControlIcon","default","placement","text","LABELS","StyledUnitControl","__shouldNotWarnDeprecated36pxSize","className","id","isPressEnterToChange","value","onUnitChange","label","hideLabelFromVision","FlexedRangeControl","__nextHasNoMarginBottom","newValue","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/input-controls.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { ALL_SIDES, CUSTOM_VALUE_SETTINGS, LABELS } 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\nexport default function BoxInputControls( {\n\t__next40pxDefaultSize,\n\tonChange = noop,\n\tonFocus = noop,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst generatedId = useInstanceId( BoxInputControls, 'box-control-input' );\n\n\tconst createHandleOnFocus =\n\t\t( side: keyof BoxControlValue ) =>\n\t\t( event: React.FocusEvent< HTMLInputElement > ) => {\n\t\t\tonFocus( event, { side } );\n\t\t};\n\n\tconst handleOnChange = ( nextValues: BoxControlValue ) => {\n\t\tonChange( nextValues );\n\t};\n\n\tconst handleOnValueChange = (\n\t\tside: keyof BoxControlValue,\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\n\t\tnextValues[ side ] = nextValue;\n\n\t\t/**\n\t\t * Supports changing pair sides. For example, holding the ALT key\n\t\t * when changing the TOP will also update BOTTOM.\n\t\t */\n\t\t// @ts-expect-error - TODO: event.altKey is only present when the change event was\n\t\t// triggered by a keyboard event. Should this feature be implemented differently so\n\t\t// it also works with drag events?\n\t\tif ( extra?.event.altKey ) {\n\t\t\tswitch ( side ) {\n\t\t\t\tcase 'top':\n\t\t\t\t\tnextValues.bottom = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bottom':\n\t\t\t\t\tnextValues.top = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'left':\n\t\t\t\t\tnextValues.right = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'right':\n\t\t\t\t\tnextValues.left = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\thandleOnChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange =\n\t\t( side: keyof BoxControlValue ) => ( next?: string ) => {\n\t\t\tconst newUnits = { ...selectedUnits };\n\t\t\tnewUnits[ side ] = next;\n\t\t\tsetSelectedUnits( newUnits );\n\t\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? ALL_SIDES.filter( ( side ) => sides.includes( side ) )\n\t\t: ALL_SIDES;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue( values[ side ] );\n\n\t\t\t\tconst computedUnit = values[ side ]\n\t\t\t\t\t? parsedUnit\n\t\t\t\t\t: selectedUnits[ side ];\n\n\t\t\t\tconst inputId = [ generatedId, side ].join( '-' );\n\n\t\t\t\treturn (\n\t\t\t\t\t<InputWrapper key={ `box-control-${ side }` } expanded>\n\t\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t\t<Tooltip placement=\"top-end\" text={ LABELS[ side ] }>\n\t\t\t\t\t\t\t<StyledUnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\t\t\t\tid={ inputId }\n\t\t\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\t\t\tvalue={ [ parsedQuantity, computedUnit ].join(\n\t\t\t\t\t\t\t\t\t''\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ ( nextValue, extra ) =>\n\t\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\t\tnextValue,\n\t\t\t\t\t\t\t\t\t\textra\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tside\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\n\t\t\t\t\t\t<FlexedRangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t\t\taria-controls={ inputId }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t\t\t\t\t\t? [ newValue, computedUnit ].join( '' )\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.max ?? 10\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InputWrapper>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAKqC,IAAAM,WAAA,GAAAN,OAAA;AAfrC;AACA;AACA;;AAEA;AACA;AACA;;AAYA,MAAMO,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEN,SAASC,gBAAgBA,CAAE;EACzCC,qBAAqB;EACrBC,Q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AA9B,sBAAA,cAAAA,sBAAA,GAAI,GACX;UACDoB,KAAK,EAAGnB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAG;UAC7B8B,cAAc,EAAG;QAAO,CACxB,CAAC;MAAA,GAvDiB,eAAgB5D,IAAI,EAwD1B,CAAC;IAEjB,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
@@ -1,84 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useInstanceId } from '@wordpress/compose';
5
- /**
6
- * Internal dependencies
7
- */
8
-
9
- import { FlexedRangeControl, StyledUnitControl } from './styles/box-control-styles';
10
- import { parseQuantityAndUnitFromRawValue } from '../unit-control';
11
- import { LABELS, applyValueToSides, getAllValue, isValuesMixed, isValuesDefined, CUSTOM_VALUE_SETTINGS } from './utils';
12
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
- const noop = () => {};
14
- export default function AllInputControl({
15
- __next40pxDefaultSize,
16
- onChange = noop,
17
- onFocus = noop,
18
- values,
19
- sides,
20
- selectedUnits,
21
- setSelectedUnits,
22
- ...props
23
- }) {
24
- var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2;
25
- const inputId = useInstanceId(AllInputControl, 'box-control-input-all');
26
- const allValue = getAllValue(values, selectedUnits, sides);
27
- const hasValues = isValuesDefined(values);
28
- const isMixed = hasValues && isValuesMixed(values, selectedUnits, sides);
29
- const allPlaceholder = isMixed ? LABELS.mixed : undefined;
30
- const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(allValue);
31
- const handleOnFocus = event => {
32
- onFocus(event, {
33
- side: 'all'
34
- });
35
- };
36
- const onValueChange = next => {
37
- const isNumeric = next !== undefined && !isNaN(parseFloat(next));
38
- const nextValue = isNumeric ? next : undefined;
39
- const nextValues = applyValueToSides(values, nextValue, sides);
40
- onChange(nextValues);
41
- };
42
- const sliderOnChange = next => {
43
- onValueChange(next !== undefined ? [next, parsedUnit].join('') : undefined);
44
- };
45
-
46
- // Set selected unit so it can be used as fallback by unlinked controls
47
- // when individual sides do not have a value containing a unit.
48
- const handleOnUnitChange = unit => {
49
- const newUnits = applyValueToSides(selectedUnits, unit, sides);
50
- setSelectedUnits(newUnits);
51
- };
52
- return /*#__PURE__*/_jsxs(_Fragment, {
53
- children: [/*#__PURE__*/_jsx(StyledUnitControl, {
54
- ...props,
55
- __shouldNotWarnDeprecated36pxSize: true,
56
- __next40pxDefaultSize: __next40pxDefaultSize,
57
- className: "component-box-control__unit-control",
58
- disableUnits: isMixed,
59
- id: inputId,
60
- isPressEnterToChange: true,
61
- value: allValue,
62
- onChange: onValueChange,
63
- onUnitChange: handleOnUnitChange,
64
- onFocus: handleOnFocus,
65
- placeholder: allPlaceholder,
66
- label: LABELS.all,
67
- hideLabelFromVision: true
68
- }), /*#__PURE__*/_jsx(FlexedRangeControl, {
69
- __nextHasNoMarginBottom: true,
70
- __next40pxDefaultSize: __next40pxDefaultSize,
71
- __shouldNotWarnDeprecated36pxSize: true,
72
- "aria-controls": inputId,
73
- label: LABELS.all,
74
- hideLabelFromVision: true,
75
- onChange: sliderOnChange,
76
- min: 0,
77
- max: (_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[parsedUnit !== null && parsedUnit !== void 0 ? parsedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10,
78
- step: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[parsedUnit !== null && parsedUnit !== void 0 ? parsedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1,
79
- value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0,
80
- withInputField: false
81
- })]
82
- });
83
- }
84
- //# sourceMappingURL=all-input-control.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useInstanceId","FlexedRangeControl","StyledUnitControl","parseQuantityAndUnitFromRawValue","LABELS","applyValueToSides","getAllValue","isValuesMixed","isValuesDefined","CUSTOM_VALUE_SETTINGS","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","noop","AllInputControl","__next40pxDefaultSize","onChange","onFocus","values","sides","selectedUnits","setSelectedUnits","props","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","inputId","allValue","hasValues","isMixed","allPlaceholder","mixed","undefined","parsedQuantity","parsedUnit","handleOnFocus","event","side","onValueChange","next","isNumeric","isNaN","parseFloat","nextValue","nextValues","sliderOnChange","join","handleOnUnitChange","unit","newUnits","children","__shouldNotWarnDeprecated36pxSize","className","disableUnits","id","isPressEnterToChange","value","onUnitChange","placeholder","label","all","hideLabelFromVision","__nextHasNoMarginBottom","min","max","step","withInputField"],"sources":["@wordpress/components/src/box-control/all-input-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport type { UnitControlProps } from '../unit-control/types';\nimport {\n\tFlexedRangeControl,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps } from './types';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control';\nimport {\n\tLABELS,\n\tapplyValueToSides,\n\tgetAllValue,\n\tisValuesMixed,\n\tisValuesDefined,\n\tCUSTOM_VALUE_SETTINGS,\n} from './utils';\n\nconst noop = () => {};\n\nexport default function AllInputControl( {\n\t__next40pxDefaultSize,\n\tonChange = noop,\n\tonFocus = noop,\n\tvalues,\n\tsides,\n\tselectedUnits,\n\tsetSelectedUnits,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst inputId = useInstanceId( AllInputControl, 'box-control-input-all' );\n\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst hasValues = isValuesDefined( values );\n\tconst isMixed = hasValues && isValuesMixed( values, selectedUnits, sides );\n\tconst allPlaceholder = isMixed ? LABELS.mixed : undefined;\n\n\tconst [ parsedQuantity, parsedUnit ] =\n\t\tparseQuantityAndUnitFromRawValue( allValue );\n\n\tconst handleOnFocus: React.FocusEventHandler< HTMLInputElement > = (\n\t\tevent\n\t) => {\n\t\tonFocus( event, { side: 'all' } );\n\t};\n\n\tconst onValueChange = ( next?: string ) => {\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\t\tconst nextValues = applyValueToSides( values, nextValue, sides );\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst sliderOnChange = ( next?: number ) => {\n\t\tonValueChange(\n\t\t\tnext !== undefined ? [ next, parsedUnit ].join( '' ) : undefined\n\t\t);\n\t};\n\n\t// Set selected unit so it can be used as fallback by unlinked controls\n\t// when individual sides do not have a value containing a unit.\n\tconst handleOnUnitChange: UnitControlProps[ 'onUnitChange' ] = ( unit ) => {\n\t\tconst newUnits = applyValueToSides( selectedUnits, unit, sides );\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StyledUnitControl\n\t\t\t\t{ ...props }\n\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\tdisableUnits={ isMixed }\n\t\t\t\tid={ inputId }\n\t\t\t\tisPressEnterToChange\n\t\t\t\tvalue={ allValue }\n\t\t\t\tonChange={ onValueChange }\n\t\t\t\tonUnitChange={ handleOnUnitChange }\n\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\tplaceholder={ allPlaceholder }\n\t\t\t\tlabel={ LABELS.all }\n\t\t\t\thideLabelFromVision\n\t\t\t/>\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.all }\n\t\t\t\thideLabelFromVision\n\t\t\t\tonChange={ sliderOnChange }\n\t\t\t\tmin={ 0 }\n\t\t\t\tmax={ CUSTOM_VALUE_SETTINGS[ parsedUnit ?? 'px' ]?.max ?? 10 }\n\t\t\t\tstep={\n\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ parsedUnit ?? '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</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAClD;AACA;AACA;;AAEA,SACCC,kBAAkB,EAClBC,iBAAiB,QACX,6BAA6B;AAEpC,SAASC,gCAAgC,QAAQ,iBAAiB;AAClE,SACCC,MAAM,EACNC,iBAAiB,EACjBC,WAAW,EACXC,aAAa,EACbC,eAAe,EACfC,qBAAqB,QACf,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEjB,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,eAAe,SAASC,eAAeA,CAAE;EACxCC,qBAAqB;EACrBC,QAAQ,GAAGH,IAAI;EACfI,OAAO,GAAGJ,IAAI;EACdK,MAAM;EACNC,KAAK;EACLC,aAAa;EACbC,gBAAgB;EAChB,GAAGC;AACyB,CAAC,EAAG;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EAChC,MAAMC,OAAO,GAAG5B,aAAa,CAAEiB,eAAe,EAAE,uBAAwB,CAAC;EAEzE,MAAMY,QAAQ,GAAGvB,WAAW,CAAEe,MAAM,EAAEE,aAAa,EAAED,KAAM,CAAC;EAC5D,MAAMQ,SAAS,GAAGtB,eAAe,CAAEa,MAAO,CAAC;EAC3C,MAAMU,OAAO,GAAGD,SAAS,IAAIvB,aAAa,CAAEc,MAAM,EAAEE,aAAa,EAAED,KAA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oB;MACpBC,KAAK,EAAG7B,QAAU;MAClBV,QAAQ,EAAGqB,aAAe;MAC1BmB,YAAY,EAAGV,kBAAoB;MACnC7B,OAAO,EAAGiB,aAAe;MACzBuB,WAAW,EAAG5B,cAAgB;MAC9B6B,KAAK,EAAGzD,MAAM,CAAC0D,GAAK;MACpBC,mBAAmB;IAAA,CACnB,CAAC,eAEFpD,IAAA,CAACV,kBAAkB;MAClB+D,uBAAuB;MACvB9C,qBAAqB,EAAGA,qBAAuB;MAC/CmC,iCAAiC;MACjC,iBAAgBzB,OAAS;MACzBiC,KAAK,EAAGzD,MAAM,CAAC0D,GAAK;MACpBC,mBAAmB;MACnB5C,QAAQ,EAAG4B,cAAgB;MAC3BkB,GAAG,EAAG,CAAG;MACTC,GAAG,GAAAxC,qBAAA,GAAGjB,qBAAqB,CAAE2B,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,IAAI,CAAE,EAAE8B,GAAG,cAAAxC,qBAAA,cAAAA,qBAAA,GAAI,EAAI;MAC9DyC,IAAI,GAAAxC,sBAAA,GACHlB,qBAAqB,CAAE2B,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,IAAI,CAAE,EAAE+B,IAAI,cAAAxC,sBAAA,cAAAA,sBAAA,GAAI,GACrD;MACD+B,KAAK,EAAGvB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAG;MAC7BiC,cAAc,EAAG;IAAO,CACxB,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
@@ -1,116 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useInstanceId } from '@wordpress/compose';
5
- /**
6
- * Internal dependencies
7
- */
8
- import { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';
9
- import Tooltip from '../tooltip';
10
- import { CUSTOM_VALUE_SETTINGS, LABELS } from './utils';
11
- import { FlexedBoxControlIcon, FlexedRangeControl, InputWrapper, StyledUnitControl } from './styles/box-control-styles';
12
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
- import { createElement as _createElement } from "react";
14
- const groupedSides = ['vertical', 'horizontal'];
15
- export default function AxialInputControls({
16
- __next40pxDefaultSize,
17
- onChange,
18
- onFocus,
19
- values,
20
- selectedUnits,
21
- setSelectedUnits,
22
- sides,
23
- ...props
24
- }) {
25
- const generatedId = useInstanceId(AxialInputControls, `box-control-input`);
26
- const createHandleOnFocus = side => event => {
27
- if (!onFocus) {
28
- return;
29
- }
30
- onFocus(event, {
31
- side
32
- });
33
- };
34
- const handleOnValueChange = (side, next) => {
35
- if (!onChange) {
36
- return;
37
- }
38
- const nextValues = {
39
- ...values
40
- };
41
- const isNumeric = next !== undefined && !isNaN(parseFloat(next));
42
- const nextValue = isNumeric ? next : undefined;
43
- if (side === 'vertical') {
44
- nextValues.top = nextValue;
45
- nextValues.bottom = nextValue;
46
- }
47
- if (side === 'horizontal') {
48
- nextValues.left = nextValue;
49
- nextValues.right = nextValue;
50
- }
51
- onChange(nextValues);
52
- };
53
- const createHandleOnUnitChange = side => next => {
54
- const newUnits = {
55
- ...selectedUnits
56
- };
57
- if (side === 'vertical') {
58
- newUnits.top = next;
59
- newUnits.bottom = next;
60
- }
61
- if (side === 'horizontal') {
62
- newUnits.left = next;
63
- newUnits.right = next;
64
- }
65
- setSelectedUnits(newUnits);
66
- };
67
-
68
- // Filter sides if custom configuration provided, maintaining default order.
69
- const filteredSides = sides?.length ? groupedSides.filter(side => sides.includes(side)) : groupedSides;
70
- return /*#__PURE__*/_jsx(_Fragment, {
71
- children: filteredSides.map(side => {
72
- var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2;
73
- const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(side === 'vertical' ? values.top : values.left);
74
- const selectedUnit = side === 'vertical' ? selectedUnits.top : selectedUnits.left;
75
- const inputId = [generatedId, side].join('-');
76
- return /*#__PURE__*/_jsxs(InputWrapper, {
77
- children: [/*#__PURE__*/_jsx(FlexedBoxControlIcon, {
78
- side: side,
79
- sides: sides
80
- }), /*#__PURE__*/_jsx(Tooltip, {
81
- placement: "top-end",
82
- text: LABELS[side],
83
- children: /*#__PURE__*/_createElement(StyledUnitControl, {
84
- ...props,
85
- __shouldNotWarnDeprecated36pxSize: true,
86
- __next40pxDefaultSize: __next40pxDefaultSize,
87
- className: "component-box-control__unit-control",
88
- id: inputId,
89
- isPressEnterToChange: true,
90
- value: [parsedQuantity, selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : parsedUnit].join(''),
91
- onChange: newValue => handleOnValueChange(side, newValue),
92
- onUnitChange: createHandleOnUnitChange(side),
93
- onFocus: createHandleOnFocus(side),
94
- label: LABELS[side],
95
- hideLabelFromVision: true,
96
- key: side
97
- })
98
- }), /*#__PURE__*/_jsx(FlexedRangeControl, {
99
- __nextHasNoMarginBottom: true,
100
- __next40pxDefaultSize: __next40pxDefaultSize,
101
- __shouldNotWarnDeprecated36pxSize: true,
102
- "aria-controls": inputId,
103
- label: LABELS[side],
104
- hideLabelFromVision: true,
105
- onChange: newValue => handleOnValueChange(side, newValue !== undefined ? [newValue, selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : parsedUnit].join('') : undefined),
106
- min: 0,
107
- max: (_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : 'px']?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10,
108
- step: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[selectedUnit !== null && selectedUnit !== void 0 ? selectedUnit : 'px']?.step) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1,
109
- value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : 0,
110
- withInputField: false
111
- })]
112
- }, side);
113
- })
114
- });
115
- }
116
- //# sourceMappingURL=axial-input-controls.js.map