@revenuecat/purchases-ui-js 2.0.4 → 2.0.6

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.
Files changed (53) hide show
  1. package/dist/components/button/ButtonNode.stories.svelte +1 -1
  2. package/dist/components/button/ButtonNode.svelte +15 -6
  3. package/dist/components/package/Package.svelte +3 -1
  4. package/dist/components/paywall/Node.svelte +13 -15
  5. package/dist/components/paywall/Node.svelte.d.ts +1 -7
  6. package/dist/components/paywall/Paywall.stories.svelte +155 -0
  7. package/dist/components/paywall/Paywall.svelte +45 -55
  8. package/dist/components/paywall/Sheet.svelte +126 -0
  9. package/dist/components/paywall/Sheet.svelte.d.ts +4 -0
  10. package/dist/components/paywall/fixtures/background-paywall.d.ts +3 -0
  11. package/dist/components/paywall/fixtures/background-paywall.js +62 -0
  12. package/dist/components/paywall/fixtures/sheet-paywall.d.ts +2 -0
  13. package/dist/components/paywall/fixtures/sheet-paywall.js +325 -0
  14. package/dist/components/stack/Stack.svelte +6 -3
  15. package/dist/components/stack/Stack.svelte.d.ts +2 -0
  16. package/dist/components/tabs/TabControl.svelte +11 -0
  17. package/dist/components/tabs/TabControl.svelte.d.ts +4 -0
  18. package/dist/components/tabs/TabControlButton.svelte +19 -0
  19. package/dist/components/tabs/TabControlButton.svelte.d.ts +4 -0
  20. package/dist/components/tabs/TabControlToggle.svelte +103 -0
  21. package/dist/components/tabs/TabControlToggle.svelte.d.ts +4 -0
  22. package/dist/components/tabs/Tabs.stories.svelte +1368 -0
  23. package/dist/components/tabs/Tabs.stories.svelte.d.ts +19 -0
  24. package/dist/components/tabs/Tabs.svelte +76 -0
  25. package/dist/components/tabs/Tabs.svelte.d.ts +4 -0
  26. package/dist/components/tabs/tabs-context.d.ts +12 -0
  27. package/dist/components/tabs/tabs-context.js +12 -0
  28. package/dist/components/video/Video.stories.svelte +267 -0
  29. package/dist/components/video/Video.stories.svelte.d.ts +19 -0
  30. package/dist/components/video/Video.svelte +248 -0
  31. package/dist/components/video/Video.svelte.d.ts +4 -0
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.js +1 -0
  34. package/dist/stores/selected.d.ts +1 -1
  35. package/dist/stores/selected.js +3 -5
  36. package/dist/types/component.d.ts +6 -4
  37. package/dist/types/components/button.d.ts +2 -1
  38. package/dist/types/components/sheet.d.ts +16 -0
  39. package/dist/types/components/sheet.js +1 -0
  40. package/dist/types/components/tabs.d.ts +56 -0
  41. package/dist/types/components/tabs.js +1 -0
  42. package/dist/types/components/video.d.ts +35 -0
  43. package/dist/types/components/video.js +1 -0
  44. package/dist/types/media.d.ts +17 -4
  45. package/dist/types/paywall.d.ts +1 -2
  46. package/dist/types.d.ts +6 -2
  47. package/dist/utils/base-utils.d.ts +1 -1
  48. package/dist/utils/base-utils.js +2 -17
  49. package/dist/utils/style-utils.d.ts +2 -9
  50. package/dist/utils/style-utils.js +1 -23
  51. package/package.json +1 -1
  52. package/dist/components/paywall/paywall-utils.d.ts +0 -8
  53. package/dist/components/paywall/paywall-utils.js +0 -24
@@ -1,10 +1,10 @@
1
1
  <script module lang="ts">
2
2
  import ButtonNode from "./ButtonNode.svelte";
3
- import type { TextNodeProps } from "../../types/components/text";
4
3
  import { componentDecorator } from "../../stories/component-decorator";
5
4
  import { localizationDecorator } from "../../stories/localization-decorator";
