componenteshospitais 2.0.7 → 2.0.9
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/cjs/index.js +21 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +21 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/InputField.d.ts +3 -0
- package/dist/types/components/SelectField.d.ts +2 -0
- package/dist/types/components/TextArea.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/Button.tsx +1 -2
- package/src/components/InputField.tsx +20 -4
- package/src/components/SelectField.tsx +22 -1
- package/src/components/TextArea.tsx +8 -2
|
@@ -17,6 +17,9 @@ interface InputFieldProps {
|
|
|
17
17
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
18
18
|
corFundo?: string;
|
|
19
19
|
corLabel?: string;
|
|
20
|
+
borderRadius?: number;
|
|
21
|
+
colorIcon?: string;
|
|
22
|
+
border?: string;
|
|
20
23
|
}
|
|
21
24
|
declare const InputField: React.FC<InputFieldProps>;
|
|
22
25
|
export default InputField;
|
|
@@ -18,6 +18,8 @@ interface SelectComponentProps {
|
|
|
18
18
|
corFundo?: string;
|
|
19
19
|
corLabel?: string;
|
|
20
20
|
empresa?: '1' | '2' | '3' | '4' | '5';
|
|
21
|
+
borderRadius?: number;
|
|
22
|
+
border?: string;
|
|
21
23
|
}
|
|
22
24
|
declare const SelectField: React.FC<SelectComponentProps>;
|
|
23
25
|
export default SelectField;
|
|
@@ -14,6 +14,8 @@ interface TextAreaFieldProps {
|
|
|
14
14
|
onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
|
15
15
|
corFundo?: string;
|
|
16
16
|
corLabel?: string;
|
|
17
|
+
borderRadius?: number;
|
|
18
|
+
border?: string;
|
|
17
19
|
}
|
|
18
20
|
declare const TextAreaField: React.FC<TextAreaFieldProps>;
|
|
19
21
|
export default TextAreaField;
|
package/package.json
CHANGED
|
@@ -14,8 +14,7 @@ const Button: React.FC<ButtonProps> = ({ empresa, type = 'submit', onClick, text
|
|
|
14
14
|
const empresaClass = styles[`empresa${empresa}`];
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
<div className={`${empresaClass}`}
|
|
18
|
-
style={{ borderRadius: borderRadius ? `${borderRadius}px` : '' }}>
|
|
17
|
+
<div className={`${empresaClass}`}>
|
|
19
18
|
{type === 'submit' ? (
|
|
20
19
|
<input type="submit" className={styles.inputSubmit} style={{width: largura ? `${largura}` : '', borderRadius: borderRadius ? `${borderRadius}px` : '' }} value={texto}/>
|
|
21
20
|
) : (
|
|
@@ -21,6 +21,9 @@ interface InputFieldProps {
|
|
|
21
21
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void; // Adicionando onBlur como opcional
|
|
22
22
|
corFundo?: string;
|
|
23
23
|
corLabel?: string;
|
|
24
|
+
borderRadius?: number;
|
|
25
|
+
colorIcon?: string;
|
|
26
|
+
border?: string;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
const InputField: React.FC<InputFieldProps> = ({
|
|
@@ -40,7 +43,10 @@ const InputField: React.FC<InputFieldProps> = ({
|
|
|
40
43
|
onKeyPress,
|
|
41
44
|
onBlur, // Usando onBlur nas props
|
|
42
45
|
corFundo,
|
|
43
|
-
corLabel
|
|
46
|
+
corLabel,
|
|
47
|
+
borderRadius,
|
|
48
|
+
colorIcon,
|
|
49
|
+
border
|
|
44
50
|
}) => {
|
|
45
51
|
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
|
46
52
|
|
|
@@ -85,7 +91,12 @@ const InputField: React.FC<InputFieldProps> = ({
|
|
|
85
91
|
name={id}
|
|
86
92
|
placeholder={placeholder}
|
|
87
93
|
className={styles.inputPadrao}
|
|
88
|
-
style={{
|
|
94
|
+
style={{
|
|
95
|
+
width: largura ? `${largura}` : '',
|
|
96
|
+
backgroundColor: (disabled ? '#e5e5e5' : (corFundo ? corFundo : '')),
|
|
97
|
+
borderRadius: (borderRadius ? `${borderRadius}px` : ''),
|
|
98
|
+
border: (border ? border : '')
|
|
99
|
+
}}
|
|
89
100
|
readOnly={readonly}
|
|
90
101
|
required={required}
|
|
91
102
|
checked={checked}
|
|
@@ -103,7 +114,12 @@ const InputField: React.FC<InputFieldProps> = ({
|
|
|
103
114
|
placeholder={placeholder}
|
|
104
115
|
onChange={handleChange} // Chama o handleChange que verifica se onChange existe
|
|
105
116
|
className={styles.inputPadrao}
|
|
106
|
-
style={{
|
|
117
|
+
style={{
|
|
118
|
+
width: largura ? `${largura}` : '',
|
|
119
|
+
backgroundColor: (disabled ? '#e5e5e5' : (corFundo ? corFundo : '')),
|
|
120
|
+
borderRadius: (borderRadius ? `${borderRadius}px` : ''),
|
|
121
|
+
border: (border ? border : '')
|
|
122
|
+
}}
|
|
107
123
|
readOnly={readonly}
|
|
108
124
|
disabled={disabled}
|
|
109
125
|
required={required}
|
|
@@ -115,7 +131,7 @@ const InputField: React.FC<InputFieldProps> = ({
|
|
|
115
131
|
)}
|
|
116
132
|
{type === 'password' && (
|
|
117
133
|
<div className={styles.passwordToggleIcon} onClick={togglePasswordVisibility}>
|
|
118
|
-
{isPasswordVisible ? <FaEyeSlash /> : <FaEye />}
|
|
134
|
+
{isPasswordVisible ? <FaEyeSlash style={{color: colorIcon ? colorIcon : ''}} /> : <FaEye style={{color: colorIcon ? colorIcon : ''}}/>}
|
|
119
135
|
</div>
|
|
120
136
|
)}
|
|
121
137
|
</div>
|
|
@@ -21,6 +21,8 @@ interface SelectComponentProps {
|
|
|
21
21
|
corFundo?: string;
|
|
22
22
|
corLabel?: string;
|
|
23
23
|
empresa?: '1' | '2' | '3' | '4' | '5';
|
|
24
|
+
borderRadius?: number;
|
|
25
|
+
border?: string;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
// Função para mapear empresa com a cor da seta
|
|
@@ -35,7 +37,24 @@ const getArrowColorByEmpresa = (empresa?: string) => {
|
|
|
35
37
|
}
|
|
36
38
|
};
|
|
37
39
|
|
|
38
|
-
const SelectField: React.FC<SelectComponentProps> = ({
|
|
40
|
+
const SelectField: React.FC<SelectComponentProps> = ({
|
|
41
|
+
id,
|
|
42
|
+
name,
|
|
43
|
+
options,
|
|
44
|
+
value,
|
|
45
|
+
onChange,
|
|
46
|
+
label,
|
|
47
|
+
optionDefault,
|
|
48
|
+
largura,
|
|
49
|
+
disabled,
|
|
50
|
+
multiple,
|
|
51
|
+
required,
|
|
52
|
+
corFundo,
|
|
53
|
+
corLabel,
|
|
54
|
+
empresa,
|
|
55
|
+
borderRadius,
|
|
56
|
+
border
|
|
57
|
+
}) => {
|
|
39
58
|
|
|
40
59
|
const handleSelectChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
|
|
41
60
|
if (multiple) {
|
|
@@ -70,6 +89,8 @@ const SelectField: React.FC<SelectComponentProps> = ({ id, name, options, value,
|
|
|
70
89
|
backgroundPosition: 'right 0.75rem center',
|
|
71
90
|
backgroundSize: '1rem',
|
|
72
91
|
paddingRight: '2.5rem',
|
|
92
|
+
borderRadius: (borderRadius ? `${borderRadius}px` : ''),
|
|
93
|
+
border: (border ? border : '')
|
|
73
94
|
}}
|
|
74
95
|
disabled={disabled}
|
|
75
96
|
multiple={multiple}
|
|
@@ -16,6 +16,8 @@ interface TextAreaFieldProps {
|
|
|
16
16
|
onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
|
17
17
|
corFundo?: string;
|
|
18
18
|
corLabel?: string;
|
|
19
|
+
borderRadius?: number;
|
|
20
|
+
border?: string;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
const TextAreaField: React.FC<TextAreaFieldProps> = ({
|
|
@@ -32,7 +34,9 @@ const TextAreaField: React.FC<TextAreaFieldProps> = ({
|
|
|
32
34
|
onKeyPress,
|
|
33
35
|
onBlur,
|
|
34
36
|
corFundo,
|
|
35
|
-
corLabel
|
|
37
|
+
corLabel,
|
|
38
|
+
borderRadius,
|
|
39
|
+
border
|
|
36
40
|
}) => {
|
|
37
41
|
const appliedMaxLength = maxLength !== undefined ? maxLength : 524288;
|
|
38
42
|
|
|
@@ -51,7 +55,9 @@ const TextAreaField: React.FC<TextAreaFieldProps> = ({
|
|
|
51
55
|
width: largura ? `${largura}` : '',
|
|
52
56
|
backgroundColor: disabled ? '#e5e5e5' : (corFundo ? corFundo : ''),
|
|
53
57
|
resize: 'none',
|
|
54
|
-
height: '6rem'
|
|
58
|
+
height: '6rem',
|
|
59
|
+
borderRadius: (borderRadius ? `${borderRadius}px` : ''),
|
|
60
|
+
border: (border ? border : '')
|
|
55
61
|
}}
|
|
56
62
|
readOnly={readonly}
|
|
57
63
|
disabled={disabled}
|