@wordpress/components 19.11.0 → 19.14.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 (1322) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/CONTRIBUTING.md +94 -12
  3. package/README.md +1 -1
  4. package/build/alignment-matrix-control/index.js +8 -5
  5. package/build/alignment-matrix-control/index.js.map +1 -1
  6. package/build/alignment-matrix-control/utils.js +1 -7
  7. package/build/alignment-matrix-control/utils.js.map +1 -1
  8. package/build/angle-picker-control/index.js +2 -2
  9. package/build/angle-picker-control/index.js.map +1 -1
  10. package/build/autocomplete/autocompleter-ui.js +3 -1
  11. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  12. package/build/autocomplete/autocompleter-ui.native.js +8 -2
  13. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  14. package/build/autocomplete/index.js +14 -10
  15. package/build/autocomplete/index.js.map +1 -1
  16. package/build/border-box-control/border-box-control/component.js +2 -1
  17. package/build/border-box-control/border-box-control/component.js.map +1 -1
  18. package/build/border-box-control/border-box-control/hook.js +2 -2
  19. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  20. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  21. package/build/border-box-control/border-box-control-split-controls/component.js +4 -1
  22. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  23. package/build/border-box-control/border-box-control-split-controls/hook.js +13 -4
  24. package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
  25. package/build/border-box-control/border-box-control-visualizer/hook.js +6 -2
  26. package/build/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
  27. package/build/border-box-control/styles.js +21 -11
  28. package/build/border-box-control/styles.js.map +1 -1
  29. package/build/border-box-control/utils.js.map +1 -1
  30. package/build/border-control/border-control/component.js +40 -4
  31. package/build/border-control/border-control/component.js.map +1 -1
  32. package/build/border-control/border-control/hook.js +2 -2
  33. package/build/border-control/border-control/hook.js.map +1 -1
  34. package/build/box-control/all-input-control.js +6 -10
  35. package/build/box-control/all-input-control.js.map +1 -1
  36. package/build/box-control/axial-input-controls.js.map +1 -1
  37. package/build/box-control/index.js +3 -7
  38. package/build/box-control/index.js.map +1 -1
  39. package/build/box-control/input-controls.js +6 -10
  40. package/build/box-control/input-controls.js.map +1 -1
  41. package/build/box-control/unit-control.js +4 -4
  42. package/build/box-control/unit-control.js.map +1 -1
  43. package/build/box-control/utils.js +3 -3
  44. package/build/box-control/utils.js.map +1 -1
  45. package/build/button/index.native.js +1 -3
  46. package/build/button/index.native.js.map +1 -1
  47. package/build/checkbox-control/index.js.map +1 -1
  48. package/build/color-indicator/index.js +27 -10
  49. package/build/color-indicator/index.js.map +1 -1
  50. package/build/color-indicator/types.js +6 -0
  51. package/build/color-indicator/types.js.map +1 -0
  52. package/build/color-palette/index.js +11 -3
  53. package/build/color-palette/index.js.map +1 -1
  54. package/build/color-palette/index.native.js +4 -1
  55. package/build/color-palette/index.native.js.map +1 -1
  56. package/build/color-picker/color-copy-button.js +87 -0
  57. package/build/color-picker/color-copy-button.js.map +1 -0
  58. package/build/color-picker/component.js +10 -23
  59. package/build/color-picker/component.js.map +1 -1
  60. package/build/color-picker/hex-input.js +18 -1
  61. package/build/color-picker/hex-input.js.map +1 -1
  62. package/build/color-picker/index.native.js.map +1 -1
  63. package/build/color-picker/input-with-slider.js +1 -2
  64. package/build/color-picker/input-with-slider.js.map +1 -1
  65. package/build/color-picker/styles.js +37 -19
  66. package/build/color-picker/styles.js.map +1 -1
  67. package/build/combobox-control/index.js +4 -2
  68. package/build/combobox-control/index.js.map +1 -1
  69. package/build/confirm-dialog/component.js.map +1 -1
  70. package/build/custom-gradient-bar/constants.js +1 -3
  71. package/build/custom-gradient-bar/constants.js.map +1 -1
  72. package/build/custom-gradient-bar/control-points.js +15 -8
  73. package/build/custom-gradient-bar/control-points.js.map +1 -1
  74. package/build/custom-gradient-bar/index.js +5 -5
  75. package/build/custom-gradient-bar/index.js.map +1 -1
  76. package/build/custom-gradient-bar/utils.js +5 -7
  77. package/build/custom-gradient-bar/utils.js.map +1 -1
  78. package/build/custom-gradient-picker/index.js +8 -8
  79. package/build/custom-gradient-picker/index.js.map +1 -1
  80. package/build/custom-gradient-picker/index.native.js +8 -9
  81. package/build/custom-gradient-picker/index.native.js.map +1 -1
  82. package/build/custom-gradient-picker/serializer.js +4 -7
  83. package/build/custom-gradient-picker/serializer.js.map +1 -1
  84. package/build/custom-gradient-picker/utils.js +1 -1
  85. package/build/custom-gradient-picker/utils.js.map +1 -1
  86. package/build/custom-select-control/index.js.map +1 -1
  87. package/build/date-time/{date.js → date/index.js} +57 -16
  88. package/build/date-time/date/index.js.map +1 -0
  89. package/build/date-time/date/styles.js +70 -0
  90. package/build/date-time/date/styles.js.map +1 -0
  91. package/build/date-time/{utils.js → date/utils.js} +0 -0
  92. package/build/date-time/date/utils.js.map +1 -0
  93. package/build/date-time/date-time/index.js +177 -0
  94. package/build/date-time/date-time/index.js.map +1 -0
  95. package/build/date-time/date-time/styles.js +32 -0
  96. package/build/date-time/date-time/styles.js.map +1 -0
  97. package/build/date-time/index.js +2 -109
  98. package/build/date-time/index.js.map +1 -1
  99. package/build/date-time/time/index.js +322 -0
  100. package/build/date-time/time/index.js.map +1 -0
  101. package/build/date-time/time/styles.js +139 -0
  102. package/build/date-time/time/styles.js.map +1 -0
  103. package/build/date-time/{timezone.js → time/timezone.js} +4 -2
  104. package/build/date-time/time/timezone.js.map +1 -0
  105. package/build/dimension-control/index.js +1 -3
  106. package/build/dimension-control/index.js.map +1 -1
  107. package/build/divider/styles.js +5 -5
  108. package/build/divider/styles.js.map +1 -1
  109. package/build/draggable/index.js.map +1 -1
  110. package/build/draggable/index.native.js +16 -6
  111. package/build/draggable/index.native.js.map +1 -1
  112. package/build/drop-zone/provider.js.map +1 -1
  113. package/build/dropdown/index.js +6 -3
  114. package/build/dropdown/index.js.map +1 -1
  115. package/build/dropdown-menu/index.js +13 -2
  116. package/build/dropdown-menu/index.js.map +1 -1
  117. package/build/dropdown-menu/index.native.js +13 -2
  118. package/build/dropdown-menu/index.native.js.map +1 -1
  119. package/build/duotone-picker/duotone-picker.js +42 -29
  120. package/build/duotone-picker/duotone-picker.js.map +1 -1
  121. package/build/elevation/hook.js +13 -13
  122. package/build/elevation/hook.js.map +1 -1
  123. package/build/external-link/index.js +20 -8
  124. package/build/external-link/index.js.map +1 -1
  125. package/build/external-link/styles/external-link-styles.js +3 -3
  126. package/build/external-link/styles/external-link-styles.js.map +1 -1
  127. package/build/external-link/types.js +6 -0
  128. package/build/external-link/types.js.map +1 -0
  129. package/build/flex/flex/hook.js +9 -5
  130. package/build/flex/flex/hook.js.map +1 -1
  131. package/build/focal-point-picker/controls.js +3 -7
  132. package/build/focal-point-picker/controls.js.map +1 -1
  133. package/build/focal-point-picker/index.js.map +1 -1
  134. package/build/focal-point-picker/index.native.js +4 -4
  135. package/build/focal-point-picker/index.native.js.map +1 -1
  136. package/build/focal-point-picker/media.js +4 -8
  137. package/build/focal-point-picker/media.js.map +1 -1
  138. package/build/font-size-picker/index.js +1 -1
  139. package/build/font-size-picker/index.js.map +1 -1
  140. package/build/form-toggle/index.js +34 -9
  141. package/build/form-toggle/index.js.map +1 -1
  142. package/build/form-toggle/types.js +6 -0
  143. package/build/form-toggle/types.js.map +1 -0
  144. package/build/form-token-field/index.js +328 -359
  145. package/build/form-token-field/index.js.map +1 -1
  146. package/build/form-token-field/suggestions-list.js +26 -20
  147. package/build/form-token-field/suggestions-list.js.map +1 -1
  148. package/build/form-token-field/token-input.js +39 -53
  149. package/build/form-token-field/token-input.js.map +1 -1
  150. package/build/form-token-field/token.js +3 -3
  151. package/build/form-token-field/token.js.map +1 -1
  152. package/build/form-token-field/types.js +6 -0
  153. package/build/form-token-field/types.js.map +1 -0
  154. package/build/gradient-picker/index.js.map +1 -1
  155. package/build/h-stack/utils.js +3 -3
  156. package/build/h-stack/utils.js.map +1 -1
  157. package/build/heading/component.js +0 -1
  158. package/build/heading/component.js.map +1 -1
  159. package/build/heading/hook.js.map +1 -1
  160. package/build/heading/types.js +6 -0
  161. package/build/heading/types.js.map +1 -0
  162. package/build/higher-order/navigate-regions/index.js.map +1 -1
  163. package/build/higher-order/with-focus-return/index.js.map +1 -1
  164. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  165. package/build/icon/index.js.map +1 -1
  166. package/build/input-control/index.js +14 -9
  167. package/build/input-control/index.js.map +1 -1
  168. package/build/input-control/input-field.js +11 -36
  169. package/build/input-control/input-field.js.map +1 -1
  170. package/build/input-control/reducer/reducer.js +36 -24
  171. package/build/input-control/reducer/reducer.js.map +1 -1
  172. package/build/input-control/reducer/state.js +0 -1
  173. package/build/input-control/reducer/state.js.map +1 -1
  174. package/build/input-control/utils.js +46 -1
  175. package/build/input-control/utils.js.map +1 -1
  176. package/build/menu-items-choice/index.js +3 -7
  177. package/build/menu-items-choice/index.js.map +1 -1
  178. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  179. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  180. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -7
  181. package/build/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  182. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  183. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
  184. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  185. package/build/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  186. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  187. package/build/mobile/color-settings/index.native.js.map +1 -1
  188. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  189. package/build/mobile/gradient/index.native.js.map +1 -1
  190. package/build/mobile/html-text-input/index.native.js.map +1 -1
  191. package/build/mobile/inserter-button/index.native.js.map +1 -1
  192. package/build/mobile/link-picker/index.native.js +4 -4
  193. package/build/mobile/link-picker/index.native.js.map +1 -1
  194. package/build/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  195. package/build/mobile/media-edit/index.native.js.map +1 -1
  196. package/build/mobile/segmented-control/index.native.js +3 -5
  197. package/build/mobile/segmented-control/index.native.js.map +1 -1
  198. package/build/modal/index.js +1 -1
  199. package/build/modal/index.js.map +1 -1
  200. package/build/navigable-container/container.js +4 -2
  201. package/build/navigable-container/container.js.map +1 -1
  202. package/build/navigation/context.js +12 -16
  203. package/build/navigation/context.js.map +1 -1
  204. package/build/navigation/group/index.js +4 -7
  205. package/build/navigation/group/index.js.map +1 -1
  206. package/build/navigation/index.js +3 -3
  207. package/build/navigation/index.js.map +1 -1
  208. package/build/navigation/item/base.js +3 -3
  209. package/build/navigation/item/base.js.map +1 -1
  210. package/build/navigation/item/index.js +3 -3
  211. package/build/navigation/item/index.js.map +1 -1
  212. package/build/navigation/item/use-navigation-tree-item.js +2 -1
  213. package/build/navigation/item/use-navigation-tree-item.js.map +1 -1
  214. package/build/navigation/menu/menu-title-search.js +1 -7
  215. package/build/navigation/menu/menu-title-search.js.map +1 -1
  216. package/build/navigation/menu/search-no-results-found.js +1 -7
  217. package/build/navigation/menu/search-no-results-found.js.map +1 -1
  218. package/build/navigation/use-navigation-tree-nodes.js +18 -10
  219. package/build/navigation/use-navigation-tree-nodes.js.map +1 -1
  220. package/build/navigation/utils.js +4 -2
  221. package/build/navigation/utils.js.map +1 -1
  222. package/build/navigator/navigator-back-button/hook.js.map +1 -1
  223. package/build/navigator/navigator-button/hook.js.map +1 -1
  224. package/build/navigator/navigator-provider/component.js +1 -1
  225. package/build/navigator/navigator-provider/component.js.map +1 -1
  226. package/build/navigator/navigator-screen/component.js +1 -1
  227. package/build/navigator/navigator-screen/component.js.map +1 -1
  228. package/build/notice/index.js +5 -5
  229. package/build/notice/index.js.map +1 -1
  230. package/build/notice/list.js +4 -2
  231. package/build/notice/list.js.map +1 -1
  232. package/build/panel/body.js +3 -3
  233. package/build/panel/body.js.map +1 -1
  234. package/build/placeholder/index.js +26 -12
  235. package/build/placeholder/index.js.map +1 -1
  236. package/build/popover/index.js +40 -33
  237. package/build/popover/index.js.map +1 -1
  238. package/build/radio-control/index.js +43 -7
  239. package/build/radio-control/index.js.map +1 -1
  240. package/build/radio-control/types.js +6 -0
  241. package/build/radio-control/types.js.map +1 -0
  242. package/build/range-control/index.js +11 -9
  243. package/build/range-control/index.js.map +1 -1
  244. package/build/range-control/input-range.js +6 -10
  245. package/build/range-control/input-range.js.map +1 -1
  246. package/build/range-control/utils.js +10 -12
  247. package/build/range-control/utils.js.map +1 -1
  248. package/build/resizable-box/resize-tooltip/index.js +3 -3
  249. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  250. package/build/resizable-box/resize-tooltip/utils.js +4 -7
  251. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  252. package/build/responsive-wrapper/index.js.map +1 -1
  253. package/build/search-control/index.js +4 -6
  254. package/build/search-control/index.js.map +1 -1
  255. package/build/select-control/index.js +8 -4
  256. package/build/select-control/index.js.map +1 -1
  257. package/build/slot-fill/fill.js +1 -7
  258. package/build/slot-fill/fill.js.map +1 -1
  259. package/build/slot-fill/slot.js +14 -3
  260. package/build/slot-fill/slot.js.map +1 -1
  261. package/build/snackbar/index.js +7 -7
  262. package/build/snackbar/index.js.map +1 -1
  263. package/build/snackbar/list.js +3 -1
  264. package/build/snackbar/list.js.map +1 -1
  265. package/build/spacer/component.js +5 -5
  266. package/build/spacer/component.js.map +1 -1
  267. package/build/spacer/hook.js +11 -3
  268. package/build/spacer/hook.js.map +1 -1
  269. package/build/spinner/index.js +26 -13
  270. package/build/spinner/index.js.map +1 -1
  271. package/build/spinner/styles.js +10 -10
  272. package/build/spinner/styles.js.map +1 -1
  273. package/build/surface/component.js +7 -7
  274. package/build/surface/component.js.map +1 -1
  275. package/build/surface/hook.js +8 -11
  276. package/build/surface/hook.js.map +1 -1
  277. package/build/surface/index.js.map +1 -1
  278. package/build/surface/styles.js +8 -48
  279. package/build/surface/styles.js.map +1 -1
  280. package/build/tab-panel/index.js +3 -1
  281. package/build/tab-panel/index.js.map +1 -1
  282. package/build/text/hook.js +4 -4
  283. package/build/text/hook.js.map +1 -1
  284. package/build/text/utils.js.map +1 -1
  285. package/build/textarea-control/index.js +40 -6
  286. package/build/textarea-control/index.js.map +1 -1
  287. package/build/textarea-control/styles/textarea-control-styles.js +3 -3
  288. package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
  289. package/build/textarea-control/types.js +6 -0
  290. package/build/textarea-control/types.js.map +1 -0
  291. package/build/toggle-control/index.js +1 -3
  292. package/build/toggle-control/index.js.map +1 -1
  293. package/build/toggle-control/index.native.js +1 -7
  294. package/build/toggle-control/index.native.js.map +1 -1
  295. package/build/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  296. package/build/toolbar/index.js.map +1 -1
  297. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  298. package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
  299. package/build/tooltip/index.js +2 -1
  300. package/build/tooltip/index.js.map +1 -1
  301. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  302. package/build/tree-select/index.js +57 -4
  303. package/build/tree-select/index.js.map +1 -1
  304. package/build/tree-select/types.js +6 -0
  305. package/build/tree-select/types.js.map +1 -0
  306. package/build/truncate/component.js +7 -8
  307. package/build/truncate/component.js.map +1 -1
  308. package/build/truncate/hook.js +3 -10
  309. package/build/truncate/hook.js.map +1 -1
  310. package/build/truncate/index.js.map +1 -1
  311. package/build/truncate/styles.js +1 -1
  312. package/build/truncate/styles.js.map +1 -1
  313. package/build/truncate/utils.js +3 -16
  314. package/build/truncate/utils.js.map +1 -1
  315. package/build/ui/form-group/form-group-content.js.map +1 -1
  316. package/build/unit-control/index.js.map +1 -1
  317. package/build/utils/hooks/index.js +0 -8
  318. package/build/utils/hooks/index.js.map +1 -1
  319. package/build/utils/math.js +17 -7
  320. package/build/utils/math.js.map +1 -1
  321. package/build/utils/unit-values.js.map +1 -1
  322. package/build/utils/values.js.map +1 -1
  323. package/build/v-stack/component.js +9 -9
  324. package/build/v-stack/component.js.map +1 -1
  325. package/build/v-stack/hook.js +0 -5
  326. package/build/v-stack/hook.js.map +1 -1
  327. package/build/v-stack/index.js.map +1 -1
  328. package/build/z-stack/component.js +22 -3
  329. package/build/z-stack/component.js.map +1 -1
  330. package/build/z-stack/types.js +6 -0
  331. package/build/z-stack/types.js.map +1 -0
  332. package/build-module/alignment-matrix-control/index.js +7 -3
  333. package/build-module/alignment-matrix-control/index.js.map +1 -1
  334. package/build-module/alignment-matrix-control/utils.js +1 -6
  335. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  336. package/build-module/angle-picker-control/index.js +1 -1
  337. package/build-module/angle-picker-control/index.js.map +1 -1
  338. package/build-module/autocomplete/autocompleter-ui.js +3 -1
  339. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  340. package/build-module/autocomplete/autocompleter-ui.native.js +8 -2
  341. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  342. package/build-module/autocomplete/index.js +15 -11
  343. package/build-module/autocomplete/index.js.map +1 -1
  344. package/build-module/border-box-control/border-box-control/component.js +2 -1
  345. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  346. package/build-module/border-box-control/border-box-control/hook.js +2 -2
  347. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  348. package/build-module/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  349. package/build-module/border-box-control/border-box-control-split-controls/component.js +4 -1
  350. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  351. package/build-module/border-box-control/border-box-control-split-controls/hook.js +11 -4
  352. package/build-module/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
  353. package/build-module/border-box-control/border-box-control-visualizer/hook.js +4 -2
  354. package/build-module/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
  355. package/build-module/border-box-control/styles.js +13 -8
  356. package/build-module/border-box-control/styles.js.map +1 -1
  357. package/build-module/border-box-control/utils.js.map +1 -1
  358. package/build-module/border-control/border-control/component.js +38 -3
  359. package/build-module/border-control/border-control/component.js.map +1 -1
  360. package/build-module/border-control/border-control/hook.js +2 -2
  361. package/build-module/border-control/border-control/hook.js.map +1 -1
  362. package/build-module/box-control/all-input-control.js +3 -5
  363. package/build-module/box-control/all-input-control.js.map +1 -1
  364. package/build-module/box-control/axial-input-controls.js.map +1 -1
  365. package/build-module/box-control/index.js +2 -5
  366. package/build-module/box-control/index.js.map +1 -1
  367. package/build-module/box-control/input-controls.js +3 -5
  368. package/build-module/box-control/input-controls.js.map +1 -1
  369. package/build-module/box-control/unit-control.js +3 -1
  370. package/build-module/box-control/unit-control.js.map +1 -1
  371. package/build-module/box-control/utils.js +4 -4
  372. package/build-module/box-control/utils.js.map +1 -1
  373. package/build-module/button/index.native.js +1 -2
  374. package/build-module/button/index.native.js.map +1 -1
  375. package/build-module/checkbox-control/index.js.map +1 -1
  376. package/build-module/color-indicator/index.js +29 -8
  377. package/build-module/color-indicator/index.js.map +1 -1
  378. package/build-module/color-indicator/types.js +2 -0
  379. package/build-module/color-indicator/types.js.map +1 -0
  380. package/build-module/color-palette/index.js +9 -6
  381. package/build-module/color-palette/index.js.map +1 -1
  382. package/build-module/color-palette/index.native.js +4 -1
  383. package/build-module/color-palette/index.native.js.map +1 -1
  384. package/build-module/color-picker/color-copy-button.js +73 -0
  385. package/build-module/color-picker/color-copy-button.js.map +1 -0
  386. package/build-module/color-picker/component.js +11 -21
  387. package/build-module/color-picker/component.js.map +1 -1
  388. package/build-module/color-picker/hex-input.js +18 -1
  389. package/build-module/color-picker/hex-input.js.map +1 -1
  390. package/build-module/color-picker/index.native.js.map +1 -1
  391. package/build-module/color-picker/input-with-slider.js +1 -2
  392. package/build-module/color-picker/input-with-slider.js.map +1 -1
  393. package/build-module/color-picker/styles.js +30 -16
  394. package/build-module/color-picker/styles.js.map +1 -1
  395. package/build-module/combobox-control/index.js +5 -2
  396. package/build-module/combobox-control/index.js.map +1 -1
  397. package/build-module/confirm-dialog/component.js.map +1 -1
  398. package/build-module/custom-gradient-bar/constants.js +0 -1
  399. package/build-module/custom-gradient-bar/constants.js.map +1 -1
  400. package/build-module/custom-gradient-bar/control-points.js +16 -9
  401. package/build-module/custom-gradient-bar/control-points.js.map +1 -1
  402. package/build-module/custom-gradient-bar/index.js +6 -6
  403. package/build-module/custom-gradient-bar/index.js.map +1 -1
  404. package/build-module/custom-gradient-bar/utils.js +6 -8
  405. package/build-module/custom-gradient-bar/utils.js.map +1 -1
  406. package/build-module/custom-gradient-picker/index.js +8 -7
  407. package/build-module/custom-gradient-picker/index.js.map +1 -1
  408. package/build-module/custom-gradient-picker/index.native.js +8 -8
  409. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  410. package/build-module/custom-gradient-picker/serializer.js +4 -6
  411. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  412. package/build-module/custom-gradient-picker/utils.js +1 -1
  413. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  414. package/build-module/custom-select-control/index.js.map +1 -1
  415. package/build-module/date-time/{date.js → date/index.js} +51 -16
  416. package/build-module/date-time/date/index.js.map +1 -0
  417. package/build-module/date-time/date/styles.js +61 -0
  418. package/build-module/date-time/date/styles.js.map +1 -0
  419. package/build-module/date-time/{utils.js → date/utils.js} +0 -0
  420. package/build-module/date-time/date/utils.js.map +1 -0
  421. package/build-module/date-time/date-time/index.js +147 -0
  422. package/build-module/date-time/date-time/index.js.map +1 -0
  423. package/build-module/date-time/date-time/styles.js +22 -0
  424. package/build-module/date-time/date-time/styles.js.map +1 -0
  425. package/build-module/date-time/index.js +1 -105
  426. package/build-module/date-time/index.js.map +1 -1
  427. package/build-module/date-time/time/index.js +302 -0
  428. package/build-module/date-time/time/index.js.map +1 -0
  429. package/build-module/date-time/time/styles.js +118 -0
  430. package/build-module/date-time/time/styles.js.map +1 -0
  431. package/build-module/date-time/{timezone.js → time/timezone.js} +3 -2
  432. package/build-module/date-time/time/timezone.js.map +1 -0
  433. package/build-module/dimension-control/index.js +1 -2
  434. package/build-module/dimension-control/index.js.map +1 -1
  435. package/build-module/divider/styles.js +5 -5
  436. package/build-module/divider/styles.js.map +1 -1
  437. package/build-module/draggable/index.js.map +1 -1
  438. package/build-module/draggable/index.native.js +16 -6
  439. package/build-module/draggable/index.native.js.map +1 -1
  440. package/build-module/drop-zone/provider.js.map +1 -1
  441. package/build-module/dropdown/index.js +6 -3
  442. package/build-module/dropdown/index.js.map +1 -1
  443. package/build-module/dropdown-menu/index.js +12 -1
  444. package/build-module/dropdown-menu/index.js.map +1 -1
  445. package/build-module/dropdown-menu/index.native.js +12 -1
  446. package/build-module/dropdown-menu/index.native.js.map +1 -1
  447. package/build-module/duotone-picker/duotone-picker.js +42 -29
  448. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  449. package/build-module/elevation/hook.js +12 -12
  450. package/build-module/elevation/hook.js.map +1 -1
  451. package/build-module/external-link/index.js +22 -7
  452. package/build-module/external-link/index.js.map +1 -1
  453. package/build-module/external-link/styles/external-link-styles.js +3 -3
  454. package/build-module/external-link/styles/external-link-styles.js.map +1 -1
  455. package/build-module/external-link/types.js +2 -0
  456. package/build-module/external-link/types.js.map +1 -0
  457. package/build-module/flex/flex/hook.js +7 -5
  458. package/build-module/flex/flex/hook.js.map +1 -1
  459. package/build-module/focal-point-picker/controls.js +3 -5
  460. package/build-module/focal-point-picker/controls.js.map +1 -1
  461. package/build-module/focal-point-picker/index.js.map +1 -1
  462. package/build-module/focal-point-picker/index.native.js +1 -1
  463. package/build-module/focal-point-picker/index.native.js.map +1 -1
  464. package/build-module/focal-point-picker/media.js +3 -5
  465. package/build-module/focal-point-picker/media.js.map +1 -1
  466. package/build-module/font-size-picker/index.js +1 -1
  467. package/build-module/font-size-picker/index.js.map +1 -1
  468. package/build-module/form-toggle/index.js +31 -7
  469. package/build-module/form-toggle/index.js.map +1 -1
  470. package/build-module/form-toggle/types.js +2 -0
  471. package/build-module/form-toggle/types.js.map +1 -0
  472. package/build-module/form-token-field/index.js +329 -361
  473. package/build-module/form-token-field/index.js.map +1 -1
  474. package/build-module/form-token-field/suggestions-list.js +32 -23
  475. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  476. package/build-module/form-token-field/token-input.js +43 -58
  477. package/build-module/form-token-field/token-input.js.map +1 -1
  478. package/build-module/form-token-field/token.js +3 -1
  479. package/build-module/form-token-field/token.js.map +1 -1
  480. package/build-module/form-token-field/types.js +2 -0
  481. package/build-module/form-token-field/types.js.map +1 -0
  482. package/build-module/gradient-picker/index.js.map +1 -1
  483. package/build-module/h-stack/utils.js +3 -3
  484. package/build-module/h-stack/utils.js.map +1 -1
  485. package/build-module/heading/component.js +0 -1
  486. package/build-module/heading/component.js.map +1 -1
  487. package/build-module/heading/hook.js.map +1 -1
  488. package/build-module/heading/types.js +2 -0
  489. package/build-module/heading/types.js.map +1 -0
  490. package/build-module/higher-order/navigate-regions/index.js.map +1 -1
  491. package/build-module/higher-order/with-focus-return/index.js.map +1 -1
  492. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  493. package/build-module/icon/index.js.map +1 -1
  494. package/build-module/input-control/index.js +10 -5
  495. package/build-module/input-control/index.js.map +1 -1
  496. package/build-module/input-control/input-field.js +3 -26
  497. package/build-module/input-control/input-field.js.map +1 -1
  498. package/build-module/input-control/reducer/reducer.js +38 -26
  499. package/build-module/input-control/reducer/reducer.js.map +1 -1
  500. package/build-module/input-control/reducer/state.js +0 -1
  501. package/build-module/input-control/reducer/state.js.map +1 -1
  502. package/build-module/input-control/utils.js +49 -3
  503. package/build-module/input-control/utils.js.map +1 -1
  504. package/build-module/menu-items-choice/index.js +3 -5
  505. package/build-module/menu-items-choice/index.js.map +1 -1
  506. package/build-module/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  507. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  508. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js +1 -6
  509. package/build-module/mobile/bottom-sheet/cycle-picker-cell.native.js.map +1 -1
  510. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  511. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js +0 -1
  512. package/build-module/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  513. package/build-module/mobile/bottom-sheet/picker-cell.native.js.map +1 -1
  514. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  515. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  516. package/build-module/mobile/global-styles-context/index.native.js.map +1 -1
  517. package/build-module/mobile/gradient/index.native.js.map +1 -1
  518. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  519. package/build-module/mobile/inserter-button/index.native.js.map +1 -1
  520. package/build-module/mobile/link-picker/index.native.js +4 -3
  521. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  522. package/build-module/mobile/link-settings/image-link-destinations-screen.native.js.map +1 -1
  523. package/build-module/mobile/media-edit/index.native.js.map +1 -1
  524. package/build-module/mobile/segmented-control/index.native.js +3 -4
  525. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  526. package/build-module/modal/index.js +1 -1
  527. package/build-module/modal/index.js.map +1 -1
  528. package/build-module/navigable-container/container.js +5 -2
  529. package/build-module/navigable-container/container.js.map +1 -1
  530. package/build-module/navigation/context.js +3 -5
  531. package/build-module/navigation/context.js.map +1 -1
  532. package/build-module/navigation/group/index.js +3 -6
  533. package/build-module/navigation/group/index.js.map +1 -1
  534. package/build-module/navigation/index.js +3 -1
  535. package/build-module/navigation/index.js.map +1 -1
  536. package/build-module/navigation/item/base.js +2 -2
  537. package/build-module/navigation/item/base.js.map +1 -1
  538. package/build-module/navigation/item/index.js +3 -1
  539. package/build-module/navigation/item/index.js.map +1 -1
  540. package/build-module/navigation/item/use-navigation-tree-item.js +2 -1
  541. package/build-module/navigation/item/use-navigation-tree-item.js.map +1 -1
  542. package/build-module/navigation/menu/menu-title-search.js +1 -6
  543. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  544. package/build-module/navigation/menu/search-no-results-found.js +1 -6
  545. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  546. package/build-module/navigation/use-navigation-tree-nodes.js +18 -9
  547. package/build-module/navigation/use-navigation-tree-nodes.js.map +1 -1
  548. package/build-module/navigation/utils.js +2 -2
  549. package/build-module/navigation/utils.js.map +1 -1
  550. package/build-module/navigator/navigator-back-button/hook.js.map +1 -1
  551. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  552. package/build-module/navigator/navigator-provider/component.js +1 -1
  553. package/build-module/navigator/navigator-provider/component.js.map +1 -1
  554. package/build-module/navigator/navigator-screen/component.js +1 -1
  555. package/build-module/navigator/navigator-screen/component.js.map +1 -1
  556. package/build-module/notice/index.js +2 -1
  557. package/build-module/notice/index.js.map +1 -1
  558. package/build-module/notice/list.js +4 -1
  559. package/build-module/notice/list.js.map +1 -1
  560. package/build-module/panel/body.js +3 -1
  561. package/build-module/panel/body.js.map +1 -1
  562. package/build-module/placeholder/index.js +24 -11
  563. package/build-module/placeholder/index.js.map +1 -1
  564. package/build-module/popover/index.js +40 -33
  565. package/build-module/popover/index.js.map +1 -1
  566. package/build-module/radio-control/index.js +40 -7
  567. package/build-module/radio-control/index.js.map +1 -1
  568. package/build-module/radio-control/types.js +2 -0
  569. package/build-module/radio-control/types.js.map +1 -0
  570. package/build-module/range-control/index.js +4 -2
  571. package/build-module/range-control/index.js.map +1 -1
  572. package/build-module/range-control/input-range.js +2 -5
  573. package/build-module/range-control/input-range.js.map +1 -1
  574. package/build-module/range-control/utils.js +4 -5
  575. package/build-module/range-control/utils.js.map +1 -1
  576. package/build-module/resizable-box/resize-tooltip/index.js +2 -1
  577. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  578. package/build-module/resizable-box/resize-tooltip/utils.js +3 -5
  579. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  580. package/build-module/responsive-wrapper/index.js.map +1 -1
  581. package/build-module/search-control/index.js +6 -7
  582. package/build-module/search-control/index.js.map +1 -1
  583. package/build-module/select-control/index.js +6 -2
  584. package/build-module/select-control/index.js.map +1 -1
  585. package/build-module/slot-fill/fill.js +1 -6
  586. package/build-module/slot-fill/fill.js.map +1 -1
  587. package/build-module/slot-fill/slot.js +12 -2
  588. package/build-module/slot-fill/slot.js.map +1 -1
  589. package/build-module/snackbar/index.js +3 -1
  590. package/build-module/snackbar/index.js.map +1 -1
  591. package/build-module/snackbar/list.js +4 -1
  592. package/build-module/snackbar/list.js.map +1 -1
  593. package/build-module/spacer/component.js +3 -4
  594. package/build-module/spacer/component.js.map +1 -1
  595. package/build-module/spacer/hook.js +10 -2
  596. package/build-module/spacer/hook.js.map +1 -1
  597. package/build-module/spinner/index.js +22 -13
  598. package/build-module/spinner/index.js.map +1 -1
  599. package/build-module/spinner/styles.js +10 -10
  600. package/build-module/spinner/styles.js.map +1 -1
  601. package/build-module/surface/component.js +7 -7
  602. package/build-module/surface/component.js.map +1 -1
  603. package/build-module/surface/hook.js +8 -11
  604. package/build-module/surface/hook.js.map +1 -1
  605. package/build-module/surface/index.js.map +1 -1
  606. package/build-module/surface/styles.js +8 -48
  607. package/build-module/surface/styles.js.map +1 -1
  608. package/build-module/tab-panel/index.js +3 -1
  609. package/build-module/tab-panel/index.js.map +1 -1
  610. package/build-module/text/hook.js +4 -4
  611. package/build-module/text/hook.js.map +1 -1
  612. package/build-module/text/utils.js.map +1 -1
  613. package/build-module/textarea-control/index.js +36 -5
  614. package/build-module/textarea-control/index.js.map +1 -1
  615. package/build-module/textarea-control/styles/textarea-control-styles.js +3 -3
  616. package/build-module/textarea-control/styles/textarea-control-styles.js.map +1 -1
  617. package/build-module/textarea-control/types.js +2 -0
  618. package/build-module/textarea-control/types.js.map +1 -0
  619. package/build-module/toggle-control/index.js +1 -2
  620. package/build-module/toggle-control/index.js.map +1 -1
  621. package/build-module/toggle-control/index.native.js +1 -6
  622. package/build-module/toggle-control/index.native.js.map +1 -1
  623. package/build-module/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.js.map +1 -1
  624. package/build-module/toolbar/index.js.map +1 -1
  625. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  626. package/build-module/tools-panel/tools-panel-header/hook.js.map +1 -1
  627. package/build-module/tooltip/index.js +2 -1
  628. package/build-module/tooltip/index.js.map +1 -1
  629. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  630. package/build-module/tree-select/index.js +53 -3
  631. package/build-module/tree-select/index.js.map +1 -1
  632. package/build-module/tree-select/types.js +2 -0
  633. package/build-module/tree-select/types.js.map +1 -0
  634. package/build-module/truncate/component.js +7 -8
  635. package/build-module/truncate/component.js.map +1 -1
  636. package/build-module/truncate/hook.js +3 -10
  637. package/build-module/truncate/hook.js.map +1 -1
  638. package/build-module/truncate/index.js.map +1 -1
  639. package/build-module/truncate/styles.js +1 -1
  640. package/build-module/truncate/styles.js.map +1 -1
  641. package/build-module/truncate/utils.js +3 -16
  642. package/build-module/truncate/utils.js.map +1 -1
  643. package/build-module/ui/form-group/form-group-content.js.map +1 -1
  644. package/build-module/unit-control/index.js.map +1 -1
  645. package/build-module/utils/hooks/index.js +0 -1
  646. package/build-module/utils/hooks/index.js.map +1 -1
  647. package/build-module/utils/math.js +15 -6
  648. package/build-module/utils/math.js.map +1 -1
  649. package/build-module/utils/unit-values.js.map +1 -1
  650. package/build-module/utils/values.js.map +1 -1
  651. package/build-module/v-stack/component.js +9 -9
  652. package/build-module/v-stack/component.js.map +1 -1
  653. package/build-module/v-stack/hook.js +0 -5
  654. package/build-module/v-stack/hook.js.map +1 -1
  655. package/build-module/v-stack/index.js.map +1 -1
  656. package/build-module/z-stack/component.js +21 -2
  657. package/build-module/z-stack/component.js.map +1 -1
  658. package/build-module/z-stack/types.js +2 -0
  659. package/build-module/z-stack/types.js.map +1 -0
  660. package/build-style/style-rtl.css +61 -191
  661. package/build-style/style.css +61 -195
  662. package/build-types/base-control/stories/index.d.ts.map +1 -1
  663. package/build-types/base-field/hook.d.ts +0 -1
  664. package/build-types/base-field/hook.d.ts.map +1 -1
  665. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  666. package/build-types/border-box-control/border-box-control/hook.d.ts +0 -1
  667. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  668. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  669. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +0 -1
  670. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  671. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  672. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +1 -1
  673. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  674. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +0 -1
  675. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  676. package/build-types/border-box-control/styles.d.ts +3 -2
  677. package/build-types/border-box-control/styles.d.ts.map +1 -1
  678. package/build-types/border-box-control/utils.d.ts.map +1 -1
  679. package/build-types/border-control/border-control/component.d.ts +36 -2
  680. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  681. package/build-types/border-control/border-control/hook.d.ts +0 -1
  682. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  683. package/build-types/border-control/border-control-dropdown/hook.d.ts +0 -1
  684. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  685. package/build-types/border-control/border-control-style-picker/hook.d.ts +0 -1
  686. package/build-types/border-control/border-control-style-picker/hook.d.ts.map +1 -1
  687. package/build-types/border-control/stories/index.d.ts +33 -0
  688. package/build-types/border-control/stories/index.d.ts.map +1 -0
  689. package/build-types/button-group/index.d.ts +1 -1
  690. package/build-types/button-group/index.d.ts.map +1 -1
  691. package/build-types/card/card/hook.d.ts +0 -1
  692. package/build-types/card/card/hook.d.ts.map +1 -1
  693. package/build-types/card/card-body/hook.d.ts +0 -1
  694. package/build-types/card/card-body/hook.d.ts.map +1 -1
  695. package/build-types/card/card-divider/hook.d.ts +0 -1
  696. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  697. package/build-types/card/card-footer/hook.d.ts +0 -1
  698. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  699. package/build-types/card/card-header/hook.d.ts +0 -1
  700. package/build-types/card/card-header/hook.d.ts.map +1 -1
  701. package/build-types/card/card-media/hook.d.ts +0 -1
  702. package/build-types/card/card-media/hook.d.ts.map +1 -1
  703. package/build-types/card/types.d.ts +1 -1
  704. package/build-types/card/types.d.ts.map +1 -1
  705. package/build-types/checkbox-control/index.d.ts.map +1 -1
  706. package/build-types/checkbox-control/stories/index.d.ts.map +1 -1
  707. package/build-types/checkbox-control/test/index.d.ts +2 -0
  708. package/build-types/checkbox-control/test/index.d.ts.map +1 -0
  709. package/build-types/color-indicator/index.d.ts +16 -5
  710. package/build-types/color-indicator/index.d.ts.map +1 -1
  711. package/build-types/color-indicator/stories/index.d.ts +12 -0
  712. package/build-types/color-indicator/stories/index.d.ts.map +1 -0
  713. package/build-types/color-indicator/test/index.d.ts +2 -0
  714. package/build-types/color-indicator/test/index.d.ts.map +1 -0
  715. package/build-types/color-indicator/types.d.ts +12 -0
  716. package/build-types/color-indicator/types.d.ts.map +1 -0
  717. package/build-types/color-palette/index.d.ts +1 -0
  718. package/build-types/color-palette/index.d.ts.map +1 -1
  719. package/build-types/color-palette/styles.d.ts +4 -2
  720. package/build-types/color-palette/styles.d.ts.map +1 -1
  721. package/build-types/{date-time → color-palette}/test/utils.d.ts +0 -0
  722. package/build-types/color-palette/test/utils.d.ts.map +1 -0
  723. package/build-types/color-picker/color-copy-button.d.ts +4 -0
  724. package/build-types/color-picker/color-copy-button.d.ts.map +1 -0
  725. package/build-types/color-picker/component.d.ts.map +1 -1
  726. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  727. package/build-types/color-picker/styles.d.ts +25 -8
  728. package/build-types/color-picker/styles.d.ts.map +1 -1
  729. package/build-types/color-picker/types.d.ts +8 -0
  730. package/build-types/color-picker/types.d.ts.map +1 -1
  731. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  732. package/build-types/date-time/{date.d.ts → date/index.d.ts} +4 -3
  733. package/build-types/date-time/date/index.d.ts.map +1 -0
  734. package/build-types/date-time/date/styles.d.ts +23 -0
  735. package/build-types/date-time/date/styles.d.ts.map +1 -0
  736. package/build-types/date-time/date/test/index.d.ts +2 -0
  737. package/build-types/date-time/date/test/index.d.ts.map +1 -0
  738. package/build-types/date-time/date/test/utils.d.ts +2 -0
  739. package/build-types/date-time/date/test/utils.d.ts.map +1 -0
  740. package/build-types/date-time/{utils.d.ts → date/utils.d.ts} +0 -0
  741. package/build-types/date-time/date/utils.d.ts.map +1 -0
  742. package/build-types/date-time/date-time/index.d.ts +33 -0
  743. package/build-types/date-time/date-time/index.d.ts.map +1 -0
  744. package/build-types/date-time/date-time/styles.d.ts +6 -0
  745. package/build-types/date-time/date-time/styles.d.ts.map +1 -0
  746. package/build-types/date-time/index.d.ts +2 -28
  747. package/build-types/date-time/index.d.ts.map +1 -1
  748. package/build-types/date-time/stories/{index.d.ts → date-time.d.ts} +2 -2
  749. package/build-types/date-time/stories/date-time.d.ts.map +1 -0
  750. package/build-types/date-time/stories/date.d.ts.map +1 -1
  751. package/build-types/date-time/{time.d.ts → time/index.d.ts} +2 -2
  752. package/build-types/date-time/time/index.d.ts.map +1 -0
  753. package/build-types/date-time/time/styles.d.ts +111 -0
  754. package/build-types/date-time/time/styles.d.ts.map +1 -0
  755. package/build-types/date-time/time/test/index.d.ts +2 -0
  756. package/build-types/date-time/time/test/index.d.ts.map +1 -0
  757. package/build-types/date-time/{timezone.d.ts → time/timezone.d.ts} +0 -0
  758. package/build-types/date-time/time/timezone.d.ts.map +1 -0
  759. package/build-types/date-time/types.d.ts +20 -15
  760. package/build-types/date-time/types.d.ts.map +1 -1
  761. package/build-types/divider/styles.d.ts.map +1 -1
  762. package/build-types/dropdown/index.d.ts.map +1 -1
  763. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  764. package/build-types/elevation/hook.d.ts +0 -1
  765. package/build-types/elevation/hook.d.ts.map +1 -1
  766. package/build-types/external-link/index.d.ts +17 -0
  767. package/build-types/external-link/index.d.ts.map +1 -0
  768. package/build-types/external-link/stories/index.d.ts +12 -0
  769. package/build-types/external-link/stories/index.d.ts.map +1 -0
  770. package/build-types/external-link/styles/external-link-styles.d.ts +10 -0
  771. package/build-types/external-link/styles/external-link-styles.d.ts.map +1 -0
  772. package/build-types/external-link/types.d.ts +15 -0
  773. package/build-types/external-link/types.d.ts.map +1 -0
  774. package/build-types/flex/flex/hook.d.ts +0 -1
  775. package/build-types/flex/flex/hook.d.ts.map +1 -1
  776. package/build-types/flex/flex-block/hook.d.ts +0 -1
  777. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  778. package/build-types/flex/flex-item/hook.d.ts +0 -1
  779. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  780. package/build-types/form-toggle/index.d.ts +29 -0
  781. package/build-types/form-toggle/index.d.ts.map +1 -0
  782. package/build-types/form-toggle/stories/index.d.ts +12 -0
  783. package/build-types/form-toggle/stories/index.d.ts.map +1 -0
  784. package/build-types/form-toggle/test/index.d.ts +2 -0
  785. package/build-types/form-toggle/test/index.d.ts.map +1 -0
  786. package/build-types/form-toggle/types.d.ts +22 -0
  787. package/build-types/form-toggle/types.d.ts.map +1 -0
  788. package/build-types/form-token-field/index.d.ts +15 -0
  789. package/build-types/form-token-field/index.d.ts.map +1 -0
  790. package/build-types/form-token-field/stories/index.d.ts +13 -0
  791. package/build-types/form-token-field/stories/index.d.ts.map +1 -0
  792. package/build-types/form-token-field/suggestions-list.d.ts +10 -0
  793. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -0
  794. package/build-types/form-token-field/test/lib/fixtures.d.ts +26 -0
  795. package/build-types/form-token-field/test/lib/fixtures.d.ts.map +1 -0
  796. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts +21 -0
  797. package/build-types/form-token-field/test/lib/token-field-wrapper.d.ts.map +1 -0
  798. package/build-types/form-token-field/token-input.d.ts +12 -0
  799. package/build-types/form-token-field/token-input.d.ts.map +1 -0
  800. package/build-types/form-token-field/token.d.ts +4 -0
  801. package/build-types/form-token-field/token.d.ts.map +1 -0
  802. package/build-types/form-token-field/types.d.ts +176 -0
  803. package/build-types/form-token-field/types.d.ts.map +1 -0
  804. package/build-types/grid/hook.d.ts +0 -1
  805. package/build-types/grid/hook.d.ts.map +1 -1
  806. package/build-types/h-stack/hook.d.ts +0 -1
  807. package/build-types/h-stack/hook.d.ts.map +1 -1
  808. package/build-types/heading/component.d.ts +1 -2
  809. package/build-types/heading/component.d.ts.map +1 -1
  810. package/build-types/heading/hook.d.ts +1 -29
  811. package/build-types/heading/hook.d.ts.map +1 -1
  812. package/build-types/heading/stories/index.d.ts.map +1 -1
  813. package/build-types/heading/test/index.d.ts +2 -0
  814. package/build-types/heading/test/index.d.ts.map +1 -0
  815. package/build-types/heading/types.d.ts +16 -0
  816. package/build-types/heading/types.d.ts.map +1 -0
  817. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  818. package/build-types/input-control/index.d.ts +1 -1
  819. package/build-types/input-control/index.d.ts.map +1 -1
  820. package/build-types/input-control/input-field.d.ts +1 -1
  821. package/build-types/input-control/input-field.d.ts.map +1 -1
  822. package/build-types/input-control/reducer/reducer.d.ts +5 -3
  823. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  824. package/build-types/input-control/reducer/state.d.ts +2 -2
  825. package/build-types/input-control/reducer/state.d.ts.map +1 -1
  826. package/build-types/input-control/stories/index.d.ts +5 -5
  827. package/build-types/input-control/stories/index.d.ts.map +1 -1
  828. package/build-types/input-control/utils.d.ts +17 -0
  829. package/build-types/input-control/utils.d.ts.map +1 -1
  830. package/build-types/item-group/item/hook.d.ts +0 -1
  831. package/build-types/item-group/item/hook.d.ts.map +1 -1
  832. package/build-types/item-group/item-group/hook.d.ts +0 -1
  833. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  834. package/build-types/navigator/navigator-back-button/hook.d.ts +0 -1
  835. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  836. package/build-types/navigator/navigator-button/hook.d.ts +0 -1
  837. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  838. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  839. package/build-types/number-control/styles/number-control-styles.d.ts +1 -1
  840. package/build-types/popover/index.d.ts +1 -0
  841. package/build-types/popover/index.d.ts.map +1 -1
  842. package/build-types/radio-control/index.d.ts +31 -0
  843. package/build-types/radio-control/index.d.ts.map +1 -0
  844. package/build-types/radio-control/stories/index.d.ts +12 -0
  845. package/build-types/radio-control/stories/index.d.ts.map +1 -0
  846. package/build-types/radio-control/types.d.ts +29 -0
  847. package/build-types/radio-control/types.d.ts.map +1 -0
  848. package/build-types/range-control/index.d.ts +5 -5
  849. package/build-types/range-control/index.d.ts.map +1 -1
  850. package/build-types/range-control/input-range.d.ts +4 -4
  851. package/build-types/range-control/input-range.d.ts.map +1 -1
  852. package/build-types/range-control/utils.d.ts.map +1 -1
  853. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  854. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  855. package/build-types/scrollable/hook.d.ts +0 -1
  856. package/build-types/scrollable/hook.d.ts.map +1 -1
  857. package/build-types/select-control/index.d.ts +1 -1
  858. package/build-types/select-control/index.d.ts.map +1 -1
  859. package/build-types/select-control/stories/index.d.ts +3 -3
  860. package/build-types/select-control/stories/index.d.ts.map +1 -1
  861. package/build-types/select-control/types.d.ts +1 -1
  862. package/build-types/select-control/types.d.ts.map +1 -1
  863. package/build-types/slot-fill/fill.d.ts.map +1 -1
  864. package/build-types/slot-fill/slot.d.ts.map +1 -1
  865. package/build-types/spacer/component.d.ts +2 -3
  866. package/build-types/spacer/component.d.ts.map +1 -1
  867. package/build-types/spacer/hook.d.ts +0 -1
  868. package/build-types/spacer/hook.d.ts.map +1 -1
  869. package/build-types/spacer/stories/index.d.ts +12 -0
  870. package/build-types/spacer/stories/index.d.ts.map +1 -0
  871. package/build-types/spinner/index.d.ts +16 -15
  872. package/build-types/spinner/index.d.ts.map +1 -1
  873. package/build-types/spinner/stories/index.d.ts +13 -0
  874. package/build-types/spinner/stories/index.d.ts.map +1 -0
  875. package/build-types/spinner/styles.d.ts +4 -3
  876. package/build-types/spinner/styles.d.ts.map +1 -1
  877. package/build-types/surface/component.d.ts +3 -2
  878. package/build-types/surface/component.d.ts.map +1 -1
  879. package/build-types/surface/hook.d.ts +4 -5
  880. package/build-types/surface/hook.d.ts.map +1 -1
  881. package/build-types/surface/index.d.ts +2 -2
  882. package/build-types/surface/index.d.ts.map +1 -1
  883. package/build-types/surface/stories/index.d.ts +12 -0
  884. package/build-types/surface/stories/index.d.ts.map +1 -0
  885. package/build-types/surface/styles.d.ts +10 -21
  886. package/build-types/surface/styles.d.ts.map +1 -1
  887. package/build-types/surface/test/index.d.ts +2 -0
  888. package/build-types/surface/test/index.d.ts.map +1 -0
  889. package/build-types/surface/types.d.ts +1 -1
  890. package/build-types/surface/types.d.ts.map +1 -1
  891. package/build-types/text/hook.d.ts +0 -1
  892. package/build-types/text/hook.d.ts.map +1 -1
  893. package/build-types/text/types.d.ts +1 -1
  894. package/build-types/text/types.d.ts.map +1 -1
  895. package/build-types/text/utils.d.ts.map +1 -1
  896. package/build-types/text-control/index.d.ts +1 -1
  897. package/build-types/text-control/index.d.ts.map +1 -1
  898. package/build-types/text-control/stories/index.d.ts.map +1 -1
  899. package/build-types/textarea-control/index.d.ts +29 -0
  900. package/build-types/textarea-control/index.d.ts.map +1 -0
  901. package/build-types/textarea-control/stories/index.d.ts +12 -0
  902. package/build-types/textarea-control/stories/index.d.ts.map +1 -0
  903. package/build-types/textarea-control/styles/textarea-control-styles.d.ts +6 -0
  904. package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -0
  905. package/build-types/textarea-control/types.d.ts +26 -0
  906. package/build-types/textarea-control/types.d.ts.map +1 -0
  907. package/build-types/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.d.ts.map +1 -1
  908. package/build-types/tools-panel/tools-panel/hook.d.ts +0 -1
  909. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  910. package/build-types/tools-panel/tools-panel-header/hook.d.ts +0 -1
  911. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  912. package/build-types/tools-panel/tools-panel-item/hook.d.ts +0 -1
  913. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  914. package/build-types/tooltip/index.d.ts.map +1 -1
  915. package/build-types/tree-select/index.d.ts +53 -0
  916. package/build-types/tree-select/index.d.ts.map +1 -0
  917. package/build-types/tree-select/stories/index.d.ts +12 -0
  918. package/build-types/tree-select/stories/index.d.ts.map +1 -0
  919. package/build-types/tree-select/types.d.ts +30 -0
  920. package/build-types/tree-select/types.d.ts.map +1 -0
  921. package/build-types/truncate/component.d.ts +3 -3
  922. package/build-types/truncate/component.d.ts.map +1 -1
  923. package/build-types/truncate/hook.d.ts +5 -3
  924. package/build-types/truncate/hook.d.ts.map +1 -1
  925. package/build-types/truncate/index.d.ts +2 -2
  926. package/build-types/truncate/index.d.ts.map +1 -1
  927. package/build-types/truncate/stories/index.d.ts +13 -0
  928. package/build-types/truncate/stories/index.d.ts.map +1 -0
  929. package/build-types/truncate/styles.d.ts +1 -1
  930. package/build-types/truncate/styles.d.ts.map +1 -1
  931. package/build-types/truncate/test/index.d.ts +2 -0
  932. package/build-types/truncate/test/index.d.ts.map +1 -0
  933. package/build-types/truncate/types.d.ts +22 -11
  934. package/build-types/truncate/types.d.ts.map +1 -1
  935. package/build-types/truncate/utils.d.ts +17 -28
  936. package/build-types/truncate/utils.d.ts.map +1 -1
  937. package/build-types/ui/context/wordpress-component.d.ts.map +1 -1
  938. package/build-types/ui/control-group/hook.d.ts +0 -1
  939. package/build-types/ui/control-group/hook.d.ts.map +1 -1
  940. package/build-types/ui/control-label/hook.d.ts +0 -1
  941. package/build-types/ui/control-label/hook.d.ts.map +1 -1
  942. package/build-types/ui/form-group/use-form-group.d.ts +2 -4
  943. package/build-types/ui/form-group/use-form-group.d.ts.map +1 -1
  944. package/build-types/unit-control/index.d.ts +1 -1
  945. package/build-types/unit-control/index.d.ts.map +1 -1
  946. package/build-types/unit-control/stories/index.d.ts.map +1 -1
  947. package/build-types/utils/hooks/index.d.ts +0 -1
  948. package/build-types/utils/math.d.ts +10 -0
  949. package/build-types/utils/math.d.ts.map +1 -1
  950. package/build-types/utils/unit-values.d.ts.map +1 -1
  951. package/build-types/utils/values.d.ts.map +1 -1
  952. package/build-types/v-stack/component.d.ts +5 -4
  953. package/build-types/v-stack/component.d.ts.map +1 -1
  954. package/build-types/v-stack/hook.d.ts +5 -4
  955. package/build-types/v-stack/hook.d.ts.map +1 -1
  956. package/build-types/v-stack/index.d.ts +2 -2
  957. package/build-types/v-stack/index.d.ts.map +1 -1
  958. package/build-types/v-stack/stories/index.d.ts +9 -0
  959. package/build-types/v-stack/stories/index.d.ts.map +1 -0
  960. package/build-types/v-stack/test/index.d.ts +2 -0
  961. package/build-types/v-stack/test/index.d.ts.map +1 -0
  962. package/build-types/v-stack/types.d.ts +21 -1
  963. package/build-types/v-stack/types.d.ts.map +1 -1
  964. package/build-types/z-stack/component.d.ts +18 -28
  965. package/build-types/z-stack/component.d.ts.map +1 -1
  966. package/build-types/z-stack/stories/index.d.ts +6 -0
  967. package/build-types/z-stack/stories/index.d.ts.map +1 -0
  968. package/build-types/z-stack/types.d.ts +33 -0
  969. package/build-types/z-stack/types.d.ts.map +1 -0
  970. package/package.json +19 -18
  971. package/src/alignment-matrix-control/index.js +6 -3
  972. package/src/alignment-matrix-control/utils.js +1 -6
  973. package/src/angle-picker-control/index.js +1 -1
  974. package/src/autocomplete/autocompleter-ui.js +3 -0
  975. package/src/autocomplete/autocompleter-ui.native.js +6 -0
  976. package/src/autocomplete/index.js +16 -8
  977. package/src/base-control/stories/index.tsx +2 -3
  978. package/src/border-box-control/border-box-control/component.tsx +1 -0
  979. package/src/border-box-control/border-box-control/hook.ts +2 -2
  980. package/src/border-box-control/border-box-control-linked-button/component.tsx +2 -5
  981. package/src/border-box-control/border-box-control-split-controls/component.tsx +3 -0
  982. package/src/border-box-control/border-box-control-split-controls/hook.ts +18 -4
  983. package/src/border-box-control/border-box-control-visualizer/hook.ts +5 -2
  984. package/src/border-box-control/styles.ts +6 -2
  985. package/src/border-box-control/utils.ts +5 -2
  986. package/src/border-control/border-control/component.tsx +41 -4
  987. package/src/border-control/border-control/hook.ts +10 -5
  988. package/src/border-control/stories/index.tsx +150 -0
  989. package/src/box-control/all-input-control.js +2 -4
  990. package/src/box-control/axial-input-controls.js +4 -6
  991. package/src/box-control/index.js +2 -5
  992. package/src/box-control/input-controls.js +33 -36
  993. package/src/box-control/test/index.js +120 -109
  994. package/src/box-control/unit-control.js +2 -1
  995. package/src/box-control/utils.js +4 -4
  996. package/src/button/index.native.js +1 -2
  997. package/src/card/stories/index.js +10 -5
  998. package/src/card/types.ts +1 -1
  999. package/src/checkbox-control/index.tsx +2 -3
  1000. package/src/checkbox-control/stories/index.tsx +2 -3
  1001. package/src/checkbox-control/test/__snapshots__/index.tsx.snap +42 -0
  1002. package/src/checkbox-control/test/index.tsx +110 -0
  1003. package/src/color-indicator/README.md +7 -9
  1004. package/src/color-indicator/index.tsx +47 -0
  1005. package/src/color-indicator/stories/index.tsx +37 -0
  1006. package/src/color-indicator/test/__snapshots__/index.tsx.snap +11 -0
  1007. package/src/color-indicator/test/{index.js → index.tsx} +4 -4
  1008. package/src/color-indicator/types.ts +12 -0
  1009. package/src/color-palette/index.js +16 -5
  1010. package/src/color-palette/index.native.js +3 -0
  1011. package/src/color-palette/stories/index.js +25 -1
  1012. package/src/color-palette/test/utils.ts +24 -0
  1013. package/src/color-picker/color-copy-button.tsx +76 -0
  1014. package/src/color-picker/component.tsx +18 -37
  1015. package/src/color-picker/hex-input.tsx +16 -0
  1016. package/src/color-picker/index.native.js +7 -4
  1017. package/src/color-picker/input-with-slider.tsx +2 -2
  1018. package/src/color-picker/styles.ts +25 -2
  1019. package/src/color-picker/types.ts +9 -0
  1020. package/src/combobox-control/index.js +4 -2
  1021. package/src/confirm-dialog/component.tsx +7 -8
  1022. package/src/custom-gradient-bar/constants.js +2 -2
  1023. package/src/custom-gradient-bar/control-points.js +20 -16
  1024. package/src/custom-gradient-bar/index.js +11 -11
  1025. package/src/custom-gradient-bar/test/utils.js +79 -0
  1026. package/src/custom-gradient-bar/utils.js +6 -18
  1027. package/src/custom-gradient-picker/index.js +4 -11
  1028. package/src/custom-gradient-picker/index.native.js +3 -11
  1029. package/src/custom-gradient-picker/serializer.js +5 -11
  1030. package/src/custom-gradient-picker/style.scss +1 -3
  1031. package/src/custom-gradient-picker/utils.js +5 -4
  1032. package/src/custom-select-control/index.js +2 -1
  1033. package/src/custom-select-control/stories/index.js +1 -2
  1034. package/src/date-time/README.md +23 -0
  1035. package/src/date-time/{datepicker.scss → date/datepicker.scss} +0 -0
  1036. package/src/date-time/{date.tsx → date/index.tsx} +42 -17
  1037. package/src/date-time/date/style.scss +85 -0
  1038. package/src/date-time/date/styles.ts +55 -0
  1039. package/src/date-time/{test/date.tsx → date/test/index.tsx} +2 -2
  1040. package/src/date-time/{test → date/test}/utils.ts +0 -0
  1041. package/src/date-time/{utils.ts → date/utils.ts} +0 -0
  1042. package/src/date-time/date-time/index.tsx +217 -0
  1043. package/src/date-time/date-time/styles.ts +8 -0
  1044. package/src/date-time/index.ts +9 -0
  1045. package/src/date-time/stories/{index.tsx → date-time.tsx} +5 -7
  1046. package/src/date-time/stories/date.tsx +2 -3
  1047. package/src/date-time/style.scss +1 -262
  1048. package/src/date-time/time/index.tsx +356 -0
  1049. package/src/date-time/time/styles.ts +119 -0
  1050. package/src/date-time/{test/time.tsx → time/test/index.tsx} +97 -50
  1051. package/src/date-time/{timezone.tsx → time/timezone.tsx} +5 -2
  1052. package/src/date-time/types.ts +23 -18
  1053. package/src/dimension-control/README.md +5 -2
  1054. package/src/dimension-control/index.js +1 -2
  1055. package/src/dimension-control/test/index.test.js +7 -7
  1056. package/src/divider/styles.ts +2 -3
  1057. package/src/draggable/index.js +3 -3
  1058. package/src/draggable/index.native.js +26 -7
  1059. package/src/draggable/test/index.native.js +130 -0
  1060. package/src/drop-zone/provider.js +1 -2
  1061. package/src/dropdown/index.js +7 -3
  1062. package/src/dropdown-menu/index.js +11 -1
  1063. package/src/dropdown-menu/index.native.js +11 -1
  1064. package/src/duotone-picker/duotone-picker.js +58 -37
  1065. package/src/duotone-picker/style.scss +19 -0
  1066. package/src/elevation/hook.js +8 -8
  1067. package/src/external-link/README.md +18 -0
  1068. package/src/external-link/{index.js → index.tsx} +26 -6
  1069. package/src/external-link/stories/index.tsx +36 -0
  1070. package/src/external-link/styles/{external-link-styles.js → external-link-styles.ts} +0 -0
  1071. package/src/external-link/types.ts +15 -0
  1072. package/src/flex/flex/README.md +5 -10
  1073. package/src/flex/flex/hook.js +4 -1
  1074. package/src/flex/flex-item/README.md +1 -1
  1075. package/src/focal-point-picker/controls.js +1 -5
  1076. package/src/focal-point-picker/index.js +2 -8
  1077. package/src/focal-point-picker/index.native.js +1 -1
  1078. package/src/focal-point-picker/media.js +2 -5
  1079. package/src/font-size-picker/index.js +3 -1
  1080. package/src/form-toggle/README.md +10 -11
  1081. package/src/form-toggle/index.tsx +71 -0
  1082. package/src/form-toggle/stories/index.tsx +52 -0
  1083. package/src/form-toggle/test/__snapshots__/index.tsx.snap +54 -0
  1084. package/src/form-toggle/test/index.tsx +102 -0
  1085. package/src/form-toggle/types.ts +22 -0
  1086. package/src/form-token-field/index.tsx +694 -0
  1087. package/src/form-token-field/stories/index.tsx +103 -0
  1088. package/src/form-token-field/style.scss +2 -1
  1089. package/src/form-token-field/{suggestions-list.js → suggestions-list.tsx} +45 -29
  1090. package/src/form-token-field/test/index.js +70 -40
  1091. package/src/form-token-field/test/lib/token-field-wrapper.tsx +71 -0
  1092. package/src/form-token-field/token-input.tsx +76 -0
  1093. package/src/form-token-field/{token.js → token.tsx} +4 -2
  1094. package/src/form-token-field/types.ts +178 -0
  1095. package/src/gradient-picker/index.js +4 -3
  1096. package/src/h-stack/utils.js +3 -3
  1097. package/src/heading/README.md +4 -3
  1098. package/src/heading/component.tsx +2 -2
  1099. package/src/heading/hook.ts +6 -46
  1100. package/src/heading/stories/index.tsx +5 -1
  1101. package/src/heading/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1102. package/src/heading/test/index.tsx +68 -0
  1103. package/src/heading/types.ts +29 -0
  1104. package/src/higher-order/navigate-regions/index.js +7 -5
  1105. package/src/higher-order/with-filters/test/index.js +43 -36
  1106. package/src/higher-order/with-focus-return/index.js +14 -13
  1107. package/src/higher-order/with-spoken-messages/index.js +8 -7
  1108. package/src/higher-order/with-spoken-messages/test/index.js +1 -1
  1109. package/src/icon/index.tsx +2 -2
  1110. package/src/input-control/index.tsx +10 -3
  1111. package/src/input-control/input-field.tsx +12 -31
  1112. package/src/input-control/reducer/reducer.ts +63 -47
  1113. package/src/input-control/reducer/state.ts +2 -3
  1114. package/src/input-control/test/index.js +106 -31
  1115. package/src/input-control/utils.ts +56 -2
  1116. package/src/item-group/stories/index.js +2 -1
  1117. package/src/menu-item/test/index.js +2 -1
  1118. package/src/menu-items-choice/index.js +2 -5
  1119. package/src/mobile/bottom-sheet/bottom-sheet-context.native.js +2 -4
  1120. package/src/mobile/bottom-sheet/cell.native.js +2 -3
  1121. package/src/mobile/bottom-sheet/cycle-picker-cell.native.js +3 -5
  1122. package/src/mobile/bottom-sheet/index.native.js +14 -17
  1123. package/src/mobile/bottom-sheet/keyboard-avoiding-view.native.js +2 -7
  1124. package/src/mobile/bottom-sheet/picker-cell.native.js +2 -7
  1125. package/src/mobile/bottom-sheet/stepper-cell/index.native.js +4 -6
  1126. package/src/mobile/color-settings/index.native.js +2 -4
  1127. package/src/mobile/global-styles-context/index.native.js +8 -7
  1128. package/src/mobile/gradient/index.native.js +12 -9
  1129. package/src/mobile/gradient/test/index.native.js +1 -3
  1130. package/src/mobile/html-text-input/index.native.js +2 -3
  1131. package/src/mobile/inserter-button/index.native.js +2 -6
  1132. package/src/mobile/link-picker/index.native.js +2 -3
  1133. package/src/mobile/link-settings/image-link-destinations-screen.native.js +6 -2
  1134. package/src/mobile/media-edit/index.native.js +2 -3
  1135. package/src/mobile/segmented-control/index.native.js +9 -9
  1136. package/src/mobile/utils/test/index.native.js +3 -12
  1137. package/src/modal/index.js +1 -1
  1138. package/src/navigable-container/container.js +3 -2
  1139. package/src/navigable-container/test/menu.js +1 -2
  1140. package/src/navigable-container/test/tabbable.js +1 -2
  1141. package/src/navigation/context.js +2 -5
  1142. package/src/navigation/group/index.js +8 -3
  1143. package/src/navigation/index.js +2 -1
  1144. package/src/navigation/item/base.js +3 -2
  1145. package/src/navigation/item/index.js +2 -1
  1146. package/src/navigation/item/use-navigation-tree-item.js +2 -0
  1147. package/src/navigation/menu/menu-title-search.js +3 -6
  1148. package/src/navigation/menu/search-no-results-found.js +3 -6
  1149. package/src/navigation/stories/controlled-state.js +1 -1
  1150. package/src/navigation/stories/more-examples.js +2 -3
  1151. package/src/navigation/test/index.js +252 -52
  1152. package/src/navigation/use-navigation-tree-nodes.js +11 -10
  1153. package/src/navigation/utils.js +2 -2
  1154. package/src/navigator/navigator-back-button/hook.ts +14 -12
  1155. package/src/navigator/navigator-button/hook.ts +14 -13
  1156. package/src/navigator/navigator-provider/component.tsx +2 -6
  1157. package/src/navigator/navigator-screen/component.tsx +3 -3
  1158. package/src/notice/index.js +2 -1
  1159. package/src/notice/list.js +3 -1
  1160. package/src/number-control/stories/index.js +24 -24
  1161. package/src/panel/body.js +2 -1
  1162. package/src/placeholder/README.md +7 -6
  1163. package/src/placeholder/index.js +27 -10
  1164. package/src/placeholder/style.scss +23 -0
  1165. package/src/popover/index.js +42 -27
  1166. package/src/query-controls/README.md +1 -1
  1167. package/src/radio-control/README.md +17 -23
  1168. package/src/radio-control/index.tsx +107 -0
  1169. package/src/radio-control/stories/index.tsx +72 -0
  1170. package/src/radio-control/types.ts +32 -0
  1171. package/src/range-control/index.js +4 -2
  1172. package/src/range-control/input-range.js +2 -5
  1173. package/src/range-control/utils.js +3 -4
  1174. package/src/resizable-box/resize-tooltip/index.tsx +2 -1
  1175. package/src/resizable-box/resize-tooltip/utils.ts +1 -5
  1176. package/src/responsive-wrapper/index.js +2 -4
  1177. package/src/sandbox/test/index.js +4 -6
  1178. package/src/search-control/index.js +6 -7
  1179. package/src/select-control/README.md +11 -0
  1180. package/src/select-control/index.tsx +9 -2
  1181. package/src/select-control/stories/index.tsx +3 -4
  1182. package/src/select-control/types.ts +1 -1
  1183. package/src/slot-fill/README.md +1 -1
  1184. package/src/slot-fill/fill.js +1 -5
  1185. package/src/slot-fill/slot.js +12 -2
  1186. package/src/slot-fill/test/slot.js +2 -3
  1187. package/src/snackbar/index.js +1 -1
  1188. package/src/snackbar/list.js +2 -1
  1189. package/src/spacer/component.tsx +3 -4
  1190. package/src/spacer/hook.ts +13 -13
  1191. package/src/spacer/stories/index.tsx +70 -0
  1192. package/src/spinner/{index.js → index.tsx} +23 -9
  1193. package/src/spinner/stories/index.tsx +32 -0
  1194. package/src/spinner/{styles.js → styles.ts} +0 -0
  1195. package/src/style.scss +1 -0
  1196. package/src/surface/README.md +15 -15
  1197. package/src/surface/{component.js → component.tsx} +13 -7
  1198. package/src/surface/{hook.js → hook.ts} +13 -12
  1199. package/src/surface/{index.js → index.ts} +0 -0
  1200. package/src/surface/stories/index.tsx +40 -0
  1201. package/src/surface/{styles.js → styles.ts} +15 -44
  1202. package/src/surface/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1203. package/src/surface/test/{index.js → index.tsx} +2 -1
  1204. package/src/surface/types.ts +1 -1
  1205. package/src/tab-panel/index.js +3 -1
  1206. package/src/text/hook.js +4 -1
  1207. package/src/text/types.ts +1 -1
  1208. package/src/text/utils.js +2 -3
  1209. package/src/text-control/stories/index.tsx +4 -6
  1210. package/src/textarea-control/README.md +14 -20
  1211. package/src/textarea-control/index.tsx +86 -0
  1212. package/src/textarea-control/stories/index.tsx +58 -0
  1213. package/src/textarea-control/styles/{textarea-control-styles.js → textarea-control-styles.ts} +0 -0
  1214. package/src/textarea-control/types.ts +30 -0
  1215. package/src/toggle-control/index.js +1 -2
  1216. package/src/toggle-control/index.native.js +2 -6
  1217. package/src/toggle-group-control/toggle-group-control/toggle-group-control-backdrop.tsx +2 -4
  1218. package/src/toolbar/index.js +1 -2
  1219. package/src/tools-panel/tools-panel/hook.ts +2 -4
  1220. package/src/tools-panel/tools-panel-header/hook.ts +2 -5
  1221. package/src/tooltip/index.js +1 -0
  1222. package/src/tree-grid/roving-tab-index-item.js +2 -4
  1223. package/src/tree-grid/test/index.js +2 -3
  1224. package/src/tree-select/README.md +2 -2
  1225. package/src/tree-select/index.tsx +99 -0
  1226. package/src/tree-select/stories/index.tsx +80 -0
  1227. package/src/tree-select/types.ts +35 -0
  1228. package/src/truncate/README.md +16 -12
  1229. package/src/truncate/{component.js → component.tsx} +13 -9
  1230. package/src/truncate/{hook.js → hook.ts} +8 -10
  1231. package/src/truncate/{index.js → index.ts} +0 -0
  1232. package/src/truncate/stories/index.tsx +49 -0
  1233. package/src/truncate/{styles.js → styles.ts} +0 -0
  1234. package/src/truncate/test/{index.js → index.tsx} +4 -4
  1235. package/src/truncate/types.ts +28 -10
  1236. package/src/truncate/{utils.js → utils.ts} +19 -19
  1237. package/src/ui/context/wordpress-component.ts +4 -5
  1238. package/src/ui/form-group/form-group-content.js +4 -4
  1239. package/src/unit-control/index.tsx +7 -9
  1240. package/src/unit-control/stories/index.tsx +8 -12
  1241. package/src/unit-control/test/index.tsx +4 -7
  1242. package/src/utils/hooks/index.js +0 -1
  1243. package/src/utils/hooks/stories/use-cx.js +8 -7
  1244. package/src/utils/hooks/test/use-controlled-state.js +2 -1
  1245. package/src/utils/math.js +14 -5
  1246. package/src/utils/test/math.js +22 -1
  1247. package/src/utils/unit-values.ts +2 -1
  1248. package/src/utils/values.js +2 -3
  1249. package/src/v-stack/README.md +6 -18
  1250. package/src/v-stack/{component.js → component.tsx} +15 -10
  1251. package/src/v-stack/{hook.js → hook.ts} +5 -6
  1252. package/src/v-stack/{index.js → index.ts} +0 -0
  1253. package/src/v-stack/stories/index.tsx +41 -0
  1254. package/src/v-stack/test/__snapshots__/{index.js.snap → index.tsx.snap} +0 -0
  1255. package/src/v-stack/test/{index.js → index.tsx} +0 -0
  1256. package/src/v-stack/types.ts +21 -1
  1257. package/src/z-stack/README.md +14 -3
  1258. package/src/z-stack/component.tsx +24 -29
  1259. package/src/z-stack/stories/index.tsx +76 -0
  1260. package/src/z-stack/types.ts +33 -0
  1261. package/tsconfig.json +7 -0
  1262. package/tsconfig.tsbuildinfo +1 -1
  1263. package/build/color-picker/color-display.js +0 -184
  1264. package/build/color-picker/color-display.js.map +0 -1
  1265. package/build/date-time/date.js.map +0 -1
  1266. package/build/date-time/time.js +0 -289
  1267. package/build/date-time/time.js.map +0 -1
  1268. package/build/date-time/timezone.js.map +0 -1
  1269. package/build/date-time/utils.js.map +0 -1
  1270. package/build/utils/hooks/use-combined-ref.js +0 -32
  1271. package/build/utils/hooks/use-combined-ref.js.map +0 -1
  1272. package/build-module/color-picker/color-display.js +0 -170
  1273. package/build-module/color-picker/color-display.js.map +0 -1
  1274. package/build-module/date-time/date.js.map +0 -1
  1275. package/build-module/date-time/time.js +0 -271
  1276. package/build-module/date-time/time.js.map +0 -1
  1277. package/build-module/date-time/timezone.js.map +0 -1
  1278. package/build-module/date-time/utils.js.map +0 -1
  1279. package/build-module/utils/hooks/use-combined-ref.js +0 -28
  1280. package/build-module/utils/hooks/use-combined-ref.js.map +0 -1
  1281. package/build-types/color-picker/color-display.d.ts +0 -14
  1282. package/build-types/color-picker/color-display.d.ts.map +0 -1
  1283. package/build-types/date-time/date.d.ts.map +0 -1
  1284. package/build-types/date-time/stories/index.d.ts.map +0 -1
  1285. package/build-types/date-time/test/date.d.ts +0 -2
  1286. package/build-types/date-time/test/date.d.ts.map +0 -1
  1287. package/build-types/date-time/test/time.d.ts +0 -2
  1288. package/build-types/date-time/test/time.d.ts.map +0 -1
  1289. package/build-types/date-time/test/utils.d.ts.map +0 -1
  1290. package/build-types/date-time/time.d.ts.map +0 -1
  1291. package/build-types/date-time/timezone.d.ts.map +0 -1
  1292. package/build-types/date-time/utils.d.ts.map +0 -1
  1293. package/build-types/utils/hooks/use-combined-ref.d.ts +0 -8
  1294. package/build-types/utils/hooks/use-combined-ref.d.ts.map +0 -1
  1295. package/src/border-control/stories/index.js +0 -119
  1296. package/src/color-indicator/index.js +0 -16
  1297. package/src/color-indicator/stories/index.js +0 -22
  1298. package/src/color-indicator/test/__snapshots__/index.js.snap +0 -13
  1299. package/src/color-picker/color-display.tsx +0 -169
  1300. package/src/date-time/index.tsx +0 -196
  1301. package/src/date-time/time.tsx +0 -321
  1302. package/src/external-link/stories/index.js +0 -23
  1303. package/src/form-toggle/index.js +0 -37
  1304. package/src/form-toggle/stories/index.js +0 -28
  1305. package/src/form-toggle/test/index.js +0 -75
  1306. package/src/form-token-field/index.js +0 -725
  1307. package/src/form-token-field/stories/index.js +0 -102
  1308. package/src/form-token-field/test/lib/token-field-wrapper.js +0 -56
  1309. package/src/form-token-field/token-input.js +0 -81
  1310. package/src/heading/test/index.js +0 -67
  1311. package/src/radio-control/index.js +0 -69
  1312. package/src/radio-control/stories/index.js +0 -41
  1313. package/src/spacer/stories/index.js +0 -59
  1314. package/src/spinner/stories/index.js +0 -43
  1315. package/src/surface/stories/index.js +0 -46
  1316. package/src/textarea-control/index.js +0 -45
  1317. package/src/textarea-control/stories/index.js +0 -48
  1318. package/src/tree-select/index.js +0 -48
  1319. package/src/tree-select/stories/index.js +0 -80
  1320. package/src/truncate/stories/index.js +0 -38
  1321. package/src/utils/hooks/use-combined-ref.ts +0 -28
  1322. package/src/z-stack/stories/index.js +0 -70
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/border-control/border-control/hook.ts"],"names":["useCallback","useMemo","useState","styles","parseQuantityAndUnitFromRawValue","useContextSystem","useCx","sanitizeBorder","border","hasNoWidth","width","undefined","hasNoColor","color","useBorderControl","props","className","isCompact","onChange","shouldSanitizeBorder","value","__next36pxDefaultSize","otherProps","widthValue","originalWidthUnit","widthUnit","hadPreviousZeroWidth","colorSelection","setColorSelection","styleSelection","setStyleSelection","onBorderChange","newBorder","onWidthChange","newWidth","newWidthValue","parsedValue","hasZeroWidth","updatedBorder","style","onSliderChange","cx","classes","borderControl","innerWrapperClassName","wrapperWidth","widthStyle","heightStyle","wrapperHeight","innerWrapper","widthControlClassName","borderWidthControl","sliderClassName","borderSlider","previousStyleSelection"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,OAAtB,EAA+BC,QAA/B,QAA+C,oBAA/C;AAEA;AACA;AACA;;AACA,OAAO,KAAKC,MAAZ,MAAwB,WAAxB;AACA,SAASC,gCAAT,QAAiD,0BAAjD;AACA,SAASC,gBAAT,QAA0D,kBAA1D;AACA,SAASC,KAAT,QAAsB,0BAAtB;;AAIA,MAAMC,cAAc,GAAKC,MAAF,IAAuB;AAC7C,QAAMC,UAAU,GAAG,CAAAD,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEE,KAAR,MAAkBC,SAAlB,IAA+BH,MAAM,CAACE,KAAP,KAAiB,EAAnE;AACA,QAAME,UAAU,GAAG,CAAAJ,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEK,KAAR,MAAkBF,SAArC,CAF6C,CAI7C;;AACA,MAAKF,UAAU,IAAIG,UAAnB,EAAgC;AAC/B,WAAOD,SAAP;AACA;;AAED,SAAOH,MAAP;AACA,CAVD;;AAYA,OAAO,SAASM,gBAAT,CACNC,KADM,EAEL;AACD,QAAM;AACLC,IAAAA,SADK;AAELC,IAAAA,SAFK;AAGLC,IAAAA,QAHK;AAILC,IA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C,UAAU,GACf,CAAC,CAAED,YAAH,IAAmB1C,MAAM,CAAC0C,YAAP,CAAqBA,YAArB,CADpB;AAEA,UAAME,WAAW,GAAG5C,MAAM,CAAC6C,aAAP,CAAsB3B,qBAAtB,CAApB;AAEA,WAAOoB,EAAE,CAAEtC,MAAM,CAAC8C,YAAP,EAAF,EAAyBH,UAAzB,EAAqCC,WAArC,CAAT;AACA,GAPoC,EAOlC,CAAE9B,SAAF,EAAaP,KAAb,EAAoB+B,EAApB,EAAwBpB,qBAAxB,CAPkC,CAArC;AASA,QAAM6B,qBAAqB,GAAGjD,OAAO,CAAE,MAAM;AAC5C,WAAOwC,EAAE,CAAEtC,MAAM,CAACgD,kBAAP,EAAF,CAAT;AACA,GAFoC,EAElC,CAAEV,EAAF,CAFkC,CAArC;AAIA,QAAMW,eAAe,GAAGnD,OAAO,CAAE,MAAM;AACtC,WAAOwC,EAAE,CAAEtC,MAAM,CAACkD,YAAP,EAAF,CAAT;AACA,GAF8B,EAE5B,CAAEZ,EAAF,CAF4B,CAA/B;AAIA,SAAO,EACN,GAAGnB,UADG;AAENN,IAAAA,SAAS,EAAE0B,OAFL;AAGNE,IAAAA,qBAHM;AAINb,IAAAA,cAJM;AAKNS,IAAAA,cALM;AAMNP,IAAAA,aANM;AAONqB,IAAAA,sBAAsB,EAAEzB,cAPlB;AAQNuB,IAAAA,eARM;AASNhC,IAAAA,KAAK,EAAEZ,MATD;AAUN0C,IAAAA,qBAVM;AAWNzB,IAAAA,SAXM;AAYNF,IAAAA,UAZM;AAaNF,IAAAA;AAbM,GAAP;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport * as styles from '../styles';\nimport { parseQuantityAndUnitFromRawValue } from '../../unit-control/utils';\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\n\nimport type { Border, BorderControlProps } from '../types';\n\nconst sanitizeBorder = ( border?: Border ) => {\n\tconst hasNoWidth = border?.width === undefined || border.width === '';\n\tconst hasNoColor = border?.color === undefined;\n\n\t// If width and color are undefined, unset any style selection as well.\n\tif ( hasNoWidth && hasNoColor ) {\n\t\treturn undefined;\n\t}\n\n\treturn border;\n};\n\nexport function useBorderControl(\n\tprops: WordPressComponentProps< BorderControlProps, 'div' >\n) {\n\tconst {\n\t\tclassName,\n\t\tisCompact,\n\t\tonChange,\n\t\tshouldSanitizeBorder = true,\n\t\tvalue: border,\n\t\twidth,\n\t\t__next36pxDefaultSize = false,\n\t\t...otherProps\n\t} = useContextSystem( props, 'BorderControl' );\n\n\tconst [ widthValue, originalWidthUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tborder?.width\n\t);\n\tconst widthUnit = originalWidthUnit || 'px';\n\tconst hadPreviousZeroWidth = widthValue === 0;\n\n\tconst [ colorSelection, setColorSelection ] = useState< string >();\n\tconst [ styleSelection, setStyleSelection ] = useState< string >();\n\n\tconst onBorderChange = useCallback(\n\t\t( newBorder?: Border ) => {\n\t\t\tif ( shouldSanitizeBorder ) {\n\t\t\t\treturn onChange( sanitizeBorder( newBorder ) );\n\t\t\t}\n\n\t\t\tonChange( newBorder );\n\t\t},\n\t\t[ onChange, shouldSanitizeBorder, sanitizeBorder ]\n\t);\n\n\tconst onWidthChange = useCallback(\n\t\t( newWidth?: string ) => {\n\t\t\tconst newWidthValue = newWidth === '' ? undefined : newWidth;\n\t\t\tconst [ parsedValue ] = parseQuantityAndUnitFromRawValue(\n\t\t\t\tnewWidth\n\t\t\t);\n\t\t\tconst hasZeroWidth = parsedValue === 0;\n\n\t\t\tconst updatedBorder = { ...border, width: newWidthValue };\n\n\t\t\t// Setting the border width explicitly to zero will also set the\n\t\t\t// border style to `none` and clear the border color.\n\t\t\tif ( hasZeroWidth && ! hadPreviousZeroWidth ) {\n\t\t\t\t// Before clearing the color and style selections, keep track of\n\t\t\t\t// the current selections so they can be restored when the width\n\t\t\t\t// changes to a non-zero value.\n\t\t\t\tsetColorSelection( border?.color );\n\t\t\t\tsetStyleSelection( border?.style );\n\n\t\t\t\t// Clear the color and style border properties.\n\t\t\t\tupdatedBorder.color = undefined;\n\t\t\t\tupdatedBorder.style = 'none';\n\t\t\t}\n\n\t\t\t// Selection has changed from zero border width to non-zero width.\n\t\t\tif ( ! hasZeroWidth && hadPreviousZeroWidth ) {\n\t\t\t\t// Restore previous border color and style selections if width\n\t\t\t\t// is now not zero.\n\t\t\t\tif ( updatedBorder.color === undefined ) {\n\t\t\t\t\tupdatedBorder.color = colorSelection;\n\t\t\t\t}\n\t\t\t\tif ( updatedBorder.style === 'none' ) {\n\t\t\t\t\tupdatedBorder.style = styleSelection;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonBorderChange( updatedBorder );\n\t\t},\n\t\t[ border, hadPreviousZeroWidth, onBorderChange ]\n\t);\n\n\tconst onSliderChange = useCallback(\n\t\t( value: string ) => {\n\t\t\tonWidthChange( `${ value }${ widthUnit }` );\n\t\t},\n\t\t[ onWidthChange, widthUnit ]\n\t);\n\n\t// Generate class names.\n\tconst cx = useCx();\n\tconst classes = useMemo( () => {\n\t\treturn cx( styles.borderControl, className );\n\t}, [ className, cx ] );\n\n\tconst innerWrapperClassName = useMemo( () => {\n\t\tconst wrapperWidth = isCompact ? '90px' : width;\n\t\tconst widthStyle =\n\t\t\t!! wrapperWidth && styles.wrapperWidth( wrapperWidth );\n\t\tconst heightStyle = styles.wrapperHeight( __next36pxDefaultSize );\n\n\t\treturn cx( styles.innerWrapper(), widthStyle, heightStyle );\n\t}, [ isCompact, width, cx, __next36pxDefaultSize ] );\n\n\tconst widthControlClassName = useMemo( () => {\n\t\treturn cx( styles.borderWidthControl() );\n\t}, [ cx ] );\n\n\tconst sliderClassName = useMemo( () => {\n\t\treturn cx( styles.borderSlider() );\n\t}, [ cx ] );\n\n\treturn {\n\t\t...otherProps,\n\t\tclassName: classes,\n\t\tinnerWrapperClassName,\n\t\tonBorderChange,\n\t\tonSliderChange,\n\t\tonWidthChange,\n\t\tpreviousStyleSelection: styleSelection,\n\t\tsliderClassName,\n\t\tvalue: border,\n\t\twidthControlClassName,\n\t\twidthUnit,\n\t\twidthValue,\n\t\t__next36pxDefaultSize,\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/border-control/border-control/hook.ts"],"names":["useCallback","useMemo","useState","styles","parseQuantityAndUnitFromRawValue","useContextSystem","useCx","sanitizeBorder","border","hasNoWidth","width","undefined","hasNoColor","color","useBorderControl","props","className","isCompact","onChange","shouldSanitizeBorder","value","__next36pxDefaultSize","otherProps","widthValue","originalWidthUnit","widthUnit","hadPreviousZeroWidth","colorSelection","setColorSelection","styleSelection","setStyleSelection","onBorderChange","newBorder","onWidthChange","newWidth","newWidthValue","parsedValue","hasZeroWidth","updatedBorder","style","onSliderChange","cx","classes","borderControl","innerWrapperClassName","wrapperWidth","widthStyle","heightStyle","wrapperHeight","innerWrapper","widthControlClassName","borderWidthControl","sliderClassName","borderSlider","previousStyleSelection"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,OAAtB,EAA+BC,QAA/B,QAA+C,oBAA/C;AAEA;AACA;AACA;;AACA,OAAO,KAAKC,MAAZ,MAAwB,WAAxB;AACA,SAASC,gCAAT,QAAiD,0BAAjD;AACA,SAASC,gBAAT,QAA0D,kBAA1D;AACA,SAASC,KAAT,QAAsB,0BAAtB;;AAIA,MAAMC,cAAc,GAAKC,MAAF,IAAuB;AAC7C,QAAMC,UAAU,GAAG,CAAAD,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEE,KAAR,MAAkBC,SAAlB,IAA+BH,MAAM,CAACE,KAAP,KAAiB,EAAnE;AACA,QAAME,UAAU,GAAG,CAAAJ,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEK,KAAR,MAAkBF,SAArC,CAF6C,CAI7C;;AACA,MAAKF,UAAU,IAAIG,UAAnB,EAAgC;AAC/B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B,CAAEA,SAAF,EAAayB,EAAb,CAFoB,CAAvB;AAIA,QAAMG,qBAAqB,GAAG3C,OAAO,CAAE,MAAM;AAC5C,UAAM4C,YAAY,GAAG5B,SAAS,GAAG,MAAH,GAAYP,KAA1C;AACA,UAAMoC,UAAU,GACf,CAAC,CAAED,YAAH,IAAmB1C,MAAM,CAAC0C,YAAP,CAAqBA,YAArB,CADpB;AAEA,UAAME,WAAW,GAAG5C,MAAM,CAAC6C,aAAP,CAAsB3B,qBAAtB,CAApB;AAEA,WAAOoB,EAAE,CAAEtC,MAAM,CAAC8C,YAAP,EAAF,EAAyBH,UAAzB,EAAqCC,WAArC,CAAT;AACA,GAPoC,EAOlC,CAAE9B,SAAF,EAAaP,KAAb,EAAoB+B,EAApB,EAAwBpB,qBAAxB,CAPkC,CAArC;AASA,QAAM6B,qBAAqB,GAAGjD,OAAO,CAAE,MAAM;AAC5C,WAAOwC,EAAE,CAAEtC,MAAM,CAACgD,kBAAP,EAAF,CAAT;AACA,GAFoC,EAElC,CAAEV,EAAF,CAFkC,CAArC;AAIA,QAAMW,eAAe,GAAGnD,OAAO,CAAE,MAAM;AACtC,WAAOwC,EAAE,CAAEtC,MAAM,CAACkD,YAAP,EAAF,CAAT;AACA,GAF8B,EAE5B,CAAEZ,EAAF,CAF4B,CAA/B;AAIA,SAAO,EACN,GAAGnB,UADG;AAENN,IAAAA,SAAS,EAAE0B,OAFL;AAGNE,IAAAA,qBAHM;AAINb,IAAAA,cAJM;AAKNS,IAAAA,cALM;AAMNP,IAAAA,aANM;AAONqB,IAAAA,sBAAsB,EAAEzB,cAPlB;AAQNuB,IAAAA,eARM;AASNhC,IAAAA,KAAK,EAAEZ,MATD;AAUN0C,IAAAA,qBAVM;AAWNzB,IAAAA,SAXM;AAYNF,IAAAA,UAZM;AAaNF,IAAAA;AAbM,GAAP;AAeA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport * as styles from '../styles';\nimport { parseQuantityAndUnitFromRawValue } from '../../unit-control/utils';\nimport { useContextSystem, WordPressComponentProps } from '../../ui/context';\nimport { useCx } from '../../utils/hooks/use-cx';\n\nimport type { Border, BorderControlProps } from '../types';\n\nconst sanitizeBorder = ( border?: Border ) => {\n\tconst hasNoWidth = border?.width === undefined || border.width === '';\n\tconst hasNoColor = border?.color === undefined;\n\n\t// If width and color are undefined, unset any style selection as well.\n\tif ( hasNoWidth && hasNoColor ) {\n\t\treturn undefined;\n\t}\n\n\treturn border;\n};\n\nexport function useBorderControl(\n\tprops: WordPressComponentProps< BorderControlProps, 'div' >\n) {\n\tconst {\n\t\tclassName,\n\t\tisCompact,\n\t\tonChange,\n\t\tshouldSanitizeBorder = true,\n\t\tvalue: border,\n\t\twidth,\n\t\t__next36pxDefaultSize = false,\n\t\t...otherProps\n\t} = useContextSystem( props, 'BorderControl' );\n\n\tconst [ widthValue, originalWidthUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tborder?.width\n\t);\n\tconst widthUnit = originalWidthUnit || 'px';\n\tconst hadPreviousZeroWidth = widthValue === 0;\n\n\tconst [ colorSelection, setColorSelection ] = useState< string >();\n\tconst [ styleSelection, setStyleSelection ] = useState< string >();\n\n\tconst onBorderChange = useCallback(\n\t\t( newBorder?: Border ) => {\n\t\t\tif ( shouldSanitizeBorder ) {\n\t\t\t\treturn onChange( sanitizeBorder( newBorder ) );\n\t\t\t}\n\n\t\t\tonChange( newBorder );\n\t\t},\n\t\t[ onChange, shouldSanitizeBorder ]\n\t);\n\n\tconst onWidthChange = useCallback(\n\t\t( newWidth?: string ) => {\n\t\t\tconst newWidthValue = newWidth === '' ? undefined : newWidth;\n\t\t\tconst [ parsedValue ] =\n\t\t\t\tparseQuantityAndUnitFromRawValue( newWidth );\n\t\t\tconst hasZeroWidth = parsedValue === 0;\n\n\t\t\tconst updatedBorder = { ...border, width: newWidthValue };\n\n\t\t\t// Setting the border width explicitly to zero will also set the\n\t\t\t// border style to `none` and clear the border color.\n\t\t\tif ( hasZeroWidth && ! hadPreviousZeroWidth ) {\n\t\t\t\t// Before clearing the color and style selections, keep track of\n\t\t\t\t// the current selections so they can be restored when the width\n\t\t\t\t// changes to a non-zero value.\n\t\t\t\tsetColorSelection( border?.color );\n\t\t\t\tsetStyleSelection( border?.style );\n\n\t\t\t\t// Clear the color and style border properties.\n\t\t\t\tupdatedBorder.color = undefined;\n\t\t\t\tupdatedBorder.style = 'none';\n\t\t\t}\n\n\t\t\t// Selection has changed from zero border width to non-zero width.\n\t\t\tif ( ! hasZeroWidth && hadPreviousZeroWidth ) {\n\t\t\t\t// Restore previous border color and style selections if width\n\t\t\t\t// is now not zero.\n\t\t\t\tif ( updatedBorder.color === undefined ) {\n\t\t\t\t\tupdatedBorder.color = colorSelection;\n\t\t\t\t}\n\t\t\t\tif ( updatedBorder.style === 'none' ) {\n\t\t\t\t\tupdatedBorder.style = styleSelection;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonBorderChange( updatedBorder );\n\t\t},\n\t\t[\n\t\t\tborder,\n\t\t\thadPreviousZeroWidth,\n\t\t\tcolorSelection,\n\t\t\tstyleSelection,\n\t\t\tonBorderChange,\n\t\t]\n\t);\n\n\tconst onSliderChange = useCallback(\n\t\t( value: string ) => {\n\t\t\tonWidthChange( `${ value }${ widthUnit }` );\n\t\t},\n\t\t[ onWidthChange, widthUnit ]\n\t);\n\n\t// Generate class names.\n\tconst cx = useCx();\n\tconst classes = useMemo( () => {\n\t\treturn cx( styles.borderControl, className );\n\t}, [ className, cx ] );\n\n\tconst innerWrapperClassName = useMemo( () => {\n\t\tconst wrapperWidth = isCompact ? '90px' : width;\n\t\tconst widthStyle =\n\t\t\t!! wrapperWidth && styles.wrapperWidth( wrapperWidth );\n\t\tconst heightStyle = styles.wrapperHeight( __next36pxDefaultSize );\n\n\t\treturn cx( styles.innerWrapper(), widthStyle, heightStyle );\n\t}, [ isCompact, width, cx, __next36pxDefaultSize ] );\n\n\tconst widthControlClassName = useMemo( () => {\n\t\treturn cx( styles.borderWidthControl() );\n\t}, [ cx ] );\n\n\tconst sliderClassName = useMemo( () => {\n\t\treturn cx( styles.borderSlider() );\n\t}, [ cx ] );\n\n\treturn {\n\t\t...otherProps,\n\t\tclassName: classes,\n\t\tinnerWrapperClassName,\n\t\tonBorderChange,\n\t\tonSliderChange,\n\t\tonWidthChange,\n\t\tpreviousStyleSelection: styleSelection,\n\t\tsliderClassName,\n\t\tvalue: border,\n\t\twidthControlClassName,\n\t\twidthUnit,\n\t\twidthValue,\n\t\t__next36pxDefaultSize,\n\t};\n}\n"]}
@@ -1,16 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { createElement } from "@wordpress/element";
3
3
 
4
- /**
5
- * External dependencies
6
- */
7
- import { noop } from 'lodash';
8
4
  /**
9
5
  * Internal dependencies
10
6
  */
11
-
12
7
  import UnitControl from './unit-control';
13
8
  import { ALL_SIDES, LABELS, getAllValue, isValuesMixed, isValuesDefined } from './utils';
9
+
10
+ const noop = () => {};
11
+
14
12
  export default function AllInputControl(_ref) {
15
13
  let {
16
14
  onChange = noop,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/box-control/all-input-control.js"],"names":["noop","UnitControl","ALL_SIDES","LABELS","getAllValue","isValuesMixed","isValuesDefined","AllInputControl","onChange","onFocus","onHoverOn","onHoverOff","values","sides","selectedUnits","setSelectedUnits","props","allValue","hasValues","isMixed","allPlaceholder","mixed","handleOnFocus","event","side","applyValueToSides","currentValues","newValue","newValues","length","forEach","top","bottom","left","right","handleOnChange","next","isNumeric","isNaN","parseFloat","nextValue","undefined","nextValues","handleOnUnitChange","unit","newUnits","handleOnHoverOn","handleOnHoverOff"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AACA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,SACCC,SADD,EAECC,MAFD,EAGCC,WAHD,EAICC,aAJ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AASA,SACC,cAAC,WAAD,eACMlB,KADN;AAEC,IAAA,YAAY,EAAGG,OAFhB;AAGC,IAAA,MAAM,MAHP;AAIC,IAAA,KAAK,EAAGF,QAJT;AAKC,IAAA,QAAQ,EAAGkB,cALZ;AAMC,IAAA,YAAY,EAAGQ,kBANhB;AAOC,IAAA,OAAO,EAAGrB,aAPX;AAQC,IAAA,SAAS,EAAGwB,eARb;AASC,IAAA,UAAU,EAAGC,gBATd;AAUC,IAAA,WAAW,EAAG3B;AAVf,KADD;AAcA","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\n/**\n * Internal dependencies\n */\nimport UnitControl from './unit-control';\nimport {\n\tALL_SIDES,\n\tLABELS,\n\tgetAllValue,\n\tisValuesMixed,\n\tisValuesDefined,\n} from './utils';\n\nexport default function AllInputControl( {\n\tonChange = noop,\n\tonFocus = noop,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tvalues,\n\tsides,\n\tselectedUnits,\n\tsetSelectedUnits,\n\t...props\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 : null;\n\n\tconst handleOnFocus = ( event ) => {\n\t\tonFocus( event, { side: 'all' } );\n\t};\n\n\t// Applies a value to an object representing top, right, bottom and left\n\t// sides while taking into account any custom side configuration.\n\tconst applyValueToSides = ( currentValues, newValue ) => {\n\t\tconst newValues = { ...currentValues };\n\n\t\tif ( sides?.length ) {\n\t\t\tsides.forEach( ( side ) => {\n\t\t\t\tif ( side === 'vertical' ) {\n\t\t\t\t\tnewValues.top = newValue;\n\t\t\t\t\tnewValues.bottom = newValue;\n\t\t\t\t} else if ( side === 'horizontal' ) {\n\t\t\t\t\tnewValues.left = newValue;\n\t\t\t\t\tnewValues.right = newValue;\n\t\t\t\t} else {\n\t\t\t\t\tnewValues[ side ] = newValue;\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tALL_SIDES.forEach( ( side ) => ( newValues[ side ] = newValue ) );\n\t\t}\n\n\t\treturn newValues;\n\t};\n\n\tconst handleOnChange = ( next ) => {\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\t\tconst nextValues = applyValueToSides( values, nextValue );\n\n\t\tonChange( nextValues );\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 = ( unit ) => {\n\t\tconst newUnits = applyValueToSides( selectedUnits, unit );\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\tconst handleOnHoverOn = () => {\n\t\tonHoverOn( {\n\t\t\ttop: true,\n\t\t\tbottom: true,\n\t\t\tleft: true,\n\t\t\tright: true,\n\t\t} );\n\t};\n\n\tconst handleOnHoverOff = () => {\n\t\tonHoverOff( {\n\t\t\ttop: false,\n\t\t\tbottom: false,\n\t\t\tleft: false,\n\t\t\tright: false,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<UnitControl\n\t\t\t{ ...props }\n\t\t\tdisableUnits={ isMixed }\n\t\t\tisOnly\n\t\t\tvalue={ allValue }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ handleOnUnitChange }\n\t\t\tonFocus={ handleOnFocus }\n\t\t\tonHoverOn={ handleOnHoverOn }\n\t\t\tonHoverOff={ handleOnHoverOff }\n\t\t\tplaceholder={ allPlaceholder }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/box-control/all-input-control.js"],"names":["UnitControl","ALL_SIDES","LABELS","getAllValue","isValuesMixed","isValuesDefined","noop","AllInputControl","onChange","onFocus","onHoverOn","onHoverOff","values","sides","selectedUnits","setSelectedUnits","props","allValue","hasValues","isMixed","allPlaceholder","mixed","handleOnFocus","event","side","applyValueToSides","currentValues","newValue","newValues","length","forEach","top","bottom","left","right","handleOnChange","next","isNumeric","isNaN","parseFloat","nextValue","undefined","nextValues","handleOnUnitChange","unit","newUnits","handleOnHoverOn","handleOnHoverOff"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,WAAP,MAAwB,gBAAxB;AACA,SACCC,SADD,EAECC,MAFD,EAGCC,WAHD,EAICC,aAJD,EAKCC,eALD,QAMO,SANP;;AAQA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,eAAe,SAASC,eAAT,OAUX;AAAA,MAVqC;AACxCC,IAAAA,QAAQ,GAAGF,IAD6B;AAExCG,IAAAA,OAAO,GAAGH,IAF8B;AAGxCI,IAAAA,SAAS,GAAGJ,IAH4B;AAIxCK,IAAAA,UAAU,GAAGL,IAJ2B;AAKxCM,IAAAA,MALwC;AAMxCC,IAAAA,KANwC;AAOxCC,IAAAA,aAPwC;AAQxCC,IAAAA,gBARwC;AASxC,OAAGC;AATqC,GAUrC;AACH,QAAMC,QAAQ,GAAGd,WAAW,CAAES,MAAF,EAAUE,aAAV,EAAyBD,KAAzB,CAA5B;AACA,QAAMK,SAAS,GAAGb,eAAe,CAAEO,MAAF,CAAjC;AACA,QAAMO,OAAO,GAAGD,SAAS,IAAId,aAAa,CAAEQ,MAAF,EAAUE,aAAV,EAAyBD,KAAzB,CAA1C;AACA,QAAMO,cAAc,GAAGD,OAAO,GAAGjB,MAAM,CAACmB,KAAV,GAAkB,IAAhD;;AAEA,QAAMC,aAAa,GAAKC,KAAF,IAAa;AAClCd,IAAAA,OAAO,CAAEc,KAAF,EAAS;AAAEC,MAAAA,IAAI,EAAE;AAAR,KAAT,CAAP;AACA,GAFD,CANG,CAUH;AACA;;;AACA,QAAMC,iBAAiB,GAAG,CAAEC,aAAF,EAAiBC,QAAjB,KAA+B;AACxD,UAAMC,SAAS,GAAG,EAAE,GAAGF;AAAL,KAAlB;;AAEA,QAAKb,KAAL,aAAKA,KAAL,eAAKA,KAAK,CAAEgB,MAAZ,EAAqB;AACpBhB,MAAAA,KAAK,CAACiB,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CAAT;AAMA,GAPD;;AASA,QAAMa,gBAAgB,GAAG,MAAM;AAC9BpC,IAAAA,UAAU,CAAE;AACXoB,MAAAA,GAAG,EAAE,KADM;AAEXC,MAAAA,MAAM,EAAE,KAFG;AAGXC,MAAAA,IAAI,EAAE,KAHK;AAIXC,MAAAA,KAAK,EAAE;AAJI,KAAF,CAAV;AAMA,GAPD;;AASA,SACC,cAAC,WAAD,eACMlB,KADN;AAEC,IAAA,YAAY,EAAGG,OAFhB;AAGC,IAAA,MAAM,MAHP;AAIC,IAAA,KAAK,EAAGF,QAJT;AAKC,IAAA,QAAQ,EAAGkB,cALZ;AAMC,IAAA,YAAY,EAAGQ,kBANhB;AAOC,IAAA,OAAO,EAAGrB,aAPX;AAQC,IAAA,SAAS,EAAGwB,eARb;AASC,IAAA,UAAU,EAAGC,gBATd;AAUC,IAAA,WAAW,EAAG3B;AAVf,KADD;AAcA","sourcesContent":["/**\n * Internal dependencies\n */\nimport UnitControl from './unit-control';\nimport {\n\tALL_SIDES,\n\tLABELS,\n\tgetAllValue,\n\tisValuesMixed,\n\tisValuesDefined,\n} from './utils';\n\nconst noop = () => {};\n\nexport default function AllInputControl( {\n\tonChange = noop,\n\tonFocus = noop,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tvalues,\n\tsides,\n\tselectedUnits,\n\tsetSelectedUnits,\n\t...props\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 : null;\n\n\tconst handleOnFocus = ( event ) => {\n\t\tonFocus( event, { side: 'all' } );\n\t};\n\n\t// Applies a value to an object representing top, right, bottom and left\n\t// sides while taking into account any custom side configuration.\n\tconst applyValueToSides = ( currentValues, newValue ) => {\n\t\tconst newValues = { ...currentValues };\n\n\t\tif ( sides?.length ) {\n\t\t\tsides.forEach( ( side ) => {\n\t\t\t\tif ( side === 'vertical' ) {\n\t\t\t\t\tnewValues.top = newValue;\n\t\t\t\t\tnewValues.bottom = newValue;\n\t\t\t\t} else if ( side === 'horizontal' ) {\n\t\t\t\t\tnewValues.left = newValue;\n\t\t\t\t\tnewValues.right = newValue;\n\t\t\t\t} else {\n\t\t\t\t\tnewValues[ side ] = newValue;\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tALL_SIDES.forEach( ( side ) => ( newValues[ side ] = newValue ) );\n\t\t}\n\n\t\treturn newValues;\n\t};\n\n\tconst handleOnChange = ( next ) => {\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\t\tconst nextValues = applyValueToSides( values, nextValue );\n\n\t\tonChange( nextValues );\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 = ( unit ) => {\n\t\tconst newUnits = applyValueToSides( selectedUnits, unit );\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\tconst handleOnHoverOn = () => {\n\t\tonHoverOn( {\n\t\t\ttop: true,\n\t\t\tbottom: true,\n\t\t\tleft: true,\n\t\t\tright: true,\n\t\t} );\n\t};\n\n\tconst handleOnHoverOff = () => {\n\t\tonHoverOff( {\n\t\t\ttop: false,\n\t\t\tbottom: false,\n\t\t\tleft: false,\n\t\t\tright: false,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<UnitControl\n\t\t\t{ ...props }\n\t\t\tdisableUnits={ isMixed }\n\t\t\tisOnly\n\t\t\tvalue={ allValue }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ handleOnUnitChange }\n\t\t\tonFocus={ handleOnFocus }\n\t\t\tonHoverOn={ handleOnHoverOn }\n\t\t\tonHoverOff={ handleOnHoverOff }\n\t\t\tplaceholder={ allPlaceholder }\n\t\t/>\n\t);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/box-control/axial-input-controls.js"],"names":["parseQuantityAndUnitFromRawValue","UnitControl","LABELS","Layout","groupedSides","AxialInputControls","onChange","onFocus","onHoverOn","onHoverOff","values","selectedUnits","setSelectedUnits","sides","props","createHandleOnFocus","side","event","createHandleOnHoverOn","top","bottom","left","right","createHandleOnHoverOff","createHandleOnChange","next","nextValues","isNumeric","isNaN","parseFloat","nextValue","undefined","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","first","last","only","map","parsedQuantity","parsedUnit","selectedUnit","join"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,gCAAT,QAAiD,uBAAjD;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,SAASC,MAAT,QAAuB,SAAvB;AACA,SAASC,MAAT,QAAuB,6BAAvB;AAEA,MAAMC,YAAY,GAAG,CAAE,UAAF,EAAc,YAAd,CAArB;AAEA,eAAe,SAASC,kBAAT,OAUX;AAAA,MAVwC;AAC3CC,IAAAA,QAD2C;AAE3CC,IAAAA,OAF2C;AAG3CC,IAAAA,SAH2C;AAI3CC,IAAAA,UAJ2C;AAK3CC,IAAAA,MAL2C;AAM3CC,IAAAA,aAN2C;AAO3CC,IAAAA,gBAP2C;AAQ3CC,IAAAA,KAR2C;AAS3C,OAAGC;AATwC,GAUxC;;AACH,QAAMC,mBAAmB,GAAKC,IAAF,IAAcC,KAAF,IAAa;AACpD,QAAK,CAAEV,OAAP,EAAiB;AAChB;AACA;;AACDA,IAAAA,OAAO,CAAEU,KAAF,EAAS;AAAED,MAAAA;AAAF,KAAT,CAAP;AACA,GALD;;AAOA,QAAME,qBAAqB,GAAKF,IAAF,IAAY,MAAM;AAC/C,QAAK,CAAER,SAAP,EAAmB;AAClB;AACA;;AACD,QAAKQ,IAAI,KAAK,UAAd,EAA2B;AAC1BR,MAAAA,SAAS,CAAE;AACVW,QAAAA,GAAG,EAAE,IADK;AAEVC,QAAAA,MAAM,EAAE;AAFE,OAAF,CAAT;AAIA;;AACD,QAAKJ,IAAI,KAAK,YAAd,EAA6B;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AAK,KAAKtB,IAFrB;AAGC,MAAA,MAAM,EAAGuB,IAAI,KAAKvB,IAHnB;AAIC,MAAA,MAAM,EAAGwB,IAAI,KAAKxB,IAJnB;AAKC,MAAA,KAAK,EAAG,CACP0B,cADO,EAEPE,YAFO,aAEPA,YAFO,cAEPA,YAFO,GAESD,UAFT,EAGNE,IAHM,CAGA,EAHA,CALT;AASC,MAAA,QAAQ,EAAGrB,oBAAoB,CAAER,IAAF,CAThC;AAUC,MAAA,YAAY,EAAGgB,wBAAwB,CAAEhB,IAAF,CAVxC;AAWC,MAAA,OAAO,EAAGD,mBAAmB,CAAEC,IAAF,CAX9B;AAYC,MAAA,SAAS,EAAGE,qBAAqB,CAAEF,IAAF,CAZlC;AAaC,MAAA,UAAU,EAAGO,sBAAsB,CAAEP,IAAF,CAbpC;AAcC,MAAA,KAAK,EAAGd,MAAM,CAAEc,IAAF,CAdf;AAeC,MAAA,GAAG,EAAGA;AAfP,OADD;AAmBA,GA9BC,CALH,CADD;AAuCA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport UnitControl from './unit-control';\nimport { LABELS } from './utils';\nimport { Layout } from './styles/box-control-styles';\n\nconst groupedSides = [ 'vertical', 'horizontal' ];\n\nexport default function AxialInputControls( {\n\tonChange,\n\tonFocus,\n\tonHoverOn,\n\tonHoverOff,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n} ) {\n\tconst createHandleOnFocus = ( side ) => ( event ) => {\n\t\tif ( ! onFocus ) {\n\t\t\treturn;\n\t\t}\n\t\tonFocus( event, { side } );\n\t};\n\n\tconst createHandleOnHoverOn = ( side ) => () => {\n\t\tif ( ! onHoverOn ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( side === 'vertical' ) {\n\t\t\tonHoverOn( {\n\t\t\t\ttop: true,\n\t\t\t\tbottom: true,\n\t\t\t} );\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tonHoverOn( {\n\t\t\t\tleft: true,\n\t\t\t\tright: true,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst createHandleOnHoverOff = ( side ) => () => {\n\t\tif ( ! onHoverOff ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( side === 'vertical' ) {\n\t\t\tonHoverOff( {\n\t\t\t\ttop: false,\n\t\t\t\tbottom: false,\n\t\t\t} );\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tonHoverOff( {\n\t\t\t\tleft: false,\n\t\t\t\tright: false,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst createHandleOnChange = ( side ) => ( next ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnextValues.top = nextValue;\n\t\t\tnextValues.bottom = nextValue;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnextValues.left = nextValue;\n\t\t\tnextValues.right = nextValue;\n\t\t}\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange = ( side ) => ( next ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnewUnits.top = next;\n\t\t\tnewUnits.bottom = next;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnewUnits.left = next;\n\t\t\tnewUnits.right = next;\n\t\t}\n\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? groupedSides.filter( ( side ) => sides.includes( side ) )\n\t\t: groupedSides;\n\n\tconst first = filteredSides[ 0 ];\n\tconst last = filteredSides[ filteredSides.length - 1 ];\n\tconst only = first === last;\n\n\treturn (\n\t\t<Layout\n\t\t\tgap={ 0 }\n\t\t\talign=\"top\"\n\t\t\tclassName=\"component-box-control__vertical-horizontal-input-controls\"\n\t\t>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [\n\t\t\t\t\tparsedQuantity,\n\t\t\t\t\tparsedUnit,\n\t\t\t\t] = parseQuantityAndUnitFromRawValue(\n\t\t\t\t\tside === 'vertical' ? values.top : values.left\n\t\t\t\t);\n\t\t\t\tconst selectedUnit =\n\t\t\t\t\tside === 'vertical'\n\t\t\t\t\t\t? selectedUnits.top\n\t\t\t\t\t\t: selectedUnits.left;\n\t\t\t\treturn (\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\tisFirst={ first === side }\n\t\t\t\t\t\tisLast={ last === side }\n\t\t\t\t\t\tisOnly={ only === side }\n\t\t\t\t\t\tvalue={ [\n\t\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t].join( '' ) }\n\t\t\t\t\t\tonChange={ createHandleOnChange( side ) }\n\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange( side ) }\n\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\tonHoverOn={ createHandleOnHoverOn( side ) }\n\t\t\t\t\t\tonHoverOff={ createHandleOnHoverOff( side ) }\n\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\tkey={ side }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Layout>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/box-control/axial-input-controls.js"],"names":["parseQuantityAndUnitFromRawValue","UnitControl","LABELS","Layout","groupedSides","AxialInputControls","onChange","onFocus","onHoverOn","onHoverOff","values","selectedUnits","setSelectedUnits","sides","props","createHandleOnFocus","side","event","createHandleOnHoverOn","top","bottom","left","right","createHandleOnHoverOff","createHandleOnChange","next","nextValues","isNumeric","isNaN","parseFloat","nextValue","undefined","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","first","last","only","map","parsedQuantity","parsedUnit","selectedUnit","join"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,gCAAT,QAAiD,uBAAjD;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,SAASC,MAAT,QAAuB,SAAvB;AACA,SAASC,MAAT,QAAuB,6BAAvB;AAEA,MAAMC,YAAY,GAAG,CAAE,UAAF,EAAc,YAAd,CAArB;AAEA,eAAe,SAASC,kBAAT,OAUX;AAAA,MAVwC;AAC3CC,IAAAA,QAD2C;AAE3CC,IAAAA,OAF2C;AAG3CC,IAAAA,SAH2C;AAI3CC,IAAAA,UAJ2C;AAK3CC,IAAAA,MAL2C;AAM3CC,IAAAA,aAN2C;AAO3CC,IAAAA,gBAP2C;AAQ3CC,IAAAA,KAR2C;AAS3C,OAAGC;AATwC,GAUxC;;AACH,QAAMC,mBAAmB,GAAKC,IAAF,IAAcC,KAAF,IAAa;AACpD,QAAK,CAAEV,OAAP,EAAiB;AAChB;AACA;;AACDA,IAAAA,OAAO,CAAEU,KAAF,EAAS;AAAED,MAAAA;AAAF,KAAT,CAAP;AACA,GALD;;AAOA,QAAME,qBAAqB,GAAKF,IAAF,IAAY,MAAM;AAC/C,QAAK,CAAER,SAAP,EAAmB;AAClB;AACA;;AACD,QAAKQ,IAAI,KAAK,UAAd,EAA2B;AAC1BR,MAAAA,SAAS,CAAE;AACVW,QAAAA,GAAG,EAAE,IADK;AAEVC,QAAAA,MAAM,EAAE;AAFE,OAAF,CAAT;AAIA;;AACD,QAAKJ,IAAI,KAAK,YAAd,EAA6B;AAC5BR,MAAAA,SAAS,CAAE;AACVa,QAAAA,IAAI,EAAE,IADI;AAEVC,QAAAA,KAAK,EAAE;AAFG,OAAF,CAAT;AAIA;AACD,GAhBD;;AAkBA,QAAMC,sBAAsB,GAAKP,IAAF,IAAY,MAAM;AAChD,QAAK,CAAEP,UAAP,EAAoB;AACnB;AACA;;AACD,QAAKO,IAAI,KAAK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T;AASC,MAAA,QAAQ,EAAGrB,oBAAoB,CAAER,IAAF,CAThC;AAUC,MAAA,YAAY,EAAGgB,wBAAwB,CAAEhB,IAAF,CAVxC;AAWC,MAAA,OAAO,EAAGD,mBAAmB,CAAEC,IAAF,CAX9B;AAYC,MAAA,SAAS,EAAGE,qBAAqB,CAAEF,IAAF,CAZlC;AAaC,MAAA,UAAU,EAAGO,sBAAsB,CAAEP,IAAF,CAbpC;AAcC,MAAA,KAAK,EAAGd,MAAM,CAAEc,IAAF,CAdf;AAeC,MAAA,GAAG,EAAGA;AAfP,OADD;AAmBA,GA5BC,CALH,CADD;AAqCA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport UnitControl from './unit-control';\nimport { LABELS } from './utils';\nimport { Layout } from './styles/box-control-styles';\n\nconst groupedSides = [ 'vertical', 'horizontal' ];\n\nexport default function AxialInputControls( {\n\tonChange,\n\tonFocus,\n\tonHoverOn,\n\tonHoverOff,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n} ) {\n\tconst createHandleOnFocus = ( side ) => ( event ) => {\n\t\tif ( ! onFocus ) {\n\t\t\treturn;\n\t\t}\n\t\tonFocus( event, { side } );\n\t};\n\n\tconst createHandleOnHoverOn = ( side ) => () => {\n\t\tif ( ! onHoverOn ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( side === 'vertical' ) {\n\t\t\tonHoverOn( {\n\t\t\t\ttop: true,\n\t\t\t\tbottom: true,\n\t\t\t} );\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tonHoverOn( {\n\t\t\t\tleft: true,\n\t\t\t\tright: true,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst createHandleOnHoverOff = ( side ) => () => {\n\t\tif ( ! onHoverOff ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( side === 'vertical' ) {\n\t\t\tonHoverOff( {\n\t\t\t\ttop: false,\n\t\t\t\tbottom: false,\n\t\t\t} );\n\t\t}\n\t\tif ( side === 'horizontal' ) {\n\t\t\tonHoverOff( {\n\t\t\t\tleft: false,\n\t\t\t\tright: false,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst createHandleOnChange = ( side ) => ( next ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnextValues.top = nextValue;\n\t\t\tnextValues.bottom = nextValue;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnextValues.left = nextValue;\n\t\t\tnextValues.right = nextValue;\n\t\t}\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange = ( side ) => ( next ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnewUnits.top = next;\n\t\t\tnewUnits.bottom = next;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnewUnits.left = next;\n\t\t\tnewUnits.right = next;\n\t\t}\n\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? groupedSides.filter( ( side ) => sides.includes( side ) )\n\t\t: groupedSides;\n\n\tconst first = filteredSides[ 0 ];\n\tconst last = filteredSides[ filteredSides.length - 1 ];\n\tconst only = first === last;\n\n\treturn (\n\t\t<Layout\n\t\t\tgap={ 0 }\n\t\t\talign=\"top\"\n\t\t\tclassName=\"component-box-control__vertical-horizontal-input-controls\"\n\t\t>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue(\n\t\t\t\t\t\tside === 'vertical' ? values.top : values.left\n\t\t\t\t\t);\n\t\t\t\tconst selectedUnit =\n\t\t\t\t\tside === 'vertical'\n\t\t\t\t\t\t? selectedUnits.top\n\t\t\t\t\t\t: selectedUnits.left;\n\t\t\t\treturn (\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\tisFirst={ first === side }\n\t\t\t\t\t\tisLast={ last === side }\n\t\t\t\t\t\tisOnly={ only === side }\n\t\t\t\t\t\tvalue={ [\n\t\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t].join( '' ) }\n\t\t\t\t\t\tonChange={ createHandleOnChange( side ) }\n\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange( side ) }\n\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\tonHoverOn={ createHandleOnHoverOn( side ) }\n\t\t\t\t\t\tonHoverOff={ createHandleOnHoverOff( side ) }\n\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\tkey={ side }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Layout>\n\t);\n}\n"]}
@@ -1,14 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { createElement } from "@wordpress/element";
3
3
 
4
- /**
5
- * External dependencies
6
- */
7
- import { noop } from 'lodash';
8
4
  /**
9
5
  * WordPress dependencies
10
6
  */
11
-
12
7
  import { useInstanceId } from '@wordpress/compose';
13
8
  import { useState } from '@wordpress/element';
14
9
  import { __ } from '@wordpress/i18n';
@@ -32,6 +27,8 @@ const defaultInputProps = {
32
27
  min: 0
33
28
  };
34
29
 
30
+ const noop = () => {};
31
+
35
32
  function useUniqueId(idProp) {
36
33
  const instanceId = useInstanceId(BoxControl, 'inspector-box-control');
37
34
  return idProp || instanceId;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/box-control/index.js"],"names":["noop","useInstanceId","useState","__","Button","FlexItem","FlexBlock","AllInputControl","InputControls","AxialInputControls","BoxControlIcon","Text","LinkedButton","Root","Header","HeaderControlWrapper","parseQuantityAndUnitFromRawValue","DEFAULT_VALUES","getInitialSide","isValuesMixed","isValuesDefined","useControlledState","defaultInputProps","min","useUniqueId","idProp","instanceId","BoxControl","id","inputProps","onChange","label","values","valuesProp","units","sides","splitOnAxis","allowReset","resetValues","setValues","fallback","inputValues","hasInitialValue","hasOneSide","length","isDirty","setIsDirty","isLinked","setIsLinked","side","setSide","selectedUnits","setSelectedUnits","top","right","bottom","left","headingId","toggleLinked","handleOnFocus","event","nextSide","handleOnChange","nextValues","handleOnReset","inputControlProps","onFocus"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,SAApC;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,cAAP,MAA2B,QAA3B;AACA,SAASC,IAAT,QAAqB,SAArB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,SACCC,IADD,EAECC,MAFD,EAGCC,oBAHD,QAIO,6BAJP;AAKA,SAASC,gCAAT,QAAiD,uBAAjD;AACA,SACCC,cADD,EAECC,cAFD,EAGCC,aAHD,EAICC,eAJD,QAKO,SALP;AAMA,SAASC,kBAAT,QAAmC,gBAAnC;AAEA,MAAMC,iBAAiB,GAAG;AACzBC,EAAAA,GAAG,EAAE;AADoB,CAA1B;;AAIA,SAASC,WAAT,CAAsBC,MAAtB,EAA+B;AAC9B,QAAMC,UAAU,GAAGzB,aAAa,CAAE0B,UAAF,EAAc,uBAAd,CAAhC;AAEA,SAAOF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AAA,OAAO,EAAGe,YADX;AAEC,IAAA,QAAQ,EAAGX;AAFZ,IADD,CAlBF,CAxBD,EAkDG,CAAEA,QAAF,IAAc,CAAEX,WAAhB,IACD,cAAC,aAAD,EAAoB6B,iBAApB,CAnDF,CADD;AAwDA","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { FlexItem, FlexBlock } from '../flex';\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport AxialInputControls from './axial-input-controls';\nimport BoxControlIcon from './icon';\nimport { Text } from '../text';\nimport LinkedButton from './linked-button';\nimport {\n\tRoot,\n\tHeader,\n\tHeaderControlWrapper,\n} from './styles/box-control-styles';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport {\n\tDEFAULT_VALUES,\n\tgetInitialSide,\n\tisValuesMixed,\n\tisValuesDefined,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\n\nconst defaultInputProps = {\n\tmin: 0,\n};\n\nfunction useUniqueId( idProp ) {\n\tconst instanceId = useInstanceId( BoxControl, 'inspector-box-control' );\n\n\treturn idProp || instanceId;\n}\nexport default function BoxControl( {\n\tid: idProp,\n\tinputProps = defaultInputProps,\n\tonChange = noop,\n\tlabel = __( 'Box Control' ),\n\tvalues: valuesProp,\n\tunits,\n\tsides,\n\tsplitOnAxis = false,\n\tallowReset = true,\n\tresetValues = DEFAULT_VALUES,\n} ) {\n\tconst [ values, setValues ] = useControlledState( valuesProp, {\n\t\tfallback: DEFAULT_VALUES,\n\t} );\n\tconst inputValues = values || DEFAULT_VALUES;\n\tconst hasInitialValue = isValuesDefined( valuesProp );\n\tconst hasOneSide = sides?.length === 1;\n\n\tconst [ isDirty, setIsDirty ] = useState( hasInitialValue );\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasInitialValue || ! isValuesMixed( inputValues ) || hasOneSide\n\t);\n\n\tconst [ side, setSide ] = useState(\n\t\tgetInitialSide( isLinked, splitOnAxis )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState( {\n\t\ttop: parseQuantityAndUnitFromRawValue( valuesProp?.top )[ 1 ],\n\t\tright: parseQuantityAndUnitFromRawValue( valuesProp?.right )[ 1 ],\n\t\tbottom: parseQuantityAndUnitFromRawValue( valuesProp?.bottom )[ 1 ],\n\t\tleft: parseQuantityAndUnitFromRawValue( valuesProp?.left )[ 1 ],\n\t} );\n\n\tconst id = useUniqueId( idProp );\n\tconst headingId = `${ id }-heading`;\n\n\tconst toggleLinked = () => {\n\t\tsetIsLinked( ! isLinked );\n\t\tsetSide( getInitialSide( ! isLinked, splitOnAxis ) );\n\t};\n\n\tconst handleOnFocus = ( event, { side: nextSide } ) => {\n\t\tsetSide( nextSide );\n\t};\n\n\tconst handleOnChange = ( nextValues ) => {\n\t\tonChange( nextValues );\n\t\tsetValues( nextValues );\n\t\tsetIsDirty( true );\n\t};\n\n\tconst handleOnReset = () => {\n\t\tonChange( resetValues );\n\t\tsetValues( resetValues );\n\t\tsetSelectedUnits( resetValues );\n\t\tsetIsDirty( false );\n\t};\n\n\tconst inputControlProps = {\n\t\t...inputProps,\n\t\tonChange: handleOnChange,\n\t\tonFocus: handleOnFocus,\n\t\tisLinked,\n\t\tunits,\n\t\tselectedUnits,\n\t\tsetSelectedUnits,\n\t\tsides,\n\t\tvalues: inputValues,\n\t};\n\n\treturn (\n\t\t<Root id={ id } role=\"region\" aria-labelledby={ headingId }>\n\t\t\t<Header className=\"component-box-control__header\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tid={ headingId }\n\t\t\t\t\t\tclassName=\"component-box-control__label\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Text>\n\t\t\t\t</FlexItem>\n\t\t\t\t{ allowReset && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"component-box-control__reset-button\"\n\t\t\t\t\t\t\tisSecondary\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</Header>\n\t\t\t<HeaderControlWrapper className=\"component-box-control__header-control-wrapper\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<BoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t</FlexItem>\n\t\t\t\t{ isLinked && (\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<AllInputControl\n\t\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\t\t{ ...inputControlProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t) }\n\t\t\t\t{ ! isLinked && splitOnAxis && (\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<AxialInputControls { ...inputControlProps } />\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t) }\n\t\t\t\t{ ! hasOneSide && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<LinkedButton\n\t\t\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</HeaderControlWrapper>\n\t\t\t{ ! isLinked && ! splitOnAxis && (\n\t\t\t\t<InputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t</Root>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/box-control/index.js"],"names":["useInstanceId","useState","__","Button","FlexItem","FlexBlock","AllInputControl","InputControls","AxialInputControls","BoxControlIcon","Text","LinkedButton","Root","Header","HeaderControlWrapper","parseQuantityAndUnitFromRawValue","DEFAULT_VALUES","getInitialSide","isValuesMixed","isValuesDefined","useControlledState","defaultInputProps","min","noop","useUniqueId","idProp","instanceId","BoxControl","id","inputProps","onChange","label","values","valuesProp","units","sides","splitOnAxis","allowReset","resetValues","setValues","fallback","inputValues","hasInitialValue","hasOneSide","length","isDirty","setIsDirty","isLinked","setIsLinked","side","setSide","selectedUnits","setSelectedUnits","top","right","bottom","left","headingId","toggleLinked","handleOnFocus","event","nextSide","handleOnChange","nextValues","handleOnReset","inputControlProps","onFocus"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,oBAA9B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,SAApC;AACA,OAAOC,eAAP,MAA4B,qBAA5B;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,kBAAP,MAA+B,wBAA/B;AACA,OAAOC,cAAP,MAA2B,QAA3B;AACA,SAASC,IAAT,QAAqB,SAArB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,SACCC,IADD,EAECC,MAFD,EAGCC,oBAHD,QAIO,6BAJP;AAKA,SAASC,gCAAT,QAAiD,uBAAjD;AACA,SACCC,cADD,EAECC,cAFD,EAGCC,aAHD,EAICC,eAJD,QAKO,SALP;AAMA,SAASC,kBAAT,QAAmC,gBAAnC;AAEA,MAAMC,iBAAiB,GAAG;AACzBC,EAAAA,GAAG,EAAE;AADoB,CAA1B;;AAIA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,SAASC,WAAT,CAAsBC,MAAtB,EAA+B;AAC9B,Q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,CADD,CAbF,EAiBG,CAAEtB,UAAF,IACD,cAAC,QAAD,QACC,cAAC,YAAD;AACC,IAAA,OAAO,EAAGe,YADX;AAEC,IAAA,QAAQ,EAAGX;AAFZ,IADD,CAlBF,CAxBD,EAkDG,CAAEA,QAAF,IAAc,CAAEX,WAAhB,IACD,cAAC,aAAD,EAAoB6B,iBAApB,CAnDF,CADD;AAwDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { FlexItem, FlexBlock } from '../flex';\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport AxialInputControls from './axial-input-controls';\nimport BoxControlIcon from './icon';\nimport { Text } from '../text';\nimport LinkedButton from './linked-button';\nimport {\n\tRoot,\n\tHeader,\n\tHeaderControlWrapper,\n} from './styles/box-control-styles';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport {\n\tDEFAULT_VALUES,\n\tgetInitialSide,\n\tisValuesMixed,\n\tisValuesDefined,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\n\nconst defaultInputProps = {\n\tmin: 0,\n};\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp ) {\n\tconst instanceId = useInstanceId( BoxControl, 'inspector-box-control' );\n\n\treturn idProp || instanceId;\n}\nexport default function BoxControl( {\n\tid: idProp,\n\tinputProps = defaultInputProps,\n\tonChange = noop,\n\tlabel = __( 'Box Control' ),\n\tvalues: valuesProp,\n\tunits,\n\tsides,\n\tsplitOnAxis = false,\n\tallowReset = true,\n\tresetValues = DEFAULT_VALUES,\n} ) {\n\tconst [ values, setValues ] = useControlledState( valuesProp, {\n\t\tfallback: DEFAULT_VALUES,\n\t} );\n\tconst inputValues = values || DEFAULT_VALUES;\n\tconst hasInitialValue = isValuesDefined( valuesProp );\n\tconst hasOneSide = sides?.length === 1;\n\n\tconst [ isDirty, setIsDirty ] = useState( hasInitialValue );\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasInitialValue || ! isValuesMixed( inputValues ) || hasOneSide\n\t);\n\n\tconst [ side, setSide ] = useState(\n\t\tgetInitialSide( isLinked, splitOnAxis )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState( {\n\t\ttop: parseQuantityAndUnitFromRawValue( valuesProp?.top )[ 1 ],\n\t\tright: parseQuantityAndUnitFromRawValue( valuesProp?.right )[ 1 ],\n\t\tbottom: parseQuantityAndUnitFromRawValue( valuesProp?.bottom )[ 1 ],\n\t\tleft: parseQuantityAndUnitFromRawValue( valuesProp?.left )[ 1 ],\n\t} );\n\n\tconst id = useUniqueId( idProp );\n\tconst headingId = `${ id }-heading`;\n\n\tconst toggleLinked = () => {\n\t\tsetIsLinked( ! isLinked );\n\t\tsetSide( getInitialSide( ! isLinked, splitOnAxis ) );\n\t};\n\n\tconst handleOnFocus = ( event, { side: nextSide } ) => {\n\t\tsetSide( nextSide );\n\t};\n\n\tconst handleOnChange = ( nextValues ) => {\n\t\tonChange( nextValues );\n\t\tsetValues( nextValues );\n\t\tsetIsDirty( true );\n\t};\n\n\tconst handleOnReset = () => {\n\t\tonChange( resetValues );\n\t\tsetValues( resetValues );\n\t\tsetSelectedUnits( resetValues );\n\t\tsetIsDirty( false );\n\t};\n\n\tconst inputControlProps = {\n\t\t...inputProps,\n\t\tonChange: handleOnChange,\n\t\tonFocus: handleOnFocus,\n\t\tisLinked,\n\t\tunits,\n\t\tselectedUnits,\n\t\tsetSelectedUnits,\n\t\tsides,\n\t\tvalues: inputValues,\n\t};\n\n\treturn (\n\t\t<Root id={ id } role=\"region\" aria-labelledby={ headingId }>\n\t\t\t<Header className=\"component-box-control__header\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tid={ headingId }\n\t\t\t\t\t\tclassName=\"component-box-control__label\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Text>\n\t\t\t\t</FlexItem>\n\t\t\t\t{ allowReset && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"component-box-control__reset-button\"\n\t\t\t\t\t\t\tisSecondary\n\t\t\t\t\t\t\tisSmall\n\t\t\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</Header>\n\t\t\t<HeaderControlWrapper className=\"component-box-control__header-control-wrapper\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<BoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t</FlexItem>\n\t\t\t\t{ isLinked && (\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<AllInputControl\n\t\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\t\t{ ...inputControlProps }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t) }\n\t\t\t\t{ ! isLinked && splitOnAxis && (\n\t\t\t\t\t<FlexBlock>\n\t\t\t\t\t\t<AxialInputControls { ...inputControlProps } />\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t) }\n\t\t\t\t{ ! hasOneSide && (\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<LinkedButton\n\t\t\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t) }\n\t\t\t</HeaderControlWrapper>\n\t\t\t{ ! isLinked && ! splitOnAxis && (\n\t\t\t\t<InputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t</Root>\n\t);\n}\n"]}
@@ -1,18 +1,16 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { createElement } from "@wordpress/element";
3
3
 
4
- /**
5
- * External dependencies
6
- */
7
- import { noop } from 'lodash';
8
4
  /**
9
5
  * Internal dependencies
10
6
  */
11
-
12
7
  import UnitControl from './unit-control';
13
8
  import { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';
14
9
  import { ALL_SIDES, LABELS } from './utils';
15
10
  import { LayoutContainer, Layout } from './styles/box-control-styles';
11
+
12
+ const noop = () => {};
13
+
16
14
  export default function BoxInputControls(_ref) {
17
15
  let {
18
16
  onChange = noop,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/box-control/input-controls.js"],"names":["noop","UnitControl","parseQuantityAndUnitFromRawValue","ALL_SIDES","LABELS","LayoutContainer","Layout","BoxInputControls","onChange","onFocus","onHoverOn","onHoverOff","values","selectedUnits","setSelectedUnits","sides","props","createHandleOnFocus","side","event","createHandleOnHoverOn","createHandleOnHoverOff","handleOnChange","nextValues","createHandleOnChange","next","altKey","isNumeric","isNaN","parseFloat","nextValue","undefined","bottom","top","right","left","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","first","last","only","map","parsedQuantity","parsedUnit","computedUnit","join"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,SAASC,gCAAT,QAAiD,uBAAjD;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,SAAlC;AACA,SAASC,eAAT,EAA0BC,MAA1B,QAAwC,6BAAxC;AAEA,eAAe,SAASC,gBAAT,OAUX;AAAA,MAVsC;AACzCC,IAAAA,QAAQ,GAAGR,IAD8B;AAEzCS,IAAAA,OAAO,GAAGT,IAF+B;AAGzCU,IAAAA,SAAS,GAAGV,IAH6B;AAIzCW,IAAAA,UAAU,GAAGX,IAJ4B;AA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MF,KADN;AAEC,MAAA,OAAO,EAAG0B,KAAK,KAAKxB,IAFrB;AAGC,MAAA,MAAM,EAAGyB,IAAI,KAAKzB,IAHnB;AAIC,MAAA,MAAM,EAAG0B,IAAI,KAAK1B,IAJnB;AAKC,MAAA,KAAK,EAAG,CAAE4B,cAAF,EAAkBE,YAAlB,EAAiCC,IAAjC,CACP,EADO,CALT;AAQC,MAAA,QAAQ,EAAGzB,oBAAoB,CAAEN,IAAF,CARhC;AASC,MAAA,YAAY,EAAGkB,wBAAwB,CAAElB,IAAF,CATxC;AAUC,MAAA,OAAO,EAAGD,mBAAmB,CAAEC,IAAF,CAV9B;AAWC,MAAA,SAAS,EAAGE,qBAAqB,CAAEF,IAAF,CAXlC;AAYC,MAAA,UAAU,EAAGG,sBAAsB,CAAEH,IAAF,CAZpC;AAaC,MAAA,KAAK,EAAGd,MAAM,CAAEc,IAAF,CAbf;AAcC,MAAA,GAAG,EAAI,eAAeA,IAAM;AAd7B,OADD;AAkBA,GA5BC,CALH,CADD,CADD;AAuCA","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport UnitControl from './unit-control';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { ALL_SIDES, LABELS } from './utils';\nimport { LayoutContainer, Layout } from './styles/box-control-styles';\n\nexport default function BoxInputControls( {\n\tonChange = noop,\n\tonFocus = noop,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n} ) {\n\tconst createHandleOnFocus = ( side ) => ( event ) => {\n\t\tonFocus( event, { side } );\n\t};\n\n\tconst createHandleOnHoverOn = ( side ) => () => {\n\t\tonHoverOn( { [ side ]: true } );\n\t};\n\n\tconst createHandleOnHoverOff = ( side ) => () => {\n\t\tonHoverOff( { [ side ]: false } );\n\t};\n\n\tconst handleOnChange = ( nextValues ) => {\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnChange = ( side ) => ( next, { event } ) => {\n\t\tconst { altKey } = event;\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tnextValues[ side ] = nextValue;\n\n\t\t/**\n\t\t * Supports changing pair sides. For example, holding the ALT key\n\t\t * when changing the TOP will also update BOTTOM.\n\t\t */\n\t\tif ( altKey ) {\n\t\t\tswitch ( side ) {\n\t\t\t\tcase 'top':\n\t\t\t\t\tnextValues.bottom = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bottom':\n\t\t\t\t\tnextValues.top = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'left':\n\t\t\t\t\tnextValues.right = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'right':\n\t\t\t\t\tnextValues.left = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\thandleOnChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange = ( side ) => ( next ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\t\tnewUnits[ side ] = next;\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? ALL_SIDES.filter( ( side ) => sides.includes( side ) )\n\t\t: ALL_SIDES;\n\n\tconst first = filteredSides[ 0 ];\n\tconst last = filteredSides[ filteredSides.length - 1 ];\n\tconst only = first === last && first;\n\n\treturn (\n\t\t<LayoutContainer className=\"component-box-control__input-controls-wrapper\">\n\t\t\t<Layout\n\t\t\t\tgap={ 0 }\n\t\t\t\talign=\"top\"\n\t\t\t\tclassName=\"component-box-control__input-controls\"\n\t\t\t>\n\t\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\t\tconst [\n\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\tparsedUnit,\n\t\t\t\t\t] = parseQuantityAndUnitFromRawValue( values[ side ] );\n\n\t\t\t\t\tconst computedUnit = values[ side ]\n\t\t\t\t\t\t? parsedUnit\n\t\t\t\t\t\t: selectedUnits[ side ];\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\tisFirst={ first === side }\n\t\t\t\t\t\t\tisLast={ last === side }\n\t\t\t\t\t\t\tisOnly={ only === side }\n\t\t\t\t\t\t\tvalue={ [ parsedQuantity, computedUnit ].join(\n\t\t\t\t\t\t\t\t''\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonChange={ createHandleOnChange( side ) }\n\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange( side ) }\n\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\tonHoverOn={ createHandleOnHoverOn( side ) }\n\t\t\t\t\t\t\tonHoverOff={ createHandleOnHoverOff( side ) }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\tkey={ `box-control-${ side }` }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</Layout>\n\t\t</LayoutContainer>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/box-control/input-controls.js"],"names":["UnitControl","parseQuantityAndUnitFromRawValue","ALL_SIDES","LABELS","LayoutContainer","Layout","noop","BoxInputControls","onChange","onFocus","onHoverOn","onHoverOff","values","selectedUnits","setSelectedUnits","sides","props","createHandleOnFocus","side","event","createHandleOnHoverOn","createHandleOnHoverOff","handleOnChange","nextValues","createHandleOnChange","next","altKey","isNumeric","isNaN","parseFloat","nextValue","undefined","bottom","top","right","left","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","first","last","only","map","parsedQuantity","parsedUnit","computedUnit","join"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,WAAP,MAAwB,gBAAxB;AACA,SAASC,gCAAT,QAAiD,uBAAjD;AACA,S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C,IAAA,KAAK,EAAC,KAFP;AAGC,IAAA,SAAS,EAAC;AAHX,KAKGJ,aAAa,CAACO,GAAd,CAAqB3B,IAAF,IAAY;AAChC,UAAM,CAAE4B,cAAF,EAAkBC,UAAlB,IACL9C,gCAAgC,CAAEW,MAAM,CAAEM,IAAF,CAAR,CADjC;AAGA,UAAM8B,YAAY,GAAGpC,MAAM,CAAEM,IAAF,CAAN,GAClB6B,UADkB,GAElBlC,aAAa,CAAEK,IAAF,CAFhB;AAIA,WACC,cAAC,WAAD,eACMF,KADN;AAEC,MAAA,OAAO,EAAG0B,KAAK,KAAKxB,IAFrB;AAGC,MAAA,MAAM,EAAGyB,IAAI,KAAKzB,IAHnB;AAIC,MAAA,MAAM,EAAG0B,IAAI,KAAK1B,IAJnB;AAKC,MAAA,KAAK,EAAG,CAAE4B,cAAF,EAAkBE,YAAlB,EAAiCC,IAAjC,CACP,EADO,CALT;AAQC,MAAA,QAAQ,EAAGzB,oBAAoB,CAAEN,IAAF,CARhC;AASC,MAAA,YAAY,EAAGkB,wBAAwB,CAAElB,IAAF,CATxC;AAUC,MAAA,OAAO,EAAGD,mBAAmB,CAAEC,IAAF,CAV9B;AAWC,MAAA,SAAS,EAAGE,qBAAqB,CAAEF,IAAF,CAXlC;AAYC,MAAA,UAAU,EAAGG,sBAAsB,CAAEH,IAAF,CAZpC;AAaC,MAAA,KAAK,EAAGf,MAAM,CAAEe,IAAF,CAbf;AAcC,MAAA,GAAG,EAAI,eAAeA,IAAM;AAd7B,OADD;AAkBA,GA1BC,CALH,CADD,CADD;AAqCA","sourcesContent":["/**\n * Internal dependencies\n */\nimport UnitControl from './unit-control';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { ALL_SIDES, LABELS } from './utils';\nimport { LayoutContainer, Layout } from './styles/box-control-styles';\n\nconst noop = () => {};\n\nexport default function BoxInputControls( {\n\tonChange = noop,\n\tonFocus = noop,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n} ) {\n\tconst createHandleOnFocus = ( side ) => ( event ) => {\n\t\tonFocus( event, { side } );\n\t};\n\n\tconst createHandleOnHoverOn = ( side ) => () => {\n\t\tonHoverOn( { [ side ]: true } );\n\t};\n\n\tconst createHandleOnHoverOff = ( side ) => () => {\n\t\tonHoverOff( { [ side ]: false } );\n\t};\n\n\tconst handleOnChange = ( nextValues ) => {\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnChange =\n\t\t( side ) =>\n\t\t( next, { event } ) => {\n\t\t\tconst { altKey } = event;\n\t\t\tconst nextValues = { ...values };\n\t\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\t\tnextValues[ side ] = nextValue;\n\n\t\t\t/**\n\t\t\t * Supports changing pair sides. For example, holding the ALT key\n\t\t\t * when changing the TOP will also update BOTTOM.\n\t\t\t */\n\t\t\tif ( altKey ) {\n\t\t\t\tswitch ( side ) {\n\t\t\t\t\tcase 'top':\n\t\t\t\t\t\tnextValues.bottom = nextValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bottom':\n\t\t\t\t\t\tnextValues.top = nextValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'left':\n\t\t\t\t\t\tnextValues.right = nextValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'right':\n\t\t\t\t\t\tnextValues.left = nextValue;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\thandleOnChange( nextValues );\n\t\t};\n\n\tconst createHandleOnUnitChange = ( side ) => ( next ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\t\tnewUnits[ side ] = next;\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? ALL_SIDES.filter( ( side ) => sides.includes( side ) )\n\t\t: ALL_SIDES;\n\n\tconst first = filteredSides[ 0 ];\n\tconst last = filteredSides[ filteredSides.length - 1 ];\n\tconst only = first === last && first;\n\n\treturn (\n\t\t<LayoutContainer className=\"component-box-control__input-controls-wrapper\">\n\t\t\t<Layout\n\t\t\t\tgap={ 0 }\n\t\t\t\talign=\"top\"\n\t\t\t\tclassName=\"component-box-control__input-controls\"\n\t\t\t>\n\t\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\t\tparseQuantityAndUnitFromRawValue( values[ side ] );\n\n\t\t\t\t\tconst computedUnit = values[ side ]\n\t\t\t\t\t\t? parsedUnit\n\t\t\t\t\t\t: selectedUnits[ side ];\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\tisFirst={ first === side }\n\t\t\t\t\t\t\tisLast={ last === side }\n\t\t\t\t\t\t\tisOnly={ only === side }\n\t\t\t\t\t\t\tvalue={ [ parsedQuantity, computedUnit ].join(\n\t\t\t\t\t\t\t\t''\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonChange={ createHandleOnChange( side ) }\n\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange( side ) }\n\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\tonHoverOn={ createHandleOnHoverOn( side ) }\n\t\t\t\t\t\t\tonHoverOff={ createHandleOnHoverOff( side ) }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\tkey={ `box-control-${ side }` }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</Layout>\n\t\t</LayoutContainer>\n\t);\n}\n"]}
@@ -4,7 +4,6 @@ import { createElement } from "@wordpress/element";
4
4
  /**
5
5
  * External dependencies
6
6
  */
7
- import { noop } from 'lodash';
8
7
  import { useHover } from '@use-gesture/react';
9
8
  /**
10
9
  * Internal dependencies
@@ -12,6 +11,9 @@ import { useHover } from '@use-gesture/react';
12
11
 
13
12
  import BaseTooltip from '../tooltip';
14
13
  import { UnitControlWrapper, UnitControl } from './styles/box-control-styles';
14
+
15
+ const noop = () => {};
16
+
15
17
  export default function BoxUnitControl(_ref) {
16
18
  let {
17
19
  isFirst,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/box-control/unit-control.js"],"names":["noop","useHover","BaseTooltip","UnitControlWrapper","UnitControl","BoxUnitControl","isFirst","isLast","isOnly","onHoverOn","onHoverOff","label","value","props","bindHoverGesture","event","state","hovering","Tooltip","children","text"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AACA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,YAAxB;AACA,SAASC,kBAAT,EAA6BC,WAA7B,QAAgD,6BAAhD;AAEA,eAAe,SAASC,cAAT,OASX;AAAA,MAToC;AACvCC,IAAAA,OADuC;AAEvCC,IAAAA,MAFuC;AAGvCC,IAAAA,MAHuC;AAIvCC,IAAAA,SAAS,GAAGT,IAJ2B;AAKvCU,IAAAA,UAAU,GAAGV,IAL0B;AAMvCW,IAAAA,KANuC;AAOvCC,IAAAA,KAPuC;AAQvC,OAAGC;AARoC,GASpC;AACH,QAAMC,gBAAgB,GAAGb,QAAQ,CAAE,SAA2B;AAAA,QAAzB;AAAEc,MAAAA,KAAF;AAAS,SAAGC;AAAZ,KAAyB;;AAC7D,QAAKA,KAAK,CAACC,QAAX,EAAsB;AACrBR,MAAAA,SAAS,CAAEM,KAAF,EAASC,KAAT,CAAT;AACA,KAFD,MAEO;AACNN,MAAAA,UAAU,CAAEK,KAAF,EAASC,KAAT,CAAV;AACA;AACD,GANgC,CAAjC;AAQA,SACC,cAAC,kBAAD,EAAyBF,gBAAgB,EAAzC,EACC,cAAC,OAAD;AAAS,IAAA,IAAI,EAAGH;AAAhB,KACC,cAAC,WAAD;AACC,kBAAaA,KADd;AAEC,IAAA,SAAS,EAAC,qCAFX;AAGC,IAAA,cAAc,MAHf;AAIC,IAAA,OAAO,EAAGL,OAJX;AAKC,IAAA,MAAM,EAAGC,MALV;AAMC,IAAA,MAAM,EAAGC,MANV;AAOC,IAAA,oBAAoB,MAPrB;AAQC,IAAA,wBAAwB,EAAG,KAR5B;AASC,IAAA,KAAK,EAAGI;AATT,KAUMC,KAVN,EADD,CADD,CADD;AAkBA;;AAED,SAASK,OAAT,QAAuC;AAAA,MAArB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAqB;AACtC,MAAK,CAAEA,IAAP,EAAc,OAAOD,QAAP;AAEd;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AACC,SACC,cAAC,WAAD;AAAa,IAAA,IAAI,EAAGC,IAApB;AAA2B,IAAA,QAAQ,EAAC;AAApC,KACC,2BAAOD,QAAP,CADD,CADD;AAKA","sourcesContent":["/**\n * External dependencies\n */\nimport { noop } from 'lodash';\nimport { useHover } from '@use-gesture/react';\n\n/**\n * Internal dependencies\n */\nimport BaseTooltip from '../tooltip';\nimport { UnitControlWrapper, UnitControl } from './styles/box-control-styles';\n\nexport default function BoxUnitControl( {\n\tisFirst,\n\tisLast,\n\tisOnly,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tlabel,\n\tvalue,\n\t...props\n} ) {\n\tconst bindHoverGesture = useHover( ( { event, ...state } ) => {\n\t\tif ( state.hovering ) {\n\t\t\tonHoverOn( event, state );\n\t\t} else {\n\t\t\tonHoverOff( event, state );\n\t\t}\n\t} );\n\n\treturn (\n\t\t<UnitControlWrapper { ...bindHoverGesture() }>\n\t\t\t<Tooltip text={ label }>\n\t\t\t\t<UnitControl\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\thideHTMLArrows\n\t\t\t\t\tisFirst={ isFirst }\n\t\t\t\t\tisLast={ isLast }\n\t\t\t\t\tisOnly={ isOnly }\n\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\tisResetValueOnUnitChange={ false }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t</UnitControlWrapper>\n\t);\n}\n\nfunction Tooltip( { children, text } ) {\n\tif ( ! text ) return children;\n\n\t/**\n\t * Wrapping the children in a `<div />` as Tooltip as it attempts\n\t * to render the <UnitControl />. Using a plain `<div />` appears to\n\t * resolve this issue.\n\t *\n\t * Originally discovered and referenced here:\n\t * https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026\n\t */\n\treturn (\n\t\t<BaseTooltip text={ text } position=\"top\">\n\t\t\t<div>{ children }</div>\n\t\t</BaseTooltip>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/box-control/unit-control.js"],"names":["useHover","BaseTooltip","UnitControlWrapper","UnitControl","noop","BoxUnitControl","isFirst","isLast","isOnly","onHoverOn","onHoverOff","label","value","props","bindHoverGesture","event","state","hovering","Tooltip","children","text"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,YAAxB;AACA,SAASC,kBAAT,EAA6BC,WAA7B,QAAgD,6BAAhD;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,eAAe,SAASC,cAAT,OASX;AAAA,MAToC;AACvCC,IAAAA,OADuC;AAEvCC,IAAAA,MAFuC;AAGvCC,IAAAA,MAHuC;AAIvCC,IAAAA,SAAS,GAAGL,IAJ2B;AAKvCM,IAAAA,UAAU,GAAGN,IAL0B;AAMvCO,IAAAA,KANuC;AAOvCC,IAAAA,KAPuC;AAQvC,OAAGC;AARoC,GASpC;AACH,QAAMC,gBAAgB,GAAGd,QAAQ,CAAE,SAA2B;AAAA,QAAzB;AAAEe,MAAAA,KAAF;AAAS,SAAGC;AAAZ,KAAyB;;AAC7D,QAAKA,KAAK,CAACC,QAAX,EAAsB;AACrBR,MAAAA,SAAS,CAAEM,KAAF,EAASC,KAAT,CAAT;AACA,KAFD,MAEO;AACNN,MAAAA,UAAU,CAAEK,KAAF,EAASC,KAAT,CAAV;AACA;AACD,GANgC,CAAjC;AAQA,SACC,cAAC,kBAAD,EAAyBF,gBAAgB,EAAzC,EACC,cAAC,OAAD;AAAS,IAAA,IAAI,EAAGH;AAAhB,KACC,cAAC,WAAD;AACC,kBAAaA,KADd;AAEC,IAAA,SAAS,EAAC,qCAFX;AAGC,IAAA,cAAc,MAHf;AAIC,IAAA,OAAO,EAAGL,OAJX;AAKC,IAAA,MAAM,EAAGC,MALV;AAMC,IAAA,MAAM,EAAGC,MANV;AAOC,IAAA,oBAAoB,MAPrB;AAQC,IAAA,wBAAwB,EAAG,KAR5B;AASC,IAAA,KAAK,EAAGI;AATT,KAUMC,KAVN,EADD,CADD,CADD;AAkBA;;AAED,SAASK,OAAT,QAAuC;AAAA,MAArB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAqB;AACtC,MAAK,CAAEA,IAAP,EAAc,OAAOD,QAAP;AAEd;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;AACC,SACC,cAAC,WAAD;AAAa,IAAA,IAAI,EAAGC,IAApB;AAA2B,IAAA,QAAQ,EAAC;AAApC,KACC,2BAAOD,QAAP,CADD,CADD;AAKA","sourcesContent":["/**\n * External dependencies\n */\nimport { useHover } from '@use-gesture/react';\n\n/**\n * Internal dependencies\n */\nimport BaseTooltip from '../tooltip';\nimport { UnitControlWrapper, UnitControl } from './styles/box-control-styles';\n\nconst noop = () => {};\n\nexport default function BoxUnitControl( {\n\tisFirst,\n\tisLast,\n\tisOnly,\n\tonHoverOn = noop,\n\tonHoverOff = noop,\n\tlabel,\n\tvalue,\n\t...props\n} ) {\n\tconst bindHoverGesture = useHover( ( { event, ...state } ) => {\n\t\tif ( state.hovering ) {\n\t\t\tonHoverOn( event, state );\n\t\t} else {\n\t\t\tonHoverOff( event, state );\n\t\t}\n\t} );\n\n\treturn (\n\t\t<UnitControlWrapper { ...bindHoverGesture() }>\n\t\t\t<Tooltip text={ label }>\n\t\t\t\t<UnitControl\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\thideHTMLArrows\n\t\t\t\t\tisFirst={ isFirst }\n\t\t\t\t\tisLast={ isLast }\n\t\t\t\t\tisOnly={ isOnly }\n\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\tisResetValueOnUnitChange={ false }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\t{ ...props }\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t</UnitControlWrapper>\n\t);\n}\n\nfunction Tooltip( { children, text } ) {\n\tif ( ! text ) return children;\n\n\t/**\n\t * Wrapping the children in a `<div />` as Tooltip as it attempts\n\t * to render the <UnitControl />. Using a plain `<div />` appears to\n\t * resolve this issue.\n\t *\n\t * Originally discovered and referenced here:\n\t * https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026\n\t */\n\treturn (\n\t\t<BaseTooltip text={ text } position=\"top\">\n\t\t\t<div>{ children }</div>\n\t\t</BaseTooltip>\n\t);\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { isEmpty, isNumber } from 'lodash';
4
+ import { isEmpty } from 'lodash';
5
5
  /**
6
6
  * WordPress dependencies
7
7
  */
@@ -65,18 +65,18 @@ export function getAllValue() {
65
65
  const allParsedUnits = parsedQuantitiesAndUnits.map(value => value[1]);
66
66
  const commonQuantity = allParsedQuantities.every(v => v === allParsedQuantities[0]) ? allParsedQuantities[0] : '';
67
67
  /**
68
- * The isNumber check is important. On reset actions, the incoming value
68
+ * The typeof === 'number' check is important. On reset actions, the incoming value
69
69
  * may be null or an empty string.
70
70
  *
71
71
  * Also, the value may also be zero (0), which is considered a valid unit value.
72
72
  *
73
- * isNumber() is more specific for these cases, rather than relying on a
73
+ * typeof === 'number' is more specific for these cases, rather than relying on a
74
74
  * simple truthy check.
75
75
  */
76
76
 
77
77
  let commonUnit;
78
78
 
79
- if (isNumber(commonQuantity)) {
79
+ if (typeof commonQuantity === 'number') {
80
80
  commonUnit = mode(allParsedUnits);
81
81
  } else {
82
82
  var _getAllUnitFallback;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/box-control/utils.js"],"names":["isEmpty","isNumber","__","parseQuantityAndUnitFromRawValue","LABELS","all","top","bottom","left","right","mixed","vertical","horizontal","DEFAULT_VALUES","undefined","ALL_SIDES","mode","arr","sort","a","b","filter","v","length","pop","getAllValue","values","selectedUnits","availableSides","sides","normalizeSides","parsedQuantitiesAndUnits","map","side","allParsedQuantities","value","allParsedUnits","commonQuantity","every","commonUnit","getAllUnitFallback","join","filteredUnits","Object","Boolean","isValuesMixed","allValue","isMixed","isNaN","parseFloat","isValuesDefined","test","getInitialSide","isLinked","splitOnAxis","initialSide","filteredSides","includes","push","newSides"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,EAAkBC,QAAlB,QAAkC,QAAlC;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,gCAAT,QAAiD,uBAAjD;AAEA,OAAO,MAAMC,MAAM,GAAG;AACrBC,EAAAA,GAAG,EAAEH,EAAE,CAAE,KAAF,CADc;AAErBI,EAAAA,GAAG,EAAEJ,EAAE,CAAE,KAAF,CAFc;AAGrBK,EAAAA,MAAM,EAAEL,EAAE,CAAE,QAAF,CAHW;AAIrBM,EAAAA,IAAI,EAAEN,EAAE,CAAE,MAAF,CAJa;AAKrBO,EAAAA,KAAK,EAAEP,EAAE,CAAE,OAAF,CALY;AAMrBQ,EAAAA,KAAK,EAAER,EAAE,CAAE,OAAF,CANY;AAOrBS,EAAAA,QAAQ,EAAET,EAAE,CAAE,UAAF,CAPS;AAQrBU,EAAAA,UAAU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A;;AAED,SAAOH,aAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty, isNumber } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\n\nexport const LABELS = {\n\tall: __( 'All' ),\n\ttop: __( 'Top' ),\n\tbottom: __( 'Bottom' ),\n\tleft: __( 'Left' ),\n\tright: __( 'Right' ),\n\tmixed: __( 'Mixed' ),\n\tvertical: __( 'Vertical' ),\n\thorizontal: __( 'Horizontal' ),\n};\n\nexport const DEFAULT_VALUES = {\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\n\n/**\n * Gets an items with the most occurrence within an array\n * https://stackoverflow.com/a/20762713\n *\n * @param {Array<any>} arr Array of items to check.\n * @return {any} The item with the most occurrences.\n */\nfunction mode( arr ) {\n\treturn arr\n\t\t.sort(\n\t\t\t( a, b ) =>\n\t\t\t\tarr.filter( ( v ) => v === a ).length -\n\t\t\t\tarr.filter( ( v ) => v === b ).length\n\t\t)\n\t\t.pop();\n}\n\n/**\n * Gets the 'all' input value and unit from values data.\n *\n * @param {Object} values Box values.\n * @param {Object} selectedUnits Box units.\n * @param {Array} availableSides Available box sides to evaluate.\n *\n * @return {string} A value + unit for the 'all' input.\n */\nexport function getAllValue(\n\tvalues = {},\n\tselectedUnits,\n\tavailableSides = ALL_SIDES\n) {\n\tconst sides = normalizeSides( availableSides );\n\tconst parsedQuantitiesAndUnits = sides.map( ( side ) =>\n\t\tparseQuantityAndUnitFromRawValue( values[ side ] )\n\t);\n\tconst allParsedQuantities = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 0 ] ?? ''\n\t);\n\tconst allParsedUnits = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 1 ]\n\t);\n\n\tconst commonQuantity = allParsedQuantities.every(\n\t\t( v ) => v === allParsedQuantities[ 0 ]\n\t)\n\t\t? allParsedQuantities[ 0 ]\n\t\t: '';\n\n\t/**\n\t * The isNumber check is important. On reset actions, the incoming value\n\t * may be null or an empty string.\n\t *\n\t * Also, the value may also be zero (0), which is considered a valid unit value.\n\t *\n\t * isNumber() is more specific for these cases, rather than relying on a\n\t * simple truthy check.\n\t */\n\tlet commonUnit;\n\tif ( isNumber( commonQuantity ) ) {\n\t\tcommonUnit = mode( allParsedUnits );\n\t} else {\n\t\t// Set meaningful unit selection if no commonQuantity and user has previously\n\t\t// selected units without assigning values while controls were unlinked.\n\t\tcommonUnit =\n\t\t\tgetAllUnitFallback( selectedUnits ) ?? mode( allParsedUnits );\n\t}\n\n\treturn [ commonQuantity, commonUnit ].join( '' );\n}\n\n/**\n * Determine the most common unit selection to use as a fallback option.\n *\n * @param {Object} selectedUnits Current unit selections for individual sides.\n * @return {string} Most common unit selection.\n */\nexport function getAllUnitFallback( selectedUnits ) {\n\tif ( ! selectedUnits || typeof selectedUnits !== 'object' ) {\n\t\treturn undefined;\n\t}\n\n\tconst filteredUnits = Object.values( selectedUnits ).filter( Boolean );\n\n\treturn mode( filteredUnits );\n}\n\n/**\n * Checks to determine if values are mixed.\n *\n * @param {Object} values Box values.\n * @param {Object} selectedUnits Box units.\n * @param {Array} sides Available box sides to evaluate.\n *\n * @return {boolean} Whether values are mixed.\n */\nexport function isValuesMixed( values = {}, selectedUnits, sides = ALL_SIDES ) {\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst isMixed = isNaN( parseFloat( allValue ) );\n\n\treturn isMixed;\n}\n\n/**\n * Checks to determine if values are defined.\n *\n * @param {Object} values Box values.\n *\n * @return {boolean} Whether values are mixed.\n */\nexport function isValuesDefined( values ) {\n\treturn (\n\t\tvalues !== undefined &&\n\t\t! isEmpty(\n\t\t\tObject.values( values ).filter(\n\t\t\t\t// Switching units when input is empty causes values only\n\t\t\t\t// containing units. This gives false positive on mixed values\n\t\t\t\t// unless filtered.\n\t\t\t\t( value ) => !! value && /\\d/.test( value )\n\t\t\t)\n\t\t)\n\t);\n}\n\n/**\n * Get initial selected side, factoring in whether the sides are linked,\n * and whether the vertical / horizontal directions are grouped via splitOnAxis.\n *\n * @param {boolean} isLinked Whether the box control's fields are linked.\n * @param {boolean} splitOnAxis Whether splitting by horizontal or vertical axis.\n * @return {string} The initial side.\n */\nexport function getInitialSide( isLinked, splitOnAxis ) {\n\tlet initialSide = 'all';\n\n\tif ( ! isLinked ) {\n\t\tinitialSide = splitOnAxis ? 'vertical' : 'top';\n\t}\n\n\treturn initialSide;\n}\n\n/**\n * Normalizes provided sides configuration to an array containing only top,\n * right, bottom and left. This essentially just maps `horizontal` or `vertical`\n * to their appropriate sides to facilitate correctly determining value for\n * all input control.\n *\n * @param {Array} sides Available sides for box control.\n * @return {Array} Normalized sides configuration.\n */\nexport function normalizeSides( sides ) {\n\tconst filteredSides = [];\n\n\tif ( ! sides?.length ) {\n\t\treturn ALL_SIDES;\n\t}\n\n\tif ( sides.includes( 'vertical' ) ) {\n\t\tfilteredSides.push( ...[ 'top', 'bottom' ] );\n\t} else if ( sides.includes( 'horizontal' ) ) {\n\t\tfilteredSides.push( ...[ 'left', 'right' ] );\n\t} else {\n\t\tconst newSides = ALL_SIDES.filter( ( side ) => sides.includes( side ) );\n\t\tfilteredSides.push( ...newSides );\n\t}\n\n\treturn filteredSides;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/box-control/utils.js"],"names":["isEmpty","__","parseQuantityAndUnitFromRawValue","LABELS","all","top","bottom","left","right","mixed","vertical","horizontal","DEFAULT_VALUES","undefined","ALL_SIDES","mode","arr","sort","a","b","filter","v","length","pop","getAllValue","values","selectedUnits","availableSides","sides","normalizeSides","parsedQuantitiesAndUnits","map","side","allParsedQuantities","value","allParsedUnits","commonQuantity","every","commonUnit","getAllUnitFallback","join","filteredUnits","Object","Boolean","isValuesMixed","allValue","isMixed","isNaN","parseFloat","isValuesDefined","test","getInitialSide","isLinked","splitOnAxis","initialSide","filteredSides","includes","push","newSides"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,gCAAT,QAAiD,uBAAjD;AAEA,OAAO,MAAMC,MAAM,GAAG;AACrBC,EAAAA,GAAG,EAAEH,EAAE,CAAE,KAAF,CADc;AAErBI,EAAAA,GAAG,EAAEJ,EAAE,CAAE,KAAF,CAFc;AAGrBK,EAAAA,MAAM,EAAEL,EAAE,CAAE,QAAF,CAHW;AAIrBM,EAAAA,IAAI,EAAEN,EAAE,CAAE,MAAF,CAJa;AAKrBO,EAAAA,KAAK,EAAEP,EAAE,CAAE,OAAF,CALY;AAMrBQ,EAAAA,KAAK,EAAER,EAAE,CAAE,OAAF,CANY;AAOrBS,EAAAA,QAAQ,EAAET,EAAE,CAAE,UAAF,CAPS;AAQrBU,EAAAA,UAAU,EAAEV,EAAE,CAAE,YAAF;AARO,CAAf;AAWP,OAAO,MAAMW,cAAc,GAAG;AAC7BP,EAAAA,GAAG,EAAEQ,SADwB;AAE7BL,EAAAA,KAAK,EAAEK,SAFsB;AAG7BP,EAAAA,MAAM,EAAEO,SAHqB;AAI7BN,EAAAA,IAAI,EAAEM;AAJuB,CAAvB;AAOP,OAAO,MAAMC,SAAS,GAAG,CAAE,KAAF,EAAS,OAAT,EAAkB,QAAlB,EAA4B,MAA5B,CAAlB;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,IAAT,CAAeC,GAAf,EAAqB;AACpB,SAAOA,GAAG,CACRC,IADK,CAEL,CAAEC,CAAF,EAAKC,CAAL,KACCH,GAAG,CAACI,MAAJ,CAAcC,CAAF,IAASA,CAAC,KAAKH,CAA3B,EAA+BI,MAA/B,GACAN,GAAG,CAACI,MAAJ,CAAcC,CAAF,IAASA,CAAC,KAAKF,CAA3B,EAA+BG,MAJ3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AACvC,QAAM2B,aAAa,GAAG,EAAtB;;AAEA,MAAK,EAAE3B,KAAF,aAAEA,KAAF,eAAEA,KAAK,CAAEN,MAAT,CAAL,EAAuB;AACtB,WAAOR,SAAP;AACA;;AAED,MAAKc,KAAK,CAAC4B,QAAN,CAAgB,UAAhB,CAAL,EAAoC;AACnCD,IAAAA,aAAa,CAACE,IAAd,CAAoB,GAAG,CAAE,KAAF,EAAS,QAAT,CAAvB;AACA,GAFD,MAEO,IAAK7B,KAAK,CAAC4B,QAAN,CAAgB,YAAhB,CAAL,EAAsC;AAC5CD,IAAAA,aAAa,CAACE,IAAd,CAAoB,GAAG,CAAE,MAAF,EAAU,OAAV,CAAvB;AACA,GAFM,MAEA;AACN,UAAMC,QAAQ,GAAG5C,SAAS,CAACM,MAAV,CAAoBY,IAAF,IAAYJ,KAAK,CAAC4B,QAAN,CAAgBxB,IAAhB,CAA9B,CAAjB;AACAuB,IAAAA,aAAa,CAACE,IAAd,CAAoB,GAAGC,QAAvB;AACA;;AAED,SAAOH,aAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\n\nexport const LABELS = {\n\tall: __( 'All' ),\n\ttop: __( 'Top' ),\n\tbottom: __( 'Bottom' ),\n\tleft: __( 'Left' ),\n\tright: __( 'Right' ),\n\tmixed: __( 'Mixed' ),\n\tvertical: __( 'Vertical' ),\n\thorizontal: __( 'Horizontal' ),\n};\n\nexport const DEFAULT_VALUES = {\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ];\n\n/**\n * Gets an items with the most occurrence within an array\n * https://stackoverflow.com/a/20762713\n *\n * @param {Array<any>} arr Array of items to check.\n * @return {any} The item with the most occurrences.\n */\nfunction mode( arr ) {\n\treturn arr\n\t\t.sort(\n\t\t\t( a, b ) =>\n\t\t\t\tarr.filter( ( v ) => v === a ).length -\n\t\t\t\tarr.filter( ( v ) => v === b ).length\n\t\t)\n\t\t.pop();\n}\n\n/**\n * Gets the 'all' input value and unit from values data.\n *\n * @param {Object} values Box values.\n * @param {Object} selectedUnits Box units.\n * @param {Array} availableSides Available box sides to evaluate.\n *\n * @return {string} A value + unit for the 'all' input.\n */\nexport function getAllValue(\n\tvalues = {},\n\tselectedUnits,\n\tavailableSides = ALL_SIDES\n) {\n\tconst sides = normalizeSides( availableSides );\n\tconst parsedQuantitiesAndUnits = sides.map( ( side ) =>\n\t\tparseQuantityAndUnitFromRawValue( values[ side ] )\n\t);\n\tconst allParsedQuantities = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 0 ] ?? ''\n\t);\n\tconst allParsedUnits = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 1 ]\n\t);\n\n\tconst commonQuantity = allParsedQuantities.every(\n\t\t( v ) => v === allParsedQuantities[ 0 ]\n\t)\n\t\t? allParsedQuantities[ 0 ]\n\t\t: '';\n\n\t/**\n\t * The typeof === 'number' check is important. On reset actions, the incoming value\n\t * may be null or an empty string.\n\t *\n\t * Also, the value may also be zero (0), which is considered a valid unit value.\n\t *\n\t * typeof === 'number' is more specific for these cases, rather than relying on a\n\t * simple truthy check.\n\t */\n\tlet commonUnit;\n\tif ( typeof commonQuantity === 'number' ) {\n\t\tcommonUnit = mode( allParsedUnits );\n\t} else {\n\t\t// Set meaningful unit selection if no commonQuantity and user has previously\n\t\t// selected units without assigning values while controls were unlinked.\n\t\tcommonUnit =\n\t\t\tgetAllUnitFallback( selectedUnits ) ?? mode( allParsedUnits );\n\t}\n\n\treturn [ commonQuantity, commonUnit ].join( '' );\n}\n\n/**\n * Determine the most common unit selection to use as a fallback option.\n *\n * @param {Object} selectedUnits Current unit selections for individual sides.\n * @return {string} Most common unit selection.\n */\nexport function getAllUnitFallback( selectedUnits ) {\n\tif ( ! selectedUnits || typeof selectedUnits !== 'object' ) {\n\t\treturn undefined;\n\t}\n\n\tconst filteredUnits = Object.values( selectedUnits ).filter( Boolean );\n\n\treturn mode( filteredUnits );\n}\n\n/**\n * Checks to determine if values are mixed.\n *\n * @param {Object} values Box values.\n * @param {Object} selectedUnits Box units.\n * @param {Array} sides Available box sides to evaluate.\n *\n * @return {boolean} Whether values are mixed.\n */\nexport function isValuesMixed( values = {}, selectedUnits, sides = ALL_SIDES ) {\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst isMixed = isNaN( parseFloat( allValue ) );\n\n\treturn isMixed;\n}\n\n/**\n * Checks to determine if values are defined.\n *\n * @param {Object} values Box values.\n *\n * @return {boolean} Whether values are mixed.\n */\nexport function isValuesDefined( values ) {\n\treturn (\n\t\tvalues !== undefined &&\n\t\t! isEmpty(\n\t\t\tObject.values( values ).filter(\n\t\t\t\t// Switching units when input is empty causes values only\n\t\t\t\t// containing units. This gives false positive on mixed values\n\t\t\t\t// unless filtered.\n\t\t\t\t( value ) => !! value && /\\d/.test( value )\n\t\t\t)\n\t\t)\n\t);\n}\n\n/**\n * Get initial selected side, factoring in whether the sides are linked,\n * and whether the vertical / horizontal directions are grouped via splitOnAxis.\n *\n * @param {boolean} isLinked Whether the box control's fields are linked.\n * @param {boolean} splitOnAxis Whether splitting by horizontal or vertical axis.\n * @return {string} The initial side.\n */\nexport function getInitialSide( isLinked, splitOnAxis ) {\n\tlet initialSide = 'all';\n\n\tif ( ! isLinked ) {\n\t\tinitialSide = splitOnAxis ? 'vertical' : 'top';\n\t}\n\n\treturn initialSide;\n}\n\n/**\n * Normalizes provided sides configuration to an array containing only top,\n * right, bottom and left. This essentially just maps `horizontal` or `vertical`\n * to their appropriate sides to facilitate correctly determining value for\n * all input control.\n *\n * @param {Array} sides Available sides for box control.\n * @return {Array} Normalized sides configuration.\n */\nexport function normalizeSides( sides ) {\n\tconst filteredSides = [];\n\n\tif ( ! sides?.length ) {\n\t\treturn ALL_SIDES;\n\t}\n\n\tif ( sides.includes( 'vertical' ) ) {\n\t\tfilteredSides.push( ...[ 'top', 'bottom' ] );\n\t} else if ( sides.includes( 'horizontal' ) ) {\n\t\tfilteredSides.push( ...[ 'left', 'right' ] );\n\t} else {\n\t\tconst newSides = ALL_SIDES.filter( ( side ) => sides.includes( side ) );\n\t\tfilteredSides.push( ...newSides );\n\t}\n\n\treturn filteredSides;\n}\n"]}
@@ -4,7 +4,6 @@ import { createElement } from "@wordpress/element";
4
4
  * External dependencies
5
5
  */
6
6
  import { StyleSheet, TouchableOpacity, Text, View, Platform } from 'react-native';
7
- import { isArray } from 'lodash';
8
7
  import { LongPressGestureHandler, State } from 'react-native-gesture-handler';
9
8
  /**
10
9
  * WordPress dependencies
@@ -126,7 +125,7 @@ export function Button(props) {
126
125
  showTooltip && label || // There's a shortcut or...
127
126
  shortcut || // There's a label and...
128
127
  !!label && ( // The children are empty and...
129
- !children || isArray(children) && !children.length) && // The tooltip is not explicitly disabled.
128
+ !children || Array.isArray(children) && !children.length) && // The tooltip is not explicitly disabled.
130
129
  false !== showTooltip);
131
130
  const newIcon = icon ? cloneElement(createElement(Icon, {
132
131
  icon: icon,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/button/index.native.js"],"names":["StyleSheet","TouchableOpacity","Text","View","Platform","isArray","LongPressGestureHandler","State","Children","cloneElement","useCallback","usePreferredColorScheme","usePreferredColorSchemeStyle","Tooltip","Icon","isAndroid","OS","marginBottom","marginLeft","styles","create","container","flex","padding","justifyContent","alignItems","buttonInactive","flexDirection","fixedRatio","aspectRatio","buttonActive","borderRadius","borderColor","backgroundColor","subscriptInactive","color","fontWeight","fontSize","alignSelf","subscriptInactiveDark","subscriptActive","Button","props","children","onClick","onLongPress","disabled","hint","isPressed","ariaDisabled","subscript","testID","icon","iconSize","showTooltip","label","shortcut","tooltipPosition","isActiveStyle","customContainerStyles","preferredColorScheme","isDisabled","containerStyle","buttonViewStyle","opacity","states","push","newChildren","map","child","colorScheme","shouldShowTooltip","length","newIcon","longPressHandler","nativeEvent","state","ACTIVE","element"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,UADD,EAECC,gBAFD,EAGCC,IAHD,EAICC,IAJD,EAKCC,QALD,QAMO,cANP;AAOA,SAASC,OAAT,QAAwB,QAAxB;AACA,SAASC,uBAAT,EAAkCC,KAAlC,QAA+C,8BAA/C;AAEA;AACA;AACA;;AACA,SAASC,QAAT,EAAmBC,YAAnB,EAAiCC,WAAjC,QAAoD,oBAApD;AACA,SACCC,uBADD,EAECC,4BAFD,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AAEA,MAAMC,SAAS,GAAGX,QAAQ,CAACY,EAAT,KAAgB,SAAlC;AACA,MAAMC,YAAY,GAAGF,SAAS,GAAG,CAAC,GAAJ,GAAU,CAAxC;AACA,MAAMG,UAAU,GAAG,CAAC,CAApB;AAEA,MAAMC,MAAM,GAAGnB,UAAU,CAACoB,MAAX,CAAmB;AACjCC,EAAAA,SAAS,EAAE;AACVC,IAAAA,IAAI,EAAE,CADI;AAEVC,IAAAA,OAAO,EAAE,CAFC;AAGVC,IAAAA,cAAc,EAAE,QAHN;AAIVC,IAAAA,UAAU,EAAE;AAJF,GADsB;AAOjCC,EAAAA,cAAc,EAAE;AACfJ,IAAAA,IAAI,EAAE,CADS;AAEfK,IAAAA,aAAa,EAAE,KAFA;AAGfH,IAAAA,cAAc,EAAE,QAHD;AAIfC,IAAAA,UAAU,EAAE;AAJG,GAPiB;AAajCG,EAAAA,UAAU,EAAE;AACXC,IAAAA,WAAW,EAAE;AADF,GAbqB;AAgBjCC,EAAAA,YAAY,EAAE;AACbR,IAAAA,IAAI,EAAE,CADO;AAEbK,IAAAA,aAAa,EAAE,KAFF;AAGbH,IAAAA,cAAc,EAAE,QAHH;AAIbC,IAAAA,UAAU,EAAE,QAJC;AAKbM,IAAA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,KACG8C,OADH,EAEGN,WAFH,EAGGjB,SAAS,IACV,cAAC,IAAD;AACC,IAAA,KAAK,EACJF,SAAS,GACN7B,MAAM,CAACqB,eADD,GAENN;AAJL,KAOGgB,SAPH,CAJF,CADD,CALD,CAZD,CADD;;AAuCA,MAAK,CAAEqB,iBAAP,EAA2B;AAC1B,WAAOO,OAAP;AACA;;AAED,SACC,cAAC,OAAD;AACC,IAAA,IAAI,EAAGvB,KADR;AAEC,IAAA,QAAQ,EAAGC,QAFZ;AAGC,IAAA,QAAQ,EAAGC,eAHZ;AAIC,IAAA,OAAO,EAAGH,WAAW,KAAK;AAJ3B,KAMGwB,OANH,CADD;AAUA;AAED,eAAerC,MAAf","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tStyleSheet,\n\tTouchableOpacity,\n\tText,\n\tView,\n\tPlatform,\n} from 'react-native';\nimport { isArray } from 'lodash';\nimport { LongPressGestureHandler, State } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, useCallback } from '@wordpress/element';\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\n\nconst isAndroid = Platform.OS === 'android';\nconst marginBottom = isAndroid ? -0.5 : 0;\nconst marginLeft = -3;\n\nconst styles = StyleSheet.create( {\n\tcontainer: {\n\t\tflex: 1,\n\t\tpadding: 3,\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tbuttonInactive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tfixedRatio: {\n\t\taspectRatio: 1,\n\t},\n\tbuttonActive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t\tborderRadius: 6,\n\t\tborderColor: '#2e4453',\n\t\tbackgroundColor: '#2e4453',\n\t},\n\tsubscriptInactive: {\n\t\tcolor: '#7b9ab1', // $toolbar-button.\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n\tsubscriptInactiveDark: {\n\t\tcolor: '#a7aaad', // $gray_20.\n\t},\n\tsubscriptActive: {\n\t\tcolor: 'white',\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n} );\n\nexport function Button( props ) {\n\tconst {\n\t\tchildren,\n\t\tonClick,\n\t\tonLongPress,\n\t\tdisabled,\n\t\thint,\n\t\tfixedRatio = true,\n\t\tisPressed,\n\t\t'aria-disabled': ariaDisabled,\n\t\t'data-subscript': subscript,\n\t\ttestID,\n\t\ticon,\n\t\ticonSize,\n\t\tshowTooltip,\n\t\tlabel,\n\t\tshortcut,\n\t\ttooltipPosition,\n\t\tisActiveStyle,\n\t\tcustomContainerStyles,\n\t} = props;\n\tconst preferredColorScheme = usePreferredColorScheme();\n\n\tconst isDisabled = ariaDisabled || disabled;\n\n\tconst containerStyle = [\n\t\tstyles.container,\n\t\tcustomContainerStyles && { ...customContainerStyles },\n\t];\n\n\tconst buttonViewStyle = {\n\t\topacity: isDisabled ? 0.3 : 1,\n\t\t...( fixedRatio && styles.fixedRatio ),\n\t\t...( isPressed ? styles.buttonActive : styles.buttonInactive ),\n\t\t...( isPressed &&\n\t\t\tisActiveStyle?.borderRadius && {\n\t\t\t\tborderRadius: isActiveStyle.borderRadius,\n\t\t\t} ),\n\t\t...( isActiveStyle?.backgroundColor && {\n\t\t\tbackgroundColor: isActiveStyle.backgroundColor,\n\t\t} ),\n\t};\n\n\tconst states = [];\n\tif ( isPressed ) {\n\t\tstates.push( 'selected' );\n\t}\n\n\tif ( isDisabled ) {\n\t\tstates.push( 'disabled' );\n\t}\n\n\tconst subscriptInactive = usePreferredColorSchemeStyle(\n\t\tstyles.subscriptInactive,\n\t\tstyles.subscriptInactiveDark\n\t);\n\n\tconst newChildren = Children.map( children, ( child ) => {\n\t\treturn child\n\t\t\t? cloneElement( child, {\n\t\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\t\tisPressed,\n\t\t\t } )\n\t\t\t: child;\n\t} );\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! isDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t( ! children ||\n\t\t\t\t\t( isArray( children ) && ! children.length ) ) &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst newIcon = icon\n\t\t? cloneElement( <Icon icon={ icon } size={ iconSize } />, {\n\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\tisPressed,\n\t\t } )\n\t\t: null;\n\n\tconst longPressHandler = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tif ( nativeEvent.state === State.ACTIVE && onLongPress ) {\n\t\t\t\tonLongPress();\n\t\t\t}\n\t\t},\n\t\t[ onLongPress ]\n\t);\n\n\tconst element = (\n\t\t<TouchableOpacity\n\t\t\tactiveOpacity={ 0.7 }\n\t\t\taccessible={ true }\n\t\t\taccessibilityLabel={ label }\n\t\t\taccessibilityStates={ states }\n\t\t\taccessibilityRole={ 'button' }\n\t\t\taccessibilityHint={ hint }\n\t\t\tonPress={ onClick }\n\t\t\tstyle={ containerStyle }\n\t\t\tdisabled={ isDisabled }\n\t\t\ttestID={ testID }\n\t\t>\n\t\t\t<LongPressGestureHandler\n\t\t\t\tminDurationMs={ 500 }\n\t\t\t\tmaxDist={ 150 }\n\t\t\t\tonHandlerStateChange={ longPressHandler }\n\t\t\t>\n\t\t\t\t<View style={ buttonViewStyle }>\n\t\t\t\t\t<View style={ { flexDirection: 'row' } }>\n\t\t\t\t\t\t{ newIcon }\n\t\t\t\t\t\t{ newChildren }\n\t\t\t\t\t\t{ subscript && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tisPressed\n\t\t\t\t\t\t\t\t\t\t? styles.subscriptActive\n\t\t\t\t\t\t\t\t\t\t: subscriptInactive\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ subscript }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</LongPressGestureHandler>\n\t\t</TouchableOpacity>\n\t);\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn element;\n\t}\n\n\treturn (\n\t\t<Tooltip\n\t\t\ttext={ label }\n\t\t\tshortcut={ shortcut }\n\t\t\tposition={ tooltipPosition }\n\t\t\tvisible={ showTooltip === true }\n\t\t>\n\t\t\t{ element }\n\t\t</Tooltip>\n\t);\n}\n\nexport default Button;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/button/index.native.js"],"names":["StyleSheet","TouchableOpacity","Text","View","Platform","LongPressGestureHandler","State","Children","cloneElement","useCallback","usePreferredColorScheme","usePreferredColorSchemeStyle","Tooltip","Icon","isAndroid","OS","marginBottom","marginLeft","styles","create","container","flex","padding","justifyContent","alignItems","buttonInactive","flexDirection","fixedRatio","aspectRatio","buttonActive","borderRadius","borderColor","backgroundColor","subscriptInactive","color","fontWeight","fontSize","alignSelf","subscriptInactiveDark","subscriptActive","Button","props","children","onClick","onLongPress","disabled","hint","isPressed","ariaDisabled","subscript","testID","icon","iconSize","showTooltip","label","shortcut","tooltipPosition","isActiveStyle","customContainerStyles","preferredColorScheme","isDisabled","containerStyle","buttonViewStyle","opacity","states","push","newChildren","map","child","colorScheme","shouldShowTooltip","Array","isArray","length","newIcon","longPressHandler","nativeEvent","state","ACTIVE","element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,CAACqB,eADD,GAENN;AAJL,KAOGgB,SAPH,CAJF,CADD,CALD,CAZD,CADD;;AAuCA,MAAK,CAAEqB,iBAAP,EAA2B;AAC1B,WAAOS,OAAP;AACA;;AAED,SACC,cAAC,OAAD;AACC,IAAA,IAAI,EAAGzB,KADR;AAEC,IAAA,QAAQ,EAAGC,QAFZ;AAGC,IAAA,QAAQ,EAAGC,eAHZ;AAIC,IAAA,OAAO,EAAGH,WAAW,KAAK;AAJ3B,KAMG0B,OANH,CADD;AAUA;AAED,eAAevC,MAAf","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tStyleSheet,\n\tTouchableOpacity,\n\tText,\n\tView,\n\tPlatform,\n} from 'react-native';\nimport { LongPressGestureHandler, State } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, useCallback } from '@wordpress/element';\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\n\nconst isAndroid = Platform.OS === 'android';\nconst marginBottom = isAndroid ? -0.5 : 0;\nconst marginLeft = -3;\n\nconst styles = StyleSheet.create( {\n\tcontainer: {\n\t\tflex: 1,\n\t\tpadding: 3,\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tbuttonInactive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tfixedRatio: {\n\t\taspectRatio: 1,\n\t},\n\tbuttonActive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t\tborderRadius: 6,\n\t\tborderColor: '#2e4453',\n\t\tbackgroundColor: '#2e4453',\n\t},\n\tsubscriptInactive: {\n\t\tcolor: '#7b9ab1', // $toolbar-button.\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n\tsubscriptInactiveDark: {\n\t\tcolor: '#a7aaad', // $gray_20.\n\t},\n\tsubscriptActive: {\n\t\tcolor: 'white',\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n} );\n\nexport function Button( props ) {\n\tconst {\n\t\tchildren,\n\t\tonClick,\n\t\tonLongPress,\n\t\tdisabled,\n\t\thint,\n\t\tfixedRatio = true,\n\t\tisPressed,\n\t\t'aria-disabled': ariaDisabled,\n\t\t'data-subscript': subscript,\n\t\ttestID,\n\t\ticon,\n\t\ticonSize,\n\t\tshowTooltip,\n\t\tlabel,\n\t\tshortcut,\n\t\ttooltipPosition,\n\t\tisActiveStyle,\n\t\tcustomContainerStyles,\n\t} = props;\n\tconst preferredColorScheme = usePreferredColorScheme();\n\n\tconst isDisabled = ariaDisabled || disabled;\n\n\tconst containerStyle = [\n\t\tstyles.container,\n\t\tcustomContainerStyles && { ...customContainerStyles },\n\t];\n\n\tconst buttonViewStyle = {\n\t\topacity: isDisabled ? 0.3 : 1,\n\t\t...( fixedRatio && styles.fixedRatio ),\n\t\t...( isPressed ? styles.buttonActive : styles.buttonInactive ),\n\t\t...( isPressed &&\n\t\t\tisActiveStyle?.borderRadius && {\n\t\t\t\tborderRadius: isActiveStyle.borderRadius,\n\t\t\t} ),\n\t\t...( isActiveStyle?.backgroundColor && {\n\t\t\tbackgroundColor: isActiveStyle.backgroundColor,\n\t\t} ),\n\t};\n\n\tconst states = [];\n\tif ( isPressed ) {\n\t\tstates.push( 'selected' );\n\t}\n\n\tif ( isDisabled ) {\n\t\tstates.push( 'disabled' );\n\t}\n\n\tconst subscriptInactive = usePreferredColorSchemeStyle(\n\t\tstyles.subscriptInactive,\n\t\tstyles.subscriptInactiveDark\n\t);\n\n\tconst newChildren = Children.map( children, ( child ) => {\n\t\treturn child\n\t\t\t? cloneElement( child, {\n\t\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\t\tisPressed,\n\t\t\t } )\n\t\t\t: child;\n\t} );\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! isDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t( ! children ||\n\t\t\t\t\t( Array.isArray( children ) && ! children.length ) ) &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst newIcon = icon\n\t\t? cloneElement( <Icon icon={ icon } size={ iconSize } />, {\n\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\tisPressed,\n\t\t } )\n\t\t: null;\n\n\tconst longPressHandler = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tif ( nativeEvent.state === State.ACTIVE && onLongPress ) {\n\t\t\t\tonLongPress();\n\t\t\t}\n\t\t},\n\t\t[ onLongPress ]\n\t);\n\n\tconst element = (\n\t\t<TouchableOpacity\n\t\t\tactiveOpacity={ 0.7 }\n\t\t\taccessible={ true }\n\t\t\taccessibilityLabel={ label }\n\t\t\taccessibilityStates={ states }\n\t\t\taccessibilityRole={ 'button' }\n\t\t\taccessibilityHint={ hint }\n\t\t\tonPress={ onClick }\n\t\t\tstyle={ containerStyle }\n\t\t\tdisabled={ isDisabled }\n\t\t\ttestID={ testID }\n\t\t>\n\t\t\t<LongPressGestureHandler\n\t\t\t\tminDurationMs={ 500 }\n\t\t\t\tmaxDist={ 150 }\n\t\t\t\tonHandlerStateChange={ longPressHandler }\n\t\t\t>\n\t\t\t\t<View style={ buttonViewStyle }>\n\t\t\t\t\t<View style={ { flexDirection: 'row' } }>\n\t\t\t\t\t\t{ newIcon }\n\t\t\t\t\t\t{ newChildren }\n\t\t\t\t\t\t{ subscript && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tisPressed\n\t\t\t\t\t\t\t\t\t\t? styles.subscriptActive\n\t\t\t\t\t\t\t\t\t\t: subscriptInactive\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ subscript }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</LongPressGestureHandler>\n\t\t</TouchableOpacity>\n\t);\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn element;\n\t}\n\n\treturn (\n\t\t<Tooltip\n\t\t\ttext={ label }\n\t\t\tshortcut={ shortcut }\n\t\t\tposition={ tooltipPosition }\n\t\t\tvisible={ showTooltip === true }\n\t\t>\n\t\t\t{ element }\n\t\t</Tooltip>\n\t);\n}\n\nexport default Button;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/components/src/checkbox-control/index.tsx"],"names":["classnames","useState","useInstanceId","useRefEffect","deprecated","Icon","check","reset","BaseControl","CheckboxControl","props","label","className","heading","checked","indeterminate","help","onChange","additionalProps","alternative","since","showCheckedIcon","setShowCheckedIcon","showIndeterminateIcon","setShowIndeterminateIcon","ref","node","matches","instanceId","id","onChangeValue","event","target","undefined"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;;AAGA;AACA;AACA;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,aAAT,EAAwBC,YAAxB,QAA4C,oBAA5C;AACA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,IAAT,EAAeC,KAAf,EAAsBC,KAAtB,QAAmC,kBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,iBAAxB;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OA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AIC,IAAA,SAAS,EAAGhB,UAAU,CAAE,6BAAF,EAAiCY,SAAjC;AAJvB,KAMC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC;AACC,IAAA,GAAG,EAAGa,GADP;AAEC,IAAA,EAAE,EAAGI,EAFN;AAGC,IAAA,SAAS,EAAC,oCAHX;AAIC,IAAA,IAAI,EAAC,UAJN;AAKC,IAAA,KAAK,EAAC,GALP;AAMC,IAAA,QAAQ,EAAGC,aANZ;AAOC,IAAA,OAAO,EAAGhB,OAPX;AAQC,wBAAmB,CAAC,CAAEE,IAAH,GAAUa,EAAE,GAAG,QAAf,GAA0BI;AAR9C,KASMf,eATN,EADD,EAYGK,qBAAqB,GACtB,cAAC,IAAD;AACC,IAAA,IAAI,EAAGhB,KADR;AAEC,IAAA,SAAS,EAAC,4CAFX;AAGC,IAAA,IAAI,EAAC;AAHN,IADsB,GAMnB,IAlBL,EAmBGc,eAAe,GAChB,cAAC,IAAD;AACC,IAAA,IAAI,EAAGf,KADR;AAEC,IAAA,SAAS,EAAC,sCAFX;AAGC,IAAA,IAAI,EAAC;AAHN,IADgB,GAMb,IAzBL,CAND,EAiCC;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,OAAO,EAAGuB;AAFX,KAIGlB,KAJH,CAjCD,CADD;AA0CA;AAED,eAAeF,eAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useInstanceId, useRefEffect } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\nimport { Icon, check, reset } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { CheckboxControlProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * Checkboxes allow the user to select one or more items from a set.\n *\n * ```jsx\n * import { CheckboxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCheckboxControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <CheckboxControl\n * label=\"Is author\"\n * help=\"Is the user a author or not?\"\n * checked={ isChecked }\n * onChange={ setChecked }\n * />\n * );\n * };\n * ```\n */\nexport function CheckboxControl(\n\t// ref is omitted until we have `WordPressComponentPropsWithoutRef` or add\n\t// ref forwarding to CheckboxControl.\n\tprops: Omit<\n\t\tWordPressComponentProps< CheckboxControlProps, 'input', false >,\n\t\t'ref'\n\t>\n) {\n\tconst {\n\t\tlabel,\n\t\tclassName,\n\t\theading,\n\t\tchecked,\n\t\tindeterminate,\n\t\thelp,\n\t\tonChange,\n\t\t...additionalProps\n\t} = props;\n\n\tif ( heading ) {\n\t\tdeprecated( '`heading` prop in `CheckboxControl`', {\n\t\t\talternative: 'a separate element to implement a heading',\n\t\t\tsince: '5.8',\n\t\t} );\n\t}\n\n\tconst [ showCheckedIcon, setShowCheckedIcon ] = useState( false );\n\tconst [ showIndeterminateIcon, setShowIndeterminateIcon ] = useState(\n\t\tfalse\n\t);\n\n\t// Run the following callback every time the `ref` (and the additional\n\t// dependencies) change.\n\tconst ref = useRefEffect< HTMLInputElement >(\n\t\t( node ) => {\n\t\t\tif ( ! node ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// It cannot be set using an HTML attribute.\n\t\t\tnode.indeterminate = !! indeterminate;\n\n\t\t\tsetShowCheckedIcon( node.matches( ':checked' ) );\n\t\t\tsetShowIndeterminateIcon( node.matches( ':indeterminate' ) );\n\t\t},\n\t\t[ checked, indeterminate ]\n\t);\n\tconst instanceId = useInstanceId( CheckboxControl );\n\tconst id = `inspector-checkbox-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.checked );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tlabel={ heading }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ classnames( 'components-checkbox-control', className ) }\n\t\t>\n\t\t\t<span className=\"components-checkbox-control__input-container\">\n\t\t\t\t<input\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tclassName=\"components-checkbox-control__input\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tvalue=\"1\"\n\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\tchecked={ checked }\n\t\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t/>\n\t\t\t\t{ showIndeterminateIcon ? (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ reset }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__indeterminate\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t\t{ showCheckedIcon ? (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__checked\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t</span>\n\t\t\t<label\n\t\t\t\tclassName=\"components-checkbox-control__label\"\n\t\t\t\thtmlFor={ id }\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t</BaseControl>\n\t);\n}\n\nexport default CheckboxControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/components/src/checkbox-control/index.tsx"],"names":["classnames","useState","useInstanceId","useRefEffect","deprecated","Icon","check","reset","BaseControl","CheckboxControl","props","label","className","heading","checked","indeterminate","help","onChange","additionalProps","alternative","since","showCheckedIcon","setShowCheckedIcon","showIndeterminateIcon","setShowIndeterminateIcon","ref","node","matches","instanceId","id","onChangeValue","event","target","undefined"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;;AAGA;AACA;AACA;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,aAAT,EAAwBC,YAAxB,QAA4C,oBAA5C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AAMoB,EAAE,GAAI,8BAA8BD,UAAY,EAAtD;;AACA,QAAME,aAAa,GAAKC,KAAF,IACrBd,QAAQ,CAAEc,KAAK,CAACC,MAAN,CAAalB,OAAf,CADT;;AAGA,SACC,cAAC,WAAD;AACC,IAAA,KAAK,EAAGD,OADT;AAEC,IAAA,EAAE,EAAGgB,EAFN;AAGC,IAAA,IAAI,EAAGb,IAHR;AAIC,IAAA,SAAS,EAAGhB,UAAU,CAAE,6BAAF,EAAiCY,SAAjC;AAJvB,KAMC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC;AACC,IAAA,GAAG,EAAGa,GADP;AAEC,IAAA,EAAE,EAAGI,EAFN;AAGC,IAAA,SAAS,EAAC,oCAHX;AAIC,IAAA,IAAI,EAAC,UAJN;AAKC,IAAA,KAAK,EAAC,GALP;AAMC,IAAA,QAAQ,EAAGC,aANZ;AAOC,IAAA,OAAO,EAAGhB,OAPX;AAQC,wBAAmB,CAAC,CAAEE,IAAH,GAAUa,EAAE,GAAG,QAAf,GAA0BI;AAR9C,KASMf,eATN,EADD,EAYGK,qBAAqB,GACtB,cAAC,IAAD;AACC,IAAA,IAAI,EAAGhB,KADR;AAEC,IAAA,SAAS,EAAC,4CAFX;AAGC,IAAA,IAAI,EAAC;AAHN,IADsB,GAMnB,IAlBL,EAmBGc,eAAe,GAChB,cAAC,IAAD;AACC,IAAA,IAAI,EAAGf,KADR;AAEC,IAAA,SAAS,EAAC,sCAFX;AAGC,IAAA,IAAI,EAAC;AAHN,IADgB,GAMb,IAzBL,CAND,EAiCC;AACC,IAAA,SAAS,EAAC,oCADX;AAEC,IAAA,OAAO,EAAGuB;AAFX,KAIGlB,KAJH,CAjCD,CADD;AA0CA;AAED,eAAeF,eAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useInstanceId, useRefEffect } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\nimport { Icon, check, reset } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { CheckboxControlProps } from './types';\nimport type { WordPressComponentProps } from '../ui/context';\n\n/**\n * Checkboxes allow the user to select one or more items from a set.\n *\n * ```jsx\n * import { CheckboxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCheckboxControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <CheckboxControl\n * label=\"Is author\"\n * help=\"Is the user a author or not?\"\n * checked={ isChecked }\n * onChange={ setChecked }\n * />\n * );\n * };\n * ```\n */\nexport function CheckboxControl(\n\t// ref is omitted until we have `WordPressComponentPropsWithoutRef` or add\n\t// ref forwarding to CheckboxControl.\n\tprops: Omit<\n\t\tWordPressComponentProps< CheckboxControlProps, 'input', false >,\n\t\t'ref'\n\t>\n) {\n\tconst {\n\t\tlabel,\n\t\tclassName,\n\t\theading,\n\t\tchecked,\n\t\tindeterminate,\n\t\thelp,\n\t\tonChange,\n\t\t...additionalProps\n\t} = props;\n\n\tif ( heading ) {\n\t\tdeprecated( '`heading` prop in `CheckboxControl`', {\n\t\t\talternative: 'a separate element to implement a heading',\n\t\t\tsince: '5.8',\n\t\t} );\n\t}\n\n\tconst [ showCheckedIcon, setShowCheckedIcon ] = useState( false );\n\tconst [ showIndeterminateIcon, setShowIndeterminateIcon ] =\n\t\tuseState( false );\n\n\t// Run the following callback every time the `ref` (and the additional\n\t// dependencies) change.\n\tconst ref = useRefEffect< HTMLInputElement >(\n\t\t( node ) => {\n\t\t\tif ( ! node ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// It cannot be set using an HTML attribute.\n\t\t\tnode.indeterminate = !! indeterminate;\n\n\t\t\tsetShowCheckedIcon( node.matches( ':checked' ) );\n\t\t\tsetShowIndeterminateIcon( node.matches( ':indeterminate' ) );\n\t\t},\n\t\t[ checked, indeterminate ]\n\t);\n\tconst instanceId = useInstanceId( CheckboxControl );\n\tconst id = `inspector-checkbox-control-${ instanceId }`;\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.checked );\n\n\treturn (\n\t\t<BaseControl\n\t\t\tlabel={ heading }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ classnames( 'components-checkbox-control', className ) }\n\t\t>\n\t\t\t<span className=\"components-checkbox-control__input-container\">\n\t\t\t\t<input\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tclassName=\"components-checkbox-control__input\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tvalue=\"1\"\n\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\tchecked={ checked }\n\t\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t/>\n\t\t\t\t{ showIndeterminateIcon ? (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ reset }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__indeterminate\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t\t{ showCheckedIcon ? (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__checked\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t</span>\n\t\t\t<label\n\t\t\t\tclassName=\"components-checkbox-control__label\"\n\t\t\t\thtmlFor={ id }\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</label>\n\t\t</BaseControl>\n\t);\n}\n\nexport default CheckboxControl;\n"]}
@@ -1,25 +1,46 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { createElement } from "@wordpress/element";
3
- // @ts-nocheck
4
3
 
5
4
  /**
6
5
  * External dependencies
7
6
  */
8
7
  import classnames from 'classnames';
9
8
 
10
- const ColorIndicator = _ref => {
11
- let {
9
+ /**
10
+ * WordPress dependencies
11
+ */
12
+ import { forwardRef } from '@wordpress/element';
13
+ /**
14
+ * Internal dependencies
15
+ */
16
+
17
+ function UnforwardedColorIndicator(props, forwardedRef) {
18
+ const {
12
19
  className,
13
20
  colorValue,
14
- ...props
15
- } = _ref;
21
+ ...additionalProps
22
+ } = props;
16
23
  return createElement("span", _extends({
17
24
  className: classnames('component-color-indicator', className),
18
25
  style: {
19
26
  background: colorValue
20
- }
21
- }, props));
22
- };
27
+ },
28
+ ref: forwardedRef
29
+ }, additionalProps));
30
+ }
31
+ /**
32
+ * ColorIndicator is a React component that renders a specific color in a
33
+ * circle. It's often used to summarize a collection of used colors in a child
34
+ * component.
35
+ *
36
+ * ```jsx
37
+ * import { ColorIndicator } from '@wordpress/components';
38
+ *
39
+ * const MyColorIndicator = () => <ColorIndicator colorValue="#0073aa" />;
40
+ * ```
41
+ */
42
+
23
43
 
44
+ export const ColorIndicator = forwardRef(UnforwardedColorIndicator);
24
45
  export default ColorIndicator;
25
46
  //# sourceMappingURL=index.js.map