@wordpress/components 25.15.1-next.79a6196f.0 → 26.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1422) hide show
  1. package/.stylelintrc.js +23 -0
  2. package/CHANGELOG.md +74 -2
  3. package/build/alignment-matrix-control/icon.js +1 -2
  4. package/build/alignment-matrix-control/icon.js.map +1 -1
  5. package/build/alignment-matrix-control/index.js +1 -2
  6. package/build/alignment-matrix-control/index.js.map +1 -1
  7. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js +4 -8
  8. package/build/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js.map +1 -1
  9. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +4 -8
  10. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  11. package/build/alignment-matrix-control/utils.js +3 -6
  12. package/build/alignment-matrix-control/utils.js.map +1 -1
  13. package/build/angle-picker-control/angle-circle.js +1 -2
  14. package/build/angle-picker-control/angle-circle.js.map +1 -1
  15. package/build/angle-picker-control/index.js +3 -15
  16. package/build/angle-picker-control/index.js.map +1 -1
  17. package/build/angle-picker-control/styles/angle-picker-control-styles.js +9 -27
  18. package/build/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  19. package/build/angle-picker-control/types.js.map +1 -1
  20. package/build/animate/index.js +1 -2
  21. package/build/animate/index.js.map +1 -1
  22. package/build/autocomplete/autocompleter-ui.native.js +1 -2
  23. package/build/autocomplete/autocompleter-ui.native.js.map +1 -1
  24. package/build/autocomplete/background-view.android.js +1 -2
  25. package/build/autocomplete/background-view.android.js.map +1 -1
  26. package/build/autocomplete/background-view.ios.js +1 -2
  27. package/build/autocomplete/background-view.ios.js.map +1 -1
  28. package/build/base-control/index.js +2 -4
  29. package/build/base-control/index.js.map +1 -1
  30. package/build/base-control/styles/base-control-styles.js +5 -10
  31. package/build/base-control/styles/base-control-styles.js.map +1 -1
  32. package/build/border-box-control/border-box-control/component.js +2 -4
  33. package/build/border-box-control/border-box-control/component.js.map +1 -1
  34. package/build/border-box-control/border-box-control/hook.js +5 -3
  35. package/build/border-box-control/border-box-control/hook.js.map +1 -1
  36. package/build/border-box-control/border-box-control-linked-button/component.js +1 -2
  37. package/build/border-box-control/border-box-control-linked-button/component.js.map +1 -1
  38. package/build/border-box-control/border-box-control-linked-button/hook.js +2 -2
  39. package/build/border-box-control/border-box-control-linked-button/hook.js.map +1 -1
  40. package/build/border-box-control/border-box-control-split-controls/component.js +1 -2
  41. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  42. package/build/border-box-control/border-box-control-split-controls/hook.js +2 -2
  43. package/build/border-box-control/border-box-control-split-controls/hook.js.map +1 -1
  44. package/build/border-box-control/border-box-control-visualizer/component.js +1 -2
  45. package/build/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  46. package/build/border-box-control/border-box-control-visualizer/hook.js +2 -2
  47. package/build/border-box-control/border-box-control-visualizer/hook.js.map +1 -1
  48. package/build/border-box-control/styles.js +3 -6
  49. package/build/border-box-control/styles.js.map +1 -1
  50. package/build/border-box-control/types.js.map +1 -1
  51. package/build/border-control/border-control/component.js +7 -5
  52. package/build/border-control/border-control/component.js.map +1 -1
  53. package/build/border-control/border-control/hook.js +20 -17
  54. package/build/border-control/border-control/hook.js.map +1 -1
  55. package/build/border-control/border-control-dropdown/component.js +3 -3
  56. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  57. package/build/border-control/border-control-dropdown/hook.js +2 -2
  58. package/build/border-control/border-control-dropdown/hook.js.map +1 -1
  59. package/build/border-control/border-control-style-picker/component.js +21 -50
  60. package/build/border-control/border-control-style-picker/component.js.map +1 -1
  61. package/build/border-control/styles.js +16 -35
  62. package/build/border-control/styles.js.map +1 -1
  63. package/build/border-control/types.js.map +1 -1
  64. package/build/box-control/all-input-control.js +35 -29
  65. package/build/box-control/all-input-control.js.map +1 -1
  66. package/build/box-control/axial-input-controls.js +40 -54
  67. package/build/box-control/axial-input-controls.js.map +1 -1
  68. package/build/box-control/index.js +22 -26
  69. package/build/box-control/index.js.map +1 -1
  70. package/build/box-control/input-controls.js +45 -37
  71. package/build/box-control/input-controls.js.map +1 -1
  72. package/build/box-control/styles/box-control-icon-styles.js +6 -12
  73. package/build/box-control/styles/box-control-icon-styles.js.map +1 -1
  74. package/build/box-control/styles/box-control-styles.js +44 -112
  75. package/build/box-control/styles/box-control-styles.js.map +1 -1
  76. package/build/box-control/types.js.map +1 -1
  77. package/build/box-control/utils.js +125 -14
  78. package/build/box-control/utils.js.map +1 -1
  79. package/build/button/deprecated.js +1 -2
  80. package/build/button/deprecated.js.map +1 -1
  81. package/build/button/index.js +16 -20
  82. package/build/button/index.js.map +1 -1
  83. package/build/button/index.native.js +1 -3
  84. package/build/button/index.native.js.map +1 -1
  85. package/build/button/types.js.map +1 -1
  86. package/build/button-group/index.js +2 -4
  87. package/build/button-group/index.js.map +1 -1
  88. package/build/card/card/component.js +4 -6
  89. package/build/card/card/component.js.map +1 -1
  90. package/build/card/card/hook.js +2 -2
  91. package/build/card/card/hook.js.map +1 -1
  92. package/build/card/card-body/component.js +2 -4
  93. package/build/card/card-body/component.js.map +1 -1
  94. package/build/card/card-body/hook.js +2 -2
  95. package/build/card/card-body/hook.js.map +1 -1
  96. package/build/card/card-divider/component.js +2 -4
  97. package/build/card/card-divider/component.js.map +1 -1
  98. package/build/card/card-divider/hook.js +2 -2
  99. package/build/card/card-divider/hook.js.map +1 -1
  100. package/build/card/card-footer/component.js +2 -4
  101. package/build/card/card-footer/component.js.map +1 -1
  102. package/build/card/card-footer/hook.js +2 -2
  103. package/build/card/card-footer/hook.js.map +1 -1
  104. package/build/card/card-header/component.js +2 -4
  105. package/build/card/card-header/component.js.map +1 -1
  106. package/build/card/card-header/hook.js +2 -2
  107. package/build/card/card-header/hook.js.map +1 -1
  108. package/build/card/card-media/component.js +2 -4
  109. package/build/card/card-media/component.js.map +1 -1
  110. package/build/card/card-media/hook.js +2 -2
  111. package/build/card/card-media/hook.js.map +1 -1
  112. package/build/card/context.js +1 -2
  113. package/build/card/context.js.map +1 -1
  114. package/build/card/index.js +2 -2
  115. package/build/card/index.js.map +1 -1
  116. package/build/card/styles.js +14 -28
  117. package/build/card/styles.js.map +1 -1
  118. package/build/checkbox-control/index.js +1 -2
  119. package/build/checkbox-control/index.js.map +1 -1
  120. package/build/checkbox-control/types.js.map +1 -1
  121. package/build/circular-option-picker/circular-option-picker-context.js +1 -2
  122. package/build/circular-option-picker/circular-option-picker-context.js.map +1 -1
  123. package/build/circular-option-picker/circular-option-picker.js +1 -2
  124. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  125. package/build/circular-option-picker/index.js +1 -2
  126. package/build/circular-option-picker/index.js.map +1 -1
  127. package/build/color-control/index.native.js +1 -2
  128. package/build/color-control/index.native.js.map +1 -1
  129. package/build/color-indicator/index.js +2 -4
  130. package/build/color-indicator/index.js.map +1 -1
  131. package/build/color-indicator/index.native.js +1 -2
  132. package/build/color-indicator/index.native.js.map +1 -1
  133. package/build/color-palette/index.js +2 -4
  134. package/build/color-palette/index.js.map +1 -1
  135. package/build/color-palette/index.native.js +1 -2
  136. package/build/color-palette/index.native.js.map +1 -1
  137. package/build/color-palette/styles.js +1 -2
  138. package/build/color-palette/styles.js.map +1 -1
  139. package/build/color-picker/component.js +2 -4
  140. package/build/color-picker/component.js.map +1 -1
  141. package/build/color-picker/hsl-input.js +55 -33
  142. package/build/color-picker/hsl-input.js.map +1 -1
  143. package/build/color-picker/hsv-color-picker.native.js +1 -2
  144. package/build/color-picker/hsv-color-picker.native.js.map +1 -1
  145. package/build/color-picker/hue-picker.native.js +2 -2
  146. package/build/color-picker/hue-picker.native.js.map +1 -1
  147. package/build/color-picker/saturation-picker.native.js +2 -2
  148. package/build/color-picker/saturation-picker.native.js.map +1 -1
  149. package/build/color-picker/styles.js +8 -16
  150. package/build/color-picker/styles.js.map +1 -1
  151. package/build/combobox-control/index.js +2 -3
  152. package/build/combobox-control/index.js.map +1 -1
  153. package/build/combobox-control/styles.js +1 -2
  154. package/build/combobox-control/styles.js.map +1 -1
  155. package/build/composite/current/index.js +43 -0
  156. package/build/composite/current/index.js.map +1 -0
  157. package/build/composite/index.js +10 -24
  158. package/build/composite/index.js.map +1 -1
  159. package/build/composite/legacy/index.js +127 -0
  160. package/build/composite/legacy/index.js.map +1 -0
  161. package/build/composite/v2.js +10 -36
  162. package/build/composite/v2.js.map +1 -1
  163. package/build/confirm-dialog/component.js +6 -6
  164. package/build/confirm-dialog/component.js.map +1 -1
  165. package/build/confirm-dialog/styles.js +1 -2
  166. package/build/confirm-dialog/styles.js.map +1 -1
  167. package/build/context/constants.js +3 -6
  168. package/build/context/constants.js.map +1 -1
  169. package/build/context/context-system-provider.js +2 -4
  170. package/build/context/context-system-provider.js.map +1 -1
  171. package/build/context/get-styled-class-name-from-key.js +1 -2
  172. package/build/context/get-styled-class-name-from-key.js.map +1 -1
  173. package/build/context/wordpress-component.js.map +1 -1
  174. package/build/custom-gradient-picker/constants.js +5 -10
  175. package/build/custom-gradient-picker/constants.js.map +1 -1
  176. package/build/custom-gradient-picker/gradient-bar/constants.js +7 -14
  177. package/build/custom-gradient-picker/gradient-bar/constants.js.map +1 -1
  178. package/build/custom-gradient-picker/gradient-bar/control-points.js +1 -2
  179. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  180. package/build/custom-gradient-picker/index.js +2 -17
  181. package/build/custom-gradient-picker/index.js.map +1 -1
  182. package/build/custom-gradient-picker/index.native.js +1 -2
  183. package/build/custom-gradient-picker/index.native.js.map +1 -1
  184. package/build/custom-gradient-picker/styles/custom-gradient-picker-styles.js +2 -4
  185. package/build/custom-gradient-picker/styles/custom-gradient-picker-styles.js.map +1 -1
  186. package/build/custom-gradient-picker/types.js.map +1 -1
  187. package/build/custom-select-control/index.js +1 -1
  188. package/build/custom-select-control/index.js.map +1 -1
  189. package/build/custom-select-control/styles.js +1 -2
  190. package/build/custom-select-control/styles.js.map +1 -1
  191. package/build/custom-select-control-v2/index.js +9 -7
  192. package/build/custom-select-control-v2/index.js.map +1 -1
  193. package/build/custom-select-control-v2/styles.js +6 -10
  194. package/build/custom-select-control-v2/styles.js.map +1 -1
  195. package/build/dashicon/index.js +1 -2
  196. package/build/dashicon/index.js.map +1 -1
  197. package/build/dashicon/index.native.js +3 -4
  198. package/build/dashicon/index.native.js.map +1 -1
  199. package/build/date-time/constants.js +1 -2
  200. package/build/date-time/constants.js.map +1 -1
  201. package/build/date-time/date/index.js +1 -2
  202. package/build/date-time/date/index.js.map +1 -1
  203. package/build/date-time/date/styles.js +6 -12
  204. package/build/date-time/date/styles.js.map +1 -1
  205. package/build/date-time/date-time/index.js +2 -4
  206. package/build/date-time/date-time/index.js.map +1 -1
  207. package/build/date-time/date-time/styles.js +1 -2
  208. package/build/date-time/date-time/styles.js.map +1 -1
  209. package/build/date-time/index.js +1 -2
  210. package/build/date-time/index.js.map +1 -1
  211. package/build/date-time/time/index.js +1 -2
  212. package/build/date-time/time/index.js.map +1 -1
  213. package/build/date-time/time/styles.js +10 -20
  214. package/build/date-time/time/styles.js.map +1 -1
  215. package/build/date-time/time/timezone.js +2 -3
  216. package/build/date-time/time/timezone.js.map +1 -1
  217. package/build/dimension-control/index.js +3 -4
  218. package/build/dimension-control/index.js.map +1 -1
  219. package/build/dimension-control/sizes.js +1 -2
  220. package/build/dimension-control/sizes.js.map +1 -1
  221. package/build/disabled/index.js +1 -2
  222. package/build/disabled/index.js.map +1 -1
  223. package/build/disabled/index.native.js +1 -2
  224. package/build/disabled/index.native.js.map +1 -1
  225. package/build/disabled/styles/disabled-styles.js +1 -2
  226. package/build/disabled/styles/disabled-styles.js.map +1 -1
  227. package/build/disclosure/index.js +4 -6
  228. package/build/disclosure/index.js.map +1 -1
  229. package/build/divider/component.js +4 -6
  230. package/build/divider/component.js.map +1 -1
  231. package/build/divider/styles.js +1 -2
  232. package/build/divider/styles.js.map +1 -1
  233. package/build/draggable/index.js +1 -2
  234. package/build/draggable/index.js.map +1 -1
  235. package/build/draggable/index.native.js +3 -4
  236. package/build/draggable/index.native.js.map +1 -1
  237. package/build/drop-zone/index.js +1 -2
  238. package/build/drop-zone/index.js.map +1 -1
  239. package/build/dropdown/dropdown-content-wrapper.js +2 -4
  240. package/build/dropdown/dropdown-content-wrapper.js.map +1 -1
  241. package/build/dropdown/index.js +2 -4
  242. package/build/dropdown/index.js.map +1 -1
  243. package/build/dropdown/index.native.js +1 -2
  244. package/build/dropdown/index.native.js.map +1 -1
  245. package/build/dropdown/styles.js +1 -2
  246. package/build/dropdown/styles.js.map +1 -1
  247. package/build/dropdown-menu/index.js +2 -4
  248. package/build/dropdown-menu/index.js.map +1 -1
  249. package/build/dropdown-menu/index.native.js +1 -2
  250. package/build/dropdown-menu/index.native.js.map +1 -1
  251. package/build/dropdown-menu-v2/index.js +11 -20
  252. package/build/dropdown-menu-v2/index.js.map +1 -1
  253. package/build/dropdown-menu-v2/styles.js +29 -42
  254. package/build/dropdown-menu-v2/styles.js.map +1 -1
  255. package/build/duotone-picker/color-list-picker/index.js +1 -2
  256. package/build/duotone-picker/color-list-picker/index.js.map +1 -1
  257. package/build/duotone-picker/duotone-picker.js +1 -2
  258. package/build/duotone-picker/duotone-picker.js.map +1 -1
  259. package/build/duotone-picker/duotone-swatch.js +1 -2
  260. package/build/duotone-picker/duotone-swatch.js.map +1 -1
  261. package/build/elevation/component.js +2 -4
  262. package/build/elevation/component.js.map +1 -1
  263. package/build/elevation/hook.js +2 -2
  264. package/build/elevation/hook.js.map +1 -1
  265. package/build/elevation/styles.js +1 -2
  266. package/build/elevation/styles.js.map +1 -1
  267. package/build/external-link/index.js +3 -5
  268. package/build/external-link/index.js.map +1 -1
  269. package/build/external-link/index.native.js +1 -2
  270. package/build/external-link/index.native.js.map +1 -1
  271. package/build/external-link/styles/external-link-styles.js +1 -2
  272. package/build/external-link/styles/external-link-styles.js.map +1 -1
  273. package/build/flex/context.js +1 -2
  274. package/build/flex/context.js.map +1 -1
  275. package/build/flex/flex/component.js +2 -4
  276. package/build/flex/flex/component.js.map +1 -1
  277. package/build/flex/flex/hook.js +2 -2
  278. package/build/flex/flex/hook.js.map +1 -1
  279. package/build/flex/flex-block/component.js +2 -4
  280. package/build/flex/flex-block/component.js.map +1 -1
  281. package/build/flex/flex-item/component.js +2 -4
  282. package/build/flex/flex-item/component.js.map +1 -1
  283. package/build/flex/flex-item/hook.js +2 -2
  284. package/build/flex/flex-item/hook.js.map +1 -1
  285. package/build/flex/index.js +2 -2
  286. package/build/flex/index.js.map +1 -1
  287. package/build/flex/styles.js +5 -10
  288. package/build/flex/styles.js.map +1 -1
  289. package/build/focal-point-picker/index.js +3 -4
  290. package/build/focal-point-picker/index.js.map +1 -1
  291. package/build/focal-point-picker/index.native.js +1 -3
  292. package/build/focal-point-picker/index.native.js.map +1 -1
  293. package/build/focal-point-picker/styles/focal-point-picker-style.js +37 -54
  294. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  295. package/build/focal-point-picker/styles/focal-point-style.js +12 -4
  296. package/build/focal-point-picker/styles/focal-point-style.js.map +1 -1
  297. package/build/focal-point-picker/tooltip/index.native.js +1 -2
  298. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  299. package/build/focal-point-picker/utils.js +1 -2
  300. package/build/focal-point-picker/utils.js.map +1 -1
  301. package/build/font-size-picker/constants.js +2 -4
  302. package/build/font-size-picker/constants.js.map +1 -1
  303. package/build/font-size-picker/font-size-picker-select.js +1 -2
  304. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  305. package/build/font-size-picker/font-size-picker-toggle-group.js +2 -4
  306. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  307. package/build/font-size-picker/index.js +6 -22
  308. package/build/font-size-picker/index.js.map +1 -1
  309. package/build/font-size-picker/index.native.js +3 -4
  310. package/build/font-size-picker/index.native.js.map +1 -1
  311. package/build/font-size-picker/styles.js +17 -29
  312. package/build/font-size-picker/styles.js.map +1 -1
  313. package/build/font-size-picker/types.js.map +1 -1
  314. package/build/footer-message-control/index.native.js +1 -2
  315. package/build/footer-message-control/index.native.js.map +1 -1
  316. package/build/form-file-upload/index.js +1 -2
  317. package/build/form-file-upload/index.js.map +1 -1
  318. package/build/form-toggle/index.js +1 -2
  319. package/build/form-toggle/index.js.map +1 -1
  320. package/build/form-token-field/index.js +2 -7
  321. package/build/form-token-field/index.js.map +1 -1
  322. package/build/form-token-field/styles.js +1 -2
  323. package/build/form-token-field/styles.js.map +1 -1
  324. package/build/form-token-field/suggestions-list.js +1 -2
  325. package/build/form-token-field/suggestions-list.js.map +1 -1
  326. package/build/form-token-field/token-input.js +2 -4
  327. package/build/form-token-field/token-input.js.map +1 -1
  328. package/build/gradient-picker/index.js +19 -43
  329. package/build/gradient-picker/index.js.map +1 -1
  330. package/build/gradient-picker/types.js.map +1 -1
  331. package/build/grid/component.js +2 -4
  332. package/build/grid/component.js.map +1 -1
  333. package/build/guide/index.js +1 -2
  334. package/build/guide/index.js.map +1 -1
  335. package/build/h-stack/component.js +2 -4
  336. package/build/h-stack/component.js.map +1 -1
  337. package/build/heading/component.js +2 -4
  338. package/build/heading/component.js.map +1 -1
  339. package/build/higher-order/navigate-regions/index.js +1 -2
  340. package/build/higher-order/navigate-regions/index.js.map +1 -1
  341. package/build/higher-order/with-constrained-tabbing/index.js +1 -2
  342. package/build/higher-order/with-constrained-tabbing/index.js.map +1 -1
  343. package/build/higher-order/with-focus-outside/index.js +1 -2
  344. package/build/higher-order/with-focus-outside/index.js.map +1 -1
  345. package/build/higher-order/with-focus-outside/index.native.js +1 -2
  346. package/build/higher-order/with-focus-outside/index.native.js.map +1 -1
  347. package/build/higher-order/with-focus-return/index.js +1 -2
  348. package/build/higher-order/with-focus-return/index.js.map +1 -1
  349. package/build/higher-order/with-notices/index.js +1 -2
  350. package/build/higher-order/with-notices/index.js.map +1 -1
  351. package/build/higher-order/with-spoken-messages/index.js +1 -2
  352. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  353. package/build/icon/index.js +1 -2
  354. package/build/icon/index.js.map +1 -1
  355. package/build/index.js +2 -2
  356. package/build/index.js.map +1 -1
  357. package/build/index.native.js +2 -2
  358. package/build/index.native.js.map +1 -1
  359. package/build/input-control/backdrop.js +3 -2
  360. package/build/input-control/backdrop.js.map +1 -1
  361. package/build/input-control/index.js +3 -5
  362. package/build/input-control/index.js.map +1 -1
  363. package/build/input-control/input-base.js +4 -3
  364. package/build/input-control/input-base.js.map +1 -1
  365. package/build/input-control/input-field.js +1 -2
  366. package/build/input-control/input-field.js.map +1 -1
  367. package/build/input-control/input-prefix-wrapper.js +2 -4
  368. package/build/input-control/input-prefix-wrapper.js.map +1 -1
  369. package/build/input-control/input-suffix-wrapper.js +2 -4
  370. package/build/input-control/input-suffix-wrapper.js.map +1 -1
  371. package/build/input-control/reducer/actions.js +11 -22
  372. package/build/input-control/reducer/actions.js.map +1 -1
  373. package/build/input-control/reducer/reducer.js +2 -2
  374. package/build/input-control/reducer/reducer.js.map +1 -1
  375. package/build/input-control/reducer/state.js +1 -2
  376. package/build/input-control/reducer/state.js.map +1 -1
  377. package/build/input-control/styles/input-control-styles.js +32 -37
  378. package/build/input-control/styles/input-control-styles.js.map +1 -1
  379. package/build/input-control/types.js.map +1 -1
  380. package/build/isolated-event-container/index.js +1 -2
  381. package/build/isolated-event-container/index.js.map +1 -1
  382. package/build/item-group/context.js +1 -2
  383. package/build/item-group/context.js.map +1 -1
  384. package/build/item-group/item/component.js +2 -4
  385. package/build/item-group/item/component.js.map +1 -1
  386. package/build/item-group/item/hook.js +2 -2
  387. package/build/item-group/item/hook.js.map +1 -1
  388. package/build/item-group/item-group/component.js +2 -4
  389. package/build/item-group/item-group/component.js.map +1 -1
  390. package/build/item-group/item-group/hook.js +2 -2
  391. package/build/item-group/item-group/hook.js.map +1 -1
  392. package/build/item-group/styles.js +13 -20
  393. package/build/item-group/styles.js.map +1 -1
  394. package/build/keyboard-shortcuts/index.js +1 -2
  395. package/build/keyboard-shortcuts/index.js.map +1 -1
  396. package/build/keyboard-shortcuts/index.native.js +1 -2
  397. package/build/keyboard-shortcuts/index.native.js.map +1 -1
  398. package/build/menu-group/index.js +1 -2
  399. package/build/menu-group/index.js.map +1 -1
  400. package/build/menu-item/index.js +2 -4
  401. package/build/menu-item/index.js.map +1 -1
  402. package/build/menu-items-choice/index.js +1 -2
  403. package/build/menu-items-choice/index.js.map +1 -1
  404. package/build/mobile/audio-player/index.native.js +1 -2
  405. package/build/mobile/audio-player/index.native.js.map +1 -1
  406. package/build/mobile/badge/index.native.js +1 -2
  407. package/build/mobile/badge/index.native.js.map +1 -1
  408. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js +1 -2
  409. package/build/mobile/bottom-sheet/bottom-sheet-context.native.js.map +1 -1
  410. package/build/mobile/bottom-sheet/bottom-sheet-navigation/bottom-sheet-navigation-context.native.js +1 -2
  411. package/build/mobile/bottom-sheet/bottom-sheet-navigation/bottom-sheet-navigation-context.native.js.map +1 -1
  412. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js +3 -4
  413. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-container.native.js.map +1 -1
  414. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -2
  415. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  416. package/build/mobile/bottom-sheet/button.native.js +1 -2
  417. package/build/mobile/bottom-sheet/button.native.js.map +1 -1
  418. package/build/mobile/bottom-sheet/cell.native.js +1 -2
  419. package/build/mobile/bottom-sheet/cell.native.js.map +1 -1
  420. package/build/mobile/bottom-sheet/chevron-back.native.js +1 -2
  421. package/build/mobile/bottom-sheet/chevron-back.native.js.map +1 -1
  422. package/build/mobile/bottom-sheet/footer-message-cell.native.js +1 -2
  423. package/build/mobile/bottom-sheet/footer-message-cell.native.js.map +1 -1
  424. package/build/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js +1 -2
  425. package/build/mobile/bottom-sheet/footer-message-link/footer-message-link.native.js.map +1 -1
  426. package/build/mobile/bottom-sheet/index.native.js +1 -2
  427. package/build/mobile/bottom-sheet/index.native.js.map +1 -1
  428. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js +1 -2
  429. package/build/mobile/bottom-sheet/keyboard-avoiding-view.native.js.map +1 -1
  430. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js +1 -2
  431. package/build/mobile/bottom-sheet/link-suggestion-item-cell.native.js.map +1 -1
  432. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js +1 -2
  433. package/build/mobile/bottom-sheet/nav-bar/action-button.native.js.map +1 -1
  434. package/build/mobile/bottom-sheet/nav-bar/apply-button.native.js +1 -2
  435. package/build/mobile/bottom-sheet/nav-bar/apply-button.native.js.map +1 -1
  436. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js +1 -2
  437. package/build/mobile/bottom-sheet/nav-bar/back-button.native.js.map +1 -1
  438. package/build/mobile/bottom-sheet/nav-bar/heading.native.js +1 -2
  439. package/build/mobile/bottom-sheet/nav-bar/heading.native.js.map +1 -1
  440. package/build/mobile/bottom-sheet/nav-bar/index.native.js +1 -2
  441. package/build/mobile/bottom-sheet/nav-bar/index.native.js.map +1 -1
  442. package/build/mobile/bottom-sheet/range-cell.native.js +1 -2
  443. package/build/mobile/bottom-sheet/range-cell.native.js.map +1 -1
  444. package/build/mobile/bottom-sheet/range-text-input.native.js +1 -2
  445. package/build/mobile/bottom-sheet/range-text-input.native.js.map +1 -1
  446. package/build/mobile/bottom-sheet/ripple.native.js +1 -2
  447. package/build/mobile/bottom-sheet/ripple.native.js.map +1 -1
  448. package/build/mobile/bottom-sheet/stepper-cell/index.native.js +1 -2
  449. package/build/mobile/bottom-sheet/stepper-cell/index.native.js.map +1 -1
  450. package/build/mobile/bottom-sheet/stepper-cell/stepper.android.js +1 -2
  451. package/build/mobile/bottom-sheet/stepper-cell/stepper.android.js.map +1 -1
  452. package/build/mobile/bottom-sheet/stepper-cell/stepper.ios.js +1 -2
  453. package/build/mobile/bottom-sheet/stepper-cell/stepper.ios.js.map +1 -1
  454. package/build/mobile/bottom-sheet/sub-sheet/index.native.js +1 -2
  455. package/build/mobile/bottom-sheet/sub-sheet/index.native.js.map +1 -1
  456. package/build/mobile/bottom-sheet-select-control/index.native.js +1 -2
  457. package/build/mobile/bottom-sheet-select-control/index.native.js.map +1 -1
  458. package/build/mobile/bottom-sheet-text-control/index.native.js +1 -2
  459. package/build/mobile/bottom-sheet-text-control/index.native.js.map +1 -1
  460. package/build/mobile/color-settings/gradient-picker-screen.native.js +1 -2
  461. package/build/mobile/color-settings/gradient-picker-screen.native.js.map +1 -1
  462. package/build/mobile/color-settings/index.native.js +1 -2
  463. package/build/mobile/color-settings/index.native.js.map +1 -1
  464. package/build/mobile/color-settings/palette.screen.native.js +1 -2
  465. package/build/mobile/color-settings/palette.screen.native.js.map +1 -1
  466. package/build/mobile/color-settings/picker-screen.native.js +1 -2
  467. package/build/mobile/color-settings/picker-screen.native.js.map +1 -1
  468. package/build/mobile/color-settings/utils.native.js +1 -2
  469. package/build/mobile/color-settings/utils.native.js.map +1 -1
  470. package/build/mobile/cycle-select-control/index.native.js +1 -2
  471. package/build/mobile/cycle-select-control/index.native.js.map +1 -1
  472. package/build/mobile/dashicons/index.native.js +3 -6
  473. package/build/mobile/dashicons/index.native.js.map +1 -1
  474. package/build/mobile/focal-point-settings-panel/index.native.js +1 -2
  475. package/build/mobile/focal-point-settings-panel/index.native.js.map +1 -1
  476. package/build/mobile/global-styles-context/index.native.js +1 -2
  477. package/build/mobile/global-styles-context/index.native.js.map +1 -1
  478. package/build/mobile/global-styles-context/utils.native.js +1 -2
  479. package/build/mobile/global-styles-context/utils.native.js.map +1 -1
  480. package/build/mobile/gradient/index.native.js +1 -2
  481. package/build/mobile/gradient/index.native.js.map +1 -1
  482. package/build/mobile/gridicons/index.native.js +8 -16
  483. package/build/mobile/gridicons/index.native.js.map +1 -1
  484. package/build/mobile/html-text-input/index.native.js +1 -2
  485. package/build/mobile/html-text-input/index.native.js.map +1 -1
  486. package/build/mobile/image/constants.js +1 -2
  487. package/build/mobile/image/constants.js.map +1 -1
  488. package/build/mobile/image/icon-customize.native.js +1 -2
  489. package/build/mobile/image/icon-customize.native.js.map +1 -1
  490. package/build/mobile/image/icon-retry.native.js +1 -2
  491. package/build/mobile/image/icon-retry.native.js.map +1 -1
  492. package/build/mobile/image/image-editing-button.native.js +1 -2
  493. package/build/mobile/image/image-editing-button.native.js.map +1 -1
  494. package/build/mobile/image/index.native.js +81 -7
  495. package/build/mobile/image/index.native.js.map +1 -1
  496. package/build/mobile/keyboard-avoiding-view/index.android.js +2 -4
  497. package/build/mobile/keyboard-avoiding-view/index.android.js.map +1 -1
  498. package/build/mobile/keyboard-avoiding-view/index.ios.js +1 -2
  499. package/build/mobile/keyboard-avoiding-view/index.ios.js.map +1 -1
  500. package/build/mobile/keyboard-aware-flat-list/index.android.js +1 -2
  501. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  502. package/build/mobile/keyboard-aware-flat-list/index.ios.js +1 -2
  503. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  504. package/build/mobile/link-picker/link-picker-screen.native.js +1 -2
  505. package/build/mobile/link-picker/link-picker-screen.native.js.map +1 -1
  506. package/build/mobile/link-settings/index.native.js +1 -2
  507. package/build/mobile/link-settings/index.native.js.map +1 -1
  508. package/build/mobile/link-settings/link-rel.native.js +1 -2
  509. package/build/mobile/link-settings/link-rel.native.js.map +1 -1
  510. package/build/mobile/link-settings/link-settings-navigation.native.js +1 -2
  511. package/build/mobile/link-settings/link-settings-navigation.native.js.map +1 -1
  512. package/build/mobile/link-settings/link-settings-screen.native.js +1 -2
  513. package/build/mobile/link-settings/link-settings-screen.native.js.map +1 -1
  514. package/build/mobile/media-edit/index.native.js +3 -6
  515. package/build/mobile/media-edit/index.native.js.map +1 -1
  516. package/build/mobile/picker/index.ios.js +1 -2
  517. package/build/mobile/picker/index.ios.js.map +1 -1
  518. package/build/mobile/segmented-control/index.native.js +1 -2
  519. package/build/mobile/segmented-control/index.native.js.map +1 -1
  520. package/build/mobile/utils/alignments.native.js +3 -6
  521. package/build/mobile/utils/alignments.native.js.map +1 -1
  522. package/build/mobile/utils/get-px-from-css-unit.native.js +1 -2
  523. package/build/mobile/utils/get-px-from-css-unit.native.js.map +1 -1
  524. package/build/modal/index.js +4 -6
  525. package/build/modal/index.js.map +1 -1
  526. package/build/navigable-container/container.js +1 -2
  527. package/build/navigable-container/container.js.map +1 -1
  528. package/build/navigable-container/menu.js +2 -4
  529. package/build/navigable-container/menu.js.map +1 -1
  530. package/build/navigable-container/tabbable.js +2 -4
  531. package/build/navigable-container/tabbable.js.map +1 -1
  532. package/build/navigation/back-button/index.js +2 -4
  533. package/build/navigation/back-button/index.js.map +1 -1
  534. package/build/navigation/constants.js +2 -4
  535. package/build/navigation/constants.js.map +1 -1
  536. package/build/navigation/context.js +1 -2
  537. package/build/navigation/context.js.map +1 -1
  538. package/build/navigation/group/context.js +1 -2
  539. package/build/navigation/group/context.js.map +1 -1
  540. package/build/navigation/group/index.js +1 -2
  541. package/build/navigation/group/index.js.map +1 -1
  542. package/build/navigation/index.js +1 -2
  543. package/build/navigation/index.js.map +1 -1
  544. package/build/navigation/item/index.js +1 -2
  545. package/build/navigation/item/index.js.map +1 -1
  546. package/build/navigation/menu/context.js +1 -2
  547. package/build/navigation/menu/context.js.map +1 -1
  548. package/build/navigation/menu/index.js +1 -2
  549. package/build/navigation/menu/index.js.map +1 -1
  550. package/build/navigation/menu/menu-title-search.js +5 -8
  551. package/build/navigation/menu/menu-title-search.js.map +1 -1
  552. package/build/navigation/styles/navigation-styles.js +34 -47
  553. package/build/navigation/styles/navigation-styles.js.map +1 -1
  554. package/build/navigator/context.js +1 -2
  555. package/build/navigator/context.js.map +1 -1
  556. package/build/navigator/navigator-back-button/component.js +2 -4
  557. package/build/navigator/navigator-back-button/component.js.map +1 -1
  558. package/build/navigator/navigator-button/component.js +2 -4
  559. package/build/navigator/navigator-button/component.js.map +1 -1
  560. package/build/navigator/navigator-provider/component.js +4 -6
  561. package/build/navigator/navigator-provider/component.js.map +1 -1
  562. package/build/navigator/navigator-screen/component.js +4 -6
  563. package/build/navigator/navigator-screen/component.js.map +1 -1
  564. package/build/navigator/navigator-to-parent-button/component.js +2 -4
  565. package/build/navigator/navigator-to-parent-button/component.js.map +1 -1
  566. package/build/navigator/styles.js +1 -2
  567. package/build/navigator/styles.js.map +1 -1
  568. package/build/navigator/use-navigator.js +1 -2
  569. package/build/navigator/use-navigator.js.map +1 -1
  570. package/build/notice/index.js +1 -2
  571. package/build/notice/index.js.map +1 -1
  572. package/build/notice/index.native.js +1 -2
  573. package/build/notice/index.native.js.map +1 -1
  574. package/build/notice/list.js +1 -2
  575. package/build/notice/list.js.map +1 -1
  576. package/build/notice/list.native.js +1 -2
  577. package/build/notice/list.native.js.map +1 -1
  578. package/build/number-control/index.js +5 -7
  579. package/build/number-control/index.js.map +1 -1
  580. package/build/number-control/styles/number-control-styles.js +3 -6
  581. package/build/number-control/styles/number-control-styles.js.map +1 -1
  582. package/build/palette-edit/index.js +11 -17
  583. package/build/palette-edit/index.js.map +1 -1
  584. package/build/palette-edit/styles.js +50 -51
  585. package/build/palette-edit/styles.js.map +1 -1
  586. package/build/panel/actions.native.js +1 -2
  587. package/build/panel/actions.native.js.map +1 -1
  588. package/build/panel/body.js +2 -4
  589. package/build/panel/body.js.map +1 -1
  590. package/build/panel/body.native.js +1 -2
  591. package/build/panel/body.native.js.map +1 -1
  592. package/build/panel/bottom-separator-cover.native.js +1 -2
  593. package/build/panel/bottom-separator-cover.native.js.map +1 -1
  594. package/build/panel/header.js +1 -2
  595. package/build/panel/header.js.map +1 -1
  596. package/build/panel/index.js +2 -4
  597. package/build/panel/index.js.map +1 -1
  598. package/build/panel/row.js +2 -4
  599. package/build/panel/row.js.map +1 -1
  600. package/build/placeholder/index.js +1 -2
  601. package/build/placeholder/index.js.map +1 -1
  602. package/build/popover/index.js +5 -6
  603. package/build/popover/index.js.map +1 -1
  604. package/build/popover/types.js.map +1 -1
  605. package/build/private-apis.js +1 -2
  606. package/build/private-apis.js.map +1 -1
  607. package/build/private-apis.native.js +1 -2
  608. package/build/private-apis.native.js.map +1 -1
  609. package/build/progress-bar/index.js +4 -6
  610. package/build/progress-bar/index.js.map +1 -1
  611. package/build/progress-bar/styles.js +4 -8
  612. package/build/progress-bar/styles.js.map +1 -1
  613. package/build/query-controls/index.js +5 -6
  614. package/build/query-controls/index.js.map +1 -1
  615. package/build/query-controls/index.native.js +4 -5
  616. package/build/query-controls/index.native.js.map +1 -1
  617. package/build/radio-control/index.js +1 -2
  618. package/build/radio-control/index.js.map +1 -1
  619. package/build/radio-control/index.native.js +1 -2
  620. package/build/radio-control/index.native.js.map +1 -1
  621. package/build/radio-group/context.js +1 -2
  622. package/build/radio-group/context.js.map +1 -1
  623. package/build/radio-group/index.js +4 -6
  624. package/build/radio-group/index.js.map +1 -1
  625. package/build/radio-group/radio.js +4 -6
  626. package/build/radio-group/radio.js.map +1 -1
  627. package/build/range-control/index.js +2 -4
  628. package/build/range-control/index.js.map +1 -1
  629. package/build/range-control/index.native.js +1 -2
  630. package/build/range-control/index.native.js.map +1 -1
  631. package/build/range-control/input-range.js +1 -2
  632. package/build/range-control/input-range.js.map +1 -1
  633. package/build/range-control/styles/range-control-styles.js +15 -30
  634. package/build/range-control/styles/range-control-styles.js.map +1 -1
  635. package/build/resizable-box/index.js +2 -4
  636. package/build/resizable-box/index.js.map +1 -1
  637. package/build/resizable-box/index.native.js +1 -2
  638. package/build/resizable-box/index.native.js.map +1 -1
  639. package/build/resizable-box/resize-tooltip/index.js +1 -2
  640. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  641. package/build/resizable-box/resize-tooltip/label.js +1 -2
  642. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  643. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +9 -12
  644. package/build/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  645. package/build/resizable-box/resize-tooltip/utils.js +1 -2
  646. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  647. package/build/responsive-wrapper/index.js +1 -2
  648. package/build/responsive-wrapper/index.js.map +1 -1
  649. package/build/sandbox/index.js +1 -2
  650. package/build/sandbox/index.js.map +1 -1
  651. package/build/sandbox/index.native.js +1 -2
  652. package/build/sandbox/index.native.js.map +1 -1
  653. package/build/scroll-lock/index.js +1 -2
  654. package/build/scroll-lock/index.js.map +1 -1
  655. package/build/scrollable/component.js +2 -4
  656. package/build/scrollable/component.js.map +1 -1
  657. package/build/scrollable/hook.js +2 -2
  658. package/build/scrollable/hook.js.map +1 -1
  659. package/build/scrollable/styles.js +7 -14
  660. package/build/scrollable/styles.js.map +1 -1
  661. package/build/search-control/index.js +68 -60
  662. package/build/search-control/index.js.map +1 -1
  663. package/build/search-control/index.native.js +1 -2
  664. package/build/search-control/index.native.js.map +1 -1
  665. package/build/search-control/styles.js +37 -0
  666. package/build/search-control/styles.js.map +1 -0
  667. package/build/search-control/types.js.map +1 -1
  668. package/build/select-control/chevron-down.js +1 -2
  669. package/build/select-control/chevron-down.js.map +1 -1
  670. package/build/select-control/index.js +3 -5
  671. package/build/select-control/index.js.map +1 -1
  672. package/build/select-control/index.native.js +2 -4
  673. package/build/select-control/index.native.js.map +1 -1
  674. package/build/select-control/styles/select-control-styles.js +4 -8
  675. package/build/select-control/styles/select-control-styles.js.map +1 -1
  676. package/build/shortcut/index.js +1 -2
  677. package/build/shortcut/index.js.map +1 -1
  678. package/build/slot-fill/bubbles-virtually/slot-fill-context.js +1 -2
  679. package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  680. package/build/slot-fill/bubbles-virtually/slot.js +1 -2
  681. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  682. package/build/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
  683. package/build/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  684. package/build/slot-fill/context.js +2 -4
  685. package/build/slot-fill/context.js.map +1 -1
  686. package/build/slot-fill/index.js +1 -2
  687. package/build/slot-fill/index.js.map +1 -1
  688. package/build/slot-fill/provider.js +1 -2
  689. package/build/slot-fill/provider.js.map +1 -1
  690. package/build/slot-fill/slot.js +1 -2
  691. package/build/slot-fill/slot.js.map +1 -1
  692. package/build/slot-fill/use-slot.js +1 -2
  693. package/build/slot-fill/use-slot.js.map +1 -1
  694. package/build/snackbar/index.js +19 -9
  695. package/build/snackbar/index.js.map +1 -1
  696. package/build/snackbar/list.js +1 -2
  697. package/build/snackbar/list.js.map +1 -1
  698. package/build/spacer/component.js +2 -4
  699. package/build/spacer/component.js.map +1 -1
  700. package/build/spinner/index.js +2 -4
  701. package/build/spinner/index.js.map +1 -1
  702. package/build/spinner/styles.js +3 -6
  703. package/build/spinner/styles.js.map +1 -1
  704. package/build/style-provider/index.js +3 -4
  705. package/build/style-provider/index.js.map +1 -1
  706. package/build/surface/component.js +2 -4
  707. package/build/surface/component.js.map +1 -1
  708. package/build/surface/hook.js +2 -2
  709. package/build/surface/hook.js.map +1 -1
  710. package/build/surface/styles.js +5 -10
  711. package/build/surface/styles.js.map +1 -1
  712. package/build/tab-panel/index.js +4 -6
  713. package/build/tab-panel/index.js.map +1 -1
  714. package/build/tabs/context.js +1 -2
  715. package/build/tabs/context.js.map +1 -1
  716. package/build/tabs/index.js +23 -20
  717. package/build/tabs/index.js.map +1 -1
  718. package/build/tabs/styles.js +5 -8
  719. package/build/tabs/styles.js.map +1 -1
  720. package/build/tabs/tab.js +1 -2
  721. package/build/tabs/tab.js.map +1 -1
  722. package/build/tabs/tablist.js +25 -4
  723. package/build/tabs/tablist.js.map +1 -1
  724. package/build/tabs/tabpanel.js +1 -2
  725. package/build/tabs/tabpanel.js.map +1 -1
  726. package/build/text/component.js +2 -4
  727. package/build/text/component.js.map +1 -1
  728. package/build/text/hook.js +2 -2
  729. package/build/text/hook.js.map +1 -1
  730. package/build/text/index.native.js +1 -2
  731. package/build/text/index.native.js.map +1 -1
  732. package/build/text/styles/emotion-css.native.js +1 -2
  733. package/build/text/styles/emotion-css.native.js.map +1 -1
  734. package/build/text/styles/font-family.native.js +1 -2
  735. package/build/text/styles/font-family.native.js.map +1 -1
  736. package/build/text/styles.js +7 -14
  737. package/build/text/styles.js.map +1 -1
  738. package/build/text-control/index.js +2 -4
  739. package/build/text-control/index.js.map +1 -1
  740. package/build/text-control/index.native.js +1 -2
  741. package/build/text-control/index.native.js.map +1 -1
  742. package/build/text-highlight/index.js +1 -2
  743. package/build/text-highlight/index.js.map +1 -1
  744. package/build/textarea-control/index.js +2 -4
  745. package/build/textarea-control/index.js.map +1 -1
  746. package/build/textarea-control/index.native.js +1 -2
  747. package/build/textarea-control/index.native.js.map +1 -1
  748. package/build/textarea-control/styles/textarea-control-styles.js +1 -2
  749. package/build/textarea-control/styles/textarea-control-styles.js.map +1 -1
  750. package/build/theme/index.js +1 -2
  751. package/build/theme/index.js.map +1 -1
  752. package/build/theme/styles.js +12 -8
  753. package/build/theme/styles.js.map +1 -1
  754. package/build/tip/index.js +1 -2
  755. package/build/tip/index.js.map +1 -1
  756. package/build/toggle-control/index.js +1 -2
  757. package/build/toggle-control/index.js.map +1 -1
  758. package/build/toggle-control/index.native.js +1 -2
  759. package/build/toggle-control/index.native.js.map +1 -1
  760. package/build/toggle-group-control/context.js +1 -2
  761. package/build/toggle-group-control/context.js.map +1 -1
  762. package/build/toggle-group-control/toggle-group-control/as-button-group.js +1 -2
  763. package/build/toggle-group-control/toggle-group-control/as-button-group.js.map +1 -1
  764. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +3 -4
  765. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  766. package/build/toggle-group-control/toggle-group-control/component.js +7 -8
  767. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  768. package/build/toggle-group-control/toggle-group-control/styles.js +2 -4
  769. package/build/toggle-group-control/toggle-group-control/styles.js.map +1 -1
  770. package/build/toggle-group-control/toggle-group-control/utils.js +7 -1
  771. package/build/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  772. package/build/toggle-group-control/toggle-group-control-option/component.js +2 -4
  773. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  774. package/build/toggle-group-control/toggle-group-control-option-base/component.js +3 -4
  775. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  776. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +4 -8
  777. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  778. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +2 -4
  779. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  780. package/build/toolbar/toolbar/index.js +2 -4
  781. package/build/toolbar/toolbar/index.js.map +1 -1
  782. package/build/toolbar/toolbar/toolbar-container.js +4 -6
  783. package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
  784. package/build/toolbar/toolbar/toolbar-container.native.js +1 -2
  785. package/build/toolbar/toolbar/toolbar-container.native.js.map +1 -1
  786. package/build/toolbar/toolbar-button/index.js +2 -4
  787. package/build/toolbar/toolbar-button/index.js.map +1 -1
  788. package/build/toolbar/toolbar-button/toolbar-button-container.js +1 -2
  789. package/build/toolbar/toolbar-button/toolbar-button-container.js.map +1 -1
  790. package/build/toolbar/toolbar-context/index.js +1 -2
  791. package/build/toolbar/toolbar-context/index.js.map +1 -1
  792. package/build/toolbar/toolbar-dropdown-menu/index.js +1 -2
  793. package/build/toolbar/toolbar-dropdown-menu/index.js.map +1 -1
  794. package/build/toolbar/toolbar-group/index.js +1 -2
  795. package/build/toolbar/toolbar-group/index.js.map +1 -1
  796. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js +1 -2
  797. package/build/toolbar/toolbar-group/toolbar-group-collapsed.js.map +1 -1
  798. package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js +1 -2
  799. package/build/toolbar/toolbar-group/toolbar-group-collapsed.native.js.map +1 -1
  800. package/build/toolbar/toolbar-group/toolbar-group-container.js +1 -2
  801. package/build/toolbar/toolbar-group/toolbar-group-container.js.map +1 -1
  802. package/build/toolbar/toolbar-group/toolbar-group-container.native.js +1 -2
  803. package/build/toolbar/toolbar-group/toolbar-group-container.native.js.map +1 -1
  804. package/build/toolbar/toolbar-item/index.js +3 -4
  805. package/build/toolbar/toolbar-item/index.js.map +1 -1
  806. package/build/toolbar/toolbar-item/index.native.js +1 -2
  807. package/build/toolbar/toolbar-item/index.native.js.map +1 -1
  808. package/build/tools-panel/context.js +1 -2
  809. package/build/tools-panel/context.js.map +1 -1
  810. package/build/tools-panel/styles.js +8 -16
  811. package/build/tools-panel/styles.js.map +1 -1
  812. package/build/tools-panel/tools-panel/component.js +2 -4
  813. package/build/tools-panel/tools-panel/component.js.map +1 -1
  814. package/build/tools-panel/tools-panel/hook.js +2 -2
  815. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  816. package/build/tools-panel/tools-panel-header/component.js +1 -2
  817. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  818. package/build/tools-panel/tools-panel-header/hook.js +2 -2
  819. package/build/tools-panel/tools-panel-header/hook.js.map +1 -1
  820. package/build/tools-panel/tools-panel-item/component.js +2 -4
  821. package/build/tools-panel/tools-panel-item/component.js.map +1 -1
  822. package/build/tools-panel/tools-panel-item/hook.js +2 -2
  823. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  824. package/build/tooltip/index.js +19 -19
  825. package/build/tooltip/index.js.map +1 -1
  826. package/build/tooltip/index.native.js +1 -2
  827. package/build/tooltip/index.native.js.map +1 -1
  828. package/build/tooltip/types.js.map +1 -1
  829. package/build/tree-grid/cell.js +2 -4
  830. package/build/tree-grid/cell.js.map +1 -1
  831. package/build/tree-grid/index.js +2 -4
  832. package/build/tree-grid/index.js.map +1 -1
  833. package/build/tree-grid/item.js +2 -4
  834. package/build/tree-grid/item.js.map +1 -1
  835. package/build/tree-grid/roving-tab-index-context.js +1 -2
  836. package/build/tree-grid/roving-tab-index-context.js.map +1 -1
  837. package/build/tree-grid/roving-tab-index-item.js +2 -4
  838. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  839. package/build/tree-grid/row.js +2 -4
  840. package/build/tree-grid/row.js.map +1 -1
  841. package/build/tree-select/index.js +2 -3
  842. package/build/tree-select/index.js.map +1 -1
  843. package/build/truncate/component.js +2 -4
  844. package/build/truncate/component.js.map +1 -1
  845. package/build/truncate/hook.js +2 -2
  846. package/build/truncate/hook.js.map +1 -1
  847. package/build/truncate/styles.js +1 -2
  848. package/build/truncate/styles.js.map +1 -1
  849. package/build/truncate/utils.js +3 -6
  850. package/build/truncate/utils.js.map +1 -1
  851. package/build/unit-control/index.js +3 -5
  852. package/build/unit-control/index.js.map +1 -1
  853. package/build/unit-control/index.native.js +1 -2
  854. package/build/unit-control/index.native.js.map +1 -1
  855. package/build/unit-control/styles/unit-control-styles.js +3 -6
  856. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  857. package/build/unit-control/unit-select-control.js +1 -2
  858. package/build/unit-control/unit-select-control.js.map +1 -1
  859. package/build/unit-control/utils.js +3 -6
  860. package/build/unit-control/utils.js.map +1 -1
  861. package/build/utils/base-label.js +1 -2
  862. package/build/utils/base-label.js.map +1 -1
  863. package/build/utils/box-sizing.js +1 -2
  864. package/build/utils/box-sizing.js.map +1 -1
  865. package/build/utils/breakpoint-values.js +1 -2
  866. package/build/utils/breakpoint-values.js.map +1 -1
  867. package/build/utils/colors-values.js +44 -24
  868. package/build/utils/colors-values.js.map +1 -1
  869. package/build/utils/config-values.js +1 -2
  870. package/build/utils/config-values.js.map +1 -1
  871. package/build/utils/font-size.js +3 -6
  872. package/build/utils/font-size.js.map +1 -1
  873. package/build/utils/font-values.js +1 -2
  874. package/build/utils/font-values.js.map +1 -1
  875. package/build/utils/hooks/use-controlled-state.js +1 -2
  876. package/build/utils/hooks/use-controlled-state.js.map +1 -1
  877. package/build/utils/hooks/use-update-effect.js +2 -3
  878. package/build/utils/hooks/use-update-effect.js.map +1 -1
  879. package/build/utils/input/base.js +2 -4
  880. package/build/utils/input/base.js.map +1 -1
  881. package/build/utils/input/input-control.js +1 -2
  882. package/build/utils/input/input-control.js.map +1 -1
  883. package/build/utils/use-deprecated-props.js +1 -15
  884. package/build/utils/use-deprecated-props.js.map +1 -1
  885. package/build/utils/use-responsive-value.js +2 -3
  886. package/build/utils/use-responsive-value.js.map +1 -1
  887. package/build/v-stack/component.js +2 -4
  888. package/build/v-stack/component.js.map +1 -1
  889. package/build/view/component.js +2 -4
  890. package/build/view/component.js.map +1 -1
  891. package/build/visually-hidden/component.js +2 -4
  892. package/build/visually-hidden/component.js.map +1 -1
  893. package/build/visually-hidden/styles.js +1 -2
  894. package/build/visually-hidden/styles.js.map +1 -1
  895. package/build/z-stack/component.js +2 -4
  896. package/build/z-stack/component.js.map +1 -1
  897. package/build/z-stack/styles.js +2 -4
  898. package/build/z-stack/styles.js.map +1 -1
  899. package/build-module/angle-picker-control/index.js +3 -13
  900. package/build-module/angle-picker-control/index.js.map +1 -1
  901. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js +5 -17
  902. package/build-module/angle-picker-control/styles/angle-picker-control-styles.js.map +1 -1
  903. package/build-module/angle-picker-control/types.js.map +1 -1
  904. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  905. package/build-module/border-box-control/border-box-control/hook.js +3 -1
  906. package/build-module/border-box-control/border-box-control/hook.js.map +1 -1
  907. package/build-module/border-box-control/types.js.map +1 -1
  908. package/build-module/border-control/border-control/component.js +5 -1
  909. package/build-module/border-control/border-control/component.js.map +1 -1
  910. package/build-module/border-control/border-control/hook.js +18 -15
  911. package/build-module/border-control/border-control/hook.js.map +1 -1
  912. package/build-module/border-control/border-control-dropdown/component.js +2 -1
  913. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  914. package/build-module/border-control/border-control-style-picker/component.js +21 -48
  915. package/build-module/border-control/border-control-style-picker/component.js.map +1 -1
  916. package/build-module/border-control/styles.js +14 -24
  917. package/build-module/border-control/styles.js.map +1 -1
  918. package/build-module/border-control/types.js.map +1 -1
  919. package/build-module/box-control/all-input-control.js +38 -28
  920. package/build-module/box-control/all-input-control.js.map +1 -1
  921. package/build-module/box-control/axial-input-controls.js +42 -57
  922. package/build-module/box-control/axial-input-controls.js.map +1 -1
  923. package/build-module/box-control/index.js +22 -25
  924. package/build-module/box-control/index.js.map +1 -1
  925. package/build-module/box-control/input-controls.js +47 -40
  926. package/build-module/box-control/input-controls.js.map +1 -1
  927. package/build-module/box-control/styles/box-control-styles.js +45 -105
  928. package/build-module/box-control/styles/box-control-styles.js.map +1 -1
  929. package/build-module/box-control/types.js.map +1 -1
  930. package/build-module/box-control/utils.js +121 -7
  931. package/build-module/box-control/utils.js.map +1 -1
  932. package/build-module/button/index.js +14 -16
  933. package/build-module/button/index.js.map +1 -1
  934. package/build-module/button/index.native.js +0 -1
  935. package/build-module/button/index.native.js.map +1 -1
  936. package/build-module/button/types.js.map +1 -1
  937. package/build-module/checkbox-control/types.js.map +1 -1
  938. package/build-module/color-picker/hsl-input.js +55 -33
  939. package/build-module/color-picker/hsl-input.js.map +1 -1
  940. package/build-module/combobox-control/index.js +1 -2
  941. package/build-module/combobox-control/index.js.map +1 -1
  942. package/build-module/composite/current/index.js +15 -0
  943. package/build-module/composite/current/index.js.map +1 -0
  944. package/build-module/composite/index.js +6 -15
  945. package/build-module/composite/index.js.map +1 -1
  946. package/build-module/composite/legacy/index.js +117 -0
  947. package/build-module/composite/legacy/index.js.map +1 -0
  948. package/build-module/composite/v2.js +3 -13
  949. package/build-module/composite/v2.js.map +1 -1
  950. package/build-module/confirm-dialog/component.js +2 -0
  951. package/build-module/confirm-dialog/component.js.map +1 -1
  952. package/build-module/context/wordpress-component.js.map +1 -1
  953. package/build-module/custom-gradient-picker/index.js +2 -15
  954. package/build-module/custom-gradient-picker/index.js.map +1 -1
  955. package/build-module/custom-gradient-picker/types.js.map +1 -1
  956. package/build-module/custom-select-control/index.js +1 -1
  957. package/build-module/custom-select-control/index.js.map +1 -1
  958. package/build-module/custom-select-control-v2/index.js +6 -3
  959. package/build-module/custom-select-control-v2/index.js.map +1 -1
  960. package/build-module/date-time/time/timezone.js +1 -1
  961. package/build-module/date-time/time/timezone.js.map +1 -1
  962. package/build-module/dropdown-menu-v2/styles.js +14 -14
  963. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  964. package/build-module/external-link/index.js +1 -1
  965. package/build-module/focal-point-picker/index.js +2 -2
  966. package/build-module/focal-point-picker/index.js.map +1 -1
  967. package/build-module/focal-point-picker/index.native.js +0 -1
  968. package/build-module/focal-point-picker/index.native.js.map +1 -1
  969. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +29 -37
  970. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  971. package/build-module/focal-point-picker/styles/focal-point-style.js +10 -2
  972. package/build-module/focal-point-picker/styles/focal-point-style.js.map +1 -1
  973. package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -2
  974. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  975. package/build-module/font-size-picker/index.js +3 -17
  976. package/build-module/font-size-picker/index.js.map +1 -1
  977. package/build-module/font-size-picker/styles.js +14 -20
  978. package/build-module/font-size-picker/styles.js.map +1 -1
  979. package/build-module/font-size-picker/types.js.map +1 -1
  980. package/build-module/form-token-field/index.js +1 -6
  981. package/build-module/form-token-field/index.js.map +1 -1
  982. package/build-module/form-token-field/suggestions-list.js +0 -1
  983. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  984. package/build-module/gradient-picker/index.js +18 -41
  985. package/build-module/gradient-picker/index.js.map +1 -1
  986. package/build-module/gradient-picker/types.js.map +1 -1
  987. package/build-module/input-control/backdrop.js +2 -0
  988. package/build-module/input-control/backdrop.js.map +1 -1
  989. package/build-module/input-control/index.js +1 -1
  990. package/build-module/input-control/index.js.map +1 -1
  991. package/build-module/input-control/input-base.js +6 -4
  992. package/build-module/input-control/input-base.js.map +1 -1
  993. package/build-module/input-control/styles/input-control-styles.js +25 -23
  994. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  995. package/build-module/input-control/types.js.map +1 -1
  996. package/build-module/isolated-event-container/index.js +0 -1
  997. package/build-module/isolated-event-container/index.js.map +1 -1
  998. package/build-module/item-group/styles.js +10 -10
  999. package/build-module/item-group/styles.js.map +1 -1
  1000. package/build-module/mobile/image/index.native.js +83 -8
  1001. package/build-module/mobile/image/index.native.js.map +1 -1
  1002. package/build-module/navigation/menu/menu-title-search.js +4 -6
  1003. package/build-module/navigation/menu/menu-title-search.js.map +1 -1
  1004. package/build-module/navigation/styles/navigation-styles.js +23 -24
  1005. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  1006. package/build-module/number-control/index.js +1 -1
  1007. package/build-module/number-control/index.js.map +1 -1
  1008. package/build-module/palette-edit/index.js +10 -15
  1009. package/build-module/palette-edit/index.js.map +1 -1
  1010. package/build-module/palette-edit/styles.js +43 -33
  1011. package/build-module/palette-edit/styles.js.map +1 -1
  1012. package/build-module/popover/index.js +2 -0
  1013. package/build-module/popover/index.js.map +1 -1
  1014. package/build-module/popover/types.js.map +1 -1
  1015. package/build-module/query-controls/index.js +5 -5
  1016. package/build-module/query-controls/index.js.map +1 -1
  1017. package/build-module/query-controls/index.native.js +4 -4
  1018. package/build-module/query-controls/index.native.js.map +1 -1
  1019. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js +4 -4
  1020. package/build-module/resizable-box/resize-tooltip/styles/resize-tooltip.styles.js.map +1 -1
  1021. package/build-module/search-control/index.js +67 -57
  1022. package/build-module/search-control/index.js.map +1 -1
  1023. package/build-module/search-control/styles.js +29 -0
  1024. package/build-module/search-control/styles.js.map +1 -0
  1025. package/build-module/search-control/types.js.map +1 -1
  1026. package/build-module/select-control/index.js +1 -1
  1027. package/build-module/select-control/index.js.map +1 -1
  1028. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
  1029. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  1030. package/build-module/snackbar/index.js +18 -6
  1031. package/build-module/snackbar/index.js.map +1 -1
  1032. package/build-module/tabs/index.js +21 -17
  1033. package/build-module/tabs/index.js.map +1 -1
  1034. package/build-module/tabs/tablist.js +22 -0
  1035. package/build-module/tabs/tablist.js.map +1 -1
  1036. package/build-module/theme/styles.js +11 -2
  1037. package/build-module/theme/styles.js.map +1 -1
  1038. package/build-module/toggle-group-control/toggle-group-control/utils.js +7 -1
  1039. package/build-module/toggle-group-control/toggle-group-control/utils.js.map +1 -1
  1040. package/build-module/tooltip/index.js +16 -13
  1041. package/build-module/tooltip/index.js.map +1 -1
  1042. package/build-module/tooltip/types.js.map +1 -1
  1043. package/build-module/tree-select/index.js +1 -1
  1044. package/build-module/tree-select/index.js.map +1 -1
  1045. package/build-module/unit-control/index.js +1 -1
  1046. package/build-module/unit-control/index.js.map +1 -1
  1047. package/build-module/utils/colors-values.js +42 -19
  1048. package/build-module/utils/colors-values.js.map +1 -1
  1049. package/build-module/utils/hooks/use-update-effect.js +1 -1
  1050. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  1051. package/build-module/utils/use-deprecated-props.js +1 -13
  1052. package/build-module/utils/use-deprecated-props.js.map +1 -1
  1053. package/build-module/utils/use-responsive-value.js +2 -3
  1054. package/build-module/utils/use-responsive-value.js.map +1 -1
  1055. package/build-style/style-rtl.css +28 -113
  1056. package/build-style/style.css +28 -113
  1057. package/build-types/angle-picker-control/index.d.ts +0 -1
  1058. package/build-types/angle-picker-control/index.d.ts.map +1 -1
  1059. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +0 -6
  1060. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  1061. package/build-types/angle-picker-control/types.d.ts +2 -0
  1062. package/build-types/angle-picker-control/types.d.ts.map +1 -1
  1063. package/build-types/border-box-control/border-box-control/component.d.ts +1 -0
  1064. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  1065. package/build-types/border-box-control/border-box-control/hook.d.ts +4 -4
  1066. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  1067. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +5 -5
  1068. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +4 -4
  1069. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +4 -4
  1070. package/build-types/border-box-control/stories/index.story.d.ts +2 -1
  1071. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  1072. package/build-types/border-box-control/types.d.ts +6 -0
  1073. package/build-types/border-box-control/types.d.ts.map +1 -1
  1074. package/build-types/border-control/border-control/component.d.ts +1 -0
  1075. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  1076. package/build-types/border-control/border-control/hook.d.ts +6 -4
  1077. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  1078. package/build-types/border-control/border-control-dropdown/component.d.ts +1 -0
  1079. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  1080. package/build-types/border-control/border-control-dropdown/hook.d.ts +5 -4
  1081. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  1082. package/build-types/border-control/border-control-style-picker/component.d.ts +3 -4
  1083. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  1084. package/build-types/border-control/stories/index.story.d.ts +12 -6
  1085. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  1086. package/build-types/border-control/styles.d.ts +0 -2
  1087. package/build-types/border-control/styles.d.ts.map +1 -1
  1088. package/build-types/border-control/types.d.ts +12 -1
  1089. package/build-types/border-control/types.d.ts.map +1 -1
  1090. package/build-types/box-control/all-input-control.d.ts +1 -1
  1091. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  1092. package/build-types/box-control/axial-input-controls.d.ts +1 -1
  1093. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  1094. package/build-types/box-control/index.d.ts +1 -1
  1095. package/build-types/box-control/index.d.ts.map +1 -1
  1096. package/build-types/box-control/input-controls.d.ts +1 -1
  1097. package/build-types/box-control/input-controls.d.ts.map +1 -1
  1098. package/build-types/box-control/stories/index.story.d.ts +42 -36
  1099. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  1100. package/build-types/box-control/styles/box-control-styles.d.ts +49 -23
  1101. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  1102. package/build-types/box-control/types.d.ts +12 -12
  1103. package/build-types/box-control/types.d.ts.map +1 -1
  1104. package/build-types/box-control/utils.d.ts +2 -1
  1105. package/build-types/box-control/utils.d.ts.map +1 -1
  1106. package/build-types/button/deprecated.d.ts +3 -3
  1107. package/build-types/button/index.d.ts.map +1 -1
  1108. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  1109. package/build-types/button/types.d.ts +7 -3
  1110. package/build-types/button/types.d.ts.map +1 -1
  1111. package/build-types/card/card/hook.d.ts +4 -4
  1112. package/build-types/card/card-body/hook.d.ts +4 -4
  1113. package/build-types/card/card-divider/hook.d.ts +4 -4
  1114. package/build-types/card/card-footer/hook.d.ts +4 -4
  1115. package/build-types/card/card-header/hook.d.ts +4 -4
  1116. package/build-types/card/card-media/hook.d.ts +4 -4
  1117. package/build-types/card/stories/index.story.d.ts +2 -2
  1118. package/build-types/checkbox-control/stories/index.story.d.ts +11 -0
  1119. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  1120. package/build-types/checkbox-control/types.d.ts +2 -3
  1121. package/build-types/checkbox-control/types.d.ts.map +1 -1
  1122. package/build-types/color-palette/styles.d.ts +2 -2
  1123. package/build-types/color-picker/component.d.ts +1 -1
  1124. package/build-types/color-picker/hsl-input.d.ts.map +1 -1
  1125. package/build-types/color-picker/stories/index.story.d.ts +1 -1
  1126. package/build-types/color-picker/styles.d.ts +3 -3
  1127. package/build-types/combobox-control/index.d.ts.map +1 -1
  1128. package/build-types/composite/current/index.d.ts +12 -0
  1129. package/build-types/composite/current/index.d.ts.map +1 -0
  1130. package/build-types/composite/current/stories/index.story.d.ts +13 -0
  1131. package/build-types/composite/current/stories/index.story.d.ts.map +1 -0
  1132. package/build-types/composite/current/stories/utils.d.ts +15 -0
  1133. package/build-types/composite/current/stories/utils.d.ts.map +1 -0
  1134. package/build-types/composite/index.d.ts +1 -14
  1135. package/build-types/composite/index.d.ts.map +1 -1
  1136. package/build-types/composite/legacy/index.d.ts +84 -0
  1137. package/build-types/composite/legacy/index.d.ts.map +1 -0
  1138. package/build-types/composite/legacy/stories/index.story.d.ts +12 -0
  1139. package/build-types/composite/legacy/stories/index.story.d.ts.map +1 -0
  1140. package/build-types/composite/legacy/stories/utils.d.ts +15 -0
  1141. package/build-types/composite/legacy/stories/utils.d.ts.map +1 -0
  1142. package/build-types/composite/legacy/test/index.d.ts.map +1 -0
  1143. package/build-types/composite/v2.d.ts +1 -11
  1144. package/build-types/composite/v2.d.ts.map +1 -1
  1145. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  1146. package/build-types/custom-gradient-picker/index.d.ts +1 -3
  1147. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  1148. package/build-types/custom-gradient-picker/types.d.ts +2 -0
  1149. package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
  1150. package/build-types/custom-select-control/index.d.ts.map +1 -1
  1151. package/build-types/custom-select-control/styles.d.ts +2 -2
  1152. package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
  1153. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  1154. package/build-types/custom-select-control-v2/test/index.d.ts +2 -0
  1155. package/build-types/custom-select-control-v2/test/index.d.ts.map +1 -0
  1156. package/build-types/date-time/date/styles.d.ts +3 -3
  1157. package/build-types/date-time/date-time/styles.d.ts +1 -1
  1158. package/build-types/date-time/time/styles.d.ts +4 -4
  1159. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  1160. package/build-types/elevation/hook.d.ts +4 -4
  1161. package/build-types/flex/flex/hook.d.ts +4 -4
  1162. package/build-types/flex/flex-block/hook.d.ts +4 -4
  1163. package/build-types/flex/flex-item/hook.d.ts +4 -4
  1164. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +1 -1
  1165. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  1166. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
  1167. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  1168. package/build-types/font-size-picker/index.d.ts.map +1 -1
  1169. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  1170. package/build-types/font-size-picker/styles.d.ts +1 -7
  1171. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  1172. package/build-types/font-size-picker/types.d.ts +3 -1
  1173. package/build-types/font-size-picker/types.d.ts.map +1 -1
  1174. package/build-types/form-token-field/index.d.ts.map +1 -1
  1175. package/build-types/gradient-picker/index.d.ts +1 -4
  1176. package/build-types/gradient-picker/index.d.ts.map +1 -1
  1177. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  1178. package/build-types/gradient-picker/types.d.ts +2 -0
  1179. package/build-types/gradient-picker/types.d.ts.map +1 -1
  1180. package/build-types/grid/hook.d.ts +4 -4
  1181. package/build-types/h-stack/hook.d.ts +4 -4
  1182. package/build-types/heading/component.d.ts +1 -1
  1183. package/build-types/heading/hook.d.ts +4 -4
  1184. package/build-types/input-control/backdrop.d.ts +2 -1
  1185. package/build-types/input-control/backdrop.d.ts.map +1 -1
  1186. package/build-types/input-control/index.d.ts.map +1 -1
  1187. package/build-types/input-control/input-base.d.ts +1 -3
  1188. package/build-types/input-control/input-base.d.ts.map +1 -1
  1189. package/build-types/input-control/styles/input-control-styles.d.ts +1 -0
  1190. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  1191. package/build-types/input-control/types.d.ts +7 -1
  1192. package/build-types/input-control/types.d.ts.map +1 -1
  1193. package/build-types/item-group/item/hook.d.ts +4 -4
  1194. package/build-types/item-group/item-group/hook.d.ts +4 -4
  1195. package/build-types/item-group/styles.d.ts.map +1 -1
  1196. package/build-types/menu-item/index.d.ts +1 -1
  1197. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  1198. package/build-types/navigation/styles/navigation-styles.d.ts +6 -13
  1199. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  1200. package/build-types/navigator/navigator-back-button/hook.d.ts +4 -4
  1201. package/build-types/navigator/navigator-button/hook.d.ts +4 -4
  1202. package/build-types/number-control/index.d.ts +1 -1
  1203. package/build-types/number-control/index.d.ts.map +1 -1
  1204. package/build-types/number-control/stories/index.story.d.ts +1 -1
  1205. package/build-types/palette-edit/index.d.ts.map +1 -1
  1206. package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
  1207. package/build-types/palette-edit/styles.d.ts +17 -23
  1208. package/build-types/palette-edit/styles.d.ts.map +1 -1
  1209. package/build-types/popover/index.d.ts.map +1 -1
  1210. package/build-types/popover/types.d.ts +9 -0
  1211. package/build-types/popover/types.d.ts.map +1 -1
  1212. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  1213. package/build-types/range-control/index.d.ts +1 -1
  1214. package/build-types/range-control/styles/range-control-styles.d.ts +1 -1
  1215. package/build-types/resizable-box/index.d.ts +1 -1
  1216. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  1217. package/build-types/resizable-box/stories/index.story.d.ts +2 -2
  1218. package/build-types/scrollable/hook.d.ts +4 -4
  1219. package/build-types/search-control/index.d.ts +4 -9
  1220. package/build-types/search-control/index.d.ts.map +1 -1
  1221. package/build-types/search-control/stories/index.story.d.ts +2 -18
  1222. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  1223. package/build-types/search-control/styles.d.ts +10 -0
  1224. package/build-types/search-control/styles.d.ts.map +1 -0
  1225. package/build-types/search-control/test/index.d.ts +2 -0
  1226. package/build-types/search-control/test/index.d.ts.map +1 -0
  1227. package/build-types/search-control/types.d.ts +34 -18
  1228. package/build-types/search-control/types.d.ts.map +1 -1
  1229. package/build-types/select-control/index.d.ts.map +1 -1
  1230. package/build-types/snackbar/index.d.ts.map +1 -1
  1231. package/build-types/spacer/hook.d.ts +4 -4
  1232. package/build-types/surface/hook.d.ts +4 -4
  1233. package/build-types/tabs/index.d.ts.map +1 -1
  1234. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  1235. package/build-types/tabs/tablist.d.ts.map +1 -1
  1236. package/build-types/text/hook.d.ts +4 -4
  1237. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  1238. package/build-types/theme/styles.d.ts.map +1 -1
  1239. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  1240. package/build-types/toggle-group-control/toggle-group-control/utils.d.ts.map +1 -1
  1241. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  1242. package/build-types/toolbar/toolbar-button/index.d.ts +3 -3
  1243. package/build-types/tools-panel/tools-panel/hook.d.ts +4 -4
  1244. package/build-types/tools-panel/tools-panel-header/hook.d.ts +4 -4
  1245. package/build-types/tools-panel/tools-panel-item/hook.d.ts +4 -4
  1246. package/build-types/tooltip/index.d.ts +1 -1
  1247. package/build-types/tooltip/index.d.ts.map +1 -1
  1248. package/build-types/tooltip/stories/index.story.d.ts +1 -1
  1249. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  1250. package/build-types/tooltip/types.d.ts +1 -1
  1251. package/build-types/tooltip/types.d.ts.map +1 -1
  1252. package/build-types/tree-select/index.d.ts.map +1 -1
  1253. package/build-types/truncate/hook.d.ts +4 -4
  1254. package/build-types/unit-control/index.d.ts +1 -1
  1255. package/build-types/unit-control/index.d.ts.map +1 -1
  1256. package/build-types/unit-control/styles/unit-control-styles.d.ts +1 -1
  1257. package/build-types/utils/colors-values.d.ts +28 -1
  1258. package/build-types/utils/colors-values.d.ts.map +1 -1
  1259. package/build-types/utils/hooks/use-update-effect.d.ts +1 -1
  1260. package/build-types/utils/use-deprecated-props.d.ts +1 -5
  1261. package/build-types/utils/use-deprecated-props.d.ts.map +1 -1
  1262. package/build-types/v-stack/hook.d.ts +4 -4
  1263. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  1264. package/package.json +19 -20
  1265. package/src/angle-picker-control/README.md +0 -8
  1266. package/src/angle-picker-control/index.tsx +4 -23
  1267. package/src/angle-picker-control/stories/index.story.tsx +0 -3
  1268. package/src/angle-picker-control/styles/angle-picker-control-styles.tsx +0 -18
  1269. package/src/angle-picker-control/types.ts +2 -0
  1270. package/src/border-box-control/border-box-control/component.tsx +0 -1
  1271. package/src/border-box-control/border-box-control/hook.ts +5 -1
  1272. package/src/border-box-control/types.ts +6 -0
  1273. package/src/border-control/border-control/component.tsx +4 -0
  1274. package/src/border-control/border-control/hook.ts +22 -16
  1275. package/src/border-control/border-control-dropdown/component.tsx +2 -1
  1276. package/src/border-control/border-control-style-picker/component.tsx +31 -66
  1277. package/src/border-control/styles.ts +0 -15
  1278. package/src/border-control/types.ts +15 -1
  1279. package/src/box-control/all-input-control.tsx +57 -34
  1280. package/src/box-control/axial-input-controls.tsx +79 -69
  1281. package/src/box-control/index.tsx +47 -54
  1282. package/src/box-control/input-controls.tsx +114 -83
  1283. package/src/box-control/styles/box-control-styles.ts +21 -61
  1284. package/src/box-control/test/index.tsx +126 -18
  1285. package/src/box-control/types.ts +10 -21
  1286. package/src/box-control/utils.ts +43 -8
  1287. package/src/button/README.md +1 -1
  1288. package/src/button/index.tsx +21 -33
  1289. package/src/button/stories/e2e/index.story.tsx +6 -0
  1290. package/src/button/style.scss +17 -5
  1291. package/src/button/test/index.tsx +122 -0
  1292. package/src/button/types.ts +7 -3
  1293. package/src/card/test/__snapshots__/index.tsx.snap +3 -3
  1294. package/src/checkbox-control/README.md +1 -2
  1295. package/src/checkbox-control/stories/index.story.tsx +44 -0
  1296. package/src/checkbox-control/test/index.tsx +2 -2
  1297. package/src/checkbox-control/types.ts +2 -3
  1298. package/src/circular-option-picker/test/index.tsx +10 -16
  1299. package/src/color-picker/hsl-input.tsx +56 -30
  1300. package/src/color-picker/test/index.tsx +190 -16
  1301. package/src/combobox-control/index.tsx +1 -4
  1302. package/src/composite/current/index.ts +22 -0
  1303. package/src/composite/current/stories/index.story.tsx +86 -0
  1304. package/src/composite/current/stories/utils.tsx +61 -0
  1305. package/src/composite/index.ts +6 -21
  1306. package/src/composite/legacy/index.tsx +191 -0
  1307. package/src/composite/legacy/stories/index.story.tsx +205 -0
  1308. package/src/composite/legacy/stories/utils.tsx +67 -0
  1309. package/src/composite/legacy/test/index.tsx +579 -0
  1310. package/src/composite/v2.ts +3 -21
  1311. package/src/confirm-dialog/component.tsx +2 -0
  1312. package/src/context/wordpress-component.ts +1 -1
  1313. package/src/custom-gradient-picker/index.tsx +1 -22
  1314. package/src/custom-gradient-picker/stories/index.story.tsx +0 -3
  1315. package/src/custom-gradient-picker/style.scss +0 -7
  1316. package/src/custom-gradient-picker/types.ts +2 -0
  1317. package/src/custom-select-control/index.js +1 -5
  1318. package/src/custom-select-control-v2/index.tsx +7 -2
  1319. package/src/custom-select-control-v2/stories/index.story.tsx +1 -0
  1320. package/src/custom-select-control-v2/test/index.tsx +219 -0
  1321. package/src/date-time/time/timezone.tsx +1 -1
  1322. package/src/dimension-control/test/__snapshots__/index.test.js.snap +16 -16
  1323. package/src/divider/README.md +1 -1
  1324. package/src/dropdown-menu-v2/stories/index.story.tsx +1 -0
  1325. package/src/dropdown-menu-v2/styles.ts +1 -1
  1326. package/src/focal-point-picker/index.tsx +2 -2
  1327. package/src/focal-point-picker/styles/focal-point-picker-style.ts +26 -10
  1328. package/src/focal-point-picker/styles/focal-point-style.ts +21 -7
  1329. package/src/font-size-picker/README.md +0 -8
  1330. package/src/font-size-picker/font-size-picker-toggle-group.tsx +2 -9
  1331. package/src/font-size-picker/index.tsx +3 -21
  1332. package/src/font-size-picker/stories/index.story.tsx +0 -1
  1333. package/src/font-size-picker/styles.ts +0 -7
  1334. package/src/font-size-picker/test/index.tsx +16 -99
  1335. package/src/font-size-picker/types.ts +3 -1
  1336. package/src/form-token-field/index.tsx +1 -4
  1337. package/src/gradient-picker/README.md +0 -8
  1338. package/src/gradient-picker/index.tsx +32 -56
  1339. package/src/gradient-picker/stories/index.story.tsx +0 -1
  1340. package/src/gradient-picker/types.ts +2 -0
  1341. package/src/guide/style.scss +1 -1
  1342. package/src/input-control/backdrop.tsx +6 -1
  1343. package/src/input-control/index.tsx +1 -5
  1344. package/src/input-control/input-base.tsx +14 -7
  1345. package/src/input-control/styles/input-control-styles.tsx +6 -3
  1346. package/src/input-control/types.ts +10 -1
  1347. package/src/item-group/styles.ts +1 -4
  1348. package/src/mobile/image/index.native.js +117 -12
  1349. package/src/mobile/image/style.native.scss +6 -0
  1350. package/src/modal/style.scss +1 -1
  1351. package/src/navigation/menu/menu-title-search.tsx +6 -6
  1352. package/src/navigation/styles/navigation-styles.tsx +5 -27
  1353. package/src/number-control/index.tsx +1 -5
  1354. package/src/palette-edit/index.tsx +18 -16
  1355. package/src/palette-edit/stories/index.story.tsx +1 -0
  1356. package/src/palette-edit/{styles.js → styles.ts} +56 -13
  1357. package/src/palette-edit/test/index.tsx +326 -10
  1358. package/src/placeholder/style.scss +6 -5
  1359. package/src/popover/index.tsx +2 -0
  1360. package/src/popover/style.scss +1 -0
  1361. package/src/popover/test/index.tsx +250 -0
  1362. package/src/popover/types.ts +9 -0
  1363. package/src/progress-bar/stories/index.story.tsx +1 -0
  1364. package/src/query-controls/index.native.js +4 -4
  1365. package/src/query-controls/index.tsx +5 -5
  1366. package/src/resizable-box/resize-tooltip/styles/resize-tooltip.styles.ts +3 -3
  1367. package/src/search-control/README.md +23 -3
  1368. package/src/search-control/index.tsx +88 -70
  1369. package/src/search-control/stories/index.story.tsx +1 -1
  1370. package/src/search-control/styles.ts +42 -0
  1371. package/src/search-control/test/index.tsx +107 -0
  1372. package/src/search-control/types.ts +37 -22
  1373. package/src/select-control/index.tsx +1 -5
  1374. package/src/slot-fill/bubbles-virtually/use-slot-fills.ts +1 -1
  1375. package/src/snackbar/index.tsx +19 -6
  1376. package/src/style.scss +0 -1
  1377. package/src/tabs/index.tsx +31 -27
  1378. package/src/tabs/stories/index.story.tsx +1 -0
  1379. package/src/tabs/tablist.tsx +19 -0
  1380. package/src/tabs/test/index.tsx +105 -47
  1381. package/src/theme/stories/index.story.tsx +1 -0
  1382. package/src/theme/styles.ts +3 -1
  1383. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +14 -14
  1384. package/src/toggle-group-control/test/index.tsx +73 -36
  1385. package/src/toggle-group-control/toggle-group-control/utils.ts +8 -3
  1386. package/src/toolbar/toolbar-button/README.md +2 -2
  1387. package/src/toolbar/toolbar-dropdown-menu/README.md +2 -2
  1388. package/src/toolbar/toolbar-item/README.md +2 -2
  1389. package/src/tooltip/index.tsx +29 -29
  1390. package/src/tooltip/test/index.tsx +32 -13
  1391. package/src/tooltip/types.ts +1 -1
  1392. package/src/tree-select/index.tsx +1 -5
  1393. package/src/unit-control/index.tsx +1 -5
  1394. package/src/utils/colors-values.js +45 -23
  1395. package/src/utils/hooks/use-update-effect.js +1 -1
  1396. package/src/utils/use-deprecated-props.ts +1 -18
  1397. package/tsconfig.tsbuildinfo +1 -1
  1398. package/build/border-control/border-control-style-picker/hook.js +0 -41
  1399. package/build/border-control/border-control-style-picker/hook.js.map +0 -1
  1400. package/build/box-control/styles/box-control-visualizer-styles.js +0 -93
  1401. package/build/box-control/styles/box-control-visualizer-styles.js.map +0 -1
  1402. package/build/box-control/unit-control.js +0 -76
  1403. package/build/box-control/unit-control.js.map +0 -1
  1404. package/build-module/border-control/border-control-style-picker/hook.js +0 -32
  1405. package/build-module/border-control/border-control-style-picker/hook.js.map +0 -1
  1406. package/build-module/box-control/styles/box-control-visualizer-styles.js +0 -86
  1407. package/build-module/box-control/styles/box-control-visualizer-styles.js.map +0 -1
  1408. package/build-module/box-control/unit-control.js +0 -68
  1409. package/build-module/box-control/unit-control.js.map +0 -1
  1410. package/build-types/border-control/border-control-style-picker/hook.d.ts +0 -267
  1411. package/build-types/border-control/border-control-style-picker/hook.d.ts.map +0 -1
  1412. package/build-types/box-control/styles/box-control-visualizer-styles.d.ts +0 -46
  1413. package/build-types/box-control/styles/box-control-visualizer-styles.d.ts.map +0 -1
  1414. package/build-types/box-control/unit-control.d.ts +0 -4
  1415. package/build-types/box-control/unit-control.d.ts.map +0 -1
  1416. package/build-types/composite/test/index.d.ts.map +0 -1
  1417. package/src/border-control/border-control-style-picker/hook.ts +0 -35
  1418. package/src/box-control/styles/box-control-visualizer-styles.ts +0 -75
  1419. package/src/box-control/unit-control.tsx +0 -74
  1420. package/src/composite/test/index.tsx +0 -576
  1421. package/src/search-control/style.scss +0 -71
  1422. /package/build-types/composite/{test → legacy/test}/index.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_flex","_unitControl","_interopRequireDefault","_utils","_EMOTION_STRINGIFIED_CSS_ERROR__","Root","_base","default","process","env","NODE_ENV","target","label","name","styles","map","toString","exports","Header","Flex","HeaderControlWrapper","UnitControlWrapper","LayoutContainer","Layout","_ref","_ref2","unitControlBorderRadiusStyles","isFirst","isLast","isOnly","rtl","borderTopRightRadius","borderBottomRightRadius","borderTopLeftRadius","borderBottomLeftRadius","unitControlMarginStyles","marginLeft","UnitControl","BaseUnitControl"],"sources":["@wordpress/components/src/box-control/styles/box-control-styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport { css } from '@emotion/react';\nimport styled from '@emotion/styled';\n/**\n * Internal dependencies\n */\nimport { Flex } from '../../flex';\nimport BaseUnitControl from '../../unit-control';\nimport { rtl } from '../../utils';\nimport type { BoxUnitControlProps } from '../types';\n\nexport const Root = styled.div`\n\tbox-sizing: border-box;\n\tmax-width: 235px;\n\tpadding-bottom: 12px;\n\twidth: 100%;\n`;\n\nexport const Header = styled( Flex )`\n\tmargin-bottom: 8px;\n`;\n\nexport const HeaderControlWrapper = styled( Flex )`\n\tmin-height: 30px;\n\tgap: 0;\n`;\n\nexport const UnitControlWrapper = styled.div`\n\tbox-sizing: border-box;\n\tmax-width: 80px;\n`;\n\nexport const LayoutContainer = styled( Flex )`\n\tjustify-content: center;\n\tpadding-top: 8px;\n`;\n\nexport const Layout = styled( Flex )`\n\tposition: relative;\n\theight: 100%;\n\twidth: 100%;\n\tjustify-content: flex-start;\n`;\n\nconst unitControlBorderRadiusStyles = ( {\n\tisFirst,\n\tisLast,\n\tisOnly,\n}: Pick< BoxUnitControlProps, 'isFirst' | 'isLast' | 'isOnly' > ) => {\n\tif ( isFirst ) {\n\t\treturn rtl( { borderTopRightRadius: 0, borderBottomRightRadius: 0 } )();\n\t}\n\tif ( isLast ) {\n\t\treturn rtl( { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 } )();\n\t}\n\tif ( isOnly ) {\n\t\treturn css( { borderRadius: 2 } );\n\t}\n\n\treturn css( {\n\t\tborderRadius: 0,\n\t} );\n};\n\nconst unitControlMarginStyles = ( {\n\tisFirst,\n\tisOnly,\n}: Pick< BoxUnitControlProps, 'isFirst' | 'isOnly' > ) => {\n\tconst marginLeft = isFirst || isOnly ? 0 : -1;\n\n\treturn rtl( { marginLeft } )();\n};\n\nexport const UnitControl = styled( BaseUnitControl )`\n\tmax-width: 60px;\n\t${ unitControlBorderRadiusStyles };\n\t${ unitControlMarginStyles };\n`;\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAAkC,SAAAK,iCAAA;AAG3B,MAAMC,IAAI,OAAAC,KAAA,CAAAC,OAAA,SAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,GAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;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C;MAAEC,sBAAsB,EAAE;IAAE,CAAE,CAAC,CAAC,CAAC;EACtE;EACA,IAAKL,MAAM,EAAG;IACb,OAAAJ,KAAA;EACD;EAEA,OAAAD,IAAA;AAGD,CAAC;AAED,MAAMW,uBAAuB,GAAGA,CAAE;EACjCR,OAAO;EACPE;AACkD,CAAC,KAAM;EACzD,MAAMO,UAAU,GAAGT,OAAO,IAAIE,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;EAE7C,OAAO,IAAAC,UAAG,EAAE;IAAEM;EAAW,CAAE,CAAC,CAAC,CAAC;AAC/B,CAAC;AAEM,MAAMC,WAAW,GAAG,kBAAA/B,KAAA,CAAAC,OAAA,EAAQ+B,oBAAe,EAAA9B,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,oBAEhDc,6BAA6B,OAC7BS,uBAAuB,SAAA3B,OAAA,CAAAC,GAAA,CAAAC,QAAA,4tFAC1B;AAACO,OAAA,CAAAoB,WAAA,GAAAA,WAAA"}
