gladvn 0.2.19 → 0.2.20
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/bin/cli.js +15 -5
- package/dist/components/macro/accordion-preset.d.ts.map +1 -1
- package/dist/components/macro/alert-dialog-preset.d.ts.map +1 -1
- package/dist/components/macro/alert-preset.d.ts.map +1 -1
- package/dist/components/macro/avatar-preset.d.ts.map +1 -1
- package/dist/components/macro/breadcrumb-preset.d.ts.map +1 -1
- package/dist/components/macro/card-preset.d.ts.map +1 -1
- package/dist/components/macro/carousel-preset.d.ts.map +1 -1
- package/dist/components/macro/checkbox-preset.d.ts.map +1 -1
- package/dist/components/macro/combobox-preset.d.ts.map +1 -1
- package/dist/components/macro/command-preset.d.ts +1 -1
- package/dist/components/macro/command-preset.d.ts.map +1 -1
- package/dist/components/macro/date-picker.d.ts.map +1 -1
- package/dist/components/macro/dialog-preset.d.ts.map +1 -1
- package/dist/components/macro/empty-preset.d.ts +1 -1
- package/dist/components/macro/empty-preset.d.ts.map +1 -1
- package/dist/components/macro/field-preset.d.ts.map +1 -1
- package/dist/components/macro/input-otp-preset.d.ts.map +1 -1
- package/dist/components/macro/input-preset.d.ts.map +1 -1
- package/dist/components/macro/pagination-preset.d.ts.map +1 -1
- package/dist/components/macro/progress-preset.d.ts.map +1 -1
- package/dist/components/macro/radio-group-preset.d.ts.map +1 -1
- package/dist/components/macro/select-preset.d.ts.map +1 -1
- package/dist/components/macro/slider-preset.d.ts.map +1 -1
- package/dist/components/macro/switch-preset.d.ts.map +1 -1
- package/dist/components/macro/tabs-preset.d.ts.map +1 -1
- package/dist/components/micro/alert-dialog.d.ts +4 -4
- package/dist/components/micro/alert-dialog.d.ts.map +1 -1
- package/dist/components/micro/combobox.d.ts +4 -3
- package/dist/components/micro/combobox.d.ts.map +1 -1
- package/dist/components/micro/context-menu.d.ts +4 -6
- package/dist/components/micro/context-menu.d.ts.map +1 -1
- package/dist/components/micro/dialog.d.ts +4 -3
- package/dist/components/micro/dialog.d.ts.map +1 -1
- package/dist/components/micro/drawer.d.ts +4 -3
- package/dist/components/micro/drawer.d.ts.map +1 -1
- package/dist/components/micro/dropdown-menu.d.ts +7 -4
- package/dist/components/micro/dropdown-menu.d.ts.map +1 -1
- package/dist/components/micro/hover-card.d.ts +4 -3
- package/dist/components/micro/hover-card.d.ts.map +1 -1
- package/dist/components/micro/menubar.d.ts +2 -3
- package/dist/components/micro/menubar.d.ts.map +1 -1
- package/dist/components/micro/navigation-menu.d.ts +4 -3
- package/dist/components/micro/navigation-menu.d.ts.map +1 -1
- package/dist/components/micro/popover.d.ts +4 -3
- package/dist/components/micro/popover.d.ts.map +1 -1
- package/dist/components/micro/select.d.ts +4 -3
- package/dist/components/micro/select.d.ts.map +1 -1
- package/dist/components/micro/sheet.d.ts +3 -3
- package/dist/components/micro/sheet.d.ts.map +1 -1
- package/dist/components/micro/tooltip.d.ts +4 -3
- package/dist/components/micro/tooltip.d.ts.map +1 -1
- package/dist/dev/showcase/accordion.d.ts.map +1 -1
- package/dist/dev/showcase/alert-dialog.d.ts.map +1 -1
- package/dist/dev/showcase/alert.d.ts.map +1 -1
- package/dist/dev/showcase/aspect-ratio.d.ts.map +1 -1
- package/dist/dev/showcase/avatar.d.ts.map +1 -1
- package/dist/dev/showcase/badge.d.ts.map +1 -1
- package/dist/dev/showcase/breadcrumb.d.ts.map +1 -1
- package/dist/dev/showcase/button.d.ts.map +1 -1
- package/dist/dev/showcase/calendar.d.ts.map +1 -1
- package/dist/dev/showcase/card.d.ts.map +1 -1
- package/dist/dev/showcase/carousel.d.ts.map +1 -1
- package/dist/dev/showcase/chart.d.ts.map +1 -1
- package/dist/dev/showcase/checkbox.d.ts.map +1 -1
- package/dist/dev/showcase/collapsible.d.ts.map +1 -1
- package/dist/dev/showcase/combobox.d.ts.map +1 -1
- package/dist/dev/showcase/command.d.ts.map +1 -1
- package/dist/dev/showcase/context-menu.d.ts.map +1 -1
- package/dist/dev/showcase/dialog.d.ts.map +1 -1
- package/dist/dev/showcase/drawer.d.ts.map +1 -1
- package/dist/dev/showcase/dropdown-menu.d.ts.map +1 -1
- package/dist/dev/showcase/empty.d.ts.map +1 -1
- package/dist/dev/showcase/hover-card.d.ts.map +1 -1
- package/dist/dev/showcase/input-group.d.ts.map +1 -1
- package/dist/dev/showcase/input-otp.d.ts.map +1 -1
- package/dist/dev/showcase/input.d.ts.map +1 -1
- package/dist/dev/showcase/item.d.ts.map +1 -1
- package/dist/dev/showcase/kbd.d.ts.map +1 -1
- package/dist/dev/showcase/label.d.ts.map +1 -1
- package/dist/dev/showcase/menubar.d.ts.map +1 -1
- package/dist/dev/showcase/navigation-menu.d.ts.map +1 -1
- package/dist/dev/showcase/overview.d.ts.map +1 -1
- package/dist/dev/showcase/pagination.d.ts.map +1 -1
- package/dist/dev/showcase/popover.d.ts.map +1 -1
- package/dist/dev/showcase/progress.d.ts.map +1 -1
- package/dist/dev/showcase/radio-group.d.ts.map +1 -1
- package/dist/dev/showcase/resizable.d.ts.map +1 -1
- package/dist/dev/showcase/scroll-area.d.ts.map +1 -1
- package/dist/dev/showcase/select.d.ts.map +1 -1
- package/dist/dev/showcase/separator.d.ts.map +1 -1
- package/dist/dev/showcase/sheet.d.ts.map +1 -1
- package/dist/dev/showcase/sidebar.d.ts.map +1 -1
- package/dist/dev/showcase/skeleton.d.ts.map +1 -1
- package/dist/dev/showcase/slider.d.ts.map +1 -1
- package/dist/dev/showcase/sonner.d.ts.map +1 -1
- package/dist/dev/showcase/spinner.d.ts.map +1 -1
- package/dist/dev/showcase/switch.d.ts.map +1 -1
- package/dist/dev/showcase/table.d.ts.map +1 -1
- package/dist/dev/showcase/tabs.d.ts.map +1 -1
- package/dist/dev/showcase/textarea.d.ts.map +1 -1
- package/dist/dev/showcase/theme-provider.d.ts.map +1 -1
- package/dist/dev/showcase/toast.d.ts.map +1 -1
- package/dist/dev/showcase/toggle-group.d.ts.map +1 -1
- package/dist/dev/showcase/toggle.d.ts.map +1 -1
- package/dist/dev/showcase/tooltip.d.ts.map +1 -1
- package/dist/index.cjs +256 -256
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +257 -244
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/macro/accordion-preset.test.tsx +1 -2
- package/src/components/macro/accordion-preset.tsx +1 -2
- package/src/components/macro/alert-dialog-preset.tsx +7 -12
- package/src/components/macro/alert-preset.tsx +1 -2
- package/src/components/macro/avatar-preset.tsx +2 -4
- package/src/components/macro/breadcrumb-preset.tsx +1 -2
- package/src/components/macro/card-preset.tsx +1 -2
- package/src/components/macro/carousel-preset.tsx +1 -2
- package/src/components/macro/checkbox-preset.tsx +1 -2
- package/src/components/macro/combobox-preset.tsx +8 -14
- package/src/components/macro/command-preset.tsx +18 -24
- package/src/components/macro/date-picker.tsx +14 -23
- package/src/components/macro/dialog-preset.tsx +45 -49
- package/src/components/macro/empty-preset.tsx +2 -4
- package/src/components/macro/field-preset.tsx +1 -2
- package/src/components/macro/input-otp-preset.tsx +1 -2
- package/src/components/macro/input-preset.tsx +1 -2
- package/src/components/macro/pagination-preset.tsx +3 -6
- package/src/components/macro/progress-preset.tsx +1 -2
- package/src/components/macro/radio-group-preset.tsx +2 -4
- package/src/components/macro/select-preset.tsx +7 -12
- package/src/components/macro/slider-preset.tsx +1 -2
- package/src/components/macro/switch-preset.tsx +1 -2
- package/src/components/macro/tabs-preset.tsx +1 -2
- package/src/components/micro/alert-dialog.tsx +16 -14
- package/src/components/micro/combobox.tsx +28 -22
- package/src/components/micro/context-menu.tsx +52 -36
- package/src/components/micro/dialog.tsx +23 -19
- package/src/components/micro/drawer.tsx +23 -19
- package/src/components/micro/dropdown-menu.tsx +23 -18
- package/src/components/micro/hover-card.tsx +31 -23
- package/src/components/micro/menubar.tsx +0 -8
- package/src/components/micro/navigation-menu.tsx +26 -19
- package/src/components/micro/popover.tsx +31 -25
- package/src/components/micro/select.tsx +36 -29
- package/src/components/micro/sheet.tsx +36 -31
- package/src/components/micro/tooltip.tsx +28 -23
- package/src/dev/showcase/accordion.tsx +47 -94
- package/src/dev/showcase/alert-dialog.tsx +27 -39
- package/src/dev/showcase/alert.tsx +5 -10
- package/src/dev/showcase/aspect-ratio.tsx +1 -2
- package/src/dev/showcase/avatar.tsx +5 -10
- package/src/dev/showcase/badge.tsx +2 -4
- package/src/dev/showcase/breadcrumb.tsx +8 -11
- package/src/dev/showcase/button.tsx +2 -4
- package/src/dev/showcase/calendar.tsx +5 -10
- package/src/dev/showcase/card.tsx +4 -8
- package/src/dev/showcase/carousel.tsx +40 -80
- package/src/dev/showcase/chart.tsx +7 -16
- package/src/dev/showcase/checkbox.tsx +7 -14
- package/src/dev/showcase/collapsible.tsx +3 -6
- package/src/dev/showcase/combobox.tsx +27 -43
- package/src/dev/showcase/command.tsx +4 -8
- package/src/dev/showcase/context-menu.tsx +13 -19
- package/src/dev/showcase/dialog.tsx +19 -33
- package/src/dev/showcase/drawer.tsx +19 -27
- package/src/dev/showcase/dropdown-menu.tsx +19 -29
- package/src/dev/showcase/empty.tsx +3 -6
- package/src/dev/showcase/hover-card.tsx +24 -36
- package/src/dev/showcase/input-group.tsx +4 -8
- package/src/dev/showcase/input-otp.tsx +5 -10
- package/src/dev/showcase/input.tsx +5 -10
- package/src/dev/showcase/item.tsx +3 -6
- package/src/dev/showcase/kbd.tsx +12 -16
- package/src/dev/showcase/label.tsx +2 -4
- package/src/dev/showcase/menubar.tsx +17 -19
- package/src/dev/showcase/navigation-menu.tsx +12 -15
- package/src/dev/showcase/overview.tsx +14 -27
- package/src/dev/showcase/pagination.tsx +4 -8
- package/src/dev/showcase/popover.tsx +21 -27
- package/src/dev/showcase/progress.tsx +4 -8
- package/src/dev/showcase/radio-group.tsx +8 -16
- package/src/dev/showcase/resizable.tsx +2 -4
- package/src/dev/showcase/scroll-area.tsx +1 -2
- package/src/dev/showcase/select.tsx +27 -39
- package/src/dev/showcase/separator.tsx +1 -2
- package/src/dev/showcase/sheet.tsx +22 -33
- package/src/dev/showcase/sidebar.tsx +2 -4
- package/src/dev/showcase/skeleton.tsx +1 -2
- package/src/dev/showcase/slider.tsx +5 -10
- package/src/dev/showcase/sonner.tsx +18 -38
- package/src/dev/showcase/spinner.tsx +2 -4
- package/src/dev/showcase/switch.tsx +6 -12
- package/src/dev/showcase/table.tsx +3 -6
- package/src/dev/showcase/tabs.tsx +20 -40
- package/src/dev/showcase/textarea.tsx +5 -10
- package/src/dev/showcase/theme-provider.tsx +384 -545
- package/src/dev/showcase/toast.tsx +4 -10
- package/src/dev/showcase/toggle-group.tsx +4 -8
- package/src/dev/showcase/toggle.tsx +2 -4
- package/src/dev/showcase/tooltip.tsx +34 -43
package/package.json
CHANGED
|
@@ -11,11 +11,9 @@ import {
|
|
|
11
11
|
AlertDialogFooter,
|
|
12
12
|
AlertDialogHeader,
|
|
13
13
|
AlertDialogMedia,
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
AlertDialogTitle,
|
|
16
|
-
AlertDialogTrigger
|
|
17
|
-
} from "../../components/micro/alert-dialog";
|
|
18
|
-
import { ThemeWrapper } from "../../components/micro/theme-provider";
|
|
16
|
+
AlertDialogTrigger } from "../../components/micro/alert-dialog";
|
|
19
17
|
import { type Color, type Size, type Variant } from "../../lib/types";
|
|
20
18
|
import { cn } from "../../lib/utils";
|
|
21
19
|
|
|
@@ -59,13 +57,11 @@ function AlertDialogPreset({
|
|
|
59
57
|
return (
|
|
60
58
|
<AlertDialog {...props}>
|
|
61
59
|
{trigger && <AlertDialogTrigger render={trigger} />}
|
|
62
|
-
|
|
63
|
-
<
|
|
64
|
-
<AlertDialogContent size={size}>
|
|
60
|
+
|
|
61
|
+
<AlertDialogContent size={size}>
|
|
65
62
|
<div
|
|
66
63
|
className={cn("flex flex-col gap-1.5", {
|
|
67
|
-
"sm:flex-row sm:gap-4": !!icon
|
|
68
|
-
})}
|
|
64
|
+
"sm:flex-row sm:gap-4": !!icon })}
|
|
69
65
|
>
|
|
70
66
|
{icon && (
|
|
71
67
|
<AlertDialogMedia className="mx-auto mb-2 shrink-0 sm:mx-0 sm:mb-0">
|
|
@@ -104,9 +100,8 @@ function AlertDialogPreset({
|
|
|
104
100
|
)}
|
|
105
101
|
</AlertDialogFooter>
|
|
106
102
|
)}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
</AlertDialogPortal>
|
|
103
|
+
</AlertDialogContent>
|
|
104
|
+
|
|
110
105
|
</AlertDialog>
|
|
111
106
|
);
|
|
112
107
|
}
|
|
@@ -10,8 +10,7 @@ import {
|
|
|
10
10
|
AlertDescription,
|
|
11
11
|
AlertIcon,
|
|
12
12
|
type AlertProps,
|
|
13
|
-
AlertTitle
|
|
14
|
-
} from "../../components/micro/alert";
|
|
13
|
+
AlertTitle } from "../../components/micro/alert";
|
|
15
14
|
import { Button } from "../../components/micro/button";
|
|
16
15
|
import { cn } from "../../lib/utils";
|
|
17
16
|
|
|
@@ -4,8 +4,7 @@ import {
|
|
|
4
4
|
Avatar,
|
|
5
5
|
AvatarBadge,
|
|
6
6
|
AvatarFallback,
|
|
7
|
-
AvatarImage
|
|
8
|
-
} from "../../components/micro/avatar";
|
|
7
|
+
AvatarImage } from "../../components/micro/avatar";
|
|
9
8
|
|
|
10
9
|
export type AvatarPresetProps = React.ComponentProps<typeof Avatar> & {
|
|
11
10
|
src?: string;
|
|
@@ -18,8 +17,7 @@ const statusColors = {
|
|
|
18
17
|
online: "bg-success",
|
|
19
18
|
away: "bg-warning",
|
|
20
19
|
busy: "bg-destructive",
|
|
21
|
-
offline: "bg-muted-foreground/50"
|
|
22
|
-
};
|
|
20
|
+
offline: "bg-muted-foreground/50" };
|
|
23
21
|
|
|
24
22
|
function getInitials(name: string) {
|
|
25
23
|
const parts = name.split(" ").filter(Boolean);
|
|
@@ -6,8 +6,7 @@ import {
|
|
|
6
6
|
BreadcrumbLink,
|
|
7
7
|
BreadcrumbList,
|
|
8
8
|
BreadcrumbPage,
|
|
9
|
-
BreadcrumbSeparator
|
|
10
|
-
} from "../../components/micro/breadcrumb";
|
|
9
|
+
BreadcrumbSeparator } from "../../components/micro/breadcrumb";
|
|
11
10
|
|
|
12
11
|
export interface BreadcrumbPresetItem {
|
|
13
12
|
label: React.ReactNode;
|
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
CarouselDots,
|
|
10
10
|
CarouselItem,
|
|
11
11
|
CarouselNext,
|
|
12
|
-
CarouselPrevious
|
|
13
|
-
} from "../../components/micro/carousel";
|
|
12
|
+
CarouselPrevious } from "../../components/micro/carousel";
|
|
14
13
|
import { cn } from "../../lib/utils";
|
|
15
14
|
|
|
16
15
|
export type CarouselPresetProps = Omit<
|
|
@@ -11,16 +11,13 @@ import {
|
|
|
11
11
|
ComboboxInput,
|
|
12
12
|
ComboboxItem,
|
|
13
13
|
ComboboxList,
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
ComboboxTrigger,
|
|
16
|
-
useComboboxContext
|
|
17
|
-
} from "../../components/micro/combobox";
|
|
16
|
+
useComboboxContext } from "../../components/micro/combobox";
|
|
18
17
|
import {
|
|
19
18
|
InputGroup,
|
|
20
19
|
InputGroupAddon,
|
|
21
|
-
InputGroupInput
|
|
22
|
-
} from "../../components/micro/input-group";
|
|
23
|
-
import { ThemeWrapper } from "../../components/micro/theme-provider";
|
|
20
|
+
InputGroupInput } from "../../components/micro/input-group";
|
|
24
21
|
import { type Size } from "../../lib/types";
|
|
25
22
|
import { FieldPreset } from "./field-preset";
|
|
26
23
|
|
|
@@ -65,8 +62,7 @@ const ComboboxPreset = React.forwardRef<HTMLInputElement, ComboboxPresetProps>(
|
|
|
65
62
|
errorMessage,
|
|
66
63
|
showError = true,
|
|
67
64
|
id,
|
|
68
|
-
size = "md",
|
|
69
|
-
},
|
|
65
|
+
size = "md" },
|
|
70
66
|
ref,
|
|
71
67
|
) => {
|
|
72
68
|
const generatedId = React.useId();
|
|
@@ -104,9 +100,8 @@ const ComboboxPreset = React.forwardRef<HTMLInputElement, ComboboxPresetProps>(
|
|
|
104
100
|
aria-invalid={!!errorMessage || undefined}
|
|
105
101
|
disabled={disabled}
|
|
106
102
|
/>
|
|
107
|
-
|
|
108
|
-
<
|
|
109
|
-
<ComboboxContent>
|
|
103
|
+
|
|
104
|
+
<ComboboxContent>
|
|
110
105
|
<ComboboxEmpty>{emptyText}</ComboboxEmpty>
|
|
111
106
|
<ComboboxList>
|
|
112
107
|
<ComboboxGroup>
|
|
@@ -121,9 +116,8 @@ const ComboboxPreset = React.forwardRef<HTMLInputElement, ComboboxPresetProps>(
|
|
|
121
116
|
))}
|
|
122
117
|
</ComboboxGroup>
|
|
123
118
|
</ComboboxList>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
</ComboboxPortal>
|
|
119
|
+
</ComboboxContent>
|
|
120
|
+
|
|
127
121
|
</Combobox>
|
|
128
122
|
</FieldPreset>
|
|
129
123
|
);
|
|
@@ -10,17 +10,14 @@ import {
|
|
|
10
10
|
CommandItem,
|
|
11
11
|
CommandList,
|
|
12
12
|
CommandSeparator,
|
|
13
|
-
CommandShortcut
|
|
14
|
-
} from "../../components/micro/command";
|
|
13
|
+
CommandShortcut } from "../../components/micro/command";
|
|
15
14
|
import {
|
|
16
15
|
Dialog,
|
|
17
16
|
DialogContent,
|
|
18
17
|
DialogDescription,
|
|
19
18
|
DialogHeader,
|
|
20
|
-
|
|
21
|
-
DialogTitle
|
|
22
|
-
} from "../../components/micro/dialog";
|
|
23
|
-
import { ThemeWrapper } from "../../components/micro/theme-provider";
|
|
19
|
+
|
|
20
|
+
DialogTitle } from "../../components/micro/dialog";
|
|
24
21
|
import { cn } from "../../lib/utils";
|
|
25
22
|
|
|
26
23
|
type CommandDialogProps = Omit<
|
|
@@ -42,22 +39,20 @@ function CommandDialog({
|
|
|
42
39
|
}: CommandDialogProps) {
|
|
43
40
|
return (
|
|
44
41
|
<Dialog {...props}>
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
>
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</ThemeWrapper>
|
|
60
|
-
</DialogPortal>
|
|
42
|
+
|
|
43
|
+
<DialogContent
|
|
44
|
+
className={cn(
|
|
45
|
+
"top-1/3 translate-y-0 overflow-hidden rounded-xl p-0 sm:max-w-lg",
|
|
46
|
+
className,
|
|
47
|
+
)}
|
|
48
|
+
>
|
|
49
|
+
<DialogHeader className="sr-only">
|
|
50
|
+
<DialogTitle>{title}</DialogTitle>
|
|
51
|
+
<DialogDescription>{description}</DialogDescription>
|
|
52
|
+
</DialogHeader>
|
|
53
|
+
{children}
|
|
54
|
+
</DialogContent>
|
|
55
|
+
|
|
61
56
|
</Dialog>
|
|
62
57
|
);
|
|
63
58
|
}
|
|
@@ -73,6 +68,5 @@ export {
|
|
|
73
68
|
CommandItem,
|
|
74
69
|
CommandList,
|
|
75
70
|
CommandSeparator,
|
|
76
|
-
CommandShortcut
|
|
77
|
-
};
|
|
71
|
+
CommandShortcut };
|
|
78
72
|
export type { CommandDialogProps };
|
|
@@ -11,10 +11,8 @@ import { Calendar } from "../../components/micro/calendar";
|
|
|
11
11
|
import {
|
|
12
12
|
Popover,
|
|
13
13
|
PopoverContent,
|
|
14
|
-
|
|
15
|
-
PopoverTrigger
|
|
16
|
-
} from "../../components/micro/popover";
|
|
17
|
-
import { ThemeWrapper } from "../../components/micro/theme-provider";
|
|
14
|
+
|
|
15
|
+
PopoverTrigger } from "../../components/micro/popover";
|
|
18
16
|
import { type Size } from "../../lib/types";
|
|
19
17
|
import { cn } from "../../lib/utils";
|
|
20
18
|
import { FieldPreset } from "./field-preset";
|
|
@@ -94,13 +92,9 @@ const triggerVariants = cva(
|
|
|
94
92
|
size: {
|
|
95
93
|
sm: "h-7 gap-1 px-2 py-0.5 text-xs",
|
|
96
94
|
md: "h-8 gap-1.5 px-2.5 py-1 text-sm",
|
|
97
|
-
lg: "h-9 gap-2 px-3 py-1.5 text-sm",
|
|
98
|
-
},
|
|
99
|
-
},
|
|
95
|
+
lg: "h-9 gap-2 px-3 py-1.5 text-sm" } },
|
|
100
96
|
defaultVariants: {
|
|
101
|
-
size: "md",
|
|
102
|
-
},
|
|
103
|
-
},
|
|
97
|
+
size: "md" } },
|
|
104
98
|
);
|
|
105
99
|
|
|
106
100
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -171,8 +165,7 @@ const DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(
|
|
|
171
165
|
disabledDates,
|
|
172
166
|
startMonth,
|
|
173
167
|
endMonth,
|
|
174
|
-
defaultMonth,
|
|
175
|
-
},
|
|
168
|
+
defaultMonth },
|
|
176
169
|
ref,
|
|
177
170
|
) => {
|
|
178
171
|
const generatedId = React.useId();
|
|
@@ -234,14 +227,13 @@ const DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(
|
|
|
234
227
|
{triggerLabel}
|
|
235
228
|
</span>
|
|
236
229
|
</PopoverTrigger>
|
|
237
|
-
|
|
238
|
-
<
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
>
|
|
230
|
+
|
|
231
|
+
<PopoverContent
|
|
232
|
+
side="bottom"
|
|
233
|
+
align="start"
|
|
234
|
+
sideOffset={4}
|
|
235
|
+
className="p-0 w-auto"
|
|
236
|
+
>
|
|
245
237
|
{mode === "single" ? (
|
|
246
238
|
<Calendar
|
|
247
239
|
mode="single"
|
|
@@ -293,9 +285,8 @@ const DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(
|
|
|
293
285
|
Xác nhận
|
|
294
286
|
</Button>
|
|
295
287
|
</div>
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
</PopoverPortal>
|
|
288
|
+
</PopoverContent>
|
|
289
|
+
|
|
299
290
|
</Popover>
|
|
300
291
|
</FieldPreset>
|
|
301
292
|
);
|
|
@@ -12,11 +12,9 @@ import {
|
|
|
12
12
|
DialogDescription,
|
|
13
13
|
DialogFooter,
|
|
14
14
|
DialogHeader,
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
DialogTitle,
|
|
17
|
-
DialogTrigger
|
|
18
|
-
} from "../../components/micro/dialog";
|
|
19
|
-
import { ThemeWrapper } from "../../components/micro/theme-provider";
|
|
17
|
+
DialogTrigger } from "../../components/micro/dialog";
|
|
20
18
|
import { type Size } from "../../lib/types";
|
|
21
19
|
import { cn } from "../../lib/utils";
|
|
22
20
|
|
|
@@ -50,54 +48,52 @@ const DialogPreset = React.forwardRef<HTMLDivElement, DialogPresetProps>(
|
|
|
50
48
|
return (
|
|
51
49
|
<Dialog {...props}>
|
|
52
50
|
{trigger && <DialogTrigger render={trigger} />}
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
{description
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
)}
|
|
51
|
+
|
|
52
|
+
<DialogContent
|
|
53
|
+
ref={ref}
|
|
54
|
+
className={cn(
|
|
55
|
+
size === "sm" && "sm:max-w-md",
|
|
56
|
+
size === "md" && "sm:max-w-lg",
|
|
57
|
+
size === "lg" && "sm:max-w-xl",
|
|
58
|
+
"flex flex-col gap-0 p-0 overflow-hidden",
|
|
59
|
+
)}
|
|
60
|
+
>
|
|
61
|
+
{(title || description) && (
|
|
62
|
+
<DialogHeader className="shrink-0 p-4 pb-0">
|
|
63
|
+
{title && <DialogTitle>{title}</DialogTitle>}
|
|
64
|
+
{description && (
|
|
65
|
+
<DialogDescription>{description}</DialogDescription>
|
|
66
|
+
)}
|
|
67
|
+
</DialogHeader>
|
|
68
|
+
)}
|
|
72
69
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
<div className="flex-1 min-h-0 overflow-y-auto p-4">
|
|
71
|
+
{children}
|
|
72
|
+
</div>
|
|
76
73
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
{footer && (
|
|
75
|
+
<DialogFooter className="shrink-0 rounded-b-xl border-t border-t-border bg-muted/50 p-4">
|
|
76
|
+
{footer}
|
|
77
|
+
</DialogFooter>
|
|
78
|
+
)}
|
|
82
79
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
</DialogPortal>
|
|
80
|
+
{showCloseButton && (
|
|
81
|
+
<DialogClose
|
|
82
|
+
render={
|
|
83
|
+
<Button
|
|
84
|
+
variant="ghost"
|
|
85
|
+
className="absolute top-2 right-2"
|
|
86
|
+
size="sm"
|
|
87
|
+
iconOnly
|
|
88
|
+
/>
|
|
89
|
+
}
|
|
90
|
+
>
|
|
91
|
+
<XIcon />
|
|
92
|
+
<span className="sr-only">Close</span>
|
|
93
|
+
</DialogClose>
|
|
94
|
+
)}
|
|
95
|
+
</DialogContent>
|
|
96
|
+
|
|
101
97
|
</Dialog>
|
|
102
98
|
);
|
|
103
99
|
},
|
|
@@ -7,8 +7,7 @@ import {
|
|
|
7
7
|
EmptyDescription,
|
|
8
8
|
EmptyHeader,
|
|
9
9
|
EmptyMedia,
|
|
10
|
-
EmptyTitle
|
|
11
|
-
} from "../../components/micro/empty";
|
|
10
|
+
EmptyTitle } from "../../components/micro/empty";
|
|
12
11
|
import { cn } from "../../lib/utils";
|
|
13
12
|
|
|
14
13
|
type EmptyPresetProps = {
|
|
@@ -24,8 +23,7 @@ function EmptyPreset({
|
|
|
24
23
|
title,
|
|
25
24
|
description,
|
|
26
25
|
action,
|
|
27
|
-
className
|
|
28
|
-
}: EmptyPresetProps) {
|
|
26
|
+
className }: EmptyPresetProps) {
|
|
29
27
|
return (
|
|
30
28
|
<Empty className={cn(className)}>
|
|
31
29
|
<EmptyHeader>
|
|
@@ -14,8 +14,7 @@ import {
|
|
|
14
14
|
InputOTP,
|
|
15
15
|
InputOTPGroup,
|
|
16
16
|
InputOTPSeparator,
|
|
17
|
-
InputOTPSlot
|
|
18
|
-
} from "../../components/micro/input-otp";
|
|
17
|
+
InputOTPSlot } from "../../components/micro/input-otp";
|
|
19
18
|
import { FieldPreset } from "./field-preset";
|
|
20
19
|
|
|
21
20
|
export type InputOTPPresetProps = Omit<
|
|
@@ -10,8 +10,7 @@ import {
|
|
|
10
10
|
InputGroupAddon,
|
|
11
11
|
InputGroupButton,
|
|
12
12
|
InputGroupInput,
|
|
13
|
-
InputGroupText
|
|
14
|
-
} from "../../components/micro/input-group";
|
|
13
|
+
InputGroupText } from "../../components/micro/input-group";
|
|
15
14
|
import { FieldPreset } from "./field-preset";
|
|
16
15
|
|
|
17
16
|
export type InputPresetProps = Omit<InputProps, "className"> & {
|
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
PaginationItem,
|
|
10
10
|
PaginationLink,
|
|
11
11
|
PaginationNext,
|
|
12
|
-
PaginationPrevious
|
|
13
|
-
} from "../../components/micro/pagination";
|
|
12
|
+
PaginationPrevious } from "../../components/micro/pagination";
|
|
14
13
|
import type { Size } from "../../lib/types";
|
|
15
14
|
import { cn } from "../../lib/utils";
|
|
16
15
|
|
|
@@ -100,8 +99,7 @@ const PaginationPreset = React.forwardRef<HTMLElement, PaginationPresetProps>(
|
|
|
100
99
|
}}
|
|
101
100
|
aria-disabled={currentPage === 1}
|
|
102
101
|
className={cn({
|
|
103
|
-
"pointer-events-none opacity-50": currentPage === 1
|
|
104
|
-
})}
|
|
102
|
+
"pointer-events-none opacity-50": currentPage === 1 })}
|
|
105
103
|
/>
|
|
106
104
|
</PaginationItem>
|
|
107
105
|
|
|
@@ -141,8 +139,7 @@ const PaginationPreset = React.forwardRef<HTMLElement, PaginationPresetProps>(
|
|
|
141
139
|
}}
|
|
142
140
|
aria-disabled={currentPage === totalPages}
|
|
143
141
|
className={cn({
|
|
144
|
-
"pointer-events-none opacity-50": currentPage === totalPages
|
|
145
|
-
})}
|
|
142
|
+
"pointer-events-none opacity-50": currentPage === totalPages })}
|
|
146
143
|
/>
|
|
147
144
|
</PaginationItem>
|
|
148
145
|
</PaginationContent>
|
|
@@ -5,8 +5,7 @@ import {
|
|
|
5
5
|
ProgressIndicator,
|
|
6
6
|
ProgressLabel,
|
|
7
7
|
ProgressTrack,
|
|
8
|
-
ProgressValue
|
|
9
|
-
} from "../../components/micro/progress";
|
|
8
|
+
ProgressValue } from "../../components/micro/progress";
|
|
10
9
|
|
|
11
10
|
export type ProgressPresetProps = Omit<
|
|
12
11
|
React.ComponentProps<typeof Progress>,
|
|
@@ -53,8 +53,7 @@ const RadioGroupPreset = React.forwardRef<
|
|
|
53
53
|
const textSizeClass = cn({
|
|
54
54
|
"text-xs": size === "sm",
|
|
55
55
|
"text-sm": size === "md",
|
|
56
|
-
"text-base": size === "lg"
|
|
57
|
-
});
|
|
56
|
+
"text-base": size === "lg" });
|
|
58
57
|
|
|
59
58
|
return (
|
|
60
59
|
<FieldPreset
|
|
@@ -71,8 +70,7 @@ const RadioGroupPreset = React.forwardRef<
|
|
|
71
70
|
id={inputId}
|
|
72
71
|
className={cn("flex", {
|
|
73
72
|
"flex-col gap-2": orientation === "vertical",
|
|
74
|
-
"flex-row gap-4 flex-wrap": orientation !== "vertical"
|
|
75
|
-
})}
|
|
73
|
+
"flex-row gap-4 flex-wrap": orientation !== "vertical" })}
|
|
76
74
|
aria-invalid={!!errorMessage}
|
|
77
75
|
{...radioGroupProps}
|
|
78
76
|
>
|
|
@@ -8,11 +8,9 @@ import {
|
|
|
8
8
|
SelectGroup,
|
|
9
9
|
SelectItem,
|
|
10
10
|
SelectLabel,
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
SelectTrigger,
|
|
13
|
-
SelectValue
|
|
14
|
-
} from "../../components/micro/select";
|
|
15
|
-
import { ThemeWrapper } from "../../components/micro/theme-provider";
|
|
13
|
+
SelectValue } from "../../components/micro/select";
|
|
16
14
|
import { type Size } from "../../lib/types";
|
|
17
15
|
import { FieldPreset } from "./field-preset";
|
|
18
16
|
|
|
@@ -72,8 +70,7 @@ const SelectPreset = React.forwardRef<
|
|
|
72
70
|
description,
|
|
73
71
|
errorMessage,
|
|
74
72
|
showError = true,
|
|
75
|
-
id,
|
|
76
|
-
},
|
|
73
|
+
id },
|
|
77
74
|
ref,
|
|
78
75
|
) => {
|
|
79
76
|
const generatedId = React.useId();
|
|
@@ -112,9 +109,8 @@ const SelectPreset = React.forwardRef<
|
|
|
112
109
|
>
|
|
113
110
|
<SelectValue placeholder={placeholder} />
|
|
114
111
|
</SelectTrigger>
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
<SelectContent>
|
|
112
|
+
|
|
113
|
+
<SelectContent>
|
|
118
114
|
{(() => {
|
|
119
115
|
const groups = new Map<
|
|
120
116
|
string | undefined,
|
|
@@ -159,9 +155,8 @@ const SelectPreset = React.forwardRef<
|
|
|
159
155
|
},
|
|
160
156
|
);
|
|
161
157
|
})()}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
</SelectPortal>
|
|
158
|
+
</SelectContent>
|
|
159
|
+
|
|
165
160
|
</Select>
|
|
166
161
|
</FieldPreset>
|
|
167
162
|
);
|
|
@@ -7,8 +7,7 @@ import {
|
|
|
7
7
|
SliderControl,
|
|
8
8
|
SliderIndicator,
|
|
9
9
|
SliderThumb,
|
|
10
|
-
SliderTrack
|
|
11
|
-
} from "../../components/micro/slider";
|
|
10
|
+
SliderTrack } from "../../components/micro/slider";
|
|
12
11
|
import { FieldPreset } from "./field-preset";
|
|
13
12
|
|
|
14
13
|
export type SliderPresetProps = Omit<
|
|
@@ -6,8 +6,7 @@ import {
|
|
|
6
6
|
Field,
|
|
7
7
|
FieldDescription,
|
|
8
8
|
FieldError,
|
|
9
|
-
FieldLabel
|
|
10
|
-
} from "../../components/micro/field";
|
|
9
|
+
FieldLabel } from "../../components/micro/field";
|
|
11
10
|
import { Switch, SwitchThumb } from "../../components/micro/switch";
|
|
12
11
|
import { cn } from "../../lib/utils";
|
|
13
12
|
|