@wordpress/components 28.11.0 → 28.13.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 (560) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/CONTRIBUTING.md +16 -16
  3. package/build/autocomplete/autocompleter-ui.js +1 -0
  4. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  5. package/build/border-box-control/border-box-control/component.js +1 -0
  6. package/build/border-box-control/border-box-control/component.js.map +1 -1
  7. package/build/border-box-control/border-box-control-split-controls/component.js +2 -1
  8. package/build/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  9. package/build/border-control/border-control/component.js +2 -1
  10. package/build/border-control/border-control/component.js.map +1 -1
  11. package/build/border-control/border-control/hook.js +3 -1
  12. package/build/border-control/border-control/hook.js.map +1 -1
  13. package/build/border-control/border-control-dropdown/component.js +1 -1
  14. package/build/border-control/border-control-dropdown/component.js.map +1 -1
  15. package/build/border-control/types.js.map +1 -1
  16. package/build/box-control/all-input-control.js +1 -0
  17. package/build/box-control/all-input-control.js.map +1 -1
  18. package/build/box-control/axial-input-controls.js +1 -0
  19. package/build/box-control/axial-input-controls.js.map +1 -1
  20. package/build/box-control/index.js +13 -13
  21. package/build/box-control/index.js.map +1 -1
  22. package/build/box-control/input-controls.js +1 -0
  23. package/build/box-control/input-controls.js.map +1 -1
  24. package/build/box-control/types.js.map +1 -1
  25. package/build/circular-option-picker/circular-option-picker-actions.js +1 -0
  26. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  27. package/build/circular-option-picker/circular-option-picker-option.js +1 -0
  28. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  29. package/build/color-palette/index.js +2 -0
  30. package/build/color-palette/index.js.map +1 -1
  31. package/build/color-picker/color-copy-button.js +6 -4
  32. package/build/color-picker/color-copy-button.js.map +1 -1
  33. package/build/color-picker/component.js +1 -0
  34. package/build/color-picker/component.js.map +1 -1
  35. package/build/color-picker/styles.js +21 -28
  36. package/build/color-picker/styles.js.map +1 -1
  37. package/build/combobox-control/index.js +17 -12
  38. package/build/combobox-control/index.js.map +1 -1
  39. package/build/composite/hover.js +1 -1
  40. package/build/composite/hover.js.map +1 -1
  41. package/build/composite/typeahead.js +1 -1
  42. package/build/composite/typeahead.js.map +1 -1
  43. package/build/custom-gradient-picker/gradient-bar/control-points.js +2 -0
  44. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  45. package/build/dashicon/types.js.map +1 -1
  46. package/build/dimension-control/index.js +7 -0
  47. package/build/dimension-control/index.js.map +1 -1
  48. package/build/disabled/index.js +8 -1
  49. package/build/disabled/index.js.map +1 -1
  50. package/build/duotone-picker/duotone-picker.js +2 -0
  51. package/build/duotone-picker/duotone-picker.js.map +1 -1
  52. package/build/font-size-picker/font-size-picker-toggle-group.js +1 -0
  53. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  54. package/build/font-size-picker/index.js +7 -0
  55. package/build/font-size-picker/index.js.map +1 -1
  56. package/build/form-file-upload/index.js +7 -1
  57. package/build/form-file-upload/index.js.map +1 -1
  58. package/build/form-token-field/token.js +1 -0
  59. package/build/form-token-field/token.js.map +1 -1
  60. package/build/gradient-picker/index.js +34 -32
  61. package/build/gradient-picker/index.js.map +1 -1
  62. package/build/gradient-picker/types.js.map +1 -1
  63. package/build/guide/page-control.js +1 -0
  64. package/build/guide/page-control.js.map +1 -1
  65. package/build/icon/index.js +9 -0
  66. package/build/icon/index.js.map +1 -1
  67. package/build/menu/styles.js +16 -16
  68. package/build/menu/styles.js.map +1 -1
  69. package/build/menu-item/index.js +1 -0
  70. package/build/menu-item/index.js.map +1 -1
  71. package/build/modal/index.js +2 -2
  72. package/build/modal/index.js.map +1 -1
  73. package/build/notice/index.js +2 -0
  74. package/build/notice/index.js.map +1 -1
  75. package/build/palette-edit/index.js +5 -0
  76. package/build/palette-edit/index.js.map +1 -1
  77. package/build/panel/body.js +1 -0
  78. package/build/panel/body.js.map +1 -1
  79. package/build/popover/index.js +4 -1
  80. package/build/popover/index.js.map +1 -1
  81. package/build/private-apis.js +0 -2
  82. package/build/private-apis.js.map +1 -1
  83. package/build/radio-group/radio.js +6 -0
  84. package/build/radio-group/radio.js.map +1 -1
  85. package/build/radio-group/types.js.map +1 -1
  86. package/build/range-control/index.js +11 -0
  87. package/build/range-control/index.js.map +1 -1
  88. package/build/range-control/types.js.map +1 -1
  89. package/build/slot-fill/bubbles-virtually/fill.js +14 -31
  90. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  91. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +13 -4
  92. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  93. package/build/slot-fill/bubbles-virtually/slot.js +11 -9
  94. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  95. package/build/slot-fill/bubbles-virtually/use-slot.js +1 -8
  96. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  97. package/build/slot-fill/fill.js +7 -24
  98. package/build/slot-fill/fill.js.map +1 -1
  99. package/build/slot-fill/index.js +5 -10
  100. package/build/slot-fill/index.js.map +1 -1
  101. package/build/slot-fill/provider.js +2 -2
  102. package/build/slot-fill/provider.js.map +1 -1
  103. package/build/slot-fill/slot.js +37 -77
  104. package/build/slot-fill/slot.js.map +1 -1
  105. package/build/slot-fill/types.js.map +1 -1
  106. package/build/snackbar/index.js +2 -1
  107. package/build/snackbar/index.js.map +1 -1
  108. package/build/tabs/tablist.js +13 -2
  109. package/build/tabs/tablist.js.map +1 -1
  110. package/build/text-control/index.js +7 -0
  111. package/build/text-control/index.js.map +1 -1
  112. package/build/toggle-group-control/toggle-group-control/component.js +10 -1
  113. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  114. package/build/toggle-group-control/toggle-group-control-option/component.js +1 -0
  115. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  116. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  117. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  118. package/build/toggle-group-control/types.js.map +1 -1
  119. package/build/utils/deprecated-36px-size.js +3 -2
  120. package/build/utils/deprecated-36px-size.js.map +1 -1
  121. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  122. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  123. package/build-module/border-box-control/border-box-control/component.js +1 -0
  124. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  125. package/build-module/border-box-control/border-box-control-split-controls/component.js +2 -1
  126. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  127. package/build-module/border-control/border-control/component.js +2 -1
  128. package/build-module/border-control/border-control/component.js.map +1 -1
  129. package/build-module/border-control/border-control/hook.js +3 -1
  130. package/build-module/border-control/border-control/hook.js.map +1 -1
  131. package/build-module/border-control/border-control-dropdown/component.js +1 -1
  132. package/build-module/border-control/border-control-dropdown/component.js.map +1 -1
  133. package/build-module/border-control/types.js.map +1 -1
  134. package/build-module/box-control/all-input-control.js +1 -0
  135. package/build-module/box-control/all-input-control.js.map +1 -1
  136. package/build-module/box-control/axial-input-controls.js +1 -0
  137. package/build-module/box-control/axial-input-controls.js.map +1 -1
  138. package/build-module/box-control/index.js +13 -13
  139. package/build-module/box-control/index.js.map +1 -1
  140. package/build-module/box-control/input-controls.js +1 -0
  141. package/build-module/box-control/input-controls.js.map +1 -1
  142. package/build-module/box-control/types.js.map +1 -1
  143. package/build-module/circular-option-picker/circular-option-picker-actions.js +1 -0
  144. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  145. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -0
  146. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  147. package/build-module/color-palette/index.js +2 -0
  148. package/build-module/color-palette/index.js.map +1 -1
  149. package/build-module/color-picker/color-copy-button.js +6 -4
  150. package/build-module/color-picker/color-copy-button.js.map +1 -1
  151. package/build-module/color-picker/component.js +1 -0
  152. package/build-module/color-picker/component.js.map +1 -1
  153. package/build-module/color-picker/styles.js +20 -27
  154. package/build-module/color-picker/styles.js.map +1 -1
  155. package/build-module/combobox-control/index.js +18 -13
  156. package/build-module/combobox-control/index.js.map +1 -1
  157. package/build-module/composite/hover.js +1 -1
  158. package/build-module/composite/hover.js.map +1 -1
  159. package/build-module/composite/typeahead.js +1 -1
  160. package/build-module/composite/typeahead.js.map +1 -1
  161. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +2 -0
  162. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  163. package/build-module/dashicon/types.js.map +1 -1
  164. package/build-module/dimension-control/index.js +7 -0
  165. package/build-module/dimension-control/index.js.map +1 -1
  166. package/build-module/disabled/index.js +8 -1
  167. package/build-module/disabled/index.js.map +1 -1
  168. package/build-module/duotone-picker/duotone-picker.js +2 -0
  169. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  170. package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -0
  171. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  172. package/build-module/font-size-picker/index.js +7 -0
  173. package/build-module/font-size-picker/index.js.map +1 -1
  174. package/build-module/form-file-upload/index.js +7 -1
  175. package/build-module/form-file-upload/index.js.map +1 -1
  176. package/build-module/form-token-field/token.js +1 -0
  177. package/build-module/form-token-field/token.js.map +1 -1
  178. package/build-module/gradient-picker/index.js +34 -32
  179. package/build-module/gradient-picker/index.js.map +1 -1
  180. package/build-module/gradient-picker/types.js.map +1 -1
  181. package/build-module/guide/page-control.js +1 -0
  182. package/build-module/guide/page-control.js.map +1 -1
  183. package/build-module/icon/index.js +9 -0
  184. package/build-module/icon/index.js.map +1 -1
  185. package/build-module/menu/styles.js +16 -16
  186. package/build-module/menu/styles.js.map +1 -1
  187. package/build-module/menu-item/index.js +1 -0
  188. package/build-module/menu-item/index.js.map +1 -1
  189. package/build-module/modal/index.js +2 -2
  190. package/build-module/modal/index.js.map +1 -1
  191. package/build-module/notice/index.js +2 -0
  192. package/build-module/notice/index.js.map +1 -1
  193. package/build-module/palette-edit/index.js +5 -0
  194. package/build-module/palette-edit/index.js.map +1 -1
  195. package/build-module/panel/body.js +1 -0
  196. package/build-module/panel/body.js.map +1 -1
  197. package/build-module/popover/index.js +4 -1
  198. package/build-module/popover/index.js.map +1 -1
  199. package/build-module/private-apis.js +0 -2
  200. package/build-module/private-apis.js.map +1 -1
  201. package/build-module/radio-group/radio.js +6 -0
  202. package/build-module/radio-group/radio.js.map +1 -1
  203. package/build-module/radio-group/types.js.map +1 -1
  204. package/build-module/range-control/index.js +11 -0
  205. package/build-module/range-control/index.js.map +1 -1
  206. package/build-module/range-control/types.js.map +1 -1
  207. package/build-module/slot-fill/bubbles-virtually/fill.js +15 -32
  208. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  209. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +13 -4
  210. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  211. package/build-module/slot-fill/bubbles-virtually/slot.js +11 -9
  212. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  213. package/build-module/slot-fill/bubbles-virtually/use-slot.js +2 -9
  214. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  215. package/build-module/slot-fill/fill.js +7 -24
  216. package/build-module/slot-fill/fill.js.map +1 -1
  217. package/build-module/slot-fill/index.js +5 -8
  218. package/build-module/slot-fill/index.js.map +1 -1
  219. package/build-module/slot-fill/provider.js +2 -3
  220. package/build-module/slot-fill/provider.js.map +1 -1
  221. package/build-module/slot-fill/slot.js +38 -78
  222. package/build-module/slot-fill/slot.js.map +1 -1
  223. package/build-module/slot-fill/types.js.map +1 -1
  224. package/build-module/snackbar/index.js +2 -1
  225. package/build-module/snackbar/index.js.map +1 -1
  226. package/build-module/tabs/tablist.js +13 -2
  227. package/build-module/tabs/tablist.js.map +1 -1
  228. package/build-module/text-control/index.js +7 -0
  229. package/build-module/text-control/index.js.map +1 -1
  230. package/build-module/toggle-group-control/toggle-group-control/component.js +10 -1
  231. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  232. package/build-module/toggle-group-control/toggle-group-control-option/component.js +1 -0
  233. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  234. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  235. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  236. package/build-module/toggle-group-control/types.js.map +1 -1
  237. package/build-module/utils/deprecated-36px-size.js +3 -2
  238. package/build-module/utils/deprecated-36px-size.js.map +1 -1
  239. package/build-style/style-rtl.css +18 -39
  240. package/build-style/style.css +18 -39
  241. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  242. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  243. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  244. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  245. package/build-types/border-control/border-control/component.d.ts +1 -0
  246. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  247. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  248. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  249. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  250. package/build-types/border-control/stories/index.story.d.ts +10 -5
  251. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  252. package/build-types/border-control/types.d.ts +7 -0
  253. package/build-types/border-control/types.d.ts.map +1 -1
  254. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  255. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  256. package/build-types/box-control/index.d.ts +13 -13
  257. package/build-types/box-control/input-controls.d.ts.map +1 -1
  258. package/build-types/box-control/styles/box-control-styles.d.ts +2 -1
  259. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  260. package/build-types/box-control/types.d.ts +2 -0
  261. package/build-types/box-control/types.d.ts.map +1 -1
  262. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  263. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  264. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  265. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  266. package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
  267. package/build-types/color-palette/index.d.ts.map +1 -1
  268. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  269. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  270. package/build-types/color-picker/component.d.ts.map +1 -1
  271. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  272. package/build-types/color-picker/styles.d.ts +2 -4
  273. package/build-types/color-picker/styles.d.ts.map +1 -1
  274. package/build-types/combobox-control/index.d.ts +1 -0
  275. package/build-types/combobox-control/index.d.ts.map +1 -1
  276. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  277. package/build-types/composite/typeahead.d.ts.map +1 -1
  278. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  279. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  280. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  281. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  282. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  283. package/build-types/dashicon/types.d.ts +1 -1
  284. package/build-types/dashicon/types.d.ts.map +1 -1
  285. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  286. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  287. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  288. package/build-types/dimension-control/index.d.ts +1 -0
  289. package/build-types/dimension-control/index.d.ts.map +1 -1
  290. package/build-types/disabled/index.d.ts +8 -1
  291. package/build-types/disabled/index.d.ts.map +1 -1
  292. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  293. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  294. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  295. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  296. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  297. package/build-types/external-link/stories/index.story.d.ts.map +1 -1
  298. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  299. package/build-types/font-size-picker/index.d.ts.map +1 -1
  300. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  301. package/build-types/form-file-upload/index.d.ts.map +1 -1
  302. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  303. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  304. package/build-types/form-token-field/token.d.ts.map +1 -1
  305. package/build-types/gradient-picker/index.d.ts +32 -32
  306. package/build-types/gradient-picker/index.d.ts.map +1 -1
  307. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  308. package/build-types/gradient-picker/types.d.ts +1 -5
  309. package/build-types/gradient-picker/types.d.ts.map +1 -1
  310. package/build-types/guide/page-control.d.ts.map +1 -1
  311. package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
  312. package/build-types/heading/stories/index.story.d.ts.map +1 -1
  313. package/build-types/icon/index.d.ts +23 -7
  314. package/build-types/icon/index.d.ts.map +1 -1
  315. package/build-types/icon/stories/index.story.d.ts +7 -1
  316. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  317. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  318. package/build-types/lock-unlock.d.ts +2 -2
  319. package/build-types/menu/stories/index.story.d.ts.map +1 -1
  320. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  321. package/build-types/menu-item/index.d.ts.map +1 -1
  322. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  323. package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
  324. package/build-types/modal/stories/index.story.d.ts.map +1 -1
  325. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  326. package/build-types/notice/index.d.ts.map +1 -1
  327. package/build-types/notice/stories/index.story.d.ts.map +1 -1
  328. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  329. package/build-types/palette-edit/index.d.ts.map +1 -1
  330. package/build-types/panel/body.d.ts.map +1 -1
  331. package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
  332. package/build-types/popover/index.d.ts.map +1 -1
  333. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  334. package/build-types/private-apis.d.ts.map +1 -1
  335. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  336. package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
  337. package/build-types/radio-group/radio.d.ts +4 -2
  338. package/build-types/radio-group/radio.d.ts.map +1 -1
  339. package/build-types/radio-group/stories/index.story.d.ts.map +1 -1
  340. package/build-types/radio-group/types.d.ts +5 -1
  341. package/build-types/radio-group/types.d.ts.map +1 -1
  342. package/build-types/range-control/index.d.ts +3 -1
  343. package/build-types/range-control/index.d.ts.map +1 -1
  344. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  345. package/build-types/range-control/types.d.ts +7 -0
  346. package/build-types/range-control/types.d.ts.map +1 -1
  347. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  348. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  349. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  350. package/build-types/slot-fill/bubbles-virtually/fill.d.ts +1 -1
  351. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  352. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  353. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  354. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
  355. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
  356. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts +3 -7
  357. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  358. package/build-types/slot-fill/fill.d.ts.map +1 -1
  359. package/build-types/slot-fill/index.d.ts +5 -12
  360. package/build-types/slot-fill/index.d.ts.map +1 -1
  361. package/build-types/slot-fill/provider.d.ts.map +1 -1
  362. package/build-types/slot-fill/slot.d.ts +1 -1
  363. package/build-types/slot-fill/slot.d.ts.map +1 -1
  364. package/build-types/slot-fill/types.d.ts +15 -18
  365. package/build-types/slot-fill/types.d.ts.map +1 -1
  366. package/build-types/slot-fill/use-slot.d.ts +1 -1
  367. package/build-types/slot-fill/use-slot.d.ts.map +1 -1
  368. package/build-types/snackbar/index.d.ts.map +1 -1
  369. package/build-types/snackbar/stories/index.story.d.ts.map +1 -1
  370. package/build-types/snackbar/stories/list.story.d.ts.map +1 -1
  371. package/build-types/spinner/stories/index.story.d.ts.map +1 -1
  372. package/build-types/tabs/tablist.d.ts.map +1 -1
  373. package/build-types/text/stories/index.story.d.ts.map +1 -1
  374. package/build-types/text-control/index.d.ts +1 -0
  375. package/build-types/text-control/index.d.ts.map +1 -1
  376. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  377. package/build-types/text-highlight/stories/index.story.d.ts.map +1 -1
  378. package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
  379. package/build-types/tip/stories/index.story.d.ts.map +1 -1
  380. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  381. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  382. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +2 -0
  383. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  384. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -0
  385. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  386. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  387. package/build-types/toggle-group-control/types.d.ts +7 -0
  388. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  389. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  390. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  391. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  392. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  393. package/build-types/truncate/stories/index.story.d.ts.map +1 -1
  394. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  395. package/build-types/utils/deprecated-36px-size.d.ts +3 -2
  396. package/build-types/utils/deprecated-36px-size.d.ts.map +1 -1
  397. package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
  398. package/package.json +4 -4
  399. package/src/autocomplete/autocompleter-ui.tsx +1 -0
  400. package/src/base-control/stories/index.story.tsx +2 -1
  401. package/src/border-box-control/border-box-control/component.tsx +1 -0
  402. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -0
  403. package/src/border-control/border-control/component.tsx +1 -0
  404. package/src/border-control/border-control/hook.ts +2 -0
  405. package/src/border-control/border-control-dropdown/component.tsx +1 -1
  406. package/src/border-control/types.ts +7 -0
  407. package/src/box-control/README.md +79 -60
  408. package/src/box-control/all-input-control.tsx +1 -0
  409. package/src/box-control/axial-input-controls.tsx +1 -0
  410. package/src/box-control/docs-manifest.json +5 -0
  411. package/src/box-control/index.tsx +13 -13
  412. package/src/box-control/input-controls.tsx +1 -0
  413. package/src/box-control/types.ts +2 -0
  414. package/src/checkbox-control/stories/index.story.tsx +2 -1
  415. package/src/circular-option-picker/circular-option-picker-actions.tsx +1 -0
  416. package/src/circular-option-picker/circular-option-picker-option.tsx +1 -0
  417. package/src/circular-option-picker/stories/index.story.tsx +2 -1
  418. package/src/circular-option-picker/style.scss +2 -2
  419. package/src/color-indicator/stories/index.story.tsx +2 -1
  420. package/src/color-palette/index.tsx +5 -1
  421. package/src/color-palette/stories/index.story.tsx +2 -1
  422. package/src/color-picker/color-copy-button.tsx +8 -10
  423. package/src/color-picker/component.tsx +1 -0
  424. package/src/color-picker/stories/index.story.tsx +2 -1
  425. package/src/color-picker/styles.ts +0 -13
  426. package/src/combobox-control/README.md +1 -0
  427. package/src/combobox-control/index.tsx +19 -13
  428. package/src/combobox-control/stories/index.story.tsx +3 -1
  429. package/src/combobox-control/style.scss +0 -6
  430. package/src/combobox-control/test/index.tsx +7 -1
  431. package/src/composite/hover.tsx +1 -1
  432. package/src/composite/typeahead.tsx +3 -1
  433. package/src/confirm-dialog/stories/index.story.tsx +2 -1
  434. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +2 -0
  435. package/src/custom-gradient-picker/stories/index.story.tsx +2 -1
  436. package/src/custom-gradient-picker/style.scss +1 -1
  437. package/src/custom-select-control/stories/index.story.tsx +2 -1
  438. package/src/custom-select-control-v2/stories/index.story.tsx +2 -1
  439. package/src/dashicon/types.ts +0 -2
  440. package/src/date-time/stories/date-time.story.tsx +2 -1
  441. package/src/date-time/stories/date.story.tsx +2 -1
  442. package/src/date-time/stories/time.story.tsx +2 -1
  443. package/src/dimension-control/README.md +1 -0
  444. package/src/dimension-control/index.tsx +8 -0
  445. package/src/dimension-control/stories/index.story.tsx +1 -0
  446. package/src/dimension-control/test/__snapshots__/index.test.js.snap +24 -24
  447. package/src/dimension-control/test/index.test.js +7 -1
  448. package/src/disabled/README.md +9 -7
  449. package/src/disabled/index.tsx +8 -1
  450. package/src/disabled/stories/index.story.tsx +1 -0
  451. package/src/drop-zone/stories/index.story.tsx +2 -1
  452. package/src/dropdown/stories/index.story.tsx +2 -1
  453. package/src/dropdown-menu/stories/index.story.tsx +2 -1
  454. package/src/duotone-picker/duotone-picker.tsx +2 -0
  455. package/src/external-link/stories/index.story.tsx +2 -1
  456. package/src/font-size-picker/README.md +1 -0
  457. package/src/font-size-picker/font-size-picker-toggle-group.tsx +1 -0
  458. package/src/font-size-picker/index.tsx +8 -0
  459. package/src/font-size-picker/stories/index.story.tsx +1 -0
  460. package/src/font-size-picker/test/index.tsx +5 -1
  461. package/src/form-file-upload/index.tsx +13 -1
  462. package/src/form-file-upload/stories/index.story.tsx +2 -1
  463. package/src/form-token-field/stories/index.story.tsx +2 -1
  464. package/src/form-token-field/style.scss +8 -12
  465. package/src/form-token-field/token.tsx +1 -0
  466. package/src/gradient-picker/README.md +107 -69
  467. package/src/gradient-picker/docs-manifest.json +5 -0
  468. package/src/gradient-picker/index.tsx +34 -32
  469. package/src/gradient-picker/stories/index.story.tsx +2 -1
  470. package/src/gradient-picker/types.ts +3 -5
  471. package/src/guide/page-control.tsx +1 -0
  472. package/src/guide/style.scss +4 -6
  473. package/src/h-stack/stories/index.story.tsx +2 -1
  474. package/src/heading/stories/index.story.tsx +2 -1
  475. package/src/higher-order/with-constrained-tabbing/README.md +13 -3
  476. package/src/higher-order/with-focus-return/README.md +9 -2
  477. package/src/icon/README.md +22 -65
  478. package/src/icon/docs-manifest.json +5 -0
  479. package/src/icon/index.tsx +28 -13
  480. package/src/icon/stories/index.story.tsx +50 -8
  481. package/src/input-control/stories/index.story.tsx +2 -1
  482. package/src/menu/stories/index.story.tsx +2 -1
  483. package/src/menu/styles.ts +1 -1
  484. package/src/menu-group/stories/index.story.tsx +2 -1
  485. package/src/menu-item/index.tsx +1 -0
  486. package/src/menu-item/stories/index.story.tsx +2 -1
  487. package/src/menu-item/test/__snapshots__/index.js.snap +4 -4
  488. package/src/menu-items-choice/stories/index.story.tsx +2 -1
  489. package/src/modal/index.tsx +2 -2
  490. package/src/modal/stories/index.story.tsx +3 -2
  491. package/src/navigator/stories/index.story.tsx +2 -1
  492. package/src/notice/index.tsx +2 -0
  493. package/src/notice/stories/index.story.tsx +7 -2
  494. package/src/notice/test/__snapshots__/index.tsx.snap +4 -4
  495. package/src/number-control/stories/index.story.tsx +2 -1
  496. package/src/palette-edit/index.tsx +5 -0
  497. package/src/panel/body.tsx +1 -0
  498. package/src/placeholder/stories/index.story.tsx +1 -0
  499. package/src/popover/index.tsx +3 -0
  500. package/src/popover/stories/index.story.tsx +2 -1
  501. package/src/private-apis.ts +0 -2
  502. package/src/progress-bar/stories/index.story.tsx +2 -1
  503. package/src/radio-control/stories/index.story.tsx +2 -1
  504. package/src/radio-group/README.md +8 -8
  505. package/src/radio-group/radio.tsx +7 -0
  506. package/src/radio-group/stories/index.story.tsx +16 -4
  507. package/src/radio-group/types.ts +6 -1
  508. package/src/range-control/README.md +4 -3
  509. package/src/range-control/index.tsx +11 -0
  510. package/src/range-control/stories/index.story.tsx +9 -1
  511. package/src/range-control/test/index.tsx +7 -1
  512. package/src/range-control/types.ts +7 -0
  513. package/src/responsive-wrapper/stories/index.story.tsx +2 -1
  514. package/src/search-control/stories/index.story.tsx +2 -1
  515. package/src/select-control/stories/index.story.tsx +2 -1
  516. package/src/slot-fill/README.md +26 -15
  517. package/src/slot-fill/bubbles-virtually/fill.tsx +18 -28
  518. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +26 -16
  519. package/src/slot-fill/bubbles-virtually/slot.tsx +13 -9
  520. package/src/slot-fill/bubbles-virtually/use-slot.ts +3 -26
  521. package/src/slot-fill/fill.ts +7 -22
  522. package/src/slot-fill/index.tsx +5 -7
  523. package/src/slot-fill/provider.tsx +8 -17
  524. package/src/slot-fill/slot.tsx +48 -85
  525. package/src/slot-fill/types.ts +14 -51
  526. package/src/snackbar/index.tsx +2 -1
  527. package/src/snackbar/stories/index.story.tsx +2 -1
  528. package/src/snackbar/stories/list.story.tsx +2 -1
  529. package/src/snackbar/style.scss +7 -16
  530. package/src/spinner/stories/index.story.tsx +2 -1
  531. package/src/tabs/tablist.tsx +13 -2
  532. package/src/text/stories/index.story.tsx +2 -1
  533. package/src/text-control/README.md +1 -0
  534. package/src/text-control/index.tsx +8 -0
  535. package/src/text-control/stories/index.story.tsx +3 -1
  536. package/src/text-control/test/text-control.tsx +7 -1
  537. package/src/text-highlight/stories/index.story.tsx +2 -1
  538. package/src/textarea-control/stories/index.story.tsx +2 -1
  539. package/src/tip/stories/index.story.tsx +2 -1
  540. package/src/toggle-control/stories/index.story.tsx +2 -1
  541. package/src/toggle-group-control/stories/index.story.tsx +3 -1
  542. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +12 -12
  543. package/src/toggle-group-control/test/index.tsx +7 -1
  544. package/src/toggle-group-control/toggle-group-control/README.md +2 -1
  545. package/src/toggle-group-control/toggle-group-control/component.tsx +11 -1
  546. package/src/toggle-group-control/toggle-group-control-option/README.md +1 -1
  547. package/src/toggle-group-control/toggle-group-control-option/component.tsx +1 -0
  548. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +1 -1
  549. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -1
  550. package/src/toggle-group-control/types.ts +7 -0
  551. package/src/tools-panel/stories/index.story.tsx +3 -0
  552. package/src/tooltip/stories/index.story.tsx +2 -1
  553. package/src/tree-grid/stories/index.story.tsx +2 -1
  554. package/src/tree-select/stories/index.story.tsx +2 -1
  555. package/src/truncate/stories/index.story.tsx +2 -1
  556. package/src/unit-control/stories/index.story.tsx +2 -1
  557. package/src/utils/deprecated-36px-size.ts +8 -2
  558. package/src/v-stack/stories/index.story.tsx +2 -1
  559. package/src/visually-hidden/stories/index.story.tsx +1 -1
  560. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_borderControlStylePicker","_interopRequireDefault","_button","_colorIndicator","_colorPalette","_dropdown","_vStack","_context","_hook","_dropdownContentWrapper","_utils","_jsxRuntime","getAriaLabelColorValue","colorValue","replace","getColorObject","colors","isMultiplePaletteArray","matchedColor","some","origin","color","find","getToggleAriaLabel","colorObject","style","isStyleEnabled","ariaLabelValue","sprintf","__","name","BorderControlDropdown","props","forwardedRef","__experimentalIsRenderedInSidebar","border","disableCustomColors","enableAlpha","enableStyle","indicatorClassName","indicatorWrapperClassName","isStyleSettable","onReset","onColorChange","onStyleChange","popoverContentClassName","popoverControlsClassName","resetButtonClassName","size","__unstablePopoverProps","otherProps","useBorderControlDropdown","toggleAriaLabel","showResetButton","dropdownPosition","undefined","renderToggle","onToggle","jsx","default","onClick","variant","tooltipPosition","label","showTooltip","__next40pxDefaultSize","children","className","renderContent","onClose","jsxs","Fragment","paddingSize","VStack","spacing","value","onChange","clearable","popoverProps","ref","ConnectedBorderControlDropdown","contextConnect","_default","exports"],"sources":["@wordpress/components/src/border-control/border-control-dropdown/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BorderControlStylePicker from '../border-control-style-picker';\nimport Button from '../../button';\nimport ColorIndicator from '../../color-indicator';\nimport ColorPalette from '../../color-palette';\nimport Dropdown from '../../dropdown';\nimport { VStack } from '../../v-stack';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderControlDropdown } from './hook';\nimport DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';\n\nimport type { ColorObject } from '../../color-palette/types';\nimport { isMultiplePaletteArray } from '../../color-palette/utils';\nimport type { DropdownProps as DropdownComponentProps } from '../../dropdown/types';\nimport type { ColorProps, DropdownProps } from '../types';\n\nconst getAriaLabelColorValue = ( colorValue: string ) => {\n\t// Leave hex values as-is. Remove the `var()` wrapper from CSS vars.\n\treturn colorValue.replace( /^var\\((.+)\\)$/, '$1' );\n};\n\nconst getColorObject = (\n\tcolorValue: CSSProperties[ 'borderColor' ],\n\tcolors: ColorProps[ 'colors' ] | undefined\n) => {\n\tif ( ! colorValue || ! colors ) {\n\t\treturn;\n\t}\n\n\tif ( isMultiplePaletteArray( colors ) ) {\n\t\t// Multiple origins\n\t\tlet matchedColor;\n\n\t\tcolors.some( ( origin ) =>\n\t\t\torigin.colors.some( ( color ) => {\n\t\t\t\tif ( color.color === colorValue ) {\n\t\t\t\t\tmatchedColor = color;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t} )\n\t\t);\n\n\t\treturn matchedColor;\n\t}\n\n\t// Single origin\n\treturn colors.find( ( color ) => color.color === colorValue );\n};\n\nconst getToggleAriaLabel = (\n\tcolorValue: CSSProperties[ 'borderColor' ],\n\tcolorObject: ColorObject | undefined,\n\tstyle: CSSProperties[ 'borderStyle' ],\n\tisStyleEnabled: boolean\n) => {\n\tif ( isStyleEnabled ) {\n\t\tif ( colorObject ) {\n\t\t\tconst ariaLabelValue = getAriaLabelColorValue( colorObject.color );\n\t\t\treturn style\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: 1: The name of the color e.g. \"vivid red\". 2: The color's hex code e.g.: \"#f00:\". 3: The current border style selection e.g. \"solid\".\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Border color and style picker. The currently selected color is called \"%1$s\" and has a value of \"%2$s\". The currently selected style is \"%3$s\".'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcolorObject.name,\n\t\t\t\t\t\tariaLabelValue,\n\t\t\t\t\t\tstyle\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t// translators: 1: The name of the color e.g. \"vivid red\". 2: The color's hex code e.g.: \"#f00:\".\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Border color and style picker. The currently selected color is called \"%1$s\" and has a value of \"%2$s\".'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcolorObject.name,\n\t\t\t\t\t\tariaLabelValue\n\t\t\t\t );\n\t\t}\n\n\t\tif ( colorValue ) {\n\t\t\tconst ariaLabelValue = getAriaLabelColorValue( colorValue );\n\t\t\treturn style\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: 1: The color's hex code e.g.: \"#f00:\". 2: The current border style selection e.g. \"solid\".\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Border color and style picker. The currently selected color has a value of \"%1$s\". The currently selected style is \"%2$s\".'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tariaLabelValue,\n\t\t\t\t\t\tstyle\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t// translators: %s: The color's hex code e.g: \"#f00\".\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Border color and style picker. The currently selected color has a value of \"%s\".'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tariaLabelValue\n\t\t\t\t );\n\t\t}\n\n\t\treturn __( 'Border color and style picker.' );\n\t}\n\n\tif ( colorObject ) {\n\t\treturn sprintf(\n\t\t\t// translators: 1: The name of the color e.g. \"vivid red\". 2: The color's hex code e.g: \"#f00\".\n\t\t\t__(\n\t\t\t\t'Border color picker. The currently selected color is called \"%1$s\" and has a value of \"%2$s\".'\n\t\t\t),\n\t\t\tcolorObject.name,\n\t\t\tgetAriaLabelColorValue( colorObject.color )\n\t\t);\n\t}\n\n\tif ( colorValue ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: The color's hex code e.g: \"#f00\".\n\t\t\t__(\n\t\t\t\t'Border color picker. The currently selected color has a value of \"%s\".'\n\t\t\t),\n\t\t\tgetAriaLabelColorValue( colorValue )\n\t\t);\n\t}\n\n\treturn __( 'Border color picker.' );\n};\n\nconst BorderControlDropdown = (\n\tprops: WordPressComponentProps< DropdownProps, 'div' >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\t__experimentalIsRenderedInSidebar,\n\t\tborder,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tindicatorClassName,\n\t\tindicatorWrapperClassName,\n\t\tisStyleSettable,\n\t\tonReset,\n\t\tonColorChange,\n\t\tonStyleChange,\n\t\tpopoverContentClassName,\n\t\tpopoverControlsClassName,\n\t\tresetButtonClassName,\n\t\tsize,\n\t\t__unstablePopoverProps,\n\t\t...otherProps\n\t} = useBorderControlDropdown( props );\n\n\tconst { color, style } = border || {};\n\tconst colorObject = getColorObject( color, colors );\n\n\tconst toggleAriaLabel = getToggleAriaLabel(\n\t\tcolor,\n\t\tcolorObject,\n\t\tstyle,\n\t\tenableStyle\n\t);\n\n\tconst showResetButton = color || ( style && style !== 'none' );\n\tconst dropdownPosition = __experimentalIsRenderedInSidebar\n\t\t? 'bottom left'\n\t\t: undefined;\n\n\tconst renderToggle: DropdownComponentProps[ 'renderToggle' ] = ( {\n\t\tonToggle,\n\t} ) => (\n\t\t<Button\n\t\t\tonClick={ onToggle }\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-label={ toggleAriaLabel }\n\t\t\ttooltipPosition={ dropdownPosition }\n\t\t\tlabel={ __( 'Border color and style picker' ) }\n\t\t\tshowTooltip\n\t\t\t__next40pxDefaultSize={ size === '__unstable-large' ? true : false }\n\t\t>\n\t\t\t<span className={ indicatorWrapperClassName }>\n\t\t\t\t<ColorIndicator\n\t\t\t\t\tclassName={ indicatorClassName }\n\t\t\t\t\tcolorValue={ color }\n\t\t\t\t/>\n\t\t\t</span>\n\t\t</Button>\n\t);\n\n\tconst renderContent: DropdownComponentProps[ 'renderContent' ] = ( {\n\t\tonClose,\n\t} ) => (\n\t\t<>\n\t\t\t<DropdownContentWrapper paddingSize=\"medium\">\n\t\t\t\t<VStack className={ popoverControlsClassName } spacing={ 6 }>\n\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\tclassName={ popoverContentClassName }\n\t\t\t\t\t\tvalue={ color }\n\t\t\t\t\t\tonChange={ onColorChange }\n\t\t\t\t\t\t{ ...{ colors, disableCustomColors } }\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t/>\n\t\t\t\t\t{ enableStyle && isStyleSettable && (\n\t\t\t\t\t\t<BorderControlStylePicker\n\t\t\t\t\t\t\tlabel={ __( 'Style' ) }\n\t\t\t\t\t\t\tvalue={ style }\n\t\t\t\t\t\t\tonChange={ onStyleChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t</DropdownContentWrapper>\n\t\t\t{ showResetButton && (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName={ resetButtonClassName }\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\trenderToggle={ renderToggle }\n\t\t\trenderContent={ renderContent }\n\t\t\tpopoverProps={ {\n\t\t\t\t...__unstablePopoverProps,\n\t\t\t} }\n\t\t\t{ ...otherProps }\n\t\t\tref={ forwardedRef }\n\t\t/>\n\t);\n};\n\nconst ConnectedBorderControlDropdown = contextConnect(\n\tBorderControlDropdown,\n\t'BorderControlDropdown'\n);\n\nexport default ConnectedBorderControlDropdown;\n"],"mappings":";;;;;;;AAQA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,yBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,eAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,aAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,SAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAEA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,uBAAA,GAAAR,sBAAA,CAAAF,OAAA;AAGA,IAAAW,MAAA,GAAAX,OAAA;AAAmE,IAAAY,WAAA,GAAAZ,OAAA;AAzBnE;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAiBA,MAAMa,sBAAsB,GAAKC,UAAkB,IAAM;EACxD;EACA,OAAOA,UAAU,CAACC,OAA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,KAAO;UACnBxC,WAAW,EAAGA;QAAa,CAC3B,CAAC,EACAC,WAAW,IAAIG,eAAe,iBAC/B,IAAA9B,WAAA,CAAA+C,GAAA,EAAC1D,yBAAA,CAAA2D,OAAwB;UACxBI,KAAK,EAAG,IAAAlC,QAAE,EAAE,OAAQ,CAAG;UACvB8C,KAAK,EAAGlD,KAAO;UACfmD,QAAQ,EAAGhC;QAAe,CAC1B,CACD;MAAA,CACM;IAAC,CACc,CAAC,EACvBS,eAAe,iBAChB,IAAA1C,WAAA,CAAA+C,GAAA,EAACjD,uBAAA,CAAAkD,OAAsB;MAACa,WAAW,EAAC,MAAM;MAAAN,QAAA,eACzC,IAAAvD,WAAA,CAAA+C,GAAA,EAACxD,OAAA,CAAAyD,OAAM;QACNQ,SAAS,EAAGpB,oBAAsB;QAClCc,OAAO,EAAC,UAAU;QAClBD,OAAO,EAAGA,CAAA,KAAM;UACflB,OAAO,CAAC,CAAC;UACT2B,OAAO,CAAC,CAAC;QACV,CAAG;QACHJ,qBAAqB;QAAAC,QAAA,EAEnB,IAAArC,QAAE,EAAE,OAAQ;MAAC,CACR;IAAC,CACc,CACxB;EAAA,CACA,CACF;EAED,oBACC,IAAAlB,WAAA,CAAA+C,GAAA,EAACrD,SAAA,CAAAsD,OAAQ;IACRH,YAAY,EAAGA,YAAc;IAC7BY,aAAa,EAAGA,aAAe;IAC/BU,YAAY,EAAG;MACd,GAAG7B;IACJ,CAAG;IAAA,GACEC,UAAU;IACf6B,GAAG,EAAG9C;EAAc,CACpB,CAAC;AAEJ,CAAC;AAED,MAAM+C,8BAA8B,GAAG,IAAAC,uBAAc,EACpDlD,qBAAqB,EACrB,uBACD,CAAC;AAAC,IAAAmD,QAAA,GAAAC,OAAA,CAAAxB,OAAA,GAEaqB,8BAA8B","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_borderControlStylePicker","_interopRequireDefault","_button","_colorIndicator","_colorPalette","_dropdown","_vStack","_context","_hook","_dropdownContentWrapper","_utils","_jsxRuntime","getAriaLabelColorValue","colorValue","replace","getColorObject","colors","isMultiplePaletteArray","matchedColor","some","origin","color","find","getToggleAriaLabel","colorObject","style","isStyleEnabled","ariaLabelValue","sprintf","__","name","BorderControlDropdown","props","forwardedRef","__experimentalIsRenderedInSidebar","border","disableCustomColors","enableAlpha","enableStyle","indicatorClassName","indicatorWrapperClassName","isStyleSettable","onReset","onColorChange","onStyleChange","popoverContentClassName","popoverControlsClassName","resetButtonClassName","size","__unstablePopoverProps","otherProps","useBorderControlDropdown","toggleAriaLabel","showResetButton","dropdownPosition","undefined","renderToggle","onToggle","jsx","default","onClick","variant","tooltipPosition","label","showTooltip","__next40pxDefaultSize","children","className","renderContent","onClose","jsxs","Fragment","paddingSize","VStack","spacing","value","onChange","clearable","popoverProps","ref","ConnectedBorderControlDropdown","contextConnect","_default","exports"],"sources":["@wordpress/components/src/border-control/border-control-dropdown/component.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BorderControlStylePicker from '../border-control-style-picker';\nimport Button from '../../button';\nimport ColorIndicator from '../../color-indicator';\nimport ColorPalette from '../../color-palette';\nimport Dropdown from '../../dropdown';\nimport { VStack } from '../../v-stack';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderControlDropdown } from './hook';\nimport DropdownContentWrapper from '../../dropdown/dropdown-content-wrapper';\n\nimport type { ColorObject } from '../../color-palette/types';\nimport { isMultiplePaletteArray } from '../../color-palette/utils';\nimport type { DropdownProps as DropdownComponentProps } from '../../dropdown/types';\nimport type { ColorProps, DropdownProps } from '../types';\n\nconst getAriaLabelColorValue = ( colorValue: string ) => {\n\t// Leave hex values as-is. Remove the `var()` wrapper from CSS vars.\n\treturn colorValue.replace( /^var\\((.+)\\)$/, '$1' );\n};\n\nconst getColorObject = (\n\tcolorValue: CSSProperties[ 'borderColor' ],\n\tcolors: ColorProps[ 'colors' ] | undefined\n) => {\n\tif ( ! colorValue || ! colors ) {\n\t\treturn;\n\t}\n\n\tif ( isMultiplePaletteArray( colors ) ) {\n\t\t// Multiple origins\n\t\tlet matchedColor;\n\n\t\tcolors.some( ( origin ) =>\n\t\t\torigin.colors.some( ( color ) => {\n\t\t\t\tif ( color.color === colorValue ) {\n\t\t\t\t\tmatchedColor = color;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t} )\n\t\t);\n\n\t\treturn matchedColor;\n\t}\n\n\t// Single origin\n\treturn colors.find( ( color ) => color.color === colorValue );\n};\n\nconst getToggleAriaLabel = (\n\tcolorValue: CSSProperties[ 'borderColor' ],\n\tcolorObject: ColorObject | undefined,\n\tstyle: CSSProperties[ 'borderStyle' ],\n\tisStyleEnabled: boolean\n) => {\n\tif ( isStyleEnabled ) {\n\t\tif ( colorObject ) {\n\t\t\tconst ariaLabelValue = getAriaLabelColorValue( colorObject.color );\n\t\t\treturn style\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: 1: The name of the color e.g. \"vivid red\". 2: The color's hex code e.g.: \"#f00:\". 3: The current border style selection e.g. \"solid\".\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Border color and style picker. The currently selected color is called \"%1$s\" and has a value of \"%2$s\". The currently selected style is \"%3$s\".'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcolorObject.name,\n\t\t\t\t\t\tariaLabelValue,\n\t\t\t\t\t\tstyle\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t// translators: 1: The name of the color e.g. \"vivid red\". 2: The color's hex code e.g.: \"#f00:\".\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Border color and style picker. The currently selected color is called \"%1$s\" and has a value of \"%2$s\".'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcolorObject.name,\n\t\t\t\t\t\tariaLabelValue\n\t\t\t\t );\n\t\t}\n\n\t\tif ( colorValue ) {\n\t\t\tconst ariaLabelValue = getAriaLabelColorValue( colorValue );\n\t\t\treturn style\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: 1: The color's hex code e.g.: \"#f00:\". 2: The current border style selection e.g. \"solid\".\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Border color and style picker. The currently selected color has a value of \"%1$s\". The currently selected style is \"%2$s\".'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tariaLabelValue,\n\t\t\t\t\t\tstyle\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t// translators: %s: The color's hex code e.g: \"#f00\".\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Border color and style picker. The currently selected color has a value of \"%s\".'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tariaLabelValue\n\t\t\t\t );\n\t\t}\n\n\t\treturn __( 'Border color and style picker.' );\n\t}\n\n\tif ( colorObject ) {\n\t\treturn sprintf(\n\t\t\t// translators: 1: The name of the color e.g. \"vivid red\". 2: The color's hex code e.g: \"#f00\".\n\t\t\t__(\n\t\t\t\t'Border color picker. The currently selected color is called \"%1$s\" and has a value of \"%2$s\".'\n\t\t\t),\n\t\t\tcolorObject.name,\n\t\t\tgetAriaLabelColorValue( colorObject.color )\n\t\t);\n\t}\n\n\tif ( colorValue ) {\n\t\treturn sprintf(\n\t\t\t// translators: %s: The color's hex code e.g: \"#f00\".\n\t\t\t__(\n\t\t\t\t'Border color picker. The currently selected color has a value of \"%s\".'\n\t\t\t),\n\t\t\tgetAriaLabelColorValue( colorValue )\n\t\t);\n\t}\n\n\treturn __( 'Border color picker.' );\n};\n\nconst BorderControlDropdown = (\n\tprops: WordPressComponentProps< DropdownProps, 'div' >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\t__experimentalIsRenderedInSidebar,\n\t\tborder,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tindicatorClassName,\n\t\tindicatorWrapperClassName,\n\t\tisStyleSettable,\n\t\tonReset,\n\t\tonColorChange,\n\t\tonStyleChange,\n\t\tpopoverContentClassName,\n\t\tpopoverControlsClassName,\n\t\tresetButtonClassName,\n\t\tsize,\n\t\t__unstablePopoverProps,\n\t\t...otherProps\n\t} = useBorderControlDropdown( props );\n\n\tconst { color, style } = border || {};\n\tconst colorObject = getColorObject( color, colors );\n\n\tconst toggleAriaLabel = getToggleAriaLabel(\n\t\tcolor,\n\t\tcolorObject,\n\t\tstyle,\n\t\tenableStyle\n\t);\n\n\tconst showResetButton = color || ( style && style !== 'none' );\n\tconst dropdownPosition = __experimentalIsRenderedInSidebar\n\t\t? 'bottom left'\n\t\t: undefined;\n\n\tconst renderToggle: DropdownComponentProps[ 'renderToggle' ] = ( {\n\t\tonToggle,\n\t} ) => (\n\t\t<Button\n\t\t\tonClick={ onToggle }\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-label={ toggleAriaLabel }\n\t\t\ttooltipPosition={ dropdownPosition }\n\t\t\tlabel={ __( 'Border color and style picker' ) }\n\t\t\tshowTooltip\n\t\t\t__next40pxDefaultSize={ size === '__unstable-large' }\n\t\t>\n\t\t\t<span className={ indicatorWrapperClassName }>\n\t\t\t\t<ColorIndicator\n\t\t\t\t\tclassName={ indicatorClassName }\n\t\t\t\t\tcolorValue={ color }\n\t\t\t\t/>\n\t\t\t</span>\n\t\t</Button>\n\t);\n\n\tconst renderContent: DropdownComponentProps[ 'renderContent' ] = ( {\n\t\tonClose,\n\t} ) => (\n\t\t<>\n\t\t\t<DropdownContentWrapper paddingSize=\"medium\">\n\t\t\t\t<VStack className={ popoverControlsClassName } spacing={ 6 }>\n\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\tclassName={ popoverContentClassName }\n\t\t\t\t\t\tvalue={ color }\n\t\t\t\t\t\tonChange={ onColorChange }\n\t\t\t\t\t\t{ ...{ colors, disableCustomColors } }\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t/>\n\t\t\t\t\t{ enableStyle && isStyleSettable && (\n\t\t\t\t\t\t<BorderControlStylePicker\n\t\t\t\t\t\t\tlabel={ __( 'Style' ) }\n\t\t\t\t\t\t\tvalue={ style }\n\t\t\t\t\t\t\tonChange={ onStyleChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t</DropdownContentWrapper>\n\t\t\t{ showResetButton && (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName={ resetButtonClassName }\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonReset();\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\trenderToggle={ renderToggle }\n\t\t\trenderContent={ renderContent }\n\t\t\tpopoverProps={ {\n\t\t\t\t...__unstablePopoverProps,\n\t\t\t} }\n\t\t\t{ ...otherProps }\n\t\t\tref={ forwardedRef }\n\t\t/>\n\t);\n};\n\nconst ConnectedBorderControlDropdown = contextConnect(\n\tBorderControlDropdown,\n\t'BorderControlDropdown'\n);\n\nexport default ConnectedBorderControlDropdown;\n"],"mappings":";;;;;;;AAQA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,yBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,eAAA,GAA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YAAY,EAAGA,YAAc;IAC7BY,aAAa,EAAGA,aAAe;IAC/BU,YAAY,EAAG;MACd,GAAG7B;IACJ,CAAG;IAAA,GACEC,UAAU;IACf6B,GAAG,EAAG9C;EAAc,CACpB,CAAC;AAEJ,CAAC;AAED,MAAM+C,8BAA8B,GAAG,IAAAC,uBAAc,EACpDlD,qBAAqB,EACrB,uBACD,CAAC;AAAC,IAAAmD,QAAA,GAAAC,OAAA,CAAAxB,OAAA,GAEaqB,8BAA8B","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/border-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ColorPaletteProps } from '../color-palette/types';\nimport type { PopoverProps } from '../popover/types';\nimport type { ToggleGroupControlProps } from '../toggle-group-control/types';\n\nexport type Border = {\n\tcolor?: CSSProperties[ 'borderColor' ];\n\tstyle?: CSSProperties[ 'borderStyle' ];\n\twidth?: CSSProperties[ 'borderWidth' ];\n};\n\nexport type ColorProps = Pick<\n\tColorPaletteProps,\n\t'colors' | '__experimentalIsRenderedInSidebar'\n> & {\n\t/**\n\t * This toggles the ability to choose custom colors.\n\t */\n\tdisableCustomColors?: boolean;\n\t/**\n\t * This controls whether the alpha channel will be offered when selecting\n\t * custom colors.\n\t *\n\t * @default true\n\t */\n\tenableAlpha?: boolean;\n};\n\nexport type LabelProps = {\n\t/**\n\t * Provides control over whether the label will only be visible to\n\t * screen readers.\n\t */\n\thideLabelFromVision?: boolean;\n\t/**\n\t * If provided, a label will be generated using this as the content.\n\t */\n\tlabel?: string;\n};\n\nexport type BorderControlProps = ColorProps &\n\tLabelProps & {\n\t\t/**\n\t\t * This controls whether unit selection should be disabled.\n\t\t */\n\t\tdisableUnits?: boolean;\n\t\t/**\n\t\t * This controls whether to support border style selection.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tenableStyle?: boolean;\n\t\t/**\n\t\t * This flags the `BorderControl` to render with a more compact\n\t\t * appearance. It restricts the width of the control and prevents it\n\t\t * from expanding to take up additional space.\n\t\t */\n\t\tisCompact?: boolean;\n\t\t/**\n\t\t * A callback function invoked when the border value is changed via an\n\t\t * interaction that selects or clears, border color, style, or width.\n\t\t */\n\t\tonChange: ( value?: Border ) => void;\n\t\t/**\n\t\t * Placeholder text for the number input.\n\t\t */\n\t\tplaceholder?: HTMLInputElement[ 'placeholder' ];\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * If opted into, sanitizing the border means that if no width or color\n\t\t * have been selected, the border style is also cleared and `undefined`\n\t\t * is returned as the new border value.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tshouldSanitizeBorder?: boolean;\n\t\t/**\n\t\t * @deprecated This prop no longer has any effect.\n\t\t * @ignore\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t\t/**\n\t\t * Size of the control.\n\t\t *\n\t\t * @default 'default'\n\t\t */\n\t\tsize?: 'default' | '__unstable-large';\n\t\t/**\n\t\t * An object representing a border or `undefined`. Used to set the\n\t\t * current border configuration for this component.\n\t\t */\n\t\tvalue?: Border;\n\t\t/**\n\t\t * Controls the visual width of the `BorderControl`. It has no effect if\n\t\t * the `isCompact` prop is set to `true`.\n\t\t */\n\t\twidth?: CSSProperties[ 'width' ];\n\t\t/**\n\t\t * Flags whether this `BorderControl` should also render a\n\t\t * `RangeControl` for additional control over a border's width.\n\t\t */\n\t\twithSlider?: boolean;\n\t\t/**\n\t\t * Start opting into the larger default height that will become the default size in a future version.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\t__next40pxDefaultSize?: boolean;\n\t};\n\nexport type DropdownProps = ColorProps &\n\tPick< BorderControlProps, 'enableStyle' | 'size' > & {\n\t\t/**\n\t\t * An object representing a border or `undefined`. This component will\n\t\t * extract the border color and style selections from this object to use as\n\t\t * values for its popover controls.\n\t\t */\n\t\tborder?: Border;\n\t\t/**\n\t\t * Whether a border style can be set, based on the border sanitization settings.\n\t\t */\n\t\tisStyleSettable: boolean;\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * A callback invoked when the border color or style selections change.\n\t\t */\n\t\tonChange: ( newBorder?: Border ) => void;\n\t\t/**\n\t\t * Any previous style selection made by the user. This can be used to\n\t\t * reapply that previous selection when, for example, a zero border width is\n\t\t * to a non-zero value.\n\t\t */\n\t\tpreviousStyleSelection?: string;\n\t\t/**\n\t\t * @deprecated This prop no longer has any effect.\n\t\t * @ignore\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t};\n\nexport type StylePickerProps = Omit<\n\tToggleGroupControlProps,\n\t'value' | 'onChange' | 'children'\n> & {\n\t/**\n\t * A callback function invoked when a border style is selected or cleared.\n\t */\n\tonChange: ( style?: string ) => void;\n\t/**\n\t * The currently selected border style if there is one. Styles available via\n\t * this control are `solid`, `dashed` & `dotted`, however the possibility\n\t * to store other valid CSS values is maintained e.g. `none`, `inherit` etc.\n\t */\n\tvalue?: string;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/border-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ColorPaletteProps } from '../color-palette/types';\nimport type { PopoverProps } from '../popover/types';\nimport type { ToggleGroupControlProps } from '../toggle-group-control/types';\n\nexport type Border = {\n\tcolor?: CSSProperties[ 'borderColor' ];\n\tstyle?: CSSProperties[ 'borderStyle' ];\n\twidth?: CSSProperties[ 'borderWidth' ];\n};\n\nexport type ColorProps = Pick<\n\tColorPaletteProps,\n\t'colors' | '__experimentalIsRenderedInSidebar'\n> & {\n\t/**\n\t * This toggles the ability to choose custom colors.\n\t */\n\tdisableCustomColors?: boolean;\n\t/**\n\t * This controls whether the alpha channel will be offered when selecting\n\t * custom colors.\n\t *\n\t * @default true\n\t */\n\tenableAlpha?: boolean;\n};\n\nexport type LabelProps = {\n\t/**\n\t * Provides control over whether the label will only be visible to\n\t * screen readers.\n\t */\n\thideLabelFromVision?: boolean;\n\t/**\n\t * If provided, a label will be generated using this as the content.\n\t */\n\tlabel?: string;\n};\n\nexport type BorderControlProps = ColorProps &\n\tLabelProps & {\n\t\t/**\n\t\t * This controls whether unit selection should be disabled.\n\t\t */\n\t\tdisableUnits?: boolean;\n\t\t/**\n\t\t * This controls whether to support border style selection.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tenableStyle?: boolean;\n\t\t/**\n\t\t * This flags the `BorderControl` to render with a more compact\n\t\t * appearance. It restricts the width of the control and prevents it\n\t\t * from expanding to take up additional space.\n\t\t */\n\t\tisCompact?: boolean;\n\t\t/**\n\t\t * A callback function invoked when the border value is changed via an\n\t\t * interaction that selects or clears, border color, style, or width.\n\t\t */\n\t\tonChange: ( value?: Border ) => void;\n\t\t/**\n\t\t * Placeholder text for the number input.\n\t\t */\n\t\tplaceholder?: HTMLInputElement[ 'placeholder' ];\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * If opted into, sanitizing the border means that if no width or color\n\t\t * have been selected, the border style is also cleared and `undefined`\n\t\t * is returned as the new border value.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tshouldSanitizeBorder?: boolean;\n\t\t/**\n\t\t * @deprecated This prop no longer has any effect.\n\t\t * @ignore\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t\t/**\n\t\t * Size of the control.\n\t\t *\n\t\t * @default 'default'\n\t\t */\n\t\tsize?: 'default' | '__unstable-large';\n\t\t/**\n\t\t * An object representing a border or `undefined`. Used to set the\n\t\t * current border configuration for this component.\n\t\t */\n\t\tvalue?: Border;\n\t\t/**\n\t\t * Controls the visual width of the `BorderControl`. It has no effect if\n\t\t * the `isCompact` prop is set to `true`.\n\t\t */\n\t\twidth?: CSSProperties[ 'width' ];\n\t\t/**\n\t\t * Flags whether this `BorderControl` should also render a\n\t\t * `RangeControl` for additional control over a border's width.\n\t\t */\n\t\twithSlider?: boolean;\n\t\t/**\n\t\t * Start opting into the larger default height that will become the default size in a future version.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\t__next40pxDefaultSize?: boolean;\n\t\t/**\n\t\t * Do not throw a warning for the deprecated 36px default size.\n\t\t * For internal components of other components that already throw the warning.\n\t\t *\n\t\t * @ignore\n\t\t */\n\t\t__shouldNotWarnDeprecated36pxSize?: boolean;\n\t};\n\nexport type DropdownProps = ColorProps &\n\tPick< BorderControlProps, 'enableStyle' | 'size' > & {\n\t\t/**\n\t\t * An object representing a border or `undefined`. This component will\n\t\t * extract the border color and style selections from this object to use as\n\t\t * values for its popover controls.\n\t\t */\n\t\tborder?: Border;\n\t\t/**\n\t\t * Whether a border style can be set, based on the border sanitization settings.\n\t\t */\n\t\tisStyleSettable: boolean;\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * A callback invoked when the border color or style selections change.\n\t\t */\n\t\tonChange: ( newBorder?: Border ) => void;\n\t\t/**\n\t\t * Any previous style selection made by the user. This can be used to\n\t\t * reapply that previous selection when, for example, a zero border width is\n\t\t * to a non-zero value.\n\t\t */\n\t\tpreviousStyleSelection?: string;\n\t\t/**\n\t\t * @deprecated This prop no longer has any effect.\n\t\t * @ignore\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t};\n\nexport type StylePickerProps = Omit<\n\tToggleGroupControlProps,\n\t'value' | 'onChange' | 'children'\n> & {\n\t/**\n\t * A callback function invoked when a border style is selected or cleared.\n\t */\n\tonChange: ( style?: string ) => void;\n\t/**\n\t * The currently selected border style if there is one. Styles available via\n\t * this control are `solid`, `dashed` & `dotted`, however the possibility\n\t * to store other valid CSS values is maintained e.g. `none`, `inherit` etc.\n\t */\n\tvalue?: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -74,6 +74,7 @@ function AllInputControl({
