@xwadex/fesd-next 0.3.4-7.9 → 0.3.4-9
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/index.d.ts +186 -2
- package/dist/components/index.js +9561 -2
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.d.ts +68 -10
- package/dist/hooks/index.js +9243 -10
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.d.ts +55 -5
- package/dist/index.js +36374 -5
- package/dist/index.js.map +1 -0
- package/dist/shadcns/index.d.ts +490 -48
- package/dist/shadcns/index.js +32495 -48
- package/dist/shadcns/index.js.map +1 -0
- package/dist/types/index.d.ts +17 -2
- package/dist/types/index.js +3 -2
- package/dist/types/index.js.map +1 -0
- package/dist/useAnchors-BzgJT2J9.d.ts +78 -0
- package/dist/utils/index.d.ts +12 -10
- package/dist/utils/index.js +56 -63
- package/dist/utils/index.js.map +1 -0
- package/package.json +11 -5
- package/dist/components/anchors/anchors.d.ts +0 -16
- package/dist/components/anchors/anchors.js +0 -26
- package/dist/components/anchors/index.d.ts +0 -1
- package/dist/components/anchors/index.js +0 -1
- package/dist/components/tests/index.d.ts +0 -1
- package/dist/components/tests/index.js +0 -1
- package/dist/components/tests/tests.d.ts +0 -4
- package/dist/components/tests/tests.js +0 -10
- package/dist/hooks/useAnchors.d.ts +0 -65
- package/dist/hooks/useAnchors.js +0 -170
- package/dist/hooks/useAsyncFetcher.d.ts +0 -11
- package/dist/hooks/useAsyncFetcher.js +0 -40
- package/dist/hooks/useCookies.d.ts +0 -6
- package/dist/hooks/useCookies.js +0 -19
- package/dist/hooks/useDebounce.d.ts +0 -7
- package/dist/hooks/useDebounce.js +0 -16
- package/dist/hooks/useDebounceValue.d.ts +0 -1
- package/dist/hooks/useDebounceValue.js +0 -17
- package/dist/hooks/useDragResize.d.ts +0 -22
- package/dist/hooks/useDragResize.js +0 -75
- package/dist/hooks/useEffectLeave.d.ts +0 -1
- package/dist/hooks/useEffectLeave.js +0 -12
- package/dist/hooks/useEffectOne.d.ts +0 -1
- package/dist/hooks/useEffectOne.js +0 -12
- package/dist/hooks/useHash.d.ts +0 -1
- package/dist/hooks/useHash.js +0 -19
- package/dist/hooks/useLocations.d.ts +0 -13
- package/dist/hooks/useLocations.js +0 -25
- package/dist/hooks/useMounted.d.ts +0 -3
- package/dist/hooks/useMounted.js +0 -7
- package/dist/hooks/useScrollContainers.d.ts +0 -27
- package/dist/hooks/useScrollContainers.js +0 -53
- package/dist/shadcns/components/ui/accordion.d.ts +0 -7
- package/dist/shadcns/components/ui/accordion.js +0 -18
- package/dist/shadcns/components/ui/alert-dialog.d.ts +0 -14
- package/dist/shadcns/components/ui/alert-dialog.js +0 -38
- package/dist/shadcns/components/ui/alert.d.ts +0 -9
- package/dist/shadcns/components/ui/alert.js +0 -25
- package/dist/shadcns/components/ui/aspect-ratio.d.ts +0 -3
- package/dist/shadcns/components/ui/aspect-ratio.js +0 -7
- package/dist/shadcns/components/ui/avatar.d.ts +0 -6
- package/dist/shadcns/components/ui/avatar.js +0 -14
- package/dist/shadcns/components/ui/badge.d.ts +0 -9
- package/dist/shadcns/components/ui/badge.js +0 -23
- package/dist/shadcns/components/ui/breadcrumb.d.ts +0 -11
- package/dist/shadcns/components/ui/breadcrumb.js +0 -27
- package/dist/shadcns/components/ui/button.d.ts +0 -10
- package/dist/shadcns/components/ui/button.js +0 -32
- package/dist/shadcns/components/ui/calendar.d.ts +0 -8
- package/dist/shadcns/components/ui/calendar.js +0 -73
- package/dist/shadcns/components/ui/card.d.ts +0 -9
- package/dist/shadcns/components/ui/card.js +0 -25
- package/dist/shadcns/components/ui/carousel.d.ts +0 -19
- package/dist/shadcns/components/ui/carousel.js +0 -91
- package/dist/shadcns/components/ui/chart.d.ts +0 -40
- package/dist/shadcns/components/ui/chart.js +0 -114
- package/dist/shadcns/components/ui/checkbox.d.ts +0 -4
- package/dist/shadcns/components/ui/checkbox.js +0 -9
- package/dist/shadcns/components/ui/collapsible.d.ts +0 -5
- package/dist/shadcns/components/ui/collapsible.js +0 -13
- package/dist/shadcns/components/ui/command.d.ts +0 -18
- package/dist/shadcns/components/ui/command.js +0 -33
- package/dist/shadcns/components/ui/context-menu.d.ts +0 -25
- package/dist/shadcns/components/ui/context-menu.js +0 -51
- package/dist/shadcns/components/ui/dialog.d.ts +0 -15
- package/dist/shadcns/components/ui/dialog.js +0 -36
- package/dist/shadcns/components/ui/drawer.d.ts +0 -13
- package/dist/shadcns/components/ui/drawer.js +0 -35
- package/dist/shadcns/components/ui/dropdown-menu.d.ts +0 -25
- package/dist/shadcns/components/ui/dropdown-menu.js +0 -51
- package/dist/shadcns/components/ui/form.d.ts +0 -24
- package/dist/shadcns/components/ui/form.js +0 -56
- package/dist/shadcns/components/ui/hover-card.d.ts +0 -6
- package/dist/shadcns/components/ui/hover-card.js +0 -14
- package/dist/shadcns/components/ui/input-otp.d.ts +0 -11
- package/dist/shadcns/components/ui/input-otp.js +0 -21
- package/dist/shadcns/components/ui/input.d.ts +0 -3
- package/dist/shadcns/components/ui/input.js +0 -6
- package/dist/shadcns/components/ui/label.d.ts +0 -4
- package/dist/shadcns/components/ui/label.js +0 -8
- package/dist/shadcns/components/ui/menubar.d.ts +0 -26
- package/dist/shadcns/components/ui/menubar.js +0 -54
- package/dist/shadcns/components/ui/navigation-menu.d.ts +0 -14
- package/dist/shadcns/components/ui/navigation-menu.js +0 -32
- package/dist/shadcns/components/ui/pagination.d.ts +0 -13
- package/dist/shadcns/components/ui/pagination.js +0 -28
- package/dist/shadcns/components/ui/popover.d.ts +0 -7
- package/dist/shadcns/components/ui/popover.js +0 -17
- package/dist/shadcns/components/ui/progress.d.ts +0 -4
- package/dist/shadcns/components/ui/progress.js +0 -8
- package/dist/shadcns/components/ui/radio-group.d.ts +0 -5
- package/dist/shadcns/components/ui/radio-group.js +0 -12
- package/dist/shadcns/components/ui/resizable.d.ts +0 -8
- package/dist/shadcns/components/ui/resizable.js +0 -15
- package/dist/shadcns/components/ui/scroll-area.d.ts +0 -5
- package/dist/shadcns/components/ui/scroll-area.js +0 -11
- package/dist/shadcns/components/ui/select.d.ts +0 -15
- package/dist/shadcns/components/ui/select.js +0 -38
- package/dist/shadcns/components/ui/separator.d.ts +0 -4
- package/dist/shadcns/components/ui/separator.js +0 -8
- package/dist/shadcns/components/ui/sheet.d.ts +0 -13
- package/dist/shadcns/components/ui/sheet.js +0 -40
- package/dist/shadcns/components/ui/sidebar.d.ts +0 -66
- package/dist/shadcns/components/ui/sidebar.js +0 -204
- package/dist/shadcns/components/ui/skeleton.d.ts +0 -2
- package/dist/shadcns/components/ui/skeleton.js +0 -6
- package/dist/shadcns/components/ui/slider.d.ts +0 -4
- package/dist/shadcns/components/ui/slider.js +0 -10
- package/dist/shadcns/components/ui/sonner.d.ts +0 -3
- package/dist/shadcns/components/ui/sonner.js +0 -13
- package/dist/shadcns/components/ui/switch.d.ts +0 -4
- package/dist/shadcns/components/ui/switch.js +0 -8
- package/dist/shadcns/components/ui/table.d.ts +0 -10
- package/dist/shadcns/components/ui/table.js +0 -28
- package/dist/shadcns/components/ui/tabs.d.ts +0 -7
- package/dist/shadcns/components/ui/tabs.js +0 -17
- package/dist/shadcns/components/ui/textarea.d.ts +0 -3
- package/dist/shadcns/components/ui/textarea.js +0 -7
- package/dist/shadcns/components/ui/toggle-group.d.ts +0 -7
- package/dist/shadcns/components/ui/toggle-group.js +0 -20
- package/dist/shadcns/components/ui/toggle.d.ts +0 -9
- package/dist/shadcns/components/ui/toggle.js +0 -26
- package/dist/shadcns/components/ui/tooltip.d.ts +0 -7
- package/dist/shadcns/components/ui/tooltip.js +0 -17
- package/dist/shadcns/hooks/use-mobile.d.ts +0 -1
- package/dist/shadcns/hooks/use-mobile.js +0 -15
- package/dist/shadcns/lib/utils.d.ts +0 -2
- package/dist/shadcns/lib/utils.js +0 -5
- package/dist/types/components.type.d.ts +0 -9
- package/dist/types/components.type.js +0 -1
- package/dist/types/shadcns.type.d.ts +0 -6
- package/dist/types/shadcns.type.js +0 -2
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';
|
|
3
|
-
import { cn, buttonVariants } from '../../index.js';
|
|
4
|
-
function Pagination({ className, ...props }) {
|
|
5
|
-
return (_jsx("nav", { role: "navigation", "aria-label": "pagination", "data-slot": "pagination", className: cn('mx-auto flex w-full justify-center', className), ...props }));
|
|
6
|
-
}
|
|
7
|
-
function PaginationContent({ className, ...props }) {
|
|
8
|
-
return (_jsx("ul", { "data-slot": "pagination-content", className: cn('flex flex-row items-center gap-1', className), ...props }));
|
|
9
|
-
}
|
|
10
|
-
function PaginationItem({ ...props }) {
|
|
11
|
-
return _jsx("li", { "data-slot": "pagination-item", ...props });
|
|
12
|
-
}
|
|
13
|
-
function PaginationLink({ className, isActive, size = 'icon', ...props }) {
|
|
14
|
-
return (_jsx("a", { "aria-current": isActive ? 'page' : undefined, "data-slot": "pagination-link", "data-active": isActive, className: cn(buttonVariants({
|
|
15
|
-
variant: isActive ? 'outline' : 'ghost',
|
|
16
|
-
size,
|
|
17
|
-
}), className), ...props }));
|
|
18
|
-
}
|
|
19
|
-
function PaginationPrevious({ className, ...props }) {
|
|
20
|
-
return (_jsxs(PaginationLink, { "aria-label": "Go to previous page", size: "default", className: cn('gap-1 px-2.5 sm:pl-2.5', className), ...props, children: [_jsx(ChevronLeftIcon, {}), _jsx("span", { className: "hidden sm:block", children: "Previous" })] }));
|
|
21
|
-
}
|
|
22
|
-
function PaginationNext({ className, ...props }) {
|
|
23
|
-
return (_jsxs(PaginationLink, { "aria-label": "Go to next page", size: "default", className: cn('gap-1 px-2.5 sm:pr-2.5', className), ...props, children: [_jsx("span", { className: "hidden sm:block", children: "Next" }), _jsx(ChevronRightIcon, {})] }));
|
|
24
|
-
}
|
|
25
|
-
function PaginationEllipsis({ className, ...props }) {
|
|
26
|
-
return (_jsxs("span", { "aria-hidden": true, "data-slot": "pagination-ellipsis", className: cn('flex size-9 items-center justify-center', className), ...props, children: [_jsx(MoreHorizontalIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "More pages" })] }));
|
|
27
|
-
}
|
|
28
|
-
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
|
-
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
4
|
-
import { cn } from '../../index.js';
|
|
5
|
-
function Popover({ ...props }) {
|
|
6
|
-
return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
7
|
-
}
|
|
8
|
-
function PopoverTrigger({ ...props }) {
|
|
9
|
-
return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
10
|
-
}
|
|
11
|
-
function PopoverContent({ className, align = 'center', sideOffset = 4, ...props }) {
|
|
12
|
-
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden', className), ...props }) }));
|
|
13
|
-
}
|
|
14
|
-
function PopoverAnchor({ ...props }) {
|
|
15
|
-
return _jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
16
|
-
}
|
|
17
|
-
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
3
|
-
declare function Progress({ className, value, ...props }: React.ComponentProps<typeof ProgressPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export { Progress };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
4
|
-
import { cn } from '../../index.js';
|
|
5
|
-
function Progress({ className, value, ...props }) {
|
|
6
|
-
return (_jsx(ProgressPrimitive.Root, { "data-slot": "progress", className: cn('bg-primary/20 relative h-2 w-full overflow-hidden rounded-full', className), ...props, children: _jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", className: "bg-primary h-full w-full flex-1 transition-all", style: { transform: `translateX(-${100 - (value || 0)}%)` } }) }));
|
|
7
|
-
}
|
|
8
|
-
export { Progress };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
-
declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
4
|
-
import { CircleIcon } from 'lucide-react';
|
|
5
|
-
import { cn } from '../../index.js';
|
|
6
|
-
function RadioGroup({ className, ...props }) {
|
|
7
|
-
return (_jsx(RadioGroupPrimitive.Root, { "data-slot": "radio-group", className: cn('grid gap-3', className), ...props }));
|
|
8
|
-
}
|
|
9
|
-
function RadioGroupItem({ className, ...props }) {
|
|
10
|
-
return (_jsx(RadioGroupPrimitive.Item, { "data-slot": "radio-group-item", className: cn('border-input text-primary 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 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50', className), ...props, children: _jsx(RadioGroupPrimitive.Indicator, { "data-slot": "radio-group-indicator", className: "relative flex items-center justify-center", children: _jsx(CircleIcon, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" }) }) }));
|
|
11
|
-
}
|
|
12
|
-
export { RadioGroup, RadioGroupItem };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
3
|
-
declare function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function ResizablePanel({ ...props }: React.ComponentProps<typeof ResizablePrimitive.Panel>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function ResizableHandle({ withHandle, className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
6
|
-
withHandle?: boolean;
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { GripVerticalIcon } from 'lucide-react';
|
|
4
|
-
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
5
|
-
import { cn } from '../../index.js';
|
|
6
|
-
function ResizablePanelGroup({ className, ...props }) {
|
|
7
|
-
return (_jsx(ResizablePrimitive.PanelGroup, { "data-slot": "resizable-panel-group", className: cn('flex h-full w-full data-[panel-group-direction=vertical]:flex-col', className), ...props }));
|
|
8
|
-
}
|
|
9
|
-
function ResizablePanel({ ...props }) {
|
|
10
|
-
return _jsx(ResizablePrimitive.Panel, { "data-slot": "resizable-panel", ...props });
|
|
11
|
-
}
|
|
12
|
-
function ResizableHandle({ withHandle, className, ...props }) {
|
|
13
|
-
return (_jsx(ResizablePrimitive.PanelResizeHandle, { "data-slot": "resizable-handle", className: cn('bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90', className), ...props, children: withHandle && (_jsx("div", { className: "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border", children: _jsx(GripVerticalIcon, { className: "size-2.5" }) })) }));
|
|
14
|
-
}
|
|
15
|
-
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
3
|
-
declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export { ScrollArea, ScrollBar };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
4
|
-
import { cn } from '../../index.js';
|
|
5
|
-
function ScrollArea({ className, children, ...props }) {
|
|
6
|
-
return (_jsxs(ScrollAreaPrimitive.Root, { "data-slot": "scroll-area", className: cn('relative', className), ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { "data-slot": "scroll-area-viewport", className: "focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1", children: children }), _jsx(ScrollBar, {}), _jsx(ScrollAreaPrimitive.Corner, {})] }));
|
|
7
|
-
}
|
|
8
|
-
function ScrollBar({ className, orientation = 'vertical', ...props }) {
|
|
9
|
-
return (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, { "data-slot": "scroll-area-scrollbar", orientation: orientation, className: cn('flex touch-none p-px transition-colors select-none', orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent', orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent', className), ...props, children: _jsx(ScrollAreaPrimitive.ScrollAreaThumb, { "data-slot": "scroll-area-thumb", className: "bg-border relative flex-1 rounded-full" }) }));
|
|
10
|
-
}
|
|
11
|
-
export { ScrollArea, ScrollBar };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
3
|
-
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
-
size?: 'sm' | 'default';
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
4
|
-
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
|
|
5
|
-
import { cn } from '../../index.js';
|
|
6
|
-
function Select({ ...props }) {
|
|
7
|
-
return _jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
8
|
-
}
|
|
9
|
-
function SelectGroup({ ...props }) {
|
|
10
|
-
return _jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
|
|
11
|
-
}
|
|
12
|
-
function SelectValue({ ...props }) {
|
|
13
|
-
return _jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
14
|
-
}
|
|
15
|
-
function SelectTrigger({ className, size = 'default', children, ...props }) {
|
|
16
|
-
return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]: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 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })] }));
|
|
17
|
-
}
|
|
18
|
-
function SelectContent({ className, children, position = 'popper', ...props }) {
|
|
19
|
-
return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { "data-slot": "select-content", className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md', position === 'popper' &&
|
|
20
|
-
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), position: position, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn('p-1', position === 'popper' &&
|
|
21
|
-
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1'), children: children }), _jsx(SelectScrollDownButton, {})] }) }));
|
|
22
|
-
}
|
|
23
|
-
function SelectLabel({ className, ...props }) {
|
|
24
|
-
return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn('text-muted-foreground px-2 py-1.5 text-xs', className), ...props }));
|
|
25
|
-
}
|
|
26
|
-
function SelectItem({ className, children, ...props }) {
|
|
27
|
-
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className), ...props, children: [_jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] }));
|
|
28
|
-
}
|
|
29
|
-
function SelectSeparator({ className, ...props }) {
|
|
30
|
-
return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn('bg-border pointer-events-none -mx-1 my-1 h-px', className), ...props }));
|
|
31
|
-
}
|
|
32
|
-
function SelectScrollUpButton({ className, ...props }) {
|
|
33
|
-
return (_jsx(SelectPrimitive.ScrollUpButton, { "data-slot": "select-scroll-up-button", className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: _jsx(ChevronUpIcon, { className: "size-4" }) }));
|
|
34
|
-
}
|
|
35
|
-
function SelectScrollDownButton({ className, ...props }) {
|
|
36
|
-
return (_jsx(SelectPrimitive.ScrollDownButton, { "data-slot": "select-scroll-down-button", className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: _jsx(ChevronDownIcon, { className: "size-4" }) }));
|
|
37
|
-
}
|
|
38
|
-
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
3
|
-
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export { Separator };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
4
|
-
import { cn } from '../../index.js';
|
|
5
|
-
function Separator({ className, orientation = 'horizontal', decorative = true, ...props }) {
|
|
6
|
-
return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn('bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px', className), ...props }));
|
|
7
|
-
}
|
|
8
|
-
export { Separator };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
3
|
-
declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
7
|
-
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
8
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare function SheetHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
declare function SheetFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
4
|
-
import { XIcon } from 'lucide-react';
|
|
5
|
-
import { cn } from '../../index.js';
|
|
6
|
-
function Sheet({ ...props }) {
|
|
7
|
-
return _jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
8
|
-
}
|
|
9
|
-
function SheetTrigger({ ...props }) {
|
|
10
|
-
return _jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
|
|
11
|
-
}
|
|
12
|
-
function SheetClose({ ...props }) {
|
|
13
|
-
return _jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
|
|
14
|
-
}
|
|
15
|
-
function SheetPortal({ ...props }) {
|
|
16
|
-
return _jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
17
|
-
}
|
|
18
|
-
function SheetOverlay({ className, ...props }) {
|
|
19
|
-
return (_jsx(SheetPrimitive.Overlay, { "data-slot": "sheet-overlay", className: cn('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50', className), ...props }));
|
|
20
|
-
}
|
|
21
|
-
function SheetContent({ className, children, side = 'right', ...props }) {
|
|
22
|
-
return (_jsxs(SheetPortal, { children: [_jsx(SheetOverlay, {}), _jsxs(SheetPrimitive.Content, { "data-slot": "sheet-content", className: cn('bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500', side === 'right' &&
|
|
23
|
-
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm', side === 'left' &&
|
|
24
|
-
'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm', side === 'top' &&
|
|
25
|
-
'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b', side === 'bottom' &&
|
|
26
|
-
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t', className), ...props, children: [children, _jsxs(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [_jsx(XIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] })] }));
|
|
27
|
-
}
|
|
28
|
-
function SheetHeader({ className, ...props }) {
|
|
29
|
-
return (_jsx("div", { "data-slot": "sheet-header", className: cn('flex flex-col gap-1.5 p-4', className), ...props }));
|
|
30
|
-
}
|
|
31
|
-
function SheetFooter({ className, ...props }) {
|
|
32
|
-
return (_jsx("div", { "data-slot": "sheet-footer", className: cn('mt-auto flex flex-col gap-2 p-4', className), ...props }));
|
|
33
|
-
}
|
|
34
|
-
function SheetTitle({ className, ...props }) {
|
|
35
|
-
return (_jsx(SheetPrimitive.Title, { "data-slot": "sheet-title", className: cn('text-foreground font-semibold', className), ...props }));
|
|
36
|
-
}
|
|
37
|
-
function SheetDescription({ className, ...props }) {
|
|
38
|
-
return (_jsx(SheetPrimitive.Description, { "data-slot": "sheet-description", className: cn('text-muted-foreground text-sm', className), ...props }));
|
|
39
|
-
}
|
|
40
|
-
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import { Button, Input, Separator, TooltipContent } from '../../index.js';
|
|
4
|
-
type SidebarContextProps = {
|
|
5
|
-
state: 'expanded' | 'collapsed';
|
|
6
|
-
open: boolean;
|
|
7
|
-
setOpen: (open: boolean) => void;
|
|
8
|
-
openMobile: boolean;
|
|
9
|
-
setOpenMobile: (open: boolean) => void;
|
|
10
|
-
isMobile: boolean;
|
|
11
|
-
toggleSidebar: () => void;
|
|
12
|
-
};
|
|
13
|
-
declare function useSidebar(): SidebarContextProps;
|
|
14
|
-
declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<'div'> & {
|
|
15
|
-
defaultOpen?: boolean;
|
|
16
|
-
open?: boolean;
|
|
17
|
-
onOpenChange?: (open: boolean) => void;
|
|
18
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
declare function Sidebar({ side, variant, collapsible, className, children, ...props }: React.ComponentProps<'div'> & {
|
|
20
|
-
side?: 'left' | 'right';
|
|
21
|
-
variant?: 'sidebar' | 'floating' | 'inset';
|
|
22
|
-
collapsible?: 'offcanvas' | 'icon' | 'none';
|
|
23
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
declare function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
declare function SidebarRail({ className, ...props }: React.ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
declare function SidebarInset({ className, ...props }: React.ComponentProps<'main'>): import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
declare function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
declare function SidebarHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
declare function SidebarFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
declare function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
declare function SidebarContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
declare function SidebarGroup({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
declare function SidebarGroupLabel({ className, asChild, ...props }: React.ComponentProps<'div'> & {
|
|
34
|
-
asChild?: boolean;
|
|
35
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
declare function SidebarGroupAction({ className, asChild, ...props }: React.ComponentProps<'button'> & {
|
|
37
|
-
asChild?: boolean;
|
|
38
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
declare function SidebarGroupContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
40
|
-
declare function SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>): import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>): import("react/jsx-runtime").JSX.Element;
|
|
42
|
-
declare const sidebarMenuButtonVariants: (props?: ({
|
|
43
|
-
variant?: "default" | "outline" | null | undefined;
|
|
44
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
45
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
46
|
-
declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<'button'> & {
|
|
47
|
-
asChild?: boolean;
|
|
48
|
-
isActive?: boolean;
|
|
49
|
-
tooltip?: string | React.ComponentProps<typeof TooltipContent>;
|
|
50
|
-
} & VariantProps<typeof sidebarMenuButtonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
51
|
-
declare function SidebarMenuAction({ className, asChild, showOnHover, ...props }: React.ComponentProps<'button'> & {
|
|
52
|
-
asChild?: boolean;
|
|
53
|
-
showOnHover?: boolean;
|
|
54
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
55
|
-
declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
56
|
-
declare function SidebarMenuSkeleton({ className, showIcon, ...props }: React.ComponentProps<'div'> & {
|
|
57
|
-
showIcon?: boolean;
|
|
58
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
59
|
-
declare function SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>): import("react/jsx-runtime").JSX.Element;
|
|
60
|
-
declare function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>): import("react/jsx-runtime").JSX.Element;
|
|
61
|
-
declare function SidebarMenuSubButton({ asChild, size, isActive, className, ...props }: React.ComponentProps<'a'> & {
|
|
62
|
-
asChild?: boolean;
|
|
63
|
-
size?: 'sm' | 'md';
|
|
64
|
-
isActive?: boolean;
|
|
65
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
66
|
-
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,204 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
-
import { cva } from 'class-variance-authority';
|
|
6
|
-
import { PanelLeftIcon } from 'lucide-react';
|
|
7
|
-
import { cn, useIsMobile, Button, Input, Separator, Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Skeleton } from '../../index.js';
|
|
8
|
-
const SIDEBAR_COOKIE_NAME = 'sidebar_state';
|
|
9
|
-
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
10
|
-
const SIDEBAR_WIDTH = '16rem';
|
|
11
|
-
const SIDEBAR_WIDTH_MOBILE = '18rem';
|
|
12
|
-
const SIDEBAR_WIDTH_ICON = '3rem';
|
|
13
|
-
const SIDEBAR_KEYBOARD_SHORTCUT = 'b';
|
|
14
|
-
const SidebarContext = React.createContext(null);
|
|
15
|
-
function useSidebar() {
|
|
16
|
-
const context = React.useContext(SidebarContext);
|
|
17
|
-
if (!context) {
|
|
18
|
-
throw new Error('useSidebar must be used within a SidebarProvider.');
|
|
19
|
-
}
|
|
20
|
-
return context;
|
|
21
|
-
}
|
|
22
|
-
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }) {
|
|
23
|
-
const isMobile = useIsMobile();
|
|
24
|
-
const [openMobile, setOpenMobile] = React.useState(false);
|
|
25
|
-
// This is the internal state of the sidebar.
|
|
26
|
-
// We use openProp and setOpenProp for control from outside the component.
|
|
27
|
-
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
28
|
-
const open = openProp ?? _open;
|
|
29
|
-
const setOpen = React.useCallback((value) => {
|
|
30
|
-
const openState = typeof value === 'function' ? value(open) : value;
|
|
31
|
-
if (setOpenProp) {
|
|
32
|
-
setOpenProp(openState);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
_setOpen(openState);
|
|
36
|
-
}
|
|
37
|
-
// This sets the cookie to keep the sidebar state.
|
|
38
|
-
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
39
|
-
}, [setOpenProp, open]);
|
|
40
|
-
// Helper to toggle the sidebar.
|
|
41
|
-
const toggleSidebar = React.useCallback(() => {
|
|
42
|
-
return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);
|
|
43
|
-
}, [isMobile, setOpen, setOpenMobile]);
|
|
44
|
-
// Adds a keyboard shortcut to toggle the sidebar.
|
|
45
|
-
React.useEffect(() => {
|
|
46
|
-
const handleKeyDown = (event) => {
|
|
47
|
-
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
48
|
-
event.preventDefault();
|
|
49
|
-
toggleSidebar();
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
window.addEventListener('keydown', handleKeyDown);
|
|
53
|
-
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
54
|
-
}, [toggleSidebar]);
|
|
55
|
-
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
56
|
-
// This makes it easier to style the sidebar with Tailwind classes.
|
|
57
|
-
const state = open ? 'expanded' : 'collapsed';
|
|
58
|
-
const contextValue = React.useMemo(() => ({
|
|
59
|
-
state,
|
|
60
|
-
open,
|
|
61
|
-
setOpen,
|
|
62
|
-
isMobile,
|
|
63
|
-
openMobile,
|
|
64
|
-
setOpenMobile,
|
|
65
|
-
toggleSidebar,
|
|
66
|
-
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
|
|
67
|
-
return (_jsx(SidebarContext.Provider, { value: contextValue, children: _jsx(TooltipProvider, { delayDuration: 0, children: _jsx("div", { "data-slot": "sidebar-wrapper", style: {
|
|
68
|
-
'--sidebar-width': SIDEBAR_WIDTH,
|
|
69
|
-
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON,
|
|
70
|
-
...style,
|
|
71
|
-
}, className: cn('group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full', className), ...props, children: children }) }) }));
|
|
72
|
-
}
|
|
73
|
-
function Sidebar({ side = 'left', variant = 'sidebar', collapsible = 'offcanvas', className, children, ...props }) {
|
|
74
|
-
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
75
|
-
if (collapsible === 'none') {
|
|
76
|
-
return (_jsx("div", { "data-slot": "sidebar", className: cn('bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col', className), ...props, children: children }));
|
|
77
|
-
}
|
|
78
|
-
if (isMobile) {
|
|
79
|
-
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: {
|
|
80
|
-
'--sidebar-width': SIDEBAR_WIDTH_MOBILE,
|
|
81
|
-
}, 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 })] }) }));
|
|
82
|
-
}
|
|
83
|
-
return (_jsxs("div", { className: "group peer text-sidebar-foreground 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('relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear', 'group-data-[collapsible=offcanvas]:w-0', 'group-data-[side=right]:rotate-180', variant === 'floating' || variant === 'inset'
|
|
84
|
-
? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]'
|
|
85
|
-
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)') }), _jsx("div", { "data-slot": "sidebar-container", className: cn('fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex', side === 'left'
|
|
86
|
-
? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'
|
|
87
|
-
: 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',
|
|
88
|
-
// Adjust the padding for floating and inset variants.
|
|
89
|
-
variant === 'floating' || variant === 'inset'
|
|
90
|
-
? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'
|
|
91
|
-
: '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 }) })] }));
|
|
92
|
-
}
|
|
93
|
-
function SidebarTrigger({ className, onClick, ...props }) {
|
|
94
|
-
const { toggleSidebar } = useSidebar();
|
|
95
|
-
return (_jsxs(Button, { "data-sidebar": "trigger", "data-slot": "sidebar-trigger", variant: "ghost", size: "icon", className: cn('size-7', className), onClick: (event) => {
|
|
96
|
-
onClick?.(event);
|
|
97
|
-
toggleSidebar();
|
|
98
|
-
}, ...props, children: [_jsx(PanelLeftIcon, {}), _jsx("span", { className: "sr-only", children: "Toggle Sidebar" })] }));
|
|
99
|
-
}
|
|
100
|
-
function SidebarRail({ className, ...props }) {
|
|
101
|
-
const { toggleSidebar } = useSidebar();
|
|
102
|
-
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 group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] 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 }));
|
|
103
|
-
}
|
|
104
|
-
function SidebarInset({ className, ...props }) {
|
|
105
|
-
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]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2', className), ...props }));
|
|
106
|
-
}
|
|
107
|
-
function SidebarInput({ className, ...props }) {
|
|
108
|
-
return (_jsx(Input, { "data-slot": "sidebar-input", "data-sidebar": "input", className: cn('bg-background h-8 w-full shadow-none', className), ...props }));
|
|
109
|
-
}
|
|
110
|
-
function SidebarHeader({ className, ...props }) {
|
|
111
|
-
return (_jsx("div", { "data-slot": "sidebar-header", "data-sidebar": "header", className: cn('flex flex-col gap-2 p-2', className), ...props }));
|
|
112
|
-
}
|
|
113
|
-
function SidebarFooter({ className, ...props }) {
|
|
114
|
-
return (_jsx("div", { "data-slot": "sidebar-footer", "data-sidebar": "footer", className: cn('flex flex-col gap-2 p-2', className), ...props }));
|
|
115
|
-
}
|
|
116
|
-
function SidebarSeparator({ className, ...props }) {
|
|
117
|
-
return (_jsx(Separator, { "data-slot": "sidebar-separator", "data-sidebar": "separator", className: cn('bg-sidebar-border mx-2 w-auto', className), ...props }));
|
|
118
|
-
}
|
|
119
|
-
function SidebarContent({ className, ...props }) {
|
|
120
|
-
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 }));
|
|
121
|
-
}
|
|
122
|
-
function SidebarGroup({ className, ...props }) {
|
|
123
|
-
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 }));
|
|
124
|
-
}
|
|
125
|
-
function SidebarGroupLabel({ className, asChild = false, ...props }) {
|
|
126
|
-
const Comp = asChild ? Slot : 'div';
|
|
127
|
-
return (_jsx(Comp, { "data-slot": "sidebar-group-label", "data-sidebar": "group-label", className: cn('text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden 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 }));
|
|
128
|
-
}
|
|
129
|
-
function SidebarGroupAction({ className, asChild = false, ...props }) {
|
|
130
|
-
const Comp = asChild ? Slot : 'button';
|
|
131
|
-
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 absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
132
|
-
// Increases the hit area of the button on mobile.
|
|
133
|
-
'after:absolute after:-inset-2 md:after:hidden', 'group-data-[collapsible=icon]:hidden', className), ...props }));
|
|
134
|
-
}
|
|
135
|
-
function SidebarGroupContent({ className, ...props }) {
|
|
136
|
-
return (_jsx("div", { "data-slot": "sidebar-group-content", "data-sidebar": "group-content", className: cn('w-full text-sm', className), ...props }));
|
|
137
|
-
}
|
|
138
|
-
function SidebarMenu({ className, ...props }) {
|
|
139
|
-
return (_jsx("ul", { "data-slot": "sidebar-menu", "data-sidebar": "menu", className: cn('flex w-full min-w-0 flex-col gap-1', className), ...props }));
|
|
140
|
-
}
|
|
141
|
-
function SidebarMenuItem({ className, ...props }) {
|
|
142
|
-
return (_jsx("li", { "data-slot": "sidebar-menu-item", "data-sidebar": "menu-item", className: cn('group/menu-item relative', className), ...props }));
|
|
143
|
-
}
|
|
144
|
-
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', {
|
|
145
|
-
variants: {
|
|
146
|
-
variant: {
|
|
147
|
-
default: 'hover:bg-sidebar-accent hover:text-sidebar-accent-foreground',
|
|
148
|
-
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))]',
|
|
149
|
-
},
|
|
150
|
-
size: {
|
|
151
|
-
default: 'h-8 text-sm',
|
|
152
|
-
sm: 'h-7 text-xs',
|
|
153
|
-
lg: 'h-12 text-sm group-data-[collapsible=icon]:p-0!',
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
defaultVariants: {
|
|
157
|
-
variant: 'default',
|
|
158
|
-
size: 'default',
|
|
159
|
-
},
|
|
160
|
-
});
|
|
161
|
-
function SidebarMenuButton({ asChild = false, isActive = false, variant = 'default', size = 'default', tooltip, className, ...props }) {
|
|
162
|
-
const Comp = asChild ? Slot : 'button';
|
|
163
|
-
const { isMobile, state } = useSidebar();
|
|
164
|
-
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 }));
|
|
165
|
-
if (!tooltip) {
|
|
166
|
-
return button;
|
|
167
|
-
}
|
|
168
|
-
if (typeof tooltip === 'string') {
|
|
169
|
-
tooltip = {
|
|
170
|
-
children: tooltip,
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: button }), _jsx(TooltipContent, { side: "right", align: "center", hidden: state !== 'collapsed' || isMobile, ...tooltip })] }));
|
|
174
|
-
}
|
|
175
|
-
function SidebarMenuAction({ className, asChild = false, showOnHover = false, ...props }) {
|
|
176
|
-
const Comp = asChild ? Slot : 'button';
|
|
177
|
-
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 absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
178
|
-
// Increases the hit area of the button on mobile.
|
|
179
|
-
'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 &&
|
|
180
|
-
'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 }));
|
|
181
|
-
}
|
|
182
|
-
function SidebarMenuBadge({ className, ...props }) {
|
|
183
|
-
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 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none', 'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground', 'peer-data-[size=sm]/menu-button:top-1', 'peer-data-[size=default]/menu-button:top-1.5', 'peer-data-[size=lg]/menu-button:top-2.5', 'group-data-[collapsible=icon]:hidden', className), ...props }));
|
|
184
|
-
}
|
|
185
|
-
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
186
|
-
// Random width between 50 to 90%.
|
|
187
|
-
const width = React.useMemo(() => {
|
|
188
|
-
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
189
|
-
}, []);
|
|
190
|
-
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: "h-4 max-w-(--skeleton-width) flex-1", "data-sidebar": "menu-skeleton-text", style: {
|
|
191
|
-
'--skeleton-width': width,
|
|
192
|
-
} })] }));
|
|
193
|
-
}
|
|
194
|
-
function SidebarMenuSub({ className, ...props }) {
|
|
195
|
-
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 }));
|
|
196
|
-
}
|
|
197
|
-
function SidebarMenuSubItem({ className, ...props }) {
|
|
198
|
-
return (_jsx("li", { "data-slot": "sidebar-menu-sub-item", "data-sidebar": "menu-sub-item", className: cn('group/menu-sub-item relative', className), ...props }));
|
|
199
|
-
}
|
|
200
|
-
function SidebarMenuSubButton({ asChild = false, size = 'md', isActive = false, className, ...props }) {
|
|
201
|
-
const Comp = asChild ? Slot : 'a';
|
|
202
|
-
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 flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden 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 }));
|
|
203
|
-
}
|
|
204
|
-
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,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '../../index.js';
|
|
3
|
-
function Skeleton({ className, ...props }) {
|
|
4
|
-
return (_jsx("div", { "data-slot": "skeleton", className: cn('bg-accent animate-pulse rounded-md', className), ...props }));
|
|
5
|
-
}
|
|
6
|
-
export { Skeleton };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
3
|
-
declare function Slider({ className, defaultValue, value, min, max, ...props }: React.ComponentProps<typeof SliderPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export { Slider };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
5
|
-
import { cn } from '../../index.js';
|
|
6
|
-
function Slider({ className, defaultValue, value, min = 0, max = 100, ...props }) {
|
|
7
|
-
const _values = React.useMemo(() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max], [value, defaultValue, min, max]);
|
|
8
|
-
return (_jsxs(SliderPrimitive.Root, { "data-slot": "slider", defaultValue: defaultValue, value: value, min: min, max: max, className: cn('relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col', 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=horizontal]:w-full data-[orientation=vertical]:h-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 bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50" }, index)))] }));
|
|
9
|
-
}
|
|
10
|
-
export { Slider };
|