react-aria-components 3.0.0-nightly-ab9fd5c68-241125 → 3.0.0-nightly-10a43de88-241127

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 (315) hide show
  1. package/dist/Breadcrumbs.main.js +2 -5
  2. package/dist/Breadcrumbs.main.js.map +1 -1
  3. package/dist/Breadcrumbs.mjs +3 -6
  4. package/dist/Breadcrumbs.module.js +3 -6
  5. package/dist/Breadcrumbs.module.js.map +1 -1
  6. package/dist/Button.main.js +2 -5
  7. package/dist/Button.main.js.map +1 -1
  8. package/dist/Button.mjs +2 -5
  9. package/dist/Button.module.js +2 -5
  10. package/dist/Button.module.js.map +1 -1
  11. package/dist/Calendar.main.js +9 -22
  12. package/dist/Calendar.main.js.map +1 -1
  13. package/dist/Calendar.mjs +9 -22
  14. package/dist/Calendar.module.js +9 -22
  15. package/dist/Calendar.module.js.map +1 -1
  16. package/dist/Checkbox.main.js +5 -12
  17. package/dist/Checkbox.main.js.map +1 -1
  18. package/dist/Checkbox.mjs +6 -13
  19. package/dist/Checkbox.module.js +6 -13
  20. package/dist/Checkbox.module.js.map +1 -1
  21. package/dist/ColorArea.main.js +2 -5
  22. package/dist/ColorArea.main.js.map +1 -1
  23. package/dist/ColorArea.mjs +3 -6
  24. package/dist/ColorArea.module.js +3 -6
  25. package/dist/ColorArea.module.js.map +1 -1
  26. package/dist/ColorField.main.js +2 -5
  27. package/dist/ColorField.main.js.map +1 -1
  28. package/dist/ColorField.mjs +2 -5
  29. package/dist/ColorField.module.js +2 -5
  30. package/dist/ColorField.module.js.map +1 -1
  31. package/dist/ColorSlider.main.js +2 -5
  32. package/dist/ColorSlider.main.js.map +1 -1
  33. package/dist/ColorSlider.mjs +2 -5
  34. package/dist/ColorSlider.module.js +2 -5
  35. package/dist/ColorSlider.module.js.map +1 -1
  36. package/dist/ColorSwatch.main.js +2 -5
  37. package/dist/ColorSwatch.main.js.map +1 -1
  38. package/dist/ColorSwatch.mjs +2 -5
  39. package/dist/ColorSwatch.module.js +2 -5
  40. package/dist/ColorSwatch.module.js.map +1 -1
  41. package/dist/ColorSwatchPicker.main.js +4 -8
  42. package/dist/ColorSwatchPicker.main.js.map +1 -1
  43. package/dist/ColorSwatchPicker.mjs +5 -9
  44. package/dist/ColorSwatchPicker.module.js +5 -9
  45. package/dist/ColorSwatchPicker.module.js.map +1 -1
  46. package/dist/ColorThumb.main.js +2 -5
  47. package/dist/ColorThumb.main.js.map +1 -1
  48. package/dist/ColorThumb.mjs +3 -6
  49. package/dist/ColorThumb.module.js +3 -6
  50. package/dist/ColorThumb.module.js.map +1 -1
  51. package/dist/ColorWheel.main.js +5 -11
  52. package/dist/ColorWheel.main.js.map +1 -1
  53. package/dist/ColorWheel.mjs +6 -12
  54. package/dist/ColorWheel.module.js +6 -12
  55. package/dist/ColorWheel.module.js.map +1 -1
  56. package/dist/ComboBox.main.js +2 -5
  57. package/dist/ComboBox.main.js.map +1 -1
  58. package/dist/ComboBox.mjs +3 -6
  59. package/dist/ComboBox.module.js +3 -6
  60. package/dist/ComboBox.module.js.map +1 -1
  61. package/dist/DateField.main.js +8 -23
  62. package/dist/DateField.main.js.map +1 -1
  63. package/dist/DateField.mjs +9 -24
  64. package/dist/DateField.module.js +9 -24
  65. package/dist/DateField.module.js.map +1 -1
  66. package/dist/DatePicker.main.js +4 -11
  67. package/dist/DatePicker.main.js.map +1 -1
  68. package/dist/DatePicker.mjs +5 -12
  69. package/dist/DatePicker.module.js +5 -12
  70. package/dist/DatePicker.module.js.map +1 -1
  71. package/dist/Dialog.main.js +2 -5
  72. package/dist/Dialog.main.js.map +1 -1
  73. package/dist/Dialog.mjs +3 -6
  74. package/dist/Dialog.module.js +3 -6
  75. package/dist/Dialog.module.js.map +1 -1
  76. package/dist/Disclosure.main.js +6 -16
  77. package/dist/Disclosure.main.js.map +1 -1
  78. package/dist/Disclosure.mjs +6 -16
  79. package/dist/Disclosure.module.js +6 -16
  80. package/dist/Disclosure.module.js.map +1 -1
  81. package/dist/DragAndDrop.main.js +2 -5
  82. package/dist/DragAndDrop.main.js.map +1 -1
  83. package/dist/DragAndDrop.mjs +3 -6
  84. package/dist/DragAndDrop.module.js +3 -6
  85. package/dist/DragAndDrop.module.js.map +1 -1
  86. package/dist/DropZone.main.js +2 -5
  87. package/dist/DropZone.main.js.map +1 -1
  88. package/dist/DropZone.mjs +3 -6
  89. package/dist/DropZone.module.js +3 -6
  90. package/dist/DropZone.module.js.map +1 -1
  91. package/dist/FieldError.main.js +2 -5
  92. package/dist/FieldError.main.js.map +1 -1
  93. package/dist/FieldError.mjs +3 -6
  94. package/dist/FieldError.module.js +3 -6
  95. package/dist/FieldError.module.js.map +1 -1
  96. package/dist/FileTrigger.main.js +2 -5
  97. package/dist/FileTrigger.main.js.map +1 -1
  98. package/dist/FileTrigger.mjs +2 -5
  99. package/dist/FileTrigger.module.js +2 -5
  100. package/dist/FileTrigger.module.js.map +1 -1
  101. package/dist/Form.main.js +2 -6
  102. package/dist/Form.main.js.map +1 -1
  103. package/dist/Form.mjs +2 -6
  104. package/dist/Form.module.js +2 -6
  105. package/dist/Form.module.js.map +1 -1
  106. package/dist/GridList.main.js +2 -6
  107. package/dist/GridList.main.js.map +1 -1
  108. package/dist/GridList.mjs +3 -7
  109. package/dist/GridList.module.js +3 -7
  110. package/dist/GridList.module.js.map +1 -1
  111. package/dist/Group.main.js +2 -5
  112. package/dist/Group.main.js.map +1 -1
  113. package/dist/Group.mjs +2 -5
  114. package/dist/Group.module.js +2 -5
  115. package/dist/Group.module.js.map +1 -1
  116. package/dist/Heading.main.js +2 -3
  117. package/dist/Heading.main.js.map +1 -1
  118. package/dist/Heading.mjs +2 -3
  119. package/dist/Heading.module.js +2 -3
  120. package/dist/Heading.module.js.map +1 -1
  121. package/dist/Input.main.js +2 -5
  122. package/dist/Input.main.js.map +1 -1
  123. package/dist/Input.mjs +2 -5
  124. package/dist/Input.module.js +2 -5
  125. package/dist/Input.module.js.map +1 -1
  126. package/dist/Keyboard.main.js +2 -3
  127. package/dist/Keyboard.main.js.map +1 -1
  128. package/dist/Keyboard.mjs +2 -3
  129. package/dist/Keyboard.module.js +2 -3
  130. package/dist/Keyboard.module.js.map +1 -1
  131. package/dist/Label.main.js +2 -3
  132. package/dist/Label.main.js.map +1 -1
  133. package/dist/Label.mjs +2 -3
  134. package/dist/Label.module.js +2 -3
  135. package/dist/Label.module.js.map +1 -1
  136. package/dist/Link.main.js +2 -6
  137. package/dist/Link.main.js.map +1 -1
  138. package/dist/Link.mjs +2 -6
  139. package/dist/Link.module.js +2 -6
  140. package/dist/Link.module.js.map +1 -1
  141. package/dist/ListBox.main.js +5 -10
  142. package/dist/ListBox.main.js.map +1 -1
  143. package/dist/ListBox.mjs +6 -11
  144. package/dist/ListBox.module.js +6 -11
  145. package/dist/ListBox.module.js.map +1 -1
  146. package/dist/Menu.main.js +5 -10
  147. package/dist/Menu.main.js.map +1 -1
  148. package/dist/Menu.mjs +5 -10
  149. package/dist/Menu.module.js +5 -10
  150. package/dist/Menu.module.js.map +1 -1
  151. package/dist/Meter.main.js +2 -5
  152. package/dist/Meter.main.js.map +1 -1
  153. package/dist/Meter.mjs +2 -5
  154. package/dist/Meter.module.js +2 -5
  155. package/dist/Meter.module.js.map +1 -1
  156. package/dist/Modal.main.js +3 -6
  157. package/dist/Modal.main.js.map +1 -1
  158. package/dist/Modal.mjs +4 -7
  159. package/dist/Modal.module.js +4 -7
  160. package/dist/Modal.module.js.map +1 -1
  161. package/dist/NumberField.main.js +2 -5
  162. package/dist/NumberField.main.js.map +1 -1
  163. package/dist/NumberField.mjs +3 -6
  164. package/dist/NumberField.module.js +3 -6
  165. package/dist/NumberField.module.js.map +1 -1
  166. package/dist/OverlayArrow.main.js +2 -6
  167. package/dist/OverlayArrow.main.js.map +1 -1
  168. package/dist/OverlayArrow.mjs +2 -6
  169. package/dist/OverlayArrow.module.js +2 -6
  170. package/dist/OverlayArrow.module.js.map +1 -1
  171. package/dist/Popover.main.js +2 -5
  172. package/dist/Popover.main.js.map +1 -1
  173. package/dist/Popover.mjs +3 -6
  174. package/dist/Popover.module.js +3 -6
  175. package/dist/Popover.module.js.map +1 -1
  176. package/dist/ProgressBar.main.js +2 -6
  177. package/dist/ProgressBar.main.js.map +1 -1
  178. package/dist/ProgressBar.mjs +2 -6
  179. package/dist/ProgressBar.module.js +2 -6
  180. package/dist/ProgressBar.module.js.map +1 -1
  181. package/dist/RadioGroup.main.js +4 -10
  182. package/dist/RadioGroup.main.js.map +1 -1
  183. package/dist/RadioGroup.mjs +4 -10
  184. package/dist/RadioGroup.module.js +4 -10
  185. package/dist/RadioGroup.module.js.map +1 -1
  186. package/dist/SearchField.main.js +2 -5
  187. package/dist/SearchField.main.js.map +1 -1
  188. package/dist/SearchField.mjs +3 -6
  189. package/dist/SearchField.module.js +3 -6
  190. package/dist/SearchField.module.js.map +1 -1
  191. package/dist/Select.main.js +5 -12
  192. package/dist/Select.main.js.map +1 -1
  193. package/dist/Select.mjs +6 -13
  194. package/dist/Select.module.js +6 -13
  195. package/dist/Select.module.js.map +1 -1
  196. package/dist/Slider.main.js +8 -20
  197. package/dist/Slider.main.js.map +1 -1
  198. package/dist/Slider.mjs +9 -21
  199. package/dist/Slider.module.js +9 -21
  200. package/dist/Slider.module.js.map +1 -1
  201. package/dist/Switch.main.js +2 -5
  202. package/dist/Switch.main.js.map +1 -1
  203. package/dist/Switch.mjs +2 -5
  204. package/dist/Switch.module.js +2 -5
  205. package/dist/Switch.module.js.map +1 -1
  206. package/dist/Table.main.js +6 -12
  207. package/dist/Table.main.js.map +1 -1
  208. package/dist/Table.mjs +7 -13
  209. package/dist/Table.module.js +7 -13
  210. package/dist/Table.module.js.map +1 -1
  211. package/dist/Tabs.main.js +6 -16
  212. package/dist/Tabs.main.js.map +1 -1
  213. package/dist/Tabs.mjs +7 -17
  214. package/dist/Tabs.module.js +7 -17
  215. package/dist/Tabs.module.js.map +1 -1
  216. package/dist/TagGroup.main.js +4 -10
  217. package/dist/TagGroup.main.js.map +1 -1
  218. package/dist/TagGroup.mjs +5 -11
  219. package/dist/TagGroup.module.js +5 -11
  220. package/dist/TagGroup.module.js.map +1 -1
  221. package/dist/Text.main.js +2 -3
  222. package/dist/Text.main.js.map +1 -1
  223. package/dist/Text.mjs +2 -3
  224. package/dist/Text.module.js +2 -3
  225. package/dist/Text.module.js.map +1 -1
  226. package/dist/TextArea.main.js +2 -5
  227. package/dist/TextArea.main.js.map +1 -1
  228. package/dist/TextArea.mjs +2 -5
  229. package/dist/TextArea.module.js +2 -5
  230. package/dist/TextArea.module.js.map +1 -1
  231. package/dist/TextField.main.js +2 -5
  232. package/dist/TextField.main.js.map +1 -1
  233. package/dist/TextField.mjs +3 -6
  234. package/dist/TextField.module.js +3 -6
  235. package/dist/TextField.module.js.map +1 -1
  236. package/dist/ToggleButton.main.js +2 -5
  237. package/dist/ToggleButton.main.js.map +1 -1
  238. package/dist/ToggleButton.mjs +3 -6
  239. package/dist/ToggleButton.module.js +3 -6
  240. package/dist/ToggleButton.module.js.map +1 -1
  241. package/dist/ToggleButtonGroup.main.js +2 -5
  242. package/dist/ToggleButtonGroup.main.js.map +1 -1
  243. package/dist/ToggleButtonGroup.mjs +2 -5
  244. package/dist/ToggleButtonGroup.module.js +2 -5
  245. package/dist/ToggleButtonGroup.module.js.map +1 -1
  246. package/dist/Toolbar.main.js +2 -6
  247. package/dist/Toolbar.main.js.map +1 -1
  248. package/dist/Toolbar.mjs +2 -6
  249. package/dist/Toolbar.module.js +2 -6
  250. package/dist/Toolbar.module.js.map +1 -1
  251. package/dist/Tooltip.main.js +2 -5
  252. package/dist/Tooltip.main.js.map +1 -1
  253. package/dist/Tooltip.mjs +3 -6
  254. package/dist/Tooltip.module.js +3 -6
  255. package/dist/Tooltip.module.js.map +1 -1
  256. package/dist/Tree.main.js +2 -6
  257. package/dist/Tree.main.js.map +1 -1
  258. package/dist/Tree.mjs +3 -7
  259. package/dist/Tree.module.js +3 -7
  260. package/dist/Tree.module.js.map +1 -1
  261. package/dist/types.d.ts +10 -10
  262. package/dist/types.d.ts.map +1 -1
  263. package/package.json +30 -30
  264. package/src/Breadcrumbs.tsx +5 -8
  265. package/src/Button.tsx +5 -8
  266. package/src/Calendar.tsx +19 -31
  267. package/src/Checkbox.tsx +11 -17
  268. package/src/ColorArea.tsx +5 -8
  269. package/src/ColorField.tsx +5 -8
  270. package/src/ColorSlider.tsx +5 -8
  271. package/src/ColorSwatch.tsx +5 -8
  272. package/src/ColorSwatchPicker.tsx +7 -13
  273. package/src/ColorThumb.tsx +5 -8
  274. package/src/ColorWheel.tsx +10 -16
  275. package/src/ComboBox.tsx +5 -8
  276. package/src/DateField.tsx +21 -33
  277. package/src/DatePicker.tsx +9 -15
  278. package/src/Dialog.tsx +5 -8
  279. package/src/Disclosure.tsx +16 -25
  280. package/src/DragAndDrop.tsx +5 -8
  281. package/src/DropZone.tsx +5 -8
  282. package/src/FieldError.tsx +5 -8
  283. package/src/FileTrigger.tsx +5 -8
  284. package/src/Form.tsx +6 -9
  285. package/src/GridList.tsx +6 -9
  286. package/src/Group.tsx +5 -8
  287. package/src/Heading.tsx +2 -5
  288. package/src/Input.tsx +5 -8
  289. package/src/Keyboard.tsx +2 -5
  290. package/src/Label.tsx +2 -5
  291. package/src/Link.tsx +6 -9
  292. package/src/ListBox.tsx +8 -12
  293. package/src/Menu.tsx +8 -12
  294. package/src/Meter.tsx +5 -8
  295. package/src/Modal.tsx +5 -8
  296. package/src/NumberField.tsx +5 -8
  297. package/src/OverlayArrow.tsx +6 -9
  298. package/src/Popover.tsx +5 -8
  299. package/src/ProgressBar.tsx +6 -9
  300. package/src/RadioGroup.tsx +10 -16
  301. package/src/SearchField.tsx +5 -8
  302. package/src/Select.tsx +11 -17
  303. package/src/Slider.tsx +20 -32
  304. package/src/Switch.tsx +5 -8
  305. package/src/Table.tsx +10 -19
  306. package/src/Tabs.tsx +14 -23
  307. package/src/TagGroup.tsx +8 -14
  308. package/src/Text.tsx +2 -5
  309. package/src/TextArea.tsx +5 -7
  310. package/src/TextField.tsx +5 -8
  311. package/src/ToggleButton.tsx +5 -8
  312. package/src/ToggleButtonGroup.tsx +5 -8
  313. package/src/Toolbar.tsx +6 -9
  314. package/src/Tooltip.tsx +5 -8
  315. package/src/Tree.tsx +6 -9
