@depup/react-aria-components 1.19.0-depup.27 → 1.21.0-depup.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 (333) hide show
  1. package/NavigationTree/package.json +5 -0
  2. package/PreviewTrigger/package.json +5 -0
  3. package/README.md +2 -2
  4. package/TokenField/package.json +5 -0
  5. package/changes.json +1 -1
  6. package/dist/exports/GridList.cjs.map +1 -1
  7. package/dist/exports/GridList.js.map +1 -1
  8. package/dist/exports/GridList.mjs.map +1 -1
  9. package/dist/exports/Menu.cjs +1 -0
  10. package/dist/exports/Menu.cjs.map +1 -1
  11. package/dist/exports/Menu.js +2 -2
  12. package/dist/exports/Menu.js.map +1 -1
  13. package/dist/exports/Menu.mjs +2 -2
  14. package/dist/exports/Menu.mjs.map +1 -1
  15. package/dist/exports/NavigationTree.cjs +37 -0
  16. package/dist/exports/NavigationTree.cjs.map +1 -0
  17. package/dist/exports/NavigationTree.js +25 -0
  18. package/dist/exports/NavigationTree.js.map +1 -0
  19. package/dist/exports/NavigationTree.mjs +25 -0
  20. package/dist/exports/NavigationTree.mjs.map +1 -0
  21. package/dist/exports/PreviewTrigger.cjs +26 -0
  22. package/dist/exports/PreviewTrigger.cjs.map +1 -0
  23. package/dist/exports/PreviewTrigger.js +21 -0
  24. package/dist/exports/PreviewTrigger.js.map +1 -0
  25. package/dist/exports/PreviewTrigger.mjs +21 -0
  26. package/dist/exports/PreviewTrigger.mjs.map +1 -0
  27. package/dist/exports/TokenField.cjs +31 -0
  28. package/dist/exports/TokenField.cjs.map +1 -0
  29. package/dist/exports/TokenField.js +21 -0
  30. package/dist/exports/TokenField.js.map +1 -0
  31. package/dist/exports/TokenField.mjs +21 -0
  32. package/dist/exports/TokenField.mjs.map +1 -0
  33. package/dist/exports/Tree.cjs.map +1 -1
  34. package/dist/exports/Tree.js.map +1 -1
  35. package/dist/exports/Tree.mjs.map +1 -1
  36. package/dist/exports/index.cjs +25 -0
  37. package/dist/exports/index.cjs.map +1 -1
  38. package/dist/exports/index.js +12 -2
  39. package/dist/exports/index.js.map +1 -1
  40. package/dist/exports/index.mjs +12 -2
  41. package/dist/exports/index.mjs.map +1 -1
  42. package/dist/private/Checkbox.cjs.map +1 -1
  43. package/dist/private/Checkbox.js.map +1 -1
  44. package/dist/private/Checkbox.mjs.map +1 -1
  45. package/dist/private/ComboBox.cjs +21 -2
  46. package/dist/private/ComboBox.cjs.map +1 -1
  47. package/dist/private/ComboBox.js +21 -2
  48. package/dist/private/ComboBox.js.map +1 -1
  49. package/dist/private/ComboBox.mjs +21 -2
  50. package/dist/private/ComboBox.mjs.map +1 -1
  51. package/dist/private/Dialog.cjs +21 -1
  52. package/dist/private/Dialog.cjs.map +1 -1
  53. package/dist/private/Dialog.js +21 -1
  54. package/dist/private/Dialog.js.map +1 -1
  55. package/dist/private/Dialog.mjs +21 -1
  56. package/dist/private/Dialog.mjs.map +1 -1
  57. package/dist/private/DragAndDrop.cjs +1 -0
  58. package/dist/private/DragAndDrop.cjs.map +1 -1
  59. package/dist/private/DragAndDrop.js +1 -0
  60. package/dist/private/DragAndDrop.js.map +1 -1
  61. package/dist/private/DragAndDrop.mjs +1 -0
  62. package/dist/private/DragAndDrop.mjs.map +1 -1
  63. package/dist/private/DropZone.cjs +5 -2
  64. package/dist/private/DropZone.cjs.map +1 -1
  65. package/dist/private/DropZone.js +5 -3
  66. package/dist/private/DropZone.js.map +1 -1
  67. package/dist/private/DropZone.mjs +5 -2
  68. package/dist/private/DropZone.mjs.map +1 -1
  69. package/dist/private/FileTrigger.cjs +1 -0
  70. package/dist/private/FileTrigger.cjs.map +1 -1
  71. package/dist/private/FileTrigger.js +1 -0
  72. package/dist/private/FileTrigger.js.map +1 -1
  73. package/dist/private/FileTrigger.mjs +1 -0
  74. package/dist/private/FileTrigger.mjs.map +1 -1
  75. package/dist/private/GridLayout.cjs +3 -1
  76. package/dist/private/GridLayout.cjs.map +1 -1
  77. package/dist/private/GridLayout.js +3 -1
  78. package/dist/private/GridLayout.js.map +1 -1
  79. package/dist/private/GridLayout.mjs +3 -1
  80. package/dist/private/GridLayout.mjs.map +1 -1
  81. package/dist/private/GridList.cjs +12 -1
  82. package/dist/private/GridList.cjs.map +1 -1
  83. package/dist/private/GridList.js +12 -1
  84. package/dist/private/GridList.js.map +1 -1
  85. package/dist/private/GridList.mjs +12 -1
  86. package/dist/private/GridList.mjs.map +1 -1
  87. package/dist/private/ListBox.cjs +9 -1
  88. package/dist/private/ListBox.cjs.map +1 -1
  89. package/dist/private/ListBox.js +9 -1
  90. package/dist/private/ListBox.js.map +1 -1
  91. package/dist/private/ListBox.mjs +9 -1
  92. package/dist/private/ListBox.mjs.map +1 -1
  93. package/dist/private/Menu.cjs +59 -2
  94. package/dist/private/Menu.cjs.map +1 -1
  95. package/dist/private/Menu.js +60 -4
  96. package/dist/private/Menu.js.map +1 -1
  97. package/dist/private/Menu.mjs +60 -4
  98. package/dist/private/Menu.mjs.map +1 -1
  99. package/dist/private/Meter.cjs +2 -1
  100. package/dist/private/Meter.cjs.map +1 -1
  101. package/dist/private/Meter.js +2 -1
  102. package/dist/private/Meter.js.map +1 -1
  103. package/dist/private/Meter.mjs +2 -1
  104. package/dist/private/Meter.mjs.map +1 -1
  105. package/dist/private/Modal.cjs +2 -0
  106. package/dist/private/Modal.cjs.map +1 -1
  107. package/dist/private/Modal.js +2 -0
  108. package/dist/private/Modal.js.map +1 -1
  109. package/dist/private/Modal.mjs +2 -0
  110. package/dist/private/Modal.mjs.map +1 -1
  111. package/dist/private/NavigationTree.cjs +272 -0
  112. package/dist/private/NavigationTree.cjs.map +1 -0
  113. package/dist/private/NavigationTree.js +258 -0
  114. package/dist/private/NavigationTree.js.map +1 -0
  115. package/dist/private/NavigationTree.mjs +257 -0
  116. package/dist/private/NavigationTree.mjs.map +1 -0
  117. package/dist/private/Popover.cjs +34 -9
  118. package/dist/private/Popover.cjs.map +1 -1
  119. package/dist/private/Popover.js +34 -9
  120. package/dist/private/Popover.js.map +1 -1
  121. package/dist/private/Popover.mjs +34 -9
  122. package/dist/private/Popover.mjs.map +1 -1
  123. package/dist/private/PreviewTrigger.cjs +88 -0
  124. package/dist/private/PreviewTrigger.cjs.map +1 -0
  125. package/dist/private/PreviewTrigger.js +80 -0
  126. package/dist/private/PreviewTrigger.js.map +1 -0
  127. package/dist/private/PreviewTrigger.mjs +79 -0
  128. package/dist/private/PreviewTrigger.mjs.map +1 -0
  129. package/dist/private/ProgressBar.cjs +6 -1
  130. package/dist/private/ProgressBar.cjs.map +1 -1
  131. package/dist/private/ProgressBar.js +6 -1
  132. package/dist/private/ProgressBar.js.map +1 -1
  133. package/dist/private/ProgressBar.mjs +6 -1
  134. package/dist/private/ProgressBar.mjs.map +1 -1
  135. package/dist/private/RadioGroup.cjs.map +1 -1
  136. package/dist/private/RadioGroup.js.map +1 -1
  137. package/dist/private/RadioGroup.mjs.map +1 -1
  138. package/dist/private/Select.cjs.map +1 -1
  139. package/dist/private/Select.js.map +1 -1
  140. package/dist/private/Select.mjs.map +1 -1
  141. package/dist/private/Switch.cjs +8 -2
  142. package/dist/private/Switch.cjs.map +1 -1
  143. package/dist/private/Switch.js +9 -3
  144. package/dist/private/Switch.js.map +1 -1
  145. package/dist/private/Switch.mjs +9 -3
  146. package/dist/private/Switch.mjs.map +1 -1
  147. package/dist/private/Table.cjs +26 -14
  148. package/dist/private/Table.cjs.map +1 -1
  149. package/dist/private/Table.js +26 -14
  150. package/dist/private/Table.js.map +1 -1
  151. package/dist/private/Table.mjs +26 -14
  152. package/dist/private/Table.mjs.map +1 -1
  153. package/dist/private/TableLayout.cjs +3 -1
  154. package/dist/private/TableLayout.cjs.map +1 -1
  155. package/dist/private/TableLayout.js +3 -1
  156. package/dist/private/TableLayout.js.map +1 -1
  157. package/dist/private/TableLayout.mjs +3 -1
  158. package/dist/private/TableLayout.mjs.map +1 -1
  159. package/dist/private/TagGroup.cjs +1 -0
  160. package/dist/private/TagGroup.cjs.map +1 -1
  161. package/dist/private/TagGroup.js +1 -0
  162. package/dist/private/TagGroup.js.map +1 -1
  163. package/dist/private/TagGroup.mjs +1 -0
  164. package/dist/private/TagGroup.mjs.map +1 -1
  165. package/dist/private/Text.cjs +3 -1
  166. package/dist/private/Text.cjs.map +1 -1
  167. package/dist/private/Text.js +4 -2
  168. package/dist/private/Text.js.map +1 -1
  169. package/dist/private/Text.mjs +4 -2
  170. package/dist/private/Text.mjs.map +1 -1
  171. package/dist/private/ToggleButton.cjs.map +1 -1
  172. package/dist/private/ToggleButton.js.map +1 -1
  173. package/dist/private/ToggleButton.mjs.map +1 -1
  174. package/dist/private/TokenField.cjs +235 -0
  175. package/dist/private/TokenField.cjs.map +1 -0
  176. package/dist/private/TokenField.js +225 -0
  177. package/dist/private/TokenField.js.map +1 -0
  178. package/dist/private/TokenField.mjs +223 -0
  179. package/dist/private/TokenField.mjs.map +1 -0
  180. package/dist/private/Tooltip.cjs +10 -2
  181. package/dist/private/Tooltip.cjs.map +1 -1
  182. package/dist/private/Tooltip.js +10 -2
  183. package/dist/private/Tooltip.js.map +1 -1
  184. package/dist/private/Tooltip.mjs +10 -2
  185. package/dist/private/Tooltip.mjs.map +1 -1
  186. package/dist/private/Tree.cjs +11 -1
  187. package/dist/private/Tree.cjs.map +1 -1
  188. package/dist/private/Tree.js +11 -1
  189. package/dist/private/Tree.js.map +1 -1
  190. package/dist/private/Tree.mjs +11 -1
  191. package/dist/private/Tree.mjs.map +1 -1
  192. package/dist/private/TreeDropTargetDelegate.cjs +11 -6
  193. package/dist/private/TreeDropTargetDelegate.cjs.map +1 -1
  194. package/dist/private/TreeDropTargetDelegate.js +11 -6
  195. package/dist/private/TreeDropTargetDelegate.js.map +1 -1
  196. package/dist/private/TreeDropTargetDelegate.mjs +11 -6
  197. package/dist/private/TreeDropTargetDelegate.mjs.map +1 -1
  198. package/dist/private/Virtualizer.cjs +18 -16
  199. package/dist/private/Virtualizer.cjs.map +1 -1
  200. package/dist/private/Virtualizer.js +18 -16
  201. package/dist/private/Virtualizer.js.map +1 -1
  202. package/dist/private/Virtualizer.mjs +18 -16
  203. package/dist/private/Virtualizer.mjs.map +1 -1
  204. package/dist/private/useDragAndDrop.cjs +7 -0
  205. package/dist/private/useDragAndDrop.cjs.map +1 -1
  206. package/dist/private/useDragAndDrop.js +7 -0
  207. package/dist/private/useDragAndDrop.js.map +1 -1
  208. package/dist/private/useDragAndDrop.mjs +7 -0
  209. package/dist/private/useDragAndDrop.mjs.map +1 -1
  210. package/dist/private/utils.cjs.map +1 -1
  211. package/dist/private/utils.js.map +1 -1
  212. package/dist/private/utils.mjs.map +1 -1
  213. package/dist/types/exports/GridList.d.ts +1 -1
  214. package/dist/types/exports/Menu.d.ts +2 -2
  215. package/dist/types/exports/NavigationTree.d.ts +8 -0
  216. package/dist/types/exports/PreviewTrigger.d.ts +3 -0
  217. package/dist/types/exports/TokenField.d.ts +5 -0
  218. package/dist/types/exports/Tree.d.ts +1 -1
  219. package/dist/types/exports/index.d.ts +14 -5
  220. package/dist/types/src/Breadcrumbs.d.ts +2 -2
  221. package/dist/types/src/Button.d.ts +1 -1
  222. package/dist/types/src/Calendar.d.ts +6 -6
  223. package/dist/types/src/Checkbox.d.ts +8 -8
  224. package/dist/types/src/Collection.d.ts +1 -1
  225. package/dist/types/src/ComboBox.d.ts +6 -3
  226. package/dist/types/src/DateField.d.ts +4 -4
  227. package/dist/types/src/DatePicker.d.ts +2 -2
  228. package/dist/types/src/Dialog.d.ts +2 -2
  229. package/dist/types/src/Disclosure.d.ts +2 -2
  230. package/dist/types/src/GridList.d.ts +18 -7
  231. package/dist/types/src/Group.d.ts +1 -1
  232. package/dist/types/src/Header.d.ts +1 -1
  233. package/dist/types/src/Input.d.ts +1 -1
  234. package/dist/types/src/Label.d.ts +1 -1
  235. package/dist/types/src/Link.d.ts +1 -1
  236. package/dist/types/src/ListBox.d.ts +6 -6
  237. package/dist/types/src/Menu.d.ts +25 -6
  238. package/dist/types/src/Meter.d.ts +1 -1
  239. package/dist/types/src/Modal.d.ts +2 -2
  240. package/dist/types/src/NavigationTree.d.ts +80 -0
  241. package/dist/types/src/NumberField.d.ts +1 -1
  242. package/dist/types/src/OverlayArrow.d.ts +1 -1
  243. package/dist/types/src/Popover.d.ts +8 -1
  244. package/dist/types/src/PreviewTrigger.d.ts +23 -0
  245. package/dist/types/src/RadioGroup.d.ts +8 -8
  246. package/dist/types/src/SearchField.d.ts +1 -1
  247. package/dist/types/src/Select.d.ts +3 -3
  248. package/dist/types/src/Separator.d.ts +1 -1
  249. package/dist/types/src/Slider.d.ts +5 -5
  250. package/dist/types/src/Switch.d.ts +7 -7
  251. package/dist/types/src/Table.d.ts +32 -8
  252. package/dist/types/src/Tabs.d.ts +5 -5
  253. package/dist/types/src/TagGroup.d.ts +3 -3
  254. package/dist/types/src/Text.d.ts +1 -1
  255. package/dist/types/src/TextField.d.ts +1 -1
  256. package/dist/types/src/Toast.d.ts +3 -3
  257. package/dist/types/src/ToggleButton.d.ts +1 -1
  258. package/dist/types/src/ToggleButtonGroup.d.ts +1 -1
  259. package/dist/types/src/TokenField.d.ts +111 -0
  260. package/dist/types/src/Toolbar.d.ts +1 -1
  261. package/dist/types/src/Tooltip.d.ts +1 -1
  262. package/dist/types/src/Tree.d.ts +12 -10
  263. package/dist/types/src/Virtualizer.d.ts +4 -0
  264. package/dist/types/src/utils.d.ts +19 -5
  265. package/i18n/ar-AE.js +1 -1
  266. package/i18n/ar-AE.mjs +1 -1
  267. package/i18n/bg-BG.js +1 -1
  268. package/i18n/bg-BG.mjs +1 -1
  269. package/i18n/cs-CZ.js +1 -1
  270. package/i18n/cs-CZ.mjs +1 -1
  271. package/i18n/da-DK.js +1 -1
  272. package/i18n/da-DK.mjs +1 -1
  273. package/i18n/de-DE.js +1 -1
  274. package/i18n/de-DE.mjs +1 -1
  275. package/i18n/el-GR.js +1 -1
  276. package/i18n/el-GR.mjs +1 -1
  277. package/i18n/en-US.js +1 -1
  278. package/i18n/en-US.mjs +1 -1
  279. package/i18n/es-ES.js +1 -1
  280. package/i18n/es-ES.mjs +1 -1
  281. package/i18n/et-EE.js +1 -1
  282. package/i18n/et-EE.mjs +1 -1
  283. package/i18n/fi-FI.js +1 -1
  284. package/i18n/fi-FI.mjs +1 -1
  285. package/i18n/fr-FR.js +1 -1
  286. package/i18n/fr-FR.mjs +1 -1
  287. package/i18n/he-IL.js +1 -1
  288. package/i18n/he-IL.mjs +1 -1
  289. package/i18n/hr-HR.js +1 -1
  290. package/i18n/hr-HR.mjs +1 -1
  291. package/i18n/hu-HU.js +1 -1
  292. package/i18n/hu-HU.mjs +1 -1
  293. package/i18n/it-IT.js +1 -1
  294. package/i18n/it-IT.mjs +1 -1
  295. package/i18n/ja-JP.js +1 -1
  296. package/i18n/ja-JP.mjs +1 -1
  297. package/i18n/ko-KR.js +1 -1
  298. package/i18n/ko-KR.mjs +1 -1
  299. package/i18n/lt-LT.js +1 -1
  300. package/i18n/lt-LT.mjs +1 -1
  301. package/i18n/lv-LV.js +1 -1
  302. package/i18n/lv-LV.mjs +1 -1
  303. package/i18n/nb-NO.js +1 -1
  304. package/i18n/nb-NO.mjs +1 -1
  305. package/i18n/nl-NL.js +1 -1
  306. package/i18n/nl-NL.mjs +1 -1
  307. package/i18n/pl-PL.js +1 -1
  308. package/i18n/pl-PL.mjs +1 -1
  309. package/i18n/pt-BR.js +1 -1
  310. package/i18n/pt-BR.mjs +1 -1
  311. package/i18n/pt-PT.js +1 -1
  312. package/i18n/pt-PT.mjs +1 -1
  313. package/i18n/ro-RO.js +1 -1
  314. package/i18n/ro-RO.mjs +1 -1
  315. package/i18n/ru-RU.js +1 -1
  316. package/i18n/ru-RU.mjs +1 -1
  317. package/i18n/sk-SK.js +1 -1
  318. package/i18n/sk-SK.mjs +1 -1
  319. package/i18n/sl-SI.js +1 -1
  320. package/i18n/sl-SI.mjs +1 -1
  321. package/i18n/sr-SP.js +1 -1
  322. package/i18n/sr-SP.mjs +1 -1
  323. package/i18n/sv-SE.js +1 -1
  324. package/i18n/sv-SE.mjs +1 -1
  325. package/i18n/tr-TR.js +1 -1
  326. package/i18n/tr-TR.mjs +1 -1
  327. package/i18n/uk-UA.js +1 -1
  328. package/i18n/uk-UA.mjs +1 -1
  329. package/i18n/zh-CN.js +1 -1
  330. package/i18n/zh-CN.mjs +1 -1
  331. package/i18n/zh-TW.js +1 -1
  332. package/i18n/zh-TW.mjs +1 -1
  333. package/package.json +33 -31
