@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
|
@@ -35,14 +35,14 @@ const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants")
|
|
|
35
35
|
const react_slot_namespaceObject = require("@radix-ui/react-slot");
|
|
36
36
|
const external_separator_cjs_namespaceObject = require("./separator.cjs");
|
|
37
37
|
const buttonGroupVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
38
|
-
base: (0, tailwind_variants_namespaceObject.cn)(
|
|
38
|
+
base: (0, tailwind_variants_namespaceObject.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"),
|
|
39
39
|
defaultVariants: {
|
|
40
|
-
orientation:
|
|
40
|
+
orientation: "horizontal"
|
|
41
41
|
},
|
|
42
42
|
variants: {
|
|
43
43
|
orientation: {
|
|
44
|
-
horizontal:
|
|
45
|
-
vertical:
|
|
44
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
45
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
});
|
|
@@ -58,15 +58,15 @@ function ButtonGroup({ className, orientation, ...props }) {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
function ButtonGroupText({ asChild = false, className, ...props }) {
|
|
61
|
-
const Component = asChild ? react_slot_namespaceObject.Slot :
|
|
61
|
+
const Component = asChild ? react_slot_namespaceObject.Slot : "div";
|
|
62
62
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, {
|
|
63
|
-
className: (0, tailwind_variants_namespaceObject.cn)("
|
|
63
|
+
className: (0, tailwind_variants_namespaceObject.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),
|
|
64
64
|
...props
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
function ButtonGroupSeparator({ className, orientation =
|
|
67
|
+
function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
|
|
68
68
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_separator_cjs_namespaceObject.Separator, {
|
|
69
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
69
|
+
className: (0, tailwind_variants_namespaceObject.cn)("relative !m-0 self-stretch bg-input data-[orientation=vertical]:h-auto", className),
|
|
70
70
|
"data-slot": "button-group-separator",
|
|
71
71
|
orientation: orientation,
|
|
72
72
|
...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
|
|
@@ -31,32 +31,32 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
31
31
|
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
32
32
|
const react_slot_namespaceObject = require("@radix-ui/react-slot");
|
|
33
33
|
const buttonVariants = (0, tailwind_variants_namespaceObject.tv)({
|
|
34
|
-
base: "
|
|
34
|
+
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",
|
|
35
35
|
defaultVariants: {
|
|
36
|
-
size:
|
|
37
|
-
variant:
|
|
36
|
+
size: "md",
|
|
37
|
+
variant: "default"
|
|
38
38
|
},
|
|
39
39
|
variants: {
|
|
40
40
|
size: {
|
|
41
|
-
|
|
42
|
-
icon:
|
|
43
|
-
|
|
44
|
-
sm:
|
|
45
|
-
md:
|
|
46
|
-
lg:
|
|
41
|
+
"icon-sm": "size-8",
|
|
42
|
+
icon: "size-9",
|
|
43
|
+
"icon-lg": "size-10",
|
|
44
|
+
sm: "h-8 px-3 has-[>svg]:px-2.5",
|
|
45
|
+
md: "h-9 px-4 has-[>svg]:px-3",
|
|
46
|
+
lg: "h-10 px-6 has-[>svg]:px-4"
|
|
47
47
|
},
|
|
48
48
|
variant: {
|
|
49
|
-
default:
|
|
50
|
-
destructive:
|
|
51
|
-
ghost:
|
|
52
|
-
link:
|
|
53
|
-
outline:
|
|
54
|
-
secondary:
|
|
49
|
+
default: "bg-primary text-primary-foreground hover:not-disabled:bg-primary/80 focus-visible:ring-primary/20 dark:focus-visible:ring-primary/40",
|
|
50
|
+
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",
|
|
51
|
+
ghost: "hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground focus-visible:ring-ring/50 dark:hover:not-disabled:bg-secondary/50",
|
|
52
|
+
link: "text-primary underline-offset-4 hover:not-disabled:underline focus-visible:ring-ring/50",
|
|
53
|
+
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",
|
|
54
|
+
secondary: "bg-secondary text-secondary-foreground hover:not-disabled:bg-secondary/80 focus-visible:ring-ring/50"
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
-
function Button({ asChild = false, children, className, size, type =
|
|
59
|
-
const Comp = asChild ? react_slot_namespaceObject.Slot :
|
|
58
|
+
function Button({ asChild = false, children, className, size, type = "button", variant, ...props }) {
|
|
59
|
+
const Comp = asChild ? react_slot_namespaceObject.Slot : "button";
|
|
60
60
|
if (asChild) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Comp, {
|
|
61
61
|
className: buttonVariants({
|
|
62
62
|
className,
|
|
@@ -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,
|
|
@@ -34,41 +34,41 @@ const external_lucide_react_namespaceObject = require("lucide-react");
|
|
|
34
34
|
const external_react_namespaceObject = require("react");
|
|
35
35
|
const external_react_day_picker_namespaceObject = require("react-day-picker");
|
|
36
36
|
const external_button_cjs_namespaceObject = require("./button.cjs");
|
|
37
|
-
function Calendar({ buttonVariant =
|
|
37
|
+
function Calendar({ buttonVariant = "ghost", captionLayout = "label", className, classNames, components, formatters, showOutsideDays = true, ...props }) {
|
|
38
38
|
const defaultClassNames = (0, external_react_day_picker_namespaceObject.getDefaultClassNames)();
|
|
39
39
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_react_day_picker_namespaceObject.DayPicker, {
|
|
40
40
|
captionLayout: captionLayout,
|
|
41
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
41
|
+
className: (0, tailwind_variants_namespaceObject.cn)("group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", "rtl:**:[.rdp-button_next>svg]:rotate-180", "rtl:**:[.rdp-button_previous>svg]:rotate-180", className),
|
|
42
42
|
classNames: {
|
|
43
43
|
button_next: (0, tailwind_variants_namespaceObject.cn)((0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
44
44
|
variant: buttonVariant
|
|
45
|
-
}),
|
|
45
|
+
}), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
46
46
|
button_previous: (0, tailwind_variants_namespaceObject.cn)((0, external_button_cjs_namespaceObject.buttonVariants)({
|
|
47
47
|
variant: buttonVariant
|
|
48
|
-
}),
|
|
49
|
-
caption_label: (0, tailwind_variants_namespaceObject.cn)(
|
|
50
|
-
day: (0, tailwind_variants_namespaceObject.cn)(
|
|
51
|
-
disabled: (0, tailwind_variants_namespaceObject.cn)(
|
|
52
|
-
dropdown: (0, tailwind_variants_namespaceObject.cn)(
|
|
53
|
-
dropdown_root: (0, tailwind_variants_namespaceObject.cn)(
|
|
54
|
-
dropdowns: (0, tailwind_variants_namespaceObject.cn)(
|
|
55
|
-
hidden: (0, tailwind_variants_namespaceObject.cn)(
|
|
56
|
-
month: (0, tailwind_variants_namespaceObject.cn)(
|
|
57
|
-
month_caption: (0, tailwind_variants_namespaceObject.cn)(
|
|
58
|
-
months: (0, tailwind_variants_namespaceObject.cn)(
|
|
59
|
-
nav: (0, tailwind_variants_namespaceObject.cn)(
|
|
60
|
-
outside: (0, tailwind_variants_namespaceObject.cn)(
|
|
61
|
-
range_end: (0, tailwind_variants_namespaceObject.cn)(
|
|
62
|
-
range_middle: (0, tailwind_variants_namespaceObject.cn)(
|
|
63
|
-
range_start: (0, tailwind_variants_namespaceObject.cn)(
|
|
64
|
-
root: (0, tailwind_variants_namespaceObject.cn)(
|
|
65
|
-
table:
|
|
66
|
-
today: (0, tailwind_variants_namespaceObject.cn)(
|
|
67
|
-
week: (0, tailwind_variants_namespaceObject.cn)(
|
|
68
|
-
week_number: (0, tailwind_variants_namespaceObject.cn)(
|
|
69
|
-
week_number_header: (0, tailwind_variants_namespaceObject.cn)(
|
|
70
|
-
weekday: (0, tailwind_variants_namespaceObject.cn)(
|
|
71
|
-
weekdays: (0, tailwind_variants_namespaceObject.cn)(
|
|
48
|
+
}), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
|
|
49
|
+
caption_label: (0, tailwind_variants_namespaceObject.cn)("font-medium select-none", "label" === captionLayout ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
|
|
50
|
+
day: (0, tailwind_variants_namespaceObject.cn)("group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
|
|
51
|
+
disabled: (0, tailwind_variants_namespaceObject.cn)("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
52
|
+
dropdown: (0, tailwind_variants_namespaceObject.cn)("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
53
|
+
dropdown_root: (0, tailwind_variants_namespaceObject.cn)("relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-3 has-focus:ring-ring/50", defaultClassNames.dropdown_root),
|
|
54
|
+
dropdowns: (0, tailwind_variants_namespaceObject.cn)("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
55
|
+
hidden: (0, tailwind_variants_namespaceObject.cn)("invisible", defaultClassNames.hidden),
|
|
56
|
+
month: (0, tailwind_variants_namespaceObject.cn)("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
57
|
+
month_caption: (0, tailwind_variants_namespaceObject.cn)("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
58
|
+
months: (0, tailwind_variants_namespaceObject.cn)("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
59
|
+
nav: (0, tailwind_variants_namespaceObject.cn)("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
|
|
60
|
+
outside: (0, tailwind_variants_namespaceObject.cn)("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
61
|
+
range_end: (0, tailwind_variants_namespaceObject.cn)("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
62
|
+
range_middle: (0, tailwind_variants_namespaceObject.cn)("rounded-none", defaultClassNames.range_middle),
|
|
63
|
+
range_start: (0, tailwind_variants_namespaceObject.cn)("rounded-l-md bg-accent", defaultClassNames.range_start),
|
|
64
|
+
root: (0, tailwind_variants_namespaceObject.cn)("w-fit", defaultClassNames.root),
|
|
65
|
+
table: "w-full border-collapse",
|
|
66
|
+
today: (0, tailwind_variants_namespaceObject.cn)("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
67
|
+
week: (0, tailwind_variants_namespaceObject.cn)("mt-2 flex w-full", defaultClassNames.week),
|
|
68
|
+
week_number: (0, tailwind_variants_namespaceObject.cn)("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
|
|
69
|
+
week_number_header: (0, tailwind_variants_namespaceObject.cn)("w-(--cell-size) select-none", defaultClassNames.week_number_header),
|
|
70
|
+
weekday: (0, tailwind_variants_namespaceObject.cn)("flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
|
|
71
|
+
weekdays: (0, tailwind_variants_namespaceObject.cn)("flex", defaultClassNames.weekdays),
|
|
72
72
|
...classNames
|
|
73
73
|
},
|
|
74
74
|
components: {
|
|
@@ -79,8 +79,8 @@ function Calendar({ buttonVariant = 'ghost', captionLayout = 'label', className,
|
|
|
79
79
|
...components
|
|
80
80
|
},
|
|
81
81
|
formatters: {
|
|
82
|
-
formatMonthDropdown: (date)=>date.toLocaleString(
|
|
83
|
-
month:
|
|
82
|
+
formatMonthDropdown: (date)=>date.toLocaleString("default", {
|
|
83
|
+
month: "short"
|
|
84
84
|
}),
|
|
85
85
|
...formatters
|
|
86
86
|
},
|
|
@@ -89,16 +89,16 @@ function Calendar({ buttonVariant = 'ghost', captionLayout = 'label', className,
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
function CalendarChevron({ className, orientation, ...props }) {
|
|
92
|
-
if (
|
|
93
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
92
|
+
if ("left" === orientation) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronLeftIcon, {
|
|
93
|
+
className: (0, tailwind_variants_namespaceObject.cn)("size-4", className),
|
|
94
94
|
...props
|
|
95
95
|
});
|
|
96
|
-
if (
|
|
97
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
96
|
+
if ("right" === orientation) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronRightIcon, {
|
|
97
|
+
className: (0, tailwind_variants_namespaceObject.cn)("size-4", className),
|
|
98
98
|
...props
|
|
99
99
|
});
|
|
100
100
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.ChevronDownIcon, {
|
|
101
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
101
|
+
className: (0, tailwind_variants_namespaceObject.cn)("size-4", className),
|
|
102
102
|
...props
|
|
103
103
|
});
|
|
104
104
|
}
|
|
@@ -129,7 +129,7 @@ function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
|
129
129
|
]);
|
|
130
130
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_button_cjs_namespaceObject.Button, {
|
|
131
131
|
ref: ref,
|
|
132
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
132
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-3 group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
|
|
133
133
|
"data-day": day.date.toLocaleDateString(),
|
|
134
134
|
"data-range-end": modifiers.range_end,
|
|
135
135
|
"data-range-middle": modifiers.range_middle,
|
|
@@ -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>;
|
|
@@ -5,41 +5,41 @@ import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react
|
|
|
5
5
|
import { useEffect, useRef } from "react";
|
|
6
6
|
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
7
7
|
import { Button, buttonVariants } from "./button.js";
|
|
8
|
-
function Calendar({ buttonVariant =
|
|
8
|
+
function Calendar({ buttonVariant = "ghost", captionLayout = "label", className, classNames, components, formatters, showOutsideDays = true, ...props }) {
|
|
9
9
|
const defaultClassNames = getDefaultClassNames();
|
|
10
10
|
return /*#__PURE__*/ jsx(DayPicker, {
|
|
11
11
|
captionLayout: captionLayout,
|
|
12
|
-
className: cn(
|
|
12
|
+
className: cn("group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", "rtl:**:[.rdp-button_next>svg]:rotate-180", "rtl:**:[.rdp-button_previous>svg]:rotate-180", className),
|
|
13
13
|
classNames: {
|
|
14
14
|
button_next: cn(buttonVariants({
|
|
15
15
|
variant: buttonVariant
|
|
16
|
-
}),
|
|
16
|
+
}), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
17
17
|
button_previous: cn(buttonVariants({
|
|
18
18
|
variant: buttonVariant
|
|
19
|
-
}),
|
|
20
|
-
caption_label: cn(
|
|
21
|
-
day: cn(
|
|
22
|
-
disabled: cn(
|
|
23
|
-
dropdown: cn(
|
|
24
|
-
dropdown_root: cn(
|
|
25
|
-
dropdowns: cn(
|
|
26
|
-
hidden: cn(
|
|
27
|
-
month: cn(
|
|
28
|
-
month_caption: cn(
|
|
29
|
-
months: cn(
|
|
30
|
-
nav: cn(
|
|
31
|
-
outside: cn(
|
|
32
|
-
range_end: cn(
|
|
33
|
-
range_middle: cn(
|
|
34
|
-
range_start: cn(
|
|
35
|
-
root: cn(
|
|
36
|
-
table:
|
|
37
|
-
today: cn(
|
|
38
|
-
week: cn(
|
|
39
|
-
week_number: cn(
|
|
40
|
-
week_number_header: cn(
|
|
41
|
-
weekday: cn(
|
|
42
|
-
weekdays: cn(
|
|
19
|
+
}), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
|
|
20
|
+
caption_label: cn("font-medium select-none", "label" === captionLayout ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
|
|
21
|
+
day: cn("group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
|
|
22
|
+
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
23
|
+
dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
24
|
+
dropdown_root: cn("relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-3 has-focus:ring-ring/50", defaultClassNames.dropdown_root),
|
|
25
|
+
dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
26
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
27
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
28
|
+
month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
29
|
+
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
30
|
+
nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
|
|
31
|
+
outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
32
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
33
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
34
|
+
range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start),
|
|
35
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
36
|
+
table: "w-full border-collapse",
|
|
37
|
+
today: cn("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
38
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
39
|
+
week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
|
|
40
|
+
week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
|
|
41
|
+
weekday: cn("flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
|
|
42
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
43
43
|
...classNames
|
|
44
44
|
},
|
|
45
45
|
components: {
|
|
@@ -50,8 +50,8 @@ function Calendar({ buttonVariant = 'ghost', captionLayout = 'label', className,
|
|
|
50
50
|
...components
|
|
51
51
|
},
|
|
52
52
|
formatters: {
|
|
53
|
-
formatMonthDropdown: (date)=>date.toLocaleString(
|
|
54
|
-
month:
|
|
53
|
+
formatMonthDropdown: (date)=>date.toLocaleString("default", {
|
|
54
|
+
month: "short"
|
|
55
55
|
}),
|
|
56
56
|
...formatters
|
|
57
57
|
},
|
|
@@ -60,16 +60,16 @@ function Calendar({ buttonVariant = 'ghost', captionLayout = 'label', className,
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
function CalendarChevron({ className, orientation, ...props }) {
|
|
63
|
-
if (
|
|
64
|
-
className: cn(
|
|
63
|
+
if ("left" === orientation) return /*#__PURE__*/ jsx(ChevronLeftIcon, {
|
|
64
|
+
className: cn("size-4", className),
|
|
65
65
|
...props
|
|
66
66
|
});
|
|
67
|
-
if (
|
|
68
|
-
className: cn(
|
|
67
|
+
if ("right" === orientation) return /*#__PURE__*/ jsx(ChevronRightIcon, {
|
|
68
|
+
className: cn("size-4", className),
|
|
69
69
|
...props
|
|
70
70
|
});
|
|
71
71
|
return /*#__PURE__*/ jsx(ChevronDownIcon, {
|
|
72
|
-
className: cn(
|
|
72
|
+
className: cn("size-4", className),
|
|
73
73
|
...props
|
|
74
74
|
});
|
|
75
75
|
}
|
|
@@ -100,7 +100,7 @@ function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
|
100
100
|
]);
|
|
101
101
|
return /*#__PURE__*/ jsx(Button, {
|
|
102
102
|
ref: ref,
|
|
103
|
-
className: cn(
|
|
103
|
+
className: cn("flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-3 group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
|
|
104
104
|
"data-day": day.date.toLocaleDateString(),
|
|
105
105
|
"data-range-end": modifiers.range_end,
|
|
106
106
|
"data-range-middle": modifiers.range_middle,
|
package/dist/components/card.cjs
CHANGED
|
@@ -36,21 +36,21 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
36
36
|
const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
|
|
37
37
|
function Card({ className, ...props }) {
|
|
38
38
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
39
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
39
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex flex-col gap-6 overflow-auto rounded-xl border bg-card py-6 text-card-foreground shadow-sm", className),
|
|
40
40
|
"data-slot": "card",
|
|
41
41
|
...props
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
function CardHeader({ className, ...props }) {
|
|
45
45
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
46
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
46
|
+
className: (0, tailwind_variants_namespaceObject.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-[data-slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
|
|
47
47
|
"data-slot": "card-header",
|
|
48
48
|
...props
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
function CardTitle({ children, className, ...props }) {
|
|
52
52
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
53
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
53
|
+
className: (0, tailwind_variants_namespaceObject.cn)("leading-none font-semibold", className),
|
|
54
54
|
"data-slot": "card-title",
|
|
55
55
|
...props,
|
|
56
56
|
children: children
|
|
@@ -58,28 +58,28 @@ function CardTitle({ children, className, ...props }) {
|
|
|
58
58
|
}
|
|
59
59
|
function CardDescription({ className, ...props }) {
|
|
60
60
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
61
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
61
|
+
className: (0, tailwind_variants_namespaceObject.cn)("text-sm text-muted-foreground", className),
|
|
62
62
|
"data-slot": "card-description",
|
|
63
63
|
...props
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
function CardContent({ 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)("px-6", className),
|
|
69
69
|
"data-slot": "card-content",
|
|
70
70
|
...props
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
function CardFooter({ className, ...props }) {
|
|
74
74
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
75
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
75
|
+
className: (0, tailwind_variants_namespaceObject.cn)("flex items-center px-6 [.border-t]:pt-6", className),
|
|
76
76
|
"data-slot": "card-footer",
|
|
77
77
|
...props
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
function CardAction({ className, ...props }) {
|
|
81
81
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
82
|
-
className: (0, tailwind_variants_namespaceObject.cn)(
|
|
82
|
+
className: (0, tailwind_variants_namespaceObject.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
|
|
83
83
|
"data-slot": "card-action",
|
|
84
84
|
...props
|
|
85
85
|
});
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { ComponentProps, JSX } from
|
|
2
|
-
type CardProps = ComponentProps<
|
|
1
|
+
import type { ComponentProps, JSX } from "react";
|
|
2
|
+
type CardProps = ComponentProps<"div">;
|
|
3
3
|
declare function Card({ className, ...props }: CardProps): JSX.Element;
|
|
4
|
-
type CardHeaderProps = ComponentProps<
|
|
4
|
+
type CardHeaderProps = ComponentProps<"div">;
|
|
5
5
|
declare function CardHeader({ className, ...props }: CardHeaderProps): JSX.Element;
|
|
6
|
-
type CardTitleProps = ComponentProps<
|
|
6
|
+
type CardTitleProps = ComponentProps<"div">;
|
|
7
7
|
declare function CardTitle({ children, className, ...props }: CardTitleProps): JSX.Element;
|
|
8
|
-
type CardDescriptionProps = ComponentProps<
|
|
8
|
+
type CardDescriptionProps = ComponentProps<"div">;
|
|
9
9
|
declare function CardDescription({ className, ...props }: CardDescriptionProps): JSX.Element;
|
|
10
|
-
type CardContentProps = ComponentProps<
|
|
10
|
+
type CardContentProps = ComponentProps<"div">;
|
|
11
11
|
declare function CardContent({ className, ...props }: CardContentProps): JSX.Element;
|
|
12
|
-
type CardFooterProps = ComponentProps<
|
|
12
|
+
type CardFooterProps = ComponentProps<"div">;
|
|
13
13
|
declare function CardFooter({ className, ...props }: CardFooterProps): JSX.Element;
|
|
14
|
-
type CardActionProps = ComponentProps<
|
|
14
|
+
type CardActionProps = ComponentProps<"div">;
|
|
15
15
|
declare function CardAction({ className, ...props }: CardActionProps): JSX.Element;
|
|
16
16
|
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
17
17
|
export type { CardActionProps, CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardTitleProps, };
|