@wordpress/components 27.5.0 → 27.6.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 (938) hide show
  1. package/CHANGELOG.md +25 -5
  2. package/build/alignment-matrix-control/icon.js +2 -2
  3. package/build/alignment-matrix-control/icon.js.map +1 -1
  4. package/build/alignment-matrix-control/index.js +2 -2
  5. package/build/alignment-matrix-control/index.js.map +1 -1
  6. package/build/angle-picker-control/index.js +2 -2
  7. package/build/angle-picker-control/index.js.map +1 -1
  8. package/build/animate/index.js +4 -4
  9. package/build/animate/index.js.map +1 -1
  10. package/build/autocomplete/autocompleter-ui.js +2 -2
  11. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  12. package/build/base-control/hooks.js +1 -4
  13. package/build/base-control/hooks.js.map +1 -1
  14. package/build/base-control/index.js +2 -2
  15. package/build/base-control/index.js.map +1 -1
  16. package/build/base-control/types.js.map +1 -1
  17. package/build/border-control/types.js.map +1 -1
  18. package/build/button/index.js +2 -2
  19. package/build/button/index.js.map +1 -1
  20. package/build/button-group/index.js +2 -2
  21. package/build/button-group/index.js.map +1 -1
  22. package/build/checkbox-control/index.js +2 -2
  23. package/build/checkbox-control/index.js.map +1 -1
  24. package/build/circular-option-picker/circular-option-picker-actions.js +3 -3
  25. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  26. package/build/circular-option-picker/circular-option-picker-option-group.js +2 -2
  27. package/build/circular-option-picker/circular-option-picker-option-group.js.map +1 -1
  28. package/build/circular-option-picker/circular-option-picker-option.js +2 -2
  29. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  30. package/build/circular-option-picker/circular-option-picker.js +2 -2
  31. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  32. package/build/clipboard-button/index.js +2 -2
  33. package/build/clipboard-button/index.js.map +1 -1
  34. package/build/color-indicator/index.js +2 -2
  35. package/build/color-indicator/index.js.map +1 -1
  36. package/build/color-palette/index.js +2 -2
  37. package/build/color-palette/index.js.map +1 -1
  38. package/build/combobox-control/index.js +7 -2
  39. package/build/combobox-control/index.js.map +1 -1
  40. package/build/combobox-control/types.js.map +1 -1
  41. package/build/custom-gradient-picker/gradient-bar/control-points.js +3 -3
  42. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  43. package/build/custom-gradient-picker/gradient-bar/index.js +2 -2
  44. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  45. package/build/custom-gradient-picker/index.js.map +1 -1
  46. package/build/custom-select-control/index.js +3 -3
  47. package/build/custom-select-control/index.js.map +1 -1
  48. package/build/dimension-control/index.js +2 -2
  49. package/build/dimension-control/index.js.map +1 -1
  50. package/build/drop-zone/index.js +2 -2
  51. package/build/drop-zone/index.js.map +1 -1
  52. package/build/dropdown/index.js +2 -2
  53. package/build/dropdown/index.js.map +1 -1
  54. package/build/dropdown-menu/index.js +5 -5
  55. package/build/dropdown-menu/index.js.map +1 -1
  56. package/build/dropdown-menu/index.native.js +4 -4
  57. package/build/dropdown-menu/index.native.js.map +1 -1
  58. package/build/external-link/index.js +2 -2
  59. package/build/external-link/index.js.map +1 -1
  60. package/build/focal-point-picker/focal-point.js +2 -2
  61. package/build/focal-point-picker/focal-point.js.map +1 -1
  62. package/build/focal-point-picker/index.js +2 -2
  63. package/build/focal-point-picker/index.js.map +1 -1
  64. package/build/form-toggle/index.js +2 -2
  65. package/build/form-toggle/index.js.map +1 -1
  66. package/build/form-token-field/index.js +3 -3
  67. package/build/form-token-field/index.js.map +1 -1
  68. package/build/form-token-field/suggestions-list.js +9 -5
  69. package/build/form-token-field/suggestions-list.js.map +1 -1
  70. package/build/form-token-field/token-input.js +2 -2
  71. package/build/form-token-field/token-input.js.map +1 -1
  72. package/build/form-token-field/token.js +2 -2
  73. package/build/form-token-field/token.js.map +1 -1
  74. package/build/guide/index.js +2 -2
  75. package/build/guide/index.js.map +1 -1
  76. package/build/input-control/index.js +3 -6
  77. package/build/input-control/index.js.map +1 -1
  78. package/build/menu-group/index.js +2 -2
  79. package/build/menu-group/index.js.map +1 -1
  80. package/build/menu-item/index.js +3 -3
  81. package/build/menu-item/index.js.map +1 -1
  82. package/build/mobile/color-settings/utils.native.js +1 -1
  83. package/build/mobile/color-settings/utils.native.js.map +1 -1
  84. package/build/modal/index.js +4 -4
  85. package/build/modal/index.js.map +1 -1
  86. package/build/navigation/back-button/index.js +2 -2
  87. package/build/navigation/back-button/index.js.map +1 -1
  88. package/build/navigation/group/index.js +2 -2
  89. package/build/navigation/group/index.js.map +1 -1
  90. package/build/navigation/index.js +3 -3
  91. package/build/navigation/index.js.map +1 -1
  92. package/build/navigation/item/base.js +2 -2
  93. package/build/navigation/item/base.js.map +1 -1
  94. package/build/navigation/item/index.js +2 -2
  95. package/build/navigation/item/index.js.map +1 -1
  96. package/build/navigation/menu/index.js +2 -2
  97. package/build/navigation/menu/index.js.map +1 -1
  98. package/build/notice/index.js +3 -3
  99. package/build/notice/index.js.map +1 -1
  100. package/build/notice/list.js +2 -2
  101. package/build/notice/list.js.map +1 -1
  102. package/build/number-control/index.js +2 -2
  103. package/build/number-control/index.js.map +1 -1
  104. package/build/palette-edit/index.js +5 -5
  105. package/build/palette-edit/index.js.map +1 -1
  106. package/build/palette-edit/styles.js +14 -15
  107. package/build/palette-edit/styles.js.map +1 -1
  108. package/build/panel/body.js +2 -2
  109. package/build/panel/body.js.map +1 -1
  110. package/build/panel/index.js +2 -2
  111. package/build/panel/index.js.map +1 -1
  112. package/build/panel/row.js +2 -2
  113. package/build/panel/row.js.map +1 -1
  114. package/build/placeholder/index.js +3 -3
  115. package/build/placeholder/index.js.map +1 -1
  116. package/build/popover/index.js +2 -2
  117. package/build/popover/index.js.map +1 -1
  118. package/build/radio-control/index.js +2 -2
  119. package/build/radio-control/index.js.map +1 -1
  120. package/build/range-control/index.js +3 -3
  121. package/build/range-control/index.js.map +1 -1
  122. package/build/range-control/mark.js +3 -3
  123. package/build/range-control/mark.js.map +1 -1
  124. package/build/range-control/tooltip.js +2 -2
  125. package/build/range-control/tooltip.js.map +1 -1
  126. package/build/resizable-box/index.js +10 -10
  127. package/build/resizable-box/index.js.map +1 -1
  128. package/build/resizable-box/resize-tooltip/index.js +2 -2
  129. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  130. package/build/responsive-wrapper/index.js +2 -2
  131. package/build/responsive-wrapper/index.js.map +1 -1
  132. package/build/search-control/index.js +2 -2
  133. package/build/search-control/index.js.map +1 -1
  134. package/build/select-control/index.js +2 -2
  135. package/build/select-control/index.js.map +1 -1
  136. package/build/snackbar/index.js +3 -3
  137. package/build/snackbar/index.js.map +1 -1
  138. package/build/snackbar/list.js +2 -2
  139. package/build/snackbar/list.js.map +1 -1
  140. package/build/spinner/index.js +2 -2
  141. package/build/spinner/index.js.map +1 -1
  142. package/build/tab-panel/index.js +2 -2
  143. package/build/tab-panel/index.js.map +1 -1
  144. package/build/text-control/index.js +2 -2
  145. package/build/text-control/index.js.map +1 -1
  146. package/build/toolbar/toolbar/index.js +2 -2
  147. package/build/toolbar/toolbar/index.js.map +1 -1
  148. package/build/toolbar/toolbar-button/index.js +3 -3
  149. package/build/toolbar/toolbar-button/index.js.map +1 -1
  150. package/build/toolbar/toolbar-group/index.js +2 -2
  151. package/build/toolbar/toolbar-group/index.js.map +1 -1
  152. package/build/tools-panel/tools-panel/hook.js +5 -6
  153. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  154. package/build/tools-panel/tools-panel-item/hook.js +6 -8
  155. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  156. package/build/tools-panel/types.js.map +1 -1
  157. package/build/truncate/hook.js +1 -1
  158. package/build/truncate/hook.js.map +1 -1
  159. package/build/unit-control/index.js +2 -2
  160. package/build/unit-control/index.js.map +1 -1
  161. package/build/unit-control/unit-select-control.js +2 -2
  162. package/build/unit-control/unit-select-control.js.map +1 -1
  163. package/build-module/alignment-matrix-control/icon.js +2 -2
  164. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  165. package/build-module/alignment-matrix-control/index.js +2 -2
  166. package/build-module/alignment-matrix-control/index.js.map +1 -1
  167. package/build-module/angle-picker-control/index.js +2 -2
  168. package/build-module/angle-picker-control/index.js.map +1 -1
  169. package/build-module/animate/index.js +4 -4
  170. package/build-module/animate/index.js.map +1 -1
  171. package/build-module/autocomplete/autocompleter-ui.js +2 -2
  172. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  173. package/build-module/base-control/hooks.js +1 -4
  174. package/build-module/base-control/hooks.js.map +1 -1
  175. package/build-module/base-control/index.js +2 -2
  176. package/build-module/base-control/index.js.map +1 -1
  177. package/build-module/base-control/types.js.map +1 -1
  178. package/build-module/border-control/types.js.map +1 -1
  179. package/build-module/button/index.js +2 -2
  180. package/build-module/button/index.js.map +1 -1
  181. package/build-module/button-group/index.js +2 -2
  182. package/build-module/button-group/index.js.map +1 -1
  183. package/build-module/checkbox-control/index.js +2 -2
  184. package/build-module/checkbox-control/index.js.map +1 -1
  185. package/build-module/circular-option-picker/circular-option-picker-actions.js +3 -3
  186. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  187. package/build-module/circular-option-picker/circular-option-picker-option-group.js +2 -2
  188. package/build-module/circular-option-picker/circular-option-picker-option-group.js.map +1 -1
  189. package/build-module/circular-option-picker/circular-option-picker-option.js +2 -2
  190. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  191. package/build-module/circular-option-picker/circular-option-picker.js +2 -2
  192. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  193. package/build-module/clipboard-button/index.js +2 -2
  194. package/build-module/clipboard-button/index.js.map +1 -1
  195. package/build-module/color-indicator/index.js +2 -2
  196. package/build-module/color-indicator/index.js.map +1 -1
  197. package/build-module/color-palette/index.js +2 -2
  198. package/build-module/color-palette/index.js.map +1 -1
  199. package/build-module/combobox-control/index.js +7 -2
  200. package/build-module/combobox-control/index.js.map +1 -1
  201. package/build-module/combobox-control/types.js.map +1 -1
  202. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +3 -3
  203. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  204. package/build-module/custom-gradient-picker/gradient-bar/index.js +2 -2
  205. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  206. package/build-module/custom-gradient-picker/index.js.map +1 -1
  207. package/build-module/custom-select-control/index.js +3 -3
  208. package/build-module/custom-select-control/index.js.map +1 -1
  209. package/build-module/dimension-control/index.js +2 -2
  210. package/build-module/dimension-control/index.js.map +1 -1
  211. package/build-module/drop-zone/index.js +2 -2
  212. package/build-module/drop-zone/index.js.map +1 -1
  213. package/build-module/dropdown/index.js +2 -2
  214. package/build-module/dropdown/index.js.map +1 -1
  215. package/build-module/dropdown-menu/index.js +5 -5
  216. package/build-module/dropdown-menu/index.js.map +1 -1
  217. package/build-module/dropdown-menu/index.native.js +4 -4
  218. package/build-module/dropdown-menu/index.native.js.map +1 -1
  219. package/build-module/external-link/index.js +2 -2
  220. package/build-module/external-link/index.js.map +1 -1
  221. package/build-module/focal-point-picker/focal-point.js +2 -2
  222. package/build-module/focal-point-picker/focal-point.js.map +1 -1
  223. package/build-module/focal-point-picker/index.js +2 -2
  224. package/build-module/focal-point-picker/index.js.map +1 -1
  225. package/build-module/form-toggle/index.js +2 -2
  226. package/build-module/form-toggle/index.js.map +1 -1
  227. package/build-module/form-token-field/index.js +3 -3
  228. package/build-module/form-token-field/index.js.map +1 -1
  229. package/build-module/form-token-field/suggestions-list.js +9 -5
  230. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  231. package/build-module/form-token-field/token-input.js +2 -2
  232. package/build-module/form-token-field/token-input.js.map +1 -1
  233. package/build-module/form-token-field/token.js +2 -2
  234. package/build-module/form-token-field/token.js.map +1 -1
  235. package/build-module/guide/index.js +2 -2
  236. package/build-module/guide/index.js.map +1 -1
  237. package/build-module/input-control/index.js +3 -6
  238. package/build-module/input-control/index.js.map +1 -1
  239. package/build-module/menu-group/index.js +2 -2
  240. package/build-module/menu-group/index.js.map +1 -1
  241. package/build-module/menu-item/index.js +3 -3
  242. package/build-module/menu-item/index.js.map +1 -1
  243. package/build-module/mobile/color-settings/utils.native.js +1 -1
  244. package/build-module/mobile/color-settings/utils.native.js.map +1 -1
  245. package/build-module/modal/index.js +4 -4
  246. package/build-module/modal/index.js.map +1 -1
  247. package/build-module/navigation/back-button/index.js +2 -2
  248. package/build-module/navigation/back-button/index.js.map +1 -1
  249. package/build-module/navigation/group/index.js +2 -2
  250. package/build-module/navigation/group/index.js.map +1 -1
  251. package/build-module/navigation/index.js +3 -3
  252. package/build-module/navigation/index.js.map +1 -1
  253. package/build-module/navigation/item/base.js +2 -2
  254. package/build-module/navigation/item/base.js.map +1 -1
  255. package/build-module/navigation/item/index.js +2 -2
  256. package/build-module/navigation/item/index.js.map +1 -1
  257. package/build-module/navigation/menu/index.js +2 -2
  258. package/build-module/navigation/menu/index.js.map +1 -1
  259. package/build-module/notice/index.js +3 -3
  260. package/build-module/notice/index.js.map +1 -1
  261. package/build-module/notice/list.js +2 -2
  262. package/build-module/notice/list.js.map +1 -1
  263. package/build-module/number-control/index.js +2 -2
  264. package/build-module/number-control/index.js.map +1 -1
  265. package/build-module/palette-edit/index.js +6 -6
  266. package/build-module/palette-edit/index.js.map +1 -1
  267. package/build-module/palette-edit/styles.js +13 -14
  268. package/build-module/palette-edit/styles.js.map +1 -1
  269. package/build-module/panel/body.js +2 -2
  270. package/build-module/panel/body.js.map +1 -1
  271. package/build-module/panel/index.js +2 -2
  272. package/build-module/panel/index.js.map +1 -1
  273. package/build-module/panel/row.js +2 -2
  274. package/build-module/panel/row.js.map +1 -1
  275. package/build-module/placeholder/index.js +3 -3
  276. package/build-module/placeholder/index.js.map +1 -1
  277. package/build-module/popover/index.js +2 -2
  278. package/build-module/popover/index.js.map +1 -1
  279. package/build-module/radio-control/index.js +2 -2
  280. package/build-module/radio-control/index.js.map +1 -1
  281. package/build-module/range-control/index.js +3 -3
  282. package/build-module/range-control/index.js.map +1 -1
  283. package/build-module/range-control/mark.js +3 -3
  284. package/build-module/range-control/mark.js.map +1 -1
  285. package/build-module/range-control/tooltip.js +2 -2
  286. package/build-module/range-control/tooltip.js.map +1 -1
  287. package/build-module/resizable-box/index.js +10 -10
  288. package/build-module/resizable-box/index.js.map +1 -1
  289. package/build-module/resizable-box/resize-tooltip/index.js +2 -2
  290. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  291. package/build-module/responsive-wrapper/index.js +2 -2
  292. package/build-module/responsive-wrapper/index.js.map +1 -1
  293. package/build-module/search-control/index.js +2 -2
  294. package/build-module/search-control/index.js.map +1 -1
  295. package/build-module/select-control/index.js +2 -2
  296. package/build-module/select-control/index.js.map +1 -1
  297. package/build-module/snackbar/index.js +3 -3
  298. package/build-module/snackbar/index.js.map +1 -1
  299. package/build-module/snackbar/list.js +2 -2
  300. package/build-module/snackbar/list.js.map +1 -1
  301. package/build-module/spinner/index.js +2 -2
  302. package/build-module/spinner/index.js.map +1 -1
  303. package/build-module/tab-panel/index.js +2 -2
  304. package/build-module/tab-panel/index.js.map +1 -1
  305. package/build-module/text-control/index.js +2 -2
  306. package/build-module/text-control/index.js.map +1 -1
  307. package/build-module/toolbar/toolbar/index.js +2 -2
  308. package/build-module/toolbar/toolbar/index.js.map +1 -1
  309. package/build-module/toolbar/toolbar-button/index.js +3 -3
  310. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  311. package/build-module/toolbar/toolbar-group/index.js +2 -2
  312. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  313. package/build-module/tools-panel/tools-panel/hook.js +5 -6
  314. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  315. package/build-module/tools-panel/tools-panel-item/hook.js +6 -8
  316. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  317. package/build-module/tools-panel/types.js.map +1 -1
  318. package/build-module/truncate/hook.js +1 -1
  319. package/build-module/truncate/hook.js.map +1 -1
  320. package/build-module/unit-control/index.js +2 -2
  321. package/build-module/unit-control/index.js.map +1 -1
  322. package/build-module/unit-control/unit-select-control.js +2 -2
  323. package/build-module/unit-control/unit-select-control.js.map +1 -1
  324. package/build-style/style-rtl.css +18 -20
  325. package/build-style/style.css +18 -20
  326. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  327. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  328. package/build-types/alignment-matrix-control/icon.d.ts +1 -1
  329. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  330. package/build-types/alignment-matrix-control/index.d.ts +1 -1
  331. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  332. package/build-types/alignment-matrix-control/stories/index.story.d.ts +2 -2
  333. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  334. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +4 -4
  335. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts +4 -4
  336. package/build-types/angle-picker-control/angle-circle.d.ts +1 -1
  337. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  338. package/build-types/angle-picker-control/index.d.ts +1 -1
  339. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  340. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +4 -4
  341. package/build-types/animate/index.d.ts.map +1 -1
  342. package/build-types/autocomplete/autocompleter-ui.d.ts +1 -1
  343. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  344. package/build-types/autocomplete/index.d.ts +3 -3
  345. package/build-types/autocomplete/index.d.ts.map +1 -1
  346. package/build-types/base-control/hooks.d.ts +1 -0
  347. package/build-types/base-control/hooks.d.ts.map +1 -1
  348. package/build-types/base-control/index.d.ts +2 -2
  349. package/build-types/base-control/index.d.ts.map +1 -1
  350. package/build-types/base-control/styles/base-control-styles.d.ts +5 -5
  351. package/build-types/base-control/types.d.ts +1 -2
  352. package/build-types/base-control/types.d.ts.map +1 -1
  353. package/build-types/border-box-control/border-box-control/hook.d.ts +67 -57
  354. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  355. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +68 -59
  356. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  357. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +67 -57
  358. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  359. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +67 -57
  360. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  361. package/build-types/border-box-control/stories/index.story.d.ts +1 -1
  362. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  363. package/build-types/border-control/border-control/component.d.ts +1 -0
  364. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  365. package/build-types/border-control/border-control/hook.d.ts +68 -57
  366. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  367. package/build-types/border-control/border-control-dropdown/hook.d.ts +67 -57
  368. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  369. package/build-types/border-control/border-control-style-picker/component.d.ts +1 -1
  370. package/build-types/border-control/stories/index.story.d.ts +12 -6
  371. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  372. package/build-types/border-control/types.d.ts +4 -0
  373. package/build-types/border-control/types.d.ts.map +1 -1
  374. package/build-types/box-control/all-input-control.d.ts +1 -1
  375. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  376. package/build-types/box-control/axial-input-controls.d.ts +1 -1
  377. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  378. package/build-types/box-control/icon.d.ts +1 -1
  379. package/build-types/box-control/icon.d.ts.map +1 -1
  380. package/build-types/box-control/index.d.ts +1 -1
  381. package/build-types/box-control/index.d.ts.map +1 -1
  382. package/build-types/box-control/input-controls.d.ts +1 -1
  383. package/build-types/box-control/input-controls.d.ts.map +1 -1
  384. package/build-types/box-control/linked-button.d.ts +1 -1
  385. package/build-types/box-control/linked-button.d.ts.map +1 -1
  386. package/build-types/box-control/stories/index.story.d.ts +427 -378
  387. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  388. package/build-types/box-control/styles/box-control-icon-styles.d.ts +6 -6
  389. package/build-types/box-control/styles/box-control-styles.d.ts +5 -5
  390. package/build-types/button/deprecated.d.ts +5 -51
  391. package/build-types/button/deprecated.d.ts.map +1 -1
  392. package/build-types/button/index.d.ts +1 -1
  393. package/build-types/button/index.d.ts.map +1 -1
  394. package/build-types/button/stories/index.story.d.ts +1 -1
  395. package/build-types/button/stories/index.story.d.ts.map +1 -1
  396. package/build-types/button-group/index.d.ts +1 -1
  397. package/build-types/button-group/index.d.ts.map +1 -1
  398. package/build-types/card/card/hook.d.ts +67 -57
  399. package/build-types/card/card/hook.d.ts.map +1 -1
  400. package/build-types/card/card-body/hook.d.ts +67 -57
  401. package/build-types/card/card-body/hook.d.ts.map +1 -1
  402. package/build-types/card/card-divider/hook.d.ts +67 -57
  403. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  404. package/build-types/card/card-footer/hook.d.ts +67 -57
  405. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  406. package/build-types/card/card-header/hook.d.ts +67 -57
  407. package/build-types/card/card-header/hook.d.ts.map +1 -1
  408. package/build-types/card/card-media/hook.d.ts +67 -57
  409. package/build-types/card/card-media/hook.d.ts.map +1 -1
  410. package/build-types/card/stories/index.story.d.ts +2 -2
  411. package/build-types/checkbox-control/index.d.ts +1 -1
  412. package/build-types/checkbox-control/index.d.ts.map +1 -1
  413. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts +2 -2
  414. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  415. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts +1 -1
  416. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts.map +1 -1
  417. package/build-types/circular-option-picker/circular-option-picker-option.d.ts +1 -1
  418. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  419. package/build-types/circular-option-picker/circular-option-picker.d.ts +1 -1
  420. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  421. package/build-types/clipboard-button/index.d.ts +1 -1
  422. package/build-types/clipboard-button/index.d.ts.map +1 -1
  423. package/build-types/color-indicator/index.d.ts +1 -1
  424. package/build-types/color-indicator/index.d.ts.map +1 -1
  425. package/build-types/color-palette/index.d.ts +1 -1
  426. package/build-types/color-palette/index.d.ts.map +1 -1
  427. package/build-types/color-palette/styles.d.ts +1 -1
  428. package/build-types/color-picker/color-copy-button.d.ts +1 -1
  429. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  430. package/build-types/color-picker/color-input.d.ts +1 -1
  431. package/build-types/color-picker/color-input.d.ts.map +1 -1
  432. package/build-types/color-picker/component.d.ts +2 -2
  433. package/build-types/color-picker/component.d.ts.map +1 -1
  434. package/build-types/color-picker/hex-input.d.ts +1 -1
  435. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  436. package/build-types/color-picker/hsl-input.d.ts +1 -1
  437. package/build-types/color-picker/hsl-input.d.ts.map +1 -1
  438. package/build-types/color-picker/input-with-slider.d.ts +1 -1
  439. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  440. package/build-types/color-picker/legacy-adapter.d.ts +1 -1
  441. package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
  442. package/build-types/color-picker/picker.d.ts +1 -1
  443. package/build-types/color-picker/picker.d.ts.map +1 -1
  444. package/build-types/color-picker/rgb-input.d.ts +1 -1
  445. package/build-types/color-picker/rgb-input.d.ts.map +1 -1
  446. package/build-types/color-picker/stories/index.story.d.ts +1 -1
  447. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  448. package/build-types/color-picker/styles.d.ts +6 -6
  449. package/build-types/combobox-control/index.d.ts +3 -1
  450. package/build-types/combobox-control/index.d.ts.map +1 -1
  451. package/build-types/combobox-control/stories/index.story.d.ts +22 -2
  452. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  453. package/build-types/combobox-control/styles.d.ts +1 -1
  454. package/build-types/combobox-control/types.d.ts +1 -0
  455. package/build-types/combobox-control/types.d.ts.map +1 -1
  456. package/build-types/composite/current/stories/utils.d.ts +1 -1
  457. package/build-types/composite/current/stories/utils.d.ts.map +1 -1
  458. package/build-types/composite/legacy/stories/utils.d.ts +1 -1
  459. package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
  460. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  461. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  462. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +2 -2
  463. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  464. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +1 -1
  465. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
  466. package/build-types/custom-gradient-picker/index.d.ts +1 -1
  467. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  468. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +2 -2
  469. package/build-types/custom-select-control/index.d.ts +2 -2
  470. package/build-types/custom-select-control/index.d.ts.map +1 -1
  471. package/build-types/custom-select-control-v2/custom-select.d.ts +1 -1
  472. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  473. package/build-types/custom-select-control-v2/default-component/index.d.ts +1 -1
  474. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
  475. package/build-types/custom-select-control-v2/item.d.ts +1 -1
  476. package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
  477. package/build-types/custom-select-control-v2/legacy-component/index.d.ts +1 -1
  478. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  479. package/build-types/custom-select-control-v2/stories/default.story.d.ts +3 -3
  480. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
  481. package/build-types/custom-select-control-v2/styles.d.ts +8 -8
  482. package/build-types/dashicon/index.d.ts +1 -1
  483. package/build-types/dashicon/index.d.ts.map +1 -1
  484. package/build-types/date-time/date/index.d.ts +1 -1
  485. package/build-types/date-time/date/index.d.ts.map +1 -1
  486. package/build-types/date-time/date/styles.d.ts +5 -5
  487. package/build-types/date-time/date-time/styles.d.ts +1 -1
  488. package/build-types/date-time/time/index.d.ts +1 -1
  489. package/build-types/date-time/time/index.d.ts.map +1 -1
  490. package/build-types/date-time/time/styles.d.ts +10 -10
  491. package/build-types/date-time/time/timezone.d.ts +1 -1
  492. package/build-types/date-time/time/timezone.d.ts.map +1 -1
  493. package/build-types/dimension-control/index.d.ts +1 -1
  494. package/build-types/dimension-control/index.d.ts.map +1 -1
  495. package/build-types/disabled/index.d.ts +1 -1
  496. package/build-types/disabled/index.d.ts.map +1 -1
  497. package/build-types/disclosure/index.d.ts +1 -1
  498. package/build-types/disclosure/index.d.ts.map +1 -1
  499. package/build-types/divider/styles.d.ts +1 -1
  500. package/build-types/draggable/index.d.ts +1 -1
  501. package/build-types/draggable/index.d.ts.map +1 -1
  502. package/build-types/drop-zone/index.d.ts +1 -1
  503. package/build-types/drop-zone/index.d.ts.map +1 -1
  504. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  505. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  506. package/build-types/dropdown/index.d.ts +1 -1
  507. package/build-types/dropdown/index.d.ts.map +1 -1
  508. package/build-types/dropdown/stories/index.story.d.ts +4 -4
  509. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  510. package/build-types/dropdown/styles.d.ts +1 -1
  511. package/build-types/dropdown-menu/index.d.ts +1 -1
  512. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  513. package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
  514. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  515. package/build-types/dropdown-menu-v2/index.d.ts +7 -7
  516. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  517. package/build-types/dropdown-menu-v2/styles.d.ts +12 -12
  518. package/build-types/duotone-picker/color-list-picker/index.d.ts +1 -1
  519. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  520. package/build-types/duotone-picker/custom-duotone-bar.d.ts +1 -1
  521. package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -1
  522. package/build-types/duotone-picker/duotone-picker.d.ts +1 -1
  523. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  524. package/build-types/duotone-picker/duotone-swatch.d.ts +1 -1
  525. package/build-types/duotone-picker/duotone-swatch.d.ts.map +1 -1
  526. package/build-types/elevation/hook.d.ts +66 -56
  527. package/build-types/elevation/hook.d.ts.map +1 -1
  528. package/build-types/flex/flex/hook.d.ts +67 -57
  529. package/build-types/flex/flex/hook.d.ts.map +1 -1
  530. package/build-types/flex/flex-block/hook.d.ts +67 -57
  531. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  532. package/build-types/flex/flex-item/hook.d.ts +67 -57
  533. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  534. package/build-types/focal-point-picker/controls.d.ts +1 -1
  535. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  536. package/build-types/focal-point-picker/focal-point.d.ts +1 -1
  537. package/build-types/focal-point-picker/focal-point.d.ts.map +1 -1
  538. package/build-types/focal-point-picker/grid.d.ts +1 -1
  539. package/build-types/focal-point-picker/grid.d.ts.map +1 -1
  540. package/build-types/focal-point-picker/index.d.ts +1 -1
  541. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  542. package/build-types/focal-point-picker/media.d.ts +1 -1
  543. package/build-types/focal-point-picker/media.d.ts.map +1 -1
  544. package/build-types/focal-point-picker/stories/index.story.d.ts +8 -8
  545. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  546. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +9 -9
  547. package/build-types/focal-point-picker/styles/focal-point-style.d.ts +1 -1
  548. package/build-types/focal-point-picker/test/index.d.ts +2 -0
  549. package/build-types/focal-point-picker/test/index.d.ts.map +1 -0
  550. package/build-types/focal-point-picker/test/media.d.ts +2 -0
  551. package/build-types/focal-point-picker/test/media.d.ts.map +1 -0
  552. package/build-types/focusable-iframe/index.d.ts +1 -1
  553. package/build-types/focusable-iframe/index.d.ts.map +1 -1
  554. package/build-types/font-size-picker/font-size-picker-select.d.ts +1 -1
  555. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  556. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts +1 -1
  557. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  558. package/build-types/font-size-picker/styles.d.ts +4 -4
  559. package/build-types/form-file-upload/index.d.ts +1 -1
  560. package/build-types/form-file-upload/index.d.ts.map +1 -1
  561. package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
  562. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  563. package/build-types/form-toggle/index.d.ts +2 -2
  564. package/build-types/form-toggle/index.d.ts.map +1 -1
  565. package/build-types/form-token-field/index.d.ts +1 -1
  566. package/build-types/form-token-field/index.d.ts.map +1 -1
  567. package/build-types/form-token-field/styles.d.ts +1 -1
  568. package/build-types/form-token-field/suggestions-list.d.ts +2 -1
  569. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  570. package/build-types/form-token-field/token-input.d.ts +2 -2
  571. package/build-types/form-token-field/token-input.d.ts.map +1 -1
  572. package/build-types/form-token-field/token.d.ts +1 -1
  573. package/build-types/form-token-field/token.d.ts.map +1 -1
  574. package/build-types/gradient-picker/index.d.ts +1 -1
  575. package/build-types/gradient-picker/index.d.ts.map +1 -1
  576. package/build-types/grid/hook.d.ts +67 -57
  577. package/build-types/grid/hook.d.ts.map +1 -1
  578. package/build-types/guide/icons.d.ts +1 -1
  579. package/build-types/guide/icons.d.ts.map +1 -1
  580. package/build-types/guide/index.d.ts +1 -1
  581. package/build-types/guide/index.d.ts.map +1 -1
  582. package/build-types/guide/page-control.d.ts +1 -1
  583. package/build-types/guide/page-control.d.ts.map +1 -1
  584. package/build-types/guide/page.d.ts +1 -1
  585. package/build-types/guide/page.d.ts.map +1 -1
  586. package/build-types/h-stack/hook.d.ts +67 -57
  587. package/build-types/h-stack/hook.d.ts.map +1 -1
  588. package/build-types/heading/hook.d.ts +67 -57
  589. package/build-types/heading/hook.d.ts.map +1 -1
  590. package/build-types/higher-order/navigate-regions/index.d.ts +1 -1
  591. package/build-types/higher-order/with-constrained-tabbing/index.d.ts +1 -1
  592. package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -1
  593. package/build-types/higher-order/with-fallback-styles/index.d.ts +1 -1
  594. package/build-types/higher-order/with-filters/index.d.ts +2 -2
  595. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  596. package/build-types/higher-order/with-notices/index.d.ts +2 -2
  597. package/build-types/higher-order/with-spoken-messages/index.d.ts +1 -1
  598. package/build-types/icon/index.d.ts +1 -1
  599. package/build-types/icon/index.d.ts.map +1 -1
  600. package/build-types/input-control/backdrop.d.ts +1 -1
  601. package/build-types/input-control/backdrop.d.ts.map +1 -1
  602. package/build-types/input-control/index.d.ts +1 -1
  603. package/build-types/input-control/index.d.ts.map +1 -1
  604. package/build-types/input-control/input-base.d.ts +1 -1
  605. package/build-types/input-control/input-base.d.ts.map +1 -1
  606. package/build-types/input-control/input-field.d.ts +1 -1
  607. package/build-types/input-control/input-field.d.ts.map +1 -1
  608. package/build-types/input-control/label.d.ts +1 -1
  609. package/build-types/input-control/label.d.ts.map +1 -1
  610. package/build-types/input-control/styles/input-control-styles.d.ts +8 -8
  611. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  612. package/build-types/isolated-event-container/index.d.ts +1 -1
  613. package/build-types/isolated-event-container/index.d.ts.map +1 -1
  614. package/build-types/item-group/item/hook.d.ts +67 -57
  615. package/build-types/item-group/item/hook.d.ts.map +1 -1
  616. package/build-types/item-group/item-group/hook.d.ts +67 -57
  617. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  618. package/build-types/keyboard-shortcuts/index.d.ts +1 -1
  619. package/build-types/keyboard-shortcuts/index.d.ts.map +1 -1
  620. package/build-types/menu-group/index.d.ts +1 -1
  621. package/build-types/menu-group/index.d.ts.map +1 -1
  622. package/build-types/menu-item/index.d.ts +1 -1
  623. package/build-types/menu-item/index.d.ts.map +1 -1
  624. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  625. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  626. package/build-types/menu-items-choice/index.d.ts +1 -1
  627. package/build-types/menu-items-choice/index.d.ts.map +1 -1
  628. package/build-types/navigable-container/container.d.ts +1 -1
  629. package/build-types/navigable-container/menu.d.ts +2 -2
  630. package/build-types/navigable-container/menu.d.ts.map +1 -1
  631. package/build-types/navigable-container/tabbable.d.ts +2 -2
  632. package/build-types/navigable-container/tabbable.d.ts.map +1 -1
  633. package/build-types/navigation/back-button/index.d.ts.map +1 -1
  634. package/build-types/navigation/group/index.d.ts +1 -1
  635. package/build-types/navigation/group/index.d.ts.map +1 -1
  636. package/build-types/navigation/index.d.ts +1 -1
  637. package/build-types/navigation/index.d.ts.map +1 -1
  638. package/build-types/navigation/item/base-content.d.ts +1 -1
  639. package/build-types/navigation/item/base-content.d.ts.map +1 -1
  640. package/build-types/navigation/item/base.d.ts +1 -1
  641. package/build-types/navigation/item/base.d.ts.map +1 -1
  642. package/build-types/navigation/item/index.d.ts +1 -1
  643. package/build-types/navigation/item/index.d.ts.map +1 -1
  644. package/build-types/navigation/menu/index.d.ts +1 -1
  645. package/build-types/navigation/menu/index.d.ts.map +1 -1
  646. package/build-types/navigation/menu/menu-title-search.d.ts +1 -1
  647. package/build-types/navigation/menu/menu-title.d.ts +1 -1
  648. package/build-types/navigation/menu/menu-title.d.ts.map +1 -1
  649. package/build-types/navigation/menu/search-no-results-found.d.ts +1 -1
  650. package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -1
  651. package/build-types/navigation/styles/navigation-styles.d.ts +11 -11
  652. package/build-types/navigator/navigator-back-button/hook.d.ts +68 -59
  653. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  654. package/build-types/navigator/navigator-button/hook.d.ts +68 -59
  655. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  656. package/build-types/notice/index.d.ts +1 -1
  657. package/build-types/notice/index.d.ts.map +1 -1
  658. package/build-types/notice/list.d.ts +1 -1
  659. package/build-types/notice/list.d.ts.map +1 -1
  660. package/build-types/number-control/index.d.ts +1 -1
  661. package/build-types/number-control/index.d.ts.map +1 -1
  662. package/build-types/number-control/stories/index.story.d.ts +1 -1
  663. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  664. package/build-types/palette-edit/index.d.ts +1 -1
  665. package/build-types/palette-edit/index.d.ts.map +1 -1
  666. package/build-types/palette-edit/styles.d.ts +1007 -756
  667. package/build-types/palette-edit/styles.d.ts.map +1 -1
  668. package/build-types/panel/body.d.ts +1 -1
  669. package/build-types/panel/body.d.ts.map +1 -1
  670. package/build-types/panel/header.d.ts +1 -1
  671. package/build-types/panel/header.d.ts.map +1 -1
  672. package/build-types/placeholder/index.d.ts +1 -1
  673. package/build-types/placeholder/index.d.ts.map +1 -1
  674. package/build-types/popover/index.d.ts +1 -1
  675. package/build-types/popover/index.d.ts.map +1 -1
  676. package/build-types/popover/stories/e2e/index.story.d.ts +2 -2
  677. package/build-types/popover/stories/e2e/index.story.d.ts.map +1 -1
  678. package/build-types/popover/test/utils/index.d.ts +1 -1
  679. package/build-types/popover/test/utils/index.d.ts.map +1 -1
  680. package/build-types/progress-bar/index.d.ts +1 -1
  681. package/build-types/progress-bar/index.d.ts.map +1 -1
  682. package/build-types/progress-bar/styles.d.ts +3 -3
  683. package/build-types/query-controls/author-select.d.ts +1 -1
  684. package/build-types/query-controls/author-select.d.ts.map +1 -1
  685. package/build-types/query-controls/category-select.d.ts +1 -1
  686. package/build-types/query-controls/category-select.d.ts.map +1 -1
  687. package/build-types/query-controls/index.d.ts +1 -1
  688. package/build-types/query-controls/index.d.ts.map +1 -1
  689. package/build-types/radio-control/index.d.ts +1 -1
  690. package/build-types/radio-control/index.d.ts.map +1 -1
  691. package/build-types/radio-group/index.d.ts +1 -1
  692. package/build-types/radio-group/index.d.ts.map +1 -1
  693. package/build-types/radio-group/radio.d.ts +1 -1
  694. package/build-types/radio-group/radio.d.ts.map +1 -1
  695. package/build-types/range-control/index.d.ts +1 -1
  696. package/build-types/range-control/index.d.ts.map +1 -1
  697. package/build-types/range-control/input-range.d.ts +1 -1
  698. package/build-types/range-control/mark.d.ts +1 -1
  699. package/build-types/range-control/mark.d.ts.map +1 -1
  700. package/build-types/range-control/rail.d.ts +1 -1
  701. package/build-types/range-control/rail.d.ts.map +1 -1
  702. package/build-types/range-control/styles/range-control-styles.d.ts +15 -15
  703. package/build-types/range-control/tooltip.d.ts +1 -1
  704. package/build-types/range-control/tooltip.d.ts.map +1 -1
  705. package/build-types/resizable-box/index.d.ts +3 -3
  706. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  707. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  708. package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
  709. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  710. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +4 -4
  711. package/build-types/resizable-box/stories/index.story.d.ts +6 -6
  712. package/build-types/responsive-wrapper/index.d.ts +1 -1
  713. package/build-types/responsive-wrapper/index.d.ts.map +1 -1
  714. package/build-types/sandbox/index.d.ts +1 -1
  715. package/build-types/sandbox/index.d.ts.map +1 -1
  716. package/build-types/scrollable/hook.d.ts +67 -57
  717. package/build-types/scrollable/hook.d.ts.map +1 -1
  718. package/build-types/search-control/index.d.ts.map +1 -1
  719. package/build-types/search-control/styles.d.ts +1 -1
  720. package/build-types/select-control/chevron-down.d.ts +1 -1
  721. package/build-types/select-control/chevron-down.d.ts.map +1 -1
  722. package/build-types/select-control/styles/select-control-styles.d.ts +3 -3
  723. package/build-types/shortcut/index.d.ts +1 -1
  724. package/build-types/shortcut/index.d.ts.map +1 -1
  725. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts +1 -1
  726. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  727. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
  728. package/build-types/slot-fill/index.d.ts +7 -7
  729. package/build-types/slot-fill/index.d.ts.map +1 -1
  730. package/build-types/slot-fill/provider.d.ts +1 -1
  731. package/build-types/slot-fill/provider.d.ts.map +1 -1
  732. package/build-types/slot-fill/slot.d.ts +1 -1
  733. package/build-types/slot-fill/slot.d.ts.map +1 -1
  734. package/build-types/snackbar/index.d.ts +2 -2
  735. package/build-types/snackbar/index.d.ts.map +1 -1
  736. package/build-types/snackbar/list.d.ts +1 -1
  737. package/build-types/snackbar/list.d.ts.map +1 -1
  738. package/build-types/spacer/hook.d.ts +67 -57
  739. package/build-types/spacer/hook.d.ts.map +1 -1
  740. package/build-types/spinner/index.d.ts +2 -2
  741. package/build-types/spinner/index.d.ts.map +1 -1
  742. package/build-types/spinner/styles.d.ts +3 -3
  743. package/build-types/style-provider/index.d.ts +1 -1
  744. package/build-types/style-provider/index.d.ts.map +1 -1
  745. package/build-types/surface/hook.d.ts +67 -57
  746. package/build-types/surface/hook.d.ts.map +1 -1
  747. package/build-types/tab-panel/index.d.ts +1 -1
  748. package/build-types/tab-panel/index.d.ts.map +1 -1
  749. package/build-types/tab-panel/stories/index.story.d.ts +4 -4
  750. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  751. package/build-types/tabs/index.d.ts +2 -2
  752. package/build-types/tabs/index.d.ts.map +1 -1
  753. package/build-types/tabs/styles.d.ts +3 -3
  754. package/build-types/tabs/tablist.d.ts +1 -1
  755. package/build-types/tabs/tablist.d.ts.map +1 -1
  756. package/build-types/text/hook.d.ts +66 -57
  757. package/build-types/text/hook.d.ts.map +1 -1
  758. package/build-types/text/stories/index.story.d.ts +3 -3
  759. package/build-types/text-control/index.d.ts +3 -3
  760. package/build-types/text-control/index.d.ts.map +1 -1
  761. package/build-types/text-highlight/index.d.ts +1 -1
  762. package/build-types/text-highlight/index.d.ts.map +1 -1
  763. package/build-types/textarea-control/index.d.ts +2 -2
  764. package/build-types/textarea-control/index.d.ts.map +1 -1
  765. package/build-types/textarea-control/styles/textarea-control-styles.d.ts +1 -1
  766. package/build-types/theme/index.d.ts +1 -1
  767. package/build-types/theme/index.d.ts.map +1 -1
  768. package/build-types/theme/stories/index.story.d.ts +1 -1
  769. package/build-types/theme/styles.d.ts +1 -1
  770. package/build-types/tip/index.d.ts +1 -1
  771. package/build-types/tip/index.d.ts.map +1 -1
  772. package/build-types/toggle-control/index.d.ts +2 -2
  773. package/build-types/toggle-control/index.d.ts.map +1 -1
  774. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  775. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  776. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +1 -1
  777. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  778. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +1 -1
  779. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  780. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -1
  781. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -1
  782. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  783. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +1 -1
  784. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  785. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +2 -2
  786. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  787. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  788. package/build-types/toolbar/stories/index.story.d.ts +3 -3
  789. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  790. package/build-types/toolbar/toolbar/index.d.ts +1 -1
  791. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  792. package/build-types/toolbar/toolbar/toolbar-container.d.ts +1 -1
  793. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  794. package/build-types/toolbar/toolbar-button/index.d.ts +5 -51
  795. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  796. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +1 -1
  797. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -1
  798. package/build-types/toolbar/toolbar-group/index.d.ts +1 -1
  799. package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -1
  800. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts +1 -1
  801. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -1
  802. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +1 -1
  803. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -1
  804. package/build-types/tools-panel/styles.d.ts +1 -1
  805. package/build-types/tools-panel/tools-panel/hook.d.ts +69 -59
  806. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  807. package/build-types/tools-panel/tools-panel-header/hook.d.ts +68 -58
  808. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  809. package/build-types/tools-panel/tools-panel-item/hook.d.ts +67 -57
  810. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  811. package/build-types/tools-panel/types.d.ts +1 -1
  812. package/build-types/tools-panel/types.d.ts.map +1 -1
  813. package/build-types/tree-grid/index.d.ts +1 -1
  814. package/build-types/tree-grid/index.d.ts.map +1 -1
  815. package/build-types/tree-grid/item.d.ts +1 -1
  816. package/build-types/tree-grid/item.d.ts.map +1 -1
  817. package/build-types/tree-grid/roving-tab-index-item.d.ts +1 -1
  818. package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
  819. package/build-types/tree-grid/roving-tab-index.d.ts +1 -1
  820. package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -1
  821. package/build-types/tree-grid/row.d.ts +1 -1
  822. package/build-types/tree-grid/row.d.ts.map +1 -1
  823. package/build-types/tree-grid/stories/index.story.d.ts +1 -1
  824. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  825. package/build-types/tree-select/index.d.ts +1 -1
  826. package/build-types/tree-select/index.d.ts.map +1 -1
  827. package/build-types/truncate/hook.d.ts +67 -57
  828. package/build-types/truncate/hook.d.ts.map +1 -1
  829. package/build-types/unit-control/index.d.ts +1 -1
  830. package/build-types/unit-control/index.d.ts.map +1 -1
  831. package/build-types/unit-control/styles/unit-control-styles.d.ts +3 -3
  832. package/build-types/unit-control/unit-select-control.d.ts +1 -1
  833. package/build-types/v-stack/hook.d.ts +67 -57
  834. package/build-types/v-stack/hook.d.ts.map +1 -1
  835. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  836. package/build-types/view/component.d.ts +251 -249
  837. package/build-types/view/component.d.ts.map +1 -1
  838. package/build-types/z-stack/styles.d.ts +2 -2
  839. package/package.json +22 -22
  840. package/src/alignment-matrix-control/icon.tsx +2 -2
  841. package/src/alignment-matrix-control/index.tsx +2 -5
  842. package/src/angle-picker-control/index.tsx +2 -2
  843. package/src/animate/index.tsx +4 -7
  844. package/src/autocomplete/autocompleter-ui.tsx +2 -2
  845. package/src/base-control/README.md +1 -1
  846. package/src/base-control/hooks.ts +1 -5
  847. package/src/base-control/index.tsx +2 -5
  848. package/src/base-control/test/index.tsx +3 -3
  849. package/src/base-control/types.ts +1 -2
  850. package/src/border-control/types.ts +4 -0
  851. package/src/button/index.tsx +2 -2
  852. package/src/button/style.scss +4 -6
  853. package/src/button-group/index.tsx +2 -2
  854. package/src/checkbox-control/index.tsx +2 -2
  855. package/src/circular-option-picker/circular-option-picker-actions.tsx +3 -3
  856. package/src/circular-option-picker/circular-option-picker-option-group.tsx +2 -2
  857. package/src/circular-option-picker/circular-option-picker-option.tsx +2 -2
  858. package/src/circular-option-picker/circular-option-picker.tsx +2 -5
  859. package/src/circular-option-picker/style.scss +1 -2
  860. package/src/clipboard-button/index.tsx +2 -2
  861. package/src/color-indicator/index.tsx +2 -2
  862. package/src/color-palette/index.tsx +2 -2
  863. package/src/combobox-control/README.md +1 -1
  864. package/src/combobox-control/index.tsx +8 -5
  865. package/src/combobox-control/stories/index.story.tsx +28 -0
  866. package/src/combobox-control/types.ts +1 -0
  867. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +3 -3
  868. package/src/custom-gradient-picker/gradient-bar/index.tsx +2 -2
  869. package/src/custom-gradient-picker/index.tsx +2 -2
  870. package/src/custom-select-control/index.js +3 -6
  871. package/src/dimension-control/index.tsx +2 -5
  872. package/src/drop-zone/index.tsx +2 -2
  873. package/src/dropdown/index.tsx +2 -2
  874. package/src/dropdown-menu/index.native.js +6 -12
  875. package/src/dropdown-menu/index.tsx +9 -16
  876. package/src/external-link/index.tsx +2 -2
  877. package/src/focal-point-picker/focal-point.tsx +2 -4
  878. package/src/focal-point-picker/index.tsx +2 -5
  879. package/src/focal-point-picker/test/{index.js → index.tsx} +44 -17
  880. package/src/focal-point-picker/test/{media.js → media.tsx} +18 -13
  881. package/src/form-toggle/index.tsx +2 -2
  882. package/src/form-token-field/index.tsx +10 -8
  883. package/src/form-token-field/style.scss +9 -0
  884. package/src/form-token-field/suggestions-list.tsx +16 -10
  885. package/src/form-token-field/token-input.tsx +2 -2
  886. package/src/form-token-field/token.tsx +2 -2
  887. package/src/guide/index.tsx +2 -2
  888. package/src/input-control/index.tsx +3 -6
  889. package/src/input-control/test/index.js +2 -2
  890. package/src/menu-group/index.tsx +2 -2
  891. package/src/menu-item/index.tsx +3 -3
  892. package/src/mobile/color-settings/utils.native.js +1 -1
  893. package/src/modal/index.tsx +4 -4
  894. package/src/navigation/back-button/index.tsx +2 -5
  895. package/src/navigation/group/index.tsx +2 -2
  896. package/src/navigation/index.tsx +3 -3
  897. package/src/navigation/item/base.tsx +2 -2
  898. package/src/navigation/item/index.tsx +2 -2
  899. package/src/navigation/menu/index.tsx +2 -2
  900. package/src/notice/index.tsx +5 -10
  901. package/src/notice/list.tsx +2 -2
  902. package/src/number-control/index.tsx +2 -2
  903. package/src/palette-edit/index.tsx +10 -8
  904. package/src/palette-edit/styles.ts +2 -3
  905. package/src/panel/body.tsx +2 -2
  906. package/src/panel/index.tsx +2 -2
  907. package/src/panel/row.tsx +2 -2
  908. package/src/placeholder/index.tsx +3 -3
  909. package/src/placeholder/style.scss +1 -2
  910. package/src/popover/index.tsx +2 -2
  911. package/src/radio-control/index.tsx +2 -2
  912. package/src/range-control/index.tsx +3 -3
  913. package/src/range-control/mark.tsx +3 -3
  914. package/src/range-control/tooltip.tsx +2 -2
  915. package/src/resizable-box/index.tsx +10 -10
  916. package/src/resizable-box/resize-tooltip/index.tsx +2 -2
  917. package/src/responsive-wrapper/index.tsx +2 -2
  918. package/src/search-control/index.tsx +2 -5
  919. package/src/select-control/index.tsx +2 -2
  920. package/src/snackbar/index.tsx +5 -8
  921. package/src/snackbar/list.tsx +2 -2
  922. package/src/spinner/index.tsx +2 -2
  923. package/src/tab-panel/index.tsx +2 -2
  924. package/src/text-control/index.tsx +2 -2
  925. package/src/theme/stories/index.story.tsx +1 -1
  926. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +0 -2
  927. package/src/toolbar/toolbar/index.tsx +2 -2
  928. package/src/toolbar/toolbar/style.scss +0 -12
  929. package/src/toolbar/toolbar-button/index.tsx +3 -3
  930. package/src/toolbar/toolbar-group/index.tsx +2 -2
  931. package/src/tools-panel/tools-panel/hook.ts +9 -6
  932. package/src/tools-panel/tools-panel-item/hook.ts +12 -8
  933. package/src/tools-panel/types.ts +1 -0
  934. package/src/truncate/hook.ts +1 -1
  935. package/src/unit-control/index.tsx +2 -2
  936. package/src/unit-control/unit-select-control.tsx +2 -2
  937. package/src/utils/theme-variables.scss +4 -0
  938. package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -2,25 +2,45 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 27.6.0 (2024-05-16)
