@bcc-code/design-tokens 2.0.2 → 2.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 +12 -67
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -7,13 +7,12 @@ A comprehensive design token package with CSS variables, Tailwind v4 integration
|
|
|
7
7
|
|
|
8
8
|
## 🚀 Features
|
|
9
9
|
|
|
10
|
-
- **CSS Variables**:
|
|
10
|
+
- **CSS Variables**: Universal support for any project
|
|
11
11
|
- **Tailwind v4 Integration**: Native support with `@theme` and custom utilities
|
|
12
|
-
- **PrimeVue
|
|
13
|
-
- **TypeScript Support**: Full type definitions for better developer experience
|
|
12
|
+
- **PrimeVue Integration**: Token override preset extending Aura theme
|
|
14
13
|
- **Dark Mode**: Automatic switching via CSS media queries or class-based control
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
14
|
+
- **TypeScript**: Full type definitions for all exports
|
|
15
|
+
- **CDN Support**: Direct imports for WordPress and static sites
|
|
17
16
|
|
|
18
17
|
## 📦 Installation
|
|
19
18
|
|
|
@@ -21,28 +20,11 @@ A comprehensive design token package with CSS variables, Tailwind v4 integration
|
|
|
21
20
|
npm install @bcc-code/design-tokens
|
|
22
21
|
```
|
|
23
22
|
|
|
24
|
-
## 📁 Package Structure
|
|
25
|
-
|
|
26
|
-
Understanding the import paths:
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
@bcc-code/design-tokens/{group}/{format}/{file}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
- **`{group}`** - Design system variant (currently `bcc`, future: `events`, `members`)
|
|
33
|
-
- **`{format}`** - Distribution format (`cdn`, `tailwind`, `primevue`)
|
|
34
|
-
- **`{file}`** - Specific file (`variables.css`, `index.css`, etc.)
|
|
35
|
-
|
|
36
|
-
**Examples:**
|
|
37
|
-
- `./bcc/cdn/variables.css` - BCC brand CSS variables for CDN/WordPress
|
|
38
|
-
- `./bcc/tailwind/index.css` - BCC brand Tailwind integration
|
|
39
|
-
- `./bcc/primevue` - BCC brand PrimeVue preset configuration
|
|
40
|
-
|
|
41
23
|
## 🎯 Usage
|
|
42
24
|
|
|
43
25
|
### CSS Variables (WordPress, Static Sites)
|
|
44
26
|
|
|
45
|
-
**CDN
|
|
27
|
+
**CDN:**
|
|
46
28
|
```html
|
|
47
29
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@bcc-code/design-tokens@latest/build/bcc/cdn/variables.css">
|
|
48
30
|
```
|
|
@@ -97,10 +79,10 @@ npm install tailwindcss
|
|
|
97
79
|
npm install tailwindcss primevue @primevue/themes
|
|
98
80
|
```
|
|
99
81
|
|
|
100
|
-
**2. Import CSS and preset configuration:**
|
|
82
|
+
**2. Import Tailwind CSS and preset configuration:**
|
|
101
83
|
```javascript
|
|
102
84
|
import '@bcc-code/design-tokens/bcc/tailwind';
|
|
103
|
-
import
|
|
85
|
+
import BCCAuraOverride from '@bcc-code/design-tokens/bcc/primevue';
|
|
104
86
|
```
|
|
105
87
|
|
|
106
88
|
**3. Configure PrimeVue:**
|
|
@@ -110,8 +92,7 @@ import PrimeVue from 'primevue/config';
|
|
|
110
92
|
import { definePreset } from '@primevue/themes';
|
|
111
93
|
import Aura from '@primevue/themes/aura';
|
|
112
94
|
|
|
113
|
-
|
|
114
|
-
const BCCPreset = definePreset(Aura, BCCPresetConfig);
|
|
95
|
+
const BCCPreset = definePreset(Aura, BCCAuraOverride);
|
|
115
96
|
|
|
116
97
|
const app = createApp(App);
|
|
117
98
|
|
|
@@ -119,7 +100,7 @@ app.use(PrimeVue, {
|
|
|
119
100
|
theme: {
|
|
120
101
|
preset: BCCPreset,
|
|
121
102
|
options: {
|
|
122
|
-
darkModeSelector: '.dark'
|
|
103
|
+
darkModeSelector: '.dark'
|
|
123
104
|
}
|
|
124
105
|
}
|
|
125
106
|
});
|
|
@@ -141,8 +122,8 @@ app.use(PrimeVue, {
|
|
|
141
122
|
|
|
142
123
|
**TypeScript Support:**
|
|
143
124
|
```typescript
|
|
144
|
-
import
|
|
145
|
-
|
|
125
|
+
import BCCAuraOverride from '@bcc-code/design-tokens/bcc/primevue';
|
|
126
|
+
import type { BCCAuraOverrideConfig } from '@bcc-code/design-tokens/bcc/primevue';
|
|
146
127
|
```
|
|
147
128
|
|
|
148
129
|
## 🌙 Dark Mode
|
|
@@ -164,34 +145,6 @@ Works out of the box with user's system preferences:
|
|
|
164
145
|
}
|
|
165
146
|
```
|
|
166
147
|
|
|
167
|
-
### Manual (Class-based)
|
|
168
|
-
Control dark mode programmatically:
|
|
169
|
-
|
|
170
|
-
```javascript
|
|
171
|
-
// Toggle dark mode
|
|
172
|
-
document.documentElement.classList.toggle('dark');
|
|
173
|
-
|
|
174
|
-
// Enable dark mode
|
|
175
|
-
document.documentElement.classList.add('dark');
|
|
176
|
-
|
|
177
|
-
// Disable dark mode
|
|
178
|
-
document.documentElement.classList.remove('dark');
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
For PrimeVue projects:
|
|
182
|
-
```javascript
|
|
183
|
-
app.use(PrimeVue, {
|
|
184
|
-
theme: {
|
|
185
|
-
preset: BCCPreset,
|
|
186
|
-
options: {
|
|
187
|
-
darkModeSelector: '.dark' // Class-based
|
|
188
|
-
// or
|
|
189
|
-
darkModeSelector: 'system' // Automatic
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
```
|
|
194
|
-
|
|
195
148
|
## 📋 Available Tokens
|
|
196
149
|
|
|
197
150
|
### Colors
|
|
@@ -217,14 +170,6 @@ app.use(PrimeVue, {
|
|
|
217
170
|
- **Text Sizes**: `--text-*` (mapped from font-size tokens)
|
|
218
171
|
- **Radius**: `--radius-*` (mapped from border-radius tokens)
|
|
219
172
|
|
|
220
|
-
## 🎨 Framework Support
|
|
221
|
-
|
|
222
|
-
### Current
|
|
223
|
-
- ✅ **CSS Variables** - Universal support
|
|
224
|
-
- ✅ **Tailwind CSS v4** - Native integration
|
|
225
|
-
- ✅ **PrimeVue v4** - Configuration object with TypeScript support
|
|
226
|
-
- ✅ **TypeScript** - Full type definitions for all exports
|
|
227
|
-
|
|
228
173
|
## 🛠️ Development
|
|
229
174
|
|
|
230
175
|
### Building from Source
|
|
@@ -265,4 +210,4 @@ MIT © BCC Code
|
|
|
265
210
|
|
|
266
211
|
---
|
|
267
212
|
|
|
268
|
-
Made with ❤️ by [BCC Code](https://bcc
|
|
213
|
+
Made with ❤️ by [BCC Code](https://github.com/bcc-code)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcc-code/design-tokens",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Design tokens with CSS variables, Tailwind v4, and framework presets.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/bcc/cdn/variables.css",
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"build/**/*",
|
|
22
|
-
"
|
|
23
|
-
"README.md"
|
|
22
|
+
"package.json"
|
|
24
23
|
],
|
|
25
24
|
"scripts": {
|
|
26
25
|
"build": "node build.js",
|