@bienui/core 0.1.13 โ 1.0.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 +125 -116
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,66 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# BienUI Core
|
|
2
2
|
|
|
3
|
-
A production-ready,
|
|
3
|
+
A production-ready, accessibility-first React component library built with:
|
|
4
4
|
|
|
5
|
-
- **
|
|
6
|
-
- **
|
|
7
|
-
- **
|
|
8
|
-
- **vanilla-extract** for type-safe styling
|
|
5
|
+
- **TypeScript** for type safety and excellent DX
|
|
6
|
+
- **Radix UI** primitives for robust accessibility
|
|
7
|
+
- **Comprehensive Storybook** documentation with a11y testing
|
|
9
8
|
- **Token-first theming** with light/dark modes + comfortable/compact density
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **changesets** for versioning and publishing
|
|
9
|
+
- **Modern build system** with ESM/CJS dual output
|
|
10
|
+
- **CI/CD automation** for seamless publishing
|
|
13
11
|
|
|
14
|
-
## ๐ฆ
|
|
12
|
+
## ๐ฆ Installation
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
```bash
|
|
15
|
+
npm install @bienui/core
|
|
16
|
+
# or
|
|
17
|
+
yarn add @bienui/core
|
|
18
|
+
# or
|
|
19
|
+
pnpm add @bienui/core
|
|
20
|
+
```
|
|
18
21
|
|
|
19
|
-
## ๐
|
|
22
|
+
## ๐ Development
|
|
20
23
|
|
|
21
|
-
###
|
|
24
|
+
### Quick Start
|
|
22
25
|
|
|
23
26
|
```bash
|
|
24
27
|
# Install dependencies
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
# Build all packages
|
|
28
|
-
pnpm build
|
|
28
|
+
yarn install
|
|
29
29
|
|
|
30
30
|
# Start Storybook (development)
|
|
31
|
-
|
|
31
|
+
yarn storybook
|
|
32
|
+
|
|
33
|
+
# Build library
|
|
34
|
+
yarn build:lib
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
### Build Commands
|
|
35
38
|
|
|
36
39
|
```bash
|
|
37
|
-
# Build
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
# Build and watch for changes
|
|
41
|
-
pnpm --filter @bien/tokens dev
|
|
42
|
-
pnpm --filter @bien/ui dev
|
|
40
|
+
# Build the component library
|
|
41
|
+
yarn build:lib
|
|
43
42
|
|
|
44
43
|
# Build Storybook for production
|
|
45
|
-
|
|
44
|
+
yarn build-storybook
|
|
45
|
+
|
|
46
|
+
# Preview Vite build
|
|
47
|
+
yarn preview
|
|
46
48
|
```
|
|
47
49
|
|
|
48
50
|
### Development Commands
|
|
49
51
|
|
|
50
52
|
```bash
|
|
51
53
|
# Run Storybook (development mode)
|
|
52
|
-
|
|
53
|
-
# or
|
|
54
|
-
pnpm storybook
|
|
54
|
+
yarn storybook
|
|
55
55
|
|
|
56
56
|
# Lint code
|
|
57
|
-
|
|
57
|
+
yarn lint
|
|
58
|
+
|
|
59
|
+
# Fix linting issues
|
|
60
|
+
yarn lint:fix
|
|
58
61
|
|
|
59
62
|
# Format code
|
|
60
|
-
|
|
63
|
+
yarn format
|
|
61
64
|
|
|
62
65
|
# Format check (CI)
|
|
63
|
-
|
|
66
|
+
yarn format:check
|
|
67
|
+
|
|
68
|
+
# Dry run publish
|
|
69
|
+
yarn publish:dry
|
|
64
70
|
```
|
|
65
71
|
|
|
66
72
|
### Code Formatting (Auto-setup)
|
|
@@ -69,7 +75,7 @@ pnpm format:check
|
|
|
69
75
|
|
|
70
76
|
- **On Commit**: Husky + lint-staged auto-formats staged files
|
|
71
77
|
- **On Save**: VS Code auto-formats when you save (if you have Prettier extension)
|
|
72
|
-
- **Manual**: Run `
|
|
78
|
+
- **Manual**: Run `yarn format` to format all files
|
|
73
79
|
|
|
74
80
|
**Setup for new developers:**
|
|
75
81
|
1. Install recommended VS Code extensions (prompted automatically)
|
|
@@ -85,19 +91,19 @@ pnpm format:check
|
|
|
85
91
|
### Versioning & Publishing
|
|
86
92
|
|
|
87
93
|
```bash
|
|
88
|
-
#
|
|
89
|
-
|
|
94
|
+
# Manual version bumping
|
|
95
|
+
yarn version:patch # 1.0.0 -> 1.0.1
|
|
96
|
+
yarn version:minor # 1.0.0 -> 1.1.0
|
|
97
|
+
yarn version:major # 1.0.0 -> 2.0.0
|
|
90
98
|
|
|
91
|
-
#
|
|
92
|
-
|
|
99
|
+
# Build library
|
|
100
|
+
yarn build:lib
|
|
93
101
|
|
|
94
|
-
#
|
|
95
|
-
|
|
102
|
+
# Test publish (dry run)
|
|
103
|
+
yarn publish:dry
|
|
96
104
|
|
|
97
|
-
#
|
|
98
|
-
|
|
99
|
-
npm run version:minor # 0.1.0 -> 0.2.0
|
|
100
|
-
npm run version:major # 0.1.0 -> 1.0.0
|
|
105
|
+
# Publish to npm (via GitHub Actions)
|
|
106
|
+
# Go to Actions -> Publish to NPM -> Run workflow
|
|
101
107
|
```
|
|
102
108
|
|
|
103
109
|
## ๐ Deployment & GitHub Pages
|
|
@@ -132,14 +138,18 @@ npm run deploy:storybook
|
|
|
132
138
|
2. Set **Source** to "GitHub Actions"
|
|
133
139
|
3. The workflow will handle the rest automatically
|
|
134
140
|
|
|
135
|
-
**Live Storybook URL**: `https
|
|
141
|
+
**Live Storybook URL**: `https://554-ventures.github.io/BienUI/`
|
|
136
142
|
|
|
137
|
-
## ๐ Using
|
|
143
|
+
## ๐ Using BienUI Core in Your App
|
|
138
144
|
|
|
139
|
-
### 1. Install
|
|
145
|
+
### 1. Install package
|
|
140
146
|
|
|
141
147
|
```bash
|
|
142
|
-
|
|
148
|
+
npm install @bienui/core
|
|
149
|
+
# or
|
|
150
|
+
yarn add @bienui/core
|
|
151
|
+
# or
|
|
152
|
+
pnpm add @bienui/core
|
|
143
153
|
```
|
|
144
154
|
|
|
145
155
|
### 2. Setup providers and styles
|
|
@@ -147,8 +157,8 @@ pnpm add @bien/tokens @bien/ui
|
|
|
147
157
|
In your app entry point (`main.tsx` or `App.tsx`):
|
|
148
158
|
|
|
149
159
|
```tsx
|
|
150
|
-
import { BienProvider, TooltipProvider, ToastProvider } from '@
|
|
151
|
-
import '@
|
|
160
|
+
import { BienProvider, TooltipProvider, ToastProvider } from '@bienui/core';
|
|
161
|
+
import '@bienui/core/styles';
|
|
152
162
|
|
|
153
163
|
function App() {
|
|
154
164
|
return (
|
|
@@ -166,7 +176,7 @@ function App() {
|
|
|
166
176
|
### 3. Use components
|
|
167
177
|
|
|
168
178
|
```tsx
|
|
169
|
-
import { Button, Input, Card, Modal, Text } from '@
|
|
179
|
+
import { Button, Input, Card, Modal, Text } from '@bienui/core';
|
|
170
180
|
|
|
171
181
|
function MyComponent() {
|
|
172
182
|
return (
|
|
@@ -185,7 +195,7 @@ function MyComponent() {
|
|
|
185
195
|
|
|
186
196
|
```tsx
|
|
187
197
|
import { useState } from 'react';
|
|
188
|
-
import { BienProvider } from '@
|
|
198
|
+
import { BienProvider } from '@bienui/core';
|
|
189
199
|
|
|
190
200
|
function App() {
|
|
191
201
|
const [theme, setTheme] = useState<'light' | 'dark'>('light');
|
|
@@ -205,10 +215,10 @@ function App() {
|
|
|
205
215
|
}
|
|
206
216
|
```
|
|
207
217
|
|
|
208
|
-
### Using tokens in custom components
|
|
218
|
+
### Using design tokens in custom components
|
|
209
219
|
|
|
210
220
|
```tsx
|
|
211
|
-
import { tokens } from '@
|
|
221
|
+
import { tokens } from '@bienui/core';
|
|
212
222
|
import { style } from '@vanilla-extract/css';
|
|
213
223
|
|
|
214
224
|
export const myCustomStyle = style({
|
|
@@ -284,42 +294,30 @@ export const myCustomStyle = style({
|
|
|
284
294
|
## ๐ Project Structure
|
|
285
295
|
|
|
286
296
|
```
|
|
287
|
-
|
|
288
|
-
โโโ .
|
|
289
|
-
|
|
290
|
-
โ
|
|
291
|
-
โ
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
โ
|
|
295
|
-
โ โ
|
|
296
|
-
โ โ
|
|
297
|
-
โ โ
|
|
298
|
-
โ โ โโโ
|
|
299
|
-
โ โ
|
|
300
|
-
โ โโโ
|
|
301
|
-
โ
|
|
302
|
-
โ
|
|
303
|
-
โ
|
|
304
|
-
โ
|
|
305
|
-
โ
|
|
306
|
-
โ
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
โ โ โโโ provider.tsx
|
|
312
|
-
โ โ โโโ index.ts
|
|
313
|
-
โ โโโ package.json
|
|
314
|
-
โ โโโ tsup.config.ts
|
|
315
|
-
โโโ apps/
|
|
316
|
-
โ โโโ storybook/ # Storybook documentation
|
|
317
|
-
โ โโโ .storybook/
|
|
318
|
-
โ โโโ stories/
|
|
319
|
-
โ โโโ package.json
|
|
320
|
-
โโโ package.json # Root package.json
|
|
321
|
-
โโโ pnpm-workspace.yaml # Workspace configuration
|
|
322
|
-
โโโ tsconfig.json # Shared TypeScript config
|
|
297
|
+
bienui-core/
|
|
298
|
+
โโโ .github/
|
|
299
|
+
โ โโโ workflows/ # GitHub Actions
|
|
300
|
+
โ โโโ deploy-storybook.yml
|
|
301
|
+
โ โโโ publish-npm.yml
|
|
302
|
+
โโโ .storybook/ # Storybook configuration
|
|
303
|
+
โโโ src/
|
|
304
|
+
โ โโโ components/ # React components
|
|
305
|
+
โ โ โโโ Display/ # Avatar, Badge, Card, Text, etc.
|
|
306
|
+
โ โ โโโ Forms/ # Input, Checkbox, Select, etc.
|
|
307
|
+
โ โ โโโ Interactive/ # Button, Menu, Panel, etc.
|
|
308
|
+
โ โ โโโ Layout/ # Container, Grid, Stack, etc.
|
|
309
|
+
โ โ โโโ Navigation/ # Breadcrumb, Header, Link, etc.
|
|
310
|
+
โ โ โโโ Feedback/ # Banner, Modal, Toast, etc.
|
|
311
|
+
โ โโโ tokens/ # Design tokens
|
|
312
|
+
โ โ โโโ primitives.ts # Raw token values
|
|
313
|
+
โ โ โโโ themes.css.ts # Light/dark themes
|
|
314
|
+
โ โ โโโ index.ts
|
|
315
|
+
โ โโโ provider.tsx # Main provider
|
|
316
|
+
โ โโโ index.ts
|
|
317
|
+
โโโ stories/ # Storybook stories
|
|
318
|
+
โโโ dist/ # Built output
|
|
319
|
+
โโโ package.json
|
|
320
|
+
โโโ vite.config.lib.ts # Library build config
|
|
323
321
|
โโโ README.md
|
|
324
322
|
```
|
|
325
323
|
|
|
@@ -327,43 +325,53 @@ bien-ui-monorepo/
|
|
|
327
325
|
|
|
328
326
|
### Package Exports
|
|
329
327
|
|
|
330
|
-
|
|
328
|
+
The package is configured with proper exports for ESM, CJS, and TypeScript:
|
|
331
329
|
|
|
332
330
|
```json
|
|
333
331
|
{
|
|
334
332
|
"exports": {
|
|
335
333
|
".": {
|
|
336
|
-
"
|
|
337
|
-
"
|
|
338
|
-
"
|
|
334
|
+
"types": "./dist/index.d.ts",
|
|
335
|
+
"import": "./dist/bien-ui.esm.js",
|
|
336
|
+
"require": "./dist/bien-ui.cjs.js"
|
|
339
337
|
},
|
|
340
|
-
"./styles
|
|
338
|
+
"./styles": "./dist/bien-ui.css"
|
|
341
339
|
}
|
|
342
340
|
}
|
|
343
341
|
```
|
|
344
342
|
|
|
345
343
|
### Peer Dependencies
|
|
346
344
|
|
|
347
|
-
`@
|
|
345
|
+
`@bienui/core` marks React as a peer dependency:
|
|
348
346
|
|
|
349
347
|
```json
|
|
350
348
|
{
|
|
351
349
|
"peerDependencies": {
|
|
352
|
-
"react": "^18.0.0",
|
|
353
|
-
"react-dom": "^18.0.0"
|
|
350
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
351
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
354
352
|
}
|
|
355
353
|
}
|
|
356
354
|
```
|
|
357
355
|
|
|
358
356
|
## ๐งช Testing in Consuming Apps
|
|
359
357
|
|
|
360
|
-
Before publishing, you can test the
|
|
358
|
+
Before publishing, you can test the package locally using npm/yarn link:
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
# In BienUI Core project
|
|
362
|
+
yarn build:lib
|
|
363
|
+
yarn link
|
|
364
|
+
|
|
365
|
+
# In your test project
|
|
366
|
+
yarn link @bienui/core
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Or install directly from file:
|
|
361
370
|
|
|
362
371
|
```json
|
|
363
372
|
{
|
|
364
373
|
"dependencies": {
|
|
365
|
-
"@
|
|
366
|
-
"@bien/ui": "workspace:*"
|
|
374
|
+
"@bienui/core": "file:../path/to/BienUI"
|
|
367
375
|
}
|
|
368
376
|
}
|
|
369
377
|
```
|
|
@@ -373,40 +381,41 @@ Before publishing, you can test the packages locally using pnpm link or by refer
|
|
|
373
381
|
Run Storybook to explore all components, variants, and usage examples:
|
|
374
382
|
|
|
375
383
|
```bash
|
|
376
|
-
|
|
384
|
+
yarn storybook
|
|
377
385
|
```
|
|
378
386
|
|
|
379
387
|
Storybook includes:
|
|
380
388
|
- Interactive component playground
|
|
381
389
|
- Auto-generated prop documentation
|
|
390
|
+
- Accessibility testing with @storybook/addon-a11y
|
|
382
391
|
- Theme switcher (light/dark)
|
|
383
392
|
- Density switcher (comfortable/compact)
|
|
384
393
|
- Live code examples
|
|
385
394
|
|
|
386
395
|
## ๐ข Publishing Workflow
|
|
387
396
|
|
|
388
|
-
1. Make changes to
|
|
389
|
-
2.
|
|
390
|
-
```bash
|
|
391
|
-
pnpm changeset
|
|
392
|
-
```
|
|
393
|
-
3. Commit the changeset
|
|
394
|
-
4. When ready to release:
|
|
397
|
+
1. Make changes to components
|
|
398
|
+
2. Update version in package.json:
|
|
395
399
|
```bash
|
|
396
|
-
|
|
397
|
-
pnpm release # Builds and publishes
|
|
400
|
+
yarn version:patch # or minor/major
|
|
398
401
|
```
|
|
402
|
+
3. Commit and push changes
|
|
403
|
+
4. Use GitHub Actions to publish:
|
|
404
|
+
- Go to **Actions** โ **Publish to NPM**
|
|
405
|
+
- Click **Run workflow**
|
|
406
|
+
- Select version type and npm tag
|
|
407
|
+
- The workflow will build and publish automatically
|
|
399
408
|
|
|
400
409
|
## ๐ ๏ธ Tech Stack
|
|
401
410
|
|
|
402
411
|
- **React 18** - UI library
|
|
403
412
|
- **TypeScript 5** - Type safety
|
|
404
|
-
- **
|
|
405
|
-
- **
|
|
406
|
-
- **
|
|
407
|
-
- **Storybook
|
|
408
|
-
- **
|
|
409
|
-
- **
|
|
413
|
+
- **Radix UI** - Accessible component primitives
|
|
414
|
+
- **Lucide React** - Icon library
|
|
415
|
+
- **Vite** - Fast build tool and dev server
|
|
416
|
+
- **Storybook 8** - Component documentation with a11y testing
|
|
417
|
+
- **GitHub Actions** - CI/CD automation
|
|
418
|
+
- **yarn** - Package manager
|
|
410
419
|
|
|
411
420
|
## ๐ License
|
|
412
421
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bienui/core",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Production-ready React component library with accessibility-first design, Radix UI primitives, and comprehensive Storybook documentation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
7
7
|
"components",
|