ui8kit 1.0.1 → 1.0.3
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 +225 -0
- package/css/dist/styles.css +3325 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
## Semantic Components Integration Guide
|
|
2
|
+
|
|
3
|
+
### CLI Installation (Recommended)
|
|
4
|
+
|
|
5
|
+
The semantic registry extends utility components with enhanced styling and behavior. Follow these steps:
|
|
6
|
+
|
|
7
|
+
#### 1. Initialize Base Registry (Required)
|
|
8
|
+
```bash
|
|
9
|
+
# Initialize utility registry first (foundation requirement)
|
|
10
|
+
npx buildy-ui@latest init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
#### 2. Initialize Semantic Registry
|
|
14
|
+
```bash
|
|
15
|
+
# Initialize semantic registry
|
|
16
|
+
npx buildy-ui@latest init --registry semantic
|
|
17
|
+
|
|
18
|
+
# Skip prompts and use defaults
|
|
19
|
+
npx buildy-ui@latest init --yes --registry semantic
|
|
20
|
+
```
|
|
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
|
|
27
|
+
|
|
28
|
+
# Install ALL semantic components at once
|
|
29
|
+
npx buildy-ui@latest add --all --registry semantic
|
|
30
|
+
|
|
31
|
+
# Preview what would be installed
|
|
32
|
+
npx buildy-ui@latest add --all --dry-run --registry semantic
|
|
33
|
+
|
|
34
|
+
# Force overwrite existing files
|
|
35
|
+
npx buildy-ui@latest add button --force --registry semantic
|
|
36
|
+
```
|
|
37
|
+
|
|
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
|
+
```
|
|
55
|
+
|
|
56
|
+
## CSS Integration with Tailwind (PROD Mode)
|
|
57
|
+
|
|
58
|
+
### Package Installation (Recommended for Tailwind projects)
|
|
59
|
+
|
|
60
|
+
Since semantic CSS files contain Tailwind directives (`@apply`), they must be processed during build time:
|
|
61
|
+
|
|
62
|
+
```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
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Import in your CSS/SCSS files
|
|
74
|
+
|
|
75
|
+
```css
|
|
76
|
+
/* Import all semantic styles */
|
|
77
|
+
@import "ui8kit/css/dist/semantic/index.css";
|
|
78
|
+
|
|
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
|
|
86
|
+
|
|
87
|
+
Semantic CSS files contain Tailwind directives that need compilation:
|
|
88
|
+
|
|
89
|
+
```css
|
|
90
|
+
/* Example from button.css */
|
|
91
|
+
.button-default {
|
|
92
|
+
@apply bg-primary text-primary-foreground shadow-xs hover:bg-primary/90;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.button-secondary {
|
|
96
|
+
@apply bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/90;
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### CDN vs Package Comparison
|
|
101
|
+
|
|
102
|
+
| Method | Use Case | Tailwind Directives | Build Required |
|
|
103
|
+
|--------|----------|-------------------|----------------|
|
|
104
|
+
| **Package** | Production projects | ✅ Supported | ✅ Required |
|
|
105
|
+
| **CDN** | Quick prototyping | ❌ Pre-compiled only | ❌ Not required |
|
|
106
|
+
|
|
107
|
+
### Integration with Tailwind Config
|
|
108
|
+
|
|
109
|
+
Add the package path to your `tailwind.config.js` for proper purging:
|
|
110
|
+
|
|
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
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Note**: CDN links with `@import` URLs will remain as external references and won't be processed by Tailwind's build system.
|
|
123
|
+
|
|
124
|
+
### CDN Integration (only DEV Mode)
|
|
125
|
+
|
|
126
|
+
For projects that prefer CDN over CLI installation:
|
|
127
|
+
|
|
128
|
+
#### Full Semantic Stylesheet
|
|
129
|
+
```html
|
|
130
|
+
<!-- Tailwind 4 CDN for DEV MODE -->
|
|
131
|
+
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
|
132
|
+
<!-- OR Tailwind 3 CDN for DEV MODE -->
|
|
133
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
134
|
+
|
|
135
|
+
<!-- Load complete semantic components -->
|
|
136
|
+
<link rel="stylesheet" href="https://unpkg.com/ui8kit@1.0.1/css/dist/semantic/index.css">
|
|
137
|
+
<!-- OR -->
|
|
138
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui8kit@latest/css/dist/semantic/index.css">
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### Individual Component Stylesheets
|
|
142
|
+
```html
|
|
143
|
+
<!-- Load only specific components you need -->
|
|
144
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui8kit@latest/css/dist/semantic/button.css">
|
|
145
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui8kit@latest/css/dist/semantic/card.css">
|
|
146
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui8kit@latest/css/dist/semantic/input.css">
|
|
147
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui8kit@latest/css/dist/semantic/alert.css">
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### Available Individual Components
|
|
151
|
+
- `button.css` - Enhanced button styles
|
|
152
|
+
- `card.css` - Card component layouts
|
|
153
|
+
- `input.css` - Form input styling
|
|
154
|
+
- `alert.css` - Alert and notification styles
|
|
155
|
+
- `badge.css` - Badge and label components
|
|
156
|
+
- `avatar.css` - User avatar components
|
|
157
|
+
- `table.css` - Data table styling
|
|
158
|
+
- `pagination.css` - Navigation pagination
|
|
159
|
+
- `breadcrumb.css` - Navigation breadcrumbs
|
|
160
|
+
- `skeleton.css` - Loading skeleton states
|
|
161
|
+
|
|
162
|
+
### Usage Examples
|
|
163
|
+
|
|
164
|
+
#### With CLI Installation
|
|
165
|
+
```jsx
|
|
166
|
+
// After CLI installation, components are available via aliases
|
|
167
|
+
import { Button } from '@/semantic/ui/button'
|
|
168
|
+
import { Card } from '@/semantic/ui/card'
|
|
169
|
+
|
|
170
|
+
function App() {
|
|
171
|
+
return (
|
|
172
|
+
<Card>
|
|
173
|
+
<Button variant="secondary">Semantic Button</Button>
|
|
174
|
+
</Card>
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
#### With CDN Integration
|
|
180
|
+
```html
|
|
181
|
+
<!DOCTYPE html>
|
|
182
|
+
<html>
|
|
183
|
+
<head>
|
|
184
|
+
<!-- Tailwind 4 CDN for DEV MODE -->
|
|
185
|
+
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
|
|
186
|
+
<!-- OR Tailwind 3 CDN for DEV MODE -->
|
|
187
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
188
|
+
|
|
189
|
+
<!-- Load semantic styles -->
|
|
190
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui8kit@latest/css/dist/semantic/index.css">
|
|
191
|
+
</head>
|
|
192
|
+
<body>
|
|
193
|
+
<!-- Use semantic classes directly -->
|
|
194
|
+
<div class="card">
|
|
195
|
+
<button class="button button-secondary button-lg">
|
|
196
|
+
Semantic Button
|
|
197
|
+
</button>
|
|
198
|
+
</div>
|
|
199
|
+
</body>
|
|
200
|
+
</html>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Registry Dependencies
|
|
204
|
+
|
|
205
|
+
**Important**: Semantic registry requires utility registry as foundation:
|
|
206
|
+
- ✅ Utility registry must be initialized first
|
|
207
|
+
- ✅ Components must exist in utility before installing in semantic
|
|
208
|
+
- ❌ Cannot use semantic registry without utility base
|
|
209
|
+
|
|
210
|
+
### Performance Considerations
|
|
211
|
+
|
|
212
|
+
**CLI Method**:
|
|
213
|
+
- ✅ Tree-shaking friendly
|
|
214
|
+
- ✅ Only includes used components
|
|
215
|
+
- ✅ TypeScript support
|
|
216
|
+
- ✅ Local development workflow
|
|
217
|
+
|
|
218
|
+
**CDN Method**:
|
|
219
|
+
- ✅ No build step required
|
|
220
|
+
- ✅ Instant integration
|
|
221
|
+
- ✅ Cacheable across projects
|
|
222
|
+
- ⚠️ Individual files = multiple HTTP requests
|
|
223
|
+
- ⚠️ Full bundle may include unused styles
|
|
224
|
+
|
|
225
|
+
Choose CLI for development projects, CDN for quick prototyping or static sites.
|