@revenuecat/purchases-ui-js 4.16.0 → 4.17.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.
@@ -0,0 +1,55 @@
1
+ /** Sizes in CSS pixels. */
2
+ export declare const COOKIE_CONSENT_BANNER: {
3
+ /** Space between the banner and the screen edges, outside the device safe area. */
4
+ readonly edgeGap: 12;
5
+ readonly padding: 16;
6
+ readonly cornerRadius: 16;
7
+ readonly fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";
8
+ readonly shadow: "0 4px 24px rgb(0 0 0 / 0.18), 0 1px 3px rgb(0 0 0 / 0.12)";
9
+ readonly title: {
10
+ readonly fontSize: 16;
11
+ readonly fontWeight: 600;
12
+ readonly lineHeight: 1.3;
13
+ readonly marginBottom: 6;
14
+ };
15
+ readonly body: {
16
+ readonly fontSize: 14;
17
+ readonly lineHeight: 1.45;
18
+ readonly marginBottom: 14;
19
+ };
20
+ readonly buttonGap: 8;
21
+ readonly button: {
22
+ readonly minHeight: 44;
23
+ readonly paddingBlock: 10;
24
+ readonly paddingInline: 16;
25
+ readonly fontSize: 15;
26
+ readonly fontWeight: 600;
27
+ readonly lineHeight: 1.2;
28
+ };
29
+ };
30
+ /** Used for whatever the funnel's banner style and branding leave unset. */
31
+ export declare const COOKIE_CONSENT_DEFAULT_COLORS: {
32
+ readonly background: {
33
+ readonly light: "#FFFFFF";
34
+ readonly dark: "#1E1E1E";
35
+ };
36
+ readonly text: {
37
+ readonly light: "#1A1A1A";
38
+ readonly dark: "#F5F5F5";
39
+ };
40
+ /** Body text is dimmed slightly unless the funnel sets a text or background color. */
41
+ readonly bodyText: {
42
+ readonly light: "#444444";
43
+ readonly dark: "#C8C8C8";
44
+ };
45
+ readonly button: {
46
+ readonly light: "#1A1A1A";
47
+ readonly dark: "#F5F5F5";
48
+ };
49
+ readonly buttonText: {
50
+ readonly light: "#FFFFFF";
51
+ readonly dark: "#1A1A1A";
52
+ };
53
+ };
54
+ /** Concentric with the banner's corner, but never less than half its radius. */
55
+ export declare function cookieConsentButtonRadius(cornerRadius: number): number;
@@ -0,0 +1,36 @@
1
+ // Public surface for `@revenuecat/purchases-ui-js/cookie-consent`. The funnel player
2
+ // renders the cookie consent banner and the dashboard previews it on the canvas;
3
+ // both read these so the preview can't drift from what visitors see.
4
+ /** Sizes in CSS pixels. */
5
+ export const COOKIE_CONSENT_BANNER = {
6
+ /** Space between the banner and the screen edges, outside the device safe area. */
7
+ edgeGap: 12,
8
+ padding: 16,
9
+ cornerRadius: 16,
10
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
11
+ shadow: "0 4px 24px rgb(0 0 0 / 0.18), 0 1px 3px rgb(0 0 0 / 0.12)",
12
+ title: { fontSize: 16, fontWeight: 600, lineHeight: 1.3, marginBottom: 6 },
13
+ body: { fontSize: 14, lineHeight: 1.45, marginBottom: 14 },
14
+ buttonGap: 8,
15
+ button: {
16
+ minHeight: 44,
17
+ paddingBlock: 10,
18
+ paddingInline: 16,
19
+ fontSize: 15,
20
+ fontWeight: 600,
21
+ lineHeight: 1.2,
22
+ },
23
+ };
24
+ /** Used for whatever the funnel's banner style and branding leave unset. */
25
+ export const COOKIE_CONSENT_DEFAULT_COLORS = {
26
+ background: { light: "#FFFFFF", dark: "#1E1E1E" },
27
+ text: { light: "#1A1A1A", dark: "#F5F5F5" },
28
+ /** Body text is dimmed slightly unless the funnel sets a text or background color. */
29
+ bodyText: { light: "#444444", dark: "#C8C8C8" },
30
+ button: { light: "#1A1A1A", dark: "#F5F5F5" },
31
+ buttonText: { light: "#FFFFFF", dark: "#1A1A1A" },
32
+ };
33
+ /** Concentric with the banner's corner, but never less than half its radius. */
34
+ export function cookieConsentButtonRadius(cornerRadius) {
35
+ return Math.max(cornerRadius - COOKIE_CONSENT_BANNER.padding, cornerRadius / 2);
36
+ }
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": "4.16.0",
5
+ "version": "4.17.0",
6
6
  "author": {
7
7
  "name": "RevenueCat, Inc."
8
8
  },
@@ -68,6 +68,10 @@
68
68
  "./safe-area": {
69
69
  "types": "./dist/utils/safe-area.d.ts",
70
70
  "default": "./dist/utils/safe-area.js"
71
+ },
72
+ "./cookie-consent": {
73
+ "types": "./dist/utils/cookie-consent.d.ts",
74
+ "default": "./dist/utils/cookie-consent.js"
71
75
  }
72
76
  },
73
77
  "engines": {