@@ -4,7 +4,7 @@ import {useFocusRing as $7aSLZ$useFocusRing, useTabList as $7aSLZ$useTabList, us
4
4
  import {CollectionBuilder as $7aSLZ$CollectionBuilder, Collection as $7aSLZ$Collection, createLeafComponent as $7aSLZ$createLeafComponent, createHideableComponent as $7aSLZ$createHideableComponent} from "@react-aria/collections";
5
5
  import {filterDOMProps as $7aSLZ$filterDOMProps, useObjectRef as $7aSLZ$useObjectRef} from "@react-aria/utils";
6
6
  import {useTabListState as $7aSLZ$useTabListState} from "react-stately";
7
- import $7aSLZ$react, {createContext as $7aSLZ$createContext, useMemo as $7aSLZ$useMemo, forwardRef as $7aSLZ$forwardRef, useContext as $7aSLZ$useContext} from "react";
7
+ import $7aSLZ$react, {createContext as $7aSLZ$createContext, forwardRef as $7aSLZ$forwardRef, useMemo as $7aSLZ$useMemo, useContext as $7aSLZ$useContext} from "react";
8
8
 
9
9
  /*
10
10
  * Copyright 2022 Adobe. All rights reserved.
@@ -25,7 +25,7 @@ import $7aSLZ$react, {createContext as $7aSLZ$createContext, useMemo as $7aSLZ$u
25
25
 
26
26
  const $5e8ad37a45e1c704$export$cfa7aa87c26e7d1f = /*#__PURE__*/ (0, $7aSLZ$createContext)(null);
27
27
  const $5e8ad37a45e1c704$export$364712098d2aa57c = /*#__PURE__*/ (0, $7aSLZ$createContext)(null);
28
- function $5e8ad37a45e1c704$var$Tabs(props, ref) {
28
+ const $5e8ad37a45e1c704$export$b2539bed5023c21c = /*#__PURE__*/ (0, $7aSLZ$forwardRef)(function Tabs(props, ref) {
29
29
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $5e8ad37a45e1c704$export$cfa7aa87c26e7d1f);
30
30
  let { children: children, orientation: orientation = 'horizontal' } = props;
31
31
  children = (0, $7aSLZ$useMemo)(()=>typeof children === 'function' ? children({
@@ -42,7 +42,7 @@ function $5e8ad37a45e1c704$var$Tabs(props, ref) {
42
42
  collection: collection,
43
43
  tabsRef: ref
44
44
  }));
45
- }
45
+ });
46
46
  function $5e8ad37a45e1c704$var$TabsInner({ props: props, tabsRef: ref, collection: collection }) {
47
47
  let { orientation: orientation = 'horizontal' } = props;
48
48
  let state = (0, $7aSLZ$useTabListState)({
@@ -90,16 +90,13 @@ function $5e8ad37a45e1c704$var$TabsInner({ props: props, tabsRef: ref, collectio
90
90
  ]
91
91
  }, renderProps.children));
92
92
  }
93
- /**
94
- * Tabs organize content into multiple sections and allow users to navigate between them.
95
- */ const $5e8ad37a45e1c704$export$b2539bed5023c21c = /*#__PURE__*/ (0, $7aSLZ$forwardRef)($5e8ad37a45e1c704$var$Tabs);
96
- function $5e8ad37a45e1c704$var$TabList(props, ref) {
93
+ const $5e8ad37a45e1c704$export$e51a686c67fdaa2d = /*#__PURE__*/ (0, $7aSLZ$forwardRef)(function TabList(props, ref) {
97
94
  let state = (0, $7aSLZ$useContext)($5e8ad37a45e1c704$export$364712098d2aa57c);
98
95
  return state ? /*#__PURE__*/ (0, $7aSLZ$react).createElement($5e8ad37a45e1c704$var$TabListInner, {
99
96
  props: props,
100
97
  forwardedRef: ref
101
98
  }) : /*#__PURE__*/ (0, $7aSLZ$react).createElement((0, $7aSLZ$Collection), props);
102
- }
99
+ });
103
100
  function $5e8ad37a45e1c704$var$TabListInner({ props: props, forwardedRef: ref }) {
104
101
  let state = (0, $7aSLZ$useContext)($5e8ad37a45e1c704$export$364712098d2aa57c);
105
102
  let { CollectionRoot: CollectionRoot } = (0, $7aSLZ$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
@@ -132,10 +129,6 @@ function $5e8ad37a45e1c704$var$TabListInner({ props: props, forwardedRef: ref })
132
129
  persistedKeys: (0, $7135fc7d473fd974$export$90e00781bc59d8f9)(state.selectionManager.focusedKey)
133
130
  }));
134
131
  }
