@tealca/core-components 1.0.8 → 1.0.9

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,4 +1,4 @@
1
- # tealca-core-components
1
+ # Tealca Core Components
2
2
 
3
3
  > A set of reusable and accessible React components, built with TypeScript. This library centralizes all of Tealca's UI components, ensuring a consistent user experience and a unified brand identity across all our web applications.
4
4
 
@@ -40,15 +40,68 @@ function App() {
40
40
  ## Project Structure
41
41
 
42
42
  ```
43
- ├── src/ # Main components
44
- ├── public/ # Public assets
45
- ├── index.html # Main entry point
46
- ├── package.json # Dependencies and scripts
47
- ├── tsconfig.json # TypeScript configuration
48
- ├── vite.config.ts # Vite configuration
43
+ .
49
44
  ├── .storybook/ # Storybook configuration
45
+ ├── src/
46
+ │ ├── assets/
47
+ │ ├── components/
48
+ │ ├── contexts/
49
+ │ ├── objects/
50
+ │ ├── providers/
51
+ │ ├── services/
52
+ │ └── utils/
53
+ ├── .gitignore
54
+ ├── package.json
55
+ ├── tsconfig.json
56
+ └── vite.config.ts
50
57
  ```
51
58
 
59
+ ## How to create a component
60
+
61
+ To create a new component, follow these steps:
62
+
63
+ 1. **Create a directory for the component**: Inside `src/components/{category}` create a new directory with the name of the component in PascalCase. For example, if you are creating a new component called `MyComponent` in the `base` category, you should create the directory `src/components/base/MyComponent`.
64
+
65
+ 2. **Create the component file**: Inside the directory you just created, create a new file called `MyComponent.tsx`. This file will contain the logic and structure of the component.
66
+
67
+ 3. **Create the story file**: Inside the same directory, create a new file called `MyComponent.stories.tsx`. This file will contain the Storybook stories for the component, which will allow you to visualize and test the component in isolation.
68
+
69
+ 4. **Export the component**: You must export the component in the `index.ts` file of the corresponding category. For example, in `src/components/base/index.ts`. Then, you must also export it in the main `index.ts` of the components, `src/components/index.ts`.
70
+
71
+ ## Publishing to NPM
72
+
73
+ To publish a new version of the package to NPM, follow these steps:
74
+
75
+ 1. **Build the project:** This command compiles the code and prepares it for distribution.
76
+
77
+ ```bash
78
+ npm run build
79
+ ```
80
+
81
+ 2. **Update the version:** Before publishing, you must update the package version in `package.json`. You can do this manually or by using the `npm version` command, which also creates a commit and a git tag.
82
+ ```bash
83
+ # Example for a patch update (e.g., 1.0.0 -> 1.0.1)
84
+ npm version patch
85
+
86
+ # Example for a minor update (e.g., 1.0.0 -> 1.1.0)
87
+ npm version minor
88
+
89
+ # Example for a major update (e.g., 1.0.0 -> 2.0.0)
90
+ npm version major
91
+ ```
92
+ > **Note:** The `npm version` command requires a clean working directory (no uncommitted changes). Make sure to commit your changes before running it.
93
+
94
+ 3. **Login to NPM:** You need to be authenticated with your NPM account.
95
+
96
+ ```bash
97
+ npm login
98
+ ```
99
+
100
+ 4. **Publish the package:** This command uploads the package to the NPM registry.
101
+ ```bash
102
+ npm publish
103
+ ```
104
+
52
105
  ## Contributing
53
106
 
54
107
  Contributions are welcome! Please follow best development practices and ensure consistency with existing components.