@undefine-ui/design-system 2.11.0 → 2.13.0
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/README.md +124 -7
- package/dist/index.cjs +465 -176
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +182 -2
- package/dist/index.d.ts +182 -2
- package/dist/index.js +457 -171
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -44,6 +44,7 @@ __export(index_exports, {
|
|
|
44
44
|
Field: () => Field,
|
|
45
45
|
Form: () => Form,
|
|
46
46
|
Icon: () => Icon,
|
|
47
|
+
Image: () => Image,
|
|
47
48
|
InfoCircleFill: () => InfoCircleFill,
|
|
48
49
|
InfoCircleOutline: () => InfoCircleOutline,
|
|
49
50
|
KeyCommand: () => KeyCommand,
|
|
@@ -157,6 +158,8 @@ __export(index_exports, {
|
|
|
157
158
|
updateCoreWithSettings: () => updateCoreWithSettings,
|
|
158
159
|
useBoolean: () => useBoolean,
|
|
159
160
|
useCopyToClipboard: () => useCopyToClipboard,
|
|
161
|
+
useCountdownDate: () => useCountdownDate,
|
|
162
|
+
useCountdownSeconds: () => useCountdownSeconds,
|
|
160
163
|
useEventListener: () => useEventListener,
|
|
161
164
|
useLocalStorage: () => useLocalStorage,
|
|
162
165
|
usePopover: () => usePopover,
|
|
@@ -788,13 +791,89 @@ var useSetState = (initialState) => {
|
|
|
788
791
|
return memoizedValue;
|
|
789
792
|
};
|
|
790
793
|
|
|
791
|
-
// src/hooks/
|
|
794
|
+
// src/hooks/useCountdown.tsx
|
|
792
795
|
var import_react7 = require("react");
|
|
796
|
+
var useCountdownDate = (date) => {
|
|
797
|
+
const targetTime = typeof date === "number" ? date : typeof date === "string" ? new Date(date).valueOf() : date.valueOf();
|
|
798
|
+
const [countdown, setCountdown] = (0, import_react7.useState)({
|
|
799
|
+
days: "00",
|
|
800
|
+
hours: "00",
|
|
801
|
+
minutes: "00",
|
|
802
|
+
seconds: "00"
|
|
803
|
+
});
|
|
804
|
+
const setNewTime = (0, import_react7.useCallback)(() => {
|
|
805
|
+
const now = Date.now();
|
|
806
|
+
const distanceToNow = targetTime - now;
|
|
807
|
+
if (distanceToNow <= 0) {
|
|
808
|
+
setCountdown({
|
|
809
|
+
days: "00",
|
|
810
|
+
hours: "00",
|
|
811
|
+
minutes: "00",
|
|
812
|
+
seconds: "00"
|
|
813
|
+
});
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
const getDays = Math.floor(distanceToNow / (1e3 * 60 * 60 * 24));
|
|
817
|
+
const getHours = `0${Math.floor(distanceToNow % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60))}`.slice(-2);
|
|
818
|
+
const getMinutes = `0${Math.floor(distanceToNow % (1e3 * 60 * 60) / (1e3 * 60))}`.slice(-2);
|
|
819
|
+
const getSeconds = `0${Math.floor(distanceToNow % (1e3 * 60) / 1e3)}`.slice(-2);
|
|
820
|
+
setCountdown({
|
|
821
|
+
days: getDays < 10 ? `0${getDays}` : `${getDays}`,
|
|
822
|
+
hours: getHours,
|
|
823
|
+
minutes: getMinutes,
|
|
824
|
+
seconds: getSeconds
|
|
825
|
+
});
|
|
826
|
+
}, [targetTime]);
|
|
827
|
+
(0, import_react7.useEffect)(() => {
|
|
828
|
+
setNewTime();
|
|
829
|
+
const interval = setInterval(setNewTime, 1e3);
|
|
830
|
+
return () => clearInterval(interval);
|
|
831
|
+
}, [setNewTime]);
|
|
832
|
+
return countdown;
|
|
833
|
+
};
|
|
834
|
+
var useCountdownSeconds = (initCountdown) => {
|
|
835
|
+
const [countdown, setCountdown] = (0, import_react7.useState)(initCountdown);
|
|
836
|
+
const intervalIdRef = (0, import_react7.useRef)(null);
|
|
837
|
+
const remainingSecondsRef = (0, import_react7.useRef)(initCountdown);
|
|
838
|
+
const startCountdown = (0, import_react7.useCallback)(() => {
|
|
839
|
+
if (intervalIdRef.current) {
|
|
840
|
+
clearInterval(intervalIdRef.current);
|
|
841
|
+
}
|
|
842
|
+
remainingSecondsRef.current = initCountdown;
|
|
843
|
+
setCountdown(initCountdown);
|
|
844
|
+
intervalIdRef.current = setInterval(() => {
|
|
845
|
+
remainingSecondsRef.current -= 1;
|
|
846
|
+
if (remainingSecondsRef.current <= 0) {
|
|
847
|
+
if (intervalIdRef.current) clearInterval(intervalIdRef.current);
|
|
848
|
+
setCountdown(0);
|
|
849
|
+
} else {
|
|
850
|
+
setCountdown(remainingSecondsRef.current);
|
|
851
|
+
}
|
|
852
|
+
}, 1e3);
|
|
853
|
+
}, [initCountdown]);
|
|
854
|
+
(0, import_react7.useEffect)(() => {
|
|
855
|
+
return () => {
|
|
856
|
+
if (intervalIdRef.current) {
|
|
857
|
+
clearInterval(intervalIdRef.current);
|
|
858
|
+
}
|
|
859
|
+
};
|
|
860
|
+
}, []);
|
|
861
|
+
const counting = countdown > 0 && countdown < initCountdown;
|
|
862
|
+
return {
|
|
863
|
+
counting,
|
|
864
|
+
countdown,
|
|
865
|
+
startCountdown,
|
|
866
|
+
setCountdown
|
|
867
|
+
};
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
// src/hooks/useResponsive.ts
|
|
871
|
+
var import_react8 = require("react");
|
|
793
872
|
var import_useMediaQuery = __toESM(require("@mui/material/useMediaQuery"), 1);
|
|
794
873
|
var import_styles = require("@mui/material/styles");
|
|
795
874
|
var useResponsive = (query, start, end) => {
|
|
796
875
|
const theme = (0, import_styles.useTheme)();
|
|
797
|
-
const getQuery = (0,
|
|
876
|
+
const getQuery = (0, import_react8.useMemo)(() => {
|
|
798
877
|
switch (query) {
|
|
799
878
|
case "up":
|
|
800
879
|
return theme.breakpoints.up(start);
|
|
@@ -813,7 +892,7 @@ var useResponsive = (query, start, end) => {
|
|
|
813
892
|
};
|
|
814
893
|
var useWidth = () => {
|
|
815
894
|
const theme = (0, import_styles.useTheme)();
|
|
816
|
-
const keys = (0,
|
|
895
|
+
const keys = (0, import_react8.useMemo)(() => [...theme.breakpoints.keys].reverse(), [theme]);
|
|
817
896
|
const width = keys.reduce((output, key) => {
|
|
818
897
|
const matches = (0, import_useMediaQuery.default)(theme.breakpoints.up(key));
|
|
819
898
|
return !output && matches ? key : output;
|
|
@@ -822,19 +901,19 @@ var useWidth = () => {
|
|
|
822
901
|
};
|
|
823
902
|
|
|
824
903
|
// src/hooks/useEventListener.ts
|
|
825
|
-
var
|
|
826
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
904
|
+
var import_react9 = require("react");
|
|
905
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react9.useLayoutEffect : import_react9.useEffect;
|
|
827
906
|
var useEventListener = ({
|
|
828
907
|
eventName,
|
|
829
908
|
handler,
|
|
830
909
|
element,
|
|
831
910
|
options
|
|
832
911
|
}) => {
|
|
833
|
-
const savedHandler = (0,
|
|
912
|
+
const savedHandler = (0, import_react9.useRef)(handler);
|
|
834
913
|
useIsomorphicLayoutEffect(() => {
|
|
835
914
|
savedHandler.current = handler;
|
|
836
915
|
}, [handler]);
|
|
837
|
-
(0,
|
|
916
|
+
(0, import_react9.useEffect)(() => {
|
|
838
917
|
const targetElement = element?.current || window;
|
|
839
918
|
if (!(targetElement && targetElement.addEventListener)) {
|
|
840
919
|
return;
|
|
@@ -848,11 +927,11 @@ var useEventListener = ({
|
|
|
848
927
|
};
|
|
849
928
|
|
|
850
929
|
// src/hooks/useCopyToClipboard.ts
|
|
851
|
-
var
|
|
930
|
+
var import_react10 = require("react");
|
|
852
931
|
var useCopyToClipboard = () => {
|
|
853
|
-
const [copiedText, setCopiedText] = (0,
|
|
854
|
-
const [isCopied, setIsCopied] = (0,
|
|
855
|
-
const copy = (0,
|
|
932
|
+
const [copiedText, setCopiedText] = (0, import_react10.useState)("");
|
|
933
|
+
const [isCopied, setIsCopied] = (0, import_react10.useState)(false);
|
|
934
|
+
const copy = (0, import_react10.useCallback)(
|
|
856
935
|
async (text2) => {
|
|
857
936
|
if (!navigator?.clipboard) {
|
|
858
937
|
console.warn("Clipboard not supported");
|
|
@@ -872,7 +951,7 @@ var useCopyToClipboard = () => {
|
|
|
872
951
|
},
|
|
873
952
|
[setCopiedText]
|
|
874
953
|
);
|
|
875
|
-
const memoizedValue = (0,
|
|
954
|
+
const memoizedValue = (0, import_react10.useMemo)(
|
|
876
955
|
() => ({ copy, copiedText, isCopied }),
|
|
877
956
|
[copy, copiedText, isCopied]
|
|
878
957
|
);
|
|
@@ -880,11 +959,11 @@ var useCopyToClipboard = () => {
|
|
|
880
959
|
};
|
|
881
960
|
|
|
882
961
|
// src/hooks/useScrollOffsetTop.ts
|
|
883
|
-
var
|
|
962
|
+
var import_react11 = require("react");
|
|
884
963
|
var useScrollOffSetTop = (top = 0) => {
|
|
885
|
-
const elementRef = (0,
|
|
886
|
-
const [offsetTop, setOffsetTop] = (0,
|
|
887
|
-
const handleScrollChange = (0,
|
|
964
|
+
const elementRef = (0, import_react11.useRef)(null);
|
|
965
|
+
const [offsetTop, setOffsetTop] = (0, import_react11.useState)(false);
|
|
966
|
+
const handleScrollChange = (0, import_react11.useCallback)(() => {
|
|
888
967
|
const scrollHeight = Math.round(window.scrollY);
|
|
889
968
|
if (elementRef?.current) {
|
|
890
969
|
const rect = elementRef.current.getBoundingClientRect();
|
|
@@ -894,14 +973,14 @@ var useScrollOffSetTop = (top = 0) => {
|
|
|
894
973
|
setOffsetTop(scrollHeight > top);
|
|
895
974
|
}
|
|
896
975
|
}, [top]);
|
|
897
|
-
(0,
|
|
976
|
+
(0, import_react11.useEffect)(() => {
|
|
898
977
|
handleScrollChange();
|
|
899
978
|
window.addEventListener("scroll", handleScrollChange, { passive: true });
|
|
900
979
|
return () => {
|
|
901
980
|
window.removeEventListener("scroll", handleScrollChange);
|
|
902
981
|
};
|
|
903
982
|
}, [handleScrollChange]);
|
|
904
|
-
const memoizedValue = (0,
|
|
983
|
+
const memoizedValue = (0, import_react11.useMemo)(() => ({ elementRef, offsetTop }), [offsetTop]);
|
|
905
984
|
return memoizedValue;
|
|
906
985
|
};
|
|
907
986
|
|
|
@@ -6139,20 +6218,226 @@ var Table = (props) => {
|
|
|
6139
6218
|
) });
|
|
6140
6219
|
};
|
|
6141
6220
|
|
|
6221
|
+
// src/components/Image/index.tsx
|
|
6222
|
+
var import_react12 = require("react");
|
|
6223
|
+
var import_Box5 = __toESM(require("@mui/material/Box"), 1);
|
|
6224
|
+
var import_Skeleton = __toESM(require("@mui/material/Skeleton"), 1);
|
|
6225
|
+
|
|
6226
|
+
// src/components/Image/classes.ts
|
|
6227
|
+
var imageClasses = {
|
|
6228
|
+
root: "undefine__image__root",
|
|
6229
|
+
wrapper: "undefine__image__wrapper",
|
|
6230
|
+
overlay: "undefine__image__overlay"
|
|
6231
|
+
};
|
|
6232
|
+
|
|
6233
|
+
// src/components/Image/index.tsx
|
|
6234
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
6235
|
+
var Image = (0, import_react12.forwardRef)(function Image2(props, ref) {
|
|
6236
|
+
const {
|
|
6237
|
+
src,
|
|
6238
|
+
alt,
|
|
6239
|
+
lazy = true,
|
|
6240
|
+
fallbackSrc,
|
|
6241
|
+
srcSet,
|
|
6242
|
+
sizes: sizes2,
|
|
6243
|
+
aspectRatio,
|
|
6244
|
+
fit = "cover",
|
|
6245
|
+
position = "center",
|
|
6246
|
+
overlay,
|
|
6247
|
+
withOverlay = !!overlay,
|
|
6248
|
+
loadingIndicator,
|
|
6249
|
+
renderError,
|
|
6250
|
+
observerMargin = "200px",
|
|
6251
|
+
className,
|
|
6252
|
+
sx,
|
|
6253
|
+
onLoad,
|
|
6254
|
+
onError,
|
|
6255
|
+
imgSx,
|
|
6256
|
+
imgProps,
|
|
6257
|
+
...rest
|
|
6258
|
+
} = props;
|
|
6259
|
+
const imageRef = (0, import_react12.useRef)(null);
|
|
6260
|
+
const [status, setStatus] = (0, import_react12.useState)(lazy ? "idle" : "loading");
|
|
6261
|
+
const [currentSrc, setCurrentSrc] = (0, import_react12.useState)(lazy ? void 0 : src);
|
|
6262
|
+
const [currentSrcSet, setCurrentSrcSet] = (0, import_react12.useState)(lazy ? void 0 : srcSet);
|
|
6263
|
+
const [hasTriedFallback, setHasTriedFallback] = (0, import_react12.useState)(false);
|
|
6264
|
+
const setRefs = (node) => {
|
|
6265
|
+
imageRef.current = node;
|
|
6266
|
+
if (typeof ref === "function") {
|
|
6267
|
+
ref(node);
|
|
6268
|
+
} else if (ref) {
|
|
6269
|
+
ref.current = node;
|
|
6270
|
+
}
|
|
6271
|
+
};
|
|
6272
|
+
(0, import_react12.useEffect)(() => {
|
|
6273
|
+
setStatus(lazy ? "idle" : "loading");
|
|
6274
|
+
setCurrentSrc(lazy ? void 0 : src);
|
|
6275
|
+
setCurrentSrcSet(lazy ? void 0 : srcSet);
|
|
6276
|
+
setHasTriedFallback(false);
|
|
6277
|
+
}, [lazy, src, srcSet]);
|
|
6278
|
+
(0, import_react12.useEffect)(() => {
|
|
6279
|
+
if (!lazy) {
|
|
6280
|
+
return;
|
|
6281
|
+
}
|
|
6282
|
+
if (typeof IntersectionObserver === "undefined") {
|
|
6283
|
+
setCurrentSrc(src);
|
|
6284
|
+
setCurrentSrcSet(srcSet);
|
|
6285
|
+
setStatus("loading");
|
|
6286
|
+
return;
|
|
6287
|
+
}
|
|
6288
|
+
const target = imageRef.current;
|
|
6289
|
+
if (!target) {
|
|
6290
|
+
return;
|
|
6291
|
+
}
|
|
6292
|
+
const observer = new IntersectionObserver(
|
|
6293
|
+
(entries) => {
|
|
6294
|
+
entries.forEach((entry) => {
|
|
6295
|
+
if (entry.isIntersecting) {
|
|
6296
|
+
setCurrentSrc(src);
|
|
6297
|
+
setCurrentSrcSet(srcSet);
|
|
6298
|
+
setStatus("loading");
|
|
6299
|
+
observer.disconnect();
|
|
6300
|
+
}
|
|
6301
|
+
});
|
|
6302
|
+
},
|
|
6303
|
+
{ rootMargin: observerMargin, threshold: 0.2 }
|
|
6304
|
+
);
|
|
6305
|
+
observer.observe(target);
|
|
6306
|
+
return () => observer.disconnect();
|
|
6307
|
+
}, [lazy, observerMargin, src, srcSet]);
|
|
6308
|
+
const {
|
|
6309
|
+
onLoad: imgOnLoad,
|
|
6310
|
+
onError: imgOnError,
|
|
6311
|
+
loading: imgLoading,
|
|
6312
|
+
...restImgProps
|
|
6313
|
+
} = imgProps ?? {};
|
|
6314
|
+
const handleLoad = (event) => {
|
|
6315
|
+
setStatus("loaded");
|
|
6316
|
+
imgOnLoad?.(event);
|
|
6317
|
+
onLoad?.(event);
|
|
6318
|
+
};
|
|
6319
|
+
const handleError = (event) => {
|
|
6320
|
+
if (fallbackSrc && !hasTriedFallback) {
|
|
6321
|
+
setHasTriedFallback(true);
|
|
6322
|
+
setCurrentSrc(fallbackSrc);
|
|
6323
|
+
setStatus("loading");
|
|
6324
|
+
return;
|
|
6325
|
+
}
|
|
6326
|
+
setStatus("error");
|
|
6327
|
+
imgOnError?.(event);
|
|
6328
|
+
onError?.(event);
|
|
6329
|
+
};
|
|
6330
|
+
const showLoader = status === "idle" || status === "loading";
|
|
6331
|
+
const showError = status === "error";
|
|
6332
|
+
const loadingAttr = lazy ? "lazy" : imgLoading ?? "eager";
|
|
6333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
6334
|
+
import_Box5.default,
|
|
6335
|
+
{
|
|
6336
|
+
className: imageClasses.root.concat(className ? ` ${className}` : ""),
|
|
6337
|
+
sx: {
|
|
6338
|
+
position: "relative",
|
|
6339
|
+
display: "block",
|
|
6340
|
+
width: 1,
|
|
6341
|
+
lineHeight: 0,
|
|
6342
|
+
overflow: aspectRatio ? "hidden" : void 0,
|
|
6343
|
+
...aspectRatio && { aspectRatio },
|
|
6344
|
+
...sx
|
|
6345
|
+
},
|
|
6346
|
+
...rest,
|
|
6347
|
+
children: [
|
|
6348
|
+
showLoader && (loadingIndicator ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
6349
|
+
import_Skeleton.default,
|
|
6350
|
+
{
|
|
6351
|
+
animation: "wave",
|
|
6352
|
+
variant: "rectangular",
|
|
6353
|
+
className: imageClasses.overlay,
|
|
6354
|
+
sx: {
|
|
6355
|
+
position: "absolute",
|
|
6356
|
+
inset: 0,
|
|
6357
|
+
width: 1,
|
|
6358
|
+
height: 1,
|
|
6359
|
+
borderRadius: 1
|
|
6360
|
+
}
|
|
6361
|
+
}
|
|
6362
|
+
)),
|
|
6363
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
6364
|
+
import_Box5.default,
|
|
6365
|
+
{
|
|
6366
|
+
ref: setRefs,
|
|
6367
|
+
component: "img",
|
|
6368
|
+
className: imageClasses.wrapper,
|
|
6369
|
+
src: currentSrc,
|
|
6370
|
+
srcSet: currentSrcSet,
|
|
6371
|
+
sizes: sizes2,
|
|
6372
|
+
alt,
|
|
6373
|
+
loading: loadingAttr,
|
|
6374
|
+
onLoad: handleLoad,
|
|
6375
|
+
onError: handleError,
|
|
6376
|
+
...restImgProps,
|
|
6377
|
+
sx: {
|
|
6378
|
+
width: 1,
|
|
6379
|
+
height: aspectRatio ? "100%" : "auto",
|
|
6380
|
+
display: "block",
|
|
6381
|
+
objectFit: fit,
|
|
6382
|
+
objectPosition: position,
|
|
6383
|
+
opacity: status === "loaded" ? 1 : 0,
|
|
6384
|
+
transition: (theme) => theme.transitions.create("opacity", {
|
|
6385
|
+
duration: theme.transitions.duration.shorter
|
|
6386
|
+
}),
|
|
6387
|
+
...aspectRatio && { position: "absolute", inset: 0 },
|
|
6388
|
+
...imgSx
|
|
6389
|
+
}
|
|
6390
|
+
}
|
|
6391
|
+
),
|
|
6392
|
+
withOverlay && !showError && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
6393
|
+
import_Box5.default,
|
|
6394
|
+
{
|
|
6395
|
+
className: imageClasses.overlay,
|
|
6396
|
+
sx: {
|
|
6397
|
+
position: "absolute",
|
|
6398
|
+
inset: 0,
|
|
6399
|
+
pointerEvents: "none"
|
|
6400
|
+
},
|
|
6401
|
+
children: overlay
|
|
6402
|
+
}
|
|
6403
|
+
),
|
|
6404
|
+
showError && (renderError ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
6405
|
+
import_Box5.default,
|
|
6406
|
+
{
|
|
6407
|
+
className: imageClasses.overlay,
|
|
6408
|
+
sx: {
|
|
6409
|
+
position: "absolute",
|
|
6410
|
+
inset: 0,
|
|
6411
|
+
display: "flex",
|
|
6412
|
+
alignItems: "center",
|
|
6413
|
+
justifyContent: "center",
|
|
6414
|
+
bgcolor: (theme) => theme.vars.palette.grey[200],
|
|
6415
|
+
color: (theme) => theme.vars.palette.text.secondary,
|
|
6416
|
+
fontSize: 12,
|
|
6417
|
+
letterSpacing: 0.2
|
|
6418
|
+
},
|
|
6419
|
+
children: "Image unavailable"
|
|
6420
|
+
}
|
|
6421
|
+
))
|
|
6422
|
+
]
|
|
6423
|
+
}
|
|
6424
|
+
);
|
|
6425
|
+
});
|
|
6426
|
+
|
|
6142
6427
|
// src/components/Upload/Upload.tsx
|
|
6143
6428
|
var import_react_dropzone = require("react-dropzone");
|
|
6144
|
-
var
|
|
6429
|
+
var import_Box11 = __toESM(require("@mui/material/Box"), 1);
|
|
6145
6430
|
var import_Stack3 = __toESM(require("@mui/material/Stack"), 1);
|
|
6146
6431
|
var import_Button3 = __toESM(require("@mui/material/Button"), 1);
|
|
6147
6432
|
var import_FormHelperText = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
6148
6433
|
|
|
6149
6434
|
// src/components/Upload/components/Placeholder.tsx
|
|
6150
6435
|
var import_Stack2 = __toESM(require("@mui/material/Stack"), 1);
|
|
6151
|
-
var
|
|
6152
|
-
var
|
|
6436
|
+
var import_Box6 = __toESM(require("@mui/material/Box"), 1);
|
|
6437
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
6153
6438
|
var UploadPlaceholder = ({ hasError, ...rest }) => {
|
|
6154
|
-
return /* @__PURE__ */ (0,
|
|
6155
|
-
|
|
6439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
6440
|
+
import_Box6.default,
|
|
6156
6441
|
{
|
|
6157
6442
|
sx: {
|
|
6158
6443
|
display: "flex",
|
|
@@ -6162,7 +6447,7 @@ var UploadPlaceholder = ({ hasError, ...rest }) => {
|
|
|
6162
6447
|
},
|
|
6163
6448
|
...rest,
|
|
6164
6449
|
children: [
|
|
6165
|
-
/* @__PURE__ */ (0,
|
|
6450
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6166
6451
|
Icon,
|
|
6167
6452
|
{
|
|
6168
6453
|
icon: "CloudUpload",
|
|
@@ -6173,11 +6458,11 @@ var UploadPlaceholder = ({ hasError, ...rest }) => {
|
|
|
6173
6458
|
}
|
|
6174
6459
|
}
|
|
6175
6460
|
),
|
|
6176
|
-
/* @__PURE__ */ (0,
|
|
6177
|
-
/* @__PURE__ */ (0,
|
|
6461
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_Stack2.default, { spacing: 1, sx: { textAlign: "center", mt: 2 }, children: [
|
|
6462
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_Box6.default, { sx: { typography: "h8" }, children: [
|
|
6178
6463
|
"Drag files here or",
|
|
6179
|
-
/* @__PURE__ */ (0,
|
|
6180
|
-
|
|
6464
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
6465
|
+
import_Box6.default,
|
|
6181
6466
|
{
|
|
6182
6467
|
component: "span",
|
|
6183
6468
|
sx: {
|
|
@@ -6189,8 +6474,8 @@ var UploadPlaceholder = ({ hasError, ...rest }) => {
|
|
|
6189
6474
|
}
|
|
6190
6475
|
)
|
|
6191
6476
|
] }),
|
|
6192
|
-
/* @__PURE__ */ (0,
|
|
6193
|
-
|
|
6477
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
6478
|
+
import_Box6.default,
|
|
6194
6479
|
{
|
|
6195
6480
|
sx: {
|
|
6196
6481
|
typography: "bodyMd",
|
|
@@ -6211,7 +6496,7 @@ var UploadPlaceholder = ({ hasError, ...rest }) => {
|
|
|
6211
6496
|
};
|
|
6212
6497
|
|
|
6213
6498
|
// src/components/Upload/components/RejectionFiles.tsx
|
|
6214
|
-
var
|
|
6499
|
+
var import_Box7 = __toESM(require("@mui/material/Box"), 1);
|
|
6215
6500
|
var import_Paper2 = __toESM(require("@mui/material/Paper"), 1);
|
|
6216
6501
|
var import_Typography3 = __toESM(require("@mui/material/Typography"), 1);
|
|
6217
6502
|
|
|
@@ -6244,12 +6529,12 @@ var fileData = (file) => {
|
|
|
6244
6529
|
};
|
|
6245
6530
|
|
|
6246
6531
|
// src/components/Upload/components/RejectionFiles.tsx
|
|
6247
|
-
var
|
|
6532
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
6248
6533
|
var RejectionFiles = ({ files }) => {
|
|
6249
6534
|
if (!files.length) {
|
|
6250
6535
|
return null;
|
|
6251
6536
|
}
|
|
6252
|
-
return /* @__PURE__ */ (0,
|
|
6537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6253
6538
|
import_Paper2.default,
|
|
6254
6539
|
{
|
|
6255
6540
|
variant: "outlined",
|
|
@@ -6264,13 +6549,13 @@ var RejectionFiles = ({ files }) => {
|
|
|
6264
6549
|
},
|
|
6265
6550
|
children: files.map(({ file, errors }) => {
|
|
6266
6551
|
const { path, size } = fileData(file);
|
|
6267
|
-
return /* @__PURE__ */ (0,
|
|
6268
|
-
/* @__PURE__ */ (0,
|
|
6552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_Box7.default, { sx: { my: 1 }, children: [
|
|
6553
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_Typography3.default, { variant: "subtitle2", noWrap: true, children: [
|
|
6269
6554
|
path,
|
|
6270
6555
|
" - ",
|
|
6271
6556
|
size ? fData(size) : ""
|
|
6272
6557
|
] }),
|
|
6273
|
-
errors.map((error2) => /* @__PURE__ */ (0,
|
|
6558
|
+
errors.map((error2) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_Box7.default, { component: "span", sx: { typography: "caption" }, children: [
|
|
6274
6559
|
"- ",
|
|
6275
6560
|
error2.message
|
|
6276
6561
|
] }, error2.code))
|
|
@@ -6281,12 +6566,12 @@ var RejectionFiles = ({ files }) => {
|
|
|
6281
6566
|
};
|
|
6282
6567
|
|
|
6283
6568
|
// src/components/Upload/components/UploadProgress.tsx
|
|
6284
|
-
var
|
|
6569
|
+
var import_Box8 = __toESM(require("@mui/material/Box"), 1);
|
|
6285
6570
|
var import_CircularProgress2 = __toESM(require("@mui/material/CircularProgress"), 1);
|
|
6286
|
-
var
|
|
6571
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
6287
6572
|
var UploadProgress = ({ progress: progress2 = 20 }) => {
|
|
6288
|
-
return /* @__PURE__ */ (0,
|
|
6289
|
-
|
|
6573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
6574
|
+
import_Box8.default,
|
|
6290
6575
|
{
|
|
6291
6576
|
sx: {
|
|
6292
6577
|
display: "flex",
|
|
@@ -6296,8 +6581,8 @@ var UploadProgress = ({ progress: progress2 = 20 }) => {
|
|
|
6296
6581
|
height: "100%"
|
|
6297
6582
|
},
|
|
6298
6583
|
children: [
|
|
6299
|
-
/* @__PURE__ */ (0,
|
|
6300
|
-
/* @__PURE__ */ (0,
|
|
6584
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_Box8.default, { sx: { position: "relative", display: "inline-flex" }, children: [
|
|
6585
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6301
6586
|
import_CircularProgress2.default,
|
|
6302
6587
|
{
|
|
6303
6588
|
variant: "determinate",
|
|
@@ -6310,7 +6595,7 @@ var UploadProgress = ({ progress: progress2 = 20 }) => {
|
|
|
6310
6595
|
}
|
|
6311
6596
|
}
|
|
6312
6597
|
),
|
|
6313
|
-
/* @__PURE__ */ (0,
|
|
6598
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6314
6599
|
import_CircularProgress2.default,
|
|
6315
6600
|
{
|
|
6316
6601
|
variant: "determinate",
|
|
@@ -6322,8 +6607,8 @@ var UploadProgress = ({ progress: progress2 = 20 }) => {
|
|
|
6322
6607
|
}
|
|
6323
6608
|
}
|
|
6324
6609
|
),
|
|
6325
|
-
/* @__PURE__ */ (0,
|
|
6326
|
-
|
|
6610
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
6611
|
+
import_Box8.default,
|
|
6327
6612
|
{
|
|
6328
6613
|
sx: {
|
|
6329
6614
|
top: 0,
|
|
@@ -6335,30 +6620,30 @@ var UploadProgress = ({ progress: progress2 = 20 }) => {
|
|
|
6335
6620
|
alignItems: "center",
|
|
6336
6621
|
justifyContent: "center"
|
|
6337
6622
|
},
|
|
6338
|
-
children: /* @__PURE__ */ (0,
|
|
6623
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_Box8.default, { sx: { typography: "h6", color: "common.black" }, children: `${Math.round(progress2)}` })
|
|
6339
6624
|
}
|
|
6340
6625
|
)
|
|
6341
6626
|
] }),
|
|
6342
|
-
/* @__PURE__ */ (0,
|
|
6627
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_Box8.default, { sx: { mt: 2, typography: "h6" }, children: "Uploading" })
|
|
6343
6628
|
]
|
|
6344
6629
|
}
|
|
6345
6630
|
);
|
|
6346
6631
|
};
|
|
6347
6632
|
|
|
6348
6633
|
// src/components/Upload/components/MultiFilePreview.tsx
|
|
6349
|
-
var
|
|
6350
|
-
var
|
|
6634
|
+
var import_react13 = require("react");
|
|
6635
|
+
var import_Box10 = __toESM(require("@mui/material/Box"), 1);
|
|
6351
6636
|
var import_IconButton3 = __toESM(require("@mui/material/IconButton"), 1);
|
|
6352
6637
|
|
|
6353
6638
|
// src/components/Upload/components/SingleFilePreview.tsx
|
|
6354
|
-
var
|
|
6639
|
+
var import_Box9 = __toESM(require("@mui/material/Box"), 1);
|
|
6355
6640
|
var import_IconButton2 = __toESM(require("@mui/material/IconButton"), 1);
|
|
6356
|
-
var
|
|
6641
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
6357
6642
|
var SingleFilePreview = ({ file }) => {
|
|
6358
6643
|
const fileName = typeof file === "string" ? file : file.name;
|
|
6359
6644
|
const previewUrl = typeof file === "string" ? file : URL.createObjectURL(file);
|
|
6360
|
-
const renderImg = /* @__PURE__ */ (0,
|
|
6361
|
-
|
|
6645
|
+
const renderImg = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6646
|
+
import_Box9.default,
|
|
6362
6647
|
{
|
|
6363
6648
|
component: "img",
|
|
6364
6649
|
alt: fileName,
|
|
@@ -6371,8 +6656,8 @@ var SingleFilePreview = ({ file }) => {
|
|
|
6371
6656
|
}
|
|
6372
6657
|
}
|
|
6373
6658
|
);
|
|
6374
|
-
return /* @__PURE__ */ (0,
|
|
6375
|
-
|
|
6659
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6660
|
+
import_Box9.default,
|
|
6376
6661
|
{
|
|
6377
6662
|
sx: {
|
|
6378
6663
|
p: 1,
|
|
@@ -6387,7 +6672,7 @@ var SingleFilePreview = ({ file }) => {
|
|
|
6387
6672
|
);
|
|
6388
6673
|
};
|
|
6389
6674
|
var DeleteButton = ({ sx, ...rest }) => {
|
|
6390
|
-
return /* @__PURE__ */ (0,
|
|
6675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6391
6676
|
import_IconButton2.default,
|
|
6392
6677
|
{
|
|
6393
6678
|
size: "small",
|
|
@@ -6406,15 +6691,15 @@ var DeleteButton = ({ sx, ...rest }) => {
|
|
|
6406
6691
|
...sx
|
|
6407
6692
|
},
|
|
6408
6693
|
...rest,
|
|
6409
|
-
children: /* @__PURE__ */ (0,
|
|
6694
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Icon, { icon: "XMark", sx: { width: 18, height: 18 } })
|
|
6410
6695
|
}
|
|
6411
6696
|
);
|
|
6412
6697
|
};
|
|
6413
6698
|
|
|
6414
6699
|
// src/components/Upload/components/MultiFilePreview.tsx
|
|
6415
|
-
var
|
|
6700
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6416
6701
|
var MultiFilePreview = ({ files, onRemove }) => {
|
|
6417
|
-
const scrollRef = (0,
|
|
6702
|
+
const scrollRef = (0, import_react13.useRef)(null);
|
|
6418
6703
|
const handleScroll = (direction) => {
|
|
6419
6704
|
if (scrollRef.current) {
|
|
6420
6705
|
const scrollAmount = 300;
|
|
@@ -6426,8 +6711,8 @@ var MultiFilePreview = ({ files, onRemove }) => {
|
|
|
6426
6711
|
}
|
|
6427
6712
|
};
|
|
6428
6713
|
const showNavigation = files.length > 2;
|
|
6429
|
-
return /* @__PURE__ */ (0,
|
|
6430
|
-
showNavigation && /* @__PURE__ */ (0,
|
|
6714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_Box10.default, { sx: { position: "relative", width: 1 }, children: [
|
|
6715
|
+
showNavigation && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6431
6716
|
import_IconButton3.default,
|
|
6432
6717
|
{
|
|
6433
6718
|
size: "small",
|
|
@@ -6444,11 +6729,11 @@ var MultiFilePreview = ({ files, onRemove }) => {
|
|
|
6444
6729
|
bgcolor: (theme) => varAlpha(theme.vars.palette.common.whiteChannel, 1)
|
|
6445
6730
|
}
|
|
6446
6731
|
},
|
|
6447
|
-
children: /* @__PURE__ */ (0,
|
|
6732
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, { icon: "NavArrowLeft", width: 20 })
|
|
6448
6733
|
}
|
|
6449
6734
|
),
|
|
6450
|
-
/* @__PURE__ */ (0,
|
|
6451
|
-
|
|
6735
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6736
|
+
import_Box10.default,
|
|
6452
6737
|
{
|
|
6453
6738
|
ref: scrollRef,
|
|
6454
6739
|
sx: {
|
|
@@ -6466,8 +6751,8 @@ var MultiFilePreview = ({ files, onRemove }) => {
|
|
|
6466
6751
|
children: files.map((file, index) => {
|
|
6467
6752
|
const fileName = typeof file === "string" ? file : file.name;
|
|
6468
6753
|
const previewUrl = typeof file === "string" ? file : URL.createObjectURL(file);
|
|
6469
|
-
return /* @__PURE__ */ (0,
|
|
6470
|
-
|
|
6754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6755
|
+
import_Box10.default,
|
|
6471
6756
|
{
|
|
6472
6757
|
sx: {
|
|
6473
6758
|
position: "relative",
|
|
@@ -6478,8 +6763,8 @@ var MultiFilePreview = ({ files, onRemove }) => {
|
|
|
6478
6763
|
flexShrink: 0
|
|
6479
6764
|
},
|
|
6480
6765
|
children: [
|
|
6481
|
-
/* @__PURE__ */ (0,
|
|
6482
|
-
|
|
6766
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6767
|
+
import_Box10.default,
|
|
6483
6768
|
{
|
|
6484
6769
|
component: "img",
|
|
6485
6770
|
alt: fileName,
|
|
@@ -6492,7 +6777,7 @@ var MultiFilePreview = ({ files, onRemove }) => {
|
|
|
6492
6777
|
}
|
|
6493
6778
|
}
|
|
6494
6779
|
),
|
|
6495
|
-
onRemove && /* @__PURE__ */ (0,
|
|
6780
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6496
6781
|
DeleteButton,
|
|
6497
6782
|
{
|
|
6498
6783
|
onClick: (e) => {
|
|
@@ -6508,7 +6793,7 @@ var MultiFilePreview = ({ files, onRemove }) => {
|
|
|
6508
6793
|
})
|
|
6509
6794
|
}
|
|
6510
6795
|
),
|
|
6511
|
-
showNavigation && /* @__PURE__ */ (0,
|
|
6796
|
+
showNavigation && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6512
6797
|
import_IconButton3.default,
|
|
6513
6798
|
{
|
|
6514
6799
|
size: "small",
|
|
@@ -6525,14 +6810,14 @@ var MultiFilePreview = ({ files, onRemove }) => {
|
|
|
6525
6810
|
bgcolor: (theme) => varAlpha(theme.vars.palette.common.whiteChannel, 1)
|
|
6526
6811
|
}
|
|
6527
6812
|
},
|
|
6528
|
-
children: /* @__PURE__ */ (0,
|
|
6813
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, { icon: "NavArrowRight", width: 20 })
|
|
6529
6814
|
}
|
|
6530
6815
|
)
|
|
6531
6816
|
] });
|
|
6532
6817
|
};
|
|
6533
6818
|
|
|
6534
6819
|
// src/components/Upload/Upload.tsx
|
|
6535
|
-
var
|
|
6820
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6536
6821
|
var Upload = ({
|
|
6537
6822
|
sx,
|
|
6538
6823
|
value,
|
|
@@ -6559,20 +6844,20 @@ var Upload = ({
|
|
|
6559
6844
|
const hasError = isDragReject || !!error2;
|
|
6560
6845
|
const renderContent = () => {
|
|
6561
6846
|
if (isUploading) {
|
|
6562
|
-
return /* @__PURE__ */ (0,
|
|
6847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(UploadProgress, { progress: uploadProgress });
|
|
6563
6848
|
}
|
|
6564
6849
|
if (hasFile) {
|
|
6565
|
-
return /* @__PURE__ */ (0,
|
|
6850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SingleFilePreview, { file: value });
|
|
6566
6851
|
}
|
|
6567
6852
|
if (hasFiles) {
|
|
6568
|
-
return /* @__PURE__ */ (0,
|
|
6853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MultiFilePreview, { files: value, onRemove });
|
|
6569
6854
|
}
|
|
6570
|
-
return /* @__PURE__ */ (0,
|
|
6855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(UploadPlaceholder, { hasError });
|
|
6571
6856
|
};
|
|
6572
6857
|
const shouldShowDropzone = !hasFile && !hasFiles && !isUploading;
|
|
6573
|
-
return /* @__PURE__ */ (0,
|
|
6574
|
-
/* @__PURE__ */ (0,
|
|
6575
|
-
|
|
6858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_Box11.default, { sx: { width: 1, position: "relative", ...sx }, children: [
|
|
6859
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
6860
|
+
import_Box11.default,
|
|
6576
6861
|
{
|
|
6577
6862
|
...shouldShowDropzone ? getRootProps() : {},
|
|
6578
6863
|
sx: {
|
|
@@ -6610,52 +6895,52 @@ var Upload = ({
|
|
|
6610
6895
|
}
|
|
6611
6896
|
},
|
|
6612
6897
|
children: [
|
|
6613
|
-
shouldShowDropzone && /* @__PURE__ */ (0,
|
|
6898
|
+
shouldShowDropzone && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("input", { ...getInputProps() }),
|
|
6614
6899
|
renderContent()
|
|
6615
6900
|
]
|
|
6616
6901
|
}
|
|
6617
6902
|
),
|
|
6618
|
-
hasFile && !isUploading && /* @__PURE__ */ (0,
|
|
6619
|
-
hasFiles && /* @__PURE__ */ (0,
|
|
6620
|
-
onRemoveAll && /* @__PURE__ */ (0,
|
|
6903
|
+
hasFile && !isUploading && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(DeleteButton, { onClick: onDelete }),
|
|
6904
|
+
hasFiles && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_Stack3.default, { direction: "row", spacing: 2, sx: { mt: 2 }, children: [
|
|
6905
|
+
onRemoveAll && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6621
6906
|
import_Button3.default,
|
|
6622
6907
|
{
|
|
6623
6908
|
variant: "outlined",
|
|
6624
6909
|
color: "inherit",
|
|
6625
6910
|
size: "small",
|
|
6626
6911
|
onClick: onRemoveAll,
|
|
6627
|
-
startIcon: /* @__PURE__ */ (0,
|
|
6912
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Icon, { icon: "Trash", sx: { width: 14, height: 14 } }),
|
|
6628
6913
|
children: "Remove all"
|
|
6629
6914
|
}
|
|
6630
6915
|
),
|
|
6631
|
-
onUpload && /* @__PURE__ */ (0,
|
|
6916
|
+
onUpload && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6632
6917
|
import_Button3.default,
|
|
6633
6918
|
{
|
|
6634
6919
|
variant: "contained",
|
|
6635
6920
|
size: "small",
|
|
6636
6921
|
onClick: onUpload,
|
|
6637
|
-
startIcon: /* @__PURE__ */ (0,
|
|
6922
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Icon, { icon: "CloudUpload", sx: { width: 14, height: 14 } }),
|
|
6638
6923
|
children: "Upload files"
|
|
6639
6924
|
}
|
|
6640
6925
|
)
|
|
6641
6926
|
] }),
|
|
6642
|
-
helperText && /* @__PURE__ */ (0,
|
|
6643
|
-
/* @__PURE__ */ (0,
|
|
6927
|
+
helperText && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_FormHelperText.default, { error: !!error2, sx: { color: "text.body", fontWeight: 500, mt: 1 }, children: helperText }),
|
|
6928
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(RejectionFiles, { files: [...fileRejections] })
|
|
6644
6929
|
] });
|
|
6645
6930
|
};
|
|
6646
6931
|
|
|
6647
6932
|
// src/components/HookForm/Form.tsx
|
|
6648
6933
|
var import_react_hook_form = require("react-hook-form");
|
|
6649
|
-
var
|
|
6650
|
-
var
|
|
6934
|
+
var import_Box12 = __toESM(require("@mui/material/Box"), 1);
|
|
6935
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6651
6936
|
var Form = ({
|
|
6652
6937
|
children,
|
|
6653
6938
|
onSubmit,
|
|
6654
6939
|
methods,
|
|
6655
6940
|
...rest
|
|
6656
6941
|
}) => {
|
|
6657
|
-
return /* @__PURE__ */ (0,
|
|
6658
|
-
|
|
6942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react_hook_form.FormProvider, { ...methods, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6943
|
+
import_Box12.default,
|
|
6659
6944
|
{
|
|
6660
6945
|
component: "form",
|
|
6661
6946
|
onSubmit: (e) => {
|
|
@@ -6675,7 +6960,7 @@ var Form = ({
|
|
|
6675
6960
|
// src/components/HookForm/RHFSwitch.tsx
|
|
6676
6961
|
var import_react_hook_form2 = require("react-hook-form");
|
|
6677
6962
|
var import_Stack4 = __toESM(require("@mui/material/Stack"), 1);
|
|
6678
|
-
var
|
|
6963
|
+
var import_Box13 = __toESM(require("@mui/material/Box"), 1);
|
|
6679
6964
|
var import_Typography4 = __toESM(require("@mui/material/Typography"), 1);
|
|
6680
6965
|
var import_Switch2 = __toESM(require("@mui/material/Switch"), 1);
|
|
6681
6966
|
var import_FormGroup = __toESM(require("@mui/material/FormGroup"), 1);
|
|
@@ -6683,7 +6968,7 @@ var import_FormLabel = __toESM(require("@mui/material/FormLabel"), 1);
|
|
|
6683
6968
|
var import_FormControl = __toESM(require("@mui/material/FormControl"), 1);
|
|
6684
6969
|
var import_FormHelperText2 = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
6685
6970
|
var import_FormControlLabel2 = __toESM(require("@mui/material/FormControlLabel"), 1);
|
|
6686
|
-
var
|
|
6971
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6687
6972
|
var RHFSwitch = ({
|
|
6688
6973
|
name,
|
|
6689
6974
|
description,
|
|
@@ -6695,16 +6980,16 @@ var RHFSwitch = ({
|
|
|
6695
6980
|
}) => {
|
|
6696
6981
|
const { control } = (0, import_react_hook_form2.useFormContext)();
|
|
6697
6982
|
const baseAriaLabel = `Switch ${name}`;
|
|
6698
|
-
return /* @__PURE__ */ (0,
|
|
6983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6699
6984
|
import_react_hook_form2.Controller,
|
|
6700
6985
|
{
|
|
6701
6986
|
name,
|
|
6702
6987
|
control,
|
|
6703
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
6704
|
-
/* @__PURE__ */ (0,
|
|
6988
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_Box13.default, { sx: slotProps?.wrap, children: [
|
|
6989
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6705
6990
|
import_FormControlLabel2.default,
|
|
6706
6991
|
{
|
|
6707
|
-
control: /* @__PURE__ */ (0,
|
|
6992
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6708
6993
|
import_Switch2.default,
|
|
6709
6994
|
{
|
|
6710
6995
|
...field,
|
|
@@ -6719,9 +7004,9 @@ var RHFSwitch = ({
|
|
|
6719
7004
|
}
|
|
6720
7005
|
}
|
|
6721
7006
|
),
|
|
6722
|
-
label: /* @__PURE__ */ (0,
|
|
6723
|
-
/* @__PURE__ */ (0,
|
|
6724
|
-
description && /* @__PURE__ */ (0,
|
|
7007
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_Stack4.default, { children: [
|
|
7008
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_Typography4.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: label }),
|
|
7009
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_Typography4.default, { variant: "body2", color: "textBody", children: description })
|
|
6725
7010
|
] }),
|
|
6726
7011
|
sx: {
|
|
6727
7012
|
alignItems: description ? "flex-start" : "center",
|
|
@@ -6730,7 +7015,7 @@ var RHFSwitch = ({
|
|
|
6730
7015
|
...other
|
|
6731
7016
|
}
|
|
6732
7017
|
),
|
|
6733
|
-
(!!error2 || helperText) && /* @__PURE__ */ (0,
|
|
7018
|
+
(!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6734
7019
|
import_FormHelperText2.default,
|
|
6735
7020
|
{
|
|
6736
7021
|
error: !!error2,
|
|
@@ -6753,19 +7038,19 @@ var RHFMultiSwitch = ({
|
|
|
6753
7038
|
}) => {
|
|
6754
7039
|
const { control } = (0, import_react_hook_form2.useFormContext)();
|
|
6755
7040
|
const getSelected = (currentValues, optionValue) => currentValues.includes(optionValue) ? currentValues.filter((value) => value !== optionValue) : [...currentValues, optionValue];
|
|
6756
|
-
return /* @__PURE__ */ (0,
|
|
7041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6757
7042
|
import_react_hook_form2.Controller,
|
|
6758
7043
|
{
|
|
6759
7044
|
name,
|
|
6760
7045
|
control,
|
|
6761
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7046
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
6762
7047
|
import_FormControl.default,
|
|
6763
7048
|
{
|
|
6764
7049
|
component: "fieldset",
|
|
6765
7050
|
sx: slotProps?.formControl?.sx,
|
|
6766
7051
|
...slotProps?.formControl,
|
|
6767
7052
|
children: [
|
|
6768
|
-
label && /* @__PURE__ */ (0,
|
|
7053
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6769
7054
|
import_FormLabel.default,
|
|
6770
7055
|
{
|
|
6771
7056
|
component: "legend",
|
|
@@ -6774,12 +7059,12 @@ var RHFMultiSwitch = ({
|
|
|
6774
7059
|
children: label
|
|
6775
7060
|
}
|
|
6776
7061
|
),
|
|
6777
|
-
/* @__PURE__ */ (0,
|
|
7062
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_FormGroup.default, { ...other, children: options.map((option) => {
|
|
6778
7063
|
const itemAriaLabel = option.label || `Option ${option.value}`;
|
|
6779
|
-
return /* @__PURE__ */ (0,
|
|
7064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6780
7065
|
import_FormControlLabel2.default,
|
|
6781
7066
|
{
|
|
6782
|
-
control: /* @__PURE__ */ (0,
|
|
7067
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6783
7068
|
import_Switch2.default,
|
|
6784
7069
|
{
|
|
6785
7070
|
checked: (field.value || []).includes(option.value),
|
|
@@ -6802,7 +7087,7 @@ var RHFMultiSwitch = ({
|
|
|
6802
7087
|
option.value
|
|
6803
7088
|
);
|
|
6804
7089
|
}) }),
|
|
6805
|
-
(!!error2 || helperText) && /* @__PURE__ */ (0,
|
|
7090
|
+
(!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_FormHelperText2.default, { error: !!error2, sx: { mx: 0 }, ...slotProps?.formHelperText, children: error2 ? error2?.message : helperText })
|
|
6806
7091
|
]
|
|
6807
7092
|
}
|
|
6808
7093
|
)
|
|
@@ -6812,10 +7097,10 @@ var RHFMultiSwitch = ({
|
|
|
6812
7097
|
|
|
6813
7098
|
// src/components/HookForm/RHFUpload.tsx
|
|
6814
7099
|
var import_react_hook_form3 = require("react-hook-form");
|
|
6815
|
-
var
|
|
7100
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
6816
7101
|
var RHFUpload = ({ name, multiple, helperText, ...rest }) => {
|
|
6817
7102
|
const { control, setValue } = (0, import_react_hook_form3.useFormContext)();
|
|
6818
|
-
return /* @__PURE__ */ (0,
|
|
7103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6819
7104
|
import_react_hook_form3.Controller,
|
|
6820
7105
|
{
|
|
6821
7106
|
name,
|
|
@@ -6843,7 +7128,7 @@ var RHFUpload = ({ name, multiple, helperText, ...rest }) => {
|
|
|
6843
7128
|
const onRemoveAll = () => {
|
|
6844
7129
|
setValue(name, [], { shouldValidate: true });
|
|
6845
7130
|
};
|
|
6846
|
-
return /* @__PURE__ */ (0,
|
|
7131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6847
7132
|
Upload,
|
|
6848
7133
|
{
|
|
6849
7134
|
multiple,
|
|
@@ -6867,18 +7152,18 @@ var RHFUpload = ({ name, multiple, helperText, ...rest }) => {
|
|
|
6867
7152
|
var import_react_hook_form4 = require("react-hook-form");
|
|
6868
7153
|
|
|
6869
7154
|
// src/components/OTPInput/index.tsx
|
|
6870
|
-
var
|
|
7155
|
+
var import_react14 = require("react");
|
|
6871
7156
|
var import_styles37 = require("@mui/material/styles");
|
|
6872
|
-
var
|
|
7157
|
+
var import_Box14 = __toESM(require("@mui/material/Box"), 1);
|
|
6873
7158
|
var import_FormHelperText3 = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
6874
7159
|
var import_InputBase3 = require("@mui/material/InputBase");
|
|
6875
7160
|
var import_TextField2 = __toESM(require("@mui/material/TextField"), 1);
|
|
6876
|
-
var
|
|
7161
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
6877
7162
|
var OTPInput = (props) => {
|
|
6878
7163
|
const { length = 6, onChange, onComplete, error: error2, helperText, containerProps, ...rest } = props;
|
|
6879
7164
|
const theme = (0, import_styles37.useTheme)();
|
|
6880
|
-
const [otp, setOtp] = (0,
|
|
6881
|
-
const inputsRef = (0,
|
|
7165
|
+
const [otp, setOtp] = (0, import_react14.useState)(Array(length).fill(""));
|
|
7166
|
+
const inputsRef = (0, import_react14.useRef)([]);
|
|
6882
7167
|
const handleChange = (value, index) => {
|
|
6883
7168
|
if (!/^[0-9]$/.test(value) && value !== "") return;
|
|
6884
7169
|
const newOtp = [...otp];
|
|
@@ -6941,18 +7226,19 @@ var OTPInput = (props) => {
|
|
|
6941
7226
|
onComplete?.(newOtp.join(""));
|
|
6942
7227
|
}
|
|
6943
7228
|
};
|
|
6944
|
-
return /* @__PURE__ */ (0,
|
|
6945
|
-
/* @__PURE__ */ (0,
|
|
6946
|
-
|
|
7229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
7230
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_Box14.default, { display: "flex", justifyContent: "center", ...containerProps, children: otp.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
7231
|
+
import_Box14.default,
|
|
6947
7232
|
{
|
|
6948
7233
|
display: "flex",
|
|
6949
7234
|
alignItems: "center",
|
|
6950
7235
|
sx: {
|
|
7236
|
+
width: "100%",
|
|
6951
7237
|
"&:not(:last-of-type)": {
|
|
6952
7238
|
mr: 1.5
|
|
6953
7239
|
}
|
|
6954
7240
|
},
|
|
6955
|
-
children: /* @__PURE__ */ (0,
|
|
7241
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
6956
7242
|
import_TextField2.default,
|
|
6957
7243
|
{
|
|
6958
7244
|
size: "medium",
|
|
@@ -7035,21 +7321,21 @@ var OTPInput = (props) => {
|
|
|
7035
7321
|
},
|
|
7036
7322
|
index
|
|
7037
7323
|
)) }),
|
|
7038
|
-
error2 && /* @__PURE__ */ (0,
|
|
7324
|
+
error2 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_FormHelperText3.default, { sx: { color: "error.main" }, children: helperText })
|
|
7039
7325
|
] });
|
|
7040
7326
|
};
|
|
7041
7327
|
var OTPInput_default = OTPInput;
|
|
7042
7328
|
|
|
7043
7329
|
// src/components/HookForm/RHFOTPInput.tsx
|
|
7044
|
-
var
|
|
7330
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
7045
7331
|
var RHFOTPInput = ({ name, length = 6, helperText, ...rest }) => {
|
|
7046
7332
|
const { control, setValue } = (0, import_react_hook_form4.useFormContext)();
|
|
7047
|
-
return /* @__PURE__ */ (0,
|
|
7333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7048
7334
|
import_react_hook_form4.Controller,
|
|
7049
7335
|
{
|
|
7050
7336
|
name,
|
|
7051
7337
|
control,
|
|
7052
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7338
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7053
7339
|
OTPInput_default,
|
|
7054
7340
|
{
|
|
7055
7341
|
length,
|
|
@@ -7069,16 +7355,16 @@ var import_react_hook_form5 = require("react-hook-form");
|
|
|
7069
7355
|
var import_IconButton4 = __toESM(require("@mui/material/IconButton"), 1);
|
|
7070
7356
|
var import_InputAdornment2 = __toESM(require("@mui/material/InputAdornment"), 1);
|
|
7071
7357
|
var import_TextField3 = __toESM(require("@mui/material/TextField"), 1);
|
|
7072
|
-
var
|
|
7358
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
7073
7359
|
var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
|
|
7074
7360
|
const { control } = (0, import_react_hook_form5.useFormContext)();
|
|
7075
7361
|
const passwordVisibility = useBoolean();
|
|
7076
|
-
return /* @__PURE__ */ (0,
|
|
7362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7077
7363
|
import_react_hook_form5.Controller,
|
|
7078
7364
|
{
|
|
7079
7365
|
name,
|
|
7080
7366
|
control,
|
|
7081
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7367
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7082
7368
|
import_TextField3.default,
|
|
7083
7369
|
{
|
|
7084
7370
|
...field,
|
|
@@ -7099,7 +7385,7 @@ var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
|
|
|
7099
7385
|
input: {
|
|
7100
7386
|
...slotProps?.input,
|
|
7101
7387
|
...type === "password" && {
|
|
7102
|
-
endAdornment: /* @__PURE__ */ (0,
|
|
7388
|
+
endAdornment: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_InputAdornment2.default, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_IconButton4.default, { edge: "end", onClick: passwordVisibility.onToggle, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7103
7389
|
Icon,
|
|
7104
7390
|
{
|
|
7105
7391
|
icon: passwordVisibility.value ? "EyeClosed" : "Eye",
|
|
@@ -7126,7 +7412,7 @@ var import_FormLabel2 = __toESM(require("@mui/material/FormLabel"), 1);
|
|
|
7126
7412
|
var import_RadioGroup = __toESM(require("@mui/material/RadioGroup"), 1);
|
|
7127
7413
|
var import_FormControl2 = __toESM(require("@mui/material/FormControl"), 1);
|
|
7128
7414
|
var import_FormHelperText4 = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
7129
|
-
var
|
|
7415
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7130
7416
|
var RHFRadioGroup = ({
|
|
7131
7417
|
name,
|
|
7132
7418
|
label,
|
|
@@ -7138,13 +7424,13 @@ var RHFRadioGroup = ({
|
|
|
7138
7424
|
const { control } = (0, import_react_hook_form6.useFormContext)();
|
|
7139
7425
|
const labelledby = `${name}-radio-buttons-group-label`;
|
|
7140
7426
|
const ariaLabel = (val) => `Radio ${val}`;
|
|
7141
|
-
return /* @__PURE__ */ (0,
|
|
7427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7142
7428
|
import_react_hook_form6.Controller,
|
|
7143
7429
|
{
|
|
7144
7430
|
name,
|
|
7145
7431
|
control,
|
|
7146
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7147
|
-
label && /* @__PURE__ */ (0,
|
|
7432
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_FormControl2.default, { component: "fieldset", sx: slotProps?.wrap, children: [
|
|
7433
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7148
7434
|
import_FormLabel2.default,
|
|
7149
7435
|
{
|
|
7150
7436
|
id: labelledby,
|
|
@@ -7154,11 +7440,11 @@ var RHFRadioGroup = ({
|
|
|
7154
7440
|
children: label
|
|
7155
7441
|
}
|
|
7156
7442
|
),
|
|
7157
|
-
/* @__PURE__ */ (0,
|
|
7443
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_RadioGroup.default, { ...field, "aria-labelledby": labelledby, ...other, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7158
7444
|
import_FormControlLabel3.default,
|
|
7159
7445
|
{
|
|
7160
7446
|
value: option.value,
|
|
7161
|
-
control: /* @__PURE__ */ (0,
|
|
7447
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7162
7448
|
import_Radio2.default,
|
|
7163
7449
|
{
|
|
7164
7450
|
...slotProps?.radio,
|
|
@@ -7170,9 +7456,9 @@ var RHFRadioGroup = ({
|
|
|
7170
7456
|
}
|
|
7171
7457
|
}
|
|
7172
7458
|
),
|
|
7173
|
-
label: /* @__PURE__ */ (0,
|
|
7174
|
-
/* @__PURE__ */ (0,
|
|
7175
|
-
option?.description && /* @__PURE__ */ (0,
|
|
7459
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_Stack5.default, { children: [
|
|
7460
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_Typography5.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: option.label }),
|
|
7461
|
+
option?.description && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_Typography5.default, { variant: "body2", color: "textBody", children: option?.description })
|
|
7176
7462
|
] }),
|
|
7177
7463
|
sx: {
|
|
7178
7464
|
alignItems: option?.description ? "flex-start" : "center"
|
|
@@ -7180,7 +7466,7 @@ var RHFRadioGroup = ({
|
|
|
7180
7466
|
},
|
|
7181
7467
|
option.value
|
|
7182
7468
|
)) }),
|
|
7183
|
-
(!!error2 || helperText) && /* @__PURE__ */ (0,
|
|
7469
|
+
(!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_FormHelperText4.default, { error: !!error2, sx: { mx: 0 }, ...slotProps?.formHelperText, children: error2 ? error2?.message : helperText })
|
|
7184
7470
|
] })
|
|
7185
7471
|
}
|
|
7186
7472
|
);
|
|
@@ -7190,7 +7476,7 @@ var RHFRadioGroup = ({
|
|
|
7190
7476
|
var import_react_hook_form7 = require("react-hook-form");
|
|
7191
7477
|
var import_TextField4 = __toESM(require("@mui/material/TextField"), 1);
|
|
7192
7478
|
var import_Autocomplete4 = __toESM(require("@mui/material/Autocomplete"), 1);
|
|
7193
|
-
var
|
|
7479
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7194
7480
|
var RHFAutocomplete = ({
|
|
7195
7481
|
name,
|
|
7196
7482
|
label,
|
|
@@ -7201,12 +7487,12 @@ var RHFAutocomplete = ({
|
|
|
7201
7487
|
...other
|
|
7202
7488
|
}) => {
|
|
7203
7489
|
const { control, setValue } = (0, import_react_hook_form7.useFormContext)();
|
|
7204
|
-
return /* @__PURE__ */ (0,
|
|
7490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7205
7491
|
import_react_hook_form7.Controller,
|
|
7206
7492
|
{
|
|
7207
7493
|
name,
|
|
7208
7494
|
control,
|
|
7209
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7495
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7210
7496
|
import_Autocomplete4.default,
|
|
7211
7497
|
{
|
|
7212
7498
|
...field,
|
|
@@ -7215,7 +7501,7 @@ var RHFAutocomplete = ({
|
|
|
7215
7501
|
setValue(name, newValue, { shouldValidate: true });
|
|
7216
7502
|
handleChange?.(newValue);
|
|
7217
7503
|
},
|
|
7218
|
-
renderInput: (params) => /* @__PURE__ */ (0,
|
|
7504
|
+
renderInput: (params) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7219
7505
|
import_TextField4.default,
|
|
7220
7506
|
{
|
|
7221
7507
|
label,
|
|
@@ -7236,7 +7522,7 @@ var RHFAutocomplete = ({
|
|
|
7236
7522
|
// src/components/HookForm/RHFCheckbox.tsx
|
|
7237
7523
|
var import_react_hook_form8 = require("react-hook-form");
|
|
7238
7524
|
var import_Stack6 = __toESM(require("@mui/material/Stack"), 1);
|
|
7239
|
-
var
|
|
7525
|
+
var import_Box15 = __toESM(require("@mui/material/Box"), 1);
|
|
7240
7526
|
var import_Typography6 = __toESM(require("@mui/material/Typography"), 1);
|
|
7241
7527
|
var import_Checkbox3 = __toESM(require("@mui/material/Checkbox"), 1);
|
|
7242
7528
|
var import_FormGroup2 = __toESM(require("@mui/material/FormGroup"), 1);
|
|
@@ -7244,7 +7530,7 @@ var import_FormLabel3 = __toESM(require("@mui/material/FormLabel"), 1);
|
|
|
7244
7530
|
var import_FormControl3 = __toESM(require("@mui/material/FormControl"), 1);
|
|
7245
7531
|
var import_FormHelperText5 = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
7246
7532
|
var import_FormControlLabel4 = __toESM(require("@mui/material/FormControlLabel"), 1);
|
|
7247
|
-
var
|
|
7533
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
7248
7534
|
var RHFCheckbox = ({
|
|
7249
7535
|
name,
|
|
7250
7536
|
description,
|
|
@@ -7256,16 +7542,16 @@ var RHFCheckbox = ({
|
|
|
7256
7542
|
}) => {
|
|
7257
7543
|
const { control } = (0, import_react_hook_form8.useFormContext)();
|
|
7258
7544
|
const baseAriaLabel = `Checkbox for ${name}`;
|
|
7259
|
-
return /* @__PURE__ */ (0,
|
|
7545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7260
7546
|
import_react_hook_form8.Controller,
|
|
7261
7547
|
{
|
|
7262
7548
|
name,
|
|
7263
7549
|
control,
|
|
7264
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7265
|
-
/* @__PURE__ */ (0,
|
|
7550
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_Box15.default, { sx: slotProps?.wrap, children: [
|
|
7551
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7266
7552
|
import_FormControlLabel4.default,
|
|
7267
7553
|
{
|
|
7268
|
-
control: /* @__PURE__ */ (0,
|
|
7554
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7269
7555
|
import_Checkbox3.default,
|
|
7270
7556
|
{
|
|
7271
7557
|
...field,
|
|
@@ -7280,9 +7566,9 @@ var RHFCheckbox = ({
|
|
|
7280
7566
|
}
|
|
7281
7567
|
}
|
|
7282
7568
|
),
|
|
7283
|
-
label: /* @__PURE__ */ (0,
|
|
7284
|
-
/* @__PURE__ */ (0,
|
|
7285
|
-
description && /* @__PURE__ */ (0,
|
|
7569
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_Stack6.default, { children: [
|
|
7570
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_Typography6.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: label }),
|
|
7571
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_Typography6.default, { variant: "body2", color: "textBody", children: description })
|
|
7286
7572
|
] }),
|
|
7287
7573
|
sx: {
|
|
7288
7574
|
alignItems: description ? "flex-start" : "center",
|
|
@@ -7291,7 +7577,7 @@ var RHFCheckbox = ({
|
|
|
7291
7577
|
...other
|
|
7292
7578
|
}
|
|
7293
7579
|
),
|
|
7294
|
-
(!!error2 || helperText) && /* @__PURE__ */ (0,
|
|
7580
|
+
(!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_FormHelperText5.default, { error: !!error2, ...slotProps?.formHelperText, children: error2 ? error2?.message : helperText })
|
|
7295
7581
|
] })
|
|
7296
7582
|
}
|
|
7297
7583
|
);
|
|
@@ -7307,13 +7593,13 @@ var RHFMultiCheckbox = ({
|
|
|
7307
7593
|
}) => {
|
|
7308
7594
|
const { control } = (0, import_react_hook_form8.useFormContext)();
|
|
7309
7595
|
const getSelected = (currentValues, optionValue) => currentValues.includes(optionValue) ? currentValues.filter((value) => value !== optionValue) : [...currentValues, optionValue];
|
|
7310
|
-
return /* @__PURE__ */ (0,
|
|
7596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7311
7597
|
import_react_hook_form8.Controller,
|
|
7312
7598
|
{
|
|
7313
7599
|
name,
|
|
7314
7600
|
control,
|
|
7315
7601
|
defaultValue: [],
|
|
7316
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7602
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
7317
7603
|
import_FormControl3.default,
|
|
7318
7604
|
{
|
|
7319
7605
|
component: "fieldset",
|
|
@@ -7321,7 +7607,7 @@ var RHFMultiCheckbox = ({
|
|
|
7321
7607
|
sx: slotProps?.formControl?.sx,
|
|
7322
7608
|
...slotProps?.formControl,
|
|
7323
7609
|
children: [
|
|
7324
|
-
label && /* @__PURE__ */ (0,
|
|
7610
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7325
7611
|
import_FormLabel3.default,
|
|
7326
7612
|
{
|
|
7327
7613
|
component: "legend",
|
|
@@ -7330,12 +7616,12 @@ var RHFMultiCheckbox = ({
|
|
|
7330
7616
|
children: label
|
|
7331
7617
|
}
|
|
7332
7618
|
),
|
|
7333
|
-
/* @__PURE__ */ (0,
|
|
7619
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_FormGroup2.default, { row, ...other, children: options.map((option) => {
|
|
7334
7620
|
const itemAriaLabel = option.label || `Option ${option.value}`;
|
|
7335
|
-
return /* @__PURE__ */ (0,
|
|
7621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7336
7622
|
import_FormControlLabel4.default,
|
|
7337
7623
|
{
|
|
7338
|
-
control: /* @__PURE__ */ (0,
|
|
7624
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7339
7625
|
import_Checkbox3.default,
|
|
7340
7626
|
{
|
|
7341
7627
|
checked: (field.value || []).includes(option.value),
|
|
@@ -7353,9 +7639,9 @@ var RHFMultiCheckbox = ({
|
|
|
7353
7639
|
}
|
|
7354
7640
|
}
|
|
7355
7641
|
),
|
|
7356
|
-
label: /* @__PURE__ */ (0,
|
|
7357
|
-
/* @__PURE__ */ (0,
|
|
7358
|
-
option?.description && /* @__PURE__ */ (0,
|
|
7642
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_Stack6.default, { children: [
|
|
7643
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_Typography6.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: option.label }),
|
|
7644
|
+
option?.description && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_Typography6.default, { variant: "body2", color: "textBody", children: option?.description })
|
|
7359
7645
|
] }),
|
|
7360
7646
|
sx: {
|
|
7361
7647
|
alignItems: option?.description ? "flex-start" : "center"
|
|
@@ -7364,7 +7650,7 @@ var RHFMultiCheckbox = ({
|
|
|
7364
7650
|
option.value
|
|
7365
7651
|
);
|
|
7366
7652
|
}) }),
|
|
7367
|
-
(!!error2 || helperText) && /* @__PURE__ */ (0,
|
|
7653
|
+
(!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7368
7654
|
import_FormHelperText5.default,
|
|
7369
7655
|
{
|
|
7370
7656
|
sx: { mx: 0, ...slotProps?.formHelperText?.sx },
|
|
@@ -7394,29 +7680,29 @@ var Field = {
|
|
|
7394
7680
|
// src/components/CopyButton/index.tsx
|
|
7395
7681
|
var import_Tooltip2 = __toESM(require("@mui/material/Tooltip"), 1);
|
|
7396
7682
|
var import_IconButton5 = __toESM(require("@mui/material/IconButton"), 1);
|
|
7397
|
-
var
|
|
7683
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
7398
7684
|
var CopyButton = ({ text: text2, size = "small" }) => {
|
|
7399
7685
|
const { copy, isCopied } = useCopyToClipboard();
|
|
7400
|
-
return /* @__PURE__ */ (0,
|
|
7686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_Tooltip2.default, { title: isCopied ? "Copied" : "Copy", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7401
7687
|
import_IconButton5.default,
|
|
7402
7688
|
{
|
|
7403
7689
|
size,
|
|
7404
7690
|
onClick: () => copy(text2),
|
|
7405
7691
|
"aria-label": "copy token",
|
|
7406
7692
|
sx: { color: "icon.black" },
|
|
7407
|
-
children: /* @__PURE__ */ (0,
|
|
7693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { icon: isCopied ? "ClipboardCheck" : "Copy", sx: { width: 20, height: 20 } })
|
|
7408
7694
|
}
|
|
7409
7695
|
) });
|
|
7410
7696
|
};
|
|
7411
7697
|
|
|
7412
7698
|
// src/components/LoadingScreen/index.tsx
|
|
7413
7699
|
var import_Portal = __toESM(require("@mui/material/Portal"), 1);
|
|
7414
|
-
var
|
|
7700
|
+
var import_Box16 = __toESM(require("@mui/material/Box"), 1);
|
|
7415
7701
|
var import_LinearProgress = __toESM(require("@mui/material/LinearProgress"), 1);
|
|
7416
|
-
var
|
|
7702
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
7417
7703
|
var LoadingScreen = ({ portal, sx, ...rest }) => {
|
|
7418
|
-
const content = /* @__PURE__ */ (0,
|
|
7419
|
-
|
|
7704
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7705
|
+
import_Box16.default,
|
|
7420
7706
|
{
|
|
7421
7707
|
sx: {
|
|
7422
7708
|
px: 5,
|
|
@@ -7429,17 +7715,17 @@ var LoadingScreen = ({ portal, sx, ...rest }) => {
|
|
|
7429
7715
|
...sx
|
|
7430
7716
|
},
|
|
7431
7717
|
...rest,
|
|
7432
|
-
children: /* @__PURE__ */ (0,
|
|
7718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_LinearProgress.default, { color: "primary", sx: { width: 1, maxWidth: 360 } })
|
|
7433
7719
|
}
|
|
7434
7720
|
);
|
|
7435
7721
|
if (portal) {
|
|
7436
|
-
return /* @__PURE__ */ (0,
|
|
7722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_Portal.default, { children: content });
|
|
7437
7723
|
}
|
|
7438
7724
|
return content;
|
|
7439
7725
|
};
|
|
7440
7726
|
var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
7441
|
-
const content = /* @__PURE__ */ (0,
|
|
7442
|
-
|
|
7727
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7728
|
+
import_Box16.default,
|
|
7443
7729
|
{
|
|
7444
7730
|
sx: {
|
|
7445
7731
|
right: 0,
|
|
@@ -7455,11 +7741,11 @@ var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
|
7455
7741
|
...sx
|
|
7456
7742
|
},
|
|
7457
7743
|
...rest,
|
|
7458
|
-
children: /* @__PURE__ */ (0,
|
|
7744
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(AnimatedLogo, {})
|
|
7459
7745
|
}
|
|
7460
7746
|
);
|
|
7461
7747
|
if (portal) {
|
|
7462
|
-
return /* @__PURE__ */ (0,
|
|
7748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_Portal.default, { children: content });
|
|
7463
7749
|
}
|
|
7464
7750
|
return content;
|
|
7465
7751
|
};
|
|
@@ -7479,6 +7765,7 @@ var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
|
7479
7765
|
Field,
|
|
7480
7766
|
Form,
|
|
7481
7767
|
Icon,
|
|
7768
|
+
Image,
|
|
7482
7769
|
InfoCircleFill,
|
|
7483
7770
|
InfoCircleOutline,
|
|
7484
7771
|
KeyCommand,
|
|
@@ -7592,6 +7879,8 @@ var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
|
7592
7879
|
updateCoreWithSettings,
|
|
7593
7880
|
useBoolean,
|
|
7594
7881
|
useCopyToClipboard,
|
|
7882
|
+
useCountdownDate,
|
|
7883
|
+
useCountdownSeconds,
|
|
7595
7884
|
useEventListener,
|
|
7596
7885
|
useLocalStorage,
|
|
7597
7886
|
usePopover,
|