@producteca/producteca-ui-kit 1.3.7 → 1.3.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.
@@ -1,12 +1,12 @@
1
- import { default as React } from 'react';
2
- import { SvgIconProps } from '@mui/material';
3
- import { ColorCategory, ColorShade } from '../../../styles/colors';
1
+ import { default as React, ReactElement } from 'react';
2
+ import { SxProps, Theme } from '@mui/material';
4
3
 
5
4
  export type iconSize = '24' | '20' | '16' | '12' | '8';
6
- interface CustomIconProps extends SvgIconProps {
7
- category?: ColorCategory;
8
- shade?: ColorShade;
5
+ interface CustomIconProps {
6
+ color?: string;
9
7
  size?: iconSize;
8
+ sx?: SxProps<Theme>;
9
+ children: ReactElement;
10
10
  }
11
11
  export declare const CustomIcon: React.FC<CustomIconProps>;
12
12
  export default CustomIcon;
@@ -3,16 +3,16 @@ import { default as React } from 'react';
3
3
  export interface ToggleItem {
4
4
  id: string;
5
5
  label: string;
6
- isChecked?: boolean;
7
- isDisabled?: boolean;
6
+ checked?: boolean;
7
+ disabled?: boolean;
8
8
  }
9
9
  export interface ToggleInputProps {
10
10
  name: string;
11
11
  items: ToggleItem[];
12
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
12
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
13
13
  title?: string;
14
14
  type?: 'checkbox' | 'radio';
15
15
  size?: 'sm' | 'md' | 'lg';
16
16
  }
17
- export declare const ToggleInput: React.FC<ToggleInputProps>;
18
- export default ToggleInput;
17
+ export declare const CheckboxInput: React.FC<ToggleInputProps>;
18
+ export default CheckboxInput;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+
3
+ interface SingleToggleOptionProps {
4
+ name: string;
5
+ checked: boolean;
6
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
7
+ label: string;
8
+ title?: string;
9
+ disabled?: boolean;
10
+ size?: 'sm' | 'md' | 'lg';
11
+ }
12
+ declare const SingleCheckboxInput: React.FC<SingleToggleOptionProps>;
13
+ export default SingleCheckboxInput;
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import { default as React, ChangeEvent } from 'react';
2
2
  import { Meta, inputValue } from '../../../validators';
3
3
 
4
4
  export interface TextInputProps {
@@ -8,8 +8,8 @@ export interface TextInputProps {
8
8
  name: string;
9
9
  noErrors?: boolean;
10
10
  value?: inputValue;
11
- isDisabled?: boolean;
12
- isRequired?: boolean;
11
+ disabled?: boolean;
12
+ required?: boolean;
13
13
  placeholder?: string;
14
14
  isClearable?: boolean;
15
15
  size?: 'sm' | 'md' | 'lg';
@@ -17,9 +17,6 @@ export interface TextInputProps {
17
17
  rightIcon?: React.ReactNode;
18
18
  isValid?: (value: inputValue) => boolean;
19
19
  type?: 'text' | 'number' | 'password' | undefined;
20
- onChange: ({ name, value }: {
21
- name: string;
22
- value: inputValue;
23
- }) => void;
20
+ onChange: (event: ChangeEvent<HTMLInputElement>) => void;
24
21
  }
25
22
  export declare const TextInput: React.FC<TextInputProps>;
@@ -1,3 +1,5 @@
1
1
  export * from './selectField/selectField';
2
- export * from './textInput/formField';
3
- export * from './toggleInput/toggleInput';
2
+ export * from './formField/formField';
3
+ export * from './checkboxInput/checkboxInput';
4
+ export * from './formField/textInput';
5
+ export * from './checkboxInput/singleCheckboxInput';
@@ -12,9 +12,9 @@ export interface SelectFieldProps {
12
12
  size?: 'md' | 'lg';
13
13
  onBlur?: () => void;
14
14
  placeholder?: string;
15
- isDisabled?: boolean;
15
+ disabled?: boolean;
16
16
  isMultiple?: boolean;
17
- isRequired?: boolean;
17
+ required?: boolean;
18
18
  isClearable?: boolean;
19
19
  isSearchable?: boolean;
20
20
  options: SelectOption[];
@@ -22,8 +22,9 @@ export interface SelectFieldProps {
22
22
  hideSelectedOptions?: boolean;
23
23
  rightModifier?: React.ReactNode;
24
24
  isOptionDisabled?: (option: SelectOption) => boolean;
25
- defaultValue?: (string | number)[] | null | undefined;
26
- onChange: (name: string, value: SelectOptionType) => void;
25
+ value?: (string | number)[] | null | undefined;
26
+ defaultValue?: (string | number) | (string | number)[] | null | undefined;
27
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
27
28
  }
28
29
  export declare const SelectField: React.FC<SelectFieldProps>;
29
30
  export default SelectField;
@@ -1,3 +1,9 @@
1
1
  export declare const onChangeSelectField = "\n Callback que se dispara cuando cambia el valor del input.\n \n #### Par\u00E1metros\n event: `React.ChangeEvent<HTMLInputElement>`\n - `event.target.name`: El nombre del input.\n - `event.target.value`: El valor actual del input, que debe cumplir con la siguiente interfaz:\n \n ```typescript\n interface SelectOption {\n label: string;\n value: string | number;\n [key: string]: any;\n }\n ```\n ";
2
- export declare const onChangeToggleInput = "\n Callback que se dispara cuando cambia el valor del input.\n \n #### Par\u00E1metros\n event: `React.ChangeEvent<HTMLInputElement>`\n - `event.target.name`: El nombre del input.\n - `event.target.value`: Siempre es \"on\"\n ";
2
+ export declare const onChangeCheckboxInput = "\n Callback que se dispara cuando cambia el valor del input.\n \n #### Par\u00E1metros\n event: `React.ChangeEvent<HTMLInputElement>`\n - `event.target.name`: El nombre del input.\n - `event.target.value`: Siempre es \"on\"\n ";
3
3
  export declare const onChangeInput = "\n Callback que se dispara cuando cambia el valor del input.\n \n #### Par\u00E1metros\n event: `React.ChangeEvent<HTMLInputElement>`\n - `event.target.name`: El nombre del input.\n - `event.target.value`: El valor actual del input, que debe cumplir con la siguiente interfaz:\n \n ```typescript\n value: string | number; \n ```\n ";
4
+ export declare const isOptionDisabled = " \n Funcion que recibe un valor de tipo SelectOption y deberia devolver un valor booleano\n Por ejemplo: (SelectOption) => SelectOption.value == 2\n \n ```typescript\n interface SelectOption {\n label: string;\n value: string | number;\n [key: string]: any;\n }\n ```\n ";
5
+ export declare const selectFieldDescription = " \n Ejemplo de uso:\n \n ```typescript\n <SelectField\n name=\"productId\"\n options={[{ label: \"1\", value: 1 }, { label: \"2\", value: 2 }]}\n onChange={(event) => handleChange(event.target.name, event.target.value)}\n isMultiple\n isClearable={false}\n label={localize('product')}\n isOptionDisabled={(option) => option.value == 2}\n rightModifier={shouldShowLoader && <Spinner />}\n />\n ```\n ";
6
+ export declare const formFieldExample = " \n Ejemplo de uso:\n \n ```typescript\n <FormField\n label=\"T\u00EDtulo\"\n name=\"textInput\"\n onChange={(event) => handleChange(event.target.name, event.target.value)}\n placeholder=\"Placeholder\"\n size=\"md\"\n type=\"text\"\n isValid={(inputValue) => _.isNumber(inputValue)}\n />\n ```\n ";
7
+ 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 ";
8
+ export declare const checkboxInputExample = " \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 ";
9
+ export declare const singleCheckboxInputExample = " \n Versi\u00F3n con una sola opci\u00F3n tipo checkbox y un label personalizado:\n \n ```typescript\n const [checked, setChecked] = React.useState(false)\n <SingleCheckboxInput\n name=\"SingleToggle\"\n checked={checked}\n onChange={setChecked}\n label={\"Amazon\"}\n title={locale('syncStockFromChannel')}\n />\n ```\n ";
@@ -11,14 +11,25 @@ declare const _default: {
11
11
  password: string;
12
12
  selectRequiredText: string;
13
13
  exportedIcon: string;
14
+ syncStockFromChannel: string;
14
15
  hideSelectedOptionsExplainText: string;
15
16
  description: {
16
17
  onChangeSelectField: string;
17
- onChangeToggleInput: string;
18
+ onChangeCheckboxInput: string;
18
19
  onChangeInput: string;
20
+ isOptionDisabled: string;
19
21
  selectField: {
22
+ example: string;
20
23
  defaultValue: string;
21
24
  };
25
+ formField: {
26
+ example: string;
27
+ isValid: string;
28
+ };
29
+ checkboxInput: {
30
+ example: string;
31
+ singleCheckboxInputExample: string;
32
+ };
22
33
  icons: {
23
34
  size: string;
24
35
  };