@wordpress/components 28.2.0 → 28.4.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 (1329) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/CONTRIBUTING.md +1 -1
  3. package/build/animation/index.js.map +1 -1
  4. package/build/autocomplete/autocompleter-ui.js +1 -0
  5. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  6. package/build/autocomplete/index.js.map +1 -1
  7. package/build/autocomplete/types.js.map +1 -1
  8. package/build/base-control/index.js +14 -7
  9. package/build/base-control/index.js.map +1 -1
  10. package/build/base-control/types.js.map +1 -1
  11. package/build/border-box-control/border-box-control-visualizer/component.js +0 -4
  12. package/build/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  13. package/build/button/index.js +14 -10
  14. package/build/button/index.js.map +1 -1
  15. package/build/button/types.js.map +1 -1
  16. package/build/checkbox-control/index.js +1 -0
  17. package/build/checkbox-control/index.js.map +1 -1
  18. package/build/color-picker/component.js +8 -17
  19. package/build/color-picker/component.js.map +1 -1
  20. package/build/combobox-control/index.js +13 -1
  21. package/build/combobox-control/index.js.map +1 -1
  22. package/build/composite/current/index.js.map +1 -1
  23. package/build/custom-select-control/index.js +125 -174
  24. package/build/custom-select-control/index.js.map +1 -1
  25. package/build/custom-select-control/types.js +6 -0
  26. package/build/custom-select-control/types.js.map +1 -0
  27. package/build/custom-select-control-v2/custom-select.js +60 -33
  28. package/build/custom-select-control-v2/custom-select.js.map +1 -1
  29. package/build/custom-select-control-v2/index.js +35 -7
  30. package/build/custom-select-control-v2/index.js.map +1 -1
  31. package/build/custom-select-control-v2/item.js +2 -0
  32. package/build/custom-select-control-v2/item.js.map +1 -1
  33. package/build/custom-select-control-v2/styles.js +106 -78
  34. package/build/custom-select-control-v2/styles.js.map +1 -1
  35. package/build/custom-select-control-v2/types.js.map +1 -1
  36. package/build/date-time/date-time/index.js +3 -1
  37. package/build/date-time/date-time/index.js.map +1 -1
  38. package/build/date-time/index.js +7 -0
  39. package/build/date-time/index.js.map +1 -1
  40. package/build/date-time/time/index.js +62 -145
  41. package/build/date-time/time/index.js.map +1 -1
  42. package/build/date-time/time-input/index.js +159 -0
  43. package/build/date-time/time-input/index.js.map +1 -0
  44. package/build/date-time/types.js.map +1 -1
  45. package/build/date-time/utils.js +64 -0
  46. package/build/date-time/utils.js.map +1 -1
  47. package/build/disclosure/index.js +0 -1
  48. package/build/disclosure/index.js.map +1 -1
  49. package/build/divider/component.js +0 -1
  50. package/build/divider/component.js.map +1 -1
  51. package/build/divider/types.js.map +1 -1
  52. package/build/dropdown-menu/index.js +1 -0
  53. package/build/dropdown-menu/index.js.map +1 -1
  54. package/build/dropdown-menu-v2/index.js +0 -1
  55. package/build/dropdown-menu-v2/index.js.map +1 -1
  56. package/build/dropdown-menu-v2/styles.js +15 -16
  57. package/build/dropdown-menu-v2/styles.js.map +1 -1
  58. package/build/dropdown-menu-v2/types.js.map +1 -1
  59. package/build/focal-point-picker/index.js +1 -0
  60. package/build/focal-point-picker/index.js.map +1 -1
  61. package/build/font-size-picker/font-size-picker-select.js +2 -2
  62. package/build/font-size-picker/font-size-picker-select.js.map +1 -1
  63. package/build/font-size-picker/index.js +37 -25
  64. package/build/font-size-picker/index.js.map +1 -1
  65. package/build/font-size-picker/types.js.map +1 -1
  66. package/build/font-size-picker/utils.js +0 -4
  67. package/build/font-size-picker/utils.js.map +1 -1
  68. package/build/form-token-field/index.js +8 -0
  69. package/build/form-token-field/index.js.map +1 -1
  70. package/build/form-token-field/token.js +4 -1
  71. package/build/form-token-field/token.js.map +1 -1
  72. package/build/higher-order/with-spoken-messages/index.js +1 -2
  73. package/build/higher-order/with-spoken-messages/index.js.map +1 -1
  74. package/build/index.js +2 -2
  75. package/build/index.js.map +1 -1
  76. package/build/menu-items-choice/types.js.map +1 -1
  77. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  78. package/build/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  79. package/build/popover/index.js +0 -4
  80. package/build/popover/index.js.map +1 -1
  81. package/build/popover/utils.js +0 -1
  82. package/build/popover/utils.js.map +1 -1
  83. package/build/private-apis.js +0 -6
  84. package/build/private-apis.js.map +1 -1
  85. package/build/progress-bar/styles.js +19 -13
  86. package/build/progress-bar/styles.js.map +1 -1
  87. package/build/radio-control/index.js +1 -1
  88. package/build/radio-control/index.js.map +1 -1
  89. package/build/radio-group/context.js +0 -1
  90. package/build/radio-group/context.js.map +1 -1
  91. package/build/radio-group/index.js +0 -1
  92. package/build/radio-group/index.js.map +1 -1
  93. package/build/radio-group/radio.js +0 -1
  94. package/build/radio-group/radio.js.map +1 -1
  95. package/build/range-control/index.js +5 -1
  96. package/build/range-control/index.js.map +1 -1
  97. package/build/range-control/styles/range-control-styles.js +34 -28
  98. package/build/range-control/styles/range-control-styles.js.map +1 -1
  99. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  100. package/build/select-control/index.js +6 -2
  101. package/build/select-control/index.js.map +1 -1
  102. package/build/select-control/styles/select-control-styles.js +49 -13
  103. package/build/select-control/styles/select-control-styles.js.map +1 -1
  104. package/build/select-control/types.js.map +1 -1
  105. package/build/tab-panel/index.js +0 -1
  106. package/build/tab-panel/index.js.map +1 -1
  107. package/build/tabs/index.js +0 -1
  108. package/build/tabs/index.js.map +1 -1
  109. package/build/tabs/styles.js +3 -5
  110. package/build/tabs/styles.js.map +1 -1
  111. package/build/tabs/tablist.js +4 -78
  112. package/build/tabs/tablist.js.map +1 -1
  113. package/build/tabs/types.js.map +1 -1
  114. package/build/textarea-control/index.js +1 -0
  115. package/build/textarea-control/index.js.map +1 -1
  116. package/build/toggle-control/index.js +10 -4
  117. package/build/toggle-control/index.js.map +1 -1
  118. package/build/toggle-group-control/toggle-group-control/as-radio-group.js +0 -2
  119. package/build/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  120. package/build/toggle-group-control/toggle-group-control/component.js +0 -2
  121. package/build/toggle-group-control/toggle-group-control/component.js.map +1 -1
  122. package/build/toggle-group-control/toggle-group-control-option-base/component.js +3 -4
  123. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  124. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
  125. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  126. package/build/toolbar/toolbar/toolbar-container.js +0 -1
  127. package/build/toolbar/toolbar/toolbar-container.js.map +1 -1
  128. package/build/toolbar/toolbar/types.js.map +1 -1
  129. package/build/toolbar/toolbar-button/index.js +27 -19
  130. package/build/toolbar/toolbar-button/index.js.map +1 -1
  131. package/build/toolbar/toolbar-button/types.js.map +1 -1
  132. package/build/toolbar/toolbar-context/index.js +0 -1
  133. package/build/toolbar/toolbar-context/index.js.map +1 -1
  134. package/build/toolbar/toolbar-item/index.js +1 -1
  135. package/build/toolbar/toolbar-item/index.js.map +1 -1
  136. package/build/tools-panel/tools-panel-header/component.js +1 -1
  137. package/build/tools-panel/tools-panel-header/component.js.map +1 -1
  138. package/build/tooltip/index.js +3 -2
  139. package/build/tooltip/index.js.map +1 -1
  140. package/build/tooltip/types.js.map +1 -1
  141. package/build/tree-select/index.js +1 -0
  142. package/build/tree-select/index.js.map +1 -1
  143. package/build/unit-control/index.js +3 -3
  144. package/build/unit-control/index.js.map +1 -1
  145. package/build/unit-control/styles/unit-control-styles.js +7 -7
  146. package/build/unit-control/styles/unit-control-styles.js.map +1 -1
  147. package/build/utils/element-rect.js +157 -0
  148. package/build/utils/element-rect.js.map +1 -0
  149. package/build/utils/hooks/use-event.js +41 -0
  150. package/build/utils/hooks/use-event.js.map +1 -0
  151. package/build/utils/hooks/use-on-value-update.js +46 -0
  152. package/build/utils/hooks/use-on-value-update.js.map +1 -0
  153. package/build/utils/hooks/use-update-effect.js +4 -1
  154. package/build/utils/hooks/use-update-effect.js.map +1 -1
  155. package/build-module/animation/index.js +0 -1
  156. package/build-module/animation/index.js.map +1 -1
  157. package/build-module/autocomplete/autocompleter-ui.js +1 -0
  158. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  159. package/build-module/autocomplete/index.js.map +1 -1
  160. package/build-module/autocomplete/types.js.map +1 -1
  161. package/build-module/base-control/index.js +13 -6
  162. package/build-module/base-control/index.js.map +1 -1
  163. package/build-module/base-control/types.js.map +1 -1
  164. package/build-module/border-box-control/border-box-control-visualizer/component.js +0 -4
  165. package/build-module/border-box-control/border-box-control-visualizer/component.js.map +1 -1
  166. package/build-module/button/index.js +14 -10
  167. package/build-module/button/index.js.map +1 -1
  168. package/build-module/button/types.js.map +1 -1
  169. package/build-module/checkbox-control/index.js +1 -0
  170. package/build-module/checkbox-control/index.js.map +1 -1
  171. package/build-module/color-picker/component.js +9 -18
  172. package/build-module/color-picker/component.js.map +1 -1
  173. package/build-module/combobox-control/index.js +13 -1
  174. package/build-module/combobox-control/index.js.map +1 -1
  175. package/build-module/composite/current/index.js +0 -3
  176. package/build-module/composite/current/index.js.map +1 -1
  177. package/build-module/custom-select-control/index.js +123 -173
  178. package/build-module/custom-select-control/index.js.map +1 -1
  179. package/build-module/custom-select-control/types.js +2 -0
  180. package/build-module/custom-select-control/types.js.map +1 -0
  181. package/build-module/custom-select-control-v2/custom-select.js +61 -35
  182. package/build-module/custom-select-control-v2/custom-select.js.map +1 -1
  183. package/build-module/custom-select-control-v2/index.js +27 -1
  184. package/build-module/custom-select-control-v2/index.js.map +1 -1
  185. package/build-module/custom-select-control-v2/item.js +2 -0
  186. package/build-module/custom-select-control-v2/item.js.map +1 -1
  187. package/build-module/custom-select-control-v2/styles.js +105 -77
  188. package/build-module/custom-select-control-v2/styles.js.map +1 -1
  189. package/build-module/custom-select-control-v2/types.js.map +1 -1
  190. package/build-module/date-time/date-time/index.js +4 -1
  191. package/build-module/date-time/date-time/index.js.map +1 -1
  192. package/build-module/date-time/index.js +2 -1
  193. package/build-module/date-time/index.js.map +1 -1
  194. package/build-module/date-time/time/index.js +65 -149
  195. package/build-module/date-time/time/index.js.map +1 -1
  196. package/build-module/date-time/time-input/index.js +151 -0
  197. package/build-module/date-time/time-input/index.js.map +1 -0
  198. package/build-module/date-time/types.js.map +1 -1
  199. package/build-module/date-time/utils.js +61 -0
  200. package/build-module/date-time/utils.js.map +1 -1
  201. package/build-module/disclosure/index.js +0 -1
  202. package/build-module/disclosure/index.js.map +1 -1
  203. package/build-module/divider/component.js +0 -1
  204. package/build-module/divider/component.js.map +1 -1
  205. package/build-module/divider/types.js.map +1 -1
  206. package/build-module/dropdown-menu/index.js +1 -0
  207. package/build-module/dropdown-menu/index.js.map +1 -1
  208. package/build-module/dropdown-menu-v2/index.js +0 -1
  209. package/build-module/dropdown-menu-v2/index.js.map +1 -1
  210. package/build-module/dropdown-menu-v2/styles.js +14 -15
  211. package/build-module/dropdown-menu-v2/styles.js.map +1 -1
  212. package/build-module/dropdown-menu-v2/types.js.map +1 -1
  213. package/build-module/focal-point-picker/index.js +1 -0
  214. package/build-module/focal-point-picker/index.js.map +1 -1
  215. package/build-module/font-size-picker/font-size-picker-select.js +2 -2
  216. package/build-module/font-size-picker/font-size-picker-select.js.map +1 -1
  217. package/build-module/font-size-picker/index.js +37 -25
  218. package/build-module/font-size-picker/index.js.map +1 -1
  219. package/build-module/font-size-picker/types.js.map +1 -1
  220. package/build-module/font-size-picker/utils.js +0 -4
  221. package/build-module/font-size-picker/utils.js.map +1 -1
  222. package/build-module/form-token-field/index.js +8 -0
  223. package/build-module/form-token-field/index.js.map +1 -1
  224. package/build-module/form-token-field/token.js +4 -1
  225. package/build-module/form-token-field/token.js.map +1 -1
  226. package/build-module/higher-order/with-spoken-messages/index.js +1 -2
  227. package/build-module/higher-order/with-spoken-messages/index.js.map +1 -1
  228. package/build-module/index.js +1 -1
  229. package/build-module/index.js.map +1 -1
  230. package/build-module/menu-items-choice/types.js.map +1 -1
  231. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  232. package/build-module/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js.map +1 -1
  233. package/build-module/popover/index.js +0 -3
  234. package/build-module/popover/index.js.map +1 -1
  235. package/build-module/popover/utils.js +0 -1
  236. package/build-module/popover/utils.js.map +1 -1
  237. package/build-module/private-apis.js +0 -6
  238. package/build-module/private-apis.js.map +1 -1
  239. package/build-module/progress-bar/styles.js +21 -13
  240. package/build-module/progress-bar/styles.js.map +1 -1
  241. package/build-module/radio-control/index.js +1 -1
  242. package/build-module/radio-control/index.js.map +1 -1
  243. package/build-module/radio-group/context.js +0 -1
  244. package/build-module/radio-group/context.js.map +1 -1
  245. package/build-module/radio-group/index.js +0 -1
  246. package/build-module/radio-group/index.js.map +1 -1
  247. package/build-module/radio-group/radio.js +0 -1
  248. package/build-module/radio-group/radio.js.map +1 -1
  249. package/build-module/range-control/index.js +5 -1
  250. package/build-module/range-control/index.js.map +1 -1
  251. package/build-module/range-control/styles/range-control-styles.js +34 -28
  252. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  253. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  254. package/build-module/select-control/index.js +7 -3
  255. package/build-module/select-control/index.js.map +1 -1
  256. package/build-module/select-control/styles/select-control-styles.js +47 -7
  257. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  258. package/build-module/select-control/types.js.map +1 -1
  259. package/build-module/tab-panel/index.js +0 -1
  260. package/build-module/tab-panel/index.js.map +1 -1
  261. package/build-module/tabs/index.js +0 -1
  262. package/build-module/tabs/index.js.map +1 -1
  263. package/build-module/tabs/styles.js +3 -4
  264. package/build-module/tabs/styles.js.map +1 -1
  265. package/build-module/tabs/tablist.js +4 -78
  266. package/build-module/tabs/tablist.js.map +1 -1
  267. package/build-module/tabs/types.js.map +1 -1
  268. package/build-module/textarea-control/index.js +1 -0
  269. package/build-module/textarea-control/index.js.map +1 -1
  270. package/build-module/toggle-control/index.js +10 -4
  271. package/build-module/toggle-control/index.js.map +1 -1
  272. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js +0 -1
  273. package/build-module/toggle-group-control/toggle-group-control/as-radio-group.js.map +1 -1
  274. package/build-module/toggle-group-control/toggle-group-control/component.js +0 -1
  275. package/build-module/toggle-group-control/toggle-group-control/component.js.map +1 -1
  276. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +3 -2
  277. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  278. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
  279. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  280. package/build-module/toolbar/toolbar/toolbar-container.js +0 -1
  281. package/build-module/toolbar/toolbar/toolbar-container.js.map +1 -1
  282. package/build-module/toolbar/toolbar/types.js.map +1 -1
  283. package/build-module/toolbar/toolbar-button/index.js +27 -19
  284. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  285. package/build-module/toolbar/toolbar-button/types.js.map +1 -1
  286. package/build-module/toolbar/toolbar-context/index.js +0 -1
  287. package/build-module/toolbar/toolbar-context/index.js.map +1 -1
  288. package/build-module/toolbar/toolbar-item/index.js +1 -1
  289. package/build-module/toolbar/toolbar-item/index.js.map +1 -1
  290. package/build-module/tools-panel/tools-panel-header/component.js +1 -1
  291. package/build-module/tools-panel/tools-panel-header/component.js.map +1 -1
  292. package/build-module/tooltip/index.js +3 -2
  293. package/build-module/tooltip/index.js.map +1 -1
  294. package/build-module/tooltip/types.js.map +1 -1
  295. package/build-module/tree-select/index.js +1 -0
  296. package/build-module/tree-select/index.js.map +1 -1
  297. package/build-module/unit-control/index.js +3 -3
  298. package/build-module/unit-control/index.js.map +1 -1
  299. package/build-module/unit-control/styles/unit-control-styles.js +7 -7
  300. package/build-module/unit-control/styles/unit-control-styles.js.map +1 -1
  301. package/build-module/utils/element-rect.js +147 -0
  302. package/build-module/utils/element-rect.js.map +1 -0
  303. package/build-module/utils/hooks/use-event.js +35 -0
  304. package/build-module/utils/hooks/use-event.js.map +1 -0
  305. package/build-module/utils/hooks/use-on-value-update.js +39 -0
  306. package/build-module/utils/hooks/use-on-value-update.js.map +1 -0
  307. package/build-module/utils/hooks/use-update-effect.js +4 -1
  308. package/build-module/utils/hooks/use-update-effect.js.map +1 -1
  309. package/build-style/style-rtl.css +80 -95
  310. package/build-style/style.css +80 -95
  311. package/build-types/alignment-matrix-control/cell.d.ts +0 -1
  312. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  313. package/build-types/alignment-matrix-control/icon.d.ts +0 -1
  314. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  315. package/build-types/alignment-matrix-control/index.d.ts +0 -1
  316. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  317. package/build-types/alignment-matrix-control/stories/index.story.d.ts +0 -1
  318. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  319. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +8 -9
  320. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts.map +1 -1
  321. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts +10 -11
  322. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -1
  323. package/build-types/angle-picker-control/angle-circle.d.ts +0 -1
  324. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  325. package/build-types/angle-picker-control/index.d.ts +0 -1
  326. package/build-types/angle-picker-control/index.d.ts.map +1 -1
  327. package/build-types/angle-picker-control/stories/index.story.d.ts +0 -1
  328. package/build-types/angle-picker-control/stories/index.story.d.ts.map +1 -1
  329. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +7 -8
  330. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts.map +1 -1
  331. package/build-types/animate/index.d.ts +0 -1
  332. package/build-types/animate/index.d.ts.map +1 -1
  333. package/build-types/animate/types.d.ts +0 -1
  334. package/build-types/animate/types.d.ts.map +1 -1
  335. package/build-types/animation/index.d.ts.map +1 -1
  336. package/build-types/autocomplete/autocompleter-ui.d.ts +0 -1
  337. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  338. package/build-types/autocomplete/index.d.ts +2 -3
  339. package/build-types/autocomplete/index.d.ts.map +1 -1
  340. package/build-types/autocomplete/types.d.ts +2 -3
  341. package/build-types/autocomplete/types.d.ts.map +1 -1
  342. package/build-types/base-control/hooks.d.ts +3 -4
  343. package/build-types/base-control/hooks.d.ts.map +1 -1
  344. package/build-types/base-control/index.d.ts +6 -21
  345. package/build-types/base-control/index.d.ts.map +1 -1
  346. package/build-types/base-control/stories/index.story.d.ts +0 -1
  347. package/build-types/base-control/stories/index.story.d.ts.map +1 -1
  348. package/build-types/base-control/styles/base-control-styles.d.ts +10 -11
  349. package/build-types/base-control/styles/base-control-styles.d.ts.map +1 -1
  350. package/build-types/base-control/types.d.ts +1 -1
  351. package/build-types/border-box-control/border-box-control/component.d.ts +4 -5
  352. package/build-types/border-box-control/border-box-control/component.d.ts.map +1 -1
  353. package/build-types/border-box-control/border-box-control/hook.d.ts +14 -16
  354. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  355. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts +0 -1
  356. package/build-types/border-box-control/border-box-control-linked-button/component.d.ts.map +1 -1
  357. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +12 -14
  358. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  359. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts +5 -6
  360. package/build-types/border-box-control/border-box-control-split-controls/component.d.ts.map +1 -1
  361. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +14 -16
  362. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  363. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts +1 -2
  364. package/build-types/border-box-control/border-box-control-visualizer/component.d.ts.map +1 -1
  365. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +9 -11
  366. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  367. package/build-types/border-box-control/stories/index.story.d.ts +4 -5
  368. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  369. package/build-types/border-box-control/styles.d.ts +3 -3
  370. package/build-types/border-box-control/utils.d.ts.map +1 -1
  371. package/build-types/border-control/border-control/component.d.ts +14 -15
  372. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  373. package/build-types/border-control/border-control/hook.d.ts +17 -19
  374. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  375. package/build-types/border-control/border-control-dropdown/component.d.ts +6 -7
  376. package/build-types/border-control/border-control-dropdown/component.d.ts.map +1 -1
  377. package/build-types/border-control/border-control-dropdown/hook.d.ts +12 -14
  378. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  379. package/build-types/border-control/border-control-style-picker/component.d.ts +2 -3
  380. package/build-types/border-control/border-control-style-picker/component.d.ts.map +1 -1
  381. package/build-types/border-control/stories/index.story.d.ts +84 -85
  382. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  383. package/build-types/border-control/styles.d.ts +2 -2
  384. package/build-types/box-control/all-input-control.d.ts +0 -1
  385. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  386. package/build-types/box-control/axial-input-controls.d.ts +0 -1
  387. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  388. package/build-types/box-control/icon.d.ts +0 -1
  389. package/build-types/box-control/icon.d.ts.map +1 -1
  390. package/build-types/box-control/index.d.ts +0 -1
  391. package/build-types/box-control/index.d.ts.map +1 -1
  392. package/build-types/box-control/input-controls.d.ts +0 -1
  393. package/build-types/box-control/input-controls.d.ts.map +1 -1
  394. package/build-types/box-control/linked-button.d.ts +0 -1
  395. package/build-types/box-control/linked-button.d.ts.map +1 -1
  396. package/build-types/box-control/stories/index.story.d.ts +312 -350
  397. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  398. package/build-types/box-control/styles/box-control-icon-styles.d.ts +16 -17
  399. package/build-types/box-control/styles/box-control-icon-styles.d.ts.map +1 -1
  400. package/build-types/box-control/styles/box-control-styles.d.ts +44 -45
  401. package/build-types/box-control/styles/box-control-styles.d.ts.map +1 -1
  402. package/build-types/box-control/types.d.ts +0 -1
  403. package/build-types/box-control/types.d.ts.map +1 -1
  404. package/build-types/button/deprecated.d.ts +69 -70
  405. package/build-types/button/deprecated.d.ts.map +1 -1
  406. package/build-types/button/index.d.ts.map +1 -1
  407. package/build-types/button/stories/e2e/index.story.d.ts +0 -1
  408. package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
  409. package/build-types/button/stories/index.story.d.ts +0 -1
  410. package/build-types/button/stories/index.story.d.ts.map +1 -1
  411. package/build-types/button/types.d.ts +36 -12
  412. package/build-types/button/types.d.ts.map +1 -1
  413. package/build-types/button-group/index.d.ts +0 -1
  414. package/build-types/button-group/index.d.ts.map +1 -1
  415. package/build-types/card/card/component.d.ts +5 -6
  416. package/build-types/card/card/component.d.ts.map +1 -1
  417. package/build-types/card/card/hook.d.ts +10 -12
  418. package/build-types/card/card/hook.d.ts.map +1 -1
  419. package/build-types/card/card-body/component.d.ts +4 -5
  420. package/build-types/card/card-body/component.d.ts.map +1 -1
  421. package/build-types/card/card-body/hook.d.ts +10 -12
  422. package/build-types/card/card-body/hook.d.ts.map +1 -1
  423. package/build-types/card/card-divider/component.d.ts +4 -5
  424. package/build-types/card/card-divider/component.d.ts.map +1 -1
  425. package/build-types/card/card-divider/hook.d.ts +15 -17
  426. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  427. package/build-types/card/card-footer/component.d.ts +5 -6
  428. package/build-types/card/card-footer/component.d.ts.map +1 -1
  429. package/build-types/card/card-footer/hook.d.ts +10 -12
  430. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  431. package/build-types/card/card-header/component.d.ts +4 -5
  432. package/build-types/card/card-header/component.d.ts.map +1 -1
  433. package/build-types/card/card-header/hook.d.ts +10 -12
  434. package/build-types/card/card-header/hook.d.ts.map +1 -1
  435. package/build-types/card/card-media/component.d.ts +0 -1
  436. package/build-types/card/card-media/component.d.ts.map +1 -1
  437. package/build-types/card/card-media/hook.d.ts +10 -12
  438. package/build-types/card/card-media/hook.d.ts.map +1 -1
  439. package/build-types/card/context.d.ts +0 -1
  440. package/build-types/card/context.d.ts.map +1 -1
  441. package/build-types/card/stories/index.story.d.ts +3 -22
  442. package/build-types/card/stories/index.story.d.ts.map +1 -1
  443. package/build-types/checkbox-control/index.d.ts +1 -1
  444. package/build-types/checkbox-control/index.d.ts.map +1 -1
  445. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts +0 -1
  446. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  447. package/build-types/circular-option-picker/circular-option-picker-context.d.ts +0 -1
  448. package/build-types/circular-option-picker/circular-option-picker-context.d.ts.map +1 -1
  449. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts +0 -1
  450. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts.map +1 -1
  451. package/build-types/circular-option-picker/circular-option-picker-option.d.ts +0 -1
  452. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  453. package/build-types/circular-option-picker/circular-option-picker.d.ts +0 -1
  454. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  455. package/build-types/clipboard-button/index.d.ts +0 -1
  456. package/build-types/clipboard-button/index.d.ts.map +1 -1
  457. package/build-types/color-indicator/index.d.ts +0 -1
  458. package/build-types/color-indicator/index.d.ts.map +1 -1
  459. package/build-types/color-palette/index.d.ts +0 -1
  460. package/build-types/color-palette/index.d.ts.map +1 -1
  461. package/build-types/color-palette/stories/index.story.d.ts +0 -1
  462. package/build-types/color-palette/stories/index.story.d.ts.map +1 -1
  463. package/build-types/color-palette/styles.d.ts +5 -6
  464. package/build-types/color-palette/styles.d.ts.map +1 -1
  465. package/build-types/color-palette/utils.d.ts +1 -1
  466. package/build-types/color-palette/utils.d.ts.map +1 -1
  467. package/build-types/color-picker/color-copy-button.d.ts +0 -1
  468. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  469. package/build-types/color-picker/color-input.d.ts +0 -1
  470. package/build-types/color-picker/color-input.d.ts.map +1 -1
  471. package/build-types/color-picker/component.d.ts +5 -6
  472. package/build-types/color-picker/component.d.ts.map +1 -1
  473. package/build-types/color-picker/hex-input.d.ts +0 -1
  474. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  475. package/build-types/color-picker/hsl-input.d.ts +0 -1
  476. package/build-types/color-picker/hsl-input.d.ts.map +1 -1
  477. package/build-types/color-picker/input-with-slider.d.ts +0 -1
  478. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  479. package/build-types/color-picker/legacy-adapter.d.ts +0 -1
  480. package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
  481. package/build-types/color-picker/picker.d.ts +0 -1
  482. package/build-types/color-picker/picker.d.ts.map +1 -1
  483. package/build-types/color-picker/rgb-input.d.ts +0 -1
  484. package/build-types/color-picker/rgb-input.d.ts.map +1 -1
  485. package/build-types/color-picker/stories/index.story.d.ts +2 -9
  486. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  487. package/build-types/color-picker/styles.d.ts +52 -53
  488. package/build-types/color-picker/styles.d.ts.map +1 -1
  489. package/build-types/combobox-control/index.d.ts +1 -1
  490. package/build-types/combobox-control/index.d.ts.map +1 -1
  491. package/build-types/combobox-control/stories/index.story.d.ts +41 -41
  492. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  493. package/build-types/combobox-control/styles.d.ts +1 -2
  494. package/build-types/combobox-control/styles.d.ts.map +1 -1
  495. package/build-types/combobox-control/types.d.ts +0 -1
  496. package/build-types/combobox-control/types.d.ts.map +1 -1
  497. package/build-types/composite/current/index.d.ts.map +1 -1
  498. package/build-types/composite/current/stories/utils.d.ts +0 -1
  499. package/build-types/composite/current/stories/utils.d.ts.map +1 -1
  500. package/build-types/composite/legacy/index.d.ts +0 -1
  501. package/build-types/composite/legacy/index.d.ts.map +1 -1
  502. package/build-types/composite/legacy/stories/utils.d.ts +0 -1
  503. package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
  504. package/build-types/confirm-dialog/component.d.ts +0 -1
  505. package/build-types/confirm-dialog/component.d.ts.map +1 -1
  506. package/build-types/confirm-dialog/stories/index.story.d.ts +0 -1
  507. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  508. package/build-types/context/context-system-provider.d.ts +1 -1
  509. package/build-types/context/context-system-provider.d.ts.map +1 -1
  510. package/build-types/context/get-styled-class-name-from-key.d.ts +9 -1
  511. package/build-types/context/get-styled-class-name-from-key.d.ts.map +1 -1
  512. package/build-types/context/use-context-system.d.ts +1 -1
  513. package/build-types/context/use-context-system.d.ts.map +1 -1
  514. package/build-types/context/utils.d.ts.map +1 -1
  515. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +0 -1
  516. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  517. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +0 -1
  518. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
  519. package/build-types/custom-gradient-picker/index.d.ts +0 -1
  520. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  521. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +2 -3
  522. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts.map +1 -1
  523. package/build-types/custom-gradient-picker/types.d.ts +0 -1
  524. package/build-types/custom-gradient-picker/types.d.ts.map +1 -1
  525. package/build-types/custom-gradient-picker/utils.d.ts.map +1 -1
  526. package/build-types/custom-select-control/index.d.ts +3 -2
  527. package/build-types/custom-select-control/index.d.ts.map +1 -1
  528. package/build-types/custom-select-control/stories/index.story.d.ts +6 -42
  529. package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
  530. package/build-types/custom-select-control/test/index.d.ts.map +1 -0
  531. package/build-types/custom-select-control/types.d.ts +122 -0
  532. package/build-types/custom-select-control/types.d.ts.map +1 -0
  533. package/build-types/custom-select-control-v2/custom-select.d.ts +2 -3
  534. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  535. package/build-types/custom-select-control-v2/index.d.ts +7 -4
  536. package/build-types/custom-select-control-v2/index.d.ts.map +1 -1
  537. package/build-types/custom-select-control-v2/item.d.ts +0 -1
  538. package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
  539. package/build-types/custom-select-control-v2/stories/{default.story.d.ts → index.story.d.ts} +13 -11
  540. package/build-types/custom-select-control-v2/stories/index.story.d.ts.map +1 -0
  541. package/build-types/custom-select-control-v2/styles.d.ts +39 -48
  542. package/build-types/custom-select-control-v2/styles.d.ts.map +1 -1
  543. package/build-types/custom-select-control-v2/types.d.ts +12 -108
  544. package/build-types/custom-select-control-v2/types.d.ts.map +1 -1
  545. package/build-types/dashicon/index.d.ts +0 -1
  546. package/build-types/dashicon/index.d.ts.map +1 -1
  547. package/build-types/date-time/date/index.d.ts +0 -1
  548. package/build-types/date-time/date/index.d.ts.map +1 -1
  549. package/build-types/date-time/date/styles.d.ts +15 -16
  550. package/build-types/date-time/date/styles.d.ts.map +1 -1
  551. package/build-types/date-time/date-time/index.d.ts +1 -2
  552. package/build-types/date-time/date-time/index.d.ts.map +1 -1
  553. package/build-types/date-time/date-time/styles.d.ts +3 -4
  554. package/build-types/date-time/date-time/styles.d.ts.map +1 -1
  555. package/build-types/date-time/index.d.ts +2 -1
  556. package/build-types/date-time/index.d.ts.map +1 -1
  557. package/build-types/date-time/stories/time-input.story.d.ts +12 -0
  558. package/build-types/date-time/stories/time-input.story.d.ts.map +1 -0
  559. package/build-types/date-time/time/index.d.ts +1 -2
  560. package/build-types/date-time/time/index.d.ts.map +1 -1
  561. package/build-types/date-time/time/styles.d.ts +64 -65
  562. package/build-types/date-time/time/styles.d.ts.map +1 -1
  563. package/build-types/date-time/time/timezone.d.ts +0 -1
  564. package/build-types/date-time/time/timezone.d.ts.map +1 -1
  565. package/build-types/date-time/time-input/index.d.ts +4 -0
  566. package/build-types/date-time/time-input/index.d.ts.map +1 -0
  567. package/build-types/date-time/time-input/test/index.d.ts +2 -0
  568. package/build-types/date-time/time-input/test/index.d.ts.map +1 -0
  569. package/build-types/date-time/types.d.ts +53 -0
  570. package/build-types/date-time/types.d.ts.map +1 -1
  571. package/build-types/date-time/utils.d.ts +39 -0
  572. package/build-types/date-time/utils.d.ts.map +1 -1
  573. package/build-types/dimension-control/index.d.ts +0 -1
  574. package/build-types/dimension-control/index.d.ts.map +1 -1
  575. package/build-types/disabled/index.d.ts +0 -1
  576. package/build-types/disabled/index.d.ts.map +1 -1
  577. package/build-types/disabled/types.d.ts +0 -1
  578. package/build-types/disabled/types.d.ts.map +1 -1
  579. package/build-types/disclosure/index.d.ts +0 -1
  580. package/build-types/disclosure/index.d.ts.map +1 -1
  581. package/build-types/disclosure/types.d.ts +0 -1
  582. package/build-types/disclosure/types.d.ts.map +1 -1
  583. package/build-types/divider/component.d.ts +4 -5
  584. package/build-types/divider/component.d.ts.map +1 -1
  585. package/build-types/divider/styles.d.ts +6 -7
  586. package/build-types/divider/styles.d.ts.map +1 -1
  587. package/build-types/divider/types.d.ts.map +1 -1
  588. package/build-types/draggable/index.d.ts +0 -1
  589. package/build-types/draggable/index.d.ts.map +1 -1
  590. package/build-types/drop-zone/index.d.ts +0 -1
  591. package/build-types/drop-zone/index.d.ts.map +1 -1
  592. package/build-types/drop-zone/provider.d.ts +0 -1
  593. package/build-types/drop-zone/provider.d.ts.map +1 -1
  594. package/build-types/drop-zone/stories/index.story.d.ts +0 -1
  595. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  596. package/build-types/dropdown/dropdown-content-wrapper.d.ts +0 -1
  597. package/build-types/dropdown/dropdown-content-wrapper.d.ts.map +1 -1
  598. package/build-types/dropdown/index.d.ts +0 -1
  599. package/build-types/dropdown/index.d.ts.map +1 -1
  600. package/build-types/dropdown/stories/index.story.d.ts +5 -6
  601. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  602. package/build-types/dropdown/styles.d.ts +2 -3
  603. package/build-types/dropdown/styles.d.ts.map +1 -1
  604. package/build-types/dropdown-menu/index.d.ts +0 -1
  605. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  606. package/build-types/dropdown-menu/stories/index.story.d.ts +3 -4
  607. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  608. package/build-types/dropdown-menu-v2/index.d.ts +0 -1
  609. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  610. package/build-types/dropdown-menu-v2/stories/index.story.d.ts.map +1 -1
  611. package/build-types/dropdown-menu-v2/styles.d.ts +41 -42
  612. package/build-types/dropdown-menu-v2/styles.d.ts.map +1 -1
  613. package/build-types/dropdown-menu-v2/types.d.ts +0 -1
  614. package/build-types/dropdown-menu-v2/types.d.ts.map +1 -1
  615. package/build-types/duotone-picker/color-list-picker/index.d.ts +0 -1
  616. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  617. package/build-types/duotone-picker/custom-duotone-bar.d.ts +0 -1
  618. package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -1
  619. package/build-types/duotone-picker/duotone-picker.d.ts +0 -1
  620. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  621. package/build-types/duotone-picker/duotone-swatch.d.ts +0 -1
  622. package/build-types/duotone-picker/duotone-swatch.d.ts.map +1 -1
  623. package/build-types/elevation/component.d.ts +0 -1
  624. package/build-types/elevation/component.d.ts.map +1 -1
  625. package/build-types/elevation/hook.d.ts +9 -11
  626. package/build-types/elevation/hook.d.ts.map +1 -1
  627. package/build-types/external-link/index.d.ts +0 -1
  628. package/build-types/external-link/index.d.ts.map +1 -1
  629. package/build-types/flex/context.d.ts +2 -3
  630. package/build-types/flex/context.d.ts.map +1 -1
  631. package/build-types/flex/flex/component.d.ts +0 -1
  632. package/build-types/flex/flex/component.d.ts.map +1 -1
  633. package/build-types/flex/flex/hook.d.ts +9 -11
  634. package/build-types/flex/flex/hook.d.ts.map +1 -1
  635. package/build-types/flex/flex-block/component.d.ts +0 -1
  636. package/build-types/flex/flex-block/component.d.ts.map +1 -1
  637. package/build-types/flex/flex-block/hook.d.ts +9 -11
  638. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  639. package/build-types/flex/flex-item/component.d.ts +0 -1
  640. package/build-types/flex/flex-item/component.d.ts.map +1 -1
  641. package/build-types/flex/flex-item/hook.d.ts +9 -11
  642. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  643. package/build-types/focal-point-picker/controls.d.ts +0 -1
  644. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  645. package/build-types/focal-point-picker/focal-point.d.ts +0 -1
  646. package/build-types/focal-point-picker/focal-point.d.ts.map +1 -1
  647. package/build-types/focal-point-picker/grid.d.ts +0 -1
  648. package/build-types/focal-point-picker/grid.d.ts.map +1 -1
  649. package/build-types/focal-point-picker/index.d.ts +1 -1
  650. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  651. package/build-types/focal-point-picker/media.d.ts +0 -1
  652. package/build-types/focal-point-picker/media.d.ts.map +1 -1
  653. package/build-types/focal-point-picker/stories/index.story.d.ts +32 -33
  654. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  655. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +26 -27
  656. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  657. package/build-types/focal-point-picker/styles/focal-point-style.d.ts +2 -3
  658. package/build-types/focal-point-picker/styles/focal-point-style.d.ts.map +1 -1
  659. package/build-types/focusable-iframe/index.d.ts +0 -1
  660. package/build-types/focusable-iframe/index.d.ts.map +1 -1
  661. package/build-types/font-size-picker/font-size-picker-select.d.ts +0 -1
  662. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  663. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts +0 -1
  664. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  665. package/build-types/font-size-picker/index.d.ts +0 -1
  666. package/build-types/font-size-picker/index.d.ts.map +1 -1
  667. package/build-types/font-size-picker/stories/e2e/index.story.d.ts +0 -1
  668. package/build-types/font-size-picker/stories/e2e/index.story.d.ts.map +1 -1
  669. package/build-types/font-size-picker/styles.d.ts +10 -11
  670. package/build-types/font-size-picker/styles.d.ts.map +1 -1
  671. package/build-types/font-size-picker/types.d.ts +6 -5
  672. package/build-types/font-size-picker/types.d.ts.map +1 -1
  673. package/build-types/font-size-picker/utils.d.ts.map +1 -1
  674. package/build-types/form-file-upload/index.d.ts +0 -1
  675. package/build-types/form-file-upload/index.d.ts.map +1 -1
  676. package/build-types/form-file-upload/stories/index.story.d.ts +0 -1
  677. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  678. package/build-types/form-token-field/index.d.ts +0 -1
  679. package/build-types/form-token-field/index.d.ts.map +1 -1
  680. package/build-types/form-token-field/stories/index.story.d.ts.map +1 -1
  681. package/build-types/form-token-field/styles.d.ts +1 -2
  682. package/build-types/form-token-field/styles.d.ts.map +1 -1
  683. package/build-types/form-token-field/suggestions-list.d.ts +0 -1
  684. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  685. package/build-types/form-token-field/token.d.ts +0 -1
  686. package/build-types/form-token-field/token.d.ts.map +1 -1
  687. package/build-types/gradient-picker/index.d.ts +0 -1
  688. package/build-types/gradient-picker/index.d.ts.map +1 -1
  689. package/build-types/gradient-picker/types.d.ts +0 -1
  690. package/build-types/gradient-picker/types.d.ts.map +1 -1
  691. package/build-types/grid/component.d.ts +0 -1
  692. package/build-types/grid/component.d.ts.map +1 -1
  693. package/build-types/grid/hook.d.ts +9 -11
  694. package/build-types/grid/hook.d.ts.map +1 -1
  695. package/build-types/guide/icons.d.ts +0 -1
  696. package/build-types/guide/icons.d.ts.map +1 -1
  697. package/build-types/guide/index.d.ts +0 -1
  698. package/build-types/guide/index.d.ts.map +1 -1
  699. package/build-types/guide/page-control.d.ts +0 -1
  700. package/build-types/guide/page-control.d.ts.map +1 -1
  701. package/build-types/guide/page.d.ts +0 -1
  702. package/build-types/guide/page.d.ts.map +1 -1
  703. package/build-types/h-stack/component.d.ts +2 -3
  704. package/build-types/h-stack/component.d.ts.map +1 -1
  705. package/build-types/h-stack/hook.d.ts +9 -11
  706. package/build-types/h-stack/hook.d.ts.map +1 -1
  707. package/build-types/heading/component.d.ts +4 -5
  708. package/build-types/heading/component.d.ts.map +1 -1
  709. package/build-types/heading/hook.d.ts +9 -11
  710. package/build-types/heading/hook.d.ts.map +1 -1
  711. package/build-types/higher-order/navigate-regions/index.d.ts +1 -2
  712. package/build-types/higher-order/navigate-regions/index.d.ts.map +1 -1
  713. package/build-types/higher-order/with-constrained-tabbing/index.d.ts +0 -1
  714. package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -1
  715. package/build-types/higher-order/with-fallback-styles/index.d.ts +3 -4
  716. package/build-types/higher-order/with-fallback-styles/index.d.ts.map +1 -1
  717. package/build-types/higher-order/with-filters/index.d.ts +4 -5
  718. package/build-types/higher-order/with-filters/index.d.ts.map +1 -1
  719. package/build-types/higher-order/with-focus-outside/index.d.ts +0 -1
  720. package/build-types/higher-order/with-focus-outside/index.d.ts.map +1 -1
  721. package/build-types/higher-order/with-focus-return/index.d.ts +0 -1
  722. package/build-types/higher-order/with-focus-return/index.d.ts.map +1 -1
  723. package/build-types/higher-order/with-notices/index.d.ts +0 -1
  724. package/build-types/higher-order/with-notices/index.d.ts.map +1 -1
  725. package/build-types/higher-order/with-notices/types.d.ts +0 -1
  726. package/build-types/higher-order/with-notices/types.d.ts.map +1 -1
  727. package/build-types/higher-order/with-spoken-messages/index.d.ts +1 -3
  728. package/build-types/higher-order/with-spoken-messages/index.d.ts.map +1 -1
  729. package/build-types/index.d.ts +1 -1
  730. package/build-types/index.d.ts.map +1 -1
  731. package/build-types/input-control/backdrop.d.ts +0 -1
  732. package/build-types/input-control/backdrop.d.ts.map +1 -1
  733. package/build-types/input-control/input-base.d.ts +0 -1
  734. package/build-types/input-control/input-base.d.ts.map +1 -1
  735. package/build-types/input-control/input-field.d.ts +0 -1
  736. package/build-types/input-control/input-field.d.ts.map +1 -1
  737. package/build-types/input-control/input-prefix-wrapper.d.ts +0 -1
  738. package/build-types/input-control/input-prefix-wrapper.d.ts.map +1 -1
  739. package/build-types/input-control/input-suffix-wrapper.d.ts +0 -1
  740. package/build-types/input-control/input-suffix-wrapper.d.ts.map +1 -1
  741. package/build-types/input-control/label.d.ts +0 -1
  742. package/build-types/input-control/label.d.ts.map +1 -1
  743. package/build-types/input-control/reducer/reducer.d.ts +9 -9
  744. package/build-types/input-control/reducer/reducer.d.ts.map +1 -1
  745. package/build-types/input-control/stories/index.story.d.ts +0 -1
  746. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  747. package/build-types/input-control/styles/input-control-styles.d.ts +13 -13
  748. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  749. package/build-types/isolated-event-container/index.d.ts +0 -1
  750. package/build-types/isolated-event-container/index.d.ts.map +1 -1
  751. package/build-types/item-group/context.d.ts +0 -1
  752. package/build-types/item-group/context.d.ts.map +1 -1
  753. package/build-types/item-group/item/component.d.ts +0 -1
  754. package/build-types/item-group/item/component.d.ts.map +1 -1
  755. package/build-types/item-group/item/hook.d.ts +10 -12
  756. package/build-types/item-group/item/hook.d.ts.map +1 -1
  757. package/build-types/item-group/item-group/component.d.ts +0 -1
  758. package/build-types/item-group/item-group/component.d.ts.map +1 -1
  759. package/build-types/item-group/item-group/hook.d.ts +11 -13
  760. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  761. package/build-types/item-group/styles.d.ts +1 -1
  762. package/build-types/item-group/types.d.ts +0 -1
  763. package/build-types/item-group/types.d.ts.map +1 -1
  764. package/build-types/keyboard-shortcuts/index.d.ts +0 -1
  765. package/build-types/keyboard-shortcuts/index.d.ts.map +1 -1
  766. package/build-types/keyboard-shortcuts/types.d.ts +0 -1
  767. package/build-types/keyboard-shortcuts/types.d.ts.map +1 -1
  768. package/build-types/menu-group/index.d.ts +0 -1
  769. package/build-types/menu-group/index.d.ts.map +1 -1
  770. package/build-types/menu-item/index.d.ts +8 -9
  771. package/build-types/menu-item/index.d.ts.map +1 -1
  772. package/build-types/menu-item/stories/index.story.d.ts +32 -33
  773. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  774. package/build-types/menu-items-choice/index.d.ts +0 -1
  775. package/build-types/menu-items-choice/index.d.ts.map +1 -1
  776. package/build-types/menu-items-choice/types.d.ts +1 -1
  777. package/build-types/menu-items-choice/types.d.ts.map +1 -1
  778. package/build-types/modal/index.d.ts +0 -1
  779. package/build-types/modal/index.d.ts.map +1 -1
  780. package/build-types/navigable-container/container.d.ts +8 -8
  781. package/build-types/navigable-container/menu.d.ts +7 -7
  782. package/build-types/navigable-container/tabbable.d.ts +6 -6
  783. package/build-types/navigation/back-button/index.d.ts +0 -1
  784. package/build-types/navigation/back-button/index.d.ts.map +1 -1
  785. package/build-types/navigation/context.d.ts +0 -1
  786. package/build-types/navigation/context.d.ts.map +1 -1
  787. package/build-types/navigation/group/context.d.ts +0 -1
  788. package/build-types/navigation/group/context.d.ts.map +1 -1
  789. package/build-types/navigation/group/index.d.ts +0 -1
  790. package/build-types/navigation/group/index.d.ts.map +1 -1
  791. package/build-types/navigation/index.d.ts +0 -1
  792. package/build-types/navigation/index.d.ts.map +1 -1
  793. package/build-types/navigation/item/base-content.d.ts +0 -1
  794. package/build-types/navigation/item/base-content.d.ts.map +1 -1
  795. package/build-types/navigation/item/base.d.ts +0 -1
  796. package/build-types/navigation/item/base.d.ts.map +1 -1
  797. package/build-types/navigation/item/index.d.ts +0 -1
  798. package/build-types/navigation/item/index.d.ts.map +1 -1
  799. package/build-types/navigation/menu/context.d.ts +0 -1
  800. package/build-types/navigation/menu/context.d.ts.map +1 -1
  801. package/build-types/navigation/menu/index.d.ts +0 -1
  802. package/build-types/navigation/menu/index.d.ts.map +1 -1
  803. package/build-types/navigation/menu/menu-title-search.d.ts +0 -1
  804. package/build-types/navigation/menu/menu-title-search.d.ts.map +1 -1
  805. package/build-types/navigation/menu/menu-title.d.ts +0 -1
  806. package/build-types/navigation/menu/menu-title.d.ts.map +1 -1
  807. package/build-types/navigation/menu/search-no-results-found.d.ts +0 -1
  808. package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -1
  809. package/build-types/navigation/styles/navigation-styles.d.ts +25 -26
  810. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  811. package/build-types/navigation/types.d.ts +0 -1
  812. package/build-types/navigation/types.d.ts.map +1 -1
  813. package/build-types/navigation/use-navigation-tree-nodes.d.ts +0 -1
  814. package/build-types/navigation/use-navigation-tree-nodes.d.ts.map +1 -1
  815. package/build-types/navigator/context.d.ts +0 -1
  816. package/build-types/navigator/context.d.ts.map +1 -1
  817. package/build-types/navigator/navigator-back-button/component.d.ts +17 -18
  818. package/build-types/navigator/navigator-back-button/component.d.ts.map +1 -1
  819. package/build-types/navigator/navigator-back-button/hook.d.ts +29 -31
  820. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  821. package/build-types/navigator/navigator-button/component.d.ts +18 -19
  822. package/build-types/navigator/navigator-button/component.d.ts.map +1 -1
  823. package/build-types/navigator/navigator-button/hook.d.ts +29 -31
  824. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  825. package/build-types/navigator/navigator-provider/component.d.ts +0 -1
  826. package/build-types/navigator/navigator-provider/component.d.ts.map +1 -1
  827. package/build-types/navigator/navigator-screen/component.d.ts +0 -1
  828. package/build-types/navigator/navigator-screen/component.d.ts.map +1 -1
  829. package/build-types/navigator/navigator-to-parent-button/component.d.ts +17 -18
  830. package/build-types/navigator/navigator-to-parent-button/component.d.ts.map +1 -1
  831. package/build-types/navigator/stories/index.story.d.ts +4 -4
  832. package/build-types/navigator/stories/index.story.d.ts.map +1 -1
  833. package/build-types/notice/index.d.ts +0 -1
  834. package/build-types/notice/index.d.ts.map +1 -1
  835. package/build-types/notice/list.d.ts +0 -1
  836. package/build-types/notice/list.d.ts.map +1 -1
  837. package/build-types/number-control/index.d.ts +12 -13
  838. package/build-types/number-control/index.d.ts.map +1 -1
  839. package/build-types/number-control/stories/index.story.d.ts +12 -13
  840. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  841. package/build-types/number-control/styles/number-control-styles.d.ts +2 -3
  842. package/build-types/number-control/styles/number-control-styles.d.ts.map +1 -1
  843. package/build-types/palette-edit/index.d.ts +0 -1
  844. package/build-types/palette-edit/index.d.ts.map +1 -1
  845. package/build-types/palette-edit/styles.d.ts +16 -18
  846. package/build-types/palette-edit/styles.d.ts.map +1 -1
  847. package/build-types/panel/body.d.ts +0 -1
  848. package/build-types/panel/body.d.ts.map +1 -1
  849. package/build-types/panel/header.d.ts +0 -1
  850. package/build-types/panel/header.d.ts.map +1 -1
  851. package/build-types/panel/index.d.ts +0 -1
  852. package/build-types/panel/index.d.ts.map +1 -1
  853. package/build-types/panel/row.d.ts +0 -1
  854. package/build-types/panel/row.d.ts.map +1 -1
  855. package/build-types/panel/types.d.ts +0 -1
  856. package/build-types/panel/types.d.ts.map +1 -1
  857. package/build-types/placeholder/index.d.ts +0 -1
  858. package/build-types/placeholder/index.d.ts.map +1 -1
  859. package/build-types/popover/index.d.ts +0 -1
  860. package/build-types/popover/index.d.ts.map +1 -1
  861. package/build-types/popover/overlay-middlewares.d.ts +1 -11
  862. package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
  863. package/build-types/popover/stories/e2e/index.story.d.ts +0 -1
  864. package/build-types/popover/stories/e2e/index.story.d.ts.map +1 -1
  865. package/build-types/popover/stories/index.story.d.ts +6 -6
  866. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  867. package/build-types/popover/test/utils/index.d.ts +0 -1
  868. package/build-types/popover/test/utils/index.d.ts.map +1 -1
  869. package/build-types/popover/utils.d.ts +3 -3
  870. package/build-types/popover/utils.d.ts.map +1 -1
  871. package/build-types/private-apis.d.ts.map +1 -1
  872. package/build-types/progress-bar/index.d.ts +0 -1
  873. package/build-types/progress-bar/index.d.ts.map +1 -1
  874. package/build-types/progress-bar/stories/index.story.d.ts +0 -1
  875. package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
  876. package/build-types/progress-bar/styles.d.ts +6 -7
  877. package/build-types/progress-bar/styles.d.ts.map +1 -1
  878. package/build-types/query-controls/author-select.d.ts +0 -1
  879. package/build-types/query-controls/author-select.d.ts.map +1 -1
  880. package/build-types/query-controls/category-select.d.ts +0 -1
  881. package/build-types/query-controls/category-select.d.ts.map +1 -1
  882. package/build-types/query-controls/index.d.ts +0 -1
  883. package/build-types/query-controls/index.d.ts.map +1 -1
  884. package/build-types/radio-control/index.d.ts +0 -1
  885. package/build-types/radio-control/index.d.ts.map +1 -1
  886. package/build-types/radio-group/context.d.ts +2 -3
  887. package/build-types/radio-group/context.d.ts.map +1 -1
  888. package/build-types/radio-group/index.d.ts +0 -1
  889. package/build-types/radio-group/index.d.ts.map +1 -1
  890. package/build-types/radio-group/radio.d.ts +0 -1
  891. package/build-types/radio-group/radio.d.ts.map +1 -1
  892. package/build-types/radio-group/types.d.ts +0 -1
  893. package/build-types/radio-group/types.d.ts.map +1 -1
  894. package/build-types/range-control/index.d.ts +29 -29
  895. package/build-types/range-control/index.d.ts.map +1 -1
  896. package/build-types/range-control/input-range.d.ts +0 -1
  897. package/build-types/range-control/input-range.d.ts.map +1 -1
  898. package/build-types/range-control/mark.d.ts +0 -1
  899. package/build-types/range-control/mark.d.ts.map +1 -1
  900. package/build-types/range-control/rail.d.ts +0 -1
  901. package/build-types/range-control/rail.d.ts.map +1 -1
  902. package/build-types/range-control/styles/range-control-styles.d.ts +48 -49
  903. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  904. package/build-types/range-control/tooltip.d.ts +0 -1
  905. package/build-types/range-control/tooltip.d.ts.map +1 -1
  906. package/build-types/resizable-box/index.d.ts +7 -20
  907. package/build-types/resizable-box/index.d.ts.map +1 -1
  908. package/build-types/resizable-box/resize-tooltip/label.d.ts +0 -1
  909. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  910. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +7 -8
  911. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts.map +1 -1
  912. package/build-types/resizable-box/resize-tooltip/utils.d.ts +2 -3
  913. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  914. package/build-types/resizable-box/stories/index.story.d.ts +32 -39
  915. package/build-types/resizable-box/stories/index.story.d.ts.map +1 -1
  916. package/build-types/responsive-wrapper/index.d.ts +0 -1
  917. package/build-types/responsive-wrapper/index.d.ts.map +1 -1
  918. package/build-types/responsive-wrapper/types.d.ts +0 -1
  919. package/build-types/responsive-wrapper/types.d.ts.map +1 -1
  920. package/build-types/sandbox/index.d.ts +0 -1
  921. package/build-types/sandbox/index.d.ts.map +1 -1
  922. package/build-types/sandbox/types.d.ts +0 -1
  923. package/build-types/sandbox/types.d.ts.map +1 -1
  924. package/build-types/scrollable/component.d.ts +0 -1
  925. package/build-types/scrollable/component.d.ts.map +1 -1
  926. package/build-types/scrollable/hook.d.ts +9 -11
  927. package/build-types/scrollable/hook.d.ts.map +1 -1
  928. package/build-types/search-control/index.d.ts +0 -1
  929. package/build-types/search-control/index.d.ts.map +1 -1
  930. package/build-types/search-control/stories/index.story.d.ts +0 -1
  931. package/build-types/search-control/stories/index.story.d.ts.map +1 -1
  932. package/build-types/search-control/styles.d.ts +3 -4
  933. package/build-types/search-control/styles.d.ts.map +1 -1
  934. package/build-types/search-control/types.d.ts +0 -1
  935. package/build-types/search-control/types.d.ts.map +1 -1
  936. package/build-types/select-control/chevron-down.d.ts +0 -1
  937. package/build-types/select-control/chevron-down.d.ts.map +1 -1
  938. package/build-types/select-control/index.d.ts +0 -1
  939. package/build-types/select-control/index.d.ts.map +1 -1
  940. package/build-types/select-control/stories/index.story.d.ts +1 -1
  941. package/build-types/select-control/stories/index.story.d.ts.map +1 -1
  942. package/build-types/select-control/styles/select-control-styles.d.ts +11 -7
  943. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  944. package/build-types/select-control/types.d.ts +6 -0
  945. package/build-types/select-control/types.d.ts.map +1 -1
  946. package/build-types/shortcut/index.d.ts +0 -1
  947. package/build-types/shortcut/index.d.ts.map +1 -1
  948. package/build-types/slot-fill/bubbles-virtually/fill.d.ts +0 -1
  949. package/build-types/slot-fill/bubbles-virtually/fill.d.ts.map +1 -1
  950. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts +0 -1
  951. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
  952. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts +0 -1
  953. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  954. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -2
  955. package/build-types/slot-fill/bubbles-virtually/slot.d.ts.map +1 -1
  956. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  957. package/build-types/slot-fill/context.d.ts +0 -1
  958. package/build-types/slot-fill/context.d.ts.map +1 -1
  959. package/build-types/slot-fill/index.d.ts +4 -4
  960. package/build-types/slot-fill/index.d.ts.map +1 -1
  961. package/build-types/slot-fill/provider.d.ts +0 -1
  962. package/build-types/slot-fill/provider.d.ts.map +1 -1
  963. package/build-types/slot-fill/slot.d.ts +1 -2
  964. package/build-types/slot-fill/slot.d.ts.map +1 -1
  965. package/build-types/slot-fill/use-slot.d.ts +0 -1
  966. package/build-types/slot-fill/use-slot.d.ts.map +1 -1
  967. package/build-types/snackbar/index.d.ts +5 -6
  968. package/build-types/snackbar/index.d.ts.map +1 -1
  969. package/build-types/snackbar/list.d.ts +0 -1
  970. package/build-types/snackbar/list.d.ts.map +1 -1
  971. package/build-types/spacer/component.d.ts +0 -1
  972. package/build-types/spacer/component.d.ts.map +1 -1
  973. package/build-types/spacer/hook.d.ts +9 -11
  974. package/build-types/spacer/hook.d.ts.map +1 -1
  975. package/build-types/spinner/styles.d.ts +6 -7
  976. package/build-types/spinner/styles.d.ts.map +1 -1
  977. package/build-types/style-provider/index.d.ts +0 -1
  978. package/build-types/style-provider/index.d.ts.map +1 -1
  979. package/build-types/surface/component.d.ts +0 -1
  980. package/build-types/surface/component.d.ts.map +1 -1
  981. package/build-types/surface/hook.d.ts +10 -12
  982. package/build-types/surface/hook.d.ts.map +1 -1
  983. package/build-types/surface/types.d.ts +0 -1
  984. package/build-types/surface/types.d.ts.map +1 -1
  985. package/build-types/tab-panel/index.d.ts +0 -1
  986. package/build-types/tab-panel/index.d.ts.map +1 -1
  987. package/build-types/tab-panel/stories/index.story.d.ts +0 -1
  988. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  989. package/build-types/tabs/context.d.ts +0 -1
  990. package/build-types/tabs/context.d.ts.map +1 -1
  991. package/build-types/tabs/index.d.ts +0 -1
  992. package/build-types/tabs/index.d.ts.map +1 -1
  993. package/build-types/tabs/stories/index.story.d.ts.map +1 -1
  994. package/build-types/tabs/styles.d.ts +12 -13
  995. package/build-types/tabs/styles.d.ts.map +1 -1
  996. package/build-types/tabs/tab.d.ts +0 -1
  997. package/build-types/tabs/tab.d.ts.map +1 -1
  998. package/build-types/tabs/tablist.d.ts +0 -1
  999. package/build-types/tabs/tablist.d.ts.map +1 -1
  1000. package/build-types/tabs/tabpanel.d.ts +0 -1
  1001. package/build-types/tabs/tabpanel.d.ts.map +1 -1
  1002. package/build-types/tabs/types.d.ts +0 -1
  1003. package/build-types/tabs/types.d.ts.map +1 -1
  1004. package/build-types/text/component.d.ts +0 -1
  1005. package/build-types/text/component.d.ts.map +1 -1
  1006. package/build-types/text/hook.d.ts +9 -9
  1007. package/build-types/text/stories/index.story.d.ts +0 -1
  1008. package/build-types/text/stories/index.story.d.ts.map +1 -1
  1009. package/build-types/text/utils.d.ts +0 -1
  1010. package/build-types/text/utils.d.ts.map +1 -1
  1011. package/build-types/text-control/index.d.ts +2 -3
  1012. package/build-types/text-control/index.d.ts.map +1 -1
  1013. package/build-types/text-highlight/index.d.ts +0 -1
  1014. package/build-types/text-highlight/index.d.ts.map +1 -1
  1015. package/build-types/textarea-control/index.d.ts +2 -2
  1016. package/build-types/textarea-control/index.d.ts.map +1 -1
  1017. package/build-types/textarea-control/styles/textarea-control-styles.d.ts +2 -3
  1018. package/build-types/textarea-control/styles/textarea-control-styles.d.ts.map +1 -1
  1019. package/build-types/theme/color-algorithms.d.ts +1 -9
  1020. package/build-types/theme/color-algorithms.d.ts.map +1 -1
  1021. package/build-types/theme/index.d.ts +0 -1
  1022. package/build-types/theme/index.d.ts.map +1 -1
  1023. package/build-types/theme/stories/index.story.d.ts +0 -1
  1024. package/build-types/theme/stories/index.story.d.ts.map +1 -1
  1025. package/build-types/theme/styles.d.ts +2 -3
  1026. package/build-types/theme/styles.d.ts.map +1 -1
  1027. package/build-types/tip/index.d.ts +0 -1
  1028. package/build-types/tip/index.d.ts.map +1 -1
  1029. package/build-types/toggle-control/index.d.ts.map +1 -1
  1030. package/build-types/toggle-control/stories/index.story.d.ts +0 -1
  1031. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  1032. package/build-types/toggle-group-control/context.d.ts +0 -1
  1033. package/build-types/toggle-group-control/context.d.ts.map +1 -1
  1034. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +0 -1
  1035. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  1036. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +0 -1
  1037. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  1038. package/build-types/toggle-group-control/toggle-group-control/component.d.ts +8 -9
  1039. package/build-types/toggle-group-control/toggle-group-control/component.d.ts.map +1 -1
  1040. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +5 -6
  1041. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts.map +1 -1
  1042. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +0 -1
  1043. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  1044. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +1 -2
  1045. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  1046. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +5 -6
  1047. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  1048. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +0 -1
  1049. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  1050. package/build-types/toolbar/stories/index.story.d.ts +0 -1
  1051. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  1052. package/build-types/toolbar/toolbar/index.d.ts +0 -1
  1053. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  1054. package/build-types/toolbar/toolbar/toolbar-container.d.ts +0 -1
  1055. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  1056. package/build-types/toolbar/toolbar/types.d.ts +6 -0
  1057. package/build-types/toolbar/toolbar/types.d.ts.map +1 -1
  1058. package/build-types/toolbar/toolbar-button/index.d.ts +3 -97
  1059. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  1060. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +0 -1
  1061. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -1
  1062. package/build-types/toolbar/toolbar-button/types.d.ts +18 -0
  1063. package/build-types/toolbar/toolbar-button/types.d.ts.map +1 -1
  1064. package/build-types/toolbar/toolbar-context/index.d.ts +0 -1
  1065. package/build-types/toolbar/toolbar-context/index.d.ts.map +1 -1
  1066. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts +0 -1
  1067. package/build-types/toolbar/toolbar-dropdown-menu/index.d.ts.map +1 -1
  1068. package/build-types/toolbar/toolbar-group/index.d.ts +0 -1
  1069. package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -1
  1070. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts +0 -1
  1071. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -1
  1072. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +1 -2
  1073. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -1
  1074. package/build-types/toolbar/toolbar-item/index.d.ts +2 -5
  1075. package/build-types/toolbar/toolbar-item/index.d.ts.map +1 -1
  1076. package/build-types/tools-panel/context.d.ts +0 -1
  1077. package/build-types/tools-panel/context.d.ts.map +1 -1
  1078. package/build-types/tools-panel/styles.d.ts +2 -3
  1079. package/build-types/tools-panel/styles.d.ts.map +1 -1
  1080. package/build-types/tools-panel/tools-panel/component.d.ts +0 -1
  1081. package/build-types/tools-panel/tools-panel/component.d.ts.map +1 -1
  1082. package/build-types/tools-panel/tools-panel/hook.d.ts +10 -12
  1083. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  1084. package/build-types/tools-panel/tools-panel-header/component.d.ts +0 -1
  1085. package/build-types/tools-panel/tools-panel-header/component.d.ts.map +1 -1
  1086. package/build-types/tools-panel/tools-panel-header/hook.d.ts +11 -13
  1087. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  1088. package/build-types/tools-panel/tools-panel-item/component.d.ts +3 -4
  1089. package/build-types/tools-panel/tools-panel-item/component.d.ts.map +1 -1
  1090. package/build-types/tools-panel/tools-panel-item/hook.d.ts +9 -11
  1091. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  1092. package/build-types/tooltip/index.d.ts +0 -1
  1093. package/build-types/tooltip/index.d.ts.map +1 -1
  1094. package/build-types/tooltip/stories/index.story.d.ts +0 -1
  1095. package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
  1096. package/build-types/tooltip/types.d.ts +4 -1
  1097. package/build-types/tooltip/types.d.ts.map +1 -1
  1098. package/build-types/tree-grid/cell.d.ts +0 -1
  1099. package/build-types/tree-grid/cell.d.ts.map +1 -1
  1100. package/build-types/tree-grid/index.d.ts +0 -1
  1101. package/build-types/tree-grid/index.d.ts.map +1 -1
  1102. package/build-types/tree-grid/item.d.ts +0 -1
  1103. package/build-types/tree-grid/item.d.ts.map +1 -1
  1104. package/build-types/tree-grid/roving-tab-index-context.d.ts +0 -1
  1105. package/build-types/tree-grid/roving-tab-index-context.d.ts.map +1 -1
  1106. package/build-types/tree-grid/roving-tab-index-item.d.ts +0 -1
  1107. package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
  1108. package/build-types/tree-grid/roving-tab-index.d.ts +0 -1
  1109. package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -1
  1110. package/build-types/tree-grid/row.d.ts +0 -1
  1111. package/build-types/tree-grid/row.d.ts.map +1 -1
  1112. package/build-types/tree-grid/stories/index.story.d.ts +0 -1
  1113. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  1114. package/build-types/tree-grid/types.d.ts +0 -1
  1115. package/build-types/tree-grid/types.d.ts.map +1 -1
  1116. package/build-types/tree-select/index.d.ts +1 -1
  1117. package/build-types/tree-select/index.d.ts.map +1 -1
  1118. package/build-types/truncate/component.d.ts +0 -1
  1119. package/build-types/truncate/component.d.ts.map +1 -1
  1120. package/build-types/truncate/hook.d.ts +9 -11
  1121. package/build-types/truncate/hook.d.ts.map +1 -1
  1122. package/build-types/truncate/utils.d.ts.map +1 -1
  1123. package/build-types/unit-control/index.d.ts +7 -8
  1124. package/build-types/unit-control/index.d.ts.map +1 -1
  1125. package/build-types/unit-control/styles/unit-control-styles.d.ts +17 -18
  1126. package/build-types/unit-control/styles/unit-control-styles.d.ts.map +1 -1
  1127. package/build-types/unit-control/unit-select-control.d.ts +0 -1
  1128. package/build-types/unit-control/unit-select-control.d.ts.map +1 -1
  1129. package/build-types/unit-control/utils.d.ts.map +1 -1
  1130. package/build-types/utils/breakpoint.d.ts +1 -10
  1131. package/build-types/utils/breakpoint.d.ts.map +1 -1
  1132. package/build-types/utils/element-rect.d.ts +111 -0
  1133. package/build-types/utils/element-rect.d.ts.map +1 -0
  1134. package/build-types/utils/font.d.ts +1 -6
  1135. package/build-types/utils/font.d.ts.map +1 -1
  1136. package/build-types/utils/hooks/use-controlled-state.d.ts +1 -1
  1137. package/build-types/utils/hooks/use-controlled-state.d.ts.map +1 -1
  1138. package/build-types/utils/hooks/use-controlled-value.d.ts +0 -1
  1139. package/build-types/utils/hooks/use-controlled-value.d.ts.map +1 -1
  1140. package/build-types/utils/hooks/use-event.d.ts +20 -0
  1141. package/build-types/utils/hooks/use-event.d.ts.map +1 -0
  1142. package/build-types/utils/hooks/use-on-value-update.d.ts +19 -0
  1143. package/build-types/utils/hooks/use-on-value-update.d.ts.map +1 -0
  1144. package/build-types/utils/hooks/use-update-effect.d.ts +2 -2
  1145. package/build-types/utils/hooks/use-update-effect.d.ts.map +1 -1
  1146. package/build-types/utils/math.d.ts.map +1 -1
  1147. package/build-types/utils/rtl.d.ts +2 -2
  1148. package/build-types/utils/values.d.ts +2 -2
  1149. package/build-types/utils/values.d.ts.map +1 -1
  1150. package/build-types/utils/with-ignore-ime-events.d.ts +0 -1
  1151. package/build-types/utils/with-ignore-ime-events.d.ts.map +1 -1
  1152. package/build-types/v-stack/component.d.ts +2 -3
  1153. package/build-types/v-stack/component.d.ts.map +1 -1
  1154. package/build-types/v-stack/hook.d.ts +9 -11
  1155. package/build-types/v-stack/hook.d.ts.map +1 -1
  1156. package/build-types/v-stack/stories/index.story.d.ts +2 -3
  1157. package/build-types/v-stack/stories/index.story.d.ts.map +1 -1
  1158. package/build-types/view/component.d.ts +0 -2
  1159. package/build-types/view/component.d.ts.map +1 -1
  1160. package/build-types/visually-hidden/component.d.ts +0 -1
  1161. package/build-types/visually-hidden/component.d.ts.map +1 -1
  1162. package/build-types/z-stack/component.d.ts +0 -1
  1163. package/build-types/z-stack/component.d.ts.map +1 -1
  1164. package/build-types/z-stack/styles.d.ts +4 -5
  1165. package/build-types/z-stack/styles.d.ts.map +1 -1
  1166. package/package.json +19 -20
  1167. package/src/animation/index.tsx +0 -1
  1168. package/src/autocomplete/README.md +2 -2
  1169. package/src/autocomplete/autocompleter-ui.tsx +1 -0
  1170. package/src/autocomplete/index.tsx +0 -1
  1171. package/src/autocomplete/types.ts +2 -3
  1172. package/src/base-control/README.md +1 -1
  1173. package/src/base-control/index.tsx +16 -6
  1174. package/src/base-control/stories/index.story.tsx +0 -1
  1175. package/src/base-control/types.ts +1 -1
  1176. package/src/border-box-control/border-box-control-visualizer/component.tsx +0 -5
  1177. package/src/button/README.md +14 -1
  1178. package/src/button/index.tsx +15 -11
  1179. package/src/button/stories/e2e/index.story.tsx +2 -1
  1180. package/src/button/test/index.tsx +34 -6
  1181. package/src/button/types.ts +36 -12
  1182. package/src/card/card/README.md +1 -1
  1183. package/src/card/stories/index.story.tsx +43 -42
  1184. package/src/checkbox-control/README.md +8 -0
  1185. package/src/checkbox-control/index.tsx +1 -0
  1186. package/src/checkbox-control/style.scss +3 -1
  1187. package/src/color-picker/component.tsx +12 -22
  1188. package/src/color-picker/stories/index.story.tsx +2 -22
  1189. package/src/combobox-control/README.md +9 -0
  1190. package/src/combobox-control/index.tsx +13 -0
  1191. package/src/combobox-control/test/index.tsx +127 -1
  1192. package/src/composite/current/index.ts +0 -2
  1193. package/src/custom-select-control/README.md +34 -32
  1194. package/src/custom-select-control/index.tsx +176 -0
  1195. package/src/custom-select-control/stories/index.story.tsx +26 -18
  1196. package/src/{custom-select-control-v2/legacy-component → custom-select-control}/test/index.tsx +89 -57
  1197. package/src/custom-select-control/types.ts +123 -0
  1198. package/src/custom-select-control-v2/custom-select.tsx +59 -22
  1199. package/src/custom-select-control-v2/index.tsx +26 -1
  1200. package/src/custom-select-control-v2/item.tsx +5 -1
  1201. package/src/custom-select-control-v2/stories/{default.story.tsx → index.story.tsx} +1 -1
  1202. package/src/custom-select-control-v2/styles.ts +179 -84
  1203. package/src/custom-select-control-v2/test/index.tsx +35 -5
  1204. package/src/custom-select-control-v2/types.ts +18 -115
  1205. package/src/date-time/README.md +8 -0
  1206. package/src/date-time/date-time/index.tsx +2 -1
  1207. package/src/date-time/index.ts +2 -1
  1208. package/src/date-time/stories/time-input.story.tsx +36 -0
  1209. package/src/date-time/time/index.tsx +77 -194
  1210. package/src/date-time/time/test/index.tsx +61 -0
  1211. package/src/date-time/time-input/index.tsx +196 -0
  1212. package/src/date-time/time-input/test/index.tsx +171 -0
  1213. package/src/date-time/types.ts +63 -0
  1214. package/src/date-time/utils.ts +69 -0
  1215. package/src/dimension-control/test/__snapshots__/index.test.js.snap +120 -96
  1216. package/src/disabled/README.md +1 -1
  1217. package/src/disclosure/index.tsx +0 -1
  1218. package/src/divider/component.tsx +0 -1
  1219. package/src/divider/types.ts +0 -1
  1220. package/src/dropdown/stories/index.story.tsx +55 -50
  1221. package/src/dropdown-menu/index.tsx +1 -0
  1222. package/src/dropdown-menu/stories/index.story.tsx +52 -55
  1223. package/src/dropdown-menu-v2/index.tsx +0 -1
  1224. package/src/dropdown-menu-v2/stories/index.story.tsx +0 -12
  1225. package/src/dropdown-menu-v2/styles.ts +3 -4
  1226. package/src/dropdown-menu-v2/types.ts +0 -1
  1227. package/src/focal-point-picker/README.md +9 -0
  1228. package/src/focal-point-picker/index.tsx +1 -0
  1229. package/src/font-size-picker/README.md +1 -1
  1230. package/src/font-size-picker/font-size-picker-select.tsx +2 -2
  1231. package/src/font-size-picker/index.tsx +69 -65
  1232. package/src/font-size-picker/test/index.tsx +89 -21
  1233. package/src/font-size-picker/types.ts +6 -5
  1234. package/src/font-size-picker/utils.ts +0 -5
  1235. package/src/form-toggle/style.scss +14 -9
  1236. package/src/form-token-field/README.md +2 -1
  1237. package/src/form-token-field/index.tsx +9 -0
  1238. package/src/form-token-field/stories/index.story.tsx +2 -0
  1239. package/src/form-token-field/token.tsx +2 -0
  1240. package/src/higher-order/navigate-regions/style.scss +14 -14
  1241. package/src/higher-order/with-spoken-messages/index.tsx +1 -2
  1242. package/src/index.ts +1 -1
  1243. package/src/menu-items-choice/types.ts +2 -1
  1244. package/src/mobile/bottom-sheet/bottom-sheet-navigation/navigation-screen.native.js +1 -1
  1245. package/src/navigator/stories/index.story.tsx +240 -242
  1246. package/src/notice/test/__snapshots__/index.tsx.snap +1 -1
  1247. package/src/palette-edit/test/index.tsx +1 -0
  1248. package/src/popover/index.tsx +0 -2
  1249. package/src/popover/stories/index.story.tsx +155 -153
  1250. package/src/popover/utils.ts +0 -1
  1251. package/src/private-apis.ts +0 -7
  1252. package/src/progress-bar/styles.ts +18 -9
  1253. package/src/radio-control/index.tsx +1 -1
  1254. package/src/radio-control/style.scss +6 -1
  1255. package/src/radio-group/context.tsx +0 -1
  1256. package/src/radio-group/index.tsx +0 -1
  1257. package/src/radio-group/radio.tsx +0 -1
  1258. package/src/range-control/README.md +8 -0
  1259. package/src/range-control/index.tsx +3 -0
  1260. package/src/range-control/styles/range-control-styles.ts +6 -2
  1261. package/src/resizable-box/resize-tooltip/README.md +1 -1
  1262. package/src/resizable-box/resize-tooltip/utils.ts +1 -1
  1263. package/src/select-control/README.md +8 -0
  1264. package/src/select-control/index.tsx +10 -4
  1265. package/src/select-control/stories/index.story.tsx +6 -0
  1266. package/src/select-control/styles/select-control-styles.ts +41 -7
  1267. package/src/select-control/types.ts +6 -0
  1268. package/src/style.scss +1 -1
  1269. package/src/tab-panel/index.tsx +0 -1
  1270. package/src/tabs/index.tsx +0 -1
  1271. package/src/tabs/stories/index.story.tsx +25 -18
  1272. package/src/tabs/styles.ts +28 -16
  1273. package/src/tabs/tablist.tsx +4 -100
  1274. package/src/tabs/types.ts +0 -1
  1275. package/src/textarea-control/README.md +8 -0
  1276. package/src/textarea-control/index.tsx +1 -0
  1277. package/src/theme/stories/index.story.tsx +2 -0
  1278. package/src/toggle-control/index.tsx +12 -3
  1279. package/src/toggle-control/style.scss +11 -0
  1280. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +36 -6
  1281. package/src/toggle-group-control/test/index.tsx +114 -0
  1282. package/src/toggle-group-control/toggle-group-control/as-radio-group.tsx +0 -1
  1283. package/src/toggle-group-control/toggle-group-control/component.tsx +0 -2
  1284. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +6 -3
  1285. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +5 -0
  1286. package/src/toolbar/toolbar/README.md +9 -0
  1287. package/src/toolbar/toolbar/style.scss +7 -0
  1288. package/src/toolbar/toolbar/toolbar-container.tsx +0 -1
  1289. package/src/toolbar/toolbar/types.ts +6 -0
  1290. package/src/toolbar/toolbar-button/index.tsx +30 -17
  1291. package/src/toolbar/toolbar-button/types.ts +19 -0
  1292. package/src/toolbar/toolbar-context/index.ts +0 -1
  1293. package/src/toolbar/toolbar-item/index.tsx +1 -1
  1294. package/src/tools-panel/tools-panel-header/component.tsx +1 -1
  1295. package/src/tooltip/index.tsx +3 -2
  1296. package/src/tooltip/test/index.tsx +18 -0
  1297. package/src/tooltip/types.ts +4 -0
  1298. package/src/tree-select/README.md +9 -0
  1299. package/src/tree-select/index.tsx +1 -0
  1300. package/src/unit-control/index.tsx +3 -2
  1301. package/src/unit-control/styles/unit-control-styles.ts +10 -4
  1302. package/src/utils/element-rect.ts +197 -0
  1303. package/src/utils/hooks/use-event.ts +38 -0
  1304. package/src/utils/hooks/use-on-value-update.ts +42 -0
  1305. package/src/utils/hooks/use-update-effect.js +8 -1
  1306. package/tsconfig.tsbuildinfo +1 -1
  1307. package/build/custom-select-control-v2/default-component/index.js +0 -43
  1308. package/build/custom-select-control-v2/default-component/index.js.map +0 -1
  1309. package/build/custom-select-control-v2/legacy-component/index.js +0 -119
  1310. package/build/custom-select-control-v2/legacy-component/index.js.map +0 -1
  1311. package/build-module/custom-select-control-v2/default-component/index.js +0 -32
  1312. package/build-module/custom-select-control-v2/default-component/index.js.map +0 -1
  1313. package/build-module/custom-select-control-v2/legacy-component/index.js +0 -110
  1314. package/build-module/custom-select-control-v2/legacy-component/index.js.map +0 -1
  1315. package/build-types/custom-select-control-v2/default-component/index.d.ts +0 -9
  1316. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +0 -1
  1317. package/build-types/custom-select-control-v2/legacy-component/index.d.ts +0 -5
  1318. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +0 -1
  1319. package/build-types/custom-select-control-v2/legacy-component/test/index.d.ts.map +0 -1
  1320. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +0 -1
  1321. package/build-types/custom-select-control-v2/stories/legacy.story.d.ts +0 -14
  1322. package/build-types/custom-select-control-v2/stories/legacy.story.d.ts.map +0 -1
  1323. package/src/custom-select-control/index.js +0 -240
  1324. package/src/custom-select-control/style.scss +0 -75
  1325. package/src/custom-select-control/test/index.js +0 -629
  1326. package/src/custom-select-control-v2/default-component/index.tsx +0 -30
  1327. package/src/custom-select-control-v2/legacy-component/index.tsx +0 -132
  1328. package/src/custom-select-control-v2/stories/legacy.story.tsx +0 -72
  1329. /package/build-types/{custom-select-control-v2/legacy-component → custom-select-control}/test/index.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useLayoutEffect","useRef","useEffect","useState","useAnchor","useDebounce","useMergeRefs","useRefEffect","speak","__","_n","sprintf","getDefaultUseItems","Button","Popover","VisuallyHidden","createPortal","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ListBox","items","onSelect","selectedIndex","instanceId","listBoxId","className","Component","id","role","children","map","option","index","key","disabled","isDisabled","onClick","label","getAutoCompleterUI","autocompleter","_autocompleter$useIte","useItems","AutocompleterUI","filterValue","onChangeOptions","onReset","reset","contentRef","popoverAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","popoverRef","popoverRefs","node","ownerDocument","useOnClickOutside","debouncedSpeak","announce","options","length","focusOnMount","onClose","placement","anchor","ref","body","handler","listener","event","contains","target","document","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useAnchor } from '@wordpress/rich-text';\nimport { useDebounce, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport getDefaultUseItems from './get-default-use-items';\nimport Button from '../button';\nimport Popover from '../popover';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { createPortal } from 'react-dom';\nimport type { AutocompleterUIProps, KeyedOption, WPCompleter } from './types';\n\ntype ListBoxProps = {\n\titems: KeyedOption[];\n\tonSelect: ( option: KeyedOption ) => void;\n\tselectedIndex: number;\n\tinstanceId: number;\n\tlistBoxId: string | undefined;\n\tclassName?: string;\n\tComponent?: React.ElementType;\n};\n\nfunction ListBox( {\n\titems,\n\tonSelect,\n\tselectedIndex,\n\tinstanceId,\n\tlistBoxId,\n\tclassName,\n\tComponent = 'div',\n}: ListBoxProps ) {\n\treturn (\n\t\t<Component\n\t\t\tid={ listBoxId }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"components-autocomplete__results\"\n\t\t>\n\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t<Button\n\t\t\t\t\tkey={ option.key }\n\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t>\n\t\t\t\t\t{ option.label }\n\t\t\t\t</Button>\n\t\t\t) ) }\n\t\t</Component>\n\t);\n}\n\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems =\n\t\tautocompleter.useItems ?? getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tinstanceId,\n\t\tlistBoxId,\n\t\tclassName,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tonReset,\n\t\treset,\n\t\tcontentRef,\n\t}: AutocompleterUIProps ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst popoverAnchor = useAnchor( {\n\t\t\teditableContentElement: contentRef.current,\n\t\t} );\n\n\t\tconst [ needsA11yCompat, setNeedsA11yCompat ] = useState( false );\n\t\tconst popoverRef = useRef< HTMLElement >( null );\n\t\tconst popoverRefs = useMergeRefs( [\n\t\t\tpopoverRef,\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tif ( ! contentRef.current ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the popover is rendered in a different document than\n\t\t\t\t\t// the content, we need to duplicate the options list in the\n\t\t\t\t\t// content document so that it's available to the screen\n\t\t\t\t\t// readers, which check the DOM ID based aria-* attributes.\n\t\t\t\t\tsetNeedsA11yCompat(\n\t\t\t\t\t\tnode.ownerDocument !== contentRef.current.ownerDocument\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t[ contentRef ]\n\t\t\t),\n\t\t] );\n\n\t\tuseOnClickOutside( popoverRef, reset );\n\n\t\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\t\tfunction announce( options: Array< KeyedOption > ) {\n\t\t\tif ( ! debouncedSpeak ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !! options.length ) {\n\t\t\t\tif ( filterValue ) {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t\t}\n\t\t}\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tannounce( items );\n\t\t\t// 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\treturn (\n\t\t\t<>\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tonClose={ onReset }\n\t\t\t\t\tplacement=\"top-start\"\n\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tref={ popoverRefs }\n\t\t\t\t>\n\t\t\t\t\t<ListBox\n\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{ contentRef.current &&\n\t\t\t\t\tneedsA11yCompat &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<ListBox\n\t\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tComponent={ VisuallyHidden }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\tcontentRef.current.ownerDocument.body\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nfunction useOnClickOutside(\n\tref: React.RefObject< HTMLElement >,\n\thandler: AutocompleterUIProps[ 'reset' ]\n) {\n\tuseEffect( () => {\n\t\tconst listener = ( event: MouseEvent | TouchEvent ) => {\n\t\t\t// Do nothing if clicking ref's element or descendent elements, or if the ref is not referencing an element\n\t\t\tif (\n\t\t\t\t! ref.current ||\n\t\t\t\tref.current.contains( event.target as Node )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandler( event );\n\t\t};\n\t\tdocument.addEventListener( 'mousedown', listener );\n\t\tdocument.addEventListener( 'touchstart', listener );\n\t\treturn () => {\n\t\t\tdocument.removeEventListener( 'mousedown', listener );\n\t\t\tdocument.removeEventListener( 'touchstart', listener );\n\t\t};\n\t\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":"AAAA;AAC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,UAAU,CAACG,OAAO,IACnBC,eAAe,IACfvC,YAAY,eACXE,IAAA,CAACK,OAAO;QACPC,KAAK,EAAGA,KAAO;QACfC,QAAQ,EAAGA,QAAU;QACrBC,aAAa,EAAGA,aAAe;QAC/BC,UAAU,EAAGA,UAAY;QACzBC,SAAS,EAAGA,SAAW;QACvBC,SAAS,EAAGA,SAAW;QACvBC,SAAS,EAAGf;MAAgB,CAC5B,CAAC,EACFoC,UAAU,CAACG,OAAO,CAACM,aAAa,CAACW,IAClC,CAAC;IAAA,CACD,CAAC;EAEL;EAEA,OAAOzB,eAAe;AACvB;AAEA,SAASe,iBAAiBA,CACzBS,GAAmC,EACnCE,OAAwC,EACvC;EACDtE,SAAS,CAAE,MAAM;IAChB,MAAMuE,QAAQ,GAAKC,KAA8B,IAAM;MACtD;MACA,IACC,CAAEJ,GAAG,CAAChB,OAAO,IACbgB,GAAG,CAAChB,OAAO,CAACqB,QAAQ,CAAED,KAAK,CAACE,MAAe,CAAC,EAC3C;QACD;MACD;MACAJ,OAAO,CAAEE,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,CAAED,OAAO,CAAG,CAAC;AACjB","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useLayoutEffect","useRef","useEffect","useState","useAnchor","useDebounce","useMergeRefs","useRefEffect","speak","__","_n","sprintf","getDefaultUseItems","Button","Popover","VisuallyHidden","createPortal","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ListBox","items","onSelect","selectedIndex","instanceId","listBoxId","className","Component","id","role","children","map","option","index","key","accessibleWhenDisabled","disabled","isDisabled","onClick","label","getAutoCompleterUI","autocompleter","_autocompleter$useIte","useItems","AutocompleterUI","filterValue","onChangeOptions","onReset","reset","contentRef","popoverAnchor","editableContentElement","current","needsA11yCompat","setNeedsA11yCompat","popoverRef","popoverRefs","node","ownerDocument","useOnClickOutside","debouncedSpeak","announce","options","length","focusOnMount","onClose","placement","anchor","ref","body","handler","listener","event","contains","target","document","addEventListener","removeEventListener"],"sources":["@wordpress/components/src/autocomplete/autocompleter-ui.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseLayoutEffect,\n\tuseRef,\n\tuseEffect,\n\tuseState,\n} from '@wordpress/element';\nimport { useAnchor } from '@wordpress/rich-text';\nimport { useDebounce, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { __, _n, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport getDefaultUseItems from './get-default-use-items';\nimport Button from '../button';\nimport Popover from '../popover';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { createPortal } from 'react-dom';\nimport type { AutocompleterUIProps, KeyedOption, WPCompleter } from './types';\n\ntype ListBoxProps = {\n\titems: KeyedOption[];\n\tonSelect: ( option: KeyedOption ) => void;\n\tselectedIndex: number;\n\tinstanceId: number;\n\tlistBoxId: string | undefined;\n\tclassName?: string;\n\tComponent?: React.ElementType;\n};\n\nfunction ListBox( {\n\titems,\n\tonSelect,\n\tselectedIndex,\n\tinstanceId,\n\tlistBoxId,\n\tclassName,\n\tComponent = 'div',\n}: ListBoxProps ) {\n\treturn (\n\t\t<Component\n\t\t\tid={ listBoxId }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"components-autocomplete__results\"\n\t\t>\n\t\t\t{ items.map( ( option, index ) => (\n\t\t\t\t<Button\n\t\t\t\t\tkey={ option.key }\n\t\t\t\t\tid={ `components-autocomplete-item-${ instanceId }-${ option.key }` }\n\t\t\t\t\trole=\"option\"\n\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tdisabled={ option.isDisabled }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'components-autocomplete__result',\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ () => onSelect( option ) }\n\t\t\t\t>\n\t\t\t\t\t{ option.label }\n\t\t\t\t</Button>\n\t\t\t) ) }\n\t\t</Component>\n\t);\n}\n\nexport function getAutoCompleterUI( autocompleter: WPCompleter ) {\n\tconst useItems =\n\t\tautocompleter.useItems ?? getDefaultUseItems( autocompleter );\n\n\tfunction AutocompleterUI( {\n\t\tfilterValue,\n\t\tinstanceId,\n\t\tlistBoxId,\n\t\tclassName,\n\t\tselectedIndex,\n\t\tonChangeOptions,\n\t\tonSelect,\n\t\tonReset,\n\t\treset,\n\t\tcontentRef,\n\t}: AutocompleterUIProps ) {\n\t\tconst [ items ] = useItems( filterValue );\n\t\tconst popoverAnchor = useAnchor( {\n\t\t\teditableContentElement: contentRef.current,\n\t\t} );\n\n\t\tconst [ needsA11yCompat, setNeedsA11yCompat ] = useState( false );\n\t\tconst popoverRef = useRef< HTMLElement >( null );\n\t\tconst popoverRefs = useMergeRefs( [\n\t\t\tpopoverRef,\n\t\t\tuseRefEffect(\n\t\t\t\t( node ) => {\n\t\t\t\t\tif ( ! contentRef.current ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the popover is rendered in a different document than\n\t\t\t\t\t// the content, we need to duplicate the options list in the\n\t\t\t\t\t// content document so that it's available to the screen\n\t\t\t\t\t// readers, which check the DOM ID based aria-* attributes.\n\t\t\t\t\tsetNeedsA11yCompat(\n\t\t\t\t\t\tnode.ownerDocument !== contentRef.current.ownerDocument\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t[ contentRef ]\n\t\t\t),\n\t\t] );\n\n\t\tuseOnClickOutside( popoverRef, reset );\n\n\t\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\t\tfunction announce( options: Array< KeyedOption > ) {\n\t\t\tif ( ! debouncedSpeak ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( !! options.length ) {\n\t\t\t\tif ( filterValue ) {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tdebouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\toptions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdebouncedSpeak( __( 'No results.' ), 'assertive' );\n\t\t\t}\n\t\t}\n\n\t\tuseLayoutEffect( () => {\n\t\t\tonChangeOptions( items );\n\t\t\tannounce( items );\n\t\t\t// 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\treturn (\n\t\t\t<>\n\t\t\t\t<Popover\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tonClose={ onReset }\n\t\t\t\t\tplacement=\"top-start\"\n\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tref={ popoverRefs }\n\t\t\t\t>\n\t\t\t\t\t<ListBox\n\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t/>\n\t\t\t\t</Popover>\n\t\t\t\t{ contentRef.current &&\n\t\t\t\t\tneedsA11yCompat &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<ListBox\n\t\t\t\t\t\t\titems={ items }\n\t\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tComponent={ VisuallyHidden }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\tcontentRef.current.ownerDocument.body\n\t\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn AutocompleterUI;\n}\n\nfunction useOnClickOutside(\n\tref: React.RefObject< HTMLElement >,\n\thandler: AutocompleterUIProps[ 'reset' ]\n) {\n\tuseEffect( () => {\n\t\tconst listener = ( event: MouseEvent | TouchEvent ) => {\n\t\t\t// Do nothing if clicking ref's element or descendent elements, or if the ref is not referencing an element\n\t\t\tif (\n\t\t\t\t! ref.current ||\n\t\t\t\tref.current.contains( event.target as Node )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandler( event );\n\t\t};\n\t\tdocument.addEventListener( 'mousedown', listener );\n\t\tdocument.addEventListener( 'touchstart', listener );\n\t\treturn () => {\n\t\t\tdocument.removeEventListener( 'mousedown', listener );\n\t\t\tdocument.removeEventListener( 'touchstart', listener );\n\t\t};\n\t\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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,eAAe,EACfC,MAAM,EACNC,SAAS,EACTC,QAAQ,QACF,oBAAoB;AAC3B,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,WAAW,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC5E,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,yBAAyB;AACxD,OAAOC,MAAM,MAAM,WAAW;AAC9B,OAAOC,OAAO,MAAM,YAAY;AAChC,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,YAAY,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAazC,SAASC,OAAOA,CAAE;EACjBC,KAAK;EACLC,QAAQ;EACRC,aAAa;EACbC,UAAU;EACVC,SAAS;EACTC,SAAS;EACTC,SAAS,GAAG;AACC,CAAC,EAAG;EACjB,oBACCZ,IAAA,CAACY,SAAS;IACTC,EAAE,EAAGH,SAAW;IAChBI,IAAI,EAAC,SAAS;IACdH,SAAS,EAAC,kCAAkC;IAAAI,QAAA,EA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,mBAAmB,CAAE,WAAW,EAAEN,QAAS,CAAC;MACrDI,QAAQ,CAACE,mBAAmB,CAAE,YAAY,EAAEN,QAAS,CAAC;IACvD,CAAC;IACD;IACA;IACA;EACD,CAAC,EAAE,CAAED,OAAO,CAAG,CAAC;AACjB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["removeAccents","renderToString","useEffect","useState","useRef","useMemo","useInstanceId","useMergeRefs","useRefEffect","create","slice","insert","isCollapsed","getTextContent","speak","isAppleOS","getAutoCompleterUI","escapeRegExp","withIgnoreIMEEvents","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","getNodeText","node","toString","Array","map","join","props","children","EMPTY_FILTERED_OPTIONS","useAutocomplete","record","onChange","onReplace","completers","contentRef","instanceId","selectedIndex","setSelectedIndex","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacing","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","html","select","option","getOptionCompletion","isDisabled","completion","value","isCompletionObject","obj","action","undefined","completionObject","reset","onChangeOptions","options","handleKeyDown","event","current","key","defaultPrevented","newIndex","label","preventDefault","textContent","completer","reduce","lastTrigger","currentCompleter","triggerIndex","lastIndexOf","lastTriggerIndex","allowContext","textWithoutTrigger","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","textAfterSelection","test","safeTrigger","text","match","RegExp","query","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","popover","onSelect","useLastDifferentValue","history","Set","add","size","delete","from","useAutocompleteProps","ref","onKeyDownRef","previousRecord","mergedRefs","element","_onKeyDown","addEventListener","removeEventListener","didUserInput","Autocomplete","isSelected"],"sources":["@wordpress/components/src/autocomplete/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport {\n\trenderToString,\n\tuseEffect,\n\tuseState,\n\tuseRef,\n\tuseMemo,\n} from '@wordpress/element';\nimport { __, _n } from '@wordpress/i18n';\nimport { useInstanceId, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport {\n\tcreate,\n\tslice,\n\tinsert,\n\tisCollapsed,\n\tgetTextContent,\n} from '@wordpress/rich-text';\nimport { speak } from '@wordpress/a11y';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { getAutoCompleterUI } from './autocompleter-ui';\nimport { escapeRegExp } from '../utils/strings';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport type {\n\tAutocompleteProps,\n\tAutocompleterUIProps,\n\tInsertOption,\n\tKeyedOption,\n\tOptionCompletion,\n\tReplaceOption,\n\tUseAutocompleteProps,\n\tWPCompleter,\n} from './types';\n\nconst getNodeText = ( node: React.ReactNode ): string => {\n\tif ( node === null ) {\n\t\treturn '';\n\t}\n\n\tswitch ( typeof node ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn node.toString();\n\t\t\tbreak;\n\t\tcase 'boolean':\n\t\t\treturn '';\n\t\t\tbreak;\n\t\tcase 'object': {\n\t\t\tif ( node instanceof Array ) {\n\t\t\t\treturn node.map( getNodeText ).join( '' );\n\t\t\t}\n\t\t\tif ( 'props' in node ) {\n\t\t\t\treturn getNodeText( node.props.children );\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\treturn '';\n\t}\n\n\treturn '';\n};\n\nconst EMPTY_FILTERED_OPTIONS: KeyedOption[] = [];\n\nexport function useAutocomplete( {\n\trecord,\n\tonChange,\n\tonReplace,\n\tcompleters,\n\tcontentRef,\n}: UseAutocompleteProps ) {\n\tconst instanceId = useInstanceId( useAutocomplete );\n\tconst [ selectedIndex, setSelectedIndex ] = useState( 0 );\n\n\tconst [ filteredOptions, setFilteredOptions ] = useState<\n\t\tArray< KeyedOption >\n\t>( EMPTY_FILTERED_OPTIONS );\n\tconst [ filterValue, setFilterValue ] =\n\t\tuseState< AutocompleterUIProps[ 'filterValue' ] >( '' );\n\tconst [ autocompleter, setAutocompleter ] = useState< WPCompleter | null >(\n\t\tnull\n\t);\n\tconst [ AutocompleterUI, setAutocompleterUI ] = useState<\n\t\t( ( props: AutocompleterUIProps ) => JSX.Element | null ) | null\n\t>( null );\n\n\tconst backspacing = useRef( false );\n\n\tfunction insertCompletion( replacement: React.ReactNode ) {\n\t\tif ( autocompleter === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst end = record.start;\n\t\tconst start =\n\t\t\tend - autocompleter.triggerPrefix.length - filterValue.length;\n\t\tconst toInsert = create( { html: renderToString( replacement ) } );\n\n\t\tonChange( insert( record, toInsert, start, end ) );\n\t}\n\n\tfunction select( option: KeyedOption ) {\n\t\tconst { getOptionCompletion } = autocompleter || {};\n\n\t\tif ( option.isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( getOptionCompletion ) {\n\t\t\tconst completion = getOptionCompletion( option.value, filterValue );\n\n\t\t\tconst isCompletionObject = (\n\t\t\t\tobj: OptionCompletion\n\t\t\t): obj is InsertOption | ReplaceOption => {\n\t\t\t\treturn (\n\t\t\t\t\tobj !== null &&\n\t\t\t\t\ttypeof obj === 'object' &&\n\t\t\t\t\t'action' in obj &&\n\t\t\t\t\tobj.action !== undefined &&\n\t\t\t\t\t'value' in obj &&\n\t\t\t\t\tobj.value !== undefined\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst completionObject = isCompletionObject( completion )\n\t\t\t\t? completion\n\t\t\t\t: ( {\n\t\t\t\t\t\taction: 'insert-at-caret',\n\t\t\t\t\t\tvalue: completion,\n\t\t\t\t } as InsertOption );\n\n\t\t\tif ( 'replace' === completionObject.action ) {\n\t\t\t\tonReplace( [ completionObject.value ] );\n\t\t\t\t// When replacing, the component will unmount, so don't reset\n\t\t\t\t// state (below) on an unmounted component.\n\t\t\t\treturn;\n\t\t\t} else if ( 'insert-at-caret' === completionObject.action ) {\n\t\t\t\tinsertCompletion( completionObject.value );\n\t\t\t}\n\t\t}\n\n\t\t// Reset autocomplete state after insertion rather than before\n\t\t// so insertion events don't cause the completion menu to redisplay.\n\t\treset();\n\t}\n\n\tfunction reset() {\n\t\tsetSelectedIndex( 0 );\n\t\tsetFilteredOptions( EMPTY_FILTERED_OPTIONS );\n\t\tsetFilterValue( '' );\n\t\tsetAutocompleter( null );\n\t\tsetAutocompleterUI( null );\n\t}\n\n\t/**\n\t * Load options for an autocompleter.\n\t *\n\t * @param {Array} options\n\t */\n\tfunction onChangeOptions( options: Array< KeyedOption > ) {\n\t\tsetSelectedIndex(\n\t\t\toptions.length === filteredOptions.length ? selectedIndex : 0\n\t\t);\n\t\tsetFilteredOptions( options );\n\t}\n\n\tfunction handleKeyDown( event: KeyboardEvent ) {\n\t\tbackspacing.current = event.key === 'Backspace';\n\n\t\tif ( ! autocompleter ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( filteredOptions.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( event.key ) {\n\t\t\tcase 'ArrowUp': {\n\t\t\t\tconst newIndex =\n\t\t\t\t\t( selectedIndex === 0\n\t\t\t\t\t\t? filteredOptions.length\n\t\t\t\t\t\t: selectedIndex ) - 1;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\t// See the related PR as to why this is necessary: https://github.com/WordPress/gutenberg/pull/54902.\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'ArrowDown': {\n\t\t\t\tconst newIndex = ( selectedIndex + 1 ) % filteredOptions.length;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'Escape':\n\t\t\t\tsetAutocompleter( null );\n\t\t\t\tsetAutocompleterUI( null );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tselect( filteredOptions[ selectedIndex ] );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowLeft':\n\t\t\tcase 'ArrowRight':\n\t\t\t\treset();\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Any handled key should prevent original behavior. This relies on\n\t\t// the early return in the default case.\n\t\tevent.preventDefault();\n\t}\n\n\t// textContent is a primitive (string), memoizing is not strictly necessary\n\t// but this is a preemptive performance improvement, since the autocompleter\n\t// is a potential bottleneck for the editor type metric.\n\tconst textContent = useMemo( () => {\n\t\tif ( isCollapsed( record ) ) {\n\t\t\treturn getTextContent( slice( record, 0 ) );\n\t\t}\n\t\treturn '';\n\t}, [ record ] );\n\n\tuseEffect( () => {\n\t\tif ( ! textContent ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Find the completer with the highest triggerPrefix index in the\n\t\t// textContent.\n\t\tconst completer = completers.reduce< WPCompleter | null >(\n\t\t\t( lastTrigger, currentCompleter ) => {\n\t\t\t\tconst triggerIndex = textContent.lastIndexOf(\n\t\t\t\t\tcurrentCompleter.triggerPrefix\n\t\t\t\t);\n\t\t\t\tconst lastTriggerIndex =\n\t\t\t\t\tlastTrigger !== null\n\t\t\t\t\t\t? textContent.lastIndexOf( lastTrigger.triggerPrefix )\n\t\t\t\t\t\t: -1;\n\n\t\t\t\treturn triggerIndex > lastTriggerIndex\n\t\t\t\t\t? currentCompleter\n\t\t\t\t\t: lastTrigger;\n\t\t\t},\n\t\t\tnull\n\t\t);\n\n\t\tif ( ! completer ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst { allowContext, triggerPrefix } = completer;\n\t\tconst triggerIndex = textContent.lastIndexOf( triggerPrefix );\n\t\tconst textWithoutTrigger = textContent.slice(\n\t\t\ttriggerIndex + triggerPrefix.length\n\t\t);\n\n\t\tconst tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.\n\t\t// This is a final barrier to prevent the effect from completing with\n\t\t// an extremely long string, which causes the editor to slow-down\n\t\t// significantly. This could happen, for example, if `matchingWhileBackspacing`\n\t\t// is true and one of the \"words\" end up being too long. If that's the case,\n\t\t// it will be caught by this guard.\n\t\tif ( tooDistantFromTrigger ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mismatch = filteredOptions.length === 0;\n\t\tconst wordsFromTrigger = textWithoutTrigger.split( /\\s/ );\n\t\t// We need to allow the effect to run when not backspacing and if there\n\t\t// was a mismatch. i.e when typing a trigger + the match string or when\n\t\t// clicking in an existing trigger word on the page. We do that if we\n\t\t// detect that we have one word from trigger in the current textual context.\n\t\t//\n\t\t// Ex.: \"Some text @a\" <-- \"@a\" will be detected as the trigger word and\n\t\t// allow the effect to run. It will run until there's a mismatch.\n\t\tconst hasOneTriggerWord = wordsFromTrigger.length === 1;\n\t\t// This is used to allow the effect to run when backspacing and if\n\t\t// \"touching\" a word that \"belongs\" to a trigger. We consider a \"trigger\n\t\t// word\" any word up to the limit of 3 from the trigger character.\n\t\t// Anything beyond that is ignored if there's a mismatch. This allows\n\t\t// us to \"escape\" a mismatch when backspacing, but still imposing some\n\t\t// sane limits.\n\t\t//\n\t\t// Ex: \"Some text @marcelo sekkkk\" <--- \"kkkk\" caused a mismatch, but\n\t\t// if the user presses backspace here, it will show the completion popup again.\n\t\tconst matchingWhileBackspacing =\n\t\t\tbackspacing.current && wordsFromTrigger.length <= 3;\n\n\t\tif ( mismatch && ! ( matchingWhileBackspacing || hasOneTriggerWord ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAfterSelection = getTextContent(\n\t\t\tslice( record, undefined, getTextContent( record ).length )\n\t\t);\n\n\t\tif (\n\t\t\tallowContext &&\n\t\t\t! allowContext(\n\t\t\t\ttextContent.slice( 0, triggerIndex ),\n\t\t\t\ttextAfterSelection\n\t\t\t)\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t/^\\s/.test( textWithoutTrigger ) ||\n\t\t\t/\\s\\s+$/.test( textWithoutTrigger )\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! /[\\u0000-\\uFFFF]*$/.test( textWithoutTrigger ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeTrigger = escapeRegExp( completer.triggerPrefix );\n\t\tconst text = removeAccents( textContent );\n\t\tconst match = text\n\t\t\t.slice( text.lastIndexOf( completer.triggerPrefix ) )\n\t\t\t.match( new RegExp( `${ safeTrigger }([\\u0000-\\uFFFF]*)$` ) );\n\t\tconst query = match && match[ 1 ];\n\n\t\tsetAutocompleter( completer );\n\t\tsetAutocompleterUI( () =>\n\t\t\tcompleter !== autocompleter\n\t\t\t\t? getAutoCompleterUI( completer )\n\t\t\t\t: AutocompleterUI\n\t\t);\n\t\tsetFilterValue( query === null ? '' : query );\n\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ textContent ] );\n\n\tconst { key: selectedKey = '' } = filteredOptions[ selectedIndex ] || {};\n\tconst { className } = autocompleter || {};\n\tconst isExpanded = !! autocompleter && filteredOptions.length > 0;\n\tconst listBoxId = isExpanded\n\t\t? `components-autocomplete-listbox-${ instanceId }`\n\t\t: undefined;\n\tconst activeId = isExpanded\n\t\t? `components-autocomplete-item-${ instanceId }-${ selectedKey }`\n\t\t: null;\n\tconst hasSelection = record.start !== undefined;\n\n\treturn {\n\t\tlistBoxId,\n\t\tactiveId,\n\t\tonKeyDown: withIgnoreIMEEvents( handleKeyDown ),\n\t\tpopover: hasSelection && AutocompleterUI && (\n\t\t\t<AutocompleterUI\n\t\t\t\tclassName={ className }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tinstanceId={ instanceId }\n\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\tonChangeOptions={ onChangeOptions }\n\t\t\t\tonSelect={ select }\n\t\t\t\tvalue={ record }\n\t\t\t\tcontentRef={ contentRef }\n\t\t\t\treset={ reset }\n\t\t\t/>\n\t\t),\n\t};\n}\n\nfunction useLastDifferentValue( value: UseAutocompleteProps[ 'record' ] ) {\n\tconst history = useRef< Set< typeof value > >( new Set() );\n\n\thistory.current.add( value );\n\n\t// Keep the history size to 2.\n\tif ( history.current.size > 2 ) {\n\t\thistory.current.delete( Array.from( history.current )[ 0 ] );\n\t}\n\n\treturn Array.from( history.current )[ 0 ];\n}\n\nexport function useAutocompleteProps( options: UseAutocompleteProps ) {\n\tconst ref = useRef< HTMLElement >( null );\n\tconst onKeyDownRef = useRef< ( event: KeyboardEvent ) => void >();\n\tconst { record } = options;\n\tconst previousRecord = useLastDifferentValue( record );\n\tconst { popover, listBoxId, activeId, onKeyDown } = useAutocomplete( {\n\t\t...options,\n\t\tcontentRef: ref,\n\t} );\n\tonKeyDownRef.current = onKeyDown;\n\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tuseRefEffect( ( element: HTMLElement ) => {\n\t\t\tfunction _onKeyDown( event: KeyboardEvent ) {\n\t\t\t\tonKeyDownRef.current?.( event );\n\t\t\t}\n\t\t\telement.addEventListener( 'keydown', _onKeyDown );\n\t\t\treturn () => {\n\t\t\t\telement.removeEventListener( 'keydown', _onKeyDown );\n\t\t\t};\n\t\t}, [] ),\n\t] );\n\n\t// We only want to show the popover if the user has typed something.\n\tconst didUserInput = record.text !== previousRecord?.text;\n\n\tif ( ! didUserInput ) {\n\t\treturn { ref: mergedRefs };\n\t}\n\n\treturn {\n\t\tref: mergedRefs,\n\t\tchildren: popover,\n\t\t'aria-autocomplete': listBoxId ? 'list' : undefined,\n\t\t'aria-owns': listBoxId,\n\t\t'aria-activedescendant': activeId,\n\t};\n}\n\nexport default function Autocomplete( {\n\tchildren,\n\tisSelected,\n\t...options\n}: AutocompleteProps ) {\n\tconst { popover, ...props } = useAutocomplete( options );\n\treturn (\n\t\t<>\n\t\t\t{ children( props ) }\n\t\t\t{ isSelected && popover }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SACCC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,OAAO,QACD,oBAAoB;AAE3B,SAASC,aAAa,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC9E,SACCC,MAAM,EACNC,KAAK,EACLC,MAAM,EACNC,WAAW,EACXC,cAAc,QACR,sBAAsB;AAC7B,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,mBAAmB,QAAQ,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAYtE,MAAMC,WAAW,GAAKC,IAAqB,IAAc;EACxD,IAAKA,IAAI,KAA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ACF;AAEA,eAAe,SAASsB,YAAYA,CAAE;EACrCnG,QAAQ;EACRoG,UAAU;EACV,GAAG3D;AACe,CAAC,EAAG;EACtB,MAAM;IAAEuC,OAAO;IAAE,GAAGjF;EAAM,CAAC,GAAGG,eAAe,CAAEuC,OAAQ,CAAC;EACxD,oBACCjD,KAAA,CAAAF,SAAA;IAAAU,QAAA,GACGA,QAAQ,CAAED,KAAM,CAAC,EACjBqG,UAAU,IAAIpB,OAAO;EAAA,CACtB,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["removeAccents","renderToString","useEffect","useState","useRef","useMemo","useInstanceId","useMergeRefs","useRefEffect","create","slice","insert","isCollapsed","getTextContent","speak","isAppleOS","getAutoCompleterUI","escapeRegExp","withIgnoreIMEEvents","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","getNodeText","node","toString","Array","map","join","props","children","EMPTY_FILTERED_OPTIONS","useAutocomplete","record","onChange","onReplace","completers","contentRef","instanceId","selectedIndex","setSelectedIndex","filteredOptions","setFilteredOptions","filterValue","setFilterValue","autocompleter","setAutocompleter","AutocompleterUI","setAutocompleterUI","backspacing","insertCompletion","replacement","end","start","triggerPrefix","length","toInsert","html","select","option","getOptionCompletion","isDisabled","completion","value","isCompletionObject","obj","action","undefined","completionObject","reset","onChangeOptions","options","handleKeyDown","event","current","key","defaultPrevented","newIndex","label","preventDefault","textContent","completer","reduce","lastTrigger","currentCompleter","triggerIndex","lastIndexOf","lastTriggerIndex","allowContext","textWithoutTrigger","tooDistantFromTrigger","mismatch","wordsFromTrigger","split","hasOneTriggerWord","matchingWhileBackspacing","textAfterSelection","test","safeTrigger","text","match","RegExp","query","selectedKey","className","isExpanded","listBoxId","activeId","hasSelection","onKeyDown","popover","onSelect","useLastDifferentValue","history","Set","add","size","delete","from","useAutocompleteProps","ref","onKeyDownRef","previousRecord","mergedRefs","element","_onKeyDown","addEventListener","removeEventListener","didUserInput","Autocomplete","isSelected"],"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 { useInstanceId, useMergeRefs, useRefEffect } from '@wordpress/compose';\nimport {\n\tcreate,\n\tslice,\n\tinsert,\n\tisCollapsed,\n\tgetTextContent,\n} from '@wordpress/rich-text';\nimport { speak } from '@wordpress/a11y';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { getAutoCompleterUI } from './autocompleter-ui';\nimport { escapeRegExp } from '../utils/strings';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\nimport type {\n\tAutocompleteProps,\n\tAutocompleterUIProps,\n\tInsertOption,\n\tKeyedOption,\n\tOptionCompletion,\n\tReplaceOption,\n\tUseAutocompleteProps,\n\tWPCompleter,\n} from './types';\n\nconst getNodeText = ( node: React.ReactNode ): string => {\n\tif ( node === null ) {\n\t\treturn '';\n\t}\n\n\tswitch ( typeof node ) {\n\t\tcase 'string':\n\t\tcase 'number':\n\t\t\treturn node.toString();\n\t\t\tbreak;\n\t\tcase 'boolean':\n\t\t\treturn '';\n\t\t\tbreak;\n\t\tcase 'object': {\n\t\t\tif ( node instanceof Array ) {\n\t\t\t\treturn node.map( getNodeText ).join( '' );\n\t\t\t}\n\t\t\tif ( 'props' in node ) {\n\t\t\t\treturn getNodeText( node.props.children );\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\treturn '';\n\t}\n\n\treturn '';\n};\n\nconst EMPTY_FILTERED_OPTIONS: KeyedOption[] = [];\n\nexport function useAutocomplete( {\n\trecord,\n\tonChange,\n\tonReplace,\n\tcompleters,\n\tcontentRef,\n}: UseAutocompleteProps ) {\n\tconst instanceId = useInstanceId( useAutocomplete );\n\tconst [ selectedIndex, setSelectedIndex ] = useState( 0 );\n\n\tconst [ filteredOptions, setFilteredOptions ] = useState<\n\t\tArray< KeyedOption >\n\t>( EMPTY_FILTERED_OPTIONS );\n\tconst [ filterValue, setFilterValue ] =\n\t\tuseState< AutocompleterUIProps[ 'filterValue' ] >( '' );\n\tconst [ autocompleter, setAutocompleter ] = useState< WPCompleter | null >(\n\t\tnull\n\t);\n\tconst [ AutocompleterUI, setAutocompleterUI ] = useState<\n\t\t( ( props: AutocompleterUIProps ) => JSX.Element | null ) | null\n\t>( null );\n\n\tconst backspacing = useRef( false );\n\n\tfunction insertCompletion( replacement: React.ReactNode ) {\n\t\tif ( autocompleter === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst end = record.start;\n\t\tconst start =\n\t\t\tend - autocompleter.triggerPrefix.length - filterValue.length;\n\t\tconst toInsert = create( { html: renderToString( replacement ) } );\n\n\t\tonChange( insert( record, toInsert, start, end ) );\n\t}\n\n\tfunction select( option: KeyedOption ) {\n\t\tconst { getOptionCompletion } = autocompleter || {};\n\n\t\tif ( option.isDisabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( getOptionCompletion ) {\n\t\t\tconst completion = getOptionCompletion( option.value, filterValue );\n\n\t\t\tconst isCompletionObject = (\n\t\t\t\tobj: OptionCompletion\n\t\t\t): obj is InsertOption | ReplaceOption => {\n\t\t\t\treturn (\n\t\t\t\t\tobj !== null &&\n\t\t\t\t\ttypeof obj === 'object' &&\n\t\t\t\t\t'action' in obj &&\n\t\t\t\t\tobj.action !== undefined &&\n\t\t\t\t\t'value' in obj &&\n\t\t\t\t\tobj.value !== undefined\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst completionObject = isCompletionObject( completion )\n\t\t\t\t? completion\n\t\t\t\t: ( {\n\t\t\t\t\t\taction: 'insert-at-caret',\n\t\t\t\t\t\tvalue: completion,\n\t\t\t\t } as InsertOption );\n\n\t\t\tif ( 'replace' === completionObject.action ) {\n\t\t\t\tonReplace( [ completionObject.value ] );\n\t\t\t\t// When replacing, the component will unmount, so don't reset\n\t\t\t\t// state (below) on an unmounted component.\n\t\t\t\treturn;\n\t\t\t} else if ( 'insert-at-caret' === completionObject.action ) {\n\t\t\t\tinsertCompletion( completionObject.value );\n\t\t\t}\n\t\t}\n\n\t\t// Reset autocomplete state after insertion rather than before\n\t\t// so insertion events don't cause the completion menu to redisplay.\n\t\treset();\n\t}\n\n\tfunction reset() {\n\t\tsetSelectedIndex( 0 );\n\t\tsetFilteredOptions( EMPTY_FILTERED_OPTIONS );\n\t\tsetFilterValue( '' );\n\t\tsetAutocompleter( null );\n\t\tsetAutocompleterUI( null );\n\t}\n\n\t/**\n\t * Load options for an autocompleter.\n\t *\n\t * @param {Array} options\n\t */\n\tfunction onChangeOptions( options: Array< KeyedOption > ) {\n\t\tsetSelectedIndex(\n\t\t\toptions.length === filteredOptions.length ? selectedIndex : 0\n\t\t);\n\t\tsetFilteredOptions( options );\n\t}\n\n\tfunction handleKeyDown( event: KeyboardEvent ) {\n\t\tbackspacing.current = event.key === 'Backspace';\n\n\t\tif ( ! autocompleter ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( filteredOptions.length === 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tswitch ( event.key ) {\n\t\t\tcase 'ArrowUp': {\n\t\t\t\tconst newIndex =\n\t\t\t\t\t( selectedIndex === 0\n\t\t\t\t\t\t? filteredOptions.length\n\t\t\t\t\t\t: selectedIndex ) - 1;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\t// See the related PR as to why this is necessary: https://github.com/WordPress/gutenberg/pull/54902.\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'ArrowDown': {\n\t\t\t\tconst newIndex = ( selectedIndex + 1 ) % filteredOptions.length;\n\t\t\t\tsetSelectedIndex( newIndex );\n\t\t\t\tif ( isAppleOS() ) {\n\t\t\t\t\tspeak(\n\t\t\t\t\t\tgetNodeText( filteredOptions[ newIndex ].label ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase 'Escape':\n\t\t\t\tsetAutocompleter( null );\n\t\t\t\tsetAutocompleterUI( null );\n\t\t\t\tevent.preventDefault();\n\t\t\t\tbreak;\n\n\t\t\tcase 'Enter':\n\t\t\t\tselect( filteredOptions[ selectedIndex ] );\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrowLeft':\n\t\t\tcase 'ArrowRight':\n\t\t\t\treset();\n\t\t\t\treturn;\n\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Any handled key should prevent original behavior. This relies on\n\t\t// the early return in the default case.\n\t\tevent.preventDefault();\n\t}\n\n\t// textContent is a primitive (string), memoizing is not strictly necessary\n\t// but this is a preemptive performance improvement, since the autocompleter\n\t// is a potential bottleneck for the editor type metric.\n\tconst textContent = useMemo( () => {\n\t\tif ( isCollapsed( record ) ) {\n\t\t\treturn getTextContent( slice( record, 0 ) );\n\t\t}\n\t\treturn '';\n\t}, [ record ] );\n\n\tuseEffect( () => {\n\t\tif ( ! textContent ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Find the completer with the highest triggerPrefix index in the\n\t\t// textContent.\n\t\tconst completer = completers.reduce< WPCompleter | null >(\n\t\t\t( lastTrigger, currentCompleter ) => {\n\t\t\t\tconst triggerIndex = textContent.lastIndexOf(\n\t\t\t\t\tcurrentCompleter.triggerPrefix\n\t\t\t\t);\n\t\t\t\tconst lastTriggerIndex =\n\t\t\t\t\tlastTrigger !== null\n\t\t\t\t\t\t? textContent.lastIndexOf( lastTrigger.triggerPrefix )\n\t\t\t\t\t\t: -1;\n\n\t\t\t\treturn triggerIndex > lastTriggerIndex\n\t\t\t\t\t? currentCompleter\n\t\t\t\t\t: lastTrigger;\n\t\t\t},\n\t\t\tnull\n\t\t);\n\n\t\tif ( ! completer ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst { allowContext, triggerPrefix } = completer;\n\t\tconst triggerIndex = textContent.lastIndexOf( triggerPrefix );\n\t\tconst textWithoutTrigger = textContent.slice(\n\t\t\ttriggerIndex + triggerPrefix.length\n\t\t);\n\n\t\tconst tooDistantFromTrigger = textWithoutTrigger.length > 50; // 50 chars seems to be a good limit.\n\t\t// This is a final barrier to prevent the effect from completing with\n\t\t// an extremely long string, which causes the editor to slow-down\n\t\t// significantly. This could happen, for example, if `matchingWhileBackspacing`\n\t\t// is true and one of the \"words\" end up being too long. If that's the case,\n\t\t// it will be caught by this guard.\n\t\tif ( tooDistantFromTrigger ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mismatch = filteredOptions.length === 0;\n\t\tconst wordsFromTrigger = textWithoutTrigger.split( /\\s/ );\n\t\t// We need to allow the effect to run when not backspacing and if there\n\t\t// was a mismatch. i.e when typing a trigger + the match string or when\n\t\t// clicking in an existing trigger word on the page. We do that if we\n\t\t// detect that we have one word from trigger in the current textual context.\n\t\t//\n\t\t// Ex.: \"Some text @a\" <-- \"@a\" will be detected as the trigger word and\n\t\t// allow the effect to run. It will run until there's a mismatch.\n\t\tconst hasOneTriggerWord = wordsFromTrigger.length === 1;\n\t\t// This is used to allow the effect to run when backspacing and if\n\t\t// \"touching\" a word that \"belongs\" to a trigger. We consider a \"trigger\n\t\t// word\" any word up to the limit of 3 from the trigger character.\n\t\t// Anything beyond that is ignored if there's a mismatch. This allows\n\t\t// us to \"escape\" a mismatch when backspacing, but still imposing some\n\t\t// sane limits.\n\t\t//\n\t\t// Ex: \"Some text @marcelo sekkkk\" <--- \"kkkk\" caused a mismatch, but\n\t\t// if the user presses backspace here, it will show the completion popup again.\n\t\tconst matchingWhileBackspacing =\n\t\t\tbackspacing.current && wordsFromTrigger.length <= 3;\n\n\t\tif ( mismatch && ! ( matchingWhileBackspacing || hasOneTriggerWord ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst textAfterSelection = getTextContent(\n\t\t\tslice( record, undefined, getTextContent( record ).length )\n\t\t);\n\n\t\tif (\n\t\t\tallowContext &&\n\t\t\t! allowContext(\n\t\t\t\ttextContent.slice( 0, triggerIndex ),\n\t\t\t\ttextAfterSelection\n\t\t\t)\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\t/^\\s/.test( textWithoutTrigger ) ||\n\t\t\t/\\s\\s+$/.test( textWithoutTrigger )\n\t\t) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! /[\\u0000-\\uFFFF]*$/.test( textWithoutTrigger ) ) {\n\t\t\tif ( autocompleter ) {\n\t\t\t\treset();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst safeTrigger = escapeRegExp( completer.triggerPrefix );\n\t\tconst text = removeAccents( textContent );\n\t\tconst match = text\n\t\t\t.slice( text.lastIndexOf( completer.triggerPrefix ) )\n\t\t\t.match( new RegExp( `${ safeTrigger }([\\u0000-\\uFFFF]*)$` ) );\n\t\tconst query = match && match[ 1 ];\n\n\t\tsetAutocompleter( completer );\n\t\tsetAutocompleterUI( () =>\n\t\t\tcompleter !== autocompleter\n\t\t\t\t? getAutoCompleterUI( completer )\n\t\t\t\t: AutocompleterUI\n\t\t);\n\t\tsetFilterValue( query === null ? '' : query );\n\t\t// Temporarily disabling exhaustive-deps to avoid introducing unexpected side effecst.\n\t\t// See https://github.com/WordPress/gutenberg/pull/41820\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ textContent ] );\n\n\tconst { key: selectedKey = '' } = filteredOptions[ selectedIndex ] || {};\n\tconst { className } = autocompleter || {};\n\tconst isExpanded = !! autocompleter && filteredOptions.length > 0;\n\tconst listBoxId = isExpanded\n\t\t? `components-autocomplete-listbox-${ instanceId }`\n\t\t: undefined;\n\tconst activeId = isExpanded\n\t\t? `components-autocomplete-item-${ instanceId }-${ selectedKey }`\n\t\t: null;\n\tconst hasSelection = record.start !== undefined;\n\n\treturn {\n\t\tlistBoxId,\n\t\tactiveId,\n\t\tonKeyDown: withIgnoreIMEEvents( handleKeyDown ),\n\t\tpopover: hasSelection && AutocompleterUI && (\n\t\t\t<AutocompleterUI\n\t\t\t\tclassName={ className }\n\t\t\t\tfilterValue={ filterValue }\n\t\t\t\tinstanceId={ instanceId }\n\t\t\t\tlistBoxId={ listBoxId }\n\t\t\t\tselectedIndex={ selectedIndex }\n\t\t\t\tonChangeOptions={ onChangeOptions }\n\t\t\t\tonSelect={ select }\n\t\t\t\tvalue={ record }\n\t\t\t\tcontentRef={ contentRef }\n\t\t\t\treset={ reset }\n\t\t\t/>\n\t\t),\n\t};\n}\n\nfunction useLastDifferentValue( value: UseAutocompleteProps[ 'record' ] ) {\n\tconst history = useRef< Set< typeof value > >( new Set() );\n\n\thistory.current.add( value );\n\n\t// Keep the history size to 2.\n\tif ( history.current.size > 2 ) {\n\t\thistory.current.delete( Array.from( history.current )[ 0 ] );\n\t}\n\n\treturn Array.from( history.current )[ 0 ];\n}\n\nexport function useAutocompleteProps( options: UseAutocompleteProps ) {\n\tconst ref = useRef< HTMLElement >( null );\n\tconst onKeyDownRef = useRef< ( event: KeyboardEvent ) => void >();\n\tconst { record } = options;\n\tconst previousRecord = useLastDifferentValue( record );\n\tconst { popover, listBoxId, activeId, onKeyDown } = useAutocomplete( {\n\t\t...options,\n\t\tcontentRef: ref,\n\t} );\n\tonKeyDownRef.current = onKeyDown;\n\n\tconst mergedRefs = useMergeRefs( [\n\t\tref,\n\t\tuseRefEffect( ( element: HTMLElement ) => {\n\t\t\tfunction _onKeyDown( event: KeyboardEvent ) {\n\t\t\t\tonKeyDownRef.current?.( event );\n\t\t\t}\n\t\t\telement.addEventListener( 'keydown', _onKeyDown );\n\t\t\treturn () => {\n\t\t\t\telement.removeEventListener( 'keydown', _onKeyDown );\n\t\t\t};\n\t\t}, [] ),\n\t] );\n\n\t// We only want to show the popover if the user has typed something.\n\tconst didUserInput = record.text !== previousRecord?.text;\n\n\tif ( ! didUserInput ) {\n\t\treturn { ref: mergedRefs };\n\t}\n\n\treturn {\n\t\tref: mergedRefs,\n\t\tchildren: popover,\n\t\t'aria-autocomplete': listBoxId ? 'list' : undefined,\n\t\t'aria-owns': listBoxId,\n\t\t'aria-activedescendant': activeId,\n\t};\n}\n\nexport default function Autocomplete( {\n\tchildren,\n\tisSelected,\n\t...options\n}: AutocompleteProps ) {\n\tconst { popover, ...props } = useAutocomplete( options );\n\treturn (\n\t\t<>\n\t\t\t{ children( props ) }\n\t\t\t{ isSelected && popover }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SACCC,cAAc,EACdC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,OAAO,QACD,oBAAoB;AAC3B,SAASC,aAAa,EAAEC,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC9E,SACCC,MAAM,EACNC,KAAK,EACLC,MAAM,EACNC,WAAW,EACXC,cAAc,QACR,sBAAsB;AAC7B,SAASC,KAAK,QAAQ,iBAAiB;AACvC,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,mBAAmB,QAAQ,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SA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EJ,SAAS,GAAG,MAAM,GAAGvC,SAAS;IACnD,WAAW,EAAEuC,SAAS;IACtB,uBAAuB,EAAEC;EAC1B,CAAC;AACF;AAEA,eAAe,SAASsB,YAAYA,CAAE;EACrCnG,QAAQ;EACRoG,UAAU;EACV,GAAG3D;AACe,CAAC,EAAG;EACtB,MAAM;IAAEuC,OAAO;IAAE,GAAGjF;EAAM,CAAC,GAAGG,eAAe,CAAEuC,OAAQ,CAAC;EACxD,oBACCjD,KAAA,CAAAF,SAAA;IAAAU,QAAA,GACGA,QAAQ,CAAED,KAAM,CAAC,EACjBqG,UAAU,IAAIpB,OAAO;EAAA,CACtB,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/autocomplete/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport type { RichTextValue } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport type { useAutocomplete } from '.';\n\n// Insert the `value` into the text.\nexport type InsertOption = {\n\taction: 'insert-at-caret';\n\tvalue: React.ReactNode;\n};\n\n// Replace the current block with the block specified in the `value` property\nexport type ReplaceOption = { action: 'replace'; value: RichTextValue };\n\nexport type OptionCompletion = React.ReactNode | InsertOption | ReplaceOption;\n\ntype OptionLabel = string | ReactElement | Array< string | ReactElement >;\nexport type KeyedOption = {\n\tkey: string;\n\tvalue: any;\n\tlabel: OptionLabel;\n\tkeywords: Array< string >;\n\tisDisabled: boolean;\n};\n\nexport type WPCompleter< TCompleterOption = any > = {\n\t/**\n\t * The name of the completer. Useful for identifying a specific completer to\n\t * be overridden via extensibility hooks.\n\t */\n\tname: string;\n\t/**\n\t * The string prefix that should trigger the completer. For example,\n\t * Gutenberg's block completer is triggered when the '/' character is\n\t * entered.\n\t */\n\ttriggerPrefix: string;\n\t/**\n\t * The raw options for completion. May be an array, a function that returns\n\t * an array, or a function that returns a promise for an array.\n\t * Options may be of any type or shape. The completer declares how those\n\t * options are rendered and what their completions should be when selected.\n\t */\n\toptions:\n\t\t| ( (\n\t\t\t\tquery: string\n\t\t ) =>\n\t\t\t\t| PromiseLike< readonly TCompleterOption[] >\n\t\t\t\t| readonly TCompleterOption[] )\n\t\t| readonly TCompleterOption[];\n\t/**\n\t * A function that returns the keywords for the specified option.\n\t */\n\tgetOptionKeywords?: ( option: TCompleterOption ) => Array< string >;\n\t/**\n\t * A function that returns whether or not the specified option is disabled.\n\t * Disabled options cannot be selected.\n\t */\n\tisOptionDisabled?: ( option: TCompleterOption ) => boolean;\n\t/**\n\t * A function that returns the label for a given option. A label may be a\n\t * string or a mixed array of strings, elements, and components.\n\t */\n\tgetOptionLabel: ( option: TCompleterOption ) => OptionLabel;\n\t/**\n\t * A function that takes a Range before and a Range after the autocomplete\n\t * trigger and query text and returns a boolean indicating whether the\n\t * completer should be considered for that context.\n\t */\n\tallowContext?: ( before: string, after: string ) => boolean;\n\t/**\n\t * A function that takes an option and returns how the option should\n\t * be completed. By default, the result is a value to be inserted in the\n\t * text.\n\t * However, a completer may explicitly declare how a completion should be\n\t * treated by returning an object with `action` and `value` properties. The\n\t * `action` declares what should be done with the `value`.\n\t */\n\tgetOptionCompletion?: (\n\t\toption: TCompleterOption,\n\t\tquery: string\n\t) => OptionCompletion;\n\t/**\n\t * A function that returns an array of items to be displayed in the\n\t * Autocomplete UI. These items have uniform shape and have been filtered by\n\t * `AutocompleterUIProps.filterValue`.\n\t */\n\tuseItems?: ( filterValue: string ) => readonly [ Array< KeyedOption > ];\n\t/**\n\t * Whether or not changes to the `filterValue` should be debounced.\n\t */\n\tisDebounced?: boolean;\n\t/**\n\t * A CSS class name to be applied to the completion menu.\n\t */\n\tclassName?: string;\n};\n\ntype ContentRef = React.RefObject< HTMLElement >;\n\nexport type AutocompleterUIProps = {\n\t/**\n\t * The value to filter the options by.\n\t */\n\tfilterValue: string;\n\t/**\n\t * An id unique to each instance of the component, used in the IDs of the\n\t * buttons generated for individual options.\n\t */\n\tinstanceId: number;\n\t/**\n\t * The id of to be applied to the listbox of options.\n\t */\n\tlistBoxId: string | undefined;\n\t/**\n\t * The class to apply to the wrapper element.\n\t */\n\tclassName?: string;\n\t/**\n\t * The index of the currently selected option.\n\t */\n\tselectedIndex: number;\n\t/**\n\t * A function to be called when the filterValue changes.\n\t */\n\tonChangeOptions: ( items: Array< KeyedOption > ) => void;\n\t/**\n\t * A function to be called when an option is selected.\n\t */\n\tonSelect: ( option: KeyedOption ) => void;\n\t/**\n\t * A function to be called when the completer is reset\n\t * (e.g. when the user hits the escape key).\n\t */\n\tonReset?: () => void;\n\t/**\n\t * A function that defines the behavior of the completer when it is reset\n\t */\n\treset: ( event: Event ) => void;\n\t// This is optional because it's still needed for mobile/native.\n\t/**\n\t * The rich text value object the autocompleter is being applied to.\n\t */\n\tvalue?: RichTextValue;\n\t/**\n\t * A ref containing the editable element that will serve as the anchor for\n\t * `Autocomplete`'s `Popover`.\n\t */\n\tcontentRef: ContentRef;\n};\n\nexport type CancelablePromise< T = void > = Promise< T > & {\n\tcanceled?: boolean;\n};\n\nexport type UseAutocompleteProps = {\n\t/**\n\t * The rich text value object the autocompleter is being applied to.\n\t */\n\trecord: RichTextValue & {\n\t\tstart: NonNullable< RichTextValue[ 'start' ] >;\n\t\tend: NonNullable< RichTextValue[ 'end' ] >;\n\t};\n\t/**\n\t * A function to be called when an option is selected to insert into the\n\t * existing text.\n\t */\n\tonChange: ( value: RichTextValue ) => void;\n\t/**\n\t * A function to be called when an option is selected to replace the\n\t * existing text.\n\t */\n\tonReplace: ( values: RichTextValue[] ) => void;\n\t/**\n\t * An array of all of the completers to apply to the current element.\n\t */\n\tcompleters: Array< WPCompleter >;\n\t/**\n\t * A ref containing the editable element that will serve as the anchor for\n\t * `Autocomplete`'s `Popover`.\n\t */\n\tcontentRef: ContentRef;\n};\n\nexport type AutocompleteProps = UseAutocompleteProps & {\n\t/**\n\t * A function that returns nodes to be rendered within the Autocomplete.\n\t */\n\tchildren: (\n\t\tprops: Omit< ReturnType< typeof useAutocomplete >, 'popover' >\n\t) => React.ReactNode;\n\t/**\n\t * Whether or not the Autocomplte componenet is selected, and if its\n\t * `Popover`\n\t * should be displayed.\n\t */\n\tisSelected: boolean;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/autocomplete/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport type { RichTextValue } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport type { useAutocomplete } from '.';\n\n// Insert the `value` into the text.\nexport type InsertOption = {\n\taction: 'insert-at-caret';\n\tvalue: React.ReactNode;\n};\n\n// Replace the current block with the block specified in the `value` property\nexport type ReplaceOption = { action: 'replace'; value: RichTextValue };\n\nexport type OptionCompletion = React.ReactNode | InsertOption | ReplaceOption;\n\ntype OptionLabel = string | ReactElement | Array< string | ReactElement >;\nexport type KeyedOption = {\n\tkey: string;\n\tvalue: any;\n\tlabel: OptionLabel;\n\tkeywords: Array< string >;\n\tisDisabled: boolean;\n};\n\nexport type WPCompleter< TCompleterOption = any > = {\n\t/**\n\t * The name of the completer. Useful for identifying a specific completer to\n\t * be overridden via extensibility hooks.\n\t */\n\tname: string;\n\t/**\n\t * The string prefix that should trigger the completer. For example,\n\t * Gutenberg's block completer is triggered when the '/' character is\n\t * entered.\n\t */\n\ttriggerPrefix: string;\n\t/**\n\t * The raw options for completion. May be an array, a function that returns\n\t * an array, or a function that returns a promise for an array.\n\t * Options may be of any type or shape. The completer declares how those\n\t * options are rendered and what their completions should be when selected.\n\t */\n\toptions:\n\t\t| ( (\n\t\t\t\tquery: string\n\t\t ) =>\n\t\t\t\t| PromiseLike< readonly TCompleterOption[] >\n\t\t\t\t| readonly TCompleterOption[] )\n\t\t| readonly TCompleterOption[];\n\t/**\n\t * A function that returns the keywords for the specified option.\n\t */\n\tgetOptionKeywords?: ( option: TCompleterOption ) => Array< string >;\n\t/**\n\t * A function that returns whether or not the specified option is disabled.\n\t * Disabled options cannot be selected.\n\t */\n\tisOptionDisabled?: ( option: TCompleterOption ) => boolean;\n\t/**\n\t * A function that returns the label for a given option. A label may be a\n\t * string or a mixed array of strings, elements, and components.\n\t */\n\tgetOptionLabel: ( option: TCompleterOption ) => OptionLabel;\n\t/**\n\t * A function that takes a Range before and a Range after the autocomplete\n\t * trigger and query text and returns a boolean indicating whether the\n\t * completer should be considered for that context.\n\t */\n\tallowContext?: ( before: string, after: string ) => boolean;\n\t/**\n\t * A function that takes an option and returns how the option should\n\t * be completed. By default, the result is a value to be inserted in the\n\t * text.\n\t * However, a completer may explicitly declare how a completion should be\n\t * treated by returning an object with `action` and `value` properties. The\n\t * `action` declares what should be done with the `value`.\n\t */\n\tgetOptionCompletion?: (\n\t\toption: TCompleterOption,\n\t\tquery: string\n\t) => OptionCompletion;\n\t/**\n\t * A function that returns an array of items to be displayed in the\n\t * Autocomplete UI. These items have uniform shape and have been filtered by\n\t * `AutocompleterUIProps.filterValue`.\n\t */\n\tuseItems?: ( filterValue: string ) => readonly [ Array< KeyedOption > ];\n\t/**\n\t * Whether or not changes to the `filterValue` should be debounced.\n\t */\n\tisDebounced?: boolean;\n\t/**\n\t * A CSS class name to be applied to the completion menu.\n\t */\n\tclassName?: string;\n};\n\ntype ContentRef = React.RefObject< HTMLElement >;\n\nexport type AutocompleterUIProps = {\n\t/**\n\t * The value to filter the options by.\n\t */\n\tfilterValue: string;\n\t/**\n\t * An id unique to each instance of the component, used in the IDs of the\n\t * buttons generated for individual options.\n\t */\n\tinstanceId: number;\n\t/**\n\t * The id of to be applied to the listbox of options.\n\t */\n\tlistBoxId: string | undefined;\n\t/**\n\t * The class to apply to the wrapper element.\n\t */\n\tclassName?: string;\n\t/**\n\t * The index of the currently selected option.\n\t */\n\tselectedIndex: number;\n\t/**\n\t * A function to be called when the filterValue changes.\n\t */\n\tonChangeOptions: ( items: Array< KeyedOption > ) => void;\n\t/**\n\t * A function to be called when an option is selected.\n\t */\n\tonSelect: ( option: KeyedOption ) => void;\n\t/**\n\t * A function to be called when the completer is reset\n\t * (e.g. when the user hits the escape key).\n\t */\n\tonReset?: () => void;\n\t/**\n\t * A function that defines the behavior of the completer when it is reset\n\t */\n\treset: ( event: Event ) => void;\n\t// This is optional because it's still needed for mobile/native.\n\t/**\n\t * The rich text value object the autocompleter is being applied to.\n\t */\n\tvalue?: RichTextValue;\n\t/**\n\t * A ref containing the editable element that will serve as the anchor for\n\t * `Autocomplete`'s `Popover`.\n\t */\n\tcontentRef: ContentRef;\n};\n\nexport type CancelablePromise< T = void > = Promise< T > & {\n\tcanceled?: boolean;\n};\n\nexport type UseAutocompleteProps = {\n\t/**\n\t * The rich text value object the autocompleter is being applied to.\n\t */\n\trecord: RichTextValue & {\n\t\tstart: NonNullable< RichTextValue[ 'start' ] >;\n\t\tend: NonNullable< RichTextValue[ 'end' ] >;\n\t};\n\t/**\n\t * A function to be called when an option is selected to insert into the\n\t * existing text.\n\t */\n\tonChange: ( value: RichTextValue ) => void;\n\t/**\n\t * A function to be called when an option is selected to replace the\n\t * existing text.\n\t */\n\tonReplace: ( values: RichTextValue[] ) => void;\n\t/**\n\t * An array of all of the completers to apply to the current element.\n\t */\n\tcompleters: Array< WPCompleter >;\n\t/**\n\t * A ref containing the editable element that will serve as the anchor for\n\t * `Autocomplete`'s `Popover`.\n\t */\n\tcontentRef: ContentRef;\n};\n\nexport type AutocompleteProps = UseAutocompleteProps & {\n\t/**\n\t * A function that returns nodes to be rendered within the Autocomplete.\n\t */\n\tchildren: (\n\t\tprops: Omit< ReturnType< typeof useAutocomplete >, 'popover' >\n\t) => React.ReactNode;\n\t/**\n\t * Whether or not the Autocomplete component is selected, and if its\n\t * `Popover` should be displayed.\n\t */\n\tisSelected: boolean;\n};\n"],"mappings":"","ignoreList":[]}
@@ -2,6 +2,10 @@
2
2
  * External dependencies
3
3
  */
4
4
  import clsx from 'clsx';
5
+ /**
6
+ * WordPress dependencies
7
+ */
8
+ import { forwardRef } from '@wordpress/element';
5
9
 
6
10
  /**
7
11
  * Internal dependencies
@@ -93,17 +97,20 @@ const UnconnectedBaseControl = props => {
93
97
  * </BaseControl>
94
98
  * );
95
99
  */
96
- export const VisualLabel = ({
97
- className,
98
- children,
99
- ...props
100
- }) => {
100
+ const UnforwardedVisualLabel = (props, ref) => {
101
+ const {
102
+ className,
103
+ children,
104
+ ...restProps
105
+ } = props;
101
106
  return /*#__PURE__*/_jsx(StyledVisualLabel, {
102
- ...props,
107
+ ref: ref,
108
+ ...restProps,
103
109
  className: clsx('components-base-control__label', className),
104
110
  children: children
105
111
  });
106
112
  };
113
+ export const VisualLabel = forwardRef(UnforwardedVisualLabel);
107
114
  export const BaseControl = Object.assign(contextConnectWithoutRef(UnconnectedBaseControl, 'BaseControl'), {
108
115
  VisualLabel
109
116
  });
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","VisuallyHidden","Wrapper","StyledField","StyledLabel","StyledHelp","StyledVisualLabel","contextConnectWithoutRef","useContextSystem","jsx","_jsx","jsxs","_jsxs","useBaseControlProps","UnconnectedBaseControl","props","__nextHasNoMarginBottom","id","label","hideLabelFromVision","help","className","children","as","htmlFor","VisualLabel","undefined","BaseControl","Object","assign"],"sources":["@wordpress/components/src/base-control/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { BaseControlProps, BaseControlVisualLabelProps } from './types';\nimport {\n\tWrapper,\n\tStyledField,\n\tStyledLabel,\n\tStyledHelp,\n\tStyledVisualLabel,\n} from './styles/base-control-styles';\nimport type { WordPressComponentProps } from '../context';\nimport { contextConnectWithoutRef, useContextSystem } from '../context';\n\nexport { useBaseControlProps } from './hooks';\n\n/**\n * `BaseControl` is a component used to generate labels and help text for components handling user inputs.\n *\n * ```jsx\n * import { BaseControl, useBaseControlProps } from '@wordpress/components';\n *\n * // Render a `BaseControl` for a textarea input\n * const MyCustomTextareaControl = ({ children, ...baseProps }) => (\n * \t// `useBaseControlProps` is a convenience hook to get the props for the `BaseControl`\n * \t// and the inner control itself. Namely, it takes care of generating a unique `id`,\n * \t// properly associating it with the `label` and `help` elements.\n * \tconst { baseControlProps, controlProps } = useBaseControlProps( baseProps );\n *\n * \treturn (\n * \t\t<BaseControl { ...baseControlProps } __nextHasNoMarginBottom={ true }>\n * \t\t\t<textarea { ...controlProps }>\n * \t\t\t { children }\n * \t\t\t</textarea>\n * \t\t</BaseControl>\n * \t);\n * );\n * ```\n */\nconst UnconnectedBaseControl = (\n\tprops: WordPressComponentProps< BaseControlProps, null >\n) => {\n\tconst {\n\t\t__nextHasNoMarginBottom = false,\n\t\tid,\n\t\tlabel,\n\t\thideLabelFromVision = false,\n\t\thelp,\n\t\tclassName,\n\t\tchildren,\n\t} = useContextSystem( props, 'BaseControl' );\n\n\treturn (\n\t\t<Wrapper className={ className }>\n\t\t\t<StyledField\n\t\t\t\tclassName=\"components-base-control__field\"\n\t\t\t\t// TODO: Official deprecation for this should start after all internal usages have been migrated\n\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t>\n\t\t\t\t{ label &&\n\t\t\t\t\tid &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\" htmlFor={ id }>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<StyledLabel\n\t\t\t\t\t\t\tclassName=\"components-base-control__label\"\n\t\t\t\t\t\t\thtmlFor={ id }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</StyledLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ label &&\n\t\t\t\t\t! id &&\n\t\t\t\t\t( hideLabelFromVision ? (\n\t\t\t\t\t\t<VisuallyHidden as=\"label\">{ label }</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<VisualLabel>{ label }</VisualLabel>\n\t\t\t\t\t) ) }\n\t\t\t\t{ children }\n\t\t\t</StyledField>\n\t\t\t{ !! help && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\tid={ id ? id + '__help' : undefined }\n\t\t\t\t\tclassName=\"components-base-control__help\"\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t>\n\t\t\t\t\t{ help }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n};\n\n/**\n * `BaseControl.VisualLabel` is used to render a purely visual label inside a `BaseControl` component.\n *\n * It should only be used in cases where the children being rendered inside `BaseControl` are already accessibly labeled,\n * e.g., a button, but we want an additional visual label for that section equivalent to the labels `BaseControl` would\n * otherwise use if the `label` prop was passed.\n *\n * @example\n * import { BaseControl } from '@wordpress/components';\n *\n * const MyBaseControl = () => (\n * \t<BaseControl help=\"This button is already accessibly labeled.\">\n * \t\t<BaseControl.VisualLabel>Author</BaseControl.VisualLabel>\n * \t\t<Button>Select an author</Button>\n * \t</BaseControl>\n * );\n */\nexport const VisualLabel = ( {\n\tclassName,\n\tchildren,\n\t...props\n}: WordPressComponentProps< BaseControlVisualLabelProps, 'span' > ) => {\n\treturn (\n\t\t<StyledVisualLabel\n\t\t\t{ ...props }\n\t\t\tclassName={ clsx( 'components-base-control__label', className ) }\n\t\t>\n\t\t\t{ children }\n\t\t</StyledVisualLabel>\n\t);\n};\n\nexport const BaseControl = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedBaseControl, 'BaseControl' ),\n\t{ VisualLabel }\n);\n\nexport default BaseControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SACCC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,iBAAiB,QACX,8BAA8B;AAErC,SA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AE,EAAGA,EAAE,GAAGA,EAAE,GAAG,QAAQ,GAAGS,SAAW;MACrCL,SAAS,EAAC,+BAA+B;MACzCL,uBAAuB,EAAGA,uBAAyB;MAAAM,QAAA,EAEjDF;IAAI,CACK,CACZ;EAAA,CACO,CAAC;AAEZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,WAAW,GAAGA,CAAE;EAC5BJ,SAAS;EACTC,QAAQ;EACR,GAAGP;AAC4D,CAAC,KAAM;EACtE,oBACCL,IAAA,CAACJ,iBAAiB;IAAA,GACZS,KAAK;IACVM,SAAS,EAAGrB,IAAI,CAAE,gCAAgC,EAAEqB,SAAU,CAAG;IAAAC,QAAA,EAE/DA;EAAQ,CACQ,CAAC;AAEtB,CAAC;AAED,OAAO,MAAMK,WAAW,GAAGC,MAAM,CAACC,MAAM,CACvCtB,wBAAwB,CAAEO,sBAAsB,EAAE,aAAc,CAAC,EACjE;EAAEW;AAAY,CACf,CAAC;AAED,eAAeE,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["clsx","forwardRef","VisuallyHidden","Wrapper","StyledField","StyledLabel","StyledHelp","StyledVisualLabel","contextConnectWithoutRef","useContextSystem","jsx","_jsx","jsxs","_jsxs","useBaseControlProps","UnconnectedBaseControl","props","__nextHasNoMarginBottom","id","label","hideLabelFromVision","help","className","children","as","htmlFor","VisualLabel","undefined","UnforwardedVisualLabel","ref","restProps","BaseControl","Object","assign"],"sources":["@wordpress/components/src/base-control/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 { 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 */\nconst UnforwardedVisualLabel = (\n\tprops: WordPressComponentProps< BaseControlVisualLabelProps, 'span' >,\n\tref: ForwardedRef< any >\n) => {\n\tconst { className, children, ...restProps } = props;\n\n\treturn (\n\t\t<StyledVisualLabel\n\t\t\tref={ ref }\n\t\t\t{ ...restProps }\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 VisualLabel = forwardRef( UnforwardedVisualLabel );\n\nexport const BaseControl = Object.assign(\n\tcontextConnectWithoutRef( UnconnectedBaseControl, 'BaseControl' ),\n\t{ VisualLabel }\n);\n\nexport default BaseControl;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,SAASC,cAAc,QAAQ,oBAAoB;AAEnD,SACCC,OAAO,EACPC,WAAW,EACXC,WAAW,EACXC,UAAU,EACVC,iBAAiB,QACX,8BAA8B;AAErC,SAASC,wBAAwB,EAAEC,gBAAgB,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAExE,SAASC,mBAAmB,QAAQ,SAAS;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAC3BC,KAAwD,IACpD;EACJ,MAAM;IACLC,uBAAuB,GAAG,KAAK;IAC/BC,EAAE;IACFC,KAAK;IACLC,mBAAmB,GAAG,KAAK;IAC3BC,IAAI;IACJC,SAAS;IACTC;EACD,CAAC,GAAGd,gBAAgB,CAAEO,KAAK,EAAE,aAAc,CAAC;EAE5C,oBACCH,KAAA,CAACV,OAAO;IAACmB,SAAS,EAAGA,SAAW;IAAAC,QAAA,gBAC/BV,KAAA,CAACT,WAAW;MACXkB,SAAS,EAAC;MACV;MAAA;MACAL,uBAAuB,EAAGA,uBAAyB;MAAAM,QAAA,GAEjDJ,KAAK,IACND,EAAE,KACAE,mBAAmB,gBACpBT,IAAA,CAACT,cAAc;QAACsB,EAAE,EAAC,OAAO;QAACC,OAAO,EAAGP,EAAI;QAAAK,QAAA,EACtCJ;MAAK,CACQ,CAAC,gBAEjBR,IAAA,CAACN,WAAW;QACXiB,SAAS,EA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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
+ {"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 * Only use for meaningful description or instructions for the control. An 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,7 +1,3 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
-
5
1
  /**
6
2
  * Internal dependencies
7
3
  */
@@ -1 +1 @@
1
- {"version":3,"names":["View","contextConnect","useBorderBoxControlVisualizer","jsx","_jsx","BorderBoxControlVisualizer","props","forwardedRef","value","otherProps","ref","ConnectedBorderBoxControlVisualizer"],"sources":["@wordpress/components/src/border-box-control/border-box-control-visualizer/component.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { View } from '../../view';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderBoxControlVisualizer } from './hook';\n\nimport type { VisualizerProps } from '../types';\n\nconst BorderBoxControlVisualizer = (\n\tprops: WordPressComponentProps< VisualizerProps, 'div' >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst { value, ...otherProps } = useBorderBoxControlVisualizer( props );\n\n\treturn <View { ...otherProps } ref={ forwardedRef } />;\n};\n\nconst ConnectedBorderBoxControlVisualizer = contextConnect(\n\tBorderBoxControlVisualizer,\n\t'BorderBoxControlVisualizer'\n);\nexport default ConnectedBorderBoxControlVisualizer;\n"],"mappings":"AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,YAAY;AAEjC,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,6BAA6B,QAAQ,QAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIvD,MAAMC,0BAA0B,GAAGA,CAClCC,KAAwD,EACxDC,YAAuC,KACnC;EACJ,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAW,CAAC,GAAGP,6BAA6B,CAAEI,KAAM,CAAC;EAEvE,oBAAOF,IAAA,CAACJ,IAAI;IAAA,GAAMS,UAAU;IAAGC,GAAG,EAAGH;EAAc,CAAE,CAAC;AACvD,CAAC;AAED,MAAMI,mCAAmC,GAAGV,cAAc,CACzDI,0BAA0B,EAC1B,4BACD,CAAC;AACD,eAAeM,mCAAmC","ignoreList":[]}
1
+ {"version":3,"names":["View","contextConnect","useBorderBoxControlVisualizer","jsx","_jsx","BorderBoxControlVisualizer","props","forwardedRef","value","otherProps","ref","ConnectedBorderBoxControlVisualizer"],"sources":["@wordpress/components/src/border-box-control/border-box-control-visualizer/component.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { View } from '../../view';\nimport type { WordPressComponentProps } from '../../context';\nimport { contextConnect } from '../../context';\nimport { useBorderBoxControlVisualizer } from './hook';\n\nimport type { VisualizerProps } from '../types';\n\nconst BorderBoxControlVisualizer = (\n\tprops: WordPressComponentProps< VisualizerProps, 'div' >,\n\tforwardedRef: React.ForwardedRef< any >\n) => {\n\tconst { value, ...otherProps } = useBorderBoxControlVisualizer( props );\n\n\treturn <View { ...otherProps } ref={ forwardedRef } />;\n};\n\nconst ConnectedBorderBoxControlVisualizer = contextConnect(\n\tBorderBoxControlVisualizer,\n\t'BorderBoxControlVisualizer'\n);\nexport default ConnectedBorderBoxControlVisualizer;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,YAAY;AAEjC,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,6BAA6B,QAAQ,QAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAIvD,MAAMC,0BAA0B,GAAGA,CAClCC,KAAwD,EACxDC,YAAuC,KACnC;EACJ,MAAM;IAAEC,KAAK;IAAE,GAAGC;EAAW,CAAC,GAAGP,6BAA6B,CAAEI,KAAM,CAAC;EAEvE,oBAAOF,IAAA,CAACJ,IAAI;IAAA,GAAMS,UAAU;IAAGC,GAAG,EAAGH;EAAc,CAAE,CAAC;AACvD,CAAC;AAED,MAAMI,mCAAmC,GAAGV,cAAc,CACzDI,0BAA0B,EAC1B,4BACD,CAAC;AACD,eAAeM,mCAAmC","ignoreList":[]}
@@ -21,6 +21,7 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
21
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
22
  const disabledEventsOnDisabledButton = ['onMouseDown', 'onClick'];
23
23
  function useDeprecatedProps({
24
+ __experimentalIsFocusable,
24
25
  isDefault,
25
26
  isPrimary,
26
27
  isSecondary,
@@ -30,13 +31,16 @@ function useDeprecatedProps({
30
31
  isSmall,
31
32
  size,
32
33
  variant,
34
+ describedBy,
33
35
  ...otherProps
34
36
  }) {
35
37
  let computedSize = size;
36
38
  let computedVariant = variant;
37
39
  const newProps = {
40
+ accessibleWhenDisabled: __experimentalIsFocusable,
38
41
  // @todo Mark `isPressed` as deprecated
39
- 'aria-pressed': isPressed
42
+ 'aria-pressed': isPressed,
43
+ description: describedBy
40
44
  };
41
45
  if (isSmall) {
42
46
  var _computedSize;
@@ -76,6 +80,7 @@ function useDeprecatedProps({
76
80
  export function UnforwardedButton(props, ref) {
77
81
  const {
78
82
  __next40pxDefaultSize,
83
+ accessibleWhenDisabled,
79
84
  isBusy,
80
85
  isDestructive,
81
86
  className,
@@ -91,8 +96,7 @@ export function UnforwardedButton(props, ref) {
91
96
  size = 'default',
92
97
  text,
93
98
  variant,
94
- __experimentalIsFocusable: isFocusable,
95
- describedBy,
99
+ description,
96
100
  ...buttonOrAnchorProps
97
101
  } = useDeprecatedProps(props);
98
102
  const {
@@ -127,8 +131,8 @@ export function UnforwardedButton(props, ref) {
127
131
  'has-text': !!icon && (hasChildren || text),
128
132
  'has-icon': !!icon
129
133
  });
130
- const trulyDisabled = disabled && !isFocusable;
131
- const Tag = href !== undefined && !trulyDisabled ? 'a' : 'button';
134
+ const trulyDisabled = disabled && !accessibleWhenDisabled;
135
+ const Tag = href !== undefined && !disabled ? 'a' : 'button';
132
136
  const buttonProps = Tag === 'button' ? {
133
137
  type: 'button',
134
138
  disabled: trulyDisabled,
@@ -141,7 +145,7 @@ export function UnforwardedButton(props, ref) {
141
145
  target
142
146
  } : {};
143
147
  const disableEventProps = {};
144
- if (disabled && isFocusable) {
148
+ if (disabled && accessibleWhenDisabled) {
145
149
  // In this case, the button will be disabled, but still focusable and
146
150
  // perceivable by screen reader users.
147
151
  buttonProps['aria-disabled'] = true;
@@ -168,7 +172,7 @@ export function UnforwardedButton(props, ref) {
168
172
  !children?.length &&
169
173
  // The tooltip is not explicitly disabled.
170
174
  false !== showTooltip);
171
- const descriptionId = describedBy ? instanceId : undefined;
175
+ const descriptionId = description ? instanceId : undefined;
172
176
  const describedById = additionalProps['aria-describedby'] || descriptionId;
173
177
  const commonProps = {
174
178
  className: classes,
@@ -206,7 +210,7 @@ export function UnforwardedButton(props, ref) {
206
210
  // In order to make sure that the tooltip doesn't show when it shouldn't,
207
211
  // we don't pass the props to the `Tooltip` component.
208
212
  const tooltipProps = shouldShowTooltip ? {
209
- text: children?.length && describedBy ? describedBy : label,
213
+ text: children?.length && description ? description : label,
210
214
  shortcut,
211
215
  placement: tooltipPosition &&
212
216
  // Convert legacy `position` values to be used with the new `placement` prop
@@ -216,10 +220,10 @@ export function UnforwardedButton(props, ref) {
216
220
  children: [/*#__PURE__*/_jsx(Tooltip, {
217
221
  ...tooltipProps,
218
222
  children: element
219
- }), describedBy && /*#__PURE__*/_jsx(VisuallyHidden, {
223
+ }), description && /*#__PURE__*/_jsx(VisuallyHidden, {
220
224
  children: /*#__PURE__*/_jsx("span", {
221
225
  id: descriptionId,
222
- children: describedBy
226
+ children: description
223
227
  })
224
228
  })]
225
229
  });
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","deprecated","forwardRef","useInstanceId","Tooltip","Icon","VisuallyHidden","positionToPlacement","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","disabledEventsOnDisabledButton","useDeprecatedProps","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","otherProps","computedSize","computedVariant","newProps","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","since","alternative","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","__experimentalIsFocusable","isFocusable","describedBy","buttonOrAnchorProps","href","target","ariaChecked","ariaPressed","ariaSelected","additionalProps","undefined","instanceId","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disableEventProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","element","tooltipProps","placement","id"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\nimport { positionToPlacement } from '../popover/utils';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisPressed,\n\tisSmall,\n\tsize,\n\tvariant,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tconst newProps: { 'aria-pressed'?: boolean } = {\n\t\t// @todo Mark `isPressed` as deprecated\n\t\t'aria-pressed': isPressed,\n\t};\n\n\tif ( isSmall ) {\n\t\tcomputedSize ??= 'small';\n\t}\n\n\tif ( isPrimary ) {\n\t\tcomputedVariant ??= 'primary';\n\t}\n\n\tif ( isTertiary ) {\n\t\tcomputedVariant ??= 'tertiary';\n\t}\n\n\tif ( isSecondary ) {\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isDefault ) {\n\t\tdeprecated( 'wp.components.Button `isDefault` prop', {\n\t\t\tsince: '5.4',\n\t\t\talternative: 'variant=\"secondary\"',\n\t\t} );\n\n\t\tcomputedVariant ??= 'secondary';\n\t}\n\n\tif ( isLink ) {\n\t\tcomputedVariant ??= 'link';\n\t}\n\n\treturn {\n\t\t...newProps,\n\t\t...otherProps,\n\t\tsize: computedSize,\n\t\tvariant: computedVariant,\n\t};\n}\n\nexport function UnforwardedButton(\n\tprops: ButtonProps & DeprecatedButtonProps,\n\tref: ForwardedRef< any >\n) {\n\tconst {\n\t\t__next40pxDefaultSize,\n\t\tisBusy,\n\t\tisDestructive,\n\t\tclassName,\n\t\tdisabled,\n\t\ticon,\n\t\ticonPosition = 'left',\n\t\ticonSize,\n\t\tshowTooltip,\n\t\ttooltipPosition,\n\t\tshortcut,\n\t\tlabel,\n\t\tchildren,\n\t\tsize = 'default',\n\t\ttext,\n\t\tvariant,\n\t\t__experimentalIsFocusable: isFocusable,\n\t\tdescribedBy,\n\t\t...buttonOrAnchorProps\n\t} = useDeprecatedProps( props );\n\n\tconst {\n\t\thref,\n\t\ttarget,\n\t\t'aria-checked': ariaChecked,\n\t\t'aria-pressed': ariaPressed,\n\t\t'aria-selected': ariaSelected,\n\t\t...additionalProps\n\t} = 'href' in buttonOrAnchorProps\n\t\t? buttonOrAnchorProps\n\t\t: { href: undefined, target: undefined, ...buttonOrAnchorProps };\n\n\tconst instanceId = useInstanceId(\n\t\tButton,\n\t\t'components-button__description'\n\t);\n\n\tconst hasChildren =\n\t\t( 'string' === typeof children && !! children ) ||\n\t\t( Array.isArray( children ) &&\n\t\t\tchildren?.[ 0 ] &&\n\t\t\tchildren[ 0 ] !== null &&\n\t\t\t// Tooltip should not considered as a child\n\t\t\tchildren?.[ 0 ]?.props?.className !== 'components-tooltip' );\n\n\tconst truthyAriaPressedValues: ( typeof ariaPressed )[] = [\n\t\ttrue,\n\t\t'true',\n\t\t'mixed',\n\t];\n\n\tconst classes = clsx( 'components-button', className, {\n\t\t'is-next-40px-default-size': __next40pxDefaultSize,\n\t\t'is-secondary': variant === 'secondary',\n\t\t'is-primary': variant === 'primary',\n\t\t'is-small': size === 'small',\n\t\t'is-compact': size === 'compact',\n\t\t'is-tertiary': variant === 'tertiary',\n\n\t\t'is-pressed': truthyAriaPressedValues.includes( ariaPressed ),\n\t\t'is-pressed-mixed': ariaPressed === 'mixed',\n\n\t\t'is-busy': isBusy,\n\t\t'is-link': variant === 'link',\n\t\t'is-destructive': isDestructive,\n\t\t'has-text': !! icon && ( hasChildren || text ),\n\t\t'has-icon': !! icon,\n\t} );\n\n\tconst trulyDisabled = disabled && ! isFocusable;\n\tconst Tag = href !== undefined && ! trulyDisabled ? 'a' : 'button';\n\tconst buttonProps: ComponentPropsWithoutRef< 'button' > =\n\t\tTag === 'button'\n\t\t\t? {\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\tdisabled: trulyDisabled,\n\t\t\t\t\t'aria-checked': ariaChecked,\n\t\t\t\t\t'aria-pressed': ariaPressed,\n\t\t\t\t\t'aria-selected': ariaSelected,\n\t\t\t }\n\t\t\t: {};\n\tconst anchorProps: ComponentPropsWithoutRef< 'a' > =\n\t\tTag === 'a' ? { href, target } : {};\n\n\tconst disableEventProps: {\n\t\t[ key: string ]: ( event: MouseEvent ) => void;\n\t} = {};\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\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tdisableEventProps[ 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{ ...disableEventProps }\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{ ...disableEventProps }\n\t\t\t\t{ ...commonProps }\n\t\t\t>\n\t\t\t\t{ elementChildren }\n\t\t\t</button>\n\t\t);\n\n\t// In order to avoid some React reconciliation issues, we are always rendering\n\t// the `Tooltip` component even when `shouldShowTooltip` is `false`.\n\t// In order to make sure that the tooltip doesn't show when it shouldn't,\n\t// we don't pass the props to the `Tooltip` component.\n\tconst tooltipProps = shouldShowTooltip\n\t\t? {\n\t\t\t\ttext:\n\t\t\t\t\t( children as string | ReactElement[] )?.length &&\n\t\t\t\t\tdescribedBy\n\t\t\t\t\t\t? describedBy\n\t\t\t\t\t\t: label,\n\t\t\t\tshortcut,\n\t\t\t\tplacement:\n\t\t\t\t\ttooltipPosition &&\n\t\t\t\t\t// Convert legacy `position` values to be used with the new `placement` prop\n\t\t\t\t\tpositionToPlacement( tooltipPosition ),\n\t\t }\n\t\t: {};\n\n\treturn (\n\t\t<>\n\t\t\t<Tooltip { ...tooltipProps }>{ element }</Tooltip>\n\t\t\t{ describedBy && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ describedBy }</span>\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Lets users take actions and make choices with a single click or tap.\n *\n * ```jsx\n * import { Button } from '@wordpress/components';\n * const Mybutton = () => (\n * <Button\n * variant=\"primary\"\n * onClick={ handleClick }\n * >\n * Click here\n * </Button>\n * );\n * ```\n */\nexport const Button = forwardRef( UnforwardedButton );\nexport default Button;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AASvB;AACA;AACA;AACA,OAAOC,UAAU,MAA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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,MAAM,GAAGhE,UAAU,CAAEmC,iBAAkB,CAAC;AACrD,eAAe6B,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["clsx","deprecated","forwardRef","useInstanceId","Tooltip","Icon","VisuallyHidden","positionToPlacement","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","disabledEventsOnDisabledButton","useDeprecatedProps","__experimentalIsFocusable","isDefault","isPrimary","isSecondary","isTertiary","isLink","isPressed","isSmall","size","variant","describedBy","otherProps","computedSize","computedVariant","newProps","accessibleWhenDisabled","description","_computedSize","_computedVariant","_computedVariant2","_computedVariant3","_computedVariant4","since","alternative","_computedVariant5","UnforwardedButton","props","ref","__next40pxDefaultSize","isBusy","isDestructive","className","disabled","icon","iconPosition","iconSize","showTooltip","tooltipPosition","shortcut","label","children","text","buttonOrAnchorProps","href","target","ariaChecked","ariaPressed","ariaSelected","additionalProps","undefined","instanceId","Button","hasChildren","Array","isArray","truthyAriaPressedValues","classes","includes","trulyDisabled","Tag","buttonProps","type","anchorProps","disableEventProps","disabledEvent","event","stopPropagation","preventDefault","shouldShowTooltip","length","descriptionId","describedById","commonProps","elementChildren","element","tooltipProps","placement","id"],"sources":["@wordpress/components/src/button/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type {\n\tComponentPropsWithoutRef,\n\tForwardedRef,\n\tHTMLAttributes,\n\tMouseEvent,\n\tReactElement,\n} from 'react';\n\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport Tooltip from '../tooltip';\nimport Icon from '../icon';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { ButtonProps, DeprecatedButtonProps } from './types';\nimport { positionToPlacement } from '../popover/utils';\n\nconst disabledEventsOnDisabledButton = [ 'onMouseDown', 'onClick' ] as const;\n\nfunction useDeprecatedProps( {\n\t__experimentalIsFocusable,\n\tisDefault,\n\tisPrimary,\n\tisSecondary,\n\tisTertiary,\n\tisLink,\n\tisPressed,\n\tisSmall,\n\tsize,\n\tvariant,\n\tdescribedBy,\n\t...otherProps\n}: ButtonProps & DeprecatedButtonProps ): ButtonProps {\n\tlet computedSize = size;\n\tlet computedVariant = variant;\n\n\tconst newProps = {\n\t\taccessibleWhenDisabled: __experimentalIsFocusable,\n\t\t// @todo Mark `isPressed` as deprecated\n\t\t'aria-pressed': isPressed,\n\t\tdescription: describedBy,\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\taccessibleWhenDisabled,\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\tdescription,\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 && ! accessibleWhenDisabled;\n\tconst Tag = href !== undefined && ! disabled ? '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\tconst disableEventProps: {\n\t\t[ key: string ]: ( event: MouseEvent ) => void;\n\t} = {};\n\tif ( disabled && accessibleWhenDisabled ) {\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\t\tfor ( const disabledEvent of disabledEventsOnDisabledButton ) {\n\t\t\tdisableEventProps[ 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 = description ? 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{ ...disableEventProps }\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{ ...disableEventProps }\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\tdescription\n\t\t\t\t\t\t? description\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{ description && (\n\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t<span id={ descriptionId }>{ description }</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 */\n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,CAAW,CAAC,EAChD1D,WAAW,iBACZvB,IAAA,CAACH,cAAc;MAAAkD,QAAA,eACd/C,IAAA;QAAMoF,EAAE,EAAGP,aAAe;QAAA9B,QAAA,EAAGxB;MAAW,CAAQ;IAAC,CAClC,CAChB;EAAA,CACA,CAAC;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMmC,MAAM,GAAGjE,UAAU,CAAEuC,iBAAkB,CAAC;AACrD,eAAe0B,MAAM","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["@wordpress/components/src/button/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Props as IconProps } from '../icon';\nimport type { PopoverProps } from '../popover/types';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\n\nexport type ButtonProps =\n\t| WordPressComponentProps< ButtonAsButtonProps, 'button', false >\n\t| WordPressComponentProps< ButtonAsAnchorProps, 'a', false >;\n\nexport type ButtonAsButtonProps = BaseButtonProps & _ButtonProps;\nexport type ButtonAsAnchorProps = BaseButtonProps & AnchorProps;\n\ntype BaseButtonProps = {\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * The button's children.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An accessible description for the button.\n\t */\n\tdescribedBy?: string;\n\t/**\n\t * If provided, renders an Icon component inside the button.\n\t */\n\ticon?: IconProps[ 'icon' ];\n\t/**\n\t * If provided with `icon`, sets the position of icon relative to the `text`.\n\t *\n\t * @default 'left'\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * If provided with `icon`, sets the icon size.\n\t * Please refer to the Icon component for more details regarding\n\t * the default value of its `size` prop.\n\t */\n\ticonSize?: IconProps[ 'size' ];\n\t/**\n\t * Indicates activity while a action is being performed.\n\t */\n\tisBusy?: boolean;\n\t/**\n\t * Renders a red text-based button style to indicate destructive behavior.\n\t */\n\tisDestructive?: boolean;\n\t/**\n\t * Renders a pressed button style.\n\t */\n\tisPressed?: boolean;\n\t/**\n\t * Sets the `aria-label` of the component, if none is provided.\n\t * Sets the Tooltip content if `showTooltip` is provided.\n\t */\n\tlabel?: string;\n\t/**\n\t * If provided with `showTooltip`, appends the Shortcut label to the tooltip content.\n\t * If an object is provided, it should contain `display` and `ariaLabel` keys.\n\t */\n\tshortcut?: string | { display: string; ariaLabel: string };\n\t/**\n\t * If provided, renders a Tooltip component for the button.\n\t */\n\tshowTooltip?: boolean;\n\t/**\n\t * The size of the button.\n\t *\n\t * - `'default'`: For normal text-label buttons, unless it is a toggle button.\n\t * - `'compact'`: For toggle buttons, icon buttons, and buttons when used in context of either.\n\t * - `'small'`: For icon buttons associated with more advanced or auxiliary features.\n\t *\n\t * If the deprecated `isSmall` prop is also defined, this prop will take precedence.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'compact' | 'small';\n\t/**\n\t * If provided, displays the given text inside the button. If the button contains children elements, the text is displayed before them.\n\t */\n\ttext?: string;\n\t/**\n\t * If provided with `showTooltip`, sets the position of the tooltip.\n\t * Please refer to the Tooltip component for more details regarding the defaults.\n\t */\n\ttooltipPosition?: PopoverProps[ 'position' ];\n\t/**\n\t * Specifies the button's style.\n\t * The accepted values are:\n\t * 'primary' (the primary button styles)\n\t * 'secondary' (the default button styles)\n\t * 'tertiary' (the text-based button styles)\n\t * 'link' (the link button styles)\n\t */\n\tvariant?: 'primary' | 'secondary' | 'tertiary' | 'link';\n\t/**\n\t * Whether to keep the button focusable when disabled.\n\t *\n\t * @default false\n\t */\n\t__experimentalIsFocusable?: boolean;\n};\n\ntype _ButtonProps = {\n\t/**\n\t * Whether the button is disabled.\n\t *\n\t * If `true`, this will force a `button` element to be rendered, even when an `href` is given.\n\t */\n\tdisabled?: boolean;\n};\n\ntype AnchorProps = {\n\t/**\n\t * Whether the button is disabled.\n\t *\n\t * If `true`, this will force a `button` element to be rendered, even when an `href` is given.\n\t */\n\tdisabled?: false;\n\t/**\n\t * If provided, renders `a` instead of `button`.\n\t */\n\thref: string;\n\t/**\n\t * If provided with `href`, sets the `target` attribute to the `a`.\n\t */\n\ttarget?: string;\n};\n\nexport type DeprecatedButtonProps = {\n\t/**\n\t * Gives the button a default style.\n\t *\n\t * @deprecated Use the `'secondary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisDefault?: boolean;\n\t/**\n\t * Gives the button a link style.\n\t *\n\t * @deprecated Use the `'link'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisLink?: boolean;\n\t/**\n\t * Gives the button a primary style.\n\t *\n\t * @deprecated Use the `'primary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisPrimary?: boolean;\n\t/**\n\t * Gives the button a default style.\n\t *\n\t * @deprecated Use the `'secondary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisSecondary?: boolean;\n\t/**\n\t * Gives the button a text-based style.\n\t *\n\t * @deprecated Use the `'tertiary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisTertiary?: boolean;\n\t/**\n\t * Decreases the size of the button.\n\t *\n\t * @deprecated Use the `'small'` value on the `size` prop instead.\n\t * @ignore\n\t */\n\tisSmall?: boolean;\n};\n\nexport type DeprecatedIconButtonProps = {\n\tlabelPosition: ButtonProps[ 'tooltipPosition' ];\n\tshowTooltip?: boolean;\n\tsize: ButtonProps[ 'iconSize' ];\n\tlabel: ButtonProps[ 'label' ];\n\ttooltip: ButtonProps[ 'label' ];\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/button/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { Props as IconProps } from '../icon';\nimport type { PopoverProps } from '../popover/types';\nimport type { WordPressComponentProps } from '../context/wordpress-component';\n\nexport type ButtonProps =\n\t| WordPressComponentProps< ButtonAsButtonProps, 'button', false >\n\t| WordPressComponentProps< ButtonAsAnchorProps, 'a', false >;\n\nexport type ButtonAsButtonProps = BaseButtonProps & _ButtonProps;\nexport type ButtonAsAnchorProps = BaseButtonProps & AnchorProps;\n\ntype BaseButtonProps = {\n\t/**\n\t * Start opting into the larger default height that will become the\n\t * default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * Whether to keep the button focusable when disabled.\n\t *\n\t * In most cases, it is recommended to set this to `true`. Disabling a control without maintaining focusability\n\t * can cause accessibility issues, by hiding their presence from screen reader users,\n\t * or by preventing focus from returning to a trigger element.\n\t *\n\t * Learn more about the [focusability of disabled controls](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols)\n\t * in the WAI-ARIA Authoring Practices Guide.\n\t *\n\t * @default false\n\t */\n\taccessibleWhenDisabled?: boolean;\n\t/**\n\t * The button's children.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * A visually hidden accessible description for the button.\n\t */\n\tdescription?: string;\n\t/**\n\t * If provided, renders an Icon component inside the button.\n\t */\n\ticon?: IconProps[ 'icon' ];\n\t/**\n\t * If provided with `icon`, sets the position of icon relative to the `text`.\n\t *\n\t * @default 'left'\n\t */\n\ticonPosition?: 'left' | 'right';\n\t/**\n\t * If provided with `icon`, sets the icon size.\n\t * Please refer to the Icon component for more details regarding\n\t * the default value of its `size` prop.\n\t */\n\ticonSize?: IconProps[ 'size' ];\n\t/**\n\t * Indicates activity while a action is being performed.\n\t */\n\tisBusy?: boolean;\n\t/**\n\t * Renders a red text-based button style to indicate destructive behavior.\n\t */\n\tisDestructive?: boolean;\n\t/**\n\t * Renders a pressed button style.\n\t */\n\tisPressed?: boolean;\n\t/**\n\t * Sets the `aria-label` of the component, if none is provided.\n\t * Sets the Tooltip content if `showTooltip` is provided.\n\t */\n\tlabel?: string;\n\t/**\n\t * If provided with `showTooltip`, appends the Shortcut label to the tooltip content.\n\t * If an object is provided, it should contain `display` and `ariaLabel` keys.\n\t */\n\tshortcut?: string | { display: string; ariaLabel: string };\n\t/**\n\t * If provided, renders a Tooltip component for the button.\n\t */\n\tshowTooltip?: boolean;\n\t/**\n\t * The size of the button.\n\t *\n\t * - `'default'`: For normal text-label buttons, unless it is a toggle button.\n\t * - `'compact'`: For toggle buttons, icon buttons, and buttons when used in context of either.\n\t * - `'small'`: For icon buttons associated with more advanced or auxiliary features.\n\t *\n\t * If the deprecated `isSmall` prop is also defined, this prop will take precedence.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | 'compact' | 'small';\n\t/**\n\t * If provided, displays the given text inside the button. If the button contains children elements, the text is displayed before them.\n\t */\n\ttext?: string;\n\t/**\n\t * If provided with `showTooltip`, sets the position of the tooltip.\n\t * Please refer to the Tooltip component for more details regarding the defaults.\n\t */\n\ttooltipPosition?: PopoverProps[ 'position' ];\n\t/**\n\t * Specifies the button's style.\n\t * The accepted values are:\n\t * 'primary' (the primary button styles)\n\t * 'secondary' (the default button styles)\n\t * 'tertiary' (the text-based button styles)\n\t * 'link' (the link button styles)\n\t */\n\tvariant?: 'primary' | 'secondary' | 'tertiary' | 'link';\n};\n\ntype _ButtonProps = {\n\t/**\n\t * Whether the button is disabled. If `true`, this will force a `button` element\n\t * to be rendered, even when an `href` is given.\n\t *\n\t * In most cases, it is recommended to also set the `accessibleWhenDisabled` prop to `true`.\n\t */\n\tdisabled?: boolean;\n};\n\ntype AnchorProps = {\n\t/**\n\t * Whether the button is disabled. If `true`, this will force a `button` element\n\t * to be rendered, even when an `href` is given.\n\t *\n\t * In most cases, it is recommended to also set the `accessibleWhenDisabled` prop to `true`.\n\t */\n\tdisabled?: false;\n\t/**\n\t * If provided, renders `a` instead of `button`.\n\t */\n\thref: string;\n\t/**\n\t * If provided with `href`, sets the `target` attribute to the `a`.\n\t */\n\ttarget?: string;\n};\n\nexport type DeprecatedButtonProps = {\n\t/**\n\t * Whether to keep the button focusable when disabled.\n\t *\n\t * @default false\n\t * @deprecated Use the `accessibleWhenDisabled` prop instead.\n\t * @ignore\n\t */\n\t__experimentalIsFocusable?: boolean;\n\t/**\n\t * Gives the button a default style.\n\t *\n\t * @deprecated Use the `'secondary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisDefault?: boolean;\n\t/**\n\t * Gives the button a link style.\n\t *\n\t * @deprecated Use the `'link'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisLink?: boolean;\n\t/**\n\t * Gives the button a primary style.\n\t *\n\t * @deprecated Use the `'primary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisPrimary?: boolean;\n\t/**\n\t * Gives the button a default style.\n\t *\n\t * @deprecated Use the `'secondary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisSecondary?: boolean;\n\t/**\n\t * Gives the button a text-based style.\n\t *\n\t * @deprecated Use the `'tertiary'` value on the `variant` prop instead.\n\t * @ignore\n\t */\n\tisTertiary?: boolean;\n\t/**\n\t * Decreases the size of the button.\n\t *\n\t * @deprecated Use the `'small'` value on the `size` prop instead.\n\t * @ignore\n\t */\n\tisSmall?: boolean;\n\t/**\n\t * A visually hidden accessible description for the button.\n\t *\n\t * @deprecated Use the `description` prop instead.\n\t * @ignore\n\t */\n\tdescribedBy?: string;\n};\n\nexport type DeprecatedIconButtonProps = {\n\tlabelPosition: ButtonProps[ 'tooltipPosition' ];\n\tshowTooltip?: boolean;\n\tsize: ButtonProps[ 'iconSize' ];\n\tlabel: ButtonProps[ 'label' ];\n\ttooltip: ButtonProps[ 'label' ];\n};\n"],"mappings":"","ignoreList":[]}
@@ -28,6 +28,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
28
28
  * const [ isChecked, setChecked ] = useState( true );
29
29
  * return (
30
30
  * <CheckboxControl
31
+ * __nextHasNoMarginBottom
31
32
  * label="Is author"
32
33
  * help="Is the user a author or not?"
33
34
  * checked={ isChecked }