@moldable-ai/ui 0.2.0 → 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/ui/accordion.d.ts +2 -2
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/accordion.js +7 -6
- package/dist/components/ui/alert-dialog.d.ts +4 -4
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +11 -10
- package/dist/components/ui/alert.d.ts +5 -5
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +9 -8
- package/dist/components/ui/aspect-ratio.d.ts +1 -1
- package/dist/components/ui/aspect-ratio.js +2 -2
- package/dist/components/ui/avatar.d.ts +2 -2
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/avatar.js +6 -5
- package/dist/components/ui/badge.d.ts +3 -3
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +11 -10
- package/dist/components/ui/breadcrumb.d.ts +8 -8
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +11 -10
- package/dist/components/ui/button-group.d.ts +4 -4
- package/dist/components/ui/button-group.d.ts.map +1 -1
- package/dist/components/ui/button-group.js +12 -11
- package/dist/components/ui/button.d.ts +3 -3
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +20 -19
- package/dist/components/ui/calendar.d.ts +4 -4
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +45 -45
- package/dist/components/ui/card.d.ts +8 -8
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +9 -8
- package/dist/components/ui/carousel.d.ts +7 -7
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +26 -25
- package/dist/components/ui/chart.d.ts +7 -7
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +37 -37
- package/dist/components/ui/checkbox.d.ts +2 -2
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +5 -5
- package/dist/components/ui/collapsible.d.ts +1 -1
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +2 -1
- package/dist/components/ui/command.d.ts +4 -4
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +14 -13
- package/dist/components/ui/context-menu.d.ts +4 -4
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +14 -14
- package/dist/components/ui/dialog.d.ts +4 -4
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +10 -9
- package/dist/components/ui/drawer.d.ts +4 -4
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/drawer.js +9 -9
- package/dist/components/ui/dropdown-menu.d.ts +4 -4
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +14 -13
- package/dist/components/ui/empty.d.ts +7 -7
- package/dist/components/ui/empty.d.ts.map +1 -1
- package/dist/components/ui/empty.js +12 -11
- package/dist/components/ui/field.d.ts +12 -12
- package/dist/components/ui/field.d.ts.map +1 -1
- package/dist/components/ui/field.js +26 -25
- package/dist/components/ui/form.d.ts +7 -7
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +12 -12
- package/dist/components/ui/hover-card.d.ts +2 -2
- package/dist/components/ui/hover-card.d.ts.map +1 -1
- package/dist/components/ui/hover-card.js +5 -5
- package/dist/components/ui/input-group.d.ts +9 -9
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js +27 -27
- package/dist/components/ui/input-otp.d.ts +5 -5
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/input-otp.js +8 -7
- package/dist/components/ui/input.d.ts +2 -2
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +3 -2
- package/dist/components/ui/item.d.ts +12 -12
- package/dist/components/ui/item.d.ts.map +1 -1
- package/dist/components/ui/item.js +28 -27
- package/dist/components/ui/kbd.d.ts +2 -2
- package/dist/components/ui/kbd.d.ts.map +1 -1
- package/dist/components/ui/kbd.js +4 -3
- package/dist/components/ui/label.d.ts +2 -2
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js +4 -4
- package/dist/components/ui/menubar.d.ts +4 -4
- package/dist/components/ui/menubar.d.ts.map +1 -1
- package/dist/components/ui/menubar.js +17 -16
- package/dist/components/ui/navigation-menu.d.ts +2 -2
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +14 -13
- package/dist/components/ui/pagination.d.ts +7 -7
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +12 -11
- package/dist/components/ui/popover.d.ts +2 -2
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +5 -5
- package/dist/components/ui/progress.d.ts +2 -2
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/progress.js +4 -3
- package/dist/components/ui/radio-group.d.ts +2 -2
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +6 -6
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +1 -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 +8 -8
- package/dist/components/ui/select.d.ts +3 -3
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +15 -14
- package/dist/components/ui/separator.d.ts +2 -2
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/separator.js +5 -5
- package/dist/components/ui/sheet.d.ts +5 -5
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +15 -14
- package/dist/components/ui/sidebar.d.ts +31 -31
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +79 -79
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/skeleton.js +3 -2
- package/dist/components/ui/slider.d.ts +2 -2
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +5 -5
- package/dist/components/ui/sonner.d.ts +1 -1
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +9 -8
- package/dist/components/ui/spinner.d.ts +1 -1
- package/dist/components/ui/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner.js +4 -3
- 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 +9 -9
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +10 -9
- package/dist/components/ui/tabs.d.ts +2 -2
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +7 -7
- package/dist/components/ui/textarea.d.ts +2 -2
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea.js +3 -2
- package/dist/components/ui/toggle-group.d.ts +4 -4
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +9 -8
- package/dist/components/ui/toggle.d.ts +3 -3
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +11 -10
- package/dist/components/ui/tooltip.d.ts +2 -2
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +4 -4
- package/dist/hooks/use-mobile.js +3 -3
- package/package.json +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { useIsMobile } from
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
const SIDEBAR_COOKIE_NAME =
|
|
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
16
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
17
|
-
const SIDEBAR_WIDTH =
|
|
18
|
-
const SIDEBAR_WIDTH_MOBILE =
|
|
19
|
-
const SIDEBAR_WIDTH_ICON =
|
|
20
|
-
const SIDEBAR_KEYBOARD_SHORTCUT =
|
|
17
|
+
const SIDEBAR_WIDTH = '16rem';
|
|
18
|
+
const SIDEBAR_WIDTH_MOBILE = '18rem';
|
|
19
|
+
const SIDEBAR_WIDTH_ICON = '3rem';
|
|
20
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
|
|
21
21
|
const SidebarContext = React.createContext(null);
|
|
22
22
|
function useSidebar() {
|
|
23
23
|
const context = React.useContext(SidebarContext);
|
|
24
24
|
if (!context) {
|
|
25
|
-
throw new Error(
|
|
25
|
+
throw new Error('useSidebar must be used within a SidebarProvider.');
|
|
26
26
|
}
|
|
27
27
|
return context;
|
|
28
28
|
}
|
|
@@ -34,7 +34,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
34
34
|
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
35
35
|
const open = openProp ?? _open;
|
|
36
36
|
const setOpen = React.useCallback((value) => {
|
|
37
|
-
const openState = typeof value ===
|
|
37
|
+
const openState = typeof value === 'function' ? value(open) : value;
|
|
38
38
|
if (setOpenProp) {
|
|
39
39
|
setOpenProp(openState);
|
|
40
40
|
}
|
|
@@ -57,12 +57,12 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
57
57
|
toggleSidebar();
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
window.addEventListener(
|
|
61
|
-
return () => window.removeEventListener(
|
|
60
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
61
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
62
62
|
}, [toggleSidebar]);
|
|
63
63
|
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
64
64
|
// This makes it easier to style the sidebar with Tailwind classes.
|
|
65
|
-
const state = open ?
|
|
65
|
+
const state = open ? 'expanded' : 'collapsed';
|
|
66
66
|
const contextValue = React.useMemo(() => ({
|
|
67
67
|
state,
|
|
68
68
|
open,
|
|
@@ -73,140 +73,140 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
73
73
|
toggleSidebar,
|
|
74
74
|
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
|
|
75
75
|
return (_jsx(SidebarContext.Provider, { value: contextValue, children: _jsx(TooltipProvider, { delayDuration: 0, children: _jsx("div", { "data-slot": "sidebar-wrapper", style: {
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
'--sidebar-width': SIDEBAR_WIDTH,
|
|
77
|
+
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
|
|
78
78
|
...style,
|
|
79
|
-
}, className: cn(
|
|
79
|
+
}, className: cn('group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full', className), ...props, children: children }) }) }));
|
|
80
80
|
}
|
|
81
|
-
function Sidebar({ side =
|
|
81
|
+
function Sidebar({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas', className, children, ...props }) {
|
|
82
82
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
83
|
-
if (collapsible ===
|
|
84
|
-
return (_jsx("div", { "data-slot": "sidebar", className: cn(
|
|
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
85
|
}
|
|
86
86
|
if (isMobile) {
|
|
87
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
|
-
|
|
88
|
+
'--sidebar-width': SIDEBAR_WIDTH_MOBILE,
|
|
89
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
90
|
}
|
|
91
|
-
return (_jsxs("div", { className: "
|
|
92
|
-
?
|
|
93
|
-
:
|
|
94
|
-
?
|
|
95
|
-
:
|
|
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
96
|
// Adjust the padding for floating and inset variants.
|
|
97
|
-
variant ===
|
|
98
|
-
?
|
|
99
|
-
:
|
|
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
100
|
}
|
|
101
101
|
function SidebarTrigger({ className, onClick, ...props }) {
|
|
102
102
|
const { toggleSidebar } = useSidebar();
|
|
103
|
-
return (_jsxs(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "icon", className: cn(
|
|
103
|
+
return (_jsxs(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "icon", className: cn('size-7', className), onClick: (event) => {
|
|
104
104
|
onClick?.(event);
|
|
105
105
|
toggleSidebar();
|
|
106
106
|
}, ...props, children: [_jsx(PanelLeftIcon, {}), _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })] }));
|
|
107
107
|
}
|
|
108
108
|
function SidebarRail({ className, ...props }) {
|
|
109
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(
|
|
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
111
|
}
|
|
112
112
|
function SidebarInset({ className, ...props }) {
|
|
113
|
-
return (_jsx("main", { "data-slot": "sidebar-inset", className: cn(
|
|
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
114
|
}
|
|
115
115
|
function SidebarInput({ className, ...props }) {
|
|
116
|
-
return (_jsx(Input, { "data-slot": "sidebar-input", "data-sidebar": "input", className: cn(
|
|
116
|
+
return (_jsx(Input, { "data-slot": "sidebar-input", "data-sidebar": "input", className: cn('bg-background h-8 w-full shadow-none', className), ...props }));
|
|
117
117
|
}
|
|
118
118
|
function SidebarHeader({ className, ...props }) {
|
|
119
|
-
return (_jsx("div", { "data-slot": "sidebar-header", "data-sidebar": "header", className: cn(
|
|
119
|
+
return (_jsx("div", { "data-slot": "sidebar-header", "data-sidebar": "header", className: cn('flex flex-col gap-2 p-2', className), ...props }));
|
|
120
120
|
}
|
|
121
121
|
function SidebarFooter({ className, ...props }) {
|
|
122
|
-
return (_jsx("div", { "data-slot": "sidebar-footer", "data-sidebar": "footer", className: cn(
|
|
122
|
+
return (_jsx("div", { "data-slot": "sidebar-footer", "data-sidebar": "footer", className: cn('flex flex-col gap-2 p-2', className), ...props }));
|
|
123
123
|
}
|
|
124
124
|
function SidebarSeparator({ className, ...props }) {
|
|
125
|
-
return (_jsx(Separator, { "data-slot": "sidebar-separator", "data-sidebar": "separator", className: cn(
|
|
125
|
+
return (_jsx(Separator, { "data-slot": "sidebar-separator", "data-sidebar": "separator", className: cn('bg-sidebar-border mx-2 w-auto', className), ...props }));
|
|
126
126
|
}
|
|
127
127
|
function SidebarContent({ className, ...props }) {
|
|
128
|
-
return (_jsx("div", { "data-slot": "sidebar-content", "data-sidebar": "content", className: cn(
|
|
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
129
|
}
|
|
130
130
|
function SidebarGroup({ className, ...props }) {
|
|
131
|
-
return (_jsx("div", { "data-slot": "sidebar-group", "data-sidebar": "group", className: cn(
|
|
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
132
|
}
|
|
133
133
|
function SidebarGroupLabel({ className, asChild = false, ...props }) {
|
|
134
|
-
const Comp = asChild ? Slot :
|
|
135
|
-
return (_jsx(Comp, { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: cn(
|
|
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
136
|
}
|
|
137
137
|
function SidebarGroupAction({ className, asChild = false, ...props }) {
|
|
138
|
-
const Comp = asChild ? Slot :
|
|
139
|
-
return (_jsx(Comp, { "data-slot": "sidebar-group-action", "data-sidebar": "group-action", className: cn(
|
|
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
140
|
// Increases the hit area of the button on mobile.
|
|
141
|
-
|
|
141
|
+
'after:absolute after:-inset-2 md:after:hidden', 'group-data-[collapsible=icon]:hidden', className), ...props }));
|
|
142
142
|
}
|
|
143
143
|
function SidebarGroupContent({ className, ...props }) {
|
|
144
|
-
return (_jsx("div", { "data-slot": "sidebar-group-content", "data-sidebar": "group-content", className: cn(
|
|
144
|
+
return (_jsx("div", { "data-slot": "sidebar-group-content", "data-sidebar": "group-content", className: cn('w-full text-sm', className), ...props }));
|
|
145
145
|
}
|
|
146
146
|
function SidebarMenu({ className, ...props }) {
|
|
147
|
-
return (_jsx("ul", { "data-slot": "sidebar-menu", "data-sidebar": "menu", className: cn(
|
|
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
148
|
}
|
|
149
149
|
function SidebarMenuItem({ className, ...props }) {
|
|
150
|
-
return (_jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn(
|
|
150
|
+
return (_jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn('group/menu-item relative', className), ...props }));
|
|
151
151
|
}
|
|
152
|
-
const sidebarMenuButtonVariants = cva(
|
|
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
153
|
variants: {
|
|
154
154
|
variant: {
|
|
155
|
-
default:
|
|
156
|
-
outline:
|
|
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
157
|
},
|
|
158
158
|
size: {
|
|
159
|
-
default:
|
|
160
|
-
sm:
|
|
161
|
-
lg:
|
|
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
162
|
},
|
|
163
163
|
},
|
|
164
164
|
defaultVariants: {
|
|
165
|
-
variant:
|
|
166
|
-
size:
|
|
165
|
+
variant: 'default',
|
|
166
|
+
size: 'default',
|
|
167
167
|
},
|
|
168
168
|
});
|
|
169
|
-
function SidebarMenuButton({ asChild = false, isActive = false, variant =
|
|
170
|
-
const Comp = asChild ? Slot :
|
|
169
|
+
function SidebarMenuButton({ asChild = false, isActive = false, variant = 'default', size = 'default', tooltip, className, ...props }) {
|
|
170
|
+
const Comp = asChild ? Slot : 'button';
|
|
171
171
|
const { isMobile, state } = useSidebar();
|
|
172
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
173
|
if (!tooltip) {
|
|
174
174
|
return button;
|
|
175
175
|
}
|
|
176
|
-
if (typeof tooltip ===
|
|
176
|
+
if (typeof tooltip === 'string') {
|
|
177
177
|
tooltip = {
|
|
178
178
|
children: tooltip,
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { side: "right", align: "center", hidden: state !==
|
|
181
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { side: "right", align: "center", hidden: state !== 'collapsed' || isMobile, ...tooltip })] }));
|
|
182
182
|
}
|
|
183
183
|
function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }) {
|
|
184
|
-
const Comp = asChild ? Slot :
|
|
185
|
-
return (_jsx(Comp, { "data-slot": "sidebar-menu-action", "data-sidebar": "menu-action", className: cn(
|
|
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
186
|
// Increases the hit area of the button on mobile.
|
|
187
|
-
|
|
188
|
-
|
|
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
189
|
}
|
|
190
190
|
function SidebarMenuBadge({ className, ...props }) {
|
|
191
|
-
return (_jsx("div", { "data-slot": "sidebar-menu-badge", "data-sidebar": "menu-badge", className: cn(
|
|
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
192
|
}
|
|
193
193
|
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
194
194
|
// Random width between 50 to 90%.
|
|
195
195
|
const width = React.useMemo(() => {
|
|
196
196
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
197
197
|
}, []);
|
|
198
|
-
return (_jsxs("div", { "data-slot": "sidebar-menu-skeleton", "data-sidebar": "menu-skeleton", className: cn(
|
|
199
|
-
|
|
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
200
|
} })] }));
|
|
201
201
|
}
|
|
202
202
|
function SidebarMenuSub({ className, ...props }) {
|
|
203
|
-
return (_jsx("ul", { "data-slot": "sidebar-menu-sub", "data-sidebar": "menu-sub", className: cn(
|
|
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
204
|
}
|
|
205
205
|
function SidebarMenuSubItem({ className, ...props }) {
|
|
206
|
-
return (_jsx("li", { "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item", className: cn(
|
|
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
207
|
}
|
|
208
|
-
function SidebarMenuSubButton({ asChild = false, size =
|
|
209
|
-
const Comp = asChild ? Slot :
|
|
210
|
-
return (_jsx(Comp, { "data-slot": "sidebar-menu-sub-button", "data-sidebar": "menu-sub-button", "data-size": size, "data-active": isActive, className: cn(
|
|
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
211
|
}
|
|
212
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, };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare function Skeleton({ className, ...props }: React.ComponentProps<
|
|
1
|
+
declare function Skeleton({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export { Skeleton };
|
|
3
3
|
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/ui/skeleton.tsx"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
3
4
|
function Skeleton({ className, ...props }) {
|
|
4
|
-
return (_jsx("div", { "data-slot": "skeleton", className: cn(
|
|
5
|
+
return (_jsx("div", { "data-slot": "skeleton", className: cn('bg-accent animate-pulse rounded-md', className), ...props }));
|
|
5
6
|
}
|
|
6
7
|
export { Skeleton };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
declare function Slider({ className, defaultValue, value, min, max, ...props }: React.ComponentProps<typeof SliderPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export { Slider };
|
|
5
5
|
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../src/components/ui/slider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
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"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import { cn } from
|
|
3
|
+
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { cn } from '../../lib/utils';
|
|
6
6
|
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
|
7
7
|
const _values = React.useMemo(() => Array.isArray(value)
|
|
8
8
|
? value
|
|
9
9
|
: Array.isArray(defaultValue)
|
|
10
10
|
? defaultValue
|
|
11
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(
|
|
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
13
|
}
|
|
14
14
|
export { Slider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../../src/components/ui/sonner.tsx"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, } from
|
|
3
|
-
import { useTheme } from
|
|
4
|
-
import { Toaster as Sonner } from
|
|
3
|
+
import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon, } from 'lucide-react';
|
|
4
|
+
import { useTheme } from 'next-themes';
|
|
5
|
+
import { Toaster as Sonner } from 'sonner';
|
|
5
6
|
const Toaster = ({ ...props }) => {
|
|
6
|
-
const { theme =
|
|
7
|
+
const { theme = 'system' } = useTheme();
|
|
7
8
|
return (_jsx(Sonner, { theme: theme, className: "toaster group", icons: {
|
|
8
9
|
success: _jsx(CircleCheckIcon, { className: "size-4" }),
|
|
9
10
|
info: _jsx(InfoIcon, { className: "size-4" }),
|
|
@@ -11,10 +12,10 @@ const Toaster = ({ ...props }) => {
|
|
|
11
12
|
error: _jsx(OctagonXIcon, { className: "size-4" }),
|
|
12
13
|
loading: _jsx(Loader2Icon, { className: "size-4 animate-spin" }),
|
|
13
14
|
}, style: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
'--normal-bg': 'var(--popover)',
|
|
16
|
+
'--normal-text': 'var(--popover-foreground)',
|
|
17
|
+
'--normal-border': 'var(--border)',
|
|
18
|
+
'--border-radius': 'var(--radius)',
|
|
18
19
|
}, ...props }));
|
|
19
20
|
};
|
|
20
21
|
export { Toaster };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare function Spinner({ className, ...props }: React.ComponentProps<
|
|
1
|
+
declare function Spinner({ className, ...props }: React.ComponentProps<'svg'>): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export { Spinner };
|
|
3
3
|
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/ui/spinner.tsx"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Loader2Icon } from
|
|
3
|
-
import { cn } from
|
|
3
|
+
import { Loader2Icon } from 'lucide-react';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
4
5
|
function Spinner({ className, ...props }) {
|
|
5
|
-
return (_jsx(Loader2Icon, { role: "status", "aria-label": "Loading", className: cn(
|
|
6
|
+
return (_jsx(Loader2Icon, { role: "status", "aria-label": "Loading", className: cn('size-4 animate-spin', className), ...props }));
|
|
6
7
|
}
|
|
7
8
|
export { Spinner };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
2
|
+
import * as React from 'react';
|
|
3
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 SwitchPrimitive from
|
|
4
|
-
import { cn } from
|
|
3
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
5
|
function Switch({ className, ...props }) {
|
|
6
|
-
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", className: cn(
|
|
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
7
|
}
|
|
8
8
|
export { Switch };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
declare function Table({ className, ...props }: React.ComponentProps<
|
|
3
|
-
declare function TableHeader({ className, ...props }: React.ComponentProps<
|
|
4
|
-
declare function TableBody({ className, ...props }: React.ComponentProps<
|
|
5
|
-
declare function TableFooter({ className, ...props }: React.ComponentProps<
|
|
6
|
-
declare function TableRow({ className, ...props }: React.ComponentProps<
|
|
7
|
-
declare function TableHead({ className, ...props }: React.ComponentProps<
|
|
8
|
-
declare function TableCell({ className, ...props }: React.ComponentProps<
|
|
9
|
-
declare function TableCaption({ className, ...props }: React.ComponentProps<
|
|
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
10
|
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
11
11
|
//# sourceMappingURL=table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/components/ui/table.tsx"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
3
4
|
function Table({ className, ...props }) {
|
|
4
|
-
return (_jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: _jsx("table", { "data-slot": "table", className: cn(
|
|
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 }) }));
|
|
5
6
|
}
|
|
6
7
|
function TableHeader({ className, ...props }) {
|
|
7
|
-
return (_jsx("thead", { "data-slot": "table-header", className: cn(
|
|
8
|
+
return (_jsx("thead", { "data-slot": "table-header", className: cn('[&_tr]:border-b', className), ...props }));
|
|
8
9
|
}
|
|
9
10
|
function TableBody({ className, ...props }) {
|
|
10
|
-
return (_jsx("tbody", { "data-slot": "table-body", className: cn(
|
|
11
|
+
return (_jsx("tbody", { "data-slot": "table-body", className: cn('[&_tr:last-child]:border-0', className), ...props }));
|
|
11
12
|
}
|
|
12
13
|
function TableFooter({ className, ...props }) {
|
|
13
|
-
return (_jsx("tfoot", { "data-slot": "table-footer", className: cn(
|
|
14
|
+
return (_jsx("tfoot", { "data-slot": "table-footer", className: cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className), ...props }));
|
|
14
15
|
}
|
|
15
16
|
function TableRow({ className, ...props }) {
|
|
16
|
-
return (_jsx("tr", { "data-slot": "table-row", className: cn(
|
|
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 }));
|
|
17
18
|
}
|
|
18
19
|
function TableHead({ className, ...props }) {
|
|
19
|
-
return (_jsx("th", { "data-slot": "table-head", className: cn(
|
|
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 }));
|
|
20
21
|
}
|
|
21
22
|
function TableCell({ className, ...props }) {
|
|
22
|
-
return (_jsx("td", { "data-slot": "table-cell", className: cn(
|
|
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 }));
|
|
23
24
|
}
|
|
24
25
|
function TableCaption({ className, ...props }) {
|
|
25
|
-
return (_jsx("caption", { "data-slot": "table-caption", className: cn(
|
|
26
|
+
return (_jsx("caption", { "data-slot": "table-caption", className: cn('text-muted-foreground mt-4 text-sm', className), ...props }));
|
|
26
27
|
}
|
|
27
28
|
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
declare function Tabs({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
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"}
|