@codefast/ui 0.3.11-canary.1 → 0.3.11
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/CHANGELOG.md +36 -0
- package/README.md +34 -14
- package/dist/components/accordion.d.ts +29 -10
- package/dist/components/accordion.js +38 -37
- package/dist/components/alert-dialog.d.ts +60 -24
- package/dist/components/alert-dialog.js +69 -72
- package/dist/components/alert.d.ts +27 -15
- package/dist/components/alert.js +29 -31
- package/dist/components/aspect-ratio.d.ts +8 -4
- package/dist/components/aspect-ratio.js +7 -5
- package/dist/components/avatar.d.ts +17 -6
- package/dist/components/avatar.js +19 -17
- package/dist/components/badge.d.ts +21 -14
- package/dist/components/badge.js +19 -22
- package/dist/components/breadcrumb.d.ts +35 -12
- package/dist/components/breadcrumb.js +48 -54
- package/dist/components/button-group.d.ts +29 -14
- package/dist/components/button-group.js +27 -32
- package/dist/components/button.d.ts +35 -25
- package/dist/components/button.js +50 -48
- package/dist/components/calendar.d.ts +24 -9
- package/dist/components/calendar.js +92 -98
- package/dist/components/card.d.ts +34 -10
- package/dist/components/card.js +39 -37
- package/dist/components/carousel.d.ts +55 -24
- package/dist/components/carousel.js +113 -130
- package/dist/components/chart.d.ts +72 -36
- package/dist/components/chart.js +154 -166
- package/dist/components/checkbox-cards.d.ts +15 -8
- package/dist/components/checkbox-cards.js +22 -25
- package/dist/components/checkbox-group.d.ts +16 -8
- package/dist/components/checkbox-group.js +19 -19
- package/dist/components/checkbox.d.ts +9 -4
- package/dist/components/checkbox.js +14 -14
- package/dist/components/collapsible.d.ts +14 -6
- package/dist/components/collapsible.js +18 -16
- package/dist/components/command.d.ts +55 -23
- package/dist/components/command.js +70 -85
- package/dist/components/context-menu.d.ts +72 -22
- package/dist/components/context-menu.js +88 -109
- package/dist/components/dialog.d.ts +53 -22
- package/dist/components/dialog.js +71 -85
- package/dist/components/drawer.d.ts +60 -28
- package/dist/components/drawer.js +59 -67
- package/dist/components/dropdown-menu.d.ts +73 -22
- package/dist/components/dropdown-menu.js +95 -112
- package/dist/components/empty.d.ts +37 -15
- package/dist/components/empty.js +43 -45
- package/dist/components/field.d.ts +63 -25
- package/dist/components/field.js +88 -104
- package/dist/components/form.d.ts +37 -15
- package/dist/components/form.js +65 -70
- package/dist/components/hover-card.d.ts +21 -7
- package/dist/components/hover-card.js +24 -24
- package/dist/components/input-group.d.ts +53 -28
- package/dist/components/input-group.js +63 -77
- package/dist/components/input-number.d.ts +28 -7
- package/dist/components/input-number.js +55 -59
- package/dist/components/input-otp.d.ts +24 -10
- package/dist/components/input-otp.js +33 -37
- package/dist/components/input-password.d.ts +12 -5
- package/dist/components/input-password.js +31 -32
- package/dist/components/input-search.d.ts +18 -8
- package/dist/components/input-search.js +43 -41
- package/dist/components/input.d.ts +10 -4
- package/dist/components/input.js +9 -7
- package/dist/components/item.d.ts +69 -32
- package/dist/components/item.js +89 -92
- package/dist/components/kbd.d.ts +13 -5
- package/dist/components/kbd.js +13 -11
- package/dist/components/label.d.ts +9 -4
- package/dist/components/label.js +9 -7
- package/dist/components/menubar.d.ts +80 -23
- package/dist/components/menubar.js +97 -118
- package/dist/components/native-select.d.ts +16 -6
- package/dist/components/native-select.js +25 -26
- package/dist/components/navigation-menu.d.ts +36 -12
- package/dist/components/navigation-menu.js +60 -75
- package/dist/components/pagination.d.ts +35 -14
- package/dist/components/pagination.js +54 -69
- package/dist/components/popover.d.ts +24 -8
- package/dist/components/popover.js +28 -28
- package/dist/components/progress-circle.d.ts +106 -88
- package/dist/components/progress-circle.js +106 -138
- package/dist/components/progress.d.ts +10 -4
- package/dist/components/progress.js +14 -14
- package/dist/components/radio-cards.d.ts +10 -4
- package/dist/components/radio-cards.js +22 -23
- package/dist/components/radio-group.d.ts +13 -5
- package/dist/components/radio-group.js +18 -16
- package/dist/components/radio.d.ts +12 -5
- package/dist/components/radio.js +10 -8
- package/dist/components/resizable.d.ts +18 -7
- package/dist/components/resizable.js +22 -22
- package/dist/components/scroll-area.d.ts +33 -20
- package/dist/components/scroll-area.js +84 -88
- package/dist/components/select.d.ts +50 -16
- package/dist/components/select.js +77 -96
- package/dist/components/separator.d.ts +29 -19
- package/dist/components/separator.js +36 -34
- package/dist/components/sheet.d.ts +62 -29
- package/dist/components/sheet.js +79 -100
- package/dist/components/sidebar.d.ts +160 -66
- package/dist/components/sidebar.js +294 -336
- package/dist/components/skeleton.d.ts +9 -4
- package/dist/components/skeleton.js +8 -6
- package/dist/components/slider.d.ts +13 -4
- package/dist/components/slider.js +34 -40
- package/dist/components/sonner.d.ts +10 -7
- package/dist/components/sonner.js +16 -14
- package/dist/components/spinner.d.ts +12 -5
- package/dist/components/spinner.js +33 -35
- package/dist/components/switch.d.ts +9 -4
- package/dist/components/switch.js +13 -11
- package/dist/components/table.d.ts +37 -11
- package/dist/components/table.js +47 -45
- package/dist/components/tabs.d.ts +21 -7
- package/dist/components/tabs.js +24 -22
- package/dist/components/textarea.d.ts +9 -4
- package/dist/components/textarea.js +8 -6
- package/dist/components/toggle-group.d.ts +24 -9
- package/dist/components/toggle-group.js +41 -42
- package/dist/components/toggle.d.ts +25 -17
- package/dist/components/toggle.js +30 -28
- package/dist/components/tooltip.d.ts +24 -8
- package/dist/components/tooltip.js +29 -32
- package/dist/hooks/use-animated-value.d.ts +4 -1
- package/dist/hooks/use-animated-value.js +57 -36
- package/dist/hooks/use-copy-to-clipboard.d.ts +11 -5
- package/dist/hooks/use-copy-to-clipboard.js +39 -20
- package/dist/hooks/use-is-mobile.d.ts +4 -1
- package/dist/hooks/use-is-mobile.js +21 -1
- package/dist/hooks/use-media-query.d.ts +4 -1
- package/dist/hooks/use-media-query.js +45 -18
- package/dist/hooks/use-mutation-observer.d.ts +6 -2
- package/dist/hooks/use-mutation-observer.js +34 -16
- package/dist/hooks/use-pagination.d.ts +22 -14
- package/dist/hooks/use-pagination.js +100 -49
- package/dist/index.d.ts +69 -130
- package/dist/index.js +11 -11
- package/dist/primitives/checkbox-group.d.ts +105 -83
- package/dist/primitives/checkbox-group.js +111 -84
- package/dist/primitives/input-number.d.ts +51 -40
- package/dist/primitives/input-number.js +483 -350
- package/dist/primitives/input.d.ts +48 -42
- package/dist/primitives/input.js +65 -43
- package/dist/primitives/progress-circle.d.ts +79 -48
- package/dist/primitives/progress-circle.js +154 -105
- package/package.json +6 -7
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
2
|
import { cn, tv } from "@codefast/tailwind-variants";
|
|
4
|
-
import {
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
5
|
+
//#region src/components/separator.tsx
|
|
5
6
|
const separatorVariants = tv({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
base: "relative flex shrink-0 items-center bg-border",
|
|
8
|
+
defaultVariants: {
|
|
9
|
+
align: "center",
|
|
10
|
+
orientation: "horizontal"
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
align: {
|
|
14
|
+
center: "justify-center",
|
|
15
|
+
end: "justify-end",
|
|
16
|
+
start: "justify-start"
|
|
17
|
+
},
|
|
18
|
+
orientation: {
|
|
19
|
+
horizontal: "h-px w-full",
|
|
20
|
+
vertical: "h-full w-px flex-col"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
22
23
|
});
|
|
23
24
|
function Separator({ align, className, decorative = true, orientation, ...props }) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
return /* @__PURE__ */ jsx(SeparatorPrimitive.Root, {
|
|
26
|
+
className: separatorVariants({
|
|
27
|
+
align,
|
|
28
|
+
className,
|
|
29
|
+
orientation
|
|
30
|
+
}),
|
|
31
|
+
"data-slot": "separator",
|
|
32
|
+
decorative,
|
|
33
|
+
orientation,
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
35
36
|
}
|
|
36
37
|
function SeparatorItem({ className, ...props }) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
className: cn("absolute mx-2 bg-background px-2 text-sm text-muted-foreground", className),
|
|
40
|
+
"data-slot": "separator-item",
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
42
43
|
}
|
|
44
|
+
//#endregion
|
|
43
45
|
export { Separator, SeparatorItem, separatorVariants };
|
|
@@ -1,42 +1,75 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { buttonVariants } from "./button.js";
|
|
2
|
+
import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
3
|
+
import { VariantProps } from "@codefast/tailwind-variants";
|
|
4
|
+
import { ComponentProps, JSX } from "react";
|
|
3
5
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
|
|
7
|
+
//#region src/components/sheet.d.ts
|
|
8
|
+
declare const sheetContentVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
|
|
9
|
+
side: {
|
|
10
|
+
bottom: string;
|
|
11
|
+
left: string;
|
|
12
|
+
right: string;
|
|
13
|
+
top: string;
|
|
14
|
+
};
|
|
12
15
|
}, Record<string, never>>;
|
|
13
16
|
type SheetProps = ComponentProps<typeof SheetPrimitive.Root>;
|
|
14
|
-
declare function Sheet({
|
|
17
|
+
declare function Sheet({
|
|
18
|
+
children,
|
|
19
|
+
...props
|
|
20
|
+
}: SheetProps): JSX.Element;
|
|
15
21
|
type SheetTriggerProps = ComponentProps<typeof SheetPrimitive.Trigger>;
|
|
16
|
-
declare function SheetTrigger({
|
|
22
|
+
declare function SheetTrigger({
|
|
23
|
+
...props
|
|
24
|
+
}: SheetTriggerProps): JSX.Element;
|
|
17
25
|
interface SheetContentProps extends ComponentProps<typeof SheetPrimitive.Content>, VariantProps<typeof sheetContentVariants> {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
classNames?: {
|
|
27
|
+
close?: string;
|
|
28
|
+
content?: string;
|
|
29
|
+
overlay?: string;
|
|
30
|
+
};
|
|
23
31
|
}
|
|
24
|
-
declare function SheetContent({
|
|
32
|
+
declare function SheetContent({
|
|
33
|
+
children,
|
|
34
|
+
className,
|
|
35
|
+
classNames,
|
|
36
|
+
side,
|
|
37
|
+
...props
|
|
38
|
+
}: SheetContentProps): JSX.Element;
|
|
25
39
|
type SheetHeaderProps = ComponentProps<"div">;
|
|
26
|
-
declare function SheetHeader({
|
|
40
|
+
declare function SheetHeader({
|
|
41
|
+
className,
|
|
42
|
+
...props
|
|
43
|
+
}: SheetHeaderProps): JSX.Element;
|
|
27
44
|
type SheetBodyProps = ComponentProps<"div">;
|
|
28
|
-
declare function SheetBody({
|
|
45
|
+
declare function SheetBody({
|
|
46
|
+
className,
|
|
47
|
+
...props
|
|
48
|
+
}: SheetBodyProps): JSX.Element;
|
|
29
49
|
type SheetFooterProps = ComponentProps<"div">;
|
|
30
|
-
declare function SheetFooter({
|
|
50
|
+
declare function SheetFooter({
|
|
51
|
+
className,
|
|
52
|
+
...props
|
|
53
|
+
}: SheetFooterProps): JSX.Element;
|
|
31
54
|
type SheetTitleProps = ComponentProps<typeof SheetPrimitive.Title>;
|
|
32
|
-
declare function SheetTitle({
|
|
55
|
+
declare function SheetTitle({
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}: SheetTitleProps): JSX.Element;
|
|
33
59
|
type SheetDescriptionProps = ComponentProps<typeof SheetPrimitive.Description>;
|
|
34
|
-
declare function SheetDescription({
|
|
60
|
+
declare function SheetDescription({
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}: SheetDescriptionProps): JSX.Element;
|
|
35
64
|
interface SheetCloseProps extends ComponentProps<typeof SheetPrimitive.Close> {
|
|
36
|
-
|
|
37
|
-
|
|
65
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
66
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
38
67
|
}
|
|
39
|
-
declare function SheetClose({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
68
|
+
declare function SheetClose({
|
|
69
|
+
className,
|
|
70
|
+
size,
|
|
71
|
+
variant,
|
|
72
|
+
...props
|
|
73
|
+
}: SheetCloseProps): JSX.Element;
|
|
74
|
+
//#endregion
|
|
75
|
+
export { Sheet, SheetBody, type SheetBodyProps, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, SheetDescription, type SheetDescriptionProps, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, type SheetProps, SheetTitle, type SheetTitleProps, SheetTrigger, type SheetTriggerProps, sheetContentVariants };
|
package/dist/components/sheet.js
CHANGED
|
@@ -1,124 +1,103 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { buttonVariants } from "./button.js";
|
|
3
3
|
import { cn, tv } from "@codefast/tailwind-variants";
|
|
4
|
-
import { Close, Content, Description, Overlay, Portal, Root, Title, Trigger } from "@radix-ui/react-dialog";
|
|
5
4
|
import { XIcon } from "lucide-react";
|
|
6
|
-
import {
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
7
|
+
//#region src/components/sheet.tsx
|
|
7
8
|
const sheetContentVariants = tv({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
|
17
|
-
top: "inset-x-0 top-0 max-h-[80vh] border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
9
|
+
base: "fixed z-50 flex flex-col overflow-auto bg-background shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:animation-duration-500 data-[state=open]:animate-in data-[state=open]:animation-duration-500",
|
|
10
|
+
defaultVariants: { side: "right" },
|
|
11
|
+
variants: { side: {
|
|
12
|
+
bottom: "inset-x-0 bottom-0 max-h-[80vh] border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
|
|
13
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
|
|
14
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
|
|
15
|
+
top: "inset-x-0 top-0 max-h-[80vh] border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top"
|
|
16
|
+
} }
|
|
20
17
|
});
|
|
21
18
|
function Sheet({ children, ...props }) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Root, {
|
|
20
|
+
"data-slot": "sheet",
|
|
21
|
+
...props,
|
|
22
|
+
children
|
|
23
|
+
});
|
|
27
24
|
}
|
|
28
25
|
function SheetTrigger({ ...props }) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, {
|
|
27
|
+
"data-slot": "sheet-trigger",
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
33
30
|
}
|
|
34
31
|
function SheetContent({ children, className, classNames, side = "right", ...props }) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
],
|
|
59
|
-
size: "icon",
|
|
60
|
-
variant: "ghost"
|
|
61
|
-
}),
|
|
62
|
-
"data-slot": "sheet-close",
|
|
63
|
-
children: [
|
|
64
|
-
/*#__PURE__*/ jsx(XIcon, {
|
|
65
|
-
className: "size-4"
|
|
66
|
-
}),
|
|
67
|
-
/*#__PURE__*/ jsx("span", {
|
|
68
|
-
className: "sr-only",
|
|
69
|
-
children: "Close"
|
|
70
|
-
})
|
|
71
|
-
]
|
|
72
|
-
})
|
|
73
|
-
]
|
|
74
|
-
})
|
|
75
|
-
]
|
|
76
|
-
});
|
|
32
|
+
return /* @__PURE__ */ jsxs(SheetPrimitive.Portal, { children: [/* @__PURE__ */ jsx(SheetPrimitive.Overlay, {
|
|
33
|
+
className: cn("fixed inset-0 z-50 bg-black/50 ease-ui data-[state=closed]:animate-out data-[state=closed]:animation-duration-500 data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:animation-duration-500 data-[state=open]:fade-in-0", classNames?.overlay),
|
|
34
|
+
"data-slot": "sheet-overlay"
|
|
35
|
+
}), /* @__PURE__ */ jsxs(SheetPrimitive.Content, {
|
|
36
|
+
className: sheetContentVariants({
|
|
37
|
+
className: [classNames?.content, className],
|
|
38
|
+
side
|
|
39
|
+
}),
|
|
40
|
+
"data-slot": "sheet-content",
|
|
41
|
+
...props,
|
|
42
|
+
children: [children, /* @__PURE__ */ jsxs(SheetPrimitive.Close, {
|
|
43
|
+
className: buttonVariants({
|
|
44
|
+
className: ["absolute top-4 right-4 size-7", classNames?.close],
|
|
45
|
+
size: "icon",
|
|
46
|
+
variant: "ghost"
|
|
47
|
+
}),
|
|
48
|
+
"data-slot": "sheet-close",
|
|
49
|
+
children: [/* @__PURE__ */ jsx(XIcon, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
50
|
+
className: "sr-only",
|
|
51
|
+
children: "Close"
|
|
52
|
+
})]
|
|
53
|
+
})]
|
|
54
|
+
})] });
|
|
77
55
|
}
|
|
78
56
|
function SheetHeader({ className, ...props }) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
57
|
+
return /* @__PURE__ */ jsx("header", {
|
|
58
|
+
className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center sm:text-left", className),
|
|
59
|
+
"data-slot": "sheet-header",
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
84
62
|
}
|
|
85
63
|
function SheetBody({ className, ...props }) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
64
|
+
return /* @__PURE__ */ jsx("main", {
|
|
65
|
+
className: cn("px-6 py-2", className),
|
|
66
|
+
"data-slot": "sheet-body",
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
91
69
|
}
|
|
92
70
|
function SheetFooter({ className, ...props }) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
71
|
+
return /* @__PURE__ */ jsx("footer", {
|
|
72
|
+
className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6 sm:flex-row sm:justify-end", className),
|
|
73
|
+
"data-slot": "sheet-footer",
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
98
76
|
}
|
|
99
77
|
function SheetTitle({ className, ...props }) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
78
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Title, {
|
|
79
|
+
className: cn("text-lg font-semibold text-foreground", className),
|
|
80
|
+
"data-slot": "sheet-title",
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
105
83
|
}
|
|
106
84
|
function SheetDescription({ className, ...props }) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
85
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Description, {
|
|
86
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
87
|
+
"data-slot": "sheet-description",
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
112
90
|
}
|
|
113
91
|
function SheetClose({ className, size, variant = "outline", ...props }) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
92
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Close, {
|
|
93
|
+
className: buttonVariants({
|
|
94
|
+
className,
|
|
95
|
+
size,
|
|
96
|
+
variant
|
|
97
|
+
}),
|
|
98
|
+
"data-slot": "sheet-close",
|
|
99
|
+
...props
|
|
100
|
+
});
|
|
123
101
|
}
|
|
102
|
+
//#endregion
|
|
124
103
|
export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, sheetContentVariants };
|
|
@@ -1,101 +1,195 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import { Separator } from "./separator.js";
|
|
3
|
+
import { Input } from "./input.js";
|
|
4
|
+
import { TooltipContent } from "./tooltip.js";
|
|
5
|
+
import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
|
|
6
|
+
import { VariantProps } from "@codefast/tailwind-variants";
|
|
7
|
+
import { ComponentProps, Dispatch, JSX, SetStateAction } from "react";
|
|
8
|
+
|
|
9
|
+
//#region src/components/sidebar.d.ts
|
|
10
|
+
declare const sidebarMenuButtonVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
|
|
11
|
+
size: {
|
|
12
|
+
sm: string;
|
|
13
|
+
md: string;
|
|
14
|
+
lg: string;
|
|
15
|
+
};
|
|
16
|
+
variant: {
|
|
17
|
+
default: string;
|
|
18
|
+
outline: string;
|
|
19
|
+
};
|
|
17
20
|
}, Record<string, never>>;
|
|
18
21
|
interface SidebarContextValue {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
isMobile: boolean;
|
|
23
|
+
open: boolean;
|
|
24
|
+
openMobile: boolean;
|
|
25
|
+
setOpen: (open: boolean) => void;
|
|
26
|
+
setOpenMobile: Dispatch<SetStateAction<boolean>>;
|
|
27
|
+
state: "collapsed" | "expanded";
|
|
28
|
+
toggleSidebar: () => void;
|
|
26
29
|
}
|
|
27
30
|
declare const useSidebar: (consumerName: string) => SidebarContextValue;
|
|
28
31
|
interface SidebarProviderProps extends ComponentProps<"div"> {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
defaultOpen?: boolean;
|
|
33
|
+
onOpenChange?: (open: boolean) => void;
|
|
34
|
+
open?: boolean;
|
|
32
35
|
}
|
|
33
|
-
declare function SidebarProvider({
|
|
36
|
+
declare function SidebarProvider({
|
|
37
|
+
children,
|
|
38
|
+
className,
|
|
39
|
+
defaultOpen,
|
|
40
|
+
onOpenChange: setOpenProperty,
|
|
41
|
+
open: openProperty,
|
|
42
|
+
style,
|
|
43
|
+
...props
|
|
44
|
+
}: SidebarProviderProps): JSX.Element;
|
|
34
45
|
interface SidebarProps extends ComponentProps<"div"> {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
collapsible?: "icon" | "none" | "offcanvas";
|
|
47
|
+
side?: "left" | "right";
|
|
48
|
+
variant?: "floating" | "inset" | "sidebar";
|
|
38
49
|
}
|
|
39
|
-
declare function Sidebar({
|
|
50
|
+
declare function Sidebar({
|
|
51
|
+
children,
|
|
52
|
+
className,
|
|
53
|
+
collapsible,
|
|
54
|
+
side,
|
|
55
|
+
variant,
|
|
56
|
+
...props
|
|
57
|
+
}: SidebarProps): JSX.Element;
|
|
40
58
|
type SidebarTriggerProps = ComponentProps<typeof Button>;
|
|
41
|
-
declare function SidebarTrigger({
|
|
59
|
+
declare function SidebarTrigger({
|
|
60
|
+
className,
|
|
61
|
+
onClick,
|
|
62
|
+
...props
|
|
63
|
+
}: SidebarTriggerProps): JSX.Element;
|
|
42
64
|
type SidebarRailProps = ComponentProps<"button">;
|
|
43
|
-
declare function SidebarRail({
|
|
65
|
+
declare function SidebarRail({
|
|
66
|
+
className,
|
|
67
|
+
...props
|
|
68
|
+
}: SidebarRailProps): JSX.Element;
|
|
44
69
|
type SidebarInsetProps = ComponentProps<"main">;
|
|
45
|
-
declare function SidebarInset({
|
|
70
|
+
declare function SidebarInset({
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
}: SidebarInsetProps): JSX.Element;
|
|
46
74
|
type SidebarInputProps = ComponentProps<typeof Input>;
|
|
47
|
-
declare function SidebarInput({
|
|
75
|
+
declare function SidebarInput({
|
|
76
|
+
className,
|
|
77
|
+
...props
|
|
78
|
+
}: SidebarInputProps): JSX.Element;
|
|
48
79
|
type SidebarHeaderProps = ComponentProps<"div">;
|
|
49
|
-
declare function SidebarHeader({
|
|
80
|
+
declare function SidebarHeader({
|
|
81
|
+
className,
|
|
82
|
+
...props
|
|
83
|
+
}: SidebarHeaderProps): JSX.Element;
|
|
50
84
|
type SidebarFooterProps = ComponentProps<"div">;
|
|
51
|
-
declare function SidebarFooter({
|
|
85
|
+
declare function SidebarFooter({
|
|
86
|
+
className,
|
|
87
|
+
...props
|
|
88
|
+
}: SidebarFooterProps): JSX.Element;
|
|
52
89
|
type SidebarSeparatorProps = ComponentProps<typeof Separator>;
|
|
53
|
-
declare function SidebarSeparator({
|
|
90
|
+
declare function SidebarSeparator({
|
|
91
|
+
className,
|
|
92
|
+
...props
|
|
93
|
+
}: SidebarSeparatorProps): JSX.Element;
|
|
54
94
|
type SidebarContentProps = ComponentProps<"div">;
|
|
55
|
-
declare function SidebarContent({
|
|
95
|
+
declare function SidebarContent({
|
|
96
|
+
className,
|
|
97
|
+
...props
|
|
98
|
+
}: SidebarContentProps): JSX.Element;
|
|
56
99
|
type SidebarGroupProps = ComponentProps<"div">;
|
|
57
|
-
declare function SidebarGroup({
|
|
100
|
+
declare function SidebarGroup({
|
|
101
|
+
className,
|
|
102
|
+
...props
|
|
103
|
+
}: SidebarGroupProps): JSX.Element;
|
|
58
104
|
interface SidebarGroupLabelProps extends ComponentProps<"div"> {
|
|
59
|
-
|
|
105
|
+
asChild?: boolean;
|
|
60
106
|
}
|
|
61
|
-
declare function SidebarGroupLabel({
|
|
107
|
+
declare function SidebarGroupLabel({
|
|
108
|
+
asChild,
|
|
109
|
+
className,
|
|
110
|
+
...props
|
|
111
|
+
}: SidebarGroupLabelProps): JSX.Element;
|
|
62
112
|
interface SidebarGroupActionProps extends ComponentProps<"button"> {
|
|
63
|
-
|
|
113
|
+
asChild?: boolean;
|
|
64
114
|
}
|
|
65
|
-
declare function SidebarGroupAction({
|
|
115
|
+
declare function SidebarGroupAction({
|
|
116
|
+
asChild,
|
|
117
|
+
className,
|
|
118
|
+
...props
|
|
119
|
+
}: SidebarGroupActionProps): JSX.Element;
|
|
66
120
|
type SidebarGroupContentProps = ComponentProps<"div">;
|
|
67
|
-
declare function SidebarGroupContent({
|
|
121
|
+
declare function SidebarGroupContent({
|
|
122
|
+
className,
|
|
123
|
+
...props
|
|
124
|
+
}: SidebarGroupContentProps): JSX.Element;
|
|
68
125
|
type SidebarMenuProps = ComponentProps<"ul">;
|
|
69
|
-
declare function SidebarMenu({
|
|
126
|
+
declare function SidebarMenu({
|
|
127
|
+
className,
|
|
128
|
+
...props
|
|
129
|
+
}: SidebarMenuProps): JSX.Element;
|
|
70
130
|
type SidebarMenuItemProps = ComponentProps<"li">;
|
|
71
|
-
declare function SidebarMenuItem({
|
|
131
|
+
declare function SidebarMenuItem({
|
|
132
|
+
className,
|
|
133
|
+
...props
|
|
134
|
+
}: SidebarMenuItemProps): JSX.Element;
|
|
72
135
|
interface SidebarMenuButtonProps extends ComponentProps<"button">, VariantProps<typeof sidebarMenuButtonVariants> {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
136
|
+
asChild?: boolean;
|
|
137
|
+
isActive?: boolean;
|
|
138
|
+
tooltip?: ComponentProps<typeof TooltipContent> | string;
|
|
76
139
|
}
|
|
77
|
-
declare function SidebarMenuButton({
|
|
140
|
+
declare function SidebarMenuButton({
|
|
141
|
+
asChild,
|
|
142
|
+
className,
|
|
143
|
+
isActive,
|
|
144
|
+
size,
|
|
145
|
+
tooltip,
|
|
146
|
+
variant,
|
|
147
|
+
...props
|
|
148
|
+
}: SidebarMenuButtonProps): JSX.Element;
|
|
78
149
|
interface SidebarMenuActionProps extends ComponentProps<"button"> {
|
|
79
|
-
|
|
80
|
-
|
|
150
|
+
asChild?: boolean;
|
|
151
|
+
showOnHover?: boolean;
|
|
81
152
|
}
|
|
82
|
-
declare function SidebarMenuAction({
|
|
153
|
+
declare function SidebarMenuAction({
|
|
154
|
+
asChild,
|
|
155
|
+
className,
|
|
156
|
+
showOnHover,
|
|
157
|
+
...props
|
|
158
|
+
}: SidebarMenuActionProps): JSX.Element;
|
|
83
159
|
type SidebarMenuBadgeProps = ComponentProps<"div">;
|
|
84
|
-
declare function SidebarMenuBadge({
|
|
160
|
+
declare function SidebarMenuBadge({
|
|
161
|
+
className,
|
|
162
|
+
...props
|
|
163
|
+
}: SidebarMenuBadgeProps): JSX.Element;
|
|
85
164
|
interface SidebarMenuSkeletonProps extends ComponentProps<"div"> {
|
|
86
|
-
|
|
165
|
+
showIcon?: boolean;
|
|
87
166
|
}
|
|
88
|
-
declare function SidebarMenuSkeleton({
|
|
167
|
+
declare function SidebarMenuSkeleton({
|
|
168
|
+
className,
|
|
169
|
+
showIcon,
|
|
170
|
+
...props
|
|
171
|
+
}: SidebarMenuSkeletonProps): JSX.Element;
|
|
89
172
|
type SidebarMenuSubProps = ComponentProps<"ul">;
|
|
90
|
-
declare function SidebarMenuSub({
|
|
173
|
+
declare function SidebarMenuSub({
|
|
174
|
+
className,
|
|
175
|
+
...props
|
|
176
|
+
}: SidebarMenuSubProps): JSX.Element;
|
|
91
177
|
type SidebarMenuSubItemProps = ComponentProps<"li">;
|
|
92
|
-
declare function SidebarMenuSubItem({
|
|
178
|
+
declare function SidebarMenuSubItem({
|
|
179
|
+
className,
|
|
180
|
+
...props
|
|
181
|
+
}: SidebarMenuSubItemProps): JSX.Element;
|
|
93
182
|
interface SidebarMenuSubButtonProps extends ComponentProps<"a"> {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
183
|
+
asChild?: boolean;
|
|
184
|
+
isActive?: boolean;
|
|
185
|
+
size?: "md" | "sm";
|
|
97
186
|
}
|
|
98
|
-
declare function SidebarMenuSubButton({
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
187
|
+
declare function SidebarMenuSubButton({
|
|
188
|
+
asChild,
|
|
189
|
+
className,
|
|
190
|
+
isActive,
|
|
191
|
+
size,
|
|
192
|
+
...props
|
|
193
|
+
}: SidebarMenuSubButtonProps): JSX.Element;
|
|
194
|
+
//#endregion
|
|
195
|
+
export { Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, SidebarGroupAction, type SidebarGroupActionProps, SidebarGroupContent, type SidebarGroupContentProps, SidebarGroupLabel, type SidebarGroupLabelProps, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarInput, type SidebarInputProps, SidebarInset, type SidebarInsetProps, SidebarMenu, SidebarMenuAction, type SidebarMenuActionProps, SidebarMenuBadge, type SidebarMenuBadgeProps, SidebarMenuButton, type SidebarMenuButtonProps, SidebarMenuItem, type SidebarMenuItemProps, type SidebarMenuProps, SidebarMenuSkeleton, type SidebarMenuSkeletonProps, SidebarMenuSub, SidebarMenuSubButton, type SidebarMenuSubButtonProps, SidebarMenuSubItem, type SidebarMenuSubItemProps, type SidebarMenuSubProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, type SidebarRailProps, SidebarSeparator, type SidebarSeparatorProps, SidebarTrigger, type SidebarTriggerProps, sidebarMenuButtonVariants, useSidebar };
|