@producteca/producteca-ui-kit 1.7.0-test.1 → 1.7.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.
- package/README.md +5 -2
- package/dist/components/index.d.ts +1 -1
- package/dist/components/inputs/checkboxInput/checkboxInput.d.ts +10 -2
- package/dist/components/inputs/checkboxInput/singleCheckboxInput.d.ts +8 -2
- package/dist/components/inputs/formField/textInput.d.ts +7 -1
- package/dist/components/inputs/searcher/searcher.d.ts +10 -4
- package/dist/components/inputs/selectField/selectField.d.ts +7 -1
- package/dist/components/loaders/index.d.ts +2 -0
- package/dist/components/loaders/progressbar/progressbar.d.ts +8 -0
- package/dist/components/{spinner → loaders/spinner}/spinner.d.ts +1 -1
- package/dist/locales/description.d.ts +1 -0
- package/dist/locales/es.d.ts +1 -0
- package/dist/producteca-ui-kit.es.js +6305 -5539
- package/dist/producteca-ui-kit.umd.js +136 -42
- package/dist/style.css +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
- 👷 [Github Actions](https://github.com/features/actions)
|
|
16
16
|
- 🚀 [Semantic Release](https://semantic-release.gitbook.io/semantic-release) para automatizar el versionado y publicación de paquetes.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
18
|
## Main Scripts
|
|
21
19
|
|
|
22
20
|
- `dev`: Starts Storybook in development mode on port 6006.
|
|
@@ -32,9 +30,11 @@
|
|
|
32
30
|
- `build-storybook`: Builds the static Storybook project.
|
|
33
31
|
|
|
34
32
|
### ✅ Commit Linting con Husky
|
|
33
|
+
|
|
35
34
|
Este proyecto utiliza commitlint junto con husky para asegurar que todos los mensajes de commit sigan el [formato convencional](https://www.conventionalcommits.org/en/v1.0.0/).
|
|
36
35
|
|
|
37
36
|
#### ¿Por qué?
|
|
37
|
+
|
|
38
38
|
El formato convencional de commits permite:
|
|
39
39
|
|
|
40
40
|
- Generar changelogs automáticamente.
|
|
@@ -42,6 +42,7 @@ El formato convencional de commits permite:
|
|
|
42
42
|
- Tener un historial de commits más claro y estructurado.
|
|
43
43
|
|
|
44
44
|
#### 🛠️ Instalación y configuración
|
|
45
|
+
|
|
45
46
|
Ya está todo configurado en el proyecto. Si estás trabajando localmente, asegurate de ejecutar lo siguiente luego de clonar e instalar dependencias:
|
|
46
47
|
|
|
47
48
|
```bash
|
|
@@ -52,11 +53,13 @@ npx husky install
|
|
|
52
53
|
Esto se asegura de que los hooks de Git estén correctamente instalados.
|
|
53
54
|
|
|
54
55
|
#### ⚙️ Archivos relevantes
|
|
56
|
+
|
|
55
57
|
- `.husky/commit-msg`: hook que ejecuta commitlint antes de hacer un commit.
|
|
56
58
|
- `commitlint.config.js`: define las reglas que deben cumplir los mensajes de commit.
|
|
57
59
|
- `.husky/pre-commit`: (opcional) puede correr linters u otros chequeos automáticos.
|
|
58
60
|
|
|
59
61
|
📝 Ejemplo de mensaje de commit válido
|
|
62
|
+
|
|
60
63
|
```sh
|
|
61
64
|
feat: agrega componente de botón primario
|
|
62
65
|
fix(ci): corrige configuración de release en rama test
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface CheckboxItem {
|
|
4
|
-
id
|
|
4
|
+
id?: string;
|
|
5
|
+
name?: string;
|
|
5
6
|
label: string;
|
|
7
|
+
value?: any;
|
|
6
8
|
checked?: boolean;
|
|
7
9
|
disabled?: boolean;
|
|
8
10
|
}
|
|
9
11
|
export interface CheckboxInputProps {
|
|
10
12
|
name: string;
|
|
11
13
|
items: CheckboxItem[];
|
|
12
|
-
onChange
|
|
14
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
15
|
title?: string;
|
|
14
16
|
type?: 'checkbox' | 'radio';
|
|
15
17
|
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
input?: {
|
|
19
|
+
value: any;
|
|
20
|
+
onChange: (value: any) => void;
|
|
21
|
+
onBlur: () => void;
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
16
24
|
}
|
|
17
25
|
export declare const CheckboxInput: React.FC<CheckboxInputProps>;
|
|
18
26
|
export default CheckboxInput;
|
|
@@ -2,12 +2,18 @@ import { default as React } from 'react';
|
|
|
2
2
|
|
|
3
3
|
export interface SingleCheckboxInputOptionProps {
|
|
4
4
|
name: string;
|
|
5
|
-
checked
|
|
6
|
-
onChange
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
7
|
label: string;
|
|
8
8
|
title?: string;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
input?: {
|
|
12
|
+
value: any;
|
|
13
|
+
onChange: (value: any) => void;
|
|
14
|
+
onBlur: () => void;
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
11
17
|
}
|
|
12
18
|
export declare const SingleCheckboxInput: React.FC<SingleCheckboxInputOptionProps>;
|
|
13
19
|
export default SingleCheckboxInput;
|
|
@@ -17,6 +17,12 @@ export interface TextInputProps {
|
|
|
17
17
|
rightIcon?: React.ReactNode;
|
|
18
18
|
isValid?: (value: InputValue) => boolean;
|
|
19
19
|
type?: 'text' | 'number' | 'password' | undefined;
|
|
20
|
-
onChange
|
|
20
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
+
input?: {
|
|
22
|
+
value: any;
|
|
23
|
+
onChange: (value: any) => void;
|
|
24
|
+
onBlur: () => void;
|
|
25
|
+
name: string;
|
|
26
|
+
};
|
|
21
27
|
}
|
|
22
28
|
export declare const TextInput: React.FC<TextInputProps>;
|
|
@@ -11,11 +11,17 @@ export interface SearcherProps {
|
|
|
11
11
|
isClearable?: boolean;
|
|
12
12
|
isSearchable?: boolean;
|
|
13
13
|
options: SelectOption[];
|
|
14
|
-
noOptionsMessage?: string;
|
|
14
|
+
noOptionsMessage?: string | React.ReactNode;
|
|
15
15
|
rightModifier?: React.ReactNode;
|
|
16
16
|
isOptionDisabled?: (option: SelectOption) => boolean;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
+
onInputChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
+
isLoading?: boolean;
|
|
20
|
+
input?: {
|
|
21
|
+
value: any;
|
|
22
|
+
onChange: (value: any) => void;
|
|
23
|
+
onBlur: () => void;
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
20
26
|
}
|
|
21
27
|
export declare const Searcher: React.FC<SearcherProps>;
|
|
@@ -26,7 +26,13 @@ export interface SelectFieldProps {
|
|
|
26
26
|
isOptionDisabled?: (option: SelectOption) => boolean;
|
|
27
27
|
value?: (string | number)[] | null | undefined;
|
|
28
28
|
defaultValue?: (string | number) | (string | number)[] | null | undefined;
|
|
29
|
-
onChange
|
|
29
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
30
|
+
input?: {
|
|
31
|
+
value: any;
|
|
32
|
+
onChange: (value: any) => void;
|
|
33
|
+
onBlur: () => void;
|
|
34
|
+
name: string;
|
|
35
|
+
};
|
|
30
36
|
}
|
|
31
37
|
export declare const Option: (props: OptionProps<SelectOption>) => import("react/jsx-runtime").JSX.Element;
|
|
32
38
|
export declare const SingleValue: (props: SingleValueProps<SelectOption>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface ProgressbarProps {
|
|
2
|
+
size?: 'sm' | 'lg';
|
|
3
|
+
progress?: number;
|
|
4
|
+
variant?: 'determinate' | 'indeterminate' | 'buffer' | 'query';
|
|
5
|
+
}
|
|
6
|
+
export declare const Progressbar: ({ size, progress: initialProgress, variant, }: ProgressbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export type { ProgressbarProps };
|
|
8
|
+
export default Progressbar;
|
|
@@ -11,3 +11,4 @@ export declare const checkboxInputExample = "\n #### Ejemplo de uso\n \n ```
|
|
|
11
11
|
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";
|
|
12
12
|
export declare const searcherExample = " \n Note la diferencia entre onChange y onInputChange (oficia de onSearch):\n \n ```typescript\n <Searcher\n label=\"Search label\"\n name=\"Searcher\"\n onChange={(event) => onSelectOption(event.target.value)}\n onInputChange={(event) => handleSearch(event.target.value)}\n options={[{ label: 'text', value: 1 }]}\n />\n ```\n";
|
|
13
13
|
export declare const saveBarExample = "\n #### Uso b\u00E1sico\n ```typescript\n <SaveBar\n saveProps={{\n onSave: () => handleSave(),\n label: 'Save'\n }}\n cancelProps={{\n onCancel: () => handleCancel(),\n label: 'Cancel'\n }}\n />\n ```\n #### Con bot\u00F3n de navegaci\u00F3n\n ```typescript\n <SaveBar\n saveProps={{\n onSave: () => handleSave(),\n label: 'Save',\n variant: 'primary'\n }}\n cancelProps={{\n onCancel: () => handleCancel(),\n label: 'Cancel'\n }}\n previousProps={{\n onPrevious: () => handlePrevious(),\n label: 'Previous'\n }}\n />\n ```\n #### Ejemplo completo\n ```typescript\n <SaveBar\n saveProps={{\n onSave: () => handleSave(),\n label: 'Guardar cambios',\n variant: 'success',\n disabled: false,\n onClick: () => {},\n }}\n cancelProps={{\n onCancel: () => handleCancel(),\n label: 'Descartar',\n }}\n previousProps={{\n onPrevious: () => handlePrevious(),\n label: 'Anterior',\n variant: 'primary',\n outline: true,\n disabled: false,\n onClick: () => console.log('Previous clicked'),\n }}\n />\n ```\n";
|
|
14
|
+
export declare const singleCheckboxInputReduxFormExample = "\n #### Ejemplo de uso con Redux Form - SingleCheckboxInput\n \n ```typescript\n <Field\n name=\"salesSync\"\n component={SingleCheckboxInput}\n classComponent={'decrease-stock'}\n props={{\n name: 'cancelSales',\n value: this.salesSync().cancelSales,\n checked: this.salesSync().cancelSales,\n label: this.context.localize('settings.cancelSales')\n }}\n />\n ```\n";
|
package/dist/locales/es.d.ts
CHANGED