@wordpress/components 28.9.0 → 28.10.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 (689) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/build/alignment-matrix-control/icon.js.map +1 -1
  3. package/build/alignment-matrix-control/types.js.map +1 -1
  4. package/build/alignment-matrix-control/utils.js.map +1 -1
  5. package/build/angle-picker-control/angle-circle.js.map +1 -1
  6. package/build/autocomplete/autocompleter-ui.js +3 -3
  7. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  8. package/build/autocomplete/get-default-use-items.js.map +1 -1
  9. package/build/autocomplete/index.js +1 -0
  10. package/build/autocomplete/index.js.map +1 -1
  11. package/build/base-control/hooks.js.map +1 -1
  12. package/build/base-control/index.js.map +1 -1
  13. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  14. package/build/border-box-control/styles.js.map +1 -1
  15. package/build/border-box-control/utils.js.map +1 -1
  16. package/build/border-control/border-control/hook.js.map +1 -1
  17. package/build/border-control/styles.js.map +1 -1
  18. package/build/box-control/axial-input-controls.js.map +1 -1
  19. package/build/box-control/icon.js.map +1 -1
  20. package/build/box-control/index.js.map +1 -1
  21. package/build/box-control/input-controls.js.map +1 -1
  22. package/build/button/index.native.js +1 -1
  23. package/build/button/index.native.js.map +1 -1
  24. package/build/card/card/component.js +1 -1
  25. package/build/card/card/component.js.map +1 -1
  26. package/build/card/styles.js.map +1 -1
  27. package/build/color-palette/index.js.map +1 -1
  28. package/build/color-palette/index.native.js +2 -1
  29. package/build/color-palette/index.native.js.map +1 -1
  30. package/build/color-picker/styles.js.map +1 -1
  31. package/build/combobox-control/index.js +1 -1
  32. package/build/combobox-control/index.js.map +1 -1
  33. package/build/composite/legacy/index.js.map +1 -1
  34. package/build/context/context-connect.js +1 -0
  35. package/build/context/context-connect.js.map +1 -1
  36. package/build/context/context-system-provider.js +1 -1
  37. package/build/context/context-system-provider.js.map +1 -1
  38. package/build/context/get-styled-class-name-from-key.js.map +1 -1
  39. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  40. package/build/custom-gradient-picker/index.js.map +1 -1
  41. package/build/custom-gradient-picker/serializer.js.map +1 -1
  42. package/build/custom-gradient-picker/utils.js.map +1 -1
  43. package/build/custom-select-control-v2/styles.js.map +1 -1
  44. package/build/dashicon/index.js.map +1 -1
  45. package/build/date-time/date/styles.js.map +1 -1
  46. package/build/date-time/time/timezone.js.map +1 -1
  47. package/build/draggable/index.js.map +1 -1
  48. package/build/drop-zone/index.js +1 -2
  49. package/build/drop-zone/index.js.map +1 -1
  50. package/build/dropdown-menu-v2/styles.js.map +1 -1
  51. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  52. package/build/duotone-picker/utils.js.map +1 -1
  53. package/build/elevation/hook.js.map +1 -1
  54. package/build/external-link/index.js +20 -23
  55. package/build/external-link/index.js.map +1 -1
  56. package/build/focal-point-picker/index.js.map +1 -1
  57. package/build/focal-point-picker/index.native.js.map +1 -1
  58. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  59. package/build/font-size-picker/index.js.map +1 -1
  60. package/build/form-token-field/index.js +2 -1
  61. package/build/form-token-field/index.js.map +1 -1
  62. package/build/form-token-field/suggestions-list.js.map +1 -1
  63. package/build/form-token-field/token-input.js.map +1 -1
  64. package/build/form-token-field/token.js +1 -1
  65. package/build/form-token-field/token.js.map +1 -1
  66. package/build/gradient-picker/index.js.map +1 -1
  67. package/build/grid/hook.js.map +1 -1
  68. package/build/guide/page-control.js +1 -1
  69. package/build/guide/page-control.js.map +1 -1
  70. package/build/h-stack/hook.js.map +1 -1
  71. package/build/heading/hook.js.map +1 -1
  72. package/build/input-control/index.js.map +1 -1
  73. package/build/input-control/input-base.js.map +1 -1
  74. package/build/input-control/styles/input-control-styles.js.map +1 -1
  75. package/build/item-group/styles.js.map +1 -1
  76. package/build/menu-group/index.js.map +1 -1
  77. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  78. package/build/mobile/bottom-sheet/cell.native.js +4 -4
  79. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  80. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  81. package/build/mobile/bottom-sheet/range-cell.native.js +1 -1
  82. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  83. package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  84. package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -1
  85. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  86. package/build/mobile/bottom-sheet/switch-cell.native.js +4 -4
  87. package/build/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  88. package/build/mobile/cycle-select-control/index.native.js.map +1 -1
  89. package/build/mobile/gradient/index.native.js.map +1 -1
  90. package/build/mobile/image/index.native.js.map +1 -1
  91. package/build/mobile/link-picker/index.native.js +1 -1
  92. package/build/mobile/link-picker/index.native.js.map +1 -1
  93. package/build/mobile/link-picker/link-picker-results.native.js.map +1 -1
  94. package/build/mobile/picker/index.android.js.map +1 -1
  95. package/build/mobile/segmented-control/index.native.js.map +1 -1
  96. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  97. package/build/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  98. package/build/modal/aria-helper.js +2 -1
  99. package/build/modal/aria-helper.js.map +1 -1
  100. package/build/modal/index.js +2 -1
  101. package/build/modal/index.js.map +1 -1
  102. package/build/modal/use-modal-exit-animation.js.map +1 -1
  103. package/build/navigation/group/index.js.map +1 -1
  104. package/build/navigation/item/base.js.map +1 -1
  105. package/build/navigation/menu/index.js.map +1 -1
  106. package/build/navigation/menu/menu-title-search.js +2 -2
  107. package/build/navigation/menu/menu-title-search.js.map +1 -1
  108. package/build/navigation/menu/menu-title.js.map +1 -1
  109. package/build/navigation/styles/navigation-styles.js.map +1 -1
  110. package/build/navigator/navigator/component.js.map +1 -1
  111. package/build/navigator/navigator-button/hook.js.map +1 -1
  112. package/build/number-control/styles/number-control-styles.js.map +1 -1
  113. package/build/palette-edit/index.js +25 -2
  114. package/build/palette-edit/index.js.map +1 -1
  115. package/build/popover/index.js +1 -1
  116. package/build/popover/index.js.map +1 -1
  117. package/build/popover/overlay-middlewares.js.map +1 -1
  118. package/build/popover/utils.js.map +1 -1
  119. package/build/progress-bar/index.js.map +1 -1
  120. package/build/progress-bar/styles.js.map +1 -1
  121. package/build/query-controls/index.js.map +1 -1
  122. package/build/query-controls/index.native.js.map +1 -1
  123. package/build/radio-control/index.js.map +1 -1
  124. package/build/radio-control/index.native.js.map +1 -1
  125. package/build/range-control/index.js.map +1 -1
  126. package/build/range-control/index.native.js.map +1 -1
  127. package/build/range-control/rail.js.map +1 -1
  128. package/build/range-control/styles/range-control-styles.js +32 -32
  129. package/build/range-control/styles/range-control-styles.js.map +1 -1
  130. package/build/range-control/tooltip.js +1 -1
  131. package/build/range-control/tooltip.js.map +1 -1
  132. package/build/range-control/utils.js.map +1 -1
  133. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  134. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  135. package/build/responsive-wrapper/index.js.map +1 -1
  136. package/build/sandbox/index.js.map +1 -1
  137. package/build/sandbox/index.native.js.map +1 -1
  138. package/build/search-control/index.js +6 -0
  139. package/build/search-control/index.js.map +1 -1
  140. package/build/search-control/index.native.js.map +1 -1
  141. package/build/search-control/types.js.map +1 -1
  142. package/build/select-control/index.js.map +1 -1
  143. package/build/select-control/index.native.js.map +1 -1
  144. package/build/slot-fill/index.js.map +1 -1
  145. package/build/spinner/styles.js.map +1 -1
  146. package/build/style-provider/index.js +1 -0
  147. package/build/style-provider/index.js.map +1 -1
  148. package/build/surface/hook.js.map +1 -1
  149. package/build/surface/styles.js.map +1 -1
  150. package/build/tab-panel/index.js.map +1 -1
  151. package/build/tabs/index.js.map +1 -1
  152. package/build/tabs/styles.js +30 -12
  153. package/build/tabs/styles.js.map +1 -1
  154. package/build/tabs/tab.js +7 -2
  155. package/build/tabs/tab.js.map +1 -1
  156. package/build/tabs/tablist.js +47 -48
  157. package/build/tabs/tablist.js.map +1 -1
  158. package/build/tabs/tabpanel.js.map +1 -1
  159. package/build/text/get-line-height.js.map +1 -1
  160. package/build/text/styles/text-mixins.native.js.map +1 -1
  161. package/build/text/utils.js.map +1 -1
  162. package/build/text-control/index.native.js.map +1 -1
  163. package/build/text-highlight/index.js.map +1 -1
  164. package/build/textarea-control/index.js.map +1 -1
  165. package/build/theme/color-algorithms.js.map +1 -1
  166. package/build/theme/styles.js.map +1 -1
  167. package/build/toggle-control/index.js.map +1 -1
  168. package/build/toggle-control/index.native.js.map +1 -1
  169. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +9 -1
  170. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  171. package/build/toggle-group-control/toggle-group-control/component.js +2 -60
  172. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  173. package/build/toggle-group-control/toggle-group-control-option-base/component.js +10 -10
  174. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  175. package/build/toggle-group-control/types.js.map +1 -1
  176. package/build/toolbar/toolbar/index.js.map +1 -1
  177. package/build/tools-panel/styles.js.map +1 -1
  178. package/build/tooltip/index.js +5 -1
  179. package/build/tooltip/index.js.map +1 -1
  180. package/build/unit-control/index.js.map +1 -1
  181. package/build/unit-control/utils.js.map +1 -1
  182. package/build/utils/breakpoint.js.map +1 -1
  183. package/build/utils/colors-values.js.map +1 -1
  184. package/build/utils/config-values.js.map +1 -1
  185. package/build/utils/font-size.js.map +1 -1
  186. package/build/utils/hooks/use-animated-offset-rect.js +80 -0
  187. package/build/utils/hooks/use-animated-offset-rect.js.map +1 -0
  188. package/build/utils/hooks/use-cx.js.map +1 -1
  189. package/build/utils/math.js +2 -2
  190. package/build/utils/math.js.map +1 -1
  191. package/build/utils/space.js.map +1 -1
  192. package/build/utils/unit-values.js.map +1 -1
  193. package/build/utils/use-responsive-value.js.map +1 -1
  194. package/build-module/alignment-matrix-control/cell.js +1 -2
  195. package/build-module/alignment-matrix-control/cell.js.map +1 -1
  196. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  197. package/build-module/alignment-matrix-control/types.js.map +1 -1
  198. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  199. package/build-module/angle-picker-control/angle-circle.js.map +1 -1
  200. package/build-module/angle-picker-control/index.js +1 -2
  201. package/build-module/angle-picker-control/index.js.map +1 -1
  202. package/build-module/autocomplete/autocompleter-ui.js +4 -6
  203. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  204. package/build-module/autocomplete/autocompleter-ui.native.js +1 -2
  205. package/build-module/autocomplete/autocompleter-ui.native.js.map +1 -1
  206. package/build-module/autocomplete/get-default-use-items.js.map +1 -1
  207. package/build-module/autocomplete/index.js +2 -3
  208. package/build-module/autocomplete/index.js.map +1 -1
  209. package/build-module/base-control/hooks.js.map +1 -1
  210. package/build-module/base-control/index.js +1 -2
  211. package/build-module/base-control/index.js.map +1 -1
  212. package/build-module/base-control/index.native.js +1 -2
  213. package/build-module/base-control/index.native.js.map +1 -1
  214. package/build-module/border-box-control/border-box-control/component.js +1 -2
  215. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  216. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  217. package/build-module/border-box-control/border-box-control-split-controls/component.js +1 -2
  218. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  219. package/build-module/border-box-control/styles.js.map +1 -1
  220. package/build-module/border-box-control/utils.js.map +1 -1
  221. package/build-module/border-control/border-control/component.js +1 -2
  222. package/build-module/border-control/border-control/component.js.map +1 -1
  223. package/build-module/border-control/border-control/hook.js.map +1 -1
  224. package/build-module/border-control/border-control-dropdown/component.js +1 -3
  225. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  226. package/build-module/border-control/styles.js.map +1 -1
  227. package/build-module/box-control/all-input-control.js +1 -3
  228. package/build-module/box-control/all-input-control.js.map +1 -1
  229. package/build-module/box-control/axial-input-controls.js +1 -3
  230. package/build-module/box-control/axial-input-controls.js.map +1 -1
  231. package/build-module/box-control/icon.js +1 -2
  232. package/build-module/box-control/icon.js.map +1 -1
  233. package/build-module/box-control/index.js +1 -2
  234. package/build-module/box-control/index.js.map +1 -1
  235. package/build-module/box-control/input-controls.js +1 -3
  236. package/build-module/box-control/input-controls.js.map +1 -1
  237. package/build-module/button/index.js +1 -3
  238. package/build-module/button/index.js.map +1 -1
  239. package/build-module/button/index.native.js +2 -3
  240. package/build-module/button/index.native.js.map +1 -1
  241. package/build-module/card/card/component.js +2 -3
  242. package/build-module/card/card/component.js.map +1 -1
  243. package/build-module/card/styles.js.map +1 -1
  244. package/build-module/checkbox-control/index.js +1 -2
  245. package/build-module/checkbox-control/index.js.map +1 -1
  246. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -2
  247. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  248. package/build-module/circular-option-picker/circular-option-picker.js +1 -2
  249. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  250. package/build-module/color-indicator/index.native.js +1 -2
  251. package/build-module/color-indicator/index.native.js.map +1 -1
  252. package/build-module/color-palette/index.js +1 -2
  253. package/build-module/color-palette/index.js.map +1 -1
  254. package/build-module/color-palette/index.native.js +3 -4
  255. package/build-module/color-palette/index.native.js.map +1 -1
  256. package/build-module/color-picker/component.js +1 -2
  257. package/build-module/color-picker/component.js.map +1 -1
  258. package/build-module/color-picker/hsl-input.js +1 -3
  259. package/build-module/color-picker/hsl-input.js.map +1 -1
  260. package/build-module/color-picker/hsv-color-picker.native.js +1 -2
  261. package/build-module/color-picker/hsv-color-picker.native.js.map +1 -1
  262. package/build-module/color-picker/hue-picker.native.js +1 -2
  263. package/build-module/color-picker/hue-picker.native.js.map +1 -1
  264. package/build-module/color-picker/index.native.js +1 -3
  265. package/build-module/color-picker/index.native.js.map +1 -1
  266. package/build-module/color-picker/input-with-slider.js +1 -2
  267. package/build-module/color-picker/input-with-slider.js.map +1 -1
  268. package/build-module/color-picker/rgb-input.js +1 -3
  269. package/build-module/color-picker/rgb-input.js.map +1 -1
  270. package/build-module/color-picker/saturation-picker.native.js +1 -2
  271. package/build-module/color-picker/saturation-picker.native.js.map +1 -1
  272. package/build-module/color-picker/styles.js.map +1 -1
  273. package/build-module/combobox-control/index.js +2 -3
  274. package/build-module/combobox-control/index.js.map +1 -1
  275. package/build-module/composite/legacy/index.js.map +1 -1
  276. package/build-module/confirm-dialog/component.js +1 -3
  277. package/build-module/confirm-dialog/component.js.map +1 -1
  278. package/build-module/context/context-connect.js +1 -0
  279. package/build-module/context/context-connect.js.map +1 -1
  280. package/build-module/context/context-system-provider.js +1 -1
  281. package/build-module/context/context-system-provider.js.map +1 -1
  282. package/build-module/context/get-styled-class-name-from-key.js.map +1 -1
  283. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +1 -3
  284. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  285. package/build-module/custom-gradient-picker/gradient-bar/index.js +1 -2
  286. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  287. package/build-module/custom-gradient-picker/index.js +1 -2
  288. package/build-module/custom-gradient-picker/index.js.map +1 -1
  289. package/build-module/custom-gradient-picker/index.native.js +1 -3
  290. package/build-module/custom-gradient-picker/index.native.js.map +1 -1
  291. package/build-module/custom-gradient-picker/serializer.js.map +1 -1
  292. package/build-module/custom-gradient-picker/utils.js.map +1 -1
  293. package/build-module/custom-select-control/index.js +1 -3
  294. package/build-module/custom-select-control/index.js.map +1 -1
  295. package/build-module/custom-select-control-v2/custom-select.js +1 -2
  296. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  297. package/build-module/custom-select-control-v2/item.js +1 -2
  298. package/build-module/custom-select-control-v2/item.js.map +1 -1
  299. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  300. package/build-module/dashicon/index.js.map +1 -1
  301. package/build-module/date-time/date/index.js +1 -2
  302. package/build-module/date-time/date/index.js.map +1 -1
  303. package/build-module/date-time/date/styles.js.map +1 -1
  304. package/build-module/date-time/date-time/index.js +1 -3
  305. package/build-module/date-time/date-time/index.js.map +1 -1
  306. package/build-module/date-time/time/index.js +1 -2
  307. package/build-module/date-time/time/index.js.map +1 -1
  308. package/build-module/date-time/time/time-input/index.js +1 -2
  309. package/build-module/date-time/time/time-input/index.js.map +1 -1
  310. package/build-module/date-time/time/timezone.js.map +1 -1
  311. package/build-module/dimension-control/index.js +1 -3
  312. package/build-module/dimension-control/index.js.map +1 -1
  313. package/build-module/draggable/index.js +1 -3
  314. package/build-module/draggable/index.js.map +1 -1
  315. package/build-module/drop-zone/index.js +2 -4
  316. package/build-module/drop-zone/index.js.map +1 -1
  317. package/build-module/dropdown/index.js +1 -2
  318. package/build-module/dropdown/index.js.map +1 -1
  319. package/build-module/dropdown/index.native.js +1 -2
  320. package/build-module/dropdown/index.native.js.map +1 -1
  321. package/build-module/dropdown-menu/index.js +1 -2
  322. package/build-module/dropdown-menu/index.js.map +1 -1
  323. package/build-module/dropdown-menu/index.native.js +1 -2
  324. package/build-module/dropdown-menu/index.native.js.map +1 -1
  325. package/build-module/dropdown-menu-v2/checkbox-item.js +1 -2
  326. package/build-module/dropdown-menu-v2/checkbox-item.js.map +1 -1
  327. package/build-module/dropdown-menu-v2/index.js +1 -3
  328. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  329. package/build-module/dropdown-menu-v2/item.js +1 -2
  330. package/build-module/dropdown-menu-v2/item.js.map +1 -1
  331. package/build-module/dropdown-menu-v2/radio-item.js +1 -2
  332. package/build-module/dropdown-menu-v2/radio-item.js.map +1 -1
  333. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  334. package/build-module/duotone-picker/color-list-picker/index.js +1 -3
  335. package/build-module/duotone-picker/color-list-picker/index.js.map +1 -1
  336. package/build-module/duotone-picker/duotone-picker.js +1 -2
  337. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  338. package/build-module/duotone-picker/utils.js.map +1 -1
  339. package/build-module/elevation/hook.js.map +1 -1
  340. package/build-module/external-link/index.js +21 -25
  341. package/build-module/external-link/index.js.map +1 -1
  342. package/build-module/external-link/index.native.js +1 -2
  343. package/build-module/external-link/index.native.js.map +1 -1
  344. package/build-module/focal-point-picker/controls.js +1 -2
  345. package/build-module/focal-point-picker/controls.js.map +1 -1
  346. package/build-module/focal-point-picker/focal-point.native.js +1 -2
  347. package/build-module/focal-point-picker/focal-point.native.js.map +1 -1
  348. package/build-module/focal-point-picker/grid.js +1 -2
  349. package/build-module/focal-point-picker/grid.js.map +1 -1
  350. package/build-module/focal-point-picker/index.js +1 -2
  351. package/build-module/focal-point-picker/index.js.map +1 -1
  352. package/build-module/focal-point-picker/index.native.js +1 -2
  353. package/build-module/focal-point-picker/index.native.js.map +1 -1
  354. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  355. package/build-module/focal-point-picker/tooltip/index.native.js +1 -2
  356. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  357. package/build-module/font-size-picker/index.js +1 -2
  358. package/build-module/font-size-picker/index.js.map +1 -1
  359. package/build-module/font-size-picker/index.native.js +1 -3
  360. package/build-module/font-size-picker/index.native.js.map +1 -1
  361. package/build-module/form-file-upload/index.js +1 -2
  362. package/build-module/form-file-upload/index.js.map +1 -1
  363. package/build-module/form-toggle/index.js +1 -2
  364. package/build-module/form-toggle/index.js.map +1 -1
  365. package/build-module/form-token-field/index.js +3 -3
  366. package/build-module/form-token-field/index.js.map +1 -1
  367. package/build-module/form-token-field/suggestions-list.js +1 -2
  368. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  369. package/build-module/form-token-field/token-input.js.map +1 -1
  370. package/build-module/form-token-field/token.js +2 -3
  371. package/build-module/form-token-field/token.js.map +1 -1
  372. package/build-module/gradient-picker/index.js +1 -2
  373. package/build-module/gradient-picker/index.js.map +1 -1
  374. package/build-module/grid/hook.js.map +1 -1
  375. package/build-module/guide/index.js +1 -2
  376. package/build-module/guide/index.js.map +1 -1
  377. package/build-module/guide/page-control.js +1 -1
  378. package/build-module/guide/page-control.js.map +1 -1
  379. package/build-module/h-stack/hook.js.map +1 -1
  380. package/build-module/heading/hook.js.map +1 -1
  381. package/build-module/higher-order/with-fallback-styles/index.js +3 -4
  382. package/build-module/higher-order/with-fallback-styles/index.js.map +1 -1
  383. package/build-module/input-control/index.js.map +1 -1
  384. package/build-module/input-control/input-base.js +1 -2
  385. package/build-module/input-control/input-base.js.map +1 -1
  386. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  387. package/build-module/item-group/styles.js.map +1 -1
  388. package/build-module/keyboard-shortcuts/index.js +1 -3
  389. package/build-module/keyboard-shortcuts/index.js.map +1 -1
  390. package/build-module/menu-group/index.js +1 -2
  391. package/build-module/menu-group/index.js.map +1 -1
  392. package/build-module/menu-item/index.js +1 -2
  393. package/build-module/menu-item/index.js.map +1 -1
  394. package/build-module/menu-items-choice/index.js +1 -2
  395. package/build-module/menu-items-choice/index.js.map +1 -1
  396. package/build-module/mobile/badge/index.native.js +1 -3
  397. package/build-module/mobile/badge/index.native.js.map +1 -1
  398. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -2
  399. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  400. package/build-module/mobile/bottom-sheet/cell.native.js +5 -6
  401. package/build-module/mobile/bottom-sheet/cell.native.js.map +1 -1
  402. package/build-module/mobile/bottom-sheet/color-cell.native.js +1 -2
  403. package/build-module/mobile/bottom-sheet/color-cell.native.js.map +1 -1
  404. package/build-module/mobile/bottom-sheet/index.native.js +1 -3
  405. package/build-module/mobile/bottom-sheet/index.native.js.map +1 -1
  406. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -2
  407. package/build-module/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  408. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -2
  409. package/build-module/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  410. package/build-module/mobile/bottom-sheet/range-cell.native.js +2 -3
  411. package/build-module/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  412. package/build-module/mobile/bottom-sheet/range-text-input.native.js +1 -2
  413. package/build-module/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  414. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js +2 -3
  415. package/build-module/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  416. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js +1 -2
  417. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
  418. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js +1 -2
  419. package/build-module/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
  420. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js +1 -3
  421. package/build-module/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  422. package/build-module/mobile/bottom-sheet/switch-cell.native.js +4 -4
  423. package/build-module/mobile/bottom-sheet/switch-cell.native.js.map +1 -1
  424. package/build-module/mobile/bottom-sheet-select-control/index.native.js +1 -3
  425. package/build-module/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  426. package/build-module/mobile/bottom-sheet-text-control/index.native.js +1 -3
  427. package/build-module/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  428. package/build-module/mobile/color-settings/gradient-picker-screen.native.js +1 -2
  429. package/build-module/mobile/color-settings/gradient-picker-screen.native.js.map +1 -1
  430. package/build-module/mobile/color-settings/index.native.js +1 -2
  431. package/build-module/mobile/color-settings/index.native.js.map +1 -1
  432. package/build-module/mobile/color-settings/palette.screen.native.js +1 -3
  433. package/build-module/mobile/color-settings/palette.screen.native.js.map +1 -1
  434. package/build-module/mobile/cycle-select-control/index.native.js.map +1 -1
  435. package/build-module/mobile/focal-point-settings-panel/index.native.js +1 -2
  436. package/build-module/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  437. package/build-module/mobile/gradient/index.native.js +1 -2
  438. package/build-module/mobile/gradient/index.native.js.map +1 -1
  439. package/build-module/mobile/html-text-input/index.native.js +1 -2
  440. package/build-module/mobile/html-text-input/index.native.js.map +1 -1
  441. package/build-module/mobile/image/icon-retry.native.js +1 -2
  442. package/build-module/mobile/image/icon-retry.native.js.map +1 -1
  443. package/build-module/mobile/image/image-editing-button.native.js +1 -2
  444. package/build-module/mobile/image/image-editing-button.native.js.map +1 -1
  445. package/build-module/mobile/image/index.native.js +1 -3
  446. package/build-module/mobile/image/index.native.js.map +1 -1
  447. package/build-module/mobile/keyboard-avoiding-view/index.ios.js +1 -2
  448. package/build-module/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  449. package/build-module/mobile/link-picker/index.native.js +2 -3
  450. package/build-module/mobile/link-picker/index.native.js.map +1 -1
  451. package/build-module/mobile/link-picker/link-picker-results.native.js.map +1 -1
  452. package/build-module/mobile/link-settings/index.native.js +1 -3
  453. package/build-module/mobile/link-settings/index.native.js.map +1 -1
  454. package/build-module/mobile/link-settings/link-settings-navigation.native.js +1 -2
  455. package/build-module/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  456. package/build-module/mobile/picker/index.android.js +1 -2
  457. package/build-module/mobile/picker/index.android.js.map +1 -1
  458. package/build-module/mobile/segmented-control/index.native.js +1 -2
  459. package/build-module/mobile/segmented-control/index.native.js.map +1 -1
  460. package/build-module/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  461. package/build-module/mobile/utils/use-unit-converter-to-mobile.native.js.map +1 -1
  462. package/build-module/modal/aria-helper.js +2 -1
  463. package/build-module/modal/aria-helper.js.map +1 -1
  464. package/build-module/modal/index.js +3 -4
  465. package/build-module/modal/index.js.map +1 -1
  466. package/build-module/modal/use-modal-exit-animation.js.map +1 -1
  467. package/build-module/navigation/back-button/index.js +1 -2
  468. package/build-module/navigation/back-button/index.js.map +1 -1
  469. package/build-module/navigation/group/index.js +1 -2
  470. package/build-module/navigation/group/index.js.map +1 -1
  471. package/build-module/navigation/item/base-content.js +1 -3
  472. package/build-module/navigation/item/base-content.js.map +1 -1
  473. package/build-module/navigation/item/base.js.map +1 -1
  474. package/build-module/navigation/item/index.js +1 -2
  475. package/build-module/navigation/item/index.js.map +1 -1
  476. package/build-module/navigation/menu/index.js +1 -2
  477. package/build-module/navigation/menu/index.js.map +1 -1
  478. package/build-module/navigation/menu/menu-title-search.js +2 -2
  479. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  480. package/build-module/navigation/menu/menu-title.js +1 -2
  481. package/build-module/navigation/menu/menu-title.js.map +1 -1
  482. package/build-module/navigation/menu/search-no-results-found.js +1 -2
  483. package/build-module/navigation/menu/search-no-results-found.js.map +1 -1
  484. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  485. package/build-module/navigator/navigator/component.js.map +1 -1
  486. package/build-module/navigator/navigator-button/hook.js.map +1 -1
  487. package/build-module/notice/index.js +1 -2
  488. package/build-module/notice/index.js.map +1 -1
  489. package/build-module/notice/index.native.js +1 -3
  490. package/build-module/notice/index.native.js.map +1 -1
  491. package/build-module/number-control/index.js +1 -3
  492. package/build-module/number-control/index.js.map +1 -1
  493. package/build-module/number-control/styles/number-control-styles.js.map +1 -1
  494. package/build-module/palette-edit/index.js +25 -5
  495. package/build-module/palette-edit/index.js.map +1 -1
  496. package/build-module/panel/actions.native.js +1 -2
  497. package/build-module/panel/actions.native.js.map +1 -1
  498. package/build-module/panel/body.js +1 -2
  499. package/build-module/panel/body.js.map +1 -1
  500. package/build-module/panel/body.native.js +1 -2
  501. package/build-module/panel/body.native.js.map +1 -1
  502. package/build-module/panel/header.js +1 -2
  503. package/build-module/panel/header.js.map +1 -1
  504. package/build-module/panel/index.js +1 -2
  505. package/build-module/panel/index.js.map +1 -1
  506. package/build-module/placeholder/index.js +1 -2
  507. package/build-module/placeholder/index.js.map +1 -1
  508. package/build-module/popover/index.js +2 -4
  509. package/build-module/popover/index.js.map +1 -1
  510. package/build-module/popover/overlay-middlewares.js.map +1 -1
  511. package/build-module/popover/utils.js.map +1 -1
  512. package/build-module/progress-bar/index.js +1 -2
  513. package/build-module/progress-bar/index.js.map +1 -1
  514. package/build-module/progress-bar/styles.js.map +1 -1
  515. package/build-module/query-controls/index.js.map +1 -1
  516. package/build-module/query-controls/index.native.js +1 -3
  517. package/build-module/query-controls/index.native.js.map +1 -1
  518. package/build-module/radio-control/index.js +1 -2
  519. package/build-module/radio-control/index.js.map +1 -1
  520. package/build-module/radio-control/index.native.js +1 -2
  521. package/build-module/radio-control/index.native.js.map +1 -1
  522. package/build-module/range-control/index.js +1 -2
  523. package/build-module/range-control/index.js.map +1 -1
  524. package/build-module/range-control/index.native.js.map +1 -1
  525. package/build-module/range-control/mark.js +1 -3
  526. package/build-module/range-control/mark.js.map +1 -1
  527. package/build-module/range-control/rail.js +1 -3
  528. package/build-module/range-control/rail.js.map +1 -1
  529. package/build-module/range-control/styles/range-control-styles.js +32 -32
  530. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  531. package/build-module/range-control/tooltip.js +1 -1
  532. package/build-module/range-control/tooltip.js.map +1 -1
  533. package/build-module/range-control/utils.js.map +1 -1
  534. package/build-module/resizable-box/index.js +1 -2
  535. package/build-module/resizable-box/index.js.map +1 -1
  536. package/build-module/resizable-box/resize-tooltip/index.js +1 -2
  537. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  538. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  539. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  540. package/build-module/responsive-wrapper/index.js.map +1 -1
  541. package/build-module/sandbox/index.js +1 -2
  542. package/build-module/sandbox/index.js.map +1 -1
  543. package/build-module/sandbox/index.native.js +1 -2
  544. package/build-module/sandbox/index.native.js.map +1 -1
  545. package/build-module/search-control/index.js +6 -0
  546. package/build-module/search-control/index.js.map +1 -1
  547. package/build-module/search-control/index.native.js +1 -2
  548. package/build-module/search-control/index.native.js.map +1 -1
  549. package/build-module/search-control/types.js.map +1 -1
  550. package/build-module/select-control/index.js.map +1 -1
  551. package/build-module/select-control/index.native.js.map +1 -1
  552. package/build-module/slot-fill/index.js +1 -3
  553. package/build-module/slot-fill/index.js.map +1 -1
  554. package/build-module/slot-fill/slot.js +1 -2
  555. package/build-module/slot-fill/slot.js.map +1 -1
  556. package/build-module/snackbar/index.js +1 -2
  557. package/build-module/snackbar/index.js.map +1 -1
  558. package/build-module/snackbar/list.js +1 -2
  559. package/build-module/snackbar/list.js.map +1 -1
  560. package/build-module/spinner/index.js +1 -2
  561. package/build-module/spinner/index.js.map +1 -1
  562. package/build-module/spinner/styles.js.map +1 -1
  563. package/build-module/style-provider/index.js +1 -0
  564. package/build-module/style-provider/index.js.map +1 -1
  565. package/build-module/surface/hook.js.map +1 -1
  566. package/build-module/surface/styles.js.map +1 -1
  567. package/build-module/tab-panel/index.js +1 -2
  568. package/build-module/tab-panel/index.js.map +1 -1
  569. package/build-module/tabs/index.js.map +1 -1
  570. package/build-module/tabs/styles.js +28 -6
  571. package/build-module/tabs/styles.js.map +1 -1
  572. package/build-module/tabs/tab.js +9 -4
  573. package/build-module/tabs/tab.js.map +1 -1
  574. package/build-module/tabs/tablist.js +47 -48
  575. package/build-module/tabs/tablist.js.map +1 -1
  576. package/build-module/tabs/tabpanel.js.map +1 -1
  577. package/build-module/text/get-line-height.js.map +1 -1
  578. package/build-module/text/styles/text-mixins.native.js.map +1 -1
  579. package/build-module/text/utils.js.map +1 -1
  580. package/build-module/text-control/index.native.js.map +1 -1
  581. package/build-module/text-highlight/index.js +1 -2
  582. package/build-module/text-highlight/index.js.map +1 -1
  583. package/build-module/textarea-control/index.js.map +1 -1
  584. package/build-module/theme/color-algorithms.js.map +1 -1
  585. package/build-module/theme/styles.js.map +1 -1
  586. package/build-module/tip/index.js +1 -2
  587. package/build-module/tip/index.js.map +1 -1
  588. package/build-module/toggle-control/index.js +1 -2
  589. package/build-module/toggle-control/index.js.map +1 -1
  590. package/build-module/toggle-control/index.native.js.map +1 -1
  591. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +10 -2
  592. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  593. package/build-module/toggle-group-control/toggle-group-control/component.js +4 -65
  594. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  595. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +11 -12
  596. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  597. package/build-module/toggle-group-control/types.js.map +1 -1
  598. package/build-module/toolbar/toolbar/index.js.map +1 -1
  599. package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js +2 -2
  600. package/build-module/toolbar/toolbar-button/toolbar-button-container.native.js.map +1 -1
  601. package/build-module/toolbar/toolbar-group/index.js +1 -2
  602. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  603. package/build-module/tools-panel/styles.js.map +1 -1
  604. package/build-module/tools-panel/tools-panel/component.js +1 -2
  605. package/build-module/tools-panel/tools-panel/component.js.map +1 -1
  606. package/build-module/tools-panel/tools-panel-header/component.js +1 -3
  607. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  608. package/build-module/tooltip/index.js +6 -3
  609. package/build-module/tooltip/index.js.map +1 -1
  610. package/build-module/tooltip/index.native.js +1 -3
  611. package/build-module/tooltip/index.native.js.map +1 -1
  612. package/build-module/tree-grid/cell.js +1 -2
  613. package/build-module/tree-grid/cell.js.map +1 -1
  614. package/build-module/unit-control/index.js.map +1 -1
  615. package/build-module/unit-control/index.native.js +1 -3
  616. package/build-module/unit-control/index.native.js.map +1 -1
  617. package/build-module/unit-control/utils.js.map +1 -1
  618. package/build-module/utils/breakpoint.js.map +1 -1
  619. package/build-module/utils/colors-values.js.map +1 -1
  620. package/build-module/utils/config-values.js.map +1 -1
  621. package/build-module/utils/font-size.js.map +1 -1
  622. package/build-module/utils/hooks/use-animated-offset-rect.js +74 -0
  623. package/build-module/utils/hooks/use-animated-offset-rect.js.map +1 -0
  624. package/build-module/utils/hooks/use-cx.js.map +1 -1
  625. package/build-module/utils/math.js +2 -2
  626. package/build-module/utils/math.js.map +1 -1
  627. package/build-module/utils/space.js.map +1 -1
  628. package/build-module/utils/unit-values.js.map +1 -1
  629. package/build-module/utils/use-responsive-value.js.map +1 -1
  630. package/build-style/style-rtl.css +8 -5
  631. package/build-style/style.css +8 -5
  632. package/build-types/alignment-matrix-control/types.d.ts +2 -0
  633. package/build-types/alignment-matrix-control/types.d.ts.map +1 -1
  634. package/build-types/drop-zone/index.d.ts.map +1 -1
  635. package/build-types/modal/aria-helper.d.ts.map +1 -1
  636. package/build-types/palette-edit/index.d.ts +3 -0
  637. package/build-types/palette-edit/index.d.ts.map +1 -1
  638. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  639. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  640. package/build-types/search-control/index.d.ts.map +1 -1
  641. package/build-types/search-control/stories/index.story.d.ts +0 -8
  642. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  643. package/build-types/search-control/types.d.ts +3 -0
  644. package/build-types/search-control/types.d.ts.map +1 -1
  645. package/build-types/tabs/styles.d.ts +7 -0
  646. package/build-types/tabs/styles.d.ts.map +1 -1
  647. package/build-types/tabs/tab.d.ts.map +1 -1
  648. package/build-types/tabs/tablist.d.ts.map +1 -1
  649. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  650. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  651. package/build-types/toggle-group-control/types.d.ts +1 -0
  652. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  653. package/build-types/tooltip/index.d.ts.map +1 -1
  654. package/build-types/utils/hooks/use-animated-offset-rect.d.ts +62 -0
  655. package/build-types/utils/hooks/use-animated-offset-rect.d.ts.map +1 -0
  656. package/package.json +20 -20
  657. package/schemas/docs-manifest.json +38 -0
  658. package/src/alignment-matrix-control/README.md +46 -36
  659. package/src/alignment-matrix-control/docs-manifest.json +12 -0
  660. package/src/alignment-matrix-control/types.ts +2 -0
  661. package/src/angle-picker-control/README.md +36 -23
  662. package/src/angle-picker-control/docs-manifest.json +5 -0
  663. package/src/button/style.scss +5 -1
  664. package/src/composite/test/index.tsx +629 -38
  665. package/src/drop-zone/index.tsx +1 -2
  666. package/src/drop-zone/style.scss +1 -1
  667. package/src/modal/aria-helper.ts +1 -0
  668. package/src/palette-edit/index.tsx +30 -5
  669. package/src/palette-edit/test/index.tsx +50 -1
  670. package/src/range-control/styles/range-control-styles.ts +19 -10
  671. package/src/range-control/tooltip.tsx +1 -1
  672. package/src/search-control/README.md +2 -0
  673. package/src/search-control/index.tsx +7 -0
  674. package/src/search-control/stories/index.story.tsx +0 -15
  675. package/src/search-control/test/index.tsx +4 -1
  676. package/src/search-control/types.ts +3 -0
  677. package/src/tabs/styles.ts +116 -47
  678. package/src/tabs/tab.tsx +8 -2
  679. package/src/tabs/tablist.tsx +48 -49
  680. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +6 -6
  681. package/src/toggle-group-control/test/index.tsx +39 -0
  682. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +11 -1
  683. package/src/toggle-group-control/toggle-group-control/component.tsx +3 -98
  684. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +15 -15
  685. package/src/toggle-group-control/types.ts +1 -0
  686. package/src/tooltip/index.tsx +8 -1
  687. package/src/tooltip/test/index.tsx +78 -0
  688. package/src/utils/hooks/use-animated-offset-rect.ts +107 -0
  689. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_unitValues","require","sides","borderProps","isEmptyBorder","border","some","prop","undefined","exports","isDefinedBorder","hasSplitBorders","allSidesEmpty","every","side","isCompleteBorder","Object","keys","indexOf","hasMixedBorders","borders","shorthandBorders","map","getShorthandBorderStyle","getSplitBorders","top","right","bottom","left","getBorderDiff","original","updated","diff","color","style","width","getCommonBorder","colors","styles","widths","forEach","push","allColorsMatch","value","allStylesMatch","allWidthsMatch","getMostCommonUnit","fallbackBorder","fallbackColor","fallbackStyle","fallbackWidth","hasVisibleBorder","borderStyle","filter","Boolean","join","values","units","parseCSSUnitValue","filteredUnits","mode","length","maxCount","currentMode"],"sources":["@wordpress/components/src/border-box-control/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { parseCSSUnitValue } from '../utils/unit-values';\nimport type { Border } from '../border-control/types';\nimport type { AnyBorder, Borders, BorderProp, BorderSide } from './types';\n\nconst sides: BorderSide[] = [ 'top', 'right', 'bottom', 'left' ];\nconst borderProps: BorderProp[] = [ 'color', 'style', 'width' ];\n\nexport const isEmptyBorder = ( border?: Border ) => {\n\tif ( ! border ) {\n\t\treturn true;\n\t}\n\treturn ! borderProps.some( ( prop ) => border[ prop ] !== undefined );\n};\n\nexport const isDefinedBorder = ( border: AnyBorder ) => {\n\t// No border, no worries :)\n\tif ( ! border ) {\n\t\treturn false;\n\t}\n\n\t// If we have individual borders per side within the border object we\n\t// need to check whether any of those side borders have been set.\n\tif ( hasSplitBorders( border ) ) {\n\t\tconst allSidesEmpty = sides.every( ( side ) =>\n\t\t\tisEmptyBorder( ( border as Borders )[ side ] )\n\t\t);\n\n\t\treturn ! allSidesEmpty;\n\t}\n\n\t// If we have a top-level border only, check if that is empty. e.g.\n\t// { color: undefined, style: undefined, width: undefined }\n\t// Border radius can still be set within the border object as it is\n\t// handled separately.\n\treturn ! isEmptyBorder( border as Border );\n};\n\nexport const isCompleteBorder = ( border?: Border ) => {\n\tif ( ! border ) {\n\t\treturn false;\n\t}\n\n\treturn borderProps.every( ( prop ) => border[ prop ] !== undefined );\n};\n\nexport const hasSplitBorders = ( border: AnyBorder = {} ) => {\n\treturn Object.keys( border ).some(\n\t\t( side ) => sides.indexOf( side as BorderSide ) !== -1\n\t);\n};\n\nexport const hasMixedBorders = ( borders: AnyBorder ) => {\n\tif ( ! hasSplitBorders( borders ) ) {\n\t\treturn false;\n\t}\n\n\tconst shorthandBorders = sides.map( ( side: BorderSide ) =>\n\t\tgetShorthandBorderStyle( ( borders as Borders )?.[ side ] )\n\t);\n\n\treturn ! shorthandBorders.every(\n\t\t( border ) => border === shorthandBorders[ 0 ]\n\t);\n};\n\nexport const getSplitBorders = ( border?: Border ) => {\n\tif ( ! border || isEmptyBorder( border ) ) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\ttop: border,\n\t\tright: border,\n\t\tbottom: border,\n\t\tleft: border,\n\t};\n};\n\nexport const getBorderDiff = ( original: Border, updated: Border ) => {\n\tconst diff: Border = {};\n\n\tif ( original.color !== updated.color ) {\n\t\tdiff.color = updated.color;\n\t}\n\n\tif ( original.style !== updated.style ) {\n\t\tdiff.style = updated.style;\n\t}\n\n\tif ( original.width !== updated.width ) {\n\t\tdiff.width = updated.width;\n\t}\n\n\treturn diff;\n};\n\nexport const getCommonBorder = ( borders?: Borders ) => {\n\tif ( ! borders ) {\n\t\treturn undefined;\n\t}\n\n\tconst colors: ( CSSProperties[ 'borderColor' ] | undefined )[] = [];\n\tconst styles: ( CSSProperties[ 'borderStyle' ] | undefined )[] = [];\n\tconst widths: ( CSSProperties[ 'borderWidth' ] | undefined )[] = [];\n\n\tsides.forEach( ( side ) => {\n\t\tcolors.push( borders[ side ]?.color );\n\t\tstyles.push( borders[ side ]?.style );\n\t\twidths.push( borders[ side ]?.width );\n\t} );\n\n\tconst allColorsMatch = colors.every( ( value ) => value === colors[ 0 ] );\n\tconst allStylesMatch = styles.every( ( value ) => value === styles[ 0 ] );\n\tconst allWidthsMatch = widths.every( ( value ) => value === widths[ 0 ] );\n\n\treturn {\n\t\tcolor: allColorsMatch ? colors[ 0 ] : undefined,\n\t\tstyle: allStylesMatch ? styles[ 0 ] : undefined,\n\t\twidth: allWidthsMatch ? widths[ 0 ] : getMostCommonUnit( widths ),\n\t};\n};\n\nexport const getShorthandBorderStyle = (\n\tborder?: Border,\n\tfallbackBorder?: Border\n) => {\n\tif ( isEmptyBorder( border ) ) {\n\t\treturn fallbackBorder;\n\t}\n\n\tconst {\n\t\tcolor: fallbackColor,\n\t\tstyle: fallbackStyle,\n\t\twidth: fallbackWidth,\n\t} = fallbackBorder || {};\n\n\tconst {\n\t\tcolor = fallbackColor,\n\t\tstyle = fallbackStyle,\n\t\twidth = fallbackWidth,\n\t} = border as Border;\n\n\tconst hasVisibleBorder = ( !! width && width !== '0' ) || !! color;\n\tconst borderStyle = hasVisibleBorder ? style || 'solid' : style;\n\n\treturn [ width, borderStyle, color ].filter( Boolean ).join( ' ' );\n};\n\nexport const getMostCommonUnit = (\n\tvalues: Array< string | number | undefined >\n): string | undefined => {\n\t// Collect all the CSS units.\n\tconst units = values.map( ( value ) =>\n\t\tvalue === undefined ? undefined : parseCSSUnitValue( `${ value }` )[ 1 ]\n\t);\n\n\t// Return the most common unit out of only the defined CSS units.\n\tconst filteredUnits = units.filter( ( value ) => value !== undefined );\n\treturn mode( filteredUnits as string[] );\n};\n\n/**\n * Finds the mode value out of the array passed favouring the first value\n * as a tiebreaker.\n *\n * @param values Values to determine the mode from.\n *\n * @return The mode value.\n */\nfunction mode( values: Array< string > ): string | undefined {\n\tif ( values.length === 0 ) {\n\t\treturn undefined;\n\t}\n\n\tconst map: { [ index: string ]: number } = {};\n\tlet maxCount = 0;\n\tlet currentMode;\n\n\tvalues.forEach( ( value ) => {\n\t\tmap[ value ] = map[ value ] === undefined ? 1 : map[ value ] + 1;\n\n\t\tif ( map[ value ] > maxCount ) {\n\t\t\tcurrentMode = value;\n\t\t\tmaxCount = map[ value ];\n\t\t}\n\t} );\n\n\treturn currentMode;\n}\n"],"mappings":";;;;;;AAQA,IAAAA,WAAA,GAAAC,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAMC,KAAmB,GAAG,CAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAE;AAChE,MAAMC,WAAyB,GAAG,CAAE,OAAO,EAAE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AC,CAAC;EAC7C,IAAIwC,QAAQ,GAAG,CAAC;EAChB,IAAIC,WAAW;EAEfP,MAAM,CAAChB,OAAO,CAAIG,KAAK,IAAM;IAC5BrB,GAAG,CAAEqB,KAAK,CAAE,GAAGrB,GAAG,CAAEqB,KAAK,CAAE,KAAKnC,SAAS,GAAG,CAAC,GAAGc,GAAG,CAAEqB,KAAK,CAAE,GAAG,CAAC;IAEhE,IAAKrB,GAAG,CAAEqB,KAAK,CAAE,GAAGmB,QAAQ,EAAG;MAC9BC,WAAW,GAAGpB,KAAK;MACnBmB,QAAQ,GAAGxC,GAAG,CAAEqB,KAAK,CAAE;IACxB;EACD,CAAE,CAAC;EAEH,OAAOoB,WAAW;AACnB","ignoreList":[]}
1
+ {"version":3,"names":["_unitValues","require","sides","borderProps","isEmptyBorder","border","some","prop","undefined","exports","isDefinedBorder","hasSplitBorders","allSidesEmpty","every","side","isCompleteBorder","Object","keys","indexOf","hasMixedBorders","borders","shorthandBorders","map","getShorthandBorderStyle","getSplitBorders","top","right","bottom","left","getBorderDiff","original","updated","diff","color","style","width","getCommonBorder","colors","styles","widths","forEach","push","allColorsMatch","value","allStylesMatch","allWidthsMatch","getMostCommonUnit","fallbackBorder","fallbackColor","fallbackStyle","fallbackWidth","hasVisibleBorder","borderStyle","filter","Boolean","join","values","units","parseCSSUnitValue","filteredUnits","mode","length","maxCount","currentMode"],"sources":["@wordpress/components/src/border-box-control/utils.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport { parseCSSUnitValue } from '../utils/unit-values';\nimport type { Border } from '../border-control/types';\nimport type { AnyBorder, Borders, BorderProp, BorderSide } from './types';\n\nconst sides: BorderSide[] = [ 'top', 'right', 'bottom', 'left' ];\nconst borderProps: BorderProp[] = [ 'color', 'style', 'width' ];\n\nexport const isEmptyBorder = ( border?: Border ) => {\n\tif ( ! border ) {\n\t\treturn true;\n\t}\n\treturn ! borderProps.some( ( prop ) => border[ prop ] !== undefined );\n};\n\nexport const isDefinedBorder = ( border: AnyBorder ) => {\n\t// No border, no worries :)\n\tif ( ! border ) {\n\t\treturn false;\n\t}\n\n\t// If we have individual borders per side within the border object we\n\t// need to check whether any of those side borders have been set.\n\tif ( hasSplitBorders( border ) ) {\n\t\tconst allSidesEmpty = sides.every( ( side ) =>\n\t\t\tisEmptyBorder( ( border as Borders )[ side ] )\n\t\t);\n\n\t\treturn ! allSidesEmpty;\n\t}\n\n\t// If we have a top-level border only, check if that is empty. e.g.\n\t// { color: undefined, style: undefined, width: undefined }\n\t// Border radius can still be set within the border object as it is\n\t// handled separately.\n\treturn ! isEmptyBorder( border as Border );\n};\n\nexport const isCompleteBorder = ( border?: Border ) => {\n\tif ( ! border ) {\n\t\treturn false;\n\t}\n\n\treturn borderProps.every( ( prop ) => border[ prop ] !== undefined );\n};\n\nexport const hasSplitBorders = ( border: AnyBorder = {} ) => {\n\treturn Object.keys( border ).some(\n\t\t( side ) => sides.indexOf( side as BorderSide ) !== -1\n\t);\n};\n\nexport const hasMixedBorders = ( borders: AnyBorder ) => {\n\tif ( ! hasSplitBorders( borders ) ) {\n\t\treturn false;\n\t}\n\n\tconst shorthandBorders = sides.map( ( side: BorderSide ) =>\n\t\tgetShorthandBorderStyle( ( borders as Borders )?.[ side ] )\n\t);\n\n\treturn ! shorthandBorders.every(\n\t\t( border ) => border === shorthandBorders[ 0 ]\n\t);\n};\n\nexport const getSplitBorders = ( border?: Border ) => {\n\tif ( ! border || isEmptyBorder( border ) ) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\ttop: border,\n\t\tright: border,\n\t\tbottom: border,\n\t\tleft: border,\n\t};\n};\n\nexport const getBorderDiff = ( original: Border, updated: Border ) => {\n\tconst diff: Border = {};\n\n\tif ( original.color !== updated.color ) {\n\t\tdiff.color = updated.color;\n\t}\n\n\tif ( original.style !== updated.style ) {\n\t\tdiff.style = updated.style;\n\t}\n\n\tif ( original.width !== updated.width ) {\n\t\tdiff.width = updated.width;\n\t}\n\n\treturn diff;\n};\n\nexport const getCommonBorder = ( borders?: Borders ) => {\n\tif ( ! borders ) {\n\t\treturn undefined;\n\t}\n\n\tconst colors: ( CSSProperties[ 'borderColor' ] | undefined )[] = [];\n\tconst styles: ( CSSProperties[ 'borderStyle' ] | undefined )[] = [];\n\tconst widths: ( CSSProperties[ 'borderWidth' ] | undefined )[] = [];\n\n\tsides.forEach( ( side ) => {\n\t\tcolors.push( borders[ side ]?.color );\n\t\tstyles.push( borders[ side ]?.style );\n\t\twidths.push( borders[ side ]?.width );\n\t} );\n\n\tconst allColorsMatch = colors.every( ( value ) => value === colors[ 0 ] );\n\tconst allStylesMatch = styles.every( ( value ) => value === styles[ 0 ] );\n\tconst allWidthsMatch = widths.every( ( value ) => value === widths[ 0 ] );\n\n\treturn {\n\t\tcolor: allColorsMatch ? colors[ 0 ] : undefined,\n\t\tstyle: allStylesMatch ? styles[ 0 ] : undefined,\n\t\twidth: allWidthsMatch ? widths[ 0 ] : getMostCommonUnit( widths ),\n\t};\n};\n\nexport const getShorthandBorderStyle = (\n\tborder?: Border,\n\tfallbackBorder?: Border\n) => {\n\tif ( isEmptyBorder( border ) ) {\n\t\treturn fallbackBorder;\n\t}\n\n\tconst {\n\t\tcolor: fallbackColor,\n\t\tstyle: fallbackStyle,\n\t\twidth: fallbackWidth,\n\t} = fallbackBorder || {};\n\n\tconst {\n\t\tcolor = fallbackColor,\n\t\tstyle = fallbackStyle,\n\t\twidth = fallbackWidth,\n\t} = border as Border;\n\n\tconst hasVisibleBorder = ( !! width && width !== '0' ) || !! color;\n\tconst borderStyle = hasVisibleBorder ? style || 'solid' : style;\n\n\treturn [ width, borderStyle, color ].filter( Boolean ).join( ' ' );\n};\n\nexport const getMostCommonUnit = (\n\tvalues: Array< string | number | undefined >\n): string | undefined => {\n\t// Collect all the CSS units.\n\tconst units = values.map( ( value ) =>\n\t\tvalue === undefined ? undefined : parseCSSUnitValue( `${ value }` )[ 1 ]\n\t);\n\n\t// Return the most common unit out of only the defined CSS units.\n\tconst filteredUnits = units.filter( ( value ) => value !== undefined );\n\treturn mode( filteredUnits as string[] );\n};\n\n/**\n * Finds the mode value out of the array passed favouring the first value\n * as a tiebreaker.\n *\n * @param values Values to determine the mode from.\n *\n * @return The mode value.\n */\nfunction mode( values: Array< string > ): string | undefined {\n\tif ( values.length === 0 ) {\n\t\treturn undefined;\n\t}\n\n\tconst map: { [ index: string ]: number } = {};\n\tlet maxCount = 0;\n\tlet currentMode;\n\n\tvalues.forEach( ( value ) => {\n\t\tmap[ value ] = map[ value ] === undefined ? 1 : map[ value ] + 1;\n\n\t\tif ( map[ value ] > maxCount ) {\n\t\t\tcurrentMode = value;\n\t\t\tmaxCount = map[ value ];\n\t\t}\n\t} );\n\n\treturn currentMode;\n}\n"],"mappings":";;;;;;AAQA,IAAAA,WAAA,GAAAC,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,MAAMC,KAAmB,GAAG,CAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAE;AAChE,MAAMC,WAAyB,GAAG,CAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAE;AAExD,MAAMC,aAAa,GAAKC,MAAe,IAAM;EACnD,IAAK,CAAEA,MAAM,EAAG;IACf,OAAO,IAAI;EACZ;EACA,OAAO,CAAEF,WAAW,CAACG,IAAI,CAAIC,IAAI,IAAMF,MAAM,CAAEE,IAAI,CAAE,KAAKC,SAAU,CAAC;AACtE,CAAC;AAACC,OAAA,CAAAL,aAAA,GAAAA,aAAA;AAEK,MAAMM,eAAe,GAAKL,MAAiB,IAAM;EACvD;EACA,IAAK,CAAEA,MAAM,EAAG;IACf,OAAO,KAAK;EACb;;EAEA;EACA;EACA,IAAKM,eAAe,CAAEN,MAAO,CAAC,EAAG;IAChC,MAAMO,aAAa,GAAGV,KAAK,CAACW,KAAK,CAAIC,IAAI,IACxCV,aAAa,CAAIC,MAAM,CAAeS,IAAI,CAAG,C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,CAAC,CAACC,IAAI,CAAE,GAAI,CAAC;AACnE,CAAC;AAAC9C,OAAA,CAAAc,uBAAA,GAAAA,uBAAA;AAEK,MAAMuB,iBAAiB,GAC7BU,MAA4C,IACpB;EACxB;EACA,MAAMC,KAAK,GAAGD,MAAM,CAAClC,GAAG,CAAIqB,KAAK,IAChCA,KAAK,KAAKnC,SAAS,GAAGA,SAAS,GAAG,IAAAkD,6BAAiB,EAAE,GAAIf,KAAK,EAAI,CAAC,CAAE,CAAC,CACvE,CAAC;;EAED;EACA,MAAMgB,aAAa,GAAGF,KAAK,CAACJ,MAAM,CAAIV,KAAK,IAAMA,KAAK,KAAKnC,SAAU,CAAC;EACtE,OAAOoD,IAAI,CAAED,aAA0B,CAAC;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAlD,OAAA,CAAAqC,iBAAA,GAAAA,iBAAA;AAQA,SAASc,IAAIA,CAAEJ,MAAuB,EAAuB;EAC5D,IAAKA,MAAM,CAACK,MAAM,KAAK,CAAC,EAAG;IAC1B,OAAOrD,SAAS;EACjB;EAEA,MAAMc,GAAkC,GAAG,CAAC,CAAC;EAC7C,IAAIwC,QAAQ,GAAG,CAAC;EAChB,IAAIC,WAAW;EAEfP,MAAM,CAAChB,OAAO,CAAIG,KAAK,IAAM;IAC5BrB,GAAG,CAAEqB,KAAK,CAAE,GAAGrB,GAAG,CAAEqB,KAAK,CAAE,KAAKnC,SAAS,GAAG,CAAC,GAAGc,GAAG,CAAEqB,KAAK,CAAE,GAAG,CAAC;IAEhE,IAAKrB,GAAG,CAAEqB,KAAK,CAAE,GAAGmB,QAAQ,EAAG;MAC9BC,WAAW,GAAGpB,KAAK;MACnBmB,QAAQ,GAAGxC,GAAG,CAAEqB,KAAK,CAAE;IACxB;EACD,CAAE,CAAC;EAEH,OAAOoB,WAAW;AACnB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","styles","_interopRequireWildcard","_utils","_context","_useCx","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","isValidBorder","border","hasWidth","width","undefined","hasColor","color","useBorderControl","props","className","colors","isCompact","onChange","enableAlpha","enableStyle","shouldSanitizeBorder","size","value","__experimentalIsRenderedInSidebar","__next40pxDefaultSize","otherProps","useContextSystem","computedSize","widthValue","originalWidthUnit","parseQuantityAndUnitFromRawValue","widthUnit","hadPreviousZeroWidth","colorSelection","setColorSelection","useState","styleSelection","setStyleSelection","isStyleSettable","onBorderChange","useCallback","newBorder","onWidthChange","newWidth","newWidthValue","parsedValue","hasZeroWidth","updatedBorder","style","onSliderChange","cx","useCx","classes","useMemo","borderControl","wrapperWidth","innerWrapperClassName","widthStyle","heightStyle","wrapperHeight","innerWrapper","sliderClassName","borderSlider","inputWidth","previousStyleSelection"],"sources":["@wordpress/components/src/border-control/border-control/hook.ts"],"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 type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\n\nimport type { Border, BorderControlProps } from '../types';\n\n// If either width or color are defined, the border is considered valid\n// and a border style can be set as well.\nconst isValidBorder = ( border?: Border ) => {\n\tconst hasWidth = border?.width !== undefined && border.width !== '';\n\tconst hasColor = border?.color !== undefined;\n\treturn hasWidth || hasColor;\n};\n\nexport function useBorderControl(\n\tprops: WordPressComponentProps< BorderControlProps, 'div' >\n) {\n\tconst {\n\t\tclassName,\n\t\tcolors = [],\n\t\tisCompact,\n\t\tonChange,\n\t\tenableAlpha = true,\n\t\tenableStyle = true,\n\t\tshouldSanitizeBorder = true,\n\t\tsize = 'default',\n\t\tvalue: border,\n\t\twidth,\n\t\t__experimentalIsRenderedInSidebar = false,\n\t\t__next40pxDefaultSize,\n\t\t...otherProps\n\t} = useContextSystem( props, 'BorderControl' );\n\n\tconst computedSize =\n\t\tsize === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;\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 isStyleSettable = shouldSanitizeBorder\n\t\t? isValidBorder( border )\n\t\t: true;\n\n\tconst onBorderChange = useCallback(\n\t\t( newBorder?: Border ) => {\n\t\t\tif ( shouldSanitizeBorder && ! isValidBorder( newBorder ) ) {\n\t\t\t\tonChange( undefined );\n\t\t\t\treturn;\n\t\t\t}\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\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?: number ) => {\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\tlet wrapperWidth = width;\n\tif ( isCompact ) {\n\t\t// Widths below represent the minimum usable width for compact controls.\n\t\t// Taller controls contain greater internal padding, thus greater width.\n\t\twrapperWidth = size === '__unstable-large' ? '116px' : '90px';\n\t}\n\tconst innerWrapperClassName = useMemo( () => {\n\t\tconst widthStyle = !! wrapperWidth && styles.wrapperWidth;\n\t\tconst heightStyle = styles.wrapperHeight( computedSize );\n\n\t\treturn cx( styles.innerWrapper(), widthStyle, heightStyle );\n\t}, [ wrapperWidth, cx, computedSize ] );\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\tcolors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tinnerWrapperClassName,\n\t\tinputWidth: wrapperWidth,\n\t\tisStyleSettable,\n\t\tonBorderChange,\n\t\tonSliderChange,\n\t\tonWidthChange,\n\t\tpreviousStyleSelection: styleSel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CAAEZ,EAAE,CAAG,CAAC;EAEX,OAAO;IACN,GAAGzB,UAAU;IACbX,SAAS,EAAEsC,OAAO;IAClBrC,MAAM;IACNG,WAAW;IACXC,WAAW;IACXqC,qBAAqB;IACrBO,UAAU,EAAER,YAAY;IACxBjB,eAAe;IACfC,cAAc;IACdU,cAAc;IACdP,aAAa;IACbsB,sBAAsB,EAAE5B,cAAc;IACtCyB,eAAe;IACfvC,KAAK,EAAEhB,MAAM;IACbyB,SAAS;IACTH,UAAU;IACVP,IAAI,EAAEM,YAAY;IAClBJ,iCAAiC;IACjCC;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","styles","_interopRequireWildcard","_utils","_context","_useCx","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","isValidBorder","border","hasWidth","width","undefined","hasColor","color","useBorderControl","props","className","colors","isCompact","onChange","enableAlpha","enableStyle","shouldSanitizeBorder","size","value","__experimentalIsRenderedInSidebar","__next40pxDefaultSize","otherProps","useContextSystem","computedSize","widthValue","originalWidthUnit","parseQuantityAndUnitFromRawValue","widthUnit","hadPreviousZeroWidth","colorSelection","setColorSelection","useState","styleSelection","setStyleSelection","isStyleSettable","onBorderChange","useCallback","newBorder","onWidthChange","newWidth","newWidthValue","parsedValue","hasZeroWidth","updatedBorder","style","onSliderChange","cx","useCx","classes","useMemo","borderControl","wrapperWidth","innerWrapperClassName","widthStyle","heightStyle","wrapperHeight","innerWrapper","sliderClassName","borderSlider","inputWidth","previousStyleSelection"],"sources":["@wordpress/components/src/border-control/border-control/hook.ts"],"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 type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\n\nimport type { Border, BorderControlProps } from '../types';\n\n// If either width or color are defined, the border is considered valid\n// and a border style can be set as well.\nconst isValidBorder = ( border?: Border ) => {\n\tconst hasWidth = border?.width !== undefined && border.width !== '';\n\tconst hasColor = border?.color !== undefined;\n\treturn hasWidth || hasColor;\n};\n\nexport function useBorderControl(\n\tprops: WordPressComponentProps< BorderControlProps, 'div' >\n) {\n\tconst {\n\t\tclassName,\n\t\tcolors = [],\n\t\tisCompact,\n\t\tonChange,\n\t\tenableAlpha = true,\n\t\tenableStyle = true,\n\t\tshouldSanitizeBorder = true,\n\t\tsize = 'default',\n\t\tvalue: border,\n\t\twidth,\n\t\t__experimentalIsRenderedInSidebar = false,\n\t\t__next40pxDefaultSize,\n\t\t...otherProps\n\t} = useContextSystem( props, 'BorderControl' );\n\n\tconst computedSize =\n\t\tsize === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;\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 isStyleSettable = shouldSanitizeBorder\n\t\t? isValidBorder( border )\n\t\t: true;\n\n\tconst onBorderChange = useCallback(\n\t\t( newBorder?: Border ) => {\n\t\t\tif ( shouldSanitizeBorder && ! isValidBorder( newBorder ) ) {\n\t\t\t\tonChange( undefined );\n\t\t\t\treturn;\n\t\t\t}\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\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?: number ) => {\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\tlet wrapperWidth = width;\n\tif ( isCompact ) {\n\t\t// Widths below represent the minimum usable width for compact controls.\n\t\t// Taller controls contain greater internal padding, thus greater width.\n\t\twrapperWidth = size === '__unstable-large' ? '116px' : '90px';\n\t}\n\tconst innerWrapperClassName = useMemo( () => {\n\t\tconst widthStyle = !! wrapperWidth && styles.wrapperWidth;\n\t\tconst heightStyle = styles.wrapperHeight( computedSize );\n\n\t\treturn cx( styles.innerWrapper(), widthStyle, heightStyle );\n\t}, [ wrapperWidth, cx, computedSize ] );\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\tcolors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tinnerWrapperClassName,\n\t\tinputWidth: wrapperWidth,\n\t\tisStyleSettable,\n\t\tonBorderChange,\n\t\tonSliderChange,\n\t\tonWidthChange,\n\t\tpreviousStyleSelection: styleSelection,\n\t\tsliderClassName,\n\t\tvalue: border,\n\t\twidthUnit,\n\t\twidthValue,\n\t\tsize: computedSize,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t__next40pxDefaultSize,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAAiD,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,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IAC5C,MAAMI,UAAU,GAAG,CAAC,CAAEF,YAAY,IAAI3E,MAAM,CAAC2E,YAAY;IACzD,MAAMG,WAAW,GAAG9E,MAAM,CAAC+E,aAAa,CAAEhC,YAAa,CAAC;IAExD,OAAOuB,EAAE,CAAEtE,MAAM,CAACgF,YAAY,CAAC,CAAC,EAAEH,UAAU,EAAEC,WAAY,CAAC;EAC5D,CAAC,EAAE,CAAEH,YAAY,EAAEL,EAAE,EAAEvB,YAAY,CAAG,CAAC;EAEvC,MAAMkC,eAAe,GAAG,IAAAR,gBAAO,EAAE,MAAM;IACtC,OAAOH,EAAE,CAAEtE,MAAM,CAACkF,YAAY,CAAC,CAAE,CAAC;EACnC,CAAC,EAAE,CAAEZ,EAAE,CAAG,CAAC;EAEX,OAAO;IACN,GAAGzB,UAAU;IACbX,SAAS,EAAEsC,OAAO;IAClBrC,MAAM;IACNG,WAAW;IACXC,WAAW;IACXqC,qBAAqB;IACrBO,UAAU,EAAER,YAAY;IACxBjB,eAAe;IACfC,cAAc;IACdU,cAAc;IACdP,aAAa;IACbsB,sBAAsB,EAAE5B,cAAc;IACtCyB,eAAe;IACfvC,KAAK,EAAEhB,MAAM;IACbyB,SAAS;IACTH,UAAU;IACVP,IAAI,EAAEM,YAAY;IAClBJ,iCAAiC;IACjCC;EACD,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_utils","_space","_baseControlStyles","_unitControlStyles","focusBoxShadow","css","CONFIG","controlBoxShadowFocus","process","env","NODE_ENV","borderControl","exports","boxSizingReset","innerWrapper","UnitControlWrapper","UnitSelect","wrapperWidth","wrapperHeight","size","borderControlDropdown","rtl","borderRadius","borderWidth","COLORS","ui","border","borderFocus","colorIndicatorBorder","color","style","fallbackColor","gray","undefined","colorIndicatorWrapper","radiusFull","space","swatchSize","swatchGap","borderControlPopoverControls","StyledLabel","borderControlPopoverContent","borderColorIndicator","resetButton","borderSlider","marginRight"],"sources":["@wordpress/components/src/border-control/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG, boxSizingReset, rtl } from '../utils';\nimport { space } from '../utils/space';\nimport { StyledLabel } from '../base-control/styles/base-control-styles';\nimport {\n\tValueInput as UnitControlWrapper,\n\tUnitSelect,\n} from '../unit-control/styles/unit-control-styles';\n\nimport type { Border } from './types';\n\nconst focusBoxShadow = css`\n\tbox-shadow: inset ${ CONFIG.controlBoxShadowFocus };\n`;\n\nexport const borderControl = css`\n\tborder: 0;\n\tpadding: 0;\n\tmargin: 0;\n\t${ boxSizingReset }\n`;\n\nexport const innerWrapper = () => css`\n\t${ UnitControlWrapper } {\n\t\tflex: 1 1 40%;\n\t}\n\t&& ${ UnitSelect } {\n\t\t/* Prevent unit select forcing min height larger than its UnitControl */\n\t\tmin-height: 0;\n\t}\n`;\n\n/*\n * This style is only applied to the UnitControl wrapper when the border width\n * field should be a set width. Omitting this allows the UnitControl &\n * RangeControl to share the available width in a 40/60 split respectively.\n */\nexport const wrapperWidth = css`\n\t${ UnitControlWrapper } {\n\t\t/* Force the UnitControl's set width. */\n\t\tflex: 0 0 auto;\n\t}\n`;\n\nexport const wrapperHeight = ( size?: 'default' | '__unstable-large' ) => {\n\treturn css`\n\t\theight: ${ size === '__unstable-large' ? '40px' : '30px' };\n\t`;\n};\n\nexport const borderControlDropdown = css`\n\tbackground: #fff;\n\n\t&& > button {\n\t\taspect-ratio: 1;\n\t\tpadding: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\t${ rtl(\n\t\t\t{ borderRadius: `2px 0 0 2px` },\n\t\t\t{ borderRadius: `0 2px 2px 0` }\n\t\t)() }\n\t\tborder: ${ CONFIG.borderWidth } solid ${ COLORS.ui.border };\n\n\t\t&:focus,\n\t\t&:hover:not( :disabled ) {\n\t\t\t${ focusBoxShadow }\n\t\t\tborder-color: ${ COLORS.ui.borderFocus };\n\t\t\tz-index: 1;\n\t\t\tposition: relative;\n\t\t}\n\t}\n`;\n\nexport const colorIndicatorBorder = ( border?: Border ) => {\n\tconst { color, style } = border || {};\n\n\tconst fallbackColor =\n\t\t!! style && style !== 'none' ? COLORS.gray[ 300 ] : undefined;\n\n\treturn css`\n\t\tborder-style: ${ style === 'none' ? 'solid' : style };\n\t\tborder-color: ${ color || fallbackColor };\n\t`;\n};\n\nexport const colorIndicatorWrapper = (\n\tborder?: Border,\n\tsize?: 'default' | '__unstable-large'\n) => {\n\tconst { style } = border || {};\n\n\treturn css`\n\t\tborder-radius: ${ CONFIG.radiusFull };\n\t\tborder: 2px solid transparent;\n\t\t${ style ? colorIndicatorBorder( border ) : undefined }\n\t\twidth: ${ size === '__unstable-large' ? '24px' : '22px' };\n\t\theight: ${ size === '__unstable-large' ? '24px' : '22px' };\n\t\tpadding: ${ size === '__unstable-large' ? '2px' : '1px' };\n\n\t\t/*\n\t\t * ColorIndicator\n\t\t *\n\t\t * The transparent colors used here ensure visibility of the indicator\n\t\t * over the active state of the border control dropdown's toggle button.\n\t\t */\n\t\t& > span {\n\t\t\theight: ${ space( 4 ) };\n\t\t\twidth: ${ space( 4 ) };\n\t\t\tbackground: linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);\n\t\t}\n\t`;\n};\n\n// Must equal $color-palette-circle-size from:\n// @wordpress/components/src/circular-option-picker/style.scss\nconst swatchSize = 28;\nconst swatchGap = 12;\n\nexport const borderControlPopoverControls = css`\n\twidth: ${ swatchSize * 6 + swatchGap * 5 }px;\n\n\t> div:first-of-type > ${ StyledLabel } {\n\t\tmargin-bottom: 0;\n\t}\n\n\t&& ${ StyledLabel } + button:not( .has-text ) {\n\t\tmin-width: 24px;\n\t\tpadding: 0;\n\t}\n`;\n\nexport const borderControlPopoverContent = css``;\nexport const borderColorIndicator = css``;\n\nexport const resetButton = css`\n\tjustify-content: center;\n\twidth: 100%;\n\n\t/* Override button component styling */\n\t&& {\n\t\tborder-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 400 ] };\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t}\n`;\n\nexport const borderSlider = () => css`\n\tflex: 1 1 60%;\n\t${ rtl( { marginRight: space( 3 ) } )() }\n`;\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAWA,MAAMK,cAAc,oBAAGC,UAAG,uBACJC,aAAM,CAACC,qBAAqB,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,m1LACjD;AAEM,MAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,oBAAGN,UAAG,kCAI5BQ,qBAAc,SAAAL,OAAA,CAAAC,GAAA,CAAAC,QAAA,mDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,m1LACjB;AAEM,MAAMI,YAAY,GAAGA,CAAA,sBAAMT,UAAG,EACjCU,6BAAkB,wBAGfC,6BAAU,uBAAAR,OAAA,CAAAC,GAAA,CAAAC,QAAA,kDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,m1LAIhB;;AAED;AACA;AACA;AACA;AACA;AAJAE,OAAA,CAAAE,YAAA,GAAAA,YAAA;AAKO,MAAMG,YAAY,GAAAL,OAAA,CAAAK,YAAA,oBAAGZ,UAAG,EAC3BU,6BAAkB,wBAAAP,OAAA,CAAAC,GAAA,CAAAC,QAAA,kDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,m1LAIrB;AAEM,MAAMQ,aAAa,G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I,CAAE,GAAG,CAAE,6DAAAxB,OAAA,CAAAC,GAAA,CAAAC,QAAA,iDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,m1LAIhE;AAEM,MAAMkC,YAAY,GAAGA,CAAA,sBAAMvC,UAAG,mBAEjC,IAAAgB,UAAG,EAAE;EAAEwB,WAAW,EAAE,IAAAT,YAAK,EAAE,CAAE;AAAE,CAAE,CAAC,CAAC,CAAC,SAAA5B,OAAA,CAAAC,GAAA,CAAAC,QAAA,kDAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,m1LACvC;AAACE,OAAA,CAAAgC,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_utils","_space","_baseControlStyles","_unitControlStyles","focusBoxShadow","css","CONFIG","controlBoxShadowFocus","process","env","NODE_ENV","borderControl","exports","boxSizingReset","innerWrapper","UnitControlWrapper","UnitSelect","wrapperWidth","wrapperHeight","size","borderControlDropdown","rtl","borderRadius","borderWidth","COLORS","ui","border","borderFocus","colorIndicatorBorder","color","style","fallbackColor","gray","undefined","colorIndicatorWrapper","radiusFull","space","swatchSize","swatchGap","borderControlPopoverControls","StyledLabel","borderControlPopoverContent","borderColorIndicator","resetButton","borderSlider","marginRight"],"sources":["@wordpress/components/src/border-control/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG, boxSizingReset, rtl } from '../utils';\nimport { space } from '../utils/space';\nimport { StyledLabel } from '../base-control/styles/base-control-styles';\nimport {\n\tValueInput as UnitControlWrapper,\n\tUnitSelect,\n} from '../unit-control/styles/unit-control-styles';\n\nimport type { Border } from './types';\n\nconst focusBoxShadow = css`\n\tbox-shadow: inset ${ CONFIG.controlBoxShadowFocus };\n`;\n\nexport const borderControl = css`\n\tborder: 0;\n\tpadding: 0;\n\tmargin: 0;\n\t${ boxSizingReset }\n`;\n\nexport const innerWrapper = () => css`\n\t${ UnitControlWrapper } {\n\t\tflex: 1 1 40%;\n\t}\n\t&& ${ UnitSelect } {\n\t\t/* Prevent unit select forcing min height larger than its UnitControl */\n\t\tmin-height: 0;\n\t}\n`;\n\n/*\n * This style is only applied to the UnitControl wrapper when the border width\n * field should be a set width. Omitting this allows the UnitControl &\n * RangeControl to share the available width in a 40/60 split respectively.\n */\nexport const wrapperWidth = css`\n\t${ UnitControlWrapper } {\n\t\t/* Force the UnitControl's set width. */\n\t\tflex: 0 0 auto;\n\t}\n`;\n\nexport const wrapperHeight = ( size?: 'default' | '__unstable-large' ) => {\n\treturn css`\n\t\theight: ${ size === '__unstable-large' ? '40px' : '30px' };\n\t`;\n};\n\nexport const borderControlDropdown = css`\n\tbackground: #fff;\n\n\t&& > button {\n\t\taspect-ratio: 1;\n\t\tpadding: 0;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\t${ rtl(\n\t\t\t{ borderRadius: `2px 0 0 2px` },\n\t\t\t{ borderRadius: `0 2px 2px 0` }\n\t\t)() }\n\t\tborder: ${ CONFIG.borderWidth } solid ${ COLORS.ui.border };\n\n\t\t&:focus,\n\t\t&:hover:not( :disabled ) {\n\t\t\t${ focusBoxShadow }\n\t\t\tborder-color: ${ COLORS.ui.borderFocus };\n\t\t\tz-index: 1;\n\t\t\tposition: relative;\n\t\t}\n\t}\n`;\n\nexport const colorIndicatorBorder = ( border?: Border ) => {\n\tconst { color, style } = border || {};\n\n\tconst fallbackColor =\n\t\t!! style && style !== 'none' ? COLORS.gray[ 300 ] : undefined;\n\n\treturn css`\n\t\tborder-style: ${ style === 'none' ? 'solid' : style };\n\t\tborder-color: ${ color || fallbackColor };\n\t`;\n};\n\nexport const colorIndicatorWrapper = (\n\tborder?: Border,\n\tsize?: 'default' | '__unstable-large'\n) => {\n\tconst { style } = border || {};\n\n\treturn css`\n\t\tborder-radius: ${ CONFIG.radiusFull };\n\t\tborder: 2px solid transparent;\n\t\t${ style ? colorIndicatorBorder( border ) : undefined }\n\t\twidth: ${ size === '__unstable-large' ? '24px' : '22px' };\n\t\theight: ${ size === '__unstable-large' ? '24px' : '22px' };\n\t\tpadding: ${ size === '__unstable-large' ? '2px' : '1px' };\n\n\t\t/*\n\t\t * ColorIndicator\n\t\t *\n\t\t * The transparent colors used here ensure visibility of the indicator\n\t\t * over the active state of the border control dropdown's toggle button.\n\t\t */\n\t\t& > span {\n\t\t\theight: ${ space( 4 ) };\n\t\t\twidth: ${ space( 4 ) };\n\t\t\tbackground: linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);\n\t\t}\n\t`;\n};\n\n// Must equal $color-palette-circle-size from:\n// @wordpress/components/src/circular-option-picker/style.scss\nconst swatchSize = 28;\nconst swatchGap = 12;\n\nexport const borderControlPopoverControls = css`\n\twidth: ${ swatchSize * 6 + swatchGap * 5 }px;\n\n\t> div:first-of-type > ${ StyledLabel } {\n\t\tmargin-bottom: 0;\n\t}\n\n\t&& ${ StyledLabel } + button:not( .has-text ) {\n\t\tmin-width: 24px;\n\t\tpadding: 0;\n\t}\n`;\n\nexport const borderControlPopoverContent = css``;\nexport const borderColorIndicator = css``;\n\nexport const resetButton = css`\n\tjustify-content: center;\n\twidth: 100%;\n\n\t/* Override button component styling */\n\t&& {\n\t\tborder-top: ${ CONFIG.borderWidth } solid ${ COLORS.gray[ 400 ] };\n\t\tborder-top-left-radius: 0;\n\t\tborder-top-right-radius: 0;\n\t}\n`;\n\nexport const borderSlider = () => css`\n\tflex: 1 1 60%;\n\t${ rtl( { marginRight: space( 3 ) } )() }\n`;\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,kBAA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["_compose","require","_utils","_tooltip","_interopRequireDefault","_utils2","_boxControlStyles","_jsxRuntime","_react","groupedSides","AxialInputControls","__next40pxDefaultSize","onChange","onFocus","values","selectedUnits","setSelectedUnits","sides","props","generatedId","useInstanceId","createHandleOnFocus","side","event","handleOnValueChange","next","nextValues","isNumeric","undefined","isNaN","parseFloat","nextValue","top","bottom","left","right","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","jsx","Fragment","children","map","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","selectedUnit","inputId","join","jsxs","InputWrapper","FlexedBoxControlIcon","default","placement","text","LABELS","createElement","StyledUnitControl","className","id","isPressEnterToChange","value","newValue","onUnitChange","label","hideLabelFromVision","key","FlexedRangeControl","__nextHasNoMarginBottom","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/axial-input-controls.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport Tooltip from '../tooltip';\nimport { CUSTOM_VALUE_SETTINGS, LABELS } from './utils';\nimport {\n\tFlexedBoxControlIcon,\n\tFlexedRangeControl,\n\tInputWrapper,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps } from './types';\n\nconst groupedSides = [ 'vertical', 'horizontal' ] as const;\ntype GroupedSide = ( typeof groupedSides )[ number ];\n\nexport default function AxialInputControls( {\n\t__next40pxDefaultSize,\n\tonChange,\n\tonFocus,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst generatedId = useInstanceId(\n\t\tAxialInputControls,\n\t\t`box-control-input`\n\t);\n\n\tconst createHandleOnFocus =\n\t\t( side: GroupedSide ) =>\n\t\t( event: React.FocusEvent< HTMLInputElement > ) => {\n\t\t\tif ( ! onFocus ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonFocus( event, { side } );\n\t\t};\n\n\tconst handleOnValueChange = ( side: GroupedSide, next?: string ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnextValues.top = nextValue;\n\t\t\tnextValues.bottom = nextValue;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnextValues.left = nextValue;\n\t\t\tnextValues.right = nextValue;\n\t\t}\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange =\n\t\t( side: GroupedSide ) => ( next?: string ) => {\n\t\t\tconst newUnits = { ...selectedUnits };\n\n\t\t\tif ( side === 'vertical' ) {\n\t\t\t\tnewUnits.top = next;\n\t\t\t\tnewUnits.bottom = next;\n\t\t\t}\n\n\t\t\tif ( side === 'horizontal' ) {\n\t\t\t\tnewUnits.left = next;\n\t\t\t\tnewUnits.right = next;\n\t\t\t}\n\n\t\t\tsetSelectedUnits( newUnits );\n\t\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? groupedSides.filter( ( side ) => sides.includes( side ) )\n\t\t: groupedSides;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue(\n\t\t\t\t\t\tside === 'vertical' ? values.top : values.left\n\t\t\t\t\t);\n\t\t\t\tconst selectedUnit =\n\t\t\t\t\tside === 'vertical'\n\t\t\t\t\t\t? selectedUnits.top\n\t\t\t\t\t\t: selectedUnits.left;\n\n\t\t\t\tconst inputId = [ generatedId, side ].join( '-' );\n\n\t\t\t\treturn (\n\t\t\t\t\t<InputWrapper key={ side }>\n\t\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t\t<Tooltip placement=\"top-end\" text={ LABELS[ side ] }>\n\t\t\t\t\t\t\t<StyledUnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\t\t\t\tid={ inputId }\n\t\t\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\t\t\tvalue={ [\n\t\t\t\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t\t\t].join( '' ) }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\t\thandleOnValueChange( side, newValue )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tside\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tkey={ side }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<FlexedRangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\taria-controls={ inputId }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t\t\t\tnewValue,\n\t\t\t\t\t\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t\t\t\t\t ].join( '' )\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ selectedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.max ?? 10\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ selectedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InputWrapper>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAKqC,IAAAM,WAAA,GAAAN,OAAA;AAAA,IAAAO,MAAA,GAAAP,OAAA;AAfrC;AACA;AACA;;AAEA;AACA;AACA;;AAYA,MAAMQ,YAAY,GAAG,CAAE,UAAU,EAAE,YAAY,CAAW;AAG3C,SAASC,kBAAkBA,CAAE;EAC3CC,qBAAqB;EACrBC,QAAQ;EACRC,OAAO;EACPC,MAAM;EACNC,aAAa;EACbC,gBAAgB;EAChBC,KAAK;EACL,GAAGC;AACyB,CAAC,EAAG;EAChC,MAAMC,WAAW,GAAG,IAAAC,sBAAa,EAChCV,k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,EAAG;QAAO,CACxB,CAAC;MAAA,GArDiBxD,IAsDN,CAAC;IAEjB,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_utils","_tooltip","_interopRequireDefault","_utils2","_boxControlStyles","_jsxRuntime","_react","groupedSides","AxialInputControls","__next40pxDefaultSize","onChange","onFocus","values","selectedUnits","setSelectedUnits","sides","props","generatedId","useInstanceId","createHandleOnFocus","side","event","handleOnValueChange","next","nextValues","isNumeric","undefined","isNaN","parseFloat","nextValue","top","bottom","left","right","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","jsx","Fragment","children","map","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","selectedUnit","inputId","join","jsxs","InputWrapper","FlexedBoxControlIcon","default","placement","text","LABELS","createElement","StyledUnitControl","className","id","isPressEnterToChange","value","newValue","onUnitChange","label","hideLabelFromVision","key","FlexedRangeControl","__nextHasNoMarginBottom","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/axial-input-controls.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport Tooltip from '../tooltip';\nimport { CUSTOM_VALUE_SETTINGS, LABELS } from './utils';\nimport {\n\tFlexedBoxControlIcon,\n\tFlexedRangeControl,\n\tInputWrapper,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps } from './types';\n\nconst groupedSides = [ 'vertical', 'horizontal' ] as const;\ntype GroupedSide = ( typeof groupedSides )[ number ];\n\nexport default function AxialInputControls( {\n\t__next40pxDefaultSize,\n\tonChange,\n\tonFocus,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst generatedId = useInstanceId(\n\t\tAxialInputControls,\n\t\t`box-control-input`\n\t);\n\n\tconst createHandleOnFocus =\n\t\t( side: GroupedSide ) =>\n\t\t( event: React.FocusEvent< HTMLInputElement > ) => {\n\t\t\tif ( ! onFocus ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonFocus( event, { side } );\n\t\t};\n\n\tconst handleOnValueChange = ( side: GroupedSide, next?: string ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnextValues.top = nextValue;\n\t\t\tnextValues.bottom = nextValue;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnextValues.left = nextValue;\n\t\t\tnextValues.right = nextValue;\n\t\t}\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange =\n\t\t( side: GroupedSide ) => ( next?: string ) => {\n\t\t\tconst newUnits = { ...selectedUnits };\n\n\t\t\tif ( side === 'vertical' ) {\n\t\t\t\tnewUnits.top = next;\n\t\t\t\tnewUnits.bottom = next;\n\t\t\t}\n\n\t\t\tif ( side === 'horizontal' ) {\n\t\t\t\tnewUnits.left = next;\n\t\t\t\tnewUnits.right = next;\n\t\t\t}\n\n\t\t\tsetSelectedUnits( newUnits );\n\t\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? groupedSides.filter( ( side ) => sides.includes( side ) )\n\t\t: groupedSides;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue(\n\t\t\t\t\t\tside === 'vertical' ? values.top : values.left\n\t\t\t\t\t);\n\t\t\t\tconst selectedUnit =\n\t\t\t\t\tside === 'vertical'\n\t\t\t\t\t\t? selectedUnits.top\n\t\t\t\t\t\t: selectedUnits.left;\n\n\t\t\t\tconst inputId = [ generatedId, side ].join( '-' );\n\n\t\t\t\treturn (\n\t\t\t\t\t<InputWrapper key={ side }>\n\t\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t\t<Tooltip placement=\"top-end\" text={ LABELS[ side ] }>\n\t\t\t\t\t\t\t<StyledUnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\t\t\t\tid={ inputId }\n\t\t\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\t\t\tvalue={ [\n\t\t\t\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t\t\t].join( '' ) }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\t\thandleOnValueChange( side, newValue )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tside\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tkey={ side }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<FlexedRangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\taria-controls={ inputId }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t\t\t\tnewValue,\n\t\t\t\t\t\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t\t\t\t\t ].join( '' )\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ selectedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.max ?? 10\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ selectedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InputWrapper>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAKqC,IAAAM,WAAA,GAAAN,OAAA;AAAA,IAAAO,MAAA,GAAAP,OAAA;AAfrC;AACA;AACA;;AAEA;AACA;AACA;;AAYA,MAAMQ,YAAY,GAAG,CAAE,UAAU,EAAE,YAAY,CAAW;AAG3C,SAASC,kBAAkBA,CAAE;EAC3CC,qBAAqB;EACrBC,QAAQ;EACRC,OAAO;EACPC,MAAM;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A9B,sBAAA,cAAAA,sBAAA,GAAI,GACX;UACDmB,KAAK,EAAGlB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAG;UAC7B8B,cAAc,EAAG;QAAO,CACxB,CAAC;MAAA,GArDiBxD,IAsDN,CAAC;IAEjB,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_boxControlIconStyles","require","_jsxRuntime","BASE_ICON_SIZE","BoxControlIcon","size","side","sides","props","isSideDisabled","value","length","includes","hasSide","top","right","bottom","left","scale","jsx","Root","style","transform","children","jsxs","Viewbox","TopStroke","isFocused","RightStroke","BottomStroke","LeftStroke"],"sources":["@wordpress/components/src/box-control/icon.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport {\n\tRoot,\n\tViewbox,\n\tTopStroke,\n\tRightStroke,\n\tBottomStroke,\n\tLeftStroke,\n} from './styles/box-control-icon-styles';\nimport type { BoxControlIconProps, BoxControlProps } from './types';\n\nconst BASE_ICON_SIZE = 24;\n\nexport default function BoxControlIcon( {\n\tsize = 24,\n\tside = 'all',\n\tsides,\n\t...props\n}: WordPressComponentProps< BoxControlIconProps, 'span' > ) {\n\tconst isSideDisabled = (\n\t\tvalue: NonNullable< BoxControlProps[ 'sides' ] >[ number ]\n\t) => sides?.length && ! sides.includes( value );\n\n\tconst hasSide = (\n\t\tvalue: NonNullable< BoxControlProps[ 'sides' ] >[ number ]\n\t) => {\n\t\tif ( isSideDisabled( value ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn side === 'all' || side === value;\n\t};\n\n\tconst top = hasSide( 'top' ) || hasSide( 'vertical' );\n\tconst right = hasSide( 'right' ) || hasSide( 'horizontal' );\n\tconst bottom = hasSide( 'bottom' ) || hasSide( 'vertical' );\n\tconst left = hasSide( 'left' ) || hasSide( 'horizontal' );\n\n\t// Simulates SVG Icon scaling.\n\tconst scale = size / BASE_ICON_SIZE;\n\n\treturn (\n\t\t<Root style={ { transform: `scale(${ scale })` } } { ...props }>\n\t\t\t<Viewbox>\n\t\t\t\t<TopStroke isFocused={ top } />\n\t\t\t\t<RightStroke isFocused={ right } />\n\t\t\t\t<BottomStroke isFocused={ bottom } />\n\t\t\t\t<LeftStroke isFocused={ left } />\n\t\t\t</Viewbox>\n\t\t</Root>\n\t);\n}\n"],"mappings":";;;;;;AAIA,IAAAA,qBAAA,GAAAC,OAAA;AAO0C,IAAAC,WAAA,GAAAD,OAAA;AAX1C;AACA;AACA;;AAYA,MAAME,cAAc,GAAG,EAAE;AAEV,SAASC,cAAcA,CAAE;EACvCC,IAAI,GAAG,EAAE;EACTC,IAAI,GAAG,KAAK;EACZC,KAAK;EACL,GAAGC;AACoD,CAAC,EAAG;EAC3D,MAAMC,cAAc,GACnBC,KAA0D,IACtDH,KAAK,EAAEI,MAAM,IAAI,CAAEJ,KAAK,CAACK,QAAQ,CAAEF,KAAM,CAAC;EAE/C,MAAMG,OAAO,GACZH,KAA0D,IACtD;IACJ,IAAKD,cAAc,CAAEC,KAAM,CAAC,EAAG;MAC9B,OAAO,KAAK;IACb;IAEA,OAAOJ,IAAI,KAAK,KAAK,IAAIA,IAAI,KAAKI,KAAK;EACxC,CAAC;EAED,MAAMI,GAAG,GAAGD,OAAO,CAAE,KAAM,CAAC,IAAIA,OAAO,CAAE,UAAW,CAAC;EACrD,MAAME,KAAK,GAAGF,OAAO,CAAE,OAAQ,CAAC,IAAIA,OAAO,CAAE,YAAa,CAAC;EAC3D,MAAMG,MAAM,GAAGH,OAAO,CAAE,QAAS,CAAC,IAAIA,OAAO,CAAE,UAAW,CAAC;EAC3D,MAAMI,IAAI,GAAGJ,OAAO,CAAE,MAAO,CAAC,IAAIA,OAAO,CAAE,YAAa,CAAC;;EAEzD;EACA,MAAMK,KAAK,GAAGb,IAAI,GAAGF,cAAc;EAEnC,oBACC,IAAAD,WAAA,CAAAiB,GAAA,EAACnB,qBAAA,CAAAoB,IAAI;IAACC,KAAK,EAAG;MAAEC,SAAS,EAAG,SAASJ,KAAO;IAAG,CAAG;IAAA,GAAMV,KAAK;IAAAe,QAAA,eAC5D,IAAArB,WAAA,CAAAsB,IAAA,EAACxB,qBAAA,CAAAyB,OAAO;MAAAF,QAAA,gBACP,IAAArB,WAAA,CAAAiB,GAAA,EAACnB,qBAAA,CAAA0B,SAAS;QAACC,SAAS,EAAGb;MAAK,CAAE,CAAC,eAC/B,IAAAZ,WAAA,CAAAiB,GAAA,EAACnB,qBAAA,CAAA4B,WAAW;QAACD,SAAS,EAAGZ;MAAO,CAAE,CAAC,eACnC,IAAAb,WAAA,CAAAiB,GAAA,EAACnB,qBAAA,CAAA6B,YAAY;QAACF,SAAS,EAAGX;MAAQ,CAAE,CAAC,eACrC,IAAAd,WAAA,CAAAiB,GAAA,EAACnB,qBAAA,CAAA8B,UAAU;QAACH,SAAS,EAAGV;MAAM,CAAE,CAAC;IAAA,CACzB;EAAC,CACL,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["_boxControlIconStyles","require","_jsxRuntime","BASE_ICON_SIZE","BoxControlIcon","size","side","sides","props","isSideDisabled","value","length","includes","hasSide","top","right","bottom","left","scale","jsx","Root","style","transform","children","jsxs","Viewbox","TopStroke","isFocused","RightStroke","BottomStroke","LeftStroke"],"sources":["@wordpress/components/src/box-control/icon.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport {\n\tRoot,\n\tViewbox,\n\tTopStroke,\n\tRightStroke,\n\tBottomStroke,\n\tLeftStroke,\n} from './styles/box-control-icon-styles';\nimport type { BoxControlIconProps, BoxControlProps } from './types';\n\nconst BASE_ICON_SIZE = 24;\n\nexport default function BoxControlIcon( {\n\tsize = 24,\n\tside = 'all',\n\tsides,\n\t...props\n}: WordPressComponentProps< BoxControlIconProps, 'span' > ) {\n\tconst isSideDisabled = (\n\t\tvalue: NonNullable< BoxControlProps[ 'sides' ] >[ number ]\n\t) => sides?.length && ! sides.includes( value );\n\n\tconst hasSide = (\n\t\tvalue: NonNullable< BoxControlProps[ 'sides' ] >[ number ]\n\t) => {\n\t\tif ( isSideDisabled( value ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn side === 'all' || side === value;\n\t};\n\n\tconst top = hasSide( 'top' ) || hasSide( 'vertical' );\n\tconst right = hasSide( 'right' ) || hasSide( 'horizontal' );\n\tconst bottom = hasSide( 'bottom' ) || hasSide( 'vertical' );\n\tconst left = hasSide( 'left' ) || hasSide( 'horizontal' );\n\n\t// Simulates SVG Icon scaling.\n\tconst scale = size / BASE_ICON_SIZE;\n\n\treturn (\n\t\t<Root style={ { transform: `scale(${ scale })` } } { ...props }>\n\t\t\t<Viewbox>\n\t\t\t\t<TopStroke isFocused={ top } />\n\t\t\t\t<RightStroke isFocused={ right } />\n\t\t\t\t<BottomStroke isFocused={ bottom } />\n\t\t\t\t<LeftStroke isFocused={ left } />\n\t\t\t</Viewbox>\n\t\t</Root>\n\t);\n}\n"],"mappings":";;;;;;AAIA,IAAAA,qBAAA,GAAAC,OAAA;AAO0C,IAAAC,WAAA,GAAAD,OAAA;AAX1C;AACA;AACA;;AAYA,MAAME,cAAc,GAAG,EAAE;AAEV,SAASC,cAAcA,CAAE;EACvCC,IAAI,GAAG,EAAE;EACTC,IAAI,GAAG,KAAK;EACZC,KAAK;EACL,GAAGC;AACoD,CAAC,EAAG;EAC3D,MAAMC,cAAc,GACnBC,KAA0D,IACtDH,KAAK,EAAEI,MAAM,IAAI,CAAEJ,KAAK,CAACK,QAAQ,CAAEF,KAAM,CAAC;EAE/C,MAAMG,OAAO,GACZH,KAA0D,IACtD;IACJ,IAAKD,cAAc,CAAEC,KAAM,CAAC,EAAG;MAC9B,OAAO,KAAK;IACb;IAEA,OAAOJ,IAAI,KAAK,KAAK,IAAIA,IAAI,KAAKI,KAAK;EACxC,CAAC;EAED,MAAMI,GAAG,GAAGD,OAAO,CAAE,KAAM,CAAC,IAAIA,OAAO,CAAE,UAAW,CAAC;EACrD,MAAME,KAAK,GAAGF,OAAO,CAAE,OAAQ,CAAC,IAAIA,OAAO,CAAE,YAAa,CAAC;EAC3D,MAAMG,MAAM,GAAGH,OAAO,CAAE,QAAS,CAAC,IAAIA,OAAO,CAAE,UAAW,CAAC;EAC3D,MAAMI,IAAI,GAAGJ,OAAO,CAAE,MAAO,CAAC,IAAIA,OAAO,CAAE,YAAa,CAAC;;EAEzD;EACA,MAAMK,KAAK,GAAGb,IAAI,GAAGF,cAAc;EAEnC,oBACC,IAAAD,WAAA,CAAAiB,GAAA,EAACnB,qBAAA,CAAAoB,IAAI;IAACC,KAAK,EAAG;MAAEC,SAAS,EAAE,SAAUJ,KAAK;IAAK,CAAG;IAAA,GAAMV,KAAK;IAAAe,QAAA,eAC5D,IAAArB,WAAA,CAAAsB,IAAA,EAACxB,qBAAA,CAAAyB,OAAO;MAAAF,QAAA,gBACP,IAAArB,WAAA,CAAAiB,GAAA,EAACnB,qBAAA,CAAA0B,SAAS;QAACC,SAAS,EAAGb;MAAK,CAAE,CAAC,eAC/B,IAAAZ,WAAA,CAAAiB,GAAA,EAACnB,qBAAA,CAAA4B,WAAW;QAACD,SAAS,EAAGZ;MAAO,CAAE,CAAC,eACnC,IAAAb,WAAA,CAAAiB,GAAA,EAACnB,qBAAA,CAAA6B,YAAY;QAACF,SAAS,EAAGX;MAAQ,CAAE,CAAC,eACrC,IAAAd,WAAA,CAAAiB,GAAA,EAACnB,qBAAA,CAAA8B,UAAU;QAACH,SAAS,EAAGV;MAAM,CAAE,CAAC;IAAA,CACzB;EAAC,CACL,CAAC;AAET","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_element","_i18n","_baseControl","_allInputControl","_interopRequireDefault","_inputControls","_axialInputControls","_linkedButton","_grid","_boxControlStyles","_utils","_utils2","_hooks","_jsxRuntime","defaultInputProps","min","noop","useUniqueId","idProp","instanceId","useInstanceId","BoxControl","__next40pxDefaultSize","id","inputProps","onChange","label","__","values","valuesProp","units","sides","splitOnAxis","allowReset","resetValues","DEFAULT_VALUES","onMouseOver","onMouseOut","setValues","useControlledState","fallback","inputValues","hasInitialValue","isValuesDefined","hasOneSide","length","isDirty","setIsDirty","useState","isLinked","setIsLinked","isValuesMixed","side","setSide","getInitialSide","selectedUnits","setSelectedUnits","top","parseQuantityAndUnitFromRawValue","right","bottom","left","headingId","toggleLinked","handleOnFocus","_event","nextSide","handleOnChange","nextValues","handleOnReset","inputControlProps","onFocus","jsxs","Grid","columns","templateColumns","role","children","jsx","BaseControl","VisualLabel","InputWrapper","FlexedBoxControlIcon","default","LinkedButtonWrapper","onClick","ResetButton","className","variant","size","disabled","_default","exports"],"sources":["@wordpress/components/src/box-control/index.tsx"],"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 { BaseControl } from '../base-control';\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport AxialInputControls from './axial-input-controls';\nimport LinkedButton from './linked-button';\nimport { Grid } from '../grid';\nimport {\n\tFlexedBoxControlIcon,\n\tInputWrapper,\n\tResetButton,\n\tLinkedButtonWrapper,\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';\nimport type {\n\tBoxControlIconProps,\n\tBoxControlProps,\n\tBoxControlValue,\n} from './types';\n\nconst defaultInputProps = {\n\tmin: 0,\n};\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( BoxControl, 'inspector-box-control' );\n\n\treturn idProp || instanceId;\n}\n\n/**\n * A control that lets users set values for top, right, bottom, and left. Can be\n * used as an input control for values like `padding` or `margin`.\n *\n * ```jsx\n * import { BoxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function Example() {\n * \tconst [ values, setValues ] = useState( {\n * \t\ttop: '50px',\n * \t\tleft: '10%',\n * \t\tright: '10%',\n * \t\tbottom: '50px',\n * \t} );\n *\n * \treturn (\n * \t\t<BoxControl\n * \t\t\tvalues={ values }\n * \t\t\tonChange={ ( nextValues ) => setValues( nextValues ) }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nfunction BoxControl( {\n\t__next40pxDefaultSize = false,\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\tonMouseOver,\n\tonMouseOut,\n}: BoxControlProps ) {\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< BoxControlIconProps[ 'side' ] >(\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< BoxControlValue >( {\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 = (\n\t\t_event: React.FocusEvent< HTMLInputElement >,\n\t\t{ side: nextSide }: { side: typeof side }\n\t) => {\n\t\tsetSide( nextSide );\n\t};\n\n\tconst handleOnChange = ( nextValues: BoxControlValue ) => {\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\tonMouseOver,\n\t\tonMouseOut,\n\t\t__next40pxDefaultSize,\n\t};\n\n\treturn (\n\t\t<Grid\n\t\t\tid={ id }\n\t\t\tcolumns={ 3 }\n\t\t\ttemplateColumns=\"1fr min-content min-content\"\n\t\t\trole=\"group\"\n\t\t\taria-labelledby={ headingId }\n\t\t>\n\t\t\t<BaseControl.VisualLabel id={ headingId }>\n\t\t\t\t{ label }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t{ isLinked && (\n\t\t\t\t<InputWrapper>\n\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t<AllInputControl { ...inputControlProps } />\n\t\t\t\t</InputWrapper>\n\t\t\t) }\n\t\t\t{ ! hasOneSide && (\n\t\t\t\t<LinkedButtonWrapper>\n\t\t\t\t\t<LinkedButton\n\t\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\t/>\n\t\t\t\t</LinkedButtonWrapper>\n\t\t\t) }\n\n\t\t\t{ ! isLinked && splitOnAxis && (\n\t\t\t\t<AxialInputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t\t{ ! isLinked && ! splitOnAxis && (\n\t\t\t\t<InputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t\t{ allowReset && (\n\t\t\t\t<ResetButton\n\t\t\t\t\tclassName=\"component-box-control__reset-button\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t</ResetButton>\n\t\t\t) }\n\t\t</Grid>\n\t);\n}\n\nexport { applyValueToSides } from './utils';\nexport default BoxControl;\n"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,cAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,mBAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,aAAA,GAAAH,sBAAA,CAAAL,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AAMA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AAMA,IAAAa,MAAA,GAAAb,OAAA;AAAoD,IAAAc,WAAA,GAAAd,OAAA;AA7BpD;AACA;AACA;;AAKA;AACA;AACA;;AA2BA,MAAMe,iBAAiB,GAAG;EACzBC,GAAG,EAAE;AACN,CAAC;AAED,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,WAAWA,CAAEC,MAAe,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GAAA,EAACxE,mBAAA,CAAA6E,OAAkB;MAAA,GAAMb;IAAiB,CAAI,CAC9C,EACC,CAAErB,QAAQ,IAAI,CAAEjB,WAAW,iBAC5B,IAAAnB,WAAA,CAAAiE,GAAA,EAACzE,cAAA,CAAA8E,OAAa;MAAA,GAAMb;IAAiB,CAAI,CACzC,EACCrC,UAAU,iBACX,IAAApB,WAAA,CAAAiE,GAAA,EAACrE,iBAAA,CAAA6E,WAAW;MACXC,SAAS,EAAC,qCAAqC;MAC/CC,OAAO,EAAC,WAAW;MACnBC,IAAI,EAAC,OAAO;MACZJ,OAAO,EAAGhB,aAAe;MACzBqB,QAAQ,EAAG,CAAE5C,OAAS;MAAA+B,QAAA,EAEpB,IAAAlD,QAAE,EAAE,OAAQ;IAAC,CACH,CACb;EAAA,CACI,CAAC;AAET;AAAC,IAAAgE,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAGc9D,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_element","_i18n","_baseControl","_allInputControl","_interopRequireDefault","_inputControls","_axialInputControls","_linkedButton","_grid","_boxControlStyles","_utils","_utils2","_hooks","_jsxRuntime","defaultInputProps","min","noop","useUniqueId","idProp","instanceId","useInstanceId","BoxControl","__next40pxDefaultSize","id","inputProps","onChange","label","__","values","valuesProp","units","sides","splitOnAxis","allowReset","resetValues","DEFAULT_VALUES","onMouseOver","onMouseOut","setValues","useControlledState","fallback","inputValues","hasInitialValue","isValuesDefined","hasOneSide","length","isDirty","setIsDirty","useState","isLinked","setIsLinked","isValuesMixed","side","setSide","getInitialSide","selectedUnits","setSelectedUnits","top","parseQuantityAndUnitFromRawValue","right","bottom","left","headingId","toggleLinked","handleOnFocus","_event","nextSide","handleOnChange","nextValues","handleOnReset","inputControlProps","onFocus","jsxs","Grid","columns","templateColumns","role","children","jsx","BaseControl","VisualLabel","InputWrapper","FlexedBoxControlIcon","default","LinkedButtonWrapper","onClick","ResetButton","className","variant","size","disabled","_default","exports"],"sources":["@wordpress/components/src/box-control/index.tsx"],"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 { BaseControl } from '../base-control';\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport AxialInputControls from './axial-input-controls';\nimport LinkedButton from './linked-button';\nimport { Grid } from '../grid';\nimport {\n\tFlexedBoxControlIcon,\n\tInputWrapper,\n\tResetButton,\n\tLinkedButtonWrapper,\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';\nimport type {\n\tBoxControlIconProps,\n\tBoxControlProps,\n\tBoxControlValue,\n} from './types';\n\nconst defaultInputProps = {\n\tmin: 0,\n};\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( BoxControl, 'inspector-box-control' );\n\n\treturn idProp || instanceId;\n}\n\n/**\n * A control that lets users set values for top, right, bottom, and left. Can be\n * used as an input control for values like `padding` or `margin`.\n *\n * ```jsx\n * import { BoxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function Example() {\n * \tconst [ values, setValues ] = useState( {\n * \t\ttop: '50px',\n * \t\tleft: '10%',\n * \t\tright: '10%',\n * \t\tbottom: '50px',\n * \t} );\n *\n * \treturn (\n * \t\t<BoxControl\n * \t\t\tvalues={ values }\n * \t\t\tonChange={ ( nextValues ) => setValues( nextValues ) }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nfunction BoxControl( {\n\t__next40pxDefaultSize = false,\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\tonMouseOver,\n\tonMouseOut,\n}: BoxControlProps ) {\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< BoxControlIconProps[ 'side' ] >(\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< BoxControlValue >( {\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 = (\n\t\t_event: React.FocusEvent< HTMLInputElement >,\n\t\t{ side: nextSide }: { side: typeof side }\n\t) => {\n\t\tsetSide( nextSide );\n\t};\n\n\tconst handleOnChange = ( nextValues: BoxControlValue ) => {\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\tonMouseOver,\n\t\tonMouseOut,\n\t\t__next40pxDefaultSize,\n\t};\n\n\treturn (\n\t\t<Grid\n\t\t\tid={ id }\n\t\t\tcolumns={ 3 }\n\t\t\ttemplateColumns=\"1fr min-content min-content\"\n\t\t\trole=\"group\"\n\t\t\taria-labelledby={ headingId }\n\t\t>\n\t\t\t<BaseControl.VisualLabel id={ headingId }>\n\t\t\t\t{ label }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t{ isLinked && (\n\t\t\t\t<InputWrapper>\n\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t<AllInputControl { ...inputControlProps } />\n\t\t\t\t</InputWrapper>\n\t\t\t) }\n\t\t\t{ ! hasOneSide && (\n\t\t\t\t<LinkedButtonWrapper>\n\t\t\t\t\t<LinkedButton\n\t\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\t/>\n\t\t\t\t</LinkedButtonWrapper>\n\t\t\t) }\n\n\t\t\t{ ! isLinked && splitOnAxis && (\n\t\t\t\t<AxialInputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t\t{ ! isLinked && ! splitOnAxis && (\n\t\t\t\t<InputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t\t{ allowReset && (\n\t\t\t\t<ResetButton\n\t\t\t\t\tclassName=\"component-box-control__reset-button\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t</ResetButton>\n\t\t\t) }\n\t\t</Grid>\n\t);\n}\n\nexport { applyValueToSides } from './utils';\nexport default BoxControl;\n"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,cAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,mBAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,aAAA,GAAAH,sBAAA,CAAAL,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AAMA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AAMA,IAAAa,MAAA,GAAAb,OAAA;AAAoD,IAAAc,WAAA,GAAAd,OAAA;AA7BpD;AACA;AACA;;AAKA;AACA;AACA;;AA2BA,MAAMe,iBAAiB,GAAG;EACzBC,GAAG,EAAE;AACN,CAAC;AAED,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,WAAWA,CAAEC,MAAe,EAAG;EACvC,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEC,UAAU,EAAE,uBAAwB,CAAC;EAEvE,OAAOH,MAAM,IAAIC,UAAU;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,UAAUA,CAAE;EACpBC,qBAAqB,GAAG,KAAK;EAC7BC,EAAE,EAAEL,MAAM;EACVM,UAAU,GAAGV,iBAAiB;EAC9BW,QAAQ,GAAGT,IAAI;EACfU,KAAK,GAAG,IAAAC,QAAE,EAAE,aAAc,CAAC;EA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B,QAAA,EAEpB,IAAAlD,QAAE,EAAE,OAAQ;IAAC,CACH,CACb;EAAA,CACI,CAAC;AAET;AAAC,IAAAgE,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAGc9D,UAAU","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_tooltip","_interopRequireDefault","_utils","_utils2","_boxControlStyles","_jsxRuntime","noop","BoxInputControls","__next40pxDefaultSize","onChange","onFocus","values","selectedUnits","setSelectedUnits","sides","props","generatedId","useInstanceId","createHandleOnFocus","side","event","handleOnChange","nextValues","handleOnValueChange","next","extra","isNumeric","undefined","isNaN","parseFloat","nextValue","altKey","bottom","top","right","left","createHandleOnUnitChange","newUnits","filteredSides","length","ALL_SIDES","filter","includes","jsx","Fragment","children","map","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","computedUnit","inputId","join","jsxs","InputWrapper","expanded","FlexedBoxControlIcon","default","placement","text","LABELS","StyledUnitControl","className","id","isPressEnterToChange","value","onUnitChange","label","hideLabelFromVision","FlexedRangeControl","__nextHasNoMarginBottom","newValue","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/input-controls.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { ALL_SIDES, CUSTOM_VALUE_SETTINGS, LABELS } from './utils';\nimport {\n\tFlexedBoxControlIcon,\n\tFlexedRangeControl,\n\tInputWrapper,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps, BoxControlValue } from './types';\n\nconst noop = () => {};\n\nexport default function BoxInputControls( {\n\t__next40pxDefaultSize,\n\tonChange = noop,\n\tonFocus = noop,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst generatedId = useInstanceId( BoxInputControls, 'box-control-input' );\n\n\tconst createHandleOnFocus =\n\t\t( side: keyof BoxControlValue ) =>\n\t\t( event: React.FocusEvent< HTMLInputElement > ) => {\n\t\t\tonFocus( event, { side } );\n\t\t};\n\n\tconst handleOnChange = ( nextValues: BoxControlValue ) => {\n\t\tonChange( nextValues );\n\t};\n\n\tconst handleOnValueChange = (\n\t\tside: keyof BoxControlValue,\n\t\tnext?: string,\n\t\textra?: { event: React.SyntheticEvent< Element, Event > }\n\t) => {\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tnextValues[ side ] = nextValue;\n\n\t\t/**\n\t\t * Supports changing pair sides. For example, holding the ALT key\n\t\t * when changing the TOP will also update BOTTOM.\n\t\t */\n\t\t// @ts-expect-error - TODO: event.altKey is only present when the change event was\n\t\t// triggered by a keyboard event. Should this feature be implemented differently so\n\t\t// it also works with drag events?\n\t\tif ( extra?.event.altKey ) {\n\t\t\tswitch ( side ) {\n\t\t\t\tcase 'top':\n\t\t\t\t\tnextValues.bottom = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bottom':\n\t\t\t\t\tnextValues.top = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'left':\n\t\t\t\t\tnextValues.right = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'right':\n\t\t\t\t\tnextValues.left = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\thandleOnChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange =\n\t\t( side: keyof BoxControlValue ) => ( next?: string ) => {\n\t\t\tconst newUnits = { ...selectedUnits };\n\t\t\tnewUnits[ side ] = next;\n\t\t\tsetSelectedUnits( newUnits );\n\t\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? ALL_SIDES.filter( ( side ) => sides.includes( side ) )\n\t\t: ALL_SIDES;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue( values[ side ] );\n\n\t\t\t\tconst computedUnit = values[ side ]\n\t\t\t\t\t? parsedUnit\n\t\t\t\t\t: selectedUnits[ side ];\n\n\t\t\t\tconst inputId = [ generatedId, side ].join( '-' );\n\n\t\t\t\treturn (\n\t\t\t\t\t<InputWrapper key={ `box-control-${ side }` } expanded>\n\t\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t\t<Tooltip placement=\"top-end\" text={ LABELS[ side ] }>\n\t\t\t\t\t\t\t<StyledUnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\t\t\t\tid={ inputId }\n\t\t\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\t\t\tvalue={ [ parsedQuantity, computedUnit ].join(\n\t\t\t\t\t\t\t\t\t''\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ ( nextValue, extra ) =>\n\t\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\t\tnextValue,\n\t\t\t\t\t\t\t\t\t\textra\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tside\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\n\t\t\t\t\t\t<FlexedRangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\taria-controls={ inputId }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t\t\t\t\t\t? [ newValue, computedUnit ].join( '' )\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.max ?? 10\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InputWrapper>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAKqC,IAAAM,WAAA,GAAAN,OAAA;AAfrC;AACA;A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B,6BAAqB,CAAExB,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,IAAI,CAAE,EAC1CyB,IAAI,cAAA7B,sBAAA,cAAAA,sBAAA,GAAI,GACX;UACDmB,KAAK,EAAGlB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAG;UAC7B6B,cAAc,EAAG;QAAO,CACxB,CAAC;MAAA,GArDkB,eAAe3D,IAAM,EAsD5B,CAAC;IAEjB,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_tooltip","_interopRequireDefault","_utils","_utils2","_boxControlStyles","_jsxRuntime","noop","BoxInputControls","__next40pxDefaultSize","onChange","onFocus","values","selectedUnits","setSelectedUnits","sides","props","generatedId","useInstanceId","createHandleOnFocus","side","event","handleOnChange","nextValues","handleOnValueChange","next","extra","isNumeric","undefined","isNaN","parseFloat","nextValue","altKey","bottom","top","right","left","createHandleOnUnitChange","newUnits","filteredSides","length","ALL_SIDES","filter","includes","jsx","Fragment","children","map","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","computedUnit","inputId","join","jsxs","InputWrapper","expanded","FlexedBoxControlIcon","default","placement","text","LABELS","StyledUnitControl","className","id","isPressEnterToChange","value","onUnitChange","label","hideLabelFromVision","FlexedRangeControl","__nextHasNoMarginBottom","newValue","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/input-controls.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { ALL_SIDES, CUSTOM_VALUE_SETTINGS, LABELS } from './utils';\nimport {\n\tFlexedBoxControlIcon,\n\tFlexedRangeControl,\n\tInputWrapper,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps, BoxControlValue } from './types';\n\nconst noop = () => {};\n\nexport default function BoxInputControls( {\n\t__next40pxDefaultSize,\n\tonChange = noop,\n\tonFocus = noop,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst generatedId = useInstanceId( BoxInputControls, 'box-control-input' );\n\n\tconst createHandleOnFocus =\n\t\t( side: keyof BoxControlValue ) =>\n\t\t( event: React.FocusEvent< HTMLInputElement > ) => {\n\t\t\tonFocus( event, { side } );\n\t\t};\n\n\tconst handleOnChange = ( nextValues: BoxControlValue ) => {\n\t\tonChange( nextValues );\n\t};\n\n\tconst handleOnValueChange = (\n\t\tside: keyof BoxControlValue,\n\t\tnext?: string,\n\t\textra?: { event: React.SyntheticEvent< Element, Event > }\n\t) => {\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tnextValues[ side ] = nextValue;\n\n\t\t/**\n\t\t * Supports changing pair sides. For example, holding the ALT key\n\t\t * when changing the TOP will also update BOTTOM.\n\t\t */\n\t\t// @ts-expect-error - TODO: event.altKey is only present when the change event was\n\t\t// triggered by a keyboard event. Should this feature be implemented differently so\n\t\t// it also works with drag events?\n\t\tif ( extra?.event.altKey ) {\n\t\t\tswitch ( side ) {\n\t\t\t\tcase 'top':\n\t\t\t\t\tnextValues.bottom = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bottom':\n\t\t\t\t\tnextValues.top = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'left':\n\t\t\t\t\tnextValues.right = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'right':\n\t\t\t\t\tnextValues.left = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\thandleOnChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange =\n\t\t( side: keyof BoxControlValue ) => ( next?: string ) => {\n\t\t\tconst newUnits = { ...selectedUnits };\n\t\t\tnewUnits[ side ] = next;\n\t\t\tsetSelectedUnits( newUnits );\n\t\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? ALL_SIDES.filter( ( side ) => sides.includes( side ) )\n\t\t: ALL_SIDES;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue( values[ side ] );\n\n\t\t\t\tconst computedUnit = values[ side ]\n\t\t\t\t\t? parsedUnit\n\t\t\t\t\t: selectedUnits[ side ];\n\n\t\t\t\tconst inputId = [ generatedId, side ].join( '-' );\n\n\t\t\t\treturn (\n\t\t\t\t\t<InputWrapper key={ `box-control-${ side }` } expanded>\n\t\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t\t<Tooltip placement=\"top-end\" text={ LABELS[ side ] }>\n\t\t\t\t\t\t\t<StyledUnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\t\t\t\tid={ inputId }\n\t\t\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\t\t\tvalue={ [ parsedQuantity, computedUnit ].join(\n\t\t\t\t\t\t\t\t\t''\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ ( nextValue, extra ) =>\n\t\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\t\tnextValue,\n\t\t\t\t\t\t\t\t\t\textra\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tside\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\n\t\t\t\t\t\t<FlexedRangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\taria-controls={ inputId }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t\t\t\t\t\t? [ newValue, computedUnit ].join( '' )\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.max ?? 10\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InputWrapper>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAC,sBAAA,CA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AAqB,CAAExB,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,IAAI,CAAE,EAC1CuB,GAAG,cAAA5B,qBAAA,cAAAA,qBAAA,GAAI,EACV;UACD8B,IAAI,GAAA7B,sBAAA,GACH4B,6BAAqB,CAAExB,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,IAAI,CAAE,EAC1CyB,IAAI,cAAA7B,sBAAA,cAAAA,sBAAA,GAAI,GACX;UACDmB,KAAK,EAAGlB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAG;UAC7B6B,cAAc,EAAG;QAAO,CACxB,CAAC;MAAA,GArDiB,eAAgB3D,IAAI,EAsD1B,CAAC;IAEjB,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
@@ -140,7 +140,7 @@ function Button(props) {
140
140
  !children || Array.isArray(children) && !children.length) &&
141
141
  // The tooltip is not explicitly disabled.
142
142
  false !== showTooltip);
143
- const newIcon = icon ? (0, _element.cloneElement)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.default, {
143
+ const newIcon = icon ? (0, _element.cloneElement)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.default, {
144
144
  icon: icon,
145
145
  size: iconSize
146
146
  }), {
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_reactNativeGestureHandler","_element","_compose","_tooltip","_interopRequireDefault","_icon","_style","_jsxRuntime","isAndroid","Platform","OS","marginBottom","marginLeft","styles","StyleSheet","create","container","flex","padding","justifyContent","alignItems","buttonInactive","flexDirection","fixedRatio","aspectRatio","buttonActive","borderRadius","subscriptInactive","color","fontWeight","fontSize","alignSelf","subscriptInactiveDark","subscriptActive","Button","props","children","onClick","onLongPress","disabled","hint","isPressed","ariaDisabled","subscript","testID","icon","iconSize","showTooltip","label","shortcut","tooltipPosition","isActiveStyle","customContainerStyles","hitSlop","preferredColorScheme","usePreferredColorScheme","isDisabled","containerStyle","buttonActiveColorStyles","usePreferredColorSchemeStyle","style","buttonViewStyle","opacity","backgroundColor","states","push","newChildren","Children","map","child","cloneElement","colorScheme","shouldShowTooltip","Array","isArray","length","newIcon","jsx","default","size","longPressHandler","useCallback","nativeEvent","state","State","ACTIVE","element","TouchableOpacity","activeOpacity","accessible","accessibilityLabel","accessibilityStates","accessibilityRole","accessibilityHint","onPress","LongPressGestureHandler","minDurationMs","maxDist","onHandlerStateChange","View","jsxs","Text","text","position","visible","_default","exports"],"sources":["@wordpress/components/src/button/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tStyleSheet,\n\tTouchableOpacity,\n\tText,\n\tView,\n\tPlatform,\n} from 'react-native';\nimport { LongPressGestureHandler, State } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, useCallback } from '@wordpress/element';\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport style from './style.scss';\n\nconst isAndroid = Platform.OS === 'android';\nconst marginBottom = isAndroid ? -0.5 : 0;\nconst marginLeft = -3;\n\nconst styles = StyleSheet.create( {\n\tcontainer: {\n\t\tflex: 1,\n\t\tpadding: 3,\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tbuttonInactive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tfixedRatio: {\n\t\taspectRatio: 1,\n\t},\n\tbuttonActive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t\tborderRadius: 6,\n\t},\n\tsubscriptInactive: {\n\t\tcolor: '#7b9ab1', // $toolbar-button.\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n\tsubscriptInactiveDark: {\n\t\tcolor: '#a7aaad', // $gray_20.\n\t},\n\tsubscriptActive: {\n\t\tcolor: 'white',\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n} );\n\nexport function Button( props ) {\n\tconst {\n\t\tchildren,\n\t\tonClick,\n\t\tonLongPress,\n\t\tdisabled,\n\t\thint,\n\t\tfixedRatio = true,\n\t\tisPressed,\n\t\t'aria-disabled': ariaDisabled,\n\t\t'data-subscript': subscript,\n\t\ttestID,\n\t\ticon,\n\t\ticonSize,\n\t\tshowTooltip,\n\t\tlabel,\n\t\tshortcut,\n\t\ttooltipPosition,\n\t\tisActiveStyle,\n\t\tcustomContainerStyles,\n\t\thitSlop,\n\t} = props;\n\tconst preferredColorScheme = usePreferredColorScheme();\n\n\tconst isDisabled = ariaDisabled || disabled;\n\n\tconst containerStyle = [\n\t\tstyles.container,\n\t\tcustomContainerStyles && { ...customContainerStyles },\n\t];\n\n\tconst buttonActiveColorStyles = usePreferredColorSchemeStyle(\n\t\tstyle[ 'components-button-light--active' ],\n\t\tstyle[ 'components-button-dark--active' ]\n\t);\n\n\tconst buttonViewStyle = {\n\t\topacity: isDisabled ? 0.3 : 1,\n\t\t...( fixedRatio && styles.fixedRatio ),\n\t\t...( isPressed ? styles.buttonActive : styles.buttonInactive ),\n\t\t...( isPressed ? buttonActiveColorStyles : {} ),\n\t\t...( isPressed &&\n\t\t\tisActiveStyle?.borderRadius && {\n\t\t\t\tborderRadius: isActiveStyle.borderRadius,\n\t\t\t} ),\n\t\t...( isActiveStyle?.backgroundColor && {\n\t\t\tbackgroundColor: isActiveStyle.backgroundColor,\n\t\t} ),\n\t};\n\n\tconst states = [];\n\tif ( isPressed ) {\n\t\tstates.push( 'selected' );\n\t}\n\n\tif ( isDisabled ) {\n\t\tstates.push( 'disabled' );\n\t}\n\n\tconst subscriptInactive = usePreferredColorSchemeStyle(\n\t\tstyles.subscriptInactive,\n\t\tstyles.subscriptInactiveDark\n\t);\n\n\tconst newChildren = Children.map( children, ( child ) => {\n\t\treturn child\n\t\t\t? cloneElement( child, {\n\t\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\t\tisPressed,\n\t\t\t } )\n\t\t\t: child;\n\t} );\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! isDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t( ! children ||\n\t\t\t\t\t( Array.isArray( children ) && ! children.length ) ) &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst newIcon = icon\n\t\t? cloneElement( <Icon icon={ icon } size={ iconSize } />, {\n\t\t\t\tisPressed,\n\t\t } )\n\t\t: null;\n\n\tconst longPressHandler = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tif ( nativeEvent.state === State.ACTIVE && onLongPress ) {\n\t\t\t\tonLongPress();\n\t\t\t}\n\t\t},\n\t\t[ onLongPress ]\n\t);\n\n\tconst element = (\n\t\t<TouchableOpacity\n\t\t\tactiveOpacity={ 0.7 }\n\t\t\taccessible\n\t\t\taccessibilityLabel={ label }\n\t\t\taccessibilityStates={ states }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessibilityHint={ hint }\n\t\t\tonPress={ onClick }\n\t\t\tstyle={ containerStyle }\n\t\t\tdisabled={ isDisabled }\n\t\t\ttestID={ testID }\n\t\t\thitSlop={ hitSlop }\n\t\t>\n\t\t\t<LongPressGestureHandler\n\t\t\t\tminDurationMs={ 500 }\n\t\t\t\tmaxDist={ 150 }\n\t\t\t\tonHandlerStateChange={ longPressHandler }\n\t\t\t>\n\t\t\t\t<View style={ buttonViewStyle }>\n\t\t\t\t\t<View style={ { flexDirection: 'row' } }>\n\t\t\t\t\t\t{ newIcon }\n\t\t\t\t\t\t{ newChildren }\n\t\t\t\t\t\t{ subscript && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tisPressed\n\t\t\t\t\t\t\t\t\t\t? styles.subscriptActive\n\t\t\t\t\t\t\t\t\t\t: subscriptInactive\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ subscript }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</LongPressGestureHandler>\n\t\t</TouchableOpacity>\n\t);\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn element;\n\t}\n\n\treturn (\n\t\t<Tooltip\n\t\t\ttext={ label }\n\t\t\tshortcut={ shortcut }\n\t\t\tposition={ tooltipPosition }\n\t\t\tvisible={ showTooltip === true }\n\t\t>\n\t\t\t{ element }\n\t\t</Tooltip>\n\t);\n}\n\nexport default Button;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,0BAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAQA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,KAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,MAAA,GAAAF,sBAAA,CAAAL,OAAA;AAAiC,IAAAQ,WAAA,GAAAR,OAAA;AA1BjC;AACA;AACA;;AAUA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,MAAMS,SAAS,GAAGC,qBAAQ,CAACC,EAAE,KAAK,SAAS;AAC3C,MAAMC,YAAY,GAAGH,SAAS,GAAG,CAAC,GAAG,GAAG,CAAC;AACzC,MAAMI,UAAU,GAAG,CAAC,CAAC;AAErB,MAAMC,MAAM,GAAGC,uBAAU,CAACC,MAAM,CAAE;EACjCC,SAAS,E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BAAuB;MACvBC,aAAa,EAAG,GAAK;MACrBC,OAAO,EAAG,GAAK;MACfC,oBAAoB,EAAGlB,gBAAkB;MAAA5C,QAAA,eAEzC,IAAA7B,WAAA,CAAAsE,GAAA,EAAC/E,YAAA,CAAAqG,IAAI;QAACvC,KAAK,EAAGC,eAAiB;QAAAzB,QAAA,eAC9B,IAAA7B,WAAA,CAAA6F,IAAA,EAACtG,YAAA,CAAAqG,IAAI;UAACvC,KAAK,EAAG;YAAEtC,aAAa,EAAE;UAAM,CAAG;UAAAc,QAAA,GACrCwC,OAAO,EACPV,WAAW,EACXvB,SAAS,iBACV,IAAApC,WAAA,CAAAsE,GAAA,EAAC/E,YAAA,CAAAuG,IAAI;YACJzC,KAAK,EACJnB,SAAS,GACN5B,MAAM,CAACoB,eAAe,GACtBN,iBACH;YAAAS,QAAA,EAECO;UAAS,CACN,CACN;QAAA,CACI;MAAC,CACF;IAAC,CACiB;EAAC,CACT,CAClB;EAED,IAAK,CAAE6B,iBAAiB,EAAG;IAC1B,OAAOc,OAAO;EACf;EAEA,oBACC,IAAA/E,WAAA,CAAAsE,GAAA,EAAC1E,QAAA,CAAA2E,OAAO;IACPwB,IAAI,EAAGtD,KAAO;IACdC,QAAQ,EAAGA,QAAU;IACrBsD,QAAQ,EAAGrD,eAAiB;IAC5BsD,OAAO,EAAGzD,WAAW,KAAK,IAAM;IAAAX,QAAA,EAE9BkD;EAAO,CACD,CAAC;AAEZ;AAAC,IAAAmB,QAAA,GAAAC,OAAA,CAAA5B,OAAA,GAEc5C,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_reactNativeGestureHandler","_element","_compose","_tooltip","_interopRequireDefault","_icon","_style","_jsxRuntime","isAndroid","Platform","OS","marginBottom","marginLeft","styles","StyleSheet","create","container","flex","padding","justifyContent","alignItems","buttonInactive","flexDirection","fixedRatio","aspectRatio","buttonActive","borderRadius","subscriptInactive","color","fontWeight","fontSize","alignSelf","subscriptInactiveDark","subscriptActive","Button","props","children","onClick","onLongPress","disabled","hint","isPressed","ariaDisabled","subscript","testID","icon","iconSize","showTooltip","label","shortcut","tooltipPosition","isActiveStyle","customContainerStyles","hitSlop","preferredColorScheme","usePreferredColorScheme","isDisabled","containerStyle","buttonActiveColorStyles","usePreferredColorSchemeStyle","style","buttonViewStyle","opacity","backgroundColor","states","push","newChildren","Children","map","child","cloneElement","colorScheme","shouldShowTooltip","Array","isArray","length","newIcon","jsx","default","size","longPressHandler","useCallback","nativeEvent","state","State","ACTIVE","element","TouchableOpacity","activeOpacity","accessible","accessibilityLabel","accessibilityStates","accessibilityRole","accessibilityHint","onPress","LongPressGestureHandler","minDurationMs","maxDist","onHandlerStateChange","View","jsxs","Text","text","position","visible","_default","exports"],"sources":["@wordpress/components/src/button/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tStyleSheet,\n\tTouchableOpacity,\n\tText,\n\tView,\n\tPlatform,\n} from 'react-native';\nimport { LongPressGestureHandler, State } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Children, cloneElement, useCallback } from '@wordpress/element';\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport style from './style.scss';\n\nconst isAndroid = Platform.OS === 'android';\nconst marginBottom = isAndroid ? -0.5 : 0;\nconst marginLeft = -3;\n\nconst styles = StyleSheet.create( {\n\tcontainer: {\n\t\tflex: 1,\n\t\tpadding: 3,\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tbuttonInactive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t},\n\tfixedRatio: {\n\t\taspectRatio: 1,\n\t},\n\tbuttonActive: {\n\t\tflex: 1,\n\t\tflexDirection: 'row',\n\t\tjustifyContent: 'center',\n\t\talignItems: 'center',\n\t\tborderRadius: 6,\n\t},\n\tsubscriptInactive: {\n\t\tcolor: '#7b9ab1', // $toolbar-button.\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n\tsubscriptInactiveDark: {\n\t\tcolor: '#a7aaad', // $gray_20.\n\t},\n\tsubscriptActive: {\n\t\tcolor: 'white',\n\t\tfontWeight: 'bold',\n\t\tfontSize: 13,\n\t\talignSelf: 'flex-end',\n\t\tmarginLeft,\n\t\tmarginBottom,\n\t},\n} );\n\nexport function Button( props ) {\n\tconst {\n\t\tchildren,\n\t\tonClick,\n\t\tonLongPress,\n\t\tdisabled,\n\t\thint,\n\t\tfixedRatio = true,\n\t\tisPressed,\n\t\t'aria-disabled': ariaDisabled,\n\t\t'data-subscript': subscript,\n\t\ttestID,\n\t\ticon,\n\t\ticonSize,\n\t\tshowTooltip,\n\t\tlabel,\n\t\tshortcut,\n\t\ttooltipPosition,\n\t\tisActiveStyle,\n\t\tcustomContainerStyles,\n\t\thitSlop,\n\t} = props;\n\tconst preferredColorScheme = usePreferredColorScheme();\n\n\tconst isDisabled = ariaDisabled || disabled;\n\n\tconst containerStyle = [\n\t\tstyles.container,\n\t\tcustomContainerStyles && { ...customContainerStyles },\n\t];\n\n\tconst buttonActiveColorStyles = usePreferredColorSchemeStyle(\n\t\tstyle[ 'components-button-light--active' ],\n\t\tstyle[ 'components-button-dark--active' ]\n\t);\n\n\tconst buttonViewStyle = {\n\t\topacity: isDisabled ? 0.3 : 1,\n\t\t...( fixedRatio && styles.fixedRatio ),\n\t\t...( isPressed ? styles.buttonActive : styles.buttonInactive ),\n\t\t...( isPressed ? buttonActiveColorStyles : {} ),\n\t\t...( isPressed &&\n\t\t\tisActiveStyle?.borderRadius && {\n\t\t\t\tborderRadius: isActiveStyle.borderRadius,\n\t\t\t} ),\n\t\t...( isActiveStyle?.backgroundColor && {\n\t\t\tbackgroundColor: isActiveStyle.backgroundColor,\n\t\t} ),\n\t};\n\n\tconst states = [];\n\tif ( isPressed ) {\n\t\tstates.push( 'selected' );\n\t}\n\n\tif ( isDisabled ) {\n\t\tstates.push( 'disabled' );\n\t}\n\n\tconst subscriptInactive = usePreferredColorSchemeStyle(\n\t\tstyles.subscriptInactive,\n\t\tstyles.subscriptInactiveDark\n\t);\n\n\tconst newChildren = Children.map( children, ( child ) => {\n\t\treturn child\n\t\t\t? cloneElement( child, {\n\t\t\t\t\tcolorScheme: preferredColorScheme,\n\t\t\t\t\tisPressed,\n\t\t\t } )\n\t\t\t: child;\n\t} );\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! isDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\tshortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t( ! children ||\n\t\t\t\t\t( Array.isArray( children ) && ! children.length ) ) &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst newIcon = icon\n\t\t? cloneElement( <Icon icon={ icon } size={ iconSize } />, {\n\t\t\t\tisPressed,\n\t\t } )\n\t\t: null;\n\n\tconst longPressHandler = useCallback(\n\t\t( { nativeEvent } ) => {\n\t\t\tif ( nativeEvent.state === State.ACTIVE && onLongPress ) {\n\t\t\t\tonLongPress();\n\t\t\t}\n\t\t},\n\t\t[ onLongPress ]\n\t);\n\n\tconst element = (\n\t\t<TouchableOpacity\n\t\t\tactiveOpacity={ 0.7 }\n\t\t\taccessible\n\t\t\taccessibilityLabel={ label }\n\t\t\taccessibilityStates={ states }\n\t\t\taccessibilityRole=\"button\"\n\t\t\taccessibilityHint={ hint }\n\t\t\tonPress={ onClick }\n\t\t\tstyle={ containerStyle }\n\t\t\tdisabled={ isDisabled }\n\t\t\ttestID={ testID }\n\t\t\thitSlop={ hitSlop }\n\t\t>\n\t\t\t<LongPressGestureHandler\n\t\t\t\tminDurationMs={ 500 }\n\t\t\t\tmaxDist={ 150 }\n\t\t\t\tonHandlerStateChange={ longPressHandler }\n\t\t\t>\n\t\t\t\t<View style={ buttonViewStyle }>\n\t\t\t\t\t<View style={ { flexDirection: 'row' } }>\n\t\t\t\t\t\t{ newIcon }\n\t\t\t\t\t\t{ newChildren }\n\t\t\t\t\t\t{ subscript && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tstyle={\n\t\t\t\t\t\t\t\t\tisPressed\n\t\t\t\t\t\t\t\t\t\t? styles.subscriptActive\n\t\t\t\t\t\t\t\t\t\t: subscriptInactive\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ subscript }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</View>\n\t\t\t\t</View>\n\t\t\t</LongPressGestureHandler>\n\t\t</TouchableOpacity>\n\t);\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn element;\n\t}\n\n\treturn (\n\t\t<Tooltip\n\t\t\ttext={ label }\n\t\t\tshortcut={ shortcut }\n\t\t\tposition={ tooltipPosition }\n\t\t\tvisible={ showTooltip === true }\n\t\t>\n\t\t\t{ element }\n\t\t</Tooltip>\n\t);\n}\n\nexport default Button;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,0BAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAQA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,KAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,MAAA,GAAAF,sBAAA,CAAAL,OAAA;AAAiC,IAAAQ,WAAA,GAAAR,OAAA;AA1BjC;AACA;AACA;;AAUA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,MAAMS,SAAS,GAAGC,qBAAQ,CA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41
  const elevationBorderRadius = isRounded ? _configValues.default.radiusLarge : 0;
42
42
  const cx = (0, _useCx.useCx)();
43
- const elevationClassName = (0, _element.useMemo)(() => cx( /*#__PURE__*/(0, _react.css)({
43
+ const elevationClassName = (0, _element.useMemo)(() => cx(/*#__PURE__*/(0, _react.css)({
44
44
  borderRadius: elevationBorderRadius
45
45
  }, process.env.NODE_ENV === "production" ? "" : ";label:elevationClassName;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY2FyZC9jYXJkL2NvbXBvbmVudC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBeUNZIiwiZmlsZSI6IkB3b3JkcHJlc3MvY29tcG9uZW50cy9zcmMvY2FyZC9jYXJkL2NvbXBvbmVudC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV4dGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgdHlwZSB7IEZvcndhcmRlZFJlZiB9IGZyb20gJ3JlYWN0JztcblxuLyoqXG4gKiBXb3JkUHJlc3MgZGVwZW5kZW5jaWVzXG4gKi9cbmltcG9ydCB7IHVzZU1lbW8gfSBmcm9tICdAd29yZHByZXNzL2VsZW1lbnQnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgdHlwZSB7IFdvcmRQcmVzc0NvbXBvbmVudFByb3BzIH0gZnJvbSAnLi4vLi4vY29udGV4dCc7XG5pbXBvcnQgeyBjb250ZXh0Q29ubmVjdCwgQ29udGV4dFN5c3RlbVByb3ZpZGVyIH0gZnJvbSAnLi4vLi4vY29udGV4dCc7XG5pbXBvcnQgeyBFbGV2YXRpb24gfSBmcm9tICcuLi8uLi9lbGV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elevationBorderRadius]);
46
46
  const contextProviderValue = (0, _element.useMemo)(() => {
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_element","_context","_elevation","_view","styles","_interopRequireWildcard","_hook","_configValues","_interopRequireDefault","_useCx","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedCard","props","forwardedRef","children","elevation","isBorderless","isRounded","size","otherProps","useCard","elevationBorderRadius","CONFIG","radiusLarge","cx","useCx","elevationClassName","useMemo","css","borderRadius","process","env","NODE_ENV","contextProviderValue","contextProps","CardBody","CardHeader","CardFooter","jsx","ContextSystemProvider","value","jsxs","View","ref","className","Content","Elevation","isInteractive","Card","exports","contextConnect","_default"],"sources":["@wordpress/components/src/card/card/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, ContextSystemProvider } from '../../context';\nimport { Elevation } from '../../elevation';\nimport { View } from '../../view';\nimport * as styles from '../styles';\nimport { useCard } from './hook';\nimport CONFIG from '../../utils/config-values';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport type { Props } from '../types';\n\nfunction UnconnectedCard(\n\tprops: WordPressComponentProps< Props, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tchildren,\n\t\televation,\n\t\tisBorderless,\n\t\tisRounded,\n\t\tsize,\n\t\t...otherProps\n\t} = useCard( props );\n\tconst elevationBorderRadius = isRounded ? CONFIG.radiusLarge : 0;\n\n\tconst cx = useCx();\n\n\tconst elevationClassName = useMemo(\n\t\t() => cx( css( { borderRadius: elevationBorderRadius } ) ),\n\t\t[ cx, elevationBorderRadius ]\n\t);\n\n\tconst contextProviderValue = useMemo( () => {\n\t\tconst contextProps = {\n\t\t\tsize,\n\t\t\tisBorderless,\n\t\t};\n\t\treturn {\n\t\t\tCardBody: contextProps,\n\t\t\tCardHeader: contextProps,\n\t\t\tCardFooter: contextProps,\n\t\t};\n\t}, [ isBorderless, size ] );\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextProviderValue }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef }>\n\t\t\t\t<View className={ cx( styles.Content ) }>{ children }</View>\n\t\t\t\t<Elevation\n\t\t\t\t\tclassName={ elevationClassName }\n\t\t\t\t\tisInteractive={ false }\n\t\t\t\t\tvalue={ elevation ? 1 : 0 }\n\t\t\t\t/>\n\t\t\t\t<Elevation\n\t\t\t\t\tclassName={ elevationClassName }\n\t\t\t\t\tisInteractive={ false }\n\t\t\t\t\tvalue={ elevation }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</ContextSystemProvider>\n\t);\n}\n\n/**\n * `Card` provides a flexible and extensible content container.\n * `Card` also provides a convenient set of sub-components such as `CardBody`,\n * `CardHeader`, `CardFooter`, and more.\n *\n * ```jsx\n * import {\n * Card,\n * CardHeader,\n * CardBody,\n * CardFooter,\n * __experimentalText as Text,\n * __experimentalHeading as Heading,\n * } from `@wordpress/components`;\n *\n * function Example() {\n * return (\n * <Card>\n * <CardHeader>\n * <Heading level={ 4 }>Card Title</Heading>\n * </CardHeader>\n * <CardBody>\n * <Text>Card Content</Text>\n * </CardBody>\n * <CardFooter>\n * <Text>Card Footer</Text>\n * </CardFooter>\n * </Card>\n * );\n * }\n * ```\n */\nexport const Card = contextConnect( UnconnectedCard, 'Card' );\n\nexport default Card;\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAC,uBAAA,CAAAN,OAA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AAC6D,OAAQ,CAAG;QAAA/B,QAAA,EAAGA;MAAQ,CAAQ,CAAC,eAC5D,IAAAxB,WAAA,CAAAgD,GAAA,EAACxD,UAAA,CAAAgE,SAAS;QACTF,SAAS,EAAGlB,kBAAoB;QAChCqB,aAAa,EAAG,KAAO;QACvBP,KAAK,EAAGzB,SAAS,GAAG,CAAC,GAAG;MAAG,CAC3B,CAAC,eACF,IAAAzB,WAAA,CAAAgD,GAAA,EAACxD,UAAA,CAAAgE,SAAS;QACTF,SAAS,EAAGlB,kBAAoB;QAChCqB,aAAa,EAAG,KAAO;QACvBP,KAAK,EAAGzB;MAAW,CACnB,CAAC;IAAA,CACG;EAAC,CACe,CAAC;AAE1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMiC,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG,IAAAE,uBAAc,EAAEvC,eAAe,EAAE,MAAO,CAAC;AAAC,IAAAwC,QAAA,GAAAF,OAAA,CAAApD,OAAA,GAE/CmD,IAAI","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_element","_context","_elevation","_view","styles","_interopRequireWildcard","_hook","_configValues","_interopRequireDefault","_useCx","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","UnconnectedCard","props","forwardedRef","children","elevation","isBorderless","isRounded","size","otherProps","useCard","elevationBorderRadius","CONFIG","radiusLarge","cx","useCx","elevationClassName","useMemo","css","borderRadius","process","env","NODE_ENV","contextProviderValue","contextProps","CardBody","CardHeader","CardFooter","jsx","ContextSystemProvider","value","jsxs","View","ref","className","Content","Elevation","isInteractive","Card","exports","contextConnect","_default"],"sources":["@wordpress/components/src/card/card/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect, ContextSystemProvider } from '../../context';\nimport { Elevation } from '../../elevation';\nimport { View } from '../../view';\nimport * as styles from '../styles';\nimport { useCard } from './hook';\nimport CONFIG from '../../utils/config-values';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport type { Props } from '../types';\n\nfunction UnconnectedCard(\n\tprops: WordPressComponentProps< Props, 'div' >,\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst {\n\t\tchildren,\n\t\televation,\n\t\tisBorderless,\n\t\tisRounded,\n\t\tsize,\n\t\t...otherProps\n\t} = useCard( props );\n\tconst elevationBorderRadius = isRounded ? CONFIG.radiusLarge : 0;\n\n\tconst cx = useCx();\n\n\tconst elevationClassName = useMemo(\n\t\t() => cx( css( { borderRadius: elevationBorderRadius } ) ),\n\t\t[ cx, elevationBorderRadius ]\n\t);\n\n\tconst contextProviderValue = useMemo( () => {\n\t\tconst contextProps = {\n\t\t\tsize,\n\t\t\tisBorderless,\n\t\t};\n\t\treturn {\n\t\t\tCardBody: contextProps,\n\t\t\tCardHeader: contextProps,\n\t\t\tCardFooter: contextProps,\n\t\t};\n\t}, [ isBorderless, size ] );\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextProviderValue }>\n\t\t\t<View { ...otherProps } ref={ forwardedRef }>\n\t\t\t\t<View className={ cx( styles.Content ) }>{ children }</View>\n\t\t\t\t<Elevation\n\t\t\t\t\tclassName={ elevationClassName }\n\t\t\t\t\tisInteractive={ false }\n\t\t\t\t\tvalue={ elevation ? 1 : 0 }\n\t\t\t\t/>\n\t\t\t\t<Elevation\n\t\t\t\t\tclassName={ elevationClassName }\n\t\t\t\t\tisInteractive={ false }\n\t\t\t\t\tvalue={ elevation }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</ContextSystemProvider>\n\t);\n}\n\n/**\n * `Card` provides a flexible and extensible content container.\n * `Card` also provides a convenient set of sub-components such as `CardBody`,\n * `CardHeader`, `CardFooter`, and more.\n *\n * ```jsx\n * import {\n * Card,\n * CardHeader,\n * CardBody,\n * CardFooter,\n * __experimentalText as Text,\n * __experimentalHeading as Heading,\n * } from `@wordpress/components`;\n *\n * function Example() {\n * return (\n * <Card>\n * <CardHeader>\n * <Heading level={ 4 }>Card Title</Heading>\n * </CardHeader>\n * <CardBody>\n * <Text>Card Content</Text>\n * </CardBody>\n * <CardFooter>\n * <Text>Card Footer</Text>\n * </CardFooter>\n * </Card>\n * );\n * }\n * ```\n */\nexport const Card = contextConnect( UnconnectedCard, 'Card' );\n\nexport default Card;\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAC,uBAAA,CAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,aAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAAiD,IAAAW,WAAA,GAAAX,OAAA;AAAA,SAAAY,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMiC,IAAI,GAAAC,OAAA,CAAAD,IAAA,GAAG,IAAAE,uBAAc,EAAEvC,eAAe,EAAE,MAAO,CAAC;AAAC,IAAAwC,QAAA,GAAAF,OAAA,CAAApD,OAAA,GAE/CmD,IAAI","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_utils","_EMOTION_STRINGIFIED_CSS_ERROR__","adjustedBorderRadius","CONFIG","radiusLarge","Card","exports","css","surfaceBorderColor","process","env","NODE_ENV","Header","name","styles","map","toString","Footer","Content","Body","Media","Divider","borderRadius","borderColor","colorDivider","boxShadowless","borderless","rounded","xSmallCardPadding","cardPaddingXSmall","cardPaddings","large","cardPaddingLarge","medium","cardPaddingMedium","small","cardPaddingSmall","xSmall","extraSmall","shady","COLORS","ui","backgroundDisabled"],"sources":["@wordpress/components/src/card/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\n\n// Since the border for `Card` is rendered via the `box-shadow` property\n// (as opposed to the `border` property), the value of the border radius needs\n// to be adjusted by removing 1px (this is because the `box-shadow` renders\n// as an \"outer radius\").\nconst adjustedBorderRadius = `calc(${ CONFIG.radiusLarge } - 1px)`;\n\nexport const Card = css`\n\tbox-shadow: 0 0 0 1px ${ CONFIG.surfaceBorderColor };\n\toutline: none;\n`;\n\nexport const Header = css`\n\tborder-bottom: 1px solid;\n\tbox-sizing: border-box;\n\n\t&:last-child {\n\t\tborder-bottom: none;\n\t}\n`;\n\nexport const Footer = css`\n\tborder-top: 1px solid;\n\tbox-sizing: border-box;\n\n\t&:first-of-type {\n\t\tborder-top: none;\n\t}\n`;\n\nexport const Content = css`\n\theight: 100%;\n`;\n\nexport const Body = css`\n\tbox-sizing: border-box;\n\theight: auto;\n\tmax-height: 100%;\n`;\n\nexport const Media = css`\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\n\t& > img,\n\t& > iframe {\n\t\tdisplay: block;\n\t\theight: auto;\n\t\tmax-width: 100%;\n\t\twidth: 100%;\n\t}\n`;\n\nexport const Divider = css`\n\tbox-sizing: border-box;\n\tdisplay: block;\n\twidth: 100%;\n`;\n\nexport const borderRadius = css`\n\t&:first-of-type {\n\t\tborder-top-left-radius: ${ adjustedBorderRadius };\n\t\tborder-top-right-radius: ${ adjustedBorderRadius };\n\t}\n\n\t&:last-of-type {\n\t\tborder-bottom-left-radius: ${ adjustedBorderRadius };\n\t\tborder-bottom-right-radius: ${ adjustedBorderRadius };\n\t}\n`;\n\nexport const borderColor = css`\n\tborder-color: ${ CONFIG.colorDivider };\n`;\n\nexport const boxShadowless = css`\n\tbox-shadow: none;\n`;\n\nexport const borderless = css`\n\tborder: none;\n`;\n\nexport const rounded = css`\n\tborder-radius: ${ adjustedBorderRadius };\n`;\n\nconst xSmallCardPadding = css`\n\tpadding: ${ CONFIG.cardPaddingXSmall };\n`;\n\nexport const cardPaddings = {\n\tlarge: css`\n\t\tpadding: ${ CONFIG.cardPaddingLarge };\n\t`,\n\tmedium: css`\n\t\tpadding: ${ CONFIG.cardPaddingMedium };\n\t`,\n\tsmall: css`\n\t\tpadding: ${ CONFIG.cardPaddingSmall };\n\t`,\n\txSmall: xSmallCardPadding,\n\t// The `extraSmall` size is not officially documented, but the following styles\n\t// are kept for legacy reasons to support older values of the `size` prop.\n\textraSmall: xSmallCardPadding,\n};\n\nexport const shady = css`\n\tbackground-color: ${ COLORS.ui.backgroundDisabled };\n`;\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAA0C,SAAAE,iCAAA,gPAR1C;AACA;AACA,GAFA,CAKA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAI,QAAQC,aAAM,CAACC,WAAa,SAAQ;AAE3D,MAAMC,IAAI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OAAA,CAAAwB,YAAA,GAAG;EAC3BC,KAAK,mBAAExB,UAAG,cACGJ,aAAM,CAAC6B,gBAAgB,SAAAvB,OAAA,CAAAC,GAAA,CAAAC,QAAA,2CAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,2oHACnC;EACDsB,MAAM,mBAAE1B,UAAG,cACEJ,aAAM,CAAC+B,iBAAiB,SAAAzB,OAAA,CAAAC,GAAA,CAAAC,QAAA,4CAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,2oHACpC;EACDwB,KAAK,mBAAE5B,UAAG,cACGJ,aAAM,CAACiC,gBAAgB,SAAA3B,OAAA,CAAAC,GAAA,CAAAC,QAAA,2CAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,2oHACnC;EACD0B,MAAM,EAAET,iBAAiB;EACzB;EACA;EACAU,UAAU,EAAEV;AACb,CAAC;AAEM,MAAMW,KAAK,GAAAjC,OAAA,CAAAiC,KAAA,oBAAGhC,UAAG,uBACFiC,aAAM,CAACC,EAAE,CAACC,kBAAkB,SAAAjC,OAAA,CAAAC,GAAA,CAAAC,QAAA,2CAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,2oHACjD","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_utils","_EMOTION_STRINGIFIED_CSS_ERROR__","adjustedBorderRadius","CONFIG","radiusLarge","Card","exports","css","surfaceBorderColor","process","env","NODE_ENV","Header","name","styles","map","toString","Footer","Content","Body","Media","Divider","borderRadius","borderColor","colorDivider","boxShadowless","borderless","rounded","xSmallCardPadding","cardPaddingXSmall","cardPaddings","large","cardPaddingLarge","medium","cardPaddingMedium","small","cardPaddingSmall","xSmall","extraSmall","shady","COLORS","ui","backgroundDisabled"],"sources":["@wordpress/components/src/card/styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\n\n/**\n * Internal dependencies\n */\nimport { COLORS, CONFIG } from '../utils';\n\n// Since the border for `Card` is rendered via the `box-shadow` property\n// (as opposed to the `border` property), the value of the border radius needs\n// to be adjusted by removing 1px (this is because the `box-shadow` renders\n// as an \"outer radius\").\nconst adjustedBorderRadius = `calc(${ CONFIG.radiusLarge } - 1px)`;\n\nexport const Card = css`\n\tbox-shadow: 0 0 0 1px ${ CONFIG.surfaceBorderColor };\n\toutline: none;\n`;\n\nexport const Header = css`\n\tborder-bottom: 1px solid;\n\tbox-sizing: border-box;\n\n\t&:last-child {\n\t\tborder-bottom: none;\n\t}\n`;\n\nexport const Footer = css`\n\tborder-top: 1px solid;\n\tbox-sizing: border-box;\n\n\t&:first-of-type {\n\t\tborder-top: none;\n\t}\n`;\n\nexport const Content = css`\n\theight: 100%;\n`;\n\nexport const Body = css`\n\tbox-sizing: border-box;\n\theight: auto;\n\tmax-height: 100%;\n`;\n\nexport const Media = css`\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\n\t& > img,\n\t& > iframe {\n\t\tdisplay: block;\n\t\theight: auto;\n\t\tmax-width: 100%;\n\t\twidth: 100%;\n\t}\n`;\n\nexport const Divider = css`\n\tbox-sizing: border-box;\n\tdisplay: block;\n\twidth: 100%;\n`;\n\nexport const borderRadius = css`\n\t&:first-of-type {\n\t\tborder-top-left-radius: ${ adjustedBorderRadius };\n\t\tborder-top-right-radius: ${ adjustedBorderRadius };\n\t}\n\n\t&:last-of-type {\n\t\tborder-bottom-left-radius: ${ adjustedBorderRadius };\n\t\tborder-bottom-right-radius: ${ adjustedBorderRadius };\n\t}\n`;\n\nexport const borderColor = css`\n\tborder-color: ${ CONFIG.colorDivider };\n`;\n\nexport const boxShadowless = css`\n\tbox-shadow: none;\n`;\n\nexport const borderless = css`\n\tborder: none;\n`;\n\nexport const rounded = css`\n\tborder-radius: ${ adjustedBorderRadius };\n`;\n\nconst xSmallCardPadding = css`\n\tpadding: ${ CONFIG.cardPaddingXSmall };\n`;\n\nexport const cardPaddings = {\n\tlarge: css`\n\t\tpadding: ${ CONFIG.cardPaddingLarge };\n\t`,\n\tmedium: css`\n\t\tpadding: ${ CONFIG.cardPaddingMedium };\n\t`,\n\tsmall: css`\n\t\tpadding: ${ CONFIG.cardPaddingSmall };\n\t`,\n\txSmall: xSmallCardPadding,\n\t// The `extraSmall` size is not officially documented, but the following styles\n\t// are kept for legacy reasons to support older values of the `size` prop.\n\textraSmall: xSmallCardPadding,\n};\n\nexport const shady = css`\n\tbackground-color: ${ COLORS.ui.backgroundDisabled };\n`;\n"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAA0C,SAAAE,iCAAA,gPAR1C;AACA;AACA,GAFA,CAKA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA,MAAMC,oBAAoB,GAAG,QAASC,aAAM,CAACC,WAAW,SAAU;AAE3D,MAAMC,IAAI,GAAAC,OAAA,CAAAD,IAAA,oBAAGE,UAAG,2BACGJ,aAAM,CAACK,kBAAkB,sBAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,0CAAAF,OAAA,CAAAC,GAAA,CAAAC,QAAA,2oHAElD;AAEM,MAAMC,MAAM,GAAAN,OAAA,CAAAM,MAAA,GAAAH,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAE,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAf;AAAA,CAOlB;AAEM,MAAMgB,MAAM,GAAAX,OAAA,CAAAW,MAAA,GAAAR,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAE,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAf;AAAA,CAOlB;AAEM,MAAMiB,OAAO,GAAAZ,OAAA,CAAAY,OAAA,GAAAT,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAE,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAf;AAAA,CAEnB;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