@wordpress/components 27.4.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 (1287) hide show
  1. package/CHANGELOG.md +47 -1
  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 +5 -3
  5. package/build/alignment-matrix-control/index.js.map +1 -1
  6. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +8 -8
  7. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  8. package/build/alignment-matrix-control/utils.js +6 -2
  9. package/build/alignment-matrix-control/utils.js.map +1 -1
  10. package/build/angle-picker-control/index.js +2 -2
  11. package/build/angle-picker-control/index.js.map +1 -1
  12. package/build/animate/index.js +4 -4
  13. package/build/animate/index.js.map +1 -1
  14. package/build/autocomplete/autocompleter-ui.js +5 -3
  15. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  16. package/build/autocomplete/index.js +21 -7
  17. package/build/autocomplete/index.js.map +1 -1
  18. package/build/base-control/hooks.js +1 -4
  19. package/build/base-control/hooks.js.map +1 -1
  20. package/build/base-control/index.js +2 -2
  21. package/build/base-control/index.js.map +1 -1
  22. package/build/base-control/types.js.map +1 -1
  23. package/build/border-control/types.js.map +1 -1
  24. package/build/button/index.js +2 -2
  25. package/build/button/index.js.map +1 -1
  26. package/build/button-group/index.js +2 -2
  27. package/build/button-group/index.js.map +1 -1
  28. package/build/checkbox-control/index.js +11 -4
  29. package/build/checkbox-control/index.js.map +1 -1
  30. package/build/circular-option-picker/circular-option-picker-actions.js +3 -3
  31. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  32. package/build/circular-option-picker/circular-option-picker-option-group.js +2 -2
  33. package/build/circular-option-picker/circular-option-picker-option-group.js.map +1 -1
  34. package/build/circular-option-picker/circular-option-picker-option.js +2 -2
  35. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  36. package/build/circular-option-picker/circular-option-picker.js +2 -2
  37. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  38. package/build/clipboard-button/index.js +2 -2
  39. package/build/clipboard-button/index.js.map +1 -1
  40. package/build/color-indicator/index.js +2 -2
  41. package/build/color-indicator/index.js.map +1 -1
  42. package/build/color-palette/index.js +2 -2
  43. package/build/color-palette/index.js.map +1 -1
  44. package/build/color-picker/hex-input.js +3 -1
  45. package/build/color-picker/hex-input.js.map +1 -1
  46. package/build/color-picker/hue-picker.native.js +6 -2
  47. package/build/color-picker/hue-picker.native.js.map +1 -1
  48. package/build/color-picker/index.native.js +9 -3
  49. package/build/color-picker/index.native.js.map +1 -1
  50. package/build/color-picker/saturation-picker.native.js +6 -2
  51. package/build/color-picker/saturation-picker.native.js.map +1 -1
  52. package/build/color-picker/use-deprecated-props.js +9 -3
  53. package/build/color-picker/use-deprecated-props.js.map +1 -1
  54. package/build/combobox-control/index.js +7 -2
  55. package/build/combobox-control/index.js.map +1 -1
  56. package/build/combobox-control/types.js.map +1 -1
  57. package/build/context/context-connect.js +6 -2
  58. package/build/context/context-connect.js.map +1 -1
  59. package/build/custom-gradient-picker/gradient-bar/control-points.js +3 -3
  60. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  61. package/build/custom-gradient-picker/gradient-bar/index.js +2 -2
  62. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  63. package/build/custom-gradient-picker/index.js.map +1 -1
  64. package/build/custom-select-control/index.js +3 -3
  65. package/build/custom-select-control/index.js.map +1 -1
  66. package/build/custom-select-control-v2/legacy-component/index.js +3 -1
  67. package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
  68. package/build/dimension-control/index.js +2 -2
  69. package/build/dimension-control/index.js.map +1 -1
  70. package/build/drop-zone/index.js +74 -66
  71. package/build/drop-zone/index.js.map +1 -1
  72. package/build/dropdown/index.js +2 -2
  73. package/build/dropdown/index.js.map +1 -1
  74. package/build/dropdown/styles.js +5 -3
  75. package/build/dropdown/styles.js.map +1 -1
  76. package/build/dropdown-menu/index.js +5 -5
  77. package/build/dropdown-menu/index.js.map +1 -1
  78. package/build/dropdown-menu/index.native.js +4 -4
  79. package/build/dropdown-menu/index.native.js.map +1 -1
  80. package/build/duotone-picker/utils.js +3 -1
  81. package/build/duotone-picker/utils.js.map +1 -1
  82. package/build/elevation/hook.js +5 -6
  83. package/build/elevation/hook.js.map +1 -1
  84. package/build/external-link/index.js +2 -2
  85. package/build/external-link/index.js.map +1 -1
  86. package/build/focal-point-picker/controls.js +3 -1
  87. package/build/focal-point-picker/controls.js.map +1 -1
  88. package/build/focal-point-picker/focal-point.js +2 -2
  89. package/build/focal-point-picker/focal-point.js.map +1 -1
  90. package/build/focal-point-picker/index.js +23 -9
  91. package/build/focal-point-picker/index.js.map +1 -1
  92. package/build/focal-point-picker/styles/focal-point-picker-style.js +12 -12
  93. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  94. package/build/focal-point-picker/tooltip/index.native.js +3 -8
  95. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  96. package/build/focal-point-picker/utils.js +3 -1
  97. package/build/focal-point-picker/utils.js.map +1 -1
  98. package/build/font-size-picker/index.js +3 -2
  99. package/build/font-size-picker/index.js.map +1 -1
  100. package/build/font-size-picker/types.js.map +1 -1
  101. package/build/form-toggle/index.js +2 -2
  102. package/build/form-toggle/index.js.map +1 -1
  103. package/build/form-token-field/index.js +3 -3
  104. package/build/form-token-field/index.js.map +1 -1
  105. package/build/form-token-field/suggestions-list.js +9 -5
  106. package/build/form-token-field/suggestions-list.js.map +1 -1
  107. package/build/form-token-field/token-input.js +2 -2
  108. package/build/form-token-field/token-input.js.map +1 -1
  109. package/build/form-token-field/token.js +2 -2
  110. package/build/form-token-field/token.js.map +1 -1
  111. package/build/guide/index.js +2 -2
  112. package/build/guide/index.js.map +1 -1
  113. package/build/input-control/index.js +3 -6
  114. package/build/input-control/index.js.map +1 -1
  115. package/build/input-control/input-field.js +3 -1
  116. package/build/input-control/input-field.js.map +1 -1
  117. package/build/input-control/label.js +3 -1
  118. package/build/input-control/label.js.map +1 -1
  119. package/build/input-control/styles/input-control-styles.js +31 -23
  120. package/build/input-control/styles/input-control-styles.js.map +1 -1
  121. package/build/input-control/utils.js +8 -4
  122. package/build/input-control/utils.js.map +1 -1
  123. package/build/item-group/item/hook.js +0 -4
  124. package/build/item-group/item/hook.js.map +1 -1
  125. package/build/menu-group/index.js +2 -2
  126. package/build/menu-group/index.js.map +1 -1
  127. package/build/menu-item/index.js +3 -3
  128. package/build/menu-item/index.js.map +1 -1
  129. package/build/mobile/color-settings/utils.native.js +1 -1
  130. package/build/mobile/color-settings/utils.native.js.map +1 -1
  131. package/build/mobile/gradient/index.native.js +3 -1
  132. package/build/mobile/gradient/index.native.js.map +1 -1
  133. package/build/mobile/keyboard-aware-flat-list/index.android.js +9 -3
  134. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  135. package/build/mobile/keyboard-aware-flat-list/index.ios.js +15 -13
  136. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  137. package/build/mobile/keyboard-aware-flat-list/shared.native.js +33 -0
  138. package/build/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
  139. package/build/modal/aria-helper.js +9 -3
  140. package/build/modal/aria-helper.js.map +1 -1
  141. package/build/modal/index.js +10 -6
  142. package/build/modal/index.js.map +1 -1
  143. package/build/navigation/back-button/index.js +2 -2
  144. package/build/navigation/back-button/index.js.map +1 -1
  145. package/build/navigation/group/index.js +2 -2
  146. package/build/navigation/group/index.js.map +1 -1
  147. package/build/navigation/index.js +3 -3
  148. package/build/navigation/index.js.map +1 -1
  149. package/build/navigation/item/base.js +2 -2
  150. package/build/navigation/item/base.js.map +1 -1
  151. package/build/navigation/item/index.js +2 -2
  152. package/build/navigation/item/index.js.map +1 -1
  153. package/build/navigation/menu/index.js +2 -2
  154. package/build/navigation/menu/index.js.map +1 -1
  155. package/build/navigation/styles/navigation-styles.js +12 -12
  156. package/build/navigation/styles/navigation-styles.js.map +1 -1
  157. package/build/notice/index.js +3 -3
  158. package/build/notice/index.js.map +1 -1
  159. package/build/notice/list.js +2 -2
  160. package/build/notice/list.js.map +1 -1
  161. package/build/number-control/index.js +2 -2
  162. package/build/number-control/index.js.map +1 -1
  163. package/build/palette-edit/index.js +5 -5
  164. package/build/palette-edit/index.js.map +1 -1
  165. package/build/palette-edit/styles.js +14 -15
  166. package/build/palette-edit/styles.js.map +1 -1
  167. package/build/panel/body.js +5 -3
  168. package/build/panel/body.js.map +1 -1
  169. package/build/panel/index.js +2 -2
  170. package/build/panel/index.js.map +1 -1
  171. package/build/panel/row.js +2 -2
  172. package/build/panel/row.js.map +1 -1
  173. package/build/placeholder/index.js +3 -3
  174. package/build/placeholder/index.js.map +1 -1
  175. package/build/popover/index.js +5 -3
  176. package/build/popover/index.js.map +1 -1
  177. package/build/popover/overlay-middlewares.js +3 -1
  178. package/build/popover/overlay-middlewares.js.map +1 -1
  179. package/build/query-controls/author-select.js +3 -1
  180. package/build/query-controls/author-select.js.map +1 -1
  181. package/build/radio-control/index.js +2 -2
  182. package/build/radio-control/index.js.map +1 -1
  183. package/build/range-control/index.js +3 -3
  184. package/build/range-control/index.js.map +1 -1
  185. package/build/range-control/mark.js +3 -3
  186. package/build/range-control/mark.js.map +1 -1
  187. package/build/range-control/rail.js +1 -1
  188. package/build/range-control/rail.js.map +1 -1
  189. package/build/range-control/styles/range-control-styles.js +29 -29
  190. package/build/range-control/styles/range-control-styles.js.map +1 -1
  191. package/build/range-control/tooltip.js +2 -2
  192. package/build/range-control/tooltip.js.map +1 -1
  193. package/build/resizable-box/index.js +10 -10
  194. package/build/resizable-box/index.js.map +1 -1
  195. package/build/resizable-box/resize-tooltip/index.js +5 -3
  196. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  197. package/build/resizable-box/resize-tooltip/label.js +3 -1
  198. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  199. package/build/resizable-box/resize-tooltip/utils.js +12 -4
  200. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  201. package/build/responsive-wrapper/index.js +2 -2
  202. package/build/responsive-wrapper/index.js.map +1 -1
  203. package/build/search-control/index.js +2 -2
  204. package/build/search-control/index.js.map +1 -1
  205. package/build/select-control/index.js +5 -3
  206. package/build/select-control/index.js.map +1 -1
  207. package/build/select-control/styles/select-control-styles.js +8 -6
  208. package/build/select-control/styles/select-control-styles.js.map +1 -1
  209. package/build/slot-fill/bubbles-virtually/slot-fill-context.js +3 -3
  210. package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  211. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +3 -3
  212. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  213. package/build/slot-fill/bubbles-virtually/use-slot-fills.js +2 -2
  214. package/build/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  215. package/build/slot-fill/bubbles-virtually/use-slot.js +2 -2
  216. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  217. package/build/slot-fill/types.js.map +1 -1
  218. package/build/snackbar/index.js +3 -3
  219. package/build/snackbar/index.js.map +1 -1
  220. package/build/snackbar/list.js +2 -2
  221. package/build/snackbar/list.js.map +1 -1
  222. package/build/spinner/index.js +2 -2
  223. package/build/spinner/index.js.map +1 -1
  224. package/build/tab-panel/index.js +2 -2
  225. package/build/tab-panel/index.js.map +1 -1
  226. package/build/text/get-line-height.js +6 -2
  227. package/build/text/get-line-height.js.map +1 -1
  228. package/build/text/utils.js +6 -2
  229. package/build/text/utils.js.map +1 -1
  230. package/build/text-control/index.js +2 -2
  231. package/build/text-control/index.js.map +1 -1
  232. package/build/theme/color-algorithms.js +6 -2
  233. package/build/theme/color-algorithms.js.map +1 -1
  234. package/build/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
  235. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  236. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
  237. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  238. package/build/toolbar/toolbar/index.js +2 -2
  239. package/build/toolbar/toolbar/index.js.map +1 -1
  240. package/build/toolbar/toolbar-button/index.js +3 -3
  241. package/build/toolbar/toolbar-button/index.js.map +1 -1
  242. package/build/toolbar/toolbar-group/index.js +2 -2
  243. package/build/toolbar/toolbar-group/index.js.map +1 -1
  244. package/build/tools-panel/tools-panel/hook.js +5 -6
  245. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  246. package/build/tools-panel/tools-panel-item/hook.js +6 -8
  247. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  248. package/build/tools-panel/types.js.map +1 -1
  249. package/build/tree-grid/roving-tab-index-item.js +3 -1
  250. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  251. package/build/truncate/hook.js +1 -1
  252. package/build/truncate/hook.js.map +1 -1
  253. package/build/unit-control/index.js +5 -3
  254. package/build/unit-control/index.js.map +1 -1
  255. package/build/unit-control/unit-select-control.js +2 -2
  256. package/build/unit-control/unit-select-control.js.map +1 -1
  257. package/build/utils/colors.js +21 -7
  258. package/build/utils/colors.js.map +1 -1
  259. package/build/utils/font-size.js +3 -1
  260. package/build/utils/font-size.js.map +1 -1
  261. package/build/utils/get-valid-children.js +3 -1
  262. package/build/utils/get-valid-children.js.map +1 -1
  263. package/build/utils/input/base.js +2 -3
  264. package/build/utils/input/base.js.map +1 -1
  265. package/build/utils/strings.js +11 -57
  266. package/build/utils/strings.js.map +1 -1
  267. package/build/utils/use-responsive-value.js +3 -1
  268. package/build/utils/use-responsive-value.js.map +1 -1
  269. package/build/view/component.js +26 -8
  270. package/build/view/component.js.map +1 -1
  271. package/build-module/alignment-matrix-control/icon.js +2 -2
  272. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  273. package/build-module/alignment-matrix-control/index.js +5 -3
  274. package/build-module/alignment-matrix-control/index.js.map +1 -1
  275. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  276. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  277. package/build-module/alignment-matrix-control/utils.js +6 -2
  278. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  279. package/build-module/angle-picker-control/index.js +2 -2
  280. package/build-module/angle-picker-control/index.js.map +1 -1
  281. package/build-module/animate/index.js +4 -4
  282. package/build-module/animate/index.js.map +1 -1
  283. package/build-module/autocomplete/autocompleter-ui.js +5 -3
  284. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  285. package/build-module/autocomplete/index.js +21 -7
  286. package/build-module/autocomplete/index.js.map +1 -1
  287. package/build-module/base-control/hooks.js +1 -4
  288. package/build-module/base-control/hooks.js.map +1 -1
  289. package/build-module/base-control/index.js +2 -2
  290. package/build-module/base-control/index.js.map +1 -1
  291. package/build-module/base-control/types.js.map +1 -1
  292. package/build-module/border-control/types.js.map +1 -1
  293. package/build-module/button/index.js +2 -2
  294. package/build-module/button/index.js.map +1 -1
  295. package/build-module/button-group/index.js +2 -2
  296. package/build-module/button-group/index.js.map +1 -1
  297. package/build-module/checkbox-control/index.js +11 -4
  298. package/build-module/checkbox-control/index.js.map +1 -1
  299. package/build-module/circular-option-picker/circular-option-picker-actions.js +3 -3
  300. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  301. package/build-module/circular-option-picker/circular-option-picker-option-group.js +2 -2
  302. package/build-module/circular-option-picker/circular-option-picker-option-group.js.map +1 -1
  303. package/build-module/circular-option-picker/circular-option-picker-option.js +2 -2
  304. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  305. package/build-module/circular-option-picker/circular-option-picker.js +2 -2
  306. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  307. package/build-module/clipboard-button/index.js +2 -2
  308. package/build-module/clipboard-button/index.js.map +1 -1
  309. package/build-module/color-indicator/index.js +2 -2
  310. package/build-module/color-indicator/index.js.map +1 -1
  311. package/build-module/color-palette/index.js +2 -2
  312. package/build-module/color-palette/index.js.map +1 -1
  313. package/build-module/color-picker/hex-input.js +3 -1
  314. package/build-module/color-picker/hex-input.js.map +1 -1
  315. package/build-module/color-picker/hue-picker.native.js +6 -2
  316. package/build-module/color-picker/hue-picker.native.js.map +1 -1
  317. package/build-module/color-picker/index.native.js +9 -3
  318. package/build-module/color-picker/index.native.js.map +1 -1
  319. package/build-module/color-picker/saturation-picker.native.js +6 -2
  320. package/build-module/color-picker/saturation-picker.native.js.map +1 -1
  321. package/build-module/color-picker/use-deprecated-props.js +9 -3
  322. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  323. package/build-module/combobox-control/index.js +7 -2
  324. package/build-module/combobox-control/index.js.map +1 -1
  325. package/build-module/combobox-control/types.js.map +1 -1
  326. package/build-module/context/context-connect.js +6 -2
  327. package/build-module/context/context-connect.js.map +1 -1
  328. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +3 -3
  329. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  330. package/build-module/custom-gradient-picker/gradient-bar/index.js +2 -2
  331. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  332. package/build-module/custom-gradient-picker/index.js.map +1 -1
  333. package/build-module/custom-select-control/index.js +3 -3
  334. package/build-module/custom-select-control/index.js.map +1 -1
  335. package/build-module/custom-select-control-v2/legacy-component/index.js +3 -1
  336. package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
  337. package/build-module/dimension-control/index.js +2 -2
  338. package/build-module/dimension-control/index.js.map +1 -1
  339. package/build-module/drop-zone/index.js +74 -66
  340. package/build-module/drop-zone/index.js.map +1 -1
  341. package/build-module/dropdown/index.js +2 -2
  342. package/build-module/dropdown/index.js.map +1 -1
  343. package/build-module/dropdown/styles.js +5 -3
  344. package/build-module/dropdown/styles.js.map +1 -1
  345. package/build-module/dropdown-menu/index.js +5 -5
  346. package/build-module/dropdown-menu/index.js.map +1 -1
  347. package/build-module/dropdown-menu/index.native.js +4 -4
  348. package/build-module/dropdown-menu/index.native.js.map +1 -1
  349. package/build-module/duotone-picker/utils.js +3 -1
  350. package/build-module/duotone-picker/utils.js.map +1 -1
  351. package/build-module/elevation/hook.js +6 -7
  352. package/build-module/elevation/hook.js.map +1 -1
  353. package/build-module/external-link/index.js +2 -2
  354. package/build-module/external-link/index.js.map +1 -1
  355. package/build-module/focal-point-picker/controls.js +3 -1
  356. package/build-module/focal-point-picker/controls.js.map +1 -1
  357. package/build-module/focal-point-picker/focal-point.js +2 -2
  358. package/build-module/focal-point-picker/focal-point.js.map +1 -1
  359. package/build-module/focal-point-picker/index.js +23 -9
  360. package/build-module/focal-point-picker/index.js.map +1 -1
  361. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +13 -13
  362. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  363. package/build-module/focal-point-picker/tooltip/index.native.js +3 -8
  364. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  365. package/build-module/focal-point-picker/utils.js +3 -1
  366. package/build-module/focal-point-picker/utils.js.map +1 -1
  367. package/build-module/font-size-picker/index.js +3 -2
  368. package/build-module/font-size-picker/index.js.map +1 -1
  369. package/build-module/font-size-picker/types.js.map +1 -1
  370. package/build-module/form-toggle/index.js +2 -2
  371. package/build-module/form-toggle/index.js.map +1 -1
  372. package/build-module/form-token-field/index.js +3 -3
  373. package/build-module/form-token-field/index.js.map +1 -1
  374. package/build-module/form-token-field/suggestions-list.js +9 -5
  375. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  376. package/build-module/form-token-field/token-input.js +2 -2
  377. package/build-module/form-token-field/token-input.js.map +1 -1
  378. package/build-module/form-token-field/token.js +2 -2
  379. package/build-module/form-token-field/token.js.map +1 -1
  380. package/build-module/guide/index.js +2 -2
  381. package/build-module/guide/index.js.map +1 -1
  382. package/build-module/input-control/index.js +3 -6
  383. package/build-module/input-control/index.js.map +1 -1
  384. package/build-module/input-control/input-field.js +3 -1
  385. package/build-module/input-control/input-field.js.map +1 -1
  386. package/build-module/input-control/label.js +3 -1
  387. package/build-module/input-control/label.js.map +1 -1
  388. package/build-module/input-control/styles/input-control-styles.js +31 -23
  389. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  390. package/build-module/input-control/utils.js +8 -4
  391. package/build-module/input-control/utils.js.map +1 -1
  392. package/build-module/item-group/item/hook.js +0 -4
  393. package/build-module/item-group/item/hook.js.map +1 -1
  394. package/build-module/menu-group/index.js +2 -2
  395. package/build-module/menu-group/index.js.map +1 -1
  396. package/build-module/menu-item/index.js +3 -3
  397. package/build-module/menu-item/index.js.map +1 -1
  398. package/build-module/mobile/color-settings/utils.native.js +1 -1
  399. package/build-module/mobile/color-settings/utils.native.js.map +1 -1
  400. package/build-module/mobile/gradient/index.native.js +3 -1
  401. package/build-module/mobile/gradient/index.native.js.map +1 -1
  402. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +9 -3
  403. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  404. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +16 -15
  405. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  406. package/build-module/mobile/keyboard-aware-flat-list/shared.native.js +27 -0
  407. package/build-module/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
  408. package/build-module/modal/aria-helper.js +9 -3
  409. package/build-module/modal/aria-helper.js.map +1 -1
  410. package/build-module/modal/index.js +10 -6
  411. package/build-module/modal/index.js.map +1 -1
  412. package/build-module/navigation/back-button/index.js +2 -2
  413. package/build-module/navigation/back-button/index.js.map +1 -1
  414. package/build-module/navigation/group/index.js +2 -2
  415. package/build-module/navigation/group/index.js.map +1 -1
  416. package/build-module/navigation/index.js +3 -3
  417. package/build-module/navigation/index.js.map +1 -1
  418. package/build-module/navigation/item/base.js +2 -2
  419. package/build-module/navigation/item/base.js.map +1 -1
  420. package/build-module/navigation/item/index.js +2 -2
  421. package/build-module/navigation/item/index.js.map +1 -1
  422. package/build-module/navigation/menu/index.js +2 -2
  423. package/build-module/navigation/menu/index.js.map +1 -1
  424. package/build-module/navigation/styles/navigation-styles.js +13 -13
  425. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  426. package/build-module/notice/index.js +3 -3
  427. package/build-module/notice/index.js.map +1 -1
  428. package/build-module/notice/list.js +2 -2
  429. package/build-module/notice/list.js.map +1 -1
  430. package/build-module/number-control/index.js +2 -2
  431. package/build-module/number-control/index.js.map +1 -1
  432. package/build-module/palette-edit/index.js +6 -6
  433. package/build-module/palette-edit/index.js.map +1 -1
  434. package/build-module/palette-edit/styles.js +13 -14
  435. package/build-module/palette-edit/styles.js.map +1 -1
  436. package/build-module/panel/body.js +5 -3
  437. package/build-module/panel/body.js.map +1 -1
  438. package/build-module/panel/index.js +2 -2
  439. package/build-module/panel/index.js.map +1 -1
  440. package/build-module/panel/row.js +2 -2
  441. package/build-module/panel/row.js.map +1 -1
  442. package/build-module/placeholder/index.js +3 -3
  443. package/build-module/placeholder/index.js.map +1 -1
  444. package/build-module/popover/index.js +5 -3
  445. package/build-module/popover/index.js.map +1 -1
  446. package/build-module/popover/overlay-middlewares.js +3 -1
  447. package/build-module/popover/overlay-middlewares.js.map +1 -1
  448. package/build-module/query-controls/author-select.js +3 -1
  449. package/build-module/query-controls/author-select.js.map +1 -1
  450. package/build-module/radio-control/index.js +2 -2
  451. package/build-module/radio-control/index.js.map +1 -1
  452. package/build-module/range-control/index.js +3 -3
  453. package/build-module/range-control/index.js.map +1 -1
  454. package/build-module/range-control/mark.js +3 -3
  455. package/build-module/range-control/mark.js.map +1 -1
  456. package/build-module/range-control/rail.js +1 -1
  457. package/build-module/range-control/rail.js.map +1 -1
  458. package/build-module/range-control/styles/range-control-styles.js +30 -30
  459. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  460. package/build-module/range-control/tooltip.js +2 -2
  461. package/build-module/range-control/tooltip.js.map +1 -1
  462. package/build-module/resizable-box/index.js +10 -10
  463. package/build-module/resizable-box/index.js.map +1 -1
  464. package/build-module/resizable-box/resize-tooltip/index.js +5 -3
  465. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  466. package/build-module/resizable-box/resize-tooltip/label.js +3 -1
  467. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  468. package/build-module/resizable-box/resize-tooltip/utils.js +12 -4
  469. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  470. package/build-module/responsive-wrapper/index.js +2 -2
  471. package/build-module/responsive-wrapper/index.js.map +1 -1
  472. package/build-module/search-control/index.js +2 -2
  473. package/build-module/search-control/index.js.map +1 -1
  474. package/build-module/select-control/index.js +5 -3
  475. package/build-module/select-control/index.js.map +1 -1
  476. package/build-module/select-control/styles/select-control-styles.js +8 -6
  477. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  478. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +2 -1
  479. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  480. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  481. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  482. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
  483. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  484. package/build-module/slot-fill/bubbles-virtually/use-slot.js +1 -1
  485. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  486. package/build-module/slot-fill/types.js.map +1 -1
  487. package/build-module/snackbar/index.js +3 -3
  488. package/build-module/snackbar/index.js.map +1 -1
  489. package/build-module/snackbar/list.js +2 -2
  490. package/build-module/snackbar/list.js.map +1 -1
  491. package/build-module/spinner/index.js +2 -2
  492. package/build-module/spinner/index.js.map +1 -1
  493. package/build-module/tab-panel/index.js +2 -2
  494. package/build-module/tab-panel/index.js.map +1 -1
  495. package/build-module/text/get-line-height.js +6 -2
  496. package/build-module/text/get-line-height.js.map +1 -1
  497. package/build-module/text/utils.js +6 -2
  498. package/build-module/text/utils.js.map +1 -1
  499. package/build-module/text-control/index.js +2 -2
  500. package/build-module/text-control/index.js.map +1 -1
  501. package/build-module/theme/color-algorithms.js +6 -2
  502. package/build-module/theme/color-algorithms.js.map +1 -1
  503. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
  504. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  505. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +10 -10
  506. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  507. package/build-module/toolbar/toolbar/index.js +2 -2
  508. package/build-module/toolbar/toolbar/index.js.map +1 -1
  509. package/build-module/toolbar/toolbar-button/index.js +3 -3
  510. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  511. package/build-module/toolbar/toolbar-group/index.js +2 -2
  512. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  513. package/build-module/tools-panel/tools-panel/hook.js +5 -6
  514. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  515. package/build-module/tools-panel/tools-panel-item/hook.js +6 -8
  516. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  517. package/build-module/tools-panel/types.js.map +1 -1
  518. package/build-module/tree-grid/roving-tab-index-item.js +3 -1
  519. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  520. package/build-module/truncate/hook.js +1 -1
  521. package/build-module/truncate/hook.js.map +1 -1
  522. package/build-module/unit-control/index.js +5 -3
  523. package/build-module/unit-control/index.js.map +1 -1
  524. package/build-module/unit-control/unit-select-control.js +2 -2
  525. package/build-module/unit-control/unit-select-control.js.map +1 -1
  526. package/build-module/utils/colors.js +21 -7
  527. package/build-module/utils/colors.js.map +1 -1
  528. package/build-module/utils/font-size.js +3 -1
  529. package/build-module/utils/font-size.js.map +1 -1
  530. package/build-module/utils/get-valid-children.js +3 -1
  531. package/build-module/utils/get-valid-children.js.map +1 -1
  532. package/build-module/utils/input/base.js +2 -3
  533. package/build-module/utils/input/base.js.map +1 -1
  534. package/build-module/utils/strings.js +12 -57
  535. package/build-module/utils/strings.js.map +1 -1
  536. package/build-module/utils/use-responsive-value.js +3 -1
  537. package/build-module/utils/use-responsive-value.js.map +1 -1
  538. package/build-module/view/component.js +26 -8
  539. package/build-module/view/component.js.map +1 -1
  540. package/build-style/style-rtl.css +56 -55
  541. package/build-style/style.css +56 -55
  542. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  543. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  544. package/build-types/alignment-matrix-control/icon.d.ts +1 -1
  545. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  546. package/build-types/alignment-matrix-control/index.d.ts +1 -1
  547. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  548. package/build-types/alignment-matrix-control/stories/index.story.d.ts +2 -2
  549. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  550. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +4 -4
  551. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts +4 -4
  552. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -1
  553. package/build-types/alignment-matrix-control/utils.d.ts.map +1 -1
  554. package/build-types/angle-picker-control/angle-circle.d.ts +1 -1
  555. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  556. package/build-types/angle-picker-control/index.d.ts +1 -1
  557. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  558. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +4 -4
  559. package/build-types/animate/index.d.ts.map +1 -1
  560. package/build-types/autocomplete/autocompleter-ui.d.ts +1 -1
  561. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  562. package/build-types/autocomplete/index.d.ts +3 -3
  563. package/build-types/autocomplete/index.d.ts.map +1 -1
  564. package/build-types/base-control/hooks.d.ts +1 -0
  565. package/build-types/base-control/hooks.d.ts.map +1 -1
  566. package/build-types/base-control/index.d.ts +2 -2
  567. package/build-types/base-control/index.d.ts.map +1 -1
  568. package/build-types/base-control/styles/base-control-styles.d.ts +5 -5
  569. package/build-types/base-control/types.d.ts +1 -2
  570. package/build-types/base-control/types.d.ts.map +1 -1
  571. package/build-types/border-box-control/border-box-control/hook.d.ts +69 -59
  572. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  573. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +70 -61
  574. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  575. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +69 -59
  576. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  577. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +69 -59
  578. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  579. package/build-types/border-box-control/stories/index.story.d.ts +1 -1
  580. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  581. package/build-types/border-control/border-control/component.d.ts +1 -0
  582. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  583. package/build-types/border-control/border-control/hook.d.ts +70 -59
  584. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  585. package/build-types/border-control/border-control-dropdown/hook.d.ts +69 -59
  586. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  587. package/build-types/border-control/border-control-style-picker/component.d.ts +1 -1
  588. package/build-types/border-control/stories/index.story.d.ts +12 -6
  589. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  590. package/build-types/border-control/types.d.ts +4 -0
  591. package/build-types/border-control/types.d.ts.map +1 -1
  592. package/build-types/box-control/all-input-control.d.ts +1 -1
  593. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  594. package/build-types/box-control/axial-input-controls.d.ts +1 -1
  595. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  596. package/build-types/box-control/icon.d.ts +1 -1
  597. package/build-types/box-control/icon.d.ts.map +1 -1
  598. package/build-types/box-control/index.d.ts +1 -1
  599. package/build-types/box-control/index.d.ts.map +1 -1
  600. package/build-types/box-control/input-controls.d.ts +1 -1
  601. package/build-types/box-control/input-controls.d.ts.map +1 -1
  602. package/build-types/box-control/linked-button.d.ts +1 -1
  603. package/build-types/box-control/linked-button.d.ts.map +1 -1
  604. package/build-types/box-control/stories/index.story.d.ts +439 -390
  605. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  606. package/build-types/box-control/styles/box-control-icon-styles.d.ts +6 -6
  607. package/build-types/box-control/styles/box-control-styles.d.ts +5 -5
  608. package/build-types/button/deprecated.d.ts +5 -51
  609. package/build-types/button/deprecated.d.ts.map +1 -1
  610. package/build-types/button/index.d.ts +1 -1
  611. package/build-types/button/index.d.ts.map +1 -1
  612. package/build-types/button/stories/index.story.d.ts +1 -1
  613. package/build-types/button/stories/index.story.d.ts.map +1 -1
  614. package/build-types/button-group/index.d.ts +1 -1
  615. package/build-types/button-group/index.d.ts.map +1 -1
  616. package/build-types/card/card/hook.d.ts +69 -59
  617. package/build-types/card/card/hook.d.ts.map +1 -1
  618. package/build-types/card/card-body/hook.d.ts +69 -59
  619. package/build-types/card/card-body/hook.d.ts.map +1 -1
  620. package/build-types/card/card-divider/hook.d.ts +69 -59
  621. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  622. package/build-types/card/card-footer/hook.d.ts +69 -59
  623. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  624. package/build-types/card/card-header/hook.d.ts +69 -59
  625. package/build-types/card/card-header/hook.d.ts.map +1 -1
  626. package/build-types/card/card-media/hook.d.ts +69 -59
  627. package/build-types/card/card-media/hook.d.ts.map +1 -1
  628. package/build-types/card/stories/index.story.d.ts +2 -2
  629. package/build-types/checkbox-control/index.d.ts +1 -1
  630. package/build-types/checkbox-control/index.d.ts.map +1 -1
  631. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts +2 -2
  632. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  633. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts +1 -1
  634. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts.map +1 -1
  635. package/build-types/circular-option-picker/circular-option-picker-option.d.ts +1 -1
  636. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  637. package/build-types/circular-option-picker/circular-option-picker.d.ts +1 -1
  638. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  639. package/build-types/clipboard-button/index.d.ts +1 -1
  640. package/build-types/clipboard-button/index.d.ts.map +1 -1
  641. package/build-types/color-indicator/index.d.ts +1 -1
  642. package/build-types/color-indicator/index.d.ts.map +1 -1
  643. package/build-types/color-palette/index.d.ts +1 -1
  644. package/build-types/color-palette/index.d.ts.map +1 -1
  645. package/build-types/color-palette/styles.d.ts +1 -1
  646. package/build-types/color-picker/color-copy-button.d.ts +1 -1
  647. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  648. package/build-types/color-picker/color-input.d.ts +1 -1
  649. package/build-types/color-picker/color-input.d.ts.map +1 -1
  650. package/build-types/color-picker/component.d.ts +2 -2
  651. package/build-types/color-picker/component.d.ts.map +1 -1
  652. package/build-types/color-picker/hex-input.d.ts +1 -1
  653. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  654. package/build-types/color-picker/hsl-input.d.ts +1 -1
  655. package/build-types/color-picker/hsl-input.d.ts.map +1 -1
  656. package/build-types/color-picker/input-with-slider.d.ts +1 -1
  657. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  658. package/build-types/color-picker/legacy-adapter.d.ts +1 -1
  659. package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
  660. package/build-types/color-picker/picker.d.ts +1 -1
  661. package/build-types/color-picker/picker.d.ts.map +1 -1
  662. package/build-types/color-picker/rgb-input.d.ts +1 -1
  663. package/build-types/color-picker/rgb-input.d.ts.map +1 -1
  664. package/build-types/color-picker/stories/index.story.d.ts +1 -1
  665. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  666. package/build-types/color-picker/styles.d.ts +6 -6
  667. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
  668. package/build-types/combobox-control/index.d.ts +3 -1
  669. package/build-types/combobox-control/index.d.ts.map +1 -1
  670. package/build-types/combobox-control/stories/index.story.d.ts +22 -2
  671. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  672. package/build-types/combobox-control/styles.d.ts +1 -1
  673. package/build-types/combobox-control/types.d.ts +1 -0
  674. package/build-types/combobox-control/types.d.ts.map +1 -1
  675. package/build-types/composite/current/stories/utils.d.ts +1 -1
  676. package/build-types/composite/current/stories/utils.d.ts.map +1 -1
  677. package/build-types/composite/legacy/stories/utils.d.ts +1 -1
  678. package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
  679. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  680. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  681. package/build-types/context/context-connect.d.ts.map +1 -1
  682. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +2 -2
  683. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  684. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +1 -1
  685. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
  686. package/build-types/custom-gradient-picker/index.d.ts +1 -1
  687. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  688. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +2 -2
  689. package/build-types/custom-select-control/index.d.ts +2 -2
  690. package/build-types/custom-select-control/index.d.ts.map +1 -1
  691. package/build-types/custom-select-control-v2/custom-select.d.ts +1 -1
  692. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  693. package/build-types/custom-select-control-v2/default-component/index.d.ts +1 -1
  694. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
  695. package/build-types/custom-select-control-v2/item.d.ts +1 -1
  696. package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
  697. package/build-types/custom-select-control-v2/legacy-component/index.d.ts +1 -1
  698. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  699. package/build-types/custom-select-control-v2/stories/default.story.d.ts +3 -3
  700. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
  701. package/build-types/custom-select-control-v2/styles.d.ts +8 -8
  702. package/build-types/dashicon/index.d.ts +1 -1
  703. package/build-types/dashicon/index.d.ts.map +1 -1
  704. package/build-types/date-time/date/index.d.ts +1 -1
  705. package/build-types/date-time/date/index.d.ts.map +1 -1
  706. package/build-types/date-time/date/styles.d.ts +5 -5
  707. package/build-types/date-time/date-time/styles.d.ts +1 -1
  708. package/build-types/date-time/time/index.d.ts +1 -1
  709. package/build-types/date-time/time/index.d.ts.map +1 -1
  710. package/build-types/date-time/time/styles.d.ts +10 -10
  711. package/build-types/date-time/time/timezone.d.ts +1 -1
  712. package/build-types/date-time/time/timezone.d.ts.map +1 -1
  713. package/build-types/dimension-control/index.d.ts +1 -1
  714. package/build-types/dimension-control/index.d.ts.map +1 -1
  715. package/build-types/disabled/index.d.ts +1 -1
  716. package/build-types/disabled/index.d.ts.map +1 -1
  717. package/build-types/disclosure/index.d.ts +1 -1
  718. package/build-types/disclosure/index.d.ts.map +1 -1
  719. package/build-types/divider/styles.d.ts +1 -1
  720. package/build-types/draggable/index.d.ts +1 -1
  721. package/build-types/draggable/index.d.ts.map +1 -1
  722. package/build-types/drop-zone/index.d.ts +1 -1
  723. package/build-types/drop-zone/index.d.ts.map +1 -1
  724. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  725. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  726. package/build-types/dropdown/index.d.ts +1 -1
  727. package/build-types/dropdown/index.d.ts.map +1 -1
  728. package/build-types/dropdown/stories/index.story.d.ts +4 -4
  729. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  730. package/build-types/dropdown/styles.d.ts +1 -1
  731. package/build-types/dropdown/styles.d.ts.map +1 -1
  732. package/build-types/dropdown-menu/index.d.ts +1 -1
  733. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  734. package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
  735. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  736. package/build-types/dropdown-menu-v2/index.d.ts +7 -7
  737. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  738. package/build-types/dropdown-menu-v2/styles.d.ts +12 -12
  739. package/build-types/duotone-picker/color-list-picker/index.d.ts +1 -1
  740. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  741. package/build-types/duotone-picker/custom-duotone-bar.d.ts +1 -1
  742. package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -1
  743. package/build-types/duotone-picker/duotone-picker.d.ts +1 -1
  744. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  745. package/build-types/duotone-picker/duotone-swatch.d.ts +1 -1
  746. package/build-types/duotone-picker/duotone-swatch.d.ts.map +1 -1
  747. package/build-types/duotone-picker/utils.d.ts.map +1 -1
  748. package/build-types/elevation/hook.d.ts +68 -58
  749. package/build-types/elevation/hook.d.ts.map +1 -1
  750. package/build-types/flex/flex/hook.d.ts +69 -59
  751. package/build-types/flex/flex/hook.d.ts.map +1 -1
  752. package/build-types/flex/flex-block/hook.d.ts +69 -59
  753. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  754. package/build-types/flex/flex-item/hook.d.ts +69 -59
  755. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  756. package/build-types/focal-point-picker/controls.d.ts +1 -1
  757. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  758. package/build-types/focal-point-picker/focal-point.d.ts +1 -1
  759. package/build-types/focal-point-picker/focal-point.d.ts.map +1 -1
  760. package/build-types/focal-point-picker/grid.d.ts +1 -1
  761. package/build-types/focal-point-picker/grid.d.ts.map +1 -1
  762. package/build-types/focal-point-picker/index.d.ts +1 -1
  763. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  764. package/build-types/focal-point-picker/media.d.ts +1 -1
  765. package/build-types/focal-point-picker/media.d.ts.map +1 -1
  766. package/build-types/focal-point-picker/stories/index.story.d.ts +8 -8
  767. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  768. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +9 -9
  769. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  770. package/build-types/focal-point-picker/styles/focal-point-style.d.ts +1 -1
  771. package/build-types/focal-point-picker/test/index.d.ts +2 -0
  772. package/build-types/focal-point-picker/test/index.d.ts.map +1 -0
  773. package/build-types/focal-point-picker/test/media.d.ts +2 -0
  774. package/build-types/focal-point-picker/test/media.d.ts.map +1 -0
  775. package/build-types/focal-point-picker/utils.d.ts.map +1 -1
  776. package/build-types/focusable-iframe/index.d.ts +1 -1
  777. package/build-types/focusable-iframe/index.d.ts.map +1 -1
  778. package/build-types/font-size-picker/font-size-picker-select.d.ts +1 -1
  779. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  780. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts +1 -1
  781. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  782. package/build-types/font-size-picker/index.d.ts.map +1 -1
  783. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  784. package/build-types/font-size-picker/styles.d.ts +4 -4
  785. package/build-types/font-size-picker/types.d.ts +2 -0
  786. package/build-types/font-size-picker/types.d.ts.map +1 -1
  787. package/build-types/form-file-upload/index.d.ts +1 -1
  788. package/build-types/form-file-upload/index.d.ts.map +1 -1
  789. package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
  790. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  791. package/build-types/form-toggle/index.d.ts +2 -2
  792. package/build-types/form-toggle/index.d.ts.map +1 -1
  793. package/build-types/form-token-field/index.d.ts +1 -1
  794. package/build-types/form-token-field/index.d.ts.map +1 -1
  795. package/build-types/form-token-field/styles.d.ts +1 -1
  796. package/build-types/form-token-field/suggestions-list.d.ts +2 -1
  797. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  798. package/build-types/form-token-field/token-input.d.ts +2 -2
  799. package/build-types/form-token-field/token-input.d.ts.map +1 -1
  800. package/build-types/form-token-field/token.d.ts +1 -1
  801. package/build-types/form-token-field/token.d.ts.map +1 -1
  802. package/build-types/gradient-picker/index.d.ts +1 -1
  803. package/build-types/gradient-picker/index.d.ts.map +1 -1
  804. package/build-types/grid/hook.d.ts +69 -59
  805. package/build-types/grid/hook.d.ts.map +1 -1
  806. package/build-types/guide/icons.d.ts +1 -1
  807. package/build-types/guide/icons.d.ts.map +1 -1
  808. package/build-types/guide/index.d.ts +1 -1
  809. package/build-types/guide/index.d.ts.map +1 -1
  810. package/build-types/guide/page-control.d.ts +1 -1
  811. package/build-types/guide/page-control.d.ts.map +1 -1
  812. package/build-types/guide/page.d.ts +1 -1
  813. package/build-types/guide/page.d.ts.map +1 -1
  814. package/build-types/h-stack/hook.d.ts +69 -59
  815. package/build-types/h-stack/hook.d.ts.map +1 -1
  816. package/build-types/heading/hook.d.ts +69 -59
  817. package/build-types/heading/hook.d.ts.map +1 -1
  818. package/build-types/higher-order/navigate-regions/index.d.ts +1 -1
  819. package/build-types/higher-order/with-constrained-tabbing/index.d.ts +1 -1
  820. package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -1
  821. package/build-types/higher-order/with-fallback-styles/index.d.ts +1 -1
  822. package/build-types/higher-order/with-filters/index.d.ts +2 -2
  823. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  824. package/build-types/higher-order/with-notices/index.d.ts +2 -2
  825. package/build-types/higher-order/with-spoken-messages/index.d.ts +1 -1
  826. package/build-types/icon/index.d.ts +1 -1
  827. package/build-types/icon/index.d.ts.map +1 -1
  828. package/build-types/input-control/backdrop.d.ts +1 -1
  829. package/build-types/input-control/backdrop.d.ts.map +1 -1
  830. package/build-types/input-control/index.d.ts +1 -1
  831. package/build-types/input-control/index.d.ts.map +1 -1
  832. package/build-types/input-control/input-base.d.ts +1 -1
  833. package/build-types/input-control/input-base.d.ts.map +1 -1
  834. package/build-types/input-control/input-field.d.ts +1 -1
  835. package/build-types/input-control/input-field.d.ts.map +1 -1
  836. package/build-types/input-control/label.d.ts +1 -1
  837. package/build-types/input-control/label.d.ts.map +1 -1
  838. package/build-types/input-control/stories/index.story.d.ts +2 -1
  839. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  840. package/build-types/input-control/styles/input-control-styles.d.ts +8 -8
  841. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  842. package/build-types/input-control/utils.d.ts.map +1 -1
  843. package/build-types/isolated-event-container/index.d.ts +1 -1
  844. package/build-types/isolated-event-container/index.d.ts.map +1 -1
  845. package/build-types/item-group/item/hook.d.ts +70 -60
  846. package/build-types/item-group/item/hook.d.ts.map +1 -1
  847. package/build-types/item-group/item-group/hook.d.ts +69 -59
  848. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  849. package/build-types/keyboard-shortcuts/index.d.ts +1 -1
  850. package/build-types/keyboard-shortcuts/index.d.ts.map +1 -1
  851. package/build-types/menu-group/index.d.ts +1 -1
  852. package/build-types/menu-group/index.d.ts.map +1 -1
  853. package/build-types/menu-item/index.d.ts +1 -1
  854. package/build-types/menu-item/index.d.ts.map +1 -1
  855. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  856. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  857. package/build-types/menu-items-choice/index.d.ts +1 -1
  858. package/build-types/menu-items-choice/index.d.ts.map +1 -1
  859. package/build-types/modal/aria-helper.d.ts.map +1 -1
  860. package/build-types/modal/index.d.ts.map +1 -1
  861. package/build-types/navigable-container/container.d.ts +1 -1
  862. package/build-types/navigable-container/menu.d.ts +2 -2
  863. package/build-types/navigable-container/menu.d.ts.map +1 -1
  864. package/build-types/navigable-container/tabbable.d.ts +2 -2
  865. package/build-types/navigable-container/tabbable.d.ts.map +1 -1
  866. package/build-types/navigation/back-button/index.d.ts.map +1 -1
  867. package/build-types/navigation/group/index.d.ts +1 -1
  868. package/build-types/navigation/group/index.d.ts.map +1 -1
  869. package/build-types/navigation/index.d.ts +1 -1
  870. package/build-types/navigation/index.d.ts.map +1 -1
  871. package/build-types/navigation/item/base-content.d.ts +1 -1
  872. package/build-types/navigation/item/base-content.d.ts.map +1 -1
  873. package/build-types/navigation/item/base.d.ts +1 -1
  874. package/build-types/navigation/item/base.d.ts.map +1 -1
  875. package/build-types/navigation/item/index.d.ts +1 -1
  876. package/build-types/navigation/item/index.d.ts.map +1 -1
  877. package/build-types/navigation/menu/index.d.ts +1 -1
  878. package/build-types/navigation/menu/index.d.ts.map +1 -1
  879. package/build-types/navigation/menu/menu-title-search.d.ts +1 -1
  880. package/build-types/navigation/menu/menu-title.d.ts +1 -1
  881. package/build-types/navigation/menu/menu-title.d.ts.map +1 -1
  882. package/build-types/navigation/menu/search-no-results-found.d.ts +1 -1
  883. package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -1
  884. package/build-types/navigation/styles/navigation-styles.d.ts +11 -11
  885. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  886. package/build-types/navigator/navigator-back-button/hook.d.ts +70 -61
  887. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  888. package/build-types/navigator/navigator-button/hook.d.ts +70 -61
  889. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  890. package/build-types/notice/index.d.ts +1 -1
  891. package/build-types/notice/index.d.ts.map +1 -1
  892. package/build-types/notice/list.d.ts +1 -1
  893. package/build-types/notice/list.d.ts.map +1 -1
  894. package/build-types/number-control/index.d.ts +1 -1
  895. package/build-types/number-control/index.d.ts.map +1 -1
  896. package/build-types/number-control/stories/index.story.d.ts +1 -1
  897. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  898. package/build-types/palette-edit/index.d.ts +1 -1
  899. package/build-types/palette-edit/index.d.ts.map +1 -1
  900. package/build-types/palette-edit/styles.d.ts +1009 -19
  901. package/build-types/palette-edit/styles.d.ts.map +1 -1
  902. package/build-types/panel/body.d.ts +1 -1
  903. package/build-types/panel/body.d.ts.map +1 -1
  904. package/build-types/panel/header.d.ts +1 -1
  905. package/build-types/panel/header.d.ts.map +1 -1
  906. package/build-types/placeholder/index.d.ts +1 -1
  907. package/build-types/placeholder/index.d.ts.map +1 -1
  908. package/build-types/popover/index.d.ts +1 -1
  909. package/build-types/popover/index.d.ts.map +1 -1
  910. package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
  911. package/build-types/popover/stories/e2e/index.story.d.ts +2 -2
  912. package/build-types/popover/stories/e2e/index.story.d.ts.map +1 -1
  913. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  914. package/build-types/popover/test/utils/index.d.ts +1 -1
  915. package/build-types/popover/test/utils/index.d.ts.map +1 -1
  916. package/build-types/progress-bar/index.d.ts +1 -1
  917. package/build-types/progress-bar/index.d.ts.map +1 -1
  918. package/build-types/progress-bar/styles.d.ts +3 -3
  919. package/build-types/query-controls/author-select.d.ts +1 -1
  920. package/build-types/query-controls/author-select.d.ts.map +1 -1
  921. package/build-types/query-controls/category-select.d.ts +1 -1
  922. package/build-types/query-controls/category-select.d.ts.map +1 -1
  923. package/build-types/query-controls/index.d.ts +1 -1
  924. package/build-types/query-controls/index.d.ts.map +1 -1
  925. package/build-types/radio-control/index.d.ts +1 -1
  926. package/build-types/radio-control/index.d.ts.map +1 -1
  927. package/build-types/radio-group/index.d.ts +1 -1
  928. package/build-types/radio-group/index.d.ts.map +1 -1
  929. package/build-types/radio-group/radio.d.ts +1 -1
  930. package/build-types/radio-group/radio.d.ts.map +1 -1
  931. package/build-types/range-control/index.d.ts +1 -1
  932. package/build-types/range-control/index.d.ts.map +1 -1
  933. package/build-types/range-control/input-range.d.ts +1 -1
  934. package/build-types/range-control/mark.d.ts +1 -1
  935. package/build-types/range-control/mark.d.ts.map +1 -1
  936. package/build-types/range-control/rail.d.ts +1 -1
  937. package/build-types/range-control/rail.d.ts.map +1 -1
  938. package/build-types/range-control/styles/range-control-styles.d.ts +15 -15
  939. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  940. package/build-types/range-control/tooltip.d.ts +1 -1
  941. package/build-types/range-control/tooltip.d.ts.map +1 -1
  942. package/build-types/resizable-box/index.d.ts +3 -3
  943. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  944. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  945. package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
  946. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  947. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +4 -4
  948. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  949. package/build-types/resizable-box/stories/index.story.d.ts +6 -6
  950. package/build-types/responsive-wrapper/index.d.ts +1 -1
  951. package/build-types/responsive-wrapper/index.d.ts.map +1 -1
  952. package/build-types/sandbox/index.d.ts +1 -1
  953. package/build-types/sandbox/index.d.ts.map +1 -1
  954. package/build-types/scrollable/hook.d.ts +69 -59
  955. package/build-types/scrollable/hook.d.ts.map +1 -1
  956. package/build-types/search-control/index.d.ts.map +1 -1
  957. package/build-types/search-control/styles.d.ts +1 -1
  958. package/build-types/select-control/chevron-down.d.ts +1 -1
  959. package/build-types/select-control/chevron-down.d.ts.map +1 -1
  960. package/build-types/select-control/index.d.ts.map +1 -1
  961. package/build-types/select-control/styles/select-control-styles.d.ts +3 -3
  962. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  963. package/build-types/shortcut/index.d.ts +1 -1
  964. package/build-types/shortcut/index.d.ts.map +1 -1
  965. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
  966. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts +1 -1
  967. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  968. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
  969. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
  970. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  971. package/build-types/slot-fill/index.d.ts +7 -7
  972. package/build-types/slot-fill/index.d.ts.map +1 -1
  973. package/build-types/slot-fill/provider.d.ts +1 -1
  974. package/build-types/slot-fill/provider.d.ts.map +1 -1
  975. package/build-types/slot-fill/slot.d.ts +1 -1
  976. package/build-types/slot-fill/slot.d.ts.map +1 -1
  977. package/build-types/slot-fill/types.d.ts +2 -2
  978. package/build-types/slot-fill/types.d.ts.map +1 -1
  979. package/build-types/snackbar/index.d.ts +2 -2
  980. package/build-types/snackbar/index.d.ts.map +1 -1
  981. package/build-types/snackbar/list.d.ts +1 -1
  982. package/build-types/snackbar/list.d.ts.map +1 -1
  983. package/build-types/spacer/hook.d.ts +69 -59
  984. package/build-types/spacer/hook.d.ts.map +1 -1
  985. package/build-types/spinner/index.d.ts +2 -2
  986. package/build-types/spinner/index.d.ts.map +1 -1
  987. package/build-types/spinner/styles.d.ts +3 -3
  988. package/build-types/style-provider/index.d.ts +1 -1
  989. package/build-types/style-provider/index.d.ts.map +1 -1
  990. package/build-types/surface/hook.d.ts +69 -59
  991. package/build-types/surface/hook.d.ts.map +1 -1
  992. package/build-types/tab-panel/index.d.ts +1 -1
  993. package/build-types/tab-panel/index.d.ts.map +1 -1
  994. package/build-types/tab-panel/stories/index.story.d.ts +4 -4
  995. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  996. package/build-types/tabs/index.d.ts +2 -2
  997. package/build-types/tabs/index.d.ts.map +1 -1
  998. package/build-types/tabs/styles.d.ts +3 -3
  999. package/build-types/tabs/tablist.d.ts +1 -1
  1000. package/build-types/tabs/tablist.d.ts.map +1 -1
  1001. package/build-types/text/get-line-height.d.ts.map +1 -1
  1002. package/build-types/text/hook.d.ts +68 -59
  1003. package/build-types/text/hook.d.ts.map +1 -1
  1004. package/build-types/text/stories/index.story.d.ts +3 -3
  1005. package/build-types/text/utils.d.ts.map +1 -1
  1006. package/build-types/text-control/index.d.ts +3 -3
  1007. package/build-types/text-control/index.d.ts.map +1 -1
  1008. package/build-types/text-highlight/index.d.ts +1 -1
  1009. package/build-types/text-highlight/index.d.ts.map +1 -1
  1010. package/build-types/textarea-control/index.d.ts +2 -2
  1011. package/build-types/textarea-control/index.d.ts.map +1 -1
  1012. package/build-types/textarea-control/styles/textarea-control-styles.d.ts +1 -1
  1013. package/build-types/theme/color-algorithms.d.ts.map +1 -1
  1014. package/build-types/theme/index.d.ts +1 -1
  1015. package/build-types/theme/index.d.ts.map +1 -1
  1016. package/build-types/theme/stories/index.story.d.ts +1 -1
  1017. package/build-types/theme/styles.d.ts +1 -1
  1018. package/build-types/tip/index.d.ts +1 -1
  1019. package/build-types/tip/index.d.ts.map +1 -1
  1020. package/build-types/toggle-control/index.d.ts +2 -2
  1021. package/build-types/toggle-control/index.d.ts.map +1 -1
  1022. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  1023. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  1024. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +1 -1
  1025. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  1026. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +1 -1
  1027. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  1028. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -1
  1029. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -1
  1030. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  1031. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +1 -1
  1032. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  1033. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +2 -2
  1034. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  1035. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  1036. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  1037. package/build-types/toolbar/stories/index.story.d.ts +3 -3
  1038. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  1039. package/build-types/toolbar/toolbar/index.d.ts +1 -1
  1040. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  1041. package/build-types/toolbar/toolbar/toolbar-container.d.ts +1 -1
  1042. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  1043. package/build-types/toolbar/toolbar-button/index.d.ts +5 -51
  1044. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  1045. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +1 -1
  1046. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -1
  1047. package/build-types/toolbar/toolbar-group/index.d.ts +1 -1
  1048. package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -1
  1049. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts +1 -1
  1050. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -1
  1051. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +1 -1
  1052. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -1
  1053. package/build-types/tools-panel/styles.d.ts +1 -1
  1054. package/build-types/tools-panel/tools-panel/hook.d.ts +71 -61
  1055. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  1056. package/build-types/tools-panel/tools-panel-header/hook.d.ts +70 -60
  1057. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  1058. package/build-types/tools-panel/tools-panel-item/hook.d.ts +69 -59
  1059. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  1060. package/build-types/tools-panel/types.d.ts +1 -1
  1061. package/build-types/tools-panel/types.d.ts.map +1 -1
  1062. package/build-types/tree-grid/index.d.ts +1 -1
  1063. package/build-types/tree-grid/index.d.ts.map +1 -1
  1064. package/build-types/tree-grid/item.d.ts +1 -1
  1065. package/build-types/tree-grid/item.d.ts.map +1 -1
  1066. package/build-types/tree-grid/roving-tab-index-item.d.ts +1 -1
  1067. package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
  1068. package/build-types/tree-grid/roving-tab-index.d.ts +1 -1
  1069. package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -1
  1070. package/build-types/tree-grid/row.d.ts +1 -1
  1071. package/build-types/tree-grid/row.d.ts.map +1 -1
  1072. package/build-types/tree-grid/stories/index.story.d.ts +1 -1
  1073. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  1074. package/build-types/tree-select/index.d.ts +1 -1
  1075. package/build-types/tree-select/index.d.ts.map +1 -1
  1076. package/build-types/truncate/hook.d.ts +69 -59
  1077. package/build-types/truncate/hook.d.ts.map +1 -1
  1078. package/build-types/unit-control/index.d.ts +1 -1
  1079. package/build-types/unit-control/index.d.ts.map +1 -1
  1080. package/build-types/unit-control/styles/unit-control-styles.d.ts +3 -3
  1081. package/build-types/unit-control/unit-select-control.d.ts +1 -1
  1082. package/build-types/utils/colors.d.ts.map +1 -1
  1083. package/build-types/utils/font-size.d.ts.map +1 -1
  1084. package/build-types/utils/get-valid-children.d.ts.map +1 -1
  1085. package/build-types/utils/input/base.d.ts.map +1 -1
  1086. package/build-types/utils/strings.d.ts.map +1 -1
  1087. package/build-types/utils/use-responsive-value.d.ts.map +1 -1
  1088. package/build-types/v-stack/hook.d.ts +69 -59
  1089. package/build-types/v-stack/hook.d.ts.map +1 -1
  1090. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  1091. package/build-types/view/component.d.ts +255 -7
  1092. package/build-types/view/component.d.ts.map +1 -1
  1093. package/build-types/z-stack/styles.d.ts +2 -2
  1094. package/package.json +22 -22
  1095. package/src/alignment-matrix-control/icon.tsx +2 -2
  1096. package/src/alignment-matrix-control/index.tsx +5 -6
  1097. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +4 -3
  1098. package/src/alignment-matrix-control/utils.tsx +6 -2
  1099. package/src/angle-picker-control/index.tsx +2 -2
  1100. package/src/animate/index.tsx +4 -7
  1101. package/src/autocomplete/autocompleter-ui.tsx +5 -3
  1102. package/src/autocomplete/index.tsx +21 -7
  1103. package/src/autocomplete/style.scss +10 -4
  1104. package/src/base-control/README.md +1 -1
  1105. package/src/base-control/hooks.ts +1 -5
  1106. package/src/base-control/index.tsx +2 -5
  1107. package/src/base-control/test/index.tsx +3 -3
  1108. package/src/base-control/types.ts +1 -2
  1109. package/src/border-control/types.ts +4 -0
  1110. package/src/box-control/test/index.tsx +22 -0
  1111. package/src/button/index.tsx +2 -2
  1112. package/src/button/style.scss +4 -6
  1113. package/src/button-group/index.tsx +2 -2
  1114. package/src/card/test/__snapshots__/index.tsx.snap +44 -47
  1115. package/src/checkbox-control/index.tsx +46 -37
  1116. package/src/checkbox-control/style.scss +12 -1
  1117. package/src/checkbox-control/test/__snapshots__/index.tsx.snap +27 -26
  1118. package/src/checkbox-control/test/index.tsx +5 -0
  1119. package/src/circular-option-picker/circular-option-picker-actions.tsx +3 -3
  1120. package/src/circular-option-picker/circular-option-picker-option-group.tsx +2 -2
  1121. package/src/circular-option-picker/circular-option-picker-option.tsx +2 -2
  1122. package/src/circular-option-picker/circular-option-picker.tsx +2 -5
  1123. package/src/circular-option-picker/style.scss +1 -2
  1124. package/src/clipboard-button/index.tsx +2 -2
  1125. package/src/color-indicator/index.tsx +2 -2
  1126. package/src/color-palette/index.tsx +2 -2
  1127. package/src/color-picker/hex-input.tsx +3 -1
  1128. package/src/color-picker/hue-picker.native.js +6 -2
  1129. package/src/color-picker/index.native.js +9 -3
  1130. package/src/color-picker/saturation-picker.native.js +6 -2
  1131. package/src/color-picker/use-deprecated-props.ts +9 -3
  1132. package/src/combobox-control/README.md +1 -1
  1133. package/src/combobox-control/index.tsx +8 -5
  1134. package/src/combobox-control/stories/index.story.tsx +28 -0
  1135. package/src/combobox-control/types.ts +1 -0
  1136. package/src/context/context-connect.ts +6 -2
  1137. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +3 -3
  1138. package/src/custom-gradient-picker/gradient-bar/index.tsx +2 -2
  1139. package/src/custom-gradient-picker/index.tsx +2 -2
  1140. package/src/custom-select-control/index.js +3 -6
  1141. package/src/custom-select-control-v2/README.md +0 -4
  1142. package/src/custom-select-control-v2/legacy-component/index.tsx +3 -1
  1143. package/src/custom-select-control-v2/stories/default.story.tsx +1 -1
  1144. package/src/custom-select-control-v2/stories/legacy.story.tsx +1 -1
  1145. package/src/dimension-control/index.tsx +2 -5
  1146. package/src/drop-zone/index.tsx +68 -68
  1147. package/src/dropdown/index.tsx +2 -2
  1148. package/src/dropdown/styles.ts +3 -1
  1149. package/src/dropdown-menu/index.native.js +6 -12
  1150. package/src/dropdown-menu/index.tsx +9 -16
  1151. package/src/duotone-picker/utils.ts +3 -1
  1152. package/src/elevation/hook.ts +6 -3
  1153. package/src/elevation/test/__snapshots__/index.tsx.snap +18 -24
  1154. package/src/external-link/index.tsx +2 -2
  1155. package/src/flex/test/__snapshots__/index.tsx.snap +4 -4
  1156. package/src/focal-point-picker/controls.tsx +3 -1
  1157. package/src/focal-point-picker/focal-point.tsx +2 -4
  1158. package/src/focal-point-picker/index.tsx +22 -12
  1159. package/src/focal-point-picker/styles/focal-point-picker-style.ts +4 -3
  1160. package/src/focal-point-picker/test/{index.js → index.tsx} +44 -17
  1161. package/src/focal-point-picker/test/{media.js → media.tsx} +18 -13
  1162. package/src/focal-point-picker/tooltip/index.native.js +1 -7
  1163. package/src/focal-point-picker/utils.ts +3 -1
  1164. package/src/font-size-picker/README.md +1 -0
  1165. package/src/font-size-picker/index.tsx +4 -2
  1166. package/src/font-size-picker/stories/index.story.tsx +0 -1
  1167. package/src/font-size-picker/types.ts +2 -0
  1168. package/src/form-toggle/index.tsx +2 -2
  1169. package/src/form-token-field/index.tsx +10 -8
  1170. package/src/form-token-field/style.scss +9 -0
  1171. package/src/form-token-field/suggestions-list.tsx +16 -10
  1172. package/src/form-token-field/token-input.tsx +2 -2
  1173. package/src/form-token-field/token.tsx +2 -2
  1174. package/src/guide/index.tsx +2 -2
  1175. package/src/higher-order/navigate-regions/style.scss +3 -3
  1176. package/src/input-control/index.tsx +3 -6
  1177. package/src/input-control/input-field.tsx +3 -1
  1178. package/src/input-control/label.tsx +3 -1
  1179. package/src/input-control/stories/index.story.tsx +31 -1
  1180. package/src/input-control/styles/input-control-styles.tsx +12 -4
  1181. package/src/input-control/test/index.js +10 -6
  1182. package/src/input-control/utils.ts +3 -2
  1183. package/src/item-group/item/hook.ts +1 -10
  1184. package/src/item-group/test/__snapshots__/index.js.snap +16 -16
  1185. package/src/menu-group/index.tsx +2 -2
  1186. package/src/menu-item/index.tsx +3 -3
  1187. package/src/mobile/color-settings/utils.native.js +1 -1
  1188. package/src/mobile/gradient/index.native.js +3 -1
  1189. package/src/mobile/keyboard-aware-flat-list/index.android.js +11 -2
  1190. package/src/mobile/keyboard-aware-flat-list/index.ios.js +30 -19
  1191. package/src/mobile/keyboard-aware-flat-list/shared.native.js +26 -0
  1192. package/src/mobile/keyboard-aware-flat-list/styles.native.scss +8 -0
  1193. package/src/modal/aria-helper.ts +8 -3
  1194. package/src/modal/index.tsx +10 -6
  1195. package/src/modal/test/index.tsx +11 -4
  1196. package/src/navigation/back-button/index.tsx +2 -5
  1197. package/src/navigation/group/index.tsx +2 -2
  1198. package/src/navigation/index.tsx +3 -3
  1199. package/src/navigation/item/base.tsx +2 -2
  1200. package/src/navigation/item/index.tsx +2 -2
  1201. package/src/navigation/menu/index.tsx +2 -2
  1202. package/src/navigation/styles/navigation-styles.tsx +4 -3
  1203. package/src/notice/index.tsx +5 -10
  1204. package/src/notice/list.tsx +2 -2
  1205. package/src/number-control/index.tsx +2 -2
  1206. package/src/palette-edit/index.tsx +10 -8
  1207. package/src/palette-edit/styles.ts +2 -3
  1208. package/src/panel/body.tsx +5 -3
  1209. package/src/panel/index.tsx +2 -2
  1210. package/src/panel/row.tsx +2 -2
  1211. package/src/panel/style.scss +1 -0
  1212. package/src/placeholder/index.tsx +3 -3
  1213. package/src/placeholder/style.scss +12 -35
  1214. package/src/popover/index.tsx +4 -3
  1215. package/src/popover/overlay-middlewares.tsx +3 -1
  1216. package/src/popover/stories/index.story.tsx +0 -2
  1217. package/src/query-controls/author-select.tsx +3 -1
  1218. package/src/radio-control/index.tsx +2 -2
  1219. package/src/range-control/index.tsx +3 -3
  1220. package/src/range-control/mark.tsx +3 -3
  1221. package/src/range-control/rail.tsx +1 -1
  1222. package/src/range-control/styles/range-control-styles.ts +5 -3
  1223. package/src/range-control/tooltip.tsx +2 -2
  1224. package/src/resizable-box/index.tsx +10 -10
  1225. package/src/resizable-box/resize-tooltip/index.tsx +5 -3
  1226. package/src/resizable-box/resize-tooltip/label.tsx +3 -1
  1227. package/src/resizable-box/resize-tooltip/utils.ts +12 -4
  1228. package/src/responsive-wrapper/index.tsx +2 -2
  1229. package/src/search-control/index.tsx +2 -5
  1230. package/src/select-control/index.tsx +5 -3
  1231. package/src/select-control/styles/select-control-styles.ts +3 -1
  1232. package/src/slot-fill/bubbles-virtually/slot-fill-context.ts +2 -1
  1233. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +1 -1
  1234. package/src/slot-fill/bubbles-virtually/use-slot-fills.ts +1 -1
  1235. package/src/slot-fill/bubbles-virtually/use-slot.ts +1 -1
  1236. package/src/slot-fill/types.ts +2 -2
  1237. package/src/snackbar/index.tsx +5 -8
  1238. package/src/snackbar/list.tsx +2 -2
  1239. package/src/spinner/index.tsx +2 -2
  1240. package/src/surface/test/__snapshots__/index.tsx.snap +10 -10
  1241. package/src/tab-panel/index.tsx +2 -2
  1242. package/src/text/get-line-height.ts +6 -2
  1243. package/src/text/utils.ts +6 -2
  1244. package/src/text-control/index.tsx +2 -2
  1245. package/src/theme/color-algorithms.ts +6 -2
  1246. package/src/theme/stories/index.story.tsx +1 -1
  1247. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +18 -26
  1248. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -1
  1249. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +7 -6
  1250. package/src/toolbar/toolbar/index.tsx +2 -2
  1251. package/src/toolbar/toolbar/style.scss +2 -14
  1252. package/src/toolbar/toolbar-button/index.tsx +3 -3
  1253. package/src/toolbar/toolbar-group/index.tsx +2 -2
  1254. package/src/tools-panel/tools-panel/hook.ts +9 -6
  1255. package/src/tools-panel/tools-panel-item/hook.ts +12 -8
  1256. package/src/tools-panel/types.ts +1 -0
  1257. package/src/tree-grid/roving-tab-index-item.tsx +3 -1
  1258. package/src/truncate/hook.ts +1 -1
  1259. package/src/unit-control/index.tsx +7 -3
  1260. package/src/unit-control/unit-select-control.tsx +2 -2
  1261. package/src/utils/colors.js +21 -7
  1262. package/src/utils/font-size.ts +3 -1
  1263. package/src/utils/get-valid-children.ts +3 -1
  1264. package/src/utils/input/base.js +4 -3
  1265. package/src/utils/strings.ts +11 -59
  1266. package/src/utils/test/strings.js +62 -0
  1267. package/src/utils/theme-variables.scss +4 -0
  1268. package/src/utils/use-responsive-value.ts +2 -1
  1269. package/src/view/component.tsx +18 -11
  1270. package/tsconfig.json +1 -2
  1271. package/tsconfig.tsbuildinfo +1 -1
  1272. package/build/slot-fill/bubbles-virtually/observable-map.js +0 -68
  1273. package/build/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
  1274. package/build/view/types.js +0 -6
  1275. package/build/view/types.js.map +0 -1
  1276. package/build-module/slot-fill/bubbles-virtually/observable-map.js +0 -60
  1277. package/build-module/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
  1278. package/build-module/view/types.js +0 -2
  1279. package/build-module/view/types.js.map +0 -1
  1280. package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts +0 -19
  1281. package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts.map +0 -1
  1282. package/build-types/view/types.d.ts +0 -8
  1283. package/build-types/view/types.d.ts.map +0 -1
  1284. package/src/slot-fill/bubbles-virtually/observable-map.ts +0 -79
  1285. package/src/slot-fill/test/observable-map.js +0 -83
  1286. package/src/utils/hooks/stories/use-cx.js +0 -157
  1287. package/src/view/types.ts +0 -6
