gwan-design-system 0.1.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/.github/workflows/bump-version.yml +50 -0
- package/.github/workflows/publish.yml +43 -0
- package/CODEOWNERS +1 -0
- package/README.md +54 -0
- package/eslint.config.mjs +16 -0
- package/next.config.ts +7 -0
- package/package.json +27 -0
- package/postcss.config.mjs +7 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/images/empty.png +0 -0
- package/public/images/empty_state.png +0 -0
- package/public/images/hero.png +0 -0
- package/public/images/hero2.png +0 -0
- package/public/images/logo.png +0 -0
- package/public/images/logo_short.png +0 -0
- package/public/images/profile_picture.png +0 -0
- package/public/images/success.png +0 -0
- package/public/next.svg +1 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/src/app/components-library/page.tsx +8 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +108 -0
- package/src/app/layout.tsx +34 -0
- package/src/app/page.tsx +5 -0
- package/src/components/avatar/index.tsx +109 -0
- package/src/components/banner/index.tsx +58 -0
- package/src/components/button/index.tsx +61 -0
- package/src/components/carousel/index.tsx +58 -0
- package/src/components/checkbox/index.tsx +48 -0
- package/src/components/chip/index.tsx +22 -0
- package/src/components/ellipsis/index.tsx +36 -0
- package/src/components/fileUploader/index.tsx +54 -0
- package/src/components/filterDropdown/index.tsx +49 -0
- package/src/components/icons/arrowLeftSVG/index.tsx +14 -0
- package/src/components/icons/checkSVG/index.tsx +14 -0
- package/src/components/icons/chevDownSVG/index.tsx +14 -0
- package/src/components/icons/chevLeftSVG/index.tsx +14 -0
- package/src/components/icons/chevRightSVG/index.tsx +14 -0
- package/src/components/icons/circleSVG/index.tsx +14 -0
- package/src/components/icons/colorsSVG/index.tsx +21 -0
- package/src/components/icons/coversSVG/index.tsx +21 -0
- package/src/components/icons/crossSVG/index.tsx +16 -0
- package/src/components/icons/dashboardSVG/index.tsx +14 -0
- package/src/components/icons/filterSVG/index.tsx +21 -0
- package/src/components/icons/index.tsx +17 -0
- package/src/components/icons/orderInfoSVG/index.tsx +21 -0
- package/src/components/icons/ordersSVG/index.tsx +21 -0
- package/src/components/icons/productsSVG/index.tsx +21 -0
- package/src/components/icons/signOutSVG/index.tsx +21 -0
- package/src/components/icons/templatesSVG/index.tsx +24 -0
- package/src/components/icons/uploadSVG/index.tsx +21 -0
- package/src/components/input/index.tsx +40 -0
- package/src/components/modal/index.tsx +54 -0
- package/src/components/navBar/index.tsx +161 -0
- package/src/components/pagination/index.tsx +69 -0
- package/src/components/radioButton/index.tsx +44 -0
- package/src/components/selectDropdown/index.tsx +90 -0
- package/src/components/snackBar/index.tsx +46 -0
- package/src/components/state/index.tsx +69 -0
- package/src/components/table/index.tsx +51 -0
- package/src/components/tag/index.tsx +33 -0
- package/src/components/timeLine/index.tsx +99 -0
- package/src/components/tooltip/index.tsx +70 -0
- package/src/index.ts +22 -0
- package/src/templates/component-library/avatars/index.tsx +45 -0
- package/src/templates/component-library/banners/index.tsx +35 -0
- package/src/templates/component-library/buttons/index.tsx +122 -0
- package/src/templates/component-library/carousels/index.tsx +38 -0
- package/src/templates/component-library/checkboxes/index.tsx +19 -0
- package/src/templates/component-library/chips/index.tsx +49 -0
- package/src/templates/component-library/ellipsis/index.tsx +20 -0
- package/src/templates/component-library/fileUploaders/index.tsx +21 -0
- package/src/templates/component-library/filterDropdown/index.tsx +48 -0
- package/src/templates/component-library/icons/index.tsx +23 -0
- package/src/templates/component-library/index.tsx +179 -0
- package/src/templates/component-library/input/index.tsx +35 -0
- package/src/templates/component-library/modals/index.tsx +113 -0
- package/src/templates/component-library/navBars/index.tsx +91 -0
- package/src/templates/component-library/pagination/index.tsx +28 -0
- package/src/templates/component-library/radioButtons/index.tsx +33 -0
- package/src/templates/component-library/selectDropdown/index.tsx +90 -0
- package/src/templates/component-library/snackBars/index.tsx +34 -0
- package/src/templates/component-library/states/index.tsx +24 -0
- package/src/templates/component-library/tables/index.tsx +143 -0
- package/src/templates/component-library/tags/index.tsx +15 -0
- package/src/templates/component-library/timeLines/index.tsx +96 -0
- package/src/templates/component-library/tooltips/index.tsx +61 -0
- package/tsconfig.build.json +16 -0
- package/tsconfig.json +27 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { CheckSVG, CircleSVG, CrossSVG } from "../icons";
|
|
3
|
+
|
|
4
|
+
export enum ORDER_STATUS {
|
|
5
|
+
ORDER_PLACED = "Order placed",
|
|
6
|
+
PRINTING_IN_PROGRESS = "Printing in progress",
|
|
7
|
+
PACKAGING = "Packaging",
|
|
8
|
+
DISPATCHED_TO_COURIER = "Dispatched to courier",
|
|
9
|
+
DELIVERED = "Delivered",
|
|
10
|
+
ORDER_CANCELLED = "Order cancelled",
|
|
11
|
+
PENDING = "Pending",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ILog {
|
|
15
|
+
title: ORDER_STATUS;
|
|
16
|
+
date?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ITimeLine {
|
|
21
|
+
logs: ILog[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const TimeLine = ({ logs }: ITimeLine) => {
|
|
25
|
+
const [steps, setSteps] = useState<ILog[]>([]);
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (
|
|
29
|
+
logs[0].title !== ORDER_STATUS.ORDER_CANCELLED &&
|
|
30
|
+
logs[0].title !== ORDER_STATUS.DELIVERED
|
|
31
|
+
) {
|
|
32
|
+
setSteps([
|
|
33
|
+
{
|
|
34
|
+
title: ORDER_STATUS.PENDING,
|
|
35
|
+
},
|
|
36
|
+
...logs,
|
|
37
|
+
]);
|
|
38
|
+
} else {
|
|
39
|
+
setSteps(logs);
|
|
40
|
+
}
|
|
41
|
+
}, [logs]);
|
|
42
|
+
|
|
43
|
+
const getIcon = (status?: ORDER_STATUS) => {
|
|
44
|
+
switch (status) {
|
|
45
|
+
case ORDER_STATUS.ORDER_PLACED:
|
|
46
|
+
case ORDER_STATUS.PRINTING_IN_PROGRESS:
|
|
47
|
+
case ORDER_STATUS.PACKAGING:
|
|
48
|
+
case ORDER_STATUS.DISPATCHED_TO_COURIER:
|
|
49
|
+
case ORDER_STATUS.DELIVERED:
|
|
50
|
+
return (
|
|
51
|
+
<div className="size-5 bg-greenola-500 rounded-full p-1 text-white">
|
|
52
|
+
<CheckSVG />
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
case ORDER_STATUS.ORDER_CANCELLED:
|
|
56
|
+
return (
|
|
57
|
+
<div className="size-5 bg-redola-500 rounded-full p-1 text-white">
|
|
58
|
+
<CrossSVG />
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
default:
|
|
62
|
+
return (
|
|
63
|
+
<div className="size-5 bg-neutrola-600 text-neutrola-200 rounded-full p-1">
|
|
64
|
+
<CircleSVG />
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div>
|
|
72
|
+
{steps.map(({ title, date, description }, index) => (
|
|
73
|
+
<div key={`log_${index}`} className="flex flex-row gap-4">
|
|
74
|
+
<div className="flex flex-col items-center">
|
|
75
|
+
{getIcon(title)}
|
|
76
|
+
<div className="w-0.5 h-full bg-neutrola-500"></div>
|
|
77
|
+
</div>
|
|
78
|
+
<div className="flex flex-col flex-1">
|
|
79
|
+
<p
|
|
80
|
+
className={`text-base font-semibold relative top-[-2px] ${
|
|
81
|
+
title === ORDER_STATUS.PENDING ? "pb-8" : ""
|
|
82
|
+
}`}
|
|
83
|
+
>
|
|
84
|
+
{title}
|
|
85
|
+
</p>
|
|
86
|
+
{title && <p className="text-xs text-neutrola-700">{date}</p>}
|
|
87
|
+
{description && (
|
|
88
|
+
<p className="p-4 text-xs bg-neutrola-50 text-neutral-800 rounded-lg my-2">
|
|
89
|
+
{description}
|
|
90
|
+
</p>
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
))}
|
|
95
|
+
</div>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export default TimeLine;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export enum TOOLTIP_POSITION {
|
|
2
|
+
TOP = "top",
|
|
3
|
+
BOTTOM = "bottom",
|
|
4
|
+
LEFT = "left",
|
|
5
|
+
RIGHT = "right",
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ITooltip {
|
|
9
|
+
position: TOOLTIP_POSITION;
|
|
10
|
+
label: React.ReactNode;
|
|
11
|
+
isVisible: boolean;
|
|
12
|
+
toolTipWidth?: string;
|
|
13
|
+
toolTipClass?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const Tooltip = ({
|
|
17
|
+
position,
|
|
18
|
+
label,
|
|
19
|
+
isVisible = false,
|
|
20
|
+
toolTipWidth = "w-60",
|
|
21
|
+
toolTipClass = "",
|
|
22
|
+
}: ITooltip) => {
|
|
23
|
+
const getTooltipPosition = (position: TOOLTIP_POSITION) => {
|
|
24
|
+
switch (position) {
|
|
25
|
+
case TOOLTIP_POSITION.TOP:
|
|
26
|
+
return "mb-2 bottom-full left-1/2 -translate-x-1/2";
|
|
27
|
+
case TOOLTIP_POSITION.BOTTOM:
|
|
28
|
+
return "mt-2 top-full left-1/2 -translate-x-1/2";
|
|
29
|
+
case TOOLTIP_POSITION.LEFT:
|
|
30
|
+
return "mr-2 right-full top-1/2 -translate-y-1/2";
|
|
31
|
+
case TOOLTIP_POSITION.RIGHT:
|
|
32
|
+
return "ml-2 left-full top-1/2 -translate-y-1/2";
|
|
33
|
+
default:
|
|
34
|
+
return "";
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const tipPosition = (position: TOOLTIP_POSITION) => {
|
|
39
|
+
switch (position) {
|
|
40
|
+
case TOOLTIP_POSITION.TOP:
|
|
41
|
+
return "bottom-[-4px] left-1/2 -translate-x-1/2";
|
|
42
|
+
case TOOLTIP_POSITION.BOTTOM:
|
|
43
|
+
return "top-[-4px] left-1/2 -translate-x-1/2";
|
|
44
|
+
case TOOLTIP_POSITION.LEFT:
|
|
45
|
+
return "right-[-4px] top-1/2 -translate-y-1/2";
|
|
46
|
+
case TOOLTIP_POSITION.RIGHT:
|
|
47
|
+
return "left-[-4px] top-1/2 -translate-y-1/2";
|
|
48
|
+
default:
|
|
49
|
+
return "";
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div
|
|
55
|
+
className={`bg-neutrola-800 text-white text-sm py-1 px-2 rounded-lg absolute z-50
|
|
56
|
+
${isVisible ? "block" : "hidden"} ${getTooltipPosition(
|
|
57
|
+
position
|
|
58
|
+
)} ${toolTipWidth} ${toolTipClass}`}
|
|
59
|
+
>
|
|
60
|
+
<div>{label}</div>
|
|
61
|
+
<div
|
|
62
|
+
className={`absolute w-2 h-2 bg-neutrola-800 rotate-45 ${tipPosition(
|
|
63
|
+
position
|
|
64
|
+
)}`}
|
|
65
|
+
></div>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export default Tooltip;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { default as Avatar } from "./components/avatar";
|
|
2
|
+
export { default as Banner } from "./components/banner";
|
|
3
|
+
export { default as Button } from "./components/button";
|
|
4
|
+
export { default as Carousel } from "./components/carousel";
|
|
5
|
+
export { default as Checkbox } from "./components/checkbox";
|
|
6
|
+
export { default as Chip } from "./components/chip";
|
|
7
|
+
export { default as Ellipsis } from "./components/ellipsis";
|
|
8
|
+
export { default as FileUploader } from "./components/fileUploader";
|
|
9
|
+
export { default as FilterDropdown } from "./components/filterDropdown";
|
|
10
|
+
export { default as Input } from "./components/input";
|
|
11
|
+
export { default as Modal } from "./components/modal";
|
|
12
|
+
export { default as NavBar } from "./components/navBar";
|
|
13
|
+
export { default as Pagination } from "./components/pagination";
|
|
14
|
+
export { default as RadioButton } from "./components/radioButton";
|
|
15
|
+
export { default as SelectDropdown } from "./components/selectDropdown";
|
|
16
|
+
export { default as Snackbar } from "./components/snackBar";
|
|
17
|
+
export { default as States } from "./components/state";
|
|
18
|
+
export { default as Table } from "./components/table";
|
|
19
|
+
export { default as Tag } from "./components/tag";
|
|
20
|
+
export { default as TimeLine } from "./components/timeLine";
|
|
21
|
+
export { default as Tooltip } from "./components/tooltip";
|
|
22
|
+
export * as Icons from "./components/icons";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Avatar, { AVATAR_VARIANT } from "@/components/avatar";
|
|
2
|
+
|
|
3
|
+
const Avatars = () => {
|
|
4
|
+
const profilePicture = "/images/profile_picture.png";
|
|
5
|
+
return (
|
|
6
|
+
<div className="w-[600px] mx-auto my-0">
|
|
7
|
+
<div className="grid grid-cols-2 gap-8 items-center">
|
|
8
|
+
<p className="text-base font-semibold text-right">
|
|
9
|
+
Avatar image with details
|
|
10
|
+
</p>
|
|
11
|
+
<Avatar
|
|
12
|
+
name="John Doe"
|
|
13
|
+
email="john.doe@email.com"
|
|
14
|
+
variant={AVATAR_VARIANT.IMAGE_WITH_FULL}
|
|
15
|
+
image={profilePicture}
|
|
16
|
+
/>
|
|
17
|
+
<p className="text-base font-semibold text-right">Avatar image only</p>
|
|
18
|
+
<Avatar
|
|
19
|
+
name="John Doe"
|
|
20
|
+
email="john.doe@email.com"
|
|
21
|
+
variant={AVATAR_VARIANT.IMAGE_ONLY}
|
|
22
|
+
image={profilePicture}
|
|
23
|
+
/>
|
|
24
|
+
<p className="text-base font-semibold text-right">
|
|
25
|
+
Avatar initials with details
|
|
26
|
+
</p>
|
|
27
|
+
<Avatar
|
|
28
|
+
name="John Doe"
|
|
29
|
+
email="john.doe@email.com"
|
|
30
|
+
variant={AVATAR_VARIANT.INITIALS_WITH_FULL}
|
|
31
|
+
/>
|
|
32
|
+
<p className="text-base font-semibold text-right">
|
|
33
|
+
Avatar initials only
|
|
34
|
+
</p>
|
|
35
|
+
<Avatar
|
|
36
|
+
name="John Doe"
|
|
37
|
+
email="john.doe@email.com"
|
|
38
|
+
variant={AVATAR_VARIANT.INITIALS_ONLY}
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default Avatars;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Banner from "@/components/banner";
|
|
2
|
+
|
|
3
|
+
const Banners = () => {
|
|
4
|
+
return (
|
|
5
|
+
<div className="flex flex-col gap-8">
|
|
6
|
+
<Banner
|
|
7
|
+
title="This is a title"
|
|
8
|
+
titleClassName="text-6xl font-semibold text-white"
|
|
9
|
+
subTitle="Below of the title is the sub title"
|
|
10
|
+
subTitleClassName="text-4xl font-normal text-white"
|
|
11
|
+
contentPlacement="left"
|
|
12
|
+
backgroundImage="/images/hero.png"
|
|
13
|
+
/>
|
|
14
|
+
<Banner backgroundImage="/images/hero2.png" />
|
|
15
|
+
<Banner
|
|
16
|
+
title="This is a title"
|
|
17
|
+
titleClassName="text-6xl font-semibold text-white"
|
|
18
|
+
subTitle="Below of the title is the sub title"
|
|
19
|
+
subTitleClassName="text-4xl font-normal text-white"
|
|
20
|
+
contentPlacement="right"
|
|
21
|
+
backgroundColor="bg-gradient-to-r from-purple-500 via-pink-500 to-red-500"
|
|
22
|
+
/>
|
|
23
|
+
<Banner
|
|
24
|
+
title="This is a title"
|
|
25
|
+
titleClassName="text-6xl font-semibold text-white"
|
|
26
|
+
subTitle="Below of the title is the sub title"
|
|
27
|
+
subTitleClassName="text-4xl font-normal text-white"
|
|
28
|
+
contentPlacement="left"
|
|
29
|
+
backgroundColor="bg-redola-500"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default Banners;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import Button, { BUTTON_VARIANTS } from "@/components/button";
|
|
2
|
+
import { ProductsSVG } from "@/components/icons";
|
|
3
|
+
|
|
4
|
+
const Buttons = () => {
|
|
5
|
+
return (
|
|
6
|
+
<div className="flex flex-col gap-8">
|
|
7
|
+
<div className="flex flex-row gap-4 items-center justify-center">
|
|
8
|
+
<Button
|
|
9
|
+
variant={BUTTON_VARIANTS.PRIMARY}
|
|
10
|
+
label="Primary"
|
|
11
|
+
onClick={() => {}}
|
|
12
|
+
/>
|
|
13
|
+
<Button
|
|
14
|
+
variant={BUTTON_VARIANTS.PRIMARY}
|
|
15
|
+
label="Primary with icon"
|
|
16
|
+
onClick={() => {}}
|
|
17
|
+
icon={<ProductsSVG />}
|
|
18
|
+
/>
|
|
19
|
+
<Button
|
|
20
|
+
variant={BUTTON_VARIANTS.SECONDARY}
|
|
21
|
+
label="Secondary"
|
|
22
|
+
onClick={() => {}}
|
|
23
|
+
/>
|
|
24
|
+
<Button
|
|
25
|
+
variant={BUTTON_VARIANTS.SECONDARY}
|
|
26
|
+
label="Secondary with icon"
|
|
27
|
+
onClick={() => {}}
|
|
28
|
+
icon={<ProductsSVG />}
|
|
29
|
+
/>
|
|
30
|
+
<Button
|
|
31
|
+
variant={BUTTON_VARIANTS.TERTIARY}
|
|
32
|
+
label="Tertiary"
|
|
33
|
+
onClick={() => {}}
|
|
34
|
+
/>
|
|
35
|
+
<Button
|
|
36
|
+
variant={BUTTON_VARIANTS.TERTIARY}
|
|
37
|
+
label="Tertiary with icon"
|
|
38
|
+
onClick={() => {}}
|
|
39
|
+
icon={<ProductsSVG />}
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
<div className="flex flex-row gap-4 items-center justify-center">
|
|
43
|
+
<Button
|
|
44
|
+
variant={BUTTON_VARIANTS.PRIMARY}
|
|
45
|
+
label=" Disabled primary"
|
|
46
|
+
onClick={() => {}}
|
|
47
|
+
disabled
|
|
48
|
+
/>
|
|
49
|
+
<Button
|
|
50
|
+
variant={BUTTON_VARIANTS.PRIMARY}
|
|
51
|
+
label=" Disabled primary with icon"
|
|
52
|
+
onClick={() => {}}
|
|
53
|
+
icon={<ProductsSVG />}
|
|
54
|
+
disabled
|
|
55
|
+
/>
|
|
56
|
+
<Button
|
|
57
|
+
variant={BUTTON_VARIANTS.SECONDARY}
|
|
58
|
+
label=" Disabled secondary"
|
|
59
|
+
onClick={() => {}}
|
|
60
|
+
disabled
|
|
61
|
+
/>
|
|
62
|
+
<Button
|
|
63
|
+
variant={BUTTON_VARIANTS.SECONDARY}
|
|
64
|
+
label=" Disabled secondary with icon"
|
|
65
|
+
onClick={() => {}}
|
|
66
|
+
icon={<ProductsSVG />}
|
|
67
|
+
disabled
|
|
68
|
+
/>
|
|
69
|
+
<Button
|
|
70
|
+
variant={BUTTON_VARIANTS.TERTIARY}
|
|
71
|
+
label=" Disabled tertiary"
|
|
72
|
+
onClick={() => {}}
|
|
73
|
+
disabled
|
|
74
|
+
/>
|
|
75
|
+
<Button
|
|
76
|
+
variant={BUTTON_VARIANTS.TERTIARY}
|
|
77
|
+
label=" Disabled tertiary with icon"
|
|
78
|
+
onClick={() => {}}
|
|
79
|
+
icon={<ProductsSVG />}
|
|
80
|
+
disabled
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<div className="flex flex-row gap-4 items-center justify-center">
|
|
84
|
+
<Button
|
|
85
|
+
variant={BUTTON_VARIANTS.PRIMARY}
|
|
86
|
+
onClick={() => {}}
|
|
87
|
+
icon={<ProductsSVG />}
|
|
88
|
+
/>
|
|
89
|
+
<Button
|
|
90
|
+
variant={BUTTON_VARIANTS.SECONDARY}
|
|
91
|
+
onClick={() => {}}
|
|
92
|
+
icon={<ProductsSVG />}
|
|
93
|
+
/>
|
|
94
|
+
<Button
|
|
95
|
+
variant={BUTTON_VARIANTS.TERTIARY}
|
|
96
|
+
onClick={() => {}}
|
|
97
|
+
icon={<ProductsSVG />}
|
|
98
|
+
/>
|
|
99
|
+
<Button
|
|
100
|
+
variant={BUTTON_VARIANTS.PRIMARY}
|
|
101
|
+
onClick={() => {}}
|
|
102
|
+
icon={<ProductsSVG />}
|
|
103
|
+
disabled
|
|
104
|
+
/>
|
|
105
|
+
<Button
|
|
106
|
+
variant={BUTTON_VARIANTS.SECONDARY}
|
|
107
|
+
onClick={() => {}}
|
|
108
|
+
icon={<ProductsSVG />}
|
|
109
|
+
disabled
|
|
110
|
+
/>
|
|
111
|
+
<Button
|
|
112
|
+
variant={BUTTON_VARIANTS.TERTIARY}
|
|
113
|
+
onClick={() => {}}
|
|
114
|
+
icon={<ProductsSVG />}
|
|
115
|
+
disabled
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export default Buttons;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IBanner } from "@/components/banner";
|
|
2
|
+
import Carousel from "@/components/carousel";
|
|
3
|
+
|
|
4
|
+
const Carousels = () => {
|
|
5
|
+
const slides = [
|
|
6
|
+
{
|
|
7
|
+
title: "This is a title",
|
|
8
|
+
titleClassName: "text-6xl font-semibold text-white",
|
|
9
|
+
subTitle: "Below of the title is the sub title",
|
|
10
|
+
subTitleClassName: "text-4xl font-normal text-white",
|
|
11
|
+
contentPlacement: "left",
|
|
12
|
+
backgroundImage: "/images/hero.png",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
backgroundImage: "/images/hero2.png",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: "This is a title",
|
|
19
|
+
titleClassName: "text-6xl font-semibold text-white",
|
|
20
|
+
subTitle: "Below of the title is the sub title",
|
|
21
|
+
subTitleClassName: "text-4xl font-normal text-white",
|
|
22
|
+
contentPlacement: "right",
|
|
23
|
+
backgroundColor:
|
|
24
|
+
"bg-gradient-to-r from-purple-500 via-pink-500 to-red-500",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
title: "This is a title",
|
|
28
|
+
titleClassName: "text-6xl font-semibold text-white",
|
|
29
|
+
subTitle: "Below of the title is the sub title",
|
|
30
|
+
subTitleClassName: "text-4xl font-normal text-white",
|
|
31
|
+
contentPlacement: "left",
|
|
32
|
+
backgroundColor: "bg-redola-500",
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
return <Carousel slides={slides as IBanner[]} />;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default Carousels;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Checkbox from "@/components/checkbox";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
const Checkboxes = () => {
|
|
5
|
+
const [isChecked, setIsChecked] = useState(false);
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className="flex flex-col gap-4 items-center">
|
|
9
|
+
<Checkbox
|
|
10
|
+
label="Accept Terms & Conditions"
|
|
11
|
+
checked={isChecked}
|
|
12
|
+
onChange={(checked) => setIsChecked(checked)}
|
|
13
|
+
/>
|
|
14
|
+
<p>Checkbox is {isChecked ? "Checked" : "Unchecked"}</p>
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default Checkboxes;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import Button from "@/components/button";
|
|
2
|
+
import Chip from "@/components/chip";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
|
|
5
|
+
const chipsArray = [
|
|
6
|
+
{ label: "Chip 1" },
|
|
7
|
+
{ label: "Chip 2" },
|
|
8
|
+
{ label: "Chip 3" },
|
|
9
|
+
{ label: "Chip 4" },
|
|
10
|
+
{ label: "Chip 5" },
|
|
11
|
+
{ label: "Chip 6" },
|
|
12
|
+
{ label: "Chip 7" },
|
|
13
|
+
{ label: "Chip 8" },
|
|
14
|
+
{ label: "Chip 9" },
|
|
15
|
+
{ label: "Chip 10" },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const Chips = () => {
|
|
19
|
+
const [chipList, setChipList] = useState<{ label: string }[]>([
|
|
20
|
+
chipsArray[0],
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
const handleAddChip = () => {
|
|
24
|
+
const nextChip = chipsArray.filter((chip) => !chipList.includes(chip))[0];
|
|
25
|
+
setChipList([...chipList, nextChip]);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const onClear = (chip: { label: string }) => {
|
|
29
|
+
const newChipList = chipList.filter((c) => c.label !== chip.label);
|
|
30
|
+
setChipList(newChipList);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div className="flex flex-row gap-2 items-center justify-center">
|
|
35
|
+
<Button
|
|
36
|
+
label="Add a chip"
|
|
37
|
+
onClick={handleAddChip}
|
|
38
|
+
disabled={chipList.length === chipsArray.length}
|
|
39
|
+
/>
|
|
40
|
+
{chipList.map((chip) => (
|
|
41
|
+
<div key={`${chip.label}`}>
|
|
42
|
+
<Chip label={chip.label} onClear={() => onClear(chip)} />
|
|
43
|
+
</div>
|
|
44
|
+
))}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default Chips;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Ellipsis from "@/components/ellipsis";
|
|
2
|
+
|
|
3
|
+
const EllipsisTemplate = () => {
|
|
4
|
+
return (
|
|
5
|
+
<div className="flex flex-row gap-10 items-center justify-center">
|
|
6
|
+
<div className="flex flex-col gap-2">
|
|
7
|
+
<p className="text-xs font-semibold text-neutrola-500">
|
|
8
|
+
Without Ellipsis
|
|
9
|
+
</p>
|
|
10
|
+
<p>Anton Nimesh Fonseka</p>
|
|
11
|
+
</div>
|
|
12
|
+
<div className="flex flex-col gap-2">
|
|
13
|
+
<p className="text-xs font-semibold text-neutrola-500">With Ellipsis</p>
|
|
14
|
+
<Ellipsis label="Anton Nimesh Fonseka" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default EllipsisTemplate;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import FileUploader from "@/components/fileUploader";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
const FileUploaders = () => {
|
|
5
|
+
const [, setFile] = useState<File | null>(null);
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<div className="flex flex-col gap-4 items-center">
|
|
9
|
+
<div className="w-[600px]">
|
|
10
|
+
<FileUploader
|
|
11
|
+
title="Upload your documents here"
|
|
12
|
+
subTitle1="Please make sure the image is in better quality"
|
|
13
|
+
subTitle2="Max file size 2 MB and we accept .jpg .jpeg .png files"
|
|
14
|
+
handleAttachment={setFile}
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default FileUploaders;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import FilterDropdown from "@/components/filterDropdown";
|
|
2
|
+
|
|
3
|
+
const FilterDropdowns = () => {
|
|
4
|
+
return (
|
|
5
|
+
<FilterDropdown>
|
|
6
|
+
{(closeDropdown) => <FilterPanel dismissPanel={closeDropdown} />}
|
|
7
|
+
</FilterDropdown>
|
|
8
|
+
);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const FilterPanel = ({ dismissPanel }: { dismissPanel: () => void }) => {
|
|
12
|
+
return (
|
|
13
|
+
<div className="w-96 h-80 p-4">
|
|
14
|
+
<div className="flex flex-col gap-4">
|
|
15
|
+
<h2 className="text-lg font-bold">Filter</h2>
|
|
16
|
+
<div className="flex flex-col gap-2">
|
|
17
|
+
<label className="text-sm font-medium">Category</label>
|
|
18
|
+
<select
|
|
19
|
+
className="border border-neutrola-300 rounded-lg p-2"
|
|
20
|
+
onChange={dismissPanel}
|
|
21
|
+
>
|
|
22
|
+
<option value="">Select a category</option>
|
|
23
|
+
<option value="category1">Category 1</option>
|
|
24
|
+
<option value="category2">Category 2</option>
|
|
25
|
+
</select>
|
|
26
|
+
</div>
|
|
27
|
+
<div className="flex flex-col gap-2">
|
|
28
|
+
<label className="text-sm font-medium">Price Range</label>
|
|
29
|
+
<input
|
|
30
|
+
type="range"
|
|
31
|
+
min="0"
|
|
32
|
+
max="100"
|
|
33
|
+
className="w-full"
|
|
34
|
+
onChange={dismissPanel}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
<button
|
|
38
|
+
className="bg-blue-500 text-white rounded-lg p-2"
|
|
39
|
+
onClick={dismissPanel}
|
|
40
|
+
>
|
|
41
|
+
Apply Filters
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default FilterDropdowns;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as svgList from "@/components/icons";
|
|
2
|
+
|
|
3
|
+
const Icons = () => {
|
|
4
|
+
const list = Object.keys(svgList);
|
|
5
|
+
|
|
6
|
+
return (
|
|
7
|
+
<div className="grid grid-cols-8 gap-x-8 gap-y-12">
|
|
8
|
+
{list.map((svg: string, index) => (
|
|
9
|
+
<div
|
|
10
|
+
className="flex flex-col items-center gap-4 border border-white bg-neutrola-50 size-32 p-2 rounded-lg justify-center"
|
|
11
|
+
key={`svg_${index}`}
|
|
12
|
+
>
|
|
13
|
+
<div className="size-[40px]">
|
|
14
|
+
{svgList[svg as keyof typeof svgList]()}
|
|
15
|
+
</div>
|
|
16
|
+
<span className="text-sm font-medium">{svg}</span>
|
|
17
|
+
</div>
|
|
18
|
+
))}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default Icons;
|