@loworbitstudio/visor-theme-engine 0.41.0 → 0.42.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 +17 -4
- package/dist/{chunk-KWNSKA6L.js → chunk-C6RLV7WM.js} +65 -22
- package/dist/index.d.ts +46 -2
- package/dist/index.js +74 -5
- package/dist/{types-Cz2u5kQs.d.ts → types-PXhSooKd.d.ts} +31 -0
- package/package.json +1 -1
- package/src/visor-theme.schema.json +41 -0
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as GeneratedPrimitives, s as SemanticTokens, R as ResolvedThemeConfig } from '../types-
|
|
1
|
+
import { k as GeneratedPrimitives, s as SemanticTokens, R as ResolvedThemeConfig } from '../types-PXhSooKd.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Adapter types for the Visor theme engine.
|
package/dist/adapters/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
+
CORNER_SHAPE_BINDING,
|
|
3
|
+
DEFAULT_EASING_OUT,
|
|
2
4
|
FULL_SHADE_STEPS,
|
|
3
5
|
MATERIAL_TEXT_SLOTS,
|
|
4
6
|
SELECTIVE_SHADE_STEPS,
|
|
@@ -10,6 +12,7 @@ import {
|
|
|
10
12
|
collectBrandPassthrough,
|
|
11
13
|
collectDeclaredProperties,
|
|
12
14
|
fontStack,
|
|
15
|
+
generateCornerShapeDecls,
|
|
13
16
|
generateDarkCss,
|
|
14
17
|
generateFontMetricDecls,
|
|
15
18
|
generateFontSizeDecls,
|
|
@@ -18,6 +21,7 @@ import {
|
|
|
18
21
|
generateHairlineDecls,
|
|
19
22
|
generateIntentDecls,
|
|
20
23
|
generateLightCss,
|
|
24
|
+
generateOptInMotionDurationDecls,
|
|
21
25
|
generatePrimitivesCss,
|
|
22
26
|
generateSemanticAliasDecls,
|
|
23
27
|
generateShadeScale,
|
|
@@ -29,7 +33,7 @@ import {
|
|
|
29
33
|
resolveThemeBrand,
|
|
30
34
|
resolveThemeFonts,
|
|
31
35
|
sectionComment
|
|
32
|
-
} from "../chunk-
|
|
36
|
+
} from "../chunk-C6RLV7WM.js";
|
|
33
37
|
|
|
34
38
|
// src/adapters/brand-passthrough.ts
|
|
35
39
|
var SENTINEL_COLOR = "#ff00ff";
|
|
@@ -229,6 +233,11 @@ function nextjsAdapter(input, options) {
|
|
|
229
233
|
"background: var(--surface-page, var(--surface-background));"
|
|
230
234
|
])
|
|
231
235
|
);
|
|
236
|
+
if (input.config.corners === "squircle") {
|
|
237
|
+
baseLines.push("");
|
|
238
|
+
baseLines.push(sectionComment("Base: corner shape"));
|
|
239
|
+
baseLines.push(CORNER_SHAPE_BINDING);
|
|
240
|
+
}
|
|
232
241
|
lines.push(wrapInLayer("visor-base", baseLines.join("\n").trim()));
|
|
233
242
|
lines.push("");
|
|
234
243
|
}
|
|
@@ -573,7 +582,8 @@ function generateRadiusDecls(config) {
|
|
|
573
582
|
`--radius-xl: ${config.radius.xl / 16}rem; /* ${config.radius.xl}px */`,
|
|
574
583
|
`--radius-2xl: ${config.radius.xl * 1.333 / 16}rem; /* ${Math.round(config.radius.xl * 1.333)}px */`,
|
|
575
584
|
`--radius-3xl: ${config.radius.xl * 2 / 16}rem; /* ${config.radius.xl * 2}px */`,
|
|
576
|
-
`--radius-full: ${config.radius.pill}px
|
|
585
|
+
`--radius-full: ${config.radius.pill}px;`,
|
|
586
|
+
...generateCornerShapeDecls(config)
|
|
577
587
|
];
|
|
578
588
|
}
|
|
579
589
|
function generateTypographyDecls(config, aliases) {
|
|
@@ -628,9 +638,10 @@ function generateMotionDecls(config) {
|
|
|
628
638
|
`--motion-duration-500: ${config.motion["duration-slow"]};`,
|
|
629
639
|
"--motion-duration-800: 800ms;",
|
|
630
640
|
"--motion-duration-1500: 1500ms;",
|
|
641
|
+
...generateOptInMotionDurationDecls(config),
|
|
631
642
|
"--motion-easing-linear: linear;",
|
|
632
643
|
"--motion-easing-ease-in: cubic-bezier(0.4, 0, 1, 1);",
|
|
633
|
-
|
|
644
|
+
`--motion-easing-ease-out: ${config.motion["easing-out"] ?? DEFAULT_EASING_OUT};`,
|
|
634
645
|
`--motion-easing-ease-in-out: ${config.motion.easing};`,
|
|
635
646
|
"--motion-easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);"
|
|
636
647
|
];
|
|
@@ -960,7 +971,9 @@ ${inner.split("\n").map((l) => ` ${l}`).join("\n")}
|
|
|
960
971
|
const brandLayerBody = [brandResult.css, passthroughCss].filter(Boolean).join("\n\n");
|
|
961
972
|
const brandLayer = wrapInLayer("visor-brand", brandLayerBody);
|
|
962
973
|
const head = fontLines.length > 0 ? fontLines.join("\n") + "\n" : "";
|
|
963
|
-
const
|
|
974
|
+
const baseLayer = input.config.corners === "squircle" ? wrapInLayer("visor-base", `${sectionComment2("Base: corner shape")}
|
|
975
|
+
${CORNER_SHAPE_BINDING}`) : "";
|
|
976
|
+
const layerBlocks = [baseLayer, semanticLayer, brandLayer, adaptiveLayer].filter(Boolean);
|
|
964
977
|
return head + LAYER_ORDER + "\n\n" + layerBlocks.join("\n\n") + "\n";
|
|
965
978
|
}
|
|
966
979
|
|
|
@@ -1671,6 +1671,24 @@ var dialogFamily = {
|
|
|
1671
1671
|
{ key: "overlay-blur", property: "backdrop-filter: blur()", description: "How much the scrim blurs the page, a length.", consumers: [{ file: DIALOG, fallback: "4px" }, { file: DIALOG, fallback: "2px" }] }
|
|
1672
1672
|
]
|
|
1673
1673
|
};
|
|
1674
|
+
var glassFamily = {
|
|
1675
|
+
family: "glass",
|
|
1676
|
+
prefix: "glass",
|
|
1677
|
+
description: 'The glass layer over a photo: surface fill, blur, edge, lift, shadow and on-photo ink, plus the glass values controls read. Draws only inside `data-glass="on"`; elsewhere components keep their solid surface and border.',
|
|
1678
|
+
tokens: [
|
|
1679
|
+
{ key: "fill", property: "background", description: "Glass surface fill, see-through.", consumers: [], recommended: "color-mix(in srgb, var(--text-primary) 5%, transparent)" },
|
|
1680
|
+
{ key: "blur", property: "backdrop-filter", description: "Filter on the photo behind a glass surface.", consumers: [], recommended: "blur(32px) saturate(110%)" },
|
|
1681
|
+
{ key: "edge", property: "border-color", description: "Edge colour, drawn with `mix-blend-mode: soft-light`.", consumers: [], recommended: "color-mix(in srgb, var(--text-primary) 25%, transparent)" },
|
|
1682
|
+
{ key: "lift", property: "background", description: "White lift laid over the fill, e.g. `rgb(255 255 255 / 0.45)` in light.", consumers: [], recommended: "transparent" },
|
|
1683
|
+
{ key: "shadow", property: "box-shadow", description: "Glass surface shadow.", consumers: [], recommended: "var(--shadow-xl)" },
|
|
1684
|
+
{ key: "ink", property: "color", description: "Text colour on glass over a photo.", consumers: [], recommended: "var(--text-primary)" },
|
|
1685
|
+
{ key: "control-fill", property: "background", description: "Glass control fill (icon buttons, toggles).", consumers: [], recommended: "color-mix(in srgb, var(--text-primary) 14%, transparent)" },
|
|
1686
|
+
{ key: "control-hover-fill", property: "background", description: "Glass control fill on hover.", consumers: [], recommended: "color-mix(in srgb, var(--text-primary) 24%, transparent)" },
|
|
1687
|
+
{ key: "control-ring", property: "box-shadow (inset ring)", description: "Glass control ring colour.", consumers: [], recommended: "color-mix(in srgb, var(--text-primary) 16%, transparent)" },
|
|
1688
|
+
{ key: "control-ink", property: "color", description: "Glass control icon and label colour.", consumers: [], recommended: "var(--text-primary)" },
|
|
1689
|
+
{ key: "control-blur", property: "backdrop-filter", description: "Filter on the photo behind a glass control.", consumers: [], recommended: "blur(16px)" }
|
|
1690
|
+
]
|
|
1691
|
+
};
|
|
1674
1692
|
var tabsFamily = {
|
|
1675
1693
|
family: "tabs",
|
|
1676
1694
|
prefix: "tabs",
|
|
@@ -2545,6 +2563,7 @@ var COMPONENT_TOKEN_FAMILIES = [
|
|
|
2545
2563
|
billingSliderFamily,
|
|
2546
2564
|
resizableSplitFamily,
|
|
2547
2565
|
dialogFamily,
|
|
2566
|
+
glassFamily,
|
|
2548
2567
|
tabsFamily,
|
|
2549
2568
|
skeletonFamily,
|
|
2550
2569
|
spinnerFamily,
|
|
@@ -2970,6 +2989,34 @@ function generateFontWeightDecls(typography) {
|
|
|
2970
2989
|
return decls;
|
|
2971
2990
|
}
|
|
2972
2991
|
|
|
2992
|
+
// src/types.ts
|
|
2993
|
+
var OPT_IN_MOTION_DURATION_KEYS = [
|
|
2994
|
+
"duration-enter",
|
|
2995
|
+
"duration-exit",
|
|
2996
|
+
"duration-page",
|
|
2997
|
+
"duration-stagger",
|
|
2998
|
+
"duration-enter-delay"
|
|
2999
|
+
];
|
|
3000
|
+
var TEXT_TRANSFORMS = ["none", "uppercase", "lowercase", "capitalize"];
|
|
3001
|
+
var MATERIAL_TEXT_SLOTS = [
|
|
3002
|
+
"displayLarge",
|
|
3003
|
+
"displayMedium",
|
|
3004
|
+
"displaySmall",
|
|
3005
|
+
"headlineLarge",
|
|
3006
|
+
"headlineMedium",
|
|
3007
|
+
"headlineSmall",
|
|
3008
|
+
"titleLarge",
|
|
3009
|
+
"titleMedium",
|
|
3010
|
+
"titleSmall",
|
|
3011
|
+
"bodyLarge",
|
|
3012
|
+
"bodyMedium",
|
|
3013
|
+
"bodySmall",
|
|
3014
|
+
"labelLarge",
|
|
3015
|
+
"labelMedium",
|
|
3016
|
+
"labelSmall",
|
|
3017
|
+
"labelXSmall"
|
|
3018
|
+
];
|
|
3019
|
+
|
|
2973
3020
|
// src/fonts/theme-alias.ts
|
|
2974
3021
|
var EMPTY_ALIASES = /* @__PURE__ */ new Map();
|
|
2975
3022
|
function aliasFamily(family, themeSlug) {
|
|
@@ -3055,8 +3102,19 @@ function generateRadiusPrimitives(config) {
|
|
|
3055
3102
|
`--radius-3xl: ${config.radius.xl * 2 / 16}rem; /* ${config.radius.xl * 2}px */`
|
|
3056
3103
|
);
|
|
3057
3104
|
decls.push(`--radius-full: ${config.radius.pill}px;`);
|
|
3105
|
+
decls.push(...generateCornerShapeDecls(config));
|
|
3058
3106
|
return decls;
|
|
3059
3107
|
}
|
|
3108
|
+
function generateCornerShapeDecls(config) {
|
|
3109
|
+
return config.corners === "squircle" ? ["--corner-shape: squircle;"] : [];
|
|
3110
|
+
}
|
|
3111
|
+
var CORNER_SHAPE_BINDING = "*, *::before, *::after {\n corner-shape: var(--corner-shape);\n}";
|
|
3112
|
+
var DEFAULT_EASING_OUT = "cubic-bezier(0, 0, 0.2, 1)";
|
|
3113
|
+
function generateOptInMotionDurationDecls(config) {
|
|
3114
|
+
return OPT_IN_MOTION_DURATION_KEYS.filter((key) => config.motion[key] !== void 0).map(
|
|
3115
|
+
(key) => `--motion-${key}: ${config.motion[key]};`
|
|
3116
|
+
);
|
|
3117
|
+
}
|
|
3060
3118
|
function generateShadowPrimitives(config) {
|
|
3061
3119
|
return [
|
|
3062
3120
|
`--shadow-xs: ${config.shadows.xs};`,
|
|
@@ -3124,9 +3182,10 @@ function generateMotionPrimitives(config) {
|
|
|
3124
3182
|
decls.push(`--motion-duration-500: ${config.motion["duration-slow"]};`);
|
|
3125
3183
|
decls.push("--motion-duration-800: 800ms;");
|
|
3126
3184
|
decls.push("--motion-duration-1500: 1500ms;");
|
|
3185
|
+
decls.push(...generateOptInMotionDurationDecls(config));
|
|
3127
3186
|
decls.push("--motion-easing-linear: linear;");
|
|
3128
3187
|
decls.push("--motion-easing-ease-in: cubic-bezier(0.4, 0, 1, 1);");
|
|
3129
|
-
decls.push(
|
|
3188
|
+
decls.push(`--motion-easing-ease-out: ${config.motion["easing-out"] ?? DEFAULT_EASING_OUT};`);
|
|
3130
3189
|
decls.push(`--motion-easing-ease-in-out: ${config.motion.easing};`);
|
|
3131
3190
|
decls.push(
|
|
3132
3191
|
"--motion-easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);"
|
|
@@ -3553,27 +3612,6 @@ function generateSemanticAliasDecls(declared, options = {}) {
|
|
|
3553
3612
|
return decls;
|
|
3554
3613
|
}
|
|
3555
3614
|
|
|
3556
|
-
// src/types.ts
|
|
3557
|
-
var TEXT_TRANSFORMS = ["none", "uppercase", "lowercase", "capitalize"];
|
|
3558
|
-
var MATERIAL_TEXT_SLOTS = [
|
|
3559
|
-
"displayLarge",
|
|
3560
|
-
"displayMedium",
|
|
3561
|
-
"displaySmall",
|
|
3562
|
-
"headlineLarge",
|
|
3563
|
-
"headlineMedium",
|
|
3564
|
-
"headlineSmall",
|
|
3565
|
-
"titleLarge",
|
|
3566
|
-
"titleMedium",
|
|
3567
|
-
"titleSmall",
|
|
3568
|
-
"bodyLarge",
|
|
3569
|
-
"bodyMedium",
|
|
3570
|
-
"bodySmall",
|
|
3571
|
-
"labelLarge",
|
|
3572
|
-
"labelMedium",
|
|
3573
|
-
"labelSmall",
|
|
3574
|
-
"labelXSmall"
|
|
3575
|
-
];
|
|
3576
|
-
|
|
3577
3615
|
export {
|
|
3578
3616
|
googleFontsCatalog,
|
|
3579
3617
|
lookupGoogleFont,
|
|
@@ -3611,6 +3649,7 @@ export {
|
|
|
3611
3649
|
isValidColor,
|
|
3612
3650
|
compositeOverBackground,
|
|
3613
3651
|
serializeColor,
|
|
3652
|
+
OPT_IN_MOTION_DURATION_KEYS,
|
|
3614
3653
|
TEXT_TRANSFORMS,
|
|
3615
3654
|
MATERIAL_TEXT_SLOTS,
|
|
3616
3655
|
componentTokenName,
|
|
@@ -3641,6 +3680,10 @@ export {
|
|
|
3641
3680
|
header,
|
|
3642
3681
|
sectionComment,
|
|
3643
3682
|
block2 as block,
|
|
3683
|
+
generateCornerShapeDecls,
|
|
3684
|
+
CORNER_SHAPE_BINDING,
|
|
3685
|
+
DEFAULT_EASING_OUT,
|
|
3686
|
+
generateOptInMotionDurationDecls,
|
|
3644
3687
|
generateFontSizeDecls,
|
|
3645
3688
|
generateFontTextTransformDecls,
|
|
3646
3689
|
generatePrimitivesCss,
|
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-
|
|
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-
|
|
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-PXhSooKd.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-PXhSooKd.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Font resolver — maps font family names to loadable font resources.
|
|
@@ -416,6 +416,14 @@ var properties = {
|
|
|
416
416
|
],
|
|
417
417
|
description: "The one switch for hairlines (VI-680). 'off' sets --hairline-width to 0, so every hairline rule, divider and ring disappears. Shorthand for components.hairline.width: \"0\" (an explicit binding there wins). Independent of 'edges'. Defaults to 'on'. Optional."
|
|
418
418
|
},
|
|
419
|
+
corners: {
|
|
420
|
+
type: "string",
|
|
421
|
+
"enum": [
|
|
422
|
+
"round",
|
|
423
|
+
"squircle"
|
|
424
|
+
],
|
|
425
|
+
description: "The one switch for corner shape (VI-796). 'squircle' emits --corner-shape: squircle and binds corner-shape to every element, so each border-radius draws as a squircle; browsers without corner-shape draw round. Set --corner-shape: round on any ancestor to keep a part round. Defaults to 'round' (nothing emitted). Optional."
|
|
426
|
+
},
|
|
419
427
|
colors: {
|
|
420
428
|
type: "object",
|
|
421
429
|
description: "Color definitions for light mode. Only primary is required — all others have sensible defaults.",
|
|
@@ -1062,6 +1070,35 @@ var properties = {
|
|
|
1062
1070
|
easing: {
|
|
1063
1071
|
type: "string",
|
|
1064
1072
|
description: "Default easing curve as a CSS timing function."
|
|
1073
|
+
},
|
|
1074
|
+
"easing-out": {
|
|
1075
|
+
type: "string",
|
|
1076
|
+
description: "Out curve as a CSS timing function (VI-796). Emits --motion-easing-ease-out, which --motion-easing-enter reads. Default: cubic-bezier(0, 0, 0.2, 1)."
|
|
1077
|
+
},
|
|
1078
|
+
"duration-enter": {
|
|
1079
|
+
type: "string",
|
|
1080
|
+
pattern: "^\\d+ms$",
|
|
1081
|
+
description: "Opt-in duration for entrances (VI-796). Emits --motion-duration-enter only when set. No default."
|
|
1082
|
+
},
|
|
1083
|
+
"duration-exit": {
|
|
1084
|
+
type: "string",
|
|
1085
|
+
pattern: "^\\d+ms$",
|
|
1086
|
+
description: "Opt-in duration for exits (VI-796). Emits --motion-duration-exit only when set. No default."
|
|
1087
|
+
},
|
|
1088
|
+
"duration-page": {
|
|
1089
|
+
type: "string",
|
|
1090
|
+
pattern: "^\\d+ms$",
|
|
1091
|
+
description: "Opt-in duration for page transitions (VI-796). Emits --motion-duration-page only when set. No default."
|
|
1092
|
+
},
|
|
1093
|
+
"duration-stagger": {
|
|
1094
|
+
type: "string",
|
|
1095
|
+
pattern: "^\\d+ms$",
|
|
1096
|
+
description: "Opt-in duration for the gap between staggered items (VI-796). Emits --motion-duration-stagger only when set. No default."
|
|
1097
|
+
},
|
|
1098
|
+
"duration-enter-delay": {
|
|
1099
|
+
type: "string",
|
|
1100
|
+
pattern: "^\\d+ms$",
|
|
1101
|
+
description: "Opt-in duration for the delay before an entrance starts (VI-796). Emits --motion-duration-enter-delay only when set. No default."
|
|
1065
1102
|
}
|
|
1066
1103
|
}
|
|
1067
1104
|
},
|
|
@@ -1189,6 +1226,13 @@ var properties = {
|
|
|
1189
1226
|
$ref: "#/$defs/componentTokenBinding"
|
|
1190
1227
|
}
|
|
1191
1228
|
},
|
|
1229
|
+
glass: {
|
|
1230
|
+
type: "object",
|
|
1231
|
+
description: "The glass layer over a photo: surface fill, blur, edge, lift, shadow and on-photo ink, plus the glass values controls read. Draws only inside `data-glass=\"on\"`; elsewhere components keep their solid surface and border. Keys: fill, blur, edge, lift, shadow, ink, control-fill, control-hover-fill, control-ring, control-ink, control-blur.",
|
|
1232
|
+
additionalProperties: {
|
|
1233
|
+
$ref: "#/$defs/componentTokenBinding"
|
|
1234
|
+
}
|
|
1235
|
+
},
|
|
1192
1236
|
tabs: {
|
|
1193
1237
|
type: "object",
|
|
1194
1238
|
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
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
FONT_WEIGHT_ALIASES,
|
|
8
8
|
MATERIAL_TEXT_SLOTS,
|
|
9
9
|
MODE_DEPENDENT_SEMANTIC_ALIASES,
|
|
10
|
+
OPT_IN_MOTION_DURATION_KEYS,
|
|
10
11
|
TAILWIND_GRAY,
|
|
11
12
|
TEXT_TRANSFORMS,
|
|
12
13
|
VISOR_BRANDS_CDN,
|
|
@@ -68,7 +69,7 @@ import {
|
|
|
68
69
|
rgbToOklch,
|
|
69
70
|
serializeColor,
|
|
70
71
|
validateComponentBindings
|
|
71
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-C6RLV7WM.js";
|
|
72
73
|
|
|
73
74
|
// src/fonts/validate-coverage.ts
|
|
74
75
|
var FONT_VAR_RE = /--font-(heading|display|body|sans|mono)\s*:\s*([^;]+);/g;
|
|
@@ -665,6 +666,11 @@ var visor_theme_schema_default = {
|
|
|
665
666
|
enum: ["on", "off"],
|
|
666
667
|
description: `The one switch for hairlines (VI-680). 'off' sets --hairline-width to 0, so every hairline rule, divider and ring disappears. Shorthand for components.hairline.width: "0" (an explicit binding there wins). Independent of 'edges'. Defaults to 'on'. Optional.`
|
|
667
668
|
},
|
|
669
|
+
corners: {
|
|
670
|
+
type: "string",
|
|
671
|
+
enum: ["round", "squircle"],
|
|
672
|
+
description: "The one switch for corner shape (VI-796). 'squircle' emits --corner-shape: squircle and binds corner-shape to every element, so each border-radius draws as a squircle; browsers without corner-shape draw round. Set --corner-shape: round on any ancestor to keep a part round. Defaults to 'round' (nothing emitted). Optional."
|
|
673
|
+
},
|
|
668
674
|
colors: {
|
|
669
675
|
type: "object",
|
|
670
676
|
description: "Color definitions for light mode. Only primary is required \u2014 all others have sensible defaults.",
|
|
@@ -1087,6 +1093,35 @@ var visor_theme_schema_default = {
|
|
|
1087
1093
|
easing: {
|
|
1088
1094
|
type: "string",
|
|
1089
1095
|
description: "Default easing curve as a CSS timing function."
|
|
1096
|
+
},
|
|
1097
|
+
"easing-out": {
|
|
1098
|
+
type: "string",
|
|
1099
|
+
description: "Out curve as a CSS timing function (VI-796). Emits --motion-easing-ease-out, which --motion-easing-enter reads. Default: cubic-bezier(0, 0, 0.2, 1)."
|
|
1100
|
+
},
|
|
1101
|
+
"duration-enter": {
|
|
1102
|
+
type: "string",
|
|
1103
|
+
pattern: "^\\d+ms$",
|
|
1104
|
+
description: "Opt-in duration for entrances (VI-796). Emits --motion-duration-enter only when set. No default."
|
|
1105
|
+
},
|
|
1106
|
+
"duration-exit": {
|
|
1107
|
+
type: "string",
|
|
1108
|
+
pattern: "^\\d+ms$",
|
|
1109
|
+
description: "Opt-in duration for exits (VI-796). Emits --motion-duration-exit only when set. No default."
|
|
1110
|
+
},
|
|
1111
|
+
"duration-page": {
|
|
1112
|
+
type: "string",
|
|
1113
|
+
pattern: "^\\d+ms$",
|
|
1114
|
+
description: "Opt-in duration for page transitions (VI-796). Emits --motion-duration-page only when set. No default."
|
|
1115
|
+
},
|
|
1116
|
+
"duration-stagger": {
|
|
1117
|
+
type: "string",
|
|
1118
|
+
pattern: "^\\d+ms$",
|
|
1119
|
+
description: "Opt-in duration for the gap between staggered items (VI-796). Emits --motion-duration-stagger only when set. No default."
|
|
1120
|
+
},
|
|
1121
|
+
"duration-enter-delay": {
|
|
1122
|
+
type: "string",
|
|
1123
|
+
pattern: "^\\d+ms$",
|
|
1124
|
+
description: "Opt-in duration for the delay before an entrance starts (VI-796). Emits --motion-duration-enter-delay only when set. No default."
|
|
1090
1125
|
}
|
|
1091
1126
|
}
|
|
1092
1127
|
},
|
|
@@ -1210,6 +1245,13 @@ var visor_theme_schema_default = {
|
|
|
1210
1245
|
$ref: "#/$defs/componentTokenBinding"
|
|
1211
1246
|
}
|
|
1212
1247
|
},
|
|
1248
|
+
glass: {
|
|
1249
|
+
type: "object",
|
|
1250
|
+
description: 'The glass layer over a photo: surface fill, blur, edge, lift, shadow and on-photo ink, plus the glass values controls read. Draws only inside `data-glass="on"`; elsewhere components keep their solid surface and border. Keys: fill, blur, edge, lift, shadow, ink, control-fill, control-hover-fill, control-ring, control-ink, control-blur.',
|
|
1251
|
+
additionalProperties: {
|
|
1252
|
+
$ref: "#/$defs/componentTokenBinding"
|
|
1253
|
+
}
|
|
1254
|
+
},
|
|
1213
1255
|
tabs: {
|
|
1214
1256
|
type: "object",
|
|
1215
1257
|
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.",
|
|
@@ -1685,7 +1727,8 @@ var KNOWN_TOP_LEVEL_KEYS = /* @__PURE__ */ new Set([
|
|
|
1685
1727
|
"overrides",
|
|
1686
1728
|
"components",
|
|
1687
1729
|
"edges",
|
|
1688
|
-
"hairlines"
|
|
1730
|
+
"hairlines",
|
|
1731
|
+
"corners"
|
|
1689
1732
|
]);
|
|
1690
1733
|
var KNOWN_COLOR_KEYS = /* @__PURE__ */ new Set([
|
|
1691
1734
|
"primary",
|
|
@@ -1732,7 +1775,15 @@ var KNOWN_SPACING_KEYS = /* @__PURE__ */ new Set(["base"]);
|
|
|
1732
1775
|
var KNOWN_RADIUS_KEYS = /* @__PURE__ */ new Set(["sm", "md", "lg", "xl", "pill"]);
|
|
1733
1776
|
var KNOWN_SHADOW_KEYS = /* @__PURE__ */ new Set(["xs", "sm", "md", "lg", "xl"]);
|
|
1734
1777
|
var KNOWN_STROKE_WIDTH_KEYS = /* @__PURE__ */ new Set(["thin", "regular", "medium", "thick"]);
|
|
1735
|
-
var KNOWN_MOTION_KEYS = /* @__PURE__ */ new Set([
|
|
1778
|
+
var KNOWN_MOTION_KEYS = /* @__PURE__ */ new Set([
|
|
1779
|
+
"duration-fast",
|
|
1780
|
+
"duration-normal",
|
|
1781
|
+
"duration-slow",
|
|
1782
|
+
"easing",
|
|
1783
|
+
"easing-overshoot",
|
|
1784
|
+
"easing-out",
|
|
1785
|
+
...OPT_IN_MOTION_DURATION_KEYS
|
|
1786
|
+
]);
|
|
1736
1787
|
var KNOWN_OVERRIDES_KEYS = /* @__PURE__ */ new Set(["light", "dark"]);
|
|
1737
1788
|
var KNOWN_BRAND_KEYS = /* @__PURE__ */ new Set([
|
|
1738
1789
|
"org",
|
|
@@ -1971,6 +2022,9 @@ function validateConfig(config) {
|
|
|
1971
2022
|
if (obj.hairlines !== void 0 && obj.hairlines !== "on" && obj.hairlines !== "off") {
|
|
1972
2023
|
errors.push("'hairlines' must be either 'on' or 'off'");
|
|
1973
2024
|
}
|
|
2025
|
+
if (obj.corners !== void 0 && obj.corners !== "round" && obj.corners !== "squircle") {
|
|
2026
|
+
errors.push("'corners' must be either 'round' or 'squircle'");
|
|
2027
|
+
}
|
|
1974
2028
|
if (typeof obj.colors !== "object" || obj.colors === null) {
|
|
1975
2029
|
errors.push("'colors' is required and must be an object");
|
|
1976
2030
|
return { valid: false, errors };
|
|
@@ -2013,7 +2067,7 @@ function validateConfig(config) {
|
|
|
2013
2067
|
}
|
|
2014
2068
|
if (obj.motion && typeof obj.motion === "object") {
|
|
2015
2069
|
const motion = obj.motion;
|
|
2016
|
-
for (const key of ["duration-fast", "duration-normal", "duration-slow"]) {
|
|
2070
|
+
for (const key of ["duration-fast", "duration-normal", "duration-slow", ...OPT_IN_MOTION_DURATION_KEYS]) {
|
|
2017
2071
|
if (motion[key] !== void 0) {
|
|
2018
2072
|
if (typeof motion[key] !== "string" || !/^\d+ms$/.test(motion[key])) {
|
|
2019
2073
|
errors.push(`'motion.${key}' must match pattern "Nms" (e.g., "200ms")`);
|
|
@@ -2357,8 +2411,16 @@ function resolveConfig(config) {
|
|
|
2357
2411
|
easing: config.motion?.easing ?? DEFAULTS.motion.easing,
|
|
2358
2412
|
// VI-451 (drive-by): pass through opt-in bouncy easing when set; absent
|
|
2359
2413
|
// themes leave this undefined and fall through to --motion-easing-spring.
|
|
2360
|
-
...config.motion?.["easing-overshoot"] !== void 0 ? { "easing-overshoot": config.motion["easing-overshoot"] } : {}
|
|
2414
|
+
...config.motion?.["easing-overshoot"] !== void 0 ? { "easing-overshoot": config.motion["easing-overshoot"] } : {},
|
|
2415
|
+
// VI-796: opt-in out curve and role durations, passed through only when set.
|
|
2416
|
+
...Object.fromEntries(
|
|
2417
|
+
["easing-out", ...OPT_IN_MOTION_DURATION_KEYS].filter((key) => config.motion?.[key] !== void 0).map((key) => [
|
|
2418
|
+
key,
|
|
2419
|
+
config.motion[key]
|
|
2420
|
+
])
|
|
2421
|
+
)
|
|
2361
2422
|
},
|
|
2423
|
+
...config.corners === "squircle" ? { corners: "squircle" } : {},
|
|
2362
2424
|
overrides: config.overrides,
|
|
2363
2425
|
// VI-625: component bindings pass through untouched — the contract in
|
|
2364
2426
|
// component-tokens.ts owns their shape, there is nothing to default.
|
|
@@ -3113,9 +3175,16 @@ function exportTheme(primitives, config) {
|
|
|
3113
3175
|
if (config.motion["easing-overshoot"] !== void 0) {
|
|
3114
3176
|
motion["easing-overshoot"] = config.motion["easing-overshoot"];
|
|
3115
3177
|
}
|
|
3178
|
+
for (const key of ["easing-out", ...OPT_IN_MOTION_DURATION_KEYS]) {
|
|
3179
|
+
const val = config.motion[key];
|
|
3180
|
+
if (val !== void 0) motion[key] = val;
|
|
3181
|
+
}
|
|
3116
3182
|
if (Object.keys(motion).length > 0) {
|
|
3117
3183
|
output.motion = motion;
|
|
3118
3184
|
}
|
|
3185
|
+
if (config.corners) {
|
|
3186
|
+
output.corners = config.corners;
|
|
3187
|
+
}
|
|
3119
3188
|
if (config.overrides) {
|
|
3120
3189
|
const overrides = {};
|
|
3121
3190
|
if (config.overrides.light && Object.keys(config.overrides.light).length > 0) {
|
|
@@ -819,6 +819,20 @@ interface VisorThemeConfig {
|
|
|
819
819
|
* when set; absent themes fall through to the default `--motion-easing-spring`.
|
|
820
820
|
*/
|
|
821
821
|
"easing-overshoot"?: string;
|
|
822
|
+
/**
|
|
823
|
+
* VI-796: the out curve, emitted as `--motion-easing-ease-out` (which the
|
|
824
|
+
* semantic `--motion-easing-enter` reads). Default: `cubic-bezier(0, 0, 0.2, 1)`.
|
|
825
|
+
*/
|
|
826
|
+
"easing-out"?: string;
|
|
827
|
+
/**
|
|
828
|
+
* VI-796: opt-in role durations (`Nms`). Each emits
|
|
829
|
+
* `--motion-duration-<role>` only when set, the way `easing-overshoot` does.
|
|
830
|
+
*/
|
|
831
|
+
"duration-enter"?: string;
|
|
832
|
+
"duration-exit"?: string;
|
|
833
|
+
"duration-page"?: string;
|
|
834
|
+
"duration-stagger"?: string;
|
|
835
|
+
"duration-enter-delay"?: string;
|
|
822
836
|
};
|
|
823
837
|
overrides?: {
|
|
824
838
|
light?: Record<string, string>;
|
|
@@ -850,6 +864,13 @@ interface VisorThemeConfig {
|
|
|
850
864
|
* neither switch touches the other's tokens. Default: `on`.
|
|
851
865
|
*/
|
|
852
866
|
hairlines?: "on" | "off";
|
|
867
|
+
/**
|
|
868
|
+
* VI-796: the one switch for corner shape. `squircle` emits
|
|
869
|
+
* `--corner-shape: squircle` and binds `corner-shape` to every element, so
|
|
870
|
+
* each `border-radius` draws as a squircle. Browsers without `corner-shape`
|
|
871
|
+
* drop the declaration and draw round. Default: `round` (nothing emitted).
|
|
872
|
+
*/
|
|
873
|
+
corners?: "round" | "squircle";
|
|
853
874
|
/**
|
|
854
875
|
* Migration metadata — optional, additive, consumed by `visor migrate` commands.
|
|
855
876
|
* Does not affect CSS generation or theme application.
|
|
@@ -1007,7 +1028,17 @@ interface ResolvedThemeConfig {
|
|
|
1007
1028
|
easing: string;
|
|
1008
1029
|
/** VI-451 (drive-by): opt-in bouncy easing for marker pops / scale-in entrances. */
|
|
1009
1030
|
"easing-overshoot"?: string;
|
|
1031
|
+
/** VI-796: opt-in out curve; emitters fall back to `cubic-bezier(0, 0, 0.2, 1)`. */
|
|
1032
|
+
"easing-out"?: string;
|
|
1033
|
+
/** VI-796: opt-in role durations, emitted only when set. */
|
|
1034
|
+
"duration-enter"?: string;
|
|
1035
|
+
"duration-exit"?: string;
|
|
1036
|
+
"duration-page"?: string;
|
|
1037
|
+
"duration-stagger"?: string;
|
|
1038
|
+
"duration-enter-delay"?: string;
|
|
1010
1039
|
};
|
|
1040
|
+
/** VI-796: present only when the theme sets `corners: squircle`. */
|
|
1041
|
+
corners?: "squircle";
|
|
1011
1042
|
overrides?: {
|
|
1012
1043
|
light?: Record<string, string>;
|
|
1013
1044
|
dark?: Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loworbitstudio/visor-theme-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.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",
|
|
@@ -44,6 +44,11 @@
|
|
|
44
44
|
"enum": ["on", "off"],
|
|
45
45
|
"description": "The one switch for hairlines (VI-680). 'off' sets --hairline-width to 0, so every hairline rule, divider and ring disappears. Shorthand for components.hairline.width: \"0\" (an explicit binding there wins). Independent of 'edges'. Defaults to 'on'. Optional."
|
|
46
46
|
},
|
|
47
|
+
"corners": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"enum": ["round", "squircle"],
|
|
50
|
+
"description": "The one switch for corner shape (VI-796). 'squircle' emits --corner-shape: squircle and binds corner-shape to every element, so each border-radius draws as a squircle; browsers without corner-shape draw round. Set --corner-shape: round on any ancestor to keep a part round. Defaults to 'round' (nothing emitted). Optional."
|
|
51
|
+
},
|
|
47
52
|
"colors": {
|
|
48
53
|
"type": "object",
|
|
49
54
|
"description": "Color definitions for light mode. Only primary is required — all others have sensible defaults.",
|
|
@@ -466,6 +471,35 @@
|
|
|
466
471
|
"easing": {
|
|
467
472
|
"type": "string",
|
|
468
473
|
"description": "Default easing curve as a CSS timing function."
|
|
474
|
+
},
|
|
475
|
+
"easing-out": {
|
|
476
|
+
"type": "string",
|
|
477
|
+
"description": "Out curve as a CSS timing function (VI-796). Emits --motion-easing-ease-out, which --motion-easing-enter reads. Default: cubic-bezier(0, 0, 0.2, 1)."
|
|
478
|
+
},
|
|
479
|
+
"duration-enter": {
|
|
480
|
+
"type": "string",
|
|
481
|
+
"pattern": "^\\d+ms$",
|
|
482
|
+
"description": "Opt-in duration for entrances (VI-796). Emits --motion-duration-enter only when set. No default."
|
|
483
|
+
},
|
|
484
|
+
"duration-exit": {
|
|
485
|
+
"type": "string",
|
|
486
|
+
"pattern": "^\\d+ms$",
|
|
487
|
+
"description": "Opt-in duration for exits (VI-796). Emits --motion-duration-exit only when set. No default."
|
|
488
|
+
},
|
|
489
|
+
"duration-page": {
|
|
490
|
+
"type": "string",
|
|
491
|
+
"pattern": "^\\d+ms$",
|
|
492
|
+
"description": "Opt-in duration for page transitions (VI-796). Emits --motion-duration-page only when set. No default."
|
|
493
|
+
},
|
|
494
|
+
"duration-stagger": {
|
|
495
|
+
"type": "string",
|
|
496
|
+
"pattern": "^\\d+ms$",
|
|
497
|
+
"description": "Opt-in duration for the gap between staggered items (VI-796). Emits --motion-duration-stagger only when set. No default."
|
|
498
|
+
},
|
|
499
|
+
"duration-enter-delay": {
|
|
500
|
+
"type": "string",
|
|
501
|
+
"pattern": "^\\d+ms$",
|
|
502
|
+
"description": "Opt-in duration for the delay before an entrance starts (VI-796). Emits --motion-duration-enter-delay only when set. No default."
|
|
469
503
|
}
|
|
470
504
|
}
|
|
471
505
|
},
|
|
@@ -589,6 +623,13 @@
|
|
|
589
623
|
"$ref": "#/$defs/componentTokenBinding"
|
|
590
624
|
}
|
|
591
625
|
},
|
|
626
|
+
"glass": {
|
|
627
|
+
"type": "object",
|
|
628
|
+
"description": "The glass layer over a photo: surface fill, blur, edge, lift, shadow and on-photo ink, plus the glass values controls read. Draws only inside `data-glass=\"on\"`; elsewhere components keep their solid surface and border. Keys: fill, blur, edge, lift, shadow, ink, control-fill, control-hover-fill, control-ring, control-ink, control-blur.",
|
|
629
|
+
"additionalProperties": {
|
|
630
|
+
"$ref": "#/$defs/componentTokenBinding"
|
|
631
|
+
}
|
|
632
|
+
},
|
|
592
633
|
"tabs": {
|
|
593
634
|
"type": "object",
|
|
594
635
|
"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.",
|