@pipelinesolucoes/form 1.2.0-beta.10 → 1.2.0-beta.12
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/dist/components/SelectField.js +11 -10
- package/dist/components/SelectField.js.map +1 -1
- package/dist/components/TextFieldPassword.d.ts +138 -44
- package/dist/components/TextFieldPassword.js +157 -106
- package/dist/components/TextFieldPassword.js.map +1 -1
- package/dist/components/TextFieldValidate.d.ts +81 -29
- package/dist/components/TextFieldValidate.js +99 -95
- package/dist/components/TextFieldValidate.js.map +1 -1
- package/dist/components/login/FormLogin.js +2 -2
- package/dist/components/login/FormLogin.js.map +1 -1
- package/dist/components/login/FormPasswordRecovery.js +1 -1
- package/dist/components/login/FormPasswordRecovery.js.map +1 -1
- package/dist/components/login/FormSignUp.js +2 -2
- package/dist/components/login/FormSignUp.js.map +1 -1
- package/dist/constant.d.ts +9 -0
- package/dist/constant.js +10 -0
- package/dist/constant.js.map +1 -0
- package/dist/{components/style → style}/ButtonFormStyled.d.ts +1 -1
- package/dist/{components/style → style}/ButtonFormStyled.js +1 -1
- package/dist/style/ButtonFormStyled.js.map +1 -0
- package/dist/style/LinkFormStyled.js.map +1 -0
- package/dist/style/TextFieldStyle.d.ts +16 -0
- package/dist/style/TextFieldStyle.js +57 -0
- package/dist/style/TextFieldStyle.js.map +1 -0
- package/dist/theme.js +46 -45
- package/dist/theme.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/components/style/ButtonFormStyled.js.map +0 -1
- package/dist/components/style/LinkFormStyled.js.map +0 -1
- /package/dist/{components/style → style}/LinkFormStyled.d.ts +0 -0
- /package/dist/{components/style → style}/LinkFormStyled.js +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { FormControl, InputLabel, MenuItem, Select, FormHelperText, Typography } from '@mui/material';
|
|
4
4
|
import { styled, useTheme } from '@mui/material/styles';
|
|
5
|
+
import { fbbackground, fbborderColor, fbborderRadius, fbboxShadow, fbcolor, fbcolorFocused, fbpadding } from '@/constant';
|
|
5
6
|
const StyledWrapper = styled('div', {
|
|
6
7
|
shouldForwardProp: (prop) => !['width', 'margin'].includes(prop),
|
|
7
8
|
})(({ width, margin }) => ({
|
|
@@ -21,30 +22,30 @@ const StyledFormControl = styled(FormControl, {
|
|
|
21
22
|
width: '100%',
|
|
22
23
|
'& .MuiOutlinedInput-root': {
|
|
23
24
|
height: height,
|
|
24
|
-
background: background,
|
|
25
|
-
borderRadius: borderRadius,
|
|
26
|
-
boxShadow: boxShadow,
|
|
25
|
+
background: background !== null && background !== void 0 ? background : fbbackground,
|
|
26
|
+
borderRadius: borderRadius !== null && borderRadius !== void 0 ? borderRadius : fbborderRadius,
|
|
27
|
+
boxShadow: boxShadow !== null && boxShadow !== void 0 ? boxShadow : fbboxShadow,
|
|
27
28
|
'& fieldset': {
|
|
28
|
-
borderColor: borderColor !== null && borderColor !== void 0 ? borderColor :
|
|
29
|
+
borderColor: borderColor !== null && borderColor !== void 0 ? borderColor : fbborderColor,
|
|
29
30
|
},
|
|
30
31
|
'&:hover fieldset': {
|
|
31
|
-
borderColor: borderColor !== null && borderColor !== void 0 ? borderColor :
|
|
32
|
+
borderColor: borderColor !== null && borderColor !== void 0 ? borderColor : fbborderColor,
|
|
32
33
|
},
|
|
33
34
|
'&.Mui-focused fieldset': {
|
|
34
|
-
borderColor: borderColor !== null && borderColor !== void 0 ? borderColor :
|
|
35
|
+
borderColor: borderColor !== null && borderColor !== void 0 ? borderColor : fbcolorFocused,
|
|
35
36
|
},
|
|
36
37
|
'& .MuiSelect-select': {
|
|
37
|
-
padding: padding !== null && padding !== void 0 ? padding :
|
|
38
|
-
color: colorText,
|
|
38
|
+
padding: padding !== null && padding !== void 0 ? padding : fbpadding,
|
|
39
|
+
color: colorText !== null && colorText !== void 0 ? colorText : fbcolor,
|
|
39
40
|
display: 'flex',
|
|
40
41
|
alignItems: 'center',
|
|
41
42
|
},
|
|
42
43
|
},
|
|
43
44
|
'& .MuiInputLabel-root': {
|
|
44
|
-
color: colorText,
|
|
45
|
+
color: colorText !== null && colorText !== void 0 ? colorText : fbcolor,
|
|
45
46
|
},
|
|
46
47
|
'& .MuiInputLabel-root.Mui-focused': {
|
|
47
|
-
color: colorText,
|
|
48
|
+
color: colorText !== null && colorText !== void 0 ? colorText : fbcolor,
|
|
48
49
|
},
|
|
49
50
|
}));
|
|
50
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectField.js","sourceRoot":"","sources":["../../src/components/SelectField.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAqB,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACzH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectField.js","sourceRoot":"","sources":["../../src/components/SelectField.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAqB,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACzH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAuB1H,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,EAAE;IAClC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,IAAc,CAAC;CAC3E,CAAC,CAAkC,CAAC,EAAE,KA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O,CACL,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAC,eAAe,YAChD,WAAW,GACD,CACd,CAAC;wBACJ,CAAC;wBAED,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC;wBAErE,OAAO,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,YAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,mCAAI,EAAE,GAAc,CAAC;oBAC1E,CAAC,YAEA,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,KAAC,QAAQ,IAAoB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,YACtD,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,YAC7C,MAAM,CAAC,KAAK,GACF,IAHA,MAAM,CAAC,KAAK,CAIhB,CACZ,CAAC,GACK,EAER,UAAU,IAAI,CACb,KAAC,cAAc,IAAC,KAAK,EAAE,CAAC,eAAe,YACrC,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,YACzD,UAAU,GACA,GACE,CAClB,IAEiB,GACN,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,eAAe,WAAW,CAAC"}
|
|
@@ -29,60 +29,154 @@ interface TextFieldPasswordProps extends BorderProps, ColorProps, LayoutProps {
|
|
|
29
29
|
pattern?: RegExp;
|
|
30
30
|
patternMessage?: string;
|
|
31
31
|
showErrorOn?: 'blur' | 'change' | 'both';
|
|
32
|
-
/**
|
|
33
|
-
* Retorna somente a senha digitada (string).
|
|
34
|
-
*/
|
|
35
32
|
onPasswordChange?: (password: string) => void;
|
|
36
|
-
/**
|
|
37
|
-
* "Evento" com o resultado completo da validação.
|
|
38
|
-
*/
|
|
39
33
|
onValidationChange?: (result: PasswordValidationResult) => void;
|
|
40
|
-
/**
|
|
41
|
-
* Se você ainda quiser receber o evento nativo.
|
|
42
|
-
*/
|
|
43
34
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
44
35
|
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
45
36
|
}
|
|
46
37
|
/**
|
|
47
38
|
* Componente de campo de senha baseado no TextField do Material UI, com botão para alternar
|
|
48
|
-
* entre mostrar
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* -
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
39
|
+
* entre mostrar e ocultar a senha.
|
|
40
|
+
*
|
|
41
|
+
* O componente oferece:
|
|
42
|
+
* - Retorno apenas do valor da senha digitada via `onPasswordChange`
|
|
43
|
+
* - Validação automática de obrigatoriedade e formato (Regex)
|
|
44
|
+
* - Exibição controlada de mensagens de erro
|
|
45
|
+
* - Evento de validação completo via `onValidationChange`
|
|
46
|
+
* - Estilização via props com fallback para tokens do theme da Pipeline
|
|
47
|
+
*
|
|
48
|
+
* ---
|
|
49
|
+
*
|
|
50
|
+
* ### Tokens de estilo (ordem de prioridade)
|
|
51
|
+
*
|
|
52
|
+
* Para propriedades visuais, o componente resolve os valores nesta ordem:
|
|
53
|
+
* 1. **Props do componente**
|
|
54
|
+
* 2. **Theme da Pipeline** (`theme.pipelinesolucoes.forms.field`)
|
|
55
|
+
* 3. **Fallback interno** (valores padrão do componente)
|
|
56
|
+
*
|
|
57
|
+
* ---
|
|
58
|
+
*
|
|
59
|
+
* ### Tipografia
|
|
60
|
+
*
|
|
61
|
+
* A tipografia do texto digitado e do placeholder pode ser definida de duas formas:
|
|
62
|
+
*
|
|
63
|
+
* 1. **Material UI**
|
|
64
|
+
* Ao informar `textVariant`, o componente utiliza `theme.typography[textVariant]`.
|
|
65
|
+
*
|
|
66
|
+
* 2. **Theme da Pipeline**
|
|
67
|
+
* Quando `textVariant` não é informado, utiliza `theme.pipelinesolucoes.forms.field.typography`.
|
|
68
|
+
*
|
|
69
|
+
* **Ordem de prioridade (tipografia):**
|
|
70
|
+
* 1. `textVariant` (prop do componente)
|
|
71
|
+
* 2. `theme.typography[textVariant]` (Material UI)
|
|
72
|
+
* 3. `theme.pipelinesolucoes.forms.field.typography` (Pipeline)
|
|
73
|
+
* 4. Fallback interno (`theme.typography.body1`)
|
|
74
|
+
*
|
|
75
|
+
* ---
|
|
76
|
+
*
|
|
77
|
+
* @param {string} [id]
|
|
78
|
+
* ID do input.
|
|
79
|
+
*
|
|
80
|
+
* @param {string} [label]
|
|
81
|
+
* Label exibido no campo.
|
|
82
|
+
*
|
|
83
|
+
* @param {string} [placeholder]
|
|
84
|
+
* Texto de placeholder do input.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} [value]
|
|
87
|
+
* Valor controlado do campo.
|
|
88
|
+
*
|
|
89
|
+
* @param {import('@mui/material/styles').TypographyVariant} [textVariant]
|
|
90
|
+
* Variante de tipografia do Material UI aplicada ao texto digitado e ao placeholder.
|
|
91
|
+
* Quando omitida, utiliza a tipografia do theme da Pipeline (`theme.pipelinesolucoes.forms.field.typography`).
|
|
92
|
+
*
|
|
93
|
+
* ---
|
|
94
|
+
* ### Estilo / Aparência
|
|
95
|
+
*
|
|
96
|
+
* @param {string} [background]
|
|
97
|
+
* Cor de fundo do campo.
|
|
98
|
+
* Ordem: `background` → `theme.pipelinesolucoes.forms.field.background` → `#fff`.
|
|
99
|
+
*
|
|
100
|
+
* @param {string} [backgroundDisabled]
|
|
101
|
+
* Cor de fundo do campo quando desabilitado.
|
|
102
|
+
* Ordem: `backgroundDisabled` → `theme.pipelinesolucoes.forms.field.backgroundDisabled` → `#E5E7EB`.
|
|
103
|
+
*
|
|
104
|
+
* @param {string} [color]
|
|
105
|
+
* Cor do texto do campo (texto digitado e label).
|
|
106
|
+
* Ordem: `color` → `theme.pipelinesolucoes.forms.field.color` → `#000`.
|
|
107
|
+
*
|
|
108
|
+
* @param {string} [colorFocused]
|
|
109
|
+
* Cor aplicada ao estado focado (usada como cor de borda no focus).
|
|
110
|
+
* Ordem: `colorFocused` → `theme.pipelinesolucoes.forms.field.colorFocused` → `#1976d2`.
|
|
111
|
+
*
|
|
112
|
+
* @param {string} [colorDisabled]
|
|
113
|
+
* Cor do texto do campo quando desabilitado.
|
|
114
|
+
* Ordem: `colorDisabled` → `theme.pipelinesolucoes.forms.field.colorDisabled` → `#9CA3AF`.
|
|
115
|
+
*
|
|
116
|
+
* @param {string} [borderRadius]
|
|
117
|
+
* Raio da borda do campo.
|
|
118
|
+
* Ordem: `borderRadius` → `theme.pipelinesolucoes.forms.field.borderRadius` → `"0"`.
|
|
119
|
+
*
|
|
120
|
+
* @param {string} [boxShadow]
|
|
121
|
+
* Sombra do campo.
|
|
122
|
+
* Ordem: `boxShadow` → `theme.pipelinesolucoes.forms.field.boxShadow` → `"none"`.
|
|
123
|
+
*
|
|
124
|
+
* @param {string} [borderColor]
|
|
125
|
+
* Cor da borda do campo (estado padrão/hover).
|
|
126
|
+
* Ordem: `borderColor` → `theme.pipelinesolucoes.forms.field.borderColor` → `#ccc`.
|
|
127
|
+
*
|
|
128
|
+
* @param {string} [padding]
|
|
129
|
+
* Espaçamento interno do input (aplicado no texto e textarea).
|
|
130
|
+
* Ordem: `padding` → `theme.pipelinesolucoes.forms.field.padding` → `"4px 8px"`.
|
|
131
|
+
*
|
|
132
|
+
* ---
|
|
133
|
+
* ### Validação
|
|
134
|
+
*
|
|
135
|
+
* @param {boolean} [required=true]
|
|
136
|
+
* Define se o campo é obrigatório.
|
|
137
|
+
*
|
|
138
|
+
* @param {RegExp} [pattern=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,}$/]
|
|
139
|
+
* Expressão regular usada para validar o formato da senha.
|
|
140
|
+
*
|
|
141
|
+
* @param {string} [requiredMessage='Senha obrigatória']
|
|
142
|
+
* Mensagem exibida quando o campo obrigatório está vazio.
|
|
143
|
+
*
|
|
144
|
+
* @param {string} [patternMessage]
|
|
145
|
+
* Mensagem exibida quando a senha não atende ao formato definido.
|
|
146
|
+
*
|
|
147
|
+
* @param {'blur' | 'change' | 'both'} [showErrorOn='blur']
|
|
148
|
+
* Define quando a validação e exibição de erros deve ocorrer.
|
|
149
|
+
*
|
|
150
|
+
* @param {boolean} [disabled=false]
|
|
151
|
+
* Desabilita o campo.
|
|
152
|
+
*
|
|
153
|
+
* ---
|
|
154
|
+
* ### Eventos
|
|
155
|
+
*
|
|
156
|
+
* @param {(password: string) => void} [onPasswordChange]
|
|
157
|
+
* Callback que retorna apenas o valor da senha digitada.
|
|
158
|
+
*
|
|
159
|
+
* @param {(result: PasswordValidationResult) => void} [onValidationChange]
|
|
160
|
+
* Callback disparado sempre que a validação é executada, contendo o resultado completo.
|
|
161
|
+
*
|
|
162
|
+
* @param {(event: React.ChangeEvent<HTMLInputElement>) => void} [onChange]
|
|
163
|
+
* Evento `onChange` nativo do input (opcional).
|
|
164
|
+
*
|
|
165
|
+
* @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onBlur]
|
|
166
|
+
* Evento `onBlur` nativo do input (opcional).
|
|
167
|
+
*
|
|
168
|
+
* ---
|
|
67
169
|
*
|
|
68
170
|
* @example
|
|
69
171
|
* ```tsx
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* label="Senha"
|
|
79
|
-
* value={password}
|
|
80
|
-
* onPasswordChange={(p) => setPassword(p)}
|
|
81
|
-
* onValidationChange={(r) => console.log(r)}
|
|
82
|
-
* validateOn="both"
|
|
83
|
-
* />
|
|
84
|
-
* );
|
|
85
|
-
* };
|
|
172
|
+
* <TextFieldPassword
|
|
173
|
+
* label="Senha"
|
|
174
|
+
* background="#fff"
|
|
175
|
+
* borderRadius="10px"
|
|
176
|
+
* textVariant="body2"
|
|
177
|
+
* showErrorOn="both"
|
|
178
|
+
* onPasswordChange={(password) => console.log(password)}
|
|
179
|
+
* />
|
|
86
180
|
* ```
|
|
87
181
|
*/
|
|
88
182
|
declare const TextFieldPassword: React.FC<TextFieldPasswordProps>;
|
|
@@ -1,122 +1,160 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import TextField from '@mui/material/TextField';
|
|
5
4
|
import InputAdornment from '@mui/material/InputAdornment';
|
|
6
5
|
import IconButton from '@mui/material/IconButton';
|
|
7
6
|
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
8
7
|
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
'background',
|
|
13
|
-
'borderRadius',
|
|
14
|
-
'boxShadow',
|
|
15
|
-
'borderColor',
|
|
16
|
-
'colorFocused',
|
|
17
|
-
'backgroundDisabled',
|
|
18
|
-
'colorDisabled',
|
|
19
|
-
'padding',
|
|
20
|
-
'colorText',
|
|
21
|
-
'textVariant',
|
|
22
|
-
].includes(prop),
|
|
23
|
-
})(({ theme, background, backgroundDisabled, colorText, borderRadius, boxShadow, borderColor, colorFocused, colorDisabled, padding, textVariant, }) => {
|
|
24
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
25
|
-
const field = (_b = (_a = theme.pipelinesolucoes) === null || _a === void 0 ? void 0 : _a.forms) === null || _b === void 0 ? void 0 : _b.field;
|
|
26
|
-
// props -> tokens -> fallback
|
|
27
|
-
const bg = (_c = background !== null && background !== void 0 ? background : field === null || field === void 0 ? void 0 : field.background) !== null && _c !== void 0 ? _c : '#fff';
|
|
28
|
-
const bgDisabled = (_d = backgroundDisabled !== null && backgroundDisabled !== void 0 ? backgroundDisabled : field === null || field === void 0 ? void 0 : field.backgroundDisabled) !== null && _d !== void 0 ? _d : "#E5E7EB";
|
|
29
|
-
const txt = (_e = colorText !== null && colorText !== void 0 ? colorText : field === null || field === void 0 ? void 0 : field.color) !== null && _e !== void 0 ? _e : '#000';
|
|
30
|
-
const txtDisabled = (_f = colorDisabled !== null && colorDisabled !== void 0 ? colorDisabled : field === null || field === void 0 ? void 0 : field.colorDisabled) !== null && _f !== void 0 ? _f : "#9CA3AF";
|
|
31
|
-
const br = (_g = borderRadius !== null && borderRadius !== void 0 ? borderRadius : field === null || field === void 0 ? void 0 : field.borderRadius) !== null && _g !== void 0 ? _g : "0";
|
|
32
|
-
const sh = (_h = boxShadow !== null && boxShadow !== void 0 ? boxShadow : field === null || field === void 0 ? void 0 : field.boxShadow) !== null && _h !== void 0 ? _h : "none";
|
|
33
|
-
const bd = (_j = borderColor !== null && borderColor !== void 0 ? borderColor : field === null || field === void 0 ? void 0 : field.borderColor) !== null && _j !== void 0 ? _j : '#ccc';
|
|
34
|
-
const bdFocused = (_k = colorFocused !== null && colorFocused !== void 0 ? colorFocused : field === null || field === void 0 ? void 0 : field.colorFocused) !== null && _k !== void 0 ? _k : '#1976d2';
|
|
35
|
-
const pad = (_l = padding !== null && padding !== void 0 ? padding : field === null || field === void 0 ? void 0 : field.padding) !== null && _l !== void 0 ? _l : '4px 8px'; // pode deixar undefined se quiser respeitar o default do MUI
|
|
36
|
-
const typo = textVariant ? theme.typography[textVariant] : undefined;
|
|
37
|
-
return {
|
|
38
|
-
borderRadius: br,
|
|
39
|
-
boxShadow: sh,
|
|
40
|
-
'& .MuiInputBase-root': {
|
|
41
|
-
color: txt,
|
|
42
|
-
},
|
|
43
|
-
'& .MuiOutlinedInput-root': Object.assign(Object.assign(Object.assign({ background: bg, borderRadius: br, boxShadow: sh }, (pad ? { padding: pad } : {})), { '& .MuiOutlinedInput-notchedOutline': {
|
|
44
|
-
borderColor: bd,
|
|
45
|
-
}, '&:hover .MuiOutlinedInput-notchedOutline': {
|
|
46
|
-
borderColor: bd,
|
|
47
|
-
}, '&.Mui-focused .MuiOutlinedInput-notchedOutline': {
|
|
48
|
-
borderColor: bdFocused,
|
|
49
|
-
}, '&.Mui-disabled': {
|
|
50
|
-
background: bgDisabled,
|
|
51
|
-
color: txtDisabled,
|
|
52
|
-
'& .MuiOutlinedInput-notchedOutline': {
|
|
53
|
-
borderColor: bd,
|
|
54
|
-
},
|
|
55
|
-
}, '& input.Mui-disabled': {
|
|
56
|
-
WebkitTextFillColor: txtDisabled,
|
|
57
|
-
} }), (typo
|
|
58
|
-
? {
|
|
59
|
-
// Texto digitado
|
|
60
|
-
'& .MuiInputBase-input': Object.assign({}, typo),
|
|
61
|
-
// Placeholder (input e textarea)
|
|
62
|
-
'& input::placeholder': Object.assign(Object.assign({}, typo), { opacity: 0.7 }),
|
|
63
|
-
'& textarea::placeholder': Object.assign(Object.assign({}, typo), { opacity: 0.7 }),
|
|
64
|
-
}
|
|
65
|
-
: {})),
|
|
66
|
-
'& .MuiInputLabel-root': {
|
|
67
|
-
color: txt,
|
|
68
|
-
},
|
|
69
|
-
'& .MuiInputLabel-root.Mui-focused': {
|
|
70
|
-
color: bdFocused,
|
|
71
|
-
},
|
|
72
|
-
'& .MuiInputLabel-root.Mui-disabled': {
|
|
73
|
-
color: txtDisabled,
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
});
|
|
8
|
+
import { useTheme } from '@mui/material/styles';
|
|
9
|
+
import { TextFieldStyled } from '../style/TextFieldStyle';
|
|
10
|
+
import { fbbackground, fbbackgroundDisabled, fbborderColor, fbborderRadius, fbboxShadow, fbcolor, fbcolorDisabled, fbcolorFocused, fbpadding } from '@/constant';
|
|
77
11
|
/**
|
|
78
12
|
* Componente de campo de senha baseado no TextField do Material UI, com botão para alternar
|
|
79
|
-
* entre mostrar
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* -
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
13
|
+
* entre mostrar e ocultar a senha.
|
|
14
|
+
*
|
|
15
|
+
* O componente oferece:
|
|
16
|
+
* - Retorno apenas do valor da senha digitada via `onPasswordChange`
|
|
17
|
+
* - Validação automática de obrigatoriedade e formato (Regex)
|
|
18
|
+
* - Exibição controlada de mensagens de erro
|
|
19
|
+
* - Evento de validação completo via `onValidationChange`
|
|
20
|
+
* - Estilização via props com fallback para tokens do theme da Pipeline
|
|
21
|
+
*
|
|
22
|
+
* ---
|
|
23
|
+
*
|
|
24
|
+
* ### Tokens de estilo (ordem de prioridade)
|
|
25
|
+
*
|
|
26
|
+
* Para propriedades visuais, o componente resolve os valores nesta ordem:
|
|
27
|
+
* 1. **Props do componente**
|
|
28
|
+
* 2. **Theme da Pipeline** (`theme.pipelinesolucoes.forms.field`)
|
|
29
|
+
* 3. **Fallback interno** (valores padrão do componente)
|
|
30
|
+
*
|
|
31
|
+
* ---
|
|
32
|
+
*
|
|
33
|
+
* ### Tipografia
|
|
34
|
+
*
|
|
35
|
+
* A tipografia do texto digitado e do placeholder pode ser definida de duas formas:
|
|
36
|
+
*
|
|
37
|
+
* 1. **Material UI**
|
|
38
|
+
* Ao informar `textVariant`, o componente utiliza `theme.typography[textVariant]`.
|
|
39
|
+
*
|
|
40
|
+
* 2. **Theme da Pipeline**
|
|
41
|
+
* Quando `textVariant` não é informado, utiliza `theme.pipelinesolucoes.forms.field.typography`.
|
|
42
|
+
*
|
|
43
|
+
* **Ordem de prioridade (tipografia):**
|
|
44
|
+
* 1. `textVariant` (prop do componente)
|
|
45
|
+
* 2. `theme.typography[textVariant]` (Material UI)
|
|
46
|
+
* 3. `theme.pipelinesolucoes.forms.field.typography` (Pipeline)
|
|
47
|
+
* 4. Fallback interno (`theme.typography.body1`)
|
|
48
|
+
*
|
|
49
|
+
* ---
|
|
50
|
+
*
|
|
51
|
+
* @param {string} [id]
|
|
52
|
+
* ID do input.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} [label]
|
|
55
|
+
* Label exibido no campo.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} [placeholder]
|
|
58
|
+
* Texto de placeholder do input.
|
|
59
|
+
*
|
|
60
|
+
* @param {string} [value]
|
|
61
|
+
* Valor controlado do campo.
|
|
62
|
+
*
|
|
63
|
+
* @param {import('@mui/material/styles').TypographyVariant} [textVariant]
|
|
64
|
+
* Variante de tipografia do Material UI aplicada ao texto digitado e ao placeholder.
|
|
65
|
+
* Quando omitida, utiliza a tipografia do theme da Pipeline (`theme.pipelinesolucoes.forms.field.typography`).
|
|
66
|
+
*
|
|
67
|
+
* ---
|
|
68
|
+
* ### Estilo / Aparência
|
|
69
|
+
*
|
|
70
|
+
* @param {string} [background]
|
|
71
|
+
* Cor de fundo do campo.
|
|
72
|
+
* Ordem: `background` → `theme.pipelinesolucoes.forms.field.background` → `#fff`.
|
|
73
|
+
*
|
|
74
|
+
* @param {string} [backgroundDisabled]
|
|
75
|
+
* Cor de fundo do campo quando desabilitado.
|
|
76
|
+
* Ordem: `backgroundDisabled` → `theme.pipelinesolucoes.forms.field.backgroundDisabled` → `#E5E7EB`.
|
|
77
|
+
*
|
|
78
|
+
* @param {string} [color]
|
|
79
|
+
* Cor do texto do campo (texto digitado e label).
|
|
80
|
+
* Ordem: `color` → `theme.pipelinesolucoes.forms.field.color` → `#000`.
|
|
81
|
+
*
|
|
82
|
+
* @param {string} [colorFocused]
|
|
83
|
+
* Cor aplicada ao estado focado (usada como cor de borda no focus).
|
|
84
|
+
* Ordem: `colorFocused` → `theme.pipelinesolucoes.forms.field.colorFocused` → `#1976d2`.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} [colorDisabled]
|
|
87
|
+
* Cor do texto do campo quando desabilitado.
|
|
88
|
+
* Ordem: `colorDisabled` → `theme.pipelinesolucoes.forms.field.colorDisabled` → `#9CA3AF`.
|
|
89
|
+
*
|
|
90
|
+
* @param {string} [borderRadius]
|
|
91
|
+
* Raio da borda do campo.
|
|
92
|
+
* Ordem: `borderRadius` → `theme.pipelinesolucoes.forms.field.borderRadius` → `"0"`.
|
|
93
|
+
*
|
|
94
|
+
* @param {string} [boxShadow]
|
|
95
|
+
* Sombra do campo.
|
|
96
|
+
* Ordem: `boxShadow` → `theme.pipelinesolucoes.forms.field.boxShadow` → `"none"`.
|
|
97
|
+
*
|
|
98
|
+
* @param {string} [borderColor]
|
|
99
|
+
* Cor da borda do campo (estado padrão/hover).
|
|
100
|
+
* Ordem: `borderColor` → `theme.pipelinesolucoes.forms.field.borderColor` → `#ccc`.
|
|
101
|
+
*
|
|
102
|
+
* @param {string} [padding]
|
|
103
|
+
* Espaçamento interno do input (aplicado no texto e textarea).
|
|
104
|
+
* Ordem: `padding` → `theme.pipelinesolucoes.forms.field.padding` → `"4px 8px"`.
|
|
105
|
+
*
|
|
106
|
+
* ---
|
|
107
|
+
* ### Validação
|
|
108
|
+
*
|
|
109
|
+
* @param {boolean} [required=true]
|
|
110
|
+
* Define se o campo é obrigatório.
|
|
111
|
+
*
|
|
112
|
+
* @param {RegExp} [pattern=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,}$/]
|
|
113
|
+
* Expressão regular usada para validar o formato da senha.
|
|
114
|
+
*
|
|
115
|
+
* @param {string} [requiredMessage='Senha obrigatória']
|
|
116
|
+
* Mensagem exibida quando o campo obrigatório está vazio.
|
|
117
|
+
*
|
|
118
|
+
* @param {string} [patternMessage]
|
|
119
|
+
* Mensagem exibida quando a senha não atende ao formato definido.
|
|
120
|
+
*
|
|
121
|
+
* @param {'blur' | 'change' | 'both'} [showErrorOn='blur']
|
|
122
|
+
* Define quando a validação e exibição de erros deve ocorrer.
|
|
123
|
+
*
|
|
124
|
+
* @param {boolean} [disabled=false]
|
|
125
|
+
* Desabilita o campo.
|
|
126
|
+
*
|
|
127
|
+
* ---
|
|
128
|
+
* ### Eventos
|
|
129
|
+
*
|
|
130
|
+
* @param {(password: string) => void} [onPasswordChange]
|
|
131
|
+
* Callback que retorna apenas o valor da senha digitada.
|
|
132
|
+
*
|
|
133
|
+
* @param {(result: PasswordValidationResult) => void} [onValidationChange]
|
|
134
|
+
* Callback disparado sempre que a validação é executada, contendo o resultado completo.
|
|
135
|
+
*
|
|
136
|
+
* @param {(event: React.ChangeEvent<HTMLInputElement>) => void} [onChange]
|
|
137
|
+
* Evento `onChange` nativo do input (opcional).
|
|
138
|
+
*
|
|
139
|
+
* @param {(event: React.FocusEvent<HTMLInputElement>) => void} [onBlur]
|
|
140
|
+
* Evento `onBlur` nativo do input (opcional).
|
|
141
|
+
*
|
|
142
|
+
* ---
|
|
98
143
|
*
|
|
99
144
|
* @example
|
|
100
145
|
* ```tsx
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* label="Senha"
|
|
110
|
-
* value={password}
|
|
111
|
-
* onPasswordChange={(p) => setPassword(p)}
|
|
112
|
-
* onValidationChange={(r) => console.log(r)}
|
|
113
|
-
* validateOn="both"
|
|
114
|
-
* />
|
|
115
|
-
* );
|
|
116
|
-
* };
|
|
146
|
+
* <TextFieldPassword
|
|
147
|
+
* label="Senha"
|
|
148
|
+
* background="#fff"
|
|
149
|
+
* borderRadius="10px"
|
|
150
|
+
* textVariant="body2"
|
|
151
|
+
* showErrorOn="both"
|
|
152
|
+
* onPasswordChange={(password) => console.log(password)}
|
|
153
|
+
* />
|
|
117
154
|
* ```
|
|
118
155
|
*/
|
|
119
|
-
const TextFieldPassword = ({ id, label, placeholder, value, onPasswordChange, onValidationChange, required = true, pattern = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,}$/, requiredMessage = 'Senha obrigatória', patternMessage = 'A senha deve ter no mínimo 8 caracteres, com ao menos uma letra maiúscula, uma letra minúscula, um número e um caractere especial.', showErrorOn = 'blur', background, backgroundDisabled, color, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor,
|
|
156
|
+
const TextFieldPassword = ({ id, label, placeholder, value, onPasswordChange, onValidationChange, disabled = false, required = true, pattern = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z0-9]).{8,}$/, requiredMessage = 'Senha obrigatória', patternMessage = 'A senha deve ter no mínimo 8 caracteres, com ao menos uma letra maiúscula, uma letra minúscula, um número e um caractere especial.', showErrorOn = 'blur', background, backgroundDisabled, color, colorFocused, colorDisabled, borderRadius, boxShadow, borderColor, padding, textVariant, onChange, onBlur, }) => {
|
|
157
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
120
158
|
const [showPassword, setShowPassword] = React.useState(false);
|
|
121
159
|
const [touched, setTouched] = React.useState(false);
|
|
122
160
|
// fallback interno caso o usuário não use `value`
|
|
@@ -177,7 +215,20 @@ const TextFieldPassword = ({ id, label, placeholder, value, onPasswordChange, on
|
|
|
177
215
|
};
|
|
178
216
|
const shouldShowError = touched && !validation.isValid && validation.status !== 'idle';
|
|
179
217
|
const helperText = shouldShowError ? validation.message : ' ';
|
|
180
|
-
|
|
218
|
+
const theme = useTheme();
|
|
219
|
+
const field = (_b = (_a = theme.pipelinesolucoes) === null || _a === void 0 ? void 0 : _a.forms) === null || _b === void 0 ? void 0 : _b.field;
|
|
220
|
+
// props -> tokens -> fallback
|
|
221
|
+
const bg = (_c = background !== null && background !== void 0 ? background : field === null || field === void 0 ? void 0 : field.background) !== null && _c !== void 0 ? _c : fbbackground;
|
|
222
|
+
const bgDisabled = (_d = backgroundDisabled !== null && backgroundDisabled !== void 0 ? backgroundDisabled : field === null || field === void 0 ? void 0 : field.backgroundDisabled) !== null && _d !== void 0 ? _d : fbbackgroundDisabled;
|
|
223
|
+
const txt = (_e = color !== null && color !== void 0 ? color : field === null || field === void 0 ? void 0 : field.color) !== null && _e !== void 0 ? _e : fbcolor;
|
|
224
|
+
const txtDisabled = (_f = colorDisabled !== null && colorDisabled !== void 0 ? colorDisabled : field === null || field === void 0 ? void 0 : field.colorDisabled) !== null && _f !== void 0 ? _f : fbcolorDisabled;
|
|
225
|
+
const br = (_g = borderRadius !== null && borderRadius !== void 0 ? borderRadius : field === null || field === void 0 ? void 0 : field.borderRadius) !== null && _g !== void 0 ? _g : fbborderRadius;
|
|
226
|
+
const sh = (_h = boxShadow !== null && boxShadow !== void 0 ? boxShadow : field === null || field === void 0 ? void 0 : field.boxShadow) !== null && _h !== void 0 ? _h : fbboxShadow;
|
|
227
|
+
const bd = (_j = borderColor !== null && borderColor !== void 0 ? borderColor : field === null || field === void 0 ? void 0 : field.borderColor) !== null && _j !== void 0 ? _j : fbborderColor;
|
|
228
|
+
const bdFocused = (_k = colorFocused !== null && colorFocused !== void 0 ? colorFocused : field === null || field === void 0 ? void 0 : field.colorFocused) !== null && _k !== void 0 ? _k : fbcolorFocused;
|
|
229
|
+
const pad = (_l = padding !== null && padding !== void 0 ? padding : field === null || field === void 0 ? void 0 : field.padding) !== null && _l !== void 0 ? _l : fbpadding;
|
|
230
|
+
const typo = (_o = (_m = (textVariant && theme.typography[textVariant])) !== null && _m !== void 0 ? _m : field === null || field === void 0 ? void 0 : field.typography) !== null && _o !== void 0 ? _o : theme.typography.body1;
|
|
231
|
+
return (_jsx(TextFieldStyled, { type: showPassword ? 'text' : 'password', id: id, typo: typo, label: label, placeholder: placeholder, value: currentValue, background: bg, backgroundDisabled: bgDisabled, colorText: txt, colorFocused: bdFocused, colorDisabled: txtDisabled, borderRadius: br, boxShadow: sh, borderColor: bd, padding: pad, disabled: disabled, required: required, fullWidth: true, error: shouldShowError, helperText: helperText, slotProps: {
|
|
181
232
|
input: {
|
|
182
233
|
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { onClick: () => setShowPassword((prev) => !prev), edge: "end", "aria-label": showPassword ? 'Ocultar senha' : 'Mostrar senha', sx: { margin: '0 16px 0 0' }, children: showPassword ? _jsx(VisibilityOffIcon, {}) : _jsx(VisibilityIcon, {}) }) })),
|
|
183
234
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFieldPassword.js","sourceRoot":"","sources":["../../src/components/TextFieldPassword.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"TextFieldPassword.js","sourceRoot":"","sources":["../../src/components/TextFieldPassword.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAC1D,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAqB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA2CjK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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