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,143 @@
|
|
|
1
|
+
import { OrderInfoSVG } from "@/components/icons";
|
|
2
|
+
import Table, { ITableColumn } from "@/components/table";
|
|
3
|
+
import Tag, { TAG_TYPE } from "@/components/tag";
|
|
4
|
+
import { ORDER_STATUS } from "@/components/timeLine";
|
|
5
|
+
|
|
6
|
+
export interface IData {
|
|
7
|
+
date: string;
|
|
8
|
+
orderId: string;
|
|
9
|
+
price: string;
|
|
10
|
+
ownerName: string;
|
|
11
|
+
status: ORDER_STATUS;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const getTagType = (status: ORDER_STATUS) => {
|
|
15
|
+
switch (status) {
|
|
16
|
+
case ORDER_STATUS.PENDING:
|
|
17
|
+
return TAG_TYPE.WARNING;
|
|
18
|
+
case ORDER_STATUS.DELIVERED:
|
|
19
|
+
return TAG_TYPE.SUCCESS;
|
|
20
|
+
case ORDER_STATUS.ORDER_CANCELLED:
|
|
21
|
+
return TAG_TYPE.DANGER;
|
|
22
|
+
default:
|
|
23
|
+
return TAG_TYPE.DEFAULT;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const columns: ITableColumn[] = [
|
|
28
|
+
{
|
|
29
|
+
header: "Date",
|
|
30
|
+
headerClassName: "",
|
|
31
|
+
render: (row: IData) => <p>{row.date}</p>,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
header: "Order ID",
|
|
35
|
+
headerClassName: "",
|
|
36
|
+
render: (row: IData) => <p>{row.orderId}</p>,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
header: "Price",
|
|
40
|
+
headerClassName: "",
|
|
41
|
+
render: (row: IData) => <p>{row.price}</p>,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
header: "Owner Name",
|
|
45
|
+
headerClassName: "w-[20%]",
|
|
46
|
+
render: (row: IData) => <p>{row.ownerName}</p>,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
header: "Status",
|
|
50
|
+
headerClassName: "",
|
|
51
|
+
render: (row: IData) => (
|
|
52
|
+
<Tag type={getTagType(row.status)} label={row.status} />
|
|
53
|
+
),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
header: "View",
|
|
57
|
+
headerClassName: "w-[8%]",
|
|
58
|
+
render: () => (
|
|
59
|
+
<div className="size-5 cursor-pointer">
|
|
60
|
+
<OrderInfoSVG />
|
|
61
|
+
</div>
|
|
62
|
+
),
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
const data = [
|
|
67
|
+
{
|
|
68
|
+
date: "12/12/2021",
|
|
69
|
+
orderId: "12345623948394",
|
|
70
|
+
price: "$100",
|
|
71
|
+
ownerName: "Sonali Rodrigo",
|
|
72
|
+
status: ORDER_STATUS.PENDING,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
date: "12/12/2021",
|
|
76
|
+
orderId: "12345623423423",
|
|
77
|
+
price: "$100",
|
|
78
|
+
ownerName: "Nimesh Fonseka",
|
|
79
|
+
status: ORDER_STATUS.DISPATCHED_TO_COURIER,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
date: "12/12/2021",
|
|
83
|
+
orderId: "1234562344234",
|
|
84
|
+
price: "$100",
|
|
85
|
+
ownerName: "Shemeera Fonseka",
|
|
86
|
+
status: ORDER_STATUS.ORDER_PLACED,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
date: "12/12/2021",
|
|
90
|
+
orderId: "1234561231231",
|
|
91
|
+
price: "$100",
|
|
92
|
+
ownerName: "Renola Mishel",
|
|
93
|
+
status: ORDER_STATUS.ORDER_CANCELLED,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
date: "12/12/2021",
|
|
97
|
+
orderId: "1234562345345",
|
|
98
|
+
price: "$100",
|
|
99
|
+
ownerName: "Shehan Sonura",
|
|
100
|
+
status: ORDER_STATUS.DELIVERED,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
date: "12/12/2021",
|
|
104
|
+
orderId: "123456345234",
|
|
105
|
+
price: "$100",
|
|
106
|
+
ownerName: "Abhirami Fernando",
|
|
107
|
+
status: ORDER_STATUS.PENDING,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
date: "12/12/2021",
|
|
111
|
+
orderId: "123456123133",
|
|
112
|
+
price: "$100",
|
|
113
|
+
ownerName: "Antonette Mari",
|
|
114
|
+
status: ORDER_STATUS.DISPATCHED_TO_COURIER,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
date: "12/12/2021",
|
|
118
|
+
orderId: "1234562123123",
|
|
119
|
+
price: "$100",
|
|
120
|
+
ownerName: "Dilhani Pereira",
|
|
121
|
+
status: ORDER_STATUS.ORDER_PLACED,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
date: "12/12/2021",
|
|
125
|
+
orderId: "123456354543",
|
|
126
|
+
price: "$100",
|
|
127
|
+
ownerName: "Johannes Nico",
|
|
128
|
+
status: ORDER_STATUS.ORDER_CANCELLED,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
date: "12/12/2021",
|
|
132
|
+
orderId: "12345634534234",
|
|
133
|
+
price: "$100",
|
|
134
|
+
ownerName: "Dammika Bandara",
|
|
135
|
+
status: ORDER_STATUS.DELIVERED,
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
const Tables = () => {
|
|
140
|
+
return <Table columns={columns} data={data} />;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export default Tables;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Tag, { TAG_TYPE } from "@/components/tag";
|
|
2
|
+
|
|
3
|
+
const Tags = () => {
|
|
4
|
+
return (
|
|
5
|
+
<div className="flex flex-row justify-center gap-4 items-center">
|
|
6
|
+
<Tag type={TAG_TYPE.DEFAULT} label="Default"/>
|
|
7
|
+
<Tag type={TAG_TYPE.SUCCESS} label="Success"/>
|
|
8
|
+
<Tag type={TAG_TYPE.INFO} label="Info"/>
|
|
9
|
+
<Tag type={TAG_TYPE.WARNING} label="Warning"/>
|
|
10
|
+
<Tag type={TAG_TYPE.DANGER} label="Danger"/>
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default Tags;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import TimeLine, { ORDER_STATUS } from "@/components/timeLine";
|
|
2
|
+
|
|
3
|
+
const success = [
|
|
4
|
+
{
|
|
5
|
+
title: ORDER_STATUS.DELIVERED,
|
|
6
|
+
date: "2021-01-04",
|
|
7
|
+
description: "Package is delivered",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
title: ORDER_STATUS.DISPATCHED_TO_COURIER,
|
|
11
|
+
date: "2021-01-03",
|
|
12
|
+
description: "Package is in transit",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
title: ORDER_STATUS.PACKAGING,
|
|
16
|
+
date: "2021-01-03",
|
|
17
|
+
description: "Packaging is in progress",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
title: ORDER_STATUS.PRINTING_IN_PROGRESS,
|
|
21
|
+
date: "2021-01-02",
|
|
22
|
+
description: "Planner is being printed",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
title: ORDER_STATUS.ORDER_PLACED,
|
|
26
|
+
date: "2025-01-01",
|
|
27
|
+
description: "Order placed by customer",
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
const canceled = [
|
|
32
|
+
{
|
|
33
|
+
title: ORDER_STATUS.ORDER_CANCELLED,
|
|
34
|
+
date: "2021-01-04",
|
|
35
|
+
description: "Package is delivered",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: ORDER_STATUS.DISPATCHED_TO_COURIER,
|
|
39
|
+
date: "2021-01-03",
|
|
40
|
+
description: "Package is in transit",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: ORDER_STATUS.PACKAGING,
|
|
44
|
+
date: "2021-01-03",
|
|
45
|
+
description: "Packaging is in progress",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
title: ORDER_STATUS.PRINTING_IN_PROGRESS,
|
|
49
|
+
date: "2021-01-02",
|
|
50
|
+
description: "Planner is being printed",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: ORDER_STATUS.ORDER_PLACED,
|
|
54
|
+
date: "2025-01-01",
|
|
55
|
+
description: "Order placed by customer",
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
const pending = [
|
|
60
|
+
{
|
|
61
|
+
title: ORDER_STATUS.PACKAGING,
|
|
62
|
+
date: "2021-01-03",
|
|
63
|
+
description: "Packaging is in progress",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: ORDER_STATUS.PRINTING_IN_PROGRESS,
|
|
67
|
+
date: "2021-01-02",
|
|
68
|
+
description: "Planner is being printed",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
title: ORDER_STATUS.ORDER_PLACED,
|
|
72
|
+
date: "2025-01-01",
|
|
73
|
+
description: "Order placed by customer",
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
const TimeLines = () => {
|
|
78
|
+
return (
|
|
79
|
+
<div className="grid grid-cols-3 gap-4">
|
|
80
|
+
<div className="flex flex-col gap-8">
|
|
81
|
+
<p className="text-base font-semibold">Order pending scenario</p>
|
|
82
|
+
<TimeLine logs={pending} />
|
|
83
|
+
</div>
|
|
84
|
+
<div className="flex flex-col gap-8">
|
|
85
|
+
<p className="text-base font-semibold">Order success scenario</p>
|
|
86
|
+
<TimeLine logs={success} />
|
|
87
|
+
</div>
|
|
88
|
+
<div className="flex flex-col gap-8">
|
|
89
|
+
<p className="text-base font-semibold">Order canceled scenario</p>
|
|
90
|
+
<TimeLine logs={canceled} />
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export default TimeLines;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import Tooltip, { TOOLTIP_POSITION } from "@/components/tooltip";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
const Tooltips = () => {
|
|
5
|
+
const [showTopTooltip, setShowTopTooltip] = useState(false);
|
|
6
|
+
const [showRightTooltip, setShowRightTooltip] = useState(false);
|
|
7
|
+
const [showBottomTooltip, setShowBottomTooltip] = useState(false);
|
|
8
|
+
const [showLeftTooltip, setShowLeftTooltip] = useState(false);
|
|
9
|
+
|
|
10
|
+
const tooltipsComponents = [
|
|
11
|
+
{
|
|
12
|
+
label: "Tooltip on top",
|
|
13
|
+
position: TOOLTIP_POSITION.TOP,
|
|
14
|
+
showTooltip: showTopTooltip,
|
|
15
|
+
setShowTooltip: setShowTopTooltip,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: "Tooltip on right",
|
|
19
|
+
position: TOOLTIP_POSITION.RIGHT,
|
|
20
|
+
showTooltip: showRightTooltip,
|
|
21
|
+
setShowTooltip: setShowRightTooltip,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: "Tooltip on bottom",
|
|
25
|
+
position: TOOLTIP_POSITION.BOTTOM,
|
|
26
|
+
showTooltip: showBottomTooltip,
|
|
27
|
+
setShowTooltip: setShowBottomTooltip,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: "Tooltip on left",
|
|
31
|
+
position: TOOLTIP_POSITION.LEFT,
|
|
32
|
+
showTooltip: showLeftTooltip,
|
|
33
|
+
setShowTooltip: setShowLeftTooltip,
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="flex flex-row items-center justify-around pt-16">
|
|
39
|
+
{tooltipsComponents.map(
|
|
40
|
+
({ label, position, showTooltip, setShowTooltip }, index) => (
|
|
41
|
+
<div
|
|
42
|
+
key={index}
|
|
43
|
+
className="relative border border-neutrola-700 p-2 rounded-lg cursor-pointer hover:border-primary-500 hover:text-primary-500"
|
|
44
|
+
onMouseEnter={() => setShowTooltip(true)}
|
|
45
|
+
onMouseLeave={() => setShowTooltip(false)}
|
|
46
|
+
>
|
|
47
|
+
{label}
|
|
48
|
+
<Tooltip
|
|
49
|
+
position={position}
|
|
50
|
+
label={label}
|
|
51
|
+
isVisible={showTooltip}
|
|
52
|
+
toolTipWidth="w-32"
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
|
+
)}
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default Tooltips;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"declaration": true,
|
|
4
|
+
"emitDeclarationOnly": false,
|
|
5
|
+
"outDir": "dist",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"target": "ES6",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"strict": true,
|
|
12
|
+
"skipLibCheck": true
|
|
13
|
+
},
|
|
14
|
+
"include": ["src/components", "src/index.ts"],
|
|
15
|
+
"exclude": ["src/app", "src/templates", "node_modules", "dist"]
|
|
16
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "preserve",
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"plugins": [
|
|
17
|
+
{
|
|
18
|
+
"name": "next"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"paths": {
|
|
22
|
+
"@/*": ["./src/*"]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
26
|
+
"exclude": ["node_modules"]
|
|
27
|
+
}
|