@loworbitstudio/visor-theme-engine 0.41.0 → 0.43.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-25CL4ADD.js} +109 -24
- package/dist/index.d.ts +55 -4
- package/dist/index.js +83 -7
- package/dist/{types-Cz2u5kQs.d.ts → types-PXhSooKd.d.ts} +31 -0
- package/package.json +1 -1
- package/src/visor-theme.schema.json +50 -2
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-25CL4ADD.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",
|
|
@@ -1724,7 +1742,7 @@ var skeletonFamily = {
|
|
|
1724
1742
|
var spinnerFamily = {
|
|
1725
1743
|
family: "spinner",
|
|
1726
1744
|
prefix: "spinner",
|
|
1727
|
-
description: "Inline loading ring \u2014 track, leading edge, per-size geometry and
|
|
1745
|
+
description: "Inline loading ring \u2014 track, leading edge, per-size geometry, cycle length, the delayed fade-in and the visible words.",
|
|
1728
1746
|
tokens: [
|
|
1729
1747
|
{ key: "track-color", property: "border-color", description: "Ring track colour.", consumers: at(SPINNER, "var(--border-default, #e5e7eb)") },
|
|
1730
1748
|
{ key: "edge-color", property: "border-top-color", description: "Leading-edge colour (default tone).", consumers: at(SPINNER, "var(--text-tertiary, #6b7280)") },
|
|
@@ -1736,7 +1754,12 @@ var spinnerFamily = {
|
|
|
1736
1754
|
{ key: "sm-size", property: "width / height", description: "Small ring diameter.", consumers: at(SPINNER, "16px") },
|
|
1737
1755
|
{ key: "sm-border-width", property: "border-width", description: "Small ring stroke.", consumers: at(SPINNER, "var(--stroke-width-regular, 1.5px)") },
|
|
1738
1756
|
{ key: "md-size", property: "width / height", description: "Default ring diameter.", consumers: at(SPINNER, "24px") },
|
|
1739
|
-
{ key: "md-border-width", property: "border-width", description: "Default ring stroke.", consumers: at(SPINNER, "var(--stroke-width-medium, 2px)") }
|
|
1757
|
+
{ key: "md-border-width", property: "border-width", description: "Default ring stroke.", consumers: at(SPINNER, "var(--stroke-width-medium, 2px)") },
|
|
1758
|
+
{ key: "appear-duration", property: "animation-duration", description: "Fade-in length once a `delay` passes.", consumers: at(SPINNER, "var(--motion-duration-500, 500ms)") },
|
|
1759
|
+
{ key: "label-gap", property: "gap", description: "Space between the spinner and its visible words (`showLabel`).", consumers: at(SPINNER, "var(--spacing-2, 0.5rem)") },
|
|
1760
|
+
{ key: "label-font-size", property: "font-size", description: "Visible words size (`showLabel`).", consumers: at(SPINNER, "var(--font-size-sm, 0.875rem)") },
|
|
1761
|
+
{ key: "label-font-weight", property: "font-weight", description: "Visible words weight (`showLabel`).", consumers: at(SPINNER, "var(--font-weight-medium, 500)") },
|
|
1762
|
+
{ key: "label-color", property: "color", description: "Visible words colour (`showLabel`).", consumers: at(SPINNER, "var(--text-secondary, #4b5563)") }
|
|
1740
1763
|
]
|
|
1741
1764
|
};
|
|
1742
1765
|
var checkboxFamily = {
|
|
@@ -2007,6 +2030,21 @@ var buttonFamily = {
|
|
|
2007
2030
|
{ key: "md-height", property: "height", description: "`md` height. Bind `auto` with `md-padding` to let the padding set the height.", consumers: at(BUTTON, "var(--label-box-height)") },
|
|
2008
2031
|
{ key: "md-padding", property: "padding", description: "`md` padding.", consumers: at(BUTTON, "0 var(--spacing-4, 1rem)") },
|
|
2009
2032
|
{ key: "dlg-padding", property: "padding", description: "`dlg` padding.", consumers: at(BUTTON, "var(--spacing-2, 0.5rem) var(--spacing-3, 0.75rem)") },
|
|
2033
|
+
// VI-807: the pill hooks. With `radius` / `icon-radius` at `999px` they draw
|
|
2034
|
+
// the Honcho kit's pill: a taller `lg`, a lifted default face, a grow on
|
|
2035
|
+
// hover and a press. Unbound, every one renders as before.
|
|
2036
|
+
{ key: "lg-height", property: "height", description: "`lg` height (`54px` for the kit's pill).", consumers: at(BUTTON, "var(--label-box-height)") },
|
|
2037
|
+
{ key: "lg-padding", property: "padding", description: "`lg` padding.", consumers: at(BUTTON, "0 var(--spacing-6, 1.5rem)") },
|
|
2038
|
+
{ key: "default-shadow", property: "box-shadow", description: "`default` variant drop shadow. Unbound, no shadow is declared.", consumers: at(BUTTON, "revert-layer") },
|
|
2039
|
+
{ key: "default-shadow-hover", property: "box-shadow", description: "`default` variant drop shadow on hover. Defaults to `default-shadow`.", consumers: at(BUTTON, "var(--button-default-shadow, revert-layer)") },
|
|
2040
|
+
{ key: "outline-text", property: "color", description: "`outline` variant ink.", consumers: at(BUTTON, "var(--text-primary, #111827)") },
|
|
2041
|
+
{ key: "outline-bg-hover", property: "background-color", description: "`outline` variant fill on hover.", consumers: at(BUTTON, "var(--surface-muted, #f3f4f6)") },
|
|
2042
|
+
{ key: "hover-scale", property: "scale", description: "Grow on hover, every variant (`1.06` for the kit). Off for disabled, gated and pending buttons.", consumers: at(BUTTON, "revert-layer") },
|
|
2043
|
+
{ key: "press-scale", property: "scale", description: "Scale while pressed (`0.97` for the kit). Replaces the hover grow while held.", consumers: at(BUTTON, "revert-layer") },
|
|
2044
|
+
{ key: "press-transform", property: "transform", description: "Press nudge. Bind `none` when `press-scale` carries the press.", consumers: at(BUTTON, "translateY(1px)") },
|
|
2045
|
+
{ key: "press-duration", property: "transition-duration", description: "How fast the press lands. Unbound, it is instant.", consumers: at(BUTTON, "0s") },
|
|
2046
|
+
{ key: "motion-duration", property: "transition-duration", description: "Duration of the fill, ink, grow, shadow and arrow-swap transitions.", consumers: at(BUTTON, "var(--motion-duration-150, 150ms)") },
|
|
2047
|
+
{ key: "motion-easing", property: "transition-timing-function", description: "Curve of the fill, ink, grow, shadow and arrow-swap transitions.", consumers: at(BUTTON, "var(--motion-easing-default, ease-in-out)") },
|
|
2010
2048
|
{
|
|
2011
2049
|
key: "text-transform",
|
|
2012
2050
|
property: "text-transform",
|
|
@@ -2240,6 +2278,27 @@ var inputAffixFamily = {
|
|
|
2240
2278
|
}
|
|
2241
2279
|
]
|
|
2242
2280
|
};
|
|
2281
|
+
var numberInputFamily = {
|
|
2282
|
+
family: "number-input",
|
|
2283
|
+
prefix: "number-input",
|
|
2284
|
+
description: "NumberInput \u2014 the field fill (resting and focused), edge colour, corner radius, height, the value's width, size and weight, and the \u2212 and + buttons' size, inset, corners, ink, hover fill and icon size. Under `data-glass=\"on\"` the field reads the glass layer's control values instead.",
|
|
2285
|
+
tokens: [
|
|
2286
|
+
{ key: "bg", property: "background-color", description: "Field fill.", consumers: at(NUMBER_INPUT, "var(--surface-interactive-default, #f9fafb)") },
|
|
2287
|
+
{ key: "bg-focus", property: "background-color", description: "Field fill while the value has focus. Unset, the resting fill.", consumers: at(NUMBER_INPUT, "var(--number-input-bg, var(--surface-interactive-default, #f9fafb))") },
|
|
2288
|
+
{ key: "border", property: "outline-color", description: "Resting edge colour. Unset, the shared `control` edge colour.", consumers: at(NUMBER_INPUT, "var(--control-edge-color, var(--border-default, #e5e7eb))") },
|
|
2289
|
+
{ key: "radius", property: "border-radius", description: "Field corner radius.", consumers: at(NUMBER_INPUT, "var(--radius-md, 0.375rem)") },
|
|
2290
|
+
{ key: "height", property: "height", description: "Field and value height.", consumers: at(NUMBER_INPUT, "2.25rem") },
|
|
2291
|
+
{ key: "value-width", property: "width", description: "Width of the value between the buttons.", consumers: at(NUMBER_INPUT, "4rem") },
|
|
2292
|
+
{ key: "value-font-size", property: "font-size", description: "Value size.", consumers: at(NUMBER_INPUT, "var(--font-size-sm, 0.875rem)") },
|
|
2293
|
+
{ key: "value-font-weight", property: "font-weight", description: "Value weight.", consumers: at(NUMBER_INPUT, "inherit") },
|
|
2294
|
+
{ key: "button-size", property: "width / height", description: "\u2212 and + button size.", consumers: at(NUMBER_INPUT, "2.25rem") },
|
|
2295
|
+
{ key: "button-inset", property: "margin-inline", description: "Space either side of each button, so a round button sits centred in a wider end column.", consumers: at(NUMBER_INPUT, "0") },
|
|
2296
|
+
{ key: "button-radius", property: "border-radius", description: "Button corner radius (`50%` for round buttons).", consumers: at(NUMBER_INPUT, "0") },
|
|
2297
|
+
{ key: "button-color", property: "color", description: "Button icon ink.", consumers: at(NUMBER_INPUT, "var(--text-secondary, #9ca3af)") },
|
|
2298
|
+
{ key: "button-hover-bg", property: "background-color", description: "Button fill on hover.", consumers: at(NUMBER_INPUT, "var(--surface-muted, #f3f4f6)") },
|
|
2299
|
+
{ key: "icon-size", property: "width / height", description: "Button icon size.", consumers: at(NUMBER_INPUT, "0.875rem") }
|
|
2300
|
+
]
|
|
2301
|
+
};
|
|
2243
2302
|
var separatorFamily = {
|
|
2244
2303
|
family: "separator",
|
|
2245
2304
|
prefix: "separator",
|
|
@@ -2545,6 +2604,7 @@ var COMPONENT_TOKEN_FAMILIES = [
|
|
|
2545
2604
|
billingSliderFamily,
|
|
2546
2605
|
resizableSplitFamily,
|
|
2547
2606
|
dialogFamily,
|
|
2607
|
+
glassFamily,
|
|
2548
2608
|
tabsFamily,
|
|
2549
2609
|
skeletonFamily,
|
|
2550
2610
|
spinnerFamily,
|
|
@@ -2567,6 +2627,7 @@ var COMPONENT_TOKEN_FAMILIES = [
|
|
|
2567
2627
|
tooltipFamily,
|
|
2568
2628
|
actionRowFamily,
|
|
2569
2629
|
inputAffixFamily,
|
|
2630
|
+
numberInputFamily,
|
|
2570
2631
|
separatorFamily,
|
|
2571
2632
|
alertFamily,
|
|
2572
2633
|
layerChartFamily,
|
|
@@ -2970,6 +3031,34 @@ function generateFontWeightDecls(typography) {
|
|
|
2970
3031
|
return decls;
|
|
2971
3032
|
}
|
|
2972
3033
|
|
|
3034
|
+
// src/types.ts
|
|
3035
|
+
var OPT_IN_MOTION_DURATION_KEYS = [
|
|
3036
|
+
"duration-enter",
|
|
3037
|
+
"duration-exit",
|
|
3038
|
+
"duration-page",
|
|
3039
|
+
"duration-stagger",
|
|
3040
|
+
"duration-enter-delay"
|
|
3041
|
+
];
|
|
3042
|
+
var TEXT_TRANSFORMS = ["none", "uppercase", "lowercase", "capitalize"];
|
|
3043
|
+
var MATERIAL_TEXT_SLOTS = [
|
|
3044
|
+
"displayLarge",
|
|
3045
|
+
"displayMedium",
|
|
3046
|
+
"displaySmall",
|
|
3047
|
+
"headlineLarge",
|
|
3048
|
+
"headlineMedium",
|
|
3049
|
+
"headlineSmall",
|
|
3050
|
+
"titleLarge",
|
|
3051
|
+
"titleMedium",
|
|
3052
|
+
"titleSmall",
|
|
3053
|
+
"bodyLarge",
|
|
3054
|
+
"bodyMedium",
|
|
3055
|
+
"bodySmall",
|
|
3056
|
+
"labelLarge",
|
|
3057
|
+
"labelMedium",
|
|
3058
|
+
"labelSmall",
|
|
3059
|
+
"labelXSmall"
|
|
3060
|
+
];
|
|
3061
|
+
|
|
2973
3062
|
// src/fonts/theme-alias.ts
|
|
2974
3063
|
var EMPTY_ALIASES = /* @__PURE__ */ new Map();
|
|
2975
3064
|
function aliasFamily(family, themeSlug) {
|
|
@@ -3055,8 +3144,19 @@ function generateRadiusPrimitives(config) {
|
|
|
3055
3144
|
`--radius-3xl: ${config.radius.xl * 2 / 16}rem; /* ${config.radius.xl * 2}px */`
|
|
3056
3145
|
);
|
|
3057
3146
|
decls.push(`--radius-full: ${config.radius.pill}px;`);
|
|
3147
|
+
decls.push(...generateCornerShapeDecls(config));
|
|
3058
3148
|
return decls;
|
|
3059
3149
|
}
|
|
3150
|
+
function generateCornerShapeDecls(config) {
|
|
3151
|
+
return config.corners === "squircle" ? ["--corner-shape: squircle;"] : [];
|
|
3152
|
+
}
|
|
3153
|
+
var CORNER_SHAPE_BINDING = "*, *::before, *::after {\n corner-shape: var(--corner-shape);\n}";
|
|
3154
|
+
var DEFAULT_EASING_OUT = "cubic-bezier(0, 0, 0.2, 1)";
|
|
3155
|
+
function generateOptInMotionDurationDecls(config) {
|
|
3156
|
+
return OPT_IN_MOTION_DURATION_KEYS.filter((key) => config.motion[key] !== void 0).map(
|
|
3157
|
+
(key) => `--motion-${key}: ${config.motion[key]};`
|
|
3158
|
+
);
|
|
3159
|
+
}
|
|
3060
3160
|
function generateShadowPrimitives(config) {
|
|
3061
3161
|
return [
|
|
3062
3162
|
`--shadow-xs: ${config.shadows.xs};`,
|
|
@@ -3124,9 +3224,10 @@ function generateMotionPrimitives(config) {
|
|
|
3124
3224
|
decls.push(`--motion-duration-500: ${config.motion["duration-slow"]};`);
|
|
3125
3225
|
decls.push("--motion-duration-800: 800ms;");
|
|
3126
3226
|
decls.push("--motion-duration-1500: 1500ms;");
|
|
3227
|
+
decls.push(...generateOptInMotionDurationDecls(config));
|
|
3127
3228
|
decls.push("--motion-easing-linear: linear;");
|
|
3128
3229
|
decls.push("--motion-easing-ease-in: cubic-bezier(0.4, 0, 1, 1);");
|
|
3129
|
-
decls.push(
|
|
3230
|
+
decls.push(`--motion-easing-ease-out: ${config.motion["easing-out"] ?? DEFAULT_EASING_OUT};`);
|
|
3130
3231
|
decls.push(`--motion-easing-ease-in-out: ${config.motion.easing};`);
|
|
3131
3232
|
decls.push(
|
|
3132
3233
|
"--motion-easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);"
|
|
@@ -3553,27 +3654,6 @@ function generateSemanticAliasDecls(declared, options = {}) {
|
|
|
3553
3654
|
return decls;
|
|
3554
3655
|
}
|
|
3555
3656
|
|
|
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
3657
|
export {
|
|
3578
3658
|
googleFontsCatalog,
|
|
3579
3659
|
lookupGoogleFont,
|
|
@@ -3611,6 +3691,7 @@ export {
|
|
|
3611
3691
|
isValidColor,
|
|
3612
3692
|
compositeOverBackground,
|
|
3613
3693
|
serializeColor,
|
|
3694
|
+
OPT_IN_MOTION_DURATION_KEYS,
|
|
3614
3695
|
TEXT_TRANSFORMS,
|
|
3615
3696
|
MATERIAL_TEXT_SLOTS,
|
|
3616
3697
|
componentTokenName,
|
|
@@ -3641,6 +3722,10 @@ export {
|
|
|
3641
3722
|
header,
|
|
3642
3723
|
sectionComment,
|
|
3643
3724
|
block2 as block,
|
|
3725
|
+
generateCornerShapeDecls,
|
|
3726
|
+
CORNER_SHAPE_BINDING,
|
|
3727
|
+
DEFAULT_EASING_OUT,
|
|
3728
|
+
generateOptInMotionDurationDecls,
|
|
3644
3729
|
generateFontSizeDecls,
|
|
3645
3730
|
generateFontTextTransformDecls,
|
|
3646
3731
|
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.",
|
|
@@ -1205,7 +1249,7 @@ var properties = {
|
|
|
1205
1249
|
},
|
|
1206
1250
|
spinner: {
|
|
1207
1251
|
type: "object",
|
|
1208
|
-
description: "Inline loading ring — track, leading edge, per-size geometry and
|
|
1252
|
+
description: "Inline loading ring — track, leading edge, per-size geometry, cycle length, the delayed fade-in and the visible words. Keys: track-color, edge-color, primary-edge-color, radius, duration, xs-size, xs-border-width, sm-size, sm-border-width, md-size, md-border-width, appear-duration, label-gap, label-font-size, label-font-weight, label-color.",
|
|
1209
1253
|
additionalProperties: {
|
|
1210
1254
|
$ref: "#/$defs/componentTokenBinding"
|
|
1211
1255
|
}
|
|
@@ -1289,7 +1333,7 @@ var properties = {
|
|
|
1289
1333
|
},
|
|
1290
1334
|
button: {
|
|
1291
1335
|
type: "object",
|
|
1292
|
-
description: "Button type treatment and rounding. The unprefixed keys set every size at once; a size key (`dlg-radius`) overrides one size. Keys: icon-gap, default-bg, default-bg-hover, default-text, dlg-destructive-bg, dlg-destructive-bg-hover, dlg-destructive-text, hero-bg, hero-bg-hover, hero-text, ghost-text, ghost-text-hover, md-height, md-padding, dlg-padding, text-transform, letter-spacing, font-weight, radius, sm-font-size, sm-font-weight, sm-text-transform, sm-letter-spacing, sm-radius, md-font-size, md-font-weight, md-text-transform, md-letter-spacing, md-radius, lg-font-size, lg-font-weight, lg-text-transform, lg-letter-spacing, lg-radius, dlg-font-size, dlg-font-weight, dlg-text-transform, dlg-letter-spacing, dlg-radius, icon-size, icon-pad, icon-radius, icon-ghost-color.",
|
|
1336
|
+
description: "Button type treatment and rounding. The unprefixed keys set every size at once; a size key (`dlg-radius`) overrides one size. Keys: icon-gap, default-bg, default-bg-hover, default-text, dlg-destructive-bg, dlg-destructive-bg-hover, dlg-destructive-text, hero-bg, hero-bg-hover, hero-text, ghost-text, ghost-text-hover, md-height, md-padding, dlg-padding, lg-height, lg-padding, default-shadow, default-shadow-hover, outline-text, outline-bg-hover, hover-scale, press-scale, press-transform, press-duration, motion-duration, motion-easing, text-transform, letter-spacing, font-weight, radius, sm-font-size, sm-font-weight, sm-text-transform, sm-letter-spacing, sm-radius, md-font-size, md-font-weight, md-text-transform, md-letter-spacing, md-radius, lg-font-size, lg-font-weight, lg-text-transform, lg-letter-spacing, lg-radius, dlg-font-size, dlg-font-weight, dlg-text-transform, dlg-letter-spacing, dlg-radius, icon-size, icon-pad, icon-radius, icon-ghost-color.",
|
|
1293
1337
|
additionalProperties: {
|
|
1294
1338
|
$ref: "#/$defs/componentTokenBinding"
|
|
1295
1339
|
}
|
|
@@ -1364,6 +1408,13 @@ var properties = {
|
|
|
1364
1408
|
$ref: "#/$defs/componentTokenBinding"
|
|
1365
1409
|
}
|
|
1366
1410
|
},
|
|
1411
|
+
"number-input": {
|
|
1412
|
+
type: "object",
|
|
1413
|
+
description: "NumberInput — the field fill (resting and focused), edge colour, corner radius, height, the value's width, size and weight, and the − and + buttons' size, inset, corners, ink, hover fill and icon size. Under `data-glass=\"on\"` the field reads the glass layer's control values instead. Keys: bg, bg-focus, border, radius, height, value-width, value-font-size, value-font-weight, button-size, button-inset, button-radius, button-color, button-hover-bg, icon-size.",
|
|
1414
|
+
additionalProperties: {
|
|
1415
|
+
$ref: "#/$defs/componentTokenBinding"
|
|
1416
|
+
}
|
|
1417
|
+
},
|
|
1367
1418
|
separator: {
|
|
1368
1419
|
type: "object",
|
|
1369
1420
|
description: "Separator rule colour, bare or either side of a label. Keys: 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-25CL4ADD.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.",
|
|
@@ -1226,7 +1268,7 @@ var visor_theme_schema_default = {
|
|
|
1226
1268
|
},
|
|
1227
1269
|
spinner: {
|
|
1228
1270
|
type: "object",
|
|
1229
|
-
description: "Inline loading ring \u2014 track, leading edge, per-size geometry and
|
|
1271
|
+
description: "Inline loading ring \u2014 track, leading edge, per-size geometry, cycle length, the delayed fade-in and the visible words. Keys: track-color, edge-color, primary-edge-color, radius, duration, xs-size, xs-border-width, sm-size, sm-border-width, md-size, md-border-width, appear-duration, label-gap, label-font-size, label-font-weight, label-color.",
|
|
1230
1272
|
additionalProperties: {
|
|
1231
1273
|
$ref: "#/$defs/componentTokenBinding"
|
|
1232
1274
|
}
|
|
@@ -1310,7 +1352,7 @@ var visor_theme_schema_default = {
|
|
|
1310
1352
|
},
|
|
1311
1353
|
button: {
|
|
1312
1354
|
type: "object",
|
|
1313
|
-
description: "Button type treatment and rounding. The unprefixed keys set every size at once; a size key (`dlg-radius`) overrides one size. Keys: icon-gap, default-bg, default-bg-hover, default-text, dlg-destructive-bg, dlg-destructive-bg-hover, dlg-destructive-text, hero-bg, hero-bg-hover, hero-text, ghost-text, ghost-text-hover, md-height, md-padding, dlg-padding, text-transform, letter-spacing, font-weight, radius, sm-font-size, sm-font-weight, sm-text-transform, sm-letter-spacing, sm-radius, md-font-size, md-font-weight, md-text-transform, md-letter-spacing, md-radius, lg-font-size, lg-font-weight, lg-text-transform, lg-letter-spacing, lg-radius, dlg-font-size, dlg-font-weight, dlg-text-transform, dlg-letter-spacing, dlg-radius, icon-size, icon-pad, icon-radius, icon-ghost-color.",
|
|
1355
|
+
description: "Button type treatment and rounding. The unprefixed keys set every size at once; a size key (`dlg-radius`) overrides one size. Keys: icon-gap, default-bg, default-bg-hover, default-text, dlg-destructive-bg, dlg-destructive-bg-hover, dlg-destructive-text, hero-bg, hero-bg-hover, hero-text, ghost-text, ghost-text-hover, md-height, md-padding, dlg-padding, lg-height, lg-padding, default-shadow, default-shadow-hover, outline-text, outline-bg-hover, hover-scale, press-scale, press-transform, press-duration, motion-duration, motion-easing, text-transform, letter-spacing, font-weight, radius, sm-font-size, sm-font-weight, sm-text-transform, sm-letter-spacing, sm-radius, md-font-size, md-font-weight, md-text-transform, md-letter-spacing, md-radius, lg-font-size, lg-font-weight, lg-text-transform, lg-letter-spacing, lg-radius, dlg-font-size, dlg-font-weight, dlg-text-transform, dlg-letter-spacing, dlg-radius, icon-size, icon-pad, icon-radius, icon-ghost-color.",
|
|
1314
1356
|
additionalProperties: {
|
|
1315
1357
|
$ref: "#/$defs/componentTokenBinding"
|
|
1316
1358
|
}
|
|
@@ -1385,6 +1427,13 @@ var visor_theme_schema_default = {
|
|
|
1385
1427
|
$ref: "#/$defs/componentTokenBinding"
|
|
1386
1428
|
}
|
|
1387
1429
|
},
|
|
1430
|
+
"number-input": {
|
|
1431
|
+
type: "object",
|
|
1432
|
+
description: "NumberInput \u2014 the field fill (resting and focused), edge colour, corner radius, height, the value's width, size and weight, and the \u2212 and + buttons' size, inset, corners, ink, hover fill and icon size. Under `data-glass=\"on\"` the field reads the glass layer's control values instead. Keys: bg, bg-focus, border, radius, height, value-width, value-font-size, value-font-weight, button-size, button-inset, button-radius, button-color, button-hover-bg, icon-size.",
|
|
1433
|
+
additionalProperties: {
|
|
1434
|
+
$ref: "#/$defs/componentTokenBinding"
|
|
1435
|
+
}
|
|
1436
|
+
},
|
|
1388
1437
|
separator: {
|
|
1389
1438
|
type: "object",
|
|
1390
1439
|
description: "Separator rule colour, bare or either side of a label. Keys: color.",
|
|
@@ -1685,7 +1734,8 @@ var KNOWN_TOP_LEVEL_KEYS = /* @__PURE__ */ new Set([
|
|
|
1685
1734
|
"overrides",
|
|
1686
1735
|
"components",
|
|
1687
1736
|
"edges",
|
|
1688
|
-
"hairlines"
|
|
1737
|
+
"hairlines",
|
|
1738
|
+
"corners"
|
|
1689
1739
|
]);
|
|
1690
1740
|
var KNOWN_COLOR_KEYS = /* @__PURE__ */ new Set([
|
|
1691
1741
|
"primary",
|
|
@@ -1732,7 +1782,15 @@ var KNOWN_SPACING_KEYS = /* @__PURE__ */ new Set(["base"]);
|
|
|
1732
1782
|
var KNOWN_RADIUS_KEYS = /* @__PURE__ */ new Set(["sm", "md", "lg", "xl", "pill"]);
|
|
1733
1783
|
var KNOWN_SHADOW_KEYS = /* @__PURE__ */ new Set(["xs", "sm", "md", "lg", "xl"]);
|
|
1734
1784
|
var KNOWN_STROKE_WIDTH_KEYS = /* @__PURE__ */ new Set(["thin", "regular", "medium", "thick"]);
|
|
1735
|
-
var KNOWN_MOTION_KEYS = /* @__PURE__ */ new Set([
|
|
1785
|
+
var KNOWN_MOTION_KEYS = /* @__PURE__ */ new Set([
|
|
1786
|
+
"duration-fast",
|
|
1787
|
+
"duration-normal",
|
|
1788
|
+
"duration-slow",
|
|
1789
|
+
"easing",
|
|
1790
|
+
"easing-overshoot",
|
|
1791
|
+
"easing-out",
|
|
1792
|
+
...OPT_IN_MOTION_DURATION_KEYS
|
|
1793
|
+
]);
|
|
1736
1794
|
var KNOWN_OVERRIDES_KEYS = /* @__PURE__ */ new Set(["light", "dark"]);
|
|
1737
1795
|
var KNOWN_BRAND_KEYS = /* @__PURE__ */ new Set([
|
|
1738
1796
|
"org",
|
|
@@ -1971,6 +2029,9 @@ function validateConfig(config) {
|
|
|
1971
2029
|
if (obj.hairlines !== void 0 && obj.hairlines !== "on" && obj.hairlines !== "off") {
|
|
1972
2030
|
errors.push("'hairlines' must be either 'on' or 'off'");
|
|
1973
2031
|
}
|
|
2032
|
+
if (obj.corners !== void 0 && obj.corners !== "round" && obj.corners !== "squircle") {
|
|
2033
|
+
errors.push("'corners' must be either 'round' or 'squircle'");
|
|
2034
|
+
}
|
|
1974
2035
|
if (typeof obj.colors !== "object" || obj.colors === null) {
|
|
1975
2036
|
errors.push("'colors' is required and must be an object");
|
|
1976
2037
|
return { valid: false, errors };
|
|
@@ -2013,7 +2074,7 @@ function validateConfig(config) {
|
|
|
2013
2074
|
}
|
|
2014
2075
|
if (obj.motion && typeof obj.motion === "object") {
|
|
2015
2076
|
const motion = obj.motion;
|
|
2016
|
-
for (const key of ["duration-fast", "duration-normal", "duration-slow"]) {
|
|
2077
|
+
for (const key of ["duration-fast", "duration-normal", "duration-slow", ...OPT_IN_MOTION_DURATION_KEYS]) {
|
|
2017
2078
|
if (motion[key] !== void 0) {
|
|
2018
2079
|
if (typeof motion[key] !== "string" || !/^\d+ms$/.test(motion[key])) {
|
|
2019
2080
|
errors.push(`'motion.${key}' must match pattern "Nms" (e.g., "200ms")`);
|
|
@@ -2357,8 +2418,16 @@ function resolveConfig(config) {
|
|
|
2357
2418
|
easing: config.motion?.easing ?? DEFAULTS.motion.easing,
|
|
2358
2419
|
// VI-451 (drive-by): pass through opt-in bouncy easing when set; absent
|
|
2359
2420
|
// themes leave this undefined and fall through to --motion-easing-spring.
|
|
2360
|
-
...config.motion?.["easing-overshoot"] !== void 0 ? { "easing-overshoot": config.motion["easing-overshoot"] } : {}
|
|
2421
|
+
...config.motion?.["easing-overshoot"] !== void 0 ? { "easing-overshoot": config.motion["easing-overshoot"] } : {},
|
|
2422
|
+
// VI-796: opt-in out curve and role durations, passed through only when set.
|
|
2423
|
+
...Object.fromEntries(
|
|
2424
|
+
["easing-out", ...OPT_IN_MOTION_DURATION_KEYS].filter((key) => config.motion?.[key] !== void 0).map((key) => [
|
|
2425
|
+
key,
|
|
2426
|
+
config.motion[key]
|
|
2427
|
+
])
|
|
2428
|
+
)
|
|
2361
2429
|
},
|
|
2430
|
+
...config.corners === "squircle" ? { corners: "squircle" } : {},
|
|
2362
2431
|
overrides: config.overrides,
|
|
2363
2432
|
// VI-625: component bindings pass through untouched — the contract in
|
|
2364
2433
|
// component-tokens.ts owns their shape, there is nothing to default.
|
|
@@ -3113,9 +3182,16 @@ function exportTheme(primitives, config) {
|
|
|
3113
3182
|
if (config.motion["easing-overshoot"] !== void 0) {
|
|
3114
3183
|
motion["easing-overshoot"] = config.motion["easing-overshoot"];
|
|
3115
3184
|
}
|
|
3185
|
+
for (const key of ["easing-out", ...OPT_IN_MOTION_DURATION_KEYS]) {
|
|
3186
|
+
const val = config.motion[key];
|
|
3187
|
+
if (val !== void 0) motion[key] = val;
|
|
3188
|
+
}
|
|
3116
3189
|
if (Object.keys(motion).length > 0) {
|
|
3117
3190
|
output.motion = motion;
|
|
3118
3191
|
}
|
|
3192
|
+
if (config.corners) {
|
|
3193
|
+
output.corners = config.corners;
|
|
3194
|
+
}
|
|
3119
3195
|
if (config.overrides) {
|
|
3120
3196
|
const overrides = {};
|
|
3121
3197
|
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.43.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.",
|
|
@@ -605,7 +646,7 @@
|
|
|
605
646
|
},
|
|
606
647
|
"spinner": {
|
|
607
648
|
"type": "object",
|
|
608
|
-
"description": "Inline loading ring — track, leading edge, per-size geometry and
|
|
649
|
+
"description": "Inline loading ring — track, leading edge, per-size geometry, cycle length, the delayed fade-in and the visible words. Keys: track-color, edge-color, primary-edge-color, radius, duration, xs-size, xs-border-width, sm-size, sm-border-width, md-size, md-border-width, appear-duration, label-gap, label-font-size, label-font-weight, label-color.",
|
|
609
650
|
"additionalProperties": {
|
|
610
651
|
"$ref": "#/$defs/componentTokenBinding"
|
|
611
652
|
}
|
|
@@ -689,7 +730,7 @@
|
|
|
689
730
|
},
|
|
690
731
|
"button": {
|
|
691
732
|
"type": "object",
|
|
692
|
-
"description": "Button type treatment and rounding. The unprefixed keys set every size at once; a size key (`dlg-radius`) overrides one size. Keys: icon-gap, default-bg, default-bg-hover, default-text, dlg-destructive-bg, dlg-destructive-bg-hover, dlg-destructive-text, hero-bg, hero-bg-hover, hero-text, ghost-text, ghost-text-hover, md-height, md-padding, dlg-padding, text-transform, letter-spacing, font-weight, radius, sm-font-size, sm-font-weight, sm-text-transform, sm-letter-spacing, sm-radius, md-font-size, md-font-weight, md-text-transform, md-letter-spacing, md-radius, lg-font-size, lg-font-weight, lg-text-transform, lg-letter-spacing, lg-radius, dlg-font-size, dlg-font-weight, dlg-text-transform, dlg-letter-spacing, dlg-radius, icon-size, icon-pad, icon-radius, icon-ghost-color.",
|
|
733
|
+
"description": "Button type treatment and rounding. The unprefixed keys set every size at once; a size key (`dlg-radius`) overrides one size. Keys: icon-gap, default-bg, default-bg-hover, default-text, dlg-destructive-bg, dlg-destructive-bg-hover, dlg-destructive-text, hero-bg, hero-bg-hover, hero-text, ghost-text, ghost-text-hover, md-height, md-padding, dlg-padding, lg-height, lg-padding, default-shadow, default-shadow-hover, outline-text, outline-bg-hover, hover-scale, press-scale, press-transform, press-duration, motion-duration, motion-easing, text-transform, letter-spacing, font-weight, radius, sm-font-size, sm-font-weight, sm-text-transform, sm-letter-spacing, sm-radius, md-font-size, md-font-weight, md-text-transform, md-letter-spacing, md-radius, lg-font-size, lg-font-weight, lg-text-transform, lg-letter-spacing, lg-radius, dlg-font-size, dlg-font-weight, dlg-text-transform, dlg-letter-spacing, dlg-radius, icon-size, icon-pad, icon-radius, icon-ghost-color.",
|
|
693
734
|
"additionalProperties": {
|
|
694
735
|
"$ref": "#/$defs/componentTokenBinding"
|
|
695
736
|
}
|
|
@@ -764,6 +805,13 @@
|
|
|
764
805
|
"$ref": "#/$defs/componentTokenBinding"
|
|
765
806
|
}
|
|
766
807
|
},
|
|
808
|
+
"number-input": {
|
|
809
|
+
"type": "object",
|
|
810
|
+
"description": "NumberInput \u2014 the field fill (resting and focused), edge colour, corner radius, height, the value's width, size and weight, and the \u2212 and + buttons' size, inset, corners, ink, hover fill and icon size. Under `data-glass=\"on\"` the field reads the glass layer's control values instead. Keys: bg, bg-focus, border, radius, height, value-width, value-font-size, value-font-weight, button-size, button-inset, button-radius, button-color, button-hover-bg, icon-size.",
|
|
811
|
+
"additionalProperties": {
|
|
812
|
+
"$ref": "#/$defs/componentTokenBinding"
|
|
813
|
+
}
|
|
814
|
+
},
|
|
767
815
|
"separator": {
|
|
768
816
|
"type": "object",
|
|
769
817
|
"description": "Separator rule colour, bare or either side of a label. Keys: color.",
|