@revenuecat/purchases-ui-js
Version:
Web components for Paywalls. Powered by RevenueCat
39 lines (38 loc) • 1.13 kB
JavaScript
import { DEFAULT_SPACING } from "./spacing";
import { DEFAULT_TEXT_STYLES } from "./text";
import { toFormColors, toFormStyleVar, toProductInfoStyleVar, toShape, toSpacingVars, toTextStyleVar, } from "./utils";
export class Theme {
brandingAppearance;
constructor(brandingAppearance) {
if (brandingAppearance) {
this.brandingAppearance = brandingAppearance;
}
else {
this.brandingAppearance = undefined;
}
}
get shape() {
return toShape(this.brandingAppearance);
}
get formColors() {
return toFormColors(this.brandingAppearance);
}
get formStyleVars() {
return toFormStyleVar(this.brandingAppearance);
}
get productInfoStyleVars() {
return toProductInfoStyleVar(this.brandingAppearance);
}
get spacing() {
return DEFAULT_SPACING;
}
get textStyles() {
return DEFAULT_TEXT_STYLES;
}
get textStyleVars() {
return toTextStyleVar("text", this.textStyles);
}
get spacingStyleVars() {
return toSpacingVars("spacing", this.spacing);
}
}