@loworbitstudio/visor-theme-engine 0.16.0 → 0.17.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.d.ts +1 -1
- package/dist/adapters/index.js +136 -77
- package/dist/{chunk-DQ256PSE.js → chunk-BUWBBUFG.js} +64 -2
- package/dist/index.d.ts +179 -5
- package/dist/index.js +243 -12
- package/dist/{types-BstIS9rL.d.ts → types-Cvm7vFwe.d.ts} +79 -4
- package/package.json +1 -1
- package/src/visor-theme.schema.json +83 -2
|
@@ -291,6 +291,12 @@ interface BrandPillar {
|
|
|
291
291
|
statement: string;
|
|
292
292
|
/** What the pillar governs (coherence-checked against the live system). */
|
|
293
293
|
governs: BrandGoverns;
|
|
294
|
+
/**
|
|
295
|
+
* Reasons-to-believe — the message-house foundation (VI-541, Phase 2 wave-1).
|
|
296
|
+
* Concrete, checkable evidence backing this pillar's claim. Optional so a
|
|
297
|
+
* record can carry pillars without proof points.
|
|
298
|
+
*/
|
|
299
|
+
proof?: string[];
|
|
294
300
|
}
|
|
295
301
|
/** A fixed voice trait with a worked example. */
|
|
296
302
|
interface BrandVoiceTrait {
|
|
@@ -319,15 +325,56 @@ interface BrandLexiconEntry {
|
|
|
319
325
|
use: string;
|
|
320
326
|
avoid: string;
|
|
321
327
|
}
|
|
328
|
+
/** Message-house roof — the single umbrella message above the pillars. */
|
|
329
|
+
interface BrandMessaging {
|
|
330
|
+
/** One overarching statement the pillars support (message-house roof). */
|
|
331
|
+
roof: string;
|
|
332
|
+
}
|
|
333
|
+
/** Reusable "about us" copy — short and long forms. */
|
|
334
|
+
interface BrandBoilerplate {
|
|
335
|
+
short: string;
|
|
336
|
+
long: string;
|
|
337
|
+
}
|
|
338
|
+
/** A color-pairing rule expressed as brand intent (not a computed value). */
|
|
339
|
+
interface BrandColorPairing {
|
|
340
|
+
/** The token or role being used (e.g. `--primary`). */
|
|
341
|
+
use: string;
|
|
342
|
+
/** What it pairs against (token, role, or surface). */
|
|
343
|
+
with: string;
|
|
344
|
+
/** The intent — when and how the pairing is allowed. */
|
|
345
|
+
rule: string;
|
|
346
|
+
}
|
|
347
|
+
/** Color-usage intent — the brand's allowed pairings. */
|
|
348
|
+
interface BrandColorUsage {
|
|
349
|
+
pairings: BrandColorPairing[];
|
|
350
|
+
}
|
|
351
|
+
/** A contrast target expressed as brand intent (a WCAG 2.1 AA threshold). */
|
|
352
|
+
interface BrandContrastTarget {
|
|
353
|
+
/** The text/UI context the target applies to. */
|
|
354
|
+
context: string;
|
|
355
|
+
/** The minimum contrast ratio (e.g. "4.5:1"). */
|
|
356
|
+
ratio: string;
|
|
357
|
+
}
|
|
358
|
+
/** Accessibility intent — the standard and its contrast targets. */
|
|
359
|
+
interface BrandAccessibility {
|
|
360
|
+
/** The conformance standard. Visor targets "WCAG 2.1 AA". */
|
|
361
|
+
standard: string;
|
|
362
|
+
/** WCAG 2.1 AA contrast targets, authored as intent (live computation is the render surface's concern). */
|
|
363
|
+
contrast: BrandContrastTarget[];
|
|
364
|
+
/** How the brand applies the standard (intent, not computed results). */
|
|
365
|
+
intent: string;
|
|
366
|
+
}
|
|
322
367
|
/** Visibility of a brand strategy. Client brands are `private`. */
|
|
323
368
|
type BrandVisibility = "public" | "private";
|
|
324
369
|
/**
|
|
325
370
|
* The `brand-strategy` block — strategy + verbal identity as data.
|
|
326
371
|
*
|
|
327
372
|
* `tone` is keyed by UI state (`error`, `success`, …); the keys are validated
|
|
328
|
-
* against the recognized UI states (coherence check D2).
|
|
329
|
-
* required in v1 — F1 authors the full record, and the downstream Workbench
|
|
330
|
-
* surfaces render each section.
|
|
373
|
+
* against the recognized UI states (coherence check D2). The ten Phase 1 fields
|
|
374
|
+
* are required in v1 — F1 authors the full record, and the downstream Workbench
|
|
375
|
+
* surfaces render each section. The Phase 2 wave-1 fields (`messaging`,
|
|
376
|
+
* `taglines`, `boilerplate`, `colorUsage`, `accessibility`; VI-541) are optional
|
|
377
|
+
* so a record — e.g. a private client brand — can omit them.
|
|
331
378
|
*/
|
|
332
379
|
interface BrandStrategy {
|
|
333
380
|
positioning: BrandPositioning;
|
|
@@ -343,6 +390,16 @@ interface BrandStrategy {
|
|
|
343
390
|
/** Aaker core/extended — the immutable subset, as section names. */
|
|
344
391
|
core: string[];
|
|
345
392
|
visibility: BrandVisibility;
|
|
393
|
+
/** Message-house roof — the umbrella message above the pillars. */
|
|
394
|
+
messaging?: BrandMessaging;
|
|
395
|
+
/** Permanent, brand-level signature line(s) — who the brand is, not what it sells this quarter. */
|
|
396
|
+
taglines?: string[];
|
|
397
|
+
/** Reusable "about us" copy — short and long forms. */
|
|
398
|
+
boilerplate?: BrandBoilerplate;
|
|
399
|
+
/** Color-usage intent — the brand's allowed pairings. */
|
|
400
|
+
colorUsage?: BrandColorUsage;
|
|
401
|
+
/** Accessibility intent — WCAG 2.1 AA standard + contrast targets. */
|
|
402
|
+
accessibility?: BrandAccessibility;
|
|
346
403
|
}
|
|
347
404
|
/**
|
|
348
405
|
* The agent-facing projection of a brand strategy, embedded in
|
|
@@ -426,6 +483,11 @@ interface TextSlotOverride {
|
|
|
426
483
|
/** Letter spacing in logical pixels (Flutter `TextStyle.letterSpacing`). */
|
|
427
484
|
"letter-spacing"?: number;
|
|
428
485
|
}
|
|
486
|
+
/**
|
|
487
|
+
* BO-55/BO-56: brand color-mode constraint. `dark-only`/`light-only` lock the
|
|
488
|
+
* brand to a single mode; `adaptive` supports both (the historical default).
|
|
489
|
+
*/
|
|
490
|
+
type ColorScheme = "dark-only" | "light-only" | "adaptive";
|
|
429
491
|
interface VisorThemeConfig {
|
|
430
492
|
name: string;
|
|
431
493
|
version: 1;
|
|
@@ -435,6 +497,13 @@ interface VisorThemeConfig {
|
|
|
435
497
|
label?: string;
|
|
436
498
|
/** Default color mode to force when the theme is activated ('dark' or 'light'). If unset, user/system preference applies. */
|
|
437
499
|
"default-mode"?: "dark" | "light";
|
|
500
|
+
/**
|
|
501
|
+
* BO-55: Brand constraint declaring which color modes the theme supports.
|
|
502
|
+
* 'dark-only'/'light-only' lock the brand to a single mode; 'adaptive' supports both.
|
|
503
|
+
* Complements `default-mode` (the runtime default) — `color-scheme` is authoritative
|
|
504
|
+
* for the brand-lock. Defaults to 'adaptive' when omitted.
|
|
505
|
+
*/
|
|
506
|
+
"color-scheme"?: ColorScheme;
|
|
438
507
|
colors: {
|
|
439
508
|
primary: string;
|
|
440
509
|
accent?: string;
|
|
@@ -617,6 +686,12 @@ interface ResolvedThemeConfig {
|
|
|
617
686
|
label?: string;
|
|
618
687
|
/** Default color mode forwarded from VisorThemeConfig["default-mode"]. */
|
|
619
688
|
"default-mode"?: "dark" | "light";
|
|
689
|
+
/**
|
|
690
|
+
* BO-55: Brand constraint for supported color modes. Always resolved (defaults
|
|
691
|
+
* to 'adaptive' when the theme omits it) so downstream readers (engine/extractor/gate)
|
|
692
|
+
* get a guaranteed value.
|
|
693
|
+
*/
|
|
694
|
+
"color-scheme": ColorScheme;
|
|
620
695
|
version: 1;
|
|
621
696
|
colors: {
|
|
622
697
|
primary: string;
|
|
@@ -779,4 +854,4 @@ interface ThemeData {
|
|
|
779
854
|
output: ThemeOutput;
|
|
780
855
|
}
|
|
781
856
|
|
|
782
|
-
export { type
|
|
857
|
+
export { type FontSource as $, type BrandColorUsage as A, type BrandSlot as B, type ColorScheme as C, type BrandContrastTarget as D, type BrandGoverns as E, type FontResolveOptions as F, type GoogleFontEntry as G, type BrandLexiconEntry as H, type BrandMessaging as I, type BrandPersonalityTrait as J, type BrandPillar as K, type BrandPositioning as L, type BrandStrategyIssueSeverity as M, type BrandToneEntry as N, type OKLCH as O, type ParsedColor as P, type BrandVariant as Q, type ResolvedThemeConfig as R, type SerializedBrandStrategy as S, type ThemeFontResult as T, type BrandVisibility as U, type VisorTypography as V, type BrandVoice as W, type BrandVoiceTrait as X, type ColorFormat as Y, DEFAULT_BRAND_STRATEGY_SURFACES as Z, DEFAULT_BRAND_STRATEGY_TONE_STATES as _, type FontResolution as a, GOVERNS_WILDCARD as a0, type RGBA as a1, type SemanticTokenValue as a2, type FontDisplayStrategy as b, type VisorBrand as c, type BrandSource as d, type BrandResolution as e, type ThemeBrandResult as f, type BrandStrategy as g, type BrandStrategyContext as h, type BrandStrategyIssue as i, type BrandStrategyValidationResult as j, type GeneratedPrimitives as k, type ThemeOutput as l, type ThemeData as m, type VisorThemeConfig as n, type FullShadeScale as o, type ColorRole as p, type SelectiveShadeScale as q, type RGB as r, type SemanticTokens as s, type ShadeStep as t, BRAND_VARIANTS as u, BRAND_VISIBILITIES as v, type BrandAccessibility as w, type BrandArchetype as x, type BrandBoilerplate as y, type BrandColorPairing as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loworbitstudio/visor-theme-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.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",
|
|
@@ -29,6 +29,11 @@
|
|
|
29
29
|
"enum": ["light", "dark"],
|
|
30
30
|
"description": "Default color mode when activating this theme. When set, the docs site forces this mode on theme switch (unless the user has a stored mode preference). Optional."
|
|
31
31
|
},
|
|
32
|
+
"color-scheme": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": ["dark-only", "light-only", "adaptive"],
|
|
35
|
+
"description": "Brand constraint declaring which color modes the theme supports. 'dark-only'/'light-only' lock the brand to a single mode; 'adaptive' supports both. Complements 'default-mode' (the runtime default) — 'color-scheme' is authoritative for the brand-lock. Defaults to 'adaptive' when omitted. Optional."
|
|
36
|
+
},
|
|
32
37
|
"colors": {
|
|
33
38
|
"type": "object",
|
|
34
39
|
"description": "Color definitions for light mode. Only primary is required — all others have sensible defaults.",
|
|
@@ -343,7 +348,17 @@
|
|
|
343
348
|
"type": "string",
|
|
344
349
|
"enum": ["public", "private"],
|
|
345
350
|
"description": "Client brands are private and are omitted from the public agent manifest."
|
|
346
|
-
}
|
|
351
|
+
},
|
|
352
|
+
"messaging": { "$ref": "#/$defs/brandMessaging" },
|
|
353
|
+
"taglines": {
|
|
354
|
+
"type": "array",
|
|
355
|
+
"items": { "type": "string", "minLength": 1 },
|
|
356
|
+
"minItems": 1,
|
|
357
|
+
"description": "Phase 2 wave-1 (VI-541). Permanent, brand-level signature line(s) — who the brand is, not what it sells this quarter."
|
|
358
|
+
},
|
|
359
|
+
"boilerplate": { "$ref": "#/$defs/brandBoilerplate" },
|
|
360
|
+
"colorUsage": { "$ref": "#/$defs/brandColorUsage" },
|
|
361
|
+
"accessibility": { "$ref": "#/$defs/brandAccessibility" }
|
|
347
362
|
}
|
|
348
363
|
},
|
|
349
364
|
"spacing": {
|
|
@@ -565,7 +580,13 @@
|
|
|
565
580
|
"properties": {
|
|
566
581
|
"id": { "type": "string", "minLength": 1 },
|
|
567
582
|
"statement": { "type": "string", "minLength": 1, "description": "The pillar's claim in one line." },
|
|
568
|
-
"governs": { "$ref": "#/$defs/brandGoverns" }
|
|
583
|
+
"governs": { "$ref": "#/$defs/brandGoverns" },
|
|
584
|
+
"proof": {
|
|
585
|
+
"type": "array",
|
|
586
|
+
"items": { "type": "string", "minLength": 1 },
|
|
587
|
+
"minItems": 1,
|
|
588
|
+
"description": "Phase 2 wave-1 (VI-541). Reasons-to-believe — checkable evidence backing this pillar's claim (the message-house foundation)."
|
|
589
|
+
}
|
|
569
590
|
}
|
|
570
591
|
},
|
|
571
592
|
"brandVoice": {
|
|
@@ -608,6 +629,66 @@
|
|
|
608
629
|
"use": { "type": "string", "minLength": 1 },
|
|
609
630
|
"avoid": { "type": "string", "minLength": 1 }
|
|
610
631
|
}
|
|
632
|
+
},
|
|
633
|
+
"brandMessaging": {
|
|
634
|
+
"type": "object",
|
|
635
|
+
"description": "Phase 2 wave-1 (VI-541). Message-house roof — the single umbrella message above the pillars.",
|
|
636
|
+
"additionalProperties": false,
|
|
637
|
+
"required": ["roof"],
|
|
638
|
+
"properties": {
|
|
639
|
+
"roof": { "type": "string", "minLength": 1, "description": "One overarching statement the pillars support." }
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
"brandBoilerplate": {
|
|
643
|
+
"type": "object",
|
|
644
|
+
"description": "Phase 2 wave-1 (VI-541). Reusable \"about us\" copy — short and long forms.",
|
|
645
|
+
"additionalProperties": false,
|
|
646
|
+
"required": ["short", "long"],
|
|
647
|
+
"properties": {
|
|
648
|
+
"short": { "type": "string", "minLength": 1 },
|
|
649
|
+
"long": { "type": "string", "minLength": 1 }
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
"brandColorPairing": {
|
|
653
|
+
"type": "object",
|
|
654
|
+
"description": "A color-pairing rule expressed as brand intent (not a computed value).",
|
|
655
|
+
"additionalProperties": false,
|
|
656
|
+
"required": ["use", "with", "rule"],
|
|
657
|
+
"properties": {
|
|
658
|
+
"use": { "type": "string", "minLength": 1, "description": "The token or role being used (e.g. --primary)." },
|
|
659
|
+
"with": { "type": "string", "minLength": 1, "description": "What it pairs against (token, role, or surface)." },
|
|
660
|
+
"rule": { "type": "string", "minLength": 1, "description": "The intent — when and how the pairing is allowed." }
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
"brandColorUsage": {
|
|
664
|
+
"type": "object",
|
|
665
|
+
"description": "Phase 2 wave-1 (VI-541). Color-usage intent — the brand's allowed pairings.",
|
|
666
|
+
"additionalProperties": false,
|
|
667
|
+
"required": ["pairings"],
|
|
668
|
+
"properties": {
|
|
669
|
+
"pairings": { "type": "array", "items": { "$ref": "#/$defs/brandColorPairing" }, "minItems": 1 }
|
|
670
|
+
}
|
|
671
|
+
},
|
|
672
|
+
"brandContrastTarget": {
|
|
673
|
+
"type": "object",
|
|
674
|
+
"description": "A contrast target expressed as brand intent (a WCAG 2.1 AA threshold).",
|
|
675
|
+
"additionalProperties": false,
|
|
676
|
+
"required": ["context", "ratio"],
|
|
677
|
+
"properties": {
|
|
678
|
+
"context": { "type": "string", "minLength": 1, "description": "The text/UI context the target applies to." },
|
|
679
|
+
"ratio": { "type": "string", "minLength": 1, "description": "The minimum contrast ratio (e.g. \"4.5:1\")." }
|
|
680
|
+
}
|
|
681
|
+
},
|
|
682
|
+
"brandAccessibility": {
|
|
683
|
+
"type": "object",
|
|
684
|
+
"description": "Phase 2 wave-1 (VI-541). Accessibility intent — the standard and its contrast targets (authored as intent; live computation is the render surface's concern).",
|
|
685
|
+
"additionalProperties": false,
|
|
686
|
+
"required": ["standard", "contrast", "intent"],
|
|
687
|
+
"properties": {
|
|
688
|
+
"standard": { "type": "string", "minLength": 1, "description": "The conformance standard. Visor targets \"WCAG 2.1 AA\"." },
|
|
689
|
+
"contrast": { "type": "array", "items": { "$ref": "#/$defs/brandContrastTarget" }, "minItems": 1 },
|
|
690
|
+
"intent": { "type": "string", "minLength": 1, "description": "How the brand applies the standard (intent, not computed results)." }
|
|
691
|
+
}
|
|
611
692
|
}
|
|
612
693
|
}
|
|
613
694
|
}
|