@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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import * as AlertDialogPrimitive from
|
|
4
|
-
import { buttonVariants } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
4
|
+
import { buttonVariants } from "./button";
|
|
5
5
|
type AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root>;
|
|
6
6
|
declare function AlertDialog({ ...props }: AlertDialogProps): JSX.Element;
|
|
7
7
|
type AlertDialogTriggerProps = ComponentProps<typeof AlertDialogPrimitive.Trigger>;
|
|
@@ -14,24 +14,24 @@ interface AlertDialogContentProps extends ComponentProps<typeof AlertDialogPrimi
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
declare function AlertDialogContent({ children, className, classNames, ...props }: AlertDialogContentProps): JSX.Element;
|
|
17
|
-
type AlertDialogHeaderProps = ComponentProps<
|
|
17
|
+
type AlertDialogHeaderProps = ComponentProps<"div">;
|
|
18
18
|
declare function AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps): JSX.Element;
|
|
19
|
-
type AlertDialogBodyProps = ComponentProps<
|
|
19
|
+
type AlertDialogBodyProps = ComponentProps<"div">;
|
|
20
20
|
declare function AlertDialogBody({ className, ...props }: AlertDialogBodyProps): JSX.Element;
|
|
21
|
-
type AlertDialogFooterProps = ComponentProps<
|
|
21
|
+
type AlertDialogFooterProps = ComponentProps<"div">;
|
|
22
22
|
declare function AlertDialogFooter({ className, ...props }: AlertDialogFooterProps): JSX.Element;
|
|
23
23
|
type AlertDialogTitleProps = ComponentProps<typeof AlertDialogPrimitive.Title>;
|
|
24
24
|
declare function AlertDialogTitle({ className, ...props }: AlertDialogTitleProps): JSX.Element;
|
|
25
25
|
type AlertDialogDescriptionProps = ComponentProps<typeof AlertDialogPrimitive.Description>;
|
|
26
26
|
declare function AlertDialogDescription({ className, ...props }: AlertDialogDescriptionProps): JSX.Element;
|
|
27
27
|
interface AlertDialogActionProps extends ComponentProps<typeof AlertDialogPrimitive.Action> {
|
|
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 AlertDialogAction({ className, size, variant, ...props }: AlertDialogActionProps): JSX.Element;
|
|
32
32
|
interface AlertDialogCancelProps extends ComponentProps<typeof AlertDialogPrimitive.Cancel> {
|
|
33
|
-
size?: VariantProps<typeof buttonVariants>[
|
|
34
|
-
variant?: VariantProps<typeof buttonVariants>[
|
|
33
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
34
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
35
35
|
}
|
|
36
36
|
declare function AlertDialogCancel({ className, size, variant, ...props }: AlertDialogCancelProps): JSX.Element;
|
|
37
37
|
export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, };
|
|
@@ -19,15 +19,15 @@ function AlertDialogContent({ children, className, classNames, ...props }) {
|
|
|
19
19
|
return /*#__PURE__*/ jsxs(Portal, {
|
|
20
20
|
children: [
|
|
21
21
|
/*#__PURE__*/ jsx(Overlay, {
|
|
22
|
-
className: cn(
|
|
22
|
+
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),
|
|
23
23
|
"data-slot": "alert-dialog-overlay"
|
|
24
24
|
}),
|
|
25
25
|
/*#__PURE__*/ jsx(Content, {
|
|
26
|
-
className: cn(
|
|
26
|
+
className: cn("fixed inset-0 z-50 grid grid-rows-[1fr_auto_1fr] justify-items-center overflow-auto p-8 ease-ui data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:grid-rows-[1fr_auto_3fr] sm:p-4", classNames?.wrapper),
|
|
27
27
|
"data-slot": "alert-dialog-content-wrapper",
|
|
28
28
|
...props,
|
|
29
29
|
children: /*#__PURE__*/ jsx("div", {
|
|
30
|
-
className: cn(
|
|
30
|
+
className: cn("relative row-start-2 flex w-full max-w-lg flex-col rounded-2xl border bg-popover text-popover-foreground shadow-lg", classNames?.content, className),
|
|
31
31
|
"data-slot": "alert-dialog-content",
|
|
32
32
|
children: children
|
|
33
33
|
})
|
|
@@ -37,35 +37,35 @@ function AlertDialogContent({ children, className, classNames, ...props }) {
|
|
|
37
37
|
}
|
|
38
38
|
function AlertDialogHeader({ className, ...props }) {
|
|
39
39
|
return /*#__PURE__*/ jsx("div", {
|
|
40
|
-
className: cn(
|
|
40
|
+
className: cn("flex shrink-0 flex-col gap-1.5 px-6 pt-6 pb-4 text-center sm:text-left", className),
|
|
41
41
|
"data-slot": "alert-dialog-header",
|
|
42
42
|
...props
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
function AlertDialogBody({ className, ...props }) {
|
|
46
46
|
return /*#__PURE__*/ jsx("main", {
|
|
47
|
-
className: cn(
|
|
47
|
+
className: cn("overflow-auto px-6 py-2", className),
|
|
48
48
|
"data-slot": "alert-dialog-body",
|
|
49
49
|
...props
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
function AlertDialogFooter({ className, ...props }) {
|
|
53
53
|
return /*#__PURE__*/ jsx("div", {
|
|
54
|
-
className: cn(
|
|
54
|
+
className: cn("flex shrink-0 flex-col-reverse gap-2 px-6 pt-4 pb-6 sm:flex-row sm:justify-end", className),
|
|
55
55
|
"data-slot": "alert-dialog-footer",
|
|
56
56
|
...props
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
function AlertDialogTitle({ className, ...props }) {
|
|
60
60
|
return /*#__PURE__*/ jsx(Title, {
|
|
61
|
-
className: cn(
|
|
61
|
+
className: cn("text-lg leading-none font-semibold tracking-tight", className),
|
|
62
62
|
"data-slot": "alert-dialog-title",
|
|
63
63
|
...props
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
function AlertDialogDescription({ className, ...props }) {
|
|
67
67
|
return /*#__PURE__*/ jsx(Description, {
|
|
68
|
-
className: cn(
|
|
68
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
69
69
|
"data-slot": "alert-dialog-description",
|
|
70
70
|
...props
|
|
71
71
|
});
|
|
@@ -81,7 +81,7 @@ function AlertDialogAction({ className, size, variant, ...props }) {
|
|
|
81
81
|
...props
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
function AlertDialogCancel({ className, size, variant =
|
|
84
|
+
function AlertDialogCancel({ className, size, variant = "outline", ...props }) {
|
|
85
85
|
return /*#__PURE__*/ jsx(Cancel, {
|
|
86
86
|
className: buttonVariants({
|
|
87
87
|
className,
|
|
@@ -1,17 +1,17 @@
|
|
|
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 alertVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
4
4
|
variant: {
|
|
5
5
|
default: string;
|
|
6
6
|
destructive: string;
|
|
7
7
|
};
|
|
8
8
|
}, Record<string, never>>;
|
|
9
|
-
interface AlertProps extends ComponentProps<
|
|
9
|
+
interface AlertProps extends ComponentProps<"div">, VariantProps<typeof alertVariants> {
|
|
10
10
|
}
|
|
11
11
|
declare function Alert({ className, variant, ...props }: AlertProps): JSX.Element;
|
|
12
|
-
type AlertTitleProps = ComponentProps<
|
|
12
|
+
type AlertTitleProps = ComponentProps<"div">;
|
|
13
13
|
declare function AlertTitle({ children, className, ...props }: AlertTitleProps): JSX.Element;
|
|
14
|
-
type AlertDescriptionProps = ComponentProps<
|
|
14
|
+
type AlertDescriptionProps = ComponentProps<"div">;
|
|
15
15
|
declare function AlertDescription({ className, ...props }: AlertDescriptionProps): JSX.Element;
|
|
16
16
|
export { alertVariants };
|
|
17
17
|
export { Alert, AlertDescription, AlertTitle };
|
package/dist/components/alert.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn, tv } from "@codefast/tailwind-variants";
|
|
3
3
|
const alertVariants = tv({
|
|
4
|
-
base:
|
|
4
|
+
base: "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-xl border bg-card px-4 py-3 text-sm has-[>svg]:grid-cols-[--spacing(4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
5
5
|
defaultVariants: {
|
|
6
|
-
variant:
|
|
6
|
+
variant: "default"
|
|
7
7
|
},
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
|
-
default:
|
|
10
|
+
default: "text-card-foreground",
|
|
11
11
|
destructive: "text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -25,7 +25,7 @@ function Alert({ className, variant, ...props }) {
|
|
|
25
25
|
}
|
|
26
26
|
function AlertTitle({ children, className, ...props }) {
|
|
27
27
|
return /*#__PURE__*/ jsx("div", {
|
|
28
|
-
className: cn(
|
|
28
|
+
className: cn("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", className),
|
|
29
29
|
"data-slot": "alert-title",
|
|
30
30
|
...props,
|
|
31
31
|
children: children
|
|
@@ -33,7 +33,7 @@ function AlertTitle({ children, className, ...props }) {
|
|
|
33
33
|
}
|
|
34
34
|
function AlertDescription({ className, ...props }) {
|
|
35
35
|
return /*#__PURE__*/ jsx("div", {
|
|
36
|
-
className: cn(
|
|
36
|
+
className: cn("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed", className),
|
|
37
37
|
"data-slot": "alert-description",
|
|
38
38
|
...props
|
|
39
39
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as AspectRatioPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
3
3
|
type AspectRatioProps = ComponentProps<typeof AspectRatioPrimitive.Root>;
|
|
4
4
|
declare function AspectRatio({ ...props }: AspectRatioProps): JSX.Element;
|
|
5
5
|
export { AspectRatio };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import * as AvatarPrimitive from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
3
|
type AvatarProps = ComponentProps<typeof AvatarPrimitive.Root>;
|
|
4
4
|
declare function Avatar({ className, ...props }: AvatarProps): JSX.Element;
|
|
5
5
|
type AvatarImageProps = ComponentProps<typeof AvatarPrimitive.Image>;
|
|
@@ -4,21 +4,21 @@ import { cn } from "@codefast/tailwind-variants";
|
|
|
4
4
|
import { Fallback, Image, Root } from "@radix-ui/react-avatar";
|
|
5
5
|
function Avatar({ className, ...props }) {
|
|
6
6
|
return /*#__PURE__*/ jsx(Root, {
|
|
7
|
-
className: cn(
|
|
7
|
+
className: cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className),
|
|
8
8
|
"data-slot": "avatar",
|
|
9
9
|
...props
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
function AvatarImage({ className, ...props }) {
|
|
13
13
|
return /*#__PURE__*/ jsx(Image, {
|
|
14
|
-
className: cn(
|
|
14
|
+
className: cn("aspect-square size-full", className),
|
|
15
15
|
"data-slot": "avatar-image",
|
|
16
16
|
...props
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
function AvatarFallback({ className, ...props }) {
|
|
20
20
|
return /*#__PURE__*/ jsx(Fallback, {
|
|
21
|
-
className: cn(
|
|
21
|
+
className: cn("flex size-full items-center justify-center rounded-full bg-muted", className),
|
|
22
22
|
"data-slot": "avatar-fallback",
|
|
23
23
|
...props
|
|
24
24
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
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 badgeVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
4
4
|
variant: {
|
|
5
5
|
default: string;
|
|
@@ -8,7 +8,7 @@ declare const badgeVariants: import("@codefast/tailwind-variants").VariantFuncti
|
|
|
8
8
|
secondary: string;
|
|
9
9
|
};
|
|
10
10
|
}, Record<string, never>>;
|
|
11
|
-
interface BadgeProps extends ComponentProps<
|
|
11
|
+
interface BadgeProps extends ComponentProps<"span">, VariantProps<typeof badgeVariants> {
|
|
12
12
|
asChild?: boolean;
|
|
13
13
|
}
|
|
14
14
|
declare function Badge({ asChild, className, variant, ...props }: BadgeProps): JSX.Element;
|
package/dist/components/badge.js
CHANGED
|
@@ -3,21 +3,21 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { tv } from "@codefast/tailwind-variants";
|
|
4
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
5
5
|
const badgeVariants = tv({
|
|
6
|
-
base:
|
|
6
|
+
base: "inline-flex w-fit shrink-0 items-center justify-center gap-2 rounded-md border px-1.5 py-0.5 text-xs font-medium whitespace-nowrap outline-hidden transition focus-visible:ring-3 focus-visible:ring-ring/50 [&>svg]:size-3 [&>svg]:shrink-0",
|
|
7
7
|
defaultVariants: {
|
|
8
|
-
variant:
|
|
8
|
+
variant: "default"
|
|
9
9
|
},
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default:
|
|
13
|
-
destructive:
|
|
14
|
-
outline:
|
|
15
|
-
secondary:
|
|
12
|
+
default: "border-transparent bg-primary text-primary-foreground focus-visible:ring-primary/20 dark:focus-visible:ring-primary/40 [a&]:hover:bg-primary/80",
|
|
13
|
+
destructive: "border-transparent bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
|
|
14
|
+
outline: "border-input bg-background focus-visible:border-ring [a&]:hover:border-ring/60 [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
|
15
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/80"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
function Badge({ asChild, className, variant, ...props }) {
|
|
20
|
-
const Component = asChild ? Slot :
|
|
20
|
+
const Component = asChild ? Slot : "span";
|
|
21
21
|
return /*#__PURE__*/ jsx(Component, {
|
|
22
22
|
className: badgeVariants({
|
|
23
23
|
className,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import type { ComponentProps, JSX, ReactNode } from
|
|
2
|
-
interface BreadcrumbProps extends ComponentProps<
|
|
1
|
+
import type { ComponentProps, JSX, ReactNode } from "react";
|
|
2
|
+
interface BreadcrumbProps extends ComponentProps<"nav"> {
|
|
3
3
|
separator?: ReactNode;
|
|
4
4
|
}
|
|
5
5
|
declare function Breadcrumb({ ...props }: BreadcrumbProps): JSX.Element;
|
|
6
|
-
type BreadcrumbListProps = ComponentProps<
|
|
6
|
+
type BreadcrumbListProps = ComponentProps<"ol">;
|
|
7
7
|
declare function BreadcrumbList({ className, ...props }: BreadcrumbListProps): JSX.Element;
|
|
8
|
-
type BreadcrumbItemProps = ComponentProps<
|
|
8
|
+
type BreadcrumbItemProps = ComponentProps<"li">;
|
|
9
9
|
declare function BreadcrumbItem({ className, ...props }: BreadcrumbItemProps): JSX.Element;
|
|
10
|
-
interface BreadcrumbLinkProps extends ComponentProps<
|
|
10
|
+
interface BreadcrumbLinkProps extends ComponentProps<"a"> {
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
}
|
|
13
13
|
declare function BreadcrumbLink({ asChild, className, ...props }: BreadcrumbLinkProps): JSX.Element;
|
|
14
|
-
type BreadcrumbPageProps = ComponentProps<
|
|
14
|
+
type BreadcrumbPageProps = ComponentProps<"span">;
|
|
15
15
|
declare function BreadcrumbPage({ className, ...props }: BreadcrumbPageProps): JSX.Element;
|
|
16
|
-
type BreadcrumbSeparatorProps = ComponentProps<
|
|
16
|
+
type BreadcrumbSeparatorProps = ComponentProps<"li">;
|
|
17
17
|
declare function BreadcrumbSeparator({ children, ...props }: BreadcrumbSeparatorProps): JSX.Element;
|
|
18
|
-
type BreadcrumbEllipsisProps = ComponentProps<
|
|
18
|
+
type BreadcrumbEllipsisProps = ComponentProps<"span">;
|
|
19
19
|
declare function BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps): JSX.Element;
|
|
20
20
|
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, };
|
|
21
21
|
export type { BreadcrumbEllipsisProps, BreadcrumbItemProps, BreadcrumbLinkProps, BreadcrumbListProps, BreadcrumbPageProps, BreadcrumbProps, BreadcrumbSeparatorProps, };
|
|
@@ -12,22 +12,22 @@ function Breadcrumb({ ...props }) {
|
|
|
12
12
|
}
|
|
13
13
|
function BreadcrumbList({ className, ...props }) {
|
|
14
14
|
return /*#__PURE__*/ jsx("ol", {
|
|
15
|
-
className: cn(
|
|
15
|
+
className: cn("flex flex-wrap items-center gap-1.5 text-sm break-words text-muted-foreground sm:gap-2", className),
|
|
16
16
|
"data-slot": "breadcrumb-list",
|
|
17
17
|
...props
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
function BreadcrumbItem({ className, ...props }) {
|
|
21
21
|
return /*#__PURE__*/ jsx("li", {
|
|
22
|
-
className: cn(
|
|
22
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
23
23
|
"data-slot": "breadcrumb-item",
|
|
24
24
|
...props
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
function BreadcrumbLink({ asChild, className, ...props }) {
|
|
28
|
-
const Component = asChild ? Slot :
|
|
28
|
+
const Component = asChild ? Slot : "a";
|
|
29
29
|
return /*#__PURE__*/ jsx(Component, {
|
|
30
|
-
className: cn(
|
|
30
|
+
className: cn("transition-colors hover:text-foreground", className),
|
|
31
31
|
"data-slot": "breadcrumb-link",
|
|
32
32
|
...props
|
|
33
33
|
});
|
|
@@ -36,10 +36,8 @@ function BreadcrumbPage({ className, ...props }) {
|
|
|
36
36
|
return /*#__PURE__*/ jsx("span", {
|
|
37
37
|
"aria-current": "page",
|
|
38
38
|
"aria-disabled": "true",
|
|
39
|
-
className: cn(
|
|
39
|
+
className: cn("font-normal text-foreground", className),
|
|
40
40
|
"data-slot": "breadcrumb-page",
|
|
41
|
-
role: "link",
|
|
42
|
-
tabIndex: 0,
|
|
43
41
|
...props
|
|
44
42
|
});
|
|
45
43
|
}
|
|
@@ -57,7 +55,7 @@ function BreadcrumbSeparator({ children, ...props }) {
|
|
|
57
55
|
function BreadcrumbEllipsis({ className, ...props }) {
|
|
58
56
|
return /*#__PURE__*/ jsxs("span", {
|
|
59
57
|
"aria-hidden": "true",
|
|
60
|
-
className: cn(
|
|
58
|
+
className: cn("flex size-4 items-center justify-center", className),
|
|
61
59
|
"data-slot": "breadcrumb-ellipsis",
|
|
62
60
|
role: "presentation",
|
|
63
61
|
...props,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { VariantProps } from
|
|
2
|
-
import type { ComponentProps, JSX } from
|
|
3
|
-
import { Separator } from
|
|
1
|
+
import type { VariantProps } from "@codefast/tailwind-variants";
|
|
2
|
+
import type { ComponentProps, JSX } from "react";
|
|
3
|
+
import { Separator } from "./separator";
|
|
4
4
|
declare const buttonGroupVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
5
5
|
orientation: {
|
|
6
6
|
horizontal: string;
|
|
7
7
|
vertical: string;
|
|
8
8
|
};
|
|
9
9
|
}, Record<string, never>>;
|
|
10
|
-
type ButtonGroupProps = ComponentProps<
|
|
10
|
+
type ButtonGroupProps = ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>;
|
|
11
11
|
declare function ButtonGroup({ className, orientation, ...props }: ButtonGroupProps): JSX.Element;
|
|
12
|
-
interface ButtonGroupTextProps extends ComponentProps<
|
|
12
|
+
interface ButtonGroupTextProps extends ComponentProps<"div"> {
|
|
13
13
|
asChild?: boolean;
|
|
14
14
|
}
|
|
15
15
|
declare function ButtonGroupText({ asChild, className, ...props }: ButtonGroupTextProps): JSX.Element;
|
|
@@ -4,14 +4,14 @@ import { cn, tv } from "@codefast/tailwind-variants";
|
|
|
4
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
5
5
|
import { Separator } from "./separator.js";
|
|
6
6
|
const buttonGroupVariants = tv({
|
|
7
|
-
base: cn(
|
|
7
|
+
base: cn("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2", "[&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit", "[&>*]:focus-visible:relative [&>*]:focus-visible:z-10 [&>input]:flex-1", "has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg"),
|
|
8
8
|
defaultVariants: {
|
|
9
|
-
orientation:
|
|
9
|
+
orientation: "horizontal"
|
|
10
10
|
},
|
|
11
11
|
variants: {
|
|
12
12
|
orientation: {
|
|
13
|
-
horizontal:
|
|
14
|
-
vertical:
|
|
13
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
14
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
});
|
|
@@ -27,15 +27,15 @@ function ButtonGroup({ className, orientation, ...props }) {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
function ButtonGroupText({ asChild = false, className, ...props }) {
|
|
30
|
-
const Component = asChild ? Slot :
|
|
30
|
+
const Component = asChild ? Slot : "div";
|
|
31
31
|
return /*#__PURE__*/ jsx(Component, {
|
|
32
|
-
className: cn("
|
|
32
|
+
className: cn("flex items-center gap-2 rounded-lg border bg-muted px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className),
|
|
33
33
|
...props
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
function ButtonGroupSeparator({ className, orientation =
|
|
36
|
+
function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
|
|
37
37
|
return /*#__PURE__*/ jsx(Separator, {
|
|
38
|
-
className: cn(
|
|
38
|
+
className: cn("relative !m-0 self-stretch bg-input data-[orientation=vertical]:h-auto", className),
|
|
39
39
|
"data-slot": "button-group-separator",
|
|
40
40
|
orientation: orientation,
|
|
41
41
|
...props
|
|
@@ -1,10 +1,10 @@
|
|
|
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 buttonVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
|
|
4
4
|
size: {
|
|
5
|
-
|
|
5
|
+
"icon-sm": string;
|
|
6
6
|
icon: string;
|
|
7
|
-
|
|
7
|
+
"icon-lg": string;
|
|
8
8
|
sm: string;
|
|
9
9
|
md: string;
|
|
10
10
|
lg: string;
|
|
@@ -18,9 +18,9 @@ declare const buttonVariants: import("@codefast/tailwind-variants").VariantFunct
|
|
|
18
18
|
secondary: string;
|
|
19
19
|
};
|
|
20
20
|
}, Record<string, never>>;
|
|
21
|
-
type ButtonProps = ComponentProps<
|
|
21
|
+
type ButtonProps = ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
22
22
|
asChild?: boolean;
|
|
23
|
-
type?: ComponentProps<
|
|
23
|
+
type?: ComponentProps<"button">["type"];
|
|
24
24
|
};
|
|
25
25
|
declare function Button({ asChild, children, className, size, type, variant, ...props }: ButtonProps): JSX.Element;
|
|
26
26
|
export { buttonVariants };
|
|
@@ -2,32 +2,32 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { tv } from "@codefast/tailwind-variants";
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
4
|
const buttonVariants = tv({
|
|
5
|
-
base: "
|
|
5
|
+
base: "inline-flex shrink-0 items-center justify-center gap-2 rounded-lg text-sm font-medium whitespace-nowrap outline-hidden transition select-none focus-visible:ring-3 disabled:opacity-50 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
6
6
|
defaultVariants: {
|
|
7
|
-
size:
|
|
8
|
-
variant:
|
|
7
|
+
size: "md",
|
|
8
|
+
variant: "default"
|
|
9
9
|
},
|
|
10
10
|
variants: {
|
|
11
11
|
size: {
|
|
12
|
-
|
|
13
|
-
icon:
|
|
14
|
-
|
|
15
|
-
sm:
|
|
16
|
-
md:
|
|
17
|
-
lg:
|
|
12
|
+
"icon-sm": "size-8",
|
|
13
|
+
icon: "size-9",
|
|
14
|
+
"icon-lg": "size-10",
|
|
15
|
+
sm: "h-8 px-3 has-[>svg]:px-2.5",
|
|
16
|
+
md: "h-9 px-4 has-[>svg]:px-3",
|
|
17
|
+
lg: "h-10 px-6 has-[>svg]:px-4"
|
|
18
18
|
},
|
|
19
19
|
variant: {
|
|
20
|
-
default:
|
|
21
|
-
destructive:
|
|
22
|
-
ghost:
|
|
23
|
-
link:
|
|
24
|
-
outline:
|
|
25
|
-
secondary:
|
|
20
|
+
default: "bg-primary text-primary-foreground hover:not-disabled:bg-primary/80 focus-visible:ring-primary/20 dark:focus-visible:ring-primary/40",
|
|
21
|
+
destructive: "bg-destructive text-white hover:not-disabled:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
22
|
+
ghost: "hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:ring-ring/50 dark:hover:not-disabled:bg-secondary/50",
|
|
23
|
+
link: "text-primary underline-offset-4 hover:not-disabled:underline focus-visible:ring-ring/50",
|
|
24
|
+
outline: "border border-input shadow-xs hover:not-disabled:border-ring/60 hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive focus-within:aria-invalid:ring-destructive/20 hover:not-disabled:aria-invalid:border-destructive/60 dark:bg-input/30 dark:hover:not-disabled:bg-input/50 dark:aria-invalid:border-destructive/70 dark:focus-within:aria-invalid:ring-destructive/40",
|
|
25
|
+
secondary: "bg-secondary text-secondary-foreground hover:not-disabled:bg-secondary/80 focus-visible:ring-ring/50"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
-
function Button({ asChild = false, children, className, size, type =
|
|
30
|
-
const Comp = asChild ? Slot :
|
|
29
|
+
function Button({ asChild = false, children, className, size, type = "button", variant, ...props }) {
|
|
30
|
+
const Comp = asChild ? Slot : "button";
|
|
31
31
|
if (asChild) return /*#__PURE__*/ jsx(Comp, {
|
|
32
32
|
className: buttonVariants({
|
|
33
33
|
className,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
import type { DayButton } from
|
|
3
|
-
import { DayPicker } from
|
|
4
|
-
import { Button } from
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
import type { DayButton } from "react-day-picker";
|
|
3
|
+
import { DayPicker } from "react-day-picker";
|
|
4
|
+
import { Button } from "./button";
|
|
5
5
|
type CalendarProps = ComponentProps<typeof DayPicker> & {
|
|
6
|
-
buttonVariant?: ComponentProps<typeof Button>[
|
|
6
|
+
buttonVariant?: ComponentProps<typeof Button>["variant"];
|
|
7
7
|
};
|
|
8
8
|
declare function Calendar({ buttonVariant, captionLayout, className, classNames, components, formatters, showOutsideDays, ...props }: CalendarProps): JSX.Element;
|
|
9
9
|
type CalendarDayButtonProps = ComponentProps<typeof DayButton>;
|