@wordpress/components 27.4.0 → 27.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1287) hide show
  1. package/CHANGELOG.md +47 -1
  2. package/build/alignment-matrix-control/icon.js +2 -2
  3. package/build/alignment-matrix-control/icon.js.map +1 -1
  4. package/build/alignment-matrix-control/index.js +5 -3
  5. package/build/alignment-matrix-control/index.js.map +1 -1
  6. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js +8 -8
  7. package/build/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  8. package/build/alignment-matrix-control/utils.js +6 -2
  9. package/build/alignment-matrix-control/utils.js.map +1 -1
  10. package/build/angle-picker-control/index.js +2 -2
  11. package/build/angle-picker-control/index.js.map +1 -1
  12. package/build/animate/index.js +4 -4
  13. package/build/animate/index.js.map +1 -1
  14. package/build/autocomplete/autocompleter-ui.js +5 -3
  15. package/build/autocomplete/autocompleter-ui.js.map +1 -1
  16. package/build/autocomplete/index.js +21 -7
  17. package/build/autocomplete/index.js.map +1 -1
  18. package/build/base-control/hooks.js +1 -4
  19. package/build/base-control/hooks.js.map +1 -1
  20. package/build/base-control/index.js +2 -2
  21. package/build/base-control/index.js.map +1 -1
  22. package/build/base-control/types.js.map +1 -1
  23. package/build/border-control/types.js.map +1 -1
  24. package/build/button/index.js +2 -2
  25. package/build/button/index.js.map +1 -1
  26. package/build/button-group/index.js +2 -2
  27. package/build/button-group/index.js.map +1 -1
  28. package/build/checkbox-control/index.js +11 -4
  29. package/build/checkbox-control/index.js.map +1 -1
  30. package/build/circular-option-picker/circular-option-picker-actions.js +3 -3
  31. package/build/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  32. package/build/circular-option-picker/circular-option-picker-option-group.js +2 -2
  33. package/build/circular-option-picker/circular-option-picker-option-group.js.map +1 -1
  34. package/build/circular-option-picker/circular-option-picker-option.js +2 -2
  35. package/build/circular-option-picker/circular-option-picker-option.js.map +1 -1
  36. package/build/circular-option-picker/circular-option-picker.js +2 -2
  37. package/build/circular-option-picker/circular-option-picker.js.map +1 -1
  38. package/build/clipboard-button/index.js +2 -2
  39. package/build/clipboard-button/index.js.map +1 -1
  40. package/build/color-indicator/index.js +2 -2
  41. package/build/color-indicator/index.js.map +1 -1
  42. package/build/color-palette/index.js +2 -2
  43. package/build/color-palette/index.js.map +1 -1
  44. package/build/color-picker/hex-input.js +3 -1
  45. package/build/color-picker/hex-input.js.map +1 -1
  46. package/build/color-picker/hue-picker.native.js +6 -2
  47. package/build/color-picker/hue-picker.native.js.map +1 -1
  48. package/build/color-picker/index.native.js +9 -3
  49. package/build/color-picker/index.native.js.map +1 -1
  50. package/build/color-picker/saturation-picker.native.js +6 -2
  51. package/build/color-picker/saturation-picker.native.js.map +1 -1
  52. package/build/color-picker/use-deprecated-props.js +9 -3
  53. package/build/color-picker/use-deprecated-props.js.map +1 -1
  54. package/build/combobox-control/index.js +7 -2
  55. package/build/combobox-control/index.js.map +1 -1
  56. package/build/combobox-control/types.js.map +1 -1
  57. package/build/context/context-connect.js +6 -2
  58. package/build/context/context-connect.js.map +1 -1
  59. package/build/custom-gradient-picker/gradient-bar/control-points.js +3 -3
  60. package/build/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  61. package/build/custom-gradient-picker/gradient-bar/index.js +2 -2
  62. package/build/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  63. package/build/custom-gradient-picker/index.js.map +1 -1
  64. package/build/custom-select-control/index.js +3 -3
  65. package/build/custom-select-control/index.js.map +1 -1
  66. package/build/custom-select-control-v2/legacy-component/index.js +3 -1
  67. package/build/custom-select-control-v2/legacy-component/index.js.map +1 -1
  68. package/build/dimension-control/index.js +2 -2
  69. package/build/dimension-control/index.js.map +1 -1
  70. package/build/drop-zone/index.js +74 -66
  71. package/build/drop-zone/index.js.map +1 -1
  72. package/build/dropdown/index.js +2 -2
  73. package/build/dropdown/index.js.map +1 -1
  74. package/build/dropdown/styles.js +5 -3
  75. package/build/dropdown/styles.js.map +1 -1
  76. package/build/dropdown-menu/index.js +5 -5
  77. package/build/dropdown-menu/index.js.map +1 -1
  78. package/build/dropdown-menu/index.native.js +4 -4
  79. package/build/dropdown-menu/index.native.js.map +1 -1
  80. package/build/duotone-picker/utils.js +3 -1
  81. package/build/duotone-picker/utils.js.map +1 -1
  82. package/build/elevation/hook.js +5 -6
  83. package/build/elevation/hook.js.map +1 -1
  84. package/build/external-link/index.js +2 -2
  85. package/build/external-link/index.js.map +1 -1
  86. package/build/focal-point-picker/controls.js +3 -1
  87. package/build/focal-point-picker/controls.js.map +1 -1
  88. package/build/focal-point-picker/focal-point.js +2 -2
  89. package/build/focal-point-picker/focal-point.js.map +1 -1
  90. package/build/focal-point-picker/index.js +23 -9
  91. package/build/focal-point-picker/index.js.map +1 -1
  92. package/build/focal-point-picker/styles/focal-point-picker-style.js +12 -12
  93. package/build/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  94. package/build/focal-point-picker/tooltip/index.native.js +3 -8
  95. package/build/focal-point-picker/tooltip/index.native.js.map +1 -1
  96. package/build/focal-point-picker/utils.js +3 -1
  97. package/build/focal-point-picker/utils.js.map +1 -1
  98. package/build/font-size-picker/index.js +3 -2
  99. package/build/font-size-picker/index.js.map +1 -1
  100. package/build/font-size-picker/types.js.map +1 -1
  101. package/build/form-toggle/index.js +2 -2
  102. package/build/form-toggle/index.js.map +1 -1
  103. package/build/form-token-field/index.js +3 -3
  104. package/build/form-token-field/index.js.map +1 -1
  105. package/build/form-token-field/suggestions-list.js +9 -5
  106. package/build/form-token-field/suggestions-list.js.map +1 -1
  107. package/build/form-token-field/token-input.js +2 -2
  108. package/build/form-token-field/token-input.js.map +1 -1
  109. package/build/form-token-field/token.js +2 -2
  110. package/build/form-token-field/token.js.map +1 -1
  111. package/build/guide/index.js +2 -2
  112. package/build/guide/index.js.map +1 -1
  113. package/build/input-control/index.js +3 -6
  114. package/build/input-control/index.js.map +1 -1
  115. package/build/input-control/input-field.js +3 -1
  116. package/build/input-control/input-field.js.map +1 -1
  117. package/build/input-control/label.js +3 -1
  118. package/build/input-control/label.js.map +1 -1
  119. package/build/input-control/styles/input-control-styles.js +31 -23
  120. package/build/input-control/styles/input-control-styles.js.map +1 -1
  121. package/build/input-control/utils.js +8 -4
  122. package/build/input-control/utils.js.map +1 -1
  123. package/build/item-group/item/hook.js +0 -4
  124. package/build/item-group/item/hook.js.map +1 -1
  125. package/build/menu-group/index.js +2 -2
  126. package/build/menu-group/index.js.map +1 -1
  127. package/build/menu-item/index.js +3 -3
  128. package/build/menu-item/index.js.map +1 -1
  129. package/build/mobile/color-settings/utils.native.js +1 -1
  130. package/build/mobile/color-settings/utils.native.js.map +1 -1
  131. package/build/mobile/gradient/index.native.js +3 -1
  132. package/build/mobile/gradient/index.native.js.map +1 -1
  133. package/build/mobile/keyboard-aware-flat-list/index.android.js +9 -3
  134. package/build/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  135. package/build/mobile/keyboard-aware-flat-list/index.ios.js +15 -13
  136. package/build/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  137. package/build/mobile/keyboard-aware-flat-list/shared.native.js +33 -0
  138. package/build/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
  139. package/build/modal/aria-helper.js +9 -3
  140. package/build/modal/aria-helper.js.map +1 -1
  141. package/build/modal/index.js +10 -6
  142. package/build/modal/index.js.map +1 -1
  143. package/build/navigation/back-button/index.js +2 -2
  144. package/build/navigation/back-button/index.js.map +1 -1
  145. package/build/navigation/group/index.js +2 -2
  146. package/build/navigation/group/index.js.map +1 -1
  147. package/build/navigation/index.js +3 -3
  148. package/build/navigation/index.js.map +1 -1
  149. package/build/navigation/item/base.js +2 -2
  150. package/build/navigation/item/base.js.map +1 -1
  151. package/build/navigation/item/index.js +2 -2
  152. package/build/navigation/item/index.js.map +1 -1
  153. package/build/navigation/menu/index.js +2 -2
  154. package/build/navigation/menu/index.js.map +1 -1
  155. package/build/navigation/styles/navigation-styles.js +12 -12
  156. package/build/navigation/styles/navigation-styles.js.map +1 -1
  157. package/build/notice/index.js +3 -3
  158. package/build/notice/index.js.map +1 -1
  159. package/build/notice/list.js +2 -2
  160. package/build/notice/list.js.map +1 -1
  161. package/build/number-control/index.js +2 -2
  162. package/build/number-control/index.js.map +1 -1
  163. package/build/palette-edit/index.js +5 -5
  164. package/build/palette-edit/index.js.map +1 -1
  165. package/build/palette-edit/styles.js +14 -15
  166. package/build/palette-edit/styles.js.map +1 -1
  167. package/build/panel/body.js +5 -3
  168. package/build/panel/body.js.map +1 -1
  169. package/build/panel/index.js +2 -2
  170. package/build/panel/index.js.map +1 -1
  171. package/build/panel/row.js +2 -2
  172. package/build/panel/row.js.map +1 -1
  173. package/build/placeholder/index.js +3 -3
  174. package/build/placeholder/index.js.map +1 -1
  175. package/build/popover/index.js +5 -3
  176. package/build/popover/index.js.map +1 -1
  177. package/build/popover/overlay-middlewares.js +3 -1
  178. package/build/popover/overlay-middlewares.js.map +1 -1
  179. package/build/query-controls/author-select.js +3 -1
  180. package/build/query-controls/author-select.js.map +1 -1
  181. package/build/radio-control/index.js +2 -2
  182. package/build/radio-control/index.js.map +1 -1
  183. package/build/range-control/index.js +3 -3
  184. package/build/range-control/index.js.map +1 -1
  185. package/build/range-control/mark.js +3 -3
  186. package/build/range-control/mark.js.map +1 -1
  187. package/build/range-control/rail.js +1 -1
  188. package/build/range-control/rail.js.map +1 -1
  189. package/build/range-control/styles/range-control-styles.js +29 -29
  190. package/build/range-control/styles/range-control-styles.js.map +1 -1
  191. package/build/range-control/tooltip.js +2 -2
  192. package/build/range-control/tooltip.js.map +1 -1
  193. package/build/resizable-box/index.js +10 -10
  194. package/build/resizable-box/index.js.map +1 -1
  195. package/build/resizable-box/resize-tooltip/index.js +5 -3
  196. package/build/resizable-box/resize-tooltip/index.js.map +1 -1
  197. package/build/resizable-box/resize-tooltip/label.js +3 -1
  198. package/build/resizable-box/resize-tooltip/label.js.map +1 -1
  199. package/build/resizable-box/resize-tooltip/utils.js +12 -4
  200. package/build/resizable-box/resize-tooltip/utils.js.map +1 -1
  201. package/build/responsive-wrapper/index.js +2 -2
  202. package/build/responsive-wrapper/index.js.map +1 -1
  203. package/build/search-control/index.js +2 -2
  204. package/build/search-control/index.js.map +1 -1
  205. package/build/select-control/index.js +5 -3
  206. package/build/select-control/index.js.map +1 -1
  207. package/build/select-control/styles/select-control-styles.js +8 -6
  208. package/build/select-control/styles/select-control-styles.js.map +1 -1
  209. package/build/slot-fill/bubbles-virtually/slot-fill-context.js +3 -3
  210. package/build/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  211. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js +3 -3
  212. package/build/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  213. package/build/slot-fill/bubbles-virtually/use-slot-fills.js +2 -2
  214. package/build/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  215. package/build/slot-fill/bubbles-virtually/use-slot.js +2 -2
  216. package/build/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  217. package/build/slot-fill/types.js.map +1 -1
  218. package/build/snackbar/index.js +3 -3
  219. package/build/snackbar/index.js.map +1 -1
  220. package/build/snackbar/list.js +2 -2
  221. package/build/snackbar/list.js.map +1 -1
  222. package/build/spinner/index.js +2 -2
  223. package/build/spinner/index.js.map +1 -1
  224. package/build/tab-panel/index.js +2 -2
  225. package/build/tab-panel/index.js.map +1 -1
  226. package/build/text/get-line-height.js +6 -2
  227. package/build/text/get-line-height.js.map +1 -1
  228. package/build/text/utils.js +6 -2
  229. package/build/text/utils.js.map +1 -1
  230. package/build/text-control/index.js +2 -2
  231. package/build/text-control/index.js.map +1 -1
  232. package/build/theme/color-algorithms.js +6 -2
  233. package/build/theme/color-algorithms.js.map +1 -1
  234. package/build/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
  235. package/build/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  236. package/build/toggle-group-control/toggle-group-control-option-base/styles.js +9 -9
  237. package/build/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  238. package/build/toolbar/toolbar/index.js +2 -2
  239. package/build/toolbar/toolbar/index.js.map +1 -1
  240. package/build/toolbar/toolbar-button/index.js +3 -3
  241. package/build/toolbar/toolbar-button/index.js.map +1 -1
  242. package/build/toolbar/toolbar-group/index.js +2 -2
  243. package/build/toolbar/toolbar-group/index.js.map +1 -1
  244. package/build/tools-panel/tools-panel/hook.js +5 -6
  245. package/build/tools-panel/tools-panel/hook.js.map +1 -1
  246. package/build/tools-panel/tools-panel-item/hook.js +6 -8
  247. package/build/tools-panel/tools-panel-item/hook.js.map +1 -1
  248. package/build/tools-panel/types.js.map +1 -1
  249. package/build/tree-grid/roving-tab-index-item.js +3 -1
  250. package/build/tree-grid/roving-tab-index-item.js.map +1 -1
  251. package/build/truncate/hook.js +1 -1
  252. package/build/truncate/hook.js.map +1 -1
  253. package/build/unit-control/index.js +5 -3
  254. package/build/unit-control/index.js.map +1 -1
  255. package/build/unit-control/unit-select-control.js +2 -2
  256. package/build/unit-control/unit-select-control.js.map +1 -1
  257. package/build/utils/colors.js +21 -7
  258. package/build/utils/colors.js.map +1 -1
  259. package/build/utils/font-size.js +3 -1
  260. package/build/utils/font-size.js.map +1 -1
  261. package/build/utils/get-valid-children.js +3 -1
  262. package/build/utils/get-valid-children.js.map +1 -1
  263. package/build/utils/input/base.js +2 -3
  264. package/build/utils/input/base.js.map +1 -1
  265. package/build/utils/strings.js +11 -57
  266. package/build/utils/strings.js.map +1 -1
  267. package/build/utils/use-responsive-value.js +3 -1
  268. package/build/utils/use-responsive-value.js.map +1 -1
  269. package/build/view/component.js +26 -8
  270. package/build/view/component.js.map +1 -1
  271. package/build-module/alignment-matrix-control/icon.js +2 -2
  272. package/build-module/alignment-matrix-control/icon.js.map +1 -1
  273. package/build-module/alignment-matrix-control/index.js +5 -3
  274. package/build-module/alignment-matrix-control/index.js.map +1 -1
  275. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js +9 -9
  276. package/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js.map +1 -1
  277. package/build-module/alignment-matrix-control/utils.js +6 -2
  278. package/build-module/alignment-matrix-control/utils.js.map +1 -1
  279. package/build-module/angle-picker-control/index.js +2 -2
  280. package/build-module/angle-picker-control/index.js.map +1 -1
  281. package/build-module/animate/index.js +4 -4
  282. package/build-module/animate/index.js.map +1 -1
  283. package/build-module/autocomplete/autocompleter-ui.js +5 -3
  284. package/build-module/autocomplete/autocompleter-ui.js.map +1 -1
  285. package/build-module/autocomplete/index.js +21 -7
  286. package/build-module/autocomplete/index.js.map +1 -1
  287. package/build-module/base-control/hooks.js +1 -4
  288. package/build-module/base-control/hooks.js.map +1 -1
  289. package/build-module/base-control/index.js +2 -2
  290. package/build-module/base-control/index.js.map +1 -1
  291. package/build-module/base-control/types.js.map +1 -1
  292. package/build-module/border-control/types.js.map +1 -1
  293. package/build-module/button/index.js +2 -2
  294. package/build-module/button/index.js.map +1 -1
  295. package/build-module/button-group/index.js +2 -2
  296. package/build-module/button-group/index.js.map +1 -1
  297. package/build-module/checkbox-control/index.js +11 -4
  298. package/build-module/checkbox-control/index.js.map +1 -1
  299. package/build-module/circular-option-picker/circular-option-picker-actions.js +3 -3
  300. package/build-module/circular-option-picker/circular-option-picker-actions.js.map +1 -1
  301. package/build-module/circular-option-picker/circular-option-picker-option-group.js +2 -2
  302. package/build-module/circular-option-picker/circular-option-picker-option-group.js.map +1 -1
  303. package/build-module/circular-option-picker/circular-option-picker-option.js +2 -2
  304. package/build-module/circular-option-picker/circular-option-picker-option.js.map +1 -1
  305. package/build-module/circular-option-picker/circular-option-picker.js +2 -2
  306. package/build-module/circular-option-picker/circular-option-picker.js.map +1 -1
  307. package/build-module/clipboard-button/index.js +2 -2
  308. package/build-module/clipboard-button/index.js.map +1 -1
  309. package/build-module/color-indicator/index.js +2 -2
  310. package/build-module/color-indicator/index.js.map +1 -1
  311. package/build-module/color-palette/index.js +2 -2
  312. package/build-module/color-palette/index.js.map +1 -1
  313. package/build-module/color-picker/hex-input.js +3 -1
  314. package/build-module/color-picker/hex-input.js.map +1 -1
  315. package/build-module/color-picker/hue-picker.native.js +6 -2
  316. package/build-module/color-picker/hue-picker.native.js.map +1 -1
  317. package/build-module/color-picker/index.native.js +9 -3
  318. package/build-module/color-picker/index.native.js.map +1 -1
  319. package/build-module/color-picker/saturation-picker.native.js +6 -2
  320. package/build-module/color-picker/saturation-picker.native.js.map +1 -1
  321. package/build-module/color-picker/use-deprecated-props.js +9 -3
  322. package/build-module/color-picker/use-deprecated-props.js.map +1 -1
  323. package/build-module/combobox-control/index.js +7 -2
  324. package/build-module/combobox-control/index.js.map +1 -1
  325. package/build-module/combobox-control/types.js.map +1 -1
  326. package/build-module/context/context-connect.js +6 -2
  327. package/build-module/context/context-connect.js.map +1 -1
  328. package/build-module/custom-gradient-picker/gradient-bar/control-points.js +3 -3
  329. package/build-module/custom-gradient-picker/gradient-bar/control-points.js.map +1 -1
  330. package/build-module/custom-gradient-picker/gradient-bar/index.js +2 -2
  331. package/build-module/custom-gradient-picker/gradient-bar/index.js.map +1 -1
  332. package/build-module/custom-gradient-picker/index.js.map +1 -1
  333. package/build-module/custom-select-control/index.js +3 -3
  334. package/build-module/custom-select-control/index.js.map +1 -1
  335. package/build-module/custom-select-control-v2/legacy-component/index.js +3 -1
  336. package/build-module/custom-select-control-v2/legacy-component/index.js.map +1 -1
  337. package/build-module/dimension-control/index.js +2 -2
  338. package/build-module/dimension-control/index.js.map +1 -1
  339. package/build-module/drop-zone/index.js +74 -66
  340. package/build-module/drop-zone/index.js.map +1 -1
  341. package/build-module/dropdown/index.js +2 -2
  342. package/build-module/dropdown/index.js.map +1 -1
  343. package/build-module/dropdown/styles.js +5 -3
  344. package/build-module/dropdown/styles.js.map +1 -1
  345. package/build-module/dropdown-menu/index.js +5 -5
  346. package/build-module/dropdown-menu/index.js.map +1 -1
  347. package/build-module/dropdown-menu/index.native.js +4 -4
  348. package/build-module/dropdown-menu/index.native.js.map +1 -1
  349. package/build-module/duotone-picker/utils.js +3 -1
  350. package/build-module/duotone-picker/utils.js.map +1 -1
  351. package/build-module/elevation/hook.js +6 -7
  352. package/build-module/elevation/hook.js.map +1 -1
  353. package/build-module/external-link/index.js +2 -2
  354. package/build-module/external-link/index.js.map +1 -1
  355. package/build-module/focal-point-picker/controls.js +3 -1
  356. package/build-module/focal-point-picker/controls.js.map +1 -1
  357. package/build-module/focal-point-picker/focal-point.js +2 -2
  358. package/build-module/focal-point-picker/focal-point.js.map +1 -1
  359. package/build-module/focal-point-picker/index.js +23 -9
  360. package/build-module/focal-point-picker/index.js.map +1 -1
  361. package/build-module/focal-point-picker/styles/focal-point-picker-style.js +13 -13
  362. package/build-module/focal-point-picker/styles/focal-point-picker-style.js.map +1 -1
  363. package/build-module/focal-point-picker/tooltip/index.native.js +3 -8
  364. package/build-module/focal-point-picker/tooltip/index.native.js.map +1 -1
  365. package/build-module/focal-point-picker/utils.js +3 -1
  366. package/build-module/focal-point-picker/utils.js.map +1 -1
  367. package/build-module/font-size-picker/index.js +3 -2
  368. package/build-module/font-size-picker/index.js.map +1 -1
  369. package/build-module/font-size-picker/types.js.map +1 -1
  370. package/build-module/form-toggle/index.js +2 -2
  371. package/build-module/form-toggle/index.js.map +1 -1
  372. package/build-module/form-token-field/index.js +3 -3
  373. package/build-module/form-token-field/index.js.map +1 -1
  374. package/build-module/form-token-field/suggestions-list.js +9 -5
  375. package/build-module/form-token-field/suggestions-list.js.map +1 -1
  376. package/build-module/form-token-field/token-input.js +2 -2
  377. package/build-module/form-token-field/token-input.js.map +1 -1
  378. package/build-module/form-token-field/token.js +2 -2
  379. package/build-module/form-token-field/token.js.map +1 -1
  380. package/build-module/guide/index.js +2 -2
  381. package/build-module/guide/index.js.map +1 -1
  382. package/build-module/input-control/index.js +3 -6
  383. package/build-module/input-control/index.js.map +1 -1
  384. package/build-module/input-control/input-field.js +3 -1
  385. package/build-module/input-control/input-field.js.map +1 -1
  386. package/build-module/input-control/label.js +3 -1
  387. package/build-module/input-control/label.js.map +1 -1
  388. package/build-module/input-control/styles/input-control-styles.js +31 -23
  389. package/build-module/input-control/styles/input-control-styles.js.map +1 -1
  390. package/build-module/input-control/utils.js +8 -4
  391. package/build-module/input-control/utils.js.map +1 -1
  392. package/build-module/item-group/item/hook.js +0 -4
  393. package/build-module/item-group/item/hook.js.map +1 -1
  394. package/build-module/menu-group/index.js +2 -2
  395. package/build-module/menu-group/index.js.map +1 -1
  396. package/build-module/menu-item/index.js +3 -3
  397. package/build-module/menu-item/index.js.map +1 -1
  398. package/build-module/mobile/color-settings/utils.native.js +1 -1
  399. package/build-module/mobile/color-settings/utils.native.js.map +1 -1
  400. package/build-module/mobile/gradient/index.native.js +3 -1
  401. package/build-module/mobile/gradient/index.native.js.map +1 -1
  402. package/build-module/mobile/keyboard-aware-flat-list/index.android.js +9 -3
  403. package/build-module/mobile/keyboard-aware-flat-list/index.android.js.map +1 -1
  404. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js +16 -15
  405. package/build-module/mobile/keyboard-aware-flat-list/index.ios.js.map +1 -1
  406. package/build-module/mobile/keyboard-aware-flat-list/shared.native.js +27 -0
  407. package/build-module/mobile/keyboard-aware-flat-list/shared.native.js.map +1 -0
  408. package/build-module/modal/aria-helper.js +9 -3
  409. package/build-module/modal/aria-helper.js.map +1 -1
  410. package/build-module/modal/index.js +10 -6
  411. package/build-module/modal/index.js.map +1 -1
  412. package/build-module/navigation/back-button/index.js +2 -2
  413. package/build-module/navigation/back-button/index.js.map +1 -1
  414. package/build-module/navigation/group/index.js +2 -2
  415. package/build-module/navigation/group/index.js.map +1 -1
  416. package/build-module/navigation/index.js +3 -3
  417. package/build-module/navigation/index.js.map +1 -1
  418. package/build-module/navigation/item/base.js +2 -2
  419. package/build-module/navigation/item/base.js.map +1 -1
  420. package/build-module/navigation/item/index.js +2 -2
  421. package/build-module/navigation/item/index.js.map +1 -1
  422. package/build-module/navigation/menu/index.js +2 -2
  423. package/build-module/navigation/menu/index.js.map +1 -1
  424. package/build-module/navigation/styles/navigation-styles.js +13 -13
  425. package/build-module/navigation/styles/navigation-styles.js.map +1 -1
  426. package/build-module/notice/index.js +3 -3
  427. package/build-module/notice/index.js.map +1 -1
  428. package/build-module/notice/list.js +2 -2
  429. package/build-module/notice/list.js.map +1 -1
  430. package/build-module/number-control/index.js +2 -2
  431. package/build-module/number-control/index.js.map +1 -1
  432. package/build-module/palette-edit/index.js +6 -6
  433. package/build-module/palette-edit/index.js.map +1 -1
  434. package/build-module/palette-edit/styles.js +13 -14
  435. package/build-module/palette-edit/styles.js.map +1 -1
  436. package/build-module/panel/body.js +5 -3
  437. package/build-module/panel/body.js.map +1 -1
  438. package/build-module/panel/index.js +2 -2
  439. package/build-module/panel/index.js.map +1 -1
  440. package/build-module/panel/row.js +2 -2
  441. package/build-module/panel/row.js.map +1 -1
  442. package/build-module/placeholder/index.js +3 -3
  443. package/build-module/placeholder/index.js.map +1 -1
  444. package/build-module/popover/index.js +5 -3
  445. package/build-module/popover/index.js.map +1 -1
  446. package/build-module/popover/overlay-middlewares.js +3 -1
  447. package/build-module/popover/overlay-middlewares.js.map +1 -1
  448. package/build-module/query-controls/author-select.js +3 -1
  449. package/build-module/query-controls/author-select.js.map +1 -1
  450. package/build-module/radio-control/index.js +2 -2
  451. package/build-module/radio-control/index.js.map +1 -1
  452. package/build-module/range-control/index.js +3 -3
  453. package/build-module/range-control/index.js.map +1 -1
  454. package/build-module/range-control/mark.js +3 -3
  455. package/build-module/range-control/mark.js.map +1 -1
  456. package/build-module/range-control/rail.js +1 -1
  457. package/build-module/range-control/rail.js.map +1 -1
  458. package/build-module/range-control/styles/range-control-styles.js +30 -30
  459. package/build-module/range-control/styles/range-control-styles.js.map +1 -1
  460. package/build-module/range-control/tooltip.js +2 -2
  461. package/build-module/range-control/tooltip.js.map +1 -1
  462. package/build-module/resizable-box/index.js +10 -10
  463. package/build-module/resizable-box/index.js.map +1 -1
  464. package/build-module/resizable-box/resize-tooltip/index.js +5 -3
  465. package/build-module/resizable-box/resize-tooltip/index.js.map +1 -1
  466. package/build-module/resizable-box/resize-tooltip/label.js +3 -1
  467. package/build-module/resizable-box/resize-tooltip/label.js.map +1 -1
  468. package/build-module/resizable-box/resize-tooltip/utils.js +12 -4
  469. package/build-module/resizable-box/resize-tooltip/utils.js.map +1 -1
  470. package/build-module/responsive-wrapper/index.js +2 -2
  471. package/build-module/responsive-wrapper/index.js.map +1 -1
  472. package/build-module/search-control/index.js +2 -2
  473. package/build-module/search-control/index.js.map +1 -1
  474. package/build-module/select-control/index.js +5 -3
  475. package/build-module/select-control/index.js.map +1 -1
  476. package/build-module/select-control/styles/select-control-styles.js +8 -6
  477. package/build-module/select-control/styles/select-control-styles.js.map +1 -1
  478. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js +2 -1
  479. package/build-module/slot-fill/bubbles-virtually/slot-fill-context.js.map +1 -1
  480. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js +1 -1
  481. package/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js.map +1 -1
  482. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js +1 -1
  483. package/build-module/slot-fill/bubbles-virtually/use-slot-fills.js.map +1 -1
  484. package/build-module/slot-fill/bubbles-virtually/use-slot.js +1 -1
  485. package/build-module/slot-fill/bubbles-virtually/use-slot.js.map +1 -1
  486. package/build-module/slot-fill/types.js.map +1 -1
  487. package/build-module/snackbar/index.js +3 -3
  488. package/build-module/snackbar/index.js.map +1 -1
  489. package/build-module/snackbar/list.js +2 -2
  490. package/build-module/snackbar/list.js.map +1 -1
  491. package/build-module/spinner/index.js +2 -2
  492. package/build-module/spinner/index.js.map +1 -1
  493. package/build-module/tab-panel/index.js +2 -2
  494. package/build-module/tab-panel/index.js.map +1 -1
  495. package/build-module/text/get-line-height.js +6 -2
  496. package/build-module/text/get-line-height.js.map +1 -1
  497. package/build-module/text/utils.js +6 -2
  498. package/build-module/text/utils.js.map +1 -1
  499. package/build-module/text-control/index.js +2 -2
  500. package/build-module/text-control/index.js.map +1 -1
  501. package/build-module/theme/color-algorithms.js +6 -2
  502. package/build-module/theme/color-algorithms.js.map +1 -1
  503. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js +3 -1
  504. package/build-module/toggle-group-control/toggle-group-control-option-base/component.js.map +1 -1
  505. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js +10 -10
  506. package/build-module/toggle-group-control/toggle-group-control-option-base/styles.js.map +1 -1
  507. package/build-module/toolbar/toolbar/index.js +2 -2
  508. package/build-module/toolbar/toolbar/index.js.map +1 -1
  509. package/build-module/toolbar/toolbar-button/index.js +3 -3
  510. package/build-module/toolbar/toolbar-button/index.js.map +1 -1
  511. package/build-module/toolbar/toolbar-group/index.js +2 -2
  512. package/build-module/toolbar/toolbar-group/index.js.map +1 -1
  513. package/build-module/tools-panel/tools-panel/hook.js +5 -6
  514. package/build-module/tools-panel/tools-panel/hook.js.map +1 -1
  515. package/build-module/tools-panel/tools-panel-item/hook.js +6 -8
  516. package/build-module/tools-panel/tools-panel-item/hook.js.map +1 -1
  517. package/build-module/tools-panel/types.js.map +1 -1
  518. package/build-module/tree-grid/roving-tab-index-item.js +3 -1
  519. package/build-module/tree-grid/roving-tab-index-item.js.map +1 -1
  520. package/build-module/truncate/hook.js +1 -1
  521. package/build-module/truncate/hook.js.map +1 -1
  522. package/build-module/unit-control/index.js +5 -3
  523. package/build-module/unit-control/index.js.map +1 -1
  524. package/build-module/unit-control/unit-select-control.js +2 -2
  525. package/build-module/unit-control/unit-select-control.js.map +1 -1
  526. package/build-module/utils/colors.js +21 -7
  527. package/build-module/utils/colors.js.map +1 -1
  528. package/build-module/utils/font-size.js +3 -1
  529. package/build-module/utils/font-size.js.map +1 -1
  530. package/build-module/utils/get-valid-children.js +3 -1
  531. package/build-module/utils/get-valid-children.js.map +1 -1
  532. package/build-module/utils/input/base.js +2 -3
  533. package/build-module/utils/input/base.js.map +1 -1
  534. package/build-module/utils/strings.js +12 -57
  535. package/build-module/utils/strings.js.map +1 -1
  536. package/build-module/utils/use-responsive-value.js +3 -1
  537. package/build-module/utils/use-responsive-value.js.map +1 -1
  538. package/build-module/view/component.js +26 -8
  539. package/build-module/view/component.js.map +1 -1
  540. package/build-style/style-rtl.css +56 -55
  541. package/build-style/style.css +56 -55
  542. package/build-types/alignment-matrix-control/cell.d.ts +1 -1
  543. package/build-types/alignment-matrix-control/cell.d.ts.map +1 -1
  544. package/build-types/alignment-matrix-control/icon.d.ts +1 -1
  545. package/build-types/alignment-matrix-control/icon.d.ts.map +1 -1
  546. package/build-types/alignment-matrix-control/index.d.ts +1 -1
  547. package/build-types/alignment-matrix-control/index.d.ts.map +1 -1
  548. package/build-types/alignment-matrix-control/stories/index.story.d.ts +2 -2
  549. package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
  550. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.d.ts +4 -4
  551. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts +4 -4
  552. package/build-types/alignment-matrix-control/styles/alignment-matrix-control-styles.d.ts.map +1 -1
  553. package/build-types/alignment-matrix-control/utils.d.ts.map +1 -1
  554. package/build-types/angle-picker-control/angle-circle.d.ts +1 -1
  555. package/build-types/angle-picker-control/angle-circle.d.ts.map +1 -1
  556. package/build-types/angle-picker-control/index.d.ts +1 -1
  557. package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
  558. package/build-types/angle-picker-control/styles/angle-picker-control-styles.d.ts +4 -4
  559. package/build-types/animate/index.d.ts.map +1 -1
  560. package/build-types/autocomplete/autocompleter-ui.d.ts +1 -1
  561. package/build-types/autocomplete/autocompleter-ui.d.ts.map +1 -1
  562. package/build-types/autocomplete/index.d.ts +3 -3
  563. package/build-types/autocomplete/index.d.ts.map +1 -1
  564. package/build-types/base-control/hooks.d.ts +1 -0
  565. package/build-types/base-control/hooks.d.ts.map +1 -1
  566. package/build-types/base-control/index.d.ts +2 -2
  567. package/build-types/base-control/index.d.ts.map +1 -1
  568. package/build-types/base-control/styles/base-control-styles.d.ts +5 -5
  569. package/build-types/base-control/types.d.ts +1 -2
  570. package/build-types/base-control/types.d.ts.map +1 -1
  571. package/build-types/border-box-control/border-box-control/hook.d.ts +69 -59
  572. package/build-types/border-box-control/border-box-control/hook.d.ts.map +1 -1
  573. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts +70 -61
  574. package/build-types/border-box-control/border-box-control-linked-button/hook.d.ts.map +1 -1
  575. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts +69 -59
  576. package/build-types/border-box-control/border-box-control-split-controls/hook.d.ts.map +1 -1
  577. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts +69 -59
  578. package/build-types/border-box-control/border-box-control-visualizer/hook.d.ts.map +1 -1
  579. package/build-types/border-box-control/stories/index.story.d.ts +1 -1
  580. package/build-types/border-box-control/stories/index.story.d.ts.map +1 -1
  581. package/build-types/border-control/border-control/component.d.ts +1 -0
  582. package/build-types/border-control/border-control/component.d.ts.map +1 -1
  583. package/build-types/border-control/border-control/hook.d.ts +70 -59
  584. package/build-types/border-control/border-control/hook.d.ts.map +1 -1
  585. package/build-types/border-control/border-control-dropdown/hook.d.ts +69 -59
  586. package/build-types/border-control/border-control-dropdown/hook.d.ts.map +1 -1
  587. package/build-types/border-control/border-control-style-picker/component.d.ts +1 -1
  588. package/build-types/border-control/stories/index.story.d.ts +12 -6
  589. package/build-types/border-control/stories/index.story.d.ts.map +1 -1
  590. package/build-types/border-control/types.d.ts +4 -0
  591. package/build-types/border-control/types.d.ts.map +1 -1
  592. package/build-types/box-control/all-input-control.d.ts +1 -1
  593. package/build-types/box-control/all-input-control.d.ts.map +1 -1
  594. package/build-types/box-control/axial-input-controls.d.ts +1 -1
  595. package/build-types/box-control/axial-input-controls.d.ts.map +1 -1
  596. package/build-types/box-control/icon.d.ts +1 -1
  597. package/build-types/box-control/icon.d.ts.map +1 -1
  598. package/build-types/box-control/index.d.ts +1 -1
  599. package/build-types/box-control/index.d.ts.map +1 -1
  600. package/build-types/box-control/input-controls.d.ts +1 -1
  601. package/build-types/box-control/input-controls.d.ts.map +1 -1
  602. package/build-types/box-control/linked-button.d.ts +1 -1
  603. package/build-types/box-control/linked-button.d.ts.map +1 -1
  604. package/build-types/box-control/stories/index.story.d.ts +439 -390
  605. package/build-types/box-control/stories/index.story.d.ts.map +1 -1
  606. package/build-types/box-control/styles/box-control-icon-styles.d.ts +6 -6
  607. package/build-types/box-control/styles/box-control-styles.d.ts +5 -5
  608. package/build-types/button/deprecated.d.ts +5 -51
  609. package/build-types/button/deprecated.d.ts.map +1 -1
  610. package/build-types/button/index.d.ts +1 -1
  611. package/build-types/button/index.d.ts.map +1 -1
  612. package/build-types/button/stories/index.story.d.ts +1 -1
  613. package/build-types/button/stories/index.story.d.ts.map +1 -1
  614. package/build-types/button-group/index.d.ts +1 -1
  615. package/build-types/button-group/index.d.ts.map +1 -1
  616. package/build-types/card/card/hook.d.ts +69 -59
  617. package/build-types/card/card/hook.d.ts.map +1 -1
  618. package/build-types/card/card-body/hook.d.ts +69 -59
  619. package/build-types/card/card-body/hook.d.ts.map +1 -1
  620. package/build-types/card/card-divider/hook.d.ts +69 -59
  621. package/build-types/card/card-divider/hook.d.ts.map +1 -1
  622. package/build-types/card/card-footer/hook.d.ts +69 -59
  623. package/build-types/card/card-footer/hook.d.ts.map +1 -1
  624. package/build-types/card/card-header/hook.d.ts +69 -59
  625. package/build-types/card/card-header/hook.d.ts.map +1 -1
  626. package/build-types/card/card-media/hook.d.ts +69 -59
  627. package/build-types/card/card-media/hook.d.ts.map +1 -1
  628. package/build-types/card/stories/index.story.d.ts +2 -2
  629. package/build-types/checkbox-control/index.d.ts +1 -1
  630. package/build-types/checkbox-control/index.d.ts.map +1 -1
  631. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts +2 -2
  632. package/build-types/circular-option-picker/circular-option-picker-actions.d.ts.map +1 -1
  633. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts +1 -1
  634. package/build-types/circular-option-picker/circular-option-picker-option-group.d.ts.map +1 -1
  635. package/build-types/circular-option-picker/circular-option-picker-option.d.ts +1 -1
  636. package/build-types/circular-option-picker/circular-option-picker-option.d.ts.map +1 -1
  637. package/build-types/circular-option-picker/circular-option-picker.d.ts +1 -1
  638. package/build-types/circular-option-picker/circular-option-picker.d.ts.map +1 -1
  639. package/build-types/clipboard-button/index.d.ts +1 -1
  640. package/build-types/clipboard-button/index.d.ts.map +1 -1
  641. package/build-types/color-indicator/index.d.ts +1 -1
  642. package/build-types/color-indicator/index.d.ts.map +1 -1
  643. package/build-types/color-palette/index.d.ts +1 -1
  644. package/build-types/color-palette/index.d.ts.map +1 -1
  645. package/build-types/color-palette/styles.d.ts +1 -1
  646. package/build-types/color-picker/color-copy-button.d.ts +1 -1
  647. package/build-types/color-picker/color-copy-button.d.ts.map +1 -1
  648. package/build-types/color-picker/color-input.d.ts +1 -1
  649. package/build-types/color-picker/color-input.d.ts.map +1 -1
  650. package/build-types/color-picker/component.d.ts +2 -2
  651. package/build-types/color-picker/component.d.ts.map +1 -1
  652. package/build-types/color-picker/hex-input.d.ts +1 -1
  653. package/build-types/color-picker/hex-input.d.ts.map +1 -1
  654. package/build-types/color-picker/hsl-input.d.ts +1 -1
  655. package/build-types/color-picker/hsl-input.d.ts.map +1 -1
  656. package/build-types/color-picker/input-with-slider.d.ts +1 -1
  657. package/build-types/color-picker/input-with-slider.d.ts.map +1 -1
  658. package/build-types/color-picker/legacy-adapter.d.ts +1 -1
  659. package/build-types/color-picker/legacy-adapter.d.ts.map +1 -1
  660. package/build-types/color-picker/picker.d.ts +1 -1
  661. package/build-types/color-picker/picker.d.ts.map +1 -1
  662. package/build-types/color-picker/rgb-input.d.ts +1 -1
  663. package/build-types/color-picker/rgb-input.d.ts.map +1 -1
  664. package/build-types/color-picker/stories/index.story.d.ts +1 -1
  665. package/build-types/color-picker/stories/index.story.d.ts.map +1 -1
  666. package/build-types/color-picker/styles.d.ts +6 -6
  667. package/build-types/color-picker/use-deprecated-props.d.ts.map +1 -1
  668. package/build-types/combobox-control/index.d.ts +3 -1
  669. package/build-types/combobox-control/index.d.ts.map +1 -1
  670. package/build-types/combobox-control/stories/index.story.d.ts +22 -2
  671. package/build-types/combobox-control/stories/index.story.d.ts.map +1 -1
  672. package/build-types/combobox-control/styles.d.ts +1 -1
  673. package/build-types/combobox-control/types.d.ts +1 -0
  674. package/build-types/combobox-control/types.d.ts.map +1 -1
  675. package/build-types/composite/current/stories/utils.d.ts +1 -1
  676. package/build-types/composite/current/stories/utils.d.ts.map +1 -1
  677. package/build-types/composite/legacy/stories/utils.d.ts +1 -1
  678. package/build-types/composite/legacy/stories/utils.d.ts.map +1 -1
  679. package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
  680. package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
  681. package/build-types/context/context-connect.d.ts.map +1 -1
  682. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts +2 -2
  683. package/build-types/custom-gradient-picker/gradient-bar/control-points.d.ts.map +1 -1
  684. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts +1 -1
  685. package/build-types/custom-gradient-picker/gradient-bar/index.d.ts.map +1 -1
  686. package/build-types/custom-gradient-picker/index.d.ts +1 -1
  687. package/build-types/custom-gradient-picker/index.d.ts.map +1 -1
  688. package/build-types/custom-gradient-picker/styles/custom-gradient-picker-styles.d.ts +2 -2
  689. package/build-types/custom-select-control/index.d.ts +2 -2
  690. package/build-types/custom-select-control/index.d.ts.map +1 -1
  691. package/build-types/custom-select-control-v2/custom-select.d.ts +1 -1
  692. package/build-types/custom-select-control-v2/custom-select.d.ts.map +1 -1
  693. package/build-types/custom-select-control-v2/default-component/index.d.ts +1 -1
  694. package/build-types/custom-select-control-v2/default-component/index.d.ts.map +1 -1
  695. package/build-types/custom-select-control-v2/item.d.ts +1 -1
  696. package/build-types/custom-select-control-v2/item.d.ts.map +1 -1
  697. package/build-types/custom-select-control-v2/legacy-component/index.d.ts +1 -1
  698. package/build-types/custom-select-control-v2/legacy-component/index.d.ts.map +1 -1
  699. package/build-types/custom-select-control-v2/stories/default.story.d.ts +3 -3
  700. package/build-types/custom-select-control-v2/stories/default.story.d.ts.map +1 -1
  701. package/build-types/custom-select-control-v2/styles.d.ts +8 -8
  702. package/build-types/dashicon/index.d.ts +1 -1
  703. package/build-types/dashicon/index.d.ts.map +1 -1
  704. package/build-types/date-time/date/index.d.ts +1 -1
  705. package/build-types/date-time/date/index.d.ts.map +1 -1
  706. package/build-types/date-time/date/styles.d.ts +5 -5
  707. package/build-types/date-time/date-time/styles.d.ts +1 -1
  708. package/build-types/date-time/time/index.d.ts +1 -1
  709. package/build-types/date-time/time/index.d.ts.map +1 -1
  710. package/build-types/date-time/time/styles.d.ts +10 -10
  711. package/build-types/date-time/time/timezone.d.ts +1 -1
  712. package/build-types/date-time/time/timezone.d.ts.map +1 -1
  713. package/build-types/dimension-control/index.d.ts +1 -1
  714. package/build-types/dimension-control/index.d.ts.map +1 -1
  715. package/build-types/disabled/index.d.ts +1 -1
  716. package/build-types/disabled/index.d.ts.map +1 -1
  717. package/build-types/disclosure/index.d.ts +1 -1
  718. package/build-types/disclosure/index.d.ts.map +1 -1
  719. package/build-types/divider/styles.d.ts +1 -1
  720. package/build-types/draggable/index.d.ts +1 -1
  721. package/build-types/draggable/index.d.ts.map +1 -1
  722. package/build-types/drop-zone/index.d.ts +1 -1
  723. package/build-types/drop-zone/index.d.ts.map +1 -1
  724. package/build-types/drop-zone/stories/index.story.d.ts +1 -1
  725. package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
  726. package/build-types/dropdown/index.d.ts +1 -1
  727. package/build-types/dropdown/index.d.ts.map +1 -1
  728. package/build-types/dropdown/stories/index.story.d.ts +4 -4
  729. package/build-types/dropdown/stories/index.story.d.ts.map +1 -1
  730. package/build-types/dropdown/styles.d.ts +1 -1
  731. package/build-types/dropdown/styles.d.ts.map +1 -1
  732. package/build-types/dropdown-menu/index.d.ts +1 -1
  733. package/build-types/dropdown-menu/index.d.ts.map +1 -1
  734. package/build-types/dropdown-menu/stories/index.story.d.ts +2 -2
  735. package/build-types/dropdown-menu/stories/index.story.d.ts.map +1 -1
  736. package/build-types/dropdown-menu-v2/index.d.ts +7 -7
  737. package/build-types/dropdown-menu-v2/index.d.ts.map +1 -1
  738. package/build-types/dropdown-menu-v2/styles.d.ts +12 -12
  739. package/build-types/duotone-picker/color-list-picker/index.d.ts +1 -1
  740. package/build-types/duotone-picker/color-list-picker/index.d.ts.map +1 -1
  741. package/build-types/duotone-picker/custom-duotone-bar.d.ts +1 -1
  742. package/build-types/duotone-picker/custom-duotone-bar.d.ts.map +1 -1
  743. package/build-types/duotone-picker/duotone-picker.d.ts +1 -1
  744. package/build-types/duotone-picker/duotone-picker.d.ts.map +1 -1
  745. package/build-types/duotone-picker/duotone-swatch.d.ts +1 -1
  746. package/build-types/duotone-picker/duotone-swatch.d.ts.map +1 -1
  747. package/build-types/duotone-picker/utils.d.ts.map +1 -1
  748. package/build-types/elevation/hook.d.ts +68 -58
  749. package/build-types/elevation/hook.d.ts.map +1 -1
  750. package/build-types/flex/flex/hook.d.ts +69 -59
  751. package/build-types/flex/flex/hook.d.ts.map +1 -1
  752. package/build-types/flex/flex-block/hook.d.ts +69 -59
  753. package/build-types/flex/flex-block/hook.d.ts.map +1 -1
  754. package/build-types/flex/flex-item/hook.d.ts +69 -59
  755. package/build-types/flex/flex-item/hook.d.ts.map +1 -1
  756. package/build-types/focal-point-picker/controls.d.ts +1 -1
  757. package/build-types/focal-point-picker/controls.d.ts.map +1 -1
  758. package/build-types/focal-point-picker/focal-point.d.ts +1 -1
  759. package/build-types/focal-point-picker/focal-point.d.ts.map +1 -1
  760. package/build-types/focal-point-picker/grid.d.ts +1 -1
  761. package/build-types/focal-point-picker/grid.d.ts.map +1 -1
  762. package/build-types/focal-point-picker/index.d.ts +1 -1
  763. package/build-types/focal-point-picker/index.d.ts.map +1 -1
  764. package/build-types/focal-point-picker/media.d.ts +1 -1
  765. package/build-types/focal-point-picker/media.d.ts.map +1 -1
  766. package/build-types/focal-point-picker/stories/index.story.d.ts +8 -8
  767. package/build-types/focal-point-picker/stories/index.story.d.ts.map +1 -1
  768. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts +9 -9
  769. package/build-types/focal-point-picker/styles/focal-point-picker-style.d.ts.map +1 -1
  770. package/build-types/focal-point-picker/styles/focal-point-style.d.ts +1 -1
  771. package/build-types/focal-point-picker/test/index.d.ts +2 -0
  772. package/build-types/focal-point-picker/test/index.d.ts.map +1 -0
  773. package/build-types/focal-point-picker/test/media.d.ts +2 -0
  774. package/build-types/focal-point-picker/test/media.d.ts.map +1 -0
  775. package/build-types/focal-point-picker/utils.d.ts.map +1 -1
  776. package/build-types/focusable-iframe/index.d.ts +1 -1
  777. package/build-types/focusable-iframe/index.d.ts.map +1 -1
  778. package/build-types/font-size-picker/font-size-picker-select.d.ts +1 -1
  779. package/build-types/font-size-picker/font-size-picker-select.d.ts.map +1 -1
  780. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts +1 -1
  781. package/build-types/font-size-picker/font-size-picker-toggle-group.d.ts.map +1 -1
  782. package/build-types/font-size-picker/index.d.ts.map +1 -1
  783. package/build-types/font-size-picker/stories/index.story.d.ts.map +1 -1
  784. package/build-types/font-size-picker/styles.d.ts +4 -4
  785. package/build-types/font-size-picker/types.d.ts +2 -0
  786. package/build-types/font-size-picker/types.d.ts.map +1 -1
  787. package/build-types/form-file-upload/index.d.ts +1 -1
  788. package/build-types/form-file-upload/index.d.ts.map +1 -1
  789. package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
  790. package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
  791. package/build-types/form-toggle/index.d.ts +2 -2
  792. package/build-types/form-toggle/index.d.ts.map +1 -1
  793. package/build-types/form-token-field/index.d.ts +1 -1
  794. package/build-types/form-token-field/index.d.ts.map +1 -1
  795. package/build-types/form-token-field/styles.d.ts +1 -1
  796. package/build-types/form-token-field/suggestions-list.d.ts +2 -1
  797. package/build-types/form-token-field/suggestions-list.d.ts.map +1 -1
  798. package/build-types/form-token-field/token-input.d.ts +2 -2
  799. package/build-types/form-token-field/token-input.d.ts.map +1 -1
  800. package/build-types/form-token-field/token.d.ts +1 -1
  801. package/build-types/form-token-field/token.d.ts.map +1 -1
  802. package/build-types/gradient-picker/index.d.ts +1 -1
  803. package/build-types/gradient-picker/index.d.ts.map +1 -1
  804. package/build-types/grid/hook.d.ts +69 -59
  805. package/build-types/grid/hook.d.ts.map +1 -1
  806. package/build-types/guide/icons.d.ts +1 -1
  807. package/build-types/guide/icons.d.ts.map +1 -1
  808. package/build-types/guide/index.d.ts +1 -1
  809. package/build-types/guide/index.d.ts.map +1 -1
  810. package/build-types/guide/page-control.d.ts +1 -1
  811. package/build-types/guide/page-control.d.ts.map +1 -1
  812. package/build-types/guide/page.d.ts +1 -1
  813. package/build-types/guide/page.d.ts.map +1 -1
  814. package/build-types/h-stack/hook.d.ts +69 -59
  815. package/build-types/h-stack/hook.d.ts.map +1 -1
  816. package/build-types/heading/hook.d.ts +69 -59
  817. package/build-types/heading/hook.d.ts.map +1 -1
  818. package/build-types/higher-order/navigate-regions/index.d.ts +1 -1
  819. package/build-types/higher-order/with-constrained-tabbing/index.d.ts +1 -1
  820. package/build-types/higher-order/with-constrained-tabbing/index.d.ts.map +1 -1
  821. package/build-types/higher-order/with-fallback-styles/index.d.ts +1 -1
  822. package/build-types/higher-order/with-filters/index.d.ts +2 -2
  823. package/build-types/higher-order/with-focus-outside/index.d.ts +1 -1
  824. package/build-types/higher-order/with-notices/index.d.ts +2 -2
  825. package/build-types/higher-order/with-spoken-messages/index.d.ts +1 -1
  826. package/build-types/icon/index.d.ts +1 -1
  827. package/build-types/icon/index.d.ts.map +1 -1
  828. package/build-types/input-control/backdrop.d.ts +1 -1
  829. package/build-types/input-control/backdrop.d.ts.map +1 -1
  830. package/build-types/input-control/index.d.ts +1 -1
  831. package/build-types/input-control/index.d.ts.map +1 -1
  832. package/build-types/input-control/input-base.d.ts +1 -1
  833. package/build-types/input-control/input-base.d.ts.map +1 -1
  834. package/build-types/input-control/input-field.d.ts +1 -1
  835. package/build-types/input-control/input-field.d.ts.map +1 -1
  836. package/build-types/input-control/label.d.ts +1 -1
  837. package/build-types/input-control/label.d.ts.map +1 -1
  838. package/build-types/input-control/stories/index.story.d.ts +2 -1
  839. package/build-types/input-control/stories/index.story.d.ts.map +1 -1
  840. package/build-types/input-control/styles/input-control-styles.d.ts +8 -8
  841. package/build-types/input-control/styles/input-control-styles.d.ts.map +1 -1
  842. package/build-types/input-control/utils.d.ts.map +1 -1
  843. package/build-types/isolated-event-container/index.d.ts +1 -1
  844. package/build-types/isolated-event-container/index.d.ts.map +1 -1
  845. package/build-types/item-group/item/hook.d.ts +70 -60
  846. package/build-types/item-group/item/hook.d.ts.map +1 -1
  847. package/build-types/item-group/item-group/hook.d.ts +69 -59
  848. package/build-types/item-group/item-group/hook.d.ts.map +1 -1
  849. package/build-types/keyboard-shortcuts/index.d.ts +1 -1
  850. package/build-types/keyboard-shortcuts/index.d.ts.map +1 -1
  851. package/build-types/menu-group/index.d.ts +1 -1
  852. package/build-types/menu-group/index.d.ts.map +1 -1
  853. package/build-types/menu-item/index.d.ts +1 -1
  854. package/build-types/menu-item/index.d.ts.map +1 -1
  855. package/build-types/menu-item/stories/index.story.d.ts +4 -4
  856. package/build-types/menu-item/stories/index.story.d.ts.map +1 -1
  857. package/build-types/menu-items-choice/index.d.ts +1 -1
  858. package/build-types/menu-items-choice/index.d.ts.map +1 -1
  859. package/build-types/modal/aria-helper.d.ts.map +1 -1
  860. package/build-types/modal/index.d.ts.map +1 -1
  861. package/build-types/navigable-container/container.d.ts +1 -1
  862. package/build-types/navigable-container/menu.d.ts +2 -2
  863. package/build-types/navigable-container/menu.d.ts.map +1 -1
  864. package/build-types/navigable-container/tabbable.d.ts +2 -2
  865. package/build-types/navigable-container/tabbable.d.ts.map +1 -1
  866. package/build-types/navigation/back-button/index.d.ts.map +1 -1
  867. package/build-types/navigation/group/index.d.ts +1 -1
  868. package/build-types/navigation/group/index.d.ts.map +1 -1
  869. package/build-types/navigation/index.d.ts +1 -1
  870. package/build-types/navigation/index.d.ts.map +1 -1
  871. package/build-types/navigation/item/base-content.d.ts +1 -1
  872. package/build-types/navigation/item/base-content.d.ts.map +1 -1
  873. package/build-types/navigation/item/base.d.ts +1 -1
  874. package/build-types/navigation/item/base.d.ts.map +1 -1
  875. package/build-types/navigation/item/index.d.ts +1 -1
  876. package/build-types/navigation/item/index.d.ts.map +1 -1
  877. package/build-types/navigation/menu/index.d.ts +1 -1
  878. package/build-types/navigation/menu/index.d.ts.map +1 -1
  879. package/build-types/navigation/menu/menu-title-search.d.ts +1 -1
  880. package/build-types/navigation/menu/menu-title.d.ts +1 -1
  881. package/build-types/navigation/menu/menu-title.d.ts.map +1 -1
  882. package/build-types/navigation/menu/search-no-results-found.d.ts +1 -1
  883. package/build-types/navigation/menu/search-no-results-found.d.ts.map +1 -1
  884. package/build-types/navigation/styles/navigation-styles.d.ts +11 -11
  885. package/build-types/navigation/styles/navigation-styles.d.ts.map +1 -1
  886. package/build-types/navigator/navigator-back-button/hook.d.ts +70 -61
  887. package/build-types/navigator/navigator-back-button/hook.d.ts.map +1 -1
  888. package/build-types/navigator/navigator-button/hook.d.ts +70 -61
  889. package/build-types/navigator/navigator-button/hook.d.ts.map +1 -1
  890. package/build-types/notice/index.d.ts +1 -1
  891. package/build-types/notice/index.d.ts.map +1 -1
  892. package/build-types/notice/list.d.ts +1 -1
  893. package/build-types/notice/list.d.ts.map +1 -1
  894. package/build-types/number-control/index.d.ts +1 -1
  895. package/build-types/number-control/index.d.ts.map +1 -1
  896. package/build-types/number-control/stories/index.story.d.ts +1 -1
  897. package/build-types/number-control/stories/index.story.d.ts.map +1 -1
  898. package/build-types/palette-edit/index.d.ts +1 -1
  899. package/build-types/palette-edit/index.d.ts.map +1 -1
  900. package/build-types/palette-edit/styles.d.ts +1009 -19
  901. package/build-types/palette-edit/styles.d.ts.map +1 -1
  902. package/build-types/panel/body.d.ts +1 -1
  903. package/build-types/panel/body.d.ts.map +1 -1
  904. package/build-types/panel/header.d.ts +1 -1
  905. package/build-types/panel/header.d.ts.map +1 -1
  906. package/build-types/placeholder/index.d.ts +1 -1
  907. package/build-types/placeholder/index.d.ts.map +1 -1
  908. package/build-types/popover/index.d.ts +1 -1
  909. package/build-types/popover/index.d.ts.map +1 -1
  910. package/build-types/popover/overlay-middlewares.d.ts.map +1 -1
  911. package/build-types/popover/stories/e2e/index.story.d.ts +2 -2
  912. package/build-types/popover/stories/e2e/index.story.d.ts.map +1 -1
  913. package/build-types/popover/stories/index.story.d.ts.map +1 -1
  914. package/build-types/popover/test/utils/index.d.ts +1 -1
  915. package/build-types/popover/test/utils/index.d.ts.map +1 -1
  916. package/build-types/progress-bar/index.d.ts +1 -1
  917. package/build-types/progress-bar/index.d.ts.map +1 -1
  918. package/build-types/progress-bar/styles.d.ts +3 -3
  919. package/build-types/query-controls/author-select.d.ts +1 -1
  920. package/build-types/query-controls/author-select.d.ts.map +1 -1
  921. package/build-types/query-controls/category-select.d.ts +1 -1
  922. package/build-types/query-controls/category-select.d.ts.map +1 -1
  923. package/build-types/query-controls/index.d.ts +1 -1
  924. package/build-types/query-controls/index.d.ts.map +1 -1
  925. package/build-types/radio-control/index.d.ts +1 -1
  926. package/build-types/radio-control/index.d.ts.map +1 -1
  927. package/build-types/radio-group/index.d.ts +1 -1
  928. package/build-types/radio-group/index.d.ts.map +1 -1
  929. package/build-types/radio-group/radio.d.ts +1 -1
  930. package/build-types/radio-group/radio.d.ts.map +1 -1
  931. package/build-types/range-control/index.d.ts +1 -1
  932. package/build-types/range-control/index.d.ts.map +1 -1
  933. package/build-types/range-control/input-range.d.ts +1 -1
  934. package/build-types/range-control/mark.d.ts +1 -1
  935. package/build-types/range-control/mark.d.ts.map +1 -1
  936. package/build-types/range-control/rail.d.ts +1 -1
  937. package/build-types/range-control/rail.d.ts.map +1 -1
  938. package/build-types/range-control/styles/range-control-styles.d.ts +15 -15
  939. package/build-types/range-control/styles/range-control-styles.d.ts.map +1 -1
  940. package/build-types/range-control/tooltip.d.ts +1 -1
  941. package/build-types/range-control/tooltip.d.ts.map +1 -1
  942. package/build-types/resizable-box/index.d.ts +3 -3
  943. package/build-types/resizable-box/resize-tooltip/index.d.ts +1 -1
  944. package/build-types/resizable-box/resize-tooltip/index.d.ts.map +1 -1
  945. package/build-types/resizable-box/resize-tooltip/label.d.ts +1 -1
  946. package/build-types/resizable-box/resize-tooltip/label.d.ts.map +1 -1
  947. package/build-types/resizable-box/resize-tooltip/styles/resize-tooltip.styles.d.ts +4 -4
  948. package/build-types/resizable-box/resize-tooltip/utils.d.ts.map +1 -1
  949. package/build-types/resizable-box/stories/index.story.d.ts +6 -6
  950. package/build-types/responsive-wrapper/index.d.ts +1 -1
  951. package/build-types/responsive-wrapper/index.d.ts.map +1 -1
  952. package/build-types/sandbox/index.d.ts +1 -1
  953. package/build-types/sandbox/index.d.ts.map +1 -1
  954. package/build-types/scrollable/hook.d.ts +69 -59
  955. package/build-types/scrollable/hook.d.ts.map +1 -1
  956. package/build-types/search-control/index.d.ts.map +1 -1
  957. package/build-types/search-control/styles.d.ts +1 -1
  958. package/build-types/select-control/chevron-down.d.ts +1 -1
  959. package/build-types/select-control/chevron-down.d.ts.map +1 -1
  960. package/build-types/select-control/index.d.ts.map +1 -1
  961. package/build-types/select-control/styles/select-control-styles.d.ts +3 -3
  962. package/build-types/select-control/styles/select-control-styles.d.ts.map +1 -1
  963. package/build-types/shortcut/index.d.ts +1 -1
  964. package/build-types/shortcut/index.d.ts.map +1 -1
  965. package/build-types/slot-fill/bubbles-virtually/slot-fill-context.d.ts.map +1 -1
  966. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts +1 -1
  967. package/build-types/slot-fill/bubbles-virtually/slot-fill-provider.d.ts.map +1 -1
  968. package/build-types/slot-fill/bubbles-virtually/slot.d.ts +1 -1
  969. package/build-types/slot-fill/bubbles-virtually/use-slot-fills.d.ts.map +1 -1
  970. package/build-types/slot-fill/bubbles-virtually/use-slot.d.ts.map +1 -1
  971. package/build-types/slot-fill/index.d.ts +7 -7
  972. package/build-types/slot-fill/index.d.ts.map +1 -1
  973. package/build-types/slot-fill/provider.d.ts +1 -1
  974. package/build-types/slot-fill/provider.d.ts.map +1 -1
  975. package/build-types/slot-fill/slot.d.ts +1 -1
  976. package/build-types/slot-fill/slot.d.ts.map +1 -1
  977. package/build-types/slot-fill/types.d.ts +2 -2
  978. package/build-types/slot-fill/types.d.ts.map +1 -1
  979. package/build-types/snackbar/index.d.ts +2 -2
  980. package/build-types/snackbar/index.d.ts.map +1 -1
  981. package/build-types/snackbar/list.d.ts +1 -1
  982. package/build-types/snackbar/list.d.ts.map +1 -1
  983. package/build-types/spacer/hook.d.ts +69 -59
  984. package/build-types/spacer/hook.d.ts.map +1 -1
  985. package/build-types/spinner/index.d.ts +2 -2
  986. package/build-types/spinner/index.d.ts.map +1 -1
  987. package/build-types/spinner/styles.d.ts +3 -3
  988. package/build-types/style-provider/index.d.ts +1 -1
  989. package/build-types/style-provider/index.d.ts.map +1 -1
  990. package/build-types/surface/hook.d.ts +69 -59
  991. package/build-types/surface/hook.d.ts.map +1 -1
  992. package/build-types/tab-panel/index.d.ts +1 -1
  993. package/build-types/tab-panel/index.d.ts.map +1 -1
  994. package/build-types/tab-panel/stories/index.story.d.ts +4 -4
  995. package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
  996. package/build-types/tabs/index.d.ts +2 -2
  997. package/build-types/tabs/index.d.ts.map +1 -1
  998. package/build-types/tabs/styles.d.ts +3 -3
  999. package/build-types/tabs/tablist.d.ts +1 -1
  1000. package/build-types/tabs/tablist.d.ts.map +1 -1
  1001. package/build-types/text/get-line-height.d.ts.map +1 -1
  1002. package/build-types/text/hook.d.ts +68 -59
  1003. package/build-types/text/hook.d.ts.map +1 -1
  1004. package/build-types/text/stories/index.story.d.ts +3 -3
  1005. package/build-types/text/utils.d.ts.map +1 -1
  1006. package/build-types/text-control/index.d.ts +3 -3
  1007. package/build-types/text-control/index.d.ts.map +1 -1
  1008. package/build-types/text-highlight/index.d.ts +1 -1
  1009. package/build-types/text-highlight/index.d.ts.map +1 -1
  1010. package/build-types/textarea-control/index.d.ts +2 -2
  1011. package/build-types/textarea-control/index.d.ts.map +1 -1
  1012. package/build-types/textarea-control/styles/textarea-control-styles.d.ts +1 -1
  1013. package/build-types/theme/color-algorithms.d.ts.map +1 -1
  1014. package/build-types/theme/index.d.ts +1 -1
  1015. package/build-types/theme/index.d.ts.map +1 -1
  1016. package/build-types/theme/stories/index.story.d.ts +1 -1
  1017. package/build-types/theme/styles.d.ts +1 -1
  1018. package/build-types/tip/index.d.ts +1 -1
  1019. package/build-types/tip/index.d.ts.map +1 -1
  1020. package/build-types/toggle-control/index.d.ts +2 -2
  1021. package/build-types/toggle-control/index.d.ts.map +1 -1
  1022. package/build-types/toggle-control/stories/index.story.d.ts +2 -2
  1023. package/build-types/toggle-control/stories/index.story.d.ts.map +1 -1
  1024. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts +1 -1
  1025. package/build-types/toggle-group-control/toggle-group-control/as-button-group.d.ts.map +1 -1
  1026. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts +1 -1
  1027. package/build-types/toggle-group-control/toggle-group-control/as-radio-group.d.ts.map +1 -1
  1028. package/build-types/toggle-group-control/toggle-group-control/styles.d.ts +1 -1
  1029. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts +1 -1
  1030. package/build-types/toggle-group-control/toggle-group-control-option/component.d.ts.map +1 -1
  1031. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts +1 -1
  1032. package/build-types/toggle-group-control/toggle-group-control-option-base/component.d.ts.map +1 -1
  1033. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts +2 -2
  1034. package/build-types/toggle-group-control/toggle-group-control-option-base/styles.d.ts.map +1 -1
  1035. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts +1 -1
  1036. package/build-types/toggle-group-control/toggle-group-control-option-icon/component.d.ts.map +1 -1
  1037. package/build-types/toolbar/stories/index.story.d.ts +3 -3
  1038. package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
  1039. package/build-types/toolbar/toolbar/index.d.ts +1 -1
  1040. package/build-types/toolbar/toolbar/index.d.ts.map +1 -1
  1041. package/build-types/toolbar/toolbar/toolbar-container.d.ts +1 -1
  1042. package/build-types/toolbar/toolbar/toolbar-container.d.ts.map +1 -1
  1043. package/build-types/toolbar/toolbar-button/index.d.ts +5 -51
  1044. package/build-types/toolbar/toolbar-button/index.d.ts.map +1 -1
  1045. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts +1 -1
  1046. package/build-types/toolbar/toolbar-button/toolbar-button-container.d.ts.map +1 -1
  1047. package/build-types/toolbar/toolbar-group/index.d.ts +1 -1
  1048. package/build-types/toolbar/toolbar-group/index.d.ts.map +1 -1
  1049. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts +1 -1
  1050. package/build-types/toolbar/toolbar-group/toolbar-group-collapsed.d.ts.map +1 -1
  1051. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts +1 -1
  1052. package/build-types/toolbar/toolbar-group/toolbar-group-container.d.ts.map +1 -1
  1053. package/build-types/tools-panel/styles.d.ts +1 -1
  1054. package/build-types/tools-panel/tools-panel/hook.d.ts +71 -61
  1055. package/build-types/tools-panel/tools-panel/hook.d.ts.map +1 -1
  1056. package/build-types/tools-panel/tools-panel-header/hook.d.ts +70 -60
  1057. package/build-types/tools-panel/tools-panel-header/hook.d.ts.map +1 -1
  1058. package/build-types/tools-panel/tools-panel-item/hook.d.ts +69 -59
  1059. package/build-types/tools-panel/tools-panel-item/hook.d.ts.map +1 -1
  1060. package/build-types/tools-panel/types.d.ts +1 -1
  1061. package/build-types/tools-panel/types.d.ts.map +1 -1
  1062. package/build-types/tree-grid/index.d.ts +1 -1
  1063. package/build-types/tree-grid/index.d.ts.map +1 -1
  1064. package/build-types/tree-grid/item.d.ts +1 -1
  1065. package/build-types/tree-grid/item.d.ts.map +1 -1
  1066. package/build-types/tree-grid/roving-tab-index-item.d.ts +1 -1
  1067. package/build-types/tree-grid/roving-tab-index-item.d.ts.map +1 -1
  1068. package/build-types/tree-grid/roving-tab-index.d.ts +1 -1
  1069. package/build-types/tree-grid/roving-tab-index.d.ts.map +1 -1
  1070. package/build-types/tree-grid/row.d.ts +1 -1
  1071. package/build-types/tree-grid/row.d.ts.map +1 -1
  1072. package/build-types/tree-grid/stories/index.story.d.ts +1 -1
  1073. package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
  1074. package/build-types/tree-select/index.d.ts +1 -1
  1075. package/build-types/tree-select/index.d.ts.map +1 -1
  1076. package/build-types/truncate/hook.d.ts +69 -59
  1077. package/build-types/truncate/hook.d.ts.map +1 -1
  1078. package/build-types/unit-control/index.d.ts +1 -1
  1079. package/build-types/unit-control/index.d.ts.map +1 -1
  1080. package/build-types/unit-control/styles/unit-control-styles.d.ts +3 -3
  1081. package/build-types/unit-control/unit-select-control.d.ts +1 -1
  1082. package/build-types/utils/colors.d.ts.map +1 -1
  1083. package/build-types/utils/font-size.d.ts.map +1 -1
  1084. package/build-types/utils/get-valid-children.d.ts.map +1 -1
  1085. package/build-types/utils/input/base.d.ts.map +1 -1
  1086. package/build-types/utils/strings.d.ts.map +1 -1
  1087. package/build-types/utils/use-responsive-value.d.ts.map +1 -1
  1088. package/build-types/v-stack/hook.d.ts +69 -59
  1089. package/build-types/v-stack/hook.d.ts.map +1 -1
  1090. package/build-types/v-stack/stories/index.story.d.ts +1 -1
  1091. package/build-types/view/component.d.ts +255 -7
  1092. package/build-types/view/component.d.ts.map +1 -1
  1093. package/build-types/z-stack/styles.d.ts +2 -2
  1094. package/package.json +22 -22
  1095. package/src/alignment-matrix-control/icon.tsx +2 -2
  1096. package/src/alignment-matrix-control/index.tsx +5 -6
  1097. package/src/alignment-matrix-control/styles/alignment-matrix-control-styles.ts +4 -3
  1098. package/src/alignment-matrix-control/utils.tsx +6 -2
  1099. package/src/angle-picker-control/index.tsx +2 -2
  1100. package/src/animate/index.tsx +4 -7
  1101. package/src/autocomplete/autocompleter-ui.tsx +5 -3
  1102. package/src/autocomplete/index.tsx +21 -7
  1103. package/src/autocomplete/style.scss +10 -4
  1104. package/src/base-control/README.md +1 -1
  1105. package/src/base-control/hooks.ts +1 -5
  1106. package/src/base-control/index.tsx +2 -5
  1107. package/src/base-control/test/index.tsx +3 -3
  1108. package/src/base-control/types.ts +1 -2
  1109. package/src/border-control/types.ts +4 -0
  1110. package/src/box-control/test/index.tsx +22 -0
  1111. package/src/button/index.tsx +2 -2
  1112. package/src/button/style.scss +4 -6
  1113. package/src/button-group/index.tsx +2 -2
  1114. package/src/card/test/__snapshots__/index.tsx.snap +44 -47
  1115. package/src/checkbox-control/index.tsx +46 -37
  1116. package/src/checkbox-control/style.scss +12 -1
  1117. package/src/checkbox-control/test/__snapshots__/index.tsx.snap +27 -26
  1118. package/src/checkbox-control/test/index.tsx +5 -0
  1119. package/src/circular-option-picker/circular-option-picker-actions.tsx +3 -3
  1120. package/src/circular-option-picker/circular-option-picker-option-group.tsx +2 -2
  1121. package/src/circular-option-picker/circular-option-picker-option.tsx +2 -2
  1122. package/src/circular-option-picker/circular-option-picker.tsx +2 -5
  1123. package/src/circular-option-picker/style.scss +1 -2
  1124. package/src/clipboard-button/index.tsx +2 -2
  1125. package/src/color-indicator/index.tsx +2 -2
  1126. package/src/color-palette/index.tsx +2 -2
  1127. package/src/color-picker/hex-input.tsx +3 -1
  1128. package/src/color-picker/hue-picker.native.js +6 -2
  1129. package/src/color-picker/index.native.js +9 -3
  1130. package/src/color-picker/saturation-picker.native.js +6 -2
  1131. package/src/color-picker/use-deprecated-props.ts +9 -3
  1132. package/src/combobox-control/README.md +1 -1
  1133. package/src/combobox-control/index.tsx +8 -5
  1134. package/src/combobox-control/stories/index.story.tsx +28 -0
  1135. package/src/combobox-control/types.ts +1 -0
  1136. package/src/context/context-connect.ts +6 -2
  1137. package/src/custom-gradient-picker/gradient-bar/control-points.tsx +3 -3
  1138. package/src/custom-gradient-picker/gradient-bar/index.tsx +2 -2
  1139. package/src/custom-gradient-picker/index.tsx +2 -2
  1140. package/src/custom-select-control/index.js +3 -6
  1141. package/src/custom-select-control-v2/README.md +0 -4
  1142. package/src/custom-select-control-v2/legacy-component/index.tsx +3 -1
  1143. package/src/custom-select-control-v2/stories/default.story.tsx +1 -1
  1144. package/src/custom-select-control-v2/stories/legacy.story.tsx +1 -1
  1145. package/src/dimension-control/index.tsx +2 -5
  1146. package/src/drop-zone/index.tsx +68 -68
  1147. package/src/dropdown/index.tsx +2 -2
  1148. package/src/dropdown/styles.ts +3 -1
  1149. package/src/dropdown-menu/index.native.js +6 -12
  1150. package/src/dropdown-menu/index.tsx +9 -16
  1151. package/src/duotone-picker/utils.ts +3 -1
  1152. package/src/elevation/hook.ts +6 -3
  1153. package/src/elevation/test/__snapshots__/index.tsx.snap +18 -24
  1154. package/src/external-link/index.tsx +2 -2
  1155. package/src/flex/test/__snapshots__/index.tsx.snap +4 -4
  1156. package/src/focal-point-picker/controls.tsx +3 -1
  1157. package/src/focal-point-picker/focal-point.tsx +2 -4
  1158. package/src/focal-point-picker/index.tsx +22 -12
  1159. package/src/focal-point-picker/styles/focal-point-picker-style.ts +4 -3
  1160. package/src/focal-point-picker/test/{index.js → index.tsx} +44 -17
  1161. package/src/focal-point-picker/test/{media.js → media.tsx} +18 -13
  1162. package/src/focal-point-picker/tooltip/index.native.js +1 -7
  1163. package/src/focal-point-picker/utils.ts +3 -1
  1164. package/src/font-size-picker/README.md +1 -0
  1165. package/src/font-size-picker/index.tsx +4 -2
  1166. package/src/font-size-picker/stories/index.story.tsx +0 -1
  1167. package/src/font-size-picker/types.ts +2 -0
  1168. package/src/form-toggle/index.tsx +2 -2
  1169. package/src/form-token-field/index.tsx +10 -8
  1170. package/src/form-token-field/style.scss +9 -0
  1171. package/src/form-token-field/suggestions-list.tsx +16 -10
  1172. package/src/form-token-field/token-input.tsx +2 -2
  1173. package/src/form-token-field/token.tsx +2 -2
  1174. package/src/guide/index.tsx +2 -2
  1175. package/src/higher-order/navigate-regions/style.scss +3 -3
  1176. package/src/input-control/index.tsx +3 -6
  1177. package/src/input-control/input-field.tsx +3 -1
  1178. package/src/input-control/label.tsx +3 -1
  1179. package/src/input-control/stories/index.story.tsx +31 -1
  1180. package/src/input-control/styles/input-control-styles.tsx +12 -4
  1181. package/src/input-control/test/index.js +10 -6
  1182. package/src/input-control/utils.ts +3 -2
  1183. package/src/item-group/item/hook.ts +1 -10
  1184. package/src/item-group/test/__snapshots__/index.js.snap +16 -16
  1185. package/src/menu-group/index.tsx +2 -2
  1186. package/src/menu-item/index.tsx +3 -3
  1187. package/src/mobile/color-settings/utils.native.js +1 -1
  1188. package/src/mobile/gradient/index.native.js +3 -1
  1189. package/src/mobile/keyboard-aware-flat-list/index.android.js +11 -2
  1190. package/src/mobile/keyboard-aware-flat-list/index.ios.js +30 -19
  1191. package/src/mobile/keyboard-aware-flat-list/shared.native.js +26 -0
  1192. package/src/mobile/keyboard-aware-flat-list/styles.native.scss +8 -0
  1193. package/src/modal/aria-helper.ts +8 -3
  1194. package/src/modal/index.tsx +10 -6
  1195. package/src/modal/test/index.tsx +11 -4
  1196. package/src/navigation/back-button/index.tsx +2 -5
  1197. package/src/navigation/group/index.tsx +2 -2
  1198. package/src/navigation/index.tsx +3 -3
  1199. package/src/navigation/item/base.tsx +2 -2
  1200. package/src/navigation/item/index.tsx +2 -2
  1201. package/src/navigation/menu/index.tsx +2 -2
  1202. package/src/navigation/styles/navigation-styles.tsx +4 -3
  1203. package/src/notice/index.tsx +5 -10
  1204. package/src/notice/list.tsx +2 -2
  1205. package/src/number-control/index.tsx +2 -2
  1206. package/src/palette-edit/index.tsx +10 -8
  1207. package/src/palette-edit/styles.ts +2 -3
  1208. package/src/panel/body.tsx +5 -3
  1209. package/src/panel/index.tsx +2 -2
  1210. package/src/panel/row.tsx +2 -2
  1211. package/src/panel/style.scss +1 -0
  1212. package/src/placeholder/index.tsx +3 -3
  1213. package/src/placeholder/style.scss +12 -35
  1214. package/src/popover/index.tsx +4 -3
  1215. package/src/popover/overlay-middlewares.tsx +3 -1
  1216. package/src/popover/stories/index.story.tsx +0 -2
  1217. package/src/query-controls/author-select.tsx +3 -1
  1218. package/src/radio-control/index.tsx +2 -2
  1219. package/src/range-control/index.tsx +3 -3
  1220. package/src/range-control/mark.tsx +3 -3
  1221. package/src/range-control/rail.tsx +1 -1
  1222. package/src/range-control/styles/range-control-styles.ts +5 -3
  1223. package/src/range-control/tooltip.tsx +2 -2
  1224. package/src/resizable-box/index.tsx +10 -10
  1225. package/src/resizable-box/resize-tooltip/index.tsx +5 -3
  1226. package/src/resizable-box/resize-tooltip/label.tsx +3 -1
  1227. package/src/resizable-box/resize-tooltip/utils.ts +12 -4
  1228. package/src/responsive-wrapper/index.tsx +2 -2
  1229. package/src/search-control/index.tsx +2 -5
  1230. package/src/select-control/index.tsx +5 -3
  1231. package/src/select-control/styles/select-control-styles.ts +3 -1
  1232. package/src/slot-fill/bubbles-virtually/slot-fill-context.ts +2 -1
  1233. package/src/slot-fill/bubbles-virtually/slot-fill-provider.tsx +1 -1
  1234. package/src/slot-fill/bubbles-virtually/use-slot-fills.ts +1 -1
  1235. package/src/slot-fill/bubbles-virtually/use-slot.ts +1 -1
  1236. package/src/slot-fill/types.ts +2 -2
  1237. package/src/snackbar/index.tsx +5 -8
  1238. package/src/snackbar/list.tsx +2 -2
  1239. package/src/spinner/index.tsx +2 -2
  1240. package/src/surface/test/__snapshots__/index.tsx.snap +10 -10
  1241. package/src/tab-panel/index.tsx +2 -2
  1242. package/src/text/get-line-height.ts +6 -2
  1243. package/src/text/utils.ts +6 -2
  1244. package/src/text-control/index.tsx +2 -2
  1245. package/src/theme/color-algorithms.ts +6 -2
  1246. package/src/theme/stories/index.story.tsx +1 -1
  1247. package/src/toggle-group-control/test/__snapshots__/index.tsx.snap +18 -26
  1248. package/src/toggle-group-control/toggle-group-control-option-base/component.tsx +3 -1
  1249. package/src/toggle-group-control/toggle-group-control-option-base/styles.ts +7 -6
  1250. package/src/toolbar/toolbar/index.tsx +2 -2
  1251. package/src/toolbar/toolbar/style.scss +2 -14
  1252. package/src/toolbar/toolbar-button/index.tsx +3 -3
  1253. package/src/toolbar/toolbar-group/index.tsx +2 -2
  1254. package/src/tools-panel/tools-panel/hook.ts +9 -6
  1255. package/src/tools-panel/tools-panel-item/hook.ts +12 -8
  1256. package/src/tools-panel/types.ts +1 -0
  1257. package/src/tree-grid/roving-tab-index-item.tsx +3 -1
  1258. package/src/truncate/hook.ts +1 -1
  1259. package/src/unit-control/index.tsx +7 -3
  1260. package/src/unit-control/unit-select-control.tsx +2 -2
  1261. package/src/utils/colors.js +21 -7
  1262. package/src/utils/font-size.ts +3 -1
  1263. package/src/utils/get-valid-children.ts +3 -1
  1264. package/src/utils/input/base.js +4 -3
  1265. package/src/utils/strings.ts +11 -59
  1266. package/src/utils/test/strings.js +62 -0
  1267. package/src/utils/theme-variables.scss +4 -0
  1268. package/src/utils/use-responsive-value.ts +2 -1
  1269. package/src/view/component.tsx +18 -11
  1270. package/tsconfig.json +1 -2
  1271. package/tsconfig.tsbuildinfo +1 -1
  1272. package/build/slot-fill/bubbles-virtually/observable-map.js +0 -68
  1273. package/build/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
  1274. package/build/view/types.js +0 -6
  1275. package/build/view/types.js.map +0 -1
  1276. package/build-module/slot-fill/bubbles-virtually/observable-map.js +0 -60
  1277. package/build-module/slot-fill/bubbles-virtually/observable-map.js.map +0 -1
  1278. package/build-module/view/types.js +0 -2
  1279. package/build-module/view/types.js.map +0 -1
  1280. package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts +0 -19
  1281. package/build-types/slot-fill/bubbles-virtually/observable-map.d.ts.map +0 -1
  1282. package/build-types/view/types.d.ts +0 -8
  1283. package/build-types/view/types.d.ts.map +0 -1
  1284. package/src/slot-fill/bubbles-virtually/observable-map.ts +0 -79
  1285. package/src/slot-fill/test/observable-map.js +0 -83
  1286. package/src/utils/hooks/stories/use-cx.js +0 -157
  1287. package/src/view/types.ts +0 -6
