@midas-ds/components 1.0.2 → 1.1.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 (175) hide show
  1. package/Button-DL6nqUco.js +182 -0
  2. package/CHANGELOG.md +15 -0
  3. package/Checkbox-q0dugR2t.js +402 -0
  4. package/{Collection-B3xUVWPF.js → Collection-KMFfVuzU.js} +179 -152
  5. package/Dialog-D6Bqrpn-.js +1952 -0
  6. package/Disclosure-dAZYXyTH.js +225 -0
  7. package/Disclosure.css +1 -0
  8. package/DragAndDrop-B0T3WgjL.js +40 -0
  9. package/FocusScope-B7CkxXNC.js +513 -0
  10. package/{Form-DXLoQL91.js → Form-BWBjJC6v.js} +79 -81
  11. package/Group-D7_8007y.js +42 -0
  12. package/Heading-RCRHv6hd.js +15 -0
  13. package/{Hidden-BQWDvze4.js → Hidden-CVlUgUJM.js} +1 -1
  14. package/Link-BnQvB-hH.js +75 -0
  15. package/ListBox-DBBiqvcR.js +474 -0
  16. package/ListKeyboardDelegate-gCXy-Xnn.js +172 -0
  17. package/PressResponder-B4g56kDz.js +31 -0
  18. package/README.md +21 -3
  19. package/{RSPContexts-EOiWkKOf.js → RSPContexts-BW2SEIqe.js} +2 -2
  20. package/SelectionManager-BfXUE1qg.js +1031 -0
  21. package/Separator-BBX9m2O2.js +49 -0
  22. package/Tag-DWt0koFj.js +728 -0
  23. package/Text-BCF0xvqL.js +15 -0
  24. package/TextField-CX4eOQf6.js +225 -0
  25. package/TextField.module-DdICj682.js +143 -0
  26. package/{VisuallyHidden-B_XzVvlX.js → VisuallyHidden-Dhr5caPC.js} +1 -1
  27. package/accordion/Accordion.d.ts +8 -8
  28. package/accordion/AccordionItem.d.ts +11 -3
  29. package/accordion/index.d.ts +0 -3
  30. package/{context-ScOIq_Gu.js → context-BpJLnOuu.js} +11 -11
  31. package/global.css +1 -0
  32. package/index-B-jHjTDC.js +120 -0
  33. package/{index-CorR1LBD.js → index-BPdc9gJ8.js} +3 -3
  34. package/{index-Dl1Q-tbj.js → index-KSgQWWiy.js} +5315 -5315
  35. package/index.d.ts +1 -0
  36. package/index.js +105 -112
  37. package/index10.js +1 -1
  38. package/index11.js +1 -1
  39. package/index12.js +1 -1
  40. package/index13.js +1 -1
  41. package/index14.js +1 -1
  42. package/index15.js +2 -2
  43. package/index16.js +2 -2
  44. package/index17.js +1 -1
  45. package/index18.js +1 -1
  46. package/index19.js +2 -2
  47. package/index2.js +1 -1
  48. package/index20.js +2 -2
  49. package/index21.js +1 -1
  50. package/index22.js +1 -1
  51. package/index23.js +1 -1
  52. package/index24.js +1 -1
  53. package/index25.js +2 -2
  54. package/index26.js +2 -2
  55. package/index27.js +2 -2
  56. package/index28.js +1 -1
  57. package/index29.js +2 -8
  58. package/index3.js +2 -4
  59. package/index30.js +17 -16
  60. package/index31.js +3 -3
  61. package/index32.js +3 -3
  62. package/index33.js +2 -2
  63. package/index34.js +3 -3
  64. package/index35.js +1 -1
  65. package/index36.js +2 -2
  66. package/index37.js +2 -2
  67. package/index38.js +2 -2
  68. package/index39.js +2 -2
  69. package/index4.js +1 -1
  70. package/index40.js +19 -12
  71. package/index41.js +61 -14
  72. package/index42.js +44 -22
  73. package/index43.js +13 -11
  74. package/index44.js +25 -4
  75. package/index45.js +16 -51
  76. package/index46.js +19 -16
  77. package/index47.js +49 -27
  78. package/index48.js +5 -18
  79. package/index49.js +25 -21
  80. package/index5.js +1 -1
  81. package/index50.js +16 -47
  82. package/index51.js +7 -3
  83. package/index52.js +18 -18
  84. package/index53.js +16 -16
  85. package/index54.js +6 -4
  86. package/index55.js +8 -21
  87. package/index56.js +13 -16
  88. package/index57.js +6 -8
  89. package/index58.js +6 -9
  90. package/index59.js +17 -13
  91. package/index6.js +1 -1
  92. package/index60.js +20 -7
  93. package/index61.js +59 -7
  94. package/index62.js +13 -17
  95. package/index63.js +9 -20
  96. package/index64.js +40 -48
  97. package/index65.js +85 -15
  98. package/index66.js +74 -11
  99. package/index67.js +23 -62
  100. package/index68.js +64 -80
  101. package/index69.js +68 -62
  102. package/index7.js +1 -1
  103. package/index70.js +138 -22
  104. package/index71.js +66 -65
  105. package/index72.js +40 -78
  106. package/index73.js +75 -133
  107. package/index74.js +69 -68
  108. package/index75.js +96 -34
  109. package/index76.js +258 -65
  110. package/index77.js +715 -63
  111. package/index78.js +478 -93
  112. package/index79.js +303 -263
  113. package/index8.js +1 -1
  114. package/index80.js +343 -678
  115. package/index81.js +242 -481
  116. package/index82.js +1329 -282
  117. package/index83.js +968 -350
  118. package/index84.js +343 -211
  119. package/index85.js +2025 -1288
  120. package/index86.js +2313 -954
  121. package/index87.js +6782 -339
  122. package/index88.js +15 -2103
  123. package/index89.js +12 -2369
  124. package/index9.js +1 -1
  125. package/index90.js +4 -6832
  126. package/index91.js +7 -15
  127. package/link/Link.d.ts +2 -2
  128. package/link-button/LinkButton.d.ts +1 -1
  129. package/package.json +7 -1
  130. package/{react.esm-D8HpDGKP.js → react.esm-sMU8Z7rL.js} +1872 -1872
  131. package/textfield/index.d.ts +0 -2
  132. package/useControlledState-Kv9K2AYu.js +30 -0
  133. package/{useDescription-D4_zk_sA.js → useDescription-B7stiK3j.js} +1 -1
  134. package/useEvent-Xk5kn5Ns.js +21 -0
  135. package/useField-DMzJIIN4.js +67 -0
  136. package/{useFilter-BnJDBCkt.js → useFilter-Bt9dbV1U.js} +1 -1
  137. package/useFocusRing-9PXyKy2A.js +1297 -0
  138. package/{useFocusable-C-N9wcwm.js → useFocusable-CcEBZe40.js} +11 -8
  139. package/{useGridSelectionCheckbox-i1rsjlC-.js → useGridSelectionCheckbox-DYgEnElE.js} +3 -3
  140. package/useHasTabbableChild-D6DwR81L.js +34 -0
  141. package/{useHighlightSelectionDescription-JVx2MW_e.js → useHighlightSelectionDescription-WYAbP4No.js} +19 -19
  142. package/useLabels-9zaZ9oa0.js +17 -0
  143. package/useListState-BfTeKTk5.js +119 -0
  144. package/{useLocalizedStringFormatter-DVCAZqcL.js → useLocalizedStringFormatter-BlCbn-hX.js} +29 -29
  145. package/{useSingleSelectListState-CmX9_L5H.js → useSingleSelectListState-DPkaL0la.js} +5 -5
  146. package/Button-CCevm2s3.js +0 -183
  147. package/Checkbox-CllWDBxF.js +0 -405
  148. package/Dialog-CLTyYwkS.js +0 -1889
  149. package/DragAndDrop-OTN7La7U.js +0 -42
  150. package/FocusScope-BR0SJ-cZ.js +0 -512
  151. package/Group-DPMuN3h8.js +0 -44
  152. package/Label-C18A_4Z5.js +0 -69
  153. package/Link-BU1h3K2a.js +0 -77
  154. package/ListBox-D21tdwTs.js +0 -463
  155. package/ListKeyboardDelegate-DxMjfMsI.js +0 -172
  156. package/PressResponder-DP8ZDNGy.js +0 -31
  157. package/SelectionManager-D4WtKtey.js +0 -988
  158. package/Separator-DLUHK9vv.js +0 -48
  159. package/Tag-CEd6WWSc.js +0 -725
  160. package/Text-DGLaY3HR.js +0 -17
  161. package/TextField-C_hq9WeT.js +0 -226
  162. package/TextField.module-Cwq1FAm7.js +0 -141
  163. package/accordion/AccordionContent.d.ts +0 -3
  164. package/accordion/AccordionTagContext.d.ts +0 -3
  165. package/accordion/AccordionTrigger.d.ts +0 -3
  166. package/index-CEg5vZQH.js +0 -132
  167. package/index-CgfokhRq.js +0 -674
  168. package/index.css +0 -1
  169. package/index92.js +0 -14
  170. package/index93.js +0 -6
  171. package/index94.js +0 -9
  172. package/useControlledState-S_TYcV_c.js +0 -45
  173. package/useFocusRing-D97-G3fT.js +0 -1324
  174. package/useHasTabbableChild-DeuCnGGv.js +0 -34
  175. package/useListState-DSOTbsL3.js +0 -119
