@producteca/producteca-ui-kit 1.82.2 → 1.83.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.
@@ -1,10 +1,6 @@
1
1
  import { default as React } from 'react';
2
- import { TextInputProps } from './textInput';
2
+ import { FormFieldProps } from './formField.types';
3
3
 
4
- export interface FormFieldProps extends TextInputProps {
5
- label?: string;
6
- children?: React.ReactNode;
7
- rightAdornment?: React.ReactNode;
8
- }
9
4
  export declare const FormField: React.FC<FormFieldProps>;
10
5
  export default FormField;
6
+ export type { FormFieldProps };
@@ -0,0 +1,34 @@
1
+ import { default as React, ChangeEvent } from 'react';
2
+ import { Meta, InputValue } from '../../../validators';
3
+ import { ReduxFormInput } from '../../../hooks/useReduxFormField';
4
+
5
+ export interface TextInputProps {
6
+ meta?: Meta;
7
+ max?: number;
8
+ min?: number;
9
+ name: string;
10
+ noErrors?: boolean;
11
+ value?: InputValue;
12
+ disabled?: boolean;
13
+ required?: boolean;
14
+ placeholder?: string;
15
+ isClearable?: boolean;
16
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'fullwidth';
17
+ sx?: React.CSSProperties;
18
+ leftIcon?: React.ReactNode;
19
+ rightIcon?: React.ReactNode;
20
+ isValid?: (value: InputValue) => boolean;
21
+ type?: 'text' | 'number' | 'password' | 'date' | 'dateRange' | undefined;
22
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
23
+ input?: ReduxFormInput;
24
+ inputRef?: React.RefObject<HTMLInputElement>;
25
+ }
26
+ export interface FormFieldProps extends TextInputProps {
27
+ label?: string;
28
+ children?: React.ReactNode;
29
+ rightAdornment?: React.ReactNode;
30
+ }
31
+ export interface VisibilityIconProps {
32
+ showPassword: boolean;
33
+ setShowPassword: React.Dispatch<React.SetStateAction<boolean>>;
34
+ }
@@ -1,4 +1,4 @@
1
1
  import { default as React } from 'react';
2
- import { FormFieldProps } from './formField';
2
+ import { FormFieldProps } from './formField.types';
3
3
 
4
4
  export declare const PasswordInput: React.FC<FormFieldProps>;
@@ -1,25 +1,5 @@
1
- import { default as React, ChangeEvent } from 'react';
2
- import { Meta, InputValue } from '../../../validators';
3
- import { ReduxFormInput } from '../../../hooks/useReduxFormField';
1
+ import { default as React } from 'react';
2
+ import { TextInputProps } from './formField.types';
4
3
 
5
- export interface TextInputProps {
6
- meta?: Meta;
7
- max?: number;
8
- min?: number;
9
- name: string;
10
- noErrors?: boolean;
11
- value?: InputValue;
12
- disabled?: boolean;
13
- required?: boolean;
14
- placeholder?: string;
15
- isClearable?: boolean;
16
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'fullwidth';
17
- leftIcon?: React.ReactNode;
18
- rightIcon?: React.ReactNode;
19
- isValid?: (value: InputValue) => boolean;
20
- type?: 'text' | 'number' | 'password' | 'date' | 'dateRange' | undefined;
21
- onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
22
- input?: ReduxFormInput;
23
- inputRef?: React.RefObject<HTMLInputElement>;
24
- }
25
4
  export declare const TextInput: React.FC<TextInputProps>;
5
+ export type { TextInputProps };
@@ -6,6 +6,7 @@ export declare const onChangeInput = "\n Callback que se dispara cuando cambi
6
6
  export declare const isOptionDisabled = " \n Funcion que recibe un valor de tipo SelectOption y deberia devolver un valor booleano\n Si la opci\u00F3n tiene definida un tooltipMessage se va a mostrar al hacer hover.\n \n#### Ejemplo\n ``` typescript\n const isOptionDisabled = (option: SelectOption) => option.value === 2;\n ```\n \n #### Interfaz\n ```typescript\n interface SelectOption {\n label: string;\n value: string | number;\n tooltipMessage?: string;\n [key: string]: any;\n }\n ```\n";