6
5
  import type { ButtonProps } from "../../types/components/button";
7
6
  import type { StackProps } from "../../types/components/stack";
7
+ import type { TextNodeProps } from "../../types/components/text";
8
8
  import { DEFAULT_TEXT_COLOR } from "../../utils/constants";
9
9
  import { defineMeta } from "@storybook/addon-svelte-csf";
10
10
 
@@ -19,11 +19,20 @@
19
19
 
20
20
  const onclick = () => onButtonAction(props.action);
21
21
 
22
- const isWebPurchaseLink = $derived(
23
- action.type === "navigate_to" && action.destination === "web_paywall_link",
24
- );
22
+ const visible = $derived.by(() => {
23
+ switch (action.type) {
24
+ case "navigate_back":
25
+ return false;
26
+ case "navigate_to":
27
+ return action.destination !== "web_paywall_link";
28
+ default:
29
+ return true;
30
+ }
31
+ });
32
+
33
+ const style = $derived({
34
+ visibility: visible ? "visible" : "hidden",
35
+ });
25
36
  </script>
26
37
 
27
- {#if !isWebPurchaseLink}
28
- <Stack {...props.stack} {onclick} />
29
- {/if}
38
+ <Stack {...props.stack} {onclick} {style} />
@@ -13,7 +13,9 @@
13
13
 
14
14
  const { selectedPackageId, variablesPerPackage } = getPaywallContext();
15
15
 
16
- setSelectedStateContext(package_id);
16
+ setSelectedStateContext(
17
+ derived(selectedPackageId, (value) => value === package_id),
18
+ );
17
19
 
18
20
  const onPackageClick = () => {
19
21
  $selectedPackageId = package_id;
@@ -6,6 +6,7 @@
6
6
  PurchaseButton,
7
7
  Stack,
8
8
  Timeline,
9
+ Video,
9
10
  } from "../..";
10
11
  import ButtonNode from "../button/ButtonNode.svelte";
11
12
  import TextNode from "../text/TextNode.svelte";
@@ -13,18 +14,10 @@
13
14
  import type { Component as SvelteComponent } from "svelte";
14
15
  import Carousel from "../carousel/Carousel.svelte";
15
16
  import Icon from "../icon/Icon.svelte";
16
-
17
- type SupportedComponents =
18
- | ButtonNode
19
- | Carousel
20
- | Footer
21
- | Icon
22
- | Image
23
- | Package
24
- | PurchaseButton
25
- | Stack
26
- | TextNode
27
- | Timeline;
17
+ import TabControl from "../tabs/TabControl.svelte";
18
+ import TabControlButton from "../tabs/TabControlButton.svelte";
19
+ import TabControlToggle from "../tabs/TabControlToggle.svelte";
20
+ import Tabs from "../tabs/Tabs.svelte";
28
21
 
29
22
  interface Props {
30
23
  nodeData: Component;
@@ -39,8 +32,13 @@
39
32
  package: Package,
40
33
  purchase_button: PurchaseButton,
41
34
  stack: Stack,
35
+ tab_control_button: TabControlButton,
36
+ tab_control_toggle: TabControlToggle,
37
+ tab_control: TabControl,
38
+ tabs: Tabs,
42
39
  text: TextNode,
43
40
  timeline: Timeline,
41
+ video: Video,
44
42
  } satisfies {
45
43
  [key in Component["type"]]: SvelteComponent<
46
44
  Extract<Component, { type: key }>
@@ -58,12 +56,12 @@
58
56
  */
59
57
  export const getComponentClass: (
60
58
  nodeData: Component,
61
- ) => [SvelteComponent<SupportedComponents>, Component] | undefined = (
59
+ ) => [SvelteComponent<Component>, Component] | undefined = (
62
60
  nodeData: Component,
63
61
  ) => {
64
62
  if (ComponentTypes[nodeData.type]) {
65
63
  return [
66
- ComponentTypes[nodeData.type] as SvelteComponent<SupportedComponents>,
64
+ ComponentTypes[nodeData.type] as SvelteComponent<Component>,
67
65
  nodeData,
68
66
  ];
69
67
  }
@@ -71,7 +69,7 @@
71
69
  const { fallback } = nodeData;
72
70
  if (fallback && ComponentTypes[fallback?.type]) {
73
71
  return [
74
- ComponentTypes[fallback.type] as SvelteComponent<SupportedComponents>,
72
+ ComponentTypes[fallback.type] as SvelteComponent<Component>,
75
73
  fallback,
76
74
  ];
77
75
  }
@@ -1,11 +1,5 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { Footer, Image, Package, PurchaseButton, Stack, Timeline } from "../..";
3
- import ButtonNode from "../button/ButtonNode.svelte";
4
- import TextNode from "../text/TextNode.svelte";
5
2
  import type { Component } from "../../types/component";
6
- import Carousel from "../carousel/Carousel.svelte";
7
- import Icon from "../icon/Icon.svelte";
8
- type SupportedComponents = ButtonNode | Carousel | Footer | Icon | Image | Package | PurchaseButton | Stack | TextNode | Timeline;
9
3
  interface Props {
10
4
  nodeData: Component;
11
5
  }
@@ -18,7 +12,7 @@ declare const Node: import("svelte").Component<Props, {
18
12
  * @param nodeData:Component - the Component object representing a Node in the paywall
19
13
  * @returns [Component<SupportedComponents>, Component] - a tuple containing the component class and the node data
20
14
  * @throws Error - if the component type and the fallback component type are not supported
21
- */ getComponentClass: (nodeData: Component) => [SvelteComponent<SupportedComponents>, Component] | undefined;
15
+ */ getComponentClass: (nodeData: Component) => [SvelteComponent<Component>, Component] | undefined;
22
16
  }, "">;
23
17
  type Node = ReturnType<typeof Node>;
24
18
  export default Node;
@@ -19,7 +19,11 @@
19
19
  uiConfigData,
20
20
  zStackTemplate,
21
21
  } from "../../stories/fixtures";
22
+ import { waitForAnimations } from "storybook/internal/preview-api";
23
+ import { viewportDecorator } from "../../stories/viewport-decorator";
24
+ import { BACKGROUND_PAYWALL } from "./fixtures/background-paywall";
22
25
  import { OVERRIDE_PAYWALL } from "./fixtures/override-paywall";
26
+ import { SHEET_PAYWALL } from "./fixtures/sheet-paywall";
23
27
  import { STACK_PAYWALL } from "./fixtures/stack-paywall";
24
28
  import { VARIABLES } from "./fixtures/variables";
25
29
 
@@ -53,6 +57,157 @@
53
57
  }}
