@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.
- package/dist/components/footer/Footer.svelte +9 -3
- package/dist/components/paywall/Node.svelte +3 -0
- package/dist/components/paywall/Node.svelte.d.ts +2 -1
- package/dist/components/paywall/Paywall.stories.svelte +66 -5
- package/dist/components/paywall/Paywall.svelte +1 -1
- package/dist/components/purchase-button/PurchaseButton.stories.svelte +6 -0
- package/dist/components/stack/Stack.svelte +2 -0
- package/dist/components/stack/stack-utils.d.ts +1 -1
- package/dist/components/stack/stack-utils.js +3 -3
- package/dist/components/text/text-utils.js +3 -3
- package/dist/data/entities.d.ts +8 -9
- package/dist/stories/fixtures.d.ts +1 -1
- package/dist/stories/fixtures.js +5961 -5434
- package/dist/utils/style-utils.d.ts +6 -4
- package/dist/utils/style-utils.js +6 -6
- package/package.json +1 -1
|
@@ -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({
|
|
63
|
+
export declare function getComponentStyles({ background_color, border, margin, padding, color, colorMode, shape, shadow, }: {
|
|
64
64
|
padding?: Spacing;
|
|
65
65
|
margin?: Spacing;
|
|
66
|
-
|
|
67
|
-
|
|
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?:
|
|
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({
|
|
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 (
|
|
116
|
+
if (background_color) {
|
|
117
117
|
stylesObject["--background"] = getColor({
|
|
118
|
-
colorMap:
|
|
118
|
+
colorMap: background_color,
|
|
119
119
|
colorMode,
|
|
120
120
|
fallback: "transparent",
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
if (
|
|
123
|
+
if (color) {
|
|
124
124
|
stylesObject["--text-color"] = getColor({
|
|
125
|
-
colorMap:
|
|
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;
|