74
74
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.FlexedRangeControl, {
75
75
  __nextHasNoMarginBottom: true,
76
76
  __next40pxDefaultSize: __next40pxDefaultSize,
77
+ __shouldNotWarnDeprecated36pxSize: true,
77
78
  "aria-controls": inputId,
78
79
  label: _utils.LABELS.all,
79
80
  hideLabelFromVision: true,
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_boxControlStyles","_unitControl","_utils","_jsxRuntime","noop","AllInputControl","__next40pxDefaultSize","onChange","onFocus","values","sides","selectedUnits","setSelectedUnits","props","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","inputId","useInstanceId","allValue","getAllValue","hasValues","isValuesDefined","isMixed","isValuesMixed","allPlaceholder","LABELS","mixed","undefined","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","handleOnFocus","event","side","onValueChange","next","isNumeric","isNaN","parseFloat","nextValue","nextValues","applyValueToSides","sliderOnChange","join","handleOnUnitChange","unit","newUnits","jsxs","Fragment","children","jsx","StyledUnitControl","className","disableUnits","id","isPressEnterToChange","value","onUnitChange","placeholder","label","all","hideLabelFromVision","FlexedRangeControl","__nextHasNoMarginBottom","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/all-input-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport type { UnitControlProps } from '../unit-control/types';\nimport {\n\tFlexedRangeControl,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps } from './types';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control';\nimport {\n\tLABELS,\n\tapplyValueToSides,\n\tgetAllValue,\n\tisValuesMixed,\n\tisValuesDefined,\n\tCUSTOM_VALUE_SETTINGS,\n} from './utils';\n\nconst noop = () => {};\n\nexport default function AllInputControl( {\n\t__next40pxDefaultSize,\n\tonChange = noop,\n\tonFocus = noop,\n\tvalues,\n\tsides,\n\tselectedUnits,\n\tsetSelectedUnits,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst inputId = useInstanceId( AllInputControl, 'box-control-input-all' );\n\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst hasValues = isValuesDefined( values );\n\tconst isMixed = hasValues && isValuesMixed( values, selectedUnits, sides );\n\tconst allPlaceholder = isMixed ? LABELS.mixed : undefined;\n\n\tconst [ parsedQuantity, parsedUnit ] =\n\t\tparseQuantityAndUnitFromRawValue( allValue );\n\n\tconst handleOnFocus: React.FocusEventHandler< HTMLInputElement > = (\n\t\tevent\n\t) => {\n\t\tonFocus( event, { side: 'all' } );\n\t};\n\n\tconst onValueChange = ( next?: string ) => {\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\t\tconst nextValues = applyValueToSides( values, nextValue, sides );\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst sliderOnChange = ( next?: number ) => {\n\t\tonValueChange(\n\t\t\tnext !== undefined ? [ next, parsedUnit ].join( '' ) : undefined\n\t\t);\n\t};\n\n\t// Set selected unit so it can be used as fallback by unlinked controls\n\t// when individual sides do not have a value containing a unit.\n\tconst handleOnUnitChange: UnitControlProps[ 'onUnitChange' ] = ( unit ) => {\n\t\tconst newUnits = applyValueToSides( selectedUnits, unit, sides );\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StyledUnitControl\n\t\t\t\t{ ...props }\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\tdisableUnits={ isMixed }\n\t\t\t\tid={ inputId }\n\t\t\t\tisPressEnterToChange\n\t\t\t\tvalue={ allValue }\n\t\t\t\tonChange={ onValueChange }\n\t\t\t\tonUnitChange={ handleOnUnitChange }\n\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\tplaceholder={ allPlaceholder }\n\t\t\t\tlabel={ LABELS.all }\n\t\t\t\thideLabelFromVision\n\t\t\t/>\n\n\t\t\t<FlexedRangeControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\taria-controls={ inputId }\n\t\t\t\tlabel={ LABELS.all }\n\t\t\t\thideLabelFromVision\n\t\t\t\tonChange={ sliderOnChange }\n\t\t\t\tmin={ 0 }\n\t\t\t\tmax={ CUSTOM_VALUE_SETTINGS[ parsedUnit ?? 'px' ]?.max ?? 10 }\n\t\t\t\tstep={\n\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ parsedUnit ?? 'px' ]?.step ?? 0.1\n\t\t\t\t}\n\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\twithInputField={ false }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAD,OAAA;AAKA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAOiB,IAAAI,WAAA,GAAAJ,OAAA;AArBjB;AACA;AACA;;AAEA;AACA;AACA;;AAiBA,MAAMK,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEN,SAASC,eAAeA,CAAE;EACxCC,qBAAqB;EACrBC,QAAQ,GAAGH,IAAI;EACfI,OAAO,GAAGJ,IAAI;EACdK,MAAM;EACNC,KAAK;EACLC,aAAa;EACbC,gBAAgB;EAChB,GAAGC;AACyB,CAAC,EAAG;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EAChC,MAAMC,OAAO,GAAG,IAAAC,sBAAa,EAAEZ,eAAe,EAAE,uBAAwB,CAAC;E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ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_boxControlStyles","_unitControl","_utils","_jsxRuntime","noop","AllInputControl","__next40pxDefaultSize","onChange","onFocus","values","sides","selectedUnits","setSelectedUnits","props","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","inputId","useInstanceId","allValue","getAllValue","hasValues","isValuesDefined","isMixed","isValuesMixed","allPlaceholder","LABELS","mixed","undefined","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","handleOnFocus","event","side","onValueChange","next","isNumeric","isNaN","parseFloat","nextValue","nextValues","applyValueToSides","sliderOnChange","join","handleOnUnitChange","unit","newUnits","jsxs","Fragment","children","jsx","StyledUnitControl","className","disableUnits","id","isPressEnterToChange","value","onUnitChange","placeholder","label","all","hideLabelFromVision","FlexedRangeControl","__nextHasNoMarginBottom","__shouldNotWarnDeprecated36pxSize","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/all-input-control.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport type { UnitControlProps } from '../unit-control/types';\nimport {\n\tFlexedRangeControl,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps } from './types';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control';\nimport {\n\tLABELS,\n\tapplyValueToSides,\n\tgetAllValue,\n\tisValuesMixed,\n\tisValuesDefined,\n\tCUSTOM_VALUE_SETTINGS,\n} from './utils';\n\nconst noop = () => {};\n\nexport default function AllInputControl( {\n\t__next40pxDefaultSize,\n\tonChange = noop,\n\tonFocus = noop,\n\tvalues,\n\tsides,\n\tselectedUnits,\n\tsetSelectedUnits,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst inputId = useInstanceId( AllInputControl, 'box-control-input-all' );\n\n\tconst allValue = getAllValue( values, selectedUnits, sides );\n\tconst hasValues = isValuesDefined( values );\n\tconst isMixed = hasValues && isValuesMixed( values, selectedUnits, sides );\n\tconst allPlaceholder = isMixed ? LABELS.mixed : undefined;\n\n\tconst [ parsedQuantity, parsedUnit ] =\n\t\tparseQuantityAndUnitFromRawValue( allValue );\n\n\tconst handleOnFocus: React.FocusEventHandler< HTMLInputElement > = (\n\t\tevent\n\t) => {\n\t\tonFocus( event, { side: 'all' } );\n\t};\n\n\tconst onValueChange = ( next?: string ) => {\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\t\tconst nextValues = applyValueToSides( values, nextValue, sides );\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst sliderOnChange = ( next?: number ) => {\n\t\tonValueChange(\n\t\t\tnext !== undefined ? [ next, parsedUnit ].join( '' ) : undefined\n\t\t);\n\t};\n\n\t// Set selected unit so it can be used as fallback by unlinked controls\n\t// when individual sides do not have a value containing a unit.\n\tconst handleOnUnitChange: UnitControlProps[ 'onUnitChange' ] = ( unit ) => {\n\t\tconst newUnits = applyValueToSides( selectedUnits, unit, sides );\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<StyledUnitControl\n\t\t\t\t{ ...props }\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\tdisableUnits={ isMixed }\n\t\t\t\tid={ inputId }\n\t\t\t\tisPressEnterToChange\n\t\t\t\tvalue={ allValue }\n\t\t\t\tonChange={ onValueChange }\n\t\t\t\tonUnitChange={ handleOnUnitChange }\n\t\t\t\tonFocus={ handleOnFocus }\n\t\t\t\tplaceholder={ allPlaceholder }\n\t\t\t\tlabel={ LABELS.all }\n\t\t\t\thideLabelFromVision\n\t\t\t/>\n\n\t\t\t<FlexedRangeControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\taria-controls={ inputId }\n\t\t\t\tlabel={ LABELS.all }\n\t\t\t\thideLabelFromVision\n\t\t\t\tonChange={ sliderOnChange }\n\t\t\t\tmin={ 0 }\n\t\t\t\tmax={ CUSTOM_VALUE_SETTINGS[ parsedUnit ?? 'px' ]?.max ?? 10 }\n\t\t\t\tstep={\n\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ parsedUnit ?? 'px' ]?.step ?? 0.1\n\t\t\t\t}\n\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\twithInputField={ false }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAD,OAAA;AAKA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAOiB,IAAAI,WAAA,GAAAJ,OAAA;AArBjB;AACA;AACA;;AAEA;AACA;AACA;;AAiBA,MAAMK,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEN,SAASC,eAAeA,CAAE;EACxCC,qBAAqB;EACrBC,QAAQ,GAAGH,IAAI;EACfI,OAAO,GAAGJ,IAAI;EACdK,MAAM;EACNC,KAAK;EACLC,aAAa;EACbC,gBAAgB;EAChB,GAAGC;AACyB,CAAC,EAAG;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EAChC,MAAMC,OAAO,GAAG,IAAAC,sBAAa,EAAEZ,eAAe,EAAE,uBAAwB,CAAC;EAEzE,MAAMa,QAAQ,GAAG,IAAAC,kBAAW,EAAEV,MAAM,EAAEE,aAAa,EAAED,KAAM,CAAC;EAC5D,MAAMU,SAAS,GAAG,IAAAC,sBAAe,EAAEZ,MAAO,CAAC;EAC3C,MAAMa,OAAO,GAAGF,SAAS,IAAI,IAAAG,oBAAa,EAAEd,MAAM,EAAEE,aAAa,EAAED,KAAM,CAAC;EAC1E,MAAMc,cAAc,GAAGF,OAAO,GAAGG,aAAM,CAACC,K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oBAAoB;MACpBC,KAAK,EAAGtC,QAAU;MAClBX,QAAQ,EAAG2B,aAAe;MAC1BuB,YAAY,EAAGb,kBAAoB;MACnCpC,OAAO,EAAGuB,aAAe;MACzB2B,WAAW,EAAGlC,cAAgB;MAC9BmC,KAAK,EAAGlC,aAAM,CAACmC,GAAK;MACpBC,mBAAmB;IAAA,CACnB,CAAC,eAEF,IAAA1D,WAAA,CAAA+C,GAAA,EAAClD,iBAAA,CAAA8D,kBAAkB;MAClBC,uBAAuB;MACvBzD,qBAAqB,EAAGA,qBAAuB;MAC/C0D,iCAAiC;MACjC,iBAAgBhD,OAAS;MACzB2C,KAAK,EAAGlC,aAAM,CAACmC,GAAK;MACpBC,mBAAmB;MACnBtD,QAAQ,EAAGmC,cAAgB;MAC3BuB,GAAG,EAAG,CAAG;MACTC,GAAG,GAAApD,qBAAA,GAAGqD,4BAAqB,CAAEtC,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,IAAI,CAAE,EAAEqC,GAAG,cAAApD,qBAAA,cAAAA,qBAAA,GAAI,EAAI;MAC9DsD,IAAI,GAAArD,sBAAA,GACHoD,4BAAqB,CAAEtC,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAI,IAAI,CAAE,EAAEuC,IAAI,cAAArD,sBAAA,cAAAA,sBAAA,GAAI,GACrD;MACDyC,KAAK,EAAG5B,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAG;MAC7ByC,cAAc,EAAG;IAAO,CACxB,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
@@ -106,6 +106,7 @@ function AxialInputControls({
106
106
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_boxControlStyles.FlexedRangeControl, {
107
107
  __nextHasNoMarginBottom: true,
108
108
  __next40pxDefaultSize: __next40pxDefaultSize,
109
+ __shouldNotWarnDeprecated36pxSize: true,
109
110
  "aria-controls": inputId,
110
111
  label: _utils2.LABELS[side],
111
112
  hideLabelFromVision: true,
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_utils","_tooltip","_interopRequireDefault","_utils2","_boxControlStyles","_jsxRuntime","_react","groupedSides","AxialInputControls","__next40pxDefaultSize","onChange","onFocus","values","selectedUnits","setSelectedUnits","sides","props","generatedId","useInstanceId","createHandleOnFocus","side","event","handleOnValueChange","next","nextValues","isNumeric","undefined","isNaN","parseFloat","nextValue","top","bottom","left","right","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","jsx","Fragment","children","map","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","selectedUnit","inputId","join","jsxs","InputWrapper","FlexedBoxControlIcon","default","placement","text","LABELS","createElement","StyledUnitControl","className","id","isPressEnterToChange","value","newValue","onUnitChange","label","hideLabelFromVision","key","FlexedRangeControl","__nextHasNoMarginBottom","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/axial-input-controls.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport Tooltip from '../tooltip';\nimport { CUSTOM_VALUE_SETTINGS, LABELS } from './utils';\nimport {\n\tFlexedBoxControlIcon,\n\tFlexedRangeControl,\n\tInputWrapper,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps } from './types';\n\nconst groupedSides = [ 'vertical', 'horizontal' ] as const;\ntype GroupedSide = ( typeof groupedSides )[ number ];\n\nexport default function AxialInputControls( {\n\t__next40pxDefaultSize,\n\tonChange,\n\tonFocus,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst generatedId = useInstanceId(\n\t\tAxialInputControls,\n\t\t`box-control-input`\n\t);\n\n\tconst createHandleOnFocus =\n\t\t( side: GroupedSide ) =>\n\t\t( event: React.FocusEvent< HTMLInputElement > ) => {\n\t\t\tif ( ! onFocus ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonFocus( event, { side } );\n\t\t};\n\n\tconst handleOnValueChange = ( side: GroupedSide, next?: string ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnextValues.top = nextValue;\n\t\t\tnextValues.bottom = nextValue;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnextValues.left = nextValue;\n\t\t\tnextValues.right = nextValue;\n\t\t}\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange =\n\t\t( side: GroupedSide ) => ( next?: string ) => {\n\t\t\tconst newUnits = { ...selectedUnits };\n\n\t\t\tif ( side === 'vertical' ) {\n\t\t\t\tnewUnits.top = next;\n\t\t\t\tnewUnits.bottom = next;\n\t\t\t}\n\n\t\t\tif ( side === 'horizontal' ) {\n\t\t\t\tnewUnits.left = next;\n\t\t\t\tnewUnits.right = next;\n\t\t\t}\n\n\t\t\tsetSelectedUnits( newUnits );\n\t\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? groupedSides.filter( ( side ) => sides.includes( side ) )\n\t\t: groupedSides;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue(\n\t\t\t\t\t\tside === 'vertical' ? values.top : values.left\n\t\t\t\t\t);\n\t\t\t\tconst selectedUnit =\n\t\t\t\t\tside === 'vertical'\n\t\t\t\t\t\t? selectedUnits.top\n\t\t\t\t\t\t: selectedUnits.left;\n\n\t\t\t\tconst inputId = [ generatedId, side ].join( '-' );\n\n\t\t\t\treturn (\n\t\t\t\t\t<InputWrapper key={ side }>\n\t\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t\t<Tooltip placement=\"top-end\" text={ LABELS[ side ] }>\n\t\t\t\t\t\t\t<StyledUnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\t\t\t\tid={ inputId }\n\t\t\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\t\t\tvalue={ [\n\t\t\t\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t\t\t].join( '' ) }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\t\thandleOnValueChange( side, newValue )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tside\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tkey={ side }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<FlexedRangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\taria-controls={ inputId }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t\t\t\tnewValue,\n\t\t\t\t\t\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t\t\t\t\t ].join( '' )\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ selectedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.max ?? 10\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ selectedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InputWrapper>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAKqC,IAAAM,WAAA,GAAAN,OAAA;AAAA,IAAAO,MAAA,GAAAP,OAAA;AAfrC;AACA;AACA;;AAEA;AACA;AACA;;AAYA,MAAMQ,YAAY,GAAG,CAAE,UAAU,EAAE,YAAY,CAAW;AAG3C,SAASC,kBAAkBA,CAAE;EAC3CC,qBAAqB;EACrBC,QAAQ;EACRC,OAAO;EACPC,MAAM;EACNC,aAAa;EACbC,gBAAgB;EAChBC,KAAK;EACL,GAAGC;AACyB,CAAC,EAAG;EAChC,MAAMC,WAAW,GAAG,IAAA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AG;UAC7B8B,cAAc,EAAG;QAAO,CACxB,CAAC;MAAA,GArDiBxD,IAsDN,CAAC;IAEjB,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_utils","_tooltip","_interopRequireDefault","_utils2","_boxControlStyles","_jsxRuntime","_react","groupedSides","AxialInputControls","__next40pxDefaultSize","onChange","onFocus","values","selectedUnits","setSelectedUnits","sides","props","generatedId","useInstanceId","createHandleOnFocus","side","event","handleOnValueChange","next","nextValues","isNumeric","undefined","isNaN","parseFloat","nextValue","top","bottom","left","right","createHandleOnUnitChange","newUnits","filteredSides","length","filter","includes","jsx","Fragment","children","map","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","selectedUnit","inputId","join","jsxs","InputWrapper","FlexedBoxControlIcon","default","placement","text","LABELS","createElement","StyledUnitControl","className","id","isPressEnterToChange","value","newValue","onUnitChange","label","hideLabelFromVision","key","FlexedRangeControl","__nextHasNoMarginBottom","__shouldNotWarnDeprecated36pxSize","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/axial-input-controls.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport Tooltip from '../tooltip';\nimport { CUSTOM_VALUE_SETTINGS, LABELS } from './utils';\nimport {\n\tFlexedBoxControlIcon,\n\tFlexedRangeControl,\n\tInputWrapper,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps } from './types';\n\nconst groupedSides = [ 'vertical', 'horizontal' ] as const;\ntype GroupedSide = ( typeof groupedSides )[ number ];\n\nexport default function AxialInputControls( {\n\t__next40pxDefaultSize,\n\tonChange,\n\tonFocus,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst generatedId = useInstanceId(\n\t\tAxialInputControls,\n\t\t`box-control-input`\n\t);\n\n\tconst createHandleOnFocus =\n\t\t( side: GroupedSide ) =>\n\t\t( event: React.FocusEvent< HTMLInputElement > ) => {\n\t\t\tif ( ! onFocus ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonFocus( event, { side } );\n\t\t};\n\n\tconst handleOnValueChange = ( side: GroupedSide, next?: string ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tif ( side === 'vertical' ) {\n\t\t\tnextValues.top = nextValue;\n\t\t\tnextValues.bottom = nextValue;\n\t\t}\n\n\t\tif ( side === 'horizontal' ) {\n\t\t\tnextValues.left = nextValue;\n\t\t\tnextValues.right = nextValue;\n\t\t}\n\n\t\tonChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange =\n\t\t( side: GroupedSide ) => ( next?: string ) => {\n\t\t\tconst newUnits = { ...selectedUnits };\n\n\t\t\tif ( side === 'vertical' ) {\n\t\t\t\tnewUnits.top = next;\n\t\t\t\tnewUnits.bottom = next;\n\t\t\t}\n\n\t\t\tif ( side === 'horizontal' ) {\n\t\t\t\tnewUnits.left = next;\n\t\t\t\tnewUnits.right = next;\n\t\t\t}\n\n\t\t\tsetSelectedUnits( newUnits );\n\t\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? groupedSides.filter( ( side ) => sides.includes( side ) )\n\t\t: groupedSides;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue(\n\t\t\t\t\t\tside === 'vertical' ? values.top : values.left\n\t\t\t\t\t);\n\t\t\t\tconst selectedUnit =\n\t\t\t\t\tside === 'vertical'\n\t\t\t\t\t\t? selectedUnits.top\n\t\t\t\t\t\t: selectedUnits.left;\n\n\t\t\t\tconst inputId = [ generatedId, side ].join( '-' );\n\n\t\t\t\treturn (\n\t\t\t\t\t<InputWrapper key={ side }>\n\t\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t\t<Tooltip placement=\"top-end\" text={ LABELS[ side ] }>\n\t\t\t\t\t\t\t<StyledUnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\t\t\t\tid={ inputId }\n\t\t\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\t\t\tvalue={ [\n\t\t\t\t\t\t\t\t\tparsedQuantity,\n\t\t\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t\t\t].join( '' ) }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\t\thandleOnValueChange( side, newValue )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tside\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tkey={ side }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<FlexedRangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t\t\taria-controls={ inputId }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t\t\t\t\t\t? [\n\t\t\t\t\t\t\t\t\t\t\t\tnewValue,\n\t\t\t\t\t\t\t\t\t\t\t\tselectedUnit ?? parsedUnit,\n\t\t\t\t\t\t\t\t\t\t ].join( '' )\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ selectedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.max ?? 10\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ selectedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InputWrapper>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAKqC,IAAAM,WAAA,GAAAN,OAAA;AAAA,IAAAO,MAAA,GAAAP,OAAA;AAfrC;AACA;AACA;;AAEA;AACA;AACA;;AAYA,MAAMQ,YAAY,GAAG,CAAE,UAAU,EAAE,YAAY,CAAW;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,sBAAA,GACH8B,6BAAqB,CAAE1B,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,IAAI,CAAE,EAC1C2B,IAAI,cAAA/B,sBAAA,cAAAA,sBAAA,GAAI,GACX;UACDmB,KAAK,EAAGlB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAG;UAC7B+B,cAAc,EAAG;QAAO,CACxB,CAAC;MAAA,GAtDiBzD,IAuDN,CAAC;IAEjB,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
@@ -47,23 +47,23 @@ function useUniqueId(idProp) {
47
47
  * used as an input control for values like `padding` or `margin`.
48
48
  *
49
49
  * ```jsx
50
+ * import { useState } from 'react';
50
51
  * import { BoxControl } from '@wordpress/components';
51
- * import { useState } from '@wordpress/element';
52
52
  *
53
53
  * function Example() {
54
- * const [ values, setValues ] = useState( {
55
- * top: '50px',
56
- * left: '10%',
57
- * right: '10%',
58
- * bottom: '50px',
59
- * } );
54
+ * const [ values, setValues ] = useState( {
55
+ * top: '50px',
56
+ * left: '10%',
57
+ * right: '10%',
58
+ * bottom: '50px',
59
+ * } );
60
60
  *
61
- * return (
62
- * <BoxControl
63
- * values={ values }
64
- * onChange={ ( nextValues ) => setValues( nextValues ) }
65
- * />
66
- * );
61
+ * return (
62
+ * <BoxControl
63
+ * values={ values }
64
+ * onChange={ setValues }
65
+ * />
66
+ * );
67
67
  * };
68
68
  * ```
69
69
  */
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_element","_i18n","_baseControl","_allInputControl","_interopRequireDefault","_inputControls","_axialInputControls","_linkedButton","_grid","_boxControlStyles","_utils","_utils2","_hooks","_jsxRuntime","defaultInputProps","min","noop","useUniqueId","idProp","instanceId","useInstanceId","BoxControl","__next40pxDefaultSize","id","inputProps","onChange","label","__","values","valuesProp","units","sides","splitOnAxis","allowReset","resetValues","DEFAULT_VALUES","onMouseOver","onMouseOut","setValues","useControlledState","fallback","inputValues","hasInitialValue","isValuesDefined","hasOneSide","length","isDirty","setIsDirty","useState","isLinked","setIsLinked","isValuesMixed","side","setSide","getInitialSide","selectedUnits","setSelectedUnits","top","parseQuantityAndUnitFromRawValue","right","bottom","left","headingId","toggleLinked","handleOnFocus","_event","nextSide","handleOnChange","nextValues","handleOnReset","inputControlProps","onFocus","jsxs","Grid","columns","templateColumns","role","children","jsx","BaseControl","VisualLabel","InputWrapper","FlexedBoxControlIcon","default","LinkedButtonWrapper","onClick","ResetButton","className","variant","size","disabled","_default","exports"],"sources":["@wordpress/components/src/box-control/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { BaseControl } from '../base-control';\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport AxialInputControls from './axial-input-controls';\nimport LinkedButton from './linked-button';\nimport { Grid } from '../grid';\nimport {\n\tFlexedBoxControlIcon,\n\tInputWrapper,\n\tResetButton,\n\tLinkedButtonWrapper,\n} from './styles/box-control-styles';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport {\n\tDEFAULT_VALUES,\n\tgetInitialSide,\n\tisValuesMixed,\n\tisValuesDefined,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport type {\n\tBoxControlIconProps,\n\tBoxControlProps,\n\tBoxControlValue,\n} from './types';\n\nconst defaultInputProps = {\n\tmin: 0,\n};\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( BoxControl, 'inspector-box-control' );\n\n\treturn idProp || instanceId;\n}\n\n/**\n * A control that lets users set values for top, right, bottom, and left. Can be\n * used as an input control for values like `padding` or `margin`.\n *\n * ```jsx\n * import { BoxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * function Example() {\n * \tconst [ values, setValues ] = useState( {\n * \t\ttop: '50px',\n * \t\tleft: '10%',\n * \t\tright: '10%',\n * \t\tbottom: '50px',\n * \t} );\n *\n * \treturn (\n * \t\t<BoxControl\n * \t\t\tvalues={ values }\n * \t\t\tonChange={ ( nextValues ) => setValues( nextValues ) }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nfunction BoxControl( {\n\t__next40pxDefaultSize = false,\n\tid: idProp,\n\tinputProps = defaultInputProps,\n\tonChange = noop,\n\tlabel = __( 'Box Control' ),\n\tvalues: valuesProp,\n\tunits,\n\tsides,\n\tsplitOnAxis = false,\n\tallowReset = true,\n\tresetValues = DEFAULT_VALUES,\n\tonMouseOver,\n\tonMouseOut,\n}: BoxControlProps ) {\n\tconst [ values, setValues ] = useControlledState( valuesProp, {\n\t\tfallback: DEFAULT_VALUES,\n\t} );\n\tconst inputValues = values || DEFAULT_VALUES;\n\tconst hasInitialValue = isValuesDefined( valuesProp );\n\tconst hasOneSide = sides?.length === 1;\n\n\tconst [ isDirty, setIsDirty ] = useState( hasInitialValue );\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasInitialValue || ! isValuesMixed( inputValues ) || hasOneSide\n\t);\n\n\tconst [ side, setSide ] = useState< BoxControlIconProps[ 'side' ] >(\n\t\tgetInitialSide( isLinked, splitOnAxis )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState< BoxControlValue >( {\n\t\ttop: parseQuantityAndUnitFromRawValue( valuesProp?.top )[ 1 ],\n\t\tright: parseQuantityAndUnitFromRawValue( valuesProp?.right )[ 1 ],\n\t\tbottom: parseQuantityAndUnitFromRawValue( valuesProp?.bottom )[ 1 ],\n\t\tleft: parseQuantityAndUnitFromRawValue( valuesProp?.left )[ 1 ],\n\t} );\n\n\tconst id = useUniqueId( idProp );\n\tconst headingId = `${ id }-heading`;\n\n\tconst toggleLinked = () => {\n\t\tsetIsLinked( ! isLinked );\n\t\tsetSide( getInitialSide( ! isLinked, splitOnAxis ) );\n\t};\n\n\tconst handleOnFocus = (\n\t\t_event: React.FocusEvent< HTMLInputElement >,\n\t\t{ side: nextSide }: { side: typeof side }\n\t) => {\n\t\tsetSide( nextSide );\n\t};\n\n\tconst handleOnChange = ( nextValues: BoxControlValue ) => {\n\t\tonChange( nextValues );\n\t\tsetValues( nextValues );\n\t\tsetIsDirty( true );\n\t};\n\n\tconst handleOnReset = () => {\n\t\tonChange( resetValues );\n\t\tsetValues( resetValues );\n\t\tsetSelectedUnits( resetValues );\n\t\tsetIsDirty( false );\n\t};\n\n\tconst inputControlProps = {\n\t\t...inputProps,\n\t\tonChange: handleOnChange,\n\t\tonFocus: handleOnFocus,\n\t\tisLinked,\n\t\tunits,\n\t\tselectedUnits,\n\t\tsetSelectedUnits,\n\t\tsides,\n\t\tvalues: inputValues,\n\t\tonMouseOver,\n\t\tonMouseOut,\n\t\t__next40pxDefaultSize,\n\t};\n\n\treturn (\n\t\t<Grid\n\t\t\tid={ id }\n\t\t\tcolumns={ 3 }\n\t\t\ttemplateColumns=\"1fr min-content min-content\"\n\t\t\trole=\"group\"\n\t\t\taria-labelledby={ headingId }\n\t\t>\n\t\t\t<BaseControl.VisualLabel id={ headingId }>\n\t\t\t\t{ label }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t{ isLinked && (\n\t\t\t\t<InputWrapper>\n\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t<AllInputControl { ...inputControlProps } />\n\t\t\t\t</InputWrapper>\n\t\t\t) }\n\t\t\t{ ! hasOneSide && (\n\t\t\t\t<LinkedButtonWrapper>\n\t\t\t\t\t<LinkedButton\n\t\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\t/>\n\t\t\t\t</LinkedButtonWrapper>\n\t\t\t) }\n\n\t\t\t{ ! isLinked && splitOnAxis && (\n\t\t\t\t<AxialInputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t\t{ ! isLinked && ! splitOnAxis && (\n\t\t\t\t<InputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t\t{ allowReset && (\n\t\t\t\t<ResetButton\n\t\t\t\t\tclassName=\"component-box-control__reset-button\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t</ResetButton>\n\t\t\t) }\n\t\t</Grid>\n\t);\n}\n\nexport { applyValueToSides } from './utils';\nexport default BoxControl;\n"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,cAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,mBAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,aAAA,GAAAH,sBAAA,CAAAL,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AAMA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,OAAA,GAAAZ,OAAA;AAMA,IAAAa,MAAA,GAAAb,OAAA;AAAoD,IAAAc,WAAA,GAAAd,OAAA;AA7BpD;AACA;AACA;;AAKA;AACA;AACA;;AA2BA,MAAMe,iBAAiB,GAAG;EACzBC,GAAG,EAAE;AACN,CAAC;AAED,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,WAAWA,CAAEC,MAAe,EAAG;EACvC,MAAMC,UAAU,GAAG,IAAAC,sBAAa,EAAEC,UAAU,EAAE,uBAAwB,CAAC;EAEvE,OAAOH,MAAM,IAAIC,UAAU;AAC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,IAAAnB,WAAA,CAAAiE,GAAA,EAACzE,cAAA,CAAA8E,OAAa;MAAA,GAAMb;IAAiB,CAAI,CACzC,EACCrC,UAAU,iBACX,IAAApB,WAAA,CAAAiE,GAAA,EAACrE,iBAAA,CAAA6E,WAAW;MACXC,SAAS,EAAC,qCAAqC;MAC/CC,OAAO,EAAC,WAAW;MACnBC,IAAI,EAAC,OAAO;MACZJ,OAAO,EAAGhB,aAAe;MACzBqB,QAAQ,EAAG,CAAE5C,OAAS;MAAA+B,QAAA,EAEpB,IAAAlD,QAAE,EAAE,OAAQ;IAAC,CACH,CACb;EAAA,CACI,CAAC;AAET;AAAC,IAAAgE,QAAA,GAAAC,OAAA,CAAAT,OAAA,GAGc9D,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_element","_i18n","_baseControl","_allInputControl","_interopRequireDefault","_inputControls","_axialInputControls","_linkedButton","_grid","_boxControlStyles","_utils","_utils2","_hooks","_jsxRuntime","defaultInputProps","min","noop","useUniqueId","idProp","instanceId","useInstanceId","BoxControl","__next40pxDefaultSize","id","inputProps","onChange","label","__","values","valuesProp","units","sides","splitOnAxis","allowReset","resetValues","DEFAULT_VALUES","onMouseOver","onMouseOut","setValues","useControlledState","fallback","inputValues","hasInitialValue","isValuesDefined","hasOneSide","length","isDirty","setIsDirty","useState","isLinked","setIsLinked","isValuesMixed","side","setSide","getInitialSide","selectedUnits","setSelectedUnits","top","parseQuantityAndUnitFromRawValue","right","bottom","left","headingId","toggleLinked","handleOnFocus","_event","nextSide","handleOnChange","nextValues","handleOnReset","inputControlProps","onFocus","jsxs","Grid","columns","templateColumns","role","children","jsx","BaseControl","VisualLabel","InputWrapper","FlexedBoxControlIcon","default","LinkedButtonWrapper","onClick","ResetButton","className","variant","size","disabled","_default","exports"],"sources":["@wordpress/components/src/box-control/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { BaseControl } from '../base-control';\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport AxialInputControls from './axial-input-controls';\nimport LinkedButton from './linked-button';\nimport { Grid } from '../grid';\nimport {\n\tFlexedBoxControlIcon,\n\tInputWrapper,\n\tResetButton,\n\tLinkedButtonWrapper,\n} from './styles/box-control-styles';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport {\n\tDEFAULT_VALUES,\n\tgetInitialSide,\n\tisValuesMixed,\n\tisValuesDefined,\n} from './utils';\nimport { useControlledState } from '../utils/hooks';\nimport type {\n\tBoxControlIconProps,\n\tBoxControlProps,\n\tBoxControlValue,\n} from './types';\n\nconst defaultInputProps = {\n\tmin: 0,\n};\n\nconst noop = () => {};\n\nfunction useUniqueId( idProp?: string ) {\n\tconst instanceId = useInstanceId( BoxControl, 'inspector-box-control' );\n\n\treturn idProp || instanceId;\n}\n\n/**\n * A control that lets users set values for top, right, bottom, and left. Can be\n * used as an input control for values like `padding` or `margin`.\n *\n * ```jsx\n * import { useState } from 'react';\n * import { BoxControl } from '@wordpress/components';\n *\n * function Example() {\n * const [ values, setValues ] = useState( {\n * top: '50px',\n * left: '10%',\n * right: '10%',\n * bottom: '50px',\n * } );\n *\n * return (\n * <BoxControl\n * values={ values }\n * onChange={ setValues }\n * />\n * );\n * };\n * ```\n */\nfunction BoxControl( {\n\t__next40pxDefaultSize = false,\n\tid: idProp,\n\tinputProps = defaultInputProps,\n\tonChange = noop,\n\tlabel = __( 'Box Control' ),\n\tvalues: valuesProp,\n\tunits,\n\tsides,\n\tsplitOnAxis = false,\n\tallowReset = true,\n\tresetValues = DEFAULT_VALUES,\n\tonMouseOver,\n\tonMouseOut,\n}: BoxControlProps ) {\n\tconst [ values, setValues ] = useControlledState( valuesProp, {\n\t\tfallback: DEFAULT_VALUES,\n\t} );\n\tconst inputValues = values || DEFAULT_VALUES;\n\tconst hasInitialValue = isValuesDefined( valuesProp );\n\tconst hasOneSide = sides?.length === 1;\n\n\tconst [ isDirty, setIsDirty ] = useState( hasInitialValue );\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasInitialValue || ! isValuesMixed( inputValues ) || hasOneSide\n\t);\n\n\tconst [ side, setSide ] = useState< BoxControlIconProps[ 'side' ] >(\n\t\tgetInitialSide( isLinked, splitOnAxis )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState< BoxControlValue >( {\n\t\ttop: parseQuantityAndUnitFromRawValue( valuesProp?.top )[ 1 ],\n\t\tright: parseQuantityAndUnitFromRawValue( valuesProp?.right )[ 1 ],\n\t\tbottom: parseQuantityAndUnitFromRawValue( valuesProp?.bottom )[ 1 ],\n\t\tleft: parseQuantityAndUnitFromRawValue( valuesProp?.left )[ 1 ],\n\t} );\n\n\tconst id = useUniqueId( idProp );\n\tconst headingId = `${ id }-heading`;\n\n\tconst toggleLinked = () => {\n\t\tsetIsLinked( ! isLinked );\n\t\tsetSide( getInitialSide( ! isLinked, splitOnAxis ) );\n\t};\n\n\tconst handleOnFocus = (\n\t\t_event: React.FocusEvent< HTMLInputElement >,\n\t\t{ side: nextSide }: { side: typeof side }\n\t) => {\n\t\tsetSide( nextSide );\n\t};\n\n\tconst handleOnChange = ( nextValues: BoxControlValue ) => {\n\t\tonChange( nextValues );\n\t\tsetValues( nextValues );\n\t\tsetIsDirty( true );\n\t};\n\n\tconst handleOnReset = () => {\n\t\tonChange( resetValues );\n\t\tsetValues( resetValues );\n\t\tsetSelectedUnits( resetValues );\n\t\tsetIsDirty( false );\n\t};\n\n\tconst inputControlProps = {\n\t\t...inputProps,\n\t\tonChange: handleOnChange,\n\t\tonFocus: handleOnFocus,\n\t\tisLinked,\n\t\tunits,\n\t\tselectedUnits,\n\t\tsetSelectedUnits,\n\t\tsides,\n\t\tvalues: inputValues,\n\t\tonMouseOver,\n\t\tonMouseOut,\n\t\t__next40pxDefaultSize,\n\t};\n\n\treturn (\n\t\t<Grid\n\t\t\tid={ id }\n\t\t\tcolumns={ 3 }\n\t\t\ttemplateColumns=\"1fr min-content min-content\"\n\t\t\trole=\"group\"\n\t\t\taria-labelledby={ headingId }\n\t\t>\n\t\t\t<BaseControl.VisualLabel id={ headingId }>\n\t\t\t\t{ label }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t{ isLinked && (\n\t\t\t\t<InputWrapper>\n\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t<AllInputControl { ...inputControlProps } />\n\t\t\t\t</InputWrapper>\n\t\t\t) }\n\t\t\t{ ! hasOneSide && (\n\t\t\t\t<LinkedButtonWrapper>\n\t\t\t\t\t<LinkedButton\n\t\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\t/>\n\t\t\t\t</LinkedButtonWrapper>\n\t\t\t) }\n\n\t\t\t{ ! isLinked && splitOnAxis && (\n\t\t\t\t<AxialInputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t\t{ ! isLinked && ! splitOnAxis && (\n\t\t\t\t<InputControls { ...inputControlProps } />\n\t\t\t) }\n\t\t\t{ allowReset && (\n\t\t\t\t<ResetButton\n\t\t\t\t\tclassName=\"component-box-control__reset-button\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tonClick={ handleOnReset }\n\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t</ResetButton>\n\t\t\t) }\n\t\t</Grid>\n\t);\n}\n\nexport { applyValueToSides } from './utils';\nexport default BoxControl;\n"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF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*/(0, _jsxRuntime.jsx)(_boxControlStyles.FlexedRangeControl, {
113
113
  __nextHasNoMarginBottom: true,
114
114
  __next40pxDefaultSize: __next40pxDefaultSize,
115
+ __shouldNotWarnDeprecated36pxSize: true,
115
116
  "aria-controls": inputId,
116
117
  label: _utils2.LABELS[side],
117
118
  hideLabelFromVision: true,
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_tooltip","_interopRequireDefault","_utils","_utils2","_boxControlStyles","_jsxRuntime","noop","BoxInputControls","__next40pxDefaultSize","onChange","onFocus","values","selectedUnits","setSelectedUnits","sides","props","generatedId","useInstanceId","createHandleOnFocus","side","event","handleOnChange","nextValues","handleOnValueChange","next","extra","isNumeric","undefined","isNaN","parseFloat","nextValue","altKey","bottom","top","right","left","createHandleOnUnitChange","newUnits","filteredSides","length","ALL_SIDES","filter","includes","jsx","Fragment","children","map","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","computedUnit","inputId","join","jsxs","InputWrapper","expanded","FlexedBoxControlIcon","default","placement","text","LABELS","StyledUnitControl","className","id","isPressEnterToChange","value","onUnitChange","label","hideLabelFromVision","FlexedRangeControl","__nextHasNoMarginBottom","newValue","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/input-controls.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { ALL_SIDES, CUSTOM_VALUE_SETTINGS, LABELS } from './utils';\nimport {\n\tFlexedBoxControlIcon,\n\tFlexedRangeControl,\n\tInputWrapper,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps, BoxControlValue } from './types';\n\nconst noop = () => {};\n\nexport default function BoxInputControls( {\n\t__next40pxDefaultSize,\n\tonChange = noop,\n\tonFocus = noop,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst generatedId = useInstanceId( BoxInputControls, 'box-control-input' );\n\n\tconst createHandleOnFocus =\n\t\t( side: keyof BoxControlValue ) =>\n\t\t( event: React.FocusEvent< HTMLInputElement > ) => {\n\t\t\tonFocus( event, { side } );\n\t\t};\n\n\tconst handleOnChange = ( nextValues: BoxControlValue ) => {\n\t\tonChange( nextValues );\n\t};\n\n\tconst handleOnValueChange = (\n\t\tside: keyof BoxControlValue,\n\t\tnext?: string,\n\t\textra?: { event: React.SyntheticEvent< Element, Event > }\n\t) => {\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tnextValues[ side ] = nextValue;\n\n\t\t/**\n\t\t * Supports changing pair sides. For example, holding the ALT key\n\t\t * when changing the TOP will also update BOTTOM.\n\t\t */\n\t\t// @ts-expect-error - TODO: event.altKey is only present when the change event was\n\t\t// triggered by a keyboard event. Should this feature be implemented differently so\n\t\t// it also works with drag events?\n\t\tif ( extra?.event.altKey ) {\n\t\t\tswitch ( side ) {\n\t\t\t\tcase 'top':\n\t\t\t\t\tnextValues.bottom = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bottom':\n\t\t\t\t\tnextValues.top = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'left':\n\t\t\t\t\tnextValues.right = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'right':\n\t\t\t\t\tnextValues.left = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\thandleOnChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange =\n\t\t( side: keyof BoxControlValue ) => ( next?: string ) => {\n\t\t\tconst newUnits = { ...selectedUnits };\n\t\t\tnewUnits[ side ] = next;\n\t\t\tsetSelectedUnits( newUnits );\n\t\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? ALL_SIDES.filter( ( side ) => sides.includes( side ) )\n\t\t: ALL_SIDES;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue( values[ side ] );\n\n\t\t\t\tconst computedUnit = values[ side ]\n\t\t\t\t\t? parsedUnit\n\t\t\t\t\t: selectedUnits[ side ];\n\n\t\t\t\tconst inputId = [ generatedId, side ].join( '-' );\n\n\t\t\t\treturn (\n\t\t\t\t\t<InputWrapper key={ `box-control-${ side }` } expanded>\n\t\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t\t<Tooltip placement=\"top-end\" text={ LABELS[ side ] }>\n\t\t\t\t\t\t\t<StyledUnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\t\t\t\tid={ inputId }\n\t\t\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\t\t\tvalue={ [ parsedQuantity, computedUnit ].join(\n\t\t\t\t\t\t\t\t\t''\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ ( nextValue, extra ) =>\n\t\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\t\tnextValue,\n\t\t\t\t\t\t\t\t\t\textra\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tside\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\n\t\t\t\t\t\t<FlexedRangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\taria-controls={ inputId }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t\t\t\t\t\t? [ newValue, computedUnit ].join( '' )\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.max ?? 10\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InputWrapper>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAA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AA,qBAAA,GAAI,EACV;UACD8B,IAAI,GAAA7B,sBAAA,GACH4B,6BAAqB,CAAExB,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,IAAI,CAAE,EAC1CyB,IAAI,cAAA7B,sBAAA,cAAAA,sBAAA,GAAI,GACX;UACDmB,KAAK,EAAGlB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAG;UAC7B6B,cAAc,EAAG;QAAO,CACxB,CAAC;MAAA,GArDiB,eAAgB3D,IAAI,EAsD1B,CAAC;IAEjB,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_tooltip","_interopRequireDefault","_utils","_utils2","_boxControlStyles","_jsxRuntime","noop","BoxInputControls","__next40pxDefaultSize","onChange","onFocus","values","selectedUnits","setSelectedUnits","sides","props","generatedId","useInstanceId","createHandleOnFocus","side","event","handleOnChange","nextValues","handleOnValueChange","next","extra","isNumeric","undefined","isNaN","parseFloat","nextValue","altKey","bottom","top","right","left","createHandleOnUnitChange","newUnits","filteredSides","length","ALL_SIDES","filter","includes","jsx","Fragment","children","map","_CUSTOM_VALUE_SETTING","_CUSTOM_VALUE_SETTING2","parsedQuantity","parsedUnit","parseQuantityAndUnitFromRawValue","computedUnit","inputId","join","jsxs","InputWrapper","expanded","FlexedBoxControlIcon","default","placement","text","LABELS","StyledUnitControl","className","id","isPressEnterToChange","value","onUnitChange","label","hideLabelFromVision","FlexedRangeControl","__nextHasNoMarginBottom","__shouldNotWarnDeprecated36pxSize","newValue","min","max","CUSTOM_VALUE_SETTINGS","step","withInputField"],"sources":["@wordpress/components/src/box-control/input-controls.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport { parseQuantityAndUnitFromRawValue } from '../unit-control/utils';\nimport { ALL_SIDES, CUSTOM_VALUE_SETTINGS, LABELS } from './utils';\nimport {\n\tFlexedBoxControlIcon,\n\tFlexedRangeControl,\n\tInputWrapper,\n\tStyledUnitControl,\n} from './styles/box-control-styles';\nimport type { BoxControlInputControlProps, BoxControlValue } from './types';\n\nconst noop = () => {};\n\nexport default function BoxInputControls( {\n\t__next40pxDefaultSize,\n\tonChange = noop,\n\tonFocus = noop,\n\tvalues,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tsides,\n\t...props\n}: BoxControlInputControlProps ) {\n\tconst generatedId = useInstanceId( BoxInputControls, 'box-control-input' );\n\n\tconst createHandleOnFocus =\n\t\t( side: keyof BoxControlValue ) =>\n\t\t( event: React.FocusEvent< HTMLInputElement > ) => {\n\t\t\tonFocus( event, { side } );\n\t\t};\n\n\tconst handleOnChange = ( nextValues: BoxControlValue ) => {\n\t\tonChange( nextValues );\n\t};\n\n\tconst handleOnValueChange = (\n\t\tside: keyof BoxControlValue,\n\t\tnext?: string,\n\t\textra?: { event: React.SyntheticEvent< Element, Event > }\n\t) => {\n\t\tconst nextValues = { ...values };\n\t\tconst isNumeric = next !== undefined && ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tnextValues[ side ] = nextValue;\n\n\t\t/**\n\t\t * Supports changing pair sides. For example, holding the ALT key\n\t\t * when changing the TOP will also update BOTTOM.\n\t\t */\n\t\t// @ts-expect-error - TODO: event.altKey is only present when the change event was\n\t\t// triggered by a keyboard event. Should this feature be implemented differently so\n\t\t// it also works with drag events?\n\t\tif ( extra?.event.altKey ) {\n\t\t\tswitch ( side ) {\n\t\t\t\tcase 'top':\n\t\t\t\t\tnextValues.bottom = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bottom':\n\t\t\t\t\tnextValues.top = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'left':\n\t\t\t\t\tnextValues.right = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'right':\n\t\t\t\t\tnextValues.left = nextValue;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\thandleOnChange( nextValues );\n\t};\n\n\tconst createHandleOnUnitChange =\n\t\t( side: keyof BoxControlValue ) => ( next?: string ) => {\n\t\t\tconst newUnits = { ...selectedUnits };\n\t\t\tnewUnits[ side ] = next;\n\t\t\tsetSelectedUnits( newUnits );\n\t\t};\n\n\t// Filter sides if custom configuration provided, maintaining default order.\n\tconst filteredSides = sides?.length\n\t\t? ALL_SIDES.filter( ( side ) => sides.includes( side ) )\n\t\t: ALL_SIDES;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredSides.map( ( side ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue( values[ side ] );\n\n\t\t\t\tconst computedUnit = values[ side ]\n\t\t\t\t\t? parsedUnit\n\t\t\t\t\t: selectedUnits[ side ];\n\n\t\t\t\tconst inputId = [ generatedId, side ].join( '-' );\n\n\t\t\t\treturn (\n\t\t\t\t\t<InputWrapper key={ `box-control-${ side }` } expanded>\n\t\t\t\t\t\t<FlexedBoxControlIcon side={ side } sides={ sides } />\n\t\t\t\t\t\t<Tooltip placement=\"top-end\" text={ LABELS[ side ] }>\n\t\t\t\t\t\t\t<StyledUnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tclassName=\"component-box-control__unit-control\"\n\t\t\t\t\t\t\t\tid={ inputId }\n\t\t\t\t\t\t\t\tisPressEnterToChange\n\t\t\t\t\t\t\t\tvalue={ [ parsedQuantity, computedUnit ].join(\n\t\t\t\t\t\t\t\t\t''\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ ( nextValue, extra ) =>\n\t\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\t\tnextValue,\n\t\t\t\t\t\t\t\t\t\textra\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tside\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonFocus={ createHandleOnFocus( side ) }\n\t\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\n\t\t\t\t\t\t<FlexedRangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t\t\taria-controls={ inputId }\n\t\t\t\t\t\t\tlabel={ LABELS[ side ] }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\thandleOnValueChange(\n\t\t\t\t\t\t\t\t\tside,\n\t\t\t\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t\t\t\t\t\t? [ newValue, computedUnit ].join( '' )\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.max ?? 10\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={\n\t\t\t\t\t\t\t\tCUSTOM_VALUE_SETTINGS[ computedUnit ?? 'px' ]\n\t\t\t\t\t\t\t\t\t?.step ?? 0.1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvalue={ parsedQuantity ?? 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</InputWrapper>\n\t\t\t\t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EtB,YAAY,CAAE,CAACE,IAAI,CAAE,EAAG,CAAC,GACrC3B,SACJ,CAAC;UACF,CAAG;UACHgD,GAAG,EAAG,CAAG;UACTC,GAAG,GAAA7B,qBAAA,GACF8B,6BAAqB,CAAEzB,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,IAAI,CAAE,EAC1CwB,GAAG,cAAA7B,qBAAA,cAAAA,qBAAA,GAAI,EACV;UACD+B,IAAI,GAAA9B,sBAAA,GACH6B,6BAAqB,CAAEzB,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAI,IAAI,CAAE,EAC1C0B,IAAI,cAAA9B,sBAAA,cAAAA,sBAAA,GAAI,GACX;UACDmB,KAAK,EAAGlB,cAAc,aAAdA,cAAc,cAAdA,cAAc,GAAI,CAAG;UAC7B8B,cAAc,EAAG;QAAO,CACxB,CAAC;MAAA,GAtDiB,eAAgB5D,IAAI,EAuD1B,CAAC;IAEjB,CAAE;EAAC,CACF,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/box-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { UnitControlProps } from '../unit-control/types';\nimport type { LABELS } from './utils';\n\nexport type BoxControlValue = {\n\ttop?: string;\n\tright?: string;\n\tbottom?: string;\n\tleft?: string;\n};\n\nexport type CustomValueUnits = {\n\t[ key: string ]: { max: number; step: number };\n};\n\ntype UnitControlPassthroughProps = Omit<\n\tUnitControlProps,\n\t'label' | 'onChange' | 'onFocus' | 'onMouseOver' | 'onMouseOut' | 'units'\n>;\n\nexport type BoxControlProps = Pick<\n\tUnitControlProps,\n\t'onMouseOver' | 'onMouseOut' | 'units'\n> & {\n\t/**\n\t * If this property is true, a button to reset the box control is rendered.\n\t *\n\t * @default true\n\t */\n\tallowReset?: boolean;\n\t/**\n\t * The id to use as a base for the unique HTML id attribute of the control.\n\t */\n\tid?: string;\n\t/**\n\t * Props for the internal `UnitControl` components.\n\t *\n\t * @default { min: 0 }\n\t */\n\tinputProps?: UnitControlPassthroughProps;\n\t/**\n\t * Heading label for the control.\n\t *\n\t * @default __( 'Box Control' )\n\t */\n\tlabel?: string;\n\t/**\n\t * A callback function when an input value changes.\n\t */\n\tonChange: ( next: BoxControlValue ) => void;\n\t/**\n\t * The `top`, `right`, `bottom`, and `left` box dimension values to use when the control is reset.\n\t *\n\t * @default { top: undefined, right: undefined, bottom: undefined, left: undefined }\n\t */\n\tresetValues?: BoxControlValue;\n\t/**\n\t * Collection of sides to allow control of. If omitted or empty, all sides will be available.\n\t */\n\tsides?: readonly ( keyof BoxControlValue | 'horizontal' | 'vertical' )[];\n\t/**\n\t * If this property is true, when the box control is unlinked, vertical and horizontal controls\n\t * can be used instead of updating individual sides.\n\t *\n\t * @default false\n\t */\n\tsplitOnAxis?: boolean;\n\t/**\n\t * The current values of the control, expressed as an object of `top`, `right`, `bottom`, and `left` values.\n\t */\n\tvalues?: BoxControlValue;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n};\n\nexport type BoxControlInputControlProps = UnitControlPassthroughProps & {\n\tonChange?: ( nextValues: BoxControlValue ) => void;\n\tonFocus?: (\n\t\t_event: React.FocusEvent< HTMLInputElement >,\n\t\t{ side }: { side: keyof typeof LABELS }\n\t) => void;\n\tonHoverOff?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tonHoverOn?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tselectedUnits: BoxControlValue;\n\tsetSelectedUnits: React.Dispatch< React.SetStateAction< BoxControlValue > >;\n\tsides: BoxControlProps[ 'sides' ];\n\tvalues: BoxControlValue;\n};\n\nexport type BoxControlIconProps = {\n\t/**\n\t * @default 24\n\t */\n\tsize?: number;\n\t/**\n\t * @default 'all'\n\t */\n\tside?: keyof typeof LABELS;\n\tsides?: BoxControlProps[ 'sides' ];\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/box-control/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { UnitControlProps } from '../unit-control/types';\nimport type { LABELS } from './utils';\n\nexport type BoxControlValue = {\n\ttop?: string;\n\tright?: string;\n\tbottom?: string;\n\tleft?: string;\n};\n\nexport type CustomValueUnits = {\n\t[ key: string ]: { max: number; step: number };\n};\n\ntype UnitControlPassthroughProps = Omit<\n\tUnitControlProps,\n\t'label' | 'onChange' | 'onFocus' | '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\t * Allowed values are \"top\", \"right\", \"bottom\", \"left\", \"vertical\", and \"horizontal\".\n\t */\n\tsides?: readonly ( keyof BoxControlValue | 'horizontal' | 'vertical' )[];\n\t/**\n\t * If this property is true, when the box control is unlinked, vertical and horizontal controls\n\t * can be used instead of updating individual sides.\n\t *\n\t * @default false\n\t */\n\tsplitOnAxis?: boolean;\n\t/**\n\t * The current values of the control, expressed as an object of `top`, `right`, `bottom`, and `left` values.\n\t */\n\tvalues?: BoxControlValue;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n};\n\nexport type BoxControlInputControlProps = UnitControlPassthroughProps & {\n\tonChange?: ( nextValues: BoxControlValue ) => void;\n\tonFocus?: (\n\t\t_event: React.FocusEvent< HTMLInputElement >,\n\t\t{ side }: { side: keyof typeof LABELS }\n\t) => void;\n\tonHoverOff?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tonHoverOn?: (\n\t\tsides: Partial< Record< keyof BoxControlValue, boolean > >\n\t) => void;\n\tselectedUnits: BoxControlValue;\n\tsetSelectedUnits: React.Dispatch< React.SetStateAction< BoxControlValue > >;\n\tsides: BoxControlProps[ 'sides' ];\n\tvalues: BoxControlValue;\n};\n\nexport type BoxControlIconProps = {\n\t/**\n\t * @default 24\n\t */\n\tsize?: number;\n\t/**\n\t * @default 'all'\n\t */\n\tside?: keyof typeof LABELS;\n\tsides?: BoxControlProps[ 'sides' ];\n};\n"],"mappings":"","ignoreList":[]}
@@ -46,6 +46,7 @@ function ButtonAction({
46
46
  ...additionalProps
47
47
  }) {
48
48
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
49
+ __next40pxDefaultSize: true,
49
50
  className: (0, _clsx.default)('components-circular-option-picker__clear', className),
50
51
  variant: "tertiary",
51
52
  ...additionalProps,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_button","_dropdown","_jsxRuntime","DropdownLinkAction","buttonProps","className","dropdownProps","linkText","jsx","default","clsx","renderToggle","isOpen","onToggle","onClick","variant","children","ButtonAction","additionalProps"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-actions.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport type { DropdownLinkActionProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport function DropdownLinkAction( {\n\tbuttonProps,\n\tclassName,\n\tdropdownProps,\n\tlinkText,\n}: DropdownLinkActionProps ) {\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__dropdown-link-action',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t>\n\t\t\t\t\t{ linkText }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ ...dropdownProps }\n\t\t/>\n\t);\n}\n\nexport function ButtonAction( {\n\tclassName,\n\tchildren,\n\t...additionalProps\n}: WordPressComponentProps< ButtonAsButtonProps, 'button', false > ) {\n\treturn (\n\t\t<Button\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__clear',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tvariant=\"tertiary\"\n\t\t\t{ ...additionalProps }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAmC,IAAAG,WAAA,GAAAH,OAAA;AATnC;AACA;AACA;;AAGA;AACA;AACA;;AAOO,SAASI,kBAAkBA,CAAE;EACnCC,WAAW;EACXC,SAAS;EACTC,aAAa;EACbC;AACwB,CAAC,EAAG;EAC5B,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACP,SAAA,CAAAQ,OAAQ;IACRJ,SAAS,EAAG,IAAAK,aAAI,EACf,yDAAyD,EACzDL,SACD,CAAG;IACHM,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpC,IAAAX,WAAA,CAAAM,GAAA,EAACR,OAAA,CAAAS,OAAM;MACN,iBAAgBG,MAAQ;MACxB,iBAAc,MAAM;MACpBE,OAAO,EAAGD,QAAU;MACpBE,OAAO,EAAC,MAAM;MAAA,GACTX,WAAW;MAAAY,QAAA,EAEdT;IAAQ,CACH,CACN;IAAA,GACED;EAAa,CAClB,CAAC;AAEJ;AAEO,SAASW,YAAYA,CAAE;EAC7BZ,SAAS;EACTW,QAAQ;EACR,GAAGE;AAC6D,CAAC,EAAG;EACpE,oBACC,IAAAhB,WAAA,CAAAM,GAAA,EAACR,OAAA,CAAAS,OAAM;IACNJ,SAAS,EAAG,IAAAK,aAAI,EACf,0CAA0C,EAC1CL,SACD,CAAG;IACHU,OAAO,EAAC,UAAU;IAAA,GACbG,eAAe;IAAAF,QAAA,EAElBA;EAAQ,CACH,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_button","_dropdown","_jsxRuntime","DropdownLinkAction","buttonProps","className","dropdownProps","linkText","jsx","default","clsx","renderToggle","isOpen","onToggle","onClick","variant","children","ButtonAction","additionalProps","__next40pxDefaultSize"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-actions.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport type { DropdownLinkActionProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport function DropdownLinkAction( {\n\tbuttonProps,\n\tclassName,\n\tdropdownProps,\n\tlinkText,\n}: DropdownLinkActionProps ) {\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__dropdown-link-action',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t>\n\t\t\t\t\t{ linkText }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ ...dropdownProps }\n\t\t/>\n\t);\n}\n\nexport function ButtonAction( {\n\tclassName,\n\tchildren,\n\t...additionalProps\n}: WordPressComponentProps< ButtonAsButtonProps, 'button', false > ) {\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__clear',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tvariant=\"tertiary\"\n\t\t\t{ ...additionalProps }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AAAmC,IAAAG,WAAA,GAAAH,OAAA;AATnC;AACA;AACA;;AAGA;AACA;AACA;;AAOO,SAASI,kBAAkBA,CAAE;EACnCC,WAAW;EACXC,SAAS;EACTC,aAAa;EACbC;AACwB,CAAC,EAAG;EAC5B,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACP,SAAA,CAAAQ,OAAQ;IACRJ,SAAS,EAAG,IAAAK,aAAI,EACf,yDAAyD,EACzDL,SACD,CAAG;IACHM,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpC,IAAAX,WAAA,CAAAM,GAAA,EAACR,OAAA,CAAAS,OAAM;MACN,iBAAgBG,MAAQ;MACxB,iBAAc,MAAM;MACpBE,OAAO,EAAGD,QAAU;MACpBE,OAAO,EAAC,MAAM;MAAA,GACTX,WAAW;MAAAY,QAAA,EAEdT;IAAQ,CACH,CACN;IAAA,GACED;EAAa,CAClB,CAAC;AAEJ;AAEO,SAASW,YAAYA,CAAE;EAC7BZ,SAAS;EACTW,QAAQ;EACR,GAAGE;AAC6D,CAAC,EAAG;EACpE,oBACC,IAAAhB,WAAA,CAAAM,GAAA,EAACR,OAAA,CAAAS,OAAM;IACNU,qBAAqB;IACrBd,SAAS,EAAG,IAAAK,aAAI,EACf,0CAA0C,EAC1CL,SACD,CAAG;IACHU,OAAO,EAAC,UAAU;IAAA,GACbG,eAAe;IAAAF,QAAA,EAElBA;EAAQ,CACH,CAAC;AAEX","ignoreList":[]}
@@ -82,6 +82,7 @@ function Option({
82
82
  const commonProps = {
83
83
  id,
84
84
  className: 'components-circular-option-picker__option',
85
+ __next40pxDefaultSize: true,
85
86
  ...additionalProps
86
87
  };
87
88
  const isListbox = setActiveId !== undefined;
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_element","_icons","_circularOptionPickerContext","_button","_composite","_tooltip","_jsxRuntime","UnforwardedOptionAsButton","props","forwardedRef","isPressed","additionalProps","jsx","default","ref","OptionAsButton","forwardRef","UnforwardedOptionAsOption","id","isSelected","setActiveId","activeId","useContext","CircularOptionPickerContext","useEffect","window","setTimeout","Composite","Item","render","role","OptionAsOption","Option","className","selectedIconProps","tooltipText","baseId","useInstanceId","commonProps","isListbox","undefined","optionControl","jsxs","clsx","children","text","Icon","icon","check"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-option.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useContext, useEffect } from '@wordpress/element';\nimport { Icon, check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { CircularOptionPickerContext } from './circular-option-picker-context';\nimport Button from '../button';\nimport { Composite } from '../composite';\nimport Tooltip from '../tooltip';\nimport type { OptionProps } from './types';\n\nfunction UnforwardedOptionAsButton(\n\tprops: {\n\t\tid?: string;\n\t\tclassName?: string;\n\t\tisPressed?: boolean;\n\t},\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { isPressed, ...additionalProps } = props;\n\treturn (\n\t\t<Button\n\t\t\t{ ...additionalProps }\n\t\t\taria-pressed={ isPressed }\n\t\t\tref={ forwardedRef }\n\t\t/>\n\t);\n}\n\nconst OptionAsButton = forwardRef( UnforwardedOptionAsButton );\n\nfunction UnforwardedOptionAsOption(\n\tprops: {\n\t\tid: string;\n\t\tclassName?: string;\n\t\tisSelected?: boolean;\n\t},\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { id, isSelected, ...additionalProps } = props;\n\n\tconst { setActiveId, activeId } = useContext( CircularOptionPickerContext );\n\n\tuseEffect( () => {\n\t\tif ( isSelected && ! activeId ) {\n\t\t\t// The setTimeout call is necessary to make sure that this update\n\t\t\t// doesn't get overridden by `Composite`'s internal logic, which picks\n\t\t\t// an initial active item if one is not specifically set.\n\t\t\twindow.setTimeout( () => setActiveId?.( id ), 0 );\n\t\t}\n\t}, [ isSelected, setActiveId, activeId, id ] );\n\n\treturn (\n\t\t<Composite.Item\n\t\t\trender={\n\t\t\t\t<Button\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\taria-selected={ !! isSelected }\n\t\t\t\t\tref={ forwardedRef }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tid={ id }\n\t\t/>\n\t);\n}\n\nconst OptionAsOption = forwardRef( UnforwardedOptionAsOption );\n\nexport function Option( {\n\tclassName,\n\tisSelected,\n\tselectedIconProps = {},\n\ttooltipText,\n\t...additionalProps\n}: OptionProps ) {\n\tconst { baseId, setActiveId } = useContext( CircularOptionPickerContext );\n\tconst id = useInstanceId(\n\t\tOption,\n\t\tbaseId || 'components-circular-option-picker__option'\n\t);\n\n\tconst commonProps = {\n\t\tid,\n\t\tclassName: 'components-circular-option-picker__option',\n\t\t...additionalProps,\n\t};\n\n\tconst isListbox = setActiveId !== undefined;\n\tconst optionControl = isListbox ? (\n\t\t<OptionAsOption { ...commonProps } isSelected={ isSelected } />\n\t) : (\n\t\t<OptionAsButton { ...commonProps } isPressed={ isSelected } />\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\tclassName,\n\t\t\t\t'components-circular-option-picker__option-wrapper'\n\t\t\t) }\n\t\t>\n\t\t\t{ tooltipText ? (\n\t\t\t\t<Tooltip text={ tooltipText }>{ optionControl }</Tooltip>\n\t\t\t) : (\n\t\t\t\toptionControl\n\t\t\t) }\n\t\t\t{ isSelected && <Icon icon={ check } { ...selectedIconProps } /> }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,4BAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAR,sBAAA,CAAAC,OAAA;AAAiC,IAAAQ,WAAA,GAAAR,OAAA;AAnBjC;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;;AAOA,SAASS,yBAAyBA,CACjCC,KAIC,EACDC,YAAiC,EAChC;EACD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAgB,CAAC,GAAGH,KAAK;EAC/C,oBACC,IAAAF,WAAA,CAAAM,GAAA,EAACT,OAAA,CAAAU,OAAM;IAAA,GACDF,eAAe;IACpB,gBAAeD,SAAW;IAC1BI,GAAG,EAAGL;EAAc,CACpB,CAAC;A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WAAW,GAAG;IACnBpB,EAAE;IACFe,SAAS,EAAE,2CAA2C;IACtD,GAAGtB;EACJ,CAAC;EAED,MAAM4B,SAAS,GAAGnB,WAAW,KAAKoB,SAAS;EAC3C,MAAMC,aAAa,GAAGF,SAAS,gBAC9B,IAAAjC,WAAA,CAAAM,GAAA,EAACmB,cAAc;IAAA,GAAMO,WAAW;IAAGnB,UAAU,EAAGA;EAAY,CAAE,CAAC,gBAE/D,IAAAb,WAAA,CAAAM,GAAA,EAACG,cAAc;IAAA,GAAMuB,WAAW;IAAG5B,SAAS,EAAGS;EAAY,CAAE,CAC7D;EAED,oBACC,IAAAb,WAAA,CAAAoC,IAAA;IACCT,SAAS,EAAG,IAAAU,aAAI,EACfV,SAAS,EACT,mDACD,CAAG;IAAAW,QAAA,GAEDT,WAAW,gBACZ,IAAA7B,WAAA,CAAAM,GAAA,EAACP,QAAA,CAAAQ,OAAO;MAACgC,IAAI,EAAGV,WAAa;MAAAS,QAAA,EAAGH;IAAa,CAAW,CAAC,GAEzDA,aACA,EACCtB,UAAU,iBAAI,IAAAb,WAAA,CAAAM,GAAA,EAACX,MAAA,CAAA6C,IAAI;MAACC,IAAI,EAAGC,YAAO;MAAA,GAAMd;IAAiB,CAAI,CAAC;EAAA,CAC5D,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_element","_icons","_circularOptionPickerContext","_button","_composite","_tooltip","_jsxRuntime","UnforwardedOptionAsButton","props","forwardedRef","isPressed","additionalProps","jsx","default","ref","OptionAsButton","forwardRef","UnforwardedOptionAsOption","id","isSelected","setActiveId","activeId","useContext","CircularOptionPickerContext","useEffect","window","setTimeout","Composite","Item","render","role","OptionAsOption","Option","className","selectedIconProps","tooltipText","baseId","useInstanceId","commonProps","__next40pxDefaultSize","isListbox","undefined","optionControl","jsxs","clsx","children","text","Icon","icon","check"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-option.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useContext, useEffect } from '@wordpress/element';\nimport { Icon, check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { CircularOptionPickerContext } from './circular-option-picker-context';\nimport Button from '../button';\nimport { Composite } from '../composite';\nimport Tooltip from '../tooltip';\nimport type { OptionProps } from './types';\n\nfunction UnforwardedOptionAsButton(\n\tprops: {\n\t\tid?: string;\n\t\tclassName?: string;\n\t\tisPressed?: boolean;\n\t},\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { isPressed, ...additionalProps } = props;\n\treturn (\n\t\t<Button\n\t\t\t{ ...additionalProps }\n\t\t\taria-pressed={ isPressed }\n\t\t\tref={ forwardedRef }\n\t\t/>\n\t);\n}\n\nconst OptionAsButton = forwardRef( UnforwardedOptionAsButton );\n\nfunction UnforwardedOptionAsOption(\n\tprops: {\n\t\tid: string;\n\t\tclassName?: string;\n\t\tisSelected?: boolean;\n\t},\n\tforwardedRef: ForwardedRef< any >\n) {\n\tconst { id, isSelected, ...additionalProps } = props;\n\n\tconst { setActiveId, activeId } = useContext( CircularOptionPickerContext );\n\n\tuseEffect( () => {\n\t\tif ( isSelected && ! activeId ) {\n\t\t\t// The setTimeout call is necessary to make sure that this update\n\t\t\t// doesn't get overridden by `Composite`'s internal logic, which picks\n\t\t\t// an initial active item if one is not specifically set.\n\t\t\twindow.setTimeout( () => setActiveId?.( id ), 0 );\n\t\t}\n\t}, [ isSelected, setActiveId, activeId, id ] );\n\n\treturn (\n\t\t<Composite.Item\n\t\t\trender={\n\t\t\t\t<Button\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\taria-selected={ !! isSelected }\n\t\t\t\t\tref={ forwardedRef }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tid={ id }\n\t\t/>\n\t);\n}\n\nconst OptionAsOption = forwardRef( UnforwardedOptionAsOption );\n\nexport function Option( {\n\tclassName,\n\tisSelected,\n\tselectedIconProps = {},\n\ttooltipText,\n\t...additionalProps\n}: OptionProps ) {\n\tconst { baseId, setActiveId } = useContext( CircularOptionPickerContext );\n\tconst id = useInstanceId(\n\t\tOption,\n\t\tbaseId || 'components-circular-option-picker__option'\n\t);\n\n\tconst commonProps = {\n\t\tid,\n\t\tclassName: 'components-circular-option-picker__option',\n\t\t__next40pxDefaultSize: true,\n\t\t...additionalProps,\n\t};\n\n\tconst isListbox = setActiveId !== undefined;\n\tconst optionControl = isListbox ? (\n\t\t<OptionAsOption { ...commonProps } isSelected={ isSelected } />\n\t) : (\n\t\t<OptionAsButton { ...commonProps } isPressed={ isSelected } />\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\tclassName,\n\t\t\t\t'components-circular-option-picker__option-wrapper'\n\t\t\t) }\n\t\t>\n\t\t\t{ tooltipText ? (\n\t\t\t\t<Tooltip text={ tooltipText }>{ optionControl }</Tooltip>\n\t\t\t) : (\n\t\t\t\toptionControl\n\t\t\t) }\n\t\t\t{ isSelected && <Icon icon={ check } { ...selectedIconProps } /> }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,4BAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAR,sBAAA,CAAAC,OAAA;AAAiC,IAAAQ,WAAA,GAAAR,OAAA;AAnBjC;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;;AAOA,SAASS,yBAAyBA,CACjCC,KAIC,EACDC,YAAiC,EAChC;EACD,MAA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AACS,CAAC,EAAG;EAChB,MAAM;IAAEyB,MAAM;IAAEhB;EAAY,CAAC,GAAG,IAAAE,mBAAU,EAAEC,wDAA4B,CAAC;EACzE,MAAML,EAAE,GAAG,IAAAmB,sBAAa,EACvBL,MAAM,EACNI,MAAM,IAAI,2CACX,CAAC;EAED,MAAME,WAAW,GAAG;IACnBpB,EAAE;IACFe,SAAS,EAAE,2CAA2C;IACtDM,qBAAqB,EAAE,IAAI;IAC3B,GAAG5B;EACJ,CAAC;EAED,MAAM6B,SAAS,GAAGpB,WAAW,KAAKqB,SAAS;EAC3C,MAAMC,aAAa,GAAGF,SAAS,gBAC9B,IAAAlC,WAAA,CAAAM,GAAA,EAACmB,cAAc;IAAA,GAAMO,WAAW;IAAGnB,UAAU,EAAGA;EAAY,CAAE,CAAC,gBAE/D,IAAAb,WAAA,CAAAM,GAAA,EAACG,cAAc;IAAA,GAAMuB,WAAW;IAAG5B,SAAS,EAAGS;EAAY,CAAE,CAC7D;EAED,oBACC,IAAAb,WAAA,CAAAqC,IAAA;IACCV,SAAS,EAAG,IAAAW,aAAI,EACfX,SAAS,EACT,mDACD,CAAG;IAAAY,QAAA,GAEDV,WAAW,gBACZ,IAAA7B,WAAA,CAAAM,GAAA,EAACP,QAAA,CAAAQ,OAAO;MAACiC,IAAI,EAAGX,WAAa;MAAAU,QAAA,EAAGH;IAAa,CAAW,CAAC,GAEzDA,aACA,EACCvB,UAAU,iBAAI,IAAAb,WAAA,CAAAM,GAAA,EAACX,MAAA,CAAA8C,IAAI;MAACC,IAAI,EAAGC,YAAO;MAAA,GAAMf;IAAiB,CAAI,CAAC;EAAA,CAC5D,CAAC;AAER","ignoreList":[]}
@@ -189,6 +189,8 @@ function UnforwardedColorPalette(props, forwardedRef) {
189
189
  };
190
190
  const actions = !!clearable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_circularOptionPicker.default.ButtonAction, {
191
191
  onClick: clearColor,
192
+ accessibleWhenDisabled: true,
193
+ disabled: !value,
192
194
  children: (0, _i18n.__)('Clear')
193
195
  });
194
196
  let metaProps;