gwan-design-system 0.1.6 → 0.1.7
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/README.md +55 -17
- package/dist/index.d.mts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +271 -203
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +271 -203
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -4
package/dist/index.mjs
CHANGED
|
@@ -22,7 +22,8 @@ var Tooltip = ({
|
|
|
22
22
|
label,
|
|
23
23
|
isVisible = false,
|
|
24
24
|
toolTipWidth = "w-60",
|
|
25
|
-
toolTipClass = ""
|
|
25
|
+
toolTipClass = "",
|
|
26
|
+
className = ""
|
|
26
27
|
}) => {
|
|
27
28
|
const getTooltipPosition = (position2) => {
|
|
28
29
|
switch (position2) {
|
|
@@ -55,16 +56,16 @@ var Tooltip = ({
|
|
|
55
56
|
return /* @__PURE__ */ jsxs(
|
|
56
57
|
"div",
|
|
57
58
|
{
|
|
58
|
-
className: `bg-
|
|
59
|
+
className: `bg-neutral-800 text-white text-sm py-1 px-2 rounded-lg absolute z-50
|
|
59
60
|
${isVisible ? "block" : "hidden"} ${getTooltipPosition(
|
|
60
61
|
position
|
|
61
|
-
)} ${toolTipWidth} ${toolTipClass}`,
|
|
62
|
+
)} ${toolTipWidth} ${toolTipClass} ${className}`,
|
|
62
63
|
children: [
|
|
63
64
|
/* @__PURE__ */ jsx("div", { children: label }),
|
|
64
65
|
/* @__PURE__ */ jsx(
|
|
65
66
|
"div",
|
|
66
67
|
{
|
|
67
|
-
className: `absolute w-2 h-2 bg-
|
|
68
|
+
className: `absolute w-2 h-2 bg-neutral-800 rotate-45 ${tipPosition(
|
|
68
69
|
position
|
|
69
70
|
)}`
|
|
70
71
|
}
|
|
@@ -90,7 +91,13 @@ var generatePastelColor = () => {
|
|
|
90
91
|
const lightness = 75 + Math.random() * 10;
|
|
91
92
|
return `hsl(${hue}, ${saturation}%, ${lightness}%)`;
|
|
92
93
|
};
|
|
93
|
-
var Avatar = ({
|
|
94
|
+
var Avatar = ({
|
|
95
|
+
name,
|
|
96
|
+
email,
|
|
97
|
+
image,
|
|
98
|
+
variant,
|
|
99
|
+
className = ""
|
|
100
|
+
}) => {
|
|
94
101
|
const [bgColor, setBgColor] = useState("transparent");
|
|
95
102
|
const [isTooltipInitialVisible, setIsTooltipInitialVisible] = useState(false);
|
|
96
103
|
const [isTooltipImageVisible, setIsTooltipImageVisible] = useState(false);
|
|
@@ -108,7 +115,7 @@ var Avatar = ({ name, email, image, variant }) => {
|
|
|
108
115
|
position: "right" /* RIGHT */,
|
|
109
116
|
label: /* @__PURE__ */ jsxs2("div", { className: "flex flex-col", children: [
|
|
110
117
|
name2,
|
|
111
|
-
/* @__PURE__ */ jsx2("p", { className: "text-
|
|
118
|
+
/* @__PURE__ */ jsx2("p", { className: "text-neutral-300 text-xs", children: email2 })
|
|
112
119
|
] }),
|
|
113
120
|
isVisible,
|
|
114
121
|
toolTipWidth: "w-36"
|
|
@@ -127,7 +134,7 @@ var Avatar = ({ name, email, image, variant }) => {
|
|
|
127
134
|
/* @__PURE__ */ jsx2(
|
|
128
135
|
Image,
|
|
129
136
|
{
|
|
130
|
-
className: "rounded-full border border-
|
|
137
|
+
className: "rounded-full border border-neutral-400",
|
|
131
138
|
src: image,
|
|
132
139
|
alt: "profile",
|
|
133
140
|
width: 60,
|
|
@@ -153,11 +160,11 @@ var Avatar = ({ name, email, image, variant }) => {
|
|
|
153
160
|
}
|
|
154
161
|
);
|
|
155
162
|
};
|
|
156
|
-
return /* @__PURE__ */ jsxs2("div", { className:
|
|
163
|
+
return /* @__PURE__ */ jsxs2("div", { className: `flex flex-row items-center gap-2 ${className}`, children: [
|
|
157
164
|
renderAvatarImage(),
|
|
158
165
|
(variant === "image_with_full" /* IMAGE_WITH_FULL */ || variant === "initials_with_full" /* INITIALS_WITH_FULL */) && /* @__PURE__ */ jsxs2("div", { className: "flex flex-col", children: [
|
|
159
166
|
/* @__PURE__ */ jsx2("p", { className: "text-base font-semibold", children: name }),
|
|
160
|
-
/* @__PURE__ */ jsx2("p", { className: "text-sm text-
|
|
167
|
+
/* @__PURE__ */ jsx2("p", { className: "text-sm text-neutral-700", children: email })
|
|
161
168
|
] })
|
|
162
169
|
] });
|
|
163
170
|
};
|
|
@@ -172,7 +179,8 @@ var Banner = ({
|
|
|
172
179
|
backgroundImage = "",
|
|
173
180
|
backgroundColor = "",
|
|
174
181
|
titleClassName = "",
|
|
175
|
-
subTitleClassName = ""
|
|
182
|
+
subTitleClassName = "",
|
|
183
|
+
className = ""
|
|
176
184
|
}) => {
|
|
177
185
|
const handleContentPlacement = () => {
|
|
178
186
|
if (contentPlacement === "left") {
|
|
@@ -195,7 +203,7 @@ var Banner = ({
|
|
|
195
203
|
return /* @__PURE__ */ jsx3(
|
|
196
204
|
"div",
|
|
197
205
|
{
|
|
198
|
-
className: `w-full h-[484px] grid grid-cols-2 items-center px-16 ${backgroundColor} bg-no-repeat bg-cover bg-center`,
|
|
206
|
+
className: `w-full h-[484px] grid grid-cols-2 items-center px-16 ${backgroundColor} bg-no-repeat bg-cover bg-center ${className}`,
|
|
199
207
|
style: backgroundImage !== "" ? { backgroundImage: `url(${backgroundImage})` } : {},
|
|
200
208
|
children: handleContentPlacement()
|
|
201
209
|
}
|
|
@@ -217,22 +225,23 @@ var Button = ({
|
|
|
217
225
|
onClick,
|
|
218
226
|
icon,
|
|
219
227
|
type = "button",
|
|
220
|
-
disabled = false
|
|
228
|
+
disabled = false,
|
|
229
|
+
className = ""
|
|
221
230
|
}) => {
|
|
222
231
|
const getButtonVariant = (variant2) => {
|
|
223
232
|
switch (variant2) {
|
|
224
233
|
case "primary" /* PRIMARY */:
|
|
225
|
-
return disabled ? "bg-
|
|
234
|
+
return disabled ? "bg-neutral-300 text-neutral-800 cursor-not-allowed" : "bg-primary-500 text-white hover:bg-primary-600 active:bg-primary-700";
|
|
226
235
|
case "secondary" /* SECONDARY */:
|
|
227
|
-
return disabled ? "bg-
|
|
236
|
+
return disabled ? "bg-neutral-100 text-neutral-800 cursor-not-allowed" : "bg-neutral-50 text-primary-700 hover:bg-primary-50 active:bg-primary-100";
|
|
228
237
|
case "tertiary" /* TERTIARY */:
|
|
229
|
-
return disabled ? "text-
|
|
238
|
+
return disabled ? "text-neutral-300 border border-neutral-300 cursor-not-allowed" : "bg-transparent text-primary-500 border border-primary-500 hover:bg-neutral-50 active:bg-neutral-100";
|
|
230
239
|
}
|
|
231
240
|
};
|
|
232
241
|
return /* @__PURE__ */ jsx4(
|
|
233
242
|
"button",
|
|
234
243
|
{
|
|
235
|
-
className: `${getButtonVariant(variant)} px-4 ${label ? "py-2" : "py-4"} rounded-lg`,
|
|
244
|
+
className: `${getButtonVariant(variant)} px-4 ${label ? "py-2" : "py-4"} rounded-lg ${className}`,
|
|
236
245
|
type,
|
|
237
246
|
onClick,
|
|
238
247
|
disabled,
|
|
@@ -248,7 +257,11 @@ var button_default = Button;
|
|
|
248
257
|
// src/components/carousel/index.tsx
|
|
249
258
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
250
259
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
251
|
-
var Carousel = ({
|
|
260
|
+
var Carousel = ({
|
|
261
|
+
slides,
|
|
262
|
+
interval = 3e3,
|
|
263
|
+
className = ""
|
|
264
|
+
}) => {
|
|
252
265
|
const [currentIndex, setCurrentIndex] = useState2(0);
|
|
253
266
|
useEffect2(() => {
|
|
254
267
|
const timer = setInterval(() => {
|
|
@@ -256,7 +269,7 @@ var Carousel = ({ slides, interval = 3e3 }) => {
|
|
|
256
269
|
}, interval);
|
|
257
270
|
return () => clearInterval(timer);
|
|
258
271
|
}, [slides.length, interval]);
|
|
259
|
-
return /* @__PURE__ */ jsx5("div", { className:
|
|
272
|
+
return /* @__PURE__ */ jsx5("div", { className: `relative w-full h-[484px] overflow-hidden ${className}`, children: slides.map(
|
|
260
273
|
({
|
|
261
274
|
title,
|
|
262
275
|
titleClassName,
|
|
@@ -585,7 +598,8 @@ import { jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
|
585
598
|
var Checkbox = ({
|
|
586
599
|
label,
|
|
587
600
|
checked = false,
|
|
588
|
-
onChange
|
|
601
|
+
onChange,
|
|
602
|
+
className = ""
|
|
589
603
|
}) => {
|
|
590
604
|
const [isChecked, setIsChecked] = useState3(checked);
|
|
591
605
|
const handleToggle = () => {
|
|
@@ -594,7 +608,7 @@ var Checkbox = ({
|
|
|
594
608
|
onChange(!isChecked);
|
|
595
609
|
}
|
|
596
610
|
};
|
|
597
|
-
return /* @__PURE__ */ jsxs14("label", { className:
|
|
611
|
+
return /* @__PURE__ */ jsxs14("label", { className: `flex items-center gap-2 cursor-pointer ${className}`, children: [
|
|
598
612
|
/* @__PURE__ */ jsx23(
|
|
599
613
|
"input",
|
|
600
614
|
{
|
|
@@ -608,7 +622,7 @@ var Checkbox = ({
|
|
|
608
622
|
"div",
|
|
609
623
|
{
|
|
610
624
|
className: `w-5 h-5 flex items-center justify-center border-2 rounded-md transition-all
|
|
611
|
-
${isChecked ? "bg-primary-500 border-primary-600" : "bg-white border-
|
|
625
|
+
${isChecked ? "bg-primary-500 border-primary-600" : "bg-white border-neutral-500"}
|
|
612
626
|
`,
|
|
613
627
|
children: isChecked && /* @__PURE__ */ jsx23("div", { className: "size-4 text-white", children: /* @__PURE__ */ jsx23(Check, {}) })
|
|
614
628
|
}
|
|
@@ -620,18 +634,24 @@ var checkbox_default = Checkbox;
|
|
|
620
634
|
|
|
621
635
|
// src/components/chip/index.tsx
|
|
622
636
|
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
623
|
-
var Chip = ({ label, onClear }) => {
|
|
624
|
-
return /* @__PURE__ */ jsxs15(
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
{
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
637
|
+
var Chip = ({ label, onClear, className = "" }) => {
|
|
638
|
+
return /* @__PURE__ */ jsxs15(
|
|
639
|
+
"div",
|
|
640
|
+
{
|
|
641
|
+
className: `flex flex-row gap-2 items-center bg-neutral-700 w-fit px-4 py-2 rounded-full ${className}`,
|
|
642
|
+
children: [
|
|
643
|
+
/* @__PURE__ */ jsx24(
|
|
644
|
+
"div",
|
|
645
|
+
{
|
|
646
|
+
className: "size-3 cursor-pointer text-neutral-200 hover:text-white",
|
|
647
|
+
onClick: onClear,
|
|
648
|
+
children: /* @__PURE__ */ jsx24(Cross, {})
|
|
649
|
+
}
|
|
650
|
+
),
|
|
651
|
+
/* @__PURE__ */ jsx24("p", { className: "text-neutral-200 text-base font-semibold", children: label })
|
|
652
|
+
]
|
|
653
|
+
}
|
|
654
|
+
);
|
|
635
655
|
};
|
|
636
656
|
var chip_default = Chip;
|
|
637
657
|
|
|
@@ -641,13 +661,14 @@ import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
|
641
661
|
var Ellipsis = ({
|
|
642
662
|
label,
|
|
643
663
|
tooltipPosition = "right" /* RIGHT */,
|
|
644
|
-
tooltipWidth = "w-40"
|
|
664
|
+
tooltipWidth = "w-40",
|
|
665
|
+
className = ""
|
|
645
666
|
}) => {
|
|
646
667
|
const [isTooltipVisible, setIsTooltipVisible] = useState4(false);
|
|
647
668
|
return /* @__PURE__ */ jsxs16(
|
|
648
669
|
"div",
|
|
649
670
|
{
|
|
650
|
-
className:
|
|
671
|
+
className: `relative ${className}`,
|
|
651
672
|
onMouseEnter: () => setIsTooltipVisible(true),
|
|
652
673
|
onMouseLeave: () => setIsTooltipVisible(false),
|
|
653
674
|
children: [
|
|
@@ -675,7 +696,8 @@ var FileUploader = ({
|
|
|
675
696
|
subTitle1 = "",
|
|
676
697
|
subTitle2 = "",
|
|
677
698
|
handleAttachment,
|
|
678
|
-
accept = ".jpg,.jpeg,.png"
|
|
699
|
+
accept = ".jpg,.jpeg,.png",
|
|
700
|
+
className = ""
|
|
679
701
|
}) => {
|
|
680
702
|
const fileInputRef = useRef(null);
|
|
681
703
|
const handleFileUpload = (event) => {
|
|
@@ -684,57 +706,63 @@ var FileUploader = ({
|
|
|
684
706
|
handleAttachment(files[0]);
|
|
685
707
|
}
|
|
686
708
|
};
|
|
687
|
-
return /* @__PURE__ */ jsxs17(
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
{
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
709
|
+
return /* @__PURE__ */ jsxs17(
|
|
710
|
+
"div",
|
|
711
|
+
{
|
|
712
|
+
className: `flex flex-row gap-4 items-start border border-dashed border-neutral-200 p-4 rounded-lg ${className}`,
|
|
713
|
+
children: [
|
|
714
|
+
/* @__PURE__ */ jsx26(
|
|
715
|
+
"div",
|
|
716
|
+
{
|
|
717
|
+
className: "bg-primary-500 hover:bg-primary-600 text-white px-6 py-8 rounded-lg cursor-pointer",
|
|
718
|
+
onClick: () => {
|
|
719
|
+
var _a;
|
|
720
|
+
return (_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
721
|
+
},
|
|
722
|
+
children: /* @__PURE__ */ jsx26("div", { className: "size-10", children: /* @__PURE__ */ jsx26(Upload, {}) })
|
|
723
|
+
}
|
|
724
|
+
),
|
|
725
|
+
/* @__PURE__ */ jsx26(
|
|
726
|
+
"input",
|
|
727
|
+
{
|
|
728
|
+
type: "file",
|
|
729
|
+
ref: fileInputRef,
|
|
730
|
+
accept,
|
|
731
|
+
className: "hidden",
|
|
732
|
+
onChange: handleFileUpload
|
|
733
|
+
}
|
|
734
|
+
),
|
|
735
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex-1 flex flex-col", children: [
|
|
736
|
+
/* @__PURE__ */ jsx26("p", { className: "text-lg", children: title }),
|
|
737
|
+
/* @__PURE__ */ jsx26("p", { className: "text-sm text-neutral-400", children: subTitle1 }),
|
|
738
|
+
/* @__PURE__ */ jsx26("p", { className: "text-sm text-neutral-400", children: subTitle2 })
|
|
739
|
+
] })
|
|
740
|
+
]
|
|
741
|
+
}
|
|
742
|
+
);
|
|
715
743
|
};
|
|
716
744
|
var fileUploader_default = FileUploader;
|
|
717
745
|
|
|
718
746
|
// src/components/filterDropdown/index.tsx
|
|
719
747
|
import { useState as useState5 } from "react";
|
|
720
748
|
import { jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
721
|
-
var FilterDropdown = ({ children }) => {
|
|
749
|
+
var FilterDropdown = ({ children, className = "" }) => {
|
|
722
750
|
const [isChildrenVisible, setIsChildrenVisible] = useState5(false);
|
|
723
751
|
const closeDropdown = () => setIsChildrenVisible(false);
|
|
724
|
-
return /* @__PURE__ */ jsxs18("div", { className:
|
|
752
|
+
return /* @__PURE__ */ jsxs18("div", { className: `relative ${className}`, children: [
|
|
725
753
|
/* @__PURE__ */ jsxs18(
|
|
726
754
|
"div",
|
|
727
755
|
{
|
|
728
|
-
className: "flex flex-row gap-4 items-center w-fit border border-
|
|
756
|
+
className: "flex flex-row gap-4 items-center w-fit border border-neutral-300 hover:border-neutral-400 group p-2 rounded-lg cursor-pointer",
|
|
729
757
|
onClick: () => setIsChildrenVisible(!isChildrenVisible),
|
|
730
758
|
children: [
|
|
731
|
-
/* @__PURE__ */ jsx27("div", { className: "size-5 text-
|
|
732
|
-
/* @__PURE__ */ jsx27("p", { className: "text-
|
|
733
|
-
/* @__PURE__ */ jsx27("div", { className: "size-5 text-
|
|
759
|
+
/* @__PURE__ */ jsx27("div", { className: "size-5 text-neutral-300 group-hover:text-neutral-400", children: /* @__PURE__ */ jsx27(Filter, {}) }),
|
|
760
|
+
/* @__PURE__ */ jsx27("p", { className: "text-neutral-300 text-base group-hover:text-neutral-400", children: "Filter" }),
|
|
761
|
+
/* @__PURE__ */ jsx27("div", { className: "size-5 text-neutral-300 group-hover:text-neutral-400", children: /* @__PURE__ */ jsx27(ChevDown, {}) })
|
|
734
762
|
]
|
|
735
763
|
}
|
|
736
764
|
),
|
|
737
|
-
isChildrenVisible && /* @__PURE__ */ jsx27("div", { className: "border border-
|
|
765
|
+
isChildrenVisible && /* @__PURE__ */ jsx27("div", { className: "border border-neutral-300 rounded-lg shadow-lg overflow-y-auto absolute top-full bg-white z-10", children: children(closeDropdown) })
|
|
738
766
|
] });
|
|
739
767
|
};
|
|
740
768
|
var filterDropdown_default = FilterDropdown;
|
|
@@ -748,10 +776,11 @@ var Input = ({
|
|
|
748
776
|
disabled,
|
|
749
777
|
placeholder,
|
|
750
778
|
inputClassName = "",
|
|
751
|
-
required = false
|
|
779
|
+
required = false,
|
|
780
|
+
className = ""
|
|
752
781
|
}) => {
|
|
753
|
-
return /* @__PURE__ */ jsxs19("div", { className:
|
|
754
|
-
/* @__PURE__ */ jsx28("label", { htmlFor: label, className: "text-sm text-
|
|
782
|
+
return /* @__PURE__ */ jsxs19("div", { className: `flex flex-col gap-1 relative ${className}`, children: [
|
|
783
|
+
/* @__PURE__ */ jsx28("label", { htmlFor: label, className: "text-sm text-neutral-600 mb-2", children: `${label}${required ? " *" : ""}` }),
|
|
755
784
|
/* @__PURE__ */ jsx28(
|
|
756
785
|
"input",
|
|
757
786
|
{
|
|
@@ -760,7 +789,7 @@ var Input = ({
|
|
|
760
789
|
value,
|
|
761
790
|
onChange: (e) => onChange(e.target.value),
|
|
762
791
|
disabled,
|
|
763
|
-
className: `border border-
|
|
792
|
+
className: `border border-neutral-300 outline-none p-4 rounded-lg ${disabled ? "cursor-not-allowed" : "cursor-text"} text-sm w-full ${inputClassName}`,
|
|
764
793
|
required
|
|
765
794
|
}
|
|
766
795
|
)
|
|
@@ -782,29 +811,36 @@ var Modal = ({
|
|
|
782
811
|
title,
|
|
783
812
|
children,
|
|
784
813
|
onClear,
|
|
785
|
-
size = "w-[800px] h-96" /* MEDIUM
|
|
814
|
+
size = "w-[800px] h-96" /* MEDIUM */,
|
|
815
|
+
className = ""
|
|
786
816
|
}) => {
|
|
787
817
|
const modalRef = useRef2(null);
|
|
788
818
|
useEffect3(() => {
|
|
789
819
|
var _a;
|
|
790
820
|
(_a = modalRef.current) == null ? void 0 : _a.focus();
|
|
791
821
|
}, []);
|
|
792
|
-
return /* @__PURE__ */ jsx29(
|
|
822
|
+
return /* @__PURE__ */ jsx29(
|
|
793
823
|
"div",
|
|
794
824
|
{
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
/*
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
825
|
+
className: `fixed inset-0 flex items-center justify-center bg-[rgba(0,0,0,0.3)] ${className}`,
|
|
826
|
+
children: /* @__PURE__ */ jsxs20(
|
|
827
|
+
"div",
|
|
828
|
+
{
|
|
829
|
+
ref: modalRef,
|
|
830
|
+
tabIndex: -1,
|
|
831
|
+
className: `bg-white p-4 ${size !== "w-full h-full" /* FULL */ && "rounded-lg"} absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 flex flex-col gap-4 ${size}`,
|
|
832
|
+
onBlur: () => onClear(),
|
|
833
|
+
children: [
|
|
834
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex flex-row gap-4 items-center", children: [
|
|
835
|
+
/* @__PURE__ */ jsx29("div", { className: "flex-1 text-3xl", children: title }),
|
|
836
|
+
/* @__PURE__ */ jsx29("div", { className: "size-4 cursor-pointer", onClick: () => onClear(), children: /* @__PURE__ */ jsx29(Cross, {}) })
|
|
837
|
+
] }),
|
|
838
|
+
/* @__PURE__ */ jsx29("div", { className: "flex-1 flex justify-center items-center", children })
|
|
839
|
+
]
|
|
840
|
+
}
|
|
841
|
+
)
|
|
806
842
|
}
|
|
807
|
-
)
|
|
843
|
+
);
|
|
808
844
|
};
|
|
809
845
|
var modal_default = Modal;
|
|
810
846
|
|
|
@@ -824,7 +860,8 @@ var NavBar = ({
|
|
|
824
860
|
menuWidthClass = "w-[20rem]",
|
|
825
861
|
menuHeightClass = "h-[100vh]",
|
|
826
862
|
isCollapsed = false,
|
|
827
|
-
menuBackgroundColor = "bg-primary-100"
|
|
863
|
+
menuBackgroundColor = "bg-primary-100",
|
|
864
|
+
className = ""
|
|
828
865
|
}) => {
|
|
829
866
|
const router = useRouter();
|
|
830
867
|
const [isActiveMenuItem, setIsActiveMenuItem] = useState6("");
|
|
@@ -856,7 +893,7 @@ var NavBar = ({
|
|
|
856
893
|
return /* @__PURE__ */ jsx30(
|
|
857
894
|
"div",
|
|
858
895
|
{
|
|
859
|
-
className: `transition-[width] duration-300 ease-in-out ${isMenuCollapsed ? collapsedClass : menuWidthClass} ${menuHeightClass}`,
|
|
896
|
+
className: `transition-[width] duration-300 ease-in-out ${isMenuCollapsed ? collapsedClass : menuWidthClass} ${menuHeightClass} ${className}`,
|
|
860
897
|
children: /* @__PURE__ */ jsxs21(
|
|
861
898
|
"div",
|
|
862
899
|
{
|
|
@@ -955,7 +992,8 @@ var SelectDropdown = ({
|
|
|
955
992
|
disabled = false,
|
|
956
993
|
value,
|
|
957
994
|
onChange,
|
|
958
|
-
inputClassName = ""
|
|
995
|
+
inputClassName = "",
|
|
996
|
+
className = ""
|
|
959
997
|
}) => {
|
|
960
998
|
const [dropdownValue, setDropdownValue] = useState7("");
|
|
961
999
|
const [isOptionsVisible, setIsOptionsVisible] = useState7(false);
|
|
@@ -973,16 +1011,16 @@ var SelectDropdown = ({
|
|
|
973
1011
|
onChange(val);
|
|
974
1012
|
setIsOptionsVisible(false);
|
|
975
1013
|
};
|
|
976
|
-
return /* @__PURE__ */ jsxs22("div", { className:
|
|
977
|
-
label && /* @__PURE__ */ jsx31("label", { htmlFor: label, className: "text-sm text-
|
|
1014
|
+
return /* @__PURE__ */ jsxs22("div", { className: `flex flex-col gap-1 relative ${className}`, children: [
|
|
1015
|
+
label && /* @__PURE__ */ jsx31("label", { htmlFor: label, className: "text-sm text-neutral-600 mb-2", children: label }),
|
|
978
1016
|
/* @__PURE__ */ jsxs22("div", { className: "relative", children: [
|
|
979
|
-
/* @__PURE__ */ jsx31("div", { className: "size-5 absolute inset-y-4 right-4 flex items-center text-
|
|
1017
|
+
/* @__PURE__ */ jsx31("div", { className: "size-5 absolute inset-y-4 right-4 flex items-center text-neutral-600 pointer-events-none", children: /* @__PURE__ */ jsx31(ChevDown, {}) }),
|
|
980
1018
|
/* @__PURE__ */ jsx31(
|
|
981
1019
|
"input",
|
|
982
1020
|
{
|
|
983
1021
|
id: label,
|
|
984
1022
|
type: "text",
|
|
985
|
-
className: `border border-
|
|
1023
|
+
className: `border border-neutral-300 outline-none p-4 rounded-lg ${disabled ? "cursor-not-allowed" : "cursor-pointer"} text-sm w-full ${inputClassName}`,
|
|
986
1024
|
placeholder,
|
|
987
1025
|
onClick: () => setIsOptionsVisible(!isOptionsVisible),
|
|
988
1026
|
value: dropdownValue,
|
|
@@ -992,10 +1030,10 @@ var SelectDropdown = ({
|
|
|
992
1030
|
}
|
|
993
1031
|
)
|
|
994
1032
|
] }),
|
|
995
|
-
isOptionsVisible && /* @__PURE__ */ jsx31("div", { className: "border border-
|
|
1033
|
+
isOptionsVisible && /* @__PURE__ */ jsx31("div", { className: "border border-neutral-300 rounded-lg shadow-lg max-h-96 overflow-y-auto absolute min-w-full top-full bg-white z-10", children: options.map(({ label: label2, value: val }, index) => /* @__PURE__ */ jsx31(
|
|
996
1034
|
"div",
|
|
997
1035
|
{
|
|
998
|
-
className: "p-4 cursor-pointer hover:bg-
|
|
1036
|
+
className: "p-4 cursor-pointer hover:bg-neutral-50 text-sm",
|
|
999
1037
|
onMouseDown: () => handleMouseDown(label2),
|
|
1000
1038
|
children: label2
|
|
1001
1039
|
},
|
|
@@ -1012,7 +1050,8 @@ var Pagination = ({
|
|
|
1012
1050
|
page,
|
|
1013
1051
|
size,
|
|
1014
1052
|
options,
|
|
1015
|
-
onChange
|
|
1053
|
+
onChange,
|
|
1054
|
+
className = ""
|
|
1016
1055
|
}) => {
|
|
1017
1056
|
const [optionDropdown, setOptionDropdown] = useState8(size.toString());
|
|
1018
1057
|
const onLeft = () => {
|
|
@@ -1029,43 +1068,49 @@ var Pagination = ({
|
|
|
1029
1068
|
setOptionDropdown(size2);
|
|
1030
1069
|
onChange({ total, page: 1, size: parseInt(size2) });
|
|
1031
1070
|
};
|
|
1032
|
-
return /* @__PURE__ */ jsxs23(
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
{
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1071
|
+
return /* @__PURE__ */ jsxs23(
|
|
1072
|
+
"div",
|
|
1073
|
+
{
|
|
1074
|
+
className: `bg-neutral-50 flex flex-row gap-4 items-center px-4 py-2 rounded-lg ${className}`,
|
|
1075
|
+
children: [
|
|
1076
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex-1", children: [
|
|
1077
|
+
page,
|
|
1078
|
+
" of ",
|
|
1079
|
+
Math.ceil(total / size),
|
|
1080
|
+
" pages"
|
|
1081
|
+
] }),
|
|
1082
|
+
/* @__PURE__ */ jsx32("div", { className: "w-20", children: /* @__PURE__ */ jsx32(
|
|
1083
|
+
selectDropdown_default,
|
|
1084
|
+
{
|
|
1085
|
+
options,
|
|
1086
|
+
value: optionDropdown,
|
|
1087
|
+
onChange: (option) => handlePageSize(option)
|
|
1088
|
+
}
|
|
1089
|
+
) }),
|
|
1090
|
+
/* @__PURE__ */ jsx32("div", { children: "items per page" }),
|
|
1091
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-row gap-4 items-center", children: [
|
|
1092
|
+
/* @__PURE__ */ jsx32(
|
|
1093
|
+
button_default,
|
|
1094
|
+
{
|
|
1095
|
+
onClick: onLeft,
|
|
1096
|
+
icon: /* @__PURE__ */ jsx32(ChevLeft, {}),
|
|
1097
|
+
variant: "tertiary" /* TERTIARY */,
|
|
1098
|
+
disabled: page === 1
|
|
1099
|
+
}
|
|
1100
|
+
),
|
|
1101
|
+
/* @__PURE__ */ jsx32(
|
|
1102
|
+
button_default,
|
|
1103
|
+
{
|
|
1104
|
+
onClick: onRight,
|
|
1105
|
+
icon: /* @__PURE__ */ jsx32(ChevRight, {}),
|
|
1106
|
+
variant: "tertiary" /* TERTIARY */,
|
|
1107
|
+
disabled: page === Math.ceil(total / size)
|
|
1108
|
+
}
|
|
1109
|
+
)
|
|
1110
|
+
] })
|
|
1111
|
+
]
|
|
1112
|
+
}
|
|
1113
|
+
);
|
|
1069
1114
|
};
|
|
1070
1115
|
var pagination_default = Pagination;
|
|
1071
1116
|
|
|
@@ -1075,10 +1120,11 @@ var RadioButton = ({
|
|
|
1075
1120
|
label,
|
|
1076
1121
|
value,
|
|
1077
1122
|
selectedValue,
|
|
1078
|
-
onChange
|
|
1123
|
+
onChange,
|
|
1124
|
+
className = ""
|
|
1079
1125
|
}) => {
|
|
1080
1126
|
const isChecked = selectedValue === value;
|
|
1081
|
-
return /* @__PURE__ */ jsxs24("label", { className:
|
|
1127
|
+
return /* @__PURE__ */ jsxs24("label", { className: `flex items-center gap-2 cursor-pointer ${className}`, children: [
|
|
1082
1128
|
/* @__PURE__ */ jsx33(
|
|
1083
1129
|
"div",
|
|
1084
1130
|
{
|
|
@@ -1117,27 +1163,28 @@ var SNACK_BAR_TYPE = /* @__PURE__ */ ((SNACK_BAR_TYPE2) => {
|
|
|
1117
1163
|
var Snackbar = ({
|
|
1118
1164
|
type = "default" /* DEFAULT */,
|
|
1119
1165
|
message,
|
|
1120
|
-
icon
|
|
1166
|
+
icon,
|
|
1167
|
+
className = ""
|
|
1121
1168
|
}) => {
|
|
1122
1169
|
const getClassName = () => {
|
|
1123
1170
|
switch (type) {
|
|
1124
1171
|
case "success" /* SUCCESS */:
|
|
1125
|
-
return "bg-
|
|
1172
|
+
return "bg-green-50 text-green-800 border-green-500";
|
|
1126
1173
|
case "danger" /* DANGER */:
|
|
1127
|
-
return "bg-
|
|
1174
|
+
return "bg-red-50 text-red-600 border-red-500";
|
|
1128
1175
|
case "warning" /* WARNING */:
|
|
1129
|
-
return "bg-
|
|
1176
|
+
return "bg-yellow-50 text-yellow-800 border-yellow-600";
|
|
1130
1177
|
case "info" /* INFO */:
|
|
1131
|
-
return "bg-
|
|
1178
|
+
return "bg-blue-50 text-blue-800 border-blue-600";
|
|
1132
1179
|
case "default" /* DEFAULT */:
|
|
1133
1180
|
default:
|
|
1134
|
-
return "bg-
|
|
1181
|
+
return "bg-neutral-50 text-neutral-800 border-neutral-500";
|
|
1135
1182
|
}
|
|
1136
1183
|
};
|
|
1137
1184
|
return /* @__PURE__ */ jsxs25(
|
|
1138
1185
|
"div",
|
|
1139
1186
|
{
|
|
1140
|
-
className: `${getClassName()} p-4 rounded-lg flex flex-row gap-4 items-center font-normal border`,
|
|
1187
|
+
className: `${getClassName()} p-4 rounded-lg flex flex-row gap-4 items-center font-normal border ${className}`,
|
|
1141
1188
|
children: [
|
|
1142
1189
|
icon && /* @__PURE__ */ jsx34("div", { className: "size-5", children: icon }),
|
|
1143
1190
|
/* @__PURE__ */ jsx34("div", { children: message })
|
|
@@ -1163,7 +1210,8 @@ var State = ({
|
|
|
1163
1210
|
title,
|
|
1164
1211
|
subTitle,
|
|
1165
1212
|
imageWidth = 526,
|
|
1166
|
-
imageHeight = 526
|
|
1213
|
+
imageHeight = 526,
|
|
1214
|
+
className = ""
|
|
1167
1215
|
}) => {
|
|
1168
1216
|
const typeImage = () => {
|
|
1169
1217
|
switch (type) {
|
|
@@ -1179,53 +1227,65 @@ var State = ({
|
|
|
1179
1227
|
return "/images/empty.png";
|
|
1180
1228
|
}
|
|
1181
1229
|
};
|
|
1182
|
-
return /* @__PURE__ */ jsxs26(
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
{
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1230
|
+
return /* @__PURE__ */ jsxs26(
|
|
1231
|
+
"div",
|
|
1232
|
+
{
|
|
1233
|
+
className: `w-full h-full flex flex-col gap-8 items-center justify-center ${className}`,
|
|
1234
|
+
children: [
|
|
1235
|
+
stateImage ? /* @__PURE__ */ jsx35(
|
|
1236
|
+
Image3,
|
|
1237
|
+
{
|
|
1238
|
+
src: stateImage,
|
|
1239
|
+
alt: "state image",
|
|
1240
|
+
width: imageWidth,
|
|
1241
|
+
height: imageHeight
|
|
1242
|
+
}
|
|
1243
|
+
) : /* @__PURE__ */ jsx35(
|
|
1244
|
+
Image3,
|
|
1245
|
+
{
|
|
1246
|
+
src: typeImage(),
|
|
1247
|
+
alt: "state image",
|
|
1248
|
+
width: imageWidth,
|
|
1249
|
+
height: imageHeight
|
|
1250
|
+
}
|
|
1251
|
+
),
|
|
1252
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex flex-col gap-2", children: [
|
|
1253
|
+
/* @__PURE__ */ jsx35("p", { className: "text-3xl text-center font-semibold", children: title }),
|
|
1254
|
+
/* @__PURE__ */ jsx35("p", { className: "w-[300px] text-center", children: subTitle })
|
|
1255
|
+
] })
|
|
1256
|
+
]
|
|
1257
|
+
}
|
|
1258
|
+
);
|
|
1205
1259
|
};
|
|
1206
1260
|
var state_default = State;
|
|
1207
1261
|
|
|
1208
1262
|
// src/components/table/index.tsx
|
|
1209
1263
|
import { jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1210
|
-
var Table = ({ columns, data }) => {
|
|
1211
|
-
return /* @__PURE__ */ jsx36(
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
{
|
|
1215
|
-
|
|
1216
|
-
children: header
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1264
|
+
var Table = ({ columns, data, className = "" }) => {
|
|
1265
|
+
return /* @__PURE__ */ jsx36(
|
|
1266
|
+
"div",
|
|
1267
|
+
{
|
|
1268
|
+
className: `overflow-hidden rounded-lg border border-neutral-300 ${className}`,
|
|
1269
|
+
children: /* @__PURE__ */ jsxs27("table", { className: "w-full border-collapse", children: [
|
|
1270
|
+
/* @__PURE__ */ jsx36("thead", { children: /* @__PURE__ */ jsx36("tr", { className: "bg-neutral-300 border border-neutral-300", children: columns.map(({ header, headerClassName }, index) => /* @__PURE__ */ jsx36(
|
|
1271
|
+
"th",
|
|
1272
|
+
{
|
|
1273
|
+
className: `text-left px-4 py-4 ${headerClassName}`,
|
|
1274
|
+
children: header
|
|
1275
|
+
},
|
|
1276
|
+
`column_${index}`
|
|
1277
|
+
)) }) }),
|
|
1278
|
+
/* @__PURE__ */ jsx36("tbody", { children: data.map((row, rowIndex) => /* @__PURE__ */ jsx36(
|
|
1279
|
+
"tr",
|
|
1280
|
+
{
|
|
1281
|
+
className: "bg-white hover:bg-neutral-100",
|
|
1282
|
+
children: columns.map(({ render }, cellIndex) => /* @__PURE__ */ jsx36("td", { className: "text-left px-4 py-4", children: render(row) }, `cell_${cellIndex}`))
|
|
1283
|
+
},
|
|
1284
|
+
`row_${rowIndex}`
|
|
1285
|
+
)) })
|
|
1286
|
+
] })
|
|
1287
|
+
}
|
|
1288
|
+
);
|
|
1229
1289
|
};
|
|
1230
1290
|
var table_default = Table;
|
|
1231
1291
|
|
|
@@ -1239,29 +1299,37 @@ var TAG_TYPE = /* @__PURE__ */ ((TAG_TYPE2) => {
|
|
|
1239
1299
|
TAG_TYPE2["INFO"] = "info";
|
|
1240
1300
|
return TAG_TYPE2;
|
|
1241
1301
|
})(TAG_TYPE || {});
|
|
1242
|
-
var Tag = ({ type, label }) => {
|
|
1302
|
+
var Tag = ({ type, label, className = "" }) => {
|
|
1243
1303
|
const getTagStyle = (type2) => {
|
|
1244
1304
|
switch (type2) {
|
|
1245
1305
|
case "success" /* SUCCESS */:
|
|
1246
|
-
return "bg-
|
|
1306
|
+
return "bg-green-50 text-green-600";
|
|
1247
1307
|
case "danger" /* DANGER */:
|
|
1248
|
-
return "bg-
|
|
1308
|
+
return "bg-red-50 text-red-600";
|
|
1249
1309
|
case "warning" /* WARNING */:
|
|
1250
|
-
return "bg-
|
|
1310
|
+
return "bg-yellow-50 text-yellow-600";
|
|
1251
1311
|
case "info" /* INFO */:
|
|
1252
|
-
return "bg-
|
|
1312
|
+
return "bg-blue-50 text-blue-600";
|
|
1253
1313
|
default:
|
|
1254
|
-
return "bg-
|
|
1314
|
+
return "bg-neutral-50 text-neutral-600";
|
|
1255
1315
|
}
|
|
1256
1316
|
};
|
|
1257
|
-
return /* @__PURE__ */ jsx37(
|
|
1317
|
+
return /* @__PURE__ */ jsx37(
|
|
1318
|
+
"div",
|
|
1319
|
+
{
|
|
1320
|
+
className: `w-fit px-4 py-2 rounded-lg text-sm ${getTagStyle(
|
|
1321
|
+
type
|
|
1322
|
+
)} ${className}`,
|
|
1323
|
+
children: label
|
|
1324
|
+
}
|
|
1325
|
+
);
|
|
1258
1326
|
};
|
|
1259
1327
|
var tag_default = Tag;
|
|
1260
1328
|
|
|
1261
1329
|
// src/components/timeLine/index.tsx
|
|
1262
1330
|
import { useEffect as useEffect6, useState as useState9 } from "react";
|
|
1263
1331
|
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1264
|
-
var TimeLine = ({ logs }) => {
|
|
1332
|
+
var TimeLine = ({ logs, className = "" }) => {
|
|
1265
1333
|
const [steps, setSteps] = useState9([]);
|
|
1266
1334
|
useEffect6(() => {
|
|
1267
1335
|
if (logs[0].title !== "Order cancelled" /* ORDER_CANCELLED */ && logs[0].title !== "Delivered" /* DELIVERED */) {
|
|
@@ -1282,17 +1350,17 @@ var TimeLine = ({ logs }) => {
|
|
|
1282
1350
|
case "Packaging" /* PACKAGING */:
|
|
1283
1351
|
case "Dispatched to courier" /* DISPATCHED_TO_COURIER */:
|
|
1284
1352
|
case "Delivered" /* DELIVERED */:
|
|
1285
|
-
return /* @__PURE__ */ jsx38("div", { className: "size-5 bg-
|
|
1353
|
+
return /* @__PURE__ */ jsx38("div", { className: "size-5 bg-green-500 rounded-full p-1 text-white", children: /* @__PURE__ */ jsx38(Check, {}) });
|
|
1286
1354
|
case "Order cancelled" /* ORDER_CANCELLED */:
|
|
1287
|
-
return /* @__PURE__ */ jsx38("div", { className: "size-5 bg-
|
|
1355
|
+
return /* @__PURE__ */ jsx38("div", { className: "size-5 bg-red-500 rounded-full p-1 text-white", children: /* @__PURE__ */ jsx38(Cross, {}) });
|
|
1288
1356
|
default:
|
|
1289
|
-
return /* @__PURE__ */ jsx38("div", { className: "size-5 bg-
|
|
1357
|
+
return /* @__PURE__ */ jsx38("div", { className: "size-5 bg-neutral-600 text-neutral-200 rounded-full p-1", children: /* @__PURE__ */ jsx38(Circle, {}) });
|
|
1290
1358
|
}
|
|
1291
1359
|
};
|
|
1292
|
-
return /* @__PURE__ */ jsx38("div", { children: steps.map(({ title, date, description }, index) => /* @__PURE__ */ jsxs28("div", { className: "flex flex-row gap-4", children: [
|
|
1360
|
+
return /* @__PURE__ */ jsx38("div", { className, children: steps.map(({ title, date, description }, index) => /* @__PURE__ */ jsxs28("div", { className: "flex flex-row gap-4", children: [
|
|
1293
1361
|
/* @__PURE__ */ jsxs28("div", { className: "flex flex-col items-center", children: [
|
|
1294
1362
|
getIcon(title),
|
|
1295
|
-
/* @__PURE__ */ jsx38("div", { className: "w-0.5 h-full bg-
|
|
1363
|
+
/* @__PURE__ */ jsx38("div", { className: "w-0.5 h-full bg-neutral-500" })
|
|
1296
1364
|
] }),
|
|
1297
1365
|
/* @__PURE__ */ jsxs28("div", { className: "flex flex-col flex-1", children: [
|
|
1298
1366
|
/* @__PURE__ */ jsx38(
|
|
@@ -1302,8 +1370,8 @@ var TimeLine = ({ logs }) => {
|
|
|
1302
1370
|
children: title
|
|
1303
1371
|
}
|
|
1304
1372
|
),
|
|
1305
|
-
title && /* @__PURE__ */ jsx38("p", { className: "text-xs text-
|
|
1306
|
-
description && /* @__PURE__ */ jsx38("p", { className: "p-4 text-xs bg-
|
|
1373
|
+
title && /* @__PURE__ */ jsx38("p", { className: "text-xs text-neutral-700", children: date }),
|
|
1374
|
+
description && /* @__PURE__ */ jsx38("p", { className: "p-4 text-xs bg-neutral-50 text-neutral-800 rounded-lg my-2", children: description })
|
|
1307
1375
|
] })
|
|
1308
1376
|
] }, `log_${index}`)) });
|
|
1309
1377
|
};
|