@midas-ds/components 1.0.2 → 1.0.3

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 (125) hide show
  1. package/Button-B4vMZbC6.js +182 -0
  2. package/CHANGELOG.md +10 -0
  3. package/Checkbox-DnKWanep.js +402 -0
  4. package/{Collection-B3xUVWPF.js → Collection-COLWgm24.js} +179 -152
  5. package/Dialog-Cb6toyXO.js +1951 -0
  6. package/DragAndDrop-B0T3WgjL.js +40 -0
  7. package/FocusScope-C8i7CH6y.js +513 -0
  8. package/Form-BQQs3jUk.js +238 -0
  9. package/Group-CdwXhx8Q.js +42 -0
  10. package/{Hidden-BQWDvze4.js → Hidden-DngIphiL.js} +1 -1
  11. package/Link-iAZLB3RI.js +75 -0
  12. package/ListBox-BKWkIIm6.js +474 -0
  13. package/ListKeyboardDelegate-BH-K5hyq.js +172 -0
  14. package/{PressResponder-DP8ZDNGy.js → PressResponder-Cz-TRBHO.js} +10 -10
  15. package/README.md +21 -3
  16. package/SelectionManager-8o40f7mx.js +1047 -0
  17. package/Separator-BlvmQjwz.js +49 -0
  18. package/Tag--W5TgxmK.js +728 -0
  19. package/Text-CQPW6xs7.js +15 -0
  20. package/TextField-DeK_yiK-.js +225 -0
  21. package/TextField.module-0-u4LVPp.js +143 -0
  22. package/{VisuallyHidden-B_XzVvlX.js → VisuallyHidden-CFx06Bae.js} +1 -1
  23. package/{context-ScOIq_Gu.js → context-Bnqknrce.js} +1 -1
  24. package/index-B-jHjTDC.js +120 -0
  25. package/{index-CorR1LBD.js → index-BPdc9gJ8.js} +3 -3
  26. package/index-DK9ZACEc.js +642 -0
  27. package/{index-Dl1Q-tbj.js → index-KSgQWWiy.js} +5315 -5315
  28. package/index.js +45 -47
  29. package/index15.js +1 -1
  30. package/index16.js +1 -1
  31. package/index25.js +1 -1
  32. package/index26.js +1 -1
  33. package/index3.js +2 -4
  34. package/index31.js +3 -3
  35. package/index32.js +2 -2
  36. package/index33.js +2 -2
  37. package/index34.js +1 -1
  38. package/index35.js +1 -1
  39. package/index36.js +1 -1
  40. package/index37.js +1 -1
  41. package/index38.js +1 -1
  42. package/index39.js +1 -1
  43. package/index40.js +1 -1
  44. package/index41.js +1 -1
  45. package/index42.js +1 -1
  46. package/index43.js +1 -1
  47. package/index45.js +3 -3
  48. package/index5.js +1 -1
  49. package/index50.js +1 -1
  50. package/index52.js +3 -3
  51. package/index53.js +3 -3
  52. package/index54.js +1 -1
  53. package/index55.js +4 -4
  54. package/index56.js +1 -1
  55. package/index57.js +1 -1
  56. package/index58.js +1 -1
  57. package/index59.js +3 -3
  58. package/index60.js +1 -1
  59. package/index61.js +1 -1
  60. package/index62.js +1 -1
  61. package/index63.js +4 -4
  62. package/index64.js +3 -3
  63. package/index65.js +3 -3
  64. package/index66.js +1 -1
  65. package/index67.js +3 -3
  66. package/index68.js +2 -2
  67. package/index69.js +1 -1
  68. package/index71.js +1 -1
  69. package/index76.js +5 -5
  70. package/index77.js +2 -2
  71. package/index78.js +2 -2
  72. package/index79.js +1 -1
  73. package/index80.js +226 -227
  74. package/index81.js +197 -199
  75. package/index82.js +192 -195
  76. package/index83.js +181 -183
  77. package/index84.js +52 -54
  78. package/index85.js +261 -262
  79. package/index86.js +262 -262
  80. package/index87.js +209 -211
  81. package/index88.js +436 -440
  82. package/index89.js +962 -964
  83. package/index90.js +2401 -2399
  84. package/index92.js +5 -5
  85. package/index93.js +1 -1
  86. package/index94.js +1 -1
  87. package/link/Link.d.ts +2 -2
  88. package/link-button/LinkButton.d.ts +1 -1
  89. package/package.json +7 -1
  90. package/{react.esm-D8HpDGKP.js → react.esm-sMU8Z7rL.js} +1872 -1872
  91. package/textfield/index.d.ts +0 -2
  92. package/{useControlledState-S_TYcV_c.js → useControlledState-DrAoodI6.js} +1 -1
  93. package/{useDescription-D4_zk_sA.js → useDescription-BPs7eRff.js} +1 -1
  94. package/useField-Dz62UHCP.js +67 -0
  95. package/{useFilter-BnJDBCkt.js → useFilter-ViwzkzZe.js} +1 -1
  96. package/useFocusRing-BKGhL91C.js +1297 -0
  97. package/{useFocusable-C-N9wcwm.js → useFocusable-CRSmYEQc.js} +11 -8
  98. package/{useGridSelectionCheckbox-i1rsjlC-.js → useGridSelectionCheckbox-CVEvUCJL.js} +3 -3
  99. package/useHasTabbableChild-C8y4fwiY.js +34 -0
  100. package/{useHighlightSelectionDescription-JVx2MW_e.js → useHighlightSelectionDescription-CD74uzLh.js} +19 -19
  101. package/useListState-DKnP5TB5.js +119 -0
  102. package/{useLocalizedStringFormatter-DVCAZqcL.js → useLocalizedStringFormatter-DsZ-ZWSk.js} +29 -29
  103. package/{useSingleSelectListState-CmX9_L5H.js → useSingleSelectListState-BHTLh8Ob.js} +5 -5
  104. package/Button-CCevm2s3.js +0 -183
  105. package/Checkbox-CllWDBxF.js +0 -405
  106. package/Dialog-CLTyYwkS.js +0 -1889
  107. package/DragAndDrop-OTN7La7U.js +0 -42
  108. package/FocusScope-BR0SJ-cZ.js +0 -512
  109. package/Form-DXLoQL91.js +0 -240
  110. package/Group-DPMuN3h8.js +0 -44
  111. package/Label-C18A_4Z5.js +0 -69
  112. package/Link-BU1h3K2a.js +0 -77
  113. package/ListBox-D21tdwTs.js +0 -463
  114. package/ListKeyboardDelegate-DxMjfMsI.js +0 -172
  115. package/SelectionManager-D4WtKtey.js +0 -988
  116. package/Separator-DLUHK9vv.js +0 -48
  117. package/Tag-CEd6WWSc.js +0 -725
  118. package/Text-DGLaY3HR.js +0 -17
  119. package/TextField-C_hq9WeT.js +0 -226
  120. package/TextField.module-Cwq1FAm7.js +0 -141
  121. package/index-CEg5vZQH.js +0 -132
  122. package/index-CgfokhRq.js +0 -674
  123. package/useFocusRing-D97-G3fT.js +0 -1324
  124. package/useHasTabbableChild-DeuCnGGv.js +0 -34
  125. package/useListState-DSOTbsL3.js +0 -119
