@phcdevworks/spectre-tokens 3.3.1 → 3.5.0
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 -2
- package/dist/index.cjs +77 -253
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +75 -60
- package/dist/index.js +77 -253
- package/dist/index.js.map +1 -1
- package/dist/tokens.dtcg.json +200 -80
- package/package.json +21 -15
package/dist/index.css
CHANGED
|
@@ -32,13 +32,10 @@
|
|
|
32
32
|
--sp-badge-info-bg-hover: #bae6fd;
|
|
33
33
|
--sp-badge-info-text: #075985;
|
|
34
34
|
--sp-badge-success-bg: #dcfce7;
|
|
35
|
-
--sp-badge-success-bg-hover: #bbf7d0;
|
|
36
35
|
--sp-badge-success-text: #15803d;
|
|
37
36
|
--sp-badge-warning-bg: #fff1c2;
|
|
38
|
-
--sp-badge-warning-bg-hover: #ffe08a;
|
|
39
37
|
--sp-badge-warning-text: #8f5200;
|
|
40
38
|
--sp-badge-danger-bg: #fee2e2;
|
|
41
|
-
--sp-badge-danger-bg-hover: #fecaca;
|
|
42
39
|
--sp-badge-danger-text: #b91c1c;
|
|
43
40
|
--sp-icon-box-bg: #ffffff;
|
|
44
41
|
--sp-icon-box-border: #d9dfeb;
|
|
@@ -46,6 +43,25 @@
|
|
|
46
43
|
--sp-icon-box-icon-success: #16a34a;
|
|
47
44
|
--sp-icon-box-icon-warning: #d48806;
|
|
48
45
|
--sp-icon-box-icon-danger: #dc2626;
|
|
46
|
+
--sp-testimonial-bg: #ffffff;
|
|
47
|
+
--sp-testimonial-bg-hover: #f7f8fb;
|
|
48
|
+
--sp-testimonial-border: #d9dfeb;
|
|
49
|
+
--sp-testimonial-text: #374253;
|
|
50
|
+
--sp-testimonial-author-name: #141b24;
|
|
51
|
+
--sp-testimonial-author-title: #4b576a;
|
|
52
|
+
--sp-testimonial-quote-mark: #4b576a;
|
|
53
|
+
--sp-pricing-card-bg: #ffffff;
|
|
54
|
+
--sp-pricing-card-bg-hover: #f7f8fb;
|
|
55
|
+
--sp-pricing-card-border: #d9dfeb;
|
|
56
|
+
--sp-pricing-card-featured-bg: #0369a1;
|
|
57
|
+
--sp-pricing-card-featured-text: #ffffff;
|
|
58
|
+
--sp-pricing-card-featured-badge-bg: #f5ad00;
|
|
59
|
+
--sp-pricing-card-featured-badge-text: #141b24;
|
|
60
|
+
--sp-pricing-card-price: #141b24;
|
|
61
|
+
--sp-pricing-card-price-description: #4b576a;
|
|
62
|
+
--sp-rating-star-filled: #f5ad00;
|
|
63
|
+
--sp-rating-star-empty: #d9dfeb;
|
|
64
|
+
--sp-rating-text: #657287;
|
|
49
65
|
--sp-nav-bg: #ffffff;
|
|
50
66
|
--sp-nav-text: #141b24;
|
|
51
67
|
--sp-nav-link: #374253;
|
|
@@ -102,10 +118,6 @@
|
|
|
102
118
|
--sp-select-disabled-bg: #f7f8fb;
|
|
103
119
|
--sp-select-disabled-border: #d9dfeb;
|
|
104
120
|
--sp-select-focus-border: #0ea5e9;
|
|
105
|
-
--sp-select-border-invalid: #ef4444;
|
|
106
|
-
--sp-select-bg-invalid: #fef2f2;
|
|
107
|
-
--sp-select-border-success: #22c55e;
|
|
108
|
-
--sp-select-bg-success: #f0fdf4;
|
|
109
121
|
--sp-textarea-bg: #ffffff;
|
|
110
122
|
--sp-textarea-border: #b7c1d4;
|
|
111
123
|
--sp-textarea-text: #141b24;
|
|
@@ -113,34 +125,22 @@
|
|
|
113
125
|
--sp-textarea-disabled-bg: #f7f8fb;
|
|
114
126
|
--sp-textarea-disabled-border: #d9dfeb;
|
|
115
127
|
--sp-textarea-focus-border: #0ea5e9;
|
|
116
|
-
--sp-textarea-border-invalid: #ef4444;
|
|
117
|
-
--sp-textarea-bg-invalid: #fef2f2;
|
|
118
|
-
--sp-textarea-border-success: #22c55e;
|
|
119
|
-
--sp-textarea-bg-success: #f0fdf4;
|
|
120
128
|
--sp-fieldset-border: #d9dfeb;
|
|
121
129
|
--sp-fieldset-legend-text: #141b24;
|
|
122
130
|
--sp-label-text: #141b24;
|
|
123
131
|
--sp-label-disabled-text: #8a96ad;
|
|
124
132
|
--sp-label-required-indicator-text: #dc2626;
|
|
125
|
-
--sp-
|
|
126
|
-
--sp-
|
|
127
|
-
--sp-
|
|
128
|
-
--sp-
|
|
129
|
-
--sp-
|
|
130
|
-
--sp-
|
|
131
|
-
--sp-
|
|
132
|
-
--sp-
|
|
133
|
-
--sp-
|
|
134
|
-
--sp-
|
|
135
|
-
--sp-
|
|
136
|
-
--sp-pricing-card-featured-text: #ffffff;
|
|
137
|
-
--sp-pricing-card-featured-badge-bg: #f5ad00;
|
|
138
|
-
--sp-pricing-card-featured-badge-text: #141b24;
|
|
139
|
-
--sp-pricing-card-price: #141b24;
|
|
140
|
-
--sp-pricing-card-price-description: #4b576a;
|
|
141
|
-
--sp-rating-star-filled: #f5ad00;
|
|
142
|
-
--sp-rating-star-empty: #d9dfeb;
|
|
143
|
-
--sp-rating-text: #657287;
|
|
133
|
+
--sp-badge-success-bg-hover: #bbf7d0;
|
|
134
|
+
--sp-badge-warning-bg-hover: #ffe08a;
|
|
135
|
+
--sp-badge-danger-bg-hover: #fecaca;
|
|
136
|
+
--sp-select-border-invalid: #ef4444;
|
|
137
|
+
--sp-select-bg-invalid: #fef2f2;
|
|
138
|
+
--sp-select-border-success: #22c55e;
|
|
139
|
+
--sp-select-bg-success: #f0fdf4;
|
|
140
|
+
--sp-textarea-border-invalid: #ef4444;
|
|
141
|
+
--sp-textarea-bg-invalid: #fef2f2;
|
|
142
|
+
--sp-textarea-border-success: #22c55e;
|
|
143
|
+
--sp-textarea-bg-success: #f0fdf4;
|
|
144
144
|
--sp-link-default: #1f57db;
|
|
145
145
|
--sp-link-hover: #1946b4;
|
|
146
146
|
--sp-link-active: #173b8f;
|
|
@@ -275,6 +275,20 @@
|
|
|
275
275
|
--sp-radius-3xl: 24px;
|
|
276
276
|
--sp-radius-4xl: 32px;
|
|
277
277
|
--sp-radius-pill: 999px;
|
|
278
|
+
--sp-icon-xs: 12px;
|
|
279
|
+
--sp-icon-sm: 16px;
|
|
280
|
+
--sp-icon-md: 20px;
|
|
281
|
+
--sp-icon-lg: 24px;
|
|
282
|
+
--sp-icon-xl: 32px;
|
|
283
|
+
--sp-icon-2xl: 40px;
|
|
284
|
+
--sp-icon-3xl: 48px;
|
|
285
|
+
--sp-aspect-ratio-square: 1/1;
|
|
286
|
+
--sp-aspect-ratio-video: 16/9;
|
|
287
|
+
--sp-aspect-ratio-classic: 3/2;
|
|
288
|
+
--sp-aspect-ratio-portrait: 3/4;
|
|
289
|
+
--sp-aspect-ratio-landscape: 4/3;
|
|
290
|
+
--sp-aspect-ratio-ultrawide: 21/9;
|
|
291
|
+
--sp-aspect-ratio-hero: 2/1;
|
|
278
292
|
--sp-font-family-sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
|
|
279
293
|
--sp-font-family-serif: 'Times New Roman', Times, serif;
|
|
280
294
|
--sp-font-family-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
|
|
@@ -367,6 +381,7 @@
|
|
|
367
381
|
--sp-min-touch-target: 44px;
|
|
368
382
|
--sp-min-text-size: 16px;
|
|
369
383
|
--sp-reduced-motion: 0.01ms;
|
|
384
|
+
--sp-forced-colors: auto;
|
|
370
385
|
--sp-button-primary-bg: #0369a1;
|
|
371
386
|
--sp-button-primary-bghover: #075985;
|
|
372
387
|
--sp-button-primary-bgactive: #0c4a6e;
|
|
@@ -526,13 +541,10 @@
|
|
|
526
541
|
--sp-badge-info-bg-hover: #075985;
|
|
527
542
|
--sp-badge-info-text: #e0f2fe;
|
|
528
543
|
--sp-badge-success-bg: #166534;
|
|
529
|
-
--sp-badge-success-bg-hover: #15803d;
|
|
530
544
|
--sp-badge-success-text: #dcfce7;
|
|
531
545
|
--sp-badge-warning-bg: #8f5200;
|
|
532
|
-
--sp-badge-warning-bg-hover: #8f5200;
|
|
533
546
|
--sp-badge-warning-text: #fff1c2;
|
|
534
547
|
--sp-badge-danger-bg: #991b1b;
|
|
535
|
-
--sp-badge-danger-bg-hover: #b91c1c;
|
|
536
548
|
--sp-badge-danger-text: #fee2e2;
|
|
537
549
|
--sp-icon-box-bg: #222b38;
|
|
538
550
|
--sp-icon-box-border: #374253;
|
|
@@ -540,6 +552,25 @@
|
|
|
540
552
|
--sp-icon-box-icon-success: #4ade80;
|
|
541
553
|
--sp-icon-box-icon-warning: #ffc21a;
|
|
542
554
|
--sp-icon-box-icon-danger: #f87171;
|
|
555
|
+
--sp-testimonial-bg: #222b38;
|
|
556
|
+
--sp-testimonial-bg-hover: #374253;
|
|
557
|
+
--sp-testimonial-border: #374253;
|
|
558
|
+
--sp-testimonial-text: #d9dfeb;
|
|
559
|
+
--sp-testimonial-author-name: #eef1f6;
|
|
560
|
+
--sp-testimonial-author-title: #b7c1d4;
|
|
561
|
+
--sp-testimonial-quote-mark: #b7c1d4;
|
|
562
|
+
--sp-pricing-card-bg: #222b38;
|
|
563
|
+
--sp-pricing-card-bg-hover: #374253;
|
|
564
|
+
--sp-pricing-card-border: #374253;
|
|
565
|
+
--sp-pricing-card-featured-bg: #0369a1;
|
|
566
|
+
--sp-pricing-card-featured-text: #ffffff;
|
|
567
|
+
--sp-pricing-card-featured-badge-bg: #f5ad00;
|
|
568
|
+
--sp-pricing-card-featured-badge-text: #141b24;
|
|
569
|
+
--sp-pricing-card-price: #eef1f6;
|
|
570
|
+
--sp-pricing-card-price-description: #b7c1d4;
|
|
571
|
+
--sp-rating-star-filled: #ffc21a;
|
|
572
|
+
--sp-rating-star-empty: #374253;
|
|
573
|
+
--sp-rating-text: #8a96ad;
|
|
543
574
|
--sp-nav-bg: #141b24;
|
|
544
575
|
--sp-nav-text: #f7f8fb;
|
|
545
576
|
--sp-nav-link: #b7c1d4;
|
|
@@ -596,10 +627,6 @@
|
|
|
596
627
|
--sp-select-disabled-bg: #141b24;
|
|
597
628
|
--sp-select-disabled-border: #374253;
|
|
598
629
|
--sp-select-focus-border: #38bdf8;
|
|
599
|
-
--sp-select-border-invalid: #ef4444;
|
|
600
|
-
--sp-select-bg-invalid: #fef2f2;
|
|
601
|
-
--sp-select-border-success: #22c55e;
|
|
602
|
-
--sp-select-bg-success: #f0fdf4;
|
|
603
630
|
--sp-textarea-bg: #222b38;
|
|
604
631
|
--sp-textarea-border: #4b576a;
|
|
605
632
|
--sp-textarea-text: #f7f8fb;
|
|
@@ -607,34 +634,22 @@
|
|
|
607
634
|
--sp-textarea-disabled-bg: #141b24;
|
|
608
635
|
--sp-textarea-disabled-border: #374253;
|
|
609
636
|
--sp-textarea-focus-border: #38bdf8;
|
|
610
|
-
--sp-textarea-border-invalid: #ef4444;
|
|
611
|
-
--sp-textarea-bg-invalid: #fef2f2;
|
|
612
|
-
--sp-textarea-border-success: #22c55e;
|
|
613
|
-
--sp-textarea-bg-success: #f0fdf4;
|
|
614
637
|
--sp-fieldset-border: #374253;
|
|
615
638
|
--sp-fieldset-legend-text: #f7f8fb;
|
|
616
639
|
--sp-label-text: #f7f8fb;
|
|
617
640
|
--sp-label-disabled-text: #4b576a;
|
|
618
641
|
--sp-label-required-indicator-text: #f87171;
|
|
619
|
-
--sp-
|
|
620
|
-
--sp-
|
|
621
|
-
--sp-
|
|
622
|
-
--sp-
|
|
623
|
-
--sp-
|
|
624
|
-
--sp-
|
|
625
|
-
--sp-
|
|
626
|
-
--sp-
|
|
627
|
-
--sp-
|
|
628
|
-
--sp-
|
|
629
|
-
--sp-
|
|
630
|
-
--sp-pricing-card-featured-text: #ffffff;
|
|
631
|
-
--sp-pricing-card-featured-badge-bg: #f5ad00;
|
|
632
|
-
--sp-pricing-card-featured-badge-text: #141b24;
|
|
633
|
-
--sp-pricing-card-price: #eef1f6;
|
|
634
|
-
--sp-pricing-card-price-description: #b7c1d4;
|
|
635
|
-
--sp-rating-star-filled: #ffc21a;
|
|
636
|
-
--sp-rating-star-empty: #374253;
|
|
637
|
-
--sp-rating-text: #8a96ad;
|
|
642
|
+
--sp-badge-success-bg-hover: #15803d;
|
|
643
|
+
--sp-badge-warning-bg-hover: #8f5200;
|
|
644
|
+
--sp-badge-danger-bg-hover: #b91c1c;
|
|
645
|
+
--sp-select-border-invalid: #ef4444;
|
|
646
|
+
--sp-select-bg-invalid: #fef2f2;
|
|
647
|
+
--sp-select-border-success: #22c55e;
|
|
648
|
+
--sp-select-bg-success: #f0fdf4;
|
|
649
|
+
--sp-textarea-border-invalid: #ef4444;
|
|
650
|
+
--sp-textarea-bg-invalid: #fef2f2;
|
|
651
|
+
--sp-textarea-border-success: #22c55e;
|
|
652
|
+
--sp-textarea-bg-success: #f0fdf4;
|
|
638
653
|
--sp-link-default: #1f57db;
|
|
639
654
|
--sp-link-hover: #1946b4;
|
|
640
655
|
--sp-link-active: #173b8f;
|
package/dist/index.js
CHANGED
|
@@ -1185,131 +1185,13 @@ var coreTokens = {
|
|
|
1185
1185
|
// src/css.ts
|
|
1186
1186
|
var DEFAULT_PREFIX = "sp";
|
|
1187
1187
|
var DEFAULT_SELECTOR = ":root";
|
|
1188
|
+
var LEGACY_COMPONENT_PREFIX_GROUPS = /* @__PURE__ */ new Set(["card", "input"]);
|
|
1188
1189
|
var formatKey = (segment) => segment.replace(/[^a-z0-9]+/gi, "-").replace(/^-+|-+$/g, "").toLowerCase();
|
|
1189
1190
|
var toVariableName = (prefix, ...parts) => {
|
|
1190
1191
|
const filtered = parts.filter(Boolean).map(formatKey);
|
|
1191
1192
|
return `--${prefix}-${filtered.join("-")}`;
|
|
1192
1193
|
};
|
|
1193
|
-
var
|
|
1194
|
-
{ variant: "neutral", bgKey: "neutralBg", bgHoverKey: "neutralBgHover", textKey: "neutralText" },
|
|
1195
|
-
{ variant: "info", bgKey: "infoBg", bgHoverKey: "infoBgHover", textKey: "infoText" },
|
|
1196
|
-
{ variant: "success", bgKey: "successBg", bgHoverKey: "successBgHover", textKey: "successText" },
|
|
1197
|
-
{ variant: "warning", bgKey: "warningBg", bgHoverKey: "warningBgHover", textKey: "warningText" },
|
|
1198
|
-
{ variant: "danger", bgKey: "dangerBg", bgHoverKey: "dangerBgHover", textKey: "dangerText" }
|
|
1199
|
-
];
|
|
1200
|
-
var ICON_BOX_FIELDS = [
|
|
1201
|
-
{ name: "bg", tokenKey: "bg" },
|
|
1202
|
-
{ name: "border", tokenKey: "border" },
|
|
1203
|
-
{ name: "icon-default", tokenKey: "iconDefault" },
|
|
1204
|
-
{ name: "icon-success", tokenKey: "iconSuccess" },
|
|
1205
|
-
{ name: "icon-warning", tokenKey: "iconWarning" },
|
|
1206
|
-
{ name: "icon-danger", tokenKey: "iconDanger" }
|
|
1207
|
-
];
|
|
1208
|
-
var NAV_FIELDS = [
|
|
1209
|
-
{ name: "bg", tokenKey: "bg" },
|
|
1210
|
-
{ name: "text", tokenKey: "text" },
|
|
1211
|
-
{ name: "link", tokenKey: "link" },
|
|
1212
|
-
{ name: "link-hover", tokenKey: "linkHover" },
|
|
1213
|
-
{ name: "link-active", tokenKey: "linkActive" },
|
|
1214
|
-
{ name: "border", tokenKey: "border" }
|
|
1215
|
-
];
|
|
1216
|
-
var MODAL_FIELDS = [
|
|
1217
|
-
{ name: "bg", tokenKey: "bg" },
|
|
1218
|
-
{ name: "shadow", tokenKey: "shadow" },
|
|
1219
|
-
{ name: "border", tokenKey: "border" },
|
|
1220
|
-
{ name: "overlay", tokenKey: "overlay" }
|
|
1221
|
-
];
|
|
1222
|
-
var TESTIMONIAL_FIELDS = [
|
|
1223
|
-
{ name: "bg", tokenKey: "bg" },
|
|
1224
|
-
{ name: "bg-hover", tokenKey: "bgHover" },
|
|
1225
|
-
{ name: "border", tokenKey: "border" },
|
|
1226
|
-
{ name: "text", tokenKey: "text" },
|
|
1227
|
-
{ name: "author-name", tokenKey: "authorName" },
|
|
1228
|
-
{ name: "author-title", tokenKey: "authorTitle" },
|
|
1229
|
-
{ name: "quote-mark", tokenKey: "quoteMark" }
|
|
1230
|
-
];
|
|
1231
|
-
var PRICING_CARD_FIELDS = [
|
|
1232
|
-
{ name: "bg", tokenKey: "bg" },
|
|
1233
|
-
{ name: "bg-hover", tokenKey: "bgHover" },
|
|
1234
|
-
{ name: "border", tokenKey: "border" },
|
|
1235
|
-
{ name: "featured-bg", tokenKey: "featuredBg" },
|
|
1236
|
-
{ name: "featured-text", tokenKey: "featuredText" },
|
|
1237
|
-
{ name: "featured-badge-bg", tokenKey: "featuredBadgeBg" },
|
|
1238
|
-
{ name: "featured-badge-text", tokenKey: "featuredBadgeText" },
|
|
1239
|
-
{ name: "price", tokenKey: "price" },
|
|
1240
|
-
{ name: "price-description", tokenKey: "priceDescription" }
|
|
1241
|
-
];
|
|
1242
|
-
var RATING_FIELDS = [
|
|
1243
|
-
{ name: "star-filled", tokenKey: "starFilled" },
|
|
1244
|
-
{ name: "star-empty", tokenKey: "starEmpty" },
|
|
1245
|
-
{ name: "text", tokenKey: "text" }
|
|
1246
|
-
];
|
|
1247
|
-
var TOAST_VARIANTS = ["success", "warning", "danger", "info"].map((variant) => ({
|
|
1248
|
-
variant,
|
|
1249
|
-
fields: [
|
|
1250
|
-
{ name: "bg", tokenKey: "bg" },
|
|
1251
|
-
{ name: "text", tokenKey: "text" },
|
|
1252
|
-
{ name: "border", tokenKey: "border" },
|
|
1253
|
-
{ name: "icon", tokenKey: "icon" }
|
|
1254
|
-
]
|
|
1255
|
-
}));
|
|
1256
|
-
var TOOLTIP_FIELDS = [
|
|
1257
|
-
{ name: "bg", tokenKey: "bg" },
|
|
1258
|
-
{ name: "text", tokenKey: "text" },
|
|
1259
|
-
{ name: "border", tokenKey: "border" }
|
|
1260
|
-
];
|
|
1261
|
-
var DROPDOWN_FIELDS = [
|
|
1262
|
-
{ name: "bg", modePath: ["bg"], aliasPath: ["bg"] },
|
|
1263
|
-
{ name: "border", modePath: ["border"], aliasPath: ["border"] },
|
|
1264
|
-
{ name: "item-default", modePath: ["item", "default"], aliasPath: ["item", "default"] },
|
|
1265
|
-
{ name: "item-hover", modePath: ["item", "hover"], aliasPath: ["item", "hover"] },
|
|
1266
|
-
{ name: "item-active", modePath: ["item", "active"], aliasPath: ["item", "active"] },
|
|
1267
|
-
{ name: "item-text", modePath: ["item", "text"], aliasPath: ["item", "text"] }
|
|
1268
|
-
];
|
|
1269
|
-
var SELECTION_CONTROL_FIELDS = [
|
|
1270
|
-
{ name: "bg", tokenKey: "bg" },
|
|
1271
|
-
{ name: "border", tokenKey: "border" },
|
|
1272
|
-
{ name: "checked-bg", tokenKey: "checkedBg" },
|
|
1273
|
-
{ name: "checked-border", tokenKey: "checkedBorder" },
|
|
1274
|
-
{ name: "text", tokenKey: "text" },
|
|
1275
|
-
{ name: "disabled-bg", tokenKey: "disabledBg" },
|
|
1276
|
-
{ name: "disabled-border", tokenKey: "disabledBorder" }
|
|
1277
|
-
];
|
|
1278
|
-
var SELECT_FIELDS = [
|
|
1279
|
-
{ name: "bg", tokenKey: "bg" },
|
|
1280
|
-
{ name: "border", tokenKey: "border" },
|
|
1281
|
-
{ name: "text", tokenKey: "text" },
|
|
1282
|
-
{ name: "placeholder-text", tokenKey: "placeholderText" },
|
|
1283
|
-
{ name: "disabled-bg", tokenKey: "disabledBg" },
|
|
1284
|
-
{ name: "disabled-border", tokenKey: "disabledBorder" },
|
|
1285
|
-
{ name: "focus-border", tokenKey: "focusBorder" },
|
|
1286
|
-
{ name: "border-invalid", tokenKey: "borderInvalid" },
|
|
1287
|
-
{ name: "bg-invalid", tokenKey: "bgInvalid" },
|
|
1288
|
-
{ name: "border-success", tokenKey: "borderSuccess" },
|
|
1289
|
-
{ name: "bg-success", tokenKey: "bgSuccess" }
|
|
1290
|
-
];
|
|
1291
|
-
var TEXTAREA_FIELDS = [
|
|
1292
|
-
{ name: "bg", tokenKey: "bg" },
|
|
1293
|
-
{ name: "border", tokenKey: "border" },
|
|
1294
|
-
{ name: "text", tokenKey: "text" },
|
|
1295
|
-
{ name: "placeholder", tokenKey: "placeholder" },
|
|
1296
|
-
{ name: "disabled-bg", tokenKey: "disabledBg" },
|
|
1297
|
-
{ name: "disabled-border", tokenKey: "disabledBorder" },
|
|
1298
|
-
{ name: "focus-border", tokenKey: "focusBorder" },
|
|
1299
|
-
{ name: "border-invalid", tokenKey: "borderInvalid" },
|
|
1300
|
-
{ name: "bg-invalid", tokenKey: "bgInvalid" },
|
|
1301
|
-
{ name: "border-success", tokenKey: "borderSuccess" },
|
|
1302
|
-
{ name: "bg-success", tokenKey: "bgSuccess" }
|
|
1303
|
-
];
|
|
1304
|
-
var FIELDSET_FIELDS = [
|
|
1305
|
-
{ name: "border", tokenKey: "border" },
|
|
1306
|
-
{ name: "legend-text", tokenKey: "legendText" }
|
|
1307
|
-
];
|
|
1308
|
-
var LABEL_FIELDS = [
|
|
1309
|
-
{ name: "text", tokenKey: "text" },
|
|
1310
|
-
{ name: "disabled-text", tokenKey: "disabledText" },
|
|
1311
|
-
{ name: "required-indicator-text", tokenKey: "requiredIndicatorText" }
|
|
1312
|
-
];
|
|
1194
|
+
var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1313
1195
|
var resolveTokenReference = (tokens2, reference) => {
|
|
1314
1196
|
const path = reference.slice(1, -1).split(".");
|
|
1315
1197
|
let current = tokens2;
|
|
@@ -1347,14 +1229,21 @@ var resolveValue = (tokens2, value) => {
|
|
|
1347
1229
|
str = str.replace(opacityRegex, (match, hex, opacity) => hexToRgba(hex, opacity));
|
|
1348
1230
|
return str;
|
|
1349
1231
|
};
|
|
1350
|
-
var resolveSemanticValue = (value, tokens2) => {
|
|
1232
|
+
var resolveSemanticValue = (value, tokens2, path) => {
|
|
1233
|
+
if (value === void 0) return void 0;
|
|
1351
1234
|
if (typeof value === "string" || typeof value === "number") {
|
|
1352
1235
|
return resolveValue(tokens2, value);
|
|
1353
1236
|
}
|
|
1354
|
-
if (value
|
|
1355
|
-
|
|
1237
|
+
if (isPlainObject(value)) {
|
|
1238
|
+
if ("value" in value) {
|
|
1239
|
+
return resolveValue(tokens2, value.value);
|
|
1240
|
+
}
|
|
1241
|
+
if ("metadata" in value || "description" in value) {
|
|
1242
|
+
throw new Error(`Unsupported token value shape at "${path ?? "(unknown path)"}": expected a string, number, or { value } wrapper.`);
|
|
1243
|
+
}
|
|
1244
|
+
return void 0;
|
|
1356
1245
|
}
|
|
1357
|
-
|
|
1246
|
+
throw new Error(`Unsupported token value shape at "${path ?? "(unknown path)"}": ${JSON.stringify(value)}`);
|
|
1358
1247
|
};
|
|
1359
1248
|
var getPath = (source, path) => path.reduce((acc, key) => acc && typeof acc === "object" ? acc[key] : void 0, source);
|
|
1360
1249
|
var pickSemantic = (tokens2, ...candidates) => {
|
|
@@ -1439,6 +1328,18 @@ var createCssVariableMap = (tokens2, options = {}) => {
|
|
|
1439
1328
|
Object.entries(baseTokens.radii).forEach(([key, value]) => {
|
|
1440
1329
|
assign(toVariableName(prefix, "radius", key), value);
|
|
1441
1330
|
});
|
|
1331
|
+
const icons = baseTokens.icons;
|
|
1332
|
+
if (icons) {
|
|
1333
|
+
Object.entries(icons).forEach(([key, value]) => {
|
|
1334
|
+
assign(toVariableName(prefix, "icon", key), value);
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
const aspectRatios = baseTokens.aspectRatios;
|
|
1338
|
+
if (aspectRatios) {
|
|
1339
|
+
Object.entries(aspectRatios).forEach(([key, value]) => {
|
|
1340
|
+
assign(toVariableName(prefix, "aspect-ratio", key), value);
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1442
1343
|
Object.entries(baseTokens.typography.families).forEach(([key, value]) => {
|
|
1443
1344
|
assign(toVariableName(prefix, "font-family", key), value);
|
|
1444
1345
|
});
|
|
@@ -1485,6 +1386,7 @@ var createCssVariableMap = (tokens2, options = {}) => {
|
|
|
1485
1386
|
assign(toVariableName(prefix, "min-touch-target"), baseTokens.accessibility.minTouchTarget);
|
|
1486
1387
|
assign(toVariableName(prefix, "min-text-size"), baseTokens.accessibility.minTextSize);
|
|
1487
1388
|
assign(toVariableName(prefix, "reduced-motion"), baseTokens.accessibility.reducedMotion);
|
|
1389
|
+
assign(toVariableName(prefix, "forced-colors"), baseTokens.accessibility.forcedColors);
|
|
1488
1390
|
Object.entries(baseTokens.buttons).forEach(([variant, states]) => {
|
|
1489
1391
|
Object.entries(states).forEach(([state, value]) => {
|
|
1490
1392
|
assign(toVariableName(prefix, "button", variant, state), value);
|
|
@@ -1526,129 +1428,7 @@ var generateCssVariables = (tokens2, options = {}) => {
|
|
|
1526
1428
|
const textAliases = tokens2.text ?? {};
|
|
1527
1429
|
const componentAliases = tokens2.component ?? {};
|
|
1528
1430
|
const linkTokens = tokens2.link ?? {};
|
|
1529
|
-
const
|
|
1530
|
-
{ varParts: ["surface", "page"], modePath: ["surface", "page"], aliasSrc: surfaceAliases, aliasPath: ["page"] },
|
|
1531
|
-
{ varParts: ["surface", "card"], modePath: ["surface", "card"], aliasSrc: surfaceAliases, aliasPath: ["card"] },
|
|
1532
|
-
{ varParts: ["surface", "input"], modePath: ["surface", "input"], aliasSrc: surfaceAliases, aliasPath: ["input"] },
|
|
1533
|
-
{ varParts: ["surface", "overlay"], modePath: ["surface", "overlay"], aliasSrc: surfaceAliases, aliasPath: ["overlay"] },
|
|
1534
|
-
{ varParts: ["surface", "subtle"], modePath: ["surface", "subtle"] },
|
|
1535
|
-
{ varParts: ["surface", "hero"], modePath: ["surface", "hero"], aliasSrc: surfaceAliases, aliasPath: ["hero"] },
|
|
1536
|
-
{ varParts: ["surface", "hover"], modePath: ["surface", "hover"], aliasSrc: surfaceAliases, aliasPath: ["hover"] },
|
|
1537
|
-
{ varParts: ["surface", "selected"], modePath: ["surface", "selected"], aliasSrc: surfaceAliases, aliasPath: ["selected"] },
|
|
1538
|
-
{ varParts: ["surface", "active"], modePath: ["surface", "active"], aliasSrc: surfaceAliases, aliasPath: ["active"] },
|
|
1539
|
-
{ varParts: ["surface", "divider"], modePath: ["surface", "divider"], aliasSrc: surfaceAliases, aliasPath: ["divider"] },
|
|
1540
|
-
{ varParts: ["text", "on", "page", "default"], modePath: ["text", "onPage", "default"], aliasSrc: textAliases, aliasPath: ["onPage", "default"] },
|
|
1541
|
-
{ varParts: ["text", "on", "page", "muted"], modePath: ["text", "onPage", "muted"], aliasSrc: textAliases, aliasPath: ["onPage", "muted"] },
|
|
1542
|
-
{ varParts: ["text", "on", "page", "subtle"], modePath: ["text", "onPage", "subtle"], aliasSrc: textAliases, aliasPath: ["onPage", "subtle"] },
|
|
1543
|
-
{ varParts: ["text", "on", "page", "meta"], modePath: ["text", "onPage", "meta"], aliasSrc: textAliases, aliasPath: ["onPage", "meta"] },
|
|
1544
|
-
{ varParts: ["text", "on", "page", "brand"], modePath: ["text", "onPage", "brand"], aliasSrc: textAliases, aliasPath: ["onPage", "brand"] },
|
|
1545
|
-
{ varParts: ["text", "on", "surface", "default"], modePath: ["text", "onSurface", "default"], aliasSrc: textAliases, aliasPath: ["onSurface", "default"] },
|
|
1546
|
-
{ varParts: ["text", "on", "surface", "muted"], modePath: ["text", "onSurface", "muted"], aliasSrc: textAliases, aliasPath: ["onSurface", "muted"] },
|
|
1547
|
-
{ varParts: ["text", "on", "surface", "subtle"], modePath: ["text", "onSurface", "subtle"], aliasSrc: textAliases, aliasPath: ["onSurface", "subtle"] },
|
|
1548
|
-
{ varParts: ["text", "on", "surface", "meta"], modePath: ["text", "onSurface", "meta"], aliasSrc: textAliases, aliasPath: ["onSurface", "meta"] },
|
|
1549
|
-
{ varParts: ["text", "on", "surface", "brand"], modePath: ["text", "onSurface", "brand"], aliasSrc: textAliases, aliasPath: ["onSurface", "brand"] },
|
|
1550
|
-
{ varParts: ["component", "card", "text"], modePath: ["component", "card", "text"], aliasSrc: componentAliases, aliasPath: ["card", "text"] },
|
|
1551
|
-
{ varParts: ["component", "card", "text-muted"], modePath: ["component", "card", "textMuted"], aliasSrc: componentAliases, aliasPath: ["card", "textMuted"] },
|
|
1552
|
-
{ varParts: ["component", "input", "text"], modePath: ["component", "input", "text"], aliasSrc: componentAliases, aliasPath: ["input", "text"] },
|
|
1553
|
-
{ varParts: ["component", "input", "placeholder"], modePath: ["component", "input", "placeholder"], aliasSrc: componentAliases, aliasPath: ["input", "placeholder"] },
|
|
1554
|
-
{ varParts: ["button", "text", "default"], modePath: ["component", "button", "textDefault"], aliasSrc: componentAliases, aliasPath: ["button", "textDefault"] },
|
|
1555
|
-
{ varParts: ["button", "text", "on", "primary"], modePath: ["component", "button", "textOnPrimary"], aliasSrc: componentAliases, aliasPath: ["button", "textOnPrimary"] },
|
|
1556
|
-
...BADGE_VARIANTS.flatMap(({ variant, bgKey, bgHoverKey, textKey }) => [
|
|
1557
|
-
{ varParts: ["badge", variant, "bg"], modePath: ["component", "badge", bgKey], aliasSrc: componentAliases, aliasPath: ["badge", bgKey] },
|
|
1558
|
-
{ varParts: ["badge", variant, "bg-hover"], modePath: ["component", "badge", bgHoverKey], aliasSrc: componentAliases, aliasPath: ["badge", bgHoverKey] },
|
|
1559
|
-
{ varParts: ["badge", variant, "text"], modePath: ["component", "badge", textKey], aliasSrc: componentAliases, aliasPath: ["badge", textKey] }
|
|
1560
|
-
]),
|
|
1561
|
-
...ICON_BOX_FIELDS.map(({ name, tokenKey }) => ({
|
|
1562
|
-
varParts: ["icon-box", name],
|
|
1563
|
-
modePath: ["component", "iconBox", tokenKey],
|
|
1564
|
-
aliasSrc: componentAliases,
|
|
1565
|
-
aliasPath: ["iconBox", tokenKey]
|
|
1566
|
-
})),
|
|
1567
|
-
...NAV_FIELDS.map(({ name, tokenKey }) => ({
|
|
1568
|
-
varParts: ["nav", name],
|
|
1569
|
-
modePath: ["component", "nav", tokenKey],
|
|
1570
|
-
aliasSrc: componentAliases,
|
|
1571
|
-
aliasPath: ["nav", tokenKey]
|
|
1572
|
-
})),
|
|
1573
|
-
...MODAL_FIELDS.map(({ name, tokenKey }) => ({
|
|
1574
|
-
varParts: ["modal", name],
|
|
1575
|
-
modePath: ["component", "modal", tokenKey],
|
|
1576
|
-
aliasSrc: componentAliases,
|
|
1577
|
-
aliasPath: ["modal", tokenKey]
|
|
1578
|
-
})),
|
|
1579
|
-
...TOAST_VARIANTS.flatMap(({ variant, fields }) => fields.map(({ name, tokenKey }) => ({
|
|
1580
|
-
varParts: ["toast", variant, name],
|
|
1581
|
-
modePath: ["component", "toast", variant, tokenKey],
|
|
1582
|
-
aliasSrc: componentAliases,
|
|
1583
|
-
aliasPath: ["toast", variant, tokenKey]
|
|
1584
|
-
}))),
|
|
1585
|
-
...TOOLTIP_FIELDS.map(({ name, tokenKey }) => ({
|
|
1586
|
-
varParts: ["tooltip", name],
|
|
1587
|
-
modePath: ["component", "tooltip", tokenKey],
|
|
1588
|
-
aliasSrc: componentAliases,
|
|
1589
|
-
aliasPath: ["tooltip", tokenKey]
|
|
1590
|
-
})),
|
|
1591
|
-
...DROPDOWN_FIELDS.map(({ name, modePath, aliasPath }) => ({
|
|
1592
|
-
varParts: ["dropdown", name],
|
|
1593
|
-
modePath: ["component", "dropdown", ...modePath],
|
|
1594
|
-
aliasSrc: componentAliases,
|
|
1595
|
-
aliasPath: ["dropdown", ...aliasPath]
|
|
1596
|
-
})),
|
|
1597
|
-
...SELECTION_CONTROL_FIELDS.map(({ name, tokenKey }) => ({
|
|
1598
|
-
varParts: ["checkbox", name],
|
|
1599
|
-
modePath: ["component", "checkbox", tokenKey],
|
|
1600
|
-
aliasSrc: componentAliases,
|
|
1601
|
-
aliasPath: ["checkbox", tokenKey]
|
|
1602
|
-
})),
|
|
1603
|
-
...SELECTION_CONTROL_FIELDS.map(({ name, tokenKey }) => ({
|
|
1604
|
-
varParts: ["radio", name],
|
|
1605
|
-
modePath: ["component", "radio", tokenKey],
|
|
1606
|
-
aliasSrc: componentAliases,
|
|
1607
|
-
aliasPath: ["radio", tokenKey]
|
|
1608
|
-
})),
|
|
1609
|
-
...SELECT_FIELDS.map(({ name, tokenKey }) => ({
|
|
1610
|
-
varParts: ["select", name],
|
|
1611
|
-
modePath: ["component", "select", tokenKey],
|
|
1612
|
-
aliasSrc: componentAliases,
|
|
1613
|
-
aliasPath: ["select", tokenKey]
|
|
1614
|
-
})),
|
|
1615
|
-
...TEXTAREA_FIELDS.map(({ name, tokenKey }) => ({
|
|
1616
|
-
varParts: ["textarea", name],
|
|
1617
|
-
modePath: ["component", "textarea", tokenKey],
|
|
1618
|
-
aliasSrc: componentAliases,
|
|
1619
|
-
aliasPath: ["textarea", tokenKey]
|
|
1620
|
-
})),
|
|
1621
|
-
...FIELDSET_FIELDS.map(({ name, tokenKey }) => ({
|
|
1622
|
-
varParts: ["fieldset", name],
|
|
1623
|
-
modePath: ["component", "fieldset", tokenKey],
|
|
1624
|
-
aliasSrc: componentAliases,
|
|
1625
|
-
aliasPath: ["fieldset", tokenKey]
|
|
1626
|
-
})),
|
|
1627
|
-
...LABEL_FIELDS.map(({ name, tokenKey }) => ({
|
|
1628
|
-
varParts: ["label", name],
|
|
1629
|
-
modePath: ["component", "label", tokenKey],
|
|
1630
|
-
aliasSrc: componentAliases,
|
|
1631
|
-
aliasPath: ["label", tokenKey]
|
|
1632
|
-
})),
|
|
1633
|
-
...TESTIMONIAL_FIELDS.map(({ name, tokenKey }) => ({
|
|
1634
|
-
varParts: ["testimonial", name],
|
|
1635
|
-
modePath: ["component", "testimonial", tokenKey],
|
|
1636
|
-
aliasSrc: componentAliases,
|
|
1637
|
-
aliasPath: ["testimonial", tokenKey]
|
|
1638
|
-
})),
|
|
1639
|
-
...PRICING_CARD_FIELDS.map(({ name, tokenKey }) => ({
|
|
1640
|
-
varParts: ["pricing-card", name],
|
|
1641
|
-
modePath: ["component", "pricingCard", tokenKey],
|
|
1642
|
-
aliasSrc: componentAliases,
|
|
1643
|
-
aliasPath: ["pricingCard", tokenKey]
|
|
1644
|
-
})),
|
|
1645
|
-
...RATING_FIELDS.map(({ name, tokenKey }) => ({
|
|
1646
|
-
varParts: ["rating", name],
|
|
1647
|
-
modePath: ["component", "rating", tokenKey],
|
|
1648
|
-
aliasSrc: componentAliases,
|
|
1649
|
-
aliasPath: ["rating", tokenKey]
|
|
1650
|
-
}))
|
|
1651
|
-
];
|
|
1431
|
+
const componentVarParts = (group, kebabGroup, path) => LEGACY_COMPONENT_PREFIX_GROUPS.has(group) ? ["component", kebabGroup, ...path] : [kebabGroup, ...path];
|
|
1652
1432
|
const baseLines = [];
|
|
1653
1433
|
const darkLines = [];
|
|
1654
1434
|
const addBase = (name, value) => {
|
|
@@ -1657,12 +1437,56 @@ var generateCssVariables = (tokens2, options = {}) => {
|
|
|
1657
1437
|
const addDark = (name, value) => {
|
|
1658
1438
|
if (value !== void 0) darkLines.push(` ${name}: ${value};`);
|
|
1659
1439
|
};
|
|
1660
|
-
|
|
1661
|
-
const
|
|
1662
|
-
const
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1440
|
+
const walkSemanticGroup = (namespace, varPartsFor, aliasSrc) => {
|
|
1441
|
+
const defaultNode = defaultMode[namespace];
|
|
1442
|
+
const darkNode = darkMode[namespace];
|
|
1443
|
+
const paths = /* @__PURE__ */ new Set();
|
|
1444
|
+
const collectPaths = (node, path) => {
|
|
1445
|
+
if (node === void 0) return;
|
|
1446
|
+
const leaf = resolveSemanticValue(node, tokens2, [namespace, ...path].join("."));
|
|
1447
|
+
if (leaf !== void 0) {
|
|
1448
|
+
paths.add(path.join("."));
|
|
1449
|
+
return;
|
|
1450
|
+
}
|
|
1451
|
+
if (isPlainObject(node)) {
|
|
1452
|
+
Object.keys(node).forEach((key) => collectPaths(node[key], [...path, key]));
|
|
1453
|
+
}
|
|
1454
|
+
};
|
|
1455
|
+
collectPaths(defaultNode, []);
|
|
1456
|
+
collectPaths(darkNode, []);
|
|
1457
|
+
collectPaths(aliasSrc, []);
|
|
1458
|
+
paths.forEach((joinedPath) => {
|
|
1459
|
+
const path = joinedPath.split(".");
|
|
1460
|
+
const varName = toVariableName(prefix, ...varPartsFor(path));
|
|
1461
|
+
const aliasCandidate = getPath(aliasSrc, path);
|
|
1462
|
+
const baseValue = pickSemantic(tokens2, getPath(defaultNode, path), aliasCandidate);
|
|
1463
|
+
const darkValue = pickSemantic(tokens2, getPath(darkNode, path), getPath(defaultNode, path), aliasCandidate);
|
|
1464
|
+
addBase(varName, baseValue);
|
|
1465
|
+
addDark(varName, darkValue);
|
|
1466
|
+
});
|
|
1467
|
+
};
|
|
1468
|
+
const kebabPathSegment = (segment) => formatKey(segment.replace(/([a-z0-9])([A-Z])/g, "$1-$2"));
|
|
1469
|
+
walkSemanticGroup(
|
|
1470
|
+
"surface",
|
|
1471
|
+
(path) => ["surface", ...path.map(kebabPathSegment)],
|
|
1472
|
+
surfaceAliases
|
|
1473
|
+
);
|
|
1474
|
+
walkSemanticGroup(
|
|
1475
|
+
"text",
|
|
1476
|
+
(path) => {
|
|
1477
|
+
const [scope, ...rest] = path;
|
|
1478
|
+
return ["text", ...kebabPathSegment(scope).split("-"), ...rest.map(kebabPathSegment)];
|
|
1479
|
+
},
|
|
1480
|
+
textAliases
|
|
1481
|
+
);
|
|
1482
|
+
walkSemanticGroup(
|
|
1483
|
+
"component",
|
|
1484
|
+
(path) => {
|
|
1485
|
+
const [group, ...rest] = path;
|
|
1486
|
+
return componentVarParts(group, kebabPathSegment(group), rest.map(kebabPathSegment));
|
|
1487
|
+
},
|
|
1488
|
+
componentAliases
|
|
1489
|
+
);
|
|
1666
1490
|
Object.entries(linkTokens).forEach(([key, value]) => {
|
|
1667
1491
|
const varName = toVariableName(prefix, "link", key);
|
|
1668
1492
|
const resolved = pickSemantic(tokens2, value);
|