@react-aria/tag 3.8.0 → 3.9.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 (197) hide show
  1. package/dist/import.mjs +2 -4
  2. package/dist/main.js +3 -5
  3. package/dist/main.js.map +1 -1
  4. package/dist/module.js +2 -4
  5. package/dist/module.js.map +1 -1
  6. package/dist/types/src/index.d.ts +2 -0
  7. package/package.json +15 -20
  8. package/src/index.ts +2 -4
  9. package/dist/ar-AE.main.js +0 -7
  10. package/dist/ar-AE.main.js.map +0 -1
  11. package/dist/ar-AE.mjs +0 -9
  12. package/dist/ar-AE.module.js +0 -9
  13. package/dist/ar-AE.module.js.map +0 -1
  14. package/dist/bg-BG.main.js +0 -7
  15. package/dist/bg-BG.main.js.map +0 -1
  16. package/dist/bg-BG.mjs +0 -9
  17. package/dist/bg-BG.module.js +0 -9
  18. package/dist/bg-BG.module.js.map +0 -1
  19. package/dist/cs-CZ.main.js +0 -7
  20. package/dist/cs-CZ.main.js.map +0 -1
  21. package/dist/cs-CZ.mjs +0 -9
  22. package/dist/cs-CZ.module.js +0 -9
  23. package/dist/cs-CZ.module.js.map +0 -1
  24. package/dist/da-DK.main.js +0 -7
  25. package/dist/da-DK.main.js.map +0 -1
  26. package/dist/da-DK.mjs +0 -9
  27. package/dist/da-DK.module.js +0 -9
  28. package/dist/da-DK.module.js.map +0 -1
  29. package/dist/de-DE.main.js +0 -7
  30. package/dist/de-DE.main.js.map +0 -1
  31. package/dist/de-DE.mjs +0 -9
  32. package/dist/de-DE.module.js +0 -9
  33. package/dist/de-DE.module.js.map +0 -1
  34. package/dist/el-GR.main.js +0 -7
  35. package/dist/el-GR.main.js.map +0 -1
  36. package/dist/el-GR.mjs +0 -9
  37. package/dist/el-GR.module.js +0 -9
  38. package/dist/el-GR.module.js.map +0 -1
  39. package/dist/en-US.main.js +0 -7
  40. package/dist/en-US.main.js.map +0 -1
  41. package/dist/en-US.mjs +0 -9
  42. package/dist/en-US.module.js +0 -9
  43. package/dist/en-US.module.js.map +0 -1
  44. package/dist/es-ES.main.js +0 -7
  45. package/dist/es-ES.main.js.map +0 -1
  46. package/dist/es-ES.mjs +0 -9
  47. package/dist/es-ES.module.js +0 -9
  48. package/dist/es-ES.module.js.map +0 -1
  49. package/dist/et-EE.main.js +0 -7
  50. package/dist/et-EE.main.js.map +0 -1
  51. package/dist/et-EE.mjs +0 -9
  52. package/dist/et-EE.module.js +0 -9
  53. package/dist/et-EE.module.js.map +0 -1
  54. package/dist/fi-FI.main.js +0 -7
  55. package/dist/fi-FI.main.js.map +0 -1
  56. package/dist/fi-FI.mjs +0 -9
  57. package/dist/fi-FI.module.js +0 -9
  58. package/dist/fi-FI.module.js.map +0 -1
  59. package/dist/fr-FR.main.js +0 -7
  60. package/dist/fr-FR.main.js.map +0 -1
  61. package/dist/fr-FR.mjs +0 -9
  62. package/dist/fr-FR.module.js +0 -9
  63. package/dist/fr-FR.module.js.map +0 -1
  64. package/dist/he-IL.main.js +0 -7
  65. package/dist/he-IL.main.js.map +0 -1
  66. package/dist/he-IL.mjs +0 -9
  67. package/dist/he-IL.module.js +0 -9
  68. package/dist/he-IL.module.js.map +0 -1
  69. package/dist/hr-HR.main.js +0 -7
  70. package/dist/hr-HR.main.js.map +0 -1
  71. package/dist/hr-HR.mjs +0 -9
  72. package/dist/hr-HR.module.js +0 -9
  73. package/dist/hr-HR.module.js.map +0 -1
  74. package/dist/hu-HU.main.js +0 -7
  75. package/dist/hu-HU.main.js.map +0 -1
  76. package/dist/hu-HU.mjs +0 -9
  77. package/dist/hu-HU.module.js +0 -9
  78. package/dist/hu-HU.module.js.map +0 -1
  79. package/dist/intlStrings.main.js +0 -108
  80. package/dist/intlStrings.main.js.map +0 -1
  81. package/dist/intlStrings.mjs +0 -110
  82. package/dist/intlStrings.module.js +0 -110
  83. package/dist/intlStrings.module.js.map +0 -1
  84. package/dist/it-IT.main.js +0 -7
  85. package/dist/it-IT.main.js.map +0 -1
  86. package/dist/it-IT.mjs +0 -9
  87. package/dist/it-IT.module.js +0 -9
  88. package/dist/it-IT.module.js.map +0 -1
  89. package/dist/ja-JP.main.js +0 -7
  90. package/dist/ja-JP.main.js.map +0 -1
  91. package/dist/ja-JP.mjs +0 -9
  92. package/dist/ja-JP.module.js +0 -9
  93. package/dist/ja-JP.module.js.map +0 -1
  94. package/dist/ko-KR.main.js +0 -7
  95. package/dist/ko-KR.main.js.map +0 -1
  96. package/dist/ko-KR.mjs +0 -9
  97. package/dist/ko-KR.module.js +0 -9
  98. package/dist/ko-KR.module.js.map +0 -1
  99. package/dist/lt-LT.main.js +0 -7
  100. package/dist/lt-LT.main.js.map +0 -1
  101. package/dist/lt-LT.mjs +0 -9
  102. package/dist/lt-LT.module.js +0 -9
  103. package/dist/lt-LT.module.js.map +0 -1
  104. package/dist/lv-LV.main.js +0 -7
  105. package/dist/lv-LV.main.js.map +0 -1
  106. package/dist/lv-LV.mjs +0 -9
  107. package/dist/lv-LV.module.js +0 -9
  108. package/dist/lv-LV.module.js.map +0 -1
  109. package/dist/nb-NO.main.js +0 -7
  110. package/dist/nb-NO.main.js.map +0 -1
  111. package/dist/nb-NO.mjs +0 -9
  112. package/dist/nb-NO.module.js +0 -9
  113. package/dist/nb-NO.module.js.map +0 -1
  114. package/dist/nl-NL.main.js +0 -7
  115. package/dist/nl-NL.main.js.map +0 -1
  116. package/dist/nl-NL.mjs +0 -9
  117. package/dist/nl-NL.module.js +0 -9
  118. package/dist/nl-NL.module.js.map +0 -1
  119. package/dist/pl-PL.main.js +0 -7
  120. package/dist/pl-PL.main.js.map +0 -1
  121. package/dist/pl-PL.mjs +0 -9
  122. package/dist/pl-PL.module.js +0 -9
  123. package/dist/pl-PL.module.js.map +0 -1
  124. package/dist/pt-BR.main.js +0 -7
  125. package/dist/pt-BR.main.js.map +0 -1
  126. package/dist/pt-BR.mjs +0 -9
  127. package/dist/pt-BR.module.js +0 -9
  128. package/dist/pt-BR.module.js.map +0 -1
  129. package/dist/pt-PT.main.js +0 -7
  130. package/dist/pt-PT.main.js.map +0 -1
  131. package/dist/pt-PT.mjs +0 -9
  132. package/dist/pt-PT.module.js +0 -9
  133. package/dist/pt-PT.module.js.map +0 -1
  134. package/dist/ro-RO.main.js +0 -7
  135. package/dist/ro-RO.main.js.map +0 -1
  136. package/dist/ro-RO.mjs +0 -9
  137. package/dist/ro-RO.module.js +0 -9
  138. package/dist/ro-RO.module.js.map +0 -1
  139. package/dist/ru-RU.main.js +0 -7
  140. package/dist/ru-RU.main.js.map +0 -1
  141. package/dist/ru-RU.mjs +0 -9
  142. package/dist/ru-RU.module.js +0 -9
  143. package/dist/ru-RU.module.js.map +0 -1
  144. package/dist/sk-SK.main.js +0 -7
  145. package/dist/sk-SK.main.js.map +0 -1
  146. package/dist/sk-SK.mjs +0 -9
  147. package/dist/sk-SK.module.js +0 -9
  148. package/dist/sk-SK.module.js.map +0 -1
  149. package/dist/sl-SI.main.js +0 -7
  150. package/dist/sl-SI.main.js.map +0 -1
  151. package/dist/sl-SI.mjs +0 -9
  152. package/dist/sl-SI.module.js +0 -9
  153. package/dist/sl-SI.module.js.map +0 -1
  154. package/dist/sr-SP.main.js +0 -7
  155. package/dist/sr-SP.main.js.map +0 -1
  156. package/dist/sr-SP.mjs +0 -9
  157. package/dist/sr-SP.module.js +0 -9
  158. package/dist/sr-SP.module.js.map +0 -1
  159. package/dist/sv-SE.main.js +0 -7
  160. package/dist/sv-SE.main.js.map +0 -1
  161. package/dist/sv-SE.mjs +0 -9
  162. package/dist/sv-SE.module.js +0 -9
  163. package/dist/sv-SE.module.js.map +0 -1
  164. package/dist/tr-TR.main.js +0 -7
  165. package/dist/tr-TR.main.js.map +0 -1
  166. package/dist/tr-TR.mjs +0 -9
  167. package/dist/tr-TR.module.js +0 -9
  168. package/dist/tr-TR.module.js.map +0 -1
  169. package/dist/types.d.ts +0 -73
  170. package/dist/types.d.ts.map +0 -1
  171. package/dist/uk-UA.main.js +0 -7
  172. package/dist/uk-UA.main.js.map +0 -1
  173. package/dist/uk-UA.mjs +0 -9
  174. package/dist/uk-UA.module.js +0 -9
  175. package/dist/uk-UA.module.js.map +0 -1
  176. package/dist/useTag.main.js +0 -94
  177. package/dist/useTag.main.js.map +0 -1
  178. package/dist/useTag.mjs +0 -89
  179. package/dist/useTag.module.js +0 -89
  180. package/dist/useTag.module.js.map +0 -1
  181. package/dist/useTagGroup.main.js +0 -90
  182. package/dist/useTagGroup.main.js.map +0 -1
  183. package/dist/useTagGroup.mjs +0 -84
  184. package/dist/useTagGroup.module.js +0 -84
  185. package/dist/useTagGroup.module.js.map +0 -1
  186. package/dist/zh-CN.main.js +0 -7
  187. package/dist/zh-CN.main.js.map +0 -1
  188. package/dist/zh-CN.mjs +0 -9
  189. package/dist/zh-CN.module.js +0 -9
  190. package/dist/zh-CN.module.js.map +0 -1
  191. package/dist/zh-TW.main.js +0 -7
  192. package/dist/zh-TW.main.js.map +0 -1
  193. package/dist/zh-TW.mjs +0 -9
  194. package/dist/zh-TW.module.js +0 -9
  195. package/dist/zh-TW.module.js.map +0 -1
  196. package/src/useTag.ts +0 -119
  197. package/src/useTagGroup.ts +0 -128
