ui8kit 1.0.5 → 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.
Files changed (51) hide show
  1. package/README.md +80 -149
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +1896 -0
  4. package/dist/index.js.map +1 -0
  5. package/package.json +53 -16
  6. package/css/dist/styles.css +0 -3325
  7. package/css/src/semantic/alert.css +0 -11
  8. package/css/src/semantic/article.css +0 -59
  9. package/css/src/semantic/avatar.css +0 -11
  10. package/css/src/semantic/badge.css +0 -19
  11. package/css/src/semantic/breadcrumb.css +0 -23
  12. package/css/src/semantic/button.css +0 -39
  13. package/css/src/semantic/card.css +0 -43
  14. package/css/src/semantic/index.css +0 -19
  15. package/css/src/semantic/input.css +0 -3
  16. package/css/src/semantic/label.css +0 -3
  17. package/css/src/semantic/link.css +0 -39
  18. package/css/src/semantic/main.css +0 -3
  19. package/css/src/semantic/markup.css +0 -23
  20. package/css/src/semantic/nav.css +0 -63
  21. package/css/src/semantic/pagination.css +0 -11
  22. package/css/src/semantic/section.css +0 -43
  23. package/css/src/semantic/sheet.css +0 -35
  24. package/css/src/semantic/skeleton.css +0 -3
  25. package/css/src/semantic/table.css +0 -31
  26. package/css/src/semantic/textarea.css +0 -3
  27. package/r/components/article.json +0 -17
  28. package/r/components/aside.json +0 -17
  29. package/r/components/footer.json +0 -17
  30. package/r/components/header.json +0 -17
  31. package/r/components/main.json +0 -17
  32. package/r/components/markup.json +0 -17
  33. package/r/components/media.json +0 -17
  34. package/r/components/nav.json +0 -18
  35. package/r/components/navbar.json +0 -15
  36. package/r/components/section.json +0 -17
  37. package/r/components/sheet.json +0 -18
  38. package/r/index.json +0 -135
  39. package/r/lib/utils.json +0 -18
  40. package/r/ui/alert.json +0 -18
  41. package/r/ui/avatar.json +0 -17
  42. package/r/ui/badge.json +0 -19
  43. package/r/ui/breadcrumb.json +0 -19
  44. package/r/ui/button.json +0 -19
  45. package/r/ui/card.json +0 -17
  46. package/r/ui/input.json +0 -17
  47. package/r/ui/label.json +0 -17
  48. package/r/ui/link.json +0 -18
  49. package/r/ui/skeleton.json +0 -15
  50. package/r/ui/table.json +0 -17
  51. package/r/ui/textarea.json +0 -17
package/README.md CHANGED
@@ -1,194 +1,125 @@
1
- ## Semantic Components Integration Guide
1
+ # ui8kit CLI
2
2
 
3
- ### CLI Installation (Recommended)
3
+ Official CLI for bootstrapping and managing UI8Kit component workflows in Vite React projects.
4
4
 
5
- The semantic registry extends utility components with enhanced styling and behavior. Follow these steps:
5
+ ## Requirements
6
+
7
+ - Node.js `>=18`
8
+ - A Vite React project (for `init` and `add`)
9
+
10
+ ## Quick Start
6
11
 
7
- #### 1. Initialize Base Registry (Required)
8
12
  ```bash
9
- # Initialize utility registry first (foundation requirement)
10
- npx buildy-ui@latest init
13
+ bunx ui8kit@latest init
11
14
  ```
12
15
 
13
- #### 2. Initialize Semantic Registry
14
- ```bash
15
- # Initialize semantic registry
16
- npx buildy-ui@latest init --registry semantic
16
+ Initialize with defaults (non-interactive):
17
17
 
18
- # Skip prompts and use defaults
19
- npx buildy-ui@latest init --yes --registry semantic
18
+ ```bash
19
+ bunx ui8kit@latest init --yes
20
20
  ```
21
21
 
22
- #### 3. Add Semantic Components
23
- ```bash
24
- # Add specific semantic components
25
- npx buildy-ui@latest add button card --registry semantic
26
- npx buildy-ui@latest add input --registry semantic
22
+ ## Commands
27
23
 
28
- # Install ALL semantic components at once
29
- npx buildy-ui@latest add --all --registry semantic
24
+ ### `init`
30
25
 
