@la-batcave/ui 3.1.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/README.md +95 -0
- package/dist/Alert.d.ts +27 -0
- package/dist/Alert.js +56 -0
- package/dist/Avatar.d.ts +20 -0
- package/dist/Avatar.js +40 -0
- package/dist/Badge.d.ts +56 -0
- package/dist/Badge.js +74 -0
- package/dist/Button.d.ts +53 -0
- package/dist/Button.js +66 -0
- package/dist/Card.d.ts +18 -0
- package/dist/Card.js +98 -0
- package/dist/CodeBlock.d.ts +45 -0
- package/dist/CodeBlock.js +306 -0
- package/dist/Collapse.d.ts +58 -0
- package/dist/Collapse.js +89 -0
- package/dist/Combobox.d.ts +44 -0
- package/dist/Combobox.js +409 -0
- package/dist/DarkMode.d.ts +59 -0
- package/dist/DarkMode.js +56 -0
- package/dist/DatePicker.d.ts +48 -0
- package/dist/DatePicker.js +2954 -0
- package/dist/Dialog.d.ts +119 -0
- package/dist/Dialog.js +337 -0
- package/dist/Drawer.d.ts +28 -0
- package/dist/Drawer.js +1126 -0
- package/dist/Dropdown.d.ts +23 -0
- package/dist/Dropdown.js +247 -0
- package/dist/EasyForm.d.ts +138 -0
- package/dist/EasyForm.js +286 -0
- package/dist/HoverCard.d.ts +10 -0
- package/dist/HoverCard.js +195 -0
- package/dist/Input.d.ts +230 -0
- package/dist/Input.js +2216 -0
- package/dist/LogViewer.d.ts +57 -0
- package/dist/LogViewer.js +120 -0
- package/dist/Menubar.d.ts +32 -0
- package/dist/Menubar.js +398 -0
- package/dist/Navbar.d.ts +20 -0
- package/dist/Navbar.js +31 -0
- package/dist/Pagination.d.ts +78 -0
- package/dist/Pagination.js +106 -0
- package/dist/Popover.d.ts +11 -0
- package/dist/Popover.js +28 -0
- package/dist/ProgressBar.d.ts +35 -0
- package/dist/ProgressBar.js +210 -0
- package/dist/Resizable.d.ts +23 -0
- package/dist/Resizable.js +1532 -0
- package/dist/Separator.d.ts +4 -0
- package/dist/Separator.js +46 -0
- package/dist/Sheet.d.ts +29 -0
- package/dist/Sheet.js +104 -0
- package/dist/Sidebar.d.ts +117 -0
- package/dist/Sidebar.js +237 -0
- package/dist/Skeleton.d.ts +57 -0
- package/dist/Skeleton.js +47 -0
- package/dist/Table.d.ts +71 -0
- package/dist/Table.js +94 -0
- package/dist/Tabs.d.ts +76 -0
- package/dist/Tabs.js +202 -0
- package/dist/Toast.d.ts +54 -0
- package/dist/Toast.js +827 -0
- package/dist/Tooltip.d.ts +29 -0
- package/dist/Tooltip.js +352 -0
- package/dist/Typography.d.ts +101 -0
- package/dist/Typography.js +123 -0
- package/dist/Widget.d.ts +133 -0
- package/dist/Widget.js +207 -0
- package/dist/_shared/Combination-D_l4PLF_.js +676 -0
- package/dist/_shared/index-B03TCNO5.js +142 -0
- package/dist/_shared/index-B1f-hyuh.js +31 -0
- package/dist/_shared/index-BC7vfx-u.js +13 -0
- package/dist/_shared/index-BrLJJgkl.js +67 -0
- package/dist/_shared/index-C0gNQvxa.js +269 -0
- package/dist/_shared/index-C3aZemLI.js +268 -0
- package/dist/_shared/index-CXeb1OMI.js +198 -0
- package/dist/_shared/index-CukUn3R0.js +626 -0
- package/dist/_shared/index-DLcqcWxM.js +29 -0
- package/dist/_shared/index-DlSuDb9N.js +283 -0
- package/dist/_shared/index-V-Ajw7Ac.js +79 -0
- package/dist/_shared/index-uPOYJZpG.js +34 -0
- package/dist/_shared/index-uu9PT5Nu.js +1588 -0
- package/dist/_shared/utils-eGXXUFl7.js +2935 -0
- package/dist/backgrounds/Aurora.d.ts +7 -0
- package/dist/backgrounds/Aurora.js +126 -0
- package/dist/backgrounds/Iridescence.d.ts +7 -0
- package/dist/backgrounds/Iridescence.js +77 -0
- package/dist/backgrounds/Lightning.d.ts +8 -0
- package/dist/backgrounds/Lightning.js +75 -0
- package/dist/backgrounds/LiquidChrome.d.ts +9 -0
- package/dist/backgrounds/LiquidChrome.js +89 -0
- package/dist/backgrounds/Particles.d.ts +15 -0
- package/dist/backgrounds/Particles.js +137 -0
- package/dist/backgrounds/PixelSnow.d.ts +9 -0
- package/dist/backgrounds/PixelSnow.js +52 -0
- package/dist/backgrounds/Silk.d.ts +8 -0
- package/dist/backgrounds/Silk.js +92 -0
- package/dist/backgrounds/Squares.d.ts +9 -0
- package/dist/backgrounds/Squares.js +75 -0
- package/dist/backgrounds/Threads.d.ts +7 -0
- package/dist/backgrounds/Threads.js +110 -0
- package/dist/backgrounds/Waves.d.ts +14 -0
- package/dist/backgrounds/Waves.js +139 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/package.json +318 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { P as h, c as m, a as H, e as Z, u as q } from "./index-CXeb1OMI.js";
|
|
3
|
+
import { c as K, u as E } from "./index-DLcqcWxM.js";
|
|
4
|
+
import { u as y } from "./index-BC7vfx-u.js";
|
|
5
|
+
import { P as U, D as Y } from "./index-B03TCNO5.js";
|
|
6
|
+
import { R as z, h as J, u as Q, F as X } from "./Combination-D_l4PLF_.js";
|
|
7
|
+
import { P as D } from "./index-V-Ajw7Ac.js";
|
|
8
|
+
import { jsx as s, jsxs as N, Fragment as I } from "react/jsx-runtime";
|
|
9
|
+
// @__NO_SIDE_EFFECTS__
|
|
10
|
+
function ee(e) {
|
|
11
|
+
const t = /* @__PURE__ */ te(e), n = i.forwardRef((r, o) => {
|
|
12
|
+
const { children: a, ...c } = r, l = i.Children.toArray(a), u = l.find(ne);
|
|
13
|
+
if (u) {
|
|
14
|
+
const f = u.props.children, g = l.map((v) => v === u ? i.Children.count(f) > 1 ? i.Children.only(null) : i.isValidElement(f) ? f.props.children : null : v);
|
|
15
|
+
return /* @__PURE__ */ s(t, { ...c, ref: o, children: i.isValidElement(f) ? i.cloneElement(f, void 0, g) : null });
|
|
16
|
+
}
|
|
17
|
+
return /* @__PURE__ */ s(t, { ...c, ref: o, children: a });
|
|
18
|
+
});
|
|
19
|
+
return n.displayName = `${e}.Slot`, n;
|
|
20
|
+
}
|
|
21
|
+
// @__NO_SIDE_EFFECTS__
|
|
22
|
+
function te(e) {
|
|
23
|
+
const t = i.forwardRef((n, r) => {
|
|
24
|
+
const { children: o, ...a } = n;
|
|
25
|
+
if (i.isValidElement(o)) {
|
|
26
|
+
const c = ae(o), l = re(a, o.props);
|
|
27
|
+
return o.type !== i.Fragment && (l.ref = r ? K(r, c) : c), i.cloneElement(o, l);
|
|
28
|
+
}
|
|
29
|
+
return i.Children.count(o) > 1 ? i.Children.only(null) : null;
|
|
30
|
+
});
|
|
31
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
32
|
+
}
|
|
33
|
+
var oe = /* @__PURE__ */ Symbol("radix.slottable");
|
|
34
|
+
function ne(e) {
|
|
35
|
+
return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === oe;
|
|
36
|
+
}
|
|
37
|
+
function re(e, t) {
|
|
38
|
+
const n = { ...t };
|
|
39
|
+
for (const r in t) {
|
|
40
|
+
const o = e[r], a = t[r];
|
|
41
|
+
/^on[A-Z]/.test(r) ? o && a ? n[r] = (...l) => {
|
|
42
|
+
const u = a(...l);
|
|
43
|
+
return o(...l), u;
|
|
44
|
+
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...a } : r === "className" && (n[r] = [o, a].filter(Boolean).join(" "));
|
|
45
|
+
}
|
|
46
|
+
return { ...e, ...n };
|
|
47
|
+
}
|
|
48
|
+
function ae(e) {
|
|
49
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
50
|
+
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
51
|
+
}
|
|
52
|
+
var R = "Dialog", [b] = H(R), [ie, d] = b(R), x = (e) => {
|
|
53
|
+
const {
|
|
54
|
+
__scopeDialog: t,
|
|
55
|
+
children: n,
|
|
56
|
+
open: r,
|
|
57
|
+
defaultOpen: o,
|
|
58
|
+
onOpenChange: a,
|
|
59
|
+
modal: c = !0
|
|
60
|
+
} = e, l = i.useRef(null), u = i.useRef(null), [f, g] = q({
|
|
61
|
+
prop: r,
|
|
62
|
+
defaultProp: o ?? !1,
|
|
63
|
+
onChange: a,
|
|
64
|
+
caller: R
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ s(
|
|
67
|
+
ie,
|
|
68
|
+
{
|
|
69
|
+
scope: t,
|
|
70
|
+
triggerRef: l,
|
|
71
|
+
contentRef: u,
|
|
72
|
+
contentId: y(),
|
|
73
|
+
titleId: y(),
|
|
74
|
+
descriptionId: y(),
|
|
75
|
+
open: f,
|
|
76
|
+
onOpenChange: g,
|
|
77
|
+
onOpenToggle: i.useCallback(() => g((v) => !v), [g]),
|
|
78
|
+
modal: c,
|
|
79
|
+
children: n
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
x.displayName = R;
|
|
84
|
+
var A = "DialogTrigger", T = i.forwardRef(
|
|
85
|
+
(e, t) => {
|
|
86
|
+
const { __scopeDialog: n, ...r } = e, o = d(A, n), a = E(t, o.triggerRef);
|
|
87
|
+
return /* @__PURE__ */ s(
|
|
88
|
+
D.button,
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
"aria-haspopup": "dialog",
|
|
92
|
+
"aria-expanded": o.open,
|
|
93
|
+
"aria-controls": o.contentId,
|
|
94
|
+
"data-state": O(o.open),
|
|
95
|
+
...r,
|
|
96
|
+
ref: a,
|
|
97
|
+
onClick: m(e.onClick, o.onOpenToggle)
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
T.displayName = A;
|
|
103
|
+
var _ = "DialogPortal", [se, S] = b(_, {
|
|
104
|
+
forceMount: void 0
|
|
105
|
+
}), M = (e) => {
|
|
106
|
+
const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, a = d(_, t);
|
|
107
|
+
return /* @__PURE__ */ s(se, { scope: t, forceMount: n, children: i.Children.map(r, (c) => /* @__PURE__ */ s(h, { present: n || a.open, children: /* @__PURE__ */ s(U, { asChild: !0, container: o, children: c }) })) });
|
|
108
|
+
};
|
|
109
|
+
M.displayName = _;
|
|
110
|
+
var C = "DialogOverlay", w = i.forwardRef(
|
|
111
|
+
(e, t) => {
|
|
112
|
+
const n = S(C, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, a = d(C, e.__scopeDialog);
|
|
113
|
+
return a.modal ? /* @__PURE__ */ s(h, { present: r || a.open, children: /* @__PURE__ */ s(ce, { ...o, ref: t }) }) : null;
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
w.displayName = C;
|
|
117
|
+
var le = /* @__PURE__ */ ee("DialogOverlay.RemoveScroll"), ce = i.forwardRef(
|
|
118
|
+
(e, t) => {
|
|
119
|
+
const { __scopeDialog: n, ...r } = e, o = d(C, n);
|
|
120
|
+
return (
|
|
121
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
122
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
123
|
+
/* @__PURE__ */ s(z, { as: le, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ s(
|
|
124
|
+
D.div,
|
|
125
|
+
{
|
|
126
|
+
"data-state": O(o.open),
|
|
127
|
+
...r,
|
|
128
|
+
ref: t,
|
|
129
|
+
style: { pointerEvents: "auto", ...r.style }
|
|
130
|
+
}
|
|
131
|
+
) })
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
), p = "DialogContent", F = i.forwardRef(
|
|
135
|
+
(e, t) => {
|
|
136
|
+
const n = S(p, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, a = d(p, e.__scopeDialog);
|
|
137
|
+
return /* @__PURE__ */ s(h, { present: r || a.open, children: a.modal ? /* @__PURE__ */ s(ue, { ...o, ref: t }) : /* @__PURE__ */ s(de, { ...o, ref: t }) });
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
F.displayName = p;
|
|
141
|
+
var ue = i.forwardRef(
|
|
142
|
+
(e, t) => {
|
|
143
|
+
const n = d(p, e.__scopeDialog), r = i.useRef(null), o = E(t, n.contentRef, r);
|
|
144
|
+
return i.useEffect(() => {
|
|
145
|
+
const a = r.current;
|
|
146
|
+
if (a) return J(a);
|
|
147
|
+
}, []), /* @__PURE__ */ s(
|
|
148
|
+
W,
|
|
149
|
+
{
|
|
150
|
+
...e,
|
|
151
|
+
ref: o,
|
|
152
|
+
trapFocus: n.open,
|
|
153
|
+
disableOutsidePointerEvents: !0,
|
|
154
|
+
onCloseAutoFocus: m(e.onCloseAutoFocus, (a) => {
|
|
155
|
+
a.preventDefault(), n.triggerRef.current?.focus();
|
|
156
|
+
}),
|
|
157
|
+
onPointerDownOutside: m(e.onPointerDownOutside, (a) => {
|
|
158
|
+
const c = a.detail.originalEvent, l = c.button === 0 && c.ctrlKey === !0;
|
|
159
|
+
(c.button === 2 || l) && a.preventDefault();
|
|
160
|
+
}),
|
|
161
|
+
onFocusOutside: m(
|
|
162
|
+
e.onFocusOutside,
|
|
163
|
+
(a) => a.preventDefault()
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
), de = i.forwardRef(
|
|
169
|
+
(e, t) => {
|
|
170
|
+
const n = d(p, e.__scopeDialog), r = i.useRef(!1), o = i.useRef(!1);
|
|
171
|
+
return /* @__PURE__ */ s(
|
|
172
|
+
W,
|
|
173
|
+
{
|
|
174
|
+
...e,
|
|
175
|
+
ref: t,
|
|
176
|
+
trapFocus: !1,
|
|
177
|
+
disableOutsidePointerEvents: !1,
|
|
178
|
+
onCloseAutoFocus: (a) => {
|
|
179
|
+
e.onCloseAutoFocus?.(a), a.defaultPrevented || (r.current || n.triggerRef.current?.focus(), a.preventDefault()), r.current = !1, o.current = !1;
|
|
180
|
+
},
|
|
181
|
+
onInteractOutside: (a) => {
|
|
182
|
+
e.onInteractOutside?.(a), a.defaultPrevented || (r.current = !0, a.detail.originalEvent.type === "pointerdown" && (o.current = !0));
|
|
183
|
+
const c = a.target;
|
|
184
|
+
n.triggerRef.current?.contains(c) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && o.current && a.preventDefault();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
), W = i.forwardRef(
|
|
190
|
+
(e, t) => {
|
|
191
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: a, ...c } = e, l = d(p, n), u = i.useRef(null), f = E(t, u);
|
|
192
|
+
return Q(), /* @__PURE__ */ N(I, { children: [
|
|
193
|
+
/* @__PURE__ */ s(
|
|
194
|
+
X,
|
|
195
|
+
{
|
|
196
|
+
asChild: !0,
|
|
197
|
+
loop: !0,
|
|
198
|
+
trapped: r,
|
|
199
|
+
onMountAutoFocus: o,
|
|
200
|
+
onUnmountAutoFocus: a,
|
|
201
|
+
children: /* @__PURE__ */ s(
|
|
202
|
+
Y,
|
|
203
|
+
{
|
|
204
|
+
role: "dialog",
|
|
205
|
+
id: l.contentId,
|
|
206
|
+
"aria-describedby": l.descriptionId,
|
|
207
|
+
"aria-labelledby": l.titleId,
|
|
208
|
+
"data-state": O(l.open),
|
|
209
|
+
...c,
|
|
210
|
+
ref: f,
|
|
211
|
+
onDismiss: () => l.onOpenChange(!1)
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
/* @__PURE__ */ N(I, { children: [
|
|
217
|
+
/* @__PURE__ */ s(fe, { titleId: l.titleId }),
|
|
218
|
+
/* @__PURE__ */ s(ge, { contentRef: u, descriptionId: l.descriptionId })
|
|
219
|
+
] })
|
|
220
|
+
] });
|
|
221
|
+
}
|
|
222
|
+
), P = "DialogTitle", L = i.forwardRef(
|
|
223
|
+
(e, t) => {
|
|
224
|
+
const { __scopeDialog: n, ...r } = e, o = d(P, n);
|
|
225
|
+
return /* @__PURE__ */ s(D.h2, { id: o.titleId, ...r, ref: t });
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
L.displayName = P;
|
|
229
|
+
var k = "DialogDescription", G = i.forwardRef(
|
|
230
|
+
(e, t) => {
|
|
231
|
+
const { __scopeDialog: n, ...r } = e, o = d(k, n);
|
|
232
|
+
return /* @__PURE__ */ s(D.p, { id: o.descriptionId, ...r, ref: t });
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
G.displayName = k;
|
|
236
|
+
var V = "DialogClose", $ = i.forwardRef(
|
|
237
|
+
(e, t) => {
|
|
238
|
+
const { __scopeDialog: n, ...r } = e, o = d(V, n);
|
|
239
|
+
return /* @__PURE__ */ s(
|
|
240
|
+
D.button,
|
|
241
|
+
{
|
|
242
|
+
type: "button",
|
|
243
|
+
...r,
|
|
244
|
+
ref: t,
|
|
245
|
+
onClick: m(e.onClick, () => o.onOpenChange(!1))
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
$.displayName = V;
|
|
251
|
+
function O(e) {
|
|
252
|
+
return e ? "open" : "closed";
|
|
253
|
+
}
|
|
254
|
+
var j = "DialogTitleWarning", [Ee, B] = Z(j, {
|
|
255
|
+
contentName: p,
|
|
256
|
+
titleName: P,
|
|
257
|
+
docsSlug: "dialog"
|
|
258
|
+
}), fe = ({ titleId: e }) => {
|
|
259
|
+
const t = B(j), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
260
|
+
|
|
261
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
262
|
+
|
|
263
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
264
|
+
return i.useEffect(() => {
|
|
265
|
+
e && (document.getElementById(e) || console.error(n));
|
|
266
|
+
}, [n, e]), null;
|
|
267
|
+
}, pe = "DialogDescriptionWarning", ge = ({ contentRef: e, descriptionId: t }) => {
|
|
268
|
+
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B(pe).contentName}}.`;
|
|
269
|
+
return i.useEffect(() => {
|
|
270
|
+
const o = e.current?.getAttribute("aria-describedby");
|
|
271
|
+
t && o && (document.getElementById(t) || console.warn(r));
|
|
272
|
+
}, [r, e, t]), null;
|
|
273
|
+
}, _e = x, Pe = T, Oe = M, Ne = w, Ie = F, be = L, xe = G, Ae = $;
|
|
274
|
+
export {
|
|
275
|
+
Ie as C,
|
|
276
|
+
xe as D,
|
|
277
|
+
Ne as O,
|
|
278
|
+
Oe as P,
|
|
279
|
+
_e as R,
|
|
280
|
+
be as T,
|
|
281
|
+
Ae as a,
|
|
282
|
+
Pe as b
|
|
283
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import * as m from "react-dom";
|
|
3
|
+
import { c as y } from "./index-DLcqcWxM.js";
|
|
4
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
5
|
+
// @__NO_SIDE_EFFECTS__
|
|
6
|
+
function h(e) {
|
|
7
|
+
const r = /* @__PURE__ */ v(e), o = i.forwardRef((n, t) => {
|
|
8
|
+
const { children: l, ...a } = n, s = i.Children.toArray(l), c = s.find(S);
|
|
9
|
+
if (c) {
|
|
10
|
+
const f = c.props.children, d = s.map((u) => u === c ? i.Children.count(f) > 1 ? i.Children.only(null) : i.isValidElement(f) ? f.props.children : null : u);
|
|
11
|
+
return /* @__PURE__ */ p(r, { ...a, ref: t, children: i.isValidElement(f) ? i.cloneElement(f, void 0, d) : null });
|
|
12
|
+
}
|
|
13
|
+
return /* @__PURE__ */ p(r, { ...a, ref: t, children: l });
|
|
14
|
+
});
|
|
15
|
+
return o.displayName = `${e}.Slot`, o;
|
|
16
|
+
}
|
|
17
|
+
// @__NO_SIDE_EFFECTS__
|
|
18
|
+
function v(e) {
|
|
19
|
+
const r = i.forwardRef((o, n) => {
|
|
20
|
+
const { children: t, ...l } = o;
|
|
21
|
+
if (i.isValidElement(t)) {
|
|
22
|
+
const a = g(t), s = C(l, t.props);
|
|
23
|
+
return t.type !== i.Fragment && (s.ref = n ? y(n, a) : a), i.cloneElement(t, s);
|
|
24
|
+
}
|
|
25
|
+
return i.Children.count(t) > 1 ? i.Children.only(null) : null;
|
|
26
|
+
});
|
|
27
|
+
return r.displayName = `${e}.SlotClone`, r;
|
|
28
|
+
}
|
|
29
|
+
var E = /* @__PURE__ */ Symbol("radix.slottable");
|
|
30
|
+
function S(e) {
|
|
31
|
+
return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === E;
|
|
32
|
+
}
|
|
33
|
+
function C(e, r) {
|
|
34
|
+
const o = { ...r };
|
|
35
|
+
for (const n in r) {
|
|
36
|
+
const t = e[n], l = r[n];
|
|
37
|
+
/^on[A-Z]/.test(n) ? t && l ? o[n] = (...s) => {
|
|
38
|
+
const c = l(...s);
|
|
39
|
+
return t(...s), c;
|
|
40
|
+
} : t && (o[n] = t) : n === "style" ? o[n] = { ...t, ...l } : n === "className" && (o[n] = [t, l].filter(Boolean).join(" "));
|
|
41
|
+
}
|
|
42
|
+
return { ...e, ...o };
|
|
43
|
+
}
|
|
44
|
+
function g(e) {
|
|
45
|
+
let r = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, o = r && "isReactWarning" in r && r.isReactWarning;
|
|
46
|
+
return o ? e.ref : (r = Object.getOwnPropertyDescriptor(e, "ref")?.get, o = r && "isReactWarning" in r && r.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
|
|
47
|
+
}
|
|
48
|
+
var R = [
|
|
49
|
+
"a",
|
|
50
|
+
"button",
|
|
51
|
+
"div",
|
|
52
|
+
"form",
|
|
53
|
+
"h2",
|
|
54
|
+
"h3",
|
|
55
|
+
"img",
|
|
56
|
+
"input",
|
|
57
|
+
"label",
|
|
58
|
+
"li",
|
|
59
|
+
"nav",
|
|
60
|
+
"ol",
|
|
61
|
+
"p",
|
|
62
|
+
"select",
|
|
63
|
+
"span",
|
|
64
|
+
"svg",
|
|
65
|
+
"ul"
|
|
66
|
+
], w = R.reduce((e, r) => {
|
|
67
|
+
const o = /* @__PURE__ */ h(`Primitive.${r}`), n = i.forwardRef((t, l) => {
|
|
68
|
+
const { asChild: a, ...s } = t, c = a ? o : r;
|
|
69
|
+
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ p(c, { ...s, ref: l });
|
|
70
|
+
});
|
|
71
|
+
return n.displayName = `Primitive.${r}`, { ...e, [r]: n };
|
|
72
|
+
}, {});
|
|
73
|
+
function N(e, r) {
|
|
74
|
+
e && m.flushSync(() => e.dispatchEvent(r));
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
w as P,
|
|
78
|
+
N as d
|
|
79
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { a as O } from "./utils-eGXXUFl7.js";
|
|
2
|
+
const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j = (e, l) => (n) => {
|
|
3
|
+
var u;
|
|
4
|
+
if (l?.variants == null) return y(e, n?.class, n?.className);
|
|
5
|
+
const { variants: r, defaultVariants: d } = l, V = Object.keys(r).map((t) => {
|
|
6
|
+
const a = n?.[t], s = d?.[t];
|
|
7
|
+
if (a === null) return null;
|
|
8
|
+
const i = m(a) || m(s);
|
|
9
|
+
return r[t][i];
|
|
10
|
+
}), v = n && Object.entries(n).reduce((t, a) => {
|
|
11
|
+
let [s, i] = a;
|
|
12
|
+
return i === void 0 || (t[s] = i), t;
|
|
13
|
+
}, {}), N = l == null || (u = l.compoundVariants) === null || u === void 0 ? void 0 : u.reduce((t, a) => {
|
|
14
|
+
let { class: s, className: i, ...f } = a;
|
|
15
|
+
return Object.entries(f).every((C) => {
|
|
16
|
+
let [c, o] = C;
|
|
17
|
+
return Array.isArray(o) ? o.includes({
|
|
18
|
+
...d,
|
|
19
|
+
...v
|
|
20
|
+
}[c]) : {
|
|
21
|
+
...d,
|
|
22
|
+
...v
|
|
23
|
+
}[c] === o;
|
|
24
|
+
}) ? [
|
|
25
|
+
...t,
|
|
26
|
+
s,
|
|
27
|
+
i
|
|
28
|
+
] : t;
|
|
29
|
+
}, []);
|
|
30
|
+
return y(e, V, N, n?.class, n?.className);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
j as c
|
|
34
|
+
};
|