@undefine-ui/design-system 2.10.1 → 2.12.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/dist/index.cjs CHANGED
@@ -56,10 +56,12 @@ __export(index_exports, {
56
56
  NavArrowDown: () => NavArrowDown,
57
57
  NavArrowLeft: () => NavArrowLeft,
58
58
  NavArrowRight: () => NavArrowRight,
59
+ OTPInput: () => OTPInput,
59
60
  RHFAutocomplete: () => RHFAutocomplete,
60
61
  RHFCheckbox: () => RHFCheckbox,
61
62
  RHFMultiCheckbox: () => RHFMultiCheckbox,
62
63
  RHFMultiSwitch: () => RHFMultiSwitch,
64
+ RHFOTPInput: () => RHFOTPInput,
63
65
  RHFRadioGroup: () => RHFRadioGroup,
64
66
  RHFSwitch: () => RHFSwitch,
65
67
  RHFTextField: () => RHFTextField,
@@ -155,6 +157,8 @@ __export(index_exports, {
155
157
  updateCoreWithSettings: () => updateCoreWithSettings,
156
158
  useBoolean: () => useBoolean,
157
159
  useCopyToClipboard: () => useCopyToClipboard,
160
+ useCountdownDate: () => useCountdownDate,
161
+ useCountdownSeconds: () => useCountdownSeconds,
158
162
  useEventListener: () => useEventListener,
159
163
  useLocalStorage: () => useLocalStorage,
160
164
  usePopover: () => usePopover,
@@ -786,13 +790,89 @@ var useSetState = (initialState) => {
786
790
  return memoizedValue;
787
791
  };
788
792
 
789
- // src/hooks/useResponsive.ts
793
+ // src/hooks/useCountdown.tsx
790
794
  var import_react7 = require("react");
795
+ var useCountdownDate = (date) => {
796
+ const targetTime = typeof date === "number" ? date : typeof date === "string" ? new Date(date).valueOf() : date.valueOf();
797
+ const [countdown, setCountdown] = (0, import_react7.useState)({
798
+ days: "00",
799
+ hours: "00",
800
+ minutes: "00",
801
+ seconds: "00"
802
+ });
803
+ const setNewTime = (0, import_react7.useCallback)(() => {
804
+ const now = Date.now();
805
+ const distanceToNow = targetTime - now;
806
+ if (distanceToNow <= 0) {
807
+ setCountdown({
808
+ days: "00",
809
+ hours: "00",
810
+ minutes: "00",
811
+ seconds: "00"
812
+ });
813
+ return;
814
+ }
815
+ const getDays = Math.floor(distanceToNow / (1e3 * 60 * 60 * 24));
816
+ const getHours = `0${Math.floor(distanceToNow % (1e3 * 60 * 60 * 24) / (1e3 * 60 * 60))}`.slice(-2);
817
+ const getMinutes = `0${Math.floor(distanceToNow % (1e3 * 60 * 60) / (1e3 * 60))}`.slice(-2);
818
+ const getSeconds = `0${Math.floor(distanceToNow % (1e3 * 60) / 1e3)}`.slice(-2);
819
+ setCountdown({
820
+ days: getDays < 10 ? `0${getDays}` : `${getDays}`,
821
+ hours: getHours,
822
+ minutes: getMinutes,
823
+ seconds: getSeconds
824
+ });
825
+ }, [targetTime]);
826
+ (0, import_react7.useEffect)(() => {
827
+ setNewTime();
828
+ const interval = setInterval(setNewTime, 1e3);
829
+ return () => clearInterval(interval);
830
+ }, [setNewTime]);
831
+ return countdown;
832
+ };
833
+ var useCountdownSeconds = (initCountdown) => {
834
+ const [countdown, setCountdown] = (0, import_react7.useState)(initCountdown);
835
+ const intervalIdRef = (0, import_react7.useRef)(null);
836
+ const remainingSecondsRef = (0, import_react7.useRef)(initCountdown);
837
+ const startCountdown = (0, import_react7.useCallback)(() => {
838
+ if (intervalIdRef.current) {
839
+ clearInterval(intervalIdRef.current);
840
+ }
841
+ remainingSecondsRef.current = initCountdown;
842
+ setCountdown(initCountdown);
843
+ intervalIdRef.current = setInterval(() => {
844
+ remainingSecondsRef.current -= 1;
845
+ if (remainingSecondsRef.current <= 0) {
846
+ if (intervalIdRef.current) clearInterval(intervalIdRef.current);
847
+ setCountdown(0);
848
+ } else {
849
+ setCountdown(remainingSecondsRef.current);
850
+ }
851
+ }, 1e3);
852
+ }, [initCountdown]);
853
+ (0, import_react7.useEffect)(() => {
854
+ return () => {
855
+ if (intervalIdRef.current) {
856
+ clearInterval(intervalIdRef.current);
857
+ }
858
+ };
859
+ }, []);
860
+ const counting = countdown > 0 && countdown < initCountdown;
861
+ return {
862
+ counting,
863
+ countdown,
864
+ startCountdown,
865
+ setCountdown
866
+ };
867
+ };
868
+
869
+ // src/hooks/useResponsive.ts
870
+ var import_react8 = require("react");
791
871
  var import_useMediaQuery = __toESM(require("@mui/material/useMediaQuery"), 1);
792
872
  var import_styles = require("@mui/material/styles");
793
873
  var useResponsive = (query, start, end) => {
794
874
  const theme = (0, import_styles.useTheme)();
795
- const getQuery = (0, import_react7.useMemo)(() => {
875
+ const getQuery = (0, import_react8.useMemo)(() => {
796
876
  switch (query) {
797
877
  case "up":
798
878
  return theme.breakpoints.up(start);
@@ -811,7 +891,7 @@ var useResponsive = (query, start, end) => {
811
891
  };
812
892
  var useWidth = () => {
813
893
  const theme = (0, import_styles.useTheme)();
814
- const keys = (0, import_react7.useMemo)(() => [...theme.breakpoints.keys].reverse(), [theme]);
894
+ const keys = (0, import_react8.useMemo)(() => [...theme.breakpoints.keys].reverse(), [theme]);
815
895
  const width = keys.reduce((output, key) => {
816
896
  const matches = (0, import_useMediaQuery.default)(theme.breakpoints.up(key));
817
897
  return !output && matches ? key : output;
@@ -820,19 +900,19 @@ var useWidth = () => {
820
900
  };
821
901
 
822
902
  // src/hooks/useEventListener.ts
823
- var import_react8 = require("react");
824
- var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react8.useLayoutEffect : import_react8.useEffect;
903
+ var import_react9 = require("react");
904
+ var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react9.useLayoutEffect : import_react9.useEffect;
825
905
  var useEventListener = ({
826
906
  eventName,
827
907
  handler,
828
908
  element,
829
909
  options
830
910
  }) => {
831
- const savedHandler = (0, import_react8.useRef)(handler);
911
+ const savedHandler = (0, import_react9.useRef)(handler);
832
912
  useIsomorphicLayoutEffect(() => {
833
913
  savedHandler.current = handler;
834
914
  }, [handler]);
835
- (0, import_react8.useEffect)(() => {
915
+ (0, import_react9.useEffect)(() => {
836
916
  const targetElement = element?.current || window;
837
917
  if (!(targetElement && targetElement.addEventListener)) {
838
918
  return;
@@ -846,11 +926,11 @@ var useEventListener = ({
846
926
  };
847
927
 
848
928
  // src/hooks/useCopyToClipboard.ts
849
- var import_react9 = require("react");
929
+ var import_react10 = require("react");
850
930
  var useCopyToClipboard = () => {
851
- const [copiedText, setCopiedText] = (0, import_react9.useState)("");
852
- const [isCopied, setIsCopied] = (0, import_react9.useState)(false);
853
- const copy = (0, import_react9.useCallback)(
931
+ const [copiedText, setCopiedText] = (0, import_react10.useState)("");
932
+ const [isCopied, setIsCopied] = (0, import_react10.useState)(false);
933
+ const copy = (0, import_react10.useCallback)(
854
934
  async (text2) => {
855
935
  if (!navigator?.clipboard) {
856
936
  console.warn("Clipboard not supported");
@@ -870,7 +950,7 @@ var useCopyToClipboard = () => {
870
950
  },
871
951
  [setCopiedText]
872
952
  );
873
- const memoizedValue = (0, import_react9.useMemo)(
953
+ const memoizedValue = (0, import_react10.useMemo)(
874
954
  () => ({ copy, copiedText, isCopied }),
875
955
  [copy, copiedText, isCopied]
876
956
  );
@@ -878,11 +958,11 @@ var useCopyToClipboard = () => {
878
958
  };
879
959
 
880
960
  // src/hooks/useScrollOffsetTop.ts
881
- var import_react10 = require("react");
961
+ var import_react11 = require("react");
882
962
  var useScrollOffSetTop = (top = 0) => {
883
- const elementRef = (0, import_react10.useRef)(null);
884
- const [offsetTop, setOffsetTop] = (0, import_react10.useState)(false);
885
- const handleScrollChange = (0, import_react10.useCallback)(() => {
963
+ const elementRef = (0, import_react11.useRef)(null);
964
+ const [offsetTop, setOffsetTop] = (0, import_react11.useState)(false);
965
+ const handleScrollChange = (0, import_react11.useCallback)(() => {
886
966
  const scrollHeight = Math.round(window.scrollY);
887
967
  if (elementRef?.current) {
888
968
  const rect = elementRef.current.getBoundingClientRect();
@@ -892,14 +972,14 @@ var useScrollOffSetTop = (top = 0) => {
892
972
  setOffsetTop(scrollHeight > top);
893
973
  }
894
974
  }, [top]);
895
- (0, import_react10.useEffect)(() => {
975
+ (0, import_react11.useEffect)(() => {
896
976
  handleScrollChange();
897
977
  window.addEventListener("scroll", handleScrollChange, { passive: true });
898
978
  return () => {
899
979
  window.removeEventListener("scroll", handleScrollChange);
900
980
  };
901
981
  }, [handleScrollChange]);
902
- const memoizedValue = (0, import_react10.useMemo)(() => ({ elementRef, offsetTop }), [offsetTop]);
982
+ const memoizedValue = (0, import_react11.useMemo)(() => ({ elementRef, offsetTop }), [offsetTop]);
903
983
  return memoizedValue;
904
984
  };
905
985
 
@@ -4512,7 +4592,7 @@ var MuiTextField = {
4512
4592
  lineHeight: 1.153,
4513
4593
  position: "relative",
4514
4594
  fontSize: theme.typography.h8.fontSize,
4515
- fontWeight: theme.typography.fontWeightMedium,
4595
+ fontWeight: `${theme.typography.fontWeightMedium} !important`,
4516
4596
  marginBottom: theme.spacing(1),
4517
4597
  color: `${theme.vars.palette.icon.black} !important`,
4518
4598
  // Focused state
@@ -6344,7 +6424,7 @@ var UploadProgress = ({ progress: progress2 = 20 }) => {
6344
6424
  };
6345
6425
 
6346
6426
  // src/components/Upload/components/MultiFilePreview.tsx
6347
- var import_react11 = require("react");
6427
+ var import_react12 = require("react");
6348
6428
  var import_Box9 = __toESM(require("@mui/material/Box"), 1);
6349
6429
  var import_IconButton3 = __toESM(require("@mui/material/IconButton"), 1);
6350
6430
 
@@ -6412,7 +6492,7 @@ var DeleteButton = ({ sx, ...rest }) => {
6412
6492
  // src/components/Upload/components/MultiFilePreview.tsx
6413
6493
  var import_jsx_runtime48 = require("react/jsx-runtime");
6414
6494
  var MultiFilePreview = ({ files, onRemove }) => {
6415
- const scrollRef = (0, import_react11.useRef)(null);
6495
+ const scrollRef = (0, import_react12.useRef)(null);
6416
6496
  const handleScroll = (direction) => {
6417
6497
  if (scrollRef.current) {
6418
6498
  const scrollAmount = 300;
@@ -6861,22 +6941,223 @@ var RHFUpload = ({ name, multiple, helperText, ...rest }) => {
6861
6941
  );
6862
6942
  };
6863
6943
 
6864
- // src/components/HookForm/RHFTextField.tsx
6944
+ // src/components/HookForm/RHFOTPInput.tsx
6865
6945
  var import_react_hook_form4 = require("react-hook-form");
6866
- var import_IconButton4 = __toESM(require("@mui/material/IconButton"), 1);
6867
- var import_InputAdornment2 = __toESM(require("@mui/material/InputAdornment"), 1);
6946
+
6947
+ // src/components/OTPInput/index.tsx
6948
+ var import_react13 = require("react");
6949
+ var import_styles37 = require("@mui/material/styles");
6950
+ var import_Box13 = __toESM(require("@mui/material/Box"), 1);
6951
+ var import_FormHelperText3 = __toESM(require("@mui/material/FormHelperText"), 1);
6952
+ var import_InputBase3 = require("@mui/material/InputBase");
6868
6953
  var import_TextField2 = __toESM(require("@mui/material/TextField"), 1);
6869
6954
  var import_jsx_runtime53 = require("react/jsx-runtime");
6955
+ var OTPInput = (props) => {
6956
+ const { length = 6, onChange, onComplete, error: error2, helperText, containerProps, ...rest } = props;
6957
+ const theme = (0, import_styles37.useTheme)();
6958
+ const [otp, setOtp] = (0, import_react13.useState)(Array(length).fill(""));
6959
+ const inputsRef = (0, import_react13.useRef)([]);
6960
+ const handleChange = (value, index) => {
6961
+ if (!/^[0-9]$/.test(value) && value !== "") return;
6962
+ const newOtp = [...otp];
6963
+ newOtp[index] = value;
6964
+ setOtp(newOtp);
6965
+ onChange?.(newOtp.join(""));
6966
+ if (value && index < length - 1) {
6967
+ inputsRef.current[index + 1]?.focus();
6968
+ }
6969
+ if (newOtp.every((val) => val !== "")) {
6970
+ onComplete?.(newOtp.join(""));
6971
+ }
6972
+ };
6973
+ const handleKeyDown = (event, index) => {
6974
+ if (event.key === "Backspace") {
6975
+ if (otp[index] === "") {
6976
+ if (index > 0) {
6977
+ inputsRef.current[index - 1]?.focus();
6978
+ setOtp((prevOtp) => {
6979
+ const newOtp = [...prevOtp];
6980
+ newOtp[index - 1] = "";
6981
+ return newOtp;
6982
+ });
6983
+ }
6984
+ } else {
6985
+ setOtp((prevOtp) => {
6986
+ const newOtp = [...prevOtp];
6987
+ newOtp[index] = "";
6988
+ return newOtp;
6989
+ });
6990
+ }
6991
+ } else if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
6992
+ if (index > 0) {
6993
+ inputsRef.current[index - 1]?.focus();
6994
+ }
6995
+ } else if (event.key === "ArrowRight" || event.key === "ArrowDown") {
6996
+ if (index < length - 1) {
6997
+ inputsRef.current[index + 1]?.focus();
6998
+ }
6999
+ }
7000
+ };
7001
+ const handlePaste = (event) => {
7002
+ event.preventDefault();
7003
+ const pasteData = event.clipboardData.getData("text");
7004
+ if (!/^\d+$/.test(pasteData)) return;
7005
+ const newOtp = [...otp];
7006
+ for (let i = 0; i < length; i++) {
7007
+ if (pasteData[i]) {
7008
+ newOtp[i] = pasteData[i];
7009
+ } else {
7010
+ newOtp[i] = "";
7011
+ }
7012
+ }
7013
+ setOtp(newOtp);
7014
+ onChange?.(newOtp.join(""));
7015
+ const filled = newOtp.filter((otp2) => otp2 !== "");
7016
+ inputsRef.current[filled.length]?.focus();
7017
+ if (newOtp.every((val) => val !== "")) {
7018
+ inputsRef.current[filled.length - 1]?.focus();
7019
+ onComplete?.(newOtp.join(""));
7020
+ }
7021
+ };
7022
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
7023
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_Box13.default, { display: "flex", justifyContent: "center", ...containerProps, children: otp.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
7024
+ import_Box13.default,
7025
+ {
7026
+ display: "flex",
7027
+ alignItems: "center",
7028
+ sx: {
7029
+ "&:not(:last-of-type)": {
7030
+ mr: 1.5
7031
+ }
7032
+ },
7033
+ children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
7034
+ import_TextField2.default,
7035
+ {
7036
+ size: "medium",
7037
+ value: otp[index],
7038
+ onChange: (e) => handleChange(e.target.value, index),
7039
+ onKeyDown: (e) => handleKeyDown(e, index),
7040
+ onPaste: handlePaste,
7041
+ inputRef: (el) => inputsRef.current[index] = el,
7042
+ error: error2,
7043
+ slotProps: {
7044
+ htmlInput: {
7045
+ maxLength: 1,
7046
+ inputMode: "numeric",
7047
+ autoComplete: "one-time-code"
7048
+ }
7049
+ },
7050
+ sx: {
7051
+ [`& .${import_InputBase3.inputBaseClasses.root}`]: {
7052
+ borderRadius: theme.radius["radius-lg"],
7053
+ backgroundColor: "transparent",
7054
+ border: `1px solid ${theme.vars.palette.border.default}`,
7055
+ transition: theme.transitions.create(
7056
+ ["background-color", "border-color", "box-shadow"],
7057
+ {
7058
+ duration: theme.transitions.duration.short
7059
+ }
7060
+ ),
7061
+ // Remove default underline
7062
+ "&::before, &::after": {
7063
+ display: "none"
7064
+ },
7065
+ // Hover state
7066
+ "&:hover": {
7067
+ backgroundColor: "transparent",
7068
+ borderColor: theme.vars.palette.border.default
7069
+ },
7070
+ // Focus state
7071
+ [`&.${import_InputBase3.inputBaseClasses.focused}`]: {
7072
+ backgroundColor: theme.vars.palette.common.white,
7073
+ border: `1px solid ${theme.vars.palette.border.default}`,
7074
+ boxShadow: `0 0 0 2px ${varAlpha(theme.vars.palette.primary["300Channel"], 1)}`
7075
+ },
7076
+ // Error state
7077
+ [`&.${import_InputBase3.inputBaseClasses.error}`]: {
7078
+ backgroundColor: theme.vars.palette.error[100],
7079
+ borderColor: theme.vars.palette.error[300],
7080
+ "&:hover": {
7081
+ backgroundColor: theme.vars.palette.error[100],
7082
+ borderColor: theme.vars.palette.error[300]
7083
+ },
7084
+ [`&.${import_InputBase3.inputBaseClasses.focused}`]: {
7085
+ backgroundColor: theme.vars.palette.error[100],
7086
+ border: `1px solid ${theme.vars.palette.border.default}`,
7087
+ boxShadow: `0 0 0 2px ${varAlpha(theme.vars.palette.error["300Channel"], 1)}`
7088
+ }
7089
+ },
7090
+ // Disabled state
7091
+ [`&.${import_InputBase3.inputBaseClasses.disabled}`]: {
7092
+ backgroundColor: theme.vars.palette.surface.disable,
7093
+ borderColor: theme.vars.palette.surface.disable,
7094
+ color: theme.vars.palette.text.disabled,
7095
+ "&:hover": {
7096
+ backgroundColor: theme.vars.palette.surface.disable,
7097
+ borderColor: theme.vars.palette.surface.disable
7098
+ }
7099
+ }
7100
+ },
7101
+ "& .MuiFilledInput-input": {
7102
+ padding: "0px !important",
7103
+ borderRadius: theme.radius["radius-lg"],
7104
+ fontWeight: 600,
7105
+ width: { xs: 44 },
7106
+ height: { xs: 44 },
7107
+ textAlign: "center"
7108
+ },
7109
+ ...rest.sx
7110
+ }
7111
+ }
7112
+ )
7113
+ },
7114
+ index
7115
+ )) }),
7116
+ error2 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_FormHelperText3.default, { sx: { color: "error.main" }, children: helperText })
7117
+ ] });
7118
+ };
7119
+ var OTPInput_default = OTPInput;
7120
+
7121
+ // src/components/HookForm/RHFOTPInput.tsx
7122
+ var import_jsx_runtime54 = require("react/jsx-runtime");
7123
+ var RHFOTPInput = ({ name, length = 6, helperText, ...rest }) => {
7124
+ const { control, setValue } = (0, import_react_hook_form4.useFormContext)();
7125
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
7126
+ import_react_hook_form4.Controller,
7127
+ {
7128
+ name,
7129
+ control,
7130
+ render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
7131
+ OTPInput_default,
7132
+ {
7133
+ length,
7134
+ onChange: field.onChange,
7135
+ onComplete: (otp) => setValue(name, otp),
7136
+ error: Boolean(error2),
7137
+ helperText: error2?.message ?? helperText,
7138
+ ...rest
7139
+ }
7140
+ )
7141
+ }
7142
+ );
7143
+ };
7144
+
7145
+ // src/components/HookForm/RHFTextField.tsx
7146
+ var import_react_hook_form5 = require("react-hook-form");
7147
+ var import_IconButton4 = __toESM(require("@mui/material/IconButton"), 1);
7148
+ var import_InputAdornment2 = __toESM(require("@mui/material/InputAdornment"), 1);
7149
+ var import_TextField3 = __toESM(require("@mui/material/TextField"), 1);
7150
+ var import_jsx_runtime55 = require("react/jsx-runtime");
6870
7151
  var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
6871
- const { control } = (0, import_react_hook_form4.useFormContext)();
7152
+ const { control } = (0, import_react_hook_form5.useFormContext)();
6872
7153
  const passwordVisibility = useBoolean();
6873
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6874
- import_react_hook_form4.Controller,
7154
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7155
+ import_react_hook_form5.Controller,
6875
7156
  {
6876
7157
  name,
6877
7158
  control,
6878
- render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
6879
- import_TextField2.default,
7159
+ render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7160
+ import_TextField3.default,
6880
7161
  {
6881
7162
  ...field,
6882
7163
  fullWidth: true,
@@ -6896,7 +7177,7 @@ var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
6896
7177
  input: {
6897
7178
  ...slotProps?.input,
6898
7179
  ...type === "password" && {
6899
- endAdornment: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_InputAdornment2.default, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_IconButton4.default, { edge: "end", onClick: passwordVisibility.onToggle, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
7180
+ endAdornment: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_InputAdornment2.default, { position: "end", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_IconButton4.default, { edge: "end", onClick: passwordVisibility.onToggle, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
6900
7181
  Icon,
6901
7182
  {
6902
7183
  icon: passwordVisibility.value ? "EyeClosed" : "Eye",
@@ -6914,7 +7195,7 @@ var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
6914
7195
  };
6915
7196
 
6916
7197
  // src/components/HookForm/RHFRadioGroup.tsx
6917
- var import_react_hook_form5 = require("react-hook-form");
7198
+ var import_react_hook_form6 = require("react-hook-form");
6918
7199
  var import_Stack5 = __toESM(require("@mui/material/Stack"), 1);
6919
7200
  var import_Typography5 = __toESM(require("@mui/material/Typography"), 1);
6920
7201
  var import_Radio2 = __toESM(require("@mui/material/Radio"), 1);
@@ -6922,8 +7203,8 @@ var import_FormControlLabel3 = __toESM(require("@mui/material/FormControlLabel")
6922
7203
  var import_FormLabel2 = __toESM(require("@mui/material/FormLabel"), 1);
6923
7204
  var import_RadioGroup = __toESM(require("@mui/material/RadioGroup"), 1);
6924
7205
  var import_FormControl2 = __toESM(require("@mui/material/FormControl"), 1);
6925
- var import_FormHelperText3 = __toESM(require("@mui/material/FormHelperText"), 1);
6926
- var import_jsx_runtime54 = require("react/jsx-runtime");
7206
+ var import_FormHelperText4 = __toESM(require("@mui/material/FormHelperText"), 1);
7207
+ var import_jsx_runtime56 = require("react/jsx-runtime");
6927
7208
  var RHFRadioGroup = ({
6928
7209
  name,
6929
7210
  label,
@@ -6932,16 +7213,16 @@ var RHFRadioGroup = ({
6932
7213
  slotProps,
6933
7214
  ...other
6934
7215
  }) => {
6935
- const { control } = (0, import_react_hook_form5.useFormContext)();
7216
+ const { control } = (0, import_react_hook_form6.useFormContext)();
6936
7217
  const labelledby = `${name}-radio-buttons-group-label`;
6937
7218
  const ariaLabel = (val) => `Radio ${val}`;
6938
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
6939
- import_react_hook_form5.Controller,
7219
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7220
+ import_react_hook_form6.Controller,
6940
7221
  {
6941
7222
  name,
6942
7223
  control,
6943
- render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_FormControl2.default, { component: "fieldset", sx: slotProps?.wrap, children: [
6944
- label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
7224
+ render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_FormControl2.default, { component: "fieldset", sx: slotProps?.wrap, children: [
7225
+ label && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6945
7226
  import_FormLabel2.default,
6946
7227
  {
6947
7228
  id: labelledby,
@@ -6951,11 +7232,11 @@ var RHFRadioGroup = ({
6951
7232
  children: label
6952
7233
  }
6953
7234
  ),
6954
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_RadioGroup.default, { ...field, "aria-labelledby": labelledby, ...other, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
7235
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_RadioGroup.default, { ...field, "aria-labelledby": labelledby, ...other, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6955
7236
  import_FormControlLabel3.default,
6956
7237
  {
6957
7238
  value: option.value,
6958
- control: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
7239
+ control: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6959
7240
  import_Radio2.default,
6960
7241
  {
6961
7242
  ...slotProps?.radio,
@@ -6967,9 +7248,9 @@ var RHFRadioGroup = ({
6967
7248
  }
6968
7249
  }
6969
7250
  ),
6970
- label: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_Stack5.default, { children: [
6971
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_Typography5.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: option.label }),
6972
- option?.description && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_Typography5.default, { variant: "body2", color: "textBody", children: option?.description })
7251
+ label: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_Stack5.default, { children: [
7252
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_Typography5.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: option.label }),
7253
+ option?.description && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_Typography5.default, { variant: "body2", color: "textBody", children: option?.description })
6973
7254
  ] }),
6974
7255
  sx: {
6975
7256
  alignItems: option?.description ? "flex-start" : "center"
@@ -6977,17 +7258,17 @@ var RHFRadioGroup = ({
6977
7258
  },
6978
7259
  option.value
6979
7260
  )) }),
6980
- (!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_FormHelperText3.default, { error: !!error2, sx: { mx: 0 }, ...slotProps?.formHelperText, children: error2 ? error2?.message : helperText })
7261
+ (!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_FormHelperText4.default, { error: !!error2, sx: { mx: 0 }, ...slotProps?.formHelperText, children: error2 ? error2?.message : helperText })
6981
7262
  ] })
6982
7263
  }
6983
7264
  );
6984
7265
  };
6985
7266
 
6986
7267
  // src/components/HookForm/RHFAutocomplete.tsx
6987
- var import_react_hook_form6 = require("react-hook-form");
6988
- var import_TextField3 = __toESM(require("@mui/material/TextField"), 1);
7268
+ var import_react_hook_form7 = require("react-hook-form");
7269
+ var import_TextField4 = __toESM(require("@mui/material/TextField"), 1);
6989
7270
  var import_Autocomplete4 = __toESM(require("@mui/material/Autocomplete"), 1);
6990
- var import_jsx_runtime55 = require("react/jsx-runtime");
7271
+ var import_jsx_runtime57 = require("react/jsx-runtime");
6991
7272
  var RHFAutocomplete = ({
6992
7273
  name,
6993
7274
  label,
@@ -6997,13 +7278,13 @@ var RHFAutocomplete = ({
6997
7278
  handleChange,
6998
7279
  ...other
6999
7280
  }) => {
7000
- const { control, setValue } = (0, import_react_hook_form6.useFormContext)();
7001
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7002
- import_react_hook_form6.Controller,
7281
+ const { control, setValue } = (0, import_react_hook_form7.useFormContext)();
7282
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
7283
+ import_react_hook_form7.Controller,
7003
7284
  {
7004
7285
  name,
7005
7286
  control,
7006
- render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7287
+ render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
7007
7288
  import_Autocomplete4.default,
7008
7289
  {
7009
7290
  ...field,
@@ -7012,8 +7293,8 @@ var RHFAutocomplete = ({
7012
7293
  setValue(name, newValue, { shouldValidate: true });
7013
7294
  handleChange?.(newValue);
7014
7295
  },
7015
- renderInput: (params) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
7016
- import_TextField3.default,
7296
+ renderInput: (params) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
7297
+ import_TextField4.default,
7017
7298
  {
7018
7299
  label,
7019
7300
  placeholder,
@@ -7031,17 +7312,17 @@ var RHFAutocomplete = ({
7031
7312
  };
7032
7313
 
7033
7314
  // src/components/HookForm/RHFCheckbox.tsx
7034
- var import_react_hook_form7 = require("react-hook-form");
7315
+ var import_react_hook_form8 = require("react-hook-form");
7035
7316
  var import_Stack6 = __toESM(require("@mui/material/Stack"), 1);
7036
- var import_Box13 = __toESM(require("@mui/material/Box"), 1);
7317
+ var import_Box14 = __toESM(require("@mui/material/Box"), 1);
7037
7318
  var import_Typography6 = __toESM(require("@mui/material/Typography"), 1);
7038
7319
  var import_Checkbox3 = __toESM(require("@mui/material/Checkbox"), 1);
7039
7320
  var import_FormGroup2 = __toESM(require("@mui/material/FormGroup"), 1);
7040
7321
  var import_FormLabel3 = __toESM(require("@mui/material/FormLabel"), 1);
7041
7322
  var import_FormControl3 = __toESM(require("@mui/material/FormControl"), 1);
7042
- var import_FormHelperText4 = __toESM(require("@mui/material/FormHelperText"), 1);
7323
+ var import_FormHelperText5 = __toESM(require("@mui/material/FormHelperText"), 1);
7043
7324
  var import_FormControlLabel4 = __toESM(require("@mui/material/FormControlLabel"), 1);
7044
- var import_jsx_runtime56 = require("react/jsx-runtime");
7325
+ var import_jsx_runtime58 = require("react/jsx-runtime");
7045
7326
  var RHFCheckbox = ({
7046
7327
  name,
7047
7328
  description,
@@ -7051,18 +7332,18 @@ var RHFCheckbox = ({
7051
7332
  slotProps,
7052
7333
  ...other
7053
7334
  }) => {
7054
- const { control } = (0, import_react_hook_form7.useFormContext)();
7335
+ const { control } = (0, import_react_hook_form8.useFormContext)();
7055
7336
  const baseAriaLabel = `Checkbox for ${name}`;
7056
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7057
- import_react_hook_form7.Controller,
7337
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7338
+ import_react_hook_form8.Controller,
7058
7339
  {
7059
7340
  name,
7060
7341
  control,
7061
- render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_Box13.default, { sx: slotProps?.wrap, children: [
7062
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7342
+ render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_Box14.default, { sx: slotProps?.wrap, children: [
7343
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7063
7344
  import_FormControlLabel4.default,
7064
7345
  {
7065
- control: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7346
+ control: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7066
7347
  import_Checkbox3.default,
7067
7348
  {
7068
7349
  ...field,
@@ -7077,9 +7358,9 @@ var RHFCheckbox = ({
7077
7358
  }
7078
7359
  }
7079
7360
  ),
7080
- label: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_Stack6.default, { children: [
7081
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_Typography6.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: label }),
7082
- description && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_Typography6.default, { variant: "body2", color: "textBody", children: description })
7361
+ label: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_Stack6.default, { children: [
7362
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_Typography6.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: label }),
7363
+ description && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_Typography6.default, { variant: "body2", color: "textBody", children: description })
7083
7364
  ] }),
7084
7365
  sx: {
7085
7366
  alignItems: description ? "flex-start" : "center",
@@ -7088,7 +7369,7 @@ var RHFCheckbox = ({
7088
7369
  ...other
7089
7370
  }
7090
7371
  ),
7091
- (!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_FormHelperText4.default, { error: !!error2, ...slotProps?.formHelperText, children: error2 ? error2?.message : helperText })
7372
+ (!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_FormHelperText5.default, { error: !!error2, ...slotProps?.formHelperText, children: error2 ? error2?.message : helperText })
7092
7373
  ] })
7093
7374
  }
7094
7375
  );
@@ -7102,15 +7383,15 @@ var RHFMultiCheckbox = ({
7102
7383
  row,
7103
7384
  ...other
7104
7385
  }) => {
7105
- const { control } = (0, import_react_hook_form7.useFormContext)();
7386
+ const { control } = (0, import_react_hook_form8.useFormContext)();
7106
7387
  const getSelected = (currentValues, optionValue) => currentValues.includes(optionValue) ? currentValues.filter((value) => value !== optionValue) : [...currentValues, optionValue];
7107
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7108
- import_react_hook_form7.Controller,
7388
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7389
+ import_react_hook_form8.Controller,
7109
7390
  {
7110
7391
  name,
7111
7392
  control,
7112
7393
  defaultValue: [],
7113
- render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
7394
+ render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
7114
7395
  import_FormControl3.default,
7115
7396
  {
7116
7397
  component: "fieldset",
@@ -7118,7 +7399,7 @@ var RHFMultiCheckbox = ({
7118
7399
  sx: slotProps?.formControl?.sx,
7119
7400
  ...slotProps?.formControl,
7120
7401
  children: [
7121
- label && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7402
+ label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7122
7403
  import_FormLabel3.default,
7123
7404
  {
7124
7405
  component: "legend",
@@ -7127,12 +7408,12 @@ var RHFMultiCheckbox = ({
7127
7408
  children: label
7128
7409
  }
7129
7410
  ),
7130
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_FormGroup2.default, { row, ...other, children: options.map((option) => {
7411
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_FormGroup2.default, { row, ...other, children: options.map((option) => {
7131
7412
  const itemAriaLabel = option.label || `Option ${option.value}`;
7132
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7413
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7133
7414
  import_FormControlLabel4.default,
7134
7415
  {
7135
- control: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7416
+ control: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7136
7417
  import_Checkbox3.default,
7137
7418
  {
7138
7419
  checked: (field.value || []).includes(option.value),
@@ -7150,9 +7431,9 @@ var RHFMultiCheckbox = ({
7150
7431
  }
7151
7432
  }
7152
7433
  ),
7153
- label: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_Stack6.default, { children: [
7154
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_Typography6.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: option.label }),
7155
- option?.description && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_Typography6.default, { variant: "body2", color: "textBody", children: option?.description })
7434
+ label: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_Stack6.default, { children: [
7435
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_Typography6.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: option.label }),
7436
+ option?.description && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_Typography6.default, { variant: "body2", color: "textBody", children: option?.description })
7156
7437
  ] }),
7157
7438
  sx: {
7158
7439
  alignItems: option?.description ? "flex-start" : "center"
@@ -7161,8 +7442,8 @@ var RHFMultiCheckbox = ({
7161
7442
  option.value
7162
7443
  );
7163
7444
  }) }),
7164
- (!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7165
- import_FormHelperText4.default,
7445
+ (!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7446
+ import_FormHelperText5.default,
7166
7447
  {
7167
7448
  sx: { mx: 0, ...slotProps?.formHelperText?.sx },
7168
7449
  ...slotProps?.formHelperText,
@@ -7178,6 +7459,7 @@ var RHFMultiCheckbox = ({
7178
7459
 
7179
7460
  // src/components/HookForm/fields.ts
7180
7461
  var Field = {
7462
+ OTP: RHFOTPInput,
7181
7463
  Switch: RHFSwitch,
7182
7464
  Upload: RHFUpload,
7183
7465
  Text: RHFTextField,
@@ -7190,29 +7472,29 @@ var Field = {
7190
7472
  // src/components/CopyButton/index.tsx
7191
7473
  var import_Tooltip2 = __toESM(require("@mui/material/Tooltip"), 1);
7192
7474
  var import_IconButton5 = __toESM(require("@mui/material/IconButton"), 1);
7193
- var import_jsx_runtime57 = require("react/jsx-runtime");
7475
+ var import_jsx_runtime59 = require("react/jsx-runtime");
7194
7476
  var CopyButton = ({ text: text2, size = "small" }) => {
7195
7477
  const { copy, isCopied } = useCopyToClipboard();
7196
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_Tooltip2.default, { title: isCopied ? "Copied" : "Copy", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
7478
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_Tooltip2.default, { title: isCopied ? "Copied" : "Copy", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
7197
7479
  import_IconButton5.default,
7198
7480
  {
7199
7481
  size,
7200
7482
  onClick: () => copy(text2),
7201
7483
  "aria-label": "copy token",
7202
7484
  sx: { color: "icon.black" },
7203
- children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { icon: isCopied ? "ClipboardCheck" : "Copy", sx: { width: 20, height: 20 } })
7485
+ children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { icon: isCopied ? "ClipboardCheck" : "Copy", sx: { width: 20, height: 20 } })
7204
7486
  }
7205
7487
  ) });
7206
7488
  };
7207
7489
 
7208
7490
  // src/components/LoadingScreen/index.tsx
7209
7491
  var import_Portal = __toESM(require("@mui/material/Portal"), 1);
7210
- var import_Box14 = __toESM(require("@mui/material/Box"), 1);
7492
+ var import_Box15 = __toESM(require("@mui/material/Box"), 1);
7211
7493
  var import_LinearProgress = __toESM(require("@mui/material/LinearProgress"), 1);
7212
- var import_jsx_runtime58 = require("react/jsx-runtime");
7494
+ var import_jsx_runtime60 = require("react/jsx-runtime");
7213
7495
  var LoadingScreen = ({ portal, sx, ...rest }) => {
7214
- const content = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7215
- import_Box14.default,
7496
+ const content = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
7497
+ import_Box15.default,
7216
7498
  {
7217
7499
  sx: {
7218
7500
  px: 5,
@@ -7225,17 +7507,17 @@ var LoadingScreen = ({ portal, sx, ...rest }) => {
7225
7507
  ...sx
7226
7508
  },
7227
7509
  ...rest,
7228
- children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_LinearProgress.default, { color: "primary", sx: { width: 1, maxWidth: 360 } })
7510
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_LinearProgress.default, { color: "primary", sx: { width: 1, maxWidth: 360 } })
7229
7511
  }
7230
7512
  );
7231
7513
  if (portal) {
7232
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_Portal.default, { children: content });
7514
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_Portal.default, { children: content });
7233
7515
  }
7234
7516
  return content;
7235
7517
  };
7236
7518
  var SplashScreen = ({ portal, sx, ...rest }) => {
7237
- const content = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7238
- import_Box14.default,
7519
+ const content = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
7520
+ import_Box15.default,
7239
7521
  {
7240
7522
  sx: {
7241
7523
  right: 0,
@@ -7251,11 +7533,11 @@ var SplashScreen = ({ portal, sx, ...rest }) => {
7251
7533
  ...sx
7252
7534
  },
7253
7535
  ...rest,
7254
- children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(AnimatedLogo, {})
7536
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(AnimatedLogo, {})
7255
7537
  }
7256
7538
  );
7257
7539
  if (portal) {
7258
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_Portal.default, { children: content });
7540
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_Portal.default, { children: content });
7259
7541
  }
7260
7542
  return content;
7261
7543
  };
@@ -7287,10 +7569,12 @@ var SplashScreen = ({ portal, sx, ...rest }) => {
7287
7569
  NavArrowDown,
7288
7570
  NavArrowLeft,
7289
7571
  NavArrowRight,
7572
+ OTPInput,
7290
7573
  RHFAutocomplete,
7291
7574
  RHFCheckbox,
7292
7575
  RHFMultiCheckbox,
7293
7576
  RHFMultiSwitch,
7577
+ RHFOTPInput,
7294
7578
  RHFRadioGroup,
7295
7579
  RHFSwitch,
7296
7580
  RHFTextField,
@@ -7386,6 +7670,8 @@ var SplashScreen = ({ portal, sx, ...rest }) => {
7386
7670
  updateCoreWithSettings,
7387
7671
  useBoolean,
7388
7672
  useCopyToClipboard,
7673
+ useCountdownDate,
7674
+ useCountdownSeconds,
7389
7675
  useEventListener,
7390
7676
  useLocalStorage,
7391
7677
  usePopover,