package/Tag-CEd6WWSc.js DELETED
@@ -1,725 +0,0 @@
1
- import { jsx as L, jsxs as qe } from "react/jsx-runtime";
2
- import { a as Xe } from "./Button-CCevm2s3.js";
3
- import { $ as Je, a as q, b as Qe, c as Ye, d as Ze, f as _e } from "./Collection-B3xUVWPF.js";
4
- import { k as X, n as A, e as y, y as er, D as rr, O as J, t as B, E as or, f as tr, N as ar, i as ir, c as Q, b as nr, d as Y, x as Z, a as _, v as lr } from "./useFocusRing-D97-G3fT.js";
5
- import { $ as ur, a as sr } from "./Label-C18A_4Z5.js";
6
- import { $ as K } from "./ListBox-D21tdwTs.js";
7
- import { $ as dr } from "./Text-DGLaY3HR.js";
8
- import g, { useRef as T, useState as cr, useEffect as ee, forwardRef as re, useContext as F, createContext as oe } from "react";
9
- import { b as h, a as br } from "./ListKeyboardDelegate-DxMjfMsI.js";
10
- import { a as pr, b as fr } from "./useHighlightSelectionDescription-JVx2MW_e.js";
11
- import { $ as $r } from "./useHasTabbableChild-DeuCnGGv.js";
12
- import { $ as vr } from "./Separator-DLUHK9vv.js";
13
- import { $ as te } from "./context-ScOIq_Gu.js";
14
- import { $ as mr } from "./useDescription-D4_zk_sA.js";
15
- import { h as gr, f as xr, i as E } from "./SelectionManager-D4WtKtey.js";
16
- import { $ as U } from "./FocusScope-BR0SJ-cZ.js";
17
- import { $ as yr } from "./useLocalizedStringFormatter-DVCAZqcL.js";
18
- import { $ as Dr } from "./useListState-DSOTbsL3.js";
19
- import { Button as kr } from "./index69.js";
20
- import { c as Br } from "./clsx-OuTLNxxd.js";
21
- import { X as Pr } from "./x-JK7i-TQC.js";
22
- import './Tag.css';const V = /* @__PURE__ */ new WeakMap();
23
- function W(o, e) {
24
- var r;
25
- let { id: i } = (r = V.get(o)) !== null && r !== void 0 ? r : {};
26
- if (!i) throw new Error("Unknown list");
27
- return `${i}-${hr(e)}`;
28
- }
29
- function hr(o) {
30
- return typeof o == "string" ? o.replace(/\s*/g, "") : "" + o;
31
- }
32
- function Er(o, e, r) {
33
- let { isVirtualized: i, keyboardDelegate: u, layoutDelegate: t, onAction: n, linkBehavior: c = "action", keyboardNavigationBehavior: s = "arrow" } = o;
34
- !o["aria-label"] && !o["aria-labelledby"] && console.warn("An aria-label or aria-labelledby prop is required for accessibility.");
35
- let { listProps: b } = vr({
36
- selectionManager: e.selectionManager,
37
- collection: e.collection,
38
- disabledKeys: e.disabledKeys,
39
- ref: r,
40
- keyboardDelegate: u,
41
- layoutDelegate: t,
42
- isVirtualized: i,
43
- selectOnFocus: e.selectionManager.selectionBehavior === "replace",
44
- shouldFocusWrap: o.shouldFocusWrap,
45
- linkBehavior: c
46
- }), l = X(o.id);
47
- V.set(e, {
48
- id: l,
49
- onAction: n,
50
- linkBehavior: c,
51
- keyboardNavigationBehavior: s
52
- });
53
- let f = pr({
54
- selectionManager: e.selectionManager,
55
- hasItemActions: !!n
56
- }), $ = $r(r, {
57
- isDisabled: e.collection.size !== 0
58
- }), d = A(o, {
59
- labelable: !0
60
- }), v = y(
61
- d,
62
- {
63
- role: "grid",
64
- id: l,
65
- "aria-multiselectable": e.selectionManager.selectionMode === "multiple" ? "true" : void 0
66
- },
67
- // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.
68
- e.collection.size === 0 ? {
69
- tabIndex: $ ? -1 : 0
70
- } : b,
71
- f
72
- );
73
- return i && (v["aria-rowcount"] = e.collection.size, v["aria-colcount"] = 1), fr({}, e), {
74
- gridProps: v
75
- };
76
- }
77
- const H = {
78
- expand: {
79
- ltr: "ArrowRight",
80
- rtl: "ArrowLeft"
81
- },
82
- collapse: {
83
- ltr: "ArrowLeft",
84
- rtl: "ArrowRight"
85
- }
86
- };
87
- function Cr(o, e, r) {
88
- var i, u;
89
- let { node: t, isVirtualized: n, shouldSelectOnPressUp: c } = o, { direction: s } = te(), { onAction: b, linkBehavior: l, keyboardNavigationBehavior: f } = V.get(e), $ = er(), d = T(null), v = () => {
90
- var a;
91
- r.current !== null && (d.current != null && t.key !== d.current || !(!((a = r.current) === null || a === void 0) && a.contains(document.activeElement))) && B(r.current);
92
- }, M = {}, D, N = e.selectionManager.isLink(t.key);
93
- if (t != null && "expandedKeys" in e) {
94
- var C, P, z;
95
- let a = (C = (P = e.collection).getChildren) === null || C === void 0 ? void 0 : C.call(P, t.key);
96
- D = [
97
- ...a ?? []
98
- ].length > 1, b == null && !N && e.selectionManager.selectionMode === "none" && D && (b = () => e.toggleKey(t.key));
99
- let m = D ? e.expandedKeys.has(t.key) : void 0, k = 1;
100
- var R;
101
- if (t.level > 0 && (t == null ? void 0 : t.parentKey) != null) {
102
- let p = e.collection.getItem(t.parentKey);
103
- if (p) {
104
- var S, j;
105
- let x = (S = (j = e.collection).getChildren) === null || S === void 0 ? void 0 : S.call(j, p.key);
106
- k = gr(x).index + 1;
107
- }
108
- } else k = ((R = (z = [
109
- ...e.collection
110
- ].filter((p) => p.level === 0).at(-1)) === null || z === void 0 ? void 0 : z.index) !== null && R !== void 0 ? R : 0) + 1;
111
- M = {
112
- "aria-expanded": m,
113
- "aria-level": t.level + 1,
114
- "aria-posinset": (t == null ? void 0 : t.index) + 1,
115
- "aria-setsize": k
116
- };
117
- }
118
- let { itemProps: Oe, ...O } = xr({
119
- selectionManager: e.selectionManager,
120
- key: t.key,
121
- ref: r,
122
- isVirtualized: n,
123
- shouldSelectOnPressUp: c,
124
- onAction: b || !((i = t.props) === null || i === void 0) && i.onAction ? rr((u = t.props) === null || u === void 0 ? void 0 : u.onAction, b ? () => b(t.key) : void 0) : void 0,
125
- focus: v,
126
- linkBehavior: l
127
- }), Ie = (a) => {
128
- if (!a.currentTarget.contains(a.target) || !r.current || !document.activeElement) return;
129
- let m = U(r.current);
130
- if (m.currentNode = document.activeElement, "expandedKeys" in e && document.activeElement === r.current) {
131
- if (a.key === H.expand[s] && e.selectionManager.focusedKey === t.key && D && !e.expandedKeys.has(t.key)) {
132
- e.toggleKey(t.key), a.stopPropagation();
133
- return;
134
- } else if (a.key === H.collapse[s] && e.selectionManager.focusedKey === t.key && D && e.expandedKeys.has(t.key)) {
135
- e.toggleKey(t.key), a.stopPropagation();
136
- return;
137
- }
138
- }
139
- switch (a.key) {
140
- case "ArrowLeft":
141
- if (f === "arrow") {
142
- let p = s === "rtl" ? m.nextNode() : m.previousNode();
143
- if (p)
144
- a.preventDefault(), a.stopPropagation(), B(p), E(p, {
145
- containingElement: h(r.current)
146
- });
147
- else if (a.preventDefault(), a.stopPropagation(), s === "rtl")
148
- B(r.current), E(r.current, {
149
- containingElement: h(r.current)
150
- });
151
- else {
152
- m.currentNode = r.current;
153
- let x = G(m);
154
- x && (B(x), E(x, {
155
- containingElement: h(r.current)
156
- }));
157
- }
158
- }
159
- break;
160
- case "ArrowRight":
161
- if (f === "arrow") {
162
- let p = s === "rtl" ? m.previousNode() : m.nextNode();
163
- if (p)
164
- a.preventDefault(), a.stopPropagation(), B(p), E(p, {
165
- containingElement: h(r.current)
166
- });
167
- else if (a.preventDefault(), a.stopPropagation(), s === "ltr")
168
- B(r.current), E(r.current, {
169
- containingElement: h(r.current)
170
- });
171
- else {
172
- m.currentNode = r.current;
173
- let x = G(m);
174
- x && (B(x), E(x, {
175
- containingElement: h(r.current)
176
- }));
177
- }
178
- }
179
- break;
180
- case "ArrowUp":
181
- case "ArrowDown":
182
- if (!a.altKey && r.current.contains(a.target)) {
183
- var k;
184
- a.stopPropagation(), a.preventDefault(), (k = r.current.parentElement) === null || k === void 0 || k.dispatchEvent(new KeyboardEvent(a.nativeEvent.type, a.nativeEvent));
185
- }
186
- break;
187
- case "Tab":
188
- if (f === "tab") {
189
- let p = U(r.current, {
190
- tabbable: !0
191
- });
192
- p.currentNode = document.activeElement, (a.shiftKey ? p.previousNode() : p.nextNode()) && a.stopPropagation();
193
- }
194
- }
195
- }, Ue = (a) => {
196
- if (d.current = t.key, a.target !== r.current) {
197
- or() || e.selectionManager.setFocusedKey(t.key);
198
- return;
199
- }
200
- }, We = J(t.props), He = O.hasAction ? We : {}, I = y(Oe, He, {
201
- role: "row",
202
- onKeyDownCapture: Ie,
203
- onFocus: Ue,
204
- // 'aria-label': [(node.textValue || undefined), rowAnnouncement].filter(Boolean).join(', '),
205
- "aria-label": t.textValue || void 0,
206
- "aria-selected": e.selectionManager.canSelectItem(t.key) ? e.selectionManager.isSelected(t.key) : void 0,
207
- "aria-disabled": e.selectionManager.isDisabled(t.key) || void 0,
208
- "aria-labelledby": $ && t.textValue ? `${W(e, t.key)} ${$}` : void 0,
209
- id: W(e, t.key)
210
- });
211
- n && (I["aria-rowindex"] = t.index + 1);
212
- let Ge = {
213
- role: "gridcell",
214
- "aria-colindex": 1
215
- };
216
- return {
217
- rowProps: {
218
- ...y(I, M)
219
- },
220
- gridCellProps: Ge,
221
- descriptionProps: {
222
- id: $
223
- },
224
- ...O
225
- };
226
- }
227
- function G(o) {
228
- let e = null, r = null;
229
- do
230
- r = o.lastChild(), r && (e = r);
231
- while (r);
232
- return e;
233
- }
234
- const ae = /* @__PURE__ */ new WeakMap();
235
- function wr(o, e, r) {
236
- let { direction: i } = te(), u = o.keyboardDelegate || new br({
237
- collection: e.collection,
238
- ref: r,
239
- orientation: "horizontal",
240
- direction: i,
241
- disabledKeys: e.disabledKeys,
242
- disabledBehavior: e.selectionManager.disabledBehavior
243
- }), { labelProps: t, fieldProps: n, descriptionProps: c, errorMessageProps: s } = ur({
244
- ...o,
245
- labelElementType: "span"
246
- }), { gridProps: b } = Er({
247
- ...o,
248
- ...n,
249
- keyboardDelegate: u,
250
- shouldFocusWrap: !0,
251
- linkBehavior: "override"
252
- }, e, r), [l, f] = cr(!1), { focusWithinProps: $ } = tr({
253
- onFocusWithinChange: f
254
- }), d = A(o), v = T(e.collection.size);
255
- return ee(() => {
256
- r.current && v.current > 0 && e.collection.size === 0 && l && r.current.focus(), v.current = e.collection.size;
257
- }, [
258
- e.collection.size,
259
- l,
260
- r
261
- ]), ae.set(e, {
262
- onRemove: o.onRemove
263
- }), {
264
- gridProps: y(b, d, {
265
- role: e.collection.size ? "grid" : null,
266
- "aria-atomic": !1,
267
- "aria-relevant": "additions",
268
- "aria-live": l ? "polite" : "off",
269
- ...$,
270
- ...n
271
- }),
272
- labelProps: t,
273
- descriptionProps: c,
274
- errorMessageProps: s
275
- };
276
- }
277
- var ie = {};
278
- ie = {
279
- removeButtonLabel: "إزالة",
280
- removeDescription: "اضغط على مفتاح DELETE لإزالة علامة."
281
- };
282
- var ne = {};
283
- ne = {
284
- removeButtonLabel: "Премахване",
285
- removeDescription: "Натиснете Delete, за да премахнете маркера."
286
- };
287
- var le = {};
288
- le = {
289
- removeButtonLabel: "Odebrat",
290
- removeDescription: "Stisknutím klávesy Delete odeberete značku."
291
- };
292
- var ue = {};
293
- ue = {
294
- removeButtonLabel: "Fjern",
295
- removeDescription: "Tryk på Slet for at fjerne tag."
296
- };
297
- var se = {};
298
- se = {
299
- removeButtonLabel: "Entfernen",
300
- removeDescription: "Auf „Löschen“ drücken, um das Tag zu entfernen."
301
- };
302
- var de = {};
303
- de = {
304
- removeButtonLabel: "Κατάργηση",
305
- removeDescription: "Πατήστε Διαγραφή για να καταργήσετε την ετικέτα."
306
- };
307
- var ce = {};
308
- ce = {
309
- removeDescription: "Press Delete to remove tag.",
310
- removeButtonLabel: "Remove"
311
- };
312
- var be = {};
313
- be = {
314
- removeButtonLabel: "Quitar",
315
- removeDescription: "Pulse Eliminar para quitar la etiqueta."
316
- };
317
- var pe = {};
318
- pe = {
319
- removeButtonLabel: "Eemalda",
320
- removeDescription: "Sildi eemaldamiseks vajutage kustutusklahvi Delete."
321
- };
322
- var fe = {};
323
- fe = {
324
- removeButtonLabel: "Poista",
325
- removeDescription: "Poista tunniste painamalla Poista-painiketta."
326
- };
327
- var $e = {};
328
- $e = {
329
- removeButtonLabel: "Supprimer",
330
- removeDescription: "Appuyez sur Supprimer pour supprimer l’étiquette."
331
- };
332
- var ve = {};
333
- ve = {
334
- removeButtonLabel: "הסר",
335
- removeDescription: "לחץ על מחק כדי להסיר תג."
336
- };
337
- var me = {};
338
- me = {
339
- removeButtonLabel: "Ukloni",
340
- removeDescription: "Pritisnite Delete za uklanjanje oznake."
341
- };
342
- var ge = {};
343
- ge = {
344
- removeButtonLabel: "Eltávolítás",
345
- removeDescription: "Nyomja meg a Delete billentyűt a címke eltávolításához."
346
- };
347
- var xe = {};
348
- xe = {
349
- removeButtonLabel: "Rimuovi",
350
- removeDescription: "Premi Elimina per rimuovere il tag."
351
- };
352
- var ye = {};
353
- ye = {
354
- removeButtonLabel: "削除",
355
- removeDescription: "タグを削除するには、Delete キーを押します。"
356
- };
357
- var De = {};
358
- De = {
359
- removeButtonLabel: "제거",
360
- removeDescription: "태그를 제거하려면 Delete 키를 누르십시오."
361
- };
362
- var ke = {};
363
- ke = {
364
- removeButtonLabel: "Pašalinti",
365
- removeDescription: "Norėdami pašalinti žymą, paspauskite „Delete“ klavišą."
366
- };
367
- var Be = {};
368
- Be = {
369
- removeButtonLabel: "Noņemt",
370
- removeDescription: "Nospiediet Delete [Dzēst], lai noņemtu tagu."
371
- };
372
- var Pe = {};
373
- Pe = {
374
- removeButtonLabel: "Fjern",
375
- removeDescription: "Trykk på Slett for å fjerne taggen."
376
- };
377
- var he = {};
378
- he = {
379
- removeButtonLabel: "Verwijderen",
380
- removeDescription: "Druk op Verwijderen om de tag te verwijderen."
381
- };
382
- var Ee = {};
383
- Ee = {
384
- removeButtonLabel: "Usuń",
385
- removeDescription: "Naciśnij Usuń, aby usunąć znacznik."
386
- };
387
- var Ce = {};
388
- Ce = {
389
- removeButtonLabel: "Remover",
390
- removeDescription: "Pressione Delete para remover a tag."
391
- };
392
- var we = {};
393
- we = {
394
- removeButtonLabel: "Eliminar",
395
- removeDescription: "Prima Delete para eliminar a tag."
396
- };
397
- var Le = {};
398
- Le = {
399
- removeButtonLabel: "Îndepărtaţi",
400
- removeDescription: "Apăsați pe Delete (Ștergere) pentru a elimina eticheta."
401
- };
402
- var Ae = {};
403
- Ae = {
404
- removeButtonLabel: "Удалить",
405
- removeDescription: "Нажмите DELETE, чтобы удалить тег."
406
- };
407
- var Me = {};
408
- Me = {
409
- removeButtonLabel: "Odstrániť",
410
- removeDescription: "Ak chcete odstrániť značku, stlačte kláves Delete."
411
- };
412
- var Fe = {};
413
- Fe = {
414
- removeButtonLabel: "Odstrani",
415
- removeDescription: "Pritisnite Delete, da odstranite oznako."
416
- };
417
- var Ke = {};
418
- Ke = {
419
- removeButtonLabel: "Ukloni",
420
- removeDescription: "Pritisnite Obriši da biste uklonili oznaku."
421
- };
422
- var Ne = {};
423
- Ne = {
424
- removeButtonLabel: "Ta bort",
425
- removeDescription: "Tryck på Radera för att ta bort taggen."
426
- };
427
- var ze = {};
428
- ze = {
429
- removeButtonLabel: "Kaldır",
430
- removeDescription: "Etiketi kaldırmak için Sil tuşuna basın."
431
- };
432
- var Re = {};
433
- Re = {
434
- removeButtonLabel: "Вилучити",
435
- removeDescription: "Натисніть Delete, щоб вилучити тег."
436
- };
437
- var Se = {};
438
- Se = {
439
- removeButtonLabel: "删除",
440
- removeDescription: "按下“删除”以删除标记。"
441
- };
442
- var Te = {};
443
- Te = {
444
- removeButtonLabel: "移除",
445
- removeDescription: "按 Delete 鍵以移除標記。"
446
- };
447
- var Ve = {};
448
- Ve = {
449
- "ar-AE": ie,
450
- "bg-BG": ne,
451
- "cs-CZ": le,
452
- "da-DK": ue,
453
- "de-DE": se,
454
- "el-GR": de,
455
- "en-US": ce,
456
- "es-ES": be,
457
- "et-EE": pe,
458
- "fi-FI": fe,
459
- "fr-FR": $e,
460
- "he-IL": ve,
461
- "hr-HR": me,
462
- "hu-HU": ge,
463
- "it-IT": xe,
464
- "ja-JP": ye,
465
- "ko-KR": De,
466
- "lt-LT": ke,
467
- "lv-LV": Be,
468
- "nb-NO": Pe,
469
- "nl-NL": he,
470
- "pl-PL": Ee,
471
- "pt-BR": Ce,
472
- "pt-PT": we,
473
- "ro-RO": Le,
474
- "ru-RU": Ae,
475
- "sk-SK": Me,
476
- "sl-SI": Fe,
477
- "sr-SP": Ke,
478
- "sv-SE": Ne,
479
- "tr-TR": ze,
480
- "uk-UA": Re,
481
- "zh-CN": Se,
482
- "zh-TW": Te
483
- };
484
- function Lr(o) {
485
- return o && o.__esModule ? o.default : o;
486
- }
487
- function Ar(o, e, r) {
488
- let { item: i } = o, u = yr(Lr(Ve), "@react-aria/tag"), t = X(), { onRemove: n } = ae.get(e) || {}, { rowProps: c, gridCellProps: s, ...b } = Cr({
489
- node: i
490
- }, e, r);
491
- delete c.onKeyDownCapture;
492
- let { descriptionProps: l, ...f } = b, $ = (P) => {
493
- (P.key === "Delete" || P.key === "Backspace") && (P.preventDefault(), e.selectionManager.isSelected(i.key) ? n == null || n(new Set(e.selectionManager.selectedKeys)) : n == null || n(/* @__PURE__ */ new Set([
494
- i.key
495
- ])));
496
- }, d = ar();
497
- d === "virtual" && typeof window < "u" && "ontouchstart" in window && (d = "pointer");
498
- let v = n && (d === "keyboard" || d === "virtual") ? u.format("removeDescription") : "", M = mr(v), D = i.key === e.selectionManager.focusedKey, N = A(i.props), C = J(i.props);
499
- return {
500
- removeButtonProps: {
501
- "aria-label": u.format("removeButtonLabel"),
502
- "aria-labelledby": `${t} ${c.id}`,
503
- isDisabled: e.disabledKeys.has(i.key) || i.props.isDisabled,
504
- id: t,
505
- onPress: () => n ? n(/* @__PURE__ */ new Set([
506
- i.key
507
- ])) : null,
508
- excludeFromTabOrder: !0
509
- },
510
- rowProps: y(c, N, C, {
511
- tabIndex: D || e.selectionManager.focusedKey == null ? 0 : -1,
512
- onKeyDown: n ? $ : void 0,
513
- "aria-describedby": M["aria-describedby"]
514
- }),
515
- gridCellProps: y(s, {
516
- "aria-errormessage": o["aria-errormessage"],
517
- "aria-label": o["aria-label"]
518
- }),
519
- ...f,
520
- allowsRemoving: !!n
521
- };
522
- }
523
- const Mr = /* @__PURE__ */ oe(null), je = /* @__PURE__ */ oe(null);
524
- function Fr(o, e) {
525
- return [o, e] = _(o, e, Mr), /* @__PURE__ */ g.createElement(Ye, {
526
- content: o.children
527
- }, (r) => /* @__PURE__ */ g.createElement(Kr, {
528
- props: o,
529
- forwardedRef: e,
530
- collection: r
531
- }));
532
- }
533
- function Kr({ props: o, forwardedRef: e, collection: r }) {
534
- let i = T(null), [u, t] = lr(), n = Dr({
535
- ...o,
536
- children: void 0,
537
- collection: r
538
- }), c = A(o), s = Object.fromEntries(Object.entries(c).map(([v]) => [
539
- v,
540
- void 0
541
- ])), { gridProps: b, labelProps: l, descriptionProps: f, errorMessageProps: $ } = wr({
542
- ...o,
543
- ...s,
544
- label: t
545
- }, n, i);
546
- var d;
547
- return /* @__PURE__ */ g.createElement("div", {
548
- ...c,
549
- ref: e,
550
- slot: o.slot || void 0,
551
- className: (d = o.className) !== null && d !== void 0 ? d : "react-aria-TagGroup",
552
- style: o.style
553
- }, /* @__PURE__ */ g.createElement(Z, {
554
- values: [
555
- [
556
- sr,
557
- {
558
- ...l,
559
- elementType: "span",
560
- ref: u
561
- }
562
- ],
563
- [
564
- je,
565
- {
566
- ...b,
567
- ref: i
568
- }
569
- ],
570
- [
571
- K,
572
- n
573
- ],
574
- [
575
- dr,
576
- {
577
- slots: {
578
- description: f,
579
- errorMessage: $
580
- }
581
- }
582
- ]
583
- ]
584
- }, o.children));
585
- }
586
- const Nr = /* @__PURE__ */ re(Fr);
587
- function zr(o, e) {
588
- return F(K) ? /* @__PURE__ */ g.createElement(Rr, {
589
- props: o,
590
- forwardedRef: e
591
- }) : /* @__PURE__ */ g.createElement(Ze, o);
592
- }
593
- function Rr({ props: o, forwardedRef: e }) {
594
- let r = F(K), { CollectionRoot: i } = F(q), [u, t] = _(o, e, je);
595
- delete u.items, delete u.renderEmptyState;
596
- let { focusProps: n, isFocused: c, isFocusVisible: s } = Q(), b = {
597
- isEmpty: r.collection.size === 0,
598
- isFocused: c,
599
- isFocusVisible: s,
600
- state: r
601
- }, l = Y({
602
- className: o.className,
603
- style: o.style,
604
- defaultClassName: "react-aria-TagList",
605
- values: b
606
- }), f = _e(r.selectionManager.focusedKey);
607
- return /* @__PURE__ */ g.createElement("div", {
608
- ...y(u, n),
609
- ...l,
610
- ref: t,
611
- "data-empty": r.collection.size === 0 || void 0,
612
- "data-focused": c || void 0,
613
- "data-focus-visible": s || void 0
614
- }, r.collection.size === 0 && o.renderEmptyState ? o.renderEmptyState(b) : /* @__PURE__ */ g.createElement(i, {
615
- collection: r.collection,
616
- persistedKeys: f
617
- }));
618
- }
619
- const Sr = /* @__PURE__ */ re(zr), Tr = /* @__PURE__ */ Je("item", (o, e, r) => {
620
- let i = F(K), u = ir(e), { focusProps: t, isFocusVisible: n } = Q({
621
- within: !0
622
- }), { rowProps: c, gridCellProps: s, removeButtonProps: b, ...l } = Ar({
623
- item: r
624
- }, i, u), { hoverProps: f, isHovered: $ } = nr({
625
- isDisabled: !l.allowsSelection,
626
- onHoverStart: r.props.onHoverStart,
627
- onHoverChange: r.props.onHoverChange,
628
- onHoverEnd: r.props.onHoverEnd
629
- }), d = Y({
630
- ...o,
631
- id: void 0,
632
- children: r.rendered,
633
- defaultClassName: "react-aria-Tag",
634
- values: {
635
- ...l,
636
- isFocusVisible: n,
637
- isHovered: $,
638
- selectionMode: i.selectionManager.selectionMode,
639
- selectionBehavior: i.selectionManager.selectionBehavior
640
- }
641
- });
642
- return ee(() => {
643
- r.textValue || console.warn("A `textValue` prop is required for <Tag> elements with non-plain text children for accessibility.");
644
- }, [
645
- r.textValue
646
- ]), /* @__PURE__ */ g.createElement("div", {
647
- ref: u,
648
- ...d,
649
- ...y(A(o), c, t, f),
650
- "data-selected": l.isSelected || void 0,
651
- "data-disabled": l.isDisabled || void 0,
652
- "data-hovered": $ || void 0,
653
- "data-focused": l.isFocused || void 0,
654
- "data-focus-visible": n || void 0,
655
- "data-pressed": l.isPressed || void 0,
656
- "data-allows-removing": l.allowsRemoving || void 0,
657
- "data-selection-mode": i.selectionManager.selectionMode === "none" ? void 0 : i.selectionManager.selectionMode
658
- }, /* @__PURE__ */ g.createElement("div", {
659
- ...s,
660
- style: {
661
- display: "contents"
662
- }
663
- }, /* @__PURE__ */ g.createElement(Z, {
664
- values: [
665
- [
666
- Xe,
667
- {
668
- slots: {
669
- remove: b
670
- }
671
- }
672
- ],
673
- [
674
- q,
675
- Qe
676
- ]
677
- ]
678
- }, d.children)));
679
- }), Vr = '"../theme/tokens.css"', jr = '"Inter", sans-serif', Or = "#000000", Ir = "#b31b1b", Ur = "(max-width: 767px)", Wr = "#bfbfbf", Hr = "#d9d9d9", Gr = "#e6e6e6", qr = "#f2f2f2", Xr = "#f2f2f2", Jr = "_button_m4kn4_4", Qr = "_tag_m4kn4_14", Yr = "_dismissable_m4kn4_34", Zr = "_tagText_m4kn4_42", _r = "_tagList_m4kn4_47", w = {
680
- tokens: Vr,
681
- display: jr,
682
- black: Or,
683
- signalRed130: Ir,
684
- smBreakpoint: Ur,
685
- gray50: Wr,
686
- gray30: Hr,
687
- gray20: Gr,
688
- gray10: qr,
689
- backgroundSecondary: Xr,
690
- button: Jr,
691
- tag: Qr,
692
- dismissable: Yr,
693
- tagText: Zr,
694
- tagList: _r
695
- }, ko = ({ children: o, ...e }) => /* @__PURE__ */ L(Nr, { ...e, children: /* @__PURE__ */ L(Sr, { className: w.tagList, children: o }) }), Bo = ({
696
- children: o,
697
- dismissable: e,
698
- ...r
699
- }) => /* @__PURE__ */ qe(
700
- Tr,
701
- {
702
- className: Br(w.tag, e && w.dismissable),
703
- ...r,
704
- children: [
705
- /* @__PURE__ */ L("div", { className: w.tagText, children: o }),
706
- e && /* @__PURE__ */ L(
707
- kr,
708
- {
709
- variant: "icon",
710
- size: "small",
711
- className: w.button,
712
- slot: "remove",
713
- children: /* @__PURE__ */ L(Pr, { size: 20 })
714
- }
715
- )
716
- ]
717
- }
718
- );
719
- export {
720
- W as $,
721
- Bo as T,
722
- ko as a,
723
- Cr as b,
724
- Er as c
725
- };