@wordpress/components 28.12.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 (442) hide show
  1. package/CHANGELOG.md +45 -1
  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/types.js.map +1 -1
  14. package/build/box-control/all-input-control.js +1 -0
  15. package/build/box-control/all-input-control.js.map +1 -1
  16. package/build/box-control/axial-input-controls.js +1 -0
  17. package/build/box-control/axial-input-controls.js.map +1 -1
  18. package/build/box-control/index.js +13 -13
  19. package/build/box-control/index.js.map +1 -1
  20. package/build/box-control/input-controls.js +1 -0
  21. package/build/box-control/input-controls.js.map +1 -1
  22. package/build/box-control/types.js.map +1 -1
  23. package/build/circular-option-picker/circular-option-picker-actions.js +1 -0
  24. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  25. package/build/circular-option-picker/circular-option-picker-option.js +1 -0
  26. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  27. package/build/color-palette/index.js +2 -0
  28. package/build/color-palette/index.js.map +1 -1
  29. package/build/color-picker/color-copy-button.js +6 -4
  30. package/build/color-picker/color-copy-button.js.map +1 -1
  31. package/build/color-picker/component.js +1 -0
  32. package/build/color-picker/component.js.map +1 -1
  33. package/build/color-picker/styles.js +21 -28
  34. package/build/color-picker/styles.js.map +1 -1
  35. package/build/combobox-control/index.js +17 -12
  36. package/build/combobox-control/index.js.map +1 -1
  37. package/build/composite/hover.js +1 -1
  38. package/build/composite/hover.js.map +1 -1
  39. package/build/composite/typeahead.js +1 -1
  40. package/build/composite/typeahead.js.map +1 -1
  41. package/build/custom-gradient-picker/gradient-bar/control-points.js +2 -0
  42. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  43. package/build/dashicon/types.js.map +1 -1
  44. package/build/dimension-control/index.js +7 -0
  45. package/build/dimension-control/index.js.map +1 -1
  46. package/build/disabled/index.js +8 -1
  47. package/build/disabled/index.js.map +1 -1
  48. package/build/duotone-picker/duotone-picker.js +2 -0
  49. package/build/duotone-picker/duotone-picker.js.map +1 -1
  50. package/build/font-size-picker/font-size-picker-toggle-group.js +1 -0
  51. package/build/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  52. package/build/font-size-picker/index.js +7 -0
  53. package/build/font-size-picker/index.js.map +1 -1
  54. package/build/form-file-upload/index.js +3 -1
  55. package/build/form-file-upload/index.js.map +1 -1
  56. package/build/gradient-picker/index.js +34 -32
  57. package/build/gradient-picker/index.js.map +1 -1
  58. package/build/gradient-picker/types.js.map +1 -1
  59. package/build/icon/index.js +9 -0
  60. package/build/icon/index.js.map +1 -1
  61. package/build/menu/styles.js +16 -16
  62. package/build/menu/styles.js.map +1 -1
  63. package/build/modal/index.js +2 -2
  64. package/build/modal/index.js.map +1 -1
  65. package/build/private-apis.js +0 -2
  66. package/build/private-apis.js.map +1 -1
  67. package/build/range-control/index.js +11 -0
  68. package/build/range-control/index.js.map +1 -1
  69. package/build/range-control/types.js.map +1 -1
  70. package/build/slot-fill/bubbles-virtually/fill.js +14 -31
  71. package/build/slot-fill/bubbles-virtually/fill.js.map +1 -1
  72. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +13 -4
  73. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  74. package/build/slot-fill/bubbles-virtually/slot.js +11 -9
  75. package/build/slot-fill/bubbles-virtually/slot.js.map +1 -1
  76. package/build/slot-fill/bubbles-virtually/use-slot.js +1 -8
  77. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  78. package/build/slot-fill/fill.js +7 -24
  79. package/build/slot-fill/fill.js.map +1 -1
  80. package/build/slot-fill/index.js +5 -10
  81. package/build/slot-fill/index.js.map +1 -1
  82. package/build/slot-fill/provider.js +2 -2
  83. package/build/slot-fill/provider.js.map +1 -1
  84. package/build/slot-fill/slot.js +37 -77
  85. package/build/slot-fill/slot.js.map +1 -1
  86. package/build/slot-fill/types.js.map +1 -1
  87. package/build/text-control/index.js +7 -0
  88. package/build/text-control/index.js.map +1 -1
  89. package/build/toggle-group-control/toggle-group-control/component.js +9 -0
  90. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  91. package/build/toggle-group-control/toggle-group-control-option/component.js +1 -0
  92. package/build/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  93. package/build/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  94. package/build/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  95. package/build/toggle-group-control/types.js.map +1 -1
  96. package/build/utils/deprecated-36px-size.js +3 -2
  97. package/build/utils/deprecated-36px-size.js.map +1 -1
  98. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  99. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  100. package/build-module/border-box-control/border-box-control/component.js +1 -0
  101. package/build-module/border-box-control/border-box-control/component.js.map +1 -1
  102. package/build-module/border-box-control/border-box-control-split-controls/component.js +2 -1
  103. package/build-module/border-box-control/border-box-control-split-controls/component.js.map +1 -1
  104. package/build-module/border-control/border-control/component.js +2 -1
  105. package/build-module/border-control/border-control/component.js.map +1 -1
  106. package/build-module/border-control/border-control/hook.js +3 -1
  107. package/build-module/border-control/border-control/hook.js.map +1 -1
  108. package/build-module/border-control/types.js.map +1 -1
  109. package/build-module/box-control/all-input-control.js +1 -0
  110. package/build-module/box-control/all-input-control.js.map +1 -1
  111. package/build-module/box-control/axial-input-controls.js +1 -0
  112. package/build-module/box-control/axial-input-controls.js.map +1 -1
  113. package/build-module/box-control/index.js +13 -13
  114. package/build-module/box-control/index.js.map +1 -1
  115. package/build-module/box-control/input-controls.js +1 -0
  116. package/build-module/box-control/input-controls.js.map +1 -1
  117. package/build-module/box-control/types.js.map +1 -1
  118. package/build-module/circular-option-picker/circular-option-picker-actions.js +1 -0
  119. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  120. package/build-module/circular-option-picker/circular-option-picker-option.js +1 -0
  121. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  122. package/build-module/color-palette/index.js +2 -0
  123. package/build-module/color-palette/index.js.map +1 -1
  124. package/build-module/color-picker/color-copy-button.js +6 -4
  125. package/build-module/color-picker/color-copy-button.js.map +1 -1
  126. package/build-module/color-picker/component.js +1 -0
  127. package/build-module/color-picker/component.js.map +1 -1
  128. package/build-module/color-picker/styles.js +20 -27
  129. package/build-module/color-picker/styles.js.map +1 -1
  130. package/build-module/combobox-control/index.js +18 -13
  131. package/build-module/combobox-control/index.js.map +1 -1
  132. package/build-module/composite/hover.js +1 -1
  133. package/build-module/composite/hover.js.map +1 -1
  134. package/build-module/composite/typeahead.js +1 -1
  135. package/build-module/composite/typeahead.js.map +1 -1
  136. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +2 -0
  137. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  138. package/build-module/dashicon/types.js.map +1 -1
  139. package/build-module/dimension-control/index.js +7 -0
  140. package/build-module/dimension-control/index.js.map +1 -1
  141. package/build-module/disabled/index.js +8 -1
  142. package/build-module/disabled/index.js.map +1 -1
  143. package/build-module/duotone-picker/duotone-picker.js +2 -0
  144. package/build-module/duotone-picker/duotone-picker.js.map +1 -1
  145. package/build-module/font-size-picker/font-size-picker-toggle-group.js +1 -0
  146. package/build-module/font-size-picker/font-size-picker-toggle-group.js.map +1 -1
  147. package/build-module/font-size-picker/index.js +7 -0
  148. package/build-module/font-size-picker/index.js.map +1 -1
  149. package/build-module/form-file-upload/index.js +3 -1
  150. package/build-module/form-file-upload/index.js.map +1 -1
  151. package/build-module/gradient-picker/index.js +34 -32
  152. package/build-module/gradient-picker/index.js.map +1 -1
  153. package/build-module/gradient-picker/types.js.map +1 -1
  154. package/build-module/icon/index.js +9 -0
  155. package/build-module/icon/index.js.map +1 -1
  156. package/build-module/menu/styles.js +16 -16
  157. package/build-module/menu/styles.js.map +1 -1
  158. package/build-module/modal/index.js +2 -2
  159. package/build-module/modal/index.js.map +1 -1
  160. package/build-module/private-apis.js +0 -2
  161. package/build-module/private-apis.js.map +1 -1
  162. package/build-module/range-control/index.js +11 -0
  163. package/build-module/range-control/index.js.map +1 -1
  164. package/build-module/range-control/types.js.map +1 -1
  165. package/build-module/slot-fill/bubbles-virtually/fill.js +15 -32
  166. package/build-module/slot-fill/bubbles-virtually/fill.js.map +1 -1
  167. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +13 -4
  168. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  169. package/build-module/slot-fill/bubbles-virtually/slot.js +11 -9
  170. package/build-module/slot-fill/bubbles-virtually/slot.js.map +1 -1
  171. package/build-module/slot-fill/bubbles-virtually/use-slot.js +2 -9
  172. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  173. package/build-module/slot-fill/fill.js +7 -24
  174. package/build-module/slot-fill/fill.js.map +1 -1
  175. package/build-module/slot-fill/index.js +5 -8
  176. package/build-module/slot-fill/index.js.map +1 -1
  177. package/build-module/slot-fill/provider.js +2 -3
  178. package/build-module/slot-fill/provider.js.map +1 -1
  179. package/build-module/slot-fill/slot.js +38 -78
  180. package/build-module/slot-fill/slot.js.map +1 -1
  181. package/build-module/slot-fill/types.js.map +1 -1
  182. package/build-module/text-control/index.js +7 -0
  183. package/build-module/text-control/index.js.map +1 -1
  184. package/build-module/toggle-group-control/toggle-group-control/component.js +9 -0
  185. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  186. package/build-module/toggle-group-control/toggle-group-control-option/component.js +1 -0
  187. package/build-module/toggle-group-control/toggle-group-control-option/component.js.map +1 -1
  188. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js +1 -1
  189. package/build-module/toggle-group-control/toggle-group-control-option-icon/component.js.map +1 -1
  190. package/build-module/toggle-group-control/types.js.map +1 -1
  191. package/build-module/utils/deprecated-36px-size.js +3 -2
  192. package/build-module/utils/deprecated-36px-size.js.map +1 -1
  193. package/build-style/style-rtl.css +3 -10
  194. package/build-style/style.css +3 -10
  195. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  196. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  197. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  198. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  199. package/build-types/border-control/border-control/component.d.ts +1 -0
  200. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  201. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  202. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  203. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  204. package/build-types/border-control/stories/index.story.d.ts +10 -5
  205. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  206. package/build-types/border-control/types.d.ts +7 -0
  207. package/build-types/border-control/types.d.ts.map +1 -1
  208. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  209. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  210. package/build-types/box-control/index.d.ts +13 -13
  211. package/build-types/box-control/input-controls.d.ts.map +1 -1
  212. package/build-types/box-control/styles/box-control-styles.d.ts +2 -1
  213. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  214. package/build-types/box-control/types.d.ts +2 -0
  215. package/build-types/box-control/types.d.ts.map +1 -1
  216. package/build-types/checkbox-control/stories/index.story.d.ts.map +1 -1
  217. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  218. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  219. package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
  220. package/build-types/color-indicator/stories/index.story.d.ts.map +1 -1
  221. package/build-types/color-palette/index.d.ts.map +1 -1
  222. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  223. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  224. package/build-types/color-picker/component.d.ts.map +1 -1
  225. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  226. package/build-types/color-picker/styles.d.ts +2 -4
  227. package/build-types/color-picker/styles.d.ts.map +1 -1
  228. package/build-types/combobox-control/index.d.ts +1 -0
  229. package/build-types/combobox-control/index.d.ts.map +1 -1
  230. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  231. package/build-types/composite/typeahead.d.ts.map +1 -1
  232. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  233. package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
  234. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  235. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -1
  236. package/build-types/dashicon/types.d.ts +1 -1
  237. package/build-types/dashicon/types.d.ts.map +1 -1
  238. package/build-types/date-time/stories/date-time.story.d.ts.map +1 -1
  239. package/build-types/date-time/stories/date.story.d.ts.map +1 -1
  240. package/build-types/date-time/stories/time.story.d.ts.map +1 -1
  241. package/build-types/dimension-control/index.d.ts +1 -0
  242. package/build-types/dimension-control/index.d.ts.map +1 -1
  243. package/build-types/disabled/index.d.ts +8 -1
  244. package/build-types/disabled/index.d.ts.map +1 -1
  245. package/build-types/disabled/stories/index.story.d.ts.map +1 -1
  246. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  247. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  248. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  249. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  250. package/build-types/font-size-picker/index.d.ts.map +1 -1
  251. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  252. package/build-types/form-file-upload/index.d.ts.map +1 -1
  253. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  254. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  255. package/build-types/gradient-picker/index.d.ts +32 -32
  256. package/build-types/gradient-picker/index.d.ts.map +1 -1
  257. package/build-types/gradient-picker/stories/index.story.d.ts.map +1 -1
  258. package/build-types/gradient-picker/types.d.ts +1 -5
  259. package/build-types/gradient-picker/types.d.ts.map +1 -1
  260. package/build-types/h-stack/stories/index.story.d.ts.map +1 -1
  261. package/build-types/icon/index.d.ts +23 -7
  262. package/build-types/icon/index.d.ts.map +1 -1
  263. package/build-types/icon/stories/index.story.d.ts +7 -1
  264. package/build-types/icon/stories/index.story.d.ts.map +1 -1
  265. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  266. package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
  267. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  268. package/build-types/menu-items-choice/stories/index.story.d.ts.map +1 -1
  269. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  270. package/build-types/placeholder/stories/index.story.d.ts.map +1 -1
  271. package/build-types/private-apis.d.ts.map +1 -1
  272. package/build-types/radio-control/stories/index.story.d.ts.map +1 -1
  273. package/build-types/range-control/index.d.ts +3 -1
  274. package/build-types/range-control/index.d.ts.map +1 -1
  275. package/build-types/range-control/stories/index.story.d.ts.map +1 -1
  276. package/build-types/range-control/types.d.ts +7 -0
  277. package/build-types/range-control/types.d.ts.map +1 -1
  278. package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
  279. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  280. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  281. package/build-types/slot-fill/bubbles-virtually/fill.d.ts +1 -1
  282. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  283. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  284. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  285. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts +1 -1
  286. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
  287. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts +3 -7
  288. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  289. package/build-types/slot-fill/fill.d.ts.map +1 -1
  290. package/build-types/slot-fill/index.d.ts +5 -12
  291. package/build-types/slot-fill/index.d.ts.map +1 -1
  292. package/build-types/slot-fill/provider.d.ts.map +1 -1
  293. package/build-types/slot-fill/slot.d.ts +1 -1
  294. package/build-types/slot-fill/slot.d.ts.map +1 -1
  295. package/build-types/slot-fill/types.d.ts +15 -18
  296. package/build-types/slot-fill/types.d.ts.map +1 -1
  297. package/build-types/slot-fill/use-slot.d.ts +1 -1
  298. package/build-types/slot-fill/use-slot.d.ts.map +1 -1
  299. package/build-types/text-control/index.d.ts +1 -0
  300. package/build-types/text-control/index.d.ts.map +1 -1
  301. package/build-types/text-control/stories/index.story.d.ts.map +1 -1
  302. package/build-types/textarea-control/stories/index.story.d.ts.map +1 -1
  303. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  304. package/build-types/toggle-group-control/stories/index.story.d.ts.map +1 -1
  305. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +2 -0
  306. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  307. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -0
  308. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  309. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  310. package/build-types/toggle-group-control/types.d.ts +7 -0
  311. package/build-types/toggle-group-control/types.d.ts.map +1 -1
  312. package/build-types/tools-panel/stories/index.story.d.ts.map +1 -1
  313. package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
  314. package/build-types/unit-control/stories/index.story.d.ts.map +1 -1
  315. package/build-types/utils/deprecated-36px-size.d.ts +2 -1
  316. package/build-types/utils/deprecated-36px-size.d.ts.map +1 -1
  317. package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
  318. package/package.json +2 -2
  319. package/src/autocomplete/autocompleter-ui.tsx +1 -0
  320. package/src/base-control/stories/index.story.tsx +2 -1
  321. package/src/border-box-control/border-box-control/component.tsx +1 -0
  322. package/src/border-box-control/border-box-control-split-controls/component.tsx +1 -0
  323. package/src/border-control/border-control/component.tsx +1 -0
  324. package/src/border-control/border-control/hook.ts +2 -0
  325. package/src/border-control/types.ts +7 -0
  326. package/src/box-control/README.md +79 -60
  327. package/src/box-control/all-input-control.tsx +1 -0
  328. package/src/box-control/axial-input-controls.tsx +1 -0
  329. package/src/box-control/docs-manifest.json +5 -0
  330. package/src/box-control/index.tsx +13 -13
  331. package/src/box-control/input-controls.tsx +1 -0
  332. package/src/box-control/types.ts +2 -0
  333. package/src/checkbox-control/stories/index.story.tsx +2 -1
  334. package/src/circular-option-picker/circular-option-picker-actions.tsx +1 -0
  335. package/src/circular-option-picker/circular-option-picker-option.tsx +1 -0
  336. package/src/circular-option-picker/stories/index.story.tsx +2 -1
  337. package/src/circular-option-picker/style.scss +2 -2
  338. package/src/color-indicator/stories/index.story.tsx +2 -1
  339. package/src/color-palette/index.tsx +5 -1
  340. package/src/color-palette/stories/index.story.tsx +2 -1
  341. package/src/color-picker/color-copy-button.tsx +8 -10
  342. package/src/color-picker/component.tsx +1 -0
  343. package/src/color-picker/stories/index.story.tsx +2 -1
  344. package/src/color-picker/styles.ts +0 -13
  345. package/src/combobox-control/README.md +1 -0
  346. package/src/combobox-control/index.tsx +19 -13
  347. package/src/combobox-control/stories/index.story.tsx +3 -1
  348. package/src/combobox-control/style.scss +0 -6
  349. package/src/combobox-control/test/index.tsx +7 -1
  350. package/src/composite/hover.tsx +1 -1
  351. package/src/composite/typeahead.tsx +3 -1
  352. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +2 -0
  353. package/src/custom-gradient-picker/stories/index.story.tsx +2 -1
  354. package/src/custom-gradient-picker/style.scss +1 -1
  355. package/src/custom-select-control/stories/index.story.tsx +2 -1
  356. package/src/custom-select-control-v2/stories/index.story.tsx +2 -1
  357. package/src/dashicon/types.ts +0 -2
  358. package/src/date-time/stories/date-time.story.tsx +2 -1
  359. package/src/date-time/stories/date.story.tsx +2 -1
  360. package/src/date-time/stories/time.story.tsx +2 -1
  361. package/src/dimension-control/README.md +1 -0
  362. package/src/dimension-control/index.tsx +8 -0
  363. package/src/dimension-control/stories/index.story.tsx +1 -0
  364. package/src/dimension-control/test/__snapshots__/index.test.js.snap +24 -24
  365. package/src/dimension-control/test/index.test.js +7 -1
  366. package/src/disabled/README.md +9 -7
  367. package/src/disabled/index.tsx +8 -1
  368. package/src/disabled/stories/index.story.tsx +1 -0
  369. package/src/drop-zone/stories/index.story.tsx +2 -1
  370. package/src/dropdown-menu/stories/index.story.tsx +2 -1
  371. package/src/duotone-picker/duotone-picker.tsx +2 -0
  372. package/src/font-size-picker/README.md +1 -0
  373. package/src/font-size-picker/font-size-picker-toggle-group.tsx +1 -0
  374. package/src/font-size-picker/index.tsx +8 -0
  375. package/src/font-size-picker/stories/index.story.tsx +1 -0
  376. package/src/font-size-picker/test/index.tsx +5 -1
  377. package/src/form-file-upload/index.tsx +9 -3
  378. package/src/form-file-upload/stories/index.story.tsx +2 -1
  379. package/src/form-token-field/stories/index.story.tsx +2 -1
  380. package/src/gradient-picker/README.md +107 -69
  381. package/src/gradient-picker/docs-manifest.json +5 -0
  382. package/src/gradient-picker/index.tsx +34 -32
  383. package/src/gradient-picker/stories/index.story.tsx +2 -1
  384. package/src/gradient-picker/types.ts +3 -5
  385. package/src/h-stack/stories/index.story.tsx +2 -1
  386. package/src/higher-order/with-constrained-tabbing/README.md +13 -3
  387. package/src/higher-order/with-focus-return/README.md +9 -2
  388. package/src/icon/README.md +22 -65
  389. package/src/icon/docs-manifest.json +5 -0
  390. package/src/icon/index.tsx +28 -13
  391. package/src/icon/stories/index.story.tsx +50 -8
  392. package/src/input-control/stories/index.story.tsx +2 -1
  393. package/src/menu/styles.ts +1 -1
  394. package/src/menu-group/stories/index.story.tsx +2 -1
  395. package/src/menu-item/stories/index.story.tsx +2 -1
  396. package/src/menu-items-choice/stories/index.story.tsx +2 -1
  397. package/src/modal/index.tsx +2 -2
  398. package/src/modal/stories/index.story.tsx +1 -1
  399. package/src/number-control/stories/index.story.tsx +2 -1
  400. package/src/placeholder/stories/index.story.tsx +1 -0
  401. package/src/private-apis.ts +0 -2
  402. package/src/radio-control/stories/index.story.tsx +2 -1
  403. package/src/range-control/README.md +4 -3
  404. package/src/range-control/index.tsx +11 -0
  405. package/src/range-control/stories/index.story.tsx +9 -1
  406. package/src/range-control/test/index.tsx +7 -1
  407. package/src/range-control/types.ts +7 -0
  408. package/src/responsive-wrapper/stories/index.story.tsx +2 -1
  409. package/src/search-control/stories/index.story.tsx +2 -1
  410. package/src/select-control/stories/index.story.tsx +2 -1
  411. package/src/slot-fill/README.md +26 -15
  412. package/src/slot-fill/bubbles-virtually/fill.tsx +18 -28
  413. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +26 -16
  414. package/src/slot-fill/bubbles-virtually/slot.tsx +13 -9
  415. package/src/slot-fill/bubbles-virtually/use-slot.ts +3 -26
  416. package/src/slot-fill/fill.ts +7 -22
  417. package/src/slot-fill/index.tsx +5 -7
  418. package/src/slot-fill/provider.tsx +8 -17
  419. package/src/slot-fill/slot.tsx +48 -85
  420. package/src/slot-fill/types.ts +14 -51
  421. package/src/text-control/README.md +1 -0
  422. package/src/text-control/index.tsx +8 -0
  423. package/src/text-control/stories/index.story.tsx +3 -1
  424. package/src/text-control/test/text-control.tsx +7 -1
  425. package/src/textarea-control/stories/index.story.tsx +2 -1
  426. package/src/toggle-control/stories/index.story.tsx +2 -1
  427. package/src/toggle-group-control/stories/index.story.tsx +3 -1
  428. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +12 -12
  429. package/src/toggle-group-control/test/index.tsx +7 -1
  430. package/src/toggle-group-control/toggle-group-control/README.md +2 -1
  431. package/src/toggle-group-control/toggle-group-control/component.tsx +10 -0
  432. package/src/toggle-group-control/toggle-group-control-option/README.md +1 -1
  433. package/src/toggle-group-control/toggle-group-control-option/component.tsx +1 -0
  434. package/src/toggle-group-control/toggle-group-control-option-icon/README.md +1 -1
  435. package/src/toggle-group-control/toggle-group-control-option-icon/component.tsx +1 -1
  436. package/src/toggle-group-control/types.ts +7 -0
  437. package/src/tools-panel/stories/index.story.tsx +3 -0
  438. package/src/tree-select/stories/index.story.tsx +2 -1
  439. package/src/unit-control/stories/index.story.tsx +2 -1
  440. package/src/utils/deprecated-36px-size.ts +3 -0
  441. package/src/v-stack/stories/index.story.tsx +2 -1
  442. package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,51 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 28.13.0 (2024-11-27)
