@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
|
@@ -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
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { h as s, i as n, e as d, j as i } from "./useFocusRing-D97-G3fT.js";
|
|
2
|
-
import c, { useRef as b, useContext as l, useEffect as u, useMemo as $ } from "react";
|
|
3
|
-
const h = /* @__PURE__ */ c.forwardRef(({ children: t, ...a }, r) => {
|
|
4
|
-
let o = b(!1), e = l(s);
|
|
5
|
-
r = n(r || (e == null ? void 0 : e.ref));
|
|
6
|
-
let f = d(e || {}, {
|
|
7
|
-
...a,
|
|
8
|
-
ref: r,
|
|
9
|
-
register() {
|
|
10
|
-
o.current = !0, e && e.register();
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
return i(e, r), u(() => {
|
|
14
|
-
o.current || (console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component."), o.current = !0);
|
|
15
|
-
}, []), /* @__PURE__ */ c.createElement(s.Provider, {
|
|
16
|
-
value: f
|
|
17
|
-
}, t);
|
|
18
|
-
});
|
|
19
|
-
function m({ children: t }) {
|
|
20
|
-
let a = $(() => ({
|
|
21
|
-
register: () => {
|
|
22
|
-
}
|
|
23
|
-
}), []);
|
|
24
|
-
return /* @__PURE__ */ c.createElement(s.Provider, {
|
|
25
|
-
value: a
|
|
26
|
-
}, t);
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
h as $,
|
|
30
|
-
m as a
|
|
31
|
-
};
|