@algorithm-shift/design-system 1.2.60 → 1.2.62
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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +170 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +165 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -239,6 +239,8 @@ var ButtonWrapper = ({
|
|
|
239
239
|
className,
|
|
240
240
|
style,
|
|
241
241
|
textContent = "Button",
|
|
242
|
+
loadingText = "Loading...",
|
|
243
|
+
loading = false,
|
|
242
244
|
...props
|
|
243
245
|
}) => {
|
|
244
246
|
return /* @__PURE__ */ jsx11(
|
|
@@ -247,7 +249,8 @@ var ButtonWrapper = ({
|
|
|
247
249
|
...props,
|
|
248
250
|
className,
|
|
249
251
|
style,
|
|
250
|
-
|
|
252
|
+
disabled: props.disabled || loading,
|
|
253
|
+
children: loading ? loadingText : textContent
|
|
251
254
|
}
|
|
252
255
|
);
|
|
253
256
|
};
|
|
@@ -26816,6 +26819,9 @@ var Icon2 = ({ iconType = "fontawesome", name = "Envelope", className, fontSize
|
|
|
26816
26819
|
};
|
|
26817
26820
|
var Icon_default = Icon2;
|
|
26818
26821
|
|
|
26822
|
+
// src/components/Inputs/TextInput/TextInput.tsx
|
|
26823
|
+
import { useEffect as useEffect2 } from "react";
|
|
26824
|
+
|
|
26819
26825
|
// src/components/ui/input.tsx
|
|
26820
26826
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
26821
26827
|
function Input({ className, type, ...props }) {
|
|
@@ -26843,6 +26849,12 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
26843
26849
|
const isDisabled = props.isDisabled ?? false;
|
|
26844
26850
|
const isReadonly = props.isReadonly ?? false;
|
|
26845
26851
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
26852
|
+
useEffect2(() => {
|
|
26853
|
+
if (props.value !== void 0) {
|
|
26854
|
+
const e = { target: { value: props.value } };
|
|
26855
|
+
handleChange?.(e);
|
|
26856
|
+
}
|
|
26857
|
+
}, []);
|
|
26846
26858
|
const handleChange = (e) => {
|
|
26847
26859
|
props.onChange?.(e);
|
|
26848
26860
|
};
|
|
@@ -26871,6 +26883,7 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
26871
26883
|
var TextInput_default = TextInput;
|
|
26872
26884
|
|
|
26873
26885
|
// src/components/Inputs/NumberInput/NumberInput.tsx
|
|
26886
|
+
import { useEffect as useEffect3 } from "react";
|
|
26874
26887
|
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
26875
26888
|
var NumberInput = ({ className, style, ...props }) => {
|
|
26876
26889
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -26878,6 +26891,12 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
26878
26891
|
const isDisabled = props.isDisabled ?? false;
|
|
26879
26892
|
const isReadonly = props.isReadonly ?? false;
|
|
26880
26893
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
26894
|
+
useEffect3(() => {
|
|
26895
|
+
if (props.value !== void 0) {
|
|
26896
|
+
const e = { target: { value: props.value } };
|
|
26897
|
+
handleChange?.(e);
|
|
26898
|
+
}
|
|
26899
|
+
}, []);
|
|
26881
26900
|
const handleChange = (e) => {
|
|
26882
26901
|
props.onChange?.(e);
|
|
26883
26902
|
};
|
|
@@ -26910,6 +26929,7 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
26910
26929
|
var NumberInput_default = NumberInput;
|
|
26911
26930
|
|
|
26912
26931
|
// src/components/Inputs/EmailInput/EmailInput.tsx
|
|
26932
|
+
import { useEffect as useEffect4 } from "react";
|
|
26913
26933
|
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
26914
26934
|
var EmailInput = ({ className, style, ...props }) => {
|
|
26915
26935
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -26917,6 +26937,12 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
26917
26937
|
const isDisabled = props.isDisabled ?? false;
|
|
26918
26938
|
const isReadonly = props.isReadonly ?? false;
|
|
26919
26939
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
26940
|
+
useEffect4(() => {
|
|
26941
|
+
if (props.value !== void 0) {
|
|
26942
|
+
const e = { target: { value: props.value } };
|
|
26943
|
+
handleChange?.(e);
|
|
26944
|
+
}
|
|
26945
|
+
}, []);
|
|
26920
26946
|
const handleChange = (e) => {
|
|
26921
26947
|
props.onChange?.(e);
|
|
26922
26948
|
};
|
|
@@ -26948,6 +26974,7 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
26948
26974
|
var EmailInput_default = EmailInput;
|
|
26949
26975
|
|
|
26950
26976
|
// src/components/Inputs/PasswordInput/PasswordInput.tsx
|
|
26977
|
+
import { useEffect as useEffect5 } from "react";
|
|
26951
26978
|
import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
26952
26979
|
var PasswordInput = ({ className, style, ...props }) => {
|
|
26953
26980
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -26955,6 +26982,12 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
26955
26982
|
const isDisabled = props.isDisabled ?? false;
|
|
26956
26983
|
const isReadonly = props.isReadonly ?? false;
|
|
26957
26984
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
26985
|
+
useEffect5(() => {
|
|
26986
|
+
if (props.value !== void 0) {
|
|
26987
|
+
const e = { target: { value: props.value } };
|
|
26988
|
+
handleChange?.(e);
|
|
26989
|
+
}
|
|
26990
|
+
}, []);
|
|
26958
26991
|
const handleChange = (e) => {
|
|
26959
26992
|
props.onChange?.(e);
|
|
26960
26993
|
};
|
|
@@ -26986,6 +27019,9 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
26986
27019
|
};
|
|
26987
27020
|
var PasswordInput_default = PasswordInput;
|
|
26988
27021
|
|
|
27022
|
+
// src/components/Inputs/Textarea/Textarea.tsx
|
|
27023
|
+
import { useEffect as useEffect6 } from "react";
|
|
27024
|
+
|
|
26989
27025
|
// src/components/ui/textarea.tsx
|
|
26990
27026
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
26991
27027
|
function Textarea({ className, ...props }) {
|
|
@@ -27010,6 +27046,12 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
27010
27046
|
const isDisabled = props.isDisabled ?? false;
|
|
27011
27047
|
const isReadonly = props.isReadonly ?? false;
|
|
27012
27048
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27049
|
+
useEffect6(() => {
|
|
27050
|
+
if (props.value !== void 0) {
|
|
27051
|
+
const e = { target: { value: props.value } };
|
|
27052
|
+
handleChange?.(e);
|
|
27053
|
+
}
|
|
27054
|
+
}, []);
|
|
27013
27055
|
const handleChange = (e) => {
|
|
27014
27056
|
props.onChange?.(e);
|
|
27015
27057
|
};
|
|
@@ -27038,6 +27080,7 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
27038
27080
|
var Textarea_default = Textarea2;
|
|
27039
27081
|
|
|
27040
27082
|
// src/components/Inputs/UrlInput/UrlInput.tsx
|
|
27083
|
+
import { useEffect as useEffect7 } from "react";
|
|
27041
27084
|
import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
27042
27085
|
var UrlInput = ({ className, style, ...props }) => {
|
|
27043
27086
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -27045,6 +27088,12 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
27045
27088
|
const isDisabled = props.isDisabled ?? false;
|
|
27046
27089
|
const isReadonly = props.isReadonly ?? false;
|
|
27047
27090
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27091
|
+
useEffect7(() => {
|
|
27092
|
+
if (props.value !== void 0) {
|
|
27093
|
+
const e = { target: { value: props.value } };
|
|
27094
|
+
handleChange?.(e);
|
|
27095
|
+
}
|
|
27096
|
+
}, []);
|
|
27048
27097
|
const handleChange = (e) => {
|
|
27049
27098
|
props.onChange?.(e);
|
|
27050
27099
|
};
|
|
@@ -27076,6 +27125,9 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
27076
27125
|
};
|
|
27077
27126
|
var UrlInput_default = UrlInput;
|
|
27078
27127
|
|
|
27128
|
+
// src/components/Inputs/Checkbox/Checkbox.tsx
|
|
27129
|
+
import { useEffect as useEffect8 } from "react";
|
|
27130
|
+
|
|
27079
27131
|
// src/components/ui/checkbox.tsx
|
|
27080
27132
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
27081
27133
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
@@ -27130,6 +27182,11 @@ var CheckboxInput = ({ className, style, ...props }) => {
|
|
|
27130
27182
|
const isEditable = props.isEditable ?? true;
|
|
27131
27183
|
const isDisabled = props.isDisabled ?? false;
|
|
27132
27184
|
const text = props.text ? props.text : "Subscribe";
|
|
27185
|
+
useEffect8(() => {
|
|
27186
|
+
if (props.value) {
|
|
27187
|
+
handleChange(props.value);
|
|
27188
|
+
}
|
|
27189
|
+
}, []);
|
|
27133
27190
|
const handleChange = (value) => {
|
|
27134
27191
|
props.onChange?.(value);
|
|
27135
27192
|
};
|
|
@@ -27151,6 +27208,9 @@ var CheckboxInput = ({ className, style, ...props }) => {
|
|
|
27151
27208
|
};
|
|
27152
27209
|
var Checkbox_default = CheckboxInput;
|
|
27153
27210
|
|
|
27211
|
+
// src/components/Inputs/RadioInput/RadioInput.tsx
|
|
27212
|
+
import { useEffect as useEffect9 } from "react";
|
|
27213
|
+
|
|
27154
27214
|
// src/components/ui/radio-group.tsx
|
|
27155
27215
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
27156
27216
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
@@ -27209,6 +27269,11 @@ var RadioInput = ({
|
|
|
27209
27269
|
value: item[dataKey || "value"],
|
|
27210
27270
|
label: item[dataLabel || "label"]
|
|
27211
27271
|
}));
|
|
27272
|
+
useEffect9(() => {
|
|
27273
|
+
if (props.value !== void 0) {
|
|
27274
|
+
handleChange?.(props.value);
|
|
27275
|
+
}
|
|
27276
|
+
}, []);
|
|
27212
27277
|
const handleChange = (value) => {
|
|
27213
27278
|
onChange?.(value);
|
|
27214
27279
|
};
|
|
@@ -27234,7 +27299,7 @@ var RadioInput = ({
|
|
|
27234
27299
|
var RadioInput_default = RadioInput;
|
|
27235
27300
|
|
|
27236
27301
|
// src/components/Inputs/MultiCheckbox/MultiCheckbox.tsx
|
|
27237
|
-
import { useCallback, useState as useState2 } from "react";
|
|
27302
|
+
import { useCallback, useEffect as useEffect10, useState as useState2 } from "react";
|
|
27238
27303
|
import { jsx as jsx31, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
27239
27304
|
var MultiCheckbox = ({
|
|
27240
27305
|
className,
|
|
@@ -27253,6 +27318,11 @@ var MultiCheckbox = ({
|
|
|
27253
27318
|
value: item[dataKey || "value"],
|
|
27254
27319
|
label: item[dataLabel || "label"]
|
|
27255
27320
|
}));
|
|
27321
|
+
useEffect10(() => {
|
|
27322
|
+
if (propValue !== void 0) {
|
|
27323
|
+
onChange?.(propValue);
|
|
27324
|
+
}
|
|
27325
|
+
}, []);
|
|
27256
27326
|
const handleChange = useCallback(
|
|
27257
27327
|
(key, checked) => {
|
|
27258
27328
|
setValue((prev) => {
|
|
@@ -27288,6 +27358,9 @@ var MultiCheckbox = ({
|
|
|
27288
27358
|
};
|
|
27289
27359
|
var MultiCheckbox_default = MultiCheckbox;
|
|
27290
27360
|
|
|
27361
|
+
// src/components/Inputs/RichText/RichText.tsx
|
|
27362
|
+
import { useEffect as useEffect11 } from "react";
|
|
27363
|
+
|
|
27291
27364
|
// src/components/Global/TinyMceEditor.tsx
|
|
27292
27365
|
import { useMemo as useMemo2, useRef } from "react";
|
|
27293
27366
|
import { Editor } from "@tinymce/tinymce-react";
|
|
@@ -27362,6 +27435,14 @@ function MyEditor({
|
|
|
27362
27435
|
// src/components/Inputs/RichText/RichText.tsx
|
|
27363
27436
|
import { jsx as jsx33, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
27364
27437
|
function RichText({ className, style, ...props }) {
|
|
27438
|
+
useEffect11(() => {
|
|
27439
|
+
if (props.value !== void 0) {
|
|
27440
|
+
handleChange?.(props.value);
|
|
27441
|
+
}
|
|
27442
|
+
}, []);
|
|
27443
|
+
const handleChange = (content) => {
|
|
27444
|
+
props.onChange?.(content);
|
|
27445
|
+
};
|
|
27365
27446
|
return /* @__PURE__ */ jsxs16(
|
|
27366
27447
|
"div",
|
|
27367
27448
|
{
|
|
@@ -27371,13 +27452,16 @@ function RichText({ className, style, ...props }) {
|
|
|
27371
27452
|
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
27372
27453
|
},
|
|
27373
27454
|
children: [
|
|
27374
|
-
/* @__PURE__ */ jsx33(MyEditor, { onChange:
|
|
27455
|
+
/* @__PURE__ */ jsx33(MyEditor, { onChange: handleChange, value: props.value || "", isDefault: true }),
|
|
27375
27456
|
props.errorMessage && /* @__PURE__ */ jsx33("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
27376
27457
|
]
|
|
27377
27458
|
}
|
|
27378
27459
|
);
|
|
27379
27460
|
}
|
|
27380
27461
|
|
|
27462
|
+
// src/components/Inputs/Dropdown/Dropdown.tsx
|
|
27463
|
+
import { useEffect as useEffect12 } from "react";
|
|
27464
|
+
|
|
27381
27465
|
// src/components/ui/select.tsx
|
|
27382
27466
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
27383
27467
|
import { jsx as jsx34, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
@@ -27512,6 +27596,11 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
27512
27596
|
const isEditable = props.isEditable ?? true;
|
|
27513
27597
|
const isDisabled = props.isDisabled ?? false;
|
|
27514
27598
|
const isReadonly = props.isReadonly ?? false;
|
|
27599
|
+
useEffect12(() => {
|
|
27600
|
+
if (props.value !== void 0) {
|
|
27601
|
+
handleChange(props.value);
|
|
27602
|
+
}
|
|
27603
|
+
}, []);
|
|
27515
27604
|
const handleChange = (value) => {
|
|
27516
27605
|
props.onChange?.(value);
|
|
27517
27606
|
};
|
|
@@ -27547,6 +27636,9 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
27547
27636
|
};
|
|
27548
27637
|
var Dropdown_default = Dropdown;
|
|
27549
27638
|
|
|
27639
|
+
// src/components/Inputs/SwitchToggle/SwitchToggle.tsx
|
|
27640
|
+
import { useEffect as useEffect13 } from "react";
|
|
27641
|
+
|
|
27550
27642
|
// src/components/ui/switch.tsx
|
|
27551
27643
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
27552
27644
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
@@ -27581,6 +27673,11 @@ import { Fragment as Fragment11, jsx as jsx37, jsxs as jsxs19 } from "react/jsx-
|
|
|
27581
27673
|
var SwitchToggle = ({ className, style, ...props }) => {
|
|
27582
27674
|
const isEditable = props.isEditable ?? true;
|
|
27583
27675
|
const isDisabled = props.isDisabled ?? false;
|
|
27676
|
+
useEffect13(() => {
|
|
27677
|
+
if (props.value !== void 0) {
|
|
27678
|
+
handleChange?.(props.value);
|
|
27679
|
+
}
|
|
27680
|
+
}, []);
|
|
27584
27681
|
const handleChange = (value) => {
|
|
27585
27682
|
props.onChange?.(value);
|
|
27586
27683
|
};
|
|
@@ -27603,6 +27700,7 @@ var SwitchToggle = ({ className, style, ...props }) => {
|
|
|
27603
27700
|
var SwitchToggle_default = SwitchToggle;
|
|
27604
27701
|
|
|
27605
27702
|
// src/components/Inputs/PhoneInput/PhoneInput.tsx
|
|
27703
|
+
import { useEffect as useEffect14 } from "react";
|
|
27606
27704
|
import { PhoneInput as PhoneInputField } from "react-international-phone";
|
|
27607
27705
|
import "react-international-phone/style.css";
|
|
27608
27706
|
import { Fragment as Fragment12, jsx as jsx38, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
@@ -27610,6 +27708,11 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
27610
27708
|
const placeholder = props.placeholder ?? "Enter phone number";
|
|
27611
27709
|
const isEditable = props.isEditable ?? true;
|
|
27612
27710
|
const isDisabled = props.isDisabled ?? false;
|
|
27711
|
+
useEffect14(() => {
|
|
27712
|
+
if (props.value !== void 0) {
|
|
27713
|
+
handleChange?.(props.value);
|
|
27714
|
+
}
|
|
27715
|
+
}, []);
|
|
27613
27716
|
const handleChange = (val) => {
|
|
27614
27717
|
props.onChange?.(val);
|
|
27615
27718
|
};
|
|
@@ -27644,6 +27747,7 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
27644
27747
|
var PhoneInput_default = PhoneInput;
|
|
27645
27748
|
|
|
27646
27749
|
// src/components/Inputs/SearchInput/SearchInput.tsx
|
|
27750
|
+
import { useEffect as useEffect15 } from "react";
|
|
27647
27751
|
import { Fragment as Fragment13, jsx as jsx39, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
27648
27752
|
var SearchInput = ({ className, style, ...props }) => {
|
|
27649
27753
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -27651,6 +27755,12 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
27651
27755
|
const isDisabled = props.isDisabled ?? false;
|
|
27652
27756
|
const isReadonly = props.isReadonly ?? false;
|
|
27653
27757
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27758
|
+
useEffect15(() => {
|
|
27759
|
+
if (props.value !== void 0) {
|
|
27760
|
+
const e = { target: { value: props.value } };
|
|
27761
|
+
handleChange?.(e);
|
|
27762
|
+
}
|
|
27763
|
+
}, []);
|
|
27654
27764
|
const handleChange = (e) => {
|
|
27655
27765
|
props.onChange?.(e);
|
|
27656
27766
|
};
|
|
@@ -27683,9 +27793,19 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
27683
27793
|
var SearchInput_default = SearchInput;
|
|
27684
27794
|
|
|
27685
27795
|
// src/components/Inputs/FileInput/FileInput.tsx
|
|
27796
|
+
import { useEffect as useEffect16 } from "react";
|
|
27686
27797
|
import { jsx as jsx40, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
27687
27798
|
var FileInput2 = ({ className, style, ...props }) => {
|
|
27688
27799
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
27800
|
+
useEffect16(() => {
|
|
27801
|
+
if (props.value !== void 0) {
|
|
27802
|
+
const e = { target: { value: props.value } };
|
|
27803
|
+
handleChange?.(e);
|
|
27804
|
+
}
|
|
27805
|
+
}, []);
|
|
27806
|
+
const handleChange = (e) => {
|
|
27807
|
+
props.onChange?.(e);
|
|
27808
|
+
};
|
|
27689
27809
|
return /* @__PURE__ */ jsxs22("div", { className: "d-flex items-center relative align-middle", children: [
|
|
27690
27810
|
/* @__PURE__ */ jsx40(
|
|
27691
27811
|
Input,
|
|
@@ -27701,9 +27821,7 @@ var FileInput2 = ({ className, style, ...props }) => {
|
|
|
27701
27821
|
},
|
|
27702
27822
|
autoComplete: "off",
|
|
27703
27823
|
placeholder,
|
|
27704
|
-
onChange:
|
|
27705
|
-
props.onChange?.(e);
|
|
27706
|
-
}
|
|
27824
|
+
onChange: handleChange
|
|
27707
27825
|
}
|
|
27708
27826
|
),
|
|
27709
27827
|
props.errorMessage && /* @__PURE__ */ jsx40("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
@@ -27712,6 +27830,7 @@ var FileInput2 = ({ className, style, ...props }) => {
|
|
|
27712
27830
|
var FileInput_default = FileInput2;
|
|
27713
27831
|
|
|
27714
27832
|
// src/components/Inputs/DatePicker/DatePicker.tsx
|
|
27833
|
+
import { useEffect as useEffect17 } from "react";
|
|
27715
27834
|
import { Fragment as Fragment14, jsx as jsx41, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
27716
27835
|
function DatePicker({ className, style, ...props }) {
|
|
27717
27836
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -27737,9 +27856,18 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27737
27856
|
};
|
|
27738
27857
|
const minDate = resolveDate(minimumDate, customMinimumDate);
|
|
27739
27858
|
const maxDate = resolveDate(maximumDate, customMaximumDate);
|
|
27859
|
+
useEffect17(() => {
|
|
27860
|
+
if (props.value !== void 0) {
|
|
27861
|
+
handleChange(props.value);
|
|
27862
|
+
}
|
|
27863
|
+
}, []);
|
|
27740
27864
|
const handleChange = (e) => {
|
|
27741
27865
|
props.onChange?.(e);
|
|
27742
27866
|
};
|
|
27867
|
+
const toDateInputValue = (value) => {
|
|
27868
|
+
if (!value) return "";
|
|
27869
|
+
return new Date(value).toISOString().split("T")[0];
|
|
27870
|
+
};
|
|
27743
27871
|
return /* @__PURE__ */ jsxs23(Fragment14, { children: [
|
|
27744
27872
|
/* @__PURE__ */ jsxs23("div", { className: "flex justify-start items-center relative", children: [
|
|
27745
27873
|
/* @__PURE__ */ jsx41(Calendar, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
|
|
@@ -27752,7 +27880,7 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27752
27880
|
onChange: handleChange,
|
|
27753
27881
|
disabled: isDisabled || !isEditable,
|
|
27754
27882
|
name: props.name,
|
|
27755
|
-
value: props.value
|
|
27883
|
+
value: toDateInputValue(props.value),
|
|
27756
27884
|
className: cn(
|
|
27757
27885
|
className,
|
|
27758
27886
|
props.errorMessage ? "border-red-500" : "",
|
|
@@ -27774,11 +27902,11 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27774
27902
|
}
|
|
27775
27903
|
|
|
27776
27904
|
// src/components/Inputs/DateRange/DateRange.tsx
|
|
27777
|
-
import
|
|
27905
|
+
import React5, { useEffect as useEffect19 } from "react";
|
|
27778
27906
|
import { addDays, format } from "date-fns";
|
|
27779
27907
|
|
|
27780
27908
|
// src/components/ui/calendar.tsx
|
|
27781
|
-
import * as
|
|
27909
|
+
import * as React4 from "react";
|
|
27782
27910
|
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
27783
27911
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
27784
27912
|
function Calendar2({
|
|
@@ -27933,8 +28061,8 @@ function CalendarDayButton({
|
|
|
27933
28061
|
...props
|
|
27934
28062
|
}) {
|
|
27935
28063
|
const defaultClassNames = getDefaultClassNames();
|
|
27936
|
-
const ref =
|
|
27937
|
-
|
|
28064
|
+
const ref = React4.useRef(null);
|
|
28065
|
+
React4.useEffect(() => {
|
|
27938
28066
|
if (modifiers.focused) ref.current?.focus();
|
|
27939
28067
|
}, [modifiers.focused]);
|
|
27940
28068
|
return /* @__PURE__ */ jsx42(
|
|
@@ -27996,12 +28124,17 @@ function PopoverContent({
|
|
|
27996
28124
|
import { Fragment as Fragment15, jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
27997
28125
|
var DateRange = ({ className, style, ...props }) => {
|
|
27998
28126
|
const isDateRange = (val) => !!val && val.from instanceof Date;
|
|
27999
|
-
const [date, setDate] =
|
|
28127
|
+
const [date, setDate] = React5.useState(
|
|
28000
28128
|
isDateRange(props.value) ? props.value : {
|
|
28001
28129
|
from: /* @__PURE__ */ new Date(),
|
|
28002
28130
|
to: addDays(/* @__PURE__ */ new Date(), 7)
|
|
28003
28131
|
}
|
|
28004
28132
|
);
|
|
28133
|
+
useEffect19(() => {
|
|
28134
|
+
if (props.value && isDateRange(props.value)) {
|
|
28135
|
+
handleChange?.(props.value);
|
|
28136
|
+
}
|
|
28137
|
+
}, []);
|
|
28005
28138
|
const handleChange = (value) => {
|
|
28006
28139
|
setDate(value);
|
|
28007
28140
|
if (value) {
|
|
@@ -28044,6 +28177,7 @@ var DateRange = ({ className, style, ...props }) => {
|
|
|
28044
28177
|
var DateRange_default = DateRange;
|
|
28045
28178
|
|
|
28046
28179
|
// src/components/Inputs/TextInputGroup/TextInputGroup.tsx
|
|
28180
|
+
import { useEffect as useEffect20 } from "react";
|
|
28047
28181
|
import { Fragment as Fragment16, jsx as jsx45, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
28048
28182
|
var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
28049
28183
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -28051,6 +28185,12 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28051
28185
|
const isDisabled = props.isDisabled ?? false;
|
|
28052
28186
|
const isReadonly = props.isReadonly ?? false;
|
|
28053
28187
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
28188
|
+
useEffect20(() => {
|
|
28189
|
+
if (props.value !== void 0) {
|
|
28190
|
+
const e = { target: { value: props.value } };
|
|
28191
|
+
handleChange?.(e);
|
|
28192
|
+
}
|
|
28193
|
+
}, []);
|
|
28054
28194
|
const handleChange = (e) => {
|
|
28055
28195
|
props.onChange?.(e);
|
|
28056
28196
|
};
|
|
@@ -28098,7 +28238,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28098
28238
|
var TextInputGroup_default = TextInputGroup;
|
|
28099
28239
|
|
|
28100
28240
|
// src/components/DataDisplay/Table/Table.tsx
|
|
28101
|
-
import { useState as
|
|
28241
|
+
import { useState as useState3, useEffect as useEffect21 } from "react";
|
|
28102
28242
|
|
|
28103
28243
|
// src/components/ui/data-table.tsx
|
|
28104
28244
|
import {
|
|
@@ -28485,9 +28625,9 @@ var Table4 = ({
|
|
|
28485
28625
|
const rawData = Array.isArray(data) ? data : [];
|
|
28486
28626
|
const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
|
|
28487
28627
|
const isControlled = typeof page === "number";
|
|
28488
|
-
const [internalPage, setInternalPage] =
|
|
28628
|
+
const [internalPage, setInternalPage] = useState3(1);
|
|
28489
28629
|
const currentPage = isControlled ? page : internalPage;
|
|
28490
|
-
|
|
28630
|
+
useEffect21(() => {
|
|
28491
28631
|
if (isControlled) return;
|
|
28492
28632
|
if (currentPage > 1 && !pagination) setInternalPage(1);
|
|
28493
28633
|
}, [pagination, isControlled]);
|
|
@@ -28617,23 +28757,22 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28617
28757
|
}
|
|
28618
28758
|
)
|
|
28619
28759
|
] });
|
|
28620
|
-
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
28621
|
-
const forceDesktop = canvasMode === "desktop";
|
|
28760
|
+
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
28761
|
+
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
28622
28762
|
return /* @__PURE__ */ jsxs30("div", { className, style, children: [
|
|
28623
|
-
forceDesktop && /* @__PURE__ */ jsx51("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx51("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
28624
|
-
forceMobile && /* @__PURE__ */ jsx51("div", { children: renderMobileMenu() }),
|
|
28625
|
-
/* @__PURE__ */ jsx51("div", { className: "md:hidden", children: renderMobileMenu() })
|
|
28763
|
+
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ jsx51("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx51("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ jsx51("div", { className: "hidden md:flex", children: /* @__PURE__ */ jsx51("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
28764
|
+
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ jsx51("div", { children: renderMobileMenu() }) : /* @__PURE__ */ jsx51("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
28626
28765
|
] });
|
|
28627
28766
|
};
|
|
28628
28767
|
var Tabs_default = Tabs;
|
|
28629
28768
|
|
|
28630
28769
|
// src/components/Navigation/Stages/Stages.tsx
|
|
28631
|
-
import
|
|
28770
|
+
import React6 from "react";
|
|
28632
28771
|
import { jsx as jsx52, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
28633
28772
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
|
|
28634
28773
|
return /* @__PURE__ */ jsx52("div", { className, style, children: /* @__PURE__ */ jsxs31("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
28635
28774
|
/* @__PURE__ */ jsx52("div", { className: "flex items-center", children: /* @__PURE__ */ jsx52("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ jsx52("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx52("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
28636
|
-
/* @__PURE__ */ jsx52("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs31(
|
|
28775
|
+
/* @__PURE__ */ jsx52("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ jsxs31(React6.Fragment, { children: [
|
|
28637
28776
|
/* @__PURE__ */ jsx52(
|
|
28638
28777
|
"button",
|
|
28639
28778
|
{
|
|
@@ -28665,10 +28804,10 @@ import { jsx as jsx55, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
|
28665
28804
|
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
28666
28805
|
|
|
28667
28806
|
// src/components/ui/avatar.tsx
|
|
28668
|
-
import * as
|
|
28807
|
+
import * as React7 from "react";
|
|
28669
28808
|
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
28670
28809
|
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
28671
|
-
var Avatar =
|
|
28810
|
+
var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
28672
28811
|
AvatarPrimitive.Root,
|
|
28673
28812
|
{
|
|
28674
28813
|
ref,
|
|
@@ -28680,7 +28819,7 @@ var Avatar = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
28680
28819
|
}
|
|
28681
28820
|
));
|
|
28682
28821
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
28683
|
-
var AvatarImage =
|
|
28822
|
+
var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
28684
28823
|
AvatarPrimitive.Image,
|
|
28685
28824
|
{
|
|
28686
28825
|
ref,
|
|
@@ -28689,7 +28828,7 @@ var AvatarImage = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
28689
28828
|
}
|
|
28690
28829
|
));
|
|
28691
28830
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
28692
|
-
var AvatarFallback =
|
|
28831
|
+
var AvatarFallback = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx57(
|
|
28693
28832
|
AvatarPrimitive.Fallback,
|
|
28694
28833
|
{
|
|
28695
28834
|
ref,
|