@revenuecat/purchases-ui-js 0.0.21 → 0.1.21
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 +9 -0
- package/dist/components/button/ButtonNode.svelte +7 -5
- package/dist/components/paywall/Paywall.svelte +0 -7
- package/dist/components/purchase-button/PurchaseButton.svelte +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/stories/fixtures.d.ts +2 -0
- package/dist/stories/fixtures.js +36 -0
- package/dist/stories/with-layout.d.ts +10 -0
- package/dist/stories/with-layout.js +15 -0
- package/dist/stories/with-layout.svelte +33 -0
- package/dist/stories/with-layout.svelte.d.ts +10 -0
- package/dist/ui/atoms/typography.stories.svelte +202 -0
- package/dist/ui/atoms/typography.stories.svelte.d.ts +19 -0
- package/dist/ui/atoms/typography.svelte +132 -0
- package/dist/ui/atoms/typography.svelte.d.ts +9 -0
- package/dist/ui/layout/container.svelte +73 -0
- package/dist/ui/layout/container.svelte.d.ts +24 -0
- package/dist/ui/layout/layout.svelte +45 -0
- package/dist/ui/layout/layout.svelte.d.ts +22 -0
- package/dist/ui/layout/main-block.svelte +32 -0
- package/dist/ui/layout/main-block.svelte.d.ts +23 -0
- package/dist/ui/layout/section-layout.svelte +73 -0
- package/dist/ui/layout/section-layout.svelte.d.ts +23 -0
- package/dist/ui/molecules/button.stories.svelte +45 -0
- package/dist/ui/molecules/button.stories.svelte.d.ts +19 -0
- package/dist/ui/molecules/button.svelte +94 -0
- package/dist/ui/molecules/button.svelte.d.ts +13 -0
- package/dist/ui/theme/colors.d.ts +37 -0
- package/dist/ui/theme/colors.js +54 -0
- package/dist/ui/theme/shapes.d.ts +8 -0
- package/dist/ui/theme/shapes.js +13 -0
- package/dist/ui/theme/spacing.d.ts +7 -0
- package/dist/ui/theme/spacing.js +42 -0
- package/dist/ui/theme/text.d.ts +19 -0
- package/dist/ui/theme/text.js +173 -0
- package/dist/ui/theme/theme.d.ts +15 -0
- package/dist/ui/theme/theme.js +38 -0
- package/dist/ui/theme/utils.d.ts +37 -0
- package/dist/ui/theme/utils.js +191 -0
- package/dist/ui/utils/branding.d.ts +16 -0
- package/dist/ui/utils/branding.js +1 -0
- package/dist/ui/utils/processing-animation.svelte +57 -0
- package/dist/ui/utils/processing-animation.svelte.d.ts +20 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
2
|
+
import { ButtonDeprecated } from "../../index";
|
|
3
3
|
import type { ButtonNodeProps } from "../../data/entities";
|
|
4
4
|
import Stack from "../stack/Stack.svelte";
|
|
5
5
|
import { getButtonStyles } from "./button-utils";
|
|
@@ -30,17 +30,19 @@
|
|
|
30
30
|
);
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
|
-
<
|
|
33
|
+
<ButtonDeprecated onclick={onClick} style={buttonStyles} class={"rc-pw-button"}>
|
|
34
34
|
<Stack {...stack} {labels} {purchaseState} {variableDictionary} />
|
|
35
|
-
</
|
|
35
|
+
</ButtonDeprecated>
|
|
36
36
|
|
|
37
37
|
<style>
|
|
38
38
|
.rc-pw-button {
|
|
39
39
|
display: flex;
|
|
40
40
|
margin: 0;
|
|
41
41
|
padding: 0;
|
|
42
|
-
background: initial;
|
|
43
|
-
border: initial;
|
|
44
42
|
text-align: initial;
|
|
43
|
+
border: none;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
background: transparent;
|
|
46
|
+
width: fit-content;
|
|
45
47
|
}
|
|
46
48
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { PurchaseButtonProps } from "../../data/entities";
|
|
3
3
|
import Stack from "../stack/Stack.svelte";
|
|
4
|
-
import {
|
|
4
|
+
import { ButtonDeprecated } from "../../index";
|
|
5
5
|
import { getPurchaseButtonStyles } from "./purchase-button-utils";
|
|
6
6
|
|
|
7
7
|
const {
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
);
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
|
-
<
|
|
33
|
+
<ButtonDeprecated
|
|
34
34
|
onclick={handleClick}
|
|
35
35
|
class="rc-pw-purchase-button"
|
|
36
36
|
style={buttonStyles}
|
|
37
37
|
>
|
|
38
38
|
<Stack {...stack} {labels} {purchaseState} {variableDictionary} />
|
|
39
|
-
</
|
|
39
|
+
</ButtonDeprecated>
|
|
40
40
|
|
|
41
41
|
<style>
|
|
42
42
|
.rc-pw-purchase-button {
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export { type PaywallData as PaywallData } from "./data/entities";
|
|
|
3
3
|
export { type VariableDictionary } from "./utils/variable-utils";
|
|
4
4
|
export { default as Paywall } from "./components/paywall/Paywall.svelte";
|
|
5
5
|
export { default as Stack } from "./components/stack/Stack.svelte";
|
|
6
|
-
export { default as
|
|
6
|
+
export { default as ButtonDeprecated } from "./components/button/Button.svelte";
|
|
7
|
+
export { default as Button } from "./ui/molecules/button.svelte";
|
|
7
8
|
export { default as Text } from "./components/text/Text.svelte";
|
|
8
9
|
export { default as Image } from "./components/image/Image.svelte";
|
|
9
10
|
export { default as PurchaseButton } from "./components/purchase-button/PurchaseButton.svelte";
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,8 @@ export {} from "./data/entities";
|
|
|
4
4
|
export {} from "./utils/variable-utils";
|
|
5
5
|
export { default as Paywall } from "./components/paywall/Paywall.svelte";
|
|
6
6
|
export { default as Stack } from "./components/stack/Stack.svelte";
|
|
7
|
-
export { default as
|
|
7
|
+
export { default as ButtonDeprecated } from "./components/button/Button.svelte";
|
|
8
|
+
export { default as Button } from "./ui/molecules/button.svelte";
|
|
8
9
|
export { default as Text } from "./components/text/Text.svelte";
|
|
9
10
|
export { default as Image } from "./components/image/Image.svelte";
|
|
10
11
|
export { default as PurchaseButton } from "./components/purchase-button/PurchaseButton.svelte";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PaywallData } from "../data/entities";
|
|
2
|
+
import type { BrandingAppearance } from "../ui/utils/branding";
|
|
2
3
|
export declare const paywallData: PaywallData;
|
|
3
4
|
export declare const alignmentPaywallData: PaywallData;
|
|
4
5
|
export declare const fontsPaywallData: PaywallData;
|
|
@@ -22,3 +23,4 @@ export declare const paywallWithFooter: PaywallData;
|
|
|
22
23
|
export declare const errorPaywallData: PaywallData;
|
|
23
24
|
export declare const fallbackPaywallData: PaywallData;
|
|
24
25
|
export declare const e2eTestTemplate: PaywallData;
|
|
26
|
+
export declare const brandingAppearances: Record<string, BrandingAppearance | null>;
|
package/dist/stories/fixtures.js
CHANGED
|
@@ -24333,3 +24333,39 @@ export const e2eTestTemplate = {
|
|
|
24333
24333
|
google: ["TW", "KZ", "MX", "PH", "TH"],
|
|
24334
24334
|
},
|
|
24335
24335
|
};
|
|
24336
|
+
export const brandingAppearances = {
|
|
24337
|
+
None: null,
|
|
24338
|
+
Fantastic: {
|
|
24339
|
+
shapes: "rectangle",
|
|
24340
|
+
color_form_bg: "#313131",
|
|
24341
|
+
color_error: "#E79462",
|
|
24342
|
+
color_product_info_bg: "#ffffff",
|
|
24343
|
+
color_buttons_primary: "#AC7DE3",
|
|
24344
|
+
color_accent: "#99BB37",
|
|
24345
|
+
color_page_bg: "#ffffff",
|
|
24346
|
+
font: "sans-serif",
|
|
24347
|
+
show_product_description: true,
|
|
24348
|
+
},
|
|
24349
|
+
Igify: {
|
|
24350
|
+
color_accent: "#969696",
|
|
24351
|
+
color_buttons_primary: "#000000",
|
|
24352
|
+
color_error: "#e61054",
|
|
24353
|
+
color_form_bg: "#FFFFFF",
|
|
24354
|
+
color_page_bg: "#114ab8",
|
|
24355
|
+
color_product_info_bg: "#114ab8",
|
|
24356
|
+
font: "default",
|
|
24357
|
+
shapes: "default",
|
|
24358
|
+
show_product_description: true,
|
|
24359
|
+
},
|
|
24360
|
+
Dipsea: {
|
|
24361
|
+
color_accent: "#DF5539",
|
|
24362
|
+
color_buttons_primary: "#DF5539",
|
|
24363
|
+
color_error: "#F2545B",
|
|
24364
|
+
color_form_bg: "#372CBC",
|
|
24365
|
+
color_page_bg: "#26122F",
|
|
24366
|
+
color_product_info_bg: "#26122F",
|
|
24367
|
+
font: "default",
|
|
24368
|
+
shapes: "pill",
|
|
24369
|
+
show_product_description: false,
|
|
24370
|
+
},
|
|
24371
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import WithLayout from "./with-layout.svelte";
|
|
2
|
+
export function withLayout(Story, context) {
|
|
3
|
+
return {
|
|
4
|
+
Component: WithLayout,
|
|
5
|
+
props: {
|
|
6
|
+
// @ts-expect-error too hard to get the type right
|
|
7
|
+
globals: context.globals,
|
|
8
|
+
children: () => ({
|
|
9
|
+
Component: Story,
|
|
10
|
+
// @ts-expect-error too hard to get the type right
|
|
11
|
+
props: context.args,
|
|
12
|
+
}),
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { brandingAppearances } from "./fixtures";
|
|
3
|
+
import { toProductInfoStyleVar } from "../ui/theme/utils";
|
|
4
|
+
import Container from "../ui/layout/container.svelte";
|
|
5
|
+
import Layout from "../ui/layout/layout.svelte";
|
|
6
|
+
import Main from "../ui/layout/main-block.svelte";
|
|
7
|
+
import type { Snippet } from "svelte";
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
export interface Props {
|
|
12
|
+
children: Snippet<[]>;
|
|
13
|
+
globals: {
|
|
14
|
+
brandingName: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { children, globals }: Props = $props();
|
|
19
|
+
const brandingAppearance = $derived(
|
|
20
|
+
brandingAppearances[globals.brandingName],
|
|
21
|
+
);
|
|
22
|
+
const colorVariables = $derived(toProductInfoStyleVar(brandingAppearance));
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<Container {brandingAppearance}>
|
|
26
|
+
<Layout style={colorVariables}>
|
|
27
|
+
<Main {brandingAppearance}>
|
|
28
|
+
{#snippet body()}
|
|
29
|
+
{@render children()}
|
|
30
|
+
{/snippet}
|
|
31
|
+
</Main>
|
|
32
|
+
</Layout>
|
|
33
|
+
</Container>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
export interface Props {
|
|
3
|
+
children: Snippet<[]>;
|
|
4
|
+
globals: {
|
|
5
|
+
brandingName: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
declare const WithLayout: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type WithLayout = ReturnType<typeof WithLayout>;
|
|
10
|
+
export default WithLayout;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { default as Typography } from "../../ui/atoms/typography.svelte";
|
|
3
|
+
import {
|
|
4
|
+
type Args,
|
|
5
|
+
defineMeta,
|
|
6
|
+
setTemplate,
|
|
7
|
+
} from "@storybook/addon-svelte-csf";
|
|
8
|
+
import { withLayout } from "../../stories/with-layout";
|
|
9
|
+
import { brandingViewportModes } from "../../../../.storybook/modes";
|
|
10
|
+
|
|
11
|
+
let { Story } = defineMeta<typeof Typography>({
|
|
12
|
+
component: Typography,
|
|
13
|
+
title: "Atoms/Typography",
|
|
14
|
+
// @ts-expect-error ignore typing of decorator
|
|
15
|
+
decorators: [withLayout],
|
|
16
|
+
argTypes: {
|
|
17
|
+
size: {
|
|
18
|
+
control: "select",
|
|
19
|
+
options: [
|
|
20
|
+
"heading-2xl",
|
|
21
|
+
"heading-xl",
|
|
22
|
+
"heading-lg",
|
|
23
|
+
"heading-md",
|
|
24
|
+
"body-base",
|
|
25
|
+
"body-small",
|
|
26
|
+
"label-button",
|
|
27
|
+
"label-default",
|
|
28
|
+
"caption-default",
|
|
29
|
+
"caption-link",
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
parameters: {
|
|
34
|
+
chromatic: {
|
|
35
|
+
modes: brandingViewportModes,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const baseContent = "The quick brown fox jumps over the lazy dog";
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<script lang="ts">
|
|
44
|
+
setTemplate(template);
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
{#snippet template({ size = "body-base" }: Args<typeof Story>)}
|
|
48
|
+
<Typography {size}>
|
|
49
|
+
{#snippet children()}
|
|
50
|
+
Default text
|
|
51
|
+
{/snippet}
|
|
52
|
+
</Typography>
|
|
53
|
+
{/snippet}
|
|
54
|
+
|
|
55
|
+
<!-- Stories for each typography variant -->
|
|
56
|
+
<Story name="Heading 2XL">
|
|
57
|
+
<Typography size="heading-2xl">
|
|
58
|
+
Heading 2XL - {baseContent}
|
|
59
|
+
</Typography>
|
|
60
|
+
</Story>
|
|
61
|
+
|
|
62
|
+
<Story name="Heading XL">
|
|
63
|
+
<Typography size="heading-xl">
|
|
64
|
+
Heading XL - {baseContent}
|
|
65
|
+
</Typography>
|
|
66
|
+
</Story>
|
|
67
|
+
|
|
68
|
+
<Story name="Heading LG">
|
|
69
|
+
<Typography size="heading-lg">
|
|
70
|
+
Heading LG - {baseContent}
|
|
71
|
+
</Typography>
|
|
72
|
+
</Story>
|
|
73
|
+
|
|
74
|
+
<Story name="Heading MD">
|
|
75
|
+
<Typography size="heading-md">
|
|
76
|
+
Heading MD - {baseContent}
|
|
77
|
+
</Typography>
|
|
78
|
+
</Story>
|
|
79
|
+
|
|
80
|
+
<Story name="Body Base">
|
|
81
|
+
<Typography size="body-base">
|
|
82
|
+
Body Base - {baseContent}
|
|
83
|
+
</Typography>
|
|
84
|
+
</Story>
|
|
85
|
+
|
|
86
|
+
<Story name="Body Small">
|
|
87
|
+
<Typography size="body-small">
|
|
88
|
+
Body Small - {baseContent}
|
|
89
|
+
</Typography>
|
|
90
|
+
</Story>
|
|
91
|
+
|
|
92
|
+
<Story name="Label Button">
|
|
93
|
+
<Typography size="label-button">
|
|
94
|
+
Label Button - {baseContent}
|
|
95
|
+
</Typography>
|
|
96
|
+
</Story>
|
|
97
|
+
|
|
98
|
+
<Story name="Label Default">
|
|
99
|
+
<Typography size="label-default">
|
|
100
|
+
Label Default - {baseContent}
|
|
101
|
+
</Typography>
|
|
102
|
+
</Story>
|
|
103
|
+
|
|
104
|
+
<Story name="Caption Default">
|
|
105
|
+
<Typography size="caption-default">
|
|
106
|
+
Caption Default - {baseContent}
|
|
107
|
+
</Typography>
|
|
108
|
+
</Story>
|
|
109
|
+
|
|
110
|
+
<Story name="Caption Link">
|
|
111
|
+
<Typography size="caption-link">
|
|
112
|
+
Caption Link - {baseContent}
|
|
113
|
+
</Typography>
|
|
114
|
+
</Story>
|
|
115
|
+
|
|
116
|
+
<!-- Story showing all variants -->
|
|
117
|
+
<Story name="All Variants">
|
|
118
|
+
<div class="story-container">
|
|
119
|
+
<div class="variant-row">
|
|
120
|
+
<div class="variant-name">heading-2xl</div>
|
|
121
|
+
<Typography size="heading-2xl">
|
|
122
|
+
Heading 2XL - {baseContent}
|
|
123
|
+
</Typography>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="variant-row">
|
|
126
|
+
<div class="variant-name">heading-xl</div>
|
|
127
|
+
<Typography size="heading-xl">
|
|
128
|
+
Heading XL - {baseContent}
|
|
129
|
+
</Typography>
|
|
130
|
+
</div>
|
|
131
|
+
<div class="variant-row">
|
|
132
|
+
<div class="variant-name">heading-lg</div>
|
|
133
|
+
<Typography size="heading-lg">
|
|
134
|
+
Heading LG - {baseContent}
|
|
135
|
+
</Typography>
|
|
136
|
+
</div>
|
|
137
|
+
<div class="variant-row">
|
|
138
|
+
<div class="variant-name">heading-md</div>
|
|
139
|
+
<Typography size="heading-md">
|
|
140
|
+
Heading MD - {baseContent}
|
|
141
|
+
</Typography>
|
|
142
|
+
</div>
|
|
143
|
+
<div class="variant-row">
|
|
144
|
+
<div class="variant-name">body-base</div>
|
|
145
|
+
<Typography size="body-base">
|
|
146
|
+
Body Base - {baseContent}
|
|
147
|
+
</Typography>
|
|
148
|
+
</div>
|
|
149
|
+
<div class="variant-row">
|
|
150
|
+
<div class="variant-name">body-small</div>
|
|
151
|
+
<Typography size="body-small">
|
|
152
|
+
Body Small - {baseContent}
|
|
153
|
+
</Typography>
|
|
154
|
+
</div>
|
|
155
|
+
<div class="variant-row">
|
|
156
|
+
<div class="variant-name">label-button</div>
|
|
157
|
+
<Typography size="label-button">
|
|
158
|
+
Label Button - {baseContent}
|
|
159
|
+
</Typography>
|
|
160
|
+
</div>
|
|
161
|
+
<div class="variant-row">
|
|
162
|
+
<div class="variant-name">label-default</div>
|
|
163
|
+
<Typography size="label-default">
|
|
164
|
+
Label Default - {baseContent}
|
|
165
|
+
</Typography>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="variant-row">
|
|
168
|
+
<div class="variant-name">caption-default</div>
|
|
169
|
+
<Typography size="caption-default">
|
|
170
|
+
Caption Default - {baseContent}
|
|
171
|
+
</Typography>
|
|
172
|
+
</div>
|
|
173
|
+
<div class="variant-row">
|
|
174
|
+
<div class="variant-name">caption-link</div>
|
|
175
|
+
<Typography size="caption-link">
|
|
176
|
+
Caption Link - {baseContent}
|
|
177
|
+
</Typography>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
</Story>
|
|
181
|
+
|
|
182
|
+
<style>
|
|
183
|
+
.story-container {
|
|
184
|
+
padding: 2rem;
|
|
185
|
+
display: flex;
|
|
186
|
+
flex-direction: column;
|
|
187
|
+
gap: 2rem;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.variant-row {
|
|
191
|
+
display: grid;
|
|
192
|
+
grid-template-columns: 200px 1fr;
|
|
193
|
+
align-items: center;
|
|
194
|
+
gap: 1rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.variant-name {
|
|
198
|
+
color: #666;
|
|
199
|
+
font-family: monospace;
|
|
200
|
+
font-size: 14px;
|
|
201
|
+
}
|
|
202
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as Typography } from "../../ui/atoms/typography.svelte";
|
|
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> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Typography: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Typography = InstanceType<typeof Typography>;
|
|
19
|
+
export default Typography;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { type Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
type Size =
|
|
5
|
+
| "heading-2xl"
|
|
6
|
+
| "heading-xl"
|
|
7
|
+
| "heading-lg"
|
|
8
|
+
| "heading-md"
|
|
9
|
+
| "body-base"
|
|
10
|
+
| "body-small"
|
|
11
|
+
| "label-button"
|
|
12
|
+
| "label-default"
|
|
13
|
+
| "caption-default"
|
|
14
|
+
| "caption-link";
|
|
15
|
+
|
|
16
|
+
type Props = {
|
|
17
|
+
size?: Size;
|
|
18
|
+
children?: Snippet;
|
|
19
|
+
};
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script lang="ts">
|
|
23
|
+
const { children, size = "body-base" }: Props = $props();
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<span class="rcb-typography rcb-typography-{size}">
|
|
27
|
+
{@render children?.()}
|
|
28
|
+
</span>
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
/* svelte-ignore css-unused-selector */
|
|
32
|
+
.rcb-typography-heading-2xl {
|
|
33
|
+
font: var(--rc-text-heading2xl-mobile);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* svelte-ignore css-unused-selector */
|
|
37
|
+
.rcb-typography-heading-xl {
|
|
38
|
+
font: var(--rc-text-headingXl-mobile);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* svelte-ignore css-unused-selector */
|
|
42
|
+
.rcb-typography-heading-lg {
|
|
43
|
+
font: var(--rc-text-headingLg-mobile);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* svelte-ignore css-unused-selector */
|
|
47
|
+
.rcb-typography-heading-md {
|
|
48
|
+
font: var(--rc-text-headingMd-mobile);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* svelte-ignore css-unused-selector */
|
|
52
|
+
.rcb-typography-body-base {
|
|
53
|
+
font: var(--rc-text-bodyBase-mobile);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* svelte-ignore css-unused-selector */
|
|
57
|
+
.rcb-typography-body-small {
|
|
58
|
+
font: var(--rc-text-bodySmall-mobile);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* svelte-ignore css-unused-selector */
|
|
62
|
+
.rcb-typography-label-button {
|
|
63
|
+
font: var(--rc-text-labelButton-mobile);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* svelte-ignore css-unused-selector */
|
|
67
|
+
.rcb-typography-label-default {
|
|
68
|
+
font: var(--rc-text-labelDefault-mobile);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* svelte-ignore css-unused-selector */
|
|
72
|
+
.rcb-typography-caption-default {
|
|
73
|
+
font: var(--rc-text-captionDefault-mobile);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* svelte-ignore css-unused-selector */
|
|
77
|
+
.rcb-typography-caption-link {
|
|
78
|
+
font: var(--rc-text-captionLink-mobile);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@container layout-query-container (width >= 768px) {
|
|
82
|
+
/* svelte-ignore css-unused-selector */
|
|
83
|
+
.rcb-typography-heading-2xl {
|
|
84
|
+
font: var(--rc-text-heading2xl-desktop);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* svelte-ignore css-unused-selector */
|
|
88
|
+
.rcb-typography-heading-xl {
|
|
89
|
+
font: var(--rc-text-headingXl-desktop);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* svelte-ignore css-unused-selector */
|
|
93
|
+
.rcb-typography-heading-lg {
|
|
94
|
+
font: var(--rc-text-headingLg-desktop);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* svelte-ignore css-unused-selector */
|
|
98
|
+
.rcb-typography-heading-md {
|
|
99
|
+
font: var(--rc-text-headingMd-desktop);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* svelte-ignore css-unused-selector */
|
|
103
|
+
.rcb-typography-body-base {
|
|
104
|
+
font: var(--rc-text-bodyBase-desktop);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* svelte-ignore css-unused-selector */
|
|
108
|
+
.rcb-typography-body-small {
|
|
109
|
+
font: var(--rc-text-bodySmall-desktop);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* svelte-ignore css-unused-selector */
|
|
113
|
+
.rcb-typography-label-button {
|
|
114
|
+
font: var(--rc-text-labelButton-desktop);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* svelte-ignore css-unused-selector */
|
|
118
|
+
.rcb-typography-label-default {
|
|
119
|
+
font: var(--rc-text-labelDefault-desktop);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* svelte-ignore css-unused-selector */
|
|
123
|
+
.rcb-typography-caption-default {
|
|
124
|
+
font: var(--rc-text-captionDefault-desktop);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* svelte-ignore css-unused-selector */
|
|
128
|
+
.rcb-typography-caption-link {
|
|
129
|
+
font: var(--rc-text-captionLink-desktop);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Snippet } from "svelte";
|
|
2
|
+
type Size = "heading-2xl" | "heading-xl" | "heading-lg" | "heading-md" | "body-base" | "body-small" | "label-button" | "label-default" | "caption-default" | "caption-link";
|
|
3
|
+
type Props = {
|
|
4
|
+
size?: Size;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
};
|
|
7
|
+
declare const Typography: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type Typography = ReturnType<typeof Typography>;
|
|
9
|
+
export default Typography;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type Snippet } from "svelte";
|
|
3
|
+
import { Theme } from "../theme/theme";
|
|
4
|
+
|
|
5
|
+
import type { BrandingAppearance } from "../utils/branding";
|
|
6
|
+
|
|
7
|
+
export let brandingAppearance: BrandingAppearance | null | undefined =
|
|
8
|
+
undefined;
|
|
9
|
+
export let isInElement: boolean = false;
|
|
10
|
+
|
|
11
|
+
// Make styles reactive to changes in brandingAppearance
|
|
12
|
+
$: textStyle = new Theme(brandingAppearance).textStyleVars;
|
|
13
|
+
$: spacingStyle = new Theme(brandingAppearance).spacingStyleVars;
|
|
14
|
+
// $: formStyle = new Theme(brandingAppearance).formStyleVars;
|
|
15
|
+
|
|
16
|
+
$: style = [textStyle, spacingStyle].join("; ");
|
|
17
|
+
|
|
18
|
+
export let children: Snippet;
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div
|
|
22
|
+
class="rcb-ui-container"
|
|
23
|
+
class:fullscreen={!isInElement}
|
|
24
|
+
class:inside={isInElement}
|
|
25
|
+
{style}
|
|
26
|
+
>
|
|
27
|
+
{@render children?.()}
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
.rcb-ui-container {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
inset: 0;
|
|
35
|
+
color-scheme: none;
|
|
36
|
+
line-height: 1.5em;
|
|
37
|
+
font-family:
|
|
38
|
+
-apple-system,
|
|
39
|
+
BlinkMacSystemFont,
|
|
40
|
+
avenir next,
|
|
41
|
+
avenir,
|
|
42
|
+
segoe ui,
|
|
43
|
+
helvetica neue,
|
|
44
|
+
helvetica,
|
|
45
|
+
Cantarell,
|
|
46
|
+
Ubuntu,
|
|
47
|
+
roboto,
|
|
48
|
+
noto,
|
|
49
|
+
arial,
|
|
50
|
+
sans-serif;
|
|
51
|
+
overflow-x: hidden;
|
|
52
|
+
overflow-y: auto;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.rcb-ui-container.fullscreen {
|
|
56
|
+
position: fixed;
|
|
57
|
+
top: 0;
|
|
58
|
+
left: 0;
|
|
59
|
+
right: 0;
|
|
60
|
+
bottom: 0;
|
|
61
|
+
overscroll-behavior: none;
|
|
62
|
+
z-index: 1000001;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.rcb-ui-container.inside {
|
|
66
|
+
position: relative;
|
|
67
|
+
width: 100%;
|
|
68
|
+
z-index: unset;
|
|
69
|
+
height: 100%;
|
|
70
|
+
top: 0;
|
|
71
|
+
left: 0;
|
|
72
|
+
}
|
|
73
|
+
</style>
|