@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.js
CHANGED
|
@@ -4348,7 +4348,7 @@ var MuiTextField = {
|
|
|
4348
4348
|
lineHeight: 1.153,
|
|
4349
4349
|
position: "relative",
|
|
4350
4350
|
fontSize: theme.typography.h8.fontSize,
|
|
4351
|
-
fontWeight: theme.typography.fontWeightMedium
|
|
4351
|
+
fontWeight: `${theme.typography.fontWeightMedium} !important`,
|
|
4352
4352
|
marginBottom: theme.spacing(1),
|
|
4353
4353
|
color: `${theme.vars.palette.icon.black} !important`,
|
|
4354
4354
|
// Focused state
|
|
@@ -6706,22 +6706,223 @@ var RHFUpload = ({ name, multiple, helperText, ...rest }) => {
|
|
|
6706
6706
|
);
|
|
6707
6707
|
};
|
|
6708
6708
|
|
|
6709
|
-
// src/components/HookForm/
|
|
6709
|
+
// src/components/HookForm/RHFOTPInput.tsx
|
|
6710
6710
|
import { Controller as Controller3, useFormContext as useFormContext3 } from "react-hook-form";
|
|
6711
|
+
|
|
6712
|
+
// src/components/OTPInput/index.tsx
|
|
6713
|
+
import { useRef as useRef4, useState as useState8 } from "react";
|
|
6714
|
+
import { useTheme as useTheme2 } from "@mui/material/styles";
|
|
6715
|
+
import Box13 from "@mui/material/Box";
|
|
6716
|
+
import FormHelperText3 from "@mui/material/FormHelperText";
|
|
6717
|
+
import { inputBaseClasses as inputBaseClasses3 } from "@mui/material/InputBase";
|
|
6718
|
+
import TextField from "@mui/material/TextField";
|
|
6719
|
+
import { Fragment, jsx as jsx53, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6720
|
+
var OTPInput = (props) => {
|
|
6721
|
+
const { length = 6, onChange, onComplete, error: error2, helperText, containerProps, ...rest } = props;
|
|
6722
|
+
const theme = useTheme2();
|
|
6723
|
+
const [otp, setOtp] = useState8(Array(length).fill(""));
|
|
6724
|
+
const inputsRef = useRef4([]);
|
|
6725
|
+
const handleChange = (value, index) => {
|
|
6726
|
+
if (!/^[0-9]$/.test(value) && value !== "") return;
|
|
6727
|
+
const newOtp = [...otp];
|
|
6728
|
+
newOtp[index] = value;
|
|
6729
|
+
setOtp(newOtp);
|
|
6730
|
+
onChange?.(newOtp.join(""));
|
|
6731
|
+
if (value && index < length - 1) {
|
|
6732
|
+
inputsRef.current[index + 1]?.focus();
|
|
6733
|
+
}
|
|
6734
|
+
if (newOtp.every((val) => val !== "")) {
|
|
6735
|
+
onComplete?.(newOtp.join(""));
|
|
6736
|
+
}
|
|
6737
|
+
};
|
|
6738
|
+
const handleKeyDown = (event, index) => {
|
|
6739
|
+
if (event.key === "Backspace") {
|
|
6740
|
+
if (otp[index] === "") {
|
|
6741
|
+
if (index > 0) {
|
|
6742
|
+
inputsRef.current[index - 1]?.focus();
|
|
6743
|
+
setOtp((prevOtp) => {
|
|
6744
|
+
const newOtp = [...prevOtp];
|
|
6745
|
+
newOtp[index - 1] = "";
|
|
6746
|
+
return newOtp;
|
|
6747
|
+
});
|
|
6748
|
+
}
|
|
6749
|
+
} else {
|
|
6750
|
+
setOtp((prevOtp) => {
|
|
6751
|
+
const newOtp = [...prevOtp];
|
|
6752
|
+
newOtp[index] = "";
|
|
6753
|
+
return newOtp;
|
|
6754
|
+
});
|
|
6755
|
+
}
|
|
6756
|
+
} else if (event.key === "ArrowLeft" || event.key === "ArrowUp") {
|
|
6757
|
+
if (index > 0) {
|
|
6758
|
+
inputsRef.current[index - 1]?.focus();
|
|
6759
|
+
}
|
|
6760
|
+
} else if (event.key === "ArrowRight" || event.key === "ArrowDown") {
|
|
6761
|
+
if (index < length - 1) {
|
|
6762
|
+
inputsRef.current[index + 1]?.focus();
|
|
6763
|
+
}
|
|
6764
|
+
}
|
|
6765
|
+
};
|
|
6766
|
+
const handlePaste = (event) => {
|
|
6767
|
+
event.preventDefault();
|
|
6768
|
+
const pasteData = event.clipboardData.getData("text");
|
|
6769
|
+
if (!/^\d+$/.test(pasteData)) return;
|
|
6770
|
+
const newOtp = [...otp];
|
|
6771
|
+
for (let i = 0; i < length; i++) {
|
|
6772
|
+
if (pasteData[i]) {
|
|
6773
|
+
newOtp[i] = pasteData[i];
|
|
6774
|
+
} else {
|
|
6775
|
+
newOtp[i] = "";
|
|
6776
|
+
}
|
|
6777
|
+
}
|
|
6778
|
+
setOtp(newOtp);
|
|
6779
|
+
onChange?.(newOtp.join(""));
|
|
6780
|
+
const filled = newOtp.filter((otp2) => otp2 !== "");
|
|
6781
|
+
inputsRef.current[filled.length]?.focus();
|
|
6782
|
+
if (newOtp.every((val) => val !== "")) {
|
|
6783
|
+
inputsRef.current[filled.length - 1]?.focus();
|
|
6784
|
+
onComplete?.(newOtp.join(""));
|
|
6785
|
+
}
|
|
6786
|
+
};
|
|
6787
|
+
return /* @__PURE__ */ jsxs30(Fragment, { children: [
|
|
6788
|
+
/* @__PURE__ */ jsx53(Box13, { display: "flex", justifyContent: "center", ...containerProps, children: otp.map((_, index) => /* @__PURE__ */ jsx53(
|
|
6789
|
+
Box13,
|
|
6790
|
+
{
|
|
6791
|
+
display: "flex",
|
|
6792
|
+
alignItems: "center",
|
|
6793
|
+
sx: {
|
|
6794
|
+
"&:not(:last-of-type)": {
|
|
6795
|
+
mr: 1.5
|
|
6796
|
+
}
|
|
6797
|
+
},
|
|
6798
|
+
children: /* @__PURE__ */ jsx53(
|
|
6799
|
+
TextField,
|
|
6800
|
+
{
|
|
6801
|
+
size: "medium",
|
|
6802
|
+
value: otp[index],
|
|
6803
|
+
onChange: (e) => handleChange(e.target.value, index),
|
|
6804
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
6805
|
+
onPaste: handlePaste,
|
|
6806
|
+
inputRef: (el) => inputsRef.current[index] = el,
|
|
6807
|
+
error: error2,
|
|
6808
|
+
slotProps: {
|
|
6809
|
+
htmlInput: {
|
|
6810
|
+
maxLength: 1,
|
|
6811
|
+
inputMode: "numeric",
|
|
6812
|
+
autoComplete: "one-time-code"
|
|
6813
|
+
}
|
|
6814
|
+
},
|
|
6815
|
+
sx: {
|
|
6816
|
+
[`& .${inputBaseClasses3.root}`]: {
|
|
6817
|
+
borderRadius: theme.radius["radius-lg"],
|
|
6818
|
+
backgroundColor: "transparent",
|
|
6819
|
+
border: `1px solid ${theme.vars.palette.border.default}`,
|
|
6820
|
+
transition: theme.transitions.create(
|
|
6821
|
+
["background-color", "border-color", "box-shadow"],
|
|
6822
|
+
{
|
|
6823
|
+
duration: theme.transitions.duration.short
|
|
6824
|
+
}
|
|
6825
|
+
),
|
|
6826
|
+
// Remove default underline
|
|
6827
|
+
"&::before, &::after": {
|
|
6828
|
+
display: "none"
|
|
6829
|
+
},
|
|
6830
|
+
// Hover state
|
|
6831
|
+
"&:hover": {
|
|
6832
|
+
backgroundColor: "transparent",
|
|
6833
|
+
borderColor: theme.vars.palette.border.default
|
|
6834
|
+
},
|
|
6835
|
+
// Focus state
|
|
6836
|
+
[`&.${inputBaseClasses3.focused}`]: {
|
|
6837
|
+
backgroundColor: theme.vars.palette.common.white,
|
|
6838
|
+
border: `1px solid ${theme.vars.palette.border.default}`,
|
|
6839
|
+
boxShadow: `0 0 0 2px ${varAlpha(theme.vars.palette.primary["300Channel"], 1)}`
|
|
6840
|
+
},
|
|
6841
|
+
// Error state
|
|
6842
|
+
[`&.${inputBaseClasses3.error}`]: {
|
|
6843
|
+
backgroundColor: theme.vars.palette.error[100],
|
|
6844
|
+
borderColor: theme.vars.palette.error[300],
|
|
6845
|
+
"&:hover": {
|
|
6846
|
+
backgroundColor: theme.vars.palette.error[100],
|
|
6847
|
+
borderColor: theme.vars.palette.error[300]
|
|
6848
|
+
},
|
|
6849
|
+
[`&.${inputBaseClasses3.focused}`]: {
|
|
6850
|
+
backgroundColor: theme.vars.palette.error[100],
|
|
6851
|
+
border: `1px solid ${theme.vars.palette.border.default}`,
|
|
6852
|
+
boxShadow: `0 0 0 2px ${varAlpha(theme.vars.palette.error["300Channel"], 1)}`
|
|
6853
|
+
}
|
|
6854
|
+
},
|
|
6855
|
+
// Disabled state
|
|
6856
|
+
[`&.${inputBaseClasses3.disabled}`]: {
|
|
6857
|
+
backgroundColor: theme.vars.palette.surface.disable,
|
|
6858
|
+
borderColor: theme.vars.palette.surface.disable,
|
|
6859
|
+
color: theme.vars.palette.text.disabled,
|
|
6860
|
+
"&:hover": {
|
|
6861
|
+
backgroundColor: theme.vars.palette.surface.disable,
|
|
6862
|
+
borderColor: theme.vars.palette.surface.disable
|
|
6863
|
+
}
|
|
6864
|
+
}
|
|
6865
|
+
},
|
|
6866
|
+
"& .MuiFilledInput-input": {
|
|
6867
|
+
padding: "0px !important",
|
|
6868
|
+
borderRadius: theme.radius["radius-lg"],
|
|
6869
|
+
fontWeight: 600,
|
|
6870
|
+
width: { xs: 44 },
|
|
6871
|
+
height: { xs: 44 },
|
|
6872
|
+
textAlign: "center"
|
|
6873
|
+
},
|
|
6874
|
+
...rest.sx
|
|
6875
|
+
}
|
|
6876
|
+
}
|
|
6877
|
+
)
|
|
6878
|
+
},
|
|
6879
|
+
index
|
|
6880
|
+
)) }),
|
|
6881
|
+
error2 && /* @__PURE__ */ jsx53(FormHelperText3, { sx: { color: "error.main" }, children: helperText })
|
|
6882
|
+
] });
|
|
6883
|
+
};
|
|
6884
|
+
var OTPInput_default = OTPInput;
|
|
6885
|
+
|
|
6886
|
+
// src/components/HookForm/RHFOTPInput.tsx
|
|
6887
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
6888
|
+
var RHFOTPInput = ({ name, length = 6, helperText, ...rest }) => {
|
|
6889
|
+
const { control, setValue } = useFormContext3();
|
|
6890
|
+
return /* @__PURE__ */ jsx54(
|
|
6891
|
+
Controller3,
|
|
6892
|
+
{
|
|
6893
|
+
name,
|
|
6894
|
+
control,
|
|
6895
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ jsx54(
|
|
6896
|
+
OTPInput_default,
|
|
6897
|
+
{
|
|
6898
|
+
length,
|
|
6899
|
+
onChange: field.onChange,
|
|
6900
|
+
onComplete: (otp) => setValue(name, otp),
|
|
6901
|
+
error: Boolean(error2),
|
|
6902
|
+
helperText: error2?.message ?? helperText,
|
|
6903
|
+
...rest
|
|
6904
|
+
}
|
|
6905
|
+
)
|
|
6906
|
+
}
|
|
6907
|
+
);
|
|
6908
|
+
};
|
|
6909
|
+
|
|
6910
|
+
// src/components/HookForm/RHFTextField.tsx
|
|
6911
|
+
import { Controller as Controller4, useFormContext as useFormContext4 } from "react-hook-form";
|
|
6711
6912
|
import IconButton3 from "@mui/material/IconButton";
|
|
6712
6913
|
import InputAdornment from "@mui/material/InputAdornment";
|
|
6713
|
-
import
|
|
6714
|
-
import { jsx as
|
|
6914
|
+
import TextField2 from "@mui/material/TextField";
|
|
6915
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
6715
6916
|
var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
|
|
6716
|
-
const { control } =
|
|
6917
|
+
const { control } = useFormContext4();
|
|
6717
6918
|
const passwordVisibility = useBoolean();
|
|
6718
|
-
return /* @__PURE__ */
|
|
6719
|
-
|
|
6919
|
+
return /* @__PURE__ */ jsx55(
|
|
6920
|
+
Controller4,
|
|
6720
6921
|
{
|
|
6721
6922
|
name,
|
|
6722
6923
|
control,
|
|
6723
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */
|
|
6724
|
-
|
|
6924
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ jsx55(
|
|
6925
|
+
TextField2,
|
|
6725
6926
|
{
|
|
6726
6927
|
...field,
|
|
6727
6928
|
fullWidth: true,
|
|
@@ -6741,7 +6942,7 @@ var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
|
|
|
6741
6942
|
input: {
|
|
6742
6943
|
...slotProps?.input,
|
|
6743
6944
|
...type === "password" && {
|
|
6744
|
-
endAdornment: /* @__PURE__ */
|
|
6945
|
+
endAdornment: /* @__PURE__ */ jsx55(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx55(IconButton3, { edge: "end", onClick: passwordVisibility.onToggle, children: /* @__PURE__ */ jsx55(
|
|
6745
6946
|
Icon,
|
|
6746
6947
|
{
|
|
6747
6948
|
icon: passwordVisibility.value ? "EyeClosed" : "Eye",
|
|
@@ -6759,7 +6960,7 @@ var RHFTextField = ({ name, helperText, type, slotProps, ...rest }) => {
|
|
|
6759
6960
|
};
|
|
6760
6961
|
|
|
6761
6962
|
// src/components/HookForm/RHFRadioGroup.tsx
|
|
6762
|
-
import { Controller as
|
|
6963
|
+
import { Controller as Controller5, useFormContext as useFormContext5 } from "react-hook-form";
|
|
6763
6964
|
import Stack5 from "@mui/material/Stack";
|
|
6764
6965
|
import Typography4 from "@mui/material/Typography";
|
|
6765
6966
|
import Radio from "@mui/material/Radio";
|
|
@@ -6767,8 +6968,8 @@ import FormControlLabel2 from "@mui/material/FormControlLabel";
|
|
|
6767
6968
|
import FormLabel2 from "@mui/material/FormLabel";
|
|
6768
6969
|
import RadioGroup from "@mui/material/RadioGroup";
|
|
6769
6970
|
import FormControl2 from "@mui/material/FormControl";
|
|
6770
|
-
import
|
|
6771
|
-
import { jsx as
|
|
6971
|
+
import FormHelperText4 from "@mui/material/FormHelperText";
|
|
6972
|
+
import { jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
6772
6973
|
var RHFRadioGroup = ({
|
|
6773
6974
|
name,
|
|
6774
6975
|
label,
|
|
@@ -6777,16 +6978,16 @@ var RHFRadioGroup = ({
|
|
|
6777
6978
|
slotProps,
|
|
6778
6979
|
...other
|
|
6779
6980
|
}) => {
|
|
6780
|
-
const { control } =
|
|
6981
|
+
const { control } = useFormContext5();
|
|
6781
6982
|
const labelledby = `${name}-radio-buttons-group-label`;
|
|
6782
6983
|
const ariaLabel = (val) => `Radio ${val}`;
|
|
6783
|
-
return /* @__PURE__ */
|
|
6784
|
-
|
|
6984
|
+
return /* @__PURE__ */ jsx56(
|
|
6985
|
+
Controller5,
|
|
6785
6986
|
{
|
|
6786
6987
|
name,
|
|
6787
6988
|
control,
|
|
6788
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */
|
|
6789
|
-
label && /* @__PURE__ */
|
|
6989
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ jsxs31(FormControl2, { component: "fieldset", sx: slotProps?.wrap, children: [
|
|
6990
|
+
label && /* @__PURE__ */ jsx56(
|
|
6790
6991
|
FormLabel2,
|
|
6791
6992
|
{
|
|
6792
6993
|
id: labelledby,
|
|
@@ -6796,11 +6997,11 @@ var RHFRadioGroup = ({
|
|
|
6796
6997
|
children: label
|
|
6797
6998
|
}
|
|
6798
6999
|
),
|
|
6799
|
-
/* @__PURE__ */
|
|
7000
|
+
/* @__PURE__ */ jsx56(RadioGroup, { ...field, "aria-labelledby": labelledby, ...other, children: options.map((option) => /* @__PURE__ */ jsx56(
|
|
6800
7001
|
FormControlLabel2,
|
|
6801
7002
|
{
|
|
6802
7003
|
value: option.value,
|
|
6803
|
-
control: /* @__PURE__ */
|
|
7004
|
+
control: /* @__PURE__ */ jsx56(
|
|
6804
7005
|
Radio,
|
|
6805
7006
|
{
|
|
6806
7007
|
...slotProps?.radio,
|
|
@@ -6812,9 +7013,9 @@ var RHFRadioGroup = ({
|
|
|
6812
7013
|
}
|
|
6813
7014
|
}
|
|
6814
7015
|
),
|
|
6815
|
-
label: /* @__PURE__ */
|
|
6816
|
-
/* @__PURE__ */
|
|
6817
|
-
option?.description && /* @__PURE__ */
|
|
7016
|
+
label: /* @__PURE__ */ jsxs31(Stack5, { children: [
|
|
7017
|
+
/* @__PURE__ */ jsx56(Typography4, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: option.label }),
|
|
7018
|
+
option?.description && /* @__PURE__ */ jsx56(Typography4, { variant: "body2", color: "textBody", children: option?.description })
|
|
6818
7019
|
] }),
|
|
6819
7020
|
sx: {
|
|
6820
7021
|
alignItems: option?.description ? "flex-start" : "center"
|
|
@@ -6822,17 +7023,17 @@ var RHFRadioGroup = ({
|
|
|
6822
7023
|
},
|
|
6823
7024
|
option.value
|
|
6824
7025
|
)) }),
|
|
6825
|
-
(!!error2 || helperText) && /* @__PURE__ */
|
|
7026
|
+
(!!error2 || helperText) && /* @__PURE__ */ jsx56(FormHelperText4, { error: !!error2, sx: { mx: 0 }, ...slotProps?.formHelperText, children: error2 ? error2?.message : helperText })
|
|
6826
7027
|
] })
|
|
6827
7028
|
}
|
|
6828
7029
|
);
|
|
6829
7030
|
};
|
|
6830
7031
|
|
|
6831
7032
|
// src/components/HookForm/RHFAutocomplete.tsx
|
|
6832
|
-
import { Controller as
|
|
6833
|
-
import
|
|
7033
|
+
import { Controller as Controller6, useFormContext as useFormContext6 } from "react-hook-form";
|
|
7034
|
+
import TextField3 from "@mui/material/TextField";
|
|
6834
7035
|
import Autocomplete from "@mui/material/Autocomplete";
|
|
6835
|
-
import { jsx as
|
|
7036
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
6836
7037
|
var RHFAutocomplete = ({
|
|
6837
7038
|
name,
|
|
6838
7039
|
label,
|
|
@@ -6842,13 +7043,13 @@ var RHFAutocomplete = ({
|
|
|
6842
7043
|
handleChange,
|
|
6843
7044
|
...other
|
|
6844
7045
|
}) => {
|
|
6845
|
-
const { control, setValue } =
|
|
6846
|
-
return /* @__PURE__ */
|
|
6847
|
-
|
|
7046
|
+
const { control, setValue } = useFormContext6();
|
|
7047
|
+
return /* @__PURE__ */ jsx57(
|
|
7048
|
+
Controller6,
|
|
6848
7049
|
{
|
|
6849
7050
|
name,
|
|
6850
7051
|
control,
|
|
6851
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */
|
|
7052
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ jsx57(
|
|
6852
7053
|
Autocomplete,
|
|
6853
7054
|
{
|
|
6854
7055
|
...field,
|
|
@@ -6857,8 +7058,8 @@ var RHFAutocomplete = ({
|
|
|
6857
7058
|
setValue(name, newValue, { shouldValidate: true });
|
|
6858
7059
|
handleChange?.(newValue);
|
|
6859
7060
|
},
|
|
6860
|
-
renderInput: (params) => /* @__PURE__ */
|
|
6861
|
-
|
|
7061
|
+
renderInput: (params) => /* @__PURE__ */ jsx57(
|
|
7062
|
+
TextField3,
|
|
6862
7063
|
{
|
|
6863
7064
|
label,
|
|
6864
7065
|
placeholder,
|
|
@@ -6876,17 +7077,17 @@ var RHFAutocomplete = ({
|
|
|
6876
7077
|
};
|
|
6877
7078
|
|
|
6878
7079
|
// src/components/HookForm/RHFCheckbox.tsx
|
|
6879
|
-
import { Controller as
|
|
7080
|
+
import { Controller as Controller7, useFormContext as useFormContext7 } from "react-hook-form";
|
|
6880
7081
|
import Stack6 from "@mui/material/Stack";
|
|
6881
|
-
import
|
|
7082
|
+
import Box14 from "@mui/material/Box";
|
|
6882
7083
|
import Typography5 from "@mui/material/Typography";
|
|
6883
7084
|
import Checkbox from "@mui/material/Checkbox";
|
|
6884
7085
|
import FormGroup2 from "@mui/material/FormGroup";
|
|
6885
7086
|
import FormLabel3 from "@mui/material/FormLabel";
|
|
6886
7087
|
import FormControl3 from "@mui/material/FormControl";
|
|
6887
|
-
import
|
|
7088
|
+
import FormHelperText5 from "@mui/material/FormHelperText";
|
|
6888
7089
|
import FormControlLabel3 from "@mui/material/FormControlLabel";
|
|
6889
|
-
import { jsx as
|
|
7090
|
+
import { jsx as jsx58, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6890
7091
|
var RHFCheckbox = ({
|
|
6891
7092
|
name,
|
|
6892
7093
|
description,
|
|
@@ -6896,18 +7097,18 @@ var RHFCheckbox = ({
|
|
|
6896
7097
|
slotProps,
|
|
6897
7098
|
...other
|
|
6898
7099
|
}) => {
|
|
6899
|
-
const { control } =
|
|
7100
|
+
const { control } = useFormContext7();
|
|
6900
7101
|
const baseAriaLabel = `Checkbox for ${name}`;
|
|
6901
|
-
return /* @__PURE__ */
|
|
6902
|
-
|
|
7102
|
+
return /* @__PURE__ */ jsx58(
|
|
7103
|
+
Controller7,
|
|
6903
7104
|
{
|
|
6904
7105
|
name,
|
|
6905
7106
|
control,
|
|
6906
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */
|
|
6907
|
-
/* @__PURE__ */
|
|
7107
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ jsxs32(Box14, { sx: slotProps?.wrap, children: [
|
|
7108
|
+
/* @__PURE__ */ jsx58(
|
|
6908
7109
|
FormControlLabel3,
|
|
6909
7110
|
{
|
|
6910
|
-
control: /* @__PURE__ */
|
|
7111
|
+
control: /* @__PURE__ */ jsx58(
|
|
6911
7112
|
Checkbox,
|
|
6912
7113
|
{
|
|
6913
7114
|
...field,
|
|
@@ -6922,9 +7123,9 @@ var RHFCheckbox = ({
|
|
|
6922
7123
|
}
|
|
6923
7124
|
}
|
|
6924
7125
|
),
|
|
6925
|
-
label: /* @__PURE__ */
|
|
6926
|
-
/* @__PURE__ */
|
|
6927
|
-
description && /* @__PURE__ */
|
|
7126
|
+
label: /* @__PURE__ */ jsxs32(Stack6, { children: [
|
|
7127
|
+
/* @__PURE__ */ jsx58(Typography5, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: label }),
|
|
7128
|
+
description && /* @__PURE__ */ jsx58(Typography5, { variant: "body2", color: "textBody", children: description })
|
|
6928
7129
|
] }),
|
|
6929
7130
|
sx: {
|
|
6930
7131
|
alignItems: description ? "flex-start" : "center",
|
|
@@ -6933,7 +7134,7 @@ var RHFCheckbox = ({
|
|
|
6933
7134
|
...other
|
|
6934
7135
|
}
|
|
6935
7136
|
),
|
|
6936
|
-
(!!error2 || helperText) && /* @__PURE__ */
|
|
7137
|
+
(!!error2 || helperText) && /* @__PURE__ */ jsx58(FormHelperText5, { error: !!error2, ...slotProps?.formHelperText, children: error2 ? error2?.message : helperText })
|
|
6937
7138
|
] })
|
|
6938
7139
|
}
|
|
6939
7140
|
);
|
|
@@ -6947,15 +7148,15 @@ var RHFMultiCheckbox = ({
|
|
|
6947
7148
|
row,
|
|
6948
7149
|
...other
|
|
6949
7150
|
}) => {
|
|
6950
|
-
const { control } =
|
|
7151
|
+
const { control } = useFormContext7();
|
|
6951
7152
|
const getSelected = (currentValues, optionValue) => currentValues.includes(optionValue) ? currentValues.filter((value) => value !== optionValue) : [...currentValues, optionValue];
|
|
6952
|
-
return /* @__PURE__ */
|
|
6953
|
-
|
|
7153
|
+
return /* @__PURE__ */ jsx58(
|
|
7154
|
+
Controller7,
|
|
6954
7155
|
{
|
|
6955
7156
|
name,
|
|
6956
7157
|
control,
|
|
6957
7158
|
defaultValue: [],
|
|
6958
|
-
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */
|
|
7159
|
+
render: ({ field, fieldState: { error: error2 } }) => /* @__PURE__ */ jsxs32(
|
|
6959
7160
|
FormControl3,
|
|
6960
7161
|
{
|
|
6961
7162
|
component: "fieldset",
|
|
@@ -6963,7 +7164,7 @@ var RHFMultiCheckbox = ({
|
|
|
6963
7164
|
sx: slotProps?.formControl?.sx,
|
|
6964
7165
|
...slotProps?.formControl,
|
|
6965
7166
|
children: [
|
|
6966
|
-
label && /* @__PURE__ */
|
|
7167
|
+
label && /* @__PURE__ */ jsx58(
|
|
6967
7168
|
FormLabel3,
|
|
6968
7169
|
{
|
|
6969
7170
|
component: "legend",
|
|
@@ -6972,12 +7173,12 @@ var RHFMultiCheckbox = ({
|
|
|
6972
7173
|
children: label
|
|
6973
7174
|
}
|
|
6974
7175
|
),
|
|
6975
|
-
/* @__PURE__ */
|
|
7176
|
+
/* @__PURE__ */ jsx58(FormGroup2, { row, ...other, children: options.map((option) => {
|
|
6976
7177
|
const itemAriaLabel = option.label || `Option ${option.value}`;
|
|
6977
|
-
return /* @__PURE__ */
|
|
7178
|
+
return /* @__PURE__ */ jsx58(
|
|
6978
7179
|
FormControlLabel3,
|
|
6979
7180
|
{
|
|
6980
|
-
control: /* @__PURE__ */
|
|
7181
|
+
control: /* @__PURE__ */ jsx58(
|
|
6981
7182
|
Checkbox,
|
|
6982
7183
|
{
|
|
6983
7184
|
checked: (field.value || []).includes(option.value),
|
|
@@ -6995,9 +7196,9 @@ var RHFMultiCheckbox = ({
|
|
|
6995
7196
|
}
|
|
6996
7197
|
}
|
|
6997
7198
|
),
|
|
6998
|
-
label: /* @__PURE__ */
|
|
6999
|
-
/* @__PURE__ */
|
|
7000
|
-
option?.description && /* @__PURE__ */
|
|
7199
|
+
label: /* @__PURE__ */ jsxs32(Stack6, { children: [
|
|
7200
|
+
/* @__PURE__ */ jsx58(Typography5, { variant: "bodyMd", color: "textHeader", fontWeight: 500, children: option.label }),
|
|
7201
|
+
option?.description && /* @__PURE__ */ jsx58(Typography5, { variant: "body2", color: "textBody", children: option?.description })
|
|
7001
7202
|
] }),
|
|
7002
7203
|
sx: {
|
|
7003
7204
|
alignItems: option?.description ? "flex-start" : "center"
|
|
@@ -7006,8 +7207,8 @@ var RHFMultiCheckbox = ({
|
|
|
7006
7207
|
option.value
|
|
7007
7208
|
);
|
|
7008
7209
|
}) }),
|
|
7009
|
-
(!!error2 || helperText) && /* @__PURE__ */
|
|
7010
|
-
|
|
7210
|
+
(!!error2 || helperText) && /* @__PURE__ */ jsx58(
|
|
7211
|
+
FormHelperText5,
|
|
7011
7212
|
{
|
|
7012
7213
|
sx: { mx: 0, ...slotProps?.formHelperText?.sx },
|
|
7013
7214
|
...slotProps?.formHelperText,
|
|
@@ -7023,6 +7224,7 @@ var RHFMultiCheckbox = ({
|
|
|
7023
7224
|
|
|
7024
7225
|
// src/components/HookForm/fields.ts
|
|
7025
7226
|
var Field = {
|
|
7227
|
+
OTP: RHFOTPInput,
|
|
7026
7228
|
Switch: RHFSwitch,
|
|
7027
7229
|
Upload: RHFUpload,
|
|
7028
7230
|
Text: RHFTextField,
|
|
@@ -7035,29 +7237,29 @@ var Field = {
|
|
|
7035
7237
|
// src/components/CopyButton/index.tsx
|
|
7036
7238
|
import Tooltip from "@mui/material/Tooltip";
|
|
7037
7239
|
import IconButton4 from "@mui/material/IconButton";
|
|
7038
|
-
import { jsx as
|
|
7240
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
7039
7241
|
var CopyButton = ({ text: text2, size = "small" }) => {
|
|
7040
7242
|
const { copy, isCopied } = useCopyToClipboard();
|
|
7041
|
-
return /* @__PURE__ */
|
|
7243
|
+
return /* @__PURE__ */ jsx59(Tooltip, { title: isCopied ? "Copied" : "Copy", children: /* @__PURE__ */ jsx59(
|
|
7042
7244
|
IconButton4,
|
|
7043
7245
|
{
|
|
7044
7246
|
size,
|
|
7045
7247
|
onClick: () => copy(text2),
|
|
7046
7248
|
"aria-label": "copy token",
|
|
7047
7249
|
sx: { color: "icon.black" },
|
|
7048
|
-
children: /* @__PURE__ */
|
|
7250
|
+
children: /* @__PURE__ */ jsx59(Icon, { icon: isCopied ? "ClipboardCheck" : "Copy", sx: { width: 20, height: 20 } })
|
|
7049
7251
|
}
|
|
7050
7252
|
) });
|
|
7051
7253
|
};
|
|
7052
7254
|
|
|
7053
7255
|
// src/components/LoadingScreen/index.tsx
|
|
7054
7256
|
import Portal from "@mui/material/Portal";
|
|
7055
|
-
import
|
|
7257
|
+
import Box15 from "@mui/material/Box";
|
|
7056
7258
|
import LinearProgress from "@mui/material/LinearProgress";
|
|
7057
|
-
import { jsx as
|
|
7259
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
7058
7260
|
var LoadingScreen = ({ portal, sx, ...rest }) => {
|
|
7059
|
-
const content = /* @__PURE__ */
|
|
7060
|
-
|
|
7261
|
+
const content = /* @__PURE__ */ jsx60(
|
|
7262
|
+
Box15,
|
|
7061
7263
|
{
|
|
7062
7264
|
sx: {
|
|
7063
7265
|
px: 5,
|
|
@@ -7070,17 +7272,17 @@ var LoadingScreen = ({ portal, sx, ...rest }) => {
|
|
|
7070
7272
|
...sx
|
|
7071
7273
|
},
|
|
7072
7274
|
...rest,
|
|
7073
|
-
children: /* @__PURE__ */
|
|
7275
|
+
children: /* @__PURE__ */ jsx60(LinearProgress, { color: "primary", sx: { width: 1, maxWidth: 360 } })
|
|
7074
7276
|
}
|
|
7075
7277
|
);
|
|
7076
7278
|
if (portal) {
|
|
7077
|
-
return /* @__PURE__ */
|
|
7279
|
+
return /* @__PURE__ */ jsx60(Portal, { children: content });
|
|
7078
7280
|
}
|
|
7079
7281
|
return content;
|
|
7080
7282
|
};
|
|
7081
7283
|
var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
7082
|
-
const content = /* @__PURE__ */
|
|
7083
|
-
|
|
7284
|
+
const content = /* @__PURE__ */ jsx60(
|
|
7285
|
+
Box15,
|
|
7084
7286
|
{
|
|
7085
7287
|
sx: {
|
|
7086
7288
|
right: 0,
|
|
@@ -7096,11 +7298,11 @@ var SplashScreen = ({ portal, sx, ...rest }) => {
|
|
|
7096
7298
|
...sx
|
|
7097
7299
|
},
|
|
7098
7300
|
...rest,
|
|
7099
|
-
children: /* @__PURE__ */
|
|
7301
|
+
children: /* @__PURE__ */ jsx60(AnimatedLogo, {})
|
|
7100
7302
|
}
|
|
7101
7303
|
);
|
|
7102
7304
|
if (portal) {
|
|
7103
|
-
return /* @__PURE__ */
|
|
7305
|
+
return /* @__PURE__ */ jsx60(Portal, { children: content });
|
|
7104
7306
|
}
|
|
7105
7307
|
return content;
|
|
7106
7308
|
};
|
|
@@ -7131,10 +7333,12 @@ export {
|
|
|
7131
7333
|
NavArrowDown,
|
|
7132
7334
|
NavArrowLeft,
|
|
7133
7335
|
NavArrowRight,
|
|
7336
|
+
OTPInput,
|
|
7134
7337
|
RHFAutocomplete,
|
|
7135
7338
|
RHFCheckbox,
|
|
7136
7339
|
RHFMultiCheckbox,
|
|
7137
7340
|
RHFMultiSwitch,
|
|
7341
|
+
RHFOTPInput,
|
|
7138
7342
|
RHFRadioGroup,
|
|
7139
7343
|
RHFSwitch,
|
|
7140
7344
|
RHFTextField,
|