@@ -1 +1 @@
1
- {"version":3,"names":["removeAccents","renderToString","useEffect","useState","useRef","useMemo","useInstanceId","useMergeRefs","useRefEffect","create","slice","insert","isCollapsed","getTextContent","speak","isAppleOS","getAutoCompleterUI","escapeRegExp","withIgnoreIMEEvents","getNodeText","node","toString","Array","map","join","props","children","EMPTY_FILTERED_OPTIONS","useAutocomplete","record","onChange","onReplace","completers","contentRef","instanceId","selectedIndex","setSelectedIndex","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacing","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","html","select","option","getOptionCompletion","isDisabled","completion","value","isCompletionObject","obj","action","undefined","completionObject","reset","onChangeOptions","options","handleKeyDown","event","current","key","defaultPrevented","newIndex","label","preventDefault","textContent","completer","reduce","lastTrigger","currentCompleter","triggerIndex","lastIndexOf","lastTriggerIndex","allowContext","textWithoutTrigger","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","textAfterSelection","test","safeTrigger","text","match","RegExp","query","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","popover","createElement","onSelect","useLastDifferentValue","history","Set","add","size","delete","from","useAutocompleteProps","ref","onKeyDownRef","previousRecord","mergedRefs","element","_onKeyDown","addEventListener","removeEventListener","didUserInput","Autocomplete","isSelected","Fragment"],"sources":["@wordpress/components/src/autocomplete/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n\tuseMemo,\n} from '@wordpress/element';\nimport { __, _n } from '@wordpress/i18n';\nimport { useInstanceId, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport {\n\tcreate,\n\tslice,\n\tinsert,\n\tisCollapsed,\n\tgetTextContent,\n} from '@wordpress/rich-text';\nimport { speak } from '@wordpress/a11y';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { getAutoCompleterUI } from './autocompleter-ui';\nimport { escapeRegExp } from '../utils/strings';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport type {\n\tAutocompleteProps,\n\tAutocompleterUIProps,\n\tInsertOption,\n\tKeyedOption,\n\tOptionCompletion,\n\tReplaceOption,\n\tUseAutocompleteProps,\n\tWPCompleter,\n} from './types';\n\nconst getNodeText = ( node: React.ReactNode ): string => {\n\tif ( node === null ) {\n\t\treturn '';\n\t}\n\n\tswitch ( typeof node ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn node.toString();\n\t\t\tbreak;\n\t\tcase 'boolean':\n\t\t\treturn '';\n\t\t\tbreak;\n\t\tcase 'object': {\n\t\t\tif ( node instanceof Array ) {\n\t\t\t\treturn node.map( getNodeText ).join( '' );\n\t\t\t}\n\t\t\tif ( 'props' in node ) {\n\t\t\t\treturn getNodeText( node.props.children );\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\treturn '';\n\t}\n\n\treturn '';\n};\n\nconst EMPTY_FILTERED_OPTIONS: KeyedOption[] = [];\n\nexport function useAutocomplete( {\n\trecord,\n\tonChange,\n\tonReplace,\n\tcompleters,\n\tcontentRef,\n}: UseAutocompleteProps ) {\n\tconst instanceId = useInstanceId( useAutocomplete );\n\tconst [ selectedIndex, setSelectedIndex ] = useState( 0 );\n\n\tconst [ filteredOptions, setFilteredOptions ] = useState<\n\t\tArray< KeyedOption >\n\t>( EMPTY_FILTERED_OPTIONS );\n\tconst [ filterValue, setFilterValue ] =\n\t\tuseState< AutocompleterUIProps[ 'filterValue' ] >( '' );\n\tconst [ autocompleter, setAutocompleter ] = useState< WPCompleter | null >(\n\t\tnull\n\t);\n\tconst [ AutocompleterUI, setAutocompleterUI ] = useState<\n\t\t( ( props: AutocompleterUIProps ) => JSX.Element | null ) | null\n\t>( null );\n\n\tconst backspacing = useRef( false );\n\n\tfunction insertCompletion( replacement: React.ReactNode ) {\n\t\tif ( autocompleter === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst end = record.start;\n\t\tconst start =\n\t\t\tend - autocompleter.triggerPrefix.length - filterValue.length;\n\t\tconst toInsert = create( { html: renderToString( replacement ) } );\n\n\t\tonChange( insert( record, toInsert, start, end ) );\n\t}\n\n\tfunction select( option: KeyedOption ) {\n\t\tconst { getOptionCompletion } = autocompleter || {};\n\n\t\tif ( option.isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( getOptionCompletion ) {\n\t\t\tconst completion = getOptionCompletion( option.value, filterValue );\n\n\t\t\tconst isCompletionObject = (\n\t\t\t\tobj: OptionCompletion\n\t\t\t): obj is InsertOption | ReplaceOption => {\n\t\t\t\treturn (\n\t\t\t\t\tobj !== null &&\n\t\t\t\t\ttypeof obj === 'object' &&\n\t\t\t\t\t'action' in obj &&\n\t\t\t\t\tobj.action !== undefined &&\n\t\t\t\t\t'value' in obj &&\n\t\t\t\t\tobj.value !== undefined\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst completionObject = isCompletionObject( completion )\n\t\t\t\t? completion\n\t\t\t\t: ( {\n\t\t\t\t\t\taction: 'insert-at-caret',\n\t\t\t\t\t\tvalue: completion,\n\t\t\t\t } as InsertOption );\n\n\t\t\tif ( 'replace' === completionObject.action ) {\n\t\t\t\tonReplace( [ completionObject.value ] );\n\t\t\t\t// When replacing, the component will unmount, so don't reset\n\t\t\t\t// state (below) on an unmounted component.\n\t\t\t\treturn;\n\t\t\t} else if ( 'insert-at-caret' === completionObject.action ) {\n\t\t\t\tinsertCompletion( completionObject.value );\n\t\t\t}\n\t\t}\n\n\t\t// Reset autocomplete state after insertion rather than before\n\t\t// so insertion events don't cause the completion menu to redisplay.\n\t\treset();\n\t}\n\n\tfunction reset() {\n\t\tsetSelectedIndex( 0 );\n\t\tsetFilteredOptions( EMPTY_FILTERED_OPTIONS );\n\t\tsetFilterValue( '' );\n\t\tsetAutocompleter( null );\n\t\tsetAutocompleterUI( null );\n\t}\n\n\t/**\n\t * Load options for an autocompleter.\n\t *\n\t * @param {Array} options\n\t */\n\tfunction onChangeOptions( options: Array< KeyedOption > ) {\n\t\tsetSelectedIndex(\n\t\t\toptions.length === filteredOptions.length ? selectedIndex : 0\n\t\t);\n\t\tsetFilteredOptions( options );\n\t}\n\n\tfunction handleKeyDown( event: KeyboardEvent ) {\n\t\tbackspacing.current = event.key === 'Backspace';\n\n\t\tif ( ! autocompleter ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( filteredOptions.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( event.key ) {\n\t\t\tcase 'ArrowUp': {\n\t\t\t\tconst newIndex =\n\t\t\t\t\t( selectedIndex === 0\n\t\t\t\t\t\t? filteredOptions.length\n\t\t\t\t\t\t: selectedIndex ) - 1;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\t// See the related PR as to why this is necessary: https://github.com/WordPress/gutenberg/pull/54902.\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'ArrowDown': {\n\t\t\t\tconst newIndex = ( selectedIndex + 1 ) % filteredOptions.length;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'Escape':\n\t\t\t\tsetAutocompleter( null );\n\t\t\t\tsetAutocompleterUI( null );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tselect( filteredOptions[ selectedIndex ] );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowLeft':\n\t\t\tcase 'ArrowRight':\n\t\t\t\treset();\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Any handled key should prevent original behavior. This relies on\n\t\t// the early return in the default case.\n\t\tevent.preventDefault();\n\t}\n\n\t// textContent is a primitive (string), memoizing is not strictly necessary\n\t// but this is a preemptive performance improvement, since the autocompleter\n\t// is a potential bottleneck for the editor type metric.\n\tconst textContent = useMemo( () => {\n\t\tif ( isCollapsed( record ) ) {\n\t\t\treturn getTextContent( slice( record, 0 ) );\n\t\t}\n\t\treturn '';\n\t}, [ record ] );\n\n\tuseEffect( () => {\n\t\tif ( ! textContent ) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\t// Find the completer with the highest triggerPrefix index in the\n\t\t// textContent.\n\t\tconst completer = completers.reduce< WPCompleter | null >(\n\t\t\t( lastTrigger, currentCompleter ) => {\n\t\t\t\tconst triggerIndex = textContent.lastIndexOf(\n\t\t\t\t\tcurrentCompleter.triggerPrefix\n\t\t\t\t);\n\t\t\t\tconst lastTriggerIndex =\n\t\t\t\t\tlastTrigger !== null\n\t\t\t\t\t\t? textContent.lastIndexOf( lastTrigger.triggerPrefix )\n\t\t\t\t\t\t: -1;\n\n\t\t\t\treturn triggerIndex > lastTriggerIndex\n\t\t\t\t\t? currentCompleter\n\t\t\t\t\t: lastTrigger;\n\t\t\t},\n\t\t\tnull\n\t\t);\n\n\t\tif ( ! completer ) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\tconst { allowContext, triggerPrefix } = completer;\n\t\tconst triggerIndex = textContent.lastIndexOf( triggerPrefix );\n\t\tconst textWithoutTrigger = textContent.slice(\n\t\t\ttriggerIndex + triggerPrefix.length\n\t\t);\n\n\t\tconst tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.\n\t\t// This is a final barrier to prevent the effect from completing with\n\t\t// an extremely long string, which causes the editor to slow-down\n\t\t// significantly. This could happen, for example, if `matchingWhileBackspacing`\n\t\t// is true and one of the \"words\" end up being too long. If that's the case,\n\t\t// it will be caught by this guard.\n\t\tif ( tooDistantFromTrigger ) return;\n\n\t\tconst mismatch = filteredOptions.length === 0;\n\t\tconst wordsFromTrigger = textWithoutTrigger.split( /\\s/ );\n\t\t// We need to allow the effect to run when not backspacing and if there\n\t\t// was a mismatch. i.e when typing a trigger + the match string or when\n\t\t// clicking in an existing trigger word on the page. We do that if we\n\t\t// detect that we have one word from trigger in the current textual context.\n\t\t//\n\t\t// Ex.: \"Some text @a\" <-- \"@a\" will be detected as the trigger word and\n\t\t// allow the effect to run. It will run until there's a mismatch.\n\t\tconst hasOneTriggerWord = wordsFromTrigger.length === 1;\n\t\t// This is used to allow the effect to run when backspacing and if\n\t\t// \"touching\" a word that \"belongs\" to a trigger. We consider a \"trigger\n\t\t// word\" any word up to the limit of 3 from the trigger character.\n\t\t// Anything beyond that is ignored if there's a mismatch. This allows\n\t\t// us to \"escape\" a mismatch when backspacing, but still imposing some\n\t\t// sane limits.\n\t\t//\n\t\t// Ex: \"Some text @marcelo sekkkk\" <--- \"kkkk\" caused a mismatch, but\n\t\t// if the user presses backspace here, it will show the completion popup again.\n\t\tconst matchingWhileBackspacing =\n\t\t\tbackspacing.current && wordsFromTrigger.length <= 3;\n\n\t\tif ( mismatch && ! ( matchingWhileBackspacing || hasOneTriggerWord ) ) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAfterSelection = getTextContent(\n\t\t\tslice( record, undefined, getTextContent( record ).length )\n\t\t);\n\n\t\tif (\n\t\t\tallowContext &&\n\t\t\t! allowContext(\n\t\t\t\ttextContent.slice( 0, triggerIndex ),\n\t\t\t\ttextAfterSelection\n\t\t\t)\n\t\t) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t/^\\s/.test( textWithoutTrigger ) ||\n\t\t\t/\\s\\s+$/.test( textWithoutTrigger )\n\t\t) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! /[\\u0000-\\uFFFF]*$/.test( textWithoutTrigger ) ) {\n\t\t\tif ( autocompleter ) reset();\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeTrigger = escapeRegExp( completer.triggerPrefix );\n\t\tconst text = removeAccents( textContent );\n\t\tconst match = text\n\t\t\t.slice( text.lastIndexOf( completer.triggerPrefix ) )\n\t\t\t.match( new RegExp( `${ safeTrigger }([\\u0000-\\uFFFF]*)$` ) );\n\t\tconst query = match && match[ 1 ];\n\n\t\tsetAutocompleter( completer );\n\t\tsetAutocompleterUI( () =>\n\t\t\tcompleter !== autocompleter\n\t\t\t\t? getAutoCompleterUI( completer )\n\t\t\t\t: AutocompleterUI\n\t\t);\n\t\tsetFilterValue( query === null ? '' : query );\n\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ textContent ] );\n\n\tconst { key: selectedKey = '' } = filteredOptions[ selectedIndex ] || {};\n\tconst { className } = autocompleter || {};\n\tconst isExpanded = !! autocompleter && filteredOptions.length > 0;\n\tconst listBoxId = isExpanded\n\t\t? `components-autocomplete-listbox-${ instanceId }`\n\t\t: undefined;\n\tconst activeId = isExpanded\n\t\t? `components-autocomplete-item-${ instanceId }-${ selectedKey }`\n\t\t: null;\n\tconst hasSelection = record.start !== undefined;\n\n\treturn {\n\t\tlistBoxId,\n\t\tactiveId,\n\t\tonKeyDown: withIgnoreIMEEvents( handleKeyDown ),\n\t\tpopover: hasSelection && AutocompleterUI && (\n\t\t\t<AutocompleterUI\n\t\t\t\tclassName={ className }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tinstanceId={ instanceId }\n\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\tonChangeOptions={ onChangeOptions }\n\t\t\t\tonSelect={ select }\n\t\t\t\tvalue={ record }\n\t\t\t\tcontentRef={ contentRef }\n\t\t\t\treset={ reset }\n\t\t\t/>\n\t\t),\n\t};\n}\n\nfunction useLastDifferentValue( value: UseAutocompleteProps[ 'record' ] ) {\n\tconst history = useRef< Set< typeof value > >( new Set() );\n\n\thistory.current.add( value );\n\n\t// Keep the history size to 2.\n\tif ( history.current.size > 2 ) {\n\t\thistory.current.delete( Array.from( history.current )[ 0 ] );\n\t}\n\n\treturn Array.from( history.current )[ 0 ];\n}\n\nexport function useAutocompleteProps( options: UseAutocompleteProps ) {\n\tconst ref = useRef< HTMLElement >( null );\n\tconst onKeyDownRef = useRef< ( event: KeyboardEvent ) => void >();\n\tconst { record } = options;\n\tconst previousRecord = useLastDifferentValue( record );\n\tconst { popover, listBoxId, activeId, onKeyDown } = useAutocomplete( {\n\t\t...options,\n\t\tcontentRef: ref,\n\t} );\n\tonKeyDownRef.current = onKeyDown;\n\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tuseRefEffect( ( element: HTMLElement ) => {\n\t\t\tfunction _onKeyDown( event: KeyboardEvent ) {\n\t\t\t\tonKeyDownRef.current?.( event );\n\t\t\t}\n\t\t\telement.addEventListener( 'keydown', _onKeyDown );\n\t\t\treturn () => {\n\t\t\t\telement.removeEventListener( 'keydown', _onKeyDown );\n\t\t\t};\n\t\t}, [] ),\n\t] );\n\n\t// We only want to show the popover if the user has typed something.\n\tconst didUserInput = record.text !== previousRecord?.text;\n\n\tif ( ! didUserInput ) {\n\t\treturn { ref: mergedRefs };\n\t}\n\n\treturn {\n\t\tref: mergedRefs,\n\t\tchildren: popover,\n\t\t'aria-autocomplete': listBoxId ? 'list' : undefined,\n\t\t'aria-owns': listBoxId,\n\t\t'aria-activedescendant': activeId,\n\t};\n}\n\nexport default function Autocomplete( {\n\tchildren,\n\tisSelected,\n\t...options\n}: AutocompleteProps ) {\n\tconst { popover, ...props } = useAutocomplete( options );\n\treturn (\n\t\t<>\n\t\t\t{ children( props ) }\n\t\t\t{ isSelected && popover }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SACCC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,OAAO,QACD,oBAAoB;AAE3B,SAASC,aAAa,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC9E,SACCC,MAAM,EACNC,KAAK,EACLC,MAAM,EACNC,WAAW,EACXC,cAAc,QACR,sBAAsB;AAC7B,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,mBAAmB,QAAQ,iCAAiC;AAYrE,MAAMC,WAAW,GAAKC,IAAqB,IAAc;EACxD,IAAKA,IAAI,KAAK,IAAI,EAAG;IACpB,OAAO,EAAE;EACV;EAEA,QAAS,OAAOA,IAAI;IACnB,KAAK,QAAQ;IACb,KAAK,QAAQ;MACZ,OAAOA,IAAI,CAACC,QAAQ,CAAC,CAAC;MACtB;IACD,KAAK,SAAS;MACb,OAAO,EAAE;MACT;IACD,KAAK,QAAQ;MAAE;QACd,IAAKD,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List":[]}
1
+ {"version":3,"names":["removeAccents","renderToString","useEffect","useState","useRef","useMemo","useInstanceId","useMergeRefs","useRefEffect","create","slice","insert","isCollapsed","getTextContent","speak","isAppleOS","getAutoCompleterUI","escapeRegExp","withIgnoreIMEEvents","getNodeText","node","toString","Array","map","join","props","children","EMPTY_FILTERED_OPTIONS","useAutocomplete","record","onChange","onReplace","completers","contentRef","instanceId","selectedIndex","setSelectedIndex","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacing","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","html","select","option","getOptionCompletion","isDisabled","completion","value","isCompletionObject","obj","action","undefined","completionObject","reset","onChangeOptions","options","handleKeyDown","event","current","key","defaultPrevented","newIndex","label","preventDefault","textContent","completer","reduce","lastTrigger","currentCompleter","triggerIndex","lastIndexOf","lastTriggerIndex","allowContext","textWithoutTrigger","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","textAfterSelection","test","safeTrigger","text","match","RegExp","query","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","popover","createElement","onSelect","useLastDifferentValue","history","Set","add","size","delete","from","useAutocompleteProps","ref","onKeyDownRef","previousRecord","mergedRefs","element","_onKeyDown","addEventListener","removeEventListener","didUserInput","Autocomplete","isSelected","Fragment"],"sources":["@wordpress/components/src/autocomplete/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n\tuseMemo,\n} from '@wordpress/element';\nimport { __, _n } from '@wordpress/i18n';\nimport { useInstanceId, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport {\n\tcreate,\n\tslice,\n\tinsert,\n\tisCollapsed,\n\tgetTextContent,\n} from '@wordpress/rich-text';\nimport { speak } from '@wordpress/a11y';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { getAutoCompleterUI } from './autocompleter-ui';\nimport { escapeRegExp } from '../utils/strings';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport type {\n\tAutocompleteProps,\n\tAutocompleterUIProps,\n\tInsertOption,\n\tKeyedOption,\n\tOptionCompletion,\n\tReplaceOption,\n\tUseAutocompleteProps,\n\tWPCompleter,\n} from './types';\n\nconst getNodeText = ( node: React.ReactNode ): string => {\n\tif ( node === null ) {\n\t\treturn '';\n\t}\n\n\tswitch ( typeof node ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn node.toString();\n\t\t\tbreak;\n\t\tcase 'boolean':\n\t\t\treturn '';\n\t\t\tbreak;\n\t\tcase 'object': {\n\t\t\tif ( node instanceof Array ) {\n\t\t\t\treturn node.map( getNodeText ).join( '' );\n\t\t\t}\n\t\t\tif ( 'props' in node ) {\n\t\t\t\treturn getNodeText( node.props.children );\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\treturn '';\n\t}\n\n\treturn '';\n};\n\nconst EMPTY_FILTERED_OPTIONS: KeyedOption[] = [];\n\nexport function useAutocomplete( {\n\trecord,\n\tonChange,\n\tonReplace,\n\tcompleters,\n\tcontentRef,\n}: UseAutocompleteProps ) {\n\tconst instanceId = useInstanceId( useAutocomplete );\n\tconst [ selectedIndex, setSelectedIndex ] = useState( 0 );\n\n\tconst [ filteredOptions, setFilteredOptions ] = useState<\n\t\tArray< KeyedOption >\n\t>( EMPTY_FILTERED_OPTIONS );\n\tconst [ filterValue, setFilterValue ] =\n\t\tuseState< AutocompleterUIProps[ 'filterValue' ] >( '' );\n\tconst [ autocompleter, setAutocompleter ] = useState< WPCompleter | null >(\n\t\tnull\n\t);\n\tconst [ AutocompleterUI, setAutocompleterUI ] = useState<\n\t\t( ( props: AutocompleterUIProps ) => JSX.Element | null ) | null\n\t>( null );\n\n\tconst backspacing = useRef( false );\n\n\tfunction insertCompletion( replacement: React.ReactNode ) {\n\t\tif ( autocompleter === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst end = record.start;\n\t\tconst start =\n\t\t\tend - autocompleter.triggerPrefix.length - filterValue.length;\n\t\tconst toInsert = create( { html: renderToString( replacement ) } );\n\n\t\tonChange( insert( record, toInsert, start, end ) );\n\t}\n\n\tfunction select( option: KeyedOption ) {\n\t\tconst { getOptionCompletion } = autocompleter || {};\n\n\t\tif ( option.isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( getOptionCompletion ) {\n\t\t\tconst completion = getOptionCompletion( option.value, filterValue );\n\n\t\t\tconst isCompletionObject = (\n\t\t\t\tobj: OptionCompletion\n\t\t\t): obj is InsertOption | ReplaceOption => {\n\t\t\t\treturn (\n\t\t\t\t\tobj !== null &&\n\t\t\t\t\ttypeof obj === 'object' &&\n\t\t\t\t\t'action' in obj &&\n\t\t\t\t\tobj.action !== undefined &&\n\t\t\t\t\t'value' in obj &&\n\t\t\t\t\tobj.value !== undefined\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst completionObject = isCompletionObject( completion )\n\t\t\t\t? completion\n\t\t\t\t: ( {\n\t\t\t\t\t\taction: 'insert-at-caret',\n\t\t\t\t\t\tvalue: completion,\n\t\t\t\t } as InsertOption );\n\n\t\t\tif ( 'replace' === completionObject.action ) {\n\t\t\t\tonReplace( [ completionObject.value ] );\n\t\t\t\t// When replacing, the component will unmount, so don't reset\n\t\t\t\t// state (below) on an unmounted component.\n\t\t\t\treturn;\n\t\t\t} else if ( 'insert-at-caret' === completionObject.action ) {\n\t\t\t\tinsertCompletion( completionObject.value );\n\t\t\t}\n\t\t}\n\n\t\t// Reset autocomplete state after insertion rather than before\n\t\t// so insertion events don't cause the completion menu to redisplay.\n\t\treset();\n\t}\n\n\tfunction reset() {\n\t\tsetSelectedIndex( 0 );\n\t\tsetFilteredOptions( EMPTY_FILTERED_OPTIONS );\n\t\tsetFilterValue( '' );\n\t\tsetAutocompleter( null );\n\t\tsetAutocompleterUI( null );\n\t}\n\n\t/**\n\t * Load options for an autocompleter.\n\t *\n\t * @param {Array} options\n\t */\n\tfunction onChangeOptions( options: Array< KeyedOption > ) {\n\t\tsetSelectedIndex(\n\t\t\toptions.length === filteredOptions.length ? selectedIndex : 0\n\t\t);\n\t\tsetFilteredOptions( options );\n\t}\n\n\tfunction handleKeyDown( event: KeyboardEvent ) {\n\t\tbackspacing.current = event.key === 'Backspace';\n\n\t\tif ( ! autocompleter ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( filteredOptions.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( event.key ) {\n\t\t\tcase 'ArrowUp': {\n\t\t\t\tconst newIndex =\n\t\t\t\t\t( selectedIndex === 0\n\t\t\t\t\t\t? filteredOptions.length\n\t\t\t\t\t\t: selectedIndex ) - 1;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\t// See the related PR as to why this is necessary: https://github.com/WordPress/gutenberg/pull/54902.\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'ArrowDown': {\n\t\t\t\tconst newIndex = ( selectedIndex + 1 ) % filteredOptions.length;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'Escape':\n\t\t\t\tsetAutocompleter( null );\n\t\t\t\tsetAutocompleterUI( null );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tselect( filteredOptions[ selectedIndex ] );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowLeft':\n\t\t\tcase 'ArrowRight':\n\t\t\t\treset();\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Any handled key should prevent original behavior. This relies on\n\t\t// the early return in the default case.\n\t\tevent.preventDefault();\n\t}\n\n\t// textContent is a primitive (string), memoizing is not strictly necessary\n\t// but this is a preemptive performance improvement, since the autocompleter\n\t// is a potential bottleneck for the editor type metric.\n\tconst textContent = useMemo( () => {\n\t\tif ( isCollapsed( record ) ) {\n\t\t\treturn getTextContent( slice( record, 0 ) );\n\t\t}\n\t\treturn '';\n\t}, [ record ] );\n\n\tuseEffect( () => {\n\t\tif ( ! textContent ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Find the completer with the highest triggerPrefix index in the\n\t\t// textContent.\n\t\tconst completer = completers.reduce< WPCompleter | null >(\n\t\t\t( lastTrigger, currentCompleter ) => {\n\t\t\t\tconst triggerIndex = textContent.lastIndexOf(\n\t\t\t\t\tcurrentCompleter.triggerPrefix\n\t\t\t\t);\n\t\t\t\tconst lastTriggerIndex =\n\t\t\t\t\tlastTrigger !== null\n\t\t\t\t\t\t? textContent.lastIndexOf( lastTrigger.triggerPrefix )\n\t\t\t\t\t\t: -1;\n\n\t\t\t\treturn triggerIndex > lastTriggerIndex\n\t\t\t\t\t? currentCompleter\n\t\t\t\t\t: lastTrigger;\n\t\t\t},\n\t\t\tnull\n\t\t);\n\n\t\tif ( ! completer ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst { allowContext, triggerPrefix } = completer;\n\t\tconst triggerIndex = textContent.lastIndexOf( triggerPrefix );\n\t\tconst textWithoutTrigger = textContent.slice(\n\t\t\ttriggerIndex + triggerPrefix.length\n\t\t);\n\n\t\tconst tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.\n\t\t// This is a final barrier to prevent the effect from completing with\n\t\t// an extremely long string, which causes the editor to slow-down\n\t\t// significantly. This could happen, for example, if `matchingWhileBackspacing`\n\t\t// is true and one of the \"words\" end up being too long. If that's the case,\n\t\t// it will be caught by this guard.\n\t\tif ( tooDistantFromTrigger ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mismatch = filteredOptions.length === 0;\n\t\tconst wordsFromTrigger = textWithoutTrigger.split( /\\s/ );\n\t\t// We need to allow the effect to run when not backspacing and if there\n\t\t// was a mismatch. i.e when typing a trigger + the match string or when\n\t\t// clicking in an existing trigger word on the page. We do that if we\n\t\t// detect that we have one word from trigger in the current textual context.\n\t\t//\n\t\t// Ex.: \"Some text @a\" <-- \"@a\" will be detected as the trigger word and\n\t\t// allow the effect to run. It will run until there's a mismatch.\n\t\tconst hasOneTriggerWord = wordsFromTrigger.length === 1;\n\t\t// This is used to allow the effect to run when backspacing and if\n\t\t// \"touching\" a word that \"belongs\" to a trigger. We consider a \"trigger\n\t\t// word\" any word up to the limit of 3 from the trigger character.\n\t\t// Anything beyond that is ignored if there's a mismatch. This allows\n\t\t// us to \"escape\" a mismatch when backspacing, but still imposing some\n\t\t// sane limits.\n\t\t//\n\t\t// Ex: \"Some text @marcelo sekkkk\" <--- \"kkkk\" caused a mismatch, but\n\t\t// if the user presses backspace here, it will show the completion popup again.\n\t\tconst matchingWhileBackspacing =\n\t\t\tbackspacing.current && wordsFromTrigger.length <= 3;\n\n\t\tif ( mismatch && ! ( matchingWhileBackspacing || hasOneTriggerWord ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAfterSelection = getTextContent(\n\t\t\tslice( record, undefined, getTextContent( record ).length )\n\t\t);\n\n\t\tif (\n\t\t\tallowContext &&\n\t\t\t! allowContext(\n\t\t\t\ttextContent.slice( 0, triggerIndex ),\n\t\t\t\ttextAfterSelection\n\t\t\t)\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t/^\\s/.test( textWithoutTrigger ) ||\n\t\t\t/\\s\\s+$/.test( textWithoutTrigger )\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! /[\\u0000-\\uFFFF]*$/.test( textWithoutTrigger ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeTrigger = escapeRegExp( completer.triggerPrefix );\n\t\tconst text = removeAccents( textContent );\n\t\tconst match = text\n\t\t\t.slice( text.lastIndexOf( completer.triggerPrefix ) )\n\t\t\t.match( new RegExp( `${ safeTrigger }([\\u0000-\\uFFFF]*)$` ) );\n\t\tconst query = match && match[ 1 ];\n\n\t\tsetAutocompleter( completer );\n\t\tsetAutocompleterUI( () =>\n\t\t\tcompleter !== autocompleter\n\t\t\t\t? getAutoCompleterUI( completer )\n\t\t\t\t: AutocompleterUI\n\t\t);\n\t\tsetFilterValue( query === null ? '' : query );\n\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ textContent ] );\n\n\tconst { key: selectedKey = '' } = filteredOptions[ selectedIndex ] || {};\n\tconst { className } = autocompleter || {};\n\tconst isExpanded = !! autocompleter && filteredOptions.length > 0;\n\tconst listBoxId = isExpanded\n\t\t? `components-autocomplete-listbox-${ instanceId }`\n\t\t: undefined;\n\tconst activeId = isExpanded\n\t\t? `components-autocomplete-item-${ instanceId }-${ selectedKey }`\n\t\t: null;\n\tconst hasSelection = record.start !== undefined;\n\n\treturn {\n\t\tlistBoxId,\n\t\tactiveId,\n\t\tonKeyDown: withIgnoreIMEEvents( handleKeyDown ),\n\t\tpopover: hasSelection && AutocompleterUI && (\n\t\t\t<AutocompleterUI\n\t\t\t\tclassName={ className }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tinstanceId={ instanceId }\n\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\tonChangeOptions={ onChangeOptions }\n\t\t\t\tonSelect={ select }\n\t\t\t\tvalue={ record }\n\t\t\t\tcontentRef={ contentRef }\n\t\t\t\treset={ reset }\n\t\t\t/>\n\t\t),\n\t};\n}\n\nfunction useLastDifferentValue( value: UseAutocompleteProps[ 'record' ] ) {\n\tconst history = useRef< Set< typeof value > >( new Set() );\n\n\thistory.current.add( value );\n\n\t// Keep the history size to 2.\n\tif ( history.current.size > 2 ) {\n\t\thistory.current.delete( Array.from( history.current )[ 0 ] );\n\t}\n\n\treturn Array.from( history.current )[ 0 ];\n}\n\nexport function useAutocompleteProps( options: UseAutocompleteProps ) {\n\tconst ref = useRef< HTMLElement >( null );\n\tconst onKeyDownRef = useRef< ( event: KeyboardEvent ) => void >();\n\tconst { record } = options;\n\tconst previousRecord = useLastDifferentValue( record );\n\tconst { popover, listBoxId, activeId, onKeyDown } = useAutocomplete( {\n\t\t...options,\n\t\tcontentRef: ref,\n\t} );\n\tonKeyDownRef.current = onKeyDown;\n\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tuseRefEffect( ( element: HTMLElement ) => {\n\t\t\tfunction _onKeyDown( event: KeyboardEvent ) {\n\t\t\t\tonKeyDownRef.current?.( event );\n\t\t\t}\n\t\t\telement.addEventListener( 'keydown', _onKeyDown );\n\t\t\treturn () => {\n\t\t\t\telement.removeEventListener( 'keydown', _onKeyDown );\n\t\t\t};\n\t\t}, [] ),\n\t] );\n\n\t// We only want to show the popover if the user has typed something.\n\tconst didUserInput = record.text !== previousRecord?.text;\n\n\tif ( ! didUserInput ) {\n\t\treturn { ref: mergedRefs };\n\t}\n\n\treturn {\n\t\tref: mergedRefs,\n\t\tchildren: popover,\n\t\t'aria-autocomplete': listBoxId ? 'list' : undefined,\n\t\t'aria-owns': listBoxId,\n\t\t'aria-activedescendant': activeId,\n\t};\n}\n\nexport default function Autocomplete( {\n\tchildren,\n\tisSelected,\n\t...options\n}: AutocompleteProps ) {\n\tconst { popover, ...props } = useAutocomplete( options );\n\treturn (\n\t\t<>\n\t\t\t{ children( props ) }\n\t\t\t{ isSelected && popover }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SACCC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,OAAO,QACD,oBAAoB;AAE3B,SAASC,aAAa,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC9E,SACCC,MAAM,EACNC,KAAK,EACLC,MAAM,EACNC,WAAW,EACXC,cAAc,QACR,sBAAsB;AAC7B,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,mBAAmB,QAAQ,iCAAiC;AAYrE,MAAMC,WAAW,GAAKC,IAAqB,IAAc;EACxD,IAAKA,IAAI,KAAK,IAAI,EAAG;IACpB,OAAO,EAAE;EACV;EAEA,QAAS,OAAOA,IAAI;IACnB,KAAK,QAAQ;IACb,KAAK,QAAQ;MACZ,OAAOA,IAAI,CAACC,QAAQ,CAAC,CAAC;MACtB;IACD,KAAK,SAAS;MACb,OAAO,EAAE;MACT;IACD,KAAK,QAAQ;MAAE;QACd,IAAKD,IAAI,YAAYE,KAAK,EAAG;UAC5B,OAAOF,IAAI,CAACG,GAAG,CAAEJ,WAAY,CAAC,CAACK,IAAI,C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BaseControlProps(props) {
21
21
  ...restProps
22
22
  } = props;
23
23
  const uniqueId = useInstanceId(BaseControl, 'wp-components-base-control', preferredId);
24
-
25
- // ARIA descriptions can only contain plain text, so fall back to aria-details if not.
26
- const helpPropName = typeof help === 'string' ? 'aria-describedby' : 'aria-details';
27
24
  return {
28
25
  baseControlProps: {
29
26
  id: uniqueId,
@@ -33,7 +30,7 @@ export function useBaseControlProps(props) {
33
30
  controlProps: {
34
31
  id: uniqueId,
35
32
  ...(!!help ? {
36
- [helpPropName]: `${uniqueId}__help`
33
+ 'aria-describedby': `${uniqueId}__help`
37
34
  } : {})
38
35
  }
39
36
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useInstanceId","BaseControl","useBaseControlProps","props","help","id","preferredId","restProps","uniqueId","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":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,GAAG;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAClCC,KAA2C,EAC1C;EACD,MAAM;IAAEC,IAAI;IAAEC,EAAE,EAAEC,WAAW;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAErD,MAAMK,QAAQ,GAAGR,aAAa,CAC7BC,WAAW,EACX,4BAA4B,EAC5BK,WACD,CAAC;;EAED;EACA,MAAMG,YAAY,GACjB,OAAOL,IAAI,KAAK,QAAQ,GAAG,kBAAkB,GAAG,cAAc;EAE/D,OAAO;IACNM,gBAAgB,EAAE;MACjBL,EAAE,EAAEG,QAAQ;MACZJ,IAAI;MACJ,GAAGG;IACJ,CAAC;IACDI,YAAY,EAAE;MACbN,EAAE,EAAEG,QAAQ;MACZ,IAAK,CAAC,CAAEJ,IAAI,GAAG;QAAE,CAAEK,YAAY,GAAK,GAAGD,QAAU;MAAQ,CAAC,GAAG,CAAC,CAAC;IAChE;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["useInstanceId","BaseControl","useBaseControlProps","props","help","id","preferredId","restProps","uniqueId","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":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,GAAG;AAG3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAClCC,KAA2C,EAC1C;EACD,MAAM;IAAEC,IAAI;IAAEC,EAAE,EAAEC,WAAW;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAErD,MAAMK,QAAQ,GAAGR,aAAa,CAC7BC,WAAW,EACX,4BAA4B,EAC5BK,WACD,CAAC;EAED,OAAO;IACNG,gBAAgB,EAAE;MACjBJ,EAAE,EAAEG,QAAQ;MACZJ,IAAI;MACJ,GAAGG;IACJ,CAAC;IACDG,YAAY,EAAE;MACbL,EAAE,EAAEG,QAAQ;MACZ,IAAK,CAAC,CAAEJ,IAAI,GAAG;QAAE,kBAAkB,EAAG,GAAGI,QAAU;MAAQ,CAAC,GAAG,CAAC,CAAC;IAClE;EACD,CAAC;AACF","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -91,7 +91,7 @@ export const VisualLabel = ({
91
91
  }) => {
92
92
  return createElement(StyledVisualLabel, {
93
93
  ...props,
94
- className: classnames('components-base-control__label', className)
94
+ className: clsx('components-base-control__label', className)
95
95
  }, children);
96
96
  };
97
97
  export const BaseControl = Object.assign(contextConnectWithoutRef(UnconnectedBaseControl, 'BaseControl'), {
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","VisuallyHidden","Wrapper","StyledField","StyledLabel","StyledHelp","StyledVisualLabel","contextConnectWithoutRef","useContextSystem","useBaseControlProps","UnconnectedBaseControl","props","__nextHasNoMarginBottom","id","label","hideLabelFromVision","help","className","children","createElement","as","htmlFor","VisualLabel","undefined","BaseControl","Object","assign"],"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":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SACCC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,iBAAiB,QACX,8BAA8B;AAErC,SAASC,wBAAwB,EAAEC,gBAAgB,QAAQ,YAAY;AAEvE,SAASC,mBAAmB,QAAQ,SAAS;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,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,GAAGV,gBAAgB,CAAEG,KAAK,EAAE,aAAc,CAAC;EAE5C,OACCQ,aAAA,CAACjB,OAAO;IAACe,SAAS,EAAGA;EAAW,GAC/BE,aAAA,CAAChB,WAAW;IACXc,SAAS,EAAC;IACV;IAAA;IACAL,uBAAuB,EAAGA;EAAyB,GAEjDE,KAAK,IACND,EAAE,KACAE,mBAAmB,GACpBI,aAAA,CAAClB,cAAc;IAACmB,EAAE,EAAC,OAAO;IAACC,OAAO,EAAGR;EAAI,GACtCC,KACa,CAAC,GAEjBK,aAAA,CAACf,WAAW;IACXa,SAAS,EAAC,gCAAgC;IAC1CI,OAAO,EAAGR;EAAI,GAEZC,KACU,CACb,CAAE,EACFA,KAAK,IACN,CAAED,EAAE,KACFE,mBAAmB,GACpBI,aAAA,CAAClB,cAAc;IAACmB,EAAE,EAAC;EAAO,GAAGN,KAAuB,CAAC,GAErDK,aAAA,CAACG,WAAW,QAAGR,KAAoB,CACnC,CAAE,EACFI,QACU,CAAC,EACZ,CAAC,CAAEF,IAAI,IACRG,aAAA,CAACd,UAAU;IACVQ,EAAE,EAAGA,EAAE,GAAGA,EAAE,GAAG,QAAQ,GAAGU,SAAW;IACrCN,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;AACA,OAAO,MAAMM,WAAW,GAAGA,CAAE;EAC5BL,SAAS;EACTC,QAAQ;EACR,GAAGP;AAC4D,CAAC,KAAM;EACtE,OACCQ,aAAA,CAACb,iBAAiB;IAAA,GACZK,KAAK;IACVM,SAAS,EAAGjB,UAAU,CACrB,gCAAgC,EAChCiB,SACD;EAAG,GAEDC,QACgB,CAAC;AAEtB,CAAC;AAED,OAAO,MAAMM,WAAW,GAAGC,MAAM,CAACC,MAAM,CACvCnB,wBAAwB,CAAEG,sBAAsB,EAAE,aAAc,CAAC,EACjE;EAAEY;AAAY,CACf,CAAC;AAED,eAAeE,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["clsx","VisuallyHidden","Wrapper","StyledField","StyledLabel","StyledHelp","StyledVisualLabel","contextConnectWithoutRef","useContextSystem","useBaseControlProps","UnconnectedBaseControl","props","__nextHasNoMarginBottom","id","label","hideLabelFromVision","help","className","children","createElement","as","htmlFor","VisualLabel","undefined","BaseControl","Object","assign"],"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":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SACCC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,iBAAiB,QACX,8BAA8B;AAErC,SAASC,wBAAwB,EAAEC,gBAAgB,QAAQ,YAAY;AAEvE,SAASC,mBAAmB,QAAQ,SAAS;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,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,GAAGV,gBAAgB,CAAEG,KAAK,EAAE,aAAc,CAAC;EAE5C,OACCQ,aAAA,CAACjB,OAAO;IAACe,SAAS,EAAGA;EAAW,GAC/BE,aAAA,CAAChB,WAAW;IACXc,SAAS,EAAC;IACV;IAAA;IACAL,uBAAuB,EAAGA;EAAyB,GAEjDE,KAAK,IACND,EAAE,KACAE,mBAAmB,GACpBI,aAAA,CAAClB,cAAc;IAACmB,EAAE,EAAC,OAAO;IAACC,OAAO,EAAGR;EAAI,GACtCC,KACa,CAAC,GAEjBK,aAAA,CAACf,WAAW;IACXa,SAAS,EAAC,gCAAgC;IAC1CI,OAAO,EAAGR;EAAI,GAEZC,KACU,CACb,CAAE,EACFA,KAAK,IACN,CAAED,EAAE,KACFE,mBAAmB,GACpBI,aAAA,CAAClB,cAAc;IAACmB,EAAE,EAAC;EAAO,GAAGN,KAAuB,CAAC,GAErDK,aAAA,CAACG,WAAW,QAAGR,KAAoB,CACnC,CAAE,EACFI,QACU,CAAC,EACZ,CAAC,CAAEF,IAAI,IACRG,aAAA,CAACd,UAAU;IACVQ,EAAE,EAAGA,EAAE,GAAGA,EAAE,GAAG,QAAQ,GAAGU,SAAW;IACrCN,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;AACA,OAAO,MAAMM,WAAW,GAAGA,CAAE;EAC5BL,SAAS;EACTC,QAAQ;EACR,GAAGP;AAC4D,CAAC,KAAM;EACtE,OACCQ,aAAA,CAACb,iBAAiB;IAAA,GACZK,KAAK;IACVM,SAAS,EAAGjB,IAAI,CAAE,gCAAgC,EAAEiB,SAAU;EAAG,GAE/DC,QACgB,CAAC;AAEtB,CAAC;AAED,OAAO,MAAMM,WAAW,GAAGC,MAAM,CAACC,MAAM,CACvCnB,wBAAwB,CAAEG,sBAAsB,EAAE,aAAc,CAAC,EACjE;EAAEY;AAAY,CACf,CAAC;AAED,eAAeE,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":[]}
@@ -2,7 +2,7 @@ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
@@ -110,7 +110,7 @@ export function UnforwardedButton(props, ref) {
110
110
  // Tooltip should not considered as a child
111
111
  children?.[0]?.props?.className !== 'components-tooltip';
112
112
  const truthyAriaPressedValues = [true, 'true', 'mixed'];
113
- const classes = classnames('components-button', className, {
113
+ const classes = clsx('components-button', className, {
114
114
  'is-next-40px-default-size': __next40pxDefaultSize,
115
115
  'is-secondary': variant === 'secondary',
116
116
  'is-primary': variant === 'primary',
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","deprecated","forwardRef","useInstanceId","Tooltip","Icon","VisuallyHidden","positionToPlacement","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","otherProps","computedSize","computedVariant","newProps","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","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","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","createElement","Fragment","element","tooltipProps","placement","id"],"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":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AASnC;AACA;AACA;AACA,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,aAAa,QAA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,IAAI;IAACkC,IAAI,EAAGA,IAAM;IAACtB,IAAI,EAAGwB;EAAU,CAAE,CAEvC,CACF;EAED,MAAM2C,OAAO,GACZhB,GAAG,KAAK,GAAG,GACVc,aAAA;IAAA,GACMX,WAAW;IAAA,GACTd,eAAe;IAAA,GACjBuB;EAAW,GAEdC,eACA,CAAC,GAEJC,aAAA;IAAA,GACMb,WAAW;IAAA,GACTZ,eAAe;IAAA,GACjBuB;EAAW,GAEdC,eACK,CACR;;EAEF;EACA;EACA;EACA;EACA,MAAMI,YAAY,GAAGT,iBAAiB,GACnC;IACA7B,IAAI,EACDD,QAAQ,EAA+B+B,MAAM,IAC/C3B,WAAW,GACRA,WAAW,GACXL,KAAK;IACTD,QAAQ;IACR0C,SAAS,EACR3C,eAAe;IACf;IACApC,mBAAmB,CAAEoC,eAAgB;EACtC,CAAC,GACD,CAAC,CAAC;EAEL,OACCuC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAAC9E,OAAO;IAAA,GAAMiF;EAAY,GAAKD,OAAkB,CAAC,EAChDlC,WAAW,IACZgC,aAAA,CAAC5E,cAAc,QACd4E,aAAA;IAAMK,EAAE,EAAGT;EAAe,GAAG5B,WAAmB,CACjC,CAEhB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,MAAM,GAAG1D,UAAU,CAAE6B,iBAAkB,CAAC;AACrD,eAAe6B,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["clsx","deprecated","forwardRef","useInstanceId","Tooltip","Icon","VisuallyHidden","positionToPlacement","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","otherProps","computedSize","computedVariant","newProps","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","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","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","createElement","Fragment","element","tooltipProps","placement","id"],"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":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AASvB;AACA;AACA;AACA,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,aAAa,QAAQ,oBAAoB;;AAElD;AACA;AACA;AACA,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,IAAI,MAAM,SAAS;AAC1B,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SAASC,mBAAmB,QAAQ,kBAAkB;AAEtD,MAAMC,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,IAA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KAAK;IACTD,QAAQ;IACR0C,SAAS,EACR3C,eAAe;IACf;IACApC,mBAAmB,CAAEoC,eAAgB;EACtC,CAAC,GACD,CAAC,CAAC;EAEL,OACCuC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAAC9E,OAAO;IAAA,GAAMiF;EAAY,GAAKD,OAAkB,CAAC,EAChDlC,WAAW,IACZgC,aAAA,CAAC5E,cAAc,QACd4E,aAAA;IAAMK,EAAE,EAAGT;EAAe,GAAG5B,WAAmB,CACjC,CAEhB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,MAAM,GAAG1D,UAAU,CAAE6B,iBAAkB,CAAC;AACrD,eAAe6B,MAAM","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
@@ -17,7 +17,7 @@ function UnforwardedButtonGroup(props, ref) {
17
17
  className,
18
18
  ...restProps
19
19
  } = props;
20
- const classes = classnames('components-button-group', className);
20
+ const classes = clsx('components-button-group', className);
21
21
  return createElement("div", {
22
22
  ref: ref,
23
23
  role: "group",
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","forwardRef","UnforwardedButtonGroup","props","ref","className","restProps","classes","createElement","role","ButtonGroup"],"sources":["@wordpress/components/src/button-group/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonGroupProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedButtonGroup(\n\tprops: WordPressComponentProps< ButtonGroupProps, 'div', false >,\n\tref: ForwardedRef< HTMLDivElement >\n) {\n\tconst { className, ...restProps } = props;\n\tconst classes = classnames( 'components-button-group', className );\n\n\treturn (\n\t\t<div ref={ ref } role=\"group\" className={ classes } { ...restProps } />\n\t);\n}\n\n/**\n * ButtonGroup can be used to group any related buttons together. To emphasize\n * related buttons, a group should share a common container.\n *\n * ```jsx\n * import { Button, ButtonGroup } from '@wordpress/components';\n *\n * const MyButtonGroup = () => (\n * <ButtonGroup>\n * <Button variant=\"primary\">Button 1</Button>\n * <Button variant=\"primary\">Button 2</Button>\n * </ButtonGroup>\n * );\n * ```\n */\nexport const ButtonGroup = forwardRef( UnforwardedButtonGroup );\n\nexport default ButtonGroup;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAGnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAIA,SAASC,sBAAsBA,CAC9BC,KAAgE,EAChEC,GAAmC,EAClC;EACD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EACzC,MAAMI,OAAO,GAAGP,UAAU,CAAE,yBAAyB,EAAEK,SAAU,CAAC;EAElE,OACCG,aAAA;IAAKJ,GAAG,EAAGA,GAAK;IAACK,IAAI,EAAC,OAAO;IAACJ,SAAS,EAAGE,OAAS;IAAA,GAAMD;EAAS,CAAI,CAAC;AAEzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,WAAW,GAAGT,UAAU,CAAEC,sBAAuB,CAAC;AAE/D,eAAeQ,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["clsx","forwardRef","UnforwardedButtonGroup","props","ref","className","restProps","classes","createElement","role","ButtonGroup"],"sources":["@wordpress/components/src/button-group/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonGroupProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedButtonGroup(\n\tprops: WordPressComponentProps< ButtonGroupProps, 'div', false >,\n\tref: ForwardedRef< HTMLDivElement >\n) {\n\tconst { className, ...restProps } = props;\n\tconst classes = clsx( 'components-button-group', className );\n\n\treturn (\n\t\t<div ref={ ref } role=\"group\" className={ classes } { ...restProps } />\n\t);\n}\n\n/**\n * ButtonGroup can be used to group any related buttons together. To emphasize\n * related buttons, a group should share a common container.\n *\n * ```jsx\n * import { Button, ButtonGroup } from '@wordpress/components';\n *\n * const MyButtonGroup = () => (\n * <ButtonGroup>\n * <Button variant=\"primary\">Button 1</Button>\n * <Button variant=\"primary\">Button 2</Button>\n * </ButtonGroup>\n * );\n * ```\n */\nexport const ButtonGroup = forwardRef( UnforwardedButtonGroup );\n\nexport default ButtonGroup;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAIA,SAASC,sBAAsBA,CAC9BC,KAAgE,EAChEC,GAAmC,EAClC;EACD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EACzC,MAAMI,OAAO,GAAGP,IAAI,CAAE,yBAAyB,EAAEK,SAAU,CAAC;EAE5D,OACCG,aAAA;IAAKJ,GAAG,EAAGA,GAAK;IAACK,IAAI,EAAC,OAAO;IAACJ,SAAS,EAAGE,OAAS;IAAA,GAAMD;EAAS,CAAI,CAAC;AAEzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,WAAW,GAAGT,UAAU,CAAEC,sBAAuB,CAAC;AAE/D,eAAeQ,WAAW","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
@@ -15,6 +15,7 @@ import { Icon, check, reset } from '@wordpress/icons';
15
15
  * Internal dependencies
16
16
  */
17
17
  import BaseControl from '../base-control';
18
+ import { HStack } from '../h-stack';
18
19
  /**
19
20
  * Checkboxes allow the user to select one or more items from a set.
20
21
  *
@@ -75,8 +76,14 @@ export function CheckboxControl(props) {
75
76
  __nextHasNoMarginBottom: __nextHasNoMarginBottom,
76
77
  label: heading,
77
78
  id: id,
78
- help: help,
79
- className: classnames('components-checkbox-control', className)
79
+ help: help && createElement("span", {
80
+ className: "components-checkbox-control__help"
81
+ }, help),
82
+ className: clsx('components-checkbox-control', className)
83
+ }, createElement(HStack, {
84
+ spacing: 0,
85
+ justify: "start",
86
+ alignment: "top"
80
87
  }, createElement("span", {
81
88
  className: "components-checkbox-control__input-container"
82
89
  }, createElement("input", {
@@ -100,7 +107,7 @@ export function CheckboxControl(props) {
100
107
  }) : null), label && createElement("label", {
101
108
  className: "components-checkbox-control__label",
102
109
  htmlFor: id
103
- }, label));
110
+ }, label)));
104
111
  }
105
112
  export default CheckboxControl;
106
113
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useState","useInstanceId","useRefEffect","deprecated","Icon","check","reset","BaseControl","CheckboxControl","props","__nextHasNoMarginBottom","label","className","heading","checked","indeterminate","help","id","idProp","onChange","additionalProps","alternative","since","showCheckedIcon","setShowCheckedIcon","showIndeterminateIcon","setShowIndeterminateIcon","ref","node","matches","onChangeValue","event","target","createElement","type","value","undefined","icon","role","htmlFor"],"sources":["@wordpress/components/src/checkbox-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useInstanceId, useRefEffect } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\nimport { Icon, check, reset } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport type { CheckboxControlProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\n/**\n * Checkboxes allow the user to select one or more items from a set.\n *\n * ```jsx\n * import { CheckboxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCheckboxControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <CheckboxControl\n * label=\"Is author\"\n * help=\"Is the user a author or not?\"\n * checked={ isChecked }\n * onChange={ setChecked }\n * />\n * );\n * };\n * ```\n */\nexport function CheckboxControl(\n\tprops: WordPressComponentProps< CheckboxControlProps, 'input', false >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom,\n\t\tlabel,\n\t\tclassName,\n\t\theading,\n\t\tchecked,\n\t\tindeterminate,\n\t\thelp,\n\t\tid: idProp,\n\t\tonChange,\n\t\t...additionalProps\n\t} = props;\n\n\tif ( heading ) {\n\t\tdeprecated( '`heading` prop in `CheckboxControl`', {\n\t\t\talternative: 'a separate element to implement a heading',\n\t\t\tsince: '5.8',\n\t\t} );\n\t}\n\n\tconst [ showCheckedIcon, setShowCheckedIcon ] = useState( false );\n\tconst [ showIndeterminateIcon, setShowIndeterminateIcon ] =\n\t\tuseState( false );\n\n\t// Run the following callback every time the `ref` (and the additional\n\t// dependencies) change.\n\tconst ref = useRefEffect< HTMLInputElement >(\n\t\t( node ) => {\n\t\t\tif ( ! node ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// It cannot be set using an HTML attribute.\n\t\t\tnode.indeterminate = !! indeterminate;\n\n\t\t\tsetShowCheckedIcon( node.matches( ':checked' ) );\n\t\t\tsetShowIndeterminateIcon( node.matches( ':indeterminate' ) );\n\t\t},\n\t\t[ checked, indeterminate ]\n\t);\n\tconst id = useInstanceId(\n\t\tCheckboxControl,\n\t\t'inspector-checkbox-control',\n\t\tidProp\n\t);\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.checked );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ heading }\n\t\t\tid={ id }\n\t\t\thelp={ help }\n\t\t\tclassName={ classnames( 'components-checkbox-control', className ) }\n\t\t>\n\t\t\t<span className=\"components-checkbox-control__input-container\">\n\t\t\t\t<input\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tid={ id }\n\t\t\t\t\tclassName=\"components-checkbox-control__input\"\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tvalue=\"1\"\n\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\tchecked={ checked }\n\t\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t/>\n\t\t\t\t{ showIndeterminateIcon ? (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ reset }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__indeterminate\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t\t{ showCheckedIcon ? (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__checked\"\n\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t/>\n\t\t\t\t) : null }\n\t\t\t</span>\n\t\t\t{ label && (\n\t\t\t\t<label\n\t\t\t\t\tclassName=\"components-checkbox-control__label\"\n\t\t\t\t\thtmlFor={ id }\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</label>\n\t\t\t) }\n\t\t</BaseControl>\n\t);\n}\n\nexport default CheckboxControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAGnC;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,aAAa,EAAEC,YAAY,QAAQ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DZ,QAAQ,CAAEY,KAAK,CAACC,MAAM,CAAClB,OAAQ,CAAC;EAEjC,OACCmB,aAAA,CAAC1B,WAAW;IACXG,uBAAuB,EAAGA,uBAAyB;IACnDC,KAAK,EAAGE,OAAS;IACjBI,EAAE,EAAGA,EAAI;IACTD,IAAI,EAAGA,IAAM;IACbJ,SAAS,EAAGb,UAAU,CAAE,6BAA6B,EAAEa,SAAU;EAAG,GAEpEqB,aAAA;IAAMrB,SAAS,EAAC;EAA8C,GAC7DqB,aAAA;IACCN,GAAG,EAAGA,GAAK;IACXV,EAAE,EAAGA,EAAI;IACTL,SAAS,EAAC,oCAAoC;IAC9CsB,IAAI,EAAC,UAAU;IACfC,KAAK,EAAC,GAAG;IACThB,QAAQ,EAAGW,aAAe;IAC1BhB,OAAO,EAAGA,OAAS;IACnB,oBAAmB,CAAC,CAAEE,IAAI,GAAGC,EAAE,GAAG,QAAQ,GAAGmB,SAAW;IAAA,GACnDhB;EAAe,CACpB,CAAC,EACAK,qBAAqB,GACtBQ,aAAA,CAAC7B,IAAI;IACJiC,IAAI,EAAG/B,KAAO;IACdM,SAAS,EAAC,4CAA4C;IACtD0B,IAAI,EAAC;EAAc,CACnB,CAAC,GACC,IAAI,EACNf,eAAe,GAChBU,aAAA,CAAC7B,IAAI;IACJiC,IAAI,EAAGhC,KAAO;IACdO,SAAS,EAAC,sCAAsC;IAChD0B,IAAI,EAAC;EAAc,CACnB,CAAC,GACC,IACC,CAAC,EACL3B,KAAK,IACNsB,aAAA;IACCrB,SAAS,EAAC,oCAAoC;IAC9C2B,OAAO,EAAGtB;EAAI,GAEZN,KACI,CAEI,CAAC;AAEhB;AAEA,eAAeH,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useState","useInstanceId","useRefEffect","deprecated","Icon","check","reset","BaseControl","HStack","CheckboxControl","props","__nextHasNoMarginBottom","label","className","heading","checked","indeterminate","help","id","idProp","onChange","additionalProps","alternative","since","showCheckedIcon","setShowCheckedIcon","showIndeterminateIcon","setShowIndeterminateIcon","ref","node","matches","onChangeValue","event","target","createElement","spacing","justify","alignment","type","value","undefined","icon","role","htmlFor"],"sources":["@wordpress/components/src/checkbox-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useInstanceId, useRefEffect } from '@wordpress/compose';\nimport deprecated from '@wordpress/deprecated';\nimport { Icon, check, reset } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '../base-control';\nimport { HStack } from '../h-stack';\nimport type { CheckboxControlProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\n/**\n * Checkboxes allow the user to select one or more items from a set.\n *\n * ```jsx\n * import { CheckboxControl } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyCheckboxControl = () => {\n * const [ isChecked, setChecked ] = useState( true );\n * return (\n * <CheckboxControl\n * label=\"Is author\"\n * help=\"Is the user a author or not?\"\n * checked={ isChecked }\n * onChange={ setChecked }\n * />\n * );\n * };\n * ```\n */\nexport function CheckboxControl(\n\tprops: WordPressComponentProps< CheckboxControlProps, 'input', false >\n) {\n\tconst {\n\t\t__nextHasNoMarginBottom,\n\t\tlabel,\n\t\tclassName,\n\t\theading,\n\t\tchecked,\n\t\tindeterminate,\n\t\thelp,\n\t\tid: idProp,\n\t\tonChange,\n\t\t...additionalProps\n\t} = props;\n\n\tif ( heading ) {\n\t\tdeprecated( '`heading` prop in `CheckboxControl`', {\n\t\t\talternative: 'a separate element to implement a heading',\n\t\t\tsince: '5.8',\n\t\t} );\n\t}\n\n\tconst [ showCheckedIcon, setShowCheckedIcon ] = useState( false );\n\tconst [ showIndeterminateIcon, setShowIndeterminateIcon ] =\n\t\tuseState( false );\n\n\t// Run the following callback every time the `ref` (and the additional\n\t// dependencies) change.\n\tconst ref = useRefEffect< HTMLInputElement >(\n\t\t( node ) => {\n\t\t\tif ( ! node ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// It cannot be set using an HTML attribute.\n\t\t\tnode.indeterminate = !! indeterminate;\n\n\t\t\tsetShowCheckedIcon( node.matches( ':checked' ) );\n\t\t\tsetShowIndeterminateIcon( node.matches( ':indeterminate' ) );\n\t\t},\n\t\t[ checked, indeterminate ]\n\t);\n\tconst id = useInstanceId(\n\t\tCheckboxControl,\n\t\t'inspector-checkbox-control',\n\t\tidProp\n\t);\n\tconst onChangeValue = ( event: ChangeEvent< HTMLInputElement > ) =>\n\t\tonChange( event.target.checked );\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\tlabel={ heading }\n\t\t\tid={ id }\n\t\t\thelp={\n\t\t\t\thelp && (\n\t\t\t\t\t<span className=\"components-checkbox-control__help\">\n\t\t\t\t\t\t{ help }\n\t\t\t\t\t</span>\n\t\t\t\t)\n\t\t\t}\n\t\t\tclassName={ clsx( 'components-checkbox-control', className ) }\n\t\t>\n\t\t\t<HStack spacing={ 0 } justify=\"start\" alignment=\"top\">\n\t\t\t\t<span className=\"components-checkbox-control__input-container\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tid={ id }\n\t\t\t\t\t\tclassName=\"components-checkbox-control__input\"\n\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\tvalue=\"1\"\n\t\t\t\t\t\tonChange={ onChangeValue }\n\t\t\t\t\t\tchecked={ checked }\n\t\t\t\t\t\taria-describedby={ !! help ? id + '__help' : undefined }\n\t\t\t\t\t\t{ ...additionalProps }\n\t\t\t\t\t/>\n\t\t\t\t\t{ showIndeterminateIcon ? (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ reset }\n\t\t\t\t\t\t\tclassName=\"components-checkbox-control__indeterminate\"\n\t\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null }\n\t\t\t\t\t{ showCheckedIcon ? (\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ check }\n\t\t\t\t\t\t\tclassName=\"components-checkbox-control__checked\"\n\t\t\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null }\n\t\t\t\t</span>\n\t\t\t\t{ label && (\n\t\t\t\t\t<label\n\t\t\t\t\t\tclassName=\"components-checkbox-control__label\"\n\t\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</label>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</BaseControl>\n\t);\n}\n\nexport default CheckboxControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,aAAa,EAAEC,YAAY,QAAQ,oBAAoB;AAChE,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,IAAI,EAAEC,KAAK,EAAEC,KAAK,QAAQ,kBAAkB;;AAErD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASC,MAAM,QAAQ,YAAY;AAInC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAC9BC,KAAsE,EACrE;EACD,MAAM;IACLC,uBAAuB;IACvBC,KAAK;IACLC,SAAS;IACTC,OAAO;IACPC,OAAO;IACPC,aAAa;IACbC,IAAI;IACJC,EAAE,EAAEC,MAAM;IACVC,QAAQ;IACR,GAAGC;EACJ,CAAC,GAAGX,KAAK;EAET,IAAKI,OAAO,EAAG;IACdX,UAAU,CAAE,qCAAqC,EAAE;MAClDmB,WAAW,EAAE,2CAA2C;MACxDC,KAAK,EAAE;IACR,CAAE,CAAC;EACJ;EAEA,MAAM,CAAEC,eAAe,EA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W,aAAe;IAC1BhB,OAAO,EAAGA,OAAS;IACnB,oBAAmB,CAAC,CAAEE,IAAI,GAAGC,EAAE,GAAG,QAAQ,GAAGsB,SAAW;IAAA,GACnDnB;EAAe,CACpB,CAAC,EACAK,qBAAqB,GACtBQ,aAAA,CAAC9B,IAAI;IACJqC,IAAI,EAAGnC,KAAO;IACdO,SAAS,EAAC,4CAA4C;IACtD6B,IAAI,EAAC;EAAc,CACnB,CAAC,GACC,IAAI,EACNlB,eAAe,GAChBU,aAAA,CAAC9B,IAAI;IACJqC,IAAI,EAAGpC,KAAO;IACdQ,SAAS,EAAC,sCAAsC;IAChD6B,IAAI,EAAC;EAAc,CACnB,CAAC,GACC,IACC,CAAC,EACL9B,KAAK,IACNsB,aAAA;IACCrB,SAAS,EAAC,oCAAoC;IAC9C8B,OAAO,EAAGzB;EAAI,GAEZN,KACI,CAED,CACI,CAAC;AAEhB;AAEA,eAAeH,eAAe","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -16,7 +16,7 @@ export function DropdownLinkAction({
16
16
  linkText
17
17
  }) {
18
18
  return createElement(Dropdown, {
19
- className: classnames('components-circular-option-picker__dropdown-link-action', className),
19
+ className: clsx('components-circular-option-picker__dropdown-link-action', className),
20
20
  renderToggle: ({
21
21
  isOpen,
22
22
  onToggle
@@ -36,7 +36,7 @@ export function ButtonAction({
36
36
  ...additionalProps
37
37
  }) {
38
38
  return createElement(Button, {
39
- className: classnames('components-circular-option-picker__clear', className),
39
+ className: clsx('components-circular-option-picker__clear', className),
40
40
  variant: "tertiary",
41
41
  ...additionalProps
42
42
  }, children);
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Button","Dropdown","DropdownLinkAction","buttonProps","className","dropdownProps","linkText","createElement","renderToggle","isOpen","onToggle","onClick","variant","ButtonAction","children","additionalProps"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-actions.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport type { DropdownLinkActionProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport function DropdownLinkAction( {\n\tbuttonProps,\n\tclassName,\n\tdropdownProps,\n\tlinkText,\n}: DropdownLinkActionProps ) {\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-circular-option-picker__dropdown-link-action',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t>\n\t\t\t\t\t{ linkText }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ ...dropdownProps }\n\t\t/>\n\t);\n}\n\nexport function ButtonAction( {\n\tclassName,\n\tchildren,\n\t...additionalProps\n}: WordPressComponentProps< ButtonAsButtonProps, 'button', false > ) {\n\treturn (\n\t\t<Button\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-circular-option-picker__clear',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tvariant=\"tertiary\"\n\t\t\t{ ...additionalProps }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,QAAQ,MAAM,aAAa;AAKlC,OAAO,SAASC,kBAAkBA,CAAE;EACnCC,WAAW;EACXC,SAAS;EACTC,aAAa;EACbC;AACwB,CAAC,EAAG;EAC5B,OACCC,aAAA,CAACN,QAAQ;IACRG,SAAS,EAAGL,UAAU,CACrB,yDAAyD,EACzDK,SACD,CAAG;IACHI,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,KACpCH,aAAA,CAACP,MAAM;MACN,iBAAgBS,MAAQ;MACxB,iBAAc,MAAM;MACpBE,OAAO,EAAGD,QAAU;MACpBE,OAAO,EAAC,MAAM;MAAA,GACTT;IAAW,GAEdG,QACK,CACN;IAAA,GACED;EAAa,CAClB,CAAC;AAEJ;AAEA,OAAO,SAASQ,YAAYA,CAAE;EAC7BT,SAAS;EACTU,QAAQ;EACR,GAAGC;AAC6D,CAAC,EAAG;EACpE,OACCR,aAAA,CAACP,MAAM;IACNI,SAAS,EAAGL,UAAU,CACrB,0CAA0C,EAC1CK,SACD,CAAG;IACHQ,OAAO,EAAC,UAAU;IAAA,GACbG;EAAe,GAElBD,QACK,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Button","Dropdown","DropdownLinkAction","buttonProps","className","dropdownProps","linkText","createElement","renderToggle","isOpen","onToggle","onClick","variant","ButtonAction","children","additionalProps"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-actions.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport Dropdown from '../dropdown';\nimport type { DropdownLinkActionProps } from './types';\nimport type { WordPressComponentProps } from '../context';\nimport type { ButtonAsButtonProps } from '../button/types';\n\nexport function DropdownLinkAction( {\n\tbuttonProps,\n\tclassName,\n\tdropdownProps,\n\tlinkText,\n}: DropdownLinkActionProps ) {\n\treturn (\n\t\t<Dropdown\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__dropdown-link-action',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t{ ...buttonProps }\n\t\t\t\t>\n\t\t\t\t\t{ linkText }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ ...dropdownProps }\n\t\t/>\n\t);\n}\n\nexport function ButtonAction( {\n\tclassName,\n\tchildren,\n\t...additionalProps\n}: WordPressComponentProps< ButtonAsButtonProps, 'button', false > ) {\n\treturn (\n\t\t<Button\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__clear',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tvariant=\"tertiary\"\n\t\t\t{ ...additionalProps }\n\t\t>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,QAAQ,MAAM,aAAa;AAKlC,OAAO,SAASC,kBAAkBA,CAAE;EACnCC,WAAW;EACXC,SAAS;EACTC,aAAa;EACbC;AACwB,CAAC,EAAG;EAC5B,OACCC,aAAA,CAACN,QAAQ;IACRG,SAAS,EAAGL,IAAI,CACf,yDAAyD,EACzDK,SACD,CAAG;IACHI,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,KACpCH,aAAA,CAACP,MAAM;MACN,iBAAgBS,MAAQ;MACxB,iBAAc,MAAM;MACpBE,OAAO,EAAGD,QAAU;MACpBE,OAAO,EAAC,MAAM;MAAA,GACTT;IAAW,GAEdG,QACK,CACN;IAAA,GACED;EAAa,CAClB,CAAC;AAEJ;AAEA,OAAO,SAASQ,YAAYA,CAAE;EAC7BT,SAAS;EACTU,QAAQ;EACR,GAAGC;AAC6D,CAAC,EAAG;EACpE,OACCR,aAAA,CAACP,MAAM;IACNI,SAAS,EAAGL,IAAI,CACf,0CAA0C,EAC1CK,SACD,CAAG;IACHQ,OAAO,EAAC,UAAU;IAAA,GACbG;EAAe,GAElBD,QACK,CAAC;AAEX","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -17,7 +17,7 @@ export function OptionGroup({
17
17
  return createElement("div", {
18
18
  ...additionalProps,
19
19
  role: role,
20
- className: classnames('components-circular-option-picker__option-group', 'components-circular-option-picker__swatches', className)
20
+ className: clsx('components-circular-option-picker__option-group', 'components-circular-option-picker__swatches', className)
21
21
  }, options);
22
22
  }
23
23
  //# sourceMappingURL=circular-option-picker-option-group.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","OptionGroup","className","options","additionalProps","role","undefined","createElement"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-option-group.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport type { OptionGroupProps } from './types';\n\nexport function OptionGroup( {\n\tclassName,\n\toptions,\n\t...additionalProps\n}: OptionGroupProps ) {\n\tconst role =\n\t\t'aria-label' in additionalProps || 'aria-labelledby' in additionalProps\n\t\t\t? 'group'\n\t\t\t: undefined;\n\n\treturn (\n\t\t<div\n\t\t\t{ ...additionalProps }\n\t\t\trole={ role }\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-circular-option-picker__option-group',\n\t\t\t\t'components-circular-option-picker__swatches',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ options }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;;AAGA,OAAO,SAASC,WAAWA,CAAE;EAC5BC,SAAS;EACTC,OAAO;EACP,GAAGC;AACc,CAAC,EAAG;EACrB,MAAMC,IAAI,GACT,YAAY,IAAID,eAAe,IAAI,iBAAiB,IAAIA,eAAe,GACpE,OAAO,GACPE,SAAS;EAEb,OACCC,aAAA;IAAA,GACMH,eAAe;IACpBC,IAAI,EAAGA,IAAM;IACbH,SAAS,EAAGF,UAAU,CACrB,iDAAiD,EACjD,6CAA6C,EAC7CE,SACD;EAAG,GAEDC,OACE,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["clsx","OptionGroup","className","options","additionalProps","role","undefined","createElement"],"sources":["@wordpress/components/src/circular-option-picker/circular-option-picker-option-group.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport type { OptionGroupProps } from './types';\n\nexport function OptionGroup( {\n\tclassName,\n\toptions,\n\t...additionalProps\n}: OptionGroupProps ) {\n\tconst role =\n\t\t'aria-label' in additionalProps || 'aria-labelledby' in additionalProps\n\t\t\t? 'group'\n\t\t\t: undefined;\n\n\treturn (\n\t\t<div\n\t\t\t{ ...additionalProps }\n\t\t\trole={ role }\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-circular-option-picker__option-group',\n\t\t\t\t'components-circular-option-picker__swatches',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ options }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;;AAGA,OAAO,SAASC,WAAWA,CAAE;EAC5BC,SAAS;EACTC,OAAO;EACP,GAAGC;AACc,CAAC,EAAG;EACrB,MAAMC,IAAI,GACT,YAAY,IAAID,eAAe,IAAI,iBAAiB,IAAIA,eAAe,GACpE,OAAO,GACPE,SAAS;EAEb,OACCC,aAAA;IAAA,GACMH,eAAe;IACpBC,IAAI,EAAGA,IAAM;IACbH,SAAS,EAAGF,IAAI,CACf,iDAAiD,EACjD,6CAA6C,EAC7CE,SACD;EAAG,GAEDC,OACE,CAAC;AAER","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
@@ -78,7 +78,7 @@ export function Option({
78
78
  isPressed: isSelected
79
79
  });
80
80
  return createElement("div", {
81
- className: classnames(className, 'components-circular-option-picker__option-wrapper')
81
+ className: clsx(className, 'components-circular-option-picker__option-wrapper')
82
82
  }, tooltipText ? createElement(Tooltip, {
83
83
  text: tooltipText
84
84
  }, optionControl) : optionControl, isSelected && createElement(Icon, {