@loworbitstudio/visor-theme-engine 0.30.0 → 0.31.1
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-Y4XRYCNV.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 --- */");
|
|
@@ -1275,6 +1275,7 @@ var TEXT = "components/ui/text/text.module.css";
|
|
|
1275
1275
|
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
|
+
var TOGGLE_GROUP = "components/ui/toggle-group/toggle-group.module.css";
|
|
1278
1279
|
var TOOLTIP = "components/ui/tooltip/tooltip.module.css";
|
|
1279
1280
|
var ACTION_ROW = "components/ui/action-row/action-row.module.css";
|
|
1280
1281
|
var DIALOG_FIELD = "blocks/dialog-field/dialog-field.module.css";
|
|
@@ -2203,6 +2204,26 @@ var segmentedControlFamily = {
|
|
|
2203
2204
|
{ key: "active-weight", property: "font-weight", description: "Active segment label weight.", consumers: at(SEGMENTED_CONTROL, "var(--font-weight-medium, 500)") }
|
|
2204
2205
|
]
|
|
2205
2206
|
};
|
|
2207
|
+
var toggleGroupFamily = {
|
|
2208
|
+
family: "toggle-group",
|
|
2209
|
+
prefix: "toggle-group",
|
|
2210
|
+
description: "ToggleGroup \u2014 the outline track's fill, the selected option's fill and ink, the unselected ink, and the compact (`xs`) size: its label size, option sides and corners. SegmentedControl takes the `xs` option keys too.",
|
|
2211
|
+
tokens: [
|
|
2212
|
+
{ key: "track-bg", property: "background-color", description: "The outline variant's track. Bind a well darker than its plane where the theme wants one.", consumers: at(TOGGLE_GROUP, "transparent") },
|
|
2213
|
+
{
|
|
2214
|
+
key: "selected-bg",
|
|
2215
|
+
property: "background-color",
|
|
2216
|
+
description: "The selected option's fill: the sliding indicator (outline, single) and the item itself (default, and outline multiple).",
|
|
2217
|
+
consumers: each([TOGGLE_GROUP, TOGGLE_GROUP, TOGGLE_GROUP], "var(--interactive-primary-bg, var(--primary, #111827))")
|
|
2218
|
+
},
|
|
2219
|
+
{ key: "selected-text", property: "color", description: "The selected option's label ink.", consumers: at(TOGGLE_GROUP, "var(--interactive-primary-text, #f9fafb)") },
|
|
2220
|
+
{ key: "unselected-text", property: "color", description: "Every option that is not selected.", consumers: at(TOGGLE_GROUP, "var(--text-primary, #111827)") },
|
|
2221
|
+
{ key: "xs-font-size", property: "font-size", description: "Compact (`xs`) label size.", consumers: at(TOGGLE_GROUP, "var(--font-size-xs, 0.75rem)") },
|
|
2222
|
+
{ key: "xs-padding-x", property: "padding-inline", description: "Compact (`xs`) option sides.", consumers: at(TOGGLE_GROUP, "var(--spacing-2, 0.5rem)") },
|
|
2223
|
+
{ key: "xs-track-radius", property: "border-radius", description: "Compact (`xs`) outline track corner radius.", consumers: at(TOGGLE_GROUP, "var(--radius-md, 0.375rem)") },
|
|
2224
|
+
{ 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
|
+
};
|
|
2206
2227
|
var adminUiFamily = {
|
|
2207
2228
|
family: "admin-ui",
|
|
2208
2229
|
prefix: "admin-ui",
|
|
@@ -2243,6 +2264,7 @@ var COMPONENT_TOKEN_FAMILIES = [
|
|
|
2243
2264
|
switchFamily,
|
|
2244
2265
|
saveStatusFamily,
|
|
2245
2266
|
segmentedControlFamily,
|
|
2267
|
+
toggleGroupFamily,
|
|
2246
2268
|
tooltipFamily,
|
|
2247
2269
|
actionRowFamily,
|
|
2248
2270
|
inputAffixFamily,
|
package/dist/index.d.ts
CHANGED
|
@@ -1275,6 +1275,13 @@ var properties = {
|
|
|
1275
1275
|
$ref: "#/$defs/componentTokenBinding"
|
|
1276
1276
|
}
|
|
1277
1277
|
},
|
|
1278
|
+
"toggle-group": {
|
|
1279
|
+
type: "object",
|
|
1280
|
+
description: "ToggleGroup — the outline track's fill, the selected option's fill and ink, the unselected ink, and the compact (`xs`) size: its label size, option sides and corners. SegmentedControl takes the `xs` option keys too. Keys: track-bg, selected-bg, selected-text, unselected-text, xs-font-size, xs-padding-x, xs-track-radius, xs-item-radius.",
|
|
1281
|
+
additionalProperties: {
|
|
1282
|
+
$ref: "#/$defs/componentTokenBinding"
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1278
1285
|
tooltip: {
|
|
1279
1286
|
type: "object",
|
|
1280
1287
|
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-Y4XRYCNV.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;
|
|
@@ -1296,6 +1296,13 @@ var visor_theme_schema_default = {
|
|
|
1296
1296
|
$ref: "#/$defs/componentTokenBinding"
|
|
1297
1297
|
}
|
|
1298
1298
|
},
|
|
1299
|
+
"toggle-group": {
|
|
1300
|
+
type: "object",
|
|
1301
|
+
description: "ToggleGroup \u2014 the outline track's fill, the selected option's fill and ink, the unselected ink, and the compact (`xs`) size: its label size, option sides and corners. SegmentedControl takes the `xs` option keys too. Keys: track-bg, selected-bg, selected-text, unselected-text, xs-font-size, xs-padding-x, xs-track-radius, xs-item-radius.",
|
|
1302
|
+
additionalProperties: {
|
|
1303
|
+
$ref: "#/$defs/componentTokenBinding"
|
|
1304
|
+
}
|
|
1305
|
+
},
|
|
1299
1306
|
tooltip: {
|
|
1300
1307
|
type: "object",
|
|
1301
1308
|
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.31.1",
|
|
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",
|
|
@@ -675,6 +675,13 @@
|
|
|
675
675
|
"$ref": "#/$defs/componentTokenBinding"
|
|
676
676
|
}
|
|
677
677
|
},
|
|
678
|
+
"toggle-group": {
|
|
679
|
+
"type": "object",
|
|
680
|
+
"description": "ToggleGroup \u2014 the outline track's fill, the selected option's fill and ink, the unselected ink, and the compact (`xs`) size: its label size, option sides and corners. SegmentedControl takes the `xs` option keys too. Keys: track-bg, selected-bg, selected-text, unselected-text, xs-font-size, xs-padding-x, xs-track-radius, xs-item-radius.",
|
|
681
|
+
"additionalProperties": {
|
|
682
|
+
"$ref": "#/$defs/componentTokenBinding"
|
|
683
|
+
}
|
|
684
|
+
},
|
|
678
685
|
"tooltip": {
|
|
679
686
|
"type": "object",
|
|
680
687
|
"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.",
|