@bcc-code/design-tokens 3.0.13 → 3.0.17

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @bcc-code/design-tokens
2
2
 
3
- BCC Design System tokens with support for CSS variables, Tailwind CSS v4, and PrimeVue themes. Generates consistent design tokens from Figma Token Studio with automatic light/dark mode support.
3
+ BCC Design System tokens for CSS, Tailwind v4, and PrimeVue with light/dark mode support.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,17 +10,13 @@ npm install @bcc-code/design-tokens
10
10
 
11
11
  ## Usage
12
12
 
13
- ### CSS Variables (Recommended)
14
-
15
- Import auto-switching CSS variables with light/dark mode support:
13
+ ### CSS Variables
16
14
 
17
15
  ```css
18
16
  @import '@bcc-code/design-tokens/css';
19
17
  ```
20
18
 
21
- This automatically provides light theme by default and switches to dark theme when the `.dark` class is applied to any parent element (typically `html` or `body`).
22
-
23
- Use semantic tokens in your styles:
19
+ Provides light theme by default, dark theme with `.dark` class:
24
20
 
25
21
  ```css
26
22
  .card {
@@ -28,65 +24,51 @@ Use semantic tokens in your styles:
28
24
  color: var(--color-text-default);
29
25
  padding: var(--space-300);
30
26
  border-radius: var(--border-radius-md);
31
- font-family: var(--font-family-archivo);
32
27
  }
33
28
  ```
34
29
 
35
- **Manual theme switching:**
30
+ Toggle dark mode:
31
+
36
32
  ```javascript
37
- // Toggle dark mode
38
33
  document.documentElement.classList.toggle('dark');
39
-
40
- // Or set theme based on user preference
41
- const isDark = localStorage.getItem('theme') === 'dark';
42
- document.documentElement.classList.toggle('dark', isDark);
43
- ```
44
-
45
- **Alternative theme-specific imports (optional):**
46
- ```css
47
- @import '@bcc-code/design-tokens/css/light';
48
- @import '@bcc-code/design-tokens/css/dark';
49
34
  ```
50
35
 
51
- ### Tailwind CSS v4 (Recommended)
52
-
53
- Import Tailwind utilities with auto-switching themes and `.dark` class support:
36
+ ### Tailwind CSS v4
54
37
 
55
38
  ```css
56
39
  @import '@bcc-code/design-tokens/tailwind';
57
40
  ```
58
41
 
59
- This provides light theme by default and dark theme when using the `.dark` class on any parent element.
60
-
61
42
  Use utility classes:
62
43
 
63
44
  ```html
64
45
  <div class="bg-elevation-surface-default text-default p-300 radius-md">
65
- Content with BCC design tokens
46
+ Content
66
47
  </div>
67
48
 
68
- <!-- Dark mode with .dark class -->
49
+ <!-- Dark mode -->
69
50
  <div class="dark">
70
- <div class="bg-elevation-surface-default text-default p-300 radius-md">
71
- Content in dark mode
51
+ <div class="bg-elevation-surface-default text-default">
52
+ Dark content
72
53
  </div>
73
54
  </div>
74
55
  ```
75
56
 
76
- **Alternative theme-specific imports (optional):**
77
- ```css
78
- @import '@bcc-code/design-tokens/tailwind/light';
79
- @import '@bcc-code/design-tokens/tailwind/dark';
80
- ```
57
+ ### PrimeVue
81
58
 
82
- ### PrimeVue Integration
59
+ Install the required peer dependencies:
83
60
 
84
- Configure PrimeVue with BCC theme preset:
61
+ ```bash
62
+ npm install primevue @primeuix/themes
63
+ ```
64
+
65
+ Import the preset and overrides:
85
66
 
86
67
  ```javascript
87
68
  import { createApp } from 'vue'
88
69
  import PrimeVue from 'primevue/config'
89
70
  import BCCPreset from '@bcc-code/design-tokens/primevue'
71
+ import '@bcc-code/design-tokens/primevue/overrides'
90
72
 
91
73
  const app = createApp(App)
92
74
 
@@ -94,158 +76,131 @@ app.use(PrimeVue, {
94
76
  theme: {
95
77
  preset: BCCPreset,
96
78
  options: {
97
- prefix: 'p',
98
79
  darkModeSelector: '.dark',
99
- cssLayer: false
80
+ cssLayer: {
81
+ name: 'primevue',
82
+ order: 'theme, base, primevue, custom'
83
+ }
100
84
  }
101
85
  }
102
86
  })
103
87
  ```
