@algorithm-shift/design-system 1.2.24 → 1.2.26
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.css +3 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +227 -66
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +283 -122
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -239,7 +239,15 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
239
239
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
240
240
|
const [value, setValue] = React2.useState("");
|
|
241
241
|
const [error, setError] = React2.useState(null);
|
|
242
|
+
React2.useEffect(() => {
|
|
243
|
+
if (!props.validateOnMount) return;
|
|
244
|
+
setError(props.errorMessage || null);
|
|
245
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
242
246
|
const handleChange = (e) => {
|
|
247
|
+
if (props.hasFormContainer) {
|
|
248
|
+
props.onChange?.(e);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
243
251
|
const val = e.target.value;
|
|
244
252
|
if (val.length > noOfCharacters) return;
|
|
245
253
|
setValue(val);
|
|
@@ -256,9 +264,13 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
256
264
|
Input,
|
|
257
265
|
{
|
|
258
266
|
type: "text",
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
267
|
+
name: props.name,
|
|
268
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
269
|
+
style: {
|
|
270
|
+
...style,
|
|
271
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
272
|
+
},
|
|
273
|
+
value: props.value || value,
|
|
262
274
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
263
275
|
placeholder,
|
|
264
276
|
onChange: handleChange,
|
|
@@ -475,6 +487,7 @@ var __iconNode14 = [
|
|
|
475
487
|
var Search = createLucideIcon("search", __iconNode14);
|
|
476
488
|
|
|
477
489
|
// src/components/Inputs/NumberInput/NumberInput.tsx
|
|
490
|
+
import { useEffect as useEffect2 } from "react";
|
|
478
491
|
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
479
492
|
var NumberInput = ({ className, style, ...props }) => {
|
|
480
493
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -488,7 +501,15 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
488
501
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
489
502
|
const [value, setValue] = React3.useState("");
|
|
490
503
|
const [error, setError] = React3.useState(null);
|
|
504
|
+
useEffect2(() => {
|
|
505
|
+
if (!props.validateOnMount) return;
|
|
506
|
+
setError(props.errorMessage || null);
|
|
507
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
491
508
|
const handleChange = (e) => {
|
|
509
|
+
if (props.hasFormContainer) {
|
|
510
|
+
props.onChange?.(e);
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
492
513
|
const val = e.target.value;
|
|
493
514
|
if (val.length > noOfCharacters) return;
|
|
494
515
|
setValue(val);
|
|
@@ -508,9 +529,13 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
508
529
|
{
|
|
509
530
|
type: "number",
|
|
510
531
|
id: "number-field",
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
532
|
+
name: props.name,
|
|
533
|
+
value: props.value || value,
|
|
534
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
535
|
+
style: {
|
|
536
|
+
...style,
|
|
537
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
538
|
+
},
|
|
514
539
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
515
540
|
placeholder,
|
|
516
541
|
onChange: handleChange,
|
|
@@ -542,7 +567,15 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
542
567
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
543
568
|
const [value, setValue] = React4.useState("");
|
|
544
569
|
const [error, setError] = React4.useState(null);
|
|
570
|
+
React4.useEffect(() => {
|
|
571
|
+
if (!props.validateOnMount) return;
|
|
572
|
+
setError(props.errorMessage || null);
|
|
573
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
545
574
|
const handleChange = (e) => {
|
|
575
|
+
if (props.hasFormContainer) {
|
|
576
|
+
props.onChange?.(e);
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
546
579
|
const val = e.target.value;
|
|
547
580
|
if (val.length > noOfCharacters) return;
|
|
548
581
|
setValue(val);
|
|
@@ -561,9 +594,13 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
561
594
|
Input,
|
|
562
595
|
{
|
|
563
596
|
type: "email",
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
597
|
+
name: props.name,
|
|
598
|
+
value: props.value || value,
|
|
599
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
600
|
+
style: {
|
|
601
|
+
...style,
|
|
602
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
603
|
+
},
|
|
567
604
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
568
605
|
placeholder,
|
|
569
606
|
onChange: handleChange,
|
|
@@ -595,7 +632,15 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
595
632
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
596
633
|
const [value, setValue] = React5.useState("");
|
|
597
634
|
const [error, setError] = React5.useState(null);
|
|
635
|
+
React5.useEffect(() => {
|
|
636
|
+
if (!props.validateOnMount) return;
|
|
637
|
+
setError(props.errorMessage || null);
|
|
638
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
598
639
|
const handleChange = (e) => {
|
|
640
|
+
if (props.hasFormContainer) {
|
|
641
|
+
props.onChange?.(e);
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
599
644
|
const val = e.target.value;
|
|
600
645
|
if (val.length > noOfCharacters) return;
|
|
601
646
|
setValue(val);
|
|
@@ -615,9 +660,13 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
615
660
|
{
|
|
616
661
|
type: "password",
|
|
617
662
|
id: "password-field",
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
663
|
+
name: props.name,
|
|
664
|
+
value: props.value || value,
|
|
665
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
666
|
+
style: {
|
|
667
|
+
...style,
|
|
668
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
669
|
+
},
|
|
621
670
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
622
671
|
placeholder,
|
|
623
672
|
onChange: handleChange,
|
|
@@ -667,7 +716,15 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
667
716
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
668
717
|
const [value, setValue] = React6.useState("");
|
|
669
718
|
const [error, setError] = React6.useState(null);
|
|
719
|
+
React6.useEffect(() => {
|
|
720
|
+
if (!props.validateOnMount) return;
|
|
721
|
+
setError(props.errorMessage || null);
|
|
722
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
670
723
|
const handleChange = (e) => {
|
|
724
|
+
if (props.hasFormContainer) {
|
|
725
|
+
props.onChange?.(e);
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
671
728
|
const val = e.target.value;
|
|
672
729
|
if (val.length > noOfCharacters) return;
|
|
673
730
|
setValue(val);
|
|
@@ -684,9 +741,13 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
684
741
|
Textarea,
|
|
685
742
|
{
|
|
686
743
|
id: "textarea-field",
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
744
|
+
name: props.name,
|
|
745
|
+
value: props.value || value,
|
|
746
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
747
|
+
style: {
|
|
748
|
+
...style,
|
|
749
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
750
|
+
},
|
|
690
751
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
691
752
|
placeholder,
|
|
692
753
|
onChange: handleChange,
|
|
@@ -716,7 +777,15 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
716
777
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
717
778
|
const [value, setValue] = React7.useState("");
|
|
718
779
|
const [error, setError] = React7.useState(null);
|
|
780
|
+
React7.useEffect(() => {
|
|
781
|
+
if (!props.validateOnMount) return;
|
|
782
|
+
setError(props.errorMessage || null);
|
|
783
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
719
784
|
const handleChange = (e) => {
|
|
785
|
+
if (props.hasFormContainer) {
|
|
786
|
+
props.onChange?.(e);
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
720
789
|
const val = e.target.value;
|
|
721
790
|
if (val.length > noOfCharacters) return;
|
|
722
791
|
setValue(val);
|
|
@@ -734,11 +803,15 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
734
803
|
/* @__PURE__ */ jsx16(
|
|
735
804
|
Input,
|
|
736
805
|
{
|
|
737
|
-
type: "url",
|
|
738
|
-
className,
|
|
739
|
-
style,
|
|
740
806
|
id: "url-field",
|
|
741
|
-
|
|
807
|
+
type: "url",
|
|
808
|
+
name: props.name,
|
|
809
|
+
value: props.value || value,
|
|
810
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
811
|
+
style: {
|
|
812
|
+
...style,
|
|
813
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
814
|
+
},
|
|
742
815
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
743
816
|
placeholder,
|
|
744
817
|
onChange: handleChange,
|
|
@@ -885,6 +958,9 @@ var MultiCheckbox = ({ className, style, ...props }) => {
|
|
|
885
958
|
};
|
|
886
959
|
var MultiCheckbox_default = MultiCheckbox;
|
|
887
960
|
|
|
961
|
+
// src/components/Inputs/RichText/RichText.tsx
|
|
962
|
+
import { useEffect as useEffect7, useState as useState7 } from "react";
|
|
963
|
+
|
|
888
964
|
// src/components/Global/TinyMceEditor.tsx
|
|
889
965
|
import { useMemo, useRef } from "react";
|
|
890
966
|
import { Editor } from "@tinymce/tinymce-react";
|
|
@@ -957,9 +1033,27 @@ function MyEditor({
|
|
|
957
1033
|
}
|
|
958
1034
|
|
|
959
1035
|
// src/components/Inputs/RichText/RichText.tsx
|
|
960
|
-
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
961
|
-
function RichText({ className, style }) {
|
|
962
|
-
|
|
1036
|
+
import { jsx as jsx24, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1037
|
+
function RichText({ className, style, ...props }) {
|
|
1038
|
+
const [error, setError] = useState7(null);
|
|
1039
|
+
useEffect7(() => {
|
|
1040
|
+
if (!props.validateOnMount) return;
|
|
1041
|
+
setError(props.errorMessage || null);
|
|
1042
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
1043
|
+
return /* @__PURE__ */ jsxs11(
|
|
1044
|
+
"div",
|
|
1045
|
+
{
|
|
1046
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
1047
|
+
style: {
|
|
1048
|
+
...style,
|
|
1049
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
1050
|
+
},
|
|
1051
|
+
children: [
|
|
1052
|
+
/* @__PURE__ */ jsx24(MyEditor, { onChange: (content) => props.onChange?.(content), value: props.value, isDefault: true }),
|
|
1053
|
+
error && /* @__PURE__ */ jsx24("p", { className: "mt-1 text-xs text-red-500", children: error })
|
|
1054
|
+
]
|
|
1055
|
+
}
|
|
1056
|
+
);
|
|
963
1057
|
}
|
|
964
1058
|
|
|
965
1059
|
// src/components/Inputs/Dropdown/Dropdown.tsx
|
|
@@ -967,7 +1061,7 @@ import * as React8 from "react";
|
|
|
967
1061
|
|
|
968
1062
|
// src/components/ui/select.tsx
|
|
969
1063
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
970
|
-
import { jsx as jsx25, jsxs as
|
|
1064
|
+
import { jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
971
1065
|
function Select({
|
|
972
1066
|
...props
|
|
973
1067
|
}) {
|
|
@@ -984,7 +1078,7 @@ function SelectTrigger({
|
|
|
984
1078
|
children,
|
|
985
1079
|
...props
|
|
986
1080
|
}) {
|
|
987
|
-
return /* @__PURE__ */
|
|
1081
|
+
return /* @__PURE__ */ jsxs12(
|
|
988
1082
|
SelectPrimitive.Trigger,
|
|
989
1083
|
{
|
|
990
1084
|
"data-slot": "select-trigger",
|
|
@@ -1007,7 +1101,7 @@ function SelectContent({
|
|
|
1007
1101
|
position = "popper",
|
|
1008
1102
|
...props
|
|
1009
1103
|
}) {
|
|
1010
|
-
return /* @__PURE__ */ jsx25(SelectPrimitive.Portal, { children: /* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ jsx25(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs12(
|
|
1011
1105
|
SelectPrimitive.Content,
|
|
1012
1106
|
{
|
|
1013
1107
|
"data-slot": "select-content",
|
|
@@ -1040,7 +1134,7 @@ function SelectItem({
|
|
|
1040
1134
|
children,
|
|
1041
1135
|
...props
|
|
1042
1136
|
}) {
|
|
1043
|
-
return /* @__PURE__ */
|
|
1137
|
+
return /* @__PURE__ */ jsxs12(
|
|
1044
1138
|
SelectPrimitive.Item,
|
|
1045
1139
|
{
|
|
1046
1140
|
"data-slot": "select-item",
|
|
@@ -1092,7 +1186,7 @@ function SelectScrollDownButton({
|
|
|
1092
1186
|
}
|
|
1093
1187
|
|
|
1094
1188
|
// src/components/Global/SelectDropdown.tsx
|
|
1095
|
-
import { jsx as jsx26, jsxs as
|
|
1189
|
+
import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1096
1190
|
function SelectDropdown({
|
|
1097
1191
|
options,
|
|
1098
1192
|
placeholder = "Select an option",
|
|
@@ -1102,9 +1196,10 @@ function SelectDropdown({
|
|
|
1102
1196
|
id,
|
|
1103
1197
|
disabled,
|
|
1104
1198
|
readOnly,
|
|
1105
|
-
style
|
|
1199
|
+
style,
|
|
1200
|
+
name
|
|
1106
1201
|
}) {
|
|
1107
|
-
return /* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ jsxs13(Select, { name, value, onValueChange: onChange, disabled, children: [
|
|
1108
1203
|
/* @__PURE__ */ jsx26(
|
|
1109
1204
|
SelectTrigger,
|
|
1110
1205
|
{
|
|
@@ -1120,7 +1215,7 @@ function SelectDropdown({
|
|
|
1120
1215
|
}
|
|
1121
1216
|
|
|
1122
1217
|
// src/components/Inputs/Dropdown/Dropdown.tsx
|
|
1123
|
-
import { Fragment as Fragment7, jsx as jsx27, jsxs as
|
|
1218
|
+
import { Fragment as Fragment7, jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1124
1219
|
var Dropdown = ({ className, style, ...props }) => {
|
|
1125
1220
|
const text = Array.isArray(props.text) ? props.text : [props.text ?? "Default"];
|
|
1126
1221
|
const placeholder = props.placeholder ? props.placeholder : "Placeholder text";
|
|
@@ -1137,7 +1232,15 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
1137
1232
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
1138
1233
|
const [value, setValue] = React8.useState("");
|
|
1139
1234
|
const [error, setError] = React8.useState(null);
|
|
1235
|
+
React8.useEffect(() => {
|
|
1236
|
+
if (!props.validateOnMount) return;
|
|
1237
|
+
setError(props.errorMessage || null);
|
|
1238
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
1140
1239
|
const handleChange = (val) => {
|
|
1240
|
+
if (props.hasFormContainer) {
|
|
1241
|
+
props.onChange?.(val);
|
|
1242
|
+
return;
|
|
1243
|
+
}
|
|
1141
1244
|
setValue(val);
|
|
1142
1245
|
if (isRequired && val.trim() === "") {
|
|
1143
1246
|
setError(errorMessage);
|
|
@@ -1147,16 +1250,20 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
1147
1250
|
setError(null);
|
|
1148
1251
|
}
|
|
1149
1252
|
};
|
|
1150
|
-
return /* @__PURE__ */
|
|
1253
|
+
return /* @__PURE__ */ jsxs14(Fragment7, { children: [
|
|
1151
1254
|
/* @__PURE__ */ jsx27("div", { className: "flex gap-3 flex-col", children: /* @__PURE__ */ jsx27(
|
|
1152
1255
|
SelectDropdown,
|
|
1153
1256
|
{
|
|
1154
1257
|
options: formatList,
|
|
1155
1258
|
placeholder,
|
|
1156
1259
|
id: "select-field",
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1260
|
+
name: props.name,
|
|
1261
|
+
value: props.value || value,
|
|
1262
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
1263
|
+
style: {
|
|
1264
|
+
...style,
|
|
1265
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
1266
|
+
},
|
|
1160
1267
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
1161
1268
|
onChange: handleChange,
|
|
1162
1269
|
disabled: isDisabled || !isEditable,
|
|
@@ -1200,10 +1307,10 @@ function Switch({
|
|
|
1200
1307
|
}
|
|
1201
1308
|
|
|
1202
1309
|
// src/components/Inputs/SwitchToggle/SwitchToggle.tsx
|
|
1203
|
-
import { jsx as jsx29, jsxs as
|
|
1310
|
+
import { jsx as jsx29, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1204
1311
|
var SwitchToggle = ({ className, style, ...props }) => {
|
|
1205
1312
|
const text = Array.isArray(props.text) ? props.text : [props.text ?? "Subscribe"];
|
|
1206
|
-
return /* @__PURE__ */ jsx29("div", { className, style, children: text?.map((item, index) => /* @__PURE__ */
|
|
1313
|
+
return /* @__PURE__ */ jsx29("div", { className, style, children: text?.map((item, index) => /* @__PURE__ */ jsxs15("div", { className: "flex items-center space-x-2 mb-2", children: [
|
|
1207
1314
|
/* @__PURE__ */ jsx29(Switch, { id: `switch-${index}` }),
|
|
1208
1315
|
/* @__PURE__ */ jsx29(Label, { htmlFor: `switch-${index}`, children: item })
|
|
1209
1316
|
] }, index)) });
|
|
@@ -1214,7 +1321,7 @@ var SwitchToggle_default = SwitchToggle;
|
|
|
1214
1321
|
import * as React9 from "react";
|
|
1215
1322
|
import { PhoneInput as PhoneInputField } from "react-international-phone";
|
|
1216
1323
|
import "react-international-phone/style.css";
|
|
1217
|
-
import { Fragment as Fragment8, jsx as jsx30, jsxs as
|
|
1324
|
+
import { Fragment as Fragment8, jsx as jsx30, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1218
1325
|
var PhoneInput = ({ className, style, ...props }) => {
|
|
1219
1326
|
const placeholder = props.placeholder ?? "Enter phone number";
|
|
1220
1327
|
const [value, setValue] = React9.useState("");
|
|
@@ -1225,7 +1332,15 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
1225
1332
|
const isEditable = props.isEditable ?? true;
|
|
1226
1333
|
const isDisabled = props.isDisabled ?? false;
|
|
1227
1334
|
const [error, setError] = React9.useState(null);
|
|
1335
|
+
React9.useEffect(() => {
|
|
1336
|
+
if (!props.validateOnMount) return;
|
|
1337
|
+
setError(props.errorMessage || null);
|
|
1338
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
1228
1339
|
const handleChange = (val) => {
|
|
1340
|
+
if (props.hasFormContainer) {
|
|
1341
|
+
props.onChange?.(val);
|
|
1342
|
+
return;
|
|
1343
|
+
}
|
|
1229
1344
|
if (val.length > noOfCharacters) return;
|
|
1230
1345
|
setValue(val);
|
|
1231
1346
|
if (isRequired && val.trim() === "") {
|
|
@@ -1236,12 +1351,18 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
1236
1351
|
setError(null);
|
|
1237
1352
|
}
|
|
1238
1353
|
};
|
|
1239
|
-
return /* @__PURE__ */
|
|
1354
|
+
return /* @__PURE__ */ jsxs16(Fragment8, { children: [
|
|
1240
1355
|
/* @__PURE__ */ jsx30(
|
|
1241
1356
|
PhoneInputField,
|
|
1242
1357
|
{
|
|
1243
1358
|
defaultCountry: "in",
|
|
1244
|
-
|
|
1359
|
+
name: props.name,
|
|
1360
|
+
value: props.value || value,
|
|
1361
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
1362
|
+
style: {
|
|
1363
|
+
...style,
|
|
1364
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
1365
|
+
},
|
|
1245
1366
|
onChange: (phone) => handleChange(phone),
|
|
1246
1367
|
inputProps: {
|
|
1247
1368
|
id: "phone-field",
|
|
@@ -1249,9 +1370,7 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
1249
1370
|
},
|
|
1250
1371
|
placeholder,
|
|
1251
1372
|
disabled: isDisabled || !isEditable,
|
|
1252
|
-
required: isRequired
|
|
1253
|
-
className,
|
|
1254
|
-
style
|
|
1373
|
+
required: isRequired
|
|
1255
1374
|
}
|
|
1256
1375
|
),
|
|
1257
1376
|
error && /* @__PURE__ */ jsx30("p", { className: "mt-1 text-xs text-red-500", children: error })
|
|
@@ -1261,7 +1380,7 @@ var PhoneInput_default = PhoneInput;
|
|
|
1261
1380
|
|
|
1262
1381
|
// src/components/Inputs/SearchInput/SearchInput.tsx
|
|
1263
1382
|
import * as React10 from "react";
|
|
1264
|
-
import { Fragment as Fragment9, jsx as jsx31, jsxs as
|
|
1383
|
+
import { Fragment as Fragment9, jsx as jsx31, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1265
1384
|
var SearchInput = ({ className, style, ...props }) => {
|
|
1266
1385
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
1267
1386
|
const regexPattern = props.regexPattern ?? "";
|
|
@@ -1274,7 +1393,15 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
1274
1393
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
1275
1394
|
const [value, setValue] = React10.useState("");
|
|
1276
1395
|
const [error, setError] = React10.useState(null);
|
|
1396
|
+
React10.useEffect(() => {
|
|
1397
|
+
if (!props.validateOnMount) return;
|
|
1398
|
+
setError(props.errorMessage || null);
|
|
1399
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
1277
1400
|
const handleChange = (e) => {
|
|
1401
|
+
if (props.hasFormContainer) {
|
|
1402
|
+
props.onChange?.(e);
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1278
1405
|
const val = e.target.value;
|
|
1279
1406
|
if (val.length > noOfCharacters) return;
|
|
1280
1407
|
setValue(val);
|
|
@@ -1286,17 +1413,21 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
1286
1413
|
setError(null);
|
|
1287
1414
|
}
|
|
1288
1415
|
};
|
|
1289
|
-
return /* @__PURE__ */
|
|
1290
|
-
/* @__PURE__ */
|
|
1416
|
+
return /* @__PURE__ */ jsxs17(Fragment9, { children: [
|
|
1417
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex justify-start items-center relative", children: [
|
|
1291
1418
|
/* @__PURE__ */ jsx31(Search, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
|
|
1292
1419
|
/* @__PURE__ */ jsx31(
|
|
1293
1420
|
Input,
|
|
1294
1421
|
{
|
|
1295
1422
|
type: "text",
|
|
1296
1423
|
id: "text-field",
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1424
|
+
name: props.name,
|
|
1425
|
+
value: props.value || value,
|
|
1426
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
1427
|
+
style: {
|
|
1428
|
+
...style,
|
|
1429
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
1430
|
+
},
|
|
1300
1431
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
1301
1432
|
placeholder,
|
|
1302
1433
|
onChange: handleChange,
|
|
@@ -1314,29 +1445,46 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
1314
1445
|
var SearchInput_default = SearchInput;
|
|
1315
1446
|
|
|
1316
1447
|
// src/components/Inputs/FileInput/FileInput.tsx
|
|
1317
|
-
import {
|
|
1448
|
+
import { useEffect as useEffect11, useState as useState11 } from "react";
|
|
1449
|
+
import { jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1318
1450
|
var FileInput = ({ className, style, ...props }) => {
|
|
1319
1451
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
1320
|
-
|
|
1321
|
-
|
|
1452
|
+
const [error, setError] = useState11(null);
|
|
1453
|
+
useEffect11(() => {
|
|
1454
|
+
if (!props.validateOnMount) return;
|
|
1455
|
+
setError(props.errorMessage || null);
|
|
1456
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
1457
|
+
return /* @__PURE__ */ jsxs18("div", { className: "d-flex items-center relative align-middle", children: [
|
|
1322
1458
|
/* @__PURE__ */ jsx32(
|
|
1323
1459
|
Input,
|
|
1324
1460
|
{
|
|
1325
1461
|
type: "file",
|
|
1326
1462
|
id: "file",
|
|
1463
|
+
name: props.name,
|
|
1464
|
+
value: props.value,
|
|
1465
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
1466
|
+
style: {
|
|
1467
|
+
...style,
|
|
1468
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
1469
|
+
},
|
|
1327
1470
|
autoComplete: "off",
|
|
1328
1471
|
placeholder,
|
|
1329
|
-
|
|
1330
|
-
|
|
1472
|
+
onChange: (e) => {
|
|
1473
|
+
if (props.hasFormContainer) {
|
|
1474
|
+
props.onChange?.(e);
|
|
1475
|
+
return;
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1331
1478
|
}
|
|
1332
|
-
)
|
|
1479
|
+
),
|
|
1480
|
+
error && /* @__PURE__ */ jsx32("p", { className: "mt-1 text-xs text-red-500", children: error })
|
|
1333
1481
|
] });
|
|
1334
1482
|
};
|
|
1335
1483
|
var FileInput_default = FileInput;
|
|
1336
1484
|
|
|
1337
1485
|
// src/components/Inputs/DatePicker/DatePicker.tsx
|
|
1338
|
-
import React11 from "react";
|
|
1339
|
-
import { Fragment as Fragment10, jsx as jsx33, jsxs as
|
|
1486
|
+
import React11, { useEffect as useEffect12 } from "react";
|
|
1487
|
+
import { Fragment as Fragment10, jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1340
1488
|
function DatePicker({ className, style, ...props }) {
|
|
1341
1489
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
1342
1490
|
const minimumDate = props.minimumDate ?? "none";
|
|
@@ -1365,7 +1513,15 @@ function DatePicker({ className, style, ...props }) {
|
|
|
1365
1513
|
};
|
|
1366
1514
|
const minDate = resolveDate(minimumDate, customMinimumDate);
|
|
1367
1515
|
const maxDate = resolveDate(maximumDate, customMaximumDate);
|
|
1516
|
+
useEffect12(() => {
|
|
1517
|
+
if (!props.validateOnMount) return;
|
|
1518
|
+
setError(props.errorMessage || null);
|
|
1519
|
+
}, [props.errorMessage, props.validateOnMount]);
|
|
1368
1520
|
const handleChange = (e) => {
|
|
1521
|
+
if (props.hasFormContainer) {
|
|
1522
|
+
props.onChange?.(e);
|
|
1523
|
+
return;
|
|
1524
|
+
}
|
|
1369
1525
|
const val = e.target.value;
|
|
1370
1526
|
setValue(val);
|
|
1371
1527
|
if (isRequired && val.trim() === "") {
|
|
@@ -1374,8 +1530,8 @@ function DatePicker({ className, style, ...props }) {
|
|
|
1374
1530
|
setError(null);
|
|
1375
1531
|
}
|
|
1376
1532
|
};
|
|
1377
|
-
return /* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1533
|
+
return /* @__PURE__ */ jsxs19(Fragment10, { children: [
|
|
1534
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-start items-center relative", children: [
|
|
1379
1535
|
/* @__PURE__ */ jsx33(Calendar, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
|
|
1380
1536
|
/* @__PURE__ */ jsx33(
|
|
1381
1537
|
Input,
|
|
@@ -1385,14 +1541,18 @@ function DatePicker({ className, style, ...props }) {
|
|
|
1385
1541
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
1386
1542
|
onChange: handleChange,
|
|
1387
1543
|
disabled: isDisabled || !isEditable,
|
|
1388
|
-
|
|
1544
|
+
name: props.name,
|
|
1545
|
+
value: props.value || value,
|
|
1546
|
+
className: cn(className, error ? "border-red-500" : ""),
|
|
1547
|
+
style: {
|
|
1548
|
+
...style,
|
|
1549
|
+
borderColor: error ? "#f87171" : style?.borderColor
|
|
1550
|
+
},
|
|
1389
1551
|
readOnly: isReadonly,
|
|
1390
1552
|
required: isRequired,
|
|
1391
1553
|
placeholder,
|
|
1392
1554
|
min: minDate,
|
|
1393
|
-
max: maxDate
|
|
1394
|
-
className,
|
|
1395
|
-
style
|
|
1555
|
+
max: maxDate
|
|
1396
1556
|
}
|
|
1397
1557
|
)
|
|
1398
1558
|
] }),
|
|
@@ -1620,13 +1780,13 @@ function PopoverContent({
|
|
|
1620
1780
|
}
|
|
1621
1781
|
|
|
1622
1782
|
// src/components/Inputs/DateRange/DateRange.tsx
|
|
1623
|
-
import { Fragment as Fragment11, jsx as jsx36, jsxs as
|
|
1783
|
+
import { Fragment as Fragment11, jsx as jsx36, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1624
1784
|
var DateRange = ({ className, style }) => {
|
|
1625
1785
|
const [date, setDate] = React13.useState({
|
|
1626
1786
|
from: /* @__PURE__ */ new Date(),
|
|
1627
1787
|
to: addDays(/* @__PURE__ */ new Date(), 7)
|
|
1628
1788
|
});
|
|
1629
|
-
return /* @__PURE__ */ jsx36("div", { className, style, children: /* @__PURE__ */
|
|
1789
|
+
return /* @__PURE__ */ jsx36("div", { className, style, children: /* @__PURE__ */ jsxs20(Popover, { children: [
|
|
1630
1790
|
/* @__PURE__ */ jsx36(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx36(
|
|
1631
1791
|
Button,
|
|
1632
1792
|
{
|
|
@@ -1636,7 +1796,7 @@ var DateRange = ({ className, style }) => {
|
|
|
1636
1796
|
"w-[300px] justify-start text-left font-normal text-[11px]",
|
|
1637
1797
|
!date && "text-muted-foreground"
|
|
1638
1798
|
),
|
|
1639
|
-
children: date?.from ? date.to ? /* @__PURE__ */
|
|
1799
|
+
children: date?.from ? date.to ? /* @__PURE__ */ jsxs20(Fragment11, { children: [
|
|
1640
1800
|
format(date.from, "LLL dd, y"),
|
|
1641
1801
|
" -",
|
|
1642
1802
|
" ",
|
|
@@ -1751,7 +1911,7 @@ function TableCell({ className, ...props }) {
|
|
|
1751
1911
|
}
|
|
1752
1912
|
|
|
1753
1913
|
// src/components/ui/data-table.tsx
|
|
1754
|
-
import { Fragment as Fragment12, jsx as jsx38, jsxs as
|
|
1914
|
+
import { Fragment as Fragment12, jsx as jsx38, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1755
1915
|
function DataTable({
|
|
1756
1916
|
columns,
|
|
1757
1917
|
rowActions,
|
|
@@ -1776,14 +1936,14 @@ function DataTable({
|
|
|
1776
1936
|
onCellClick(rowData, columnId);
|
|
1777
1937
|
}
|
|
1778
1938
|
};
|
|
1779
|
-
return /* @__PURE__ */ jsx38("div", { className: "overflow-hidden rounded-md border w-full", children: /* @__PURE__ */
|
|
1939
|
+
return /* @__PURE__ */ jsx38("div", { className: "overflow-hidden rounded-md border w-full", children: /* @__PURE__ */ jsxs21(Table, { children: [
|
|
1780
1940
|
/* @__PURE__ */ jsx38(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx38(TableRow, { children: headerGroup.headers.map((header) => {
|
|
1781
1941
|
return /* @__PURE__ */ jsx38(TableHead, { children: header.isPlaceholder ? null : flexRender(
|
|
1782
1942
|
header.column.columnDef.header,
|
|
1783
1943
|
header.getContext()
|
|
1784
1944
|
) }, header.id);
|
|
1785
1945
|
}) }, headerGroup.id)) }),
|
|
1786
|
-
/* @__PURE__ */ jsx38(TableBody, { children: loading ? /* @__PURE__ */ jsx38(TableRow, { children: /* @__PURE__ */ jsx38(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : /* @__PURE__ */ jsx38(Fragment12, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */
|
|
1946
|
+
/* @__PURE__ */ jsx38(TableBody, { children: loading ? /* @__PURE__ */ jsx38(TableRow, { children: /* @__PURE__ */ jsx38(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "Loading..." }) }) : /* @__PURE__ */ jsx38(Fragment12, { children: table.getRowModel().rows?.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsxs21(
|
|
1787
1947
|
TableRow,
|
|
1788
1948
|
{
|
|
1789
1949
|
"data-state": row.getIsSelected() && "selected",
|
|
@@ -1817,7 +1977,7 @@ function DataTable({
|
|
|
1817
1977
|
}
|
|
1818
1978
|
|
|
1819
1979
|
// src/components/ui/pagination.tsx
|
|
1820
|
-
import { jsx as jsx39, jsxs as
|
|
1980
|
+
import { jsx as jsx39, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1821
1981
|
function Pagination({ className, ...props }) {
|
|
1822
1982
|
return /* @__PURE__ */ jsx39(
|
|
1823
1983
|
"nav",
|
|
@@ -1873,7 +2033,7 @@ function PaginationPrevious({
|
|
|
1873
2033
|
className,
|
|
1874
2034
|
...props
|
|
1875
2035
|
}) {
|
|
1876
|
-
return /* @__PURE__ */
|
|
2036
|
+
return /* @__PURE__ */ jsxs22(
|
|
1877
2037
|
PaginationLink,
|
|
1878
2038
|
{
|
|
1879
2039
|
"aria-label": "Go to previous page",
|
|
@@ -1891,7 +2051,7 @@ function PaginationNext({
|
|
|
1891
2051
|
className,
|
|
1892
2052
|
...props
|
|
1893
2053
|
}) {
|
|
1894
|
-
return /* @__PURE__ */
|
|
2054
|
+
return /* @__PURE__ */ jsxs22(
|
|
1895
2055
|
PaginationLink,
|
|
1896
2056
|
{
|
|
1897
2057
|
"aria-label": "Go to next page",
|
|
@@ -1909,7 +2069,7 @@ function PaginationEllipsis({
|
|
|
1909
2069
|
className,
|
|
1910
2070
|
...props
|
|
1911
2071
|
}) {
|
|
1912
|
-
return /* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ jsxs22(
|
|
1913
2073
|
"span",
|
|
1914
2074
|
{
|
|
1915
2075
|
"aria-hidden": true,
|
|
@@ -1925,7 +2085,7 @@ function PaginationEllipsis({
|
|
|
1925
2085
|
}
|
|
1926
2086
|
|
|
1927
2087
|
// src/components/DataDisplay/Pagination/Pagination.tsx
|
|
1928
|
-
import { jsx as jsx40, jsxs as
|
|
2088
|
+
import { jsx as jsx40, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1929
2089
|
var CustomPagination = ({
|
|
1930
2090
|
totalPages,
|
|
1931
2091
|
currentPage,
|
|
@@ -1967,7 +2127,7 @@ var CustomPagination = ({
|
|
|
1967
2127
|
}
|
|
1968
2128
|
};
|
|
1969
2129
|
const pageNumbers = getPageNumbers();
|
|
1970
|
-
return /* @__PURE__ */ jsx40(Pagination, { children: /* @__PURE__ */
|
|
2130
|
+
return /* @__PURE__ */ jsx40(Pagination, { children: /* @__PURE__ */ jsxs23(PaginationContent, { children: [
|
|
1971
2131
|
/* @__PURE__ */ jsx40(PaginationItem, { children: /* @__PURE__ */ jsx40(
|
|
1972
2132
|
PaginationPrevious,
|
|
1973
2133
|
{
|
|
@@ -1996,20 +2156,21 @@ var CustomPagination = ({
|
|
|
1996
2156
|
var Pagination_default = CustomPagination;
|
|
1997
2157
|
|
|
1998
2158
|
// src/components/DataDisplay/Table/Table.tsx
|
|
1999
|
-
import { useState as
|
|
2000
|
-
import { jsx as jsx41, jsxs as
|
|
2159
|
+
import { useState as useState13 } from "react";
|
|
2160
|
+
import { jsx as jsx41, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2001
2161
|
var Table2 = ({ columns, data, rowActions, className, style, pagination = false, itemsPerPage = 10, onPageChange }) => {
|
|
2002
2162
|
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
2003
2163
|
const rawData = Array.isArray(data) ? data : [];
|
|
2004
2164
|
const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
|
|
2005
|
-
const [currentPage, setCurrentPage] =
|
|
2165
|
+
const [currentPage, setCurrentPage] = useState13(1);
|
|
2006
2166
|
const enablePagination = pagination && rawData.length > itemsPerPage;
|
|
2007
2167
|
const handlePageChange = (page) => {
|
|
2008
2168
|
setCurrentPage(page);
|
|
2009
2169
|
onPageChange?.(page);
|
|
2010
2170
|
};
|
|
2011
|
-
|
|
2012
|
-
|
|
2171
|
+
const paginatedData = enablePagination ? rawData.slice((currentPage - 1) * itemsPerPage, currentPage * itemsPerPage) : rawData;
|
|
2172
|
+
return /* @__PURE__ */ jsxs24("div", { className: `${className} space-y-3`, style, children: [
|
|
2173
|
+
/* @__PURE__ */ jsx41(DataTable, { columns: rawColumns, data: paginatedData, rowActions: rawRowActions }),
|
|
2013
2174
|
enablePagination && /* @__PURE__ */ jsx41(
|
|
2014
2175
|
Pagination_default,
|
|
2015
2176
|
{
|
|
@@ -2024,7 +2185,7 @@ var Table_default = Table2;
|
|
|
2024
2185
|
|
|
2025
2186
|
// src/components/ui/dropdown-menu.tsx
|
|
2026
2187
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
2027
|
-
import { jsx as jsx42, jsxs as
|
|
2188
|
+
import { jsx as jsx42, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2028
2189
|
function DropdownMenu({
|
|
2029
2190
|
...props
|
|
2030
2191
|
}) {
|
|
@@ -2112,7 +2273,7 @@ function DropdownMenuSeparator({
|
|
|
2112
2273
|
}
|
|
2113
2274
|
|
|
2114
2275
|
// src/components/Navigation/Tabs/Tabs.tsx
|
|
2115
|
-
import { jsx as jsx43, jsxs as
|
|
2276
|
+
import { jsx as jsx43, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2116
2277
|
var Tabs = ({ tabs, className, style, pathname, LinkComponent }) => {
|
|
2117
2278
|
const rawTabs = Array.isArray(tabs) ? tabs : [];
|
|
2118
2279
|
const baseClasses = "text-[12px] text-[#E9E9E9] p-2 text-center rounded-md transition-colors border-none outline-none focus:outline-none focus:ring-0 focus:ring-offset-0 cursor-pointer select-none ";
|
|
@@ -2130,8 +2291,8 @@ var Tabs = ({ tabs, className, style, pathname, LinkComponent }) => {
|
|
|
2130
2291
|
].join(" ");
|
|
2131
2292
|
const hasDropdown = Array.isArray(tab.children) && tab.children.length > 0 && tab.isDropDown;
|
|
2132
2293
|
if (hasDropdown) {
|
|
2133
|
-
return /* @__PURE__ */
|
|
2134
|
-
/* @__PURE__ */
|
|
2294
|
+
return /* @__PURE__ */ jsxs26(DropdownMenu, { children: [
|
|
2295
|
+
/* @__PURE__ */ jsxs26(
|
|
2135
2296
|
DropdownMenuTrigger,
|
|
2136
2297
|
{
|
|
2137
2298
|
className: `${finalClasses} inline-flex items-center gap-1`,
|
|
@@ -2167,11 +2328,11 @@ var Tabs_default = Tabs;
|
|
|
2167
2328
|
|
|
2168
2329
|
// src/components/Navigation/Stages/Stages.tsx
|
|
2169
2330
|
import React14 from "react";
|
|
2170
|
-
import { jsx as jsx44, jsxs as
|
|
2331
|
+
import { jsx as jsx44, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2171
2332
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
|
|
2172
|
-
return /* @__PURE__ */ jsx44("div", { className, style, children: /* @__PURE__ */
|
|
2333
|
+
return /* @__PURE__ */ jsx44("div", { className, style, children: /* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between bg-gray-50 p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
2173
2334
|
/* @__PURE__ */ jsx44("div", { className: "flex items-center", children: /* @__PURE__ */ jsx44("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx44("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx44("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
2174
|
-
/* @__PURE__ */ jsx44("div", { className: "flex items-center flex-1 px-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */
|
|
2335
|
+
/* @__PURE__ */ jsx44("div", { className: "flex items-center flex-1 px-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs27(React14.Fragment, { children: [
|
|
2175
2336
|
/* @__PURE__ */ jsx44(
|
|
2176
2337
|
"button",
|
|
2177
2338
|
{
|
|
@@ -2195,9 +2356,9 @@ var Spacer = ({ className, style }) => {
|
|
|
2195
2356
|
var Spacer_default = Spacer;
|
|
2196
2357
|
|
|
2197
2358
|
// src/components/Navigation/Profile/Profile.tsx
|
|
2198
|
-
import { jsx as jsx46, jsxs as
|
|
2359
|
+
import { jsx as jsx46, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2199
2360
|
var Profile = ({ profileType, showName, userName, className, style }) => {
|
|
2200
|
-
return /* @__PURE__ */ jsx46("div", { className, style, children: /* @__PURE__ */
|
|
2361
|
+
return /* @__PURE__ */ jsx46("div", { className, style, children: /* @__PURE__ */ jsxs28("div", { className: "flex gap-2 items-center justify-between w-30 cursor-pointer", children: [
|
|
2201
2362
|
showName && /* @__PURE__ */ jsx46("h4", { className: "text-[#000000] dark:text-[#fff] text-[13px] font-[500] mb-0", children: userName }),
|
|
2202
2363
|
profileType === "avatar" ? /* @__PURE__ */ jsx46(
|
|
2203
2364
|
"img",
|
|
@@ -2213,9 +2374,9 @@ var Profile = ({ profileType, showName, userName, className, style }) => {
|
|
|
2213
2374
|
var Profile_default = Profile;
|
|
2214
2375
|
|
|
2215
2376
|
// src/components/Navigation/Notification/Notification.tsx
|
|
2216
|
-
import { jsx as jsx47, jsxs as
|
|
2377
|
+
import { jsx as jsx47, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2217
2378
|
var Notification = ({ className, style, badgeType, badgeCount = 0, hideBadgeWhenZero }) => {
|
|
2218
|
-
return /* @__PURE__ */ jsx47("div", { className, style, children: /* @__PURE__ */
|
|
2379
|
+
return /* @__PURE__ */ jsx47("div", { className, style, children: /* @__PURE__ */ jsxs29("div", { className: "w-[34px] h-[34px] bg-[#E9E9E9] rounded-md text-center flex items-center justify-center relative", children: [
|
|
2219
2380
|
/* @__PURE__ */ jsx47(
|
|
2220
2381
|
"img",
|
|
2221
2382
|
{
|
|
@@ -2297,7 +2458,7 @@ var AvatarFallback = React15.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
2297
2458
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
2298
2459
|
|
|
2299
2460
|
// src/components/Navigation/Navbar/Navbar.tsx
|
|
2300
|
-
import { Fragment as Fragment13, jsx as jsx50, jsxs as
|
|
2461
|
+
import { Fragment as Fragment13, jsx as jsx50, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2301
2462
|
function Navbar({
|
|
2302
2463
|
style,
|
|
2303
2464
|
badgeType,
|
|
@@ -2312,10 +2473,10 @@ function Navbar({
|
|
|
2312
2473
|
ImageComponent
|
|
2313
2474
|
}) {
|
|
2314
2475
|
const isMobileView = canvasMode === "mobile" || canvasMode === "tablet";
|
|
2315
|
-
return /* @__PURE__ */ jsx50("nav", { className: "w-full border-b bg-white shadow-sm", style, children: /* @__PURE__ */
|
|
2476
|
+
return /* @__PURE__ */ jsx50("nav", { className: "w-full border-b bg-white shadow-sm", style, children: /* @__PURE__ */ jsxs30("div", { className: "mx-auto flex max-w-7xl items-center justify-between px-4 py-2", children: [
|
|
2316
2477
|
LinkComponent && ImageComponent ? /* @__PURE__ */ jsx50(LinkComponent, { href: "/", className: "flex items-center space-x-2", children: imageUrl ? /* @__PURE__ */ jsx50(ImageComponent, { src: imageUrl, alt: altText, width: 200, height: 200 }) : /* @__PURE__ */ jsx50("span", { className: "font-semibold text-blue-700", children: "Logo" }) }) : /* @__PURE__ */ jsx50("span", { className: "font-semibold text-blue-700", children: "Logo" }),
|
|
2317
|
-
/* @__PURE__ */
|
|
2318
|
-
!isMobileView ? /* @__PURE__ */ jsx50("div", { className: "flex-1 px-6", children: /* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ jsxs30("div", { className: "flex items-center space-x-3", children: [
|
|
2479
|
+
!isMobileView ? /* @__PURE__ */ jsx50("div", { className: "flex-1 px-6", children: /* @__PURE__ */ jsxs30("div", { className: "relative w-full max-w-md border border-gray-300 rounded-md", children: [
|
|
2319
2480
|
/* @__PURE__ */ jsx50(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }),
|
|
2320
2481
|
/* @__PURE__ */ jsx50(Input, { placeholder: "Search", className: "pl-9 text-gray-400" })
|
|
2321
2482
|
] }) }) : /* @__PURE__ */ jsx50(
|
|
@@ -2327,14 +2488,14 @@ function Navbar({
|
|
|
2327
2488
|
children: /* @__PURE__ */ jsx50(Search, { className: "h-5 w-5 text-gray-400" })
|
|
2328
2489
|
}
|
|
2329
2490
|
),
|
|
2330
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsxs30("div", { className: "relative bg-[#E9E9E9] rounded-md", children: [
|
|
2331
2492
|
/* @__PURE__ */ jsx50(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx50(Bell, { className: "h-5 w-5 text-[#1C1B1F]" }) }),
|
|
2332
2493
|
badgeType === "number" && !(hideBadgeWhenZero && badgeCount === 0) && badgeCount > 0 ? /* @__PURE__ */ jsx50("span", { className: "absolute -top-1 -right-1 flex h-4 w-4 items-center justify-center rounded-full bg-red-500 text-[10px] text-white leading-8", children: badgeCount }) : /* @__PURE__ */ jsx50("span", { className: "absolute -top-1 -right-1 flex h-2 w-2 items-center justify-center rounded-full bg-red-500" })
|
|
2333
2494
|
] }),
|
|
2334
|
-
/* @__PURE__ */
|
|
2335
|
-
/* @__PURE__ */ jsx50(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */
|
|
2495
|
+
/* @__PURE__ */ jsxs30(DropdownMenu, { children: [
|
|
2496
|
+
/* @__PURE__ */ jsx50(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs30("div", { className: "flex items-center space-x-2", children: [
|
|
2336
2497
|
!isMobileView && showName && /* @__PURE__ */ jsx50("h4", { className: "text-[#000000] text-[13px] font-[500] mb-0", children: "Akbar Sheriff" }),
|
|
2337
|
-
!isMobileView ? /* @__PURE__ */
|
|
2498
|
+
!isMobileView ? /* @__PURE__ */ jsxs30(Fragment13, { children: [
|
|
2338
2499
|
/* @__PURE__ */ jsx50(Avatar, { className: "cursor-pointer h-8 w-8 text-gray-900", children: profileType === "avatar" ? /* @__PURE__ */ jsx50(
|
|
2339
2500
|
AvatarImage,
|
|
2340
2501
|
{
|
|
@@ -2361,7 +2522,7 @@ function Navbar({
|
|
|
2361
2522
|
}
|
|
2362
2523
|
)
|
|
2363
2524
|
] }) }),
|
|
2364
|
-
/* @__PURE__ */
|
|
2525
|
+
/* @__PURE__ */ jsxs30(DropdownMenuContent, { align: "end", className: "bg-white", children: [
|
|
2365
2526
|
/* @__PURE__ */ jsx50(DropdownMenuLabel, { className: "text-black", children: "My Account" }),
|
|
2366
2527
|
/* @__PURE__ */ jsx50(DropdownMenuSeparator, {}),
|
|
2367
2528
|
/* @__PURE__ */ jsx50(DropdownMenuItem, { className: "text-black", children: "Profile" }),
|
|
@@ -2375,20 +2536,20 @@ function Navbar({
|
|
|
2375
2536
|
|
|
2376
2537
|
// src/components/Chart/BarChart.tsx
|
|
2377
2538
|
import { BarChart, Bar, Area, AreaChart, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from "recharts";
|
|
2378
|
-
import { jsx as jsx51, jsxs as
|
|
2539
|
+
import { jsx as jsx51, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2379
2540
|
var ChartComponent = ({ className, style, ...props }) => {
|
|
2380
2541
|
const data = Array.isArray(props?.data) ? props.data : [];
|
|
2381
2542
|
const chartType = props.chartType || "bar";
|
|
2382
2543
|
const legendsPosition = props.legendsPosition === "middle" || props.legendsPosition === "bottom" ? props.legendsPosition : "top";
|
|
2383
|
-
return /* @__PURE__ */ jsx51("div", { className: `${className} h-[400px]`, style, children: data.length > 0 && /* @__PURE__ */ jsx51(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */
|
|
2544
|
+
return /* @__PURE__ */ jsx51("div", { className: `${className} h-[400px]`, style, children: data.length > 0 && /* @__PURE__ */ jsx51(ResponsiveContainer, { width: "100%", height: "100%", children: chartType === "bar" ? /* @__PURE__ */ jsxs31(BarChart, { data, children: [
|
|
2384
2545
|
/* @__PURE__ */ jsx51(CartesianGrid, { strokeDasharray: "3 3" }),
|
|
2385
2546
|
/* @__PURE__ */ jsx51(XAxis, { dataKey: "name" }),
|
|
2386
2547
|
/* @__PURE__ */ jsx51(YAxis, {}),
|
|
2387
2548
|
/* @__PURE__ */ jsx51(Tooltip, {}),
|
|
2388
2549
|
/* @__PURE__ */ jsx51(Legend, { verticalAlign: legendsPosition, align: "center" }),
|
|
2389
2550
|
/* @__PURE__ */ jsx51(Bar, { dataKey: "value", fill: "#00695C" })
|
|
2390
|
-
] }) : /* @__PURE__ */
|
|
2391
|
-
/* @__PURE__ */ jsx51("defs", { children: /* @__PURE__ */
|
|
2551
|
+
] }) : /* @__PURE__ */ jsxs31(AreaChart, { data, children: [
|
|
2552
|
+
/* @__PURE__ */ jsx51("defs", { children: /* @__PURE__ */ jsxs31("linearGradient", { id: "colorCount", x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2392
2553
|
/* @__PURE__ */ jsx51("stop", { offset: "5%", stopColor: "#00695C", stopOpacity: 0.8 }),
|
|
2393
2554
|
/* @__PURE__ */ jsx51("stop", { offset: "95%", stopColor: "#00695C", stopOpacity: 0 })
|
|
2394
2555
|
] }) }),
|
|
@@ -2412,7 +2573,7 @@ var BarChart_default = ChartComponent;
|
|
|
2412
2573
|
|
|
2413
2574
|
// src/components/Chart/PieChart.tsx
|
|
2414
2575
|
import { PieChart, Pie, Cell, ResponsiveContainer as ResponsiveContainer2, Tooltip as Tooltip2, LabelList } from "recharts";
|
|
2415
|
-
import { Fragment as Fragment14, jsx as jsx52, jsxs as
|
|
2576
|
+
import { Fragment as Fragment14, jsx as jsx52, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2416
2577
|
var DonutChart = ({ className, style, ...props }) => {
|
|
2417
2578
|
const data = Array.isArray(props?.data) ? props.data : [];
|
|
2418
2579
|
const total = data.reduce((sum, d) => sum + d.value, 0);
|
|
@@ -2423,7 +2584,7 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
2423
2584
|
const renderLabel = ({ value, x, y }) => {
|
|
2424
2585
|
if (value == null) return null;
|
|
2425
2586
|
const percentage = (Number(value) / total * 100).toFixed(0);
|
|
2426
|
-
return /* @__PURE__ */
|
|
2587
|
+
return /* @__PURE__ */ jsxs32(
|
|
2427
2588
|
"text",
|
|
2428
2589
|
{
|
|
2429
2590
|
x,
|
|
@@ -2445,7 +2606,7 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
2445
2606
|
const wrapperClass = canvasMode ? forceDesktop ? "flex-row" : "flex-col" : "flex-col md:flex-row";
|
|
2446
2607
|
const renderLegends = () => {
|
|
2447
2608
|
if (!showLegends) return null;
|
|
2448
|
-
return /* @__PURE__ */ jsx52(Fragment14, { children: data.map((d) => /* @__PURE__ */
|
|
2609
|
+
return /* @__PURE__ */ jsx52(Fragment14, { children: data.map((d) => /* @__PURE__ */ jsxs32(
|
|
2449
2610
|
"div",
|
|
2450
2611
|
{
|
|
2451
2612
|
className: "flex items-center space-x-2 rounded-md border border-gray-200 px-3 py-2 w-[48%] md:w-auto",
|
|
@@ -2463,15 +2624,15 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
2463
2624
|
d.name
|
|
2464
2625
|
)) });
|
|
2465
2626
|
};
|
|
2466
|
-
return /* @__PURE__ */
|
|
2627
|
+
return /* @__PURE__ */ jsxs32(
|
|
2467
2628
|
"div",
|
|
2468
2629
|
{
|
|
2469
2630
|
className: `relative flex items-center ${wrapperClass} ${className}`,
|
|
2470
2631
|
style,
|
|
2471
2632
|
children: [
|
|
2472
|
-
/* @__PURE__ */
|
|
2473
|
-
data.length > 0 && /* @__PURE__ */ jsx52(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */
|
|
2474
|
-
/* @__PURE__ */
|
|
2633
|
+
/* @__PURE__ */ jsxs32("div", { className: "relative w-full md:w-[70%] h-[300px] md:h-[400px] flex items-center justify-center", children: [
|
|
2634
|
+
data.length > 0 && /* @__PURE__ */ jsx52(ResponsiveContainer2, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs32(PieChart, { children: [
|
|
2635
|
+
/* @__PURE__ */ jsxs32(
|
|
2475
2636
|
Pie,
|
|
2476
2637
|
{
|
|
2477
2638
|
data,
|
|
@@ -2497,7 +2658,7 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
2497
2658
|
),
|
|
2498
2659
|
/* @__PURE__ */ jsx52(Tooltip2, { formatter: (value, name) => [`${value}k`, name] })
|
|
2499
2660
|
] }) }),
|
|
2500
|
-
/* @__PURE__ */
|
|
2661
|
+
/* @__PURE__ */ jsxs32("div", { className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-2xl md:text-4xl font-bold text-[#000]", children: [
|
|
2501
2662
|
total,
|
|
2502
2663
|
"k"
|
|
2503
2664
|
] })
|
|
@@ -2511,9 +2672,9 @@ var DonutChart = ({ className, style, ...props }) => {
|
|
|
2511
2672
|
var PieChart_default = DonutChart;
|
|
2512
2673
|
|
|
2513
2674
|
// src/components/Blocks/EmailComposer.tsx
|
|
2514
|
-
import { jsx as jsx53, jsxs as
|
|
2675
|
+
import { jsx as jsx53, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2515
2676
|
function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc, setShowBcc, cc, setCc, bcc, setBcc, subject, setSubject, body, setBody }) {
|
|
2516
|
-
return /* @__PURE__ */ jsx53("div", { className, style, children: /* @__PURE__ */
|
|
2677
|
+
return /* @__PURE__ */ jsx53("div", { className, style, children: /* @__PURE__ */ jsxs33("div", { className: "border rounded-md shadow bg-[#fff] p-4 mx-auto z-[50] relative", children: [
|
|
2517
2678
|
/* @__PURE__ */ jsx53("div", { className: "mb-3", children: /* @__PURE__ */ jsx53(
|
|
2518
2679
|
"input",
|
|
2519
2680
|
{
|
|
@@ -2523,7 +2684,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
2523
2684
|
required: true
|
|
2524
2685
|
}
|
|
2525
2686
|
) }),
|
|
2526
|
-
/* @__PURE__ */ jsx53("div", { className: "mb-3", children: /* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ jsx53("div", { className: "mb-3", children: /* @__PURE__ */ jsxs33("div", { className: "flex items-center gap-2", children: [
|
|
2527
2688
|
/* @__PURE__ */ jsx53(
|
|
2528
2689
|
"input",
|
|
2529
2690
|
{
|
|
@@ -2583,7 +2744,7 @@ function EmailComposer({ className, style, to, setTo, showCc, setShowCc, showBcc
|
|
|
2583
2744
|
}
|
|
2584
2745
|
) }),
|
|
2585
2746
|
/* @__PURE__ */ jsx53("div", { className: "mb-4", children: /* @__PURE__ */ jsx53(MyEditor, { value: body, onChange: setBody }) }),
|
|
2586
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ jsxs33("div", { className: "flex justify-end gap-2", children: [
|
|
2587
2748
|
/* @__PURE__ */ jsx53("button", { className: "px-4 py-2 rounded-md text-gray-600 hover:bg-gray-100", children: "Discard" }),
|
|
2588
2749
|
/* @__PURE__ */ jsx53("button", { className: "px-4 py-2 rounded-md border text-[#12715B] border-[#12715B]", children: "Reset" }),
|
|
2589
2750
|
/* @__PURE__ */ jsx53("button", { className: "px-4 py-2 rounded-md bg-[#12715B] text-white", children: "Send" })
|
|
@@ -2598,8 +2759,8 @@ export {
|
|
|
2598
2759
|
DatePicker,
|
|
2599
2760
|
DateRange_default as DateRange,
|
|
2600
2761
|
Dropdown_default as Dropdown,
|
|
2762
|
+
EmailInput_default as Email,
|
|
2601
2763
|
EmailComposer,
|
|
2602
|
-
EmailInput_default as EmailInput,
|
|
2603
2764
|
FileInput_default as FileInput,
|
|
2604
2765
|
Flex_default as FlexLayout,
|
|
2605
2766
|
Grid_default as GridLayout,
|
|
@@ -2611,23 +2772,23 @@ export {
|
|
|
2611
2772
|
Notification_default as Notification,
|
|
2612
2773
|
NumberInput_default as NumberInput,
|
|
2613
2774
|
Pagination_default as Pagination,
|
|
2614
|
-
PasswordInput_default as
|
|
2615
|
-
PhoneInput_default as
|
|
2775
|
+
PasswordInput_default as Password,
|
|
2776
|
+
PhoneInput_default as Phone,
|
|
2616
2777
|
PieChart_default as PieChart,
|
|
2617
2778
|
Profile_default as Profile,
|
|
2618
|
-
RadioInput_default as
|
|
2779
|
+
RadioInput_default as RadioGroup,
|
|
2619
2780
|
RichText,
|
|
2620
|
-
SearchInput_default as
|
|
2781
|
+
SearchInput_default as Search,
|
|
2621
2782
|
Shape_default as Shape,
|
|
2622
2783
|
Spacer_default as Spacer,
|
|
2623
2784
|
Stages_default as Stages,
|
|
2624
2785
|
SwitchToggle_default as SwitchToggle,
|
|
2625
2786
|
Table_default as Table,
|
|
2626
2787
|
Tabs_default as Tabs,
|
|
2627
|
-
TextInput_default as
|
|
2788
|
+
TextInput_default as Text,
|
|
2628
2789
|
Textarea_default as Textarea,
|
|
2629
2790
|
Typography_default as Typography,
|
|
2630
|
-
UrlInput_default as
|
|
2791
|
+
UrlInput_default as URL,
|
|
2631
2792
|
cn
|
|
2632
2793
|
};
|
|
2633
2794
|
/*! Bundled license information:
|