@algorithm-shift/design-system 1.2.42 → 1.2.43
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.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +76 -192
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +65 -181
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -598,9 +598,6 @@ function SplitButton({ style, textContent, className, list = [], LinkComponent }
|
|
|
598
598
|
] });
|
|
599
599
|
}
|
|
600
600
|
|
|
601
|
-
// src/components/Inputs/TextInput/TextInput.tsx
|
|
602
|
-
import * as React2 from "react";
|
|
603
|
-
|
|
604
601
|
// src/components/ui/input.tsx
|
|
605
602
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
606
603
|
function Input({ className, type, ...props }) {
|
|
@@ -628,11 +625,6 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
628
625
|
const isDisabled = props.isDisabled ?? false;
|
|
629
626
|
const isReadonly = props.isReadonly ?? false;
|
|
630
627
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
631
|
-
const [error, setError] = React2.useState(null);
|
|
632
|
-
React2.useEffect(() => {
|
|
633
|
-
if (!props.validateOnMount) return;
|
|
634
|
-
setError(props.errorMessage || null);
|
|
635
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
636
628
|
const handleChange = (e) => {
|
|
637
629
|
props.onChange?.(e);
|
|
638
630
|
};
|
|
@@ -642,10 +634,10 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
642
634
|
{
|
|
643
635
|
type: "text",
|
|
644
636
|
name: props.name,
|
|
645
|
-
className: cn(className,
|
|
637
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
646
638
|
style: {
|
|
647
639
|
...style,
|
|
648
|
-
borderColor:
|
|
640
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
649
641
|
},
|
|
650
642
|
value: props.value,
|
|
651
643
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
@@ -655,14 +647,12 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
655
647
|
readOnly: isReadonly
|
|
656
648
|
}
|
|
657
649
|
),
|
|
658
|
-
|
|
650
|
+
props.errorMessage && /* @__PURE__ */ jsx13("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
659
651
|
] });
|
|
660
652
|
};
|
|
661
653
|
var TextInput_default = TextInput;
|
|
662
654
|
|
|
663
655
|
// src/components/Inputs/NumberInput/NumberInput.tsx
|
|
664
|
-
import * as React3 from "react";
|
|
665
|
-
import { useEffect as useEffect2 } from "react";
|
|
666
656
|
import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
667
657
|
var NumberInput = ({ className, style, ...props }) => {
|
|
668
658
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -670,11 +660,6 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
670
660
|
const isDisabled = props.isDisabled ?? false;
|
|
671
661
|
const isReadonly = props.isReadonly ?? false;
|
|
672
662
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
673
|
-
const [error, setError] = React3.useState(null);
|
|
674
|
-
useEffect2(() => {
|
|
675
|
-
if (!props.validateOnMount) return;
|
|
676
|
-
setError(props.errorMessage || null);
|
|
677
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
678
663
|
const handleChange = (e) => {
|
|
679
664
|
props.onChange?.(e);
|
|
680
665
|
};
|
|
@@ -688,10 +673,10 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
688
673
|
id: props.name || "number-field",
|
|
689
674
|
name: props.name,
|
|
690
675
|
value: props.value,
|
|
691
|
-
className: cn(className,
|
|
676
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
692
677
|
style: {
|
|
693
678
|
...style,
|
|
694
|
-
borderColor:
|
|
679
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
695
680
|
},
|
|
696
681
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
697
682
|
placeholder,
|
|
@@ -701,13 +686,12 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
701
686
|
}
|
|
702
687
|
)
|
|
703
688
|
] }),
|
|
704
|
-
|
|
689
|
+
props.errorMessage && /* @__PURE__ */ jsx14("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
705
690
|
] });
|
|
706
691
|
};
|
|
707
692
|
var NumberInput_default = NumberInput;
|
|
708
693
|
|
|
709
694
|
// src/components/Inputs/EmailInput/EmailInput.tsx
|
|
710
|
-
import * as React4 from "react";
|
|
711
695
|
import { Fragment as Fragment3, jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
712
696
|
var EmailInput = ({ className, style, ...props }) => {
|
|
713
697
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -715,11 +699,6 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
715
699
|
const isDisabled = props.isDisabled ?? false;
|
|
716
700
|
const isReadonly = props.isReadonly ?? false;
|
|
717
701
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
718
|
-
const [error, setError] = React4.useState(null);
|
|
719
|
-
React4.useEffect(() => {
|
|
720
|
-
if (!props.validateOnMount) return;
|
|
721
|
-
setError(props.errorMessage || null);
|
|
722
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
723
702
|
const handleChange = (e) => {
|
|
724
703
|
props.onChange?.(e);
|
|
725
704
|
};
|
|
@@ -732,10 +711,10 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
732
711
|
type: "email",
|
|
733
712
|
name: props.name,
|
|
734
713
|
value: props.value,
|
|
735
|
-
className: cn(className,
|
|
714
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
736
715
|
style: {
|
|
737
716
|
...style,
|
|
738
|
-
borderColor:
|
|
717
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
739
718
|
},
|
|
740
719
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
741
720
|
placeholder,
|
|
@@ -745,13 +724,12 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
745
724
|
}
|
|
746
725
|
)
|
|
747
726
|
] }),
|
|
748
|
-
|
|
727
|
+
props.errorMessage && /* @__PURE__ */ jsx15("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
749
728
|
] });
|
|
750
729
|
};
|
|
751
730
|
var EmailInput_default = EmailInput;
|
|
752
731
|
|
|
753
732
|
// src/components/Inputs/PasswordInput/PasswordInput.tsx
|
|
754
|
-
import * as React5 from "react";
|
|
755
733
|
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
756
734
|
var PasswordInput = ({ className, style, ...props }) => {
|
|
757
735
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -759,11 +737,6 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
759
737
|
const isDisabled = props.isDisabled ?? false;
|
|
760
738
|
const isReadonly = props.isReadonly ?? false;
|
|
761
739
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
762
|
-
const [error, setError] = React5.useState(null);
|
|
763
|
-
React5.useEffect(() => {
|
|
764
|
-
if (!props.validateOnMount) return;
|
|
765
|
-
setError(props.errorMessage || null);
|
|
766
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
767
740
|
const handleChange = (e) => {
|
|
768
741
|
props.onChange?.(e);
|
|
769
742
|
};
|
|
@@ -777,10 +750,10 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
777
750
|
id: props.name || "password-field",
|
|
778
751
|
name: props.name,
|
|
779
752
|
value: props.value,
|
|
780
|
-
className: cn(className,
|
|
753
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
781
754
|
style: {
|
|
782
755
|
...style,
|
|
783
|
-
borderColor:
|
|
756
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
784
757
|
},
|
|
785
758
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
786
759
|
placeholder,
|
|
@@ -790,14 +763,11 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
790
763
|
}
|
|
791
764
|
)
|
|
792
765
|
] }),
|
|
793
|
-
|
|
766
|
+
props.errorMessage && /* @__PURE__ */ jsx16("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
794
767
|
] });
|
|
795
768
|
};
|
|
796
769
|
var PasswordInput_default = PasswordInput;
|
|
797
770
|
|
|
798
|
-
// src/components/Inputs/Textarea/Textarea.tsx
|
|
799
|
-
import * as React6 from "react";
|
|
800
|
-
|
|
801
771
|
// src/components/ui/textarea.tsx
|
|
802
772
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
803
773
|
function Textarea({ className, ...props }) {
|
|
@@ -822,11 +792,6 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
822
792
|
const isDisabled = props.isDisabled ?? false;
|
|
823
793
|
const isReadonly = props.isReadonly ?? false;
|
|
824
794
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
825
|
-
const [error, setError] = React6.useState(null);
|
|
826
|
-
React6.useEffect(() => {
|
|
827
|
-
if (!props.validateOnMount) return;
|
|
828
|
-
setError(props.errorMessage || null);
|
|
829
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
830
795
|
const handleChange = (e) => {
|
|
831
796
|
props.onChange?.(e);
|
|
832
797
|
};
|
|
@@ -837,10 +802,10 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
837
802
|
id: "textarea-field",
|
|
838
803
|
name: props.name,
|
|
839
804
|
value: props.value,
|
|
840
|
-
className: cn(className,
|
|
805
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
841
806
|
style: {
|
|
842
807
|
...style,
|
|
843
|
-
borderColor:
|
|
808
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
844
809
|
},
|
|
845
810
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
846
811
|
placeholder,
|
|
@@ -849,13 +814,12 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
849
814
|
readOnly: isReadonly
|
|
850
815
|
}
|
|
851
816
|
),
|
|
852
|
-
|
|
817
|
+
props.errorMessage && /* @__PURE__ */ jsx18("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
853
818
|
] });
|
|
854
819
|
};
|
|
855
820
|
var Textarea_default = Textarea2;
|
|
856
821
|
|
|
857
822
|
// src/components/Inputs/UrlInput/UrlInput.tsx
|
|
858
|
-
import * as React7 from "react";
|
|
859
823
|
import { Fragment as Fragment6, jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
860
824
|
var UrlInput = ({ className, style, ...props }) => {
|
|
861
825
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -863,11 +827,6 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
863
827
|
const isDisabled = props.isDisabled ?? false;
|
|
864
828
|
const isReadonly = props.isReadonly ?? false;
|
|
865
829
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
866
|
-
const [error, setError] = React7.useState(null);
|
|
867
|
-
React7.useEffect(() => {
|
|
868
|
-
if (!props.validateOnMount) return;
|
|
869
|
-
setError(props.errorMessage || null);
|
|
870
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
871
830
|
const handleChange = (e) => {
|
|
872
831
|
props.onChange?.(e);
|
|
873
832
|
};
|
|
@@ -881,10 +840,10 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
881
840
|
type: "url",
|
|
882
841
|
name: props.name,
|
|
883
842
|
value: props.value,
|
|
884
|
-
className: cn(className,
|
|
843
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
885
844
|
style: {
|
|
886
845
|
...style,
|
|
887
|
-
borderColor:
|
|
846
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
888
847
|
},
|
|
889
848
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
890
849
|
placeholder,
|
|
@@ -894,14 +853,11 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
894
853
|
}
|
|
895
854
|
)
|
|
896
855
|
] }),
|
|
897
|
-
|
|
856
|
+
props.errorMessage && /* @__PURE__ */ jsx19("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
898
857
|
] });
|
|
899
858
|
};
|
|
900
859
|
var UrlInput_default = UrlInput;
|
|
901
860
|
|
|
902
|
-
// src/components/Inputs/Checkbox/Checkbox.tsx
|
|
903
|
-
import { useEffect as useEffect7, useState as useState7 } from "react";
|
|
904
|
-
|
|
905
861
|
// src/components/ui/checkbox.tsx
|
|
906
862
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
907
863
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
@@ -956,11 +912,6 @@ var CheckboxInput = ({ className, style, ...props }) => {
|
|
|
956
912
|
const isEditable = props.isEditable ?? true;
|
|
957
913
|
const isDisabled = props.isDisabled ?? false;
|
|
958
914
|
const text = props.text ? props.text : "Subscribe";
|
|
959
|
-
const [error, setError] = useState7(null);
|
|
960
|
-
useEffect7(() => {
|
|
961
|
-
if (!props.validateOnMount) return;
|
|
962
|
-
setError(props.errorMessage || null);
|
|
963
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
964
915
|
const handleChange = (value) => {
|
|
965
916
|
props.onChange?.(value);
|
|
966
917
|
};
|
|
@@ -977,14 +928,11 @@ var CheckboxInput = ({ className, style, ...props }) => {
|
|
|
977
928
|
),
|
|
978
929
|
/* @__PURE__ */ jsx22(Label2, { htmlFor: props.name || "checkbox", children: text })
|
|
979
930
|
] }) }),
|
|
980
|
-
|
|
931
|
+
props.errorMessage && /* @__PURE__ */ jsx22("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
981
932
|
] });
|
|
982
933
|
};
|
|
983
934
|
var Checkbox_default = CheckboxInput;
|
|
984
935
|
|
|
985
|
-
// src/components/Inputs/RadioInput/RadioInput.tsx
|
|
986
|
-
import { useEffect as useEffect8, useState as useState8 } from "react";
|
|
987
|
-
|
|
988
936
|
// src/components/ui/radio-group.tsx
|
|
989
937
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
990
938
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
@@ -1038,11 +986,6 @@ var RadioInput = ({
|
|
|
1038
986
|
dataLabel,
|
|
1039
987
|
...props
|
|
1040
988
|
}) => {
|
|
1041
|
-
const [error, setError] = useState8(null);
|
|
1042
|
-
useEffect8(() => {
|
|
1043
|
-
if (!props.validateOnMount) return;
|
|
1044
|
-
setError(props.errorMessage || null);
|
|
1045
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1046
989
|
const options = (data || []).map((item) => ({
|
|
1047
990
|
value: item[dataKey || "value"],
|
|
1048
991
|
label: item[dataLabel || "label"]
|
|
@@ -1066,13 +1009,13 @@ var RadioInput = ({
|
|
|
1066
1009
|
]
|
|
1067
1010
|
}
|
|
1068
1011
|
) }),
|
|
1069
|
-
|
|
1012
|
+
props.errorMessage && /* @__PURE__ */ jsx24("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1070
1013
|
] });
|
|
1071
1014
|
};
|
|
1072
1015
|
var RadioInput_default = RadioInput;
|
|
1073
1016
|
|
|
1074
1017
|
// src/components/Inputs/MultiCheckbox/MultiCheckbox.tsx
|
|
1075
|
-
import { useCallback, useState
|
|
1018
|
+
import { useCallback, useState } from "react";
|
|
1076
1019
|
import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1077
1020
|
var MultiCheckbox = ({
|
|
1078
1021
|
className,
|
|
@@ -1085,7 +1028,7 @@ var MultiCheckbox = ({
|
|
|
1085
1028
|
isEditable = true,
|
|
1086
1029
|
isDisabled = false
|
|
1087
1030
|
}) => {
|
|
1088
|
-
const [value, setValue] =
|
|
1031
|
+
const [value, setValue] = useState(propValue);
|
|
1089
1032
|
const options = (data || []).map((item) => ({
|
|
1090
1033
|
value: item[dataKey || "value"],
|
|
1091
1034
|
label: item[dataLabel || "label"]
|
|
@@ -1125,9 +1068,6 @@ var MultiCheckbox = ({
|
|
|
1125
1068
|
};
|
|
1126
1069
|
var MultiCheckbox_default = MultiCheckbox;
|
|
1127
1070
|
|
|
1128
|
-
// src/components/Inputs/RichText/RichText.tsx
|
|
1129
|
-
import { useEffect as useEffect9, useState as useState10 } from "react";
|
|
1130
|
-
|
|
1131
1071
|
// src/components/Global/TinyMceEditor.tsx
|
|
1132
1072
|
import { useMemo, useRef } from "react";
|
|
1133
1073
|
import { Editor } from "@tinymce/tinymce-react";
|
|
@@ -1202,30 +1142,22 @@ function MyEditor({
|
|
|
1202
1142
|
// src/components/Inputs/RichText/RichText.tsx
|
|
1203
1143
|
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1204
1144
|
function RichText({ className, style, ...props }) {
|
|
1205
|
-
const [error, setError] = useState10(null);
|
|
1206
|
-
useEffect9(() => {
|
|
1207
|
-
if (!props.validateOnMount) return;
|
|
1208
|
-
setError(props.errorMessage || null);
|
|
1209
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1210
1145
|
return /* @__PURE__ */ jsxs14(
|
|
1211
1146
|
"div",
|
|
1212
1147
|
{
|
|
1213
|
-
className: cn(className,
|
|
1148
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1214
1149
|
style: {
|
|
1215
1150
|
...style,
|
|
1216
|
-
borderColor:
|
|
1151
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1217
1152
|
},
|
|
1218
1153
|
children: [
|
|
1219
1154
|
/* @__PURE__ */ jsx27(MyEditor, { onChange: (content) => props.onChange?.(content), value: props.value, isDefault: true }),
|
|
1220
|
-
|
|
1155
|
+
props.errorMessage && /* @__PURE__ */ jsx27("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1221
1156
|
]
|
|
1222
1157
|
}
|
|
1223
1158
|
);
|
|
1224
1159
|
}
|
|
1225
1160
|
|
|
1226
|
-
// src/components/Inputs/Dropdown/Dropdown.tsx
|
|
1227
|
-
import * as React8 from "react";
|
|
1228
|
-
|
|
1229
1161
|
// src/components/ui/select.tsx
|
|
1230
1162
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1231
1163
|
import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
@@ -1360,11 +1292,6 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
1360
1292
|
const isEditable = props.isEditable ?? true;
|
|
1361
1293
|
const isDisabled = props.isDisabled ?? false;
|
|
1362
1294
|
const isReadonly = props.isReadonly ?? false;
|
|
1363
|
-
const [error, setError] = React8.useState(null);
|
|
1364
|
-
React8.useEffect(() => {
|
|
1365
|
-
if (!props.validateOnMount) return;
|
|
1366
|
-
setError(props.errorMessage || null);
|
|
1367
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1368
1295
|
const handleChange = (value) => {
|
|
1369
1296
|
props.onChange?.(value);
|
|
1370
1297
|
};
|
|
@@ -1380,10 +1307,10 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
1380
1307
|
SelectTrigger,
|
|
1381
1308
|
{
|
|
1382
1309
|
id: props.name || "select-field",
|
|
1383
|
-
className: cn(className,
|
|
1310
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1384
1311
|
style: {
|
|
1385
1312
|
...style,
|
|
1386
|
-
borderColor:
|
|
1313
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1387
1314
|
},
|
|
1388
1315
|
"aria-readonly": isReadonly,
|
|
1389
1316
|
children: /* @__PURE__ */ jsx29(SelectValue, { placeholder })
|
|
@@ -1391,14 +1318,11 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
1391
1318
|
),
|
|
1392
1319
|
/* @__PURE__ */ jsx29(SelectContent, { children: options.map((opt) => /* @__PURE__ */ jsx29(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
|
|
1393
1320
|
] }),
|
|
1394
|
-
|
|
1321
|
+
props.errorMessage && /* @__PURE__ */ jsx29("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1395
1322
|
] });
|
|
1396
1323
|
};
|
|
1397
1324
|
var Dropdown_default = Dropdown;
|
|
1398
1325
|
|
|
1399
|
-
// src/components/Inputs/SwitchToggle/SwitchToggle.tsx
|
|
1400
|
-
import { useEffect as useEffect11, useState as useState12 } from "react";
|
|
1401
|
-
|
|
1402
1326
|
// src/components/ui/switch.tsx
|
|
1403
1327
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
1404
1328
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
@@ -1433,11 +1357,6 @@ import { Fragment as Fragment10, jsx as jsx31, jsxs as jsxs17 } from "react/jsx-
|
|
|
1433
1357
|
var SwitchToggle = ({ className, style, ...props }) => {
|
|
1434
1358
|
const isEditable = props.isEditable ?? true;
|
|
1435
1359
|
const isDisabled = props.isDisabled ?? false;
|
|
1436
|
-
const [error, setError] = useState12(null);
|
|
1437
|
-
useEffect11(() => {
|
|
1438
|
-
if (!props.validateOnMount) return;
|
|
1439
|
-
setError(props.errorMessage || null);
|
|
1440
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1441
1360
|
const handleChange = (value) => {
|
|
1442
1361
|
props.onChange?.(value);
|
|
1443
1362
|
};
|
|
@@ -1454,13 +1373,12 @@ var SwitchToggle = ({ className, style, ...props }) => {
|
|
|
1454
1373
|
),
|
|
1455
1374
|
/* @__PURE__ */ jsx31(Label2, { htmlFor: props.name || "switch", children: props.text })
|
|
1456
1375
|
] }) }),
|
|
1457
|
-
|
|
1376
|
+
props.errorMessage && /* @__PURE__ */ jsx31("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1458
1377
|
] });
|
|
1459
1378
|
};
|
|
1460
1379
|
var SwitchToggle_default = SwitchToggle;
|
|
1461
1380
|
|
|
1462
1381
|
// src/components/Inputs/PhoneInput/PhoneInput.tsx
|
|
1463
|
-
import * as React9 from "react";
|
|
1464
1382
|
import { PhoneInput as PhoneInputField } from "react-international-phone";
|
|
1465
1383
|
import "react-international-phone/style.css";
|
|
1466
1384
|
import { Fragment as Fragment11, jsx as jsx32, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
@@ -1468,11 +1386,6 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
1468
1386
|
const placeholder = props.placeholder ?? "Enter phone number";
|
|
1469
1387
|
const isEditable = props.isEditable ?? true;
|
|
1470
1388
|
const isDisabled = props.isDisabled ?? false;
|
|
1471
|
-
const [error, setError] = React9.useState(null);
|
|
1472
|
-
React9.useEffect(() => {
|
|
1473
|
-
if (!props.validateOnMount) return;
|
|
1474
|
-
setError(props.errorMessage || null);
|
|
1475
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1476
1389
|
const handleChange = (val) => {
|
|
1477
1390
|
props.onChange?.(val);
|
|
1478
1391
|
};
|
|
@@ -1483,10 +1396,10 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
1483
1396
|
defaultCountry: "in",
|
|
1484
1397
|
name: props.name,
|
|
1485
1398
|
value: props.value,
|
|
1486
|
-
className: cn(className,
|
|
1399
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1487
1400
|
style: {
|
|
1488
1401
|
...style,
|
|
1489
|
-
borderColor:
|
|
1402
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1490
1403
|
},
|
|
1491
1404
|
onChange: (phone) => handleChange(phone),
|
|
1492
1405
|
inputProps: {
|
|
@@ -1496,13 +1409,12 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
1496
1409
|
disabled: isDisabled || !isEditable
|
|
1497
1410
|
}
|
|
1498
1411
|
),
|
|
1499
|
-
|
|
1412
|
+
props.errorMessage && /* @__PURE__ */ jsx32("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1500
1413
|
] });
|
|
1501
1414
|
};
|
|
1502
1415
|
var PhoneInput_default = PhoneInput;
|
|
1503
1416
|
|
|
1504
1417
|
// src/components/Inputs/SearchInput/SearchInput.tsx
|
|
1505
|
-
import * as React10 from "react";
|
|
1506
1418
|
import { Fragment as Fragment12, jsx as jsx33, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1507
1419
|
var SearchInput = ({ className, style, ...props }) => {
|
|
1508
1420
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -1510,11 +1422,6 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
1510
1422
|
const isDisabled = props.isDisabled ?? false;
|
|
1511
1423
|
const isReadonly = props.isReadonly ?? false;
|
|
1512
1424
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
1513
|
-
const [error, setError] = React10.useState(null);
|
|
1514
|
-
React10.useEffect(() => {
|
|
1515
|
-
if (!props.validateOnMount) return;
|
|
1516
|
-
setError(props.errorMessage || null);
|
|
1517
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1518
1425
|
const handleChange = (e) => {
|
|
1519
1426
|
props.onChange?.(e);
|
|
1520
1427
|
};
|
|
@@ -1528,10 +1435,10 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
1528
1435
|
id: props.name || "text-field",
|
|
1529
1436
|
name: props.name,
|
|
1530
1437
|
value: props.value,
|
|
1531
|
-
className: cn(className,
|
|
1438
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1532
1439
|
style: {
|
|
1533
1440
|
...style,
|
|
1534
|
-
borderColor:
|
|
1441
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1535
1442
|
},
|
|
1536
1443
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
1537
1444
|
placeholder,
|
|
@@ -1541,21 +1448,15 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
1541
1448
|
}
|
|
1542
1449
|
)
|
|
1543
1450
|
] }),
|
|
1544
|
-
|
|
1451
|
+
props.errorMessage && /* @__PURE__ */ jsx33("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1545
1452
|
] });
|
|
1546
1453
|
};
|
|
1547
1454
|
var SearchInput_default = SearchInput;
|
|
1548
1455
|
|
|
1549
1456
|
// src/components/Inputs/FileInput/FileInput.tsx
|
|
1550
|
-
import { useEffect as useEffect14, useState as useState15 } from "react";
|
|
1551
1457
|
import { jsx as jsx34, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1552
1458
|
var FileInput = ({ className, style, ...props }) => {
|
|
1553
1459
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
1554
|
-
const [error, setError] = useState15(null);
|
|
1555
|
-
useEffect14(() => {
|
|
1556
|
-
if (!props.validateOnMount) return;
|
|
1557
|
-
setError(props.errorMessage || null);
|
|
1558
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1559
1460
|
return /* @__PURE__ */ jsxs20("div", { className: "d-flex items-center relative align-middle", children: [
|
|
1560
1461
|
/* @__PURE__ */ jsx34(
|
|
1561
1462
|
Input,
|
|
@@ -1564,10 +1465,10 @@ var FileInput = ({ className, style, ...props }) => {
|
|
|
1564
1465
|
id: "file",
|
|
1565
1466
|
name: props.name,
|
|
1566
1467
|
value: props.value,
|
|
1567
|
-
className: cn(className,
|
|
1468
|
+
className: cn(className, props.errorMessage ? "border-red-500" : ""),
|
|
1568
1469
|
style: {
|
|
1569
1470
|
...style,
|
|
1570
|
-
borderColor:
|
|
1471
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1571
1472
|
},
|
|
1572
1473
|
autoComplete: "off",
|
|
1573
1474
|
placeholder,
|
|
@@ -1576,13 +1477,12 @@ var FileInput = ({ className, style, ...props }) => {
|
|
|
1576
1477
|
}
|
|
1577
1478
|
}
|
|
1578
1479
|
),
|
|
1579
|
-
|
|
1480
|
+
props.errorMessage && /* @__PURE__ */ jsx34("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1580
1481
|
] });
|
|
1581
1482
|
};
|
|
1582
1483
|
var FileInput_default = FileInput;
|
|
1583
1484
|
|
|
1584
1485
|
// src/components/Inputs/DatePicker/DatePicker.tsx
|
|
1585
|
-
import React11, { useEffect as useEffect15 } from "react";
|
|
1586
1486
|
import { Fragment as Fragment13, jsx as jsx35, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1587
1487
|
function DatePicker({ className, style, ...props }) {
|
|
1588
1488
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -1594,7 +1494,6 @@ function DatePicker({ className, style, ...props }) {
|
|
|
1594
1494
|
const isDisabled = props.isDisabled ?? false;
|
|
1595
1495
|
const isReadonly = props.isReadonly ?? false;
|
|
1596
1496
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
1597
|
-
const [error, setError] = React11.useState(null);
|
|
1598
1497
|
const resolveDate = (option, customOption) => {
|
|
1599
1498
|
if (!option) return void 0;
|
|
1600
1499
|
switch (option) {
|
|
@@ -1609,10 +1508,6 @@ function DatePicker({ className, style, ...props }) {
|
|
|
1609
1508
|
};
|
|
1610
1509
|
const minDate = resolveDate(minimumDate, customMinimumDate);
|
|
1611
1510
|
const maxDate = resolveDate(maximumDate, customMaximumDate);
|
|
1612
|
-
useEffect15(() => {
|
|
1613
|
-
if (!props.validateOnMount) return;
|
|
1614
|
-
setError(props.errorMessage || null);
|
|
1615
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1616
1511
|
const handleChange = (e) => {
|
|
1617
1512
|
props.onChange?.(e);
|
|
1618
1513
|
};
|
|
@@ -1631,12 +1526,12 @@ function DatePicker({ className, style, ...props }) {
|
|
|
1631
1526
|
value: props.value,
|
|
1632
1527
|
className: cn(
|
|
1633
1528
|
className,
|
|
1634
|
-
|
|
1529
|
+
props.errorMessage ? "border-red-500" : "",
|
|
1635
1530
|
"appearance-auto"
|
|
1636
1531
|
),
|
|
1637
1532
|
style: {
|
|
1638
1533
|
...style,
|
|
1639
|
-
borderColor:
|
|
1534
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1640
1535
|
},
|
|
1641
1536
|
readOnly: isReadonly,
|
|
1642
1537
|
placeholder,
|
|
@@ -1645,16 +1540,16 @@ function DatePicker({ className, style, ...props }) {
|
|
|
1645
1540
|
}
|
|
1646
1541
|
)
|
|
1647
1542
|
] }),
|
|
1648
|
-
|
|
1543
|
+
props.errorMessage && /* @__PURE__ */ jsx35("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1649
1544
|
] });
|
|
1650
1545
|
}
|
|
1651
1546
|
|
|
1652
1547
|
// src/components/Inputs/DateRange/DateRange.tsx
|
|
1653
|
-
import * as
|
|
1548
|
+
import * as React3 from "react";
|
|
1654
1549
|
import { addDays, format } from "date-fns";
|
|
1655
1550
|
|
|
1656
1551
|
// src/components/ui/calendar.tsx
|
|
1657
|
-
import * as
|
|
1552
|
+
import * as React2 from "react";
|
|
1658
1553
|
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
1659
1554
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1660
1555
|
function Calendar2({
|
|
@@ -1809,8 +1704,8 @@ function CalendarDayButton({
|
|
|
1809
1704
|
...props
|
|
1810
1705
|
}) {
|
|
1811
1706
|
const defaultClassNames = getDefaultClassNames();
|
|
1812
|
-
const ref =
|
|
1813
|
-
|
|
1707
|
+
const ref = React2.useRef(null);
|
|
1708
|
+
React2.useEffect(() => {
|
|
1814
1709
|
if (modifiers.focused) ref.current?.focus();
|
|
1815
1710
|
}, [modifiers.focused]);
|
|
1816
1711
|
return /* @__PURE__ */ jsx36(
|
|
@@ -1871,18 +1766,13 @@ function PopoverContent({
|
|
|
1871
1766
|
// src/components/Inputs/DateRange/DateRange.tsx
|
|
1872
1767
|
import { Fragment as Fragment14, jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1873
1768
|
var DateRange = ({ className, style, ...props }) => {
|
|
1874
|
-
const [error, setError] = React13.useState(null);
|
|
1875
1769
|
const isDateRange = (val) => !!val && val.from instanceof Date;
|
|
1876
|
-
const [date, setDate] =
|
|
1770
|
+
const [date, setDate] = React3.useState(
|
|
1877
1771
|
isDateRange(props.value) ? props.value : {
|
|
1878
1772
|
from: /* @__PURE__ */ new Date(),
|
|
1879
1773
|
to: addDays(/* @__PURE__ */ new Date(), 7)
|
|
1880
1774
|
}
|
|
1881
1775
|
);
|
|
1882
|
-
React13.useEffect(() => {
|
|
1883
|
-
if (!props.validateOnMount) return;
|
|
1884
|
-
setError(props.errorMessage || null);
|
|
1885
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1886
1776
|
const handleChange = (value) => {
|
|
1887
1777
|
setDate(value);
|
|
1888
1778
|
if (value) {
|
|
@@ -1919,13 +1809,12 @@ var DateRange = ({ className, style, ...props }) => {
|
|
|
1919
1809
|
}
|
|
1920
1810
|
) })
|
|
1921
1811
|
] }) }),
|
|
1922
|
-
|
|
1812
|
+
props.errorMessage && /* @__PURE__ */ jsx38("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1923
1813
|
] });
|
|
1924
1814
|
};
|
|
1925
1815
|
var DateRange_default = DateRange;
|
|
1926
1816
|
|
|
1927
1817
|
// src/components/Inputs/TextInputGroup/TextInputGroup.tsx
|
|
1928
|
-
import * as React14 from "react";
|
|
1929
1818
|
import { Fragment as Fragment15, jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1930
1819
|
var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
1931
1820
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -1933,11 +1822,6 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
1933
1822
|
const isDisabled = props.isDisabled ?? false;
|
|
1934
1823
|
const isReadonly = props.isReadonly ?? false;
|
|
1935
1824
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
1936
|
-
const [error, setError] = React14.useState(null);
|
|
1937
|
-
React14.useEffect(() => {
|
|
1938
|
-
if (!props.validateOnMount) return;
|
|
1939
|
-
setError(props.errorMessage || null);
|
|
1940
|
-
}, [props.errorMessage, props.validateOnMount]);
|
|
1941
1825
|
const handleChange = (e) => {
|
|
1942
1826
|
props.onChange?.(e);
|
|
1943
1827
|
};
|
|
@@ -1949,7 +1833,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
1949
1833
|
"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",
|
|
1950
1834
|
className,
|
|
1951
1835
|
"p-0 m-0",
|
|
1952
|
-
|
|
1836
|
+
props.errorMessage ? "border-red-500" : ""
|
|
1953
1837
|
),
|
|
1954
1838
|
children: [
|
|
1955
1839
|
prepend && /* @__PURE__ */ jsx39("div", { className: "px-3 flex items-center bg-gray-500 text-white h-10 rounded-l-md", children: prepend }),
|
|
@@ -1966,7 +1850,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
1966
1850
|
),
|
|
1967
1851
|
style: {
|
|
1968
1852
|
...style,
|
|
1969
|
-
borderColor:
|
|
1853
|
+
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
1970
1854
|
},
|
|
1971
1855
|
autoComplete: isAutocomplete ? "on" : "off",
|
|
1972
1856
|
placeholder,
|
|
@@ -1979,7 +1863,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
1979
1863
|
]
|
|
1980
1864
|
}
|
|
1981
1865
|
),
|
|
1982
|
-
|
|
1866
|
+
props.errorMessage && /* @__PURE__ */ jsx39("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
1983
1867
|
] });
|
|
1984
1868
|
};
|
|
1985
1869
|
var TextInputGroup_default = TextInputGroup;
|
|
@@ -2322,7 +2206,7 @@ var CustomPagination = ({
|
|
|
2322
2206
|
var Pagination_default = CustomPagination;
|
|
2323
2207
|
|
|
2324
2208
|
// src/components/DataDisplay/Table/Table.tsx
|
|
2325
|
-
import { useState as
|
|
2209
|
+
import { useState as useState3 } from "react";
|
|
2326
2210
|
import { jsx as jsx44, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2327
2211
|
var Table2 = ({
|
|
2328
2212
|
columns,
|
|
@@ -2339,7 +2223,7 @@ var Table2 = ({
|
|
|
2339
2223
|
const rawColumns = Array.isArray(columns) ? columns : [];
|
|
2340
2224
|
const rawData = Array.isArray(data) ? data : [];
|
|
2341
2225
|
const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
|
|
2342
|
-
const [currentPage, setCurrentPage] =
|
|
2226
|
+
const [currentPage, setCurrentPage] = useState3(1);
|
|
2343
2227
|
const enablePagination = pagination && rawData.length > itemsPerPage;
|
|
2344
2228
|
const handlePageChange = (page) => {
|
|
2345
2229
|
setCurrentPage(page);
|
|
@@ -2460,12 +2344,12 @@ var Tabs = ({ className, style, tabs, verticalMenu, LinkComponent, pathname, can
|
|
|
2460
2344
|
var Tabs_default = Tabs;
|
|
2461
2345
|
|
|
2462
2346
|
// src/components/Navigation/Stages/Stages.tsx
|
|
2463
|
-
import
|
|
2347
|
+
import React4 from "react";
|
|
2464
2348
|
import { jsx as jsx46, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2465
2349
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
|
|
2466
2350
|
return /* @__PURE__ */ jsx46("div", { className, style, children: /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between bg-gray-50 p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
2467
2351
|
/* @__PURE__ */ jsx46("div", { className: "flex items-center", children: /* @__PURE__ */ jsx46("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx46("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx46("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
2468
|
-
/* @__PURE__ */ jsx46("div", { className: "flex items-center flex-1 px-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs29(
|
|
2352
|
+
/* @__PURE__ */ jsx46("div", { className: "flex items-center flex-1 px-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs29(React4.Fragment, { children: [
|
|
2469
2353
|
/* @__PURE__ */ jsx46(
|
|
2470
2354
|
"button",
|
|
2471
2355
|
{
|
|
@@ -2498,10 +2382,10 @@ import { jsx as jsx49, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
|
2498
2382
|
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
2499
2383
|
|
|
2500
2384
|
// src/components/ui/avatar.tsx
|
|
2501
|
-
import * as
|
|
2385
|
+
import * as React5 from "react";
|
|
2502
2386
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
2503
2387
|
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2504
|
-
var Avatar =
|
|
2388
|
+
var Avatar = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
2505
2389
|
AvatarPrimitive.Root,
|
|
2506
2390
|
{
|
|
2507
2391
|
ref,
|
|
@@ -2513,7 +2397,7 @@ var Avatar = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
2513
2397
|
}
|
|
2514
2398
|
));
|
|
2515
2399
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
2516
|
-
var AvatarImage =
|
|
2400
|
+
var AvatarImage = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
2517
2401
|
AvatarPrimitive.Image,
|
|
2518
2402
|
{
|
|
2519
2403
|
ref,
|
|
@@ -2522,7 +2406,7 @@ var AvatarImage = React16.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2522
2406
|
}
|
|
2523
2407
|
));
|
|
2524
2408
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
2525
|
-
var AvatarFallback =
|
|
2409
|
+
var AvatarFallback = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
2526
2410
|
AvatarPrimitive.Fallback,
|
|
2527
2411
|
{
|
|
2528
2412
|
ref,
|
|
@@ -2910,7 +2794,7 @@ function useAppState() {
|
|
|
2910
2794
|
}
|
|
2911
2795
|
|
|
2912
2796
|
// src/components/Form/Form.tsx
|
|
2913
|
-
import
|
|
2797
|
+
import React7, { useMemo as useMemo2 } from "react";
|
|
2914
2798
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
2915
2799
|
import { useForm, Controller } from "react-hook-form";
|
|
2916
2800
|
import { z } from "zod";
|
|
@@ -3018,9 +2902,9 @@ var Form = ({
|
|
|
3018
2902
|
className: cn(
|
|
3019
2903
|
"space-y-4 min-h-[100px] h-auto flex justify-between flex-col"
|
|
3020
2904
|
),
|
|
3021
|
-
children: /* @__PURE__ */ jsx57("div", { className: "min-h-[50px]", children:
|
|
2905
|
+
children: /* @__PURE__ */ jsx57("div", { className: "min-h-[50px]", children: React7.Children.map(children, (child) => {
|
|
3022
2906
|
const processChild = (child2) => {
|
|
3023
|
-
if (
|
|
2907
|
+
if (React7.isValidElement(child2)) {
|
|
3024
2908
|
const node = child2.props?.node;
|
|
3025
2909
|
if (node?.category === "Form Controls") {
|
|
3026
2910
|
const name = node.properties?.name || "unnamed";
|
|
@@ -3031,7 +2915,7 @@ var Form = ({
|
|
|
3031
2915
|
control,
|
|
3032
2916
|
render: ({ field: controllerField }) => {
|
|
3033
2917
|
const childElement = child2;
|
|
3034
|
-
return
|
|
2918
|
+
return React7.cloneElement(childElement, {
|
|
3035
2919
|
input: {
|
|
3036
2920
|
...controllerField,
|
|
3037
2921
|
value: controllerField.value || "",
|
|
@@ -3047,11 +2931,11 @@ var Form = ({
|
|
|
3047
2931
|
}
|
|
3048
2932
|
if (child2.props?.children) {
|
|
3049
2933
|
const childElement = child2;
|
|
3050
|
-
return
|
|
3051
|
-
children:
|
|
2934
|
+
return React7.cloneElement(childElement, {
|
|
2935
|
+
children: React7.Children.map(childElement.props.children, processChild)
|
|
3052
2936
|
});
|
|
3053
2937
|
}
|
|
3054
|
-
return
|
|
2938
|
+
return React7.cloneElement(child2);
|
|
3055
2939
|
}
|
|
3056
2940
|
return child2;
|
|
3057
2941
|
};
|