@@ -1 +1 @@
1
- {"version":3,"names":["__","settings","useState","useMemo","forwardRef","Button","RangeControl","Flex","FlexItem","default","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits","VisuallyHidden","getCommonSizeUnit","Container","Header","HeaderHint","HeaderLabel","HeaderToggle","Spacer","FontSizePickerSelect","FontSizePickerToggleGroup","T_SHIRT_NAMES","UnforwardedFontSizePicker","props","ref","__next40pxDefaultSize","fallbackFontSize","fontSizes","disableCustomFontSizes","onChange","size","units","unitsProp","value","withSlider","withReset","availableUnits","shouldUseSelectControl","length","selectedFontSize","find","fontSize","isCustomValue","showCustomValueControl","setShowCustomValueControl","headerHint","name","indexOf","commonUnit","hasUnits","valueQuantity","valueUnit","isValueUnitRelative","includes","isDisabled","undefined","createElement","className","as","label","icon","onClick","isPressed","newValue","Number","onSelectCustom","isBlock","labelPosition","hideLabelFromVision","parseInt","min","marginX","marginBottom","__nextHasNoMarginBottom","initialPosition","withInputField","max","step","disabled","__experimentalIsFocusable","variant","FontSizePicker"],"sources":["@wordpress/components/src/font-size-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\nimport { useState, useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Button } from '../button';\nimport RangeControl from '../range-control';\nimport { Flex, FlexItem } from '../flex';\nimport {\n\tdefault as UnitControl,\n\tparseQuantityAndUnitFromRawValue,\n\tuseCustomUnits,\n} from '../unit-control';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { getCommonSizeUnit } from './utils';\nimport type { FontSizePickerProps } from './types';\nimport {\n\tContainer,\n\tHeader,\n\tHeaderHint,\n\tHeaderLabel,\n\tHeaderToggle,\n} from './styles';\nimport { Spacer } from '../spacer';\nimport FontSizePickerSelect from './font-size-picker-select';\nimport FontSizePickerToggleGroup from './font-size-picker-toggle-group';\nimport { T_SHIRT_NAMES } from './constants';\n\nconst UnforwardedFontSizePicker = (\n\tprops: FontSizePickerProps,\n\tref: ForwardedRef< any >\n) => {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\tfallbackFontSize,\n\t\tfontSizes = [],\n\t\tdisableCustomFontSizes = false,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tunits: unitsProp,\n\t\tvalue,\n\t\twithSlider = false,\n\t\twithReset = true,\n\t} = props;\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: unitsProp || [ 'px', 'em', 'rem' ],\n\t} );\n\n\tconst shouldUseSelectControl = fontSizes.length > 5;\n\tconst selectedFontSize = fontSizes.find(\n\t\t( fontSize ) => fontSize.size === value\n\t);\n\tconst isCustomValue = !! value && ! selectedFontSize;\n\n\tconst [ showCustomValueControl, setShowCustomValueControl ] = useState(\n\t\t! disableCustomFontSizes && isCustomValue\n\t);\n\n\tconst headerHint = useMemo( () => {\n\t\tif ( showCustomValueControl ) {\n\t\t\treturn __( 'Custom' );\n\t\t}\n\n\t\tif ( ! shouldUseSelectControl ) {\n\t\t\tif ( selectedFontSize ) {\n\t\t\t\treturn (\n\t\t\t\t\tselectedFontSize.name ||\n\t\t\t\t\tT_SHIRT_NAMES[ fontSizes.indexOf( selectedFontSize ) ]\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\tconst commonUnit = getCommonSizeUnit( fontSizes );\n\t\tif ( commonUnit ) {\n\t\t\treturn `(${ commonUnit })`;\n\t\t}\n\n\t\treturn '';\n\t}, [\n\t\tshowCustomValueControl,\n\t\tshouldUseSelectControl,\n\t\tselectedFontSize,\n\t\tfontSizes,\n\t] );\n\n\tif ( fontSizes.length === 0 && disableCustomFontSizes ) {\n\t\treturn null;\n\t}\n\n\t// If neither the value or first font size is a string, then FontSizePicker\n\t// operates in a legacy \"unitless\" mode where UnitControl can only be used\n\t// to select px values and onChange() is always called with number values.\n\tconst hasUnits =\n\t\ttypeof value === 'string' || typeof fontSizes[ 0 ]?.size === 'string';\n\n\tconst [ valueQuantity, valueUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tvalue,\n\t\tunits\n\t);\n\tconst isValueUnitRelative =\n\t\t!! valueUnit && [ 'em', 'rem' ].includes( valueUnit );\n\tconst isDisabled = value === undefined;\n\n\treturn (\n\t\t<Container ref={ ref } className=\"components-font-size-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Font size' ) }</VisuallyHidden>\n\t\t\t<Spacer>\n\t\t\t\t<Header className=\"components-font-size-picker__header\">\n\t\t\t\t\t<HeaderLabel\n\t\t\t\t\t\taria-label={ `${ __( 'Size' ) } ${ headerHint || '' }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Size' ) }\n\t\t\t\t\t\t{ headerHint && (\n\t\t\t\t\t\t\t<HeaderHint className=\"components-font-size-picker__header__hint\">\n\t\t\t\t\t\t\t\t{ headerHint }\n\t\t\t\t\t\t\t</HeaderHint>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HeaderLabel>\n\t\t\t\t\t{ ! disableCustomFontSizes && (\n\t\t\t\t\t\t<HeaderToggle\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tshowCustomValueControl\n\t\t\t\t\t\t\t\t\t? __( 'Use size preset' )\n\t\t\t\t\t\t\t\t\t: __( 'Set custom size' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ settings }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetShowCustomValueControl(\n\t\t\t\t\t\t\t\t\t! showCustomValueControl\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisPressed={ showCustomValueControl }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Header>\n\t\t\t</Spacer>\n\t\t\t<div>\n\t\t\t\t{ !! fontSizes.length &&\n\t\t\t\t\tshouldUseSelectControl &&\n\t\t\t\t\t! showCustomValueControl && (\n\t\t\t\t\t\t<FontSizePickerSelect\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t: Number( newValue ),\n\t\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonSelectCustom={ () =>\n\t\t\t\t\t\t\t\tsetShowCustomValueControl( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t{ ! shouldUseSelectControl && ! showCustomValueControl && (\n\t\t\t\t\t<FontSizePickerToggleGroup\n\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\thasUnits ? newValue : Number( newValue ),\n\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! disableCustomFontSizes && showCustomValueControl && (\n\t\t\t\t\t<Flex className=\"components-font-size-picker__custom-size-control\">\n\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t\t: parseInt( newValue, 10 )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\tunits={ hasUnits ? units : [] }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t{ withSlider && (\n\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t<Spacer marginX={ 2 } marginBottom={ 0 }>\n\t\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize={\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tclassName=\"components-font-size-picker__custom-input\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom Size' ) }\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tvalue={ valueQuantity }\n\t\t\t\t\t\t\t\t\t\tinitialPosition={ fallbackFontSize }\n\t\t\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t\t\t} else if ( hasUnits ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewValue +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( valueUnit ?? 'px' )\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( newValue );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tmax={ isValueUnitRelative ? 10 : 100 }\n\t\t\t\t\t\t\t\t\t\tstep={ isValueUnitRelative ? 0.1 : 1 }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ withReset && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\t\t\tsize === '__unstable-large' ||\n\t\t\t\t\t\t\t\t\t\tprops.__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t: 'small'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Flex>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</Container>\n\t);\n};\n\nexport const FontSizePicker = forwardRef( UnforwardedFontSizePicker );\n\nexport default FontSizePicker;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SAASC,QAAQ,EAAEC,OAAO,EAAEC,UAAU,QAAQ,oBAAoB;;AAElE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,YAAY,MA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,UAAU,CAAEoB,yBAA0B,CAAC;AAErE,eAAe2D,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["__","settings","useState","useMemo","forwardRef","Button","RangeControl","Flex","FlexItem","default","UnitControl","parseQuantityAndUnitFromRawValue","useCustomUnits","VisuallyHidden","getCommonSizeUnit","Container","Header","HeaderHint","HeaderLabel","HeaderToggle","Spacer","FontSizePickerSelect","FontSizePickerToggleGroup","T_SHIRT_NAMES","DEFAULT_UNITS","UnforwardedFontSizePicker","props","ref","__next40pxDefaultSize","fallbackFontSize","fontSizes","disableCustomFontSizes","onChange","size","units","unitsProp","value","withSlider","withReset","availableUnits","shouldUseSelectControl","length","selectedFontSize","find","fontSize","isCustomValue","showCustomValueControl","setShowCustomValueControl","headerHint","name","indexOf","commonUnit","hasUnits","valueQuantity","valueUnit","isValueUnitRelative","includes","isDisabled","undefined","createElement","className","as","label","icon","onClick","isPressed","newValue","Number","onSelectCustom","isBlock","labelPosition","hideLabelFromVision","parseInt","min","marginX","marginBottom","__nextHasNoMarginBottom","initialPosition","withInputField","max","step","disabled","__experimentalIsFocusable","variant","FontSizePicker"],"sources":["@wordpress/components/src/font-size-picker/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\nimport { useState, useMemo, forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Button } from '../button';\nimport RangeControl from '../range-control';\nimport { Flex, FlexItem } from '../flex';\nimport {\n\tdefault as UnitControl,\n\tparseQuantityAndUnitFromRawValue,\n\tuseCustomUnits,\n} from '../unit-control';\nimport { VisuallyHidden } from '../visually-hidden';\nimport { getCommonSizeUnit } from './utils';\nimport type { FontSizePickerProps } from './types';\nimport {\n\tContainer,\n\tHeader,\n\tHeaderHint,\n\tHeaderLabel,\n\tHeaderToggle,\n} from './styles';\nimport { Spacer } from '../spacer';\nimport FontSizePickerSelect from './font-size-picker-select';\nimport FontSizePickerToggleGroup from './font-size-picker-toggle-group';\nimport { T_SHIRT_NAMES } from './constants';\n\nconst DEFAULT_UNITS = [ 'px', 'em', 'rem' ];\n\nconst UnforwardedFontSizePicker = (\n\tprops: FontSizePickerProps,\n\tref: ForwardedRef< any >\n) => {\n\tconst {\n\t\t__next40pxDefaultSize = false,\n\t\tfallbackFontSize,\n\t\tfontSizes = [],\n\t\tdisableCustomFontSizes = false,\n\t\tonChange,\n\t\tsize = 'default',\n\t\tunits: unitsProp = DEFAULT_UNITS,\n\t\tvalue,\n\t\twithSlider = false,\n\t\twithReset = true,\n\t} = props;\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: unitsProp,\n\t} );\n\n\tconst shouldUseSelectControl = fontSizes.length > 5;\n\tconst selectedFontSize = fontSizes.find(\n\t\t( fontSize ) => fontSize.size === value\n\t);\n\tconst isCustomValue = !! value && ! selectedFontSize;\n\n\tconst [ showCustomValueControl, setShowCustomValueControl ] = useState(\n\t\t! disableCustomFontSizes && isCustomValue\n\t);\n\n\tconst headerHint = useMemo( () => {\n\t\tif ( showCustomValueControl ) {\n\t\t\treturn __( 'Custom' );\n\t\t}\n\n\t\tif ( ! shouldUseSelectControl ) {\n\t\t\tif ( selectedFontSize ) {\n\t\t\t\treturn (\n\t\t\t\t\tselectedFontSize.name ||\n\t\t\t\t\tT_SHIRT_NAMES[ fontSizes.indexOf( selectedFontSize ) ]\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\tconst commonUnit = getCommonSizeUnit( fontSizes );\n\t\tif ( commonUnit ) {\n\t\t\treturn `(${ commonUnit })`;\n\t\t}\n\n\t\treturn '';\n\t}, [\n\t\tshowCustomValueControl,\n\t\tshouldUseSelectControl,\n\t\tselectedFontSize,\n\t\tfontSizes,\n\t] );\n\n\tif ( fontSizes.length === 0 && disableCustomFontSizes ) {\n\t\treturn null;\n\t}\n\n\t// If neither the value or first font size is a string, then FontSizePicker\n\t// operates in a legacy \"unitless\" mode where UnitControl can only be used\n\t// to select px values and onChange() is always called with number values.\n\tconst hasUnits =\n\t\ttypeof value === 'string' || typeof fontSizes[ 0 ]?.size === 'string';\n\n\tconst [ valueQuantity, valueUnit ] = parseQuantityAndUnitFromRawValue(\n\t\tvalue,\n\t\tunits\n\t);\n\tconst isValueUnitRelative =\n\t\t!! valueUnit && [ 'em', 'rem' ].includes( valueUnit );\n\tconst isDisabled = value === undefined;\n\n\treturn (\n\t\t<Container ref={ ref } className=\"components-font-size-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Font size' ) }</VisuallyHidden>\n\t\t\t<Spacer>\n\t\t\t\t<Header className=\"components-font-size-picker__header\">\n\t\t\t\t\t<HeaderLabel\n\t\t\t\t\t\taria-label={ `${ __( 'Size' ) } ${ headerHint || '' }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Size' ) }\n\t\t\t\t\t\t{ headerHint && (\n\t\t\t\t\t\t\t<HeaderHint className=\"components-font-size-picker__header__hint\">\n\t\t\t\t\t\t\t\t{ headerHint }\n\t\t\t\t\t\t\t</HeaderHint>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HeaderLabel>\n\t\t\t\t\t{ ! disableCustomFontSizes && (\n\t\t\t\t\t\t<HeaderToggle\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tshowCustomValueControl\n\t\t\t\t\t\t\t\t\t? __( 'Use size preset' )\n\t\t\t\t\t\t\t\t\t: __( 'Set custom size' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ settings }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetShowCustomValueControl(\n\t\t\t\t\t\t\t\t\t! showCustomValueControl\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisPressed={ showCustomValueControl }\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Header>\n\t\t\t</Spacer>\n\t\t\t<div>\n\t\t\t\t{ !! fontSizes.length &&\n\t\t\t\t\tshouldUseSelectControl &&\n\t\t\t\t\t! showCustomValueControl && (\n\t\t\t\t\t\t<FontSizePickerSelect\n\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t: Number( newValue ),\n\t\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonSelectCustom={ () =>\n\t\t\t\t\t\t\t\tsetShowCustomValueControl( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t{ ! shouldUseSelectControl && ! showCustomValueControl && (\n\t\t\t\t\t<FontSizePickerToggleGroup\n\t\t\t\t\t\tfontSizes={ fontSizes }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\thasUnits ? newValue : Number( newValue ),\n\t\t\t\t\t\t\t\t\tfontSizes.find(\n\t\t\t\t\t\t\t\t\t\t( fontSize ) =>\n\t\t\t\t\t\t\t\t\t\t\tfontSize.size === newValue\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ! disableCustomFontSizes && showCustomValueControl && (\n\t\t\t\t\t<Flex className=\"components-font-size-picker__custom-size-control\">\n\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\t\t\t\tlabel={ __( 'Custom' ) }\n\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\thasUnits\n\t\t\t\t\t\t\t\t\t\t\t\t? newValue\n\t\t\t\t\t\t\t\t\t\t\t\t: parseInt( newValue, 10 )\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tsize={ size }\n\t\t\t\t\t\t\t\tunits={ hasUnits ? units : [] }\n\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t{ withSlider && (\n\t\t\t\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t\t\t\t<Spacer marginX={ 2 } marginBottom={ 0 }>\n\t\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize={\n\t\t\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tclassName=\"components-font-size-picker__custom-input\"\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Custom Size' ) }\n\t\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\t\tvalue={ valueQuantity }\n\t\t\t\t\t\t\t\t\t\tinitialPosition={ fallbackFontSize }\n\t\t\t\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( newValue === undefined ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t\t\t} else if ( hasUnits ) {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnewValue +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t( valueUnit ?? 'px' )\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tonChange?.( newValue );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\t\t\t\tmax={ isValueUnitRelative ? 10 : 100 }\n\t\t\t\t\t\t\t\t\t\tstep={ isValueUnitRelative ? 0.1 : 1 }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Spacer>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ withReset && (\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tdisabled={ isDisabled }\n\t\t\t\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tonChange?.( undefined );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tsize={\n\t\t\t\t\t\t\t\t\t\tsize === '__unstable-large' ||\n\t\t\t\t\t\t\t\t\t\tprops.__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t: 'small'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Flex>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</Container>\n\t);\n};\n\nexport const FontSizePicker = forwardRef( UnforwardedFontSizePicker );\n\nexport default FontSizePicker;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,SAASC,QAAQ,EAAEC,OAAO,EAAEC,UAAU,QAAQ,oBAAoB;;AAElE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,WAAW;AAClC,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,IAAI,EAAEC,QAAQ,QAAQ,SAAS;AACxC,SACCC,OAAO,IAAIC,WAAW,EACtBC,gCAAgC,EAChCC,cAAc,QACR,iBAAiB;AACxB,SAASC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/src/font-size-picker/types.ts"],"sourcesContent":["export type FontSizePickerProps = {\n\t/**\n\t * If `true`, it will not be possible to choose a custom fontSize. The user\n\t * will be forced to pick one of the pre-defined sizes passed in fontSizes.\n\t *\n\t * @default false\n\t */\n\tdisableCustomFontSizes?: boolean;\n\t/**\n\t * If no value exists, this prop defines the starting position for the font\n\t * size picker slider. Only relevant if `withSlider` is `true`.\n\t */\n\tfallbackFontSize?: number;\n\t/**\n\t * An array of font size objects. The object should contain properties size,\n\t * name, and slug.\n\t */\n\tfontSizes?: FontSize[];\n\t/**\n\t * A function that receives the new font size value.\n\t * If onChange is called without any parameter, it should reset the value,\n\t * attending to what reset means in that context, e.g., set the font size to\n\t * undefined or set the font size a starting value.\n\t */\n\tonChange?: (\n\t\tvalue: number | string | undefined,\n\t\tselectedItem?: FontSize\n\t) => void;\n\t/**\n\t * Available units for custom font size selection.\n\t */\n\tunits?: string[];\n\t/**\n\t * The current font size value.\n\t */\n\tvalue?: number | string;\n\t/**\n\t * If `true`, the UI will contain a slider, instead of a numeric text input\n\t * field. If `false`, no slider will be present.\n\t *\n\t * @default false\n\t */\n\twithSlider?: boolean;\n\t/**\n\t * If `true`, a reset button will be displayed alongside the input field\n\t * when a custom font size is active. Has no effect when\n\t * `disableCustomFontSizes` or `withSlider` is `true`.\n\t *\n\t * @default true\n\t */\n\twithReset?: boolean;\n\t/**\n\t * Start opting into the new margin-free styles that will become the default\n\t * in a future version, currently scheduled to be WordPress 6.4. (The prop\n\t * can be safely removed once this happens.)\n\t *\n\t * @default false\n\t * @deprecated Default behavior since WP 6.5. Prop can be safely removed.\n\t * @ignore\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * Size of the control.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | '__unstable-large';\n};\n\nexport type FontSize = {\n\t/**\n\t * The property `size` contains a number with the font size value, in `px` or\n\t * a string specifying the font size CSS property that should be used eg:\n\t * \"13px\", \"1em\", or \"clamp(12px, 5vw, 100px)\".\n\t */\n\tsize: number | string;\n\t/**\n\t * The `name` property includes a label for that font size e.g.: `Small`.\n\t */\n\tname?: string;\n\t/**\n\t * The `slug` property is a string with a unique identifier for the font\n\t * size. Used for the class generation process.\n\t */\n\tslug: string;\n};\n\nexport type FontSizePickerSelectProps = Pick<\n\tFontSizePickerProps,\n\t'value' | 'size'\n> & {\n\tfontSizes: NonNullable< FontSizePickerProps[ 'fontSizes' ] >;\n\tdisableCustomFontSizes: NonNullable<\n\t\tFontSizePickerProps[ 'disableCustomFontSizes' ]\n\t>;\n\tonChange: NonNullable< FontSizePickerProps[ 'onChange' ] >;\n\tonSelectCustom: () => void;\n\t__next40pxDefaultSize: boolean;\n};\n\nexport type FontSizePickerSelectOption = {\n\tkey: string;\n\tname: string;\n\tvalue?: FontSize[ 'size' ];\n\t__experimentalHint?: string;\n};\n\nexport type FontSizePickerToggleGroupProps = Pick<\n\tFontSizePickerProps,\n\t'value' | 'size' | '__next40pxDefaultSize'\n> & {\n\tfontSizes: NonNullable< FontSizePickerProps[ 'fontSizes' ] >;\n\tonChange: NonNullable< FontSizePickerProps[ 'onChange' ] >;\n};\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["@wordpress/components/src/font-size-picker/types.ts"],"sourcesContent":["export type FontSizePickerProps = {\n\t/**\n\t * If `true`, it will not be possible to choose a custom fontSize. The user\n\t * will be forced to pick one of the pre-defined sizes passed in fontSizes.\n\t *\n\t * @default false\n\t */\n\tdisableCustomFontSizes?: boolean;\n\t/**\n\t * If no value exists, this prop defines the starting position for the font\n\t * size picker slider. Only relevant if `withSlider` is `true`.\n\t */\n\tfallbackFontSize?: number;\n\t/**\n\t * An array of font size objects. The object should contain properties size,\n\t * name, and slug.\n\t */\n\tfontSizes?: FontSize[];\n\t/**\n\t * A function that receives the new font size value.\n\t * If onChange is called without any parameter, it should reset the value,\n\t * attending to what reset means in that context, e.g., set the font size to\n\t * undefined or set the font size a starting value.\n\t */\n\tonChange?: (\n\t\tvalue: number | string | undefined,\n\t\tselectedItem?: FontSize\n\t) => void;\n\t/**\n\t * Available units for custom font size selection.\n\t *\n\t * @default `[ 'px', 'em', 'rem' ]`\n\t */\n\tunits?: string[];\n\t/**\n\t * The current font size value.\n\t */\n\tvalue?: number | string;\n\t/**\n\t * If `true`, the UI will contain a slider, instead of a numeric text input\n\t * field. If `false`, no slider will be present.\n\t *\n\t * @default false\n\t */\n\twithSlider?: boolean;\n\t/**\n\t * If `true`, a reset button will be displayed alongside the input field\n\t * when a custom font size is active. Has no effect when\n\t * `disableCustomFontSizes` or `withSlider` is `true`.\n\t *\n\t * @default true\n\t */\n\twithReset?: boolean;\n\t/**\n\t * Start opting into the new margin-free styles that will become the default\n\t * in a future version, currently scheduled to be WordPress 6.4. (The prop\n\t * can be safely removed once this happens.)\n\t *\n\t * @default false\n\t * @deprecated Default behavior since WP 6.5. Prop can be safely removed.\n\t * @ignore\n\t */\n\t__nextHasNoMarginBottom?: boolean;\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @default false\n\t */\n\t__next40pxDefaultSize?: boolean;\n\t/**\n\t * Size of the control.\n\t *\n\t * @default 'default'\n\t */\n\tsize?: 'default' | '__unstable-large';\n};\n\nexport type FontSize = {\n\t/**\n\t * The property `size` contains a number with the font size value, in `px` or\n\t * a string specifying the font size CSS property that should be used eg:\n\t * \"13px\", \"1em\", or \"clamp(12px, 5vw, 100px)\".\n\t */\n\tsize: number | string;\n\t/**\n\t * The `name` property includes a label for that font size e.g.: `Small`.\n\t */\n\tname?: string;\n\t/**\n\t * The `slug` property is a string with a unique identifier for the font\n\t * size. Used for the class generation process.\n\t */\n\tslug: string;\n};\n\nexport type FontSizePickerSelectProps = Pick<\n\tFontSizePickerProps,\n\t'value' | 'size'\n> & {\n\tfontSizes: NonNullable< FontSizePickerProps[ 'fontSizes' ] >;\n\tdisableCustomFontSizes: NonNullable<\n\t\tFontSizePickerProps[ 'disableCustomFontSizes' ]\n\t>;\n\tonChange: NonNullable< FontSizePickerProps[ 'onChange' ] >;\n\tonSelectCustom: () => void;\n\t__next40pxDefaultSize: boolean;\n};\n\nexport type FontSizePickerSelectOption = {\n\tkey: string;\n\tname: string;\n\tvalue?: FontSize[ 'size' ];\n\t__experimentalHint?: string;\n};\n\nexport type FontSizePickerToggleGroupProps = Pick<\n\tFontSizePickerProps,\n\t'value' | 'size' | '__next40pxDefaultSize'\n> & {\n\tfontSizes: NonNullable< FontSizePickerProps[ 'fontSizes' ] >;\n\tonChange: NonNullable< FontSizePickerProps[ 'onChange' ] >;\n};\n"],"mappings":"","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
@@ -42,7 +42,7 @@ export function FormToggle(props, ref) {
42
42
  onChange = noop,
43
43
  ...additionalProps
44
44
  } = props;
45
- const wrapperClasses = classnames('components-form-toggle', className, {
45
+ const wrapperClasses = clsx('components-form-toggle', className, {
46
46
  'is-checked': checked,
47
47
  'is-disabled': disabled
48
48
  });
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","forwardRef","noop","FormToggle","props","ref","className","checked","id","disabled","onChange","additionalProps","wrapperClasses","createElement","type"],"sources":["@wordpress/components/src/form-toggle/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { FormToggleProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport const noop = () => {};\n\n/**\n * FormToggle switches a single setting on or off.\n *\n * ```jsx\n * import { FormToggle } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyFormToggle = () => {\n * const [ isChecked, setChecked ] = useState( true );\n *\n * return (\n * <FormToggle\n * checked={ isChecked }\n * onChange={ () => setChecked( ( state ) => ! state ) }\n * />\n * );\n * };\n * ```\n */\nexport function FormToggle(\n\tprops: WordPressComponentProps< FormToggleProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\tclassName,\n\t\tchecked,\n\t\tid,\n\t\tdisabled,\n\t\tonChange = noop,\n\t\t...additionalProps\n\t} = props;\n\tconst wrapperClasses = classnames( 'components-form-toggle', className, {\n\t\t'is-checked': checked,\n\t\t'is-disabled': disabled,\n\t} );\n\n\treturn (\n\t\t<span className={ wrapperClasses }>\n\t\t\t<input\n\t\t\t\tclassName=\"components-form-toggle__input\"\n\t\t\t\tid={ id }\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tchecked={ checked }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\t{ ...additionalProps }\n\t\t\t\tref={ ref }\n\t\t\t/>\n\t\t\t<span className=\"components-form-toggle__track\"></span>\n\t\t\t<span className=\"components-form-toggle__thumb\"></span>\n\t\t</span>\n\t);\n}\n\nexport default forwardRef( FormToggle );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAGnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAIA,OAAO,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CACzBC,KAAiE,EACjEC,GAAqC,EACpC;EACD,MAAM;IACLC,SAAS;IACTC,OAAO;IACPC,EAAE;IACFC,QAAQ;IACRC,QAAQ,GAAGR,IAAI;IACf,GAAGS;EACJ,CAAC,GAAGP,KAAK;EACT,MAAMQ,cAAc,GAAGZ,UAAU,CAAE,wBAAwB,EAAEM,SAAS,EAAE;IACvE,YAAY,EAAEC,OAAO;IACrB,aAAa,EAAEE;EAChB,CAAE,CAAC;EAEH,OACCI,aAAA;IAAMP,SAAS,EAAGM;EAAgB,GACjCC,aAAA;IACCP,SAAS,EAAC,+BAA+B;IACzCE,EAAE,EAAGA,EAAI;IACTM,IAAI,EAAC,UAAU;IACfP,OAAO,EAAGA,OAAS;IACnBG,QAAQ,EAAGA,QAAU;IACrBD,QAAQ,EAAGA,QAAU;IAAA,GAChBE,eAAe;IACpBN,GAAG,EAAGA;EAAK,CACX,CAAC,EACFQ,aAAA;IAAMP,SAAS,EAAC;EAA+B,CAAO,CAAC,EACvDO,aAAA;IAAMP,SAAS,EAAC;EAA+B,CAAO,CACjD,CAAC;AAET;AAEA,eAAeL,UAAU,CAAEE,UAAW,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","forwardRef","noop","FormToggle","props","ref","className","checked","id","disabled","onChange","additionalProps","wrapperClasses","createElement","type"],"sources":["@wordpress/components/src/form-toggle/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { FormToggleProps } from './types';\nimport type { WordPressComponentProps } from '../context';\n\nexport const noop = () => {};\n\n/**\n * FormToggle switches a single setting on or off.\n *\n * ```jsx\n * import { FormToggle } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const MyFormToggle = () => {\n * const [ isChecked, setChecked ] = useState( true );\n *\n * return (\n * <FormToggle\n * checked={ isChecked }\n * onChange={ () => setChecked( ( state ) => ! state ) }\n * />\n * );\n * };\n * ```\n */\nexport function FormToggle(\n\tprops: WordPressComponentProps< FormToggleProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\tclassName,\n\t\tchecked,\n\t\tid,\n\t\tdisabled,\n\t\tonChange = noop,\n\t\t...additionalProps\n\t} = props;\n\tconst wrapperClasses = clsx( 'components-form-toggle', className, {\n\t\t'is-checked': checked,\n\t\t'is-disabled': disabled,\n\t} );\n\n\treturn (\n\t\t<span className={ wrapperClasses }>\n\t\t\t<input\n\t\t\t\tclassName=\"components-form-toggle__input\"\n\t\t\t\tid={ id }\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tchecked={ checked }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\t{ ...additionalProps }\n\t\t\t\tref={ ref }\n\t\t\t/>\n\t\t\t<span className=\"components-form-toggle__track\"></span>\n\t\t\t<span className=\"components-form-toggle__thumb\"></span>\n\t\t</span>\n\t);\n}\n\nexport default forwardRef( FormToggle );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;;AAIA,OAAO,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CACzBC,KAAiE,EACjEC,GAAqC,EACpC;EACD,MAAM;IACLC,SAAS;IACTC,OAAO;IACPC,EAAE;IACFC,QAAQ;IACRC,QAAQ,GAAGR,IAAI;IACf,GAAGS;EACJ,CAAC,GAAGP,KAAK;EACT,MAAMQ,cAAc,GAAGZ,IAAI,CAAE,wBAAwB,EAAEM,SAAS,EAAE;IACjE,YAAY,EAAEC,OAAO;IACrB,aAAa,EAAEE;EAChB,CAAE,CAAC;EAEH,OACCI,aAAA;IAAMP,SAAS,EAAGM;EAAgB,GACjCC,aAAA;IACCP,SAAS,EAAC,+BAA+B;IACzCE,EAAE,EAAGA,EAAI;IACTM,IAAI,EAAC,UAAU;IACfP,OAAO,EAAGA,OAAS;IACnBG,QAAQ,EAAGA,QAAU;IACrBD,QAAQ,EAAGA,QAAU;IAAA,GAChBE,eAAe;IACpBN,GAAG,EAAGA;EAAK,CACX,CAAC,EACFQ,aAAA;IAAMP,SAAS,EAAC;EAA+B,CAAO,CAAC,EACvDO,aAAA;IAAMP,SAAS,EAAC;EAA+B,CAAO,CACjD,CAAC;AAET;AAEA,eAAeL,UAAU,CAAEE,UAAW,CAAC","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
@@ -489,7 +489,7 @@ export function FormTokenField(props) {
489
489
  ref: input
490
490
  });
491
491
  }
492
- const classes = classnames(className, 'components-form-token-field__input-container', {
492
+ const classes = clsx(className, 'components-form-token-field__input-container', {
493
493
  'is-active': isActive,
494
494
  'is-disabled': disabled
495
495
  });
@@ -512,7 +512,7 @@ export function FormTokenField(props) {
512
512
  /* eslint-disable jsx-a11y/no-static-element-interactions */
513
513
  return createElement("div", {
514
514
  ...tokenFieldProps
515
- }, createElement(StyledLabel, {
515
+ }, label && createElement(StyledLabel, {
516
516
  htmlFor: `components-form-token-input-${instanceId}`,
517
517
  className: "components-form-token-field__label"
518
518
  }, label), createElement("div", {
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useEffect","useRef","useState","__","_n","sprintf","useDebounce","useInstanceId","usePrevious","speak","isShallowEqual","Token","TokenInput","TokensAndInputWrapperFlex","SuggestionsList","FlexItem","StyledHelp","StyledLabel","Spacer","useDeprecated36pxDefaultSizeProp","withIgnoreIMEEvents","identity","value","FormTokenField","props","autoCapitalize","autoComplete","maxLength","placeholder","label","className","suggestions","maxSuggestions","displayTransform","saveTransform","token","trim","onChange","onInputChange","onFocus","undefined","isBorderless","disabled","tokenizeOnSpace","messages","added","removed","remove","__experimentalInvalid","__experimentalRenderItem","__experimentalExpandOnFocus","__experimentalValidateInput","__experimentalShowHowTo","__next40pxDefaultSize","__experimentalAutoSelectFirstMatch","__nextHasNoMarginBottom","tokenizeOnBlur","instanceId","incompleteTokenValue","setIncompleteTokenValue","inputOffsetFromEnd","setInputOffsetFromEnd","isActive","setIsActive","isExpanded","setIsExpanded","selectedSuggestionIndex","setSelectedSuggestionIndex","selectedSuggestionScroll","setSelectedSuggestionScroll","prevSuggestions","prevValue","input","tokensAndInput","debouncedSpeak","hasFocus","focus","suggestionsDidUpdate","updateSuggestions","current","ownerDocument","activeElement","onFocusHandler","event","target","onBlur","inputHasValidValue","addNewToken","hasFocusWithin","relatedTarget","onKeyDown","preventDefault","defaultPrevented","key","handleDeleteKey","deleteTokenBeforeInput","addCurrentToken","handleLeftArrowKey","handleUpArrowKey","handleRightArrowKey","handleDownArrowKey","deleteTokenAfterInput","handleEscapeKey","onKeyPress","handleCommaKey","onContainerTouched","onTokenClickRemove","deleteToken","onSuggestionHovered","suggestion","index","getMatchingSuggestions","indexOf","onSuggestionSelected","onInputChangeHandler","text","separator","items","split","tokenValue","length","addNewTokens","slice","_deleteToken","isInputEmpty","moveInputBeforePreviousToken","moveInputAfterNextToken","HTMLInputElement","moveInputToIndex","Math","max","prevInputOffsetFromEnd","min","getIndexOfInput","selectedSuggestion","getSelectedSuggestion","tokens","tokensToAdd","Set","map","filter","Boolean","valueContainsToken","newValue","splice","newTokens","item","getTokenValue","searchValue","_suggestions","_value","_maxSuggestions","_saveTransform","match","startsWithMatch","containsMatch","normalizedValue","includes","toLocaleLowerCase","forEach","push","concat","some","resetSelectedSuggestion","inputHasMinimumChars","matchingSuggestions","hasMatchingSuggestions","shouldExpandIfFocuses","message","renderTokensAndInput","components","renderToken","renderInput","status","termPosition","termsCount","createElement","title","onClickRemove","onMouseEnter","onMouseLeave","inputProps","ref","classes","tokenFieldProps","tabIndex","Object","assign","htmlFor","onMouseDown","onTouchStart","justify","align","gap","wrap","hasTokens","selectedIndex","scrollIntoView","onHover","onSelect","marginBottom","id"],"sources":["@wordpress/components/src/form-token-field/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { KeyboardEvent, MouseEvent, TouchEvent, FocusEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useDebounce, useInstanceId, usePrevious } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport Token from './token';\nimport TokenInput from './token-input';\nimport { TokensAndInputWrapperFlex } from './styles';\nimport SuggestionsList from './suggestions-list';\nimport type { FormTokenFieldProps, TokenItem } from './types';\nimport { FlexItem } from '../flex';\nimport {\n\tStyledHelp,\n\tStyledLabel,\n} from '../base-control/styles/base-control-styles';\nimport { Spacer } from '../spacer';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\n\nconst identity = ( value: string ) => value;\n\n/**\n * A `FormTokenField` is a field similar to the tags and categories fields in the interim editor chrome,\n * or the \"to\" field in Mail on OS X. Tokens can be entered by typing them or selecting them from a list of suggested tokens.\n *\n * Up to one hundred suggestions that match what the user has typed so far will be shown from which the user can pick from (auto-complete).\n * Tokens are separated by the \",\" character. Suggestions can be selected with the up or down arrows and added with the tab or enter key.\n *\n * The `value` property is handled in a manner similar to controlled form components.\n * See [Forms](https://react.dev/reference/react-dom/components#form-components) in the React Documentation for more information.\n */\nexport function FormTokenField( props: FormTokenFieldProps ) {\n\tconst {\n\t\tautoCapitalize,\n\t\tautoComplete,\n\t\tmaxLength,\n\t\tplaceholder,\n\t\tlabel = __( 'Add item' ),\n\t\tclassName,\n\t\tsuggestions = [],\n\t\tmaxSuggestions = 100,\n\t\tvalue = [],\n\t\tdisplayTransform = identity,\n\t\tsaveTransform = ( token ) => token.trim(),\n\t\tonChange = () => {},\n\t\tonInputChange = () => {},\n\t\tonFocus = undefined,\n\t\tisBorderless = false,\n\t\tdisabled = false,\n\t\ttokenizeOnSpace = false,\n\t\tmessages = {\n\t\t\tadded: __( 'Item added.' ),\n\t\t\tremoved: __( 'Item removed.' ),\n\t\t\tremove: __( 'Remove item' ),\n\t\t\t__experimentalInvalid: __( 'Invalid item' ),\n\t\t},\n\t\t__experimentalRenderItem,\n\t\t__experimentalExpandOnFocus = false,\n\t\t__experimentalValidateInput = () => true,\n\t\t__experimentalShowHowTo = true,\n\t\t__next40pxDefaultSize = false,\n\t\t__experimentalAutoSelectFirstMatch = false,\n\t\t__nextHasNoMarginBottom = false,\n\t\ttokenizeOnBlur = false,\n\t} = useDeprecated36pxDefaultSizeProp< FormTokenFieldProps >( props );\n\n\tconst instanceId = useInstanceId( FormTokenField );\n\n\t// We reset to these initial values again in the onBlur\n\tconst [ incompleteTokenValue, setIncompleteTokenValue ] = useState( '' );\n\tconst [ inputOffsetFromEnd, setInputOffsetFromEnd ] = useState( 0 );\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst [ isExpanded, setIsExpanded ] = useState( false );\n\tconst [ selectedSuggestionIndex, setSelectedSuggestionIndex ] =\n\t\tuseState( -1 );\n\tconst [ selectedSuggestionScroll, setSelectedSuggestionScroll ] =\n\t\tuseState( false );\n\n\tconst prevSuggestions = usePrevious< string[] >( suggestions );\n\tconst prevValue = usePrevious< ( string | TokenItem )[] >( value );\n\n\tconst input = useRef< HTMLInputElement >( null );\n\tconst tokensAndInput = useRef< HTMLInputElement >( null );\n\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\tuseEffect( () => {\n\t\t// Make sure to focus the input when the isActive state is true.\n\t\tif ( isActive && ! hasFocus() ) {\n\t\t\tfocus();\n\t\t}\n\t}, [ isActive ] );\n\n\tuseEffect( () => {\n\t\tconst suggestionsDidUpdate = ! isShallowEqual(\n\t\t\tsuggestions,\n\t\t\tprevSuggestions || []\n\t\t);\n\n\t\tif ( suggestionsDidUpdate || value !== prevValue ) {\n\t\t\tupdateSuggestions( suggestionsDidUpdate );\n\t\t}\n\n\t\t// TODO: updateSuggestions() should first be refactored so its actual deps are clearer.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ suggestions, prevSuggestions, value, prevValue ] );\n\n\tuseEffect( () => {\n\t\tupdateSuggestions();\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ incompleteTokenValue ] );\n\n\tuseEffect( () => {\n\t\tupdateSuggestions();\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ __experimentalAutoSelectFirstMatch ] );\n\n\tif ( disabled && isActive ) {\n\t\tsetIsActive( false );\n\t\tsetIncompleteTokenValue( '' );\n\t}\n\n\tfunction focus() {\n\t\tinput.current?.focus();\n\t}\n\n\tfunction hasFocus() {\n\t\treturn input.current === input.current?.ownerDocument.activeElement;\n\t}\n\n\tfunction onFocusHandler( event: FocusEvent ) {\n\t\t// If focus is on the input or on the container, set the isActive state to true.\n\t\tif ( hasFocus() || event.target === tokensAndInput.current ) {\n\t\t\tsetIsActive( true );\n\t\t\tsetIsExpanded( __experimentalExpandOnFocus || isExpanded );\n\t\t} else {\n\t\t\t/*\n\t\t\t * Otherwise, focus is on one of the token \"remove\" buttons and we\n\t\t\t * set the isActive state to false to prevent the input to be\n\t\t\t * re-focused, see componentDidUpdate().\n\t\t\t */\n\t\t\tsetIsActive( false );\n\t\t}\n\n\t\tif ( 'function' === typeof onFocus ) {\n\t\t\tonFocus( event );\n\t\t}\n\t}\n\n\tfunction onBlur( event: FocusEvent ) {\n\t\tif (\n\t\t\tinputHasValidValue() &&\n\t\t\t__experimentalValidateInput( incompleteTokenValue )\n\t\t) {\n\t\t\tsetIsActive( false );\n\t\t\tif ( tokenizeOnBlur && inputHasValidValue() ) {\n\t\t\t\taddNewToken( incompleteTokenValue );\n\t\t\t}\n\t\t} else {\n\t\t\t// Reset to initial state\n\t\t\tsetIncompleteTokenValue( '' );\n\t\t\tsetInputOffsetFromEnd( 0 );\n\t\t\tsetIsActive( false );\n\n\t\t\tif ( __experimentalExpandOnFocus ) {\n\t\t\t\t// If `__experimentalExpandOnFocus` is true, don't close the suggestions list when\n\t\t\t\t// the user clicks on it (`tokensAndInput` will be the element that caused the blur).\n\t\t\t\tconst hasFocusWithin =\n\t\t\t\t\tevent.relatedTarget === tokensAndInput.current;\n\t\t\t\tsetIsExpanded( hasFocusWithin );\n\t\t\t} else {\n\t\t\t\t// Else collapse the suggestion list. This will result in the suggestion list closing\n\t\t\t\t// after a suggestion has been submitted since that causes a blur.\n\t\t\t\tsetIsExpanded( false );\n\t\t\t}\n\n\t\t\tsetSelectedSuggestionIndex( -1 );\n\t\t\tsetSelectedSuggestionScroll( false );\n\t\t}\n\t}\n\n\tfunction onKeyDown( event: KeyboardEvent ) {\n\t\tlet preventDefault = false;\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\t\tswitch ( event.key ) {\n\t\t\tcase 'Backspace':\n\t\t\t\tpreventDefault = handleDeleteKey( deleteTokenBeforeInput );\n\t\t\t\tbreak;\n\t\t\tcase 'Enter':\n\t\t\t\tpreventDefault = addCurrentToken();\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowLeft':\n\t\t\t\tpreventDefault = handleLeftArrowKey();\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowUp':\n\t\t\t\tpreventDefault = handleUpArrowKey();\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowRight':\n\t\t\t\tpreventDefault = handleRightArrowKey();\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowDown':\n\t\t\t\tpreventDefault = handleDownArrowKey();\n\t\t\t\tbreak;\n\t\t\tcase 'Delete':\n\t\t\t\tpreventDefault = handleDeleteKey( deleteTokenAfterInput );\n\t\t\t\tbreak;\n\t\t\tcase 'Space':\n\t\t\t\tif ( tokenizeOnSpace ) {\n\t\t\t\t\tpreventDefault = addCurrentToken();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Escape':\n\t\t\t\tpreventDefault = handleEscapeKey( event );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n\n\tfunction onKeyPress( event: KeyboardEvent ) {\n\t\tlet preventDefault = false;\n\n\t\tswitch ( event.key ) {\n\t\t\tcase ',':\n\t\t\t\tpreventDefault = handleCommaKey();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n\n\tfunction onContainerTouched( event: MouseEvent | TouchEvent ) {\n\t\t// Prevent clicking/touching the tokensAndInput container from blurring\n\t\t// the input and adding the current token.\n\t\tif ( event.target === tokensAndInput.current && isActive ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n\n\tfunction onTokenClickRemove( event: { value: string } ) {\n\t\tdeleteToken( event.value );\n\t\tfocus();\n\t}\n\n\tfunction onSuggestionHovered( suggestion: string ) {\n\t\tconst index = getMatchingSuggestions().indexOf( suggestion );\n\n\t\tif ( index >= 0 ) {\n\t\t\tsetSelectedSuggestionIndex( index );\n\t\t\tsetSelectedSuggestionScroll( false );\n\t\t}\n\t}\n\n\tfunction onSuggestionSelected( suggestion: string ) {\n\t\taddNewToken( suggestion );\n\t}\n\n\tfunction onInputChangeHandler( event: { value: string } ) {\n\t\tconst text = event.value;\n\t\tconst separator = tokenizeOnSpace ? /[ ,\\t]+/ : /[,\\t]+/;\n\t\tconst items = text.split( separator );\n\t\tconst tokenValue = items[ items.length - 1 ] || '';\n\n\t\tif ( items.length > 1 ) {\n\t\t\taddNewTokens( items.slice( 0, -1 ) );\n\t\t}\n\t\tsetIncompleteTokenValue( tokenValue );\n\t\tonInputChange( tokenValue );\n\t}\n\n\tfunction handleDeleteKey( _deleteToken: () => void ) {\n\t\tlet preventDefault = false;\n\t\tif ( hasFocus() && isInputEmpty() ) {\n\t\t\t_deleteToken();\n\t\t\tpreventDefault = true;\n\t\t}\n\n\t\treturn preventDefault;\n\t}\n\n\tfunction handleLeftArrowKey() {\n\t\tlet preventDefault = false;\n\t\tif ( isInputEmpty() ) {\n\t\t\tmoveInputBeforePreviousToken();\n\t\t\tpreventDefault = true;\n\t\t}\n\n\t\treturn preventDefault;\n\t}\n\n\tfunction handleRightArrowKey() {\n\t\tlet preventDefault = false;\n\t\tif ( isInputEmpty() ) {\n\t\t\tmoveInputAfterNextToken();\n\t\t\tpreventDefault = true;\n\t\t}\n\n\t\treturn preventDefault;\n\t}\n\n\tfunction handleUpArrowKey() {\n\t\tsetSelectedSuggestionIndex( ( index ) => {\n\t\t\treturn (\n\t\t\t\t( index === 0\n\t\t\t\t\t? getMatchingSuggestions(\n\t\t\t\t\t\t\tincompleteTokenValue,\n\t\t\t\t\t\t\tsuggestions,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\tmaxSuggestions,\n\t\t\t\t\t\t\tsaveTransform\n\t\t\t\t\t ).length\n\t\t\t\t\t: index ) - 1\n\t\t\t);\n\t\t} );\n\t\tsetSelectedSuggestionScroll( true );\n\n\t\treturn true; // PreventDefault.\n\t}\n\n\tfunction handleDownArrowKey() {\n\t\tsetSelectedSuggestionIndex( ( index ) => {\n\t\t\treturn (\n\t\t\t\t( index + 1 ) %\n\t\t\t\tgetMatchingSuggestions(\n\t\t\t\t\tincompleteTokenValue,\n\t\t\t\t\tsuggestions,\n\t\t\t\t\tvalue,\n\t\t\t\t\tmaxSuggestions,\n\t\t\t\t\tsaveTransform\n\t\t\t\t).length\n\t\t\t);\n\t\t} );\n\n\t\tsetSelectedSuggestionScroll( true );\n\t\treturn true; // PreventDefault.\n\t}\n\n\tfunction handleEscapeKey( event: KeyboardEvent ) {\n\t\tif ( event.target instanceof HTMLInputElement ) {\n\t\t\tsetIncompleteTokenValue( event.target.value );\n\t\t\tsetIsExpanded( false );\n\t\t\tsetSelectedSuggestionIndex( -1 );\n\t\t\tsetSelectedSuggestionScroll( false );\n\t\t}\n\n\t\treturn true; // PreventDefault.\n\t}\n\n\tfunction handleCommaKey() {\n\t\tif ( inputHasValidValue() ) {\n\t\t\taddNewToken( incompleteTokenValue );\n\t\t}\n\n\t\treturn true; // PreventDefault.\n\t}\n\n\tfunction moveInputToIndex( index: number ) {\n\t\tsetInputOffsetFromEnd( value.length - Math.max( index, -1 ) - 1 );\n\t}\n\n\tfunction moveInputBeforePreviousToken() {\n\t\tsetInputOffsetFromEnd( ( prevInputOffsetFromEnd ) => {\n\t\t\treturn Math.min( prevInputOffsetFromEnd + 1, value.length );\n\t\t} );\n\t}\n\n\tfunction moveInputAfterNextToken() {\n\t\tsetInputOffsetFromEnd( ( prevInputOffsetFromEnd ) => {\n\t\t\treturn Math.max( prevInputOffsetFromEnd - 1, 0 );\n\t\t} );\n\t}\n\n\tfunction deleteTokenBeforeInput() {\n\t\tconst index = getIndexOfInput() - 1;\n\n\t\tif ( index > -1 ) {\n\t\t\tdeleteToken( value[ index ] );\n\t\t}\n\t}\n\n\tfunction deleteTokenAfterInput() {\n\t\tconst index = getIndexOfInput();\n\n\t\tif ( index < value.length ) {\n\t\t\tdeleteToken( value[ index ] );\n\t\t\t// Update input offset since it's the offset from the last token.\n\t\t\tmoveInputToIndex( index );\n\t\t}\n\t}\n\n\tfunction addCurrentToken() {\n\t\tlet preventDefault = false;\n\t\tconst selectedSuggestion = getSelectedSuggestion();\n\n\t\tif ( selectedSuggestion ) {\n\t\t\taddNewToken( selectedSuggestion );\n\t\t\tpreventDefault = true;\n\t\t} else if ( inputHasValidValue() ) {\n\t\t\taddNewToken( incompleteTokenValue );\n\t\t\tpreventDefault = true;\n\t\t}\n\n\t\treturn preventDefault;\n\t}\n\n\tfunction addNewTokens( tokens: string[] ) {\n\t\tconst tokensToAdd = [\n\t\t\t...new Set(\n\t\t\t\ttokens\n\t\t\t\t\t.map( saveTransform )\n\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t.filter( ( token ) => ! valueContainsToken( token ) )\n\t\t\t),\n\t\t];\n\n\t\tif ( tokensToAdd.length > 0 ) {\n\t\t\tconst newValue = [ ...value ];\n\t\t\tnewValue.splice( getIndexOfInput(), 0, ...tokensToAdd );\n\t\t\tonChange( newValue );\n\t\t}\n\t}\n\n\tfunction addNewToken( token: string ) {\n\t\tif ( ! __experimentalValidateInput( token ) ) {\n\t\t\tspeak( messages.__experimentalInvalid, 'assertive' );\n\t\t\treturn;\n\t\t}\n\t\taddNewTokens( [ token ] );\n\t\tspeak( messages.added, 'assertive' );\n\n\t\tsetIncompleteTokenValue( '' );\n\t\tsetSelectedSuggestionIndex( -1 );\n\t\tsetSelectedSuggestionScroll( false );\n\t\tsetIsExpanded( ! __experimentalExpandOnFocus );\n\n\t\tif ( isActive && ! tokenizeOnBlur ) {\n\t\t\tfocus();\n\t\t}\n\t}\n\n\tfunction deleteToken( token: string | TokenItem ) {\n\t\tconst newTokens = value.filter( ( item ) => {\n\t\t\treturn getTokenValue( item ) !== getTokenValue( token );\n\t\t} );\n\t\tonChange( newTokens );\n\t\tspeak( messages.removed, 'assertive' );\n\t}\n\n\tfunction getTokenValue( token: { value: string } | string ) {\n\t\tif ( 'object' === typeof token ) {\n\t\t\treturn token.value;\n\t\t}\n\n\t\treturn token;\n\t}\n\n\tfunction getMatchingSuggestions(\n\t\tsearchValue = incompleteTokenValue,\n\t\t_suggestions = suggestions,\n\t\t_value = value,\n\t\t_maxSuggestions = maxSuggestions,\n\t\t_saveTransform = saveTransform\n\t) {\n\t\tlet match = _saveTransform( searchValue );\n\t\tconst startsWithMatch: string[] = [];\n\t\tconst containsMatch: string[] = [];\n\t\tconst normalizedValue = _value.map( ( item ) => {\n\t\t\tif ( typeof item === 'string' ) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\treturn item.value;\n\t\t} );\n\n\t\tif ( match.length === 0 ) {\n\t\t\t_suggestions = _suggestions.filter(\n\t\t\t\t( suggestion ) => ! normalizedValue.includes( suggestion )\n\t\t\t);\n\t\t} else {\n\t\t\tmatch = match.toLocaleLowerCase();\n\n\t\t\t_suggestions.forEach( ( suggestion ) => {\n\t\t\t\tconst index = suggestion.toLocaleLowerCase().indexOf( match );\n\t\t\t\tif ( normalizedValue.indexOf( suggestion ) === -1 ) {\n\t\t\t\t\tif ( index === 0 ) {\n\t\t\t\t\t\tstartsWithMatch.push( suggestion );\n\t\t\t\t\t} else if ( index > 0 ) {\n\t\t\t\t\t\tcontainsMatch.push( suggestion );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t_suggestions = startsWithMatch.concat( containsMatch );\n\t\t}\n\n\t\treturn _suggestions.slice( 0, _maxSuggestions );\n\t}\n\n\tfunction getSelectedSuggestion() {\n\t\tif ( selectedSuggestionIndex !== -1 ) {\n\t\t\treturn getMatchingSuggestions()[ selectedSuggestionIndex ];\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tfunction valueContainsToken( token: string ) {\n\t\treturn value.some( ( item ) => {\n\t\t\treturn getTokenValue( token ) === getTokenValue( item );\n\t\t} );\n\t}\n\n\tfunction getIndexOfInput() {\n\t\treturn value.length - inputOffsetFromEnd;\n\t}\n\n\tfunction isInputEmpty() {\n\t\treturn incompleteTokenValue.length === 0;\n\t}\n\n\tfunction inputHasValidValue() {\n\t\treturn saveTransform( incompleteTokenValue ).length > 0;\n\t}\n\n\tfunction updateSuggestions( resetSelectedSuggestion = true ) {\n\t\tconst inputHasMinimumChars = incompleteTokenValue.trim().length > 1;\n\t\tconst matchingSuggestions =\n\t\t\tgetMatchingSuggestions( incompleteTokenValue );\n\t\tconst hasMatchingSuggestions = matchingSuggestions.length > 0;\n\n\t\tconst shouldExpandIfFocuses = hasFocus() && __experimentalExpandOnFocus;\n\t\tsetIsExpanded(\n\t\t\tshouldExpandIfFocuses ||\n\t\t\t\t( inputHasMinimumChars && hasMatchingSuggestions )\n\t\t);\n\n\t\tif ( resetSelectedSuggestion ) {\n\t\t\tif (\n\t\t\t\t__experimentalAutoSelectFirstMatch &&\n\t\t\t\tinputHasMinimumChars &&\n\t\t\t\thasMatchingSuggestions\n\t\t\t) {\n\t\t\t\tsetSelectedSuggestionIndex( 0 );\n\t\t\t\tsetSelectedSuggestionScroll( true );\n\t\t\t} else {\n\t\t\t\tsetSelectedSuggestionIndex( -1 );\n\t\t\t\tsetSelectedSuggestionScroll( false );\n\t\t\t}\n\t\t}\n\n\t\tif ( inputHasMinimumChars ) {\n\t\t\tconst message = hasMatchingSuggestions\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t_n(\n\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'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\tmatchingSuggestions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmatchingSuggestions.length\n\t\t\t\t )\n\t\t\t\t: __( 'No results.' );\n\n\t\t\tdebouncedSpeak( message, 'assertive' );\n\t\t}\n\t}\n\n\tfunction renderTokensAndInput() {\n\t\tconst components = value.map( renderToken );\n\t\tcomponents.splice( getIndexOfInput(), 0, renderInput() );\n\n\t\treturn components;\n\t}\n\n\tfunction renderToken(\n\t\ttoken: string | TokenItem,\n\t\tindex: number,\n\t\ttokens: ( string | TokenItem )[]\n\t) {\n\t\tconst _value = getTokenValue( token );\n\t\tconst status = typeof token !== 'string' ? token.status : undefined;\n\t\tconst termPosition = index + 1;\n\t\tconst termsCount = tokens.length;\n\n\t\treturn (\n\t\t\t<FlexItem key={ 'token-' + _value }>\n\t\t\t\t<Token\n\t\t\t\t\tvalue={ _value }\n\t\t\t\t\tstatus={ status }\n\t\t\t\t\ttitle={\n\t\t\t\t\t\ttypeof token !== 'string' ? token.title : undefined\n\t\t\t\t\t}\n\t\t\t\t\tdisplayTransform={ displayTransform }\n\t\t\t\t\tonClickRemove={ onTokenClickRemove }\n\t\t\t\t\tisBorderless={\n\t\t\t\t\t\t( typeof token !== 'string' && token.isBorderless ) ||\n\t\t\t\t\t\tisBorderless\n\t\t\t\t\t}\n\t\t\t\t\tonMouseEnter={\n\t\t\t\t\t\ttypeof token !== 'string'\n\t\t\t\t\t\t\t? token.onMouseEnter\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tonMouseLeave={\n\t\t\t\t\t\ttypeof token !== 'string'\n\t\t\t\t\t\t\t? token.onMouseLeave\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tdisabled={ 'error' !== status && disabled }\n\t\t\t\t\tmessages={ messages }\n\t\t\t\t\ttermsCount={ termsCount }\n\t\t\t\t\ttermPosition={ termPosition }\n\t\t\t\t/>\n\t\t\t</FlexItem>\n\t\t);\n\t}\n\n\tfunction renderInput() {\n\t\tconst inputProps = {\n\t\t\tinstanceId,\n\t\t\tautoCapitalize,\n\t\t\tautoComplete,\n\t\t\tplaceholder: value.length === 0 ? placeholder : '',\n\t\t\tkey: 'input',\n\t\t\tdisabled,\n\t\t\tvalue: incompleteTokenValue,\n\t\t\tonBlur,\n\t\t\tisExpanded,\n\t\t\tselectedSuggestionIndex,\n\t\t};\n\n\t\treturn (\n\t\t\t<TokenInput\n\t\t\t\t{ ...inputProps }\n\t\t\t\tonChange={\n\t\t\t\t\t! ( maxLength && value.length >= maxLength )\n\t\t\t\t\t\t? onInputChangeHandler\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tref={ input }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst classes = classnames(\n\t\tclassName,\n\t\t'components-form-token-field__input-container',\n\t\t{\n\t\t\t'is-active': isActive,\n\t\t\t'is-disabled': disabled,\n\t\t}\n\t);\n\n\tlet tokenFieldProps = {\n\t\tclassName: 'components-form-token-field',\n\t\ttabIndex: -1,\n\t};\n\tconst matchingSuggestions = getMatchingSuggestions();\n\n\tif ( ! disabled ) {\n\t\ttokenFieldProps = Object.assign( {}, tokenFieldProps, {\n\t\t\tonKeyDown: withIgnoreIMEEvents( onKeyDown ),\n\t\t\tonKeyPress,\n\t\t\tonFocus: onFocusHandler,\n\t\t} );\n\t}\n\n\t// Disable reason: There is no appropriate role which describes the\n\t// input container intended accessible usability.\n\t// TODO: Refactor click detection to use blur to stop propagation.\n\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\treturn (\n\t\t<div { ...tokenFieldProps }>\n\t\t\t<StyledLabel\n\t\t\t\thtmlFor={ `components-form-token-input-${ instanceId }` }\n\t\t\t\tclassName=\"components-form-token-field__label\"\n\t\t\t>\n\t\t\t\t{ label }\n\t\t\t</StyledLabel>\n\t\t\t<div\n\t\t\t\tref={ tokensAndInput }\n\t\t\t\tclassName={ classes }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t\tonMouseDown={ onContainerTouched }\n\t\t\t\tonTouchStart={ onContainerTouched }\n\t\t\t>\n\t\t\t\t<TokensAndInputWrapperFlex\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tgap={ 1 }\n\t\t\t\t\twrap\n\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\thasTokens={ !! value.length }\n\t\t\t\t>\n\t\t\t\t\t{ renderTokensAndInput() }\n\t\t\t\t</TokensAndInputWrapperFlex>\n\t\t\t\t{ isExpanded && (\n\t\t\t\t\t<SuggestionsList\n\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\tmatch={ saveTransform( incompleteTokenValue ) }\n\t\t\t\t\t\tdisplayTransform={ displayTransform }\n\t\t\t\t\t\tsuggestions={ matchingSuggestions }\n\t\t\t\t\t\tselectedIndex={ selectedSuggestionIndex }\n\t\t\t\t\t\tscrollIntoView={ selectedSuggestionScroll }\n\t\t\t\t\t\tonHover={ onSuggestionHovered }\n\t\t\t\t\t\tonSelect={ onSuggestionSelected }\n\t\t\t\t\t\t__experimentalRenderItem={ __experimentalRenderItem }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t{ ! __nextHasNoMarginBottom && <Spacer marginBottom={ 2 } /> }\n\t\t\t{ __experimentalShowHowTo && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\tid={ `components-form-token-suggestions-howto-${ instanceId }` }\n\t\t\t\t\tclassName=\"components-form-token-field__help\"\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t>\n\t\t\t\t\t{ tokenizeOnSpace\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'Separate with commas, spaces, or the Enter key.'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Separate with commas or the Enter key.' ) }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</div>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n}\n\nexport default FormTokenField;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAGnC;AACA;AACA;AACA,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,WAAW,EAAEC,aAAa,EAAEC,WAAW,QAAQ,oBAAoB;AAC5E,SAASC,KAAK,QAAQ,iBAAiB;AACvC,OAAOC,cAAc,MAAM,6BAA6B;;AAExD;AACA;AACA;AACA,OAAOC,KAAK,MAAM,SAAS;AAC3B,OAAOC,UAAU,MAAM,eAAe;AACtC,SAASC,yBAAyB,QAAQ,UAAU;AACpD,OAAOC,eAAe,MAAM,oBAAoB;AAEhD,SAASC,QAAQ,QAAQ,SAAS;AAClC,SACCC,UAAU,EACVC,WAAW,QACL,4CAA4C;AACnD,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,gCAAgC,QAAQ,+BAA+B;AAChF,SAASC,mBAAmB,QAAQ,iCAAiC;AAErE,MAAM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C,CAET,CAAC;EAEP;AACD;AAEA,eAAeoB,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useEffect","useRef","useState","__","_n","sprintf","useDebounce","useInstanceId","usePrevious","speak","isShallowEqual","Token","TokenInput","TokensAndInputWrapperFlex","SuggestionsList","FlexItem","StyledHelp","StyledLabel","Spacer","useDeprecated36pxDefaultSizeProp","withIgnoreIMEEvents","identity","value","FormTokenField","props","autoCapitalize","autoComplete","maxLength","placeholder","label","className","suggestions","maxSuggestions","displayTransform","saveTransform","token","trim","onChange","onInputChange","onFocus","undefined","isBorderless","disabled","tokenizeOnSpace","messages","added","removed","remove","__experimentalInvalid","__experimentalRenderItem","__experimentalExpandOnFocus","__experimentalValidateInput","__experimentalShowHowTo","__next40pxDefaultSize","__experimentalAutoSelectFirstMatch","__nextHasNoMarginBottom","tokenizeOnBlur","instanceId","incompleteTokenValue","setIncompleteTokenValue","inputOffsetFromEnd","setInputOffsetFromEnd","isActive","setIsActive","isExpanded","setIsExpanded","selectedSuggestionIndex","setSelectedSuggestionIndex","selectedSuggestionScroll","setSelectedSuggestionScroll","prevSuggestions","prevValue","input","tokensAndInput","debouncedSpeak","hasFocus","focus","suggestionsDidUpdate","updateSuggestions","current","ownerDocument","activeElement","onFocusHandler","event","target","onBlur","inputHasValidValue","addNewToken","hasFocusWithin","relatedTarget","onKeyDown","preventDefault","defaultPrevented","key","handleDeleteKey","deleteTokenBeforeInput","addCurrentToken","handleLeftArrowKey","handleUpArrowKey","handleRightArrowKey","handleDownArrowKey","deleteTokenAfterInput","handleEscapeKey","onKeyPress","handleCommaKey","onContainerTouched","onTokenClickRemove","deleteToken","onSuggestionHovered","suggestion","index","getMatchingSuggestions","indexOf","onSuggestionSelected","onInputChangeHandler","text","separator","items","split","tokenValue","length","addNewTokens","slice","_deleteToken","isInputEmpty","moveInputBeforePreviousToken","moveInputAfterNextToken","HTMLInputElement","moveInputToIndex","Math","max","prevInputOffsetFromEnd","min","getIndexOfInput","selectedSuggestion","getSelectedSuggestion","tokens","tokensToAdd","Set","map","filter","Boolean","valueContainsToken","newValue","splice","newTokens","item","getTokenValue","searchValue","_suggestions","_value","_maxSuggestions","_saveTransform","match","startsWithMatch","containsMatch","normalizedValue","includes","toLocaleLowerCase","forEach","push","concat","some","resetSelectedSuggestion","inputHasMinimumChars","matchingSuggestions","hasMatchingSuggestions","shouldExpandIfFocuses","message","renderTokensAndInput","components","renderToken","renderInput","status","termPosition","termsCount","createElement","title","onClickRemove","onMouseEnter","onMouseLeave","inputProps","ref","classes","tokenFieldProps","tabIndex","Object","assign","htmlFor","onMouseDown","onTouchStart","justify","align","gap","wrap","hasTokens","selectedIndex","scrollIntoView","onHover","onSelect","marginBottom","id"],"sources":["@wordpress/components/src/form-token-field/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { KeyboardEvent, MouseEvent, TouchEvent, FocusEvent } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useDebounce, useInstanceId, usePrevious } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\n\n/**\n * Internal dependencies\n */\nimport Token from './token';\nimport TokenInput from './token-input';\nimport { TokensAndInputWrapperFlex } from './styles';\nimport SuggestionsList from './suggestions-list';\nimport type { FormTokenFieldProps, TokenItem } from './types';\nimport { FlexItem } from '../flex';\nimport {\n\tStyledHelp,\n\tStyledLabel,\n} from '../base-control/styles/base-control-styles';\nimport { Spacer } from '../spacer';\nimport { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props';\nimport { withIgnoreIMEEvents } from '../utils/with-ignore-ime-events';\n\nconst identity = ( value: string ) => value;\n\n/**\n * A `FormTokenField` is a field similar to the tags and categories fields in the interim editor chrome,\n * or the \"to\" field in Mail on OS X. Tokens can be entered by typing them or selecting them from a list of suggested tokens.\n *\n * Up to one hundred suggestions that match what the user has typed so far will be shown from which the user can pick from (auto-complete).\n * Tokens are separated by the \",\" character. Suggestions can be selected with the up or down arrows and added with the tab or enter key.\n *\n * The `value` property is handled in a manner similar to controlled form components.\n * See [Forms](https://react.dev/reference/react-dom/components#form-components) in the React Documentation for more information.\n */\nexport function FormTokenField( props: FormTokenFieldProps ) {\n\tconst {\n\t\tautoCapitalize,\n\t\tautoComplete,\n\t\tmaxLength,\n\t\tplaceholder,\n\t\tlabel = __( 'Add item' ),\n\t\tclassName,\n\t\tsuggestions = [],\n\t\tmaxSuggestions = 100,\n\t\tvalue = [],\n\t\tdisplayTransform = identity,\n\t\tsaveTransform = ( token ) => token.trim(),\n\t\tonChange = () => {},\n\t\tonInputChange = () => {},\n\t\tonFocus = undefined,\n\t\tisBorderless = false,\n\t\tdisabled = false,\n\t\ttokenizeOnSpace = false,\n\t\tmessages = {\n\t\t\tadded: __( 'Item added.' ),\n\t\t\tremoved: __( 'Item removed.' ),\n\t\t\tremove: __( 'Remove item' ),\n\t\t\t__experimentalInvalid: __( 'Invalid item' ),\n\t\t},\n\t\t__experimentalRenderItem,\n\t\t__experimentalExpandOnFocus = false,\n\t\t__experimentalValidateInput = () => true,\n\t\t__experimentalShowHowTo = true,\n\t\t__next40pxDefaultSize = false,\n\t\t__experimentalAutoSelectFirstMatch = false,\n\t\t__nextHasNoMarginBottom = false,\n\t\ttokenizeOnBlur = false,\n\t} = useDeprecated36pxDefaultSizeProp< FormTokenFieldProps >( props );\n\n\tconst instanceId = useInstanceId( FormTokenField );\n\n\t// We reset to these initial values again in the onBlur\n\tconst [ incompleteTokenValue, setIncompleteTokenValue ] = useState( '' );\n\tconst [ inputOffsetFromEnd, setInputOffsetFromEnd ] = useState( 0 );\n\tconst [ isActive, setIsActive ] = useState( false );\n\tconst [ isExpanded, setIsExpanded ] = useState( false );\n\tconst [ selectedSuggestionIndex, setSelectedSuggestionIndex ] =\n\t\tuseState( -1 );\n\tconst [ selectedSuggestionScroll, setSelectedSuggestionScroll ] =\n\t\tuseState( false );\n\n\tconst prevSuggestions = usePrevious< string[] >( suggestions );\n\tconst prevValue = usePrevious< ( string | TokenItem )[] >( value );\n\n\tconst input = useRef< HTMLInputElement >( null );\n\tconst tokensAndInput = useRef< HTMLInputElement >( null );\n\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\n\tuseEffect( () => {\n\t\t// Make sure to focus the input when the isActive state is true.\n\t\tif ( isActive && ! hasFocus() ) {\n\t\t\tfocus();\n\t\t}\n\t}, [ isActive ] );\n\n\tuseEffect( () => {\n\t\tconst suggestionsDidUpdate = ! isShallowEqual(\n\t\t\tsuggestions,\n\t\t\tprevSuggestions || []\n\t\t);\n\n\t\tif ( suggestionsDidUpdate || value !== prevValue ) {\n\t\t\tupdateSuggestions( suggestionsDidUpdate );\n\t\t}\n\n\t\t// TODO: updateSuggestions() should first be refactored so its actual deps are clearer.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ suggestions, prevSuggestions, value, prevValue ] );\n\n\tuseEffect( () => {\n\t\tupdateSuggestions();\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ incompleteTokenValue ] );\n\n\tuseEffect( () => {\n\t\tupdateSuggestions();\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ __experimentalAutoSelectFirstMatch ] );\n\n\tif ( disabled && isActive ) {\n\t\tsetIsActive( false );\n\t\tsetIncompleteTokenValue( '' );\n\t}\n\n\tfunction focus() {\n\t\tinput.current?.focus();\n\t}\n\n\tfunction hasFocus() {\n\t\treturn input.current === input.current?.ownerDocument.activeElement;\n\t}\n\n\tfunction onFocusHandler( event: FocusEvent ) {\n\t\t// If focus is on the input or on the container, set the isActive state to true.\n\t\tif ( hasFocus() || event.target === tokensAndInput.current ) {\n\t\t\tsetIsActive( true );\n\t\t\tsetIsExpanded( __experimentalExpandOnFocus || isExpanded );\n\t\t} else {\n\t\t\t/*\n\t\t\t * Otherwise, focus is on one of the token \"remove\" buttons and we\n\t\t\t * set the isActive state to false to prevent the input to be\n\t\t\t * re-focused, see componentDidUpdate().\n\t\t\t */\n\t\t\tsetIsActive( false );\n\t\t}\n\n\t\tif ( 'function' === typeof onFocus ) {\n\t\t\tonFocus( event );\n\t\t}\n\t}\n\n\tfunction onBlur( event: FocusEvent ) {\n\t\tif (\n\t\t\tinputHasValidValue() &&\n\t\t\t__experimentalValidateInput( incompleteTokenValue )\n\t\t) {\n\t\t\tsetIsActive( false );\n\t\t\tif ( tokenizeOnBlur && inputHasValidValue() ) {\n\t\t\t\taddNewToken( incompleteTokenValue );\n\t\t\t}\n\t\t} else {\n\t\t\t// Reset to initial state\n\t\t\tsetIncompleteTokenValue( '' );\n\t\t\tsetInputOffsetFromEnd( 0 );\n\t\t\tsetIsActive( false );\n\n\t\t\tif ( __experimentalExpandOnFocus ) {\n\t\t\t\t// If `__experimentalExpandOnFocus` is true, don't close the suggestions list when\n\t\t\t\t// the user clicks on it (`tokensAndInput` will be the element that caused the blur).\n\t\t\t\tconst hasFocusWithin =\n\t\t\t\t\tevent.relatedTarget === tokensAndInput.current;\n\t\t\t\tsetIsExpanded( hasFocusWithin );\n\t\t\t} else {\n\t\t\t\t// Else collapse the suggestion list. This will result in the suggestion list closing\n\t\t\t\t// after a suggestion has been submitted since that causes a blur.\n\t\t\t\tsetIsExpanded( false );\n\t\t\t}\n\n\t\t\tsetSelectedSuggestionIndex( -1 );\n\t\t\tsetSelectedSuggestionScroll( false );\n\t\t}\n\t}\n\n\tfunction onKeyDown( event: KeyboardEvent ) {\n\t\tlet preventDefault = false;\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\t\tswitch ( event.key ) {\n\t\t\tcase 'Backspace':\n\t\t\t\tpreventDefault = handleDeleteKey( deleteTokenBeforeInput );\n\t\t\t\tbreak;\n\t\t\tcase 'Enter':\n\t\t\t\tpreventDefault = addCurrentToken();\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowLeft':\n\t\t\t\tpreventDefault = handleLeftArrowKey();\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowUp':\n\t\t\t\tpreventDefault = handleUpArrowKey();\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowRight':\n\t\t\t\tpreventDefault = handleRightArrowKey();\n\t\t\t\tbreak;\n\t\t\tcase 'ArrowDown':\n\t\t\t\tpreventDefault = handleDownArrowKey();\n\t\t\t\tbreak;\n\t\t\tcase 'Delete':\n\t\t\t\tpreventDefault = handleDeleteKey( deleteTokenAfterInput );\n\t\t\t\tbreak;\n\t\t\tcase 'Space':\n\t\t\t\tif ( tokenizeOnSpace ) {\n\t\t\t\t\tpreventDefault = addCurrentToken();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Escape':\n\t\t\t\tpreventDefault = handleEscapeKey( event );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n\n\tfunction onKeyPress( event: KeyboardEvent ) {\n\t\tlet preventDefault = false;\n\n\t\tswitch ( event.key ) {\n\t\t\tcase ',':\n\t\t\t\tpreventDefault = handleCommaKey();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( preventDefault ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n\n\tfunction onContainerTouched( event: MouseEvent | TouchEvent ) {\n\t\t// Prevent clicking/touching the tokensAndInput container from blurring\n\t\t// the input and adding the current token.\n\t\tif ( event.target === tokensAndInput.current && isActive ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n\n\tfunction onTokenClickRemove( event: { value: string } ) {\n\t\tdeleteToken( event.value );\n\t\tfocus();\n\t}\n\n\tfunction onSuggestionHovered( suggestion: string ) {\n\t\tconst index = getMatchingSuggestions().indexOf( suggestion );\n\n\t\tif ( index >= 0 ) {\n\t\t\tsetSelectedSuggestionIndex( index );\n\t\t\tsetSelectedSuggestionScroll( false );\n\t\t}\n\t}\n\n\tfunction onSuggestionSelected( suggestion: string ) {\n\t\taddNewToken( suggestion );\n\t}\n\n\tfunction onInputChangeHandler( event: { value: string } ) {\n\t\tconst text = event.value;\n\t\tconst separator = tokenizeOnSpace ? /[ ,\\t]+/ : /[,\\t]+/;\n\t\tconst items = text.split( separator );\n\t\tconst tokenValue = items[ items.length - 1 ] || '';\n\n\t\tif ( items.length > 1 ) {\n\t\t\taddNewTokens( items.slice( 0, -1 ) );\n\t\t}\n\t\tsetIncompleteTokenValue( tokenValue );\n\t\tonInputChange( tokenValue );\n\t}\n\n\tfunction handleDeleteKey( _deleteToken: () => void ) {\n\t\tlet preventDefault = false;\n\t\tif ( hasFocus() && isInputEmpty() ) {\n\t\t\t_deleteToken();\n\t\t\tpreventDefault = true;\n\t\t}\n\n\t\treturn preventDefault;\n\t}\n\n\tfunction handleLeftArrowKey() {\n\t\tlet preventDefault = false;\n\t\tif ( isInputEmpty() ) {\n\t\t\tmoveInputBeforePreviousToken();\n\t\t\tpreventDefault = true;\n\t\t}\n\n\t\treturn preventDefault;\n\t}\n\n\tfunction handleRightArrowKey() {\n\t\tlet preventDefault = false;\n\t\tif ( isInputEmpty() ) {\n\t\t\tmoveInputAfterNextToken();\n\t\t\tpreventDefault = true;\n\t\t}\n\n\t\treturn preventDefault;\n\t}\n\n\tfunction handleUpArrowKey() {\n\t\tsetSelectedSuggestionIndex( ( index ) => {\n\t\t\treturn (\n\t\t\t\t( index === 0\n\t\t\t\t\t? getMatchingSuggestions(\n\t\t\t\t\t\t\tincompleteTokenValue,\n\t\t\t\t\t\t\tsuggestions,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\tmaxSuggestions,\n\t\t\t\t\t\t\tsaveTransform\n\t\t\t\t\t ).length\n\t\t\t\t\t: index ) - 1\n\t\t\t);\n\t\t} );\n\t\tsetSelectedSuggestionScroll( true );\n\n\t\treturn true; // PreventDefault.\n\t}\n\n\tfunction handleDownArrowKey() {\n\t\tsetSelectedSuggestionIndex( ( index ) => {\n\t\t\treturn (\n\t\t\t\t( index + 1 ) %\n\t\t\t\tgetMatchingSuggestions(\n\t\t\t\t\tincompleteTokenValue,\n\t\t\t\t\tsuggestions,\n\t\t\t\t\tvalue,\n\t\t\t\t\tmaxSuggestions,\n\t\t\t\t\tsaveTransform\n\t\t\t\t).length\n\t\t\t);\n\t\t} );\n\n\t\tsetSelectedSuggestionScroll( true );\n\t\treturn true; // PreventDefault.\n\t}\n\n\tfunction handleEscapeKey( event: KeyboardEvent ) {\n\t\tif ( event.target instanceof HTMLInputElement ) {\n\t\t\tsetIncompleteTokenValue( event.target.value );\n\t\t\tsetIsExpanded( false );\n\t\t\tsetSelectedSuggestionIndex( -1 );\n\t\t\tsetSelectedSuggestionScroll( false );\n\t\t}\n\n\t\treturn true; // PreventDefault.\n\t}\n\n\tfunction handleCommaKey() {\n\t\tif ( inputHasValidValue() ) {\n\t\t\taddNewToken( incompleteTokenValue );\n\t\t}\n\n\t\treturn true; // PreventDefault.\n\t}\n\n\tfunction moveInputToIndex( index: number ) {\n\t\tsetInputOffsetFromEnd( value.length - Math.max( index, -1 ) - 1 );\n\t}\n\n\tfunction moveInputBeforePreviousToken() {\n\t\tsetInputOffsetFromEnd( ( prevInputOffsetFromEnd ) => {\n\t\t\treturn Math.min( prevInputOffsetFromEnd + 1, value.length );\n\t\t} );\n\t}\n\n\tfunction moveInputAfterNextToken() {\n\t\tsetInputOffsetFromEnd( ( prevInputOffsetFromEnd ) => {\n\t\t\treturn Math.max( prevInputOffsetFromEnd - 1, 0 );\n\t\t} );\n\t}\n\n\tfunction deleteTokenBeforeInput() {\n\t\tconst index = getIndexOfInput() - 1;\n\n\t\tif ( index > -1 ) {\n\t\t\tdeleteToken( value[ index ] );\n\t\t}\n\t}\n\n\tfunction deleteTokenAfterInput() {\n\t\tconst index = getIndexOfInput();\n\n\t\tif ( index < value.length ) {\n\t\t\tdeleteToken( value[ index ] );\n\t\t\t// Update input offset since it's the offset from the last token.\n\t\t\tmoveInputToIndex( index );\n\t\t}\n\t}\n\n\tfunction addCurrentToken() {\n\t\tlet preventDefault = false;\n\t\tconst selectedSuggestion = getSelectedSuggestion();\n\n\t\tif ( selectedSuggestion ) {\n\t\t\taddNewToken( selectedSuggestion );\n\t\t\tpreventDefault = true;\n\t\t} else if ( inputHasValidValue() ) {\n\t\t\taddNewToken( incompleteTokenValue );\n\t\t\tpreventDefault = true;\n\t\t}\n\n\t\treturn preventDefault;\n\t}\n\n\tfunction addNewTokens( tokens: string[] ) {\n\t\tconst tokensToAdd = [\n\t\t\t...new Set(\n\t\t\t\ttokens\n\t\t\t\t\t.map( saveTransform )\n\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t.filter( ( token ) => ! valueContainsToken( token ) )\n\t\t\t),\n\t\t];\n\n\t\tif ( tokensToAdd.length > 0 ) {\n\t\t\tconst newValue = [ ...value ];\n\t\t\tnewValue.splice( getIndexOfInput(), 0, ...tokensToAdd );\n\t\t\tonChange( newValue );\n\t\t}\n\t}\n\n\tfunction addNewToken( token: string ) {\n\t\tif ( ! __experimentalValidateInput( token ) ) {\n\t\t\tspeak( messages.__experimentalInvalid, 'assertive' );\n\t\t\treturn;\n\t\t}\n\t\taddNewTokens( [ token ] );\n\t\tspeak( messages.added, 'assertive' );\n\n\t\tsetIncompleteTokenValue( '' );\n\t\tsetSelectedSuggestionIndex( -1 );\n\t\tsetSelectedSuggestionScroll( false );\n\t\tsetIsExpanded( ! __experimentalExpandOnFocus );\n\n\t\tif ( isActive && ! tokenizeOnBlur ) {\n\t\t\tfocus();\n\t\t}\n\t}\n\n\tfunction deleteToken( token: string | TokenItem ) {\n\t\tconst newTokens = value.filter( ( item ) => {\n\t\t\treturn getTokenValue( item ) !== getTokenValue( token );\n\t\t} );\n\t\tonChange( newTokens );\n\t\tspeak( messages.removed, 'assertive' );\n\t}\n\n\tfunction getTokenValue( token: { value: string } | string ) {\n\t\tif ( 'object' === typeof token ) {\n\t\t\treturn token.value;\n\t\t}\n\n\t\treturn token;\n\t}\n\n\tfunction getMatchingSuggestions(\n\t\tsearchValue = incompleteTokenValue,\n\t\t_suggestions = suggestions,\n\t\t_value = value,\n\t\t_maxSuggestions = maxSuggestions,\n\t\t_saveTransform = saveTransform\n\t) {\n\t\tlet match = _saveTransform( searchValue );\n\t\tconst startsWithMatch: string[] = [];\n\t\tconst containsMatch: string[] = [];\n\t\tconst normalizedValue = _value.map( ( item ) => {\n\t\t\tif ( typeof item === 'string' ) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\treturn item.value;\n\t\t} );\n\n\t\tif ( match.length === 0 ) {\n\t\t\t_suggestions = _suggestions.filter(\n\t\t\t\t( suggestion ) => ! normalizedValue.includes( suggestion )\n\t\t\t);\n\t\t} else {\n\t\t\tmatch = match.toLocaleLowerCase();\n\n\t\t\t_suggestions.forEach( ( suggestion ) => {\n\t\t\t\tconst index = suggestion.toLocaleLowerCase().indexOf( match );\n\t\t\t\tif ( normalizedValue.indexOf( suggestion ) === -1 ) {\n\t\t\t\t\tif ( index === 0 ) {\n\t\t\t\t\t\tstartsWithMatch.push( suggestion );\n\t\t\t\t\t} else if ( index > 0 ) {\n\t\t\t\t\t\tcontainsMatch.push( suggestion );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t_suggestions = startsWithMatch.concat( containsMatch );\n\t\t}\n\n\t\treturn _suggestions.slice( 0, _maxSuggestions );\n\t}\n\n\tfunction getSelectedSuggestion() {\n\t\tif ( selectedSuggestionIndex !== -1 ) {\n\t\t\treturn getMatchingSuggestions()[ selectedSuggestionIndex ];\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tfunction valueContainsToken( token: string ) {\n\t\treturn value.some( ( item ) => {\n\t\t\treturn getTokenValue( token ) === getTokenValue( item );\n\t\t} );\n\t}\n\n\tfunction getIndexOfInput() {\n\t\treturn value.length - inputOffsetFromEnd;\n\t}\n\n\tfunction isInputEmpty() {\n\t\treturn incompleteTokenValue.length === 0;\n\t}\n\n\tfunction inputHasValidValue() {\n\t\treturn saveTransform( incompleteTokenValue ).length > 0;\n\t}\n\n\tfunction updateSuggestions( resetSelectedSuggestion = true ) {\n\t\tconst inputHasMinimumChars = incompleteTokenValue.trim().length > 1;\n\t\tconst matchingSuggestions =\n\t\t\tgetMatchingSuggestions( incompleteTokenValue );\n\t\tconst hasMatchingSuggestions = matchingSuggestions.length > 0;\n\n\t\tconst shouldExpandIfFocuses = hasFocus() && __experimentalExpandOnFocus;\n\t\tsetIsExpanded(\n\t\t\tshouldExpandIfFocuses ||\n\t\t\t\t( inputHasMinimumChars && hasMatchingSuggestions )\n\t\t);\n\n\t\tif ( resetSelectedSuggestion ) {\n\t\t\tif (\n\t\t\t\t__experimentalAutoSelectFirstMatch &&\n\t\t\t\tinputHasMinimumChars &&\n\t\t\t\thasMatchingSuggestions\n\t\t\t) {\n\t\t\t\tsetSelectedSuggestionIndex( 0 );\n\t\t\t\tsetSelectedSuggestionScroll( true );\n\t\t\t} else {\n\t\t\t\tsetSelectedSuggestionIndex( -1 );\n\t\t\t\tsetSelectedSuggestionScroll( false );\n\t\t\t}\n\t\t}\n\n\t\tif ( inputHasMinimumChars ) {\n\t\t\tconst message = hasMatchingSuggestions\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t_n(\n\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'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\tmatchingSuggestions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmatchingSuggestions.length\n\t\t\t\t )\n\t\t\t\t: __( 'No results.' );\n\n\t\t\tdebouncedSpeak( message, 'assertive' );\n\t\t}\n\t}\n\n\tfunction renderTokensAndInput() {\n\t\tconst components = value.map( renderToken );\n\t\tcomponents.splice( getIndexOfInput(), 0, renderInput() );\n\n\t\treturn components;\n\t}\n\n\tfunction renderToken(\n\t\ttoken: string | TokenItem,\n\t\tindex: number,\n\t\ttokens: ( string | TokenItem )[]\n\t) {\n\t\tconst _value = getTokenValue( token );\n\t\tconst status = typeof token !== 'string' ? token.status : undefined;\n\t\tconst termPosition = index + 1;\n\t\tconst termsCount = tokens.length;\n\n\t\treturn (\n\t\t\t<FlexItem key={ 'token-' + _value }>\n\t\t\t\t<Token\n\t\t\t\t\tvalue={ _value }\n\t\t\t\t\tstatus={ status }\n\t\t\t\t\ttitle={\n\t\t\t\t\t\ttypeof token !== 'string' ? token.title : undefined\n\t\t\t\t\t}\n\t\t\t\t\tdisplayTransform={ displayTransform }\n\t\t\t\t\tonClickRemove={ onTokenClickRemove }\n\t\t\t\t\tisBorderless={\n\t\t\t\t\t\t( typeof token !== 'string' && token.isBorderless ) ||\n\t\t\t\t\t\tisBorderless\n\t\t\t\t\t}\n\t\t\t\t\tonMouseEnter={\n\t\t\t\t\t\ttypeof token !== 'string'\n\t\t\t\t\t\t\t? token.onMouseEnter\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tonMouseLeave={\n\t\t\t\t\t\ttypeof token !== 'string'\n\t\t\t\t\t\t\t? token.onMouseLeave\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t\tdisabled={ 'error' !== status && disabled }\n\t\t\t\t\tmessages={ messages }\n\t\t\t\t\ttermsCount={ termsCount }\n\t\t\t\t\ttermPosition={ termPosition }\n\t\t\t\t/>\n\t\t\t</FlexItem>\n\t\t);\n\t}\n\n\tfunction renderInput() {\n\t\tconst inputProps = {\n\t\t\tinstanceId,\n\t\t\tautoCapitalize,\n\t\t\tautoComplete,\n\t\t\tplaceholder: value.length === 0 ? placeholder : '',\n\t\t\tkey: 'input',\n\t\t\tdisabled,\n\t\t\tvalue: incompleteTokenValue,\n\t\t\tonBlur,\n\t\t\tisExpanded,\n\t\t\tselectedSuggestionIndex,\n\t\t};\n\n\t\treturn (\n\t\t\t<TokenInput\n\t\t\t\t{ ...inputProps }\n\t\t\t\tonChange={\n\t\t\t\t\t! ( maxLength && value.length >= maxLength )\n\t\t\t\t\t\t? onInputChangeHandler\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tref={ input }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst classes = clsx(\n\t\tclassName,\n\t\t'components-form-token-field__input-container',\n\t\t{\n\t\t\t'is-active': isActive,\n\t\t\t'is-disabled': disabled,\n\t\t}\n\t);\n\n\tlet tokenFieldProps = {\n\t\tclassName: 'components-form-token-field',\n\t\ttabIndex: -1,\n\t};\n\tconst matchingSuggestions = getMatchingSuggestions();\n\n\tif ( ! disabled ) {\n\t\ttokenFieldProps = Object.assign( {}, tokenFieldProps, {\n\t\t\tonKeyDown: withIgnoreIMEEvents( onKeyDown ),\n\t\t\tonKeyPress,\n\t\t\tonFocus: onFocusHandler,\n\t\t} );\n\t}\n\n\t// Disable reason: There is no appropriate role which describes the\n\t// input container intended accessible usability.\n\t// TODO: Refactor click detection to use blur to stop propagation.\n\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\treturn (\n\t\t<div { ...tokenFieldProps }>\n\t\t\t{ label && (\n\t\t\t\t<StyledLabel\n\t\t\t\t\thtmlFor={ `components-form-token-input-${ instanceId }` }\n\t\t\t\t\tclassName=\"components-form-token-field__label\"\n\t\t\t\t>\n\t\t\t\t\t{ label }\n\t\t\t\t</StyledLabel>\n\t\t\t) }\n\t\t\t<div\n\t\t\t\tref={ tokensAndInput }\n\t\t\t\tclassName={ classes }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t\tonMouseDown={ onContainerTouched }\n\t\t\t\tonTouchStart={ onContainerTouched }\n\t\t\t>\n\t\t\t\t<TokensAndInputWrapperFlex\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tgap={ 1 }\n\t\t\t\t\twrap\n\t\t\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\t\t\thasTokens={ !! value.length }\n\t\t\t\t>\n\t\t\t\t\t{ renderTokensAndInput() }\n\t\t\t\t</TokensAndInputWrapperFlex>\n\t\t\t\t{ isExpanded && (\n\t\t\t\t\t<SuggestionsList\n\t\t\t\t\t\tinstanceId={ instanceId }\n\t\t\t\t\t\tmatch={ saveTransform( incompleteTokenValue ) }\n\t\t\t\t\t\tdisplayTransform={ displayTransform }\n\t\t\t\t\t\tsuggestions={ matchingSuggestions }\n\t\t\t\t\t\tselectedIndex={ selectedSuggestionIndex }\n\t\t\t\t\t\tscrollIntoView={ selectedSuggestionScroll }\n\t\t\t\t\t\tonHover={ onSuggestionHovered }\n\t\t\t\t\t\tonSelect={ onSuggestionSelected }\n\t\t\t\t\t\t__experimentalRenderItem={ __experimentalRenderItem }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t{ ! __nextHasNoMarginBottom && <Spacer marginBottom={ 2 } /> }\n\t\t\t{ __experimentalShowHowTo && (\n\t\t\t\t<StyledHelp\n\t\t\t\t\tid={ `components-form-token-suggestions-howto-${ instanceId }` }\n\t\t\t\t\tclassName=\"components-form-token-field__help\"\n\t\t\t\t\t__nextHasNoMarginBottom={ __nextHasNoMarginBottom }\n\t\t\t\t>\n\t\t\t\t\t{ tokenizeOnSpace\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'Separate with commas, spaces, or the Enter key.'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Separate with commas or the Enter key.' ) }\n\t\t\t\t</StyledHelp>\n\t\t\t) }\n\t\t</div>\n\t);\n\t/* eslint-enable jsx-a11y/no-static-element-interactions */\n}\n\nexport default FormTokenField;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB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AAa,EAAGlI,uBAAyB;IACzCmI,cAAc,EAAGjI,wBAA0B;IAC3CkI,OAAO,EAAG1F,mBAAqB;IAC/B2F,QAAQ,EAAGtF,oBAAsB;IACjChE,wBAAwB,EAAGA;EAA0B,CACrD,CAEE,CAAC,EACJ,CAAEM,uBAAuB,IAAIyH,aAAA,CAAC9J,MAAM;IAACsL,YAAY,EAAG;EAAG,CAAE,CAAC,EAC1DpJ,uBAAuB,IACxB4H,aAAA,CAAChK,UAAU;IACVyL,EAAE,EAAI,2CAA2ChJ,UAAY,EAAG;IAChE3B,SAAS,EAAC,mCAAmC;IAC7CyB,uBAAuB,EAAGA;EAAyB,GAEjDZ,eAAe,GACdxC,EAAE,CACF,iDACA,CAAC,GACDA,EAAE,CAAE,wCAAyC,CACrC,CAET,CAAC;EAEP;AACD;AAEA,eAAeoB,cAAc","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
@@ -74,8 +74,11 @@ export function SuggestionsList({
74
74
  role: "listbox"
75
75
  }, suggestions.map((suggestion, index) => {
76
76
  const matchText = computeSuggestionMatch(suggestion);
77
- const className = classnames('components-form-token-field__suggestion', {
78
- 'is-selected': index === selectedIndex
77
+ const isSelected = index === selectedIndex;
78
+ const isDisabled = typeof suggestion === 'object' && suggestion?.disabled;
79
+ const key = typeof suggestion === 'object' && 'value' in suggestion ? suggestion?.value : displayTransform(suggestion);
80
+ const className = clsx('components-form-token-field__suggestion', {
81
+ 'is-selected': isSelected
79
82
  });
80
83
  let output;
81
84
  if (typeof __experimentalRenderItem === 'function') {
@@ -97,11 +100,12 @@ export function SuggestionsList({
97
100
  id: `components-form-token-suggestions-${instanceId}-${index}`,
98
101
  role: "option",
99
102
  className: className,
100
- key: typeof suggestion === 'object' && 'value' in suggestion ? suggestion?.value : displayTransform(suggestion),
103
+ key: key,
101
104
  onMouseDown: handleMouseDown,
102
105
  onClick: handleClick(suggestion),
103
106
  onMouseEnter: handleHover(suggestion),
104
- "aria-selected": index === selectedIndex
107
+ "aria-selected": index === selectedIndex,
108
+ "aria-disabled": isDisabled
105
109
  }, output);
106
110
  /* eslint-enable jsx-a11y/click-events-have-key-events */
107
111
  }));
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useRefEffect","handleMouseDown","e","preventDefault","SuggestionsList","selectedIndex","scrollIntoView","match","onHover","onSelect","suggestions","displayTransform","instanceId","__experimentalRenderItem","listRef","listNode","rafId","children","behavior","block","inline","undefined","cancelAnimationFrame","handleHover","suggestion","handleClick","computeSuggestionMatch","matchText","toLocaleLowerCase","length","transformedSuggestion","indexOfMatch","indexOf","suggestionBeforeMatch","substring","suggestionMatch","suggestionAfterMatch","createElement","ref","className","id","role","map","index","output","item","key","value","onMouseDown","onClick","onMouseEnter"],"sources":["@wordpress/components/src/form-token-field/suggestions-list.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { MouseEventHandler, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { SuggestionsListProps } from './types';\n\nconst handleMouseDown: MouseEventHandler = ( e ) => {\n\t// By preventing default here, we will not lose focus of <input> when clicking a suggestion.\n\te.preventDefault();\n};\n\nexport function SuggestionsList< T extends string | { value: string } >( {\n\tselectedIndex,\n\tscrollIntoView,\n\tmatch,\n\tonHover,\n\tonSelect,\n\tsuggestions = [],\n\tdisplayTransform,\n\tinstanceId,\n\t__experimentalRenderItem,\n}: SuggestionsListProps< T > ) {\n\tconst listRef = useRefEffect< HTMLUListElement >(\n\t\t( listNode ) => {\n\t\t\t// only have to worry about scrolling selected suggestion into view\n\t\t\t// when already expanded.\n\t\t\tlet rafId: number | undefined;\n\t\t\tif (\n\t\t\t\tselectedIndex > -1 &&\n\t\t\t\tscrollIntoView &&\n\t\t\t\tlistNode.children[ selectedIndex ]\n\t\t\t) {\n\t\t\t\tlistNode.children[ selectedIndex ].scrollIntoView( {\n\t\t\t\t\tbehavior: 'instant',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'nearest',\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\tif ( rafId !== undefined ) {\n\t\t\t\t\tcancelAnimationFrame( rafId );\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\t[ selectedIndex, scrollIntoView ]\n\t);\n\n\tconst handleHover = ( suggestion: T ) => {\n\t\treturn () => {\n\t\t\tonHover?.( suggestion );\n\t\t};\n\t};\n\n\tconst handleClick = ( suggestion: T ) => {\n\t\treturn () => {\n\t\t\tonSelect?.( suggestion );\n\t\t};\n\t};\n\n\tconst computeSuggestionMatch = ( suggestion: T ) => {\n\t\tconst matchText = displayTransform( match ).toLocaleLowerCase();\n\t\tif ( matchText.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst transformedSuggestion = displayTransform( suggestion );\n\t\tconst indexOfMatch = transformedSuggestion\n\t\t\t.toLocaleLowerCase()\n\t\t\t.indexOf( matchText );\n\n\t\treturn {\n\t\t\tsuggestionBeforeMatch: transformedSuggestion.substring(\n\t\t\t\t0,\n\t\t\t\tindexOfMatch\n\t\t\t),\n\t\t\tsuggestionMatch: transformedSuggestion.substring(\n\t\t\t\tindexOfMatch,\n\t\t\t\tindexOfMatch + matchText.length\n\t\t\t),\n\t\t\tsuggestionAfterMatch: transformedSuggestion.substring(\n\t\t\t\tindexOfMatch + matchText.length\n\t\t\t),\n\t\t};\n\t};\n\n\treturn (\n\t\t<ul\n\t\t\tref={ listRef }\n\t\t\tclassName=\"components-form-token-field__suggestions-list\"\n\t\t\tid={ `components-form-token-suggestions-${ instanceId }` }\n\t\t\trole=\"listbox\"\n\t\t>\n\t\t\t{ suggestions.map( ( suggestion, index ) => {\n\t\t\t\tconst matchText = computeSuggestionMatch( suggestion );\n\t\t\t\tconst className = classnames(\n\t\t\t\t\t'components-form-token-field__suggestion',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-selected': index === selectedIndex,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tlet output: ReactNode;\n\n\t\t\t\tif ( typeof __experimentalRenderItem === 'function' ) {\n\t\t\t\t\toutput = __experimentalRenderItem( { item: suggestion } );\n\t\t\t\t} else if ( matchText ) {\n\t\t\t\t\toutput = (\n\t\t\t\t\t\t<span aria-label={ displayTransform( suggestion ) }>\n\t\t\t\t\t\t\t{ matchText.suggestionBeforeMatch }\n\t\t\t\t\t\t\t<strong className=\"components-form-token-field__suggestion-match\">\n\t\t\t\t\t\t\t\t{ matchText.suggestionMatch }\n\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t{ matchText.suggestionAfterMatch }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\toutput = displayTransform( suggestion );\n\t\t\t\t}\n\n\t\t\t\t/* eslint-disable jsx-a11y/click-events-have-key-events */\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tid={ `components-form-token-suggestions-${ instanceId }-${ index }` }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tkey={\n\t\t\t\t\t\t\ttypeof suggestion === 'object' &&\n\t\t\t\t\t\t\t'value' in suggestion\n\t\t\t\t\t\t\t\t? suggestion?.value\n\t\t\t\t\t\t\t\t: displayTransform( suggestion )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonMouseDown={ handleMouseDown }\n\t\t\t\t\t\tonClick={ handleClick( suggestion ) }\n\t\t\t\t\t\tonMouseEnter={ handleHover( suggestion ) }\n\t\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ output }\n\t\t\t\t\t</li>\n\t\t\t\t);\n\t\t\t\t/* eslint-enable jsx-a11y/click-events-have-key-events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AACM,qBAAqB,EACjCI,aAAA;QAAQE,SAAS,EAAC;MAA+C,GAC9DZ,SAAS,CAACQ,eACL,CAAC,EACPR,SAAS,CAACS,oBACP,CACN;IACF,CAAC,MAAM;MACNQ,MAAM,GAAGjC,gBAAgB,CAAEa,UAAW,CAAC;IACxC;;IAEA;IACA,OACCa,aAAA;MACCG,EAAE,EAAI,qCAAqC5B,UAAY,IAAI+B,KAAO,EAAG;MACrEF,IAAI,EAAC,QAAQ;MACbF,SAAS,EAAGA,SAAW;MACvBO,GAAG,EACF,OAAOtB,UAAU,KAAK,QAAQ,IAC9B,OAAO,IAAIA,UAAU,GAClBA,UAAU,EAAEuB,KAAK,GACjBpC,gBAAgB,CAAEa,UAAW,CAChC;MACDwB,WAAW,EAAG/C,eAAiB;MAC/BgD,OAAO,EAAGxB,WAAW,CAAED,UAAW,CAAG;MACrC0B,YAAY,EAAG3B,WAAW,CAAEC,UAAW,CAAG;MAC1C,iBAAgBmB,KAAK,KAAKtC;IAAe,GAEvCuC,MACC,CAAC;IAEN;EACD,CAAE,CACC,CAAC;AAEP;AAEA,eAAexC,eAAe","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useRefEffect","handleMouseDown","e","preventDefault","SuggestionsList","selectedIndex","scrollIntoView","match","onHover","onSelect","suggestions","displayTransform","instanceId","__experimentalRenderItem","listRef","listNode","rafId","children","behavior","block","inline","undefined","cancelAnimationFrame","handleHover","suggestion","handleClick","computeSuggestionMatch","matchText","toLocaleLowerCase","length","transformedSuggestion","indexOfMatch","indexOf","suggestionBeforeMatch","substring","suggestionMatch","suggestionAfterMatch","createElement","ref","className","id","role","map","index","isSelected","isDisabled","disabled","key","value","output","item","onMouseDown","onClick","onMouseEnter"],"sources":["@wordpress/components/src/form-token-field/suggestions-list.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { MouseEventHandler, ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport type { SuggestionsListProps } from './types';\n\nconst handleMouseDown: MouseEventHandler = ( e ) => {\n\t// By preventing default here, we will not lose focus of <input> when clicking a suggestion.\n\te.preventDefault();\n};\n\nexport function SuggestionsList<\n\tT extends string | { value: string; disabled?: boolean },\n>( {\n\tselectedIndex,\n\tscrollIntoView,\n\tmatch,\n\tonHover,\n\tonSelect,\n\tsuggestions = [],\n\tdisplayTransform,\n\tinstanceId,\n\t__experimentalRenderItem,\n}: SuggestionsListProps< T > ) {\n\tconst listRef = useRefEffect< HTMLUListElement >(\n\t\t( listNode ) => {\n\t\t\t// only have to worry about scrolling selected suggestion into view\n\t\t\t// when already expanded.\n\t\t\tlet rafId: number | undefined;\n\t\t\tif (\n\t\t\t\tselectedIndex > -1 &&\n\t\t\t\tscrollIntoView &&\n\t\t\t\tlistNode.children[ selectedIndex ]\n\t\t\t) {\n\t\t\t\tlistNode.children[ selectedIndex ].scrollIntoView( {\n\t\t\t\t\tbehavior: 'instant',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'nearest',\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\tif ( rafId !== undefined ) {\n\t\t\t\t\tcancelAnimationFrame( rafId );\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\t[ selectedIndex, scrollIntoView ]\n\t);\n\n\tconst handleHover = ( suggestion: T ) => {\n\t\treturn () => {\n\t\t\tonHover?.( suggestion );\n\t\t};\n\t};\n\n\tconst handleClick = ( suggestion: T ) => {\n\t\treturn () => {\n\t\t\tonSelect?.( suggestion );\n\t\t};\n\t};\n\n\tconst computeSuggestionMatch = ( suggestion: T ) => {\n\t\tconst matchText = displayTransform( match ).toLocaleLowerCase();\n\t\tif ( matchText.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst transformedSuggestion = displayTransform( suggestion );\n\t\tconst indexOfMatch = transformedSuggestion\n\t\t\t.toLocaleLowerCase()\n\t\t\t.indexOf( matchText );\n\n\t\treturn {\n\t\t\tsuggestionBeforeMatch: transformedSuggestion.substring(\n\t\t\t\t0,\n\t\t\t\tindexOfMatch\n\t\t\t),\n\t\t\tsuggestionMatch: transformedSuggestion.substring(\n\t\t\t\tindexOfMatch,\n\t\t\t\tindexOfMatch + matchText.length\n\t\t\t),\n\t\t\tsuggestionAfterMatch: transformedSuggestion.substring(\n\t\t\t\tindexOfMatch + matchText.length\n\t\t\t),\n\t\t};\n\t};\n\n\treturn (\n\t\t<ul\n\t\t\tref={ listRef }\n\t\t\tclassName=\"components-form-token-field__suggestions-list\"\n\t\t\tid={ `components-form-token-suggestions-${ instanceId }` }\n\t\t\trole=\"listbox\"\n\t\t>\n\t\t\t{ suggestions.map( ( suggestion, index ) => {\n\t\t\t\tconst matchText = computeSuggestionMatch( suggestion );\n\t\t\t\tconst isSelected = index === selectedIndex;\n\t\t\t\tconst isDisabled =\n\t\t\t\t\ttypeof suggestion === 'object' && suggestion?.disabled;\n\t\t\t\tconst key =\n\t\t\t\t\ttypeof suggestion === 'object' && 'value' in suggestion\n\t\t\t\t\t\t? suggestion?.value\n\t\t\t\t\t\t: displayTransform( suggestion );\n\n\t\t\t\tconst className = clsx(\n\t\t\t\t\t'components-form-token-field__suggestion',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tlet output: ReactNode;\n\n\t\t\t\tif ( typeof __experimentalRenderItem === 'function' ) {\n\t\t\t\t\toutput = __experimentalRenderItem( { item: suggestion } );\n\t\t\t\t} else if ( matchText ) {\n\t\t\t\t\toutput = (\n\t\t\t\t\t\t<span aria-label={ displayTransform( suggestion ) }>\n\t\t\t\t\t\t\t{ matchText.suggestionBeforeMatch }\n\t\t\t\t\t\t\t<strong className=\"components-form-token-field__suggestion-match\">\n\t\t\t\t\t\t\t\t{ matchText.suggestionMatch }\n\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t{ matchText.suggestionAfterMatch }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\toutput = displayTransform( suggestion );\n\t\t\t\t}\n\n\t\t\t\t/* eslint-disable jsx-a11y/click-events-have-key-events */\n\t\t\t\treturn (\n\t\t\t\t\t<li\n\t\t\t\t\t\tid={ `components-form-token-suggestions-${ instanceId }-${ index }` }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\tonMouseDown={ handleMouseDown }\n\t\t\t\t\t\tonClick={ handleClick( suggestion ) }\n\t\t\t\t\t\tonMouseEnter={ handleHover( suggestion ) }\n\t\t\t\t\t\taria-selected={ index === selectedIndex }\n\t\t\t\t\t\taria-disabled={ isDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ output }\n\t\t\t\t\t</li>\n\t\t\t\t);\n\t\t\t\t/* eslint-enable jsx-a11y/click-events-have-key-events */\n\t\t\t} ) }\n\t\t</ul>\n\t);\n}\n\nexport default SuggestionsList;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;;AAGA,MAAMC,eAAkC,GAAKC,CAAC,IAAM;EACnD;EACAA,CAAC,CAACC,cAAc,CAAC,CAAC;AACnB,CAAC;AAED,OAAO,SAASC,eAAeA,CAE5B;EACFC,aAAa;EACbC,cAAc;EACdC,KAAK;EACLC,OAAO;EACPC,QAAQ;EACRC,WAAW,GAAG,EAAE;EAChBC,gBAAgB;EAChBC,UAAU;EACVC;AAC0B,CAAC,EAAG;EAC9B,MAAMC,OAAO,GAAGd,YAAY,CACzBe,QAAQ,IAAM;IACf;IACA;IACA,IAAIC,KAAyB;IAC7B,IACCX,aAAa,GAAG,CAAC,CAAC,IAClBC,cAAc,IACdS,QAAQ,CAACE,QAAQ,CAAEZ,aAAa,C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AAiB;MAC/BmD,OAAO,EAAG3B,WAAW,CAAED,UAAW,CAAG;MACrC6B,YAAY,EAAG9B,WAAW,CAAEC,UAAW,CAAG;MAC1C,iBAAgBmB,KAAK,KAAKtC,aAAe;MACzC,iBAAgBwC;IAAY,GAE1BI,MACC,CAAC;IAEN;EACD,CAAE,CACC,CAAC;AAEP;AAEA,eAAe7C,eAAe","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
@@ -51,7 +51,7 @@ export function UnForwardedTokenInput(props, ref) {
51
51
  onFocus: onFocusHandler,
52
52
  onBlur: onBlurHandler,
53
53
  size: size,
54
- className: classnames(className, 'components-form-token-field__input'),
54
+ className: clsx(className, 'components-form-token-field__input'),
55
55
  autoComplete: "off",
56
56
  role: "combobox",
57
57
  "aria-expanded": isExpanded,
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","forwardRef","useState","UnForwardedTokenInput","props","ref","value","isExpanded","instanceId","selectedSuggestionIndex","className","onChange","onFocus","onBlur","restProps","hasFocus","setHasFocus","size","length","onChangeHandler","event","target","onFocusHandler","e","onBlurHandler","createElement","id","type","autoComplete","role","undefined","TokenInput"],"sources":["@wordpress/components/src/form-token-field/token-input.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ChangeEvent, ForwardedRef, FocusEventHandler } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { TokenInputProps } from './types';\n\nexport function UnForwardedTokenInput(\n\tprops: WordPressComponentProps< TokenInputProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\tvalue,\n\t\tisExpanded,\n\t\tinstanceId,\n\t\tselectedSuggestionIndex,\n\t\tclassName,\n\t\tonChange,\n\t\tonFocus,\n\t\tonBlur,\n\t\t...restProps\n\t} = props;\n\n\tconst [ hasFocus, setHasFocus ] = useState( false );\n\n\tconst size = value ? value.length + 1 : 0;\n\n\tconst onChangeHandler = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tif ( onChange ) {\n\t\t\tonChange( {\n\t\t\t\tvalue: event.target.value,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst onFocusHandler: FocusEventHandler< HTMLInputElement > = ( e ) => {\n\t\tsetHasFocus( true );\n\t\tonFocus?.( e );\n\t};\n\n\tconst onBlurHandler: FocusEventHandler< HTMLInputElement > = ( e ) => {\n\t\tsetHasFocus( false );\n\t\tonBlur?.( e );\n\t};\n\n\treturn (\n\t\t<input\n\t\t\tref={ ref }\n\t\t\tid={ `components-form-token-input-${ instanceId }` }\n\t\t\ttype=\"text\"\n\t\t\t{ ...restProps }\n\t\t\tvalue={ value || '' }\n\t\t\tonChange={ onChangeHandler }\n\t\t\tonFocus={ onFocusHandler }\n\t\t\tonBlur={ onBlurHandler }\n\t\t\tsize={ size }\n\t\t\tclassName={ classnames(\n\t\t\t\tclassName,\n\t\t\t\t'components-form-token-field__input'\n\t\t\t) }\n\t\t\tautoComplete=\"off\"\n\t\t\trole=\"combobox\"\n\t\t\taria-expanded={ isExpanded }\n\t\t\taria-autocomplete=\"list\"\n\t\t\taria-owns={\n\t\t\t\tisExpanded\n\t\t\t\t\t? `components-form-token-suggestions-${ instanceId }`\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\taria-activedescendant={\n\t\t\t\t// Only add the `aria-activedescendant` attribute when:\n\t\t\t\t// - the user is actively interacting with the input (`hasFocus`)\n\t\t\t\t// - there is a selected suggestion (`selectedSuggestionIndex !== -1`)\n\t\t\t\t// - the list of suggestions are rendered in the DOM (`isExpanded`)\n\t\t\t\thasFocus && selectedSuggestionIndex !== -1 && isExpanded\n\t\t\t\t\t? `components-form-token-suggestions-${ instanceId }-${ selectedSuggestionIndex }`\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\taria-describedby={ `components-form-token-suggestions-howto-${ instanceId }` }\n\t\t/>\n\t);\n}\n\nexport const TokenInput = forwardRef( UnForwardedTokenInput );\n\nexport default TokenInput;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAGnC;AACA;AACA;AACA,SAASC,UAAU,EAAEC,QAAQ,QAAQ,oBAAoB;;AAEzD;AACA;AACA;;AAIA,OAAO,SAASC,qBAAqBA,CACpCC,KAAiE,EACjEC,GAAqC,EACpC;EACD,MAAM;IACLC,KAAK;IACLC,UAAU;IACVC,UAAU;IACVC,uBAAuB;IACvBC,SAAS;IACTC,QAAQ;IACRC,OAAO;IACPC,MAAM;IACN,GAAGC;EACJ,CAAC,GAAGV,KAAK;EAET,MAAM,CAAEW,QAAQ,EAAEC,WAAW,CAAE,GAAGd,QAAQ,CAAE,KAAM,CAAC;EAEnD,MAAMe,IAAI,GAAGX,KAAK,GAAGA,KAAK,CAACY,MAAM,GAAG,CAAC,GAAG,CAAC;EAEzC,MAAMC,eAAe,GAAKC,KAAsC,IAAM;IACrE,IAAKT,QAAQ,EAAG;MACfA,QAAQ,CAAE;QACTL,KAAK,EAAEc,KAAK,CAACC,MAAM,CAACf;MACrB,CAAE,CAAC;IACJ;EACD,CAAC;EAED,MAAMgB,cAAqD,GAAKC,CAAC,IAAM;IACtEP,WAAW,CAAE,IAAK,CAAC;IACnBJ,OAAO,GAAIW,CAAE,CAAC;EACf,CAAC;EAED,MAAMC,aAAoD,GAAKD,CAAC,IAAM;IACrEP,WAAW,CAAE,KAAM,CAAC;IACpBH,MAAM,GAAIU,CAAE,CAAC;EACd,CAAC;EAED,OACCE,aAAA;IACCpB,GAAG,EAAGA,GAAK;IACXqB,EAAE,EAAI,+BAA+BlB,UAAY,EAAG;IACpDmB,IAAI,EAAC,MAAM;IAAA,GACNb,SAAS;IACdR,KAAK,EAAGA,KAAK,IAAI,EAAI;IACrBK,QAAQ,EAAGQ,eAAiB;IAC5BP,OAAO,EAAGU,cAAgB;IAC1BT,MAAM,EAAGW,aAAe;IACxBP,IAAI,EAAGA,IAAM;IACbP,SAAS,EAAGV,UAAU,CACrBU,SAAS,EACT,oCACD,CAAG;IACHkB,YAAY,EAAC,KAAK;IAClBC,IAAI,EAAC,UAAU;IACf,iBAAgBtB,UAAY;IAC5B,qBAAkB,MAAM;IACxB,aACCA,UAAU,GACN,qCAAqCC,UAAY,EAAC,GACnDsB,SACH;IACD;IACC;IACA;IACA;IACA;IACAf,QAAQ,IAAIN,uBAAuB,KAAK,CAAC,CAAC,IAAIF,UAAU,GACpD,qCAAqCC,UAAY,IAAIC,uBAAyB,EAAC,GAChFqB,SACH;IACD,oBAAoB,2CAA2CtB,UAAY;EAAG,CAC9E,CAAC;AAEJ;AAEA,OAAO,MAAMuB,UAAU,GAAG9B,UAAU,CAAEE,qBAAsB,CAAC;AAE7D,eAAe4B,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["clsx","forwardRef","useState","UnForwardedTokenInput","props","ref","value","isExpanded","instanceId","selectedSuggestionIndex","className","onChange","onFocus","onBlur","restProps","hasFocus","setHasFocus","size","length","onChangeHandler","event","target","onFocusHandler","e","onBlurHandler","createElement","id","type","autoComplete","role","undefined","TokenInput"],"sources":["@wordpress/components/src/form-token-field/token-input.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ChangeEvent, ForwardedRef, FocusEventHandler } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../context';\nimport type { TokenInputProps } from './types';\n\nexport function UnForwardedTokenInput(\n\tprops: WordPressComponentProps< TokenInputProps, 'input', false >,\n\tref: ForwardedRef< HTMLInputElement >\n) {\n\tconst {\n\t\tvalue,\n\t\tisExpanded,\n\t\tinstanceId,\n\t\tselectedSuggestionIndex,\n\t\tclassName,\n\t\tonChange,\n\t\tonFocus,\n\t\tonBlur,\n\t\t...restProps\n\t} = props;\n\n\tconst [ hasFocus, setHasFocus ] = useState( false );\n\n\tconst size = value ? value.length + 1 : 0;\n\n\tconst onChangeHandler = ( event: ChangeEvent< HTMLInputElement > ) => {\n\t\tif ( onChange ) {\n\t\t\tonChange( {\n\t\t\t\tvalue: event.target.value,\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst onFocusHandler: FocusEventHandler< HTMLInputElement > = ( e ) => {\n\t\tsetHasFocus( true );\n\t\tonFocus?.( e );\n\t};\n\n\tconst onBlurHandler: FocusEventHandler< HTMLInputElement > = ( e ) => {\n\t\tsetHasFocus( false );\n\t\tonBlur?.( e );\n\t};\n\n\treturn (\n\t\t<input\n\t\t\tref={ ref }\n\t\t\tid={ `components-form-token-input-${ instanceId }` }\n\t\t\ttype=\"text\"\n\t\t\t{ ...restProps }\n\t\t\tvalue={ value || '' }\n\t\t\tonChange={ onChangeHandler }\n\t\t\tonFocus={ onFocusHandler }\n\t\t\tonBlur={ onBlurHandler }\n\t\t\tsize={ size }\n\t\t\tclassName={ clsx(\n\t\t\t\tclassName,\n\t\t\t\t'components-form-token-field__input'\n\t\t\t) }\n\t\t\tautoComplete=\"off\"\n\t\t\trole=\"combobox\"\n\t\t\taria-expanded={ isExpanded }\n\t\t\taria-autocomplete=\"list\"\n\t\t\taria-owns={\n\t\t\t\tisExpanded\n\t\t\t\t\t? `components-form-token-suggestions-${ instanceId }`\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\taria-activedescendant={\n\t\t\t\t// Only add the `aria-activedescendant` attribute when:\n\t\t\t\t// - the user is actively interacting with the input (`hasFocus`)\n\t\t\t\t// - there is a selected suggestion (`selectedSuggestionIndex !== -1`)\n\t\t\t\t// - the list of suggestions are rendered in the DOM (`isExpanded`)\n\t\t\t\thasFocus && selectedSuggestionIndex !== -1 && isExpanded\n\t\t\t\t\t? `components-form-token-suggestions-${ instanceId }-${ selectedSuggestionIndex }`\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\taria-describedby={ `components-form-token-suggestions-howto-${ instanceId }` }\n\t\t/>\n\t);\n}\n\nexport const TokenInput = forwardRef( UnForwardedTokenInput );\n\nexport default TokenInput;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;AAGvB;AACA;AACA;AACA,SAASC,UAAU,EAAEC,QAAQ,QAAQ,oBAAoB;;AAEzD;AACA;AACA;;AAIA,OAAO,SAASC,qBAAqBA,CACpCC,KAAiE,EACjEC,GAAqC,EACpC;EACD,MAAM;IACLC,KAAK;IACLC,UAAU;IACVC,UAAU;IACVC,uBAAuB;IACvBC,SAAS;IACTC,QAAQ;IACRC,OAAO;IACPC,MAAM;IACN,GAAGC;EACJ,CAAC,GAAGV,KAAK;EAET,MAAM,CAAEW,QAAQ,EAAEC,WAAW,CAAE,GAAGd,QAAQ,CAAE,KAAM,CAAC;EAEnD,MAAMe,IAAI,GAAGX,KAAK,GAAGA,KAAK,CAACY,MAAM,GAAG,CAAC,GAAG,CAAC;EAEzC,MAAMC,eAAe,GAAKC,KAAsC,IAAM;IACrE,IAAKT,QAAQ,EAAG;MACfA,QAAQ,CAAE;QACTL,KAAK,EAAEc,KAAK,CAACC,MAAM,CAACf;MACrB,CAAE,CAAC;IACJ;EACD,CAAC;EAED,MAAMgB,cAAqD,GAAKC,CAAC,IAAM;IACtEP,WAAW,CAAE,IAAK,CAAC;IACnBJ,OAAO,GAAIW,CAAE,CAAC;EACf,CAAC;EAED,MAAMC,aAAoD,GAAKD,CAAC,IAAM;IACrEP,WAAW,CAAE,KAAM,CAAC;IACpBH,MAAM,GAAIU,CAAE,CAAC;EACd,CAAC;EAED,OACCE,aAAA;IACCpB,GAAG,EAAGA,GAAK;IACXqB,EAAE,EAAI,+BAA+BlB,UAAY,EAAG;IACpDmB,IAAI,EAAC,MAAM;IAAA,GACNb,SAAS;IACdR,KAAK,EAAGA,KAAK,IAAI,EAAI;IACrBK,QAAQ,EAAGQ,eAAiB;IAC5BP,OAAO,EAAGU,cAAgB;IAC1BT,MAAM,EAAGW,aAAe;IACxBP,IAAI,EAAGA,IAAM;IACbP,SAAS,EAAGV,IAAI,CACfU,SAAS,EACT,oCACD,CAAG;IACHkB,YAAY,EAAC,KAAK;IAClBC,IAAI,EAAC,UAAU;IACf,iBAAgBtB,UAAY;IAC5B,qBAAkB,MAAM;IACxB,aACCA,UAAU,GACN,qCAAqCC,UAAY,EAAC,GACnDsB,SACH;IACD;IACC;IACA;IACA;IACA;IACAf,QAAQ,IAAIN,uBAAuB,KAAK,CAAC,CAAC,IAAIF,UAAU,GACpD,qCAAqCC,UAAY,IAAIC,uBAAyB,EAAC,GAChFqB,SACH;IACD,oBAAoB,2CAA2CtB,UAAY;EAAG,CAC9E,CAAC;AAEJ;AAEA,OAAO,MAAMuB,UAAU,GAAG9B,UAAU,CAAEE,qBAAsB,CAAC;AAE7D,eAAe4B,UAAU","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -32,7 +32,7 @@ export default function Token({
32
32
  termsCount
33
33
  }) {
34
34
  const instanceId = useInstanceId(Token);
35
- const tokenClasses = classnames('components-form-token-field__token', {
35
+ const tokenClasses = clsx('components-form-token-field__token', {
36
36
  'is-error': 'error' === status,
37
37
  'is-success': 'success' === status,
38
38
  'is-validating': 'validating' === status,
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useInstanceId","__","sprintf","closeSmall","Button","VisuallyHidden","noop","Token","value","status","title","displayTransform","isBorderless","disabled","onClickRemove","onMouseEnter","onMouseLeave","messages","termPosition","termsCount","instanceId","tokenClasses","onClick","transformedValue","termPositionAndCount","createElement","className","id","as","icon","undefined","label","remove"],"sources":["@wordpress/components/src/form-token-field/token.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { TokenProps } from './types';\n\nconst noop = () => {};\n\nexport default function Token( {\n\tvalue,\n\tstatus,\n\ttitle,\n\tdisplayTransform,\n\tisBorderless = false,\n\tdisabled = false,\n\tonClickRemove = noop,\n\tonMouseEnter,\n\tonMouseLeave,\n\tmessages,\n\ttermPosition,\n\ttermsCount,\n}: TokenProps ) {\n\tconst instanceId = useInstanceId( Token );\n\tconst tokenClasses = classnames( 'components-form-token-field__token', {\n\t\t'is-error': 'error' === status,\n\t\t'is-success': 'success' === status,\n\t\t'is-validating': 'validating' === status,\n\t\t'is-borderless': isBorderless,\n\t\t'is-disabled': disabled,\n\t} );\n\n\tconst onClick = () => onClickRemove( { value } );\n\n\tconst transformedValue = displayTransform( value );\n\tconst termPositionAndCount = sprintf(\n\t\t/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */\n\t\t__( '%1$s (%2$s of %3$s)' ),\n\t\ttransformedValue,\n\t\ttermPosition,\n\t\ttermsCount\n\t);\n\n\treturn (\n\t\t<span\n\t\t\tclassName={ tokenClasses }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\ttitle={ title }\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"components-form-token-field__token-text\"\n\t\t\t\tid={ `components-form-token-field__token-text-${ instanceId }` }\n\t\t\t>\n\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t{ termPositionAndCount }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<span aria-hidden=\"true\">{ transformedValue }</span>\n\t\t\t</span>\n\n\t\t\t<Button\n\t\t\t\tclassName=\"components-form-token-field__remove-token\"\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tonClick={ ! disabled ? onClick : undefined }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tlabel={ messages.remove }\n\t\t\t\taria-describedby={ `components-form-token-field__token-text-${ instanceId }` }\n\t\t\t/>\n\t\t</span>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,UAAU,QAAQ,kBAAkB;;AAE7C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,WAAW;AAC9B,SAASC,cAAc,QAAQ,oBAAoB;AAGnD,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,eAAe,SAASC,KAAKA,CAAE;EAC9BC,KAAK;EACLC,MAAM;EACNC,KAAK;EACLC,gBAAgB;EAChBC,YAAY,GAAG,KAAK;EACpBC,QAAQ,GAAG,KAAK;EAChBC,aAAa,GAAGR,IAAI;EACpBS,YAAY;EACZC,YAAY;EACZC,QAAQ;EACRC,YAAY;EACZC;AACW,CAAC,EAAG;EACf,MAAMC,UAAU,GAAGpB,aAAa,CAAEO,KAAM,CAAC;EACzC,MAAMc,YAAY,GAAGtB,UAAU,CAAE,oCAAoC,EAAE;IACtE,UAAU,EAAE,OAAO,KAAKU,MAAM;IAC9B,YAAY,EAAE,SAAS,KAAKA,MAAM;IAClC,eAAe,EAAE,YAAY,KAAKA,MAAM;IACxC,eAAe,EAAEG,YAAY;IAC7B,aAAa,EAAEC;EAChB,CAAE,CAAC;EAEH,MAAMS,OAAO,GAAGA,CAAA,KAAMR,aAAa,CAAE;IAAEN;EAAM,CAAE,CAAC;EAEhD,MAAMe,gBAAgB,GAAGZ,gBAAgB,CAAEH,KAAM,CAAC;EAClD,MAAMgB,oBAAoB,GAAGtB,OAAO,EACnC;EACAD,EAAE,CAAE,qBAAsB,CAAC,EAC3BsB,gBAAgB,EAChBL,YAAY,EACZC,UACD,CAAC;EAED,OACCM,aAAA;IACCC,SAAS,EAAGL,YAAc;IAC1BN,YAAY,EAAGA,YAAc;IAC7BC,YAAY,EAAGA,YAAc;IAC7BN,KAAK,EAAGA;EAAO,GAEfe,aAAA;IACCC,SAAS,EAAC,yCAAyC;IACnDC,EAAE,EAAI,2CAA2CP,UAAY;EAAG,GAEhEK,aAAA,CAACpB,cAAc;IAACuB,EAAE,EAAC;EAAM,GACtBJ,oBACa,CAAC,EACjBC,aAAA;IAAM,eAAY;EAAM,GAAGF,gBAAwB,CAC9C,CAAC,EAEPE,aAAA,CAACrB,MAAM;IACNsB,SAAS,EAAC,2CAA2C;IACrDG,IAAI,EAAG1B,UAAY;IACnBmB,OAAO,EAAG,CAAET,QAAQ,GAAGS,OAAO,GAAGQ,SAAW;IAC5CjB,QAAQ,EAAGA,QAAU;IACrBkB,KAAK,EAAGd,QAAQ,CAACe,MAAQ;IACzB,oBAAoB,2CAA2CZ,UAAY;EAAG,CAC9E,CACI,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useInstanceId","__","sprintf","closeSmall","Button","VisuallyHidden","noop","Token","value","status","title","displayTransform","isBorderless","disabled","onClickRemove","onMouseEnter","onMouseLeave","messages","termPosition","termsCount","instanceId","tokenClasses","onClick","transformedValue","termPositionAndCount","createElement","className","id","as","icon","undefined","label","remove"],"sources":["@wordpress/components/src/form-token-field/token.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport Button from '../button';\nimport { VisuallyHidden } from '../visually-hidden';\nimport type { TokenProps } from './types';\n\nconst noop = () => {};\n\nexport default function Token( {\n\tvalue,\n\tstatus,\n\ttitle,\n\tdisplayTransform,\n\tisBorderless = false,\n\tdisabled = false,\n\tonClickRemove = noop,\n\tonMouseEnter,\n\tonMouseLeave,\n\tmessages,\n\ttermPosition,\n\ttermsCount,\n}: TokenProps ) {\n\tconst instanceId = useInstanceId( Token );\n\tconst tokenClasses = clsx( 'components-form-token-field__token', {\n\t\t'is-error': 'error' === status,\n\t\t'is-success': 'success' === status,\n\t\t'is-validating': 'validating' === status,\n\t\t'is-borderless': isBorderless,\n\t\t'is-disabled': disabled,\n\t} );\n\n\tconst onClick = () => onClickRemove( { value } );\n\n\tconst transformedValue = displayTransform( value );\n\tconst termPositionAndCount = sprintf(\n\t\t/* translators: 1: term name, 2: term position in a set of terms, 3: total term set count. */\n\t\t__( '%1$s (%2$s of %3$s)' ),\n\t\ttransformedValue,\n\t\ttermPosition,\n\t\ttermsCount\n\t);\n\n\treturn (\n\t\t<span\n\t\t\tclassName={ tokenClasses }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\ttitle={ title }\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"components-form-token-field__token-text\"\n\t\t\t\tid={ `components-form-token-field__token-text-${ instanceId }` }\n\t\t\t>\n\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t{ termPositionAndCount }\n\t\t\t\t</VisuallyHidden>\n\t\t\t\t<span aria-hidden=\"true\">{ transformedValue }</span>\n\t\t\t</span>\n\n\t\t\t<Button\n\t\t\t\tclassName=\"components-form-token-field__remove-token\"\n\t\t\t\ticon={ closeSmall }\n\t\t\t\tonClick={ ! disabled ? onClick : undefined }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tlabel={ messages.remove }\n\t\t\t\taria-describedby={ `components-form-token-field__token-text-${ instanceId }` }\n\t\t\t/>\n\t\t</span>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,EAAE,EAAEC,OAA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,oBACa,CAAC,EACjBC,aAAA;IAAM,eAAY;EAAM,GAAGF,gBAAwB,CAC9C,CAAC,EAEPE,aAAA,CAACrB,MAAM;IACNsB,SAAS,EAAC,2CAA2C;IACrDG,IAAI,EAAG1B,UAAY;IACnBmB,OAAO,EAAG,CAAET,QAAQ,GAAGS,OAAO,GAAGQ,SAAW;IAC5CjB,QAAQ,EAAGA,QAAU;IACrBkB,KAAK,EAAGd,QAAQ,CAACe,MAAQ;IACzB,oBAAoB,2CAA2CZ,UAAY;EAAG,CAC9E,CACI,CAAC;AAET","ignoreList":[]}
@@ -2,7 +2,7 @@ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
5
- import classnames from 'classnames';
5
+ import clsx from 'clsx';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -96,7 +96,7 @@ function Guide({
96
96
  return null;
97
97
  }
98
98
  return createElement(Modal, {
99
- className: classnames('components-guide', className),
99
+ className: clsx('components-guide', className),
100
100
  contentLabel: contentLabel,
101
101
  isDismissible: pages.length > 1,
102
102
  onRequestClose: onFinish,