@react-aria/tag 3.3.3 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/ar-AE.mjs +1 -1
  2. package/dist/bg-BG.mjs +1 -1
  3. package/dist/cs-CZ.mjs +1 -1
  4. package/dist/da-DK.mjs +1 -1
  5. package/dist/de-DE.mjs +1 -1
  6. package/dist/el-GR.mjs +1 -1
  7. package/dist/en-US.mjs +1 -1
  8. package/dist/es-ES.mjs +1 -1
  9. package/dist/et-EE.mjs +1 -1
  10. package/dist/fi-FI.mjs +1 -1
  11. package/dist/fr-FR.mjs +1 -1
  12. package/dist/he-IL.mjs +1 -1
  13. package/dist/hr-HR.mjs +1 -1
  14. package/dist/hu-HU.mjs +1 -1
  15. package/dist/import.mjs +2 -257
  16. package/dist/intlStrings.main.js +108 -0
  17. package/dist/intlStrings.main.js.map +1 -0
  18. package/dist/intlStrings.mjs +110 -0
  19. package/dist/intlStrings.module.js +110 -0
  20. package/dist/intlStrings.module.js.map +1 -0
  21. package/dist/it-IT.mjs +1 -1
  22. package/dist/ja-JP.mjs +1 -1
  23. package/dist/ko-KR.mjs +1 -1
  24. package/dist/lt-LT.mjs +1 -1
  25. package/dist/lv-LV.mjs +1 -1
  26. package/dist/main.js +4 -259
  27. package/dist/main.js.map +1 -1
  28. package/dist/module.js +2 -257
  29. package/dist/module.js.map +1 -1
  30. package/dist/nb-NO.mjs +1 -1
  31. package/dist/nl-NL.mjs +1 -1
  32. package/dist/pl-PL.mjs +1 -1
  33. package/dist/pt-BR.mjs +1 -1
  34. package/dist/pt-PT.mjs +1 -1
  35. package/dist/ro-RO.mjs +1 -1
  36. package/dist/ru-RU.mjs +1 -1
  37. package/dist/sk-SK.mjs +1 -1
  38. package/dist/sl-SI.mjs +1 -1
  39. package/dist/sr-SP.mjs +1 -1
  40. package/dist/sv-SE.mjs +1 -1
  41. package/dist/tr-TR.mjs +1 -1
  42. package/dist/types.d.ts.map +1 -1
  43. package/dist/uk-UA.mjs +1 -1
  44. package/dist/useTag.main.js +88 -0
  45. package/dist/useTag.main.js.map +1 -0
  46. package/dist/useTag.mjs +83 -0
  47. package/dist/useTag.module.js +83 -0
  48. package/dist/useTag.module.js.map +1 -0
  49. package/dist/useTagGroup.main.js +89 -0
  50. package/dist/useTagGroup.main.js.map +1 -0
  51. package/dist/useTagGroup.mjs +83 -0
  52. package/dist/useTagGroup.module.js +83 -0
  53. package/dist/useTagGroup.module.js.map +1 -0
  54. package/dist/zh-CN.mjs +1 -1
  55. package/dist/zh-TW.mjs +1 -1
  56. package/package.json +11 -11
  57. package/src/useTagGroup.ts +2 -1
package/dist/module.js CHANGED
@@ -1,60 +1,7 @@
1
- import $84925f526f90eebd$exports from "./ar-AE.module.js";
2
- import $c0650163dc1b6f9d$exports from "./bg-BG.module.js";
3
- import $b2b55661291de587$exports from "./cs-CZ.module.js";
4
- import $deb83970956f6d5b$exports from "./da-DK.module.js";
5
- import $aea1cb4c7ec97e1c$exports from "./de-DE.module.js";
6
- import $3618d917e503a8d3$exports from "./el-GR.module.js";
7
- import $9eb56bbbe8e31294$exports from "./en-US.module.js";
8
- import $361c604b0fc269a3$exports from "./es-ES.module.js";
9
- import $2f00170f4ee3ca01$exports from "./et-EE.module.js";
10
- import $80ee16b64fab9fb5$exports from "./fi-FI.module.js";
11
- import $be9d354476c08087$exports from "./fr-FR.module.js";
12
- import $ffeb903ba092eb35$exports from "./he-IL.module.js";
13
- import $1df6722c6f19728b$exports from "./hr-HR.module.js";
14
- import $093d57e325bc9071$exports from "./hu-HU.module.js";
15
- import $609dbdfbcad85bdb$exports from "./it-IT.module.js";
16
- import $c08e84f882644048$exports from "./ja-JP.module.js";
17
- import $5cd130489822fa21$exports from "./ko-KR.module.js";
18
- import $ab5183739b6c5e7e$exports from "./lt-LT.module.js";
19
- import $dd84a0b574be3f23$exports from "./lv-LV.module.js";
20
- import $85eee97d14eef7b5$exports from "./nb-NO.module.js";
21
- import $18781839f93b0314$exports from "./nl-NL.module.js";
22
- import $1c40ffbbfe9f3bda$exports from "./pl-PL.module.js";
23
- import $156880e329b1c717$exports from "./pt-BR.module.js";
24
- import $b6d50b1d20768ce4$exports from "./pt-PT.module.js";
25
- import $d8c38c691b006187$exports from "./ro-RO.module.js";
26
- import $ed9b4bf7ce1fb1d7$exports from "./ru-RU.module.js";
27
- import $51d8721afda4d678$exports from "./sk-SK.module.js";
28
- import $fd37a27baae493e8$exports from "./sl-SI.module.js";
29
- import $5505a1ca71ffd6f4$exports from "./sr-SP.module.js";
30
- import $33670e148c84ad02$exports from "./sv-SE.module.js";
31
- import $0bf46fdcdd7cb5f6$exports from "./tr-TR.module.js";
32
- import $9d9765222bc08ca2$exports from "./uk-UA.module.js";
33
- import $d737296cedcdee9f$exports from "./zh-CN.module.js";
34
- import $09cd168ab18773f4$exports from "./zh-TW.module.js";
35
- import {useId as $aIvin$useId, useDescription as $aIvin$useDescription, filterDOMProps as $aIvin$filterDOMProps, getSyntheticLinkProps as $aIvin$getSyntheticLinkProps, mergeProps as $aIvin$mergeProps} from "@react-aria/utils";
36
- import {useGridListItem as $aIvin$useGridListItem, useGridList as $aIvin$useGridList} from "@react-aria/gridlist";
37
- import {useInteractionModality as $aIvin$useInteractionModality, useFocusWithin as $aIvin$useFocusWithin} from "@react-aria/interactions";
38
- import {useLocalizedStringFormatter as $aIvin$useLocalizedStringFormatter, useLocale as $aIvin$useLocale} from "@react-aria/i18n";
39
- import {ListKeyboardDelegate as $aIvin$ListKeyboardDelegate} from "@react-aria/selection";
40
- import {useState as $aIvin$useState, useRef as $aIvin$useRef, useEffect as $aIvin$useEffect} from "react";
41
- import {useField as $aIvin$useField} from "@react-aria/label";
1
+ import {useTag as $fc6126c82a4601f1$export$3f568fff7dff2f03} from "./useTag.module.js";
2
+ import {useTagGroup as $d7323bca8d074eeb$export$4f8b5cda58b7e8ff} from "./useTagGroup.module.js";
42
3
 
