@drjoshcsimmons/scl 0.2.1 → 0.2.2
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/components/ui/terminal-textarea/terminal-textarea.d.ts +1 -7
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
- package/dist/index100.js +9 -4
- package/dist/index101.js +4 -30
- package/dist/index102.js +647 -10
- package/dist/index103.js +5 -649
- package/dist/index104.js +25 -30
- package/dist/index105.js +30 -4
- package/dist/index106.js +29 -47
- package/dist/index107.js +15 -30
- package/dist/index108.js +177 -51
- package/dist/index109.js +47 -29
- package/dist/index11.js +2 -2
- package/dist/index110.js +51 -44
- package/dist/index111.js +30 -9
- package/dist/index112.js +45 -12
- package/dist/index113.js +6 -48
- package/dist/index114.js +1 -1
- 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 +400 -6
- package/dist/index12.js +1 -1
- package/dist/index120.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/index136.js +1 -1
- package/dist/index137.js +1 -1
- package/dist/index14.js +2 -2
- package/dist/index141.js +1 -1
- package/dist/index142.js +1 -1
- package/dist/index143.js +1 -1
- package/dist/index148.js +11 -21
- package/dist/index149.js +26 -11
- package/dist/index15.js +2 -2
- package/dist/index150.js +4 -27
- package/dist/index151.js +22 -4
- 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/index34.js +18 -16
- package/dist/index36.js +2 -2
- package/dist/index37.js +1 -1
- package/dist/index4.js +2 -2
- package/dist/index45.js +33 -237
- package/dist/index46.js +125 -11
- package/dist/index47.js +237 -33
- package/dist/index48.js +11 -241
- package/dist/index49.js +58 -16
- package/dist/index5.js +1 -1
- package/dist/index50.js +64 -116
- package/dist/index51.js +238 -28
- package/dist/index52.js +326 -63
- package/dist/index53.js +505 -211
- package/dist/index54.js +225 -11
- package/dist/index55.js +9 -60
- package/dist/index56.js +11 -254
- package/dist/index57.js +11 -225
- package/dist/index58.js +130 -9
- package/dist/index59.js +310 -11
- package/dist/index6.js +1 -1
- package/dist/index60.js +12 -130
- package/dist/index61.js +17 -21
- package/dist/index62.js +16 -854
- package/dist/index63.js +254 -9
- package/dist/index64.js +107 -71
- package/dist/index65.js +140 -239
- package/dist/index66.js +260 -12
- package/dist/index67.js +12 -249
- package/dist/index68.js +71 -107
- package/dist/index69.js +811 -481
- package/dist/index7.js +1 -1
- package/dist/index70.js +2 -5
- package/dist/index71.js +30 -434
- package/dist/index72.js +224 -311
- package/dist/index73.js +224 -298
- package/dist/index74.js +4 -4
- package/dist/index75.js +403 -129
- package/dist/index77.js +25 -44
- package/dist/index78.js +5 -25
- package/dist/index79.js +8 -6
- package/dist/index8.js +1 -1
- package/dist/index80.js +44 -50
- package/dist/index81.js +51 -33
- package/dist/index82.js +33 -10
- package/dist/index83.js +10 -7
- package/dist/index84.js +7 -124
- package/dist/index85.js +52 -12
- package/dist/index86.js +10 -134
- package/dist/index87.js +3 -218
- package/dist/index88.js +30 -14
- package/dist/index89.js +11 -67
- package/dist/index9.js +2 -2
- package/dist/index90.js +120 -43
- package/dist/index91.js +218 -49
- package/dist/index92.js +12 -7
- package/dist/index93.js +68 -29
- package/dist/index95.js +27 -178
- package/dist/index96.js +14 -24
- package/dist/index97.js +134 -5
- package/dist/index98.js +44 -51
- package/dist/index99.js +50 -11
- package/package.json +1 -1
package/dist/index72.js
CHANGED
|
@@ -1,338 +1,251 @@
|
|
|
1
1
|
import * as s from "react";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import { Root as ne } from "./index107.js";
|
|
14
|
-
import { jsx as f, jsxs as se } from "react/jsx-runtime";
|
|
15
|
-
var [D] = K("Tooltip", [
|
|
16
|
-
S
|
|
17
|
-
]), O = S(), j = "TooltipProvider", ie = 700, L = "tooltip.open", [ae, k] = D(j), F = (t) => {
|
|
2
|
+
import { useComposedRefs as B } from "./index77.js";
|
|
3
|
+
import { createContextScope as L } from "./index76.js";
|
|
4
|
+
import { composeEventHandlers as S } from "./index78.js";
|
|
5
|
+
import { useControllableState as O } from "./index81.js";
|
|
6
|
+
import { usePrevious as j } from "./index103.js";
|
|
7
|
+
import { useSize as H } from "./index104.js";
|
|
8
|
+
import { Presence as z } from "./index93.js";
|
|
9
|
+
import { Primitive as P } from "./index82.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) {
|
|
18
13
|
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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,
|
|
30
52
|
{
|
|
31
|
-
scope:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
onOpen: s.useCallback(() => {
|
|
35
|
-
window.clearTimeout(i.current), l.current = !1;
|
|
36
|
-
}, []),
|
|
37
|
-
onClose: s.useCallback(() => {
|
|
38
|
-
window.clearTimeout(i.current), i.current = window.setTimeout(
|
|
39
|
-
() => l.current = !0,
|
|
40
|
-
r
|
|
41
|
-
);
|
|
42
|
-
}, [r]),
|
|
43
|
-
isPointerInTransitRef: v,
|
|
44
|
-
onPointerInTransitChange: s.useCallback((p) => {
|
|
45
|
-
v.current = p;
|
|
46
|
-
}, []),
|
|
47
|
-
disableHoverableContent: n,
|
|
48
|
-
children: a
|
|
53
|
+
scope: a,
|
|
54
|
+
...R,
|
|
55
|
+
children: W(d) ? d(R) : u
|
|
49
56
|
}
|
|
50
57
|
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
window.clearTimeout(u.current), u.current = window.setTimeout(() => {
|
|
75
|
-
T.current = !0, C(!0), u.current = 0;
|
|
76
|
-
}, y);
|
|
77
|
-
}, [y, C]);
|
|
78
|
-
return s.useEffect(() => () => {
|
|
79
|
-
u.current && (window.clearTimeout(u.current), u.current = 0);
|
|
80
|
-
}, []), /* @__PURE__ */ f(z, { ...p, children: /* @__PURE__ */ f(
|
|
81
|
-
le,
|
|
82
|
-
{
|
|
83
|
-
scope: o,
|
|
84
|
-
contentId: h,
|
|
85
|
-
open: x,
|
|
86
|
-
stateAttribute: w,
|
|
87
|
-
trigger: c,
|
|
88
|
-
onTriggerChange: d,
|
|
89
|
-
onTriggerEnter: s.useCallback(() => {
|
|
90
|
-
i.isOpenDelayedRef.current ? I() : P();
|
|
91
|
-
}, [i.isOpenDelayedRef, I, P]),
|
|
92
|
-
onTriggerLeave: s.useCallback(() => {
|
|
93
|
-
m ? E() : (window.clearTimeout(u.current), u.current = 0);
|
|
94
|
-
}, [E, m]),
|
|
95
|
-
onOpen: P,
|
|
96
|
-
onClose: E,
|
|
97
|
-
disableHoverableContent: m,
|
|
98
|
-
children: e
|
|
99
|
-
}
|
|
100
|
-
) });
|
|
101
|
-
};
|
|
102
|
-
B.displayName = R;
|
|
103
|
-
var A = "TooltipTrigger", U = s.forwardRef(
|
|
104
|
-
(t, o) => {
|
|
105
|
-
const { __scopeTooltip: e, ...r } = t, n = _(A, e), a = k(A, e), l = O(e), v = s.useRef(null), i = N(o, v, n.onTriggerChange), p = s.useRef(!1), c = s.useRef(!1), d = s.useCallback(() => p.current = !1, []);
|
|
106
|
-
return s.useEffect(() => () => document.removeEventListener("pointerup", d), [d]), /* @__PURE__ */ f(J, { asChild: !0, ...l, children: /* @__PURE__ */ f(
|
|
107
|
-
te.button,
|
|
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,
|
|
108
81
|
{
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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();
|
|
118
94
|
}),
|
|
119
|
-
|
|
120
|
-
n
|
|
121
|
-
})
|
|
122
|
-
onFocus: g(t.onFocus, () => {
|
|
123
|
-
p.current || n.onOpen();
|
|
124
|
-
}),
|
|
125
|
-
onBlur: g(t.onBlur, n.onClose),
|
|
126
|
-
onClick: g(t.onClick, n.onClose)
|
|
95
|
+
onClick: S(c, (o) => {
|
|
96
|
+
d((n) => h(n) ? !0 : !n), k && v && (l.current = o.isPropagationStopped(), l.current || o.stopPropagation());
|
|
97
|
+
})
|
|
127
98
|
}
|
|
128
|
-
)
|
|
99
|
+
);
|
|
129
100
|
}
|
|
130
101
|
);
|
|
131
|
-
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
}), V = (t) => {
|
|
135
|
-
const { __scopeTooltip: o, forceMount: e, children: r, container: n } = t, a = _(M, o);
|
|
136
|
-
return /* @__PURE__ */ f(ce, { scope: o, forceMount: e, children: /* @__PURE__ */ f(G, { present: e || a.open, children: /* @__PURE__ */ f(ee, { asChild: !0, container: n, children: r }) }) });
|
|
137
|
-
};
|
|
138
|
-
V.displayName = M;
|
|
139
|
-
var b = "TooltipContent", Y = s.forwardRef(
|
|
140
|
-
(t, o) => {
|
|
141
|
-
const e = ue(b, t.__scopeTooltip), { forceMount: r = e.forceMount, side: n = "top", ...a } = t, l = _(b, t.__scopeTooltip);
|
|
142
|
-
return /* @__PURE__ */ f(G, { present: r || l.open, children: l.disableHoverableContent ? /* @__PURE__ */ f(q, { side: n, ...a, ref: o }) : /* @__PURE__ */ f(pe, { side: n, ...a, ref: o }) });
|
|
143
|
-
}
|
|
144
|
-
), pe = s.forwardRef((t, o) => {
|
|
145
|
-
const e = _(b, t.__scopeTooltip), r = k(b, t.__scopeTooltip), n = s.useRef(null), a = N(o, n), [l, v] = s.useState(null), { trigger: i, onClose: p } = e, c = n.current, { onPointerInTransitChange: d } = r, h = s.useCallback(() => {
|
|
146
|
-
v(null), d(!1);
|
|
147
|
-
}, [d]), u = s.useCallback(
|
|
148
|
-
(m, y) => {
|
|
149
|
-
const T = m.currentTarget, x = { x: m.clientX, y: m.clientY }, C = me(x, T.getBoundingClientRect()), w = Te(x, C), P = ye(y.getBoundingClientRect()), E = xe([...w, ...P]);
|
|
150
|
-
v(E), d(!0);
|
|
151
|
-
},
|
|
152
|
-
[d]
|
|
153
|
-
);
|
|
154
|
-
return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
|
|
155
|
-
if (i && c) {
|
|
156
|
-
const m = (T) => u(T, c), y = (T) => u(T, i);
|
|
157
|
-
return i.addEventListener("pointerleave", m), c.addEventListener("pointerleave", y), () => {
|
|
158
|
-
i.removeEventListener("pointerleave", m), c.removeEventListener("pointerleave", y);
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
}, [i, c, u, h]), s.useEffect(() => {
|
|
162
|
-
if (l) {
|
|
163
|
-
const m = (y) => {
|
|
164
|
-
const T = y.target, x = { x: y.clientX, y: y.clientY }, C = (i == null ? void 0 : i.contains(T)) || (c == null ? void 0 : c.contains(T)), w = !Ce(x, l);
|
|
165
|
-
C ? h() : w && (h(), p());
|
|
166
|
-
};
|
|
167
|
-
return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
|
|
168
|
-
}
|
|
169
|
-
}, [i, c, l, p, h]), /* @__PURE__ */ f(q, { ...t, ref: a });
|
|
170
|
-
}), [de, fe] = D(R, { isInside: !1 }), ve = oe("TooltipContent"), q = s.forwardRef(
|
|
171
|
-
(t, o) => {
|
|
102
|
+
w.displayName = N;
|
|
103
|
+
var Q = s.forwardRef(
|
|
104
|
+
(t, a) => {
|
|
172
105
|
const {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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,
|
|
119
|
+
{
|
|
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
|
+
] })
|
|
187
145
|
}
|
|
188
|
-
|
|
189
|
-
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
);
|
|
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,
|
|
190
155
|
{
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
onPointerDownOutside: l,
|
|
195
|
-
onFocusOutside: (d) => d.preventDefault(),
|
|
196
|
-
onDismiss: c,
|
|
197
|
-
children: /* @__PURE__ */ se(
|
|
198
|
-
Q,
|
|
156
|
+
present: u || h(e.checked) || e.checked === !0,
|
|
157
|
+
children: /* @__PURE__ */ b(
|
|
158
|
+
P.span,
|
|
199
159
|
{
|
|
200
|
-
"data-state":
|
|
201
|
-
|
|
202
|
-
...
|
|
203
|
-
ref:
|
|
204
|
-
style: {
|
|
205
|
-
...v.style,
|
|
206
|
-
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
207
|
-
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
208
|
-
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
209
|
-
"--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
|
|
210
|
-
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
211
|
-
},
|
|
212
|
-
children: [
|
|
213
|
-
/* @__PURE__ */ f(ve, { children: r }),
|
|
214
|
-
/* @__PURE__ */ f(de, { scope: e, isInside: !0, children: /* @__PURE__ */ f(ne, { id: i.contentId, role: "tooltip", children: n || r }) })
|
|
215
|
-
]
|
|
160
|
+
"data-state": A(e.checked),
|
|
161
|
+
"data-disabled": e.disabled ? "" : void 0,
|
|
162
|
+
...r,
|
|
163
|
+
ref: a,
|
|
164
|
+
style: { pointerEvents: "none", ...t.style }
|
|
216
165
|
}
|
|
217
166
|
)
|
|
218
167
|
}
|
|
219
168
|
);
|
|
220
169
|
}
|
|
221
170
|
);
|
|
222
|
-
|
|
223
|
-
var
|
|
224
|
-
(t,
|
|
225
|
-
const {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
e
|
|
229
|
-
|
|
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
|
+
}
|
|
226
|
+
}
|
|
227
|
+
);
|
|
230
228
|
}
|
|
231
229
|
);
|
|
232
|
-
|
|
233
|
-
function
|
|
234
|
-
|
|
235
|
-
switch (Math.min(e, r, n, a)) {
|
|
236
|
-
case a:
|
|
237
|
-
return "left";
|
|
238
|
-
case n:
|
|
239
|
-
return "right";
|
|
240
|
-
case e:
|
|
241
|
-
return "top";
|
|
242
|
-
case r:
|
|
243
|
-
return "bottom";
|
|
244
|
-
default:
|
|
245
|
-
throw new Error("unreachable");
|
|
246
|
-
}
|
|
230
|
+
q.displayName = M;
|
|
231
|
+
function W(t) {
|
|
232
|
+
return typeof t == "function";
|
|
247
233
|
}
|
|
248
|
-
function
|
|
249
|
-
|
|
250
|
-
switch (o) {
|
|
251
|
-
case "top":
|
|
252
|
-
r.push(
|
|
253
|
-
{ x: t.x - e, y: t.y + e },
|
|
254
|
-
{ x: t.x + e, y: t.y + e }
|
|
255
|
-
);
|
|
256
|
-
break;
|
|
257
|
-
case "bottom":
|
|
258
|
-
r.push(
|
|
259
|
-
{ x: t.x - e, y: t.y - e },
|
|
260
|
-
{ x: t.x + e, y: t.y - e }
|
|
261
|
-
);
|
|
262
|
-
break;
|
|
263
|
-
case "left":
|
|
264
|
-
r.push(
|
|
265
|
-
{ x: t.x + e, y: t.y - e },
|
|
266
|
-
{ x: t.x + e, y: t.y + e }
|
|
267
|
-
);
|
|
268
|
-
break;
|
|
269
|
-
case "right":
|
|
270
|
-
r.push(
|
|
271
|
-
{ x: t.x - e, y: t.y - e },
|
|
272
|
-
{ x: t.x - e, y: t.y + e }
|
|
273
|
-
);
|
|
274
|
-
break;
|
|
275
|
-
}
|
|
276
|
-
return r;
|
|
277
|
-
}
|
|
278
|
-
function ye(t) {
|
|
279
|
-
const { top: o, right: e, bottom: r, left: n } = t;
|
|
280
|
-
return [
|
|
281
|
-
{ x: n, y: o },
|
|
282
|
-
{ x: e, y: o },
|
|
283
|
-
{ x: e, y: r },
|
|
284
|
-
{ x: n, y: r }
|
|
285
|
-
];
|
|
286
|
-
}
|
|
287
|
-
function Ce(t, o) {
|
|
288
|
-
const { x: e, y: r } = t;
|
|
289
|
-
let n = !1;
|
|
290
|
-
for (let a = 0, l = o.length - 1; a < o.length; l = a++) {
|
|
291
|
-
const v = o[a], i = o[l], p = v.x, c = v.y, d = i.x, h = i.y;
|
|
292
|
-
c > r != h > r && e < (d - p) * (r - c) / (h - c) + p && (n = !n);
|
|
293
|
-
}
|
|
294
|
-
return n;
|
|
295
|
-
}
|
|
296
|
-
function xe(t) {
|
|
297
|
-
const o = t.slice();
|
|
298
|
-
return o.sort((e, r) => e.x < r.x ? -1 : e.x > r.x ? 1 : e.y < r.y ? -1 : e.y > r.y ? 1 : 0), ge(o);
|
|
234
|
+
function h(t) {
|
|
235
|
+
return t === "indeterminate";
|
|
299
236
|
}
|
|
300
|
-
function
|
|
301
|
-
|
|
302
|
-
const o = [];
|
|
303
|
-
for (let r = 0; r < t.length; r++) {
|
|
304
|
-
const n = t[r];
|
|
305
|
-
for (; o.length >= 2; ) {
|
|
306
|
-
const a = o[o.length - 1], l = o[o.length - 2];
|
|
307
|
-
if ((a.x - l.x) * (n.y - l.y) >= (a.y - l.y) * (n.x - l.x)) o.pop();
|
|
308
|
-
else break;
|
|
309
|
-
}
|
|
310
|
-
o.push(n);
|
|
311
|
-
}
|
|
312
|
-
o.pop();
|
|
313
|
-
const e = [];
|
|
314
|
-
for (let r = t.length - 1; r >= 0; r--) {
|
|
315
|
-
const n = t[r];
|
|
316
|
-
for (; e.length >= 2; ) {
|
|
317
|
-
const a = e[e.length - 1], l = e[e.length - 2];
|
|
318
|
-
if ((a.x - l.x) * (n.y - l.y) >= (a.y - l.y) * (n.x - l.x)) e.pop();
|
|
319
|
-
else break;
|
|
320
|
-
}
|
|
321
|
-
e.push(n);
|
|
322
|
-
}
|
|
323
|
-
return e.pop(), o.length === 1 && e.length === 1 && o[0].x === e[0].x && o[0].y === e[0].y ? o : o.concat(e);
|
|
237
|
+
function A(t) {
|
|
238
|
+
return h(t) ? "indeterminate" : t ? "checked" : "unchecked";
|
|
324
239
|
}
|
|
325
|
-
var He = F, Ne = B, Se = U, Ge = V, je = Y;
|
|
326
240
|
export {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
Se as Trigger
|
|
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
|
|
338
251
|
};
|