@mbao01/common 0.1.4 → 0.2.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/README.md +1 -9
- package/dist/types/components/AlertDialog/AlertDialog.d.ts +4 -0
- package/dist/types/components/Button/Button.d.ts +2 -0
- package/dist/types/components/Button/constants.d.ts +2 -0
- package/dist/types/components/Card/Card.d.ts +1 -1
- package/dist/types/components/Card/constants.d.ts +2 -2
- package/dist/types/components/Carousel/Carousel.d.ts +4 -0
- package/dist/types/components/Form/DatetimeInput/DatetimeInput.d.ts +1 -0
- package/dist/types/components/Form/Select/Select.d.ts +0 -2
- package/dist/types/components/Form/Select/constants.d.ts +0 -1
- package/dist/types/components/Form/components/Fieldset/Fieldset.d.ts +7 -0
- package/dist/types/components/Form/components/Fieldset/constants.d.ts +3 -0
- package/dist/types/components/Form/components/Fieldset/index.d.ts +1 -0
- package/dist/types/components/Form/components/Fieldset/types.d.ts +10 -0
- package/dist/types/components/Form/components/Label/Label.d.ts +2 -4
- package/dist/types/components/Form/index.d.ts +1 -1
- package/dist/types/components/Loading/constants.d.ts +1 -1
- package/dist/types/components/Sidebar/Sidebar.d.ts +2 -0
- package/dist/types/components/Toggle/Toggle.d.ts +3 -0
- package/dist/types/components/Toggle/constants.d.ts +1 -0
- package/dist/types/components/ToggleGroup/ToggleGroup.d.ts +3 -0
- package/package.json +75 -79
- package/src/components/AlertDialog/constants.ts +1 -1
- package/src/components/Avatar/constants.ts +4 -4
- package/src/components/Button/Button.tsx +24 -3
- package/src/components/Button/constants.ts +19 -1
- package/src/components/Calendar/Calendar.tsx +9 -9
- package/src/components/Card/Card.tsx +2 -2
- package/src/components/Card/constants.ts +9 -8
- package/src/components/Chart/constants.ts +2 -2
- package/src/components/Chart/stories/examples/PieChart.tsx +1 -1
- package/src/components/Chart/stories/examples/RadarChart.tsx +2 -2
- package/src/components/Command/constants.ts +2 -2
- package/src/components/DatetimePicker/constants.ts +2 -2
- package/src/components/Description/Description.tsx +1 -1
- package/src/components/Dialog/constants.ts +1 -1
- package/src/components/DragAndDrop/Draggable/Draggable.example.tsx +1 -1
- package/src/components/DragAndDrop/Draggable/constants.ts +1 -1
- package/src/components/DragAndDrop/Droppable/Droppable.example.tsx +2 -2
- package/src/components/DragAndDrop/Sortable/Sortable.example.tsx +2 -2
- package/src/components/FileUploader/FileUploader.tsx +1 -1
- package/src/components/Form/Checkbox/constants.ts +1 -1
- package/src/components/Form/DatetimeInput/constants.ts +5 -5
- package/src/components/Form/MultiSelect/constants.ts +4 -4
- package/src/components/Form/OtpInput/OtpInput.tsx +1 -1
- package/src/components/Form/Phone/constants.ts +2 -2
- package/src/components/Form/Select/Select.tsx +2 -2
- package/src/components/Form/Select/constants.ts +7 -5
- package/src/components/Form/Slider/constants.ts +1 -1
- package/src/components/Form/TagsInput/constants.ts +3 -3
- package/src/components/Form/TextField/TextField.tsx +15 -12
- package/src/components/Form/Textarea/constants.ts +6 -1
- package/src/components/Form/components/Fieldset/Fieldset.tsx +42 -0
- package/src/components/Form/components/Fieldset/constants.ts +7 -0
- package/src/components/Form/components/Fieldset/index.ts +1 -0
- package/src/components/Form/components/Fieldset/types.ts +19 -0
- package/src/components/Form/components/Label/Label.tsx +2 -13
- package/src/components/Form/index.ts +1 -1
- package/src/components/HoverCard/constants.ts +1 -1
- package/src/components/Loading/constants.ts +1 -0
- package/src/components/Menu/Menubar/constants.ts +6 -6
- package/src/components/Menu/NavigationMenu/constants.ts +12 -12
- package/src/components/Popover/constants.ts +1 -1
- package/src/components/Sidebar/SidebarMenu.tsx +1 -1
- package/src/components/Sidebar/constants.ts +24 -24
- package/src/components/Sidebar/stories/examples/components/AppMain.tsx +1 -1
- package/src/components/Sidebar/stories/examples/components/VersionSwitcher.tsx +1 -1
- package/src/components/Sonner/constants.ts +18 -18
- package/src/components/Tabs/constants.ts +2 -2
- package/src/components/Timeline/constants.ts +1 -1
- package/src/components/Toggle/Toggle.tsx +1 -1
- package/src/components/Toggle/constants.ts +50 -0
- package/src/components/Widget/Widgets.example.tsx +2 -2
- package/dist/types/components/Form/components/FormControl/FormControl.d.ts +0 -2
- package/dist/types/components/Form/components/FormControl/constants.d.ts +0 -1
- package/dist/types/components/Form/components/FormControl/index.d.ts +0 -1
- package/dist/types/components/Form/components/FormControl/types.d.ts +0 -8
- package/plugin.d.ts +0 -4
- package/plugin.js +0 -5
- package/src/components/Form/components/FormControl/FormControl.tsx +0 -21
- package/src/components/Form/components/FormControl/constants.ts +0 -3
- package/src/components/Form/components/FormControl/index.ts +0 -1
- package/src/components/Form/components/FormControl/types.ts +0 -13
|
@@ -32,11 +32,11 @@ const triggerVariant = {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
export const getMenubarClasses = cva(
|
|
35
|
-
"flex h-9 items-center space-x-1 rounded-md border bg-base-100 p-1 shadow-
|
|
35
|
+
"flex h-9 items-center space-x-1 rounded-md border bg-base-100 p-1 shadow-xs"
|
|
36
36
|
);
|
|
37
37
|
|
|
38
38
|
export const getMenubarTriggerClasses = cva(
|
|
39
|
-
"flex cursor-default select-none items-center rounded-
|
|
39
|
+
"flex cursor-default select-none items-center rounded-xs px-3 py-1 text-sm font-medium outline-hidden",
|
|
40
40
|
{
|
|
41
41
|
variants: {
|
|
42
42
|
variant: triggerVariant,
|
|
@@ -45,7 +45,7 @@ export const getMenubarTriggerClasses = cva(
|
|
|
45
45
|
);
|
|
46
46
|
|
|
47
47
|
export const getMenubarSubTriggerClasses = cva(
|
|
48
|
-
"flex cursor-default select-none items-center rounded-
|
|
48
|
+
"flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden",
|
|
49
49
|
{
|
|
50
50
|
variants: {
|
|
51
51
|
variant: triggerVariant,
|
|
@@ -65,7 +65,7 @@ export const getMenubarSubContentClasses = cva(
|
|
|
65
65
|
);
|
|
66
66
|
|
|
67
67
|
export const getMenubarItemClasses = cva(
|
|
68
|
-
"relative flex cursor-default select-none items-center rounded-
|
|
68
|
+
"relative flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
69
69
|
{
|
|
70
70
|
variants: {
|
|
71
71
|
variant: itemVariant,
|
|
@@ -77,7 +77,7 @@ export const getMenubarItemClasses = cva(
|
|
|
77
77
|
);
|
|
78
78
|
|
|
79
79
|
export const getMenubarCheckboxItemClasses = cva(
|
|
80
|
-
"relative flex cursor-default select-none items-center rounded-
|
|
80
|
+
"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
81
81
|
{
|
|
82
82
|
variants: {
|
|
83
83
|
variant: itemVariant,
|
|
@@ -86,7 +86,7 @@ export const getMenubarCheckboxItemClasses = cva(
|
|
|
86
86
|
);
|
|
87
87
|
|
|
88
88
|
export const getMenubarRadioItemClasses = cva(
|
|
89
|
-
"relative flex cursor-default select-none items-center rounded-
|
|
89
|
+
"relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
90
90
|
{
|
|
91
91
|
variants: {
|
|
92
92
|
variant: itemVariant,
|
|
@@ -9,26 +9,26 @@ export const getNavigationMenuListClasses = cva(
|
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
export const getNavigationMenuTriggerClasses = cva(
|
|
12
|
-
"group inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:outline-
|
|
12
|
+
"group inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors focus:outline-hidden disabled:pointer-events-none disabled:opacity-50",
|
|
13
13
|
{
|
|
14
14
|
variants: {
|
|
15
15
|
variant: {
|
|
16
16
|
primary:
|
|
17
|
-
"hover:bg-primary hover:text-primary-content focus:bg-primary focus:text-primary-content data-
|
|
17
|
+
"hover:bg-primary hover:text-primary-content focus:bg-primary focus:text-primary-content data-active:bg-primary/50 data-[state=open]:bg-primary/50",
|
|
18
18
|
secondary:
|
|
19
|
-
"hover:bg-secondary hover:text-secondary-content focus:bg-secondary focus:text-secondary-content data-
|
|
19
|
+
"hover:bg-secondary hover:text-secondary-content focus:bg-secondary focus:text-secondary-content data-active:bg-secondary/50 data-[state=open]:bg-secondary/50",
|
|
20
20
|
accent:
|
|
21
|
-
"hover:bg-accent hover:text-accent-content focus:bg-accent focus:text-accent-content data-
|
|
21
|
+
"hover:bg-accent hover:text-accent-content focus:bg-accent focus:text-accent-content data-active:bg-accent/50 data-[state=open]:bg-accent/50",
|
|
22
22
|
neutral:
|
|
23
|
-
"hover:bg-neutral hover:text-neutral-content focus:bg-neutral focus:text-neutral-content data-
|
|
24
|
-
base: "hover:bg-base-300 hover:text-base-content focus:bg-base-300 focus:text-base-content data-
|
|
25
|
-
info: "hover:bg-info hover:text-info-content focus:bg-info focus:text-info-content data-
|
|
23
|
+
"hover:bg-neutral hover:text-neutral-content focus:bg-neutral focus:text-neutral-content data-active:bg-neutral/50 data-[state=open]:bg-neutral/50",
|
|
24
|
+
base: "hover:bg-base-300 hover:text-base-content focus:bg-base-300 focus:text-base-content data-active:bg-base-300/50 data-[state=open]:bg-base-300/50",
|
|
25
|
+
info: "hover:bg-info hover:text-info-content focus:bg-info focus:text-info-content data-active:bg-info/50 data-[state=open]:bg-info/50",
|
|
26
26
|
success:
|
|
27
|
-
"hover:bg-success hover:text-success-content focus:bg-success focus:text-success-content data-
|
|
27
|
+
"hover:bg-success hover:text-success-content focus:bg-success focus:text-success-content data-active:bg-success/50 data-[state=open]:bg-success/50",
|
|
28
28
|
warning:
|
|
29
|
-
"hover:bg-warning hover:text-warning-content focus:bg-warning focus:text-warning-content data-
|
|
29
|
+
"hover:bg-warning hover:text-warning-content focus:bg-warning focus:text-warning-content data-active:bg-warning/50 data-[state=open]:bg-warning/50",
|
|
30
30
|
error:
|
|
31
|
-
"hover:bg-error hover:text-error-content focus:bg-error focus:text-error-content data-
|
|
31
|
+
"hover:bg-error hover:text-error-content focus:bg-error focus:text-error-content data-active:bg-error/50 data-[state=open]:bg-error/50",
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
}
|
|
@@ -39,9 +39,9 @@ export const getNavigationMenuContentClasses = cva(
|
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
export const getNavigationMenuViewportClasses = cva(
|
|
42
|
-
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-base-100 shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]"
|
|
42
|
+
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-base-100 shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]"
|
|
43
43
|
);
|
|
44
44
|
|
|
45
45
|
export const getNavigationMenuIndicatorClasses = cva(
|
|
46
|
-
"top-full z-
|
|
46
|
+
"top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in"
|
|
47
47
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from "../../libs";
|
|
2
2
|
|
|
3
3
|
export const getPopoverContentClasses = cva(
|
|
4
|
-
"z-50 w-72 rounded-md border bg-base-100 p-4 shadow-md outline-
|
|
4
|
+
"z-50 w-72 rounded-md border bg-base-100 p-4 shadow-md outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
|
|
5
5
|
);
|
|
@@ -144,7 +144,7 @@ const SidebarMenuSkeleton = forwardRef<HTMLDivElement, SidebarMenuSkeletonProps>
|
|
|
144
144
|
<Skeleton width={4} height={4} className="rounded-md" data-sidebar="menu-skeleton-icon" />
|
|
145
145
|
)}
|
|
146
146
|
<Skeleton
|
|
147
|
-
className="h-4 flex-1 max-w-
|
|
147
|
+
className="h-4 flex-1 max-w-(--skeleton-width)"
|
|
148
148
|
data-sidebar="menu-skeleton-text"
|
|
149
149
|
style={
|
|
150
150
|
{
|
|
@@ -15,7 +15,7 @@ export const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
|
15
15
|
export const getSidebarClasses = cva([], {
|
|
16
16
|
variants: {
|
|
17
17
|
collapsible: {
|
|
18
|
-
none: "flex h-full w-
|
|
18
|
+
none: "flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
});
|
|
@@ -23,9 +23,9 @@ export const getSidebarClasses = cva([], {
|
|
|
23
23
|
export const getSidebarMobileClasses = cva([], {
|
|
24
24
|
variants: {
|
|
25
25
|
isMobile: {
|
|
26
|
-
true: "w-
|
|
26
|
+
true: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
|
|
27
27
|
false:
|
|
28
|
-
"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",
|
|
28
|
+
"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
});
|
|
@@ -33,7 +33,7 @@ export const getSidebarMobileClasses = cva([], {
|
|
|
33
33
|
export const getSidebarOuterClasses = cva("group peer hidden md:block text-sidebar-foreground");
|
|
34
34
|
|
|
35
35
|
export const getSidebarInnerClasses = cva(
|
|
36
|
-
"duration-200 fixed inset-y-0 z-10 hidden h-svh w-
|
|
36
|
+
"duration-200 fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] ease-linear md:flex",
|
|
37
37
|
{
|
|
38
38
|
variants: {
|
|
39
39
|
side: {
|
|
@@ -42,11 +42,11 @@ export const getSidebarInnerClasses = cva(
|
|
|
42
42
|
},
|
|
43
43
|
variant: {
|
|
44
44
|
floating:
|
|
45
|
-
"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)
|
|
45
|
+
"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]",
|
|
46
46
|
inset:
|
|
47
|
-
"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)
|
|
47
|
+
"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]",
|
|
48
48
|
sidebar:
|
|
49
|
-
"group-data-[collapsible=icon]:w-
|
|
49
|
+
"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
52
|
}
|
|
@@ -54,7 +54,7 @@ export const getSidebarInnerClasses = cva(
|
|
|
54
54
|
|
|
55
55
|
export const getSidebarGapClasses = cva(
|
|
56
56
|
[
|
|
57
|
-
"duration-200 relative h-svh w-
|
|
57
|
+
"duration-200 relative h-svh w-(--sidebar-width) bg-transparent transition-[width] ease-linear",
|
|
58
58
|
"group-data-[collapsible=offcanvas]:w-0",
|
|
59
59
|
"group-data-[side=right]:rotate-180",
|
|
60
60
|
],
|
|
@@ -62,16 +62,16 @@ export const getSidebarGapClasses = cva(
|
|
|
62
62
|
variants: {
|
|
63
63
|
variant: {
|
|
64
64
|
floating:
|
|
65
|
-
"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)
|
|
65
|
+
"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]",
|
|
66
66
|
inset:
|
|
67
|
-
"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)
|
|
68
|
-
sidebar: "group-data-[collapsible=icon]:w-
|
|
67
|
+
"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]",
|
|
68
|
+
sidebar: "group-data-[collapsible=icon]:w-(--sidebar-width-icon)",
|
|
69
69
|
},
|
|
70
70
|
},
|
|
71
71
|
compoundVariants: [
|
|
72
72
|
{
|
|
73
73
|
variant: null,
|
|
74
|
-
className: "group-data-[collapsible=icon]:w-
|
|
74
|
+
className: "group-data-[collapsible=icon]:w-(--sidebar-width-icon)",
|
|
75
75
|
},
|
|
76
76
|
],
|
|
77
77
|
}
|
|
@@ -81,16 +81,16 @@ export const getSidebarTriggerClasses = cva("h-7 w-7 p-0");
|
|
|
81
81
|
|
|
82
82
|
export const getSidebarRailClasses = cva([
|
|
83
83
|
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
|
|
84
|
-
"
|
|
84
|
+
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
85
85
|
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
86
|
-
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:
|
|
86
|
+
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar",
|
|
87
87
|
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
88
88
|
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
89
89
|
]);
|
|
90
90
|
|
|
91
91
|
export const getSidebarInsetClasses = cva([
|
|
92
92
|
"relative flex min-h-svh flex-1 flex-col bg-background",
|
|
93
|
-
"peer-data-[variant=inset]:min-h-[calc(100svh-
|
|
93
|
+
"peer-data-[variant=inset]:min-h-[calc(100svh-(--spacing(4)))] md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",
|
|
94
94
|
]);
|
|
95
95
|
|
|
96
96
|
// TODO
|
|
@@ -109,20 +109,20 @@ export const getSidebarContentClasses = cva(
|
|
|
109
109
|
);
|
|
110
110
|
|
|
111
111
|
export const getSidebarProviderClasses = cva(
|
|
112
|
-
"group/sidebar-wrapper flex min-h-svh w-full has-
|
|
112
|
+
"group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar"
|
|
113
113
|
);
|
|
114
114
|
|
|
115
115
|
export const getSidebarGroupClasses = cva("relative flex w-full min-w-0 flex-col p-2");
|
|
116
116
|
|
|
117
117
|
export const getSidebarGroupLabelClasses = cva([
|
|
118
|
-
"duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-
|
|
118
|
+
"duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-hidden ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
119
119
|
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
120
120
|
]);
|
|
121
121
|
|
|
122
122
|
export const getSidebarGroupActionClasses = cva([
|
|
123
|
-
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-
|
|
123
|
+
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
124
124
|
// Increases the hit area of the button on mobile.
|
|
125
|
-
"after:absolute after:-inset-2 after:
|
|
125
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
126
126
|
"group-data-[collapsible=icon]:hidden",
|
|
127
127
|
]);
|
|
128
128
|
|
|
@@ -133,7 +133,7 @@ export const getSidebarMenuClasses = cva("flex w-full min-w-0 flex-col gap-1");
|
|
|
133
133
|
export const getSidebarMenuItemClasses = cva("group/menu-item relative");
|
|
134
134
|
|
|
135
135
|
export const getSidebarMenuButtonClasses = cva(
|
|
136
|
-
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-
|
|
136
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] 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 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
137
137
|
{
|
|
138
138
|
variants: {
|
|
139
139
|
variant: {
|
|
@@ -144,7 +144,7 @@ export const getSidebarMenuButtonClasses = cva(
|
|
|
144
144
|
size: {
|
|
145
145
|
default: "h-8 text-sm",
|
|
146
146
|
sm: "h-7 text-xs",
|
|
147
|
-
lg: "h-12 text-sm group-data-[collapsible=icon]
|
|
147
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
|
|
148
148
|
},
|
|
149
149
|
},
|
|
150
150
|
defaultVariants: {
|
|
@@ -156,9 +156,9 @@ export const getSidebarMenuButtonClasses = cva(
|
|
|
156
156
|
|
|
157
157
|
export const getSidebarMenuActionClasses = cva(
|
|
158
158
|
[
|
|
159
|
-
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-
|
|
159
|
+
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-hidden ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
|
|
160
160
|
// Increases the hit area of the button on mobile.
|
|
161
|
-
"after:absolute after:-inset-2 after:
|
|
161
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
162
162
|
"peer-data-[size=sm]/menu-button:top-1",
|
|
163
163
|
"peer-data-[size=default]/menu-button:top-1.5",
|
|
164
164
|
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
@@ -191,7 +191,7 @@ export const getSidebarMenuSubClasses = cva([
|
|
|
191
191
|
|
|
192
192
|
export const getSidebarMenuSubItemClasses = cva(
|
|
193
193
|
[
|
|
194
|
-
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-
|
|
194
|
+
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-hidden ring-sidebar-ring 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 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
|
|
195
195
|
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
196
196
|
"group-data-[collapsible=icon]:hidden",
|
|
197
197
|
],
|
|
@@ -20,7 +20,7 @@ export const AppMain = ({
|
|
|
20
20
|
<Breadcrumb.Page>Data Fetching</Breadcrumb.Page>
|
|
21
21
|
</Breadcrumb.List>
|
|
22
22
|
</Breadcrumb>
|
|
23
|
-
{side === "right" ? <Sidebar.Trigger className="-mr-1 ml-auto
|
|
23
|
+
{side === "right" ? <Sidebar.Trigger className="-mr-1 ml-auto rotate-180!" /> : null}
|
|
24
24
|
</header>
|
|
25
25
|
<div className="flex flex-1 flex-col gap-4 p-4">
|
|
26
26
|
<div className="grid auto-rows-min gap-4 md:grid-cols-3">
|
|
@@ -31,7 +31,7 @@ export const VersionSwitcher = ({
|
|
|
31
31
|
<ChevronsUpDown className="ml-auto" />
|
|
32
32
|
</SidebarMenu.Button>
|
|
33
33
|
</DropdownMenu.Trigger>
|
|
34
|
-
<DropdownMenu.Content className="w-
|
|
34
|
+
<DropdownMenu.Content className="w-(--radix-dropdown-menu-trigger-width)" align="start">
|
|
35
35
|
{versions.map((version) => (
|
|
36
36
|
<DropdownMenu.Item key={version} onSelect={() => setSelectedVersion(version)}>
|
|
37
37
|
v{version} {version === selectedVersion && <Check className="ml-auto" />}
|
|
@@ -38,60 +38,60 @@ export const getToastClasses = cva("sonner group", {
|
|
|
38
38
|
export const getToastButtonClasses = cva("", {
|
|
39
39
|
variants: {
|
|
40
40
|
variant: {
|
|
41
|
-
base: "group-[.sonner]
|
|
42
|
-
accent: "group-[.sonner]
|
|
43
|
-
error: "group-[.sonner]
|
|
44
|
-
info: "group-[.sonner]
|
|
45
|
-
neutral: "group-[.sonner]
|
|
46
|
-
primary: "group-[.sonner]
|
|
47
|
-
secondary: "group-[.sonner]
|
|
48
|
-
success: "group-[.sonner]
|
|
49
|
-
warning: "group-[.sonner]
|
|
41
|
+
base: "group-[.sonner]:bg-base-300! group-[.sonner]:text-base-content!",
|
|
42
|
+
accent: "group-[.sonner]:bg-accent! group-[.sonner]:text-accent-content!",
|
|
43
|
+
error: "group-[.sonner]:bg-error! group-[.sonner]:text-error-content!",
|
|
44
|
+
info: "group-[.sonner]:bg-info! group-[.sonner]:text-info-content!",
|
|
45
|
+
neutral: "group-[.sonner]:bg-neutral! group-[.sonner]:text-neutral-content!",
|
|
46
|
+
primary: "group-[.sonner]:bg-primary! group-[.sonner]:text-primary-content!",
|
|
47
|
+
secondary: "group-[.sonner]:bg-secondary! group-[.sonner]:text-secondary-content!",
|
|
48
|
+
success: "group-[.sonner]:bg-success! group-[.sonner]:text-success-content!",
|
|
49
|
+
warning: "group-[.sonner]:bg-warning! group-[.sonner]:text-warning-content!",
|
|
50
50
|
},
|
|
51
51
|
outline: {
|
|
52
|
-
true: "group-[.sonner]
|
|
52
|
+
true: "group-[.sonner]:border! group-[.sonner]:border-solid! group-[.sonner]:bg-transparent!",
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
compoundVariants: [
|
|
56
56
|
{
|
|
57
57
|
outline: true,
|
|
58
58
|
variant: "accent",
|
|
59
|
-
className: "group-[.sonner]
|
|
59
|
+
className: "group-[.sonner]:border-accent! group-[.sonner]:text-accent!",
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
outline: true,
|
|
63
63
|
variant: "error",
|
|
64
|
-
className: "group-[.sonner]
|
|
64
|
+
className: "group-[.sonner]:border-error! group-[.sonner]:text-error!",
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
outline: true,
|
|
68
68
|
variant: "info",
|
|
69
|
-
className: "group-[.sonner]
|
|
69
|
+
className: "group-[.sonner]:text-info!",
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
outline: true,
|
|
73
73
|
variant: "neutral",
|
|
74
|
-
className: "group-[.sonner]
|
|
74
|
+
className: "group-[.sonner]:border-neutral! group-[.sonner]:text-neutral!",
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
outline: true,
|
|
78
78
|
variant: "primary",
|
|
79
|
-
className: "group-[.sonner]
|
|
79
|
+
className: "group-[.sonner]:border-primary! group-[.sonner]:text-primary!",
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
outline: true,
|
|
83
83
|
variant: "secondary",
|
|
84
|
-
className: "group-[.sonner]
|
|
84
|
+
className: "group-[.sonner]:border-secondary! group-[.sonner]:text-secondary!",
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
outline: true,
|
|
88
88
|
variant: "success",
|
|
89
|
-
className: "group-[.sonner]
|
|
89
|
+
className: "group-[.sonner]:border-success! group-[.sonner]:text-success!",
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
outline: true,
|
|
93
93
|
variant: "warning",
|
|
94
|
-
className: "group-[.sonner]
|
|
94
|
+
className: "group-[.sonner]:border-warning! group-[.sonner]:text-warning!",
|
|
95
95
|
},
|
|
96
96
|
],
|
|
97
97
|
});
|
|
@@ -5,9 +5,9 @@ export const getTabsListClasses = cva(
|
|
|
5
5
|
);
|
|
6
6
|
|
|
7
7
|
export const getTabsTriggerClasses = cva(
|
|
8
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-
|
|
8
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-base-100 data-[state=active]:text-foreground data-[state=active]:shadow-sm"
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
export const getTabsContentClasses = cva(
|
|
12
|
-
"mt-2 ring-offset-background focus-visible:outline-
|
|
12
|
+
"mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
13
13
|
);
|
|
@@ -34,7 +34,7 @@ export const getTimelineDotClasses = cva(
|
|
|
34
34
|
{
|
|
35
35
|
variants: {
|
|
36
36
|
status: {
|
|
37
|
-
default: "
|
|
37
|
+
default: "*:hidden",
|
|
38
38
|
active: "[&>*:not(.lucide-circle)]:hidden",
|
|
39
39
|
success: "[&>*:not(.lucide-check)]:hidden",
|
|
40
40
|
failed: "[&>*:not(.lucide-x)]:hidden",
|
|
@@ -13,7 +13,7 @@ const Toggle = React.forwardRef<React.ElementRef<typeof TogglePrimitive.Root>, T
|
|
|
13
13
|
ref={ref}
|
|
14
14
|
className={cn(
|
|
15
15
|
getButtonClasses({ size, wide, outline }),
|
|
16
|
-
getToggleClasses({ variant }),
|
|
16
|
+
getToggleClasses({ variant, outline }),
|
|
17
17
|
className
|
|
18
18
|
)}
|
|
19
19
|
{...props}
|
|
@@ -16,6 +16,56 @@ export const getToggleClasses = cva(
|
|
|
16
16
|
success: "data-[state=on]:btn-success",
|
|
17
17
|
warning: "data-[state=on]:btn-warning",
|
|
18
18
|
},
|
|
19
|
+
outline: {
|
|
20
|
+
true: "data-[state=on]:btn-outline",
|
|
21
|
+
},
|
|
19
22
|
},
|
|
23
|
+
compoundVariants: [
|
|
24
|
+
{
|
|
25
|
+
outline: true,
|
|
26
|
+
variant: "accent",
|
|
27
|
+
className: "data-[state=on]:border-accent",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
outline: true,
|
|
31
|
+
variant: "default",
|
|
32
|
+
className: "data-[state=on]:border-default",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
outline: true,
|
|
36
|
+
variant: "error",
|
|
37
|
+
className: "data-[state=on]:border-error",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
outline: true,
|
|
41
|
+
variant: "info",
|
|
42
|
+
className: "data-[state=on]:border-info",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
outline: true,
|
|
46
|
+
variant: "neutral",
|
|
47
|
+
className: "data-[state=on]:border-neutral",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
outline: true,
|
|
51
|
+
variant: "primary",
|
|
52
|
+
className: "data-[state=on]:border-primary",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
outline: true,
|
|
56
|
+
variant: "secondary",
|
|
57
|
+
className: "data-[state=on]:border-secondary",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
outline: true,
|
|
61
|
+
variant: "success",
|
|
62
|
+
className: "data-[state=on]:border-success",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
outline: true,
|
|
66
|
+
variant: "warning",
|
|
67
|
+
className: "data-[state=on]:border-warning",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
20
70
|
}
|
|
21
71
|
);
|
|
@@ -89,7 +89,7 @@ const Widgets = () => {
|
|
|
89
89
|
key={widget.id}
|
|
90
90
|
id={widget.id}
|
|
91
91
|
actions={({ draggable, deleteWidget }) => (
|
|
92
|
-
<div className="absolute top-1 right-1 opacity-0 flex gap-1
|
|
92
|
+
<div className="absolute top-1 right-1 opacity-0 flex gap-1 *:cursor-pointer [&_svg]:size-4 pointer-events-none transition-opacity duration-300 hover:opacity-100 group-hover:pointer-events-auto">
|
|
93
93
|
<Draggable.Action
|
|
94
94
|
ref={draggable?.ref}
|
|
95
95
|
{...draggable?.listeners}
|
|
@@ -107,7 +107,7 @@ const Widgets = () => {
|
|
|
107
107
|
</Draggable.Action>
|
|
108
108
|
</div>
|
|
109
109
|
)}
|
|
110
|
-
className="group flex items-center justify-center w-32 h-32 bg-base-100 border border-primary-content/30 rounded-md text-sm p-2 cursor-default data-
|
|
110
|
+
className="group flex items-center justify-center w-32 h-32 bg-base-100 border border-primary-content/30 rounded-md text-sm p-2 cursor-default data-draggable:shadow-sm data-draggable-active:z-20"
|
|
111
111
|
>
|
|
112
112
|
{widget.id}
|
|
113
113
|
</Widget>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getFormControlClasses: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FormControl } from './FormControl';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { VariantProps } from '../../../../libs';
|
|
2
|
-
import { getFormControlClasses } from './constants';
|
|
3
|
-
export type As = "div" | "span" | "label";
|
|
4
|
-
type AllowedElements = Pick<React.JSX.IntrinsicElements, As>;
|
|
5
|
-
export type FormControlProps<T extends As> = (T extends "label" ? React.LabelHTMLAttributes<HTMLLabelElement> : React.HTMLAttributes<HTMLElement & AllowedElements[T]>) & VariantProps<typeof getFormControlClasses> & {
|
|
6
|
-
as?: T;
|
|
7
|
-
};
|
|
8
|
-
export {};
|
package/plugin.d.ts
DELETED
package/plugin.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
-
import type { As, FormControlProps } from "./types";
|
|
3
|
-
import { cn } from "../../../../utilities";
|
|
4
|
-
import { Label } from "../Label";
|
|
5
|
-
import { getFormControlClasses } from "./constants";
|
|
6
|
-
|
|
7
|
-
export const FormControl = <T extends As>({
|
|
8
|
-
as,
|
|
9
|
-
children,
|
|
10
|
-
className,
|
|
11
|
-
...props
|
|
12
|
-
}: FormControlProps<T>) => {
|
|
13
|
-
const SlotChild = !as || as === "label" ? Label : as;
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Slot className={cn(getFormControlClasses(), className)} {...props}>
|
|
17
|
-
{/* slot merges it's prop into it's immediate child */}
|
|
18
|
-
<SlotChild>{children}</SlotChild>
|
|
19
|
-
</Slot>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FormControl } from "./FormControl";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type VariantProps } from "../../../../libs";
|
|
2
|
-
import { getFormControlClasses } from "./constants";
|
|
3
|
-
|
|
4
|
-
export type As = "div" | "span" | "label";
|
|
5
|
-
|
|
6
|
-
type AllowedElements = Pick<React.JSX.IntrinsicElements, As>;
|
|
7
|
-
|
|
8
|
-
export type FormControlProps<T extends As> = (T extends "label"
|
|
9
|
-
? React.LabelHTMLAttributes<HTMLLabelElement>
|
|
10
|
-
: React.HTMLAttributes<HTMLElement & AllowedElements[T]>) &
|
|
11
|
-
VariantProps<typeof getFormControlClasses> & {
|
|
12
|
-
as?: T;
|
|
13
|
-
};
|