135
- /**
136
- * A TabList is used within Tabs to group tabs that a user can switch between.
137
- * The ids of the items within the <TabList> must match up with a corresponding item inside the <TabPanels>.
138
- */ const $5e8ad37a45e1c704$export$e51a686c67fdaa2d = /*#__PURE__*/ (0, $7aSLZ$forwardRef)($5e8ad37a45e1c704$var$TabList);
139
132
  const $5e8ad37a45e1c704$export$3e41faf802a29e71 = /*#__PURE__*/ (0, $7aSLZ$createLeafComponent)('item', (props, forwardedRef, item)=>{
140
133
  let state = (0, $7aSLZ$useContext)($5e8ad37a45e1c704$export$364712098d2aa57c);
141
134
  let ref = (0, $7aSLZ$useObjectRef)(forwardedRef);
@@ -175,7 +168,7 @@ const $5e8ad37a45e1c704$export$3e41faf802a29e71 = /*#__PURE__*/ (0, $7aSLZ$creat
175
168
  "data-hovered": isHovered || undefined
176
169
  });
177
170
  });
178
- function $5e8ad37a45e1c704$var$TabPanel(props, forwardedRef) {
171
+ const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /*#__PURE__*/ (0, $7aSLZ$createHideableComponent)(function TabPanel(props, forwardedRef) {
179
172
  const state = (0, $7aSLZ$useContext)($5e8ad37a45e1c704$export$364712098d2aa57c);
180
173
  let ref = (0, $7aSLZ$useObjectRef)(forwardedRef);
181
174
  let { tabPanelProps: tabPanelProps } = (0, $7aSLZ$useTabPanel)(props, state, ref);
@@ -215,10 +208,7 @@ function $5e8ad37a45e1c704$var$TabPanel(props, forwardedRef) {
215
208
  ]
216
209
  ]
217
210
  }, renderProps.children));
218
- }
219
- /**
220
- * A TabPanel provides the content for a tab.
221
- */ const $5e8ad37a45e1c704$export$3d96ec278d3efce4 = /*#__PURE__*/ (0, $7aSLZ$createHideableComponent)($5e8ad37a45e1c704$var$TabPanel);
211
+ });
222
212
 
223
213
 
