rafters 0.0.63 → 0.0.65
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/dist/index.js +588 -610
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18394,94 +18394,6 @@ function generateHarmony(baseColor) {
|
|
|
18394
18394
|
monochromatic
|
|
18395
18395
|
};
|
|
18396
18396
|
}
|
|
18397
|
-
function generateSemanticColorSuggestions(baseColor) {
|
|
18398
|
-
const danger = [
|
|
18399
|
-
roundOKLCH({
|
|
18400
|
-
l: Math.max(0.55, Math.min(0.7, baseColor.l + 0.1)),
|
|
18401
|
-
c: Math.min(0.25, baseColor.c * 1.2),
|
|
18402
|
-
h: 15,
|
|
18403
|
-
alpha: 1
|
|
18404
|
-
}),
|
|
18405
|
-
roundOKLCH({
|
|
18406
|
-
l: Math.max(0.6, Math.min(0.75, baseColor.l + 0.15)),
|
|
18407
|
-
c: Math.min(0.22, baseColor.c * 1.1),
|
|
18408
|
-
h: 25,
|
|
18409
|
-
alpha: 1
|
|
18410
|
-
}),
|
|
18411
|
-
roundOKLCH({
|
|
18412
|
-
l: Math.max(0.5, Math.min(0.65, baseColor.l + 0.05)),
|
|
18413
|
-
c: Math.min(0.23, baseColor.c * 1.15),
|
|
18414
|
-
h: 5,
|
|
18415
|
-
alpha: 1
|
|
18416
|
-
})
|
|
18417
|
-
];
|
|
18418
|
-
const success2 = [
|
|
18419
|
-
roundOKLCH({
|
|
18420
|
-
l: Math.max(0.6, Math.min(0.75, baseColor.l + 0.15)),
|
|
18421
|
-
c: Math.min(0.2, baseColor.c * 0.9),
|
|
18422
|
-
h: 135,
|
|
18423
|
-
alpha: 1
|
|
18424
|
-
}),
|
|
18425
|
-
roundOKLCH({
|
|
18426
|
-
l: Math.max(0.55, Math.min(0.7, baseColor.l + 0.1)),
|
|
18427
|
-
c: Math.min(0.22, baseColor.c * 1),
|
|
18428
|
-
h: 145,
|
|
18429
|
-
alpha: 1
|
|
18430
|
-
}),
|
|
18431
|
-
roundOKLCH({
|
|
18432
|
-
l: Math.max(0.65, Math.min(0.8, baseColor.l + 0.2)),
|
|
18433
|
-
c: Math.min(0.24, baseColor.c * 1.1),
|
|
18434
|
-
h: 125,
|
|
18435
|
-
alpha: 1
|
|
18436
|
-
})
|
|
18437
|
-
];
|
|
18438
|
-
const warning = [
|
|
18439
|
-
roundOKLCH({
|
|
18440
|
-
l: Math.max(0.7, Math.min(0.8, baseColor.l + 0.15)),
|
|
18441
|
-
c: Math.min(0.2, baseColor.c * 0.95),
|
|
18442
|
-
h: 45,
|
|
18443
|
-
alpha: 1
|
|
18444
|
-
}),
|
|
18445
|
-
roundOKLCH({
|
|
18446
|
-
l: Math.max(0.75, Math.min(0.85, baseColor.l + 0.2)),
|
|
18447
|
-
c: Math.min(0.18, baseColor.c * 0.9),
|
|
18448
|
-
h: 55,
|
|
18449
|
-
alpha: 1
|
|
18450
|
-
}),
|
|
18451
|
-
roundOKLCH({
|
|
18452
|
-
l: Math.max(0.72, Math.min(0.82, baseColor.l + 0.17)),
|
|
18453
|
-
c: Math.min(0.19, baseColor.c * 0.92),
|
|
18454
|
-
h: 35,
|
|
18455
|
-
alpha: 1
|
|
18456
|
-
})
|
|
18457
|
-
];
|
|
18458
|
-
const info = [
|
|
18459
|
-
roundOKLCH({
|
|
18460
|
-
l: Math.max(0.6, Math.min(0.75, baseColor.l + 0.1)),
|
|
18461
|
-
c: Math.min(0.2, baseColor.c * 0.9),
|
|
18462
|
-
h: 220,
|
|
18463
|
-
alpha: 1
|
|
18464
|
-
}),
|
|
18465
|
-
roundOKLCH({
|
|
18466
|
-
l: Math.max(0.55, Math.min(0.7, baseColor.l + 0.05)),
|
|
18467
|
-
c: Math.min(0.22, baseColor.c * 1),
|
|
18468
|
-
h: 230,
|
|
18469
|
-
alpha: 1
|
|
18470
|
-
}),
|
|
18471
|
-
roundOKLCH({
|
|
18472
|
-
l: Math.max(0.5, Math.min(0.65, baseColor.l)),
|
|
18473
|
-
c: Math.min(0.25, baseColor.c * 1.1),
|
|
18474
|
-
h: 240,
|
|
18475
|
-
alpha: 1
|
|
18476
|
-
})
|
|
18477
|
-
];
|
|
18478
|
-
return {
|
|
18479
|
-
danger: danger.map(clampColor),
|
|
18480
|
-
success: success2.map(clampColor),
|
|
18481
|
-
warning: warning.map(clampColor),
|
|
18482
|
-
info: info.map(clampColor)
|
|
18483
|
-
};
|
|
18484
|
-
}
|
|
18485
18397
|
function validateScaleGeneration(baseColor) {
|
|
18486
18398
|
const l = baseColor.l;
|
|
18487
18399
|
if (l > 0.85) {
|
|
@@ -21213,44 +21125,255 @@ var POSITION_TO_INDEX = SCALE_POSITIONS.reduce(
|
|
|
21213
21125
|
},
|
|
21214
21126
|
{}
|
|
21215
21127
|
);
|
|
21216
|
-
|
|
21217
|
-
|
|
21218
|
-
|
|
21219
|
-
|
|
21128
|
+
|
|
21129
|
+
// ../color-utils/src/semantic.ts
|
|
21130
|
+
var SemanticSelectionError = class extends Error {
|
|
21131
|
+
constructor(familyName, message) {
|
|
21132
|
+
super(`semantic selection: family "${familyName}" ${message}`);
|
|
21133
|
+
this.familyName = familyName;
|
|
21134
|
+
this.name = "SemanticSelectionError";
|
|
21135
|
+
}
|
|
21136
|
+
};
|
|
21137
|
+
var STATE_USES = ["hover", "active", "focus", "disabled"];
|
|
21138
|
+
var STATE_RANK_STEP = {
|
|
21139
|
+
hover: (rank) => rank + 1,
|
|
21140
|
+
active: (rank) => rank + 2,
|
|
21141
|
+
focus: (rank) => rank + 1,
|
|
21142
|
+
disabled: (_rank, ladder) => closestRankTo(ladder, 5)
|
|
21143
|
+
};
|
|
21144
|
+
function partnerForBase(pairs, base) {
|
|
21145
|
+
if (!pairs) return void 0;
|
|
21146
|
+
for (const [p1, p2] of pairs) {
|
|
21147
|
+
if (p1 === base) return p2;
|
|
21148
|
+
if (p2 === base) return p1;
|
|
21149
|
+
}
|
|
21150
|
+
return void 0;
|
|
21151
|
+
}
|
|
21152
|
+
function nearestPartner(pairs, base) {
|
|
21153
|
+
if (!pairs || pairs.length === 0) return void 0;
|
|
21154
|
+
const anchors = /* @__PURE__ */ new Set();
|
|
21220
21155
|
for (const pair of pairs) {
|
|
21221
|
-
|
|
21222
|
-
|
|
21223
|
-
|
|
21224
|
-
|
|
21225
|
-
|
|
21226
|
-
|
|
21227
|
-
|
|
21228
|
-
if (wantHigher && partner <= sourceIndex) continue;
|
|
21229
|
-
if (!wantHigher && partner >= sourceIndex) continue;
|
|
21230
|
-
const distance2 = Math.abs(partner - sourceIndex);
|
|
21231
|
-
if (distance2 > bestDistance) {
|
|
21156
|
+
for (const position of pair) anchors.add(position);
|
|
21157
|
+
}
|
|
21158
|
+
let nearest = -1;
|
|
21159
|
+
let bestDistance = Number.POSITIVE_INFINITY;
|
|
21160
|
+
for (const anchor of anchors) {
|
|
21161
|
+
const distance2 = Math.abs(anchor - base);
|
|
21162
|
+
if (distance2 < bestDistance) {
|
|
21232
21163
|
bestDistance = distance2;
|
|
21233
|
-
|
|
21164
|
+
nearest = anchor;
|
|
21234
21165
|
}
|
|
21235
21166
|
}
|
|
21236
|
-
return
|
|
21167
|
+
return nearest === -1 ? void 0 : partnerForBase(pairs, nearest);
|
|
21237
21168
|
}
|
|
21238
|
-
function
|
|
21239
|
-
const
|
|
21240
|
-
const
|
|
21241
|
-
|
|
21242
|
-
|
|
21243
|
-
|
|
21244
|
-
|
|
21169
|
+
function collectLadder(pairs) {
|
|
21170
|
+
const positions = /* @__PURE__ */ new Set();
|
|
21171
|
+
for (const pair of pairs) {
|
|
21172
|
+
for (const position of pair) positions.add(position);
|
|
21173
|
+
}
|
|
21174
|
+
return Array.from(positions).sort((a2, b2) => a2 - b2);
|
|
21175
|
+
}
|
|
21176
|
+
function closestRankTo(ladder, target) {
|
|
21177
|
+
let bestRank = 0;
|
|
21178
|
+
let bestDistance = Number.POSITIVE_INFINITY;
|
|
21179
|
+
for (let rank = 0; rank < ladder.length; rank++) {
|
|
21180
|
+
const position = ladder[rank];
|
|
21181
|
+
if (position === void 0) continue;
|
|
21182
|
+
const distance2 = Math.abs(position - target);
|
|
21183
|
+
if (distance2 < bestDistance) {
|
|
21184
|
+
bestDistance = distance2;
|
|
21185
|
+
bestRank = rank;
|
|
21186
|
+
}
|
|
21187
|
+
}
|
|
21188
|
+
return bestRank;
|
|
21189
|
+
}
|
|
21190
|
+
function requirePosition(index, familyName) {
|
|
21191
|
+
const position = SCALE_POSITIONS[index];
|
|
21192
|
+
if (!position) {
|
|
21193
|
+
throw new SemanticSelectionError(familyName, `produced invalid scale index ${index}`);
|
|
21194
|
+
}
|
|
21195
|
+
return position;
|
|
21196
|
+
}
|
|
21197
|
+
function requireIndex(position, familyName) {
|
|
21198
|
+
const index = POSITION_TO_INDEX[position];
|
|
21199
|
+
if (index === void 0) {
|
|
21200
|
+
throw new SemanticSelectionError(familyName, `has no scale position "${position}"`);
|
|
21201
|
+
}
|
|
21202
|
+
return index;
|
|
21203
|
+
}
|
|
21204
|
+
var STATUS_ROLE_ANCHORS = {
|
|
21205
|
+
// band is the recognizability range a variant may never leave;
|
|
21206
|
+
// [min > max] means the band wraps through 0 (destructive: 330..360..30).
|
|
21207
|
+
destructive: { hue: 25, l: 0.55, cCap: 0.2, cScale: 1, band: [330, 30] },
|
|
21208
|
+
success: { hue: 145, l: 0.55, cCap: 0.18, cScale: 0.9, band: [120, 160] },
|
|
21209
|
+
warning: { hue: 85, l: 0.75, cCap: 0.18, cScale: 0.9, band: [60, 110] },
|
|
21210
|
+
info: { hue: 230, l: 0.58, cCap: 0.15, cScale: 0.85, band: [200, 250] }
|
|
21211
|
+
};
|
|
21212
|
+
function statusAnchor(role, seed) {
|
|
21213
|
+
const spec = STATUS_ROLE_ANCHORS[role];
|
|
21214
|
+
return roundOKLCH({
|
|
21215
|
+
l: spec.l,
|
|
21216
|
+
c: Math.min(spec.cCap, seed.c * spec.cScale),
|
|
21217
|
+
h: spec.hue,
|
|
21218
|
+
alpha: seed.alpha ?? 1
|
|
21219
|
+
});
|
|
21220
|
+
}
|
|
21221
|
+
function clampHueToBand(hue, band) {
|
|
21222
|
+
const h = (hue % 360 + 360) % 360;
|
|
21223
|
+
const [min, max2] = band;
|
|
21224
|
+
if (min <= max2) return Math.max(min, Math.min(max2, h));
|
|
21225
|
+
if (h >= min || h <= max2) return h;
|
|
21226
|
+
const toMin = Math.abs(h - min);
|
|
21227
|
+
const toMax = Math.abs(h - max2);
|
|
21228
|
+
return toMin < toMax ? min : max2;
|
|
21229
|
+
}
|
|
21230
|
+
var VARIANT_OFFSETS = [
|
|
21231
|
+
{ dh: 0, dl: 0 },
|
|
21232
|
+
{ dh: 10, dl: 0.05 },
|
|
21233
|
+
{ dh: -10, dl: -0.05 }
|
|
21234
|
+
];
|
|
21235
|
+
function generateSemanticColorSuggestions(baseColor) {
|
|
21236
|
+
const roles = {};
|
|
21237
|
+
for (const role of Object.keys(STATUS_ROLE_ANCHORS)) {
|
|
21238
|
+
const anchor = statusAnchor(role, baseColor);
|
|
21239
|
+
const { band } = STATUS_ROLE_ANCHORS[role];
|
|
21240
|
+
roles[role] = VARIANT_OFFSETS.map(({ dh, dl }) => {
|
|
21241
|
+
const raw = roundOKLCH({
|
|
21242
|
+
l: Math.max(0, Math.min(1, anchor.l + dl)),
|
|
21243
|
+
c: anchor.c,
|
|
21244
|
+
h: clampHueToBand(anchor.h + dh, band),
|
|
21245
|
+
alpha: anchor.alpha ?? 1
|
|
21246
|
+
});
|
|
21247
|
+
return roundOKLCH(toNearestGamut(raw).color);
|
|
21248
|
+
});
|
|
21249
|
+
}
|
|
21250
|
+
return { ...roles, danger: roles.destructive };
|
|
21251
|
+
}
|
|
21252
|
+
function semanticFor(family, options) {
|
|
21253
|
+
const familyName = options?.name ?? family.name;
|
|
21254
|
+
const refs = family;
|
|
21255
|
+
const aaaPairs = family.accessibility?.wcagAAA?.normal;
|
|
21256
|
+
const aaPairs = family.accessibility?.wcagAA?.normal;
|
|
21257
|
+
function foregroundPair(from, level) {
|
|
21258
|
+
const auto = refs.foregroundReferences?.auto;
|
|
21259
|
+
if (auto) {
|
|
21260
|
+
return {
|
|
21261
|
+
from: { family: familyName, position: from },
|
|
21262
|
+
to: { family: auto.family, position: auto.position },
|
|
21263
|
+
standard: level,
|
|
21264
|
+
tier: "reference"
|
|
21265
|
+
};
|
|
21266
|
+
}
|
|
21267
|
+
const base = requireIndex(from, familyName);
|
|
21268
|
+
const exactAAA = partnerForBase(aaaPairs, base);
|
|
21269
|
+
const aaa = exactAAA ?? nearestPartner(aaaPairs, base);
|
|
21270
|
+
const exactAA = partnerForBase(aaPairs, base);
|
|
21271
|
+
const aa = exactAA ?? nearestPartner(aaPairs, base);
|
|
21272
|
+
const partner = level === "AAA" ? aaa ?? aa : aa;
|
|
21273
|
+
if (partner === void 0) {
|
|
21274
|
+
throw new SemanticSelectionError(
|
|
21275
|
+
familyName,
|
|
21276
|
+
`has no WCAG pair partner for position ${from} (accessibility metadata required)`
|
|
21277
|
+
);
|
|
21278
|
+
}
|
|
21279
|
+
const fromAAA = level === "AAA" && aaa !== void 0;
|
|
21280
|
+
return {
|
|
21281
|
+
from: { family: familyName, position: from },
|
|
21282
|
+
to: { family: familyName, position: requirePosition(partner, familyName) },
|
|
21283
|
+
standard: fromAAA ? "AAA" : "AA",
|
|
21284
|
+
tier: (fromAAA ? exactAAA : exactAA) !== void 0 ? "pair-exact" : "pair-nearest"
|
|
21285
|
+
};
|
|
21286
|
+
}
|
|
21287
|
+
function statePair(use, from) {
|
|
21288
|
+
const precomputed = refs.stateReferences?.[use];
|
|
21289
|
+
if (precomputed) {
|
|
21290
|
+
return {
|
|
21291
|
+
from: { family: familyName, position: from },
|
|
21292
|
+
to: { family: precomputed.family, position: String(precomputed.position) },
|
|
21293
|
+
standard: "AAA",
|
|
21294
|
+
tier: "reference"
|
|
21295
|
+
};
|
|
21296
|
+
}
|
|
21297
|
+
if (!aaaPairs || aaaPairs.length === 0) {
|
|
21298
|
+
throw new SemanticSelectionError(
|
|
21299
|
+
familyName,
|
|
21300
|
+
"has no accessibility.wcagAAA.normal ladder (color generator must emit accessibility metadata)"
|
|
21301
|
+
);
|
|
21302
|
+
}
|
|
21303
|
+
const base = requireIndex(from, familyName);
|
|
21304
|
+
const ladder = collectLadder(aaaPairs);
|
|
21305
|
+
const baseRank = closestRankTo(ladder, base);
|
|
21306
|
+
const targetRank = STATE_RANK_STEP[use](baseRank, ladder);
|
|
21307
|
+
const clampedRank = Math.max(0, Math.min(ladder.length - 1, targetRank));
|
|
21308
|
+
const targetIndex = ladder[clampedRank];
|
|
21309
|
+
if (targetIndex === void 0) {
|
|
21310
|
+
throw new SemanticSelectionError(familyName, `ladder lookup failed at rank ${clampedRank}`);
|
|
21311
|
+
}
|
|
21312
|
+
return {
|
|
21313
|
+
from: { family: familyName, position: from },
|
|
21314
|
+
to: { family: familyName, position: requirePosition(targetIndex, familyName) },
|
|
21315
|
+
standard: "AAA",
|
|
21316
|
+
tier: "ladder"
|
|
21317
|
+
};
|
|
21245
21318
|
}
|
|
21246
|
-
|
|
21247
|
-
|
|
21248
|
-
|
|
21249
|
-
|
|
21250
|
-
|
|
21319
|
+
function invert(pair) {
|
|
21320
|
+
if (pair.to.family !== familyName && pair.tier !== "reference") {
|
|
21321
|
+
throw new SemanticSelectionError(
|
|
21322
|
+
familyName,
|
|
21323
|
+
`cannot invert a pair whose legs belong to "${pair.from.family}"/"${pair.to.family}"`
|
|
21324
|
+
);
|
|
21251
21325
|
}
|
|
21326
|
+
const fromTarget = 10 - requireIndex(pair.from.position, familyName);
|
|
21327
|
+
const toIndex = POSITION_TO_INDEX[pair.to.position];
|
|
21328
|
+
const toTarget = toIndex === void 0 ? void 0 : 10 - toIndex;
|
|
21329
|
+
for (const [pairs, standard] of [
|
|
21330
|
+
[aaaPairs, "AAA"],
|
|
21331
|
+
[aaPairs, "AA"]
|
|
21332
|
+
]) {
|
|
21333
|
+
if (!pairs || pairs.length === 0) continue;
|
|
21334
|
+
let best = null;
|
|
21335
|
+
for (const [p1, p2] of pairs) {
|
|
21336
|
+
if (p1 === void 0 || p2 === void 0) continue;
|
|
21337
|
+
for (const [a2, b2] of [
|
|
21338
|
+
[p1, p2],
|
|
21339
|
+
[p2, p1]
|
|
21340
|
+
]) {
|
|
21341
|
+
const fromDist = Math.abs(a2 - fromTarget);
|
|
21342
|
+
const toDist = toTarget === void 0 ? 0 : Math.abs(b2 - toTarget);
|
|
21343
|
+
const better = best === null || fromDist < best.fromDist || fromDist === best.fromDist && toDist < best.toDist || fromDist === best.fromDist && toDist === best.toDist && a2 < best.from;
|
|
21344
|
+
if (better) best = { from: a2, to: b2, fromDist, toDist };
|
|
21345
|
+
}
|
|
21346
|
+
}
|
|
21347
|
+
if (best) {
|
|
21348
|
+
return {
|
|
21349
|
+
from: { family: familyName, position: requirePosition(best.from, familyName) },
|
|
21350
|
+
to: { family: familyName, position: requirePosition(best.to, familyName) },
|
|
21351
|
+
standard,
|
|
21352
|
+
tier: best.fromDist === 0 && best.toDist === 0 ? "pair-exact" : "pair-nearest"
|
|
21353
|
+
};
|
|
21354
|
+
}
|
|
21355
|
+
}
|
|
21356
|
+
const toFallback = toTarget === void 0 ? fromTarget : toTarget;
|
|
21357
|
+
return {
|
|
21358
|
+
from: { family: familyName, position: requirePosition(fromTarget, familyName) },
|
|
21359
|
+
to: { family: familyName, position: requirePosition(toFallback, familyName) },
|
|
21360
|
+
standard: "none",
|
|
21361
|
+
tier: "inversion"
|
|
21362
|
+
};
|
|
21252
21363
|
}
|
|
21253
|
-
return
|
|
21364
|
+
return {
|
|
21365
|
+
pair(request) {
|
|
21366
|
+
const level = request.level ?? "AAA";
|
|
21367
|
+
if (request.use === "foreground") return foregroundPair(request.from, level);
|
|
21368
|
+
return statePair(request.use, request.from);
|
|
21369
|
+
},
|
|
21370
|
+
states(from) {
|
|
21371
|
+
const out = {};
|
|
21372
|
+
for (const use of STATE_USES) out[use] = statePair(use, from);
|
|
21373
|
+
return out;
|
|
21374
|
+
},
|
|
21375
|
+
invert
|
|
21376
|
+
};
|
|
21254
21377
|
}
|
|
21255
21378
|
|
|
21256
21379
|
// ../color-utils/src/builder.ts
|
|
@@ -21603,12 +21726,22 @@ var PerceptualWeightSchema = external_exports.object({
|
|
|
21603
21726
|
density: external_exports.enum(["light", "medium", "heavy"]),
|
|
21604
21727
|
balancingRecommendation: external_exports.string()
|
|
21605
21728
|
});
|
|
21606
|
-
var SemanticColorSuggestionsSchema = external_exports.
|
|
21607
|
-
|
|
21608
|
-
|
|
21609
|
-
|
|
21610
|
-
|
|
21611
|
-
|
|
21729
|
+
var SemanticColorSuggestionsSchema = external_exports.preprocess(
|
|
21730
|
+
(raw) => {
|
|
21731
|
+
if (raw && typeof raw === "object" && !("destructive" in raw) && "danger" in raw) {
|
|
21732
|
+
return { ...raw, destructive: raw.danger };
|
|
21733
|
+
}
|
|
21734
|
+
return raw;
|
|
21735
|
+
},
|
|
21736
|
+
external_exports.object({
|
|
21737
|
+
destructive: external_exports.array(OKLCHSchema),
|
|
21738
|
+
success: external_exports.array(OKLCHSchema),
|
|
21739
|
+
warning: external_exports.array(OKLCHSchema),
|
|
21740
|
+
info: external_exports.array(OKLCHSchema),
|
|
21741
|
+
/** @deprecated mirror of `destructive`; dies when apps/api leaves the repo */
|
|
21742
|
+
danger: external_exports.array(OKLCHSchema).optional()
|
|
21743
|
+
})
|
|
21744
|
+
);
|
|
21612
21745
|
var ColorValueSchema = external_exports.object({
|
|
21613
21746
|
name: external_exports.string(),
|
|
21614
21747
|
// the fancy name from color-utils, IE ocean-blue
|
|
@@ -24290,16 +24423,16 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24290
24423
|
// CORE SURFACE TOKENS (shadcn compatible)
|
|
24291
24424
|
// ============================================================================
|
|
24292
24425
|
background: {
|
|
24293
|
-
light: { family: "
|
|
24294
|
-
dark: { family: "
|
|
24426
|
+
light: { family: "neutral", position: "50" },
|
|
24427
|
+
dark: { family: "neutral", position: "950" },
|
|
24295
24428
|
meaning: "Primary page background color",
|
|
24296
24429
|
contexts: ["page-bg", "app-background"],
|
|
24297
24430
|
do: ["Use for main page background"],
|
|
24298
24431
|
never: ["Use for interactive elements"]
|
|
24299
24432
|
},
|
|
24300
24433
|
foreground: {
|
|
24301
|
-
light: { family: "
|
|
24302
|
-
dark: { family: "
|
|
24434
|
+
light: { family: "neutral", position: "950" },
|
|
24435
|
+
dark: { family: "neutral", position: "50" },
|
|
24303
24436
|
meaning: "Primary text color",
|
|
24304
24437
|
contexts: ["body-text", "headings", "primary-content"],
|
|
24305
24438
|
do: ["Use for main text content", "Use for headings"],
|
|
@@ -24307,32 +24440,32 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24307
24440
|
},
|
|
24308
24441
|
// Card surfaces
|
|
24309
24442
|
card: {
|
|
24310
|
-
light: { family: "
|
|
24311
|
-
dark: { family: "
|
|
24443
|
+
light: { family: "neutral", position: "50" },
|
|
24444
|
+
dark: { family: "neutral", position: "950" },
|
|
24312
24445
|
meaning: "Card and contained surface background",
|
|
24313
24446
|
contexts: ["cards", "modals", "dialogs", "panels"],
|
|
24314
24447
|
do: ["Use for elevated surfaces"],
|
|
24315
24448
|
never: ["Use for page-level backgrounds"]
|
|
24316
24449
|
},
|
|
24317
24450
|
"card-foreground": {
|
|
24318
|
-
light: { family: "
|
|
24319
|
-
dark: { family: "
|
|
24451
|
+
light: { family: "neutral", position: "950" },
|
|
24452
|
+
dark: { family: "neutral", position: "50" },
|
|
24320
24453
|
meaning: "Text on card surfaces",
|
|
24321
24454
|
contexts: ["card-text", "modal-text"],
|
|
24322
24455
|
do: ["Use for text within cards"],
|
|
24323
24456
|
never: ["Use without card background"]
|
|
24324
24457
|
},
|
|
24325
24458
|
"card-hover": {
|
|
24326
|
-
light: { family: "
|
|
24327
|
-
dark: { family: "
|
|
24459
|
+
light: { family: "neutral", position: "100" },
|
|
24460
|
+
dark: { family: "neutral", position: "900" },
|
|
24328
24461
|
meaning: "Card hover state background",
|
|
24329
24462
|
contexts: ["card-hover"],
|
|
24330
24463
|
do: ["Use for card hover states"],
|
|
24331
24464
|
never: ["Use as default card background"]
|
|
24332
24465
|
},
|
|
24333
24466
|
"card-border": {
|
|
24334
|
-
light: { family: "
|
|
24335
|
-
dark: { family: "
|
|
24467
|
+
light: { family: "neutral", position: "200" },
|
|
24468
|
+
dark: { family: "neutral", position: "800" },
|
|
24336
24469
|
meaning: "Card border color",
|
|
24337
24470
|
contexts: ["card-borders"],
|
|
24338
24471
|
do: ["Use for card borders"],
|
|
@@ -24340,24 +24473,24 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24340
24473
|
},
|
|
24341
24474
|
// Popover surfaces
|
|
24342
24475
|
popover: {
|
|
24343
|
-
light: { family: "
|
|
24344
|
-
dark: { family: "
|
|
24476
|
+
light: { family: "neutral", position: "50" },
|
|
24477
|
+
dark: { family: "neutral", position: "950" },
|
|
24345
24478
|
meaning: "Popover and dropdown background",
|
|
24346
24479
|
contexts: ["dropdowns", "tooltips", "menus"],
|
|
24347
24480
|
do: ["Use for floating elements"],
|
|
24348
24481
|
never: ["Use for static content"]
|
|
24349
24482
|
},
|
|
24350
24483
|
"popover-foreground": {
|
|
24351
|
-
light: { family: "
|
|
24352
|
-
dark: { family: "
|
|
24484
|
+
light: { family: "neutral", position: "950" },
|
|
24485
|
+
dark: { family: "neutral", position: "50" },
|
|
24353
24486
|
meaning: "Text in popovers",
|
|
24354
24487
|
contexts: ["dropdown-text", "menu-text"],
|
|
24355
24488
|
do: ["Use for popover content"],
|
|
24356
24489
|
never: ["Use outside floating elements"]
|
|
24357
24490
|
},
|
|
24358
24491
|
"popover-border": {
|
|
24359
|
-
light: { family: "
|
|
24360
|
-
dark: { family: "
|
|
24492
|
+
light: { family: "neutral", position: "200" },
|
|
24493
|
+
dark: { family: "neutral", position: "800" },
|
|
24361
24494
|
meaning: "Popover border color",
|
|
24362
24495
|
contexts: ["popover-borders"],
|
|
24363
24496
|
do: ["Use for popover borders"],
|
|
@@ -24365,40 +24498,40 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24365
24498
|
},
|
|
24366
24499
|
// Generic surface
|
|
24367
24500
|
surface: {
|
|
24368
|
-
light: { family: "
|
|
24369
|
-
dark: { family: "
|
|
24501
|
+
light: { family: "neutral", position: "50" },
|
|
24502
|
+
dark: { family: "neutral", position: "900" },
|
|
24370
24503
|
meaning: "Elevated surface background",
|
|
24371
24504
|
contexts: ["elevated-elements"],
|
|
24372
24505
|
do: ["Use for elevated surfaces"],
|
|
24373
24506
|
never: ["Use for page background"]
|
|
24374
24507
|
},
|
|
24375
24508
|
"surface-foreground": {
|
|
24376
|
-
light: { family: "
|
|
24377
|
-
dark: { family: "
|
|
24509
|
+
light: { family: "neutral", position: "950" },
|
|
24510
|
+
dark: { family: "neutral", position: "50" },
|
|
24378
24511
|
meaning: "Text on surface backgrounds",
|
|
24379
24512
|
contexts: ["surface-text"],
|
|
24380
24513
|
do: ["Use for text on surfaces"],
|
|
24381
24514
|
never: ["Use without surface background"]
|
|
24382
24515
|
},
|
|
24383
24516
|
"surface-hover": {
|
|
24384
|
-
light: { family: "
|
|
24385
|
-
dark: { family: "
|
|
24517
|
+
light: { family: "neutral", position: "100" },
|
|
24518
|
+
dark: { family: "neutral", position: "800" },
|
|
24386
24519
|
meaning: "Surface hover state",
|
|
24387
24520
|
contexts: ["surface-hover"],
|
|
24388
24521
|
do: ["Use for surface hover states"],
|
|
24389
24522
|
never: ["Use as default surface"]
|
|
24390
24523
|
},
|
|
24391
24524
|
"surface-active": {
|
|
24392
|
-
light: { family: "
|
|
24393
|
-
dark: { family: "
|
|
24525
|
+
light: { family: "neutral", position: "200" },
|
|
24526
|
+
dark: { family: "neutral", position: "700" },
|
|
24394
24527
|
meaning: "Surface active/pressed state",
|
|
24395
24528
|
contexts: ["surface-active"],
|
|
24396
24529
|
do: ["Use for active surface states"],
|
|
24397
24530
|
never: ["Use for hover states"]
|
|
24398
24531
|
},
|
|
24399
24532
|
"surface-border": {
|
|
24400
|
-
light: { family: "
|
|
24401
|
-
dark: { family: "
|
|
24533
|
+
light: { family: "neutral", position: "200" },
|
|
24534
|
+
dark: { family: "neutral", position: "800" },
|
|
24402
24535
|
meaning: "Surface border color",
|
|
24403
24536
|
contexts: ["surface-borders"],
|
|
24404
24537
|
do: ["Use for surface borders"],
|
|
@@ -24408,8 +24541,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24408
24541
|
// PRIMARY - Main brand/action color (shadcn compatible + extended)
|
|
24409
24542
|
// ============================================================================
|
|
24410
24543
|
primary: {
|
|
24411
|
-
light: { family: "
|
|
24412
|
-
dark: { family: "
|
|
24544
|
+
light: { family: "neutral", position: "900" },
|
|
24545
|
+
dark: { family: "neutral", position: "50" },
|
|
24413
24546
|
meaning: "Primary interactive elements - buttons, links, focus states",
|
|
24414
24547
|
contexts: ["primary-buttons", "links", "active-states"],
|
|
24415
24548
|
do: ["Use for main CTA buttons", "Use for primary links"],
|
|
@@ -24418,80 +24551,80 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24418
24551
|
consequence: "reversible"
|
|
24419
24552
|
},
|
|
24420
24553
|
"primary-foreground": {
|
|
24421
|
-
light: { family: "
|
|
24422
|
-
dark: { family: "
|
|
24554
|
+
light: { family: "neutral", position: "50" },
|
|
24555
|
+
dark: { family: "neutral", position: "900" },
|
|
24423
24556
|
meaning: "Text on primary color backgrounds",
|
|
24424
24557
|
contexts: ["button-text", "primary-action-text"],
|
|
24425
24558
|
do: ["Use for text on primary buttons"],
|
|
24426
24559
|
never: ["Use without primary background"]
|
|
24427
24560
|
},
|
|
24428
24561
|
"primary-hover": {
|
|
24429
|
-
light: { family: "
|
|
24430
|
-
dark: { family: "
|
|
24562
|
+
light: { family: "neutral", position: "800" },
|
|
24563
|
+
dark: { family: "neutral", position: "200" },
|
|
24431
24564
|
meaning: "Primary hover state",
|
|
24432
24565
|
contexts: ["primary-hover"],
|
|
24433
24566
|
do: ["Use for primary button hover"],
|
|
24434
24567
|
never: ["Use as default primary"]
|
|
24435
24568
|
},
|
|
24436
24569
|
"primary-hover-foreground": {
|
|
24437
|
-
light: { family: "
|
|
24438
|
-
dark: { family: "
|
|
24570
|
+
light: { family: "neutral", position: "50" },
|
|
24571
|
+
dark: { family: "neutral", position: "900" },
|
|
24439
24572
|
meaning: "Text on primary hover",
|
|
24440
24573
|
contexts: ["primary-hover-text"],
|
|
24441
24574
|
do: ["Use for text on primary hover"],
|
|
24442
24575
|
never: ["Use without primary-hover background"]
|
|
24443
24576
|
},
|
|
24444
24577
|
"primary-active": {
|
|
24445
|
-
light: { family: "
|
|
24446
|
-
dark: { family: "
|
|
24578
|
+
light: { family: "neutral", position: "700" },
|
|
24579
|
+
dark: { family: "neutral", position: "300" },
|
|
24447
24580
|
meaning: "Primary active/pressed state",
|
|
24448
24581
|
contexts: ["primary-active"],
|
|
24449
24582
|
do: ["Use for primary button active state"],
|
|
24450
24583
|
never: ["Use for hover states"]
|
|
24451
24584
|
},
|
|
24452
24585
|
"primary-active-foreground": {
|
|
24453
|
-
light: { family: "
|
|
24454
|
-
dark: { family: "
|
|
24586
|
+
light: { family: "neutral", position: "50" },
|
|
24587
|
+
dark: { family: "neutral", position: "900" },
|
|
24455
24588
|
meaning: "Text on primary active",
|
|
24456
24589
|
contexts: ["primary-active-text"],
|
|
24457
24590
|
do: ["Use for text on primary active"],
|
|
24458
24591
|
never: ["Use without primary-active background"]
|
|
24459
24592
|
},
|
|
24460
24593
|
"primary-focus": {
|
|
24461
|
-
light: { family: "
|
|
24462
|
-
dark: { family: "
|
|
24594
|
+
light: { family: "neutral", position: "900" },
|
|
24595
|
+
dark: { family: "neutral", position: "50" },
|
|
24463
24596
|
meaning: "Primary focus state",
|
|
24464
24597
|
contexts: ["primary-focus"],
|
|
24465
24598
|
do: ["Use for primary focus states"],
|
|
24466
24599
|
never: ["Use for non-focused elements"]
|
|
24467
24600
|
},
|
|
24468
24601
|
"primary-border": {
|
|
24469
|
-
light: { family: "
|
|
24470
|
-
dark: { family: "
|
|
24602
|
+
light: { family: "neutral", position: "900" },
|
|
24603
|
+
dark: { family: "neutral", position: "50" },
|
|
24471
24604
|
meaning: "Primary border color",
|
|
24472
24605
|
contexts: ["primary-borders"],
|
|
24473
24606
|
do: ["Use for primary element borders"],
|
|
24474
24607
|
never: ["Use for neutral borders"]
|
|
24475
24608
|
},
|
|
24476
24609
|
"primary-ring": {
|
|
24477
|
-
light: { family: "
|
|
24478
|
-
dark: { family: "
|
|
24610
|
+
light: { family: "neutral", position: "900" },
|
|
24611
|
+
dark: { family: "neutral", position: "50" },
|
|
24479
24612
|
meaning: "Primary focus ring color",
|
|
24480
24613
|
contexts: ["primary-focus-ring"],
|
|
24481
24614
|
do: ["Use for primary element focus rings"],
|
|
24482
24615
|
never: ["Use for decorative rings"]
|
|
24483
24616
|
},
|
|
24484
24617
|
"primary-subtle": {
|
|
24485
|
-
light: { family: "
|
|
24486
|
-
dark: { family: "
|
|
24618
|
+
light: { family: "neutral", position: "100" },
|
|
24619
|
+
dark: { family: "neutral", position: "900" },
|
|
24487
24620
|
meaning: "Subtle primary background for badges/alerts",
|
|
24488
24621
|
contexts: ["primary-badges", "primary-alerts"],
|
|
24489
24622
|
do: ["Use for subtle primary backgrounds"],
|
|
24490
24623
|
never: ["Use for primary buttons"]
|
|
24491
24624
|
},
|
|
24492
24625
|
"primary-subtle-foreground": {
|
|
24493
|
-
light: { family: "
|
|
24494
|
-
dark: { family: "
|
|
24626
|
+
light: { family: "neutral", position: "900" },
|
|
24627
|
+
dark: { family: "neutral", position: "100" },
|
|
24495
24628
|
meaning: "Text on subtle primary backgrounds",
|
|
24496
24629
|
contexts: ["primary-subtle-text"],
|
|
24497
24630
|
do: ["Use for text on subtle primary"],
|
|
@@ -24501,8 +24634,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24501
24634
|
// SECONDARY - Alternative action color (shadcn compatible + extended)
|
|
24502
24635
|
// ============================================================================
|
|
24503
24636
|
secondary: {
|
|
24504
|
-
light: { family: "
|
|
24505
|
-
dark: { family: "
|
|
24637
|
+
light: { family: "neutral", position: "100" },
|
|
24638
|
+
dark: { family: "neutral", position: "800" },
|
|
24506
24639
|
meaning: "Secondary interactive elements - less prominent actions",
|
|
24507
24640
|
contexts: ["secondary-buttons", "alternative-actions"],
|
|
24508
24641
|
do: ["Use for secondary actions", "Use when primary is too strong"],
|
|
@@ -24511,64 +24644,64 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24511
24644
|
consequence: "reversible"
|
|
24512
24645
|
},
|
|
24513
24646
|
"secondary-foreground": {
|
|
24514
|
-
light: { family: "
|
|
24515
|
-
dark: { family: "
|
|
24647
|
+
light: { family: "neutral", position: "900" },
|
|
24648
|
+
dark: { family: "neutral", position: "50" },
|
|
24516
24649
|
meaning: "Text on secondary color backgrounds",
|
|
24517
24650
|
contexts: ["secondary-button-text"],
|
|
24518
24651
|
do: ["Use for text on secondary buttons"],
|
|
24519
24652
|
never: ["Use without secondary background"]
|
|
24520
24653
|
},
|
|
24521
24654
|
"secondary-hover": {
|
|
24522
|
-
light: { family: "
|
|
24523
|
-
dark: { family: "
|
|
24655
|
+
light: { family: "neutral", position: "200" },
|
|
24656
|
+
dark: { family: "neutral", position: "700" },
|
|
24524
24657
|
meaning: "Secondary hover state",
|
|
24525
24658
|
contexts: ["secondary-hover"],
|
|
24526
24659
|
do: ["Use for secondary hover"],
|
|
24527
24660
|
never: ["Use as default secondary"]
|
|
24528
24661
|
},
|
|
24529
24662
|
"secondary-hover-foreground": {
|
|
24530
|
-
light: { family: "
|
|
24531
|
-
dark: { family: "
|
|
24663
|
+
light: { family: "neutral", position: "900" },
|
|
24664
|
+
dark: { family: "neutral", position: "50" },
|
|
24532
24665
|
meaning: "Text on secondary hover",
|
|
24533
24666
|
contexts: ["secondary-hover-text"],
|
|
24534
24667
|
do: ["Use for text on secondary hover"],
|
|
24535
24668
|
never: ["Use without secondary-hover background"]
|
|
24536
24669
|
},
|
|
24537
24670
|
"secondary-active": {
|
|
24538
|
-
light: { family: "
|
|
24539
|
-
dark: { family: "
|
|
24671
|
+
light: { family: "neutral", position: "300" },
|
|
24672
|
+
dark: { family: "neutral", position: "600" },
|
|
24540
24673
|
meaning: "Secondary active/pressed state",
|
|
24541
24674
|
contexts: ["secondary-active"],
|
|
24542
24675
|
do: ["Use for secondary active state"],
|
|
24543
24676
|
never: ["Use for hover states"]
|
|
24544
24677
|
},
|
|
24545
24678
|
"secondary-active-foreground": {
|
|
24546
|
-
light: { family: "
|
|
24547
|
-
dark: { family: "
|
|
24679
|
+
light: { family: "neutral", position: "900" },
|
|
24680
|
+
dark: { family: "neutral", position: "50" },
|
|
24548
24681
|
meaning: "Text on secondary active",
|
|
24549
24682
|
contexts: ["secondary-active-text"],
|
|
24550
24683
|
do: ["Use for text on secondary active"],
|
|
24551
24684
|
never: ["Use without secondary-active background"]
|
|
24552
24685
|
},
|
|
24553
24686
|
"secondary-focus": {
|
|
24554
|
-
light: { family: "
|
|
24555
|
-
dark: { family: "
|
|
24687
|
+
light: { family: "neutral", position: "100" },
|
|
24688
|
+
dark: { family: "neutral", position: "800" },
|
|
24556
24689
|
meaning: "Secondary focus state",
|
|
24557
24690
|
contexts: ["secondary-focus"],
|
|
24558
24691
|
do: ["Use for secondary focus states"],
|
|
24559
24692
|
never: ["Use for non-focused elements"]
|
|
24560
24693
|
},
|
|
24561
24694
|
"secondary-border": {
|
|
24562
|
-
light: { family: "
|
|
24563
|
-
dark: { family: "
|
|
24695
|
+
light: { family: "neutral", position: "300" },
|
|
24696
|
+
dark: { family: "neutral", position: "700" },
|
|
24564
24697
|
meaning: "Secondary border color",
|
|
24565
24698
|
contexts: ["secondary-borders"],
|
|
24566
24699
|
do: ["Use for secondary element borders"],
|
|
24567
24700
|
never: ["Use for primary borders"]
|
|
24568
24701
|
},
|
|
24569
24702
|
"secondary-ring": {
|
|
24570
|
-
light: { family: "
|
|
24571
|
-
dark: { family: "
|
|
24703
|
+
light: { family: "neutral", position: "400" },
|
|
24704
|
+
dark: { family: "neutral", position: "500" },
|
|
24572
24705
|
meaning: "Secondary focus ring color",
|
|
24573
24706
|
contexts: ["secondary-focus-ring"],
|
|
24574
24707
|
do: ["Use for secondary element focus rings"],
|
|
@@ -24578,48 +24711,48 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24578
24711
|
// MUTED - Subdued elements (shadcn compatible + extended)
|
|
24579
24712
|
// ============================================================================
|
|
24580
24713
|
muted: {
|
|
24581
|
-
light: { family: "
|
|
24582
|
-
dark: { family: "
|
|
24714
|
+
light: { family: "neutral", position: "100" },
|
|
24715
|
+
dark: { family: "neutral", position: "800" },
|
|
24583
24716
|
meaning: "Muted backgrounds for subtle emphasis",
|
|
24584
24717
|
contexts: ["subtle-backgrounds", "inactive-tabs", "disabled-areas"],
|
|
24585
24718
|
do: ["Use for subtle background differentiation"],
|
|
24586
24719
|
never: ["Use for interactive elements needing visibility"]
|
|
24587
24720
|
},
|
|
24588
24721
|
"muted-foreground": {
|
|
24589
|
-
light: { family: "
|
|
24590
|
-
dark: { family: "
|
|
24722
|
+
light: { family: "neutral", position: "500" },
|
|
24723
|
+
dark: { family: "neutral", position: "400" },
|
|
24591
24724
|
meaning: "Muted text for secondary information",
|
|
24592
24725
|
contexts: ["helper-text", "placeholders", "metadata"],
|
|
24593
24726
|
do: ["Use for secondary text", "Use for placeholders"],
|
|
24594
24727
|
never: ["Use for primary content", "Use for important information"]
|
|
24595
24728
|
},
|
|
24596
24729
|
"muted-hover": {
|
|
24597
|
-
light: { family: "
|
|
24598
|
-
dark: { family: "
|
|
24730
|
+
light: { family: "neutral", position: "200" },
|
|
24731
|
+
dark: { family: "neutral", position: "700" },
|
|
24599
24732
|
meaning: "Muted hover state",
|
|
24600
24733
|
contexts: ["muted-hover"],
|
|
24601
24734
|
do: ["Use for muted hover states"],
|
|
24602
24735
|
never: ["Use as default muted"]
|
|
24603
24736
|
},
|
|
24604
24737
|
"muted-hover-foreground": {
|
|
24605
|
-
light: { family: "
|
|
24606
|
-
dark: { family: "
|
|
24738
|
+
light: { family: "neutral", position: "600" },
|
|
24739
|
+
dark: { family: "neutral", position: "300" },
|
|
24607
24740
|
meaning: "Text on muted hover",
|
|
24608
24741
|
contexts: ["muted-hover-text"],
|
|
24609
24742
|
do: ["Use for text on muted hover"],
|
|
24610
24743
|
never: ["Use without muted-hover background"]
|
|
24611
24744
|
},
|
|
24612
24745
|
"muted-active": {
|
|
24613
|
-
light: { family: "
|
|
24614
|
-
dark: { family: "
|
|
24746
|
+
light: { family: "neutral", position: "300" },
|
|
24747
|
+
dark: { family: "neutral", position: "600" },
|
|
24615
24748
|
meaning: "Muted active state",
|
|
24616
24749
|
contexts: ["muted-active"],
|
|
24617
24750
|
do: ["Use for muted active states"],
|
|
24618
24751
|
never: ["Use for hover states"]
|
|
24619
24752
|
},
|
|
24620
24753
|
"muted-border": {
|
|
24621
|
-
light: { family: "
|
|
24622
|
-
dark: { family: "
|
|
24754
|
+
light: { family: "neutral", position: "200" },
|
|
24755
|
+
dark: { family: "neutral", position: "700" },
|
|
24623
24756
|
meaning: "Muted border color",
|
|
24624
24757
|
contexts: ["muted-borders"],
|
|
24625
24758
|
do: ["Use for muted element borders"],
|
|
@@ -24629,64 +24762,64 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24629
24762
|
// ACCENT - Highlight/emphasis color (shadcn compatible + extended)
|
|
24630
24763
|
// ============================================================================
|
|
24631
24764
|
accent: {
|
|
24632
|
-
light: { family: "
|
|
24633
|
-
dark: { family: "
|
|
24765
|
+
light: { family: "neutral", position: "100" },
|
|
24766
|
+
dark: { family: "neutral", position: "800" },
|
|
24634
24767
|
meaning: "Accent for hover states and highlights",
|
|
24635
24768
|
contexts: ["hover-states", "selected-items", "focus-backgrounds"],
|
|
24636
24769
|
do: ["Use for hover backgrounds", "Use for selected states"],
|
|
24637
24770
|
never: ["Use for primary actions"]
|
|
24638
24771
|
},
|
|
24639
24772
|
"accent-foreground": {
|
|
24640
|
-
light: { family: "
|
|
24641
|
-
dark: { family: "
|
|
24773
|
+
light: { family: "neutral", position: "900" },
|
|
24774
|
+
dark: { family: "neutral", position: "50" },
|
|
24642
24775
|
meaning: "Text on accent backgrounds",
|
|
24643
24776
|
contexts: ["hover-text", "selected-text"],
|
|
24644
24777
|
do: ["Use for text on accent backgrounds"],
|
|
24645
24778
|
never: ["Use without accent background"]
|
|
24646
24779
|
},
|
|
24647
24780
|
"accent-hover": {
|
|
24648
|
-
light: { family: "
|
|
24649
|
-
dark: { family: "
|
|
24781
|
+
light: { family: "neutral", position: "200" },
|
|
24782
|
+
dark: { family: "neutral", position: "700" },
|
|
24650
24783
|
meaning: "Accent hover state",
|
|
24651
24784
|
contexts: ["accent-hover"],
|
|
24652
24785
|
do: ["Use for accent hover states"],
|
|
24653
24786
|
never: ["Use as default accent"]
|
|
24654
24787
|
},
|
|
24655
24788
|
"accent-hover-foreground": {
|
|
24656
|
-
light: { family: "
|
|
24657
|
-
dark: { family: "
|
|
24789
|
+
light: { family: "neutral", position: "900" },
|
|
24790
|
+
dark: { family: "neutral", position: "50" },
|
|
24658
24791
|
meaning: "Text on accent hover",
|
|
24659
24792
|
contexts: ["accent-hover-text"],
|
|
24660
24793
|
do: ["Use for text on accent hover"],
|
|
24661
24794
|
never: ["Use without accent-hover background"]
|
|
24662
24795
|
},
|
|
24663
24796
|
"accent-active": {
|
|
24664
|
-
light: { family: "
|
|
24665
|
-
dark: { family: "
|
|
24797
|
+
light: { family: "neutral", position: "300" },
|
|
24798
|
+
dark: { family: "neutral", position: "600" },
|
|
24666
24799
|
meaning: "Accent active state",
|
|
24667
24800
|
contexts: ["accent-active"],
|
|
24668
24801
|
do: ["Use for accent active states"],
|
|
24669
24802
|
never: ["Use for hover states"]
|
|
24670
24803
|
},
|
|
24671
24804
|
"accent-active-foreground": {
|
|
24672
|
-
light: { family: "
|
|
24673
|
-
dark: { family: "
|
|
24805
|
+
light: { family: "neutral", position: "900" },
|
|
24806
|
+
dark: { family: "neutral", position: "50" },
|
|
24674
24807
|
meaning: "Text on accent active",
|
|
24675
24808
|
contexts: ["accent-active-text"],
|
|
24676
24809
|
do: ["Use for text on accent active"],
|
|
24677
24810
|
never: ["Use without accent-active background"]
|
|
24678
24811
|
},
|
|
24679
24812
|
"accent-border": {
|
|
24680
|
-
light: { family: "
|
|
24681
|
-
dark: { family: "
|
|
24813
|
+
light: { family: "neutral", position: "300" },
|
|
24814
|
+
dark: { family: "neutral", position: "700" },
|
|
24682
24815
|
meaning: "Accent border color",
|
|
24683
24816
|
contexts: ["accent-borders"],
|
|
24684
24817
|
do: ["Use for accent element borders"],
|
|
24685
24818
|
never: ["Use for neutral borders"]
|
|
24686
24819
|
},
|
|
24687
24820
|
"accent-ring": {
|
|
24688
|
-
light: { family: "
|
|
24689
|
-
dark: { family: "
|
|
24821
|
+
light: { family: "neutral", position: "400" },
|
|
24822
|
+
dark: { family: "neutral", position: "500" },
|
|
24690
24823
|
meaning: "Accent focus ring color",
|
|
24691
24824
|
contexts: ["accent-focus-ring"],
|
|
24692
24825
|
do: ["Use for accent element focus rings"],
|
|
@@ -24707,8 +24840,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24707
24840
|
consequence: "destructive"
|
|
24708
24841
|
},
|
|
24709
24842
|
"destructive-foreground": {
|
|
24710
|
-
light: { family: "
|
|
24711
|
-
dark: { family: "
|
|
24843
|
+
light: { family: "neutral", position: "50" },
|
|
24844
|
+
dark: { family: "neutral", position: "50" },
|
|
24712
24845
|
meaning: "Text on destructive backgrounds",
|
|
24713
24846
|
contexts: ["delete-button-text", "error-message-text"],
|
|
24714
24847
|
do: ["Use for text on destructive buttons"],
|
|
@@ -24723,8 +24856,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24723
24856
|
never: ["Use as default destructive"]
|
|
24724
24857
|
},
|
|
24725
24858
|
"destructive-hover-foreground": {
|
|
24726
|
-
light: { family: "
|
|
24727
|
-
dark: { family: "
|
|
24859
|
+
light: { family: "neutral", position: "50" },
|
|
24860
|
+
dark: { family: "neutral", position: "950" },
|
|
24728
24861
|
meaning: "Text on destructive hover",
|
|
24729
24862
|
contexts: ["destructive-hover-text"],
|
|
24730
24863
|
do: ["Use for text on destructive hover"],
|
|
@@ -24739,8 +24872,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24739
24872
|
never: ["Use for hover states"]
|
|
24740
24873
|
},
|
|
24741
24874
|
"destructive-active-foreground": {
|
|
24742
|
-
light: { family: "
|
|
24743
|
-
dark: { family: "
|
|
24875
|
+
light: { family: "neutral", position: "50" },
|
|
24876
|
+
dark: { family: "neutral", position: "950" },
|
|
24744
24877
|
meaning: "Text on destructive active",
|
|
24745
24878
|
contexts: ["destructive-active-text"],
|
|
24746
24879
|
do: ["Use for text on destructive active"],
|
|
@@ -24801,8 +24934,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24801
24934
|
consequence: "reversible"
|
|
24802
24935
|
},
|
|
24803
24936
|
"success-foreground": {
|
|
24804
|
-
light: { family: "
|
|
24805
|
-
dark: { family: "
|
|
24937
|
+
light: { family: "neutral", position: "50" },
|
|
24938
|
+
dark: { family: "neutral", position: "950" },
|
|
24806
24939
|
meaning: "Text on success backgrounds",
|
|
24807
24940
|
contexts: ["success-message-text"],
|
|
24808
24941
|
do: ["Use for text on success backgrounds"],
|
|
@@ -24817,8 +24950,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24817
24950
|
never: ["Use as default success"]
|
|
24818
24951
|
},
|
|
24819
24952
|
"success-hover-foreground": {
|
|
24820
|
-
light: { family: "
|
|
24821
|
-
dark: { family: "
|
|
24953
|
+
light: { family: "neutral", position: "50" },
|
|
24954
|
+
dark: { family: "neutral", position: "950" },
|
|
24822
24955
|
meaning: "Text on success hover",
|
|
24823
24956
|
contexts: ["success-hover-text"],
|
|
24824
24957
|
do: ["Use for text on success hover"],
|
|
@@ -24833,8 +24966,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24833
24966
|
never: ["Use for hover states"]
|
|
24834
24967
|
},
|
|
24835
24968
|
"success-active-foreground": {
|
|
24836
|
-
light: { family: "
|
|
24837
|
-
dark: { family: "
|
|
24969
|
+
light: { family: "neutral", position: "50" },
|
|
24970
|
+
dark: { family: "neutral", position: "950" },
|
|
24838
24971
|
meaning: "Text on success active",
|
|
24839
24972
|
contexts: ["success-active-text"],
|
|
24840
24973
|
do: ["Use for text on success active"],
|
|
@@ -24895,8 +25028,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24895
25028
|
consequence: "significant"
|
|
24896
25029
|
},
|
|
24897
25030
|
"warning-foreground": {
|
|
24898
|
-
light: { family: "
|
|
24899
|
-
dark: { family: "
|
|
25031
|
+
light: { family: "neutral", position: "950" },
|
|
25032
|
+
dark: { family: "neutral", position: "950" },
|
|
24900
25033
|
meaning: "Text on warning backgrounds",
|
|
24901
25034
|
contexts: ["warning-message-text"],
|
|
24902
25035
|
do: ["Use for text on warning backgrounds"],
|
|
@@ -24911,8 +25044,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24911
25044
|
never: ["Use as default warning"]
|
|
24912
25045
|
},
|
|
24913
25046
|
"warning-hover-foreground": {
|
|
24914
|
-
light: { family: "
|
|
24915
|
-
dark: { family: "
|
|
25047
|
+
light: { family: "neutral", position: "950" },
|
|
25048
|
+
dark: { family: "neutral", position: "950" },
|
|
24916
25049
|
meaning: "Text on warning hover",
|
|
24917
25050
|
contexts: ["warning-hover-text"],
|
|
24918
25051
|
do: ["Use for text on warning hover"],
|
|
@@ -24927,8 +25060,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24927
25060
|
never: ["Use for hover states"]
|
|
24928
25061
|
},
|
|
24929
25062
|
"warning-active-foreground": {
|
|
24930
|
-
light: { family: "
|
|
24931
|
-
dark: { family: "
|
|
25063
|
+
light: { family: "neutral", position: "50" },
|
|
25064
|
+
dark: { family: "neutral", position: "950" },
|
|
24932
25065
|
meaning: "Text on warning active",
|
|
24933
25066
|
contexts: ["warning-active-text"],
|
|
24934
25067
|
do: ["Use for text on warning active"],
|
|
@@ -24989,8 +25122,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
24989
25122
|
consequence: "reversible"
|
|
24990
25123
|
},
|
|
24991
25124
|
"info-foreground": {
|
|
24992
|
-
light: { family: "
|
|
24993
|
-
dark: { family: "
|
|
25125
|
+
light: { family: "neutral", position: "50" },
|
|
25126
|
+
dark: { family: "neutral", position: "50" },
|
|
24994
25127
|
meaning: "Text on info backgrounds",
|
|
24995
25128
|
contexts: ["info-message-text"],
|
|
24996
25129
|
do: ["Use for text on info backgrounds"],
|
|
@@ -25005,8 +25138,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25005
25138
|
never: ["Use as default info"]
|
|
25006
25139
|
},
|
|
25007
25140
|
"info-hover-foreground": {
|
|
25008
|
-
light: { family: "
|
|
25009
|
-
dark: { family: "
|
|
25141
|
+
light: { family: "neutral", position: "50" },
|
|
25142
|
+
dark: { family: "neutral", position: "950" },
|
|
25010
25143
|
meaning: "Text on info hover",
|
|
25011
25144
|
contexts: ["info-hover-text"],
|
|
25012
25145
|
do: ["Use for text on info hover"],
|
|
@@ -25021,8 +25154,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25021
25154
|
never: ["Use for hover states"]
|
|
25022
25155
|
},
|
|
25023
25156
|
"info-active-foreground": {
|
|
25024
|
-
light: { family: "
|
|
25025
|
-
dark: { family: "
|
|
25157
|
+
light: { family: "neutral", position: "50" },
|
|
25158
|
+
dark: { family: "neutral", position: "950" },
|
|
25026
25159
|
meaning: "Text on info active",
|
|
25027
25160
|
contexts: ["info-active-text"],
|
|
25028
25161
|
do: ["Use for text on info active"],
|
|
@@ -25082,8 +25215,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25082
25215
|
consequence: "significant"
|
|
25083
25216
|
},
|
|
25084
25217
|
"alert-foreground": {
|
|
25085
|
-
light: { family: "
|
|
25086
|
-
dark: { family: "
|
|
25218
|
+
light: { family: "neutral", position: "50" },
|
|
25219
|
+
dark: { family: "neutral", position: "50" },
|
|
25087
25220
|
meaning: "Text on alert backgrounds",
|
|
25088
25221
|
contexts: ["alert-text"],
|
|
25089
25222
|
do: ["Use for text on alert backgrounds"],
|
|
@@ -25098,8 +25231,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25098
25231
|
never: ["Use as default alert"]
|
|
25099
25232
|
},
|
|
25100
25233
|
"alert-hover-foreground": {
|
|
25101
|
-
light: { family: "
|
|
25102
|
-
dark: { family: "
|
|
25234
|
+
light: { family: "neutral", position: "50" },
|
|
25235
|
+
dark: { family: "neutral", position: "950" },
|
|
25103
25236
|
meaning: "Text on alert hover",
|
|
25104
25237
|
contexts: ["alert-hover-text"],
|
|
25105
25238
|
do: ["Use for text on alert hover"],
|
|
@@ -25114,8 +25247,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25114
25247
|
never: ["Use for hover states"]
|
|
25115
25248
|
},
|
|
25116
25249
|
"alert-active-foreground": {
|
|
25117
|
-
light: { family: "
|
|
25118
|
-
dark: { family: "
|
|
25250
|
+
light: { family: "neutral", position: "50" },
|
|
25251
|
+
dark: { family: "neutral", position: "950" },
|
|
25119
25252
|
meaning: "Text on alert active",
|
|
25120
25253
|
contexts: ["alert-active-text"],
|
|
25121
25254
|
do: ["Use for text on alert active"],
|
|
@@ -25208,32 +25341,32 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25208
25341
|
// BORDER TOKENS (shadcn compatible + extended)
|
|
25209
25342
|
// ============================================================================
|
|
25210
25343
|
border: {
|
|
25211
|
-
light: { family: "
|
|
25212
|
-
dark: { family: "
|
|
25344
|
+
light: { family: "neutral", position: "200" },
|
|
25345
|
+
dark: { family: "neutral", position: "800" },
|
|
25213
25346
|
meaning: "Default border color",
|
|
25214
25347
|
contexts: ["dividers", "separators", "input-borders"],
|
|
25215
25348
|
do: ["Use for subtle borders", "Use for dividers"],
|
|
25216
25349
|
never: ["Use for emphasized borders"]
|
|
25217
25350
|
},
|
|
25218
25351
|
"border-hover": {
|
|
25219
|
-
light: { family: "
|
|
25220
|
-
dark: { family: "
|
|
25352
|
+
light: { family: "neutral", position: "300" },
|
|
25353
|
+
dark: { family: "neutral", position: "700" },
|
|
25221
25354
|
meaning: "Border hover state",
|
|
25222
25355
|
contexts: ["border-hover"],
|
|
25223
25356
|
do: ["Use for border hover states"],
|
|
25224
25357
|
never: ["Use as default border"]
|
|
25225
25358
|
},
|
|
25226
25359
|
"border-focus": {
|
|
25227
|
-
light: { family: "
|
|
25228
|
-
dark: { family: "
|
|
25360
|
+
light: { family: "neutral", position: "400" },
|
|
25361
|
+
dark: { family: "neutral", position: "600" },
|
|
25229
25362
|
meaning: "Border focus state",
|
|
25230
25363
|
contexts: ["border-focus"],
|
|
25231
25364
|
do: ["Use for focused element borders"],
|
|
25232
25365
|
never: ["Use for non-focused elements"]
|
|
25233
25366
|
},
|
|
25234
25367
|
"border-active": {
|
|
25235
|
-
light: { family: "
|
|
25236
|
-
dark: { family: "
|
|
25368
|
+
light: { family: "neutral", position: "500" },
|
|
25369
|
+
dark: { family: "neutral", position: "500" },
|
|
25237
25370
|
meaning: "Border active state",
|
|
25238
25371
|
contexts: ["border-active"],
|
|
25239
25372
|
do: ["Use for active element borders"],
|
|
@@ -25243,56 +25376,56 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25243
25376
|
// INPUT TOKENS (shadcn compatible + extended for form states)
|
|
25244
25377
|
// ============================================================================
|
|
25245
25378
|
input: {
|
|
25246
|
-
light: { family: "
|
|
25247
|
-
dark: { family: "
|
|
25379
|
+
light: { family: "neutral", position: "200" },
|
|
25380
|
+
dark: { family: "neutral", position: "800" },
|
|
25248
25381
|
meaning: "Input field border color",
|
|
25249
25382
|
contexts: ["form-inputs", "text-fields", "selects"],
|
|
25250
25383
|
do: ["Use for form field borders"],
|
|
25251
25384
|
never: ["Use for buttons"]
|
|
25252
25385
|
},
|
|
25253
25386
|
"input-foreground": {
|
|
25254
|
-
light: { family: "
|
|
25255
|
-
dark: { family: "
|
|
25387
|
+
light: { family: "neutral", position: "950" },
|
|
25388
|
+
dark: { family: "neutral", position: "50" },
|
|
25256
25389
|
meaning: "Input text color",
|
|
25257
25390
|
contexts: ["input-text"],
|
|
25258
25391
|
do: ["Use for input text"],
|
|
25259
25392
|
never: ["Use for placeholders"]
|
|
25260
25393
|
},
|
|
25261
25394
|
"input-hover": {
|
|
25262
|
-
light: { family: "
|
|
25263
|
-
dark: { family: "
|
|
25395
|
+
light: { family: "neutral", position: "300" },
|
|
25396
|
+
dark: { family: "neutral", position: "700" },
|
|
25264
25397
|
meaning: "Input hover state",
|
|
25265
25398
|
contexts: ["input-hover"],
|
|
25266
25399
|
do: ["Use for input hover states"],
|
|
25267
25400
|
never: ["Use as default input"]
|
|
25268
25401
|
},
|
|
25269
25402
|
"input-focus": {
|
|
25270
|
-
light: { family: "
|
|
25271
|
-
dark: { family: "
|
|
25403
|
+
light: { family: "neutral", position: "400" },
|
|
25404
|
+
dark: { family: "neutral", position: "600" },
|
|
25272
25405
|
meaning: "Input focus state",
|
|
25273
25406
|
contexts: ["input-focus"],
|
|
25274
25407
|
do: ["Use for input focus states"],
|
|
25275
25408
|
never: ["Use for non-focused inputs"]
|
|
25276
25409
|
},
|
|
25277
25410
|
"input-disabled": {
|
|
25278
|
-
light: { family: "
|
|
25279
|
-
dark: { family: "
|
|
25411
|
+
light: { family: "neutral", position: "100" },
|
|
25412
|
+
dark: { family: "neutral", position: "900" },
|
|
25280
25413
|
meaning: "Disabled input background",
|
|
25281
25414
|
contexts: ["disabled-inputs"],
|
|
25282
25415
|
do: ["Use for disabled input backgrounds"],
|
|
25283
25416
|
never: ["Use for enabled inputs"]
|
|
25284
25417
|
},
|
|
25285
25418
|
"input-disabled-foreground": {
|
|
25286
|
-
light: { family: "
|
|
25287
|
-
dark: { family: "
|
|
25419
|
+
light: { family: "neutral", position: "400" },
|
|
25420
|
+
dark: { family: "neutral", position: "600" },
|
|
25288
25421
|
meaning: "Disabled input text color",
|
|
25289
25422
|
contexts: ["disabled-input-text"],
|
|
25290
25423
|
do: ["Use for disabled input text"],
|
|
25291
25424
|
never: ["Use for enabled input text"]
|
|
25292
25425
|
},
|
|
25293
25426
|
"input-placeholder": {
|
|
25294
|
-
light: { family: "
|
|
25295
|
-
dark: { family: "
|
|
25427
|
+
light: { family: "neutral", position: "500" },
|
|
25428
|
+
dark: { family: "neutral", position: "400" },
|
|
25296
25429
|
meaning: "Placeholder text color",
|
|
25297
25430
|
contexts: ["placeholders"],
|
|
25298
25431
|
do: ["Use for placeholder text"],
|
|
@@ -25334,24 +25467,24 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25334
25467
|
// RING/FOCUS TOKENS (shadcn compatible + extended for a11y)
|
|
25335
25468
|
// ============================================================================
|
|
25336
25469
|
ring: {
|
|
25337
|
-
light: { family: "
|
|
25338
|
-
dark: { family: "
|
|
25470
|
+
light: { family: "neutral", position: "950" },
|
|
25471
|
+
dark: { family: "neutral", position: "300" },
|
|
25339
25472
|
meaning: "Focus ring color",
|
|
25340
25473
|
contexts: ["focus-states", "keyboard-navigation"],
|
|
25341
25474
|
do: ["Use for focus indicators", "Ensure high contrast"],
|
|
25342
25475
|
never: ["Use for decorative elements"]
|
|
25343
25476
|
},
|
|
25344
25477
|
"ring-offset": {
|
|
25345
|
-
light: { family: "
|
|
25346
|
-
dark: { family: "
|
|
25478
|
+
light: { family: "neutral", position: "50" },
|
|
25479
|
+
dark: { family: "neutral", position: "950" },
|
|
25347
25480
|
meaning: "Focus ring offset color",
|
|
25348
25481
|
contexts: ["focus-ring-offset"],
|
|
25349
25482
|
do: ["Use for focus ring offset"],
|
|
25350
25483
|
never: ["Use as primary color"]
|
|
25351
25484
|
},
|
|
25352
25485
|
"ring-primary": {
|
|
25353
|
-
light: { family: "
|
|
25354
|
-
dark: { family: "
|
|
25486
|
+
light: { family: "neutral", position: "900" },
|
|
25487
|
+
dark: { family: "neutral", position: "50" },
|
|
25355
25488
|
meaning: "Primary focus ring",
|
|
25356
25489
|
contexts: ["primary-focus-ring"],
|
|
25357
25490
|
do: ["Use for primary element focus rings"],
|
|
@@ -25444,8 +25577,8 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25444
25577
|
never: ["Use for other highlights"]
|
|
25445
25578
|
},
|
|
25446
25579
|
"selection-foreground": {
|
|
25447
|
-
light: { family: "
|
|
25448
|
-
dark: { family: "
|
|
25580
|
+
light: { family: "neutral", position: "950" },
|
|
25581
|
+
dark: { family: "neutral", position: "50" },
|
|
25449
25582
|
meaning: "Text selection foreground",
|
|
25450
25583
|
contexts: ["text-selection-foreground"],
|
|
25451
25584
|
do: ["Use for ::selection text color"],
|
|
@@ -25455,168 +25588,168 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25455
25588
|
// SIDEBAR TOKENS (shadcn compatible + extended)
|
|
25456
25589
|
// ============================================================================
|
|
25457
25590
|
sidebar: {
|
|
25458
|
-
light: { family: "
|
|
25459
|
-
dark: { family: "
|
|
25591
|
+
light: { family: "neutral", position: "50" },
|
|
25592
|
+
dark: { family: "neutral", position: "950" },
|
|
25460
25593
|
meaning: "Sidebar background",
|
|
25461
25594
|
contexts: ["navigation-sidebar", "side-panels"],
|
|
25462
25595
|
do: ["Use for sidebar backgrounds"],
|
|
25463
25596
|
never: ["Use for main content areas"]
|
|
25464
25597
|
},
|
|
25465
25598
|
"sidebar-foreground": {
|
|
25466
|
-
light: { family: "
|
|
25467
|
-
dark: { family: "
|
|
25599
|
+
light: { family: "neutral", position: "950" },
|
|
25600
|
+
dark: { family: "neutral", position: "50" },
|
|
25468
25601
|
meaning: "Sidebar text color",
|
|
25469
25602
|
contexts: ["sidebar-text", "nav-items"],
|
|
25470
25603
|
do: ["Use for sidebar content"],
|
|
25471
25604
|
never: ["Use outside sidebar context"]
|
|
25472
25605
|
},
|
|
25473
25606
|
"sidebar-muted": {
|
|
25474
|
-
light: { family: "
|
|
25475
|
-
dark: { family: "
|
|
25607
|
+
light: { family: "neutral", position: "500" },
|
|
25608
|
+
dark: { family: "neutral", position: "400" },
|
|
25476
25609
|
meaning: "Sidebar muted text",
|
|
25477
25610
|
contexts: ["sidebar-secondary-text"],
|
|
25478
25611
|
do: ["Use for secondary sidebar text"],
|
|
25479
25612
|
never: ["Use for primary sidebar text"]
|
|
25480
25613
|
},
|
|
25481
25614
|
"sidebar-primary": {
|
|
25482
|
-
light: { family: "
|
|
25483
|
-
dark: { family: "
|
|
25615
|
+
light: { family: "neutral", position: "900" },
|
|
25616
|
+
dark: { family: "neutral", position: "50" },
|
|
25484
25617
|
meaning: "Sidebar primary accent",
|
|
25485
25618
|
contexts: ["active-nav-item", "selected-sidebar-item"],
|
|
25486
25619
|
do: ["Use for active sidebar items"],
|
|
25487
25620
|
never: ["Use for inactive items"]
|
|
25488
25621
|
},
|
|
25489
25622
|
"sidebar-primary-foreground": {
|
|
25490
|
-
light: { family: "
|
|
25491
|
-
dark: { family: "
|
|
25623
|
+
light: { family: "neutral", position: "50" },
|
|
25624
|
+
dark: { family: "neutral", position: "900" },
|
|
25492
25625
|
meaning: "Text on sidebar primary",
|
|
25493
25626
|
contexts: ["active-nav-text"],
|
|
25494
25627
|
do: ["Use for active nav item text"],
|
|
25495
25628
|
never: ["Use without sidebar-primary background"]
|
|
25496
25629
|
},
|
|
25497
25630
|
"sidebar-primary-hover": {
|
|
25498
|
-
light: { family: "
|
|
25499
|
-
dark: { family: "
|
|
25631
|
+
light: { family: "neutral", position: "800" },
|
|
25632
|
+
dark: { family: "neutral", position: "200" },
|
|
25500
25633
|
meaning: "Sidebar primary hover",
|
|
25501
25634
|
contexts: ["sidebar-primary-hover"],
|
|
25502
25635
|
do: ["Use for sidebar primary hover"],
|
|
25503
25636
|
never: ["Use as default sidebar primary"]
|
|
25504
25637
|
},
|
|
25505
25638
|
"sidebar-primary-active": {
|
|
25506
|
-
light: { family: "
|
|
25507
|
-
dark: { family: "
|
|
25639
|
+
light: { family: "neutral", position: "700" },
|
|
25640
|
+
dark: { family: "neutral", position: "300" },
|
|
25508
25641
|
meaning: "Sidebar primary active",
|
|
25509
25642
|
contexts: ["sidebar-primary-active"],
|
|
25510
25643
|
do: ["Use for sidebar primary active state"],
|
|
25511
25644
|
never: ["Use for hover states"]
|
|
25512
25645
|
},
|
|
25513
25646
|
"sidebar-accent": {
|
|
25514
|
-
light: { family: "
|
|
25515
|
-
dark: { family: "
|
|
25647
|
+
light: { family: "neutral", position: "100" },
|
|
25648
|
+
dark: { family: "neutral", position: "800" },
|
|
25516
25649
|
meaning: "Sidebar hover/accent state",
|
|
25517
25650
|
contexts: ["sidebar-hover", "sidebar-selected"],
|
|
25518
25651
|
do: ["Use for sidebar hover states"],
|
|
25519
25652
|
never: ["Use for active state"]
|
|
25520
25653
|
},
|
|
25521
25654
|
"sidebar-accent-foreground": {
|
|
25522
|
-
light: { family: "
|
|
25523
|
-
dark: { family: "
|
|
25655
|
+
light: { family: "neutral", position: "900" },
|
|
25656
|
+
dark: { family: "neutral", position: "50" },
|
|
25524
25657
|
meaning: "Text on sidebar accent",
|
|
25525
25658
|
contexts: ["sidebar-hover-text"],
|
|
25526
25659
|
do: ["Use for hovered sidebar text"],
|
|
25527
25660
|
never: ["Use without sidebar-accent background"]
|
|
25528
25661
|
},
|
|
25529
25662
|
"sidebar-accent-hover": {
|
|
25530
|
-
light: { family: "
|
|
25531
|
-
dark: { family: "
|
|
25663
|
+
light: { family: "neutral", position: "200" },
|
|
25664
|
+
dark: { family: "neutral", position: "700" },
|
|
25532
25665
|
meaning: "Sidebar accent hover",
|
|
25533
25666
|
contexts: ["sidebar-accent-hover"],
|
|
25534
25667
|
do: ["Use for sidebar accent hover"],
|
|
25535
25668
|
never: ["Use as default sidebar accent"]
|
|
25536
25669
|
},
|
|
25537
25670
|
"sidebar-accent-active": {
|
|
25538
|
-
light: { family: "
|
|
25539
|
-
dark: { family: "
|
|
25671
|
+
light: { family: "neutral", position: "300" },
|
|
25672
|
+
dark: { family: "neutral", position: "600" },
|
|
25540
25673
|
meaning: "Sidebar accent active",
|
|
25541
25674
|
contexts: ["sidebar-accent-active"],
|
|
25542
25675
|
do: ["Use for sidebar accent active state"],
|
|
25543
25676
|
never: ["Use for hover states"]
|
|
25544
25677
|
},
|
|
25545
25678
|
"sidebar-item": {
|
|
25546
|
-
light: { family: "
|
|
25547
|
-
dark: { family: "
|
|
25679
|
+
light: { family: "neutral", position: "50" },
|
|
25680
|
+
dark: { family: "neutral", position: "950" },
|
|
25548
25681
|
meaning: "Sidebar item background",
|
|
25549
25682
|
contexts: ["sidebar-items"],
|
|
25550
25683
|
do: ["Use for sidebar item backgrounds"],
|
|
25551
25684
|
never: ["Use for active items"]
|
|
25552
25685
|
},
|
|
25553
25686
|
"sidebar-item-foreground": {
|
|
25554
|
-
light: { family: "
|
|
25555
|
-
dark: { family: "
|
|
25687
|
+
light: { family: "neutral", position: "700" },
|
|
25688
|
+
dark: { family: "neutral", position: "300" },
|
|
25556
25689
|
meaning: "Sidebar item text",
|
|
25557
25690
|
contexts: ["sidebar-item-text"],
|
|
25558
25691
|
do: ["Use for sidebar item text"],
|
|
25559
25692
|
never: ["Use for active item text"]
|
|
25560
25693
|
},
|
|
25561
25694
|
"sidebar-item-hover": {
|
|
25562
|
-
light: { family: "
|
|
25563
|
-
dark: { family: "
|
|
25695
|
+
light: { family: "neutral", position: "100" },
|
|
25696
|
+
dark: { family: "neutral", position: "900" },
|
|
25564
25697
|
meaning: "Sidebar item hover",
|
|
25565
25698
|
contexts: ["sidebar-item-hover"],
|
|
25566
25699
|
do: ["Use for sidebar item hover"],
|
|
25567
25700
|
never: ["Use as default item background"]
|
|
25568
25701
|
},
|
|
25569
25702
|
"sidebar-item-hover-foreground": {
|
|
25570
|
-
light: { family: "
|
|
25571
|
-
dark: { family: "
|
|
25703
|
+
light: { family: "neutral", position: "900" },
|
|
25704
|
+
dark: { family: "neutral", position: "50" },
|
|
25572
25705
|
meaning: "Sidebar item hover text",
|
|
25573
25706
|
contexts: ["sidebar-item-hover-text"],
|
|
25574
25707
|
do: ["Use for sidebar item hover text"],
|
|
25575
25708
|
never: ["Use without hover background"]
|
|
25576
25709
|
},
|
|
25577
25710
|
"sidebar-item-active": {
|
|
25578
|
-
light: { family: "
|
|
25579
|
-
dark: { family: "
|
|
25711
|
+
light: { family: "neutral", position: "200" },
|
|
25712
|
+
dark: { family: "neutral", position: "800" },
|
|
25580
25713
|
meaning: "Sidebar item active",
|
|
25581
25714
|
contexts: ["sidebar-item-active"],
|
|
25582
25715
|
do: ["Use for sidebar item active state"],
|
|
25583
25716
|
never: ["Use for hover states"]
|
|
25584
25717
|
},
|
|
25585
25718
|
"sidebar-item-active-foreground": {
|
|
25586
|
-
light: { family: "
|
|
25587
|
-
dark: { family: "
|
|
25719
|
+
light: { family: "neutral", position: "950" },
|
|
25720
|
+
dark: { family: "neutral", position: "50" },
|
|
25588
25721
|
meaning: "Sidebar item active text",
|
|
25589
25722
|
contexts: ["sidebar-item-active-text"],
|
|
25590
25723
|
do: ["Use for sidebar item active text"],
|
|
25591
25724
|
never: ["Use without active background"]
|
|
25592
25725
|
},
|
|
25593
25726
|
"sidebar-item-selected": {
|
|
25594
|
-
light: { family: "
|
|
25595
|
-
dark: { family: "
|
|
25727
|
+
light: { family: "neutral", position: "100" },
|
|
25728
|
+
dark: { family: "neutral", position: "800" },
|
|
25596
25729
|
meaning: "Sidebar selected item",
|
|
25597
25730
|
contexts: ["sidebar-selected-item"],
|
|
25598
25731
|
do: ["Use for selected sidebar items"],
|
|
25599
25732
|
never: ["Use for unselected items"]
|
|
25600
25733
|
},
|
|
25601
25734
|
"sidebar-item-selected-foreground": {
|
|
25602
|
-
light: { family: "
|
|
25603
|
-
dark: { family: "
|
|
25735
|
+
light: { family: "neutral", position: "950" },
|
|
25736
|
+
dark: { family: "neutral", position: "50" },
|
|
25604
25737
|
meaning: "Sidebar selected item text",
|
|
25605
25738
|
contexts: ["sidebar-selected-item-text"],
|
|
25606
25739
|
do: ["Use for selected item text"],
|
|
25607
25740
|
never: ["Use without selected background"]
|
|
25608
25741
|
},
|
|
25609
25742
|
"sidebar-border": {
|
|
25610
|
-
light: { family: "
|
|
25611
|
-
dark: { family: "
|
|
25743
|
+
light: { family: "neutral", position: "200" },
|
|
25744
|
+
dark: { family: "neutral", position: "800" },
|
|
25612
25745
|
meaning: "Sidebar border/divider color",
|
|
25613
25746
|
contexts: ["sidebar-dividers", "nav-section-borders"],
|
|
25614
25747
|
do: ["Use for sidebar dividers"],
|
|
25615
25748
|
never: ["Use for main content borders"]
|
|
25616
25749
|
},
|
|
25617
25750
|
"sidebar-ring": {
|
|
25618
|
-
light: { family: "
|
|
25619
|
-
dark: { family: "
|
|
25751
|
+
light: { family: "neutral", position: "950" },
|
|
25752
|
+
dark: { family: "neutral", position: "300" },
|
|
25620
25753
|
meaning: "Sidebar focus ring",
|
|
25621
25754
|
contexts: ["sidebar-focus-states"],
|
|
25622
25755
|
do: ["Use for sidebar focus indicators"],
|
|
@@ -25626,80 +25759,80 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25626
25759
|
// NAVIGATION TOKENS
|
|
25627
25760
|
// ============================================================================
|
|
25628
25761
|
nav: {
|
|
25629
|
-
light: { family: "
|
|
25630
|
-
dark: { family: "
|
|
25762
|
+
light: { family: "neutral", position: "50" },
|
|
25763
|
+
dark: { family: "neutral", position: "950" },
|
|
25631
25764
|
meaning: "Navigation background",
|
|
25632
25765
|
contexts: ["navbars", "breadcrumbs", "tabs"],
|
|
25633
25766
|
do: ["Use for navigation backgrounds"],
|
|
25634
25767
|
never: ["Use for content areas"]
|
|
25635
25768
|
},
|
|
25636
25769
|
"nav-foreground": {
|
|
25637
|
-
light: { family: "
|
|
25638
|
-
dark: { family: "
|
|
25770
|
+
light: { family: "neutral", position: "700" },
|
|
25771
|
+
dark: { family: "neutral", position: "300" },
|
|
25639
25772
|
meaning: "Navigation text",
|
|
25640
25773
|
contexts: ["nav-links", "nav-items"],
|
|
25641
25774
|
do: ["Use for navigation text"],
|
|
25642
25775
|
never: ["Use for active nav text"]
|
|
25643
25776
|
},
|
|
25644
25777
|
"nav-hover": {
|
|
25645
|
-
light: { family: "
|
|
25646
|
-
dark: { family: "
|
|
25778
|
+
light: { family: "neutral", position: "100" },
|
|
25779
|
+
dark: { family: "neutral", position: "900" },
|
|
25647
25780
|
meaning: "Navigation hover",
|
|
25648
25781
|
contexts: ["nav-hover"],
|
|
25649
25782
|
do: ["Use for nav hover states"],
|
|
25650
25783
|
never: ["Use as default nav background"]
|
|
25651
25784
|
},
|
|
25652
25785
|
"nav-hover-foreground": {
|
|
25653
|
-
light: { family: "
|
|
25654
|
-
dark: { family: "
|
|
25786
|
+
light: { family: "neutral", position: "900" },
|
|
25787
|
+
dark: { family: "neutral", position: "50" },
|
|
25655
25788
|
meaning: "Navigation hover text",
|
|
25656
25789
|
contexts: ["nav-hover-text"],
|
|
25657
25790
|
do: ["Use for nav hover text"],
|
|
25658
25791
|
never: ["Use without hover background"]
|
|
25659
25792
|
},
|
|
25660
25793
|
"nav-active": {
|
|
25661
|
-
light: { family: "
|
|
25662
|
-
dark: { family: "
|
|
25794
|
+
light: { family: "neutral", position: "200" },
|
|
25795
|
+
dark: { family: "neutral", position: "800" },
|
|
25663
25796
|
meaning: "Navigation active",
|
|
25664
25797
|
contexts: ["nav-active"],
|
|
25665
25798
|
do: ["Use for nav active states"],
|
|
25666
25799
|
never: ["Use for hover states"]
|
|
25667
25800
|
},
|
|
25668
25801
|
"nav-active-foreground": {
|
|
25669
|
-
light: { family: "
|
|
25670
|
-
dark: { family: "
|
|
25802
|
+
light: { family: "neutral", position: "950" },
|
|
25803
|
+
dark: { family: "neutral", position: "50" },
|
|
25671
25804
|
meaning: "Navigation active text",
|
|
25672
25805
|
contexts: ["nav-active-text"],
|
|
25673
25806
|
do: ["Use for nav active text"],
|
|
25674
25807
|
never: ["Use without active background"]
|
|
25675
25808
|
},
|
|
25676
25809
|
"nav-selected": {
|
|
25677
|
-
light: { family: "
|
|
25678
|
-
dark: { family: "
|
|
25810
|
+
light: { family: "neutral", position: "900" },
|
|
25811
|
+
dark: { family: "neutral", position: "50" },
|
|
25679
25812
|
meaning: "Navigation selected",
|
|
25680
25813
|
contexts: ["nav-selected"],
|
|
25681
25814
|
do: ["Use for selected nav items"],
|
|
25682
25815
|
never: ["Use for unselected items"]
|
|
25683
25816
|
},
|
|
25684
25817
|
"nav-selected-foreground": {
|
|
25685
|
-
light: { family: "
|
|
25686
|
-
dark: { family: "
|
|
25818
|
+
light: { family: "neutral", position: "50" },
|
|
25819
|
+
dark: { family: "neutral", position: "900" },
|
|
25687
25820
|
meaning: "Navigation selected text",
|
|
25688
25821
|
contexts: ["nav-selected-text"],
|
|
25689
25822
|
do: ["Use for selected nav text"],
|
|
25690
25823
|
never: ["Use without selected background"]
|
|
25691
25824
|
},
|
|
25692
25825
|
"nav-disabled": {
|
|
25693
|
-
light: { family: "
|
|
25694
|
-
dark: { family: "
|
|
25826
|
+
light: { family: "neutral", position: "200" },
|
|
25827
|
+
dark: { family: "neutral", position: "800" },
|
|
25695
25828
|
meaning: "Navigation disabled",
|
|
25696
25829
|
contexts: ["nav-disabled"],
|
|
25697
25830
|
do: ["Use for disabled nav items"],
|
|
25698
25831
|
never: ["Use for enabled items"]
|
|
25699
25832
|
},
|
|
25700
25833
|
"nav-disabled-foreground": {
|
|
25701
|
-
light: { family: "
|
|
25702
|
-
dark: { family: "
|
|
25834
|
+
light: { family: "neutral", position: "400" },
|
|
25835
|
+
dark: { family: "neutral", position: "600" },
|
|
25703
25836
|
meaning: "Navigation disabled text",
|
|
25704
25837
|
contexts: ["nav-disabled-text"],
|
|
25705
25838
|
do: ["Use for disabled nav text"],
|
|
@@ -25709,64 +25842,64 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25709
25842
|
// TABLE TOKENS
|
|
25710
25843
|
// ============================================================================
|
|
25711
25844
|
table: {
|
|
25712
|
-
light: { family: "
|
|
25713
|
-
dark: { family: "
|
|
25845
|
+
light: { family: "neutral", position: "50" },
|
|
25846
|
+
dark: { family: "neutral", position: "950" },
|
|
25714
25847
|
meaning: "Table background",
|
|
25715
25848
|
contexts: ["data-tables"],
|
|
25716
25849
|
do: ["Use for table backgrounds"],
|
|
25717
25850
|
never: ["Use for content areas"]
|
|
25718
25851
|
},
|
|
25719
25852
|
"table-foreground": {
|
|
25720
|
-
light: { family: "
|
|
25721
|
-
dark: { family: "
|
|
25853
|
+
light: { family: "neutral", position: "950" },
|
|
25854
|
+
dark: { family: "neutral", position: "50" },
|
|
25722
25855
|
meaning: "Table text",
|
|
25723
25856
|
contexts: ["table-text"],
|
|
25724
25857
|
do: ["Use for table text"],
|
|
25725
25858
|
never: ["Use without table background"]
|
|
25726
25859
|
},
|
|
25727
25860
|
"table-header": {
|
|
25728
|
-
light: { family: "
|
|
25729
|
-
dark: { family: "
|
|
25861
|
+
light: { family: "neutral", position: "100" },
|
|
25862
|
+
dark: { family: "neutral", position: "900" },
|
|
25730
25863
|
meaning: "Table header background",
|
|
25731
25864
|
contexts: ["table-headers"],
|
|
25732
25865
|
do: ["Use for table header backgrounds"],
|
|
25733
25866
|
never: ["Use for table body"]
|
|
25734
25867
|
},
|
|
25735
25868
|
"table-header-foreground": {
|
|
25736
|
-
light: { family: "
|
|
25737
|
-
dark: { family: "
|
|
25869
|
+
light: { family: "neutral", position: "950" },
|
|
25870
|
+
dark: { family: "neutral", position: "50" },
|
|
25738
25871
|
meaning: "Table header text",
|
|
25739
25872
|
contexts: ["table-header-text"],
|
|
25740
25873
|
do: ["Use for table header text"],
|
|
25741
25874
|
never: ["Use for body text"]
|
|
25742
25875
|
},
|
|
25743
25876
|
"table-row-hover": {
|
|
25744
|
-
light: { family: "
|
|
25745
|
-
dark: { family: "
|
|
25877
|
+
light: { family: "neutral", position: "50" },
|
|
25878
|
+
dark: { family: "neutral", position: "900" },
|
|
25746
25879
|
meaning: "Table row hover",
|
|
25747
25880
|
contexts: ["table-row-hover"],
|
|
25748
25881
|
do: ["Use for table row hover"],
|
|
25749
25882
|
never: ["Use as default row background"]
|
|
25750
25883
|
},
|
|
25751
25884
|
"table-row-selected": {
|
|
25752
|
-
light: { family: "
|
|
25753
|
-
dark: { family: "
|
|
25885
|
+
light: { family: "neutral", position: "100" },
|
|
25886
|
+
dark: { family: "neutral", position: "800" },
|
|
25754
25887
|
meaning: "Table row selected",
|
|
25755
25888
|
contexts: ["table-row-selected"],
|
|
25756
25889
|
do: ["Use for selected table rows"],
|
|
25757
25890
|
never: ["Use for unselected rows"]
|
|
25758
25891
|
},
|
|
25759
25892
|
"table-row-selected-foreground": {
|
|
25760
|
-
light: { family: "
|
|
25761
|
-
dark: { family: "
|
|
25893
|
+
light: { family: "neutral", position: "950" },
|
|
25894
|
+
dark: { family: "neutral", position: "50" },
|
|
25762
25895
|
meaning: "Table row selected text",
|
|
25763
25896
|
contexts: ["table-row-selected-text"],
|
|
25764
25897
|
do: ["Use for selected row text"],
|
|
25765
25898
|
never: ["Use without selected background"]
|
|
25766
25899
|
},
|
|
25767
25900
|
"table-border": {
|
|
25768
|
-
light: { family: "
|
|
25769
|
-
dark: { family: "
|
|
25901
|
+
light: { family: "neutral", position: "200" },
|
|
25902
|
+
dark: { family: "neutral", position: "800" },
|
|
25770
25903
|
meaning: "Table border",
|
|
25771
25904
|
contexts: ["table-borders"],
|
|
25772
25905
|
do: ["Use for table borders"],
|
|
@@ -25776,16 +25909,16 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25776
25909
|
// TOOLTIP TOKENS
|
|
25777
25910
|
// ============================================================================
|
|
25778
25911
|
tooltip: {
|
|
25779
|
-
light: { family: "
|
|
25780
|
-
dark: { family: "
|
|
25912
|
+
light: { family: "neutral", position: "900" },
|
|
25913
|
+
dark: { family: "neutral", position: "50" },
|
|
25781
25914
|
meaning: "Tooltip background",
|
|
25782
25915
|
contexts: ["tooltips"],
|
|
25783
25916
|
do: ["Use for tooltip backgrounds"],
|
|
25784
25917
|
never: ["Use for content areas"]
|
|
25785
25918
|
},
|
|
25786
25919
|
"tooltip-foreground": {
|
|
25787
|
-
light: { family: "
|
|
25788
|
-
dark: { family: "
|
|
25920
|
+
light: { family: "neutral", position: "50" },
|
|
25921
|
+
dark: { family: "neutral", position: "900" },
|
|
25789
25922
|
meaning: "Tooltip text",
|
|
25790
25923
|
contexts: ["tooltip-text"],
|
|
25791
25924
|
do: ["Use for tooltip text"],
|
|
@@ -25795,16 +25928,16 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25795
25928
|
// OVERLAY TOKENS
|
|
25796
25929
|
// ============================================================================
|
|
25797
25930
|
overlay: {
|
|
25798
|
-
light: { family: "
|
|
25799
|
-
dark: { family: "
|
|
25931
|
+
light: { family: "neutral", position: "950" },
|
|
25932
|
+
dark: { family: "neutral", position: "950" },
|
|
25800
25933
|
meaning: "Overlay background",
|
|
25801
25934
|
contexts: ["modals", "dialogs", "sheets"],
|
|
25802
25935
|
do: ["Use for modal backdrops"],
|
|
25803
25936
|
never: ["Use for content backgrounds"]
|
|
25804
25937
|
},
|
|
25805
25938
|
"overlay-foreground": {
|
|
25806
|
-
light: { family: "
|
|
25807
|
-
dark: { family: "
|
|
25939
|
+
light: { family: "neutral", position: "50" },
|
|
25940
|
+
dark: { family: "neutral", position: "50" },
|
|
25808
25941
|
meaning: "Overlay text",
|
|
25809
25942
|
contexts: ["overlay-text"],
|
|
25810
25943
|
do: ["Use for text on overlays"],
|
|
@@ -25814,16 +25947,16 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25814
25947
|
// SKELETON/LOADING TOKENS
|
|
25815
25948
|
// ============================================================================
|
|
25816
25949
|
skeleton: {
|
|
25817
|
-
light: { family: "
|
|
25818
|
-
dark: { family: "
|
|
25950
|
+
light: { family: "neutral", position: "200" },
|
|
25951
|
+
dark: { family: "neutral", position: "800" },
|
|
25819
25952
|
meaning: "Skeleton loader background",
|
|
25820
25953
|
contexts: ["loading-states", "skeletons"],
|
|
25821
25954
|
do: ["Use for skeleton backgrounds"],
|
|
25822
25955
|
never: ["Use for content backgrounds"]
|
|
25823
25956
|
},
|
|
25824
25957
|
"skeleton-highlight": {
|
|
25825
|
-
light: { family: "
|
|
25826
|
-
dark: { family: "
|
|
25958
|
+
light: { family: "neutral", position: "300" },
|
|
25959
|
+
dark: { family: "neutral", position: "700" },
|
|
25827
25960
|
meaning: "Skeleton loader highlight",
|
|
25828
25961
|
contexts: ["skeleton-animation"],
|
|
25829
25962
|
do: ["Use for skeleton animation highlight"],
|
|
@@ -25876,24 +26009,24 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25876
26009
|
// SCROLLBAR TOKENS
|
|
25877
26010
|
// ============================================================================
|
|
25878
26011
|
scrollbar: {
|
|
25879
|
-
light: { family: "
|
|
25880
|
-
dark: { family: "
|
|
26012
|
+
light: { family: "neutral", position: "300" },
|
|
26013
|
+
dark: { family: "neutral", position: "700" },
|
|
25881
26014
|
meaning: "Scrollbar thumb color",
|
|
25882
26015
|
contexts: ["scrollbars"],
|
|
25883
26016
|
do: ["Use for scrollbar thumbs"],
|
|
25884
26017
|
never: ["Use for content elements"]
|
|
25885
26018
|
},
|
|
25886
26019
|
"scrollbar-hover": {
|
|
25887
|
-
light: { family: "
|
|
25888
|
-
dark: { family: "
|
|
26020
|
+
light: { family: "neutral", position: "400" },
|
|
26021
|
+
dark: { family: "neutral", position: "600" },
|
|
25889
26022
|
meaning: "Scrollbar thumb hover",
|
|
25890
26023
|
contexts: ["scrollbar-hover"],
|
|
25891
26024
|
do: ["Use for scrollbar thumb hover"],
|
|
25892
26025
|
never: ["Use as default scrollbar color"]
|
|
25893
26026
|
},
|
|
25894
26027
|
"scrollbar-track": {
|
|
25895
|
-
light: { family: "
|
|
25896
|
-
dark: { family: "
|
|
26028
|
+
light: { family: "neutral", position: "100" },
|
|
26029
|
+
dark: { family: "neutral", position: "900" },
|
|
25897
26030
|
meaning: "Scrollbar track background",
|
|
25898
26031
|
contexts: ["scrollbar-tracks"],
|
|
25899
26032
|
do: ["Use for scrollbar track backgrounds"],
|
|
@@ -25903,24 +26036,24 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25903
26036
|
// CODE/SYNTAX TOKENS
|
|
25904
26037
|
// ============================================================================
|
|
25905
26038
|
code: {
|
|
25906
|
-
light: { family: "
|
|
25907
|
-
dark: { family: "
|
|
26039
|
+
light: { family: "neutral", position: "100" },
|
|
26040
|
+
dark: { family: "neutral", position: "900" },
|
|
25908
26041
|
meaning: "Code block background",
|
|
25909
26042
|
contexts: ["code-blocks", "inline-code"],
|
|
25910
26043
|
do: ["Use for code backgrounds"],
|
|
25911
26044
|
never: ["Use for regular text"]
|
|
25912
26045
|
},
|
|
25913
26046
|
"code-foreground": {
|
|
25914
|
-
light: { family: "
|
|
25915
|
-
dark: { family: "
|
|
26047
|
+
light: { family: "neutral", position: "900" },
|
|
26048
|
+
dark: { family: "neutral", position: "100" },
|
|
25916
26049
|
meaning: "Code text color",
|
|
25917
26050
|
contexts: ["code-text"],
|
|
25918
26051
|
do: ["Use for code text"],
|
|
25919
26052
|
never: ["Use without code background"]
|
|
25920
26053
|
},
|
|
25921
26054
|
"code-border": {
|
|
25922
|
-
light: { family: "
|
|
25923
|
-
dark: { family: "
|
|
26055
|
+
light: { family: "neutral", position: "200" },
|
|
26056
|
+
dark: { family: "neutral", position: "800" },
|
|
25924
26057
|
meaning: "Code block border",
|
|
25925
26058
|
contexts: ["code-borders"],
|
|
25926
26059
|
do: ["Use for code block borders"],
|
|
@@ -25930,24 +26063,24 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25930
26063
|
// BADGE TOKENS
|
|
25931
26064
|
// ============================================================================
|
|
25932
26065
|
badge: {
|
|
25933
|
-
light: { family: "
|
|
25934
|
-
dark: { family: "
|
|
26066
|
+
light: { family: "neutral", position: "100" },
|
|
26067
|
+
dark: { family: "neutral", position: "800" },
|
|
25935
26068
|
meaning: "Badge background",
|
|
25936
26069
|
contexts: ["badges", "labels"],
|
|
25937
26070
|
do: ["Use for badge backgrounds"],
|
|
25938
26071
|
never: ["Use for buttons"]
|
|
25939
26072
|
},
|
|
25940
26073
|
"badge-foreground": {
|
|
25941
|
-
light: { family: "
|
|
25942
|
-
dark: { family: "
|
|
26074
|
+
light: { family: "neutral", position: "900" },
|
|
26075
|
+
dark: { family: "neutral", position: "100" },
|
|
25943
26076
|
meaning: "Badge text color",
|
|
25944
26077
|
contexts: ["badge-text"],
|
|
25945
26078
|
do: ["Use for badge text"],
|
|
25946
26079
|
never: ["Use without badge background"]
|
|
25947
26080
|
},
|
|
25948
26081
|
"badge-border": {
|
|
25949
|
-
light: { family: "
|
|
25950
|
-
dark: { family: "
|
|
26082
|
+
light: { family: "neutral", position: "200" },
|
|
26083
|
+
dark: { family: "neutral", position: "700" },
|
|
25951
26084
|
meaning: "Badge border",
|
|
25952
26085
|
contexts: ["badge-borders"],
|
|
25953
26086
|
do: ["Use for badge borders"],
|
|
@@ -25957,16 +26090,16 @@ var DEFAULT_SEMANTIC_COLOR_MAPPINGS = {
|
|
|
25957
26090
|
// AVATAR TOKENS
|
|
25958
26091
|
// ============================================================================
|
|
25959
26092
|
avatar: {
|
|
25960
|
-
light: { family: "
|
|
25961
|
-
dark: { family: "
|
|
26093
|
+
light: { family: "neutral", position: "200" },
|
|
26094
|
+
dark: { family: "neutral", position: "800" },
|
|
25962
26095
|
meaning: "Avatar fallback background",
|
|
25963
26096
|
contexts: ["avatars", "fallback-images"],
|
|
25964
26097
|
do: ["Use for avatar fallback backgrounds"],
|
|
25965
26098
|
never: ["Use for content backgrounds"]
|
|
25966
26099
|
},
|
|
25967
26100
|
"avatar-foreground": {
|
|
25968
|
-
light: { family: "
|
|
25969
|
-
dark: { family: "
|
|
26101
|
+
light: { family: "neutral", position: "600" },
|
|
26102
|
+
dark: { family: "neutral", position: "400" },
|
|
25970
26103
|
meaning: "Avatar fallback text/icon color",
|
|
25971
26104
|
contexts: ["avatar-initials", "avatar-icons"],
|
|
25972
26105
|
do: ["Use for avatar initials or icons"],
|
|
@@ -27376,12 +27509,12 @@ function derivationParent(derivation, suffix = "") {
|
|
|
27376
27509
|
return `${derivation.against}${suffix}`;
|
|
27377
27510
|
}
|
|
27378
27511
|
}
|
|
27379
|
-
function deriveDarkBinding(derivation) {
|
|
27512
|
+
function deriveDarkBinding(derivation, parentName) {
|
|
27380
27513
|
switch (derivation.kind) {
|
|
27381
27514
|
case "scale":
|
|
27382
27515
|
return {
|
|
27383
27516
|
plugin: "invert",
|
|
27384
|
-
input: {
|
|
27517
|
+
input: { fromToken: parentName }
|
|
27385
27518
|
};
|
|
27386
27519
|
case "state":
|
|
27387
27520
|
return {
|
|
@@ -27406,7 +27539,7 @@ function generateSemanticTokens(_config) {
|
|
|
27406
27539
|
const binding = derivationToBinding(derivation);
|
|
27407
27540
|
const parent = derivationParent(derivation);
|
|
27408
27541
|
const darkName = `${name}--dark`;
|
|
27409
|
-
const darkBinding = deriveDarkBinding(derivation);
|
|
27542
|
+
const darkBinding = deriveDarkBinding(derivation, name);
|
|
27410
27543
|
const darkParent = derivationParent(derivation, "--dark");
|
|
27411
27544
|
const dependsOn = [parent, darkName];
|
|
27412
27545
|
tokens.push({
|
|
@@ -28881,6 +29014,33 @@ function readEnvelopes(dir) {
|
|
|
28881
29014
|
}
|
|
28882
29015
|
|
|
28883
29016
|
// ../design-tokens/src/plugin.ts
|
|
29017
|
+
function resolveFamily(familyName, get3) {
|
|
29018
|
+
let resolved = get3(familyName);
|
|
29019
|
+
let name = familyName;
|
|
29020
|
+
if (resolved && typeof resolved === "object" && "family" in resolved && "position" in resolved) {
|
|
29021
|
+
name = resolved.family;
|
|
29022
|
+
resolved = get3(name);
|
|
29023
|
+
}
|
|
29024
|
+
if (!resolved || typeof resolved !== "object" || !("scale" in resolved)) return null;
|
|
29025
|
+
return { family: resolved, familyName: name };
|
|
29026
|
+
}
|
|
29027
|
+
function resolveParent(tokenName, get3) {
|
|
29028
|
+
const raw = get3(tokenName);
|
|
29029
|
+
if (!raw || typeof raw !== "object" || !("family" in raw) || !("position" in raw)) return null;
|
|
29030
|
+
const ref = raw;
|
|
29031
|
+
const positionIndex = POSITION_TO_INDEX[ref.position];
|
|
29032
|
+
if (positionIndex === void 0) return null;
|
|
29033
|
+
const result = resolveFamily(ref.family, get3);
|
|
29034
|
+
if (!result) return null;
|
|
29035
|
+
return { ref, positionIndex, ...result };
|
|
29036
|
+
}
|
|
29037
|
+
function requireSemanticParent(tokenName, get3, pluginName) {
|
|
29038
|
+
const resolved = resolveParent(tokenName, get3);
|
|
29039
|
+
if (!resolved) {
|
|
29040
|
+
throw new Error(`${pluginName} plugin: "${tokenName}" could not resolve`);
|
|
29041
|
+
}
|
|
29042
|
+
return { sem: semanticFor(resolved.family, { name: resolved.familyName }), resolved };
|
|
29043
|
+
}
|
|
28884
29044
|
function definePlugin(spec) {
|
|
28885
29045
|
return {
|
|
28886
29046
|
name: spec.name,
|
|
@@ -28933,132 +29093,32 @@ var ContrastInputSchema = external_exports.object({
|
|
|
28933
29093
|
against: external_exports.string(),
|
|
28934
29094
|
level: external_exports.enum(["AA", "AAA"]).default("AAA")
|
|
28935
29095
|
});
|
|
28936
|
-
function partnerForBase(pairs, basePosition) {
|
|
28937
|
-
if (!pairs) return void 0;
|
|
28938
|
-
for (const [p1, p2] of pairs) {
|
|
28939
|
-
if (p1 === basePosition) return p2;
|
|
28940
|
-
if (p2 === basePosition) return p1;
|
|
28941
|
-
}
|
|
28942
|
-
return void 0;
|
|
28943
|
-
}
|
|
28944
|
-
function nearestPartner(pairs, basePosition) {
|
|
28945
|
-
if (!pairs || pairs.length === 0) return void 0;
|
|
28946
|
-
const anchors = /* @__PURE__ */ new Set();
|
|
28947
|
-
for (const pair of pairs) {
|
|
28948
|
-
for (const position of pair) anchors.add(position);
|
|
28949
|
-
}
|
|
28950
|
-
if (anchors.size === 0) return void 0;
|
|
28951
|
-
let nearest = -1;
|
|
28952
|
-
let bestDistance = Number.POSITIVE_INFINITY;
|
|
28953
|
-
for (const anchor of anchors) {
|
|
28954
|
-
const distance2 = Math.abs(anchor - basePosition);
|
|
28955
|
-
if (distance2 < bestDistance) {
|
|
28956
|
-
bestDistance = distance2;
|
|
28957
|
-
nearest = anchor;
|
|
28958
|
-
}
|
|
28959
|
-
}
|
|
28960
|
-
if (nearest === -1) return void 0;
|
|
28961
|
-
return partnerForBase(pairs, nearest);
|
|
28962
|
-
}
|
|
28963
|
-
function requireScalePosition(index, label) {
|
|
28964
|
-
const position = SCALE_POSITIONS[index];
|
|
28965
|
-
if (!position) {
|
|
28966
|
-
throw new Error(`contrast plugin: invalid scale index ${index} (${label})`);
|
|
28967
|
-
}
|
|
28968
|
-
return position;
|
|
28969
|
-
}
|
|
28970
|
-
function isPositionString(value) {
|
|
28971
|
-
return typeof value === "string";
|
|
28972
|
-
}
|
|
28973
|
-
function resolveBasePosition(position) {
|
|
28974
|
-
const map2 = {
|
|
28975
|
-
"50": 0,
|
|
28976
|
-
"100": 1,
|
|
28977
|
-
"200": 2,
|
|
28978
|
-
"300": 3,
|
|
28979
|
-
"400": 4,
|
|
28980
|
-
"500": 5,
|
|
28981
|
-
"600": 6,
|
|
28982
|
-
"700": 7,
|
|
28983
|
-
"800": 8,
|
|
28984
|
-
"900": 9,
|
|
28985
|
-
"950": 10
|
|
28986
|
-
};
|
|
28987
|
-
const index = map2[position];
|
|
28988
|
-
if (index === void 0) {
|
|
28989
|
-
throw new Error(`contrast plugin: unknown scale position "${position}"`);
|
|
28990
|
-
}
|
|
28991
|
-
return index;
|
|
28992
|
-
}
|
|
28993
29096
|
var contrastPlugin = definePlugin({
|
|
28994
29097
|
name: "contrast",
|
|
28995
29098
|
inputSchema: ContrastInputSchema,
|
|
28996
29099
|
outputSchema: ColorReferenceSchema,
|
|
28997
29100
|
dependsOn: (input2) => [input2.against],
|
|
28998
29101
|
transform: (input2, get3) => {
|
|
28999
|
-
const
|
|
29000
|
-
|
|
29001
|
-
|
|
29002
|
-
`contrast plugin: parent token "${input2.against}" did not resolve to a ColorReference`
|
|
29003
|
-
);
|
|
29004
|
-
}
|
|
29005
|
-
const parentRef = parent;
|
|
29006
|
-
if (!isPositionString(parentRef.position)) {
|
|
29007
|
-
throw new Error(
|
|
29008
|
-
`contrast plugin: parent token "${input2.against}" position is not a scale string`
|
|
29009
|
-
);
|
|
29010
|
-
}
|
|
29011
|
-
const basePosition = resolveBasePosition(parentRef.position);
|
|
29012
|
-
const family = get3(parentRef.family);
|
|
29013
|
-
if (!family) {
|
|
29014
|
-
throw new Error(
|
|
29015
|
-
`contrast plugin: family "${parentRef.family}" (from "${input2.against}") not in registry`
|
|
29016
|
-
);
|
|
29017
|
-
}
|
|
29018
|
-
if (family.foregroundReferences?.auto) {
|
|
29019
|
-
const ref = family.foregroundReferences.auto;
|
|
29020
|
-
return { family: ref.family, position: ref.position };
|
|
29021
|
-
}
|
|
29022
|
-
if (family.accessibility) {
|
|
29023
|
-
const aaaPartner = partnerForBase(family.accessibility.wcagAAA?.normal, basePosition) ?? nearestPartner(family.accessibility.wcagAAA?.normal, basePosition);
|
|
29024
|
-
const aaPartner = partnerForBase(family.accessibility.wcagAA?.normal, basePosition) ?? nearestPartner(family.accessibility.wcagAA?.normal, basePosition);
|
|
29025
|
-
const partner = input2.level === "AAA" ? aaaPartner ?? aaPartner : aaPartner;
|
|
29026
|
-
if (partner !== void 0) {
|
|
29027
|
-
return {
|
|
29028
|
-
family: parentRef.family,
|
|
29029
|
-
position: requireScalePosition(partner, `${parentRef.family} pair`)
|
|
29030
|
-
};
|
|
29031
|
-
}
|
|
29032
|
-
}
|
|
29033
|
-
throw new Error(
|
|
29034
|
-
`contrast plugin: family "${parentRef.family}" has no foregroundReferences and no accessibility WCAG pair partner for position ${parentRef.position} (against ${input2.against})`
|
|
29035
|
-
);
|
|
29102
|
+
const { sem, resolved } = requireSemanticParent(input2.against, get3, "contrast");
|
|
29103
|
+
const pair = sem.pair({ use: "foreground", from: resolved.ref.position, level: input2.level });
|
|
29104
|
+
return { family: pair.to.family, position: pair.to.position };
|
|
29036
29105
|
}
|
|
29037
29106
|
});
|
|
29038
29107
|
|
|
29039
29108
|
// ../design-tokens/src/plugins/invert.ts
|
|
29040
29109
|
var InvertInputSchema = external_exports.object({
|
|
29041
|
-
|
|
29042
|
-
basePosition: external_exports.number().int().min(0).max(10)
|
|
29110
|
+
fromToken: external_exports.string()
|
|
29043
29111
|
});
|
|
29044
29112
|
var invertPlugin = definePlugin({
|
|
29045
29113
|
name: "invert",
|
|
29046
29114
|
inputSchema: InvertInputSchema,
|
|
29047
29115
|
outputSchema: ColorReferenceSchema,
|
|
29048
|
-
dependsOn: (input2) => [input2.
|
|
29116
|
+
dependsOn: (input2) => [input2.fromToken],
|
|
29049
29117
|
transform: (input2, get3) => {
|
|
29050
|
-
const
|
|
29051
|
-
|
|
29052
|
-
|
|
29053
|
-
}
|
|
29054
|
-
const darkIndex = findDarkCounterpartIndex(input2.basePosition, family);
|
|
29055
|
-
const darkPosition = SCALE_POSITIONS[darkIndex];
|
|
29056
|
-
if (!darkPosition) {
|
|
29057
|
-
throw new Error(
|
|
29058
|
-
`invert plugin: invalid dark index ${darkIndex} for base position ${input2.basePosition}`
|
|
29059
|
-
);
|
|
29060
|
-
}
|
|
29061
|
-
return { family: input2.familyName, position: darkPosition };
|
|
29118
|
+
const { sem, resolved } = requireSemanticParent(input2.fromToken, get3, "invert");
|
|
29119
|
+
const lightPair = sem.pair({ use: "foreground", from: resolved.ref.position });
|
|
29120
|
+
const darkPair = sem.invert(lightPair);
|
|
29121
|
+
return { family: resolved.familyName, position: darkPair.from.position };
|
|
29062
29122
|
}
|
|
29063
29123
|
});
|
|
29064
29124
|
|
|
@@ -29073,15 +29133,15 @@ var scalePlugin = definePlugin({
|
|
|
29073
29133
|
outputSchema: ColorReferenceSchema,
|
|
29074
29134
|
dependsOn: (input2) => [input2.familyName],
|
|
29075
29135
|
transform: (input2, get3) => {
|
|
29076
|
-
const
|
|
29077
|
-
if (!
|
|
29136
|
+
const result = resolveFamily(input2.familyName, get3);
|
|
29137
|
+
if (!result) {
|
|
29078
29138
|
throw new Error(`scale plugin: family "${input2.familyName}" not found in registry`);
|
|
29079
29139
|
}
|
|
29080
29140
|
const position = SCALE_POSITIONS[input2.scalePosition];
|
|
29081
29141
|
if (position === void 0) {
|
|
29082
29142
|
throw new Error(`scale plugin: invalid position index ${input2.scalePosition}`);
|
|
29083
29143
|
}
|
|
29084
|
-
return { family:
|
|
29144
|
+
return { family: result.familyName, position };
|
|
29085
29145
|
}
|
|
29086
29146
|
});
|
|
29087
29147
|
|
|
@@ -29091,115 +29151,15 @@ var StateInputSchema = external_exports.object({
|
|
|
29091
29151
|
from: external_exports.string(),
|
|
29092
29152
|
stateType: StateTypeSchema
|
|
29093
29153
|
});
|
|
29094
|
-
var POSITION_TO_INDEX3 = {
|
|
29095
|
-
"50": 0,
|
|
29096
|
-
"100": 1,
|
|
29097
|
-
"200": 2,
|
|
29098
|
-
"300": 3,
|
|
29099
|
-
"400": 4,
|
|
29100
|
-
"500": 5,
|
|
29101
|
-
"600": 6,
|
|
29102
|
-
"700": 7,
|
|
29103
|
-
"800": 8,
|
|
29104
|
-
"900": 9,
|
|
29105
|
-
"950": 10
|
|
29106
|
-
};
|
|
29107
|
-
var STEP_BY_STATE = {
|
|
29108
|
-
hover: (rank) => rank + 1,
|
|
29109
|
-
active: (rank) => rank + 2,
|
|
29110
|
-
focus: (rank) => rank + 1,
|
|
29111
|
-
disabled: (_rank, ladder) => closestRankToMidpoint(ladder)
|
|
29112
|
-
};
|
|
29113
|
-
function closestRankToMidpoint(ladder) {
|
|
29114
|
-
let bestRank = 0;
|
|
29115
|
-
let bestDistance = Number.POSITIVE_INFINITY;
|
|
29116
|
-
for (let r = 0; r < ladder.length; r++) {
|
|
29117
|
-
const position = ladder[r];
|
|
29118
|
-
if (position === void 0) continue;
|
|
29119
|
-
const distance2 = Math.abs(position - 5);
|
|
29120
|
-
if (distance2 < bestDistance) {
|
|
29121
|
-
bestDistance = distance2;
|
|
29122
|
-
bestRank = r;
|
|
29123
|
-
}
|
|
29124
|
-
}
|
|
29125
|
-
return bestRank;
|
|
29126
|
-
}
|
|
29127
|
-
function nearestRankOnLadder(ladder, position) {
|
|
29128
|
-
let bestRank = 0;
|
|
29129
|
-
let bestDistance = Number.POSITIVE_INFINITY;
|
|
29130
|
-
for (let r = 0; r < ladder.length; r++) {
|
|
29131
|
-
const candidate = ladder[r];
|
|
29132
|
-
if (candidate === void 0) continue;
|
|
29133
|
-
const distance2 = Math.abs(candidate - position);
|
|
29134
|
-
if (distance2 < bestDistance) {
|
|
29135
|
-
bestDistance = distance2;
|
|
29136
|
-
bestRank = r;
|
|
29137
|
-
}
|
|
29138
|
-
}
|
|
29139
|
-
return bestRank;
|
|
29140
|
-
}
|
|
29141
|
-
function collectLadder(pairs) {
|
|
29142
|
-
const positions = /* @__PURE__ */ new Set();
|
|
29143
|
-
for (const pair of pairs) {
|
|
29144
|
-
for (const position of pair) positions.add(position);
|
|
29145
|
-
}
|
|
29146
|
-
return Array.from(positions).sort((a2, b2) => a2 - b2);
|
|
29147
|
-
}
|
|
29148
29154
|
var statePlugin = definePlugin({
|
|
29149
29155
|
name: "state",
|
|
29150
29156
|
inputSchema: StateInputSchema,
|
|
29151
29157
|
outputSchema: ColorReferenceSchema,
|
|
29152
29158
|
dependsOn: (input2) => [input2.from],
|
|
29153
29159
|
transform: (input2, get3) => {
|
|
29154
|
-
const
|
|
29155
|
-
|
|
29156
|
-
|
|
29157
|
-
`state plugin: parent token "${input2.from}" did not resolve to a ColorReference`
|
|
29158
|
-
);
|
|
29159
|
-
}
|
|
29160
|
-
const parentRef = parent;
|
|
29161
|
-
if (typeof parentRef.position !== "string") {
|
|
29162
|
-
throw new Error(`state plugin: parent token "${input2.from}" position is not a scale string`);
|
|
29163
|
-
}
|
|
29164
|
-
const basePosition = POSITION_TO_INDEX3[parentRef.position];
|
|
29165
|
-
if (basePosition === void 0) {
|
|
29166
|
-
throw new Error(
|
|
29167
|
-
`state plugin: parent token "${input2.from}" position "${parentRef.position}" is not a known scale step`
|
|
29168
|
-
);
|
|
29169
|
-
}
|
|
29170
|
-
const family = get3(parentRef.family);
|
|
29171
|
-
if (!family) {
|
|
29172
|
-
throw new Error(
|
|
29173
|
-
`state plugin: family "${parentRef.family}" (from "${input2.from}") not in registry`
|
|
29174
|
-
);
|
|
29175
|
-
}
|
|
29176
|
-
const precomputed = family.stateReferences?.[input2.stateType];
|
|
29177
|
-
if (precomputed) {
|
|
29178
|
-
return { family: precomputed.family, position: String(precomputed.position) };
|
|
29179
|
-
}
|
|
29180
|
-
const pairs = family.accessibility?.wcagAAA?.normal;
|
|
29181
|
-
if (!pairs || pairs.length === 0) {
|
|
29182
|
-
throw new Error(
|
|
29183
|
-
`state plugin: family "${parentRef.family}" has no accessibility.wcagAAA.normal ladder (color generator must emit accessibility metadata)`
|
|
29184
|
-
);
|
|
29185
|
-
}
|
|
29186
|
-
const ladder = collectLadder(pairs);
|
|
29187
|
-
const baseRank = nearestRankOnLadder(ladder, basePosition);
|
|
29188
|
-
const targetRank = STEP_BY_STATE[input2.stateType](baseRank, ladder);
|
|
29189
|
-
const clampedRank = Math.max(0, Math.min(ladder.length - 1, targetRank));
|
|
29190
|
-
const targetIndex = ladder[clampedRank];
|
|
29191
|
-
if (targetIndex === void 0) {
|
|
29192
|
-
throw new Error(
|
|
29193
|
-
`state plugin: ladder lookup failed for rank ${clampedRank} on family "${parentRef.family}"`
|
|
29194
|
-
);
|
|
29195
|
-
}
|
|
29196
|
-
const position = SCALE_POSITIONS[targetIndex];
|
|
29197
|
-
if (!position) {
|
|
29198
|
-
throw new Error(
|
|
29199
|
-
`state plugin: invalid scale index ${targetIndex} for family "${parentRef.family}"`
|
|
29200
|
-
);
|
|
29201
|
-
}
|
|
29202
|
-
return { family: parentRef.family, position };
|
|
29160
|
+
const { sem, resolved } = requireSemanticParent(input2.from, get3, "state");
|
|
29161
|
+
const pair = sem.pair({ use: input2.stateType, from: resolved.ref.position });
|
|
29162
|
+
return { family: pair.to.family, position: pair.to.position };
|
|
29203
29163
|
}
|
|
29204
29164
|
});
|
|
29205
29165
|
|
|
@@ -29210,6 +29170,15 @@ async function backupCss(cssPath) {
|
|
|
29210
29170
|
await copyFile(cssPath, backupPath);
|
|
29211
29171
|
return backupPath;
|
|
29212
29172
|
}
|
|
29173
|
+
async function stripImportedDeclarations(cwd, cssPath, importedNames) {
|
|
29174
|
+
if (importedNames.length === 0) return;
|
|
29175
|
+
const fullPath = join7(cwd, cssPath);
|
|
29176
|
+
const content = await readFile4(fullPath, "utf-8");
|
|
29177
|
+
const pattern = new RegExp(importedNames.map((n2) => `^\\s*--${n2}[^;]*;\\s*$`).join("|"), "gm");
|
|
29178
|
+
const cleaned = content.replace(pattern, "");
|
|
29179
|
+
const collapsed = cleaned.replace(/\n{3,}/g, "\n\n");
|
|
29180
|
+
await writeFile2(fullPath, collapsed);
|
|
29181
|
+
}
|
|
29213
29182
|
async function updateMainCss(cwd, cssPath, themePath) {
|
|
29214
29183
|
const fullCssPath = join7(cwd, cssPath);
|
|
29215
29184
|
const cssContent = await readFile4(fullCssPath, "utf-8");
|
|
@@ -29771,6 +29740,11 @@ async function init(options) {
|
|
|
29771
29740
|
}
|
|
29772
29741
|
saveRegistryToDir(paths.tokens, registry2);
|
|
29773
29742
|
await generateOutputs(cwd, paths, registry2, exports, shadcn);
|
|
29743
|
+
const importedNames = [
|
|
29744
|
+
...toImportColors.map((c4) => c4.name),
|
|
29745
|
+
...toImportNonColors.map((d2) => d2.name)
|
|
29746
|
+
];
|
|
29747
|
+
await stripImportedDeclarations(cwd, detectedCssPath, importedNames);
|
|
29774
29748
|
log({
|
|
29775
29749
|
event: "init:import_applied",
|
|
29776
29750
|
count: toImportColors.length + toImportNonColors.length - skipped.length,
|
|
@@ -29854,6 +29828,10 @@ async function init(options) {
|
|
|
29854
29828
|
}
|
|
29855
29829
|
saveRegistryToDir(paths.tokens, registry2);
|
|
29856
29830
|
await generateOutputs(cwd, paths, registry2, exports, shadcn);
|
|
29831
|
+
const themeImportedNames = families.flatMap(
|
|
29832
|
+
(f) => SCALE_POSITIONS.map((p2) => `color-${f.name}-${p2}`).concat([`color-${f.name}`])
|
|
29833
|
+
);
|
|
29834
|
+
await stripImportedDeclarations(cwd, detectedCssPath, themeImportedNames);
|
|
29857
29835
|
log({
|
|
29858
29836
|
event: "init:import_palettes_applied",
|
|
29859
29837
|
cssPath: detectedCssPath,
|