@@ -1,463 +0,0 @@
1
- import { $ as te, c as re, d as le, a as N, e as ie } from "./Collection-B3xUVWPF.js";
2
- import { n as T, f as de, k as j, e as E, y as W, B as ne, C as se, D as ce, b as G, E as q, p as ue, i as J, d as C, x as Q, a as fe, c as pe, v as be } from "./useFocusRing-D97-G3fT.js";
3
- import { $ as _, a as $e, b as ve, c as X } from "./DragAndDrop-OTN7La7U.js";
4
- import { $ as ge, a as he, b as me, c as De } from "./Separator-DLUHK9vv.js";
5
- import { $ as Pe } from "./Text-DGLaY3HR.js";
6
- import c, { forwardRef as Y, useContext as m, useEffect as Z, createContext as ee, useMemo as xe, useRef as z } from "react";
7
- import { f as ye } from "./SelectionManager-D4WtKtey.js";
8
- import { c as Se } from "./Label-C18A_4Z5.js";
9
- import { $ as ke } from "./useListState-DSOTbsL3.js";
10
- import { $ as Be } from "./context-ScOIq_Gu.js";
11
- import { $ as Fe, a as we } from "./ListKeyboardDelegate-DxMjfMsI.js";
12
- import { a as He } from "./FocusScope-BR0SJ-cZ.js";
13
- const K = /* @__PURE__ */ new WeakMap();
14
- function Ee(e) {
15
- return typeof e == "string" ? e.replace(/\s*/g, "") : "" + e;
16
- }
17
- function Me(e, o) {
18
- let r = K.get(e);
19
- if (!r) throw new Error("Unknown list");
20
- return `${r.id}-option-${Ee(o)}`;
21
- }
22
- function Ve(e, o, r) {
23
- let a = T(e, {
24
- labelable: !0
25
- }), i = e.selectionBehavior || "toggle", l = e.linkBehavior || (i === "replace" ? "action" : "override");
26
- i === "toggle" && l === "action" && (l = "override");
27
- let { listProps: t } = ge({
28
- ...e,
29
- ref: r,
30
- selectionManager: o.selectionManager,
31
- collection: o.collection,
32
- disabledKeys: o.disabledKeys,
33
- linkBehavior: l
34
- }), { focusWithinProps: d } = de({
35
- onFocusWithin: e.onFocus,
36
- onBlurWithin: e.onBlur,
37
- onFocusWithinChange: e.onFocusChange
38
- }), s = j(e.id);
39
- K.set(o, {
40
- id: s,
41
- shouldUseVirtualFocus: e.shouldUseVirtualFocus,
42
- shouldSelectOnPressUp: e.shouldSelectOnPressUp,
43
- shouldFocusOnHover: e.shouldFocusOnHover,
44
- isVirtualized: e.isVirtualized,
45
- onAction: e.onAction,
46
- linkBehavior: l
47
- });
48
- let { labelProps: f, fieldProps: p } = Se({
49
- ...e,
50
- id: s,
51
- // listbox is not an HTML input element so it
52
- // shouldn't be labeled by a <label> element.
53
- labelElementType: "span"
54
- });
55
- return {
56
- labelProps: f,
57
- listBoxProps: E(a, d, o.selectionManager.selectionMode === "multiple" ? {
58
- "aria-multiselectable": "true"
59
- } : {}, {
60
- role: "listbox",
61
- ...E(p, t)
62
- })
63
- };
64
- }
65
- function Ie(e, o, r) {
66
- var a, i;
67
- let { key: l } = e, t = K.get(o);
68
- var d;
69
- let s = (d = e.isDisabled) !== null && d !== void 0 ? d : o.selectionManager.isDisabled(l);
70
- var f;
71
- let p = (f = e.isSelected) !== null && f !== void 0 ? f : o.selectionManager.isSelected(l);
72
- var v;
73
- let u = (v = e.shouldSelectOnPressUp) !== null && v !== void 0 ? v : t == null ? void 0 : t.shouldSelectOnPressUp;
74
- var g;
75
- let S = (g = e.shouldFocusOnHover) !== null && g !== void 0 ? g : t == null ? void 0 : t.shouldFocusOnHover;
76
- var $;
77
- let b = ($ = e.shouldUseVirtualFocus) !== null && $ !== void 0 ? $ : t == null ? void 0 : t.shouldUseVirtualFocus;
78
- var D;
79
- let P = (D = e.isVirtualized) !== null && D !== void 0 ? D : t == null ? void 0 : t.isVirtualized, k = W(), M = W(), x = {
80
- role: "option",
81
- "aria-disabled": s || void 0,
82
- "aria-selected": o.selectionManager.selectionMode !== "none" ? p : void 0
83
- };
84
- ne() && se() || (x["aria-label"] = e["aria-label"], x["aria-labelledby"] = k, x["aria-describedby"] = M);
85
- let n = o.collection.getItem(l);
86
- if (P) {
87
- let y = Number(n == null ? void 0 : n.index);
88
- x["aria-posinset"] = Number.isNaN(y) ? void 0 : y + 1, x["aria-setsize"] = he(o.collection);
89
- }
90
- let h = t != null && t.onAction ? () => {
91
- var y;
92
- return t == null || (y = t.onAction) === null || y === void 0 ? void 0 : y.call(t, l);
93
- } : void 0, { itemProps: B, isPressed: F, isFocused: w, hasAction: V, allowsSelection: U } = ye({
94
- selectionManager: o.selectionManager,
95
- key: l,
96
- ref: r,
97
- shouldSelectOnPressUp: u,
98
- allowsDifferentPressOrigin: u && S,
99
- isVirtualized: P,
100
- shouldUseVirtualFocus: b,
101
- isDisabled: s,
102
- onAction: h || !(n == null || (a = n.props) === null || a === void 0) && a.onAction ? ce(n == null || (i = n.props) === null || i === void 0 ? void 0 : i.onAction, h) : void 0,
103
- linkBehavior: t == null ? void 0 : t.linkBehavior
104
- }), { hoverProps: I } = G({
105
- isDisabled: s || !S,
106
- onHoverStart() {
107
- q() || (o.selectionManager.setFocused(!0), o.selectionManager.setFocusedKey(l));
108
- }
109
- }), H = T(n == null ? void 0 : n.props);
110
- delete H.id;
111
- let A = ue(n == null ? void 0 : n.props);
112
- return {
113
- optionProps: {
114
- ...x,
115
- ...E(H, B, I, A),
116
- id: Me(o, l)
117
- },
118
- labelProps: {
119
- id: k
120
- },
121
- descriptionProps: {
122
- id: M
123
- },
124
- isFocused: w,
125
- isFocusVisible: w && q(),
126
- isSelected: p,
127
- isDisabled: s,
128
- isPressed: F,
129
- allowsSelection: U,
130
- hasAction: V
131
- };
132
- }
133
- function Ae(e) {
134
- let { heading: o, "aria-label": r } = e, a = j();
135
- return {
136
- itemProps: {
137
- role: "presentation"
138
- },
139
- headingProps: o ? {
140
- // Techincally, listbox cannot contain headings according to ARIA.
141
- // We hide the heading from assistive technology, using role="presentation",
142
- // and only use it as a visual label for the nested group.
143
- id: a,
144
- role: "presentation"
145
- } : {},
146
- groupProps: {
147
- role: "group",
148
- "aria-label": r,
149
- "aria-labelledby": o ? a : void 0
150
- }
151
- };
152
- }
153
- const oe = /* @__PURE__ */ ee(null), L = /* @__PURE__ */ ee(null);
154
- function Te(e, o) {
155
- [e, o] = fe(e, o, oe);
156
- let r = m(L);
157
- return r ? /* @__PURE__ */ c.createElement(ae, {
158
- state: r,
159
- props: e,
160
- listBoxRef: o
161
- }) : /* @__PURE__ */ c.createElement(re, {
162
- content: /* @__PURE__ */ c.createElement(le, e)
163
- }, (a) => /* @__PURE__ */ c.createElement(Ce, {
164
- props: e,
165
- listBoxRef: o,
166
- collection: a
167
- }));
168
- }
169
- function Ce({ props: e, listBoxRef: o, collection: r }) {
170
- e = {
171
- ...e,
172
- collection: r,
173
- children: null,
174
- items: null
175
- };
176
- let { layoutDelegate: a } = m(N), i = ke({
177
- ...e,
178
- layoutDelegate: a
179
- });
180
- return /* @__PURE__ */ c.createElement(ae, {
181
- state: i,
182
- props: e,
183
- listBoxRef: o
184
- });
185
- }
186
- const Ze = /* @__PURE__ */ Y(Te);
187
- function ae({ state: e, props: o, listBoxRef: r }) {
188
- let { dragAndDropHooks: a, layout: i = "stack", orientation: l = "vertical" } = o, { collection: t, selectionManager: d } = e, s = !!(a != null && a.useDraggableCollectionState), f = !!(a != null && a.useDroppableCollectionState), { direction: p } = Be(), { disabledBehavior: v, disabledKeys: u } = d, g = Fe({
189
- usage: "search",
190
- sensitivity: "base"
191
- }), { isVirtualized: S, layoutDelegate: $, dropTargetDelegate: b, CollectionRoot: D } = m(N), P = xe(() => o.keyboardDelegate || new we({
192
- collection: t,
193
- collator: g,
194
- ref: r,
195
- disabledKeys: u,
196
- disabledBehavior: v,
197
- layout: i,
198
- orientation: l,
199
- direction: p,
200
- layoutDelegate: $
201
- }), [
202
- t,
203
- g,
204
- r,
205
- v,
206
- u,
207
- l,
208
- p,
209
- o.keyboardDelegate,
210
- i,
211
- $
212
- ]), { listBoxProps: k } = Ve({
213
- ...o,
214
- shouldSelectOnPressUp: s || o.shouldSelectOnPressUp,
215
- keyboardDelegate: P,
216
- isVirtualized: S
217
- }, e, r), M = z(s), x = z(f);
218
- Z(() => {
219
- M.current !== s && console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."), x.current !== f && console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.");
220
- }, [
221
- s,
222
- f
223
- ]);
224
- let n, h, B, F = !1, w = null, V = z(null);
225
- if (s && a) {
226
- n = a.useDraggableCollectionState({
227
- collection: t,
228
- selectionManager: d,
229
- preview: a.renderDragPreview ? V : void 0
230
- }), a.useDraggableCollection({}, n, r);
231
- let O = a.DragPreview;
232
- w = a.renderDragPreview ? /* @__PURE__ */ c.createElement(O, {
233
- ref: V
234
- }, a.renderDragPreview) : null;
235
- }
236
- if (f && a) {
237
- h = a.useDroppableCollectionState({
238
- collection: t,
239
- selectionManager: d
240
- });
241
- let O = a.dropTargetDelegate || b || new a.ListDropTargetDelegate(t, r, {
242
- orientation: l,
243
- layout: i,
244
- direction: p
245
- });
246
- B = a.useDroppableCollection({
247
- keyboardDelegate: P,
248
- dropTargetDelegate: O
249
- }, h, r), F = h.isDropTarget({
250
- type: "root"
251
- });
252
- }
253
- let { focusProps: U, isFocused: I, isFocusVisible: H } = pe(), A = {
254
- isDropTarget: F,
255
- isEmpty: e.collection.size === 0,
256
- isFocused: I,
257
- isFocusVisible: H,
258
- layout: o.layout || "stack",
259
- state: e
260
- }, y = C({
261
- className: o.className,
262
- style: o.style,
263
- defaultClassName: "react-aria-ListBox",
264
- values: A
265
- }), R = null;
266
- return e.collection.size === 0 && o.renderEmptyState && (R = /* @__PURE__ */ c.createElement("div", {
267
- // eslint-disable-next-line
268
- role: "option",
269
- style: {
270
- display: "contents"
271
- }
272
- }, o.renderEmptyState(A))), /* @__PURE__ */ c.createElement(He, null, /* @__PURE__ */ c.createElement("div", {
273
- ...T(o),
274
- ...E(k, U, B == null ? void 0 : B.collectionProps),
275
- ...y,
276
- ref: r,
277
- slot: o.slot || void 0,
278
- onScroll: o.onScroll,
279
- "data-drop-target": F || void 0,
280
- "data-empty": e.collection.size === 0 || void 0,
281
- "data-focused": I || void 0,
282
- "data-focus-visible": H || void 0,
283
- "data-layout": o.layout || "stack",
284
- "data-orientation": o.orientation || "vertical"
285
- }, /* @__PURE__ */ c.createElement(Q, {
286
- values: [
287
- [
288
- oe,
289
- o
290
- ],
291
- [
292
- L,
293
- e
294
- ],
295
- [
296
- _,
297
- {
298
- dragAndDropHooks: a,
299
- dragState: n,
300
- dropState: h
301
- }
302
- ],
303
- [
304
- me,
305
- {
306
- elementType: "div"
307
- }
308
- ],
309
- [
310
- $e,
311
- {
312
- render: Le
313
- }
314
- ],
315
- [
316
- ie,
317
- {
318
- name: "ListBoxSection",
319
- render: _e
320
- }
321
- ]
322
- ]
323
- }, /* @__PURE__ */ c.createElement(D, {
324
- collection: t,
325
- scrollRef: r,
326
- persistedKeys: ve(d, a, h),
327
- renderDropIndicator: X(a, h)
328
- })), R, w));
329
- }
330
- function _e(e, o, r, a = "react-aria-ListBoxSection") {
331
- let i = m(L), { dragAndDropHooks: l, dropState: t } = m(_), { CollectionBranch: d } = m(N), [s, f] = be();
332
- var p;
333
- let { headingProps: v, groupProps: u } = Ae({
334
- heading: f,
335
- "aria-label": (p = e["aria-label"]) !== null && p !== void 0 ? p : void 0
336
- }), g = C({
337
- defaultClassName: a,
338
- className: e.className,
339
- style: e.style,
340
- values: {}
341
- });
342
- return /* @__PURE__ */ c.createElement("section", {
343
- ...T(e),
344
- ...u,
345
- ...g,
346
- ref: o
347
- }, /* @__PURE__ */ c.createElement(De.Provider, {
348
- value: {
349
- ...v,
350
- ref: s
351
- }
352
- }, /* @__PURE__ */ c.createElement(d, {
353
- collection: i.collection,
354
- parent: r,
355
- renderDropIndicator: X(l, t)
356
- })));
357
- }
358
- const eo = /* @__PURE__ */ te("item", function(o, r, a) {
359
- let i = J(r), l = m(L), { dragAndDropHooks: t, dragState: d, dropState: s } = m(_), { optionProps: f, labelProps: p, descriptionProps: v, ...u } = Ie({
360
- key: a.key,
361
- "aria-label": o == null ? void 0 : o["aria-label"]
362
- }, l, i), { hoverProps: g, isHovered: S } = G({
363
- isDisabled: !u.allowsSelection && !u.hasAction,
364
- onHoverStart: a.props.onHoverStart,
365
- onHoverChange: a.props.onHoverChange,
366
- onHoverEnd: a.props.onHoverEnd
367
- }), $ = null;
368
- d && t && ($ = t.useDraggableItem({
369
- key: a.key
370
- }, d));
371
- let b = null;
372
- s && t && (b = t.useDroppableItem({
373
- target: {
374
- type: "item",
375
- key: a.key,
376
- dropPosition: "on"
377
- }
378
- }, s, i));
379
- let D = d && d.isDragging(a.key), P = C({
380
- ...o,
381
- id: void 0,
382
- children: o.children,
383
- defaultClassName: "react-aria-ListBoxItem",
384
- values: {
385
- ...u,
386
- isHovered: S,
387
- selectionMode: l.selectionManager.selectionMode,
388
- selectionBehavior: l.selectionManager.selectionBehavior,
389
- allowsDragging: !!d,
390
- isDragging: D,
391
- isDropTarget: b == null ? void 0 : b.isDropTarget
392
- }
393
- });
394
- Z(() => {
395
- a.textValue || console.warn("A `textValue` prop is required for <ListBoxItem> elements with non-plain text children in order to support accessibility features such as type to select.");
396
- }, [
397
- a.textValue
398
- ]);
399
- let k = o.href ? "a" : "div";
400
- return /* @__PURE__ */ c.createElement(k, {
401
- ...E(f, g, $ == null ? void 0 : $.dragProps, b == null ? void 0 : b.dropProps),
402
- ...P,
403
- ref: i,
404
- "data-allows-dragging": !!d || void 0,
405
- "data-selected": u.isSelected || void 0,
406
- "data-disabled": u.isDisabled || void 0,
407
- "data-hovered": S || void 0,
408
- "data-focused": u.isFocused || void 0,
409
- "data-focus-visible": u.isFocusVisible || void 0,
410
- "data-pressed": u.isPressed || void 0,
411
- "data-dragging": D || void 0,
412
- "data-drop-target": (b == null ? void 0 : b.isDropTarget) || void 0,
413
- "data-selection-mode": l.selectionManager.selectionMode === "none" ? void 0 : l.selectionManager.selectionMode
414
- }, /* @__PURE__ */ c.createElement(Q, {
415
- values: [
416
- [
417
- Pe,
418
- {
419
- slots: {
420
- label: p,
421
- description: v
422
- }
423
- }
424
- ]
425
- ]
426
- }, P.children));
427
- });
428
- function Le(e, o) {
429
- o = J(o);
430
- let { dragAndDropHooks: r, dropState: a } = m(_), { dropIndicatorProps: i, isHidden: l, isDropTarget: t } = r.useDropIndicator(e, a, o);
431
- return l ? null : /* @__PURE__ */ c.createElement(Oe, {
432
- ...e,
433
- dropIndicatorProps: i,
434
- isDropTarget: t,
435
- ref: o
436
- });
437
- }
438
- function Ue(e, o) {
439
- let { dropIndicatorProps: r, isDropTarget: a, ...i } = e, l = C({
440
- ...i,
441
- defaultClassName: "react-aria-DropIndicator",
442
- values: {
443
- isDropTarget: a
444
- }
445
- });
446
- return /* @__PURE__ */ c.createElement("div", {
447
- ...r,
448
- ...l,
449
- // eslint-disable-next-line
450
- role: "option",
451
- ref: o,
452
- "data-drop-target": a || void 0
453
- });
454
- }
455
- const Oe = /* @__PURE__ */ Y(Ue);
456
- export {
457
- L as $,
458
- oe as a,
459
- Ze as b,
460
- eo as c,
461
- K as d,
462
- Me as e
463
- };
@@ -1,172 +0,0 @@
1
- import { c as r } from "./SelectionManager-D4WtKtey.js";
2
- import { $ as u } from "./context-ScOIq_Gu.js";
3
- function d(o, t) {
4
- let e = o;
5
- for (r(e, t) && (e = e.parentElement); e && !r(e, t); ) e = e.parentElement;
6
- return e || document.scrollingElement || document.documentElement;
7
- }
8
- let a = /* @__PURE__ */ new Map();
9
- function f(o) {
10
- let { locale: t } = u(), e = t + (o ? Object.entries(o).sort((l, n) => l[0] < n[0] ? -1 : 1).join() : "");
11
- if (a.has(e)) return a.get(e);
12
- let i = new Intl.Collator(t, o);
13
- return a.set(e, i), i;
14
- }
15
- class h {
16
- getItemRect(t) {
17
- let e = this.ref.current;
18
- if (!e) return null;
19
- let i = t != null ? e.querySelector(`[data-key="${CSS.escape(t.toString())}"]`) : null;
20
- if (!i) return null;
21
- let l = e.getBoundingClientRect(), n = i.getBoundingClientRect();
22
- return {
23
- x: n.left - l.left + e.scrollLeft,
24
- y: n.top - l.top + e.scrollTop,
25
- width: n.width,
26
- height: n.height
27
- };
28
- }
29
- getContentSize() {
30
- let t = this.ref.current;
31
- var e, i;
32
- return {
33
- width: (e = t == null ? void 0 : t.scrollWidth) !== null && e !== void 0 ? e : 0,
34
- height: (i = t == null ? void 0 : t.scrollHeight) !== null && i !== void 0 ? i : 0
35
- };
36
- }
37
- getVisibleRect() {
38
- let t = this.ref.current;
39
- var e, i, l, n;
40
- return {
41
- x: (e = t == null ? void 0 : t.scrollLeft) !== null && e !== void 0 ? e : 0,
42
- y: (i = t == null ? void 0 : t.scrollTop) !== null && i !== void 0 ? i : 0,
43
- width: (l = t == null ? void 0 : t.offsetWidth) !== null && l !== void 0 ? l : 0,
44
- height: (n = t == null ? void 0 : t.offsetHeight) !== null && n !== void 0 ? n : 0
45
- };
46
- }
47
- constructor(t) {
48
- this.ref = t;
49
- }
50
- }
51
- class y {
52
- isDisabled(t) {
53
- var e;
54
- return this.disabledBehavior === "all" && (((e = t.props) === null || e === void 0 ? void 0 : e.isDisabled) || this.disabledKeys.has(t.key));
55
- }
56
- findNextNonDisabled(t, e) {
57
- let i = t;
58
- for (; i != null; ) {
59
- let l = this.collection.getItem(i);
60
- if ((l == null ? void 0 : l.type) === "item" && !this.isDisabled(l)) return i;
61
- i = e(i);
62
- }
63
- return null;
64
- }
65
- getNextKey(t) {
66
- let e = t;
67
- return e = this.collection.getKeyAfter(e), this.findNextNonDisabled(e, (i) => this.collection.getKeyAfter(i));
68
- }
69
- getPreviousKey(t) {
70
- let e = t;
71
- return e = this.collection.getKeyBefore(e), this.findNextNonDisabled(e, (i) => this.collection.getKeyBefore(i));
72
- }
73
- findKey(t, e, i) {
74
- let l = t, n = this.layoutDelegate.getItemRect(l);
75
- if (!n || l == null) return null;
76
- let s = n;
77
- do {
78
- if (l = e(l), l == null) break;
79
- n = this.layoutDelegate.getItemRect(l);
80
- } while (n && i(s, n) && l != null);
81
- return l;
82
- }
83
- isSameRow(t, e) {
84
- return t.y === e.y || t.x !== e.x;
85
- }
86
- isSameColumn(t, e) {
87
- return t.x === e.x || t.y !== e.y;
88
- }
89
- getKeyBelow(t) {
90
- return this.layout === "grid" && this.orientation === "vertical" ? this.findKey(t, (e) => this.getNextKey(e), this.isSameRow) : this.getNextKey(t);
91
- }
92
- getKeyAbove(t) {
93
- return this.layout === "grid" && this.orientation === "vertical" ? this.findKey(t, (e) => this.getPreviousKey(e), this.isSameRow) : this.getPreviousKey(t);
94
- }
95
- getNextColumn(t, e) {
96
- return e ? this.getPreviousKey(t) : this.getNextKey(t);
97
- }
98
- getKeyRightOf(t) {
99
- let e = this.direction === "ltr" ? "getKeyRightOf" : "getKeyLeftOf";
100
- return this.layoutDelegate[e] ? (t = this.layoutDelegate[e](t), this.findNextNonDisabled(t, (i) => this.layoutDelegate[e](i))) : this.layout === "grid" ? this.orientation === "vertical" ? this.getNextColumn(t, this.direction === "rtl") : this.findKey(t, (i) => this.getNextColumn(i, this.direction === "rtl"), this.isSameColumn) : this.orientation === "horizontal" ? this.getNextColumn(t, this.direction === "rtl") : null;
101
- }
102
- getKeyLeftOf(t) {
103
- let e = this.direction === "ltr" ? "getKeyLeftOf" : "getKeyRightOf";
104
- return this.layoutDelegate[e] ? (t = this.layoutDelegate[e](t), this.findNextNonDisabled(t, (i) => this.layoutDelegate[e](i))) : this.layout === "grid" ? this.orientation === "vertical" ? this.getNextColumn(t, this.direction === "ltr") : this.findKey(t, (i) => this.getNextColumn(i, this.direction === "ltr"), this.isSameColumn) : this.orientation === "horizontal" ? this.getNextColumn(t, this.direction === "ltr") : null;
105
- }
106
- getFirstKey() {
107
- let t = this.collection.getFirstKey();
108
- return this.findNextNonDisabled(t, (e) => this.collection.getKeyAfter(e));
109
- }
110
- getLastKey() {
111
- let t = this.collection.getLastKey();
112
- return this.findNextNonDisabled(t, (e) => this.collection.getKeyBefore(e));
113
- }
114
- getKeyPageAbove(t) {
115
- let e = this.ref.current, i = this.layoutDelegate.getItemRect(t);
116
- if (!i) return null;
117
- if (e && !r(e)) return this.getFirstKey();
118
- let l = t;
119
- if (this.orientation === "horizontal") {
120
- let n = Math.max(0, i.x + i.width - this.layoutDelegate.getVisibleRect().width);
121
- for (; i && i.x > n && l != null; )
122
- l = this.getKeyAbove(l), i = l == null ? null : this.layoutDelegate.getItemRect(l);
123
- } else {
124
- let n = Math.max(0, i.y + i.height - this.layoutDelegate.getVisibleRect().height);
125
- for (; i && i.y > n && l != null; )
126
- l = this.getKeyAbove(l), i = l == null ? null : this.layoutDelegate.getItemRect(l);
127
- }
128
- return l ?? this.getFirstKey();
129
- }
130
- getKeyPageBelow(t) {
131
- let e = this.ref.current, i = this.layoutDelegate.getItemRect(t);
132
- if (!i) return null;
133
- if (e && !r(e)) return this.getLastKey();
134
- let l = t;
135
- if (this.orientation === "horizontal") {
136
- let n = Math.min(this.layoutDelegate.getContentSize().width, i.y - i.width + this.layoutDelegate.getVisibleRect().width);
137
- for (; i && i.x < n && l != null; )
138
- l = this.getKeyBelow(l), i = l == null ? null : this.layoutDelegate.getItemRect(l);
139
- } else {
140
- let n = Math.min(this.layoutDelegate.getContentSize().height, i.y - i.height + this.layoutDelegate.getVisibleRect().height);
141
- for (; i && i.y < n && l != null; )
142
- l = this.getKeyBelow(l), i = l == null ? null : this.layoutDelegate.getItemRect(l);
143
- }
144
- return l ?? this.getLastKey();
145
- }
146
- getKeyForSearch(t, e) {
147
- if (!this.collator) return null;
148
- let i = this.collection, l = e || this.getFirstKey();
149
- for (; l != null; ) {
150
- let n = i.getItem(l);
151
- if (!n) return null;
152
- let s = n.textValue.slice(0, t.length);
153
- if (n.textValue && this.collator.compare(s, t) === 0) return l;
154
- l = this.getNextKey(l);
155
- }
156
- return null;
157
- }
158
- constructor(...t) {
159
- if (t.length === 1) {
160
- let e = t[0];
161
- this.collection = e.collection, this.ref = e.ref, this.collator = e.collator, this.disabledKeys = e.disabledKeys || /* @__PURE__ */ new Set(), this.disabledBehavior = e.disabledBehavior || "all", this.orientation = e.orientation || "vertical", this.direction = e.direction, this.layout = e.layout || "stack", this.layoutDelegate = e.layoutDelegate || new h(e.ref);
162
- } else
163
- this.collection = t[0], this.disabledKeys = t[1], this.ref = t[2], this.collator = t[3], this.layout = "stack", this.orientation = "vertical", this.disabledBehavior = "all", this.layoutDelegate = new h(this.ref);
164
- this.layout === "stack" && this.orientation === "vertical" && (this.getKeyLeftOf = void 0, this.getKeyRightOf = void 0);
165
- }
166
- }
167
- export {
168
- f as $,
169
- y as a,
170
- d as b,
171
- h as c
172
- };