@codefast/ui 0.3.10 → 0.3.11-canary.0
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 +19 -0
- package/README.md +277 -167
- package/dist/components/accordion.cjs +5 -5
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +5 -5
- package/dist/components/alert-dialog.cjs +9 -9
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +9 -9
- package/dist/components/alert.cjs +5 -5
- package/dist/components/alert.d.ts +5 -5
- package/dist/components/alert.js +5 -5
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/avatar.cjs +3 -3
- package/dist/components/avatar.d.ts +2 -2
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.cjs +7 -7
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +7 -7
- package/dist/components/breadcrumb.cjs +6 -8
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +6 -8
- package/dist/components/button-group.cjs +8 -8
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +8 -8
- package/dist/components/button.cjs +17 -17
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +17 -17
- package/dist/components/calendar.cjs +35 -35
- package/dist/components/calendar.d.ts +5 -5
- package/dist/components/calendar.js +35 -35
- package/dist/components/card.cjs +7 -7
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +7 -7
- package/dist/components/carousel.cjs +20 -20
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +20 -20
- package/dist/components/chart.cjs +42 -42
- package/dist/components/chart.d.ts +12 -11
- package/dist/components/chart.js +42 -42
- package/dist/components/checkbox-cards.cjs +2 -2
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +2 -2
- package/dist/components/checkbox-group.cjs +2 -2
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +2 -2
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/command.cjs +10 -10
- package/dist/components/command.d.ts +4 -4
- package/dist/components/command.js +10 -10
- package/dist/components/context-menu.cjs +10 -10
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +10 -10
- package/dist/components/dialog.cjs +12 -12
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +12 -12
- package/dist/components/drawer.cjs +9 -9
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +9 -9
- package/dist/components/dropdown-menu.cjs +10 -10
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +10 -10
- package/dist/components/empty.cjs +10 -10
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +10 -10
- package/dist/components/field.cjs +17 -17
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +17 -17
- package/dist/components/form.cjs +8 -8
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +8 -8
- package/dist/components/hover-card.cjs +3 -3
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +3 -3
- package/dist/components/input-group.cjs +20 -20
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +20 -20
- package/dist/components/input-number.cjs +7 -7
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +7 -7
- package/dist/components/input-otp.cjs +4 -4
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +4 -4
- package/dist/components/input-password.cjs +6 -6
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +6 -6
- package/dist/components/input-search.cjs +4 -4
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +4 -4
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +1 -1
- package/dist/components/item.cjs +23 -23
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +23 -23
- package/dist/components/kbd.cjs +2 -2
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +2 -2
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +1 -1
- package/dist/components/menubar.cjs +13 -13
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +13 -13
- package/dist/components/native-select.cjs +2 -2
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +2 -2
- package/dist/components/navigation-menu.cjs +10 -10
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +10 -10
- package/dist/components/pagination.cjs +6 -6
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +6 -6
- package/dist/components/popover.cjs +3 -3
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +3 -3
- package/dist/components/progress-circle.cjs +22 -22
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +22 -22
- package/dist/components/progress.cjs +2 -2
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-cards.cjs +3 -3
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +3 -3
- package/dist/components/radio-group.cjs +3 -3
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +3 -3
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +1 -1
- package/dist/components/resizable.cjs +3 -3
- package/dist/components/resizable.d.ts +2 -2
- package/dist/components/resizable.js +3 -3
- package/dist/components/scroll-area.cjs +31 -31
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +31 -31
- package/dist/components/select.cjs +9 -9
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +9 -9
- package/dist/components/separator.cjs +9 -9
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +9 -9
- package/dist/components/sheet.cjs +17 -17
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +17 -17
- package/dist/components/sidebar.cjs +65 -65
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +65 -65
- package/dist/components/skeleton.cjs +1 -1
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.cjs +4 -4
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +4 -4
- package/dist/components/sonner.cjs +4 -4
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +4 -4
- package/dist/components/spinner.cjs +5 -5
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +5 -5
- package/dist/components/switch.cjs +2 -2
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +2 -2
- package/dist/components/table.cjs +8 -8
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +8 -8
- package/dist/components/tabs.cjs +4 -4
- package/dist/components/tabs.d.ts +2 -2
- package/dist/components/tabs.js +4 -4
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.cjs +5 -5
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle-group.js +5 -5
- package/dist/components/toggle.cjs +8 -8
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/toggle.js +8 -8
- package/dist/components/tooltip.cjs +2 -2
- package/dist/components/tooltip.d.ts +3 -3
- package/dist/components/tooltip.js +2 -2
- package/dist/css/preset.css +4 -4
- package/dist/css/style.css +3 -3
- package/dist/hooks/use-copy-to-clipboard.cjs +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -1
- package/dist/hooks/use-media-query.cjs +3 -3
- package/dist/hooks/use-media-query.js +3 -3
- package/dist/hooks/use-mutation-observer.d.ts +1 -1
- package/dist/hooks/use-pagination.cjs +1 -1
- package/dist/hooks/use-pagination.js +1 -1
- package/dist/index.d.ts +130 -130
- package/dist/primitives/checkbox-group.cjs +3 -3
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +3 -3
- package/dist/primitives/input-number.cjs +46 -46
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +46 -46
- package/dist/primitives/input.cjs +7 -7
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +7 -7
- package/dist/primitives/progress-circle.cjs +8 -8
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +8 -8
- package/package.json +38 -42
|
@@ -30,7 +30,7 @@ function SelectTrigger({ children, className, size, ...props }) {
|
|
|
30
30
|
className
|
|
31
31
|
],
|
|
32
32
|
size,
|
|
33
|
-
variant:
|
|
33
|
+
variant: "outline"
|
|
34
34
|
}),
|
|
35
35
|
"data-size": size,
|
|
36
36
|
"data-slot": "select-trigger",
|
|
@@ -47,7 +47,7 @@ function SelectTrigger({ children, className, size, ...props }) {
|
|
|
47
47
|
}
|
|
48
48
|
function SelectScrollUpButton({ className, ...props }) {
|
|
49
49
|
return /*#__PURE__*/ jsx(ScrollUpButton, {
|
|
50
|
-
className: cn(
|
|
50
|
+
className: cn("flex items-center justify-center py-1 text-muted-foreground", className),
|
|
51
51
|
"data-slot": "select-scroll-up-button",
|
|
52
52
|
...props,
|
|
53
53
|
children: /*#__PURE__*/ jsx(ChevronUpIcon, {
|
|
@@ -57,7 +57,7 @@ function SelectScrollUpButton({ className, ...props }) {
|
|
|
57
57
|
}
|
|
58
58
|
function SelectScrollDownButton({ className, ...props }) {
|
|
59
59
|
return /*#__PURE__*/ jsx(ScrollDownButton, {
|
|
60
|
-
className: cn(
|
|
60
|
+
className: cn("flex items-center justify-center py-1 text-muted-foreground", className),
|
|
61
61
|
"data-slot": "select-scroll-down-button",
|
|
62
62
|
...props,
|
|
63
63
|
children: /*#__PURE__*/ jsx(ChevronDownIcon, {
|
|
@@ -65,17 +65,17 @@ function SelectScrollDownButton({ className, ...props }) {
|
|
|
65
65
|
})
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
function SelectContent({ children, className, position =
|
|
68
|
+
function SelectContent({ children, className, position = "popper", ...props }) {
|
|
69
69
|
return /*#__PURE__*/ jsx(Portal, {
|
|
70
70
|
children: /*#__PURE__*/ jsxs(Content, {
|
|
71
|
-
className: cn(
|
|
71
|
+
className: cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=top]:slide-in-from-bottom-2", "popper" === position && "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),
|
|
72
72
|
"data-slot": "select-content",
|
|
73
73
|
position: position,
|
|
74
74
|
...props,
|
|
75
75
|
children: [
|
|
76
76
|
/*#__PURE__*/ jsx(SelectScrollUpButton, {}),
|
|
77
77
|
/*#__PURE__*/ jsx(Viewport, {
|
|
78
|
-
className: cn(
|
|
78
|
+
className: cn("p-1", "popper" === position && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
79
79
|
children: children
|
|
80
80
|
}),
|
|
81
81
|
/*#__PURE__*/ jsx(SelectScrollDownButton, {})
|
|
@@ -85,14 +85,14 @@ function SelectContent({ children, className, position = 'popper', ...props }) {
|
|
|
85
85
|
}
|
|
86
86
|
function SelectLabel({ className, ...props }) {
|
|
87
87
|
return /*#__PURE__*/ jsx(Label, {
|
|
88
|
-
className: cn(
|
|
88
|
+
className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold", className),
|
|
89
89
|
"data-slot": "select-label",
|
|
90
90
|
...props
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
function SelectItem({ children, className, ...props }) {
|
|
94
94
|
return /*#__PURE__*/ jsxs(Item, {
|
|
95
|
-
className: cn("
|
|
95
|
+
className: cn("relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:[&_svg:not([class*='text-'])]:text-destructive/80 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
96
96
|
"data-slot": "select-item",
|
|
97
97
|
...props,
|
|
98
98
|
children: [
|
|
@@ -112,7 +112,7 @@ function SelectItem({ children, className, ...props }) {
|
|
|
112
112
|
}
|
|
113
113
|
function SelectSeparator({ className, ...props }) {
|
|
114
114
|
return /*#__PURE__*/ jsx(Separator, {
|
|
115
|
-
className: cn(
|
|
115
|
+
className: cn("mx-2 my-1 h-px bg-border", className),
|
|
116
116
|
"data-slot": "select-separator",
|
|
117
117
|
...props
|
|
118
118
|
});
|
|
@@ -33,20 +33,20 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
33
33
|
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
34
34
|
const react_separator_namespaceObject = require("@radix-ui/react-separator");
|
|
35
35
|
const separatorVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
36
|
-
base:
|
|
36
|
+
base: "relative flex shrink-0 items-center bg-border",
|
|
37
37
|
defaultVariants: {
|
|
38
|
-
align:
|
|
39
|
-
orientation:
|
|
38
|
+
align: "center",
|
|
39
|
+
orientation: "horizontal"
|
|
40
40
|
},
|
|
41
41
|
variants: {
|
|
42
42
|
align: {
|
|
43
|
-
center:
|
|
44
|
-
end:
|
|
45
|
-
start:
|
|
43
|
+
center: "justify-center",
|
|
44
|
+
end: "justify-end",
|
|
45
|
+
start: "justify-start"
|
|
46
46
|
},
|
|
47
47
|
orientation: {
|
|
48
|
-
horizontal:
|
|
49
|
-
vertical:
|
|
48
|
+
horizontal: "h-px w-full",
|
|
49
|
+
vertical: "h-full w-px flex-col"
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
});
|
|
@@ -65,7 +65,7 @@ function Separator({ align, className, decorative = true, orientation, ...props
|
|
|
65
65
|
}
|
|
66
66
|
function SeparatorItem({ className, ...props }) {
|
|
67
67
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
68
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
68
|
+
className: (0, tailwind_variants_namespaceObject.cn)("absolute mx-2 bg-background px-2 text-sm text-muted-foreground", className),
|
|
69
69
|
"data-slot": "separator-item",
|
|
70
70
|
...props
|
|
71
71
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import * as SeparatorPrimitive from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
4
|
declare const separatorVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
5
|
align: {
|
|
6
6
|
center: string;
|
|
@@ -12,10 +12,10 @@ declare const separatorVariants: import("@codefast/tailwind-variants").VariantFu
|
|
|
12
12
|
vertical: string;
|
|
13
13
|
};
|
|
14
14
|
}, Record<string, never>>;
|
|
15
|
-
interface SeparatorProps extends ComponentProps<typeof SeparatorPrimitive.Root>, Omit<VariantProps<typeof separatorVariants>,
|
|
15
|
+
interface SeparatorProps extends ComponentProps<typeof SeparatorPrimitive.Root>, Omit<VariantProps<typeof separatorVariants>, "orientation"> {
|
|
16
16
|
}
|
|
17
17
|
declare function Separator({ align, className, decorative, orientation, ...props }: SeparatorProps): JSX.Element;
|
|
18
|
-
type SeparatorItemProps = ComponentProps<
|
|
18
|
+
type SeparatorItemProps = ComponentProps<"div">;
|
|
19
19
|
declare function SeparatorItem({ className, ...props }: SeparatorItemProps): JSX.Element;
|
|
20
20
|
export { separatorVariants };
|
|
21
21
|
export { Separator, SeparatorItem };
|
|
@@ -3,20 +3,20 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { cn, tv } from "@codefast/tailwind-variants";
|
|
4
4
|
import { Root } from "@radix-ui/react-separator";
|
|
5
5
|
const separatorVariants = tv({
|
|
6
|
-
base:
|
|
6
|
+
base: "relative flex shrink-0 items-center bg-border",
|
|
7
7
|
defaultVariants: {
|
|
8
|
-
align:
|
|
9
|
-
orientation:
|
|
8
|
+
align: "center",
|
|
9
|
+
orientation: "horizontal"
|
|
10
10
|
},
|
|
11
11
|
variants: {
|
|
12
12
|
align: {
|
|
13
|
-
center:
|
|
14
|
-
end:
|
|
15
|
-
start:
|
|
13
|
+
center: "justify-center",
|
|
14
|
+
end: "justify-end",
|
|
15
|
+
start: "justify-start"
|
|
16
16
|
},
|
|
17
17
|
orientation: {
|
|
18
|
-
horizontal:
|
|
19
|
-
vertical:
|
|
18
|
+
horizontal: "h-px w-full",
|
|
19
|
+
vertical: "h-full w-px flex-col"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
});
|
|
@@ -35,7 +35,7 @@ function Separator({ align, className, decorative = true, orientation, ...props
|
|
|
35
35
|
}
|
|
36
36
|
function SeparatorItem({ className, ...props }) {
|
|
37
37
|
return /*#__PURE__*/ jsx("div", {
|
|
38
|
-
className: cn(
|
|
38
|
+
className: cn("absolute mx-2 bg-background px-2 text-sm text-muted-foreground", className),
|
|
39
39
|
"data-slot": "separator-item",
|
|
40
40
|
...props
|
|
41
41
|
});
|
|
@@ -42,16 +42,16 @@ const react_dialog_namespaceObject = require("@radix-ui/react-dialog");
|
|
|
42
42
|
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
43
43
|
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
44
44
|
const sheetContentVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
45
|
-
base:
|
|
45
|
+
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",
|
|
46
46
|
defaultVariants: {
|
|
47
|
-
side:
|
|
47
|
+
side: "right"
|
|
48
48
|
},
|
|
49
49
|
variants: {
|
|
50
50
|
side: {
|
|
51
|
-
bottom:
|
|
52
|
-
left:
|
|
53
|
-
right:
|
|
54
|
-
top:
|
|
51
|
+
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",
|
|
52
|
+
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",
|
|
53
|
+
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",
|
|
54
|
+
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"
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
});
|
|
@@ -68,11 +68,11 @@ function SheetTrigger({ ...props }) {
|
|
|
68
68
|
...props
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
function SheetContent({ children, className, classNames, side =
|
|
71
|
+
function SheetContent({ children, className, classNames, side = "right", ...props }) {
|
|
72
72
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_dialog_namespaceObject.Portal, {
|
|
73
73
|
children: [
|
|
74
74
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Overlay, {
|
|
75
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
75
|
+
className: (0, tailwind_variants_namespaceObject.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),
|
|
76
76
|
"data-slot": "sheet-overlay"
|
|
77
77
|
}),
|
|
78
78
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_dialog_namespaceObject.Content, {
|
|
@@ -90,11 +90,11 @@ function SheetContent({ children, className, classNames, side = 'right', ...prop
|
|
|
90
90
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_dialog_namespaceObject.Close, {
|
|
91
91
|
className: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
92
92
|
className: [
|
|
93
|
-
|
|
93
|
+
"absolute top-4 right-4 size-7",
|
|
94
94
|
classNames?.close
|
|
95
95
|
],
|
|
96
|
-
size:
|
|
97
|
-
variant:
|
|
96
|
+
size: "icon",
|
|
97
|
+
variant: "ghost"
|
|
98
98
|
}),
|
|
99
99
|
"data-slot": "sheet-close",
|
|
100
100
|
children: [
|
|
@@ -114,40 +114,40 @@ function SheetContent({ children, className, classNames, side = 'right', ...prop
|
|
|
114
114
|
}
|
|
115
115
|
function SheetHeader({ className, ...props }) {
|
|
116
116
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("header", {
|
|
117
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
117
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center sm:text-left", className),
|
|
118
118
|
"data-slot": "sheet-header",
|
|
119
119
|
...props
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
function SheetBody({ className, ...props }) {
|
|
123
123
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("main", {
|
|
124
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
124
|
+
className: (0, tailwind_variants_namespaceObject.cn)("px-6 py-2", className),
|
|
125
125
|
"data-slot": "sheet-body",
|
|
126
126
|
...props
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
function SheetFooter({ className, ...props }) {
|
|
130
130
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("footer", {
|
|
131
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
131
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6 sm:flex-row sm:justify-end", className),
|
|
132
132
|
"data-slot": "sheet-footer",
|
|
133
133
|
...props
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
136
|
function SheetTitle({ className, ...props }) {
|
|
137
137
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Title, {
|
|
138
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
138
|
+
className: (0, tailwind_variants_namespaceObject.cn)("text-lg font-semibold text-foreground", className),
|
|
139
139
|
"data-slot": "sheet-title",
|
|
140
140
|
...props
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
function SheetDescription({ className, ...props }) {
|
|
144
144
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Description, {
|
|
145
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
145
|
+
className: (0, tailwind_variants_namespaceObject.cn)("text-sm text-muted-foreground", className),
|
|
146
146
|
"data-slot": "sheet-description",
|
|
147
147
|
...props
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
function SheetClose({ className, size, variant =
|
|
150
|
+
function SheetClose({ className, size, variant = "outline", ...props }) {
|
|
151
151
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_dialog_namespaceObject.Close, {
|
|
152
152
|
className: (0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
153
153
|
className,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import * as SheetPrimitive from
|
|
4
|
-
import { buttonVariants } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import { buttonVariants } from "./button";
|
|
5
5
|
declare const sheetContentVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
6
6
|
side: {
|
|
7
7
|
bottom: string;
|
|
@@ -22,19 +22,19 @@ interface SheetContentProps extends ComponentProps<typeof SheetPrimitive.Content
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
declare function SheetContent({ children, className, classNames, side, ...props }: SheetContentProps): JSX.Element;
|
|
25
|
-
type SheetHeaderProps = ComponentProps<
|
|
25
|
+
type SheetHeaderProps = ComponentProps<"div">;
|
|
26
26
|
declare function SheetHeader({ className, ...props }: SheetHeaderProps): JSX.Element;
|
|
27
|
-
type SheetBodyProps = ComponentProps<
|
|
27
|
+
type SheetBodyProps = ComponentProps<"div">;
|
|
28
28
|
declare function SheetBody({ className, ...props }: SheetBodyProps): JSX.Element;
|
|
29
|
-
type SheetFooterProps = ComponentProps<
|
|
29
|
+
type SheetFooterProps = ComponentProps<"div">;
|
|
30
30
|
declare function SheetFooter({ className, ...props }: SheetFooterProps): JSX.Element;
|
|
31
31
|
type SheetTitleProps = ComponentProps<typeof SheetPrimitive.Title>;
|
|
32
32
|
declare function SheetTitle({ className, ...props }: SheetTitleProps): JSX.Element;
|
|
33
33
|
type SheetDescriptionProps = ComponentProps<typeof SheetPrimitive.Description>;
|
|
34
34
|
declare function SheetDescription({ className, ...props }: SheetDescriptionProps): JSX.Element;
|
|
35
35
|
interface SheetCloseProps extends ComponentProps<typeof SheetPrimitive.Close> {
|
|
36
|
-
size?: VariantProps<typeof buttonVariants>[
|
|
37
|
-
variant?: VariantProps<typeof buttonVariants>[
|
|
36
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
37
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
38
38
|
}
|
|
39
39
|
declare function SheetClose({ className, size, variant, ...props }: SheetCloseProps): JSX.Element;
|
|
40
40
|
export { sheetContentVariants };
|
package/dist/components/sheet.js
CHANGED
|
@@ -5,16 +5,16 @@ import { Close, Content, Description, Overlay, Portal, Root, Title, Trigger } fr
|
|
|
5
5
|
import { XIcon } from "lucide-react";
|
|
6
6
|
import { buttonVariants } from "./button.js";
|
|
7
7
|
const sheetContentVariants = tv({
|
|
8
|
-
base:
|
|
8
|
+
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",
|
|
9
9
|
defaultVariants: {
|
|
10
|
-
side:
|
|
10
|
+
side: "right"
|
|
11
11
|
},
|
|
12
12
|
variants: {
|
|
13
13
|
side: {
|
|
14
|
-
bottom:
|
|
15
|
-
left:
|
|
16
|
-
right:
|
|
17
|
-
top:
|
|
14
|
+
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",
|
|
15
|
+
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",
|
|
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
18
|
}
|
|
19
19
|
}
|
|
20
20
|
});
|
|
@@ -31,11 +31,11 @@ function SheetTrigger({ ...props }) {
|
|
|
31
31
|
...props
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
function SheetContent({ children, className, classNames, side =
|
|
34
|
+
function SheetContent({ children, className, classNames, side = "right", ...props }) {
|
|
35
35
|
return /*#__PURE__*/ jsxs(Portal, {
|
|
36
36
|
children: [
|
|
37
37
|
/*#__PURE__*/ jsx(Overlay, {
|
|
38
|
-
className: cn(
|
|
38
|
+
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),
|
|
39
39
|
"data-slot": "sheet-overlay"
|
|
40
40
|
}),
|
|
41
41
|
/*#__PURE__*/ jsxs(Content, {
|
|
@@ -53,11 +53,11 @@ function SheetContent({ children, className, classNames, side = 'right', ...prop
|
|
|
53
53
|
/*#__PURE__*/ jsxs(Close, {
|
|
54
54
|
className: buttonVariants({
|
|
55
55
|
className: [
|
|
56
|
-
|
|
56
|
+
"absolute top-4 right-4 size-7",
|
|
57
57
|
classNames?.close
|
|
58
58
|
],
|
|
59
|
-
size:
|
|
60
|
-
variant:
|
|
59
|
+
size: "icon",
|
|
60
|
+
variant: "ghost"
|
|
61
61
|
}),
|
|
62
62
|
"data-slot": "sheet-close",
|
|
63
63
|
children: [
|
|
@@ -77,40 +77,40 @@ function SheetContent({ children, className, classNames, side = 'right', ...prop
|
|
|
77
77
|
}
|
|
78
78
|
function SheetHeader({ className, ...props }) {
|
|
79
79
|
return /*#__PURE__*/ jsx("header", {
|
|
80
|
-
className: cn(
|
|
80
|
+
className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center sm:text-left", className),
|
|
81
81
|
"data-slot": "sheet-header",
|
|
82
82
|
...props
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
function SheetBody({ className, ...props }) {
|
|
86
86
|
return /*#__PURE__*/ jsx("main", {
|
|
87
|
-
className: cn(
|
|
87
|
+
className: cn("px-6 py-2", className),
|
|
88
88
|
"data-slot": "sheet-body",
|
|
89
89
|
...props
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
function SheetFooter({ className, ...props }) {
|
|
93
93
|
return /*#__PURE__*/ jsx("footer", {
|
|
94
|
-
className: cn(
|
|
94
|
+
className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6 sm:flex-row sm:justify-end", className),
|
|
95
95
|
"data-slot": "sheet-footer",
|
|
96
96
|
...props
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
function SheetTitle({ className, ...props }) {
|
|
100
100
|
return /*#__PURE__*/ jsx(Title, {
|
|
101
|
-
className: cn(
|
|
101
|
+
className: cn("text-lg font-semibold text-foreground", className),
|
|
102
102
|
"data-slot": "sheet-title",
|
|
103
103
|
...props
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
function SheetDescription({ className, ...props }) {
|
|
107
107
|
return /*#__PURE__*/ jsx(Description, {
|
|
108
|
-
className: cn(
|
|
108
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
109
109
|
"data-slot": "sheet-description",
|
|
110
110
|
...props
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
function SheetClose({ className, size, variant =
|
|
113
|
+
function SheetClose({ className, size, variant = "outline", ...props }) {
|
|
114
114
|
return /*#__PURE__*/ jsx(Close, {
|
|
115
115
|
className: buttonVariants({
|
|
116
116
|
className,
|