@@ -1,94 +0,0 @@
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$reactariainteractions = require("@react-aria/interactions");
5
- var $8p8DL$reactariagridlist = require("@react-aria/gridlist");
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
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
43
- let { descriptionProps: _, ...stateWithoutDescription } = states;
44
- let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled;
45
- let onKeyDown = (e)=>{
46
- if (e.key === 'Delete' || e.key === 'Backspace') {
47
- if (isDisabled) return;
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 isItemFocused = item.key === state.selectionManager.focusedKey;
60
- let isFocused = state.selectionManager.focusedKey != null;
61
- let tabIndex = -1;
62
- if (!isDisabled && (isItemFocused || !isFocused)) tabIndex = 0;
63
- let domProps = (0, $8p8DL$reactariautils.filterDOMProps)(item.props);
64
- let linkProps = (0, $8p8DL$reactariautils.useSyntheticLinkProps)(item.props);
65
- let { focusableProps: focusableProps } = (0, $8p8DL$reactariainteractions.useFocusable)({
66
- ...item.props,
67
- isDisabled: isDisabled
68
- }, ref);
69
- return {
70
- removeButtonProps: {
71
- 'aria-label': stringFormatter.format('removeButtonLabel'),
72
- 'aria-labelledby': `${buttonId} ${rowProps.id}`,
73
- isDisabled: isDisabled,
74
- id: buttonId,
75
- onPress: ()=>onRemove ? onRemove(new Set([
76
- item.key
77
- ])) : null
78
- },
79
- rowProps: (0, $8p8DL$reactariautils.mergeProps)(focusableProps, rowProps, domProps, linkProps, {
80
- tabIndex: tabIndex,
81
- onKeyDown: onRemove ? onKeyDown : undefined,
82
- 'aria-describedby': descProps['aria-describedby']
83
- }),
84
- gridCellProps: (0, $8p8DL$reactariautils.mergeProps)(gridCellProps, {
85
- 'aria-errormessage': props['aria-errormessage'],
86
- 'aria-label': props['aria-label']
87
- }),
88
- ...stateWithoutDescription,
89
- allowsRemoving: !!onRemove
90
- };
91
- }
92
-
93
-
94
- //# sourceMappingURL=useTag.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAsCM,SAAS,0CAAU,KAAsB,EAAE,KAAmB,EAAE,GAAuC;IAC5G,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,6DAA6D;IAC7D,IAAI,EAAC,kBAAkB,CAAC,EAAE,GAAG,yBAAwB,GAAG;IAExD,IAAI,aAAa,MAAM,YAAY,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,KAAK,KAAK,CAAC,UAAU;IAC1E,IAAI,YAAY,CAAC;QACf,IAAI,EAAE,GAAG,KAAK,YAAY,EAAE,GAAG,KAAK,aAAa;YAC/C,IAAI,YACF;YAGF,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,gBAAgB,KAAK,GAAG,KAAK,MAAM,gBAAgB,CAAC,UAAU;IAClE,IAAI,YAAY,MAAM,gBAAgB,CAAC,UAAU,IAAI;IACrD,IAAI,WAAW;IACf,IAAI,CAAC,cAAe,CAAA,iBAAiB,CAAC,SAAQ,GAC5C,WAAW;IAGb,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,KAAK,KAAK;IACxC,IAAI,YAAY,CAAA,GAAA,2CAAoB,EAAE,KAAK,KAAK;IAChD,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW,EAAE;QAClC,GAAG,KAAK,KAAK;oBACb;IACF,GAAG;IAEH,OAAO;QACL,mBAAmB;YACjB,cAAc,gBAAgB,MAAM,CAAC;YACrC,mBAAmB,GAAG,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;wBAC/C;YACA,IAAI;YACJ,SAAS,IAAM,WAAW,SAAS,IAAI,IAAI;oBAAC,KAAK,GAAG;iBAAC,KAAK;QAC5D;QACA,UAAU,CAAA,GAAA,gCAAS,EAAE,gBAAgB,UAAU,UAAU,WAAW;sBAClE;YACA,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, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useDescription, useId, useSyntheticLinkProps} from '@react-aria/utils';\nimport {hookData} from './useTagGroup';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {KeyboardEvent} from 'react';\nimport type {ListState} from '@react-stately/list';\nimport {SelectableItemStates} from '@react-aria/selection';\nimport {useFocusable, useInteractionModality} from '@react-aria/interactions';\nimport {useGridListItem} from '@react-aria/gridlist';\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 | null>): 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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {descriptionProps: _, ...stateWithoutDescription} = states;\n\n let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled;\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Delete' || e.key === 'Backspace') {\n if (isDisabled) {\n return;\n }\n\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 isItemFocused = item.key === state.selectionManager.focusedKey;\n let isFocused = state.selectionManager.focusedKey != null;\n let tabIndex = -1;\n if (!isDisabled && (isItemFocused || !isFocused)) {\n tabIndex = 0;\n }\n\n let domProps = filterDOMProps(item.props);\n let linkProps = useSyntheticLinkProps(item.props);\n let {focusableProps} = useFocusable({\n ...item.props,\n isDisabled\n }, ref);\n\n return {\n removeButtonProps: {\n 'aria-label': stringFormatter.format('removeButtonLabel'),\n 'aria-labelledby': `${buttonId} ${rowProps.id}`,\n isDisabled,\n id: buttonId,\n onPress: () => onRemove ? onRemove(new Set([item.key])) : null\n },\n rowProps: mergeProps(focusableProps, rowProps, domProps, linkProps, {\n tabIndex,\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"}
package/dist/useTag.mjs DELETED
@@ -1,89 +0,0 @@
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, useSyntheticLinkProps as $ioKwR$useSyntheticLinkProps, mergeProps as $ioKwR$mergeProps} from "@react-aria/utils";
4
- import {useInteractionModality as $ioKwR$useInteractionModality, useFocusable as $ioKwR$useFocusable} from "@react-aria/interactions";
5
- import {useGridListItem as $ioKwR$useGridListItem} from "@react-aria/gridlist";
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
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
37
- let { descriptionProps: _, ...stateWithoutDescription } = states;
38
- let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled;
39
- let onKeyDown = (e)=>{
40
- if (e.key === 'Delete' || e.key === 'Backspace') {
41
- if (isDisabled) return;
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 isItemFocused = item.key === state.selectionManager.focusedKey;
54
- let isFocused = state.selectionManager.focusedKey != null;
55
- let tabIndex = -1;
56
- if (!isDisabled && (isItemFocused || !isFocused)) tabIndex = 0;
57
- let domProps = (0, $ioKwR$filterDOMProps)(item.props);
58
- let linkProps = (0, $ioKwR$useSyntheticLinkProps)(item.props);
59
- let { focusableProps: focusableProps } = (0, $ioKwR$useFocusable)({
60
- ...item.props,
61
- isDisabled: isDisabled
62
- }, ref);
63
- return {
64
- removeButtonProps: {
65
- 'aria-label': stringFormatter.format('removeButtonLabel'),
66
- 'aria-labelledby': `${buttonId} ${rowProps.id}`,
67
- isDisabled: isDisabled,
68
- id: buttonId,
69
- onPress: ()=>onRemove ? onRemove(new Set([
70
- item.key
71
- ])) : null
72
- },
73
- rowProps: (0, $ioKwR$mergeProps)(focusableProps, rowProps, domProps, linkProps, {
74
- tabIndex: tabIndex,
75
- onKeyDown: onRemove ? onKeyDown : undefined,
76
- 'aria-describedby': descProps['aria-describedby']
77
- }),
78
- gridCellProps: (0, $ioKwR$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
- export {$fc6126c82a4601f1$export$3f568fff7dff2f03 as useTag};
89
- //# sourceMappingURL=useTag.module.js.map
@@ -1,89 +0,0 @@
1
- import {hookData as $d7323bca8d074eeb$export$653eddfc964b0f8a} from "./useTagGroup.module.js";
2
- import $ioKwR$intlStringsmodulejs from "./intlStrings.module.js";
3
- import {useId as $ioKwR$useId, useDescription as $ioKwR$useDescription, filterDOMProps as $ioKwR$filterDOMProps, useSyntheticLinkProps as $ioKwR$useSyntheticLinkProps, mergeProps as $ioKwR$mergeProps} from "@react-aria/utils";
4
- import {useInteractionModality as $ioKwR$useInteractionModality, useFocusable as $ioKwR$useFocusable} from "@react-aria/interactions";
5
- import {useGridListItem as $ioKwR$useGridListItem} from "@react-aria/gridlist";
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
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
37
- let { descriptionProps: _, ...stateWithoutDescription } = states;
38
- let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled;
39
- let onKeyDown = (e)=>{
40
- if (e.key === 'Delete' || e.key === 'Backspace') {
41
- if (isDisabled) return;
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 isItemFocused = item.key === state.selectionManager.focusedKey;
54
- let isFocused = state.selectionManager.focusedKey != null;
55
- let tabIndex = -1;
56
- if (!isDisabled && (isItemFocused || !isFocused)) tabIndex = 0;
57
- let domProps = (0, $ioKwR$filterDOMProps)(item.props);
58
- let linkProps = (0, $ioKwR$useSyntheticLinkProps)(item.props);
59
- let { focusableProps: focusableProps } = (0, $ioKwR$useFocusable)({
60
- ...item.props,
61
- isDisabled: isDisabled
62
- }, ref);
63
- return {
64
- removeButtonProps: {
65
- 'aria-label': stringFormatter.format('removeButtonLabel'),
66
- 'aria-labelledby': `${buttonId} ${rowProps.id}`,
67
- isDisabled: isDisabled,
68
- id: buttonId,
69
- onPress: ()=>onRemove ? onRemove(new Set([
70
- item.key
71
- ])) : null
72
- },
73
- rowProps: (0, $ioKwR$mergeProps)(focusableProps, rowProps, domProps, linkProps, {
74
- tabIndex: tabIndex,
75
- onKeyDown: onRemove ? onKeyDown : undefined,
76
- 'aria-describedby': descProps['aria-describedby']
77
- }),
78
- gridCellProps: (0, $ioKwR$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
- export {$fc6126c82a4601f1$export$3f568fff7dff2f03 as useTag};
89
- //# sourceMappingURL=useTag.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAsCM,SAAS,0CAAU,KAAsB,EAAE,KAAmB,EAAE,GAAuC;IAC5G,IAAI,QAAC,IAAI,EAAC,GAAG;IACb,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,WAAW,CAAA,GAAA,YAAI;IAEnB,IAAI,YAAC,QAAQ,EAAC,GAAG,CAAA,GAAA,yCAAO,EAAE,GAAG,CAAC,UAAU,CAAC;IACzC,IAAI,YAAC,QAAQ,iBAAE,aAAa,EAAE,GAAG,QAAO,GAAG,CAAA,GAAA,sBAAc,EAAE;QACzD,MAAM;IACR,GAAG,OAAO;IAEV,6DAA6D;IAC7D,IAAI,EAAC,kBAAkB,CAAC,EAAE,GAAG,yBAAwB,GAAG;IAExD,IAAI,aAAa,MAAM,YAAY,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,KAAK,KAAK,CAAC,UAAU;IAC1E,IAAI,YAAY,CAAC;QACf,IAAI,EAAE,GAAG,KAAK,YAAY,EAAE,GAAG,KAAK,aAAa;YAC/C,IAAI,YACF;YAGF,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,6BAAqB;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,qBAAa,EAAE;IAE/B,IAAI,gBAAgB,KAAK,GAAG,KAAK,MAAM,gBAAgB,CAAC,UAAU;IAClE,IAAI,YAAY,MAAM,gBAAgB,CAAC,UAAU,IAAI;IACrD,IAAI,WAAW;IACf,IAAI,CAAC,cAAe,CAAA,iBAAiB,CAAC,SAAQ,GAC5C,WAAW;IAGb,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,KAAK,KAAK;IACxC,IAAI,YAAY,CAAA,GAAA,4BAAoB,EAAE,KAAK,KAAK;IAChD,IAAI,kBAAC,cAAc,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAClC,GAAG,KAAK,KAAK;oBACb;IACF,GAAG;IAEH,OAAO;QACL,mBAAmB;YACjB,cAAc,gBAAgB,MAAM,CAAC;YACrC,mBAAmB,GAAG,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;wBAC/C;YACA,IAAI;YACJ,SAAS,IAAM,WAAW,SAAS,IAAI,IAAI;oBAAC,KAAK,GAAG;iBAAC,KAAK;QAC5D;QACA,UAAU,CAAA,GAAA,iBAAS,EAAE,gBAAgB,UAAU,UAAU,WAAW;sBAClE;YACA,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","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, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useDescription, useId, useSyntheticLinkProps} from '@react-aria/utils';\nimport {hookData} from './useTagGroup';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {KeyboardEvent} from 'react';\nimport type {ListState} from '@react-stately/list';\nimport {SelectableItemStates} from '@react-aria/selection';\nimport {useFocusable, useInteractionModality} from '@react-aria/interactions';\nimport {useGridListItem} from '@react-aria/gridlist';\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 | null>): 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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {descriptionProps: _, ...stateWithoutDescription} = states;\n\n let isDisabled = state.disabledKeys.has(item.key) || item.props.isDisabled;\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Delete' || e.key === 'Backspace') {\n if (isDisabled) {\n return;\n }\n\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 isItemFocused = item.key === state.selectionManager.focusedKey;\n let isFocused = state.selectionManager.focusedKey != null;\n let tabIndex = -1;\n if (!isDisabled && (isItemFocused || !isFocused)) {\n tabIndex = 0;\n }\n\n let domProps = filterDOMProps(item.props);\n let linkProps = useSyntheticLinkProps(item.props);\n let {focusableProps} = useFocusable({\n ...item.props,\n isDisabled\n }, ref);\n\n return {\n removeButtonProps: {\n 'aria-label': stringFormatter.format('removeButtonLabel'),\n 'aria-labelledby': `${buttonId} ${rowProps.id}`,\n isDisabled,\n id: buttonId,\n onPress: () => onRemove ? onRemove(new Set([item.key])) : null\n },\n rowProps: mergeProps(focusableProps, rowProps, domProps, linkProps, {\n tabIndex,\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.module.js.map"}
@@ -1,90 +0,0 @@
1
- var $jLhmn$reactariagridlist = require("@react-aria/gridlist");
2
- var $jLhmn$reactariautils = require("@react-aria/utils");
3
- var $jLhmn$reactariaselection = require("@react-aria/selection");
4
- var $jLhmn$react = require("react");
5
- var $jLhmn$reactarialabel = require("@react-aria/label");
6
- var $jLhmn$reactariainteractions = require("@react-aria/interactions");
7
- var $jLhmn$reactariai18n = require("@react-aria/i18n");
8
-
9
-
10
- function $parcel$export(e, n, v, s) {
11
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
- }
13
-
14
- $parcel$export(module.exports, "hookData", () => $09704b0efefe5140$export$653eddfc964b0f8a);
15
- $parcel$export(module.exports, "useTagGroup", () => $09704b0efefe5140$export$4f8b5cda58b7e8ff);
16
- /*
17
- * Copyright 2020 Adobe. All rights reserved.
18
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
- * you may not use this file except in compliance with the License. You may obtain a copy
20
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
- *
22
- * Unless required by applicable law or agreed to in writing, software distributed under
23
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
- * OF ANY KIND, either express or implied. See the License for the specific language
25
- * governing permissions and limitations under the License.
26
- */
27
-
28
-
29
-
30
-
31
-
32
-
33
- const $09704b0efefe5140$export$653eddfc964b0f8a = new WeakMap();
34
- function $09704b0efefe5140$export$4f8b5cda58b7e8ff(props, state, ref) {
35
- let { direction: direction } = (0, $jLhmn$reactariai18n.useLocale)();
36
- let keyboardDelegate = props.keyboardDelegate || new (0, $jLhmn$reactariaselection.ListKeyboardDelegate)({
37
- collection: state.collection,
38
- ref: ref,
39
- orientation: 'horizontal',
40
- direction: direction,
41
- disabledKeys: state.disabledKeys,
42
- disabledBehavior: state.selectionManager.disabledBehavior
43
- });
44
- let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $jLhmn$reactarialabel.useField)({
45
- ...props,
46
- labelElementType: 'span'
47
- });
48
- let { gridProps: gridProps } = (0, $jLhmn$reactariagridlist.useGridList)({
49
- ...props,
50
- ...fieldProps,
51
- keyboardDelegate: keyboardDelegate,
52
- shouldFocusWrap: true,
53
- linkBehavior: 'override',
54
- keyboardNavigationBehavior: 'tab'
55
- }, state, ref);
56
- let [isFocusWithin, setFocusWithin] = (0, $jLhmn$react.useState)(false);
57
- let { focusWithinProps: focusWithinProps } = (0, $jLhmn$reactariainteractions.useFocusWithin)({
58
- onFocusWithinChange: setFocusWithin
59
- });
60
- let domProps = (0, $jLhmn$reactariautils.filterDOMProps)(props);
61
- // If the last tag is removed, focus the container.
62
- let prevCount = (0, $jLhmn$react.useRef)(state.collection.size);
63
- (0, $jLhmn$react.useEffect)(()=>{
64
- if (ref.current && prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) ref.current.focus();
65
- prevCount.current = state.collection.size;
66
- }, [
67
- state.collection.size,
68
- isFocusWithin,
69
- ref
70
- ]);
71
- $09704b0efefe5140$export$653eddfc964b0f8a.set(state, {
72
- onRemove: props.onRemove
73
- });
74
- return {
75
- gridProps: (0, $jLhmn$reactariautils.mergeProps)(gridProps, domProps, {
76
- role: state.collection.size ? 'grid' : 'group',
77
- 'aria-atomic': false,
78
- 'aria-relevant': 'additions',
79
- 'aria-live': isFocusWithin ? 'polite' : 'off',
80
- ...focusWithinProps,
81
- ...fieldProps
82
- }),
83
- labelProps: labelProps,
84
- descriptionProps: descriptionProps,
85
- errorMessageProps: errorMessageProps
86
- };
87
- }
88
-
89
-
90
- //# sourceMappingURL=useTagGroup.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuDM,MAAM,4CAA8C,IAAI;AASxD,SAAS,0CAAe,KAA6B,EAAE,KAAmB,EAAE,GAAkC;IACnH,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,8BAAQ;IAC1B,IAAI,mBAAmB,MAAM,gBAAgB,IAAI,IAAI,CAAA,GAAA,8CAAmB,EAAE;QACxE,YAAY,MAAM,UAAU;aAC5B;QACA,aAAa;mBACb;QACA,cAAc,MAAM,YAAY;QAChC,kBAAkB,MAAM,gBAAgB,CAAC,gBAAgB;IAC3D;IACA,IAAI,cAAC,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,8BAAO,EAAE;QAC3E,GAAG,KAAK;QACR,kBAAkB;IACpB;IACA,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,oCAAU,EAAE;QAC5B,GAAG,KAAK;QACR,GAAG,UAAU;0BACb;QACA,iBAAiB;QACjB,cAAc;QACd,4BAA4B;IAC9B,GAAG,OAAO;IAEV,IAAI,CAAC,eAAe,eAAe,GAAG,CAAA,GAAA,qBAAO,EAAE;IAC/C,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,2CAAa,EAAE;QACtC,qBAAqB;IACvB;IACA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;IAE9B,mDAAmD;IACnD,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE,MAAM,UAAU,CAAC,IAAI;IAC5C,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,IAAI,OAAO,IAAI,UAAU,OAAO,GAAG,KAAK,MAAM,UAAU,CAAC,IAAI,KAAK,KAAK,eACzE,IAAI,OAAO,CAAC,KAAK;QAEnB,UAAU,OAAO,GAAG,MAAM,UAAU,CAAC,IAAI;IAC3C,GAAG;QAAC,MAAM,UAAU,CAAC,IAAI;QAAE;QAAe;KAAI;IAE9C,0CAAS,GAAG,CAAC,OAAO;QAAC,UAAU,MAAM,QAAQ;IAAA;IAE7C,OAAO;QACL,WAAW,CAAA,GAAA,gCAAS,EAAE,WAAW,UAAU;YACzC,MAAM,MAAM,UAAU,CAAC,IAAI,GAAG,SAAS;YACvC,eAAe;YACf,iBAAiB;YACjB,aAAa,gBAAgB,WAAW;YACxC,GAAG,gBAAgB;YACnB,GAAG,UAAU;QACf;oBACA;0BACA;2BACA;IACF;AACF","sources":["packages/@react-aria/tag/src/useTagGroup.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 {AriaGridListProps, useGridList} from '@react-aria/gridlist';\nimport {AriaLabelingProps, CollectionBase, DOMAttributes, DOMProps, HelpTextProps, Key, KeyboardDelegate, LabelableProps, MultipleSelection, RefObject, 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, useEffect, useRef, useState} from 'react';\nimport {useField} from '@react-aria/label';\nimport {useFocusWithin} from '@react-aria/interactions';\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, Pick<AriaGridListProps<T>, 'escapeKeyBehavior'>, DOMProps, LabelableProps, AriaLabelingProps, Omit<HelpTextProps, 'errorMessage'> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\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 * Whether pressing the escape key should clear selection in the TagGroup or not.\n *\n * Most experiences should not modify this option as it eliminates a keyboard user's ability to\n * easily clear selection. Only use if the escape key is being handled externally or should not\n * trigger selection clearing contextually.\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none'\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: WeakMap<ListState<any>, 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 | null>): 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 disabledBehavior: state.selectionManager.disabledBehavior\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 keyboardNavigationBehavior: 'tab'\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' : 'group',\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"],"names":[],"version":3,"file":"useTagGroup.main.js.map"}
@@ -1,84 +0,0 @@
1
- import {useGridList as $eUtJD$useGridList} from "@react-aria/gridlist";
2
- import {filterDOMProps as $eUtJD$filterDOMProps, mergeProps as $eUtJD$mergeProps} from "@react-aria/utils";
3
- import {ListKeyboardDelegate as $eUtJD$ListKeyboardDelegate} from "@react-aria/selection";
4
- import {useState as $eUtJD$useState, useRef as $eUtJD$useRef, useEffect as $eUtJD$useEffect} from "react";
5
- import {useField as $eUtJD$useField} from "@react-aria/label";
6
- import {useFocusWithin as $eUtJD$useFocusWithin} from "@react-aria/interactions";
7
- import {useLocale as $eUtJD$useLocale} from "@react-aria/i18n";
8
-
9
- /*
10
- * Copyright 2020 Adobe. All rights reserved.
11
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License. You may obtain a copy
13
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software distributed under
16
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
- * OF ANY KIND, either express or implied. See the License for the specific language
18
- * governing permissions and limitations under the License.
19
- */
20
-
21
-
22
-
23
-
24
-
25
-
26
- const $d7323bca8d074eeb$export$653eddfc964b0f8a = new WeakMap();
27
- function $d7323bca8d074eeb$export$4f8b5cda58b7e8ff(props, state, ref) {
28
- let { direction: direction } = (0, $eUtJD$useLocale)();
29
- let keyboardDelegate = props.keyboardDelegate || new (0, $eUtJD$ListKeyboardDelegate)({
30
- collection: state.collection,
31
- ref: ref,
32
- orientation: 'horizontal',
33
- direction: direction,
34
- disabledKeys: state.disabledKeys,
35
- disabledBehavior: state.selectionManager.disabledBehavior
36
- });
37
- let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $eUtJD$useField)({
38
- ...props,
39
- labelElementType: 'span'
40
- });
41
- let { gridProps: gridProps } = (0, $eUtJD$useGridList)({
42
- ...props,
43
- ...fieldProps,
44
- keyboardDelegate: keyboardDelegate,
45
- shouldFocusWrap: true,
46
- linkBehavior: 'override',
47
- keyboardNavigationBehavior: 'tab'
48
- }, state, ref);
49
- let [isFocusWithin, setFocusWithin] = (0, $eUtJD$useState)(false);
50
- let { focusWithinProps: focusWithinProps } = (0, $eUtJD$useFocusWithin)({
51
- onFocusWithinChange: setFocusWithin
52
- });
53
- let domProps = (0, $eUtJD$filterDOMProps)(props);
54
- // If the last tag is removed, focus the container.
55
- let prevCount = (0, $eUtJD$useRef)(state.collection.size);
56
- (0, $eUtJD$useEffect)(()=>{
57
- if (ref.current && prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) ref.current.focus();
58
- prevCount.current = state.collection.size;
59
- }, [
60
- state.collection.size,
61
- isFocusWithin,
62
- ref
63
- ]);
64
- $d7323bca8d074eeb$export$653eddfc964b0f8a.set(state, {
65
- onRemove: props.onRemove
66
- });
67
- return {
68
- gridProps: (0, $eUtJD$mergeProps)(gridProps, domProps, {
69
- role: state.collection.size ? 'grid' : 'group',
70
- 'aria-atomic': false,
71
- 'aria-relevant': 'additions',
72
- 'aria-live': isFocusWithin ? 'polite' : 'off',
73
- ...focusWithinProps,
74
- ...fieldProps
75
- }),
76
- labelProps: labelProps,
77
- descriptionProps: descriptionProps,
78
- errorMessageProps: errorMessageProps
79
- };
80
- }
81
-
82
-
83
- export {$d7323bca8d074eeb$export$653eddfc964b0f8a as hookData, $d7323bca8d074eeb$export$4f8b5cda58b7e8ff as useTagGroup};
84
- //# sourceMappingURL=useTagGroup.module.js.map
@@ -1,84 +0,0 @@
1
- import {useGridList as $eUtJD$useGridList} from "@react-aria/gridlist";
2
- import {filterDOMProps as $eUtJD$filterDOMProps, mergeProps as $eUtJD$mergeProps} from "@react-aria/utils";
3
- import {ListKeyboardDelegate as $eUtJD$ListKeyboardDelegate} from "@react-aria/selection";
4
- import {useState as $eUtJD$useState, useRef as $eUtJD$useRef, useEffect as $eUtJD$useEffect} from "react";
5
- import {useField as $eUtJD$useField} from "@react-aria/label";
6
- import {useFocusWithin as $eUtJD$useFocusWithin} from "@react-aria/interactions";
7
- import {useLocale as $eUtJD$useLocale} from "@react-aria/i18n";
8
-
9
- /*
10
- * Copyright 2020 Adobe. All rights reserved.
11
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License. You may obtain a copy
13
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software distributed under
16
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
17
- * OF ANY KIND, either express or implied. See the License for the specific language
18
- * governing permissions and limitations under the License.
19
- */
20
-
21
-
22
-
23
-
24
-
25
-
26
- const $d7323bca8d074eeb$export$653eddfc964b0f8a = new WeakMap();
27
- function $d7323bca8d074eeb$export$4f8b5cda58b7e8ff(props, state, ref) {
28
- let { direction: direction } = (0, $eUtJD$useLocale)();
29
- let keyboardDelegate = props.keyboardDelegate || new (0, $eUtJD$ListKeyboardDelegate)({
30
- collection: state.collection,
31
- ref: ref,
32
- orientation: 'horizontal',
33
- direction: direction,
34
- disabledKeys: state.disabledKeys,
35
- disabledBehavior: state.selectionManager.disabledBehavior
36
- });
37
- let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $eUtJD$useField)({
38
- ...props,
39
- labelElementType: 'span'
40
- });
41
- let { gridProps: gridProps } = (0, $eUtJD$useGridList)({
42
- ...props,
43
- ...fieldProps,
44
- keyboardDelegate: keyboardDelegate,
45
- shouldFocusWrap: true,
46
- linkBehavior: 'override',
47
- keyboardNavigationBehavior: 'tab'
48
- }, state, ref);
49
- let [isFocusWithin, setFocusWithin] = (0, $eUtJD$useState)(false);
50
- let { focusWithinProps: focusWithinProps } = (0, $eUtJD$useFocusWithin)({
51
- onFocusWithinChange: setFocusWithin
52
- });
53
- let domProps = (0, $eUtJD$filterDOMProps)(props);
54
- // If the last tag is removed, focus the container.
55
- let prevCount = (0, $eUtJD$useRef)(state.collection.size);
56
- (0, $eUtJD$useEffect)(()=>{
57
- if (ref.current && prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) ref.current.focus();
58
- prevCount.current = state.collection.size;
59
- }, [
60
- state.collection.size,
61
- isFocusWithin,
62
- ref
63
- ]);
64
- $d7323bca8d074eeb$export$653eddfc964b0f8a.set(state, {
65
- onRemove: props.onRemove
66
- });
67
- return {
68
- gridProps: (0, $eUtJD$mergeProps)(gridProps, domProps, {
69
- role: state.collection.size ? 'grid' : 'group',
70
- 'aria-atomic': false,
71
- 'aria-relevant': 'additions',
72
- 'aria-live': isFocusWithin ? 'polite' : 'off',
73
- ...focusWithinProps,
74
- ...fieldProps
75
- }),
76
- labelProps: labelProps,
77
- descriptionProps: descriptionProps,
78
- errorMessageProps: errorMessageProps
79
- };
80
- }
81
-
82
-
83
- export {$d7323bca8d074eeb$export$653eddfc964b0f8a as hookData, $d7323bca8d074eeb$export$4f8b5cda58b7e8ff as useTagGroup};
84
- //# sourceMappingURL=useTagGroup.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAuDM,MAAM,4CAA8C,IAAI;AASxD,SAAS,0CAAe,KAA6B,EAAE,KAAmB,EAAE,GAAkC;IACnH,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;QAChC,kBAAkB,MAAM,gBAAgB,CAAC,gBAAgB;IAC3D;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;QACd,4BAA4B;IAC9B,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,IAAI,OAAO,CAAC,KAAK;QAEnB,UAAU,OAAO,GAAG,MAAM,UAAU,CAAC,IAAI;IAC3C,GAAG;QAAC,MAAM,UAAU,CAAC,IAAI;QAAE;QAAe;KAAI;IAE9C,0CAAS,GAAG,CAAC,OAAO;QAAC,UAAU,MAAM,QAAQ;IAAA;IAE7C,OAAO;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,WAAW,UAAU;YACzC,MAAM,MAAM,UAAU,CAAC,IAAI,GAAG,SAAS;YACvC,eAAe;YACf,iBAAiB;YACjB,aAAa,gBAAgB,WAAW;YACxC,GAAG,gBAAgB;YACnB,GAAG,UAAU;QACf;oBACA;0BACA;2BACA;IACF;AACF","sources":["packages/@react-aria/tag/src/useTagGroup.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 {AriaGridListProps, useGridList} from '@react-aria/gridlist';\nimport {AriaLabelingProps, CollectionBase, DOMAttributes, DOMProps, HelpTextProps, Key, KeyboardDelegate, LabelableProps, MultipleSelection, RefObject, 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, useEffect, useRef, useState} from 'react';\nimport {useField} from '@react-aria/label';\nimport {useFocusWithin} from '@react-aria/interactions';\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, Pick<AriaGridListProps<T>, 'escapeKeyBehavior'>, DOMProps, LabelableProps, AriaLabelingProps, Omit<HelpTextProps, 'errorMessage'> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\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 * Whether pressing the escape key should clear selection in the TagGroup or not.\n *\n * Most experiences should not modify this option as it eliminates a keyboard user's ability to\n * easily clear selection. Only use if the escape key is being handled externally or should not\n * trigger selection clearing contextually.\n * @default 'clearSelection'\n */\n escapeKeyBehavior?: 'clearSelection' | 'none'\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: WeakMap<ListState<any>, 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 | null>): 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 disabledBehavior: state.selectionManager.disabledBehavior\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 keyboardNavigationBehavior: 'tab'\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' : 'group',\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"],"names":[],"version":3,"file":"useTagGroup.module.js.map"}
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- "removeButtonLabel": `\u{5220}\u{9664}`,
3
- "removeDescription": `\u{6309}\u{4E0B}\u{201C}\u{5220}\u{9664}\u{201D}\u{4EE5}\u{5220}\u{9664}\u{6807}\u{8BB0}\u{3002}`
4
- };
5
-
6
-
7
- //# sourceMappingURL=zh-CN.main.js.map
@@ -1 +0,0 @@
1
- {"mappings":"AAAA,iBAAiB;IAAG,qBAAqB,CAAC,gBAAE,CAAC;IAC3C,qBAAqB,CAAC,gGAAY,CAAC;AACrC","sources":["packages/@react-aria/tag/intl/zh-CN.json"],"sourcesContent":["{\n \"removeButtonLabel\": \"删除\",\n \"removeDescription\": \"按下“删除”以删除标记。\"\n}\n"],"names":[],"version":3,"file":"zh-CN.main.js.map"}
package/dist/zh-CN.mjs DELETED
@@ -1,9 +0,0 @@
1
- var $d737296cedcdee9f$exports = {};
2
- $d737296cedcdee9f$exports = {
3
- "removeButtonLabel": `\u{5220}\u{9664}`,
4
- "removeDescription": `\u{6309}\u{4E0B}\u{201C}\u{5220}\u{9664}\u{201D}\u{4EE5}\u{5220}\u{9664}\u{6807}\u{8BB0}\u{3002}`
5
- };
6
-
7
-
8
- export {$d737296cedcdee9f$exports as default};
9
- //# sourceMappingURL=zh-CN.module.js.map
@@ -1,9 +0,0 @@
1
- var $d737296cedcdee9f$exports = {};
2
- $d737296cedcdee9f$exports = {
3
- "removeButtonLabel": `\u{5220}\u{9664}`,
4
- "removeDescription": `\u{6309}\u{4E0B}\u{201C}\u{5220}\u{9664}\u{201D}\u{4EE5}\u{5220}\u{9664}\u{6807}\u{8BB0}\u{3002}`
5
- };
6
-
7
-
8
- export {$d737296cedcdee9f$exports as default};
9
- //# sourceMappingURL=zh-CN.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";AAAA,4BAAiB;IAAG,qBAAqB,CAAC,gBAAE,CAAC;IAC3C,qBAAqB,CAAC,gGAAY,CAAC;AACrC","sources":["packages/@react-aria/tag/intl/zh-CN.json"],"sourcesContent":["{\n \"removeButtonLabel\": \"删除\",\n \"removeDescription\": \"按下“删除”以删除标记。\"\n}\n"],"names":[],"version":3,"file":"zh-CN.module.js.map"}