@drjoshcsimmons/scl 0.1.5 → 0.1.6
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/globals.css +300 -0
- package/dist/index100.js +4 -9
- package/dist/index101.js +15 -50
- package/dist/index102.js +29 -218
- package/dist/index103.js +178 -27
- package/dist/index104.js +628 -159
- package/dist/index105.js +12 -6
- package/dist/index106.js +206 -21
- package/dist/index107.js +22 -9
- package/dist/index108.js +400 -38
- package/dist/index109.js +6 -18
- package/dist/index11.js +2 -2
- package/dist/index110.js +21 -12
- package/dist/index111.js +9 -206
- package/dist/index112.js +37 -21
- package/dist/index113.js +17 -399
- package/dist/index114.js +25 -2
- package/dist/index115.js +29 -53
- package/dist/index116.js +5 -65
- package/dist/index117.js +2 -2
- package/dist/index118.js +53 -2
- package/dist/index119.js +63 -23
- package/dist/index12.js +1 -1
- package/dist/index120.js +2 -29
- package/dist/index121.js +2 -5
- package/dist/index125.js +1 -1
- package/dist/index126.js +1 -1
- package/dist/index13.js +2 -2
- package/dist/index130.js +1 -1
- package/dist/index131.js +1 -1
- package/dist/index132.js +1 -1
- package/dist/index137.js +21 -11
- package/dist/index138.js +11 -26
- package/dist/index139.js +27 -4
- package/dist/index14.js +2 -2
- package/dist/index140.js +4 -22
- 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 +33 -237
- package/dist/index46.js +241 -11
- package/dist/index47.js +249 -33
- package/dist/index48.js +9 -125
- package/dist/index49.js +12 -73
- package/dist/index5.js +1 -1
- package/dist/index50.js +257 -57
- package/dist/index51.js +12 -254
- package/dist/index52.js +62 -107
- package/dist/index53.js +224 -297
- package/dist/index54.js +4 -5
- package/dist/index55.js +530 -12
- package/dist/index56.js +125 -9
- package/dist/index57.js +285 -410
- package/dist/index58.js +12 -225
- package/dist/index59.js +435 -11
- package/dist/index6.js +1 -1
- package/dist/index60.js +60 -11
- package/dist/index61.js +248 -254
- package/dist/index62.js +130 -12
- package/dist/index63.js +68 -846
- package/dist/index64.js +22 -9
- package/dist/index65.js +25 -524
- package/dist/index66.js +16 -159
- package/dist/index67.js +234 -16
- package/dist/index68.js +11 -22
- package/dist/index69.js +143 -318
- package/dist/index7.js +1 -1
- package/dist/index70.js +325 -119
- package/dist/index71.js +215 -72
- package/dist/index72.js +11 -241
- package/dist/index73.js +823 -212
- package/dist/index74.js +9 -31
- package/dist/index75.js +100 -218
- package/dist/index76.js +5 -66
- package/dist/index78.js +66 -5
- package/dist/index79.js +120 -49
- package/dist/index8.js +1 -1
- package/dist/index80.js +12 -52
- package/dist/index81.js +134 -10
- package/dist/index82.js +11 -4
- package/dist/index83.js +219 -30
- package/dist/index84.js +14 -13
- package/dist/index85.js +65 -48
- package/dist/index86.js +1 -1
- package/dist/index87.js +48 -63
- package/dist/index88.js +51 -10
- package/dist/index89.js +50 -15
- package/dist/index9.js +2 -2
- package/dist/index90.js +9 -46
- package/dist/index91.js +5 -7
- package/dist/index92.js +24 -3
- package/dist/index93.js +54 -5
- package/dist/index94.js +10 -24
- package/dist/index95.js +3 -649
- package/dist/index96.js +29 -124
- package/dist/index97.js +9 -131
- package/dist/index98.js +46 -14
- package/dist/index99.js +7 -14
- package/package.json +19 -11
package/dist/index62.js
CHANGED
|
@@ -1,14 +1,132 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { composeEventHandlers as T } from "./index76.js";
|
|
3
|
+
import { useComposedRefs as P } from "./index77.js";
|
|
4
|
+
import { createContextScope as I } from "./index78.js";
|
|
5
|
+
import { useControllableState as M } from "./index88.js";
|
|
6
|
+
import { usePrevious as H } from "./index91.js";
|
|
7
|
+
import { useSize as j } from "./index92.js";
|
|
8
|
+
import { Primitive as y } from "./index86.js";
|
|
9
|
+
import { jsxs as A, jsx as m } from "react/jsx-runtime";
|
|
10
|
+
var h = "Switch", [U] = I(h), [q, z] = U(h), R = r.forwardRef(
|
|
11
|
+
(t, a) => {
|
|
12
|
+
const {
|
|
13
|
+
__scopeSwitch: e,
|
|
14
|
+
name: c,
|
|
15
|
+
checked: o,
|
|
16
|
+
defaultChecked: v,
|
|
17
|
+
required: i,
|
|
18
|
+
disabled: n,
|
|
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";
|
|
125
|
+
}
|
|
126
|
+
var Q = R, V = _;
|
|
12
127
|
export {
|
|
13
|
-
|
|
128
|
+
Q as Root,
|
|
129
|
+
R as Switch,
|
|
130
|
+
_ as SwitchThumb,
|
|
131
|
+
V as Thumb
|
|
14
132
|
};
|