@revenuecat/purchases-ui-js
Version:
Web components for Paywalls. Powered by RevenueCat
38 lines (37 loc) • 1.99 kB
TypeScript
import { type Colors } from "./colors";
import { type Shape } from "./shapes";
import { type TextStyles } from "./text";
import type { Spacing } from "./spacing";
import type { BrandingAppearance } from "../utils/branding";
export declare const DEFAULT_LUMINANCE_THRESHOLD = 0.37;
/**
* Applies an alpha value to a color.
* If the base color is light, the overlay color is black.
* If the base color is dark, the overlay color is white.
*/
export declare function applyAlpha(baseColor: string, alpha: number): string;
export declare const toColors: (colorsMapping: Record<string, string>, defaultColors: Colors, brandingAppearance?: BrandingAppearance | null | undefined) => Colors;
export declare const toProductInfoColors: (brandingAppearance?: BrandingAppearance | null | undefined) => Colors;
export declare const toFormColors: (brandingAppearance?: BrandingAppearance | null | undefined) => Colors;
export declare const toShape: (brandingAppearance?: BrandingAppearance | null | undefined) => Shape;
export declare const toStyleVar: (prefix: string | undefined, entries: [string, string][]) => string;
/**
* Assigns values to the css variables given the branding appearance customization.
* @param appearance BrandingAppearance
* @return a style parameter compatible string.
*/
export declare const toProductInfoStyleVar: (appearance?: BrandingAppearance | null) => string;
/**
* Assigns values to the css variables given the branding appearance customization.
* @param appearance BrandingAppearance
* @return a style parameter compatible string.
*/
export declare const toFormStyleVar: (appearance?: BrandingAppearance | null) => string;
/**
* Convert text styles into CSS variables for both desktop and mobile.
*/
export declare const toTextStyleVar: (prefix: string | undefined, textStyles: TextStyles) => string;
/**
* Generates CSS variables for the spacing system.
*/
export declare const toSpacingVars: (prefix: string | undefined, spacing: Spacing) => string;