@producteca/producteca-ui-kit 1.3.15 → 1.4.1-test.1

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 CHANGED
@@ -1,6 +1,4 @@
1
- # Producteca UI Kit ⚛️⚡
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 component instances**
52
- For any component that has been moved to the UI kit (like SelectField, CheckboxInput, etc.), you need to:
53
-
54
- - Remove the old component files from your project. For example:
55
-
56
- ```bash
57
- app/components/form/selectField
58
- app/components/form/checkboxInput
59
- # or any other component that has been moved to the UI kit
60
- ```
61
-
62
- - Update your imports to use the components from the UI kit:
63
- ```typescript
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
 
@@ -7,7 +7,6 @@ interface CustomIconProps {
7
7
  size?: iconSize;
8
8
  sx?: SxProps<Theme>;
9
9
  children: ReactElement;
10
- disabled?: boolean;
11
10
  }
12
11
  export declare const CustomIcon: React.FC<CustomIconProps>;
13
12
  export default CustomIcon;
@@ -1,5 +1,5 @@
1
1
  import { default as React, ChangeEvent } from 'react';
2
- import { Meta, InputValue } from '../../../validators';
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?: InputValue;
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: InputValue) => boolean;
18
+ isValid?: (value: inputValue) => boolean;
19
19
  type?: 'text' | 'number' | 'password' | undefined;
20
20
  onChange: (event: ChangeEvent<HTMLInputElement>) => void;
21
21
  }
@@ -3,7 +3,6 @@ import { default as React } from 'react';
3
3
  export interface SelectOption {
4
4
  label: string;
5
5
  value: string | number;
6
- tooltipMessage?: string;
7
6
  [key: string]: any;
8
7
  }
9
8
  export type SelectOptionType = SelectOption[] | SelectOption | null;
@@ -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 Si la opci\u00F3n tiene definida un tooltipMessage se va a mostrar al hacer hover.\n \n ```typescript\n interface SelectOption {\n label: string;\n value: string | number;\n tooltipMessage?: string;\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, tooltipMessage: \"Este valor no es representativo\" }]}\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 ";
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 ";