@codefast/ui 0.3.16-canary.2 → 0.3.16-canary.3
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 +21 -0
- package/README.md +1 -1
- package/dist/components/accordion.mjs +2 -2
- package/dist/components/alert-dialog.d.mts +1 -1
- package/dist/components/alert-dialog.mjs +4 -4
- package/dist/components/alert.d.mts +3 -13
- package/dist/components/alert.mjs +3 -23
- package/dist/components/badge.d.mts +3 -15
- package/dist/components/badge.mjs +2 -44
- package/dist/components/breadcrumb.mjs +1 -1
- package/dist/components/button-group.d.mts +3 -13
- package/dist/components/button-group.mjs +3 -24
- package/dist/components/button.d.mts +3 -25
- package/dist/components/button.mjs +2 -72
- package/dist/components/calendar.mjs +2 -1
- package/dist/components/carousel.d.mts +1 -2
- package/dist/components/chart.d.mts +2 -4
- package/dist/components/checkbox.mjs +2 -2
- package/dist/components/context-menu.mjs +2 -2
- package/dist/components/dialog.d.mts +1 -1
- package/dist/components/dialog.mjs +4 -4
- package/dist/components/drawer.d.mts +1 -1
- package/dist/components/drawer.mjs +2 -2
- package/dist/components/dropdown-menu.mjs +2 -2
- package/dist/components/empty.d.mts +3 -13
- package/dist/components/empty.mjs +3 -18
- package/dist/components/field.d.mts +3 -14
- package/dist/components/field.mjs +3 -32
- package/dist/components/form.d.mts +2 -4
- package/dist/components/hover-card.mjs +1 -1
- package/dist/components/input-group.d.mts +4 -31
- package/dist/components/input-group.mjs +3 -90
- package/dist/components/input-number.mjs +4 -4
- package/dist/components/input-otp.mjs +2 -2
- package/dist/components/input.mjs +1 -1
- package/dist/components/item.d.mts +4 -29
- package/dist/components/item.mjs +3 -56
- package/dist/components/menubar.mjs +2 -2
- package/dist/components/native-select.mjs +1 -1
- package/dist/components/navigation-menu.d.mts +1 -6
- package/dist/components/navigation-menu.mjs +8 -15
- package/dist/components/pagination.d.mts +1 -1
- package/dist/components/pagination.mjs +1 -1
- package/dist/components/popover.mjs +1 -1
- package/dist/components/progress-circle.d.mts +3 -47
- package/dist/components/progress-circle.mjs +2 -47
- package/dist/components/progress.mjs +1 -1
- package/dist/components/radio-group.mjs +1 -1
- package/dist/components/radio.mjs +1 -1
- package/dist/components/scroll-area.d.mts +3 -19
- package/dist/components/scroll-area.mjs +4 -61
- package/dist/components/select.d.mts +1 -1
- package/dist/components/select.mjs +3 -3
- package/dist/components/separator.d.mts +3 -18
- package/dist/components/separator.mjs +3 -23
- package/dist/components/sheet.d.mts +6 -18
- package/dist/components/sheet.mjs +6 -49
- package/dist/components/sidebar.d.mts +4 -19
- package/dist/components/sidebar.mjs +10 -46
- package/dist/components/skeleton.mjs +1 -1
- package/dist/components/slider.mjs +1 -1
- package/dist/components/spinner.mjs +1 -1
- package/dist/components/switch.mjs +2 -2
- package/dist/components/table.mjs +1 -1
- package/dist/components/tabs.mjs +1 -1
- package/dist/components/textarea.mjs +1 -1
- package/dist/components/toggle-group.d.mts +3 -2
- package/dist/components/toggle-group.mjs +1 -1
- package/dist/components/toggle.d.mts +2 -21
- package/dist/components/toggle.mjs +2 -39
- package/dist/components/tooltip.mjs +1 -1
- package/dist/index.d.mts +31 -16
- package/dist/index.mjs +30 -15
- package/dist/lib/utils.d.mts +1 -12
- package/dist/lib/utils.mjs +1 -9
- package/dist/primitives/checkbox-group.d.mts +1 -2
- package/dist/primitives/input-number.d.mts +1 -2
- package/dist/primitives/input.d.mts +1 -2
- package/dist/primitives/progress-circle.d.mts +1 -2
- package/dist/variants/alert.d.mts +18 -0
- package/dist/variants/alert.mjs +25 -0
- package/dist/variants/badge.d.mts +20 -0
- package/dist/variants/badge.mjs +46 -0
- package/dist/variants/button-group.d.mts +18 -0
- package/dist/variants/button-group.mjs +26 -0
- package/dist/variants/button.d.mts +30 -0
- package/dist/variants/button.mjs +76 -0
- package/dist/variants/empty.d.mts +18 -0
- package/dist/variants/empty.mjs +20 -0
- package/dist/variants/field.d.mts +19 -0
- package/dist/variants/field.mjs +34 -0
- package/dist/variants/input-group.d.mts +43 -0
- package/dist/variants/input-group.mjs +93 -0
- package/dist/variants/item.d.mts +37 -0
- package/dist/variants/item.mjs +60 -0
- package/dist/variants/navigation-menu.d.mts +13 -0
- package/dist/variants/navigation-menu.mjs +12 -0
- package/dist/variants/progress-circle.d.mts +52 -0
- package/dist/variants/progress-circle.mjs +49 -0
- package/dist/variants/scroll-area.d.mts +24 -0
- package/dist/variants/scroll-area.mjs +63 -0
- package/dist/variants/separator.d.mts +23 -0
- package/dist/variants/separator.mjs +25 -0
- package/dist/variants/sheet.d.mts +20 -0
- package/dist/variants/sheet.mjs +50 -0
- package/dist/variants/sidebar.d.mts +23 -0
- package/dist/variants/sidebar.mjs +42 -0
- package/dist/variants/toggle.d.mts +23 -0
- package/dist/variants/toggle.mjs +43 -0
- package/package.json +168 -20
- package/src/components/accordion.tsx +156 -0
- package/src/components/alert-dialog.tsx +314 -0
- package/src/components/alert.tsx +86 -0
- package/src/components/aspect-ratio.tsx +28 -0
- package/src/components/avatar.tsx +84 -0
- package/src/components/badge.tsx +38 -0
- package/src/components/breadcrumb.tsx +197 -0
- package/src/components/button-group.tsx +107 -0
- package/src/components/button.tsx +66 -0
- package/src/components/calendar.tsx +277 -0
- package/src/components/card.tsx +175 -0
- package/src/components/carousel.tsx +367 -0
- package/src/components/chart.tsx +587 -0
- package/src/components/checkbox-cards.tsx +92 -0
- package/src/components/checkbox-group.tsx +83 -0
- package/src/components/checkbox.tsx +65 -0
- package/src/components/collapsible.tsx +60 -0
- package/src/components/command.tsx +311 -0
- package/src/components/context-menu.tsx +489 -0
- package/src/components/dialog.tsx +295 -0
- package/src/components/drawer.tsx +271 -0
- package/src/components/dropdown-menu.tsx +498 -0
- package/src/components/empty.tsx +169 -0
- package/src/components/field.tsx +362 -0
- package/src/components/form.tsx +300 -0
- package/src/components/hover-card.tsx +116 -0
- package/src/components/input-group.tsx +224 -0
- package/src/components/input-number.tsx +161 -0
- package/src/components/input-otp.tsx +151 -0
- package/src/components/input-password.tsx +74 -0
- package/src/components/input-search.tsx +98 -0
- package/src/components/input.tsx +52 -0
- package/src/components/item.tsx +280 -0
- package/src/components/kbd.tsx +59 -0
- package/src/components/label.tsx +44 -0
- package/src/components/menubar.tsx +531 -0
- package/src/components/native-select.tsx +96 -0
- package/src/components/navigation-menu.tsx +295 -0
- package/src/components/pagination.tsx +204 -0
- package/src/components/popover.tsx +139 -0
- package/src/components/progress-circle.tsx +203 -0
- package/src/components/progress.tsx +54 -0
- package/src/components/radio-cards.tsx +85 -0
- package/src/components/radio-group.tsx +79 -0
- package/src/components/radio.tsx +61 -0
- package/src/components/resizable.tsx +99 -0
- package/src/components/scroll-area.tsx +115 -0
- package/src/components/select.tsx +319 -0
- package/src/components/separator.tsx +74 -0
- package/src/components/sheet.tsx +278 -0
- package/src/components/sidebar.tsx +1056 -0
- package/src/components/skeleton.tsx +37 -0
- package/src/components/slider.tsx +95 -0
- package/src/components/sonner.tsx +47 -0
- package/src/components/spinner.tsx +75 -0
- package/src/components/switch.tsx +66 -0
- package/src/components/table.tsx +200 -0
- package/src/components/tabs.tsx +128 -0
- package/src/components/textarea.tsx +49 -0
- package/src/components/toggle-group.tsx +141 -0
- package/src/components/toggle.tsx +39 -0
- package/src/components/tooltip.tsx +141 -0
- package/src/css/amber.css +59 -22
- package/src/css/blue.css +59 -22
- package/src/css/cyan.css +59 -22
- package/src/css/emerald.css +59 -22
- package/src/css/fuchsia.css +59 -22
- package/src/css/gray.css +59 -22
- package/src/css/green.css +59 -22
- package/src/css/indigo.css +59 -22
- package/src/css/lime.css +59 -22
- package/src/css/neutral.css +59 -22
- package/src/css/orange.css +59 -22
- package/src/css/pink.css +59 -22
- package/src/css/preset.css +32 -13
- package/src/css/purple.css +59 -22
- package/src/css/red.css +59 -22
- package/src/css/rose.css +59 -22
- package/src/css/sky.css +59 -22
- package/src/css/slate.css +59 -22
- package/src/css/stone.css +59 -22
- package/src/css/teal.css +59 -22
- package/src/css/violet.css +59 -22
- package/src/css/yellow.css +59 -22
- package/src/css/zinc.css +59 -22
- package/src/hooks/use-animated-value.ts +97 -0
- package/src/hooks/use-copy-to-clipboard.ts +63 -0
- package/src/hooks/use-is-mobile.ts +27 -0
- package/src/hooks/use-media-query.ts +71 -0
- package/src/hooks/use-mutation-observer.ts +54 -0
- package/src/hooks/use-pagination.ts +166 -0
- package/src/index.ts +720 -0
- package/src/lib/utils.ts +5 -0
- package/src/primitives/checkbox-group.tsx +360 -0
- package/src/primitives/input-number.tsx +1013 -0
- package/src/primitives/input.tsx +243 -0
- package/src/primitives/progress-circle.tsx +537 -0
- package/src/variants/alert.ts +45 -0
- package/src/variants/badge.ts +66 -0
- package/src/variants/button-group.ts +49 -0
- package/src/variants/button.ts +93 -0
- package/src/variants/empty.ts +43 -0
- package/src/variants/field.ts +50 -0
- package/src/variants/input-group.ts +132 -0
- package/src/variants/item.ts +90 -0
- package/src/variants/navigation-menu.ts +32 -0
- package/src/variants/progress-circle.ts +47 -0
- package/src/variants/scroll-area.ts +79 -0
- package/src/variants/separator.ts +41 -0
- package/src/variants/sheet.ts +70 -0
- package/src/variants/sidebar.ts +61 -0
- package/src/variants/toggle.ts +59 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/clsx.d.mts +0 -6
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/button.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const buttonVariants = tv({
|
|
7
|
+
base: [
|
|
8
|
+
"inline-flex shrink-0 items-center justify-center gap-2",
|
|
9
|
+
"rounded-lg outline-hidden",
|
|
10
|
+
"text-sm font-medium whitespace-nowrap",
|
|
11
|
+
"transition duration-150 ease-snappy select-none",
|
|
12
|
+
"motion-reduce:transition-none motion-reduce:duration-0",
|
|
13
|
+
"active:not-disabled:translate-y-px",
|
|
14
|
+
"focus-visible:ring-3",
|
|
15
|
+
"disabled:opacity-50",
|
|
16
|
+
"[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
17
|
+
],
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: "md",
|
|
20
|
+
variant: "default"
|
|
21
|
+
},
|
|
22
|
+
variants: {
|
|
23
|
+
size: {
|
|
24
|
+
"icon-sm": "size-8",
|
|
25
|
+
icon: "size-9",
|
|
26
|
+
"icon-lg": "size-10",
|
|
27
|
+
sm: ["h-8 px-3", "has-[>svg]:px-2.5"],
|
|
28
|
+
md: ["h-9 px-4", "has-[>svg]:px-3"],
|
|
29
|
+
lg: ["h-10 px-6", "has-[>svg]:px-4"]
|
|
30
|
+
},
|
|
31
|
+
variant: {
|
|
32
|
+
default: [
|
|
33
|
+
"bg-primary text-primary-foreground",
|
|
34
|
+
"hover:not-disabled:bg-primary/80",
|
|
35
|
+
"focus-visible:ring-primary/20",
|
|
36
|
+
"dark:focus-visible:ring-primary/40"
|
|
37
|
+
],
|
|
38
|
+
destructive: [
|
|
39
|
+
"bg-destructive text-white",
|
|
40
|
+
"hover:not-disabled:bg-destructive/90",
|
|
41
|
+
"focus-visible:ring-destructive/20",
|
|
42
|
+
"dark:bg-destructive/60",
|
|
43
|
+
"dark:focus-visible:ring-destructive/40"
|
|
44
|
+
],
|
|
45
|
+
ghost: [
|
|
46
|
+
"hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground",
|
|
47
|
+
"focus-visible:ring-ring/50",
|
|
48
|
+
"dark:hover:not-disabled:bg-secondary/50"
|
|
49
|
+
],
|
|
50
|
+
link: [
|
|
51
|
+
"text-primary underline-offset-4",
|
|
52
|
+
"hover:not-disabled:underline",
|
|
53
|
+
"focus-visible:ring-ring/50"
|
|
54
|
+
],
|
|
55
|
+
outline: [
|
|
56
|
+
"border border-input shadow-xs",
|
|
57
|
+
"hover:not-disabled:border-ring/60 hover:not-disabled:bg-secondary hover:not-disabled:text-secondary-foreground",
|
|
58
|
+
"focus-visible:border-ring focus-visible:ring-ring/50",
|
|
59
|
+
"aria-invalid:border-destructive",
|
|
60
|
+
"focus-within:aria-invalid:ring-destructive/20",
|
|
61
|
+
"hover:not-disabled:aria-invalid:border-destructive/60",
|
|
62
|
+
"dark:bg-input/30",
|
|
63
|
+
"dark:hover:not-disabled:bg-input/50",
|
|
64
|
+
"dark:aria-invalid:border-destructive/70",
|
|
65
|
+
"dark:focus-within:aria-invalid:ring-destructive/40"
|
|
66
|
+
],
|
|
67
|
+
secondary: [
|
|
68
|
+
"bg-secondary text-secondary-foreground",
|
|
69
|
+
"hover:not-disabled:bg-secondary/80",
|
|
70
|
+
"focus-visible:ring-ring/50"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
//#endregion
|
|
76
|
+
export { buttonVariants };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/empty.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const emptyMediaVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
|
+
variant: {
|
|
9
|
+
default: string;
|
|
10
|
+
icon: string[];
|
|
11
|
+
};
|
|
12
|
+
}, Record<string, never>>;
|
|
13
|
+
/**
|
|
14
|
+
* @since 0.3.16-canary.0
|
|
15
|
+
*/
|
|
16
|
+
type EmptyMediaVariants = VariantProps<typeof emptyMediaVariants>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { type EmptyMediaVariants, emptyMediaVariants };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/empty.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const emptyMediaVariants = tv({
|
|
7
|
+
base: ["mb-2 flex shrink-0 items-center justify-center", "[&_svg]:pointer-events-none [&_svg]:shrink-0"],
|
|
8
|
+
defaultVariants: { variant: "default" },
|
|
9
|
+
variants: { variant: {
|
|
10
|
+
default: "bg-transparent",
|
|
11
|
+
icon: [
|
|
12
|
+
"flex size-10 shrink-0 items-center justify-center",
|
|
13
|
+
"rounded-xl",
|
|
14
|
+
"bg-muted text-foreground",
|
|
15
|
+
"[&_svg:not([class*='size-'])]:size-6"
|
|
16
|
+
]
|
|
17
|
+
} }
|
|
18
|
+
});
|
|
19
|
+
//#endregion
|
|
20
|
+
export { emptyMediaVariants };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/field.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const fieldVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
|
+
orientation: {
|
|
9
|
+
horizontal: string[];
|
|
10
|
+
responsive: string[];
|
|
11
|
+
vertical: string[];
|
|
12
|
+
};
|
|
13
|
+
}, Record<string, never>>;
|
|
14
|
+
/**
|
|
15
|
+
* @since 0.3.16-canary.0
|
|
16
|
+
*/
|
|
17
|
+
type FieldVariants = VariantProps<typeof fieldVariants>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { type FieldVariants, fieldVariants };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/field.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const fieldVariants = tv({
|
|
7
|
+
base: ["group/field flex w-full gap-3", "data-[invalid=true]:text-destructive"],
|
|
8
|
+
defaultVariants: { orientation: "vertical" },
|
|
9
|
+
variants: { orientation: {
|
|
10
|
+
horizontal: [
|
|
11
|
+
"flex-row items-center",
|
|
12
|
+
"has-[>[data-slot=field-content]]:items-start",
|
|
13
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
14
|
+
"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
15
|
+
],
|
|
16
|
+
responsive: [
|
|
17
|
+
"flex-col",
|
|
18
|
+
"@md/field-group:flex-row @md/field-group:items-center",
|
|
19
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start",
|
|
20
|
+
"[&>*]:w-full",
|
|
21
|
+
"@md/field-group:[&>*]:w-auto",
|
|
22
|
+
"[&>.sr-only]:w-auto",
|
|
23
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
24
|
+
"@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
25
|
+
],
|
|
26
|
+
vertical: [
|
|
27
|
+
"flex-col",
|
|
28
|
+
"[&>*]:w-full",
|
|
29
|
+
"[&>.sr-only]:w-auto"
|
|
30
|
+
]
|
|
31
|
+
} }
|
|
32
|
+
});
|
|
33
|
+
//#endregion
|
|
34
|
+
export { fieldVariants };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/input-group.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const inputGroupVariants: import("@codefast/tailwind-variants").VariantResolver<import("@codefast/tailwind-variants").VariantSchema, Record<string, never>>;
|
|
8
|
+
/**
|
|
9
|
+
* @since 0.3.16-canary.0
|
|
10
|
+
*/
|
|
11
|
+
declare const inputGroupAddonVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
12
|
+
align: {
|
|
13
|
+
"block-end": string[];
|
|
14
|
+
"block-start": string[];
|
|
15
|
+
"inline-end": string[];
|
|
16
|
+
"inline-start": string[];
|
|
17
|
+
};
|
|
18
|
+
}, Record<string, never>>;
|
|
19
|
+
/**
|
|
20
|
+
* @since 0.3.16-canary.0
|
|
21
|
+
*/
|
|
22
|
+
declare const inputGroupButtonVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
23
|
+
size: {
|
|
24
|
+
"icon-xs": string[];
|
|
25
|
+
"icon-sm": string[];
|
|
26
|
+
xs: string[];
|
|
27
|
+
sm: string[];
|
|
28
|
+
};
|
|
29
|
+
}, Record<string, never>>;
|
|
30
|
+
/**
|
|
31
|
+
* @since 0.3.16-canary.0
|
|
32
|
+
*/
|
|
33
|
+
type InputGroupVariants = VariantProps<typeof inputGroupVariants>;
|
|
34
|
+
/**
|
|
35
|
+
* @since 0.3.16-canary.0
|
|
36
|
+
*/
|
|
37
|
+
type InputGroupAddonVariants = VariantProps<typeof inputGroupAddonVariants>;
|
|
38
|
+
/**
|
|
39
|
+
* @since 0.3.16-canary.0
|
|
40
|
+
*/
|
|
41
|
+
type InputGroupButtonVariants = VariantProps<typeof inputGroupButtonVariants>;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { type InputGroupAddonVariants, type InputGroupButtonVariants, type InputGroupVariants, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupVariants };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/input-group.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const inputGroupVariants = tv({ base: [
|
|
7
|
+
"group/input-group relative flex h-9 w-full min-w-0 items-center",
|
|
8
|
+
"rounded-lg border border-input shadow-xs outline-none",
|
|
9
|
+
"transition-[color,box-shadow]",
|
|
10
|
+
"motion-reduce:transition-none",
|
|
11
|
+
"dark:bg-input/30",
|
|
12
|
+
"has-[>textarea]:h-auto",
|
|
13
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col",
|
|
14
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col",
|
|
15
|
+
"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50",
|
|
16
|
+
"has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20",
|
|
17
|
+
"dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
|
|
18
|
+
"has-[>[data-align=block-end]]:[&>[data-slot=input-group-control]]:pt-3",
|
|
19
|
+
"has-[>[data-align=block-start]]:[&>[data-slot=input-group-control]]:pb-3",
|
|
20
|
+
"has-[>[data-align=inline-end]]:[&>[data-slot=input-group-control]]:pr-2",
|
|
21
|
+
"has-[>[data-align=inline-start]]:[&>[data-slot=input-group-control]]:pl-2"
|
|
22
|
+
] });
|
|
23
|
+
/**
|
|
24
|
+
* @since 0.3.16-canary.0
|
|
25
|
+
*/
|
|
26
|
+
const inputGroupAddonVariants = tv({
|
|
27
|
+
base: [
|
|
28
|
+
"flex h-auto items-center justify-center gap-2 py-1.5",
|
|
29
|
+
"text-sm font-medium text-muted-foreground",
|
|
30
|
+
"cursor-text select-none",
|
|
31
|
+
"group-data-disabled/input-group:opacity-50",
|
|
32
|
+
"[&>kbd]:rounded-[calc(var(--radius)-5px)]",
|
|
33
|
+
"[&>svg:not([class*='size-'])]:size-4"
|
|
34
|
+
],
|
|
35
|
+
defaultVariants: { align: "inline-start" },
|
|
36
|
+
variants: { align: {
|
|
37
|
+
"block-end": [
|
|
38
|
+
"order-last w-full justify-start px-3 pb-3",
|
|
39
|
+
"group-has-[>input]/input-group:pb-2.5",
|
|
40
|
+
"[.border-t]:pt-3"
|
|
41
|
+
],
|
|
42
|
+
"block-start": [
|
|
43
|
+
"order-first w-full justify-start px-3 pt-3",
|
|
44
|
+
"group-has-[>input]/input-group:pt-2.5",
|
|
45
|
+
"[.border-b]:pb-3"
|
|
46
|
+
],
|
|
47
|
+
"inline-end": [
|
|
48
|
+
"order-last",
|
|
49
|
+
"pr-3",
|
|
50
|
+
"has-[>button]:mr-[-0.45rem]",
|
|
51
|
+
"has-[>kbd]:mr-[-0.35rem]"
|
|
52
|
+
],
|
|
53
|
+
"inline-start": [
|
|
54
|
+
"order-first",
|
|
55
|
+
"pl-3",
|
|
56
|
+
"has-[>button]:ml-[-0.45rem]",
|
|
57
|
+
"has-[>kbd]:ml-[-0.35rem]"
|
|
58
|
+
]
|
|
59
|
+
} }
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* @since 0.3.16-canary.0
|
|
63
|
+
*/
|
|
64
|
+
const inputGroupButtonVariants = tv({
|
|
65
|
+
base: [
|
|
66
|
+
"flex items-center gap-2",
|
|
67
|
+
"shadow-none",
|
|
68
|
+
"text-sm",
|
|
69
|
+
"[&>svg:not([class*='size-'])]:size-4"
|
|
70
|
+
],
|
|
71
|
+
defaultVariants: { size: "xs" },
|
|
72
|
+
variants: { size: {
|
|
73
|
+
"icon-xs": [
|
|
74
|
+
"size-6 p-0",
|
|
75
|
+
"rounded-[calc(var(--radius)-5px)]",
|
|
76
|
+
"has-[>svg]:p-0"
|
|
77
|
+
],
|
|
78
|
+
"icon-sm": ["size-8 p-0", "has-[>svg]:p-0"],
|
|
79
|
+
xs: [
|
|
80
|
+
"h-6 gap-1 px-2",
|
|
81
|
+
"rounded-[calc(var(--radius)-5px)]",
|
|
82
|
+
"has-[>svg]:px-2",
|
|
83
|
+
"[&>svg]:size-3.5"
|
|
84
|
+
],
|
|
85
|
+
sm: [
|
|
86
|
+
"h-8 gap-1.5 px-2.5",
|
|
87
|
+
"rounded-md",
|
|
88
|
+
"has-[>svg]:px-2.5"
|
|
89
|
+
]
|
|
90
|
+
} }
|
|
91
|
+
});
|
|
92
|
+
//#endregion
|
|
93
|
+
export { inputGroupAddonVariants, inputGroupButtonVariants, inputGroupVariants };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/item.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const itemVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
|
+
size: {
|
|
9
|
+
default: string[];
|
|
10
|
+
sm: string[];
|
|
11
|
+
};
|
|
12
|
+
variant: {
|
|
13
|
+
default: string;
|
|
14
|
+
muted: string;
|
|
15
|
+
outline: string;
|
|
16
|
+
};
|
|
17
|
+
}, Record<string, never>>;
|
|
18
|
+
/**
|
|
19
|
+
* @since 0.3.16-canary.0
|
|
20
|
+
*/
|
|
21
|
+
declare const itemMediaVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
22
|
+
variant: {
|
|
23
|
+
default: string;
|
|
24
|
+
icon: string[];
|
|
25
|
+
image: string[];
|
|
26
|
+
};
|
|
27
|
+
}, Record<string, never>>;
|
|
28
|
+
/**
|
|
29
|
+
* @since 0.3.16-canary.0
|
|
30
|
+
*/
|
|
31
|
+
type ItemVariants = VariantProps<typeof itemVariants>;
|
|
32
|
+
/**
|
|
33
|
+
* @since 0.3.16-canary.0
|
|
34
|
+
*/
|
|
35
|
+
type ItemMediaVariants = VariantProps<typeof itemMediaVariants>;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { type ItemMediaVariants, type ItemVariants, itemMediaVariants, itemVariants };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/item.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const itemVariants = tv({
|
|
7
|
+
base: [
|
|
8
|
+
"group/item flex flex-wrap items-center",
|
|
9
|
+
"rounded-lg border border-transparent outline-hidden",
|
|
10
|
+
"text-sm",
|
|
11
|
+
"transition-colors duration-100",
|
|
12
|
+
"motion-reduce:transition-none motion-reduce:duration-0",
|
|
13
|
+
"focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
14
|
+
"[a]:transition-colors",
|
|
15
|
+
"[a]:motion-reduce:transition-none",
|
|
16
|
+
"[a]:hover:bg-accent/50"
|
|
17
|
+
],
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
size: "default",
|
|
20
|
+
variant: "default"
|
|
21
|
+
},
|
|
22
|
+
variants: {
|
|
23
|
+
size: {
|
|
24
|
+
default: ["gap-4", "p-4"],
|
|
25
|
+
sm: ["gap-2.5", "px-4 py-3"]
|
|
26
|
+
},
|
|
27
|
+
variant: {
|
|
28
|
+
default: "bg-transparent",
|
|
29
|
+
muted: "bg-muted/50",
|
|
30
|
+
outline: "border-border"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* @since 0.3.16-canary.0
|
|
36
|
+
*/
|
|
37
|
+
const itemMediaVariants = tv({
|
|
38
|
+
base: [
|
|
39
|
+
"flex shrink-0 items-center justify-center gap-2",
|
|
40
|
+
"group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start",
|
|
41
|
+
"[&_svg]:pointer-events-none"
|
|
42
|
+
],
|
|
43
|
+
defaultVariants: { variant: "default" },
|
|
44
|
+
variants: { variant: {
|
|
45
|
+
default: "bg-transparent",
|
|
46
|
+
icon: [
|
|
47
|
+
"size-8 shrink-0",
|
|
48
|
+
"rounded-md border",
|
|
49
|
+
"bg-muted",
|
|
50
|
+
"[&_svg:not([class*='size-'])]:size-4"
|
|
51
|
+
],
|
|
52
|
+
image: [
|
|
53
|
+
"size-10 shrink-0 overflow-hidden",
|
|
54
|
+
"rounded-md",
|
|
55
|
+
"[&_img]:size-full [&_img]:object-cover"
|
|
56
|
+
]
|
|
57
|
+
} }
|
|
58
|
+
});
|
|
59
|
+
//#endregion
|
|
60
|
+
export { itemMediaVariants, itemVariants };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/navigation-menu.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const navigationMenuTriggerVariants: import("@codefast/tailwind-variants").VariantResolver<import("@codefast/tailwind-variants").VariantSchema, Record<string, never>>;
|
|
8
|
+
/**
|
|
9
|
+
* @since 0.3.16-canary.0
|
|
10
|
+
*/
|
|
11
|
+
type NavigationMenuTriggerVariants = VariantProps<typeof navigationMenuTriggerVariants>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { type NavigationMenuTriggerVariants, navigationMenuTriggerVariants };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
import { buttonVariants } from "./button.mjs";
|
|
3
|
+
//#region src/variants/navigation-menu.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
const navigationMenuTriggerVariants = tv({ base: buttonVariants({
|
|
8
|
+
className: "data-open:bg-secondary/50 data-open:text-secondary-foreground group/navigation-menu-trigger focus-visible:bg-secondary dark:hover:not-disabled:bg-secondary",
|
|
9
|
+
variant: "ghost"
|
|
10
|
+
}) });
|
|
11
|
+
//#endregion
|
|
12
|
+
export { navigationMenuTriggerVariants };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/progress-circle.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const progressCircleVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
|
+
size: {
|
|
9
|
+
sm: {
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
md: {
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
lg: {
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
xl: {
|
|
19
|
+
label: string;
|
|
20
|
+
};
|
|
21
|
+
"2xl": {
|
|
22
|
+
label: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
thickness: {
|
|
26
|
+
regular: {};
|
|
27
|
+
thick: {};
|
|
28
|
+
thin: {};
|
|
29
|
+
};
|
|
30
|
+
variant: {
|
|
31
|
+
default: {
|
|
32
|
+
indicator: string;
|
|
33
|
+
track: string;
|
|
34
|
+
};
|
|
35
|
+
destructive: {
|
|
36
|
+
indicator: string;
|
|
37
|
+
track: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
}, {
|
|
41
|
+
indicator: string;
|
|
42
|
+
label: string[];
|
|
43
|
+
root: string;
|
|
44
|
+
svg: string;
|
|
45
|
+
track: string;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* @since 0.3.16-canary.0
|
|
49
|
+
*/
|
|
50
|
+
type ProgressCircleVariants = VariantProps<typeof progressCircleVariants>;
|
|
51
|
+
//#endregion
|
|
52
|
+
export { type ProgressCircleVariants, progressCircleVariants };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/progress-circle.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const progressCircleVariants = tv({
|
|
7
|
+
defaultVariants: {
|
|
8
|
+
size: "md",
|
|
9
|
+
thickness: "regular",
|
|
10
|
+
variant: "default"
|
|
11
|
+
},
|
|
12
|
+
slots: {
|
|
13
|
+
indicator: "origin-center",
|
|
14
|
+
label: [
|
|
15
|
+
"absolute flex items-center justify-center",
|
|
16
|
+
"inset-0",
|
|
17
|
+
"text-xs font-medium"
|
|
18
|
+
],
|
|
19
|
+
root: "relative inline-flex items-center justify-center",
|
|
20
|
+
svg: "size-full",
|
|
21
|
+
track: "origin-center"
|
|
22
|
+
},
|
|
23
|
+
variants: {
|
|
24
|
+
size: {
|
|
25
|
+
sm: { label: "text-[0.625rem]" },
|
|
26
|
+
md: { label: "text-xs" },
|
|
27
|
+
lg: { label: "text-sm" },
|
|
28
|
+
xl: { label: "text-base" },
|
|
29
|
+
"2xl": { label: "text-lg" }
|
|
30
|
+
},
|
|
31
|
+
thickness: {
|
|
32
|
+
regular: {},
|
|
33
|
+
thick: {},
|
|
34
|
+
thin: {}
|
|
35
|
+
},
|
|
36
|
+
variant: {
|
|
37
|
+
default: {
|
|
38
|
+
indicator: "text-primary",
|
|
39
|
+
track: "text-primary/20"
|
|
40
|
+
},
|
|
41
|
+
destructive: {
|
|
42
|
+
indicator: "text-destructive",
|
|
43
|
+
track: "text-destructive/20"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { progressCircleVariants };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/scroll-area.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const scrollAreaScrollbarVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
|
+
orientation: {
|
|
9
|
+
horizontal: string[];
|
|
10
|
+
vertical: string[];
|
|
11
|
+
};
|
|
12
|
+
size: {
|
|
13
|
+
none: string;
|
|
14
|
+
sm: string;
|
|
15
|
+
md: string;
|
|
16
|
+
lg: string;
|
|
17
|
+
};
|
|
18
|
+
}, Record<string, never>>;
|
|
19
|
+
/**
|
|
20
|
+
* @since 0.3.16-canary.0
|
|
21
|
+
*/
|
|
22
|
+
type ScrollAreaScrollbarVariants = VariantProps<typeof scrollAreaScrollbarVariants>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { type ScrollAreaScrollbarVariants, scrollAreaScrollbarVariants };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/scroll-area.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const scrollAreaScrollbarVariants = tv({
|
|
7
|
+
base: [
|
|
8
|
+
"flex",
|
|
9
|
+
"p-px",
|
|
10
|
+
"touch-none transition-colors select-none",
|
|
11
|
+
"motion-reduce:transition-none motion-reduce:duration-0"
|
|
12
|
+
],
|
|
13
|
+
compoundVariants: [
|
|
14
|
+
{
|
|
15
|
+
className: "w-1.5",
|
|
16
|
+
orientation: "vertical",
|
|
17
|
+
size: "sm"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
className: "w-2",
|
|
21
|
+
orientation: "vertical",
|
|
22
|
+
size: "md"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
className: "w-2.5",
|
|
26
|
+
orientation: "vertical",
|
|
27
|
+
size: "lg"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
className: "h-1.5",
|
|
31
|
+
orientation: "horizontal",
|
|
32
|
+
size: "sm"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
className: "h-2",
|
|
36
|
+
orientation: "horizontal",
|
|
37
|
+
size: "md"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
className: "h-2.5",
|
|
41
|
+
orientation: "horizontal",
|
|
42
|
+
size: "lg"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
orientation: "vertical",
|
|
47
|
+
size: "md"
|
|
48
|
+
},
|
|
49
|
+
variants: {
|
|
50
|
+
orientation: {
|
|
51
|
+
horizontal: ["w-full flex-col", "border-t border-t-transparent"],
|
|
52
|
+
vertical: ["h-full flex-row", "border-l border-l-transparent"]
|
|
53
|
+
},
|
|
54
|
+
size: {
|
|
55
|
+
none: "",
|
|
56
|
+
sm: "",
|
|
57
|
+
md: "",
|
|
58
|
+
lg: ""
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
//#endregion
|
|
63
|
+
export { scrollAreaScrollbarVariants };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/separator.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const separatorVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
|
+
align: {
|
|
9
|
+
center: string;
|
|
10
|
+
end: string;
|
|
11
|
+
start: string;
|
|
12
|
+
};
|
|
13
|
+
orientation: {
|
|
14
|
+
horizontal: string;
|
|
15
|
+
vertical: string;
|
|
16
|
+
};
|
|
17
|
+
}, Record<string, never>>;
|
|
18
|
+
/**
|
|
19
|
+
* @since 0.3.16-canary.0
|
|
20
|
+
*/
|
|
21
|
+
type SeparatorVariants = VariantProps<typeof separatorVariants>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { type SeparatorVariants, separatorVariants };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/separator.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const separatorVariants = tv({
|
|
7
|
+
base: ["relative flex shrink-0 items-center", "bg-border"],
|
|
8
|
+
defaultVariants: {
|
|
9
|
+
align: "center",
|
|
10
|
+
orientation: "horizontal"
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
align: {
|
|
14
|
+
center: "justify-center",
|
|
15
|
+
end: "justify-end",
|
|
16
|
+
start: "justify-start"
|
|
17
|
+
},
|
|
18
|
+
orientation: {
|
|
19
|
+
horizontal: "h-px w-full",
|
|
20
|
+
vertical: "h-full w-px flex-col"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { separatorVariants };
|