@producteca/producteca-ui-kit 1.3.15 → 1.4.1-test.10
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 +14 -34
- package/dist/components/icons/customIcon/customIcon.d.ts +0 -1
- package/dist/components/inputs/formField/textInput.d.ts +3 -3
- package/dist/components/inputs/selectField/selectField.d.ts +0 -1
- package/dist/locales/description.d.ts +2 -2
- package/dist/producteca-ui-kit.es.js +917 -947
- package/dist/producteca-ui-kit.umd.js +16 -18
- package/dist/style.css +1 -1
- package/dist/validators/validation.d.ts +3 -3
- package/package.json +12 -7
package/README.md
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
> 📚 Documentation: [apps.producteca.com/producteca-ui-kit](https://apps.producteca.com/producteca-ui-kit)
|
|
1
|
+
# ⚛️⚡ Node + Vite + React + Typescript
|
|
4
2
|
|
|
5
3
|
## Features
|
|
6
4
|
|
|
@@ -48,37 +46,19 @@ Follow these steps to integrate and configure the `@producteca/producteca-ui-kit
|
|
|
48
46
|
|
|
49
47
|
```
|
|
50
48
|
|
|
51
|
-
3. **Remove old
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
import { SelectField, CheckboxInput /* other components */ } from '@producteca/producteca-ui-kit'
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
4. **Node 12 Compatibility**
|
|
68
|
-
If you're using Node 12 in your project, you'll need to update your Babel configuration to ensure compatibility. Follow these steps:
|
|
69
|
-
|
|
70
|
-
- Update your Babel dependencies to the following versions:
|
|
71
|
-
```json
|
|
72
|
-
{
|
|
73
|
-
"devDependencies": {
|
|
74
|
-
"@babel/core": "^7.23.9",
|
|
75
|
-
"@babel/preset-env": "^7.23.9",
|
|
76
|
-
"@babel/preset-react": "^7.23.3",
|
|
77
|
-
"@babel/preset-typescript": "^7.23.3"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
```
|
|
81
|
-
- For a complete example of how to implement these changes, refer to this pull request: [Shopify Babel Update Example](https://github.com/Parsimotion/shopify/pull/279)
|
|
49
|
+
3. **Remove old SelectField instances**
|
|
50
|
+
|
|
51
|
+
- Check for any existing version of `selectField`. If found, delete the file:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
app/components/form/selectField
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- Update any old imports to:
|
|
59
|
+
```bash
|
|
60
|
+
import { SelectField } from "@producteca/producteca-ui-kit";
|
|
61
|
+
```
|
|
82
62
|
|
|
83
63
|
### Auto Publish
|
|
84
64
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React, ChangeEvent } from 'react';
|
|
2
|
-
import { Meta,
|
|
2
|
+
import { Meta, inputValue } from '../../../validators';
|
|
3
3
|
|
|
4
4
|
export interface TextInputProps {
|
|
5
5
|
meta?: Meta;
|
|
@@ -7,7 +7,7 @@ export interface TextInputProps {
|
|
|
7
7
|
min?: number;
|
|
8
8
|
name: string;
|
|
9
9
|
noErrors?: boolean;
|
|
10
|
-
value?:
|
|
10
|
+
value?: inputValue;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
required?: boolean;
|
|
13
13
|
placeholder?: string;
|
|
@@ -15,7 +15,7 @@ export interface TextInputProps {
|
|
|
15
15
|
size?: 'sm' | 'md' | 'lg';
|
|
16
16
|
leftIcon?: React.ReactNode;
|
|
17
17
|
rightIcon?: React.ReactNode;
|
|
18
|
-
isValid?: (value:
|
|
18
|
+
isValid?: (value: inputValue) => boolean;
|
|
19
19
|
type?: 'text' | 'number' | 'password' | undefined;
|
|
20
20
|
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
21
21
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
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
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
|
|
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
|
|
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
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
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
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 ";
|