@revenuecat/purchases-ui-js 2.0.2 → 2.0.3
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 +66 -102
- package/dist/components/button/ButtonNode.svelte +2 -27
- package/dist/components/footer/Footer.stories.svelte +112 -102
- package/dist/components/footer/Footer.svelte +8 -4
- package/dist/components/icon/Icon.stories.svelte +100 -0
- package/dist/components/icon/Icon.stories.svelte.d.ts +19 -0
- package/dist/components/icon/Icon.svelte +73 -0
- package/dist/components/icon/Icon.svelte.d.ts +4 -0
- package/dist/components/image/ClipPath.svelte +49 -0
- package/dist/components/image/ClipPath.svelte.d.ts +9 -0
- package/dist/components/image/Image.stories.svelte +83 -188
- package/dist/components/image/Image.svelte +152 -136
- package/dist/components/image/Image.svelte.d.ts +1 -1
- package/dist/components/image/Overlay.svelte +36 -0
- package/dist/components/image/Overlay.svelte.d.ts +8 -0
- package/dist/components/package/Package.stories.svelte +10 -21
- package/dist/components/package/Package.svelte +8 -35
- package/dist/components/paywall/Node.svelte +27 -28
- package/dist/components/paywall/Node.svelte.d.ts +3 -6
- package/dist/components/paywall/Paywall.stories.svelte +36 -140
- package/dist/components/paywall/Paywall.svelte +22 -6
- package/dist/components/paywall/Paywall.svelte.d.ts +3 -2
- package/dist/components/paywall/fixtures/override-paywall.d.ts +2 -0
- package/dist/components/paywall/fixtures/override-paywall.js +1310 -0
- package/dist/components/paywall/fixtures/stack-paywall.d.ts +2 -0
- package/dist/components/paywall/fixtures/stack-paywall.js +5223 -0
- package/dist/components/paywall/fixtures/variables.d.ts +261 -0
- package/dist/components/paywall/fixtures/variables.js +262 -0
- package/dist/components/purchase-button/PurchaseButton.stories.svelte +10 -21
- package/dist/components/purchase-button/PurchaseButton.svelte +2 -27
- package/dist/components/stack/Stack.stories.svelte +2354 -978
- package/dist/components/stack/Stack.svelte +111 -134
- package/dist/components/stack/Stack.svelte.d.ts +6 -2
- package/dist/components/stack/stack-utils.d.ts +10 -30
- package/dist/components/stack/stack-utils.js +77 -255
- package/dist/components/text/Text.svelte +3 -37
- package/dist/components/text/Text.svelte.d.ts +1 -2
- package/dist/components/text/TextNode.stories.svelte +10 -36
- package/dist/components/text/TextNode.svelte +25 -28
- package/dist/components/text/TextNode.svelte.d.ts +1 -1
- package/dist/components/text/text-utils.d.ts +4 -9
- package/dist/components/text/text-utils.js +32 -117
- package/dist/components/timeline/Timeline.stories.svelte +640 -251
- package/dist/components/timeline/Timeline.svelte +42 -28
- package/dist/components/timeline/Timeline.svelte.d.ts +1 -1
- package/dist/components/timeline/TimelineItem.svelte +80 -112
- package/dist/components/timeline/TimelineItem.svelte.d.ts +6 -2
- package/dist/components/timeline/timeline-utils.d.ts +24 -6
- package/dist/components/timeline/timeline-utils.js +21 -113
- package/dist/data/entities.d.ts +19 -135
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/stores/color-mode.d.ts +1 -1
- package/dist/stores/paywall.d.ts +5 -2
- package/dist/stores/selected.d.ts +5 -0
- package/dist/stores/selected.js +12 -0
- package/dist/stores/variables.d.ts +1 -1
- package/dist/stores/variables.js +0 -1
- package/dist/stories/component-decorator.d.ts +2 -0
- package/dist/stories/component-decorator.js +12 -0
- package/dist/stories/fixtures.d.ts +5 -3
- package/dist/stories/fixtures.js +5214 -4422
- package/dist/stories/paywall-decorator.js +6 -0
- package/dist/stories/variables-decorator.d.ts +1 -1
- package/dist/stories/viewport-decorator.d.ts +2 -0
- package/dist/stories/viewport-decorator.js +8 -0
- package/dist/stories/viewport-wrapper.svelte +53 -0
- package/dist/stories/viewport-wrapper.svelte.d.ts +10 -0
- package/dist/stories/with-layout.d.ts +2 -10
- package/dist/stories/with-layout.js +3 -5
- package/dist/types/alignment.d.ts +5 -3
- package/dist/types/background.d.ts +6 -5
- package/dist/types/base.d.ts +7 -0
- package/dist/types/base.js +1 -0
- package/dist/types/colors.d.ts +4 -4
- package/dist/types/component.d.ts +6 -2
- package/dist/types/components/button.d.ts +4 -1
- package/dist/types/components/footer.d.ts +2 -1
- package/dist/types/components/icon.d.ts +28 -0
- package/dist/types/components/icon.js +1 -0
- package/dist/types/components/image.d.ts +20 -0
- package/dist/types/components/image.js +1 -0
- package/dist/types/components/package.d.ts +2 -1
- package/dist/types/components/purchase-button.d.ts +2 -1
- package/dist/types/components/stack.d.ts +32 -0
- package/dist/types/components/stack.js +1 -0
- package/dist/types/components/text.d.ts +20 -0
- package/dist/types/components/text.js +1 -0
- package/dist/types/components/timeline.d.ts +35 -0
- package/dist/types/components/timeline.js +1 -0
- package/dist/types/localization.d.ts +2 -1
- package/dist/types/media.d.ts +4 -3
- package/dist/types/overrides.d.ts +48 -0
- package/dist/types/overrides.js +1 -0
- package/dist/types/variables.d.ts +13 -0
- package/dist/types/variables.js +10 -0
- package/dist/types.d.ts +17 -9
- package/dist/ui/atoms/typography.stories.svelte +1 -27
- package/dist/ui/molecules/button.stories.svelte +3 -8
- package/dist/ui/theme/colors.d.ts +0 -6
- package/dist/ui/theme/colors.js +1 -1
- package/dist/ui/theme/text.d.ts +3 -4
- package/dist/ui/theme/utils.d.ts +0 -10
- package/dist/ui/theme/utils.js +5 -5
- package/dist/utils/background-utils.d.ts +4 -0
- package/dist/utils/background-utils.js +39 -0
- package/dist/utils/base-utils.d.ts +18 -0
- package/dist/utils/base-utils.js +124 -0
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +6 -1
- package/dist/utils/font-utils.d.ts +4 -0
- package/dist/utils/font-utils.js +47 -0
- package/dist/utils/style-utils.d.ts +7 -120
- package/dist/utils/style-utils.js +22 -302
- package/dist/utils/variable-utils.d.ts +1 -22
- package/dist/utils/variable-utils.js +28 -24
- package/dist/web-components/index.css +1 -1
- package/dist/web-components/index.js +1323 -895
- package/package.json +34 -24
- package/dist/components/button/button-utils.d.ts +0 -2
- package/dist/components/button/button-utils.js +0 -19
- package/dist/components/image/image-utils.d.ts +0 -19
- package/dist/components/image/image-utils.js +0 -33
- package/dist/components/purchase-button/purchase-button-utils.d.ts +0 -2
- package/dist/components/purchase-button/purchase-button-utils.js +0 -20
- package/dist/stories/meta-templates.d.ts +0 -12
- package/dist/stories/meta-templates.js +0 -155
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
export declare const VARIABLES: Readonly<{
|
|
2
|
+
readonly $rc_weekly: {
|
|
3
|
+
readonly "product.price": "$2.99";
|
|
4
|
+
readonly "product.price_per_period": "$2.99/week";
|
|
5
|
+
readonly "product.price_per_period_abbreviated": "$2.99/wk";
|
|
6
|
+
readonly "product.price_per_day": "$0.43";
|
|
7
|
+
readonly "product.price_per_week": "$2.99";
|
|
8
|
+
readonly "product.price_per_month": "$11.96";
|
|
9
|
+
readonly "product.price_per_year": "$155.48";
|
|
10
|
+
readonly "product.period": "week";
|
|
11
|
+
readonly "product.period_abbreviated": "wk";
|
|
12
|
+
readonly "product.periodly": "weekly";
|
|
13
|
+
readonly "product.period_in_days": "7";
|
|
14
|
+
readonly "product.period_in_weeks": "1";
|
|
15
|
+
readonly "product.period_in_months": "0";
|
|
16
|
+
readonly "product.period_in_years": "0";
|
|
17
|
+
readonly "product.period_with_unit": "1 week";
|
|
18
|
+
readonly "product.currency_code": "USD";
|
|
19
|
+
readonly "product.currency_symbol": "$";
|
|
20
|
+
readonly "product.offer_price": "$1.99";
|
|
21
|
+
readonly "product.offer_price_per_day": "$0.07";
|
|
22
|
+
readonly "product.offer_price_per_week": "$0.50";
|
|
23
|
+
readonly "product.offer_price_per_month": "$1.99";
|
|
24
|
+
readonly "product.offer_price_per_year": "$23.88";
|
|
25
|
+
readonly "product.offer_period": "week";
|
|
26
|
+
readonly "product.offer_period_abbreviated": "wk";
|
|
27
|
+
readonly "product.offer_period_in_days": "7";
|
|
28
|
+
readonly "product.offer_period_in_weeks": "1";
|
|
29
|
+
readonly "product.offer_period_in_months": "0";
|
|
30
|
+
readonly "product.offer_period_in_years": "0";
|
|
31
|
+
readonly "product.offer_period_with_unit": "1 week";
|
|
32
|
+
readonly "product.offer_end_date": "December 31, 2024";
|
|
33
|
+
readonly "product.secondary_offer_price": "$2.99";
|
|
34
|
+
readonly "product.secondary_offer_period": "week";
|
|
35
|
+
readonly "product.secondary_offer_period_abbreviated": "wk";
|
|
36
|
+
readonly "product.relative_discount": "19%";
|
|
37
|
+
readonly "product.store_product_name": "Pro Access";
|
|
38
|
+
};
|
|
39
|
+
readonly $rc_monthly: {
|
|
40
|
+
readonly "product.price": "$9.99";
|
|
41
|
+
readonly "product.price_per_period": "$9.99/month";
|
|
42
|
+
readonly "product.price_per_period_abbreviated": "$9.99/mo";
|
|
43
|
+
readonly "product.price_per_day": "$0.33";
|
|
44
|
+
readonly "product.price_per_week": "$2.50";
|
|
45
|
+
readonly "product.price_per_month": "$9.99";
|
|
46
|
+
readonly "product.price_per_year": "$119.88";
|
|
47
|
+
readonly "product.period": "month";
|
|
48
|
+
readonly "product.period_abbreviated": "mo";
|
|
49
|
+
readonly "product.periodly": "monthly";
|
|
50
|
+
readonly "product.period_in_days": "30";
|
|
51
|
+
readonly "product.period_in_weeks": "4";
|
|
52
|
+
readonly "product.period_in_months": "1";
|
|
53
|
+
readonly "product.period_in_years": "0";
|
|
54
|
+
readonly "product.period_with_unit": "1 month";
|
|
55
|
+
readonly "product.currency_code": "USD";
|
|
56
|
+
readonly "product.currency_symbol": "$";
|
|
57
|
+
readonly "product.offer_price": "$1.99";
|
|
58
|
+
readonly "product.offer_price_per_day": "$0.07";
|
|
59
|
+
readonly "product.offer_price_per_week": "$0.50";
|
|
60
|
+
readonly "product.offer_price_per_month": "$1.99";
|
|
61
|
+
readonly "product.offer_price_per_year": "$23.88";
|
|
62
|
+
readonly "product.offer_period": "week";
|
|
63
|
+
readonly "product.offer_period_abbreviated": "wk";
|
|
64
|
+
readonly "product.offer_period_in_days": "7";
|
|
65
|
+
readonly "product.offer_period_in_weeks": "1";
|
|
66
|
+
readonly "product.offer_period_in_months": "0";
|
|
67
|
+
readonly "product.offer_period_in_years": "0";
|
|
68
|
+
readonly "product.offer_period_with_unit": "1 week";
|
|
69
|
+
readonly "product.offer_end_date": "December 31, 2024";
|
|
70
|
+
readonly "product.secondary_offer_price": "$2.99";
|
|
71
|
+
readonly "product.secondary_offer_period": "week";
|
|
72
|
+
readonly "product.secondary_offer_period_abbreviated": "wk";
|
|
73
|
+
readonly "product.relative_discount": "19%";
|
|
74
|
+
readonly "product.store_product_name": "Pro Access";
|
|
75
|
+
};
|
|
76
|
+
readonly $rc_two_month: {
|
|
77
|
+
readonly "product.price": "$17.99";
|
|
78
|
+
readonly "product.price_per_period": "$17.99/2 months";
|
|
79
|
+
readonly "product.price_per_period_abbreviated": "$17.99/2mo";
|
|
80
|
+
readonly "product.price_per_day": "$0.30";
|
|
81
|
+
readonly "product.price_per_week": "$2.25";
|
|
82
|
+
readonly "product.price_per_month": "$9.00";
|
|
83
|
+
readonly "product.price_per_year": "$107.94";
|
|
84
|
+
readonly "product.period": "2 months";
|
|
85
|
+
readonly "product.period_abbreviated": "2mo";
|
|
86
|
+
readonly "product.periodly": "2 months";
|
|
87
|
+
readonly "product.period_in_days": "60";
|
|
88
|
+
readonly "product.period_in_weeks": "8";
|
|
89
|
+
readonly "product.period_in_months": "2";
|
|
90
|
+
readonly "product.period_in_years": "0";
|
|
91
|
+
readonly "product.period_with_unit": "2 months";
|
|
92
|
+
readonly "product.currency_code": "USD";
|
|
93
|
+
readonly "product.currency_symbol": "$";
|
|
94
|
+
readonly "product.offer_price": "$1.99";
|
|
95
|
+
readonly "product.offer_price_per_day": "$0.07";
|
|
96
|
+
readonly "product.offer_price_per_week": "$0.50";
|
|
97
|
+
readonly "product.offer_price_per_month": "$1.99";
|
|
98
|
+
readonly "product.offer_price_per_year": "$23.88";
|
|
99
|
+
readonly "product.offer_period": "week";
|
|
100
|
+
readonly "product.offer_period_abbreviated": "wk";
|
|
101
|
+
readonly "product.offer_period_in_days": "7";
|
|
102
|
+
readonly "product.offer_period_in_weeks": "1";
|
|
103
|
+
readonly "product.offer_period_in_months": "0";
|
|
104
|
+
readonly "product.offer_period_in_years": "0";
|
|
105
|
+
readonly "product.offer_period_with_unit": "1 week";
|
|
106
|
+
readonly "product.offer_end_date": "December 31, 2024";
|
|
107
|
+
readonly "product.secondary_offer_price": "$2.99";
|
|
108
|
+
readonly "product.secondary_offer_period": "week";
|
|
109
|
+
readonly "product.secondary_offer_period_abbreviated": "wk";
|
|
110
|
+
readonly "product.relative_discount": "19%";
|
|
111
|
+
readonly "product.store_product_name": "Pro Access";
|
|
112
|
+
};
|
|
113
|
+
readonly $rc_three_month: {
|
|
114
|
+
readonly "product.price": "$24.99";
|
|
115
|
+
readonly "product.price_per_period": "$24.99/3 months";
|
|
116
|
+
readonly "product.price_per_period_abbreviated": "$24.99/3mo";
|
|
117
|
+
readonly "product.price_per_day": "$0.28";
|
|
118
|
+
readonly "product.price_per_week": "$1.92";
|
|
119
|
+
readonly "product.price_per_month": "$8.33";
|
|
120
|
+
readonly "product.price_per_year": "$99.96";
|
|
121
|
+
readonly "product.period": "3 months";
|
|
122
|
+
readonly "product.period_abbreviated": "3mo";
|
|
123
|
+
readonly "product.periodly": "3 months";
|
|
124
|
+
readonly "product.period_in_days": "90";
|
|
125
|
+
readonly "product.period_in_weeks": "13";
|
|
126
|
+
readonly "product.period_in_months": "3";
|
|
127
|
+
readonly "product.period_in_years": "0";
|
|
128
|
+
readonly "product.period_with_unit": "3 months";
|
|
129
|
+
readonly "product.currency_code": "USD";
|
|
130
|
+
readonly "product.currency_symbol": "$";
|
|
131
|
+
readonly "product.offer_price": "$1.99";
|
|
132
|
+
readonly "product.offer_price_per_day": "$0.07";
|
|
133
|
+
readonly "product.offer_price_per_week": "$0.50";
|
|
134
|
+
readonly "product.offer_price_per_month": "$1.99";
|
|
135
|
+
readonly "product.offer_price_per_year": "$23.88";
|
|
136
|
+
readonly "product.offer_period": "week";
|
|
137
|
+
readonly "product.offer_period_abbreviated": "wk";
|
|
138
|
+
readonly "product.offer_period_in_days": "7";
|
|
139
|
+
readonly "product.offer_period_in_weeks": "1";
|
|
140
|
+
readonly "product.offer_period_in_months": "0";
|
|
141
|
+
readonly "product.offer_period_in_years": "0";
|
|
142
|
+
readonly "product.offer_period_with_unit": "1 week";
|
|
143
|
+
readonly "product.offer_end_date": "December 31, 2024";
|
|
144
|
+
readonly "product.secondary_offer_price": "$2.99";
|
|
145
|
+
readonly "product.secondary_offer_period": "week";
|
|
146
|
+
readonly "product.secondary_offer_period_abbreviated": "wk";
|
|
147
|
+
readonly "product.relative_discount": "19%";
|
|
148
|
+
readonly "product.store_product_name": "Pro Access";
|
|
149
|
+
};
|
|
150
|
+
readonly $rc_six_month: {
|
|
151
|
+
readonly "product.price": "$39.99";
|
|
152
|
+
readonly "product.price_per_period": "$39.99/6 months";
|
|
153
|
+
readonly "product.price_per_period_abbreviated": "$39.99/6mo";
|
|
154
|
+
readonly "product.price_per_day": "$0.22";
|
|
155
|
+
readonly "product.price_per_week": "$1.54";
|
|
156
|
+
readonly "product.price_per_month": "$6.67";
|
|
157
|
+
readonly "product.price_per_year": "$79.98";
|
|
158
|
+
readonly "product.period": "6 months";
|
|
159
|
+
readonly "product.period_abbreviated": "6mo";
|
|
160
|
+
readonly "product.periodly": "6 months";
|
|
161
|
+
readonly "product.period_in_days": "180";
|
|
162
|
+
readonly "product.period_in_weeks": "13";
|
|
163
|
+
readonly "product.period_in_months": "6";
|
|
164
|
+
readonly "product.period_in_years": "0";
|
|
165
|
+
readonly "product.period_with_unit": "6 months";
|
|
166
|
+
readonly "product.currency_code": "USD";
|
|
167
|
+
readonly "product.currency_symbol": "$";
|
|
168
|
+
readonly "product.offer_price": "$1.99";
|
|
169
|
+
readonly "product.offer_price_per_day": "$0.07";
|
|
170
|
+
readonly "product.offer_price_per_week": "$0.50";
|
|
171
|
+
readonly "product.offer_price_per_month": "$1.99";
|
|
172
|
+
readonly "product.offer_price_per_year": "$23.88";
|
|
173
|
+
readonly "product.offer_period": "week";
|
|
174
|
+
readonly "product.offer_period_abbreviated": "wk";
|
|
175
|
+
readonly "product.offer_period_in_days": "7";
|
|
176
|
+
readonly "product.offer_period_in_weeks": "1";
|
|
177
|
+
readonly "product.offer_period_in_months": "0";
|
|
178
|
+
readonly "product.offer_period_in_years": "0";
|
|
179
|
+
readonly "product.offer_period_with_unit": "1 week";
|
|
180
|
+
readonly "product.offer_end_date": "December 31, 2024";
|
|
181
|
+
readonly "product.secondary_offer_price": "$2.99";
|
|
182
|
+
readonly "product.secondary_offer_period": "week";
|
|
183
|
+
readonly "product.secondary_offer_period_abbreviated": "wk";
|
|
184
|
+
readonly "product.relative_discount": "19%";
|
|
185
|
+
readonly "product.store_product_name": "Pro Access";
|
|
186
|
+
};
|
|
187
|
+
readonly $rc_annual: {
|
|
188
|
+
readonly "product.price": "$69.99";
|
|
189
|
+
readonly "product.price_per_period": "$69.99/year";
|
|
190
|
+
readonly "product.price_per_period_abbreviated": "$69.99/yr";
|
|
191
|
+
readonly "product.price_per_day": "$0.19";
|
|
192
|
+
readonly "product.price_per_week": "$1.35";
|
|
193
|
+
readonly "product.price_per_month": "$5.83";
|
|
194
|
+
readonly "product.price_per_year": "$69.99";
|
|
195
|
+
readonly "product.period": "year";
|
|
196
|
+
readonly "product.period_abbreviated": "yr";
|
|
197
|
+
readonly "product.periodly": "yearly";
|
|
198
|
+
readonly "product.period_in_days": "365";
|
|
199
|
+
readonly "product.period_in_weeks": "52";
|
|
200
|
+
readonly "product.period_in_months": "12";
|
|
201
|
+
readonly "product.period_in_years": "1";
|
|
202
|
+
readonly "product.period_with_unit": "1 year";
|
|
203
|
+
readonly "product.currency_code": "USD";
|
|
204
|
+
readonly "product.currency_symbol": "$";
|
|
205
|
+
readonly "product.offer_price": "$1.99";
|
|
206
|
+
readonly "product.offer_price_per_day": "$0.07";
|
|
207
|
+
readonly "product.offer_price_per_week": "$0.50";
|
|
208
|
+
readonly "product.offer_price_per_month": "$1.99";
|
|
209
|
+
readonly "product.offer_price_per_year": "$23.88";
|
|
210
|
+
readonly "product.offer_period": "week";
|
|
211
|
+
readonly "product.offer_period_abbreviated": "wk";
|
|
212
|
+
readonly "product.offer_period_in_days": "7";
|
|
213
|
+
readonly "product.offer_period_in_weeks": "1";
|
|
214
|
+
readonly "product.offer_period_in_months": "0";
|
|
215
|
+
readonly "product.offer_period_in_years": "0";
|
|
216
|
+
readonly "product.offer_period_with_unit": "1 week";
|
|
217
|
+
readonly "product.offer_end_date": "December 31, 2024";
|
|
218
|
+
readonly "product.secondary_offer_price": "$2.99";
|
|
219
|
+
readonly "product.secondary_offer_period": "week";
|
|
220
|
+
readonly "product.secondary_offer_period_abbreviated": "wk";
|
|
221
|
+
readonly "product.relative_discount": "19%";
|
|
222
|
+
readonly "product.store_product_name": "Pro Access";
|
|
223
|
+
};
|
|
224
|
+
readonly $rc_lifetime: {
|
|
225
|
+
readonly "product.price": "$119.99";
|
|
226
|
+
readonly "product.price_per_period": "$119.99";
|
|
227
|
+
readonly "product.price_per_period_abbreviated": "$119.99";
|
|
228
|
+
readonly "product.price_per_day": "$119.99";
|
|
229
|
+
readonly "product.price_per_week": "$119.99";
|
|
230
|
+
readonly "product.price_per_month": "$119.99";
|
|
231
|
+
readonly "product.price_per_year": "$119.99";
|
|
232
|
+
readonly "product.period": "lifetime";
|
|
233
|
+
readonly "product.period_abbreviated": "lifetime";
|
|
234
|
+
readonly "product.periodly": "lifetime";
|
|
235
|
+
readonly "product.period_in_days": "";
|
|
236
|
+
readonly "product.period_in_weeks": "";
|
|
237
|
+
readonly "product.period_in_months": "";
|
|
238
|
+
readonly "product.period_in_years": "";
|
|
239
|
+
readonly "product.period_with_unit": "lifetime";
|
|
240
|
+
readonly "product.currency_code": "USD";
|
|
241
|
+
readonly "product.currency_symbol": "$";
|
|
242
|
+
readonly "product.offer_price": "";
|
|
243
|
+
readonly "product.offer_price_per_day": "";
|
|
244
|
+
readonly "product.offer_price_per_week": "";
|
|
245
|
+
readonly "product.offer_price_per_month": "";
|
|
246
|
+
readonly "product.offer_price_per_year": "";
|
|
247
|
+
readonly "product.offer_period": "";
|
|
248
|
+
readonly "product.offer_period_abbreviated": "";
|
|
249
|
+
readonly "product.offer_period_in_days": "";
|
|
250
|
+
readonly "product.offer_period_in_weeks": "";
|
|
251
|
+
readonly "product.offer_period_in_months": "";
|
|
252
|
+
readonly "product.offer_period_in_years": "";
|
|
253
|
+
readonly "product.offer_period_with_unit": "";
|
|
254
|
+
readonly "product.offer_end_date": "";
|
|
255
|
+
readonly "product.secondary_offer_price": "";
|
|
256
|
+
readonly "product.secondary_offer_period": "";
|
|
257
|
+
readonly "product.secondary_offer_period_abbreviated": "";
|
|
258
|
+
readonly "product.relative_discount": "19%";
|
|
259
|
+
readonly "product.store_product_name": "Pro Access";
|
|
260
|
+
};
|
|
261
|
+
}>;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { PackageIdentifier, } from "../../../types/variables";
|
|
2
|
+
export const VARIABLES = Object.freeze({
|
|
3
|
+
[PackageIdentifier.weekly]: {
|
|
4
|
+
"product.price": "$2.99",
|
|
5
|
+
"product.price_per_period": "$2.99/week",
|
|
6
|
+
"product.price_per_period_abbreviated": "$2.99/wk",
|
|
7
|
+
"product.price_per_day": "$0.43",
|
|
8
|
+
"product.price_per_week": "$2.99",
|
|
9
|
+
"product.price_per_month": "$11.96",
|
|
10
|
+
"product.price_per_year": "$155.48",
|
|
11
|
+
"product.period": "week",
|
|
12
|
+
"product.period_abbreviated": "wk",
|
|
13
|
+
"product.periodly": "weekly",
|
|
14
|
+
"product.period_in_days": "7",
|
|
15
|
+
"product.period_in_weeks": "1",
|
|
16
|
+
"product.period_in_months": "0",
|
|
17
|
+
"product.period_in_years": "0",
|
|
18
|
+
"product.period_with_unit": "1 week",
|
|
19
|
+
"product.currency_code": "USD",
|
|
20
|
+
"product.currency_symbol": "$",
|
|
21
|
+
"product.offer_price": "$1.99",
|
|
22
|
+
"product.offer_price_per_day": "$0.07",
|
|
23
|
+
"product.offer_price_per_week": "$0.50",
|
|
24
|
+
"product.offer_price_per_month": "$1.99",
|
|
25
|
+
"product.offer_price_per_year": "$23.88",
|
|
26
|
+
"product.offer_period": "week",
|
|
27
|
+
"product.offer_period_abbreviated": "wk",
|
|
28
|
+
"product.offer_period_in_days": "7",
|
|
29
|
+
"product.offer_period_in_weeks": "1",
|
|
30
|
+
"product.offer_period_in_months": "0",
|
|
31
|
+
"product.offer_period_in_years": "0",
|
|
32
|
+
"product.offer_period_with_unit": "1 week",
|
|
33
|
+
"product.offer_end_date": "December 31, 2024",
|
|
34
|
+
"product.secondary_offer_price": "$2.99",
|
|
35
|
+
"product.secondary_offer_period": "week",
|
|
36
|
+
"product.secondary_offer_period_abbreviated": "wk",
|
|
37
|
+
"product.relative_discount": "19%",
|
|
38
|
+
"product.store_product_name": "Pro Access",
|
|
39
|
+
},
|
|
40
|
+
[PackageIdentifier.monthly]: {
|
|
41
|
+
"product.price": "$9.99",
|
|
42
|
+
"product.price_per_period": "$9.99/month",
|
|
43
|
+
"product.price_per_period_abbreviated": "$9.99/mo",
|
|
44
|
+
"product.price_per_day": "$0.33",
|
|
45
|
+
"product.price_per_week": "$2.50",
|
|
46
|
+
"product.price_per_month": "$9.99",
|
|
47
|
+
"product.price_per_year": "$119.88",
|
|
48
|
+
"product.period": "month",
|
|
49
|
+
"product.period_abbreviated": "mo",
|
|
50
|
+
"product.periodly": "monthly",
|
|
51
|
+
"product.period_in_days": "30",
|
|
52
|
+
"product.period_in_weeks": "4",
|
|
53
|
+
"product.period_in_months": "1",
|
|
54
|
+
"product.period_in_years": "0",
|
|
55
|
+
"product.period_with_unit": "1 month",
|
|
56
|
+
"product.currency_code": "USD",
|
|
57
|
+
"product.currency_symbol": "$",
|
|
58
|
+
"product.offer_price": "$1.99",
|
|
59
|
+
"product.offer_price_per_day": "$0.07",
|
|
60
|
+
"product.offer_price_per_week": "$0.50",
|
|
61
|
+
"product.offer_price_per_month": "$1.99",
|
|
62
|
+
"product.offer_price_per_year": "$23.88",
|
|
63
|
+
"product.offer_period": "week",
|
|
64
|
+
"product.offer_period_abbreviated": "wk",
|
|
65
|
+
"product.offer_period_in_days": "7",
|
|
66
|
+
"product.offer_period_in_weeks": "1",
|
|
67
|
+
"product.offer_period_in_months": "0",
|
|
68
|
+
"product.offer_period_in_years": "0",
|
|
69
|
+
"product.offer_period_with_unit": "1 week",
|
|
70
|
+
"product.offer_end_date": "December 31, 2024",
|
|
71
|
+
"product.secondary_offer_price": "$2.99",
|
|
72
|
+
"product.secondary_offer_period": "week",
|
|
73
|
+
"product.secondary_offer_period_abbreviated": "wk",
|
|
74
|
+
"product.relative_discount": "19%",
|
|
75
|
+
"product.store_product_name": "Pro Access",
|
|
76
|
+
},
|
|
77
|
+
[PackageIdentifier.two_month]: {
|
|
78
|
+
"product.price": "$17.99",
|
|
79
|
+
"product.price_per_period": "$17.99/2 months",
|
|
80
|
+
"product.price_per_period_abbreviated": "$17.99/2mo",
|
|
81
|
+
"product.price_per_day": "$0.30",
|
|
82
|
+
"product.price_per_week": "$2.25",
|
|
83
|
+
"product.price_per_month": "$9.00",
|
|
84
|
+
"product.price_per_year": "$107.94",
|
|
85
|
+
"product.period": "2 months",
|
|
86
|
+
"product.period_abbreviated": "2mo",
|
|
87
|
+
"product.periodly": "2 months",
|
|
88
|
+
"product.period_in_days": "60",
|
|
89
|
+
"product.period_in_weeks": "8",
|
|
90
|
+
"product.period_in_months": "2",
|
|
91
|
+
"product.period_in_years": "0",
|
|
92
|
+
"product.period_with_unit": "2 months",
|
|
93
|
+
"product.currency_code": "USD",
|
|
94
|
+
"product.currency_symbol": "$",
|
|
95
|
+
"product.offer_price": "$1.99",
|
|
96
|
+
"product.offer_price_per_day": "$0.07",
|
|
97
|
+
"product.offer_price_per_week": "$0.50",
|
|
98
|
+
"product.offer_price_per_month": "$1.99",
|
|
99
|
+
"product.offer_price_per_year": "$23.88",
|
|
100
|
+
"product.offer_period": "week",
|
|
101
|
+
"product.offer_period_abbreviated": "wk",
|
|
102
|
+
"product.offer_period_in_days": "7",
|
|
103
|
+
"product.offer_period_in_weeks": "1",
|
|
104
|
+
"product.offer_period_in_months": "0",
|
|
105
|
+
"product.offer_period_in_years": "0",
|
|
106
|
+
"product.offer_period_with_unit": "1 week",
|
|
107
|
+
"product.offer_end_date": "December 31, 2024",
|
|
108
|
+
"product.secondary_offer_price": "$2.99",
|
|
109
|
+
"product.secondary_offer_period": "week",
|
|
110
|
+
"product.secondary_offer_period_abbreviated": "wk",
|
|
111
|
+
"product.relative_discount": "19%",
|
|
112
|
+
"product.store_product_name": "Pro Access",
|
|
113
|
+
},
|
|
114
|
+
[PackageIdentifier.three_month]: {
|
|
115
|
+
"product.price": "$24.99",
|
|
116
|
+
"product.price_per_period": "$24.99/3 months",
|
|
117
|
+
"product.price_per_period_abbreviated": "$24.99/3mo",
|
|
118
|
+
"product.price_per_day": "$0.28",
|
|
119
|
+
"product.price_per_week": "$1.92",
|
|
120
|
+
"product.price_per_month": "$8.33",
|
|
121
|
+
"product.price_per_year": "$99.96",
|
|
122
|
+
"product.period": "3 months",
|
|
123
|
+
"product.period_abbreviated": "3mo",
|
|
124
|
+
"product.periodly": "3 months",
|
|
125
|
+
"product.period_in_days": "90",
|
|
126
|
+
"product.period_in_weeks": "13",
|
|
127
|
+
"product.period_in_months": "3",
|
|
128
|
+
"product.period_in_years": "0",
|
|
129
|
+
"product.period_with_unit": "3 months",
|
|
130
|
+
"product.currency_code": "USD",
|
|
131
|
+
"product.currency_symbol": "$",
|
|
132
|
+
"product.offer_price": "$1.99",
|
|
133
|
+
"product.offer_price_per_day": "$0.07",
|
|
134
|
+
"product.offer_price_per_week": "$0.50",
|
|
135
|
+
"product.offer_price_per_month": "$1.99",
|
|
136
|
+
"product.offer_price_per_year": "$23.88",
|
|
137
|
+
"product.offer_period": "week",
|
|
138
|
+
"product.offer_period_abbreviated": "wk",
|
|
139
|
+
"product.offer_period_in_days": "7",
|
|
140
|
+
"product.offer_period_in_weeks": "1",
|
|
141
|
+
"product.offer_period_in_months": "0",
|
|
142
|
+
"product.offer_period_in_years": "0",
|
|
143
|
+
"product.offer_period_with_unit": "1 week",
|
|
144
|
+
"product.offer_end_date": "December 31, 2024",
|
|
145
|
+
"product.secondary_offer_price": "$2.99",
|
|
146
|
+
"product.secondary_offer_period": "week",
|
|
147
|
+
"product.secondary_offer_period_abbreviated": "wk",
|
|
148
|
+
"product.relative_discount": "19%",
|
|
149
|
+
"product.store_product_name": "Pro Access",
|
|
150
|
+
},
|
|
151
|
+
[PackageIdentifier.six_month]: {
|
|
152
|
+
"product.price": "$39.99",
|
|
153
|
+
"product.price_per_period": "$39.99/6 months",
|
|
154
|
+
"product.price_per_period_abbreviated": "$39.99/6mo",
|
|
155
|
+
"product.price_per_day": "$0.22",
|
|
156
|
+
"product.price_per_week": "$1.54",
|
|
157
|
+
"product.price_per_month": "$6.67",
|
|
158
|
+
"product.price_per_year": "$79.98",
|
|
159
|
+
"product.period": "6 months",
|
|
160
|
+
"product.period_abbreviated": "6mo",
|
|
161
|
+
"product.periodly": "6 months",
|
|
162
|
+
"product.period_in_days": "180",
|
|
163
|
+
"product.period_in_weeks": "13",
|
|
164
|
+
"product.period_in_months": "6",
|
|
165
|
+
"product.period_in_years": "0",
|
|
166
|
+
"product.period_with_unit": "6 months",
|
|
167
|
+
"product.currency_code": "USD",
|
|
168
|
+
"product.currency_symbol": "$",
|
|
169
|
+
"product.offer_price": "$1.99",
|
|
170
|
+
"product.offer_price_per_day": "$0.07",
|
|
171
|
+
"product.offer_price_per_week": "$0.50",
|
|
172
|
+
"product.offer_price_per_month": "$1.99",
|
|
173
|
+
"product.offer_price_per_year": "$23.88",
|
|
174
|
+
"product.offer_period": "week",
|
|
175
|
+
"product.offer_period_abbreviated": "wk",
|
|
176
|
+
"product.offer_period_in_days": "7",
|
|
177
|
+
"product.offer_period_in_weeks": "1",
|
|
178
|
+
"product.offer_period_in_months": "0",
|
|
179
|
+
"product.offer_period_in_years": "0",
|
|
180
|
+
"product.offer_period_with_unit": "1 week",
|
|
181
|
+
"product.offer_end_date": "December 31, 2024",
|
|
182
|
+
"product.secondary_offer_price": "$2.99",
|
|
183
|
+
"product.secondary_offer_period": "week",
|
|
184
|
+
"product.secondary_offer_period_abbreviated": "wk",
|
|
185
|
+
"product.relative_discount": "19%",
|
|
186
|
+
"product.store_product_name": "Pro Access",
|
|
187
|
+
},
|
|
188
|
+
[PackageIdentifier.annual]: {
|
|
189
|
+
"product.price": "$69.99",
|
|
190
|
+
"product.price_per_period": "$69.99/year",
|
|
191
|
+
"product.price_per_period_abbreviated": "$69.99/yr",
|
|
192
|
+
"product.price_per_day": "$0.19",
|
|
193
|
+
"product.price_per_week": "$1.35",
|
|
194
|
+
"product.price_per_month": "$5.83",
|
|
195
|
+
"product.price_per_year": "$69.99",
|
|
196
|
+
"product.period": "year",
|
|
197
|
+
"product.period_abbreviated": "yr",
|
|
198
|
+
"product.periodly": "yearly",
|
|
199
|
+
"product.period_in_days": "365",
|
|
200
|
+
"product.period_in_weeks": "52",
|
|
201
|
+
"product.period_in_months": "12",
|
|
202
|
+
"product.period_in_years": "1",
|
|
203
|
+
"product.period_with_unit": "1 year",
|
|
204
|
+
"product.currency_code": "USD",
|
|
205
|
+
"product.currency_symbol": "$",
|
|
206
|
+
"product.offer_price": "$1.99",
|
|
207
|
+
"product.offer_price_per_day": "$0.07",
|
|
208
|
+
"product.offer_price_per_week": "$0.50",
|
|
209
|
+
"product.offer_price_per_month": "$1.99",
|
|
210
|
+
"product.offer_price_per_year": "$23.88",
|
|
211
|
+
"product.offer_period": "week",
|
|
212
|
+
"product.offer_period_abbreviated": "wk",
|
|
213
|
+
"product.offer_period_in_days": "7",
|
|
214
|
+
"product.offer_period_in_weeks": "1",
|
|
215
|
+
"product.offer_period_in_months": "0",
|
|
216
|
+
"product.offer_period_in_years": "0",
|
|
217
|
+
"product.offer_period_with_unit": "1 week",
|
|
218
|
+
"product.offer_end_date": "December 31, 2024",
|
|
219
|
+
"product.secondary_offer_price": "$2.99",
|
|
220
|
+
"product.secondary_offer_period": "week",
|
|
221
|
+
"product.secondary_offer_period_abbreviated": "wk",
|
|
222
|
+
"product.relative_discount": "19%",
|
|
223
|
+
"product.store_product_name": "Pro Access",
|
|
224
|
+
},
|
|
225
|
+
[PackageIdentifier.lifetime]: {
|
|
226
|
+
"product.price": "$119.99",
|
|
227
|
+
"product.price_per_period": "$119.99",
|
|
228
|
+
"product.price_per_period_abbreviated": "$119.99",
|
|
229
|
+
"product.price_per_day": "$119.99",
|
|
230
|
+
"product.price_per_week": "$119.99",
|
|
231
|
+
"product.price_per_month": "$119.99",
|
|
232
|
+
"product.price_per_year": "$119.99",
|
|
233
|
+
"product.period": "lifetime",
|
|
234
|
+
"product.period_abbreviated": "lifetime",
|
|
235
|
+
"product.periodly": "lifetime",
|
|
236
|
+
"product.period_in_days": "",
|
|
237
|
+
"product.period_in_weeks": "",
|
|
238
|
+
"product.period_in_months": "",
|
|
239
|
+
"product.period_in_years": "",
|
|
240
|
+
"product.period_with_unit": "lifetime",
|
|
241
|
+
"product.currency_code": "USD",
|
|
242
|
+
"product.currency_symbol": "$",
|
|
243
|
+
"product.offer_price": "",
|
|
244
|
+
"product.offer_price_per_day": "",
|
|
245
|
+
"product.offer_price_per_week": "",
|
|
246
|
+
"product.offer_price_per_month": "",
|
|
247
|
+
"product.offer_price_per_year": "",
|
|
248
|
+
"product.offer_period": "",
|
|
249
|
+
"product.offer_period_abbreviated": "",
|
|
250
|
+
"product.offer_period_in_days": "",
|
|
251
|
+
"product.offer_period_in_weeks": "",
|
|
252
|
+
"product.offer_period_in_months": "",
|
|
253
|
+
"product.offer_period_in_years": "",
|
|
254
|
+
"product.offer_period_with_unit": "",
|
|
255
|
+
"product.offer_end_date": "",
|
|
256
|
+
"product.secondary_offer_price": "",
|
|
257
|
+
"product.secondary_offer_period": "",
|
|
258
|
+
"product.secondary_offer_period_abbreviated": "",
|
|
259
|
+
"product.relative_discount": "19%",
|
|
260
|
+
"product.store_product_name": "Pro Access",
|
|
261
|
+
},
|
|
262
|
+
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import PurchaseButton from "./PurchaseButton.svelte";
|
|
3
|
+
import { componentDecorator } from "../../stories/component-decorator";
|
|
3
4
|
import { localizationDecorator } from "../../stories/localization-decorator";
|
|
5
|
+
import type { PurchaseButtonProps } from "../../types/components/purchase-button";
|
|
4
6
|
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
5
7
|
|
|
6
8
|
const defaultLocale = "en_US";
|
|
@@ -9,8 +11,8 @@
|
|
|
9
11
|
const { Story } = defineMeta({
|
|
10
12
|
title: "Components/PurchaseButton",
|
|
11
13
|
component: PurchaseButton,
|
|
12
|
-
tags: ["autodocs"],
|
|
13
14
|
decorators: [
|
|
15
|
+
componentDecorator(),
|
|
14
16
|
localizationDecorator({
|
|
15
17
|
defaultLocale,
|
|
16
18
|
localizations: {
|
|
@@ -20,28 +22,19 @@
|
|
|
20
22
|
},
|
|
21
23
|
}),
|
|
22
24
|
],
|
|
23
|
-
argTypes: {
|
|
24
|
-
stack: {
|
|
25
|
-
control: { type: "object" },
|
|
26
|
-
description: "Stack configuration for button content",
|
|
27
|
-
table: {
|
|
28
|
-
type: {
|
|
29
|
-
summary: "object",
|
|
30
|
-
detail: "StackProps",
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
25
|
});
|
|
36
26
|
</script>
|
|
37
27
|
|
|
38
|
-
<!-- Default button -->
|
|
39
28
|
<Story
|
|
40
29
|
name="Default button"
|
|
41
30
|
args={{
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
type: "purchase_button",
|
|
32
|
+
id: "purchase-button",
|
|
33
|
+
name: "Purchase button",
|
|
44
34
|
stack: {
|
|
35
|
+
type: "stack",
|
|
36
|
+
id: "pbvAUBvilP",
|
|
37
|
+
name: "Stack",
|
|
45
38
|
background_color: {
|
|
46
39
|
light: {
|
|
47
40
|
type: "hex",
|
|
@@ -103,14 +96,12 @@
|
|
|
103
96
|
alignment: "center",
|
|
104
97
|
distribution: "center",
|
|
105
98
|
},
|
|
106
|
-
id: "pbvAUBvilP",
|
|
107
99
|
margin: {
|
|
108
100
|
bottom: 16,
|
|
109
101
|
leading: 16,
|
|
110
102
|
top: 16,
|
|
111
103
|
trailing: 16,
|
|
112
104
|
},
|
|
113
|
-
name: "Stack",
|
|
114
105
|
padding: {
|
|
115
106
|
bottom: 16,
|
|
116
107
|
leading: 16,
|
|
@@ -137,8 +128,6 @@
|
|
|
137
128
|
},
|
|
138
129
|
},
|
|
139
130
|
spacing: 8,
|
|
140
|
-
type: "stack",
|
|
141
131
|
},
|
|
142
|
-
|
|
143
|
-
}}
|
|
132
|
+
} satisfies PurchaseButtonProps}
|
|
144
133
|
/>
|
|
@@ -1,36 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getPurchaseButtonStyles } from "./purchase-button-utils";
|
|
3
2
|
import Stack from "../stack/Stack.svelte";
|
|
4
|
-
import { ButtonDeprecated } from "../../index";
|
|
5
3
|
import { getPaywallContext } from "../../stores/paywall";
|
|
6
4
|
import type { PurchaseButtonProps } from "../../types/components/purchase-button";
|
|
7
5
|
|
|
8
|
-
const { stack
|
|
9
|
-
$props();
|
|
6
|
+
const { stack }: PurchaseButtonProps = $props();
|
|
10
7
|
|
|
11
8
|
const { onPurchase } = getPaywallContext();
|
|
12
|
-
|
|
13
|
-
const buttonStyles = $derived(
|
|
14
|
-
getPurchaseButtonStyles({
|
|
15
|
-
stack,
|
|
16
|
-
zStackChildStyles,
|
|
17
|
-
...restProps,
|
|
18
|
-
}),
|
|
19
|
-
);
|
|
20
9
|
</script>
|
|
21
10
|
|
|
22
|
-
<
|
|
23
|
-
onclick={onPurchase}
|
|
24
|
-
class="rc-pw-purchase-button"
|
|
25
|
-
style={buttonStyles}
|
|
26
|
-
>
|
|
27
|
-
<Stack {...stack} />
|
|
28
|
-
</ButtonDeprecated>
|
|
29
|
-
|
|
30
|
-
<style>
|
|
31
|
-
.rc-pw-purchase-button {
|
|
32
|
-
position: var(--purchase-button-position, relative);
|
|
33
|
-
inset: var(--purchase-button-inset, 0);
|
|
34
|
-
transform: var(--purchase-button-transform, initial);
|
|
35
|
-
}
|
|
36
|
-
</style>
|
|
11
|
+
<Stack {...stack} onclick={onPurchase} />
|