@revenuecat/purchases-ui-js 2.0.1 → 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/ButtonNode.stories.svelte +0 -6
- package/dist/components/button/ButtonNode.svelte +3 -6
- package/dist/components/footer/Footer.stories.svelte +0 -4
- package/dist/components/footer/Footer.svelte +3 -3
- package/dist/components/image/Image.stories.svelte +2 -13
- package/dist/components/image/Image.svelte +1 -2
- package/dist/components/package/Package.stories.svelte +2 -6
- package/dist/components/package/Package.svelte +4 -11
- package/dist/components/paywall/Node.svelte +23 -20
- package/dist/components/paywall/Node.svelte.d.ts +9 -8
- package/dist/components/paywall/Paywall.svelte +16 -14
- package/dist/components/purchase-button/PurchaseButton.stories.svelte +0 -8
- package/dist/components/purchase-button/PurchaseButton.svelte +3 -10
- package/dist/components/stack/Stack.stories.svelte +11 -43
- package/dist/components/stack/Stack.svelte +3 -23
- package/dist/components/stack/stack-utils.js +0 -2
- package/dist/components/text/TextNode.stories.svelte +0 -12
- package/dist/components/text/TextNode.svelte +2 -11
- package/dist/components/text/text-utils.d.ts +1 -1
- package/dist/components/timeline/Timeline.stories.svelte +0 -5
- package/dist/components/timeline/Timeline.svelte +0 -2
- package/dist/components/timeline/timeline-utils.js +0 -1
- package/dist/data/entities.d.ts +18 -48
- package/dist/index.d.ts +10 -10
- package/dist/index.js +10 -10
- package/dist/stores/localization.d.ts +1 -1
- package/dist/stores/localization.js +3 -2
- package/dist/stores/paywall.d.ts +5 -4
- package/dist/stores/variables.d.ts +1 -2
- package/dist/stories/fixtures.d.ts +1 -1
- package/dist/stories/fixtures.js +23 -59
- package/dist/stories/localization-decorator.js +1 -1
- package/dist/stories/paywall-decorator.js +2 -1
- package/dist/stories/with-layout.svelte +3 -3
- package/dist/types/component.d.ts +6 -0
- package/dist/types/components/button.d.ts +2 -2
- package/dist/types/components/footer.d.ts +2 -2
- package/dist/types/components/package.d.ts +2 -2
- package/dist/types/components/purchase-button.d.ts +2 -2
- package/dist/ui/atoms/typography.stories.svelte +2 -2
- package/dist/ui/atoms/typography.stories.svelte.d.ts +1 -1
- package/dist/ui/layout/main-block.svelte +2 -2
- package/dist/ui/molecules/button.stories.svelte +2 -2
- package/dist/ui/molecules/button.svelte +1 -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.js +13 -12
- package/dist/web-components/index.css +1 -1
- package/dist/web-components/index.js +144 -144
- package/package.json +1 -1
- package/dist/data/state.d.ts +0 -4
- /package/dist/{data/state.js → types/component.js} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
|
-
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
2
|
import Stack from "./Stack.svelte";
|
|
3
|
+
import type { StackProps, TextNodeProps } from "../../data/entities";
|
|
4
|
+
import { localizations } from "../../stories/fixtures";
|
|
5
|
+
import { localizationDecorator } from "../../stories/localization-decorator";
|
|
4
6
|
import {
|
|
5
7
|
borderStoryMeta,
|
|
6
8
|
getColorStoryMeta,
|
|
@@ -9,18 +11,13 @@
|
|
|
9
11
|
sizeStoryMeta,
|
|
10
12
|
stackDimensionStoryMeta,
|
|
11
13
|
} from "../../stories/meta-templates";
|
|
12
|
-
import { labelsData } from "../../stories/fixtures";
|
|
13
|
-
import type { PurchaseState } from "../../data/state";
|
|
14
|
-
import type { PaywallComponent } from "../../data/entities";
|
|
15
14
|
import {
|
|
16
15
|
DEFAULT_BACKGROUND_COLOR,
|
|
17
16
|
DEFAULT_TEXT_COLOR,
|
|
18
17
|
} from "../../utils/constants";
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
const defaultLocale = Object.keys(labelsData)[0];
|
|
18
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
22
19
|
|
|
23
|
-
const
|
|
20
|
+
const defaultLocale = Object.keys(localizations)[0];
|
|
24
21
|
|
|
25
22
|
const { Story } = defineMeta({
|
|
26
23
|
title: "Components/Stack",
|
|
@@ -29,10 +26,9 @@
|
|
|
29
26
|
decorators: [
|
|
30
27
|
localizationDecorator({
|
|
31
28
|
defaultLocale,
|
|
32
|
-
localizations
|
|
29
|
+
localizations,
|
|
33
30
|
}),
|
|
34
31
|
],
|
|
35
|
-
args: { purchaseState },
|
|
36
32
|
argTypes: {
|
|
37
33
|
dimension: stackDimensionStoryMeta,
|
|
38
34
|
spacing: {
|
|
@@ -48,7 +44,7 @@
|
|
|
48
44
|
},
|
|
49
45
|
});
|
|
50
46
|
|
|
51
|
-
const components
|
|
47
|
+
const components = [
|
|
52
48
|
{
|
|
53
49
|
type: "text",
|
|
54
50
|
size: {
|
|
@@ -57,7 +53,6 @@
|
|
|
57
53
|
},
|
|
58
54
|
horizontal_alignment: "center",
|
|
59
55
|
name: "Item 1",
|
|
60
|
-
components: [],
|
|
61
56
|
id: "1",
|
|
62
57
|
text_lid: "id1",
|
|
63
58
|
background_color: {
|
|
@@ -73,7 +68,6 @@
|
|
|
73
68
|
},
|
|
74
69
|
horizontal_alignment: "center",
|
|
75
70
|
name: "Item 2",
|
|
76
|
-
components: [],
|
|
77
71
|
id: "2",
|
|
78
72
|
text_lid: "id2",
|
|
79
73
|
background_color: {
|
|
@@ -89,7 +83,6 @@
|
|
|
89
83
|
},
|
|
90
84
|
horizontal_alignment: "center",
|
|
91
85
|
name: "Item 3",
|
|
92
|
-
components: [],
|
|
93
86
|
id: "3",
|
|
94
87
|
text_lid: "id3",
|
|
95
88
|
background_color: {
|
|
@@ -97,7 +90,7 @@
|
|
|
97
90
|
light: { type: "alias", value: "transparent" },
|
|
98
91
|
},
|
|
99
92
|
},
|
|
100
|
-
];
|
|
93
|
+
] as unknown as TextNodeProps[];
|
|
101
94
|
</script>
|
|
102
95
|
|
|
103
96
|
<!-- Vertical Stack -->
|
|
@@ -321,7 +314,6 @@
|
|
|
321
314
|
components: [
|
|
322
315
|
{
|
|
323
316
|
type: "stack",
|
|
324
|
-
|
|
325
317
|
dimension: {
|
|
326
318
|
type: "zlayer",
|
|
327
319
|
alignment: "center",
|
|
@@ -336,7 +328,6 @@
|
|
|
336
328
|
},
|
|
337
329
|
{
|
|
338
330
|
type: "stack",
|
|
339
|
-
|
|
340
331
|
dimension: {
|
|
341
332
|
type: "zlayer",
|
|
342
333
|
alignment: "center",
|
|
@@ -378,7 +369,6 @@
|
|
|
378
369
|
},
|
|
379
370
|
{
|
|
380
371
|
type: "stack",
|
|
381
|
-
|
|
382
372
|
dimension: {
|
|
383
373
|
type: "zlayer",
|
|
384
374
|
alignment: "center",
|
|
@@ -420,7 +410,6 @@
|
|
|
420
410
|
},
|
|
421
411
|
{
|
|
422
412
|
type: "stack",
|
|
423
|
-
|
|
424
413
|
dimension: {
|
|
425
414
|
type: "zlayer",
|
|
426
415
|
alignment: "center",
|
|
@@ -462,7 +451,6 @@
|
|
|
462
451
|
},
|
|
463
452
|
{
|
|
464
453
|
type: "stack",
|
|
465
|
-
|
|
466
454
|
dimension: {
|
|
467
455
|
type: "zlayer",
|
|
468
456
|
alignment: "center",
|
|
@@ -504,7 +492,6 @@
|
|
|
504
492
|
},
|
|
505
493
|
{
|
|
506
494
|
type: "stack",
|
|
507
|
-
|
|
508
495
|
dimension: {
|
|
509
496
|
type: "zlayer",
|
|
510
497
|
alignment: "center",
|
|
@@ -546,7 +533,6 @@
|
|
|
546
533
|
},
|
|
547
534
|
{
|
|
548
535
|
type: "stack",
|
|
549
|
-
|
|
550
536
|
dimension: {
|
|
551
537
|
type: "zlayer",
|
|
552
538
|
alignment: "center",
|
|
@@ -588,7 +574,6 @@
|
|
|
588
574
|
},
|
|
589
575
|
{
|
|
590
576
|
type: "stack",
|
|
591
|
-
|
|
592
577
|
dimension: {
|
|
593
578
|
type: "zlayer",
|
|
594
579
|
alignment: "center",
|
|
@@ -630,7 +615,6 @@
|
|
|
630
615
|
},
|
|
631
616
|
{
|
|
632
617
|
type: "stack",
|
|
633
|
-
|
|
634
618
|
dimension: {
|
|
635
619
|
type: "zlayer",
|
|
636
620
|
alignment: "center",
|
|
@@ -670,7 +654,7 @@
|
|
|
670
654
|
},
|
|
671
655
|
},
|
|
672
656
|
},
|
|
673
|
-
],
|
|
657
|
+
] as unknown as StackProps[],
|
|
674
658
|
border: {
|
|
675
659
|
width: 2,
|
|
676
660
|
color: {
|
|
@@ -706,7 +690,6 @@
|
|
|
706
690
|
components: [
|
|
707
691
|
{
|
|
708
692
|
type: "stack",
|
|
709
|
-
|
|
710
693
|
dimension: {
|
|
711
694
|
type: "zlayer",
|
|
712
695
|
alignment: "center",
|
|
@@ -721,7 +704,6 @@
|
|
|
721
704
|
},
|
|
722
705
|
{
|
|
723
706
|
type: "stack",
|
|
724
|
-
|
|
725
707
|
dimension: {
|
|
726
708
|
type: "zlayer",
|
|
727
709
|
alignment: "center",
|
|
@@ -763,7 +745,6 @@
|
|
|
763
745
|
},
|
|
764
746
|
{
|
|
765
747
|
type: "stack",
|
|
766
|
-
|
|
767
748
|
dimension: {
|
|
768
749
|
type: "zlayer",
|
|
769
750
|
alignment: "center",
|
|
@@ -805,7 +786,6 @@
|
|
|
805
786
|
},
|
|
806
787
|
{
|
|
807
788
|
type: "stack",
|
|
808
|
-
|
|
809
789
|
dimension: {
|
|
810
790
|
type: "zlayer",
|
|
811
791
|
alignment: "center",
|
|
@@ -847,7 +827,6 @@
|
|
|
847
827
|
},
|
|
848
828
|
{
|
|
849
829
|
type: "stack",
|
|
850
|
-
|
|
851
830
|
dimension: {
|
|
852
831
|
type: "zlayer",
|
|
853
832
|
alignment: "center",
|
|
@@ -889,7 +868,6 @@
|
|
|
889
868
|
},
|
|
890
869
|
{
|
|
891
870
|
type: "stack",
|
|
892
|
-
|
|
893
871
|
dimension: {
|
|
894
872
|
type: "zlayer",
|
|
895
873
|
alignment: "center",
|
|
@@ -931,7 +909,6 @@
|
|
|
931
909
|
},
|
|
932
910
|
{
|
|
933
911
|
type: "stack",
|
|
934
|
-
|
|
935
912
|
dimension: {
|
|
936
913
|
type: "zlayer",
|
|
937
914
|
alignment: "center",
|
|
@@ -971,7 +948,7 @@
|
|
|
971
948
|
},
|
|
972
949
|
},
|
|
973
950
|
},
|
|
974
|
-
],
|
|
951
|
+
] as unknown as StackProps[],
|
|
975
952
|
border: {
|
|
976
953
|
width: 2,
|
|
977
954
|
color: {
|
|
@@ -1142,7 +1119,6 @@
|
|
|
1142
1119
|
components: [
|
|
1143
1120
|
{
|
|
1144
1121
|
type: "stack",
|
|
1145
|
-
|
|
1146
1122
|
dimension: {
|
|
1147
1123
|
type: "zlayer",
|
|
1148
1124
|
alignment: "center",
|
|
@@ -1157,13 +1133,11 @@
|
|
|
1157
1133
|
},
|
|
1158
1134
|
{
|
|
1159
1135
|
type: "stack",
|
|
1160
|
-
|
|
1161
1136
|
dimension: {
|
|
1162
1137
|
type: "zlayer",
|
|
1163
1138
|
alignment: "center",
|
|
1164
1139
|
},
|
|
1165
1140
|
components: [],
|
|
1166
|
-
|
|
1167
1141
|
border: {
|
|
1168
1142
|
width: 2,
|
|
1169
1143
|
color: {
|
|
@@ -1215,13 +1189,11 @@
|
|
|
1215
1189
|
},
|
|
1216
1190
|
{
|
|
1217
1191
|
type: "stack",
|
|
1218
|
-
|
|
1219
1192
|
dimension: {
|
|
1220
1193
|
type: "zlayer",
|
|
1221
1194
|
alignment: "center",
|
|
1222
1195
|
},
|
|
1223
1196
|
components: [],
|
|
1224
|
-
|
|
1225
1197
|
border: {
|
|
1226
1198
|
width: 2,
|
|
1227
1199
|
color: {
|
|
@@ -1273,13 +1245,11 @@
|
|
|
1273
1245
|
},
|
|
1274
1246
|
{
|
|
1275
1247
|
type: "stack",
|
|
1276
|
-
|
|
1277
1248
|
dimension: {
|
|
1278
1249
|
type: "zlayer",
|
|
1279
1250
|
alignment: "center",
|
|
1280
1251
|
},
|
|
1281
1252
|
components: [],
|
|
1282
|
-
|
|
1283
1253
|
border: {
|
|
1284
1254
|
width: 2,
|
|
1285
1255
|
color: {
|
|
@@ -1331,13 +1301,11 @@
|
|
|
1331
1301
|
},
|
|
1332
1302
|
{
|
|
1333
1303
|
type: "stack",
|
|
1334
|
-
|
|
1335
1304
|
dimension: {
|
|
1336
1305
|
type: "zlayer",
|
|
1337
1306
|
alignment: "center",
|
|
1338
1307
|
},
|
|
1339
1308
|
components: [],
|
|
1340
|
-
|
|
1341
1309
|
border: {
|
|
1342
1310
|
width: 2,
|
|
1343
1311
|
color: {
|
|
@@ -1387,7 +1355,7 @@
|
|
|
1387
1355
|
},
|
|
1388
1356
|
},
|
|
1389
1357
|
},
|
|
1390
|
-
],
|
|
1358
|
+
] as unknown as StackProps[],
|
|
1391
1359
|
border: {
|
|
1392
1360
|
width: 2,
|
|
1393
1361
|
color: {
|
|
@@ -13,15 +13,8 @@
|
|
|
13
13
|
import { getVariablesContext } from "../../stores/variables";
|
|
14
14
|
import { replaceVariables } from "../../utils/variable-utils";
|
|
15
15
|
|
|
16
|
-
const {
|
|
17
|
-
|
|
18
|
-
components,
|
|
19
|
-
labels,
|
|
20
|
-
purchaseState,
|
|
21
|
-
badge,
|
|
22
|
-
zStackChildStyles,
|
|
23
|
-
...restProps
|
|
24
|
-
}: StackProps = $props();
|
|
16
|
+
const { id, components, badge, zStackChildStyles, ...restProps }: StackProps =
|
|
17
|
+
$props();
|
|
25
18
|
|
|
26
19
|
const getColorMode = getColorModeContext();
|
|
27
20
|
const colorMode = $derived(getColorMode());
|
|
@@ -30,8 +23,6 @@
|
|
|
30
23
|
getStackComponentStyles(colorMode, {
|
|
31
24
|
id,
|
|
32
25
|
components,
|
|
33
|
-
labels,
|
|
34
|
-
purchaseState,
|
|
35
26
|
zStackChildStyles,
|
|
36
27
|
...restProps,
|
|
37
28
|
}),
|
|
@@ -40,8 +31,6 @@
|
|
|
40
31
|
getBadgeStyles(colorMode, {
|
|
41
32
|
id,
|
|
42
33
|
components,
|
|
43
|
-
labels,
|
|
44
|
-
purchaseState,
|
|
45
34
|
badge,
|
|
46
35
|
...restProps,
|
|
47
36
|
}),
|
|
@@ -51,8 +40,6 @@
|
|
|
51
40
|
getZStackChildStyles({
|
|
52
41
|
id,
|
|
53
42
|
components,
|
|
54
|
-
labels,
|
|
55
|
-
purchaseState,
|
|
56
43
|
...restProps,
|
|
57
44
|
}),
|
|
58
45
|
);
|
|
@@ -67,8 +54,6 @@
|
|
|
67
54
|
getStackBadgeTextStyles(colorMode, {
|
|
68
55
|
id,
|
|
69
56
|
components,
|
|
70
|
-
labels,
|
|
71
|
-
purchaseState,
|
|
72
57
|
badge,
|
|
73
58
|
...restProps,
|
|
74
59
|
}),
|
|
@@ -88,16 +73,11 @@
|
|
|
88
73
|
{#if zStackChildrenStyles}
|
|
89
74
|
<Node
|
|
90
75
|
nodeData={component}
|
|
91
|
-
{purchaseState}
|
|
92
76
|
componentState={restProps.componentState}
|
|
93
77
|
zStackChildStyles={index > 0 ? zStackChildrenStyles : undefined}
|
|
94
78
|
/>
|
|
95
79
|
{:else}
|
|
96
|
-
<Node
|
|
97
|
-
nodeData={component}
|
|
98
|
-
{purchaseState}
|
|
99
|
-
componentState={restProps.componentState}
|
|
100
|
-
/>
|
|
80
|
+
<Node nodeData={component} componentState={restProps.componentState} />
|
|
101
81
|
{/if}
|
|
102
82
|
{/each}
|
|
103
83
|
</div>
|
|
@@ -217,9 +217,7 @@ export function getStackBadgeTextStyles(colorMode, props) {
|
|
|
217
217
|
return { tagToRender: "", textStyles: "" };
|
|
218
218
|
const { tagToRender, textStyles } = getTextComponentStyles(colorMode, {
|
|
219
219
|
id: props.id,
|
|
220
|
-
purchaseState: props.purchaseState,
|
|
221
220
|
...badge,
|
|
222
|
-
components: [],
|
|
223
221
|
type: "text",
|
|
224
222
|
size: {
|
|
225
223
|
width: { type: "fit" },
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
width: { type: "fill" },
|
|
41
41
|
height: { type: "fill" },
|
|
42
42
|
},
|
|
43
|
-
purchaseState: {},
|
|
44
43
|
},
|
|
45
44
|
argTypes: {
|
|
46
45
|
name: getTextControlStoryMeta("Content of the text to render"),
|
|
@@ -54,11 +53,6 @@
|
|
|
54
53
|
horizontal_alignment: horizontalAlignmentStoryMeta,
|
|
55
54
|
padding: getSpacingStoryMeta("Padding values in pixels"),
|
|
56
55
|
margin: getSpacingStoryMeta("Margin values in pixels"),
|
|
57
|
-
variableDictionary: {
|
|
58
|
-
description: "Dictionary containing the values for the variables",
|
|
59
|
-
control: { type: "object" },
|
|
60
|
-
defaultValue: {},
|
|
61
|
-
},
|
|
62
56
|
},
|
|
63
57
|
parameters: {
|
|
64
58
|
localizations: {
|
|
@@ -85,7 +79,6 @@
|
|
|
85
79
|
name="Font Weight"
|
|
86
80
|
args={{
|
|
87
81
|
font_weight: "bold",
|
|
88
|
-
text_style: "normal",
|
|
89
82
|
horizontal_alignment: "leading",
|
|
90
83
|
name: "hello world!",
|
|
91
84
|
}}
|
|
@@ -96,7 +89,6 @@
|
|
|
96
89
|
name="Text Alignment"
|
|
97
90
|
args={{
|
|
98
91
|
font_weight: "regular",
|
|
99
|
-
text_style: "normal",
|
|
100
92
|
horizontal_alignment: "center",
|
|
101
93
|
name: "hello world!",
|
|
102
94
|
}}
|
|
@@ -107,7 +99,6 @@
|
|
|
107
99
|
name="Color"
|
|
108
100
|
args={{
|
|
109
101
|
font_weight: "regular",
|
|
110
|
-
text_style: "normal",
|
|
111
102
|
horizontal_alignment: "leading",
|
|
112
103
|
color: {
|
|
113
104
|
dark: { type: "hex", value: "#3471eb" },
|
|
@@ -126,7 +117,6 @@
|
|
|
126
117
|
name="With Spacing"
|
|
127
118
|
args={{
|
|
128
119
|
font_weight: "regular",
|
|
129
|
-
text_style: "normal",
|
|
130
120
|
horizontal_alignment: "leading",
|
|
131
121
|
padding: { top: 16, trailing: 24, bottom: 16, leading: 24 },
|
|
132
122
|
margin: { top: 8, trailing: 0, bottom: 8, leading: 0 },
|
|
@@ -139,7 +129,6 @@
|
|
|
139
129
|
name="With variable dictionary"
|
|
140
130
|
args={{
|
|
141
131
|
font_weight: "regular",
|
|
142
|
-
text_style: "normal",
|
|
143
132
|
horizontal_alignment: "leading",
|
|
144
133
|
padding: { top: 16, trailing: 24, bottom: 16, leading: 24 },
|
|
145
134
|
margin: { top: 8, trailing: 0, bottom: 8, leading: 0 },
|
|
@@ -161,7 +150,6 @@
|
|
|
161
150
|
name="With missing variable in dictionary"
|
|
162
151
|
args={{
|
|
163
152
|
font_weight: "regular",
|
|
164
|
-
text_style: "normal",
|
|
165
153
|
horizontal_alignment: "leading",
|
|
166
154
|
padding: { top: 16, trailing: 24, bottom: 16, leading: 24 },
|
|
167
155
|
margin: { top: 8, trailing: 0, bottom: 8, leading: 0 },
|
|
@@ -11,15 +11,8 @@
|
|
|
11
11
|
import { getVariablesContext } from "../../stores/variables";
|
|
12
12
|
import { replaceVariables } from "../../utils/variable-utils";
|
|
13
13
|
|
|
14
|
-
const {
|
|
15
|
-
|
|
16
|
-
labels,
|
|
17
|
-
text_lid,
|
|
18
|
-
purchaseState,
|
|
19
|
-
background_color,
|
|
20
|
-
size,
|
|
21
|
-
...restProps
|
|
22
|
-
}: TextNodeProps = $props();
|
|
14
|
+
const { id, text_lid, background_color, size, ...restProps }: TextNodeProps =
|
|
15
|
+
$props();
|
|
23
16
|
|
|
24
17
|
const getColorMode = getColorModeContext();
|
|
25
18
|
const colorMode = $derived(getColorMode());
|
|
@@ -27,9 +20,7 @@
|
|
|
27
20
|
const { tagToRender, textStyles } = $derived(
|
|
28
21
|
getTextNodeStyles(colorMode, {
|
|
29
22
|
id,
|
|
30
|
-
labels,
|
|
31
23
|
text_lid,
|
|
32
|
-
purchaseState,
|
|
33
24
|
background_color,
|
|
34
25
|
size,
|
|
35
26
|
...restProps,
|
|
@@ -12,7 +12,7 @@ export declare const getTextComponentStyles: (colorMode: ColorMode, props: TextN
|
|
|
12
12
|
textStyles: Record<string, string | number>;
|
|
13
13
|
tagToRender: import("../../utils/style-utils").TextComponentTags;
|
|
14
14
|
};
|
|
15
|
-
export declare function getTextWrapperStyles(restProps: Partial<TextNodeProps>, size: SizeType, background_color?: ColorGradientScheme): string;
|
|
15
|
+
export declare function getTextWrapperStyles(restProps: Partial<TextNodeProps>, size: SizeType, background_color?: ColorGradientScheme | null): string;
|
|
16
16
|
export declare function getTextNodeStyles(colorMode: ColorMode, props: TextNodeProps): {
|
|
17
17
|
tagToRender: import("../../utils/style-utils").TextComponentTags;
|
|
18
18
|
textStyles: string;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import { Timeline } from "../..";
|
|
3
3
|
import { defaultColor } from "../text/text-utils";
|
|
4
|
-
import type { PurchaseState } from "../../data/state";
|
|
5
4
|
import { localizationDecorator } from "../../stories/localization-decorator";
|
|
6
5
|
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
7
6
|
|
|
8
7
|
const defaultLocale = "en_US";
|
|
9
8
|
|
|
10
|
-
const purchaseState: PurchaseState = {};
|
|
11
|
-
|
|
12
9
|
const { Story } = defineMeta({
|
|
13
10
|
title: "Components/Timeline",
|
|
14
11
|
component: Timeline,
|
|
@@ -42,7 +39,6 @@
|
|
|
42
39
|
},
|
|
43
40
|
}),
|
|
44
41
|
],
|
|
45
|
-
args: { purchaseState },
|
|
46
42
|
argTypes: {},
|
|
47
43
|
});
|
|
48
44
|
</script>
|
|
@@ -423,7 +419,6 @@
|
|
|
423
419
|
color: "#d3d3d3",
|
|
424
420
|
percent: 0,
|
|
425
421
|
},
|
|
426
|
-
|
|
427
422
|
{
|
|
428
423
|
color: "#d3d3d300",
|
|
429
424
|
percent: 100,
|
|
@@ -13,11 +13,9 @@
|
|
|
13
13
|
{#each items as item, index}
|
|
14
14
|
<TimelineItem
|
|
15
15
|
{...item}
|
|
16
|
-
labels={restProps.labels}
|
|
17
16
|
id={`${restProps.id}-${index}`}
|
|
18
17
|
name={`${restProps.name}-${index}`}
|
|
19
18
|
type="timeline"
|
|
20
|
-
purchaseState={restProps.purchaseState}
|
|
21
19
|
text_spacing={restProps.text_spacing}
|
|
22
20
|
item_spacing={restProps.item_spacing}
|
|
23
21
|
/>
|
|
@@ -102,7 +102,6 @@ export function getTimelineItemTextStyles(colorMode, props, kind = "title") {
|
|
|
102
102
|
};
|
|
103
103
|
const { tagToRender, textStyles } = getTextComponentStyles(colorMode, {
|
|
104
104
|
...props,
|
|
105
|
-
components: [],
|
|
106
105
|
...textProps,
|
|
107
106
|
size: { width: { type: "fit" }, height: { type: "fit" } },
|
|
108
107
|
type: "text",
|
package/dist/data/entities.d.ts
CHANGED
|
@@ -1,35 +1,17 @@
|
|
|
1
1
|
import type { ZStackChildStyles } from "../components/stack/stack-utils";
|
|
2
|
-
import type { PurchaseState } from "./state";
|
|
3
2
|
import type { AlignmentType, BorderType, CircleShape, CornerRadiusType, FontSizeTags, FontWeights, RectangleShape, ShadowType, ShapeType, SizeType, Spacing, TextAlignments } from "../types";
|
|
4
3
|
import type { Dimension } from "../types/alignment";
|
|
5
4
|
import type { Background } from "../types/background";
|
|
6
5
|
import type { ColorGradientScheme, ColorScheme } from "../types/colors";
|
|
6
|
+
import type { Component } from "../types/component";
|
|
7
|
+
import type { FooterProps } from "../types/components/footer";
|
|
7
8
|
import type { Localizations } from "../types/localization";
|
|
8
9
|
import type { ImageInfo, ImageObjectFit } from "../types/media";
|
|
9
|
-
export interface
|
|
10
|
-
[key: string]: unknown;
|
|
11
|
-
}
|
|
12
|
-
export type ComponentTypes = "stack" | "text" | "image" | "button" | "purchase_button" | "footer" | "package" | "timeline";
|
|
13
|
-
export interface PaywallComponent extends Extra {
|
|
14
|
-
type: ComponentTypes;
|
|
15
|
-
id: string;
|
|
16
|
-
name: string;
|
|
17
|
-
fallback?: PaywallComponent;
|
|
18
|
-
}
|
|
19
|
-
export interface Stack extends PaywallComponent {
|
|
20
|
-
spacing: number;
|
|
21
|
-
components: PaywallComponent[];
|
|
22
|
-
}
|
|
23
|
-
export type RootPaywall = {
|
|
10
|
+
export interface RootPaywall {
|
|
24
11
|
background?: Background;
|
|
25
|
-
stack:
|
|
26
|
-
sticky_footer?:
|
|
27
|
-
|
|
28
|
-
id: string;
|
|
29
|
-
name: string;
|
|
30
|
-
type: "footer";
|
|
31
|
-
};
|
|
32
|
-
};
|
|
12
|
+
stack: StackProps;
|
|
13
|
+
sticky_footer?: FooterProps | null;
|
|
14
|
+
}
|
|
33
15
|
export interface ComponentConfig {
|
|
34
16
|
colors?: Record<string, string>;
|
|
35
17
|
fonts?: {
|
|
@@ -43,29 +25,18 @@ export interface ComponentConfig {
|
|
|
43
25
|
base: RootPaywall;
|
|
44
26
|
}
|
|
45
27
|
export interface PaywallData {
|
|
46
|
-
template_name: string;
|
|
47
|
-
offering_id: string;
|
|
48
|
-
created_at: string;
|
|
49
|
-
updated_at: string;
|
|
50
|
-
published_at?: string | null;
|
|
51
|
-
asset_base_url: string;
|
|
52
28
|
default_locale: string;
|
|
53
|
-
revision: number;
|
|
54
29
|
components_config: ComponentConfig;
|
|
55
30
|
components_localizations: Localizations;
|
|
56
|
-
published_revision?: number | null;
|
|
57
|
-
published_components_config?: ComponentConfig | null;
|
|
58
|
-
published_components_localizations?: Localizations | null;
|
|
59
|
-
}
|
|
60
|
-
export interface PurchaseStateProps {
|
|
61
|
-
purchaseState: PurchaseState;
|
|
62
31
|
}
|
|
63
32
|
export type ComponentState = {
|
|
64
33
|
[state: string]: boolean;
|
|
65
34
|
};
|
|
66
|
-
export interface
|
|
35
|
+
export interface BaseComponent {
|
|
36
|
+
type: string;
|
|
67
37
|
id: string;
|
|
68
38
|
name: string;
|
|
39
|
+
fallback?: Component;
|
|
69
40
|
componentState?: ComponentState;
|
|
70
41
|
zStackChildStyles?: ZStackChildStyles;
|
|
71
42
|
}
|
|
@@ -74,10 +45,10 @@ export type OverrideProps<T> = {
|
|
|
74
45
|
[state: string]: T;
|
|
75
46
|
};
|
|
76
47
|
};
|
|
77
|
-
export interface StackProps extends
|
|
48
|
+
export interface StackProps extends BaseComponent {
|
|
78
49
|
type: "stack";
|
|
79
50
|
visible?: boolean | null;
|
|
80
|
-
components:
|
|
51
|
+
components: Component[];
|
|
81
52
|
size: SizeType;
|
|
82
53
|
dimension: Dimension;
|
|
83
54
|
spacing: number;
|
|
@@ -90,7 +61,7 @@ export interface StackProps extends SharedComponentProps {
|
|
|
90
61
|
shadow: ShadowType | null;
|
|
91
62
|
badge?: null | {
|
|
92
63
|
stack: {
|
|
93
|
-
components:
|
|
64
|
+
components: Component[];
|
|
94
65
|
type: "stack";
|
|
95
66
|
};
|
|
96
67
|
style: "overlay" | "edge_to_edge" | "nested";
|
|
@@ -110,11 +81,10 @@ export interface StackProps extends SharedComponentProps {
|
|
|
110
81
|
};
|
|
111
82
|
overrides?: OverrideProps<StackProps>;
|
|
112
83
|
}
|
|
113
|
-
export interface TextNodeProps extends
|
|
114
|
-
background_color?: ColorGradientScheme;
|
|
84
|
+
export interface TextNodeProps extends BaseComponent {
|
|
85
|
+
background_color?: ColorGradientScheme | null;
|
|
115
86
|
color: ColorScheme;
|
|
116
|
-
|
|
117
|
-
font_name?: string;
|
|
87
|
+
font_name?: string | null;
|
|
118
88
|
font_size: keyof typeof FontSizeTags;
|
|
119
89
|
font_weight: keyof typeof FontWeights;
|
|
120
90
|
horizontal_alignment: keyof typeof TextAlignments;
|
|
@@ -129,7 +99,7 @@ export interface ImageMaskShapeType {
|
|
|
129
99
|
type: "circle" | "rectangle" | "concave" | "convex";
|
|
130
100
|
corners?: CornerRadiusType;
|
|
131
101
|
}
|
|
132
|
-
export interface ImageProps extends
|
|
102
|
+
export interface ImageProps extends BaseComponent {
|
|
133
103
|
type: "image";
|
|
134
104
|
fit_mode: ImageObjectFit;
|
|
135
105
|
size: SizeType;
|
|
@@ -177,7 +147,7 @@ export type ItemProps = {
|
|
|
177
147
|
color: ColorGradientScheme;
|
|
178
148
|
};
|
|
179
149
|
};
|
|
180
|
-
export interface TimelineProps extends
|
|
150
|
+
export interface TimelineProps extends BaseComponent {
|
|
181
151
|
type: "timeline";
|
|
182
152
|
item_spacing: number;
|
|
183
153
|
text_spacing: number;
|
|
@@ -186,7 +156,7 @@ export interface TimelineProps extends SharedComponentProps {
|
|
|
186
156
|
margin: Spacing;
|
|
187
157
|
items: ItemProps[];
|
|
188
158
|
}
|
|
189
|
-
export interface TimelineItemProps extends ItemProps,
|
|
159
|
+
export interface TimelineItemProps extends ItemProps, BaseComponent {
|
|
190
160
|
text_spacing: number;
|
|
191
161
|
item_spacing: number;
|
|
192
162
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export * from "./ui/globals";
|
|
3
|
-
export { type PaywallData as PaywallData } from "./data/entities";
|
|
4
|
-
export { type VariableDictionary } from "./utils/variable-utils";
|
|
5
|
-
export { default as Paywall } from "./components/paywall/Paywall.svelte";
|
|
6
|
-
export { default as Stack } from "./components/stack/Stack.svelte";
|
|
7
1
|
export { default as ButtonDeprecated } from "./components/button/Button.svelte";
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as Text } from "./components/text/Text.svelte";
|
|
2
|
+
export { default as Footer } from "./components/footer/Footer.svelte";
|
|
10
3
|
export { default as Image } from "./components/image/Image.svelte";
|
|
11
|
-
export { default as PurchaseButton } from "./components/purchase-button/PurchaseButton.svelte";
|
|
12
4
|
export { default as Package } from "./components/package/Package.svelte";
|
|
13
|
-
export { default as
|
|
5
|
+
export { default as Paywall } from "./components/paywall/Paywall.svelte";
|
|
6
|
+
export { default as PurchaseButton } from "./components/purchase-button/PurchaseButton.svelte";
|
|
7
|
+
export { default as Stack } from "./components/stack/Stack.svelte";
|
|
8
|
+
export { default as Text } from "./components/text/Text.svelte";
|
|
14
9
|
export { default as Timeline } from "./components/timeline/Timeline.svelte";
|
|
10
|
+
export { type PaywallData as PaywallData } from "./data/entities";
|
|
11
|
+
export * from "./types";
|
|
12
|
+
export * from "./ui/globals";
|
|
13
|
+
export { default as Button } from "./ui/molecules/button.svelte";
|
|
14
|
+
export { type VariableDictionary } from "./utils/variable-utils";
|