104
88
 
105
- Enable dark mode by adding the `dark` class to your root element:
89
+ Toggle dark mode:
106
90
 
107
91
  ```javascript
108
- // Toggle dark mode
109
92
  document.documentElement.classList.toggle('dark')
110
-
111
- // Or with system preference fallback
112
- function setTheme(isDark) {
113
- document.documentElement.classList.toggle('dark', isDark);
114
- document.documentElement.style.colorScheme = isDark ? 'dark' : 'light';
115
- }
116
93
  ```
117
94
 
95
+ **What's Included:**
96
+ - `@bcc-code/design-tokens/primevue` - PrimeVue Aura preset with BCC tokens
97
+ - `@bcc-code/design-tokens/primevue/overrides` - CSS overrides for component styling
98
+
99
+ ## Available Exports
100
+
101
+ ### CSS
102
+ - `@bcc-code/design-tokens/css` - Auto-switching theme (prefers-color-scheme)
103
+ - `@bcc-code/design-tokens/css/light` - Light theme only
104
+ - `@bcc-code/design-tokens/css/dark` - Dark theme only
105
+
106
+ ### Tailwind CSS
107
+ - `@bcc-code/design-tokens/tailwind` - Auto-switching utilities
108
+ - `@bcc-code/design-tokens/tailwind/light` - Light utilities only
109
+ - `@bcc-code/design-tokens/tailwind/dark` - Dark utilities only
110
+
111
+ ### JavaScript
112
+ - `@bcc-code/design-tokens/js/light` - Light theme tokens as JS objects
113
+ - `@bcc-code/design-tokens/js/dark` - Dark theme tokens as JS objects
114
+
115
+ ### PrimeVue
116
+ - `@bcc-code/design-tokens/primevue` - Aura preset configuration
117
+ - `@bcc-code/design-tokens/primevue/overrides` - Component CSS overrides
118
+
118
119
  ## Token Categories
119
120
 
120
- - **Colors**: Semantic color tokens for text, backgrounds, borders, and states
121
- - **Typography**: Font families, sizes, weights, and line heights
122
- - **Spacing**: Consistent spacing scale for margins, padding, and gaps
123
- - **Border Radius**: Border radius values for consistent corner rounding
124
- - **Elevation**: Surface tokens for different elevation levels
121
+ - **Colors**: Text, backgrounds, borders, states
122
+ - **Typography**: Font families, sizes, weights, line heights
123
+ - **Spacing**: Margins, padding, gaps (50-1000 scale)
124
+ - **Border Radius**: Corner rounding
125
+ - **Elevation**: Surface levels
125
126
 
126
127
  ## CDN Usage
127
128
 
128
129
  ```html
129
- <!-- Auto-switching CSS variables with .dark class support (recommended) -->
130
+ <!-- CSS variables -->
130
131
  <link rel="stylesheet" href="https://unpkg.com/@bcc-code/design-tokens@latest/build/bcc/css/auto.css">
131
132
 
132
- <!-- Or Tailwind utilities with .dark class support -->
133
+ <!-- Tailwind utilities -->
133
134
  <link rel="stylesheet" href="https://unpkg.com/@bcc-code/design-tokens@latest/build/bcc/css/tailwind-auto.css">
134
135
 
135
- <!-- Then add JavaScript for theme switching -->
136
+ <!-- Theme toggle -->
136
137
  <script>
137
- // Basic theme toggle
138
- function toggleTheme() {
139
- document.documentElement.classList.toggle('dark');
140
- }
141
-
142
- // Theme with system preference detection
143
- function initTheme() {
144
- const savedTheme = localStorage.getItem('theme');
145
- const systemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
146
- const isDark = savedTheme ? savedTheme === 'dark' : systemDark;
147
-
148
- document.documentElement.classList.toggle('dark', isDark);
149
- document.documentElement.style.colorScheme = isDark ? 'dark' : 'light';
150
- }
151
-
152
- initTheme();
138
+ document.documentElement.classList.toggle('dark');
153
139
  </script>
154
140
  ```
155
141
 
156
- ## Contributing
142
+ ## Development
157
143
 