31
- # Preview what would be installed
32
- npx buildy-ui@latest add --all --dry-run --registry semantic
26
+ Initialize UI8Kit structure and config in the current project.
33
27
 
34
- # Force overwrite existing files
35
- npx buildy-ui@latest add button --force --registry semantic
28
+ ```bash
29
+ bunx ui8kit@latest init
30
+ bunx ui8kit@latest init --yes
31
+ bunx ui8kit@latest init --registry ui
36
32
  ```
37
33
 
38
- #### Project Structure After Installation
39
- ```
40
- semantic/
41
- ├── ui/ # Semantic UI components
42
- ├── blocks/ # Semantic blocks
43
- ├── components/ # Semantic components
44
- ├── templates/ # Semantic templates
45
- └── buildy.config.json
46
-
47
- utility/ # Base registry (required)
48
- ├── ui/
49
- ├── blocks/
50
- └── buildy.config.json
51
-
52
- lib/ # Shared utilities
53
- └── utils.ts
54
- ```
34
+ Options:
55
35
 
56
- ## CSS Integration with Tailwind (PROD Mode)
36
+ - `-y, --yes` Skip prompts and use defaults
37
+ - `-r, --registry <type>` Registry type (default: `ui`)
57
38
 
58
- ### Package Installation (Recommended for Tailwind projects)
39
+ ### `add`
59
40
 
60
- Since semantic CSS files contain Tailwind directives (`@apply`), they must be processed during build time:
41
+ Install one or more components from the registry.
61
42
 
62
43
  ```bash
63
- # Install the CSS package
64
- npm install ui8kit@latest
65
- # or
66
- yarn add ui8kit@latest
67
- # or
68
- pnpm add ui8kit@latest
69
- # or
70
- bun add ui8kit@latest
44
+ bunx ui8kit@latest add button
45
+ bunx ui8kit@latest add button card
46
+ bunx ui8kit@latest add --all
47
+ bunx ui8kit@latest add badge --force
48
+ bunx ui8kit@latest add button --dry-run
49
+ bunx ui8kit@latest add --all --retry
71
50
  ```
72
51
 
73
- ### Import in your CSS/SCSS files
74
-
75
- ```css
76
- /* Import all semantic styles */
77
- @import "ui8kit/css/dist/semantic/index.css";
52
+ Options:
78
53
 
79
- /* Or import individual components */
80
- @import "ui8kit/css/dist/semantic/button.css";
81
- @import "ui8kit/css/dist/semantic/card.css";
82
- @import "ui8kit/css/dist/semantic/input.css";
83
- ```
84
-
85
- ### Why Package Installation is Required
54
+ - `-a, --all` Install all available components
55
+ - `-f, --force` Overwrite existing files
56
+ - `-r, --registry <type>` Registry type (default: `ui`)
57
+ - `--dry-run` Show planned actions without writing files
58
+ - `--retry` Enable retry logic for unstable connections
86
59
 
87
- Semantic CSS files contain Tailwind directives that need compilation:
60
+ ### `scan`
88
61
 
89
- ```css
90
- /* Example from button.css */
91
- .button-default {
92
- @apply bg-primary text-primary-foreground shadow-xs hover:bg-primary/90;
93
- }
62
+ Scan source files and generate a registry manifest.
94
63
 
95
- .button-secondary {
96
- @apply bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/90;
97
- }
64
+ ```bash
65
+ bunx ui8kit@latest scan
66
+ bunx ui8kit@latest scan --cwd ./apps/engine
67
+ bunx ui8kit@latest scan --source ./src --output ./src/registry.json
98
68
  ```
99
69
 
100
- ### CDN vs Package Comparison
70
+ Options:
101
71
 
102
- | Method | Use Case | Tailwind Directives | Build Required |
103
- |--------|----------|-------------------|----------------|
104
- | **Package** | Production projects | Supported | ✅ Required |
105
- | **CDN** | Quick prototyping | ❌ Pre-compiled only | Not required |
72
+ - `-r, --registry <type|path>` Registry type/path (default: `ui`)
73
+ - `-o, --output <file>` Output registry file
74
+ - `-s, --source <dir>` Source directory to scan
75
+ - `--cwd <dir>` Working directory
106
76
 
107
- ### Integration with Tailwind Config
77
+ ### `build`
108
78
 
109
- Add the package path to your `tailwind.config.js` for proper purging:
79
+ Build a publishable registry from a registry JSON file.
110
80
 
111
- ```js
112
- /** @type {import('tailwindcss').Config} */
113
- module.exports = {
114
- content: [
115
- "./src/**/*.{js,ts,jsx,tsx}",
116
- "./node_modules/ui8kit/**/*.{js,ts,jsx,tsx}", // Add this line
117
- ],
118
- // ... rest of your config
119
- }
81
+ ```bash
82
+ bunx ui8kit@latest build
83
+ bunx ui8kit@latest build ./src/registry.json
84
+ bunx ui8kit@latest build ./src/registry.json --output ./packages/registry/r
120
85
  ```
