elseware-ui 2.35.0 → 2.36.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 elseware Technology
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2026 elseware Technology
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,53 +1,91 @@
1
1
  # elseware-ui
2
2
 
3
- A modern React component library for building web and desktop user interfaces.
3
+ A modern, customizable React component library for building web and desktop user interfaces.
4
4
 
5
- `elseware-ui` provides a collection of reusable, customizable, and production-ready UI components designed to accelerate application development while maintaining consistency, accessibility, and scalability.
5
+ `elseware-ui` provides reusable, production-ready UI components designed to speed up application development while maintaining consistency, accessibility, scalability, and a clean developer experience.
6
6
 
7
7
  ## Features
8
8
 
9
- - TypeScript-first development
9
+ - TypeScript-first component development
10
10
  - React-based component architecture
11
11
  - Tailwind CSS integration
12
- - Customizable themes and styling
13
- - Consistent design system
12
+ - Customizable themes, variants, shapes, and styles
13
+ - Shared design tokens, enums, animations, and SVG utilities
14
+ - Modular barrel exports
15
+ - Tree-shakable ESM build
16
+ - Storybook-powered component development
17
+ - Linting, formatting, type checking, and build validation
14
18
  - Web and desktop application support
15
- - Storybook-powered component documentation
16
- - Modular and tree-shakable components
17
19
  - Developer-friendly APIs
18
20
 
21
+ ## Installation
22
+
23
+ Install the package:
24
+
25
+ ```bash
26
+ npm install elseware-ui
27
+ ```
28
+
29
+ Install required peer dependencies if they are not already installed:
30
+
31
+ ```bash
32
+ npm install react react-dom tailwindcss
33
+ ```
34
+
35
+ ## Package Exports
36
+
37
+ The package exposes the main component API and compiled styles:
38
+
39
+ ```json
40
+ {
41
+ ".": {
42
+ "types": "./dist/index.d.ts",
43
+ "import": "./dist/index.js",
44
+ "require": "./dist/index.cjs"
45
+ },
46
+ "./styles.css": "./dist/index.css"
47
+ }
48
+ ```
49
+
50
+ Recommended usage:
51
+
52
+ ```tsx
53
+ import { Button } from "elseware-ui";
54
+ import "elseware-ui/styles.css";
55
+ ```
56
+
19
57
  ## Component Import Structure
20
58
 
21
- Use the following import ordering convention when creating components:
59
+ Use the following import ordering convention when creating or updating components:
22
60
 
23
61
  ```ts
24
62
  // External
25
63
 
26
64
  // Internal
27
65
 
28
- // Types
29
-
30
66
  // Data
67
+
68
+ // Types
31
69
  ```
32
70
 
33
71
  Example:
34
72
 
35
73
  ```ts
36
74
  // External
37
- import { ReactNode } from "react";
75
+ import React from "react";
38
76
 
39
77
  // Internal
40
- import { cn } from "@/utils";
41
-
42
- // Types
43
- import { BaseComponentProps } from "@/interfaces";
44
- import { Variant, Shape, Size } from "@/types";
78
+ import { cn } from "../../../utils";
45
79
 
46
80
  // Data
47
- import { shapes, variants, borderVariants, avatarSizes } from "@/data/styles";
81
+ import { Shape, Variant } from "../../../data/enums";
82
+ import { shapes, variants } from "../../../data/styles";
83
+
84
+ // Types
85
+ import type { BaseComponentProps } from "../../../interfaces";
48
86
  ```
49
87
 
50
- ## Installation
88
+ ## Development
51
89
 
52
90
  Install dependencies:
53
91
 
@@ -55,34 +93,181 @@ Install dependencies:
55
93
  npm install
56
94
  ```
57
95
 
58
- ## Development
59
-
60
- Start Storybook for component development and testing:
96
+ Start Storybook:
61
97
 
62
98
  ```bash
63
99
  npm run dev
64
100
  ```
65
101
 
66
- ## Build
67
-
68
102
  Build the component library:
69
103
 
70
104
  ```bash
71
105
  npm run build
