@pipelinesolucoes/form 1.0.0-beta.0 → 1.0.0-beta.1
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 -78
- package/README.md +170 -162
- package/dist/components/ButtonFormStyled.d.ts +2 -0
- package/dist/components/ButtonFormStyled.js +22 -0
- package/dist/components/ButtonFormStyled.js.map +1 -0
- package/dist/components/FormStyled.d.ts +2 -2
- package/dist/components/TextFieldValidate.d.ts +52 -67
- package/dist/components/TextFieldValidate.js +58 -78
- package/dist/components/TextFieldValidate.js.map +1 -1
- package/dist/components/login/GoogleButton.d.ts +64 -0
- package/dist/components/login/GoogleButton.js +100 -0
- package/dist/components/login/GoogleButton.js.map +1 -0
- package/dist/components/{LoginForm.js → login/LoginForm.js} +1 -1
- package/dist/components/login/LoginForm.js.map +1 -0
- package/dist/components/login/PasswordRecoveryForm.d.ts +142 -0
- package/dist/components/login/PasswordRecoveryForm.js +169 -0
- package/dist/components/login/PasswordRecoveryForm.js.map +1 -0
- package/dist/components/{SignUpForm.js → login/SignUpForm.js} +1 -1
- package/dist/components/login/SignUpForm.js.map +1 -0
- package/dist/components/{RecaptchaForm.js → recaptcha/RecaptchaForm.js} +1 -1
- package/dist/components/recaptcha/RecaptchaForm.js.map +1 -0
- package/dist/components/recaptcha/RecaptchaInvisible.js.map +1 -0
- package/dist/components/recaptcha/RecaptchaMessage.js.map +1 -0
- package/dist/index.d.ts +9 -5
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/BorderProps.d.ts +6 -0
- package/dist/types/BorderProps.js +2 -0
- package/dist/types/BorderProps.js.map +1 -0
- package/dist/types/ButtonProps.d.ts +17 -0
- package/dist/types/ButtonProps.js +16 -0
- package/dist/types/ButtonProps.js.map +1 -0
- package/dist/types/ColorProps.d.ts +7 -0
- package/dist/types/ColorProps.js +2 -0
- package/dist/types/ColorProps.js.map +1 -0
- package/dist/types/FieldProps.d.ts +9 -0
- package/dist/types/FieldProps.js +2 -0
- package/dist/types/FieldProps.js.map +1 -0
- package/dist/types/LayoutProps.d.ts +7 -0
- package/dist/types/LayoutProps.js +2 -0
- package/dist/types/LayoutProps.js.map +1 -0
- package/dist/types/TextProps.d.ts +5 -0
- package/dist/types/TextProps.js +2 -0
- package/dist/types/TextProps.js.map +1 -0
- package/package.json +62 -64
- package/dist/components/GoogleButton.d.ts +0 -60
- package/dist/components/GoogleButton.js +0 -110
- package/dist/components/GoogleButton.js.map +0 -1
- package/dist/components/LoginForm.js.map +0 -1
- package/dist/components/RecaptchaForm.js.map +0 -1
- package/dist/components/RecaptchaInvisible.js.map +0 -1
- package/dist/components/RecaptchaMessage.js.map +0 -1
- package/dist/components/RecuperarSenhaForm.d.ts +0 -23
- package/dist/components/RecuperarSenhaForm.js +0 -98
- package/dist/components/RecuperarSenhaForm.js.map +0 -1
- package/dist/components/SignUpForm.js.map +0 -1
- /package/dist/components/{LoginForm.d.ts → login/LoginForm.d.ts} +0 -0
- /package/dist/components/{SignUpForm.d.ts → login/SignUpForm.d.ts} +0 -0
- /package/dist/components/{RecaptchaForm.d.ts → recaptcha/RecaptchaForm.d.ts} +0 -0
- /package/dist/components/{RecaptchaInvisible.d.ts → recaptcha/RecaptchaInvisible.d.ts} +0 -0
- /package/dist/components/{RecaptchaInvisible.js → recaptcha/RecaptchaInvisible.js} +0 -0
- /package/dist/components/{RecaptchaMessage.d.ts → recaptcha/RecaptchaMessage.d.ts} +0 -0
- /package/dist/components/{RecaptchaMessage.js → recaptcha/RecaptchaMessage.js} +0 -0
|
@@ -1,104 +1,89 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { BorderProps } from '../types/BorderProps';
|
|
3
|
+
import { ColorProps } from '../types/ColorProps';
|
|
4
|
+
import { LayoutProps } from '../types/LayoutProps';
|
|
5
|
+
interface TextFieldValidateProps extends BorderProps, ColorProps, LayoutProps {
|
|
3
6
|
id?: string;
|
|
4
7
|
label?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
value?: string;
|
|
5
10
|
background?: string;
|
|
6
11
|
colorText?: string;
|
|
12
|
+
colorFocused?: string;
|
|
7
13
|
borderRadius?: string;
|
|
8
14
|
boxShadow?: string;
|
|
9
15
|
borderColor?: string;
|
|
10
|
-
|
|
16
|
+
padding?: string;
|
|
11
17
|
disabled?: boolean;
|
|
12
|
-
value?: string;
|
|
13
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
-
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
15
18
|
multiline?: boolean;
|
|
16
19
|
rows?: number;
|
|
17
20
|
required?: boolean;
|
|
18
21
|
requiredMessage?: string;
|
|
19
|
-
minLength?: number;
|
|
20
22
|
pattern?: RegExp | string;
|
|
21
23
|
patternMessage?: string;
|
|
22
24
|
validate?: (value: string) => string | null | undefined;
|
|
23
25
|
showErrorOn?: 'change' | 'blur';
|
|
26
|
+
minLength?: number;
|
|
24
27
|
maxLength?: number;
|
|
28
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
29
|
+
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
25
30
|
}
|
|
26
31
|
/**
|
|
27
|
-
*
|
|
32
|
+
* Componente de campo de texto com validação, baseado no TextField do Material UI.
|
|
33
|
+
* Permite personalização visual via `styled` e suporte a validações comuns
|
|
34
|
+
* (obrigatório, tamanho mínimo, regex) e validação customizada.
|
|
28
35
|
*
|
|
29
|
-
*
|
|
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).
|
|
36
|
+
* O erro pode ser exibido durante a digitação ou apenas após o campo perder o foco.
|
|
37
37
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
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`
|
|
38
|
+
* @param {string} [id] Id do campo (replicado no input do MUI).
|
|
39
|
+
* @param {string} [label] Rótulo exibido acima do campo.
|
|
40
|
+
* @param {string} [placeholder] Placeholder exibido quando o campo está vazio.
|
|
41
|
+
* @param {string} [value=''] Valor atual do campo (modo controlado).
|
|
42
|
+
* @param {boolean} [disabled=false] Define se o campo está desabilitado.
|
|
51
43
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
44
|
+
* @param {string} [background='#fff'] Cor de fundo do campo.
|
|
45
|
+
* @param {string} [colorText='#000'] Cor do texto e do label.
|
|
46
|
+
* @param {string} [colorFocused='#1976d2'] Cor da borda quando o campo está focado.
|
|
47
|
+
* @param {string} [borderColor='#ccc'] Cor da borda no estado normal e hover.
|
|
48
|
+
* @param {string} [borderRadius='0'] Raio da borda do campo.
|
|
49
|
+
* @param {string} [boxShadow='none'] Sombra aplicada ao campo.
|
|
50
|
+
* @param {string} [padding='4px 8px'] Espaçamento interno do input.
|
|
55
51
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
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"`
|
|
52
|
+
* @param {boolean} [multiline=false] Define se o campo é multilinha.
|
|
53
|
+
* @param {number} [rows=3] Número de linhas quando `multiline` está ativo.
|
|
64
54
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
55
|
+
* @param {boolean} [required=false] Indica se o campo é obrigatório.
|
|
56
|
+
* @param {string} [requiredMessage='Campo obrigatório'] Mensagem exibida quando o campo obrigatório está vazio.
|
|
57
|
+
* @param {number} [minLength] Número mínimo de caracteres.
|
|
58
|
+
* @param {RegExp | string} [pattern] Expressão regular para validação do valor.
|
|
59
|
+
* @param {string} [patternMessage='Formato inválido'] Mensagem exibida quando o pattern não é atendido.
|
|
60
|
+
* @param {(value: string) => string | null | undefined} [validate] Função de validação customizada.
|
|
61
|
+
* @param {'change' | 'blur'} [showErrorOn='blur'] Momento em que o erro deve ser exibido.
|
|
67
62
|
*
|
|
68
|
-
*
|
|
63
|
+
* @param {number} [maxLength] Limite máximo de caracteres permitido no input.
|
|
64
|
+
* @param {(event: React.ChangeEvent<HTMLInputElement>) => void} [onChange] Callback disparado ao alterar o valor.
|
|
65
|
+
* @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onBlur] Callback disparado ao perder o foco.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
69
68
|
* ```tsx
|
|
70
69
|
* import React from 'react';
|
|
71
|
-
* import TextFieldValidate from '
|
|
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, '');
|
|
70
|
+
* import TextFieldValidate from '@/components/TextFieldValidate';
|
|
79
71
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
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
|
-
* };
|
|
72
|
+
* const Example = () => {
|
|
73
|
+
* const [email, setEmail] = React.useState('');
|
|
88
74
|
*
|
|
89
75
|
* return (
|
|
90
76
|
* <TextFieldValidate
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* onChange={(e) => setCep(e.target.value)}
|
|
96
|
-
* onBlur={handleCepBlur}
|
|
97
|
-
* pattern={/^\d{5}-?\d{3}$/}
|
|
98
|
-
* patternMessage="CEP inválido"
|
|
77
|
+
* label="E-mail"
|
|
78
|
+
* placeholder="Digite seu e-mail"
|
|
79
|
+
* value={email}
|
|
80
|
+
* onChange={(e) => setEmail(e.target.value)}
|
|
99
81
|
* required
|
|
82
|
+
* pattern={/^[^\s@]+@[^\s@]+\.[^\s@]+$/}
|
|
83
|
+
* patternMessage="E-mail inválido"
|
|
100
84
|
* showErrorOn="blur"
|
|
101
|
-
* maxLength={
|
|
85
|
+
* maxLength={120}
|
|
86
|
+
* borderRadius="6px"
|
|
102
87
|
* />
|
|
103
88
|
* );
|
|
104
89
|
* };
|
|
@@ -3,30 +3,30 @@ import React from 'react';
|
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import TextField from '@mui/material/TextField';
|
|
5
5
|
const StyledTextField = styled(TextField, {
|
|
6
|
-
shouldForwardProp: (prop) => !['background', 'colorText', 'borderRadius', 'boxShadow', 'borderColor'].includes(prop),
|
|
7
|
-
})(({ background, colorText, borderRadius, boxShadow, borderColor }) => ({
|
|
8
|
-
background: background
|
|
9
|
-
color: colorText
|
|
10
|
-
borderRadius: borderRadius
|
|
11
|
-
boxShadow: boxShadow
|
|
6
|
+
shouldForwardProp: (prop) => !['background', 'colorText', 'borderRadius', 'boxShadow', 'borderColor', 'colorFocused', 'padding'].includes(prop),
|
|
7
|
+
})(({ background, colorText, borderRadius, boxShadow, borderColor, colorFocused, padding }) => ({
|
|
8
|
+
background: background,
|
|
9
|
+
color: colorText,
|
|
10
|
+
borderRadius: borderRadius,
|
|
11
|
+
boxShadow: boxShadow,
|
|
12
12
|
'& .MuiInputBase-root': {
|
|
13
|
-
color: colorText
|
|
14
|
-
background: background
|
|
15
|
-
borderRadius: borderRadius
|
|
16
|
-
boxShadow: boxShadow
|
|
17
|
-
padding:
|
|
13
|
+
color: colorText,
|
|
14
|
+
background: background,
|
|
15
|
+
borderRadius: borderRadius,
|
|
16
|
+
boxShadow: boxShadow,
|
|
17
|
+
padding: padding,
|
|
18
18
|
},
|
|
19
19
|
'& .MuiInputLabel-root': {
|
|
20
|
-
color: colorText
|
|
20
|
+
color: colorText,
|
|
21
21
|
},
|
|
22
22
|
'& .MuiOutlinedInput-notchedOutline': {
|
|
23
|
-
borderColor: borderColor
|
|
23
|
+
borderColor: borderColor,
|
|
24
24
|
},
|
|
25
25
|
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
26
|
-
borderColor: borderColor
|
|
26
|
+
borderColor: borderColor,
|
|
27
27
|
},
|
|
28
28
|
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
|
|
29
|
-
borderColor:
|
|
29
|
+
borderColor: colorFocused,
|
|
30
30
|
},
|
|
31
31
|
}));
|
|
32
32
|
const computeError = (value, { required, requiredMessage, minLength, pattern, patternMessage, validate, }) => {
|
|
@@ -48,87 +48,67 @@ const computeError = (value, { required, requiredMessage, minLength, pattern, pa
|
|
|
48
48
|
return null;
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Componente de campo de texto com validação, baseado no TextField do Material UI.
|
|
52
|
+
* Permite personalização visual via `styled` e suporte a validações comuns
|
|
53
|
+
* (obrigatório, tamanho mínimo, regex) e validação customizada.
|
|
52
54
|
*
|
|
53
|
-
*
|
|
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).
|
|
55
|
+
* O erro pode ser exibido durante a digitação ou apenas após o campo perder o foco.
|
|
61
56
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
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`
|
|
57
|
+
* @param {string} [id] Id do campo (replicado no input do MUI).
|
|
58
|
+
* @param {string} [label] Rótulo exibido acima do campo.
|
|
59
|
+
* @param {string} [placeholder] Placeholder exibido quando o campo está vazio.
|
|
60
|
+
* @param {string} [value=''] Valor atual do campo (modo controlado).
|
|
61
|
+
* @param {boolean} [disabled=false] Define se o campo está desabilitado.
|
|
75
62
|
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
63
|
+
* @param {string} [background='#fff'] Cor de fundo do campo.
|
|
64
|
+
* @param {string} [colorText='#000'] Cor do texto e do label.
|
|
65
|
+
* @param {string} [colorFocused='#1976d2'] Cor da borda quando o campo está focado.
|
|
66
|
+
* @param {string} [borderColor='#ccc'] Cor da borda no estado normal e hover.
|
|
67
|
+
* @param {string} [borderRadius='0'] Raio da borda do campo.
|
|
68
|
+
* @param {string} [boxShadow='none'] Sombra aplicada ao campo.
|
|
69
|
+
* @param {string} [padding='4px 8px'] Espaçamento interno do input.
|
|
79
70
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
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"`
|
|
71
|
+
* @param {boolean} [multiline=false] Define se o campo é multilinha.
|
|
72
|
+
* @param {number} [rows=3] Número de linhas quando `multiline` está ativo.
|
|
88
73
|
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
74
|
+
* @param {boolean} [required=false] Indica se o campo é obrigatório.
|
|
75
|
+
* @param {string} [requiredMessage='Campo obrigatório'] Mensagem exibida quando o campo obrigatório está vazio.
|
|
76
|
+
* @param {number} [minLength] Número mínimo de caracteres.
|
|
77
|
+
* @param {RegExp | string} [pattern] Expressão regular para validação do valor.
|
|
78
|
+
* @param {string} [patternMessage='Formato inválido'] Mensagem exibida quando o pattern não é atendido.
|
|
79
|
+
* @param {(value: string) => string | null | undefined} [validate] Função de validação customizada.
|
|
80
|
+
* @param {'change' | 'blur'} [showErrorOn='blur'] Momento em que o erro deve ser exibido.
|
|
91
81
|
*
|
|
92
|
-
*
|
|
82
|
+
* @param {number} [maxLength] Limite máximo de caracteres permitido no input.
|
|
83
|
+
* @param {(event: React.ChangeEvent<HTMLInputElement>) => void} [onChange] Callback disparado ao alterar o valor.
|
|
84
|
+
* @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onBlur] Callback disparado ao perder o foco.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
93
87
|
* ```tsx
|
|
94
88
|
* import React from 'react';
|
|
95
|
-
* import TextFieldValidate from '
|
|
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, '');
|
|
89
|
+
* import TextFieldValidate from '@/components/TextFieldValidate';
|
|
103
90
|
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
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
|
-
* };
|
|
91
|
+
* const Example = () => {
|
|
92
|
+
* const [email, setEmail] = React.useState('');
|
|
112
93
|
*
|
|
113
94
|
* return (
|
|
114
95
|
* <TextFieldValidate
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* onChange={(e) => setCep(e.target.value)}
|
|
120
|
-
* onBlur={handleCepBlur}
|
|
121
|
-
* pattern={/^\d{5}-?\d{3}$/}
|
|
122
|
-
* patternMessage="CEP inválido"
|
|
96
|
+
* label="E-mail"
|
|
97
|
+
* placeholder="Digite seu e-mail"
|
|
98
|
+
* value={email}
|
|
99
|
+
* onChange={(e) => setEmail(e.target.value)}
|
|
123
100
|
* required
|
|
101
|
+
* pattern={/^[^\s@]+@[^\s@]+\.[^\s@]+$/}
|
|
102
|
+
* patternMessage="E-mail inválido"
|
|
124
103
|
* showErrorOn="blur"
|
|
125
|
-
* maxLength={
|
|
104
|
+
* maxLength={120}
|
|
105
|
+
* borderRadius="6px"
|
|
126
106
|
* />
|
|
127
107
|
* );
|
|
128
108
|
* };
|
|
129
109
|
* ```
|
|
130
110
|
*/
|
|
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, }) => {
|
|
111
|
+
const TextFieldValidate = ({ id, label, background = '#fff', colorText = '#000', colorFocused = '#1976d2', borderRadius = '0', boxShadow = 'none', borderColor = '#ccc', 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, padding = '4px 8px' }) => {
|
|
132
112
|
const [touched, setTouched] = React.useState(false);
|
|
133
113
|
const errorMessage = React.useMemo(() => {
|
|
134
114
|
if (showErrorOn === 'change') {
|
|
@@ -170,7 +150,7 @@ const TextFieldValidate = ({ id, label, background, colorText = '#000', borderRa
|
|
|
170
150
|
onBlur(event);
|
|
171
151
|
}
|
|
172
152
|
};
|
|
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: {
|
|
153
|
+
return (_jsx(StyledTextField, { id: id, label: label, placeholder: placeholder, value: value, onChange: onChange, onBlur: handleBlur, background: background, colorText: colorText, colorFocused: colorFocused, borderRadius: borderRadius, boxShadow: boxShadow, borderColor: borderColor, padding: padding, disabled: disabled, multiline: multiline, required: required, rows: multiline ? rows : undefined, fullWidth: true, error: Boolean(errorMessage), helperText: errorMessage || ' ', slotProps: {
|
|
174
154
|
input: {
|
|
175
155
|
inputProps: typeof maxLength === 'number' ? { maxLength } : undefined,
|
|
176
156
|
},
|
|
@@ -1 +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;AAC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,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAClC,SAAS,QACT,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,EAC5B,UAAU,EAAE,YAAY,IAAI,GAAG,EAC/B,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,UAAU,EAAE,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS;aACtE;SACF,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,iBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AAEpD,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TypographyVariant } from '@mui/material';
|
|
3
|
+
import { ColorProps } from '@/types/ColorProps';
|
|
4
|
+
import { BorderProps } from '@/types/BorderProps';
|
|
5
|
+
import { LayoutProps } from '@/types/LayoutProps';
|
|
6
|
+
import { TextProps } from '@/types/TextProps';
|
|
7
|
+
interface GoogleButtonProps extends ColorProps, BorderProps, LayoutProps, TextProps {
|
|
8
|
+
text: string;
|
|
9
|
+
variant?: TypographyVariant;
|
|
10
|
+
endpoint: string;
|
|
11
|
+
messageError?: string;
|
|
12
|
+
errorColor?: string;
|
|
13
|
+
background?: string;
|
|
14
|
+
width?: string;
|
|
15
|
+
height?: string;
|
|
16
|
+
padding?: string;
|
|
17
|
+
margin?: string;
|
|
18
|
+
border?: string;
|
|
19
|
+
borderRadius?: string;
|
|
20
|
+
boxShadow?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Componente de botão que redireciona o usuário para um endpoint externo
|
|
24
|
+
* (ex: autenticação com Google). Durante o clique, o botão entra em estado
|
|
25
|
+
* de loading e, caso ocorra algum erro, exibe uma mensagem abaixo do botão.
|
|
26
|
+
*
|
|
27
|
+
* @param {string} text Texto exibido dentro do botão.
|
|
28
|
+
* @param {TypographyVariant} [variant='body1'] Variante do Typography usada no texto do botão.
|
|
29
|
+
* @param {string} endpoint URL para a qual o usuário será redirecionado ao clicar no botão.
|
|
30
|
+
* @param {string} [messageError='Ocorreu um erro ao processar sua solicitação.'] Mensagem exibida em caso de erro.
|
|
31
|
+
* @param {string} [errorColor='#d32f2f'] Cor do texto da mensagem de erro.
|
|
32
|
+
* @param {string} [width='auto'] Largura do botão.
|
|
33
|
+
* @param {string} [height='auto'] Altura do botão.
|
|
34
|
+
* @param {string} [padding='8px 24px'] Espaçamento interno do botão.
|
|
35
|
+
* @param {string} [margin='0'] Margem externa do botão.
|
|
36
|
+
* @param {string} [background='transparent'] Cor de fundo do botão.
|
|
37
|
+
* @param {string} [border='none'] Borda do botão.
|
|
38
|
+
* @param {string | number} [borderRadius='8px'] Raio da borda do botão.
|
|
39
|
+
* @param {string} [boxShadow='none'] Sombra aplicada ao botão.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* import { GoogleButton } from '@/components/GoogleButton';
|
|
44
|
+
*
|
|
45
|
+
* const Example = () => {
|
|
46
|
+
* return (
|
|
47
|
+
* <GoogleButton
|
|
48
|
+
* text="Continuar com Google"
|
|
49
|
+
* endpoint="/api/auth/google"
|
|
50
|
+
* width="100%"
|
|
51
|
+
* height="40px"
|
|
52
|
+
* background="transparent"
|
|
53
|
+
* border="1px solid #ccc"
|
|
54
|
+
* borderRadius="6px"
|
|
55
|
+
* boxShadow="0 2px 6px rgba(0,0,0,0.1)"
|
|
56
|
+
* messageError="Falha ao autenticar com o Google."
|
|
57
|
+
* errorColor="#d32f2f"
|
|
58
|
+
* />
|
|
59
|
+
* );
|
|
60
|
+
* };
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const GoogleButton: React.FC<GoogleButtonProps>;
|
|
64
|
+
export default GoogleButton;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Button, styled, Typography, Box } from '@mui/material';
|
|
4
|
+
const ButtonFormStyled = styled(Button, {
|
|
5
|
+
shouldForwardProp: (prop) => ![
|
|
6
|
+
'width',
|
|
7
|
+
'height',
|
|
8
|
+
'padding',
|
|
9
|
+
'margin',
|
|
10
|
+
'background',
|
|
11
|
+
'border',
|
|
12
|
+
'borderRadius',
|
|
13
|
+
'boxShadow',
|
|
14
|
+
].includes(prop),
|
|
15
|
+
})(({ width, height, padding, margin, background, border, borderRadius, boxShadow, }) => ({
|
|
16
|
+
// Layout
|
|
17
|
+
width: width,
|
|
18
|
+
height: height,
|
|
19
|
+
padding: padding,
|
|
20
|
+
margin: margin,
|
|
21
|
+
// Visual
|
|
22
|
+
background: background,
|
|
23
|
+
border: border,
|
|
24
|
+
borderRadius: borderRadius,
|
|
25
|
+
boxShadow: boxShadow,
|
|
26
|
+
textTransform: 'none',
|
|
27
|
+
cursor: 'pointer',
|
|
28
|
+
'&:hover': {
|
|
29
|
+
opacity: 0.9,
|
|
30
|
+
boxShadow: boxShadow || 'none',
|
|
31
|
+
},
|
|
32
|
+
'&:disabled': {
|
|
33
|
+
opacity: 0.6,
|
|
34
|
+
cursor: 'not-allowed',
|
|
35
|
+
},
|
|
36
|
+
}));
|
|
37
|
+
/**
|
|
38
|
+
* Componente de botão que redireciona o usuário para um endpoint externo
|
|
39
|
+
* (ex: autenticação com Google). Durante o clique, o botão entra em estado
|
|
40
|
+
* de loading e, caso ocorra algum erro, exibe uma mensagem abaixo do botão.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} text Texto exibido dentro do botão.
|
|
43
|
+
* @param {TypographyVariant} [variant='body1'] Variante do Typography usada no texto do botão.
|
|
44
|
+
* @param {string} endpoint URL para a qual o usuário será redirecionado ao clicar no botão.
|
|
45
|
+
* @param {string} [messageError='Ocorreu um erro ao processar sua solicitação.'] Mensagem exibida em caso de erro.
|
|
46
|
+
* @param {string} [errorColor='#d32f2f'] Cor do texto da mensagem de erro.
|
|
47
|
+
* @param {string} [width='auto'] Largura do botão.
|
|
48
|
+
* @param {string} [height='auto'] Altura do botão.
|
|
49
|
+
* @param {string} [padding='8px 24px'] Espaçamento interno do botão.
|
|
50
|
+
* @param {string} [margin='0'] Margem externa do botão.
|
|
51
|
+
* @param {string} [background='transparent'] Cor de fundo do botão.
|
|
52
|
+
* @param {string} [border='none'] Borda do botão.
|
|
53
|
+
* @param {string | number} [borderRadius='8px'] Raio da borda do botão.
|
|
54
|
+
* @param {string} [boxShadow='none'] Sombra aplicada ao botão.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* import { GoogleButton } from '@/components/GoogleButton';
|
|
59
|
+
*
|
|
60
|
+
* const Example = () => {
|
|
61
|
+
* return (
|
|
62
|
+
* <GoogleButton
|
|
63
|
+
* text="Continuar com Google"
|
|
64
|
+
* endpoint="/api/auth/google"
|
|
65
|
+
* width="100%"
|
|
66
|
+
* height="40px"
|
|
67
|
+
* background="transparent"
|
|
68
|
+
* border="1px solid #ccc"
|
|
69
|
+
* borderRadius="6px"
|
|
70
|
+
* boxShadow="0 2px 6px rgba(0,0,0,0.1)"
|
|
71
|
+
* messageError="Falha ao autenticar com o Google."
|
|
72
|
+
* errorColor="#d32f2f"
|
|
73
|
+
* />
|
|
74
|
+
* );
|
|
75
|
+
* };
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
const GoogleButton = ({ text, variant = 'body1', endpoint, messageError = 'Ocorreu um erro ao processar sua solicitação.', errorColor = '#d32f2f', boxShadow = 'none', width = 'auto', height = 'auto', padding = '8px 24px', margin = '0', background = "transparent", border = 'none', borderRadius, }) => {
|
|
79
|
+
const [loading, setLoading] = React.useState(false);
|
|
80
|
+
const [errorMsg, setErrorMsg] = React.useState(null);
|
|
81
|
+
const handleClick = async () => {
|
|
82
|
+
setErrorMsg(null);
|
|
83
|
+
setLoading(true);
|
|
84
|
+
try {
|
|
85
|
+
window.location.href = endpoint;
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
setErrorMsg(messageError);
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
setLoading(false);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
return (_jsxs(Box, { children: [_jsx(ButtonFormStyled, { onClick: handleClick, disabled: loading, width: width, height: height, padding: padding, margin: margin, background: background, border: border, borderRadius: borderRadius, boxShadow: boxShadow, children: loading
|
|
95
|
+
? 'Carregando...'
|
|
96
|
+
: _jsx(Typography, { variant: variant, children: text }) }), errorMsg && (_jsx(Typography, { role: "alert", variant: "body2", sx: { mt: 1 }, color: errorColor, children: errorMsg }))] }));
|
|
97
|
+
};
|
|
98
|
+
GoogleButton.displayName = 'GoogleButton';
|
|
99
|
+
export default GoogleButton;
|
|
100
|
+
//# sourceMappingURL=GoogleButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleButton.js","sourceRoot":"","sources":["../../../src/components/login/GoogleButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAqB,MAAM,eAAe,CAAC;AAOnF,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE;IACtC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAC1B,CAAC;QACC,OAAO;QACP,QAAQ;QACR,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,QAAQ;QACR,cAAc;QACd,WAAW;KACZ,CAAC,QAAQ,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IAAI,CAAC,CAAC;QAClB,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC;YACH,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAA;QACjC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,WAAW,CAAC,YAAY,CAAC,CAAC;QAC5B,CAAC;gBAAS,CAAC;YACT,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,MAAC,GAAG,eACF,KAAC,gBAAgB,IAChB,OAAO,EAAE,WAAW,EACnB,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,YAEnB,OAAO;oBACN,CAAC,CAAC,eAAe;oBACjB,CAAC,CAAC,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,YAAG,IAAI,GAAc,GACpC,EAElB,QAAQ,IAAI,CACX,KAAC,UAAU,IACT,IAAI,EAAC,OAAO,EACZ,OAAO,EAAC,OAAO,EACf,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EACb,KAAK,EAAE,UAAU,YAEhB,QAAQ,GACE,CACd,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAC1C,eAAe,YAAY,CAAC"}
|
|
@@ -3,10 +3,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { Box, Divider, IconButton, InputAdornment, Typography } from '@mui/material';
|
|
6
|
-
import { ButtonFormStyled, LinkFormStyled, TextFieldStyled } from './FormStyled';
|
|
7
6
|
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
|
8
7
|
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
9
8
|
import GoogleIcon from '@mui/icons-material/Google';
|
|
9
|
+
import { ButtonFormStyled, LinkFormStyled, TextFieldStyled } from '../FormStyled';
|
|
10
10
|
const FormContainer = styled('div')(() => ({
|
|
11
11
|
display: 'flex',
|
|
12
12
|
flexDirection: 'column',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginForm.js","sourceRoot":"","sources":["../../../src/components/login/LoginForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,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,iBAAiB,MAAM,mCAAmC,CAAC;AAClE,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAElF,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,E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