@undefine-ui/design-system 2.10.1 → 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 -73
- 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 -73
- 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
|
|
@@ -6861,22 +6863,223 @@ var RHFUpload = ({ name, multiple, helperText, ...rest }) => {
|
|
|
6861
6863
|
);
|
|
6862
6864
|
};
|
|
6863
6865
|
|
|
6864
|
-
// src/components/HookForm/
|
|
6866
|
+
// src/components/HookForm/RHFOTPInput.tsx
|
|
6865
6867
|
var import_react_hook_form4 = require("react-hook-form");
|
|
6866
|
-
|
|
6867
|
-
|
|
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");
|
|
6868
6875
|
var import_TextField2 = __toESM(require("@mui/material/TextField"), 1);
|
|
6869
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");
|
|
6870
7073
|
var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
|
|
6871
|
-
const { control } = (0,
|
|
7074
|
+
const { control } = (0, import_react_hook_form5.useFormContext)();
|
|
6872
7075
|
const passwordVisibility = useBoolean();
|
|
6873
|
-
return /* @__PURE__ */ (0,
|
|
6874
|
-
|
|
7076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7077
|
+
import_react_hook_form5.Controller,
|
|
6875
7078
|
{
|
|
6876
7079
|
name,
|
|
6877
7080
|
control,
|
|
6878
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
6879
|
-
|
|
7081
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7082
|
+
import_TextField3.default,
|
|
6880
7083
|
{
|
|
6881
7084
|
...field,
|
|
6882
7085
|
fullWidth: true,
|
|
@@ -6896,7 +7099,7 @@ var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
|
|
|
6896
7099
|
input: {
|
|
6897
7100
|
...slotProps?.input,
|
|
6898
7101
|
...type === "password" && {
|
|
6899
|
-
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)(
|
|
6900
7103
|
Icon,
|
|
6901
7104
|
{
|
|
6902
7105
|
icon: passwordVisibility.value ? "EyeClosed" : "Eye",
|
|
@@ -6914,7 +7117,7 @@ var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
|
|
|
6914
7117
|
};
|
|
6915
7118
|
|
|
6916
7119
|
// src/components/HookForm/RHFRadioGroup.tsx
|
|
6917
|
-
var
|
|
7120
|
+
var import_react_hook_form6 = require("react-hook-form");
|
|
6918
7121
|
var import_Stack5 = __toESM(require("@mui/material/Stack"), 1);
|
|
6919
7122
|
var import_Typography5 = __toESM(require("@mui/material/Typography"), 1);
|
|
6920
7123
|
var import_Radio2 = __toESM(require("@mui/material/Radio"), 1);
|
|
@@ -6922,8 +7125,8 @@ var import_FormControlLabel3 = __toESM(require("@mui/material/FormControlLabel")
|
|
|
6922
7125
|
var import_FormLabel2 = __toESM(require("@mui/material/FormLabel"), 1);
|
|
6923
7126
|
var import_RadioGroup = __toESM(require("@mui/material/RadioGroup"), 1);
|
|
6924
7127
|
var import_FormControl2 = __toESM(require("@mui/material/FormControl"), 1);
|
|
6925
|
-
var
|
|
6926
|
-
var
|
|
7128
|
+
var import_FormHelperText4 = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
7129
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
6927
7130
|
var RHFRadioGroup = ({
|
|
6928
7131
|
name,
|
|
6929
7132
|
label,
|
|
@@ -6932,16 +7135,16 @@ var RHFRadioGroup = ({
|
|
|
6932
7135
|
slotProps,
|
|
6933
7136
|
...other
|
|
6934
7137
|
}) => {
|
|
6935
|
-
const { control } = (0,
|
|
7138
|
+
const { control } = (0, import_react_hook_form6.useFormContext)();
|
|
6936
7139
|
const labelledby = `${name}-radio-buttons-group-label`;
|
|
6937
7140
|
const ariaLabel = (val) => `Radio ${val}`;
|
|
6938
|
-
return /* @__PURE__ */ (0,
|
|
6939
|
-
|
|
7141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
7142
|
+
import_react_hook_form6.Controller,
|
|
6940
7143
|
{
|
|
6941
7144
|
name,
|
|
6942
7145
|
control,
|
|
6943
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
6944
|
-
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)(
|
|
6945
7148
|
import_FormLabel2.default,
|
|
6946
7149
|
{
|
|
6947
7150
|
id: labelledby,
|
|
@@ -6951,11 +7154,11 @@ var RHFRadioGroup = ({
|
|
|
6951
7154
|
children: label
|
|
6952
7155
|
}
|
|
6953
7156
|
),
|
|
6954
|
-
/* @__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)(
|
|
6955
7158
|
import_FormControlLabel3.default,
|
|
6956
7159
|
{
|
|
6957
7160
|
value: option.value,
|
|
6958
|
-
control: /* @__PURE__ */ (0,
|
|
7161
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6959
7162
|
import_Radio2.default,
|
|
6960
7163
|
{
|
|
6961
7164
|
...slotProps?.radio,
|
|
@@ -6967,9 +7170,9 @@ var RHFRadioGroup = ({
|
|
|
6967
7170
|
}
|
|
6968
7171
|
}
|
|
6969
7172
|
),
|
|
6970
|
-
label: /* @__PURE__ */ (0,
|
|
6971
|
-
/* @__PURE__ */ (0,
|
|
6972
|
-
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 })
|
|
6973
7176
|
] }),
|
|
6974
7177
|
sx: {
|
|
6975
7178
|
alignItems: option?.description ? "flex-start" : "center"
|
|
@@ -6977,17 +7180,17 @@ var RHFRadioGroup = ({
|
|
|
6977
7180
|
},
|
|
6978
7181
|
option.value
|
|
6979
7182
|
)) }),
|
|
6980
|
-
(!!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 })
|
|
6981
7184
|
] })
|
|
6982
7185
|
}
|
|
6983
7186
|
);
|
|
6984
7187
|
};
|
|
6985
7188
|
|
|
6986
7189
|
// src/components/HookForm/RHFAutocomplete.tsx
|
|
6987
|
-
var
|
|
6988
|
-
var
|
|
7190
|
+
var import_react_hook_form7 = require("react-hook-form");
|
|
7191
|
+
var import_TextField4 = __toESM(require("@mui/material/TextField"), 1);
|
|
6989
7192
|
var import_Autocomplete4 = __toESM(require("@mui/material/Autocomplete"), 1);
|
|
6990
|
-
var
|
|
7193
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6991
7194
|
var RHFAutocomplete = ({
|
|
6992
7195
|
name,
|
|
6993
7196
|
label,
|
|
@@ -6997,13 +7200,13 @@ var RHFAutocomplete = ({
|
|
|
6997
7200
|
handleChange,
|
|
6998
7201
|
...other
|
|
6999
7202
|
}) => {
|
|
7000
|
-
const { control, setValue } = (0,
|
|
7001
|
-
return /* @__PURE__ */ (0,
|
|
7002
|
-
|
|
7203
|
+
const { control, setValue } = (0, import_react_hook_form7.useFormContext)();
|
|
7204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7205
|
+
import_react_hook_form7.Controller,
|
|
7003
7206
|
{
|
|
7004
7207
|
name,
|
|
7005
7208
|
control,
|
|
7006
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7209
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7007
7210
|
import_Autocomplete4.default,
|
|
7008
7211
|
{
|
|
7009
7212
|
...field,
|
|
@@ -7012,8 +7215,8 @@ var RHFAutocomplete = ({
|
|
|
7012
7215
|
setValue(name, newValue, { shouldValidate: true });
|
|
7013
7216
|
handleChange?.(newValue);
|
|
7014
7217
|
},
|
|
7015
|
-
renderInput: (params) => /* @__PURE__ */ (0,
|
|
7016
|
-
|
|
7218
|
+
renderInput: (params) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7219
|
+
import_TextField4.default,
|
|
7017
7220
|
{
|
|
7018
7221
|
label,
|
|
7019
7222
|
placeholder,
|
|
@@ -7031,17 +7234,17 @@ var RHFAutocomplete = ({
|
|
|
7031
7234
|
};
|
|
7032
7235
|
|
|
7033
7236
|
// src/components/HookForm/RHFCheckbox.tsx
|
|
7034
|
-
var
|
|
7237
|
+
var import_react_hook_form8 = require("react-hook-form");
|
|
7035
7238
|
var import_Stack6 = __toESM(require("@mui/material/Stack"), 1);
|
|
7036
|
-
var
|
|
7239
|
+
var import_Box14 = __toESM(require("@mui/material/Box"), 1);
|
|
7037
7240
|
var import_Typography6 = __toESM(require("@mui/material/Typography"), 1);
|
|
7038
7241
|
var import_Checkbox3 = __toESM(require("@mui/material/Checkbox"), 1);
|
|
7039
7242
|
var import_FormGroup2 = __toESM(require("@mui/material/FormGroup"), 1);
|
|
7040
7243
|
var import_FormLabel3 = __toESM(require("@mui/material/FormLabel"), 1);
|
|
7041
7244
|
var import_FormControl3 = __toESM(require("@mui/material/FormControl"), 1);
|
|
7042
|
-
var
|
|
7245
|
+
var import_FormHelperText5 = __toESM(require("@mui/material/FormHelperText"), 1);
|
|
7043
7246
|
var import_FormControlLabel4 = __toESM(require("@mui/material/FormControlLabel"), 1);
|
|
7044
|
-
var
|
|
7247
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7045
7248
|
var RHFCheckbox = ({
|
|
7046
7249
|
name,
|
|
7047
7250
|
description,
|
|
@@ -7051,18 +7254,18 @@ var RHFCheckbox = ({
|
|
|
7051
7254
|
slotProps,
|
|
7052
7255
|
...other
|
|
7053
7256
|
}) => {
|
|
7054
|
-
const { control } = (0,
|
|
7257
|
+
const { control } = (0, import_react_hook_form8.useFormContext)();
|
|
7055
7258
|
const baseAriaLabel = `Checkbox for ${name}`;
|
|
7056
|
-
return /* @__PURE__ */ (0,
|
|
7057
|
-
|
|
7259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7260
|
+
import_react_hook_form8.Controller,
|
|
7058
7261
|
{
|
|
7059
7262
|
name,
|
|
7060
7263
|
control,
|
|
7061
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7062
|
-
/* @__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)(
|
|
7063
7266
|
import_FormControlLabel4.default,
|
|
7064
7267
|
{
|
|
7065
|
-
control: /* @__PURE__ */ (0,
|
|
7268
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7066
7269
|
import_Checkbox3.default,
|
|
7067
7270
|
{
|
|
7068
7271
|
...field,
|
|
@@ -7077,9 +7280,9 @@ var RHFCheckbox = ({
|
|
|
7077
7280
|
}
|
|
7078
7281
|
}
|
|
7079
7282
|
),
|
|
7080
|
-
label: /* @__PURE__ */ (0,
|
|
7081
|
-
/* @__PURE__ */ (0,
|
|
7082
|
-
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 })
|
|
7083
7286
|
] }),
|
|
7084
7287
|
sx: {
|
|
7085
7288
|
alignItems: description ? "flex-start" : "center",
|
|
@@ -7088,7 +7291,7 @@ var RHFCheckbox = ({
|
|
|
7088
7291
|
...other
|
|
7089
7292
|
}
|
|
7090
7293
|
),
|
|
7091
|
-
(!!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 })
|
|
7092
7295
|
] })
|
|
7093
7296
|
}
|
|
7094
7297
|
);
|
|
@@ -7102,15 +7305,15 @@ var RHFMultiCheckbox = ({
|
|
|
7102
7305
|
row,
|
|
7103
7306
|
...other
|
|
7104
7307
|
}) => {
|
|
7105
|
-
const { control } = (0,
|
|
7308
|
+
const { control } = (0, import_react_hook_form8.useFormContext)();
|
|
7106
7309
|
const getSelected = (currentValues, optionValue) => currentValues.includes(optionValue) ? currentValues.filter((value) => value !== optionValue) : [...currentValues, optionValue];
|
|
7107
|
-
return /* @__PURE__ */ (0,
|
|
7108
|
-
|
|
7310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7311
|
+
import_react_hook_form8.Controller,
|
|
7109
7312
|
{
|
|
7110
7313
|
name,
|
|
7111
7314
|
control,
|
|
7112
7315
|
defaultValue: [],
|
|
7113
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0,
|
|
7316
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
7114
7317
|
import_FormControl3.default,
|
|
7115
7318
|
{
|
|
7116
7319
|
component: "fieldset",
|
|
@@ -7118,7 +7321,7 @@ var RHFMultiCheckbox = ({
|
|
|
7118
7321
|
sx: slotProps?.formControl?.sx,
|
|
7119
7322
|
...slotProps?.formControl,
|
|
7120
7323
|
children: [
|
|
7121
|
-
label && /* @__PURE__ */ (0,
|
|
7324
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7122
7325
|
import_FormLabel3.default,
|
|
7123
7326
|
{
|
|
7124
7327
|
component: "legend",
|
|
@@ -7127,12 +7330,12 @@ var RHFMultiCheckbox = ({
|
|
|
7127
7330
|
children: label
|
|
7128
7331
|
}
|
|
7129
7332
|
),
|
|
7130
|
-
/* @__PURE__ */ (0,
|
|
7333
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_FormGroup2.default, { row, ...other, children: options.map((option) => {
|
|
7131
7334
|
const itemAriaLabel = option.label || `Option ${option.value}`;
|
|
7132
|
-
return /* @__PURE__ */ (0,
|
|
7335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7133
7336
|
import_FormControlLabel4.default,
|
|
7134
7337
|
{
|
|
7135
|
-
control: /* @__PURE__ */ (0,
|
|
7338
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7136
7339
|
import_Checkbox3.default,
|
|
7137
7340
|
{
|
|
7138
7341
|
checked: (field.value || []).includes(option.value),
|
|
@@ -7150,9 +7353,9 @@ var RHFMultiCheckbox = ({
|
|
|
7150
7353
|
}
|
|
7151
7354
|
}
|
|
7152
7355
|
),
|
|
7153
|
-
label: /* @__PURE__ */ (0,
|
|
7154
|
-
/* @__PURE__ */ (0,
|
|
7155
|
-
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 })
|
|
7156
7359
|
] }),
|
|
7157
7360
|
sx: {
|
|
7158
7361
|
alignItems: option?.description ? "flex-start" : "center"
|
|
@@ -7161,8 +7364,8 @@ var RHFMultiCheckbox = ({
|
|
|
7161
7364
|
option.value
|
|
7162
7365
|
);
|
|
7163
7366
|
}) }),
|
|
7164
|
-
(!!error2 || helperText) && /* @__PURE__ */ (0,
|
|
7165
|
-
|
|
7367
|
+
(!!error2 || helperText) && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7368
|
+
import_FormHelperText5.default,
|
|
7166
7369
|
{
|
|
7167
7370
|
sx: { mx: 0, ...slotProps?.formHelperText?.sx },
|
|
7168
7371
|
...slotProps?.formHelperText,
|
|
@@ -7178,6 +7381,7 @@ var RHFMultiCheckbox = ({
|
|
|
7178
7381
|
|
|
7179
7382
|
// src/components/HookForm/fields.ts
|
|
7180
7383
|
var Field = {
|
|
7384
|
+
OTP: RHFOTPInput,
|
|
7181
7385
|
Switch: RHFSwitch,
|
|
7182
7386
|
Upload: RHFUpload,
|
|
7183
7387
|
Text: RHFTextField,
|
|
@@ -7190,29 +7394,29 @@ var Field = {
|
|
|
7190
7394
|
// src/components/CopyButton/index.tsx
|
|
7191
7395
|
var import_Tooltip2 = __toESM(require("@mui/material/Tooltip"), 1);
|
|
7192
7396
|
var import_IconButton5 = __toESM(require("@mui/material/IconButton"), 1);
|
|
7193
|
-
var
|
|
7397
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
7194
7398
|
var CopyButton = ({ text: text2, size = "small" }) => {
|
|
7195
7399
|
const { copy, isCopied } = useCopyToClipboard();
|
|
7196
|
-
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)(
|
|
7197
7401
|
import_IconButton5.default,
|
|
7198
7402
|
{
|
|
7199
7403
|
size,
|
|
7200
7404
|
onClick: () => copy(text2),
|
|
7201
7405
|
"aria-label": "copy token",
|
|
7202
7406
|
sx: { color: "icon.black" },
|
|
7203
|
-
children: /* @__PURE__ */ (0,
|
|
7407
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Icon, { icon: isCopied ? "ClipboardCheck" : "Copy", sx: { width: 20, height: 20 } })
|
|
7204
7408
|
}
|
|
7205
7409
|
) });
|
|
7206
7410
|
};
|
|
7207
7411
|
|
|
7208
7412
|
// src/components/LoadingScreen/index.tsx
|
|
7209
7413
|
var import_Portal = __toESM(require("@mui/material/Portal"), 1);
|
|
7210
|
-
var
|
|
7414
|
+
var import_Box15 = __toESM(require("@mui/material/Box"), 1);
|
|
7211
7415
|
var import_LinearProgress = __toESM(require("@mui/material/LinearProgress"), 1);
|
|
7212
|
-
var
|
|
7416
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
7213
7417
|
var LoadingScreen = ({ portal, sx, ...rest }) => {
|
|
7214
|
-
const content = /* @__PURE__ */ (0,
|
|
7215
|
-
|
|
7418
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7419
|
+
import_Box15.default,
|
|
7216
7420
|
{
|
|
7217
7421
|
sx: {
|
|
7218
7422
|
px: 5,
|
|
@@ -7225,17 +7429,17 @@ var LoadingScreen = ({ portal, sx, ...rest }) => {
|
|
|
7225
7429
|
...sx
|
|
7226
7430
|
},
|
|
7227
7431
|
...rest,
|
|
7228
|
-
children: /* @__PURE__ */ (0,
|
|
7432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_LinearProgress.default, { color: "primary", sx: { width: 1, maxWidth: 360 } })
|
|
7229
7433
|
}
|
|
7230
7434
|
);
|
|
7231
7435
|
if (portal) {
|
|
7232
|
-
return /* @__PURE__ */ (0,
|
|
7436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_Portal.default, { children: content });
|
|
7233
7437
|
}
|
|
7234
7438
|
return content;
|
|
7235
7439
|
};
|
|
7236
7440
|
var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
7237
|
-
const content = /* @__PURE__ */ (0,
|
|
7238
|
-
|
|
7441
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7442
|
+
import_Box15.default,
|
|
7239
7443
|
{
|
|
7240
7444
|
sx: {
|
|
7241
7445
|
right: 0,
|
|
@@ -7251,11 +7455,11 @@ var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
|
7251
7455
|
...sx
|
|
7252
7456
|
},
|
|
7253
7457
|
...rest,
|
|
7254
|
-
children: /* @__PURE__ */ (0,
|
|
7458
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(AnimatedLogo, {})
|
|
7255
7459
|
}
|
|
7256
7460
|
);
|
|
7257
7461
|
if (portal) {
|
|
7258
|
-
return /* @__PURE__ */ (0,
|
|
7462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_Portal.default, { children: content });
|
|
7259
7463
|
}
|
|
7260
7464
|
return content;
|
|
7261
7465
|
};
|
|
@@ -7287,10 +7491,12 @@ var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
|
7287
7491
|
NavArrowDown,
|
|
7288
7492
|
NavArrowLeft,
|
|
7289
7493
|
NavArrowRight,
|
|
7494
|
+
OTPInput,
|
|
7290
7495
|
RHFAutocomplete,
|
|
7291
7496
|
RHFCheckbox,
|
|
7292
7497
|
RHFMultiCheckbox,
|
|
7293
7498
|
RHFMultiSwitch,
|
|
7499
|
+
RHFOTPInput,
|
|
7294
7500
|
RHFRadioGroup,
|
|
7295
7501
|
RHFSwitch,
|
|
7296
7502
|
RHFTextField,
|