@revenuecat/purchases-ui-js 2.0.3 → 2.0.5
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/button/ButtonNode.stories.svelte +1 -1
- package/dist/components/button/ButtonNode.svelte +27 -3
- package/dist/components/carousel/Carousel.stories.svelte +1039 -0
- package/dist/components/carousel/Carousel.stories.svelte.d.ts +19 -0
- package/dist/components/carousel/Carousel.svelte +298 -0
- package/dist/components/carousel/Carousel.svelte.d.ts +4 -0
- package/dist/components/carousel/CarouselPage.svelte +39 -0
- package/dist/components/carousel/CarouselPage.svelte.d.ts +11 -0
- package/dist/components/carousel/PageControl.svelte +93 -0
- package/dist/components/carousel/PageControl.svelte.d.ts +4 -0
- package/dist/components/carousel/carousel-utils.d.ts +4 -0
- package/dist/components/carousel/carousel-utils.js +21 -0
- package/dist/components/package/Package.svelte +3 -1
- package/dist/components/paywall/Node.svelte +12 -24
- package/dist/components/paywall/Node.svelte.d.ts +1 -6
- package/dist/components/paywall/Paywall.stories.svelte +155 -0
- package/dist/components/paywall/Paywall.svelte +50 -59
- package/dist/components/paywall/Paywall.svelte.d.ts +2 -1
- package/dist/components/paywall/Sheet.svelte +126 -0
- package/dist/components/paywall/Sheet.svelte.d.ts +4 -0
- package/dist/components/paywall/fixtures/background-paywall.d.ts +3 -0
- package/dist/components/paywall/fixtures/background-paywall.js +62 -0
- package/dist/components/paywall/fixtures/override-paywall.d.ts +1 -1
- package/dist/components/paywall/fixtures/sheet-paywall.d.ts +2 -0
- package/dist/components/paywall/fixtures/sheet-paywall.js +325 -0
- package/dist/components/paywall/fixtures/stack-paywall.d.ts +1 -1
- package/dist/components/stack/Stack.svelte +6 -1
- package/dist/components/stack/Stack.svelte.d.ts +2 -0
- package/dist/components/tabs/TabControl.svelte +11 -0
- package/dist/components/tabs/TabControl.svelte.d.ts +4 -0
- package/dist/components/tabs/TabControlButton.svelte +19 -0
- package/dist/components/tabs/TabControlButton.svelte.d.ts +4 -0
- package/dist/components/tabs/Tabs.stories.svelte +929 -0
- package/dist/components/tabs/Tabs.stories.svelte.d.ts +19 -0
- package/dist/components/tabs/Tabs.svelte +69 -0
- package/dist/components/tabs/Tabs.svelte.d.ts +4 -0
- package/dist/components/tabs/tabs-context.d.ts +11 -0
- package/dist/components/tabs/tabs-context.js +12 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/stores/paywall.d.ts +1 -1
- package/dist/stores/selected.d.ts +1 -1
- package/dist/stores/selected.js +3 -5
- package/dist/stories/fixtures.d.ts +2 -1
- package/dist/stories/viewport-wrapper.svelte +7 -5
- package/dist/types/component.d.ts +5 -3
- package/dist/types/components/button.d.ts +4 -1
- package/dist/types/components/carousel.d.ts +51 -0
- package/dist/types/components/sheet.d.ts +16 -0
- package/dist/types/components/sheet.js +1 -0
- package/dist/types/components/tabs.d.ts +46 -0
- package/dist/types/components/tabs.js +1 -0
- package/dist/types/paywall.d.ts +26 -0
- package/dist/types/paywall.js +1 -0
- package/dist/types/ui-config.d.ts +20 -0
- package/dist/types/ui-config.js +1 -0
- package/dist/types.d.ts +6 -2
- package/dist/utils/base-utils.d.ts +1 -1
- package/dist/utils/base-utils.js +2 -17
- package/dist/utils/font-utils.d.ts +1 -1
- package/dist/utils/style-utils.d.ts +2 -9
- package/dist/utils/style-utils.js +7 -24
- package/dist/web-components/index.js +969 -942
- package/package.json +20 -20
- package/dist/components/paywall/paywall-utils.d.ts +0 -8
- package/dist/components/paywall/paywall-utils.js +0 -24
- package/dist/data/entities.d.ts +0 -46
- /package/dist/{data/entities.js → types/components/carousel.js} +0 -0
|
@@ -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
|
|
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Stack from "../stack/Stack.svelte";
|
|
3
3
|
import { getPaywallContext } from "../../stores/paywall";
|
|
4
|
+
import { getSelectedStateContext } from "../../stores/selected";
|
|
4
5
|
import type { ButtonProps } from "../../types/components/button";
|
|
6
|
+
import { getActiveStateProps } from "../../utils/style-utils";
|
|
7
|
+
|
|
8
|
+
const props: ButtonProps = $props();
|
|
9
|
+
|
|
10
|
+
const selectedState = getSelectedStateContext();
|
|
11
|
+
const { action } = $derived.by(() => {
|
|
12
|
+
return {
|
|
13
|
+
...props,
|
|
14
|
+
...getActiveStateProps($selectedState, props.overrides),
|
|
15
|
+
};
|
|
16
|
+
});
|
|
5
17
|
|
|
6
|
-
const { stack, action }: ButtonProps = $props();
|
|
7
18
|
const { onButtonAction } = getPaywallContext();
|
|
8
19
|
|
|
9
|
-
const onclick = () => onButtonAction(action);
|
|
20
|
+
const onclick = () => onButtonAction(props.action);
|
|
21
|
+
|
|
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
|
+
});
|
|
10
32
|
</script>
|
|
11
33
|
|
|
12
|
-
|
|
34
|
+
{#if visible}
|
|
35
|
+
<Stack {...props.stack} {onclick} />
|
|
36
|
+
{/if}
|