@revenuecat/purchases-ui-js 2.0.0 → 2.0.2
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/Button.svelte +1 -5
- package/dist/components/button/ButtonNode.stories.svelte +57 -71
- package/dist/components/button/ButtonNode.stories.svelte.d.ts +0 -8
- package/dist/components/button/ButtonNode.svelte +10 -21
- package/dist/components/button/ButtonNode.svelte.d.ts +2 -2
- package/dist/components/button/button-utils.d.ts +2 -2
- package/dist/components/footer/Footer.stories.svelte +26 -22
- package/dist/components/footer/Footer.stories.svelte.d.ts +0 -5
- package/dist/components/footer/Footer.svelte +3 -10
- package/dist/components/footer/Footer.svelte.d.ts +1 -1
- package/dist/components/image/Image.stories.svelte +27 -19
- package/dist/components/image/Image.svelte +18 -17
- package/dist/components/image/image-utils.d.ts +2 -1
- package/dist/components/image/image-utils.js +2 -2
- package/dist/components/package/Package.stories.svelte +31 -31
- package/dist/components/package/Package.stories.svelte.d.ts +0 -6
- package/dist/components/package/Package.svelte +19 -30
- package/dist/components/package/Package.svelte.d.ts +1 -1
- package/dist/components/paywall/Node.svelte +26 -50
- package/dist/components/paywall/Node.svelte.d.ts +11 -14
- package/dist/components/paywall/Paywall.stories.svelte +21 -78
- package/dist/components/paywall/Paywall.svelte +75 -100
- package/dist/components/paywall/Paywall.svelte.d.ts +4 -4
- package/dist/components/paywall/paywall-utils.d.ts +3 -2
- package/dist/components/paywall/paywall-utils.js +5 -5
- package/dist/components/purchase-button/PurchaseButton.stories.svelte +29 -31
- package/dist/components/purchase-button/PurchaseButton.stories.svelte.d.ts +0 -5
- package/dist/components/purchase-button/PurchaseButton.svelte +9 -20
- package/dist/components/purchase-button/PurchaseButton.svelte.d.ts +1 -1
- package/dist/components/purchase-button/purchase-button-utils.d.ts +1 -1
- package/dist/components/stack/Stack.stories.svelte +17 -94
- package/dist/components/stack/Stack.svelte +18 -48
- package/dist/components/stack/stack-utils.d.ts +4 -3
- package/dist/components/stack/stack-utils.js +7 -10
- package/dist/components/text/TextNode.stories.svelte +45 -152
- package/dist/components/text/TextNode.svelte +15 -23
- package/dist/components/text/text-utils.d.ts +7 -6
- package/dist/components/text/text-utils.js +7 -7
- package/dist/components/timeline/Timeline.stories.svelte +37 -48
- package/dist/components/timeline/Timeline.svelte +0 -2
- package/dist/components/timeline/TimelineItem.svelte +28 -11
- package/dist/components/timeline/timeline-utils.d.ts +3 -3
- package/dist/components/timeline/timeline-utils.js +7 -17
- package/dist/data/entities.d.ts +54 -145
- package/dist/index.d.ts +10 -10
- package/dist/index.js +10 -10
- package/dist/stores/color-mode.d.ts +6 -0
- package/dist/stores/color-mode.js +15 -0
- package/dist/stores/localization.d.ts +13 -0
- package/dist/stores/localization.js +26 -0
- package/dist/stores/paywall.d.ts +11 -0
- package/dist/stores/paywall.js +13 -0
- package/dist/stores/variables.d.ts +5 -0
- package/dist/stores/variables.js +14 -0
- package/dist/stories/fixtures.d.ts +1 -1
- package/dist/stories/fixtures.js +30 -135
- package/dist/stories/localization-decorator.d.ts +3 -0
- package/dist/stories/localization-decorator.js +7 -0
- package/dist/stories/paywall-decorator.d.ts +2 -0
- package/dist/stories/paywall-decorator.js +19 -0
- package/dist/stories/variables-decorator.d.ts +3 -0
- package/dist/stories/variables-decorator.js +9 -0
- package/dist/stories/with-layout.svelte +4 -4
- package/dist/types/alignment.d.ts +19 -0
- package/dist/types/background.d.ts +18 -0
- package/dist/types/background.js +1 -0
- package/dist/types/colors.d.ts +34 -0
- package/dist/types/colors.js +1 -0
- package/dist/types/component.d.ts +6 -0
- package/dist/types/component.js +1 -0
- package/dist/types/components/button.d.ts +36 -0
- package/dist/types/components/button.js +1 -0
- package/dist/types/components/footer.d.ts +5 -0
- package/dist/types/components/footer.js +1 -0
- package/dist/types/components/package.d.ts +8 -0
- package/dist/types/components/package.js +1 -0
- package/dist/types/components/purchase-button.d.ts +5 -0
- package/dist/types/components/purchase-button.js +1 -0
- package/dist/types/localization.d.ts +4 -0
- package/dist/types/localization.js +1 -0
- package/dist/types/media.d.ts +18 -0
- package/dist/types/media.js +1 -0
- package/dist/types.d.ts +5 -35
- package/dist/ui/atoms/typography.stories.svelte +7 -13
- package/dist/ui/atoms/typography.stories.svelte.d.ts +1 -1
- package/dist/ui/atoms/typography.svelte +1 -1
- package/dist/ui/layout/main-block.svelte +2 -2
- package/dist/ui/molecules/button.stories.svelte +8 -15
- package/dist/ui/molecules/button.svelte +3 -2
- package/dist/ui/molecules/button.svelte.d.ts +2 -26
- package/dist/ui/molecules/types.d.ts +2 -1
- package/dist/ui/theme/theme.d.ts +2 -2
- package/dist/ui/theme/theme.js +2 -2
- package/dist/ui/theme/utils.d.ts +2 -2
- package/dist/utils/style-utils.d.ts +13 -11
- package/dist/utils/style-utils.js +21 -27
- package/dist/utils/variable-utils.d.ts +1 -38
- package/dist/utils/variable-utils.js +6 -48
- package/dist/web-components/index.css +1 -1
- package/dist/web-components/index.js +610 -657
- package/package.json +33 -36
- package/dist/data/state.d.ts +0 -9
- package/dist/stores/theme.d.ts +0 -1
- package/dist/stores/theme.js +0 -17
- /package/dist/{data/state.js → types/alignment.js} +0 -0
|
@@ -9,13 +9,9 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const { onclick, children, style, class: clz }: ButtonProps = $props();
|
|
12
|
-
|
|
13
|
-
const handleClick = () => {
|
|
14
|
-
onclick?.();
|
|
15
|
-
};
|
|
16
12
|
</script>
|
|
17
13
|
|
|
18
|
-
<button onclick
|
|
14
|
+
<button {onclick} class={clz} disabled={!onclick} {style}>
|
|
19
15
|
{@render children?.()}
|
|
20
16
|
</button>
|
|
21
17
|
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
2
|
import ButtonNode from "./ButtonNode.svelte";
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "../../data/entities";
|
|
9
|
-
import type { PurchaseState } from "../../data/state";
|
|
10
|
-
import { DEFAULT_COLOR_MODE, DEFAULT_TEXT_COLOR } from "../../utils/constants";
|
|
3
|
+
import type { StackProps, TextNodeProps } from "../../data/entities";
|
|
4
|
+
import { localizationDecorator } from "../../stories/localization-decorator";
|
|
5
|
+
import { DEFAULT_TEXT_COLOR } from "../../utils/constants";
|
|
6
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
11
7
|
|
|
12
|
-
const
|
|
13
|
-
alert(action.type);
|
|
14
|
-
};
|
|
8
|
+
const defaultLocale = "en_US";
|
|
15
9
|
|
|
16
10
|
const { Story } = defineMeta({
|
|
17
11
|
title: "Components/Button",
|
|
18
12
|
component: ButtonNode,
|
|
19
13
|
tags: ["autodocs"],
|
|
14
|
+
decorators: [
|
|
15
|
+
localizationDecorator({
|
|
16
|
+
defaultLocale,
|
|
17
|
+
localizations: {
|
|
18
|
+
[defaultLocale]: {
|
|
19
|
+
id1: "Restore purchases",
|
|
20
|
+
id2: "Navigate back",
|
|
21
|
+
id3: "Navigate to",
|
|
22
|
+
id4: "URL navigation",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
20
27
|
argTypes: {
|
|
21
28
|
action: {
|
|
22
29
|
control: { type: "object" },
|
|
@@ -48,51 +55,34 @@
|
|
|
48
55
|
},
|
|
49
56
|
});
|
|
50
57
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
dark: { type: "hex", value: "transparent" },
|
|
76
|
-
light: { type: "hex", value: "transparent" },
|
|
77
|
-
},
|
|
78
|
-
color: {
|
|
79
|
-
dark: { type: "hex", value: DEFAULT_TEXT_COLOR },
|
|
80
|
-
light: { type: "hex", value: "#ffffff" },
|
|
81
|
-
},
|
|
82
|
-
font_size: "body_m",
|
|
83
|
-
margin: { top: 0, trailing: 0, bottom: 0, leading: 0 },
|
|
84
|
-
padding: { top: 0, trailing: 0, bottom: 0, leading: 0 },
|
|
85
|
-
labels: labelsData,
|
|
86
|
-
size: {
|
|
87
|
-
width: { type: "fit" },
|
|
88
|
-
height: { type: "fit" },
|
|
89
|
-
},
|
|
90
|
-
});
|
|
58
|
+
const textProps = (id: number) =>
|
|
59
|
+
({
|
|
60
|
+
type: "text",
|
|
61
|
+
name: "Button Text",
|
|
62
|
+
id: "button-text-1",
|
|
63
|
+
text_lid: `id${id}`,
|
|
64
|
+
font_weight: "medium",
|
|
65
|
+
horizontal_alignment: "center",
|
|
66
|
+
background_color: {
|
|
67
|
+
dark: { type: "hex", value: "transparent" },
|
|
68
|
+
light: { type: "hex", value: "transparent" },
|
|
69
|
+
},
|
|
70
|
+
color: {
|
|
71
|
+
dark: { type: "hex", value: DEFAULT_TEXT_COLOR },
|
|
72
|
+
light: { type: "hex", value: "#ffffff" },
|
|
73
|
+
},
|
|
74
|
+
font_size: "body_m",
|
|
75
|
+
margin: { top: 0, trailing: 0, bottom: 0, leading: 0 },
|
|
76
|
+
padding: { top: 0, trailing: 0, bottom: 0, leading: 0 },
|
|
77
|
+
size: {
|
|
78
|
+
width: { type: "fit" },
|
|
79
|
+
height: { type: "fit" },
|
|
80
|
+
},
|
|
81
|
+
}) satisfies Partial<TextNodeProps>;
|
|
91
82
|
|
|
92
|
-
const baseStackProps
|
|
83
|
+
const baseStackProps = {
|
|
93
84
|
type: "stack",
|
|
94
85
|
size: { width: { type: "fill" }, height: { type: "fill" } },
|
|
95
|
-
labels: labelsData,
|
|
96
86
|
dimension: {
|
|
97
87
|
type: "horizontal",
|
|
98
88
|
alignment: "center",
|
|
@@ -109,7 +99,16 @@
|
|
|
109
99
|
dark: { type: "hex", value: "#3471eb" },
|
|
110
100
|
light: { type: "hex", value: "#3471eb" },
|
|
111
101
|
},
|
|
112
|
-
|
|
102
|
+
background: {
|
|
103
|
+
type: "color",
|
|
104
|
+
value: {
|
|
105
|
+
dark: { type: "hex", value: "#3471eb" },
|
|
106
|
+
light: { type: "hex", value: "#3471eb" },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
border: null,
|
|
110
|
+
shadow: null,
|
|
111
|
+
} satisfies Partial<StackProps>;
|
|
113
112
|
</script>
|
|
114
113
|
|
|
115
114
|
<!-- Restore purchases -->
|
|
@@ -118,14 +117,10 @@
|
|
|
118
117
|
args={{
|
|
119
118
|
type: "button",
|
|
120
119
|
action: { type: "restore_purchases" },
|
|
121
|
-
labels: labelsData,
|
|
122
120
|
stack: {
|
|
123
121
|
...baseStackProps,
|
|
124
122
|
components: [textProps(1)],
|
|
125
|
-
|
|
126
|
-
} as StackProps,
|
|
127
|
-
purchaseState: purchaseState,
|
|
128
|
-
onAction,
|
|
123
|
+
},
|
|
129
124
|
}}
|
|
130
125
|
/>
|
|
131
126
|
|
|
@@ -135,8 +130,6 @@
|
|
|
135
130
|
args={{
|
|
136
131
|
type: "button",
|
|
137
132
|
action: { type: "navigate_back" },
|
|
138
|
-
onAction,
|
|
139
|
-
labels: labelsData,
|
|
140
133
|
stack: {
|
|
141
134
|
...baseStackProps,
|
|
142
135
|
shape: {
|
|
@@ -153,8 +146,7 @@
|
|
|
153
146
|
light: { type: "hex", value: "#2E7D32" },
|
|
154
147
|
},
|
|
155
148
|
components: [textProps(2)],
|
|
156
|
-
}
|
|
157
|
-
purchaseState: purchaseState,
|
|
149
|
+
},
|
|
158
150
|
}}
|
|
159
151
|
/>
|
|
160
152
|
|
|
@@ -163,12 +155,10 @@
|
|
|
163
155
|
name="Navigate To"
|
|
164
156
|
args={{
|
|
165
157
|
type: "button",
|
|
166
|
-
labels: labelsData,
|
|
167
158
|
action: {
|
|
168
159
|
type: "navigate_to",
|
|
169
160
|
destination: "customer_center",
|
|
170
161
|
},
|
|
171
|
-
onAction,
|
|
172
162
|
stack: {
|
|
173
163
|
...baseStackProps,
|
|
174
164
|
shape: {
|
|
@@ -185,8 +175,7 @@
|
|
|
185
175
|
light: { type: "hex", value: "#D32F2F" },
|
|
186
176
|
},
|
|
187
177
|
components: [textProps(3)],
|
|
188
|
-
}
|
|
189
|
-
purchaseState: purchaseState,
|
|
178
|
+
},
|
|
190
179
|
}}
|
|
191
180
|
/>
|
|
192
181
|
|
|
@@ -195,7 +184,6 @@
|
|
|
195
184
|
name="URL Navigation"
|
|
196
185
|
args={{
|
|
197
186
|
type: "button",
|
|
198
|
-
labels: labelsData,
|
|
199
187
|
action: {
|
|
200
188
|
type: "navigate_to",
|
|
201
189
|
destination: "url",
|
|
@@ -204,7 +192,6 @@
|
|
|
204
192
|
method: "in_app_browser",
|
|
205
193
|
},
|
|
206
194
|
},
|
|
207
|
-
onAction,
|
|
208
195
|
stack: {
|
|
209
196
|
...baseStackProps,
|
|
210
197
|
background_color: {
|
|
@@ -212,7 +199,6 @@
|
|
|
212
199
|
light: { type: "hex", value: "#4A90E2" },
|
|
213
200
|
},
|
|
214
201
|
components: [textProps(4)],
|
|
215
|
-
}
|
|
216
|
-
purchaseState: purchaseState,
|
|
202
|
+
},
|
|
217
203
|
}}
|
|
218
204
|
/>
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import ButtonNode from "./ButtonNode.svelte";
|
|
2
|
-
export declare const labelsData: {
|
|
3
|
-
en_US: {
|
|
4
|
-
id1: string;
|
|
5
|
-
id2: string;
|
|
6
|
-
id3: string;
|
|
7
|
-
id4: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
2
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
11
3
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
12
4
|
$$bindings?: Bindings;
|
|
@@ -1,37 +1,26 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { ButtonDeprecated } from "../../index";
|
|
3
|
-
import type { ButtonNodeProps } from "../../data/entities";
|
|
4
|
-
import Stack from "../stack/Stack.svelte";
|
|
5
2
|
import { getButtonStyles } from "./button-utils";
|
|
3
|
+
import Stack from "../stack/Stack.svelte";
|
|
4
|
+
import { ButtonDeprecated } from "../../index";
|
|
5
|
+
import { getPaywallContext } from "../../stores/paywall";
|
|
6
|
+
import type { ButtonProps } from "../../types/components/button";
|
|
7
|
+
|
|
8
|
+
const { stack, action, ...restProps }: ButtonProps = $props();
|
|
9
|
+
const { onButtonAction } = getPaywallContext();
|
|
6
10
|
|
|
7
|
-
const
|
|
8
|
-
stack,
|
|
9
|
-
action,
|
|
10
|
-
onAction,
|
|
11
|
-
labels,
|
|
12
|
-
purchaseState,
|
|
13
|
-
variableDictionary,
|
|
14
|
-
...restProps
|
|
15
|
-
}: ButtonNodeProps = $props();
|
|
16
|
-
const onClick = () => {
|
|
17
|
-
onAction && onAction(action);
|
|
18
|
-
};
|
|
11
|
+
const onclick = () => onButtonAction(action);
|
|
19
12
|
|
|
20
13
|
const buttonStyles = $derived(
|
|
21
14
|
getButtonStyles({
|
|
22
15
|
stack,
|
|
23
16
|
action,
|
|
24
|
-
onAction,
|
|
25
|
-
labels,
|
|
26
|
-
purchaseState,
|
|
27
|
-
variableDictionary,
|
|
28
17
|
...restProps,
|
|
29
18
|
}),
|
|
30
19
|
);
|
|
31
20
|
</script>
|
|
32
21
|
|
|
33
|
-
<ButtonDeprecated onclick
|
|
34
|
-
<Stack {...stack}
|
|
22
|
+
<ButtonDeprecated {onclick} style={buttonStyles} class={"rc-pw-button"}>
|
|
23
|
+
<Stack {...stack} />
|
|
35
24
|
</ButtonDeprecated>
|
|
36
25
|
|
|
37
26
|
<style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const ButtonNode: import("svelte").Component<
|
|
1
|
+
import type { ButtonProps } from "../../types/components/button";
|
|
2
|
+
declare const ButtonNode: import("svelte").Component<ButtonProps, {}, "">;
|
|
3
3
|
type ButtonNode = ReturnType<typeof ButtonNode>;
|
|
4
4
|
export default ButtonNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function getButtonStyles({ stack, zStackChildStyles }:
|
|
1
|
+
import type { ButtonProps } from "../../types/components/button";
|
|
2
|
+
export declare function getButtonStyles({ stack, zStackChildStyles }: ButtonProps): string;
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
2
|
import Footer from "./Footer.svelte";
|
|
4
|
-
import {
|
|
3
|
+
import { localizationDecorator } from "../../stories/localization-decorator";
|
|
4
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
locale: "en_US",
|
|
8
|
-
defaultLocale: "en_US",
|
|
9
|
-
colorMode: DEFAULT_COLOR_MODE,
|
|
10
|
-
};
|
|
6
|
+
const defaultLocale = "en_US";
|
|
11
7
|
|
|
12
8
|
const { Story } = defineMeta({
|
|
13
9
|
title: "Components/Footer",
|
|
14
10
|
component: Footer,
|
|
15
11
|
tags: ["autodocs"],
|
|
16
|
-
|
|
12
|
+
decorators: [
|
|
13
|
+
localizationDecorator({
|
|
14
|
+
defaultLocale,
|
|
15
|
+
localizations: {
|
|
16
|
+
[defaultLocale]: {
|
|
17
|
+
GM2Sytqd5p: "Do it now before you regret it!",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
],
|
|
17
22
|
});
|
|
18
|
-
|
|
19
|
-
export const labelsData = {
|
|
20
|
-
en_US: {
|
|
21
|
-
GM2Sytqd5p: "Do it now before you regret it!",
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
23
|
</script>
|
|
25
24
|
|
|
26
25
|
<!-- Default -->
|
|
@@ -36,9 +35,16 @@
|
|
|
36
35
|
value: "#6c6c6cFF",
|
|
37
36
|
},
|
|
38
37
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
background: {
|
|
39
|
+
type: "color",
|
|
40
|
+
value: {
|
|
41
|
+
light: {
|
|
42
|
+
type: "hex",
|
|
43
|
+
value: "#6c6c6cFF",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
border: null,
|
|
42
48
|
components: [
|
|
43
49
|
{
|
|
44
50
|
background_color: null,
|
|
@@ -72,7 +78,7 @@
|
|
|
72
78
|
value: null,
|
|
73
79
|
},
|
|
74
80
|
width: {
|
|
75
|
-
type: "
|
|
81
|
+
type: "fit",
|
|
76
82
|
value: null,
|
|
77
83
|
},
|
|
78
84
|
},
|
|
@@ -81,9 +87,9 @@
|
|
|
81
87
|
},
|
|
82
88
|
],
|
|
83
89
|
dimension: {
|
|
84
|
-
alignment: "top",
|
|
85
|
-
distribution: "space_between",
|
|
86
90
|
type: "vertical",
|
|
91
|
+
alignment: "center",
|
|
92
|
+
distribution: "center",
|
|
87
93
|
},
|
|
88
94
|
id: "yI_0xF4hlJ",
|
|
89
95
|
margin: {
|
|
@@ -131,7 +137,5 @@
|
|
|
131
137
|
type: "stack",
|
|
132
138
|
},
|
|
133
139
|
type: "footer",
|
|
134
|
-
purchaseState: purchaseState,
|
|
135
|
-
labels: labelsData,
|
|
136
140
|
}}
|
|
137
141
|
/>
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import Footer from "./Footer.svelte";
|
|
2
|
-
export declare const labelsData: {
|
|
3
|
-
en_US: {
|
|
4
|
-
GM2Sytqd5p: string;
|
|
5
|
-
};
|
|
6
|
-
};
|
|
7
2
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
8
3
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
9
4
|
$$bindings?: Bindings;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { FooterProps } from "../../data/entities";
|
|
3
2
|
import Stack from "../stack/Stack.svelte";
|
|
3
|
+
import type { FooterProps } from "../../types/components/footer";
|
|
4
4
|
|
|
5
|
-
const {
|
|
6
|
-
stack,
|
|
7
|
-
id,
|
|
8
|
-
labels,
|
|
9
|
-
purchaseState,
|
|
10
|
-
variableDictionary,
|
|
11
|
-
onAction,
|
|
12
|
-
}: FooterProps = $props();
|
|
5
|
+
const { stack, id }: FooterProps = $props();
|
|
13
6
|
</script>
|
|
14
7
|
|
|
15
8
|
<div class="rc-pw-footer" {id}>
|
|
16
|
-
<Stack {...stack}
|
|
9
|
+
<Stack {...stack} />
|
|
17
10
|
</div>
|
|
18
11
|
|
|
19
12
|
<style>
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
2
|
import Image from "./Image.svelte";
|
|
4
|
-
import
|
|
5
|
-
import { DEFAULT_COLOR_MODE } from "../../utils/constants";
|
|
6
|
-
|
|
7
|
-
const purchaseState: PurchaseState = {
|
|
8
|
-
colorMode: DEFAULT_COLOR_MODE,
|
|
9
|
-
locale: "en_US",
|
|
10
|
-
defaultLocale: "en_US",
|
|
11
|
-
};
|
|
3
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
12
4
|
|
|
13
5
|
const { Story } = defineMeta({
|
|
14
6
|
title: "Components/Image",
|
|
@@ -16,9 +8,9 @@
|
|
|
16
8
|
tags: ["autodocs"],
|
|
17
9
|
argTypes: {
|
|
18
10
|
id: { control: "text", description: "Unique identifier for the image" },
|
|
19
|
-
|
|
11
|
+
color_overlay: {
|
|
20
12
|
control: "object",
|
|
21
|
-
description: "
|
|
13
|
+
description: "Image overlay",
|
|
22
14
|
},
|
|
23
15
|
size: {
|
|
24
16
|
control: "object",
|
|
@@ -45,7 +37,6 @@
|
|
|
45
37
|
<Story
|
|
46
38
|
name="Rectangle"
|
|
47
39
|
args={{
|
|
48
|
-
purchaseState,
|
|
49
40
|
id: "example-id",
|
|
50
41
|
fit_mode: "fit",
|
|
51
42
|
size: {
|
|
@@ -54,12 +45,15 @@
|
|
|
54
45
|
},
|
|
55
46
|
source: {
|
|
56
47
|
light: {
|
|
48
|
+
width: 600,
|
|
49
|
+
height: 400,
|
|
57
50
|
original: "https://placehold.co/600x400",
|
|
58
51
|
heic: "https://placehold.co/600x400",
|
|
59
52
|
heic_low_res: "https://placehold.co/600x400",
|
|
60
53
|
webp: "https://placehold.co/600x400",
|
|
61
54
|
webp_low_res: "https://placehold.co/600x400",
|
|
62
55
|
},
|
|
56
|
+
dark: null,
|
|
63
57
|
},
|
|
64
58
|
mask_shape: { type: "rectangle" },
|
|
65
59
|
}}
|
|
@@ -69,7 +63,6 @@
|
|
|
69
63
|
<Story
|
|
70
64
|
name="Rounded Rectangle"
|
|
71
65
|
args={{
|
|
72
|
-
purchaseState,
|
|
73
66
|
id: "example-id",
|
|
74
67
|
fit_mode: "fit",
|
|
75
68
|
size: {
|
|
@@ -78,12 +71,15 @@
|
|
|
78
71
|
},
|
|
79
72
|
source: {
|
|
80
73
|
light: {
|
|
74
|
+
width: 600,
|
|
75
|
+
height: 400,
|
|
81
76
|
original: "https://placehold.co/600x400",
|
|
82
77
|
heic: "https://placehold.co/600x400",
|
|
83
78
|
heic_low_res: "https://placehold.co/600x400",
|
|
84
79
|
webp: "https://placehold.co/600x400",
|
|
85
80
|
webp_low_res: "https://placehold.co/600x400",
|
|
86
81
|
},
|
|
82
|
+
dark: null,
|
|
87
83
|
},
|
|
88
84
|
mask_shape: {
|
|
89
85
|
type: "rectangle",
|
|
@@ -100,7 +96,6 @@
|
|
|
100
96
|
<Story
|
|
101
97
|
name="Circle"
|
|
102
98
|
args={{
|
|
103
|
-
purchaseState,
|
|
104
99
|
id: "example-id",
|
|
105
100
|
fit_mode: "fit",
|
|
106
101
|
size: {
|
|
@@ -109,12 +104,15 @@
|
|
|
109
104
|
},
|
|
110
105
|
source: {
|
|
111
106
|
light: {
|
|
107
|
+
width: 600,
|
|
108
|
+
height: 400,
|
|
112
109
|
original: "https://placehold.co/600x400",
|
|
113
110
|
heic: "https://placehold.co/600x400",
|
|
114
111
|
heic_low_res: "https://placehold.co/600x400",
|
|
115
112
|
webp: "https://placehold.co/600x400",
|
|
116
113
|
webp_low_res: "https://placehold.co/600x400",
|
|
117
114
|
},
|
|
115
|
+
dark: null,
|
|
118
116
|
},
|
|
119
117
|
mask_shape: { type: "circle" },
|
|
120
118
|
}}
|
|
@@ -123,7 +121,6 @@
|
|
|
123
121
|
<Story
|
|
124
122
|
name="Concave"
|
|
125
123
|
args={{
|
|
126
|
-
purchaseState,
|
|
127
124
|
id: "example-id",
|
|
128
125
|
fit_mode: "fit",
|
|
129
126
|
size: {
|
|
@@ -132,12 +129,15 @@
|
|
|
132
129
|
},
|
|
133
130
|
source: {
|
|
134
131
|
light: {
|
|
132
|
+
width: 600,
|
|
133
|
+
height: 400,
|
|
135
134
|
original: "https://placehold.co/600x400",
|
|
136
135
|
heic: "https://placehold.co/600x400",
|
|
137
136
|
heic_low_res: "https://placehold.co/600x400",
|
|
138
137
|
webp: "https://placehold.co/600x400",
|
|
139
138
|
webp_low_res: "https://placehold.co/600x400",
|
|
140
139
|
},
|
|
140
|
+
dark: null,
|
|
141
141
|
},
|
|
142
142
|
mask_shape: { type: "concave" },
|
|
143
143
|
}}
|
|
@@ -146,7 +146,6 @@
|
|
|
146
146
|
<Story
|
|
147
147
|
name="Convex"
|
|
148
148
|
args={{
|
|
149
|
-
purchaseState,
|
|
150
149
|
id: "example-id",
|
|
151
150
|
fit_mode: "fit",
|
|
152
151
|
size: {
|
|
@@ -155,12 +154,15 @@
|
|
|
155
154
|
},
|
|
156
155
|
source: {
|
|
157
156
|
light: {
|
|
157
|
+
width: 600,
|
|
158
|
+
height: 400,
|
|
158
159
|
original: "https://placehold.co/600x400",
|
|
159
160
|
heic: "https://placehold.co/600x400",
|
|
160
161
|
heic_low_res: "https://placehold.co/600x400",
|
|
161
162
|
webp: "https://placehold.co/600x400",
|
|
162
163
|
webp_low_res: "https://placehold.co/600x400",
|
|
163
164
|
},
|
|
165
|
+
dark: null,
|
|
164
166
|
},
|
|
165
167
|
mask_shape: { type: "convex" },
|
|
166
168
|
}}
|
|
@@ -169,7 +171,6 @@
|
|
|
169
171
|
<Story
|
|
170
172
|
name="Overlay Radial Gradient"
|
|
171
173
|
args={{
|
|
172
|
-
purchaseState,
|
|
173
174
|
id: "example-id",
|
|
174
175
|
fit_mode: "fit",
|
|
175
176
|
size: {
|
|
@@ -178,12 +179,15 @@
|
|
|
178
179
|
},
|
|
179
180
|
source: {
|
|
180
181
|
light: {
|
|
182
|
+
width: 600,
|
|
183
|
+
height: 400,
|
|
181
184
|
original: "https://placehold.co/600x400",
|
|
182
185
|
heic: "https://placehold.co/600x400",
|
|
183
186
|
heic_low_res: "https://placehold.co/600x400",
|
|
184
187
|
webp: "https://placehold.co/600x400",
|
|
185
188
|
webp_low_res: "https://placehold.co/600x400",
|
|
186
189
|
},
|
|
190
|
+
dark: null,
|
|
187
191
|
},
|
|
188
192
|
color_overlay: {
|
|
189
193
|
dark: {
|
|
@@ -210,7 +214,6 @@
|
|
|
210
214
|
<Story
|
|
211
215
|
name="Overlay Linear Gradient"
|
|
212
216
|
args={{
|
|
213
|
-
purchaseState,
|
|
214
217
|
id: "example-id",
|
|
215
218
|
fit_mode: "fit",
|
|
216
219
|
size: {
|
|
@@ -219,12 +222,15 @@
|
|
|
219
222
|
},
|
|
220
223
|
source: {
|
|
221
224
|
light: {
|
|
225
|
+
width: 600,
|
|
226
|
+
height: 400,
|
|
222
227
|
original: "https://placehold.co/600x400",
|
|
223
228
|
heic: "https://placehold.co/600x400",
|
|
224
229
|
heic_low_res: "https://placehold.co/600x400",
|
|
225
230
|
webp: "https://placehold.co/600x400",
|
|
226
231
|
webp_low_res: "https://placehold.co/600x400",
|
|
227
232
|
},
|
|
233
|
+
dark: null,
|
|
228
234
|
},
|
|
229
235
|
color_overlay: {
|
|
230
236
|
dark: {
|
|
@@ -252,7 +258,6 @@
|
|
|
252
258
|
<Story
|
|
253
259
|
name="Overlay Solid"
|
|
254
260
|
args={{
|
|
255
|
-
purchaseState,
|
|
256
261
|
id: "example-id",
|
|
257
262
|
fit_mode: "fit",
|
|
258
263
|
size: {
|
|
@@ -261,12 +266,15 @@
|
|
|
261
266
|
},
|
|
262
267
|
source: {
|
|
263
268
|
light: {
|
|
269
|
+
width: 600,
|
|
270
|
+
height: 400,
|
|
264
271
|
original: "https://placehold.co/600x400",
|
|
265
272
|
heic: "https://placehold.co/600x400",
|
|
266
273
|
heic_low_res: "https://placehold.co/600x400",
|
|
267
274
|
webp: "https://placehold.co/600x400",
|
|
268
275
|
webp_low_res: "https://placehold.co/600x400",
|
|
269
276
|
},
|
|
277
|
+
dark: null,
|
|
270
278
|
},
|
|
271
279
|
color_overlay: {
|
|
272
280
|
dark: {
|