158
- We welcome contributions! Here's how to get started:
159
-
160
- ### Development Setup
161
-
162
- 1. **Clone and install dependencies:**
163
- ```bash
164
- git clone https://github.com/bcc-code/design-tokens.git
165
- cd design-tokens
166
- npm install
167
- ```
168
-
169
- 2. **Build tokens:**
170
- ```bash
171
- npm run build
172
- ```
173
-
174
- 3. **Test with demo application:**
175
- ```bash
176
- cd demo
177
- npm install
178
- npm run dev
179
- ```
180
-
181
- The demo application showcases all three integration methods (CSS variables, Tailwind utilities, and PrimeVue components) with a comprehensive dashboard featuring theme switching, real-world examples, and live token demonstrations.
182
-
183
- ### Token Structure
184
-
185
- - **Source tokens** are located in `tokens/` directory, synced from Figma Token Studio
186
- - **Build configuration** is in `export-tokens/build.js` using Style Dictionary
187
- - **Output files** are generated in `build/bcc/` with organized folders for `css/` and `js/`
188
-
189
- ### GitHub-Figma Workflow
190
-
191
- The design token system integrates with Figma through Figma Token Studio, creating a streamlined workflow between design and development:
192
-
193
- **1. Design in Figma**
194
- - Design tokens are created and managed in Figma using the Token Studio plugin
195
- - Tokens are organized into collections: primitives, semantic (light/dark), typeface, and PrimeVue
196
- - Designers can make changes directly in Figma and preview them in real-time
197
-
198
- **2. Export from Figma Token Studio**
199
- - Use the Token Studio plugin to export tokens as JSON files
200
- - Export collections separately or as a complete token set
201
- - Tokens are exported in the Figma Token Studio format with proper references
202
-
203
- **3. Sync to GitHub**
204
- - Export token files from Figma Token Studio
205
- - Update the corresponding files in the `tokens/` directory:
206
- - `tokens/primitives/` - Base design tokens (colors, dimensions, typography)
207
- - `tokens/semantic/light.json` - Light theme semantic tokens
208
- - `tokens/semantic/dark.json` - Dark theme semantic tokens
209
- - `tokens/typeface/` - Font definitions
210
- - `tokens/primevue/aura-primitive.json` - PrimeVue Aura primitive tokens
211
- - Commit changes to your feature branch
212
-
213
- **4. Build and Deploy**
214
- - Run `npm run build` to transform tokens into CSS, JS, and Tailwind formats
215
- - The Style Dictionary build system processes tokens with custom transforms
216
- - Generated files in `build/bcc/` are ready for distribution
217
-
218
- **5. Version and Release**
219
- - Create pull request with token changes
220
- - Review generated output files and test with demo application
221
- - Merge to main branch triggers automated release process
222
- - New package version is published to npm with updated tokens
223
-
224
- ### Making Changes
225
-
226
- 1. **Token updates:** Export from Figma Token Studio and update files in `tokens/` directory
227
- 2. **Build system changes:** Update `export-tokens/build.js` for new formats or transformations
228
- 3. **PrimeVue preset:** Modify `config/primevue.config.js` for theme mapping changes
229
-
230
- ### Pull Requests
231
-
232
- - Ensure `npm run build` runs successfully
233
- - Test changes with the demo application
234
- - Update documentation if adding new features
235
- - Follow conventional commit messages
144
+ ```bash
145
+ git clone https://github.com/bcc-code/bcc-tokens.git
146
+ cd bcc-tokens
147
+ npm install
148
+ npm run build
149
+ ```
236
150
 
237
- ## Development
151
+ Run demo:
152
+
153
+ ```bash
154
+ cd demo
155
+ npm install
156
+ npm run dev
157
+ ```
158
+
159
+ Visit `http://localhost:5173`
160
+
161
+ ## Project Structure
162
+
163
+ ```
164
+ tokens/ # Source tokens (Figma Token Studio)
165
+ export-tokens/ # Build system
166
+ config/ # PrimeVue preset
167
+ build/bcc/ # Generated output
168
+ demo/ # Demo application
169
+ ```
170
+
171
+ ## Publishing
238
172
 
239
- A comprehensive demo application is available in the `demo/` directory featuring:
173
+ ### Stable Release (latest tag)
240
174
 