1
+ {"version":3,"names":["_icon","_interopRequireDefault","require","_button","_hStack","_rangeControl","_unitControl","_space","_EMOTION_STRINGIFIED_CSS_ERROR__","StyledUnitControl","exports","_base","default","UnitControl","process","env","NODE_ENV","target","label","name","styles","map","toString","InputWrapper","HStack","ResetButton","Button","LinkedButtonWrapper","FlexedBoxControlIcon","BoxControlIcon","FlexedRangeControl","RangeControl","space"],"sources":["@wordpress/components/src/box-control/styles/box-control-styles.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport styled from '@emotion/styled';\n/**\n * Internal dependencies\n */\nimport BoxControlIcon from '../icon';\nimport Button from '../../button';\nimport { HStack } from '../../h-stack';\nimport RangeControl from '../../range-control';\nimport UnitControl from '../../unit-control';\nimport { space } from '../../utils/space';\n\nexport const StyledUnitControl = styled( UnitControl )`\n\tmax-width: 90px;\n`;\n\nexport const InputWrapper = styled( HStack )`\n\tgrid-column: 1 / span 3;\n`;\n\nexport const ResetButton = styled( Button )`\n\tgrid-area: 1 / 2;\n\tjustify-self: end;\n`;\n\nexport const LinkedButtonWrapper = styled.div`\n\tgrid-area: 1 / 3;\n\tjustify-self: end;\n`;\n\nexport const FlexedBoxControlIcon = styled( BoxControlIcon )`\n\tflex: 0 0 auto;\n`;\n\nexport const FlexedRangeControl = styled( RangeControl )`\n\twidth: 100%;\n\tmargin-inline-end: ${ space( 2 ) };\n`;\n"],"mappings":";;;;;;;;AAOA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA0C,SAAAM,iCAAA;AAEnC,MAAMC,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,kBAAAE,KAAA,CAAAC,OAAA,EAAQC,oBAAW,EAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,CAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GAAA;EAAAC,QAAA,EAAAd;AAAA,EAErD;AAEM,MAAMe,YAAY,GAAAb,OAAA,CAAAa,YAAA,GAAG,kBAAAZ,KAAA,CAAAC,OAAA,EAAQY,cAAM,EAAAV,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAC,MAAA;AAAA;EAAAA,MAAA;EAAAC,KAAA;AAAA,CAAC,CAAC,CAAAJ,OAAA,CAAAC,GAAA,CAAAC,QAAA;EAAAG,IAAA;EAAAC,MAAA;AAAA;EAAAD,IAAA;EAAAC,MAAA;EAAAC,GA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AAC,KAAA;AAAA,CAAC,CAAC,kCAEjC,IAAAc,YAAK,EAAE,CAAE,CAAC,SAAAlB,OAAA,CAAAC,GAAA,CAAAC,QAAA,omDAChC"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/box-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { useHover } from '@use-gesture/react';\n\n/**\n * Internal dependencies\n */\nimport type { UnitControlProps } from '../unit-control/types';\nimport type { LABELS } from './utils';\n\nexport type BoxControlValue = {\n\ttop?: string;\n\tright?: string;\n\tbottom?: string;\n\tleft?: string;\n};\n\ntype UnitControlPassthroughProps = Omit<\n\tUnitControlProps,\n\t'label' | 'onChange' | 'onFocus' | 'onMouseOver' | 'onMouseOut' | 'units'\n>;\n\nexport type BoxControlProps = Pick<\n\tUnitControlProps,\n\t'onMouseOver' | 'onMouseOut' | 'units'\n> & {\n\t/**\n\t * If this property is true, a button to reset the box control is rendered.\n\t *\n\t * @default true\n\t */\n\tallowReset?: boolean;\n\t/**\n\t * The id to use as a base for the unique HTML id attribute of the control.\n\t */\n\tid?: string;\n\t/**\n\t * Props for the internal `UnitControl` components.\n\t *\n\t * @default `{ min: 0 }`\n\t */\n\tinputProps?: UnitControlPassthroughProps;\n\t/**\n\t * Heading label for the control.\n\t *\n\t * @default `__( 'Box Control' )`\n\t */\n\tlabel?: string;\n\t/**\n\t * A callback function when an input value changes.\n\t */\n\tonChange: ( next: BoxControlValue ) => void;\n\t/**\n\t * The `top`, `right`, `bottom`, and `left` box dimension values to use when the control is reset.\n\t *\n\t * @default `{ top: undefined, right: undefined, bottom: undefined, left: undefined }`\n\t */\n\tresetValues?: BoxControlValue;\n\t/**\n\t * Collection of sides to allow control of. If omitted or empty, all sides will be available.\n\t */\n\tsides?: readonly ( keyof BoxControlValue | 'horizontal' | 'vertical' )[];\n\t/**\n\t * If this property is true, when the box control is unlinked, vertical and horizontal controls\n\t * can be used instead of updating individual sides.\n\t *\n\t * @default false\n\t */\n\tsplitOnAxis?: boolean;\n\t/**\n\t * The current values of the control, expressed as an object of `top`, `right`, `bottom`, and `left` values.\n\t */\n\tvalues?: BoxControlValue;\n};\n\nexport type BoxControlInputControlProps = UnitControlPassthroughProps & {\n\tonChange?: ( nextValues: BoxControlValue ) => void;\n\tonFocus?: (\n\t\t_event: React.FocusEvent< HTMLInputElement >,\n\t\t{ side }: { side: keyof typeof LABELS }\n\t) => void;\n\tonHoverOff?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tonHoverOn?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tselectedUnits: BoxControlValue;\n\tsetSelectedUnits: React.Dispatch< React.SetStateAction< BoxControlValue > >;\n\tsides: BoxControlProps[ 'sides' ];\n\tvalues: BoxControlValue;\n};\n\nexport type BoxUnitControlProps = UnitControlPassthroughProps &\n\tPick< UnitControlProps, 'onChange' | 'onFocus' > & {\n\t\tisFirst?: boolean;\n\t\tisLast?: boolean;\n\t\tisOnly?: boolean;\n\t\tlabel?: string;\n\t\tonHoverOff?: (\n\t\t\tevent: ReturnType< typeof useHover >[ 'event' ],\n\t\t\tstate: Omit< ReturnType< typeof useHover >, 'event' >\n\t\t) => void;\n\t\tonHoverOn?: (\n\t\t\tevent: ReturnType< typeof useHover >[ 'event' ],\n\t\t\tstate: Omit< ReturnType< typeof useHover >, 'event' >\n\t\t) => void;\n\t};\n\nexport type BoxControlIconProps = {\n\t/**\n\t * @default 24\n\t */\n\tsize?: number;\n\t/**\n\t * @default 'all'\n\t */\n\tside?: keyof typeof LABELS;\n\tsides?: BoxControlProps[ 'sides' ];\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/box-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { UnitControlProps } from '../unit-control/types';\nimport type { LABELS } from './utils';\n\nexport type BoxControlValue = {\n\ttop?: string;\n\tright?: string;\n\tbottom?: string;\n\tleft?: string;\n};\n\nexport type CustomValueUnits = {\n\t[ key: string ]: { max: number; step: number };\n};\n\ntype UnitControlPassthroughProps = Omit<\n\tUnitControlProps,\n\t'label' | 'onChange' | 'onFocus' | 'onMouseOver' | 'onMouseOut' | 'units'\n>;\n\nexport type BoxControlProps = Pick<\n\tUnitControlProps,\n\t'onMouseOver' | 'onMouseOut' | 'units'\n> & {\n\t/**\n\t * If this property is true, a button to reset the box control is rendered.\n\t *\n\t * @default true\n\t */\n\tallowReset?: boolean;\n\t/**\n\t * The id to use as a base for the unique HTML id attribute of the control.\n\t */\n\tid?: string;\n\t/**\n\t * Props for the internal `UnitControl` components.\n\t *\n\t * @default `{ min: 0 }`\n\t */\n\tinputProps?: UnitControlPassthroughProps;\n\t/**\n\t * Heading label for the control.\n\t *\n\t * @default `__( 'Box Control' )`\n\t */\n\tlabel?: string;\n\t/**\n\t * A callback function when an input value changes.\n\t */\n\tonChange: ( next: BoxControlValue ) => void;\n\t/**\n\t * The `top`, `right`, `bottom`, and `left` box dimension values to use when the control is reset.\n\t *\n\t * @default `{ top: undefined, right: undefined, bottom: undefined, left: undefined }`\n\t */\n\tresetValues?: BoxControlValue;\n\t/**\n\t * Collection of sides to allow control of. If omitted or empty, all sides will be available.\n\t */\n\tsides?: readonly ( keyof BoxControlValue | 'horizontal' | 'vertical' )[];\n\t/**\n\t * If this property is true, when the box control is unlinked, vertical and horizontal controls\n\t * can be used instead of updating individual sides.\n\t *\n\t * @default false\n\t */\n\tsplitOnAxis?: boolean;\n\t/**\n\t * The current values of the control, expressed as an object of `top`, `right`, `bottom`, and `left` values.\n\t */\n\tvalues?: BoxControlValue;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n};\n\nexport type BoxControlInputControlProps = UnitControlPassthroughProps & {\n\tonChange?: ( nextValues: BoxControlValue ) => void;\n\tonFocus?: (\n\t\t_event: React.FocusEvent< HTMLInputElement >,\n\t\t{ side }: { side: keyof typeof LABELS }\n\t) => void;\n\tonHoverOff?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tonHoverOn?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tselectedUnits: BoxControlValue;\n\tsetSelectedUnits: React.Dispatch< React.SetStateAction< BoxControlValue > >;\n\tsides: BoxControlProps[ 'sides' ];\n\tvalues: BoxControlValue;\n};\n\nexport type BoxControlIconProps = {\n\t/**\n\t * @default 24\n\t */\n\tsize?: number;\n\t/**\n\t * @default 'all'\n\t */\n\tside?: keyof typeof LABELS;\n\tsides?: BoxControlProps[ 'sides' ];\n};\n"],"mappings":""}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.LABELS = exports.DEFAULT_VALUES = exports.ALL_SIDES = void 0;
6
+ exports.LABELS = exports.DEFAULT_VALUES = exports.CUSTOM_VALUE_SETTINGS = exports.ALL_SIDES = void 0;
7
7
  exports.applyValueToSides = applyValueToSides;
8
8
  exports.getAllUnitFallback = getAllUnitFallback;
9
9
  exports.getAllValue = getAllValue;
@@ -21,25 +21,137 @@ var _utils = require("../unit-control/utils");
21
21
  * Internal dependencies
22
22
  */
23
23
 
24
- const LABELS = {
25
- all: (0, _i18n.__)('All'),
26
- top: (0, _i18n.__)('Top'),
27
- bottom: (0, _i18n.__)('Bottom'),
28
- left: (0, _i18n.__)('Left'),
29
- right: (0, _i18n.__)('Right'),
24
+ const CUSTOM_VALUE_SETTINGS = exports.CUSTOM_VALUE_SETTINGS = {
25
+ px: {
26
+ max: 300,
27
+ step: 1
28
+ },
29
+ '%': {
30
+ max: 100,
31
+ step: 1
32
+ },
33
+ vw: {
34
+ max: 100,
35
+ step: 1
36
+ },
37
+ vh: {
38
+ max: 100,
39
+ step: 1
40
+ },
41
+ em: {
42
+ max: 10,
43
+ step: 0.1
44
+ },
45
+ rm: {
46
+ max: 10,
47
+ step: 0.1
48
+ },
49
+ svw: {
50
+ max: 100,
51
+ step: 1
52
+ },
53
+ lvw: {
54
+ max: 100,
55
+ step: 1
56
+ },
57
+ dvw: {
58
+ max: 100,
59
+ step: 1
60
+ },
61
+ svh: {
62
+ max: 100,
63
+ step: 1
64
+ },
65
+ lvh: {
66
+ max: 100,
67
+ step: 1
68
+ },
69
+ dvh: {
70
+ max: 100,
71
+ step: 1
72
+ },
73
+ vi: {
74
+ max: 100,
75
+ step: 1
76
+ },
77
+ svi: {
78
+ max: 100,
79
+ step: 1
80
+ },
81
+ lvi: {
82
+ max: 100,
83
+ step: 1
84
+ },
85
+ dvi: {
86
+ max: 100,
87
+ step: 1
88
+ },
89
+ vb: {
90
+ max: 100,
91
+ step: 1
92
+ },
93
+ svb: {
94
+ max: 100,
95
+ step: 1
96
+ },
97
+ lvb: {
98
+ max: 100,
99
+ step: 1
100
+ },
101
+ dvb: {
102
+ max: 100,
103
+ step: 1
104
+ },
105
+ vmin: {
106
+ max: 100,
107
+ step: 1
108
+ },
109
+ svmin: {
110
+ max: 100,
111
+ step: 1
112
+ },
113
+ lvmin: {
114
+ max: 100,
115
+ step: 1
116
+ },
117
+ dvmin: {
118
+ max: 100,
119
+ step: 1
120
+ },
121
+ vmax: {
122
+ max: 100,
123
+ step: 1
124
+ },
125
+ svmax: {
126
+ max: 100,
127
+ step: 1
128
+ },
129
+ lvmax: {
130
+ max: 100,
131
+ step: 1
132
+ },
133
+ dvmax: {
134
+ max: 100,
135
+ step: 1
136
+ }
137
+ };
138
+ const LABELS = exports.LABELS = {
139
+ all: (0, _i18n.__)('All sides'),
140
+ top: (0, _i18n.__)('Top side'),
141
+ bottom: (0, _i18n.__)('Bottom side'),
142
+ left: (0, _i18n.__)('Left side'),
143
+ right: (0, _i18n.__)('Right side'),
30
144
  mixed: (0, _i18n.__)('Mixed'),
31
- vertical: (0, _i18n.__)('Vertical'),
32
- horizontal: (0, _i18n.__)('Horizontal')
145
+ vertical: (0, _i18n.__)('Top and bottom sides'),
146
+ horizontal: (0, _i18n.__)('Left and right sides')
33
147
  };
34
- exports.LABELS = LABELS;
35
- const DEFAULT_VALUES = {
148
+ const DEFAULT_VALUES = exports.DEFAULT_VALUES = {
36
149
  top: undefined,
37
150
  right: undefined,
38
151
  bottom: undefined,
39
152
  left: undefined
40
153
  };
41
- exports.DEFAULT_VALUES = DEFAULT_VALUES;
42
- const ALL_SIDES = ['top', 'right', 'bottom', 'left'];
154
+ const ALL_SIDES = exports.ALL_SIDES = ['top', 'right', 'bottom', 'left'];
43
155
 
44
156
  /**
45
157
  * Gets an items with the most occurrence within an array
@@ -48,7 +160,6 @@ const ALL_SIDES = ['top', 'right', 'bottom', 'left'];
48
160
  * @param arr Array of items to check.
49
161
  * @return The item with the most occurrences.
50
162
  */
51
- exports.ALL_SIDES = ALL_SIDES;
52
163
  function mode(arr) {
53
164
  return arr.sort((a, b) => arr.filter(v => v === a).length - arr.filter(v => v === b).length).pop();
54
165
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_utils","LABELS","all","__","top","bottom","left","right","mixed","vertical","horizontal","exports","DEFAULT_VALUES","undefined","ALL_SIDES","mode","arr","sort","a","b","filter","v","length","pop","getAllValue","values","selectedUnits","availableSides","sides","normalizeSides","parsedQuantitiesAndUnits","map","side","parseQuantityAndUnitFromRawValue","allParsedQuantities","value","_value$","allParsedUnits","commonQuantity","every","commonUnit","_getAllUnitFallback","getAllUnitFallback","join","filteredUnits","Object","Boolean","isValuesMixed","allValue","isMixed","isNaN","parseFloat","isValuesDefined","test","getInitialSide","isLinked","splitOnAxis","initialSide","filteredSides","includes","push","newSides","applyValueToSides","currentValues","newValue","newValues","forEach"],"sources":["@wordpress/components/src/box-control/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport type { BoxControlProps, BoxControlValue } from './types';\n\nexport const LABELS = {\n\tall: __( 'All' ),\n\ttop: __( 'Top' ),\n\tbottom: __( 'Bottom' ),\n\tleft: __( 'Left' ),\n\tright: __( 'Right' ),\n\tmixed: __( 'Mixed' ),\n\tvertical: __( 'Vertical' ),\n\thorizontal: __( 'Horizontal' ),\n};\n\nexport const DEFAULT_VALUES = {\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ] as const;\n\n/**\n * Gets an items with the most occurrence within an array\n * https://stackoverflow.com/a/20762713\n *\n * @param arr Array of items to check.\n * @return The item with the most occurrences.\n */\nfunction mode< T >( arr: T[] ) {\n\treturn arr\n\t\t.sort(\n\t\t\t( a, b ) =>\n\t\t\t\tarr.filter( ( v ) => v === a ).length -\n\t\t\t\tarr.filter( ( v ) => v === b ).length\n\t\t)\n\t\t.pop();\n}\n\n/**\n * Gets the 'all' input value and unit from values data.\n *\n * @param values Box values.\n * @param selectedUnits Box units.\n * @param availableSides Available box sides to evaluate.\n *\n * @return A value + unit for the 'all' input.\n */\nexport function getAllValue(\n\tvalues: BoxControlValue = {},\n\tselectedUnits?: BoxControlValue,\n\tavailableSides: BoxControlProps[ 'sides' ] = ALL_SIDES\n) {\n\tconst sides = normalizeSides( availableSides );\n\tconst parsedQuantitiesAndUnits = sides.map( ( side ) =>\n\t\tparseQuantityAndUnitFromRawValue( values[ side ] )\n\t);\n\tconst allParsedQuantities = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 0 ] ?? ''\n\t);\n\tconst allParsedUnits = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 1 ]\n\t);\n\n\tconst commonQuantity = allParsedQuantities.every(\n\t\t( v ) => v === allParsedQuantities[ 0 ]\n\t)\n\t\t? allParsedQuantities[ 0 ]\n\t\t: '';\n\n\t/**\n\t * The typeof === 'number' check is important. On reset actions, the incoming value\n\t * may be null or an empty string.\n\t *\n\t * Also, the value may also be zero (0), which is considered a valid unit value.\n\t *\n\t * typeof === 'number' is more specific for these cases, rather than relying on a\n\t * simple truthy check.\n\t */\n\tlet commonUnit;\n\tif ( typeof commonQuantity === 'number' ) {\n\t\tcommonUnit = mode( allParsedUnits );\n\t} else {\n\t\t// Set meaningful unit selection if no commonQuantity and user has previously\n\t\t// selected units without assigning values while controls were unlinked.\n\t\tcommonUnit =\n\t\t\tgetAllUnitFallback( selectedUnits ) ?? mode( allParsedUnits );\n\t}\n\n\treturn [ commonQuantity, commonUnit ].join( '' );\n}\n\n/**\n * Determine the most common unit selection to use as a fallback option.\n *\n * @param selectedUnits Current unit selections for individual sides.\n * @return Most common unit selection.\n */\nexport function getAllUnitFallback( selectedUnits?: BoxControlValue ) {\n\tif ( ! selectedUnits || typeof selectedUnits !== 'object' ) {\n\t\treturn undefined;\n\t}\n\n\tconst filteredUnits = Object.values( selectedUnits ).filter( Boolean );\n\n\treturn mode( filteredUnits );\n}\n\n/**\n * Checks to determine if values are mixed.\n *\n * @param values Box values.\n * @param selectedUnits Box units.\n * @param sides Available box sides to evaluate.\n *\n * @return Whether values are mixed.\n */\nexport function isValuesMixed(\n\tvalues: BoxControlValue = {},\n\tselectedUnits?: BoxControlValue,\n\tsides: BoxControlProps[ 'sides' ] = ALL_SIDES\n) {\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst isMixed = isNaN( parseFloat( allValue ) );\n\n\treturn isMixed;\n}\n\n/**\n * Checks to determine if values are defined.\n *\n * @param values Box values.\n *\n * @return Whether values are mixed.\n */\nexport function isValuesDefined( values?: BoxControlValue ) {\n\treturn (\n\t\tvalues !== undefined &&\n\t\tObject.values( values ).filter(\n\t\t\t// Switching units when input is empty causes values only\n\t\t\t// containing units. This gives false positive on mixed values\n\t\t\t// unless filtered.\n\t\t\t( value ) => !! value && /\\d/.test( value )\n\t\t).length > 0\n\t);\n}\n\n/**\n * Get initial selected side, factoring in whether the sides are linked,\n * and whether the vertical / horizontal directions are grouped via splitOnAxis.\n *\n * @param isLinked Whether the box control's fields are linked.\n * @param splitOnAxis Whether splitting by horizontal or vertical axis.\n * @return The initial side.\n */\nexport function getInitialSide( isLinked: boolean, splitOnAxis: boolean ) {\n\tlet initialSide: keyof typeof LABELS = 'all';\n\n\tif ( ! isLinked ) {\n\t\tinitialSide = splitOnAxis ? 'vertical' : 'top';\n\t}\n\n\treturn initialSide;\n}\n\n/**\n * Normalizes provided sides configuration to an array containing only top,\n * right, bottom and left. This essentially just maps `horizontal` or `vertical`\n * to their appropriate sides to facilitate correctly determining value for\n * all input control.\n *\n * @param sides Available sides for box control.\n * @return Normalized sides configuration.\n */\nexport function normalizeSides( sides: BoxControlProps[ 'sides' ] ) {\n\tconst filteredSides: ( keyof BoxControlValue )[] = [];\n\n\tif ( ! sides?.length ) {\n\t\treturn ALL_SIDES;\n\t}\n\n\tif ( sides.includes( 'vertical' ) ) {\n\t\tfilteredSides.push( ...( [ 'top', 'bottom' ] as const ) );\n\t} else if ( sides.includes( 'horizontal' ) ) {\n\t\tfilteredSides.push( ...( [ 'left', 'right' ] as const ) );\n\t} else {\n\t\tconst newSides = ALL_SIDES.filter( ( side ) => sides.includes( side ) );\n\t\tfilteredSides.push( ...newSides );\n\t}\n\n\treturn filteredSides;\n}\n\n/**\n * Applies a value to an object representing top, right, bottom and left sides\n * while taking into account any custom side configuration.\n *\n * @param currentValues The current values for each side.\n * @param newValue The value to apply to the sides object.\n * @param sides Array defining valid sides.\n *\n * @return Object containing the updated values for each side.\n */\nexport function applyValueToSides(\n\tcurrentValues: BoxControlValue,\n\tnewValue?: string,\n\tsides?: BoxControlProps[ 'sides' ]\n): BoxControlValue {\n\tconst newValues = { ...currentValues };\n\n\tif ( sides?.length ) {\n\t\tsides.forEach( ( side ) => {\n\t\t\tif ( side === 'vertical' ) {\n\t\t\t\tnewValues.top = newValue;\n\t\t\t\tnewValues.bottom = newValue;\n\t\t\t} else if ( side === 'horizontal' ) {\n\t\t\t\tnewValues.left = newValue;\n\t\t\t\tnewValues.right = newValue;\n\t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Q;QACzBC,SAAS,CAAC1D,KAAK,GAAGyD,QAAQ;MAC3B,CAAC,MAAM;QACNC,SAAS,CAAEjC,IAAI,CAAE,GAAGgC,QAAQ;MAC7B;IACD,CAAE,CAAC;EACJ,CAAC,MAAM;IACNlD,SAAS,CAACoD,OAAO,CAAIlC,IAAI,IAAQiC,SAAS,CAAEjC,IAAI,CAAE,GAAGgC,QAAW,CAAC;EAClE;EAEA,OAAOC,SAAS;AACjB"}
1
+ {"version":3,"names":["_i18n","require","_utils","CUSTOM_VALUE_SETTINGS","exports","px","max","step","vw","vh","em","rm","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","LABELS","all","__","top","bottom","left","right","mixed","vertical","horizontal","DEFAULT_VALUES","undefined","ALL_SIDES","mode","arr","sort","a","b","filter","v","length","pop","getAllValue","values","selectedUnits","availableSides","sides","normalizeSides","parsedQuantitiesAndUnits","map","side","parseQuantityAndUnitFromRawValue","allParsedQuantities","value","_value$","allParsedUnits","commonQuantity","every","commonUnit","_getAllUnitFallback","getAllUnitFallback","join","filteredUnits","Object","Boolean","isValuesMixed","allValue","isMixed","isNaN","parseFloat","isValuesDefined","test","getInitialSide","isLinked","splitOnAxis","initialSide","filteredSides","includes","push","newSides","applyValueToSides","currentValues","newValue","newValues","forEach"],"sources":["@wordpress/components/src/box-control/utils.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport type {\n\tBoxControlProps,\n\tBoxControlValue,\n\tCustomValueUnits,\n} from './types';\n\nexport const CUSTOM_VALUE_SETTINGS: CustomValueUnits = {\n\tpx: { max: 300, step: 1 },\n\t'%': { max: 100, step: 1 },\n\tvw: { max: 100, step: 1 },\n\tvh: { max: 100, step: 1 },\n\tem: { max: 10, step: 0.1 },\n\trm: { max: 10, step: 0.1 },\n\tsvw: { max: 100, step: 1 },\n\tlvw: { max: 100, step: 1 },\n\tdvw: { max: 100, step: 1 },\n\tsvh: { max: 100, step: 1 },\n\tlvh: { max: 100, step: 1 },\n\tdvh: { max: 100, step: 1 },\n\tvi: { max: 100, step: 1 },\n\tsvi: { max: 100, step: 1 },\n\tlvi: { max: 100, step: 1 },\n\tdvi: { max: 100, step: 1 },\n\tvb: { max: 100, step: 1 },\n\tsvb: { max: 100, step: 1 },\n\tlvb: { max: 100, step: 1 },\n\tdvb: { max: 100, step: 1 },\n\tvmin: { max: 100, step: 1 },\n\tsvmin: { max: 100, step: 1 },\n\tlvmin: { max: 100, step: 1 },\n\tdvmin: { max: 100, step: 1 },\n\tvmax: { max: 100, step: 1 },\n\tsvmax: { max: 100, step: 1 },\n\tlvmax: { max: 100, step: 1 },\n\tdvmax: { max: 100, step: 1 },\n};\n\nexport const LABELS = {\n\tall: __( 'All sides' ),\n\ttop: __( 'Top side' ),\n\tbottom: __( 'Bottom side' ),\n\tleft: __( 'Left side' ),\n\tright: __( 'Right side' ),\n\tmixed: __( 'Mixed' ),\n\tvertical: __( 'Top and bottom sides' ),\n\thorizontal: __( 'Left and right sides' ),\n};\n\nexport const DEFAULT_VALUES = {\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\nexport const ALL_SIDES = [ 'top', 'right', 'bottom', 'left' ] as const;\n\n/**\n * Gets an items with the most occurrence within an array\n * https://stackoverflow.com/a/20762713\n *\n * @param arr Array of items to check.\n * @return The item with the most occurrences.\n */\nfunction mode< T >( arr: T[] ) {\n\treturn arr\n\t\t.sort(\n\t\t\t( a, b ) =>\n\t\t\t\tarr.filter( ( v ) => v === a ).length -\n\t\t\t\tarr.filter( ( v ) => v === b ).length\n\t\t)\n\t\t.pop();\n}\n\n/**\n * Gets the 'all' input value and unit from values data.\n *\n * @param values Box values.\n * @param selectedUnits Box units.\n * @param availableSides Available box sides to evaluate.\n *\n * @return A value + unit for the 'all' input.\n */\nexport function getAllValue(\n\tvalues: BoxControlValue = {},\n\tselectedUnits?: BoxControlValue,\n\tavailableSides: BoxControlProps[ 'sides' ] = ALL_SIDES\n) {\n\tconst sides = normalizeSides( availableSides );\n\tconst parsedQuantitiesAndUnits = sides.map( ( side ) =>\n\t\tparseQuantityAndUnitFromRawValue( values[ side ] )\n\t);\n\tconst allParsedQuantities = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 0 ] ?? ''\n\t);\n\tconst allParsedUnits = parsedQuantitiesAndUnits.map(\n\t\t( value ) => value[ 1 ]\n\t);\n\n\tconst commonQuantity = allParsedQuantities.every(\n\t\t( v ) => v === allParsedQuantities[ 0 ]\n\t)\n\t\t? allParsedQuantities[ 0 ]\n\t\t: '';\n\n\t/**\n\t * The typeof === 'number' check is important. On reset actions, the incoming value\n\t * may be null or an empty string.\n\t *\n\t * Also, the value may also be zero (0), which is considered a valid unit value.\n\t *\n\t * typeof === 'number' is more specific for these cases, rather than relying on a\n\t * simple truthy check.\n\t */\n\tlet commonUnit;\n\tif ( typeof commonQuantity === 'number' ) {\n\t\tcommonUnit = mode( allParsedUnits );\n\t} else {\n\t\t// Set meaningful unit selection if no commonQuantity and user has previously\n\t\t// selected units without assigning values while controls were unlinked.\n\t\tcommonUnit =\n\t\t\tgetAllUnitFallback( selectedUnits ) ?? mode( allParsedUnits );\n\t}\n\n\treturn [ commonQuantity, commonUnit ].join( '' );\n}\n\n/**\n * Determine the most common unit selection to use as a fallback option.\n *\n * @param selectedUnits Current unit selections for individual sides.\n * @return Most common unit selection.\n */\nexport function getAllUnitFallback( selectedUnits?: BoxControlValue ) {\n\tif ( ! selectedUnits || typeof selectedUnits !== 'object' ) {\n\t\treturn undefined;\n\t}\n\n\tconst filteredUnits = Object.values( selectedUnits ).filter( Boolean );\n\n\treturn mode( filteredUnits );\n}\n\n/**\n * Checks to determine if values are mixed.\n *\n * @param values Box values.\n * @param selectedUnits Box units.\n * @param sides Available box sides to evaluate.\n *\n * @return Whether values are mixed.\n */\nexport function isValuesMixed(\n\tvalues: BoxControlValue = {},\n\tselectedUnits?: BoxControlValue,\n\tsides: BoxControlProps[ 'sides' ] = ALL_SIDES\n) {\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst isMixed = isNaN( parseFloat( allValue ) );\n\n\treturn isMixed;\n}\n\n/**\n * Checks to determine if values are defined.\n *\n * @param values Box values.\n *\n * @return Whether values are mixed.\n */\nexport function isValuesDefined( values?: BoxControlValue ) {\n\treturn (\n\t\tvalues !== undefined &&\n\t\tObject.values( values ).filter(\n\t\t\t// Switching units when input is empty causes values only\n\t\t\t// containing units. This gives false positive on mixed values\n\t\t\t// unless filtered.\n\t\t\t( value ) => !! value && /\\d/.test( value )\n\t\t).length > 0\n\t);\n}\n\n/**\n * Get initial selected side, factoring in whether the sides are linked,\n * and whether the vertical / horizontal directions are grouped via splitOnAxis.\n *\n * @param isLinked Whether the box control's fields are linked.\n * @param splitOnAxis Whether splitting by horizontal or vertical axis.\n * @return The initial side.\n */\nexport function getInitialSide( isLinked: boolean, splitOnAxis: boolean ) {\n\tlet initialSide: keyof typeof LABELS = 'all';\n\n\tif ( ! isLinked ) {\n\t\tinitialSide = splitOnAxis ? 'vertical' : 'top';\n\t}\n\n\treturn initialSide;\n}\n\n/**\n * Normalizes provided sides configuration to an array containing only top,\n * right, bottom and left. This essentially just maps `horizontal` or `vertical`\n * to their appropriate sides to facilitate correctly determining value for\n * all input control.\n *\n * @param sides Available sides for box control.\n * @return Normalized sides configuration.\n */\nexport function normalizeSides( sides: BoxControlProps[ 'sides' ] ) {\n\tconst filteredSides: ( keyof BoxControlValue )[] = [];\n\n\tif ( ! sides?.length ) {\n\t\treturn ALL_SIDES;\n\t}\n\n\tif ( sides.includes( 'vertical' ) ) {\n\t\tfilteredSides.push( ...( [ 'top', 'bottom' ] as const ) );\n\t} else if ( sides.includes( 'horizontal' ) ) {\n\t\tfilteredSides.push( ...( [ 'left', 'right' ] as const ) );\n\t} else {\n\t\tconst newSides = ALL_SIDES.filter( ( side ) => sides.includes( side ) );\n\t\tfilteredSides.push( ...newSides );\n\t}\n\n\treturn filteredSides;\n}\n\n/**\n * Applies a value to an object representing top, right, bottom and left sides\n * while taking into account any custom side configuration.\n *\n * @param currentValues The current values for each side.\n * @param newValue The value to apply to the sides object.\n * @param sides Array defining valid sides.\n *\n * @return Object containing the updated values for each side.\n */\nexport function applyValueToSides(\n\tcurrentValues: BoxControlValue,\n\tnewValue?: string,\n\tsides?: BoxControlProps[ 'sides' ]\n): BoxControlValue {\n\tconst newValues = { ...currentValues };\n\n\tif ( sides?.length ) {\n\t\tsides.forEach( ( side ) => {\n\t\t\tif ( side === 'vertical' ) {\n\t\t\t\tnewValues.top = newValue;\n\t\t\t\tnewValues.bottom = newValue;\n\t\t\t} else if ( side === 'horizontal' ) {\n\t\t\t\tnewValues.left = newValue;\n\t\t\t\tnewValues.right = newValue;\n\t\t\t} else {\n\t\t\t\tnewValues[ side ] = newValue;\n\t\t\t}\n\t\t} );\n\t} else {\n\t\tALL_SIDES.forEach( ( side ) => ( newValues[ side ] = newValue ) );\n\t}\n\n\treturn newValues;\n}\n"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAQO,MAAME,qBAAuC,GAAAC,OAAA,CAAAD,qBAAA,GAAG;EACtDE,EAAE,EAAE;IAAEC,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EACzB,GAAG,EAAE;IAAED,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EAC1BC,EAAE,EAAE;IAAEF,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EACzBE,EAAE,EAAE;IAAEH,GAAG,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAE,CAAC;EACzBG,EAAE,EAAE;IAAE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AG;IAAE,GAAGF;EAAc,CAAC;EAEtC,IAAKnC,KAAK,EAAEN,MAAM,EAAG;IACpBM,KAAK,CAACsC,OAAO,CAAIlC,IAAI,IAAM;MAC1B,IAAKA,IAAI,KAAK,UAAU,EAAG;QAC1BiC,SAAS,CAAC5D,GAAG,GAAG2D,QAAQ;QACxBC,SAAS,CAAC3D,MAAM,GAAG0D,QAAQ;MAC5B,CAAC,MAAM,IAAKhC,IAAI,KAAK,YAAY,EAAG;QACnCiC,SAAS,CAAC1D,IAAI,GAAGyD,QAAQ;QACzBC,SAAS,CAACzD,KAAK,GAAGwD,QAAQ;MAC3B,CAAC,MAAM;QACNC,SAAS,CAAEjC,IAAI,CAAE,GAAGgC,QAAQ;MAC7B;IACD,CAAE,CAAC;EACJ,CAAC,MAAM;IACNlD,SAAS,CAACoD,OAAO,CAAIlC,IAAI,IAAQiC,SAAS,CAAEjC,IAAI,CAAE,GAAGgC,QAAW,CAAC;EAClE;EAEA,OAAOC,SAAS;AACjB"}
@@ -42,6 +42,5 @@ function UnforwardedIconButton({
42
42
  label: tooltip || label
43
43
  });
44
44
  }
45
- var _default = (0, _element.forwardRef)(UnforwardedIconButton);
46
- exports.default = _default;
45
+ var _default = exports.default = (0, _element.forwardRef)(UnforwardedIconButton);
47
46
  //# sourceMappingURL=deprecated.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_deprecated","_interopRequireDefault","require","_element","_","UnforwardedIconButton","label","labelPosition","size","tooltip","props","ref","deprecated","since","alternative","version","_react","createElement","default","tooltipPosition","iconSize","showTooltip","undefined","_default","forwardRef","exports"],"sources":["@wordpress/components/src/button/deprecated.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '.';\nimport type { DeprecatedIconButtonProps } from './types';\n\nfunction UnforwardedIconButton(\n\t{\n\t\tlabel,\n\t\tlabelPosition,\n\t\tsize,\n\t\ttooltip,\n\t\t...props\n\t}: React.ComponentPropsWithoutRef< typeof Button > &\n\t\tDeprecatedIconButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tdeprecated( 'wp.components.IconButton', {\n\t\tsince: '5.4',\n\t\talternative: 'wp.components.Button',\n\t\tversion: '6.2',\n\t} );\n\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\ttooltipPosition={ labelPosition }\n\t\t\ticonSize={ size }\n\t\t\tshowTooltip={ tooltip !== undefined ? !! tooltip : undefined }\n\t\t\tlabel={ tooltip || label }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( UnforwardedIconButton );\n"],"mappings":";;;;;;;;AAQA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,CAAA,GAAAH,sBAAA,CAAAC,OAAA;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASG,qBAAqBA,CAC7B;EACCC,KAAK;EACLC,aAAa;EACbC,IAAI;EACJC,OAAO;EACP,GAAGC;AAEqB,CAAC,EAC1BC,GAAwB,EACvB;EACD,IAAAC,mBAAU,EAAE,0BAA0B,EAAE;IACvCC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE,sBAAsB;IACnCC,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACb,CAAA,CAAAc,OAAM;IAAA,GACDR,KAAK;IACVC,GAAG,EAAGA,GAAK;IACXQ,eAAe,EAAGZ,aAAe;IACjCa,QAAQ,EAAGZ,IAAM;IACjBa,WAAW,EAAGZ,OAAO,KAAKa,SAAS,GAAG,CAAC,CAAEb,OAAO,GAAGa,SAAW;IAC9DhB,KAAK,EAAGG,OAAO,IAAIH;EAAO,CAC1B,CAAC;AAEJ;AAAC,IAAAiB,QAAA,GAEc,IAAAC,mBAAU,EAAEnB,qBAAsB,CAAC;AAAAoB,OAAA,CAAAP,OAAA,GAAAK,QAAA"}
1
+ {"version":3,"names":["_deprecated","_interopRequireDefault","require","_element","_","UnforwardedIconButton","label","labelPosition","size","tooltip","props","ref","deprecated","since","alternative","version","_react","createElement","default","tooltipPosition","iconSize","showTooltip","undefined","_default","exports","forwardRef"],"sources":["@wordpress/components/src/button/deprecated.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport Button from '.';\nimport type { DeprecatedIconButtonProps } from './types';\n\nfunction UnforwardedIconButton(\n\t{\n\t\tlabel,\n\t\tlabelPosition,\n\t\tsize,\n\t\ttooltip,\n\t\t...props\n\t}: React.ComponentPropsWithoutRef< typeof Button > &\n\t\tDeprecatedIconButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tdeprecated( 'wp.components.IconButton', {\n\t\tsince: '5.4',\n\t\talternative: 'wp.components.Button',\n\t\tversion: '6.2',\n\t} );\n\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\ttooltipPosition={ labelPosition }\n\t\t\ticonSize={ size }\n\t\t\tshowTooltip={ tooltip !== undefined ? !! tooltip : undefined }\n\t\t\tlabel={ tooltip || label }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( UnforwardedIconButton );\n"],"mappings":";;;;;;;;AAQA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,CAAA,GAAAH,sBAAA,CAAAC,OAAA;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASG,qBAAqBA,CAC7B;EACCC,KAAK;EACLC,aAAa;EACbC,IAAI;EACJC,OAAO;EACP,GAAGC;AAEqB,CAAC,EAC1BC,GAAwB,EACvB;EACD,IAAAC,mBAAU,EAAE,0BAA0B,EAAE;IACvCC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAE,sBAAsB;IACnCC,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACb,CAAA,CAAAc,OAAM;IAAA,GACDR,KAAK;IACVC,GAAG,EAAGA,GAAK;IACXQ,eAAe,EAAGZ,aAAe;IACjCa,QAAQ,EAAGZ,IAAM;IACjBa,WAAW,EAAGZ,OAAO,KAAKa,SAAS,GAAG,CAAC,CAAEb,OAAO,GAAGa,SAAW;IAC9DhB,KAAK,EAAGG,OAAO,IAAIH;EAAO,CAC1B,CAAC;AAEJ;AAAC,IAAAiB,QAAA,GAAAC,OAAA,CAAAN,OAAA,GAEc,IAAAO,mBAAU,EAAEpB,qBAAsB,CAAC"}
@@ -168,9 +168,9 @@ function UnforwardedButton(props, ref) {
168
168
  // Should show the tooltip if...
169
169
  const shouldShowTooltip = !trulyDisabled && (
170
170
  // An explicit tooltip is passed or...
171
- showTooltip && label ||
171
+ showTooltip && !!label ||
172
172
  // There's a shortcut or...
173
- shortcut ||
173
+ !!shortcut ||
174
174
  // There's a label and...
175
175
  !!label &&
176
176
  // The children are empty and...
@@ -202,21 +202,19 @@ function UnforwardedButton(props, ref) {
202
202
  ...commonProps
203
203
  }, elementChildren);
204
204
 
205
- // Convert legacy `position` values to be used with the new `placement` prop
206
- let computedPlacement;
207
- // if `tooltipPosition` is defined, compute value to `placement`
208
- if (tooltipPosition !== undefined) {
209
- computedPlacement = (0, _utils.positionToPlacement)(tooltipPosition);
210
- }
211
- if (!shouldShowTooltip) {
212
- return (0, _react.createElement)(_react.Fragment, null, element, describedBy && (0, _react.createElement)(_visuallyHidden.VisuallyHidden, null, (0, _react.createElement)("span", {
213
- id: descriptionId
214
- }, describedBy)));
215
- }
216
- return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_tooltip.default, {
205
+ // In order to avoid some React reconciliation issues, we are always rendering
206
+ // the `Tooltip` component even when `shouldShowTooltip` is `false`.
207
+ // In order to make sure that the tooltip doesn't show when it shouldn't,
208
+ // we don't pass the props to the `Tooltip` component.
209
+ const tooltipProps = shouldShowTooltip ? {
217
210
  text: children?.length && describedBy ? describedBy : label,
218
- shortcut: shortcut,
219
- placement: computedPlacement
211
+ shortcut,
212
+ placement: tooltipPosition &&
213
+ // Convert legacy `position` values to be used with the new `placement` prop
214
+ (0, _utils.positionToPlacement)(tooltipPosition)
215
+ } : {};
216
+ return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_tooltip.default, {
217
+ ...tooltipProps
220
218
  }, element), describedBy && (0, _react.createElement)(_visuallyHidden.VisuallyHidden, null, (0, _react.createElement)("span", {
221
219
  id: descriptionId
222
220
  }, describedBy)));
@@ -237,8 +235,6 @@ function UnforwardedButton(props, ref) {
237
235
  * );
238
236
  * ```
239
237
  */
240
- const Button = (0, _element.forwardRef)(UnforwardedButton);
241
- exports.Button = Button;
242
- var _default = Button;
243
- exports.default = _default;
238
+ const Button = exports.Button = (0, _element.forwardRef)(UnforwardedButton);
239
+ var _default = exports.default = Button;
244
240
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_deprecated","_element","_compose","_tooltip","_icon","_visuallyHidden","_utils","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","otherProps","computedSize","computedVariant","newProps","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","deprecated","since","alternative","version","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","buttonOrAnchorProps","href","target","ariaChecked","ariaPressed","ariaSelected","additionalProps","undefined","instanceId","useInstanceId","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","classnames","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","_react","createElement","Fragment","default","element","computedPlacement","positionToPlacement","VisuallyHidden","id","placement","forwardRef","exports","_default"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\nimport { positionToPlacement } from '../popover/utils';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisPressed,\n\tisSmall,\n\tsize,\n\tvariant,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tconst newProps: { 'aria-pressed'?: boolean } = {\n\t\t// @TODO Mark `isPressed` as deprecated\n\t\t'aria-pressed': isPressed,\n\t};\n\n\tif ( isSmall ) {\n\t\tcomputedSize ??= 'small';\n\t}\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'Button isDefault prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...newProps,\n\t\t...otherProps,\n\t\tsize: computedSize,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function UnforwardedButton(\n\tprops: ButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\tsize = 'default',\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...buttonOrAnchorProps\n\t} = useDeprecatedProps( props );\n\n\tconst {\n\t\thref,\n\t\ttarget,\n\t\t'aria-checked': ariaChecked,\n\t\t'aria-pressed': ariaPressed,\n\t\t'aria-selected': ariaSelected,\n\t\t...additionalProps\n\t} = 'href' in buttonOrAnchorProps\n\t\t? buttonOrAnchorProps\n\t\t: { href: undefined, target: undefined, ...buttonOrAnchorProps };\n\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst hasChildren =\n\t\t( 'string' === typeof children && !! children ) ||\n\t\t( Array.isArray( children ) &&\n\t\t\tchildren?.[ 0 ] &&\n\t\t\tchildren[ 0 ] !== null &&\n\t\t\t// Tooltip should not considered as a child\n\t\t\tchildren?.[ 0 ]?.props?.className !== 'components-tooltip' );\n\n\tconst truthyAriaPressedValues: ( typeof ariaPressed )[] = [\n\t\ttrue,\n\t\t'true',\n\t\t'mixed',\n\t];\n\n\tconst classes = classnames( 'components-button', className, {\n\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': size === 'small',\n\t\t'is-compact': size === 'compact',\n\t\t'is-tertiary': variant === 'tertiary',\n\n\t\t'is-pressed': truthyAriaPressedValues.includes( ariaPressed ),\n\t\t'is-pressed-mixed': ariaPressed === 'mixed',\n\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && ( hasChildren || text ),\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst buttonProps: ComponentPropsWithoutRef< 'button' > =\n\t\tTag === 'button'\n\t\t\t? {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-checked': ariaChecked,\n\t\t\t\t\t'aria-pressed': ariaPressed,\n\t\t\t\t\t'aria-selected': ariaSelected,\n\t\t\t }\n\t\t\t: {};\n\tconst anchorProps: ComponentPropsWithoutRef< 'a' > =\n\t\tTag === 'a' ? { href, target } : {};\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\tbuttonProps[ 'aria-disabled' ] = true;\n\t\tanchorProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event: MouseEvent ) => {\n\t\t\t\tif ( event ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\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 as string | ReactElement[] )?.length &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : undefined;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst commonProps = {\n\t\tclassName: classes,\n\t\t'aria-label': additionalProps[ 'aria-label' ] || label,\n\t\t'aria-describedby': describedById,\n\t\tref,\n\t};\n\n\tconst elementChildren = (\n\t\t<>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ children }\n\t\t</>\n\t);\n\n\tconst element =\n\t\tTag === 'a' ? (\n\t\t\t<a\n\t\t\t\t{ ...anchorProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLAnchorElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\t{ ...buttonProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLButtonElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</button>\n\t\t);\n\n\t// Convert legacy `position` values to be used with the new `placement` prop\n\tlet computedPlacement;\n\t// if `tooltipPosition` is defined, compute value to `placement`\n\tif ( tooltipPosition !== undefined ) {\n\t\tcomputedPlacement = positionToPlacement( tooltipPosition );\n\t}\n\n\tif ( ! shouldShowTooltip ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ element }\n\t\t\t\t{ describedBy && (\n\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip\n\t\t\t\ttext={\n\t\t\t\t\t( children as string | ReactElement[] )?.length &&\n\t\t\t\t\tdescribedBy\n\t\t\t\t\t\t? describedBy\n\t\t\t\t\t\t: label\n\t\t\t\t}\n\t\t\t\tshortcut={ shortcut }\n\t\t\t\tplacement={ computedPlacement }\n\t\t\t>\n\t\t\t\t{ element }\n\t\t\t</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef( UnforwardedButton );\nexport default Button;\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAYA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AA1BA;AACA;AACA;;AAUA;AACA;AACA;;AAKA;AACA;AACA;;AAOA,MAAMQ,8BAA8B,GAAG,CAAE,aAAa,EAAE,SAAS,CAAW;AAE5E,SAASC,kBAAkBA,CAAE;EAC5BC,SAAS;EACTC,SAAS;EACTC,WAAW;EACXC,UAAU;EACVC,MAAM;EACNC,SAAS;EACTC,OAAO;EACPC,IA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C,OAAA,CAAAR,OAAA,GAAAS,QAAA"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_deprecated","_element","_compose","_tooltip","_icon","_visuallyHidden","_utils","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","otherProps","computedSize","computedVariant","newProps","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","deprecated","since","alternative","version","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","buttonOrAnchorProps","href","target","ariaChecked","ariaPressed","ariaSelected","additionalProps","undefined","instanceId","useInstanceId","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","classnames","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","_react","createElement","Fragment","default","element","tooltipProps","placement","positionToPlacement","VisuallyHidden","id","exports","forwardRef","_default"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\nimport { positionToPlacement } from '../popover/utils';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisPressed,\n\tisSmall,\n\tsize,\n\tvariant,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tconst newProps: { 'aria-pressed'?: boolean } = {\n\t\t// @TODO Mark `isPressed` as deprecated\n\t\t'aria-pressed': isPressed,\n\t};\n\n\tif ( isSmall ) {\n\t\tcomputedSize ??= 'small';\n\t}\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'Button isDefault prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...newProps,\n\t\t...otherProps,\n\t\tsize: computedSize,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function UnforwardedButton(\n\tprops: ButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\tsize = 'default',\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...buttonOrAnchorProps\n\t} = useDeprecatedProps( props );\n\n\tconst {\n\t\thref,\n\t\ttarget,\n\t\t'aria-checked': ariaChecked,\n\t\t'aria-pressed': ariaPressed,\n\t\t'aria-selected': ariaSelected,\n\t\t...additionalProps\n\t} = 'href' in buttonOrAnchorProps\n\t\t? buttonOrAnchorProps\n\t\t: { href: undefined, target: undefined, ...buttonOrAnchorProps };\n\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst hasChildren =\n\t\t( 'string' === typeof children && !! children ) ||\n\t\t( Array.isArray( children ) &&\n\t\t\tchildren?.[ 0 ] &&\n\t\t\tchildren[ 0 ] !== null &&\n\t\t\t// Tooltip should not considered as a child\n\t\t\tchildren?.[ 0 ]?.props?.className !== 'components-tooltip' );\n\n\tconst truthyAriaPressedValues: ( typeof ariaPressed )[] = [\n\t\ttrue,\n\t\t'true',\n\t\t'mixed',\n\t];\n\n\tconst classes = classnames( 'components-button', className, {\n\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': size === 'small',\n\t\t'is-compact': size === 'compact',\n\t\t'is-tertiary': variant === 'tertiary',\n\n\t\t'is-pressed': truthyAriaPressedValues.includes( ariaPressed ),\n\t\t'is-pressed-mixed': ariaPressed === 'mixed',\n\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && ( hasChildren || text ),\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst buttonProps: ComponentPropsWithoutRef< 'button' > =\n\t\tTag === 'button'\n\t\t\t? {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-checked': ariaChecked,\n\t\t\t\t\t'aria-pressed': ariaPressed,\n\t\t\t\t\t'aria-selected': ariaSelected,\n\t\t\t }\n\t\t\t: {};\n\tconst anchorProps: ComponentPropsWithoutRef< 'a' > =\n\t\tTag === 'a' ? { href, target } : {};\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\tbuttonProps[ 'aria-disabled' ] = true;\n\t\tanchorProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event: MouseEvent ) => {\n\t\t\t\tif ( event ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\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\t!! shortcut ||\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 as string | ReactElement[] )?.length &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : undefined;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst commonProps = {\n\t\tclassName: classes,\n\t\t'aria-label': additionalProps[ 'aria-label' ] || label,\n\t\t'aria-describedby': describedById,\n\t\tref,\n\t};\n\n\tconst elementChildren = (\n\t\t<>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ children }\n\t\t</>\n\t);\n\n\tconst element =\n\t\tTag === 'a' ? (\n\t\t\t<a\n\t\t\t\t{ ...anchorProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLAnchorElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\t{ ...buttonProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLButtonElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</button>\n\t\t);\n\n\t// In order to avoid some React reconciliation issues, we are always rendering\n\t// the `Tooltip` component even when `shouldShowTooltip` is `false`.\n\t// In order to make sure that the tooltip doesn't show when it shouldn't,\n\t// we don't pass the props to the `Tooltip` component.\n\tconst tooltipProps = shouldShowTooltip\n\t\t? {\n\t\t\t\ttext:\n\t\t\t\t\t( children as string | ReactElement[] )?.length &&\n\t\t\t\t\tdescribedBy\n\t\t\t\t\t\t? describedBy\n\t\t\t\t\t\t: label,\n\t\t\t\tshortcut,\n\t\t\t\tplacement:\n\t\t\t\t\ttooltipPosition &&\n\t\t\t\t\t// Convert legacy `position` values to be used with the new `placement` prop\n\t\t\t\t\tpositionToPlacement( tooltipPosition ),\n\t\t }\n\t\t: {};\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip { ...tooltipProps }>{ element }</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef( UnforwardedButton );\nexport default Button;\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAYA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,G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C,MAAA,GAAG,IAAAkC,mBAAU,EAAEhE,iBAAkB,CAAC;AAAC,IAAAiE,QAAA,GAAAF,OAAA,CAAAP,OAAA,GACvC1B,MAAM"}
@@ -64,7 +64,6 @@ const styles = _reactNative.StyleSheet.create({
64
64
  subscriptInactiveDark: {
65
65
  color: '#a7aaad' // $gray_20.
66
66
  },
67
-
68
67
  subscriptActive: {
69
68
  color: 'white',
70
69
  fontWeight: 'bold',
@@ -189,6 +188,5 @@ function Button(props) {
189
188
  visible: showTooltip === true
190
189
  }, element);
191
190
  }
192
- var _default = Button;
193
- exports.default = _default;
191
+ var _default = exports.default = Button;
194
192
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_reactNativeGestureHandler","_element","_compose","_tooltip","_interopRequireDefault","_icon","_style","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","_react","createElement","default","size","longPressHandler","useCallback","nativeEvent","state","State","ACTIVE","element","TouchableOpacity","activeOpacity","accessible","accessibilityLabel","accessibilityStates","accessibilityRole","accessibilityHint","onPress","LongPressGestureHandler","minDurationMs","maxDist","onHandlerStateChange","View","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={ true }\n\t\t\taccessibilityLabel={ label }\n\t\t\taccessibilityStates={ states }\n\t\t\taccessibilityRole={ 'button' }\n\t\t\taccessibilityHint={ hint }\n\t\t\tonPress={ onClick }\n\t\t\tstyle={ containerStyle }\n\t\t\tdisabled={ isDisabled }\n\t\t\ttestID={ testID }\n\t\t\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;AA1BA;AACA;AACA;;AAUA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,MAAMQ,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,EAAE;IACVC,IAAI,EAAE,CAAC;IACPC,OAAO,EAAE,CAAC;IACVC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACb,CAAC;EACDC,cAAc,EAAE;IACfJ,IAAI,EAAE,CAAC;IACPK,aAAa,EAAE,KAAK;IACpBH,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACb,CAAC;EACDG,UAAU,EAAE;IACXC,WAAW,EAAE;EACd,CAAC;EACDC,YAAY,EAAE;IACbR,IAAI,EAAE,CAAC;IACPK,aAAa,EAAE,KAAK;IACpBH,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE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zC,KAAK,EACJnB,SAAS,GACN5B,MAAM,CAACoB,eAAe,GACtBN;EACH,GAECgB,SACG,CAEF,CACD,CACkB,CACR,CAClB;EAED,IAAK,CAAE6B,iBAAiB,EAAG;IAC1B,OAAOe,OAAO;EACf;EAEA,OACC,IAAAV,MAAA,CAAAC,aAAA,EAAC1E,QAAA,CAAA2E,OAAO;IACPuB,IAAI,EAAGtD,KAAO;IACdC,QAAQ,EAAGA,QAAU;IACrBsD,QAAQ,EAAGrD,eAAiB;IAC5BsD,OAAO,EAAGzD,WAAW,KAAK;EAAM,GAE9BwC,OACM,CAAC;AAEZ;AAAC,IAAAkB,QAAA,GAEcvE,MAAM;AAAAwE,OAAA,CAAA3B,OAAA,GAAA0B,QAAA"}
1
+ {"version":3,"names":["_reactNative","require","_reactNativeGestureHandler","_element","_compose","_tooltip","_interopRequireDefault","_icon","_style","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","_react","createElement","default","size","longPressHandler","useCallback","nativeEvent","state","State","ACTIVE","element","TouchableOpacity","activeOpacity","accessible","accessibilityLabel","accessibilityStates","accessibilityRole","accessibilityHint","onPress","LongPressGestureHandler","minDurationMs","maxDist","onHandlerStateChange","View","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={ true }\n\t\t\taccessibilityLabel={ label }\n\t\t\taccessibilityStates={ states }\n\t\t\taccessibilityRole={ 'button' }\n\t\t\taccessibilityHint={ hint }\n\t\t\tonPress={ onClick }\n\t\t\tstyle={ containerStyle }\n\t\t\tdisabled={ isDisabled }\n\t\t\ttestID={ testID }\n\t\t\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;AA1BA;AACA;AACA;;AAUA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,MAAMQ,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,EAAE;IACVC,IAAI,EAAE,CAAC;IACPC,OAAO,EAAE,CAAC;IACVC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACb,CAAC;EACDC,cAAc,EAAE;IACfJ,IAAI,EAAE,CAAC;IACPK,aAAa,EAAE,KAAK;IACpBH,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACb,CAAC;EACDG,UAAU,EAAE;IACXC,WAAW,EAAE;EACd,CAAC;EACDC,YAAY,EAAE;IACbR,IAAI,EAAE,CAAC;IACPK,aAAa,EAAE,KAAK;IACpBH,cAAc,EA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/E,YAAA,CAAAsG,IAAI;IACJzC,KAAK,EACJnB,SAAS,GACN5B,MAAM,CAACoB,eAAe,GACtBN;EACH,GAECgB,SACG,CAEF,CACD,CACkB,CACR,CAClB;EAED,IAAK,CAAE6B,iBAAiB,EAAG;IAC1B,OAAOe,OAAO;EACf;EAEA,OACC,IAAAV,MAAA,CAAAC,aAAA,EAAC1E,QAAA,CAAA2E,OAAO;IACPuB,IAAI,EAAGtD,KAAO;IACdC,QAAQ,EAAGA,QAAU;IACrBsD,QAAQ,EAAGrD,eAAiB;IAC5BsD,OAAO,EAAGzD,WAAW,KAAK;EAAM,GAE9BwC,OACM,CAAC;AAEZ;AAAC,IAAAkB,QAAA,GAAAC,OAAA,CAAA3B,OAAA,GAEc7C,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/button/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Props as IconProps } from '../icon';\nimport type { PopoverProps } from '../popover/types';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\n\nexport type ButtonProps =\n\t| WordPressComponentProps< ButtonAsButtonProps, 'button', false >\n\t| WordPressComponentProps< ButtonAsAnchorProps, 'a', false >;\n\nexport type ButtonAsButtonProps = BaseButtonProps & _ButtonProps;\nexport type ButtonAsAnchorProps = BaseButtonProps & AnchorProps;\n\ntype BaseButtonProps = {\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * The button's children.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An accessible description for the button.\n\t */\n\tdescribedBy?: string;\n\t/**\n\t * If provided, renders an Icon component inside the button.\n\t */\n\ticon?: IconProps[ 'icon' ];\n\t/**\n\t * If provided with `icon`, sets the position of icon relative to the `text`.\n\t *\n\t * @default 'left'\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * If provided with `icon`, sets the icon size.\n\t * Please refer to the Icon component for more details regarding\n\t * the default value of its `size` prop.\n\t */\n\ticonSize?: IconProps[ 'size' ];\n\t/**\n\t * Indicates activity while a action is being performed.\n\t */\n\tisBusy?: boolean;\n\t/**\n\t * Renders a red text-based button style to indicate destructive behavior.\n\t */\n\tisDestructive?: boolean;\n\t/**\n\t * Renders a pressed button style.\n\t */\n\tisPressed?: boolean;\n\t// TODO: Deprecate officially (add console warning and move to DeprecatedButtonProps).\n\t/**\n\t * Decreases the size of the button.\n\t *\n\t * Deprecated in favor of the `size` prop. If both props are defined, the `size` prop will take precedence.\n\t *\n\t * @deprecated Use the `'small'` value on the `size` prop instead.\n\t */\n\tisSmall?: boolean;\n\t/**\n\t * Sets the `aria-label` of the component, if none is provided.\n\t * Sets the Tooltip content if `showTooltip` is provided.\n\t */\n\tlabel?: string;\n\t/**\n\t * If provided with `showTooltip`, appends the Shortcut label to the tooltip content.\n\t * If an object is provided, it should contain `display` and `ariaLabel` keys.\n\t */\n\tshortcut?: string | { display: string; ariaLabel: string };\n\t/**\n\t * If provided, renders a Tooltip component for the button.\n\t */\n\tshowTooltip?: boolean;\n\t/**\n\t * The size of the button.\n\t *\n\t * - `'default'`: For normal text-label buttons, unless it is a toggle button.\n\t * - `'compact'`: For toggle buttons, icon buttons, and buttons when used in context of either.\n\t * - `'small'`: For icon buttons associated with more advanced or auxiliary features.\n\t *\n\t * If the deprecated `isSmall` prop is also defined, this prop will take precedence.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'compact' | 'small';\n\t/**\n\t * If provided, displays the given text inside the button. If the button contains children elements, the text is displayed before them.\n\t */\n\ttext?: string;\n\t/**\n\t * If provided with `showTooltip`, sets the position of the tooltip.\n\t * Please refer to the Tooltip component for more details regarding the defaults.\n\t */\n\ttooltipPosition?: PopoverProps[ 'position' ];\n\t/**\n\t * Specifies the button's style.\n\t * The accepted values are:\n\t * 'primary' (the primary button styles)\n\t * 'secondary' (the default button styles)\n\t * 'tertiary' (the text-based button styles)\n\t * 'link' (the link button styles)\n\t */\n\tvariant?: 'primary' | 'secondary' | 'tertiary' | 'link';\n\t/**\n\t * Whether this is focusable.\n\t */\n\t__experimentalIsFocusable?: boolean;\n};\n\ntype _ButtonProps = {\n\t/**\n\t * Whether the button is disabled.\n\t * If `true`, this will force a `button` element to be rendered.\n\t */\n\tdisabled?: boolean;\n};\n\ntype AnchorProps = {\n\t/**\n\t * Whether the button is disabled.\n\t * If `true`, this will force a `button` element to be rendered.\n\t */\n\tdisabled?: false;\n\t/**\n\t * If provided, renders `a` instead of `button`.\n\t */\n\thref: string;\n\t/**\n\t * If provided with `href`, sets the `target` attribute to the `a`.\n\t */\n\ttarget?: string;\n};\n\nexport type DeprecatedButtonProps = {\n\tisDefault?: boolean;\n\tisLink?: boolean;\n\tisPrimary?: boolean;\n\tisSecondary?: boolean;\n\tisTertiary?: boolean;\n};\n\nexport type DeprecatedIconButtonProps = {\n\tlabelPosition: ButtonProps[ 'tooltipPosition' ];\n\tshowTooltip?: boolean;\n\tsize: ButtonProps[ 'iconSize' ];\n\tlabel: ButtonProps[ 'label' ];\n\ttooltip: ButtonProps[ 'label' ];\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/button/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Props as IconProps } from '../icon';\nimport type { PopoverProps } from '../popover/types';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\n\nexport type ButtonProps =\n\t| WordPressComponentProps< ButtonAsButtonProps, 'button', false >\n\t| WordPressComponentProps< ButtonAsAnchorProps, 'a', false >;\n\nexport type ButtonAsButtonProps = BaseButtonProps & _ButtonProps;\nexport type ButtonAsAnchorProps = BaseButtonProps & AnchorProps;\n\ntype BaseButtonProps = {\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * The button's children.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An accessible description for the button.\n\t */\n\tdescribedBy?: string;\n\t/**\n\t * If provided, renders an Icon component inside the button.\n\t */\n\ticon?: IconProps[ 'icon' ];\n\t/**\n\t * If provided with `icon`, sets the position of icon relative to the `text`.\n\t *\n\t * @default 'left'\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * If provided with `icon`, sets the icon size.\n\t * Please refer to the Icon component for more details regarding\n\t * the default value of its `size` prop.\n\t */\n\ticonSize?: IconProps[ 'size' ];\n\t/**\n\t * Indicates activity while a action is being performed.\n\t */\n\tisBusy?: boolean;\n\t/**\n\t * Renders a red text-based button style to indicate destructive behavior.\n\t */\n\tisDestructive?: boolean;\n\t/**\n\t * Renders a pressed button style.\n\t */\n\tisPressed?: boolean;\n\t// TODO: Deprecate officially (add console warning and move to DeprecatedButtonProps).\n\t/**\n\t * Decreases the size of the button.\n\t *\n\t * Deprecated in favor of the `size` prop. If both props are defined, the `size` prop will take precedence.\n\t *\n\t * @deprecated Use the `'small'` value on the `size` prop instead.\n\t */\n\tisSmall?: boolean;\n\t/**\n\t * Sets the `aria-label` of the component, if none is provided.\n\t * Sets the Tooltip content if `showTooltip` is provided.\n\t */\n\tlabel?: string;\n\t/**\n\t * If provided with `showTooltip`, appends the Shortcut label to the tooltip content.\n\t * If an object is provided, it should contain `display` and `ariaLabel` keys.\n\t */\n\tshortcut?: string | { display: string; ariaLabel: string };\n\t/**\n\t * If provided, renders a Tooltip component for the button.\n\t */\n\tshowTooltip?: boolean;\n\t/**\n\t * The size of the button.\n\t *\n\t * - `'default'`: For normal text-label buttons, unless it is a toggle button.\n\t * - `'compact'`: For toggle buttons, icon buttons, and buttons when used in context of either.\n\t * - `'small'`: For icon buttons associated with more advanced or auxiliary features.\n\t *\n\t * If the deprecated `isSmall` prop is also defined, this prop will take precedence.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'compact' | 'small';\n\t/**\n\t * If provided, displays the given text inside the button. If the button contains children elements, the text is displayed before them.\n\t */\n\ttext?: string;\n\t/**\n\t * If provided with `showTooltip`, sets the position of the tooltip.\n\t * Please refer to the Tooltip component for more details regarding the defaults.\n\t */\n\ttooltipPosition?: PopoverProps[ 'position' ];\n\t/**\n\t * Specifies the button's style.\n\t * The accepted values are:\n\t * 'primary' (the primary button styles)\n\t * 'secondary' (the default button styles)\n\t * 'tertiary' (the text-based button styles)\n\t * 'link' (the link button styles)\n\t */\n\tvariant?: 'primary' | 'secondary' | 'tertiary' | 'link';\n\t/**\n\t * Whether to keep the button focusable when disabled.\n\t *\n\t * @default false\n\t */\n\t__experimentalIsFocusable?: boolean;\n};\n\ntype _ButtonProps = {\n\t/**\n\t * Whether the button is disabled.\n\t *\n\t * If `true`, this will force a `button` element to be rendered, even when an `href` is given.\n\t */\n\tdisabled?: boolean;\n};\n\ntype AnchorProps = {\n\t/**\n\t * Whether the button is disabled.\n\t *\n\t * If `true`, this will force a `button` element to be rendered, even when an `href` is given.\n\t */\n\tdisabled?: false;\n\t/**\n\t * If provided, renders `a` instead of `button`.\n\t */\n\thref: string;\n\t/**\n\t * If provided with `href`, sets the `target` attribute to the `a`.\n\t */\n\ttarget?: string;\n};\n\nexport type DeprecatedButtonProps = {\n\tisDefault?: boolean;\n\tisLink?: boolean;\n\tisPrimary?: boolean;\n\tisSecondary?: boolean;\n\tisTertiary?: boolean;\n};\n\nexport type DeprecatedIconButtonProps = {\n\tlabelPosition: ButtonProps[ 'tooltipPosition' ];\n\tshowTooltip?: boolean;\n\tsize: ButtonProps[ 'iconSize' ];\n\tlabel: ButtonProps[ 'label' ];\n\ttooltip: ButtonProps[ 'label' ];\n};\n"],"mappings":""}
@@ -45,8 +45,6 @@ function UnforwardedButtonGroup(props, ref) {
45
45
  * );
46
46
  * ```
47
47
  */
48
- const ButtonGroup = (0, _element.forwardRef)(UnforwardedButtonGroup);
49
- exports.ButtonGroup = ButtonGroup;
50
- var _default = ButtonGroup;
51
- exports.default = _default;
48
+ const ButtonGroup = exports.ButtonGroup = (0, _element.forwardRef)(UnforwardedButtonGroup);
49
+ var _default = exports.default = ButtonGroup;
52
50
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","UnforwardedButtonGroup","props","ref","className","restProps","classes","classnames","_react","createElement","role","ButtonGroup","forwardRef","exports","_default","default"],"sources":["@wordpress/components/src/button-group/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonGroupProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedButtonGroup(\n\tprops: WordPressComponentProps< ButtonGroupProps, 'div', false >,\n\tref: ForwardedRef< HTMLDivElement >\n) {\n\tconst { className, ...restProps } = props;\n\tconst classes = classnames( 'components-button-group', className );\n\n\treturn (\n\t\t<div ref={ ref } role=\"group\" className={ classes } { ...restProps } />\n\t);\n}\n\n/**\n * ButtonGroup can be used to group any related buttons together. To emphasize\n * related buttons, a group should share a common container.\n *\n * ```jsx\n * import { Button, ButtonGroup } from '@wordpress/components';\n *\n * const MyButtonGroup = () => (\n * <ButtonGroup>\n * <Button variant=\"primary\">Button 1</Button>\n * <Button variant=\"primary\">Button 2</Button>\n * </ButtonGroup>\n * );\n * ```\n */\nexport const ButtonGroup = forwardRef( UnforwardedButtonGroup );\n\nexport default ButtonGroup;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AASA,SAASE,sBAAsBA,CAC9BC,KAAgE,EAChEC,GAAmC,EAClC;EACD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EACzC,MAAMI,OAAO,GAAG,IAAAC,mBAAU,EAAE,yBAAyB,EAAEH,SAAU,CAAC;EAElE,OACC,IAAAI,MAAA,CAAAC,aAAA;IAAKN,GAAG,EAAGA,GAAK;IAACO,IAAI,EAAC,OAAO;IAACN,SAAS,EAAGE,OAAS;IAAA,GAAMD;EAAS,CAAI,CAAC;AAEzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,WAAW,GAAG,IAAAC,mBAAU,EAAEX,sBAAuB,CAAC;AAACY,OAAA,CAAAF,WAAA,GAAAA,WAAA;AAAA,IAAAG,QAAA,GAEjDH,WAAW;AAAAE,OAAA,CAAAE,OAAA,GAAAD,QAAA"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","UnforwardedButtonGroup","props","ref","className","restProps","classes","classnames","_react","createElement","role","ButtonGroup","exports","forwardRef","_default","default"],"sources":["@wordpress/components/src/button-group/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonGroupProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedButtonGroup(\n\tprops: WordPressComponentProps< ButtonGroupProps, 'div', false >,\n\tref: ForwardedRef< HTMLDivElement >\n) {\n\tconst { className, ...restProps } = props;\n\tconst classes = classnames( 'components-button-group', className );\n\n\treturn (\n\t\t<div ref={ ref } role=\"group\" className={ classes } { ...restProps } />\n\t);\n}\n\n/**\n * ButtonGroup can be used to group any related buttons together. To emphasize\n * related buttons, a group should share a common container.\n *\n * ```jsx\n * import { Button, ButtonGroup } from '@wordpress/components';\n *\n * const MyButtonGroup = () => (\n * <ButtonGroup>\n * <Button variant=\"primary\">Button 1</Button>\n * <Button variant=\"primary\">Button 2</Button>\n * </ButtonGroup>\n * );\n * ```\n */\nexport const ButtonGroup = forwardRef( UnforwardedButtonGroup );\n\nexport default ButtonGroup;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AASA,SAASE,sBAAsBA,CAC9BC,KAAgE,EAChEC,GAAmC,EAClC;EACD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EACzC,MAAMI,OAAO,GAAG,IAAAC,mBAAU,EAAE,yBAAyB,EAAEH,SAAU,CAAC;EAElE,OACC,IAAAI,MAAA,CAAAC,aAAA;IAAKN,GAAG,EAAGA,GAAK;IAACO,IAAI,EAAC,OAAO;IAACN,SAAS,EAAGE,OAAS;IAAA,GAAMD;EAAS,CAAI,CAAC;AAEzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAAE,mBAAU,EAAEZ,sBAAuB,CAAC;AAAC,IAAAa,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEjDJ,WAAW"}