@drjoshcsimmons/scl 0.2.8 → 0.3.1
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/accordion/accordion.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.d.ts +5 -4
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/index.d.ts +1 -1
- package/dist/components/ui/alert/index.d.ts.map +1 -1
- package/dist/components/ui/avatar/avatar.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +4 -6
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/badge/index.d.ts +1 -1
- package/dist/components/ui/badge/index.d.ts.map +1 -1
- package/dist/components/ui/button/button.d.ts +6 -7
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/button/index.d.ts +1 -1
- package/dist/components/ui/button/index.d.ts.map +1 -1
- package/dist/components/ui/card/card.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/collapsible/collapsible.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/input/input.d.ts.map +1 -1
- package/dist/components/ui/label/label.d.ts +1 -2
- package/dist/components/ui/label/label.d.ts.map +1 -1
- package/dist/components/ui/popover/popover.d.ts.map +1 -1
- package/dist/components/ui/progress/progress.d.ts +0 -3
- package/dist/components/ui/progress/progress.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/select/select.d.ts.map +1 -1
- package/dist/components/ui/separator/separator.d.ts.map +1 -1
- package/dist/components/ui/skeleton/skeleton.d.ts +1 -0
- package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/ui/slider/slider.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/table/table.d.ts.map +1 -1
- package/dist/components/ui/tabs/tabs.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/components/ui/toggle/index.d.ts +1 -1
- package/dist/components/ui/toggle/index.d.ts.map +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +6 -10
- package/dist/components/ui/toggle/toggle.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/globals.css +222 -287
- package/dist/index.d.ts +1 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +115 -184
- package/dist/index10.js +29 -57
- package/dist/index100.js +6 -30
- package/dist/index101.js +44 -11
- package/dist/index102.js +54 -5
- package/dist/index103.js +30 -25
- package/dist/index104.js +30 -9
- package/dist/index105.js +3 -180
- package/dist/index106.js +218 -3
- package/dist/index107.js +47 -29
- package/dist/index108.js +30 -9
- package/dist/index109.js +47 -29
- package/dist/index11.js +6 -19
- package/dist/index110.js +8 -54
- package/dist/index111.js +6 -30
- package/dist/index112.js +1 -1
- package/dist/index113.js +11 -47
- package/dist/index114.js +1 -1
- package/dist/index115.js +204 -10
- package/dist/index116.js +20 -204
- package/dist/index117.js +399 -21
- package/dist/index118.js +2 -400
- package/dist/index119.js +50 -45
- package/dist/index12.js +80 -5
- package/dist/index120.js +65 -6
- package/dist/index121.js +24 -20
- package/dist/index122.js +29 -9
- package/dist/index123.js +5 -38
- package/dist/index124.js +2 -18
- package/dist/index125.js +2 -25
- package/dist/index126.js +5 -29
- package/dist/index127.js +3 -5
- package/dist/index128.js +24 -2
- package/dist/index129.js +109 -49
- package/dist/index13.js +16 -136
- package/dist/index130.js +15 -64
- package/dist/index131.js +525 -2
- package/dist/index132.js +128 -2
- package/dist/index133.js +134 -5
- package/dist/index134.js +65 -3
- package/dist/index135.js +69 -24
- package/dist/index136.js +9 -113
- package/dist/index137.js +14 -16
- package/dist/index138.js +64 -523
- package/dist/index139.js +3 -127
- package/dist/index14.js +11 -97
- package/dist/index140.js +22 -133
- package/dist/index141.js +12 -64
- package/dist/index142.js +27 -68
- package/dist/index143.js +4 -8
- package/dist/index144.js +23 -14
- package/dist/index15.js +18 -72
- package/dist/index16.js +30 -252
- package/dist/index17.js +20 -133
- package/dist/index18.js +37 -89
- package/dist/index19.js +138 -18
- package/dist/index2.js +5 -5
- package/dist/index20.js +21 -10
- package/dist/index21.js +13 -22
- package/dist/index22.js +24 -35
- package/dist/index23.js +13 -19
- package/dist/index24.js +32 -37
- package/dist/index25.js +23 -102
- package/dist/index26.js +16 -20
- package/dist/index27.js +11 -72
- package/dist/index28.js +24 -12
- package/dist/index29.js +99 -28
- package/dist/index3.js +6 -6
- package/dist/index30.js +39 -111
- package/dist/index31.js +11 -25
- package/dist/index32.js +49 -65
- package/dist/index33.js +65 -43
- package/dist/index34.js +230 -79
- package/dist/index36.js +58 -33
- package/dist/index4.js +42 -26
- package/dist/index41.js +73 -49
- package/dist/index43.js +159 -13
- package/dist/index45.js +232 -210
- package/dist/index47.js +16 -223
- package/dist/index5.js +21 -32
- package/dist/index50.js +236 -11
- package/dist/index52.js +30 -309
- package/dist/index55.js +860 -18
- package/dist/index57.js +71 -249
- package/dist/index59.js +22 -12
- package/dist/index6.js +26 -70
- package/dist/index61.js +509 -109
- package/dist/index63.js +225 -109
- package/dist/index65.js +409 -210
- package/dist/index67.js +103 -321
- package/dist/index69.js +245 -18
- package/dist/index7.js +7 -40
- package/dist/index71.js +320 -66
- package/dist/index73.js +111 -416
- package/dist/index77.js +25 -44
- package/dist/index78.js +52 -24
- package/dist/index79.js +10 -6
- package/dist/index8.js +20 -26
- package/dist/index80.js +4 -52
- package/dist/index81.js +8 -12
- package/dist/index82.js +12 -10
- package/dist/index83.js +30 -8
- package/dist/index84.js +5 -123
- package/dist/index85.js +65 -12
- package/dist/index86.js +173 -127
- package/dist/index87.js +66 -216
- package/dist/index88.js +33 -13
- package/dist/index89.js +7 -68
- package/dist/index9.js +33 -36
- package/dist/index90.js +49 -45
- package/dist/index91.js +11 -50
- package/dist/index92.js +124 -8
- package/dist/index93.js +135 -4
- package/dist/index94.js +13 -649
- package/dist/index95.js +13 -13
- package/dist/index96.js +9 -30
- package/dist/index97.js +49 -47
- package/dist/index98.js +44 -51
- package/dist/index99.js +24 -10
- package/dist/lib/utils.d.ts +8 -8
- package/dist/lib/utils.d.ts.map +1 -1
- package/package.json +5 -46
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts +0 -21
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +0 -1
- package/dist/components/ui/alert-dialog/index.d.ts +0 -2
- package/dist/components/ui/alert-dialog/index.d.ts.map +0 -1
- package/dist/components/ui/combobox/combobox.d.ts +0 -31
- package/dist/components/ui/combobox/combobox.d.ts.map +0 -1
- package/dist/components/ui/combobox/index.d.ts +0 -3
- package/dist/components/ui/combobox/index.d.ts.map +0 -1
- package/dist/components/ui/command/command.d.ts +0 -85
- package/dist/components/ui/command/command.d.ts.map +0 -1
- package/dist/components/ui/command/index.d.ts +0 -2
- package/dist/components/ui/command/index.d.ts.map +0 -1
- package/dist/components/ui/dithered-image/dithered-image.d.ts +0 -21
- package/dist/components/ui/dithered-image/dithered-image.d.ts.map +0 -1
- package/dist/components/ui/dithered-image/index.d.ts +0 -3
- package/dist/components/ui/dithered-image/index.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +0 -28
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu/index.d.ts +0 -2
- package/dist/components/ui/dropdown-menu/index.d.ts.map +0 -1
- package/dist/components/ui/form/form.d.ts +0 -24
- package/dist/components/ui/form/form.d.ts.map +0 -1
- package/dist/components/ui/form/index.d.ts +0 -2
- package/dist/components/ui/form/index.d.ts.map +0 -1
- package/dist/components/ui/sheet/index.d.ts +0 -2
- package/dist/components/ui/sheet/index.d.ts.map +0 -1
- package/dist/components/ui/sheet/sheet.d.ts +0 -26
- package/dist/components/ui/sheet/sheet.d.ts.map +0 -1
- package/dist/components/ui/statusline/index.d.ts +0 -2
- package/dist/components/ui/statusline/index.d.ts.map +0 -1
- package/dist/components/ui/statusline/statusline.d.ts +0 -40
- package/dist/components/ui/statusline/statusline.d.ts.map +0 -1
- package/dist/components/ui/terminal-textarea/index.d.ts +0 -2
- package/dist/components/ui/terminal-textarea/index.d.ts.map +0 -1
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +0 -16
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +0 -1
- package/dist/index145.js +0 -68
- package/dist/index146.js +0 -6
- package/dist/index147.js +0 -25
- package/dist/index148.js +0 -25
- package/dist/index149.js +0 -15
- package/dist/index150.js +0 -30
- package/dist/index151.js +0 -7
- package/dist/index35.js +0 -20
- package/dist/index37.js +0 -28
- package/dist/index38.js +0 -102
- package/dist/index39.js +0 -41
- package/dist/index40.js +0 -13
- package/dist/index42.js +0 -68
- package/dist/index44.js +0 -2265
- package/dist/index46.js +0 -13
- package/dist/index48.js +0 -11
- package/dist/index49.js +0 -13
- package/dist/index51.js +0 -243
- package/dist/index53.js +0 -14
- package/dist/index54.js +0 -120
- package/dist/index56.js +0 -35
- package/dist/index58.js +0 -14
- package/dist/index60.js +0 -75
- package/dist/index62.js +0 -62
- package/dist/index64.js +0 -256
- package/dist/index66.js +0 -532
- package/dist/index68.js +0 -251
- package/dist/index70.js +0 -163
- package/dist/index72.js +0 -33
- package/dist/index74.js +0 -862
- package/dist/index75.js +0 -11
- package/dist/index76.js +0 -70
package/dist/index78.js
CHANGED
|
@@ -1,29 +1,57 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
3
|
+
function $(e, x = []) {
|
|
4
|
+
let o = [];
|
|
5
|
+
function f(r, n) {
|
|
6
|
+
const t = i.createContext(n);
|
|
7
|
+
t.displayName = r + "Context";
|
|
8
|
+
const c = o.length;
|
|
9
|
+
o = [...o, n];
|
|
10
|
+
const m = (a) => {
|
|
11
|
+
var l;
|
|
12
|
+
const { scope: s, children: C, ...p } = a, d = ((l = s == null ? void 0 : s[e]) == null ? void 0 : l[c]) || t, v = i.useMemo(() => p, Object.values(p));
|
|
13
|
+
return /* @__PURE__ */ _(d.Provider, { value: v, children: C });
|
|
14
|
+
};
|
|
15
|
+
m.displayName = r + "Provider";
|
|
16
|
+
function S(a, s) {
|
|
17
|
+
var d;
|
|
18
|
+
const C = ((d = s == null ? void 0 : s[e]) == null ? void 0 : d[c]) || t, p = i.useContext(C);
|
|
19
|
+
if (p) return p;
|
|
20
|
+
if (n !== void 0) return n;
|
|
21
|
+
throw new Error(`\`${a}\` must be used within \`${r}\``);
|
|
22
|
+
}
|
|
23
|
+
return [m, S];
|
|
24
|
+
}
|
|
25
|
+
const u = () => {
|
|
26
|
+
const r = o.map((n) => i.createContext(n));
|
|
27
|
+
return function(t) {
|
|
28
|
+
const c = (t == null ? void 0 : t[e]) || r;
|
|
29
|
+
return i.useMemo(
|
|
30
|
+
() => ({ [`__scope${e}`]: { ...t, [e]: c } }),
|
|
31
|
+
[t, c]
|
|
32
|
+
);
|
|
33
|
+
};
|
|
21
34
|
};
|
|
35
|
+
return u.scopeName = e, [f, h(u, ...x)];
|
|
22
36
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
37
|
+
function h(...e) {
|
|
38
|
+
const x = e[0];
|
|
39
|
+
if (e.length === 1) return x;
|
|
40
|
+
const o = () => {
|
|
41
|
+
const f = e.map((u) => ({
|
|
42
|
+
useScope: u(),
|
|
43
|
+
scopeName: u.scopeName
|
|
44
|
+
}));
|
|
45
|
+
return function(r) {
|
|
46
|
+
const n = f.reduce((t, { useScope: c, scopeName: m }) => {
|
|
47
|
+
const a = c(r)[`__scope${m}`];
|
|
48
|
+
return { ...t, ...a };
|
|
49
|
+
}, {});
|
|
50
|
+
return i.useMemo(() => ({ [`__scope${x.scopeName}`]: n }), [n]);
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
return o.scopeName = x.scopeName, o;
|
|
25
54
|
}
|
|
26
55
|
export {
|
|
27
|
-
|
|
28
|
-
s as useComposedRefs
|
|
56
|
+
$ as createContextScope
|
|
29
57
|
};
|
package/dist/index79.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
function o(t) {
|
|
3
|
+
const e = r.useRef(t);
|
|
4
|
+
return r.useEffect(() => {
|
|
5
|
+
e.current = t;
|
|
6
|
+
}), r.useMemo(() => (...n) => {
|
|
7
|
+
var u;
|
|
8
|
+
return (u = e.current) == null ? void 0 : u.call(e, ...n);
|
|
9
|
+
}, []);
|
|
6
10
|
}
|
|
7
11
|
export {
|
|
8
|
-
|
|
12
|
+
o as useCallbackRef
|
|
9
13
|
};
|
package/dist/index8.js
CHANGED
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
defaultVariants: {
|
|
20
|
-
variant: "default"
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { Root as n } from "./index36.js";
|
|
3
|
+
import * as c from "react";
|
|
4
|
+
import { cx as e } from "./index2.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
const f = c.forwardRef(
|
|
7
|
+
({ className: t, variant: o = "primary", size: r = "default", asChild: m = !1, ...s }, a) => /* @__PURE__ */ p(
|
|
8
|
+
m ? n : "button",
|
|
9
|
+
{
|
|
10
|
+
className: e(
|
|
11
|
+
"scl-button",
|
|
12
|
+
`scl-button--${o}`,
|
|
13
|
+
`scl-button--${r}`,
|
|
14
|
+
t
|
|
15
|
+
),
|
|
16
|
+
ref: a,
|
|
17
|
+
...s
|
|
21
18
|
}
|
|
22
|
-
|
|
19
|
+
)
|
|
23
20
|
);
|
|
24
|
-
|
|
25
|
-
return /* @__PURE__ */ n("div", { className: a(i({ variant: e }), r), ...t });
|
|
26
|
-
}
|
|
21
|
+
f.displayName = "Button";
|
|
27
22
|
export {
|
|
28
|
-
|
|
29
|
-
i as badgeVariants
|
|
23
|
+
f as Button
|
|
30
24
|
};
|
package/dist/index80.js
CHANGED
|
@@ -1,54 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
|
|
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";
|
|
51
|
-
}
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
var e = globalThis != null && globalThis.document ? t.useLayoutEffect : () => {
|
|
3
|
+
};
|
|
52
4
|
export {
|
|
53
|
-
|
|
5
|
+
e as useLayoutEffect
|
|
54
6
|
};
|
package/dist/index81.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as f from "react";
|
|
2
|
-
import
|
|
3
|
-
import { createSlot as
|
|
4
|
-
import { jsx as
|
|
2
|
+
import "react-dom";
|
|
3
|
+
import { createSlot as l } from "./index36.js";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
5
|
var u = [
|
|
6
6
|
"a",
|
|
7
7
|
"button",
|
|
@@ -20,17 +20,13 @@ var u = [
|
|
|
20
20
|
"span",
|
|
21
21
|
"svg",
|
|
22
22
|
"ul"
|
|
23
|
-
],
|
|
24
|
-
const o =
|
|
25
|
-
const { asChild:
|
|
26
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
23
|
+
], w = u.reduce((t, i) => {
|
|
24
|
+
const o = l(`Primitive.${i}`), r = f.forwardRef((e, m) => {
|
|
25
|
+
const { asChild: a, ...p } = e, s = a ? o : i;
|
|
26
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ n(s, { ...p, ref: m });
|
|
27
27
|
});
|
|
28
28
|
return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
|
|
29
29
|
}, {});
|
|
30
|
-
function w(t, i) {
|
|
31
|
-
t && p.flushSync(() => t.dispatchEvent(i));
|
|
32
|
-
}
|
|
33
30
|
export {
|
|
34
|
-
|
|
35
|
-
w as dispatchDiscreteCustomEvent
|
|
31
|
+
w as Primitive
|
|
36
32
|
};
|
package/dist/index82.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { s as r } from "./index111.js";
|
|
2
|
+
function s() {
|
|
3
|
+
return r.useSyncExternalStore(
|
|
4
|
+
e,
|
|
5
|
+
() => !0,
|
|
6
|
+
() => !1
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
function e() {
|
|
10
|
+
return () => {
|
|
11
|
+
};
|
|
10
12
|
}
|
|
11
13
|
export {
|
|
12
|
-
|
|
14
|
+
s as useIsHydrated
|
|
13
15
|
};
|
package/dist/index83.js
CHANGED
|
@@ -1,10 +1,32 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import "react
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import "react-dom";
|
|
3
|
+
import { createSlot as l } from "./index36.js";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
var u = [
|
|
6
|
+
"a",
|
|
7
|
+
"button",
|
|
8
|
+
"div",
|
|
9
|
+
"form",
|
|
10
|
+
"h2",
|
|
11
|
+
"h3",
|
|
12
|
+
"img",
|
|
13
|
+
"input",
|
|
14
|
+
"label",
|
|
15
|
+
"li",
|
|
16
|
+
"nav",
|
|
17
|
+
"ol",
|
|
18
|
+
"p",
|
|
19
|
+
"select",
|
|
20
|
+
"span",
|
|
21
|
+
"svg",
|
|
22
|
+
"ul"
|
|
23
|
+
], w = u.reduce((t, i) => {
|
|
24
|
+
const o = l(`Primitive.${i}`), r = f.forwardRef((e, m) => {
|
|
25
|
+
const { asChild: a, ...p } = e, s = a ? o : i;
|
|
26
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ n(s, { ...p, ref: m });
|
|
27
|
+
});
|
|
28
|
+
return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
|
|
29
|
+
}, {});
|
|
8
30
|
export {
|
|
9
|
-
|
|
31
|
+
w as Primitive
|
|
10
32
|
};
|
package/dist/index84.js
CHANGED
|
@@ -1,127 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { useCallbackRef as w } from "./index99.js";
|
|
6
|
-
import { useEscapeKeydown as U } from "./index115.js";
|
|
7
|
-
import { jsx as T } from "react/jsx-runtime";
|
|
8
|
-
var z = "DismissableLayer", y = "dismissableLayer.update", H = "dismissableLayer.pointerDownOutside", M = "dismissableLayer.focusOutside", L, B = n.createContext({
|
|
9
|
-
layers: /* @__PURE__ */ new Set(),
|
|
10
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
11
|
-
branches: /* @__PURE__ */ new Set()
|
|
12
|
-
}), j = n.forwardRef(
|
|
13
|
-
(r, e) => {
|
|
14
|
-
const {
|
|
15
|
-
disableOutsidePointerEvents: i = !1,
|
|
16
|
-
onEscapeKeyDown: o,
|
|
17
|
-
onPointerDownOutside: t,
|
|
18
|
-
onFocusOutside: a,
|
|
19
|
-
onInteractOutside: l,
|
|
20
|
-
onDismiss: d,
|
|
21
|
-
...v
|
|
22
|
-
} = r, c = n.useContext(B), [u, S] = n.useState(null), f = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, F] = n.useState({}), W = R(e, (s) => S(s)), p = Array.from(c.layers), [A] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), N = p.indexOf(A), b = u ? p.indexOf(u) : -1, I = c.layersWithOutsidePointerEventsDisabled.size > 0, P = b >= N, _ = q((s) => {
|
|
23
|
-
const E = s.target, C = [...c.branches].some((h) => h.contains(E));
|
|
24
|
-
!P || C || (t == null || t(s), l == null || l(s), s.defaultPrevented || d == null || d());
|
|
25
|
-
}, f), D = G((s) => {
|
|
26
|
-
const E = s.target;
|
|
27
|
-
[...c.branches].some((h) => h.contains(E)) || (a == null || a(s), l == null || l(s), s.defaultPrevented || d == null || d());
|
|
28
|
-
}, f);
|
|
29
|
-
return U((s) => {
|
|
30
|
-
b === c.layers.size - 1 && (o == null || o(s), !s.defaultPrevented && d && (s.preventDefault(), d()));
|
|
31
|
-
}, f), n.useEffect(() => {
|
|
32
|
-
if (u)
|
|
33
|
-
return i && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (L = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(u)), c.layers.add(u), O(), () => {
|
|
34
|
-
i && c.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = L);
|
|
35
|
-
};
|
|
36
|
-
}, [u, f, i, c]), n.useEffect(() => () => {
|
|
37
|
-
u && (c.layers.delete(u), c.layersWithOutsidePointerEventsDisabled.delete(u), O());
|
|
38
|
-
}, [u, c]), n.useEffect(() => {
|
|
39
|
-
const s = () => F({});
|
|
40
|
-
return document.addEventListener(y, s), () => document.removeEventListener(y, s);
|
|
41
|
-
}, []), /* @__PURE__ */ T(
|
|
42
|
-
g.div,
|
|
43
|
-
{
|
|
44
|
-
...v,
|
|
45
|
-
ref: W,
|
|
46
|
-
style: {
|
|
47
|
-
pointerEvents: I ? P ? "auto" : "none" : void 0,
|
|
48
|
-
...r.style
|
|
49
|
-
},
|
|
50
|
-
onFocusCapture: m(r.onFocusCapture, D.onFocusCapture),
|
|
51
|
-
onBlurCapture: m(r.onBlurCapture, D.onBlurCapture),
|
|
52
|
-
onPointerDownCapture: m(
|
|
53
|
-
r.onPointerDownCapture,
|
|
54
|
-
_.onPointerDownCapture
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
j.displayName = z;
|
|
61
|
-
var X = "DismissableLayerBranch", Y = n.forwardRef((r, e) => {
|
|
62
|
-
const i = n.useContext(B), o = n.useRef(null), t = R(e, o);
|
|
63
|
-
return n.useEffect(() => {
|
|
64
|
-
const a = o.current;
|
|
65
|
-
if (a)
|
|
66
|
-
return i.branches.add(a), () => {
|
|
67
|
-
i.branches.delete(a);
|
|
68
|
-
};
|
|
69
|
-
}, [i.branches]), /* @__PURE__ */ T(g.div, { ...r, ref: t });
|
|
70
|
-
});
|
|
71
|
-
Y.displayName = X;
|
|
72
|
-
function q(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
73
|
-
const i = w(r), o = n.useRef(!1), t = n.useRef(() => {
|
|
74
|
-
});
|
|
75
|
-
return n.useEffect(() => {
|
|
76
|
-
const a = (d) => {
|
|
77
|
-
if (d.target && !o.current) {
|
|
78
|
-
let v = function() {
|
|
79
|
-
x(
|
|
80
|
-
H,
|
|
81
|
-
i,
|
|
82
|
-
c,
|
|
83
|
-
{ discrete: !0 }
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
const c = { originalEvent: d };
|
|
87
|
-
d.pointerType === "touch" ? (e.removeEventListener("click", t.current), t.current = v, e.addEventListener("click", t.current, { once: !0 })) : v();
|
|
88
|
-
} else
|
|
89
|
-
e.removeEventListener("click", t.current);
|
|
90
|
-
o.current = !1;
|
|
91
|
-
}, l = window.setTimeout(() => {
|
|
92
|
-
e.addEventListener("pointerdown", a);
|
|
93
|
-
}, 0);
|
|
94
|
-
return () => {
|
|
95
|
-
window.clearTimeout(l), e.removeEventListener("pointerdown", a), e.removeEventListener("click", t.current);
|
|
96
|
-
};
|
|
97
|
-
}, [e, i]), {
|
|
98
|
-
// ensures we check React component tree (not just DOM tree)
|
|
99
|
-
onPointerDownCapture: () => o.current = !0
|
|
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);
|
|
100
5
|
};
|
|
101
6
|
}
|
|
102
|
-
function G(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
103
|
-
const i = w(r), o = n.useRef(!1);
|
|
104
|
-
return n.useEffect(() => {
|
|
105
|
-
const t = (a) => {
|
|
106
|
-
a.target && !o.current && x(M, i, { originalEvent: a }, {
|
|
107
|
-
discrete: !1
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
return e.addEventListener("focusin", t), () => e.removeEventListener("focusin", t);
|
|
111
|
-
}, [e, i]), {
|
|
112
|
-
onFocusCapture: () => o.current = !0,
|
|
113
|
-
onBlurCapture: () => o.current = !1
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
function O() {
|
|
117
|
-
const r = new CustomEvent(y);
|
|
118
|
-
document.dispatchEvent(r);
|
|
119
|
-
}
|
|
120
|
-
function x(r, e, i, { discrete: o }) {
|
|
121
|
-
const t = i.originalEvent.target, a = new CustomEvent(r, { bubbles: !1, cancelable: !0, detail: i });
|
|
122
|
-
e && t.addEventListener(r, e, { once: !0 }), o ? k(t, a) : t.dispatchEvent(a);
|
|
123
|
-
}
|
|
124
7
|
export {
|
|
125
|
-
|
|
126
|
-
Y as DismissableLayerBranch
|
|
8
|
+
h as composeEventHandlers
|
|
127
9
|
};
|
package/dist/index85.js
CHANGED
|
@@ -1,17 +1,70 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
return
|
|
7
|
-
|
|
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 });
|
|
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];
|
|
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}\``);
|
|
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
|
+
);
|
|
8
45
|
};
|
|
9
|
-
}
|
|
46
|
+
};
|
|
47
|
+
return i.scopeName = e, [a, l(i, ...c)];
|
|
10
48
|
}
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
|
|
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;
|
|
14
66
|
}
|
|
15
67
|
export {
|
|
16
|
-
|
|
68
|
+
w as createContext,
|
|
69
|
+
_ as createContextScope
|
|
17
70
|
};
|