54
58
  />
55
59
 
60
+ <Story
61
+ name="Sheet"
62
+ decorators={[viewportDecorator(500, 500, 0)]}
63
+ play={async ({ canvasElement }) => {
64
+ const button = canvasElement.querySelector("button");
65
+ button?.click();
66
+ await waitForAnimations();
67
+ }}
68
+ args={{
69
+ paywallData: SHEET_PAYWALL,
70
+ }}
71
+ />
72
+
73
+ <Story
74
+ name="Background - Color"
75
+ decorators={[viewportDecorator(500, 500, 0)]}
76
+ args={{
77
+ paywallData: BACKGROUND_PAYWALL({
78
+ type: "color",
79
+ value: {
80
+ light: {
81
+ type: "hex",
82
+ value: "#ddffddff",
83
+ },
84
+ },
85
+ }),
86
+ }}
87
+ />
88
+
89
+ <Story
90
+ name="Background - Linear gradient"
91
+ decorators={[viewportDecorator(500, 500, 0)]}
92
+ args={{
93
+ paywallData: BACKGROUND_PAYWALL({
94
+ type: "color",
95
+ value: {
96
+ light: {
97
+ type: "linear",
98
+ degrees: 0,
99
+ points: [
100
+ { percent: 0, color: "#ddffddff" },
101
+ {
102
+ percent: 100,
103
+ color: "#000000ff",
104
+ },
105
+ ],
106
+ },
107
+ },
108
+ }),
109
+ }}
110
+ />
111
+
112
+ <Story
113
+ name="Background - Radial gradient"
114
+ decorators={[viewportDecorator(500, 500, 0)]}
115
+ args={{
116
+ paywallData: BACKGROUND_PAYWALL({
117
+ type: "color",
118
+ value: {
119
+ light: {
120
+ type: "radial",
121
+ points: [
122
+ { percent: 0, color: "#ddffddff" },
123
+ {
124
+ percent: 100,
125
+ color: "#000000ff",
126
+ },
127
+ ],
128
+ },
129
+ },
130
+ }),
131
+ }}
132
+ />
133
+
134
+ <Story
135
+ name="Background - Image fit"
136
+ decorators={[viewportDecorator(500, 500, 0)]}
137
+ args={{
138
+ paywallData: BACKGROUND_PAYWALL({
139
+ type: "image",
140
+ fit_mode: "fit",
141
+ color_overlay: null,
142
+ value: {
143
+ light: {
144
+ width: 600,
145
+ height: 400,
146
+ original: "https://placehold.co/500x1000",
147
+ heic: "https://placehold.co/500x1000",
148
+ heic_low_res: "https://placehold.co/500x1000",
149
+ webp: "https://placehold.co/500x1000",
150
+ webp_low_res: "https://placehold.co/500x1000",
151
+ },
152
+ },
153
+ }),
154
+ }}
155
+ />
156
+
157
+ <Story
158
+ name="Background - Image fill"
159
+ decorators={[viewportDecorator(500, 500, 0)]}
160
+ args={{
161
+ paywallData: BACKGROUND_PAYWALL({
162
+ type: "image",
163
+ fit_mode: "fill",
164
+ color_overlay: null,
165
+ value: {
166
+ light: {
167
+ width: 600,
168
+ height: 400,
169
+ original: "https://placehold.co/500x1000",
170
+ heic: "https://placehold.co/500x1000",
171
+ heic_low_res: "https://placehold.co/500x1000",
172
+ webp: "https://placehold.co/500x1000",
173
+ webp_low_res: "https://placehold.co/500x1000",
174
+ },
175
+ },
176
+ }),
177
+ }}
178
+ />
179
+
180
+ <Story
181
+ name="Background - Image overlay"
182
+ decorators={[viewportDecorator(500, 500, 0)]}
183
+ args={{
184
+ paywallData: BACKGROUND_PAYWALL({
185
+ type: "image",
186
+ fit_mode: "fill",
187
+ color_overlay: {
188
+ light: {
189
+ type: "radial",
190
+ points: [
191
+ { percent: 0, color: "#ddffdd7f" },
192
+ { percent: 100, color: "#0000007f" },
193
+ ],
194
+ },
195
+ },
196
+ value: {
197
+ light: {
198
+ width: 600,
199
+ height: 400,
200
+ original: "https://placehold.co/500x1000",
201
+ heic: "https://placehold.co/500x1000",
202
+ heic_low_res: "https://placehold.co/500x1000",
203
+ webp: "https://placehold.co/500x1000",
204
+ webp_low_res: "https://placehold.co/500x1000",
205
+ },
206
+ },
207
+ }),
208
+ }}
209
+ />
210
+
56
211
  <Story