241
- - **CSS Variables showcase**: Custom cards, newsletter forms, and status displays using pure CSS with BCC tokens
242
- - **Tailwind Utilities showcase**: Project management dashboard with utility-first CSS classes
243
- - **PrimeVue Components showcase**: User profiles, settings panels, and component galleries
244
- - **Theme switching**: Manual dark/light mode toggle with system preference detection
245
- - **Live token demonstrations**: Real-time examples of all token categories in action
175
+ Automated via GitHub Actions when you push a version tag:
176
+
177
+ ```bash
178
+ # Update version
179
+ npm version patch # or minor/major
180
+ git push
181
+ git push --tags
182
+ ```
183
+
184
+ ### Pre-release (next tag)
185
+
186
+ For testing before stable release:
187
+
188
+ ```bash
189
+ # Create pre-release version
190
+ npm version prerelease --preid=next
191
+ # Example: 3.0.14-next.0
192
+
193
+ # Publish to next tag
194
+ npm publish --tag next
195
+
196
+ # Users can install with:
197
+ # npm install @bcc-code/design-tokens@next
198
+ ```
199
+
200
+ ## Contributing
246
201
 
247
- Access the demo at `http://localhost:5173` after running `npm run dev` in the `demo/` directory.
202
+ See [CONTRIBUTING.md](CONTRIBUTING.md)
248
203
 
249
204
  ## License
250
205
 
