linkedunion-design-kit 1.10.6 → 1.10.7-beta.1
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/dist/index.d.ts +8 -1
- package/dist/index.js +8 -1
- package/dist/src/components/Alerts/Alert/alert.js +1 -0
- package/dist/src/components/Button/Button/Button.d.ts +3 -2
- package/dist/src/components/Button/Button/Button.js +18 -6
- package/dist/src/components/Button/Button/Button.module.css +1 -1
- package/dist/src/components/Button/Button/Button.stories.d.ts +6 -4
- package/dist/src/components/Button/IconButton/IconButton.d.ts +1 -1
- package/dist/src/components/Button/IconButton/IconButton.stories.d.ts +2 -2
- package/dist/src/components/Button/index.d.ts +2 -0
- package/dist/src/components/Button/index.js +5 -4
- package/dist/src/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/src/components/DatePicker/DatePicker.js +64 -0
- package/dist/src/components/DatePicker/DatePicker.stories.d.ts +14 -0
- package/dist/src/components/DatePicker/DatePicker.stories.js +171 -0
- package/dist/src/components/DatePicker/index.d.ts +14 -0
- package/dist/src/components/DatePicker/index.js +12 -0
- package/dist/src/components/DatePicker/types.d.ts +19 -0
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.d.ts +6 -2
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.js +7 -6
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.d.ts +8 -1
- package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.js +48 -3
- package/dist/src/components/Dropdown/DropdownMenu/index.d.ts +5 -0
- package/dist/src/components/Dropdown/DropdownMenu/index.js +5 -0
- package/dist/src/components/Dropdown/select.js +1 -1
- package/dist/src/components/MenuBar/menubar.d.ts +26 -0
- package/dist/src/components/MenuBar/menubar.js +92 -0
- package/dist/src/components/MenuBar/menubar.stories.d.ts +14 -0
- package/dist/src/components/MenuBar/menubar.stories.js +59 -0
- package/dist/src/components/NavigationMenu/index.d.ts +1 -0
- package/dist/src/components/NavigationMenu/index.js +1 -0
- package/dist/src/components/NavigationMenu/navigation-menu.d.ts +14 -0
- package/dist/src/components/NavigationMenu/navigation-menu.js +62 -0
- package/dist/src/components/NavigationMenu/navigation-menu.stories.d.ts +29 -0
- package/dist/src/components/NavigationMenu/navigation-menu.stories.js +91 -0
- package/dist/src/components/Separator/Separator.stories.d.ts +15 -0
- package/dist/src/components/Separator/Separator.stories.js +79 -0
- package/dist/src/components/Separator/index.d.ts +1 -0
- package/dist/src/components/Separator/index.js +1 -0
- package/dist/src/components/Separator/separator.d.ts +4 -0
- package/dist/src/components/Separator/separator.js +32 -0
- package/dist/src/components/Sheet/index.d.ts +1 -0
- package/dist/src/components/Sheet/index.js +1 -0
- package/dist/src/components/Sheet/sheet.d.ts +25 -0
- package/dist/src/components/Sheet/sheet.js +76 -0
- package/dist/src/components/Sheet/sheet.stories.d.ts +7 -0
- package/dist/src/components/Sheet/sheet.stories.js +21 -0
- package/dist/src/components/Table/Table.d.ts +7 -7
- package/dist/src/components/Table/Table.js +193 -28
- package/dist/src/components/Table/Table.stories.d.ts +5 -5
- package/dist/src/components/Table/Table.stories.js +55 -2
- package/dist/src/components/Table/index.d.ts +8 -0
- package/dist/src/components/Table/index.js +7 -0
- package/dist/src/components/Table/types.d.ts +8 -0
- package/dist/src/components/Table/types.js +1 -0
- package/dist/src/components/TimePicker/TimePicker.d.ts +2 -0
- package/dist/src/components/TimePicker/TimePicker.js +109 -0
- package/dist/src/components/TimePicker/TimePicker.stories.d.ts +15 -0
- package/dist/src/components/TimePicker/TimePicker.stories.js +169 -0
- package/dist/src/components/TimePicker/index.d.ts +24 -0
- package/dist/src/components/TimePicker/index.js +22 -0
- package/dist/src/components/TimePicker/types.d.ts +15 -0
- package/dist/src/components/TimePicker/types.js +1 -0
- package/dist/src/components/TimePicker/utils.d.ts +1 -0
- package/dist/src/components/TimePicker/utils.js +1 -0
- package/dist/src/components/Title/Title.module.css +1 -1
- package/dist/src/components/Typography/Heading/heading.module.css +1 -1
- package/dist/src/components/ui/calendar.d.ts +10 -0
- package/dist/src/components/ui/calendar.js +222 -0
- package/dist/src/utils/constants.d.ts +1 -0
- package/dist/src/utils/constants.js +1 -0
- package/dist/styles/global.css +994 -12
- package/package.json +6 -1
- package/dist/src/components/Avatar/Avatar/Avatar1.stories.d.ts +0 -17
- package/dist/src/components/Avatar/Avatar/Avatar1.stories.js +0 -68
- package/dist/src/components/Avatar/Avatar/type.d.ts +0 -12
- package/dist/src/components/ui/avatar.d.ts +0 -13
- package/dist/src/components/ui/avatar.js +0 -53
- package/dist/src/components/ui/dialog.d.ts +0 -15
- package/dist/src/components/ui/dialog.js +0 -68
- /package/dist/src/components/{Avatar/Avatar/type.js → DatePicker/types.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { Tabs, TabsList, TabsTrigger, TabsContent, } from "./src/components/Tabs
|
|
|
24
24
|
export { Select, SelectTrigger, SelectContent, SelectItem, SelectGroup, SelectLabel, SelectSeparator, SelectValue, } from "./src/components/Dropdown/select";
|
|
25
25
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "./src/components/Alerts/AlertDialog";
|
|
26
26
|
export { Avatar, AvatarImage, AvatarFallback, } from "./src/components/Avatar/Avatar/Avatar";
|
|
27
|
-
export { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, } from "./src/components/Table/Table";
|
|
27
|
+
export { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, TableButton, TableCellPadded, TableFooter, } from "./src/components/Table/Table";
|
|
28
28
|
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuCheckboxItem, DropdownMenuLabel, DropdownMenuSubTrigger, DropdownMenuSub, DropdownMenuSubContent, } from "./src/components/Dropdown/DropdownMenu/DropdownMenu";
|
|
29
29
|
export { Badge } from "./src/components/Badge/Badge";
|
|
30
30
|
export { default as Combobox } from "./src/components/Dropdown/Combobox/Combobox";
|
|
@@ -32,3 +32,10 @@ export { Pagination, PaginationContent, PaginationLink, PaginationItem, Paginati
|
|
|
32
32
|
export { Skeleton } from "./src/components/Skeleton/skeleton";
|
|
33
33
|
export { Tabs as VerticalTabs, TabsContent as VerticalTabsContent, TabsList as VerticalTabsList, tabSizes as verticalTabsSize, TabsTrigger as VerticalTabsTrigger, TabsHeading as VerticalTabsHeading, } from "./src/components/VerticalTabs/VerticalTabs";
|
|
34
34
|
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose, sizes, } from "./src/components/Modal/Modal";
|
|
35
|
+
export { DatePicker } from "./src/components/DatePicker/DatePicker";
|
|
36
|
+
export { TimePicker } from "./src/components/TimePicker/TimePicker";
|
|
37
|
+
export * from "./src/components/NavigationMenu";
|
|
38
|
+
export * from "./src/components/Sheet";
|
|
39
|
+
export * from "./src/components/Separator";
|
|
40
|
+
export * from "./src/components/MenuBar/menubar";
|
|
41
|
+
export * from "./src/components/Alerts/Alert/alert";
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ export { Tabs, TabsList, TabsTrigger, TabsContent, } from "./src/components/Tabs
|
|
|
24
24
|
export { Select, SelectTrigger, SelectContent, SelectItem, SelectGroup, SelectLabel, SelectSeparator, SelectValue, } from "./src/components/Dropdown/select";
|
|
25
25
|
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "./src/components/Alerts/AlertDialog";
|
|
26
26
|
export { Avatar, AvatarImage, AvatarFallback, } from "./src/components/Avatar/Avatar/Avatar";
|
|
27
|
-
export { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, } from "./src/components/Table/Table";
|
|
27
|
+
export { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, TableButton, TableCellPadded, TableFooter, } from "./src/components/Table/Table";
|
|
28
28
|
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuCheckboxItem, DropdownMenuLabel, DropdownMenuSubTrigger, DropdownMenuSub, DropdownMenuSubContent, } from "./src/components/Dropdown/DropdownMenu/DropdownMenu";
|
|
29
29
|
export { Badge } from "./src/components/Badge/Badge";
|
|
30
30
|
export { default as Combobox } from "./src/components/Dropdown/Combobox/Combobox";
|
|
@@ -32,3 +32,10 @@ export { Pagination, PaginationContent, PaginationLink, PaginationItem, Paginati
|
|
|
32
32
|
export { Skeleton } from "./src/components/Skeleton/skeleton";
|
|
33
33
|
export { Tabs as VerticalTabs, TabsContent as VerticalTabsContent, TabsList as VerticalTabsList, tabSizes as verticalTabsSize, TabsTrigger as VerticalTabsTrigger, TabsHeading as VerticalTabsHeading, } from "./src/components/VerticalTabs/VerticalTabs";
|
|
34
34
|
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose, sizes, } from "./src/components/Modal/Modal";
|
|
35
|
+
export { DatePicker } from "./src/components/DatePicker/DatePicker";
|
|
36
|
+
export { TimePicker } from "./src/components/TimePicker/TimePicker";
|
|
37
|
+
export * from "./src/components/NavigationMenu";
|
|
38
|
+
export * from "./src/components/Sheet";
|
|
39
|
+
export * from "./src/components/Separator";
|
|
40
|
+
export * from "./src/components/MenuBar/menubar";
|
|
41
|
+
export * from "./src/components/Alerts/Alert/alert";
|
|
@@ -15,8 +15,9 @@ export declare const variant: {
|
|
|
15
15
|
};
|
|
16
16
|
declare const buttonVariants: (props?: ({
|
|
17
17
|
color?: "blue" | "light-blue" | "green" | "light-green" | "yellow" | "light-yellow" | "red" | "light-red" | "indigo" | "light-indigo" | "gray" | "light-gray" | "disabled" | null | undefined;
|
|
18
|
-
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
19
|
-
|
|
18
|
+
size?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
19
|
+
linkSize?: "sm" | "md" | "lg" | "none" | null | undefined;
|
|
20
|
+
shape?: "rounded-sm" | "rounded-full" | "rounded-none" | null | undefined;
|
|
20
21
|
variant?: "link" | "fill" | "outline" | "ghost" | null | undefined;
|
|
21
22
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
22
23
|
declare function Button({ className, color, size, shape, variant, asChild, startIcon, endIcon, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -37,30 +37,39 @@ import LUIcon from "../../Icons/LUIcon";
|
|
|
37
37
|
import { buttonStyles } from "..";
|
|
38
38
|
export var variant = {
|
|
39
39
|
fill: "",
|
|
40
|
-
link: "lu-bg-transparent hover:lu-bg-transparent focus:lu-bg-transparent active:lu-bg-transparent !p-0 underline-offset-4 hover:underline border-none",
|
|
40
|
+
link: "lu-bg-transparent hover:lu-bg-transparent focus:lu-bg-transparent active:lu-bg-transparent !p-0 underline-offset-4 hover:underline border-none font-normal leading-normal",
|
|
41
41
|
outline: "border lu-bg-transparent",
|
|
42
42
|
ghost: "lu-bg-transparent border-none",
|
|
43
43
|
};
|
|
44
|
-
var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap
|
|
44
|
+
var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer", {
|
|
45
45
|
variants: {
|
|
46
46
|
color: buttonStyles.fillColor,
|
|
47
|
-
size: buttonStyles.size,
|
|
47
|
+
size: __assign(__assign({}, buttonStyles.size), { none: "" }),
|
|
48
|
+
linkSize: __assign(__assign({}, buttonStyles.linkSize), { none: "" }),
|
|
48
49
|
shape: buttonStyles.shape,
|
|
49
50
|
variant: variant,
|
|
50
51
|
},
|
|
51
52
|
defaultVariants: {
|
|
52
53
|
color: "blue",
|
|
53
54
|
size: "md",
|
|
55
|
+
linkSize: "none",
|
|
54
56
|
shape: "rounded-sm",
|
|
55
57
|
variant: "fill",
|
|
56
58
|
},
|
|
57
|
-
compoundVariants: __spreadArray(__spreadArray(__spreadArray([], Object.entries(buttonStyles.linkColor).map(function (_a) {
|
|
59
|
+
compoundVariants: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], Object.entries(buttonStyles.linkColor).map(function (_a) {
|
|
58
60
|
var color = _a[0], className = _a[1];
|
|
59
61
|
return ({
|
|
60
62
|
color: color,
|
|
61
63
|
variant: "link",
|
|
62
64
|
class: className,
|
|
63
65
|
});
|
|
66
|
+
}), true), Object.entries(buttonStyles.linkSize).map(function (_a) {
|
|
67
|
+
var sizeKey = _a[0], className = _a[1];
|
|
68
|
+
return ({
|
|
69
|
+
linkSize: sizeKey,
|
|
70
|
+
variant: "link",
|
|
71
|
+
class: className,
|
|
72
|
+
});
|
|
64
73
|
}), true), Object.entries(buttonStyles.outlineColor).map(function (_a) {
|
|
65
74
|
var color = _a[0], className = _a[1];
|
|
66
75
|
return ({
|
|
@@ -78,7 +87,7 @@ var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespa
|
|
|
78
87
|
}), true),
|
|
79
88
|
});
|
|
80
89
|
function Button(_a) {
|
|
81
|
-
var className = _a.className, _b = _a.color, color = _b === void 0 ? "blue" : _b,
|
|
90
|
+
var className = _a.className, _b = _a.color, color = _b === void 0 ? "blue" : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, shape = _a.shape, _d = _a.variant, variant = _d === void 0 ? "fill" : _d, _e = _a.asChild, asChild = _e === void 0 ? false : _e, startIcon = _a.startIcon, endIcon = _a.endIcon, props = __rest(_a, ["className", "color", "size", "shape", "variant", "asChild", "startIcon", "endIcon"]);
|
|
82
91
|
var Comp = asChild ? Slot : "button";
|
|
83
92
|
// Map button size to appropriate icon sizes for start and end icons
|
|
84
93
|
var getIconSizes = function () {
|
|
@@ -98,6 +107,9 @@ function Button(_a) {
|
|
|
98
107
|
// Use the calculated sizes based on button size
|
|
99
108
|
var startIconSizeValue = iconSizes.startIcon;
|
|
100
109
|
var endIconSizeValue = iconSizes.endIcon;
|
|
101
|
-
|
|
110
|
+
var sizeProps = variant === "link"
|
|
111
|
+
? { linkSize: (size === "xl" ? "lg" : size), size: "none" }
|
|
112
|
+
: { size: size, linkSize: "none" };
|
|
113
|
+
return (_jsxs(Comp, __assign({ "data-slot": "button", "data-size": size, "data-variant": variant, "data-color": color, className: cn(buttonVariants(__assign(__assign({ variant: variant, color: color }, sizeProps), { shape: shape })), className) }, props, { children: [startIcon && (_jsx(LUIcon, { size: startIconSizeValue, "data-testid": "start-icon", icon: startIcon })), props.children, endIcon && (_jsx(LUIcon, { size: endIconSizeValue, "data-testid": "end-icon", icon: endIcon }))] })));
|
|
102
114
|
}
|
|
103
115
|
export { Button, buttonVariants };
|
|
@@ -391,9 +391,10 @@ declare const meta: {
|
|
|
391
391
|
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
392
392
|
onTransitionStart?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
393
393
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
394
|
-
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
394
|
+
size?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
395
395
|
variant?: "fill" | "link" | "outline" | "ghost" | undefined;
|
|
396
|
-
shape?: "rounded-sm" | "rounded-full" | null | undefined;
|
|
396
|
+
shape?: "rounded-sm" | "rounded-full" | "rounded-none" | null | undefined;
|
|
397
|
+
linkSize?: "sm" | "md" | "lg" | "none" | null | undefined;
|
|
397
398
|
asChild?: boolean | undefined;
|
|
398
399
|
startIcon?: keyof typeof import("../../../utils/iconList").iconList | undefined;
|
|
399
400
|
endIcon?: keyof typeof import("../../../utils/iconList").iconList | undefined;
|
|
@@ -691,9 +692,10 @@ declare const meta: {
|
|
|
691
692
|
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
692
693
|
onTransitionStart?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
693
694
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
694
|
-
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
695
|
+
size?: "sm" | "md" | "lg" | "xl" | "none" | null | undefined;
|
|
695
696
|
variant?: "fill" | "link" | "outline" | "ghost" | undefined;
|
|
696
|
-
shape?: "rounded-sm" | "rounded-full" | null | undefined;
|
|
697
|
+
shape?: "rounded-sm" | "rounded-full" | "rounded-none" | null | undefined;
|
|
698
|
+
linkSize?: "sm" | "md" | "lg" | "none" | null | undefined;
|
|
697
699
|
asChild?: boolean | undefined;
|
|
698
700
|
startIcon?: keyof typeof import("../../../utils/iconList").iconList | undefined;
|
|
699
701
|
endIcon?: keyof typeof import("../../../utils/iconList").iconList | undefined;
|
|
@@ -9,7 +9,7 @@ export declare const variant: {
|
|
|
9
9
|
declare const buttonVariants: (props?: ({
|
|
10
10
|
color?: "blue" | "light-blue" | "green" | "light-green" | "yellow" | "light-yellow" | "red" | "light-red" | "indigo" | "light-indigo" | "gray" | "light-gray" | "disabled" | null | undefined;
|
|
11
11
|
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
12
|
-
shape?: "rounded-sm" | "rounded-full" | null | undefined;
|
|
12
|
+
shape?: "rounded-sm" | "rounded-full" | "rounded-none" | null | undefined;
|
|
13
13
|
variant?: "fill" | "outline" | "ghost" | null | undefined;
|
|
14
14
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
15
|
declare function IconButton({ className, color, size, shape, variant, asChild, icon, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
@@ -404,7 +404,7 @@ declare const meta: {
|
|
|
404
404
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
405
405
|
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
406
406
|
variant?: "fill" | "outline" | "ghost" | undefined;
|
|
407
|
-
shape?: "rounded-sm" | "rounded-full" | null | undefined;
|
|
407
|
+
shape?: "rounded-sm" | "rounded-full" | "rounded-none" | null | undefined;
|
|
408
408
|
asChild?: boolean | undefined;
|
|
409
409
|
icon?: keyof typeof iconList | undefined;
|
|
410
410
|
}>, context: import("@storybook/core/csf").StoryContext<import("@storybook/react").ReactRenderer, {
|
|
@@ -703,7 +703,7 @@ declare const meta: {
|
|
|
703
703
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
704
704
|
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
705
705
|
variant?: "fill" | "outline" | "ghost" | undefined;
|
|
706
|
-
shape?: "rounded-sm" | "rounded-full" | null | undefined;
|
|
706
|
+
shape?: "rounded-sm" | "rounded-full" | "rounded-none" | null | undefined;
|
|
707
707
|
asChild?: boolean | undefined;
|
|
708
708
|
icon?: keyof typeof iconList | undefined;
|
|
709
709
|
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
@@ -27,6 +27,7 @@ export declare const buttonStyles: {
|
|
|
27
27
|
sm: string;
|
|
28
28
|
};
|
|
29
29
|
shape: {
|
|
30
|
+
"rounded-none": string;
|
|
30
31
|
"rounded-sm": string;
|
|
31
32
|
"rounded-full": string;
|
|
32
33
|
};
|
|
@@ -42,6 +43,7 @@ export declare const buttonStyles: {
|
|
|
42
43
|
linkSize: {
|
|
43
44
|
lg: string;
|
|
44
45
|
md: string;
|
|
46
|
+
sm: string;
|
|
45
47
|
};
|
|
46
48
|
outlineColor: {
|
|
47
49
|
blue: string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// Button style types
|
|
2
1
|
import styles from "./Button/Button.module.css";
|
|
3
2
|
export var buttonStyles = {
|
|
4
3
|
fillColor: {
|
|
@@ -14,7 +13,7 @@ export var buttonStyles = {
|
|
|
14
13
|
"light-indigo": "bg-indigo-100 text-indigo-600 hover:bg-indigo-700 hover:text-indigo-50 active:bg-indigo-800 active:text-indigo-50",
|
|
15
14
|
gray: "bg-gray-900 text-gray-50 hover:bg-gray-100 hover:text-gray-950 active:bg-gray-300 active:text-gray-950",
|
|
16
15
|
"light-gray": "bg-gray-50 text-gray-950 hover:bg-gray-100 active:bg-gray-300",
|
|
17
|
-
disabled: "bg-gray-100 text-gray-300",
|
|
16
|
+
disabled: "bg-gray-100 text-gray-300 cursor-not-allowed",
|
|
18
17
|
},
|
|
19
18
|
size: {
|
|
20
19
|
xl: "h-13 !py-3.5 !px-6 !text-base !font-normal !leading-normal",
|
|
@@ -29,6 +28,7 @@ export var buttonStyles = {
|
|
|
29
28
|
sm: "size-9 !p-2.5",
|
|
30
29
|
},
|
|
31
30
|
shape: {
|
|
31
|
+
"rounded-none": styles["rounded-none"],
|
|
32
32
|
"rounded-sm": styles["rounded-sm"],
|
|
33
33
|
"rounded-full": styles["rounded-full"],
|
|
34
34
|
},
|
|
@@ -42,8 +42,9 @@ export var buttonStyles = {
|
|
|
42
42
|
disabled: "text-gray-300 hover:no-underline",
|
|
43
43
|
},
|
|
44
44
|
linkSize: {
|
|
45
|
-
lg: "!text-
|
|
46
|
-
md: "!text-
|
|
45
|
+
lg: "!text-lg",
|
|
46
|
+
md: "!text-base",
|
|
47
|
+
sm: "!text-sm",
|
|
47
48
|
},
|
|
48
49
|
outlineColor: {
|
|
49
50
|
blue: "text-blue-600 hover:bg-blue-700 hover:text-blue-50 active:bg-blue-800 active:text-blue-50",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
import { format } from "date-fns";
|
|
26
|
+
import { cn } from "../../lib/utils";
|
|
27
|
+
import { Calendar } from "../ui/calendar";
|
|
28
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover";
|
|
29
|
+
import LUIcon from "../Icons/LUIcon";
|
|
30
|
+
import { getIconSize, getPadding, getIconPosition } from "../Input";
|
|
31
|
+
import { inputVariantConfig, inputVariants } from "../Input/input";
|
|
32
|
+
import { Button } from "../Button/Button/Button";
|
|
33
|
+
import { Default_DatePicker_Variant, Default_DatePicker_Color, Default_DatePicker_Shape, Default_DatePicker_Size, datePickerStyles, Default_DatePicker_Shadow, } from ".";
|
|
34
|
+
import { useState } from "react";
|
|
35
|
+
export function DatePicker(_a) {
|
|
36
|
+
var className = _a.className, _b = _a.variant, variant = _b === void 0 ? Default_DatePicker_Variant : _b, _c = _a.size, size = _c === void 0 ? Default_DatePicker_Size : _c, _d = _a.color, color = _d === void 0 ? Default_DatePicker_Color : _d, _e = _a.shape, shape = _e === void 0 ? Default_DatePicker_Shape : _e, date = _a.date, onChange = _a.onChange, _f = _a.placeholder, placeholder = _f === void 0 ? "MM/DD/YYYY" : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, startIcon = _a.startIcon, endIcon = _a.endIcon, _h = _a.shadow, shadow = _h === void 0 ? Default_DatePicker_Shadow : _h, minDate = _a.minDate, maxDate = _a.maxDate, props = __rest(_a, ["className", "variant", "size", "color", "shape", "date", "onChange", "placeholder", "disabled", "startIcon", "endIcon", "shadow", "minDate", "maxDate"]);
|
|
37
|
+
var _j = useState(false), open = _j[0], setOpen = _j[1];
|
|
38
|
+
var iconSizeClass = getIconSize(size);
|
|
39
|
+
var paddingClass = getPadding(size, !!startIcon, !!endIcon);
|
|
40
|
+
var iconPosition = getIconPosition(size || Default_DatePicker_Size);
|
|
41
|
+
return (_jsxs(Popover, { open: !disabled && open, onOpenChange: disabled ? undefined : setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs("div", { className: "relative", children: [startIcon && (_jsx(LUIcon, { icon: startIcon, size: iconSizeClass, className: cn("absolute top-1/2 -translate-y-1/2 pointer-events-none z-10", iconPosition.left) })), _jsx(Button, { color: "light-gray", "aria-expanded": open, "data-slot": "date-picker-input", className: cn("w-full justify-between !p-0", inputVariants({ variant: variant, size: size, color: color, shape: shape }), "text-left flex items-center", !date && "text-muted-foreground", open &&
|
|
42
|
+
color === "default" &&
|
|
43
|
+
"border-blue-600 ring-2 ring-blue-200", disabled && [
|
|
44
|
+
variant === "filled" && "bg-gray-100",
|
|
45
|
+
"border border-gray-300 cursor-not-allowed pointer-events-none opacity-50",
|
|
46
|
+
]), shape: inputVariantConfig.shape[shape], disabled: disabled, tabIndex: disabled ? -1 : 0, children: _jsx("div", { className: cn("flex-grow flex items-center", paddingClass), children: date ? format(date, "MM/dd/yyyy") : placeholder }) }), endIcon && (_jsx(LUIcon, { icon: endIcon, size: iconSizeClass, className: cn("absolute top-1/2 -translate-y-1/2 pointer-events-none z-10", iconPosition.right) }))] }) }), _jsx(PopoverContent, __assign({ align: "start", className: cn("w-full p-0 bg-white", datePickerStyles.shadow[shadow], className) }, props, { children: _jsx(Calendar, __assign({}, {
|
|
47
|
+
mode: "single",
|
|
48
|
+
selected: date !== null && date !== void 0 ? date : undefined,
|
|
49
|
+
onSelect: function (selectedDate) {
|
|
50
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(selectedDate !== null && selectedDate !== void 0 ? selectedDate : null);
|
|
51
|
+
setOpen(false);
|
|
52
|
+
},
|
|
53
|
+
calendarSize: size !== null && size !== void 0 ? size : Default_DatePicker_Size,
|
|
54
|
+
autoFocus: true,
|
|
55
|
+
disabled: {
|
|
56
|
+
before: minDate
|
|
57
|
+
? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate())
|
|
58
|
+
: undefined,
|
|
59
|
+
after: maxDate
|
|
60
|
+
? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate())
|
|
61
|
+
: undefined,
|
|
62
|
+
},
|
|
63
|
+
})) }))] }));
|
|
64
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta } from "@storybook/react";
|
|
2
|
+
import { DatePickerProps } from ".";
|
|
3
|
+
declare const _default: Meta<DatePickerProps>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, DatePickerProps>;
|
|
6
|
+
export declare const WithLabel: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const WithLabelAndCaption: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const Sizes: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const WithIcons: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const ValidationStates: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const Disabled: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const Shapes: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const CalendarSizes: () => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const Shadows: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { DatePicker } from "./DatePicker";
|
|
14
|
+
import { Body } from "../Typography/Body/body";
|
|
15
|
+
import { Label } from "../Label/Label";
|
|
16
|
+
import { Caption } from "../Typography/Caption/caption";
|
|
17
|
+
import Tooltip from "../ToolTip/Tooltip";
|
|
18
|
+
import LUIcon from "../Icons/LUIcon";
|
|
19
|
+
import { datePickerStyles, Default_DatePicker_Color, Default_DatePicker_Shadow, Default_DatePicker_Shape, Default_DatePicker_Size, Default_DatePicker_Variant, } from ".";
|
|
20
|
+
import { inputVariantConfig } from "../Input/input";
|
|
21
|
+
import { Calendar } from "../ui/calendar";
|
|
22
|
+
import { useEffect, useState } from "react";
|
|
23
|
+
export default {
|
|
24
|
+
title: "Components/DatePicker",
|
|
25
|
+
component: DatePicker,
|
|
26
|
+
tags: ["autodocs"],
|
|
27
|
+
argTypes: {
|
|
28
|
+
variant: {
|
|
29
|
+
control: {
|
|
30
|
+
type: "select",
|
|
31
|
+
},
|
|
32
|
+
options: Object.keys(inputVariantConfig.variant),
|
|
33
|
+
defaultValue: Default_DatePicker_Variant,
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
control: {
|
|
37
|
+
type: "select",
|
|
38
|
+
},
|
|
39
|
+
options: Object.keys(inputVariantConfig.size),
|
|
40
|
+
defaultValue: Default_DatePicker_Size,
|
|
41
|
+
},
|
|
42
|
+
color: {
|
|
43
|
+
control: {
|
|
44
|
+
type: "select",
|
|
45
|
+
},
|
|
46
|
+
options: Object.keys(inputVariantConfig.color),
|
|
47
|
+
defaultValue: Default_DatePicker_Color,
|
|
48
|
+
description: "Color variant of the trigger button",
|
|
49
|
+
table: {
|
|
50
|
+
type: { summary: "string" },
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
shape: {
|
|
54
|
+
control: {
|
|
55
|
+
type: "select",
|
|
56
|
+
},
|
|
57
|
+
options: Object.keys(inputVariantConfig.shape),
|
|
58
|
+
defaultValue: Default_DatePicker_Shape,
|
|
59
|
+
description: "Shape variant of the trigger button (border radius)",
|
|
60
|
+
table: {
|
|
61
|
+
type: { summary: "string" },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
placeholder: {
|
|
65
|
+
control: "text",
|
|
66
|
+
defaultValue: "MM/DD/YYYY",
|
|
67
|
+
},
|
|
68
|
+
disabled: {
|
|
69
|
+
control: "boolean",
|
|
70
|
+
defaultValue: false,
|
|
71
|
+
},
|
|
72
|
+
shadow: {
|
|
73
|
+
control: {
|
|
74
|
+
type: "select",
|
|
75
|
+
},
|
|
76
|
+
options: Object.keys(datePickerStyles.shadow),
|
|
77
|
+
defaultValue: Default_DatePicker_Shadow,
|
|
78
|
+
description: "Shadow styling for the calendar dropdown when opened",
|
|
79
|
+
table: {
|
|
80
|
+
type: { summary: "string" },
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
var Template = function (args) {
|
|
86
|
+
var _a;
|
|
87
|
+
var _b = useState((_a = args.date) !== null && _a !== void 0 ? _a : null), date = _b[0], setDate = _b[1];
|
|
88
|
+
useEffect(function () {
|
|
89
|
+
var _a;
|
|
90
|
+
setDate((_a = args.date) !== null && _a !== void 0 ? _a : null);
|
|
91
|
+
}, [args.date]);
|
|
92
|
+
return (_jsx("div", { className: "w-full max-w-md", children: _jsx(DatePicker, __assign({}, args, { date: date, onChange: setDate })) }));
|
|
93
|
+
};
|
|
94
|
+
export var Default = Template.bind({});
|
|
95
|
+
Default.args = {
|
|
96
|
+
placeholder: "Select a date",
|
|
97
|
+
variant: Default_DatePicker_Variant,
|
|
98
|
+
size: Default_DatePicker_Size,
|
|
99
|
+
};
|
|
100
|
+
export var WithLabel = function () {
|
|
101
|
+
var _a = useState(null), date = _a[0], setDate = _a[1];
|
|
102
|
+
return (_jsx("div", { className: "w-full max-w-md", children: _jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Label, { variant: "label-lg", children: "Label" }), _jsx(Tooltip, { title: "?", children: _jsx(LUIcon, { variant: "padded", size: "md", shape: "rounded", icon: "question", color: "light-blue" }) })] }), _jsx(DatePicker, { placeholder: "MM/DD/YYYY", date: date, onChange: setDate })] }) }));
|
|
103
|
+
};
|
|
104
|
+
export var WithLabelAndCaption = function () {
|
|
105
|
+
var _a = useState(null), date = _a[0], setDate = _a[1];
|
|
106
|
+
return (_jsx("div", { className: "w-full max-w-md", children: _jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Label, { variant: "label-lg", children: "Label" }), _jsx(Tooltip, { title: "?", children: _jsx(LUIcon, { variant: "padded", size: "md", shape: "rounded", icon: "question", color: "light-blue" }) })] }), _jsx(DatePicker, { placeholder: "MM/DD/YYYY", date: date, onChange: setDate }), _jsx(Caption, { variant: "sm", children: "Enter your application/validation/helper content here" })] }) }));
|
|
107
|
+
};
|
|
108
|
+
export var Sizes = function () {
|
|
109
|
+
var sizes = Object.keys(inputVariantConfig.size);
|
|
110
|
+
var _a = useState({}), dates = _a[0], setDates = _a[1];
|
|
111
|
+
var handleDateChange = function (size, date) {
|
|
112
|
+
setDates(function (prev) {
|
|
113
|
+
var _a;
|
|
114
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[size] = date, _a)));
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
return (_jsx("div", { className: "space-y-4 w-full max-w-md", children: sizes.map(function (size) { return (_jsxs("div", { children: [_jsx(Body, { variant: "body-sm-500", className: "mb-2", children: size.charAt(0).toUpperCase() + size.slice(1) }), _jsx(DatePicker, { size: size, placeholder: "MM/DD/YYYY", date: dates[size], onChange: function (date) { return handleDateChange(size, date); } })] }, size)); }) }));
|
|
118
|
+
};
|
|
119
|
+
export var WithIcons = function () {
|
|
120
|
+
var _a = useState(null), dateStart = _a[0], setDateStart = _a[1];
|
|
121
|
+
var _b = useState(null), dateBoth = _b[0], setDateBoth = _b[1];
|
|
122
|
+
return (_jsxs("div", { className: "space-y-4 w-full max-w-md", children: [_jsxs("div", { children: [_jsx(Body, { variant: "body-sm-500", className: "mb-2", children: "With Start Icon" }), _jsx(DatePicker, { startIcon: "plus", placeholder: "MM/DD/YYYY", date: dateStart, onChange: setDateStart })] }), _jsxs("div", { children: [_jsx(Body, { variant: "body-sm-500", className: "mb-2", children: "With Both Icons" }), _jsx(DatePicker, { startIcon: "plus", endIcon: "calendar-days", placeholder: "MM/DD/YYYY", date: dateBoth, onChange: setDateBoth })] })] }));
|
|
123
|
+
};
|
|
124
|
+
export var ValidationStates = function () {
|
|
125
|
+
var _a = useState(null), dateDefault = _a[0], setDateDefault = _a[1];
|
|
126
|
+
var _b = useState(new Date()), dateSuccess = _b[0], setDateSuccess = _b[1];
|
|
127
|
+
var _c = useState(null), dateWarning = _c[0], setDateWarning = _c[1];
|
|
128
|
+
var _d = useState(null), dateError = _d[0], setDateError = _d[1];
|
|
129
|
+
return (_jsxs("div", { className: "space-y-4 w-full max-w-md", children: [_jsxs("div", { children: [_jsx(Body, { variant: "body-sm-500", className: "mb-2", children: "Default" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { variant: "label-lg", children: "Label" }), _jsx(DatePicker, { placeholder: "MM/DD/YYYY", date: dateDefault, onChange: setDateDefault }), _jsx(Caption, { variant: "sm", children: "Enter your application/validation/helper content here" })] })] }), _jsxs("div", { children: [_jsx(Body, { variant: "body-sm-500", className: "mb-2", children: "Success" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { variant: "label-lg", children: "Label" }), _jsx(DatePicker, { placeholder: "MM/DD/YYYY", color: "success", date: dateSuccess, onChange: setDateSuccess }), _jsx(Caption, { variant: "sm", children: "Correct date selected" })] })] }), _jsxs("div", { children: [_jsx(Body, { variant: "body-sm-500", className: "mb-2", children: "Warning" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { variant: "label-lg", children: "Label" }), _jsx(DatePicker, { placeholder: "MM/DD/YYYY", color: "warning", date: dateWarning, onChange: setDateWarning }), _jsx(Caption, { variant: "sm", children: "Please verify the selected date" })] })] }), _jsxs("div", { children: [_jsx(Body, { variant: "body-sm-500", className: "mb-2", children: "Error" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { variant: "label-lg", children: "Label" }), _jsx(DatePicker, { placeholder: "MM/DD/YYYY", color: "danger", date: dateError, onChange: setDateError }), _jsx(Caption, { variant: "sm", children: "Invalid date selection" })] })] })] }));
|
|
130
|
+
};
|
|
131
|
+
export var Disabled = function () {
|
|
132
|
+
return (_jsx("div", { className: "w-full max-w-md", children: _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { variant: "label-lg", children: "Label" }), _jsx(DatePicker, { placeholder: "MM/DD/YYYY", disabled: true })] }) }));
|
|
133
|
+
};
|
|
134
|
+
export var Shapes = function () {
|
|
135
|
+
var shapes = Object.keys(inputVariantConfig.shape);
|
|
136
|
+
var _a = useState({}), dates = _a[0], setDates = _a[1];
|
|
137
|
+
var handleDateChange = function (shape, date) {
|
|
138
|
+
setDates(function (prev) {
|
|
139
|
+
var _a;
|
|
140
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[shape] = date, _a)));
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
return (_jsx("div", { className: "space-y-4 w-full max-w-md", children: shapes.map(function (shape) { return (_jsxs("div", { children: [_jsx(Body, { variant: "body-sm-500", className: "mb-2", children: shape.charAt(0).toUpperCase() + shape.slice(1) }), _jsx(DatePicker, { shape: shape, placeholder: "MM/DD/YYYY", date: dates[shape], onChange: function (date) { return handleDateChange(shape, date); } })] }, shape)); }) }));
|
|
144
|
+
};
|
|
145
|
+
export var CalendarSizes = function () {
|
|
146
|
+
var sizes = Object.keys(inputVariantConfig.size);
|
|
147
|
+
var _a = useState({}), dates = _a[0], setDates = _a[1];
|
|
148
|
+
return (_jsx("div", { className: "flex gap-8 items-start flex-wrap", children: sizes.map(function (size) {
|
|
149
|
+
var _a;
|
|
150
|
+
return (_jsxs("div", { className: "flex flex-col items-center", children: [_jsx(Body, { variant: "body-sm-500", className: "mb-4", children: size.charAt(0).toUpperCase() + size.slice(1) }), _jsx("div", { className: "border border-gray-200 rounded-lg shadow-lg p-0 bg-white", children: _jsx(Calendar, { mode: "single",
|
|
151
|
+
selected: (_a = dates[size]) !== null && _a !== void 0 ? _a : undefined,
|
|
152
|
+
onSelect: function (date) {
|
|
153
|
+
setDates(function (prev) {
|
|
154
|
+
var _a;
|
|
155
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[size] = date !== null && date !== void 0 ? date : null, _a)));
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
calendarSize: size }) })] }, size));
|
|
159
|
+
}) }));
|
|
160
|
+
};
|
|
161
|
+
export var Shadows = function () {
|
|
162
|
+
var shadows = Object.keys(datePickerStyles.shadow);
|
|
163
|
+
var _a = useState({}), dates = _a[0], setDates = _a[1];
|
|
164
|
+
var handleDateChange = function (shadow, date) {
|
|
165
|
+
setDates(function (prev) {
|
|
166
|
+
var _a;
|
|
167
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[shadow] = date, _a)));
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
return (_jsx("div", { className: "space-y-4 w-full max-w-md", children: shadows.map(function (shadow) { return (_jsxs("div", { children: [_jsx(Body, { variant: "body-sm-500", className: "mb-2", children: shadow !== "none" ? "With Shadow" : "Without Shadow" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Label, { variant: "label-lg", children: "Label" }), _jsx(DatePicker, { placeholder: "MM/DD/YYYY", shadow: shadow, date: dates[shadow], onChange: function (date) { return handleDateChange(shadow, date); } })] })] }, shadow)); }) }));
|
|
171
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { inputVariantConfig } from "../Input/input";
|
|
2
|
+
export declare const Default_DatePicker_Variant: keyof typeof inputVariantConfig.variant;
|
|
3
|
+
export declare const Default_DatePicker_Size: keyof typeof inputVariantConfig.size;
|
|
4
|
+
export declare const Default_DatePicker_Color: keyof typeof inputVariantConfig.color;
|
|
5
|
+
export declare const Default_DatePicker_Shape: keyof typeof inputVariantConfig.shape;
|
|
6
|
+
export declare const datePickerStyles: {
|
|
7
|
+
shadow: {
|
|
8
|
+
lg: string;
|
|
9
|
+
none: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const Default_DatePicker_Shadow: keyof typeof datePickerStyles.shadow;
|
|
13
|
+
export { DatePicker } from "./DatePicker";
|
|
14
|
+
export type { DatePickerProps } from "./types";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export var Default_DatePicker_Variant = "filled";
|
|
2
|
+
export var Default_DatePicker_Size = "lg";
|
|
3
|
+
export var Default_DatePicker_Color = "default";
|
|
4
|
+
export var Default_DatePicker_Shape = "square";
|
|
5
|
+
export var datePickerStyles = {
|
|
6
|
+
shadow: {
|
|
7
|
+
lg: "rounded-md shadow-lg border border-gray-200",
|
|
8
|
+
none: "",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
export var Default_DatePicker_Shadow = "lg";
|
|
12
|
+
export { DatePicker } from "./DatePicker";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { inputVariantConfig, inputVariants } from "../Input/input";
|
|
3
|
+
import { iconList } from "../../utils/iconList";
|
|
4
|
+
import { datePickerStyles } from ".";
|
|
5
|
+
export interface DatePickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "size" | "color" | "onChange">, VariantProps<typeof inputVariants> {
|
|
6
|
+
date?: Date | null;
|
|
7
|
+
onChange?: (date: Date | null) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
startIcon?: keyof typeof iconList;
|
|
11
|
+
endIcon?: keyof typeof iconList;
|
|
12
|
+
shape?: keyof typeof inputVariantConfig.shape;
|
|
13
|
+
shadow?: keyof typeof datePickerStyles.shadow;
|
|
14
|
+
minDate?: Date;
|
|
15
|
+
maxDate?: Date;
|
|
16
|
+
size?: keyof typeof inputVariantConfig.size;
|
|
17
|
+
color?: keyof typeof inputVariantConfig.color;
|
|
18
|
+
variant?: keyof typeof inputVariantConfig.variant;
|
|
19
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
-
import { checkBoxSize, dropdownMenuSize } from ".";
|
|
3
|
+
import { checkBoxSize, dropdownContentPosition, dropdownMenuSize } from ".";
|
|
4
4
|
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
5
5
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -13,9 +13,13 @@ declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<Dropd
|
|
|
13
13
|
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
14
14
|
size?: keyof typeof dropdownMenuSize;
|
|
15
15
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export type DropdownMenuContentProps = React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> & {
|
|
17
|
+
size?: keyof typeof dropdownMenuSize;
|
|
18
|
+
align?: keyof typeof dropdownContentPosition;
|
|
19
|
+
};
|
|
16
20
|
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
17
21
|
size?: keyof typeof dropdownMenuSize;
|
|
18
|
-
align?:
|
|
22
|
+
align?: keyof typeof dropdownContentPosition;
|
|
19
23
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
20
24
|
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
21
25
|
inset?: boolean;
|