componenteshospitais 3.0.5 → 3.0.7

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 CHANGED
@@ -240,7 +240,7 @@ function FaDownload (props) {
240
240
  }
241
241
 
242
242
  var InputField = function (_a) {
243
- var type = _a.type, id = _a.id, placeholder = _a.placeholder, onChange = _a.onChange, value = _a.value, label = _a.label, largura = _a.largura, readonly = _a.readonly, disabled = _a.disabled, required = _a.required, checked = _a.checked, maxLength = _a.maxLength, maskType = _a.maskType, onKeyPress = _a.onKeyPress, onBlur = _a.onBlur, corFundo = _a.corFundo, corLabel = _a.corLabel, borderRadius = _a.borderRadius, colorIcon = _a.colorIcon, border = _a.border;
243
+ var type = _a.type, id = _a.id, name = _a.name, placeholder = _a.placeholder, onChange = _a.onChange, value = _a.value, label = _a.label, largura = _a.largura, readonly = _a.readonly, disabled = _a.disabled, required = _a.required, checked = _a.checked, maxLength = _a.maxLength, maskType = _a.maskType, onKeyPress = _a.onKeyPress, onBlur = _a.onBlur, corFundo = _a.corFundo, corLabel = _a.corLabel, borderRadius = _a.borderRadius, colorIcon = _a.colorIcon, border = _a.border;
244
244
  var _b = React.useState(false), isPasswordVisible = _b[0], setIsPasswordVisible = _b[1];
245
245
  var togglePasswordVisibility = function () {
246
246
  setIsPasswordVisible(!isPasswordVisible);
@@ -299,7 +299,7 @@ var InputField = function (_a) {
299
299
  return (React.createElement(React.Fragment, null,
300
300
  label && React.createElement("label", { htmlFor: id, style: { color: corLabel ? corLabel : '' } }, label),
301
301
  React.createElement("div", { className: styles$5.inputWrapper },
302
- React.createElement("input", { type: type === 'password' && isPasswordVisible ? 'text' : type, id: id, name: id, value: value, placeholder: placeholder, onChange: handleChange, className: styles$5.inputPadrao, style: {
302
+ React.createElement("input", { type: type === 'password' && isPasswordVisible ? 'text' : type, id: id, name: name, value: value, placeholder: placeholder, onChange: handleChange, className: styles$5.inputPadrao, style: {
303
303
  width: largura ? "".concat(largura) : '',
304
304
  backgroundColor: disabled ? '#e5e5e5' : (corFundo ? corFundo : ''),
305
305
  borderRadius: borderRadius ? "".concat(borderRadius, "px") : '',
package/dist/esm/index.js CHANGED
@@ -238,7 +238,7 @@ function FaDownload (props) {
238
238
  }
239
239
 
240
240
  var InputField = function (_a) {
241
- var type = _a.type, id = _a.id, placeholder = _a.placeholder, onChange = _a.onChange, value = _a.value, label = _a.label, largura = _a.largura, readonly = _a.readonly, disabled = _a.disabled, required = _a.required, checked = _a.checked, maxLength = _a.maxLength, maskType = _a.maskType, onKeyPress = _a.onKeyPress, onBlur = _a.onBlur, corFundo = _a.corFundo, corLabel = _a.corLabel, borderRadius = _a.borderRadius, colorIcon = _a.colorIcon, border = _a.border;
241
+ var type = _a.type, id = _a.id, name = _a.name, placeholder = _a.placeholder, onChange = _a.onChange, value = _a.value, label = _a.label, largura = _a.largura, readonly = _a.readonly, disabled = _a.disabled, required = _a.required, checked = _a.checked, maxLength = _a.maxLength, maskType = _a.maskType, onKeyPress = _a.onKeyPress, onBlur = _a.onBlur, corFundo = _a.corFundo, corLabel = _a.corLabel, borderRadius = _a.borderRadius, colorIcon = _a.colorIcon, border = _a.border;
242
242
  var _b = useState(false), isPasswordVisible = _b[0], setIsPasswordVisible = _b[1];
243
243
  var togglePasswordVisibility = function () {
244
244
  setIsPasswordVisible(!isPasswordVisible);
@@ -297,7 +297,7 @@ var InputField = function (_a) {
297
297
  return (React.createElement(React.Fragment, null,
298
298
  label && React.createElement("label", { htmlFor: id, style: { color: corLabel ? corLabel : '' } }, label),
299
299
  React.createElement("div", { className: styles$5.inputWrapper },
300
- React.createElement("input", { type: type === 'password' && isPasswordVisible ? 'text' : type, id: id, name: id, value: value, placeholder: placeholder, onChange: handleChange, className: styles$5.inputPadrao, style: {
300
+ React.createElement("input", { type: type === 'password' && isPasswordVisible ? 'text' : type, id: id, name: name, value: value, placeholder: placeholder, onChange: handleChange, className: styles$5.inputPadrao, style: {
301
301
  width: largura ? "".concat(largura) : '',
302
302
  backgroundColor: disabled ? '#e5e5e5' : (corFundo ? corFundo : ''),
303
303
  borderRadius: borderRadius ? "".concat(borderRadius, "px") : '',
@@ -1,8 +1,9 @@
1
1
  import React, { ChangeEvent } from 'react';
2
- interface InputFieldProps {
2
+ export interface InputFieldProps {
3
3
  label?: string;
4
4
  type: string;
5
5
  id: string;
6
+ name?: string;
6
7
  placeholder: string;
7
8
  value: string;
8
9
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
@@ -2,6 +2,6 @@ import { Meta } from '@storybook/react';
2
2
  import { InputFieldProps } from '../components/InputField';
3
3
  declare const meta: Meta<InputFieldProps>;
4
4
  export default meta;
5
- export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, any>;
6
- export declare const Password: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, any>;
7
- export declare const Disabled: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, any>;
5
+ export declare const Primary: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, InputFieldProps>;
6
+ export declare const Password: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, InputFieldProps>;
7
+ export declare const Disabled: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, InputFieldProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "componenteshospitais",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -2,10 +2,11 @@ import React, { ChangeEvent, useState } from 'react';
2
2
  import { FaEye, FaEyeSlash } from 'react-icons/fa'; // FontAwesome icons
3
3
  import styles from '../styles/input.module.css';
4
4
 
5
- interface InputFieldProps {
5
+ export interface InputFieldProps {
6
6
  label?: string;
7
7
  type: string;
8
8
  id: string;
9
+ name?: string;
9
10
  placeholder: string;
10
11
  value: string;
11
12
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
@@ -28,6 +29,7 @@ interface InputFieldProps {
28
29
  const InputField: React.FC<InputFieldProps> = ({
29
30
  type,
30
31
  id,
32
+ name,
31
33
  placeholder,
32
34
  onChange,
33
35
  value,
@@ -121,7 +123,7 @@ const InputField: React.FC<InputFieldProps> = ({
121
123
  <input
122
124
  type={type === 'password' && isPasswordVisible ? 'text' : type}
123
125
  id={id}
124
- name={id}
126
+ name={name}
125
127
  value={value}
126
128
  placeholder={placeholder}
127
129
  onChange={handleChange} // Chama o handleChange que aplica a máscara