@drjoshcsimmons/scl 0.1.8 → 0.1.10
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/index10.js +21 -21
- package/dist/index100.js +49 -29
- package/dist/index101.js +47 -12
- package/dist/index103.js +13 -53
- package/dist/index104.js +219 -30
- package/dist/index105.js +7 -46
- package/dist/index106.js +30 -15
- package/dist/index108.js +47 -29
- package/dist/index109.js +1 -1
- package/dist/index11.js +2 -2
- package/dist/index110.js +50 -645
- package/dist/index111.js +1 -1
- package/dist/index112.js +12 -8
- package/dist/index115.js +48 -6
- package/dist/index116.js +1 -1
- package/dist/index117.js +21 -206
- package/dist/index118.js +9 -22
- package/dist/index119.js +38 -400
- package/dist/index12.js +1 -1
- package/dist/index120.js +11 -14
- package/dist/index121.js +206 -9
- package/dist/index122.js +21 -37
- package/dist/index123.js +399 -17
- package/dist/index124.js +6 -48
- package/dist/index125.js +25 -2
- package/dist/index126.js +29 -53
- package/dist/index127.js +5 -65
- package/dist/index128.js +2 -25
- package/dist/index129.js +53 -29
- package/dist/index13.js +2 -2
- package/dist/index130.js +65 -5
- package/dist/index131.js +5 -2
- package/dist/index132.js +3 -2
- package/dist/index133.js +24 -5
- package/dist/index134.js +113 -3
- package/dist/index135.js +15 -23
- package/dist/index136.js +2 -113
- package/dist/index137.js +2 -16
- package/dist/index14.js +2 -2
- package/dist/index141.js +1 -1
- package/dist/index142.js +1 -1
- 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 +3 -3
- 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/index45.js +1 -1
- package/dist/index46.js +1 -1
- package/dist/index47.js +32 -529
- package/dist/index48.js +12 -241
- package/dist/index49.js +9 -33
- package/dist/index5.js +1 -1
- package/dist/index50.js +58 -234
- package/dist/index51.js +118 -11
- package/dist/index52.js +237 -61
- package/dist/index53.js +21 -129
- package/dist/index54.js +220 -109
- package/dist/index55.js +11 -60
- package/dist/index56.js +518 -242
- package/dist/index57.js +215 -72
- package/dist/index58.js +11 -260
- package/dist/index59.js +82 -12
- package/dist/index6.js +1 -1
- package/dist/index60.js +222 -822
- package/dist/index61.js +6 -3
- package/dist/index62.js +435 -9
- package/dist/index63.js +118 -303
- package/dist/index64.js +31 -12
- package/dist/index65.js +303 -111
- package/dist/index66.js +12 -225
- package/dist/index67.js +336 -11
- package/dist/index68.js +247 -242
- package/dist/index69.js +238 -15
- package/dist/index7.js +1 -1
- package/dist/index70.js +854 -16
- package/dist/index71.js +9 -161
- package/dist/index72.js +16 -334
- package/dist/index73.js +111 -416
- package/dist/index74.js +160 -30
- package/dist/index75.js +73 -12
- package/dist/index8.js +1 -1
- package/dist/index80.js +1 -1
- package/dist/index82.js +1 -1
- package/dist/index84.js +3 -68
- package/dist/index85.js +68 -10
- package/dist/index86.js +30 -4
- package/dist/index87.js +5 -3
- package/dist/index88.js +24 -180
- package/dist/index89.js +180 -24
- package/dist/index9.js +2 -2
- package/dist/index90.js +10 -5
- package/dist/index91.js +3 -124
- package/dist/index92.js +646 -11
- package/dist/index93.js +50 -130
- package/dist/index94.js +30 -219
- package/dist/index95.js +124 -13
- package/dist/index96.js +127 -40
- package/dist/index97.js +14 -50
- package/dist/index98.js +14 -8
- package/dist/index99.js +9 -55
- package/package.json +1 -8
package/dist/index51.js
CHANGED
|
@@ -1,13 +1,120 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { composeEventHandlers as T } from "./index79.js";
|
|
3
|
+
import { createContextScope as S } from "./index76.js";
|
|
4
|
+
import { useControllableState as D } from "./index80.js";
|
|
5
|
+
import { useLayoutEffect as L } from "./index84.js";
|
|
6
|
+
import { useComposedRefs as M } from "./index78.js";
|
|
7
|
+
import { Primitive as v } from "./index81.js";
|
|
8
|
+
import { Presence as k } from "./index85.js";
|
|
9
|
+
import { useId as F } from "./index82.js";
|
|
10
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
11
|
+
var u = "Collapsible", [B, W] = S(u), [G, g] = B(u), w = o.forwardRef(
|
|
12
|
+
(e, a) => {
|
|
13
|
+
const {
|
|
14
|
+
__scopeCollapsible: i,
|
|
15
|
+
open: r,
|
|
16
|
+
defaultOpen: t,
|
|
17
|
+
disabled: l,
|
|
18
|
+
onOpenChange: s,
|
|
19
|
+
...m
|
|
20
|
+
} = e, [d, p] = D({
|
|
21
|
+
prop: r,
|
|
22
|
+
defaultProp: t ?? !1,
|
|
23
|
+
onChange: s,
|
|
24
|
+
caller: u
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ c(
|
|
27
|
+
G,
|
|
28
|
+
{
|
|
29
|
+
scope: i,
|
|
30
|
+
disabled: l,
|
|
31
|
+
contentId: F(),
|
|
32
|
+
open: d,
|
|
33
|
+
onOpenToggle: o.useCallback(() => p((C) => !C), [p]),
|
|
34
|
+
children: /* @__PURE__ */ c(
|
|
35
|
+
v.div,
|
|
36
|
+
{
|
|
37
|
+
"data-state": h(d),
|
|
38
|
+
"data-disabled": l ? "" : void 0,
|
|
39
|
+
...m,
|
|
40
|
+
ref: a
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
w.displayName = u;
|
|
48
|
+
var A = "CollapsibleTrigger", I = o.forwardRef(
|
|
49
|
+
(e, a) => {
|
|
50
|
+
const { __scopeCollapsible: i, ...r } = e, t = g(A, i);
|
|
51
|
+
return /* @__PURE__ */ c(
|
|
52
|
+
v.button,
|
|
53
|
+
{
|
|
54
|
+
type: "button",
|
|
55
|
+
"aria-controls": t.contentId,
|
|
56
|
+
"aria-expanded": t.open || !1,
|
|
57
|
+
"data-state": h(t.open),
|
|
58
|
+
"data-disabled": t.disabled ? "" : void 0,
|
|
59
|
+
disabled: t.disabled,
|
|
60
|
+
...r,
|
|
61
|
+
ref: a,
|
|
62
|
+
onClick: T(e.onClick, t.onOpenToggle)
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
I.displayName = A;
|
|
68
|
+
var R = "CollapsibleContent", O = o.forwardRef(
|
|
69
|
+
(e, a) => {
|
|
70
|
+
const { forceMount: i, ...r } = e, t = g(R, e.__scopeCollapsible);
|
|
71
|
+
return /* @__PURE__ */ c(k, { present: i || t.open, children: ({ present: l }) => /* @__PURE__ */ c($, { ...r, ref: a, present: l }) });
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
O.displayName = R;
|
|
75
|
+
var $ = o.forwardRef((e, a) => {
|
|
76
|
+
const { __scopeCollapsible: i, present: r, children: t, ...l } = e, s = g(R, i), [m, d] = o.useState(r), p = o.useRef(null), C = M(a, p), y = o.useRef(0), x = y.current, N = o.useRef(0), P = N.current, b = s.open || m, _ = o.useRef(b), f = o.useRef(void 0);
|
|
77
|
+
return o.useEffect(() => {
|
|
78
|
+
const n = requestAnimationFrame(() => _.current = !1);
|
|
79
|
+
return () => cancelAnimationFrame(n);
|
|
80
|
+
}, []), L(() => {
|
|
81
|
+
const n = p.current;
|
|
82
|
+
if (n) {
|
|
83
|
+
f.current = f.current || {
|
|
84
|
+
transitionDuration: n.style.transitionDuration,
|
|
85
|
+
animationName: n.style.animationName
|
|
86
|
+
}, n.style.transitionDuration = "0s", n.style.animationName = "none";
|
|
87
|
+
const E = n.getBoundingClientRect();
|
|
88
|
+
y.current = E.height, N.current = E.width, _.current || (n.style.transitionDuration = f.current.transitionDuration, n.style.animationName = f.current.animationName), d(r);
|
|
89
|
+
}
|
|
90
|
+
}, [s.open, r]), /* @__PURE__ */ c(
|
|
91
|
+
v.div,
|
|
92
|
+
{
|
|
93
|
+
"data-state": h(s.open),
|
|
94
|
+
"data-disabled": s.disabled ? "" : void 0,
|
|
95
|
+
id: s.contentId,
|
|
96
|
+
hidden: !b,
|
|
97
|
+
...l,
|
|
98
|
+
ref: C,
|
|
99
|
+
style: {
|
|
100
|
+
"--radix-collapsible-content-height": x ? `${x}px` : void 0,
|
|
101
|
+
"--radix-collapsible-content-width": P ? `${P}px` : void 0,
|
|
102
|
+
...e.style
|
|
103
|
+
},
|
|
104
|
+
children: b && t
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
});
|
|
108
|
+
function h(e) {
|
|
109
|
+
return e ? "open" : "closed";
|
|
110
|
+
}
|
|
111
|
+
var X = w, Y = I, Z = O;
|
|
11
112
|
export {
|
|
12
|
-
|
|
113
|
+
w as Collapsible,
|
|
114
|
+
O as CollapsibleContent,
|
|
115
|
+
I as CollapsibleTrigger,
|
|
116
|
+
Z as Content,
|
|
117
|
+
X as Root,
|
|
118
|
+
Y as Trigger,
|
|
119
|
+
W as createCollapsibleScope
|
|
13
120
|
};
|
package/dist/index52.js
CHANGED
|
@@ -1,75 +1,251 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { useComposedRefs as B } from "./index78.js";
|
|
3
|
+
import { createContextScope as L } from "./index76.js";
|
|
4
|
+
import { composeEventHandlers as S } from "./index79.js";
|
|
5
|
+
import { useControllableState as O } from "./index80.js";
|
|
6
|
+
import { usePrevious as j } from "./index87.js";
|
|
7
|
+
import { useSize as H } from "./index88.js";
|
|
8
|
+
import { Presence as z } from "./index85.js";
|
|
9
|
+
import { Primitive as P } from "./index81.js";
|
|
10
|
+
import { jsx as b, jsxs as G, Fragment as K } from "react/jsx-runtime";
|
|
11
|
+
var g = "Checkbox", [U] = L(g), [X, E] = U(g);
|
|
12
|
+
function J(t) {
|
|
13
|
+
const {
|
|
14
|
+
__scopeCheckbox: a,
|
|
15
|
+
checked: c,
|
|
16
|
+
children: u,
|
|
17
|
+
defaultChecked: r,
|
|
18
|
+
disabled: e,
|
|
19
|
+
form: p,
|
|
20
|
+
name: f,
|
|
21
|
+
onCheckedChange: i,
|
|
22
|
+
required: m,
|
|
23
|
+
value: C = "on",
|
|
24
|
+
// @ts-expect-error
|
|
25
|
+
internal_do_not_use_render: d
|
|
26
|
+
} = t, [l, v] = O({
|
|
27
|
+
prop: c,
|
|
28
|
+
defaultProp: r ?? !1,
|
|
29
|
+
onChange: i,
|
|
30
|
+
caller: g
|
|
31
|
+
}), [k, x] = s.useState(null), [_, o] = s.useState(null), n = s.useRef(!1), I = k ? !!p || !!k.closest("form") : (
|
|
32
|
+
// We set this to true by default so that events bubble to forms without JS (SSR)
|
|
33
|
+
!0
|
|
34
|
+
), R = {
|
|
35
|
+
checked: l,
|
|
36
|
+
disabled: e,
|
|
37
|
+
setChecked: v,
|
|
38
|
+
control: k,
|
|
39
|
+
setControl: x,
|
|
40
|
+
name: f,
|
|
41
|
+
form: p,
|
|
42
|
+
value: C,
|
|
43
|
+
hasConsumerStoppedPropagationRef: n,
|
|
44
|
+
required: m,
|
|
45
|
+
defaultChecked: h(r) ? !1 : r,
|
|
46
|
+
isFormControl: I,
|
|
47
|
+
bubbleInput: _,
|
|
48
|
+
setBubbleInput: o
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ b(
|
|
51
|
+
X,
|
|
52
|
+
{
|
|
53
|
+
scope: a,
|
|
54
|
+
...R,
|
|
55
|
+
children: W(d) ? d(R) : u
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
var N = "CheckboxTrigger", w = s.forwardRef(
|
|
60
|
+
({ __scopeCheckbox: t, onKeyDown: a, onClick: c, ...u }, r) => {
|
|
61
|
+
const {
|
|
62
|
+
control: e,
|
|
63
|
+
value: p,
|
|
64
|
+
disabled: f,
|
|
65
|
+
checked: i,
|
|
66
|
+
required: m,
|
|
67
|
+
setControl: C,
|
|
68
|
+
setChecked: d,
|
|
69
|
+
hasConsumerStoppedPropagationRef: l,
|
|
70
|
+
isFormControl: v,
|
|
71
|
+
bubbleInput: k
|
|
72
|
+
} = E(N, t), x = B(r, C), _ = s.useRef(i);
|
|
73
|
+
return s.useEffect(() => {
|
|
74
|
+
const o = e == null ? void 0 : e.form;
|
|
75
|
+
if (o) {
|
|
76
|
+
const n = () => d(_.current);
|
|
77
|
+
return o.addEventListener("reset", n), () => o.removeEventListener("reset", n);
|
|
78
|
+
}
|
|
79
|
+
}, [e, d]), /* @__PURE__ */ b(
|
|
80
|
+
P.button,
|
|
81
|
+
{
|
|
82
|
+
type: "button",
|
|
83
|
+
role: "checkbox",
|
|
84
|
+
"aria-checked": h(i) ? "mixed" : i,
|
|
85
|
+
"aria-required": m,
|
|
86
|
+
"data-state": A(i),
|
|
87
|
+
"data-disabled": f ? "" : void 0,
|
|
88
|
+
disabled: f,
|
|
89
|
+
value: p,
|
|
90
|
+
...u,
|
|
91
|
+
ref: x,
|
|
92
|
+
onKeyDown: S(a, (o) => {
|
|
93
|
+
o.key === "Enter" && o.preventDefault();
|
|
94
|
+
}),
|
|
95
|
+
onClick: S(c, (o) => {
|
|
96
|
+
d((n) => h(n) ? !0 : !n), k && v && (l.current = o.isPropagationStopped(), l.current || o.stopPropagation());
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
w.displayName = N;
|
|
103
|
+
var Q = s.forwardRef(
|
|
104
|
+
(t, a) => {
|
|
105
|
+
const {
|
|
106
|
+
__scopeCheckbox: c,
|
|
107
|
+
name: u,
|
|
108
|
+
checked: r,
|
|
109
|
+
defaultChecked: e,
|
|
110
|
+
required: p,
|
|
111
|
+
disabled: f,
|
|
112
|
+
value: i,
|
|
113
|
+
onCheckedChange: m,
|
|
114
|
+
form: C,
|
|
115
|
+
...d
|
|
116
|
+
} = t;
|
|
117
|
+
return /* @__PURE__ */ b(
|
|
118
|
+
J,
|
|
13
119
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
120
|
+
__scopeCheckbox: c,
|
|
121
|
+
checked: r,
|
|
122
|
+
defaultChecked: e,
|
|
123
|
+
disabled: f,
|
|
124
|
+
required: p,
|
|
125
|
+
onCheckedChange: m,
|
|
126
|
+
name: u,
|
|
127
|
+
form: C,
|
|
128
|
+
value: i,
|
|
129
|
+
internal_do_not_use_render: ({ isFormControl: l }) => /* @__PURE__ */ G(K, { children: [
|
|
130
|
+
/* @__PURE__ */ b(
|
|
131
|
+
w,
|
|
132
|
+
{
|
|
133
|
+
...d,
|
|
134
|
+
ref: a,
|
|
135
|
+
__scopeCheckbox: c
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
l && /* @__PURE__ */ b(
|
|
139
|
+
q,
|
|
140
|
+
{
|
|
141
|
+
__scopeCheckbox: c
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
] })
|
|
18
145
|
}
|
|
19
146
|
);
|
|
20
147
|
}
|
|
21
148
|
);
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
(t,
|
|
25
|
-
const {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
149
|
+
Q.displayName = g;
|
|
150
|
+
var T = "CheckboxIndicator", V = s.forwardRef(
|
|
151
|
+
(t, a) => {
|
|
152
|
+
const { __scopeCheckbox: c, forceMount: u, ...r } = t, e = E(T, c);
|
|
153
|
+
return /* @__PURE__ */ b(
|
|
154
|
+
z,
|
|
155
|
+
{
|
|
156
|
+
present: u || h(e.checked) || e.checked === !0,
|
|
157
|
+
children: /* @__PURE__ */ b(
|
|
158
|
+
P.span,
|
|
159
|
+
{
|
|
160
|
+
"data-state": A(e.checked),
|
|
161
|
+
"data-disabled": e.disabled ? "" : void 0,
|
|
162
|
+
...r,
|
|
163
|
+
ref: a,
|
|
164
|
+
style: { pointerEvents: "none", ...t.style }
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
);
|
|
32
169
|
}
|
|
33
170
|
);
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
(t,
|
|
37
|
-
const {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
171
|
+
V.displayName = T;
|
|
172
|
+
var M = "CheckboxBubbleInput", q = s.forwardRef(
|
|
173
|
+
({ __scopeCheckbox: t, ...a }, c) => {
|
|
174
|
+
const {
|
|
175
|
+
control: u,
|
|
176
|
+
hasConsumerStoppedPropagationRef: r,
|
|
177
|
+
checked: e,
|
|
178
|
+
defaultChecked: p,
|
|
179
|
+
required: f,
|
|
180
|
+
disabled: i,
|
|
181
|
+
name: m,
|
|
182
|
+
value: C,
|
|
183
|
+
form: d,
|
|
184
|
+
bubbleInput: l,
|
|
185
|
+
setBubbleInput: v
|
|
186
|
+
} = E(M, t), k = B(c, v), x = j(e), _ = H(u);
|
|
187
|
+
s.useEffect(() => {
|
|
188
|
+
const n = l;
|
|
189
|
+
if (!n) return;
|
|
190
|
+
const I = window.HTMLInputElement.prototype, y = Object.getOwnPropertyDescriptor(
|
|
191
|
+
I,
|
|
192
|
+
"checked"
|
|
193
|
+
).set, D = !r.current;
|
|
194
|
+
if (x !== e && y) {
|
|
195
|
+
const F = new Event("click", { bubbles: D });
|
|
196
|
+
n.indeterminate = h(e), y.call(n, h(e) ? !1 : e), n.dispatchEvent(F);
|
|
197
|
+
}
|
|
198
|
+
}, [l, x, e, r]);
|
|
199
|
+
const o = s.useRef(h(e) ? !1 : e);
|
|
200
|
+
return /* @__PURE__ */ b(
|
|
201
|
+
P.input,
|
|
202
|
+
{
|
|
203
|
+
type: "checkbox",
|
|
204
|
+
"aria-hidden": !0,
|
|
205
|
+
defaultChecked: p ?? o.current,
|
|
206
|
+
required: f,
|
|
207
|
+
disabled: i,
|
|
208
|
+
name: m,
|
|
209
|
+
value: C,
|
|
210
|
+
form: d,
|
|
211
|
+
...a,
|
|
212
|
+
tabIndex: -1,
|
|
213
|
+
ref: k,
|
|
214
|
+
style: {
|
|
215
|
+
...a.style,
|
|
216
|
+
..._,
|
|
217
|
+
position: "absolute",
|
|
218
|
+
pointerEvents: "none",
|
|
219
|
+
opacity: 0,
|
|
220
|
+
margin: 0,
|
|
221
|
+
// We transform because the input is absolutely positioned but we have
|
|
222
|
+
// rendered it **after** the button. This pulls it back to sit on top
|
|
223
|
+
// of the button.
|
|
224
|
+
transform: "translateX(-100%)"
|
|
225
|
+
}
|
|
42
226
|
}
|
|
43
|
-
|
|
227
|
+
);
|
|
44
228
|
}
|
|
45
229
|
);
|
|
46
|
-
|
|
47
|
-
function
|
|
48
|
-
return
|
|
230
|
+
q.displayName = M;
|
|
231
|
+
function W(t) {
|
|
232
|
+
return typeof t == "function";
|
|
49
233
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return
|
|
55
|
-
s(p(a, t));
|
|
56
|
-
}, [a, t]), f(() => {
|
|
57
|
-
const d = (w) => () => {
|
|
58
|
-
s(w);
|
|
59
|
-
};
|
|
60
|
-
if (!a) return;
|
|
61
|
-
const c = d("loaded"), g = d("error");
|
|
62
|
-
return a.addEventListener("load", c), a.addEventListener("error", g), e && (a.referrerPolicy = e), typeof o == "string" && (a.crossOrigin = o), () => {
|
|
63
|
-
a.removeEventListener("load", c), a.removeEventListener("error", g);
|
|
64
|
-
};
|
|
65
|
-
}, [a, o, e]), u;
|
|
234
|
+
function h(t) {
|
|
235
|
+
return t === "indeterminate";
|
|
236
|
+
}
|
|
237
|
+
function A(t) {
|
|
238
|
+
return h(t) ? "indeterminate" : t ? "checked" : "unchecked";
|
|
66
239
|
}
|
|
67
|
-
var H = L, j = E, B = R;
|
|
68
240
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
241
|
+
Q as Checkbox,
|
|
242
|
+
V as CheckboxIndicator,
|
|
243
|
+
V as Indicator,
|
|
244
|
+
Q as Root,
|
|
245
|
+
q as unstable_BubbleInput,
|
|
246
|
+
q as unstable_CheckboxBubbleInput,
|
|
247
|
+
J as unstable_CheckboxProvider,
|
|
248
|
+
w as unstable_CheckboxTrigger,
|
|
249
|
+
J as unstable_Provider,
|
|
250
|
+
w as unstable_Trigger
|
|
75
251
|
};
|
package/dist/index53.js
CHANGED
|
@@ -1,132 +1,24 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
value: p = "on",
|
|
20
|
-
onCheckedChange: w,
|
|
21
|
-
form: s,
|
|
22
|
-
...S
|
|
23
|
-
} = t, [d, u] = r.useState(null), b = P(a, (f) => u(f)), C = r.useRef(!1), k = d ? s || !!d.closest("form") : !0, [l, B] = M({
|
|
24
|
-
prop: o,
|
|
25
|
-
defaultProp: v ?? !1,
|
|
26
|
-
onChange: w,
|
|
27
|
-
caller: h
|
|
28
|
-
});
|
|
29
|
-
return /* @__PURE__ */ A(q, { scope: e, checked: l, disabled: n, children: [
|
|
30
|
-
/* @__PURE__ */ m(
|
|
31
|
-
y.button,
|
|
32
|
-
{
|
|
33
|
-
type: "button",
|
|
34
|
-
role: "switch",
|
|
35
|
-
"aria-checked": l,
|
|
36
|
-
"aria-required": i,
|
|
37
|
-
"data-state": g(l),
|
|
38
|
-
"data-disabled": n ? "" : void 0,
|
|
39
|
-
disabled: n,
|
|
40
|
-
value: p,
|
|
41
|
-
...S,
|
|
42
|
-
ref: b,
|
|
43
|
-
onClick: T(t.onClick, (f) => {
|
|
44
|
-
B((N) => !N), k && (C.current = f.isPropagationStopped(), C.current || f.stopPropagation());
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
),
|
|
48
|
-
k && /* @__PURE__ */ m(
|
|
49
|
-
x,
|
|
50
|
-
{
|
|
51
|
-
control: d,
|
|
52
|
-
bubbles: !C.current,
|
|
53
|
-
name: c,
|
|
54
|
-
value: p,
|
|
55
|
-
checked: l,
|
|
56
|
-
required: i,
|
|
57
|
-
disabled: n,
|
|
58
|
-
form: s,
|
|
59
|
-
style: { transform: "translateX(-100%)" }
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
] });
|
|
63
|
-
}
|
|
64
|
-
);
|
|
65
|
-
R.displayName = h;
|
|
66
|
-
var E = "SwitchThumb", _ = r.forwardRef(
|
|
67
|
-
(t, a) => {
|
|
68
|
-
const { __scopeSwitch: e, ...c } = t, o = z(E, e);
|
|
69
|
-
return /* @__PURE__ */ m(
|
|
70
|
-
y.span,
|
|
71
|
-
{
|
|
72
|
-
"data-state": g(o.checked),
|
|
73
|
-
"data-disabled": o.disabled ? "" : void 0,
|
|
74
|
-
...c,
|
|
75
|
-
ref: a
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
_.displayName = E;
|
|
81
|
-
var L = "SwitchBubbleInput", x = r.forwardRef(
|
|
82
|
-
({
|
|
83
|
-
__scopeSwitch: t,
|
|
84
|
-
control: a,
|
|
85
|
-
checked: e,
|
|
86
|
-
bubbles: c = !0,
|
|
87
|
-
...o
|
|
88
|
-
}, v) => {
|
|
89
|
-
const i = r.useRef(null), n = P(i, v), p = H(e), w = j(a);
|
|
90
|
-
return r.useEffect(() => {
|
|
91
|
-
const s = i.current;
|
|
92
|
-
if (!s) return;
|
|
93
|
-
const S = window.HTMLInputElement.prototype, u = Object.getOwnPropertyDescriptor(
|
|
94
|
-
S,
|
|
95
|
-
"checked"
|
|
96
|
-
).set;
|
|
97
|
-
if (p !== e && u) {
|
|
98
|
-
const b = new Event("click", { bubbles: c });
|
|
99
|
-
u.call(s, e), s.dispatchEvent(b);
|
|
100
|
-
}
|
|
101
|
-
}, [p, e, c]), /* @__PURE__ */ m(
|
|
102
|
-
"input",
|
|
103
|
-
{
|
|
104
|
-
type: "checkbox",
|
|
105
|
-
"aria-hidden": !0,
|
|
106
|
-
defaultChecked: e,
|
|
107
|
-
...o,
|
|
108
|
-
tabIndex: -1,
|
|
109
|
-
ref: n,
|
|
110
|
-
style: {
|
|
111
|
-
...o.style,
|
|
112
|
-
...w,
|
|
113
|
-
position: "absolute",
|
|
114
|
-
pointerEvents: "none",
|
|
115
|
-
opacity: 0,
|
|
116
|
-
margin: 0
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
);
|
|
122
|
-
x.displayName = L;
|
|
123
|
-
function g(t) {
|
|
124
|
-
return t ? "checked" : "unchecked";
|
|
1
|
+
import * as p from "react";
|
|
2
|
+
import { Primitive as v } from "./index86.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
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
i.displayName = d;
|
|
17
|
+
function f(r) {
|
|
18
|
+
return l.includes(r);
|
|
125
19
|
}
|
|
126
|
-
var
|
|
20
|
+
var T = i;
|
|
127
21
|
export {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
_ as SwitchThumb,
|
|
131
|
-
V as Thumb
|
|
22
|
+
T as Root,
|
|
23
|
+
i as Separator
|
|
132
24
|
};
|