57
212
  name="Primary"
58
213
  args={{
@@ -1,10 +1,5 @@
1
1
  <script lang="ts">
2
2
  import Footer from "../footer/Footer.svelte";
3
- import Node from "./Node.svelte";
4
- import {
5
- getBackgroundImageSource,
6
- getBackgroundStyles,
7
- } from "./paywall-utils";
8
3
  import { setColorModeContext } from "../../stores/color-mode";
9
4
  import { setLocalizationContext } from "../../stores/localization";
10
5
  import { setPaywallContext } from "../../stores/paywall";
@@ -14,13 +9,18 @@
14
9
  } from "../../stores/variables";
15
10
  import type { ColorMode } from "../../types";
16
11
  import type { Action } from "../../types/components/button";
12
+ import type { SheetProps } from "../../types/components/sheet";
17
13
  import type { PaywallData } from "../../types/paywall";
18
14
  import type { UIConfig } from "../../types/ui-config";
19
15
  import type { VariableDictionary } from "../../types/variables";
16
+ import { mapBackground } from "../../utils/background-utils";
17
+ import { css } from "../../utils/base-utils";
20
18
  import { registerFonts } from "../../utils/font-utils";
21
19
  import { findSelectedPackageId } from "../../utils/style-utils";
22
20
  import { onMount } from "svelte";
23
21
  import { derived, readable, writable } from "svelte/store";
22
+ import Stack from "../stack/Stack.svelte";
23
+ import Sheet from "./Sheet.svelte";
24
24
 
25
25
  interface Props {
26
26
  paywallData: PaywallData;
@@ -53,14 +53,18 @@
53
53
  const getColorMode = setColorModeContext(() => preferredColorMode);
54
54
  const colorMode = $derived(getColorMode());
55
55
 
56
+ const { default_locale, components_config, components_localizations } =
57
+ paywallData;
58
+ const { base } = components_config;
59
+
56
60
  const { getLocalizedString } = setLocalizationContext(() => ({
57
- defaultLocale: paywallData.default_locale,
61
+ defaultLocale: default_locale,
58
62
  selectedLocale,
59
- localizations: paywallData.components_localizations!,
63
+ localizations: components_localizations!,
60
64
  }));
61
65
 
62
66
  const selectedPackageId = writable<string | undefined>(
63
- findSelectedPackageId(paywallData),
67
+ findSelectedPackageId(base),
64
68
  );
65
69
 
66
70
  const onPurchase = () => {
@@ -70,6 +74,8 @@
70
74
  }
71
75
  };
72
76
 
77
+ let sheet = $state<SheetProps>();
78
+
73
79
  const onButtonAction = (action: Action) => {
74
80
  switch (action.type) {
75
81
  case "navigate_back":
@@ -92,10 +98,12 @@
92
98
  onNavigateToUrlClicked?.(url);
93
99
  }
94
100
  return;
95
- case "offer_code":
96
101
  case "sheet":
102
+ sheet = action.sheet ?? undefined;
103
+ return;
104
+ case "offer_code":
97
105
  case "web_paywall_link":
98
- // TODO: Implement later.
106
+ // Ignored.
99
107
  return;
100
108
  }
101
109
  };
