@admin-layout/tailwind-ui 10.1.1-alpha.9 → 12.0.16-alpha.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/lib/components/Button/Button.d.ts +13 -0
- package/lib/components/Button/Button.d.ts.map +1 -0
- package/lib/components/Button/Button.js +50 -0
- package/lib/components/Button/Button.js.map +1 -0
- package/lib/components/DatePicker/DatePicker.d.ts +5 -0
- package/lib/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/lib/components/DatePicker/DatePicker.js +218 -0
- package/lib/components/DatePicker/DatePicker.js.map +1 -0
- package/lib/components/DatePicker/index.d.ts +3 -0
- package/lib/components/DatePicker/index.d.ts.map +1 -0
- package/lib/components/DatePicker/machine.d.ts +3 -0
- package/lib/components/DatePicker/machine.d.ts.map +1 -0
- package/lib/components/DatePicker/machine.js +95 -0
- package/lib/components/DatePicker/machine.js.map +1 -0
- package/lib/components/DatePicker/types.d.ts +34 -0
- package/lib/components/DatePicker/types.d.ts.map +1 -0
- package/lib/components/DatePicker/utils.d.ts +25 -0
- package/lib/components/DatePicker/utils.d.ts.map +1 -0
- package/lib/components/DatePicker/utils.js +28 -0
- package/lib/components/DatePicker/utils.js.map +1 -0
- package/lib/components/ThemeProvider/ThemeProvider.d.ts +14 -0
- package/lib/components/ThemeProvider/ThemeProvider.d.ts.map +1 -0
- package/lib/components/ThemeProvider/ThemeProvider.js +96 -0
- package/lib/components/ThemeProvider/ThemeProvider.js.map +1 -0
- package/lib/components/ThemeProvider/ThemeToggle.d.ts +7 -0
- package/lib/components/ThemeProvider/ThemeToggle.d.ts.map +1 -0
- package/lib/components/ThemeProvider/ThemeToggle.js +50 -0
- package/lib/components/ThemeProvider/ThemeToggle.js.map +1 -0
- package/lib/components/ThemeProvider/index.d.ts +4 -0
- package/lib/components/ThemeProvider/index.d.ts.map +1 -0
- package/lib/components/ThemeProvider/types.d.ts +25 -0
- package/lib/components/ThemeProvider/types.d.ts.map +1 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/hooks/useTheme.d.ts +2 -0
- package/lib/hooks/useTheme.d.ts.map +1 -0
- package/lib/hooks/useTheme.js +7 -0
- package/lib/hooks/useTheme.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/shardui/accordion.d.ts +8 -0
- package/lib/shardui/accordion.d.ts.map +1 -0
- package/lib/shardui/accordion.js +40 -0
- package/lib/shardui/accordion.js.map +1 -0
- package/lib/shardui/alert-dialog.d.ts +21 -0
- package/lib/shardui/alert-dialog.d.ts.map +1 -0
- package/lib/shardui/alert-dialog.js +77 -0
- package/lib/shardui/alert-dialog.js.map +1 -0
- package/lib/shardui/alert.d.ts +9 -0
- package/lib/shardui/alert.d.ts.map +1 -0
- package/lib/shardui/alert.js +42 -0
- package/lib/shardui/alert.js.map +1 -0
- package/lib/shardui/aspect-ratio.d.ts +4 -0
- package/lib/shardui/aspect-ratio.d.ts.map +1 -0
- package/lib/shardui/aspect-ratio.js +1 -0
- package/lib/shardui/aspect-ratio.js.map +1 -0
- package/lib/shardui/avatar.d.ts +7 -0
- package/lib/shardui/avatar.d.ts.map +1 -0
- package/lib/shardui/avatar.js +27 -0
- package/lib/shardui/avatar.js.map +1 -0
- package/lib/shardui/badge.d.ts +10 -0
- package/lib/shardui/badge.d.ts.map +1 -0
- package/lib/shardui/badge.js +25 -0
- package/lib/shardui/badge.js.map +1 -0
- package/lib/shardui/breadcrumb.d.ts +20 -0
- package/lib/shardui/breadcrumb.d.ts.map +1 -0
- package/lib/shardui/breadcrumb.js +79 -0
- package/lib/shardui/breadcrumb.js.map +1 -0
- package/lib/shardui/button.d.ts +12 -0
- package/lib/shardui/button.d.ts.map +1 -0
- package/lib/shardui/button.js +41 -0
- package/lib/shardui/button.js.map +1 -0
- package/lib/shardui/calendar.d.ts +9 -0
- package/lib/shardui/calendar.d.ts.map +1 -0
- package/lib/shardui/calendar.js +53 -0
- package/lib/shardui/calendar.js.map +1 -0
- package/lib/shardui/card.d.ts +9 -0
- package/lib/shardui/card.d.ts.map +1 -0
- package/lib/shardui/card.js +54 -0
- package/lib/shardui/card.js.map +1 -0
- package/lib/shardui/carousel.d.ts +19 -0
- package/lib/shardui/carousel.d.ts.map +1 -0
- package/lib/shardui/carousel.js +176 -0
- package/lib/shardui/carousel.js.map +1 -0
- package/lib/shardui/chart.d.ts +63 -0
- package/lib/shardui/chart.d.ts.map +1 -0
- package/lib/shardui/chart.js +197 -0
- package/lib/shardui/chart.js.map +1 -0
- package/lib/shardui/checkbox.d.ts +5 -0
- package/lib/shardui/checkbox.d.ts.map +1 -0
- package/lib/shardui/checkbox.js +15 -0
- package/lib/shardui/checkbox.js.map +1 -0
- package/lib/shardui/collapsible.d.ts +6 -0
- package/lib/shardui/collapsible.d.ts.map +1 -0
- package/lib/shardui/collapsible.js +3 -0
- package/lib/shardui/collapsible.js.map +1 -0
- package/lib/shardui/command.d.ts +83 -0
- package/lib/shardui/command.d.ts.map +1 -0
- package/lib/shardui/command.js +91 -0
- package/lib/shardui/command.js.map +1 -0
- package/lib/shardui/context-menu.d.ts +28 -0
- package/lib/shardui/context-menu.d.ts.map +1 -0
- package/lib/shardui/context-menu.js +117 -0
- package/lib/shardui/context-menu.js.map +1 -0
- package/lib/shardui/dialog.d.ts +20 -0
- package/lib/shardui/dialog.d.ts.map +1 -0
- package/lib/shardui/dialog.js +67 -0
- package/lib/shardui/dialog.js.map +1 -0
- package/lib/shardui/drawer.d.ts +23 -0
- package/lib/shardui/drawer.d.ts.map +1 -0
- package/lib/shardui/drawer.js +69 -0
- package/lib/shardui/drawer.js.map +1 -0
- package/lib/shardui/dropdown-menu.d.ts +28 -0
- package/lib/shardui/dropdown-menu.d.ts.map +1 -0
- package/lib/shardui/dropdown-menu.js +119 -0
- package/lib/shardui/dropdown-menu.js.map +1 -0
- package/lib/shardui/form.d.ts +24 -0
- package/lib/shardui/form.d.ts.map +1 -0
- package/lib/shardui/form.js +126 -0
- package/lib/shardui/form.js.map +1 -0
- package/lib/shardui/hover-card.d.ts +7 -0
- package/lib/shardui/hover-card.d.ts.map +1 -0
- package/lib/shardui/hover-card.js +15 -0
- package/lib/shardui/hover-card.js.map +1 -0
- package/lib/shardui/index.d.ts +50 -0
- package/lib/shardui/index.d.ts.map +1 -0
- package/lib/shardui/input-otp.d.ts +35 -0
- package/lib/shardui/input-otp.d.ts.map +1 -0
- package/lib/shardui/input-otp.js +53 -0
- package/lib/shardui/input-otp.js.map +1 -0
- package/lib/shardui/input.d.ts +4 -0
- package/lib/shardui/input.d.ts.map +1 -0
- package/lib/shardui/input.js +13 -0
- package/lib/shardui/input.js.map +1 -0
- package/lib/shardui/label.d.ts +6 -0
- package/lib/shardui/label.d.ts.map +1 -0
- package/lib/shardui/label.js +10 -0
- package/lib/shardui/label.js.map +1 -0
- package/lib/shardui/menubar.d.ts +34 -0
- package/lib/shardui/menubar.d.ts.map +1 -0
- package/lib/shardui/menubar.js +140 -0
- package/lib/shardui/menubar.js.map +1 -0
- package/lib/shardui/navigation-menu.d.ts +13 -0
- package/lib/shardui/navigation-menu.d.ts.map +1 -0
- package/lib/shardui/navigation-menu.js +70 -0
- package/lib/shardui/navigation-menu.js.map +1 -0
- package/lib/shardui/pagination.d.ts +29 -0
- package/lib/shardui/pagination.d.ts.map +1 -0
- package/lib/shardui/pagination.js +87 -0
- package/lib/shardui/pagination.js.map +1 -0
- package/lib/shardui/popover.d.ts +7 -0
- package/lib/shardui/popover.d.ts.map +1 -0
- package/lib/shardui/popover.js +17 -0
- package/lib/shardui/popover.js.map +1 -0
- package/lib/shardui/progress.d.ts +5 -0
- package/lib/shardui/progress.d.ts.map +1 -0
- package/lib/shardui/progress.js +16 -0
- package/lib/shardui/progress.js.map +1 -0
- package/lib/shardui/radio-group.d.ts +6 -0
- package/lib/shardui/radio-group.d.ts.map +1 -0
- package/lib/shardui/radio-group.js +28 -0
- package/lib/shardui/radio-group.js.map +1 -0
- package/lib/shardui/resizable.d.ts +24 -0
- package/lib/shardui/resizable.d.ts.map +1 -0
- package/lib/shardui/resizable.js +22 -0
- package/lib/shardui/resizable.js.map +1 -0
- package/lib/shardui/scroll-area.d.ts +6 -0
- package/lib/shardui/scroll-area.d.ts.map +1 -0
- package/lib/shardui/scroll-area.js +28 -0
- package/lib/shardui/scroll-area.js.map +1 -0
- package/lib/shardui/select.d.ts +14 -0
- package/lib/shardui/select.d.ts.map +1 -0
- package/lib/shardui/select.js +99 -0
- package/lib/shardui/select.js.map +1 -0
- package/lib/shardui/separator.d.ts +5 -0
- package/lib/shardui/separator.d.ts.map +1 -0
- package/lib/shardui/separator.js +13 -0
- package/lib/shardui/separator.js.map +1 -0
- package/lib/shardui/sheet.d.ts +26 -0
- package/lib/shardui/sheet.d.ts.map +1 -0
- package/lib/shardui/sheet.js +84 -0
- package/lib/shardui/sheet.js.map +1 -0
- package/lib/shardui/sidebar.d.ts +67 -0
- package/lib/shardui/sidebar.d.ts.map +1 -0
- package/lib/shardui/sidebar.js +490 -0
- package/lib/shardui/sidebar.js.map +1 -0
- package/lib/shardui/skeleton.d.ts +3 -0
- package/lib/shardui/skeleton.d.ts.map +1 -0
- package/lib/shardui/skeleton.js +9 -0
- package/lib/shardui/skeleton.js.map +1 -0
- package/lib/shardui/slider.d.ts +5 -0
- package/lib/shardui/slider.d.ts.map +1 -0
- package/lib/shardui/slider.js +17 -0
- package/lib/shardui/slider.js.map +1 -0
- package/lib/shardui/sonner.d.ts +5 -0
- package/lib/shardui/sonner.d.ts.map +1 -0
- package/lib/shardui/sonner.js +20 -0
- package/lib/shardui/sonner.js.map +1 -0
- package/lib/shardui/switch.d.ts +5 -0
- package/lib/shardui/switch.d.ts.map +1 -0
- package/lib/shardui/switch.js +12 -0
- package/lib/shardui/switch.js.map +1 -0
- package/lib/shardui/table.d.ts +11 -0
- package/lib/shardui/table.d.ts.map +1 -0
- package/lib/shardui/table.js +75 -0
- package/lib/shardui/table.js.map +1 -0
- package/lib/shardui/tabs.d.ts +8 -0
- package/lib/shardui/tabs.d.ts.map +1 -0
- package/lib/shardui/tabs.js +28 -0
- package/lib/shardui/tabs.js.map +1 -0
- package/lib/shardui/textarea.d.ts +6 -0
- package/lib/shardui/textarea.d.ts.map +1 -0
- package/lib/shardui/textarea.js +11 -0
- package/lib/shardui/textarea.js.map +1 -0
- package/lib/shardui/toast.d.ts +16 -0
- package/lib/shardui/toast.d.ts.map +1 -0
- package/lib/shardui/toast.js +75 -0
- package/lib/shardui/toast.js.map +1 -0
- package/lib/shardui/toaster.d.ts +2 -0
- package/lib/shardui/toaster.d.ts.map +1 -0
- package/lib/shardui/toaster.js +26 -0
- package/lib/shardui/toaster.js.map +1 -0
- package/lib/shardui/toggle-group.d.ts +13 -0
- package/lib/shardui/toggle-group.d.ts.map +1 -0
- package/lib/shardui/toggle-group.js +42 -0
- package/lib/shardui/toggle-group.js.map +1 -0
- package/lib/shardui/toggle.d.ts +13 -0
- package/lib/shardui/toggle.d.ts.map +1 -0
- package/lib/shardui/toggle.js +32 -0
- package/lib/shardui/toggle.js.map +1 -0
- package/lib/shardui/tooltip.d.ts +8 -0
- package/lib/shardui/tooltip.d.ts.map +1 -0
- package/lib/shardui/tooltip.js +14 -0
- package/lib/shardui/tooltip.js.map +1 -0
- package/lib/shardui/use-toast.d.ts +3 -0
- package/lib/shardui/use-toast.d.ts.map +1 -0
- package/lib/utils/hooks/use-mobile.d.ts +2 -0
- package/lib/utils/hooks/use-mobile.d.ts.map +1 -0
- package/lib/utils/hooks/use-mobile.js +14 -0
- package/lib/utils/hooks/use-mobile.js.map +1 -0
- package/lib/utils/hooks/use-toast.d.ts +45 -0
- package/lib/utils/hooks/use-toast.d.ts.map +1 -0
- package/lib/utils/hooks/use-toast.js +133 -0
- package/lib/utils/hooks/use-toast.js.map +1 -0
- package/lib/utils/index.d.ts +7 -1
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/isBrowser/index.js +1 -0
- package/lib/utils/isBrowser/index.js.map +1 -0
- package/lib/utils/util.d.ts +3 -0
- package/lib/utils/util.d.ts.map +1 -0
- package/lib/utils/util.js +3 -0
- package/lib/utils/util.js.map +1 -0
- package/package.json +7 -3
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import*as React from'react';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {PanelLeft}from'lucide-react';import'../utils/isBrowser/index.js';import {cn}from'../utils/util.js';import'fast-deep-equal/react';import {useIsMobile}from'../utils/hooks/use-mobile.js';import {Button}from'./button.js';import {Input}from'./input.js';import {Separator}from'./separator.js';import {Sheet,SheetContent}from'./sheet.js';import {Skeleton}from'./skeleton.js';import {TooltipProvider,Tooltip,TooltipTrigger,TooltipContent}from'./tooltip.js';const SIDEBAR_COOKIE_NAME = 'sidebar:state';
|
|
2
|
+
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
3
|
+
const SIDEBAR_WIDTH = '16rem';
|
|
4
|
+
const SIDEBAR_WIDTH_MOBILE = '18rem';
|
|
5
|
+
const SIDEBAR_WIDTH_ICON = '3rem';
|
|
6
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
|
|
7
|
+
const SidebarContext = React.createContext(null);
|
|
8
|
+
function useSidebar() {
|
|
9
|
+
const context = React.useContext(SidebarContext);
|
|
10
|
+
if (!context) {
|
|
11
|
+
throw new Error('useSidebar must be used within a SidebarProvider.');
|
|
12
|
+
}
|
|
13
|
+
return context;
|
|
14
|
+
}
|
|
15
|
+
const SidebarProvider = React.forwardRef(({
|
|
16
|
+
defaultOpen = true,
|
|
17
|
+
open: openProp,
|
|
18
|
+
onOpenChange: setOpenProp,
|
|
19
|
+
className,
|
|
20
|
+
style,
|
|
21
|
+
children,
|
|
22
|
+
...props
|
|
23
|
+
}, ref) => {
|
|
24
|
+
const isMobile = useIsMobile();
|
|
25
|
+
const [openMobile, setOpenMobile] = React.useState(false);
|
|
26
|
+
// This is the internal state of the sidebar.
|
|
27
|
+
// We use openProp and setOpenProp for control from outside the component.
|
|
28
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
29
|
+
const open = openProp ?? _open;
|
|
30
|
+
const setOpen = React.useCallback(value => {
|
|
31
|
+
const openState = typeof value === 'function' ? value(open) : value;
|
|
32
|
+
if (setOpenProp) {
|
|
33
|
+
setOpenProp(openState);
|
|
34
|
+
} else {
|
|
35
|
+
_setOpen(openState);
|
|
36
|
+
}
|
|
37
|
+
// This sets the cookie to keep the sidebar state.
|
|
38
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
39
|
+
}, [setOpenProp, open]);
|
|
40
|
+
// Helper to toggle the sidebar.
|
|
41
|
+
const toggleSidebar = React.useCallback(() => {
|
|
42
|
+
return isMobile ? setOpenMobile(open => !open) : setOpen(open => !open);
|
|
43
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
44
|
+
// Adds a keyboard shortcut to toggle the sidebar.
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
const handleKeyDown = event => {
|
|
47
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
toggleSidebar();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
53
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
54
|
+
}, [toggleSidebar]);
|
|
55
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
56
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
57
|
+
const state = open ? 'expanded' : 'collapsed';
|
|
58
|
+
const contextValue = React.useMemo(() => ({
|
|
59
|
+
state,
|
|
60
|
+
open,
|
|
61
|
+
setOpen,
|
|
62
|
+
isMobile,
|
|
63
|
+
openMobile,
|
|
64
|
+
setOpenMobile,
|
|
65
|
+
toggleSidebar
|
|
66
|
+
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
|
|
67
|
+
return jsx(SidebarContext.Provider, {
|
|
68
|
+
value: contextValue,
|
|
69
|
+
children: jsx(TooltipProvider, {
|
|
70
|
+
delayDuration: 0,
|
|
71
|
+
children: jsx("div", {
|
|
72
|
+
style: {
|
|
73
|
+
'--sidebar-width': SIDEBAR_WIDTH,
|
|
74
|
+
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
|
|
75
|
+
...style
|
|
76
|
+
},
|
|
77
|
+
className: cn('group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar', className),
|
|
78
|
+
ref: ref,
|
|
79
|
+
...props,
|
|
80
|
+
children: children
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
SidebarProvider.displayName = 'SidebarProvider';
|
|
86
|
+
const Sidebar = React.forwardRef(({
|
|
87
|
+
side = 'left',
|
|
88
|
+
variant = 'sidebar',
|
|
89
|
+
collapsible = 'offcanvas',
|
|
90
|
+
className,
|
|
91
|
+
children,
|
|
92
|
+
...props
|
|
93
|
+
}, ref) => {
|
|
94
|
+
const {
|
|
95
|
+
isMobile,
|
|
96
|
+
state,
|
|
97
|
+
openMobile,
|
|
98
|
+
setOpenMobile
|
|
99
|
+
} = useSidebar();
|
|
100
|
+
if (collapsible === 'none') {
|
|
101
|
+
return jsx("div", {
|
|
102
|
+
className: cn('flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground', className),
|
|
103
|
+
ref: ref,
|
|
104
|
+
...props,
|
|
105
|
+
children: children
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
if (isMobile) {
|
|
109
|
+
return jsx(Sheet, {
|
|
110
|
+
open: openMobile,
|
|
111
|
+
onOpenChange: setOpenMobile,
|
|
112
|
+
...props,
|
|
113
|
+
children: jsx(SheetContent, {
|
|
114
|
+
"data-sidebar": "sidebar",
|
|
115
|
+
"data-mobile": "true",
|
|
116
|
+
className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
|
|
117
|
+
style: {
|
|
118
|
+
'--sidebar-width': SIDEBAR_WIDTH_MOBILE
|
|
119
|
+
},
|
|
120
|
+
side: side,
|
|
121
|
+
children: jsx("div", {
|
|
122
|
+
className: "flex h-full w-full flex-col",
|
|
123
|
+
children: children
|
|
124
|
+
})
|
|
125
|
+
})
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return jsxs("div", {
|
|
129
|
+
ref: ref,
|
|
130
|
+
className: "group peer hidden md:block text-sidebar-foreground",
|
|
131
|
+
"data-state": state,
|
|
132
|
+
"data-collapsible": state === 'collapsed' ? collapsible : '',
|
|
133
|
+
"data-variant": variant,
|
|
134
|
+
"data-side": side,
|
|
135
|
+
children: [jsx("div", {
|
|
136
|
+
className: cn('duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear', 'group-data-[collapsible=offcanvas]:w-0', 'group-data-[side=right]:rotate-180', variant === 'floating' || variant === 'inset' ? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]' : 'group-data-[collapsible=icon]:w-[--sidebar-width-icon]')
|
|
137
|
+
}), jsx("div", {
|
|
138
|
+
className: cn('duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex', side === 'left' ? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]' : 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',
|
|
139
|
+
// Adjust the padding for floating and inset variants.
|
|
140
|
+
variant === 'floating' || variant === 'inset' ? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]' : 'group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l', className),
|
|
141
|
+
...props,
|
|
142
|
+
children: jsx("div", {
|
|
143
|
+
"data-sidebar": "sidebar",
|
|
144
|
+
className: "flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",
|
|
145
|
+
children: children
|
|
146
|
+
})
|
|
147
|
+
})]
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
Sidebar.displayName = 'Sidebar';
|
|
151
|
+
const SidebarTrigger = React.forwardRef(({
|
|
152
|
+
className,
|
|
153
|
+
onClick,
|
|
154
|
+
...props
|
|
155
|
+
}, ref) => {
|
|
156
|
+
const {
|
|
157
|
+
toggleSidebar
|
|
158
|
+
} = useSidebar();
|
|
159
|
+
return jsxs(Button, {
|
|
160
|
+
ref: ref,
|
|
161
|
+
"data-sidebar": "trigger",
|
|
162
|
+
variant: "ghost",
|
|
163
|
+
size: "icon",
|
|
164
|
+
className: cn('h-7 w-7', className),
|
|
165
|
+
onClick: event => {
|
|
166
|
+
onClick?.(event);
|
|
167
|
+
toggleSidebar();
|
|
168
|
+
},
|
|
169
|
+
...props,
|
|
170
|
+
children: [jsx(PanelLeft, {}), jsx("span", {
|
|
171
|
+
className: "sr-only",
|
|
172
|
+
children: "Toggle Sidebar"
|
|
173
|
+
})]
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
SidebarTrigger.displayName = 'SidebarTrigger';
|
|
177
|
+
const SidebarRail = React.forwardRef(({
|
|
178
|
+
className,
|
|
179
|
+
...props
|
|
180
|
+
}, ref) => {
|
|
181
|
+
const {
|
|
182
|
+
toggleSidebar
|
|
183
|
+
} = useSidebar();
|
|
184
|
+
return jsx("button", {
|
|
185
|
+
ref: ref,
|
|
186
|
+
"data-sidebar": "rail",
|
|
187
|
+
"aria-label": "Toggle Sidebar",
|
|
188
|
+
tabIndex: -1,
|
|
189
|
+
onClick: toggleSidebar,
|
|
190
|
+
title: "Toggle Sidebar",
|
|
191
|
+
className: cn('absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex', '[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize', '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize', 'group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar', '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2', '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2', className),
|
|
192
|
+
...props
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
SidebarRail.displayName = 'SidebarRail';
|
|
196
|
+
const SidebarInset = React.forwardRef(({
|
|
197
|
+
className,
|
|
198
|
+
...props
|
|
199
|
+
}, ref) => {
|
|
200
|
+
return jsx("main", {
|
|
201
|
+
ref: ref,
|
|
202
|
+
className: cn('relative flex min-h-svh flex-1 flex-col bg-background', 'peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow', className),
|
|
203
|
+
...props
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
SidebarInset.displayName = 'SidebarInset';
|
|
207
|
+
const SidebarInput = React.forwardRef(({
|
|
208
|
+
className,
|
|
209
|
+
...props
|
|
210
|
+
}, ref) => {
|
|
211
|
+
return jsx(Input, {
|
|
212
|
+
ref: ref,
|
|
213
|
+
"data-sidebar": "input",
|
|
214
|
+
className: cn('h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring', className),
|
|
215
|
+
...props
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
SidebarInput.displayName = 'SidebarInput';
|
|
219
|
+
const SidebarHeader = React.forwardRef(({
|
|
220
|
+
className,
|
|
221
|
+
...props
|
|
222
|
+
}, ref) => {
|
|
223
|
+
return jsx("div", {
|
|
224
|
+
ref: ref,
|
|
225
|
+
"data-sidebar": "header",
|
|
226
|
+
className: cn('flex flex-col gap-2 p-2', className),
|
|
227
|
+
...props
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
SidebarHeader.displayName = 'SidebarHeader';
|
|
231
|
+
const SidebarFooter = React.forwardRef(({
|
|
232
|
+
className,
|
|
233
|
+
...props
|
|
234
|
+
}, ref) => {
|
|
235
|
+
return jsx("div", {
|
|
236
|
+
ref: ref,
|
|
237
|
+
"data-sidebar": "footer",
|
|
238
|
+
className: cn('flex flex-col gap-2 p-2', className),
|
|
239
|
+
...props
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
SidebarFooter.displayName = 'SidebarFooter';
|
|
243
|
+
const SidebarSeparator = React.forwardRef(({
|
|
244
|
+
className,
|
|
245
|
+
...props
|
|
246
|
+
}, ref) => {
|
|
247
|
+
return jsx(Separator, {
|
|
248
|
+
ref: ref,
|
|
249
|
+
"data-sidebar": "separator",
|
|
250
|
+
className: cn('mx-2 w-auto bg-sidebar-border', className),
|
|
251
|
+
...props
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
SidebarSeparator.displayName = 'SidebarSeparator';
|
|
255
|
+
const SidebarContent = React.forwardRef(({
|
|
256
|
+
className,
|
|
257
|
+
...props
|
|
258
|
+
}, ref) => {
|
|
259
|
+
return jsx("div", {
|
|
260
|
+
ref: ref,
|
|
261
|
+
"data-sidebar": "content",
|
|
262
|
+
className: cn('flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden', className),
|
|
263
|
+
...props
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
SidebarContent.displayName = 'SidebarContent';
|
|
267
|
+
const SidebarGroup = React.forwardRef(({
|
|
268
|
+
className,
|
|
269
|
+
...props
|
|
270
|
+
}, ref) => {
|
|
271
|
+
return jsx("div", {
|
|
272
|
+
ref: ref,
|
|
273
|
+
"data-sidebar": "group",
|
|
274
|
+
className: cn('relative flex w-full min-w-0 flex-col p-2', className),
|
|
275
|
+
...props
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
SidebarGroup.displayName = 'SidebarGroup';
|
|
279
|
+
const SidebarGroupLabel = React.forwardRef(({
|
|
280
|
+
className,
|
|
281
|
+
asChild = false,
|
|
282
|
+
...props
|
|
283
|
+
}, ref) => {
|
|
284
|
+
const Comp = asChild ? Slot : 'div';
|
|
285
|
+
return jsx(Comp, {
|
|
286
|
+
ref: ref,
|
|
287
|
+
"data-sidebar": "group-label",
|
|
288
|
+
className: cn('duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0', 'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0', className),
|
|
289
|
+
...props
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
SidebarGroupLabel.displayName = 'SidebarGroupLabel';
|
|
293
|
+
const SidebarGroupAction = React.forwardRef(({
|
|
294
|
+
className,
|
|
295
|
+
asChild = false,
|
|
296
|
+
...props
|
|
297
|
+
}, ref) => {
|
|
298
|
+
const Comp = asChild ? Slot : 'button';
|
|
299
|
+
return jsx(Comp, {
|
|
300
|
+
ref: ref,
|
|
301
|
+
"data-sidebar": "group-action",
|
|
302
|
+
className: cn('absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
303
|
+
// Increases the hit area of the button on mobile.
|
|
304
|
+
'after:absolute after:-inset-2 after:md:hidden', 'group-data-[collapsible=icon]:hidden', className),
|
|
305
|
+
...props
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
SidebarGroupAction.displayName = 'SidebarGroupAction';
|
|
309
|
+
const SidebarGroupContent = React.forwardRef(({
|
|
310
|
+
className,
|
|
311
|
+
...props
|
|
312
|
+
}, ref) => jsx("div", {
|
|
313
|
+
ref: ref,
|
|
314
|
+
"data-sidebar": "group-content",
|
|
315
|
+
className: cn('w-full text-sm', className),
|
|
316
|
+
...props
|
|
317
|
+
}));
|
|
318
|
+
SidebarGroupContent.displayName = 'SidebarGroupContent';
|
|
319
|
+
const SidebarMenu = React.forwardRef(({
|
|
320
|
+
className,
|
|
321
|
+
...props
|
|
322
|
+
}, ref) => jsx("ul", {
|
|
323
|
+
ref: ref,
|
|
324
|
+
"data-sidebar": "menu",
|
|
325
|
+
className: cn('flex w-full min-w-0 flex-col gap-1', className),
|
|
326
|
+
...props
|
|
327
|
+
}));
|
|
328
|
+
SidebarMenu.displayName = 'SidebarMenu';
|
|
329
|
+
const SidebarMenuItem = React.forwardRef(({
|
|
330
|
+
className,
|
|
331
|
+
...props
|
|
332
|
+
}, ref) => jsx("li", {
|
|
333
|
+
ref: ref,
|
|
334
|
+
"data-sidebar": "menu-item",
|
|
335
|
+
className: cn('group/menu-item relative', className),
|
|
336
|
+
...props
|
|
337
|
+
}));
|
|
338
|
+
SidebarMenuItem.displayName = 'SidebarMenuItem';
|
|
339
|
+
const sidebarMenuButtonVariants = cva('peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0', {
|
|
340
|
+
variants: {
|
|
341
|
+
variant: {
|
|
342
|
+
default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
|
343
|
+
outline: 'bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]'
|
|
344
|
+
},
|
|
345
|
+
size: {
|
|
346
|
+
default: 'h-8 text-sm',
|
|
347
|
+
sm: 'h-7 text-xs',
|
|
348
|
+
lg: 'h-12 text-sm group-data-[collapsible=icon]:!p-0'
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
defaultVariants: {
|
|
352
|
+
variant: 'default',
|
|
353
|
+
size: 'default'
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
const SidebarMenuButton = React.forwardRef(({
|
|
357
|
+
asChild = false,
|
|
358
|
+
isActive = false,
|
|
359
|
+
variant = 'default',
|
|
360
|
+
size = 'default',
|
|
361
|
+
tooltip,
|
|
362
|
+
className,
|
|
363
|
+
...props
|
|
364
|
+
}, ref) => {
|
|
365
|
+
const Comp = asChild ? Slot : 'button';
|
|
366
|
+
const {
|
|
367
|
+
isMobile,
|
|
368
|
+
state
|
|
369
|
+
} = useSidebar();
|
|
370
|
+
const button = jsx(Comp, {
|
|
371
|
+
ref: ref,
|
|
372
|
+
"data-sidebar": "menu-button",
|
|
373
|
+
"data-size": size,
|
|
374
|
+
"data-active": isActive,
|
|
375
|
+
className: cn(sidebarMenuButtonVariants({
|
|
376
|
+
variant,
|
|
377
|
+
size
|
|
378
|
+
}), className),
|
|
379
|
+
...props
|
|
380
|
+
});
|
|
381
|
+
if (!tooltip) {
|
|
382
|
+
return button;
|
|
383
|
+
}
|
|
384
|
+
if (typeof tooltip === 'string') {
|
|
385
|
+
tooltip = {
|
|
386
|
+
children: tooltip
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
return jsxs(Tooltip, {
|
|
390
|
+
children: [jsx(TooltipTrigger, {
|
|
391
|
+
asChild: true,
|
|
392
|
+
children: button
|
|
393
|
+
}), jsx(TooltipContent, {
|
|
394
|
+
side: "right",
|
|
395
|
+
align: "center",
|
|
396
|
+
hidden: state !== 'collapsed' || isMobile,
|
|
397
|
+
...tooltip
|
|
398
|
+
})]
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
SidebarMenuButton.displayName = 'SidebarMenuButton';
|
|
402
|
+
const SidebarMenuAction = React.forwardRef(({
|
|
403
|
+
className,
|
|
404
|
+
asChild = false,
|
|
405
|
+
showOnHover = false,
|
|
406
|
+
...props
|
|
407
|
+
}, ref) => {
|
|
408
|
+
const Comp = asChild ? Slot : 'button';
|
|
409
|
+
return jsx(Comp, {
|
|
410
|
+
ref: ref,
|
|
411
|
+
"data-sidebar": "menu-action",
|
|
412
|
+
className: cn('absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0',
|
|
413
|
+
// Increases the hit area of the button on mobile.
|
|
414
|
+
'after:absolute after:-inset-2 after:md:hidden', 'peer-data-[size=sm]/menu-button:top-1', 'peer-data-[size=default]/menu-button:top-1.5', 'peer-data-[size=lg]/menu-button:top-2.5', 'group-data-[collapsible=icon]:hidden', showOnHover && 'group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0', className),
|
|
415
|
+
...props
|
|
416
|
+
});
|
|
417
|
+
});
|
|
418
|
+
SidebarMenuAction.displayName = 'SidebarMenuAction';
|
|
419
|
+
const SidebarMenuBadge = React.forwardRef(({
|
|
420
|
+
className,
|
|
421
|
+
...props
|
|
422
|
+
}, ref) => jsx("div", {
|
|
423
|
+
ref: ref,
|
|
424
|
+
"data-sidebar": "menu-badge",
|
|
425
|
+
className: cn('absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none', 'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground', 'peer-data-[size=sm]/menu-button:top-1', 'peer-data-[size=default]/menu-button:top-1.5', 'peer-data-[size=lg]/menu-button:top-2.5', 'group-data-[collapsible=icon]:hidden', className),
|
|
426
|
+
...props
|
|
427
|
+
}));
|
|
428
|
+
SidebarMenuBadge.displayName = 'SidebarMenuBadge';
|
|
429
|
+
const SidebarMenuSkeleton = React.forwardRef(({
|
|
430
|
+
className,
|
|
431
|
+
showIcon = false,
|
|
432
|
+
...props
|
|
433
|
+
}, ref) => {
|
|
434
|
+
// Random width between 50 to 90%.
|
|
435
|
+
const width = React.useMemo(() => {
|
|
436
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
437
|
+
}, []);
|
|
438
|
+
return jsxs("div", {
|
|
439
|
+
ref: ref,
|
|
440
|
+
"data-sidebar": "menu-skeleton",
|
|
441
|
+
className: cn('rounded-md h-8 flex gap-2 px-2 items-center', className),
|
|
442
|
+
...props,
|
|
443
|
+
children: [showIcon && jsx(Skeleton, {
|
|
444
|
+
className: "size-4 rounded-md",
|
|
445
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
446
|
+
}), jsx(Skeleton, {
|
|
447
|
+
className: "h-4 flex-1 max-w-[--skeleton-width]",
|
|
448
|
+
"data-sidebar": "menu-skeleton-text",
|
|
449
|
+
style: {
|
|
450
|
+
'--skeleton-width': width
|
|
451
|
+
}
|
|
452
|
+
})]
|
|
453
|
+
});
|
|
454
|
+
});
|
|
455
|
+
SidebarMenuSkeleton.displayName = 'SidebarMenuSkeleton';
|
|
456
|
+
const SidebarMenuSub = React.forwardRef(({
|
|
457
|
+
className,
|
|
458
|
+
...props
|
|
459
|
+
}, ref) => jsx("ul", {
|
|
460
|
+
ref: ref,
|
|
461
|
+
"data-sidebar": "menu-sub",
|
|
462
|
+
className: cn('mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5', 'group-data-[collapsible=icon]:hidden', className),
|
|
463
|
+
...props
|
|
464
|
+
}));
|
|
465
|
+
SidebarMenuSub.displayName = 'SidebarMenuSub';
|
|
466
|
+
const SidebarMenuSubItem = React.forwardRef(({
|
|
467
|
+
...props
|
|
468
|
+
}, ref) => jsx("li", {
|
|
469
|
+
ref: ref,
|
|
470
|
+
...props
|
|
471
|
+
}));
|
|
472
|
+
SidebarMenuSubItem.displayName = 'SidebarMenuSubItem';
|
|
473
|
+
const SidebarMenuSubButton = React.forwardRef(({
|
|
474
|
+
asChild = false,
|
|
475
|
+
size = 'md',
|
|
476
|
+
isActive,
|
|
477
|
+
className,
|
|
478
|
+
...props
|
|
479
|
+
}, ref) => {
|
|
480
|
+
const Comp = asChild ? Slot : 'a';
|
|
481
|
+
return jsx(Comp, {
|
|
482
|
+
ref: ref,
|
|
483
|
+
"data-sidebar": "menu-sub-button",
|
|
484
|
+
"data-size": size,
|
|
485
|
+
"data-active": isActive,
|
|
486
|
+
className: cn('flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground', 'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground', size === 'sm' && 'text-xs', size === 'md' && 'text-sm', 'group-data-[collapsible=icon]:hidden', className),
|
|
487
|
+
...props
|
|
488
|
+
});
|
|
489
|
+
});
|
|
490
|
+
SidebarMenuSubButton.displayName = 'SidebarMenuSubButton';export{Sidebar,SidebarContent,SidebarFooter,SidebarGroup,SidebarGroupAction,SidebarGroupContent,SidebarGroupLabel,SidebarHeader,SidebarInput,SidebarInset,SidebarMenu,SidebarMenuAction,SidebarMenuBadge,SidebarMenuButton,SidebarMenuItem,SidebarMenuSkeleton,SidebarMenuSub,SidebarMenuSubButton,SidebarMenuSubItem,SidebarProvider,SidebarRail,SidebarSeparator,SidebarTrigger,useSidebar};//# sourceMappingURL=sidebar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.js","sources":["../../src/shardui/sidebar.tsx"],"sourcesContent":[null],"names":[],"mappings":"imBAiCA,MAAA,sBAOC,eAAA;AAED,MAAA,sBAAqB,GAAA,EAAA,GAAA,EAAA,GAAA,EAAA,GAAA,CAAA;mBAGQ,GAAA,OAAA;0BACP,GAAA,OAAA;AACC,MAAA,kBAAK,GAAS,MAAA;;AAsFrC,MAAA,cAAa,GAAA,KAAA,CAAA,aAAA,CAAA,IAAA,CAAA;AAGE,SAAA,aAAgB;eACJ,GAAA,KAAA,CAAA,UAAa,CAAA,cAAU,CAAA;;uEAiF/C,CAAA;AAGH;AAyBA,EAAA,OAAA,OAAiB;AA4BjB;AAeA,MAAA,eAAkB,GAAA,KAAA,CAAA,UAAA,CAAA,CAAA;AAiBlB,EAAA,WAAA,GAAmB,IAAA;AAKnB,EAAA,IAAA,EAAA,QAAmB;AAKnB,EAAA,YAAM,EAAgB,WAAA;AActB,EAAA,SAAA;AAeA,EAAA,KAAA;AAYA,EAAA;;;AAoBA,EAAA,MAAA,QAAwB,GAAA,WAAA,EAAA;mBAA2F,EAAA,aAAA,CAAA,GAAA,KAAA,CAAA,QAAA,CAAA,KAAA,CAAA;;AAsBnH;AAOA,EAAA,MAAA,CAAA,KAAM,EAAW,QAAA,CAAA,GAAA,KAAA,CAAA,QAAA,CAAA,WAAA,CAAA;AAKjB,EAAA,MAAA,IAAA,GAAqB,QAAA,IAAA,KAAA;AA2BrB,EAAA,MAAA,OAAuB,GAAA,KAAA,CAAA,WAAA,CAAA,KAAA,IAAA;mBAGE,GAAA,OAAA,KAAA,KAAA,UAAA,GAAA,KAAA,CAAA,IAAA,CAAA,GAAA,KAAA;mBACC,EAAA;AACR,MAAA,WAAA,CAAA,SAAc,CAAA;;;;;AAoChC,IAAA,eAAuB,GAAA,CAAA,EAAA,mBAAA,CAAA,CAAA,EAAA,SAAA,CAAA,kBAAA,EAAA,sBAAA,CAAA,CAAA;iBAGE,EAAA,IAAA,CAAA,CAAA;;;AA4BzB,IAAA,OAAA,QAAsB,GAAA,aAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA,GAAA,OAAA,CAAA,IAAA,IAAA,CAAA,IAAA,CAAA;AAoBtB,GAAA,EAAA,CAAA,QAAM,EAAmB,OAAA,EAAA,aAAA,CAAA,CAAA;;;AAiCzB,IAAA,MAAA,aAAoB,GAAA,KAAA,IAAA;AAgBpB,MAAA,IAAA,KAAwB,CAAA,GAAA,KAAA,yBAAA,KAAA,KAAA,CAAA,OAAA,IAAA,KAAA,CAAA,OAAA,CAAA,EAAA;AAKxB,QAAA,MAAM,cAAoB,EAAA;qBAGD,EAAA;AACV;;oDAuBZ,CAAA;AAGH,IAAO,aAEH,MAAA,CAAA,mBACa,CAAA,SACD,EAAA,aACM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../src/shardui/skeleton.tsx"],"names":[],"mappings":"AAEA,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,2CAE9E;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import'../utils/isBrowser/index.js';import {cn}from'../utils/util.js';import'react';import'fast-deep-equal/react';function Skeleton({
|
|
2
|
+
className,
|
|
3
|
+
...props
|
|
4
|
+
}) {
|
|
5
|
+
return jsx("div", {
|
|
6
|
+
className: cn('animate-pulse rounded-md bg-muted', className),
|
|
7
|
+
...props
|
|
8
|
+
});
|
|
9
|
+
}export{Skeleton};//# sourceMappingURL=skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
3
|
+
declare const Slider: React.ForwardRefExoticComponent<Omit<SliderPrimitive.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
export { Slider };
|
|
5
|
+
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/shardui/slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAI1D,QAAA,MAAM,MAAM,yJAcV,CAAC;AAGH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import*as React from'react';import*as SliderPrimitive from'@radix-ui/react-slider';import'../utils/isBrowser/index.js';import {cn}from'../utils/util.js';import'fast-deep-equal/react';const Slider = React.forwardRef(({
|
|
2
|
+
className,
|
|
3
|
+
...props
|
|
4
|
+
}, ref) => jsxs(SliderPrimitive.Root, {
|
|
5
|
+
ref: ref,
|
|
6
|
+
className: cn('relative flex w-full touch-none select-none items-center', className),
|
|
7
|
+
...props,
|
|
8
|
+
children: [jsx(SliderPrimitive.Track, {
|
|
9
|
+
className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",
|
|
10
|
+
children: jsx(SliderPrimitive.Range, {
|
|
11
|
+
className: "absolute h-full bg-primary"
|
|
12
|
+
})
|
|
13
|
+
}), jsx(SliderPrimitive.Thumb, {
|
|
14
|
+
className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
|
|
15
|
+
})]
|
|
16
|
+
}));
|
|
17
|
+
Slider.displayName = SliderPrimitive.Root.displayName;export{Slider};//# sourceMappingURL=slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Toaster as Sonner, toast } from 'sonner';
|
|
2
|
+
type ToasterProps = React.ComponentProps<typeof Sonner>;
|
|
3
|
+
declare const Toaster: ({ ...props }: ToasterProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Toaster, toast };
|
|
5
|
+
//# sourceMappingURL=sonner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/shardui/sonner.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAElD,KAAK,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAExD,QAAA,MAAM,OAAO,GAAI,cAAc,YAAY,4CAkB1C,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {useTheme}from'next-themes';import {Toaster as Toaster$1}from'sonner';export{toast}from'sonner';const Toaster = ({
|
|
2
|
+
...props
|
|
3
|
+
}) => {
|
|
4
|
+
const {
|
|
5
|
+
theme = 'system'
|
|
6
|
+
} = useTheme();
|
|
7
|
+
return jsx(Toaster$1, {
|
|
8
|
+
theme: theme,
|
|
9
|
+
className: "toaster group",
|
|
10
|
+
toastOptions: {
|
|
11
|
+
classNames: {
|
|
12
|
+
toast: 'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',
|
|
13
|
+
description: 'group-[.toast]:text-muted-foreground',
|
|
14
|
+
actionButton: 'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',
|
|
15
|
+
cancelButton: 'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
...props
|
|
19
|
+
});
|
|
20
|
+
};export{Toaster};//# sourceMappingURL=sonner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.js","sources":["../../src/shardui/sonner.tsx"],"sourcesContent":[null],"names":[],"mappings":"2IAyBA,MAAA,OAAS,GAAO,CAAE;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Switch };
|
|
5
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/shardui/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAI3D,QAAA,MAAM,MAAM,8JAkBV,CAAC;AAGH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import*as React from'react';import*as SwitchPrimitives from'@radix-ui/react-switch';import'../utils/isBrowser/index.js';import {cn}from'../utils/util.js';import'fast-deep-equal/react';const Switch = React.forwardRef(({
|
|
2
|
+
className,
|
|
3
|
+
...props
|
|
4
|
+
}, ref) => jsx(SwitchPrimitives.Root, {
|
|
5
|
+
className: cn('peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input', className),
|
|
6
|
+
...props,
|
|
7
|
+
ref: ref,
|
|
8
|
+
children: jsx(SwitchPrimitives.Thumb, {
|
|
9
|
+
className: cn('pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0')
|
|
10
|
+
})
|
|
11
|
+
}));
|
|
12
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;export{Switch};//# sourceMappingURL=switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
3
|
+
declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
4
|
+
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
5
|
+
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
6
|
+
declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
|
|
7
|
+
declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
8
|
+
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
|
+
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
10
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
11
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/shardui/table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,KAAK,iHAMV,CAAC;AAGF,QAAA,MAAM,WAAW,+HAEhB,CAAC;AAGF,QAAA,MAAM,SAAS,+HAId,CAAC;AAGF,QAAA,MAAM,WAAW,+HAQhB,CAAC;AAGF,QAAA,MAAM,QAAQ,uHAQb,CAAC;AAGF,QAAA,MAAM,SAAS,2HAWd,CAAC;AAGF,QAAA,MAAM,SAAS,2HAId,CAAC;AAGF,QAAA,MAAM,YAAY,+HAIjB,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC"}
|