@producteca/producteca-ui-kit 0.0.13 → 1.1.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 CHANGED
@@ -14,10 +14,55 @@
14
14
 
15
15
  ## Main Scripts
16
16
 
17
- - `dev`: Bootstrap the Storybook preview with Hot Reload.
18
- - `build`: Builds the static storybook project.
19
- - `build:lib`: Builds the component library into the **dist** folder.
20
- - `lint:fix`: Applies linting based on the rules defined in **.eslintrc.js**.
21
- - `format:prettier`: Formats files using the prettier rules defined in **.prettierrc**.
22
- - `test`: Runs testing using watch mode.
23
- - `test:cov`: Runs testing displaying a coverage report.
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
+
36
+ ```bash
37
+ bun install @producteca/producteca-ui-kit
38
+
39
+ ```
40
+
41
+ 2. **Import the styles**
42
+ Add the following line to your `app/css/setup.js` file:
43
+
44
+ ```bash
45
+ import "@producteca/producteca-ui-kit/dist/style.css";
46
+
47
+ ```
48
+
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
+ ```
62
+
63
+ ### Auto Publish
64
+
65
+ - Use the following options for the branch name
66
+ ```bash
67
+ (major | minor | patch | premajor | preminor | prepatch | prerelease)/name
68
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@producteca/producteca-ui-kit",
3
- "version": "0.0.13",
3
+ "version": "1.1.0",
4
4
  "main": "./dist/producteca-ui-kit.umd.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "repository": {
@@ -19,13 +19,17 @@
19
19
  "scripts": {
20
20
  "dev": "storybook dev -p 6006",
21
21
  "build": "storybook build",
22
- "build:lib": "tsc && vite build",
22
+ "build:lib": "rm -rf dist && tsc && vite build",
23
+ "version": "git add package.json",
24
+ "postversion": "npm publish",
25
+ "deploy": "make deploy",
23
26
  "lint": "eslint --ext .js,.jsx,.ts,.tsx --fix",
24
27
  "prettier": "prettier --write \"src/**/*.{ts,tsx,js,mdx}\"",
25
28
  "test": "vitest",
26
29
  "test:cov": "vitest run --coverage",
27
30
  "prepare": "husky",
28
- "chromatic": "npx chromatic --project-token=chpt_296f9471a29e98c"
31
+ "pre-commit": "husky && husky install",
32
+ "build-storybook": "storybook build"
29
33
  },
30
34
  "files": [
31
35
  "dist"
@@ -58,30 +62,33 @@
58
62
  "@vitejs/plugin-react-refresh": "^1.3.6",
59
63
  "@vitejs/plugin-react-swc": "^3.5.0",
60
64
  "@vitest/coverage-v8": "^1.6.0",
65
+ "jsdom": "^24.1.0",
66
+ "json": "11.0.0",
67
+ "react": "^18.2.0",
68
+ "react-dom": "^18.2.0",
69
+ "react-select": "^5.8.3",
70
+ "sass": "^1.77.4",
71
+ "typescript": "^5.2.2",
72
+ "vite": "^5.2.0",
73
+ "vite-plugin-css-modules": "^0.0.1",
74
+ "vite-plugin-dts": "^3.9.1",
75
+ "vitest": "^1.6.0"
76
+ },
77
+ "devDependencies": {
61
78
  "autoprefixer": "^10.4.19",
62
79
  "chromatic": "^11.3.0",
80
+ "clsx": "^2.1.1",
63
81
  "eslint": "^8.57.0",
64
82
  "eslint-plugin-react-hooks": "^4.6.0",
65
83
  "eslint-plugin-react-refresh": "^0.4.6",
66
84
  "eslint-plugin-storybook": "^0.8.0",
67
85
  "husky": "^9.0.11",
68
86
  "i18next": "^23.11.5",
69
- "jsdom": "^24.1.0",
70
- "json": "11.0.0",
71
- "postcss-modules": "^6.0.0",
72
87
  "prettier": "3.0.1",
73
88
  "prop-types": "15.8.1",
74
- "react": "^18.2.0",
75
- "react-dom": "^18.2.0",
76
89
  "react-i18next": "^14.1.2",
77
- "sass": "^1.77.4",
78
90
  "storybook": "^8.0.9",
79
91
  "storybook-i18n": "^3.0.1",
80
- "storybook-react-i18next": "^3.1.1",
81
- "typescript": "^5.2.2",
82
- "vite": "^5.2.0",
83
- "vite-plugin-css-modules": "^0.0.1",
84
- "vite-plugin-dts": "^3.9.1",
85
- "vitest": "^1.6.0"
92
+ "storybook-react-i18next": "^3.1.1"
86
93
  }
87
94
  }
@@ -1,11 +0,0 @@
1
- interface ButtonProps {
2
- label: string;
3
- variant?: 'primary' | 'secondary' | 'success' | 'error';
4
- outline?: boolean;
5
- size?: 'sm' | 'lg';
6
- type?: 'submit' | 'button' | 'reset';
7
- onClick?: () => void;
8
- }
9
- export declare const Button: ({ type, variant, size, label, outline, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
10
- export type { ButtonProps };
11
- export default Button;
@@ -1,11 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- interface EmptyStateProps {
4
- onActionClick?: () => void;
5
- actionTex?: string;
6
- text?: string;
7
- icon?: React.ReactNode;
8
- }
9
- export declare const EmptyState: ({ onActionClick, icon, actionTex, text, }: EmptyStateProps) => import("react/jsx-runtime").JSX.Element;
10
- export type { EmptyStateProps };
11
- export default EmptyState;
@@ -1 +0,0 @@
1
- export { SearchPublication } from './searchPublication/searchPublication';
@@ -1,8 +0,0 @@
1
-
2
- interface SearchPublicationProps {
3
- size?: number;
4
- color?: string | undefined;
5
- }
6
- export declare const SearchPublication: ({ size, color }: SearchPublicationProps) => import("react/jsx-runtime").JSX.Element;
7
- export type { SearchPublicationProps };
8
- export default SearchPublication;
@@ -1,4 +0,0 @@
1
- export * from './button/button';
2
- export * from './emptyState/emptyState';
3
- export * from './icons';
4
- export * from './spinner/spinner';
@@ -1,6 +0,0 @@
1
- interface SpinnerProps {
2
- size?: number;
3
- }
4
- export declare const Spinner: ({ size }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
5
- export type { SpinnerProps };
6
- export default Spinner;
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
-
2
- export * from './components';
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- noResultsFound: string;
3
- reloadPage: string;
4
- };
5
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import('i18next').TFunction<["translation", ...string[]], undefined>;
2
- export default _default;
@@ -1,3 +0,0 @@
1
- import { default as i18next } from 'i18next';
2
-
3
- export default i18next;