43
-
44
- function $parcel$interopDefault(a) {
45
- return a && a.__esModule ? a.default : a;
46
- }
47
4
  /*
48
- * Copyright 2020 Adobe. All rights reserved.
49
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
50
- * you may not use this file except in compliance with the License. You may obtain a copy
51
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
52
- *
53
- * Unless required by applicable law or agreed to in writing, software distributed under
54
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
55
- * OF ANY KIND, either express or implied. See the License for the specific language
56
- * governing permissions and limitations under the License.
57
- */ /*
58
5
  * Copyright 2020 Adobe. All rights reserved.
59
6
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
60
7
  * you may not use this file except in compliance with the License. You may obtain a copy
@@ -65,208 +12,6 @@ function $parcel$interopDefault(a) {
65
12
  * OF ANY KIND, either express or implied. See the License for the specific language
66
13
  * governing permissions and limitations under the License.
67
14
  */
68
- /*
69
- * Copyright 2020 Adobe. All rights reserved.
70
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
71
- * you may not use this file except in compliance with the License. You may obtain a copy
72
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
73
- *
74
- * Unless required by applicable law or agreed to in writing, software distributed under
75
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
76
- * OF ANY KIND, either express or implied. See the License for the specific language
77
- * governing permissions and limitations under the License.
78
- */
79
-
80
-
81
-
82
-
83
-
84
-
85
- const $d7323bca8d074eeb$export$653eddfc964b0f8a = new WeakMap();
86
- function $d7323bca8d074eeb$export$4f8b5cda58b7e8ff(props, state, ref) {
87
- let { direction: direction } = (0, $aIvin$useLocale)();
88
- let keyboardDelegate = props.keyboardDelegate || new (0, $aIvin$ListKeyboardDelegate)({
89
- collection: state.collection,
90
- ref: ref,
91
- orientation: "horizontal",
92
- direction: direction,
93
- disabledKeys: state.disabledKeys
94
- });
95
- let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $aIvin$useField)({
96
- ...props,
97
- labelElementType: "span"
98
- });
99
- let { gridProps: gridProps } = (0, $aIvin$useGridList)({
100
- ...props,
101
- ...fieldProps,
102
- keyboardDelegate: keyboardDelegate,
103
- shouldFocusWrap: true,
104
- linkBehavior: "override"
105
- }, state, ref);
106
- let [isFocusWithin, setFocusWithin] = (0, $aIvin$useState)(false);
107
- let { focusWithinProps: focusWithinProps } = (0, $aIvin$useFocusWithin)({
108
- onFocusWithinChange: setFocusWithin
109
- });
110
- let domProps = (0, $aIvin$filterDOMProps)(props);
111
- // If the last tag is removed, focus the container.
112
- let prevCount = (0, $aIvin$useRef)(state.collection.size);
113
- (0, $aIvin$useEffect)(()=>{
114
- if (ref.current && prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) ref.current.focus();
115
- prevCount.current = state.collection.size;
116
- }, [
117
- state.collection.size,
118
- isFocusWithin,
119
- ref
120
- ]);
121
- $d7323bca8d074eeb$export$653eddfc964b0f8a.set(state, {
122
- onRemove: props.onRemove
123
- });
124
- return {
125
- gridProps: (0, $aIvin$mergeProps)(gridProps, domProps, {
126
- role: state.collection.size ? "grid" : null,
127
- "aria-atomic": false,
128
- "aria-relevant": "additions",
129
- "aria-live": isFocusWithin ? "polite" : "off",
130
- ...focusWithinProps,
131
- ...fieldProps
132
- }),
133
- labelProps: labelProps,
134
- descriptionProps: descriptionProps,
135
- errorMessageProps: errorMessageProps
136
- };
137
- }
138
-
139
-
140
- var $3bb15cc24d006ec5$exports = {};
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
-
164
-
165
-
166
-
167
-
168
-
169
-
170
-
171
-
172
-
173
-
174
-
175
- $3bb15cc24d006ec5$exports = {
176
- "ar-AE": $84925f526f90eebd$exports,
177
- "bg-BG": $c0650163dc1b6f9d$exports,
178
- "cs-CZ": $b2b55661291de587$exports,
179
- "da-DK": $deb83970956f6d5b$exports,
180
- "de-DE": $aea1cb4c7ec97e1c$exports,
181
- "el-GR": $3618d917e503a8d3$exports,
182
- "en-US": $9eb56bbbe8e31294$exports,
183
- "es-ES": $361c604b0fc269a3$exports,
184
- "et-EE": $2f00170f4ee3ca01$exports,
185
- "fi-FI": $80ee16b64fab9fb5$exports,
186
- "fr-FR": $be9d354476c08087$exports,
187
- "he-IL": $ffeb903ba092eb35$exports,
188
- "hr-HR": $1df6722c6f19728b$exports,
189
- "hu-HU": $093d57e325bc9071$exports,
190
- "it-IT": $609dbdfbcad85bdb$exports,
191
- "ja-JP": $c08e84f882644048$exports,
192
- "ko-KR": $5cd130489822fa21$exports,
193
- "lt-LT": $ab5183739b6c5e7e$exports,
194
- "lv-LV": $dd84a0b574be3f23$exports,
195
- "nb-NO": $85eee97d14eef7b5$exports,
196
- "nl-NL": $18781839f93b0314$exports,
197
- "pl-PL": $1c40ffbbfe9f3bda$exports,
198
- "pt-BR": $156880e329b1c717$exports,
199
- "pt-PT": $b6d50b1d20768ce4$exports,
200
- "ro-RO": $d8c38c691b006187$exports,
201
- "ru-RU": $ed9b4bf7ce1fb1d7$exports,
202
- "sk-SK": $51d8721afda4d678$exports,
203
- "sl-SI": $fd37a27baae493e8$exports,
204
- "sr-SP": $5505a1ca71ffd6f4$exports,
205
- "sv-SE": $33670e148c84ad02$exports,
206
- "tr-TR": $0bf46fdcdd7cb5f6$exports,
207
- "uk-UA": $9d9765222bc08ca2$exports,
208
- "zh-CN": $d737296cedcdee9f$exports,
209
- "zh-TW": $09cd168ab18773f4$exports
210
- };
211
-
212
-
213
-
214
-
215
-
216
- function $fc6126c82a4601f1$export$3f568fff7dff2f03(props, state, ref) {
217
- let { item: item } = props;
218
- let stringFormatter = (0, $aIvin$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($3bb15cc24d006ec5$exports))), "@react-aria/tag");
219
- let buttonId = (0, $aIvin$useId)();
220
- let { onRemove: onRemove } = (0, $d7323bca8d074eeb$export$653eddfc964b0f8a).get(state) || {};
221
- let { rowProps: rowProps, gridCellProps: gridCellProps, ...states } = (0, $aIvin$useGridListItem)({
222
- node: item
223
- }, state, ref);
224
- // We want the group to handle keyboard navigation between tags.
225
- delete rowProps.onKeyDownCapture;
226
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
227
- let { descriptionProps: _, ...stateWithoutDescription } = states;
228
- let onKeyDown = (e)=>{
229
- if (e.key === "Delete" || e.key === "Backspace") {
230
- e.preventDefault();
231
- if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set(state.selectionManager.selectedKeys));
232
- else onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set([
233
- item.key
234
- ]));
235
- }
236
- };
237
- let modality = (0, $aIvin$useInteractionModality)();
238
- if (modality === "virtual" && typeof window !== "undefined" && "ontouchstart" in window) modality = "pointer";
239
- let description = onRemove && (modality === "keyboard" || modality === "virtual") ? stringFormatter.format("removeDescription") : "";
240
- let descProps = (0, $aIvin$useDescription)(description);
241
- let isFocused = item.key === state.selectionManager.focusedKey;
242
- // @ts-ignore - data attributes are ok but TS doesn't know about them.
243
- let domProps = (0, $aIvin$filterDOMProps)(item.props);
244
- let linkProps = (0, $aIvin$getSyntheticLinkProps)(item.props);
245
- return {
246
- removeButtonProps: {
247
- "aria-label": stringFormatter.format("removeButtonLabel"),
248
- "aria-labelledby": `${buttonId} ${rowProps.id}`,
249
- id: buttonId,
250
- onPress: ()=>onRemove ? onRemove(new Set([
251
- item.key
252
- ])) : null,
253
- excludeFromTabOrder: true
254
- },
255
- rowProps: (0, $aIvin$mergeProps)(rowProps, domProps, linkProps, {
256
- tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,
257
- onKeyDown: onRemove ? onKeyDown : undefined,
258
- "aria-describedby": descProps["aria-describedby"]
259
- }),
260
- gridCellProps: (0, $aIvin$mergeProps)(gridCellProps, {
261
- "aria-errormessage": props["aria-errormessage"],
262
- "aria-label": props["aria-label"]
263
- }),
264
- ...stateWithoutDescription,
265
- allowsRemoving: !!onRemove
266
- };
267
- }
268
-
269
-
270
15
 
