@drjoshcsimmons/scl 0.2.4 → 0.2.5
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/dist/index100.js +205 -167
- package/dist/index101.js +14 -55
- package/dist/index102.js +47 -29
- package/dist/index103.js +49 -29
- package/dist/index104.js +9 -15
- package/dist/index105.js +47 -29
- package/dist/index106.js +646 -44
- package/dist/index107.js +12 -45
- package/dist/index108.js +3 -54
- package/dist/index109.js +9 -30
- package/dist/index11.js +2 -2
- package/dist/index110.js +30 -13
- package/dist/index111.js +44 -646
- package/dist/index112.js +30 -9
- package/dist/index113.js +1 -1
- package/dist/index114.js +6 -48
- package/dist/index115.js +47 -11
- package/dist/index116.js +10 -204
- package/dist/index117.js +204 -20
- package/dist/index118.js +21 -399
- package/dist/index119.js +399 -20
- package/dist/index12.js +1 -1
- package/dist/index120.js +15 -3
- package/dist/index121.js +3 -32
- package/dist/index122.js +32 -12
- package/dist/index123.js +18 -6
- package/dist/index124.js +1 -1
- package/dist/index125.js +2 -25
- package/dist/index126.js +53 -29
- package/dist/index127.js +65 -5
- package/dist/index128.js +25 -2
- package/dist/index129.js +29 -53
- package/dist/index13.js +2 -2
- package/dist/index130.js +5 -65
- package/dist/index131.js +2 -5
- package/dist/index132.js +2 -3
- package/dist/index133.js +5 -24
- package/dist/index134.js +3 -113
- package/dist/index135.js +23 -15
- package/dist/index136.js +107 -519
- package/dist/index137.js +14 -126
- package/dist/index138.js +516 -125
- package/dist/index139.js +128 -2
- package/dist/index14.js +2 -2
- package/dist/index140.js +134 -2
- package/dist/index141.js +65 -69
- package/dist/index142.js +68 -8
- package/dist/index143.js +9 -14
- package/dist/index144.js +14 -66
- package/dist/index145.js +65 -64
- package/dist/index15.js +2 -2
- package/dist/index17.js +4 -4
- package/dist/index18.js +2 -2
- package/dist/index20.js +2 -2
- package/dist/index21.js +1 -1
- package/dist/index22.js +1 -1
- package/dist/index23.js +2 -2
- package/dist/index24.js +1 -1
- package/dist/index25.js +4 -4
- package/dist/index26.js +1 -1
- package/dist/index27.js +3 -3
- package/dist/index29.js +1 -1
- package/dist/index31.js +1 -1
- package/dist/index33.js +1 -1
- package/dist/index36.js +2 -2
- package/dist/index37.js +1 -1
- package/dist/index4.js +2 -2
- package/dist/index45.js +108 -220
- package/dist/index46.js +33 -11
- package/dist/index47.js +249 -33
- package/dist/index48.js +9 -60
- package/dist/index49.js +62 -107
- package/dist/index5.js +1 -1
- package/dist/index50.js +220 -108
- package/dist/index51.js +11 -435
- package/dist/index52.js +56 -856
- package/dist/index53.js +5 -2
- package/dist/index54.js +18 -9
- package/dist/index55.js +105 -117
- package/dist/index56.js +64 -512
- package/dist/index57.js +217 -137
- package/dist/index58.js +224 -70
- package/dist/index59.js +11 -18
- package/dist/index6.js +1 -1
- package/dist/index60.js +91 -197
- package/dist/index61.js +254 -11
- package/dist/index62.js +256 -27
- package/dist/index63.js +12 -310
- package/dist/index64.js +225 -12
- package/dist/index65.js +11 -260
- package/dist/index66.js +31 -12
- package/dist/index67.js +308 -20
- package/dist/index68.js +12 -225
- package/dist/index69.js +530 -11
- package/dist/index7.js +1 -1
- package/dist/index70.js +823 -204
- package/dist/index71.js +9 -73
- package/dist/index72.js +336 -12
- package/dist/index73.js +402 -216
- package/dist/index74.js +143 -318
- package/dist/index75.js +20 -252
- package/dist/index76.js +23 -64
- package/dist/index77.js +64 -42
- package/dist/index78.js +5 -25
- package/dist/index79.js +51 -6
- package/dist/index8.js +1 -1
- package/dist/index80.js +5 -51
- package/dist/index81.js +24 -33
- package/dist/index82.js +68 -10
- package/dist/index83.js +33 -7
- package/dist/index84.js +9 -4
- package/dist/index85.js +51 -65
- package/dist/index86.js +10 -8
- package/dist/index87.js +4 -4
- package/dist/index88.js +30 -6
- package/dist/index89.js +12 -24
- package/dist/index9.js +2 -2
- package/dist/index90.js +44 -123
- package/dist/index91.js +10 -14
- package/dist/index92.js +7 -134
- package/dist/index93.js +30 -219
- package/dist/index94.js +55 -14
- package/dist/index95.js +29 -47
- package/dist/index96.js +180 -10
- package/dist/index97.js +124 -29
- package/dist/index98.js +15 -50
- package/dist/index99.js +134 -8
- package/package.json +1 -1
package/dist/index75.js
CHANGED
|
@@ -1,256 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
const s = e
|
|
6
|
-
return
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return e;
|
|
14
|
-
const t = Array.isArray(e);
|
|
15
|
-
if (!t && !(p(e) && Y(e)))
|
|
16
|
-
return e;
|
|
17
|
-
const n = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
18
|
-
for (const r in e)
|
|
19
|
-
Object.prototype.hasOwnProperty.call(e, r) && (n[r] = W(e[r]));
|
|
20
|
-
return n;
|
|
21
|
-
}
|
|
22
|
-
var G = (e) => /^\w*$/.test(e), R = (e) => e === void 0, j = (e) => Array.isArray(e) ? e.filter(Boolean) : [], $ = (e) => j(e.replace(/["|']|\]/g, "").split(/\.|\[/)), y = (e, s, t) => {
|
|
23
|
-
if (!s || !p(e))
|
|
24
|
-
return t;
|
|
25
|
-
const n = (G(s) ? [s] : $(s)).reduce((r, a) => w(r) ? r : r[a], e);
|
|
26
|
-
return R(n) || n === e ? R(e[s]) ? t : e[s] : n;
|
|
27
|
-
}, P = (e) => typeof e == "boolean", E = (e) => typeof e == "function", D = (e, s, t) => {
|
|
28
|
-
let n = -1;
|
|
29
|
-
const r = G(s) ? [s] : $(s), a = r.length, i = a - 1;
|
|
30
|
-
for (; ++n < a; ) {
|
|
31
|
-
const l = r[n];
|
|
32
|
-
let c = t;
|
|
33
|
-
if (n !== i) {
|
|
34
|
-
const f = e[l];
|
|
35
|
-
c = p(f) || Array.isArray(f) ? f : isNaN(+r[n + 1]) ? {} : [];
|
|
36
|
-
}
|
|
37
|
-
if (l === "__proto__" || l === "constructor" || l === "prototype")
|
|
38
|
-
return;
|
|
39
|
-
e[l] = c, e = e[l];
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
const I = {
|
|
43
|
-
BLUR: "blur",
|
|
44
|
-
CHANGE: "change"
|
|
45
|
-
}, B = {
|
|
46
|
-
all: "all"
|
|
47
|
-
}, L = u.createContext(null);
|
|
48
|
-
L.displayName = "HookFormContext";
|
|
49
|
-
const M = () => u.useContext(L), oe = (e) => {
|
|
50
|
-
const { children: s, ...t } = e;
|
|
51
|
-
return u.createElement(L.Provider, { value: t }, s);
|
|
52
|
-
};
|
|
53
|
-
var ee = (e, s, t, n = !0) => {
|
|
54
|
-
const r = {
|
|
55
|
-
defaultValues: s._defaultValues
|
|
56
|
-
};
|
|
57
|
-
for (const a in e)
|
|
58
|
-
Object.defineProperty(r, a, {
|
|
59
|
-
get: () => {
|
|
60
|
-
const i = a;
|
|
61
|
-
return s._proxyFormState[i] !== B.all && (s._proxyFormState[i] = !n || B.all), t && (t[i] = !0), e[i];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
return r;
|
|
65
|
-
};
|
|
66
|
-
const q = typeof window < "u" ? u.useLayoutEffect : u.useEffect;
|
|
67
|
-
function te(e) {
|
|
68
|
-
const s = M(), { control: t = s.control, disabled: n, name: r, exact: a } = e || {}, [i, l] = u.useState(t._formState), c = u.useRef({
|
|
69
|
-
isDirty: !1,
|
|
70
|
-
isLoading: !1,
|
|
71
|
-
dirtyFields: !1,
|
|
72
|
-
touchedFields: !1,
|
|
73
|
-
validatingFields: !1,
|
|
74
|
-
isValidating: !1,
|
|
75
|
-
isValid: !1,
|
|
76
|
-
errors: !1
|
|
77
|
-
});
|
|
78
|
-
return q(() => t._subscribe({
|
|
79
|
-
name: r,
|
|
80
|
-
formState: c.current,
|
|
81
|
-
exact: a,
|
|
82
|
-
callback: (f) => {
|
|
83
|
-
!n && l({
|
|
84
|
-
...t._formState,
|
|
85
|
-
...f
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}), [r, n, a]), u.useEffect(() => {
|
|
89
|
-
c.current.isValid && t._setValid(!0);
|
|
90
|
-
}, [t]), u.useMemo(() => ee(i, t, c.current, !1), [i, t]);
|
|
91
|
-
}
|
|
92
|
-
var re = (e) => typeof e == "string", T = (e, s, t, n, r) => re(e) ? y(t, e, r) : Array.isArray(e) ? e.map((a) => y(t, a)) : t, U = (e) => w(e) || !H(e);
|
|
93
|
-
function S(e, s, t = /* @__PURE__ */ new WeakSet()) {
|
|
94
|
-
if (U(e) || U(s))
|
|
95
|
-
return Object.is(e, s);
|
|
96
|
-
if (k(e) && k(s))
|
|
97
|
-
return e.getTime() === s.getTime();
|
|
98
|
-
const n = Object.keys(e), r = Object.keys(s);
|
|
99
|
-
if (n.length !== r.length)
|
|
100
|
-
return !1;
|
|
101
|
-
if (t.has(e) || t.has(s))
|
|
102
|
-
return !0;
|
|
103
|
-
t.add(e), t.add(s);
|
|
104
|
-
for (const a of n) {
|
|
105
|
-
const i = e[a];
|
|
106
|
-
if (!r.includes(a))
|
|
107
|
-
return !1;
|
|
108
|
-
if (a !== "ref") {
|
|
109
|
-
const l = s[a];
|
|
110
|
-
if (k(i) && k(l) || p(i) && p(l) || Array.isArray(i) && Array.isArray(l) ? !S(i, l, t) : !Object.is(i, l))
|
|
111
|
-
return !1;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return !0;
|
|
115
|
-
}
|
|
116
|
-
function se(e) {
|
|
117
|
-
const s = M(), { control: t = s.control, name: n, defaultValue: r, disabled: a, exact: i, compute: l } = e || {}, c = u.useRef(r), f = u.useRef(l), V = u.useRef(void 0), d = u.useRef(t), g = u.useRef(n);
|
|
118
|
-
f.current = l;
|
|
119
|
-
const [A, v] = u.useState(() => {
|
|
120
|
-
const o = t._getWatch(n, c.current);
|
|
121
|
-
return f.current ? f.current(o) : o;
|
|
122
|
-
}), C = u.useCallback((o) => {
|
|
123
|
-
const m = T(n, t._names, o || t._formValues, !1, c.current);
|
|
124
|
-
return f.current ? f.current(m) : m;
|
|
125
|
-
}, [t._formValues, t._names, n]), b = u.useCallback((o) => {
|
|
126
|
-
if (!a) {
|
|
127
|
-
const m = T(n, t._names, o || t._formValues, !1, c.current);
|
|
128
|
-
if (f.current) {
|
|
129
|
-
const _ = f.current(m);
|
|
130
|
-
S(_, V.current) || (v(_), V.current = _);
|
|
131
|
-
} else
|
|
132
|
-
v(m);
|
|
133
|
-
}
|
|
134
|
-
}, [t._formValues, t._names, a, n]);
|
|
135
|
-
q(() => ((d.current !== t || !S(g.current, n)) && (d.current = t, g.current = n, b()), t._subscribe({
|
|
136
|
-
name: n,
|
|
137
|
-
formState: {
|
|
138
|
-
values: !0
|
|
139
|
-
},
|
|
140
|
-
exact: i,
|
|
141
|
-
callback: (o) => {
|
|
142
|
-
b(o.values);
|
|
143
|
-
}
|
|
144
|
-
})), [t, i, n, b]), u.useEffect(() => t._removeUnmounted());
|
|
145
|
-
const h = d.current !== t, F = g.current, O = u.useMemo(() => {
|
|
146
|
-
if (a)
|
|
147
|
-
return null;
|
|
148
|
-
const o = !h && !S(F, n);
|
|
149
|
-
return h || o ? C() : null;
|
|
150
|
-
}, [a, h, n, F, C]);
|
|
151
|
-
return O !== null ? O : A;
|
|
152
|
-
}
|
|
153
|
-
function ne(e) {
|
|
154
|
-
const s = M(), { name: t, disabled: n, control: r = s.control, shouldUnregister: a, defaultValue: i, exact: l = !0 } = e, c = X(r._names.array, t), f = u.useMemo(() => y(r._formValues, t, y(r._defaultValues, t, i)), [r, t, i]), V = se({
|
|
155
|
-
control: r,
|
|
156
|
-
name: t,
|
|
157
|
-
defaultValue: f,
|
|
158
|
-
exact: l
|
|
159
|
-
}), d = te({
|
|
160
|
-
control: r,
|
|
161
|
-
name: t,
|
|
162
|
-
exact: l
|
|
163
|
-
}), g = u.useRef(e), A = u.useRef(void 0), v = u.useRef(r.register(t, {
|
|
164
|
-
...e.rules,
|
|
165
|
-
value: V,
|
|
166
|
-
...P(e.disabled) ? { disabled: e.disabled } : {}
|
|
167
|
-
}));
|
|
168
|
-
g.current = e;
|
|
169
|
-
const C = u.useMemo(() => Object.defineProperties({}, {
|
|
170
|
-
invalid: {
|
|
171
|
-
enumerable: !0,
|
|
172
|
-
get: () => !!y(d.errors, t)
|
|
173
|
-
},
|
|
174
|
-
isDirty: {
|
|
175
|
-
enumerable: !0,
|
|
176
|
-
get: () => !!y(d.dirtyFields, t)
|
|
177
|
-
},
|
|
178
|
-
isTouched: {
|
|
179
|
-
enumerable: !0,
|
|
180
|
-
get: () => !!y(d.touchedFields, t)
|
|
181
|
-
},
|
|
182
|
-
isValidating: {
|
|
183
|
-
enumerable: !0,
|
|
184
|
-
get: () => !!y(d.validatingFields, t)
|
|
185
|
-
},
|
|
186
|
-
error: {
|
|
187
|
-
enumerable: !0,
|
|
188
|
-
get: () => y(d.errors, t)
|
|
189
|
-
}
|
|
190
|
-
}), [d, t]), b = u.useCallback((o) => v.current.onChange({
|
|
191
|
-
target: {
|
|
192
|
-
value: J(o),
|
|
193
|
-
name: t
|
|
194
|
-
},
|
|
195
|
-
type: I.CHANGE
|
|
196
|
-
}), [t]), h = u.useCallback(() => v.current.onBlur({
|
|
197
|
-
target: {
|
|
198
|
-
value: y(r._formValues, t),
|
|
199
|
-
name: t
|
|
200
|
-
},
|
|
201
|
-
type: I.BLUR
|
|
202
|
-
}), [t, r._formValues]), F = u.useCallback((o) => {
|
|
203
|
-
const m = y(r._fields, t);
|
|
204
|
-
m && m._f && o && (m._f.ref = {
|
|
205
|
-
focus: () => E(o.focus) && o.focus(),
|
|
206
|
-
select: () => E(o.select) && o.select(),
|
|
207
|
-
setCustomValidity: (_) => E(o.setCustomValidity) && o.setCustomValidity(_),
|
|
208
|
-
reportValidity: () => E(o.reportValidity) && o.reportValidity()
|
|
209
|
-
});
|
|
210
|
-
}, [r._fields, t]), O = u.useMemo(() => ({
|
|
211
|
-
name: t,
|
|
212
|
-
value: V,
|
|
213
|
-
...P(n) || d.disabled ? { disabled: d.disabled || n } : {},
|
|
214
|
-
onChange: b,
|
|
215
|
-
onBlur: h,
|
|
216
|
-
ref: F
|
|
217
|
-
}), [t, n, d.disabled, b, h, F, V]);
|
|
218
|
-
return u.useEffect(() => {
|
|
219
|
-
const o = r._options.shouldUnregister || a, m = A.current;
|
|
220
|
-
m && m !== t && !c && r.unregister(m), r.register(t, {
|
|
221
|
-
...g.current.rules,
|
|
222
|
-
...P(g.current.disabled) ? { disabled: g.current.disabled } : {}
|
|
223
|
-
});
|
|
224
|
-
const _ = (x, K) => {
|
|
225
|
-
const N = y(r._fields, x);
|
|
226
|
-
N && N._f && (N._f.mount = K);
|
|
227
|
-
};
|
|
228
|
-
if (_(t, !0), o) {
|
|
229
|
-
const x = W(y(r._options.defaultValues, t, g.current.defaultValue));
|
|
230
|
-
D(r._defaultValues, t, x), R(y(r._formValues, t)) && D(r._formValues, t, x);
|
|
1
|
+
import * as p from "react";
|
|
2
|
+
import { Primitive as v } from "./index112.js";
|
|
3
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
4
|
+
var d = "Separator", a = "horizontal", l = ["horizontal", "vertical"], i = p.forwardRef((r, n) => {
|
|
5
|
+
const { decorative: e, orientation: t = a, ...s } = r, o = f(t) ? t : a, c = e ? { role: "none" } : { "aria-orientation": o === "vertical" ? o : void 0, role: "separator" };
|
|
6
|
+
return /* @__PURE__ */ m(
|
|
7
|
+
v.div,
|
|
8
|
+
{
|
|
9
|
+
"data-orientation": o,
|
|
10
|
+
...c,
|
|
11
|
+
...s,
|
|
12
|
+
ref: n
|
|
231
13
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
disabled: n,
|
|
238
|
-
name: t
|
|
239
|
-
});
|
|
240
|
-
}, [n, t, r]), u.useMemo(() => ({
|
|
241
|
-
field: O,
|
|
242
|
-
formState: d,
|
|
243
|
-
fieldState: C
|
|
244
|
-
}), [O, d, C]);
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
i.displayName = d;
|
|
17
|
+
function f(r) {
|
|
18
|
+
return l.includes(r);
|
|
245
19
|
}
|
|
246
|
-
|
|
20
|
+
var T = i;
|
|
247
21
|
export {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
y as get,
|
|
251
|
-
D as set,
|
|
252
|
-
ne as useController,
|
|
253
|
-
M as useFormContext,
|
|
254
|
-
te as useFormState,
|
|
255
|
-
se as useWatch
|
|
22
|
+
T as Root,
|
|
23
|
+
i as Separator
|
|
256
24
|
};
|
package/dist/index76.js
CHANGED
|
@@ -1,70 +1,29 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return /* @__PURE__ */ h(o.Provider, { value: s, children: t });
|
|
7
|
-
};
|
|
8
|
-
a.displayName = e + "Provider";
|
|
9
|
-
function i(r) {
|
|
10
|
-
const t = u.useContext(o);
|
|
11
|
-
if (t) return t;
|
|
12
|
-
if (c !== void 0) return c;
|
|
13
|
-
throw new Error(`\`${r}\` must be used within \`${e}\``);
|
|
14
|
-
}
|
|
15
|
-
return [a, i];
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
function l(n, o) {
|
|
3
|
+
if (typeof n == "function")
|
|
4
|
+
return n(o);
|
|
5
|
+
n != null && (n.current = o);
|
|
16
6
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (m) return m;
|
|
32
|
-
if (t !== void 0) return t;
|
|
33
|
-
throw new Error(`\`${d}\` must be used within \`${r}\``);
|
|
34
|
-
}
|
|
35
|
-
return [p, f];
|
|
36
|
-
}
|
|
37
|
-
const i = () => {
|
|
38
|
-
const r = o.map((t) => u.createContext(t));
|
|
39
|
-
return function(n) {
|
|
40
|
-
const s = (n == null ? void 0 : n[e]) || r;
|
|
41
|
-
return u.useMemo(
|
|
42
|
-
() => ({ [`__scope${e}`]: { ...n, [e]: s } }),
|
|
43
|
-
[n, s]
|
|
44
|
-
);
|
|
45
|
-
};
|
|
7
|
+
function i(...n) {
|
|
8
|
+
return (o) => {
|
|
9
|
+
let u = !1;
|
|
10
|
+
const c = n.map((t) => {
|
|
11
|
+
const e = l(t, o);
|
|
12
|
+
return !u && typeof e == "function" && (u = !0), e;
|
|
13
|
+
});
|
|
14
|
+
if (u)
|
|
15
|
+
return () => {
|
|
16
|
+
for (let t = 0; t < c.length; t++) {
|
|
17
|
+
const e = c[t];
|
|
18
|
+
typeof e == "function" ? e() : l(n[t], null);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
46
21
|
};
|
|
47
|
-
return i.scopeName = e, [a, l(i, ...c)];
|
|
48
22
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
51
|
-
if (e.length === 1) return c;
|
|
52
|
-
const o = () => {
|
|
53
|
-
const a = e.map((i) => ({
|
|
54
|
-
useScope: i(),
|
|
55
|
-
scopeName: i.scopeName
|
|
56
|
-
}));
|
|
57
|
-
return function(r) {
|
|
58
|
-
const t = a.reduce((n, { useScope: s, scopeName: p }) => {
|
|
59
|
-
const d = s(r)[`__scope${p}`];
|
|
60
|
-
return { ...n, ...d };
|
|
61
|
-
}, {});
|
|
62
|
-
return u.useMemo(() => ({ [`__scope${c.scopeName}`]: t }), [t]);
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
return o.scopeName = c.scopeName, o;
|
|
23
|
+
function s(...n) {
|
|
24
|
+
return f.useCallback(i(...n), n);
|
|
66
25
|
}
|
|
67
26
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
27
|
+
i as composeRefs,
|
|
28
|
+
s as useComposedRefs
|
|
70
29
|
};
|
package/dist/index77.js
CHANGED
|
@@ -1,48 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const m = s + "CollectionProvider", [A, N] = y(m), [_, f] = A(
|
|
8
|
-
m,
|
|
9
|
-
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
10
|
-
), p = (c) => {
|
|
11
|
-
const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
|
|
12
|
-
return /* @__PURE__ */ u(_, { scope: e, itemMap: t, collectionRef: o, children: l });
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
3
|
+
function w(e, c) {
|
|
4
|
+
const o = u.createContext(c), a = (r) => {
|
|
5
|
+
const { children: t, ...n } = r, s = u.useMemo(() => n, Object.values(n));
|
|
6
|
+
return /* @__PURE__ */ h(o.Provider, { value: s, children: t });
|
|
13
7
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
a.displayName = e + "Provider";
|
|
9
|
+
function i(r) {
|
|
10
|
+
const t = u.useContext(o);
|
|
11
|
+
if (t) return t;
|
|
12
|
+
if (c !== void 0) return c;
|
|
13
|
+
throw new Error(`\`${r}\` must be used within \`${e}\``);
|
|
14
|
+
}
|
|
15
|
+
return [a, i];
|
|
16
|
+
}
|
|
17
|
+
function _(e, c = []) {
|
|
18
|
+
let o = [];
|
|
19
|
+
function a(r, t) {
|
|
20
|
+
const n = u.createContext(t), s = o.length;
|
|
21
|
+
o = [...o, t];
|
|
22
|
+
const p = (d) => {
|
|
23
|
+
var S;
|
|
24
|
+
const { scope: x, children: C, ...m } = d, v = ((S = x == null ? void 0 : x[e]) == null ? void 0 : S[s]) || n, P = u.useMemo(() => m, Object.values(m));
|
|
25
|
+
return /* @__PURE__ */ h(v.Provider, { value: P, children: C });
|
|
26
|
+
};
|
|
27
|
+
p.displayName = r + "Provider";
|
|
28
|
+
function f(d, x) {
|
|
29
|
+
var v;
|
|
30
|
+
const C = ((v = x == null ? void 0 : x[e]) == null ? void 0 : v[s]) || n, m = u.useContext(C);
|
|
31
|
+
if (m) return m;
|
|
32
|
+
if (t !== void 0) return t;
|
|
33
|
+
throw new Error(`\`${d}\` must be used within \`${r}\``);
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
I.displayName = d;
|
|
29
|
-
function O(c) {
|
|
30
|
-
const e = f(s + "CollectionConsumer", c);
|
|
31
|
-
return r.useCallback(() => {
|
|
32
|
-
const o = e.collectionRef.current;
|
|
33
|
-
if (!o) return [];
|
|
34
|
-
const t = Array.from(o.querySelectorAll(`[${R}]`));
|
|
35
|
-
return Array.from(e.itemMap.values()).sort(
|
|
36
|
-
(i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
|
|
37
|
-
);
|
|
38
|
-
}, [e.collectionRef, e.itemMap]);
|
|
35
|
+
return [p, f];
|
|
39
36
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
const i = () => {
|
|
38
|
+
const r = o.map((t) => u.createContext(t));
|
|
39
|
+
return function(n) {
|
|
40
|
+
const s = (n == null ? void 0 : n[e]) || r;
|
|
41
|
+
return u.useMemo(
|
|
42
|
+
() => ({ [`__scope${e}`]: { ...n, [e]: s } }),
|
|
43
|
+
[n, s]
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
return i.scopeName = e, [a, l(i, ...c)];
|
|
48
|
+
}
|
|
49
|
+
function l(...e) {
|
|
50
|
+
const c = e[0];
|
|
51
|
+
if (e.length === 1) return c;
|
|
52
|
+
const o = () => {
|
|
53
|
+
const a = e.map((i) => ({
|
|
54
|
+
useScope: i(),
|
|
55
|
+
scopeName: i.scopeName
|
|
56
|
+
}));
|
|
57
|
+
return function(r) {
|
|
58
|
+
const t = a.reduce((n, { useScope: s, scopeName: p }) => {
|
|
59
|
+
const d = s(r)[`__scope${p}`];
|
|
60
|
+
return { ...n, ...d };
|
|
61
|
+
}, {});
|
|
62
|
+
return u.useMemo(() => ({ [`__scope${c.scopeName}`]: t }), [t]);
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
return o.scopeName = c.scopeName, o;
|
|
45
66
|
}
|
|
46
67
|
export {
|
|
47
|
-
|
|
68
|
+
w as createContext,
|
|
69
|
+
_ as createContextScope
|
|
48
70
|
};
|
package/dist/index78.js
CHANGED
|
@@ -1,29 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
n != null && (n.current = o);
|
|
6
|
-
}
|
|
7
|
-
function i(...n) {
|
|
8
|
-
return (o) => {
|
|
9
|
-
let u = !1;
|
|
10
|
-
const c = n.map((t) => {
|
|
11
|
-
const e = l(t, o);
|
|
12
|
-
return !u && typeof e == "function" && (u = !0), e;
|
|
13
|
-
});
|
|
14
|
-
if (u)
|
|
15
|
-
return () => {
|
|
16
|
-
for (let t = 0; t < c.length; t++) {
|
|
17
|
-
const e = c[t];
|
|
18
|
-
typeof e == "function" ? e() : l(n[t], null);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
1
|
+
function h(f, c, { checkForDefaultPrevented: p = !0 } = {}) {
|
|
2
|
+
return function(s) {
|
|
3
|
+
if (f == null || f(s), p === !1 || !s.defaultPrevented)
|
|
4
|
+
return c == null ? void 0 : c(s);
|
|
21
5
|
};
|
|
22
6
|
}
|
|
23
|
-
function s(...n) {
|
|
24
|
-
return f.useCallback(i(...n), n);
|
|
25
|
-
}
|
|
26
7
|
export {
|
|
27
|
-
|
|
28
|
-
s as useComposedRefs
|
|
8
|
+
h as composeEventHandlers
|
|
29
9
|
};
|
package/dist/index79.js
CHANGED
|
@@ -1,9 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as n from "react";
|
|
2
|
+
import { useLayoutEffect as v } from "./index87.js";
|
|
3
|
+
var E = n[" useInsertionEffect ".trim().toString()] || v;
|
|
4
|
+
function y({
|
|
5
|
+
prop: t,
|
|
6
|
+
defaultProp: u,
|
|
7
|
+
onChange: o = () => {
|
|
8
|
+
},
|
|
9
|
+
caller: i
|
|
10
|
+
}) {
|
|
11
|
+
const [l, e, r] = w({
|
|
12
|
+
defaultProp: u,
|
|
13
|
+
onChange: o
|
|
14
|
+
}), c = t !== void 0, a = c ? t : l;
|
|
15
|
+
{
|
|
16
|
+
const s = n.useRef(t !== void 0);
|
|
17
|
+
n.useEffect(() => {
|
|
18
|
+
const f = s.current;
|
|
19
|
+
f !== c && console.warn(
|
|
20
|
+
`${i} is changing from ${f ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
21
|
+
), s.current = c;
|
|
22
|
+
}, [c, i]);
|
|
23
|
+
}
|
|
24
|
+
const m = n.useCallback(
|
|
25
|
+
(s) => {
|
|
26
|
+
var f;
|
|
27
|
+
if (c) {
|
|
28
|
+
const d = R(s) ? s(t) : s;
|
|
29
|
+
d !== t && ((f = r.current) == null || f.call(r, d));
|
|
30
|
+
} else
|
|
31
|
+
e(s);
|
|
32
|
+
},
|
|
33
|
+
[c, t, e, r]
|
|
34
|
+
);
|
|
35
|
+
return [a, m];
|
|
36
|
+
}
|
|
37
|
+
function w({
|
|
38
|
+
defaultProp: t,
|
|
39
|
+
onChange: u
|
|
40
|
+
}) {
|
|
41
|
+
const [o, i] = n.useState(t), l = n.useRef(o), e = n.useRef(u);
|
|
42
|
+
return E(() => {
|
|
43
|
+
e.current = u;
|
|
44
|
+
}, [u]), n.useEffect(() => {
|
|
45
|
+
var r;
|
|
46
|
+
l.current !== o && ((r = e.current) == null || r.call(e, o), l.current = o);
|
|
47
|
+
}, [o, l]), [o, i, e];
|
|
48
|
+
}
|
|
49
|
+
function R(t) {
|
|
50
|
+
return typeof t == "function";
|
|
6
51
|
}
|
|
7
52
|
export {
|
|
8
|
-
|
|
53
|
+
y as useControllableState
|
|
9
54
|
};
|
package/dist/index8.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { cva as o } from "./
|
|
2
|
+
import { cva as o } from "./index46.js";
|
|
3
3
|
import { cn as a } from "./index2.js";
|
|
4
4
|
const i = o(
|
|
5
5
|
"inline-flex items-center border-2 px-2.5 py-0.5 text-xs font-semibold uppercase tracking-wider focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
package/dist/index80.js
CHANGED
|
@@ -1,54 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
prop: t,
|
|
6
|
-
defaultProp: u,
|
|
7
|
-
onChange: o = () => {
|
|
8
|
-
},
|
|
9
|
-
caller: i
|
|
10
|
-
}) {
|
|
11
|
-
const [l, e, r] = w({
|
|
12
|
-
defaultProp: u,
|
|
13
|
-
onChange: o
|
|
14
|
-
}), c = t !== void 0, a = c ? t : l;
|
|
15
|
-
{
|
|
16
|
-
const s = n.useRef(t !== void 0);
|
|
17
|
-
n.useEffect(() => {
|
|
18
|
-
const f = s.current;
|
|
19
|
-
f !== c && console.warn(
|
|
20
|
-
`${i} is changing from ${f ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
21
|
-
), s.current = c;
|
|
22
|
-
}, [c, i]);
|
|
23
|
-
}
|
|
24
|
-
const m = n.useCallback(
|
|
25
|
-
(s) => {
|
|
26
|
-
var f;
|
|
27
|
-
if (c) {
|
|
28
|
-
const d = R(s) ? s(t) : s;
|
|
29
|
-
d !== t && ((f = r.current) == null || f.call(r, d));
|
|
30
|
-
} else
|
|
31
|
-
e(s);
|
|
32
|
-
},
|
|
33
|
-
[c, t, e, r]
|
|
34
|
-
);
|
|
35
|
-
return [a, m];
|
|
36
|
-
}
|
|
37
|
-
function w({
|
|
38
|
-
defaultProp: t,
|
|
39
|
-
onChange: u
|
|
40
|
-
}) {
|
|
41
|
-
const [o, i] = n.useState(t), l = n.useRef(o), e = n.useRef(u);
|
|
42
|
-
return E(() => {
|
|
43
|
-
e.current = u;
|
|
44
|
-
}, [u]), n.useEffect(() => {
|
|
45
|
-
var r;
|
|
46
|
-
l.current !== o && ((r = e.current) == null || r.call(e, o), l.current = o);
|
|
47
|
-
}, [o, l]), [o, i, e];
|
|
48
|
-
}
|
|
49
|
-
function R(t) {
|
|
50
|
-
return typeof t == "function";
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
function t(r) {
|
|
3
|
+
const e = u.useRef({ value: r, previous: r });
|
|
4
|
+
return u.useMemo(() => (e.current.value !== r && (e.current.previous = e.current.value, e.current.value = r), e.current.previous), [r]);
|
|
51
5
|
}
|
|
52
6
|
export {
|
|
53
|
-
|
|
7
|
+
t as usePrevious
|
|
54
8
|
};
|