@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.
- package/Button-DL6nqUco.js +182 -0
- package/CHANGELOG.md +15 -0
- package/Checkbox-q0dugR2t.js +402 -0
- package/{Collection-B3xUVWPF.js → Collection-KMFfVuzU.js} +179 -152
- package/Dialog-D6Bqrpn-.js +1952 -0
- package/Disclosure-dAZYXyTH.js +225 -0
- package/Disclosure.css +1 -0
- package/DragAndDrop-B0T3WgjL.js +40 -0
- package/FocusScope-B7CkxXNC.js +513 -0
- package/{Form-DXLoQL91.js → Form-BWBjJC6v.js} +79 -81
- package/Group-D7_8007y.js +42 -0
- package/Heading-RCRHv6hd.js +15 -0
- package/{Hidden-BQWDvze4.js → Hidden-CVlUgUJM.js} +1 -1
- package/Link-BnQvB-hH.js +75 -0
- package/ListBox-DBBiqvcR.js +474 -0
- package/ListKeyboardDelegate-gCXy-Xnn.js +172 -0
- package/PressResponder-B4g56kDz.js +31 -0
- package/README.md +21 -3
- package/{RSPContexts-EOiWkKOf.js → RSPContexts-BW2SEIqe.js} +2 -2
- package/SelectionManager-BfXUE1qg.js +1031 -0
- package/Separator-BBX9m2O2.js +49 -0
- package/Tag-DWt0koFj.js +728 -0
- package/Text-BCF0xvqL.js +15 -0
- package/TextField-CX4eOQf6.js +225 -0
- package/TextField.module-DdICj682.js +143 -0
- package/{VisuallyHidden-B_XzVvlX.js → VisuallyHidden-Dhr5caPC.js} +1 -1
- package/accordion/Accordion.d.ts +8 -8
- package/accordion/AccordionItem.d.ts +11 -3
- package/accordion/index.d.ts +0 -3
- package/{context-ScOIq_Gu.js → context-BpJLnOuu.js} +11 -11
- package/global.css +1 -0
- package/index-B-jHjTDC.js +120 -0
- package/{index-CorR1LBD.js → index-BPdc9gJ8.js} +3 -3
- package/{index-Dl1Q-tbj.js → index-KSgQWWiy.js} +5315 -5315
- package/index.d.ts +1 -0
- package/index.js +105 -112
- package/index10.js +1 -1
- package/index11.js +1 -1
- package/index12.js +1 -1
- package/index13.js +1 -1
- package/index14.js +1 -1
- package/index15.js +2 -2
- package/index16.js +2 -2
- package/index17.js +1 -1
- package/index18.js +1 -1
- package/index19.js +2 -2
- package/index2.js +1 -1
- package/index20.js +2 -2
- package/index21.js +1 -1
- package/index22.js +1 -1
- package/index23.js +1 -1
- package/index24.js +1 -1
- package/index25.js +2 -2
- package/index26.js +2 -2
- package/index27.js +2 -2
- package/index28.js +1 -1
- package/index29.js +2 -8
- package/index3.js +2 -4
- package/index30.js +17 -16
- package/index31.js +3 -3
- package/index32.js +3 -3
- package/index33.js +2 -2
- package/index34.js +3 -3
- package/index35.js +1 -1
- package/index36.js +2 -2
- package/index37.js +2 -2
- package/index38.js +2 -2
- package/index39.js +2 -2
- package/index4.js +1 -1
- package/index40.js +19 -12
- package/index41.js +61 -14
- package/index42.js +44 -22
- package/index43.js +13 -11
- package/index44.js +25 -4
- package/index45.js +16 -51
- package/index46.js +19 -16
- package/index47.js +49 -27
- package/index48.js +5 -18
- package/index49.js +25 -21
- package/index5.js +1 -1
- package/index50.js +16 -47
- package/index51.js +7 -3
- package/index52.js +18 -18
- package/index53.js +16 -16
- package/index54.js +6 -4
- package/index55.js +8 -21
- package/index56.js +13 -16
- package/index57.js +6 -8
- package/index58.js +6 -9
- package/index59.js +17 -13
- package/index6.js +1 -1
- package/index60.js +20 -7
- package/index61.js +59 -7
- package/index62.js +13 -17
- package/index63.js +9 -20
- package/index64.js +40 -48
- package/index65.js +85 -15
- package/index66.js +74 -11
- package/index67.js +23 -62
- package/index68.js +64 -80
- package/index69.js +68 -62
- package/index7.js +1 -1
- package/index70.js +138 -22
- package/index71.js +66 -65
- package/index72.js +40 -78
- package/index73.js +75 -133
- package/index74.js +69 -68
- package/index75.js +96 -34
- package/index76.js +258 -65
- package/index77.js +715 -63
- package/index78.js +478 -93
- package/index79.js +303 -263
- package/index8.js +1 -1
- package/index80.js +343 -678
- package/index81.js +242 -481
- package/index82.js +1329 -282
- package/index83.js +968 -350
- package/index84.js +343 -211
- package/index85.js +2025 -1288
- package/index86.js +2313 -954
- package/index87.js +6782 -339
- package/index88.js +15 -2103
- package/index89.js +12 -2369
- package/index9.js +1 -1
- package/index90.js +4 -6832
- package/index91.js +7 -15
- package/link/Link.d.ts +2 -2
- package/link-button/LinkButton.d.ts +1 -1
- package/package.json +7 -1
- package/{react.esm-D8HpDGKP.js → react.esm-sMU8Z7rL.js} +1872 -1872
- package/textfield/index.d.ts +0 -2
- package/useControlledState-Kv9K2AYu.js +30 -0
- package/{useDescription-D4_zk_sA.js → useDescription-B7stiK3j.js} +1 -1
- package/useEvent-Xk5kn5Ns.js +21 -0
- package/useField-DMzJIIN4.js +67 -0
- package/{useFilter-BnJDBCkt.js → useFilter-Bt9dbV1U.js} +1 -1
- package/useFocusRing-9PXyKy2A.js +1297 -0
- package/{useFocusable-C-N9wcwm.js → useFocusable-CcEBZe40.js} +11 -8
- package/{useGridSelectionCheckbox-i1rsjlC-.js → useGridSelectionCheckbox-DYgEnElE.js} +3 -3
- package/useHasTabbableChild-D6DwR81L.js +34 -0
- package/{useHighlightSelectionDescription-JVx2MW_e.js → useHighlightSelectionDescription-WYAbP4No.js} +19 -19
- package/useLabels-9zaZ9oa0.js +17 -0
- package/useListState-BfTeKTk5.js +119 -0
- package/{useLocalizedStringFormatter-DVCAZqcL.js → useLocalizedStringFormatter-BlCbn-hX.js} +29 -29
- package/{useSingleSelectListState-CmX9_L5H.js → useSingleSelectListState-DPkaL0la.js} +5 -5
- package/Button-CCevm2s3.js +0 -183
- package/Checkbox-CllWDBxF.js +0 -405
- package/Dialog-CLTyYwkS.js +0 -1889
- package/DragAndDrop-OTN7La7U.js +0 -42
- package/FocusScope-BR0SJ-cZ.js +0 -512
- package/Group-DPMuN3h8.js +0 -44
- package/Label-C18A_4Z5.js +0 -69
- package/Link-BU1h3K2a.js +0 -77
- package/ListBox-D21tdwTs.js +0 -463
- package/ListKeyboardDelegate-DxMjfMsI.js +0 -172
- package/PressResponder-DP8ZDNGy.js +0 -31
- package/SelectionManager-D4WtKtey.js +0 -988
- package/Separator-DLUHK9vv.js +0 -48
- package/Tag-CEd6WWSc.js +0 -725
- package/Text-DGLaY3HR.js +0 -17
- package/TextField-C_hq9WeT.js +0 -226
- package/TextField.module-Cwq1FAm7.js +0 -141
- package/accordion/AccordionContent.d.ts +0 -3
- package/accordion/AccordionTagContext.d.ts +0 -3
- package/accordion/AccordionTrigger.d.ts +0 -3
- package/index-CEg5vZQH.js +0 -132
- package/index-CgfokhRq.js +0 -674
- package/index.css +0 -1
- package/index92.js +0 -14
- package/index93.js +0 -6
- package/index94.js +0 -9
- package/useControlledState-S_TYcV_c.js +0 -45
- package/useFocusRing-D97-G3fT.js +0 -1324
- package/useHasTabbableChild-DeuCnGGv.js +0 -34
- package/useListState-DSOTbsL3.js +0 -119
package/Link-BU1h3K2a.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { m as k, n as h, e as b, o as C, p as D, q as T, a as E, b as F, c as H, d as g } from "./useFocusRing-D97-G3fT.js";
|
|
2
|
-
import y, { createContext as L, forwardRef as _ } from "react";
|
|
3
|
-
import { $ as S } from "./useFocusable-C-N9wcwm.js";
|
|
4
|
-
function V(e, r) {
|
|
5
|
-
let {
|
|
6
|
-
elementType: n = "a",
|
|
7
|
-
onPress: l,
|
|
8
|
-
onPressStart: i,
|
|
9
|
-
onPressEnd: f,
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
onClick: a,
|
|
12
|
-
isDisabled: d,
|
|
13
|
-
...o
|
|
14
|
-
} = e, t = {};
|
|
15
|
-
n !== "a" && (t = {
|
|
16
|
-
role: "link",
|
|
17
|
-
tabIndex: d ? void 0 : 0
|
|
18
|
-
});
|
|
19
|
-
let { focusableProps: c } = S(e, r), { pressProps: u, isPressed: p } = k({
|
|
20
|
-
onPress: l,
|
|
21
|
-
onPressStart: i,
|
|
22
|
-
onPressEnd: f,
|
|
23
|
-
isDisabled: d,
|
|
24
|
-
ref: r
|
|
25
|
-
}), x = h(o, {
|
|
26
|
-
labelable: !0
|
|
27
|
-
}), m = b(c, u), P = C(), v = D(e);
|
|
28
|
-
return {
|
|
29
|
-
isPressed: p,
|
|
30
|
-
linkProps: b(x, v, {
|
|
31
|
-
...m,
|
|
32
|
-
...t,
|
|
33
|
-
"aria-disabled": d || void 0,
|
|
34
|
-
"aria-current": e["aria-current"],
|
|
35
|
-
onClick: (s) => {
|
|
36
|
-
var $;
|
|
37
|
-
($ = u.onClick) === null || $ === void 0 || $.call(u, s), a && (a(s), console.warn("onClick is deprecated, please use onPress")), !P.isNative && s.currentTarget instanceof HTMLAnchorElement && s.currentTarget.href && // If props are applied to a router Link component, it may have already prevented default.
|
|
38
|
-
!s.isDefaultPrevented() && T(s.currentTarget, s) && e.href && (s.preventDefault(), P.open(s.currentTarget, s, e.href, e.routerOptions));
|
|
39
|
-
}
|
|
40
|
-
})
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
const w = /* @__PURE__ */ L(null);
|
|
44
|
-
function N(e, r) {
|
|
45
|
-
[e, r] = E(e, r, w);
|
|
46
|
-
let n = e.href && !e.isDisabled ? "a" : "span", { linkProps: l, isPressed: i } = V({
|
|
47
|
-
...e,
|
|
48
|
-
elementType: n
|
|
49
|
-
}, r), { hoverProps: f, isHovered: a } = F(e), { focusProps: d, isFocused: o, isFocusVisible: t } = H(), c = g({
|
|
50
|
-
...e,
|
|
51
|
-
defaultClassName: "react-aria-Link",
|
|
52
|
-
values: {
|
|
53
|
-
isCurrent: !!e["aria-current"],
|
|
54
|
-
isDisabled: e.isDisabled || !1,
|
|
55
|
-
isPressed: i,
|
|
56
|
-
isHovered: a,
|
|
57
|
-
isFocused: o,
|
|
58
|
-
isFocusVisible: t
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
return /* @__PURE__ */ y.createElement(n, {
|
|
62
|
-
ref: r,
|
|
63
|
-
slot: e.slot || void 0,
|
|
64
|
-
...b(c, l, f, d),
|
|
65
|
-
"data-focused": o || void 0,
|
|
66
|
-
"data-hovered": a || void 0,
|
|
67
|
-
"data-pressed": i || void 0,
|
|
68
|
-
"data-focus-visible": t || void 0,
|
|
69
|
-
"data-current": !!e["aria-current"] || void 0,
|
|
70
|
-
"data-disabled": e.isDisabled || void 0
|
|
71
|
-
}, c.children);
|
|
72
|
-
}
|
|
73
|
-
const A = /* @__PURE__ */ _(N);
|
|
74
|
-
export {
|
|
75
|
-
A as $,
|
|
76
|
-
w as a
|
|
77
|
-
};
|
package/ListBox-D21tdwTs.js
DELETED
|
@@ -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
|
-
};
|