@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":["_classnames","_interopRequireDefault","require","_element","_richText","_compose","_a11y","_i18n","_getDefaultUseItems","_button","_popover","_visuallyHidden","_reactDom","getAutoCompleterUI","autocompleter","useItems","getDefaultUseItems","AutocompleterUI","filterValue","instanceId","listBoxId","className","selectedIndex","onChangeOptions","onSelect","onReset","reset","contentRef","items","popoverAnchor","useAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","useState","popoverRef","useRef","popoverRefs","useMergeRefs","useRefEffect","node","ownerDocument","useOnClickOutside","debouncedSpeak","useDebounce","speak","announce","options","length","sprintf","_n","__","useLayoutEffect","ListBox","Component","_react","createElement","id","role","map","option","index","default","key","disabled","isDisabled","classnames","onClick","label","Fragment","focusOnMount","onClose","placement","anchor","ref","createPortal","VisuallyHidden","body","handler","useEffect","listener","event","contains","target","document","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useAnchor } from '@wordpress/rich-text';\nimport { useDebounce, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport getDefaultUseItems from './get-default-use-items';\nimport Button from '../button';\nimport Popover from '../popover';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { createPortal } from 'react-dom';\nimport type { AutocompleterUIProps, KeyedOption, WPCompleter } from './types';\n\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems = autocompleter.useItems\n\t\t? autocompleter.useItems\n\t\t: getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tinstanceId,\n\t\tlistBoxId,\n\t\tclassName,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tonReset,\n\t\treset,\n\t\tcontentRef,\n\t}: AutocompleterUIProps ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst popoverAnchor = useAnchor( {\n\t\t\teditableContentElement: contentRef.current,\n\t\t} );\n\n\t\tconst [ needsA11yCompat, setNeedsA11yCompat ] = useState( false );\n\t\tconst popoverRef = useRef< HTMLElement >( null );\n\t\tconst popoverRefs = useMergeRefs( [\n\t\t\tpopoverRef,\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tif ( ! contentRef.current ) return;\n\n\t\t\t\t\t// If the popover is rendered in a different document than\n\t\t\t\t\t// the content, we need to duplicate the options list in the\n\t\t\t\t\t// content document so that it's available to the screen\n\t\t\t\t\t// readers, which check the DOM ID based aira-* attributes.\n\t\t\t\t\tsetNeedsA11yCompat(\n\t\t\t\t\t\tnode.ownerDocument !== contentRef.current.ownerDocument\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t[ contentRef ]\n\t\t\t),\n\t\t] );\n\n\t\tuseOnClickOutside( popoverRef, reset );\n\n\t\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\t\tfunction announce( options: Array< KeyedOption > ) {\n\t\t\tif ( ! debouncedSpeak ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !! options.length ) {\n\t\t\t\tif ( filterValue ) {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t\t}\n\t\t}\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tannounce( items );\n\t\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [ items ] );\n\n\t\tif ( items.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst ListBox = ( {\n\t\t\tComponent = 'div',\n\t\t}: {\n\t\t\tComponent?: React.ElementType;\n\t\t} ) => (\n\t\t\t<Component\n\t\t\t\tid={ listBoxId }\n\t\t\t\trole=\"listbox\"\n\t\t\t\tclassName=\"components-autocomplete__results\"\n\t\t\t>\n\t\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ option.key }\n\t\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ option.label }\n\t\t\t\t\t</Button>\n\t\t\t\t) ) }\n\t\t\t</Component>\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tonClose={ onReset }\n\t\t\t\t\tplacement=\"top-start\"\n\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tref={ popoverRefs }\n\t\t\t\t>\n\t\t\t\t\t<ListBox />\n\t\t\t\t</Popover>\n\t\t\t\t{ contentRef.current &&\n\t\t\t\t\tneedsA11yCompat &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<ListBox Component={ VisuallyHidden } />,\n\t\t\t\t\t\tcontentRef.current.ownerDocument.body\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nfunction useOnClickOutside(\n\tref: React.RefObject< HTMLElement >,\n\thandler: AutocompleterUIProps[ 'reset' ]\n) {\n\tuseEffect( () => {\n\t\tconst listener = ( event: MouseEvent | TouchEvent ) => {\n\t\t\t// Do nothing if clicking ref's element or descendent elements, or if the ref is not referencing an element\n\t\t\tif (\n\t\t\t\t! ref.current ||\n\t\t\t\tref.current.contains( event.target as Node )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandler( event );\n\t\t};\n\t\tdocument.addEventListener( 'mousedown', listener );\n\t\tdocument.addEventListener( 'touchstart', listener );\n\t\treturn () => {\n\t\t\tdocument.removeEventListener( 'mousedown', listener );\n\t\t\tdocument.removeEventListener( 'touchstart', listener );\n\t\t};\n\t\t// Disable reason: `ref` is a ref object and should not be included in a\n\t\t// hook's dependency list.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ handler ] );\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,OAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,QAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAV,OAAA;AA1BA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;;AAQO,SAASW,kBAAkBA,CAAEC,aAA0B,EAAG;EAChE,MAAMC,QAAQ,GAAGD,aAAa,CAACC,QAAQ,GACpCD,aAAa,CAACC,QAAQ,GACtB,IAAAC,2BAAkB,EAAEF,aAAc,CAAC;EAEtC,SAASG,eAAeA,CAAE;IACzBC,WAAW;IACXC,UAAU;IACVC,SAAS;IACTC,SAAS;IACTC,aAAa;IACbC,eAAe;IACfC,QAAQ;IACRC,OAAO;IACPC,KAAK;IACLC;EACqB,CAAC,EAAG;IACzB,MAAM,CAAEC,KAAK,CAAE,GAAGb,QAAQ,CAAEG,WAAY,CAAC;IACzC,MAAMW,aAAa,GAAG,IAAAC,mBAAS,EAAE;MAChCC,sBAAsB,EAAEJ,UAAU,CAACK;IACpC,CAAE,CAAC;IA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AAO,MAAE,CACF,CAAC,EACR3B,UAAU,CAACK,OAAO,IACnBC,eAAe,IACf,IAAA2C,sBAAY,EACX,IAAApB,MAAA,CAAAC,aAAA,EAACH,OAAO;MAACC,SAAS,EAAGsB;IAAgB,CAAE,CAAC,EACxClD,UAAU,CAACK,OAAO,CAACU,aAAa,CAACoC,IAClC,CACA,CAAC;EAEL;EAEA,OAAO7D,eAAe;AACvB;AAEA,SAAS0B,iBAAiBA,CACzBgC,GAAmC,EACnCI,OAAwC,EACvC;EACD,IAAAC,kBAAS,EAAE,MAAM;IAChB,MAAMC,QAAQ,GAAKC,KAA8B,IAAM;MACtD;MACA,IACC,CAAEP,GAAG,CAAC3C,OAAO,IACb2C,GAAG,CAAC3C,OAAO,CAACmD,QAAQ,CAAED,KAAK,CAACE,MAAe,CAAC,EAC3C;QACD;MACD;MACAL,OAAO,CAAEG,KAAM,CAAC;IACjB,CAAC;IACDG,QAAQ,CAACC,gBAAgB,CAAE,WAAW,EAAEL,QAAS,CAAC;IAClDI,QAAQ,CAACC,gBAAgB,CAAE,YAAY,EAAEL,QAAS,CAAC;IACnD,OAAO,MAAM;MACZI,QAAQ,CAACE,mBAAmB,CAAE,WAAW,EAAEN,QAAS,CAAC;MACrDI,QAAQ,CAACE,mBAAmB,CAAE,YAAY,EAAEN,QAAS,CAAC;IACvD,CAAC;IACD;IACA;IACA;EACD,CAAC,EAAE,CAAEF,OAAO,CAAG,CAAC;AACjB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_richText","_compose","_a11y","_i18n","_getDefaultUseItems","_button","_popover","_visuallyHidden","_reactDom","getAutoCompleterUI","autocompleter","useItems","getDefaultUseItems","AutocompleterUI","filterValue","instanceId","listBoxId","className","selectedIndex","onChangeOptions","onSelect","onReset","reset","contentRef","items","popoverAnchor","useAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","useState","popoverRef","useRef","popoverRefs","useMergeRefs","useRefEffect","node","ownerDocument","useOnClickOutside","debouncedSpeak","useDebounce","speak","announce","options","length","sprintf","_n","__","useLayoutEffect","ListBox","Component","_react","createElement","id","role","map","option","index","default","key","disabled","isDisabled","clsx","onClick","label","Fragment","focusOnMount","onClose","placement","anchor","ref","createPortal","VisuallyHidden","body","handler","useEffect","listener","event","contains","target","document","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useAnchor } from '@wordpress/rich-text';\nimport { useDebounce, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport getDefaultUseItems from './get-default-use-items';\nimport Button from '../button';\nimport Popover from '../popover';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { createPortal } from 'react-dom';\nimport type { AutocompleterUIProps, KeyedOption, WPCompleter } from './types';\n\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems = autocompleter.useItems\n\t\t? autocompleter.useItems\n\t\t: getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tinstanceId,\n\t\tlistBoxId,\n\t\tclassName,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tonReset,\n\t\treset,\n\t\tcontentRef,\n\t}: AutocompleterUIProps ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst popoverAnchor = useAnchor( {\n\t\t\teditableContentElement: contentRef.current,\n\t\t} );\n\n\t\tconst [ needsA11yCompat, setNeedsA11yCompat ] = useState( false );\n\t\tconst popoverRef = useRef< HTMLElement >( null );\n\t\tconst popoverRefs = useMergeRefs( [\n\t\t\tpopoverRef,\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tif ( ! contentRef.current ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the popover is rendered in a different document than\n\t\t\t\t\t// the content, we need to duplicate the options list in the\n\t\t\t\t\t// content document so that it's available to the screen\n\t\t\t\t\t// readers, which check the DOM ID based aira-* attributes.\n\t\t\t\t\tsetNeedsA11yCompat(\n\t\t\t\t\t\tnode.ownerDocument !== contentRef.current.ownerDocument\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t[ contentRef ]\n\t\t\t),\n\t\t] );\n\n\t\tuseOnClickOutside( popoverRef, reset );\n\n\t\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\t\tfunction announce( options: Array< KeyedOption > ) {\n\t\t\tif ( ! debouncedSpeak ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !! options.length ) {\n\t\t\t\tif ( filterValue ) {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t\t}\n\t\t}\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tannounce( items );\n\t\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t}, [ items ] );\n\n\t\tif ( items.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst ListBox = ( {\n\t\t\tComponent = 'div',\n\t\t}: {\n\t\t\tComponent?: React.ElementType;\n\t\t} ) => (\n\t\t\t<Component\n\t\t\t\tid={ listBoxId }\n\t\t\t\trole=\"listbox\"\n\t\t\t\tclassName=\"components-autocomplete__results\"\n\t\t\t>\n\t\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ option.key }\n\t\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ option.label }\n\t\t\t\t\t</Button>\n\t\t\t\t) ) }\n\t\t\t</Component>\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tonClose={ onReset }\n\t\t\t\t\tplacement=\"top-start\"\n\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tref={ popoverRefs }\n\t\t\t\t>\n\t\t\t\t\t<ListBox />\n\t\t\t\t</Popover>\n\t\t\t\t{ contentRef.current &&\n\t\t\t\t\tneedsA11yCompat &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<ListBox Component={ VisuallyHidden } />,\n\t\t\t\t\t\tcontentRef.current.ownerDocument.body\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nfunction useOnClickOutside(\n\tref: React.RefObject< HTMLElement >,\n\thandler: AutocompleterUIProps[ 'reset' ]\n) {\n\tuseEffect( () => {\n\t\tconst listener = ( event: MouseEvent | TouchEvent ) => {\n\t\t\t// Do nothing if clicking ref's element or descendent elements, or if the ref is not referencing an element\n\t\t\tif (\n\t\t\t\t! ref.current ||\n\t\t\t\tref.current.contains( event.target as Node )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandler( event );\n\t\t};\n\t\tdocument.addEventListener( 'mousedown', listener );\n\t\tdocument.addEventListener( 'touchstart', listener );\n\t\treturn () => {\n\t\t\tdocument.removeEventListener( 'mousedown', listener );\n\t\t\tdocument.removeEventListener( 'touchstart', listener );\n\t\t};\n\t\t// Disable reason: `ref` is a ref object and should not be included in a\n\t\t// hook's dependency list.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ handler ] );\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,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AEG,KAAM,CAAC;IACjB,CAAC;IACDG,QAAQ,CAACC,gBAAgB,CAAE,WAAW,EAAEL,QAAS,CAAC;IAClDI,QAAQ,CAACC,gBAAgB,CAAE,YAAY,EAAEL,QAAS,CAAC;IACnD,OAAO,MAAM;MACZI,QAAQ,CAACE,mBAAmB,CAAE,WAAW,EAAEN,QAAS,CAAC;MACrDI,QAAQ,CAACE,mBAAmB,CAAE,YAAY,EAAEN,QAAS,CAAC;IACvD,CAAC;IACD;IACA;IACA;EACD,CAAC,EAAE,CAAEF,OAAO,CAAG,CAAC;AACjB","ignoreList":[]}
@@ -192,7 +192,9 @@ function useAutocomplete({
192
192
  }, [record]);
193
193
  (0, _element.useEffect)(() => {
194
194
  if (!textContent) {
195
- if (autocompleter) reset();
195
+ if (autocompleter) {
196
+ reset();
197
+ }
196
198
  return;
197
199
  }
198
200
 
@@ -204,7 +206,9 @@ function useAutocomplete({
204
206
  return triggerIndex > lastTriggerIndex ? currentCompleter : lastTrigger;
205
207
  }, null);
206
208
  if (!completer) {
207
- if (autocompleter) reset();
209
+ if (autocompleter) {
210
+ reset();
211
+ }
208
212
  return;
209
213
  }
210
214
  const {
@@ -219,7 +223,9 @@ function useAutocomplete({
219
223
  // significantly. This could happen, for example, if `matchingWhileBackspacing`
220
224
  // is true and one of the "words" end up being too long. If that's the case,
221
225
  // it will be caught by this guard.
222
- if (tooDistantFromTrigger) return;
226
+ if (tooDistantFromTrigger) {
227
+ return;
228
+ }
223
229
  const mismatch = filteredOptions.length === 0;
224
230
  const wordsFromTrigger = textWithoutTrigger.split(/\s/);
225
231
  // We need to allow the effect to run when not backspacing and if there
@@ -241,20 +247,28 @@ function useAutocomplete({
241
247
  // if the user presses backspace here, it will show the completion popup again.
242
248
  const matchingWhileBackspacing = backspacing.current && wordsFromTrigger.length <= 3;
243
249
  if (mismatch && !(matchingWhileBackspacing || hasOneTriggerWord)) {
244
- if (autocompleter) reset();
250
+ if (autocompleter) {
251
+ reset();
252
+ }
245
253
  return;
246
254
  }
247
255
  const textAfterSelection = (0, _richText.getTextContent)((0, _richText.slice)(record, undefined, (0, _richText.getTextContent)(record).length));
248
256
  if (allowContext && !allowContext(textContent.slice(0, triggerIndex), textAfterSelection)) {
249
- if (autocompleter) reset();
257
+ if (autocompleter) {
258
+ reset();
259
+ }
250
260
  return;
251
261
  }
252
262
  if (/^\s/.test(textWithoutTrigger) || /\s\s+$/.test(textWithoutTrigger)) {
253
- if (autocompleter) reset();
263
+ if (autocompleter) {
264
+ reset();
265
+ }
254
266
  return;
255
267
  }
256
268
  if (!/[\u0000-\uFFFF]*$/.test(textWithoutTrigger)) {
257
- if (autocompleter) reset();
269
+ if (autocompleter) {
270
+ reset();
271
+ }
258
272
  return;
259
273
  }
260
274
  const safeTrigger = (0, _strings.escapeRegExp)(completer.triggerPrefix);
@@ -1 +1 @@
1
- {"version":3,"names":["_removeAccents","_interopRequireDefault","require","_element","_compose","_richText","_a11y","_keycodes","_autocompleterUi","_strings","_withIgnoreImeEvents","getNodeText","node","toString","Array","map","join","props","children","EMPTY_FILTERED_OPTIONS","useAutocomplete","record","onChange","onReplace","completers","contentRef","instanceId","useInstanceId","selectedIndex","setSelectedIndex","useState","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacing","useRef","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","create","html","renderToString","insert","select","option","getOptionCompletion","isDisabled","completion","value","isCompletionObject","obj","action","undefined","completionObject","reset","onChangeOptions","options","handleKeyDown","event","current","key","defaultPrevented","newIndex","isAppleOS","speak","label","preventDefault","textContent","useMemo","isCollapsed","getTextContent","slice","useEffect","completer","reduce","lastTrigger","currentCompleter","triggerIndex","lastIndexOf","lastTriggerIndex","allowContext","textWithoutTrigger","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","textAfterSelection","test","safeTrigger","escapeRegExp","text","removeAccents","match","RegExp","query","getAutoCompleterUI","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","withIgnoreIMEEvents","popover","_react","createElement","onSelect","useLastDifferentValue","history","Set","add","size","delete","from","useAutocompleteProps","ref","onKeyDownRef","previousRecord","mergedRefs","useMergeRefs","useRefEffect","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":";;;;;;;;;;AAGA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAQA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAOA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,gBAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,oBAAA,GAAAR,OAAA;AAhCA;AACA;AACA;;AAGA;AACA;AACA;;AAoBA;AACA;AACA;;AAeA,MAAMS,WAAW,GAAKC,IAAqB,IAAc;EACxD,I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QAAQ,EAAEiG,OAAO;IACjB,mBAAmB,EAAEL,SAAS,GAAG,MAAM,GAAGjD,SAAS;IACnD,WAAW,EAAEiD,SAAS;IACtB,uBAAuB,EAAEC;EAC1B,CAAC;AACF;AAEe,SAAS2B,YAAYA,CAAE;EACrCxH,QAAQ;EACRyH,UAAU;EACV,GAAG1E;AACe,CAAC,EAAG;EACtB,MAAM;IAAEkD,OAAO;IAAE,GAAGlG;EAAM,CAAC,GAAGG,eAAe,CAAE6C,OAAQ,CAAC;EACxD,OACC,IAAAmD,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAwB,QAAA,QACG1H,QAAQ,CAAED,KAAM,CAAC,EACjB0H,UAAU,IAAIxB,OACf,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_removeAccents","_interopRequireDefault","require","_element","_compose","_richText","_a11y","_keycodes","_autocompleterUi","_strings","_withIgnoreImeEvents","getNodeText","node","toString","Array","map","join","props","children","EMPTY_FILTERED_OPTIONS","useAutocomplete","record","onChange","onReplace","completers","contentRef","instanceId","useInstanceId","selectedIndex","setSelectedIndex","useState","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacing","useRef","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","create","html","renderToString","insert","select","option","getOptionCompletion","isDisabled","completion","value","isCompletionObject","obj","action","undefined","completionObject","reset","onChangeOptions","options","handleKeyDown","event","current","key","defaultPrevented","newIndex","isAppleOS","speak","label","preventDefault","textContent","useMemo","isCollapsed","getTextContent","slice","useEffect","completer","reduce","lastTrigger","currentCompleter","triggerIndex","lastIndexOf","lastTriggerIndex","allowContext","textWithoutTrigger","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","textAfterSelection","test","safeTrigger","escapeRegExp","text","removeAccents","match","RegExp","query","getAutoCompleterUI","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","withIgnoreIMEEvents","popover","_react","createElement","onSelect","useLastDifferentValue","history","Set","add","size","delete","from","useAutocompleteProps","ref","onKeyDownRef","previousRecord","mergedRefs","useMergeRefs","useRefEffect","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":";;;;;;;;;;AAGA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAQA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAOA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,gBAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,oBAAA,GAAAR,OAAA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AI,KAAK4B,cAAc,EAAE5B,IAAI;EAEzD,IAAK,CAAEoC,YAAY,EAAG;IACrB,OAAO;MAAEV,GAAG,EAAEG;IAAW,CAAC;EAC3B;EAEA,OAAO;IACNH,GAAG,EAAEG,UAAU;IACfhH,QAAQ,EAAEiG,OAAO;IACjB,mBAAmB,EAAEL,SAAS,GAAG,MAAM,GAAGjD,SAAS;IACnD,WAAW,EAAEiD,SAAS;IACtB,uBAAuB,EAAEC;EAC1B,CAAC;AACF;AAEe,SAAS2B,YAAYA,CAAE;EACrCxH,QAAQ;EACRyH,UAAU;EACV,GAAG1E;AACe,CAAC,EAAG;EACtB,MAAM;IAAEkD,OAAO;IAAE,GAAGlG;EAAM,CAAC,GAAGG,eAAe,CAAE6C,OAAQ,CAAC;EACxD,OACC,IAAAmD,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAwB,QAAA,QACG1H,QAAQ,CAAED,KAAM,CAAC,EACjB0H,UAAU,IAAIxB,OACf,CAAC;AAEL","ignoreList":[]}
@@ -29,9 +29,6 @@ function useBaseControlProps(props) {
29
29
  ...restProps
30
30
  } = props;
31
31
  const uniqueId = (0, _compose.useInstanceId)(_.default, 'wp-components-base-control', preferredId);
32
-
33
- // ARIA descriptions can only contain plain text, so fall back to aria-details if not.
34
- const helpPropName = typeof help === 'string' ? 'aria-describedby' : 'aria-details';
35
32
  return {
36
33
  baseControlProps: {
37
34
  id: uniqueId,
@@ -41,7 +38,7 @@ function useBaseControlProps(props) {
41
38
  controlProps: {
42
39
  id: uniqueId,
43
40
  ...(!!help ? {
44
- [helpPropName]: `${uniqueId}__help`
41
+ 'aria-describedby': `${uniqueId}__help`
45
42
  } : {})
46
43
  }
47
44
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_","_interopRequireDefault","useBaseControlProps","props","help","id","preferredId","restProps","uniqueId","useInstanceId","BaseControl","helpPropName","baseControlProps","controlProps"],"sources":["@wordpress/components/src/base-control/hooks.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '.';\nimport type { BaseControlProps } from './types';\n\n/**\n * Generate props for the `BaseControl` and the inner control itself.\n *\n * Namely, it takes care of generating a unique `id`, properly associating it with the `label` and `help` elements.\n *\n * @param props\n */\nexport function useBaseControlProps(\n\tprops: Omit< BaseControlProps, 'children' >\n) {\n\tconst { help, id: preferredId, ...restProps } = props;\n\n\tconst uniqueId = useInstanceId(\n\t\tBaseControl,\n\t\t'wp-components-base-control',\n\t\tpreferredId\n\t);\n\n\t// ARIA descriptions can only contain plain text, so fall back to aria-details if not.\n\tconst helpPropName =\n\t\ttypeof help === 'string' ? 'aria-describedby' : 'aria-details';\n\n\treturn {\n\t\tbaseControlProps: {\n\t\t\tid: uniqueId,\n\t\t\thelp,\n\t\t\t...restProps,\n\t\t},\n\t\tcontrolProps: {\n\t\t\tid: uniqueId,\n\t\t\t...( !! help ? { [ helpPropName ]: `${ uniqueId }__help` } : {} ),\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,CAAA,GAAAC,sBAAA,CAAAF,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,mBAAmBA,CAClCC,KAA2C,EAC1C;EACD,MAAM;IAAEC,IAAI;IAAEC,EAAE,EAAEC,WAAW;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAErD,MAAMK,QAAQ,GAAG,IAAAC,sBAAa,EAC7BC,SAAW,EACX,4BAA4B,EAC5BJ,WACD,CAAC;;EAED;EACA,MAAMK,YAAY,GACjB,OAAOP,IAAI,KAAK,QAAQ,GAAG,kBAAkB,GAAG,cAAc;EAE/D,OAAO;IACNQ,gBAAgB,EAAE;MACjBP,EAAE,EAAEG,QAAQ;MACZJ,IAAI;MACJ,GAAGG;IACJ,CAAC;IACDM,YAAY,EAAE;MACbR,EAAE,EAAEG,QAAQ;MACZ,IAAK,CAAC,CAAEJ,IAAI,GAAG;QAAE,CAAEO,YAAY,GAAK,GAAGH,QAAU;MAAQ,CAAC,GAAG,CAAC,CAAC;IAChE;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_","_interopRequireDefault","useBaseControlProps","props","help","id","preferredId","restProps","uniqueId","useInstanceId","BaseControl","baseControlProps","controlProps"],"sources":["@wordpress/components/src/base-control/hooks.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BaseControl from '.';\nimport type { BaseControlProps } from './types';\n\n/**\n * Generate props for the `BaseControl` and the inner control itself.\n *\n * Namely, it takes care of generating a unique `id`, properly associating it with the `label` and `help` elements.\n *\n * @param props\n */\nexport function useBaseControlProps(\n\tprops: Omit< BaseControlProps, 'children' >\n) {\n\tconst { help, id: preferredId, ...restProps } = props;\n\n\tconst uniqueId = useInstanceId(\n\t\tBaseControl,\n\t\t'wp-components-base-control',\n\t\tpreferredId\n\t);\n\n\treturn {\n\t\tbaseControlProps: {\n\t\t\tid: uniqueId,\n\t\t\thelp,\n\t\t\t...restProps,\n\t\t},\n\t\tcontrolProps: {\n\t\t\tid: uniqueId,\n\t\t\t...( !! help ? { 'aria-describedby': `${ uniqueId }__help` } : {} ),\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,CAAA,GAAAC,sBAAA,CAAAF,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,mBAAmBA,CAClCC,KAA2C,EAC1C;EACD,MAAM;IAAEC,IAAI;IAAEC,EAAE,EAAEC,WAAW;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAErD,MAAMK,QAAQ,GAAG,IAAAC,sBAAa,EAC7BC,SAAW,EACX,4BAA4B,EAC5BJ,WACD,CAAC;EAED,OAAO;IACNK,gBAAgB,EAAE;MACjBN,EAAE,EAAEG,QAAQ;MACZJ,IAAI;MACJ,GAAGG;IACJ,CAAC;IACDK,YAAY,EAAE;MACbP,EAAE,EAAEG,QAAQ;MACZ,IAAK,CAAC,CAAEJ,IAAI,GAAG;QAAE,kBAAkB,EAAG,GAAGI,QAAU;MAAQ,CAAC,GAAG,CAAC,CAAC;IAClE;EACD,CAAC;AACF","ignoreList":[]}
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "useBaseControlProps", {
12
12
  }
13
13
  });
14
14
  var _react = require("react");
15
- var _classnames = _interopRequireDefault(require("classnames"));
15
+ var _clsx = _interopRequireDefault(require("clsx"));
16
16
  var _visuallyHidden = require("../visually-hidden");
17
17
  var _baseControlStyles = require("./styles/base-control-styles");
18
18
  var _context = require("../context");
@@ -104,7 +104,7 @@ const VisualLabel = ({
104
104
  }) => {
105
105
  return (0, _react.createElement)(_baseControlStyles.StyledVisualLabel, {
106
106
  ...props,
107
- className: (0, _classnames.default)('components-base-control__label', className)
107
+ className: (0, _clsx.default)('components-base-control__label', className)
108
108
  }, children);
109
109
  };
110
110
  exports.VisualLabel = VisualLabel;
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_visuallyHidden","_baseControlStyles","_context","_hooks","UnconnectedBaseControl","props","__nextHasNoMarginBottom","id","label","hideLabelFromVision","help","className","children","useContextSystem","_react","createElement","Wrapper","StyledField","VisuallyHidden","as","htmlFor","StyledLabel","VisualLabel","StyledHelp","undefined","StyledVisualLabel","classnames","exports","BaseControl","Object","assign","contextConnectWithoutRef","_default","default"],"sources":["@wordpress/components/src/base-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { BaseControlProps, BaseControlVisualLabelProps } from './types';\nimport {\n\tWrapper,\n\tStyledField,\n\tStyledLabel,\n\tStyledHelp,\n\tStyledVisualLabel,\n} from './styles/base-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\n\nexport { useBaseControlProps } from './hooks';\n\n/**\n * `BaseControl` is a component used to generate labels and help text for components handling user inputs.\n *\n * ```jsx\n * import { BaseControl, useBaseControlProps } from '@wordpress/components';\n *\n * // Render a `BaseControl` for a textarea input\n * const MyCustomTextareaControl = ({ children, ...baseProps }) => (\n * \t// `useBaseControlProps` is a convenience hook to get the props for the `BaseControl`\n * \t// and the inner control itself. Namely, it takes care of generating a unique `id`,\n * \t// properly associating it with the `label` and `help` elements.\n * \tconst { baseControlProps, controlProps } = useBaseControlProps( baseProps );\n *\n * \treturn (\n * \t\t<BaseControl { ...baseControlProps } __nextHasNoMarginBottom={ true }>\n * \t\t\t<textarea { ...controlProps }>\n * \t\t\t { children }\n * \t\t\t</textarea>\n * \t\t</BaseControl>\n * \t);\n * );\n * ```\n */\nconst UnconnectedBaseControl = (\n\tprops: WordPressComponentProps< BaseControlProps, null >\n) => {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tid,\n\t\tlabel,\n\t\thideLabelFromVision = false,\n\t\thelp,\n\t\tclassName,\n\t\tchildren,\n\t} = useContextSystem( props, 'BaseControl' );\n\n\treturn (\n\t\t<Wrapper className={ className }>\n\t\t\t<StyledField\n\t\t\t\tclassName=\"components-base-control__field\"\n\t\t\t\t// TODO: Official deprecation for this should start after all internal usages have been migrated\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t>\n\t\t\t\t{ label &&\n\t\t\t\t\tid &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\" htmlFor={ id }>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<StyledLabel\n\t\t\t\t\t\t\tclassName=\"components-base-control__label\"\n\t\t\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</StyledLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ label &&\n\t\t\t\t\t! id &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<VisualLabel>{ label }</VisualLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ children }\n\t\t\t</StyledField>\n\t\t\t{ !! help && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\tid={ id ? id + '__help' : undefined }\n\t\t\t\t\tclassName=\"components-base-control__help\"\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t>\n\t\t\t\t\t{ help }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n};\n\n/**\n * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.\n *\n * It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled,\n * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would\n * otherwise use if the `label` prop was passed.\n *\n * @example\n * import { BaseControl } from '@wordpress/components';\n *\n * const MyBaseControl = () => (\n * \t<BaseControl help=\"This button is already accessibly labeled.\">\n * \t\t<BaseControl.VisualLabel>Author</BaseControl.VisualLabel>\n * \t\t<Button>Select an author</Button>\n * \t</BaseControl>\n * );\n */\nexport const VisualLabel = ( {\n\tclassName,\n\tchildren,\n\t...props\n}: WordPressComponentProps< BaseControlVisualLabelProps, 'span' > ) => {\n\treturn (\n\t\t<StyledVisualLabel\n\t\t\t{ ...props }\n\t\t\tclassName={ classnames(\n\t\t\t\t'components-base-control__label',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledVisualLabel>\n\t);\n};\n\nexport const BaseControl = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedBaseControl, 'BaseControl' ),\n\t{ VisualLabel }\n);\n\nexport default BaseControl;\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AAQA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,sBAAsB,GAC3BC,KAAwD,IACpD;EACJ,MAAM;IACLC,uBAAuB,GAAG,KAAK;IAC/BC,EAAE;IACFC,KAAK;IACLC,mBAAmB,GAAG,KAAK;IAC3BC,IAAI;IACJC,SAAS;IACTC;EACD,CAAC,GAAG,IAAAC,yBAAgB,EAAER,KAAK,EAAE,aAAc,CAAC;EAE5C,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAe,OAAO;IAACL,SAAS,EAAGA;EAAW,GAC/B,IAAAG,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAgB,WAAW;IACXN,SAAS,EAAC;IACV;IAAA;IACAL,uBAAuB,EAAGA;EAAyB,GAEjDE,KAAK,IACND,EAAE,KACAE,mBAAmB,GACpB,IAAAK,MAAA,CAAAC,aAAA,EAACf,eAAA,CAAAkB,cAAc;IAACC,EAAE,EAAC,OAAO;IAACC,OAAO,EAAGb;EAAI,GACtCC,KACa,CAAC,GAEjB,IAAAM,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAoB,WAAW;IACXV,SAAS,EAAC,gCAAgC;IAC1CS,OAAO,EAAGb;EAAI,GAEZC,KACU,CACb,CAAE,EACFA,KAAK,IACN,CAAED,EAAE,KACFE,mBAAmB,GACpB,IAAAK,MAAA,CAAAC,aAAA,EAACf,eAAA,CAAAkB,cAAc;IAACC,EAAE,EAAC;EAAO,GAAGX,KAAuB,CAAC,GAErD,IAAAM,MAAA,CAAAC,aAAA,EAACO,WAAW,QAAGd,KAAoB,CACnC,CAAE,EACFI,QACU,CAAC,EACZ,CAAC,CAAEF,IAAI,IACR,IAAAI,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAsB,UAAU;IACVhB,EAAE,EAAGA,EAAE,GAAGA,EAAE,GAAG,QAAQ,GAAGiB,SAAW;IACrCb,SAAS,EAAC,+BAA+B;IACzCL,uBAAuB,EAAGA;EAAyB,GAEjDI,IACS,CAEL,CAAC;AAEZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMY,WAAW,GAAGA,CAAE;EAC5BX,SAAS;EACTC,QAAQ;EACR,GAAGP;AAC4D,CAAC,KAAM;EACtE,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAwB,iBAAiB;IAAA,GACZpB,KAAK;IACVM,SAAS,EAAG,IAAAe,mBAAU,EACrB,gCAAgC,EAChCf,SACD;EAAG,GAEDC,QACgB,CAAC;AAEtB,CAAC;AAACe,OAAA,CAAAL,WAAA,GAAAA,WAAA;AAEK,MAAMM,WAAW,GAAAD,OAAA,CAAAC,WAAA,GAAGC,MAAM,CAACC,MAAM,CACvC,IAAAC,iCAAwB,EAAE3B,sBAAsB,EAAE,aAAc,CAAC,EACjE;EAAEkB;AAAY,CACf,CAAC;AAAC,IAAAU,QAAA,GAAAL,OAAA,CAAAM,OAAA,GAEaL,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_visuallyHidden","_baseControlStyles","_context","_hooks","UnconnectedBaseControl","props","__nextHasNoMarginBottom","id","label","hideLabelFromVision","help","className","children","useContextSystem","_react","createElement","Wrapper","StyledField","VisuallyHidden","as","htmlFor","StyledLabel","VisualLabel","StyledHelp","undefined","StyledVisualLabel","clsx","exports","BaseControl","Object","assign","contextConnectWithoutRef","_default","default"],"sources":["@wordpress/components/src/base-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { BaseControlProps, BaseControlVisualLabelProps } from './types';\nimport {\n\tWrapper,\n\tStyledField,\n\tStyledLabel,\n\tStyledHelp,\n\tStyledVisualLabel,\n} from './styles/base-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\n\nexport { useBaseControlProps } from './hooks';\n\n/**\n * `BaseControl` is a component used to generate labels and help text for components handling user inputs.\n *\n * ```jsx\n * import { BaseControl, useBaseControlProps } from '@wordpress/components';\n *\n * // Render a `BaseControl` for a textarea input\n * const MyCustomTextareaControl = ({ children, ...baseProps }) => (\n * \t// `useBaseControlProps` is a convenience hook to get the props for the `BaseControl`\n * \t// and the inner control itself. Namely, it takes care of generating a unique `id`,\n * \t// properly associating it with the `label` and `help` elements.\n * \tconst { baseControlProps, controlProps } = useBaseControlProps( baseProps );\n *\n * \treturn (\n * \t\t<BaseControl { ...baseControlProps } __nextHasNoMarginBottom={ true }>\n * \t\t\t<textarea { ...controlProps }>\n * \t\t\t { children }\n * \t\t\t</textarea>\n * \t\t</BaseControl>\n * \t);\n * );\n * ```\n */\nconst UnconnectedBaseControl = (\n\tprops: WordPressComponentProps< BaseControlProps, null >\n) => {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tid,\n\t\tlabel,\n\t\thideLabelFromVision = false,\n\t\thelp,\n\t\tclassName,\n\t\tchildren,\n\t} = useContextSystem( props, 'BaseControl' );\n\n\treturn (\n\t\t<Wrapper className={ className }>\n\t\t\t<StyledField\n\t\t\t\tclassName=\"components-base-control__field\"\n\t\t\t\t// TODO: Official deprecation for this should start after all internal usages have been migrated\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t>\n\t\t\t\t{ label &&\n\t\t\t\t\tid &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\" htmlFor={ id }>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<StyledLabel\n\t\t\t\t\t\t\tclassName=\"components-base-control__label\"\n\t\t\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</StyledLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ label &&\n\t\t\t\t\t! id &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<VisualLabel>{ label }</VisualLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ children }\n\t\t\t</StyledField>\n\t\t\t{ !! help && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\tid={ id ? id + '__help' : undefined }\n\t\t\t\t\tclassName=\"components-base-control__help\"\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t>\n\t\t\t\t\t{ help }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n};\n\n/**\n * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.\n *\n * It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled,\n * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would\n * otherwise use if the `label` prop was passed.\n *\n * @example\n * import { BaseControl } from '@wordpress/components';\n *\n * const MyBaseControl = () => (\n * \t<BaseControl help=\"This button is already accessibly labeled.\">\n * \t\t<BaseControl.VisualLabel>Author</BaseControl.VisualLabel>\n * \t\t<Button>Select an author</Button>\n * \t</BaseControl>\n * );\n */\nexport const VisualLabel = ( {\n\tclassName,\n\tchildren,\n\t...props\n}: WordPressComponentProps< BaseControlVisualLabelProps, 'span' > ) => {\n\treturn (\n\t\t<StyledVisualLabel\n\t\t\t{ ...props }\n\t\t\tclassName={ clsx( 'components-base-control__label', className ) }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledVisualLabel>\n\t);\n};\n\nexport const BaseControl = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedBaseControl, 'BaseControl' ),\n\t{ VisualLabel }\n);\n\nexport default BaseControl;\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AAQA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,sBAAsB,GAC3BC,KAAwD,IACpD;EACJ,MAAM;IACLC,uBAAuB,GAAG,KAAK;IAC/BC,EAAE;IACFC,KAAK;IACLC,mBAAmB,GAAG,KAAK;IAC3BC,IAAI;IACJC,SAAS;IACTC;EACD,CAAC,GAAG,IAAAC,yBAAgB,EAAER,KAAK,EAAE,aAAc,CAAC;EAE5C,OACC,IAAAS,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAe,OAAO;IAACL,SAAS,EAAGA;EAAW,GAC/B,IAAAG,MAAA,CAAAC,aAAA,EAACd,kBAAA,CAAAgB,WAAW;IACXN,SAAS,EAAC;IACV;IAAA;IACAL,uBAAuB,EAAGA;EAAyB,GAEjDE,KAAK,IACND,EAAE,KACAE,mBAAmB,GACpB,IAAAK,MAAA,CAAAC,aAAA,EAACf,eAAA,CAAAkB,cA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AAY,CACf,CAAC;AAAC,IAAAU,QAAA,GAAAL,OAAA,CAAAM,OAAA,GAEaL,WAAW","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/base-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type BaseControlProps = {\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * The HTML `id` of the control element (passed in as a child to `BaseControl`) to which labels and help text are being generated.\n\t * This is necessary to accessibly associate the label with that element.\n\t *\n\t * The recommended way is to use the `useBaseControlProps` hook, which takes care of generating a unique `id` for you.\n\t * Otherwise, if you choose to pass an explicit `id` to this prop, you are responsible for ensuring the uniqueness of the `id`.\n\t */\n\tid?: string;\n\t/**\n\t * Additional description for the control.\n\t *\n\t * It is preferable to use plain text for `help`, as it can be accessibly associated with the control using `aria-describedby`.\n\t * When the `help` contains links, or otherwise non-plain text content, it will be associated with the control using `aria-details`.\n\t */\n\thelp?: ReactNode;\n\t/**\n\t * If this property is added, a label will be generated using label property as the content.\n\t */\n\tlabel?: ReactNode;\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default false\n\t */\n\thideLabelFromVision?: boolean;\n\tclassName?: string;\n\t/**\n\t * The content to be displayed within the `BaseControl`.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type BaseControlVisualLabelProps = {\n\tchildren: ReactNode;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/base-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type BaseControlProps = {\n\t/**\n\t * Start opting into the new margin-free styles that will become the default in a future version.\n\t *\n\t * @default false\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * The HTML `id` of the control element (passed in as a child to `BaseControl`) to which labels and help text are being generated.\n\t * This is necessary to accessibly associate the label with that element.\n\t *\n\t * The recommended way is to use the `useBaseControlProps` hook, which takes care of generating a unique `id` for you.\n\t * Otherwise, if you choose to pass an explicit `id` to this prop, you are responsible for ensuring the uniqueness of the `id`.\n\t */\n\tid?: string;\n\t/**\n\t * Additional description for the control.\n\t *\n\t * The element containing the description will be programmatically associated to the BaseControl by the means of an `aria-describedby` attribute.\n\t */\n\thelp?: ReactNode;\n\t/**\n\t * If this property is added, a label will be generated using label property as the content.\n\t */\n\tlabel?: ReactNode;\n\t/**\n\t * If true, the label will only be visible to screen readers.\n\t *\n\t * @default false\n\t */\n\thideLabelFromVision?: boolean;\n\tclassName?: string;\n\t/**\n\t * The content to be displayed within the `BaseControl`.\n\t */\n\tchildren: ReactNode;\n};\n\nexport type BaseControlVisualLabelProps = {\n\tchildren: ReactNode;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/border-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ColorPaletteProps } from '../color-palette/types';\nimport type { PopoverProps } from '../popover/types';\nimport type { ToggleGroupControlProps } from '../toggle-group-control/types';\n\nexport type Border = {\n\tcolor?: CSSProperties[ 'borderColor' ];\n\tstyle?: CSSProperties[ 'borderStyle' ];\n\twidth?: CSSProperties[ 'borderWidth' ];\n};\n\nexport type ColorProps = Pick<\n\tColorPaletteProps,\n\t'colors' | 'enableAlpha' | '__experimentalIsRenderedInSidebar'\n> & {\n\t/**\n\t * This toggles the ability to choose custom colors.\n\t */\n\tdisableCustomColors?: boolean;\n};\n\nexport type LabelProps = {\n\t/**\n\t * Provides control over whether the label will only be visible to\n\t * screen readers.\n\t */\n\thideLabelFromVision?: boolean;\n\t/**\n\t * If provided, a label will be generated using this as the content.\n\t */\n\tlabel?: string;\n};\n\nexport type BorderControlProps = ColorProps &\n\tLabelProps & {\n\t\t/**\n\t\t * This controls whether unit selection should be disabled.\n\t\t */\n\t\tdisableUnits?: boolean;\n\t\t/**\n\t\t * This controls whether to support border style selection.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tenableStyle?: boolean;\n\t\t/**\n\t\t * This flags the `BorderControl` to render with a more compact\n\t\t * appearance. It restricts the width of the control and prevents it\n\t\t * from expanding to take up additional space.\n\t\t */\n\t\tisCompact?: boolean;\n\t\t/**\n\t\t * A callback function invoked when the border value is changed via an\n\t\t * interaction that selects or clears, border color, style, or width.\n\t\t */\n\t\tonChange: ( value?: Border ) => void;\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * If opted into, sanitizing the border means that if no width or color\n\t\t * have been selected, the border style is also cleared and `undefined`\n\t\t * is returned as the new border value.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tshouldSanitizeBorder?: boolean;\n\t\t/**\n\t\t * Whether or not to show the header for the border color and style\n\t\t * picker dropdown. The header includes a label for the color picker\n\t\t * and a close button.\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t\t/**\n\t\t * Size of the control.\n\t\t *\n\t\t * @default 'default'\n\t\t */\n\t\tsize?: 'default' | '__unstable-large';\n\t\t/**\n\t\t * An object representing a border or `undefined`. Used to set the\n\t\t * current border configuration for this component.\n\t\t */\n\t\tvalue?: Border;\n\t\t/**\n\t\t * Controls the visual width of the `BorderControl`. It has no effect if\n\t\t * the `isCompact` prop is set to `true`.\n\t\t */\n\t\twidth?: CSSProperties[ 'width' ];\n\t\t/**\n\t\t * Flags whether this `BorderControl` should also render a\n\t\t * `RangeControl` for additional control over a border's width.\n\t\t */\n\t\twithSlider?: boolean;\n\t\t/**\n\t\t * Start opting into the larger default height that will become the default size in a future version.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\t__next40pxDefaultSize?: boolean;\n\t};\n\nexport type DropdownProps = ColorProps &\n\tPick< BorderControlProps, 'enableStyle' | 'size' > & {\n\t\t/**\n\t\t * An object representing a border or `undefined`. This component will\n\t\t * extract the border color and style selections from this object to use as\n\t\t * values for its popover controls.\n\t\t */\n\t\tborder?: Border;\n\t\t/**\n\t\t * Whether a border style can be set, based on the border sanitization settings.\n\t\t */\n\t\tisStyleSettable: boolean;\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * A callback invoked when the border color or style selections change.\n\t\t */\n\t\tonChange: ( newBorder?: Border ) => void;\n\t\t/**\n\t\t * Any previous style selection made by the user. This can be used to\n\t\t * reapply that previous selection when, for example, a zero border width is\n\t\t * to a non-zero value.\n\t\t */\n\t\tpreviousStyleSelection?: string;\n\t\t/**\n\t\t * Whether or not to render a header for the border color and style picker\n\t\t * dropdown. The header includes a label for the color picker and a\n\t\t * close button.\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t};\n\nexport type StylePickerProps = Omit<\n\tToggleGroupControlProps,\n\t'value' | 'onChange' | 'children'\n> & {\n\t/**\n\t * A callback function invoked when a border style is selected or cleared.\n\t */\n\tonChange: ( style?: string ) => void;\n\t/**\n\t * The currently selected border style if there is one. Styles available via\n\t * this control are `solid`, `dashed` & `dotted`, however the possibility\n\t * to store other valid CSS values is maintained e.g. `none`, `inherit` etc.\n\t */\n\tvalue?: string;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/border-control/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { CSSProperties } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { ColorPaletteProps } from '../color-palette/types';\nimport type { PopoverProps } from '../popover/types';\nimport type { ToggleGroupControlProps } from '../toggle-group-control/types';\n\nexport type Border = {\n\tcolor?: CSSProperties[ 'borderColor' ];\n\tstyle?: CSSProperties[ 'borderStyle' ];\n\twidth?: CSSProperties[ 'borderWidth' ];\n};\n\nexport type ColorProps = Pick<\n\tColorPaletteProps,\n\t'colors' | 'enableAlpha' | '__experimentalIsRenderedInSidebar'\n> & {\n\t/**\n\t * This toggles the ability to choose custom colors.\n\t */\n\tdisableCustomColors?: boolean;\n};\n\nexport type LabelProps = {\n\t/**\n\t * Provides control over whether the label will only be visible to\n\t * screen readers.\n\t */\n\thideLabelFromVision?: boolean;\n\t/**\n\t * If provided, a label will be generated using this as the content.\n\t */\n\tlabel?: string;\n};\n\nexport type BorderControlProps = ColorProps &\n\tLabelProps & {\n\t\t/**\n\t\t * This controls whether unit selection should be disabled.\n\t\t */\n\t\tdisableUnits?: boolean;\n\t\t/**\n\t\t * This controls whether to support border style selection.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tenableStyle?: boolean;\n\t\t/**\n\t\t * This flags the `BorderControl` to render with a more compact\n\t\t * appearance. It restricts the width of the control and prevents it\n\t\t * from expanding to take up additional space.\n\t\t */\n\t\tisCompact?: boolean;\n\t\t/**\n\t\t * A callback function invoked when the border value is changed via an\n\t\t * interaction that selects or clears, border color, style, or width.\n\t\t */\n\t\tonChange: ( value?: Border ) => void;\n\t\t/**\n\t\t * Placeholder text for the number input.\n\t\t */\n\t\tplaceholder?: HTMLInputElement[ 'placeholder' ];\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * If opted into, sanitizing the border means that if no width or color\n\t\t * have been selected, the border style is also cleared and `undefined`\n\t\t * is returned as the new border value.\n\t\t *\n\t\t * @default true\n\t\t */\n\t\tshouldSanitizeBorder?: boolean;\n\t\t/**\n\t\t * Whether or not to show the header for the border color and style\n\t\t * picker dropdown. The header includes a label for the color picker\n\t\t * and a close button.\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t\t/**\n\t\t * Size of the control.\n\t\t *\n\t\t * @default 'default'\n\t\t */\n\t\tsize?: 'default' | '__unstable-large';\n\t\t/**\n\t\t * An object representing a border or `undefined`. Used to set the\n\t\t * current border configuration for this component.\n\t\t */\n\t\tvalue?: Border;\n\t\t/**\n\t\t * Controls the visual width of the `BorderControl`. It has no effect if\n\t\t * the `isCompact` prop is set to `true`.\n\t\t */\n\t\twidth?: CSSProperties[ 'width' ];\n\t\t/**\n\t\t * Flags whether this `BorderControl` should also render a\n\t\t * `RangeControl` for additional control over a border's width.\n\t\t */\n\t\twithSlider?: boolean;\n\t\t/**\n\t\t * Start opting into the larger default height that will become the default size in a future version.\n\t\t *\n\t\t * @default false\n\t\t */\n\t\t__next40pxDefaultSize?: boolean;\n\t};\n\nexport type DropdownProps = ColorProps &\n\tPick< BorderControlProps, 'enableStyle' | 'size' > & {\n\t\t/**\n\t\t * An object representing a border or `undefined`. This component will\n\t\t * extract the border color and style selections from this object to use as\n\t\t * values for its popover controls.\n\t\t */\n\t\tborder?: Border;\n\t\t/**\n\t\t * Whether a border style can be set, based on the border sanitization settings.\n\t\t */\n\t\tisStyleSettable: boolean;\n\t\t/**\n\t\t * An internal prop used to control the visibility of the dropdown.\n\t\t */\n\t\t__unstablePopoverProps?: Omit< PopoverProps, 'children' >;\n\t\t/**\n\t\t * A callback invoked when the border color or style selections change.\n\t\t */\n\t\tonChange: ( newBorder?: Border ) => void;\n\t\t/**\n\t\t * Any previous style selection made by the user. This can be used to\n\t\t * reapply that previous selection when, for example, a zero border width is\n\t\t * to a non-zero value.\n\t\t */\n\t\tpreviousStyleSelection?: string;\n\t\t/**\n\t\t * Whether or not to render a header for the border color and style picker\n\t\t * dropdown. The header includes a label for the color picker and a\n\t\t * close button.\n\t\t */\n\t\tshowDropdownHeader?: boolean;\n\t};\n\nexport type StylePickerProps = Omit<\n\tToggleGroupControlProps,\n\t'value' | 'onChange' | 'children'\n> & {\n\t/**\n\t * A callback function invoked when a border style is selected or cleared.\n\t */\n\tonChange: ( style?: string ) => void;\n\t/**\n\t * The currently selected border style if there is one. Styles available via\n\t * this control are `solid`, `dashed` & `dotted`, however the possibility\n\t * to store other valid CSS values is maintained e.g. `none`, `inherit` etc.\n\t */\n\tvalue?: string;\n};\n"],"mappings":"","ignoreList":[]}
@@ -8,7 +8,7 @@ exports.Button = void 0;
8
8
  exports.UnforwardedButton = UnforwardedButton;
9
9
  exports.default = void 0;
10
10
  var _react = require("react");
11
- var _classnames = _interopRequireDefault(require("classnames"));
11
+ var _clsx = _interopRequireDefault(require("clsx"));
12
12
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
13
13
  var _element = require("@wordpress/element");
14
14
  var _compose = require("@wordpress/compose");
@@ -121,7 +121,7 @@ function UnforwardedButton(props, ref) {
121
121
  // Tooltip should not considered as a child
122
122
  children?.[0]?.props?.className !== 'components-tooltip';
123
123
  const truthyAriaPressedValues = [true, 'true', 'mixed'];
124
- const classes = (0, _classnames.default)('components-button', className, {
124
+ const classes = (0, _clsx.default)('components-button', className, {
125
125
  'is-next-40px-default-size': __next40pxDefaultSize,
126
126
  'is-secondary': variant === 'secondary',
127
127
  'is-primary': variant === 'primary',
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_deprecated","_element","_compose","_tooltip","_icon","_visuallyHidden","_utils","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","otherProps","computedSize","computedVariant","newProps","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","deprecated","since","alternative","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","buttonOrAnchorProps","href","target","ariaChecked","ariaPressed","ariaSelected","additionalProps","undefined","instanceId","useInstanceId","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","classnames","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","_react","createElement","Fragment","default","element","tooltipProps","placement","positionToPlacement","VisuallyHidden","id","exports","forwardRef","_default"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\nimport { positionToPlacement } from '../popover/utils';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisPressed,\n\tisSmall,\n\tsize,\n\tvariant,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tconst newProps: { 'aria-pressed'?: boolean } = {\n\t\t// @todo Mark `isPressed` as deprecated\n\t\t'aria-pressed': isPressed,\n\t};\n\n\tif ( isSmall ) {\n\t\tcomputedSize ??= 'small';\n\t}\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'wp.components.Button `isDefault` prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...newProps,\n\t\t...otherProps,\n\t\tsize: computedSize,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function UnforwardedButton(\n\tprops: ButtonProps & DeprecatedButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\tsize = 'default',\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...buttonOrAnchorProps\n\t} = useDeprecatedProps( props );\n\n\tconst {\n\t\thref,\n\t\ttarget,\n\t\t'aria-checked': ariaChecked,\n\t\t'aria-pressed': ariaPressed,\n\t\t'aria-selected': ariaSelected,\n\t\t...additionalProps\n\t} = 'href' in buttonOrAnchorProps\n\t\t? buttonOrAnchorProps\n\t\t: { href: undefined, target: undefined, ...buttonOrAnchorProps };\n\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst hasChildren =\n\t\t( 'string' === typeof children && !! children ) ||\n\t\t( Array.isArray( children ) &&\n\t\t\tchildren?.[ 0 ] &&\n\t\t\tchildren[ 0 ] !== null &&\n\t\t\t// Tooltip should not considered as a child\n\t\t\tchildren?.[ 0 ]?.props?.className !== 'components-tooltip' );\n\n\tconst truthyAriaPressedValues: ( typeof ariaPressed )[] = [\n\t\ttrue,\n\t\t'true',\n\t\t'mixed',\n\t];\n\n\tconst classes = classnames( 'components-button', className, {\n\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': size === 'small',\n\t\t'is-compact': size === 'compact',\n\t\t'is-tertiary': variant === 'tertiary',\n\n\t\t'is-pressed': truthyAriaPressedValues.includes( ariaPressed ),\n\t\t'is-pressed-mixed': ariaPressed === 'mixed',\n\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && ( hasChildren || text ),\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst buttonProps: ComponentPropsWithoutRef< 'button' > =\n\t\tTag === 'button'\n\t\t\t? {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-checked': ariaChecked,\n\t\t\t\t\t'aria-pressed': ariaPressed,\n\t\t\t\t\t'aria-selected': ariaSelected,\n\t\t\t }\n\t\t\t: {};\n\tconst anchorProps: ComponentPropsWithoutRef< 'a' > =\n\t\tTag === 'a' ? { href, target } : {};\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\tbuttonProps[ 'aria-disabled' ] = true;\n\t\tanchorProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event: MouseEvent ) => {\n\t\t\t\tif ( event ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && !! label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\t!! shortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t! ( children as string | ReactElement[] )?.length &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : undefined;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst commonProps = {\n\t\tclassName: classes,\n\t\t'aria-label': additionalProps[ 'aria-label' ] || label,\n\t\t'aria-describedby': describedById,\n\t\tref,\n\t};\n\n\tconst elementChildren = (\n\t\t<>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ children }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t</>\n\t);\n\n\tconst element =\n\t\tTag === 'a' ? (\n\t\t\t<a\n\t\t\t\t{ ...anchorProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLAnchorElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\t{ ...buttonProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLButtonElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</button>\n\t\t);\n\n\t// In order to avoid some React reconciliation issues, we are always rendering\n\t// the `Tooltip` component even when `shouldShowTooltip` is `false`.\n\t// In order to make sure that the tooltip doesn't show when it shouldn't,\n\t// we don't pass the props to the `Tooltip` component.\n\tconst tooltipProps = shouldShowTooltip\n\t\t? {\n\t\t\t\ttext:\n\t\t\t\t\t( children as string | ReactElement[] )?.length &&\n\t\t\t\t\tdescribedBy\n\t\t\t\t\t\t? describedBy\n\t\t\t\t\t\t: label,\n\t\t\t\tshortcut,\n\t\t\t\tplacement:\n\t\t\t\t\ttooltipPosition &&\n\t\t\t\t\t// Convert legacy `position` values to be used with the new `placement` prop\n\t\t\t\t\tpositionToPlacement( tooltipPosition ),\n\t\t }\n\t\t: {};\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip { ...tooltipProps }>{ element }</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef( UnforwardedButton );\nexport default Button;\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAYA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AA1BA;AACA;AACA;;AAUA;AACA;AACA;;AAKA;AACA;AACA;;AAOA,MAAMQ,8BAA8B,GAAG,CAAE,aAAa,EAAE,SAAS,CAAW;AAE5E,SAASC,kBAAkBA,CAAE;EAC5BC,SAAS;EACTC,SAAS;EACTC,WAAW;EACXC,UAAU;EACVC,MAAM;EACNC,SAAS;EACTC,OAAO;EACPC,IAAI;EACJC,OAAO;EACP,GAAGC;AACiC,CAAC,EAAgB;EACrD,IAAIC,YAAY,GAAGH,IAAI;EACvB,IAAII,eAAe,GAAGH,OAAO;EAE7B,MAAMI,QAAsC,GAAG;IAC9C;IACA,cAAc,EAAEP;EACjB,CAAC;EAED,IAAKC,OAAO,EAAG;IAAA,IAAAO,aAAA;IACd,CAAAA,aAAA,GAAAH,YAAY,cAA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A,WAAW,GACXL,KAAK;IACTD,QAAQ;IACR8C,SAAS,EACR/C,eAAe;IACf;IACA,IAAAgD,0BAAmB,EAAEhD,eAAgB;EACtC,CAAC,GACD,CAAC,CAAC;EAEL,OACC,IAAAyC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAAClF,QAAA,CAAAoF,OAAO;IAAA,GAAME;EAAY,GAAKD,OAAkB,CAAC,EAChDtC,WAAW,IACZ,IAAAkC,MAAA,CAAAC,aAAA,EAAChF,eAAA,CAAAuF,cAAc,QACd,IAAAR,MAAA,CAAAC,aAAA;IAAMQ,EAAE,EAAGb;EAAe,GAAG9B,WAAmB,CACjC,CAEhB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMW,MAAM,GAAAiC,OAAA,CAAAjC,MAAA,GAAG,IAAAkC,mBAAU,EAAEhE,iBAAkB,CAAC;AAAC,IAAAiE,QAAA,GAAAF,OAAA,CAAAP,OAAA,GACvC1B,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_deprecated","_element","_compose","_tooltip","_icon","_visuallyHidden","_utils","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","otherProps","computedSize","computedVariant","newProps","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","deprecated","since","alternative","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","buttonOrAnchorProps","href","target","ariaChecked","ariaPressed","ariaSelected","additionalProps","undefined","instanceId","useInstanceId","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","clsx","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","_react","createElement","Fragment","default","element","tooltipProps","placement","positionToPlacement","VisuallyHidden","id","exports","forwardRef","_default"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\nimport { positionToPlacement } from '../popover/utils';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisPressed,\n\tisSmall,\n\tsize,\n\tvariant,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tconst newProps: { 'aria-pressed'?: boolean } = {\n\t\t// @todo Mark `isPressed` as deprecated\n\t\t'aria-pressed': isPressed,\n\t};\n\n\tif ( isSmall ) {\n\t\tcomputedSize ??= 'small';\n\t}\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'wp.components.Button `isDefault` prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...newProps,\n\t\t...otherProps,\n\t\tsize: computedSize,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function UnforwardedButton(\n\tprops: ButtonProps & DeprecatedButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\tsize = 'default',\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...buttonOrAnchorProps\n\t} = useDeprecatedProps( props );\n\n\tconst {\n\t\thref,\n\t\ttarget,\n\t\t'aria-checked': ariaChecked,\n\t\t'aria-pressed': ariaPressed,\n\t\t'aria-selected': ariaSelected,\n\t\t...additionalProps\n\t} = 'href' in buttonOrAnchorProps\n\t\t? buttonOrAnchorProps\n\t\t: { href: undefined, target: undefined, ...buttonOrAnchorProps };\n\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst hasChildren =\n\t\t( 'string' === typeof children && !! children ) ||\n\t\t( Array.isArray( children ) &&\n\t\t\tchildren?.[ 0 ] &&\n\t\t\tchildren[ 0 ] !== null &&\n\t\t\t// Tooltip should not considered as a child\n\t\t\tchildren?.[ 0 ]?.props?.className !== 'components-tooltip' );\n\n\tconst truthyAriaPressedValues: ( typeof ariaPressed )[] = [\n\t\ttrue,\n\t\t'true',\n\t\t'mixed',\n\t];\n\n\tconst classes = clsx( 'components-button', className, {\n\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': size === 'small',\n\t\t'is-compact': size === 'compact',\n\t\t'is-tertiary': variant === 'tertiary',\n\n\t\t'is-pressed': truthyAriaPressedValues.includes( ariaPressed ),\n\t\t'is-pressed-mixed': ariaPressed === 'mixed',\n\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && ( hasChildren || text ),\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst buttonProps: ComponentPropsWithoutRef< 'button' > =\n\t\tTag === 'button'\n\t\t\t? {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-checked': ariaChecked,\n\t\t\t\t\t'aria-pressed': ariaPressed,\n\t\t\t\t\t'aria-selected': ariaSelected,\n\t\t\t }\n\t\t\t: {};\n\tconst anchorProps: ComponentPropsWithoutRef< 'a' > =\n\t\tTag === 'a' ? { href, target } : {};\n\n\tif ( disabled && isFocusable ) {\n\t\t// In this case, the button will be disabled, but still focusable and\n\t\t// perceivable by screen reader users.\n\t\tbuttonProps[ 'aria-disabled' ] = true;\n\t\tanchorProps[ 'aria-disabled' ] = true;\n\n\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tadditionalProps[ disabledEvent ] = ( event: MouseEvent ) => {\n\t\t\t\tif ( event ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n\n\t// Should show the tooltip if...\n\tconst shouldShowTooltip =\n\t\t! trulyDisabled &&\n\t\t// An explicit tooltip is passed or...\n\t\t( ( showTooltip && !! label ) ||\n\t\t\t// There's a shortcut or...\n\t\t\t!! shortcut ||\n\t\t\t// There's a label and...\n\t\t\t( !! label &&\n\t\t\t\t// The children are empty and...\n\t\t\t\t! ( children as string | ReactElement[] )?.length &&\n\t\t\t\t// The tooltip is not explicitly disabled.\n\t\t\t\tfalse !== showTooltip ) );\n\n\tconst descriptionId = describedBy ? instanceId : undefined;\n\n\tconst describedById =\n\t\tadditionalProps[ 'aria-describedby' ] || descriptionId;\n\n\tconst commonProps = {\n\t\tclassName: classes,\n\t\t'aria-label': additionalProps[ 'aria-label' ] || label,\n\t\t'aria-describedby': describedById,\n\t\tref,\n\t};\n\n\tconst elementChildren = (\n\t\t<>\n\t\t\t{ icon && iconPosition === 'left' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t\t{ text && <>{ text }</> }\n\t\t\t{ children }\n\t\t\t{ icon && iconPosition === 'right' && (\n\t\t\t\t<Icon icon={ icon } size={ iconSize } />\n\t\t\t) }\n\t\t</>\n\t);\n\n\tconst element =\n\t\tTag === 'a' ? (\n\t\t\t<a\n\t\t\t\t{ ...anchorProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLAnchorElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</a>\n\t\t) : (\n\t\t\t<button\n\t\t\t\t{ ...buttonProps }\n\t\t\t\t{ ...( additionalProps as HTMLAttributes< HTMLButtonElement > ) }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</button>\n\t\t);\n\n\t// In order to avoid some React reconciliation issues, we are always rendering\n\t// the `Tooltip` component even when `shouldShowTooltip` is `false`.\n\t// In order to make sure that the tooltip doesn't show when it shouldn't,\n\t// we don't pass the props to the `Tooltip` component.\n\tconst tooltipProps = shouldShowTooltip\n\t\t? {\n\t\t\t\ttext:\n\t\t\t\t\t( children as string | ReactElement[] )?.length &&\n\t\t\t\t\tdescribedBy\n\t\t\t\t\t\t? describedBy\n\t\t\t\t\t\t: label,\n\t\t\t\tshortcut,\n\t\t\t\tplacement:\n\t\t\t\t\ttooltipPosition &&\n\t\t\t\t\t// Convert legacy `position` values to be used with the new `placement` prop\n\t\t\t\t\tpositionToPlacement( tooltipPosition ),\n\t\t }\n\t\t: {};\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip { ...tooltipProps }>{ element }</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef( UnforwardedButton );\nexport default Button;\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAYA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,KAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AA1BA;AACA;AACA;;AAUA;AACA;AACA;;AAKA;AACA;AACA;;AAOA,MAAMQ,8BAA8B,GAAG,CAAE,aAAa,EAAE,SAAS,CAAW;AAE5E,SAASC,kBAAkBA,CAAE;EAC5BC,SAAS;EACTC,SAAS;EACTC,WAAW;EACXC,UAAU;EACVC,MAAM;EACNC,SAAS;EACTC,OAAO;EACPC,IAAI;EACJC,OAAO;EACP,GAAGC;AACiC,CAAC,EAAgB;EACrD,IAAIC,YAAY,GAAGH,IAAI;EACvB,IAAII,eAAe,GAAGH,OAAO;EAE7B,MAAMI,QAAsC,GAAG;IAC9C;IACA,cAAc,EAAEP;EACjB,CAAC;EAED,IAAKC,OA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IACA/B,IAAI,EACDD,QAAQ,EAA+BiC,MAAM,IAC/C7B,WAAW,GACRA,WAAW,GACXL,KAAK;IACTD,QAAQ;IACR8C,SAAS,EACR/C,eAAe;IACf;IACA,IAAAgD,0BAAmB,EAAEhD,eAAgB;EACtC,CAAC,GACD,CAAC,CAAC;EAEL,OACC,IAAAyC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAAClF,QAAA,CAAAoF,OAAO;IAAA,GAAME;EAAY,GAAKD,OAAkB,CAAC,EAChDtC,WAAW,IACZ,IAAAkC,MAAA,CAAAC,aAAA,EAAChF,eAAA,CAAAuF,cAAc,QACd,IAAAR,MAAA,CAAAC,aAAA;IAAMQ,EAAE,EAAGb;EAAe,GAAG9B,WAAmB,CACjC,CAEhB,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMW,MAAM,GAAAiC,OAAA,CAAAjC,MAAA,GAAG,IAAAkC,mBAAU,EAAEhE,iBAAkB,CAAC;AAAC,IAAAiE,QAAA,GAAAF,OAAA,CAAAP,OAAA,GACvC1B,MAAM","ignoreList":[]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = exports.ButtonGroup = void 0;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _element = require("@wordpress/element");
11
11
  /**
12
12
  * External dependencies
@@ -25,7 +25,7 @@ function UnforwardedButtonGroup(props, ref) {
25
25
  className,
26
26
  ...restProps
27
27
  } = props;
28
- const classes = (0, _classnames.default)('components-button-group', className);
28
+ const classes = (0, _clsx.default)('components-button-group', className);
29
29
  return (0, _react.createElement)("div", {
30
30
  ref: ref,
31
31
  role: "group",
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_element","UnforwardedButtonGroup","props","ref","className","restProps","classes","classnames","_react","createElement","role","ButtonGroup","exports","forwardRef","_default","default"],"sources":["@wordpress/components/src/button-group/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { ButtonGroupProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nfunction UnforwardedButtonGroup(\n\tprops: WordPressComponentProps< ButtonGroupProps, 'div', false >,\n\tref: ForwardedRef< HTMLDivElement >\n) {\n\tconst { className, ...restProps } = props;\n\tconst classes = classnames( 'components-button-group', className );\n\n\treturn (\n\t\t<div ref={ ref } role=\"group\" className={ classes } { ...restProps } />\n\t);\n}\n\n/**\n * ButtonGroup can be used to group any related buttons together. To emphasize\n * related buttons, a group should share a common container.\n *\n * ```jsx\n * import { Button, ButtonGroup } from '@wordpress/components';\n *\n * const MyButtonGroup = () => (\n * <ButtonGroup>\n * <Button variant=\"primary\">Button 1</Button>\n * <Button variant=\"primary\">Button 2</Button>\n * </ButtonGroup>\n * );\n * ```\n */\nexport const ButtonGroup = forwardRef( UnforwardedButtonGroup );\n\nexport default ButtonGroup;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;;AAIA,SAASE,sBAAsBA,CAC9BC,KAAgE,EAChEC,GAAmC,EAClC;EACD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EACzC,MAAMI,OAAO,GAAG,IAAAC,mBAAU,EAAE,yBAAyB,EAAEH,SAAU,CAAC;EAElE,OACC,IAAAI,MAAA,CAAAC,aAAA;IAAKN,GAAG,EAAGA,GAAK;IAACO,IAAI,EAAC,OAAO;IAACN,SAAS,EAAGE,OAAS;IAAA,GAAMD;EAAS,CAAI,CAAC;AAEzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAAE,mBAAU,EAAEZ,sBAAuB,CAAC;AAAC,IAAAa,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEjDJ,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","UnforwardedButtonGroup","props","ref","className","restProps","classes","clsx","_react","createElement","role","ButtonGroup","exports","forwardRef","_default","default"],"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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;;AAIA,SAASE,sBAAsBA,CAC9BC,KAAgE,EAChEC,GAAmC,EAClC;EACD,MAAM;IAAEC,SAAS;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EACzC,MAAMI,OAAO,GAAG,IAAAC,aAAI,EAAE,yBAAyB,EAAEH,SAAU,CAAC;EAE5D,OACC,IAAAI,MAAA,CAAAC,aAAA;IAAKN,GAAG,EAAGA,GAAK;IAACO,IAAI,EAAC,OAAO;IAACN,SAAS,EAAGE,OAAS;IAAA,GAAMD;EAAS,CAAI,CAAC;AAEzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAAE,mBAAU,EAAEZ,sBAAuB,CAAC;AAAC,IAAAa,QAAA,GAAAF,OAAA,CAAAG,OAAA,GAEjDJ,WAAW","ignoreList":[]}
@@ -7,12 +7,13 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.CheckboxControl = CheckboxControl;
8
8
  exports.default = void 0;
9
9
  var _react = require("react");
10
- var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _clsx = _interopRequireDefault(require("clsx"));
11
11
  var _element = require("@wordpress/element");
12
12
  var _compose = require("@wordpress/compose");
13
13
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
14
14
  var _icons = require("@wordpress/icons");
15
15
  var _baseControl = _interopRequireDefault(require("../base-control"));
16
+ var _hStack = require("../h-stack");
16
17
  /**
17
18
  * External dependencies
18
19
  */
@@ -85,8 +86,14 @@ function CheckboxControl(props) {
85
86
  __nextHasNoMarginBottom: __nextHasNoMarginBottom,
86
87
  label: heading,
87
88
  id: id,
88
- help: help,
89
- className: (0, _classnames.default)('components-checkbox-control', className)
89
+ help: help && (0, _react.createElement)("span", {
90
+ className: "components-checkbox-control__help"
91
+ }, help),
92
+ className: (0, _clsx.default)('components-checkbox-control', className)
93
+ }, (0, _react.createElement)(_hStack.HStack, {
94
+ spacing: 0,
95
+ justify: "start",
96
+ alignment: "top"
90
97
  }, (0, _react.createElement)("span", {
91
98
  className: "components-checkbox-control__input-container"
92
99
  }, (0, _react.createElement)("input", {
@@ -110,7 +117,7 @@ function CheckboxControl(props) {
110
117
  }) : null), label && (0, _react.createElement)("label", {
111
118
  className: "components-checkbox-control__label",
112
119
  htmlFor: id
113
- }, label));
120
+ }, label)));
114
121
  }
115
122
  var _default = exports.default = CheckboxControl;
116
123
  //# sourceMappingURL=index.js.map