@loworbitstudio/visor-theme-engine 0.45.0 → 0.46.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.js
CHANGED
|
@@ -3284,6 +3284,12 @@ var SQUIRCLE_FALLBACK = [
|
|
|
3284
3284
|
" }",
|
|
3285
3285
|
"}"
|
|
3286
3286
|
].join("\n");
|
|
3287
|
+
function forceSquircleFallback(css) {
|
|
3288
|
+
const gate = /@supports\s+not\s*\(\s*corner-shape\s*:\s*squircle\s*\)/g;
|
|
3289
|
+
return `${css.replace(gate, "@media all")}
|
|
3290
|
+
*, *::before, *::after { corner-shape: round !important; }
|
|
3291
|
+
`;
|
|
3292
|
+
}
|
|
3287
3293
|
function squirclePath(r, i) {
|
|
3288
3294
|
const h = `${r} * 0.082`;
|
|
3289
3295
|
const lo = (v) => `calc(${i} + ${v})`;
|
|
@@ -3884,6 +3890,7 @@ export {
|
|
|
3884
3890
|
generateCornerShapeDecls,
|
|
3885
3891
|
CORNER_SHAPE_BINDING,
|
|
3886
3892
|
SQUIRCLE_FALLBACK,
|
|
3893
|
+
forceSquircleFallback,
|
|
3887
3894
|
DEFAULT_EASING_OUT,
|
|
3888
3895
|
generateOptInMotionDurationDecls,
|
|
3889
3896
|
generateFontSizeDecls,
|
package/dist/index.d.ts
CHANGED
|
@@ -2350,6 +2350,16 @@ type AliasedFamilies = ReadonlyMap<string, string>;
|
|
|
2350
2350
|
* packages/tokens/src/generate/generate-css.ts output format.
|
|
2351
2351
|
*/
|
|
2352
2352
|
|
|
2353
|
+
/**
|
|
2354
|
+
* VI-841: test-only. `css` with the squircle fallback forced on, so a test can
|
|
2355
|
+
* draw it in an engine that has `corner-shape` (Chromium, newer Playwright
|
|
2356
|
+
* WebKit builds). Every `@supports not (corner-shape: squircle)` gate, the
|
|
2357
|
+
* theme's and each component's, becomes `@media all`, and a trailing rule turns
|
|
2358
|
+
* native `corner-shape` off. The `--corner-shape` style-query gate stays, so
|
|
2359
|
+
* round themes and round subtrees are still untouched. Nothing calls it on
|
|
2360
|
+
* production output: a test passes each stylesheet through it.
|
|
2361
|
+
*/
|
|
2362
|
+
declare function forceSquircleFallback(css: string): string;
|
|
2353
2363
|
declare function generatePrimitivesCss(primitives: GeneratedPrimitives, config: ResolvedThemeConfig, options?: {
|
|
2354
2364
|
aliasedFamilies?: AliasedFamilies;
|
|
2355
2365
|
scopePrefix?: string;
|
|
@@ -2601,4 +2611,4 @@ declare const FONT_VERTICAL_METRICS: Record<string, FontVerticalMetrics>;
|
|
|
2601
2611
|
/** The `--font-ascent` / `--font-descent` declarations for a body family, or none when the face is unmeasured. */
|
|
2602
2612
|
declare function generateFontMetricDecls(family: string): string[];
|
|
2603
2613
|
|
|
2604
|
-
export { type BrandPassthrough, BrandResolution, BrandSlot, BrandSource, BrandStrategy, BrandStrategyContext, BrandStrategyIssue, BrandStrategyValidationResult, type CSSFile, ColorRole, type Confidence, DEFAULT_VISOR_BRAND, type ExtractedToken, type ExtractionResult, FONT_VERTICAL_METRICS, FONT_WEIGHT_ALIASES, type FontCoverageError, type FontCoverageResult, FontDisplayStrategy, type FontFaceDeclaration, FontResolution, FontResolveOptions, type FontVerticalMetrics, FullShadeScale, GeneratedPrimitives, GoogleFontEntry, MODE_DEPENDENT_SEMANTIC_ALIASES, OKLCH, ParsedColor, RGB, ResolvedThemeConfig, type ResolvedWeightRamp, SEMANTIC_MAP, SelectiveShadeScale, SemanticTokens, SerializedBrandStrategy, ShadeStep, TAILWIND_GRAY, ThemeBrandResult, ThemeData, ThemeFontResult, ThemeOutput, type ThemeValidationResult, VISOR_BRANDS_CDN, VISOR_CORE_DARK_SEMANTIC_ALIASES, VISOR_CORE_SEMANTIC_ALIASES, VISOR_DEFAULT_BRAND_PATH, VISOR_FONTS_CDN, type ValidateOptions, type ValidationIssue, type ValidationSeverity, VisorBrand, VisorThemeConfig, VisorTypography, WEIGHT_RAMP_TARGETS, applyOverrides, assignSemanticTokens, buildVisorBrandUrl, buildVisorFontUrl, checkBrandStrategyCoherence, checkBrandStrategyStructure, clampToSrgb, cleanFontValue, collectBrandPassthrough, collectDeclaredProperties, compositeOverBackground, declaresWeights, exportTheme, extractFromCSS, formatFontCoverageError, generateDarkCss, generateFontMetricDecls, generateFontWeightDecls, generateFullBundleCss, generateLightCss, generatePreloadLinks, generatePrimitives, generatePrimitivesCss, generateSemanticAliasDecls, generateSemanticCss, generateShadeScale, generateStylesheetLinks, generateTheme, generateThemeData, generateThemeDataFromConfig, generateThemeFromConfig, getContrastRatio, getKnownTokenRefs, getLuminance, googleFontsCatalog, hasBrandPassthrough, hexToOklch, hexToRgb, isValidColor, isValidHex, isVisorThemeConfig, loadedWeights, lookupFontWeightAlias, lookupGoogleFont, matchLoadedWeight, normalizeHex, oklchToHex, parseCSSDeclarations, parseColor, parseConfig, parseFontFaceDeclarations, parseHex, parseHsla, parseOklch, parseRgba, resolveBrandSlot, resolveBrandSource, resolveConfig, resolveFont, resolveRoleWeight, resolveThemeBrand, resolveThemeFonts, resolveWeightRamp, rgbToHex, serializeBrandStrategy, serializeColor, validate, validateBrandStrategy, validateConfig, validateFontCoverage, visorTheme_schema as visorThemeSchema };
|
|
2614
|
+
export { type BrandPassthrough, BrandResolution, BrandSlot, BrandSource, BrandStrategy, BrandStrategyContext, BrandStrategyIssue, BrandStrategyValidationResult, type CSSFile, ColorRole, type Confidence, DEFAULT_VISOR_BRAND, type ExtractedToken, type ExtractionResult, FONT_VERTICAL_METRICS, FONT_WEIGHT_ALIASES, type FontCoverageError, type FontCoverageResult, FontDisplayStrategy, type FontFaceDeclaration, FontResolution, FontResolveOptions, type FontVerticalMetrics, FullShadeScale, GeneratedPrimitives, GoogleFontEntry, MODE_DEPENDENT_SEMANTIC_ALIASES, OKLCH, ParsedColor, RGB, ResolvedThemeConfig, type ResolvedWeightRamp, SEMANTIC_MAP, SelectiveShadeScale, SemanticTokens, SerializedBrandStrategy, ShadeStep, TAILWIND_GRAY, ThemeBrandResult, ThemeData, ThemeFontResult, ThemeOutput, type ThemeValidationResult, VISOR_BRANDS_CDN, VISOR_CORE_DARK_SEMANTIC_ALIASES, VISOR_CORE_SEMANTIC_ALIASES, VISOR_DEFAULT_BRAND_PATH, VISOR_FONTS_CDN, type ValidateOptions, type ValidationIssue, type ValidationSeverity, VisorBrand, VisorThemeConfig, VisorTypography, WEIGHT_RAMP_TARGETS, applyOverrides, assignSemanticTokens, buildVisorBrandUrl, buildVisorFontUrl, checkBrandStrategyCoherence, checkBrandStrategyStructure, clampToSrgb, cleanFontValue, collectBrandPassthrough, collectDeclaredProperties, compositeOverBackground, declaresWeights, exportTheme, extractFromCSS, forceSquircleFallback, formatFontCoverageError, generateDarkCss, generateFontMetricDecls, generateFontWeightDecls, generateFullBundleCss, generateLightCss, generatePreloadLinks, generatePrimitives, generatePrimitivesCss, generateSemanticAliasDecls, generateSemanticCss, generateShadeScale, generateStylesheetLinks, generateTheme, generateThemeData, generateThemeDataFromConfig, generateThemeFromConfig, getContrastRatio, getKnownTokenRefs, getLuminance, googleFontsCatalog, hasBrandPassthrough, hexToOklch, hexToRgb, isValidColor, isValidHex, isVisorThemeConfig, loadedWeights, lookupFontWeightAlias, lookupGoogleFont, matchLoadedWeight, normalizeHex, oklchToHex, parseCSSDeclarations, parseColor, parseConfig, parseFontFaceDeclarations, parseHex, parseHsla, parseOklch, parseRgba, resolveBrandSlot, resolveBrandSource, resolveConfig, resolveFont, resolveRoleWeight, resolveThemeBrand, resolveThemeFonts, resolveWeightRamp, rgbToHex, serializeBrandStrategy, serializeColor, validate, validateBrandStrategy, validateConfig, validateFontCoverage, visorTheme_schema as visorThemeSchema };
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
componentTokenName,
|
|
27
27
|
compositeOverBackground,
|
|
28
28
|
declaresWeights,
|
|
29
|
+
forceSquircleFallback,
|
|
29
30
|
generateDarkCss,
|
|
30
31
|
generateFontMetricDecls,
|
|
31
32
|
generateFontWeightDecls,
|
|
@@ -69,7 +70,7 @@ import {
|
|
|
69
70
|
rgbToOklch,
|
|
70
71
|
serializeColor,
|
|
71
72
|
validateComponentBindings
|
|
72
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-FN6RU72C.js";
|
|
73
74
|
|
|
74
75
|
// src/fonts/validate-coverage.ts
|
|
75
76
|
var FONT_VAR_RE = /--font-(heading|display|body|sans|mono)\s*:\s*([^;]+);/g;
|
|
@@ -4653,6 +4654,7 @@ export {
|
|
|
4653
4654
|
declaresWeights,
|
|
4654
4655
|
exportTheme,
|
|
4655
4656
|
extractFromCSS,
|
|
4657
|
+
forceSquircleFallback,
|
|
4656
4658
|
formatFontCoverageError,
|
|
4657
4659
|
generateDarkCss,
|
|
4658
4660
|
generateFontMetricDecls,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loworbitstudio/visor-theme-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.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",
|