@revealui/presentation 0.3.2 → 0.3.4
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 +14 -0
- package/dist/{Text-BWMs9_wn.js → Text-mMOCv1lF.js} +11 -3
- package/dist/Text-mMOCv1lF.js.map +1 -0
- package/dist/client.d.ts +3 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -10
- package/dist/client.js.map +1 -1
- package/dist/components/BuiltWithRevealUI.d.ts +4 -2
- package/dist/components/BuiltWithRevealUI.d.ts.map +1 -1
- package/dist/components/Button.d.ts +4 -2
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Card.d.ts.map +1 -1
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/accordion.d.ts.map +1 -1
- package/dist/components/alert.d.ts.map +1 -1
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/badge.d.ts.map +1 -1
- package/dist/components/breadcrumb.d.ts.map +1 -1
- package/dist/components/button-headless.d.ts.map +1 -1
- package/dist/components/callout.d.ts.map +1 -1
- package/dist/components/checkbox-headless.d.ts.map +1 -1
- package/dist/components/combobox.d.ts.map +1 -1
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/drawer.d.ts.map +1 -1
- package/dist/components/dropdown.d.ts.map +1 -1
- package/dist/components/empty-state.d.ts.map +1 -1
- package/dist/components/fieldset.d.ts.map +1 -1
- package/dist/components/icon.d.ts +53 -0
- package/dist/components/icon.d.ts.map +1 -0
- package/dist/components/input-headless.d.ts.map +1 -1
- package/dist/components/kbd.d.ts.map +1 -1
- package/dist/components/listbox.d.ts.map +1 -1
- package/dist/components/navbar.d.ts.map +1 -1
- package/dist/components/radio.d.ts.map +1 -1
- package/dist/components/select-headless.d.ts.map +1 -1
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/skeleton.d.ts.map +1 -1
- package/dist/components/stat.d.ts.map +1 -1
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/table.d.ts.map +1 -1
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/textarea-headless.d.ts.map +1 -1
- package/dist/components/timeline.d.ts.map +1 -1
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/use-theme.d.ts +26 -0
- package/dist/hooks/use-theme.d.ts.map +1 -0
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +403 -3
- package/dist/server.js.map +1 -0
- package/dist/{skeleton-Bb51IWbG.js → skeleton-CHPpiyJj.js} +35 -83
- package/dist/skeleton-CHPpiyJj.js.map +1 -0
- package/dist/{tooltip-DZGP3hO_.js → use-theme-QxeZadnD.js} +285 -154
- package/dist/use-theme-QxeZadnD.js.map +1 -0
- package/dist/utils/cn.d.ts +21 -4
- package/dist/utils/cn.d.ts.map +1 -1
- package/package.json +3 -6
- package/dist/Text-BWMs9_wn.js.map +0 -1
- package/dist/skeleton-Bb51IWbG.js.map +0 -1
- package/dist/tooltip-DZGP3hO_.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { Children, createContext, isValidElement, use, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
1
|
+
import { i as Box, v as cn } from "./skeleton-CHPpiyJj.js";
|
|
2
|
+
import React, { Children, createContext, isValidElement, use, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
//#region src/components/accordion.tsx
|
|
6
6
|
function Accordion({ className, children }) {
|
|
7
7
|
return /* @__PURE__ */ jsx("div", {
|
|
8
|
-
className:
|
|
8
|
+
className: cn("divide-y divide-zinc-200 dark:divide-zinc-700", className),
|
|
9
9
|
children
|
|
10
10
|
});
|
|
11
11
|
}
|
|
@@ -25,7 +25,7 @@ function AccordionItem({ title, defaultOpen = false, className, children }) {
|
|
|
25
25
|
"aria-hidden": "true",
|
|
26
26
|
viewBox: "0 0 16 16",
|
|
27
27
|
fill: "none",
|
|
28
|
-
className:
|
|
28
|
+
className: cn("size-4 shrink-0 text-zinc-400 transition-transform duration-200", open && "rotate-180"),
|
|
29
29
|
children: /* @__PURE__ */ jsx("path", {
|
|
30
30
|
d: "M4 6l4 4 4-4",
|
|
31
31
|
stroke: "currentColor",
|
|
@@ -278,7 +278,25 @@ function Text({ className, ...props }) {
|
|
|
278
278
|
return /* @__PURE__ */ jsx("p", {
|
|
279
279
|
"data-slot": "text",
|
|
280
280
|
...props,
|
|
281
|
-
className:
|
|
281
|
+
className: cn(className, "text-base/6 text-zinc-500 sm:text-sm/6 dark:text-zinc-400")
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
function TextLink({ className, ...props }) {
|
|
285
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
286
|
+
...props,
|
|
287
|
+
className: cn(className, "text-zinc-950 underline decoration-zinc-950/50 data-hover:decoration-zinc-950 dark:text-white dark:decoration-white/50 dark:data-hover:decoration-white")
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
function Strong({ className, ...props }) {
|
|
291
|
+
return /* @__PURE__ */ jsx("strong", {
|
|
292
|
+
...props,
|
|
293
|
+
className: cn(className, "font-medium text-zinc-950 dark:text-white")
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
function Code({ className, ...props }) {
|
|
297
|
+
return /* @__PURE__ */ jsx("code", {
|
|
298
|
+
...props,
|
|
299
|
+
className: cn(className, "rounded-sm border border-zinc-950/10 bg-zinc-950/2.5 px-0.5 text-sm font-medium text-zinc-950 sm:text-[0.8125rem] dark:border-white/20 dark:bg-white/5 dark:text-white")
|
|
282
300
|
});
|
|
283
301
|
}
|
|
284
302
|
//#endregion
|
|
@@ -324,7 +342,7 @@ function Alert({ size = "md", className, children, open, onClose }) {
|
|
|
324
342
|
panel.nodeRef.current = node;
|
|
325
343
|
},
|
|
326
344
|
...panel.transitionProps,
|
|
327
|
-
className:
|
|
345
|
+
className: cn(className, sizes$1[size], "row-start-2 w-full rounded-2xl bg-white p-8 shadow-lg ring-1 ring-zinc-950/10 sm:rounded-2xl sm:p-6 dark:bg-zinc-900 dark:ring-white/10 forced-colors:outline", "transition duration-100 will-change-transform data-closed:opacity-0 data-enter:ease-out data-closed:data-enter:scale-95 data-leave:ease-in"),
|
|
328
346
|
children
|
|
329
347
|
})
|
|
330
348
|
})
|
|
@@ -334,25 +352,25 @@ function Alert({ size = "md", className, children, open, onClose }) {
|
|
|
334
352
|
function AlertTitle({ className, ...props }) {
|
|
335
353
|
return /* @__PURE__ */ jsx("h2", {
|
|
336
354
|
...props,
|
|
337
|
-
className:
|
|
355
|
+
className: cn(className, "text-center text-base/6 font-semibold text-balance text-zinc-950 sm:text-left sm:text-sm/6 sm:text-wrap dark:text-white")
|
|
338
356
|
});
|
|
339
357
|
}
|
|
340
358
|
function AlertDescription({ className, ...props }) {
|
|
341
359
|
return /* @__PURE__ */ jsx(Text, {
|
|
342
360
|
...props,
|
|
343
|
-
className:
|
|
361
|
+
className: cn(className, "mt-2 text-center text-pretty sm:text-left")
|
|
344
362
|
});
|
|
345
363
|
}
|
|
346
364
|
function AlertBody({ className, ...props }) {
|
|
347
365
|
return /* @__PURE__ */ jsx("div", {
|
|
348
366
|
...props,
|
|
349
|
-
className:
|
|
367
|
+
className: cn(className, "mt-4")
|
|
350
368
|
});
|
|
351
369
|
}
|
|
352
370
|
function AlertActions({ className, ...props }) {
|
|
353
371
|
return /* @__PURE__ */ jsx("div", {
|
|
354
372
|
...props,
|
|
355
|
-
className:
|
|
373
|
+
className: cn(className, "mt-6 flex flex-col-reverse items-center justify-end gap-3 *:w-full sm:mt-4 sm:flex-row sm:*:w-auto")
|
|
356
374
|
});
|
|
357
375
|
}
|
|
358
376
|
//#endregion
|
|
@@ -440,7 +458,7 @@ var styles = {
|
|
|
440
458
|
};
|
|
441
459
|
function Button({ color, outline, plain, className, children, ref, ...props }) {
|
|
442
460
|
const interactiveProps = useDataInteractive({ disabled: ("disabled" in props ? props.disabled : false) ?? false });
|
|
443
|
-
const classes =
|
|
461
|
+
const classes = cn(className, styles.base, outline ? styles.outline : plain ? styles.plain : cn(styles.solid, styles.colors[color ?? "dark/zinc"]));
|
|
444
462
|
return typeof props.href === "string" ? /* @__PURE__ */ jsx(Link, {
|
|
445
463
|
...props,
|
|
446
464
|
className: classes,
|
|
@@ -450,7 +468,7 @@ function Button({ color, outline, plain, className, children, ref, ...props }) {
|
|
|
450
468
|
type: "button",
|
|
451
469
|
...props,
|
|
452
470
|
...interactiveProps,
|
|
453
|
-
className:
|
|
471
|
+
className: cn(classes, "cursor-default"),
|
|
454
472
|
ref,
|
|
455
473
|
children: /* @__PURE__ */ jsx(TouchTarget, { children })
|
|
456
474
|
});
|
|
@@ -471,7 +489,7 @@ function Avatar({ src = null, square = false, initials, alt = "", className, ...
|
|
|
471
489
|
return /* @__PURE__ */ jsxs("span", {
|
|
472
490
|
"data-slot": "avatar",
|
|
473
491
|
...props,
|
|
474
|
-
className:
|
|
492
|
+
className: cn(className, "inline-grid shrink-0 align-middle [--avatar-radius:20%] *:col-start-1 *:row-start-1", "outline -outline-offset-1 outline-black/10 dark:outline-white/10", square ? "rounded-(--avatar-radius) *:rounded-(--avatar-radius)" : "rounded-full *:rounded-full"),
|
|
475
493
|
children: [initials && /* @__PURE__ */ jsxs("svg", {
|
|
476
494
|
className: "size-full fill-current p-[5%] text-[48px] font-medium uppercase select-none",
|
|
477
495
|
viewBox: "0 0 100 100",
|
|
@@ -494,7 +512,7 @@ function Avatar({ src = null, square = false, initials, alt = "", className, ...
|
|
|
494
512
|
}
|
|
495
513
|
function AvatarButton({ src, square = false, initials, alt, className, ref, ...props }) {
|
|
496
514
|
const interactiveProps = useDataInteractive({ disabled: ("disabled" in props ? props.disabled : false) ?? false });
|
|
497
|
-
const classes =
|
|
515
|
+
const classes = cn(className, square ? "rounded-[20%]" : "rounded-full", "relative inline-grid focus:not-data-focus:outline-hidden data-focus:outline-2 data-focus:outline-offset-2 data-focus:outline-blue-500");
|
|
498
516
|
return typeof props.href === "string" ? /* @__PURE__ */ jsx(Link, {
|
|
499
517
|
...props,
|
|
500
518
|
className: classes,
|
|
@@ -537,10 +555,10 @@ function AvatarGroup({ items, max = 5, size = "md", className }) {
|
|
|
537
555
|
const visible = items.slice(0, max);
|
|
538
556
|
const overflow = items.length - max;
|
|
539
557
|
return /* @__PURE__ */ jsxs("div", {
|
|
540
|
-
className:
|
|
558
|
+
className: cn("flex items-center", className),
|
|
541
559
|
children: [visible.map((item, i) => {
|
|
542
560
|
return /* @__PURE__ */ jsx("div", {
|
|
543
|
-
className:
|
|
561
|
+
className: cn("ring-2 ring-white dark:ring-zinc-900", sizeClasses[size], i > 0 && overlapClass[size], "rounded-full"),
|
|
544
562
|
children: /* @__PURE__ */ jsx(Avatar, {
|
|
545
563
|
src: item.src,
|
|
546
564
|
initials: item.initials,
|
|
@@ -549,7 +567,7 @@ function AvatarGroup({ items, max = 5, size = "md", className }) {
|
|
|
549
567
|
})
|
|
550
568
|
}, i);
|
|
551
569
|
}), overflow > 0 && /* @__PURE__ */ jsxs("div", {
|
|
552
|
-
className:
|
|
570
|
+
className: cn(overlapClass[size], sizeClasses[size], "flex items-center justify-center rounded-full bg-zinc-200 text-xs font-medium text-zinc-600 ring-2 ring-white dark:bg-zinc-700 dark:text-zinc-300 dark:ring-zinc-900"),
|
|
553
571
|
role: "img",
|
|
554
572
|
"aria-label": `${overflow} more`,
|
|
555
573
|
children: ["+", overflow]
|
|
@@ -581,12 +599,16 @@ var colors$2 = {
|
|
|
581
599
|
function Badge({ color = "zinc", className, ...props }) {
|
|
582
600
|
return /* @__PURE__ */ jsx("span", {
|
|
583
601
|
...props,
|
|
584
|
-
className:
|
|
602
|
+
className: cn(className, "inline-flex items-center gap-x-1.5 rounded-md px-1.5 py-0.5 text-sm/5 font-medium sm:text-xs/5 forced-colors:outline", colors$2[color]),
|
|
603
|
+
style: {
|
|
604
|
+
borderRadius: "var(--rvui-radius-full, 9999px)",
|
|
605
|
+
transition: "background-color var(--rvui-duration-fast, 120ms) var(--rvui-ease, cubic-bezier(0.22, 1, 0.36, 1))"
|
|
606
|
+
}
|
|
585
607
|
});
|
|
586
608
|
}
|
|
587
609
|
function BadgeButton({ color = "zinc", className, children, ref, ...props }) {
|
|
588
610
|
const interactiveProps = useDataInteractive({ disabled: ("disabled" in props ? props.disabled : false) ?? false });
|
|
589
|
-
const classes =
|
|
611
|
+
const classes = cn(className, "group relative inline-flex rounded-md focus:not-data-focus:outline-hidden data-focus:outline-2 data-focus:outline-offset-2 data-focus:outline-blue-500");
|
|
590
612
|
return typeof props.href === "string" ? /* @__PURE__ */ jsx(Link, {
|
|
591
613
|
...props,
|
|
592
614
|
className: classes,
|
|
@@ -687,11 +709,11 @@ function Callout({ variant = "info", title, icon, className, children }) {
|
|
|
687
709
|
const styles = variantStyles[variant];
|
|
688
710
|
return /* @__PURE__ */ jsx("div", {
|
|
689
711
|
role: "note",
|
|
690
|
-
className:
|
|
712
|
+
className: cn("rounded-xl p-4 ring-1", styles.wrapper, className),
|
|
691
713
|
children: /* @__PURE__ */ jsxs("div", {
|
|
692
714
|
className: "flex gap-3",
|
|
693
715
|
children: [/* @__PURE__ */ jsx("span", {
|
|
694
|
-
className:
|
|
716
|
+
className: cn("mt-0.5 shrink-0 text-sm font-bold", styles.icon),
|
|
695
717
|
"aria-hidden": "true",
|
|
696
718
|
children: icon ?? styles.iconChar
|
|
697
719
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -700,7 +722,7 @@ function Callout({ variant = "info", title, icon, className, children }) {
|
|
|
700
722
|
className: "text-sm font-semibold text-zinc-950 dark:text-white",
|
|
701
723
|
children: title
|
|
702
724
|
}), /* @__PURE__ */ jsx("div", {
|
|
703
|
-
className:
|
|
725
|
+
className: cn("text-sm text-zinc-700 dark:text-zinc-300", title && "mt-1"),
|
|
704
726
|
children
|
|
705
727
|
})]
|
|
706
728
|
})]
|
|
@@ -826,7 +848,7 @@ function CheckboxGroup({ className, ...props }) {
|
|
|
826
848
|
return /* @__PURE__ */ jsx("div", {
|
|
827
849
|
"data-slot": "control",
|
|
828
850
|
...props,
|
|
829
|
-
className:
|
|
851
|
+
className: cn(className, "space-y-3", "has-data-[slot=description]:space-y-6 has-data-[slot=description]:**:data-[slot=label]:font-medium")
|
|
830
852
|
});
|
|
831
853
|
}
|
|
832
854
|
function CheckboxField({ className, disabled, ...props }) {
|
|
@@ -836,7 +858,7 @@ function CheckboxField({ className, disabled, ...props }) {
|
|
|
836
858
|
"data-slot": "field",
|
|
837
859
|
"data-disabled": disabled ? "" : void 0,
|
|
838
860
|
...props,
|
|
839
|
-
className:
|
|
861
|
+
className: cn(className, "grid grid-cols-[1.125rem_1fr] gap-x-4 gap-y-1 sm:grid-cols-[1rem_1fr]", "*:data-[slot=control]:col-start-1 *:data-[slot=control]:row-start-1 *:data-[slot=control]:mt-0.75 sm:*:data-[slot=control]:mt-1", "*:data-[slot=label]:col-start-2 *:data-[slot=label]:row-start-1", "*:data-[slot=description]:col-start-2 *:data-[slot=description]:row-start-2", "has-data-[slot=description]:**:data-[slot=label]:font-medium")
|
|
840
862
|
})
|
|
841
863
|
});
|
|
842
864
|
}
|
|
@@ -907,13 +929,13 @@ function Checkbox({ color = "dark/zinc", className, checked: controlledChecked,
|
|
|
907
929
|
onKeyDown: disabled ? void 0 : handleKeyDown,
|
|
908
930
|
...interactiveProps,
|
|
909
931
|
...props,
|
|
910
|
-
className:
|
|
932
|
+
className: cn(className, "group inline-flex focus:outline-hidden"),
|
|
911
933
|
children: [name && /* @__PURE__ */ jsx("input", {
|
|
912
934
|
type: "hidden",
|
|
913
935
|
name,
|
|
914
936
|
value: checked ? value ?? "on" : ""
|
|
915
937
|
}), /* @__PURE__ */ jsx("span", {
|
|
916
|
-
className:
|
|
938
|
+
className: cn([base$1, colors$1[color]]),
|
|
917
939
|
children: /* @__PURE__ */ jsxs("svg", {
|
|
918
940
|
className: "size-4 stroke-(--checkbox-check) opacity-0 group-data-checked:opacity-100 sm:h-3.5 sm:w-3.5",
|
|
919
941
|
viewBox: "0 0 14 14",
|
|
@@ -949,7 +971,7 @@ function CodeBlock({ code, language, filename, showCopy = true, className }) {
|
|
|
949
971
|
setTimeout(() => setCopied(false), 2e3);
|
|
950
972
|
}, [code]);
|
|
951
973
|
return /* @__PURE__ */ jsxs("div", {
|
|
952
|
-
className:
|
|
974
|
+
className: cn("overflow-hidden rounded-xl bg-zinc-950 ring-1 ring-zinc-800", className),
|
|
953
975
|
children: [(filename || language || showCopy) && /* @__PURE__ */ jsxs("div", {
|
|
954
976
|
className: "flex items-center justify-between border-b border-zinc-800 px-4 py-2.5",
|
|
955
977
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -1194,7 +1216,7 @@ function Combobox({ options, displayValue, filter, anchor = "bottom", className,
|
|
|
1194
1216
|
ref: controlRef,
|
|
1195
1217
|
"data-slot": "control",
|
|
1196
1218
|
...disabled ? { "data-disabled": "" } : {},
|
|
1197
|
-
className:
|
|
1219
|
+
className: cn([
|
|
1198
1220
|
className,
|
|
1199
1221
|
"relative block w-full",
|
|
1200
1222
|
"before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm",
|
|
@@ -1227,7 +1249,7 @@ function Combobox({ options, displayValue, filter, anchor = "bottom", className,
|
|
|
1227
1249
|
onKeyDown: handleInputKeyDown,
|
|
1228
1250
|
placeholder,
|
|
1229
1251
|
...disabled ? { "data-disabled": "" } : {},
|
|
1230
|
-
className:
|
|
1252
|
+
className: cn([
|
|
1231
1253
|
className,
|
|
1232
1254
|
"relative block w-full appearance-none rounded-lg py-[calc(--spacing(2.5)-1px)] sm:py-[calc(--spacing(1.5)-1px)]",
|
|
1233
1255
|
"pr-[calc(--spacing(10)-1px)] pl-[calc(--spacing(3.5)-1px)] sm:pr-[calc(--spacing(9)-1px)] sm:pl-[calc(--spacing(3)-1px)]",
|
|
@@ -1280,7 +1302,7 @@ function Combobox({ options, displayValue, filter, anchor = "bottom", className,
|
|
|
1280
1302
|
id: listboxId,
|
|
1281
1303
|
...popoverProps,
|
|
1282
1304
|
...transitionProps,
|
|
1283
|
-
className:
|
|
1305
|
+
className: cn("[--anchor-gap:--spacing(2)] [--anchor-padding:--spacing(4)] sm:data-[anchor~=start]:[--anchor-offset:-4px]", "isolate min-w-[calc(var(--input-width)+8px)] scroll-py-1 rounded-xl p-1 select-none empty:invisible", "outline outline-transparent focus:outline-hidden", "overflow-y-scroll overscroll-contain", "bg-white/75 backdrop-blur-xl dark:bg-zinc-800/75", "shadow-lg ring-1 ring-zinc-950/10 dark:ring-white/10 dark:ring-inset", "transition-opacity duration-100 ease-in data-closed:data-leave:opacity-0 data-transition:pointer-events-none"),
|
|
1284
1306
|
style: {
|
|
1285
1307
|
...popoverProps.style,
|
|
1286
1308
|
minWidth: controlRef.current?.offsetWidth
|
|
@@ -1304,7 +1326,7 @@ function ComboboxOption({ children, className, value, disabled = false }) {
|
|
|
1304
1326
|
const index = use(ComboboxOptionIndexContext);
|
|
1305
1327
|
const isSelected = selectedValue === value;
|
|
1306
1328
|
const isActive = activeIndex === index;
|
|
1307
|
-
const sharedClasses =
|
|
1329
|
+
const sharedClasses = cn("flex min-w-0 items-center", "*:data-[slot=icon]:size-5 *:data-[slot=icon]:shrink-0 sm:*:data-[slot=icon]:size-4", "*:data-[slot=icon]:text-zinc-500 group-data-focus/option:*:data-[slot=icon]:text-white dark:*:data-[slot=icon]:text-zinc-400", "forced-colors:*:data-[slot=icon]:text-[CanvasText] forced-colors:group-data-focus/option:*:data-[slot=icon]:text-[Canvas]", "*:data-[slot=avatar]:-mx-0.5 *:data-[slot=avatar]:size-6 sm:*:data-[slot=avatar]:size-5");
|
|
1308
1330
|
return /* @__PURE__ */ jsxs("div", {
|
|
1309
1331
|
role: "option",
|
|
1310
1332
|
"aria-selected": isSelected,
|
|
@@ -1322,9 +1344,9 @@ function ComboboxOption({ children, className, value, disabled = false }) {
|
|
|
1322
1344
|
onClick: () => {
|
|
1323
1345
|
if (!disabled) select(value);
|
|
1324
1346
|
},
|
|
1325
|
-
className:
|
|
1347
|
+
className: cn("group/option grid w-full cursor-default grid-cols-[1fr_--spacing(5)] items-baseline gap-x-2 rounded-lg py-2.5 pr-2 pl-3.5 sm:grid-cols-[1fr_--spacing(4)] sm:py-1.5 sm:pr-2 sm:pl-3", "text-base/6 text-zinc-950 sm:text-sm/6 dark:text-white forced-colors:text-[CanvasText]", "outline-hidden data-focus:bg-blue-500 data-focus:text-white", "forced-color-adjust-none forced-colors:data-focus:bg-[Highlight] forced-colors:data-focus:text-[HighlightText]", "data-disabled:opacity-50"),
|
|
1326
1348
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1327
|
-
className:
|
|
1349
|
+
className: cn(className, sharedClasses),
|
|
1328
1350
|
children
|
|
1329
1351
|
}), /* @__PURE__ */ jsx("svg", {
|
|
1330
1352
|
className: "relative col-start-2 hidden size-5 self-center stroke-current group-data-selected/option:inline sm:size-4",
|
|
@@ -1343,13 +1365,13 @@ function ComboboxOption({ children, className, value, disabled = false }) {
|
|
|
1343
1365
|
function ComboboxLabel({ className, ...props }) {
|
|
1344
1366
|
return /* @__PURE__ */ jsx("span", {
|
|
1345
1367
|
...props,
|
|
1346
|
-
className:
|
|
1368
|
+
className: cn(className, "ml-2.5 truncate first:ml-0 sm:ml-2 sm:first:ml-0")
|
|
1347
1369
|
});
|
|
1348
1370
|
}
|
|
1349
1371
|
function ComboboxDescription({ className, children, ...props }) {
|
|
1350
1372
|
return /* @__PURE__ */ jsx("span", {
|
|
1351
1373
|
...props,
|
|
1352
|
-
className:
|
|
1374
|
+
className: cn(className, "flex flex-1 overflow-hidden text-zinc-500 group-data-focus/option:text-white before:w-2 before:min-w-0 before:shrink dark:text-zinc-400"),
|
|
1353
1375
|
children: /* @__PURE__ */ jsx("span", {
|
|
1354
1376
|
className: "flex-1 truncate",
|
|
1355
1377
|
children
|
|
@@ -1361,19 +1383,19 @@ function ComboboxDescription({ className, children, ...props }) {
|
|
|
1361
1383
|
function DescriptionList({ className, ...props }) {
|
|
1362
1384
|
return /* @__PURE__ */ jsx("dl", {
|
|
1363
1385
|
...props,
|
|
1364
|
-
className:
|
|
1386
|
+
className: cn(className, "grid grid-cols-1 text-base/6 sm:grid-cols-[min(50%,--spacing(80))_auto] sm:text-sm/6")
|
|
1365
1387
|
});
|
|
1366
1388
|
}
|
|
1367
1389
|
function DescriptionTerm({ className, ...props }) {
|
|
1368
1390
|
return /* @__PURE__ */ jsx("dt", {
|
|
1369
1391
|
...props,
|
|
1370
|
-
className:
|
|
1392
|
+
className: cn(className, "col-start-1 border-t border-zinc-950/5 pt-3 text-zinc-500 first:border-none sm:border-t sm:border-zinc-950/5 sm:py-3 dark:border-white/5 dark:text-zinc-400 sm:dark:border-white/5")
|
|
1371
1393
|
});
|
|
1372
1394
|
}
|
|
1373
1395
|
function DescriptionDetails({ className, ...props }) {
|
|
1374
1396
|
return /* @__PURE__ */ jsx("dd", {
|
|
1375
1397
|
...props,
|
|
1376
|
-
className:
|
|
1398
|
+
className: cn(className, "pt-1 pb-3 text-zinc-950 sm:border-t sm:border-zinc-950/5 sm:py-3 sm:nth-2:border-none dark:text-white dark:sm:border-white/5")
|
|
1377
1399
|
});
|
|
1378
1400
|
}
|
|
1379
1401
|
//#endregion
|
|
@@ -1411,7 +1433,11 @@ function Dialog({ size = "lg", className, children, open, onClose }) {
|
|
|
1411
1433
|
ref: backdrop.nodeRef,
|
|
1412
1434
|
...backdrop.transitionProps,
|
|
1413
1435
|
onClick: onClose,
|
|
1414
|
-
className: "fixed inset-0 flex w-screen justify-center overflow-y-auto
|
|
1436
|
+
className: "fixed inset-0 flex w-screen justify-center overflow-y-auto px-2 py-2 transition duration-100 focus:outline-0 data-closed:opacity-0 data-enter:ease-out data-leave:ease-in sm:px-6 sm:py-8 lg:px-8 lg:py-16",
|
|
1437
|
+
style: {
|
|
1438
|
+
backgroundColor: "oklch(0.13 0.004 228 / 0.6)",
|
|
1439
|
+
backdropFilter: "blur(4px)"
|
|
1440
|
+
}
|
|
1415
1441
|
}), panel.mounted && /* @__PURE__ */ jsx("div", {
|
|
1416
1442
|
className: "fixed inset-0 w-screen overflow-y-auto pt-6 sm:pt-0",
|
|
1417
1443
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -1422,7 +1448,14 @@ function Dialog({ size = "lg", className, children, open, onClose }) {
|
|
|
1422
1448
|
panel.nodeRef.current = node;
|
|
1423
1449
|
},
|
|
1424
1450
|
...panel.transitionProps,
|
|
1425
|
-
className:
|
|
1451
|
+
className: cn(className, sizes[size], "row-start-2 w-full min-w-0 rounded-t-3xl p-(--gutter) shadow-lg ring-1 [--gutter:--spacing(8)] sm:mb-auto sm:rounded-2xl forced-colors:outline", "transition will-change-transform data-closed:translate-y-12 data-closed:opacity-0 data-enter:ease-out data-leave:ease-in sm:data-closed:translate-y-0 sm:data-closed:data-enter:scale-95"),
|
|
1452
|
+
style: {
|
|
1453
|
+
backgroundColor: "var(--rvui-surface-1, oklch(0.18 0.006 225))",
|
|
1454
|
+
boxShadow: "var(--rvui-shadow-lg, 0 12px 40px oklch(0 0 0 / 0.35))",
|
|
1455
|
+
"--tw-ring-color": "var(--rvui-border-subtle, oklch(0.28 0.006 222 / 0.4))",
|
|
1456
|
+
transitionDuration: "var(--rvui-duration-normal, 200ms)",
|
|
1457
|
+
transitionTimingFunction: "var(--rvui-ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1))"
|
|
1458
|
+
},
|
|
1426
1459
|
children
|
|
1427
1460
|
})
|
|
1428
1461
|
})
|
|
@@ -1434,25 +1467,26 @@ function DialogTitle({ className, ...props }) {
|
|
|
1434
1467
|
return /* @__PURE__ */ jsx("h2", {
|
|
1435
1468
|
id: use(DialogContext),
|
|
1436
1469
|
...props,
|
|
1437
|
-
className:
|
|
1470
|
+
className: cn(className, "text-lg/6 font-semibold text-balance sm:text-base/6"),
|
|
1471
|
+
style: { color: "var(--rvui-text-0, oklch(0.95 0.002 210))" }
|
|
1438
1472
|
});
|
|
1439
1473
|
}
|
|
1440
1474
|
function DialogDescription({ className, ...props }) {
|
|
1441
1475
|
return /* @__PURE__ */ jsx(Text, {
|
|
1442
1476
|
...props,
|
|
1443
|
-
className:
|
|
1477
|
+
className: cn(className, "mt-2 text-pretty")
|
|
1444
1478
|
});
|
|
1445
1479
|
}
|
|
1446
1480
|
function DialogBody({ className, ...props }) {
|
|
1447
1481
|
return /* @__PURE__ */ jsx("div", {
|
|
1448
1482
|
...props,
|
|
1449
|
-
className:
|
|
1483
|
+
className: cn(className, "mt-6")
|
|
1450
1484
|
});
|
|
1451
1485
|
}
|
|
1452
1486
|
function DialogActions({ className, ...props }) {
|
|
1453
1487
|
return /* @__PURE__ */ jsx("div", {
|
|
1454
1488
|
...props,
|
|
1455
|
-
className:
|
|
1489
|
+
className: cn(className, "mt-8 flex flex-col-reverse items-center justify-end gap-3 *:w-full sm:flex-row sm:*:w-auto")
|
|
1456
1490
|
});
|
|
1457
1491
|
}
|
|
1458
1492
|
//#endregion
|
|
@@ -1460,7 +1494,7 @@ function DialogActions({ className, ...props }) {
|
|
|
1460
1494
|
function Divider({ soft = false, className, ...props }) {
|
|
1461
1495
|
return /* @__PURE__ */ jsx("hr", {
|
|
1462
1496
|
...props,
|
|
1463
|
-
className:
|
|
1497
|
+
className: cn(className, "w-full border-t", soft && "border-zinc-950/5 dark:border-white/5", !soft && "border-zinc-950/10 dark:border-white/10")
|
|
1464
1498
|
});
|
|
1465
1499
|
}
|
|
1466
1500
|
//#endregion
|
|
@@ -1503,7 +1537,7 @@ function Drawer({ open, onClose, side = "right", className, children }) {
|
|
|
1503
1537
|
panel.nodeRef.current = node;
|
|
1504
1538
|
},
|
|
1505
1539
|
...panel.transitionProps,
|
|
1506
|
-
className:
|
|
1540
|
+
className: cn("fixed z-50 overflow-y-auto bg-white shadow-xl ring-1 ring-zinc-950/10 transition duration-300 ease-in-out dark:bg-zinc-900 dark:ring-white/10", sideClasses$1[side], className),
|
|
1507
1541
|
children
|
|
1508
1542
|
})]
|
|
1509
1543
|
})
|
|
@@ -1512,7 +1546,7 @@ function Drawer({ open, onClose, side = "right", className, children }) {
|
|
|
1512
1546
|
function DrawerHeader({ onClose, className, children }) {
|
|
1513
1547
|
const titleId = use(DrawerContext);
|
|
1514
1548
|
return /* @__PURE__ */ jsxs("div", {
|
|
1515
|
-
className:
|
|
1549
|
+
className: cn("flex items-center justify-between border-b border-zinc-200 px-6 py-4 dark:border-zinc-700", className),
|
|
1516
1550
|
children: [/* @__PURE__ */ jsx("h2", {
|
|
1517
1551
|
id: titleId,
|
|
1518
1552
|
className: "text-base font-semibold text-zinc-950 dark:text-white",
|
|
@@ -1540,13 +1574,13 @@ function DrawerHeader({ onClose, className, children }) {
|
|
|
1540
1574
|
function DrawerBody({ className, ...props }) {
|
|
1541
1575
|
return /* @__PURE__ */ jsx("div", {
|
|
1542
1576
|
...props,
|
|
1543
|
-
className:
|
|
1577
|
+
className: cn("px-6 py-4", className)
|
|
1544
1578
|
});
|
|
1545
1579
|
}
|
|
1546
1580
|
function DrawerFooter({ className, ...props }) {
|
|
1547
1581
|
return /* @__PURE__ */ jsx("div", {
|
|
1548
1582
|
...props,
|
|
1549
|
-
className:
|
|
1583
|
+
className: cn("flex items-center justify-end gap-3 border-t border-zinc-200 px-6 py-4 dark:border-zinc-700", className)
|
|
1550
1584
|
});
|
|
1551
1585
|
}
|
|
1552
1586
|
//#endregion
|
|
@@ -1781,7 +1815,7 @@ function DropdownMenu({ anchor = "bottom", className, children, ...props }) {
|
|
|
1781
1815
|
"aria-orientation": "vertical",
|
|
1782
1816
|
style: popover.popoverProps.style,
|
|
1783
1817
|
onKeyDown: handleKeyDown,
|
|
1784
|
-
className:
|
|
1818
|
+
className: cn(className, "[--anchor-gap:--spacing(2)] [--anchor-padding:--spacing(1)] data-[anchor~=end]:[--anchor-offset:6px] data-[anchor~=start]:[--anchor-offset:-6px] sm:data-[anchor~=end]:[--anchor-offset:4px] sm:data-[anchor~=start]:[--anchor-offset:-4px]", "isolate w-max rounded-xl p-1", "outline outline-transparent focus:outline-hidden", "overflow-y-auto", "bg-white/75 backdrop-blur-xl dark:bg-zinc-800/75", "shadow-lg ring-1 ring-zinc-950/10 dark:ring-white/10 dark:ring-inset", "supports-[grid-template-columns:subgrid]:grid supports-[grid-template-columns:subgrid]:grid-cols-[auto_1fr_1.5rem_0.5rem_auto]", "transition data-leave:duration-100 data-leave:ease-in data-closed:data-leave:opacity-0"),
|
|
1785
1819
|
children
|
|
1786
1820
|
})
|
|
1787
1821
|
}), document.body);
|
|
@@ -1822,7 +1856,7 @@ function DropdownItem({ className, ...props }) {
|
|
|
1822
1856
|
propsOnClick,
|
|
1823
1857
|
rovingProps
|
|
1824
1858
|
]);
|
|
1825
|
-
const classes =
|
|
1859
|
+
const classes = cn(className, "group cursor-default rounded-lg px-3.5 py-2.5 focus:outline-hidden sm:px-3 sm:py-1.5", "text-left text-base/6 text-zinc-950 sm:text-sm/6 dark:text-white forced-colors:text-[CanvasText]", "data-focus:bg-blue-500 data-focus:text-white", "data-disabled:opacity-50", "forced-color-adjust-none forced-colors:data-focus:bg-[Highlight] forced-colors:data-focus:text-[HighlightText] forced-colors:data-focus:*:data-[slot=icon]:text-[HighlightText]", "col-span-full grid grid-cols-[auto_1fr_1.5rem_0.5rem_auto] items-center supports-[grid-template-columns:subgrid]:grid-cols-subgrid", "*:data-[slot=icon]:col-start-1 *:data-[slot=icon]:row-start-1 *:data-[slot=icon]:mr-2.5 *:data-[slot=icon]:-ml-0.5 *:data-[slot=icon]:size-5 sm:*:data-[slot=icon]:mr-2 sm:*:data-[slot=icon]:size-4", "*:data-[slot=icon]:text-zinc-500 data-focus:*:data-[slot=icon]:text-white dark:*:data-[slot=icon]:text-zinc-400 dark:data-focus:*:data-[slot=icon]:text-white", "*:data-[slot=avatar]:mr-2.5 *:data-[slot=avatar]:-ml-1 *:data-[slot=avatar]:size-6 sm:*:data-[slot=avatar]:mr-2 sm:*:data-[slot=avatar]:size-5");
|
|
1826
1860
|
if (typeof props.href === "string") {
|
|
1827
1861
|
const { href, children, ...linkProps } = props;
|
|
1828
1862
|
return /* @__PURE__ */ jsx(Link, {
|
|
@@ -1858,50 +1892,50 @@ function DropdownItem({ className, ...props }) {
|
|
|
1858
1892
|
function DropdownHeader({ className, ...props }) {
|
|
1859
1893
|
return /* @__PURE__ */ jsx("div", {
|
|
1860
1894
|
...props,
|
|
1861
|
-
className:
|
|
1895
|
+
className: cn(className, "col-span-5 px-3.5 pt-2.5 pb-1 sm:px-3")
|
|
1862
1896
|
});
|
|
1863
1897
|
}
|
|
1864
1898
|
function DropdownSection({ className, ...props }) {
|
|
1865
1899
|
return /* @__PURE__ */ jsx("div", {
|
|
1866
1900
|
role: "group",
|
|
1867
1901
|
...props,
|
|
1868
|
-
className:
|
|
1902
|
+
className: cn(className, "col-span-full supports-[grid-template-columns:subgrid]:grid supports-[grid-template-columns:subgrid]:grid-cols-[auto_1fr_1.5rem_0.5rem_auto]")
|
|
1869
1903
|
});
|
|
1870
1904
|
}
|
|
1871
1905
|
function DropdownHeading({ className, ...props }) {
|
|
1872
1906
|
return /* @__PURE__ */ jsx("div", {
|
|
1873
1907
|
role: "presentation",
|
|
1874
1908
|
...props,
|
|
1875
|
-
className:
|
|
1909
|
+
className: cn(className, "col-span-full grid grid-cols-[1fr_auto] gap-x-12 px-3.5 pt-2 pb-1 text-sm/5 font-medium text-zinc-500 sm:px-3 sm:text-xs/5 dark:text-zinc-400")
|
|
1876
1910
|
});
|
|
1877
1911
|
}
|
|
1878
1912
|
function DropdownDivider({ className, ...props }) {
|
|
1879
1913
|
return /* @__PURE__ */ jsx("hr", {
|
|
1880
1914
|
...props,
|
|
1881
|
-
className:
|
|
1915
|
+
className: cn(className, "col-span-full mx-3.5 my-1 h-px border-0 bg-zinc-950/5 sm:mx-3 dark:bg-white/10 forced-colors:bg-[CanvasText]")
|
|
1882
1916
|
});
|
|
1883
1917
|
}
|
|
1884
1918
|
function DropdownLabel({ className, ...props }) {
|
|
1885
1919
|
return /* @__PURE__ */ jsx("div", {
|
|
1886
1920
|
...props,
|
|
1887
1921
|
"data-slot": "label",
|
|
1888
|
-
className:
|
|
1922
|
+
className: cn(className, "col-start-2 row-start-1")
|
|
1889
1923
|
});
|
|
1890
1924
|
}
|
|
1891
1925
|
function DropdownDescription({ className, ...props }) {
|
|
1892
1926
|
return /* @__PURE__ */ jsx("span", {
|
|
1893
1927
|
"data-slot": "description",
|
|
1894
1928
|
...props,
|
|
1895
|
-
className:
|
|
1929
|
+
className: cn(className, "col-span-2 col-start-2 row-start-2 text-sm/5 text-zinc-500 group-data-focus:text-white sm:text-xs/5 dark:text-zinc-400 forced-colors:group-data-focus:text-[HighlightText]")
|
|
1896
1930
|
});
|
|
1897
1931
|
}
|
|
1898
1932
|
function DropdownShortcut({ keys, className, ...props }) {
|
|
1899
1933
|
return /* @__PURE__ */ jsx("kbd", {
|
|
1900
1934
|
...props,
|
|
1901
|
-
className:
|
|
1935
|
+
className: cn(className, "col-start-5 row-start-1 flex justify-self-end"),
|
|
1902
1936
|
children: (Array.isArray(keys) ? keys : keys.split("")).map((char, index) => {
|
|
1903
1937
|
return /* @__PURE__ */ jsx("kbd", {
|
|
1904
|
-
className:
|
|
1938
|
+
className: cn(["min-w-[2ch] text-center font-sans text-zinc-400 capitalize group-data-focus:text-white forced-colors:group-data-focus:text-[HighlightText]", index > 0 && char.length > 1 && "pl-1"]),
|
|
1905
1939
|
children: char
|
|
1906
1940
|
}, `${char}-${index}`);
|
|
1907
1941
|
})
|
|
@@ -1913,21 +1947,21 @@ function Fieldset({ className, disabled, ...props }) {
|
|
|
1913
1947
|
return /* @__PURE__ */ jsx("fieldset", {
|
|
1914
1948
|
disabled,
|
|
1915
1949
|
...props,
|
|
1916
|
-
className:
|
|
1950
|
+
className: cn(className, "*:data-[slot=text]:mt-1 [&>*+[data-slot=control]]:mt-6")
|
|
1917
1951
|
});
|
|
1918
1952
|
}
|
|
1919
1953
|
function Legend({ className, ...props }) {
|
|
1920
1954
|
return /* @__PURE__ */ jsx("legend", {
|
|
1921
1955
|
"data-slot": "legend",
|
|
1922
1956
|
...props,
|
|
1923
|
-
className:
|
|
1957
|
+
className: cn(className, "text-base/6 font-semibold text-zinc-950 data-disabled:opacity-50 sm:text-sm/6 dark:text-white")
|
|
1924
1958
|
});
|
|
1925
1959
|
}
|
|
1926
1960
|
function FieldGroup({ className, ...props }) {
|
|
1927
1961
|
return /* @__PURE__ */ jsx("div", {
|
|
1928
1962
|
"data-slot": "control",
|
|
1929
1963
|
...props,
|
|
1930
|
-
className:
|
|
1964
|
+
className: cn(className, "space-y-8")
|
|
1931
1965
|
});
|
|
1932
1966
|
}
|
|
1933
1967
|
function Field({ className, disabled, ...props }) {
|
|
@@ -1936,7 +1970,7 @@ function Field({ className, disabled, ...props }) {
|
|
|
1936
1970
|
children: /* @__PURE__ */ jsx("div", {
|
|
1937
1971
|
...props,
|
|
1938
1972
|
"data-disabled": disabled ? "" : void 0,
|
|
1939
|
-
className:
|
|
1973
|
+
className: cn(className, "[&>[data-slot=label]+[data-slot=control]]:mt-3", "[&>[data-slot=label]+[data-slot=description]]:mt-1", "[&>[data-slot=description]+[data-slot=control]]:mt-3", "[&>[data-slot=control]+[data-slot=description]]:mt-3", "[&>[data-slot=control]+[data-slot=error]]:mt-3", "*:data-[slot=label]:font-medium")
|
|
1940
1974
|
})
|
|
1941
1975
|
});
|
|
1942
1976
|
}
|
|
@@ -1946,7 +1980,7 @@ function Label({ className, ...props }) {
|
|
|
1946
1980
|
"data-slot": "label",
|
|
1947
1981
|
...fieldLabelProps,
|
|
1948
1982
|
...props,
|
|
1949
|
-
className:
|
|
1983
|
+
className: cn(className, "text-base/6 text-zinc-950 select-none data-disabled:opacity-50 sm:text-sm/6 dark:text-white")
|
|
1950
1984
|
});
|
|
1951
1985
|
}
|
|
1952
1986
|
function Description({ className, ...props }) {
|
|
@@ -1955,7 +1989,7 @@ function Description({ className, ...props }) {
|
|
|
1955
1989
|
"data-slot": "description",
|
|
1956
1990
|
...fieldDescriptionProps,
|
|
1957
1991
|
...props,
|
|
1958
|
-
className:
|
|
1992
|
+
className: cn(className, "text-base/6 text-zinc-500 data-disabled:opacity-50 sm:text-sm/6 dark:text-zinc-400")
|
|
1959
1993
|
});
|
|
1960
1994
|
}
|
|
1961
1995
|
function ErrorMessage({ className, ...props }) {
|
|
@@ -1964,7 +1998,7 @@ function ErrorMessage({ className, ...props }) {
|
|
|
1964
1998
|
"data-slot": "error",
|
|
1965
1999
|
...fieldErrorProps,
|
|
1966
2000
|
...props,
|
|
1967
|
-
className:
|
|
2001
|
+
className: cn(className, "text-base/6 text-red-600 data-disabled:opacity-50 sm:text-sm/6 dark:text-red-500")
|
|
1968
2002
|
});
|
|
1969
2003
|
}
|
|
1970
2004
|
//#endregion
|
|
@@ -1972,7 +2006,7 @@ function ErrorMessage({ className, ...props }) {
|
|
|
1972
2006
|
function InputGroup({ children }) {
|
|
1973
2007
|
return /* @__PURE__ */ jsx("span", {
|
|
1974
2008
|
"data-slot": "control",
|
|
1975
|
-
className:
|
|
2009
|
+
className: cn("relative isolate block", "has-[[data-slot=icon]:first-child]:[&_input]:pl-10 has-[[data-slot=icon]:last-child]:[&_input]:pr-10 sm:has-[[data-slot=icon]:first-child]:[&_input]:pl-8 sm:has-[[data-slot=icon]:last-child]:[&_input]:pr-8", "*:data-[slot=icon]:pointer-events-none *:data-[slot=icon]:absolute *:data-[slot=icon]:top-3 *:data-[slot=icon]:z-10 *:data-[slot=icon]:size-5 sm:*:data-[slot=icon]:top-2.5 sm:*:data-[slot=icon]:size-4", "[&>[data-slot=icon]:first-child]:left-3 sm:[&>[data-slot=icon]:first-child]:left-2.5 [&>[data-slot=icon]:last-child]:right-3 sm:[&>[data-slot=icon]:last-child]:right-2.5", "*:data-[slot=icon]:text-zinc-500 dark:*:data-[slot=icon]:text-zinc-400"),
|
|
1976
2010
|
children
|
|
1977
2011
|
});
|
|
1978
2012
|
}
|
|
@@ -1988,7 +2022,7 @@ function Input({ className, disabled, invalid, ref, ...props }) {
|
|
|
1988
2022
|
const fieldProps = useFieldControlProps();
|
|
1989
2023
|
return /* @__PURE__ */ jsx("span", {
|
|
1990
2024
|
"data-slot": "control",
|
|
1991
|
-
className:
|
|
2025
|
+
className: cn([
|
|
1992
2026
|
className,
|
|
1993
2027
|
"relative block w-full",
|
|
1994
2028
|
"before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm",
|
|
@@ -2004,7 +2038,7 @@ function Input({ className, disabled, invalid, ref, ...props }) {
|
|
|
2004
2038
|
...fieldProps,
|
|
2005
2039
|
"data-invalid": invalid ? "" : void 0,
|
|
2006
2040
|
"data-disabled": disabled ? "" : void 0,
|
|
2007
|
-
className:
|
|
2041
|
+
className: cn([
|
|
2008
2042
|
props.type && dateTypes.includes(props.type) && [
|
|
2009
2043
|
"[&::-webkit-datetime-edit-fields-wrapper]:p-0",
|
|
2010
2044
|
"[&::-webkit-date-and-time-value]:min-h-[1.5em]",
|
|
@@ -2036,13 +2070,13 @@ function Input({ className, disabled, invalid, ref, ...props }) {
|
|
|
2036
2070
|
function Kbd({ className, children, ...props }) {
|
|
2037
2071
|
return /* @__PURE__ */ jsx("kbd", {
|
|
2038
2072
|
...props,
|
|
2039
|
-
className:
|
|
2073
|
+
className: cn("inline-flex items-center rounded border border-zinc-300 bg-zinc-100 px-1.5 py-0.5 font-mono text-xs font-medium text-zinc-700 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-300", className),
|
|
2040
2074
|
children
|
|
2041
2075
|
});
|
|
2042
2076
|
}
|
|
2043
2077
|
function KbdShortcut({ keys, separator = "+", className }) {
|
|
2044
2078
|
return /* @__PURE__ */ jsx("span", {
|
|
2045
|
-
className:
|
|
2079
|
+
className: cn("inline-flex items-center gap-1", className),
|
|
2046
2080
|
children: keys.map((key, i) => /* @__PURE__ */ jsxs("span", {
|
|
2047
2081
|
className: "inline-flex items-center gap-1",
|
|
2048
2082
|
children: [/* @__PURE__ */ jsx(Kbd, { children: key }), i < keys.length - 1 && /* @__PURE__ */ jsx("span", {
|
|
@@ -2227,7 +2261,7 @@ function Listbox({ className, placeholder, autoFocus = false, "aria-label": aria
|
|
|
2227
2261
|
setOpen(true);
|
|
2228
2262
|
}
|
|
2229
2263
|
}, [disabled]);
|
|
2230
|
-
const selectedSharedClasses =
|
|
2264
|
+
const selectedSharedClasses = cn("flex min-w-0 items-center", "*:data-[slot=icon]:size-5 *:data-[slot=icon]:shrink-0 sm:*:data-[slot=icon]:size-4", "*:data-[slot=icon]:text-zinc-500 group-data-focus/option:*:data-[slot=icon]:text-white dark:*:data-[slot=icon]:text-zinc-400", "forced-colors:*:data-[slot=icon]:text-[CanvasText] forced-colors:group-data-focus/option:*:data-[slot=icon]:text-[Canvas]", "*:data-[slot=avatar]:-mx-0.5 *:data-[slot=avatar]:size-6 sm:*:data-[slot=avatar]:size-5");
|
|
2231
2265
|
const displayContent = selectedContent != null ? /* @__PURE__ */ jsx("span", {
|
|
2232
2266
|
className: selectedSharedClasses,
|
|
2233
2267
|
children: selectedContent
|
|
@@ -2259,7 +2293,7 @@ function Listbox({ className, placeholder, autoFocus = false, "aria-label": aria
|
|
|
2259
2293
|
disabled,
|
|
2260
2294
|
onClick: handleButtonClick,
|
|
2261
2295
|
onKeyDown: handleButtonKeyDown,
|
|
2262
|
-
className:
|
|
2296
|
+
className: cn([
|
|
2263
2297
|
className,
|
|
2264
2298
|
"group relative block w-full",
|
|
2265
2299
|
"before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm",
|
|
@@ -2269,7 +2303,7 @@ function Listbox({ className, placeholder, autoFocus = false, "aria-label": aria
|
|
|
2269
2303
|
"data-disabled:opacity-50 data-disabled:before:bg-zinc-950/5 data-disabled:before:shadow-none"
|
|
2270
2304
|
]),
|
|
2271
2305
|
children: [/* @__PURE__ */ jsx("span", {
|
|
2272
|
-
className:
|
|
2306
|
+
className: cn([
|
|
2273
2307
|
"relative block w-full appearance-none rounded-lg py-[calc(--spacing(2.5)-1px)] sm:py-[calc(--spacing(1.5)-1px)]",
|
|
2274
2308
|
"min-h-11 sm:min-h-9",
|
|
2275
2309
|
"pr-[calc(--spacing(7)-1px)] pl-[calc(--spacing(3.5)-1px)] sm:pl-[calc(--spacing(3)-1px)]",
|
|
@@ -2313,7 +2347,7 @@ function Listbox({ className, placeholder, autoFocus = false, "aria-label": aria
|
|
|
2313
2347
|
"aria-labelledby": buttonId,
|
|
2314
2348
|
tabIndex: -1,
|
|
2315
2349
|
onKeyDown: handleOptionsKeyDown,
|
|
2316
|
-
className:
|
|
2350
|
+
className: cn("[--anchor-offset:-1.625rem] [--anchor-padding:--spacing(4)] sm:[--anchor-offset:-1.375rem]", "isolate w-max min-w-[calc(var(--button-width)+1.75rem)] scroll-py-1 rounded-xl p-1 select-none", "outline outline-transparent focus:outline-hidden", "overflow-y-scroll overscroll-contain", "bg-white/75 backdrop-blur-xl dark:bg-zinc-800/75", "shadow-lg ring-1 ring-zinc-950/10 dark:ring-white/10 dark:ring-inset", "transition-opacity duration-100 ease-in data-closed:data-leave:opacity-0 data-transition:pointer-events-none"),
|
|
2317
2351
|
style: {
|
|
2318
2352
|
...popoverProps.style,
|
|
2319
2353
|
minWidth: triggerRef.current ? `${triggerRef.current.getBoundingClientRect().width + 28}px` : void 0
|
|
@@ -2337,7 +2371,7 @@ function ListboxOption({ children, className, value: optionValue, disabled: opti
|
|
|
2337
2371
|
ctx.registerOption,
|
|
2338
2372
|
ctx
|
|
2339
2373
|
]);
|
|
2340
|
-
const sharedClasses =
|
|
2374
|
+
const sharedClasses = cn("flex min-w-0 items-center", "*:data-[slot=icon]:size-5 *:data-[slot=icon]:shrink-0 sm:*:data-[slot=icon]:size-4", "*:data-[slot=icon]:text-zinc-500 group-data-focus/option:*:data-[slot=icon]:text-white dark:*:data-[slot=icon]:text-zinc-400", "forced-colors:*:data-[slot=icon]:text-[CanvasText] forced-colors:group-data-focus/option:*:data-[slot=icon]:text-[Canvas]", "*:data-[slot=avatar]:-mx-0.5 *:data-[slot=avatar]:size-6 sm:*:data-[slot=avatar]:size-5");
|
|
2341
2375
|
const handleClick = useCallback(() => {
|
|
2342
2376
|
if (optionDisabled) return;
|
|
2343
2377
|
ctx.setValue(optionValue);
|
|
@@ -2368,7 +2402,7 @@ function ListboxOption({ children, className, value: optionValue, disabled: opti
|
|
|
2368
2402
|
onClick: handleClick,
|
|
2369
2403
|
onPointerEnter: handlePointerEnter,
|
|
2370
2404
|
tabIndex: -1,
|
|
2371
|
-
className:
|
|
2405
|
+
className: cn("group/option grid cursor-default grid-cols-[--spacing(5)_1fr] items-baseline gap-x-2 rounded-lg py-2.5 pr-3.5 pl-2 sm:grid-cols-[--spacing(4)_1fr] sm:py-1.5 sm:pr-3 sm:pl-1.5", "text-base/6 text-zinc-950 sm:text-sm/6 dark:text-white forced-colors:text-[CanvasText]", "outline-hidden data-focus:bg-blue-500 data-focus:text-white", "forced-color-adjust-none forced-colors:data-focus:bg-[Highlight] forced-colors:data-focus:text-[HighlightText]", "data-disabled:opacity-50"),
|
|
2372
2406
|
children: [/* @__PURE__ */ jsx("svg", {
|
|
2373
2407
|
className: "relative hidden size-5 self-center stroke-current group-data-selected/option:inline sm:size-4",
|
|
2374
2408
|
viewBox: "0 0 16 16",
|
|
@@ -2381,7 +2415,7 @@ function ListboxOption({ children, className, value: optionValue, disabled: opti
|
|
|
2381
2415
|
strokeLinejoin: "round"
|
|
2382
2416
|
})
|
|
2383
2417
|
}), /* @__PURE__ */ jsx("span", {
|
|
2384
|
-
className:
|
|
2418
|
+
className: cn(className, sharedClasses, "col-start-2"),
|
|
2385
2419
|
children
|
|
2386
2420
|
})]
|
|
2387
2421
|
});
|
|
@@ -2389,13 +2423,13 @@ function ListboxOption({ children, className, value: optionValue, disabled: opti
|
|
|
2389
2423
|
function ListboxLabel({ className, ...props }) {
|
|
2390
2424
|
return /* @__PURE__ */ jsx("span", {
|
|
2391
2425
|
...props,
|
|
2392
|
-
className:
|
|
2426
|
+
className: cn(className, "ml-2.5 truncate first:ml-0 sm:ml-2 sm:first:ml-0")
|
|
2393
2427
|
});
|
|
2394
2428
|
}
|
|
2395
2429
|
function ListboxDescription({ className, children, ...props }) {
|
|
2396
2430
|
return /* @__PURE__ */ jsx("span", {
|
|
2397
2431
|
...props,
|
|
2398
|
-
className:
|
|
2432
|
+
className: cn(className, "flex flex-1 overflow-hidden text-zinc-500 group-data-focus/option:text-white before:w-2 before:min-w-0 before:shrink dark:text-zinc-400"),
|
|
2399
2433
|
children: /* @__PURE__ */ jsx("span", {
|
|
2400
2434
|
className: "flex-1 truncate",
|
|
2401
2435
|
children
|
|
@@ -2495,14 +2529,14 @@ function LayoutIndicator({ layoutId, ...props }) {
|
|
|
2495
2529
|
function Navbar({ className, ...props }) {
|
|
2496
2530
|
return /* @__PURE__ */ jsx("nav", {
|
|
2497
2531
|
...props,
|
|
2498
|
-
className:
|
|
2532
|
+
className: cn(className, "flex flex-1 items-center gap-4 py-2.5")
|
|
2499
2533
|
});
|
|
2500
2534
|
}
|
|
2501
2535
|
function NavbarDivider({ className, ...props }) {
|
|
2502
2536
|
return /* @__PURE__ */ jsx("div", {
|
|
2503
2537
|
"aria-hidden": "true",
|
|
2504
2538
|
...props,
|
|
2505
|
-
className:
|
|
2539
|
+
className: cn(className, "h-6 w-px bg-zinc-950/10 dark:bg-white/10")
|
|
2506
2540
|
});
|
|
2507
2541
|
}
|
|
2508
2542
|
function NavbarSection({ className, ...props }) {
|
|
@@ -2510,7 +2544,7 @@ function NavbarSection({ className, ...props }) {
|
|
|
2510
2544
|
id: useId(),
|
|
2511
2545
|
children: /* @__PURE__ */ jsx("div", {
|
|
2512
2546
|
...props,
|
|
2513
|
-
className:
|
|
2547
|
+
className: cn(className, "flex items-center gap-3")
|
|
2514
2548
|
})
|
|
2515
2549
|
});
|
|
2516
2550
|
}
|
|
@@ -2518,14 +2552,14 @@ function NavbarSpacer({ className, ...props }) {
|
|
|
2518
2552
|
return /* @__PURE__ */ jsx("div", {
|
|
2519
2553
|
"aria-hidden": "true",
|
|
2520
2554
|
...props,
|
|
2521
|
-
className:
|
|
2555
|
+
className: cn(className, "-ml-4 flex-1")
|
|
2522
2556
|
});
|
|
2523
2557
|
}
|
|
2524
2558
|
function NavbarItem({ current, className, children, ref, ...props }) {
|
|
2525
2559
|
const interactiveProps = useDataInteractive({ disabled: ("disabled" in props ? props.disabled : false) ?? false });
|
|
2526
|
-
const classes =
|
|
2560
|
+
const classes = cn("relative flex min-w-0 items-center gap-3 rounded-lg p-2 text-left text-base/6 font-medium text-zinc-950 sm:text-sm/5", "*:data-[slot=icon]:size-6 *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:fill-zinc-500 sm:*:data-[slot=icon]:size-5", "*:not-nth-2:last:data-[slot=icon]:ml-auto *:not-nth-2:last:data-[slot=icon]:size-5 sm:*:not-nth-2:last:data-[slot=icon]:size-4", "*:data-[slot=avatar]:-m-0.5 *:data-[slot=avatar]:size-7 *:data-[slot=avatar]:[--avatar-radius:var(--radius-md)] sm:*:data-[slot=avatar]:size-6", "data-hover:bg-zinc-950/5 data-hover:*:data-[slot=icon]:fill-zinc-950", "data-active:bg-zinc-950/5 data-active:*:data-[slot=icon]:fill-zinc-950", "dark:text-white dark:*:data-[slot=icon]:fill-zinc-400", "dark:data-hover:bg-white/5 dark:data-hover:*:data-[slot=icon]:fill-white", "dark:data-active:bg-white/5 dark:data-active:*:data-[slot=icon]:fill-white");
|
|
2527
2561
|
return /* @__PURE__ */ jsxs("span", {
|
|
2528
|
-
className:
|
|
2562
|
+
className: cn(className, "relative"),
|
|
2529
2563
|
children: [current && /* @__PURE__ */ jsx(LayoutIndicator, {
|
|
2530
2564
|
layoutId: "current-indicator",
|
|
2531
2565
|
className: "absolute inset-x-2 -bottom-2.5 h-0.5 rounded-full bg-zinc-950 dark:bg-white"
|
|
@@ -2539,7 +2573,7 @@ function NavbarItem({ current, className, children, ref, ...props }) {
|
|
|
2539
2573
|
type: "button",
|
|
2540
2574
|
...props,
|
|
2541
2575
|
...interactiveProps,
|
|
2542
|
-
className:
|
|
2576
|
+
className: cn("cursor-default", classes),
|
|
2543
2577
|
"data-current": current ? "true" : void 0,
|
|
2544
2578
|
ref,
|
|
2545
2579
|
children: /* @__PURE__ */ jsx(TouchTarget, { children })
|
|
@@ -2549,7 +2583,7 @@ function NavbarItem({ current, className, children, ref, ...props }) {
|
|
|
2549
2583
|
function NavbarLabel({ className, ...props }) {
|
|
2550
2584
|
return /* @__PURE__ */ jsx("span", {
|
|
2551
2585
|
...props,
|
|
2552
|
-
className:
|
|
2586
|
+
className: cn(className, "truncate")
|
|
2553
2587
|
});
|
|
2554
2588
|
}
|
|
2555
2589
|
//#endregion
|
|
@@ -2571,7 +2605,7 @@ function Progress({ value, max = 100, color = "blue", size = "md", label, showVa
|
|
|
2571
2605
|
lg: "h-4"
|
|
2572
2606
|
}[size];
|
|
2573
2607
|
return /* @__PURE__ */ jsxs("div", {
|
|
2574
|
-
className:
|
|
2608
|
+
className: cn("w-full", className),
|
|
2575
2609
|
children: [(label || showValue) && /* @__PURE__ */ jsxs("div", {
|
|
2576
2610
|
className: "mb-1.5 flex items-center justify-between",
|
|
2577
2611
|
children: [label && /* @__PURE__ */ jsx("span", {
|
|
@@ -2587,9 +2621,9 @@ function Progress({ value, max = 100, color = "blue", size = "md", label, showVa
|
|
|
2587
2621
|
"aria-valuemin": 0,
|
|
2588
2622
|
"aria-valuemax": max,
|
|
2589
2623
|
"aria-label": label ?? "Progress",
|
|
2590
|
-
className:
|
|
2624
|
+
className: cn("w-full overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-700", heightClass),
|
|
2591
2625
|
children: /* @__PURE__ */ jsx("div", {
|
|
2592
|
-
className:
|
|
2626
|
+
className: cn("h-full rounded-full transition-all duration-300 ease-in-out", trackClasses[color]),
|
|
2593
2627
|
style: { width: `${percentage}%` }
|
|
2594
2628
|
})
|
|
2595
2629
|
})]
|
|
@@ -2653,7 +2687,7 @@ function RadioGroup({ className, value: controlledValue, defaultValue, onChange,
|
|
|
2653
2687
|
"data-slot": "control",
|
|
2654
2688
|
onKeyDown: handleKeyDown,
|
|
2655
2689
|
...props,
|
|
2656
|
-
className:
|
|
2690
|
+
className: cn(className, "space-y-3 **:data-[slot=label]:font-normal", "has-data-[slot=description]:space-y-6 has-data-[slot=description]:**:data-[slot=label]:font-medium"),
|
|
2657
2691
|
children
|
|
2658
2692
|
})
|
|
2659
2693
|
});
|
|
@@ -2665,7 +2699,7 @@ function RadioField({ className, disabled, ...props }) {
|
|
|
2665
2699
|
"data-slot": "field",
|
|
2666
2700
|
"data-disabled": disabled ? "" : void 0,
|
|
2667
2701
|
...props,
|
|
2668
|
-
className:
|
|
2702
|
+
className: cn(className, "grid grid-cols-[1.125rem_1fr] gap-x-4 gap-y-1 sm:grid-cols-[1rem_1fr]", "*:data-[slot=control]:col-start-1 *:data-[slot=control]:row-start-1 *:data-[slot=control]:mt-0.75 sm:*:data-[slot=control]:mt-1", "*:data-[slot=label]:col-start-2 *:data-[slot=label]:row-start-1", "*:data-[slot=description]:col-start-2 *:data-[slot=description]:row-start-2", "has-data-[slot=description]:**:data-[slot=label]:font-medium")
|
|
2669
2703
|
})
|
|
2670
2704
|
});
|
|
2671
2705
|
}
|
|
@@ -2744,14 +2778,14 @@ function Radio({ color = "dark/zinc", className, value, disabled: localDisabled,
|
|
|
2744
2778
|
onKeyDown: handleKeyDown,
|
|
2745
2779
|
...interactiveProps,
|
|
2746
2780
|
...props,
|
|
2747
|
-
className:
|
|
2781
|
+
className: cn(className, "group inline-flex focus:outline-hidden"),
|
|
2748
2782
|
children: [group.name && checked && /* @__PURE__ */ jsx("input", {
|
|
2749
2783
|
type: "hidden",
|
|
2750
2784
|
name: group.name,
|
|
2751
2785
|
value
|
|
2752
2786
|
}), /* @__PURE__ */ jsx("span", {
|
|
2753
|
-
className:
|
|
2754
|
-
children: /* @__PURE__ */ jsx("span", { className:
|
|
2787
|
+
className: cn([base, radioColors[color]]),
|
|
2788
|
+
children: /* @__PURE__ */ jsx("span", { className: cn("size-full rounded-full border-[4.5px] border-transparent bg-(--radio-indicator) bg-clip-padding", "forced-colors:border-[Canvas] forced-colors:group-data-checked:border-[Highlight]") })
|
|
2755
2789
|
})]
|
|
2756
2790
|
});
|
|
2757
2791
|
}
|
|
@@ -2796,11 +2830,11 @@ function Rating({ value: controlledValue, defaultValue = 0, max = 5, onChange, r
|
|
|
2796
2830
|
onClick: () => handleClick(star),
|
|
2797
2831
|
onMouseEnter: () => !readOnly && setHovered(star),
|
|
2798
2832
|
onMouseLeave: () => !readOnly && setHovered(0),
|
|
2799
|
-
className:
|
|
2833
|
+
className: cn(sizeClass, "transition-colors", readOnly ? "cursor-default" : "cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500"),
|
|
2800
2834
|
children: /* @__PURE__ */ jsx("svg", {
|
|
2801
2835
|
viewBox: "0 0 20 20",
|
|
2802
2836
|
"aria-hidden": "true",
|
|
2803
|
-
className:
|
|
2837
|
+
className: cn("size-full", filled ? "fill-amber-400 text-amber-400" : "fill-zinc-200 text-zinc-200 dark:fill-zinc-700 dark:text-zinc-700"),
|
|
2804
2838
|
children: /* @__PURE__ */ jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" })
|
|
2805
2839
|
})
|
|
2806
2840
|
}, star);
|
|
@@ -2955,7 +2989,7 @@ function Select({ className, multiple, disabled, invalid, ref, ...props }) {
|
|
|
2955
2989
|
const fieldProps = useFieldControlProps();
|
|
2956
2990
|
return /* @__PURE__ */ jsxs("span", {
|
|
2957
2991
|
"data-slot": "control",
|
|
2958
|
-
className:
|
|
2992
|
+
className: cn([
|
|
2959
2993
|
className,
|
|
2960
2994
|
"group relative block w-full",
|
|
2961
2995
|
"before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm",
|
|
@@ -2972,7 +3006,7 @@ function Select({ className, multiple, disabled, invalid, ref, ...props }) {
|
|
|
2972
3006
|
...fieldProps,
|
|
2973
3007
|
"data-invalid": invalid ? "" : void 0,
|
|
2974
3008
|
"data-disabled": disabled ? "" : void 0,
|
|
2975
|
-
className:
|
|
3009
|
+
className: cn([
|
|
2976
3010
|
"relative block w-full appearance-none rounded-lg py-[calc(--spacing(2.5)-1px)] sm:py-[calc(--spacing(1.5)-1px)]",
|
|
2977
3011
|
multiple ? "px-[calc(--spacing(3.5)-1px)] sm:px-[calc(--spacing(3)-1px)]" : "pr-[calc(--spacing(10)-1px)] pl-[calc(--spacing(3.5)-1px)] sm:pr-[calc(--spacing(9)-1px)] sm:pl-[calc(--spacing(3)-1px)]",
|
|
2978
3012
|
"[&_optgroup]:font-semibold",
|
|
@@ -3016,25 +3050,25 @@ function useCloseContext() {
|
|
|
3016
3050
|
function Sidebar({ className, ...props }) {
|
|
3017
3051
|
return /* @__PURE__ */ jsx("nav", {
|
|
3018
3052
|
...props,
|
|
3019
|
-
className:
|
|
3053
|
+
className: cn(className, "flex h-full min-h-0 flex-col")
|
|
3020
3054
|
});
|
|
3021
3055
|
}
|
|
3022
3056
|
function SidebarHeader({ className, ...props }) {
|
|
3023
3057
|
return /* @__PURE__ */ jsx("div", {
|
|
3024
3058
|
...props,
|
|
3025
|
-
className:
|
|
3059
|
+
className: cn(className, "flex flex-col border-b border-zinc-950/5 p-4 dark:border-white/5 [&>[data-slot=section]+[data-slot=section]]:mt-2.5")
|
|
3026
3060
|
});
|
|
3027
3061
|
}
|
|
3028
3062
|
function SidebarBody({ className, ...props }) {
|
|
3029
3063
|
return /* @__PURE__ */ jsx("div", {
|
|
3030
3064
|
...props,
|
|
3031
|
-
className:
|
|
3065
|
+
className: cn(className, "flex flex-1 flex-col overflow-y-auto p-4 [&>[data-slot=section]+[data-slot=section]]:mt-8")
|
|
3032
3066
|
});
|
|
3033
3067
|
}
|
|
3034
3068
|
function SidebarFooter({ className, ...props }) {
|
|
3035
3069
|
return /* @__PURE__ */ jsx("div", {
|
|
3036
3070
|
...props,
|
|
3037
|
-
className:
|
|
3071
|
+
className: cn(className, "flex flex-col border-t border-zinc-950/5 p-4 dark:border-white/5 [&>[data-slot=section]+[data-slot=section]]:mt-2.5")
|
|
3038
3072
|
});
|
|
3039
3073
|
}
|
|
3040
3074
|
function SidebarSection({ className, ...props }) {
|
|
@@ -3043,27 +3077,27 @@ function SidebarSection({ className, ...props }) {
|
|
|
3043
3077
|
children: /* @__PURE__ */ jsx("div", {
|
|
3044
3078
|
...props,
|
|
3045
3079
|
"data-slot": "section",
|
|
3046
|
-
className:
|
|
3080
|
+
className: cn(className, "flex flex-col gap-0.5")
|
|
3047
3081
|
})
|
|
3048
3082
|
});
|
|
3049
3083
|
}
|
|
3050
3084
|
function SidebarDivider({ className, ...props }) {
|
|
3051
3085
|
return /* @__PURE__ */ jsx("hr", {
|
|
3052
3086
|
...props,
|
|
3053
|
-
className:
|
|
3087
|
+
className: cn(className, "my-4 border-t border-zinc-950/5 lg:-mx-4 dark:border-white/5")
|
|
3054
3088
|
});
|
|
3055
3089
|
}
|
|
3056
3090
|
function SidebarSpacer({ className, ...props }) {
|
|
3057
3091
|
return /* @__PURE__ */ jsx("div", {
|
|
3058
3092
|
"aria-hidden": "true",
|
|
3059
3093
|
...props,
|
|
3060
|
-
className:
|
|
3094
|
+
className: cn(className, "mt-8 flex-1")
|
|
3061
3095
|
});
|
|
3062
3096
|
}
|
|
3063
3097
|
function SidebarHeading({ className, ...props }) {
|
|
3064
3098
|
return /* @__PURE__ */ jsx("h3", {
|
|
3065
3099
|
...props,
|
|
3066
|
-
className:
|
|
3100
|
+
className: cn(className, "mb-1 px-2 text-xs/6 font-medium text-zinc-500 dark:text-zinc-400")
|
|
3067
3101
|
});
|
|
3068
3102
|
}
|
|
3069
3103
|
function SidebarItem({ current, className, children, ref, ...props }) {
|
|
@@ -3074,9 +3108,9 @@ function SidebarItem({ current, className, children, ref, ...props }) {
|
|
|
3074
3108
|
propsOnClick?.(e);
|
|
3075
3109
|
closeFn?.();
|
|
3076
3110
|
}, [propsOnClick, closeFn]);
|
|
3077
|
-
const classes =
|
|
3111
|
+
const classes = cn("flex w-full items-center gap-3 rounded-lg px-2 py-2.5 text-left text-base/6 font-medium text-zinc-950 sm:py-2 sm:text-sm/5", "*:data-[slot=icon]:size-6 *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:fill-zinc-500 sm:*:data-[slot=icon]:size-5", "*:last:data-[slot=icon]:ml-auto *:last:data-[slot=icon]:size-5 sm:*:last:data-[slot=icon]:size-4", "*:data-[slot=avatar]:-m-0.5 *:data-[slot=avatar]:size-7 sm:*:data-[slot=avatar]:size-6", "data-hover:bg-zinc-950/5 data-hover:*:data-[slot=icon]:fill-zinc-950", "data-active:bg-zinc-950/5 data-active:*:data-[slot=icon]:fill-zinc-950", "data-current:*:data-[slot=icon]:fill-zinc-950", "dark:text-white dark:*:data-[slot=icon]:fill-zinc-400", "dark:data-hover:bg-white/5 dark:data-hover:*:data-[slot=icon]:fill-white", "dark:data-active:bg-white/5 dark:data-active:*:data-[slot=icon]:fill-white", "dark:data-current:*:data-[slot=icon]:fill-white");
|
|
3078
3112
|
return /* @__PURE__ */ jsxs("span", {
|
|
3079
|
-
className:
|
|
3113
|
+
className: cn(className, "relative"),
|
|
3080
3114
|
children: [current && /* @__PURE__ */ jsx(LayoutIndicator, {
|
|
3081
3115
|
layoutId: "current-indicator",
|
|
3082
3116
|
className: "absolute inset-y-2 -left-4 w-0.5 rounded-full bg-zinc-950 dark:bg-white"
|
|
@@ -3091,7 +3125,7 @@ function SidebarItem({ current, className, children, ref, ...props }) {
|
|
|
3091
3125
|
type: "button",
|
|
3092
3126
|
...props,
|
|
3093
3127
|
...interactiveProps,
|
|
3094
|
-
className:
|
|
3128
|
+
className: cn("cursor-default", classes),
|
|
3095
3129
|
"data-current": current ? "true" : void 0,
|
|
3096
3130
|
ref,
|
|
3097
3131
|
children: /* @__PURE__ */ jsx(TouchTarget, { children })
|
|
@@ -3101,7 +3135,7 @@ function SidebarItem({ current, className, children, ref, ...props }) {
|
|
|
3101
3135
|
function SidebarLabel({ className, ...props }) {
|
|
3102
3136
|
return /* @__PURE__ */ jsx("span", {
|
|
3103
3137
|
...props,
|
|
3104
|
-
className:
|
|
3138
|
+
className: cn(className, "truncate")
|
|
3105
3139
|
});
|
|
3106
3140
|
}
|
|
3107
3141
|
//#endregion
|
|
@@ -3219,7 +3253,7 @@ function Slider({ value: controlledValue, defaultValue = 0, min = 0, max = 100,
|
|
|
3219
3253
|
}, [onChange]);
|
|
3220
3254
|
const percentage = (value - min) / (max - min) * 100;
|
|
3221
3255
|
return /* @__PURE__ */ jsxs("div", {
|
|
3222
|
-
className:
|
|
3256
|
+
className: cn("w-full", className),
|
|
3223
3257
|
children: [(label || showValue) && /* @__PURE__ */ jsxs("div", {
|
|
3224
3258
|
className: "mb-2 flex items-center justify-between",
|
|
3225
3259
|
children: [label && /* @__PURE__ */ jsx("label", {
|
|
@@ -3240,7 +3274,7 @@ function Slider({ value: controlledValue, defaultValue = 0, min = 0, max = 100,
|
|
|
3240
3274
|
disabled,
|
|
3241
3275
|
onChange: handleChange,
|
|
3242
3276
|
style: { "--slider-pct": `${percentage}%` },
|
|
3243
|
-
className:
|
|
3277
|
+
className: cn("h-2 w-full cursor-pointer appearance-none rounded-full outline-none", "bg-zinc-200 dark:bg-zinc-700", "[&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:appearance-none", "[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-blue-600 [&::-webkit-slider-thumb]:shadow-sm", "[&::-webkit-slider-thumb]:ring-2 [&::-webkit-slider-thumb]:ring-white [&::-webkit-slider-thumb]:dark:ring-zinc-900", "[&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:cursor-pointer [&::-moz-range-thumb]:appearance-none", "[&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-none [&::-moz-range-thumb]:bg-blue-600", "focus-visible:[&::-webkit-slider-thumb]:outline-2 focus-visible:[&::-webkit-slider-thumb]:outline-offset-2 focus-visible:[&::-webkit-slider-thumb]:outline-blue-500", disabled && "cursor-not-allowed opacity-50")
|
|
3244
3278
|
})]
|
|
3245
3279
|
});
|
|
3246
3280
|
}
|
|
@@ -3344,43 +3378,56 @@ function StackedLayout({ navbar, sidebar, children }) {
|
|
|
3344
3378
|
}
|
|
3345
3379
|
//#endregion
|
|
3346
3380
|
//#region src/components/stat.tsx
|
|
3381
|
+
var trendStyles = {
|
|
3382
|
+
up: { color: "var(--rvui-success, oklch(0.72 0.17 155))" },
|
|
3383
|
+
down: { color: "var(--rvui-error, oklch(0.65 0.2 25))" },
|
|
3384
|
+
neutral: { color: "var(--rvui-text-2, oklch(0.55 0.012 218))" }
|
|
3385
|
+
};
|
|
3386
|
+
var trendArrow = {
|
|
3387
|
+
up: "↑",
|
|
3388
|
+
down: "↓",
|
|
3389
|
+
neutral: "→"
|
|
3390
|
+
};
|
|
3347
3391
|
function Stat({ label, value, change, trend, description, icon, className }) {
|
|
3348
3392
|
return /* @__PURE__ */ jsxs("div", {
|
|
3349
|
-
className:
|
|
3393
|
+
className: cn("rounded-xl p-6 ring-1", className),
|
|
3394
|
+
style: {
|
|
3395
|
+
backgroundColor: "var(--rvui-surface-1, oklch(0.18 0.006 225))",
|
|
3396
|
+
"--tw-ring-color": "var(--rvui-border-subtle, oklch(0.28 0.006 222 / 0.4))",
|
|
3397
|
+
borderRadius: "var(--rvui-radius-lg, 16px)",
|
|
3398
|
+
transition: "box-shadow var(--rvui-duration-normal, 200ms) var(--rvui-ease, cubic-bezier(0.22, 1, 0.36, 1))"
|
|
3399
|
+
},
|
|
3350
3400
|
children: [
|
|
3351
3401
|
/* @__PURE__ */ jsxs("div", {
|
|
3352
3402
|
className: "flex items-start justify-between",
|
|
3353
3403
|
children: [/* @__PURE__ */ jsx("p", {
|
|
3354
|
-
className: "text-sm font-medium
|
|
3404
|
+
className: "text-sm font-medium",
|
|
3405
|
+
style: { color: "var(--rvui-text-2, oklch(0.55 0.012 218))" },
|
|
3355
3406
|
children: label
|
|
3356
3407
|
}), icon && /* @__PURE__ */ jsx("div", {
|
|
3357
|
-
className: "rounded-lg
|
|
3408
|
+
className: "rounded-lg p-2",
|
|
3409
|
+
style: { backgroundColor: "var(--rvui-surface-2, oklch(0.22 0.008 222))" },
|
|
3358
3410
|
children: icon
|
|
3359
3411
|
})]
|
|
3360
3412
|
}),
|
|
3361
3413
|
/* @__PURE__ */ jsx("p", {
|
|
3362
|
-
className: "mt-2 text-3xl font-semibold tracking-tight
|
|
3414
|
+
className: "mt-2 text-3xl font-semibold tracking-tight",
|
|
3415
|
+
style: { color: "var(--rvui-text-0, oklch(0.95 0.002 210))" },
|
|
3363
3416
|
children: value
|
|
3364
3417
|
}),
|
|
3365
3418
|
(change || description) && /* @__PURE__ */ jsxs("div", {
|
|
3366
3419
|
className: "mt-2 flex items-center gap-2",
|
|
3367
3420
|
children: [change && trend && /* @__PURE__ */ jsxs("span", {
|
|
3368
|
-
className:
|
|
3369
|
-
|
|
3370
|
-
down: "text-red-600 dark:text-red-400",
|
|
3371
|
-
neutral: "text-zinc-500 dark:text-zinc-400"
|
|
3372
|
-
}[trend]),
|
|
3421
|
+
className: "text-sm font-medium",
|
|
3422
|
+
style: trendStyles[trend],
|
|
3373
3423
|
children: [
|
|
3374
|
-
|
|
3375
|
-
up: "↑",
|
|
3376
|
-
down: "↓",
|
|
3377
|
-
neutral: "→"
|
|
3378
|
-
}[trend],
|
|
3424
|
+
trendArrow[trend],
|
|
3379
3425
|
" ",
|
|
3380
3426
|
change
|
|
3381
3427
|
]
|
|
3382
3428
|
}), description && /* @__PURE__ */ jsx("span", {
|
|
3383
|
-
className: "text-sm
|
|
3429
|
+
className: "text-sm",
|
|
3430
|
+
style: { color: "var(--rvui-text-2, oklch(0.55 0.012 218))" },
|
|
3384
3431
|
children: description
|
|
3385
3432
|
})]
|
|
3386
3433
|
})
|
|
@@ -3389,7 +3436,7 @@ function Stat({ label, value, change, trend, description, icon, className }) {
|
|
|
3389
3436
|
}
|
|
3390
3437
|
function StatGroup({ className, children }) {
|
|
3391
3438
|
return /* @__PURE__ */ jsx("div", {
|
|
3392
|
-
className:
|
|
3439
|
+
className: cn("grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4", className),
|
|
3393
3440
|
children
|
|
3394
3441
|
});
|
|
3395
3442
|
}
|
|
@@ -3434,21 +3481,21 @@ function StepperHorizontal({ steps, className }) {
|
|
|
3434
3481
|
return /* @__PURE__ */ jsx("nav", {
|
|
3435
3482
|
"aria-label": "Progress",
|
|
3436
3483
|
children: /* @__PURE__ */ jsx("ol", {
|
|
3437
|
-
className:
|
|
3484
|
+
className: cn("flex items-center", className),
|
|
3438
3485
|
children: steps.map((step, index) => {
|
|
3439
3486
|
const isLast = index === steps.length - 1;
|
|
3440
3487
|
return /* @__PURE__ */ jsxs("li", {
|
|
3441
3488
|
"aria-current": step.status === "current" ? "step" : void 0,
|
|
3442
|
-
className:
|
|
3489
|
+
className: cn("flex items-center", !isLast && "flex-1"),
|
|
3443
3490
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
3444
3491
|
className: "flex flex-col items-center gap-1.5",
|
|
3445
3492
|
children: [/* @__PURE__ */ jsx(StepIcon, { status: step.status }), /* @__PURE__ */ jsx("span", {
|
|
3446
|
-
className:
|
|
3493
|
+
className: cn("text-xs font-medium", step.status === "current" ? "text-blue-600" : step.status === "complete" ? "text-zinc-950 dark:text-white" : "text-zinc-400 dark:text-zinc-500"),
|
|
3447
3494
|
children: step.label
|
|
3448
3495
|
})]
|
|
3449
3496
|
}), !isLast && /* @__PURE__ */ jsx("div", {
|
|
3450
3497
|
"aria-hidden": "true",
|
|
3451
|
-
className:
|
|
3498
|
+
className: cn("mx-3 h-px flex-1", step.status === "complete" ? "bg-blue-600" : "bg-zinc-200 dark:bg-zinc-700")
|
|
3452
3499
|
})]
|
|
3453
3500
|
}, index);
|
|
3454
3501
|
})
|
|
@@ -3459,7 +3506,7 @@ function StepperVertical({ steps, className }) {
|
|
|
3459
3506
|
return /* @__PURE__ */ jsx("nav", {
|
|
3460
3507
|
"aria-label": "Progress",
|
|
3461
3508
|
children: /* @__PURE__ */ jsx("ol", {
|
|
3462
|
-
className:
|
|
3509
|
+
className: cn("space-y-0", className),
|
|
3463
3510
|
children: steps.map((step, index) => {
|
|
3464
3511
|
const isLast = index === steps.length - 1;
|
|
3465
3512
|
return /* @__PURE__ */ jsxs("li", {
|
|
@@ -3469,12 +3516,12 @@ function StepperVertical({ steps, className }) {
|
|
|
3469
3516
|
className: "flex flex-col items-center",
|
|
3470
3517
|
children: [/* @__PURE__ */ jsx(StepIcon, { status: step.status }), !isLast && /* @__PURE__ */ jsx("div", {
|
|
3471
3518
|
"aria-hidden": "true",
|
|
3472
|
-
className:
|
|
3519
|
+
className: cn("w-px flex-1", step.status === "complete" ? "bg-blue-600" : "bg-zinc-200 dark:bg-zinc-700")
|
|
3473
3520
|
})]
|
|
3474
3521
|
}), /* @__PURE__ */ jsxs("div", {
|
|
3475
|
-
className:
|
|
3522
|
+
className: cn("pb-6 pt-1", isLast && "pb-0"),
|
|
3476
3523
|
children: [/* @__PURE__ */ jsx("p", {
|
|
3477
|
-
className:
|
|
3524
|
+
className: cn("text-sm font-medium", step.status === "current" ? "text-blue-600" : step.status === "complete" ? "text-zinc-950 dark:text-white" : "text-zinc-400 dark:text-zinc-500"),
|
|
3478
3525
|
children: step.label
|
|
3479
3526
|
}), step.description && /* @__PURE__ */ jsx("p", {
|
|
3480
3527
|
className: "mt-0.5 text-sm text-zinc-500 dark:text-zinc-400",
|
|
@@ -3492,7 +3539,7 @@ function SwitchGroup({ className, ...props }) {
|
|
|
3492
3539
|
return /* @__PURE__ */ jsx("div", {
|
|
3493
3540
|
"data-slot": "control",
|
|
3494
3541
|
...props,
|
|
3495
|
-
className:
|
|
3542
|
+
className: cn(className, "space-y-3 **:data-[slot=label]:font-normal", "has-data-[slot=description]:space-y-6 has-data-[slot=description]:**:data-[slot=label]:font-medium")
|
|
3496
3543
|
});
|
|
3497
3544
|
}
|
|
3498
3545
|
function SwitchField({ className, disabled, ...props }) {
|
|
@@ -3502,7 +3549,7 @@ function SwitchField({ className, disabled, ...props }) {
|
|
|
3502
3549
|
"data-slot": "field",
|
|
3503
3550
|
"data-disabled": disabled ? "" : void 0,
|
|
3504
3551
|
...props,
|
|
3505
|
-
className:
|
|
3552
|
+
className: cn(className, "grid grid-cols-[1fr_auto] gap-x-8 gap-y-1 sm:grid-cols-[1fr_auto]", "*:data-[slot=control]:col-start-2 *:data-[slot=control]:self-start sm:*:data-[slot=control]:mt-0.5", "*:data-[slot=label]:col-start-1 *:data-[slot=label]:row-start-1", "*:data-[slot=description]:col-start-1 *:data-[slot=description]:row-start-2", "has-data-[slot=description]:**:data-[slot=label]:font-medium")
|
|
3506
3553
|
})
|
|
3507
3554
|
});
|
|
3508
3555
|
}
|
|
@@ -3550,14 +3597,14 @@ function Switch({ color = "dark/zinc", className, checked: controlledChecked, de
|
|
|
3550
3597
|
onKeyDown: toggleProps.onKeyDown,
|
|
3551
3598
|
...interactiveProps,
|
|
3552
3599
|
...props,
|
|
3553
|
-
className:
|
|
3600
|
+
className: cn(className, "group relative isolate inline-flex h-6 w-10 cursor-default rounded-full p-[3px] sm:h-5 sm:w-8", "transition duration-0 ease-in-out data-changing:duration-200", "forced-colors:outline forced-colors:[--switch-bg:Highlight] dark:forced-colors:[--switch-bg:Highlight]", "bg-zinc-200 ring-1 ring-black/5 ring-inset dark:bg-white/5 dark:ring-white/15", "data-checked:bg-(--switch-bg) data-checked:ring-(--switch-bg-ring) dark:data-checked:bg-(--switch-bg) dark:data-checked:ring-(--switch-bg-ring)", "focus:not-data-focus:outline-hidden data-focus:outline-2 data-focus:outline-offset-2 data-focus:outline-blue-500", "data-hover:ring-black/15 data-hover:data-checked:ring-(--switch-bg-ring)", "dark:data-hover:ring-white/25 dark:data-hover:data-checked:ring-(--switch-bg-ring)", "data-disabled:bg-zinc-200 data-disabled:opacity-50 data-disabled:data-checked:bg-zinc-200 data-disabled:data-checked:ring-black/5", "dark:data-disabled:bg-white/15 dark:data-disabled:data-checked:bg-white/15 dark:data-disabled:data-checked:ring-white/15", colors[color]),
|
|
3554
3601
|
children: [name && /* @__PURE__ */ jsx("input", {
|
|
3555
3602
|
type: "hidden",
|
|
3556
3603
|
name,
|
|
3557
3604
|
value: checked ? value ?? "on" : ""
|
|
3558
3605
|
}), /* @__PURE__ */ jsx("span", {
|
|
3559
3606
|
"aria-hidden": "true",
|
|
3560
|
-
className:
|
|
3607
|
+
className: cn("pointer-events-none relative inline-block size-4.5 rounded-full sm:size-3.5", "translate-x-0 transition duration-200 ease-in-out", "border border-transparent", "bg-white shadow-sm ring-1 ring-black/5", "group-data-checked:bg-(--switch) group-data-checked:shadow-(--switch-shadow) group-data-checked:ring-(--switch-ring)", "group-data-checked:translate-x-4 sm:group-data-checked:translate-x-3", "group-data-checked:group-data-disabled:bg-white group-data-checked:group-data-disabled:shadow-sm group-data-checked:group-data-disabled:ring-black/5")
|
|
3561
3608
|
})]
|
|
3562
3609
|
});
|
|
3563
3610
|
}
|
|
@@ -3611,7 +3658,7 @@ function TabList({ className, children }) {
|
|
|
3611
3658
|
ref: listRef,
|
|
3612
3659
|
role: "tablist",
|
|
3613
3660
|
onKeyDown: handleKeyDown,
|
|
3614
|
-
className:
|
|
3661
|
+
className: cn("flex border-b border-zinc-200 dark:border-zinc-700", className),
|
|
3615
3662
|
children
|
|
3616
3663
|
});
|
|
3617
3664
|
}
|
|
@@ -3626,7 +3673,7 @@ function Tab({ id, className, children }) {
|
|
|
3626
3673
|
"aria-selected": isActive,
|
|
3627
3674
|
tabIndex: isActive ? 0 : -1,
|
|
3628
3675
|
onClick: () => setActiveTab(id),
|
|
3629
|
-
className:
|
|
3676
|
+
className: cn(className, "relative -mb-px border-b-2 px-4 py-2.5 text-sm font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500", isActive ? "border-blue-600 text-blue-600 dark:border-blue-400 dark:text-blue-400" : "border-transparent text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200"),
|
|
3630
3677
|
children
|
|
3631
3678
|
});
|
|
3632
3679
|
}
|
|
@@ -3638,7 +3685,7 @@ function TabPanel({ id, className, children }) {
|
|
|
3638
3685
|
id: `${baseId}-panel-${id}`,
|
|
3639
3686
|
"aria-labelledby": `${baseId}-tab-${id}`,
|
|
3640
3687
|
tabIndex: 0,
|
|
3641
|
-
className:
|
|
3688
|
+
className: cn("focus-visible:outline-none", className),
|
|
3642
3689
|
children
|
|
3643
3690
|
});
|
|
3644
3691
|
}
|
|
@@ -3649,7 +3696,7 @@ function Textarea({ className, resizable = true, disabled, invalid, ref, ...prop
|
|
|
3649
3696
|
const fieldProps = useFieldControlProps();
|
|
3650
3697
|
return /* @__PURE__ */ jsx("span", {
|
|
3651
3698
|
"data-slot": "control",
|
|
3652
|
-
className:
|
|
3699
|
+
className: cn([
|
|
3653
3700
|
className,
|
|
3654
3701
|
"relative block w-full",
|
|
3655
3702
|
"before:absolute before:inset-px before:rounded-[calc(var(--radius-lg)-1px)] before:bg-white before:shadow-sm",
|
|
@@ -3665,7 +3712,7 @@ function Textarea({ className, resizable = true, disabled, invalid, ref, ...prop
|
|
|
3665
3712
|
...fieldProps,
|
|
3666
3713
|
"data-invalid": invalid ? "" : void 0,
|
|
3667
3714
|
"data-disabled": disabled ? "" : void 0,
|
|
3668
|
-
className:
|
|
3715
|
+
className: cn([
|
|
3669
3716
|
"relative block h-full w-full appearance-none rounded-lg px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(2.5)-1px)] sm:px-[calc(--spacing(3)-1px)] sm:py-[calc(--spacing(1.5)-1px)]",
|
|
3670
3717
|
"text-base/6 text-zinc-950 placeholder:text-zinc-500 sm:text-sm/6 dark:text-white",
|
|
3671
3718
|
"border border-zinc-950/10 data-hover:border-zinc-950/20 dark:border-white/10 dark:data-hover:border-white/20",
|
|
@@ -3682,13 +3729,13 @@ function Textarea({ className, resizable = true, disabled, invalid, ref, ...prop
|
|
|
3682
3729
|
//#region src/components/timeline.tsx
|
|
3683
3730
|
function Timeline({ className, children }) {
|
|
3684
3731
|
return /* @__PURE__ */ jsx("ol", {
|
|
3685
|
-
className:
|
|
3732
|
+
className: cn("relative", className),
|
|
3686
3733
|
children
|
|
3687
3734
|
});
|
|
3688
3735
|
}
|
|
3689
3736
|
function TimelineItem({ icon, date, title, description, isLast = false, className }) {
|
|
3690
3737
|
return /* @__PURE__ */ jsxs("li", {
|
|
3691
|
-
className:
|
|
3738
|
+
className: cn("relative flex gap-4", !isLast && "pb-8", className),
|
|
3692
3739
|
children: [
|
|
3693
3740
|
!isLast && /* @__PURE__ */ jsx("div", {
|
|
3694
3741
|
"aria-hidden": "true",
|
|
@@ -3810,10 +3857,10 @@ function ToastItem({ toast, onRemove }) {
|
|
|
3810
3857
|
}, [toast.duration, handleRemove]);
|
|
3811
3858
|
return /* @__PURE__ */ jsxs("div", {
|
|
3812
3859
|
role: "alert",
|
|
3813
|
-
className:
|
|
3860
|
+
className: cn("pointer-events-auto flex w-full max-w-sm items-start gap-3 rounded-xl p-4 shadow-lg ring-1 transition-all duration-200", variantClasses[variant], isExiting ? "translate-y-2 opacity-0" : "translate-y-0 opacity-100 animate-[slide-in-from-bottom_200ms_ease-out]"),
|
|
3814
3861
|
children: [
|
|
3815
3862
|
variant !== "default" && /* @__PURE__ */ jsx("span", {
|
|
3816
|
-
className:
|
|
3863
|
+
className: cn("mt-0.5 text-sm font-bold", variantIconClasses[variant]),
|
|
3817
3864
|
children: variantIcons[variant]
|
|
3818
3865
|
}),
|
|
3819
3866
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -3882,12 +3929,96 @@ function Tooltip({ content, side = "top", className, delay = 200, children }) {
|
|
|
3882
3929
|
children: [children, visible && /* @__PURE__ */ jsx("span", {
|
|
3883
3930
|
id,
|
|
3884
3931
|
role: "tooltip",
|
|
3885
|
-
className:
|
|
3932
|
+
className: cn("pointer-events-none absolute z-50 w-max max-w-xs rounded-lg bg-zinc-950 px-2.5 py-1.5 text-xs text-white shadow-lg dark:bg-zinc-700", sideClasses[side], className),
|
|
3886
3933
|
children: content
|
|
3887
3934
|
})]
|
|
3888
3935
|
});
|
|
3889
3936
|
}
|
|
3890
3937
|
//#endregion
|
|
3891
|
-
|
|
3938
|
+
//#region src/hooks/use-theme.ts
|
|
3939
|
+
var STORAGE_KEY = "rvui-theme";
|
|
3940
|
+
var DATA_ATTR = "data-theme";
|
|
3941
|
+
/** Listeners for theme changes across components */
|
|
3942
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
3943
|
+
function notifyListeners() {
|
|
3944
|
+
for (const listener of listeners) listener();
|
|
3945
|
+
}
|
|
3946
|
+
/** Resolve 'system' to 'light' or 'dark' based on media query */
|
|
3947
|
+
function resolveSystemTheme() {
|
|
3948
|
+
if (typeof window === "undefined") return "dark";
|
|
3949
|
+
return window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark";
|
|
3950
|
+
}
|
|
3951
|
+
/** Read stored preference or default to 'system' */
|
|
3952
|
+
function getStoredTheme() {
|
|
3953
|
+
if (typeof window === "undefined") return "system";
|
|
3954
|
+
try {
|
|
3955
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
3956
|
+
if (stored === "light" || stored === "dark" || stored === "system") return stored;
|
|
3957
|
+
} catch {}
|
|
3958
|
+
return "system";
|
|
3959
|
+
}
|
|
3960
|
+
/** Apply theme to the document element */
|
|
3961
|
+
function applyTheme(theme) {
|
|
3962
|
+
if (typeof document === "undefined") return;
|
|
3963
|
+
const resolved = theme === "system" ? resolveSystemTheme() : theme;
|
|
3964
|
+
document.documentElement.setAttribute(DATA_ATTR, resolved);
|
|
3965
|
+
}
|
|
3966
|
+
/** Store and apply theme, notify all subscribers */
|
|
3967
|
+
function setTheme(theme) {
|
|
3968
|
+
try {
|
|
3969
|
+
localStorage.setItem(STORAGE_KEY, theme);
|
|
3970
|
+
} catch {}
|
|
3971
|
+
applyTheme(theme);
|
|
3972
|
+
notifyListeners();
|
|
3973
|
+
}
|
|
3974
|
+
/** Get the current snapshot for useSyncExternalStore */
|
|
3975
|
+
function getSnapshot() {
|
|
3976
|
+
return getStoredTheme();
|
|
3977
|
+
}
|
|
3978
|
+
function getServerSnapshot() {
|
|
3979
|
+
return "system";
|
|
3980
|
+
}
|
|
3981
|
+
function subscribe(listener) {
|
|
3982
|
+
listeners.add(listener);
|
|
3983
|
+
return () => listeners.delete(listener);
|
|
3984
|
+
}
|
|
3985
|
+
/**
|
|
3986
|
+
* Hook to read and set the current theme.
|
|
3987
|
+
*
|
|
3988
|
+
* Persists preference to localStorage under `rvui-theme`.
|
|
3989
|
+
* Applies `data-theme` attribute to the document element.
|
|
3990
|
+
* Supports 'light', 'dark', and 'system' (auto-detect).
|
|
3991
|
+
*
|
|
3992
|
+
* @example
|
|
3993
|
+
* ```tsx
|
|
3994
|
+
* const { theme, resolvedTheme, setTheme } = useTheme();
|
|
3995
|
+
* <button onClick={() => setTheme(resolvedTheme === 'dark' ? 'light' : 'dark')}>
|
|
3996
|
+
* Toggle theme
|
|
3997
|
+
* </button>
|
|
3998
|
+
* ```
|
|
3999
|
+
*/
|
|
4000
|
+
function useTheme() {
|
|
4001
|
+
const theme = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
4002
|
+
const resolved = theme === "system" ? resolveSystemTheme() : theme;
|
|
4003
|
+
useEffect(() => {
|
|
4004
|
+
applyTheme(theme);
|
|
4005
|
+
const mq = window.matchMedia("(prefers-color-scheme: light)");
|
|
4006
|
+
const handleChange = () => {
|
|
4007
|
+
if (getStoredTheme() === "system") {
|
|
4008
|
+
applyTheme("system");
|
|
4009
|
+
notifyListeners();
|
|
4010
|
+
}
|
|
4011
|
+
};
|
|
4012
|
+
mq.addEventListener("change", handleChange);
|
|
4013
|
+
return () => mq.removeEventListener("change", handleChange);
|
|
4014
|
+
}, [theme]);
|
|
4015
|
+
return {
|
|
4016
|
+
theme,
|
|
4017
|
+
resolvedTheme: resolved,
|
|
4018
|
+
setTheme: useCallback((t) => setTheme(t), [])
|
|
4019
|
+
};
|
|
4020
|
+
}
|
|
4021
|
+
//#endregion
|
|
4022
|
+
export { NavbarSection as $, CheckboxField as $t, SidebarSpacer as A, useTransition as An, useTypeAhead as At, SelectScrollUpButton as B, DialogDescription as Bt, SidebarDivider as C, AlertTitle as Cn, DropdownHeader as Ct, SidebarItem as D, TextLink as Dn, DropdownMenu as Dt, SidebarHeading as E, Text as En, DropdownLabel as Et, SelectContent as F, AccordionItem as Fn, DrawerHeader as Ft, Radio as G, Combobox as Gt, SelectTrigger as H, DescriptionDetails as Ht, SelectGroup as I, Divider as It, Progress as J, ComboboxOption as Jt, RadioField as K, ComboboxDescription as Kt, SelectItem as L, Dialog as Lt, useCloseContext as M, useFocusTrap as Mn, Drawer as Mt, Select as N, useEscapeKey as Nn, DrawerBody as Nt, SidebarLabel as O, Link as On, DropdownSection as Ot, Select$1 as P, Accordion as Pn, DrawerFooter as Pt, NavbarLabel as Q, Checkbox as Qt, SelectLabel as R, DialogActions as Rt, SidebarBody as S, AlertDescription as Sn, DropdownDivider as St, SidebarHeader as T, Strong as Tn, DropdownItem as Tt, SelectValue as U, DescriptionList as Ut, SelectSeparator as V, DialogTitle as Vt, Rating as W, DescriptionTerm as Wt, NavbarDivider as X, useClickOutside as Xt, Navbar as Y, usePopover as Yt, NavbarItem as Z, CodeBlock as Zt, StatGroup as _, Button as _n, Label as _t, Timeline as a, useFieldControlProps as an, ListboxDescription as at, SidebarLayout as b, AlertActions as bn, DropdownButton as bt, Tab as c, useFieldLabelProps as cn, Kbd as ct, Tabs as d, CheckboxIndicator as dn, InputGroup as dt, CheckboxGroup as en, NavbarSpacer as et, Switch as f, Badge as fn, Description as ft, Stat as g, AvatarButton as gn, Fieldset as gt, Stepper as h, Avatar as hn, FieldGroup as ht, useToast as i, useFieldContext as in, Listbox as it, CloseContext as j, useScrollLock as jn, useRovingTabindex as jt, SidebarSection as k, useDataInteractive as kn, DropdownShortcut as kt, TabList as l, Callout as ln, KbdShortcut as lt, SwitchGroup as m, AvatarGroup as mn, Field as mt, Tooltip as n, useControllableState as nn, LayoutIndicator as nt, TimelineItem as o, useFieldDescriptionProps as on, ListboxLabel as ot, SwitchField as p, BadgeButton as pn, ErrorMessage as pt, RadioGroup as q, ComboboxLabel as qt, ToastProvider as r, FieldProvider as rn, useLayoutAnimation as rt, Textarea as s, useFieldErrorProps as sn, ListboxOption as st, useTheme as t, useToggle as tn, LayoutGroup as tt, TabPanel as u, Checkbox$1 as un, Input as ut, StackedLayout as v, TouchTarget as vn, Legend as vt, SidebarFooter as w, Code as wn, DropdownHeading as wt, Sidebar as x, AlertBody as xn, DropdownDescription as xt, Slider as y, Alert as yn, Dropdown as yt, SelectScrollDownButton as z, DialogBody as zt };
|
|
3892
4023
|
|
|
3893
|
-
//# sourceMappingURL=
|
|
4024
|
+
//# sourceMappingURL=use-theme-QxeZadnD.js.map
|