@codefast/ui 0.3.16-canary.3 → 0.4.0-canary.4
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 +60 -0
- package/README.md +27 -16
- package/dist/components/accordion.d.mts +7 -22
- package/dist/components/accordion.mjs +26 -29
- package/dist/components/alert-dialog.d.mts +27 -26
- package/dist/components/alert-dialog.mjs +53 -45
- package/dist/components/alert.d.mts +12 -2
- package/dist/components/alert.mjs +15 -6
- package/dist/components/aspect-ratio.d.mts +2 -2
- package/dist/components/aspect-ratio.mjs +2 -3
- package/dist/components/avatar.d.mts +41 -5
- package/dist/components/avatar.mjs +40 -10
- package/dist/components/badge.mjs +4 -4
- package/dist/components/breadcrumb.d.mts +1 -0
- package/dist/components/breadcrumb.mjs +11 -10
- package/dist/components/button-group.d.mts +1 -1
- package/dist/components/button-group.mjs +6 -7
- package/dist/components/button.d.mts +0 -1
- package/dist/components/button.mjs +7 -7
- package/dist/components/calendar.d.mts +6 -2
- package/dist/components/calendar.mjs +39 -43
- package/dist/components/card.d.mts +4 -2
- package/dist/components/card.mjs +9 -9
- package/dist/components/carousel.d.mts +16 -4
- package/dist/components/carousel.mjs +24 -11
- package/dist/components/chart.d.mts +8 -3
- package/dist/components/chart.mjs +21 -15
- package/dist/components/checkbox-cards.mjs +4 -4
- package/dist/components/checkbox-group.mjs +3 -4
- package/dist/components/checkbox.d.mts +2 -2
- package/dist/components/checkbox.mjs +6 -7
- package/dist/components/collapsible.d.mts +4 -4
- package/dist/components/collapsible.mjs +4 -5
- package/dist/components/command.d.mts +11 -1
- package/dist/components/command.mjs +35 -32
- package/dist/components/context-menu.d.mts +22 -15
- package/dist/components/context-menu.mjs +44 -39
- package/dist/components/dialog.d.mts +19 -23
- package/dist/components/dialog.mjs +48 -47
- package/dist/components/direction.d.mts +24 -0
- package/dist/components/direction.mjs +18 -0
- package/dist/components/drawer.d.mts +2 -20
- package/dist/components/drawer.mjs +17 -25
- package/dist/components/dropdown-menu.d.mts +22 -15
- package/dist/components/dropdown-menu.mjs +41 -37
- package/dist/components/empty.mjs +5 -5
- package/dist/components/field.d.mts +1 -1
- package/dist/components/field.mjs +11 -12
- package/dist/components/form.d.mts +6 -7
- package/dist/components/form.mjs +6 -7
- package/dist/components/hover-card.d.mts +5 -5
- package/dist/components/hover-card.mjs +14 -12
- package/dist/components/input-group.d.mts +1 -1
- package/dist/components/input-group.mjs +12 -7
- package/dist/components/input-number.d.mts +3 -1
- package/dist/components/input-number.mjs +49 -27
- package/dist/components/input-otp.mjs +9 -7
- package/dist/components/input-password.mjs +1 -4
- package/dist/components/input-search.mjs +3 -5
- package/dist/components/input.mjs +1 -2
- package/dist/components/item.mjs +9 -9
- package/dist/components/kbd.mjs +1 -1
- package/dist/components/label.d.mts +2 -2
- package/dist/components/label.mjs +3 -4
- package/dist/components/menubar.d.mts +22 -16
- package/dist/components/menubar.mjs +54 -47
- package/dist/components/native-select.d.mts +5 -1
- package/dist/components/native-select.mjs +9 -6
- package/dist/components/navigation-menu.d.mts +30 -8
- package/dist/components/navigation-menu.mjs +33 -23
- package/dist/components/pagination.d.mts +6 -0
- package/dist/components/pagination.mjs +26 -11
- package/dist/components/popover.d.mts +40 -7
- package/dist/components/popover.mjs +46 -14
- package/dist/components/progress-circle.d.mts +1 -1
- package/dist/components/progress-circle.mjs +1 -2
- package/dist/components/progress.d.mts +2 -2
- package/dist/components/progress.mjs +5 -6
- package/dist/components/radio-cards.d.mts +3 -3
- package/dist/components/radio-cards.mjs +11 -11
- package/dist/components/radio-group.d.mts +3 -3
- package/dist/components/radio-group.mjs +9 -9
- package/dist/components/radio.mjs +2 -3
- package/dist/components/resizable.mjs +3 -8
- package/dist/components/scroll-area.d.mts +5 -5
- package/dist/components/scroll-area.mjs +13 -10
- package/dist/components/select.d.mts +14 -14
- package/dist/components/select.mjs +47 -47
- package/dist/components/separator.d.mts +2 -2
- package/dist/components/separator.mjs +3 -4
- package/dist/components/sheet.d.mts +13 -14
- package/dist/components/sheet.mjs +41 -39
- package/dist/components/sidebar.d.mts +2 -3
- package/dist/components/sidebar.mjs +46 -46
- package/dist/components/skeleton.mjs +1 -1
- package/dist/components/slider.d.mts +2 -2
- package/dist/components/slider.mjs +9 -11
- package/dist/components/sonner.mjs +11 -3
- package/dist/components/spinner.mjs +6 -7
- package/dist/components/switch.d.mts +5 -2
- package/dist/components/switch.mjs +7 -7
- package/dist/components/table.mjs +10 -10
- package/dist/components/tabs.d.mts +8 -5
- package/dist/components/tabs.mjs +18 -12
- package/dist/components/textarea.mjs +1 -1
- package/dist/components/toggle-group.d.mts +9 -6
- package/dist/components/toggle-group.mjs +19 -20
- package/dist/components/toggle.d.mts +2 -3
- package/dist/components/toggle.mjs +4 -6
- package/dist/components/tooltip.d.mts +7 -6
- package/dist/components/tooltip.mjs +19 -17
- package/dist/hooks/use-animated-value.mjs +0 -1
- package/dist/hooks/use-copy-to-clipboard.mjs +0 -1
- package/dist/hooks/use-is-mobile.mjs +0 -1
- package/dist/hooks/use-media-query.mjs +0 -1
- package/dist/hooks/use-mutation-observer.mjs +0 -1
- package/dist/hooks/use-pagination.mjs +0 -1
- package/dist/index.d.mts +15 -13
- package/dist/index.mjs +18 -16
- package/dist/primitives/checkbox-group.d.mts +9 -10
- package/dist/primitives/checkbox-group.mjs +14 -19
- package/dist/primitives/input-number.d.mts +3 -3
- package/dist/primitives/input-number.mjs +3 -5
- package/dist/primitives/input.d.mts +4 -4
- package/dist/primitives/input.mjs +2 -3
- package/dist/primitives/progress-circle.d.mts +3 -3
- package/dist/primitives/progress-circle.mjs +2 -3
- package/dist/variants/alert.d.mts +1 -1
- package/dist/variants/alert.mjs +3 -13
- package/dist/variants/badge.d.mts +6 -4
- package/dist/variants/badge.mjs +7 -34
- package/dist/variants/button-group.d.mts +2 -2
- package/dist/variants/button-group.mjs +3 -14
- package/dist/variants/button.d.mts +12 -10
- package/dist/variants/button.mjs +15 -57
- package/dist/variants/empty.d.mts +1 -1
- package/dist/variants/empty.mjs +2 -7
- package/dist/variants/field.d.mts +3 -3
- package/dist/variants/field.mjs +4 -22
- package/dist/variants/input-group.d.mts +9 -9
- package/dist/variants/input-group.mjs +11 -70
- package/dist/variants/input-number.d.mts +45 -0
- package/dist/variants/input-number.mjs +40 -0
- package/dist/variants/item.d.mts +5 -4
- package/dist/variants/item.mjs +9 -31
- package/dist/variants/navigation-menu.d.mts +1 -1
- package/dist/variants/navigation-menu.mjs +1 -5
- package/dist/variants/progress-circle.d.mts +1 -1
- package/dist/variants/progress-circle.mjs +1 -5
- package/dist/variants/scroll-area.d.mts +2 -2
- package/dist/variants/scroll-area.mjs +3 -8
- package/dist/variants/separator.mjs +6 -6
- package/dist/variants/sheet.d.mts +4 -4
- package/dist/variants/sheet.mjs +5 -38
- package/dist/variants/sidebar.d.mts +4 -4
- package/dist/variants/sidebar.mjs +6 -23
- package/dist/variants/tabs.d.mts +18 -0
- package/dist/variants/tabs.mjs +15 -0
- package/dist/variants/toggle.d.mts +4 -4
- package/dist/variants/toggle.mjs +9 -27
- package/package.json +27 -44
- package/src/components/accordion.tsx +26 -68
- package/src/components/alert-dialog.tsx +70 -86
- package/src/components/alert.tsx +27 -19
- package/src/components/aspect-ratio.tsx +1 -4
- package/src/components/avatar.tsx +99 -12
- package/src/components/badge.tsx +5 -8
- package/src/components/breadcrumb.tsx +18 -24
- package/src/components/button-group.tsx +10 -20
- package/src/components/button.tsx +8 -19
- package/src/components/calendar.tsx +77 -132
- package/src/components/card.tsx +16 -22
- package/src/components/carousel.tsx +38 -56
- package/src/components/chart.tsx +41 -92
- package/src/components/checkbox-cards.tsx +10 -30
- package/src/components/checkbox-group.tsx +5 -28
- package/src/components/checkbox.tsx +5 -26
- package/src/components/collapsible.tsx +1 -4
- package/src/components/command.tsx +52 -65
- package/src/components/context-menu.tsx +46 -125
- package/src/components/dialog.tsx +49 -101
- package/src/components/direction.tsx +32 -0
- package/src/components/drawer.tsx +17 -79
- package/src/components/dropdown-menu.tsx +39 -118
- package/src/components/empty.tsx +6 -20
- package/src/components/field.tsx +19 -52
- package/src/components/form.tsx +19 -61
- package/src/components/hover-card.tsx +4 -27
- package/src/components/input-group.tsx +13 -52
- package/src/components/input-number.tsx +55 -75
- package/src/components/input-otp.tsx +19 -38
- package/src/components/input-password.tsx +5 -29
- package/src/components/input-search.tsx +6 -23
- package/src/components/input.tsx +1 -17
- package/src/components/item.tsx +17 -31
- package/src/components/kbd.tsx +2 -14
- package/src/components/label.tsx +2 -10
- package/src/components/menubar.tsx +34 -125
- package/src/components/native-select.tsx +21 -30
- package/src/components/navigation-menu.tsx +34 -94
- package/src/components/pagination.tsx +28 -34
- package/src/components/popover.tsx +66 -35
- package/src/components/progress-circle.tsx +7 -25
- package/src/components/progress.tsx +3 -16
- package/src/components/radio-cards.tsx +8 -27
- package/src/components/radio-group.tsx +7 -27
- package/src/components/radio.tsx +3 -24
- package/src/components/resizable.tsx +5 -26
- package/src/components/scroll-area.tsx +12 -32
- package/src/components/select.tsx +36 -59
- package/src/components/separator.tsx +4 -18
- package/src/components/sheet.tsx +37 -74
- package/src/components/sidebar.tsx +47 -177
- package/src/components/skeleton.tsx +1 -3
- package/src/components/slider.tsx +7 -36
- package/src/components/sonner.tsx +16 -6
- package/src/components/spinner.tsx +6 -15
- package/src/components/switch.tsx +8 -30
- package/src/components/table.tsx +18 -35
- package/src/components/tabs.tsx +16 -34
- package/src/components/textarea.tsx +1 -15
- package/src/components/toggle-group.tsx +34 -38
- package/src/components/toggle.tsx +4 -13
- package/src/components/tooltip.tsx +11 -37
- package/src/css/foundation/base.css +50 -0
- package/src/css/foundation/motion.css +36 -0
- package/src/css/foundation/source.css +3 -0
- package/src/css/foundation/tokens.css +71 -0
- package/src/css/foundation/variants.css +113 -0
- package/src/css/preset.css +5 -214
- package/src/css/style.css +1 -1
- package/src/hooks/use-animated-value.ts +1 -7
- package/src/hooks/use-copy-to-clipboard.ts +1 -6
- package/src/hooks/use-is-mobile.ts +0 -2
- package/src/hooks/use-media-query.ts +0 -2
- package/src/hooks/use-mutation-observer.ts +0 -3
- package/src/hooks/use-pagination.ts +0 -2
- package/src/index.ts +39 -80
- package/src/primitives/checkbox-group.tsx +25 -39
- package/src/primitives/input-number.tsx +17 -63
- package/src/primitives/input.tsx +8 -24
- package/src/primitives/progress-circle.tsx +13 -43
- package/src/variants/alert.ts +3 -14
- package/src/variants/badge.ts +8 -35
- package/src/variants/button-group.ts +5 -18
- package/src/variants/button.ts +21 -58
- package/src/variants/empty.ts +2 -11
- package/src/variants/field.ts +6 -19
- package/src/variants/input-group.ts +12 -64
- package/src/variants/input-number.ts +65 -0
- package/src/variants/item.ts +10 -32
- package/src/variants/navigation-menu.ts +1 -8
- package/src/variants/progress-circle.ts +1 -2
- package/src/variants/scroll-area.ts +3 -9
- package/src/variants/separator.ts +6 -7
- package/src/variants/sheet.ts +6 -39
- package/src/variants/sidebar.ts +7 -27
- package/src/variants/tabs.ts +34 -0
- package/src/variants/toggle.ts +9 -28
- /package/src/css/{amber.css → themes/amber.css} +0 -0
- /package/src/css/{blue.css → themes/blue.css} +0 -0
- /package/src/css/{cyan.css → themes/cyan.css} +0 -0
- /package/src/css/{emerald.css → themes/emerald.css} +0 -0
- /package/src/css/{fuchsia.css → themes/fuchsia.css} +0 -0
- /package/src/css/{gray.css → themes/gray.css} +0 -0
- /package/src/css/{green.css → themes/green.css} +0 -0
- /package/src/css/{indigo.css → themes/indigo.css} +0 -0
- /package/src/css/{lime.css → themes/lime.css} +0 -0
- /package/src/css/{neutral.css → themes/neutral.css} +0 -0
- /package/src/css/{orange.css → themes/orange.css} +0 -0
- /package/src/css/{pink.css → themes/pink.css} +0 -0
- /package/src/css/{purple.css → themes/purple.css} +0 -0
- /package/src/css/{red.css → themes/red.css} +0 -0
- /package/src/css/{rose.css → themes/rose.css} +0 -0
- /package/src/css/{sky.css → themes/sky.css} +0 -0
- /package/src/css/{slate.css → themes/slate.css} +0 -0
- /package/src/css/{stone.css → themes/stone.css} +0 -0
- /package/src/css/{teal.css → themes/teal.css} +0 -0
- /package/src/css/{violet.css → themes/violet.css} +0 -0
- /package/src/css/{yellow.css → themes/yellow.css} +0 -0
- /package/src/css/{zinc.css → themes/zinc.css} +0 -0
package/dist/variants/sheet.mjs
CHANGED
|
@@ -4,46 +4,13 @@ import { tv } from "../lib/utils.mjs";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
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
|
-
],
|
|
7
|
+
base: "fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition ease-ui data-open:animate-in data-open:animation-duration-panel-in data-open:fade-in-0 data-closed:animate-out data-closed:ease-exit data-closed:animation-duration-panel-out data-closed:fade-out-0",
|
|
14
8
|
defaultVariants: { side: "right" },
|
|
15
9
|
variants: { side: {
|
|
16
|
-
bottom:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
]
|
|
10
|
+
bottom: "inset-x-0 bottom-0 h-auto border-t data-open:slide-in-from-bottom-10 data-closed:slide-out-to-bottom-10",
|
|
11
|
+
left: "inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm data-open:slide-in-from-left-10 data-closed:slide-out-to-left-10",
|
|
12
|
+
right: "inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm data-open:slide-in-from-right-10 data-closed:slide-out-to-right-10",
|
|
13
|
+
top: "inset-x-0 top-0 h-auto border-b data-open:slide-in-from-top-10 data-closed:slide-out-to-top-10"
|
|
47
14
|
} }
|
|
48
15
|
});
|
|
49
16
|
//#endregion
|
|
@@ -6,13 +6,13 @@ import { VariantProps } from "../lib/utils.mjs";
|
|
|
6
6
|
*/
|
|
7
7
|
declare const sidebarMenuButtonVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
8
|
size: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
lg: string
|
|
9
|
+
default: string;
|
|
10
|
+
sm: string;
|
|
11
|
+
lg: string;
|
|
12
12
|
};
|
|
13
13
|
variant: {
|
|
14
14
|
default: string;
|
|
15
|
-
outline: string
|
|
15
|
+
outline: string;
|
|
16
16
|
};
|
|
17
17
|
}, Record<string, never>>;
|
|
18
18
|
/**
|
|
@@ -4,37 +4,20 @@ import { tv } from "../lib/utils.mjs";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
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
|
-
],
|
|
7
|
+
base: "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
|
|
25
8
|
defaultVariants: {
|
|
26
|
-
size: "
|
|
9
|
+
size: "default",
|
|
27
10
|
variant: "default"
|
|
28
11
|
},
|
|
29
12
|
variants: {
|
|
30
13
|
size: {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
lg:
|
|
14
|
+
default: "h-8 text-sm",
|
|
15
|
+
sm: "h-7 text-xs",
|
|
16
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
34
17
|
},
|
|
35
18
|
variant: {
|
|
36
19
|
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
37
|
-
outline:
|
|
20
|
+
outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
|
|
38
21
|
}
|
|
39
22
|
}
|
|
40
23
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { VariantProps } from "../lib/utils.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/variants/tabs.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* @since 0.3.16-canary.0
|
|
6
|
+
*/
|
|
7
|
+
declare const tabsListVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
|
+
variant: {
|
|
9
|
+
default: string;
|
|
10
|
+
line: string;
|
|
11
|
+
};
|
|
12
|
+
}, Record<string, never>>;
|
|
13
|
+
/**
|
|
14
|
+
* @since 0.3.16-canary.0
|
|
15
|
+
*/
|
|
16
|
+
type TabsListVariants = VariantProps<typeof tabsListVariants>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { type TabsListVariants, tabsListVariants };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { tv } from "../lib/utils.mjs";
|
|
2
|
+
//#region src/variants/tabs.ts
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.3.16-canary.0
|
|
5
|
+
*/
|
|
6
|
+
const tabsListVariants = tv({
|
|
7
|
+
base: "group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-0.75 text-muted-foreground group-data-horizontal/tabs:h-9 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",
|
|
8
|
+
defaultVariants: { variant: "default" },
|
|
9
|
+
variants: { variant: {
|
|
10
|
+
default: "bg-muted",
|
|
11
|
+
line: "gap-1 bg-transparent"
|
|
12
|
+
} }
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { tabsListVariants };
|
|
@@ -6,13 +6,13 @@ import { VariantProps } from "../lib/utils.mjs";
|
|
|
6
6
|
*/
|
|
7
7
|
declare const toggleVariants: import("@codefast/tailwind-variants").VariantResolver<{
|
|
8
8
|
size: {
|
|
9
|
-
default: string
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
default: string;
|
|
10
|
+
sm: string;
|
|
11
|
+
lg: string;
|
|
12
12
|
};
|
|
13
13
|
variant: {
|
|
14
14
|
default: string;
|
|
15
|
-
outline: string
|
|
15
|
+
outline: string;
|
|
16
16
|
};
|
|
17
17
|
}, Record<string, never>>;
|
|
18
18
|
/**
|
package/dist/variants/toggle.mjs
CHANGED
|
@@ -4,39 +4,21 @@ import { tv } from "../lib/utils.mjs";
|
|
|
4
4
|
* @since 0.3.16-canary.0
|
|
5
5
|
*/
|
|
6
6
|
const toggleVariants = tv({
|
|
7
|
-
base: [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
],
|
|
7
|
+
base: "group/toggle inline-flex items-center justify-center gap-1 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
8
|
+
defaultVariants: {
|
|
9
|
+
size: "default",
|
|
10
|
+
variant: "default"
|
|
11
|
+
},
|
|
22
12
|
variants: {
|
|
23
13
|
size: {
|
|
24
|
-
default:
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
default: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
15
|
+
sm: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
16
|
+
lg: "h-10 min-w-10 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2"
|
|
27
17
|
},
|
|
28
18
|
variant: {
|
|
29
19
|
default: "bg-transparent",
|
|
30
|
-
outline:
|
|
31
|
-
"border border-input",
|
|
32
|
-
"bg-transparent shadow-xs",
|
|
33
|
-
"hover:bg-accent hover:text-accent-foreground"
|
|
34
|
-
]
|
|
20
|
+
outline: "border border-input bg-transparent shadow-xs hover:bg-muted"
|
|
35
21
|
}
|
|
36
|
-
},
|
|
37
|
-
defaultVariants: {
|
|
38
|
-
size: "default",
|
|
39
|
-
variant: "default"
|
|
40
22
|
}
|
|
41
23
|
});
|
|
42
24
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codefast/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-canary.4",
|
|
4
4
|
"description": "Core UI components library built with React and Tailwind CSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -160,6 +160,11 @@
|
|
|
160
160
|
"types": "./dist/components/dialog.d.mts",
|
|
161
161
|
"import": "./dist/components/dialog.mjs"
|
|
162
162
|
},
|
|
163
|
+
"./direction": {
|
|
164
|
+
"source": "./src/components/direction.tsx",
|
|
165
|
+
"types": "./dist/components/direction.d.mts",
|
|
166
|
+
"import": "./dist/components/direction.mjs"
|
|
167
|
+
},
|
|
163
168
|
"./drawer": {
|
|
164
169
|
"source": "./src/components/drawer.tsx",
|
|
165
170
|
"types": "./dist/components/drawer.d.mts",
|
|
@@ -460,6 +465,11 @@
|
|
|
460
465
|
"types": "./dist/variants/input-group.d.mts",
|
|
461
466
|
"import": "./dist/variants/input-group.mjs"
|
|
462
467
|
},
|
|
468
|
+
"./variants/input-number": {
|
|
469
|
+
"source": "./src/variants/input-number.ts",
|
|
470
|
+
"types": "./dist/variants/input-number.d.mts",
|
|
471
|
+
"import": "./dist/variants/input-number.mjs"
|
|
472
|
+
},
|
|
463
473
|
"./variants/item": {
|
|
464
474
|
"source": "./src/variants/item.ts",
|
|
465
475
|
"types": "./dist/variants/item.d.mts",
|
|
@@ -495,6 +505,11 @@
|
|
|
495
505
|
"types": "./dist/variants/sidebar.d.mts",
|
|
496
506
|
"import": "./dist/variants/sidebar.mjs"
|
|
497
507
|
},
|
|
508
|
+
"./variants/tabs": {
|
|
509
|
+
"source": "./src/variants/tabs.ts",
|
|
510
|
+
"types": "./dist/variants/tabs.d.mts",
|
|
511
|
+
"import": "./dist/variants/tabs.mjs"
|
|
512
|
+
},
|
|
498
513
|
"./variants/toggle": {
|
|
499
514
|
"source": "./src/variants/toggle.ts",
|
|
500
515
|
"types": "./dist/variants/toggle.d.mts",
|
|
@@ -507,52 +522,20 @@
|
|
|
507
522
|
"access": "public"
|
|
508
523
|
},
|
|
509
524
|
"dependencies": {
|
|
510
|
-
"@
|
|
511
|
-
"@radix-ui/react-accordion": "^1.2.12",
|
|
512
|
-
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
513
|
-
"@radix-ui/react-aspect-ratio": "^1.1.8",
|
|
514
|
-
"@radix-ui/react-avatar": "^1.1.11",
|
|
515
|
-
"@radix-ui/react-checkbox": "^1.3.3",
|
|
516
|
-
"@radix-ui/react-collapsible": "^1.1.12",
|
|
517
|
-
"@radix-ui/react-compose-refs": "^1.1.2",
|
|
518
|
-
"@radix-ui/react-context": "^1.1.3",
|
|
519
|
-
"@radix-ui/react-context-menu": "^2.2.16",
|
|
520
|
-
"@radix-ui/react-dialog": "^1.1.15",
|
|
521
|
-
"@radix-ui/react-direction": "^1.1.1",
|
|
522
|
-
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
523
|
-
"@radix-ui/react-hover-card": "^1.1.15",
|
|
524
|
-
"@radix-ui/react-label": "^2.1.8",
|
|
525
|
-
"@radix-ui/react-menubar": "^1.1.16",
|
|
526
|
-
"@radix-ui/react-navigation-menu": "^1.2.14",
|
|
527
|
-
"@radix-ui/react-popover": "^1.1.15",
|
|
528
|
-
"@radix-ui/react-progress": "^1.1.8",
|
|
529
|
-
"@radix-ui/react-radio-group": "^1.3.8",
|
|
530
|
-
"@radix-ui/react-roving-focus": "^1.1.11",
|
|
531
|
-
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
532
|
-
"@radix-ui/react-select": "^2.2.6",
|
|
533
|
-
"@radix-ui/react-separator": "^1.1.8",
|
|
534
|
-
"@radix-ui/react-slider": "^1.3.6",
|
|
535
|
-
"@radix-ui/react-slot": "^1.2.4",
|
|
536
|
-
"@radix-ui/react-switch": "^1.2.6",
|
|
537
|
-
"@radix-ui/react-tabs": "^1.1.13",
|
|
538
|
-
"@radix-ui/react-toggle": "^1.1.10",
|
|
539
|
-
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
540
|
-
"@radix-ui/react-tooltip": "^1.2.8",
|
|
541
|
-
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
|
542
|
-
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
525
|
+
"@daypicker/react": "^10.0.1",
|
|
543
526
|
"cmdk": "^1.1.1",
|
|
544
527
|
"embla-carousel-react": "^8.6.0",
|
|
545
528
|
"input-otp": "^1.4.2",
|
|
546
|
-
"lucide-react": "^1.
|
|
529
|
+
"lucide-react": "^1.17.0",
|
|
547
530
|
"next-themes": "^0.4.6",
|
|
548
|
-
"
|
|
549
|
-
"react-hook-form": "^7.
|
|
531
|
+
"radix-ui": "^1.5.0",
|
|
532
|
+
"react-hook-form": "^7.78.0",
|
|
550
533
|
"react-resizable-panels": "^4.11.2",
|
|
551
534
|
"recharts": "^3.8.1",
|
|
552
535
|
"sonner": "^2.0.7",
|
|
553
536
|
"tw-animate-css": "^1.4.0",
|
|
554
537
|
"vaul": "^1.1.2",
|
|
555
|
-
"@codefast/tailwind-variants": "0.
|
|
538
|
+
"@codefast/tailwind-variants": "0.4.0-canary.4"
|
|
556
539
|
},
|
|
557
540
|
"devDependencies": {
|
|
558
541
|
"@tailwindcss/postcss": "^4.3.0",
|
|
@@ -561,18 +544,18 @@
|
|
|
561
544
|
"@testing-library/react": "^16.3.2",
|
|
562
545
|
"@testing-library/user-event": "^14.6.1",
|
|
563
546
|
"@types/jest-axe": "^3.5.9",
|
|
564
|
-
"@types/node": "^25.9.
|
|
565
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
547
|
+
"@types/node": "^25.9.2",
|
|
548
|
+
"@typescript/native-preview": "7.0.0-dev.20260604.1",
|
|
566
549
|
"@vitejs/plugin-react": "^6.0.2",
|
|
567
|
-
"@vitest/coverage-v8": "^4.1.
|
|
550
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
568
551
|
"jest-axe": "^10.0.0",
|
|
569
552
|
"jsdom": "^29.1.1",
|
|
570
553
|
"postcss": "^8.5.15",
|
|
571
554
|
"tailwindcss": "^4.3.0",
|
|
572
|
-
"tsdown": "^0.22.
|
|
555
|
+
"tsdown": "^0.22.2",
|
|
573
556
|
"typescript": "^6.0.3",
|
|
574
|
-
"vitest": "^4.1.
|
|
575
|
-
"@codefast/typescript-config": "0.
|
|
557
|
+
"vitest": "^4.1.8",
|
|
558
|
+
"@codefast/typescript-config": "0.4.0-canary.4"
|
|
576
559
|
},
|
|
577
560
|
"peerDependencies": {
|
|
578
561
|
"@types/react": ">=19.0.0",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
2
|
+
import { Accordion as AccordionPrimitive } from "radix-ui";
|
|
3
3
|
import type { ComponentProps, JSX } from "react";
|
|
4
4
|
|
|
5
5
|
import { cn } from "#/lib/utils";
|
|
6
|
-
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
7
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
8
|
-
import { ChevronDownIcon } from "lucide-react";
|
|
9
6
|
|
|
10
7
|
/* -----------------------------------------------------------------------------
|
|
11
8
|
* Component: Accordion
|
|
@@ -19,8 +16,8 @@ type AccordionProps = ComponentProps<typeof AccordionPrimitive.Root>;
|
|
|
19
16
|
/**
|
|
20
17
|
* @since 0.3.16-canary.0
|
|
21
18
|
*/
|
|
22
|
-
function Accordion({ ...props }: AccordionProps): JSX.Element {
|
|
23
|
-
return <AccordionPrimitive.Root data-slot="accordion" {...props} />;
|
|
19
|
+
function Accordion({ className, ...props }: AccordionProps): JSX.Element {
|
|
20
|
+
return <AccordionPrimitive.Root className={cn("flex w-full flex-col", className)} data-slot="accordion" {...props} />;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
/* -----------------------------------------------------------------------------
|
|
@@ -37,44 +34,7 @@ type AccordionItemProps = ComponentProps<typeof AccordionPrimitive.Item>;
|
|
|
37
34
|
*/
|
|
38
35
|
function AccordionItem({ className, ...props }: AccordionItemProps): JSX.Element {
|
|
39
36
|
return (
|
|
40
|
-
<AccordionPrimitive.Item
|
|
41
|
-
className={cn("border-b", "last:border-b-0", className)}
|
|
42
|
-
data-slot="accordion-item"
|
|
43
|
-
{...props}
|
|
44
|
-
/>
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* -----------------------------------------------------------------------------
|
|
49
|
-
* Component: AccordionIcon
|
|
50
|
-
* -------------------------------------------------------------------------- */
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @since 0.3.16-canary.0
|
|
54
|
-
*/
|
|
55
|
-
interface AccordionIconProps extends ComponentProps<typeof Slot> {
|
|
56
|
-
asChild?: boolean;
|
|
57
|
-
className?: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* @since 0.3.16-canary.0
|
|
62
|
-
*/
|
|
63
|
-
function AccordionIcon({ asChild, className, ...props }: AccordionIconProps): JSX.Element {
|
|
64
|
-
const Component = (asChild ? Slot : ChevronDownIcon) as typeof Slot;
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<Component
|
|
68
|
-
aria-hidden
|
|
69
|
-
className={cn(
|
|
70
|
-
"size-4 shrink-0 text-muted-foreground",
|
|
71
|
-
"translate-y-0.5 transition-transform duration-300 ease-spring",
|
|
72
|
-
"motion-reduce:transition-none motion-reduce:duration-0",
|
|
73
|
-
className,
|
|
74
|
-
)}
|
|
75
|
-
data-slot="accordion-icon"
|
|
76
|
-
{...props}
|
|
77
|
-
/>
|
|
37
|
+
<AccordionPrimitive.Item className={cn("not-last:border-b", className)} data-slot="accordion-item" {...props} />
|
|
78
38
|
);
|
|
79
39
|
}
|
|
80
40
|
|
|
@@ -92,22 +52,24 @@ type AccordionTriggerProps = ComponentProps<typeof AccordionPrimitive.Trigger>;
|
|
|
92
52
|
*/
|
|
93
53
|
function AccordionTrigger({ children, className, ...props }: AccordionTriggerProps): JSX.Element {
|
|
94
54
|
return (
|
|
95
|
-
<AccordionPrimitive.Header className="flex"
|
|
55
|
+
<AccordionPrimitive.Header className="flex">
|
|
96
56
|
<AccordionPrimitive.Trigger
|
|
97
57
|
className={cn(
|
|
98
|
-
"group/accordion-trigger flex
|
|
99
|
-
"rounded-md outline-hidden",
|
|
100
|
-
"text-left text-sm font-medium",
|
|
101
|
-
"hover:not-disabled:underline",
|
|
102
|
-
"focus-visible:ring-3 focus-visible:ring-ring/50",
|
|
103
|
-
"disabled:opacity-50",
|
|
104
|
-
"[&[data-state=open]>svg]:rotate-180",
|
|
58
|
+
"group/accordion-trigger relative flex flex-1 items-start justify-between rounded-md border border-transparent py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring disabled:pointer-events-none disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",
|
|
105
59
|
className,
|
|
106
60
|
)}
|
|
107
61
|
data-slot="accordion-trigger"
|
|
108
62
|
{...props}
|
|
109
63
|
>
|
|
110
64
|
{children}
|
|
65
|
+
<ChevronDownIcon
|
|
66
|
+
className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"
|
|
67
|
+
data-slot="accordion-trigger-icon"
|
|
68
|
+
/>
|
|
69
|
+
<ChevronUpIcon
|
|
70
|
+
className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"
|
|
71
|
+
data-slot="accordion-trigger-icon"
|
|
72
|
+
/>
|
|
111
73
|
</AccordionPrimitive.Trigger>
|
|
112
74
|
</AccordionPrimitive.Header>
|
|
113
75
|
);
|
|
@@ -128,16 +90,18 @@ type AccordionContentProps = ComponentProps<typeof AccordionPrimitive.Content>;
|
|
|
128
90
|
function AccordionContent({ children, className, ...props }: AccordionContentProps): JSX.Element {
|
|
129
91
|
return (
|
|
130
92
|
<AccordionPrimitive.Content
|
|
131
|
-
className=
|
|
132
|
-
"overflow-hidden",
|
|
133
|
-
"data-open:animate-collapsible-down data-open:ease-snappy",
|
|
134
|
-
"data-closed:animate-collapsible-up data-closed:ease-snappy",
|
|
135
|
-
"motion-reduce:animate-none motion-reduce:transition-none",
|
|
136
|
-
)}
|
|
93
|
+
className="overflow-hidden text-sm ease-snappy data-open:animate-accordion-down data-open:animation-duration-expand-in data-closed:animate-accordion-up data-closed:ease-exit data-closed:animation-duration-expand-out"
|
|
137
94
|
data-slot="accordion-content"
|
|
138
95
|
{...props}
|
|
139
96
|
>
|
|
140
|
-
<div
|
|
97
|
+
<div
|
|
98
|
+
className={cn(
|
|
99
|
+
"h-(--radix-accordion-content-height) pt-0 pb-4 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
|
|
100
|
+
className,
|
|
101
|
+
)}
|
|
102
|
+
>
|
|
103
|
+
{children}
|
|
104
|
+
</div>
|
|
141
105
|
</AccordionPrimitive.Content>
|
|
142
106
|
);
|
|
143
107
|
}
|
|
@@ -146,11 +110,5 @@ function AccordionContent({ children, className, ...props }: AccordionContentPro
|
|
|
146
110
|
* Exports
|
|
147
111
|
* -------------------------------------------------------------------------- */
|
|
148
112
|
|
|
149
|
-
export { Accordion, AccordionContent,
|
|
150
|
-
export type {
|
|
151
|
-
AccordionContentProps,
|
|
152
|
-
AccordionIconProps,
|
|
153
|
-
AccordionItemProps,
|
|
154
|
-
AccordionProps,
|
|
155
|
-
AccordionTriggerProps,
|
|
156
|
-
};
|
|
113
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
114
|
+
export type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps };
|