@pipelinesolucoes/form 1.0.0-beta.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/LICENSE +78 -0
- package/README.md +162 -0
- package/dist/app/layout.d.ts +6 -0
- package/dist/app/layout.js +19 -0
- package/dist/app/layout.js.map +1 -0
- package/dist/app/page.d.ts +1 -0
- package/dist/app/page.js +6 -0
- package/dist/app/page.js.map +1 -0
- package/dist/components/FormStyled.d.ts +37 -0
- package/dist/components/FormStyled.js +120 -0
- package/dist/components/FormStyled.js.map +1 -0
- package/dist/components/GoogleButton.d.ts +60 -0
- package/dist/components/GoogleButton.js +110 -0
- package/dist/components/GoogleButton.js.map +1 -0
- package/dist/components/LoginForm.d.ts +29 -0
- package/dist/components/LoginForm.js +143 -0
- package/dist/components/LoginForm.js.map +1 -0
- package/dist/components/RecaptchaForm.d.ts +21 -0
- package/dist/components/RecaptchaForm.js +118 -0
- package/dist/components/RecaptchaForm.js.map +1 -0
- package/dist/components/RecaptchaInvisible.d.ts +10 -0
- package/dist/components/RecaptchaInvisible.js +29 -0
- package/dist/components/RecaptchaInvisible.js.map +1 -0
- package/dist/components/RecaptchaMessage.d.ts +5 -0
- package/dist/components/RecaptchaMessage.js +46 -0
- package/dist/components/RecaptchaMessage.js.map +1 -0
- package/dist/components/RecuperarSenhaForm.d.ts +23 -0
- package/dist/components/RecuperarSenhaForm.js +98 -0
- package/dist/components/RecuperarSenhaForm.js.map +1 -0
- package/dist/components/SignUpForm.d.ts +26 -0
- package/dist/components/SignUpForm.js +149 -0
- package/dist/components/SignUpForm.js.map +1 -0
- package/dist/components/TextFieldValidate.d.ts +108 -0
- package/dist/components/TextFieldValidate.js +181 -0
- package/dist/components/TextFieldValidate.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/pages/_app.d.ts +2 -0
- package/dist/pages/_app.js +20 -0
- package/dist/pages/_app.js.map +1 -0
- package/dist/pages/_document.d.ts +9 -0
- package/dist/pages/_document.js +33 -0
- package/dist/pages/_document.js.map +1 -0
- package/dist/theme.d.ts +35 -0
- package/dist/theme.js +142 -0
- package/dist/theme.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/validateEmail.d.ts +37 -0
- package/dist/utils/validateEmail.js +50 -0
- package/dist/utils/validateEmail.js.map +1 -0
- package/dist/utils/validateTelefone.d.ts +36 -0
- package/dist/utils/validateTelefone.js +47 -0
- package/dist/utils/validateTelefone.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { Box, Divider, IconButton, InputAdornment, Typography } from '@mui/material';
|
|
6
|
+
import { ButtonFormStyled, LinkFormStyled, TextFieldStyled } from './FormStyled';
|
|
7
|
+
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
|
8
|
+
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
9
|
+
const FormContainer = styled('div')(() => ({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
gap: '16px',
|
|
13
|
+
width: '100%',
|
|
14
|
+
margin: 'auto',
|
|
15
|
+
padding: '0px',
|
|
16
|
+
}));
|
|
17
|
+
const DivPassword = styled('div')(() => ({
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
gap: '8px',
|
|
21
|
+
width: '100%',
|
|
22
|
+
margin: '0',
|
|
23
|
+
padding: '0',
|
|
24
|
+
}));
|
|
25
|
+
const DivTitulo = styled('div')(() => ({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
gap: '8px',
|
|
29
|
+
width: '100%',
|
|
30
|
+
margin: '0',
|
|
31
|
+
padding: '0',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
justifyContent: 'center'
|
|
34
|
+
}));
|
|
35
|
+
const DivLink = styled("div", {
|
|
36
|
+
shouldForwardProp: (prop) => !['text_color', 'align'].includes(prop),
|
|
37
|
+
})(({ theme, text_color, align }) => {
|
|
38
|
+
var _a, _b, _c, _d, _e, _f;
|
|
39
|
+
return ({
|
|
40
|
+
display: 'flex',
|
|
41
|
+
flexDirection: 'row',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
justifyContent: align,
|
|
44
|
+
width: '100%',
|
|
45
|
+
padding: '0',
|
|
46
|
+
flex: '1',
|
|
47
|
+
color: text_color,
|
|
48
|
+
// Tipografia
|
|
49
|
+
fontFamily: theme.typography.fontFamily,
|
|
50
|
+
fontWeight: (_a = theme.typography.body1) === null || _a === void 0 ? void 0 : _a.fontWeight,
|
|
51
|
+
fontStyle: (_b = theme.typography.body1) === null || _b === void 0 ? void 0 : _b.fontStyle,
|
|
52
|
+
lineHeight: (_c = theme.typography.body1) === null || _c === void 0 ? void 0 : _c.lineHeight,
|
|
53
|
+
letterSpacing: (_d = theme.typography.body1) === null || _d === void 0 ? void 0 : _d.letterSpacing,
|
|
54
|
+
fontSize: (_e = theme.typography.body1) === null || _e === void 0 ? void 0 : _e.fontSize,
|
|
55
|
+
margin: (_f = theme.typography.body1) === null || _f === void 0 ? void 0 : _f.margin,
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
const SignUpForm = ({ Icon, titulo, googleButton, color, background = 'transparent', border_radius = '0px', background_color_field = 'transparent', border_radius_field = '0px', color_button, background_color_button = 'transparent', border_radius_button = '0px', text_button, message_sucess, color_message_sucess, message_erro, color_message_erro, color_separador, children, urlLogin, color_link, }) => {
|
|
59
|
+
const [mensagemApi, setMensagemApi] = useState('');
|
|
60
|
+
const [corMensagemApi, setCorMensagemApi] = useState(color_message_erro);
|
|
61
|
+
const [email, setEmail] = useState('');
|
|
62
|
+
const [password, setPassword] = useState('');
|
|
63
|
+
const [errors, setErrors] = useState({});
|
|
64
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
65
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
66
|
+
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
|
|
67
|
+
const [confirmPassword, setConfirmPassword] = useState('');
|
|
68
|
+
const validateEmail = (email) => /\S+@\S+\.\S+/.test(email);
|
|
69
|
+
const handleBlur = (field) => {
|
|
70
|
+
switch (field) {
|
|
71
|
+
case 'email':
|
|
72
|
+
setErrors((prevErrors) => (Object.assign(Object.assign({}, prevErrors), { email: !validateEmail(email) })));
|
|
73
|
+
break;
|
|
74
|
+
case 'password':
|
|
75
|
+
setErrors((prevErrors) => (Object.assign(Object.assign({}, prevErrors), { password: !password.trim() })));
|
|
76
|
+
break;
|
|
77
|
+
case 'confirmPassword':
|
|
78
|
+
setErrors((prevErrors) => (Object.assign(Object.assign({}, prevErrors), { confirmPassword: confirmPassword !== password })));
|
|
79
|
+
break;
|
|
80
|
+
default:
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const handleSubmit = async (e) => {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
// Validação dos campos
|
|
87
|
+
const newErrors = {
|
|
88
|
+
email: !validateEmail(email),
|
|
89
|
+
password: !password.trim(),
|
|
90
|
+
confirmPassword: confirmPassword !== password,
|
|
91
|
+
};
|
|
92
|
+
setErrors(newErrors);
|
|
93
|
+
const hasErrors = Object.values(newErrors).some(Boolean);
|
|
94
|
+
if (hasErrors) {
|
|
95
|
+
setCorMensagemApi(color_message_erro);
|
|
96
|
+
setMensagemApi(`Alguns dos dados fornecidos estão inválidos. Por favor, revise as informações preenchidas e corrija os campos destacados.`);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
setIsLoading(true);
|
|
100
|
+
setMensagemApi('');
|
|
101
|
+
//try {
|
|
102
|
+
const formData = new FormData();
|
|
103
|
+
formData.append('email', email);
|
|
104
|
+
formData.append('password', password);
|
|
105
|
+
// const response = await fetch('https://backend-sites-pipelinesolucoes.onrender.com/send-email-gmail', {
|
|
106
|
+
// method: 'POST',
|
|
107
|
+
// headers: {
|
|
108
|
+
// Authorization: `Bearer ${token_bearer}`,
|
|
109
|
+
// },
|
|
110
|
+
// body: formData,
|
|
111
|
+
// });
|
|
112
|
+
// if (response.status === 200) {
|
|
113
|
+
//setCorMensagemApi(color_message_sucess);
|
|
114
|
+
//setMensagemApi(message_sucess);
|
|
115
|
+
setEmail('');
|
|
116
|
+
setPassword('');
|
|
117
|
+
// setErrors({});
|
|
118
|
+
// } else {
|
|
119
|
+
// setCorMensagemApi(color_message_erro);
|
|
120
|
+
// setMensagemApi(
|
|
121
|
+
// message_erro ??
|
|
122
|
+
// `Houve um problema ao enviar sua mensagem. Por favor, verifique sua conexão e tente novamente mais tarde.`
|
|
123
|
+
// );
|
|
124
|
+
// console.error('Erro ao enviar dados:', response.statusText);
|
|
125
|
+
// }
|
|
126
|
+
// } catch (error) {
|
|
127
|
+
// setCorMensagemApi(color_message_erro);
|
|
128
|
+
// setMensagemApi(
|
|
129
|
+
// message_erro ??
|
|
130
|
+
// `Houve um problema ao enviar sua mensagem. Por favor, verifique sua conexão e tente novamente mais tarde.`
|
|
131
|
+
// );
|
|
132
|
+
// console.error('Erro na solicitação:', error);
|
|
133
|
+
// } finally {
|
|
134
|
+
// setIsLoading(false);
|
|
135
|
+
// }
|
|
136
|
+
};
|
|
137
|
+
return (_jsxs(Box, { display: "flex", flexDirection: 'column', justifyContent: "center", gap: "24px", flex: 1, sx: { padding: "24px", borderRadius: border_radius, background: background }, children: [(Icon || titulo) &&
|
|
138
|
+
_jsxs(DivTitulo, { children: [Icon && _jsx(Icon, {}), titulo && titulo()] }), _jsxs(FormContainer, { children: [googleButton && googleButton(), _jsx(Divider, { sx: { borderColor: color_separador }, children: "ou" }), _jsx(TextFieldStyled, { id: "email", label: "Email", placeholder: "Email", value: email, onChange: (e) => setEmail(e.target.value), onBlur: () => handleBlur('email'), error: errors.email, helperText: errors.email && _jsx("span", { style: { color: color_message_erro }, children: "Email inv\u00E1lido" }), required: true, background_color: background_color_field, text_color: color, text_color_error: color_message_erro, border_radius: border_radius_field }), _jsxs(DivPassword, { children: [_jsx(TextFieldStyled, { id: "password", label: "Senha", type: showPassword ? 'text' : 'password', value: password, onChange: (e) => setPassword(e.target.value), onBlur: () => handleBlur('password'), error: errors.password, helperText: errors.password && (_jsx("span", { style: { color: color_message_erro }, children: "Senha inv\u00E1lida" })), required: true, background_color: background_color_field, text_color: color, text_color_error: color_message_erro, border_radius: border_radius_field, slotProps: {
|
|
139
|
+
input: {
|
|
140
|
+
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { onClick: () => setShowPassword((prev) => !prev), edge: "end", children: showPassword ? _jsx(VisibilityOffIcon, {}) : _jsx(VisibilityIcon, {}) }) })),
|
|
141
|
+
},
|
|
142
|
+
} }), _jsx(TextFieldStyled, { id: "passwordconfirmada", label: "Confirmar Senha", type: showConfirmPassword ? 'text' : 'password', value: confirmPassword, onChange: (e) => setConfirmPassword(e.target.value), onBlur: () => handleBlur('confirmPassword'), error: errors.confirmPassword, helperText: errors.confirmPassword && (_jsx("span", { style: { color: color_message_erro }, children: "As senhas n\u00E3o coincidem" })), required: true, background_color: background_color_field, text_color: color, text_color_error: color_message_erro, border_radius: border_radius_field, slotProps: {
|
|
143
|
+
input: {
|
|
144
|
+
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { onClick: () => setShowConfirmPassword((prev) => !prev), edge: "end", children: showConfirmPassword ? _jsx(VisibilityOffIcon, {}) : _jsx(VisibilityIcon, {}) }) })),
|
|
145
|
+
},
|
|
146
|
+
} })] }), _jsx(ButtonFormStyled, { width: "100%", height: "100%", onClick: handleSubmit, background_color: background_color_button, text_color: color_button, border_radius: border_radius_button, disabled: isLoading, margin: '16px 0 0 0', children: isLoading ? 'Enviando...' : text_button }), mensagemApi && (_jsx(Typography, { variant: "body1", component: "span", color: corMensagemApi, children: mensagemApi })), _jsxs(DivLink, { text_color: color, align: "center", children: ["J\u00E1 tem uma conta?", _jsx(LinkFormStyled, { href: urlLogin, width: "auto", height: "100%", text_color: color_link, margin: '0 0 0 8px', children: "Entrar" })] })] }), children] }));
|
|
147
|
+
};
|
|
148
|
+
export default SignUpForm;
|
|
149
|
+
//# sourceMappingURL=SignUpForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignUpForm.js","sourceRoot":"","sources":["../../src/components/SignUpForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAU,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAgB,UAAU,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAClE,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAE5D,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACzC,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,KAAK;CACf,CAAC,CAAC,CAAC;AAEJ,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,GAAG;CACb,CAAC,CAAC,CAAC;AA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AE,YAAY,EACrB,gBAAgB,EAAE,uBAAuB,EACzC,UAAU,EAAE,YAAY,EACxB,aAAa,EAAE,oBAAoB,EACnC,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAC,YAAY,YAElB,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,GACvB,EAClB,WAAW,IAAI,CACd,KAAC,UAAU,IAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,cAAc,YAC/D,WAAW,GACD,CACd,EAED,MAAC,OAAO,IAAC,UAAU,EAAE,KAAK,EAAE,KAAK,EAAC,QAAQ,uCAExC,KAAC,cAAc,IAAC,IAAI,EAAE,QAAQ,EAC5B,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAC,WAAW,uBAEtD,IACT,IAEI,EAEf,QAAQ,IAEL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface TextFieldValidateProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
background?: string;
|
|
6
|
+
colorText?: string;
|
|
7
|
+
borderRadius?: string;
|
|
8
|
+
boxShadow?: string;
|
|
9
|
+
borderColor?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
value?: string;
|
|
13
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
15
|
+
multiline?: boolean;
|
|
16
|
+
rows?: number;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
requiredMessage?: string;
|
|
19
|
+
minLength?: number;
|
|
20
|
+
pattern?: RegExp | string;
|
|
21
|
+
patternMessage?: string;
|
|
22
|
+
validate?: (value: string) => string | null | undefined;
|
|
23
|
+
showErrorOn?: 'change' | 'blur';
|
|
24
|
+
maxLength?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* TextFieldValidate Component
|
|
28
|
+
*
|
|
29
|
+
* Um campo de texto personalizável baseado no Material UI (MUI 6+), com suporte a:
|
|
30
|
+
* - Estilização via `styled` (background, cor do texto, bordas, sombra).
|
|
31
|
+
* - Estados e acessibilidade do MUI (`label`, `disabled`, `helperText`, `error`).
|
|
32
|
+
* - Modo multilinha (`multiline`, `rows`).
|
|
33
|
+
* - Validações simples (obrigatório, tamanho mínimo, `pattern`) e validação customizada (`validate`).
|
|
34
|
+
* - Controle de exibição de erro durante a digitação ou após perder o foco (`showErrorOn`).
|
|
35
|
+
* - Limite máximo de caracteres via `maxLength` (aplicado ao input).
|
|
36
|
+
* - Suporte a um `onBlur` externo para lógicas adicionais (ex: busca de CEP).
|
|
37
|
+
*
|
|
38
|
+
* ### Parâmetros (props)
|
|
39
|
+
* - `id?: string` — Id do campo (passado para o DOM/MUI). **Default:** `undefined`
|
|
40
|
+
* - `label?: string` — Rótulo exibido acima do campo (Label do MUI). **Default:** `undefined`
|
|
41
|
+
* - `background?: string` — Cor de fundo do campo. **Default:** `"#fff"`
|
|
42
|
+
* - `colorText?: string` — Cor do texto. **Default:** `"#000"`
|
|
43
|
+
* - `borderRadius?: string` — Raio de borda. **Default:** `"6px"`
|
|
44
|
+
* - `boxShadow?: string` — Sombra do campo. **Default:** `"none"`
|
|
45
|
+
* - `borderColor?: string` — Cor da borda do campo (estado base e hover). **Default:** `"#ccc"`
|
|
46
|
+
* - `placeholder?: string` — Placeholder exibido quando o campo está vazio. **Default:** `""`
|
|
47
|
+
* - `disabled?: boolean` — Desabilita o campo (estado disabled). **Default:** `false`
|
|
48
|
+
* - `value?: string` — Valor atual do campo (controlado). **Default:** `""`
|
|
49
|
+
* - `onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void` — Função chamada ao alterar o valor. **Default:** `undefined`
|
|
50
|
+
* - `onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void` — Função chamada ao perder o foco, após a lógica interna marcar o campo como “tocado”. **Default:** `undefined`
|
|
51
|
+
*
|
|
52
|
+
* **Multiline**
|
|
53
|
+
* - `multiline?: boolean` — Define se o campo é multilinha. **Default:** `false`
|
|
54
|
+
* - `rows?: number` — Número de linhas quando `multiline` está ativo. **Default:** `3`
|
|
55
|
+
*
|
|
56
|
+
* **Validação**
|
|
57
|
+
* - `required?: boolean` — Indica se o preenchimento é obrigatório. **Default:** `false`
|
|
58
|
+
* - `requiredMessage?: string` — Mensagem quando obrigatório não atendido. **Default:** `"Campo obrigatório"`
|
|
59
|
+
* - `minLength?: number` — Tamanho mínimo (caracteres). **Default:** `undefined`
|
|
60
|
+
* - `pattern?: RegExp | string` — Expressão regular para validar o formato. **Default:** `undefined`
|
|
61
|
+
* - `patternMessage?: string` — Mensagem quando o `pattern` não é atendido. **Default:** `"Formato inválido"`
|
|
62
|
+
* - `validate?: (value: string) => string | null | undefined` — Validação customizada; retorne string com a mensagem de erro, ou `null/undefined` se válido. **Default:** `undefined`
|
|
63
|
+
* - `showErrorOn?: 'change' | 'blur'` — Quando exibir erros: durante a digitação (`"change"`) ou ao perder o foco (`"blur"`). **Default:** `"blur"`
|
|
64
|
+
*
|
|
65
|
+
* **Outros**
|
|
66
|
+
* - `maxLength?: number` — Limite máximo de caracteres permitido (não valida; apenas limita o input). **Default:** `undefined`
|
|
67
|
+
*
|
|
68
|
+
* ### Exemplo (uso com CEP e onBlur)
|
|
69
|
+
* ```tsx
|
|
70
|
+
* import React from 'react';
|
|
71
|
+
* import TextFieldValidate from './TextFieldValidate';
|
|
72
|
+
*
|
|
73
|
+
* const CepExample: React.FC = () => {
|
|
74
|
+
* const [cep, setCep] = React.useState('');
|
|
75
|
+
*
|
|
76
|
+
* const handleCepBlur = async (event: React.FocusEvent<HTMLInputElement>) => {
|
|
77
|
+
* const raw = event.target.value || '';
|
|
78
|
+
* const onlyDigits = raw.replace(/\D/g, '');
|
|
79
|
+
*
|
|
80
|
+
* if (onlyDigits.length === 8) {
|
|
81
|
+
* // Exemplo de chamada de API (ViaCEP)
|
|
82
|
+
* // const response = await fetch(`https://viacep.com.br/ws/${onlyDigits}/json/`);
|
|
83
|
+
* // const data = await response.json();
|
|
84
|
+
* // ...preencher outros campos do formulário...
|
|
85
|
+
* console.log('CEP para buscar:', onlyDigits);
|
|
86
|
+
* }
|
|
87
|
+
* };
|
|
88
|
+
*
|
|
89
|
+
* return (
|
|
90
|
+
* <TextFieldValidate
|
|
91
|
+
* id="cep-input"
|
|
92
|
+
* label="CEP"
|
|
93
|
+
* placeholder="Digite o CEP"
|
|
94
|
+
* value={cep}
|
|
95
|
+
* onChange={(e) => setCep(e.target.value)}
|
|
96
|
+
* onBlur={handleCepBlur}
|
|
97
|
+
* pattern={/^\d{5}-?\d{3}$/}
|
|
98
|
+
* patternMessage="CEP inválido"
|
|
99
|
+
* required
|
|
100
|
+
* showErrorOn="blur"
|
|
101
|
+
* maxLength={9}
|
|
102
|
+
* />
|
|
103
|
+
* );
|
|
104
|
+
* };
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
declare const TextFieldValidate: React.FC<TextFieldValidateProps>;
|
|
108
|
+
export default TextFieldValidate;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
import TextField from '@mui/material/TextField';
|
|
5
|
+
const StyledTextField = styled(TextField, {
|
|
6
|
+
shouldForwardProp: (prop) => !['background', 'colorText', 'borderRadius', 'boxShadow', 'borderColor'].includes(prop),
|
|
7
|
+
})(({ background, colorText, borderRadius, boxShadow, borderColor }) => ({
|
|
8
|
+
background: background || '#fff',
|
|
9
|
+
color: colorText || '#000',
|
|
10
|
+
borderRadius: borderRadius || '6px',
|
|
11
|
+
boxShadow: boxShadow || 'none',
|
|
12
|
+
'& .MuiInputBase-root': {
|
|
13
|
+
color: colorText || '#000',
|
|
14
|
+
background: background || '#fff',
|
|
15
|
+
borderRadius: borderRadius || '6px',
|
|
16
|
+
boxShadow: boxShadow || 'none',
|
|
17
|
+
padding: '4px 8px',
|
|
18
|
+
},
|
|
19
|
+
'& .MuiInputLabel-root': {
|
|
20
|
+
color: colorText || '#000',
|
|
21
|
+
},
|
|
22
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
23
|
+
borderColor: borderColor || '#ccc',
|
|
24
|
+
},
|
|
25
|
+
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
26
|
+
borderColor: borderColor || '#888',
|
|
27
|
+
},
|
|
28
|
+
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
|
|
29
|
+
borderColor: '#1976d2',
|
|
30
|
+
},
|
|
31
|
+
}));
|
|
32
|
+
const computeError = (value, { required, requiredMessage, minLength, pattern, patternMessage, validate, }) => {
|
|
33
|
+
const v = value !== null && value !== void 0 ? value : '';
|
|
34
|
+
if (required && v.trim().length === 0)
|
|
35
|
+
return requiredMessage || 'Campo obrigatório';
|
|
36
|
+
if (typeof minLength === 'number' && v.length < minLength)
|
|
37
|
+
return `Mínimo de ${minLength} caracteres`;
|
|
38
|
+
if (pattern) {
|
|
39
|
+
const re = typeof pattern === 'string' ? new RegExp(pattern) : pattern;
|
|
40
|
+
if (!re.test(v))
|
|
41
|
+
return patternMessage || 'Formato inválido';
|
|
42
|
+
}
|
|
43
|
+
if (validate) {
|
|
44
|
+
const customMsg = validate(v);
|
|
45
|
+
if (typeof customMsg === 'string' && customMsg)
|
|
46
|
+
return customMsg;
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* TextFieldValidate Component
|
|
52
|
+
*
|
|
53
|
+
* Um campo de texto personalizável baseado no Material UI (MUI 6+), com suporte a:
|
|
54
|
+
* - Estilização via `styled` (background, cor do texto, bordas, sombra).
|
|
55
|
+
* - Estados e acessibilidade do MUI (`label`, `disabled`, `helperText`, `error`).
|
|
56
|
+
* - Modo multilinha (`multiline`, `rows`).
|
|
57
|
+
* - Validações simples (obrigatório, tamanho mínimo, `pattern`) e validação customizada (`validate`).
|
|
58
|
+
* - Controle de exibição de erro durante a digitação ou após perder o foco (`showErrorOn`).
|
|
59
|
+
* - Limite máximo de caracteres via `maxLength` (aplicado ao input).
|
|
60
|
+
* - Suporte a um `onBlur` externo para lógicas adicionais (ex: busca de CEP).
|
|
61
|
+
*
|
|
62
|
+
* ### Parâmetros (props)
|
|
63
|
+
* - `id?: string` — Id do campo (passado para o DOM/MUI). **Default:** `undefined`
|
|
64
|
+
* - `label?: string` — Rótulo exibido acima do campo (Label do MUI). **Default:** `undefined`
|
|
65
|
+
* - `background?: string` — Cor de fundo do campo. **Default:** `"#fff"`
|
|
66
|
+
* - `colorText?: string` — Cor do texto. **Default:** `"#000"`
|
|
67
|
+
* - `borderRadius?: string` — Raio de borda. **Default:** `"6px"`
|
|
68
|
+
* - `boxShadow?: string` — Sombra do campo. **Default:** `"none"`
|
|
69
|
+
* - `borderColor?: string` — Cor da borda do campo (estado base e hover). **Default:** `"#ccc"`
|
|
70
|
+
* - `placeholder?: string` — Placeholder exibido quando o campo está vazio. **Default:** `""`
|
|
71
|
+
* - `disabled?: boolean` — Desabilita o campo (estado disabled). **Default:** `false`
|
|
72
|
+
* - `value?: string` — Valor atual do campo (controlado). **Default:** `""`
|
|
73
|
+
* - `onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void` — Função chamada ao alterar o valor. **Default:** `undefined`
|
|
74
|
+
* - `onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void` — Função chamada ao perder o foco, após a lógica interna marcar o campo como “tocado”. **Default:** `undefined`
|
|
75
|
+
*
|
|
76
|
+
* **Multiline**
|
|
77
|
+
* - `multiline?: boolean` — Define se o campo é multilinha. **Default:** `false`
|
|
78
|
+
* - `rows?: number` — Número de linhas quando `multiline` está ativo. **Default:** `3`
|
|
79
|
+
*
|
|
80
|
+
* **Validação**
|
|
81
|
+
* - `required?: boolean` — Indica se o preenchimento é obrigatório. **Default:** `false`
|
|
82
|
+
* - `requiredMessage?: string` — Mensagem quando obrigatório não atendido. **Default:** `"Campo obrigatório"`
|
|
83
|
+
* - `minLength?: number` — Tamanho mínimo (caracteres). **Default:** `undefined`
|
|
84
|
+
* - `pattern?: RegExp | string` — Expressão regular para validar o formato. **Default:** `undefined`
|
|
85
|
+
* - `patternMessage?: string` — Mensagem quando o `pattern` não é atendido. **Default:** `"Formato inválido"`
|
|
86
|
+
* - `validate?: (value: string) => string | null | undefined` — Validação customizada; retorne string com a mensagem de erro, ou `null/undefined` se válido. **Default:** `undefined`
|
|
87
|
+
* - `showErrorOn?: 'change' | 'blur'` — Quando exibir erros: durante a digitação (`"change"`) ou ao perder o foco (`"blur"`). **Default:** `"blur"`
|
|
88
|
+
*
|
|
89
|
+
* **Outros**
|
|
90
|
+
* - `maxLength?: number` — Limite máximo de caracteres permitido (não valida; apenas limita o input). **Default:** `undefined`
|
|
91
|
+
*
|
|
92
|
+
* ### Exemplo (uso com CEP e onBlur)
|
|
93
|
+
* ```tsx
|
|
94
|
+
* import React from 'react';
|
|
95
|
+
* import TextFieldValidate from './TextFieldValidate';
|
|
96
|
+
*
|
|
97
|
+
* const CepExample: React.FC = () => {
|
|
98
|
+
* const [cep, setCep] = React.useState('');
|
|
99
|
+
*
|
|
100
|
+
* const handleCepBlur = async (event: React.FocusEvent<HTMLInputElement>) => {
|
|
101
|
+
* const raw = event.target.value || '';
|
|
102
|
+
* const onlyDigits = raw.replace(/\D/g, '');
|
|
103
|
+
*
|
|
104
|
+
* if (onlyDigits.length === 8) {
|
|
105
|
+
* // Exemplo de chamada de API (ViaCEP)
|
|
106
|
+
* // const response = await fetch(`https://viacep.com.br/ws/${onlyDigits}/json/`);
|
|
107
|
+
* // const data = await response.json();
|
|
108
|
+
* // ...preencher outros campos do formulário...
|
|
109
|
+
* console.log('CEP para buscar:', onlyDigits);
|
|
110
|
+
* }
|
|
111
|
+
* };
|
|
112
|
+
*
|
|
113
|
+
* return (
|
|
114
|
+
* <TextFieldValidate
|
|
115
|
+
* id="cep-input"
|
|
116
|
+
* label="CEP"
|
|
117
|
+
* placeholder="Digite o CEP"
|
|
118
|
+
* value={cep}
|
|
119
|
+
* onChange={(e) => setCep(e.target.value)}
|
|
120
|
+
* onBlur={handleCepBlur}
|
|
121
|
+
* pattern={/^\d{5}-?\d{3}$/}
|
|
122
|
+
* patternMessage="CEP inválido"
|
|
123
|
+
* required
|
|
124
|
+
* showErrorOn="blur"
|
|
125
|
+
* maxLength={9}
|
|
126
|
+
* />
|
|
127
|
+
* );
|
|
128
|
+
* };
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
const TextFieldValidate = ({ id, label, background, colorText = '#000', borderRadius, boxShadow, borderColor, placeholder, disabled = false, value = '', onChange, onBlur, multiline = false, rows = 3, required = false, requiredMessage = 'Campo obrigatório', minLength, pattern, patternMessage = 'Formato inválido', validate, showErrorOn = 'blur', maxLength, }) => {
|
|
132
|
+
const [touched, setTouched] = React.useState(false);
|
|
133
|
+
const errorMessage = React.useMemo(() => {
|
|
134
|
+
if (showErrorOn === 'change') {
|
|
135
|
+
return computeError(value, {
|
|
136
|
+
required,
|
|
137
|
+
requiredMessage,
|
|
138
|
+
minLength,
|
|
139
|
+
pattern,
|
|
140
|
+
patternMessage,
|
|
141
|
+
validate,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
if (showErrorOn === 'blur' && touched) {
|
|
145
|
+
return computeError(value, {
|
|
146
|
+
required,
|
|
147
|
+
requiredMessage,
|
|
148
|
+
minLength,
|
|
149
|
+
pattern,
|
|
150
|
+
patternMessage,
|
|
151
|
+
validate,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return null;
|
|
155
|
+
}, [
|
|
156
|
+
value,
|
|
157
|
+
required,
|
|
158
|
+
requiredMessage,
|
|
159
|
+
minLength,
|
|
160
|
+
pattern,
|
|
161
|
+
patternMessage,
|
|
162
|
+
validate,
|
|
163
|
+
showErrorOn,
|
|
164
|
+
touched,
|
|
165
|
+
]);
|
|
166
|
+
const handleBlur = (event) => {
|
|
167
|
+
if (!touched)
|
|
168
|
+
setTouched(true);
|
|
169
|
+
if (onBlur) {
|
|
170
|
+
onBlur(event);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
return (_jsx(StyledTextField, { id: id, label: label, placeholder: placeholder, value: value, onChange: onChange, onBlur: handleBlur, background: background, colorText: colorText, borderRadius: borderRadius, boxShadow: boxShadow, borderColor: borderColor, disabled: disabled, multiline: multiline, required: required, rows: multiline ? rows : undefined, fullWidth: true, error: Boolean(errorMessage), helperText: errorMessage || ' ', slotProps: {
|
|
174
|
+
input: {
|
|
175
|
+
inputProps: typeof maxLength === 'number' ? { maxLength } : undefined,
|
|
176
|
+
},
|
|
177
|
+
} }));
|
|
178
|
+
};
|
|
179
|
+
TextFieldValidate.displayName = 'TextFieldValidate';
|
|
180
|
+
export default TextFieldValidate;
|
|
181
|
+
//# sourceMappingURL=TextFieldValidate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextFieldValidate.js","sourceRoot":"","sources":["../../src/components/TextFieldValidate.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAkChD,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,EAAE;IACxC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAc,CAAC;CACpG,CAAC,CAKA,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,WAA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,mBAAmB,CAAC;AAEpD,eAAe,iBAAiB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as RecaptchaForm } from './components/RecaptchaForm';
|
|
2
|
+
export { default as LoginForm } from './components/LoginForm';
|
|
3
|
+
export { default as RecuperarSenhaForm } from './components/RecuperarSenhaForm';
|
|
4
|
+
export { default as SignUpForm } from './components/SignUpForm';
|
|
5
|
+
export { default as GoogleButton } from './components/GoogleButton';
|
|
6
|
+
export { default as TextFieldValidate } from './components/TextFieldValidate';
|
|
7
|
+
export * from './utils/validateTelefone';
|
|
8
|
+
export * from './utils/validateEmail';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as RecaptchaForm } from './components/RecaptchaForm';
|
|
2
|
+
export { default as LoginForm } from './components/LoginForm';
|
|
3
|
+
export { default as RecuperarSenhaForm } from './components/RecuperarSenhaForm';
|
|
4
|
+
export { default as SignUpForm } from './components/SignUpForm';
|
|
5
|
+
export { default as GoogleButton } from './components/GoogleButton';
|
|
6
|
+
export { default as TextFieldValidate } from './components/TextFieldValidate';
|
|
7
|
+
export * from './utils/validateTelefone';
|
|
8
|
+
export * from './utils/validateEmail';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAC,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAC,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAE9E,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
|
|
4
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
5
|
+
import { CacheProvider } from '@emotion/react';
|
|
6
|
+
import createCache from '@emotion/cache';
|
|
7
|
+
import { theme } from '@/theme';
|
|
8
|
+
// Crie uma instância de cache para o Emotion
|
|
9
|
+
const cache = createCache({ key: 'css', prepend: true });
|
|
10
|
+
export default function MyApp({ Component, pageProps }) {
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
// Remove o CSS injetado pelo servidor, se existir
|
|
13
|
+
const jssStyles = document.querySelector('#jss-server-side');
|
|
14
|
+
if (jssStyles && jssStyles.parentElement) {
|
|
15
|
+
jssStyles.parentElement.removeChild(jssStyles);
|
|
16
|
+
}
|
|
17
|
+
}, []);
|
|
18
|
+
return (_jsx(CacheProvider, { value: cache, children: _jsxs(MuiThemeProvider, { theme: theme, children: [_jsx(CssBaseline, {}), _jsx(Component, Object.assign({}, pageProps))] }) }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=_app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_app.js","sourceRoot":"","sources":["../../src/pages/_app.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,6CAA6C;AAC7C,MAAM,KAAK,GAAG,WAAW,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,SAAS,EAAY;IAC9D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,kDAAkD;QAClD,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;QAC7D,IAAI,SAAS,IAAI,SAAS,CAAC,aAAa,EAAE,CAAC;YACzC,SAAS,CAAC,aAAa,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,KAAK,YACzB,MAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,aAC5B,KAAC,WAAW,KAAe,EAC3B,KAAC,SAAS,oBAAK,SAAS,EAAe,IACtB,GACL,CACjB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Document, { DocumentContext } from "next/document";
|
|
2
|
+
export default class MyDocument extends Document {
|
|
3
|
+
static getInitialProps(ctx: DocumentContext): Promise<{
|
|
4
|
+
styles: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
html: string;
|
|
6
|
+
head?: Array<import("react").JSX.Element | null>;
|
|
7
|
+
}>;
|
|
8
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import Document, { Html, Head, Main, NextScript } from "next/document";
|
|
3
|
+
import createCache from "@emotion/cache";
|
|
4
|
+
import createEmotionServer from "@emotion/server/create-instance";
|
|
5
|
+
import { CacheProvider } from "@emotion/react";
|
|
6
|
+
// Função para criar o cache do Emotion
|
|
7
|
+
const createEmotionCache = () => {
|
|
8
|
+
return createCache({ key: "css", prepend: true });
|
|
9
|
+
};
|
|
10
|
+
export default class MyDocument extends Document {
|
|
11
|
+
static async getInitialProps(ctx) {
|
|
12
|
+
const cache = createEmotionCache();
|
|
13
|
+
const { extractCriticalToChunks } = createEmotionServer(cache);
|
|
14
|
+
const originalRenderPage = ctx.renderPage;
|
|
15
|
+
try {
|
|
16
|
+
ctx.renderPage = () => originalRenderPage({
|
|
17
|
+
enhanceApp: (App) => (props) => (_jsx(CacheProvider, { value: cache, children: _jsx(App, Object.assign({}, props)) })),
|
|
18
|
+
});
|
|
19
|
+
const initialProps = await Document.getInitialProps(ctx);
|
|
20
|
+
// Extrai os estilos críticos para renderização no lado do servidor
|
|
21
|
+
const emotionStyles = extractCriticalToChunks(initialProps.html);
|
|
22
|
+
const emotionStyleTags = emotionStyles.styles.map((style) => (_jsx("style", { "data-emotion": `${style.key} ${style.ids.join(" ")}`, dangerouslySetInnerHTML: { __html: style.css } }, style.key)));
|
|
23
|
+
return Object.assign(Object.assign({}, initialProps), { styles: (_jsxs(_Fragment, { children: [initialProps.styles, emotionStyleTags] })) });
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
// Nada a liberar como no caso do styled-components
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return (_jsxs(Html, { lang: "pt", children: [_jsx(Head, {}), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] }));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=_document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_document.js","sourceRoot":"","sources":["../../src/pages/_document.tsx"],"names":[],"mappings":";AAAA,OAAO,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAmB,MA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AAE,KAAK,CAAC,GAAG,EAAE,IAFzC,KAAK,CAAC,GAAG,CAGd,CACH,CAAC,CAAC;YAEH,uCACK,YAAY,KACf,MAAM,EAAE,CACN,8BACG,YAAY,CAAC,MAAM,EACnB,gBAAgB,IAChB,CACJ,IACD;QACJ,CAAC;gBAAS,CAAC;YACT,mDAAmD;QACrD,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,MAAC,IAAI,IAAC,IAAI,EAAC,IAAI,aACb,KAAC,IAAI,KACE,EACP,2BACE,KAAC,IAAI,KAAG,EACR,KAAC,UAAU,KAAG,IACT,IACF,CACR,CAAC;IACJ,CAAC;CACF"}
|
package/dist/theme.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
declare module '@mui/material/styles' {
|
|
2
|
+
interface Palette {
|
|
3
|
+
custom: {
|
|
4
|
+
transparent: string;
|
|
5
|
+
backgroundSectionMain: string;
|
|
6
|
+
backgroundSectionAlternative: string;
|
|
7
|
+
backgroundSectionHighlight?: string;
|
|
8
|
+
colorSectionMain: string;
|
|
9
|
+
backgroundButtonCTA: string;
|
|
10
|
+
backgroundHoverButtonCTA: string;
|
|
11
|
+
colorButtonCTA: string;
|
|
12
|
+
colorHoverButtonCTA: string;
|
|
13
|
+
borderRadiusButtonCTA: string;
|
|
14
|
+
carouselColorIndicators: string;
|
|
15
|
+
carouselColorFocus: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface PaletteOptions {
|
|
19
|
+
custom?: {
|
|
20
|
+
transparent: string;
|
|
21
|
+
backgroundSectionMain: string;
|
|
22
|
+
backgroundSectionAlternative: string;
|
|
23
|
+
backgroundSectionHighlight?: string;
|
|
24
|
+
backgroundButtonCTA: string;
|
|
25
|
+
backgroundHoverButtonCTA: string;
|
|
26
|
+
colorButtonCTA: string;
|
|
27
|
+
colorHoverButtonCTA: string;
|
|
28
|
+
borderRadiusButtonCTA: string;
|
|
29
|
+
carouselColorIndicators: string;
|
|
30
|
+
carouselColorFocus: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
declare const theme: import("@mui/material/styles").Theme;
|
|
35
|
+
export { theme };
|