@loworbitstudio/visor-theme-engine 0.34.1 → 0.35.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.
@@ -1,4 +1,4 @@
1
- import { k as GeneratedPrimitives, s as SemanticTokens, R as ResolvedThemeConfig } from '../types-C7nWZ5fB.js';
1
+ import { k as GeneratedPrimitives, s as SemanticTokens, R as ResolvedThemeConfig } from '../types-BzMsNXmX.js';
2
2
 
3
3
  /**
4
4
  * Adapter types for the Visor theme engine.
@@ -29,7 +29,7 @@ import {
29
29
  resolveThemeBrand,
30
30
  resolveThemeFonts,
31
31
  sectionComment
32
- } from "../chunk-AULV4PDD.js";
32
+ } from "../chunk-WK6TF5EZ.js";
33
33
 
34
34
  // src/adapters/brand-passthrough.ts
35
35
  var SENTINEL_COLOR = "#ff00ff";
@@ -584,7 +584,7 @@ function generateTypographyDecls(config, aliases) {
584
584
  decls.push(`--font-heading: ${fontStack(headingFamily, aliases)};`);
585
585
  decls.push(`--font-body: ${fontStack(config.typography.body.family, aliases)};`);
586
586
  decls.push(`--font-mono: ${fontStack(config.typography.mono.family, aliases)};`);
587
- decls.push(...generateFontSizeDecls(config.typography.scale));
587
+ decls.push(...generateFontSizeDecls(config.typography.scale, config.typography.floor));
588
588
  decls.push(...generateFontMetricDecls(config.typography.body.family));
589
589
  decls.push(...generateFontWeightDecls(config.typography));
590
590
  decls.push(...generateFontTextTransformDecls(config.typography));
@@ -1280,6 +1280,7 @@ var RADIO_GROUP = "components/ui/radio-group/radio-group.module.css";
1280
1280
  var TOOLTIP = "components/ui/tooltip/tooltip.module.css";
1281
1281
  var ACTION_ROW = "components/ui/action-row/action-row.module.css";
1282
1282
  var DIALOG_FIELD = "blocks/dialog-field/dialog-field.module.css";
1283
+ var ADMIN_SHELL = "blocks/admin-shell/admin-shell.module.css";
1283
1284
  function at(file, fallback) {
1284
1285
  return [{ file, fallback }];
1285
1286
  }
@@ -1606,6 +1607,18 @@ var sidebarFamily = {
1606
1607
  { key: "item-active-font-weight", property: "font-weight", description: "Active nav-item weight.", consumers: at(SIDEBAR, "var(--font-weight-medium, 500)") }
1607
1608
  ]
1608
1609
  };
1610
+ var adminShellFamily = {
1611
+ family: "admin-shell",
1612
+ prefix: "admin-shell",
1613
+ description: "AdminShell block chrome. Every rule the shell draws is a token, so a theme that separates surfaces by tone (Paper) sets them to `none` and gets a borderless shell.",
1614
+ tokens: [
1615
+ { key: "sidebar-border", property: "border-right", description: "Rule between the sidebar and the body.", consumers: at(ADMIN_SHELL, "1px solid var(--border-default, #e5e7eb)") },
1616
+ { key: "sidebar-header-border", property: "border-bottom", description: "Rule under the sidebar header.", consumers: at(ADMIN_SHELL, "1px solid var(--border-muted, #e5e7eb)") },
1617
+ { key: "sidebar-footer-border", property: "border-top", description: "Rule above the sidebar footer.", consumers: at(ADMIN_SHELL, "1px solid var(--border-muted, #e5e7eb)") },
1618
+ { key: "topbar-bg", property: "background", description: "Topbar fill.", consumers: at(ADMIN_SHELL, "var(--surface-card, #ffffff)") },
1619
+ { key: "topbar-border", property: "border-bottom", description: "Rule under the topbar.", consumers: at(ADMIN_SHELL, "1px solid var(--border-default, #e5e7eb)") }
1620
+ ]
1621
+ };
1609
1622
  var tabsFamily = {
1610
1623
  family: "tabs",
1611
1624
  prefix: "tabs",
@@ -2327,6 +2340,7 @@ var COMPONENT_TOKEN_FAMILIES = [
2327
2340
  emptyStateFamily,
2328
2341
  bannerFamily,
2329
2342
  sidebarFamily,
2343
+ adminShellFamily,
2330
2344
  tabsFamily,
2331
2345
  skeletonFamily,
2332
2346
  spinnerFamily,
@@ -2855,9 +2869,9 @@ var FONT_SIZE_RAMP_PX = {
2855
2869
  "3xl": 30,
2856
2870
  "4xl": 36
2857
2871
  };
2858
- function generateFontSizeDecls(scale) {
2872
+ function generateFontSizeDecls(scale, floor = 0) {
2859
2873
  return Object.entries(FONT_SIZE_RAMP_PX).map(([name, px]) => {
2860
- const scaled = px * scale;
2874
+ const scaled = Math.max(px * scale, floor);
2861
2875
  const rem = Number((scaled / 16).toFixed(5));
2862
2876
  return `--font-size-${name}: ${rem}rem; /* ${Number(scaled.toFixed(2))}px */`;
2863
2877
  });
@@ -2877,7 +2891,7 @@ function generateTypographyPrimitives(config, aliases = EMPTY_ALIASES) {
2877
2891
  decls.push(`--font-sans: ${fontStack(config.typography.body.family, aliases)};`);
2878
2892
  decls.push(`--font-body: ${fontStack(config.typography.body.family, aliases)};`);
2879
2893
  decls.push(`--font-mono: ${fontStack(config.typography.mono.family, aliases)};`);
2880
- decls.push(...generateFontSizeDecls(config.typography.scale));
2894
+ decls.push(...generateFontSizeDecls(config.typography.scale, config.typography.floor));
2881
2895
  decls.push(...generateFontMetricDecls(config.typography.body.family));
2882
2896
  decls.push(...generateFontWeightDecls(config.typography));
2883
2897
  decls.push(...generateFontTextTransformDecls(config.typography));
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, C as ColorScheme, f as ThemeBrandResult, g as BrandStrategy, h as BrandStrategyContext, i as BrandStrategyIssue, j as BrandStrategyValidationResult, S as SerializedBrandStrategy, R as ResolvedThemeConfig, k as GeneratedPrimitives, l as ThemeOutput, m as ThemeData, n as VisorThemeConfig, o as FullShadeScale, p as ColorRole, q as SelectiveShadeScale, r as RGB, P as ParsedColor, O as OKLCH, s as SemanticTokens, t as ShadeStep } from './types-C7nWZ5fB.js';
2
- export { u as BRAND_VARIANTS, v as BRAND_VISIBILITIES, w as BrandAccessibility, x as BrandArchetype, y as BrandBoilerplate, z as BrandColorPairing, A as BrandColorUsage, D as BrandContrastTarget, E as BrandGoverns, H as BrandLexiconEntry, I as BrandMessaging, J as BrandPersonalityTrait, K as BrandPillar, L as BrandPositioning, M as BrandStrategyIssueSeverity, N as BrandToneEntry, Q as BrandVariant, U as BrandVisibility, W as BrandVoice, X as BrandVoiceTrait, Y as COMPONENT_TOKEN_FAMILIES, Z as COMPONENT_TOKEN_FAMILY_BY_NAME, _ as ColorFormat, $ as ComponentTokenBinding, a0 as ComponentTokenBindings, a1 as ComponentTokenConsumer, a2 as ComponentTokenFamily, a3 as ComponentTokenSpec, a4 as DEFAULT_BRAND_STRATEGY_SURFACES, a5 as DEFAULT_BRAND_STRATEGY_TONE_STATES, a6 as FontSource, a7 as GOVERNS_WILDCARD, a8 as RGBA, a9 as ResolvedComponentTokens, aa as SemanticTokenValue, ab as allComponentTokenNames, ac as componentTokenName, ad as hasComponentBindings, ae as resolveComponentBindings, af as validateComponentBindings } from './types-C7nWZ5fB.js';
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, C as ColorScheme, f as ThemeBrandResult, g as BrandStrategy, h as BrandStrategyContext, i as BrandStrategyIssue, j as BrandStrategyValidationResult, S as SerializedBrandStrategy, R as ResolvedThemeConfig, k as GeneratedPrimitives, l as ThemeOutput, m as ThemeData, n as VisorThemeConfig, o as FullShadeScale, p as ColorRole, q as SelectiveShadeScale, r as RGB, P as ParsedColor, O as OKLCH, s as SemanticTokens, t as ShadeStep } from './types-BzMsNXmX.js';
2
+ export { u as BRAND_VARIANTS, v as BRAND_VISIBILITIES, w as BrandAccessibility, x as BrandArchetype, y as BrandBoilerplate, z as BrandColorPairing, A as BrandColorUsage, D as BrandContrastTarget, E as BrandGoverns, H as BrandLexiconEntry, I as BrandMessaging, J as BrandPersonalityTrait, K as BrandPillar, L as BrandPositioning, M as BrandStrategyIssueSeverity, N as BrandToneEntry, Q as BrandVariant, U as BrandVisibility, W as BrandVoice, X as BrandVoiceTrait, Y as COMPONENT_TOKEN_FAMILIES, Z as COMPONENT_TOKEN_FAMILY_BY_NAME, _ as ColorFormat, $ as ComponentTokenBinding, a0 as ComponentTokenBindings, a1 as ComponentTokenConsumer, a2 as ComponentTokenFamily, a3 as ComponentTokenSpec, a4 as DEFAULT_BRAND_STRATEGY_SURFACES, a5 as DEFAULT_BRAND_STRATEGY_TONE_STATES, a6 as FontSource, a7 as GOVERNS_WILDCARD, a8 as RGBA, a9 as ResolvedComponentTokens, aa as SemanticTokenValue, ab as allComponentTokenNames, ac as componentTokenName, ad as hasComponentBindings, ae as resolveComponentBindings, af as validateComponentBindings } from './types-BzMsNXmX.js';
3
3
 
4
4
  /**
5
5
  * Font resolver — maps font family names to loadable font resources.
@@ -643,6 +643,11 @@ var properties = {
643
643
  type: "number",
644
644
  description: "Type scale multiplier applied to the font-size ramp: every --font-size-* step is multiplied by it, and the page inherits the scaled --font-size-base. Default: 1. CSS adapters only — the Flutter adapter emits Material 3 slot sizes verbatim and ignores this field."
645
645
  },
646
+ floor: {
647
+ type: "number",
648
+ minimum: 0,
649
+ description: "VI-754: smallest size in px any --font-size-* step may emit. A step that scales below it is raised to it (Paper sets 13, so --font-size-xs is 13px). Unset: no floor. CSS adapters only."
650
+ },
646
651
  "text-on-light": {
647
652
  type: "string",
648
653
  description: "VI-375: text color placed on a LIGHT interactive background. Auto-picked for interactive *-text tokens whose paired *-bg has relative luminance > 0.5. Defaults to #FFFFFF (which deliberately still fails AA on a bright bg so the contrast validator flags it); set a readable near-black (e.g. #1E1F21) to clear the warning. Per-token overrides (overrides.{mode}.interactive-*-text) still win."
@@ -1156,6 +1161,13 @@ var properties = {
1156
1161
  $ref: "#/$defs/componentTokenBinding"
1157
1162
  }
1158
1163
  },
1164
+ "admin-shell": {
1165
+ type: "object",
1166
+ description: "AdminShell block chrome. Every rule the shell draws is a token, so a theme that separates surfaces by tone (Paper) sets them to `none` and gets a borderless shell. Keys: sidebar-border, sidebar-header-border, sidebar-footer-border, topbar-bg, topbar-border.",
1167
+ additionalProperties: {
1168
+ $ref: "#/$defs/componentTokenBinding"
1169
+ }
1170
+ },
1159
1171
  tabs: {
1160
1172
  type: "object",
1161
1173
  description: "Tab rail and trigger treatment, for both the segmented (`default`) and underlined (`line`) variants. Keys: list-radius, list-height, list-padding, list-color, list-bg, line-border-bottom, trigger-radius, trigger-padding, trigger-font-size, trigger-font-weight, trigger-letter-spacing, trigger-text-transform, trigger-color, trigger-active-bg, trigger-active-color, trigger-active-shadow, indicator-height, indicator-color.",
package/dist/index.js CHANGED
@@ -68,7 +68,7 @@ import {
68
68
  rgbToOklch,
69
69
  serializeColor,
70
70
  validateComponentBindings
71
- } from "./chunk-AULV4PDD.js";
71
+ } from "./chunk-WK6TF5EZ.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;
@@ -840,6 +840,11 @@ var visor_theme_schema_default = {
840
840
  type: "number",
841
841
  description: "Type scale multiplier applied to the font-size ramp: every --font-size-* step is multiplied by it, and the page inherits the scaled --font-size-base. Default: 1. CSS adapters only \u2014 the Flutter adapter emits Material 3 slot sizes verbatim and ignores this field."
842
842
  },
843
+ floor: {
844
+ type: "number",
845
+ minimum: 0,
846
+ description: "VI-754: smallest size in px any --font-size-* step may emit. A step that scales below it is raised to it (Paper sets 13, so --font-size-xs is 13px). Unset: no floor. CSS adapters only."
847
+ },
843
848
  "text-on-light": {
844
849
  type: "string",
845
850
  description: "VI-375: text color placed on a LIGHT interactive background. Auto-picked for interactive *-text tokens whose paired *-bg has relative luminance > 0.5. Defaults to #FFFFFF (which deliberately still fails AA on a bright bg so the contrast validator flags it); set a readable near-black (e.g. #1E1F21) to clear the warning. Per-token overrides (overrides.{mode}.interactive-*-text) still win."
@@ -1177,6 +1182,13 @@ var visor_theme_schema_default = {
1177
1182
  $ref: "#/$defs/componentTokenBinding"
1178
1183
  }
1179
1184
  },
1185
+ "admin-shell": {
1186
+ type: "object",
1187
+ description: "AdminShell block chrome. Every rule the shell draws is a token, so a theme that separates surfaces by tone (Paper) sets them to `none` and gets a borderless shell. Keys: sidebar-border, sidebar-header-border, sidebar-footer-border, topbar-bg, topbar-border.",
1188
+ additionalProperties: {
1189
+ $ref: "#/$defs/componentTokenBinding"
1190
+ }
1191
+ },
1180
1192
  tabs: {
1181
1193
  type: "object",
1182
1194
  description: "Tab rail and trigger treatment, for both the segmented (`default`) and underlined (`line`) variants. Keys: list-radius, list-height, list-padding, list-color, list-bg, line-border-bottom, trigger-radius, trigger-padding, trigger-font-size, trigger-font-weight, trigger-letter-spacing, trigger-text-transform, trigger-color, trigger-active-bg, trigger-active-color, trigger-active-shadow, indicator-height, indicator-color.",
@@ -1651,6 +1663,7 @@ var KNOWN_TYPOGRAPHY_KEYS = /* @__PURE__ */ new Set([
1651
1663
  "mono",
1652
1664
  "letter-spacing",
1653
1665
  "scale",
1666
+ "floor",
1654
1667
  "slots",
1655
1668
  "cdn-overrides",
1656
1669
  // VI-375: default text colors for interactive backgrounds (auto-picked by
@@ -2230,6 +2243,7 @@ function resolveConfig(config) {
2230
2243
  "colors-dark": config["colors-dark"],
2231
2244
  typography: {
2232
2245
  scale: config.typography?.scale ?? DEFAULTS.typography.scale,
2246
+ ...config.typography?.floor !== void 0 && { floor: config.typography.floor },
2233
2247
  "text-on-light": config.typography?.["text-on-light"] ?? DEFAULTS.typography["text-on-light"],
2234
2248
  "text-on-dark": config.typography?.["text-on-dark"] ?? DEFAULTS.typography["text-on-dark"],
2235
2249
  heading: {
@@ -687,6 +687,11 @@ interface VisorThemeConfig {
687
687
  * Material 3 slot sizes verbatim. Default: 1.
688
688
  */
689
689
  scale?: number;
690
+ /**
691
+ * Smallest size, in px, any `--font-size-*` step may emit (VI-754). A step
692
+ * that scales below it is raised to it. CSS adapters only. Unset: no floor.
693
+ */
694
+ floor?: number;
690
695
  /**
691
696
  * VI-375: text color placed on a LIGHT interactive background. Auto-picked
692
697
  * for interactive `*-text` tokens whose paired `*-bg` resolves to a light
@@ -902,6 +907,8 @@ interface ResolvedThemeConfig {
902
907
  * Material 3 slot sizes verbatim. Default: 1.
903
908
  */
904
909
  scale: number;
910
+ /** Smallest `--font-size-*` step in px (VI-754). Unset: no floor. */
911
+ floor?: number;
905
912
  /**
906
913
  * VI-375: resolved default text color for LIGHT interactive backgrounds.
907
914
  * Always present (defaults to `#1E1F21`); theme-overridable.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loworbitstudio/visor-theme-engine",
