@undefine-ui/design-system 2.10.0 → 2.11.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 +62 -0
- package/dist/index.cjs +279 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +277 -76
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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,
|
|
@@ -4512,7 +4514,7 @@ var MuiTextField = {
|
|
|
4512
4514
|
lineHeight: 1.153,
|
|
4513
4515
|
position: "relative",
|
|
4514
4516
|
fontSize: theme.typography.h8.fontSize,
|
|
4515
|
-
fontWeight: theme.typography.fontWeightMedium
|
|
4517
|
+
fontWeight: `${theme.typography.fontWeightMedium} !important`,
|
|
4516
4518
|
marginBottom: theme.spacing(1),
|
|
4517
4519
|
color: `${theme.vars.palette.icon.black} !important`,
|
|
4518
4520
|
// Focused state
|
|
@@ -4589,9 +4591,6 @@ var MuiTextField = {
|
|
|
4589
4591
|
height: 20,
|
|
4590
4592
|
color: theme.vars.palette.icon.black
|
|
4591
4593
|
},
|
|
4592
|
-
[`& .${import_InputBase.inputBaseClasses.input}`]: {
|
|
4593
|
-
paddingLeft: 0
|
|
4594
|
-
},
|
|
4595
4594
|
[`& .${import_InputAdornment.inputAdornmentClasses.sizeSmall}`]: {
|
|
4596
4595
|
svg: { width: 16, height: 16 }
|
|
4597
4596
|
},
|
|
@@ -6864,22 +6863,223 @@ var RHFUpload = ({ name, multiple, helperText, ...rest }) => {
|
|
|
6864
6863
|
);
|
|
6865
6864
|
};
|
|
6866
6865
|
|
|
6867
|
-
// src/components/HookForm/
|
|
6866
|
+
// src/components/HookForm/RHFOTPInput.tsx
|
|
6868
6867
|
var import_react_hook_form4 = require("react-hook-form");
|
|
6869
|
-
|
|
6870
|
-
|
|
6868
|
+
|
|
6869
|
+
// src/components/OTPInput/index.tsx
|
|
6870
|
+
var import_react12 = require("react");
|
|
6871
|
+
var import_styles37 = require("@mui/material/styles");
|
|
6872
|
+
var import_Box13 = __toESM(require("@mui/material/Box"), 1);
|
|
6873
|
+
var import_FormHelperText3 = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
6874
|
+
var import_InputBase3 = require("@mui/material/InputBase");
|
|
6871
6875
|
var import_TextField2 = __toESM(require("@mui/material/TextField"), 1);
|
|
6872
6876
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
6877
|
+
var OTPInput = (props) => {
|
|
6878
|
+
const { length = 6, onChange, onComplete, error: error2, helperText, containerProps, ...rest } = props;
|
|
6879
|
+
const theme = (0, import_styles37.useTheme)();
|
|
6880
|
+
const [otp, setOtp] = (0, import_react12.useState)(Array(length).fill(""));
|
|
6881
|
+
const inputsRef = (0, import_react12.useRef)([]);
|
|
6882
|
+
const handleChange = (value, index) => {
|
|
6883
|
+
if (!/^[0-9]$/.test(value) && value !== "") return;
|
|
6884
|
+
const newOtp = [...otp];
|
|
6885
|
+
newOtp[index] = value;
|
|
6886
|
+
setOtp(newOtp);
|
|
6887
|
+
onChange?.(newOtp.join(""));
|
|
6888
|
+
if (value && index < length - 1) {
|
|
6889
|
+
inputsRef.current[index + 1]?.focus();
|
|
6890
|
+
}
|
|
6891
|
+
if (newOtp.every((val) => val !== "")) {
|
|
6892
|
+
onComplete?.(newOtp.join(""));
|
|
6893
|
+
}
|
|
6894
|
+
};
|
|
6895
|
+
const handleKeyDown = (event, index) => {
|
|
6896
|
+
if (event.key === "Backspace") {
|
|
6897
|
+
if (otp[index] === "") {
|
|
6898
|
+
if (index > 0) {
|
|
6899
|
+
inputsRef.current[index - 1]?.focus();
|
|
6900
|
+
setOtp((prevOtp) => {
|
|
6901
|
+
const newOtp = [...prevOtp];
|
|
6902
|
+
newOtp[index - 1] = "";
|
|
6903
|
+
return newOtp;
|
|
6904
|
+
});
|
|
6905
|
+
}
|
|
6906
|
+
} else {
|
|
6907
|
+
setOtp((prevOtp) => {
|
|
6908
|
+
const newOtp = [...prevOtp];
|
|
6909
|
+
newOtp[index] = "";
|
|
6910
|
+
return newOtp;
|
|
6911
|
+
});
|
|
6912
|
+
}
|
|
6913
|
+
} else if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
|
|
6914
|
+
if (index > 0) {
|
|
6915
|
+
inputsRef.current[index - 1]?.focus();
|
|
6916
|
+
}
|
|
6917
|
+
} else if (event.key === "ArrowRight" || event.key === "ArrowDown") {
|
|
6918
|
+
if (index < length - 1) {
|
|
6919
|
+
inputsRef.current[index + 1]?.focus();
|
|
6920
|
+
}
|
|
6921
|
+
}
|
|
6922
|
+
};
|
|
6923
|
+
const handlePaste = (event) => {
|
|
6924
|
+
event.preventDefault();
|
|
6925
|
+
const pasteData = event.clipboardData.getData("text");
|
|
6926
|
+
if (!/^\d+$/.test(pasteData)) return;
|
|
6927
|
+
const newOtp = [...otp];
|
|
6928
|
+
for (let i = 0; i < length; i++) {
|
|
6929
|
+
if (pasteData[i]) {
|
|
6930
|
+
newOtp[i] = pasteData[i];
|
|
6931
|
+
} else {
|
|
6932
|
+
newOtp[i] = "";
|
|
6933
|
+
}
|
|
6934
|
+
}
|
|
6935
|
+
setOtp(newOtp);
|
|
6936
|
+
onChange?.(newOtp.join(""));
|
|
6937
|
+
const filled = newOtp.filter((otp2) => otp2 !== "");
|
|
6938
|
+
inputsRef.current[filled.length]?.focus();
|
|
6939
|
+
if (newOtp.every((val) => val !== "")) {
|
|
6940
|
+
inputsRef.current[filled.length - 1]?.focus();
|
|
6941
|
+
onComplete?.(newOtp.join(""));
|
|
6942
|
+
}
|
|
6943
|
+
};
|
|
6944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
6945
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_Box13.default, { display: "flex", justifyContent: "center", ...containerProps, children: otp.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6946
|
+
import_Box13.default,
|
|
6947
|
+
{
|
|
6948
|
+
display: "flex",
|
|
6949
|
+
alignItems: "center",
|
|
6950
|
+
sx: {
|
|
6951
|
+
"&:not(:last-of-type)": {
|
|
6952
|
+
mr: 1.5
|
|
6953
|
+
}
|
|
6954
|
+
},
|
|
6955
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6956
|
+
import_TextField2.default,
|
|
6957
|
+
{
|
|
6958
|
+
size: "medium",
|
|
6959
|
+
value: otp[index],
|
|
6960
|
+
onChange: (e) => handleChange(e.target.value, index),
|
|
6961
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
6962
|
+
onPaste: handlePaste,
|
|
6963
|
+
inputRef: (el) => inputsRef.current[index] = el,
|
|
6964
|
+
error: error2,
|
|
6965
|
+
slotProps: {
|
|
6966
|
+
htmlInput: {
|
|
6967
|
+
maxLength: 1,
|
|
6968
|
+
inputMode: "numeric",
|
|
6969
|
+
autoComplete: "one-time-code"
|
|
6970
|
+
}
|
|
6971
|
+
},
|
|
6972
|
+
sx: {
|
|
6973
|
+
[`& .${import_InputBase3.inputBaseClasses.root}`]: {
|
|
6974
|
+
borderRadius: theme.radius["radius-lg"],
|
|
6975
|
+
backgroundColor: "transparent",
|
|
6976
|
+
border: `1px solid ${theme.vars.palette.border.default}`,
|
|
6977
|
+
transition: theme.transitions.create(
|
|
6978
|
+
["background-color", "border-color", "box-shadow"],
|
|
6979
|
+
{
|
|
6980
|
+
duration: theme.transitions.duration.short
|
|
6981
|
+
}
|
|
6982
|
+
),
|
|
6983
|
+
// Remove default underline
|
|
6984
|
+
"&::before, &::after": {
|
|
6985
|
+
display: "none"
|
|
6986
|
+
},
|
|
6987
|
+
// Hover state
|
|
6988
|
+
"&:hover": {
|
|
6989
|
+
backgroundColor: "transparent",
|
|
6990
|
+
borderColor: theme.vars.palette.border.default
|
|
6991
|
+
},
|
|
6992
|
+
// Focus state
|
|
6993
|
+
[`&.${import_InputBase3.inputBaseClasses.focused}`]: {
|
|
6994
|
+
backgroundColor: theme.vars.palette.common.white,
|
|
6995
|
+
border: `1px solid ${theme.vars.palette.border.default}`,
|
|
6996
|
+
boxShadow: `0 0 0 2px ${varAlpha(theme.vars.palette.primary["300Channel"], 1)}`
|
|
6997
|
+
},
|
|
6998
|
+
// Error state
|
|
6999
|
+
[`&.${import_InputBase3.inputBaseClasses.error}`]: {
|
|
7000
|
+
backgroundColor: theme.vars.palette.error[100],
|
|
7001
|
+
borderColor: theme.vars.palette.error[300],
|
|
7002
|
+
"&:hover": {
|
|
7003
|
+
backgroundColor: theme.vars.palette.error[100],
|
|
7004
|
+
borderColor: theme.vars.palette.error[300]
|
|
7005
|
+
},
|
|
7006
|
+
[`&.${import_InputBase3.inputBaseClasses.focused}`]: {
|
|
7007
|
+
backgroundColor: theme.vars.palette.error[100],
|
|
7008
|
+
border: `1px solid ${theme.vars.palette.border.default}`,
|
|
7009
|
+
boxShadow: `0 0 0 2px ${varAlpha(theme.vars.palette.error["300Channel"], 1)}`
|
|
7010
|
+
}
|
|
7011
|
+
},
|
|
7012
|
+
// Disabled state
|
|
7013
|
+
[`&.${import_InputBase3.inputBaseClasses.disabled}`]: {
|
|
7014
|
+
backgroundColor: theme.vars.palette.surface.disable,
|
|
7015
|
+
borderColor: theme.vars.palette.surface.disable,
|
|
7016
|
+
color: theme.vars.palette.text.disabled,
|
|
7017
|
+
"&:hover": {
|
|
7018
|
+
backgroundColor: theme.vars.palette.surface.disable,
|
|
7019
|
+
borderColor: theme.vars.palette.surface.disable
|
|
7020
|
+
}
|
|
7021
|
+
}
|
|
7022
|
+
},
|
|
7023
|
+
"& .MuiFilledInput-input": {
|
|
7024
|
+
padding: "0px !important",
|
|
7025
|
+
borderRadius: theme.radius["radius-lg"],
|
|
7026
|
+
fontWeight: 600,
|
|
7027
|
+
width: { xs: 44 },
|
|
7028
|
+
height: { xs: 44 },
|
|
7029
|
+
textAlign: "center"
|
|
7030
|
+
},
|
|
7031
|
+
...rest.sx
|
|
7032
|
+
}
|
|
7033
|
+
}
|
|
7034
|
+
)
|
|
7035
|
+
},
|
|
7036
|
+
index
|
|
7037
|
+
)) }),
|
|
7038
|
+
error2 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_FormHelperText3.default, { sx: { color: "error.main" }, children: helperText })
|
|
7039
|
+
] });
|
|
7040
|
+
};
|
|
7041
|
+
var OTPInput_default = OTPInput;
|
|
7042
|
+
|
|
7043
|
+
// src/components/HookForm/RHFOTPInput.tsx
|
|
7044
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
7045
|
+
var RHFOTPInput = ({ name, length = 6, helperText, ...rest }) => {
|
|
7046
|
+
const { control, setValue } = (0, import_react_hook_form4.useFormContext)();
|
|
7047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
7048
|
+
import_react_hook_form4.Controller,
|
|
7049
|
+
{
|
|
7050
|
+
name,
|
|
7051
|
+
control,
|
|
7052
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
7053
|
+
OTPInput_default,
|
|
7054
|
+
{
|
|
7055
|
+
length,
|
|
7056
|
+
onChange: field.onChange,
|
|
7057
|
+
onComplete: (otp) => setValue(name, otp),
|
|
7058
|
+
error: Boolean(error2),
|
|
7059
|
+
helperText: error2?.message ?? helperText,
|
|
7060
|
+
...rest
|
|
7061
|
+
}
|
|
7062
|
+
)
|
|
7063
|
+
}
|
|
7064
|
+
);
|
|
7065
|
+
};
|
|
7066
|
+
|
|
7067
|
+
// src/components/HookForm/RHFTextField.tsx
|
|
7068
|
+
var import_react_hook_form5 = require("react-hook-form");
|
|
7069
|
+
var import_IconButton4 = __toESM(require("@mui/material/IconButton"), 1);
|
|
7070
|
+
var import_InputAdornment2 = __toESM(require("@mui/material/InputAdornment"), 1);
|
|
7071
|
+
var import_TextField3 = __toESM(require("@mui/material/TextField"), 1);
|
|
7072
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
6873
7073
|
var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
|
|
6874
|
-
const { control } = (0,
|
|
7074
|
+
const { control } = (0, import_react_hook_form5.useFormContext)();
|
|
6875
7075
|
const passwordVisibility = useBoolean();
|
|
6876
|
-
return /* @__PURE__ */ (0,
|
|
6877
|
-
|
|
7076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7077
|
+
import_react_hook_form5.Controller,
|
|
6878
7078
|
{
|
|
6879
7079
|
name,
|
|
6880
7080
|
control,
|
|
6881
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
6882
|
-
|
|
7081
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7082
|
+
import_TextField3.default,
|
|
6883
7083
|
{
|
|
6884
7084
|
...field,
|
|
6885
7085
|
fullWidth: true,
|
|
@@ -6899,7 +7099,7 @@ var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
|
|
|
6899
7099
|
input: {
|
|
6900
7100
|
...slotProps?.input,
|
|
6901
7101
|
...type === "password" && {
|
|
6902
|
-
endAdornment: /* @__PURE__ */ (0,
|
|
7102
|
+
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)(
|
|
6903
7103
|
Icon,
|
|
6904
7104
|
{
|
|
6905
7105
|
icon: passwordVisibility.value ? "EyeClosed" : "Eye",
|
|
@@ -6917,7 +7117,7 @@ var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
|
|
|
6917
7117
|
};
|
|
6918
7118
|
|
|
6919
7119
|
// src/components/HookForm/RHFRadioGroup.tsx
|
|
6920
|
-
var
|
|
7120
|
+
var import_react_hook_form6 = require("react-hook-form");
|
|
6921
7121
|
var import_Stack5 = __toESM(require("@mui/material/Stack"), 1);
|
|
6922
7122
|
var import_Typography5 = __toESM(require("@mui/material/Typography"), 1);
|
|
6923
7123
|
var import_Radio2 = __toESM(require("@mui/material/Radio"), 1);
|
|
@@ -6925,8 +7125,8 @@ var import_FormControlLabel3 = __toESM(require("@mui/material/FormControlLabel")
|
|
|
6925
7125
|
var import_FormLabel2 = __toESM(require("@mui/material/FormLabel"), 1);
|
|
6926
7126
|
var import_RadioGroup = __toESM(require("@mui/material/RadioGroup"), 1);
|
|
6927
7127
|
var import_FormControl2 = __toESM(require("@mui/material/FormControl"), 1);
|
|
6928
|
-
var
|
|
6929
|
-
var
|
|
7128
|
+
var import_FormHelperText4 = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
7129
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
6930
7130
|
var RHFRadioGroup = ({
|
|
6931
7131
|
name,
|
|
6932
7132
|
label,
|
|
@@ -6935,16 +7135,16 @@ var RHFRadioGroup = ({
|
|
|
6935
7135
|
slotProps,
|
|
6936
7136
|
...other
|
|
6937
7137
|
}) => {
|
|
6938
|
-
const { control } = (0,
|
|
7138
|
+
const { control } = (0, import_react_hook_form6.useFormContext)();
|
|
6939
7139
|
const labelledby = `${name}-radio-buttons-group-label`;
|
|
6940
7140
|
const ariaLabel = (val) => `Radio ${val}`;
|
|
6941
|
-
return /* @__PURE__ */ (0,
|
|
6942
|
-
|
|
7141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7142
|
+
import_react_hook_form6.Controller,
|
|
6943
7143
|
{
|
|
6944
7144
|
name,
|
|
6945
7145
|
control,
|
|
6946
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
6947
|
-
label && /* @__PURE__ */ (0,
|
|
7146
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_FormControl2.default, { component: "fieldset", sx: slotProps?.wrap, children: [
|
|
7147
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6948
7148
|
import_FormLabel2.default,
|
|
6949
7149
|
{
|
|
6950
7150
|
id: labelledby,
|
|
@@ -6954,11 +7154,11 @@ var RHFRadioGroup = ({
|
|
|
6954
7154
|
children: label
|
|
6955
7155
|
}
|
|
6956
7156
|
),
|
|
6957
|
-
/* @__PURE__ */ (0,
|
|
7157
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_RadioGroup.default, { ...field, "aria-labelledby": labelledby, ...other, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6958
7158
|
import_FormControlLabel3.default,
|
|
6959
7159
|
{
|
|
6960
7160
|
value: option.value,
|
|
6961
|
-
control: /* @__PURE__ */ (0,
|
|
7161
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6962
7162
|
import_Radio2.default,
|
|
6963
7163
|
{
|
|
6964
7164
|
...slotProps?.radio,
|
|
@@ -6970,9 +7170,9 @@ var RHFRadioGroup = ({
|
|
|
6970
7170
|
}
|
|
6971
7171
|
}
|
|
6972
7172
|
),
|
|
6973
|
-
label: /* @__PURE__ */ (0,
|
|
6974
|
-
/* @__PURE__ */ (0,
|
|
6975
|
-
option?.description && /* @__PURE__ */ (0,
|
|
7173
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_Stack5.default, { children: [
|
|
7174
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_Typography5.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: option.label }),
|
|
7175
|
+
option?.description && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_Typography5.default, { variant: "body2", color: "textBody", children: option?.description })
|
|
6976
7176
|
] }),
|
|
6977
7177
|
sx: {
|
|
6978
7178
|
alignItems: option?.description ? "flex-start" : "center"
|
|
@@ -6980,17 +7180,17 @@ var RHFRadioGroup = ({
|
|
|
6980
7180
|
},
|
|
6981
7181
|
option.value
|
|
6982
7182
|
)) }),
|
|
6983
|
-
(!!error2 || helperText) && /* @__PURE__ */ (0,
|
|
7183
|
+
(!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_FormHelperText4.default, { error: !!error2, sx: { mx: 0 }, ...slotProps?.formHelperText, children: error2 ? error2?.message : helperText })
|
|
6984
7184
|
] })
|
|
6985
7185
|
}
|
|
6986
7186
|
);
|
|
6987
7187
|
};
|
|
6988
7188
|
|
|
6989
7189
|
// src/components/HookForm/RHFAutocomplete.tsx
|
|
6990
|
-
var
|
|
6991
|
-
var
|
|
7190
|
+
var import_react_hook_form7 = require("react-hook-form");
|
|
7191
|
+
var import_TextField4 = __toESM(require("@mui/material/TextField"), 1);
|
|
6992
7192
|
var import_Autocomplete4 = __toESM(require("@mui/material/Autocomplete"), 1);
|
|
6993
|
-
var
|
|
7193
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6994
7194
|
var RHFAutocomplete = ({
|
|
6995
7195
|
name,
|
|
6996
7196
|
label,
|
|
@@ -7000,13 +7200,13 @@ var RHFAutocomplete = ({
|
|
|
7000
7200
|
handleChange,
|
|
7001
7201
|
...other
|
|
7002
7202
|
}) => {
|
|
7003
|
-
const { control, setValue } = (0,
|
|
7004
|
-
return /* @__PURE__ */ (0,
|
|
7005
|
-
|
|
7203
|
+
const { control, setValue } = (0, import_react_hook_form7.useFormContext)();
|
|
7204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7205
|
+
import_react_hook_form7.Controller,
|
|
7006
7206
|
{
|
|
7007
7207
|
name,
|
|
7008
7208
|
control,
|
|
7009
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7209
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7010
7210
|
import_Autocomplete4.default,
|
|
7011
7211
|
{
|
|
7012
7212
|
...field,
|
|
@@ -7015,8 +7215,8 @@ var RHFAutocomplete = ({
|
|
|
7015
7215
|
setValue(name, newValue, { shouldValidate: true });
|
|
7016
7216
|
handleChange?.(newValue);
|
|
7017
7217
|
},
|
|
7018
|
-
renderInput: (params) => /* @__PURE__ */ (0,
|
|
7019
|
-
|
|
7218
|
+
renderInput: (params) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7219
|
+
import_TextField4.default,
|
|
7020
7220
|
{
|
|
7021
7221
|
label,
|
|
7022
7222
|
placeholder,
|
|
@@ -7034,17 +7234,17 @@ var RHFAutocomplete = ({
|
|
|
7034
7234
|
};
|
|
7035
7235
|
|
|
7036
7236
|
// src/components/HookForm/RHFCheckbox.tsx
|
|
7037
|
-
var
|
|
7237
|
+
var import_react_hook_form8 = require("react-hook-form");
|
|
7038
7238
|
var import_Stack6 = __toESM(require("@mui/material/Stack"), 1);
|
|
7039
|
-
var
|
|
7239
|
+
var import_Box14 = __toESM(require("@mui/material/Box"), 1);
|
|
7040
7240
|
var import_Typography6 = __toESM(require("@mui/material/Typography"), 1);
|
|
7041
7241
|
var import_Checkbox3 = __toESM(require("@mui/material/Checkbox"), 1);
|
|
7042
7242
|
var import_FormGroup2 = __toESM(require("@mui/material/FormGroup"), 1);
|
|
7043
7243
|
var import_FormLabel3 = __toESM(require("@mui/material/FormLabel"), 1);
|
|
7044
7244
|
var import_FormControl3 = __toESM(require("@mui/material/FormControl"), 1);
|
|
7045
|
-
var
|
|
7245
|
+
var import_FormHelperText5 = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
7046
7246
|
var import_FormControlLabel4 = __toESM(require("@mui/material/FormControlLabel"), 1);
|
|
7047
|
-
var
|
|
7247
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7048
7248
|
var RHFCheckbox = ({
|
|
7049
7249
|
name,
|
|
7050
7250
|
description,
|
|
@@ -7054,18 +7254,18 @@ var RHFCheckbox = ({
|
|
|
7054
7254
|
slotProps,
|
|
7055
7255
|
...other
|
|
7056
7256
|
}) => {
|
|
7057
|
-
const { control } = (0,
|
|
7257
|
+
const { control } = (0, import_react_hook_form8.useFormContext)();
|
|
7058
7258
|
const baseAriaLabel = `Checkbox for ${name}`;
|
|
7059
|
-
return /* @__PURE__ */ (0,
|
|
7060
|
-
|
|
7259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7260
|
+
import_react_hook_form8.Controller,
|
|
7061
7261
|
{
|
|
7062
7262
|
name,
|
|
7063
7263
|
control,
|
|
7064
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7065
|
-
/* @__PURE__ */ (0,
|
|
7264
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_Box14.default, { sx: slotProps?.wrap, children: [
|
|
7265
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7066
7266
|
import_FormControlLabel4.default,
|
|
7067
7267
|
{
|
|
7068
|
-
control: /* @__PURE__ */ (0,
|
|
7268
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7069
7269
|
import_Checkbox3.default,
|
|
7070
7270
|
{
|
|
7071
7271
|
...field,
|
|
@@ -7080,9 +7280,9 @@ var RHFCheckbox = ({
|
|
|
7080
7280
|
}
|
|
7081
7281
|
}
|
|
7082
7282
|
),
|
|
7083
|
-
label: /* @__PURE__ */ (0,
|
|
7084
|
-
/* @__PURE__ */ (0,
|
|
7085
|
-
description && /* @__PURE__ */ (0,
|
|
7283
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_Stack6.default, { children: [
|
|
7284
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_Typography6.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: label }),
|
|
7285
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_Typography6.default, { variant: "body2", color: "textBody", children: description })
|
|
7086
7286
|
] }),
|
|
7087
7287
|
sx: {
|
|
7088
7288
|
alignItems: description ? "flex-start" : "center",
|
|
@@ -7091,7 +7291,7 @@ var RHFCheckbox = ({
|
|
|
7091
7291
|
...other
|
|
7092
7292
|
}
|
|
7093
7293
|
),
|
|
7094
|
-
(!!error2 || helperText) && /* @__PURE__ */ (0,
|
|
7294
|
+
(!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_FormHelperText5.default, { error: !!error2, ...slotProps?.formHelperText, children: error2 ? error2?.message : helperText })
|
|
7095
7295
|
] })
|
|
7096
7296
|
}
|
|
7097
7297
|
);
|
|
@@ -7105,15 +7305,15 @@ var RHFMultiCheckbox = ({
|
|
|
7105
7305
|
row,
|
|
7106
7306
|
...other
|
|
7107
7307
|
}) => {
|
|
7108
|
-
const { control } = (0,
|
|
7308
|
+
const { control } = (0, import_react_hook_form8.useFormContext)();
|
|
7109
7309
|
const getSelected = (currentValues, optionValue) => currentValues.includes(optionValue) ? currentValues.filter((value) => value !== optionValue) : [...currentValues, optionValue];
|
|
7110
|
-
return /* @__PURE__ */ (0,
|
|
7111
|
-
|
|
7310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7311
|
+
import_react_hook_form8.Controller,
|
|
7112
7312
|
{
|
|
7113
7313
|
name,
|
|
7114
7314
|
control,
|
|
7115
7315
|
defaultValue: [],
|
|
7116
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7316
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
7117
7317
|
import_FormControl3.default,
|
|
7118
7318
|
{
|
|
7119
7319
|
component: "fieldset",
|
|
@@ -7121,7 +7321,7 @@ var RHFMultiCheckbox = ({
|
|
|
7121
7321
|
sx: slotProps?.formControl?.sx,
|
|
7122
7322
|
...slotProps?.formControl,
|
|
7123
7323
|
children: [
|
|
7124
|
-
label && /* @__PURE__ */ (0,
|
|
7324
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7125
7325
|
import_FormLabel3.default,
|
|
7126
7326
|
{
|
|
7127
7327
|
component: "legend",
|
|
@@ -7130,12 +7330,12 @@ var RHFMultiCheckbox = ({
|
|
|
7130
7330
|
children: label
|
|
7131
7331
|
}
|
|
7132
7332
|
),
|
|
7133
|
-
/* @__PURE__ */ (0,
|
|
7333
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_FormGroup2.default, { row, ...other, children: options.map((option) => {
|
|
7134
7334
|
const itemAriaLabel = option.label || `Option ${option.value}`;
|
|
7135
|
-
return /* @__PURE__ */ (0,
|
|
7335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7136
7336
|
import_FormControlLabel4.default,
|
|
7137
7337
|
{
|
|
7138
|
-
control: /* @__PURE__ */ (0,
|
|
7338
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7139
7339
|
import_Checkbox3.default,
|
|
7140
7340
|
{
|
|
7141
7341
|
checked: (field.value || []).includes(option.value),
|
|
@@ -7153,9 +7353,9 @@ var RHFMultiCheckbox = ({
|
|
|
7153
7353
|
}
|
|
7154
7354
|
}
|
|
7155
7355
|
),
|
|
7156
|
-
label: /* @__PURE__ */ (0,
|
|
7157
|
-
/* @__PURE__ */ (0,
|
|
7158
|
-
option?.description && /* @__PURE__ */ (0,
|
|
7356
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_Stack6.default, { children: [
|
|
7357
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_Typography6.default, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: option.label }),
|
|
7358
|
+
option?.description && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_Typography6.default, { variant: "body2", color: "textBody", children: option?.description })
|
|
7159
7359
|
] }),
|
|
7160
7360
|
sx: {
|
|
7161
7361
|
alignItems: option?.description ? "flex-start" : "center"
|
|
@@ -7164,8 +7364,8 @@ var RHFMultiCheckbox = ({
|
|
|
7164
7364
|
option.value
|
|
7165
7365
|
);
|
|
7166
7366
|
}) }),
|
|
7167
|
-
(!!error2 || helperText) && /* @__PURE__ */ (0,
|
|
7168
|
-
|
|
7367
|
+
(!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7368
|
+
import_FormHelperText5.default,
|
|
7169
7369
|
{
|
|
7170
7370
|
sx: { mx: 0, ...slotProps?.formHelperText?.sx },
|
|
7171
7371
|
...slotProps?.formHelperText,
|
|
@@ -7181,6 +7381,7 @@ var RHFMultiCheckbox = ({
|
|
|
7181
7381
|
|
|
7182
7382
|
// src/components/HookForm/fields.ts
|
|
7183
7383
|
var Field = {
|
|
7384
|
+
OTP: RHFOTPInput,
|
|
7184
7385
|
Switch: RHFSwitch,
|
|
7185
7386
|
Upload: RHFUpload,
|
|
7186
7387
|
Text: RHFTextField,
|
|
@@ -7193,29 +7394,29 @@ var Field = {
|
|
|
7193
7394
|
// src/components/CopyButton/index.tsx
|
|
7194
7395
|
var import_Tooltip2 = __toESM(require("@mui/material/Tooltip"), 1);
|
|
7195
7396
|
var import_IconButton5 = __toESM(require("@mui/material/IconButton"), 1);
|
|
7196
|
-
var
|
|
7397
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
7197
7398
|
var CopyButton = ({ text: text2, size = "small" }) => {
|
|
7198
7399
|
const { copy, isCopied } = useCopyToClipboard();
|
|
7199
|
-
return /* @__PURE__ */ (0,
|
|
7400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_Tooltip2.default, { title: isCopied ? "Copied" : "Copy", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7200
7401
|
import_IconButton5.default,
|
|
7201
7402
|
{
|
|
7202
7403
|
size,
|
|
7203
7404
|
onClick: () => copy(text2),
|
|
7204
7405
|
"aria-label": "copy token",
|
|
7205
7406
|
sx: { color: "icon.black" },
|
|
7206
|
-
children: /* @__PURE__ */ (0,
|
|
7407
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { icon: isCopied ? "ClipboardCheck" : "Copy", sx: { width: 20, height: 20 } })
|
|
7207
7408
|
}
|
|
7208
7409
|
) });
|
|
7209
7410
|
};
|
|
7210
7411
|
|
|
7211
7412
|
// src/components/LoadingScreen/index.tsx
|
|
7212
7413
|
var import_Portal = __toESM(require("@mui/material/Portal"), 1);
|
|
7213
|
-
var
|
|
7414
|
+
var import_Box15 = __toESM(require("@mui/material/Box"), 1);
|
|
7214
7415
|
var import_LinearProgress = __toESM(require("@mui/material/LinearProgress"), 1);
|
|
7215
|
-
var
|
|
7416
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
7216
7417
|
var LoadingScreen = ({ portal, sx, ...rest }) => {
|
|
7217
|
-
const content = /* @__PURE__ */ (0,
|
|
7218
|
-
|
|
7418
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7419
|
+
import_Box15.default,
|
|
7219
7420
|
{
|
|
7220
7421
|
sx: {
|
|
7221
7422
|
px: 5,
|
|
@@ -7228,17 +7429,17 @@ var LoadingScreen = ({ portal, sx, ...rest }) => {
|
|
|
7228
7429
|
...sx
|
|
7229
7430
|
},
|
|
7230
7431
|
...rest,
|
|
7231
|
-
children: /* @__PURE__ */ (0,
|
|
7432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_LinearProgress.default, { color: "primary", sx: { width: 1, maxWidth: 360 } })
|
|
7232
7433
|
}
|
|
7233
7434
|
);
|
|
7234
7435
|
if (portal) {
|
|
7235
|
-
return /* @__PURE__ */ (0,
|
|
7436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_Portal.default, { children: content });
|
|
7236
7437
|
}
|
|
7237
7438
|
return content;
|
|
7238
7439
|
};
|
|
7239
7440
|
var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
7240
|
-
const content = /* @__PURE__ */ (0,
|
|
7241
|
-
|
|
7441
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7442
|
+
import_Box15.default,
|
|
7242
7443
|
{
|
|
7243
7444
|
sx: {
|
|
7244
7445
|
right: 0,
|
|
@@ -7254,11 +7455,11 @@ var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
|
7254
7455
|
...sx
|
|
7255
7456
|
},
|
|
7256
7457
|
...rest,
|
|
7257
|
-
children: /* @__PURE__ */ (0,
|
|
7458
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(AnimatedLogo, {})
|
|
7258
7459
|
}
|
|
7259
7460
|
);
|
|
7260
7461
|
if (portal) {
|
|
7261
|
-
return /* @__PURE__ */ (0,
|
|
7462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_Portal.default, { children: content });
|
|
7262
7463
|
}
|
|
7263
7464
|
return content;
|
|
7264
7465
|
};
|
|
@@ -7290,10 +7491,12 @@ var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
|
7290
7491
|
NavArrowDown,
|
|
7291
7492
|
NavArrowLeft,
|
|
7292
7493
|
NavArrowRight,
|
|
7494
|
+
OTPInput,
|
|
7293
7495
|
RHFAutocomplete,
|
|
7294
7496
|
RHFCheckbox,
|
|
7295
7497
|
RHFMultiCheckbox,
|
|
7296
7498
|
RHFMultiSwitch,
|
|
7499
|
+
RHFOTPInput,
|
|
7297
7500
|
RHFRadioGroup,
|
|
7298
7501
|
RHFSwitch,
|
|
7299
7502
|
RHFTextField,
|