224
214
  export {$5e8ad37a45e1c704$export$cfa7aa87c26e7d1f as TabsContext, $5e8ad37a45e1c704$export$364712098d2aa57c as TabListStateContext, $5e8ad37a45e1c704$export$b2539bed5023c21c as Tabs, $5e8ad37a45e1c704$export$e51a686c67fdaa2d as TabList, $5e8ad37a45e1c704$export$3e41faf802a29e71 as Tab, $5e8ad37a45e1c704$export$3d96ec278d3efce4 as TabPanel};
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA2GM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAA2C;AAC3E,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA+B;AAE9E,SAAS,2BAAK,KAAgB,EAAE,GAAiC;IAC/D,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,YAAC,QAAQ,eAAE,cAAc,cAAa,GAAG;IAC7C,WAAW,CAAA,GAAA,cAAM,EAAE,IACjB,OAAO,aAAa,aAChB,SAAS;yBAAC;YAAa,iBAAiB;QAAI,KAC5C,UACH;QAAC;QAAU;KAAY;IAE1B,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,SAAS;OACzB,CAAA,2BAAc,gCAAC;YAAU,OAAO;YAAO,YAAY;YAAY,SAAS;;AAG/E;AAQA,SAAS,gCAAU,SAAC,KAAK,EAAE,SAAS,GAAG,cAAE,UAAU,EAAiB;IAClE,IAAI,eAAC,cAAc,cAAa,GAAG;IACnC,IAAI,QAAQ,CAAA,GAAA,sBAAc,EAAE;QAC1B,GAAG,KAAK;oBACR;QACA,UAAU;IACZ;IACA,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAAC,QAAQ;IAAI;IACxE,IAAI,SAAS,CAAA,GAAA,cAAM,EAAE,IAAO,CAAA;yBAC1B;YACA,eAAe;4BACf;QACF,CAAA,GAAI;QAAC;QAAa;QAAW;KAAe;IAC5C,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;gBA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sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;QAC3B,gBAAc,aAAa;;AAEjC;AAEA,SAAS,+BAAS,KAAoB,EAAE,YAA0C;IAChF,MAAM,QAAQ,CAAA,GAAA,iBAAS,EAAE;IACzB,IAAI,MAAM,CAAA,GAAA,mBAAW,EAAkB;IACvC,IAAI,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,kBAAU,EAAE,OAAO,OAAO;IAChD,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW;IAEzD,IAAI,aAAa,MAAM,WAAW,KAAK,MAAM,EAAE;IAC/C,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;uBACN;4BACA;YACA,SAAS,CAAC;mBACV;QACF;IACF;IAEA,IAAI,CAAC,cAAc,CAAC,MAAM,gBAAgB,EACxC,OAAO;IAGT,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAC9B,OAAO,SAAS,EAAE;IAElB,IAAI,WAAW,aACX,CAAA,GAAA,iBAAS,EAAE,UAAU,eAAe,YAAY,eAChD;IAEJ,qBACE,gCAAC;QACE,GAAG,QAAQ;QACZ,KAAK;QACL,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,aAAa;QACb,OAAO,CAAC,aAAa,SAAS;QAC9B,cAAY,CAAC,aAAa,SAAS;qBACnC,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAAa;aAAK;YACnB;gBAAC;gBAAqB;aAAK;SAC5B;OACA,YAAY,QAAQ;AAI7B;AAEA;;CAEC,GACD,MAAM,4CAAY,WAAW,GAAG,CAAA,GAAA,8BAAsB,EAAE","sources":["packages/react-aria-components/src/Tabs.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaLabelingProps, forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {AriaTabListProps, AriaTabPanelProps, mergeProps, Orientation, useFocusRing, useHover, useTab, useTabList, useTabPanel} from 'react-aria';\nimport {Collection, CollectionBuilder, createHideableComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, usePersistedKeys} from './Collection';\nimport {ContextValue, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {Collection as ICollection, Node, TabListState, useTabListState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, useContext, useMemo} from 'react';\n\nexport interface TabsProps extends Omit<AriaTabListProps<any>, 'items' | 'children'>, RenderProps<TabsRenderProps>, SlotProps {}\n\nexport interface TabsRenderProps {\n /**\n * The orientation of the tabs.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation\n}\n\nexport interface TabListProps<T> extends StyleRenderProps<TabListRenderProps>, AriaLabelingProps, Omit<CollectionProps<T>, 'disabledKeys'> {}\n\nexport interface TabListRenderProps {\n /**\n * The orientation of the tab list.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport interface TabProps extends RenderProps<TabRenderProps>, AriaLabelingProps, LinkDOMProps, HoverEvents {\n /** The unique id of the tab. */\n id?: Key,\n /** Whether the tab is disabled. */\n isDisabled?: boolean\n}\n\nexport interface TabRenderProps {\n /**\n * Whether the tab is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the tab is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the tab is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the tab is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface TabPanelProps extends AriaTabPanelProps, RenderProps<TabPanelRenderProps> {\n /**\n * Whether to mount the tab panel in the DOM even when it is not currently selected.\n * Inactive tab panels are inert and cannot be interacted with. They must be styled appropriately so this is clear to the user visually.\n * @default false\n */\n shouldForceMount?: boolean\n}\n\nexport interface TabPanelRenderProps {\n /**\n * Whether the tab panel is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab panel is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab panel is currently non-interactive. This occurs when the\n * `shouldForceMount` prop is true, and the corresponding tab is not selected.\n * @selector [data-inert]\n */\n isInert: boolean,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, HTMLDivElement>>(null);\nexport const TabListStateContext = createContext<TabListState<object> | null>(null);\n\nfunction Tabs(props: TabsProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TabsContext);\n let {children, orientation = 'horizontal'} = props;\n children = useMemo(() => (\n typeof children === 'function'\n ? children({orientation, defaultChildren: null})\n : children\n ), [children, orientation]);\n\n return (\n <CollectionBuilder content={children}>\n {collection => <TabsInner props={props} collection={collection} tabsRef={ref} />}\n </CollectionBuilder>\n );\n}\n\ninterface TabsInnerProps {\n props: TabsProps,\n collection: ICollection<Node<any>>,\n tabsRef: RefObject<HTMLDivElement | null>\n}\n\nfunction TabsInner({props, tabsRef: ref, collection}: TabsInnerProps) {\n let {orientation = 'horizontal'} = props;\n let state = useTabListState({\n ...props,\n collection,\n children: undefined\n });\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let values = useMemo(() => ({\n orientation,\n isFocusWithin: isFocused,\n isFocusVisible\n }), [orientation, isFocused, isFocusVisible]);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Tabs',\n values\n });\n\n return (\n <div\n {...filterDOMProps(props as any)}\n {...focusProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-orientation={orientation}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={state.isDisabled || undefined}>\n <Provider\n values={[\n [TabsContext, props],\n [TabListStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them.\n */\nconst _Tabs = /*#__PURE__*/ (forwardRef as forwardRefType)(Tabs);\nexport {_Tabs as Tabs};\n\nfunction TabList<T extends object>(props: TabListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(TabListStateContext);\n return state\n ? <TabListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n}\n\ninterface TabListInnerProps<T> {\n props: TabListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TabListInner<T extends object>({props, forwardedRef: ref}: TabListInnerProps<T>) {\n let state = useContext(TabListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {orientation = 'horizontal', keyboardActivation = 'automatic'} = useSlottedContext(TabsContext)!;\n let objectRef = useObjectRef(ref);\n\n let {tabListProps} = useTabList({\n ...props,\n orientation,\n keyboardActivation\n }, state, objectRef);\n\n let renderProps = useRenderProps({\n ...props,\n children: null,\n defaultClassName: 'react-aria-TabList',\n values: {\n orientation,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...DOMProps}\n {...tabListProps}\n ref={objectRef}\n {...renderProps}\n data-orientation={orientation || undefined}>\n <CollectionRoot collection={state.collection} persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)} />\n </div>\n );\n}\n\n/**\n * A TabList is used within Tabs to group tabs that a user can switch between.\n * The ids of the items within the <TabList> must match up with a corresponding item inside the <TabPanels>.\n */\nconst _TabList = /*#__PURE__*/ (forwardRef as forwardRefType)(TabList);\nexport {_TabList as TabList};\n\n/**\n * A Tab provides a title for an individual item within a TabList.\n */\nexport const Tab = /*#__PURE__*/ createLeafComponent('item', (props: TabProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(TabListStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let {tabProps, isSelected, isDisabled, isPressed} = useTab({key: item.key, ...props}, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled,\n onHoverStart: props.onHoverStart,\n onHoverEnd: props.onHoverEnd,\n onHoverChange: props.onHoverChange\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Tab',\n values: {\n isSelected,\n isDisabled,\n isFocused,\n isFocusVisible,\n isPressed,\n isHovered\n }\n });\n\n let ElementType: React.ElementType = item.props.href ? 'a' : 'div';\n\n return (\n <ElementType\n {...mergeProps(tabProps, focusProps, hoverProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-disabled={isDisabled || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined} />\n );\n});\n\nfunction TabPanel(props: TabPanelProps, forwardedRef: ForwardedRef<HTMLDivElement>) {\n const state = useContext(TabListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {tabPanelProps} = useTabPanel(props, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let isSelected = state.selectedKey === props.id;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-TabPanel',\n values: {\n isFocused,\n isFocusVisible,\n isInert: !isSelected,\n state\n }\n });\n\n if (!isSelected && !props.shouldForceMount) {\n return null;\n }\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n let domProps = isSelected\n ? mergeProps(DOMProps, tabPanelProps, focusProps, renderProps)\n : renderProps;\n\n return (\n <div\n {...domProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n // @ts-ignore\n inert={!isSelected ? 'true' : undefined}\n data-inert={!isSelected ? 'true' : undefined}>\n <Provider\n values={[\n [TabsContext, null],\n [TabListStateContext, null]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A TabPanel provides the content for a tab.\n */\nconst _TabPanel = /*#__PURE__*/ createHideableComponent(TabPanel);\nexport {_TabPanel as TabPanel};\n"],"names":[],"version":3,"file":"Tabs.module.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA2GM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAA2C;AAC3E,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAA+B;AAKvE,MAAM,4CAAqB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,KAAK,KAAgB,EAAE,GAAiC;IAChI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,YAAC,QAAQ,eAAE,cAAc,cAAa,GAAG;IAC7C,WAAW,CAAA,GAAA,cAAM,EAAE,IACjB,OAAO,aAAa,aAChB,SAAS;yBAAC;YAAa,iBAAiB;QAAI,KAC5C,UACH;QAAC;QAAU;KAAY;IAE1B,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,SAAS;OACzB,CAAA,2BAAc,gCAAC;YAAU,OAAO;YAAO,YAAY;YAAY,SAAS;;AAG/E;AA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gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,aAAa;QACb,OAAO,CAAC,aAAa,SAAS;QAC9B,cAAY,CAAC,aAAa,SAAS;qBACnC,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC;gBAAa;aAAK;YACnB;gBAAC;gBAAqB;aAAK;SAC5B;OACA,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Tabs.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaLabelingProps, forwardRefType, HoverEvents, Key, LinkDOMProps, RefObject} from '@react-types/shared';\nimport {AriaTabListProps, AriaTabPanelProps, mergeProps, Orientation, useFocusRing, useHover, useTab, useTabList, useTabPanel} from 'react-aria';\nimport {Collection, CollectionBuilder, createHideableComponent, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, usePersistedKeys} from './Collection';\nimport {ContextValue, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlottedContext} from './utils';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {Collection as ICollection, Node, TabListState, useTabListState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, useContext, useMemo} from 'react';\n\nexport interface TabsProps extends Omit<AriaTabListProps<any>, 'items' | 'children'>, RenderProps<TabsRenderProps>, SlotProps {}\n\nexport interface TabsRenderProps {\n /**\n * The orientation of the tabs.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation\n}\n\nexport interface TabListProps<T> extends StyleRenderProps<TabListRenderProps>, AriaLabelingProps, Omit<CollectionProps<T>, 'disabledKeys'> {}\n\nexport interface TabListRenderProps {\n /**\n * The orientation of the tab list.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport interface TabProps extends RenderProps<TabRenderProps>, AriaLabelingProps, LinkDOMProps, HoverEvents {\n /** The unique id of the tab. */\n id?: Key,\n /** Whether the tab is disabled. */\n isDisabled?: boolean\n}\n\nexport interface TabRenderProps {\n /**\n * Whether the tab is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the tab is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the tab is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the tab is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\n\nexport interface TabPanelProps extends AriaTabPanelProps, RenderProps<TabPanelRenderProps> {\n /**\n * Whether to mount the tab panel in the DOM even when it is not currently selected.\n * Inactive tab panels are inert and cannot be interacted with. They must be styled appropriately so this is clear to the user visually.\n * @default false\n */\n shouldForceMount?: boolean\n}\n\nexport interface TabPanelRenderProps {\n /**\n * Whether the tab panel is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tab panel is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the tab panel is currently non-interactive. This occurs when the\n * `shouldForceMount` prop is true, and the corresponding tab is not selected.\n * @selector [data-inert]\n */\n isInert: boolean,\n /**\n * State of the tab list.\n */\n state: TabListState<unknown>\n}\n\nexport const TabsContext = createContext<ContextValue<TabsProps, HTMLDivElement>>(null);\nexport const TabListStateContext = createContext<TabListState<object> | null>(null);\n\n/**\n * Tabs organize content into multiple sections and allow users to navigate between them.\n */\nexport const Tabs = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tabs(props: TabsProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TabsContext);\n let {children, orientation = 'horizontal'} = props;\n children = useMemo(() => (\n typeof children === 'function'\n ? children({orientation, defaultChildren: null})\n : children\n ), [children, orientation]);\n\n return (\n <CollectionBuilder content={children}>\n {collection => <TabsInner props={props} collection={collection} tabsRef={ref} />}\n </CollectionBuilder>\n );\n});\n\ninterface TabsInnerProps {\n props: TabsProps,\n collection: ICollection<Node<any>>,\n tabsRef: RefObject<HTMLDivElement | null>\n}\n\nfunction TabsInner({props, tabsRef: ref, collection}: TabsInnerProps) {\n let {orientation = 'horizontal'} = props;\n let state = useTabListState({\n ...props,\n collection,\n children: undefined\n });\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let values = useMemo(() => ({\n orientation,\n isFocusWithin: isFocused,\n isFocusVisible\n }), [orientation, isFocused, isFocusVisible]);\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Tabs',\n values\n });\n\n return (\n <div\n {...filterDOMProps(props as any)}\n {...focusProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-orientation={orientation}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={state.isDisabled || undefined}>\n <Provider\n values={[\n [TabsContext, props],\n [TabListStateContext, state]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A TabList is used within Tabs to group tabs that a user can switch between.\n * The ids of the items within the <TabList> must match up with a corresponding item inside the <TabPanels>.\n */\nexport const TabList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TabList<T extends object>(props: TabListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(TabListStateContext);\n return state\n ? <TabListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n});\n\ninterface TabListInnerProps<T> {\n props: TabListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TabListInner<T extends object>({props, forwardedRef: ref}: TabListInnerProps<T>) {\n let state = useContext(TabListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let {orientation = 'horizontal', keyboardActivation = 'automatic'} = useSlottedContext(TabsContext)!;\n let objectRef = useObjectRef(ref);\n\n let {tabListProps} = useTabList({\n ...props,\n orientation,\n keyboardActivation\n }, state, objectRef);\n\n let renderProps = useRenderProps({\n ...props,\n children: null,\n defaultClassName: 'react-aria-TabList',\n values: {\n orientation,\n state\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <div\n {...DOMProps}\n {...tabListProps}\n ref={objectRef}\n {...renderProps}\n data-orientation={orientation || undefined}>\n <CollectionRoot collection={state.collection} persistedKeys={usePersistedKeys(state.selectionManager.focusedKey)} />\n </div>\n );\n}\n\n/**\n * A Tab provides a title for an individual item within a TabList.\n */\nexport const Tab = /*#__PURE__*/ createLeafComponent('item', (props: TabProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(TabListStateContext)!;\n let ref = useObjectRef<any>(forwardedRef);\n let {tabProps, isSelected, isDisabled, isPressed} = useTab({key: item.key, ...props}, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({\n isDisabled,\n onHoverStart: props.onHoverStart,\n onHoverEnd: props.onHoverEnd,\n onHoverChange: props.onHoverChange\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n defaultClassName: 'react-aria-Tab',\n values: {\n isSelected,\n isDisabled,\n isFocused,\n isFocusVisible,\n isPressed,\n isHovered\n }\n });\n\n let ElementType: React.ElementType = item.props.href ? 'a' : 'div';\n\n return (\n <ElementType\n {...mergeProps(tabProps, focusProps, hoverProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-disabled={isDisabled || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined} />\n );\n});\n\n/**\n * A TabPanel provides the content for a tab.\n */\nexport const TabPanel = /*#__PURE__*/ createHideableComponent(function TabPanel(props: TabPanelProps, forwardedRef: ForwardedRef<HTMLDivElement>) {\n const state = useContext(TabListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {tabPanelProps} = useTabPanel(props, state, ref);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n\n let isSelected = state.selectedKey === props.id;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-TabPanel',\n values: {\n isFocused,\n isFocusVisible,\n isInert: !isSelected,\n state\n }\n });\n\n if (!isSelected && !props.shouldForceMount) {\n return null;\n }\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n let domProps = isSelected\n ? mergeProps(DOMProps, tabPanelProps, focusProps, renderProps)\n : renderProps;\n\n return (\n <div\n {...domProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n // @ts-ignore\n inert={!isSelected ? 'true' : undefined}\n data-inert={!isSelected ? 'true' : undefined}>\n <Provider\n values={[\n [TabsContext, null],\n [TabListStateContext, null]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Tabs.module.js.map"}
@@ -47,7 +47,7 @@ $parcel$export(module.exports, "Tag", () => $ecf55d0c218a575e$export$3288d34c523
47
47
 
48
48
  const $ecf55d0c218a575e$export$5b07b5dd2cbd96e3 = /*#__PURE__*/ (0, $4TsYs$react.createContext)(null);
49
49
  const $ecf55d0c218a575e$export$e755ce3685dd0ca9 = /*#__PURE__*/ (0, $4TsYs$react.createContext)(null);
50
- function $ecf55d0c218a575e$var$TagGroup(props, ref) {
50
+ const $ecf55d0c218a575e$export$67ea30858aaf75e3 = /*#__PURE__*/ (0, $4TsYs$react.forwardRef)(function TagGroup(props, ref) {
51
51
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $ecf55d0c218a575e$export$5b07b5dd2cbd96e3);
52
52
  return /*#__PURE__*/ (0, ($parcel$interopDefault($4TsYs$react))).createElement((0, $4TsYs$reactariacollections.CollectionBuilder), {
53
53
  content: props.children
@@ -56,7 +56,7 @@ function $ecf55d0c218a575e$var$TagGroup(props, ref) {
56
56
  forwardedRef: ref,
57
57
  collection: collection
58
58
  }));
59
- }
59
+ });
60
60
  function $ecf55d0c218a575e$var$TagGroupInner({ props: props, forwardedRef: ref, collection: collection }) {
61
61
  let tagListRef = (0, $4TsYs$react.useRef)(null);
62
62
  let [labelRef, label] = (0, $c5ccf687772c0422$exports.useSlot)();
@@ -116,16 +116,13 @@ function $ecf55d0c218a575e$var$TagGroupInner({ props: props, forwardedRef: ref,
116
116
  ]
117
117
  }, props.children));
118
118
  }
119
- /**
120
- * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.
121
- */ const $ecf55d0c218a575e$export$67ea30858aaf75e3 = /*#__PURE__*/ (0, $4TsYs$react.forwardRef)($ecf55d0c218a575e$var$TagGroup);
122
- function $ecf55d0c218a575e$var$TagList(props, ref) {
119
+ const $ecf55d0c218a575e$export$f9fef0f55402315b = /*#__PURE__*/ (0, $4TsYs$react.forwardRef)(function TagList(props, ref) {
123
120
  let state = (0, $4TsYs$react.useContext)((0, $a03b42240404b420$exports.ListStateContext));
124
121
  return state ? /*#__PURE__*/ (0, ($parcel$interopDefault($4TsYs$react))).createElement($ecf55d0c218a575e$var$TagListInner, {
125
122
  props: props,
126
123
  forwardedRef: ref
127
124
  }) : /*#__PURE__*/ (0, ($parcel$interopDefault($4TsYs$react))).createElement((0, $4TsYs$reactariacollections.Collection), props);
128
- }
125
+ });
129
126
  function $ecf55d0c218a575e$var$TagListInner({ props: props, forwardedRef: forwardedRef }) {
130
127
  let state = (0, $4TsYs$react.useContext)((0, $a03b42240404b420$exports.ListStateContext));
131
128
  let { CollectionRoot: CollectionRoot } = (0, $4TsYs$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
@@ -158,9 +155,6 @@ function $ecf55d0c218a575e$var$TagListInner({ props: props, forwardedRef: forwar
158
155
  persistedKeys: persistedKeys
159
156
  }));
160
157
  }
161
- /**
162
- * A tag list is a container for tags within a TagGroup.
163
- */ const $ecf55d0c218a575e$export$f9fef0f55402315b = /*#__PURE__*/ (0, $4TsYs$react.forwardRef)($ecf55d0c218a575e$var$TagList);
164
158
  const $ecf55d0c218a575e$export$3288d34c523a1192 = /*#__PURE__*/ (0, $4TsYs$reactariacollections.createLeafComponent)('item', (props, forwardedRef, item)=>{
165
159
  let state = (0, $4TsYs$react.useContext)((0, $a03b42240404b420$exports.ListStateContext));
166
160
  let ref = (0, $4TsYs$reactariautils.useObjectRef)(forwardedRef);
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4CM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAmD;AAE7F,SAAS,+BAAS,KAAoB,EAAE,GAAiC;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,SAAS,MAAM,QAAQ;OACvC,CAAA,2BAAc,0DAAC;YAAc,OAAO;YAAO,cAAc;YAAK,YAAY;;AAGjF;AAQA,SAAS,oCAAc,SAAC,KAAK,EAAE,cAAc,GAAG,cAAE,UAAU,EAAqB;IAC/E,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAkB;IACxC,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM;IAC9B,IAAI,QAAQ,CAAA,GAAA,gCAAW,EAAE;QACvB,GAAG,KAAK;QACR,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gBAAgB,CAAC,aAAa;qBACvH,0DAAC;QAAK,GAAG,aAAa;QAAE,OAAO;YAAC,SAAS;QAAU;qBACjD,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,uCAAY;gBAAG;oBACd,OAAO;wBACL,QAAQ;oBACV;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,mDAAwB;gBAAG,CAAA,GAAA,mDAAwB;aAAE;SACvD;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaTagGroupProps, useFocusRing, useHover, useTag, useTagGroup} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {filterDOMProps, mergeProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {ListState, Node, useListState} from 'react-stately';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface TagGroupProps extends Omit<AriaTagGroupProps<unknown>, 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'>, DOMProps, SlotProps {}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tag list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tag list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>\n}\n\nexport interface TagListProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, StyleRenderProps<TagListRenderProps> {\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\nfunction TagGroup(props: TagGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n}\n\ninterface TagGroupInnerProps {\n props: TagGroupProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n collection\n}\n\nfunction TagGroupInner({props, forwardedRef: ref, collection}: TagGroupInnerProps) {\n let tagListRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot();\n let state = useListState({\n ...props,\n children: undefined,\n collection\n });\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(props);\n let domPropOverrides = Object.fromEntries(Object.entries(domProps).map(([k]) => [k, undefined]));\n let {\n gridProps,\n labelProps,\n descriptionProps,\n errorMessageProps\n } = useTagGroup({\n ...props,\n ...domPropOverrides,\n label\n }, state, tagListRef);\n\n return (\n <div\n {...domProps}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n */\nconst _TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(TagGroup);\nexport {_TagGroup as TagGroup};\n\nfunction TagList<T extends object>(props: TagListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(ListStateContext);\n return state\n ? <TagListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n}\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TagListInner<T extends object>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps(props, forwardedRef, TagListContext);\n delete gridProps.items;\n delete gridProps.renderEmptyState;\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n\n return (\n <div\n {...mergeProps(gridProps, focusProps)}\n {...renderProps}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {state.collection.size === 0 && props.renderEmptyState\n ? props.renderEmptyState(renderValues)\n : <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />}\n </div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nconst _TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(TagList);\nexport {_TagList as TagList};\n\nexport interface TagRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /**\n * Whether the tag group allows items to be removed.\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean\n}\n\nexport interface TagProps extends RenderProps<TagRenderProps>, LinkDOMProps, HoverEvents {\n /** A unique id for the tag. */\n id?: Key,\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string,\n /** Whether the tag is disabled. */\n isDisabled?: boolean\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent('item', (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: true});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');\n }\n }, [item.textValue]);\n\n return (\n <div\n ref={ref}\n {...renderProps}\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps)}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n remove: removeButtonProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"TagGroup.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4CM,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAmD;AAKtF,MAAM,4CAAyB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,SAAS,KAAoB,EAAE,GAAiC;IAC5I,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,0DAAC,CAAA,GAAA,6CAAgB;QAAE,SAAS,MAAM,QAAQ;OACvC,CAAA,2BAAc,0DAAC;YAAc,OAAO;YAAO,cAAc;YAAK,YAAY;;AAGjF;AAQA,SAAS,oCAAc,SAAC,KAAK,EAAE,cAAc,GAAG,cAAE,UAAU,EAAqB;IAC/E,IAAI,aAAa,CAAA,GAAA,mBAAK,EAAkB;IACxC,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM;IAC9B,IAAI,QAAQ,CAAA,GAAA,gCAAW,EAAE;QACvB,GAAG,KAAK;QACR,UAAU;oBACV;IACF;IAEA,8CAA8C;IAC9C,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAC9B,IAAI,mBAAmB,OAAO,WAAW,CAAC,OAAO,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,GAAK;YAAC;YAAG;SAAU;IAC9F,IAAI,aACF,SAAS,cACT,UAAU,oBACV,gBAAgB,qB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cesContent":["/*\n * Copyright 2022 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 {AriaTagGroupProps, useFocusRing, useHover, useTag, useTagGroup} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {filterDOMProps, mergeProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {ListState, Node, useListState} from 'react-stately';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface TagGroupProps extends Omit<AriaTagGroupProps<unknown>, 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'>, DOMProps, SlotProps {}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tag list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tag list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>\n}\n\nexport interface TagListProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, StyleRenderProps<TagListRenderProps> {\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(props: TagGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\ninterface TagGroupInnerProps {\n props: TagGroupProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n collection\n}\n\nfunction TagGroupInner({props, forwardedRef: ref, collection}: TagGroupInnerProps) {\n let tagListRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot();\n let state = useListState({\n ...props,\n children: undefined,\n collection\n });\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(props);\n let domPropOverrides = Object.fromEntries(Object.entries(domProps).map(([k]) => [k, undefined]));\n let {\n gridProps,\n labelProps,\n descriptionProps,\n errorMessageProps\n } = useTagGroup({\n ...props,\n ...domPropOverrides,\n label\n }, state, tagListRef);\n\n return (\n <div\n {...domProps}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T extends object>(props: TagListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(ListStateContext);\n return state\n ? <TagListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TagListInner<T extends object>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps(props, forwardedRef, TagListContext);\n delete gridProps.items;\n delete gridProps.renderEmptyState;\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n\n return (\n <div\n {...mergeProps(gridProps, focusProps)}\n {...renderProps}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {state.collection.size === 0 && props.renderEmptyState\n ? props.renderEmptyState(renderValues)\n : <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />}\n </div>\n );\n}\n\nexport interface TagRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /**\n * Whether the tag group allows items to be removed.\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean\n}\n\nexport interface TagProps extends RenderProps<TagRenderProps>, LinkDOMProps, HoverEvents {\n /** A unique id for the tag. */\n id?: Key,\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string,\n /** Whether the tag is disabled. */\n isDisabled?: boolean\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent('item', (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: true});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');\n }\n }, [item.textValue]);\n\n return (\n <div\n ref={ref}\n {...renderProps}\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps)}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n remove: removeButtonProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"TagGroup.main.js.map"}
package/dist/TagGroup.mjs CHANGED
@@ -8,7 +8,7 @@ import {useTagGroup as $7lruP$useTagGroup, useFocusRing as $7lruP$useFocusRing,
8
8
  import {CollectionBuilder as $7lruP$CollectionBuilder, Collection as $7lruP$Collection, createLeafComponent as $7lruP$createLeafComponent} from "@react-aria/collections";
9
9
  import {filterDOMProps as $7lruP$filterDOMProps, mergeProps as $7lruP$mergeProps, useObjectRef as $7lruP$useObjectRef} from "@react-aria/utils";
10
10
  import {useListState as $7lruP$useListState} from "react-stately";
11
- import $7lruP$react, {createContext as $7lruP$createContext, useRef as $7lruP$useRef, forwardRef as $7lruP$forwardRef, useContext as $7lruP$useContext, useEffect as $7lruP$useEffect} from "react";
11
+ import $7lruP$react, {createContext as $7lruP$createContext, forwardRef as $7lruP$forwardRef, useRef as $7lruP$useRef, useContext as $7lruP$useContext, useEffect as $7lruP$useEffect} from "react";
12
12
 
13
13
  /*
14
14
  * Copyright 2022 Adobe. All rights reserved.
@@ -33,7 +33,7 @@ import $7lruP$react, {createContext as $7lruP$createContext, useRef as $7lruP$us
33
33
 
34
34
  const $eaf9e70818b436db$export$5b07b5dd2cbd96e3 = /*#__PURE__*/ (0, $7lruP$createContext)(null);
35
35
  const $eaf9e70818b436db$export$e755ce3685dd0ca9 = /*#__PURE__*/ (0, $7lruP$createContext)(null);
36
- function $eaf9e70818b436db$var$TagGroup(props, ref) {
36
+ const $eaf9e70818b436db$export$67ea30858aaf75e3 = /*#__PURE__*/ (0, $7lruP$forwardRef)(function TagGroup(props, ref) {
37
37
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $eaf9e70818b436db$export$5b07b5dd2cbd96e3);
38
38
  return /*#__PURE__*/ (0, $7lruP$react).createElement((0, $7lruP$CollectionBuilder), {
39
39
  content: props.children
@@ -42,7 +42,7 @@ function $eaf9e70818b436db$var$TagGroup(props, ref) {
42
42
  forwardedRef: ref,
43
43
  collection: collection
44
44
  }));
45
- }
45
+ });
46
46
  function $eaf9e70818b436db$var$TagGroupInner({ props: props, forwardedRef: ref, collection: collection }) {
47
47
  let tagListRef = (0, $7lruP$useRef)(null);
48
48
  let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
@@ -102,16 +102,13 @@ function $eaf9e70818b436db$var$TagGroupInner({ props: props, forwardedRef: ref,
102
102
  ]
103
103
  }, props.children));
104
104
  }
105
- /**
106
- * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.
107
- */ const $eaf9e70818b436db$export$67ea30858aaf75e3 = /*#__PURE__*/ (0, $7lruP$forwardRef)($eaf9e70818b436db$var$TagGroup);
108
- function $eaf9e70818b436db$var$TagList(props, ref) {
105
+ const $eaf9e70818b436db$export$f9fef0f55402315b = /*#__PURE__*/ (0, $7lruP$forwardRef)(function TagList(props, ref) {
109
106
  let state = (0, $7lruP$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
110
107
  return state ? /*#__PURE__*/ (0, $7lruP$react).createElement($eaf9e70818b436db$var$TagListInner, {
111
108
  props: props,
112
109
  forwardedRef: ref
113
110
  }) : /*#__PURE__*/ (0, $7lruP$react).createElement((0, $7lruP$Collection), props);
114
- }
111
+ });
115
112
  function $eaf9e70818b436db$var$TagListInner({ props: props, forwardedRef: forwardedRef }) {
116
113
  let state = (0, $7lruP$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
117
114
  let { CollectionRoot: CollectionRoot } = (0, $7lruP$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
@@ -144,9 +141,6 @@ function $eaf9e70818b436db$var$TagListInner({ props: props, forwardedRef: forwar
144
141
  persistedKeys: persistedKeys
145
142
  }));
146
143
  }
147
- /**
148
- * A tag list is a container for tags within a TagGroup.
149
- */ const $eaf9e70818b436db$export$f9fef0f55402315b = /*#__PURE__*/ (0, $7lruP$forwardRef)($eaf9e70818b436db$var$TagList);
150
144
  const $eaf9e70818b436db$export$3288d34c523a1192 = /*#__PURE__*/ (0, $7lruP$createLeafComponent)('item', (props, forwardedRef, item)=>{
151
145
  let state = (0, $7lruP$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
152
146
  let ref = (0, $7lruP$useObjectRef)(forwardedRef);
@@ -8,7 +8,7 @@ import {useTagGroup as $7lruP$useTagGroup, useFocusRing as $7lruP$useFocusRing,
8
8
  import {CollectionBuilder as $7lruP$CollectionBuilder, Collection as $7lruP$Collection, createLeafComponent as $7lruP$createLeafComponent} from "@react-aria/collections";
9
9
  import {filterDOMProps as $7lruP$filterDOMProps, mergeProps as $7lruP$mergeProps, useObjectRef as $7lruP$useObjectRef} from "@react-aria/utils";
10
10
  import {useListState as $7lruP$useListState} from "react-stately";
11
- import $7lruP$react, {createContext as $7lruP$createContext, useRef as $7lruP$useRef, forwardRef as $7lruP$forwardRef, useContext as $7lruP$useContext, useEffect as $7lruP$useEffect} from "react";
11
+ import $7lruP$react, {createContext as $7lruP$createContext, forwardRef as $7lruP$forwardRef, useRef as $7lruP$useRef, useContext as $7lruP$useContext, useEffect as $7lruP$useEffect} from "react";
12
12
 
13
13
  /*
14
14
  * Copyright 2022 Adobe. All rights reserved.
@@ -33,7 +33,7 @@ import $7lruP$react, {createContext as $7lruP$createContext, useRef as $7lruP$us
33
33
 
34
34
  const $eaf9e70818b436db$export$5b07b5dd2cbd96e3 = /*#__PURE__*/ (0, $7lruP$createContext)(null);
35
35
  const $eaf9e70818b436db$export$e755ce3685dd0ca9 = /*#__PURE__*/ (0, $7lruP$createContext)(null);
36
- function $eaf9e70818b436db$var$TagGroup(props, ref) {
36
+ const $eaf9e70818b436db$export$67ea30858aaf75e3 = /*#__PURE__*/ (0, $7lruP$forwardRef)(function TagGroup(props, ref) {
37
37
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $eaf9e70818b436db$export$5b07b5dd2cbd96e3);
38
38
  return /*#__PURE__*/ (0, $7lruP$react).createElement((0, $7lruP$CollectionBuilder), {
39
39
  content: props.children
@@ -42,7 +42,7 @@ function $eaf9e70818b436db$var$TagGroup(props, ref) {
42
42
  forwardedRef: ref,
43
43
  collection: collection
44
44
  }));
45
- }
45
+ });
46
46
  function $eaf9e70818b436db$var$TagGroupInner({ props: props, forwardedRef: ref, collection: collection }) {
47
47
  let tagListRef = (0, $7lruP$useRef)(null);
48
48
  let [labelRef, label] = (0, $64fa3d84918910a7$export$9d4c57ee4c6ffdd8)();
@@ -102,16 +102,13 @@ function $eaf9e70818b436db$var$TagGroupInner({ props: props, forwardedRef: ref,
102
102
  ]
103
103
  }, props.children));
104
104
  }
105
- /**
106
- * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.
107
- */ const $eaf9e70818b436db$export$67ea30858aaf75e3 = /*#__PURE__*/ (0, $7lruP$forwardRef)($eaf9e70818b436db$var$TagGroup);
108
- function $eaf9e70818b436db$var$TagList(props, ref) {
105
+ const $eaf9e70818b436db$export$f9fef0f55402315b = /*#__PURE__*/ (0, $7lruP$forwardRef)(function TagList(props, ref) {
109
106
  let state = (0, $7lruP$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
110
107
  return state ? /*#__PURE__*/ (0, $7lruP$react).createElement($eaf9e70818b436db$var$TagListInner, {
111
108
  props: props,
112
109
  forwardedRef: ref
113
110
  }) : /*#__PURE__*/ (0, $7lruP$react).createElement((0, $7lruP$Collection), props);
114
- }
111
+ });
115
112
  function $eaf9e70818b436db$var$TagListInner({ props: props, forwardedRef: forwardedRef }) {
116
113
  let state = (0, $7lruP$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
117
114
  let { CollectionRoot: CollectionRoot } = (0, $7lruP$useContext)((0, $7135fc7d473fd974$export$4feb769f8ddf26c5));
@@ -144,9 +141,6 @@ function $eaf9e70818b436db$var$TagListInner({ props: props, forwardedRef: forwar
144
141
  persistedKeys: persistedKeys
145
142
  }));
146
143
  }
147
- /**
148
- * A tag list is a container for tags within a TagGroup.
149
- */ const $eaf9e70818b436db$export$f9fef0f55402315b = /*#__PURE__*/ (0, $7lruP$forwardRef)($eaf9e70818b436db$var$TagList);
150
144
  const $eaf9e70818b436db$export$3288d34c523a1192 = /*#__PURE__*/ (0, $7lruP$createLeafComponent)('item', (props, forwardedRef, item)=>{
151
145
  let state = (0, $7lruP$useContext)((0, $eed445e0843c11d0$export$7c5906fe4f1f2af2));
152
146
  let ref = (0, $7lruP$useObjectRef)(forwardedRef);
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4CM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAmD;AAE7F,SAAS,+BAAS,KAAoB,EAAE,GAAiC;IACvE,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,qBACE,gCAAC,CAAA,GAAA,wBAAgB;QAAE,SAAS,MAAM,QAAQ;OACvC,CAAA,2BAAc,gCAAC;YAAc,OAAO;YAAO,cAAc;YAAK,YAAY;;AAGjF;AAQA,SAAS,oCAAc,SAAC,KAAK,EAAE,cAAc,GAAG,cAAE,UAAU,EAAqB;IAC/E,IAAI,aAAa,CAAA,GAAA,aAAK,EAAkB;IACxC,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,yCAAM;IAC9B,IAAI,QAAQ,CAAA,GAAA,mBAAW,EAAE;QACvB,GAAG,KAAK;QACR,UAAU;oBACV;IACF;IAEA,8CAA8C;IAC9C,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAC9B,IAAI,mBAAmB,OAAO,WAAW,CAAC,OAAO,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,GAAK;YAAC;YAAG;SAAU;IAC9F,IAAI,aACF,SAAS,cACT,UAAU,oBACV,gBAAgB,qBAChB,iBAAiB,EAClB,GAAG,CAAA,GAAA,kBAAU,EAAE;QACd,GAAG,KAAK;QACR,GAAG,gBAAgB;eACnB;IACF,GAAG,OAAO;QAOK;IALf,qBACE,gCAAC;QACE,GAAG,QAAQ;QACZ,KAAK;QACL,MAAM,MA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Y,KAAK,KAAK,CAAC,UAAU;IACnC;IAEA,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,IAAI;QACJ,UAAU,KAAK,QAAQ;QACvB,kBAAkB;QAClB,QAAQ;YACN,GAAG,MAAM;4BACT;uBACA;YACA,eAAe,MAAM,gBAAgB,CAAC,aAAa;YACnD,mBAAmB,MAAM,gBAAgB,CAAC,iBAAiB;QAC7D;IACF;IAEA,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,CAAC,KAAK,SAAS,EACjB,QAAQ,IAAI,CAAC;IAEjB,GAAG;QAAC,KAAK,SAAS;KAAC;IAEnB,qBACE,gCAAC;QACC,KAAK;QACJ,GAAG,WAAW;QACd,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,QAAe,UAAU,YAAY,WAAW;QAC9E,iBAAe,OAAO,UAAU,IAAI;QACpC,iBAAe,OAAO,UAAU,IAAI;QACpC,gBAAc,aAAa;QAC3B,gBAAc,OAAO,SAAS,IAAI;QAClC,sBAAoB,kBAAkB;QACtC,gBAAc,OAAO,SAAS,IAAI;QAClC,wBAAsB,OAAO,cAAc,IAAI;QAC/C,uBAAqB,MAAM,gBAAgB,CAAC,aAAa,KAAK,SAAS,YAAY,MAAM,gBAAgB,CAAC,aAAa;qBACvH,gCAAC;QAAK,GAAG,aAAa;QAAE,OAAO;YAAC,SAAS;QAAU;qBACjD,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAY;gBAAG;oBACd,OAAO;wBACL,QAAQ;oBACV;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAwB;gBAAG,CAAA,GAAA,yCAAwB;aAAE;SACvD;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaTagGroupProps, useFocusRing, useHover, useTag, useTagGroup} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {filterDOMProps, mergeProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {ListState, Node, useListState} from 'react-stately';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface TagGroupProps extends Omit<AriaTagGroupProps<unknown>, 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'>, DOMProps, SlotProps {}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tag list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tag list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>\n}\n\nexport interface TagListProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, StyleRenderProps<TagListRenderProps> {\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\nfunction TagGroup(props: TagGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n}\n\ninterface TagGroupInnerProps {\n props: TagGroupProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n collection\n}\n\nfunction TagGroupInner({props, forwardedRef: ref, collection}: TagGroupInnerProps) {\n let tagListRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot();\n let state = useListState({\n ...props,\n children: undefined,\n collection\n });\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(props);\n let domPropOverrides = Object.fromEntries(Object.entries(domProps).map(([k]) => [k, undefined]));\n let {\n gridProps,\n labelProps,\n descriptionProps,\n errorMessageProps\n } = useTagGroup({\n ...props,\n ...domPropOverrides,\n label\n }, state, tagListRef);\n\n return (\n <div\n {...domProps}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n */\nconst _TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(TagGroup);\nexport {_TagGroup as TagGroup};\n\nfunction TagList<T extends object>(props: TagListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(ListStateContext);\n return state\n ? <TagListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n}\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TagListInner<T extends object>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps(props, forwardedRef, TagListContext);\n delete gridProps.items;\n delete gridProps.renderEmptyState;\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n\n return (\n <div\n {...mergeProps(gridProps, focusProps)}\n {...renderProps}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {state.collection.size === 0 && props.renderEmptyState\n ? props.renderEmptyState(renderValues)\n : <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />}\n </div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nconst _TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(TagList);\nexport {_TagList as TagList};\n\nexport interface TagRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /**\n * Whether the tag group allows items to be removed.\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean\n}\n\nexport interface TagProps extends RenderProps<TagRenderProps>, LinkDOMProps, HoverEvents {\n /** A unique id for the tag. */\n id?: Key,\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string,\n /** Whether the tag is disabled. */\n isDisabled?: boolean\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent('item', (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: true});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');\n }\n }, [item.textValue]);\n\n return (\n <div\n ref={ref}\n {...renderProps}\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps)}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n remove: removeButtonProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"TagGroup.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;AA4CM,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAA+C;AACnF,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAm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C;IAEjB,GAAG;QAAC,KAAK,SAAS;KAAC;IAEnB,qBACE,gCAAC;QACC,KAAK;QACJ,GAAG,WAAW;QACd,GAAG,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,QAAe,UAAU,YAAY,WAAW;QAC9E,iBAAe,OAAO,UAAU,IAAI;QACpC,iBAAe,OAAO,UAAU,IAAI;QACpC,gBAAc,aAAa;QAC3B,gBAAc,OAAO,SAAS,IAAI;QAClC,sBAAoB,kBAAkB;QACtC,gBAAc,OAAO,SAAS,IAAI;QAClC,wBAAsB,OAAO,cAAc,IAAI;QAC/C,uBAAqB,MAAM,gBAAgB,CAAC,aAAa,KAAK,SAAS,YAAY,MAAM,gBAAgB,CAAC,aAAa;qBACvH,gCAAC;QAAK,GAAG,aAAa;QAAE,OAAO;YAAC,SAAS;QAAU;qBACjD,gCAAC,CAAA,GAAA,yCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAY;gBAAG;oBACd,OAAO;wBACL,QAAQ;oBACV;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAwB;gBAAG,CAAA,GAAA,yCAAwB;aAAE;SACvD;OACA,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/TagGroup.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {AriaTagGroupProps, useFocusRing, useHover, useTag, useTagGroup} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {Collection, CollectionBuilder, createLeafComponent} from '@react-aria/collections';\nimport {CollectionProps, CollectionRendererContext, DefaultCollectionRenderer, ItemRenderProps, usePersistedKeys} from './Collection';\nimport {ContextValue, DOMProps, Provider, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {filterDOMProps, mergeProps, useObjectRef} from '@react-aria/utils';\nimport {forwardRefType, HoverEvents, Key, LinkDOMProps} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {ListState, Node, useListState} from 'react-stately';\nimport {ListStateContext} from './ListBox';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useEffect, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface TagGroupProps extends Omit<AriaTagGroupProps<unknown>, 'children' | 'items' | 'label' | 'description' | 'errorMessage' | 'keyboardDelegate'>, DOMProps, SlotProps {}\n\nexport interface TagListRenderProps {\n /**\n * Whether the tag list has no items and should display its empty state.\n * @selector [data-empty]\n */\n isEmpty: boolean,\n /**\n * Whether the tag list is currently focused.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the tag list is currently keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * State of the TagGroup.\n */\n state: ListState<unknown>\n}\n\nexport interface TagListProps<T> extends Omit<CollectionProps<T>, 'disabledKeys'>, StyleRenderProps<TagListRenderProps> {\n /** Provides content to display when there are no items in the tag list. */\n renderEmptyState?: (props: TagListRenderProps) => ReactNode\n}\n\nexport const TagGroupContext = createContext<ContextValue<TagGroupProps, HTMLDivElement>>(null);\nexport const TagListContext = createContext<ContextValue<TagListProps<any>, HTMLDivElement>>(null);\n\n/**\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n */\nexport const TagGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagGroup(props: TagGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TagGroupContext);\n return (\n <CollectionBuilder content={props.children}>\n {collection => <TagGroupInner props={props} forwardedRef={ref} collection={collection} />}\n </CollectionBuilder>\n );\n});\n\ninterface TagGroupInnerProps {\n props: TagGroupProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n collection\n}\n\nfunction TagGroupInner({props, forwardedRef: ref, collection}: TagGroupInnerProps) {\n let tagListRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot();\n let state = useListState({\n ...props,\n children: undefined,\n collection\n });\n\n // Prevent DOM props from going to two places.\n let domProps = filterDOMProps(props);\n let domPropOverrides = Object.fromEntries(Object.entries(domProps).map(([k]) => [k, undefined]));\n let {\n gridProps,\n labelProps,\n descriptionProps,\n errorMessageProps\n } = useTagGroup({\n ...props,\n ...domPropOverrides,\n label\n }, state, tagListRef);\n\n return (\n <div\n {...domProps}\n ref={ref}\n slot={props.slot || undefined}\n className={props.className ?? 'react-aria-TagGroup'}\n style={props.style}>\n <Provider\n values={[\n [LabelContext, {...labelProps, elementType: 'span', ref: labelRef}],\n [TagListContext, {...gridProps, ref: tagListRef}],\n [ListStateContext, state],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }]\n ]}>\n {props.children}\n </Provider>\n </div>\n );\n}\n\n/**\n * A tag list is a container for tags within a TagGroup.\n */\nexport const TagList = /*#__PURE__*/ (forwardRef as forwardRefType)(function TagList<T extends object>(props: TagListProps<T>, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n let state = useContext(ListStateContext);\n return state\n ? <TagListInner props={props} forwardedRef={ref} />\n : <Collection {...props} />;\n});\n\ninterface TagListInnerProps<T> {\n props: TagListProps<T>,\n forwardedRef: ForwardedRef<HTMLDivElement>\n}\n\nfunction TagListInner<T extends object>({props, forwardedRef}: TagListInnerProps<T>) {\n let state = useContext(ListStateContext)!;\n let {CollectionRoot} = useContext(CollectionRendererContext);\n let [gridProps, ref] = useContextProps(props, forwardedRef, TagListContext);\n delete gridProps.items;\n delete gridProps.renderEmptyState;\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let renderValues = {\n isEmpty: state.collection.size === 0,\n isFocused,\n isFocusVisible,\n state\n };\n let renderProps = useRenderProps({\n className: props.className,\n style: props.style,\n defaultClassName: 'react-aria-TagList',\n values: renderValues\n });\n\n let persistedKeys = usePersistedKeys(state.selectionManager.focusedKey);\n\n return (\n <div\n {...mergeProps(gridProps, focusProps)}\n {...renderProps}\n ref={ref}\n data-empty={state.collection.size === 0 || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}>\n {state.collection.size === 0 && props.renderEmptyState\n ? props.renderEmptyState(renderValues)\n : <CollectionRoot collection={state.collection} persistedKeys={persistedKeys} />}\n </div>\n );\n}\n\nexport interface TagRenderProps extends Omit<ItemRenderProps, 'allowsDragging' | 'isDragging' | 'isDropTarget'> {\n /**\n * Whether the tag group allows items to be removed.\n * @selector [data-allows-removing]\n */\n allowsRemoving: boolean\n}\n\nexport interface TagProps extends RenderProps<TagRenderProps>, LinkDOMProps, HoverEvents {\n /** A unique id for the tag. */\n id?: Key,\n /**\n * A string representation of the tags's contents, used for accessibility.\n * Required if children is not a plain text string.\n */\n textValue?: string,\n /** Whether the tag is disabled. */\n isDisabled?: boolean\n}\n\n/**\n * A Tag is an individual item within a TagList.\n */\nexport const Tag = /*#__PURE__*/ createLeafComponent('item', (props: TagProps, forwardedRef: ForwardedRef<HTMLDivElement>, item: Node<unknown>) => {\n let state = useContext(ListStateContext)!;\n let ref = useObjectRef<HTMLDivElement>(forwardedRef);\n let {focusProps, isFocusVisible} = useFocusRing({within: true});\n let {rowProps, gridCellProps, removeButtonProps, ...states} = useTag({item}, state, ref);\n\n let {hoverProps, isHovered} = useHover({\n isDisabled: !states.allowsSelection,\n onHoverStart: item.props.onHoverStart,\n onHoverChange: item.props.onHoverChange,\n onHoverEnd: item.props.onHoverEnd\n });\n\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n children: item.rendered,\n defaultClassName: 'react-aria-Tag',\n values: {\n ...states,\n isFocusVisible,\n isHovered,\n selectionMode: state.selectionManager.selectionMode,\n selectionBehavior: state.selectionManager.selectionBehavior\n }\n });\n\n useEffect(() => {\n if (!item.textValue) {\n console.warn('A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.');\n }\n }, [item.textValue]);\n\n return (\n <div\n ref={ref}\n {...renderProps}\n {...mergeProps(filterDOMProps(props as any), rowProps, focusProps, hoverProps)}\n data-selected={states.isSelected || undefined}\n data-disabled={states.isDisabled || undefined}\n data-hovered={isHovered || undefined}\n data-focused={states.isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-pressed={states.isPressed || undefined}\n data-allows-removing={states.allowsRemoving || undefined}\n data-selection-mode={state.selectionManager.selectionMode === 'none' ? undefined : state.selectionManager.selectionMode}>\n <div {...gridCellProps} style={{display: 'contents'}}>\n <Provider\n values={[\n [ButtonContext, {\n slots: {\n remove: removeButtonProps\n }\n }],\n [CollectionRendererContext, DefaultCollectionRenderer]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"TagGroup.module.js.map"}
package/dist/Text.main.js CHANGED
@@ -25,7 +25,7 @@ $parcel$export(module.exports, "Text", () => $a8a589c28affdc40$export$5f1af8db98
25
25
  */
26
26
 
27
27
  const $a8a589c28affdc40$export$9afb8bc826b033ea = /*#__PURE__*/ (0, $bTf3o$react.createContext)({});
28
- function $a8a589c28affdc40$var$Text(props, ref) {
28
+ const $a8a589c28affdc40$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $bTf3o$react.forwardRef)(function Text(props, ref) {
29
29
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $a8a589c28affdc40$export$9afb8bc826b033ea);
30
30
  let { elementType: ElementType = 'span', ...domProps } = props;
31
31
  // @ts-ignore
@@ -34,8 +34,7 @@ function $a8a589c28affdc40$var$Text(props, ref) {
34
34
  ...domProps,
35
35
  ref: ref
36
36
  });
37
- }
38
- const $a8a589c28affdc40$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $bTf3o$react.forwardRef)($a8a589c28affdc40$var$Text);
37
+ });
39
38
 
40
39
 
41
40
  //# sourceMappingURL=Text.main.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AASM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAwC,CAAC;AAEhF,SAAS,2BAAK,KAAgB,EAAE,GAA8B;IAC5D,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,aAAa,cAAc,MAAM,EAAE,GAAG,UAAS,GAAG;IACvD,aAAa;IACb,qBAAO,0DAAC;QAAY,WAAU;QAAmB,GAAG,QAAQ;QAAE,KAAK;;AACrE;AAEA,MAAM,0DAAQ,CAAA,GAAA,uBAAS,EAAE","sources":["packages/react-aria-components/src/Text.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {ContextValue, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\n\nexport interface TextProps extends HTMLAttributes<HTMLElement> {\n elementType?: string\n}\n\nexport const TextContext = createContext<ContextValue<TextProps, HTMLElement>>({});\n\nfunction Text(props: TextProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, TextContext);\n let {elementType: ElementType = 'span', ...domProps} = props;\n // @ts-ignore\n return <ElementType className=\"react-aria-Text\" {...domProps} ref={ref} />;\n}\n\nconst _Text = forwardRef(Text);\nexport {_Text as Text};\n"],"names":[],"version":3,"file":"Text.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;AASM,MAAM,0DAAc,CAAA,GAAA,0BAAY,EAAwC,CAAC;AAEzE,MAAM,0DAAO,CAAA,GAAA,uBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAA8B;IAC3F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,aAAa,cAAc,MAAM,EAAE,GAAG,UAAS,GAAG;IACvD,aAAa;IACb,qBAAO,0DAAC;QAAY,WAAU;QAAmB,GAAG,QAAQ;QAAE,KAAK;;AACrE","sources":["packages/react-aria-components/src/Text.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {ContextValue, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\n\nexport interface TextProps extends HTMLAttributes<HTMLElement> {\n elementType?: string\n}\n\nexport const TextContext = createContext<ContextValue<TextProps, HTMLElement>>({});\n\nexport const Text = forwardRef(function Text(props: TextProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, TextContext);\n let {elementType: ElementType = 'span', ...domProps} = props;\n // @ts-ignore\n return <ElementType className=\"react-aria-Text\" {...domProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Text.main.js.map"}
package/dist/Text.mjs CHANGED
@@ -14,7 +14,7 @@ import $1B3Dx$react, {createContext as $1B3Dx$createContext, forwardRef as $1B3D
14
14
  */
15
15
 
16
16
  const $514c0188e459b4c0$export$9afb8bc826b033ea = /*#__PURE__*/ (0, $1B3Dx$createContext)({});
17
- function $514c0188e459b4c0$var$Text(props, ref) {
17
+ const $514c0188e459b4c0$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $1B3Dx$forwardRef)(function Text(props, ref) {
18
18
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $514c0188e459b4c0$export$9afb8bc826b033ea);
19
19
  let { elementType: ElementType = 'span', ...domProps } = props;
20
20
  // @ts-ignore
@@ -23,8 +23,7 @@ function $514c0188e459b4c0$var$Text(props, ref) {
23
23
  ...domProps,
24
24
  ref: ref
25
25
  });
26
- }
27
- const $514c0188e459b4c0$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $1B3Dx$forwardRef)($514c0188e459b4c0$var$Text);
26
+ });
28
27
 
29
28
 
30
29
  export {$514c0188e459b4c0$export$9afb8bc826b033ea as TextContext, $514c0188e459b4c0$export$5f1af8db9871e1d6 as Text};
@@ -14,7 +14,7 @@ import $1B3Dx$react, {createContext as $1B3Dx$createContext, forwardRef as $1B3D
14
14
  */
15
15
 
16
16
  const $514c0188e459b4c0$export$9afb8bc826b033ea = /*#__PURE__*/ (0, $1B3Dx$createContext)({});
17
- function $514c0188e459b4c0$var$Text(props, ref) {
17
+ const $514c0188e459b4c0$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $1B3Dx$forwardRef)(function Text(props, ref) {
18
18
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $514c0188e459b4c0$export$9afb8bc826b033ea);
19
19
  let { elementType: ElementType = 'span', ...domProps } = props;
20
20
  // @ts-ignore
@@ -23,8 +23,7 @@ function $514c0188e459b4c0$var$Text(props, ref) {
23
23
  ...domProps,
24
24
  ref: ref
25
25
  });
26
- }
27
- const $514c0188e459b4c0$export$5f1af8db9871e1d6 = /*#__PURE__*/ (0, $1B3Dx$forwardRef)($514c0188e459b4c0$var$Text);
26
+ });
28
27
 
29
28
 
30
29
  export {$514c0188e459b4c0$export$9afb8bc826b033ea as TextContext, $514c0188e459b4c0$export$5f1af8db9871e1d6 as Text};
@@ -1 +1 @@
1
- {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AASM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAwC,CAAC;AAEhF,SAAS,2BAAK,KAAgB,EAAE,GAA8B;IAC5D,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,aAAa,cAAc,MAAM,EAAE,GAAG,UAAS,GAAG;IACvD,aAAa;IACb,qBAAO,gCAAC;QAAY,WAAU;QAAmB,GAAG,QAAQ;QAAE,KAAK;;AACrE;AAEA,MAAM,0DAAQ,CAAA,GAAA,iBAAS,EAAE","sources":["packages/react-aria-components/src/Text.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {ContextValue, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\n\nexport interface TextProps extends HTMLAttributes<HTMLElement> {\n elementType?: string\n}\n\nexport const TextContext = createContext<ContextValue<TextProps, HTMLElement>>({});\n\nfunction Text(props: TextProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, TextContext);\n let {elementType: ElementType = 'span', ...domProps} = props;\n // @ts-ignore\n return <ElementType className=\"react-aria-Text\" {...domProps} ref={ref} />;\n}\n\nconst _Text = forwardRef(Text);\nexport {_Text as Text};\n"],"names":[],"version":3,"file":"Text.module.js.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AASM,MAAM,0DAAc,CAAA,GAAA,oBAAY,EAAwC,CAAC;AAEzE,MAAM,0DAAO,CAAA,GAAA,iBAAS,EAAE,SAAS,KAAK,KAAgB,EAAE,GAA8B;IAC3F,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,aAAa,cAAc,MAAM,EAAE,GAAG,UAAS,GAAG;IACvD,aAAa;IACb,qBAAO,gCAAC;QAAY,WAAU;QAAmB,GAAG,QAAQ;QAAE,KAAK;;AACrE","sources":["packages/react-aria-components/src/Text.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {ContextValue, useContextProps} from './utils';\nimport React, {createContext, ForwardedRef, forwardRef, HTMLAttributes} from 'react';\n\nexport interface TextProps extends HTMLAttributes<HTMLElement> {\n elementType?: string\n}\n\nexport const TextContext = createContext<ContextValue<TextProps, HTMLElement>>({});\n\nexport const Text = forwardRef(function Text(props: TextProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, TextContext);\n let {elementType: ElementType = 'span', ...domProps} = props;\n // @ts-ignore\n return <ElementType className=\"react-aria-Text\" {...domProps} ref={ref} />;\n});\n"],"names":[],"version":3,"file":"Text.module.js.map"}
@@ -22,7 +22,7 @@ let $a5d2423f42834231$var$filterHoverProps = (props)=>{
22
22
  let { onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
23
23
  return otherProps;
24
24
  };
25
- function $a5d2423f42834231$var$TextArea(props, ref) {
25
+ const $a5d2423f42834231$export$f5c9f3c2c4054eec = /*#__PURE__*/ (0, $gp0Yb$react.forwardRef)(function TextArea(props, ref) {
26
26
  [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $a5d2423f42834231$export$2dc6166a7e65358c);
27
27
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $gp0Yb$reactaria.useHover)(props);
28
28
  let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $gp0Yb$reactaria.useFocusRing)({
@@ -51,10 +51,7 @@ function $a5d2423f42834231$var$TextArea(props, ref) {
51
51
  "data-focus-visible": isFocusVisible || undefined,
52
52
  "data-invalid": isInvalid || undefined
53
53
  });
54
- }
55
- /**
56
- * A textarea allows a user to input mult-line text.
57
- */ const $a5d2423f42834231$export$f5c9f3c2c4054eec = /*#__PURE__*/ (0, $gp0Yb$react.forwardRef)($a5d2423f42834231$var$TextArea);
54
+ });
58
55
 
59
56
 
60
57
  //# sourceMappingURL=TextArea.main.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;AAOO,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD,CAAC;AAEhG,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAEA,SAAS,+BAAS,KAAoB,EAAE,GAAsC;IAC5E,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IACvC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC;AACA;;CAEC,GACD,MAAM,0DAAY,CAAA,GAAA,uBAAS,EAAE","sources":["packages/react-aria-components/src/TextArea.tsx"],"sourcesContent":["import {ContextValue, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport {InputRenderProps} from './Input';\nimport React, {createContext, ForwardedRef, forwardRef, TextareaHTMLAttributes} from 'react';\n\nexport interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, HTMLTextAreaElement>>({});\n\nlet filterHoverProps = (props: TextAreaProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\nfunction TextArea(props: TextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>) {\n [props, ref] = useContextProps(props, ref, TextAreaContext);\n\n let {hoverProps, isHovered} = useHover(props);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-TextArea'\n });\n\n return (\n <textarea\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n}\n/**\n * A textarea allows a user to input mult-line text.\n */\nconst _TextArea = forwardRef(TextArea);\nexport {_TextArea as TextArea};\n"],"names":[],"version":3,"file":"TextArea.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;AAOO,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAoD,CAAC;AAEhG,IAAI,yCAAmB,CAAC;IACtB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,0DAAW,CAAA,GAAA,uBAAS,EAAE,SAAS,SAAS,KAAoB,EAAE,GAAsC;IAC/G,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAE3C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IACvC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;QACzD,aAAa;QACb,WAAW,MAAM,SAAS;IAC5B;IAEA,IAAI,YAAY,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,KAAK;IACrE,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;uBACN;uBACA;4BACA;YACA,YAAY,MAAM,QAAQ,IAAI;uBAC9B;QACF;QACA,kBAAkB;IACpB;IAEA,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,uCAAiB,QAAQ,YAAY,WAAW;QAC9D,GAAG,WAAW;QACf,KAAK;QACL,gBAAc,aAAa;QAC3B,iBAAe,MAAM,QAAQ,IAAI;QACjC,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,gBAAc,aAAa;;AAEjC","sources":["packages/react-aria-components/src/TextArea.tsx"],"sourcesContent":["import {ContextValue, StyleRenderProps, useContextProps, useRenderProps} from './utils';\nimport {HoverEvents, mergeProps, useFocusRing, useHover} from 'react-aria';\nimport {InputRenderProps} from './Input';\nimport React, {createContext, ForwardedRef, forwardRef, TextareaHTMLAttributes} from 'react';\n\nexport interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className' | 'style'>, HoverEvents, StyleRenderProps<InputRenderProps> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, HTMLTextAreaElement>>({});\n\nlet filterHoverProps = (props: TextAreaProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * A textarea allows a user to input mult-line text.\n */\nexport const TextArea = forwardRef(function TextArea(props: TextAreaProps, ref: ForwardedRef<HTMLTextAreaElement>) {\n [props, ref] = useContextProps(props, ref, TextAreaContext);\n\n let {hoverProps, isHovered} = useHover(props);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n isTextInput: true,\n autoFocus: props.autoFocus\n });\n\n let isInvalid = !!props['aria-invalid'] && props['aria-invalid'] !== 'false';\n let renderProps = useRenderProps({\n ...props,\n values: {\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled: props.disabled || false,\n isInvalid\n },\n defaultClassName: 'react-aria-TextArea'\n });\n\n return (\n <textarea\n {...mergeProps(filterHoverProps(props), focusProps, hoverProps)}\n {...renderProps}\n ref={ref}\n data-focused={isFocused || undefined}\n data-disabled={props.disabled || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-invalid={isInvalid || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"TextArea.main.js.map"}
package/dist/TextArea.mjs CHANGED
@@ -11,7 +11,7 @@ let $216918bed6669f72$var$filterHoverProps = (props)=>{
11
11
  let { onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
12
12
  return otherProps;
13
13
  };
14
- function $216918bed6669f72$var$TextArea(props, ref) {
14
+ const $216918bed6669f72$export$f5c9f3c2c4054eec = /*#__PURE__*/ (0, $9Usiy$forwardRef)(function TextArea(props, ref) {
15
15
  [props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $216918bed6669f72$export$2dc6166a7e65358c);
16
16
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $9Usiy$useHover)(props);
17
17
  let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $9Usiy$useFocusRing)({
@@ -40,10 +40,7 @@ function $216918bed6669f72$var$TextArea(props, ref) {
40
40
  "data-focus-visible": isFocusVisible || undefined,
41
41
  "data-invalid": isInvalid || undefined
42
42
  });
43
- }
44
- /**
45
- * A textarea allows a user to input mult-line text.
46
- */ const $216918bed6669f72$export$f5c9f3c2c4054eec = /*#__PURE__*/ (0, $9Usiy$forwardRef)($216918bed6669f72$var$TextArea);
43
+ });
47
44
 
48
45
 
49
46
  export {$216918bed6669f72$export$2dc6166a7e65358c as TextAreaContext, $216918bed6669f72$export$f5c9f3c2c4054eec as TextArea};