6
+
7
+ ### Internal
8
+
9
+ - Replaced `classnames` package with the faster and smaller `clsx` package ([#61138](https://github.com/WordPress/gutenberg/pull/61138)).
10
+ - Upgrade `@use-gesture/react` package to `^10.3.1` ([#61503](https://github.com/WordPress/gutenberg/pull/61503)).
11
+ - Upgrade `framer-motion` package to version `^11.1.9` ([#61572](https://github.com/WordPress/gutenberg/pull/61572)).
12
+
13
+ ### Enhancements
14
+
15
+ - `PaletteEdit`: Use consistent spacing and metrics. ([#61368](https://github.com/WordPress/gutenberg/pull/61368)).
16
+ - `FormTokenField`: Hide label when not defined ([#61336](https://github.com/WordPress/gutenberg/pull/61336)).
17
+ - `ComboboxControl`: supports disabled items ([#61294](https://github.com/WordPress/gutenberg/pull/61294)).
18
+ - Upgraded the @types/react and @types/react-dom packages ([#60796](https://github.com/WordPress/gutenberg/pull/60796)).
19
+ - `Placeholder`: Tweak placeholder style ([#61590](https://github.com/WordPress/gutenberg/pull/61590)).
20
+
21
+ ### Bug Fix
22
+
23
+ - `ToolsPanel`: Fix sticking “Reset” option ([#60621](https://github.com/WordPress/gutenberg/pull/60621)).
24
+ - Fix an issue where types used a synthetic default import ([#61679](https://github.com/WordPress/gutenberg/pull/61679)).
25
+
5
26
  ## 27.5.0 (2024-05-02)
6
27
 
7
28
  ### Enhancements
8
29
 
30
+ - Replaced `classnames` package with the faster and smaller `clsx` package ([#61138](https://github.com/WordPress/gutenberg/pull/61138)).
9
31
  - `InputControl`: Add a password visibility toggle story ([#60898](https://github.com/WordPress/gutenberg/pull/60898)).
10
32
  - `View`: Fix prop types ([#60919](https://github.com/WordPress/gutenberg/pull/60919)).
11
33
  - `Placeholder`: Unify appearance across. ([#59275](https://github.com/WordPress/gutenberg/pull/59275)).
12
34
  - `Toolbar`: Adjust top toolbar to use same metrics as block toolbar ([#61126](https://github.com/WordPress/gutenberg/pull/61126)).
35
+ - `DropZone`: Avoid a media query on mount [#60546](https://github.com/WordPress/gutenberg/pull/60546)).
36
+ - `ComboboxControl`: Simplify string normalization ([#60893](https://github.com/WordPress/gutenberg/pull/60893)).
13
37
 
14
38
  ### Bug Fix
15
39
 
40
+ - `BaseControl`, `InputControl`: Remove usage of aria-details from InputControl and BaseControl ([#61203](https://github.com/WordPress/gutenberg/pull/61203)).
16
41
  - `SlotFill`: fixed missing `getServerSnapshot` parameter in slot map ([#60943](https://github.com/WordPress/gutenberg/pull/60943)).
17
42
  - `Panel`: Fix issue with collapsing panel header ([#61319](https://github.com/WordPress/gutenberg/pull/61319)).
18
43
 
19
- ### Enhancements
20
-
21
- - `DropZone`: Avoid a media query on mount [#60546](https://github.com/WordPress/gutenberg/pull/60546)).
22
- - `ComboboxControl`: Simplify string normalization ([#60893](https://github.com/WordPress/gutenberg/pull/60893)).
23
-
24
44
  ### Internal
25
45
 
26
46
  - `FontSizerPicker`: Improve docs for default units ([#60996](https://github.com/WordPress/gutenberg/pull/60996)).
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _utils = require("./utils");
11
11
  var _alignmentMatrixControlIconStyles = require("./styles/alignment-matrix-control-icon-styles");
12
12
  /**
@@ -28,7 +28,7 @@ function AlignmentMatrixControlIcon({
28
28
  }) {
29
29
  const alignIndex = (0, _utils.getAlignmentIndex)(value);
30
30
  const scale = (size / BASE_SIZE).toFixed(2);
31
- const classes = (0, _classnames.default)('component-alignment-matrix-control-icon', className);
31
+ const classes = (0, _clsx.default)('component-alignment-matrix-control-icon', className);
32
32
  const styles = {
33
33
  ...style,
34
34
  transform: `scale(${scale})`
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_utils","_alignmentMatrixControlIconStyles","BASE_SIZE","AlignmentMatrixControlIcon","className","disablePointerEvents","size","style","value","props","alignIndex","getAlignmentIndex","scale","toFixed","classes","classnames","styles","transform","_react","createElement","Root","role","ALIGNMENTS","map","align","index","isActive","Cell","key","Point","_default","exports","default"],"sources":["@wordpress/components/src/alignment-matrix-control/icon.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport { ALIGNMENTS, getAlignmentIndex } from './utils';\nimport {\n\tRoot,\n\tCell,\n\tPoint,\n} from './styles/alignment-matrix-control-icon-styles';\nimport type { AlignmentMatrixControlIconProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nconst BASE_SIZE = 24;\n\nfunction AlignmentMatrixControlIcon( {\n\tclassName,\n\tdisablePointerEvents = true,\n\tsize = BASE_SIZE,\n\tstyle = {},\n\tvalue = 'center',\n\t...props\n}: WordPressComponentProps< AlignmentMatrixControlIconProps, 'div', false > ) {\n\tconst alignIndex = getAlignmentIndex( value );\n\tconst scale = ( size / BASE_SIZE ).toFixed( 2 );\n\n\tconst classes = classnames(\n\t\t'component-alignment-matrix-control-icon',\n\t\tclassName\n\t);\n\n\tconst styles = {\n\t\t...style,\n\t\ttransform: `scale(${ scale })`,\n\t};\n\n\treturn (\n\t\t<Root\n\t\t\t{ ...props }\n\t\t\tclassName={ classes }\n\t\t\tdisablePointerEvents={ disablePointerEvents }\n\t\t\trole=\"presentation\"\n\t\t\tstyle={ styles }\n\t\t>\n\t\t\t{ ALIGNMENTS.map( ( align, index ) => {\n\t\t\t\tconst isActive = alignIndex === index;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Cell key={ align }>\n\t\t\t\t\t\t<Point isActive={ isActive } />\n\t\t\t\t\t</Cell>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Root>\n\t);\n}\n\nexport default AlignmentMatrixControlIcon;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;A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"version":3,"names":["_clsx","_interopRequireDefault","require","_utils","_alignmentMatrixControlIconStyles","BASE_SIZE","AlignmentMatrixControlIcon","className","disablePointerEvents","size","style","value","props","alignIndex","getAlignmentIndex","scale","toFixed","classes","clsx","styles","transform","_react","createElement","Root","role","ALIGNMENTS","map","align","index","isActive","Cell","key","Point","_default","exports","default"],"sources":["@wordpress/components/src/alignment-matrix-control/icon.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { ALIGNMENTS, getAlignmentIndex } from './utils';\nimport {\n\tRoot,\n\tCell,\n\tPoint,\n} from './styles/alignment-matrix-control-icon-styles';\nimport type { AlignmentMatrixControlIconProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nconst BASE_SIZE = 24;\n\nfunction AlignmentMatrixControlIcon( {\n\tclassName,\n\tdisablePointerEvents = true,\n\tsize = BASE_SIZE,\n\tstyle = {},\n\tvalue = 'center',\n\t...props\n}: WordPressComponentProps< AlignmentMatrixControlIconProps, 'div', false > ) {\n\tconst alignIndex = getAlignmentIndex( value );\n\tconst scale = ( size / BASE_SIZE ).toFixed( 2 );\n\n\tconst classes = clsx(\n\t\t'component-alignment-matrix-control-icon',\n\t\tclassName\n\t);\n\n\tconst styles = {\n\t\t...style,\n\t\ttransform: `scale(${ scale })`,\n\t};\n\n\treturn (\n\t\t<Root\n\t\t\t{ ...props }\n\t\t\tclassName={ classes }\n\t\t\tdisablePointerEvents={ disablePointerEvents }\n\t\t\trole=\"presentation\"\n\t\t\tstyle={ styles }\n\t\t>\n\t\t\t{ ALIGNMENTS.map( ( align, index ) => {\n\t\t\t\tconst isActive = alignIndex === index;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Cell key={ align }>\n\t\t\t\t\t\t<Point isActive={ isActive } />\n\t\t\t\t\t</Cell>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Root>\n\t);\n}\n\nexport default AlignmentMatrixControlIcon;\n"],"mappings":";;;;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AA,CAAAC,OAAA,GAEc7B,0BAA0B","ignoreList":[]}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.AlignmentMatrixControl = AlignmentMatrixControl;
8
8
  exports.default = void 0;
9
9
  var _react = require("react");
10
- var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _clsx = _interopRequireDefault(require("clsx"));
11
11
  var _i18n = require("@wordpress/i18n");
12
12
  var _compose = require("@wordpress/compose");
13
13
  var _cell = _interopRequireDefault(require("./cell"));
@@ -70,7 +70,7 @@ function AlignmentMatrixControl({
70
70
  rtl: (0, _i18n.isRTL)()
71
71
  });
72
72
  const activeId = compositeStore.useState('activeId');
73
- const classes = (0, _classnames.default)('component-alignment-matrix-control', className);
73
+ const classes = (0, _clsx.default)('component-alignment-matrix-control', className);
74
74
  return (0, _react.createElement)(_v.Composite, {
75
75
  store: compositeStore,
76
76
  render: (0, _react.createElement)(_alignmentMatrixControlStyles.Root, {
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_compose","_cell","_v","_alignmentMatrixControlStyles","_icon","_utils","AlignmentMatrixControl","className","id","label","__","defaultValue","value","onChange","width","props","baseId","useInstanceId","compositeStore","useCompositeStore","defaultActiveId","getItemId","activeId","setActiveId","nextActiveId","nextValue","getItemValue","rtl","isRTL","useState","classes","classnames","_react","createElement","Composite","store","render","Root","role","size","GRID","map","cells","index","CompositeRow","Row","key","cell","cellId","isActive","default","Icon","AlignmentMatrixControlIcon","_default","exports"],"sources":["@wordpress/components/src/alignment-matrix-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport { Composite, CompositeRow, useCompositeStore } from '../composite/v2';\nimport { Root, Row } from './styles/alignment-matrix-control-styles';\nimport AlignmentMatrixControlIcon from './icon';\nimport { GRID, getItemId, getItemValue } from './utils';\nimport type { WordPressComponentProps } from '../context';\nimport type { AlignmentMatrixControlProps } from './types';\n\n/**\n *\n * AlignmentMatrixControl components enable adjustments to horizontal and vertical alignments for UI.\n *\n * ```jsx\n * import { __experimentalAlignmentMatrixControl as AlignmentMatrixControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ alignment, setAlignment ] = useState( 'center center' );\n *\n * \treturn (\n * \t\t<AlignmentMatrixControl\n * \t\t\tvalue={ alignment }\n * \t\t\tonChange={ setAlignment }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport function AlignmentMatrixControl( {\n\tclassName,\n\tid,\n\tlabel = __( 'Alignment Matrix Control' ),\n\tdefaultValue = 'center center',\n\tvalue,\n\tonChange,\n\twidth = 92,\n\t...props\n}: WordPressComponentProps< AlignmentMatrixControlProps, 'div', false > ) {\n\tconst baseId = useInstanceId(\n\t\tAlignmentMatrixControl,\n\t\t'alignment-matrix-control',\n\t\tid\n\t);\n\n\tconst compositeStore = useCompositeStore( {\n\t\tdefaultActiveId: getItemId( baseId, defaultValue ),\n\t\tactiveId: getItemId( baseId, value ),\n\t\tsetActiveId: ( nextActiveId ) => {\n\t\t\tconst nextValue = getItemValue( baseId, nextActiveId );\n\t\t\tif ( nextValue ) {\n\t\t\t\tonChange?.( nextValue );\n\t\t\t}\n\t\t},\n\t\trtl: isRTL(),\n\t} );\n\n\tconst activeId = compositeStore.useState( 'activeId' );\n\n\tconst classes = classnames(\n\t\t'component-alignment-matrix-control',\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<Composite\n\t\t\tstore={ compositeStore }\n\t\t\trender={\n\t\t\t\t<Root\n\t\t\t\t\t{ ...props }\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tclassName={ classes }\n\t\t\t\t\tid={ baseId }\n\t\t\t\t\trole=\"grid\"\n\t\t\t\t\tsize={ width }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{ GRID.map( ( cells, index ) => (\n\t\t\t\t<CompositeRow render={ <Row role=\"row\" /> } key={ index }>\n\t\t\t\t\t{ cells.map( ( cell ) => {\n\t\t\t\t\t\tconst cellId = getItemId( baseId, cell );\n\t\t\t\t\t\tconst isActive = cellId === activeId;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Cell\n\t\t\t\t\t\t\t\tid={ cellId }\n\t\t\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\t\t\tkey={ cell }\n\t\t\t\t\t\t\t\tvalue={ cell }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</CompositeRow>\n\t\t\t) ) }\n\t\t</Composite>\n\t);\n}\n\nAlignmentMatrixControl.Icon = AlignmentMatrixControlIcon;\n\nexport default AlignmentMatrixControl;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,EAAA,GAAAJ,OAAA;AACA,IAAAK,6BAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,sBAAsBA,CAAE;EACvCC,SAAS;EACTC,EAAE;EACFC,KAAK,GAAG,IAAAC,QAAE,EAAE,0BAA2B,CAAC;EACxCC,YAAY,GAAG,eAAe;EAC9BC,KAAK;EACLC,QAAQ;EACRC,KAAK,GAAG,EAAE;EACV,GAAGC;AACkE,CAAC,EAAG;EACzE,M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DD,KAAK,CAACD,GAAG,CAAIM,IAAI,IAAM;IACxB,MAAMC,MAAM,GAAG,IAAA3B,gBAAS,EAAEL,MAAM,EAAE+B,IAAK,CAAC;IACxC,MAAME,QAAQ,GAAGD,MAAM,KAAK1B,QAAQ;IAEpC,OACC,IAAAU,MAAA,CAAAC,aAAA,EAAChC,KAAA,CAAAiD,OAAI;MACJ1C,EAAE,EAAGwC,MAAQ;MACbC,QAAQ,EAAGA,QAAU;MACrBH,GAAG,EAAGC,IAAM;MACZnC,KAAK,EAAGmC;IAAM,CACd,CAAC;EAEJ,CAAE,CACW,CACb,CACQ,CAAC;AAEd;AAEAzC,sBAAsB,CAAC6C,IAAI,GAAGC,aAA0B;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAE1C5C,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_compose","_cell","_v","_alignmentMatrixControlStyles","_icon","_utils","AlignmentMatrixControl","className","id","label","__","defaultValue","value","onChange","width","props","baseId","useInstanceId","compositeStore","useCompositeStore","defaultActiveId","getItemId","activeId","setActiveId","nextActiveId","nextValue","getItemValue","rtl","isRTL","useState","classes","clsx","_react","createElement","Composite","store","render","Root","role","size","GRID","map","cells","index","CompositeRow","Row","key","cell","cellId","isActive","default","Icon","AlignmentMatrixControlIcon","_default","exports"],"sources":["@wordpress/components/src/alignment-matrix-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Cell from './cell';\nimport { Composite, CompositeRow, useCompositeStore } from '../composite/v2';\nimport { Root, Row } from './styles/alignment-matrix-control-styles';\nimport AlignmentMatrixControlIcon from './icon';\nimport { GRID, getItemId, getItemValue } from './utils';\nimport type { WordPressComponentProps } from '../context';\nimport type { AlignmentMatrixControlProps } from './types';\n\n/**\n *\n * AlignmentMatrixControl components enable adjustments to horizontal and vertical alignments for UI.\n *\n * ```jsx\n * import { __experimentalAlignmentMatrixControl as AlignmentMatrixControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const Example = () => {\n * \tconst [ alignment, setAlignment ] = useState( 'center center' );\n *\n * \treturn (\n * \t\t<AlignmentMatrixControl\n * \t\t\tvalue={ alignment }\n * \t\t\tonChange={ setAlignment }\n * \t\t/>\n * \t);\n * };\n * ```\n */\nexport function AlignmentMatrixControl( {\n\tclassName,\n\tid,\n\tlabel = __( 'Alignment Matrix Control' ),\n\tdefaultValue = 'center center',\n\tvalue,\n\tonChange,\n\twidth = 92,\n\t...props\n}: WordPressComponentProps< AlignmentMatrixControlProps, 'div', false > ) {\n\tconst baseId = useInstanceId(\n\t\tAlignmentMatrixControl,\n\t\t'alignment-matrix-control',\n\t\tid\n\t);\n\n\tconst compositeStore = useCompositeStore( {\n\t\tdefaultActiveId: getItemId( baseId, defaultValue ),\n\t\tactiveId: getItemId( baseId, value ),\n\t\tsetActiveId: ( nextActiveId ) => {\n\t\t\tconst nextValue = getItemValue( baseId, nextActiveId );\n\t\t\tif ( nextValue ) {\n\t\t\t\tonChange?.( nextValue );\n\t\t\t}\n\t\t},\n\t\trtl: isRTL(),\n\t} );\n\n\tconst activeId = compositeStore.useState( 'activeId' );\n\n\tconst classes = clsx( 'component-alignment-matrix-control', className );\n\n\treturn (\n\t\t<Composite\n\t\t\tstore={ compositeStore }\n\t\t\trender={\n\t\t\t\t<Root\n\t\t\t\t\t{ ...props }\n\t\t\t\t\taria-label={ label }\n\t\t\t\t\tclassName={ classes }\n\t\t\t\t\tid={ baseId }\n\t\t\t\t\trole=\"grid\"\n\t\t\t\t\tsize={ width }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{ GRID.map( ( cells, index ) => (\n\t\t\t\t<CompositeRow render={ <Row role=\"row\" /> } key={ index }>\n\t\t\t\t\t{ cells.map( ( cell ) => {\n\t\t\t\t\t\tconst cellId = getItemId( baseId, cell );\n\t\t\t\t\t\tconst isActive = cellId === activeId;\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Cell\n\t\t\t\t\t\t\t\tid={ cellId }\n\t\t\t\t\t\t\t\tisActive={ isActive }\n\t\t\t\t\t\t\t\tkey={ cell }\n\t\t\t\t\t\t\t\tvalue={ cell }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</CompositeRow>\n\t\t\t) ) }\n\t\t</Composite>\n\t);\n}\n\nAlignmentMatrixControl.Icon = AlignmentMatrixControlIcon;\n\nexport default AlignmentMatrixControl;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,EAAA,GAAAJ,OAAA;AACA,IAAAK,6BAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,sBAAsBA,CAAE;EACvCC,SAAS;EACTC,EAAE;EACFC,KAAK,GAAG,IAAAC,QAAE,EAAE,0BAA2B,CAAC;EACxCC,YAAY,GAAG,eAAe;EAC9BC,KAAK;EACLC,QAAQ;EACRC,KAAK,GAAG,EAAE;EACV,GAAGC;AACkE,CAAC,EAAG;EACzE,MAAMC,MAAM,GAAG,IAAAC,sBAAa,EAC3BX,sBAAsB,EACtB,0BAA0B,EAC1BE,EACD,CAAC;EAED,MAAMU,cAAc,GAAG,IAAAC,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C;IACxC,MAAME,QAAQ,GAAGD,MAAM,KAAK1B,QAAQ;IAEpC,OACC,IAAAU,MAAA,CAAAC,aAAA,EAAChC,KAAA,CAAAiD,OAAI;MACJ1C,EAAE,EAAGwC,MAAQ;MACbC,QAAQ,EAAGA,QAAU;MACrBH,GAAG,EAAGC,IAAM;MACZnC,KAAK,EAAGmC;IAAM,CACd,CAAC;EAEJ,CAAE,CACW,CACb,CACQ,CAAC;AAEd;AAEAzC,sBAAsB,CAAC6C,IAAI,GAAGC,aAA0B;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAE1C5C,sBAAsB","ignoreList":[]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = exports.AnglePickerControl = void 0;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _element = require("@wordpress/element");
11
11
  var _i18n = require("@wordpress/i18n");
12
12
  var _flex = require("../flex");
@@ -41,7 +41,7 @@ function UnforwardedAnglePickerControl(props, ref) {
41
41
  const inputValue = unprocessedValue !== undefined && unprocessedValue !== '' ? parseInt(unprocessedValue, 10) : 0;
42
42
  onChange(inputValue);
43
43
  };
44
- const classes = (0, _classnames.default)('components-angle-picker-control', className);
44
+ const classes = (0, _clsx.default)('components-angle-picker-control', className);
45
45
  const unitText = (0, _react.createElement)(_anglePickerControlStyles.UnitText, null, "\xB0");
46
46
  const [prefixedUnitText, suffixedUnitText] = (0, _i18n.isRTL)() ? [unitText, null] : [null, unitText];
47
47
  return (0, _react.createElement)(_flex.Flex, {
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_i18n","_flex","_spacer","_numberControl","_angleCircle","_anglePickerControlStyles","UnforwardedAnglePickerControl","props","ref","className","label","__","onChange","value","restProps","handleOnNumberChange","unprocessedValue","undefined","inputValue","parseInt","classes","classnames","unitText","_react","createElement","UnitText","prefixedUnitText","suffixedUnitText","isRTL","Flex","gap","FlexBlock","default","max","min","size","step","spinControls","prefix","suffix","Spacer","marginBottom","marginTop","AnglePickerControl","exports","forwardRef","_default"],"sources":["@wordpress/components/src/angle-picker-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Flex, FlexBlock } from '../flex';\nimport { Spacer } from '../spacer';\nimport NumberControl from '../number-control';\nimport AngleCircle from './angle-circle';\nimport { UnitText } from './styles/angle-picker-control-styles';\n\nimport type { WordPressComponentProps } from '../context';\nimport type { AnglePickerControlProps } from './types';\n\nfunction UnforwardedAnglePickerControl(\n\tprops: WordPressComponentProps< AnglePickerControlProps, 'div' >,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\tclassName,\n\t\tlabel = __( 'Angle' ),\n\t\tonChange,\n\t\tvalue,\n\t\t...restProps\n\t} = props;\n\n\tconst handleOnNumberChange = ( unprocessedValue: string | undefined ) => {\n\t\tif ( onChange === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst inputValue =\n\t\t\tunprocessedValue !== undefined && unprocessedValue !== ''\n\t\t\t\t? parseInt( unprocessedValue, 10 )\n\t\t\t\t: 0;\n\t\tonChange( inputValue );\n\t};\n\n\tconst classes = classnames( 'components-angle-picker-control', className );\n\n\tconst unitText = <UnitText>°</UnitText>;\n\tconst [ prefixedUnitText, suffixedUnitText ] = isRTL()\n\t\t? [ unitText, null ]\n\t\t: [ null, unitText ];\n\n\treturn (\n\t\t<Flex { ...restProps } ref={ ref } className={ classes } gap={ 2 }>\n\t\t\t<FlexBlock>\n\t\t\t\t<NumberControl\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tclassName=\"components-angle-picker-control__input-field\"\n\t\t\t\t\tmax={ 360 }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tonChange={ handleOnNumberChange }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tstep=\"1\"\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tspinControls=\"none\"\n\t\t\t\t\tprefix={ prefixedUnitText }\n\t\t\t\t\tsuffix={ suffixedUnitText }\n\t\t\t\t/>\n\t\t\t</FlexBlock>\n\t\t\t<Spacer marginBottom=\"1\" marginTop=\"auto\">\n\t\t\t\t<AngleCircle\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t</Spacer>\n\t\t</Flex>\n\t);\n}\n\n/**\n * `AnglePickerControl` is a React component to render a UI that allows users to\n * pick an angle. Users can choose an angle in a visual UI with the mouse by\n * dragging an angle indicator inside a circle or by directly inserting the\n * desired angle in a text field.\n *\n * ```jsx\n * import { useState } from '@wordpress/element';\n * import { AnglePickerControl } from '@wordpress/components';\n *\n * function Example() {\n * const [ angle, setAngle ] = useState( 0 );\n * return (\n * <AnglePickerControl\n * value={ angle }\n * onChange={ setAngle }\n * </>\n * );\n * }\n * ```\n */\nexport const AnglePickerControl = forwardRef( UnforwardedAnglePickerControl );\n\nexport default AnglePickerControl;\n"],"mappings":";;;;;;;;AAIA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,yBAAA,GAAAP,OAAA;AAnBA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAUA,SAASQ,6BAA6BA,CACrCC,KAAgE,EAChEC,GAAwB,EACvB;EACD,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;IACfwB,YAAY,EAAC,MAAM;IACnBC,MAAM,EAAGZ,gBAAkB;IAC3Ba,MAAM,EAAGZ;EAAkB,CAC3B,CACS,CAAC,EACZ,IAAAJ,MAAA,CAAAC,aAAA,EAACtB,OAAA,CAAAsC,MAAM;IAACC,YAAY,EAAC,GAAG;IAACC,SAAS,EAAC;EAAM,GACxC,IAAAnB,MAAA,CAAAC,aAAA,EAACpB,YAAA,CAAA4B,OAAW;IACX,eAAY,MAAM;IAClBnB,KAAK,EAAGA,KAAO;IACfD,QAAQ,EAAGA;EAAU,CACrB,CACM,CACH,CAAC;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM+B,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,mBAAU,EAAEvC,6BAA8B,CAAC;AAAC,IAAAwC,QAAA,GAAAF,OAAA,CAAAZ,OAAA,GAE/DW,kBAAkB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_flex","_spacer","_numberControl","_angleCircle","_anglePickerControlStyles","UnforwardedAnglePickerControl","props","ref","className","label","__","onChange","value","restProps","handleOnNumberChange","unprocessedValue","undefined","inputValue","parseInt","classes","clsx","unitText","_react","createElement","UnitText","prefixedUnitText","suffixedUnitText","isRTL","Flex","gap","FlexBlock","default","max","min","size","step","spinControls","prefix","suffix","Spacer","marginBottom","marginTop","AnglePickerControl","exports","forwardRef","_default"],"sources":["@wordpress/components/src/angle-picker-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { Flex, FlexBlock } from '../flex';\nimport { Spacer } from '../spacer';\nimport NumberControl from '../number-control';\nimport AngleCircle from './angle-circle';\nimport { UnitText } from './styles/angle-picker-control-styles';\n\nimport type { WordPressComponentProps } from '../context';\nimport type { AnglePickerControlProps } from './types';\n\nfunction UnforwardedAnglePickerControl(\n\tprops: WordPressComponentProps< AnglePickerControlProps, 'div' >,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\tclassName,\n\t\tlabel = __( 'Angle' ),\n\t\tonChange,\n\t\tvalue,\n\t\t...restProps\n\t} = props;\n\n\tconst handleOnNumberChange = ( unprocessedValue: string | undefined ) => {\n\t\tif ( onChange === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst inputValue =\n\t\t\tunprocessedValue !== undefined && unprocessedValue !== ''\n\t\t\t\t? parseInt( unprocessedValue, 10 )\n\t\t\t\t: 0;\n\t\tonChange( inputValue );\n\t};\n\n\tconst classes = clsx( 'components-angle-picker-control', className );\n\n\tconst unitText = <UnitText>°</UnitText>;\n\tconst [ prefixedUnitText, suffixedUnitText ] = isRTL()\n\t\t? [ unitText, null ]\n\t\t: [ null, unitText ];\n\n\treturn (\n\t\t<Flex { ...restProps } ref={ ref } className={ classes } gap={ 2 }>\n\t\t\t<FlexBlock>\n\t\t\t\t<NumberControl\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tclassName=\"components-angle-picker-control__input-field\"\n\t\t\t\t\tmax={ 360 }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tonChange={ handleOnNumberChange }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tstep=\"1\"\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tspinControls=\"none\"\n\t\t\t\t\tprefix={ prefixedUnitText }\n\t\t\t\t\tsuffix={ suffixedUnitText }\n\t\t\t\t/>\n\t\t\t</FlexBlock>\n\t\t\t<Spacer marginBottom=\"1\" marginTop=\"auto\">\n\t\t\t\t<AngleCircle\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t</Spacer>\n\t\t</Flex>\n\t);\n}\n\n/**\n * `AnglePickerControl` is a React component to render a UI that allows users to\n * pick an angle. Users can choose an angle in a visual UI with the mouse by\n * dragging an angle indicator inside a circle or by directly inserting the\n * desired angle in a text field.\n *\n * ```jsx\n * import { useState } from '@wordpress/element';\n * import { AnglePickerControl } from '@wordpress/components';\n *\n * function Example() {\n * const [ angle, setAngle ] = useState( 0 );\n * return (\n * <AnglePickerControl\n * value={ angle }\n * onChange={ setAngle }\n * </>\n * );\n * }\n * ```\n */\nexport const AnglePickerControl = forwardRef( UnforwardedAnglePickerControl );\n\nexport default AnglePickerControl;\n"],"mappings":";;;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,YAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,yBAAA,GAAAP,OAAA;AAnBA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAUA,SAASQ,6BAA6BA,CACrCC,KAAgE,EAChEC,GAAwB,EACvB;EACD,MAAM;IACLC,SAAS;IACTC,KAAK,GAAG,IAAAC,QAAE,EAAE,OAAQ,CAAC;IACrBC,QAAQ;IACRC,KAAK;IACL,GAAGC;EACJ,CAAC,GAAGP,KAAK;EAET,MAAMQ,oBAAoB,GAAKC,gBAAoC,IAAM;IACxE,IAAKJ,QAAQ,KAAKK,SAAS,EAAG;MAC7B;IACD;IAEA,MAAMC,UAAU,GACfF,gBAAgB,KAAKC,SAAS,IAAID,gBAAgB,KAAK,EAAE,GACtDG,QAAQ,CAAEH,gBAAgB,EAAE,EAAG,CAAC,GAChC,CAAC;IACLJ,QAAQ,CAAEM,UA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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM+B,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,IAAAE,mBAAU,EAAEvC,6BAA8B,CAAC;AAAC,IAAAwC,QAAA,GAAAF,OAAA,CAAAZ,OAAA,GAE/DW,kBAAkB","ignoreList":[]}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.Animate = Animate;
8
8
  exports.default = void 0;
9
9
  exports.getAnimateClassName = getAnimateClassName;
10
- var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _clsx = _interopRequireDefault(require("clsx"));
11
11
  /**
12
12
  * External dependencies
13
13
  */
@@ -31,7 +31,7 @@ function getDefaultOrigin(type) {
31
31
  */
32
32
  function getAnimateClassName(options) {
33
33
  if (options.type === 'loading') {
34
- return (0, _classnames.default)('components-animate__loading');
34
+ return (0, _clsx.default)('components-animate__loading');
35
35
  }
36
36
  const {
37
37
  type,
@@ -39,13 +39,13 @@ function getAnimateClassName(options) {
39
39
  } = options;
40
40
  if (type === 'appear') {
41
41
  const [yAxis, xAxis = 'center'] = origin.split(' ');
42
- return (0, _classnames.default)('components-animate__appear', {
42
+ return (0, _clsx.default)('components-animate__appear', {
43
43
  ['is-from-' + xAxis]: xAxis !== 'center',
44
44
  ['is-from-' + yAxis]: yAxis !== 'middle'
45
45
  });
46
46
  }
47
47
  if (type === 'slide-in') {
48
- return (0, _classnames.default)('components-animate__slide-in', 'is-from-' + origin);
48
+ return (0, _clsx.default)('components-animate__slide-in', 'is-from-' + origin);
49
49
  }
50
50
  return undefined;
51
51
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","getDefaultOrigin","type","getAnimateClassName","options","classnames","origin","yAxis","xAxis","split","undefined","Animate","children","className","_default","exports","default"],"sources":["@wordpress/components/src/animate/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport type { AnimateProps, GetAnimateOptions } from './types';\n\n/**\n * @param type The animation type\n * @return Default origin\n */\nfunction getDefaultOrigin( type?: GetAnimateOptions[ 'type' ] ) {\n\treturn type === 'appear' ? 'top' : 'left';\n}\n\n/**\n * @param options\n *\n * @return ClassName that applies the animations\n */\nexport function getAnimateClassName( options: GetAnimateOptions ) {\n\tif ( options.type === 'loading' ) {\n\t\treturn classnames( 'components-animate__loading' );\n\t}\n\n\tconst { type, origin = getDefaultOrigin( type ) } = options;\n\n\tif ( type === 'appear' ) {\n\t\tconst [ yAxis, xAxis = 'center' ] = origin.split( ' ' );\n\t\treturn classnames( 'components-animate__appear', {\n\t\t\t[ 'is-from-' + xAxis ]: xAxis !== 'center',\n\t\t\t[ 'is-from-' + yAxis ]: yAxis !== 'middle',\n\t\t} );\n\t}\n\n\tif ( type === 'slide-in' ) {\n\t\treturn classnames(\n\t\t\t'components-animate__slide-in',\n\t\t\t'is-from-' + origin\n\t\t);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Simple interface to introduce animations to components.\n *\n * ```jsx\n * import { Animate, Notice } from '@wordpress/components';\n *\n * const MyAnimatedNotice = () => (\n * \t<Animate type=\"slide-in\" options={ { origin: 'top' } }>\n * \t\t{ ( { className } ) => (\n * \t\t\t<Notice className={ className } status=\"success\">\n * \t\t\t\t<p>Animation finished.</p>\n * \t\t\t</Notice>\n * \t\t) }\n * \t</Animate>\n * );\n * ```\n */\nexport function Animate( { type, options = {}, children }: AnimateProps ) {\n\treturn children( {\n\t\tclassName: getAnimateClassName( {\n\t\t\ttype,\n\t\t\t...options,\n\t\t} as GetAnimateOptions ),\n\t} );\n}\n\nexport default Animate;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CAAEC,IAAkC,EAAG;EAC/D,OAAOA,IAAI,KAAK,QAAQ,GAAG,KAAK,GAAG,MAAM;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CAAEC,OAA0B,EAAG;EACjE,IAAKA,OAAO,CAACF,IAAI,KAAK,SAAS,EAAG;IACjC,OAAO,IAAAG,mBAAU,EAAE,6BAA8B,CAAC;EACnD;EAEA,MAAM;IAAEH,IAAI;IAAEI,MAAM,GAAGL,gBAAgB,CAAEC,IAAK;EAAE,CAAC,GAAGE,OAAO;EAE3D,IAAKF,IAAI,KAAK,QAAQ,EAAG;IACxB,MAAM,CAAEK,KAAK,EAAEC,KAAK,GAAG,QAAQ,CAAE,GAAGF,MAAM,CAACG,KAAK,CAAE,GAAI,CAAC;IACvD,OAAO,IAAAJ,mBAAU,EAAE,4BAA4B,EAAE;MAChD,CAAE,UAAU,GAAGG,KAAK,GAAIA,KAAK,KAAK,QAAQ;MAC1C,CAAE,UAAU,GAAGD,KAAK,GAAIA,KAAK,KAAK;IACnC,CAAE,CAAC;EACJ;EAEA,IAAKL,IAAI,KAAK,UAAU,EAAG;IAC1B,OAAO,IAAAG,mBAAU,EAChB,8BAA8B,EAC9B,UAAU,GAAGC,MACd,CAAC;EACF;EAEA,OAAOI,SAAS;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAAE;EAAET,IAAI;EAAEE,OAAO,GAAG,CAAC,CAAC;EAAEQ;AAAuB,CAAC,EAAG;EACzE,OAAOA,QAAQ,CAAE;IAChBC,SAAS,EAAEV,mBAAmB,CAAE;MAC/BD,IAAI;MACJ,GAAGE;IACJ,CAAuB;EACxB,CAAE,CAAC;AACJ;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcL,OAAO","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","getDefaultOrigin","type","getAnimateClassName","options","clsx","origin","yAxis","xAxis","split","undefined","Animate","children","className","_default","exports","default"],"sources":["@wordpress/components/src/animate/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport type { AnimateProps, GetAnimateOptions } from './types';\n\n/**\n * @param type The animation type\n * @return Default origin\n */\nfunction getDefaultOrigin( type?: GetAnimateOptions[ 'type' ] ) {\n\treturn type === 'appear' ? 'top' : 'left';\n}\n\n/**\n * @param options\n *\n * @return ClassName that applies the animations\n */\nexport function getAnimateClassName( options: GetAnimateOptions ) {\n\tif ( options.type === 'loading' ) {\n\t\treturn clsx( 'components-animate__loading' );\n\t}\n\n\tconst { type, origin = getDefaultOrigin( type ) } = options;\n\n\tif ( type === 'appear' ) {\n\t\tconst [ yAxis, xAxis = 'center' ] = origin.split( ' ' );\n\t\treturn clsx( 'components-animate__appear', {\n\t\t\t[ 'is-from-' + xAxis ]: xAxis !== 'center',\n\t\t\t[ 'is-from-' + yAxis ]: yAxis !== 'middle',\n\t\t} );\n\t}\n\n\tif ( type === 'slide-in' ) {\n\t\treturn clsx( 'components-animate__slide-in', 'is-from-' + origin );\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Simple interface to introduce animations to components.\n *\n * ```jsx\n * import { Animate, Notice } from '@wordpress/components';\n *\n * const MyAnimatedNotice = () => (\n * \t<Animate type=\"slide-in\" options={ { origin: 'top' } }>\n * \t\t{ ( { className } ) => (\n * \t\t\t<Notice className={ className } status=\"success\">\n * \t\t\t\t<p>Animation finished.</p>\n * \t\t\t</Notice>\n * \t\t) }\n * \t</Animate>\n * );\n * ```\n */\nexport function Animate( { type, options = {}, children }: AnimateProps ) {\n\treturn children( {\n\t\tclassName: getAnimateClassName( {\n\t\t\ttype,\n\t\t\t...options,\n\t\t} as GetAnimateOptions ),\n\t} );\n}\n\nexport default Animate;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA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GAEcL,OAAO","ignoreList":[]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.getAutoCompleterUI = getAutoCompleterUI;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _element = require("@wordpress/element");
11
11
  var _richText = require("@wordpress/rich-text");
12
12
  var _compose = require("@wordpress/compose");
@@ -100,7 +100,7 @@ function getAutoCompleterUI(autocompleter) {
100
100
  role: "option",
101
101
  "aria-selected": index === selectedIndex,
102
102
  disabled: option.isDisabled,
103
- className: (0, _classnames.default)('components-autocomplete__result', className, {
103
+ className: (0, _clsx.default)('components-autocomplete__result', className, {
104
104
  'is-selected': index === selectedIndex
105
105
  }),
106
106
  onClick: () => onSelect(option)
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_richText","_compose","_a11y","_i18n","_getDefaultUseItems","_button","_popover","_visuallyHidden","_reactDom","getAutoCompleterUI","autocompleter","useItems","getDefaultUseItems","AutocompleterUI","filterValue","instanceId","listBoxId","className","selectedIndex","onChangeOptions","onSelect","onReset","reset","contentRef","items","popoverAnchor","useAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","useState","popoverRef","useRef","popoverRefs","useMergeRefs","useRefEffect","node","ownerDocument","useOnClickOutside","debouncedSpeak","useDebounce","speak","announce","options","length","sprintf","_n","__","useLayoutEffect","ListBox","Component","_react","createElement","id","role","map","option","index","default","key","disabled","isDisabled","classnames","onClick","label","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 classnames from 'classnames';\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\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems = autocompleter.useItems\n\t\t? autocompleter.useItems\n\t\t: 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 aira-* 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// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [ items ] );\n\n\t\tif ( items.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst ListBox = ( {\n\t\t\tComponent = 'div',\n\t\t}: {\n\t\t\tComponent?: React.ElementType;\n\t\t} ) => (\n\t\t\t<Component\n\t\t\t\tid={ listBoxId }\n\t\t\t\trole=\"listbox\"\n\t\t\t\tclassName=\"components-autocomplete__results\"\n\t\t\t>\n\t\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ option.key }\n\t\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ option.label }\n\t\t\t\t\t</Button>\n\t\t\t\t) ) }\n\t\t\t</Component>\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</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 Component={ VisuallyHidden } />,\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\t// Disable reason: `ref` is a ref object and should not be included in a\n\t\t// hook's dependency list.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ handler ] );\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,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;AA1BA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;;AAQO,SAASW,kBAAkBA,CAAEC,aAA0B,EAAG;EAChE,MAAMC,QAAQ,GAAGD,aAAa,CAACC,QAAQ,GACpCD,aAAa,CAACC,QAAQ,GACtB,IAAAC,2BAAkB,EAAEF,aAAc,CAAC;EAEtC,SAASG,eAAeA,CAAE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3,"names":["_clsx","_interopRequireDefault","require","_element","_richText","_compose","_a11y","_i18n","_getDefaultUseItems","_button","_popover","_visuallyHidden","_reactDom","getAutoCompleterUI","autocompleter","useItems","getDefaultUseItems","AutocompleterUI","filterValue","instanceId","listBoxId","className","selectedIndex","onChangeOptions","onSelect","onReset","reset","contentRef","items","popoverAnchor","useAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","useState","popoverRef","useRef","popoverRefs","useMergeRefs","useRefEffect","node","ownerDocument","useOnClickOutside","debouncedSpeak","useDebounce","speak","announce","options","length","sprintf","_n","__","useLayoutEffect","ListBox","Component","_react","createElement","id","role","map","option","index","default","key","disabled","isDisabled","clsx","onClick","label","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\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems = autocompleter.useItems\n\t\t? autocompleter.useItems\n\t\t: 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 aira-* 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// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [ items ] );\n\n\t\tif ( items.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst ListBox = ( {\n\t\t\tComponent = 'div',\n\t\t}: {\n\t\t\tComponent?: React.ElementType;\n\t\t} ) => (\n\t\t\t<Component\n\t\t\t\tid={ listBoxId }\n\t\t\t\trole=\"listbox\"\n\t\t\t\tclassName=\"components-autocomplete__results\"\n\t\t\t>\n\t\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ option.key }\n\t\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ option.label }\n\t\t\t\t\t</Button>\n\t\t\t\t) ) }\n\t\t\t</Component>\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</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 Component={ VisuallyHidden } />,\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\t// Disable reason: `ref` is a ref object and should not be included in a\n\t\t// hook's dependency list.\n\t\t// eslint-disable-next-line react-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C;EAEL;EAEA,OAAO7D,eAAe;AACvB;AAEA,SAAS0B,iBAAiBA,CACzBgC,GAAmC,EACnCI,OAAwC,EACvC;EACD,IAAAC,kBAAS,EAAE,MAAM;IAChB,MAAMC,QAAQ,GAAKC,KAA8B,IAAM;MACtD;MACA,IACC,CAAEP,GAAG,CAAC3C,OAAO,IACb2C,GAAG,CAAC3C,OAAO,CAACmD,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;IACD;IACA;IACA;EACD,CAAC,EAAE,CAAEF,OAAO,CAAG,CAAC;AACjB","ignoreList":[]}
@@ -29,9 +29,6 @@ function useBaseControlProps(props) {
29
29
  ...restProps
30
30
  } = props;
31
31
  const uniqueId = (0, _compose.useInstanceId)(_.default, 'wp-components-base-control', preferredId);
32
-
33
- // ARIA descriptions can only contain plain text, so fall back to aria-details if not.
34
- const helpPropName = typeof help === 'string' ? 'aria-describedby' : 'aria-details';
35
32
  return {
36
33
  baseControlProps: {
37
34
  id: uniqueId,
@@ -41,7 +38,7 @@ function useBaseControlProps(props) {
41
38
  controlProps: {
42
39
  id: uniqueId,
43
40
  ...(!!help ? {
44
- [helpPropName]: `${uniqueId}__help`
41
+ 'aria-describedby': `${uniqueId}__help`
45
42
  } : {})
46
43
  }
47
44
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_","_interopRequireDefault","useBaseControlProps","props","help","id","preferredId","restProps","uniqueId","useInstanceId","BaseControl","helpPropName","baseControlProps","controlProps"],"sources":["@wordpress/components/src/base-control/hooks.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '.';\nimport type { BaseControlProps } from './types';\n\n/**\n * Generate props for the `BaseControl` and the inner control itself.\n *\n * Namely, it takes care of generating a unique `id`, properly associating it with the `label` and `help` elements.\n *\n * @param props\n */\nexport function useBaseControlProps(\n\tprops: Omit< BaseControlProps, 'children' >\n) {\n\tconst { help, id: preferredId, ...restProps } = props;\n\n\tconst uniqueId = useInstanceId(\n\t\tBaseControl,\n\t\t'wp-components-base-control',\n\t\tpreferredId\n\t);\n\n\t// ARIA descriptions can only contain plain text, so fall back to aria-details if not.\n\tconst helpPropName =\n\t\ttypeof help === 'string' ? 'aria-describedby' : 'aria-details';\n\n\treturn {\n\t\tbaseControlProps: {\n\t\t\tid: uniqueId,\n\t\t\thelp,\n\t\t\t...restProps,\n\t\t},\n\t\tcontrolProps: {\n\t\t\tid: uniqueId,\n\t\t\t...( !! help ? { [ helpPropName ]: `${ uniqueId }__help` } : {} ),\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,CAAA,GAAAC,sBAAA,CAAAF,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,mBAAmBA,CAClCC,KAA2C,EAC1C;EACD,MAAM;IAAEC,IAAI;IAAEC,EAAE,EAAEC,WAAW;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAErD,MAAMK,QAAQ,GAAG,IAAAC,sBAAa,EAC7BC,SAAW,EACX,4BAA4B,EAC5BJ,WACD,CAAC;;EAED;EACA,MAAMK,YAAY,GACjB,OAAOP,IAAI,KAAK,QAAQ,GAAG,kBAAkB,GAAG,cAAc;EAE/D,OAAO;IACNQ,gBAAgB,EAAE;MACjBP,EAAE,EAAEG,QAAQ;MACZJ,IAAI;MACJ,GAAGG;IACJ,CAAC;IACDM,YAAY,EAAE;MACbR,EAAE,EAAEG,QAAQ;MACZ,IAAK,CAAC,CAAEJ,IAAI,GAAG;QAAE,CAAEO,YAAY,GAAK,GAAGH,QAAU;MAAQ,CAAC,GAAG,CAAC,CAAC;IAChE;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_","_interopRequireDefault","useBaseControlProps","props","help","id","preferredId","restProps","uniqueId","useInstanceId","BaseControl","baseControlProps","controlProps"],"sources":["@wordpress/components/src/base-control/hooks.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '.';\nimport type { BaseControlProps } from './types';\n\n/**\n * Generate props for the `BaseControl` and the inner control itself.\n *\n * Namely, it takes care of generating a unique `id`, properly associating it with the `label` and `help` elements.\n *\n * @param props\n */\nexport function useBaseControlProps(\n\tprops: Omit< BaseControlProps, 'children' >\n) {\n\tconst { help, id: preferredId, ...restProps } = props;\n\n\tconst uniqueId = useInstanceId(\n\t\tBaseControl,\n\t\t'wp-components-base-control',\n\t\tpreferredId\n\t);\n\n\treturn {\n\t\tbaseControlProps: {\n\t\t\tid: uniqueId,\n\t\t\thelp,\n\t\t\t...restProps,\n\t\t},\n\t\tcontrolProps: {\n\t\t\tid: uniqueId,\n\t\t\t...( !! help ? { 'aria-describedby': `${ uniqueId }__help` } : {} ),\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,CAAA,GAAAC,sBAAA,CAAAF,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,mBAAmBA,CAClCC,KAA2C,EAC1C;EACD,MAAM;IAAEC,IAAI;IAAEC,EAAE,EAAEC,WAAW;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAErD,MAAMK,QAAQ,GAAG,IAAAC,sBAAa,EAC7BC,SAAW,EACX,4BAA4B,EAC5BJ,WACD,CAAC;EAED,OAAO;IACNK,gBAAgB,EAAE;MACjBN,EAAE,EAAEG,QAAQ;MACZJ,IAAI;MACJ,GAAGG;IACJ,CAAC;IACDK,YAAY,EAAE;MACbP,EAAE,EAAEG,QAAQ;MACZ,IAAK,CAAC,CAAEJ,IAAI,GAAG;QAAE,kBAAkB,EAAG,GAAGI,QAAU;MAAQ,CAAC,GAAG,CAAC,CAAC;IAClE;EACD,CAAC;AACF","ignoreList":[]}
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "useBaseControlProps", {
12
12
  }
13
13
  });
14
14
  var _react = require("react");
15
- var _classnames = _interopRequireDefault(require("classnames"));
15
+ var _clsx = _interopRequireDefault(require("clsx"));
16
16
  var _visuallyHidden = require("../visually-hidden");
17
17
  var _baseControlStyles = require("./styles/base-control-styles");
18
18
  var _context = require("../context");
@@ -104,7 +104,7 @@ const VisualLabel = ({
104
104
  }) => {
105
105
  return (0, _react.createElement)(_baseControlStyles.StyledVisualLabel, {
106
106
  ...props,
107
- className: (0, _classnames.default)('components-base-control__label', className)
107
+ className: (0, _clsx.default)('components-base-control__label', className)
108
108
  }, children);
109
109
  };
110
110
  exports.VisualLabel = VisualLabel;
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_visuallyHidden","_baseControlStyles","_context","_hooks","UnconnectedBaseControl","props","__nextHasNoMarginBottom","id","label","hideLabelFromVision","help","className","children","useContextSystem","_react","createElement","Wrapper","StyledField","VisuallyHidden","as","htmlFor","StyledLabel","VisualLabel","StyledHelp","undefined","StyledVisualLabel","classnames","exports","BaseControl","Object","assign","contextConnectWithoutRef","_default","default"],"sources":["@wordpress/components/src/base-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { BaseControlProps, BaseControlVisualLabelProps } from './types';\nimport {\n\tWrapper,\n\tStyledField,\n\tStyledLabel,\n\tStyledHelp,\n\tStyledVisualLabel,\n} from './styles/base-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\n\nexport { useBaseControlProps } from './hooks';\n\n/**\n * `BaseControl` is a component used to generate labels and help text for components handling user inputs.\n *\n * ```jsx\n * import { BaseControl, useBaseControlProps } from '@wordpress/components';\n *\n * // Render a `BaseControl` for a textarea input\n * const MyCustomTextareaControl = ({ children, ...baseProps }) => (\n * \t// `useBaseControlProps` is a convenience hook to get the props for the `BaseControl`\n * \t// and the inner control itself. Namely, it takes care of generating a unique `id`,\n * \t// properly associating it with the `label` and `help` elements.\n * \tconst { baseControlProps, controlProps } = useBaseControlProps( baseProps );\n *\n * \treturn (\n * \t\t<BaseControl { ...baseControlProps } __nextHasNoMarginBottom={ true }>\n * \t\t\t<textarea { ...controlProps }>\n * \t\t\t { children }\n * \t\t\t</textarea>\n * \t\t</BaseControl>\n * \t);\n * );\n * ```\n */\nconst UnconnectedBaseControl = (\n\tprops: WordPressComponentProps< BaseControlProps, null >\n) => {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tid,\n\t\tlabel,\n\t\thideLabelFromVision = false,\n\t\thelp,\n\t\tclassName,\n\t\tchildren,\n\t} = useContextSystem( props, 'BaseControl' );\n\n\treturn (\n\t\t<Wrapper className={ className }>\n\t\t\t<StyledField\n\t\t\t\tclassName=\"components-base-control__field\"\n\t\t\t\t// TODO: Official deprecation for this should start after all internal usages have been migrated\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t>\n\t\t\t\t{ label &&\n\t\t\t\t\tid &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\" htmlFor={ id }>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<StyledLabel\n\t\t\t\t\t\t\tclassName=\"components-base-control__label\"\n\t\t\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</StyledLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ label &&\n\t\t\t\t\t! id &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<VisualLabel>{ label }</VisualLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ children }\n\t\t\t</StyledField>\n\t\t\t{ !! help && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\tid={ id ? id + '__help' : undefined }\n\t\t\t\t\tclassName=\"components-base-control__help\"\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t>\n\t\t\t\t\t{ help }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n};\n\n/**\n * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.\n *\n * It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled,\n * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would\n * otherwise use if the `label` prop was passed.\n *\n * @example\n * import { BaseControl } from '@wordpress/components';\n *\n * const MyBaseControl = () => (\n * \t<BaseControl help=\"This button is already accessibly labeled.\">\n * \t\t<BaseControl.VisualLabel>Author</BaseControl.VisualLabel>\n * \t\t<Button>Select an author</Button>\n * \t</BaseControl>\n * );\n */\nexport const VisualLabel = ( {\n\tclassName,\n\tchildren,\n\t...props\n}: WordPressComponentProps< BaseControlVisualLabelProps, 'span' > ) => {\n\treturn (\n\t\t<StyledVisualLabel\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-base-control__label',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledVisualLabel>\n\t);\n};\n\nexport const BaseControl = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedBaseControl, 'BaseControl' ),\n\t{ VisualLabel }\n);\n\nexport default BaseControl;\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AAQA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,sBAAsB,GAC3BC,KAAwD,IACpD;EACJ,MAAM;IACLC,uBAAuB,GAAG,KAAK;IAC/BC,EAAE;IACFC,KAAK;IACLC,mBAAmB,GAAG,KAAK;IAC3BC,IAAI;IACJC,SAAS;IACTC;EACD,CAAC,GAAG,IAAAC,yBAAgB,EAAER,KAAK,EAAE,aAAc,CAAC;EAE5C,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAe,OAAO;IAACL,SAAS,EAAGA;EAAW,GAC/B,IAAAG,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAgB,WAAW;IACXN,SAAS,EAAC;IACV;IAAA;IACAL,uBAAuB,EAAGA;EAAyB,GAEjDE,KAAK,IACND,EAAE,KACAE,mBAAmB,GACpB,IAAAK,MAAA,CAAAC,aAAA,EAACf,eAAA,CAAAkB,cAAc;IAACC,EAAE,EAAC,OAAO;IAACC,OAAO,EAAGb;EAAI,GACtCC,KACa,CAAC,GAEjB,IAAAM,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAoB,WAAW;IACXV,SAAS,EAAC,gCAAgC;IAC1CS,OAAO,EAAGb;EAAI,GAEZC,KACU,CACb,CAAE,EACFA,KAAK,IACN,CAAED,EAAE,KACFE,mBAAmB,GACpB,IAAAK,MAAA,CAAAC,aAAA,EAACf,eAAA,CAAAkB,cAAc;IAACC,EAAE,EAAC;EAAO,GAAGX,KAAuB,CAAC,GAErD,IAAAM,MAAA,CAAAC,aAAA,EAACO,WAAW,QAAGd,KAAoB,CACnC,CAAE,EACFI,QACU,CAAC,EACZ,CAAC,CAAEF,IAAI,IACR,IAAAI,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAsB,UAAU;IACVhB,EAAE,EAAGA,EAAE,GAAGA,EAAE,GAAG,QAAQ,GAAGiB,SAAW;IACrCb,SAAS,EAAC,+BAA+B;IACzCL,uBAAuB,EAAGA;EAAyB,GAEjDI,IACS,CAEL,CAAC;AAEZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMY,WAAW,GAAGA,CAAE;EAC5BX,SAAS;EACTC,QAAQ;EACR,GAAGP;AAC4D,CAAC,KAAM;EACtE,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAwB,iBAAiB;IAAA,GACZpB,KAAK;IACVM,SAAS,EAAG,IAAAe,mBAAU,EACrB,gCAAgC,EAChCf,SACD;EAAG,GAEDC,QACgB,CAAC;AAEtB,CAAC;AAACe,OAAA,CAAAL,WAAA,GAAAA,WAAA;AAEK,MAAMM,WAAW,GAAAD,OAAA,CAAAC,WAAA,GAAGC,MAAM,CAACC,MAAM,CACvC,IAAAC,iCAAwB,EAAE3B,sBAAsB,EAAE,aAAc,CAAC,EACjE;EAAEkB;AAAY,CACf,CAAC;AAAC,IAAAU,QAAA,GAAAL,OAAA,CAAAM,OAAA,GAEaL,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_visuallyHidden","_baseControlStyles","_context","_hooks","UnconnectedBaseControl","props","__nextHasNoMarginBottom","id","label","hideLabelFromVision","help","className","children","useContextSystem","_react","createElement","Wrapper","StyledField","VisuallyHidden","as","htmlFor","StyledLabel","VisualLabel","StyledHelp","undefined","StyledVisualLabel","clsx","exports","BaseControl","Object","assign","contextConnectWithoutRef","_default","default"],"sources":["@wordpress/components/src/base-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { BaseControlProps, BaseControlVisualLabelProps } from './types';\nimport {\n\tWrapper,\n\tStyledField,\n\tStyledLabel,\n\tStyledHelp,\n\tStyledVisualLabel,\n} from './styles/base-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\n\nexport { useBaseControlProps } from './hooks';\n\n/**\n * `BaseControl` is a component used to generate labels and help text for components handling user inputs.\n *\n * ```jsx\n * import { BaseControl, useBaseControlProps } from '@wordpress/components';\n *\n * // Render a `BaseControl` for a textarea input\n * const MyCustomTextareaControl = ({ children, ...baseProps }) => (\n * \t// `useBaseControlProps` is a convenience hook to get the props for the `BaseControl`\n * \t// and the inner control itself. Namely, it takes care of generating a unique `id`,\n * \t// properly associating it with the `label` and `help` elements.\n * \tconst { baseControlProps, controlProps } = useBaseControlProps( baseProps );\n *\n * \treturn (\n * \t\t<BaseControl { ...baseControlProps } __nextHasNoMarginBottom={ true }>\n * \t\t\t<textarea { ...controlProps }>\n * \t\t\t { children }\n * \t\t\t</textarea>\n * \t\t</BaseControl>\n * \t);\n * );\n * ```\n */\nconst UnconnectedBaseControl = (\n\tprops: WordPressComponentProps< BaseControlProps, null >\n) => {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tid,\n\t\tlabel,\n\t\thideLabelFromVision = false,\n\t\thelp,\n\t\tclassName,\n\t\tchildren,\n\t} = useContextSystem( props, 'BaseControl' );\n\n\treturn (\n\t\t<Wrapper className={ className }>\n\t\t\t<StyledField\n\t\t\t\tclassName=\"components-base-control__field\"\n\t\t\t\t// TODO: Official deprecation for this should start after all internal usages have been migrated\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t>\n\t\t\t\t{ label &&\n\t\t\t\t\tid &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\" htmlFor={ id }>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<StyledLabel\n\t\t\t\t\t\t\tclassName=\"components-base-control__label\"\n\t\t\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</StyledLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ label &&\n\t\t\t\t\t! id &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<VisualLabel>{ label }</VisualLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ children }\n\t\t\t</StyledField>\n\t\t\t{ !! help && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\tid={ id ? id + '__help' : undefined }\n\t\t\t\t\tclassName=\"components-base-control__help\"\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t>\n\t\t\t\t\t{ help }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n};\n\n/**\n * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.\n *\n * It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled,\n * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would\n * otherwise use if the `label` prop was passed.\n *\n * @example\n * import { BaseControl } from '@wordpress/components';\n *\n * const MyBaseControl = () => (\n * \t<BaseControl help=\"This button is already accessibly labeled.\">\n * \t\t<BaseControl.VisualLabel>Author</BaseControl.VisualLabel>\n * \t\t<Button>Select an author</Button>\n * \t</BaseControl>\n * );\n */\nexport const VisualLabel = ( {\n\tclassName,\n\tchildren,\n\t...props\n}: WordPressComponentProps< BaseControlVisualLabelProps, 'span' > ) => {\n\treturn (\n\t\t<StyledVisualLabel\n\t\t\t{ ...props }\n\t\t\tclassName={ clsx( 'components-base-control__label', className ) }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledVisualLabel>\n\t);\n};\n\nexport const BaseControl = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedBaseControl, 'BaseControl' ),\n\t{ VisualLabel }\n);\n\nexport default BaseControl;\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AAQA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,sBAAsB,GAC3BC,KAAwD,IACpD;EACJ,MAAM;IACLC,uBAAuB,GAAG,KAAK;IAC/BC,EAAE;IACFC,KAAK;IACLC,mBAAmB,GAAG,KAAK;IAC3BC,IAAI;IACJC,SAAS;IACTC;EACD,CAAC,GAAG,IAAAC,yBAAgB,EAAER,KAAK,EAAE,aAAc,CAAC;EAE5C,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAe,OAAO;IAACL,SAAS,EAAGA;EAAW,GAC/B,IAAAG,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAgB,WAAW;IACXN,SAAS,EAAC;IACV;IAAA;IACAL,uBAAuB,EAAGA;EAAyB,GAEjDE,KAAK,IACND,EAAE,KACAE,mBAAmB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AAwB,EAAE3B,sBAAsB,EAAE,aAAc,CAAC,EACjE;EAAEkB;AAAY,CACf,CAAC;AAAC,IAAAU,QAAA,GAAAL,OAAA,CAAAM,OAAA,GAEaL,WAAW","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/base-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type BaseControlProps = {\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * The HTML `id` of the control element (passed in as a child to `BaseControl`) to which labels and help text are being generated.\n\t * This is necessary to accessibly associate the label with that element.\n\t *\n\t * The recommended way is to use the `useBaseControlProps` hook, which takes care of generating a unique `id` for you.\n\t * Otherwise, if you choose to pass an explicit `id` to this prop, you are responsible for ensuring the uniqueness of the `id`.\n\t */\n\tid?: string;\n\t/**\n\t * Additional description for the control.\n\t *\n\t * It is preferable to use plain text for `help`, as it can be accessibly associated with the control using `aria-describedby`.\n\t * When the `help` contains links, or otherwise non-plain text content, it will be associated with the control using `aria-details`.\n\t */\n\thelp?: ReactNode;\n\t/**\n\t * If this property is added, a label will be generated using label property as the content.\n\t */\n\tlabel?: ReactNode;\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default false\n\t */\n\thideLabelFromVision?: boolean;\n\tclassName?: string;\n\t/**\n\t * The content to be displayed within the `BaseControl`.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type BaseControlVisualLabelProps = {\n\tchildren: ReactNode;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/base-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type BaseControlProps = {\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * The HTML `id` of the control element (passed in as a child to `BaseControl`) to which labels and help text are being generated.\n\t * This is necessary to accessibly associate the label with that element.\n\t *\n\t * The recommended way is to use the `useBaseControlProps` hook, which takes care of generating a unique `id` for you.\n\t * Otherwise, if you choose to pass an explicit `id` to this prop, you are responsible for ensuring the uniqueness of the `id`.\n\t */\n\tid?: string;\n\t/**\n\t * Additional description for the control.\n\t *\n\t * The element containing the description will be programmatically associated to the BaseControl by the means of an `aria-describedby` attribute.\n\t */\n\thelp?: ReactNode;\n\t/**\n\t * If this property is added, a label will be generated using label property as the content.\n\t */\n\tlabel?: ReactNode;\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default false\n\t */\n\thideLabelFromVision?: boolean;\n\tclassName?: string;\n\t/**\n\t * The content to be displayed within the `BaseControl`.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type BaseControlVisualLabelProps = {\n\tchildren: ReactNode;\n};\n"],"mappings":"","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' | 'enableAlpha' | '__experimentalIsRenderedInSidebar'\n> & {\n\t/**\n\t * This toggles the ability to choose custom colors.\n\t */\n\tdisableCustomColors?: 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 * 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 * Whether or not to show the header for the border color and style\n\t\t * picker dropdown. The header includes a label for the color picker\n\t\t * and a close button.\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 * Whether or not to render a header for the border color and style picker\n\t\t * dropdown. The header includes a label for the color picker and a\n\t\t * close button.\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' | 'enableAlpha' | '__experimentalIsRenderedInSidebar'\n> & {\n\t/**\n\t * This toggles the ability to choose custom colors.\n\t */\n\tdisableCustomColors?: 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 * Whether or not to show the header for the border color and style\n\t\t * picker dropdown. The header includes a label for the color picker\n\t\t * and a close button.\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 * Whether or not to render a header for the border color and style picker\n\t\t * dropdown. The header includes a label for the color picker and a\n\t\t * close button.\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":[]}
@@ -8,7 +8,7 @@ exports.Button = void 0;
8
8
  exports.UnforwardedButton = UnforwardedButton;
9
9
  exports.default = void 0;
10
10
  var _react = require("react");
11
- var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _clsx = _interopRequireDefault(require("clsx"));
12
12
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
13
13
  var _element = require("@wordpress/element");
14
14
  var _compose = require("@wordpress/compose");
@@ -121,7 +121,7 @@ function UnforwardedButton(props, ref) {
121
121
  // Tooltip should not considered as a child
122
122
  children?.[0]?.props?.className !== 'components-tooltip';
123
123
  const truthyAriaPressedValues = [true, 'true', 'mixed'];
124
- const classes = (0, _classnames.default)('components-button', className, {
124
+ const classes = (0, _clsx.default)('components-button', className, {
125
125
  'is-next-40px-default-size': __next40pxDefaultSize,
126
126
  'is-secondary': variant === 'secondary',
127
127
  'is-primary': variant === 'primary',
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_deprecated","_element","_compose","_tooltip","_icon","_visuallyHidden","_utils","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","otherProps","computedSize","computedVariant","newProps","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","deprecated","since","alternative","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","buttonOrAnchorProps","href","target","ariaChecked","ariaPressed","ariaSelected","additionalProps","undefined","instanceId","useInstanceId","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","classnames","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","_react","createElement","Fragment","default","element","tooltipProps","placement","positionToPlacement","VisuallyHidden","id","exports","forwardRef","_default"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\nimport { positionToPlacement } from '../popover/utils';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisPressed,\n\tisSmall,\n\tsize,\n\tvariant,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tconst newProps: { 'aria-pressed'?: boolean } = {\n\t\t// @todo Mark `isPressed` as deprecated\n\t\t'aria-pressed': isPressed,\n\t};\n\n\tif ( isSmall ) {\n\t\tcomputedSize ??= 'small';\n\t}\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'wp.components.Button `isDefault` prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...newProps,\n\t\t...otherProps,\n\t\tsize: computedSize,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function UnforwardedButton(\n\tprops: ButtonProps & DeprecatedButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\tsize = 'default',\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...buttonOrAnchorProps\n\t} = useDeprecatedProps( props );\n\n\tconst {\n\t\thref,\n\t\ttarget,\n\t\t'aria-checked': ariaChecked,\n\t\t'aria-pressed': ariaPressed,\n\t\t'aria-selected': ariaSelected,\n\t\t...additionalProps\n\t} = 'href' in buttonOrAnchorProps\n\t\t? buttonOrAnchorProps\n\t\t: { href: undefined, target: undefined, ...buttonOrAnchorProps };\n\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst hasChildren =\n\t\t( 'string' === typeof children && !! children ) ||\n\t\t( Array.isArray( children ) &&\n\t\t\tchildren?.[ 0 ] &&\n\t\t\tchildren[ 0 ] !== null &&\n\t\t\t// Tooltip should not considered as a child\n\t\t\tchildren?.[ 0 ]?.props?.className !== 'components-tooltip' );\n\n\tconst truthyAriaPressedValues: ( typeof ariaPressed )[] = [\n\t\ttrue,\n\t\t'true',\n\t\t'mixed',\n\t];\n\n\tconst classes = classnames( 'components-button', className, {\n\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': size === 'small',\n\t\t'is-compact': size === 'compact',\n\t\t'is-tertiary': variant === 'tertiary',\n\n\t\t'is-pressed': truthyAriaPressedValues.includes( ariaPressed ),\n\t\t'is-pressed-mixed': ariaPressed === 'mixed',\n\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && ( hasChildren || text ),\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst buttonProps: ComponentPropsWithoutRef< 'button' > =\n\t\tTag === 'button'\n\t\t\t? {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-checked': ariaChecked,\n\t\t\t\t\t'aria-pressed': ariaPressed,\n\t\t\t\t\t'aria-selected': ariaSelected,\n\t\t\t }\n\t\t\t: {};\n\tconst anchorProps: ComponentPropsWithoutRef< 'a' > =\n\t\tTag === 'a' ? { href, target } : {};\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\tbuttonProps[ 'aria-disabled' ] = true;\n\t\tanchorProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event: MouseEvent ) => {\n\t\t\t\tif ( event ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && !! label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\t!! shortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t! ( children as string | ReactElement[] )?.length &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : undefined;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst commonProps = {\n\t\tclassName: classes,\n\t\t'aria-label': additionalProps[ 'aria-label' ] || label,\n\t\t'aria-describedby': describedById,\n\t\tref,\n\t};\n\n\tconst elementChildren = (\n\t\t<>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ children }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t</>\n\t);\n\n\tconst element =\n\t\tTag === 'a' ? (\n\t\t\t<a\n\t\t\t\t{ ...anchorProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLAnchorElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\t{ ...buttonProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLButtonElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</button>\n\t\t);\n\n\t// In order to avoid some React reconciliation issues, we are always rendering\n\t// the `Tooltip` component even when `shouldShowTooltip` is `false`.\n\t// In order to make sure that the tooltip doesn't show when it shouldn't,\n\t// we don't pass the props to the `Tooltip` component.\n\tconst tooltipProps = shouldShowTooltip\n\t\t? {\n\t\t\t\ttext:\n\t\t\t\t\t( children as string | ReactElement[] )?.length &&\n\t\t\t\t\tdescribedBy\n\t\t\t\t\t\t? describedBy\n\t\t\t\t\t\t: label,\n\t\t\t\tshortcut,\n\t\t\t\tplacement:\n\t\t\t\t\ttooltipPosition &&\n\t\t\t\t\t// Convert legacy `position` values to be used with the new `placement` prop\n\t\t\t\t\tpositionToPlacement( tooltipPosition ),\n\t\t }\n\t\t: {};\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip { ...tooltipProps }>{ element }</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef( UnforwardedButton );\nexport default Button;\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAYA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AA1BA;AACA;AACA;;AAUA;AACA;AACA;;AAKA;AACA;AACA;;AAOA,MAAMQ,8BAA8B,GAAG,CAAE,aAAa,EAAE,SAAS,CAAW;AAE5E,SAASC,kBAAkBA,CAAE;EAC5BC,SAAS;EACTC,SAAS;EACTC,WAAW;EACXC,UAAU;EACVC,MAAM;EACNC,SAAS;EACTC,OAAO;EACPC,IAAI;EACJC,OAAO;EACP,GAAGC;AACiC,CAAC,EAAgB;EACrD,IAAIC,YAAY,GAAGH,IAAI;EACvB,IAAII,eAAe,GAAGH,OAAO;EAE7B,MAAMI,QAAsC,GAAG;IAC9C;IACA,cAAc,EAAEP;EACjB,CAAC;EAED,IAAKC,OAAO,EAA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B,IAAI,EACDD,QAAQ,EAA+BiC,MAAM,IAC/C7B,WAAW,GACRA,WAAW,GACXL,KAAK;IACTD,QAAQ;IACR8C,SAAS,EACR/C,eAAe;IACf;IACA,IAAAgD,0BAAmB,EAAEhD,eAAgB;EACtC,CAAC,GACD,CAAC,CAAC;EAEL,OACC,IAAAyC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAAClF,QAAA,CAAAoF,OAAO;IAAA,GAAME;EAAY,GAAKD,OAAkB,CAAC,EAChDtC,WAAW,IACZ,IAAAkC,MAAA,CAAAC,aAAA,EAAChF,eAAA,CAAAuF,cAAc,QACd,IAAAR,MAAA,CAAAC,aAAA;IAAMQ,EAAE,EAAGb;EAAe,GAAG9B,WAAmB,CACjC,CAEhB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMW,MAAM,GAAAiC,OAAA,CAAAjC,MAAA,GAAG,IAAAkC,mBAAU,EAAEhE,iBAAkB,CAAC;AAAC,IAAAiE,QAAA,GAAAF,OAAA,CAAAP,OAAA,GACvC1B,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_deprecated","_element","_compose","_tooltip","_icon","_visuallyHidden","_utils","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","otherProps","computedSize","computedVariant","newProps","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","deprecated","since","alternative","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","buttonOrAnchorProps","href","target","ariaChecked","ariaPressed","ariaSelected","additionalProps","undefined","instanceId","useInstanceId","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","clsx","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","_react","createElement","Fragment","default","element","tooltipProps","placement","positionToPlacement","VisuallyHidden","id","exports","forwardRef","_default"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\nimport { positionToPlacement } from '../popover/utils';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisPressed,\n\tisSmall,\n\tsize,\n\tvariant,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tconst newProps: { 'aria-pressed'?: boolean } = {\n\t\t// @todo Mark `isPressed` as deprecated\n\t\t'aria-pressed': isPressed,\n\t};\n\n\tif ( isSmall ) {\n\t\tcomputedSize ??= 'small';\n\t}\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'wp.components.Button `isDefault` prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...newProps,\n\t\t...otherProps,\n\t\tsize: computedSize,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function UnforwardedButton(\n\tprops: ButtonProps & DeprecatedButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\tsize = 'default',\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...buttonOrAnchorProps\n\t} = useDeprecatedProps( props );\n\n\tconst {\n\t\thref,\n\t\ttarget,\n\t\t'aria-checked': ariaChecked,\n\t\t'aria-pressed': ariaPressed,\n\t\t'aria-selected': ariaSelected,\n\t\t...additionalProps\n\t} = 'href' in buttonOrAnchorProps\n\t\t? buttonOrAnchorProps\n\t\t: { href: undefined, target: undefined, ...buttonOrAnchorProps };\n\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst hasChildren =\n\t\t( 'string' === typeof children && !! children ) ||\n\t\t( Array.isArray( children ) &&\n\t\t\tchildren?.[ 0 ] &&\n\t\t\tchildren[ 0 ] !== null &&\n\t\t\t// Tooltip should not considered as a child\n\t\t\tchildren?.[ 0 ]?.props?.className !== 'components-tooltip' );\n\n\tconst truthyAriaPressedValues: ( typeof ariaPressed )[] = [\n\t\ttrue,\n\t\t'true',\n\t\t'mixed',\n\t];\n\n\tconst classes = clsx( 'components-button', className, {\n\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': size === 'small',\n\t\t'is-compact': size === 'compact',\n\t\t'is-tertiary': variant === 'tertiary',\n\n\t\t'is-pressed': truthyAriaPressedValues.includes( ariaPressed ),\n\t\t'is-pressed-mixed': ariaPressed === 'mixed',\n\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && ( hasChildren || text ),\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst buttonProps: ComponentPropsWithoutRef< 'button' > =\n\t\tTag === 'button'\n\t\t\t? {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-checked': ariaChecked,\n\t\t\t\t\t'aria-pressed': ariaPressed,\n\t\t\t\t\t'aria-selected': ariaSelected,\n\t\t\t }\n\t\t\t: {};\n\tconst anchorProps: ComponentPropsWithoutRef< 'a' > =\n\t\tTag === 'a' ? { href, target } : {};\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\tbuttonProps[ 'aria-disabled' ] = true;\n\t\tanchorProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event: MouseEvent ) => {\n\t\t\t\tif ( event ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && !! label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\t!! shortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t! ( children as string | ReactElement[] )?.length &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : undefined;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst commonProps = {\n\t\tclassName: classes,\n\t\t'aria-label': additionalProps[ 'aria-label' ] || label,\n\t\t'aria-describedby': describedById,\n\t\tref,\n\t};\n\n\tconst elementChildren = (\n\t\t<>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ children }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t</>\n\t);\n\n\tconst element =\n\t\tTag === 'a' ? (\n\t\t\t<a\n\t\t\t\t{ ...anchorProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLAnchorElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\t{ ...buttonProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLButtonElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</button>\n\t\t);\n\n\t// In order to avoid some React reconciliation issues, we are always rendering\n\t// the `Tooltip` component even when `shouldShowTooltip` is `false`.\n\t// In order to make sure that the tooltip doesn't show when it shouldn't,\n\t// we don't pass the props to the `Tooltip` component.\n\tconst tooltipProps = shouldShowTooltip\n\t\t? {\n\t\t\t\ttext:\n\t\t\t\t\t( children as string | ReactElement[] )?.length &&\n\t\t\t\t\tdescribedBy\n\t\t\t\t\t\t? describedBy\n\t\t\t\t\t\t: label,\n\t\t\t\tshortcut,\n\t\t\t\tplacement:\n\t\t\t\t\ttooltipPosition &&\n\t\t\t\t\t// Convert legacy `position` values to be used with the new `placement` prop\n\t\t\t\t\tpositionToPlacement( tooltipPosition ),\n\t\t }\n\t\t: {};\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip { ...tooltipProps }>{ element }</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef( UnforwardedButton );\nexport default Button;\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAYA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AA1BA;AACA;AACA;;AAUA;AACA;AACA;;AAKA;AACA;AACA;;AAOA,MAAMQ,8BAA8B,GAAG,CAAE,aAAa,EAAE,SAAS,CAAW;AAE5E,SAASC,kBAAkBA,CAAE;EAC5BC,SAAS;EACTC,SAAS;EACTC,WAAW;EACXC,UAAU;EACVC,MAAM;EACNC,SAAS;EACTC,OAAO;EACPC,IAAI;EACJC,OAAO;EACP,GAAGC;AACiC,CAAC,EAAgB;EACrD,IAAIC,YAAY,GAAGH,IAAI;EACvB,IAAII,eAAe,GAAGH,OAAO;EAE7B,MAAMI,QAAsC,G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F;EACA;EACA;EACA;EACA,MAAMM,YAAY,GAAGX,iBAAiB,GACnC;IACA/B,IAAI,EACDD,QAAQ,EAA+BiC,MAAM,IAC/C7B,WAAW,GACRA,WAAW,GACXL,KAAK;IACTD,QAAQ;IACR8C,SAAS,EACR/C,eAAe;IACf;IACA,IAAAgD,0BAAmB,EAAEhD,eAAgB;EACtC,CAAC,GACD,CAAC,CAAC;EAEL,OACC,IAAAyC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAAClF,QAAA,CAAAoF,OAAO;IAAA,GAAME;EAAY,GAAKD,OAAkB,CAAC,EAChDtC,WAAW,IACZ,IAAAkC,MAAA,CAAAC,aAAA,EAAChF,eAAA,CAAAuF,cAAc,QACd,IAAAR,MAAA,CAAAC,aAAA;IAAMQ,EAAE,EAAGb;EAAe,GAAG9B,WAAmB,CACjC,CAEhB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMW,MAAM,GAAAiC,OAAA,CAAAjC,MAAA,GAAG,IAAAkC,mBAAU,EAAEhE,iBAAkB,CAAC;AAAC,IAAAiE,QAAA,GAAAF,OAAA,CAAAP,OAAA,GACvC1B,MAAM","ignoreList":[]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = exports.ButtonGroup = void 0;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _element = require("@wordpress/element");
11
11
  /**
12
12
  * External dependencies
@@ -25,7 +25,7 @@ function UnforwardedButtonGroup(props, ref) {
25
25
  className,
26
26
  ...restProps
27
27
  } = props;
28
- const classes = (0, _classnames.default)('components-button-group', className);
28
+ const classes = (0, _clsx.default)('components-button-group', className);
29
29
  return (0, _react.createElement)("div", {
30
30
  ref: ref,
31
31
  role: "group",