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