@loworbitstudio/visor-theme-engine 0.31.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/adapters/index.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
resolveThemeBrand,
|
|
30
30
|
resolveThemeFonts,
|
|
31
31
|
sectionComment
|
|
32
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-DACVNO5C.js";
|
|
33
33
|
|
|
34
34
|
// src/adapters/brand-passthrough.ts
|
|
35
35
|
var SENTINEL_COLOR = "#ff00ff";
|
|
@@ -692,6 +692,7 @@ function sectionComment2(label) {
|
|
|
692
692
|
function docsAdapter(input, options) {
|
|
693
693
|
const slug = toKebabCase3(input.config.name);
|
|
694
694
|
const scopeClass = `.${slug}-theme`;
|
|
695
|
+
const prefersSel = `html:not(.light) ${scopeClass}:not(.light):not(.theme-light):not([data-theme="light"])`;
|
|
695
696
|
const colorScheme = input.config["color-scheme"] ?? "adaptive";
|
|
696
697
|
const singleMode = colorScheme === "dark-only" ? "dark" : colorScheme === "light-only" ? "light" : null;
|
|
697
698
|
const emitDark = colorScheme !== "light-only";
|
|
@@ -826,7 +827,7 @@ function docsAdapter(input, options) {
|
|
|
826
827
|
if (emitPrefers) {
|
|
827
828
|
for (const cat of pcsCategories) {
|
|
828
829
|
lines.push(sectionComment2(`Adaptive: ${cat.label} (dark) \u2014 prefers-color-scheme`));
|
|
829
|
-
const inner = block2(
|
|
830
|
+
const inner = block2(prefersSel, cat.entries);
|
|
830
831
|
lines.push(`@media (prefers-color-scheme: dark) {
|
|
831
832
|
${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
832
833
|
}`);
|
|
@@ -835,7 +836,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
|
835
836
|
}
|
|
836
837
|
if (darkPrimitiveOverrides.length > 0 && emitPrefers) {
|
|
837
838
|
lines.push(sectionComment2("Primitive overrides (dark) \u2014 prefers-color-scheme"));
|
|
838
|
-
const inner = block2(
|
|
839
|
+
const inner = block2(prefersSel, darkPrimitiveOverrides);
|
|
839
840
|
lines.push(`@media (prefers-color-scheme: dark) {
|
|
840
841
|
${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
841
842
|
}`);
|
|
@@ -892,7 +893,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
|
892
893
|
if (emitPrefers) {
|
|
893
894
|
semanticLines.push(sectionComment2("Intent aliases (dark) \u2014 prefers-color-scheme"));
|
|
894
895
|
{
|
|
895
|
-
const inner = block2(
|
|
896
|
+
const inner = block2(prefersSel, generateIntentDecls(input.tokens, "dark"));
|
|
896
897
|
semanticLines.push(`@media (prefers-color-scheme: dark) {
|
|
897
898
|
${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
898
899
|
}`);
|
|
@@ -900,7 +901,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
|
900
901
|
semanticLines.push("");
|
|
901
902
|
semanticLines.push(sectionComment2("Hairline aliases (dark) \u2014 prefers-color-scheme"));
|
|
902
903
|
{
|
|
903
|
-
const inner = block2(
|
|
904
|
+
const inner = block2(prefersSel, generateHairlineDecls(input.tokens, "dark"));
|
|
904
905
|
semanticLines.push(`@media (prefers-color-scheme: dark) {
|
|
905
906
|
${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
906
907
|
}`);
|
|
@@ -913,7 +914,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
|
913
914
|
{
|
|
914
915
|
light: lightSel,
|
|
915
916
|
dark: darkSel,
|
|
916
|
-
prefers:
|
|
917
|
+
prefers: prefersSel
|
|
917
918
|
},
|
|
918
919
|
colorScheme
|
|
919
920
|
);
|
|
@@ -922,7 +923,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
|
922
923
|
{
|
|
923
924
|
light: lightSel,
|
|
924
925
|
dark: darkSel,
|
|
925
|
-
prefers:
|
|
926
|
+
prefers: prefersSel
|
|
926
927
|
},
|
|
927
928
|
colorScheme
|
|
928
929
|
);
|
|
@@ -946,7 +947,7 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
|
946
947
|
semanticLines.push(block2(darkSel, darkAliasDecls));
|
|
947
948
|
semanticLines.push("");
|
|
948
949
|
semanticLines.push(sectionComment2("visor-core alias re-substitution (dark) \u2014 prefers-color-scheme (VI-696)"));
|
|
949
|
-
const inner = block2(
|
|
950
|
+
const inner = block2(prefersSel, darkAliasDecls);
|
|
950
951
|
semanticLines.push(`@media (prefers-color-scheme: dark) {
|
|
951
952
|
${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
952
953
|
}`);
|
|
@@ -834,7 +834,7 @@ function generateBrandCSS(resolutions, scope, colorScheme = "adaptive") {
|
|
|
834
834
|
const baseSelector = scope ? scope : ":root";
|
|
835
835
|
const lightSelector = scope ? `html:not(.dark) ${scope}` : ":root";
|
|
836
836
|
const darkSelector = scope ? `.dark ${scope}` : ".dark";
|
|
837
|
-
const pcsSelector = scope ?
|
|
837
|
+
const pcsSelector = scope ? `html:not(.light) ${scope}:not(.light)` : ":root:not(.light)";
|
|
838
838
|
const lines = [];
|
|
839
839
|
const staticDecls = resolutions.flatMap(staticDeclsFor);
|
|
840
840
|
lines.push("/* --- Brand: forced-mode aliases + tokens --- */");
|
|
@@ -1276,6 +1276,7 @@ var INLINE_EDIT = "components/ui/inline-edit/inline-edit.module.css";
|
|
|
1276
1276
|
var SAVE_STATUS = "components/ui/save-status/save-status.module.css";
|
|
1277
1277
|
var SEGMENTED_CONTROL = "components/ui/segmented-control/segmented-control.module.css";
|
|
1278
1278
|
var TOGGLE_GROUP = "components/ui/toggle-group/toggle-group.module.css";
|
|
1279
|
+
var RADIO_GROUP = "components/ui/radio-group/radio-group.module.css";
|
|
1279
1280
|
var TOOLTIP = "components/ui/tooltip/tooltip.module.css";
|
|
1280
1281
|
var ACTION_ROW = "components/ui/action-row/action-row.module.css";
|
|
1281
1282
|
var DIALOG_FIELD = "blocks/dialog-field/dialog-field.module.css";
|
|
@@ -2224,6 +2225,25 @@ var toggleGroupFamily = {
|
|
|
2224
2225
|
{ key: "xs-item-radius", property: "border-radius", description: "Compact (`xs`) option and indicator corner radius. Concentric with the track is the track radius minus its 2px inset.", consumers: at(TOGGLE_GROUP, "var(--radius-sm, 0.25rem)") }
|
|
2225
2226
|
]
|
|
2226
2227
|
};
|
|
2228
|
+
var radioCardFamily = {
|
|
2229
|
+
family: "radio-card",
|
|
2230
|
+
prefix: "radio-card",
|
|
2231
|
+
description: 'RadioGroup card \u2014 its surface, edge, radius, icon and mark, plus the ring and dot of `indicator="dot"`.',
|
|
2232
|
+
tokens: [
|
|
2233
|
+
{ key: "bg", property: "background-color", description: "Card surface.", consumers: [{ file: RADIO_GROUP, fallback: "var(--surface-card, #ffffff)" }] },
|
|
2234
|
+
{ key: "border", property: "outline-color", description: "Resting card edge colour.", consumers: at(RADIO_GROUP, "var(--control-edge-color, var(--border-default, #e5e7eb))") },
|
|
2235
|
+
{ key: "radius", property: "border-radius", description: "Card corner radius.", consumers: at(RADIO_GROUP, "var(--radius-lg, 0.5rem)") },
|
|
2236
|
+
{ key: "hover-bg", property: "background-color", description: "Card surface on hover.", consumers: at(RADIO_GROUP, "var(--surface-interactive-hover, var(--surface-muted, #f3f4f6))") },
|
|
2237
|
+
{ key: "selected-bg", property: "background-color", description: "Chosen card surface.", consumers: at(RADIO_GROUP, "color-mix(in srgb, var(--text-primary, #111827) 10%, var(--radio-card-bg, var(--surface-card, #ffffff)))") },
|
|
2238
|
+
{ key: "selected-border", property: "outline-color", description: "Chosen card edge colour.", consumers: at(RADIO_GROUP, "color-mix(in srgb, var(--text-primary, #111827) 40%, transparent)") },
|
|
2239
|
+
{ key: "icon-size", property: "width", description: "Leading icon box and font size.", consumers: at(RADIO_GROUP, "1.5rem") },
|
|
2240
|
+
{ key: "mark-bg", property: "background-color", description: "Filled disc behind the check mark.", consumers: at(RADIO_GROUP, "var(--interactive-primary-bg, var(--primary, #111827))") },
|
|
2241
|
+
{ key: "mark-text", property: "color", description: "Check mark colour.", consumers: at(RADIO_GROUP, "var(--interactive-primary-text, #f9fafb)") },
|
|
2242
|
+
{ key: "ring", property: "outline-color", description: "The ring on a card that is not chosen.", consumers: at(RADIO_GROUP, "color-mix(in srgb, var(--text-primary, #111827) 30%, transparent)") },
|
|
2243
|
+
{ key: "ring-selected", property: "outline-color", description: "The ring on the chosen card. Unbound it follows the dot.", consumers: at(RADIO_GROUP, "var(--radio-card-dot, var(--interactive-primary-bg, var(--primary, #111827)))") },
|
|
2244
|
+
{ key: "dot", property: "background-color", description: "The dot inside the chosen card.", consumers: at(RADIO_GROUP, "var(--interactive-primary-bg, var(--primary, #111827))") }
|
|
2245
|
+
]
|
|
2246
|
+
};
|
|
2227
2247
|
var adminUiFamily = {
|
|
2228
2248
|
family: "admin-ui",
|
|
2229
2249
|
prefix: "admin-ui",
|
|
@@ -2265,6 +2285,7 @@ var COMPONENT_TOKEN_FAMILIES = [
|
|
|
2265
2285
|
saveStatusFamily,
|
|
2266
2286
|
segmentedControlFamily,
|
|
2267
2287
|
toggleGroupFamily,
|
|
2288
|
+
radioCardFamily,
|
|
2268
2289
|
tooltipFamily,
|
|
2269
2290
|
actionRowFamily,
|
|
2270
2291
|
inputAffixFamily,
|
package/dist/index.d.ts
CHANGED
|
@@ -1282,6 +1282,13 @@ var properties = {
|
|
|
1282
1282
|
$ref: "#/$defs/componentTokenBinding"
|
|
1283
1283
|
}
|
|
1284
1284
|
},
|
|
1285
|
+
"radio-card": {
|
|
1286
|
+
type: "object",
|
|
1287
|
+
description: "RadioGroup card — its surface, edge, radius, icon and mark, plus the ring and dot of `indicator=\"dot\"`. Keys: bg, border, radius, hover-bg, selected-bg, selected-border, icon-size, mark-bg, mark-text, ring, ring-selected, dot.",
|
|
1288
|
+
additionalProperties: {
|
|
1289
|
+
$ref: "#/$defs/componentTokenBinding"
|
|
1290
|
+
}
|
|
1291
|
+
},
|
|
1285
1292
|
tooltip: {
|
|
1286
1293
|
type: "object",
|
|
1287
1294
|
description: "Tooltip ground and ink, so a dark theme can keep the label legible without retuning the shared inverse pair other components read. Keys: bg, text.",
|
package/dist/index.js
CHANGED
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
rgbToOklch,
|
|
69
69
|
serializeColor,
|
|
70
70
|
validateComponentBindings
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-DACVNO5C.js";
|
|
72
72
|
|
|
73
73
|
// src/fonts/validate-coverage.ts
|
|
74
74
|
var FONT_VAR_RE = /--font-(heading|display|body|sans|mono)\s*:\s*([^;]+);/g;
|
|
@@ -1303,6 +1303,13 @@ var visor_theme_schema_default = {
|
|
|
1303
1303
|
$ref: "#/$defs/componentTokenBinding"
|
|
1304
1304
|
}
|
|
1305
1305
|
},
|
|
1306
|
+
"radio-card": {
|
|
1307
|
+
type: "object",
|
|
1308
|
+
description: 'RadioGroup card \u2014 its surface, edge, radius, icon and mark, plus the ring and dot of `indicator="dot"`. Keys: bg, border, radius, hover-bg, selected-bg, selected-border, icon-size, mark-bg, mark-text, ring, ring-selected, dot.',
|
|
1309
|
+
additionalProperties: {
|
|
1310
|
+
$ref: "#/$defs/componentTokenBinding"
|
|
1311
|
+
}
|
|
1312
|
+
},
|
|
1306
1313
|
tooltip: {
|
|
1307
1314
|
type: "object",
|
|
1308
1315
|
description: "Tooltip ground and ink, so a dark theme can keep the label legible without retuning the shared inverse pair other components read. Keys: bg, text.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loworbitstudio/visor-theme-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "Theme engine for the Visor design system — shade generation, token mapping, font resolution, and import/export for .visor.yaml themes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -682,6 +682,13 @@
|
|
|
682
682
|
"$ref": "#/$defs/componentTokenBinding"
|
|
683
683
|
}
|
|
684
684
|
},
|
|
685
|
+
"radio-card": {
|
|
686
|
+
"type": "object",
|
|
687
|
+
"description": "RadioGroup card \u2014 its surface, edge, radius, icon and mark, plus the ring and dot of `indicator=\"dot\"`. Keys: bg, border, radius, hover-bg, selected-bg, selected-border, icon-size, mark-bg, mark-text, ring, ring-selected, dot.",
|
|
688
|
+
"additionalProperties": {
|
|
689
|
+
"$ref": "#/$defs/componentTokenBinding"
|
|
690
|
+
}
|
|
691
|
+
},
|
|
685
692
|
"tooltip": {
|
|
686
693
|
"type": "object",
|
|
687
694
|
"description": "Tooltip ground and ink, so a dark theme can keep the label legible without retuning the shared inverse pair other components read. Keys: bg, text.",
|