@loworbitstudio/visor-theme-engine 0.12.0 → 0.13.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.d.ts +1 -1
- package/dist/adapters/index.js +1 -1
- package/dist/{chunk-B56A5DE6.js → chunk-KFTTL3XP.js} +2 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +23 -4
- package/dist/{types-BKEkyelS.d.ts → types-CSO2avFQ.d.ts} +8 -1
- package/package.json +1 -1
- package/src/visor-theme.schema.json +1 -0
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as GeneratedPrimitives, m as SemanticTokens, R as ResolvedThemeConfig } from '../types-
|
|
1
|
+
import { g as GeneratedPrimitives, m as SemanticTokens, R as ResolvedThemeConfig } from '../types-CSO2avFQ.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Adapter types for the Visor theme engine.
|
package/dist/adapters/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
resolveThemeBrand,
|
|
19
19
|
resolveThemeFonts,
|
|
20
20
|
sectionComment
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-KFTTL3XP.js";
|
|
22
22
|
|
|
23
23
|
// src/adapters/layers.ts
|
|
24
24
|
var LAYER_ORDER = "@layer visor-primitives, visor-semantic, visor-brand, visor-adaptive, visor-bridge;";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FontResolveOptions, a as FontResolution, V as VisorTypography, b as FontDisplayStrategy, T as ThemeFontResult, G as GoogleFontEntry, c as VisorBrand, B as BrandSlot, d as BrandSource, e as BrandResolution, f as ThemeBrandResult, R as ResolvedThemeConfig, g as GeneratedPrimitives, h as ThemeOutput, i as ThemeData, j as VisorThemeConfig, k as FullShadeScale, C as ColorRole, S as SelectiveShadeScale, l as RGB, P as ParsedColor, O as OKLCH, m as SemanticTokens, n as ShadeStep } from './types-
|
|
2
|
-
export { o as BRAND_VARIANTS, p as BrandVariant, q as ColorFormat, r as FontSource, s as RGBA, t as SemanticTokenValue } from './types-
|
|
1
|
+
import { F as FontResolveOptions, a as FontResolution, V as VisorTypography, b as FontDisplayStrategy, T as ThemeFontResult, G as GoogleFontEntry, c as VisorBrand, B as BrandSlot, d as BrandSource, e as BrandResolution, f as ThemeBrandResult, R as ResolvedThemeConfig, g as GeneratedPrimitives, h as ThemeOutput, i as ThemeData, j as VisorThemeConfig, k as FullShadeScale, C as ColorRole, S as SelectiveShadeScale, l as RGB, P as ParsedColor, O as OKLCH, m as SemanticTokens, n as ShadeStep } from './types-CSO2avFQ.js';
|
|
2
|
+
export { o as BRAND_VARIANTS, p as BrandVariant, q as ColorFormat, r as FontSource, s as RGBA, t as SemanticTokenValue } from './types-CSO2avFQ.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Font resolver — maps font family names to loadable font resources.
|
|
@@ -631,6 +631,9 @@ var properties = {
|
|
|
631
631
|
favicon: {
|
|
632
632
|
$ref: "#/$defs/brandSlot"
|
|
633
633
|
},
|
|
634
|
+
animated: {
|
|
635
|
+
$ref: "#/$defs/brandSlot"
|
|
636
|
+
},
|
|
634
637
|
custom: {
|
|
635
638
|
type: "object",
|
|
636
639
|
description: "Operator-defined slots, addressed by key.",
|
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
rgbToHex,
|
|
43
43
|
rgbToOklch,
|
|
44
44
|
serializeColor
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-KFTTL3XP.js";
|
|
46
46
|
|
|
47
47
|
// src/fonts/validate-coverage.ts
|
|
48
48
|
var FONT_VAR_RE = /--font-(heading|display|body|sans|mono)\s*:\s*([^;]+);/g;
|
|
@@ -457,6 +457,7 @@ var visor_theme_schema_default = {
|
|
|
457
457
|
wordmark: { $ref: "#/$defs/brandSlot" },
|
|
458
458
|
monochrome: { $ref: "#/$defs/brandSlot" },
|
|
459
459
|
favicon: { $ref: "#/$defs/brandSlot" },
|
|
460
|
+
animated: { $ref: "#/$defs/brandSlot" },
|
|
460
461
|
custom: {
|
|
461
462
|
type: "object",
|
|
462
463
|
description: "Operator-defined slots, addressed by key.",
|
|
@@ -705,9 +706,10 @@ var KNOWN_BRAND_KEYS = /* @__PURE__ */ new Set([
|
|
|
705
706
|
"wordmark",
|
|
706
707
|
"monochrome",
|
|
707
708
|
"favicon",
|
|
709
|
+
"animated",
|
|
708
710
|
"custom"
|
|
709
711
|
]);
|
|
710
|
-
var KNOWN_BRAND_STANDARD_SLOTS = ["logo", "brandmark", "wordmark", "monochrome", "favicon"];
|
|
712
|
+
var KNOWN_BRAND_STANDARD_SLOTS = ["logo", "brandmark", "wordmark", "monochrome", "favicon", "animated"];
|
|
711
713
|
var KNOWN_BRAND_SLOT_KEYS = /* @__PURE__ */ new Set(["slug", "formats", "light", "dark", "clearSpace", "aspectRatio"]);
|
|
712
714
|
var KNOWN_BRAND_SOURCES = /* @__PURE__ */ new Set(["visor-brands", "local"]);
|
|
713
715
|
var KNOWN_BRAND_CDN_OVERRIDE_KEYS = /* @__PURE__ */ new Set(["visor-brands"]);
|
|
@@ -1039,6 +1041,20 @@ function validateConfig(config) {
|
|
|
1039
1041
|
}
|
|
1040
1042
|
}
|
|
1041
1043
|
}
|
|
1044
|
+
if (typeof brand.animated === "object" && brand.animated !== null) {
|
|
1045
|
+
const animated = brand.animated;
|
|
1046
|
+
if (Array.isArray(animated.formats) && !animated.formats.every(
|
|
1047
|
+
(f) => typeof f === "string" && f.toLowerCase() === "svg"
|
|
1048
|
+
)) {
|
|
1049
|
+
errors.push("'brand.animated.formats' must be SVG-only (the animated slot accepts self-contained animated SVGs only)");
|
|
1050
|
+
}
|
|
1051
|
+
for (const mode of ["light", "dark"]) {
|
|
1052
|
+
const p = animated[mode];
|
|
1053
|
+
if (typeof p === "string" && !p.toLowerCase().endsWith(".svg")) {
|
|
1054
|
+
errors.push(`'brand.animated.${mode}' must be an .svg path (the animated slot is SVG-only)`);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1042
1058
|
}
|
|
1043
1059
|
}
|
|
1044
1060
|
if (obj.overrides !== void 0) {
|
|
@@ -1112,6 +1128,9 @@ function resolveBrand(brand) {
|
|
|
1112
1128
|
wordmark: brand.wordmark ?? DEFAULT_VISOR_BRAND.wordmark,
|
|
1113
1129
|
monochrome: brand.monochrome ?? DEFAULT_VISOR_BRAND.monochrome,
|
|
1114
1130
|
favicon: brand.favicon ?? DEFAULT_VISOR_BRAND.favicon,
|
|
1131
|
+
// animated is optional with no Visor default (D2): pass through only when a
|
|
1132
|
+
// theme declares it, so undeclared themes emit no --brand-animated.
|
|
1133
|
+
...brand.animated && { animated: brand.animated },
|
|
1115
1134
|
...brand.custom && { custom: brand.custom }
|
|
1116
1135
|
};
|
|
1117
1136
|
}
|
|
@@ -1407,7 +1426,7 @@ var SEMANTIC_SURFACE_MAP = {
|
|
|
1407
1426
|
// VI-478: status soft tints (BL-193) — alpha overlays, semantically distinct
|
|
1408
1427
|
// from the OPAQUE `surface-{status}-subtle` above (do NOT alias them together).
|
|
1409
1428
|
// Default to a color-mix of the status color so they track the theme; themes
|
|
1410
|
-
// pin exact values via overrides (blacklight-
|
|
1429
|
+
// pin exact values via overrides (blacklight-pro: success @10%,
|
|
1411
1430
|
// warning/error @12%).
|
|
1412
1431
|
"success-soft": {
|
|
1413
1432
|
light: { constant: "color-mix(in srgb, var(--color-success-500) 10%, transparent)" },
|
|
@@ -1504,7 +1523,7 @@ var SEMANTIC_INTERACTIVE_MAP = {
|
|
|
1504
1523
|
// VI-478: brand-derived alpha-overlay helpers (BL-193). `soft`/`glow` are
|
|
1505
1524
|
// alpha overlays that track the theme's primary via color-mix (distinct from
|
|
1506
1525
|
// any opaque surface); `strong` is a solid lightened-brand emphasis color.
|
|
1507
|
-
// Themes pin exact values via overrides — e.g. blacklight-
|
|
1526
|
+
// Themes pin exact values via overrides — e.g. blacklight-pro sets
|
|
1508
1527
|
// soft @12% / glow @32% / strong #FFD050.
|
|
1509
1528
|
"primary-soft": {
|
|
1510
1529
|
light: { constant: "color-mix(in srgb, var(--color-primary-500) 12%, transparent)" },
|
|
@@ -138,7 +138,7 @@ type BrandSource = "visor-brands" | "local";
|
|
|
138
138
|
* Standard brand variant slots. A fixed set covers the common lockups; custom
|
|
139
139
|
* operator-defined slots are addressed by key through the `custom` map.
|
|
140
140
|
*/
|
|
141
|
-
type BrandVariant = "logo" | "brandmark" | "wordmark" | "monochrome" | "favicon";
|
|
141
|
+
type BrandVariant = "logo" | "brandmark" | "wordmark" | "monochrome" | "favicon" | "animated";
|
|
142
142
|
/** Ordered list of the standard brand variant slots. */
|
|
143
143
|
declare const BRAND_VARIANTS: readonly BrandVariant[];
|
|
144
144
|
/**
|
|
@@ -185,6 +185,13 @@ interface VisorBrand {
|
|
|
185
185
|
monochrome?: BrandSlot;
|
|
186
186
|
/** Favicon source. */
|
|
187
187
|
favicon?: BrandSlot;
|
|
188
|
+
/**
|
|
189
|
+
* Animated lockup. Optional and SVG-only (D2/D3): the asset must be a
|
|
190
|
+
* self-contained animated SVG (inlined `<style>`/@keyframes or SMIL) so it
|
|
191
|
+
* animates inside `<img>`. Stock themes omit this — absent → no
|
|
192
|
+
* `--brand-animated` emitted. Reduced-motion consumers fall back to `logo`.
|
|
193
|
+
*/
|
|
194
|
+
animated?: BrandSlot;
|
|
188
195
|
/** Operator-defined slots, addressed by key. */
|
|
189
196
|
custom?: Record<string, BrandSlot>;
|
|
190
197
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loworbitstudio/visor-theme-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.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",
|
|
@@ -253,6 +253,7 @@
|
|
|
253
253
|
"wordmark": { "$ref": "#/$defs/brandSlot" },
|
|
254
254
|
"monochrome": { "$ref": "#/$defs/brandSlot" },
|
|
255
255
|
"favicon": { "$ref": "#/$defs/brandSlot" },
|
|
256
|
+
"animated": { "$ref": "#/$defs/brandSlot" },
|
|
256
257
|
"custom": {
|
|
257
258
|
"type": "object",
|
|
258
259
|
"description": "Operator-defined slots, addressed by key.",
|