@@ -0,0 +1,235 @@
1
+ var $048d76b84370f141$exports = require("./utils.cjs");
2
+ var $433949643203e332$exports = require("./Autocomplete.cjs");
3
+ var $d5d46822336ca1e1$exports = require("./Label.cjs");
4
+ var $cab7d9a238d19c33$exports = require("./Text.cjs");
5
+ var $4P2rL$reactariaprivatecollectionsHidden = require("react-aria/private/collections/Hidden");
6
+ var $4P2rL$reactariafilterDOMProps = require("react-aria/filterDOMProps");
7
+ var $4P2rL$reactariauseHover = require("react-aria/useHover");
8
+ var $4P2rL$reactariaprivateutilsdomHelpers = require("react-aria/private/utils/domHelpers");
9
+ var $4P2rL$reactariamergeProps = require("react-aria/mergeProps");
10
+ var $4P2rL$reactariamergeRefs = require("react-aria/mergeRefs");
11
+ var $4P2rL$react = require("react");
12
+ var $4P2rL$reactstatelyuseTokenFieldState = require("react-stately/useTokenFieldState");
13
+ var $4P2rL$reactariauseFocusRing = require("react-aria/useFocusRing");
14
+ var $4P2rL$reactariaprivateutilsuseLayoutEffect = require("react-aria/private/utils/useLayoutEffect");
15
+ var $4P2rL$reactariauseObjectRef = require("react-aria/useObjectRef");
16
+ var $4P2rL$reactariauseTokenField = require("react-aria/useTokenField");
17
+
18
+
19
+ function $parcel$interopDefault(a) {
20
+ return a && a.__esModule ? a.default : a;
21
+ }
22
+
23
+ function $parcel$export(e, n, v, s) {
24
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
25
+ }
26
+
27
+ $parcel$export(module.exports, "TokenFieldContext", function () { return $95baf1bfb6adc271$export$24532e5e37c56ff2; });
28
+ $parcel$export(module.exports, "TokenField", function () { return $95baf1bfb6adc271$export$e4550c392cbe69d7; });
29
+ $parcel$export(module.exports, "TokenInput", function () { return $95baf1bfb6adc271$export$4ddf413e820cfcc4; });
30
+ $parcel$export(module.exports, "Token", function () { return $95baf1bfb6adc271$export$50792b0e93539fde; });
31
+ /*
32
+ * Copyright 2026 Adobe. All rights reserved.
33
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
34
+ * you may not use this file except in compliance with the License. You may obtain a copy
35
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
36
+ *
37
+ * Unless required by applicable law or agreed to in writing, software distributed under
38
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
39
+ * OF ANY KIND, either express or implied. See the License for the specific language
40
+ * governing permissions and limitations under the License.
41
+ */
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+ const $95baf1bfb6adc271$export$24532e5e37c56ff2 = /*#__PURE__*/ (0, $4P2rL$react.createContext)(null);
58
+ const $95baf1bfb6adc271$var$TokenInputContext = /*#__PURE__*/ (0, $4P2rL$react.createContext)(null);
59
+ const $95baf1bfb6adc271$export$e4550c392cbe69d7 = /*#__PURE__*/ (0, $4P2rL$reactariaprivatecollectionsHidden.createHideableComponent)(function TokenField(props, ref) {
60
+ [props, ref] = (0, $048d76b84370f141$exports.useContextProps)(props, ref, $95baf1bfb6adc271$export$24532e5e37c56ff2);
61
+ let [labelRef, label] = (0, $048d76b84370f141$exports.useSlot)(!props['aria-label'] && !props['aria-labelledby']);
62
+ let fieldCtx = (0, $048d76b84370f141$exports.useSlottedContext)((0, $433949643203e332$exports.FieldInputContext), props.slot);
63
+ let { value: _autocompleteValue, onChange: onAutocompleteChange, ref: autocompleteRef, ...autocompleteProps } = fieldCtx ?? {};
64
+ let inputRef = (0, $4P2rL$reactariauseObjectRef.useObjectRef)(autocompleteRef);
65
+ let isDisabled = props.isDisabled || false;
66
+ let isReadOnly = props.isReadOnly || false;
67
+ let state = (0, $4P2rL$reactstatelyuseTokenFieldState.useTokenFieldState)({
68
+ ...props,
69
+ onChange: (value)=>{
70
+ props.onChange?.(value);
71
+ onAutocompleteChange?.(value.toString());
72
+ }
73
+ });
74
+ let { tokenFieldProps: tokenFieldProps, labelProps: labelProps, descriptionProps: descriptionProps } = (0, $4P2rL$reactariauseTokenField.useTokenField)({
75
+ ...props,
76
+ label: // @ts-ignore - not a public prop, used to determine if slot is present
77
+ label,
78
+ role: props.role || autocompleteProps['role'] || 'textbox'
79
+ }, state, inputRef);
80
+ let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
81
+ ...props,
82
+ values: {
83
+ isDisabled: isDisabled,
84
+ isReadOnly: isReadOnly
85
+ },
86
+ defaultClassName: 'react-aria-TokenField'
87
+ });
88
+ let DOMProps = (0, $4P2rL$reactariafilterDOMProps.filterDOMProps)(props, {
89
+ global: true
90
+ });
91
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($4P2rL$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
92
+ ...DOMProps,
93
+ ...renderProps,
94
+ ref: ref,
95
+ slot: props.slot || undefined,
96
+ "data-disabled": isDisabled || undefined,
97
+ "data-readonly": isReadOnly || undefined
98
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($4P2rL$react))).createElement((0, $048d76b84370f141$exports.Provider), {
99
+ values: [
100
+ [
101
+ (0, $d5d46822336ca1e1$exports.LabelContext),
102
+ {
103
+ ...labelProps,
104
+ elementType: 'span',
105
+ ref: labelRef
106
+ }
107
+ ],
108
+ [
109
+ (0, $cab7d9a238d19c33$exports.TextContext),
110
+ {
111
+ slots: {
112
+ description: descriptionProps
113
+ }
114
+ }
115
+ ],
116
+ [
117
+ $95baf1bfb6adc271$var$TokenInputContext,
118
+ {
119
+ tokenFieldProps: tokenFieldProps,
120
+ state: state,
121
+ isDisabled: isDisabled,
122
+ isReadOnly: isReadOnly,
123
+ autocompleteProps: autocompleteProps,
124
+ ref: inputRef
125
+ }
126
+ ]
127
+ ]
128
+ }, renderProps.children));
129
+ });
130
+ const $95baf1bfb6adc271$export$4ddf413e820cfcc4 = /*#__PURE__*/ (0, $4P2rL$react.forwardRef)(function TokenInput(props, forwardedRef) {
131
+ let { tokenFieldProps: tokenFieldProps, state: state, isDisabled: isDisabled = false, isReadOnly: isReadOnly = false, autocompleteProps: autocompleteProps, ref: contextRef } = (0, $4P2rL$react.useContext)($95baf1bfb6adc271$var$TokenInputContext);
132
+ let ref = (0, $4P2rL$react.useMemo)(()=>(0, $4P2rL$reactariamergeRefs.mergeRefs)(contextRef, forwardedRef), [
133
+ contextRef,
134
+ forwardedRef
135
+ ]);
136
+ let { children: children, ...domProps } = props;
137
+ let { isHovered: isHovered, hoverProps: hoverProps } = (0, $4P2rL$reactariauseHover.useHover)(domProps);
138
+ let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $4P2rL$reactariauseFocusRing.useFocusRing)();
139
+ let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
140
+ ...domProps,
141
+ defaultClassName: 'react-aria-TokenInput',
142
+ values: {
143
+ isHovered: isHovered,
144
+ isFocused: isFocused,
145
+ isFocusVisible: isFocusVisible,
146
+ isDisabled: isDisabled,
147
+ isReadOnly: isReadOnly
148
+ }
149
+ });
150
+ let DOMProps = (0, $4P2rL$reactariafilterDOMProps.filterDOMProps)(domProps, {
151
+ global: true
152
+ });
153
+ let objectRef = (0, $4P2rL$reactariauseObjectRef.useObjectRef)(ref);
154
+ (0, $4P2rL$reactariaprivateutilsuseLayoutEffect.useLayoutEffect)(()=>$95baf1bfb6adc271$var$insertSelectionStyle(objectRef), [
155
+ objectRef
156
+ ]);
157
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($4P2rL$react))).createElement((0, $048d76b84370f141$exports.dom).div, {
158
+ ...(0, $4P2rL$reactariamergeProps.mergeProps)(DOMProps, renderProps, focusProps, hoverProps, tokenFieldProps, autocompleteProps),
159
+ ref: objectRef,
160
+ "data-focused": isFocused || undefined,
161
+ "data-focus-visible": isFocusVisible || undefined,
162
+ "data-disabled": isDisabled || undefined,
163
+ "data-readonly": isReadOnly || undefined,
164
+ style: {
165
+ ...renderProps.style,
166
+ ...tokenFieldProps?.style
167
+ }
168
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($4P2rL$react))).createElement($95baf1bfb6adc271$var$CompositionRenderBlocker, {
169
+ isComposing: state.isComposing
170
+ }, state.value.segments.map((v, i)=>{
171
+ switch(v.type){
172
+ case 'token':
173
+ {
174
+ let token = children(v);
175
+ return(// Wrap tokens in zero-width spaces so the cursor is placed correctly.
176
+ /*#__PURE__*/ (0, ($parcel$interopDefault($4P2rL$react))).createElement("span", {
177
+ key: i,
178
+ "data-react-aria-token": true
179
+ }, '\u200b', token, '\u200b'));
180
+ }
181
+ case 'text':
182
+ return v.text;
183
+ }
184
+ }), state.value.segments.at(-1)?.text.endsWith('\n') && /*#__PURE__*/ (0, ($parcel$interopDefault($4P2rL$react))).createElement("br", null)));
185
+ });
186
+ const $95baf1bfb6adc271$export$50792b0e93539fde = /*#__PURE__*/ (0, $4P2rL$react.forwardRef)(function Token(props, ref) {
187
+ let { isDisabled: isDisabled } = (0, $4P2rL$react.useContext)($95baf1bfb6adc271$var$TokenInputContext);
188
+ let objectRef = (0, $4P2rL$reactariauseObjectRef.useObjectRef)(ref);
189
+ let { tokenProps: tokenProps, isSelected: isSelected } = (0, $4P2rL$reactariauseTokenField.useToken)(props, {}, objectRef);
190
+ let renderProps = (0, $048d76b84370f141$exports.useRenderProps)({
191
+ ...props,
192
+ defaultClassName: 'react-aria-Token',
193
+ values: {
194
+ isSelected: isSelected,
195
+ isDisabled: isDisabled
196
+ }
197
+ });
198
+ let DOMProps = (0, $4P2rL$reactariafilterDOMProps.filterDOMProps)(props, {
199
+ global: true
200
+ });
201
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($4P2rL$react))).createElement((0, $048d76b84370f141$exports.dom).span, {
202
+ ref: objectRef,
203
+ ...(0, $4P2rL$reactariamergeProps.mergeProps)(DOMProps, renderProps, tokenProps),
204
+ "data-selected": isSelected || undefined,
205
+ "data-disabled": isDisabled || undefined,
206
+ style: {
207
+ ...renderProps.style,
208
+ ...tokenProps.style
209
+ }
210
+ }, renderProps.children);
211
+ });
212
+ // Prevents React from re-rendering during composition events.
213
+ const $95baf1bfb6adc271$var$CompositionRenderBlocker = /*#__PURE__*/ (0, $4P2rL$react.memo)(({ children: children })=>children, (prevProps, nextProps)=>nextProps.isComposing ? true : prevProps.children === nextProps.children);
214
+ // Inserts a stylesheet into the document / shadow root that hides the native text selection on tokens.
215
+ function $95baf1bfb6adc271$var$insertSelectionStyle(ref) {
216
+ if (typeof CSSStyleSheet !== 'function' || !ref || !ref.current) return;
217
+ let root = ref.current.getRootNode();
218
+ if (!(0, $4P2rL$reactariaprivateutilsdomHelpers.isDocument)(root) && !(0, $4P2rL$reactariaprivateutilsdomHelpers.isShadowRoot)(root)) return;
219
+ if (!root.adoptedStyleSheets) return;
220
+ // Skip if we already inserted it.
221
+ let sym = Symbol.for('react-aria-token-style');
222
+ if (root.adoptedStyleSheets.some((s)=>s[sym])) return;
223
+ let style = new CSSStyleSheet();
224
+ style[sym] = true;
225
+ // Firefox ignores completely transparent selection colors, so use a nearly transparent color instead.
226
+ style.replaceSync('[data-react-aria-token]::selection,[data-react-aria-token]>*::selection{background:#ffffff01}');
227
+ root.adoptedStyleSheets.push(style);
228
+ return ()=>{
229
+ let index = root.adoptedStyleSheets.indexOf(style);
230
+ if (index >= 0) root.adoptedStyleSheets.splice(index, 1);
231
+ };
232
+ }
233
+
234
+
235
+ //# sourceMappingURL=TokenField.cjs.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AA4IM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AAC9F,MAAM,wDAAoB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,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,aAAa,WAAW;QACjD,iBAAe,cAAc;QAC7B,iBAAe,cAAc;QAC7B,OAAO;YACL,GAAG,YAAY,KAAK;YACpB,GAAG,WAAW,KAAK;QACrB;OACC,YAAY,QAAQ;AAG3B;AAEA,8DAA8D;AAC9D,MAAM,+DAA2B,CAAA,GAAA,iBAAG,EAClC,CAAC,YAAC,QAAQ,EAAoD,GAAK,UACnE,CAAC,WAAW,YACV,UAAU,WAAW,GAAG,OAAO,UAAU,QAAQ,KAAK,UAAU,QAAQ;AAG5E,uGAAuG;AACvG,SAAS,2CAAqB,GAA4C;IACxE,IAAI,OAAO,kBAAkB,cAAc,CAAC,OAAO,CAAC,IAAI,OAAO,EAC7D;IAGF,IAAI,OAAO,IAAI,OAAO,CAAC,WAAW;IAClC,IAAI,CAAC,CAAA,GAAA,iDAAS,EAAE,SAAS,CAAC,CAAA,GAAA,mDAAW,EAAE,OACrC;IAGF,IAAI,CAAC,KAAK,kBAAkB,EAC1B;IAGF,kCAAkC;IAClC,IAAI,MAAM,OAAO,GAAG,CAAC;IACrB,IAAI,KAAK,kBAAkB,CAAC,IAAI,CAAC,CAAA,IAAK,CAAC,CAAC,IAAI,GAC1C;IAGF,IAAI,QAAQ,IAAI;IAChB,KAAK,CAAC,IAAI,GAAG;IACb,sGAAsG;IACtG,MAAM,WAAW,CACf;IAEF,KAAK,kBAAkB,CAAC,IAAI,CAAC;IAE7B,OAAO;QACL,IAAI,QAAQ,KAAK,kBAAkB,CAAC,OAAO,CAAC;QAC5C,IAAI,SAAS,GACX,KAAK,kBAAkB,CAAC,MAAM,CAAC,OAAO;IAE1C;AACF","sources":["packages/react-aria-components/src/TokenField.tsx"],"sourcesContent":["/*\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaTokenFieldProps} from 'react-aria/useTokenField';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {createHideableComponent} from 'react-aria/private/collections/Hidden';\nimport {FieldInputContext} from './Autocomplete';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport {HoverProps, useHover} from 'react-aria/useHover';\nimport {isDocument, isShadowRoot} from 'react-aria/private/utils/domHelpers';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n HTMLAttributes,\n memo,\n RefObject,\n useContext,\n useMemo\n} from 'react';\nimport {TextContext} from './Text';\nimport {\n TokenFieldState,\n TokenFieldValue,\n TokenSegment,\n useTokenFieldState\n} from 'react-stately/useTokenFieldState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useToken, useTokenField} from 'react-aria/useTokenField';\n\nexport interface TokenFieldRenderProps {\n /**\n * Whether the token field is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the token field is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n}\n\nexport interface TokenFieldProps<T extends TokenFieldValue = TokenFieldValue>\n extends\n AriaTokenFieldProps<T>,\n RenderProps<TokenFieldRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-TokenField'\n */\n className?: ClassNameOrFunction<TokenFieldRenderProps>;\n}\n\nexport interface TokenInputRenderProps {\n /**\n * Whether the token input is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n /**\n * Whether the token input is focused, either via a mouse or keyboard.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the token input is keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the token input is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the token input is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n}\n\nexport interface TokenInputProps<T extends TokenFieldValue = TokenFieldValue>\n extends\n HoverProps,\n StyleRenderProps<TokenInputRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * A function that renders a token for each segment in the token field.\n */\n children: (\n segment: TokenSegment<T extends TokenFieldValue<infer V> ? V : never>\n ) => React.ReactElement;\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-TokenInput'\n */\n className?: ClassNameOrFunction<TokenInputRenderProps>;\n}\n\ninterface TokenInputContextValue<T extends TokenFieldValue = TokenFieldValue> {\n tokenFieldProps: HTMLAttributes<HTMLDivElement>;\n state: TokenFieldState<T>;\n isDisabled: boolean;\n isReadOnly: boolean;\n autocompleteProps?: HTMLAttributes<HTMLDivElement>;\n ref: RefObject<HTMLDivElement | null>;\n}\n\nexport const TokenFieldContext = createContext<ContextValue<TokenFieldProps, HTMLDivElement>>(null);\nconst TokenInputContext = createContext<TokenInputContextValue | null>(null);\n\n/**\n * A token field allows users to enter text with inline tokens. Use it to build AI prompt fields,\n * tag inputs, structured search fields, mention inputs, and multi-select comboboxes.\n */\nexport const TokenField = /*#__PURE__*/ createHideableComponent(function TokenField<\n T extends TokenFieldValue = TokenFieldValue\n>(props: TokenFieldProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TokenFieldContext);\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n\n let fieldCtx = useSlottedContext(FieldInputContext, props.slot);\n let {\n value: _autocompleteValue,\n onChange: onAutocompleteChange,\n ref: autocompleteRef,\n ...autocompleteProps\n } = fieldCtx ?? {};\n let inputRef = useObjectRef(autocompleteRef);\n\n let isDisabled = props.isDisabled || false;\n let isReadOnly = props.isReadOnly || false;\n\n let state = useTokenFieldState<T>({\n ...props,\n onChange: (value: T) => {\n props.onChange?.(value);\n onAutocompleteChange?.(value.toString());\n }\n });\n\n let {tokenFieldProps, labelProps, descriptionProps} = useTokenField(\n {\n ...props,\n // @ts-ignore - not a public prop, used to determine if slot is present\n label,\n role: props.role || autocompleteProps['role'] || 'textbox'\n },\n state,\n inputRef\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isDisabled,\n isReadOnly\n },\n defaultClassName: 'react-aria-TokenField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps\n }\n }\n ],\n [\n TokenInputContext,\n {\n tokenFieldProps,\n state: state as any,\n isDisabled,\n isReadOnly,\n autocompleteProps: autocompleteProps as HTMLAttributes<HTMLDivElement>,\n ref: inputRef as RefObject<HTMLDivElement | null>\n }\n ]\n ]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A token input represents the editable area within a token field.\n */\nexport const TokenInput = /*#__PURE__*/ (forwardRef as forwardRefType)(function TokenInput<\n T extends TokenFieldValue = TokenFieldValue\n>(props: TokenInputProps<T>, forwardedRef: ForwardedRef<HTMLDivElement | null>) {\n let {\n tokenFieldProps,\n state,\n isDisabled = false,\n isReadOnly = false,\n autocompleteProps,\n ref: contextRef\n } = useContext(TokenInputContext)!;\n let ref = useMemo(() => mergeRefs(contextRef, forwardedRef), [contextRef, forwardedRef]);\n let {children, ...domProps} = props;\n\n let {isHovered, hoverProps} = useHover(domProps);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n\n let renderProps = useRenderProps({\n ...domProps,\n defaultClassName: 'react-aria-TokenInput',\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly\n }\n });\n\n let DOMProps = filterDOMProps(domProps, {global: true});\n let objectRef = useObjectRef(ref);\n useLayoutEffect(() => insertSelectionStyle(objectRef), [objectRef]);\n\n return (\n <dom.div\n {...mergeProps(\n DOMProps,\n renderProps,\n focusProps,\n hoverProps,\n tokenFieldProps,\n autocompleteProps\n )}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}\n style={{...renderProps.style, ...tokenFieldProps?.style}}>\n <CompositionRenderBlocker isComposing={state.isComposing}>\n {state.value.segments.map((v, i) => {\n switch (v.type) {\n case 'token': {\n let token = children(v);\n return (\n // Wrap tokens in zero-width spaces so the cursor is placed correctly.\n <span key={i} data-react-aria-token>\n {'\\u200b'}\n {token}\n {'\\u200b'}\n </span>\n );\n }\n case 'text':\n return v.text;\n }\n })}\n {/* Force cursor to the next line if the last segment ends with a newline. */}\n {state.value.segments.at(-1)?.text.endsWith('\\n') && <br />}\n </CompositionRenderBlocker>\n </dom.div>\n );\n});\n\nexport interface TokenRenderProps {\n /**\n * Whether the token is selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * Whether the token is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n}\n\nexport interface TokenProps\n extends RenderProps<TokenRenderProps, 'span'>, GlobalDOMAttributes<HTMLSpanElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Token'\n */\n className?: ClassNameOrFunction<TokenRenderProps>;\n}\n\n/**\n * A token represents an inline segment within a token field.\n */\nexport const Token = forwardRef(function Token(\n props: TokenProps,\n ref: ForwardedRef<HTMLSpanElement>\n) {\n let {isDisabled} = useContext(TokenInputContext)!;\n let objectRef = useObjectRef(ref);\n let {tokenProps, isSelected} = useToken(props, {}, objectRef);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Token',\n values: {\n isSelected,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.span\n ref={objectRef}\n {...mergeProps(DOMProps, renderProps, tokenProps)}\n data-selected={isSelected || undefined}\n data-disabled={isDisabled || undefined}\n style={{\n ...renderProps.style,\n ...tokenProps.style\n }}>\n {renderProps.children}\n </dom.span>\n );\n});\n\n// Prevents React from re-rendering during composition events.\nconst CompositionRenderBlocker = memo(\n ({children}: {children: React.ReactNode; isComposing: boolean}) => children,\n (prevProps, nextProps) =>\n nextProps.isComposing ? true : prevProps.children === nextProps.children\n);\n\n// Inserts a stylesheet into the document / shadow root that hides the native text selection on tokens.\nfunction insertSelectionStyle(ref: RefObject<HTMLDivElement | null> | null) {\n if (typeof CSSStyleSheet !== 'function' || !ref || !ref.current) {\n return;\n }\n\n let root = ref.current.getRootNode();\n if (!isDocument(root) && !isShadowRoot(root)) {\n return;\n }\n\n if (!root.adoptedStyleSheets) {\n return;\n }\n\n // Skip if we already inserted it.\n let sym = Symbol.for('react-aria-token-style');\n if (root.adoptedStyleSheets.some(s => s[sym])) {\n return;\n }\n\n let style = new CSSStyleSheet();\n style[sym] = true;\n // Firefox ignores completely transparent selection colors, so use a nearly transparent color instead.\n style.replaceSync(\n '[data-react-aria-token]::selection,[data-react-aria-token]>*::selection{background:#ffffff01}'\n );\n root.adoptedStyleSheets.push(style);\n\n return () => {\n let index = root.adoptedStyleSheets.indexOf(style);\n if (index >= 0) {\n root.adoptedStyleSheets.splice(index, 1);\n }\n };\n}\n"],"names":[],"version":3,"file":"TokenField.cjs.map"}
@@ -0,0 +1,225 @@
1
+ import {dom as $b7b7a92703138c9b$export$df3a06d6289f983e, Provider as $b7b7a92703138c9b$export$2881499e37b75b9a, useContextProps as $b7b7a92703138c9b$export$29f1550f4b0d4415, useRenderProps as $b7b7a92703138c9b$export$4d86445c2cf5e3, useSlot as $b7b7a92703138c9b$export$9d4c57ee4c6ffdd8, useSlottedContext as $b7b7a92703138c9b$export$fabf2dc03a41866e} from "./utils.js";
2
+ import {FieldInputContext as $8f09b710ef85b337$export$698f465ec27e93df} from "./Autocomplete.js";
3
+ import {LabelContext as $3e4839e5b30e7b17$export$75b6ee27786ba447} from "./Label.js";
4
+ import {TextContext as $20d769b1e2b13352$export$9afb8bc826b033ea} from "./Text.js";
5
+ import {createHideableComponent as $lOx05$createHideableComponent} from "react-aria/private/collections/Hidden";
6
+ import {filterDOMProps as $lOx05$filterDOMProps} from "react-aria/filterDOMProps";
7
+ import {useHover as $lOx05$useHover} from "react-aria/useHover";
8
+ import {isDocument as $lOx05$isDocument, isShadowRoot as $lOx05$isShadowRoot} from "react-aria/private/utils/domHelpers";
9
+ import {mergeProps as $lOx05$mergeProps} from "react-aria/mergeProps";
10
+ import {mergeRefs as $lOx05$mergeRefs} from "react-aria/mergeRefs";
11
+ import $lOx05$react, {createContext as $lOx05$createContext, forwardRef as $lOx05$forwardRef, useContext as $lOx05$useContext, useMemo as $lOx05$useMemo, memo as $lOx05$memo} from "react";
12
+ import {useTokenFieldState as $lOx05$useTokenFieldState} from "react-stately/useTokenFieldState";
13
+ import {useFocusRing as $lOx05$useFocusRing} from "react-aria/useFocusRing";
14
+ import {useLayoutEffect as $lOx05$useLayoutEffect} from "react-aria/private/utils/useLayoutEffect";
15
+ import {useObjectRef as $lOx05$useObjectRef} from "react-aria/useObjectRef";
16
+ import {useTokenField as $lOx05$useTokenField, useToken as $lOx05$useToken} from "react-aria/useTokenField";
17
+
18
+ /*
19
+ * Copyright 2026 Adobe. All rights reserved.
20
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
21
+ * you may not use this file except in compliance with the License. You may obtain a copy
22
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
23
+ *
24
+ * Unless required by applicable law or agreed to in writing, software distributed under
25
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
26
+ * OF ANY KIND, either express or implied. See the License for the specific language
27
+ * governing permissions and limitations under the License.
28
+ */
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+ const $0557236f0f66b699$export$24532e5e37c56ff2 = /*#__PURE__*/ (0, $lOx05$createContext)(null);
45
+ const $0557236f0f66b699$var$TokenInputContext = /*#__PURE__*/ (0, $lOx05$createContext)(null);
46
+ const $0557236f0f66b699$export$e4550c392cbe69d7 = /*#__PURE__*/ (0, $lOx05$createHideableComponent)(function TokenField(props, ref) {
47
+ [props, ref] = (0, $b7b7a92703138c9b$export$29f1550f4b0d4415)(props, ref, $0557236f0f66b699$export$24532e5e37c56ff2);
48
+ let [labelRef, label] = (0, $b7b7a92703138c9b$export$9d4c57ee4c6ffdd8)(!props['aria-label'] && !props['aria-labelledby']);
49
+ let fieldCtx = (0, $b7b7a92703138c9b$export$fabf2dc03a41866e)((0, $8f09b710ef85b337$export$698f465ec27e93df), props.slot);
50
+ let { value: _autocompleteValue, onChange: onAutocompleteChange, ref: autocompleteRef, ...autocompleteProps } = fieldCtx !== null && fieldCtx !== void 0 ? fieldCtx : {};
51
+ let inputRef = (0, $lOx05$useObjectRef)(autocompleteRef);
52
+ let isDisabled = props.isDisabled || false;
53
+ let isReadOnly = props.isReadOnly || false;
54
+ let state = (0, $lOx05$useTokenFieldState)({
55
+ ...props,
56
+ onChange: (value)=>{
57
+ var _props_onChange;
58
+ (_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, value);
59
+ onAutocompleteChange === null || onAutocompleteChange === void 0 ? void 0 : onAutocompleteChange(value.toString());
60
+ }
61
+ });
62
+ let { tokenFieldProps: tokenFieldProps, labelProps: labelProps, descriptionProps: descriptionProps } = (0, $lOx05$useTokenField)({
63
+ ...props,
64
+ label: // @ts-ignore - not a public prop, used to determine if slot is present
65
+ label,
66
+ role: props.role || autocompleteProps['role'] || 'textbox'
67
+ }, state, inputRef);
68
+ let renderProps = (0, $b7b7a92703138c9b$export$4d86445c2cf5e3)({
69
+ ...props,
70
+ values: {
71
+ isDisabled: isDisabled,
72
+ isReadOnly: isReadOnly
73
+ },
74
+ defaultClassName: 'react-aria-TokenField'
75
+ });
76
+ let DOMProps = (0, $lOx05$filterDOMProps)(props, {
77
+ global: true
78
+ });
79
+ return /*#__PURE__*/ (0, $lOx05$react).createElement((0, $b7b7a92703138c9b$export$df3a06d6289f983e).div, {
80
+ ...DOMProps,
81
+ ...renderProps,
82
+ ref: ref,
83
+ slot: props.slot || undefined,
84
+ "data-disabled": isDisabled || undefined,
85
+ "data-readonly": isReadOnly || undefined
86
+ }, /*#__PURE__*/ (0, $lOx05$react).createElement((0, $b7b7a92703138c9b$export$2881499e37b75b9a), {
87
+ values: [
88
+ [
89
+ (0, $3e4839e5b30e7b17$export$75b6ee27786ba447),
90
+ {
91
+ ...labelProps,
92
+ elementType: 'span',
93
+ ref: labelRef
94
+ }
95
+ ],
96
+ [
97
+ (0, $20d769b1e2b13352$export$9afb8bc826b033ea),
98
+ {
99
+ slots: {
100
+ description: descriptionProps
101
+ }
102
+ }
103
+ ],
104
+ [
105
+ $0557236f0f66b699$var$TokenInputContext,
106
+ {
107
+ tokenFieldProps: tokenFieldProps,
108
+ state: state,
109
+ isDisabled: isDisabled,
110
+ isReadOnly: isReadOnly,
111
+ autocompleteProps: autocompleteProps,
112
+ ref: inputRef
113
+ }
114
+ ]
115
+ ]
116
+ }, renderProps.children));
117
+ });
118
+ const $0557236f0f66b699$export$4ddf413e820cfcc4 = /*#__PURE__*/ (0, $lOx05$forwardRef)(function TokenInput(props, forwardedRef) {
119
+ var _state_value_segments_at;
120
+ let { tokenFieldProps: tokenFieldProps, state: state, isDisabled: isDisabled = false, isReadOnly: isReadOnly = false, autocompleteProps: autocompleteProps, ref: contextRef } = (0, $lOx05$useContext)($0557236f0f66b699$var$TokenInputContext);
121
+ let ref = (0, $lOx05$useMemo)(()=>(0, $lOx05$mergeRefs)(contextRef, forwardedRef), [
122
+ contextRef,
123
+ forwardedRef
124
+ ]);
125
+ let { children: children, ...domProps } = props;
126
+ let { isHovered: isHovered, hoverProps: hoverProps } = (0, $lOx05$useHover)(domProps);
127
+ let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $lOx05$useFocusRing)();
128
+ let renderProps = (0, $b7b7a92703138c9b$export$4d86445c2cf5e3)({
129
+ ...domProps,
130
+ defaultClassName: 'react-aria-TokenInput',
131
+ values: {
132
+ isHovered: isHovered,
133
+ isFocused: isFocused,
134
+ isFocusVisible: isFocusVisible,
135
+ isDisabled: isDisabled,
136
+ isReadOnly: isReadOnly
137
+ }
138
+ });
139
+ let DOMProps = (0, $lOx05$filterDOMProps)(domProps, {
140
+ global: true
141
+ });
142
+ let objectRef = (0, $lOx05$useObjectRef)(ref);
143
+ (0, $lOx05$useLayoutEffect)(()=>$0557236f0f66b699$var$insertSelectionStyle(objectRef), [
144
+ objectRef
145
+ ]);
146
+ return /*#__PURE__*/ (0, $lOx05$react).createElement((0, $b7b7a92703138c9b$export$df3a06d6289f983e).div, {
147
+ ...(0, $lOx05$mergeProps)(DOMProps, renderProps, focusProps, hoverProps, tokenFieldProps, autocompleteProps),
148
+ ref: objectRef,
149
+ "data-focused": isFocused || undefined,
150
+ "data-focus-visible": isFocusVisible || undefined,
151
+ "data-disabled": isDisabled || undefined,
152
+ "data-readonly": isReadOnly || undefined,
153
+ style: {
154
+ ...renderProps.style,
155
+ ...tokenFieldProps === null || tokenFieldProps === void 0 ? void 0 : tokenFieldProps.style
156
+ }
157
+ }, /*#__PURE__*/ (0, $lOx05$react).createElement($0557236f0f66b699$var$CompositionRenderBlocker, {
158
+ isComposing: state.isComposing
159
+ }, state.value.segments.map((v, i)=>{
160
+ switch(v.type){
161
+ case 'token':
162
+ {
163
+ let token = children(v);
164
+ return(// Wrap tokens in zero-width spaces so the cursor is placed correctly.
165
+ /*#__PURE__*/ (0, $lOx05$react).createElement("span", {
166
+ key: i,
167
+ "data-react-aria-token": true
168
+ }, '\u200b', token, '\u200b'));
169
+ }
170
+ case 'text':
171
+ return v.text;
172
+ }
173
+ }), ((_state_value_segments_at = state.value.segments.at(-1)) === null || _state_value_segments_at === void 0 ? void 0 : _state_value_segments_at.text.endsWith('\n')) && /*#__PURE__*/ (0, $lOx05$react).createElement("br", null)));
174
+ });
175
+ const $0557236f0f66b699$export$50792b0e93539fde = /*#__PURE__*/ (0, $lOx05$forwardRef)(function Token(props, ref) {
176
+ let { isDisabled: isDisabled } = (0, $lOx05$useContext)($0557236f0f66b699$var$TokenInputContext);
177
+ let objectRef = (0, $lOx05$useObjectRef)(ref);
178
+ let { tokenProps: tokenProps, isSelected: isSelected } = (0, $lOx05$useToken)(props, {}, objectRef);
179
+ let renderProps = (0, $b7b7a92703138c9b$export$4d86445c2cf5e3)({
180
+ ...props,
181
+ defaultClassName: 'react-aria-Token',
182
+ values: {
183
+ isSelected: isSelected,
184
+ isDisabled: isDisabled
185
+ }
186
+ });
187
+ let DOMProps = (0, $lOx05$filterDOMProps)(props, {
188
+ global: true
189
+ });
190
+ return /*#__PURE__*/ (0, $lOx05$react).createElement((0, $b7b7a92703138c9b$export$df3a06d6289f983e).span, {
191
+ ref: objectRef,
192
+ ...(0, $lOx05$mergeProps)(DOMProps, renderProps, tokenProps),
193
+ "data-selected": isSelected || undefined,
194
+ "data-disabled": isDisabled || undefined,
195
+ style: {
196
+ ...renderProps.style,
197
+ ...tokenProps.style
198
+ }
199
+ }, renderProps.children);
200
+ });
201
+ // Prevents React from re-rendering during composition events.
202
+ const $0557236f0f66b699$var$CompositionRenderBlocker = /*#__PURE__*/ (0, $lOx05$memo)(({ children: children })=>children, (prevProps, nextProps)=>nextProps.isComposing ? true : prevProps.children === nextProps.children);
203
+ // Inserts a stylesheet into the document / shadow root that hides the native text selection on tokens.
204
+ function $0557236f0f66b699$var$insertSelectionStyle(ref) {
205
+ if (typeof CSSStyleSheet !== 'function' || !ref || !ref.current) return;
206
+ let root = ref.current.getRootNode();
207
+ if (!(0, $lOx05$isDocument)(root) && !(0, $lOx05$isShadowRoot)(root)) return;
208
+ if (!root.adoptedStyleSheets) return;
209
+ // Skip if we already inserted it.
210
+ let sym = Symbol.for('react-aria-token-style');
211
+ if (root.adoptedStyleSheets.some((s)=>s[sym])) return;
212
+ let style = new CSSStyleSheet();
213
+ style[sym] = true;
214
+ // Firefox ignores completely transparent selection colors, so use a nearly transparent color instead.
215
+ style.replaceSync('[data-react-aria-token]::selection,[data-react-aria-token]>*::selection{background:#ffffff01}');
216
+ root.adoptedStyleSheets.push(style);
217
+ return ()=>{
218
+ let index = root.adoptedStyleSheets.indexOf(style);
219
+ if (index >= 0) root.adoptedStyleSheets.splice(index, 1);
220
+ };
221
+ }
222
+
223
+
224
+ export {$0557236f0f66b699$export$24532e5e37c56ff2 as TokenFieldContext, $0557236f0f66b699$export$e4550c392cbe69d7 as TokenField, $0557236f0f66b699$export$4ddf413e820cfcc4 as TokenInput, $0557236f0f66b699$export$50792b0e93539fde as Token};
225
+ //# sourceMappingURL=TokenField.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AA4IM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAiD;AAC9F,MAAM,wDAAoB,CAAA,GAAA,oBAAY,EAAiC;AAMhE,MAAM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AAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC,CAAA,GAAA,yCAAE,EAAE,IAAI;QACP,KAAK;QACJ,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,WAAW;QACjD,iBAAe,cAAc;QAC7B,iBAAe,cAAc;QAC7B,OAAO;YACL,GAAG,YAAY,KAAK;YACpB,GAAG,WAAW,KAAK;QACrB;OACC,YAAY,QAAQ;AAG3B;AAEA,8DAA8D;AAC9D,MAAM,+DAA2B,CAAA,GAAA,WAAG,EAClC,CAAC,YAAC,QAAQ,EAAoD,GAAK,UACnE,CAAC,WAAW,YACV,UAAU,WAAW,GAAG,OAAO,UAAU,QAAQ,KAAK,UAAU,QAAQ;AAG5E,uGAAuG;AACvG,SAAS,2CAAqB,GAA4C;IACxE,IAAI,OAAO,kBAAkB,cAAc,CAAC,OAAO,CAAC,IAAI,OAAO,EAC7D;IAGF,IAAI,OAAO,IAAI,OAAO,CAAC,WAAW;IAClC,IAAI,CAAC,CAAA,GAAA,iBAAS,EAAE,SAAS,CAAC,CAAA,GAAA,mBAAW,EAAE,OACrC;IAGF,IAAI,CAAC,KAAK,kBAAkB,EAC1B;IAGF,kCAAkC;IAClC,IAAI,MAAM,OAAO,GAAG,CAAC;IACrB,IAAI,KAAK,kBAAkB,CAAC,IAAI,CAAC,CAAA,IAAK,CAAC,CAAC,IAAI,GAC1C;IAGF,IAAI,QAAQ,IAAI;IAChB,KAAK,CAAC,IAAI,GAAG;IACb,sGAAsG;IACtG,MAAM,WAAW,CACf;IAEF,KAAK,kBAAkB,CAAC,IAAI,CAAC;IAE7B,OAAO;QACL,IAAI,QAAQ,KAAK,kBAAkB,CAAC,OAAO,CAAC;QAC5C,IAAI,SAAS,GACX,KAAK,kBAAkB,CAAC,MAAM,CAAC,OAAO;IAE1C;AACF","sources":["packages/react-aria-components/src/TokenField.tsx"],"sourcesContent":["/*\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaTokenFieldProps} from 'react-aria/useTokenField';\nimport {\n ClassNameOrFunction,\n ContextValue,\n dom,\n Provider,\n RenderProps,\n SlotProps,\n StyleRenderProps,\n useContextProps,\n useRenderProps,\n useSlot,\n useSlottedContext\n} from './utils';\nimport {createHideableComponent} from 'react-aria/private/collections/Hidden';\nimport {FieldInputContext} from './Autocomplete';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport {HoverProps, useHover} from 'react-aria/useHover';\nimport {isDocument, isShadowRoot} from 'react-aria/private/utils/domHelpers';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport React, {\n createContext,\n ForwardedRef,\n forwardRef,\n HTMLAttributes,\n memo,\n RefObject,\n useContext,\n useMemo\n} from 'react';\nimport {TextContext} from './Text';\nimport {\n TokenFieldState,\n TokenFieldValue,\n TokenSegment,\n useTokenFieldState\n} from 'react-stately/useTokenFieldState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useToken, useTokenField} from 'react-aria/useTokenField';\n\nexport interface TokenFieldRenderProps {\n /**\n * Whether the token field is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the token field is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n}\n\nexport interface TokenFieldProps<T extends TokenFieldValue = TokenFieldValue>\n extends\n AriaTokenFieldProps<T>,\n RenderProps<TokenFieldRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-TokenField'\n */\n className?: ClassNameOrFunction<TokenFieldRenderProps>;\n}\n\nexport interface TokenInputRenderProps {\n /**\n * Whether the token input is currently hovered with a mouse.\n *\n * @selector [data-hovered]\n */\n isHovered: boolean;\n /**\n * Whether the token input is focused, either via a mouse or keyboard.\n *\n * @selector [data-focused]\n */\n isFocused: boolean;\n /**\n * Whether the token input is keyboard focused.\n *\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean;\n /**\n * Whether the token input is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n /**\n * Whether the token input is read only.\n *\n * @selector [data-readonly]\n */\n isReadOnly: boolean;\n}\n\nexport interface TokenInputProps<T extends TokenFieldValue = TokenFieldValue>\n extends\n HoverProps,\n StyleRenderProps<TokenInputRenderProps>,\n SlotProps,\n GlobalDOMAttributes<HTMLDivElement> {\n /**\n * A function that renders a token for each segment in the token field.\n */\n children: (\n segment: TokenSegment<T extends TokenFieldValue<infer V> ? V : never>\n ) => React.ReactElement;\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-TokenInput'\n */\n className?: ClassNameOrFunction<TokenInputRenderProps>;\n}\n\ninterface TokenInputContextValue<T extends TokenFieldValue = TokenFieldValue> {\n tokenFieldProps: HTMLAttributes<HTMLDivElement>;\n state: TokenFieldState<T>;\n isDisabled: boolean;\n isReadOnly: boolean;\n autocompleteProps?: HTMLAttributes<HTMLDivElement>;\n ref: RefObject<HTMLDivElement | null>;\n}\n\nexport const TokenFieldContext = createContext<ContextValue<TokenFieldProps, HTMLDivElement>>(null);\nconst TokenInputContext = createContext<TokenInputContextValue | null>(null);\n\n/**\n * A token field allows users to enter text with inline tokens. Use it to build AI prompt fields,\n * tag inputs, structured search fields, mention inputs, and multi-select comboboxes.\n */\nexport const TokenField = /*#__PURE__*/ createHideableComponent(function TokenField<\n T extends TokenFieldValue = TokenFieldValue\n>(props: TokenFieldProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TokenFieldContext);\n let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n\n let fieldCtx = useSlottedContext(FieldInputContext, props.slot);\n let {\n value: _autocompleteValue,\n onChange: onAutocompleteChange,\n ref: autocompleteRef,\n ...autocompleteProps\n } = fieldCtx ?? {};\n let inputRef = useObjectRef(autocompleteRef);\n\n let isDisabled = props.isDisabled || false;\n let isReadOnly = props.isReadOnly || false;\n\n let state = useTokenFieldState<T>({\n ...props,\n onChange: (value: T) => {\n props.onChange?.(value);\n onAutocompleteChange?.(value.toString());\n }\n });\n\n let {tokenFieldProps, labelProps, descriptionProps} = useTokenField(\n {\n ...props,\n // @ts-ignore - not a public prop, used to determine if slot is present\n label,\n role: props.role || autocompleteProps['role'] || 'textbox'\n },\n state,\n inputRef\n );\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isDisabled,\n isReadOnly\n },\n defaultClassName: 'react-aria-TokenField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps\n }\n }\n ],\n [\n TokenInputContext,\n {\n tokenFieldProps,\n state: state as any,\n isDisabled,\n isReadOnly,\n autocompleteProps: autocompleteProps as HTMLAttributes<HTMLDivElement>,\n ref: inputRef as RefObject<HTMLDivElement | null>\n }\n ]\n ]}>\n {renderProps.children}\n </Provider>\n </dom.div>\n );\n});\n\n/**\n * A token input represents the editable area within a token field.\n */\nexport const TokenInput = /*#__PURE__*/ (forwardRef as forwardRefType)(function TokenInput<\n T extends TokenFieldValue = TokenFieldValue\n>(props: TokenInputProps<T>, forwardedRef: ForwardedRef<HTMLDivElement | null>) {\n let {\n tokenFieldProps,\n state,\n isDisabled = false,\n isReadOnly = false,\n autocompleteProps,\n ref: contextRef\n } = useContext(TokenInputContext)!;\n let ref = useMemo(() => mergeRefs(contextRef, forwardedRef), [contextRef, forwardedRef]);\n let {children, ...domProps} = props;\n\n let {isHovered, hoverProps} = useHover(domProps);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n\n let renderProps = useRenderProps({\n ...domProps,\n defaultClassName: 'react-aria-TokenInput',\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly\n }\n });\n\n let DOMProps = filterDOMProps(domProps, {global: true});\n let objectRef = useObjectRef(ref);\n useLayoutEffect(() => insertSelectionStyle(objectRef), [objectRef]);\n\n return (\n <dom.div\n {...mergeProps(\n DOMProps,\n renderProps,\n focusProps,\n hoverProps,\n tokenFieldProps,\n autocompleteProps\n )}\n ref={objectRef}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={isReadOnly || undefined}\n style={{...renderProps.style, ...tokenFieldProps?.style}}>\n <CompositionRenderBlocker isComposing={state.isComposing}>\n {state.value.segments.map((v, i) => {\n switch (v.type) {\n case 'token': {\n let token = children(v);\n return (\n // Wrap tokens in zero-width spaces so the cursor is placed correctly.\n <span key={i} data-react-aria-token>\n {'\\u200b'}\n {token}\n {'\\u200b'}\n </span>\n );\n }\n case 'text':\n return v.text;\n }\n })}\n {/* Force cursor to the next line if the last segment ends with a newline. */}\n {state.value.segments.at(-1)?.text.endsWith('\\n') && <br />}\n </CompositionRenderBlocker>\n </dom.div>\n );\n});\n\nexport interface TokenRenderProps {\n /**\n * Whether the token is selected.\n *\n * @selector [data-selected]\n */\n isSelected: boolean;\n /**\n * Whether the token is disabled.\n *\n * @selector [data-disabled]\n */\n isDisabled: boolean;\n}\n\nexport interface TokenProps\n extends RenderProps<TokenRenderProps, 'span'>, GlobalDOMAttributes<HTMLSpanElement> {\n /**\n * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n * element. A function may be provided to compute the class based on component state.\n *\n * @default 'react-aria-Token'\n */\n className?: ClassNameOrFunction<TokenRenderProps>;\n}\n\n/**\n * A token represents an inline segment within a token field.\n */\nexport const Token = forwardRef(function Token(\n props: TokenProps,\n ref: ForwardedRef<HTMLSpanElement>\n) {\n let {isDisabled} = useContext(TokenInputContext)!;\n let objectRef = useObjectRef(ref);\n let {tokenProps, isSelected} = useToken(props, {}, objectRef);\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Token',\n values: {\n isSelected,\n isDisabled\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <dom.span\n ref={objectRef}\n {...mergeProps(DOMProps, renderProps, tokenProps)}\n data-selected={isSelected || undefined}\n data-disabled={isDisabled || undefined}\n style={{\n ...renderProps.style,\n ...tokenProps.style\n }}>\n {renderProps.children}\n </dom.span>\n );\n});\n\n// Prevents React from re-rendering during composition events.\nconst CompositionRenderBlocker = memo(\n ({children}: {children: React.ReactNode; isComposing: boolean}) => children,\n (prevProps, nextProps) =>\n nextProps.isComposing ? true : prevProps.children === nextProps.children\n);\n\n// Inserts a stylesheet into the document / shadow root that hides the native text selection on tokens.\nfunction insertSelectionStyle(ref: RefObject<HTMLDivElement | null> | null) {\n if (typeof CSSStyleSheet !== 'function' || !ref || !ref.current) {\n return;\n }\n\n let root = ref.current.getRootNode();\n if (!isDocument(root) && !isShadowRoot(root)) {\n return;\n }\n\n if (!root.adoptedStyleSheets) {\n return;\n }\n\n // Skip if we already inserted it.\n let sym = Symbol.for('react-aria-token-style');\n if (root.adoptedStyleSheets.some(s => s[sym])) {\n return;\n }\n\n let style = new CSSStyleSheet();\n style[sym] = true;\n // Firefox ignores completely transparent selection colors, so use a nearly transparent color instead.\n style.replaceSync(\n '[data-react-aria-token]::selection,[data-react-aria-token]>*::selection{background:#ffffff01}'\n );\n root.adoptedStyleSheets.push(style);\n\n return () => {\n let index = root.adoptedStyleSheets.indexOf(style);\n if (index >= 0) {\n root.adoptedStyleSheets.splice(index, 1);\n }\n };\n}\n"],"names":[],"version":3,"file":"TokenField.js.map"}