271
16
 
272
17
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;ACVD;;;;;;;;;;CAUC;;;;;;;AA4CM,MAAM,4CAAW,IAAI;AASrB,SAAS,0CAAe,KAA6B,EAAE,KAAmB,EAAE,GAA2B;IAC5G,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAC1B,IAAI,mBAAmB,MAAM,gBAAgB,IAAI,IAAI,CAAA,GAAA,2BAAmB,EAAE;QACxE,YAAY,MAAM,UAAU;aAC5B;QACA,aAAa;mBACb;QACA,cAAc,MAAM,YAAY;IAClC;IACA,IAAI,cAAC,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;QAC3E,GAAG,KAAK;QACR,kBAAkB;IACpB;IACA,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,kBAAU,EAAE;QAC5B,GAAG,KAAK;QACR,GAAG,UAAU;0BACb;QACA,iBAAiB;QACjB,cAAc;IAChB,GAAG,OAAO;IAEV,IAAI,CAAC,eAAe,eAAe,GAAG,CAAA,GAAA,eAAO,EAAE;IAC/C,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE;QACtC,qBAAqB;IACvB;IACA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;IAE9B,mDAAmD;IACnD,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE,MAAM,UAAU,CAAC,IAAI;IAC5C,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,IAAI,OAAO,IAAI,UAAU,OAAO,GAAG,KAAK,MAAM,UAAU,CAAC,IAAI,KAAK,KAAK,eACzE,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AQ,IAAI;YACzE,WAAW,WAAW,YAAY;YAClC,oBAAoB,SAAS,CAAC,mBAAmB;QACnD;QACA,eAAe,CAAA,GAAA,iBAAS,EAAE,eAAe;YACvC,qBAAqB,KAAK,CAAC,oBAAoB;YAC/C,cAAc,KAAK,CAAC,aAAa;QACnC;QACA,GAAG,uBAAuB;QAC1B,gBAAgB,CAAC,CAAC;IACpB;AACF;;CD/FC","sources":["packages/@react-aria/tag/src/index.ts","packages/@react-aria/tag/src/useTag.ts","packages/@react-aria/tag/src/useTagGroup.ts","packages/@react-aria/tag/src/*.js"],"sourcesContent":["/*\n * Copyright 2020 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\nexport {useTag} from './useTag';\nexport {useTagGroup} from './useTagGroup';\n\nexport type {TagGroupAria, AriaTagGroupProps} from './useTagGroup';\nexport type {AriaTagProps, TagAria} from './useTag';\n","/*\n * Copyright 2020 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 {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes, FocusableElement, Node} from '@react-types/shared';\nimport {filterDOMProps, getSyntheticLinkProps, mergeProps, useDescription, useId} from '@react-aria/utils';\nimport {hookData} from './useTagGroup';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {KeyboardEvent, RefObject} from 'react';\nimport type {ListState} from '@react-stately/list';\nimport {SelectableItemStates} from '@react-aria/selection';\nimport {useGridListItem} from '@react-aria/gridlist';\nimport {useInteractionModality} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\nexport interface TagAria extends Omit<SelectableItemStates, 'hasAction'> {\n /** Props for the tag row element. */\n rowProps: DOMAttributes,\n /** Props for the tag cell element. */\n gridCellProps: DOMAttributes,\n /** Props for the tag remove button. */\n removeButtonProps: AriaButtonProps,\n /** Whether the tag can be removed. */\n allowsRemoving: boolean\n}\n\nexport interface AriaTagProps<T> {\n /** An object representing the tag. Contains all the relevant information that makes up the tag. */\n item: Node<T>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a tag component.\n * @param props - Props to be applied to the tag.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag.\n */\nexport function useTag<T>(props: AriaTagProps<T>, state: ListState<T>, ref: RefObject<FocusableElement>): TagAria {\n let {item} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/tag');\n let buttonId = useId();\n\n let {onRemove} = hookData.get(state) || {};\n let {rowProps, gridCellProps, ...states} = useGridListItem({\n node: item\n }, state, ref);\n\n // We want the group to handle keyboard navigation between tags.\n delete rowProps.onKeyDownCapture;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {descriptionProps: _, ...stateWithoutDescription} = states;\n\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Delete' || e.key === 'Backspace') {\n e.preventDefault();\n if (state.selectionManager.isSelected(item.key)) {\n onRemove?.(new Set(state.selectionManager.selectedKeys));\n } else {\n onRemove?.(new Set([item.key]));\n }\n }\n };\n\n let modality = useInteractionModality();\n if (modality === 'virtual' && (typeof window !== 'undefined' && 'ontouchstart' in window)) {\n modality = 'pointer';\n }\n let description = onRemove && (modality === 'keyboard' || modality === 'virtual') ? stringFormatter.format('removeDescription') : '';\n let descProps = useDescription(description);\n\n let isFocused = item.key === state.selectionManager.focusedKey;\n // @ts-ignore - data attributes are ok but TS doesn't know about them.\n let domProps = filterDOMProps(item.props);\n let linkProps = getSyntheticLinkProps(item.props);\n return {\n removeButtonProps: {\n 'aria-label': stringFormatter.format('removeButtonLabel'),\n 'aria-labelledby': `${buttonId} ${rowProps.id}`,\n id: buttonId,\n onPress: () => onRemove ? onRemove(new Set([item.key])) : null,\n excludeFromTabOrder: true\n },\n rowProps: mergeProps(rowProps, domProps, linkProps, {\n tabIndex: (isFocused || state.selectionManager.focusedKey == null) ? 0 : -1,\n onKeyDown: onRemove ? onKeyDown : undefined,\n 'aria-describedby': descProps['aria-describedby']\n }),\n gridCellProps: mergeProps(gridCellProps, {\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-label': props['aria-label']\n }),\n ...stateWithoutDescription,\n allowsRemoving: !!onRemove\n };\n}\n","/*\n * Copyright 2020 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, CollectionBase, DOMAttributes, DOMProps, HelpTextProps, Key, KeyboardDelegate, LabelableProps, MultipleSelection, SelectionBehavior} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {ListKeyboardDelegate} from '@react-aria/selection';\nimport type {ListState} from '@react-stately/list';\nimport {ReactNode, RefObject, useEffect, useRef, useState} from 'react';\nimport {useField} from '@react-aria/label';\nimport {useFocusWithin} from '@react-aria/interactions';\nimport {useGridList} from '@react-aria/gridlist';\nimport {useLocale} from '@react-aria/i18n';\n\nexport interface TagGroupAria {\n /** Props for the tag grouping element. */\n gridProps: DOMAttributes,\n /** Props for the tag group's visible label (if any). */\n labelProps: DOMAttributes,\n /** Props for the tag group description element, if any. */\n descriptionProps: DOMAttributes,\n /** Props for the tag group error message element, if any. */\n errorMessageProps: DOMAttributes\n}\n\nexport interface AriaTagGroupProps<T> extends CollectionBase<T>, MultipleSelection, DOMProps, LabelableProps, AriaLabelingProps, Omit<HelpTextProps, 'errorMessage'> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** Handler that is called when a user deletes a tag. */\n onRemove?: (keys: Set<Key>) => void,\n /** An error message for the field. */\n errorMessage?: ReactNode\n}\n\nexport interface AriaTagGroupOptions<T> extends Omit<AriaTagGroupProps<T>, 'children'> {\n /**\n * An optional keyboard delegate to handle arrow key navigation,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate\n}\n\ninterface HookData {\n onRemove?: (keys: Set<Key>) => void\n}\n\nexport const hookData = new WeakMap<ListState<any>, HookData>();\n\n/**\n * Provides the behavior and accessibility implementation for a tag group component.\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 * @param props - Props to be applied to the tag group.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag group.\n */\nexport function useTagGroup<T>(props: AriaTagGroupOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement>): TagGroupAria {\n let {direction} = useLocale();\n let keyboardDelegate = props.keyboardDelegate || new ListKeyboardDelegate({\n collection: state.collection,\n ref,\n orientation: 'horizontal',\n direction,\n disabledKeys: state.disabledKeys\n });\n let {labelProps, fieldProps, descriptionProps, errorMessageProps} = useField({\n ...props,\n labelElementType: 'span'\n });\n let {gridProps} = useGridList({\n ...props,\n ...fieldProps,\n keyboardDelegate,\n shouldFocusWrap: true,\n linkBehavior: 'override'\n }, state, ref);\n\n let [isFocusWithin, setFocusWithin] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithinChange: setFocusWithin\n });\n let domProps = filterDOMProps(props);\n\n // If the last tag is removed, focus the container.\n let prevCount = useRef(state.collection.size);\n useEffect(() => {\n if (ref.current && prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) {\n ref.current.focus();\n }\n prevCount.current = state.collection.size;\n }, [state.collection.size, isFocusWithin, ref]);\n\n hookData.set(state, {onRemove: props.onRemove});\n\n return {\n gridProps: mergeProps(gridProps, domProps, {\n role: state.collection.size ? 'grid' : null,\n 'aria-atomic': false,\n 'aria-relevant': 'additions',\n 'aria-live': isFocusWithin ? 'polite' : 'off',\n ...focusWithinProps,\n ...fieldProps\n }),\n labelProps,\n descriptionProps,\n errorMessageProps\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/tag/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 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\nexport {useTag} from './useTag';\nexport {useTagGroup} from './useTagGroup';\n\nexport type {TagGroupAria, AriaTagGroupProps} from './useTagGroup';\nexport type {AriaTagProps, TagAria} from './useTag';\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/nb-NO.mjs CHANGED
@@ -6,4 +6,4 @@ $85eee97d14eef7b5$exports = {
6
6
 
7
7
 
8
8
  export {$85eee97d14eef7b5$exports as default};
9
- //# sourceMappingURL=nb-NO.module.js.map
9
+ //# sourceMappingURL=nb-NO.mjs.map
package/dist/nl-NL.mjs CHANGED
@@ -6,4 +6,4 @@ $18781839f93b0314$exports = {
6
6
 
7
7
 
8
8
  export {$18781839f93b0314$exports as default};
9
- //# sourceMappingURL=nl-NL.module.js.map
9
+ //# sourceMappingURL=nl-NL.mjs.map
package/dist/pl-PL.mjs CHANGED
@@ -6,4 +6,4 @@ $1c40ffbbfe9f3bda$exports = {
6
6
 
7
7
 
8
8
  export {$1c40ffbbfe9f3bda$exports as default};
9
- //# sourceMappingURL=pl-PL.module.js.map
9
+ //# sourceMappingURL=pl-PL.mjs.map
package/dist/pt-BR.mjs CHANGED
@@ -6,4 +6,4 @@ $156880e329b1c717$exports = {
6
6
 
7
7
 
8
8
  export {$156880e329b1c717$exports as default};
9
- //# sourceMappingURL=pt-BR.module.js.map
9
+ //# sourceMappingURL=pt-BR.mjs.map
package/dist/pt-PT.mjs CHANGED
@@ -6,4 +6,4 @@ $b6d50b1d20768ce4$exports = {
6
6
 
7
7
 
8
8
  export {$b6d50b1d20768ce4$exports as default};
9
- //# sourceMappingURL=pt-PT.module.js.map
9
+ //# sourceMappingURL=pt-PT.mjs.map
package/dist/ro-RO.mjs CHANGED
@@ -6,4 +6,4 @@ $d8c38c691b006187$exports = {
6
6
 
7
7
 
8
8
  export {$d8c38c691b006187$exports as default};
9
- //# sourceMappingURL=ro-RO.module.js.map
9
+ //# sourceMappingURL=ro-RO.mjs.map
package/dist/ru-RU.mjs CHANGED
@@ -6,4 +6,4 @@ $ed9b4bf7ce1fb1d7$exports = {
6
6
 
7
7
 
8
8
  export {$ed9b4bf7ce1fb1d7$exports as default};
9
- //# sourceMappingURL=ru-RU.module.js.map
9
+ //# sourceMappingURL=ru-RU.mjs.map
package/dist/sk-SK.mjs CHANGED
@@ -6,4 +6,4 @@ $51d8721afda4d678$exports = {
6
6
 
7
7
 
8
8
  export {$51d8721afda4d678$exports as default};
9
- //# sourceMappingURL=sk-SK.module.js.map
9
+ //# sourceMappingURL=sk-SK.mjs.map
package/dist/sl-SI.mjs CHANGED
@@ -6,4 +6,4 @@ $fd37a27baae493e8$exports = {
6
6
 
7
7
 
8
8
  export {$fd37a27baae493e8$exports as default};
9
- //# sourceMappingURL=sl-SI.module.js.map
9
+ //# sourceMappingURL=sl-SI.mjs.map
package/dist/sr-SP.mjs CHANGED
@@ -6,4 +6,4 @@ $5505a1ca71ffd6f4$exports = {
6
6
 
7
7
 
8
8
  export {$5505a1ca71ffd6f4$exports as default};
9
- //# sourceMappingURL=sr-SP.module.js.map
9
+ //# sourceMappingURL=sr-SP.mjs.map
package/dist/sv-SE.mjs CHANGED
@@ -6,4 +6,4 @@ $33670e148c84ad02$exports = {
6
6
 
7
7
 
8
8
  export {$33670e148c84ad02$exports as default};
9
- //# sourceMappingURL=sv-SE.module.js.map
9
+ //# sourceMappingURL=sv-SE.mjs.map
package/dist/tr-TR.mjs CHANGED
@@ -6,4 +6,4 @@ $0bf46fdcdd7cb5f6$exports = {
6
6
 
7
7
 
8
8
  export {$0bf46fdcdd7cb5f6$exports as default};
9
- //# sourceMappingURL=tr-TR.module.js.map
9
+ //# sourceMappingURL=tr-TR.mjs.map
@@ -1 +1 @@
1
- {"mappings":";;;;;AAsBA;IACE,0CAA0C;IAC1C,SAAS,EAAE,aAAa,CAAC;IACzB,wDAAwD;IACxD,UAAU,EAAE,a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AAG,EAAE,UAAU,gBAAgB,CAAC,GAAG,OAAO,CAyDhH","sources":["packages/@react-aria/tag/src/packages/@react-aria/tag/src/useTagGroup.ts","packages/@react-aria/tag/src/packages/@react-aria/tag/src/useTag.ts","packages/@react-aria/tag/src/packages/@react-aria/tag/src/index.ts","packages/@react-aria/tag/src/index.ts"],"sourcesContent":[null,null,null,"/*\n * Copyright 2020 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\nexport {useTag} from './useTag';\nexport {useTagGroup} from './useTagGroup';\n\nexport type {TagGroupAria, AriaTagGroupProps} from './useTagGroup';\nexport type {AriaTagProps, TagAria} from './useTag';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;;;AAsBA;IACE,0CAA0C;IAC1C,SAAS,EAAE,aAAa,CAAC;IACzB,wDAAwD;IACxD,UAAU,EAAE,aAAa,CAAC;IAC1B,2DAA2D;IAC3D,gBAAgB,EAAE,aAAa,CAAC;IAChC,6DAA6D;IAC7D,iBAAiB,EAAE,aAAa,CAAA;CACjC;AAED,mCAAmC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,EAAE,iBAAiB,EAAE,QAAQ,EAAE,cAAc,EAAE,iBAAiB,EAAE,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC;IAClK,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,yDAAyD;IACzD,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IACpC,sCAAsC;IACtC,YAAY,CAAC,EAAE,SAAS,CAAA;CACzB;AAED,8BAAqC,CAAC,CAAE,SAAQ,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,UAAU,CAAC;IACpF;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CACpC;AAQD;;;;;;GAMG;AACH,4BAA4B,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,WAAW,CAAC,GAAG,YAAY,CAoD5H;ACzFD,wBAAyB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,WAAW,CAAC;IACtE,qCAAqC;IACrC,QAAQ,EAAE,aAAa,CAAC;IACxB,sCAAsC;IACtC,aAAa,EAAE,aAAa,CAAC;IAC7B,uCAAuC;IACvC,iBAAiB,EAAE,eAAe,CAAC;IACnC,sCAAsC;IACtC,cAAc,EAAE,OAAO,CAAA;CACxB;AAED,8BAA8B,CAAC;IAC7B,mGAAmG;IACnG,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;CACd;AAED;;;;;GAKG;AACH,uBAAuB,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,gBAAgB,CAAC,GAAG,OAAO,CAyDhH","sources":["packages/@react-aria/tag/src/packages/@react-aria/tag/src/useTagGroup.ts","packages/@react-aria/tag/src/packages/@react-aria/tag/src/useTag.ts","packages/@react-aria/tag/src/packages/@react-aria/tag/src/index.ts","packages/@react-aria/tag/src/index.ts"],"sourcesContent":[null,null,null,"/*\n * Copyright 2020 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\nexport {useTag} from './useTag';\nexport {useTagGroup} from './useTagGroup';\n\nexport type {TagGroupAria, AriaTagGroupProps} from './useTagGroup';\nexport type {AriaTagProps, TagAria} from './useTag';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/dist/uk-UA.mjs CHANGED
@@ -6,4 +6,4 @@ $9d9765222bc08ca2$exports = {
6
6
 
7
7
 
8
8
  export {$9d9765222bc08ca2$exports as default};
9
- //# sourceMappingURL=uk-UA.module.js.map
9
+ //# sourceMappingURL=uk-UA.mjs.map
@@ -0,0 +1,88 @@
1
+ var $09704b0efefe5140$exports = require("./useTagGroup.main.js");
2
+ var $b6a2538ff098a9ff$exports = require("./intlStrings.main.js");
3
+ var $8p8DL$reactariautils = require("@react-aria/utils");
4
+ var $8p8DL$reactariagridlist = require("@react-aria/gridlist");
5
+ var $8p8DL$reactariainteractions = require("@react-aria/interactions");
6
+ var $8p8DL$reactariai18n = require("@react-aria/i18n");
7
+
8
+
9
+ function $parcel$interopDefault(a) {
10
+ return a && a.__esModule ? a.default : a;
11
+ }
12
+
13
+ function $parcel$export(e, n, v, s) {
14
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
15
+ }
16
+
17
+ $parcel$export(module.exports, "useTag", () => $a442534c81d8ad16$export$3f568fff7dff2f03);
18
+ /*
19
+ * Copyright 2020 Adobe. All rights reserved.
20
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
21
+ * you may not use this file except in compliance with the License. You may obtain a copy
22
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
23
+ *
24
+ * Unless required by applicable law or agreed to in writing, software distributed under
25
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
26
+ * OF ANY KIND, either express or implied. See the License for the specific language
27
+ * governing permissions and limitations under the License.
28
+ */
29
+
30
+
31
+
32
+
33
+
34
+ function $a442534c81d8ad16$export$3f568fff7dff2f03(props, state, ref) {
35
+ let { item: item } = props;
36
+ let stringFormatter = (0, $8p8DL$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($b6a2538ff098a9ff$exports))), "@react-aria/tag");
37
+ let buttonId = (0, $8p8DL$reactariautils.useId)();
38
+ let { onRemove: onRemove } = (0, $09704b0efefe5140$exports.hookData).get(state) || {};
39
+ let { rowProps: rowProps, gridCellProps: gridCellProps, ...states } = (0, $8p8DL$reactariagridlist.useGridListItem)({
40
+ node: item
41
+ }, state, ref);
42
+ // We want the group to handle keyboard navigation between tags.
43
+ delete rowProps.onKeyDownCapture;
44
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
45
+ let { descriptionProps: _, ...stateWithoutDescription } = states;
46
+ let onKeyDown = (e)=>{
47
+ if (e.key === "Delete" || e.key === "Backspace") {
48
+ e.preventDefault();
49
+ if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set(state.selectionManager.selectedKeys));
50
+ else onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set([
51
+ item.key
52
+ ]));
53
+ }
54
+ };
55
+ let modality = (0, $8p8DL$reactariainteractions.useInteractionModality)();
56
+ if (modality === "virtual" && typeof window !== "undefined" && "ontouchstart" in window) modality = "pointer";
57
+ let description = onRemove && (modality === "keyboard" || modality === "virtual") ? stringFormatter.format("removeDescription") : "";
58
+ let descProps = (0, $8p8DL$reactariautils.useDescription)(description);
59
+ let isFocused = item.key === state.selectionManager.focusedKey;
60
+ // @ts-ignore - data attributes are ok but TS doesn't know about them.
61
+ let domProps = (0, $8p8DL$reactariautils.filterDOMProps)(item.props);
62
+ let linkProps = (0, $8p8DL$reactariautils.getSyntheticLinkProps)(item.props);
63
+ return {
64
+ removeButtonProps: {
65
+ "aria-label": stringFormatter.format("removeButtonLabel"),
66
+ "aria-labelledby": `${buttonId} ${rowProps.id}`,
67
+ id: buttonId,
68
+ onPress: ()=>onRemove ? onRemove(new Set([
69
+ item.key
70
+ ])) : null,
71
+ excludeFromTabOrder: true
72
+ },
73
+ rowProps: (0, $8p8DL$reactariautils.mergeProps)(rowProps, domProps, linkProps, {
74
+ tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,
75
+ onKeyDown: onRemove ? onKeyDown : undefined,
76
+ "aria-describedby": descProps["aria-describedby"]
77
+ }),
78
+ gridCellProps: (0, $8p8DL$reactariautils.mergeProps)(gridCellProps, {
79
+ "aria-errormessage": props["aria-errormessage"],
80
+ "aria-label": props["aria-label"]
81
+ }),
82
+ ...stateWithoutDescription,
83
+ allowsRemoving: !!onRemove
84
+ };
85
+ }
86
+
87
+
88
+ //# sourceMappingURL=useTag.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAsCM,SAAS,0CAAU,KAAsB,EAAE,KAAmB,EAAE,GAAgC;IACrG,IAAI,QAAC,IAAI,EAAC,GAAG;IACb,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,WAAW,CAAA,GAAA,2BAAI;IAEnB,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,kCAAO,EAAE,GAAG,CAAC,UAAU,CAAC;IACzC,IAAI,YAAC,QAAQ,iBAAE,aAAa,EAAE,GAAG,QAAO,GAAG,CAAA,GAAA,wCAAc,EAAE;QACzD,MAAM;IACR,GAAG,OAAO;IAEV,gEAAgE;IAChE,OAAO,SAAS,gBAAgB;IAChC,6DAA6D;IAC7D,IAAI,EAAC,kBAAkB,CAAC,EAAE,GAAG,yBAAwB,GAAG;IAExD,IAAI,YAAY,CAAC;QACf,IAAI,EAAE,GAAG,KAAK,YAAY,EAAE,GAAG,KAAK,aAAa;YAC/C,EAAE,cAAc;YAChB,IAAI,MAAM,gBAAgB,CAAC,UAAU,CAAC,KAAK,GAAG,GAC5C,qBAAA,+BAAA,SAAW,IAAI,IAAI,MAAM,gBAAgB,CAAC,YAAY;iBAEtD,qBAAA,+BAAA,SAAW,IAAI,IAAI;gBAAC,KAAK,GAAG;aAAC;QAEjC;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,mDAAqB;IACpC,IAAI,aAAa,aAAe,OAAO,WAAW,eAAe,kBAAkB,QACjF,WAAW;IAEb,IAAI,cAAc,YAAa,CAAA,aAAa,cAAc,aAAa,SAAQ,IAAK,gBAAgB,MAAM,CAAC,uBAAuB;IAClI,IAAI,YAAY,CAAA,GAAA,oCAAa,EAAE;IAE/B,IAAI,YAAY,KAAK,GAAG,KAAK,MAAM,gBAAgB,CAAC,UAAU;IAC9D,sEAAsE;IACtE,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,KAAK,KAAK;IACxC,IAAI,YAAY,CAAA,GAAA,2CAAoB,EAAE,KAAK,KAAK;IAChD,OAAO;QACL,mBAAmB;YACjB,cAAc,gBAAgB,MAAM,CAAC;YACrC,mBAAmB,CAAC,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;YAC/C,IAAI;YACJ,SAAS,IAAM,WAAW,SAAS,IAAI,IAAI;oBAAC,KAAK,GAAG;iBAAC,KAAK;YAC1D,qBAAqB;QACvB;QACA,UAAU,CAAA,GAAA,gCAAS,EAAE,UAAU,UAAU,WAAW;YAClD,UAAU,AAAC,aAAa,MAAM,gBAAgB,CAAC,UAAU,IAAI,OAAQ,IAAI;YACzE,WAAW,WAAW,YAAY;YAClC,oBAAoB,SAAS,CAAC,mBAAmB;QACnD;QACA,eAAe,CAAA,GAAA,gCAAS,EAAE,eAAe;YACvC,qBAAqB,KAAK,CAAC,oBAAoB;YAC/C,cAAc,KAAK,CAAC,aAAa;QACnC;QACA,GAAG,uBAAuB;QAC1B,gBAAgB,CAAC,CAAC;IACpB;AACF","sources":["packages/@react-aria/tag/src/useTag.ts"],"sourcesContent":["/*\n * Copyright 2020 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 {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes, FocusableElement, Node} from '@react-types/shared';\nimport {filterDOMProps, getSyntheticLinkProps, mergeProps, useDescription, useId} from '@react-aria/utils';\nimport {hookData} from './useTagGroup';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {KeyboardEvent, RefObject} from 'react';\nimport type {ListState} from '@react-stately/list';\nimport {SelectableItemStates} from '@react-aria/selection';\nimport {useGridListItem} from '@react-aria/gridlist';\nimport {useInteractionModality} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\nexport interface TagAria extends Omit<SelectableItemStates, 'hasAction'> {\n /** Props for the tag row element. */\n rowProps: DOMAttributes,\n /** Props for the tag cell element. */\n gridCellProps: DOMAttributes,\n /** Props for the tag remove button. */\n removeButtonProps: AriaButtonProps,\n /** Whether the tag can be removed. */\n allowsRemoving: boolean\n}\n\nexport interface AriaTagProps<T> {\n /** An object representing the tag. Contains all the relevant information that makes up the tag. */\n item: Node<T>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a tag component.\n * @param props - Props to be applied to the tag.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag.\n */\nexport function useTag<T>(props: AriaTagProps<T>, state: ListState<T>, ref: RefObject<FocusableElement>): TagAria {\n let {item} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/tag');\n let buttonId = useId();\n\n let {onRemove} = hookData.get(state) || {};\n let {rowProps, gridCellProps, ...states} = useGridListItem({\n node: item\n }, state, ref);\n\n // We want the group to handle keyboard navigation between tags.\n delete rowProps.onKeyDownCapture;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {descriptionProps: _, ...stateWithoutDescription} = states;\n\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Delete' || e.key === 'Backspace') {\n e.preventDefault();\n if (state.selectionManager.isSelected(item.key)) {\n onRemove?.(new Set(state.selectionManager.selectedKeys));\n } else {\n onRemove?.(new Set([item.key]));\n }\n }\n };\n\n let modality = useInteractionModality();\n if (modality === 'virtual' && (typeof window !== 'undefined' && 'ontouchstart' in window)) {\n modality = 'pointer';\n }\n let description = onRemove && (modality === 'keyboard' || modality === 'virtual') ? stringFormatter.format('removeDescription') : '';\n let descProps = useDescription(description);\n\n let isFocused = item.key === state.selectionManager.focusedKey;\n // @ts-ignore - data attributes are ok but TS doesn't know about them.\n let domProps = filterDOMProps(item.props);\n let linkProps = getSyntheticLinkProps(item.props);\n return {\n removeButtonProps: {\n 'aria-label': stringFormatter.format('removeButtonLabel'),\n 'aria-labelledby': `${buttonId} ${rowProps.id}`,\n id: buttonId,\n onPress: () => onRemove ? onRemove(new Set([item.key])) : null,\n excludeFromTabOrder: true\n },\n rowProps: mergeProps(rowProps, domProps, linkProps, {\n tabIndex: (isFocused || state.selectionManager.focusedKey == null) ? 0 : -1,\n onKeyDown: onRemove ? onKeyDown : undefined,\n 'aria-describedby': descProps['aria-describedby']\n }),\n gridCellProps: mergeProps(gridCellProps, {\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-label': props['aria-label']\n }),\n ...stateWithoutDescription,\n allowsRemoving: !!onRemove\n };\n}\n"],"names":[],"version":3,"file":"useTag.main.js.map"}
@@ -0,0 +1,83 @@
1
+ import {hookData as $d7323bca8d074eeb$export$653eddfc964b0f8a} from "./useTagGroup.mjs";
2
+ import $ioKwR$intlStringsmodulejs from "./intlStrings.mjs";
3
+ import {useId as $ioKwR$useId, useDescription as $ioKwR$useDescription, filterDOMProps as $ioKwR$filterDOMProps, getSyntheticLinkProps as $ioKwR$getSyntheticLinkProps, mergeProps as $ioKwR$mergeProps} from "@react-aria/utils";
4
+ import {useGridListItem as $ioKwR$useGridListItem} from "@react-aria/gridlist";
5
+ import {useInteractionModality as $ioKwR$useInteractionModality} from "@react-aria/interactions";
6
+ import {useLocalizedStringFormatter as $ioKwR$useLocalizedStringFormatter} from "@react-aria/i18n";
7
+
8
+
9
+ function $parcel$interopDefault(a) {
10
+ return a && a.__esModule ? a.default : a;
11
+ }
12
+ /*
13
+ * Copyright 2020 Adobe. All rights reserved.
14
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License. You may obtain a copy
16
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software distributed under
19
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
+ * OF ANY KIND, either express or implied. See the License for the specific language
21
+ * governing permissions and limitations under the License.
22
+ */
23
+
24
+
25
+
26
+
27
+
28
+ function $fc6126c82a4601f1$export$3f568fff7dff2f03(props, state, ref) {
29
+ let { item: item } = props;
30
+ let stringFormatter = (0, $ioKwR$useLocalizedStringFormatter)((0, ($parcel$interopDefault($ioKwR$intlStringsmodulejs))), "@react-aria/tag");
31
+ let buttonId = (0, $ioKwR$useId)();
32
+ let { onRemove: onRemove } = (0, $d7323bca8d074eeb$export$653eddfc964b0f8a).get(state) || {};
33
+ let { rowProps: rowProps, gridCellProps: gridCellProps, ...states } = (0, $ioKwR$useGridListItem)({
34
+ node: item
35
+ }, state, ref);
36
+ // We want the group to handle keyboard navigation between tags.
37
+ delete rowProps.onKeyDownCapture;
38
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
39
+ let { descriptionProps: _, ...stateWithoutDescription } = states;
40
+ let onKeyDown = (e)=>{
41
+ if (e.key === "Delete" || e.key === "Backspace") {
42
+ e.preventDefault();
43
+ if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set(state.selectionManager.selectedKeys));
44
+ else onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set([
45
+ item.key
46
+ ]));
47
+ }
48
+ };
49
+ let modality = (0, $ioKwR$useInteractionModality)();
50
+ if (modality === "virtual" && typeof window !== "undefined" && "ontouchstart" in window) modality = "pointer";
51
+ let description = onRemove && (modality === "keyboard" || modality === "virtual") ? stringFormatter.format("removeDescription") : "";
52
+ let descProps = (0, $ioKwR$useDescription)(description);
53
+ let isFocused = item.key === state.selectionManager.focusedKey;
54
+ // @ts-ignore - data attributes are ok but TS doesn't know about them.
55
+ let domProps = (0, $ioKwR$filterDOMProps)(item.props);
56
+ let linkProps = (0, $ioKwR$getSyntheticLinkProps)(item.props);
57
+ return {
58
+ removeButtonProps: {
59
+ "aria-label": stringFormatter.format("removeButtonLabel"),
60
+ "aria-labelledby": `${buttonId} ${rowProps.id}`,
61
+ id: buttonId,
62
+ onPress: ()=>onRemove ? onRemove(new Set([
63
+ item.key
64
+ ])) : null,
65
+ excludeFromTabOrder: true
66
+ },
67
+ rowProps: (0, $ioKwR$mergeProps)(rowProps, domProps, linkProps, {
68
+ tabIndex: isFocused || state.selectionManager.focusedKey == null ? 0 : -1,
69
+ onKeyDown: onRemove ? onKeyDown : undefined,
70
+ "aria-describedby": descProps["aria-describedby"]
71
+ }),
72
+ gridCellProps: (0, $ioKwR$mergeProps)(gridCellProps, {
73
+ "aria-errormessage": props["aria-errormessage"],
74
+ "aria-label": props["aria-label"]
75
+ }),
76
+ ...stateWithoutDescription,
77
+ allowsRemoving: !!onRemove
78
+ };
79
+ }
80
+
81
+
82
+ export {$fc6126c82a4601f1$export$3f568fff7dff2f03 as useTag};
83
+ //# sourceMappingURL=useTag.mjs.map