linkedunion-design-kit 1.10.4 → 1.10.5-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/build/types/app/layout.js +1 -1
- package/dist/build/types/app/page.js +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -1
- package/dist/src/components/Alerts/Alert/alert.js +1 -0
- package/dist/src/components/Avatar/Avatar/Avatar1.stories.d.ts +17 -0
- package/dist/src/components/Avatar/Avatar/Avatar1.stories.js +68 -0
- package/dist/src/components/Avatar/Avatar/type.d.ts +12 -0
- package/dist/src/components/Avatar/Avatar/type.js +1 -0
- package/dist/src/components/Button/Button/Button.d.ts +1 -1
- package/dist/src/components/Button/Button/Button.module.css +1 -1
- package/dist/src/components/Button/Button/Button.stories.d.ts +2 -2
- 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 +1 -0
- package/dist/src/components/Button/index.js +1 -0
- package/dist/src/components/Card/contactProfile/ContactProfile.js +4 -3
- package/dist/src/components/Card/contactProfile/ContactProfile.stories.d.ts +1 -0
- package/dist/src/components/Card/contactProfile/ContactProfile.stories.js +4 -1
- package/dist/src/components/Card/type.d.ts +3 -0
- 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/DatePicker/types.js +1 -0
- package/dist/src/components/Dropdown/Combobox/dialog.d.ts +15 -0
- package/dist/src/components/Dropdown/Combobox/dialog.js +68 -0
- package/dist/src/components/Modal/Dialog/Dialog.stories.d.ts +8 -0
- package/dist/src/components/Modal/Dialog/Dialog.stories.js +21 -0
- package/dist/src/components/Modal/Modal.d.ts +41 -0
- package/dist/src/components/Modal/Modal.js +85 -0
- package/dist/src/components/Modal/Modal.stories.d.ts +107 -0
- package/dist/src/components/Modal/Modal.stories.js +119 -0
- package/dist/src/components/Modal/index.d.ts +45 -0
- package/dist/src/components/Modal/index.js +53 -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/avatar.d.ts +13 -0
- package/dist/src/components/ui/avatar.js +53 -0
- package/dist/src/components/ui/calendar.d.ts +10 -0
- package/dist/src/components/ui/calendar.js +222 -0
- package/dist/src/components/ui/command.d.ts +1 -1
- package/dist/src/components/ui/command.js +1 -1
- package/dist/src/components/ui/dialog.js +1 -1
- package/dist/src/utils/constants.d.ts +4 -0
- package/dist/src/utils/constants.js +4 -0
- package/dist/src/utils/iconList.d.ts +1 -0
- package/dist/src/utils/iconList.js +1 -0
- package/dist/styles/global.css +555 -6
- package/dist/tailwind.config.js +1 -0
- package/package.json +4 -2
- package/dist/src/components/Input/DatePicker.d.ts +0 -3
- package/dist/src/components/Input/DatePicker.js +0 -255
- package/dist/src/components/Input/DatePicker.stories.d.ts +0 -15
- package/dist/src/components/Input/DatePicker.stories.js +0 -253
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// File: /Users/
|
|
1
|
+
// File: /Users/avialdosolutions/linkedunion-design-kit/linkedunion-design-kit/app/layout.tsx
|
|
2
2
|
import * as entry from '../../../app/layout.js';
|
|
3
3
|
// Check that the entry is a valid entry
|
|
4
4
|
checkFields();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// File: /Users/
|
|
1
|
+
// File: /Users/avialdosolutions/linkedunion-design-kit/linkedunion-design-kit/app/page.tsx
|
|
2
2
|
import * as entry from '../../../app/page.js';
|
|
3
3
|
// Check that the entry is a valid entry
|
|
4
4
|
checkFields();
|
package/dist/index.d.ts
CHANGED
|
@@ -23,11 +23,15 @@ export { AppIcon } from "./src/components/AppIcons";
|
|
|
23
23
|
export { Tabs, TabsList, TabsTrigger, TabsContent, } from "./src/components/Tabs/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
|
+
export { Alert, AlertAction, AlertCancel, AlertHeader, AlertTitle, AlertDescription, AlertFooter, } from "./src/components/Alerts/Alert/alert";
|
|
26
27
|
export { Avatar, AvatarImage, AvatarFallback, } from "./src/components/Avatar/Avatar/Avatar";
|
|
27
|
-
export { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, } from "./src/components/Table/Table";
|
|
28
|
+
export { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, TableButton, TableCellPadded, TableFooter, } from "./src/components/Table/Table";
|
|
28
29
|
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuCheckboxItem, DropdownMenuLabel, DropdownMenuSubTrigger, DropdownMenuSub, DropdownMenuSubContent, } from "./src/components/Dropdown/DropdownMenu/DropdownMenu";
|
|
29
30
|
export { Badge } from "./src/components/Badge/Badge";
|
|
30
31
|
export { default as Combobox } from "./src/components/Dropdown/Combobox/Combobox";
|
|
31
32
|
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./src/components/Pagination/pagination";
|
|
32
33
|
export { Skeleton } from "./src/components/Skeleton/skeleton";
|
|
33
34
|
export { Tabs as VerticalTabs, TabsContent as VerticalTabsContent, TabsList as VerticalTabsList, tabSizes as verticalTabsSize, TabsTrigger as VerticalTabsTrigger, TabsHeading as VerticalTabsHeading, } from "./src/components/VerticalTabs/VerticalTabs";
|
|
35
|
+
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogSubTitle, DialogBody, DialogFooter, DialogAction, DialogClose, } from "./src/components/Modal/Modal";
|
|
36
|
+
export { DatePicker } from "./src/components/DatePicker/DatePicker";
|
|
37
|
+
export { TimePicker } from "./src/components/TimePicker/TimePicker";
|
package/dist/index.js
CHANGED
|
@@ -23,11 +23,15 @@ export { AppIcon } from "./src/components/AppIcons";
|
|
|
23
23
|
export { Tabs, TabsList, TabsTrigger, TabsContent, } from "./src/components/Tabs/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
|
+
export { Alert, AlertAction, AlertCancel, AlertHeader, AlertTitle, AlertDescription, AlertFooter, } from "./src/components/Alerts/Alert/alert";
|
|
26
27
|
export { Avatar, AvatarImage, AvatarFallback, } from "./src/components/Avatar/Avatar/Avatar";
|
|
27
|
-
export { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, } from "./src/components/Table/Table";
|
|
28
|
+
export { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, TableButton, TableCellPadded, TableFooter, } from "./src/components/Table/Table";
|
|
28
29
|
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuCheckboxItem, DropdownMenuLabel, DropdownMenuSubTrigger, DropdownMenuSub, DropdownMenuSubContent, } from "./src/components/Dropdown/DropdownMenu/DropdownMenu";
|
|
29
30
|
export { Badge } from "./src/components/Badge/Badge";
|
|
30
31
|
export { default as Combobox } from "./src/components/Dropdown/Combobox/Combobox";
|
|
31
32
|
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./src/components/Pagination/pagination";
|
|
32
33
|
export { Skeleton } from "./src/components/Skeleton/skeleton";
|
|
33
34
|
export { Tabs as VerticalTabs, TabsContent as VerticalTabsContent, TabsList as VerticalTabsList, tabSizes as verticalTabsSize, TabsTrigger as VerticalTabsTrigger, TabsHeading as VerticalTabsHeading, } from "./src/components/VerticalTabs/VerticalTabs";
|
|
35
|
+
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogSubTitle, DialogBody, DialogFooter, DialogAction, DialogClose, } from "./src/components/Modal/Modal";
|
|
36
|
+
export { DatePicker } from "./src/components/DatePicker/DatePicker";
|
|
37
|
+
export { TimePicker } from "./src/components/TimePicker/TimePicker";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Avatar } from "../../../components/ui/avatar";
|
|
2
|
+
import { Meta } from "@storybook/react";
|
|
3
|
+
import { avatar1Shape, avatar1Size } from ".";
|
|
4
|
+
declare const _default: Meta<typeof Avatar>;
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, Omit<import("@radix-ui/react-avatar").AvatarProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & {
|
|
7
|
+
size?: keyof typeof avatar1Size;
|
|
8
|
+
shape?: keyof typeof avatar1Shape;
|
|
9
|
+
status?: "online" | "offline" | "busy" | "away";
|
|
10
|
+
} & import("react").RefAttributes<HTMLSpanElement>>;
|
|
11
|
+
export declare const AvatarSize: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const AvatarFallBackValue: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const AvatarShape: () => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const AvatarWithNoImageAndFallBackValue: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const AvatarShapeSizeCombination: () => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const AvatarStatusIndicator: () => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const RoundedAvatarStatusIndicatorSize: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
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 { Avatar, AvatarImage, AvatarFallback } from "../../../components/ui/avatar";
|
|
14
|
+
import { avatar1Shape, avatar1Size } from ".";
|
|
15
|
+
export default {
|
|
16
|
+
title: "Components/Avatar/Avatar1",
|
|
17
|
+
component: Avatar,
|
|
18
|
+
argTypes: {
|
|
19
|
+
size: {
|
|
20
|
+
control: {
|
|
21
|
+
type: "select",
|
|
22
|
+
options: Object.keys(avatar1Size),
|
|
23
|
+
},
|
|
24
|
+
description: "The size of the avatar.",
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: "string" },
|
|
27
|
+
defaultValue: { summary: "md" },
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
shape: {
|
|
31
|
+
control: {
|
|
32
|
+
type: "select",
|
|
33
|
+
options: Object.keys(avatar1Shape),
|
|
34
|
+
},
|
|
35
|
+
description: "The shape of the avatar.",
|
|
36
|
+
table: {
|
|
37
|
+
type: { summary: "string" },
|
|
38
|
+
defaultValue: { summary: "rounded" },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
status: {
|
|
42
|
+
control: {
|
|
43
|
+
type: "select",
|
|
44
|
+
options: ["online", "offline", "busy", "away"],
|
|
45
|
+
},
|
|
46
|
+
description: "The status of the avatar.",
|
|
47
|
+
table: {
|
|
48
|
+
type: { summary: "string" },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
var Template = function (args) {
|
|
54
|
+
return (_jsxs(Avatar, __assign({}, args, { children: [_jsx(AvatarImage, { src: "https://www.w3schools.com/howto/img_avatar2.png", alt: "Avatar" }), _jsx(AvatarFallback, { children: "AB" })] })));
|
|
55
|
+
};
|
|
56
|
+
export var Default = Template.bind({});
|
|
57
|
+
export var AvatarSize = function () { return (_jsx("div", { className: "flex flex-row space-x-2", children: Object.keys(avatar1Size).map(function (size) { return (_jsxs(Avatar, { size: size, children: [_jsx(AvatarImage, { src: "https://www.w3schools.com/howto/img_avatar2.png", alt: "Avatar" }), _jsx(AvatarFallback, { children: "AB" })] }, size)); }) })); };
|
|
58
|
+
export var AvatarFallBackValue = function () { return (_jsx("div", { className: "flex flex-row space-x-2", children: Object.keys(avatar1Size).map(function (size) { return (_jsxs(Avatar, { size: size, children: [_jsx(AvatarImage, { src: "", alt: "Avatar" }), _jsx(AvatarFallback, { children: "AB" })] }, size)); }) })); };
|
|
59
|
+
export var AvatarShape = function () { return (_jsx("div", { className: "flex flex-row space-x-2", children: Object.keys(avatar1Shape).map(function (shape) { return (_jsxs(Avatar, { shape: shape, size: "massive", status: "online", children: [_jsx(AvatarImage, { src: "https://www.w3schools.com/howto/img_avatar2.png", alt: "Avatar" }), _jsx(AvatarFallback, { children: "AB" })] }, shape)); }) })); };
|
|
60
|
+
export var AvatarWithNoImageAndFallBackValue = function () {
|
|
61
|
+
var user = { name: "", image: null };
|
|
62
|
+
return (_jsx("div", { className: "flex flex-row space-x-2", children: _jsxs(Avatar, { size: "md", children: [_jsx(AvatarImage, { src: "", alt: "User avatar" }), _jsx(AvatarFallback, { children: (user === null || user === void 0 ? void 0 : user.name) ? user.name.charAt(0) : null })] }) }));
|
|
63
|
+
};
|
|
64
|
+
export var AvatarShapeSizeCombination = function () { return (_jsx("div", { className: "flex flex-col space-y-2", children: Object.keys(avatar1Shape).map(function (shape) {
|
|
65
|
+
return Object.keys(avatar1Size).map(function (size) { return (_jsxs(Avatar, { shape: shape, size: size, children: [_jsx(AvatarImage, { src: "https://www.w3schools.com/howto/img_avatar2.png", alt: "Avatar" }), _jsx(AvatarFallback, { children: "AB" })] }, "".concat(shape, "-").concat(size))); });
|
|
66
|
+
}) })); };
|
|
67
|
+
export var AvatarStatusIndicator = function () { return (_jsx("div", { className: "flex flex-row space-x-2", children: ["online", "offline", "busy", "away"].map(function (status) { return (_jsxs(Avatar, { size: "massive", shape: "square", status: status, children: [_jsx(AvatarImage, { src: "https://www.w3schools.com/howto/img_avatar2.png", alt: "Avatar" }), _jsx(AvatarFallback, { children: "AB" })] }, status)); }) })); };
|
|
68
|
+
export var RoundedAvatarStatusIndicatorSize = function () { return (_jsx("div", { className: "flex flex-row space-x-2", children: Object.keys(avatar1Size).map(function (size) { return (_jsxs(Avatar, { size: size, shape: "rounded", status: "online", children: [_jsx(AvatarImage, { src: "https://www.w3schools.com/howto/img_avatar2.png", alt: "Avatar" }), _jsx(AvatarFallback, { children: "AB" })] }, size)); }) })); };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { avatarShape, avatarSize } from ".";
|
|
2
|
+
import { iconList } from "../../../utils/iconList";
|
|
3
|
+
type avatarSize = keyof typeof avatarSize;
|
|
4
|
+
type avatarShape = keyof typeof avatarShape;
|
|
5
|
+
export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
image?: string;
|
|
7
|
+
icon?: keyof typeof iconList;
|
|
8
|
+
shape?: avatarShape;
|
|
9
|
+
size?: avatarSize;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,7 +16,7 @@ export declare const variant: {
|
|
|
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
18
|
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
19
|
-
shape?: "rounded-sm" | "rounded-full" | null | undefined;
|
|
19
|
+
shape?: "rounded-sm" | "rounded-full" | "rounded-none" | null | undefined;
|
|
20
20
|
variant?: "link" | "fill" | "outline" | "ghost" | null | undefined;
|
|
21
21
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
22
22
|
declare function Button({ className, color, size, shape, variant, asChild, startIcon, endIcon, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -393,7 +393,7 @@ declare const meta: {
|
|
|
393
393
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
394
394
|
size?: "sm" | "md" | "lg" | "xl" | 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
397
|
asChild?: boolean | undefined;
|
|
398
398
|
startIcon?: keyof typeof import("../../../utils/iconList").iconList | undefined;
|
|
399
399
|
endIcon?: keyof typeof import("../../../utils/iconList").iconList | undefined;
|
|
@@ -693,7 +693,7 @@ declare const meta: {
|
|
|
693
693
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
694
694
|
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
695
695
|
variant?: "fill" | "link" | "outline" | "ghost" | undefined;
|
|
696
|
-
shape?: "rounded-sm" | "rounded-full" | null | undefined;
|
|
696
|
+
shape?: "rounded-sm" | "rounded-full" | "rounded-none" | null | undefined;
|
|
697
697
|
asChild?: boolean | undefined;
|
|
698
698
|
startIcon?: keyof typeof import("../../../utils/iconList").iconList | undefined;
|
|
699
699
|
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)[];
|
|
@@ -4,6 +4,7 @@ import LuImage from "../../Images/LuImage";
|
|
|
4
4
|
import { Heading } from "../../Typography/Heading/heading";
|
|
5
5
|
import { Body } from "../../Typography/Body/body";
|
|
6
6
|
import { Button } from "../../Button/Button/Button";
|
|
7
|
+
import LUIcon from "../../../components/Icons/LUIcon";
|
|
7
8
|
export var ContactProfile = function (_a) {
|
|
8
9
|
var item = _a.item, image = _a.image, href = _a.href, btnLabel = _a.btnLabel, editor = _a.editor, mediaPosition = _a.mediaPosition, orientation = _a.orientation;
|
|
9
10
|
// Normalize mediaPosition based on orientation
|
|
@@ -22,16 +23,16 @@ export var ContactProfile = function (_a) {
|
|
|
22
23
|
// Common content section component
|
|
23
24
|
var CardContent = function (_a) {
|
|
24
25
|
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
25
|
-
return (_jsxs("div", { className: "flex flex-col !gap-1 ".concat(className), children: [_jsx(Heading, { variant: "h5-600", className: "".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle, " capitalize
|
|
26
|
+
return (_jsxs("div", { className: "flex flex-col !gap-1 ".concat(className, " min-w-0"), children: [(item === null || item === void 0 ? void 0 : item.designation) && (_jsx(Body, { variant: "body-md", className: "text-gray-600 capitalize truncate min-w-0", children: item === null || item === void 0 ? void 0 : item.designation })), _jsx(Heading, { variant: "h5-600", className: "".concat(editor === null || editor === void 0 ? void 0 : editor.cardTitle, " capitalize truncate min-w-0"), children: item === null || item === void 0 ? void 0 : item.title }), _jsx(Body, { variant: "body-md", className: " ".concat(orientation === "horizontal" ? "line-clamp-1" : "line-clamp-2", " ").concat(editor === null || editor === void 0 ? void 0 : editor.cardText), children: item === null || item === void 0 ? void 0 : item.description }), (item === null || item === void 0 ? void 0 : item.email) && (_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx(LUIcon, { icon: "envelope", size: "lg" }), _jsx(Body, { variant: "body-md", className: "text-gray-600 truncate min-w-0", children: item === null || item === void 0 ? void 0 : item.email })] })), (item === null || item === void 0 ? void 0 : item.phone) && (_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [_jsx(LUIcon, { icon: "phone", size: "lg" }), _jsx(Body, { variant: "body-md", className: "text-gray-600 truncate min-w-0", children: item === null || item === void 0 ? void 0 : item.phone })] }))] }));
|
|
26
27
|
};
|
|
27
28
|
// Common button component
|
|
28
29
|
var CardButton = function (_a) {
|
|
29
30
|
var _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
30
|
-
return (_jsx(Link, { href: href || "#", passHref: true, children: _jsx(Button, { endIcon: "angle-right", size: "sm", className: "".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn, " ").concat(className), children: btnLabel }) }));
|
|
31
|
+
return btnLabel ? (_jsx(Link, { href: href || "#", passHref: true, children: _jsx(Button, { endIcon: "angle-right", size: "sm", className: "".concat(editor === null || editor === void 0 ? void 0 : editor.cardBtn, " ").concat(className), children: btnLabel }) })) : null;
|
|
31
32
|
};
|
|
32
33
|
// Horizontal layout
|
|
33
34
|
if (orientation === "horizontal") {
|
|
34
|
-
return (_jsxs("div", { className: "!p-5 bg-white rounded-xl flex ".concat(safeMediaPosition === "left" ? "sm:flex-row" : "sm:flex-row-reverse", " max-w-5xl !gap-5 items-center shadow-lg ").concat(editor === null || editor === void 0 ? void 0 : editor.card), children: [_jsx(CardMedia, { className: "".concat(safeMediaPosition === "right" ? "order-3" : "order-1", " w-full max-w-40 aspect-square object-cover") }), _jsxs("div", { className: "flex-1 flex flex-col !gap-1 md:!gap-2.5 text-center sm:!text-left h-full justify-center ".concat(safeMediaPosition === "right" ? "order-1" : "order-2"), children: [_jsx(CardContent, {}), _jsx(CardButton, {})] })] }));
|
|
35
|
+
return (_jsxs("div", { className: "!p-5 bg-white rounded-xl flex ".concat(safeMediaPosition === "left" ? "sm:flex-row" : "sm:flex-row-reverse", " max-w-5xl !gap-5 items-center shadow-lg ").concat(editor === null || editor === void 0 ? void 0 : editor.card), children: [_jsx(CardMedia, { className: "".concat(safeMediaPosition === "right" ? "order-3" : "order-1", " w-full max-w-40 aspect-square object-cover") }), _jsxs("div", { className: "flex-1 flex flex-col !gap-1 md:!gap-2.5 text-center sm:!text-left h-full justify-center min-w-0 ".concat(safeMediaPosition === "right" ? "order-1" : "order-2"), children: [_jsx(CardContent, {}), _jsx(CardButton, {})] })] }));
|
|
35
36
|
}
|
|
36
37
|
// Vertical layout
|
|
37
38
|
return (_jsxs("div", { className: "p-8 bg-white rounded-xl flex flex-col gap-6 max-w-md items-center shadow-lg ".concat(editor === null || editor === void 0 ? void 0 : editor.card), children: [_jsxs("div", { className: "flex w-full ".concat(safeMediaPosition === "top" ? "flex-col" : "flex-col-reverse", " items-center !gap-5 text-center"), children: [_jsx(CardMedia, { className: "w-full h-full aspect-5/4 object-cover" }), _jsx(CardContent, { className: "h-20" })] }), _jsx(CardButton, {})] }));
|
|
@@ -11,3 +11,4 @@ export declare const ContactProfileHorizontalRight: Story;
|
|
|
11
11
|
export declare const ContactProfileVerticalTop: Story;
|
|
12
12
|
export declare const ContactProfileVerticalMiddle: Story;
|
|
13
13
|
export declare const ContactProfileVerticalBottom: Story;
|
|
14
|
+
export declare const ContactProfileWithFullInfo: Story;
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { Dummy_Image, Dummy_Para, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
|
|
13
|
+
import { DUMMY_designation, DUMMY_email, Dummy_Image, Dummy_Para, DUMMY_phone, Dummy_Title, Dummy_Url, } from "../../../utils/constants";
|
|
14
14
|
import { OrientationEnum } from "../../../utils/enums";
|
|
15
15
|
import Card from "../card";
|
|
16
16
|
var meta = {
|
|
@@ -98,3 +98,6 @@ export var ContactProfileVerticalMiddle = {
|
|
|
98
98
|
export var ContactProfileVerticalBottom = {
|
|
99
99
|
args: __assign(__assign({ type: "contactProfile" }, baseCardArgs), { orientation: OrientationEnum.vertical, mediaPosition: "bottom" }),
|
|
100
100
|
};
|
|
101
|
+
export var ContactProfileWithFullInfo = {
|
|
102
|
+
args: __assign(__assign({ type: "contactProfile" }, baseCardArgs), { item: __assign(__assign({}, baseCardArgs.item), { designation: DUMMY_designation, email: DUMMY_email, phone: DUMMY_phone }), orientation: OrientationEnum.horizontal, mediaPosition: "left", btnLabel: undefined }),
|
|
103
|
+
};
|
|
@@ -18,7 +18,10 @@ export interface CardDataProps {
|
|
|
18
18
|
title?: string;
|
|
19
19
|
short_description?: string;
|
|
20
20
|
description?: string;
|
|
21
|
+
designation?: string;
|
|
21
22
|
images?: AlbumGalleryDataProps[];
|
|
23
|
+
email?: string;
|
|
24
|
+
phone?: string;
|
|
22
25
|
}
|
|
23
26
|
export interface CardInterface {
|
|
24
27
|
mediaPosition?: "top" | "middle" | "bottom" | "left" | "right";
|
|
@@ -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";
|