@revenuecat/purchases-ui-js 0.0.18 → 0.0.19

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.
@@ -60,11 +60,11 @@ type ComponentStyleVariables = {
60
60
  * @param params - Component style configuration object
61
61
  * @returns CSS style object with component styles
62
62
  */
63
- export declare function getComponentStyles({ backgroundColor, border, margin, padding, textColor, colorMode, shape, shadow, }: {
63
+ export declare function getComponentStyles({ background_color, border, margin, padding, color, colorMode, shape, shadow, }: {
64
64
  padding?: Spacing;
65
65
  margin?: Spacing;
66
- backgroundColor?: ColorType;
67
- textColor?: ColorType;
66
+ background_color?: ColorType;
67
+ color?: ColorType;
68
68
  border?: BorderType;
69
69
  colorMode?: ColorMode;
70
70
  shape?: ShapeType;
@@ -151,6 +151,8 @@ export declare function stringifyStyles(styles: Record<string, string | number>)
151
151
  * @returns the id of the first package marked as `is_selected_by_default` or undefined
152
152
  */
153
153
  export declare function findSelectedPackageId(paywallData: PaywallData): string | undefined;
154
- export declare const getActiveStateProps: <T>(overrides?: Record<string, T>, componentState?: ComponentState) => T;
154
+ export declare const getActiveStateProps: <T>(overrides?: {
155
+ states?: Record<string, T>;
156
+ }, componentState?: ComponentState) => T;
155
157
  export declare function prefixObject(object?: Record<string, string | number>, prefix?: string): Record<string, string | number>;
156
158
  export {};
@@ -88,7 +88,7 @@ export function getCornerRadiusStyle(corners) {
88
88
  * @param params - Component style configuration object
89
89
  * @returns CSS style object with component styles
90
90
  */
91
- export function getComponentStyles({ backgroundColor, border, margin, padding, textColor, colorMode = "light", shape, shadow, }) {
91
+ export function getComponentStyles({ background_color, border, margin, padding, color, colorMode = "light", shape, shadow, }) {
92
92
  const stylesObject = {
93
93
  "--margin-block-start": "0px",
94
94
  "--margin-inline-end": "0px",
@@ -113,16 +113,16 @@ export function getComponentStyles({ backgroundColor, border, margin, padding, t
113
113
  if (margin) {
114
114
  Object.assign(stylesObject, getSpacingStyle(margin, "margin"));
115
115
  }
116
- if (backgroundColor) {
116
+ if (background_color) {
117
117
  stylesObject["--background"] = getColor({
118
- colorMap: backgroundColor,
118
+ colorMap: background_color,
119
119
  colorMode,
120
120
  fallback: "transparent",
121
121
  });
122
122
  }
123
- if (textColor) {
123
+ if (color) {
124
124
  stylesObject["--text-color"] = getColor({
125
- colorMap: textColor,
125
+ colorMap: color,
126
126
  colorMode,
127
127
  fallback: "#000000",
128
128
  });
@@ -385,7 +385,7 @@ export const getActiveStateProps = (overrides, componentState) => {
385
385
  const activeStateKeys = getComponentActiveStateKeys(componentState);
386
386
  const activeStateProps = activeStateKeys.reduce((props, key) => {
387
387
  if (overrides) {
388
- const styles = overrides[key] || {};
388
+ const styles = overrides?.states?.[key] || {};
389
389
  return { ...props, ...styles };
390
390
  }
391
391
  return props;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@revenuecat/purchases-ui-js",
3
3
  "description": "Web components for Paywalls. Powered by RevenueCat",
4
4
  "private": false,
5
- "version": "0.0.18",
5
+ "version": "0.0.19",
6
6
  "author": {
7
7
  "name": "RevenueCat, Inc."
8
8
  },