251
- MIT © BCC Code
206
+ MIT © BCC Code
@@ -0,0 +1,179 @@
1
+ /* primevue-overrides.css - CSS-level component overrides */
2
+ @layer custom {
3
+ .p-accordionheader {
4
+ gap: var(--p-accordion-header-gap);
5
+ }
6
+
7
+ .p-autocomplete-input-multiple {
8
+ min-height: var(--p-autocomplete-input-multiple-min-height);
9
+ gap: var(--p-autocomplete-input-multiple-gap);
10
+ }
11
+
12
+ .p-badge-circle {
13
+ border-radius: var(--p-badge-circle-border-radius);
14
+ }
15
+
16
+ .p-button {
17
+ min-height: var(--p-button-min-height);
18
+ }
19
+
20
+ .p-button-sm {
21
+ min-height: var(--p-button-sm-min-height);
22
+ }
23
+
24
+ .p-button-lg {
25
+ min-height: var(--p-button-lg-min-height);
26
+ }
27
+
28
+ .p-button.p-button-icon-only {
29
+ min-width: var(--p-button-icon-only-width);
30
+ }
31
+
32
+ .p-button-sm.p-button-icon-only {
33
+ min-width: var(--p-button-sm-icon-only-width);
34
+ }
35
+
36
+ .p-button-lg.p-button-icon-only {
37
+ min-width: var(--p-button-lg-icon-only-width);
38
+ }
39
+
40
+ .p-chip {
41
+ border-radius: var(--p-chip-remove-icon-border-radius);
42
+ }
43
+
44
+ .p-divider {
45
+ gap: var(--p-divider-content-gap);
46
+ }
47
+
48
+ .p-inputgroupaddon {
49
+ min-height: var(--p-inputgroup-addon-min-height);
50
+ }
51
+
52
+ .p-inputtext {
53
+ min-height: var(--p-inputtext-min-height);
54
+ }
55
+
56
+ .p-inputtext-sm {
57
+ min-height: var(--p-inputtext-sm-min-height);
58
+ }
59
+
60
+ .p-inputtext-lg {
61
+ min-height: var(--p-inputtext-lg-min-height);
62
+ }
63
+
64
+ .p-message {
65
+ min-height: var(--p-message-content-min-height);
66
+ }
67
+
68
+ .p-message-sm {
69
+ min-height: var(--p-message-content-sm-min-height);
70
+ }
71
+
72
+ .p-message-lg {
73
+ min-height: var(--p-message-content-lg-min-height);
74
+ }
75
+
76
+ .p-multiselect {
77
+ min-height: var(--p-multiselect-min-height);
78
+ }
79
+
80
+ .p-multiselect-sm {
81
+ min-height: var(--p-multiselect-sm-min-height);
82
+ }
83
+
84
+ .p-multiselect-lg {
85
+ min-height: var(--p-multiselect-lg-min-height);
86
+ }
87
+
88
+ .p-multiselect-label-container {
89
+ display: flex;
90
+ align-items: center;
91
+ }
92
+
93
+ .p-radiobutton {
94
+ gap: var(--p-radiobutton-gap);
95
+ border-radius: var(--p-radiobutton-border-radius);
96
+ }
97
+
98
+ .p-radiobutton-icon {
99
+ border-radius: var(--p-radiobutton-icon-border-radius);
100
+ }
101
+
102
+ .p-radiobutton-icon-sm {
103
+ border-radius: var(--p-radiobutton-icon-sm-border-radius);
104
+ }
105
+
106
+ .p-radiobutton-icon-lg {
107
+ border-radius: var(--p-radiobutton-icon-lg-border-radius);
108
+ }
109
+
110
+ .p-select {
111
+ min-height: var(--p-select-min-height);
112
+ }
113
+
114
+ .p-select-sm {
115
+ min-height: var(--p-select-sm-min-height);
116
+ }
117
+
118
+ .p-select-lg {
119
+ min-height: var(--p-select-lg-min-height);
120
+ }
121
+
122
+ .p-select-label {
123
+ display: flex;
124
+ align-items: center;
125
+ }
126
+
127
+ .p-select-option {
128
+ gap: var(--p-select-option-gap);
129
+ }
130
+
131
+ .p-tag-sm {
132
+ font-size: var(--p-tag-sm-font-size);
133
+ padding: var(--p-tag-sm-padding);
134
+ }
135
+
136
+ .p-tag-lg {
137
+ font-size: var(--p-tag-lg-font-size);
138
+ padding: var(--p-tag-lg-padding);
139
+ }
140
+
141
+ .p-tag-sm .p-tag-icon {
142
+ font-size: var(--p-tag-sm-icon-size);
143
+ }
144
+
145
+ .p-tag-lg .p-tag-icon {
146
+ font-size: var(--p-tag-lg-icon-size);
147
+ }
148
+
149
+ .p-textarea {
150
+ min-height: var(--p-textarea-min-height);
151
+ }
152
+
153
+ .p-togglebutton {
154
+ min-height: var(--p-togglebutton-min-height);
155
+ line-height: var(--p-togglebutton-line-height);
156
+ }
157
+
158
+ .p-togglebutton .p-togglebutton-sm {
159
+ min-height: var(--p-togglebutton-sm-min-height);
160
+ border-radius: var(--p-togglebutton-sm-border-radius);
161
+ }
162
+
163
+ .p-togglebutton-lg {
164
+ min-height: var(--p-togglebutton-lg-min-height);
165
+ }
166
+
167
+ .p-togglebutton .p-togglebutton-content {
168
+ min-height: var(--p-togglebutton-content-min-height);
169
+ }
170
+
171
+ .p-togglebutton-sm .p-togglebutton-content {
172
+ min-height: var(--p-togglebutton-content-sm-min-height);
173
+ border-radius: var(--p-togglebutton-content-sm-border-radius);
174
+ }
175
+
176
+ .p-togglebutton-lg .p-togglebutton-content {
177
+ min-height: var(--p-togglebutton-content-lg-min-height);
178
+ }
179
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bcc-code/design-tokens",
3
- "version": "3.0.13",
3
+ "version": "3.0.17",
4
4
  "description": "Design tokens build system",
5
5
  "type": "module",
6
6
  "exports": {
@@ -16,12 +16,14 @@
16
16
  "import": "./config/primevue.config.js",
17
17
  "types": "./config/primevue.config.d.ts"
18
18
  },
19
+ "./primevue/overrides": "./config/primevue-overrides.css",
19
20
  "./package.json": "./package.json"
20
21
  },
21
22
  "files": [
22
23
  "build/**/*",
23
24
  "config/primevue.config.js",
24
25
  "config/primevue.config.d.ts",
26
+ "config/primevue-overrides.css",
25
27
  "README.md",
26
28
  "package.json"
27
29
  ],
@@ -37,13 +39,10 @@
37
39
  },
38
40
  "homepage": "https://github.com/bcc-code/bcc-tokens#readme",
39
41
  "dependencies": {
40
- "@tokens-studio/sd-transforms": "^2.0.1",
42
+ "@tokens-studio/sd-transforms": "^2.0.2",
41
43
  "style-dictionary": "^5.0.1"
42
44
  },
43
45
  "peerDependencies": {
44
- "@primeuix/themes": "^1.1.1"
45
- },
46
- "overrides": {
47
- "tmp": "^0.2.4"
46
+ "@primeuix/themes": "^2.0.0"
48
47
  }
49
48
  }