6
+
7
+ ### Deprecations
8
+
9
+ - `DimensionControl`: Deprecate 36px default size ([#66705](https://github.com/WordPress/gutenberg/pull/66705)).
10
+ - `TextControl`: Deprecate 36px default size ([#66745](https://github.com/WordPress/gutenberg/pull/66745).
11
+ - `FontSizePicker`: Deprecate 36px default size ([#66920](https://github.com/WordPress/gutenberg/pull/66920)).
12
+ - `ComboboxControl`: Deprecate 36px default size ([#66900](https://github.com/WordPress/gutenberg/pull/66900)).
13
+ - `ToggleGroupControl`: Deprecate 36px default size ([#66747](https://github.com/WordPress/gutenberg/pull/66747)).
14
+ - `RangeControl`: Deprecate 36px default size ([#66721](https://github.com/WordPress/gutenberg/pull/66721)).
15
+
16
+ ### Bug Fixes
17
+
18
+ - `Modal`: Modal: Increase size of the Close button ([#66792](https://github.com/WordPress/gutenberg/pull/66792)).
19
+ - `ToggleGroupControl`: Fix active background for `0` value ([#66855](https://github.com/WordPress/gutenberg/pull/66855)).
20
+ - `SlotFill`: Fix a bug where a stale value of `fillProps` could be used ([#67000](https://github.com/WordPress/gutenberg/pull/67000)).
21
+ - `ColorPalette`: Disable `Clear` button if there's no color value. ([#67108](https://github.com/WordPress/gutenberg/pull/67108)).
22
+ - `GradientPicker`: Disable `Clear` button if there's no value. ([#67108](https://github.com/WordPress/gutenberg/pull/67108)).
23
+ - `DuotonePicker`: Disable `Clear` button if there's no value. ([#67108](https://github.com/WordPress/gutenberg/pull/67108)).
24
+ - `ColorPicker`: Add accessible label for copy button ([#67094](https://github.com/WordPress/gutenberg/pull/67094)).
25
+ - `FormFileUpload`: Prevent HEIC and HEIF files from being uploaded on Safari ([#67139](https://github.com/WordPress/gutenberg/pull/67139)).
26
+ - `Composite.Hover`: Restore functionality ([#67212](https://github.com/WordPress/gutenberg/pull/67212)).
27
+ - `Composite.Typeahead`: Restore functionality ([#67212](https://github.com/WordPress/gutenberg/pull/67212)).
28
+ - `Dashicons`: Remove non-existent icons from type ([#67235](https://github.com/WordPress/gutenberg/pull/67235)).
29
+
30
+ ### Enhancements
31
+
32
+ - `ColorPicker`: Update sizes of color format select and copy button ([#67093](https://github.com/WordPress/gutenberg/pull/67093)).
33
+ - `ComboboxControl`: Update reset button size ([#67215](https://github.com/WordPress/gutenberg/pull/67215)).
34
+ - `Autocomplete`: Increase option height ([#67214](https://github.com/WordPress/gutenberg/pull/67214)).
35
+ - `CircularOptionPicker`: Update `Button` sizes to be ready for 40px default size ([#67285](https://github.com/WordPress/gutenberg/pull/67285)).
36
+
37
+ ### Experimental
38
+
39
+ - `SlotFill`: Remove registration API methods from return value of `__experimentalUseSlot` ([#67070](https://github.com/WordPress/gutenberg/pull/67070)).
40
+ - `SlotFill`: Remove the `createPrivateSlotFill` private API ([#67238](https://github.com/WordPress/gutenberg/pull/67238)).
41
+
42
+ ### Internal
43
+
44
+ - `SlotFill`: fix dependencies of `Fill` registration effects ([#67071](https://github.com/WordPress/gutenberg/pull/67071)).
45
+ - `SlotFill`: rewrite the `Slot` component from class component to functional ([#67153](https://github.com/WordPress/gutenberg/pull/67153)).
46
+ - `Menu.ItemHelpText`: Fix text wrapping to prevent unintended word breaks ([#67011](https://github.com/WordPress/gutenberg/pull/67011)).
47
+ - `BorderBoxControl`: Suppress redundant warnings for deprecated 36px size ([#67213](https://github.com/WordPress/gutenberg/pull/67213)).
48
+ - `CustomGradientPicker`: Prepare `Button`s for 40px default size ([#67286](https://github.com/WordPress/gutenberg/pull/67286)).
49
+
5
50
  ## 28.12.0 (2024-11-16)
6
51
 
7
52
  ### Deprecations
@@ -11,7 +56,6 @@
11
56
  ### Bug Fixes
12
57
 
13
58
  - `Popover`: Fix missing label of the headerTitle Close button ([#66813](https://github.com/WordPress/gutenberg/pull/66813)).
14
- - `ToggleGroupControl`: Fix active background for `0` value ([#66855](https://github.com/WordPress/gutenberg/pull/66855)).
15
59
 
16
60
  ### Enhancements
17
61
 
package/CONTRIBUTING.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Thank you for taking the time to contribute.
4
4
 
5
- The following is a set of guidelines for contributing to the `@wordpress/components` package to be considered in addition to the general ones described in our [Contributing Policy](/CONTRIBUTING.md).
5
+ The following is a set of guidelines for contributing to the `@wordpress/components` package to be considered in addition to the general ones described in our [Contributing Policy](https://github.com/WordPress/gutenberg/blob/HEAD/CONTRIBUTING.md).
6
6
 
7
7
  This set of guidelines should apply especially to newly introduced components. In fact, while these guidelines should also be retroactively applied to existing components, it is sometimes impossible to do so for legacy/compatibility reasons.
8
8
 
@@ -36,7 +36,7 @@ To determine if a component should be added, ask yourself:
36
36
 
37
37
  Here’s a flowchart that can help determine if a new component is necessary:
38
38
 
39
- [![New component flowchart](https://wordpress.org/gutenberg/files/2019/07/New_component_flowchart.png)](https://coggle.it/diagram/WtUSrld3uAYZHsn-/t/new-ui-component/992b38cbe685d897b4aec6d0dd93cc4b47c06e0d4484eeb0d7d9a47fb2c48d94)
39
+ ![New component flowchart](https://wordpress.org/gutenberg/files/2019/07/New_component_flowchart.png)
40
40
 
41
41
  ### First steps
42
42
 
@@ -95,12 +95,12 @@ In these situations, one possible approach is to "soft-deprecate" a given legacy
95
95
  2. Updating all places in Gutenberg that use that API.
96
96
  3. Adding deprecation warnings (only after the previous point is completed, otherwise the Browser Console will be polluted by all those warnings and some e2e tests may fail).
97
97
 
98
- When adding new components or new props to existing components, it's recommended to create a [private version](/packages/private-apis/README.md)) of the component until the changes are stable enough to be exposed as part of the public API.
98
+ When adding new components or new props to existing components, it's recommended to create a [private version](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-private-apis/) of the component until the changes are stable enough to be exposed as part of the public API.
99
99
 
100
100
  ### Learn more
101
101
 
102
- - [How to preserve backward compatibility for a React Component](/docs/contributors/code/backward-compatibility.md#how-to-preserve-backward-compatibility-for-a-react-component)
103
- - [Experimental and Unstable APIs](/docs/contributors/code/coding-guidelines.md#legacy-experimental-apis-plugin-only-apis-and-private-apis)
102
+ - [How to preserve backward compatibility for a React Component](https://developer.wordpress.org/block-editor/contributors/code/backward-compatibility/#how-to-preserve-backward-compatibility-for-a-react-component)
103
+ - [Experimental and Unstable APIs](https://developer.wordpress.org/block-editor/contributors/code/coding-guidelines/#legacy-experimental-apis-plugin-only-apis-and-private-apis)
104
104
  - [Deprecating styles](#deprecating-styles)
105
105
 
106
106
  <!-- ## Polymorphic Components (i.e. the `as` prop)
@@ -216,8 +216,8 @@ function Example(
216
216
 
217
217
  A couple of good examples of how hooks are used for composition are:
218
218
 
219
- - the `Card` component, which builds on top of the `Surface` component by [calling the `useSurface` hook inside its own hook](/packages/components/src/card/card/hook.ts);
220
- - the `HStack` component, which builds on top of the `Flex` component and [calls the `useFlex` hook inside its own hook](/packages/components/src/h-stack/hook.tsx).
219
+ - the `Card` component, which builds on top of the `Surface` component by [calling the `useSurface` hook inside its own hook](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/card/card/hook.ts);
220
+ - the `HStack` component, which builds on top of the `Flex` component and [calls the `useFlex` hook inside its own hook](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/h-stack/hook.tsx).
221
221
 
222
222
  <!-- ## API Consinstency
223
223
 
@@ -418,7 +418,7 @@ On the component's main named export, add a JSDoc comment that includes the main
418
418
 
419
419
  All new component should be styled using [Emotion](https://emotion.sh/docs/introduction).
420
420
 
421
- Note: Instead of using Emotion's standard `cx` function, the custom [`useCx` hook](/packages/components/src/utils/hooks/use-cx.ts) should be used instead.
421
+ Note: Instead of using Emotion's standard `cx` function, the custom [`useCx` hook](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/utils/hooks/use-cx.ts) should be used instead.
422
422
 
423
423
  ### Deprecating styles
424
424
 
@@ -462,7 +462,7 @@ export const Wrapper = styled.div`
462
462
 
463
463
  Once deprecated, code examples in docs/stories should include the opt-in prop set to `true` so that new consumers are encouraged to adopt it from the start.
464
464
 
465
- Remember to [add a **Needs Dev Note** label](/docs/contributors/code/backward-compatibility.md##dev-notes) to the pull request so third-party developers can be informed of the deprecation.
465
+ Remember to [add a **Needs Dev Note** label](https://developer.wordpress.org/block-editor/contributors/code/backward-compatibility/#dev-notes) to the pull request so third-party developers can be informed of the deprecation.
466
466
 
467
467
  When the grace period is over and the deprecation version arrives, the `__next*` prop, deprecation notice, and deprecated styles should all be completely removed from the codebase.
468
468
 
@@ -491,7 +491,7 @@ Components can use this system via a couple of functions:
491
491
  - they can connect to the Context via `contextConnect`
492
492
  - they can read the "computed" values from the context via `useContextSystem`
493
493
 
494
- An example of how this is used can be found in the [`Card` component family](/packages/components/src/card). For example, this is how the `Card` component injects the `size` and `isBorderless` props down to its `CardBody` subcomponent — which makes it use the correct spacing and border settings "auto-magically".
494
+ An example of how this is used can be found in the [`Card` component family](https://github.com/WordPress/gutenberg/tree/trunk/packages/components/src/card). For example, this is how the `Card` component injects the `size` and `isBorderless` props down to its `CardBody` subcomponent — which makes it use the correct spacing and border settings "auto-magically".
495
495
 
496
496
  ```jsx
497
497
  //=========================================================================
@@ -564,7 +564,7 @@ export function useCardBody( props ) {
564
564
 
565
565
  ## Unit tests
566
566
 
567
- Please refer to the [JavaScript Testing Overview docs](/docs/contributors/code/testing-overview.md#snapshot-testing).
567
+ Please refer to the [JavaScript Testing Overview docs](https://developer.wordpress.org/block-editor/contributors/code/testing-overview/#snapshot-testing).
568
568
 
569
569
  ## Storybook
570
570
 
@@ -596,13 +596,13 @@ Primary.args = {
596
596
 
597
597
  A great tool to use when writing stories is the [Storybook Controls addon](https://storybook.js.org/addons/@storybook/addon-controls). Ideally props should be exposed by using this addon, which provides a graphical UI to interact dynamically with the component without needing to write code. Historically, we used [Knobs](https://storybook.js.org/addons/@storybook/addon-knobs), but it was deprecated and later removed in [#47152](https://github.com/WordPress/gutenberg/pull/47152).
598
598
 
599
- The default value of each control should coincide with the default value of the props (i.e. it should be `undefined` if a prop is not required). A story should, therefore, also explicitly show how values from the Context System are applied to (sub)components. A good example of how this may look like is the [`Card` story](https://wordpress.github.io/gutenberg/?path=/story/components-card--default) (code [here](/packages/components/src/card/stories/index.tsx)).
599
+ The default value of each control should coincide with the default value of the props (i.e. it should be `undefined` if a prop is not required). A story should, therefore, also explicitly show how values from the Context System are applied to (sub)components. A good example of how this may look like is the [`Card` story](https://wordpress.github.io/gutenberg/?path=/story/components-card--default) (code [here](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/card/stories/index.story.tsx)).
600
600
 
601
601
  Storybook can be started on a local machine by running `npm run storybook:dev`. Alternatively, the components' catalogue (up to date with the latest code on `trunk`) can be found at [wordpress.github.io/gutenberg/](https://wordpress.github.io/gutenberg/).
602
602
 
603
603
  ## Documentation
604
604
 
605
- All components, in addition to being typed, should be using JSDoc when necessary — as explained in the [Coding Guidelines](/docs/contributors/code/coding-guidelines.md#javascript-documentation-using-jsdoc).
605
+ All components, in addition to being typed, should be using JSDoc when necessary — as explained in the [Coding Guidelines](https://developer.wordpress.org/block-editor/contributors/code/coding-guidelines/#javascript-documentation-using-jsdoc).
606
606
 
607
607
  Each component that is exported from the `@wordpress/components` package should include a `README.md` file, explaining how to use the component, showing examples, and documenting all the props.
608
608
 
@@ -625,7 +625,7 @@ Description of the component.
625
625
 
626
626
  ## Usage
627
627
 
628
- Code example using correct markdown syntax and formatted using project's formatting rules. See [ItemGroup](/packages/components/src/item-group/item-group/README.md#usage) for a real-world example.
628
+ Code example using correct markdown syntax and formatted using project's formatting rules. See [ItemGroup](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/item-group/item-group/README.md) for a real-world example.
629
629
 
630
630
  ```jsx
631
631
  import { ExampleComponent } from '@wordpress/components';
@@ -653,13 +653,13 @@ Prop description. With a new line before and after the description and before an
653
653
 
654
654
  ### Inherited props
655
655
 
656
- Add this section when there are props that are drilled down into an internal component. See [ClipboardButton](/packages/components/src/clipboard-button/README.md) for an example.
656
+ Add this section when there are props that are drilled down into an internal component. See [ClipboardButton](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/clipboard-button/README.md) for an example.
657
657
 
658
658
  <!-- Only add the next section if the component relies on the [Context System](#context-system) -->
659
659
 
660
660
  ## Context
661
661
 
662
- See examples for this section for the [ItemGroup](/packages/components/src/item-group/item-group/README.md#context) and [`Card`](/packages/components/src/card/card/README.md#context) components.
662
+ See examples for this section for the [ItemGroup](https://github.com/WordPress/gutenberg/blob/trunk/packages/components/src/item-group/item-group/README.md#context) and [`Card`](https://github.com/WordPress/gutenberg/tree/trunk/packages/components/src/card/card#context) components.
663
663
  ````
664
664
 
665
665
  ## Folder structure
@@ -45,6 +45,7 @@ function ListBox({
45
45
  children: items.map((option, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
46
46
  id: `components-autocomplete-item-${instanceId}-${option.key}`,
47
47
  role: "option",
48
+ __next40pxDefaultSize: true,
48
49
  "aria-selected": index === selectedIndex,
49
50
  accessibleWhenDisabled: true,
50
51
  disabled: option.isDisabled,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_richText","_compose","_a11y","_i18n","_getDefaultUseItems","_button","_popover","_visuallyHidden","_reactDom","_jsxRuntime","ListBox","items","onSelect","selectedIndex","instanceId","listBoxId","className","Component","jsx","id","role","children","map","option","index","default","key","accessibleWhenDisabled","disabled","isDisabled","clsx","variant","undefined","onClick","label","getAutoCompleterUI","autocompleter","_autocompleter$useIte","useItems","getDefaultUseItems","AutocompleterUI","filterValue","onChangeOptions","onReset","reset","contentRef","popoverAnchor","useAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","useState","popoverRef","useRef","popoverRefs","useMergeRefs","useRefEffect","node","ownerDocument","useOnClickOutside","debouncedSpeak","useDebounce","speak","announce","options","length","sprintf","_n","__","useLayoutEffect","jsxs","Fragment","focusOnMount","onClose","placement","anchor","ref","createPortal","VisuallyHidden","body","handler","useEffect","listener","event","contains","target","document","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useAnchor } from '@wordpress/rich-text';\nimport { useDebounce, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport getDefaultUseItems from './get-default-use-items';\nimport Button from '../button';\nimport Popover from '../popover';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { createPortal } from 'react-dom';\nimport type { AutocompleterUIProps, KeyedOption, WPCompleter } from './types';\n\ntype ListBoxProps = {\n\titems: KeyedOption[];\n\tonSelect: ( option: KeyedOption ) => void;\n\tselectedIndex: number;\n\tinstanceId: number;\n\tlistBoxId: string | undefined;\n\tclassName?: string;\n\tComponent?: React.ElementType;\n};\n\nfunction ListBox( {\n\titems,\n\tonSelect,\n\tselectedIndex,\n\tinstanceId,\n\tlistBoxId,\n\tclassName,\n\tComponent = 'div',\n}: ListBoxProps ) {\n\treturn (\n\t\t<Component\n\t\t\tid={ listBoxId }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"components-autocomplete__results\"\n\t\t>\n\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t<Button\n\t\t\t\t\tkey={ option.key }\n\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Unused, for backwards compatibility.\n\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tvariant={ index === selectedIndex ? 'primary' : undefined }\n\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t>\n\t\t\t\t\t{ option.label }\n\t\t\t\t</Button>\n\t\t\t) ) }\n\t\t</Component>\n\t);\n}\n\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems =\n\t\tautocompleter.useItems ?? getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tinstanceId,\n\t\tlistBoxId,\n\t\tclassName,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tonReset,\n\t\treset,\n\t\tcontentRef,\n\t}: AutocompleterUIProps ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst popoverAnchor = useAnchor( {\n\t\t\teditableContentElement: contentRef.current,\n\t\t} );\n\n\t\tconst [ needsA11yCompat, setNeedsA11yCompat ] = useState( false );\n\t\tconst popoverRef = useRef< HTMLElement >( null );\n\t\tconst popoverRefs = useMergeRefs( [\n\t\t\tpopoverRef,\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tif ( ! contentRef.current ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the popover is rendered in a different document than\n\t\t\t\t\t// the content, we need to duplicate the options list in the\n\t\t\t\t\t// content document so that it's available to the screen\n\t\t\t\t\t// readers, which check the DOM ID based aria-* attributes.\n\t\t\t\t\tsetNeedsA11yCompat(\n\t\t\t\t\t\tnode.ownerDocument !== contentRef.current.ownerDocument\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t[ contentRef ]\n\t\t\t),\n\t\t] );\n\n\t\tuseOnClickOutside( popoverRef, reset );\n\n\t\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\t\tfunction announce( options: Array< KeyedOption > ) {\n\t\t\tif ( ! debouncedSpeak ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !! options.length ) {\n\t\t\t\tif ( filterValue ) {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t\t}\n\t\t}\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tannounce( items );\n\t\t\t// We want to avoid introducing unexpected side effects.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t}, [ items ] );\n\n\t\tif ( items.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tonClose={ onReset }\n\t\t\t\t\tplacement=\"top-start\"\n\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tref={ popoverRefs }\n\t\t\t\t>\n\t\t\t\t\t<ListBox\n\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{ contentRef.current &&\n\t\t\t\t\tneedsA11yCompat &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<ListBox\n\t\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tComponent={ VisuallyHidden }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\tcontentRef.current.ownerDocument.body\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nfunction useOnClickOutside(\n\tref: React.RefObject< HTMLElement >,\n\thandler: AutocompleterUIProps[ 'reset' ]\n) {\n\tuseEffect( () => {\n\t\tconst listener = ( event: MouseEvent | TouchEvent ) => {\n\t\t\t// Do nothing if clicking ref's element or descendent elements, or if the ref is not referencing an element\n\t\t\tif (\n\t\t\t\t! ref.current ||\n\t\t\t\tref.current.contains( event.target as Node )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandler( event );\n\t\t};\n\t\tdocument.addEventListener( 'mousedown', listener );\n\t\tdocument.addEventListener( 'touchstart', listener );\n\t\treturn () => {\n\t\t\tdocument.removeEventListener( 'mousedown', listener );\n\t\t\tdocument.removeEventListener( 'touchstart', listener );\n\t\t};\n\t}, [ handler, ref ] );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,OAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,QAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AAAyC,IAAAW,WAAA,GAAAX,OAAA;AA1BzC;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;;AAkBA,SAASY,OAAOA,CAAE;EACjBC,KAAK;EACLC,QAAQ;EACRC,aAAa;EACbC,UAAU;EACVC,SAAS;EACTC,SAAS;EACTC,SAAS,GAAG;AACC,CAAC,EAAG;EAC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iB,GAAmC,EACnCI,OAAwC,EACvC;EACD,IAAAC,kBAAS,EAAE,MAAM;IAChB,MAAMC,QAAQ,GAAKC,KAA8B,IAAM;MACtD;MACA,IACC,CAAEP,GAAG,CAAC5B,OAAO,IACb4B,GAAG,CAAC5B,OAAO,CAACoC,QAAQ,CAAED,KAAK,CAACE,MAAe,CAAC,EAC3C;QACD;MACD;MACAL,OAAO,CAAEG,KAAM,CAAC;IACjB,CAAC;IACDG,QAAQ,CAACC,gBAAgB,CAAE,WAAW,EAAEL,QAAS,CAAC;IAClDI,QAAQ,CAACC,gBAAgB,CAAE,YAAY,EAAEL,QAAS,CAAC;IACnD,OAAO,MAAM;MACZI,QAAQ,CAACE,mBAAmB,CAAE,WAAW,EAAEN,QAAS,CAAC;MACrDI,QAAQ,CAACE,mBAAmB,CAAE,YAAY,EAAEN,QAAS,CAAC;IACvD,CAAC;EACF,CAAC,EAAE,CAAEF,OAAO,EAAEJ,GAAG,CAAG,CAAC;AACtB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_richText","_compose","_a11y","_i18n","_getDefaultUseItems","_button","_popover","_visuallyHidden","_reactDom","_jsxRuntime","ListBox","items","onSelect","selectedIndex","instanceId","listBoxId","className","Component","jsx","id","role","children","map","option","index","default","key","__next40pxDefaultSize","accessibleWhenDisabled","disabled","isDisabled","clsx","variant","undefined","onClick","label","getAutoCompleterUI","autocompleter","_autocompleter$useIte","useItems","getDefaultUseItems","AutocompleterUI","filterValue","onChangeOptions","onReset","reset","contentRef","popoverAnchor","useAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","useState","popoverRef","useRef","popoverRefs","useMergeRefs","useRefEffect","node","ownerDocument","useOnClickOutside","debouncedSpeak","useDebounce","speak","announce","options","length","sprintf","_n","__","useLayoutEffect","jsxs","Fragment","focusOnMount","onClose","placement","anchor","ref","createPortal","VisuallyHidden","body","handler","useEffect","listener","event","contains","target","document","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useAnchor } from '@wordpress/rich-text';\nimport { useDebounce, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport getDefaultUseItems from './get-default-use-items';\nimport Button from '../button';\nimport Popover from '../popover';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { createPortal } from 'react-dom';\nimport type { AutocompleterUIProps, KeyedOption, WPCompleter } from './types';\n\ntype ListBoxProps = {\n\titems: KeyedOption[];\n\tonSelect: ( option: KeyedOption ) => void;\n\tselectedIndex: number;\n\tinstanceId: number;\n\tlistBoxId: string | undefined;\n\tclassName?: string;\n\tComponent?: React.ElementType;\n};\n\nfunction ListBox( {\n\titems,\n\tonSelect,\n\tselectedIndex,\n\tinstanceId,\n\tlistBoxId,\n\tclassName,\n\tComponent = 'div',\n}: ListBoxProps ) {\n\treturn (\n\t\t<Component\n\t\t\tid={ listBoxId }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"components-autocomplete__results\"\n\t\t>\n\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t<Button\n\t\t\t\t\tkey={ option.key }\n\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Unused, for backwards compatibility.\n\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tvariant={ index === selectedIndex ? 'primary' : undefined }\n\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t>\n\t\t\t\t\t{ option.label }\n\t\t\t\t</Button>\n\t\t\t) ) }\n\t\t</Component>\n\t);\n}\n\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems =\n\t\tautocompleter.useItems ?? getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tinstanceId,\n\t\tlistBoxId,\n\t\tclassName,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tonReset,\n\t\treset,\n\t\tcontentRef,\n\t}: AutocompleterUIProps ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst popoverAnchor = useAnchor( {\n\t\t\teditableContentElement: contentRef.current,\n\t\t} );\n\n\t\tconst [ needsA11yCompat, setNeedsA11yCompat ] = useState( false );\n\t\tconst popoverRef = useRef< HTMLElement >( null );\n\t\tconst popoverRefs = useMergeRefs( [\n\t\t\tpopoverRef,\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tif ( ! contentRef.current ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the popover is rendered in a different document than\n\t\t\t\t\t// the content, we need to duplicate the options list in the\n\t\t\t\t\t// content document so that it's available to the screen\n\t\t\t\t\t// readers, which check the DOM ID based aria-* attributes.\n\t\t\t\t\tsetNeedsA11yCompat(\n\t\t\t\t\t\tnode.ownerDocument !== contentRef.current.ownerDocument\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t[ contentRef ]\n\t\t\t),\n\t\t] );\n\n\t\tuseOnClickOutside( popoverRef, reset );\n\n\t\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\t\tfunction announce( options: Array< KeyedOption > ) {\n\t\t\tif ( ! debouncedSpeak ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !! options.length ) {\n\t\t\t\tif ( filterValue ) {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t\t}\n\t\t}\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tannounce( items );\n\t\t\t// We want to avoid introducing unexpected side effects.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t}, [ items ] );\n\n\t\tif ( items.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tonClose={ onReset }\n\t\t\t\t\tplacement=\"top-start\"\n\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tref={ popoverRefs }\n\t\t\t\t>\n\t\t\t\t\t<ListBox\n\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{ contentRef.current &&\n\t\t\t\t\tneedsA11yCompat &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<ListBox\n\t\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tComponent={ VisuallyHidden }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\tcontentRef.current.ownerDocument.body\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nfunction useOnClickOutside(\n\tref: React.RefObject< HTMLElement >,\n\thandler: AutocompleterUIProps[ 'reset' ]\n) {\n\tuseEffect( () => {\n\t\tconst listener = ( event: MouseEvent | TouchEvent ) => {\n\t\t\t// Do nothing if clicking ref's element or descendent elements, or if the ref is not referencing an element\n\t\t\tif (\n\t\t\t\t! ref.current ||\n\t\t\t\tref.current.contains( event.target as Node )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandler( event );\n\t\t};\n\t\tdocument.addEventListener( 'mousedown', listener );\n\t\tdocument.addEventListener( 'touchstart', listener );\n\t\treturn () => {\n\t\t\tdocument.removeEventListener( 'mousedown', listener );\n\t\t\tdocument.removeEventListener( 'touchstart', listener );\n\t\t};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IACvD,CAAC;EACF,CAAC,EAAE,CAAEF,OAAO,EAAEJ,GAAG,CAAG,CAAC;AACtB","ignoreList":[]}
@@ -103,6 +103,7 @@ const UnconnectedBorderBoxControl = (props, forwardedRef) => {
103
103
  withSlider: true,
104
104
  width: size === '__unstable-large' ? '116px' : '110px',
105
105
  __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar,
106
+ __shouldNotWarnDeprecated36pxSize: true,
106
107
  size: size
107
108
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_borderBoxControlSplitControls.default, {
108
109
  colors: colors,
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_element","_compose","_borderBoxControlLinkedButton","_interopRequireDefault","_borderBoxControlSplitControls","_borderControl","_baseControlStyles","_view","_visuallyHidden","_context","_hook","_jsxRuntime","BorderLabel","props","label","hideLabelFromVision","jsx","VisuallyHidden","as","children","StyledLabel","UnconnectedBorderBoxControl","forwardedRef","className","colors","disableCustomColors","disableUnits","enableAlpha","enableStyle","hasMixedBorders","isLinked","linkedControlClassName","linkedValue","onLinkedChange","onSplitChange","popoverPlacement","popoverOffset","size","splitValue","toggleLinked","wrapperClassName","__experimentalIsRenderedInSidebar","otherProps","useBorderBoxControl","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","placement","offset","anchor","shift","undefined","mergedRef","useMergeRefs","jsxs","View","ref","BorderControl","onChange","placeholder","__","__unstablePopoverProps","shouldSanitizeBorder","value","withSlider","width","default","onClick","BorderBoxControl","exports","contextConnect","_default"],"sources":["@wordpress/components/src/border-box-control/border-box-control/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BorderBoxControlLinkedButton from '../border-box-control-linked-button';\nimport BorderBoxControlSplitControls from '../border-box-control-split-controls';\nimport { BorderControl } from '../../border-control';\nimport { StyledLabel } from '../../base-control/styles/base-control-styles';\nimport { View } from '../../view';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderBoxControl } from './hook';\n\nimport type { BorderBoxControlProps } from '../types';\nimport type {\n\tLabelProps,\n\tBorderControlProps,\n} from '../../border-control/types';\n\nconst BorderLabel = ( props: LabelProps ) => {\n\tconst { label, hideLabelFromVision } = props;\n\n\tif ( ! label ) {\n\t\treturn null;\n\t}\n\n\treturn hideLabelFromVision ? (\n\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t) : (\n\t\t<StyledLabel>{ label }</StyledLabel>\n\t);\n};\n\nconst UnconnectedBorderBoxControl = (\n\tprops: WordPressComponentProps< BorderBoxControlProps, 'div', false >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\tclassName,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tdisableUnits,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\thasMixedBorders,\n\t\thideLabelFromVision,\n\t\tisLinked,\n\t\tlabel,\n\t\tlinkedControlClassName,\n\t\tlinkedValue,\n\t\tonLinkedChange,\n\t\tonSplitChange,\n\t\tpopoverPlacement,\n\t\tpopoverOffset,\n\t\tsize,\n\t\tsplitValue,\n\t\ttoggleLinked,\n\t\twrapperClassName,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t...otherProps\n\t} = useBorderBoxControl( props );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< Element | null >(\n\t\tnull\n\t);\n\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps: BorderControlProps[ '__unstablePopoverProps' ] =\n\t\tuseMemo(\n\t\t\t() =>\n\t\t\t\tpopoverPlacement\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tplacement: popoverPlacement,\n\t\t\t\t\t\t\toffset: popoverOffset,\n\t\t\t\t\t\t\tanchor: popoverAnchor,\n\t\t\t\t\t\t\tshift: true,\n\t\t\t\t\t }\n\t\t\t\t\t: undefined,\n\t\t\t[ popoverPlacement, popoverOffset, popoverAnchor ]\n\t\t);\n\n\tconst mergedRef = useMergeRefs( [ setPopoverAnchor, forwardedRef ] );\n\treturn (\n\t\t<View className={ className } { ...otherProps } ref={ mergedRef }>\n\t\t\t<BorderLabel\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t/>\n\t\t\t<View className={ wrapperClassName }>\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<BorderControl\n\t\t\t\t\t\tclassName={ linkedControlClassName }\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onLinkedChange }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\thasMixedBorders ? __( 'Mixed' ) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\t\t\tshouldSanitizeBorder={ false } // This component will handle that.\n\t\t\t\t\t\tvalue={ linkedValue }\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t\twidth={\n\t\t\t\t\t\t\tsize === '__unstable-large' ? '116px' : '110px'\n\t\t\t\t\t\t}\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\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BorderBoxControlSplitControls\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onSplitChange }\n\t\t\t\t\t\tpopoverPlacement={ popoverPlacement }\n\t\t\t\t\t\tpopoverOffset={ popoverOffset }\n\t\t\t\t\t\tvalue={ splitValue }\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\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BorderBoxControlLinkedButton\n\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\tsize={ size }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</View>\n\t);\n};\n\n/**\n * An input control for the color, style, and width of the border of a box. The\n * border can be customized as a whole, or individually for each side of the box.\n *\n * ```jsx\n * import { BorderBoxControl } from '@wordpress/components';\n * import { __ } from '@wordpress/i18n';\n *\n * const colors = [\n * \t{ name: 'Blue 20', color: '#72aee6' },\n * \t// ...\n * ];\n *\n * const MyBorderBoxControl = () => {\n * \tconst defaultBorder = {\n * \t\tcolor: '#72aee6',\n * \t\tstyle: 'dashed',\n * \t\twidth: '1px',\n * \t};\n * \tconst [ borders, setBorders ] = useState( {\n * \t\ttop: defaultBorder,\n * \t\tright: defaultBorder,\n * \t\tbottom: defaultBorder,\n * \t\tleft: defaultBorder,\n * \t} );\n * \tconst onChange = ( newBorders ) => setBorders( newBorders );\n *\n * \treturn (\n * \t\t<BorderBoxControl\n * \t\t\t__next40pxDefaultSize\n * \t\t\tcolors={ colors }\n * \t\t\tlabel={ __( 'Borders' ) }\n * \t\t\tonChange={ onChange }\n * \t\t\tvalue={ borders }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport const BorderBoxControl = contextConnect(\n\tUnconnectedBorderBoxControl,\n\t'BorderBoxControl'\n);\n\nexport default BorderBoxControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA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CiB,oBAAoB,EAAG,KAAO,CAAC;QAAA;QAC/BC,KAAK,EAAGjC,WAAa;QACrBkC,UAAU;QACVC,KAAK,EACJ9B,IAAI,KAAK,kBAAkB,GAAG,OAAO,GAAG,OACxC;QACDI,iCAAiC,EAChCA,iCACA;QACDJ,IAAI,EAAGA;MAAM,CACb,CAAC,gBAEF,IAAA1B,WAAA,CAAAK,GAAA,EAACZ,8BAAA,CAAAgE,OAA6B;QAC7B5C,MAAM,EAAGA,MAAQ;QACjBC,mBAAmB,EAAGA,mBAAqB;QAC3CE,WAAW,EAAGA,WAAa;QAC3BC,WAAW,EAAGA,WAAa;QAC3BgC,QAAQ,EAAG1B,aAAe;QAC1BC,gBAAgB,EAAGA,gBAAkB;QACrCC,aAAa,EAAGA,aAAe;QAC/B6B,KAAK,EAAG3B,UAAY;QACpBG,iCAAiC,EAChCA,iCACA;QACDJ,IAAI,EAAGA;MAAM,CACb,CACD,eACD,IAAA1B,WAAA,CAAAK,GAAA,EAACd,6BAAA,CAAAkE,OAA4B;QAC5BC,OAAO,EAAG9B,YAAc;QACxBT,QAAQ,EAAGA,QAAU;QACrBO,IAAI,EAAGA;MAAM,CACb,CAAC;IAAA,CACG,CAAC;EAAA,CACF,CAAC;AAET,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMiC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,uBAAc,EAC7CnD,2BAA2B,EAC3B,kBACD,CAAC;AAAC,IAAAoD,QAAA,GAAAF,OAAA,CAAAH,OAAA,GAEaE,gBAAgB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_element","_compose","_borderBoxControlLinkedButton","_interopRequireDefault","_borderBoxControlSplitControls","_borderControl","_baseControlStyles","_view","_visuallyHidden","_context","_hook","_jsxRuntime","BorderLabel","props","label","hideLabelFromVision","jsx","VisuallyHidden","as","children","StyledLabel","UnconnectedBorderBoxControl","forwardedRef","className","colors","disableCustomColors","disableUnits","enableAlpha","enableStyle","hasMixedBorders","isLinked","linkedControlClassName","linkedValue","onLinkedChange","onSplitChange","popoverPlacement","popoverOffset","size","splitValue","toggleLinked","wrapperClassName","__experimentalIsRenderedInSidebar","otherProps","useBorderBoxControl","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","placement","offset","anchor","shift","undefined","mergedRef","useMergeRefs","jsxs","View","ref","BorderControl","onChange","placeholder","__","__unstablePopoverProps","shouldSanitizeBorder","value","withSlider","width","__shouldNotWarnDeprecated36pxSize","default","onClick","BorderBoxControl","exports","contextConnect","_default"],"sources":["@wordpress/components/src/border-box-control/border-box-control/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BorderBoxControlLinkedButton from '../border-box-control-linked-button';\nimport BorderBoxControlSplitControls from '../border-box-control-split-controls';\nimport { BorderControl } from '../../border-control';\nimport { StyledLabel } from '../../base-control/styles/base-control-styles';\nimport { View } from '../../view';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderBoxControl } from './hook';\n\nimport type { BorderBoxControlProps } from '../types';\nimport type {\n\tLabelProps,\n\tBorderControlProps,\n} from '../../border-control/types';\n\nconst BorderLabel = ( props: LabelProps ) => {\n\tconst { label, hideLabelFromVision } = props;\n\n\tif ( ! label ) {\n\t\treturn null;\n\t}\n\n\treturn hideLabelFromVision ? (\n\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t) : (\n\t\t<StyledLabel>{ label }</StyledLabel>\n\t);\n};\n\nconst UnconnectedBorderBoxControl = (\n\tprops: WordPressComponentProps< BorderBoxControlProps, 'div', false >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\tclassName,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tdisableUnits,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\thasMixedBorders,\n\t\thideLabelFromVision,\n\t\tisLinked,\n\t\tlabel,\n\t\tlinkedControlClassName,\n\t\tlinkedValue,\n\t\tonLinkedChange,\n\t\tonSplitChange,\n\t\tpopoverPlacement,\n\t\tpopoverOffset,\n\t\tsize,\n\t\tsplitValue,\n\t\ttoggleLinked,\n\t\twrapperClassName,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t...otherProps\n\t} = useBorderBoxControl( props );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< Element | null >(\n\t\tnull\n\t);\n\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps: BorderControlProps[ '__unstablePopoverProps' ] =\n\t\tuseMemo(\n\t\t\t() =>\n\t\t\t\tpopoverPlacement\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tplacement: popoverPlacement,\n\t\t\t\t\t\t\toffset: popoverOffset,\n\t\t\t\t\t\t\tanchor: popoverAnchor,\n\t\t\t\t\t\t\tshift: true,\n\t\t\t\t\t }\n\t\t\t\t\t: undefined,\n\t\t\t[ popoverPlacement, popoverOffset, popoverAnchor ]\n\t\t);\n\n\tconst mergedRef = useMergeRefs( [ setPopoverAnchor, forwardedRef ] );\n\treturn (\n\t\t<View className={ className } { ...otherProps } ref={ mergedRef }>\n\t\t\t<BorderLabel\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t/>\n\t\t\t<View className={ wrapperClassName }>\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<BorderControl\n\t\t\t\t\t\tclassName={ linkedControlClassName }\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onLinkedChange }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\thasMixedBorders ? __( 'Mixed' ) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\t\t\tshouldSanitizeBorder={ false } // This component will handle that.\n\t\t\t\t\t\tvalue={ linkedValue }\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t\twidth={\n\t\t\t\t\t\t\tsize === '__unstable-large' ? '116px' : '110px'\n\t\t\t\t\t\t}\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\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<BorderBoxControlSplitControls\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\tonChange={ onSplitChange }\n\t\t\t\t\t\tpopoverPlacement={ popoverPlacement }\n\t\t\t\t\t\tpopoverOffset={ popoverOffset }\n\t\t\t\t\t\tvalue={ splitValue }\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\tsize={ size }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BorderBoxControlLinkedButton\n\t\t\t\t\tonClick={ toggleLinked }\n\t\t\t\t\tisLinked={ isLinked }\n\t\t\t\t\tsize={ size }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</View>\n\t);\n};\n\n/**\n * An input control for the color, style, and width of the border of a box. The\n * border can be customized as a whole, or individually for each side of the box.\n *\n * ```jsx\n * import { BorderBoxControl } from '@wordpress/components';\n * import { __ } from '@wordpress/i18n';\n *\n * const colors = [\n * \t{ name: 'Blue 20', color: '#72aee6' },\n * \t// ...\n * ];\n *\n * const MyBorderBoxControl = () => {\n * \tconst defaultBorder = {\n * \t\tcolor: '#72aee6',\n * \t\tstyle: 'dashed',\n * \t\twidth: '1px',\n * \t};\n * \tconst [ borders, setBorders ] = useState( {\n * \t\ttop: defaultBorder,\n * \t\tright: defaultBorder,\n * \t\tbottom: defaultBorder,\n * \t\tleft: defaultBorder,\n * \t} );\n * \tconst onChange = ( newBorders ) => setBorders( newBorders );\n *\n * \treturn (\n * \t\t<BorderBoxControl\n * \t\t\t__next40pxDefaultSize\n * \t\t\tcolors={ colors }\n * \t\t\tlabel={ __( 'Borders' ) }\n * \t\t\tonChange={ onChange }\n * \t\t\tvalue={ borders }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport const BorderBoxControl = contextConnect(\n\tUnconnectedBorderBoxControl,\n\t'BorderBoxControl'\n);\n\nexport default BorderBoxControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,6BAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,8BAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AAEA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,KAAA,GAAAX,OAAA;AAA6C,IAAAY,WAAA,GAAAZ,OAAA;AAlB7C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,EAAGA,WAAa;QAC3BgC,QAAQ,EAAG1B,aAAe;QAC1BC,gBAAgB,EAAGA,gBAAkB;QACrCC,aAAa,EAAGA,aAAe;QAC/B6B,KAAK,EAAG3B,UAAY;QACpBG,iCAAiC,EAChCA,iCACA;QACDJ,IAAI,EAAGA;MAAM,CACb,CACD,eACD,IAAA1B,WAAA,CAAAK,GAAA,EAACd,6BAAA,CAAAmE,OAA4B;QAC5BC,OAAO,EAAG/B,YAAc;QACxBT,QAAQ,EAAGA,QAAU;QACrBO,IAAI,EAAGA;MAAM,CACb,CAAC;IAAA,CACG,CAAC;EAAA,CACF,CAAC;AAET,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMkC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAAE,uBAAc,EAC7CpD,2BAA2B,EAC3B,kBACD,CAAC;AAAC,IAAAqD,QAAA,GAAAF,OAAA,CAAAH,OAAA,GAEaE,gBAAgB","ignoreList":[]}
@@ -57,7 +57,8 @@ const BorderBoxControlSplitControls = (props, forwardedRef) => {
57
57
  enableStyle,
58
58
  isCompact: true,
59
59
  __experimentalIsRenderedInSidebar,
60
- size
60
+ size,
61
+ __shouldNotWarnDeprecated36pxSize: true
61
62
  };
62
63
  const mergedRef = (0, _compose.useMergeRefs)([setPopoverAnchor, forwardedRef]);
63
64
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_grid.Grid, {
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_element","_compose","_borderBoxControlVisualizer","_interopRequireDefault","_borderControl","_grid","_context","_hook","_jsxRuntime","BorderBoxControlSplitControls","props","forwardedRef","centeredClassName","colors","disableCustomColors","enableAlpha","enableStyle","onChange","popoverPlacement","popoverOffset","rightAlignedClassName","size","value","__experimentalIsRenderedInSidebar","otherProps","useBorderBoxControlSplitControls","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","placement","offset","anchor","shift","undefined","sharedBorderControlProps","isCompact","mergedRef","useMergeRefs","jsxs","Grid","ref","gap","children","jsx","default","BorderControl","className","hideLabelFromVision","label","__","newBorder","__unstablePopoverProps","top","left","right","bottom","ConnectedBorderBoxControlSplitControls","contextConnect","_default","exports"],"sources":["@wordpress/components/src/border-box-control/border-box-control-split-controls/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BorderBoxControlVisualizer from '../border-box-control-visualizer';\nimport { BorderControl } from '../../border-control';\nimport { Grid } from '../../grid';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderBoxControlSplitControls } from './hook';\n\nimport type { BorderControlProps } from '../../border-control/types';\nimport type { SplitControlsProps } from '../types';\n\nconst BorderBoxControlSplitControls = (\n\tprops: WordPressComponentProps< SplitControlsProps, 'div' >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\tcenteredClassName,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tonChange,\n\t\tpopoverPlacement,\n\t\tpopoverOffset,\n\t\trightAlignedClassName,\n\t\tsize = 'default',\n\t\tvalue,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t...otherProps\n\t} = useBorderBoxControlSplitControls( props );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< Element | null >(\n\t\tnull\n\t);\n\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps: BorderControlProps[ '__unstablePopoverProps' ] =\n\t\tuseMemo(\n\t\t\t() =>\n\t\t\t\tpopoverPlacement\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tplacement: popoverPlacement,\n\t\t\t\t\t\t\toffset: popoverOffset,\n\t\t\t\t\t\t\tanchor: popoverAnchor,\n\t\t\t\t\t\t\tshift: true,\n\t\t\t\t\t }\n\t\t\t\t\t: undefined,\n\t\t\t[ popoverPlacement, popoverOffset, popoverAnchor ]\n\t\t);\n\n\tconst sharedBorderControlProps = {\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tisCompact: true,\n\t\t__experimentalIsRenderedInSidebar,\n\t\tsize,\n\t};\n\n\tconst mergedRef = useMergeRefs( [ setPopoverAnchor, forwardedRef ] );\n\n\treturn (\n\t\t<Grid { ...otherProps } ref={ mergedRef } gap={ 4 }>\n\t\t\t<BorderBoxControlVisualizer value={ value } size={ size } />\n\t\t\t<BorderControl\n\t\t\t\tclassName={ centeredClassName }\n\t\t\t\thideLabelFromVision\n\t\t\t\tlabel={ __( 'Top border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'top' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.top }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t\t<BorderControl\n\t\t\t\thideLabelFromVision\n\t\t\t\tlabel={ __( 'Left border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'left' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.left }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t\t<BorderControl\n\t\t\t\tclassName={ rightAlignedClassName }\n\t\t\t\thideLabelFromVision\n\t\t\t\tlabel={ __( 'Right border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'right' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.right }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t\t<BorderControl\n\t\t\t\tclassName={ centeredClassName }\n\t\t\t\thideLabelFromVision\n\t\t\t\tlabel={ __( 'Bottom border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'bottom' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.bottom }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t</Grid>\n\t);\n};\n\nconst ConnectedBorderBoxControlSplitControls = contextConnect(\n\tBorderBoxControlSplitControls,\n\t'BorderBoxControlSplitControls'\n);\nexport default ConnectedBorderBoxControlSplitControls;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,2BAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAA0D,IAAAS,WAAA,GAAAT,OAAA;AAf1D;AACA;AACA;;AAKA;AACA;AACA;;AAWA,MAAMU,6BAA6B,GAAGA,CACrCC,KAA2D,EAC3DC,YAAuC,KACnC;EACJ,MAAM;IACLC,iBAAiB;IACjBC,MAAM;IACNC,mBAAmB;IACnBC,WAAW;IACXC,WAAW;IACXC,QAAQ;IACRC,gBAAgB;IAChBC,aAAa;IACbC,qBAAqB;IACrBC,IAAI,GAAG,SAAS;IAChBC,KAAK;IACLC,iCAAiC;IACjC,GAAGC;EACJ,CAAC,GAAG,IAAAC,sCAAgC,EAAEf,KAAM,CAAC;;EAE7C;EACA;EACA,MAAM,CAAEgB,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EACnD,IACD,CAAC;;EAED;EACA,MAAMC,YAA4D,GACjE,IAAAC,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S,IAAMnC,QAAQ,CAAEmC,SAAS,EAAE,MAAO,CAAG;MAC3DC,sBAAsB,EAAGxB,YAAc;MACvCP,KAAK,EAAGA,KAAK,EAAEiC,IAAM;MAAA,GAChBnB;IAAwB,CAC7B,CAAC,eACF,IAAA5B,WAAA,CAAAqC,GAAA,EAACzC,cAAA,CAAA2C,aAAa;MACbC,SAAS,EAAG5B,qBAAuB;MACnC6B,mBAAmB;MACnBC,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;MAC9BlC,QAAQ,EAAKmC,SAAS,IAAMnC,QAAQ,CAAEmC,SAAS,EAAE,OAAQ,CAAG;MAC5DC,sBAAsB,EAAGxB,YAAc;MACvCP,KAAK,EAAGA,KAAK,EAAEkC,KAAO;MAAA,GACjBpB;IAAwB,CAC7B,CAAC,eACF,IAAA5B,WAAA,CAAAqC,GAAA,EAACzC,cAAA,CAAA2C,aAAa;MACbC,SAAS,EAAGpC,iBAAmB;MAC/BqC,mBAAmB;MACnBC,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB,CAAG;MAC/BlC,QAAQ,EAAKmC,SAAS,IAAMnC,QAAQ,CAAEmC,SAAS,EAAE,QAAS,CAAG;MAC7DC,sBAAsB,EAAGxB,YAAc;MACvCP,KAAK,EAAGA,KAAK,EAAEmC,MAAQ;MAAA,GAClBrB;IAAwB,CAC7B,CAAC;EAAA,CACG,CAAC;AAET,CAAC;AAED,MAAMsB,sCAAsC,GAAG,IAAAC,uBAAc,EAC5DlD,6BAA6B,EAC7B,+BACD,CAAC;AAAC,IAAAmD,QAAA,GAAAC,OAAA,CAAAf,OAAA,GACaY,sCAAsC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_element","_compose","_borderBoxControlVisualizer","_interopRequireDefault","_borderControl","_grid","_context","_hook","_jsxRuntime","BorderBoxControlSplitControls","props","forwardedRef","centeredClassName","colors","disableCustomColors","enableAlpha","enableStyle","onChange","popoverPlacement","popoverOffset","rightAlignedClassName","size","value","__experimentalIsRenderedInSidebar","otherProps","useBorderBoxControlSplitControls","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","placement","offset","anchor","shift","undefined","sharedBorderControlProps","isCompact","__shouldNotWarnDeprecated36pxSize","mergedRef","useMergeRefs","jsxs","Grid","ref","gap","children","jsx","default","BorderControl","className","hideLabelFromVision","label","__","newBorder","__unstablePopoverProps","top","left","right","bottom","ConnectedBorderBoxControlSplitControls","contextConnect","_default","exports"],"sources":["@wordpress/components/src/border-box-control/border-box-control-split-controls/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BorderBoxControlVisualizer from '../border-box-control-visualizer';\nimport { BorderControl } from '../../border-control';\nimport { Grid } from '../../grid';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderBoxControlSplitControls } from './hook';\n\nimport type { BorderControlProps } from '../../border-control/types';\nimport type { SplitControlsProps } from '../types';\n\nconst BorderBoxControlSplitControls = (\n\tprops: WordPressComponentProps< SplitControlsProps, 'div' >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\tcenteredClassName,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tonChange,\n\t\tpopoverPlacement,\n\t\tpopoverOffset,\n\t\trightAlignedClassName,\n\t\tsize = 'default',\n\t\tvalue,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t...otherProps\n\t} = useBorderBoxControlSplitControls( props );\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< Element | null >(\n\t\tnull\n\t);\n\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps: BorderControlProps[ '__unstablePopoverProps' ] =\n\t\tuseMemo(\n\t\t\t() =>\n\t\t\t\tpopoverPlacement\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tplacement: popoverPlacement,\n\t\t\t\t\t\t\toffset: popoverOffset,\n\t\t\t\t\t\t\tanchor: popoverAnchor,\n\t\t\t\t\t\t\tshift: true,\n\t\t\t\t\t }\n\t\t\t\t\t: undefined,\n\t\t\t[ popoverPlacement, popoverOffset, popoverAnchor ]\n\t\t);\n\n\tconst sharedBorderControlProps = {\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tisCompact: true,\n\t\t__experimentalIsRenderedInSidebar,\n\t\tsize,\n\t\t__shouldNotWarnDeprecated36pxSize: true,\n\t};\n\n\tconst mergedRef = useMergeRefs( [ setPopoverAnchor, forwardedRef ] );\n\n\treturn (\n\t\t<Grid { ...otherProps } ref={ mergedRef } gap={ 4 }>\n\t\t\t<BorderBoxControlVisualizer value={ value } size={ size } />\n\t\t\t<BorderControl\n\t\t\t\tclassName={ centeredClassName }\n\t\t\t\thideLabelFromVision\n\t\t\t\tlabel={ __( 'Top border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'top' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.top }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t\t<BorderControl\n\t\t\t\thideLabelFromVision\n\t\t\t\tlabel={ __( 'Left border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'left' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.left }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t\t<BorderControl\n\t\t\t\tclassName={ rightAlignedClassName }\n\t\t\t\thideLabelFromVision\n\t\t\t\tlabel={ __( 'Right border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'right' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.right }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t\t<BorderControl\n\t\t\t\tclassName={ centeredClassName }\n\t\t\t\thideLabelFromVision\n\t\t\t\tlabel={ __( 'Bottom border' ) }\n\t\t\t\tonChange={ ( newBorder ) => onChange( newBorder, 'bottom' ) }\n\t\t\t\t__unstablePopoverProps={ popoverProps }\n\t\t\t\tvalue={ value?.bottom }\n\t\t\t\t{ ...sharedBorderControlProps }\n\t\t\t/>\n\t\t</Grid>\n\t);\n};\n\nconst ConnectedBorderBoxControlSplitControls = contextConnect(\n\tBorderBoxControlSplitControls,\n\t'BorderBoxControlSplitControls'\n);\nexport default ConnectedBorderBoxControlSplitControls;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,2BAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAEA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAA0D,IAAAS,WAAA,GAAAT,OAAA;AAf1D;AACA;AACA;;AAKA;AACA;AACA;;AAWA,MAAMU,6BAA6B,GAAGA,CACrCC,KAA2D,EAC3DC,YAAuC,KACnC;EACJ,MAAM;IACLC,iBAAiB;IACjBC,MAAM;IACNC,mBAAmB;IACnBC,WAAW;IACXC,WAAW;IACXC,QAAQ;IACRC,gBAAgB;IAChBC,aAAa;IACbC,qBAAqB;IACrBC,IAAI,GAAG,SAAS;IAChBC,KAAK;IACLC,iCAAiC;IACjC,GAAGC;EACJ,CAAC,GAAG,IAAAC,sCAAgC,EAAEf,KAAM,CAAC;;EAE7C;EACA;EACA,MAAM,CAAEgB,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EACnD,IACD,CAAC;;EAED;E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,IAAAC,QAAE,EAAE,aAAc,CAAG;MAC7BnC,QAAQ,EAAKoC,SAAS,IAAMpC,QAAQ,CAAEoC,SAAS,EAAE,MAAO,CAAG;MAC3DC,sBAAsB,EAAGzB,YAAc;MACvCP,KAAK,EAAGA,KAAK,EAAEkC,IAAM;MAAA,GAChBpB;IAAwB,CAC7B,CAAC,eACF,IAAA5B,WAAA,CAAAsC,GAAA,EAAC1C,cAAA,CAAA4C,aAAa;MACbC,SAAS,EAAG7B,qBAAuB;MACnC8B,mBAAmB;MACnBC,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;MAC9BnC,QAAQ,EAAKoC,SAAS,IAAMpC,QAAQ,CAAEoC,SAAS,EAAE,OAAQ,CAAG;MAC5DC,sBAAsB,EAAGzB,YAAc;MACvCP,KAAK,EAAGA,KAAK,EAAEmC,KAAO;MAAA,GACjBrB;IAAwB,CAC7B,CAAC,eACF,IAAA5B,WAAA,CAAAsC,GAAA,EAAC1C,cAAA,CAAA4C,aAAa;MACbC,SAAS,EAAGrC,iBAAmB;MAC/BsC,mBAAmB;MACnBC,KAAK,EAAG,IAAAC,QAAE,EAAE,eAAgB,CAAG;MAC/BnC,QAAQ,EAAKoC,SAAS,IAAMpC,QAAQ,CAAEoC,SAAS,EAAE,QAAS,CAAG;MAC7DC,sBAAsB,EAAGzB,YAAc;MACvCP,KAAK,EAAGA,KAAK,EAAEoC,MAAQ;MAAA,GAClBtB;IAAwB,CAC7B,CAAC;EAAA,CACG,CAAC;AAET,CAAC;AAED,MAAMuB,sCAAsC,GAAG,IAAAC,uBAAc,EAC5DnD,6BAA6B,EAC7B,+BACD,CAAC;AAAC,IAAAoD,QAAA,GAAAC,OAAA,CAAAf,OAAA,GACaY,sCAAsC","ignoreList":[]}
@@ -119,7 +119,8 @@ const UnconnectedBorderControl = (props, forwardedRef) => {
119
119
  step: ['px', '%'].includes(widthUnit) ? 1 : 0.1,
120
120
  value: widthValue || undefined,
121
121
  withInputField: false,
122
- __next40pxDefaultSize: __next40pxDefaultSize
122
+ __next40pxDefaultSize: __next40pxDefaultSize,
123
+ __shouldNotWarnDeprecated36pxSize: true
123
124
  })]
124
125
  })]
125
126
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_borderControlDropdown","_interopRequireDefault","_unitControl","_rangeControl","_hStack","_baseControlStyles","_view","_visuallyHidden","_context","_hook","_spacer","_jsxRuntime","BorderLabel","props","label","hideLabelFromVision","jsx","VisuallyHidden","as","children","StyledLabel","UnconnectedBorderControl","forwardedRef","__next40pxDefaultSize","colors","disableCustomColors","disableUnits","enableAlpha","enableStyle","innerWrapperClassName","inputWidth","isStyleSettable","onBorderChange","onSliderChange","onWidthChange","placeholder","__unstablePopoverProps","previousStyleSelection","showDropdownHeader","size","sliderClassName","value","border","widthUnit","widthValue","withSlider","__experimentalIsRenderedInSidebar","otherProps","useBorderControl","jsxs","View","ref","HStack","spacing","className","default","prefix","Spacer","marginRight","marginBottom","onChange","__","min","width","__unstableInputWidth","__nextHasNoMarginBottom","initialPosition","max","step","includes","undefined","withInputField","BorderControl","exports","contextConnect","_default"],"sources":["@wordpress/components/src/border-control/border-control/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BorderControlDropdown from '../border-control-dropdown';\nimport UnitControl from '../../unit-control';\nimport RangeControl from '../../range-control';\nimport { HStack } from '../../h-stack';\nimport { StyledLabel } from '../../base-control/styles/base-control-styles';\nimport { View } from '../../view';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderControl } from './hook';\n\nimport type { BorderControlProps, LabelProps } from '../types';\nimport { Spacer } from '../../spacer';\n\nconst BorderLabel = ( props: LabelProps ) => {\n\tconst { label, hideLabelFromVision } = props;\n\n\tif ( ! label ) {\n\t\treturn null;\n\t}\n\n\treturn hideLabelFromVision ? (\n\t\t<VisuallyHidden as=\"legend\">{ label }</VisuallyHidden>\n\t) : (\n\t\t<StyledLabel as=\"legend\">{ label }</StyledLabel>\n\t);\n};\n\nconst UnconnectedBorderControl = (\n\tprops: WordPressComponentProps< BorderControlProps, 'div', false >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tdisableUnits,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\thideLabelFromVision,\n\t\tinnerWrapperClassName,\n\t\tinputWidth,\n\t\tisStyleSettable,\n\t\tlabel,\n\t\tonBorderChange,\n\t\tonSliderChange,\n\t\tonWidthChange,\n\t\tplaceholder,\n\t\t__unstablePopoverProps,\n\t\tpreviousStyleSelection,\n\t\tshowDropdownHeader,\n\t\tsize,\n\t\tsliderClassName,\n\t\tvalue: border,\n\t\twidthUnit,\n\t\twidthValue,\n\t\twithSlider,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t...otherProps\n\t} = useBorderControl( props );\n\n\treturn (\n\t\t<View as=\"fieldset\" { ...otherProps } ref={ forwardedRef }>\n\t\t\t<BorderLabel\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t/>\n\t\t\t<HStack spacing={ 4 } className={ innerWrapperClassName }>\n\t\t\t\t<UnitControl\n\t\t\t\t\tprefix={\n\t\t\t\t\t\t<Spacer marginRight={ 1 } marginBottom={ 0 }>\n\t\t\t\t\t\t\t<BorderControlDropdown\n\t\t\t\t\t\t\t\tborder={ border }\n\t\t\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\t\t\t__unstablePopoverProps={\n\t\t\t\t\t\t\t\t\t__unstablePopoverProps\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\t\t\tisStyleSettable={ isStyleSettable }\n\t\t\t\t\t\t\t\tonChange={ onBorderChange }\n\t\t\t\t\t\t\t\tpreviousStyleSelection={\n\t\t\t\t\t\t\t\t\tpreviousStyleSelection\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t}\n\t\t\t\t\tlabel={ __( 'Border width' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tonChange={ onWidthChange }\n\t\t\t\t\tvalue={ border?.width || '' }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\t\t__unstableInputWidth={ inputWidth }\n\t\t\t\t\tsize={ size }\n\t\t\t\t/>\n\t\t\t\t{ withSlider && (\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Border width' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tclassName={ sliderClassName }\n\t\t\t\t\t\tinitialPosition={ 0 }\n\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tonChange={ onSliderChange }\n\t\t\t\t\t\tstep={ [ 'px', '%' ].includes( widthUnit ) ? 1 : 0.1 }\n\t\t\t\t\t\tvalue={ widthValue || undefined }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</View>\n\t);\n};\n\n/**\n * The `BorderControl` brings together internal sub-components which allow users to\n * set the various properties of a border. The first sub-component, a\n * `BorderDropdown` contains options representing border color and style. The\n * border width is controlled via a `UnitControl` and an optional `RangeControl`.\n *\n * Border radius is not covered by this control as it may be desired separate to\n * color, style, and width. For example, the border radius may be absorbed under\n * a \"shape\" abstraction.\n *\n * ```jsx\n * import { BorderControl } from '@wordpress/components';\n * import { __ } from '@wordpress/i18n';\n *\n * const colors = [\n * \t{ name: 'Blue 20', color: '#72aee6' },\n * \t// ...\n * ];\n *\n * const MyBorderControl = () => {\n * \tconst [ border, setBorder ] = useState();\n * \tconst onChange = ( newBorder ) => setBorder( newBorder );\n *\n * \treturn (\n * \t\t<BorderControl\n * \t\t\t__next40pxDefaultSize\n * \t\t\tcolors={ colors }\n * \t\t\tlabel={ __( 'Border' ) }\n * \t\t\tonChange={ onChange }\n * \t\t\tvalue={ border }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport const BorderControl = contextConnect(\n\tUnconnectedBorderControl,\n\t'BorderControl'\n);\n\nexport default BorderControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,aAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAR,OAAA;AAEA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,KAAA,GAAAV,OAAA;AAGA,IAAAW,OAAA,GAAAX,OAAA;AAAsC,IAAAY,WAAA,GAAAZ,OAAA;AApBtC;AACA;AACA;;AAGA;AACA;AACA;;AAeA,MAAMa,WAAW,GAAKC,KAAiB,IAAM;EAC5C,MAAM;IAAEC,KAAK;IAAEC;EAAoB,CAAC,GAAGF,KAAK;EAE5C,IAAK,CAAEC,KAAK,EAAG;IACd,OAAO,IAAI;EACZ;EAEA,OAAOC,mBAAmB,g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KAAK,EAAGG,UAAU,IAAI0B,SAAW;QACjCC,cAAc,EAAG,KAAO;QACxBhD,qBAAqB,EAAGA;MAAuB,CAC/C,CACD;IAAA,CACM,CAAC;EAAA,CACJ,CAAC;AAET,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMiD,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,uBAAc,EAC1CrD,wBAAwB,EACxB,eACD,CAAC;AAAC,IAAAsD,QAAA,GAAAF,OAAA,CAAAlB,OAAA,GAEaiB,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_borderControlDropdown","_interopRequireDefault","_unitControl","_rangeControl","_hStack","_baseControlStyles","_view","_visuallyHidden","_context","_hook","_spacer","_jsxRuntime","BorderLabel","props","label","hideLabelFromVision","jsx","VisuallyHidden","as","children","StyledLabel","UnconnectedBorderControl","forwardedRef","__next40pxDefaultSize","colors","disableCustomColors","disableUnits","enableAlpha","enableStyle","innerWrapperClassName","inputWidth","isStyleSettable","onBorderChange","onSliderChange","onWidthChange","placeholder","__unstablePopoverProps","previousStyleSelection","showDropdownHeader","size","sliderClassName","value","border","widthUnit","widthValue","withSlider","__experimentalIsRenderedInSidebar","otherProps","useBorderControl","jsxs","View","ref","HStack","spacing","className","default","prefix","Spacer","marginRight","marginBottom","onChange","__","min","width","__unstableInputWidth","__nextHasNoMarginBottom","initialPosition","max","step","includes","undefined","withInputField","__shouldNotWarnDeprecated36pxSize","BorderControl","exports","contextConnect","_default"],"sources":["@wordpress/components/src/border-control/border-control/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BorderControlDropdown from '../border-control-dropdown';\nimport UnitControl from '../../unit-control';\nimport RangeControl from '../../range-control';\nimport { HStack } from '../../h-stack';\nimport { StyledLabel } from '../../base-control/styles/base-control-styles';\nimport { View } from '../../view';\nimport { VisuallyHidden } from '../../visually-hidden';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderControl } from './hook';\n\nimport type { BorderControlProps, LabelProps } from '../types';\nimport { Spacer } from '../../spacer';\n\nconst BorderLabel = ( props: LabelProps ) => {\n\tconst { label, hideLabelFromVision } = props;\n\n\tif ( ! label ) {\n\t\treturn null;\n\t}\n\n\treturn hideLabelFromVision ? (\n\t\t<VisuallyHidden as=\"legend\">{ label }</VisuallyHidden>\n\t) : (\n\t\t<StyledLabel as=\"legend\">{ label }</StyledLabel>\n\t);\n};\n\nconst UnconnectedBorderControl = (\n\tprops: WordPressComponentProps< BorderControlProps, 'div', false >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\tcolors,\n\t\tdisableCustomColors,\n\t\tdisableUnits,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\thideLabelFromVision,\n\t\tinnerWrapperClassName,\n\t\tinputWidth,\n\t\tisStyleSettable,\n\t\tlabel,\n\t\tonBorderChange,\n\t\tonSliderChange,\n\t\tonWidthChange,\n\t\tplaceholder,\n\t\t__unstablePopoverProps,\n\t\tpreviousStyleSelection,\n\t\tshowDropdownHeader,\n\t\tsize,\n\t\tsliderClassName,\n\t\tvalue: border,\n\t\twidthUnit,\n\t\twidthValue,\n\t\twithSlider,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t...otherProps\n\t} = useBorderControl( props );\n\n\treturn (\n\t\t<View as=\"fieldset\" { ...otherProps } ref={ forwardedRef }>\n\t\t\t<BorderLabel\n\t\t\t\tlabel={ label }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t/>\n\t\t\t<HStack spacing={ 4 } className={ innerWrapperClassName }>\n\t\t\t\t<UnitControl\n\t\t\t\t\tprefix={\n\t\t\t\t\t\t<Spacer marginRight={ 1 } marginBottom={ 0 }>\n\t\t\t\t\t\t\t<BorderControlDropdown\n\t\t\t\t\t\t\t\tborder={ border }\n\t\t\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\t\t\t__unstablePopoverProps={\n\t\t\t\t\t\t\t\t\t__unstablePopoverProps\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\t\t\t\t\tenableStyle={ enableStyle }\n\t\t\t\t\t\t\t\tisStyleSettable={ isStyleSettable }\n\t\t\t\t\t\t\t\tonChange={ onBorderChange }\n\t\t\t\t\t\t\t\tpreviousStyleSelection={\n\t\t\t\t\t\t\t\t\tpreviousStyleSelection\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t}\n\t\t\t\t\tlabel={ __( 'Border width' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tonChange={ onWidthChange }\n\t\t\t\t\tvalue={ border?.width || '' }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tdisableUnits={ disableUnits }\n\t\t\t\t\t__unstableInputWidth={ inputWidth }\n\t\t\t\t\tsize={ size }\n\t\t\t\t/>\n\t\t\t\t{ withSlider && (\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Border width' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tclassName={ sliderClassName }\n\t\t\t\t\t\tinitialPosition={ 0 }\n\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tonChange={ onSliderChange }\n\t\t\t\t\t\tstep={ [ 'px', '%' ].includes( widthUnit ) ? 1 : 0.1 }\n\t\t\t\t\t\tvalue={ widthValue || undefined }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t__shouldNotWarnDeprecated36pxSize\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</View>\n\t);\n};\n\n/**\n * The `BorderControl` brings together internal sub-components which allow users to\n * set the various properties of a border. The first sub-component, a\n * `BorderDropdown` contains options representing border color and style. The\n * border width is controlled via a `UnitControl` and an optional `RangeControl`.\n *\n * Border radius is not covered by this control as it may be desired separate to\n * color, style, and width. For example, the border radius may be absorbed under\n * a \"shape\" abstraction.\n *\n * ```jsx\n * import { BorderControl } from '@wordpress/components';\n * import { __ } from '@wordpress/i18n';\n *\n * const colors = [\n * \t{ name: 'Blue 20', color: '#72aee6' },\n * \t// ...\n * ];\n *\n * const MyBorderControl = () => {\n * \tconst [ border, setBorder ] = useState();\n * \tconst onChange = ( newBorder ) => setBorder( newBorder );\n *\n * \treturn (\n * \t\t<BorderControl\n * \t\t\t__next40pxDefaultSize\n * \t\t\tcolors={ colors }\n * \t\t\tlabel={ __( 'Border' ) }\n * \t\t\tonChange={ onChange }\n * \t\t\tvalue={ border }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport const BorderControl = contextConnect(\n\tUnconnectedBorderControl,\n\t'BorderControl'\n);\n\nexport default BorderControl;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,aAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,kBA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AAM,CACb,CAAC,EACAM,UAAU,iBACX,IAAAlC,WAAA,CAAAK,GAAA,EAACb,aAAA,CAAAoD,OAAY;QACZU,uBAAuB;QACvBnD,KAAK,EAAG,IAAA+C,QAAE,EAAE,cAAe,CAAG;QAC9B9C,mBAAmB;QACnBuC,SAAS,EAAGd,eAAiB;QAC7B0B,eAAe,EAAG,CAAG;QACrBC,GAAG,EAAG,GAAK;QACXL,GAAG,EAAG,CAAG;QACTF,QAAQ,EAAG3B,cAAgB;QAC3BmC,IAAI,EAAG,CAAE,IAAI,EAAE,GAAG,CAAE,CAACC,QAAQ,CAAE1B,SAAU,CAAC,GAAG,CAAC,GAAG,GAAK;QACtDF,KAAK,EAAGG,UAAU,IAAI0B,SAAW;QACjCC,cAAc,EAAG,KAAO;QACxBhD,qBAAqB,EAAGA,qBAAuB;QAC/CiD,iCAAiC;MAAA,CACjC,CACD;IAAA,CACM,CAAC;EAAA,CACJ,CAAC;AAET,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,IAAAE,uBAAc,EAC1CtD,wBAAwB,EACxB,eACD,CAAC;AAAC,IAAAuD,QAAA,GAAAF,OAAA,CAAAnB,OAAA,GAEakB,aAAa","ignoreList":[]}
@@ -41,12 +41,14 @@ function useBorderControl(props) {
41
41
  width,
42
42
  __experimentalIsRenderedInSidebar = false,
43
43
  __next40pxDefaultSize,
44
+ __shouldNotWarnDeprecated36pxSize,
44
45
  ...otherProps
45
46
  } = (0, _context.useContextSystem)(props, 'BorderControl');
46
47
  (0, _deprecated36pxSize.maybeWarnDeprecated36pxSize)({
47
48
  componentName: 'BorderControl',
48
49
  __next40pxDefaultSize,
49
- size
50
+ size,
51
+ __shouldNotWarnDeprecated36pxSize
50
52
  });
51
53
  const computedSize = size === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;
52
54
  const [widthValue, originalWidthUnit] = (0, _utils.parseQuantityAndUnitFromRawValue)(border?.width);
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","styles","_interopRequireWildcard","_utils","_context","_useCx","_deprecated36pxSize","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","isValidBorder","border","hasWidth","width","undefined","hasColor","color","useBorderControl","props","className","colors","isCompact","onChange","enableAlpha","enableStyle","shouldSanitizeBorder","size","value","__experimentalIsRenderedInSidebar","__next40pxDefaultSize","otherProps","useContextSystem","maybeWarnDeprecated36pxSize","componentName","computedSize","widthValue","originalWidthUnit","parseQuantityAndUnitFromRawValue","widthUnit","hadPreviousZeroWidth","colorSelection","setColorSelection","useState","styleSelection","setStyleSelection","isStyleSettable","onBorderChange","useCallback","newBorder","onWidthChange","newWidth","newWidthValue","parsedValue","hasZeroWidth","updatedBorder","style","onSliderChange","cx","useCx","classes","useMemo","borderControl","wrapperWidth","innerWrapperClassName","widthStyle","heightStyle","wrapperHeight","innerWrapper","sliderClassName","borderSlider","inputWidth","previousStyleSelection"],"sources":["@wordpress/components/src/border-control/border-control/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport * as styles from '../styles';\nimport { parseQuantityAndUnitFromRawValue } from '../../unit-control/utils';\nimport type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport type { Border, BorderControlProps } from '../types';\nimport { maybeWarnDeprecated36pxSize } from '../../utils/deprecated-36px-size';\n\n// If either width or color are defined, the border is considered valid\n// and a border style can be set as well.\nconst isValidBorder = ( border?: Border ) => {\n\tconst hasWidth = border?.width !== undefined && border.width !== '';\n\tconst hasColor = border?.color !== undefined;\n\treturn hasWidth || hasColor;\n};\n\nexport function useBorderControl(\n\tprops: WordPressComponentProps< BorderControlProps, 'div' >\n) {\n\tconst {\n\t\tclassName,\n\t\tcolors = [],\n\t\tisCompact,\n\t\tonChange,\n\t\tenableAlpha = true,\n\t\tenableStyle = true,\n\t\tshouldSanitizeBorder = true,\n\t\tsize = 'default',\n\t\tvalue: border,\n\t\twidth,\n\t\t__experimentalIsRenderedInSidebar = false,\n\t\t__next40pxDefaultSize,\n\t\t...otherProps\n\t} = useContextSystem( props, 'BorderControl' );\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'BorderControl',\n\t\t__next40pxDefaultSize,\n\t\tsize,\n\t} );\n\n\tconst computedSize =\n\t\tsize === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;\n\n\tconst [ widthValue, originalWidthUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tborder?.width\n\t);\n\tconst widthUnit = originalWidthUnit || 'px';\n\tconst hadPreviousZeroWidth = widthValue === 0;\n\n\tconst [ colorSelection, setColorSelection ] = useState< string >();\n\tconst [ styleSelection, setStyleSelection ] = useState< string >();\n\n\tconst isStyleSettable = shouldSanitizeBorder\n\t\t? isValidBorder( border )\n\t\t: true;\n\n\tconst onBorderChange = useCallback(\n\t\t( newBorder?: Border ) => {\n\t\t\tif ( shouldSanitizeBorder && ! isValidBorder( newBorder ) ) {\n\t\t\t\tonChange( undefined );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonChange( newBorder );\n\t\t},\n\t\t[ onChange, shouldSanitizeBorder ]\n\t);\n\n\tconst onWidthChange = useCallback(\n\t\t( newWidth?: string ) => {\n\t\t\tconst newWidthValue = newWidth === '' ? undefined : newWidth;\n\t\t\tconst [ parsedValue ] =\n\t\t\t\tparseQuantityAndUnitFromRawValue( newWidth );\n\t\t\tconst hasZeroWidth = parsedValue === 0;\n\t\t\tconst updatedBorder = { ...border, width: newWidthValue };\n\n\t\t\t// Setting the border width explicitly to zero will also set the\n\t\t\t// border style to `none` and clear the border color.\n\t\t\tif ( hasZeroWidth && ! hadPreviousZeroWidth ) {\n\t\t\t\t// Before clearing the color and style selections, keep track of\n\t\t\t\t// the current selections so they can be restored when the width\n\t\t\t\t// changes to a non-zero value.\n\t\t\t\tsetColorSelection( border?.color );\n\t\t\t\tsetStyleSelection( border?.style );\n\n\t\t\t\t// Clear the color and style border properties.\n\t\t\t\tupdatedBorder.color = undefined;\n\t\t\t\tupdatedBorder.style = 'none';\n\t\t\t}\n\n\t\t\t// Selection has changed from zero border width to non-zero width.\n\t\t\tif ( ! hasZeroWidth && hadPreviousZeroWidth ) {\n\t\t\t\t// Restore previous border color and style selections if width\n\t\t\t\t// is now not zero.\n\t\t\t\tif ( updatedBorder.color === undefined ) {\n\t\t\t\t\tupdatedBorder.color = colorSelection;\n\t\t\t\t}\n\t\t\t\tif ( updatedBorder.style === 'none' ) {\n\t\t\t\t\tupdatedBorder.style = styleSelection;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonBorderChange( updatedBorder );\n\t\t},\n\t\t[\n\t\t\tborder,\n\t\t\thadPreviousZeroWidth,\n\t\t\tcolorSelection,\n\t\t\tstyleSelection,\n\t\t\tonBorderChange,\n\t\t]\n\t);\n\n\tconst onSliderChange = useCallback(\n\t\t( value?: number ) => {\n\t\t\tonWidthChange( `${ value }${ widthUnit }` );\n\t\t},\n\t\t[ onWidthChange, widthUnit ]\n\t);\n\n\t// Generate class names.\n\tconst cx = useCx();\n\tconst classes = useMemo( () => {\n\t\treturn cx( styles.borderControl, className );\n\t}, [ className, cx ] );\n\n\tlet wrapperWidth = width;\n\tif ( isCompact ) {\n\t\t// Widths below represent the minimum usable width for compact controls.\n\t\t// Taller controls contain greater internal padding, thus greater width.\n\t\twrapperWidth = size === '__unstable-large' ? '116px' : '90px';\n\t}\n\tconst innerWrapperClassName = useMemo( () => {\n\t\tconst widthStyle = !! wrapperWidth && styles.wrapperWidth;\n\t\tconst heightStyle = styles.wrapperHeight( computedSize );\n\n\t\treturn cx( styles.innerWrapper(), widthStyle, heightStyle );\n\t}, [ wrapperWidth, cx, computedSize ] );\n\n\tconst sliderClassName = useMemo( () => {\n\t\treturn cx( styles.borderSlider() );\n\t}, [ cx ] );\n\n\treturn {\n\t\t...otherProps,\n\t\tclassName: classes,\n\t\tcolors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tinnerWrapperClassName,\n\t\tinputWidth: wrapperWidth,\n\t\tisStyleSettable,\n\t\tonBorderChange,\n\t\tonSliderChange,\n\t\tonWidthChange,\n\t\tpreviousStyleSelection: styleSelection,\n\t\tsliderClassName,\n\t\tvalue: border,\n\t\twidthUnit,\n\t\twidthValue,\n\t\tsize: computedSize,\n\t\t__experimentalIsRenderedInSidebar,\n\t\t__next40pxDefaultSize,\n\t};\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,mBAAA,GAAAN,OAAA;AAA+E,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,G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AO,GAAG,MAAM;EAC9D;EACA,MAAMqC,qBAAqB,GAAG,IAAAH,gBAAO,EAAE,MAAM;IAC5C,MAAMI,UAAU,GAAG,CAAC,CAAEF,YAAY,IAAI9E,MAAM,CAAC8E,YAAY;IACzD,MAAMG,WAAW,GAAGjF,MAAM,CAACkF,aAAa,CAAEhC,YAAa,CAAC;IAExD,OAAOuB,EAAE,CAAEzE,MAAM,CAACmF,YAAY,CAAC,CAAC,EAAEH,UAAU,EAAEC,WAAY,CAAC;EAC5D,CAAC,EAAE,CAAEH,YAAY,EAAEL,EAAE,EAAEvB,YAAY,CAAG,CAAC;EAEvC,MAAMkC,eAAe,GAAG,IAAAR,gBAAO,EAAE,MAAM;IACtC,OAAOH,EAAE,CAAEzE,MAAM,CAACqF,YAAY,CAAC,CAAE,CAAC;EACnC,CAAC,EAAE,CAAEZ,EAAE,CAAG,CAAC;EAEX,OAAO;IACN,GAAG3B,UAAU;IACbX,SAAS,EAAEwC,OAAO;IAClBvC,MAAM;IACNG,WAAW;IACXC,WAAW;IACXuC,qBAAqB;IACrBO,UAAU,EAAER,YAAY;IACxBjB,eAAe;IACfC,cAAc;IACdU,cAAc;IACdP,aAAa;IACbsB,sBAAsB,EAAE5B,cAAc;IACtCyB,eAAe;IACfzC,KAAK,EAAEhB,MAAM;IACb2B,SAAS;IACTH,UAAU;IACVT,IAAI,EAAEQ,YAAY;IAClBN,iCAAiC;IACjCC;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","styles","_interopRequireWildcard","_utils","_context","_useCx","_deprecated36pxSize","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","isValidBorder","border","hasWidth","width","undefined","hasColor","color","useBorderControl","props","className","colors","isCompact","onChange","enableAlpha","enableStyle","shouldSanitizeBorder","size","value","__experimentalIsRenderedInSidebar","__next40pxDefaultSize","__shouldNotWarnDeprecated36pxSize","otherProps","useContextSystem","maybeWarnDeprecated36pxSize","componentName","computedSize","widthValue","originalWidthUnit","parseQuantityAndUnitFromRawValue","widthUnit","hadPreviousZeroWidth","colorSelection","setColorSelection","useState","styleSelection","setStyleSelection","isStyleSettable","onBorderChange","useCallback","newBorder","onWidthChange","newWidth","newWidthValue","parsedValue","hasZeroWidth","updatedBorder","style","onSliderChange","cx","useCx","classes","useMemo","borderControl","wrapperWidth","innerWrapperClassName","widthStyle","heightStyle","wrapperHeight","innerWrapper","sliderClassName","borderSlider","inputWidth","previousStyleSelection"],"sources":["@wordpress/components/src/border-control/border-control/hook.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback, useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport * as styles from '../styles';\nimport { parseQuantityAndUnitFromRawValue } from '../../unit-control/utils';\nimport type { WordPressComponentProps } from '../../context';\nimport { useContextSystem } from '../../context';\nimport { useCx } from '../../utils/hooks/use-cx';\nimport type { Border, BorderControlProps } from '../types';\nimport { maybeWarnDeprecated36pxSize } from '../../utils/deprecated-36px-size';\n\n// If either width or color are defined, the border is considered valid\n// and a border style can be set as well.\nconst isValidBorder = ( border?: Border ) => {\n\tconst hasWidth = border?.width !== undefined && border.width !== '';\n\tconst hasColor = border?.color !== undefined;\n\treturn hasWidth || hasColor;\n};\n\nexport function useBorderControl(\n\tprops: WordPressComponentProps< BorderControlProps, 'div' >\n) {\n\tconst {\n\t\tclassName,\n\t\tcolors = [],\n\t\tisCompact,\n\t\tonChange,\n\t\tenableAlpha = true,\n\t\tenableStyle = true,\n\t\tshouldSanitizeBorder = true,\n\t\tsize = 'default',\n\t\tvalue: border,\n\t\twidth,\n\t\t__experimentalIsRenderedInSidebar = false,\n\t\t__next40pxDefaultSize,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t\t...otherProps\n\t} = useContextSystem( props, 'BorderControl' );\n\n\tmaybeWarnDeprecated36pxSize( {\n\t\tcomponentName: 'BorderControl',\n\t\t__next40pxDefaultSize,\n\t\tsize,\n\t\t__shouldNotWarnDeprecated36pxSize,\n\t} );\n\n\tconst computedSize =\n\t\tsize === 'default' && __next40pxDefaultSize ? '__unstable-large' : size;\n\n\tconst [ widthValue, originalWidthUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tborder?.width\n\t);\n\tconst widthUnit = originalWidthUnit || 'px';\n\tconst hadPreviousZeroWidth = widthValue === 0;\n\n\tconst [ colorSelection, setColorSelection ] = useState< string >();\n\tconst [ styleSelection, setStyleSelection ] = useState< string >();\n\n\tconst isStyleSettable = shouldSanitizeBorder\n\t\t? isValidBorder( border )\n\t\t: true;\n\n\tconst onBorderChange = useCallback(\n\t\t( newBorder?: Border ) => {\n\t\t\tif ( shouldSanitizeBorder && ! isValidBorder( newBorder ) ) {\n\t\t\t\tonChange( undefined );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonChange( newBorder );\n\t\t},\n\t\t[ onChange, shouldSanitizeBorder ]\n\t);\n\n\tconst onWidthChange = useCallback(\n\t\t( newWidth?: string ) => {\n\t\t\tconst newWidthValue = newWidth === '' ? undefined : newWidth;\n\t\t\tconst [ parsedValue ] =\n\t\t\t\tparseQuantityAndUnitFromRawValue( newWidth );\n\t\t\tconst hasZeroWidth = parsedValue === 0;\n\t\t\tconst updatedBorder = { ...border, width: newWidthValue };\n\n\t\t\t// Setting the border width explicitly to zero will also set the\n\t\t\t// border style to `none` and clear the border color.\n\t\t\tif ( hasZeroWidth && ! hadPreviousZeroWidth ) {\n\t\t\t\t// Before clearing the color and style selections, keep track of\n\t\t\t\t// the current selections so they can be restored when the width\n\t\t\t\t// changes to a non-zero value.\n\t\t\t\tsetColorSelection( border?.color );\n\t\t\t\tsetStyleSelection( border?.style );\n\n\t\t\t\t// Clear the color and style border properties.\n\t\t\t\tupdatedBorder.color = undefined;\n\t\t\t\tupdatedBorder.style = 'none';\n\t\t\t}\n\n\t\t\t// Selection has changed from zero border width to non-zero width.\n\t\t\tif ( ! hasZeroWidth && hadPreviousZeroWidth ) {\n\t\t\t\t// Restore previous border color and style selections if width\n\t\t\t\t// is now not zero.\n\t\t\t\tif ( updatedBorder.color === undefined ) {\n\t\t\t\t\tupdatedBorder.color = colorSelection;\n\t\t\t\t}\n\t\t\t\tif ( updatedBorder.style === 'none' ) {\n\t\t\t\t\tupdatedBorder.style = styleSelection;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonBorderChange( updatedBorder );\n\t\t},\n\t\t[\n\t\t\tborder,\n\t\t\thadPreviousZeroWidth,\n\t\t\tcolorSelection,\n\t\t\tstyleSelection,\n\t\t\tonBorderChange,\n\t\t]\n\t);\n\n\tconst onSliderChange = useCallback(\n\t\t( value?: number ) => {\n\t\t\tonWidthChange( `${ value }${ widthUnit }` );\n\t\t},\n\t\t[ onWidthChange, widthUnit ]\n\t);\n\n\t// Generate class names.\n\tconst cx = useCx();\n\tconst classes = useMemo( () => {\n\t\treturn cx( styles.borderControl, className );\n\t}, [ className, cx ] );\n\n\tlet wrapperWidth = width;\n\tif ( isCompact ) {\n\t\t// Widths below represent the minimum usable width for compact controls.\n\t\t// Taller controls contain greater internal padding, thus greater width.\n\t\twrapperWidth = size === '__unstable-large' ? '116px' : '90px';\n\t}\n\tconst innerWrapperClassName = useMemo( () => {\n\t\tconst widthStyle = !! wrapperWidth && styles.wrapperWidth;\n\t\tconst heightStyle = styles.wrapperHeight( computedSize );\n\n\t\treturn cx( styles.innerWrapper(), widthStyle, heightStyle );\n\t}, [ wrapperWidth, cx, computedSize ] );\n\n\tconst sliderClassName = useMemo( () => {\n\t\treturn cx( styles.borderSlider() );\n\t}, [ cx ] );\n\n\treturn {\n\t\t...otherProps,\n\t\tclassName: classes,\n\t\tcolors,\n\t\tenableAlpha,\n\t\tenableStyle,\n\t\tinnerWrapperClassName,\n\t\tinputWidth: wrapperWidth,\n\t\tisStyleSettable,\n\t\tonBorderChange,\n\t\tonSliderChange,\n\t\tonWidthChange,\n\t\tpreviousStyleSelection: styleSelection,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YAAY,CAAG,CAAC;EAEvC,MAAMkC,eAAe,GAAG,IAAAR,gBAAO,EAAE,MAAM;IACtC,OAAOH,EAAE,CAAE1E,MAAM,CAACsF,YAAY,CAAC,CAAE,CAAC;EACnC,CAAC,EAAE,CAAEZ,EAAE,CAAG,CAAC;EAEX,OAAO;IACN,GAAG3B,UAAU;IACbZ,SAAS,EAAEyC,OAAO;IAClBxC,MAAM;IACNG,WAAW;IACXC,WAAW;IACXwC,qBAAqB;IACrBO,UAAU,EAAER,YAAY;IACxBjB,eAAe;IACfC,cAAc;IACdU,cAAc;IACdP,aAAa;IACbsB,sBAAsB,EAAE5B,cAAc;IACtCyB,eAAe;IACf1C,KAAK,EAAEhB,MAAM;IACb4B,SAAS;IACTH,UAAU;IACVV,IAAI,EAAES,YAAY;IAClBP,iCAAiC;IACjCC;EACD,CAAC;AACF","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,