3
- "version": "0.34.1",
3
+ "version": "0.35.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",
@@ -219,6 +219,11 @@
219
219
  "type": "number",
220
220
  "description": "Type scale multiplier applied to the font-size ramp: every --font-size-* step is multiplied by it, and the page inherits the scaled --font-size-base. Default: 1. CSS adapters only — the Flutter adapter emits Material 3 slot sizes verbatim and ignores this field."
221
221
  },
222
+ "floor": {
223
+ "type": "number",
224
+ "minimum": 0,
225
+ "description": "VI-754: smallest size in px any --font-size-* step may emit. A step that scales below it is raised to it (Paper sets 13, so --font-size-xs is 13px). Unset: no floor. CSS adapters only."
226
+ },
222
227
  "text-on-light": {
223
228
  "type": "string",
224
229
  "description": "VI-375: text color placed on a LIGHT interactive background. Auto-picked for interactive *-text tokens whose paired *-bg has relative luminance > 0.5. Defaults to #FFFFFF (which deliberately still fails AA on a bright bg so the contrast validator flags it); set a readable near-black (e.g. #1E1F21) to clear the warning. Per-token overrides (overrides.{mode}.interactive-*-text) still win."
@@ -556,6 +561,13 @@
556
561
  "$ref": "#/$defs/componentTokenBinding"
557
562
  }
558
563
  },
564
+ "admin-shell": {
565
+ "type": "object",
566
+ "description": "AdminShell block chrome. Every rule the shell draws is a token, so a theme that separates surfaces by tone (Paper) sets them to `none` and gets a borderless shell. Keys: sidebar-border, sidebar-header-border, sidebar-footer-border, topbar-bg, topbar-border.",
567
+ "additionalProperties": {
568
+ "$ref": "#/$defs/componentTokenBinding"
569
+ }
570
+ },
559
571
  "tabs": {
560
572
  "type": "object",
561
573
  "description": "Tab rail and trigger treatment, for both the segmented (`default`) and underlined (`line`) variants. Keys: list-radius, list-height, list-padding, list-color, list-bg, line-border-bottom, trigger-radius, trigger-padding, trigger-font-size, trigger-font-weight, trigger-letter-spacing, trigger-text-transform, trigger-color, trigger-active-bg, trigger-active-color, trigger-active-shadow, indicator-height, indicator-color.",