@producteca/producteca-ui-kit 0.0.13 → 1.0.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 +39 -7
- package/dist/components/emptyState/emptyState.d.ts +2 -2
- package/dist/components/icons/closeIcon/closeIcon.d.ts +5 -0
- package/dist/components/icons/index.d.ts +2 -0
- package/dist/components/icons/parameters.d.ts +35 -0
- package/dist/components/icons/searchIcon/searchIcon.d.ts +5 -0
- package/dist/components/icons/searchPublication/searchPublication.d.ts +3 -6
- package/dist/components/index.d.ts +1 -0
- package/dist/components/selectField/selectField.d.ts +28 -0
- package/dist/index.d.ts +0 -1
- package/dist/locales/es.d.ts +7 -0
- package/dist/producteca-ui-kit.es.js +9087 -1102
- package/dist/producteca-ui-kit.umd.js +46 -1
- package/dist/style.css +1 -1
- package/dist/styles/colors.d.ts +26 -0
- package/package.json +20 -15
package/README.md
CHANGED
|
@@ -14,10 +14,42 @@
|
|
|
14
14
|
|
|
15
15
|
## Main Scripts
|
|
16
16
|
|
|
17
|
-
- `dev`:
|
|
18
|
-
- `build`: Builds the static
|
|
19
|
-
- `build:lib`:
|
|
20
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
23
|
-
- `test
|
|
17
|
+
- `dev`: Starts Storybook in development mode on port 6006.
|
|
18
|
+
- `build`: Builds the static Storybook project.
|
|
19
|
+
- `build:lib`: Removes the `dist` folder, compiles TypeScript, and builds the library using Vite.
|
|
20
|
+
- `deploy`: Deploys the project using the specified Makefile configuration.
|
|
21
|
+
- `lint`: Runs ESLint to lint and fix issues in files with `.js`, `.jsx`, `.ts`, and `.tsx` extensions.
|
|
22
|
+
- `prettier`: Formats files in the `src` folder with extensions `.ts`, `.tsx`, `.js`, and `.mdx` using Prettier.
|
|
23
|
+
- `test`: Runs tests using Vitest.
|
|
24
|
+
- `test:cov`: Executes tests and generates a coverage report using Vitest.
|
|
25
|
+
- `prepare`: Prepares the repository by installing Husky for Git hooks.
|
|
26
|
+
- `pre-commit`: Installs Husky and sets up Git hooks for pre-commit validation.
|
|
27
|
+
- `build-storybook`: Builds the static Storybook project.
|
|
28
|
+
|
|
29
|
+
### Setting up `@producteca/producteca-ui-kit`
|
|
30
|
+
|
|
31
|
+
Follow these steps to integrate and configure the `@producteca/producteca-ui-kit` package in your project:
|
|
32
|
+
|
|
33
|
+
1. **Install the package**
|
|
34
|
+
Make sure to install the latest version of the package:
|
|
35
|
+
```bash
|
|
36
|
+
bun install @producteca/producteca-ui-kit
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
2. **Import the styles**
|
|
40
|
+
Add the following line to your `app/css/setup.js` file:
|
|
41
|
+
```bash
|
|
42
|
+
import "@producteca/producteca-ui-kit/dist/style.css";
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
3. **Remove old SelectField instances**
|
|
46
|
+
|
|
47
|
+
- Check for any existing version of `selectField`. If found, delete the file:
|
|
48
|
+
```bash
|
|
49
|
+
app/components/form/selectField
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
- Update any old imports to:
|
|
53
|
+
```bash
|
|
54
|
+
import { SelectField } from "@producteca/producteca-ui-kit";
|
|
55
|
+
```
|
|
@@ -2,10 +2,10 @@ import { default as React } from 'react';
|
|
|
2
2
|
|
|
3
3
|
interface EmptyStateProps {
|
|
4
4
|
onActionClick?: () => void;
|
|
5
|
-
|
|
5
|
+
actionText?: string;
|
|
6
6
|
text?: string;
|
|
7
7
|
icon?: React.ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export declare const EmptyState: ({ onActionClick, icon,
|
|
9
|
+
export declare const EmptyState: ({ onActionClick, icon, actionText, text, }: EmptyStateProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export type { EmptyStateProps };
|
|
11
11
|
export default EmptyState;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface IconInterface {
|
|
2
|
+
size?: number;
|
|
3
|
+
color?: string;
|
|
4
|
+
}
|
|
5
|
+
interface ArgTypes {
|
|
6
|
+
[key: string]: {
|
|
7
|
+
control: {
|
|
8
|
+
type: string;
|
|
9
|
+
presetColors?: {
|
|
10
|
+
title: string;
|
|
11
|
+
color: string;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare const argTypes: ArgTypes;
|
|
18
|
+
export declare const parameters: {
|
|
19
|
+
layout: string;
|
|
20
|
+
design: {
|
|
21
|
+
type: string;
|
|
22
|
+
url: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const defaultParameters: {
|
|
26
|
+
parameters: {
|
|
27
|
+
layout: string;
|
|
28
|
+
design: {
|
|
29
|
+
type: string;
|
|
30
|
+
url: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
argTypes: ArgTypes;
|
|
34
|
+
};
|
|
35
|
+
export default defaultParameters;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
+
import { IconInterface } from '../parameters';
|
|
1
2
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
color?: string | undefined;
|
|
5
|
-
}
|
|
6
|
-
export declare const SearchPublication: ({ size, color }: SearchPublicationProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export type { SearchPublicationProps };
|
|
3
|
+
export declare const SearchPublication: ({ size, color }: IconInterface) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export type { IconInterface };
|
|
8
5
|
export default SearchPublication;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface SelectOption {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string | number;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}
|
|
8
|
+
export interface SelectFieldProps {
|
|
9
|
+
name: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
onBlur?: () => void;
|
|
14
|
+
noOptionsMessage?: string;
|
|
15
|
+
options: SelectOption[];
|
|
16
|
+
hideSelectedOptions?: boolean;
|
|
17
|
+
defaultValue?: SelectOption[] | SelectOption | null | undefined;
|
|
18
|
+
currentValue?: (string | number)[];
|
|
19
|
+
isMultiple?: boolean;
|
|
20
|
+
isSearchable?: boolean;
|
|
21
|
+
isClearable?: boolean;
|
|
22
|
+
isRequired?: boolean;
|
|
23
|
+
isOptionDisabled?: (option: SelectOption) => boolean;
|
|
24
|
+
rightModifier?: React.ReactNode;
|
|
25
|
+
setValue: (name: string, value: SelectOption | SelectOption[] | null) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const SelectField: React.FC<SelectFieldProps>;
|
|
28
|
+
export default SelectField;
|
package/dist/index.d.ts
CHANGED
package/dist/locales/es.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
noResultsFound: string;
|
|
3
3
|
reloadPage: string;
|
|
4
|
+
selectPlaceholder: string;
|
|
5
|
+
noOptionsMessage: string;
|
|
6
|
+
noFoundOptions: string;
|
|
7
|
+
selectedPlural: string;
|
|
8
|
+
selected: string;
|
|
9
|
+
selectRequiredText: string;
|
|
10
|
+
hideSelectedOptionsExplainText: string;
|
|
4
11
|
};
|
|
5
12
|
export default _default;
|