@phillips/seldon 1.31.2 → 1.32.0
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/assets/lock.svg.js +4 -0
- package/dist/assets/minus.svg.js +4 -0
- package/dist/assets/plus.svg.js +4 -0
- package/dist/components/Accordion/Accordion.d.ts +26 -0
- package/dist/components/Accordion/Accordion.js +21 -0
- package/dist/components/Accordion/AccordionItem.d.ts +37 -0
- package/dist/components/Accordion/AccordionItem.js +114 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Accordion/types.d.ts +44 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +26 -22
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +237 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/primitive/dist/index.js +9 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-compose-refs/dist/index.js +14 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-context/dist/index.js +52 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-id/dist/index.js +13 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-primitive/dist/index.js +31 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-slot/dist/index.js +48 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +13 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +119 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/primitive/dist/index.js +9 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-compose-refs/dist/index.js +14 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-context/dist/index.js +52 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-id/dist/index.js +13 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-presence/dist/index.js +69 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-primitive/dist/index.js +31 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-slot/dist/index.js +48 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +13 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +32 -0
- package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +48 -0
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-compose-refs/dist/index.js +14 -0
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-context/dist/index.js +52 -0
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js +48 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +10 -0
- package/dist/node_modules/react-modal/lib/components/Modal.js +6 -6
- package/dist/scss/components/Accordion/_accordion.scss +104 -0
- package/dist/scss/styles.scss +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
3
|
+
function P(t, x = []) {
|
|
4
|
+
let o = [];
|
|
5
|
+
function f(u, e) {
|
|
6
|
+
const n = i.createContext(e), r = o.length;
|
|
7
|
+
o = [...o, e];
|
|
8
|
+
function m(a) {
|
|
9
|
+
const { scope: c, children: C, ...p } = a, d = (c == null ? void 0 : c[t][r]) || n, v = i.useMemo(() => p, Object.values(p));
|
|
10
|
+
return /* @__PURE__ */ _(d.Provider, { value: v, children: C });
|
|
11
|
+
}
|
|
12
|
+
function S(a, c) {
|
|
13
|
+
const C = (c == null ? void 0 : c[t][r]) || n, p = i.useContext(C);
|
|
14
|
+
if (p) return p;
|
|
15
|
+
if (e !== void 0) return e;
|
|
16
|
+
throw new Error(`\`${a}\` must be used within \`${u}\``);
|
|
17
|
+
}
|
|
18
|
+
return m.displayName = u + "Provider", [m, S];
|
|
19
|
+
}
|
|
20
|
+
const s = () => {
|
|
21
|
+
const u = o.map((e) => i.createContext(e));
|
|
22
|
+
return function(n) {
|
|
23
|
+
const r = (n == null ? void 0 : n[t]) || u;
|
|
24
|
+
return i.useMemo(
|
|
25
|
+
() => ({ [`__scope${t}`]: { ...n, [t]: r } }),
|
|
26
|
+
[n, r]
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
return s.scopeName = t, [f, h(s, ...x)];
|
|
31
|
+
}
|
|
32
|
+
function h(...t) {
|
|
33
|
+
const x = t[0];
|
|
34
|
+
if (t.length === 1) return x;
|
|
35
|
+
const o = () => {
|
|
36
|
+
const f = t.map((s) => ({
|
|
37
|
+
useScope: s(),
|
|
38
|
+
scopeName: s.scopeName
|
|
39
|
+
}));
|
|
40
|
+
return function(u) {
|
|
41
|
+
const e = f.reduce((n, { useScope: r, scopeName: m }) => {
|
|
42
|
+
const a = r(u)[`__scope${m}`];
|
|
43
|
+
return { ...n, ...a };
|
|
44
|
+
}, {});
|
|
45
|
+
return i.useMemo(() => ({ [`__scope${x.scopeName}`]: e }), [e]);
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
return o.scopeName = x.scopeName, o;
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
P as createContextScope
|
|
52
|
+
};
|
package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-id/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
import { useLayoutEffect as i } from "../../react-use-layout-effect/dist/index.js";
|
|
3
|
+
var r = u.useId || (() => {
|
|
4
|
+
}), f = 0;
|
|
5
|
+
function a(e) {
|
|
6
|
+
const [o, s] = u.useState(r());
|
|
7
|
+
return i(() => {
|
|
8
|
+
s((t) => t != null ? t : String(f++));
|
|
9
|
+
}, [e]), o ? `radix-${o}` : "";
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
a as useId
|
|
13
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import "react-dom";
|
|
3
|
+
import { Slot as n } from "../../react-slot/dist/index.js";
|
|
4
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
5
|
+
var d = [
|
|
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
|
+
"span",
|
|
20
|
+
"svg",
|
|
21
|
+
"ul"
|
|
22
|
+
], c = d.reduce((o, r) => {
|
|
23
|
+
const i = f.forwardRef((t, e) => {
|
|
24
|
+
const { asChild: m, ...a } = t, p = m ? n : r;
|
|
25
|
+
return typeof window != "undefined" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ s(p, { ...a, ref: e });
|
|
26
|
+
});
|
|
27
|
+
return i.displayName = `Primitive.${r}`, { ...o, [r]: i };
|
|
28
|
+
}, {});
|
|
29
|
+
export {
|
|
30
|
+
c as Primitive
|
|
31
|
+
};
|
package/dist/node_modules/@radix-ui/react-accordion/node_modules/@radix-ui/react-slot/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { composeRefs as u } from "../../react-compose-refs/dist/index.js";
|
|
3
|
+
import { jsx as c, Fragment as d } from "react/jsx-runtime";
|
|
4
|
+
var m = l.forwardRef((e, n) => {
|
|
5
|
+
const { children: r, ...t } = e, o = l.Children.toArray(r), i = o.find(y);
|
|
6
|
+
if (i) {
|
|
7
|
+
const s = i.props.children, a = o.map((p) => p === i ? l.Children.count(s) > 1 ? l.Children.only(null) : l.isValidElement(s) ? s.props.children : null : p);
|
|
8
|
+
return /* @__PURE__ */ c(f, { ...t, ref: n, children: l.isValidElement(s) ? l.cloneElement(s, void 0, a) : null });
|
|
9
|
+
}
|
|
10
|
+
return /* @__PURE__ */ c(f, { ...t, ref: n, children: r });
|
|
11
|
+
});
|
|
12
|
+
m.displayName = "Slot";
|
|
13
|
+
var f = l.forwardRef((e, n) => {
|
|
14
|
+
const { children: r, ...t } = e;
|
|
15
|
+
if (l.isValidElement(r)) {
|
|
16
|
+
const o = C(r);
|
|
17
|
+
return l.cloneElement(r, {
|
|
18
|
+
...h(t, r.props),
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
ref: n ? u(n, o) : o
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return l.Children.count(r) > 1 ? l.Children.only(null) : null;
|
|
24
|
+
});
|
|
25
|
+
f.displayName = "SlotClone";
|
|
26
|
+
var g = ({ children: e }) => /* @__PURE__ */ c(d, { children: e });
|
|
27
|
+
function y(e) {
|
|
28
|
+
return l.isValidElement(e) && e.type === g;
|
|
29
|
+
}
|
|
30
|
+
function h(e, n) {
|
|
31
|
+
const r = { ...n };
|
|
32
|
+
for (const t in n) {
|
|
33
|
+
const o = e[t], i = n[t];
|
|
34
|
+
/^on[A-Z]/.test(t) ? o && i ? r[t] = (...a) => {
|
|
35
|
+
i(...a), o(...a);
|
|
36
|
+
} : o && (r[t] = o) : t === "style" ? r[t] = { ...o, ...i } : t === "className" && (r[t] = [o, i].filter(Boolean).join(" "));
|
|
37
|
+
}
|
|
38
|
+
return { ...e, ...r };
|
|
39
|
+
}
|
|
40
|
+
function C(e) {
|
|
41
|
+
var t, o;
|
|
42
|
+
let n = (t = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : t.get, r = n && "isReactWarning" in n && n.isReactWarning;
|
|
43
|
+
return r ? e.ref : (n = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
m as Slot,
|
|
47
|
+
g as Slottable
|
|
48
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
}, []);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
o as useCallbackRef
|
|
13
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { useCallbackRef as f } from "../../react-use-callback-ref/dist/index.js";
|
|
3
|
+
function R({
|
|
4
|
+
prop: t,
|
|
5
|
+
defaultProp: r,
|
|
6
|
+
onChange: s = () => {
|
|
7
|
+
}
|
|
8
|
+
}) {
|
|
9
|
+
const [e, n] = v({ defaultProp: r, onChange: s }), o = t !== void 0, i = o ? t : e, u = f(s), d = l.useCallback(
|
|
10
|
+
(c) => {
|
|
11
|
+
if (o) {
|
|
12
|
+
const a = typeof c == "function" ? c(t) : c;
|
|
13
|
+
a !== t && u(a);
|
|
14
|
+
} else
|
|
15
|
+
n(c);
|
|
16
|
+
},
|
|
17
|
+
[o, t, n, u]
|
|
18
|
+
);
|
|
19
|
+
return [i, d];
|
|
20
|
+
}
|
|
21
|
+
function v({
|
|
22
|
+
defaultProp: t,
|
|
23
|
+
onChange: r
|
|
24
|
+
}) {
|
|
25
|
+
const s = l.useState(t), [e] = s, n = l.useRef(e), o = f(r);
|
|
26
|
+
return l.useEffect(() => {
|
|
27
|
+
n.current !== e && (o(e), n.current = e);
|
|
28
|
+
}, [e, n, o]), s;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
R as useControllableState
|
|
32
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as o from "react";
|
|
2
|
+
import { composeEventHandlers as T } from "../node_modules/@radix-ui/primitive/dist/index.js";
|
|
3
|
+
import { createContextScope as S } from "../node_modules/@radix-ui/react-context/dist/index.js";
|
|
4
|
+
import { useControllableState as D } from "../node_modules/@radix-ui/react-use-controllable-state/dist/index.js";
|
|
5
|
+
import { useLayoutEffect as L } from "../node_modules/@radix-ui/react-use-layout-effect/dist/index.js";
|
|
6
|
+
import { useComposedRefs as M } from "../node_modules/@radix-ui/react-compose-refs/dist/index.js";
|
|
7
|
+
import { Primitive as b } from "../node_modules/@radix-ui/react-primitive/dist/index.js";
|
|
8
|
+
import { Presence as k } from "../node_modules/@radix-ui/react-presence/dist/index.js";
|
|
9
|
+
import { useId as F } from "../node_modules/@radix-ui/react-id/dist/index.js";
|
|
10
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
11
|
+
var v = "Collapsible", [B, W] = S(v), [G, g] = B(v), w = o.forwardRef(
|
|
12
|
+
(e, a) => {
|
|
13
|
+
const {
|
|
14
|
+
__scopeCollapsible: i,
|
|
15
|
+
open: r,
|
|
16
|
+
defaultOpen: t,
|
|
17
|
+
disabled: l,
|
|
18
|
+
onOpenChange: s,
|
|
19
|
+
...u
|
|
20
|
+
} = e, [d = !1, p] = D({
|
|
21
|
+
prop: r,
|
|
22
|
+
defaultProp: t,
|
|
23
|
+
onChange: s
|
|
24
|
+
});
|
|
25
|
+
return /* @__PURE__ */ c(
|
|
26
|
+
G,
|
|
27
|
+
{
|
|
28
|
+
scope: i,
|
|
29
|
+
disabled: l,
|
|
30
|
+
contentId: F(),
|
|
31
|
+
open: d,
|
|
32
|
+
onOpenToggle: o.useCallback(() => p((m) => !m), [p]),
|
|
33
|
+
children: /* @__PURE__ */ c(
|
|
34
|
+
b.div,
|
|
35
|
+
{
|
|
36
|
+
"data-state": h(d),
|
|
37
|
+
"data-disabled": l ? "" : void 0,
|
|
38
|
+
...u,
|
|
39
|
+
ref: a
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
w.displayName = v;
|
|
47
|
+
var A = "CollapsibleTrigger", I = o.forwardRef(
|
|
48
|
+
(e, a) => {
|
|
49
|
+
const { __scopeCollapsible: i, ...r } = e, t = g(A, i);
|
|
50
|
+
return /* @__PURE__ */ c(
|
|
51
|
+
b.button,
|
|
52
|
+
{
|
|
53
|
+
type: "button",
|
|
54
|
+
"aria-controls": t.contentId,
|
|
55
|
+
"aria-expanded": t.open || !1,
|
|
56
|
+
"data-state": h(t.open),
|
|
57
|
+
"data-disabled": t.disabled ? "" : void 0,
|
|
58
|
+
disabled: t.disabled,
|
|
59
|
+
...r,
|
|
60
|
+
ref: a,
|
|
61
|
+
onClick: T(e.onClick, t.onOpenToggle)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
I.displayName = A;
|
|
67
|
+
var R = "CollapsibleContent", O = o.forwardRef(
|
|
68
|
+
(e, a) => {
|
|
69
|
+
const { forceMount: i, ...r } = e, t = g(R, e.__scopeCollapsible);
|
|
70
|
+
return /* @__PURE__ */ c(k, { present: i || t.open, children: ({ present: l }) => /* @__PURE__ */ c($, { ...r, ref: a, present: l }) });
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
O.displayName = R;
|
|
74
|
+
var $ = o.forwardRef((e, a) => {
|
|
75
|
+
const { __scopeCollapsible: i, present: r, children: t, ...l } = e, s = g(R, i), [u, d] = o.useState(r), p = o.useRef(null), m = M(a, p), y = o.useRef(0), x = y.current, N = o.useRef(0), P = N.current, C = s.open || u, _ = o.useRef(C), f = o.useRef();
|
|
76
|
+
return o.useEffect(() => {
|
|
77
|
+
const n = requestAnimationFrame(() => _.current = !1);
|
|
78
|
+
return () => cancelAnimationFrame(n);
|
|
79
|
+
}, []), L(() => {
|
|
80
|
+
const n = p.current;
|
|
81
|
+
if (n) {
|
|
82
|
+
f.current = f.current || {
|
|
83
|
+
transitionDuration: n.style.transitionDuration,
|
|
84
|
+
animationName: n.style.animationName
|
|
85
|
+
}, n.style.transitionDuration = "0s", n.style.animationName = "none";
|
|
86
|
+
const E = n.getBoundingClientRect();
|
|
87
|
+
y.current = E.height, N.current = E.width, _.current || (n.style.transitionDuration = f.current.transitionDuration, n.style.animationName = f.current.animationName), d(r);
|
|
88
|
+
}
|
|
89
|
+
}, [s.open, r]), /* @__PURE__ */ c(
|
|
90
|
+
b.div,
|
|
91
|
+
{
|
|
92
|
+
"data-state": h(s.open),
|
|
93
|
+
"data-disabled": s.disabled ? "" : void 0,
|
|
94
|
+
id: s.contentId,
|
|
95
|
+
hidden: !C,
|
|
96
|
+
...l,
|
|
97
|
+
ref: m,
|
|
98
|
+
style: {
|
|
99
|
+
"--radix-collapsible-content-height": x ? `${x}px` : void 0,
|
|
100
|
+
"--radix-collapsible-content-width": P ? `${P}px` : void 0,
|
|
101
|
+
...e.style
|
|
102
|
+
},
|
|
103
|
+
children: C && t
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
});
|
|
107
|
+
function h(e) {
|
|
108
|
+
return e ? "open" : "closed";
|
|
109
|
+
}
|
|
110
|
+
var X = w, Y = I, Z = O;
|
|
111
|
+
export {
|
|
112
|
+
w as Collapsible,
|
|
113
|
+
O as CollapsibleContent,
|
|
114
|
+
I as CollapsibleTrigger,
|
|
115
|
+
Z as Content,
|
|
116
|
+
X as Root,
|
|
117
|
+
Y as Trigger,
|
|
118
|
+
W as createCollapsibleScope
|
|
119
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
function c(o, n) {
|
|
3
|
+
typeof o == "function" ? o(n) : o != null && (o.current = n);
|
|
4
|
+
}
|
|
5
|
+
function u(...o) {
|
|
6
|
+
return (n) => o.forEach((t) => c(t, n));
|
|
7
|
+
}
|
|
8
|
+
function i(...o) {
|
|
9
|
+
return e.useCallback(u(...o), o);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
u as composeRefs,
|
|
13
|
+
i as useComposedRefs
|
|
14
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
3
|
+
function P(t, x = []) {
|
|
4
|
+
let o = [];
|
|
5
|
+
function f(u, e) {
|
|
6
|
+
const n = i.createContext(e), r = o.length;
|
|
7
|
+
o = [...o, e];
|
|
8
|
+
function m(a) {
|
|
9
|
+
const { scope: c, children: C, ...p } = a, d = (c == null ? void 0 : c[t][r]) || n, v = i.useMemo(() => p, Object.values(p));
|
|
10
|
+
return /* @__PURE__ */ _(d.Provider, { value: v, children: C });
|
|
11
|
+
}
|
|
12
|
+
function S(a, c) {
|
|
13
|
+
const C = (c == null ? void 0 : c[t][r]) || n, p = i.useContext(C);
|
|
14
|
+
if (p) return p;
|
|
15
|
+
if (e !== void 0) return e;
|
|
16
|
+
throw new Error(`\`${a}\` must be used within \`${u}\``);
|
|
17
|
+
}
|
|
18
|
+
return m.displayName = u + "Provider", [m, S];
|
|
19
|
+
}
|
|
20
|
+
const s = () => {
|
|
21
|
+
const u = o.map((e) => i.createContext(e));
|
|
22
|
+
return function(n) {
|
|
23
|
+
const r = (n == null ? void 0 : n[t]) || u;
|
|
24
|
+
return i.useMemo(
|
|
25
|
+
() => ({ [`__scope${t}`]: { ...n, [t]: r } }),
|
|
26
|
+
[n, r]
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
return s.scopeName = t, [f, h(s, ...x)];
|
|
31
|
+
}
|
|
32
|
+
function h(...t) {
|
|
33
|
+
const x = t[0];
|
|
34
|
+
if (t.length === 1) return x;
|
|
35
|
+
const o = () => {
|
|
36
|
+
const f = t.map((s) => ({
|
|
37
|
+
useScope: s(),
|
|
38
|
+
scopeName: s.scopeName
|
|
39
|
+
}));
|
|
40
|
+
return function(u) {
|
|
41
|
+
const e = f.reduce((n, { useScope: r, scopeName: m }) => {
|
|
42
|
+
const a = r(u)[`__scope${m}`];
|
|
43
|
+
return { ...n, ...a };
|
|
44
|
+
}, {});
|
|
45
|
+
return i.useMemo(() => ({ [`__scope${x.scopeName}`]: e }), [e]);
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
return o.scopeName = x.scopeName, o;
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
P as createContextScope
|
|
52
|
+
};
|
package/dist/node_modules/@radix-ui/react-collapsible/node_modules/@radix-ui/react-id/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import { useLayoutEffect as a } from "../../react-use-layout-effect/dist/index.js";
|
|
3
|
+
var e = f.useId || (() => {
|
|
4
|
+
}), r = 0;
|
|
5
|
+
function i(o) {
|
|
6
|
+
const [u, s] = f.useState(e());
|
|
7
|
+
return a(() => {
|
|
8
|
+
o || s((t) => t != null ? t : String(r++));
|
|
9
|
+
}, [o]), o || (u ? `radix-${u}` : "");
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
i as useId
|
|
13
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as a from "react";
|
|
2
|
+
import * as g from "react-dom";
|
|
3
|
+
import { useComposedRefs as O } from "../../react-compose-refs/dist/index.js";
|
|
4
|
+
import { useLayoutEffect as l } from "../../react-use-layout-effect/dist/index.js";
|
|
5
|
+
function E(e, n) {
|
|
6
|
+
return a.useReducer((o, r) => {
|
|
7
|
+
const i = n[o][r];
|
|
8
|
+
return i != null ? i : o;
|
|
9
|
+
}, e);
|
|
10
|
+
}
|
|
11
|
+
var M = (e) => {
|
|
12
|
+
const { present: n, children: o } = e, r = R(n), i = typeof o == "function" ? o({ present: r.isPresent }) : a.Children.only(o), c = O(r.ref, T(i));
|
|
13
|
+
return typeof o == "function" || r.isPresent ? a.cloneElement(i, { ref: c }) : null;
|
|
14
|
+
};
|
|
15
|
+
M.displayName = "Presence";
|
|
16
|
+
function R(e) {
|
|
17
|
+
const [n, o] = a.useState(), r = a.useRef({}), i = a.useRef(e), c = a.useRef("none"), p = e ? "mounted" : "unmounted", [N, s] = E(p, {
|
|
18
|
+
mounted: {
|
|
19
|
+
UNMOUNT: "unmounted",
|
|
20
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
21
|
+
},
|
|
22
|
+
unmountSuspended: {
|
|
23
|
+
MOUNT: "mounted",
|
|
24
|
+
ANIMATION_END: "unmounted"
|
|
25
|
+
},
|
|
26
|
+
unmounted: {
|
|
27
|
+
MOUNT: "mounted"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return a.useEffect(() => {
|
|
31
|
+
const t = d(r.current);
|
|
32
|
+
c.current = N === "mounted" ? t : "none";
|
|
33
|
+
}, [N]), l(() => {
|
|
34
|
+
const t = r.current, u = i.current;
|
|
35
|
+
if (u !== e) {
|
|
36
|
+
const A = c.current, f = d(t);
|
|
37
|
+
e ? s("MOUNT") : f === "none" || (t == null ? void 0 : t.display) === "none" ? s("UNMOUNT") : s(u && A !== f ? "ANIMATION_OUT" : "UNMOUNT"), i.current = e;
|
|
38
|
+
}
|
|
39
|
+
}, [e, s]), l(() => {
|
|
40
|
+
if (n) {
|
|
41
|
+
const t = (m) => {
|
|
42
|
+
const f = d(r.current).includes(m.animationName);
|
|
43
|
+
m.target === n && f && g.flushSync(() => s("ANIMATION_END"));
|
|
44
|
+
}, u = (m) => {
|
|
45
|
+
m.target === n && (c.current = d(r.current));
|
|
46
|
+
};
|
|
47
|
+
return n.addEventListener("animationstart", u), n.addEventListener("animationcancel", t), n.addEventListener("animationend", t), () => {
|
|
48
|
+
n.removeEventListener("animationstart", u), n.removeEventListener("animationcancel", t), n.removeEventListener("animationend", t);
|
|
49
|
+
};
|
|
50
|
+
} else
|
|
51
|
+
s("ANIMATION_END");
|
|
52
|
+
}, [n, s]), {
|
|
53
|
+
isPresent: ["mounted", "unmountSuspended"].includes(N),
|
|
54
|
+
ref: a.useCallback((t) => {
|
|
55
|
+
t && (r.current = getComputedStyle(t)), o(t);
|
|
56
|
+
}, [])
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function d(e) {
|
|
60
|
+
return (e == null ? void 0 : e.animationName) || "none";
|
|
61
|
+
}
|
|
62
|
+
function T(e) {
|
|
63
|
+
var r, i;
|
|
64
|
+
let n = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, o = n && "isReactWarning" in n && n.isReactWarning;
|
|
65
|
+
return o ? e.ref : (n = (i = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : i.get, o = n && "isReactWarning" in n && n.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
M as Presence
|
|
69
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import "react-dom";
|
|
3
|
+
import { Slot as n } from "../../react-slot/dist/index.js";
|
|
4
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
5
|
+
var d = [
|
|
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
|
+
"span",
|
|
20
|
+
"svg",
|
|
21
|
+
"ul"
|
|
22
|
+
], c = d.reduce((o, r) => {
|
|
23
|
+
const i = f.forwardRef((t, e) => {
|
|
24
|
+
const { asChild: m, ...a } = t, p = m ? n : r;
|
|
25
|
+
return typeof window != "undefined" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ s(p, { ...a, ref: e });
|
|
26
|
+
});
|
|
27
|
+
return i.displayName = `Primitive.${r}`, { ...o, [r]: i };
|
|
28
|
+
}, {});
|
|
29
|
+
export {
|
|
30
|
+
c as Primitive
|
|
31
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { composeRefs as u } from "../../react-compose-refs/dist/index.js";
|
|
3
|
+
import { jsx as c, Fragment as d } from "react/jsx-runtime";
|
|
4
|
+
var m = l.forwardRef((e, n) => {
|
|
5
|
+
const { children: r, ...t } = e, o = l.Children.toArray(r), i = o.find(y);
|
|
6
|
+
if (i) {
|
|
7
|
+
const s = i.props.children, a = o.map((p) => p === i ? l.Children.count(s) > 1 ? l.Children.only(null) : l.isValidElement(s) ? s.props.children : null : p);
|
|
8
|
+
return /* @__PURE__ */ c(f, { ...t, ref: n, children: l.isValidElement(s) ? l.cloneElement(s, void 0, a) : null });
|
|
9
|
+
}
|
|
10
|
+
return /* @__PURE__ */ c(f, { ...t, ref: n, children: r });
|
|
11
|
+
});
|
|
12
|
+
m.displayName = "Slot";
|
|
13
|
+
var f = l.forwardRef((e, n) => {
|
|
14
|
+
const { children: r, ...t } = e;
|
|
15
|
+
if (l.isValidElement(r)) {
|
|
16
|
+
const o = C(r);
|
|
17
|
+
return l.cloneElement(r, {
|
|
18
|
+
...h(t, r.props),
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
ref: n ? u(n, o) : o
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return l.Children.count(r) > 1 ? l.Children.only(null) : null;
|
|
24
|
+
});
|
|
25
|
+
f.displayName = "SlotClone";
|
|
26
|
+
var g = ({ children: e }) => /* @__PURE__ */ c(d, { children: e });
|
|
27
|
+
function y(e) {
|
|
28
|
+
return l.isValidElement(e) && e.type === g;
|
|
29
|
+
}
|
|
30
|
+
function h(e, n) {
|
|
31
|
+
const r = { ...n };
|
|
32
|
+
for (const t in n) {
|
|
33
|
+
const o = e[t], i = n[t];
|
|
34
|
+
/^on[A-Z]/.test(t) ? o && i ? r[t] = (...a) => {
|
|
35
|
+
i(...a), o(...a);
|
|
36
|
+
} : o && (r[t] = o) : t === "style" ? r[t] = { ...o, ...i } : t === "className" && (r[t] = [o, i].filter(Boolean).join(" "));
|
|
37
|
+
}
|
|
38
|
+
return { ...e, ...r };
|
|
39
|
+
}
|
|
40
|
+
function C(e) {
|
|
41
|
+
var t, o;
|
|
42
|
+
let n = (t = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : t.get, r = n && "isReactWarning" in n && n.isReactWarning;
|
|
43
|
+
return r ? e.ref : (n = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
m as Slot,
|
|
47
|
+
g as Slottable
|
|
48
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
}, []);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
o as useCallbackRef
|
|
13
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { useCallbackRef as f } from "../../react-use-callback-ref/dist/index.js";
|
|
3
|
+
function R({
|
|
4
|
+
prop: t,
|
|
5
|
+
defaultProp: r,
|
|
6
|
+
onChange: s = () => {
|
|
7
|
+
}
|
|
8
|
+
}) {
|
|
9
|
+
const [e, n] = v({ defaultProp: r, onChange: s }), o = t !== void 0, i = o ? t : e, u = f(s), d = l.useCallback(
|
|
10
|
+
(c) => {
|
|
11
|
+
if (o) {
|
|
12
|
+
const a = typeof c == "function" ? c(t) : c;
|
|
13
|
+
a !== t && u(a);
|
|
14
|
+
} else
|
|
15
|
+
n(c);
|
|
16
|
+
},
|
|
17
|
+
[o, t, n, u]
|
|
18
|
+
);
|
|
19
|
+
return [i, d];
|
|
20
|
+
}
|
|
21
|
+
function v({
|
|
22
|
+
defaultProp: t,
|
|
23
|
+
onChange: r
|
|
24
|
+
}) {
|
|
25
|
+
const s = l.useState(t), [e] = s, n = l.useRef(e), o = f(r);
|
|
26
|
+
return l.useEffect(() => {
|
|
27
|
+
n.current !== e && (o(e), n.current = e);
|
|
28
|
+
}, [e, n, o]), s;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
R as useControllableState
|
|
32
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import n from "react";
|
|
2
|
+
import { createContextScope as O } from "../node_modules/@radix-ui/react-context/dist/index.js";
|
|
3
|
+
import { useComposedRefs as S } from "../node_modules/@radix-ui/react-compose-refs/dist/index.js";
|
|
4
|
+
import { Slot as x } from "../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
5
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
6
|
+
function h(s) {
|
|
7
|
+
const f = s + "CollectionProvider", [A, N] = O(f), [_, m] = A(
|
|
8
|
+
f,
|
|
9
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
10
|
+
), u = (c) => {
|
|
11
|
+
const { scope: e, children: l } = c, o = n.useRef(null), t = n.useRef(/* @__PURE__ */ new Map()).current;
|
|
12
|
+
return /* @__PURE__ */ d(_, { scope: e, itemMap: t, collectionRef: o, children: l });
|
|
13
|
+
};
|
|
14
|
+
u.displayName = f;
|
|
15
|
+
const a = s + "CollectionSlot", p = n.forwardRef(
|
|
16
|
+
(c, e) => {
|
|
17
|
+
const { scope: l, children: o } = c, t = m(a, l), r = S(e, t.collectionRef);
|
|
18
|
+
return /* @__PURE__ */ d(x, { ref: r, children: o });
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
p.displayName = a;
|
|
22
|
+
const C = s + "CollectionItemSlot", R = "data-radix-collection-item", M = n.forwardRef(
|
|
23
|
+
(c, e) => {
|
|
24
|
+
const { scope: l, children: o, ...t } = c, r = n.useRef(null), I = S(e, r), i = m(C, l);
|
|
25
|
+
return n.useEffect(() => (i.itemMap.set(r, { ref: r, ...t }), () => void i.itemMap.delete(r))), /* @__PURE__ */ d(x, { [R]: "", ref: I, children: o });
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
M.displayName = C;
|
|
29
|
+
function E(c) {
|
|
30
|
+
const e = m(s + "CollectionConsumer", c);
|
|
31
|
+
return n.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, T) => t.indexOf(i.ref.current) - t.indexOf(T.ref.current)
|
|
37
|
+
);
|
|
38
|
+
}, [e.collectionRef, e.itemMap]);
|
|
39
|
+
}
|
|
40
|
+
return [
|
|
41
|
+
{ Provider: u, Slot: p, ItemSlot: M },
|
|
42
|
+
E,
|
|
43
|
+
N
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
h as createCollection
|
|
48
|
+
};
|