@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,20 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/sheet.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const sheetContentVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
|
+
side: {
|
|
9
|
+
bottom: string[];
|
|
10
|
+
left: string[];
|
|
11
|
+
right: string[];
|
|
12
|
+
top: string[];
|
|
13
|
+
};
|
|
14
|
+
}, Record<string, never>>;
|
|
15
|
+
/**
|
|
16
|
+
* @since 0.3.16-canary.0
|
|
17
|
+
*/
|
|
18
|
+
type SheetContentVariants = VariantProps<typeof sheetContentVariants>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { type SheetContentVariants, sheetContentVariants };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/sheet.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const sheetContentVariants = tv({
|
|
7
|
+
base: [
|
|
8
|
+
"fixed z-50 flex flex-col overflow-auto",
|
|
9
|
+
"bg-background shadow-lg",
|
|
10
|
+
"ease-ui data-open:animate-in data-open:animation-duration-500",
|
|
11
|
+
"data-closed:animate-out data-closed:animation-duration-500",
|
|
12
|
+
"motion-reduce:animate-none motion-reduce:transition-none motion-reduce:duration-0"
|
|
13
|
+
],
|
|
14
|
+
defaultVariants: { side: "right" },
|
|
15
|
+
variants: { side: {
|
|
16
|
+
bottom: [
|
|
17
|
+
"max-h-[80dvh]",
|
|
18
|
+
"inset-x-0 bottom-0",
|
|
19
|
+
"rounded-t-2xl border-t",
|
|
20
|
+
"pb-[env(safe-area-inset-bottom)]",
|
|
21
|
+
"data-open:slide-in-from-bottom",
|
|
22
|
+
"data-closed:slide-out-to-bottom"
|
|
23
|
+
],
|
|
24
|
+
left: [
|
|
25
|
+
"h-full w-3/4",
|
|
26
|
+
"inset-y-0 left-0",
|
|
27
|
+
"border-r",
|
|
28
|
+
"sm:max-w-sm",
|
|
29
|
+
"data-open:slide-in-from-left",
|
|
30
|
+
"data-closed:slide-out-to-left"
|
|
31
|
+
],
|
|
32
|
+
right: [
|
|
33
|
+
"h-full w-3/4",
|
|
34
|
+
"inset-y-0 right-0",
|
|
35
|
+
"border-l",
|
|
36
|
+
"sm:max-w-sm",
|
|
37
|
+
"data-open:slide-in-from-right",
|
|
38
|
+
"data-closed:slide-out-to-right"
|
|
39
|
+
],
|
|
40
|
+
top: [
|
|
41
|
+
"max-h-[80vh]",
|
|
42
|
+
"inset-x-0 top-0",
|
|
43
|
+
"border-b",
|
|
44
|
+
"data-open:slide-in-from-top",
|
|
45
|
+
"data-closed:slide-out-to-top"
|
|
46
|
+
]
|
|
47
|
+
} }
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
export { sheetContentVariants };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/sidebar.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const sidebarMenuButtonVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
|
+
size: {
|
|
9
|
+
sm: string[];
|
|
10
|
+
md: string[];
|
|
11
|
+
lg: string[];
|
|
12
|
+
};
|
|
13
|
+
variant: {
|
|
14
|
+
default: string;
|
|
15
|
+
outline: string[];
|
|
16
|
+
};
|
|
17
|
+
}, Record<string, never>>;
|
|
18
|
+
/**
|
|
19
|
+
* @since 0.3.16-canary.0
|
|
20
|
+
*/
|
|
21
|
+
type SidebarMenuButtonVariants = VariantProps<typeof sidebarMenuButtonVariants>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { type SidebarMenuButtonVariants, sidebarMenuButtonVariants };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/sidebar.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const sidebarMenuButtonVariants = tv({
|
|
7
|
+
base: [
|
|
8
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden p-2",
|
|
9
|
+
"rounded-md ring-sidebar-ring outline-hidden",
|
|
10
|
+
"text-left text-sm",
|
|
11
|
+
"transition-[width,height,padding]",
|
|
12
|
+
"motion-reduce:transition-none motion-reduce:duration-0",
|
|
13
|
+
"group-has-data-[sidebar=menu-action]/menu-item:pr-8",
|
|
14
|
+
"group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2!",
|
|
15
|
+
"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
16
|
+
"focus-visible:ring-3",
|
|
17
|
+
"active:bg-sidebar-accent active:text-sidebar-accent-foreground",
|
|
18
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
19
|
+
"aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
20
|
+
"data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground",
|
|
21
|
+
"data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground",
|
|
22
|
+
"[&>span:last-child]:truncate",
|
|
23
|
+
"[&>svg]:size-4 [&>svg]:shrink-0"
|
|
24
|
+
],
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
size: "md",
|
|
27
|
+
variant: "default"
|
|
28
|
+
},
|
|
29
|
+
variants: {
|
|
30
|
+
size: {
|
|
31
|
+
sm: ["h-7", "text-xs"],
|
|
32
|
+
md: ["h-8", "text-sm"],
|
|
33
|
+
lg: ["h-12 text-sm", "group-data-[collapsible=icon]:p-0!"]
|
|
34
|
+
},
|
|
35
|
+
variant: {
|
|
36
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
37
|
+
outline: ["bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))]", "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
//#endregion
|
|
42
|
+
export { sidebarMenuButtonVariants };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/toggle.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const toggleVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
|
+
size: {
|
|
9
|
+
default: string[];
|
|
10
|
+
lg: string[];
|
|
11
|
+
sm: string[];
|
|
12
|
+
};
|
|
13
|
+
variant: {
|
|
14
|
+
default: string;
|
|
15
|
+
outline: string[];
|
|
16
|
+
};
|
|
17
|
+
}, Record<string, never>>;
|
|
18
|
+
/**
|
|
19
|
+
* @since 0.3.16-canary.0
|
|
20
|
+
*/
|
|
21
|
+
type ToggleVariants = VariantProps<typeof toggleVariants>;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { type ToggleVariants, toggleVariants };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/toggle.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const toggleVariants = tv({
|
|
7
|
+
base: [
|
|
8
|
+
"inline-flex items-center justify-center gap-2",
|
|
9
|
+
"rounded-lg outline-none",
|
|
10
|
+
"text-sm font-medium whitespace-nowrap",
|
|
11
|
+
"transition-[color,background-color,box-shadow] duration-150 ease-snappy",
|
|
12
|
+
"motion-reduce:transition-none motion-reduce:duration-0",
|
|
13
|
+
"active:not-disabled:translate-y-px",
|
|
14
|
+
"hover:bg-muted hover:text-muted-foreground",
|
|
15
|
+
"focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
16
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
17
|
+
"aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
18
|
+
"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
19
|
+
"dark:aria-invalid:ring-destructive/40",
|
|
20
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
21
|
+
],
|
|
22
|
+
variants: {
|
|
23
|
+
size: {
|
|
24
|
+
default: ["h-9 min-w-9", "px-2"],
|
|
25
|
+
lg: ["h-10 min-w-10", "px-2.5"],
|
|
26
|
+
sm: ["h-8 min-w-8", "px-1.5"]
|
|
27
|
+
},
|
|
28
|
+
variant: {
|
|
29
|
+
default: "bg-transparent",
|
|
30
|
+
outline: [
|
|
31
|
+
"border border-input",
|
|
32
|
+
"bg-transparent shadow-xs",
|
|
33
|
+
"hover:bg-accent hover:text-accent-foreground"
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: {
|
|
38
|
+
size: "default",
|
|
39
|
+
variant: "default"
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
//#endregion
|
|
43
|
+
export { toggleVariants };
|