@webmate-studio/builder 0.2.67 → 0.2.70
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/package.json +1 -1
- package/src/design-tokens.js +107 -5
package/package.json
CHANGED
package/src/design-tokens.js
CHANGED
|
@@ -12,7 +12,25 @@ function generateSemanticColorUtilities(tokens) {
|
|
|
12
12
|
const colorMap = {
|
|
13
13
|
// Brand colors
|
|
14
14
|
'primary': 'primary',
|
|
15
|
+
'primaryDark': 'primary-dark',
|
|
16
|
+
'primaryLight': 'primary-light',
|
|
15
17
|
'secondary': 'secondary',
|
|
18
|
+
'secondaryDark': 'secondary-dark',
|
|
19
|
+
'secondaryLight': 'secondary-light',
|
|
20
|
+
|
|
21
|
+
// Semantic state colors
|
|
22
|
+
'success': 'success',
|
|
23
|
+
'successDark': 'success-dark',
|
|
24
|
+
'successLight': 'success-light',
|
|
25
|
+
'warning': 'warning',
|
|
26
|
+
'warningDark': 'warning-dark',
|
|
27
|
+
'warningLight': 'warning-light',
|
|
28
|
+
'error': 'error',
|
|
29
|
+
'errorDark': 'error-dark',
|
|
30
|
+
'errorLight': 'error-light',
|
|
31
|
+
'info': 'info',
|
|
32
|
+
'infoDark': 'info-dark',
|
|
33
|
+
'infoLight': 'info-light',
|
|
16
34
|
|
|
17
35
|
// Base semantic colors
|
|
18
36
|
'bgBase': 'default',
|
|
@@ -91,12 +109,16 @@ export const defaultDesignTokens = {
|
|
|
91
109
|
// Semantic Colors
|
|
92
110
|
success: '#10b981',
|
|
93
111
|
successDark: '#059669',
|
|
112
|
+
successLight: '#d1fae5',
|
|
94
113
|
warning: '#f59e0b',
|
|
95
114
|
warningDark: '#d97706',
|
|
115
|
+
warningLight: '#fef3c7',
|
|
96
116
|
error: '#ef4444',
|
|
97
117
|
errorDark: '#dc2626',
|
|
118
|
+
errorLight: '#fee2e2',
|
|
98
119
|
info: '#3b82f6',
|
|
99
120
|
infoDark: '#2563eb',
|
|
121
|
+
infoLight: '#dbeafe',
|
|
100
122
|
|
|
101
123
|
// Background Colors (Semantic)
|
|
102
124
|
bgBase: '#ffffff',
|
|
@@ -198,6 +220,33 @@ export const defaultDesignTokens = {
|
|
|
198
220
|
textTransform: 'none',
|
|
199
221
|
textColor: 'textBase'
|
|
200
222
|
},
|
|
223
|
+
heading4: {
|
|
224
|
+
fontFamily: 'heading',
|
|
225
|
+
fontSize: '1.5rem', // 24px
|
|
226
|
+
fontWeight: 600,
|
|
227
|
+
lineHeight: '1.3',
|
|
228
|
+
letterSpacing: '0em',
|
|
229
|
+
textTransform: 'none',
|
|
230
|
+
textColor: 'textBase'
|
|
231
|
+
},
|
|
232
|
+
heading5: {
|
|
233
|
+
fontFamily: 'heading',
|
|
234
|
+
fontSize: '1.25rem', // 20px
|
|
235
|
+
fontWeight: 600,
|
|
236
|
+
lineHeight: '1.3',
|
|
237
|
+
letterSpacing: '0em',
|
|
238
|
+
textTransform: 'none',
|
|
239
|
+
textColor: 'textBase'
|
|
240
|
+
},
|
|
241
|
+
heading6: {
|
|
242
|
+
fontFamily: 'heading',
|
|
243
|
+
fontSize: '1.125rem', // 18px
|
|
244
|
+
fontWeight: 600,
|
|
245
|
+
lineHeight: '1.3',
|
|
246
|
+
letterSpacing: '0em',
|
|
247
|
+
textTransform: 'none',
|
|
248
|
+
textColor: 'textBase'
|
|
249
|
+
},
|
|
201
250
|
overlineDisplay: {
|
|
202
251
|
fontFamily: 'body',
|
|
203
252
|
fontSize: '1rem', // 16px
|
|
@@ -234,6 +283,33 @@ export const defaultDesignTokens = {
|
|
|
234
283
|
textTransform: 'uppercase',
|
|
235
284
|
textColor: 'textAccentSubtle'
|
|
236
285
|
},
|
|
286
|
+
overlineHeading4: {
|
|
287
|
+
fontFamily: 'body',
|
|
288
|
+
fontSize: '0.75rem', // 12px
|
|
289
|
+
fontWeight: 500,
|
|
290
|
+
lineHeight: '1.5',
|
|
291
|
+
letterSpacing: '0.08em',
|
|
292
|
+
textTransform: 'uppercase',
|
|
293
|
+
textColor: 'textAccentSubtle'
|
|
294
|
+
},
|
|
295
|
+
overlineHeading5: {
|
|
296
|
+
fontFamily: 'body',
|
|
297
|
+
fontSize: '0.6875rem', // 11px
|
|
298
|
+
fontWeight: 500,
|
|
299
|
+
lineHeight: '1.5',
|
|
300
|
+
letterSpacing: '0.08em',
|
|
301
|
+
textTransform: 'uppercase',
|
|
302
|
+
textColor: 'textAccentMuted'
|
|
303
|
+
},
|
|
304
|
+
overlineHeading6: {
|
|
305
|
+
fontFamily: 'body',
|
|
306
|
+
fontSize: '0.625rem', // 10px
|
|
307
|
+
fontWeight: 500,
|
|
308
|
+
lineHeight: '1.5',
|
|
309
|
+
letterSpacing: '0.08em',
|
|
310
|
+
textTransform: 'uppercase',
|
|
311
|
+
textColor: 'textAccentMuted'
|
|
312
|
+
},
|
|
237
313
|
lead: {
|
|
238
314
|
fontFamily: 'body',
|
|
239
315
|
fontSize: '1.25rem', // 20px
|
|
@@ -454,12 +530,16 @@ export function generateTailwindV4Theme(tokens) {
|
|
|
454
530
|
// Semantic colors
|
|
455
531
|
if (tokens.colors.success) lines.push(` --color-success: ${tokens.colors.success};`);
|
|
456
532
|
if (tokens.colors.successDark) lines.push(` --color-success-dark: ${tokens.colors.successDark};`);
|
|
533
|
+
if (tokens.colors.successLight) lines.push(` --color-success-light: ${tokens.colors.successLight};`);
|
|
457
534
|
if (tokens.colors.warning) lines.push(` --color-warning: ${tokens.colors.warning};`);
|
|
458
535
|
if (tokens.colors.warningDark) lines.push(` --color-warning-dark: ${tokens.colors.warningDark};`);
|
|
536
|
+
if (tokens.colors.warningLight) lines.push(` --color-warning-light: ${tokens.colors.warningLight};`);
|
|
459
537
|
if (tokens.colors.error) lines.push(` --color-error: ${tokens.colors.error};`);
|
|
460
538
|
if (tokens.colors.errorDark) lines.push(` --color-error-dark: ${tokens.colors.errorDark};`);
|
|
539
|
+
if (tokens.colors.errorLight) lines.push(` --color-error-light: ${tokens.colors.errorLight};`);
|
|
461
540
|
if (tokens.colors.info) lines.push(` --color-info: ${tokens.colors.info};`);
|
|
462
541
|
if (tokens.colors.infoDark) lines.push(` --color-info-dark: ${tokens.colors.infoDark};`);
|
|
542
|
+
if (tokens.colors.infoLight) lines.push(` --color-info-light: ${tokens.colors.infoLight};`);
|
|
463
543
|
|
|
464
544
|
// Background colors (Semantic)
|
|
465
545
|
if (tokens.colors.bgBase) lines.push(` --color-bg-base: ${tokens.colors.bgBase};`);
|
|
@@ -514,7 +594,13 @@ export function generateTailwindV4Theme(tokens) {
|
|
|
514
594
|
// Text Styles - Generate CSS variables for each style (with responsive support)
|
|
515
595
|
if (tokens.textStyles) {
|
|
516
596
|
for (const [styleName, style] of Object.entries(tokens.textStyles)) {
|
|
517
|
-
|
|
597
|
+
// Convert camelCase to kebab-case with numbers separated
|
|
598
|
+
// heading1 -> heading-1, overlineHeading2 -> overline-heading-2
|
|
599
|
+
const kebabName = styleName
|
|
600
|
+
.replace(/([A-Z])/g, '-$1') // Insert hyphen before capitals
|
|
601
|
+
.replace(/(\d+)/g, '-$1') // Insert hyphen before numbers
|
|
602
|
+
.toLowerCase()
|
|
603
|
+
.replace(/^-/, ''); // Remove leading hyphen
|
|
518
604
|
|
|
519
605
|
// Font family (not responsive)
|
|
520
606
|
if (style.fontFamily) {
|
|
@@ -654,7 +740,11 @@ body {
|
|
|
654
740
|
if (tokens.textStyles) {
|
|
655
741
|
globalStyles += '\n\n/* Text Style Utilities */';
|
|
656
742
|
for (const [styleName, style] of Object.entries(tokens.textStyles)) {
|
|
657
|
-
const kebabName = styleName
|
|
743
|
+
const kebabName = styleName
|
|
744
|
+
.replace(/([A-Z])/g, '-$1')
|
|
745
|
+
.replace(/(\d+)/g, '-$1')
|
|
746
|
+
.toLowerCase()
|
|
747
|
+
.replace(/^-/, '');
|
|
658
748
|
const className = `text-${kebabName}`;
|
|
659
749
|
|
|
660
750
|
globalStyles += `\n.${className} {`;
|
|
@@ -744,7 +834,11 @@ body {
|
|
|
744
834
|
const mediaQueryLines = [];
|
|
745
835
|
|
|
746
836
|
for (const [styleName, style] of Object.entries(tokens.textStyles)) {
|
|
747
|
-
const kebabName = styleName
|
|
837
|
+
const kebabName = styleName
|
|
838
|
+
.replace(/([A-Z])/g, '-$1')
|
|
839
|
+
.replace(/(\d+)/g, '-$1')
|
|
840
|
+
.toLowerCase()
|
|
841
|
+
.replace(/^-/, '');
|
|
748
842
|
|
|
749
843
|
// Font size
|
|
750
844
|
if (style.fontSize && typeof style.fontSize === 'object' && style.fontSize[bp]) {
|
|
@@ -947,7 +1041,11 @@ export function generateCSSFromTokens(tokens) {
|
|
|
947
1041
|
lines.push('');
|
|
948
1042
|
lines.push('/* Text Style Utilities */');
|
|
949
1043
|
for (const [styleName, style] of Object.entries(tokens.textStyles)) {
|
|
950
|
-
const kebabName = styleName
|
|
1044
|
+
const kebabName = styleName
|
|
1045
|
+
.replace(/([A-Z])/g, '-$1')
|
|
1046
|
+
.replace(/(\d+)/g, '-$1')
|
|
1047
|
+
.toLowerCase()
|
|
1048
|
+
.replace(/^-/, '');
|
|
951
1049
|
const className = `text-${kebabName}`;
|
|
952
1050
|
|
|
953
1051
|
lines.push(`.${className} {`);
|
|
@@ -993,7 +1091,11 @@ export function generateCSSFromTokens(tokens) {
|
|
|
993
1091
|
const mediaQueryLines = [];
|
|
994
1092
|
|
|
995
1093
|
for (const [styleName, style] of Object.entries(tokens.textStyles)) {
|
|
996
|
-
const kebabName = styleName
|
|
1094
|
+
const kebabName = styleName
|
|
1095
|
+
.replace(/([A-Z])/g, '-$1')
|
|
1096
|
+
.replace(/(\d+)/g, '-$1')
|
|
1097
|
+
.toLowerCase()
|
|
1098
|
+
.replace(/^-/, '');
|
|
997
1099
|
const className = `text-${kebabName}`;
|
|
998
1100
|
const hasResponsive = (
|
|
999
1101
|
(style.fontSize && typeof style.fontSize === 'object' && style.fontSize[bp]) ||
|