@midas-ds/components 1.0.3 → 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-B4vMZbC6.js → Button-DL6nqUco.js} +22 -22
- package/CHANGELOG.md +6 -1
- package/{Checkbox-DnKWanep.js → Checkbox-q0dugR2t.js} +8 -8
- package/{Collection-COLWgm24.js → Collection-KMFfVuzU.js} +2 -2
- package/{Dialog-Cb6toyXO.js → Dialog-D6Bqrpn-.js} +170 -169
- package/Disclosure-dAZYXyTH.js +225 -0
- package/Disclosure.css +1 -0
- package/{FocusScope-C8i7CH6y.js → FocusScope-B7CkxXNC.js} +1 -1
- package/{Form-BQQs3jUk.js → Form-BWBjJC6v.js} +42 -42
- package/{Group-CdwXhx8Q.js → Group-D7_8007y.js} +10 -10
- package/Heading-RCRHv6hd.js +15 -0
- package/{Hidden-DngIphiL.js → Hidden-CVlUgUJM.js} +1 -1
- package/{Link-iAZLB3RI.js → Link-BnQvB-hH.js} +8 -8
- package/{ListBox-BKWkIIm6.js → ListBox-DBBiqvcR.js} +72 -72
- package/{ListKeyboardDelegate-BH-K5hyq.js → ListKeyboardDelegate-gCXy-Xnn.js} +2 -2
- package/{PressResponder-Cz-TRBHO.js → PressResponder-B4g56kDz.js} +5 -5
- package/{RSPContexts-EOiWkKOf.js → RSPContexts-BW2SEIqe.js} +2 -2
- package/{SelectionManager-8o40f7mx.js → SelectionManager-BfXUE1qg.js} +113 -129
- package/{Separator-BlvmQjwz.js → Separator-BBX9m2O2.js} +2 -2
- package/{Tag--W5TgxmK.js → Tag-DWt0koFj.js} +74 -74
- package/Text-BCF0xvqL.js +15 -0
- package/{TextField-DeK_yiK-.js → TextField-CX4eOQf6.js} +33 -33
- package/{TextField.module-0-u4LVPp.js → TextField.module-DdICj682.js} +7 -7
- package/{VisuallyHidden-CFx06Bae.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-Bnqknrce.js → context-BpJLnOuu.js} +11 -11
- package/global.css +1 -0
- package/index.d.ts +1 -0
- package/index.js +105 -110
- 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 +1 -1
- package/index30.js +17 -16
- package/index31.js +1 -1
- package/index32.js +1 -1
- package/index33.js +1 -1
- package/index34.js +2 -2
- package/index36.js +1 -1
- package/index37.js +1 -1
- package/index38.js +1 -1
- package/index39.js +1 -1
- 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 +5 -3
- package/index55.js +7 -20
- package/index56.js +13 -16
- package/index57.js +6 -8
- package/index58.js +5 -8
- 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 +38 -46
- 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 -677
- package/index81.js +242 -479
- package/index82.js +1332 -282
- package/index83.js +966 -346
- package/index84.js +344 -210
- package/index85.js +2024 -1286
- package/index86.js +2314 -955
- package/index87.js +6785 -340
- package/index88.js +15 -2099
- package/index89.js +12 -2367
- package/index9.js +1 -1
- package/index90.js +4 -6834
- package/index91.js +7 -15
- package/package.json +1 -1
- package/useControlledState-Kv9K2AYu.js +30 -0
- package/{useDescription-BPs7eRff.js → useDescription-B7stiK3j.js} +1 -1
- package/useEvent-Xk5kn5Ns.js +21 -0
- package/{useField-Dz62UHCP.js → useField-DMzJIIN4.js} +5 -5
- package/{useFilter-ViwzkzZe.js → useFilter-Bt9dbV1U.js} +1 -1
- package/{useFocusRing-BKGhL91C.js → useFocusRing-9PXyKy2A.js} +26 -26
- package/{useFocusable-CRSmYEQc.js → useFocusable-CcEBZe40.js} +1 -1
- package/{useGridSelectionCheckbox-CVEvUCJL.js → useGridSelectionCheckbox-DYgEnElE.js} +3 -3
- package/{useHasTabbableChild-C8y4fwiY.js → useHasTabbableChild-D6DwR81L.js} +5 -5
- package/{useHighlightSelectionDescription-CD74uzLh.js → useHighlightSelectionDescription-WYAbP4No.js} +4 -4
- package/useLabels-9zaZ9oa0.js +17 -0
- package/{useListState-DKnP5TB5.js → useListState-BfTeKTk5.js} +1 -1
- package/{useLocalizedStringFormatter-DsZ-ZWSk.js → useLocalizedStringFormatter-BlCbn-hX.js} +1 -1
- package/{useSingleSelectListState-BHTLh8Ob.js → useSingleSelectListState-DPkaL0la.js} +2 -2
- package/Text-CQPW6xs7.js +0 -15
- package/accordion/AccordionContent.d.ts +0 -3
- package/accordion/AccordionTagContext.d.ts +0 -3
- package/accordion/AccordionTrigger.d.ts +0 -3
- package/index-DK9ZACEc.js +0 -642
- package/index.css +0 -1
- package/index92.js +0 -14
- package/index93.js +0 -6
- package/index94.js +0 -9
- package/useControlledState-DrAoodI6.js +0 -45
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { a as y } from "./Button-DL6nqUco.js";
|
|
2
|
+
import { k as b, g as k, l as A, d as x, o as g, a as V, c as P, B as D, E as I, F as B, e as N } from "./useFocusRing-9PXyKy2A.js";
|
|
3
|
+
import { flushSync as G } from "react-dom";
|
|
4
|
+
import c, { useRef as q, useCallback as u, useEffect as v, useMemo as _, forwardRef as h, useContext as w, createContext as p } from "react";
|
|
5
|
+
import { $ as z } from "./useEvent-Xk5kn5Ns.js";
|
|
6
|
+
import { $ as S } from "./useControlledState-Kv9K2AYu.js";
|
|
7
|
+
import './Disclosure.css';const O = '"../theme/tokens.css"', j = '"Inter", sans-serif', H = "#f2f2f2", J = "#e6e6e6", L = "#d9d9d9", Q = "#000000", U = "300ms", X = "400", Y = "500", Z = "_root_6hoor_4", ee = "_contained_6hoor_12", ae = "_triggerText_6hoor_27", te = "_trigger_6hoor_27", de = "_item_6hoor_78", ne = "_panel_6hoor_84", se = "_panel0_6hoor_84", ie = "_content_6hoor_94", le = "_header_6hoor_98", me = {
|
|
8
|
+
tokens: O,
|
|
9
|
+
display: j,
|
|
10
|
+
gray10: H,
|
|
11
|
+
gray20: J,
|
|
12
|
+
gray30: L,
|
|
13
|
+
black: Q,
|
|
14
|
+
normalTransition: U,
|
|
15
|
+
regularWeight: X,
|
|
16
|
+
mediumWeight: Y,
|
|
17
|
+
root: Z,
|
|
18
|
+
contained: ee,
|
|
19
|
+
triggerText: ae,
|
|
20
|
+
trigger: te,
|
|
21
|
+
item: de,
|
|
22
|
+
panel: ne,
|
|
23
|
+
panel0: se,
|
|
24
|
+
content: ie,
|
|
25
|
+
header: le
|
|
26
|
+
};
|
|
27
|
+
function oe(n, e, t) {
|
|
28
|
+
let { isDisabled: a } = n, d = b(), s = b(), o = !k() && "onbeforematch" in document.body, i = q(null), f = u(() => {
|
|
29
|
+
i.current = requestAnimationFrame(() => {
|
|
30
|
+
t.current && t.current.setAttribute("hidden", "until-found");
|
|
31
|
+
}), G(() => {
|
|
32
|
+
e.toggle();
|
|
33
|
+
});
|
|
34
|
+
}, [
|
|
35
|
+
t,
|
|
36
|
+
e
|
|
37
|
+
]);
|
|
38
|
+
return z(t, "beforematch", o ? f : null), A(() => {
|
|
39
|
+
i.current && cancelAnimationFrame(i.current), o && t.current && !a && (e.isExpanded ? t.current.removeAttribute("hidden") : t.current.setAttribute("hidden", "until-found"));
|
|
40
|
+
}, [
|
|
41
|
+
a,
|
|
42
|
+
t,
|
|
43
|
+
e.isExpanded,
|
|
44
|
+
o
|
|
45
|
+
]), v(() => () => {
|
|
46
|
+
i.current && cancelAnimationFrame(i.current);
|
|
47
|
+
}, []), {
|
|
48
|
+
buttonProps: {
|
|
49
|
+
id: d,
|
|
50
|
+
"aria-expanded": e.isExpanded,
|
|
51
|
+
"aria-controls": s,
|
|
52
|
+
onPress: (r) => {
|
|
53
|
+
!a && r.pointerType !== "keyboard" && e.toggle();
|
|
54
|
+
},
|
|
55
|
+
isDisabled: a,
|
|
56
|
+
onPressStart(r) {
|
|
57
|
+
r.pointerType === "keyboard" && !a && e.toggle();
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
panelProps: {
|
|
61
|
+
id: s,
|
|
62
|
+
// This can be overridden at the panel element level.
|
|
63
|
+
role: "group",
|
|
64
|
+
"aria-labelledby": d,
|
|
65
|
+
"aria-hidden": !e.isExpanded,
|
|
66
|
+
hidden: o ? !0 : !e.isExpanded
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function re(n) {
|
|
71
|
+
let [e, t] = S(n.isExpanded, n.defaultExpanded || !1, n.onExpandedChange);
|
|
72
|
+
const a = u(() => {
|
|
73
|
+
t(!0);
|
|
74
|
+
}, [
|
|
75
|
+
t
|
|
76
|
+
]), d = u(() => {
|
|
77
|
+
t(!1);
|
|
78
|
+
}, [
|
|
79
|
+
t
|
|
80
|
+
]), s = u(() => {
|
|
81
|
+
t(!e);
|
|
82
|
+
}, [
|
|
83
|
+
t,
|
|
84
|
+
e
|
|
85
|
+
]);
|
|
86
|
+
return {
|
|
87
|
+
isExpanded: e,
|
|
88
|
+
setExpanded: t,
|
|
89
|
+
expand: a,
|
|
90
|
+
collapse: d,
|
|
91
|
+
toggle: s
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function ce(n) {
|
|
95
|
+
let { allowsMultipleExpanded: e = !1, isDisabled: t = !1 } = n, [a, d] = S(_(() => n.expandedKeys ? new Set(n.expandedKeys) : void 0, [
|
|
96
|
+
n.expandedKeys
|
|
97
|
+
]), _(() => n.defaultExpandedKeys ? new Set(n.defaultExpandedKeys) : /* @__PURE__ */ new Set(), [
|
|
98
|
+
n.defaultExpandedKeys
|
|
99
|
+
]), n.onExpandedChange);
|
|
100
|
+
return v(() => {
|
|
101
|
+
!e && a.size > 1 && d(/* @__PURE__ */ new Set([
|
|
102
|
+
a.values().next().value
|
|
103
|
+
]));
|
|
104
|
+
}), {
|
|
105
|
+
allowsMultipleExpanded: e,
|
|
106
|
+
isDisabled: t,
|
|
107
|
+
expandedKeys: a,
|
|
108
|
+
setExpandedKeys: d,
|
|
109
|
+
toggleKey(s) {
|
|
110
|
+
let l;
|
|
111
|
+
e ? (l = new Set(a), l.has(s) ? l.delete(s) : l.add(s)) : l = new Set(a.has(s) ? [] : [
|
|
112
|
+
s
|
|
113
|
+
]), d(l);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const K = /* @__PURE__ */ p(null), Ee = /* @__PURE__ */ h(function(e, t) {
|
|
118
|
+
let a = ce(e), d = x({
|
|
119
|
+
...e,
|
|
120
|
+
defaultClassName: "react-aria-DisclosureGroup",
|
|
121
|
+
values: {
|
|
122
|
+
isDisabled: a.isDisabled,
|
|
123
|
+
state: a
|
|
124
|
+
}
|
|
125
|
+
}), s = g(e);
|
|
126
|
+
return /* @__PURE__ */ c.createElement("div", {
|
|
127
|
+
...s,
|
|
128
|
+
...d,
|
|
129
|
+
ref: t,
|
|
130
|
+
"data-disabled": e.isDisabled || void 0
|
|
131
|
+
}, /* @__PURE__ */ c.createElement(K.Provider, {
|
|
132
|
+
value: a
|
|
133
|
+
}, d.children));
|
|
134
|
+
}), fe = /* @__PURE__ */ p(null), ue = /* @__PURE__ */ p(null), C = /* @__PURE__ */ p(null), _e = /* @__PURE__ */ h(function(e, t) {
|
|
135
|
+
[e, t] = V(e, t, fe);
|
|
136
|
+
let a = w(K), { id: d, ...s } = e, l = b();
|
|
137
|
+
d || (d = l);
|
|
138
|
+
let o = a ? a.expandedKeys.has(d) : e.isExpanded, i = re({
|
|
139
|
+
...e,
|
|
140
|
+
isExpanded: o,
|
|
141
|
+
onExpandedChange(T) {
|
|
142
|
+
var $;
|
|
143
|
+
a && a.toggleKey(d), ($ = e.onExpandedChange) === null || $ === void 0 || $.call(e, T);
|
|
144
|
+
}
|
|
145
|
+
}), f = c.useRef(null), r = e.isDisabled || (a == null ? void 0 : a.isDisabled) || !1, { buttonProps: F, panelProps: R } = oe({
|
|
146
|
+
...e,
|
|
147
|
+
isExpanded: o,
|
|
148
|
+
isDisabled: r
|
|
149
|
+
}, i, f), { isFocusVisible: m, focusProps: W } = P({
|
|
150
|
+
within: !0
|
|
151
|
+
}), E = x({
|
|
152
|
+
...e,
|
|
153
|
+
id: void 0,
|
|
154
|
+
defaultClassName: "react-aria-Disclosure",
|
|
155
|
+
values: {
|
|
156
|
+
isExpanded: i.isExpanded,
|
|
157
|
+
isDisabled: r,
|
|
158
|
+
isFocusVisibleWithin: m,
|
|
159
|
+
state: i
|
|
160
|
+
}
|
|
161
|
+
}), M = g(s);
|
|
162
|
+
return /* @__PURE__ */ c.createElement(D, {
|
|
163
|
+
values: [
|
|
164
|
+
[
|
|
165
|
+
y,
|
|
166
|
+
{
|
|
167
|
+
slots: {
|
|
168
|
+
[I]: {},
|
|
169
|
+
trigger: F
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
[
|
|
174
|
+
C,
|
|
175
|
+
{
|
|
176
|
+
panelProps: R,
|
|
177
|
+
panelRef: f
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
[
|
|
181
|
+
ue,
|
|
182
|
+
i
|
|
183
|
+
]
|
|
184
|
+
]
|
|
185
|
+
}, /* @__PURE__ */ c.createElement("div", {
|
|
186
|
+
ref: t,
|
|
187
|
+
"data-expanded": i.isExpanded || void 0,
|
|
188
|
+
"data-disabled": r || void 0,
|
|
189
|
+
"data-focus-visible-within": m || void 0,
|
|
190
|
+
...M,
|
|
191
|
+
...W,
|
|
192
|
+
...E
|
|
193
|
+
}, E.children));
|
|
194
|
+
}), ye = /* @__PURE__ */ h(function(e, t) {
|
|
195
|
+
let { role: a = "group" } = e, { panelProps: d, panelRef: s } = w(C), { isFocusVisible: l, focusProps: o } = P({
|
|
196
|
+
within: !0
|
|
197
|
+
}), i = x({
|
|
198
|
+
...e,
|
|
199
|
+
defaultClassName: "react-aria-DisclosurePanel",
|
|
200
|
+
values: {
|
|
201
|
+
isFocusVisibleWithin: l
|
|
202
|
+
}
|
|
203
|
+
}), f = g(e);
|
|
204
|
+
return /* @__PURE__ */ c.createElement("div", {
|
|
205
|
+
...f,
|
|
206
|
+
ref: B(t, s),
|
|
207
|
+
...N(d, o),
|
|
208
|
+
...i,
|
|
209
|
+
role: a,
|
|
210
|
+
"data-focus-visible-within": l || void 0
|
|
211
|
+
}, /* @__PURE__ */ c.createElement(D, {
|
|
212
|
+
values: [
|
|
213
|
+
[
|
|
214
|
+
y,
|
|
215
|
+
null
|
|
216
|
+
]
|
|
217
|
+
]
|
|
218
|
+
}, e.children));
|
|
219
|
+
});
|
|
220
|
+
export {
|
|
221
|
+
Ee as $,
|
|
222
|
+
_e as a,
|
|
223
|
+
ye as b,
|
|
224
|
+
me as s
|
|
225
|
+
};
|
package/Disclosure.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._root_6hoor_4{--gap: .75rem;--item-padding: 0;--content-padding: .5rem .5rem .5rem 1.85rem;--background: transparent;--background-active: transparent;--background-hover: transparent;width:100%;display:flex;flex-direction:column;gap:var(--gap)}._root_6hoor_4._contained_6hoor_12{--gap: .25rem;--item-padding: .875rem;--content-padding: 1rem;--background: #f2f2f2;--background-active: #e6e6e6;--background-hover: #d9d9d9}._triggerText_6hoor_27{margin:0;padding:0;font-size:1rem;font-weight:400}._trigger_6hoor_27{font-family:Inter,sans-serif;color:#000;border:0;cursor:pointer;display:flex;justify-content:space-between;align-items:center;margin:0}._trigger_6hoor_27 button{width:100%;justify-content:flex-start;gap:.5rem;padding:var(--item-padding)}._trigger_6hoor_27 button svg{transform:rotate(0);transition:transform .3s ease}._trigger_6hoor_27 button[aria-expanded=true]{background-color:var(--background-active)}._trigger_6hoor_27 button[aria-expanded=true] ._triggerText_6hoor_27{font-weight:500}._trigger_6hoor_27 button[aria-expanded=true] svg{transform:rotate(-180deg);transition:transform .3s ease}._trigger_6hoor_27 button[aria-expanded=true]:hover{background-color:var(--background-hover)}._trigger_6hoor_27 button:hover{background-color:var(--background-active)}._item_6hoor_78{background-color:var(--background);font-family:Inter,sans-serif}._panel_6hoor_84:not(._panel0_6hoor_84){height:0;overflow:hidden;transition:height .5s cubic-bezier(.16,1,.3,1)}._panel_6hoor_84:not(._panel0_6hoor_84)[aria-hidden=false]{height:var(--panel-height)}._content_6hoor_94{padding:var(--content-padding)}._header_6hoor_98{margin:0}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as H, l as T, t as N, u as W, v as G, w as J, x as Y } from "./useFocusRing-9PXyKy2A.js";
|
|
2
2
|
import L, { useRef as y, useContext as Q, useMemo as R, useEffect as B } from "react";
|
|
3
3
|
function X(e) {
|
|
4
4
|
const t = H(e);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as b, l as Q, K as k, o as q, d as K } from "./useFocusRing-9PXyKy2A.js";
|
|
2
2
|
import R, { useRef as x, useEffect as S, createContext as L, useMemo as y, useContext as D, useState as m, forwardRef as B } from "react";
|
|
3
|
-
import { a as
|
|
4
|
-
function
|
|
5
|
-
let i = x(e),
|
|
3
|
+
import { a as Y } from "./Text-BCF0xvqL.js";
|
|
4
|
+
function ne(t, e, a) {
|
|
5
|
+
let i = x(e), n = b(() => {
|
|
6
6
|
a && a(i.current);
|
|
7
7
|
});
|
|
8
8
|
S(() => {
|
|
9
|
-
var
|
|
10
|
-
let l = t == null || (
|
|
11
|
-
return l == null || l.addEventListener("reset",
|
|
12
|
-
l == null || l.removeEventListener("reset",
|
|
9
|
+
var r;
|
|
10
|
+
let l = t == null || (r = t.current) === null || r === void 0 ? void 0 : r.form;
|
|
11
|
+
return l == null || l.addEventListener("reset", n), () => {
|
|
12
|
+
l == null || l.removeEventListener("reset", n);
|
|
13
13
|
};
|
|
14
14
|
}, [
|
|
15
15
|
t,
|
|
16
|
-
|
|
16
|
+
n
|
|
17
17
|
]);
|
|
18
18
|
}
|
|
19
19
|
const C = {
|
|
@@ -36,37 +36,37 @@ const C = {
|
|
|
36
36
|
isInvalid: !1,
|
|
37
37
|
validationDetails: C,
|
|
38
38
|
validationErrors: []
|
|
39
|
-
},
|
|
39
|
+
}, z = L({}), F = "__formValidationState" + Date.now();
|
|
40
40
|
function le(t) {
|
|
41
41
|
if (t[F]) {
|
|
42
|
-
let { realtimeValidation: e, displayValidation: a, updateValidation: i, resetValidation:
|
|
42
|
+
let { realtimeValidation: e, displayValidation: a, updateValidation: i, resetValidation: n, commitValidation: r } = t[F];
|
|
43
43
|
return {
|
|
44
44
|
realtimeValidation: e,
|
|
45
45
|
displayValidation: a,
|
|
46
46
|
updateValidation: i,
|
|
47
|
-
resetValidation:
|
|
48
|
-
commitValidation:
|
|
47
|
+
resetValidation: n,
|
|
48
|
+
commitValidation: r
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
return
|
|
51
|
+
return G(t);
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
let { isInvalid: e, validationState: a, name: i, value:
|
|
53
|
+
function G(t) {
|
|
54
|
+
let { isInvalid: e, validationState: a, name: i, value: n, builtinValidation: r, validate: l, validationBehavior: u = "aria" } = t;
|
|
55
55
|
a && (e || (e = a === "invalid"));
|
|
56
56
|
let d = e !== void 0 ? {
|
|
57
57
|
isInvalid: e,
|
|
58
58
|
validationErrors: [],
|
|
59
59
|
validationDetails: T
|
|
60
60
|
} : null, s = y(() => {
|
|
61
|
-
if (!l ||
|
|
62
|
-
let o =
|
|
61
|
+
if (!l || n == null) return null;
|
|
62
|
+
let o = H(l, n);
|
|
63
63
|
return O(o);
|
|
64
64
|
}, [
|
|
65
65
|
l,
|
|
66
|
-
|
|
66
|
+
n
|
|
67
67
|
]);
|
|
68
|
-
|
|
69
|
-
let f = D(
|
|
68
|
+
r != null && r.validationDetails.valid && (r = void 0);
|
|
69
|
+
let f = D(z), c = y(() => i ? Array.isArray(i) ? i.flatMap((o) => M(f[o])) : M(f[i]) : [], [
|
|
70
70
|
f,
|
|
71
71
|
i
|
|
72
72
|
]), [_, j] = m(f), [w, V] = m(!1);
|
|
@@ -75,14 +75,14 @@ function z(t) {
|
|
|
75
75
|
w,
|
|
76
76
|
c
|
|
77
77
|
]), A = x(v), [E, g] = m(v), $ = x(v), P = () => {
|
|
78
|
-
if (!
|
|
78
|
+
if (!N) return;
|
|
79
79
|
h(!1);
|
|
80
|
-
let o = s ||
|
|
80
|
+
let o = s || r || A.current;
|
|
81
81
|
I(o, $.current) || ($.current = o, g(o));
|
|
82
|
-
}, [
|
|
82
|
+
}, [N, h] = m(!1);
|
|
83
83
|
return S(P), {
|
|
84
|
-
realtimeValidation: d || p || s ||
|
|
85
|
-
displayValidation: u === "native" ? d || p || E : d || p || s ||
|
|
84
|
+
realtimeValidation: d || p || s || r || v,
|
|
85
|
+
displayValidation: u === "native" ? d || p || E : d || p || s || r || E,
|
|
86
86
|
updateValidation(o) {
|
|
87
87
|
u === "aria" && !I(E, o) ? g(o) : A.current = o;
|
|
88
88
|
},
|
|
@@ -100,7 +100,7 @@ function M(t) {
|
|
|
100
100
|
t
|
|
101
101
|
] : [];
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function H(t, e) {
|
|
104
104
|
if (typeof t == "function") {
|
|
105
105
|
let a = t(e);
|
|
106
106
|
if (a && typeof a != "boolean") return M(a);
|
|
@@ -122,10 +122,10 @@ function de(...t) {
|
|
|
122
122
|
...C
|
|
123
123
|
};
|
|
124
124
|
for (let l of t) {
|
|
125
|
-
var
|
|
125
|
+
var n, r;
|
|
126
126
|
for (let u of l.validationErrors) e.add(u);
|
|
127
127
|
a || (a = l.isInvalid);
|
|
128
|
-
for (let u in i) (
|
|
128
|
+
for (let u in i) (n = i)[r = u] || (n[r] = l.validationDetails[u]);
|
|
129
129
|
}
|
|
130
130
|
return i.valid = !a, {
|
|
131
131
|
isInvalid: a,
|
|
@@ -136,14 +136,14 @@ function de(...t) {
|
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
function oe(t, e, a) {
|
|
139
|
-
let { validationBehavior: i, focus:
|
|
140
|
-
|
|
139
|
+
let { validationBehavior: i, focus: n } = t;
|
|
140
|
+
Q(() => {
|
|
141
141
|
if (i === "native" && (a != null && a.current) && !a.current.disabled) {
|
|
142
142
|
let d = e.realtimeValidation.isInvalid ? e.realtimeValidation.validationErrors.join(" ") || "Invalid value." : "";
|
|
143
143
|
a.current.setCustomValidity(d), a.current.hasAttribute("title") || (a.current.title = ""), e.realtimeValidation.isInvalid || e.updateValidation(W(a.current));
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
|
-
let
|
|
146
|
+
let r = b(() => {
|
|
147
147
|
e.resetValidation();
|
|
148
148
|
}), l = b((d) => {
|
|
149
149
|
var s;
|
|
@@ -151,7 +151,7 @@ function oe(t, e, a) {
|
|
|
151
151
|
let f = a == null || (s = a.current) === null || s === void 0 ? void 0 : s.form;
|
|
152
152
|
if (!d.defaultPrevented && a && f && X(f) === a.current) {
|
|
153
153
|
var c;
|
|
154
|
-
|
|
154
|
+
n ? n() : (c = a.current) === null || c === void 0 || c.focus(), k("keyboard");
|
|
155
155
|
}
|
|
156
156
|
d.preventDefault();
|
|
157
157
|
}), u = b(() => {
|
|
@@ -161,18 +161,18 @@ function oe(t, e, a) {
|
|
|
161
161
|
let d = a == null ? void 0 : a.current;
|
|
162
162
|
if (!d) return;
|
|
163
163
|
let s = d.form;
|
|
164
|
-
return d.addEventListener("invalid", l), d.addEventListener("change", u), s == null || s.addEventListener("reset",
|
|
165
|
-
d.removeEventListener("invalid", l), d.removeEventListener("change", u), s == null || s.removeEventListener("reset",
|
|
164
|
+
return d.addEventListener("invalid", l), d.addEventListener("change", u), s == null || s.addEventListener("reset", r), () => {
|
|
165
|
+
d.removeEventListener("invalid", l), d.removeEventListener("change", u), s == null || s.removeEventListener("reset", r);
|
|
166
166
|
};
|
|
167
167
|
}, [
|
|
168
168
|
a,
|
|
169
169
|
l,
|
|
170
170
|
u,
|
|
171
|
-
|
|
171
|
+
r,
|
|
172
172
|
i
|
|
173
173
|
]);
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function J(t) {
|
|
176
176
|
let e = t.validity;
|
|
177
177
|
return {
|
|
178
178
|
badInput: e.badInput,
|
|
@@ -191,7 +191,7 @@ function H(t) {
|
|
|
191
191
|
function W(t) {
|
|
192
192
|
return {
|
|
193
193
|
isInvalid: !t.validity.valid,
|
|
194
|
-
validationDetails:
|
|
194
|
+
validationDetails: J(t),
|
|
195
195
|
validationErrors: t.validationMessage ? [
|
|
196
196
|
t.validationMessage
|
|
197
197
|
] : []
|
|
@@ -211,16 +211,16 @@ const U = /* @__PURE__ */ L(null), se = /* @__PURE__ */ B(function(e, a) {
|
|
|
211
211
|
ref: a
|
|
212
212
|
}) : null;
|
|
213
213
|
}), Z = /* @__PURE__ */ B((t, e) => {
|
|
214
|
-
let a = D(U), i = q(t),
|
|
214
|
+
let a = D(U), i = q(t), n = K({
|
|
215
215
|
...t,
|
|
216
216
|
defaultClassName: "react-aria-FieldError",
|
|
217
217
|
defaultChildren: a.validationErrors.length === 0 ? void 0 : a.validationErrors.join(" "),
|
|
218
218
|
values: a
|
|
219
219
|
});
|
|
220
|
-
return
|
|
220
|
+
return n.children == null ? null : /* @__PURE__ */ R.createElement(Y, {
|
|
221
221
|
slot: "errorMessage",
|
|
222
222
|
...i,
|
|
223
|
-
...
|
|
223
|
+
...n,
|
|
224
224
|
ref: e
|
|
225
225
|
});
|
|
226
226
|
}), ue = /* @__PURE__ */ L(null);
|
|
@@ -229,7 +229,7 @@ export {
|
|
|
229
229
|
U as a,
|
|
230
230
|
se as b,
|
|
231
231
|
le as c,
|
|
232
|
-
|
|
232
|
+
ne as d,
|
|
233
233
|
oe as e,
|
|
234
234
|
F as f,
|
|
235
235
|
v as g,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { a as H, b as h, c as x, d as m, e as F } from "./useFocusRing-
|
|
1
|
+
import { a as H, b as h, c as x, d as m, e as F } from "./useFocusRing-9PXyKy2A.js";
|
|
2
2
|
import P, { forwardRef as _, createContext as p } from "react";
|
|
3
|
-
const C = /* @__PURE__ */ p({}),
|
|
3
|
+
const C = /* @__PURE__ */ p({}), S = /* @__PURE__ */ _(function(e, i) {
|
|
4
4
|
[e, i] = H(e, i, C);
|
|
5
|
-
let { isDisabled: d, isInvalid: a, onHoverStart: f, onHoverChange: u, onHoverEnd: c, ...v } = e, { hoverProps:
|
|
5
|
+
let { isDisabled: d, isInvalid: a, onHoverStart: f, onHoverChange: u, onHoverEnd: c, ...v } = e, { hoverProps: $, isHovered: r } = h({
|
|
6
6
|
onHoverStart: f,
|
|
7
7
|
onHoverChange: u,
|
|
8
8
|
onHoverEnd: c,
|
|
9
9
|
isDisabled: d
|
|
10
|
-
}), { isFocused:
|
|
10
|
+
}), { isFocused: s, isFocusVisible: t, focusProps: b } = x({
|
|
11
11
|
within: !0
|
|
12
12
|
});
|
|
13
13
|
d ?? (d = !!e["aria-disabled"] && e["aria-disabled"] !== "false"), a ?? (a = !!e["aria-invalid"] && e["aria-invalid"] !== "false");
|
|
14
14
|
let l = m({
|
|
15
15
|
...e,
|
|
16
16
|
values: {
|
|
17
|
-
isHovered:
|
|
18
|
-
isFocusWithin:
|
|
17
|
+
isHovered: r,
|
|
18
|
+
isFocusWithin: s,
|
|
19
19
|
isFocusVisible: t,
|
|
20
20
|
isDisabled: d,
|
|
21
21
|
isInvalid: a
|
|
@@ -24,19 +24,19 @@ const C = /* @__PURE__ */ p({}), w = /* @__PURE__ */ _(function(e, i) {
|
|
|
24
24
|
});
|
|
25
25
|
var o, n;
|
|
26
26
|
return /* @__PURE__ */ P.createElement("div", {
|
|
27
|
-
...F(v,
|
|
27
|
+
...F(v, b, $),
|
|
28
28
|
...l,
|
|
29
29
|
ref: i,
|
|
30
30
|
role: (o = e.role) !== null && o !== void 0 ? o : "group",
|
|
31
31
|
slot: (n = e.slot) !== null && n !== void 0 ? n : void 0,
|
|
32
|
-
"data-focus-within":
|
|
33
|
-
"data-hovered":
|
|
32
|
+
"data-focus-within": s || void 0,
|
|
33
|
+
"data-hovered": r || void 0,
|
|
34
34
|
"data-focus-visible": t || void 0,
|
|
35
35
|
"data-disabled": d || void 0,
|
|
36
36
|
"data-invalid": a || void 0
|
|
37
37
|
}, l.children);
|
|
38
38
|
});
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
S as $,
|
|
41
41
|
C as a
|
|
42
42
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { $ } from "./RSPContexts-BW2SEIqe.js";
|
|
2
|
+
import { a as n } from "./useFocusRing-9PXyKy2A.js";
|
|
3
|
+
import o, { forwardRef as m } from "react";
|
|
4
|
+
const b = /* @__PURE__ */ m(function(e, a) {
|
|
5
|
+
[e, a] = n(e, a, $);
|
|
6
|
+
let { children: t, level: l = 3, className: r, ...d } = e, f = `h${l}`;
|
|
7
|
+
return /* @__PURE__ */ o.createElement(f, {
|
|
8
|
+
...d,
|
|
9
|
+
ref: a,
|
|
10
|
+
className: r ?? "react-aria-Heading"
|
|
11
|
+
}, t);
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
b as $
|
|
15
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createPortal as c } from "react-dom";
|
|
2
2
|
import a, { forwardRef as l, useContext as d, createContext as o } from "react";
|
|
3
|
-
import { g as f } from "./useFocusRing-
|
|
3
|
+
import { g as f } from "./useFocusRing-9PXyKy2A.js";
|
|
4
4
|
if (typeof HTMLTemplateElement < "u") {
|
|
5
5
|
const e = Object.getOwnPropertyDescriptor(Node.prototype, "firstChild").get;
|
|
6
6
|
Object.defineProperty(HTMLTemplateElement.prototype, "firstChild", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import y, { createContext as L, forwardRef as
|
|
3
|
-
import { $ as
|
|
1
|
+
import { n as v, o as h, e as b, p as C, q as D, r as T, a as E, b as F, c as H, d as g } from "./useFocusRing-9PXyKy2A.js";
|
|
2
|
+
import y, { createContext as L, forwardRef as S } from "react";
|
|
3
|
+
import { $ as _ } from "./useFocusable-CcEBZe40.js";
|
|
4
4
|
function V(r, e) {
|
|
5
5
|
let {
|
|
6
6
|
elementType: a = "a",
|
|
@@ -16,7 +16,7 @@ function V(r, e) {
|
|
|
16
16
|
role: "link",
|
|
17
17
|
tabIndex: d ? void 0 : 0
|
|
18
18
|
});
|
|
19
|
-
let { focusableProps: l } =
|
|
19
|
+
let { focusableProps: l } = _(r, e), { pressProps: t, isPressed: p } = v({
|
|
20
20
|
onPress: i,
|
|
21
21
|
onPressStart: f,
|
|
22
22
|
onPressEnd: o,
|
|
@@ -24,11 +24,11 @@ function V(r, e) {
|
|
|
24
24
|
ref: e
|
|
25
25
|
}), x = h(u, {
|
|
26
26
|
labelable: !0
|
|
27
|
-
}),
|
|
27
|
+
}), k = b(l, t), P = C(), m = D(r);
|
|
28
28
|
return {
|
|
29
29
|
isPressed: p,
|
|
30
|
-
linkProps: b(x,
|
|
31
|
-
...
|
|
30
|
+
linkProps: b(x, m, {
|
|
31
|
+
...k,
|
|
32
32
|
...n,
|
|
33
33
|
"aria-disabled": d || void 0,
|
|
34
34
|
"aria-current": r["aria-current"],
|
|
@@ -40,7 +40,7 @@ function V(r, e) {
|
|
|
40
40
|
})
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
const w = /* @__PURE__ */ L(null), q = /* @__PURE__ */
|
|
43
|
+
const w = /* @__PURE__ */ L(null), q = /* @__PURE__ */ S(function(e, a) {
|
|
44
44
|
[e, a] = E(e, a, w);
|
|
45
45
|
let i = e.href && !e.isDisabled ? "a" : "span", { linkProps: f, isPressed: o } = V({
|
|
46
46
|
...e,
|