@still-void/ui 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/README.md +5 -2
- package/dist/react/client/index.cjs +541 -90
- package/dist/react/client/index.cjs.map +1 -1
- package/dist/react/client/index.d.cts +152 -2
- package/dist/react/client/index.d.ts +152 -2
- package/dist/react/client/index.js +543 -90
- package/dist/react/client/index.js.map +1 -1
- package/dist/react/index.cjs +322 -37
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +156 -3
- package/dist/react/index.d.ts +156 -3
- package/dist/react/index.js +313 -39
- package/dist/react/index.js.map +1 -1
- package/dist/style.css +489 -2
- package/package.json +2 -1
|
@@ -44,7 +44,7 @@ __export(client_exports, {
|
|
|
44
44
|
AlertDialogTrigger: () => AlertDialogTrigger,
|
|
45
45
|
CopyButton: () => CopyButton,
|
|
46
46
|
DEFAULT_STORAGE_KEY: () => DEFAULT_STORAGE_KEY,
|
|
47
|
-
Dialog: () =>
|
|
47
|
+
Dialog: () => Dialog2,
|
|
48
48
|
DialogClose: () => DialogClose,
|
|
49
49
|
DialogContent: () => DialogContent,
|
|
50
50
|
DialogDescription: () => DialogDescription,
|
|
@@ -80,6 +80,10 @@ __export(client_exports, {
|
|
|
80
80
|
SelectSeparator: () => SelectSeparator,
|
|
81
81
|
SelectTrigger: () => SelectTrigger,
|
|
82
82
|
SelectValue: () => SelectValue,
|
|
83
|
+
SidebarInset: () => SidebarInset,
|
|
84
|
+
SidebarPanel: () => SidebarPanel,
|
|
85
|
+
SidebarProvider: () => SidebarProvider,
|
|
86
|
+
SidebarTrigger: () => SidebarTrigger,
|
|
83
87
|
TableOfContents: () => TableOfContents,
|
|
84
88
|
Tabs: () => Tabs,
|
|
85
89
|
TabsContent: () => TabsContent,
|
|
@@ -87,17 +91,22 @@ __export(client_exports, {
|
|
|
87
91
|
TabsTrigger: () => TabsTrigger,
|
|
88
92
|
ThemeProvider: () => ThemeProvider,
|
|
89
93
|
ThemeToggle: () => ThemeToggle,
|
|
94
|
+
ToastProvider: () => ToastProvider,
|
|
90
95
|
Tooltip: () => Tooltip,
|
|
91
96
|
TooltipContent: () => TooltipContent,
|
|
92
97
|
TooltipProvider: () => TooltipProvider,
|
|
93
98
|
TooltipTrigger: () => TooltipTrigger,
|
|
94
99
|
copyToClipboard: () => copyToClipboard,
|
|
100
|
+
createMediaQuery: () => createMediaQuery,
|
|
95
101
|
createReadingProgress: () => createReadingProgress,
|
|
96
102
|
createScrollSpy: () => createScrollSpy,
|
|
97
103
|
createThemeManager: () => createThemeManager,
|
|
104
|
+
useMediaQuery: () => useMediaQuery,
|
|
98
105
|
useReadingProgress: () => useReadingProgress,
|
|
99
106
|
useScrollSpy: () => useScrollSpy,
|
|
100
|
-
|
|
107
|
+
useSidebar: () => useSidebar,
|
|
108
|
+
useTheme: () => useTheme,
|
|
109
|
+
useToast: () => useToast
|
|
101
110
|
});
|
|
102
111
|
module.exports = __toCommonJS(client_exports);
|
|
103
112
|
|
|
@@ -362,6 +371,72 @@ var import_react4 = require("react");
|
|
|
362
371
|
// src/react/client/hooks.ts
|
|
363
372
|
var import_react3 = require("react");
|
|
364
373
|
|
|
374
|
+
// src/behaviors/mediaQuery.ts
|
|
375
|
+
function createMediaQuery(query) {
|
|
376
|
+
if (typeof window === "undefined" || !window.matchMedia) {
|
|
377
|
+
return {
|
|
378
|
+
getSnapshot: () => false,
|
|
379
|
+
subscribe: () => () => {
|
|
380
|
+
},
|
|
381
|
+
// no-op unsubscribe
|
|
382
|
+
destroy: () => {
|
|
383
|
+
}
|
|
384
|
+
// no-op
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
const mql = window.matchMedia(query);
|
|
388
|
+
const listeners = [];
|
|
389
|
+
let currentMatches = mql.matches;
|
|
390
|
+
let attached = false;
|
|
391
|
+
const handleChange = () => {
|
|
392
|
+
const newMatches = mql.matches;
|
|
393
|
+
if (newMatches !== currentMatches) {
|
|
394
|
+
currentMatches = newMatches;
|
|
395
|
+
for (const listener of [...listeners]) {
|
|
396
|
+
listener();
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
};
|
|
400
|
+
const attachListener = () => {
|
|
401
|
+
if (attached) return;
|
|
402
|
+
attached = true;
|
|
403
|
+
if (mql.addEventListener) {
|
|
404
|
+
mql.addEventListener("change", handleChange);
|
|
405
|
+
} else if (mql.addListener) {
|
|
406
|
+
mql.addListener(handleChange);
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
const detachListener = () => {
|
|
410
|
+
if (!attached) return;
|
|
411
|
+
attached = false;
|
|
412
|
+
if (mql.removeEventListener) {
|
|
413
|
+
mql.removeEventListener("change", handleChange);
|
|
414
|
+
} else if (mql.removeListener) {
|
|
415
|
+
mql.removeListener(handleChange);
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
return {
|
|
419
|
+
getSnapshot: () => mql.matches,
|
|
420
|
+
subscribe: (listener) => {
|
|
421
|
+
listeners.push(listener);
|
|
422
|
+
attachListener();
|
|
423
|
+
return () => {
|
|
424
|
+
const index = listeners.indexOf(listener);
|
|
425
|
+
if (index >= 0) {
|
|
426
|
+
listeners.splice(index, 1);
|
|
427
|
+
}
|
|
428
|
+
if (listeners.length === 0) {
|
|
429
|
+
detachListener();
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
},
|
|
433
|
+
destroy: () => {
|
|
434
|
+
listeners.length = 0;
|
|
435
|
+
detachListener();
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
|
|
365
440
|
// src/behaviors/readingProgress.ts
|
|
366
441
|
var raf = typeof window !== "undefined" && typeof window.requestAnimationFrame === "function" ? (cb) => window.requestAnimationFrame(cb) : (
|
|
367
442
|
/* v8 ignore next */
|
|
@@ -467,6 +542,30 @@ function useReadingProgress(target, step = 1) {
|
|
|
467
542
|
}, [target, step]);
|
|
468
543
|
return percent;
|
|
469
544
|
}
|
|
545
|
+
function useMediaQuery(query) {
|
|
546
|
+
const mq = (0, import_react3.useSyncExternalStore)(
|
|
547
|
+
// subscribe: attach listener and return unsubscribe
|
|
548
|
+
(onStoreChange) => {
|
|
549
|
+
const mediaQuery = createMediaQuery(query);
|
|
550
|
+
const unsubscribe = mediaQuery.subscribe(onStoreChange);
|
|
551
|
+
return () => {
|
|
552
|
+
unsubscribe();
|
|
553
|
+
mediaQuery.destroy();
|
|
554
|
+
};
|
|
555
|
+
},
|
|
556
|
+
// getSnapshot: return current state (after hydration)
|
|
557
|
+
() => {
|
|
558
|
+
const mediaQuery = createMediaQuery(query);
|
|
559
|
+
const matches = mediaQuery.getSnapshot();
|
|
560
|
+
mediaQuery.destroy();
|
|
561
|
+
return matches;
|
|
562
|
+
},
|
|
563
|
+
// getServerSnapshot: return initial state during SSR (desktop/false)
|
|
564
|
+
// R5-01 AC-4: SSR returns false without error
|
|
565
|
+
() => false
|
|
566
|
+
);
|
|
567
|
+
return mq;
|
|
568
|
+
}
|
|
470
569
|
|
|
471
570
|
// src/react/client/TableOfContents.tsx
|
|
472
571
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -499,9 +598,12 @@ function ReadingProgress({ target, announce, className, ...rest }) {
|
|
|
499
598
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: cx(readingProgress(), className), ...a11yProps, ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: readingProgressClasses.bar }) });
|
|
500
599
|
}
|
|
501
600
|
|
|
502
|
-
// src/
|
|
601
|
+
// src/react/client/ToastProvider.tsx
|
|
503
602
|
var React2 = __toESM(require("react"), 1);
|
|
504
|
-
var
|
|
603
|
+
var Toast = __toESM(require("@radix-ui/react-toast"), 1);
|
|
604
|
+
|
|
605
|
+
// src/components/ui/icon.tsx
|
|
606
|
+
var React = __toESM(require("react"), 1);
|
|
505
607
|
|
|
506
608
|
// src/lib/utils.ts
|
|
507
609
|
var import_clsx = require("clsx");
|
|
@@ -510,9 +612,6 @@ function cn(...inputs) {
|
|
|
510
612
|
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
511
613
|
}
|
|
512
614
|
|
|
513
|
-
// src/components/ui/icon.tsx
|
|
514
|
-
var React = __toESM(require("react"), 1);
|
|
515
|
-
|
|
516
615
|
// src/components/ui/icon-set.ts
|
|
517
616
|
var import_outline = require("@heroicons/react/24/outline");
|
|
518
617
|
var ICON_GLYPHS = {
|
|
@@ -530,7 +629,10 @@ var ICON_GLYPHS = {
|
|
|
530
629
|
sun: import_outline.SunIcon,
|
|
531
630
|
moon: import_outline.MoonIcon,
|
|
532
631
|
search: import_outline.MagnifyingGlassIcon,
|
|
533
|
-
menu: import_outline.Bars3Icon
|
|
632
|
+
menu: import_outline.Bars3Icon,
|
|
633
|
+
camera: import_outline.CameraIcon,
|
|
634
|
+
blocked: import_outline.NoSymbolIcon,
|
|
635
|
+
pending: import_outline.ClockIcon
|
|
534
636
|
};
|
|
535
637
|
var ICON_NAMES = Object.keys(ICON_GLYPHS);
|
|
536
638
|
var ICON_FALLBACK_NAME = "alert-circle";
|
|
@@ -545,6 +647,7 @@ var Icon = React.forwardRef(
|
|
|
545
647
|
{
|
|
546
648
|
...props,
|
|
547
649
|
ref,
|
|
650
|
+
"data-icon-name": name,
|
|
548
651
|
className: cn(
|
|
549
652
|
"sv-icon",
|
|
550
653
|
size === "sm" && "sv-icon--sm",
|
|
@@ -560,13 +663,349 @@ var Icon = React.forwardRef(
|
|
|
560
663
|
);
|
|
561
664
|
Icon.displayName = "Icon";
|
|
562
665
|
|
|
563
|
-
// src/
|
|
666
|
+
// src/react/client/ToastProvider.tsx
|
|
564
667
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
565
|
-
var
|
|
668
|
+
var ToastContext = React2.createContext(null);
|
|
669
|
+
function useToast() {
|
|
670
|
+
const context = React2.useContext(ToastContext);
|
|
671
|
+
if (!context) {
|
|
672
|
+
throw new Error("useToast must be used within ToastProvider");
|
|
673
|
+
}
|
|
674
|
+
return context;
|
|
675
|
+
}
|
|
676
|
+
var variantConfig = {
|
|
677
|
+
info: { icon: "info", type: "background" },
|
|
678
|
+
success: { icon: "check-circle", type: "background" },
|
|
679
|
+
warning: { icon: "alert-triangle", type: "foreground" },
|
|
680
|
+
danger: { icon: "alert-circle", type: "foreground" }
|
|
681
|
+
};
|
|
682
|
+
function toastReducer(state, action) {
|
|
683
|
+
switch (action.type) {
|
|
684
|
+
case "ADD": {
|
|
685
|
+
return [...state, action.entry];
|
|
686
|
+
}
|
|
687
|
+
case "REMOVE": {
|
|
688
|
+
return state.filter((t) => t.id !== action.id);
|
|
689
|
+
}
|
|
690
|
+
case "UPDATE": {
|
|
691
|
+
return state.map(
|
|
692
|
+
(t) => t.id === action.id ? { ...t, ...action.patch, version: t.version + 1 } : t
|
|
693
|
+
);
|
|
694
|
+
}
|
|
695
|
+
case "REMOVE_ALL": {
|
|
696
|
+
return [];
|
|
697
|
+
}
|
|
698
|
+
/* v8 ignore next 2 */
|
|
699
|
+
default: {
|
|
700
|
+
return state;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function ToastProvider({
|
|
705
|
+
children,
|
|
706
|
+
duration = 5e3,
|
|
707
|
+
max = 3,
|
|
708
|
+
label = "Notifications",
|
|
709
|
+
closeLabel = "Close",
|
|
710
|
+
swipeDirection = "right"
|
|
711
|
+
}) {
|
|
712
|
+
const [allToasts, dispatch] = React2.useReducer(toastReducer, []);
|
|
713
|
+
const isMountedRef = React2.useRef(true);
|
|
714
|
+
React2.useEffect(() => {
|
|
715
|
+
isMountedRef.current = true;
|
|
716
|
+
return () => {
|
|
717
|
+
isMountedRef.current = false;
|
|
718
|
+
};
|
|
719
|
+
}, []);
|
|
720
|
+
const validatedMax = typeof max === "number" && Number.isFinite(max) && max > 0 ? Math.floor(max) : 3;
|
|
721
|
+
const displayedToasts = allToasts.slice(-validatedMax);
|
|
722
|
+
const toast = React2.useCallback(
|
|
723
|
+
(options) => {
|
|
724
|
+
if (!isMountedRef.current) return { id: "", dismiss: () => {
|
|
725
|
+
}, update: () => {
|
|
726
|
+
} };
|
|
727
|
+
const id = Math.random().toString(36).substr(2, 9);
|
|
728
|
+
const variant = options.variant ?? "info";
|
|
729
|
+
const duration_val = typeof options.duration === "number" && options.duration > 0 ? options.duration : duration;
|
|
730
|
+
const entry = {
|
|
731
|
+
...options,
|
|
732
|
+
variant,
|
|
733
|
+
duration: duration_val,
|
|
734
|
+
id,
|
|
735
|
+
version: 0
|
|
736
|
+
};
|
|
737
|
+
dispatch({ type: "ADD", entry });
|
|
738
|
+
return {
|
|
739
|
+
id,
|
|
740
|
+
dismiss: () => dispatch({ type: "REMOVE", id }),
|
|
741
|
+
update: (patch) => {
|
|
742
|
+
dispatch({ type: "UPDATE", id, patch });
|
|
743
|
+
}
|
|
744
|
+
};
|
|
745
|
+
},
|
|
746
|
+
[duration]
|
|
747
|
+
);
|
|
748
|
+
const dismiss = React2.useCallback((id) => {
|
|
749
|
+
dispatch({ type: "REMOVE", id });
|
|
750
|
+
}, []);
|
|
751
|
+
const dismissAll = React2.useCallback(() => {
|
|
752
|
+
dispatch({ type: "REMOVE_ALL" });
|
|
753
|
+
}, []);
|
|
754
|
+
React2.useEffect(() => {
|
|
755
|
+
if (allToasts.length > validatedMax) {
|
|
756
|
+
const toRemove = allToasts[0];
|
|
757
|
+
if (toRemove) {
|
|
758
|
+
dismiss(toRemove.id);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}, [allToasts.length, validatedMax, dismiss]);
|
|
762
|
+
const value = {
|
|
763
|
+
toast,
|
|
764
|
+
dismiss,
|
|
765
|
+
dismissAll,
|
|
766
|
+
toasts: displayedToasts
|
|
767
|
+
};
|
|
768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ToastContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Toast.Provider, { duration, label, swipeDirection, children: [
|
|
769
|
+
children,
|
|
770
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Toast.Viewport, { className: "sv-toast__viewport" }),
|
|
771
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
772
|
+
ToastViewportRenderer,
|
|
773
|
+
{
|
|
774
|
+
toasts: displayedToasts,
|
|
775
|
+
closeLabel,
|
|
776
|
+
duration,
|
|
777
|
+
dismiss
|
|
778
|
+
}
|
|
779
|
+
)
|
|
780
|
+
] }) });
|
|
781
|
+
}
|
|
782
|
+
function ToastViewportRenderer({
|
|
783
|
+
toasts,
|
|
784
|
+
closeLabel,
|
|
785
|
+
duration,
|
|
786
|
+
dismiss
|
|
787
|
+
}) {
|
|
788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: toasts.map((entry) => {
|
|
789
|
+
const { id, title, description, variant = "info", action } = entry;
|
|
790
|
+
const config = variantConfig[variant];
|
|
791
|
+
const toastDuration = entry.duration ?? duration;
|
|
792
|
+
const handleActionClick = () => {
|
|
793
|
+
if (action?.onClick) {
|
|
794
|
+
action.onClick();
|
|
795
|
+
}
|
|
796
|
+
dismiss(id);
|
|
797
|
+
};
|
|
798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
799
|
+
Toast.Root,
|
|
800
|
+
{
|
|
801
|
+
open: true,
|
|
802
|
+
onOpenChange: (open) => {
|
|
803
|
+
if (!open) {
|
|
804
|
+
dismiss(id);
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
duration: toastDuration,
|
|
808
|
+
type: config.type,
|
|
809
|
+
"data-variant": variant,
|
|
810
|
+
className: cn("sv-toast", `sv-toast--${variant}`),
|
|
811
|
+
children: [
|
|
812
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: config.icon, className: "sv-toast__icon", "aria-hidden": "true", "data-name": config.icon }),
|
|
813
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "sv-toast__content", children: [
|
|
814
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Toast.Title, { className: "sv-toast__title", children: title }),
|
|
815
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Toast.Description, { className: "sv-toast__description", children: description })
|
|
816
|
+
] }),
|
|
817
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "sv-toast__actions", children: [
|
|
818
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
819
|
+
Toast.Action,
|
|
820
|
+
{
|
|
821
|
+
altText: action.altText,
|
|
822
|
+
asChild: true,
|
|
823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
824
|
+
"button",
|
|
825
|
+
{
|
|
826
|
+
type: "button",
|
|
827
|
+
className: "sv-toast__action",
|
|
828
|
+
onClick: handleActionClick,
|
|
829
|
+
children: action.label
|
|
830
|
+
}
|
|
831
|
+
)
|
|
832
|
+
}
|
|
833
|
+
),
|
|
834
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Toast.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "sv-toast__close", "aria-label": closeLabel, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "x" }) }) })
|
|
835
|
+
] })
|
|
836
|
+
]
|
|
837
|
+
},
|
|
838
|
+
`${id}-${entry.version}`
|
|
839
|
+
);
|
|
840
|
+
}) });
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
// src/react/client/SidebarProvider.tsx
|
|
844
|
+
var import_react5 = require("react");
|
|
845
|
+
var Dialog = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
846
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
847
|
+
function composeRefs(...refs) {
|
|
848
|
+
return (node) => {
|
|
849
|
+
for (const ref of refs) {
|
|
850
|
+
if (typeof ref === "function") {
|
|
851
|
+
ref(node);
|
|
852
|
+
} else if (ref !== null && ref !== void 0) {
|
|
853
|
+
;
|
|
854
|
+
ref.current = node;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
var SidebarContext = (0, import_react5.createContext)(null);
|
|
860
|
+
function SidebarProvider({
|
|
861
|
+
children,
|
|
862
|
+
defaultOpen = true,
|
|
863
|
+
open: controlledOpen,
|
|
864
|
+
onOpenChange,
|
|
865
|
+
collapsible: collapsibleProp = "offcanvas",
|
|
866
|
+
breakpoint: breakpointProp
|
|
867
|
+
}) {
|
|
868
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react5.useState)(defaultOpen);
|
|
869
|
+
const panelId = (0, import_react5.useId)();
|
|
870
|
+
const triggerRef = (0, import_react5.useRef)(null);
|
|
871
|
+
const breakpoint = (() => {
|
|
872
|
+
if (breakpointProp === void 0 || breakpointProp === 0 || breakpointProp < 0 || Number.isNaN(breakpointProp) || !Number.isFinite(breakpointProp)) {
|
|
873
|
+
return 1024;
|
|
874
|
+
}
|
|
875
|
+
return breakpointProp;
|
|
876
|
+
})();
|
|
877
|
+
const isMobile = !useMediaQuery(`(min-width: ${breakpoint}px)`);
|
|
878
|
+
const isControlled = controlledOpen !== void 0;
|
|
879
|
+
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
880
|
+
const setOpen = (0, import_react5.useCallback)(
|
|
881
|
+
(newOpen) => {
|
|
882
|
+
if (collapsibleProp === "none") return;
|
|
883
|
+
if (isControlled) {
|
|
884
|
+
onOpenChange?.(newOpen);
|
|
885
|
+
} else {
|
|
886
|
+
setUncontrolledOpen(newOpen);
|
|
887
|
+
}
|
|
888
|
+
},
|
|
889
|
+
[collapsibleProp, isControlled, onOpenChange]
|
|
890
|
+
);
|
|
891
|
+
const toggle = (0, import_react5.useCallback)(() => {
|
|
892
|
+
if (collapsibleProp === "none") return;
|
|
893
|
+
if (isControlled) {
|
|
894
|
+
onOpenChange?.(!controlledOpen);
|
|
895
|
+
} else {
|
|
896
|
+
setUncontrolledOpen((prev) => !prev);
|
|
897
|
+
}
|
|
898
|
+
}, [collapsibleProp, isControlled, controlledOpen, onOpenChange]);
|
|
899
|
+
const contextValue = {
|
|
900
|
+
open,
|
|
901
|
+
setOpen,
|
|
902
|
+
toggle,
|
|
903
|
+
isMobile,
|
|
904
|
+
collapsible: collapsibleProp,
|
|
905
|
+
panelId,
|
|
906
|
+
triggerRef
|
|
907
|
+
};
|
|
908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
909
|
+
"div",
|
|
910
|
+
{
|
|
911
|
+
className: "sv-app-shell",
|
|
912
|
+
"data-state": open ? "open" : "closed",
|
|
913
|
+
"data-collapsible": collapsibleProp,
|
|
914
|
+
"data-mobile": isMobile,
|
|
915
|
+
children
|
|
916
|
+
}
|
|
917
|
+
) });
|
|
918
|
+
}
|
|
919
|
+
function useSidebar() {
|
|
920
|
+
const context = (0, import_react5.useContext)(SidebarContext);
|
|
921
|
+
if (!context) {
|
|
922
|
+
throw new Error("useSidebar must be used within SidebarProvider");
|
|
923
|
+
}
|
|
924
|
+
return context;
|
|
925
|
+
}
|
|
926
|
+
var SidebarPanel = (0, import_react5.forwardRef)(
|
|
927
|
+
function SidebarPanel2({ className, title = "Navigation", children, ...props }, ref) {
|
|
928
|
+
const { open, setOpen, isMobile, collapsible, panelId, triggerRef } = useSidebar();
|
|
929
|
+
if (isMobile && collapsible !== "none") {
|
|
930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Dialog.Root, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Dialog.Portal, { children: [
|
|
931
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Dialog.Overlay, { className: "sv-overlay" }),
|
|
932
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
933
|
+
Dialog.Content,
|
|
934
|
+
{
|
|
935
|
+
ref,
|
|
936
|
+
className: cn("sv-app-sidebar sv-app-sidebar__drawer", className),
|
|
937
|
+
role: "dialog",
|
|
938
|
+
"aria-modal": "true",
|
|
939
|
+
id: panelId,
|
|
940
|
+
onCloseAutoFocus: (event) => {
|
|
941
|
+
event.preventDefault();
|
|
942
|
+
triggerRef.current?.focus();
|
|
943
|
+
},
|
|
944
|
+
...props,
|
|
945
|
+
children: [
|
|
946
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Dialog.Title, { className: "sv-sr-only", children: title }),
|
|
947
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "sv-app-sidebar__body", children }),
|
|
948
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Dialog.Close, { className: "sv-dialog__close", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { "aria-label": "Close sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "x" }) }) })
|
|
949
|
+
]
|
|
950
|
+
}
|
|
951
|
+
)
|
|
952
|
+
] }) });
|
|
953
|
+
}
|
|
954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
955
|
+
"aside",
|
|
956
|
+
{
|
|
957
|
+
ref,
|
|
958
|
+
className: cn("sv-app-sidebar", className),
|
|
959
|
+
id: panelId,
|
|
960
|
+
...props,
|
|
961
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "sv-app-sidebar__body", children })
|
|
962
|
+
}
|
|
963
|
+
);
|
|
964
|
+
}
|
|
965
|
+
);
|
|
966
|
+
SidebarPanel.displayName = "SidebarPanel";
|
|
967
|
+
var SidebarTrigger = (0, import_react5.forwardRef)(
|
|
968
|
+
function SidebarTrigger2({ className, label, children, onClick, ...props }, ref) {
|
|
969
|
+
const { open, toggle, collapsible, panelId, triggerRef } = useSidebar();
|
|
970
|
+
if (collapsible === "none") {
|
|
971
|
+
return null;
|
|
972
|
+
}
|
|
973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
974
|
+
"button",
|
|
975
|
+
{
|
|
976
|
+
ref: composeRefs(ref, triggerRef),
|
|
977
|
+
type: "button",
|
|
978
|
+
...props,
|
|
979
|
+
className: cn("sv-app-sidebar-trigger", className),
|
|
980
|
+
"aria-expanded": open,
|
|
981
|
+
"aria-controls": panelId,
|
|
982
|
+
"aria-label": label || "Toggle sidebar",
|
|
983
|
+
onClick: (event) => {
|
|
984
|
+
onClick?.(event);
|
|
985
|
+
toggle();
|
|
986
|
+
},
|
|
987
|
+
children: children || /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "menu" })
|
|
988
|
+
}
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
);
|
|
992
|
+
SidebarTrigger.displayName = "SidebarTrigger";
|
|
993
|
+
var SidebarInset = (0, import_react5.forwardRef)(
|
|
994
|
+
function SidebarInset2({ className, ...props }, ref) {
|
|
995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("main", { ref, className: cn("sv-app-sidebar-inset", className), ...props });
|
|
996
|
+
}
|
|
997
|
+
);
|
|
998
|
+
SidebarInset.displayName = "SidebarInset";
|
|
999
|
+
|
|
1000
|
+
// src/components/ui/dialog.tsx
|
|
1001
|
+
var React3 = __toESM(require("react"), 1);
|
|
1002
|
+
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
1003
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1004
|
+
var Dialog2 = DialogPrimitive.Root;
|
|
566
1005
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
567
1006
|
var DialogPortal = DialogPrimitive.Portal;
|
|
568
1007
|
var DialogClose = DialogPrimitive.Close;
|
|
569
|
-
var DialogOverlay =
|
|
1008
|
+
var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
570
1009
|
DialogPrimitive.Overlay,
|
|
571
1010
|
{
|
|
572
1011
|
ref,
|
|
@@ -575,37 +1014,40 @@ var DialogOverlay = React2.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
575
1014
|
}
|
|
576
1015
|
));
|
|
577
1016
|
DialogOverlay.displayName = "DialogOverlay";
|
|
578
|
-
var DialogContent =
|
|
579
|
-
|
|
580
|
-
/* @__PURE__ */ (0,
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
/* @__PURE__ */ (0,
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
1017
|
+
var DialogContent = React3.forwardRef(({ className, children, showCloseButton = true, closeLabel: closeLabelProp, ...props }, ref) => {
|
|
1018
|
+
const closeLabel = closeLabelProp && closeLabelProp.trim().length > 0 ? closeLabelProp : "Close dialog";
|
|
1019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogPortal, { children: [
|
|
1020
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogOverlay, {}),
|
|
1021
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1022
|
+
DialogPrimitive.Content,
|
|
1023
|
+
{
|
|
1024
|
+
ref,
|
|
1025
|
+
className: cn("sv-dialog", className),
|
|
1026
|
+
...props,
|
|
1027
|
+
"aria-modal": "true",
|
|
1028
|
+
children: [
|
|
1029
|
+
children,
|
|
1030
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogPrimitive.Close, { className: "sv-dialog__close", children: [
|
|
1031
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: "x" }),
|
|
1032
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "sv-sr-only", children: closeLabel })
|
|
1033
|
+
] }) : null
|
|
1034
|
+
]
|
|
1035
|
+
}
|
|
1036
|
+
)
|
|
1037
|
+
] });
|
|
1038
|
+
});
|
|
597
1039
|
DialogContent.displayName = "DialogContent";
|
|
598
1040
|
var DialogHeader = ({
|
|
599
1041
|
className,
|
|
600
1042
|
...props
|
|
601
|
-
}) => /* @__PURE__ */ (0,
|
|
1043
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: cn("sv-dialog__header", className), ...props });
|
|
602
1044
|
DialogHeader.displayName = "DialogHeader";
|
|
603
1045
|
var DialogFooter = ({
|
|
604
1046
|
className,
|
|
605
1047
|
...props
|
|
606
|
-
}) => /* @__PURE__ */ (0,
|
|
1048
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: cn("sv-dialog__footer", className), ...props });
|
|
607
1049
|
DialogFooter.displayName = "DialogFooter";
|
|
608
|
-
var DialogTitle =
|
|
1050
|
+
var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
609
1051
|
DialogPrimitive.Title,
|
|
610
1052
|
{
|
|
611
1053
|
ref,
|
|
@@ -614,7 +1056,7 @@ var DialogTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
614
1056
|
}
|
|
615
1057
|
));
|
|
616
1058
|
DialogTitle.displayName = "DialogTitle";
|
|
617
|
-
var DialogDescription =
|
|
1059
|
+
var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
618
1060
|
DialogPrimitive.Description,
|
|
619
1061
|
{
|
|
620
1062
|
ref,
|
|
@@ -625,13 +1067,13 @@ var DialogDescription = React2.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
625
1067
|
DialogDescription.displayName = "DialogDescription";
|
|
626
1068
|
|
|
627
1069
|
// src/components/ui/alert-dialog.tsx
|
|
628
|
-
var
|
|
1070
|
+
var React4 = __toESM(require("react"), 1);
|
|
629
1071
|
var AlertDialogPrimitive = __toESM(require("@radix-ui/react-alert-dialog"), 1);
|
|
630
|
-
var
|
|
1072
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
631
1073
|
var AlertDialog = AlertDialogPrimitive.Root;
|
|
632
1074
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
633
1075
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
634
|
-
var AlertDialogOverlay =
|
|
1076
|
+
var AlertDialogOverlay = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
635
1077
|
AlertDialogPrimitive.Overlay,
|
|
636
1078
|
{
|
|
637
1079
|
ref,
|
|
@@ -640,9 +1082,9 @@ var AlertDialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /*
|
|
|
640
1082
|
}
|
|
641
1083
|
));
|
|
642
1084
|
AlertDialogOverlay.displayName = "AlertDialogOverlay";
|
|
643
|
-
var AlertDialogContent =
|
|
644
|
-
/* @__PURE__ */ (0,
|
|
645
|
-
/* @__PURE__ */ (0,
|
|
1085
|
+
var AlertDialogContent = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(AlertDialogPortal, { children: [
|
|
1086
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AlertDialogOverlay, {}),
|
|
1087
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
646
1088
|
AlertDialogPrimitive.Content,
|
|
647
1089
|
{
|
|
648
1090
|
ref,
|
|
@@ -656,14 +1098,14 @@ AlertDialogContent.displayName = "AlertDialogContent";
|
|
|
656
1098
|
var AlertDialogHeader = ({
|
|
657
1099
|
className,
|
|
658
1100
|
...props
|
|
659
|
-
}) => /* @__PURE__ */ (0,
|
|
1101
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: cn("sv-dialog__header", className), ...props });
|
|
660
1102
|
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
661
1103
|
var AlertDialogFooter = ({
|
|
662
1104
|
className,
|
|
663
1105
|
...props
|
|
664
|
-
}) => /* @__PURE__ */ (0,
|
|
1106
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: cn("sv-dialog__footer", className), ...props });
|
|
665
1107
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
666
|
-
var AlertDialogTitle =
|
|
1108
|
+
var AlertDialogTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
667
1109
|
AlertDialogPrimitive.Title,
|
|
668
1110
|
{
|
|
669
1111
|
ref,
|
|
@@ -672,7 +1114,7 @@ var AlertDialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
672
1114
|
}
|
|
673
1115
|
));
|
|
674
1116
|
AlertDialogTitle.displayName = "AlertDialogTitle";
|
|
675
|
-
var AlertDialogDescription =
|
|
1117
|
+
var AlertDialogDescription = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
676
1118
|
AlertDialogPrimitive.Description,
|
|
677
1119
|
{
|
|
678
1120
|
ref,
|
|
@@ -681,7 +1123,7 @@ var AlertDialogDescription = React3.forwardRef(({ className, ...props }, ref) =>
|
|
|
681
1123
|
}
|
|
682
1124
|
));
|
|
683
1125
|
AlertDialogDescription.displayName = "AlertDialogDescription";
|
|
684
|
-
var AlertDialogAction =
|
|
1126
|
+
var AlertDialogAction = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
685
1127
|
AlertDialogPrimitive.Action,
|
|
686
1128
|
{
|
|
687
1129
|
ref,
|
|
@@ -690,7 +1132,7 @@ var AlertDialogAction = React3.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
690
1132
|
}
|
|
691
1133
|
));
|
|
692
1134
|
AlertDialogAction.displayName = "AlertDialogAction";
|
|
693
|
-
var AlertDialogCancel =
|
|
1135
|
+
var AlertDialogCancel = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
694
1136
|
AlertDialogPrimitive.Cancel,
|
|
695
1137
|
{
|
|
696
1138
|
ref,
|
|
@@ -701,19 +1143,19 @@ var AlertDialogCancel = React3.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
701
1143
|
AlertDialogCancel.displayName = "AlertDialogCancel";
|
|
702
1144
|
|
|
703
1145
|
// src/components/ui/select.tsx
|
|
704
|
-
var
|
|
1146
|
+
var React5 = __toESM(require("react"), 1);
|
|
705
1147
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
|
|
706
|
-
var
|
|
1148
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
707
1149
|
var Select = SelectPrimitive.Root;
|
|
708
1150
|
var SelectGroup = SelectPrimitive.Group;
|
|
709
1151
|
var SelectValue = SelectPrimitive.Value;
|
|
710
|
-
var SelectTrigger =
|
|
711
|
-
({ className, children, icon = /* @__PURE__ */ (0,
|
|
1152
|
+
var SelectTrigger = React5.forwardRef(
|
|
1153
|
+
({ className, children, icon = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: "chevron-down" }), ...props }, ref) => (
|
|
712
1154
|
// The trigger IS a form field, so it shares .sv-field with Input, Textarea
|
|
713
1155
|
// and NativeSelect rather than restating the frame. The utility string this
|
|
714
1156
|
// replaces named `ring-offset-background` and `focus:ring-accent`, neither
|
|
715
1157
|
// of which this package ever declared: the field had no visible focus.
|
|
716
|
-
/* @__PURE__ */ (0,
|
|
1158
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
717
1159
|
SelectPrimitive.Trigger,
|
|
718
1160
|
{
|
|
719
1161
|
ref,
|
|
@@ -721,34 +1163,34 @@ var SelectTrigger = React4.forwardRef(
|
|
|
721
1163
|
...props,
|
|
722
1164
|
children: [
|
|
723
1165
|
children,
|
|
724
|
-
icon === null ? null : /* @__PURE__ */ (0,
|
|
1166
|
+
icon === null ? null : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectPrimitive.Icon, { children: icon })
|
|
725
1167
|
]
|
|
726
1168
|
}
|
|
727
1169
|
)
|
|
728
1170
|
)
|
|
729
1171
|
);
|
|
730
1172
|
SelectTrigger.displayName = "SelectTrigger";
|
|
731
|
-
var SelectScrollUpButton =
|
|
1173
|
+
var SelectScrollUpButton = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
732
1174
|
SelectPrimitive.ScrollUpButton,
|
|
733
1175
|
{
|
|
734
1176
|
ref,
|
|
735
1177
|
className: cn("sv-pop__scroll", className),
|
|
736
1178
|
...props,
|
|
737
|
-
children: /* @__PURE__ */ (0,
|
|
1179
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: "chevron-up" })
|
|
738
1180
|
}
|
|
739
1181
|
));
|
|
740
1182
|
SelectScrollUpButton.displayName = "SelectScrollUpButton";
|
|
741
|
-
var SelectScrollDownButton =
|
|
1183
|
+
var SelectScrollDownButton = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
742
1184
|
SelectPrimitive.ScrollDownButton,
|
|
743
1185
|
{
|
|
744
1186
|
ref,
|
|
745
1187
|
className: cn("sv-pop__scroll", className),
|
|
746
1188
|
...props,
|
|
747
|
-
children: /* @__PURE__ */ (0,
|
|
1189
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: "chevron-down" })
|
|
748
1190
|
}
|
|
749
1191
|
));
|
|
750
1192
|
SelectScrollDownButton.displayName = "SelectScrollDownButton";
|
|
751
|
-
var SelectContent =
|
|
1193
|
+
var SelectContent = React5.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
752
1194
|
SelectPrimitive.Content,
|
|
753
1195
|
{
|
|
754
1196
|
ref,
|
|
@@ -756,8 +1198,8 @@ var SelectContent = React4.forwardRef(({ className, children, position = "popper
|
|
|
756
1198
|
position,
|
|
757
1199
|
...props,
|
|
758
1200
|
children: [
|
|
759
|
-
/* @__PURE__ */ (0,
|
|
760
|
-
/* @__PURE__ */ (0,
|
|
1201
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectScrollUpButton, {}),
|
|
1202
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
761
1203
|
SelectPrimitive.Viewport,
|
|
762
1204
|
{
|
|
763
1205
|
className: cn(
|
|
@@ -767,25 +1209,25 @@ var SelectContent = React4.forwardRef(({ className, children, position = "popper
|
|
|
767
1209
|
children
|
|
768
1210
|
}
|
|
769
1211
|
),
|
|
770
|
-
/* @__PURE__ */ (0,
|
|
1212
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectScrollDownButton, {})
|
|
771
1213
|
]
|
|
772
1214
|
}
|
|
773
1215
|
) }));
|
|
774
1216
|
SelectContent.displayName = "SelectContent";
|
|
775
|
-
var SelectItem =
|
|
1217
|
+
var SelectItem = React5.forwardRef(({ className, children, icon = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { name: "check" }), ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
776
1218
|
SelectPrimitive.Item,
|
|
777
1219
|
{
|
|
778
1220
|
ref,
|
|
779
1221
|
className: cn("sv-menu-item", className),
|
|
780
1222
|
...props,
|
|
781
1223
|
children: [
|
|
782
|
-
icon === null ? null : /* @__PURE__ */ (0,
|
|
783
|
-
/* @__PURE__ */ (0,
|
|
1224
|
+
icon === null ? null : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectPrimitive.ItemIndicator, { className: "sv-menu-item__indicator", children: icon }),
|
|
1225
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SelectPrimitive.ItemText, { children })
|
|
784
1226
|
]
|
|
785
1227
|
}
|
|
786
1228
|
));
|
|
787
1229
|
SelectItem.displayName = "SelectItem";
|
|
788
|
-
var SelectLabel =
|
|
1230
|
+
var SelectLabel = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
789
1231
|
SelectPrimitive.Label,
|
|
790
1232
|
{
|
|
791
1233
|
ref,
|
|
@@ -794,7 +1236,7 @@ var SelectLabel = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
794
1236
|
}
|
|
795
1237
|
));
|
|
796
1238
|
SelectLabel.displayName = "SelectLabel";
|
|
797
|
-
var SelectSeparator =
|
|
1239
|
+
var SelectSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
798
1240
|
SelectPrimitive.Separator,
|
|
799
1241
|
{
|
|
800
1242
|
ref,
|
|
@@ -805,17 +1247,17 @@ var SelectSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
805
1247
|
SelectSeparator.displayName = "SelectSeparator";
|
|
806
1248
|
|
|
807
1249
|
// src/components/ui/dropdown-menu.tsx
|
|
808
|
-
var
|
|
1250
|
+
var React6 = __toESM(require("react"), 1);
|
|
809
1251
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
810
|
-
var
|
|
1252
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
811
1253
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
812
1254
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
813
1255
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
814
1256
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
815
1257
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
816
1258
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
817
|
-
var DropdownMenuSubTrigger =
|
|
818
|
-
({ className, inset, children, icon = /* @__PURE__ */ (0,
|
|
1259
|
+
var DropdownMenuSubTrigger = React6.forwardRef(
|
|
1260
|
+
({ className, inset, children, icon = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "chevron-right" }), ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
819
1261
|
DropdownMenuPrimitive.SubTrigger,
|
|
820
1262
|
{
|
|
821
1263
|
ref,
|
|
@@ -829,7 +1271,7 @@ var DropdownMenuSubTrigger = React5.forwardRef(
|
|
|
829
1271
|
)
|
|
830
1272
|
);
|
|
831
1273
|
DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
|
|
832
|
-
var DropdownMenuSubContent =
|
|
1274
|
+
var DropdownMenuSubContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
833
1275
|
DropdownMenuPrimitive.SubContent,
|
|
834
1276
|
{
|
|
835
1277
|
ref,
|
|
@@ -838,7 +1280,7 @@ var DropdownMenuSubContent = React5.forwardRef(({ className, ...props }, ref) =>
|
|
|
838
1280
|
}
|
|
839
1281
|
));
|
|
840
1282
|
DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
|
|
841
|
-
var DropdownMenuContent =
|
|
1283
|
+
var DropdownMenuContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
842
1284
|
DropdownMenuPrimitive.Content,
|
|
843
1285
|
{
|
|
844
1286
|
ref,
|
|
@@ -847,7 +1289,7 @@ var DropdownMenuContent = React5.forwardRef(({ className, ...props }, ref) => /*
|
|
|
847
1289
|
}
|
|
848
1290
|
) }));
|
|
849
1291
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
850
|
-
var DropdownMenuItem =
|
|
1292
|
+
var DropdownMenuItem = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
851
1293
|
DropdownMenuPrimitive.Item,
|
|
852
1294
|
{
|
|
853
1295
|
ref,
|
|
@@ -856,35 +1298,35 @@ var DropdownMenuItem = React5.forwardRef(({ className, inset, ...props }, ref) =
|
|
|
856
1298
|
}
|
|
857
1299
|
));
|
|
858
1300
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
859
|
-
var DropdownMenuCheckboxItem =
|
|
1301
|
+
var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, icon = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "check" }), ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
860
1302
|
DropdownMenuPrimitive.CheckboxItem,
|
|
861
1303
|
{
|
|
862
1304
|
ref,
|
|
863
1305
|
className: cn("sv-menu-item", className),
|
|
864
1306
|
...props,
|
|
865
1307
|
children: [
|
|
866
|
-
icon === null ? null : /* @__PURE__ */ (0,
|
|
1308
|
+
icon === null ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownMenuPrimitive.ItemIndicator, { className: "sv-menu-item__indicator", children: icon }),
|
|
867
1309
|
children
|
|
868
1310
|
]
|
|
869
1311
|
}
|
|
870
1312
|
));
|
|
871
1313
|
DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
|
|
872
|
-
var DropdownMenuRadioItem =
|
|
873
|
-
({ className, children, icon = /* @__PURE__ */ (0,
|
|
1314
|
+
var DropdownMenuRadioItem = React6.forwardRef(
|
|
1315
|
+
({ className, children, icon = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "sv-menu-item__dot" }), ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
874
1316
|
DropdownMenuPrimitive.RadioItem,
|
|
875
1317
|
{
|
|
876
1318
|
ref,
|
|
877
1319
|
className: cn("sv-menu-item", className),
|
|
878
1320
|
...props,
|
|
879
1321
|
children: [
|
|
880
|
-
icon === null ? null : /* @__PURE__ */ (0,
|
|
1322
|
+
icon === null ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownMenuPrimitive.ItemIndicator, { className: "sv-menu-item__indicator", children: icon }),
|
|
881
1323
|
children
|
|
882
1324
|
]
|
|
883
1325
|
}
|
|
884
1326
|
)
|
|
885
1327
|
);
|
|
886
1328
|
DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
|
|
887
|
-
var DropdownMenuLabel =
|
|
1329
|
+
var DropdownMenuLabel = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
888
1330
|
DropdownMenuPrimitive.Label,
|
|
889
1331
|
{
|
|
890
1332
|
ref,
|
|
@@ -893,7 +1335,7 @@ var DropdownMenuLabel = React5.forwardRef(({ className, inset, ...props }, ref)
|
|
|
893
1335
|
}
|
|
894
1336
|
));
|
|
895
1337
|
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
896
|
-
var DropdownMenuSeparator =
|
|
1338
|
+
var DropdownMenuSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
897
1339
|
DropdownMenuPrimitive.Separator,
|
|
898
1340
|
{
|
|
899
1341
|
ref,
|
|
@@ -905,14 +1347,14 @@ DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
|
905
1347
|
var DropdownMenuShortcut = ({
|
|
906
1348
|
className,
|
|
907
1349
|
...props
|
|
908
|
-
}) => /* @__PURE__ */ (0,
|
|
1350
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: cn("sv-menu-shortcut", className), ...props });
|
|
909
1351
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
910
1352
|
|
|
911
1353
|
// src/components/ui/tabs.tsx
|
|
912
|
-
var
|
|
1354
|
+
var React7 = __toESM(require("react"), 1);
|
|
913
1355
|
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
914
|
-
var
|
|
915
|
-
var Tabs =
|
|
1356
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1357
|
+
var Tabs = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
916
1358
|
TabsPrimitive.Root,
|
|
917
1359
|
{
|
|
918
1360
|
ref,
|
|
@@ -921,7 +1363,7 @@ var Tabs = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (
|
|
|
921
1363
|
}
|
|
922
1364
|
));
|
|
923
1365
|
Tabs.displayName = "Tabs";
|
|
924
|
-
var TabsList =
|
|
1366
|
+
var TabsList = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
925
1367
|
TabsPrimitive.List,
|
|
926
1368
|
{
|
|
927
1369
|
ref,
|
|
@@ -930,7 +1372,7 @@ var TabsList = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
930
1372
|
}
|
|
931
1373
|
));
|
|
932
1374
|
TabsList.displayName = "TabsList";
|
|
933
|
-
var TabsTrigger =
|
|
1375
|
+
var TabsTrigger = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
934
1376
|
TabsPrimitive.Trigger,
|
|
935
1377
|
{
|
|
936
1378
|
ref,
|
|
@@ -939,7 +1381,7 @@ var TabsTrigger = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
939
1381
|
}
|
|
940
1382
|
));
|
|
941
1383
|
TabsTrigger.displayName = "TabsTrigger";
|
|
942
|
-
var TabsContent =
|
|
1384
|
+
var TabsContent = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
943
1385
|
TabsPrimitive.Content,
|
|
944
1386
|
{
|
|
945
1387
|
ref,
|
|
@@ -950,13 +1392,13 @@ var TabsContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
950
1392
|
TabsContent.displayName = "TabsContent";
|
|
951
1393
|
|
|
952
1394
|
// src/components/ui/tooltip.tsx
|
|
953
|
-
var
|
|
1395
|
+
var React8 = __toESM(require("react"), 1);
|
|
954
1396
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
955
|
-
var
|
|
1397
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
956
1398
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
957
1399
|
var Tooltip = TooltipPrimitive.Root;
|
|
958
1400
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
959
|
-
var TooltipContent =
|
|
1401
|
+
var TooltipContent = React8.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
960
1402
|
TooltipPrimitive.Content,
|
|
961
1403
|
{
|
|
962
1404
|
ref,
|
|
@@ -1017,6 +1459,10 @@ TooltipContent.displayName = "TooltipContent";
|
|
|
1017
1459
|
SelectSeparator,
|
|
1018
1460
|
SelectTrigger,
|
|
1019
1461
|
SelectValue,
|
|
1462
|
+
SidebarInset,
|
|
1463
|
+
SidebarPanel,
|
|
1464
|
+
SidebarProvider,
|
|
1465
|
+
SidebarTrigger,
|
|
1020
1466
|
TableOfContents,
|
|
1021
1467
|
Tabs,
|
|
1022
1468
|
TabsContent,
|
|
@@ -1024,16 +1470,21 @@ TooltipContent.displayName = "TooltipContent";
|
|
|
1024
1470
|
TabsTrigger,
|
|
1025
1471
|
ThemeProvider,
|
|
1026
1472
|
ThemeToggle,
|
|
1473
|
+
ToastProvider,
|
|
1027
1474
|
Tooltip,
|
|
1028
1475
|
TooltipContent,
|
|
1029
1476
|
TooltipProvider,
|
|
1030
1477
|
TooltipTrigger,
|
|
1031
1478
|
copyToClipboard,
|
|
1479
|
+
createMediaQuery,
|
|
1032
1480
|
createReadingProgress,
|
|
1033
1481
|
createScrollSpy,
|
|
1034
1482
|
createThemeManager,
|
|
1483
|
+
useMediaQuery,
|
|
1035
1484
|
useReadingProgress,
|
|
1036
1485
|
useScrollSpy,
|
|
1037
|
-
|
|
1486
|
+
useSidebar,
|
|
1487
|
+
useTheme,
|
|
1488
|
+
useToast
|
|
1038
1489
|
});
|
|
1039
1490
|
//# sourceMappingURL=index.cjs.map
|