@bcc-code/design-tokens 3.0.13 → 3.0.16

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,68 +24,43 @@ 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
- ```
81
-
82
- ### PrimeVue Integration
83
-
84
- Configure PrimeVue with BCC theme preset:
57
+ ### PrimeVue
85
58
 
86
59
  ```javascript
87
60
  import { createApp } from 'vue'
88
61
  import PrimeVue from 'primevue/config'
89
62
  import BCCPreset from '@bcc-code/design-tokens/primevue'
90
63
 
91
- const app = createApp(App)
92
-
93
64
  app.use(PrimeVue, {
94
65
  theme: {
95
66
  preset: BCCPreset,
@@ -102,150 +73,83 @@ app.use(PrimeVue, {
102
73
  })
103
74
  ```
104
75
 
105
- Enable dark mode by adding the `dark` class to your root element:
76
+ Toggle dark mode:
106
77
 
107
78
  ```javascript
108
- // Toggle dark mode
109
- 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
- }
79
+ document.documentElement.classList.toggle('dark');
116
80
  ```
117
81
 
118
82
  ## Token Categories
119
83
 
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
84
+ - **Colors**: Text, backgrounds, borders, states
85
+ - **Typography**: Font families, sizes, weights, line heights
86
+ - **Spacing**: Margins, padding, gaps
87
+ - **Border Radius**: Corner rounding
88
+ - **Elevation**: Surface levels
125
89
 
126
90
  ## CDN Usage
127
91
 
128
92
  ```html
129
- <!-- Auto-switching CSS variables with .dark class support (recommended) -->
93
+ <!-- CSS variables -->
130
94
  <link rel="stylesheet" href="https://unpkg.com/@bcc-code/design-tokens@latest/build/bcc/css/auto.css">
131
95
 
132
- <!-- Or Tailwind utilities with .dark class support -->
96
+ <!-- Tailwind utilities -->
133
97
  <link rel="stylesheet" href="https://unpkg.com/@bcc-code/design-tokens@latest/build/bcc/css/tailwind-auto.css">
134
98
 
135
- <!-- Then add JavaScript for theme switching -->
99
+ <!-- Theme toggle -->
136
100
  <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();
101
+ document.documentElement.classList.toggle('dark');
153
102
  </script>
154
103
  ```
155
104
 
156
- ## Contributing
105
+ ## Development
157
106
 
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
107
+ ```bash
108
+ git clone https://github.com/bcc-code/bcc-tokens.git
109
+ cd bcc-tokens
110
+ npm install
111
+ npm run build
112
+ ```
236
113
 
237
- ## Development
114
+ Run demo:
115
+
116
+ ```bash
117
+ cd demo
118
+ npm install
119
+ npm run dev
120
+ ```
121
+
122
+ Visit `http://localhost:5173`
238
123
 
239
- A comprehensive demo application is available in the `demo/` directory featuring:
124
+ ## Project Structure
240
125
 
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
126
+ ```
127
+ tokens/ # Source tokens (Figma Token Studio)
128
+ export-tokens/ # Build system
129
+ config/ # PrimeVue preset
130
+ build/bcc/ # Generated output
131
+ demo/ # Demo application
132
+ ```
133
+
134
+ ## Publishing
135
+
136
+ Automated via GitHub Actions when you push a version tag:
137
+
138
+ ```bash
139
+ # Update version in package.json
140
+ git add package.json
141
+ git commit -m "Bump version to X.X.X"
142
+ git push
143
+
144
+ # Create and push tag
145
+ git tag vX.X.X
146
+ git push origin vX.X.X
147
+ ```
148
+
149
+ ## Contributing
246
150
 
247
- Access the demo at `http://localhost:5173` after running `npm run dev` in the `demo/` directory.
151
+ See [CONTRIBUTING.md](CONTRIBUTING.md)
248
152
 
249
153
  ## License
250
154
 
251
- MIT © BCC Code
155
+ 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.16",
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
  }