7
7
  export declare const selectFieldDescription = "\n## Uso del componente\n\nEl componente `SelectField` permite seleccionar una o varias opciones de una lista con soporte para b\u00FAsqueda, opciones deshabilitadas y modificadores.\n\n### Ejemplo b\u00E1sico:\n\n```tsx\n<SelectField\n name=\"productId\"\n label=\"Producto\"\n placeholder=\"Seleccionar...\"\n options={[\n { label: 'Opci\u00F3n 1', value: 1 },\n { label: 'Opci\u00F3n 2', value: 2 },\n { label: 'Opci\u00F3n 3', value: 3, tooltipMessage: 'No disponible' },\n ]}\n onChange={(event) => handleChange(event.target.name, event.target.value)}\n isSearchable\n isClearable\n/>\n```\n\n### Ejemplo con m\u00FAltiple selecci\u00F3n y loader:\n\n```tsx\n<SelectField\n name=\"productIds\"\n label=\"Productos\"\n isMultiple\n options={options}\n rightModifier={isLoading && <Spinner size=\"sm\" />}\n isOptionDisabled={(option) => option.value === 2}\n onChange={(event) => setValue(event.target.value)}\n/>\n```\n";
8
8
  export declare const formFieldExample = "\n## Uso del componente\n\nEl componente `FormField` es un input de formulario con label, mensajes de error y soporte para iconos y adornos.\n\n### Ejemplo b\u00E1sico:\n\n```tsx\n<FormField\n label=\"T\u00EDtulo\"\n name=\"textInput\"\n placeholder=\"Placeholder\"\n size=\"md\"\n type=\"text\"\n onChange={(event) => handleChange(event.target.name, event.target.value)}\n/>\n```\n\n### Ejemplo con validaci\u00F3n personalizada:\n\n```tsx\n<FormField\n label=\"Solo n\u00FAmeros\"\n name=\"numberInput\"\n type=\"number\"\n isValid={(inputValue) => _.isNumber(inputValue)}\n onChange={(event) => setValue(event.target.value)}\n/>\n```\n";
9
+ export declare const inputSx = "\n Estilos inline aplicados al `<input>`. \u00DAtil para pisar los estilos del tama\u00F1o elegido,\n por ejemplo la alineaci\u00F3n del texto.\n\n ``` typescript\n <FormField name=\"quantity\" size=\"xs\" sx={{ textAlign: 'right' }} />\n ```\n";
9
10
  export declare const isValidInput = "\n Funcion que recibe un valor de tipo inputValue y deberia devolver un valor booleano.\n \n #### Por ejemplo: (inputValue) => _.isNumber(inputValue)\n \n ``` typescript\n type inputValue = string | number; \n ```\n";
10
11
  export declare const checkboxInputGroupExample = "\n #### Ejemplo de uso\n \n ``` typescript\n <CheckboxInput\n items={[\n {\n id: '1',\n label: 'Opci\u00F3n 1'\n },\n {\n id: '2',\n label: 'Opci\u00F3n 2'\n },\n {\n disabled: true,\n id: '3',\n label: 'Opci\u00F3n 3'\n }\n ]}\n name=\"CheckboxList\"\n onChange={(event) => handleChange(event.target.name, event.target.value)}\n size=\"lg\"\n title=\"Selecciona una opci\u00F3n\"\n type=\"checkbox\"\n />\n ```\n";
11
12
  export declare const checkboxInputExample = "\n## Uso del componente\n\nEl componente `CheckboxInput` / `CheckboxInputGroup` permite mostrar uno o varios checkboxes o radios con label y soporte para Redux Form.\n\n### Ejemplo b\u00E1sico (un solo checkbox):\n\n```tsx\nconst [checked, setChecked] = React.useState(false)\n\n<CheckboxInput\n name=\"Toggle\"\n checked={checked}\n onChange={(e) => setChecked(e.target.checked)}\n label=\"Amazon\"\n title=\"Selecciona qu\u00E9 sincronizar\"\n/>\n```\n\n### Ejemplo con grupo de opciones:\n\n```tsx\n<CheckboxInputGroup\n name=\"options\"\n title=\"Selecciona opciones\"\n type=\"checkbox\"\n items={[\n { id: '1', label: 'Opci\u00F3n 1' },\n { id: '2', label: 'Opci\u00F3n 2' },\n { id: '3', label: 'Opci\u00F3n 3', disabled: true },\n ]}\n onChange={(event) => handleChange(event.target.value)}\n/>\n```\n";
@@ -125,6 +125,7 @@ declare const _default: {
125
125
  formField: {
126
126
  example: string;
127
127
  isValid: string;
128
+ sx: string;
128
129
  };
129
130
  checkboxInput: {
130
131
  example: string;