@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.d.mts
CHANGED
|
@@ -120,6 +120,8 @@ interface StagesProps extends ElementProps {
|
|
|
120
120
|
|
|
121
121
|
type ButtonProps = ElementProps & React.ComponentProps<"button"> & {
|
|
122
122
|
textContent?: string;
|
|
123
|
+
loading?: boolean;
|
|
124
|
+
loadingText?: string;
|
|
123
125
|
type?: 'button' | 'submit' | 'reset';
|
|
124
126
|
}
|
|
125
127
|
|
|
@@ -223,7 +225,7 @@ declare function TabList({ children, style, className, activeTab, tabId }: TabLi
|
|
|
223
225
|
|
|
224
226
|
declare function TabGroupComponent({ children, style, className, list, activeTab, onTabChange, }: TabGroupProps): react_jsx_runtime.JSX.Element;
|
|
225
227
|
|
|
226
|
-
declare const ButtonWrapper: ({ className, style, textContent, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
228
|
+
declare const ButtonWrapper: ({ className, style, textContent, loadingText, loading, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
227
229
|
|
|
228
230
|
declare const ImageControl: ({ className, style, imageUrl, imageUrlExternal, altText, }: ImageProps) => react_jsx_runtime.JSX.Element;
|
|
229
231
|
|
package/dist/index.d.ts
CHANGED
|
@@ -120,6 +120,8 @@ interface StagesProps extends ElementProps {
|
|
|
120
120
|
|
|
121
121
|
type ButtonProps = ElementProps & React.ComponentProps<"button"> & {
|
|
122
122
|
textContent?: string;
|
|
123
|
+
loading?: boolean;
|
|
124
|
+
loadingText?: string;
|
|
123
125
|
type?: 'button' | 'submit' | 'reset';
|
|
124
126
|
}
|
|
125
127
|
|
|
@@ -223,7 +225,7 @@ declare function TabList({ children, style, className, activeTab, tabId }: TabLi
|
|
|
223
225
|
|
|
224
226
|
declare function TabGroupComponent({ children, style, className, list, activeTab, onTabChange, }: TabGroupProps): react_jsx_runtime.JSX.Element;
|
|
225
227
|
|
|
226
|
-
declare const ButtonWrapper: ({ className, style, textContent, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
228
|
+
declare const ButtonWrapper: ({ className, style, textContent, loadingText, loading, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
227
229
|
|
|
228
230
|
declare const ImageControl: ({ className, style, imageUrl, imageUrlExternal, altText, }: ImageProps) => react_jsx_runtime.JSX.Element;
|
|
229
231
|
|
package/dist/index.js
CHANGED
|
@@ -333,6 +333,8 @@ var ButtonWrapper = ({
|
|
|
333
333
|
className,
|
|
334
334
|
style,
|
|
335
335
|
textContent = "Button",
|
|
336
|
+
loadingText = "Loading...",
|
|
337
|
+
loading = false,
|
|
336
338
|
...props
|
|
337
339
|
}) => {
|
|
338
340
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -341,7 +343,8 @@ var ButtonWrapper = ({
|
|
|
341
343
|
...props,
|
|
342
344
|
className,
|
|
343
345
|
style,
|
|
344
|
-
|
|
346
|
+
disabled: props.disabled || loading,
|
|
347
|
+
children: loading ? loadingText : textContent
|
|
345
348
|
}
|
|
346
349
|
);
|
|
347
350
|
};
|
|
@@ -26910,6 +26913,9 @@ var Icon2 = ({ iconType = "fontawesome", name = "Envelope", className, fontSize
|
|
|
26910
26913
|
};
|
|
26911
26914
|
var Icon_default = Icon2;
|
|
26912
26915
|
|
|
26916
|
+
// src/components/Inputs/TextInput/TextInput.tsx
|
|
26917
|
+
var import_react7 = require("react");
|
|
26918
|
+
|
|
26913
26919
|
// src/components/ui/input.tsx
|
|
26914
26920
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
26915
26921
|
function Input({ className, type, ...props }) {
|
|
@@ -26937,6 +26943,12 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
26937
26943
|
const isDisabled = props.isDisabled ?? false;
|
|
26938
26944
|
const isReadonly = props.isReadonly ?? false;
|
|
26939
26945
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
26946
|
+
(0, import_react7.useEffect)(() => {
|
|
26947
|
+
if (props.value !== void 0) {
|
|
26948
|
+
const e = { target: { value: props.value } };
|
|
26949
|
+
handleChange?.(e);
|
|
26950
|
+
}
|
|
26951
|
+
}, []);
|
|
26940
26952
|
const handleChange = (e) => {
|
|
26941
26953
|
props.onChange?.(e);
|
|
26942
26954
|
};
|
|
@@ -26965,6 +26977,7 @@ var TextInput = ({ className, style, ...props }) => {
|
|
|
26965
26977
|
var TextInput_default = TextInput;
|
|
26966
26978
|
|
|
26967
26979
|
// src/components/Inputs/NumberInput/NumberInput.tsx
|
|
26980
|
+
var import_react8 = require("react");
|
|
26968
26981
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
26969
26982
|
var NumberInput = ({ className, style, ...props }) => {
|
|
26970
26983
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -26972,6 +26985,12 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
26972
26985
|
const isDisabled = props.isDisabled ?? false;
|
|
26973
26986
|
const isReadonly = props.isReadonly ?? false;
|
|
26974
26987
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
26988
|
+
(0, import_react8.useEffect)(() => {
|
|
26989
|
+
if (props.value !== void 0) {
|
|
26990
|
+
const e = { target: { value: props.value } };
|
|
26991
|
+
handleChange?.(e);
|
|
26992
|
+
}
|
|
26993
|
+
}, []);
|
|
26975
26994
|
const handleChange = (e) => {
|
|
26976
26995
|
props.onChange?.(e);
|
|
26977
26996
|
};
|
|
@@ -27004,6 +27023,7 @@ var NumberInput = ({ className, style, ...props }) => {
|
|
|
27004
27023
|
var NumberInput_default = NumberInput;
|
|
27005
27024
|
|
|
27006
27025
|
// src/components/Inputs/EmailInput/EmailInput.tsx
|
|
27026
|
+
var import_react9 = require("react");
|
|
27007
27027
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
27008
27028
|
var EmailInput = ({ className, style, ...props }) => {
|
|
27009
27029
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -27011,6 +27031,12 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
27011
27031
|
const isDisabled = props.isDisabled ?? false;
|
|
27012
27032
|
const isReadonly = props.isReadonly ?? false;
|
|
27013
27033
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27034
|
+
(0, import_react9.useEffect)(() => {
|
|
27035
|
+
if (props.value !== void 0) {
|
|
27036
|
+
const e = { target: { value: props.value } };
|
|
27037
|
+
handleChange?.(e);
|
|
27038
|
+
}
|
|
27039
|
+
}, []);
|
|
27014
27040
|
const handleChange = (e) => {
|
|
27015
27041
|
props.onChange?.(e);
|
|
27016
27042
|
};
|
|
@@ -27042,6 +27068,7 @@ var EmailInput = ({ className, style, ...props }) => {
|
|
|
27042
27068
|
var EmailInput_default = EmailInput;
|
|
27043
27069
|
|
|
27044
27070
|
// src/components/Inputs/PasswordInput/PasswordInput.tsx
|
|
27071
|
+
var import_react10 = require("react");
|
|
27045
27072
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
27046
27073
|
var PasswordInput = ({ className, style, ...props }) => {
|
|
27047
27074
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -27049,6 +27076,12 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
27049
27076
|
const isDisabled = props.isDisabled ?? false;
|
|
27050
27077
|
const isReadonly = props.isReadonly ?? false;
|
|
27051
27078
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27079
|
+
(0, import_react10.useEffect)(() => {
|
|
27080
|
+
if (props.value !== void 0) {
|
|
27081
|
+
const e = { target: { value: props.value } };
|
|
27082
|
+
handleChange?.(e);
|
|
27083
|
+
}
|
|
27084
|
+
}, []);
|
|
27052
27085
|
const handleChange = (e) => {
|
|
27053
27086
|
props.onChange?.(e);
|
|
27054
27087
|
};
|
|
@@ -27080,6 +27113,9 @@ var PasswordInput = ({ className, style, ...props }) => {
|
|
|
27080
27113
|
};
|
|
27081
27114
|
var PasswordInput_default = PasswordInput;
|
|
27082
27115
|
|
|
27116
|
+
// src/components/Inputs/Textarea/Textarea.tsx
|
|
27117
|
+
var import_react11 = require("react");
|
|
27118
|
+
|
|
27083
27119
|
// src/components/ui/textarea.tsx
|
|
27084
27120
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
27085
27121
|
function Textarea({ className, ...props }) {
|
|
@@ -27104,6 +27140,12 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
27104
27140
|
const isDisabled = props.isDisabled ?? false;
|
|
27105
27141
|
const isReadonly = props.isReadonly ?? false;
|
|
27106
27142
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27143
|
+
(0, import_react11.useEffect)(() => {
|
|
27144
|
+
if (props.value !== void 0) {
|
|
27145
|
+
const e = { target: { value: props.value } };
|
|
27146
|
+
handleChange?.(e);
|
|
27147
|
+
}
|
|
27148
|
+
}, []);
|
|
27107
27149
|
const handleChange = (e) => {
|
|
27108
27150
|
props.onChange?.(e);
|
|
27109
27151
|
};
|
|
@@ -27132,6 +27174,7 @@ var Textarea2 = ({ className, style, ...props }) => {
|
|
|
27132
27174
|
var Textarea_default = Textarea2;
|
|
27133
27175
|
|
|
27134
27176
|
// src/components/Inputs/UrlInput/UrlInput.tsx
|
|
27177
|
+
var import_react12 = require("react");
|
|
27135
27178
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
27136
27179
|
var UrlInput = ({ className, style, ...props }) => {
|
|
27137
27180
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -27139,6 +27182,12 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
27139
27182
|
const isDisabled = props.isDisabled ?? false;
|
|
27140
27183
|
const isReadonly = props.isReadonly ?? false;
|
|
27141
27184
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27185
|
+
(0, import_react12.useEffect)(() => {
|
|
27186
|
+
if (props.value !== void 0) {
|
|
27187
|
+
const e = { target: { value: props.value } };
|
|
27188
|
+
handleChange?.(e);
|
|
27189
|
+
}
|
|
27190
|
+
}, []);
|
|
27142
27191
|
const handleChange = (e) => {
|
|
27143
27192
|
props.onChange?.(e);
|
|
27144
27193
|
};
|
|
@@ -27170,6 +27219,9 @@ var UrlInput = ({ className, style, ...props }) => {
|
|
|
27170
27219
|
};
|
|
27171
27220
|
var UrlInput_default = UrlInput;
|
|
27172
27221
|
|
|
27222
|
+
// src/components/Inputs/Checkbox/Checkbox.tsx
|
|
27223
|
+
var import_react13 = require("react");
|
|
27224
|
+
|
|
27173
27225
|
// src/components/ui/checkbox.tsx
|
|
27174
27226
|
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
27175
27227
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
@@ -27224,6 +27276,11 @@ var CheckboxInput = ({ className, style, ...props }) => {
|
|
|
27224
27276
|
const isEditable = props.isEditable ?? true;
|
|
27225
27277
|
const isDisabled = props.isDisabled ?? false;
|
|
27226
27278
|
const text = props.text ? props.text : "Subscribe";
|
|
27279
|
+
(0, import_react13.useEffect)(() => {
|
|
27280
|
+
if (props.value) {
|
|
27281
|
+
handleChange(props.value);
|
|
27282
|
+
}
|
|
27283
|
+
}, []);
|
|
27227
27284
|
const handleChange = (value) => {
|
|
27228
27285
|
props.onChange?.(value);
|
|
27229
27286
|
};
|
|
@@ -27245,6 +27302,9 @@ var CheckboxInput = ({ className, style, ...props }) => {
|
|
|
27245
27302
|
};
|
|
27246
27303
|
var Checkbox_default = CheckboxInput;
|
|
27247
27304
|
|
|
27305
|
+
// src/components/Inputs/RadioInput/RadioInput.tsx
|
|
27306
|
+
var import_react14 = require("react");
|
|
27307
|
+
|
|
27248
27308
|
// src/components/ui/radio-group.tsx
|
|
27249
27309
|
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"));
|
|
27250
27310
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
@@ -27303,6 +27363,11 @@ var RadioInput = ({
|
|
|
27303
27363
|
value: item[dataKey || "value"],
|
|
27304
27364
|
label: item[dataLabel || "label"]
|
|
27305
27365
|
}));
|
|
27366
|
+
(0, import_react14.useEffect)(() => {
|
|
27367
|
+
if (props.value !== void 0) {
|
|
27368
|
+
handleChange?.(props.value);
|
|
27369
|
+
}
|
|
27370
|
+
}, []);
|
|
27306
27371
|
const handleChange = (value) => {
|
|
27307
27372
|
onChange?.(value);
|
|
27308
27373
|
};
|
|
@@ -27328,7 +27393,7 @@ var RadioInput = ({
|
|
|
27328
27393
|
var RadioInput_default = RadioInput;
|
|
27329
27394
|
|
|
27330
27395
|
// src/components/Inputs/MultiCheckbox/MultiCheckbox.tsx
|
|
27331
|
-
var
|
|
27396
|
+
var import_react15 = require("react");
|
|
27332
27397
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
27333
27398
|
var MultiCheckbox = ({
|
|
27334
27399
|
className,
|
|
@@ -27342,12 +27407,17 @@ var MultiCheckbox = ({
|
|
|
27342
27407
|
isDisabled = false
|
|
27343
27408
|
}) => {
|
|
27344
27409
|
const list = Array.isArray(data) ? data : [];
|
|
27345
|
-
const [value, setValue] = (0,
|
|
27410
|
+
const [value, setValue] = (0, import_react15.useState)(propValue);
|
|
27346
27411
|
const options = (list || []).map((item) => ({
|
|
27347
27412
|
value: item[dataKey || "value"],
|
|
27348
27413
|
label: item[dataLabel || "label"]
|
|
27349
27414
|
}));
|
|
27350
|
-
|
|
27415
|
+
(0, import_react15.useEffect)(() => {
|
|
27416
|
+
if (propValue !== void 0) {
|
|
27417
|
+
onChange?.(propValue);
|
|
27418
|
+
}
|
|
27419
|
+
}, []);
|
|
27420
|
+
const handleChange = (0, import_react15.useCallback)(
|
|
27351
27421
|
(key, checked) => {
|
|
27352
27422
|
setValue((prev) => {
|
|
27353
27423
|
const newValue = { ...prev, [key]: checked };
|
|
@@ -27382,8 +27452,11 @@ var MultiCheckbox = ({
|
|
|
27382
27452
|
};
|
|
27383
27453
|
var MultiCheckbox_default = MultiCheckbox;
|
|
27384
27454
|
|
|
27455
|
+
// src/components/Inputs/RichText/RichText.tsx
|
|
27456
|
+
var import_react17 = require("react");
|
|
27457
|
+
|
|
27385
27458
|
// src/components/Global/TinyMceEditor.tsx
|
|
27386
|
-
var
|
|
27459
|
+
var import_react16 = require("react");
|
|
27387
27460
|
var import_tinymce_react = require("@tinymce/tinymce-react");
|
|
27388
27461
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
27389
27462
|
function MyEditor({
|
|
@@ -27391,7 +27464,7 @@ function MyEditor({
|
|
|
27391
27464
|
onChange,
|
|
27392
27465
|
isDefault
|
|
27393
27466
|
}) {
|
|
27394
|
-
const editorRef = (0,
|
|
27467
|
+
const editorRef = (0, import_react16.useRef)(null);
|
|
27395
27468
|
function stripOuterP(html) {
|
|
27396
27469
|
const trimmedHtml = html.trim();
|
|
27397
27470
|
if (!trimmedHtml) return "";
|
|
@@ -27403,7 +27476,7 @@ function MyEditor({
|
|
|
27403
27476
|
}
|
|
27404
27477
|
return trimmedHtml;
|
|
27405
27478
|
}
|
|
27406
|
-
const isDefaultToolbar = (0,
|
|
27479
|
+
const isDefaultToolbar = (0, import_react16.useMemo)(() => {
|
|
27407
27480
|
let toolbar = "undo redo | formatselect | bold italic forecolor";
|
|
27408
27481
|
if (isDefault) {
|
|
27409
27482
|
toolbar = "undo redo | blocks | bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help";
|
|
@@ -27456,6 +27529,14 @@ function MyEditor({
|
|
|
27456
27529
|
// src/components/Inputs/RichText/RichText.tsx
|
|
27457
27530
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
27458
27531
|
function RichText({ className, style, ...props }) {
|
|
27532
|
+
(0, import_react17.useEffect)(() => {
|
|
27533
|
+
if (props.value !== void 0) {
|
|
27534
|
+
handleChange?.(props.value);
|
|
27535
|
+
}
|
|
27536
|
+
}, []);
|
|
27537
|
+
const handleChange = (content) => {
|
|
27538
|
+
props.onChange?.(content);
|
|
27539
|
+
};
|
|
27459
27540
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
27460
27541
|
"div",
|
|
27461
27542
|
{
|
|
@@ -27465,13 +27546,16 @@ function RichText({ className, style, ...props }) {
|
|
|
27465
27546
|
borderColor: props.errorMessage ? "#f87171" : style?.borderColor
|
|
27466
27547
|
},
|
|
27467
27548
|
children: [
|
|
27468
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MyEditor, { onChange:
|
|
27549
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MyEditor, { onChange: handleChange, value: props.value || "", isDefault: true }),
|
|
27469
27550
|
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
27470
27551
|
]
|
|
27471
27552
|
}
|
|
27472
27553
|
);
|
|
27473
27554
|
}
|
|
27474
27555
|
|
|
27556
|
+
// src/components/Inputs/Dropdown/Dropdown.tsx
|
|
27557
|
+
var import_react18 = require("react");
|
|
27558
|
+
|
|
27475
27559
|
// src/components/ui/select.tsx
|
|
27476
27560
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
27477
27561
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
@@ -27606,6 +27690,11 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
27606
27690
|
const isEditable = props.isEditable ?? true;
|
|
27607
27691
|
const isDisabled = props.isDisabled ?? false;
|
|
27608
27692
|
const isReadonly = props.isReadonly ?? false;
|
|
27693
|
+
(0, import_react18.useEffect)(() => {
|
|
27694
|
+
if (props.value !== void 0) {
|
|
27695
|
+
handleChange(props.value);
|
|
27696
|
+
}
|
|
27697
|
+
}, []);
|
|
27609
27698
|
const handleChange = (value) => {
|
|
27610
27699
|
props.onChange?.(value);
|
|
27611
27700
|
};
|
|
@@ -27641,6 +27730,9 @@ var Dropdown = ({ className, style, ...props }) => {
|
|
|
27641
27730
|
};
|
|
27642
27731
|
var Dropdown_default = Dropdown;
|
|
27643
27732
|
|
|
27733
|
+
// src/components/Inputs/SwitchToggle/SwitchToggle.tsx
|
|
27734
|
+
var import_react19 = require("react");
|
|
27735
|
+
|
|
27644
27736
|
// src/components/ui/switch.tsx
|
|
27645
27737
|
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
27646
27738
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
@@ -27675,6 +27767,11 @@ var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
|
27675
27767
|
var SwitchToggle = ({ className, style, ...props }) => {
|
|
27676
27768
|
const isEditable = props.isEditable ?? true;
|
|
27677
27769
|
const isDisabled = props.isDisabled ?? false;
|
|
27770
|
+
(0, import_react19.useEffect)(() => {
|
|
27771
|
+
if (props.value !== void 0) {
|
|
27772
|
+
handleChange?.(props.value);
|
|
27773
|
+
}
|
|
27774
|
+
}, []);
|
|
27678
27775
|
const handleChange = (value) => {
|
|
27679
27776
|
props.onChange?.(value);
|
|
27680
27777
|
};
|
|
@@ -27697,6 +27794,7 @@ var SwitchToggle = ({ className, style, ...props }) => {
|
|
|
27697
27794
|
var SwitchToggle_default = SwitchToggle;
|
|
27698
27795
|
|
|
27699
27796
|
// src/components/Inputs/PhoneInput/PhoneInput.tsx
|
|
27797
|
+
var import_react20 = require("react");
|
|
27700
27798
|
var import_react_international_phone = require("react-international-phone");
|
|
27701
27799
|
var import_style = require("react-international-phone/style.css");
|
|
27702
27800
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
@@ -27704,6 +27802,11 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
27704
27802
|
const placeholder = props.placeholder ?? "Enter phone number";
|
|
27705
27803
|
const isEditable = props.isEditable ?? true;
|
|
27706
27804
|
const isDisabled = props.isDisabled ?? false;
|
|
27805
|
+
(0, import_react20.useEffect)(() => {
|
|
27806
|
+
if (props.value !== void 0) {
|
|
27807
|
+
handleChange?.(props.value);
|
|
27808
|
+
}
|
|
27809
|
+
}, []);
|
|
27707
27810
|
const handleChange = (val) => {
|
|
27708
27811
|
props.onChange?.(val);
|
|
27709
27812
|
};
|
|
@@ -27738,6 +27841,7 @@ var PhoneInput = ({ className, style, ...props }) => {
|
|
|
27738
27841
|
var PhoneInput_default = PhoneInput;
|
|
27739
27842
|
|
|
27740
27843
|
// src/components/Inputs/SearchInput/SearchInput.tsx
|
|
27844
|
+
var import_react21 = require("react");
|
|
27741
27845
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
27742
27846
|
var SearchInput = ({ className, style, ...props }) => {
|
|
27743
27847
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -27745,6 +27849,12 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
27745
27849
|
const isDisabled = props.isDisabled ?? false;
|
|
27746
27850
|
const isReadonly = props.isReadonly ?? false;
|
|
27747
27851
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
27852
|
+
(0, import_react21.useEffect)(() => {
|
|
27853
|
+
if (props.value !== void 0) {
|
|
27854
|
+
const e = { target: { value: props.value } };
|
|
27855
|
+
handleChange?.(e);
|
|
27856
|
+
}
|
|
27857
|
+
}, []);
|
|
27748
27858
|
const handleChange = (e) => {
|
|
27749
27859
|
props.onChange?.(e);
|
|
27750
27860
|
};
|
|
@@ -27777,9 +27887,19 @@ var SearchInput = ({ className, style, ...props }) => {
|
|
|
27777
27887
|
var SearchInput_default = SearchInput;
|
|
27778
27888
|
|
|
27779
27889
|
// src/components/Inputs/FileInput/FileInput.tsx
|
|
27890
|
+
var import_react22 = require("react");
|
|
27780
27891
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
27781
27892
|
var FileInput2 = ({ className, style, ...props }) => {
|
|
27782
27893
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
27894
|
+
(0, import_react22.useEffect)(() => {
|
|
27895
|
+
if (props.value !== void 0) {
|
|
27896
|
+
const e = { target: { value: props.value } };
|
|
27897
|
+
handleChange?.(e);
|
|
27898
|
+
}
|
|
27899
|
+
}, []);
|
|
27900
|
+
const handleChange = (e) => {
|
|
27901
|
+
props.onChange?.(e);
|
|
27902
|
+
};
|
|
27783
27903
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "d-flex items-center relative align-middle", children: [
|
|
27784
27904
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
27785
27905
|
Input,
|
|
@@ -27795,9 +27915,7 @@ var FileInput2 = ({ className, style, ...props }) => {
|
|
|
27795
27915
|
},
|
|
27796
27916
|
autoComplete: "off",
|
|
27797
27917
|
placeholder,
|
|
27798
|
-
onChange:
|
|
27799
|
-
props.onChange?.(e);
|
|
27800
|
-
}
|
|
27918
|
+
onChange: handleChange
|
|
27801
27919
|
}
|
|
27802
27920
|
),
|
|
27803
27921
|
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "mt-1 text-xs text-red-500", children: props.errorMessage })
|
|
@@ -27806,6 +27924,7 @@ var FileInput2 = ({ className, style, ...props }) => {
|
|
|
27806
27924
|
var FileInput_default = FileInput2;
|
|
27807
27925
|
|
|
27808
27926
|
// src/components/Inputs/DatePicker/DatePicker.tsx
|
|
27927
|
+
var import_react23 = require("react");
|
|
27809
27928
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
27810
27929
|
function DatePicker({ className, style, ...props }) {
|
|
27811
27930
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -27831,9 +27950,18 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27831
27950
|
};
|
|
27832
27951
|
const minDate = resolveDate(minimumDate, customMinimumDate);
|
|
27833
27952
|
const maxDate = resolveDate(maximumDate, customMaximumDate);
|
|
27953
|
+
(0, import_react23.useEffect)(() => {
|
|
27954
|
+
if (props.value !== void 0) {
|
|
27955
|
+
handleChange(props.value);
|
|
27956
|
+
}
|
|
27957
|
+
}, []);
|
|
27834
27958
|
const handleChange = (e) => {
|
|
27835
27959
|
props.onChange?.(e);
|
|
27836
27960
|
};
|
|
27961
|
+
const toDateInputValue = (value) => {
|
|
27962
|
+
if (!value) return "";
|
|
27963
|
+
return new Date(value).toISOString().split("T")[0];
|
|
27964
|
+
};
|
|
27837
27965
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
27838
27966
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex justify-start items-center relative", children: [
|
|
27839
27967
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Calendar, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[#BDBDBD]" }),
|
|
@@ -27846,7 +27974,7 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27846
27974
|
onChange: handleChange,
|
|
27847
27975
|
disabled: isDisabled || !isEditable,
|
|
27848
27976
|
name: props.name,
|
|
27849
|
-
value: props.value
|
|
27977
|
+
value: toDateInputValue(props.value),
|
|
27850
27978
|
className: cn(
|
|
27851
27979
|
className,
|
|
27852
27980
|
props.errorMessage ? "border-red-500" : "",
|
|
@@ -27868,11 +27996,11 @@ function DatePicker({ className, style, ...props }) {
|
|
|
27868
27996
|
}
|
|
27869
27997
|
|
|
27870
27998
|
// src/components/Inputs/DateRange/DateRange.tsx
|
|
27871
|
-
var
|
|
27999
|
+
var import_react24 = __toESM(require("react"));
|
|
27872
28000
|
var import_date_fns = require("date-fns");
|
|
27873
28001
|
|
|
27874
28002
|
// src/components/ui/calendar.tsx
|
|
27875
|
-
var
|
|
28003
|
+
var React4 = __toESM(require("react"));
|
|
27876
28004
|
var import_react_day_picker = require("react-day-picker");
|
|
27877
28005
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
27878
28006
|
function Calendar2({
|
|
@@ -28027,8 +28155,8 @@ function CalendarDayButton({
|
|
|
28027
28155
|
...props
|
|
28028
28156
|
}) {
|
|
28029
28157
|
const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
|
|
28030
|
-
const ref =
|
|
28031
|
-
|
|
28158
|
+
const ref = React4.useRef(null);
|
|
28159
|
+
React4.useEffect(() => {
|
|
28032
28160
|
if (modifiers.focused) ref.current?.focus();
|
|
28033
28161
|
}, [modifiers.focused]);
|
|
28034
28162
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
@@ -28090,12 +28218,17 @@ function PopoverContent({
|
|
|
28090
28218
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
28091
28219
|
var DateRange = ({ className, style, ...props }) => {
|
|
28092
28220
|
const isDateRange = (val) => !!val && val.from instanceof Date;
|
|
28093
|
-
const [date, setDate] =
|
|
28221
|
+
const [date, setDate] = import_react24.default.useState(
|
|
28094
28222
|
isDateRange(props.value) ? props.value : {
|
|
28095
28223
|
from: /* @__PURE__ */ new Date(),
|
|
28096
28224
|
to: (0, import_date_fns.addDays)(/* @__PURE__ */ new Date(), 7)
|
|
28097
28225
|
}
|
|
28098
28226
|
);
|
|
28227
|
+
(0, import_react24.useEffect)(() => {
|
|
28228
|
+
if (props.value && isDateRange(props.value)) {
|
|
28229
|
+
handleChange?.(props.value);
|
|
28230
|
+
}
|
|
28231
|
+
}, []);
|
|
28099
28232
|
const handleChange = (value) => {
|
|
28100
28233
|
setDate(value);
|
|
28101
28234
|
if (value) {
|
|
@@ -28138,6 +28271,7 @@ var DateRange = ({ className, style, ...props }) => {
|
|
|
28138
28271
|
var DateRange_default = DateRange;
|
|
28139
28272
|
|
|
28140
28273
|
// src/components/Inputs/TextInputGroup/TextInputGroup.tsx
|
|
28274
|
+
var import_react25 = require("react");
|
|
28141
28275
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
28142
28276
|
var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
28143
28277
|
const placeholder = props.placeholder ?? "Placeholder text";
|
|
@@ -28145,6 +28279,12 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28145
28279
|
const isDisabled = props.isDisabled ?? false;
|
|
28146
28280
|
const isReadonly = props.isReadonly ?? false;
|
|
28147
28281
|
const isAutocomplete = props.isAutocomplete ?? false;
|
|
28282
|
+
(0, import_react25.useEffect)(() => {
|
|
28283
|
+
if (props.value !== void 0) {
|
|
28284
|
+
const e = { target: { value: props.value } };
|
|
28285
|
+
handleChange?.(e);
|
|
28286
|
+
}
|
|
28287
|
+
}, []);
|
|
28148
28288
|
const handleChange = (e) => {
|
|
28149
28289
|
props.onChange?.(e);
|
|
28150
28290
|
};
|
|
@@ -28192,7 +28332,7 @@ var TextInputGroup = ({ className, style, prepend, append, ...props }) => {
|
|
|
28192
28332
|
var TextInputGroup_default = TextInputGroup;
|
|
28193
28333
|
|
|
28194
28334
|
// src/components/DataDisplay/Table/Table.tsx
|
|
28195
|
-
var
|
|
28335
|
+
var import_react26 = require("react");
|
|
28196
28336
|
|
|
28197
28337
|
// src/components/ui/data-table.tsx
|
|
28198
28338
|
var import_react_table = require("@tanstack/react-table");
|
|
@@ -28575,9 +28715,9 @@ var Table4 = ({
|
|
|
28575
28715
|
const rawData = Array.isArray(data) ? data : [];
|
|
28576
28716
|
const rawRowActions = Array.isArray(rowActions) ? rowActions : [];
|
|
28577
28717
|
const isControlled = typeof page === "number";
|
|
28578
|
-
const [internalPage, setInternalPage] = (0,
|
|
28718
|
+
const [internalPage, setInternalPage] = (0, import_react26.useState)(1);
|
|
28579
28719
|
const currentPage = isControlled ? page : internalPage;
|
|
28580
|
-
(0,
|
|
28720
|
+
(0, import_react26.useEffect)(() => {
|
|
28581
28721
|
if (isControlled) return;
|
|
28582
28722
|
if (currentPage > 1 && !pagination) setInternalPage(1);
|
|
28583
28723
|
}, [pagination, isControlled]);
|
|
@@ -28707,23 +28847,22 @@ var Tabs = ({ className, style, tabs, verticalMenu, pathname, canvasMode }) => {
|
|
|
28707
28847
|
}
|
|
28708
28848
|
)
|
|
28709
28849
|
] });
|
|
28710
|
-
const forceMobile = canvasMode === "mobile" || canvasMode === "tablet";
|
|
28711
|
-
const forceDesktop = canvasMode === "desktop";
|
|
28850
|
+
const forceMobile = canvasMode ? canvasMode === "mobile" || canvasMode === "tablet" : void 0;
|
|
28851
|
+
const forceDesktop = canvasMode ? canvasMode === "desktop" : void 0;
|
|
28712
28852
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className, style, children: [
|
|
28713
|
-
forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
28714
|
-
forceMobile && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: renderMobileMenu() }),
|
|
28715
|
-
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "md:hidden", children: renderMobileMenu() })
|
|
28853
|
+
forceDesktop !== void 0 ? forceDesktop && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "hidden md:flex", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: `flex gap-2 ${verticalMenu ? "flex-col items-start" : "flex-row"}`, children: rawTabs.map(renderDesktopTab) }) }),
|
|
28854
|
+
forceMobile !== void 0 ? forceMobile && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { children: renderMobileMenu() }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex md:hidden", children: renderMobileMenu() })
|
|
28716
28855
|
] });
|
|
28717
28856
|
};
|
|
28718
28857
|
var Tabs_default = Tabs;
|
|
28719
28858
|
|
|
28720
28859
|
// src/components/Navigation/Stages/Stages.tsx
|
|
28721
|
-
var
|
|
28860
|
+
var import_react27 = __toESM(require("react"));
|
|
28722
28861
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
28723
28862
|
var StagesComponent = ({ stages, isShowBtn, buttonText, className, style }) => {
|
|
28724
28863
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex items-center justify-between bg-red p-2 rounded-lg border border-gray-200 w-full", children: [
|
|
28725
28864
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("button", { className: "p-2 hover:bg-gray-100 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("svg", { className: "w-4 h-4 text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) }) }) }),
|
|
28726
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
28865
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex items-center flex-1 px-2 flex-wrap gap-2", children: stages?.length > 0 && stages?.map((stage, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_react27.default.Fragment, { children: [
|
|
28727
28866
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
28728
28867
|
"button",
|
|
28729
28868
|
{
|
|
@@ -28755,10 +28894,10 @@ var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
|
28755
28894
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
28756
28895
|
|
|
28757
28896
|
// src/components/ui/avatar.tsx
|
|
28758
|
-
var
|
|
28897
|
+
var React7 = __toESM(require("react"));
|
|
28759
28898
|
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
28760
28899
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
28761
|
-
var Avatar =
|
|
28900
|
+
var Avatar = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
28762
28901
|
AvatarPrimitive.Root,
|
|
28763
28902
|
{
|
|
28764
28903
|
ref,
|
|
@@ -28770,7 +28909,7 @@ var Avatar = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
28770
28909
|
}
|
|
28771
28910
|
));
|
|
28772
28911
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
28773
|
-
var AvatarImage =
|
|
28912
|
+
var AvatarImage = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
28774
28913
|
AvatarPrimitive.Image,
|
|
28775
28914
|
{
|
|
28776
28915
|
ref,
|
|
@@ -28779,7 +28918,7 @@ var AvatarImage = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
28779
28918
|
}
|
|
28780
28919
|
));
|
|
28781
28920
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
28782
|
-
var AvatarFallback =
|
|
28921
|
+
var AvatarFallback = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
28783
28922
|
AvatarPrimitive.Fallback,
|
|
28784
28923
|
{
|
|
28785
28924
|
ref,
|