linkedunion-design-kit 1.10.3 → 1.10.4-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 +4 -2
- package/dist/index.js +4 -2
- 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 +2 -1
- 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/ColorPicker/ColorPicker.stories.js +1 -1
- package/dist/src/components/ColorPicker/index.d.ts +1 -1
- 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/{ui → Dropdown/Combobox}/dialog.js +1 -1
- package/dist/src/components/Input/Input.stories.d.ts +1 -2
- package/dist/src/components/Input/Input.stories.js +2 -7
- package/dist/src/components/Input/index.d.ts +17 -90
- package/dist/src/components/Input/index.js +8 -83
- package/dist/src/components/Input/input.d.ts +27 -8
- package/dist/src/components/Input/input.js +29 -7
- package/dist/src/components/Input/type.d.ts +10 -18
- package/dist/src/components/Label/Label.d.ts +1 -1
- package/dist/src/components/Modal/Modal.d.ts +31 -0
- package/dist/src/components/Modal/Modal.js +78 -0
- package/dist/src/components/Modal/Modal.stories.d.ts +32 -0
- package/dist/src/components/Modal/Modal.stories.js +44 -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/components/ui/command.d.ts +1 -1
- package/dist/src/components/ui/command.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 +556 -49
- package/package.json +4 -2
- package/dist/build/types/app/layout.d.ts +0 -12
- package/dist/build/types/app/layout.js +0 -22
- package/dist/build/types/app/page.d.ts +0 -12
- package/dist/build/types/app/page.js +0 -22
- package/dist/build/types/validator.js +0 -12
- 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
- /package/dist/{build/types/validator.d.ts → src/components/DatePicker/types.js} +0 -0
- /package/dist/src/components/{ui → Dropdown/Combobox}/dialog.d.ts +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -24,11 +24,13 @@ 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";
|
|
31
31
|
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./src/components/Pagination/pagination";
|
|
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
|
-
export {
|
|
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";
|
package/dist/index.js
CHANGED
|
@@ -24,11 +24,13 @@ 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";
|
|
31
31
|
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./src/components/Pagination/pagination";
|
|
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
|
-
export {
|
|
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";
|
|
@@ -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)[];
|
|
@@ -14,7 +14,7 @@ export var buttonStyles = {
|
|
|
14
14
|
"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
15
|
gray: "bg-gray-900 text-gray-50 hover:bg-gray-100 hover:text-gray-950 active:bg-gray-300 active:text-gray-950",
|
|
16
16
|
"light-gray": "bg-gray-50 text-gray-950 hover:bg-gray-100 active:bg-gray-300",
|
|
17
|
-
disabled: "bg-gray-100 text-gray-300",
|
|
17
|
+
disabled: "bg-gray-100 text-gray-300 cursor-not-allowed",
|
|
18
18
|
},
|
|
19
19
|
size: {
|
|
20
20
|
xl: "h-13 !py-3.5 !px-6 !text-base !font-normal !leading-normal",
|
|
@@ -29,6 +29,7 @@ export var buttonStyles = {
|
|
|
29
29
|
sm: "size-9 !p-2.5",
|
|
30
30
|
},
|
|
31
31
|
shape: {
|
|
32
|
+
"rounded-none": styles["rounded-none"],
|
|
32
33
|
"rounded-sm": styles["rounded-sm"],
|
|
33
34
|
"rounded-full": styles["rounded-full"],
|
|
34
35
|
},
|
|
@@ -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";
|
|
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import ColorPicker from "./ColorPicker";
|
|
14
14
|
import { Label } from "../Label/Label";
|
|
15
|
-
import { inputVariantConfig } from "../Input";
|
|
15
|
+
import { inputVariantConfig } from "../Input/input";
|
|
16
16
|
export default {
|
|
17
17
|
title: "Components/ColorPicker",
|
|
18
18
|
component: ColorPicker,
|
|
@@ -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
|
+
}
|
|
@@ -24,7 +24,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
24
24
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
25
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
26
26
|
import { XIcon } from "lucide-react";
|
|
27
|
-
import { cn } from "
|
|
27
|
+
import { cn } from "../../../lib/utils";
|
|
28
28
|
function Dialog(_a) {
|
|
29
29
|
var props = __rest(_a, []);
|
|
30
30
|
return _jsx(DialogPrimitive.Root, __assign({ "data-slot": "dialog" }, props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta } from "@storybook/react";
|
|
2
|
-
import { InputFieldProps } from "
|
|
2
|
+
import { InputFieldProps } from "./type";
|
|
3
3
|
declare const _default: Meta<InputFieldProps>;
|
|
4
4
|
export default _default;
|
|
5
5
|
export declare const Default: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, InputFieldProps>;
|
|
@@ -11,4 +11,3 @@ export declare const VariantsWithIcons: () => import("react/jsx-runtime").JSX.El
|
|
|
11
11
|
export declare const ErrorValidation: () => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export declare const SuccessValidation: () => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare const WarningValidation: () => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare const DatePickerExample: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,9 +11,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import React from "react";
|
|
14
|
-
import { Input } from "./input";
|
|
15
|
-
import {
|
|
16
|
-
import { inputType, inputVariantConfig } from ".";
|
|
14
|
+
import { Input, inputVariantConfig } from "./input";
|
|
15
|
+
import { inputType } from "."; // Ensure this exports an object like { text: 'text', email: 'email', ... }
|
|
17
16
|
import { Label } from "../Label/Label";
|
|
18
17
|
import LUIcon from "../Icons/LUIcon";
|
|
19
18
|
import Tooltip from "../ToolTip/Tooltip";
|
|
@@ -132,7 +131,3 @@ export var WarningValidation = function () {
|
|
|
132
131
|
? "Password is weak. Consider using 8+ characters"
|
|
133
132
|
: "Enter a secure password" })] }) }));
|
|
134
133
|
};
|
|
135
|
-
export var DatePickerExample = function () {
|
|
136
|
-
var _a = React.useState(null), selectedDate = _a[0], setSelectedDate = _a[1];
|
|
137
|
-
return (_jsx("div", { className: "space-y-4", children: _jsxs("div", { children: [_jsx(Label, { variant: "label-md", children: "Select Date" }), _jsx(DatePicker, { placeholder: "Pick a date", value: selectedDate, onChange: setSelectedDate }), _jsx(Caption, { variant: "md", className: "mt-1 text-gray-500", children: "For full DatePicker documentation, see Components/Input/DatePicker" })] }) }));
|
|
138
|
-
};
|