@algorithm-shift/design-system 1.2.42 → 1.2.44
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/chunk-JFDQZCMW.mjs +3130 -0
- package/dist/chunk-JFDQZCMW.mjs.map +1 -0
- package/dist/client.d.mts +26 -0
- package/dist/client.d.ts +26 -0
- package/dist/client.js +578 -0
- package/dist/client.js.map +1 -0
- package/dist/client.mjs +10 -0
- package/dist/client.mjs.map +1 -0
- package/dist/index.d.mts +4 -24
- package/dist/index.d.ts +4 -24
- package/dist/index.js +79 -195
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -3200
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -1
package/dist/index.js
CHANGED
|
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
33
|
BarChart: () => BarChart_default,
|
|
34
34
|
Breadcrumb: () => Breadcrumb_default,
|
|
35
35
|
Button: () => Button_default,
|
|
@@ -76,7 +76,7 @@ __export(index_exports, {
|
|
|
76
76
|
stateReducer: () => stateReducer,
|
|
77
77
|
useAppState: () => useAppState
|
|
78
78
|
});
|
|
79
|
-
module.exports = __toCommonJS(
|
|
79
|
+
module.exports = __toCommonJS(src_exports);
|
|
80
80
|
|
|
81
81
|
// src/components/Layout/Modal.tsx
|
|
82
82
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -678,9 +678,6 @@ function SplitButton({ style, textContent, className, list = [], LinkComponent }
|
|
|
678
678
|
] });
|
|
679
679
|
}
|
|
680
680
|
|
|
681
|
-
// src/components/Inputs/TextInput/TextInput.tsx
|
|
682
|
-
var React2 = __toESM(require("react"));
|
|
683
|
-
|
|
684
681
|
// src/components/ui/input.tsx
|
|
685
682
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
686
683
|
function Input({ className, type, ...props }) {
|
|
@@ -708,11 +705,6 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
708
705
|
const isDisabled = props.isDisabled ?? false;
|
|
709
706
|
const isReadonly = props.isReadonly ?? false;
|
|
710
707
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
711
|
-
const [error, setError] = React2.useState(null);
|
|
712
|
-
React2.useEffect(() => {
|
|
713
|
-
if (!props.validateOnMount) return;
|
|
714
|
-
setError(props.errorMessage || null);
|
|
715
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
716
708
|
const handleChange = (e) => {
|
|
717
709
|
props.onChange?.(e);
|
|
718
710
|
};
|
|
@@ -722,10 +714,10 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
722
714
|
{
|
|
723
715
|
type: "text",
|
|
724
716
|
name: props.name,
|
|
725
|
-
className: cn(className,
|
|
717
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
726
718
|
style: {
|
|
727
719
|
...style,
|
|
728
|
-
borderColor:
|
|
720
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
729
721
|
},
|
|
730
722
|
value: props.value,
|
|
731
723
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
@@ -735,14 +727,12 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
735
727
|
readOnly: isReadonly
|
|
736
728
|
}
|
|
737
729
|
),
|
|
738
|
-
|
|
730
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
739
731
|
] });
|
|
740
732
|
};
|
|
741
733
|
var TextInput_default = TextInput;
|
|
742
734
|
|
|
743
735
|
// src/components/Inputs/NumberInput/NumberInput.tsx
|
|
744
|
-
var React3 = __toESM(require("react"));
|
|
745
|
-
var import_react4 = require("react");
|
|
746
736
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
747
737
|
var NumberInput = ({ className, style, ...props }) => {
|
|
748
738
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -750,11 +740,6 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
750
740
|
const isDisabled = props.isDisabled ?? false;
|
|
751
741
|
const isReadonly = props.isReadonly ?? false;
|
|
752
742
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
753
|
-
const [error, setError] = React3.useState(null);
|
|
754
|
-
(0, import_react4.useEffect)(() => {
|
|
755
|
-
if (!props.validateOnMount) return;
|
|
756
|
-
setError(props.errorMessage || null);
|
|
757
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
758
743
|
const handleChange = (e) => {
|
|
759
744
|
props.onChange?.(e);
|
|
760
745
|
};
|
|
@@ -768,10 +753,10 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
768
753
|
id: props.name || "number-field",
|
|
769
754
|
name: props.name,
|
|
770
755
|
value: props.value,
|
|
771
|
-
className: cn(className,
|
|
756
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
772
757
|
style: {
|
|
773
758
|
...style,
|
|
774
|
-
borderColor:
|
|
759
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
775
760
|
},
|
|
776
761
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
777
762
|
placeholder,
|
|
@@ -781,13 +766,12 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
781
766
|
}
|
|
782
767
|
)
|
|
783
768
|
] }),
|
|
784
|
-
|
|
769
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
785
770
|
] });
|
|
786
771
|
};
|
|
787
772
|
var NumberInput_default = NumberInput;
|
|
788
773
|
|
|
789
774
|
// src/components/Inputs/EmailInput/EmailInput.tsx
|
|
790
|
-
var React4 = __toESM(require("react"));
|
|
791
775
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
792
776
|
var EmailInput = ({ className, style, ...props }) => {
|
|
793
777
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -795,11 +779,6 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
795
779
|
const isDisabled = props.isDisabled ?? false;
|
|
796
780
|
const isReadonly = props.isReadonly ?? false;
|
|
797
781
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
798
|
-
const [error, setError] = React4.useState(null);
|
|
799
|
-
React4.useEffect(() => {
|
|
800
|
-
if (!props.validateOnMount) return;
|
|
801
|
-
setError(props.errorMessage || null);
|
|
802
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
803
782
|
const handleChange = (e) => {
|
|
804
783
|
props.onChange?.(e);
|
|
805
784
|
};
|
|
@@ -812,10 +791,10 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
812
791
|
type: "email",
|
|
813
792
|
name: props.name,
|
|
814
793
|
value: props.value,
|
|
815
|
-
className: cn(className,
|
|
794
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
816
795
|
style: {
|
|
817
796
|
...style,
|
|
818
|
-
borderColor:
|
|
797
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
819
798
|
},
|
|
820
799
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
821
800
|
placeholder,
|
|
@@ -825,13 +804,12 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
825
804
|
}
|
|
826
805
|
)
|
|
827
806
|
] }),
|
|
828
|
-
|
|
807
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
829
808
|
] });
|
|
830
809
|
};
|
|
831
810
|
var EmailInput_default = EmailInput;
|
|
832
811
|
|
|
833
812
|
// src/components/Inputs/PasswordInput/PasswordInput.tsx
|
|
834
|
-
var React5 = __toESM(require("react"));
|
|
835
813
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
836
814
|
var PasswordInput = ({ className, style, ...props }) => {
|
|
837
815
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -839,11 +817,6 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
839
817
|
const isDisabled = props.isDisabled ?? false;
|
|
840
818
|
const isReadonly = props.isReadonly ?? false;
|
|
841
819
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
842
|
-
const [error, setError] = React5.useState(null);
|
|
843
|
-
React5.useEffect(() => {
|
|
844
|
-
if (!props.validateOnMount) return;
|
|
845
|
-
setError(props.errorMessage || null);
|
|
846
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
847
820
|
const handleChange = (e) => {
|
|
848
821
|
props.onChange?.(e);
|
|
849
822
|
};
|
|
@@ -857,10 +830,10 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
857
830
|
id: props.name || "password-field",
|
|
858
831
|
name: props.name,
|
|
859
832
|
value: props.value,
|
|
860
|
-
className: cn(className,
|
|
833
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
861
834
|
style: {
|
|
862
835
|
...style,
|
|
863
|
-
borderColor:
|
|
836
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
864
837
|
},
|
|
865
838
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
866
839
|
placeholder,
|
|
@@ -870,14 +843,11 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
870
843
|
}
|
|
871
844
|
)
|
|
872
845
|
] }),
|
|
873
|
-
|
|
846
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
874
847
|
] });
|
|
875
848
|
};
|
|
876
849
|
var PasswordInput_default = PasswordInput;
|
|
877
850
|
|
|
878
|
-
// src/components/Inputs/Textarea/Textarea.tsx
|
|
879
|
-
var React6 = __toESM(require("react"));
|
|
880
|
-
|
|
881
851
|
// src/components/ui/textarea.tsx
|
|
882
852
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
883
853
|
function Textarea({ className, ...props }) {
|
|
@@ -902,11 +872,6 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
902
872
|
const isDisabled = props.isDisabled ?? false;
|
|
903
873
|
const isReadonly = props.isReadonly ?? false;
|
|
904
874
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
905
|
-
const [error, setError] = React6.useState(null);
|
|
906
|
-
React6.useEffect(() => {
|
|
907
|
-
if (!props.validateOnMount) return;
|
|
908
|
-
setError(props.errorMessage || null);
|
|
909
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
910
875
|
const handleChange = (e) => {
|
|
911
876
|
props.onChange?.(e);
|
|
912
877
|
};
|
|
@@ -917,10 +882,10 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
917
882
|
id: "textarea-field",
|
|
918
883
|
name: props.name,
|
|
919
884
|
value: props.value,
|
|
920
|
-
className: cn(className,
|
|
885
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
921
886
|
style: {
|
|
922
887
|
...style,
|
|
923
|
-
borderColor:
|
|
888
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
924
889
|
},
|
|
925
890
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
926
891
|
placeholder,
|
|
@@ -929,13 +894,12 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
929
894
|
readOnly: isReadonly
|
|
930
895
|
}
|
|
931
896
|
),
|
|
932
|
-
|
|
897
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
933
898
|
] });
|
|
934
899
|
};
|
|
935
900
|
var Textarea_default = Textarea2;
|
|
936
901
|
|
|
937
902
|
// src/components/Inputs/UrlInput/UrlInput.tsx
|
|
938
|
-
var React7 = __toESM(require("react"));
|
|
939
903
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
940
904
|
var UrlInput = ({ className, style, ...props }) => {
|
|
941
905
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -943,11 +907,6 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
943
907
|
const isDisabled = props.isDisabled ?? false;
|
|
944
908
|
const isReadonly = props.isReadonly ?? false;
|
|
945
909
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
946
|
-
const [error, setError] = React7.useState(null);
|
|
947
|
-
React7.useEffect(() => {
|
|
948
|
-
if (!props.validateOnMount) return;
|
|
949
|
-
setError(props.errorMessage || null);
|
|
950
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
951
910
|
const handleChange = (e) => {
|
|
952
911
|
props.onChange?.(e);
|
|
953
912
|
};
|
|
@@ -961,10 +920,10 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
961
920
|
type: "url",
|
|
962
921
|
name: props.name,
|
|
963
922
|
value: props.value,
|
|
964
|
-
className: cn(className,
|
|
923
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
965
924
|
style: {
|
|
966
925
|
...style,
|
|
967
|
-
borderColor:
|
|
926
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
968
927
|
},
|
|
969
928
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
970
929
|
placeholder,
|
|
@@ -974,14 +933,11 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
974
933
|
}
|
|
975
934
|
)
|
|
976
935
|
] }),
|
|
977
|
-
|
|
936
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
978
937
|
] });
|
|
979
938
|
};
|
|
980
939
|
var UrlInput_default = UrlInput;
|
|
981
940
|
|
|
982
|
-
// src/components/Inputs/Checkbox/Checkbox.tsx
|
|
983
|
-
var import_react5 = require("react");
|
|
984
|
-
|
|
985
941
|
// src/components/ui/checkbox.tsx
|
|
986
942
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
987
943
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
@@ -1036,11 +992,6 @@ var CheckboxInput = ({ className, style, ...props }) => {
|
|
|
1036
992
|
const isEditable = props.isEditable ?? true;
|
|
1037
993
|
const isDisabled = props.isDisabled ?? false;
|
|
1038
994
|
const text = props.text ? props.text : "Subscribe";
|
|
1039
|
-
const [error, setError] = (0, import_react5.useState)(null);
|
|
1040
|
-
(0, import_react5.useEffect)(() => {
|
|
1041
|
-
if (!props.validateOnMount) return;
|
|
1042
|
-
setError(props.errorMessage || null);
|
|
1043
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1044
995
|
const handleChange = (value) => {
|
|
1045
996
|
props.onChange?.(value);
|
|
1046
997
|
};
|
|
@@ -1057,14 +1008,11 @@ var CheckboxInput = ({ className, style, ...props }) => {
|
|
|
1057
1008
|
),
|
|
1058
1009
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Label2, { htmlFor: props.name || "checkbox", children: text })
|
|
1059
1010
|
] }) }),
|
|
1060
|
-
|
|
1011
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1061
1012
|
] });
|
|
1062
1013
|
};
|
|
1063
1014
|
var Checkbox_default = CheckboxInput;
|
|
1064
1015
|
|
|
1065
|
-
// src/components/Inputs/RadioInput/RadioInput.tsx
|
|
1066
|
-
var import_react6 = require("react");
|
|
1067
|
-
|
|
1068
1016
|
// src/components/ui/radio-group.tsx
|
|
1069
1017
|
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"));
|
|
1070
1018
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
@@ -1118,11 +1066,6 @@ var RadioInput = ({
|
|
|
1118
1066
|
dataLabel,
|
|
1119
1067
|
...props
|
|
1120
1068
|
}) => {
|
|
1121
|
-
const [error, setError] = (0, import_react6.useState)(null);
|
|
1122
|
-
(0, import_react6.useEffect)(() => {
|
|
1123
|
-
if (!props.validateOnMount) return;
|
|
1124
|
-
setError(props.errorMessage || null);
|
|
1125
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1126
1069
|
const options = (data || []).map((item) => ({
|
|
1127
1070
|
value: item[dataKey || "value"],
|
|
1128
1071
|
label: item[dataLabel || "label"]
|
|
@@ -1146,13 +1089,13 @@ var RadioInput = ({
|
|
|
1146
1089
|
]
|
|
1147
1090
|
}
|
|
1148
1091
|
) }),
|
|
1149
|
-
|
|
1092
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1150
1093
|
] });
|
|
1151
1094
|
};
|
|
1152
1095
|
var RadioInput_default = RadioInput;
|
|
1153
1096
|
|
|
1154
1097
|
// src/components/Inputs/MultiCheckbox/MultiCheckbox.tsx
|
|
1155
|
-
var
|
|
1098
|
+
var import_react4 = require("react");
|
|
1156
1099
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1157
1100
|
var MultiCheckbox = ({
|
|
1158
1101
|
className,
|
|
@@ -1165,12 +1108,12 @@ var MultiCheckbox = ({
|
|
|
1165
1108
|
isEditable = true,
|
|
1166
1109
|
isDisabled = false
|
|
1167
1110
|
}) => {
|
|
1168
|
-
const [value, setValue] = (0,
|
|
1111
|
+
const [value, setValue] = (0, import_react4.useState)(propValue);
|
|
1169
1112
|
const options = (data || []).map((item) => ({
|
|
1170
1113
|
value: item[dataKey || "value"],
|
|
1171
1114
|
label: item[dataLabel || "label"]
|
|
1172
1115
|
}));
|
|
1173
|
-
const handleChange = (0,
|
|
1116
|
+
const handleChange = (0, import_react4.useCallback)(
|
|
1174
1117
|
(key, checked) => {
|
|
1175
1118
|
setValue((prev) => {
|
|
1176
1119
|
const newValue = { ...prev, [key]: checked };
|
|
@@ -1205,11 +1148,8 @@ var MultiCheckbox = ({
|
|
|
1205
1148
|
};
|
|
1206
1149
|
var MultiCheckbox_default = MultiCheckbox;
|
|
1207
1150
|
|
|
1208
|
-
// src/components/Inputs/RichText/RichText.tsx
|
|
1209
|
-
var import_react9 = require("react");
|
|
1210
|
-
|
|
1211
1151
|
// src/components/Global/TinyMceEditor.tsx
|
|
1212
|
-
var
|
|
1152
|
+
var import_react5 = require("react");
|
|
1213
1153
|
var import_tinymce_react = require("@tinymce/tinymce-react");
|
|
1214
1154
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1215
1155
|
function MyEditor({
|
|
@@ -1217,7 +1157,7 @@ function MyEditor({
|
|
|
1217
1157
|
onChange,
|
|
1218
1158
|
isDefault
|
|
1219
1159
|
}) {
|
|
1220
|
-
const editorRef = (0,
|
|
1160
|
+
const editorRef = (0, import_react5.useRef)(null);
|
|
1221
1161
|
function stripOuterP(html) {
|
|
1222
1162
|
const trimmedHtml = html.trim();
|
|
1223
1163
|
if (!trimmedHtml) return "";
|
|
@@ -1229,7 +1169,7 @@ function MyEditor({
|
|
|
1229
1169
|
}
|
|
1230
1170
|
return trimmedHtml;
|
|
1231
1171
|
}
|
|
1232
|
-
const isDefaultToolbar = (0,
|
|
1172
|
+
const isDefaultToolbar = (0, import_react5.useMemo)(() => {
|
|
1233
1173
|
let toolbar = "undo redo | formatselect | bold italic forecolor";
|
|
1234
1174
|
if (isDefault) {
|
|
1235
1175
|
toolbar = "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help";
|
|
@@ -1282,30 +1222,22 @@ function MyEditor({
|
|
|
1282
1222
|
// src/components/Inputs/RichText/RichText.tsx
|
|
1283
1223
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1284
1224
|
function RichText({ className, style, ...props }) {
|
|
1285
|
-
const [error, setError] = (0, import_react9.useState)(null);
|
|
1286
|
-
(0, import_react9.useEffect)(() => {
|
|
1287
|
-
if (!props.validateOnMount) return;
|
|
1288
|
-
setError(props.errorMessage || null);
|
|
1289
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1290
1225
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1291
1226
|
"div",
|
|
1292
1227
|
{
|
|
1293
|
-
className: cn(className,
|
|
1228
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1294
1229
|
style: {
|
|
1295
1230
|
...style,
|
|
1296
|
-
borderColor:
|
|
1231
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1297
1232
|
},
|
|
1298
1233
|
children: [
|
|
1299
1234
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MyEditor, { onChange: (content) => props.onChange?.(content), value: props.value, isDefault: true }),
|
|
1300
|
-
|
|
1235
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1301
1236
|
]
|
|
1302
1237
|
}
|
|
1303
1238
|
);
|
|
1304
1239
|
}
|
|
1305
1240
|
|
|
1306
|
-
// src/components/Inputs/Dropdown/Dropdown.tsx
|
|
1307
|
-
var React8 = __toESM(require("react"));
|
|
1308
|
-
|
|
1309
1241
|
// src/components/ui/select.tsx
|
|
1310
1242
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
1311
1243
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
@@ -1440,11 +1372,6 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
1440
1372
|
const isEditable = props.isEditable ?? true;
|
|
1441
1373
|
const isDisabled = props.isDisabled ?? false;
|
|
1442
1374
|
const isReadonly = props.isReadonly ?? false;
|
|
1443
|
-
const [error, setError] = React8.useState(null);
|
|
1444
|
-
React8.useEffect(() => {
|
|
1445
|
-
if (!props.validateOnMount) return;
|
|
1446
|
-
setError(props.errorMessage || null);
|
|
1447
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1448
1375
|
const handleChange = (value) => {
|
|
1449
1376
|
props.onChange?.(value);
|
|
1450
1377
|
};
|
|
@@ -1460,10 +1387,10 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
1460
1387
|
SelectTrigger,
|
|
1461
1388
|
{
|
|
1462
1389
|
id: props.name || "select-field",
|
|
1463
|
-
className: cn(className,
|
|
1390
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1464
1391
|
style: {
|
|
1465
1392
|
...style,
|
|
1466
|
-
borderColor:
|
|
1393
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1467
1394
|
},
|
|
1468
1395
|
"aria-readonly": isReadonly,
|
|
1469
1396
|
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectValue, { placeholder })
|
|
@@ -1471,14 +1398,11 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
1471
1398
|
),
|
|
1472
1399
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectContent, { children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
|
|
1473
1400
|
] }),
|
|
1474
|
-
|
|
1401
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1475
1402
|
] });
|
|
1476
1403
|
};
|
|
1477
1404
|
var Dropdown_default = Dropdown;
|
|
1478
1405
|
|
|
1479
|
-
// src/components/Inputs/SwitchToggle/SwitchToggle.tsx
|
|
1480
|
-
var import_react10 = require("react");
|
|
1481
|
-
|
|
1482
1406
|
// src/components/ui/switch.tsx
|
|
1483
1407
|
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
1484
1408
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
@@ -1513,11 +1437,6 @@ var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
|
1513
1437
|
var SwitchToggle = ({ className, style, ...props }) => {
|
|
1514
1438
|
const isEditable = props.isEditable ?? true;
|
|
1515
1439
|
const isDisabled = props.isDisabled ?? false;
|
|
1516
|
-
const [error, setError] = (0, import_react10.useState)(null);
|
|
1517
|
-
(0, import_react10.useEffect)(() => {
|
|
1518
|
-
if (!props.validateOnMount) return;
|
|
1519
|
-
setError(props.errorMessage || null);
|
|
1520
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1521
1440
|
const handleChange = (value) => {
|
|
1522
1441
|
props.onChange?.(value);
|
|
1523
1442
|
};
|
|
@@ -1534,13 +1453,12 @@ var SwitchToggle = ({ className, style, ...props }) => {
|
|
|
1534
1453
|
),
|
|
1535
1454
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Label2, { htmlFor: props.name || "switch", children: props.text })
|
|
1536
1455
|
] }) }),
|
|
1537
|
-
|
|
1456
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1538
1457
|
] });
|
|
1539
1458
|
};
|
|
1540
1459
|
var SwitchToggle_default = SwitchToggle;
|
|
1541
1460
|
|
|
1542
1461
|
// src/components/Inputs/PhoneInput/PhoneInput.tsx
|
|
1543
|
-
var React9 = __toESM(require("react"));
|
|
1544
1462
|
var import_react_international_phone = require("react-international-phone");
|
|
1545
1463
|
var import_style = require("react-international-phone/style.css");
|
|
1546
1464
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
@@ -1548,11 +1466,6 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
1548
1466
|
const placeholder = props.placeholder ?? "Enter phone number";
|
|
1549
1467
|
const isEditable = props.isEditable ?? true;
|
|
1550
1468
|
const isDisabled = props.isDisabled ?? false;
|
|
1551
|
-
const [error, setError] = React9.useState(null);
|
|
1552
|
-
React9.useEffect(() => {
|
|
1553
|
-
if (!props.validateOnMount) return;
|
|
1554
|
-
setError(props.errorMessage || null);
|
|
1555
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1556
1469
|
const handleChange = (val) => {
|
|
1557
1470
|
props.onChange?.(val);
|
|
1558
1471
|
};
|
|
@@ -1563,10 +1476,10 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
1563
1476
|
defaultCountry: "in",
|
|
1564
1477
|
name: props.name,
|
|
1565
1478
|
value: props.value,
|
|
1566
|
-
className: cn(className,
|
|
1479
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1567
1480
|
style: {
|
|
1568
1481
|
...style,
|
|
1569
|
-
borderColor:
|
|
1482
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1570
1483
|
},
|
|
1571
1484
|
onChange: (phone) => handleChange(phone),
|
|
1572
1485
|
inputProps: {
|
|
@@ -1576,13 +1489,12 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
1576
1489
|
disabled: isDisabled || !isEditable
|
|
1577
1490
|
}
|
|
1578
1491
|
),
|
|
1579
|
-
|
|
1492
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1580
1493
|
] });
|
|
1581
1494
|
};
|
|
1582
1495
|
var PhoneInput_default = PhoneInput;
|
|
1583
1496
|
|
|
1584
1497
|
// src/components/Inputs/SearchInput/SearchInput.tsx
|
|
1585
|
-
var React10 = __toESM(require("react"));
|
|
1586
1498
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1587
1499
|
var SearchInput = ({ className, style, ...props }) => {
|
|
1588
1500
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -1590,11 +1502,6 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
1590
1502
|
const isDisabled = props.isDisabled ?? false;
|
|
1591
1503
|
const isReadonly = props.isReadonly ?? false;
|
|
1592
1504
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
1593
|
-
const [error, setError] = React10.useState(null);
|
|
1594
|
-
React10.useEffect(() => {
|
|
1595
|
-
if (!props.validateOnMount) return;
|
|
1596
|
-
setError(props.errorMessage || null);
|
|
1597
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1598
1505
|
const handleChange = (e) => {
|
|
1599
1506
|
props.onChange?.(e);
|
|
1600
1507
|
};
|
|
@@ -1608,10 +1515,10 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
1608
1515
|
id: props.name || "text-field",
|
|
1609
1516
|
name: props.name,
|
|
1610
1517
|
value: props.value,
|
|
1611
|
-
className: cn(className,
|
|
1518
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1612
1519
|
style: {
|
|
1613
1520
|
...style,
|
|
1614
|
-
borderColor:
|
|
1521
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1615
1522
|
},
|
|
1616
1523
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
1617
1524
|
placeholder,
|
|
@@ -1621,21 +1528,15 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
1621
1528
|
}
|
|
1622
1529
|
)
|
|
1623
1530
|
] }),
|
|
1624
|
-
|
|
1531
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1625
1532
|
] });
|
|
1626
1533
|
};
|
|
1627
1534
|
var SearchInput_default = SearchInput;
|
|
1628
1535
|
|
|
1629
1536
|
// src/components/Inputs/FileInput/FileInput.tsx
|
|
1630
|
-
var import_react11 = require("react");
|
|
1631
1537
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1632
1538
|
var FileInput = ({ className, style, ...props }) => {
|
|
1633
1539
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
1634
|
-
const [error, setError] = (0, import_react11.useState)(null);
|
|
1635
|
-
(0, import_react11.useEffect)(() => {
|
|
1636
|
-
if (!props.validateOnMount) return;
|
|
1637
|
-
setError(props.errorMessage || null);
|
|
1638
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1639
1540
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "d-flex items-center relative align-middle", children: [
|
|
1640
1541
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1641
1542
|
Input,
|
|
@@ -1644,10 +1545,10 @@ var FileInput = ({ className, style, ...props }) => {
|
|
|
1644
1545
|
id: "file",
|
|
1645
1546
|
name: props.name,
|
|
1646
1547
|
value: props.value,
|
|
1647
|
-
className: cn(className,
|
|
1548
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1648
1549
|
style: {
|
|
1649
1550
|
...style,
|
|
1650
|
-
borderColor:
|
|
1551
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1651
1552
|
},
|
|
1652
1553
|
autoComplete: "off",
|
|
1653
1554
|
placeholder,
|
|
@@ -1656,13 +1557,12 @@ var FileInput = ({ className, style, ...props }) => {
|
|
|
1656
1557
|
}
|
|
1657
1558
|
}
|
|
1658
1559
|
),
|
|
1659
|
-
|
|
1560
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1660
1561
|
] });
|
|
1661
1562
|
};
|
|
1662
1563
|
var FileInput_default = FileInput;
|
|
1663
1564
|
|
|
1664
1565
|
// src/components/Inputs/DatePicker/DatePicker.tsx
|
|
1665
|
-
var import_react12 = __toESM(require("react"));
|
|
1666
1566
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1667
1567
|
function DatePicker({ className, style, ...props }) {
|
|
1668
1568
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -1674,7 +1574,6 @@ function DatePicker({ className, style, ...props }) {
|
|
|
1674
1574
|
const isDisabled = props.isDisabled ?? false;
|
|
1675
1575
|
const isReadonly = props.isReadonly ?? false;
|
|
1676
1576
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
1677
|
-
const [error, setError] = import_react12.default.useState(null);
|
|
1678
1577
|
const resolveDate = (option, customOption) => {
|
|
1679
1578
|
if (!option) return void 0;
|
|
1680
1579
|
switch (option) {
|
|
@@ -1689,10 +1588,6 @@ function DatePicker({ className, style, ...props }) {
|
|
|
1689
1588
|
};
|
|
1690
1589
|
const minDate = resolveDate(minimumDate, customMinimumDate);
|
|
1691
1590
|
const maxDate = resolveDate(maximumDate, customMaximumDate);
|
|
1692
|
-
(0, import_react12.useEffect)(() => {
|
|
1693
|
-
if (!props.validateOnMount) return;
|
|
1694
|
-
setError(props.errorMessage || null);
|
|
1695
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1696
1591
|
const handleChange = (e) => {
|
|
1697
1592
|
props.onChange?.(e);
|
|
1698
1593
|
};
|
|
@@ -1711,12 +1606,12 @@ function DatePicker({ className, style, ...props }) {
|
|
|
1711
1606
|
value: props.value,
|
|
1712
1607
|
className: cn(
|
|
1713
1608
|
className,
|
|
1714
|
-
|
|
1609
|
+
props.errorMessage ? "border-red-500" : "",
|
|
1715
1610
|
"appearance-auto"
|
|
1716
1611
|
),
|
|
1717
1612
|
style: {
|
|
1718
1613
|
...style,
|
|
1719
|
-
borderColor:
|
|
1614
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1720
1615
|
},
|
|
1721
1616
|
readOnly: isReadonly,
|
|
1722
1617
|
placeholder,
|
|
@@ -1725,16 +1620,16 @@ function DatePicker({ className, style, ...props }) {
|
|
|
1725
1620
|
}
|
|
1726
1621
|
)
|
|
1727
1622
|
] }),
|
|
1728
|
-
|
|
1623
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1729
1624
|
] });
|
|
1730
1625
|
}
|
|
1731
1626
|
|
|
1732
1627
|
// src/components/Inputs/DateRange/DateRange.tsx
|
|
1733
|
-
var
|
|
1628
|
+
var React3 = __toESM(require("react"));
|
|
1734
1629
|
var import_date_fns = require("date-fns");
|
|
1735
1630
|
|
|
1736
1631
|
// src/components/ui/calendar.tsx
|
|
1737
|
-
var
|
|
1632
|
+
var React2 = __toESM(require("react"));
|
|
1738
1633
|
var import_react_day_picker = require("react-day-picker");
|
|
1739
1634
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1740
1635
|
function Calendar2({
|
|
@@ -1889,8 +1784,8 @@ function CalendarDayButton({
|
|
|
1889
1784
|
...props
|
|
1890
1785
|
}) {
|
|
1891
1786
|
const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
|
|
1892
|
-
const ref =
|
|
1893
|
-
|
|
1787
|
+
const ref = React2.useRef(null);
|
|
1788
|
+
React2.useEffect(() => {
|
|
1894
1789
|
if (modifiers.focused) ref.current?.focus();
|
|
1895
1790
|
}, [modifiers.focused]);
|
|
1896
1791
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
@@ -1951,18 +1846,13 @@ function PopoverContent({
|
|
|
1951
1846
|
// src/components/Inputs/DateRange/DateRange.tsx
|
|
1952
1847
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1953
1848
|
var DateRange = ({ className, style, ...props }) => {
|
|
1954
|
-
const [error, setError] = React13.useState(null);
|
|
1955
1849
|
const isDateRange = (val) => !!val && val.from instanceof Date;
|
|
1956
|
-
const [date, setDate] =
|
|
1850
|
+
const [date, setDate] = React3.useState(
|
|
1957
1851
|
isDateRange(props.value) ? props.value : {
|
|
1958
1852
|
from: /* @__PURE__ */ new Date(),
|
|
1959
1853
|
to: (0, import_date_fns.addDays)(/* @__PURE__ */ new Date(), 7)
|
|
1960
1854
|
}
|
|
1961
1855
|
);
|
|
1962
|
-
React13.useEffect(() => {
|
|
1963
|
-
if (!props.validateOnMount) return;
|
|
1964
|
-
setError(props.errorMessage || null);
|
|
1965
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1966
1856
|
const handleChange = (value) => {
|
|
1967
1857
|
setDate(value);
|
|
1968
1858
|
if (value) {
|
|
@@ -1999,13 +1889,12 @@ var DateRange = ({ className, style, ...props }) => {
|
|
|
1999
1889
|
}
|
|
2000
1890
|
) })
|
|
2001
1891
|
] }) }),
|
|
2002
|
-
|
|
1892
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
2003
1893
|
] });
|
|
2004
1894
|
};
|
|
2005
1895
|
var DateRange_default = DateRange;
|
|
2006
1896
|
|
|
2007
1897
|
// src/components/Inputs/TextInputGroup/TextInputGroup.tsx
|
|
2008
|
-
var React14 = __toESM(require("react"));
|
|
2009
1898
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2010
1899
|
var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
2011
1900
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -2013,11 +1902,6 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
2013
1902
|
const isDisabled = props.isDisabled ?? false;
|
|
2014
1903
|
const isReadonly = props.isReadonly ?? false;
|
|
2015
1904
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
2016
|
-
const [error, setError] = React14.useState(null);
|
|
2017
|
-
React14.useEffect(() => {
|
|
2018
|
-
if (!props.validateOnMount) return;
|
|
2019
|
-
setError(props.errorMessage || null);
|
|
2020
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
2021
1905
|
const handleChange = (e) => {
|
|
2022
1906
|
props.onChange?.(e);
|
|
2023
1907
|
};
|
|
@@ -2029,7 +1913,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
2029
1913
|
"flex justify-start items-center relative border border-input rounded-md bg-transparent focus-within:ring-2 focus-within:ring-ring focus-within:border-primary",
|
|
2030
1914
|
className,
|
|
2031
1915
|
"p-0 m-0",
|
|
2032
|
-
|
|
1916
|
+
props.errorMessage ? "border-red-500" : ""
|
|
2033
1917
|
),
|
|
2034
1918
|
children: [
|
|
2035
1919
|
prepend && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-l-md", children: prepend }),
|
|
@@ -2046,7 +1930,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
2046
1930
|
),
|
|
2047
1931
|
style: {
|
|
2048
1932
|
...style,
|
|
2049
|
-
borderColor:
|
|
1933
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
2050
1934
|
},
|
|
2051
1935
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
2052
1936
|
placeholder,
|
|
@@ -2059,7 +1943,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
2059
1943
|
]
|
|
2060
1944
|
}
|
|
2061
1945
|
),
|
|
2062
|
-
|
|
1946
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
2063
1947
|
] });
|
|
2064
1948
|
};
|
|
2065
1949
|
var TextInputGroup_default = TextInputGroup;
|
|
@@ -2398,7 +2282,7 @@ var CustomPagination = ({
|
|
|
2398
2282
|
var Pagination_default = CustomPagination;
|
|
2399
2283
|
|
|
2400
2284
|
// src/components/DataDisplay/Table/Table.tsx
|
|
2401
|
-
var
|
|
2285
|
+
var import_react6 = require("react");
|
|
2402
2286
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2403
2287
|
var Table2 = ({
|
|
2404
2288
|
columns,
|
|
@@ -2415,7 +2299,7 @@ var Table2 = ({
|
|
|
2415
2299
|
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
2416
2300
|
const rawData = Array.isArray(data) ? data : [];
|
|
2417
2301
|
const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
|
|
2418
|
-
const [currentPage, setCurrentPage] = (0,
|
|
2302
|
+
const [currentPage, setCurrentPage] = (0, import_react6.useState)(1);
|
|
2419
2303
|
const enablePagination = pagination && rawData.length > itemsPerPage;
|
|
2420
2304
|
const handlePageChange = (page) => {
|
|
2421
2305
|
setCurrentPage(page);
|
|
@@ -2536,12 +2420,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, LinkComponent, pathname, can
|
|
|
2536
2420
|
var Tabs_default = Tabs;
|
|
2537
2421
|
|
|
2538
2422
|
// src/components/Navigation/Stages/Stages.tsx
|
|
2539
|
-
var
|
|
2423
|
+
var import_react7 = __toESM(require("react"));
|
|
2540
2424
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2541
2425
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
|
|
2542
2426
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex items-center justify-between bg-gray-50 p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
2543
2427
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
2544
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex items-center flex-1 px-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2428
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex items-center flex-1 px-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react7.default.Fragment, { children: [
|
|
2545
2429
|
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2546
2430
|
"button",
|
|
2547
2431
|
{
|
|
@@ -2574,10 +2458,10 @@ var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
|
2574
2458
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2575
2459
|
|
|
2576
2460
|
// src/components/ui/avatar.tsx
|
|
2577
|
-
var
|
|
2461
|
+
var React5 = __toESM(require("react"));
|
|
2578
2462
|
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
2579
2463
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2580
|
-
var Avatar =
|
|
2464
|
+
var Avatar = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2581
2465
|
AvatarPrimitive.Root,
|
|
2582
2466
|
{
|
|
2583
2467
|
ref,
|
|
@@ -2589,7 +2473,7 @@ var Avatar = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
2589
2473
|
}
|
|
2590
2474
|
));
|
|
2591
2475
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
2592
|
-
var AvatarImage =
|
|
2476
|
+
var AvatarImage = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2593
2477
|
AvatarPrimitive.Image,
|
|
2594
2478
|
{
|
|
2595
2479
|
ref,
|
|
@@ -2598,7 +2482,7 @@ var AvatarImage = React16.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2598
2482
|
}
|
|
2599
2483
|
));
|
|
2600
2484
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
2601
|
-
var AvatarFallback =
|
|
2485
|
+
var AvatarFallback = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2602
2486
|
AvatarPrimitive.Fallback,
|
|
2603
2487
|
{
|
|
2604
2488
|
ref,
|
|
@@ -2962,7 +2846,7 @@ function showSonnerToast({
|
|
|
2962
2846
|
}
|
|
2963
2847
|
|
|
2964
2848
|
// src/components/StateManagment/StateContext.tsx
|
|
2965
|
-
var
|
|
2849
|
+
var import_react8 = require("react");
|
|
2966
2850
|
|
|
2967
2851
|
// src/components/StateManagment/stateReducer.ts
|
|
2968
2852
|
function stateReducer(state, action) {
|
|
@@ -2976,17 +2860,17 @@ function stateReducer(state, action) {
|
|
|
2976
2860
|
|
|
2977
2861
|
// src/components/StateManagment/StateContext.tsx
|
|
2978
2862
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2979
|
-
var StateContext = (0,
|
|
2863
|
+
var StateContext = (0, import_react8.createContext)(null);
|
|
2980
2864
|
function StateProvider({ children }) {
|
|
2981
|
-
const [state, dispatch] = (0,
|
|
2865
|
+
const [state, dispatch] = (0, import_react8.useReducer)(stateReducer, {});
|
|
2982
2866
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(StateContext.Provider, { value: { state, dispatch }, children });
|
|
2983
2867
|
}
|
|
2984
2868
|
function useAppState() {
|
|
2985
|
-
return (0,
|
|
2869
|
+
return (0, import_react8.useContext)(StateContext);
|
|
2986
2870
|
}
|
|
2987
2871
|
|
|
2988
2872
|
// src/components/Form/Form.tsx
|
|
2989
|
-
var
|
|
2873
|
+
var import_react9 = __toESM(require("react"));
|
|
2990
2874
|
var import_zod = require("@hookform/resolvers/zod");
|
|
2991
2875
|
var import_react_hook_form = require("react-hook-form");
|
|
2992
2876
|
var import_zod2 = require("zod");
|
|
@@ -3066,7 +2950,7 @@ var Form = ({
|
|
|
3066
2950
|
onSubmit,
|
|
3067
2951
|
onReset
|
|
3068
2952
|
}) => {
|
|
3069
|
-
const schema = (0,
|
|
2953
|
+
const schema = (0, import_react9.useMemo)(() => {
|
|
3070
2954
|
if (!validation || validation.length === 0) return null;
|
|
3071
2955
|
return generateZodSchema(validation);
|
|
3072
2956
|
}, [validation]);
|
|
@@ -3094,9 +2978,9 @@ var Form = ({
|
|
|
3094
2978
|
className: cn(
|
|
3095
2979
|
"space-y-4 min-h-[100px] h-auto flex justify-between flex-col"
|
|
3096
2980
|
),
|
|
3097
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "min-h-[50px]", children:
|
|
2981
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "min-h-[50px]", children: import_react9.default.Children.map(children, (child) => {
|
|
3098
2982
|
const processChild = (child2) => {
|
|
3099
|
-
if (
|
|
2983
|
+
if (import_react9.default.isValidElement(child2)) {
|
|
3100
2984
|
const node = child2.props?.node;
|
|
3101
2985
|
if (node?.category === "Form Controls") {
|
|
3102
2986
|
const name = node.properties?.name || "unnamed";
|
|
@@ -3107,7 +2991,7 @@ var Form = ({
|
|
|
3107
2991
|
control,
|
|
3108
2992
|
render: ({ field: controllerField }) => {
|
|
3109
2993
|
const childElement = child2;
|
|
3110
|
-
return
|
|
2994
|
+
return import_react9.default.cloneElement(childElement, {
|
|
3111
2995
|
input: {
|
|
3112
2996
|
...controllerField,
|
|
3113
2997
|
value: controllerField.value || "",
|
|
@@ -3123,11 +3007,11 @@ var Form = ({
|
|
|
3123
3007
|
}
|
|
3124
3008
|
if (child2.props?.children) {
|
|
3125
3009
|
const childElement = child2;
|
|
3126
|
-
return
|
|
3127
|
-
children:
|
|
3010
|
+
return import_react9.default.cloneElement(childElement, {
|
|
3011
|
+
children: import_react9.default.Children.map(childElement.props.children, processChild)
|
|
3128
3012
|
});
|
|
3129
3013
|
}
|
|
3130
|
-
return
|
|
3014
|
+
return import_react9.default.cloneElement(child2);
|
|
3131
3015
|
}
|
|
3132
3016
|
return child2;
|
|
3133
3017
|
};
|
|
@@ -3139,7 +3023,7 @@ var Form = ({
|
|
|
3139
3023
|
var Form_default = Form;
|
|
3140
3024
|
|
|
3141
3025
|
// src/components/Form/Wrapper.tsx
|
|
3142
|
-
var
|
|
3026
|
+
var import_react10 = require("react");
|
|
3143
3027
|
var import_zod3 = require("@hookform/resolvers/zod");
|
|
3144
3028
|
var import_react_hook_form2 = require("react-hook-form");
|
|
3145
3029
|
var import_zod4 = require("zod");
|
|
@@ -3219,7 +3103,7 @@ var FormWrapper = ({
|
|
|
3219
3103
|
onSubmit,
|
|
3220
3104
|
onReset
|
|
3221
3105
|
}) => {
|
|
3222
|
-
const schema = (0,
|
|
3106
|
+
const schema = (0, import_react10.useMemo)(() => {
|
|
3223
3107
|
if (!validation || validation.length === 0) return null;
|
|
3224
3108
|
return generateZodSchema2(validation);
|
|
3225
3109
|
}, [validation]);
|