@codefast/ui 0.3.10 → 0.3.11-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +277 -167
- package/dist/components/accordion.d.ts +4 -4
- package/dist/components/accordion.js +5 -5
- package/dist/components/alert-dialog.d.ts +11 -11
- package/dist/components/alert-dialog.js +9 -9
- 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.d.ts +2 -2
- package/dist/components/avatar.js +3 -3
- package/dist/components/badge.d.ts +3 -3
- package/dist/components/badge.js +7 -7
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +6 -8
- package/dist/components/button-group.d.ts +5 -5
- package/dist/components/button-group.js +8 -8
- package/dist/components/button.d.ts +6 -6
- package/dist/components/button.js +17 -17
- package/dist/components/calendar.d.ts +5 -5
- package/dist/components/calendar.js +35 -35
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +7 -7
- package/dist/components/carousel.d.ts +10 -10
- package/dist/components/carousel.js +20 -20
- package/dist/components/chart.d.ts +12 -11
- package/dist/components/chart.js +42 -42
- package/dist/components/checkbox-cards.d.ts +2 -2
- package/dist/components/checkbox-cards.js +2 -2
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +2 -2
- 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.d.ts +4 -4
- package/dist/components/command.js +10 -10
- package/dist/components/context-menu.d.ts +4 -4
- package/dist/components/context-menu.js +10 -10
- package/dist/components/dialog.d.ts +10 -10
- package/dist/components/dialog.js +12 -12
- package/dist/components/drawer.d.ts +9 -9
- package/dist/components/drawer.js +9 -9
- package/dist/components/dropdown-menu.d.ts +4 -4
- package/dist/components/dropdown-menu.js +10 -10
- package/dist/components/empty.d.ts +9 -9
- package/dist/components/empty.js +10 -10
- package/dist/components/field.d.ts +14 -14
- package/dist/components/field.js +17 -17
- package/dist/components/form.d.ts +10 -10
- package/dist/components/form.js +8 -8
- package/dist/components/hover-card.d.ts +2 -2
- package/dist/components/hover-card.js +3 -3
- package/dist/components/input-group.d.ts +15 -15
- package/dist/components/input-group.js +20 -20
- package/dist/components/input-number.d.ts +2 -2
- package/dist/components/input-number.js +7 -7
- package/dist/components/input-otp.d.ts +6 -6
- package/dist/components/input-otp.js +4 -4
- package/dist/components/input-password.d.ts +3 -3
- package/dist/components/input-password.js +6 -6
- package/dist/components/input-search.d.ts +3 -3
- package/dist/components/input-search.js +4 -4
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +1 -1
- package/dist/components/item.d.ts +12 -12
- package/dist/components/item.js +23 -23
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +2 -2
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +1 -1
- package/dist/components/menubar.d.ts +4 -4
- package/dist/components/menubar.js +13 -13
- package/dist/components/native-select.d.ts +4 -4
- package/dist/components/native-select.js +2 -2
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +10 -10
- package/dist/components/pagination.d.ts +10 -10
- package/dist/components/pagination.js +6 -6
- package/dist/components/popover.d.ts +3 -3
- package/dist/components/popover.js +3 -3
- package/dist/components/progress-circle.d.ts +5 -5
- package/dist/components/progress-circle.js +22 -22
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-cards.d.ts +2 -2
- package/dist/components/radio-cards.js +3 -3
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +3 -3
- package/dist/components/radio.d.ts +2 -2
- package/dist/components/radio.js +1 -1
- package/dist/components/resizable.d.ts +2 -2
- package/dist/components/resizable.js +3 -3
- package/dist/components/scroll-area.d.ts +5 -5
- package/dist/components/scroll-area.js +31 -31
- package/dist/components/select.d.ts +5 -5
- package/dist/components/select.js +9 -9
- package/dist/components/separator.d.ts +5 -5
- package/dist/components/separator.js +9 -9
- package/dist/components/sheet.d.ts +9 -9
- package/dist/components/sheet.js +17 -17
- package/dist/components/sidebar.d.ts +31 -31
- package/dist/components/sidebar.js +65 -65
- package/dist/components/skeleton.d.ts +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +4 -4
- package/dist/components/sonner.d.ts +3 -3
- package/dist/components/sonner.js +4 -4
- package/dist/components/spinner.d.ts +2 -2
- package/dist/components/spinner.js +5 -5
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +2 -2
- package/dist/components/table.d.ts +9 -9
- package/dist/components/table.js +8 -8
- package/dist/components/tabs.d.ts +2 -2
- package/dist/components/tabs.js +4 -4
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.d.ts +4 -4
- package/dist/components/toggle-group.js +5 -5
- package/dist/components/toggle.d.ts +3 -3
- package/dist/components/toggle.js +8 -8
- 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.d.ts +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +1 -1
- package/dist/hooks/use-media-query.js +3 -3
- package/dist/hooks/use-mutation-observer.d.ts +1 -1
- package/dist/hooks/use-pagination.js +1 -1
- package/dist/index.d.ts +130 -130
- package/dist/primitives/checkbox-group.d.ts +11 -11
- package/dist/primitives/checkbox-group.js +3 -3
- package/dist/primitives/input-number.d.ts +8 -8
- package/dist/primitives/input-number.js +46 -46
- package/dist/primitives/input.d.ts +4 -4
- package/dist/primitives/input.js +7 -7
- package/dist/primitives/progress-circle.d.ts +7 -7
- package/dist/primitives/progress-circle.js +8 -8
- package/package.json +111 -189
- package/dist/components/accordion.cjs +0 -98
- package/dist/components/alert-dialog.cjs +0 -156
- package/dist/components/alert.cjs +0 -84
- package/dist/components/aspect-ratio.cjs +0 -44
- package/dist/components/avatar.cjs +0 -66
- package/dist/components/badge.cjs +0 -67
- package/dist/components/breadcrumb.cjs +0 -127
- package/dist/components/button-group.cjs +0 -87
- package/dist/components/button.cjs +0 -92
- package/dist/components/calendar.cjs +0 -151
- package/dist/components/card.cjs +0 -105
- package/dist/components/carousel.cjs +0 -211
- package/dist/components/chart.cjs +0 -251
- package/dist/components/checkbox-cards.cjs +0 -70
- package/dist/components/checkbox-group.cjs +0 -64
- package/dist/components/checkbox.cjs +0 -54
- package/dist/components/collapsible.cjs +0 -62
- package/dist/components/command.cjs +0 -168
- package/dist/components/context-menu.cjs +0 -219
- package/dist/components/dialog.cjs +0 -165
- package/dist/components/drawer.cjs +0 -144
- package/dist/components/dropdown-menu.cjs +0 -222
- package/dist/components/empty.cjs +0 -113
- package/dist/components/field.cjs +0 -194
- package/dist/components/form.cjs +0 -152
- package/dist/components/hover-card.cjs +0 -78
- package/dist/components/input-group.cjs +0 -156
- package/dist/components/input-number.cjs +0 -99
- package/dist/components/input-otp.cjs +0 -102
- package/dist/components/input-password.cjs +0 -72
- package/dist/components/input-search.cjs +0 -81
- package/dist/components/input.cjs +0 -46
- package/dist/components/item.cjs +0 -186
- package/dist/components/kbd.cjs +0 -54
- package/dist/components/label.cjs +0 -46
- package/dist/components/menubar.cjs +0 -233
- package/dist/components/native-select.cjs +0 -75
- package/dist/components/navigation-menu.cjs +0 -146
- package/dist/components/pagination.cjs +0 -138
- package/dist/components/popover.cjs +0 -87
- package/dist/components/progress-circle.cjs +0 -185
- package/dist/components/progress.cjs +0 -53
- package/dist/components/radio-cards.cjs +0 -67
- package/dist/components/radio-group.cjs +0 -60
- package/dist/components/radio.cjs +0 -48
- package/dist/components/resizable.cjs +0 -72
- package/dist/components/scroll-area.cjs +0 -141
- package/dist/components/select.cjs +0 -181
- package/dist/components/separator.cjs +0 -83
- package/dist/components/sheet.cjs +0 -185
- package/dist/components/sidebar.cjs +0 -507
- package/dist/components/skeleton.cjs +0 -44
- package/dist/components/slider.cjs +0 -80
- package/dist/components/sonner.cjs +0 -58
- package/dist/components/spinner.cjs +0 -76
- package/dist/components/switch.cjs +0 -50
- package/dist/components/table.cjs +0 -118
- package/dist/components/tabs.cjs +0 -76
- package/dist/components/textarea.cjs +0 -44
- package/dist/components/toggle-group.cjs +0 -91
- package/dist/components/toggle.cjs +0 -72
- package/dist/components/tooltip.cjs +0 -91
- package/dist/hooks/use-animated-value.cjs +0 -75
- package/dist/hooks/use-copy-to-clipboard.cjs +0 -58
- package/dist/hooks/use-is-mobile.cjs +0 -40
- package/dist/hooks/use-media-query.cjs +0 -57
- package/dist/hooks/use-mutation-observer.cjs +0 -57
- package/dist/hooks/use-pagination.cjs +0 -93
- package/dist/index.cjs +0 -1081
- package/dist/primitives/checkbox-group.cjs +0 -151
- package/dist/primitives/input-number.cjs +0 -439
- package/dist/primitives/input.cjs +0 -99
- package/dist/primitives/progress-circle.cjs +0 -199
|
@@ -20,26 +20,26 @@ function DialogContent({ children, className, classNames, ...props }) {
|
|
|
20
20
|
return /*#__PURE__*/ jsxs(Portal, {
|
|
21
21
|
children: [
|
|
22
22
|
/*#__PURE__*/ jsx(Overlay, {
|
|
23
|
-
className: cn(
|
|
23
|
+
className: cn("fixed inset-0 z-50 bg-black/50 ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", classNames?.overlay),
|
|
24
24
|
"data-slot": "dialog-overlay"
|
|
25
25
|
}),
|
|
26
26
|
/*#__PURE__*/ jsx(Content, {
|
|
27
|
-
className: cn(
|
|
27
|
+
className: cn("fixed inset-0 z-50 grid grid-rows-[1fr_auto] justify-items-center overflow-auto ease-ui data-[state=closed]:animate-out data-[state=open]:animate-in max-sm:data-[state=closed]:animation-duration-500 max-sm:data-[state=closed]:slide-out-to-bottom max-sm:data-[state=open]:animation-duration-500 max-sm:data-[state=open]:slide-in-from-bottom sm:grid-rows-[1fr_auto_3fr] sm:p-4 sm:data-[state=closed]:fade-out-0 sm:data-[state=closed]:zoom-out-95 sm:data-[state=open]:fade-in-0 sm:data-[state=open]:zoom-in-95", classNames?.wrapper),
|
|
28
28
|
"data-slot": "dialog-content-wrapper",
|
|
29
29
|
...props,
|
|
30
30
|
children: /*#__PURE__*/ jsxs("div", {
|
|
31
|
-
className: cn(
|
|
31
|
+
className: cn("relative row-start-2 flex w-full flex-col rounded-t-2xl border bg-popover text-popover-foreground shadow-lg sm:max-w-lg sm:rounded-2xl", classNames?.content, className),
|
|
32
32
|
"data-slot": "dialog-content",
|
|
33
33
|
children: [
|
|
34
34
|
children,
|
|
35
35
|
/*#__PURE__*/ jsxs(Close, {
|
|
36
36
|
className: buttonVariants({
|
|
37
37
|
className: [
|
|
38
|
-
|
|
38
|
+
"absolute top-2.5 right-2.5 size-7",
|
|
39
39
|
classNames?.close
|
|
40
40
|
],
|
|
41
|
-
size:
|
|
42
|
-
variant:
|
|
41
|
+
size: "icon",
|
|
42
|
+
variant: "ghost"
|
|
43
43
|
}),
|
|
44
44
|
"data-slot": "dialog-close",
|
|
45
45
|
children: [
|
|
@@ -60,40 +60,40 @@ function DialogContent({ children, className, classNames, ...props }) {
|
|
|
60
60
|
}
|
|
61
61
|
function DialogHeader({ className, ...props }) {
|
|
62
62
|
return /*#__PURE__*/ jsx("header", {
|
|
63
|
-
className: cn(
|
|
63
|
+
className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-2 text-center sm:text-left", className),
|
|
64
64
|
"data-slot": "dialog-header",
|
|
65
65
|
...props
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
function DialogBody({ className, ...props }) {
|
|
69
69
|
return /*#__PURE__*/ jsx("main", {
|
|
70
|
-
className: cn(
|
|
70
|
+
className: cn("overflow-auto px-6 py-2", className),
|
|
71
71
|
"data-slot": "dialog-body",
|
|
72
72
|
...props
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
function DialogFooter({ className, ...props }) {
|
|
76
76
|
return /*#__PURE__*/ jsx("footer", {
|
|
77
|
-
className: cn(
|
|
77
|
+
className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-2 pb-6 sm:flex-row sm:justify-end", className),
|
|
78
78
|
"data-slot": "dialog-footer",
|
|
79
79
|
...props
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
function DialogTitle({ className, ...props }) {
|
|
83
83
|
return /*#__PURE__*/ jsx(Title, {
|
|
84
|
-
className: cn(
|
|
84
|
+
className: cn("text-lg leading-none font-semibold tracking-tight", className),
|
|
85
85
|
"data-slot": "dialog-title",
|
|
86
86
|
...props
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
function DialogDescription({ className, ...props }) {
|
|
90
90
|
return /*#__PURE__*/ jsx(Description, {
|
|
91
|
-
className: cn(
|
|
91
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
92
92
|
"data-slot": "dialog-description",
|
|
93
93
|
...props
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
function DialogClose({ className, size, variant =
|
|
96
|
+
function DialogClose({ className, size, variant = "outline", ...props }) {
|
|
97
97
|
return /*#__PURE__*/ jsx(Close, {
|
|
98
98
|
className: buttonVariants({
|
|
99
99
|
className,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import { Drawer as DrawerPrimitive } from
|
|
4
|
-
import { buttonVariants } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import { Drawer as DrawerPrimitive } from "vaul";
|
|
4
|
+
import { buttonVariants } from "./button";
|
|
5
5
|
type DrawerProps = ComponentProps<typeof DrawerPrimitive.Root>;
|
|
6
6
|
declare function Drawer({ shouldScaleBackground, ...props }: DrawerProps): JSX.Element;
|
|
7
7
|
type DrawerTriggerProps = ComponentProps<typeof DrawerPrimitive.Trigger>;
|
|
@@ -14,19 +14,19 @@ interface DrawerContentProps extends ComponentProps<typeof DrawerPrimitive.Conte
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
declare function DrawerContent({ children, className, classNames, ...props }: DrawerContentProps): JSX.Element;
|
|
17
|
-
type DrawerHeaderProps = ComponentProps<
|
|
17
|
+
type DrawerHeaderProps = ComponentProps<"div">;
|
|
18
18
|
declare function DrawerHeader({ className, ...props }: DrawerHeaderProps): JSX.Element;
|
|
19
|
-
type DrawerBodyProps = ComponentProps<
|
|
19
|
+
type DrawerBodyProps = ComponentProps<"div">;
|
|
20
20
|
declare function DrawerBody({ className, ...props }: DrawerBodyProps): JSX.Element;
|
|
21
|
-
type DrawerFooterProps = ComponentProps<
|
|
21
|
+
type DrawerFooterProps = ComponentProps<"div">;
|
|
22
22
|
declare function DrawerFooter({ className, ...props }: DrawerFooterProps): JSX.Element;
|
|
23
23
|
type DrawerTitleProps = ComponentProps<typeof DrawerPrimitive.Title>;
|
|
24
24
|
declare function DrawerTitle({ className, ...props }: DrawerTitleProps): JSX.Element;
|
|
25
25
|
type DrawerDescriptionProps = ComponentProps<typeof DrawerPrimitive.Description>;
|
|
26
26
|
declare function DrawerDescription({ className, ...props }: DrawerDescriptionProps): JSX.Element;
|
|
27
27
|
interface DrawerCloseProps extends ComponentProps<typeof DrawerPrimitive.Close> {
|
|
28
|
-
size?: VariantProps<typeof buttonVariants>[
|
|
29
|
-
variant?: VariantProps<typeof buttonVariants>[
|
|
28
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
29
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
30
30
|
}
|
|
31
31
|
declare function DrawerClose({ className, size, variant, ...props }: DrawerCloseProps): JSX.Element;
|
|
32
32
|
export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, };
|
|
@@ -20,16 +20,16 @@ function DrawerContent({ children, className, classNames, ...props }) {
|
|
|
20
20
|
return /*#__PURE__*/ jsxs(Drawer.Portal, {
|
|
21
21
|
children: [
|
|
22
22
|
/*#__PURE__*/ jsx(Drawer.Overlay, {
|
|
23
|
-
className: cn(
|
|
23
|
+
className: cn("fixed inset-0 z-50 bg-black/50", classNames?.overlay),
|
|
24
24
|
"data-slot": "drawer-overlay"
|
|
25
25
|
}),
|
|
26
26
|
/*#__PURE__*/ jsxs(Drawer.Content, {
|
|
27
|
-
className: cn(
|
|
27
|
+
className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-background data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-2xl data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-2xl data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm", classNames?.content, className),
|
|
28
28
|
"data-slot": "drawer-content",
|
|
29
29
|
...props,
|
|
30
30
|
children: [
|
|
31
31
|
/*#__PURE__*/ jsx("div", {
|
|
32
|
-
className: cn(
|
|
32
|
+
className: cn("mx-auto mt-4 hidden h-1.5 w-12 shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block", classNames?.handle)
|
|
33
33
|
}),
|
|
34
34
|
children
|
|
35
35
|
]
|
|
@@ -39,40 +39,40 @@ function DrawerContent({ children, className, classNames, ...props }) {
|
|
|
39
39
|
}
|
|
40
40
|
function DrawerHeader({ className, ...props }) {
|
|
41
41
|
return /*#__PURE__*/ jsx("div", {
|
|
42
|
-
className: cn(
|
|
42
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
43
43
|
"data-slot": "drawer-header",
|
|
44
44
|
...props
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
function DrawerBody({ className, ...props }) {
|
|
48
48
|
return /*#__PURE__*/ jsx("main", {
|
|
49
|
-
className: cn(
|
|
49
|
+
className: cn("overflow-auto px-4 py-2", className),
|
|
50
50
|
"data-slot": "drawer-body",
|
|
51
51
|
...props
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function DrawerFooter({ className, ...props }) {
|
|
55
55
|
return /*#__PURE__*/ jsx("div", {
|
|
56
|
-
className: cn(
|
|
56
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
57
57
|
"data-slot": "drawer-footer",
|
|
58
58
|
...props
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
function DrawerTitle({ className, ...props }) {
|
|
62
62
|
return /*#__PURE__*/ jsx(Drawer.Title, {
|
|
63
|
-
className: cn(
|
|
63
|
+
className: cn("font-semibold text-foreground", className),
|
|
64
64
|
"data-slot": "drawer-title",
|
|
65
65
|
...props
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
function DrawerDescription({ className, ...props }) {
|
|
69
69
|
return /*#__PURE__*/ jsx(Drawer.Description, {
|
|
70
|
-
className: cn(
|
|
70
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
71
71
|
"data-slot": "drawer-description",
|
|
72
72
|
...props
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
function DrawerClose({ className, size, variant =
|
|
75
|
+
function DrawerClose({ className, size, variant = "outline", ...props }) {
|
|
76
76
|
return /*#__PURE__*/ jsx(Drawer.Close, {
|
|
77
77
|
className: buttonVariants({
|
|
78
78
|
className,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as DropdownMenuPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
3
|
type DropdownMenuProps = ComponentProps<typeof DropdownMenuPrimitive.Root>;
|
|
4
4
|
declare function DropdownMenu({ ...props }: DropdownMenuProps): JSX.Element;
|
|
5
5
|
type DropdownMenuTriggerProps = ComponentProps<typeof DropdownMenuPrimitive.Trigger>;
|
|
@@ -20,7 +20,7 @@ type DropdownMenuContentProps = ComponentProps<typeof DropdownMenuPrimitive.Cont
|
|
|
20
20
|
declare function DropdownMenuContent({ className, sideOffset, ...props }: DropdownMenuContentProps): JSX.Element;
|
|
21
21
|
interface DropdownMenuItemProps extends ComponentProps<typeof DropdownMenuPrimitive.Item> {
|
|
22
22
|
inset?: boolean;
|
|
23
|
-
variant?:
|
|
23
|
+
variant?: "default" | "destructive";
|
|
24
24
|
}
|
|
25
25
|
declare function DropdownMenuItem({ className, inset, variant, ...props }: DropdownMenuItemProps): JSX.Element;
|
|
26
26
|
type DropdownMenuCheckboxItemProps = ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>;
|
|
@@ -33,7 +33,7 @@ interface DropdownMenuLabelProps extends ComponentProps<typeof DropdownMenuPrimi
|
|
|
33
33
|
declare function DropdownMenuLabel({ className, inset, ...props }: DropdownMenuLabelProps): JSX.Element;
|
|
34
34
|
type DropdownMenuSeparatorProps = ComponentProps<typeof DropdownMenuPrimitive.Separator>;
|
|
35
35
|
declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): JSX.Element;
|
|
36
|
-
type DropdownMenuShortcutProps = ComponentProps<
|
|
36
|
+
type DropdownMenuShortcutProps = ComponentProps<"span">;
|
|
37
37
|
declare function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps): JSX.Element;
|
|
38
38
|
type DropdownMenuArrowProps = ComponentProps<typeof DropdownMenuPrimitive.Arrow>;
|
|
39
39
|
declare function DropdownMenuArrow({ className, ...props }: DropdownMenuArrowProps): JSX.Element;
|
|
@@ -35,7 +35,7 @@ function DropdownMenuRadioGroup({ ...props }) {
|
|
|
35
35
|
}
|
|
36
36
|
function DropdownMenuSubTrigger({ children, className, inset, ...props }) {
|
|
37
37
|
return /*#__PURE__*/ jsxs(SubTrigger, {
|
|
38
|
-
className: cn(
|
|
38
|
+
className: cn("flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground", className),
|
|
39
39
|
"data-inset": inset,
|
|
40
40
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
41
41
|
...props,
|
|
@@ -51,7 +51,7 @@ function DropdownMenuSubContent({ className, ...props }) {
|
|
|
51
51
|
return /*#__PURE__*/ jsx(Portal, {
|
|
52
52
|
"data-slot": "dropdown-menu-portal",
|
|
53
53
|
children: /*#__PURE__*/ jsx(SubContent, {
|
|
54
|
-
className: cn(
|
|
54
|
+
className: cn("z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 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", className),
|
|
55
55
|
"data-slot": "dropdown-menu-sub-content",
|
|
56
56
|
...props
|
|
57
57
|
})
|
|
@@ -61,7 +61,7 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
|
61
61
|
return /*#__PURE__*/ jsx(Portal, {
|
|
62
62
|
"data-slot": "dropdown-menu-portal",
|
|
63
63
|
children: /*#__PURE__*/ jsx(Content, {
|
|
64
|
-
className: cn(
|
|
64
|
+
className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 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", className),
|
|
65
65
|
"data-slot": "dropdown-menu-content",
|
|
66
66
|
sideOffset: sideOffset,
|
|
67
67
|
...props
|
|
@@ -70,7 +70,7 @@ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
|
70
70
|
}
|
|
71
71
|
function DropdownMenuItem({ className, inset, variant, ...props }) {
|
|
72
72
|
return /*#__PURE__*/ jsx(Item, {
|
|
73
|
-
className: cn("focus:bg-accent focus:text-accent-foreground
|
|
73
|
+
className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground aria-disabled:opacity-50 data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 [&_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", className),
|
|
74
74
|
"data-inset": inset,
|
|
75
75
|
"data-slot": "dropdown-menu-item",
|
|
76
76
|
"data-variant": variant,
|
|
@@ -80,7 +80,7 @@ function DropdownMenuItem({ className, inset, variant, ...props }) {
|
|
|
80
80
|
function DropdownMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
81
81
|
return /*#__PURE__*/ jsxs(CheckboxItem, {
|
|
82
82
|
checked: checked,
|
|
83
|
-
className: cn("
|
|
83
|
+
className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm py-1.5 pr-2 pl-8 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", className),
|
|
84
84
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
85
85
|
...props,
|
|
86
86
|
children: [
|
|
@@ -98,7 +98,7 @@ function DropdownMenuCheckboxItem({ checked, children, className, ...props }) {
|
|
|
98
98
|
}
|
|
99
99
|
function DropdownMenuRadioItem({ children, className, ...props }) {
|
|
100
100
|
return /*#__PURE__*/ jsxs(RadioItem, {
|
|
101
|
-
className: cn("
|
|
101
|
+
className: cn("group/dropdown-menu-item relative flex cursor-default items-center gap-x-2 rounded-sm py-1.5 pr-2 pl-8 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", className),
|
|
102
102
|
"data-slot": "dropdown-menu-radio-item",
|
|
103
103
|
...props,
|
|
104
104
|
children: [
|
|
@@ -116,7 +116,7 @@ function DropdownMenuRadioItem({ children, className, ...props }) {
|
|
|
116
116
|
}
|
|
117
117
|
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
118
118
|
return /*#__PURE__*/ jsx(Label, {
|
|
119
|
-
className: cn(
|
|
119
|
+
className: cn("flex items-center gap-x-2 px-2 py-1.5 text-sm font-semibold data-inset:pl-8", className),
|
|
120
120
|
"data-inset": inset,
|
|
121
121
|
"data-slot": "dropdown-menu-label",
|
|
122
122
|
...props
|
|
@@ -124,21 +124,21 @@ function DropdownMenuLabel({ className, inset, ...props }) {
|
|
|
124
124
|
}
|
|
125
125
|
function DropdownMenuSeparator({ className, ...props }) {
|
|
126
126
|
return /*#__PURE__*/ jsx(Separator, {
|
|
127
|
-
className: cn(
|
|
127
|
+
className: cn("mx-2 my-1 h-px bg-border", className),
|
|
128
128
|
"data-slot": "dropdown-menu-separator",
|
|
129
129
|
...props
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
function DropdownMenuShortcut({ className, ...props }) {
|
|
133
133
|
return /*#__PURE__*/ jsx("span", {
|
|
134
|
-
className: cn(
|
|
134
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-[variant=destructive]/dropdown-menu-item:text-destructive/80", className),
|
|
135
135
|
"data-slot": "dropdown-menu-shortcut",
|
|
136
136
|
...props
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
function DropdownMenuArrow({ className, ...props }) {
|
|
140
140
|
return /*#__PURE__*/ jsx(Arrow, {
|
|
141
|
-
className: cn(
|
|
141
|
+
className: cn("fill-popover", className),
|
|
142
142
|
"data-slot": "dropdown-menu-arrow",
|
|
143
143
|
...props
|
|
144
144
|
});
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
3
|
declare const emptyMediaVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
4
4
|
variant: {
|
|
5
5
|
default: string;
|
|
6
6
|
icon: string;
|
|
7
7
|
};
|
|
8
8
|
}, Record<string, never>>;
|
|
9
|
-
type EmptyProps = ComponentProps<
|
|
9
|
+
type EmptyProps = ComponentProps<"div">;
|
|
10
10
|
declare function Empty({ className, ...props }: EmptyProps): JSX.Element;
|
|
11
|
-
type EmptyHeaderProps = ComponentProps<
|
|
11
|
+
type EmptyHeaderProps = ComponentProps<"div">;
|
|
12
12
|
declare function EmptyHeader({ className, ...props }: EmptyHeaderProps): JSX.Element;
|
|
13
|
-
type EmptyMediaProps = ComponentProps<
|
|
13
|
+
type EmptyMediaProps = ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>;
|
|
14
14
|
declare function EmptyMedia({ className, variant, ...props }: EmptyMediaProps): JSX.Element;
|
|
15
|
-
type EmptyTitleProps = ComponentProps<
|
|
15
|
+
type EmptyTitleProps = ComponentProps<"div">;
|
|
16
16
|
declare function EmptyTitle({ className, ...props }: EmptyTitleProps): JSX.Element;
|
|
17
|
-
type EmptyDescriptionProps = ComponentProps<
|
|
17
|
+
type EmptyDescriptionProps = ComponentProps<"p">;
|
|
18
18
|
declare function EmptyDescription({ className, ...props }: EmptyDescriptionProps): JSX.Element;
|
|
19
|
-
type EmptyContentProps = ComponentProps<
|
|
19
|
+
type EmptyContentProps = ComponentProps<"div">;
|
|
20
20
|
declare function EmptyContent({ className, ...props }: EmptyContentProps): JSX.Element;
|
|
21
|
-
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, emptyMediaVariants, EmptyTitle };
|
|
21
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, emptyMediaVariants, EmptyTitle, };
|
|
22
22
|
export type { EmptyContentProps, EmptyDescriptionProps, EmptyHeaderProps, EmptyMediaProps, EmptyProps, EmptyTitleProps, };
|
package/dist/components/empty.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn, tv } from "@codefast/tailwind-variants";
|
|
3
3
|
const emptyMediaVariants = tv({
|
|
4
|
-
base:
|
|
4
|
+
base: "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
5
5
|
defaultVariants: {
|
|
6
|
-
variant:
|
|
6
|
+
variant: "default"
|
|
7
7
|
},
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
|
-
default:
|
|
11
|
-
icon: "
|
|
10
|
+
default: "bg-transparent",
|
|
11
|
+
icon: "flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
function Empty({ className, ...props }) {
|
|
16
16
|
return /*#__PURE__*/ jsx("div", {
|
|
17
|
-
className: cn(
|
|
17
|
+
className: cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-xl border-dashed p-6 text-center text-balance md:p-12", className),
|
|
18
18
|
"data-slot": "empty",
|
|
19
19
|
...props
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
function EmptyHeader({ className, ...props }) {
|
|
23
23
|
return /*#__PURE__*/ jsx("div", {
|
|
24
|
-
className: cn(
|
|
24
|
+
className: cn("flex max-w-sm flex-col items-center gap-2 text-center", className),
|
|
25
25
|
"data-slot": "empty-header",
|
|
26
26
|
...props
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
function EmptyMedia({ className, variant =
|
|
29
|
+
function EmptyMedia({ className, variant = "default", ...props }) {
|
|
30
30
|
return /*#__PURE__*/ jsx("div", {
|
|
31
31
|
className: emptyMediaVariants({
|
|
32
32
|
className,
|
|
@@ -39,21 +39,21 @@ function EmptyMedia({ className, variant = 'default', ...props }) {
|
|
|
39
39
|
}
|
|
40
40
|
function EmptyTitle({ className, ...props }) {
|
|
41
41
|
return /*#__PURE__*/ jsx("div", {
|
|
42
|
-
className: cn(
|
|
42
|
+
className: cn("text-lg font-medium tracking-tight", className),
|
|
43
43
|
"data-slot": "empty-title",
|
|
44
44
|
...props
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
function EmptyDescription({ className, ...props }) {
|
|
48
48
|
return /*#__PURE__*/ jsx("p", {
|
|
49
|
-
className: cn(
|
|
49
|
+
className: cn("text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
50
50
|
"data-slot": "empty-description",
|
|
51
51
|
...props
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function EmptyContent({ className, ...props }) {
|
|
55
55
|
return /*#__PURE__*/ jsx("div", {
|
|
56
|
-
className: cn(
|
|
56
|
+
className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className),
|
|
57
57
|
"data-slot": "empty-content",
|
|
58
58
|
...props
|
|
59
59
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import { Label } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import { Label } from "./label";
|
|
4
4
|
declare const fieldVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
5
|
orientation: {
|
|
6
6
|
horizontal: string;
|
|
@@ -8,32 +8,32 @@ declare const fieldVariants: import("@codefast/tailwind-variants").VariantFuncti
|
|
|
8
8
|
vertical: string;
|
|
9
9
|
};
|
|
10
10
|
}, Record<string, never>>;
|
|
11
|
-
type FieldSetProps = ComponentProps<
|
|
11
|
+
type FieldSetProps = ComponentProps<"fieldset">;
|
|
12
12
|
declare function FieldSet({ className, ...props }: FieldSetProps): JSX.Element;
|
|
13
|
-
type FieldLegendProps = ComponentProps<
|
|
14
|
-
variant?:
|
|
13
|
+
type FieldLegendProps = ComponentProps<"legend"> & {
|
|
14
|
+
variant?: "label" | "legend";
|
|
15
15
|
};
|
|
16
16
|
declare function FieldLegend({ className, variant, ...props }: FieldLegendProps): JSX.Element;
|
|
17
|
-
type FieldGroupProps = ComponentProps<
|
|
17
|
+
type FieldGroupProps = ComponentProps<"div">;
|
|
18
18
|
declare function FieldGroup({ className, ...props }: FieldGroupProps): JSX.Element;
|
|
19
|
-
type FieldProps = ComponentProps<
|
|
19
|
+
type FieldProps = ComponentProps<"div"> & VariantProps<typeof fieldVariants>;
|
|
20
20
|
declare function Field({ className, orientation, ...props }: FieldProps): JSX.Element;
|
|
21
|
-
type FieldContentProps = ComponentProps<
|
|
21
|
+
type FieldContentProps = ComponentProps<"div">;
|
|
22
22
|
declare function FieldContent({ className, ...props }: FieldContentProps): JSX.Element;
|
|
23
23
|
type FieldLabelProps = ComponentProps<typeof Label>;
|
|
24
24
|
declare function FieldLabel({ className, ...props }: FieldLabelProps): JSX.Element;
|
|
25
|
-
type FieldTitleProps = ComponentProps<
|
|
25
|
+
type FieldTitleProps = ComponentProps<"div">;
|
|
26
26
|
declare function FieldTitle({ className, ...props }: FieldTitleProps): JSX.Element;
|
|
27
|
-
type FieldDescriptionProps = ComponentProps<
|
|
27
|
+
type FieldDescriptionProps = ComponentProps<"p">;
|
|
28
28
|
declare function FieldDescription({ className, ...props }: FieldDescriptionProps): JSX.Element;
|
|
29
|
-
type FieldSeparatorProps = ComponentProps<
|
|
30
|
-
children?: ComponentProps<
|
|
29
|
+
type FieldSeparatorProps = ComponentProps<"div"> & {
|
|
30
|
+
children?: ComponentProps<"span">["children"];
|
|
31
31
|
};
|
|
32
32
|
declare function FieldSeparator({ children, className, ...props }: FieldSeparatorProps): JSX.Element;
|
|
33
33
|
interface FieldErrorMessage {
|
|
34
34
|
message?: string;
|
|
35
35
|
}
|
|
36
|
-
interface FieldErrorProps extends ComponentProps<
|
|
36
|
+
interface FieldErrorProps extends ComponentProps<"div"> {
|
|
37
37
|
errors?: (FieldErrorMessage | undefined)[];
|
|
38
38
|
}
|
|
39
39
|
declare function FieldError({ children, className, errors, ...props }: FieldErrorProps): JSX.Element | null;
|
package/dist/components/field.js
CHANGED
|
@@ -5,28 +5,28 @@ import { useMemo } from "react";
|
|
|
5
5
|
import { Label } from "./label.js";
|
|
6
6
|
import { Separator } from "./separator.js";
|
|
7
7
|
const fieldVariants = tv({
|
|
8
|
-
base:
|
|
8
|
+
base: "group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
|
|
9
9
|
defaultVariants: {
|
|
10
|
-
orientation:
|
|
10
|
+
orientation: "vertical"
|
|
11
11
|
},
|
|
12
12
|
variants: {
|
|
13
13
|
orientation: {
|
|
14
|
-
horizontal: cn(
|
|
15
|
-
responsive: cn(
|
|
16
|
-
vertical:
|
|
14
|
+
horizontal: cn("flex-row items-center", "[&>[data-slot=field-label]]:flex-auto", "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"),
|
|
15
|
+
responsive: cn("flex-col [&>*]:w-full [&>.sr-only]:w-auto", "@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto", "@md/field-group:[&>[data-slot=field-label]]:flex-auto", "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"),
|
|
16
|
+
vertical: "flex-col [&>*]:w-full [&>.sr-only]:w-auto"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
function FieldSet({ className, ...props }) {
|
|
21
21
|
return /*#__PURE__*/ jsx("fieldset", {
|
|
22
|
-
className: cn(
|
|
22
|
+
className: cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className),
|
|
23
23
|
"data-slot": "field-set",
|
|
24
24
|
...props
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
function FieldLegend({ className, variant =
|
|
27
|
+
function FieldLegend({ className, variant = "legend", ...props }) {
|
|
28
28
|
return /*#__PURE__*/ jsx("legend", {
|
|
29
|
-
className: cn(
|
|
29
|
+
className: cn("mb-3 text-base font-medium", "data-[variant=label]:text-sm", className),
|
|
30
30
|
"data-slot": "field-legend",
|
|
31
31
|
"data-variant": variant,
|
|
32
32
|
...props
|
|
@@ -34,12 +34,12 @@ function FieldLegend({ className, variant = 'legend', ...props }) {
|
|
|
34
34
|
}
|
|
35
35
|
function FieldGroup({ className, ...props }) {
|
|
36
36
|
return /*#__PURE__*/ jsx("div", {
|
|
37
|
-
className: cn(
|
|
37
|
+
className: cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4", className),
|
|
38
38
|
"data-slot": "field-group",
|
|
39
39
|
...props
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
function Field({ className, orientation =
|
|
42
|
+
function Field({ className, orientation = "vertical", ...props }) {
|
|
43
43
|
return /*#__PURE__*/ jsx("div", {
|
|
44
44
|
className: fieldVariants({
|
|
45
45
|
className,
|
|
@@ -53,28 +53,28 @@ function Field({ className, orientation = 'vertical', ...props }) {
|
|
|
53
53
|
}
|
|
54
54
|
function FieldContent({ className, ...props }) {
|
|
55
55
|
return /*#__PURE__*/ jsx("div", {
|
|
56
|
-
className: cn(
|
|
56
|
+
className: cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className),
|
|
57
57
|
"data-slot": "field-content",
|
|
58
58
|
...props
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
function FieldLabel({ className, ...props }) {
|
|
62
62
|
return /*#__PURE__*/ jsx(Label, {
|
|
63
|
-
className: cn(
|
|
63
|
+
className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10", className),
|
|
64
64
|
"data-slot": "field-label",
|
|
65
65
|
...props
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
function FieldTitle({ className, ...props }) {
|
|
69
69
|
return /*#__PURE__*/ jsx("div", {
|
|
70
|
-
className: cn(
|
|
70
|
+
className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className),
|
|
71
71
|
"data-slot": "field-label",
|
|
72
72
|
...props
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
function FieldDescription({ className, ...props }) {
|
|
76
76
|
return /*#__PURE__*/ jsx("p", {
|
|
77
|
-
className: cn(
|
|
77
|
+
className: cn("text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
|
|
78
78
|
"data-slot": "field-description",
|
|
79
79
|
...props
|
|
80
80
|
});
|
|
@@ -82,7 +82,7 @@ function FieldDescription({ className, ...props }) {
|
|
|
82
82
|
function FieldSeparator({ children, className, ...props }) {
|
|
83
83
|
const hasContent = Boolean(children);
|
|
84
84
|
return /*#__PURE__*/ jsxs("div", {
|
|
85
|
-
className: cn(
|
|
85
|
+
className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className),
|
|
86
86
|
"data-content": hasContent,
|
|
87
87
|
"data-slot": "field-separator",
|
|
88
88
|
...props,
|
|
@@ -91,7 +91,7 @@ function FieldSeparator({ children, className, ...props }) {
|
|
|
91
91
|
className: "absolute inset-0 top-1/2"
|
|
92
92
|
}),
|
|
93
93
|
hasContent ? /*#__PURE__*/ jsx("span", {
|
|
94
|
-
className: "
|
|
94
|
+
className: "relative mx-auto block w-fit bg-background px-2 text-muted-foreground",
|
|
95
95
|
"data-slot": "field-separator-content",
|
|
96
96
|
children: children
|
|
97
97
|
}) : null
|
|
@@ -120,7 +120,7 @@ function FieldError({ children, className, errors, ...props }) {
|
|
|
120
120
|
const content = children ?? fallbackContent;
|
|
121
121
|
if (null == content || false === content) return null;
|
|
122
122
|
return /*#__PURE__*/ jsx("div", {
|
|
123
|
-
className: cn(
|
|
123
|
+
className: cn("text-sm font-normal text-destructive", className),
|
|
124
124
|
"data-slot": "field-error",
|
|
125
125
|
role: "alert",
|
|
126
126
|
...props,
|