121
86
 
122
- **Note**: CDN links with `@import` URLs will remain as external references and won't be processed by Tailwind's build system.
87
+ Options:
123
88
 
124
- ### CDN Integration
89
+ - `[registry]` Path to registry JSON (default: `./src/registry.json`)
90
+ - `-o, --output <path>` Output directory (default: `./packages/registry/r`)
91
+ - `-c, --cwd <cwd>` Working directory
125
92
 
126
- For projects that prefer CDN over CLI installation:
93
+ ## Typical Flow
127
94
 
128
- #### Compiled Semantic Stylesheet
129
- ```html
130
- <!-- Load compiled semantic components -->
131
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui8kit@latest/css/dist/styles.css">
132
- <!-- OR -->
133
- <link rel="stylesheet" href="https://unpkg.com/ui8kit@latest/css/dist/styles.css">
134
- ```
95
+ ```bash
96
+ # 1) Initialize project
97
+ bunx ui8kit@latest init --yes
135
98
 
136
- ### Usage Examples
137
-
138
- #### With CLI Installation
139
- ```jsx
140
- // After CLI installation, components are available via aliases
141
- import { Button } from '@/semantic/ui/button'
142
- import { Card } from '@/semantic/ui/card'
143
-
144
- function App() {
145
- return (
146
- <Card>
147
- <Button variant="secondary">Semantic Button</Button>
148
- </Card>
149
- )
150
- }
151
- ```
99
+ # 2) Add a component
100
+ bunx ui8kit@latest add button
152
101
 
153
- #### With CDN Integration
154
- ```html
155
- <!DOCTYPE html>
156
- <html>
157
- <head>
158
- <!-- Load compiled semantic styles -->
159
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui8kit@latest/css/dist/styles.css">
160
- </head>
161
- <body>
162
- <!-- Use semantic classes directly -->
163
- <div class="card">
164
- <button class="button button-secondary button-lg">
165
- Semantic Button
166
- </button>
167
- </div>
168
- </body>
169
- </html>
102
+ # 3) Add everything from registry (optional)
103
+ bunx ui8kit@latest add --all
170
104
  ```
171
105
 
172
- ### Registry Dependencies
106
+ ## Local Development (this package)
173
107
 
174
- **Important**: Semantic registry requires utility registry as foundation:
175
- - ✅ Utility registry must be initialized first
176
- - ✅ Components must exist in utility before installing in semantic
177
- - ❌ Cannot use semantic registry without utility base
108
+ From `packages/cli`:
178
109
 
179
- ### Performance Considerations
110
+ ```bash
111
+ npm install
112
+ npm run dev
113
+ ```
180
114
 
181
- **CLI Method**:
182
- - ✅ Tree-shaking friendly
183
- - ✅ Only includes used components
184
- - ✅ TypeScript support
185
- - ✅ Local development workflow
115
+ Build once:
186
116
 
187
- **CDN Method**:
188
- - No build step required
189
- - ✅ Instant integration
190
- - ✅ Cacheable across projects
191
- - ⚠️ Individual files = multiple HTTP requests
192
- - ⚠️ Full bundle may include unused styles
117
+ ```bash
118
+ npm run build
119
+ ```
120
+
121
+ Run compiled CLI locally:
193
122
 
194
- Choose CLI for development projects, CDN for quick prototyping or static sites.
123
+ ```bash
124
+ node dist/index.js --help
125
+ ```
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node