72
106
  ```
73
107
 
108
+ Build Storybook:
109
+
110
+ ```bash
111
+ npm run build:storybook
112
+ ```
113
+
114
+ ## Code Quality
115
+
116
+ Run TypeScript checks:
117
+
118
+ ```bash
119
+ npm run typecheck
120
+ ```
121
+
122
+ Run ESLint:
123
+
124
+ ```bash
125
+ npm run lint
126
+ ```
127
+
128
+ Fix lint issues:
129
+
130
+ ```bash
131
+ npm run lint:fix
132
+ ```
133
+
134
+ Format files with Prettier:
135
+
136
+ ```bash
137
+ npm run format
138
+ ```
139
+
140
+ Check formatting:
141
+
142
+ ```bash
143
+ npm run format:check
144
+ ```
145
+
146
+ Check unused files, exports, and dependencies:
147
+
148
+ ```bash
149
+ npm run deadcode
150
+ ```
151
+
152
+ Run the full validation pipeline:
153
+
154
+ ```bash
155
+ npm run validate
156
+ ```
157
+
158
+ Run automatic lint fixes, formatting, and validation:
159
+
160
+ ```bash
161
+ npm run full
162
+ ```
163
+
164
+ ## Git Hooks
165
+
166
+ Initialize Husky:
167
+
168
+ ```bash
169
+ npm run prepare:husky
170
+ ```
171
+
172
+ Recommended pre-commit hook:
173
+
174
+ ```bash
175
+ npx lint-staged
176
+ ```
177
+
74
178
  ## Publishing
75
179
 
76
- Publish a new package version to npm:
180
+ Before publishing, update the package version:
181
+
182
+ ```bash
183
+ npm version patch
184
+ ```
185
+
186
+ or:
187
+
188
+ ```bash
189
+ npm version minor
190
+ ```
191
+
192
+ or:
193
+
194
+ ```bash
195
+ npm version major
196
+ ```
197
+
198
+ Then publish:
77
199
 
78
200
  ```bash
79
201
  npm run release
80
202
  ```
81
203
 
204
+ The `release` script validates the package before publishing.
205
+
206
+ ## Component Guidelines
207
+
208
+ When building components:
209
+
210
+ - Keep components modular and focused
211
+ - Move reusable enums to `src/data/enums.ts`
212
+ - Move reusable style maps to `src/data/styles.tsx`
213
+ - Move reusable animation class maps to `src/data/animations.tsx`
214
+ - Move generic SVG icons to `src/data/svgs.tsx`
215
+ - Keep component-specific state logic in hooks when possible
216
+ - Keep public types in each component's `types.ts`
217
+ - Export each component through its local `index.ts`
218
+ - Avoid unnecessary dependencies between unrelated component groups
219
+
220
+ ## Barrel Export Pattern
221
+
222
+ Each component should expose a local barrel file:
223
+
224
+ ```ts
225
+ export * from "./Button";
226
+ export * from "./types";
227
+ ```
228
+
229
+ Component groups should also expose barrel exports:
230
+
231
+ ```ts
232
+ export * from "./avatar";
233
+ export * from "./badge";
234
+ export * from "./toast";
235
+ ```
236
+
237
+ The root entry point should expose the public package API:
238
+
239
+ ```ts
240
+ export * from "./components";
241
+ export * from "./compositions";
242
+ export * from "./hooks";
243
+ export * from "./layouts";
244
+ export * from "./providers";
245
+ export * from "./routing";
246
+ export * from "./utils";
247
+ export * from "./interfaces";
248
+ export * from "./types";
249
+ ```
250
+
251
+ ## Styling
252
+
253
+ `elseware-ui` uses Tailwind CSS and shared design tokens.
254
+
255
+ Consumers should import the compiled stylesheet once in their application entry:
256
+
257
+ ```tsx
258
+ import "elseware-ui/styles.css";
259
+ ```
260
+
82
261
  ## Documentation
83
262
 
84
263
  Interactive component documentation and examples are available through Storybook.
85
264
 
265
+ Start Storybook locally:
266
+
267
+ ```bash
268
+ npm run dev
269
+ ```
270
+
86
271
  ## About elseware Technology
87
272
 
88
273
  elseware Technology builds tools, frameworks, and solutions for software engineering, cloud computing, game development, and developer productivity.
@@ -91,6 +276,12 @@ elseware Technology builds tools, frameworks, and solutions for software enginee
91
276
 
92
277
  Contributions, issues, and feature requests are welcome.
93
278
 
279
+ Before opening a pull request, run:
280
+
281
+ ```bash
282
+ npm run validate
283
+ ```
284
+
94
285
  ## License
95
286
 
96
287
  This project is licensed under the MIT License.