@@ -115,49 +123,52 @@
115
123
 
116
124
  setVariablesContext(variables);
117
125
 
118
- const backgroundStyles = $derived(
119
- getBackgroundStyles({
120
- background: paywallData.components_config.base?.background,
121
- colorMode,
126
+ const style = $derived(
127
+ css({
128
+ ...mapBackground(colorMode, null, base.background),
122
129
  }),
123
130
  );
124
- const backgroundImgSource = $derived(
125
- getBackgroundImageSource(paywallData, colorMode),
126
- );
127
131
 
128
132
  onMount(() => {
129
133
  registerFonts(uiConfig);
130
134
  });
135
+
136
+ const paywallClass = $derived(sheet ? "paywall blur" : "paywall");
137
+
138
+ const { stack, sticky_footer } = base;
131
139
  </script>
132
140
 
133
141
  <svelte:boundary onerror={onError}>
134
- <div class="rc-pw-paywall">
135
- <Node nodeData={paywallData.components_config.base.stack} />
136
-
137
- {#if paywallData.components_config.base.sticky_footer}
138
- <Footer
139
- {...paywallData.components_config.base.sticky_footer}
140
- stack={paywallData.components_config.base.sticky_footer.stack}
141
- />
142
- {/if}
143
- {#if paywallData.components_config.base.background?.type === "color"}
144
- <div class="rc-pw-paywall-background" style={backgroundStyles}></div>
145
- {:else if paywallData.components_config.base.background?.type === "image"}
146
- <div class="rc-pw-paywall-background rc-pw-image-container">
147
- <img class="rc-pw-image" src={backgroundImgSource} alt="" />
148
- </div>
142
+ <div class={paywallClass} {style}>
143
+ <Stack {...stack} />
144
+
145
+ {#if sticky_footer}
146
+ <Footer {...sticky_footer} />
149
147
  {/if}
150
148
  </div>
149
+
150
+ {#if sheet}
151
+ <Sheet {...sheet} />
152
+ {/if}
151
153
  </svelte:boundary>
152
154
 
153
155
  <style>
154
- .rc-pw-paywall {
156
+ .paywall {
155
157
  position: relative;
156
158
  display: flex;
157
159
  flex-direction: column;
158
160
  align-items: stretch;
159
161
  height: 100%;
160
- overflow: hidden;
162
+
163
+ transition-property: filter, transform;
164
+ transition-duration: 0.1s;
165
+ transition-timing-function: ease-in-out;
166
+ transform-origin: center;
167
+
168
+ &:global(.blur) {
169
+ filter: blur(10px) brightness(0.8);
170
+ transform: scale(1.045);
171
+ }
161
172
 
162
173
  & > :global(*:first-child) {
163
174
  flex-grow: 1;
@@ -165,27 +176,6 @@
165
176
  }
166
177
  }
167
178
 
168
- .rc-pw-paywall-background {
169
- position: absolute;
170
- top: 0;
171
- left: 0;
172
- width: 100%;
173
- height: 100%;
174
- background: var(--paywall-background, none);
175
- z-index: -1;
176
- }
177
- .rc-pw-image-container {
178
- overflow: hidden;
179
- background: none;
180
- }
181
-
182
- .rc-pw-image {
183
- width: 100%;
184
- height: 100%;
185
- object-fit: cover;
186
- display: block;
187
- }
188
-
189
179
  :global {
190
180
  *,
191
181
  *::before,
@@ -0,0 +1,126 @@
1
+ <script lang="ts">
2
+ import { getColorModeContext } from "../../stores/color-mode";
3
+ import { getPaywallContext } from "../../stores/paywall";
4
+ import { getSelectedStateContext } from "../../stores/selected";
5
+ import type { SheetProps } from "../../types/components/sheet";
6
+ import { mapBackground } from "../../utils/background-utils";
7
+ import { css, mapSize } from "../../utils/base-utils";
8
+ import { getActiveStateProps } from "../../utils/style-utils";
9
+ import { onMount } from "svelte";
10
+ import Stack from "../stack/Stack.svelte";
11
+
12
+ const props: SheetProps = $props();
13
+ const { stack } = props;
14
+
15
+ const selectedState = getSelectedStateContext();
16
+ const { size, background, background_blur, position } = $derived.by(() => {
17
+ return {
18
+ ...props,
19
+ ...getActiveStateProps($selectedState, props.overrides),
20
+ };
21
+ });
22
+
23
+ const getColorMode = getColorModeContext();
24
+ const colorMode = $derived(getColorMode());
25
+
26
+ const backdropStyle = $derived(
27
+ css({
28
+ background: background_blur ? "#0000003f" : "",
29
+ }),
30
+ );
31
+
32
+ const sheetStyle = $derived(
33
+ css({
34
+ height: mapSize(size.height),
35
+ ...mapBackground(colorMode, null, background),
36
+ }),
37
+ );
38
+
39
+ const { onButtonAction } = getPaywallContext();
40
+
41
+ let sheet: HTMLDivElement | undefined;
42
+ let visible = $state(false);
43
+
44
+ onMount(() => {
45
+ requestAnimationFrame(() => {
46
+ visible = true;
47
+ });
48
+ });
49
+
50
+ const hideSheet = () => {
51
+ visible = false;
52
+ };
53
+
54
+ const ontransitionend = () => {
55
+ if (visible) {
56
+ return;
57
+ }
58
+
59
+ onButtonAction({
60
+ type: "navigate_to",
61
+ destination: "sheet",
62
+ sheet: null,
63
+ });
64
+ };
65
+
66
+ const onclick = (event: MouseEvent) => {
67
+ if (event.target === event.currentTarget) {
68
+ hideSheet();
69
+ }
70
+ };
71
+
72
+ const onkeydown = (event: KeyboardEvent) => {
73
+ if (event.key === "Escape") {
74
+ hideSheet();
75
+ }
76
+ };
77
+
78
+ let sheetClass = $derived(`sheet ${visible ? "visible" : ""}`);
79
+ </script>
80
+
81
+ <div
82
+ class="backdrop"
83
+ style={backdropStyle}
84
+ {onclick}
85
+ {onkeydown}
86
+ role="presentation"
87
+ tabindex="-1"
88
+ aria-hidden="true"
89
+ >
90
+ <div
91
+ bind:this={sheet}
92
+ class={sheetClass}
93
+ style={sheetStyle}
94
+ role="dialog"
95
+ aria-modal="true"
96
+ {ontransitionend}
97
+ >
98
+ <Stack {...stack} />
99
+ </div>
100
+ </div>
101
+
102
+ <style>
103
+ .backdrop {
104
+ position: absolute;
105
+ inset: 0 0 0 0;
106
+ width: 100%;
107
+ height: 100%;
108
+ background-color: #0000003f;
109
+
110
+ display: flex;
111
+ flex-direction: column;
112
+ }
113
+
114
+ .sheet {
115
+ position: absolute;
116
+ inset: auto 0 0 0;
117
+ transition-property: transform;
118
+ transition-duration: 225ms;
119
+ transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
120
+ transform: translateY(100%);
121
+
122
+ &.visible {
123
+ transform: translateY(0);
124
+ }
125
+ }
126
+ </style>
@@ -0,0 +1,4 @@
1
+ import type { SheetProps } from "../../types/components/sheet";
2
+ declare const Sheet: import("svelte").Component<SheetProps, {}, "">;
3
+ type Sheet = ReturnType<typeof Sheet>;
4
+ export default Sheet;
@@ -0,0 +1,3 @@
1
+ import type { Background } from "../../../types/background";
2
+ import type { PaywallData } from "../../../types/paywall";
3
+ export declare const BACKGROUND_PAYWALL: (background: Background) => PaywallData;
@@ -0,0 +1,62 @@
1
+ export const BACKGROUND_PAYWALL = (background) => {
2
+ return {
3
+ default_locale: "en_US",
4
+ components_localizations: {
5
+ en_US: {},
6
+ },
7
+ components_config: {
8
+ base: {
9
+ background,
10
+ stack: {
11
+ background: null,
12
+ background_color: null,
13
+ badge: null,
14
+ border: null,
15
+ components: [],
16
+ dimension: {
17
+ alignment: "center",
18
+ distribution: "start",
19
+ type: "vertical",
20
+ },
21
+ id: "rocJhuHfiP",
22
+ margin: {
23
+ bottom: 0,
24
+ leading: 0,
25
+ top: 0,
26
+ trailing: 0,
27
+ },
28
+ name: "Content",
29
+ padding: {
30
+ bottom: 0,
31
+ leading: 0,
32
+ top: 0,
33
+ trailing: 0,
34
+ },
35
+ shadow: null,
36
+ shape: {
37
+ corners: {
38
+ bottom_leading: 0,
39
+ bottom_trailing: 0,
40
+ top_leading: 0,
41
+ top_trailing: 0,
42
+ },
43
+ type: "rectangle",
44
+ },
45
+ size: {
46
+ height: {
47
+ type: "fit",
48
+ value: null,
49
+ },
50
+ width: {
51
+ type: "fill",
52
+ value: null,
53
+ },
54
+ },
55
+ spacing: 16,
56
+ type: "stack",
57
+ },
58
+ sticky_footer: null,
59
+ },
60
+ },
61
+ };
62
+ };
@@ -0,0 +1,2 @@
1
+ import type { PaywallData } from "../../../types/paywall";
2
+ export declare const SHEET_PAYWALL: PaywallData;