@moldable-ai/ui 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat/chat-input.d.ts.map +1 -1
- package/dist/components/chat/chat-input.js +8 -6
- package/dist/components/chat/chat-panel.d.ts +5 -1
- package/dist/components/chat/chat-panel.d.ts.map +1 -1
- package/dist/components/chat/chat-panel.js +6 -2
- package/dist/components/chat/markdown.d.ts +9 -0
- package/dist/components/chat/markdown.d.ts.map +1 -0
- package/dist/components/chat/markdown.js +47 -0
- package/dist/components/chat/tool-handlers.d.ts.map +1 -1
- package/dist/components/chat/tool-handlers.js +21 -51
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +18 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +1 -0
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +25 -0
- package/dist/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +7 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +14 -0
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +1 -0
- package/dist/components/ui/breadcrumb.d.ts +12 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +28 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +28 -0
- package/dist/components/ui/button.d.ts +2 -3
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +5 -6
- package/dist/components/ui/calendar.d.ts +9 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +76 -0
- package/dist/components/ui/card.d.ts +8 -7
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +23 -14
- package/dist/components/ui/carousel.d.ts +20 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +91 -0
- package/dist/components/ui/chart.d.ts +41 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +132 -0
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/collapsible.d.ts +3 -3
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +11 -3
- package/dist/components/ui/command.d.ts +15 -15
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +29 -24
- package/dist/components/ui/context-menu.d.ts +26 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +51 -0
- package/dist/components/ui/dialog.d.ts +13 -17
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +32 -19
- package/dist/components/ui/drawer.d.ts +14 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +35 -0
- package/dist/components/ui/dropdown-menu.js +6 -6
- package/dist/components/ui/empty.d.ts +12 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +34 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +76 -0
- package/dist/components/ui/form.d.ts +25 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/form.js +59 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +14 -0
- package/dist/components/ui/index.d.ts +35 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +35 -0
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +63 -0
- package/dist/components/ui/input-otp.d.ts +12 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +21 -0
- package/dist/components/ui/input.d.ts +1 -2
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +4 -5
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +67 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +10 -0
- package/dist/components/ui/label.d.ts +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +3 -3
- package/dist/components/ui/menubar.d.ts +27 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +54 -0
- package/dist/components/ui/navigation-menu.d.ts +15 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +32 -0
- package/dist/components/ui/pagination.d.ts +14 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +30 -0
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +1 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +8 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +12 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +15 -0
- package/dist/components/ui/scroll-area.d.ts +2 -2
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +9 -7
- package/dist/components/ui/select.d.ts +13 -11
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +35 -23
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +8 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +40 -0
- package/dist/components/ui/sidebar.d.ts +70 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +212 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +7 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +14 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +21 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +8 -0
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +4 -4
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +28 -0
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +1 -0
- package/dist/components/ui/textarea.d.ts +1 -2
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +4 -5
- package/dist/components/ui/toggle-group.d.ts +10 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +22 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +26 -0
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +48 -24
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from './button';
|
|
3
|
+
import { Input } from './input';
|
|
4
|
+
import { Separator } from './separator';
|
|
5
|
+
import { TooltipContent } from './tooltip';
|
|
6
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
7
|
+
type SidebarContextProps = {
|
|
8
|
+
state: 'expanded' | 'collapsed';
|
|
9
|
+
open: boolean;
|
|
10
|
+
setOpen: (open: boolean) => void;
|
|
11
|
+
openMobile: boolean;
|
|
12
|
+
setOpenMobile: (open: boolean) => void;
|
|
13
|
+
isMobile: boolean;
|
|
14
|
+
toggleSidebar: () => void;
|
|
15
|
+
};
|
|
16
|
+
declare function useSidebar(): SidebarContextProps;
|
|
17
|
+
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<'div'> & {
|
|
18
|
+
defaultOpen?: boolean;
|
|
19
|
+
open?: boolean;
|
|
20
|
+
onOpenChange?: (open: boolean) => void;
|
|
21
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function Sidebar({ side, variant, collapsible, className, children, ...props }: React.ComponentProps<'div'> & {
|
|
23
|
+
side?: 'left' | 'right';
|
|
24
|
+
variant?: 'sidebar' | 'floating' | 'inset';
|
|
25
|
+
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare function SidebarRail({ className, ...props }: React.ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function SidebarInset({ className, ...props }: React.ComponentProps<'main'>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
declare function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare function SidebarContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
declare function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
declare function SidebarGroupLabel({ className, asChild, ...props }: React.ComponentProps<'div'> & {
|
|
37
|
+
asChild?: boolean;
|
|
38
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
declare function SidebarGroupAction({ className, asChild, ...props }: React.ComponentProps<'button'> & {
|
|
40
|
+
asChild?: boolean;
|
|
41
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
declare function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
declare const sidebarMenuButtonVariants: (props?: ({
|
|
46
|
+
variant?: "default" | "outline" | null | undefined;
|
|
47
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
48
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
49
|
+
declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<'button'> & {
|
|
50
|
+
asChild?: boolean;
|
|
51
|
+
isActive?: boolean;
|
|
52
|
+
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
53
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React.ComponentProps<'button'> & {
|
|
55
|
+
asChild?: boolean;
|
|
56
|
+
showOnHover?: boolean;
|
|
57
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<'div'> & {
|
|
60
|
+
showIcon?: boolean;
|
|
61
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>): import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React.ComponentProps<'a'> & {
|
|
65
|
+
asChild?: boolean;
|
|
66
|
+
size?: 'sm' | 'md';
|
|
67
|
+
isActive?: boolean;
|
|
68
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
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, };
|
|
70
|
+
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import { PanelLeftIcon } from 'lucide-react';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { cn } from '../../lib/utils';
|
|
7
|
+
import { useIsMobile } from '../../hooks/use-mobile';
|
|
8
|
+
import { Button } from './button';
|
|
9
|
+
import { Input } from './input';
|
|
10
|
+
import { Separator } from './separator';
|
|
11
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, } from './sheet';
|
|
12
|
+
import { Skeleton } from './skeleton';
|
|
13
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from './tooltip';
|
|
14
|
+
import { cva } from 'class-variance-authority';
|
|
15
|
+
const SIDEBAR_COOKIE_NAME = 'sidebar_state';
|
|
16
|
+
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
17
|
+
const SIDEBAR_WIDTH = '16rem';
|
|
18
|
+
const SIDEBAR_WIDTH_MOBILE = '18rem';
|
|
19
|
+
const SIDEBAR_WIDTH_ICON = '3rem';
|
|
20
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
|
|
21
|
+
const SidebarContext = React.createContext(null);
|
|
22
|
+
function useSidebar() {
|
|
23
|
+
const context = React.useContext(SidebarContext);
|
|
24
|
+
if (!context) {
|
|
25
|
+
throw new Error('useSidebar must be used within a SidebarProvider.');
|
|
26
|
+
}
|
|
27
|
+
return context;
|
|
28
|
+
}
|
|
29
|
+
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) {
|
|
30
|
+
const isMobile = useIsMobile();
|
|
31
|
+
const [openMobile, setOpenMobile] = React.useState(false);
|
|
32
|
+
// This is the internal state of the sidebar.
|
|
33
|
+
// We use openProp and setOpenProp for control from outside the component.
|
|
34
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
35
|
+
const open = openProp ?? _open;
|
|
36
|
+
const setOpen = React.useCallback((value) => {
|
|
37
|
+
const openState = typeof value === 'function' ? value(open) : value;
|
|
38
|
+
if (setOpenProp) {
|
|
39
|
+
setOpenProp(openState);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
_setOpen(openState);
|
|
43
|
+
}
|
|
44
|
+
// This sets the cookie to keep the sidebar state.
|
|
45
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
46
|
+
}, [setOpenProp, open]);
|
|
47
|
+
// Helper to toggle the sidebar.
|
|
48
|
+
const toggleSidebar = React.useCallback(() => {
|
|
49
|
+
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
|
50
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
51
|
+
// Adds a keyboard shortcut to toggle the sidebar.
|
|
52
|
+
React.useEffect(() => {
|
|
53
|
+
const handleKeyDown = (event) => {
|
|
54
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
|
55
|
+
(event.metaKey || event.ctrlKey)) {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
toggleSidebar();
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
61
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
62
|
+
}, [toggleSidebar]);
|
|
63
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
64
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
65
|
+
const state = open ? 'expanded' : 'collapsed';
|
|
66
|
+
const contextValue = React.useMemo(() => ({
|
|
67
|
+
state,
|
|
68
|
+
open,
|
|
69
|
+
setOpen,
|
|
70
|
+
isMobile,
|
|
71
|
+
openMobile,
|
|
72
|
+
setOpenMobile,
|
|
73
|
+
toggleSidebar,
|
|
74
|
+
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
|
|
75
|
+
return (_jsx(SidebarContext.Provider, { value: contextValue, children: _jsx(TooltipProvider, { delayDuration: 0, children: _jsx("div", { "data-slot": "sidebar-wrapper", style: {
|
|
76
|
+
'--sidebar-width': SIDEBAR_WIDTH,
|
|
77
|
+
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
|
|
78
|
+
...style,
|
|
79
|
+
}, className: cn('group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full', className), ...props, children: children }) }) }));
|
|
80
|
+
}
|
|
81
|
+
function Sidebar({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas', className, children, ...props }) {
|
|
82
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
83
|
+
if (collapsible === 'none') {
|
|
84
|
+
return (_jsx("div", { "data-slot": "sidebar", className: cn('bg-sidebar text-sidebar-foreground w-(--sidebar-width) flex h-full flex-col', className), ...props, children: children }));
|
|
85
|
+
}
|
|
86
|
+
if (isMobile) {
|
|
87
|
+
return (_jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: _jsxs(SheetContent, { "data-sidebar": "sidebar", "data-slot": "sidebar", "data-mobile": "true", className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden", style: {
|
|
88
|
+
'--sidebar-width': SIDEBAR_WIDTH_MOBILE,
|
|
89
|
+
}, side: side, children: [_jsxs(SheetHeader, { className: "sr-only", children: [_jsx(SheetTitle, { children: "Sidebar" }), _jsx(SheetDescription, { children: "Displays the mobile sidebar." })] }), _jsx("div", { className: "flex h-full w-full flex-col", children: children })] }) }));
|
|
90
|
+
}
|
|
91
|
+
return (_jsxs("div", { className: "text-sidebar-foreground group peer hidden md:block", "data-state": state, "data-collapsible": state === 'collapsed' ? collapsible : '', "data-variant": variant, "data-side": side, "data-slot": "sidebar", children: [_jsx("div", { "data-slot": "sidebar-gap", className: cn('w-(--sidebar-width) relative bg-transparent transition-[width] duration-200 ease-linear', 'group-data-[collapsible=offcanvas]:w-0', 'group-data-[side=right]:rotate-180', variant === 'floating' || variant === 'inset'
|
|
92
|
+
? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]'
|
|
93
|
+
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)') }), _jsx("div", { "data-slot": "sidebar-container", className: cn('w-(--sidebar-width) fixed inset-y-0 z-10 hidden h-svh transition-[left,right,width] duration-200 ease-linear md:flex', side === 'left'
|
|
94
|
+
? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'
|
|
95
|
+
: 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',
|
|
96
|
+
// Adjust the padding for floating and inset variants.
|
|
97
|
+
variant === 'floating' || variant === 'inset'
|
|
98
|
+
? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'
|
|
99
|
+
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l', className), ...props, children: _jsx("div", { "data-sidebar": "sidebar", "data-slot": "sidebar-inner", className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm", children: children }) })] }));
|
|
100
|
+
}
|
|
101
|
+
function SidebarTrigger({ className, onClick, ...props }) {
|
|
102
|
+
const { toggleSidebar } = useSidebar();
|
|
103
|
+
return (_jsxs(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "icon", className: cn('size-7', className), onClick: (event) => {
|
|
104
|
+
onClick?.(event);
|
|
105
|
+
toggleSidebar();
|
|
106
|
+
}, ...props, children: [_jsx(PanelLeftIcon, {}), _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })] }));
|
|
107
|
+
}
|
|
108
|
+
function SidebarRail({ className, ...props }) {
|
|
109
|
+
const { toggleSidebar } = useSidebar();
|
|
110
|
+
return (_jsx("button", { "data-sidebar": "rail", "data-slot": "sidebar-rail", "aria-label": "Toggle Sidebar", tabIndex: -1, onClick: toggleSidebar, title: "Toggle Sidebar", className: cn('hover:after:bg-sidebar-border 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] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex', 'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize', '[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize', 'hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full', '[[data-side=left][data-collapsible=offcanvas]_&]:-right-2', '[[data-side=right][data-collapsible=offcanvas]_&]:-left-2', className), ...props }));
|
|
111
|
+
}
|
|
112
|
+
function SidebarInset({ className, ...props }) {
|
|
113
|
+
return (_jsx("main", { "data-slot": "sidebar-inset", className: cn('bg-background relative flex w-full flex-1 flex-col', 'md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm', className), ...props }));
|
|
114
|
+
}
|
|
115
|
+
function SidebarInput({ className, ...props }) {
|
|
116
|
+
return (_jsx(Input, { "data-slot": "sidebar-input", "data-sidebar": "input", className: cn('bg-background h-8 w-full shadow-none', className), ...props }));
|
|
117
|
+
}
|
|
118
|
+
function SidebarHeader({ className, ...props }) {
|
|
119
|
+
return (_jsx("div", { "data-slot": "sidebar-header", "data-sidebar": "header", className: cn('flex flex-col gap-2 p-2', className), ...props }));
|
|
120
|
+
}
|
|
121
|
+
function SidebarFooter({ className, ...props }) {
|
|
122
|
+
return (_jsx("div", { "data-slot": "sidebar-footer", "data-sidebar": "footer", className: cn('flex flex-col gap-2 p-2', className), ...props }));
|
|
123
|
+
}
|
|
124
|
+
function SidebarSeparator({ className, ...props }) {
|
|
125
|
+
return (_jsx(Separator, { "data-slot": "sidebar-separator", "data-sidebar": "separator", className: cn('bg-sidebar-border mx-2 w-auto', className), ...props }));
|
|
126
|
+
}
|
|
127
|
+
function SidebarContent({ className, ...props }) {
|
|
128
|
+
return (_jsx("div", { "data-slot": "sidebar-content", "data-sidebar": "content", className: cn('flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden', className), ...props }));
|
|
129
|
+
}
|
|
130
|
+
function SidebarGroup({ className, ...props }) {
|
|
131
|
+
return (_jsx("div", { "data-slot": "sidebar-group", "data-sidebar": "group", className: cn('relative flex w-full min-w-0 flex-col p-2', className), ...props }));
|
|
132
|
+
}
|
|
133
|
+
function SidebarGroupLabel({ className, asChild = false, ...props }) {
|
|
134
|
+
const Comp = asChild ? Slot : 'div';
|
|
135
|
+
return (_jsx(Comp, { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: cn('text-sidebar-foreground/70 ring-sidebar-ring outline-hidden flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 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), ...props }));
|
|
136
|
+
}
|
|
137
|
+
function SidebarGroupAction({ className, asChild = false, ...props }) {
|
|
138
|
+
const Comp = asChild ? Slot : 'button';
|
|
139
|
+
return (_jsx(Comp, { "data-slot": "sidebar-group-action", "data-sidebar": "group-action", className: cn('text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground outline-hidden absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
140
|
+
// Increases the hit area of the button on mobile.
|
|
141
|
+
'after:absolute after:-inset-2 md:after:hidden', 'group-data-[collapsible=icon]:hidden', className), ...props }));
|
|
142
|
+
}
|
|
143
|
+
function SidebarGroupContent({ className, ...props }) {
|
|
144
|
+
return (_jsx("div", { "data-slot": "sidebar-group-content", "data-sidebar": "group-content", className: cn('w-full text-sm', className), ...props }));
|
|
145
|
+
}
|
|
146
|
+
function SidebarMenu({ className, ...props }) {
|
|
147
|
+
return (_jsx("ul", { "data-slot": "sidebar-menu", "data-sidebar": "menu", className: cn('flex w-full min-w-0 flex-col gap-1', className), ...props }));
|
|
148
|
+
}
|
|
149
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
150
|
+
return (_jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn('group/menu-item relative', className), ...props }));
|
|
151
|
+
}
|
|
152
|
+
const sidebarMenuButtonVariants = cva('peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden 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', {
|
|
153
|
+
variants: {
|
|
154
|
+
variant: {
|
|
155
|
+
default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
|
156
|
+
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))]',
|
|
157
|
+
},
|
|
158
|
+
size: {
|
|
159
|
+
default: 'h-8 text-sm',
|
|
160
|
+
sm: 'h-7 text-xs',
|
|
161
|
+
lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
defaultVariants: {
|
|
165
|
+
variant: 'default',
|
|
166
|
+
size: 'default',
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
function SidebarMenuButton({ asChild = false, isActive = false, variant = 'default', size = 'default', tooltip, className, ...props }) {
|
|
170
|
+
const Comp = asChild ? Slot : 'button';
|
|
171
|
+
const { isMobile, state } = useSidebar();
|
|
172
|
+
const button = (_jsx(Comp, { "data-slot": "sidebar-menu-button", "data-sidebar": "menu-button", "data-size": size, "data-active": isActive, className: cn(sidebarMenuButtonVariants({ variant, size }), className), ...props }));
|
|
173
|
+
if (!tooltip) {
|
|
174
|
+
return button;
|
|
175
|
+
}
|
|
176
|
+
if (typeof tooltip === 'string') {
|
|
177
|
+
tooltip = {
|
|
178
|
+
children: tooltip,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { side: "right", align: "center", hidden: state !== 'collapsed' || isMobile, ...tooltip })] }));
|
|
182
|
+
}
|
|
183
|
+
function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }) {
|
|
184
|
+
const Comp = asChild ? Slot : 'button';
|
|
185
|
+
return (_jsx(Comp, { "data-slot": "sidebar-menu-action", "data-sidebar": "menu-action", className: cn('text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground outline-hidden absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
186
|
+
// Increases the hit area of the button on mobile.
|
|
187
|
+
'after:absolute after:-inset-2 md:after: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 &&
|
|
188
|
+
'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0', className), ...props }));
|
|
189
|
+
}
|
|
190
|
+
function SidebarMenuBadge({ className, ...props }) {
|
|
191
|
+
return (_jsx("div", { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge", className: cn('text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums', '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), ...props }));
|
|
192
|
+
}
|
|
193
|
+
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
194
|
+
// Random width between 50 to 90%.
|
|
195
|
+
const width = React.useMemo(() => {
|
|
196
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
197
|
+
}, []);
|
|
198
|
+
return (_jsxs("div", { "data-slot": "sidebar-menu-skeleton", "data-sidebar": "menu-skeleton", className: cn('flex h-8 items-center gap-2 rounded-md px-2', className), ...props, children: [showIcon && (_jsx(Skeleton, { className: "size-4 rounded-md", "data-sidebar": "menu-skeleton-icon" })), _jsx(Skeleton, { className: "max-w-(--skeleton-width) h-4 flex-1", "data-sidebar": "menu-skeleton-text", style: {
|
|
199
|
+
'--skeleton-width': width,
|
|
200
|
+
} })] }));
|
|
201
|
+
}
|
|
202
|
+
function SidebarMenuSub({ className, ...props }) {
|
|
203
|
+
return (_jsx("ul", { "data-slot": "sidebar-menu-sub", "data-sidebar": "menu-sub", className: cn('border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5', 'group-data-[collapsible=icon]:hidden', className), ...props }));
|
|
204
|
+
}
|
|
205
|
+
function SidebarMenuSubItem({ className, ...props }) {
|
|
206
|
+
return (_jsx("li", { "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item", className: cn('group/menu-sub-item relative', className), ...props }));
|
|
207
|
+
}
|
|
208
|
+
function SidebarMenuSubButton({ asChild = false, size = 'md', isActive = false, className, ...props }) {
|
|
209
|
+
const Comp = asChild ? Slot : 'a';
|
|
210
|
+
return (_jsx(Comp, { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn('text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground outline-hidden flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 focus-visible:ring-2 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', '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), ...props }));
|
|
211
|
+
}
|
|
212
|
+
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, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/ui/skeleton.tsx"],"names":[],"mappings":"AAIA,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQrE;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
function Skeleton({ className, ...props }) {
|
|
5
|
+
return (_jsx("div", { "data-slot": "skeleton", className: cn('bg-accent animate-pulse rounded-md', className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
export { Skeleton };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Slider({ className, defaultValue, value, min, max, ...props }: React.ComponentProps<typeof SliderPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Slider };
|
|
5
|
+
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../src/components/ui/slider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,YAAY,EACZ,KAAK,EACL,GAAO,EACP,GAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CA8CnD;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
|
7
|
+
const _values = React.useMemo(() => Array.isArray(value)
|
|
8
|
+
? value
|
|
9
|
+
: Array.isArray(defaultValue)
|
|
10
|
+
? defaultValue
|
|
11
|
+
: [min, max], [value, defaultValue, min, max]);
|
|
12
|
+
return (_jsxs(SliderPrimitive.Root, { "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, className: cn('relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50', className), ...props, children: [_jsx(SliderPrimitive.Track, { "data-slot": "slider-track", className: cn('bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5'), children: _jsx(SliderPrimitive.Range, { "data-slot": "slider-range", className: cn('bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full') }) }), Array.from({ length: _values.length }, (_, index) => (_jsx(SliderPrimitive.Thumb, { "data-slot": "slider-thumb", className: "border-primary ring-ring/50 focus-visible:outline-hidden block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50" }, index)))] }));
|
|
13
|
+
}
|
|
14
|
+
export { Slider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../../src/components/ui/sonner.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE7D,QAAA,MAAM,OAAO,GAAI,cAAc,YAAY,4CAyB1C,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, } from 'lucide-react';
|
|
4
|
+
import { useTheme } from 'next-themes';
|
|
5
|
+
import { Toaster as Sonner } from 'sonner';
|
|
6
|
+
const Toaster = ({ ...props }) => {
|
|
7
|
+
const { theme = 'system' } = useTheme();
|
|
8
|
+
return (_jsx(Sonner, { theme: theme, className: "toaster group", icons: {
|
|
9
|
+
success: _jsx(CircleCheckIcon, { className: "size-4" }),
|
|
10
|
+
info: _jsx(InfoIcon, { className: "size-4" }),
|
|
11
|
+
warning: _jsx(TriangleAlertIcon, { className: "size-4" }),
|
|
12
|
+
error: _jsx(OctagonXIcon, { className: "size-4" }),
|
|
13
|
+
loading: _jsx(Loader2Icon, { className: "size-4 animate-spin" }),
|
|
14
|
+
}, style: {
|
|
15
|
+
'--normal-bg': 'var(--popover)',
|
|
16
|
+
'--normal-text': 'var(--popover-foreground)',
|
|
17
|
+
'--normal-border': 'var(--border)',
|
|
18
|
+
'--border-radius': 'var(--radius)',
|
|
19
|
+
}, ...props }));
|
|
20
|
+
};
|
|
21
|
+
export { Toaster };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/ui/spinner.tsx"],"names":[],"mappings":"AAKA,iBAAS,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CASpE;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Loader2Icon } from 'lucide-react';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
function Spinner({ className, ...props }) {
|
|
6
|
+
return (_jsx(Loader2Icon, { role: "status", "aria-label": "Loading", className: cn('size-4 animate-spin', className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
export { Spinner };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
declare
|
|
3
|
+
declare function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export { Switch };
|
|
5
5
|
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/ui/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../src/components/ui/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAkBnD;AAED,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
4
|
-
import * as React from 'react';
|
|
3
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
5
4
|
import { cn } from '../../lib/utils';
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function Switch({ className, ...props }) {
|
|
6
|
+
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", className: cn('data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 shadow-xs peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent outline-none transition-all focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: cn('bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0') }) }));
|
|
7
|
+
}
|
|
8
8
|
export { Switch };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<'table'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<'tr'>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<'caption'>): import("react/jsx-runtime").JSX.Element;
|
|
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/components/ui/table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAapE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAQ1E;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAQxE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,2CAW1E;AAED,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAWpE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAWrE;AAED,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAWrE;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,2CAQjC;AAED,OAAO,EACL,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACb,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
function Table({ className, ...props }) {
|
|
5
|
+
return (_jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: _jsx("table", { "data-slot": "table", className: cn('w-full caption-bottom text-sm', className), ...props }) }));
|
|
6
|
+
}
|
|
7
|
+
function TableHeader({ className, ...props }) {
|
|
8
|
+
return (_jsx("thead", { "data-slot": "table-header", className: cn('[&_tr]:border-b', className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
function TableBody({ className, ...props }) {
|
|
11
|
+
return (_jsx("tbody", { "data-slot": "table-body", className: cn('[&_tr:last-child]:border-0', className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function TableFooter({ className, ...props }) {
|
|
14
|
+
return (_jsx("tfoot", { "data-slot": "table-footer", className: cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
function TableRow({ className, ...props }) {
|
|
17
|
+
return (_jsx("tr", { "data-slot": "table-row", className: cn('hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors', className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function TableHead({ className, ...props }) {
|
|
20
|
+
return (_jsx("th", { "data-slot": "table-head", className: cn('text-foreground h-10 whitespace-nowrap px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]', className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function TableCell({ className, ...props }) {
|
|
23
|
+
return (_jsx("td", { "data-slot": "table-cell", className: cn('whitespace-nowrap p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]', className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function TableCaption({ className, ...props }) {
|
|
26
|
+
return (_jsx("caption", { "data-slot": "table-caption", className: cn('text-muted-foreground mt-4 text-sm', className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tabs.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAA;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,2CAQjD;AAED,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,2CAWjD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,2CAWpD;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,2CAQpD;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
2
|
+
declare function Textarea({ className, ...props }: React.ComponentProps<'textarea'>): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
export { Textarea };
|
|
5
4
|
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/components/ui/textarea.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/components/ui/textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAW1E;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import { cn } from '../../lib/utils';
|
|
4
|
-
|
|
5
|
-
return (_jsx("textarea", { className: cn('border-input
|
|
6
|
-
}
|
|
7
|
-
Textarea.displayName = 'Textarea';
|
|
4
|
+
function Textarea({ className, ...props }) {
|
|
5
|
+
return (_jsx("textarea", { "data-slot": "textarea", className: cn('border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 field-sizing-content shadow-xs flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm', className), ...props }));
|
|
6
|
+
}
|
|
8
7
|
export { Textarea };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { toggleVariants } from './toggle';
|
|
4
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
5
|
+
declare function ToggleGroup({ className, variant, size, spacing, children, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants> & {
|
|
6
|
+
spacing?: number;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
10
|
+
//# sourceMappingURL=toggle-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../../src/components/ui/toggle-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AACzC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAY5D,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAW,EACX,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GACvD,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,2CAmBF;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GACvD,YAAY,CAAC,OAAO,cAAc,CAAC,2CAuBpC;AAED,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
|
+
import { toggleVariants } from './toggle';
|
|
7
|
+
const ToggleGroupContext = React.createContext({
|
|
8
|
+
size: 'default',
|
|
9
|
+
variant: 'default',
|
|
10
|
+
spacing: 0,
|
|
11
|
+
});
|
|
12
|
+
function ToggleGroup({ className, variant, size, spacing = 0, children, ...props }) {
|
|
13
|
+
return (_jsx(ToggleGroupPrimitive.Root, { "data-slot": "toggle-group", "data-variant": variant, "data-size": size, "data-spacing": spacing, style: { '--gap': spacing }, className: cn('group/toggle-group data-[spacing=default]:data-[variant=outline]:shadow-xs flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md', className), ...props, children: _jsx(ToggleGroupContext.Provider, { value: { variant, size, spacing }, children: children }) }));
|
|
14
|
+
}
|
|
15
|
+
function ToggleGroupItem({ className, children, variant, size, ...props }) {
|
|
16
|
+
const context = React.useContext(ToggleGroupContext);
|
|
17
|
+
return (_jsx(ToggleGroupPrimitive.Item, { "data-slot": "toggle-group-item", "data-variant": context.variant || variant, "data-size": context.size || size, "data-spacing": context.spacing, className: cn(toggleVariants({
|
|
18
|
+
variant: context.variant || variant,
|
|
19
|
+
size: context.size || size,
|
|
20
|
+
}), 'w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10', 'data-[spacing=0]:rounded-none data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:data-[variant=outline]:first:border-l data-[spacing=0]:last:rounded-r-md', className), ...props, children: children }));
|
|
21
|
+
}
|
|
22
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare const toggleVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "outline" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Toggle, toggleVariants };
|
|
10
|
+
//# sourceMappingURL=toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../src/components/ui/toggle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAEjE,QAAA,MAAM,cAAc;;;8EAoBnB,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GAClD,YAAY,CAAC,OAAO,cAAc,CAAC,2CAQpC;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|