@revenuecat/purchases-ui-js 0.0.20 → 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.
Files changed (62) hide show
  1. package/dist/components/button/Button.svelte +9 -0
  2. package/dist/components/button/ButtonNode.stories.svelte +3 -3
  3. package/dist/components/button/ButtonNode.svelte +7 -5
  4. package/dist/components/footer/Footer.stories.svelte +2 -2
  5. package/dist/components/image/Image.stories.svelte +2 -2
  6. package/dist/components/image/Image.svelte +5 -4
  7. package/dist/components/package/Package.stories.svelte +2 -2
  8. package/dist/components/paywall/Paywall.svelte +3 -8
  9. package/dist/components/paywall/Paywall.svelte.d.ts +3 -2
  10. package/dist/components/paywall/paywall-utils.d.ts +1 -1
  11. package/dist/components/paywall/paywall-utils.js +2 -1
  12. package/dist/components/purchase-button/PurchaseButton.stories.svelte +3 -2
  13. package/dist/components/purchase-button/PurchaseButton.svelte +3 -3
  14. package/dist/components/stack/Stack.stories.svelte +31 -26
  15. package/dist/components/text/TextNode.stories.svelte +6 -5
  16. package/dist/components/text/text-utils.js +3 -2
  17. package/dist/components/timeline/Timeline.stories.svelte +2 -1
  18. package/dist/index.d.ts +2 -1
  19. package/dist/index.js +2 -1
  20. package/dist/stories/fixtures.d.ts +2 -0
  21. package/dist/stories/fixtures.js +36 -0
  22. package/dist/stories/meta-templates.js +7 -3
  23. package/dist/stories/with-layout.d.ts +10 -0
  24. package/dist/stories/with-layout.js +15 -0
  25. package/dist/stories/with-layout.svelte +33 -0
  26. package/dist/stories/with-layout.svelte.d.ts +10 -0
  27. package/dist/ui/atoms/typography.stories.svelte +202 -0
  28. package/dist/ui/atoms/typography.stories.svelte.d.ts +19 -0
  29. package/dist/ui/atoms/typography.svelte +132 -0
  30. package/dist/ui/atoms/typography.svelte.d.ts +9 -0
  31. package/dist/ui/layout/container.svelte +73 -0
  32. package/dist/ui/layout/container.svelte.d.ts +24 -0
  33. package/dist/ui/layout/layout.svelte +45 -0
  34. package/dist/ui/layout/layout.svelte.d.ts +22 -0
  35. package/dist/ui/layout/main-block.svelte +32 -0
  36. package/dist/ui/layout/main-block.svelte.d.ts +23 -0
  37. package/dist/ui/layout/section-layout.svelte +73 -0
  38. package/dist/ui/layout/section-layout.svelte.d.ts +23 -0
  39. package/dist/ui/molecules/button.stories.svelte +45 -0
  40. package/dist/ui/molecules/button.stories.svelte.d.ts +19 -0
  41. package/dist/ui/molecules/button.svelte +94 -0
  42. package/dist/ui/molecules/button.svelte.d.ts +13 -0
  43. package/dist/ui/theme/colors.d.ts +37 -0
  44. package/dist/ui/theme/colors.js +54 -0
  45. package/dist/ui/theme/shapes.d.ts +8 -0
  46. package/dist/ui/theme/shapes.js +13 -0
  47. package/dist/ui/theme/spacing.d.ts +7 -0
  48. package/dist/ui/theme/spacing.js +42 -0
  49. package/dist/ui/theme/text.d.ts +19 -0
  50. package/dist/ui/theme/text.js +173 -0
  51. package/dist/ui/theme/theme.d.ts +15 -0
  52. package/dist/ui/theme/theme.js +38 -0
  53. package/dist/ui/theme/utils.d.ts +37 -0
  54. package/dist/ui/theme/utils.js +191 -0
  55. package/dist/ui/utils/branding.d.ts +16 -0
  56. package/dist/ui/utils/branding.js +1 -0
  57. package/dist/ui/utils/processing-animation.svelte +57 -0
  58. package/dist/ui/utils/processing-animation.svelte.d.ts +20 -0
  59. package/dist/utils/constants.d.ts +4 -0
  60. package/dist/utils/constants.js +3 -0
  61. package/dist/utils/style-utils.js +9 -8
  62. package/package.json +26 -26
@@ -0,0 +1,23 @@
1
+ import type { BrandingAppearance } from "../utils/branding";
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: Props & {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
12
+ };
13
+ z_$$bindings?: Bindings;
14
+ }
15
+ declare const MainBlock: $$__sveltets_2_IsomorphicComponent<{
16
+ brandingAppearance?: BrandingAppearance | null | undefined;
17
+ body: any;
18
+ header?: (() => any) | null;
19
+ }, {
20
+ [evt: string]: CustomEvent<any>;
21
+ }, {}, {}, string>;
22
+ type MainBlock = InstanceType<typeof MainBlock>;
23
+ export default MainBlock;
@@ -0,0 +1,73 @@
1
+ <script lang="ts">
2
+ import { fade } from "svelte/transition";
3
+
4
+ export let show: boolean = true;
5
+ export let layoutStyle: string | undefined = undefined;
6
+
7
+ export let header: (() => any) | null = null;
8
+ export let body: (() => any) | null = null;
9
+ </script>
10
+
11
+ <div class="layout-wrapper-outer" style={layoutStyle}>
12
+ {#if show}
13
+ <div class="layout-wrapper">
14
+ <div
15
+ class="layout-content"
16
+ transition:fade={{ duration: 500, delay: 50 }}
17
+ >
18
+ {#if header}
19
+ {@render header()}
20
+ {/if}
21
+ {#if body}
22
+ {@render body()}
23
+ {/if}
24
+ </div>
25
+ </div>
26
+ {/if}
27
+ </div>
28
+
29
+ <style>
30
+ .layout-wrapper-outer {
31
+ flex: 1;
32
+ display: flex;
33
+ background-color: var(--rc-color-background);
34
+ }
35
+
36
+ .layout-wrapper {
37
+ width: 100%;
38
+ }
39
+
40
+ .layout-content {
41
+ box-sizing: border-box;
42
+ background-color: var(--rc-color-background);
43
+ color: var(--rc-color-grey-text-dark);
44
+ display: flex;
45
+ flex-direction: column;
46
+ padding: var(--rc-spacing-outerPadding-mobile);
47
+ }
48
+
49
+ @container layout-query-container (width >= 768px) {
50
+ .layout-wrapper {
51
+ min-height: 100vh;
52
+ flex-basis: 600px;
53
+ }
54
+
55
+ .layout-content {
56
+ padding: var(--rc-spacing-outerPadding-desktop);
57
+ }
58
+ }
59
+
60
+ @container layout-query-container (width < 768px) {
61
+ .layout-wrapper {
62
+ width: 100%;
63
+ min-width: 300px;
64
+ display: flex;
65
+ flex-grow: 1;
66
+ }
67
+
68
+ .layout-content {
69
+ flex-grow: 1;
70
+ height: 100%;
71
+ }
72
+ }
73
+ </style>
@@ -0,0 +1,23 @@
1
+ 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> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const SectionLayout: $$__sveltets_2_IsomorphicComponent<{
15
+ show?: boolean;
16
+ layoutStyle?: string | undefined;
17
+ header?: (() => any) | null;
18
+ body?: (() => any) | null;
19
+ }, {
20
+ [evt: string]: CustomEvent<any>;
21
+ }, {}, {}, string>;
22
+ type SectionLayout = InstanceType<typeof SectionLayout>;
23
+ export default SectionLayout;
@@ -0,0 +1,45 @@
1
+ <script module>
2
+ import { default as Button } from "./button.svelte";
3
+ import {
4
+ type Args,
5
+ defineMeta,
6
+ setTemplate,
7
+ } from "@storybook/addon-svelte-csf";
8
+ import { withLayout } from "../../stories/with-layout";
9
+
10
+ let { Story } = defineMeta<typeof Button>({
11
+ component: Button,
12
+ title: "Molecules/Button",
13
+ // @ts-expect-error ignore typing of decorator
14
+ decorators: [withLayout],
15
+ argTypes: {
16
+ intent: {
17
+ control: "radio",
18
+ options: ["primary", undefined],
19
+ },
20
+ },
21
+ });
22
+
23
+ const args = {
24
+ intent: "primary" as const,
25
+ disabled: false,
26
+ loading: false,
27
+ onclick: () => {},
28
+ };
29
+ </script>
30
+
31
+ <script lang="ts">
32
+ setTemplate(template);
33
+ </script>
34
+
35
+ {#snippet template({ ...args }: Args<typeof Story>)}
36
+ <Button {...args}>
37
+ {#snippet children()}
38
+ Click Me
39
+ {/snippet}
40
+ </Button>
41
+ {/snippet}
42
+
43
+ <Story name="Default" {args} />
44
+ <Story name="Disabled" args={{ ...args, disabled: true }} />
45
+ <Story name="Loading" args={{ ...args, loading: true }} />
@@ -0,0 +1,19 @@
1
+ import { default as Button } from "./button.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 Button: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Button = InstanceType<typeof Button>;
19
+ export default Button;
@@ -0,0 +1,94 @@
1
+ <script lang="ts">
2
+ import { type Snippet } from "svelte";
3
+ import ProcessingAnimation from "../utils/processing-animation.svelte";
4
+ import Typography from "../atoms/typography.svelte";
5
+
6
+ type Props = {
7
+ onclick?: () => void;
8
+ intent?: "primary";
9
+ disabled?: boolean;
10
+ testId?: string | undefined;
11
+ type?: "reset" | "submit" | "button" | null | undefined;
12
+ loading?: boolean;
13
+ children: Snippet | undefined;
14
+ };
15
+
16
+ const {
17
+ onclick,
18
+ intent = "primary",
19
+ disabled = false,
20
+ testId,
21
+ type,
22
+ loading = false,
23
+ children,
24
+ }: Props = $props();
25
+ </script>
26
+
27
+ <button
28
+ {onclick}
29
+ class={`intent-${intent}`}
30
+ {disabled}
31
+ data-testid={testId}
32
+ {type}
33
+ >
34
+ {#if loading}
35
+ <ProcessingAnimation size="small" />
36
+ {:else}
37
+ <Typography size="body-base">{@render children?.()}</Typography>
38
+ {/if}
39
+ </button>
40
+
41
+ <style>
42
+ button {
43
+ border: none;
44
+ border-radius: var(--rc-shape-input-button-border-radius);
45
+ cursor: pointer;
46
+ height: var(--rc-spacing-inputHeight-mobile);
47
+ color: var(--rc-color-grey-text-dark);
48
+ background-color: var(--rc-color-grey-ui-dark);
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
53
+ -webkit-tap-highlight-color: transparent;
54
+ transition: background-color 0.15s ease-in-out;
55
+ user-select: none;
56
+ }
57
+
58
+ @container layout-query-container (width >= 768px) {
59
+ button {
60
+ height: var(--rc-spacing-inputHeight-desktop);
61
+ }
62
+ }
63
+
64
+ /* focus-visible is triggered only when focused with keyboard/reader */
65
+ button:focus-visible {
66
+ outline: 2px solid var(--rc-color-focus);
67
+ }
68
+
69
+ button.intent-primary {
70
+ background-color: var(--rc-color-primary);
71
+ color: var(--rc-color-primary-text);
72
+ }
73
+
74
+ button:disabled {
75
+ color: var(--rc-color-grey-text-light);
76
+ background-color: var(--rc-color-grey-ui-dark);
77
+ outline: none;
78
+ }
79
+
80
+ button.intent-primary:not(:disabled):hover {
81
+ background-color: var(--rc-color-primary-hover);
82
+ }
83
+
84
+ button.intent-primary:not(:disabled):active,
85
+ button:active {
86
+ background-color: var(--rc-color-primary-pressed);
87
+ outline: none;
88
+ }
89
+
90
+ button.intent-primary:disabled {
91
+ color: var(--rc-color-grey-text-light);
92
+ background-color: var(--rc-color-grey-ui-dark);
93
+ }
94
+ </style>
@@ -0,0 +1,13 @@
1
+ import { type Snippet } from "svelte";
2
+ type Props = {
3
+ onclick?: () => void;
4
+ intent?: "primary";
5
+ disabled?: boolean;
6
+ testId?: string | undefined;
7
+ type?: "reset" | "submit" | "button" | null | undefined;
8
+ loading?: boolean;
9
+ children: Snippet | undefined;
10
+ };
11
+ declare const Button: import("svelte").Component<Props, {}, "">;
12
+ type Button = ReturnType<typeof Button>;
13
+ export default Button;
@@ -0,0 +1,37 @@
1
+ import type { BrandingAppearance } from "../utils/branding";
2
+ /**
3
+ * All those colors get translated in --rc-color-<property_name> css variables.
4
+ * i.e. --rc-color-error or --rc-color-input-background
5
+ */
6
+ export interface Colors {
7
+ error: string;
8
+ warning: string;
9
+ focus: string;
10
+ accent: string;
11
+ primary: string;
12
+ "primary-hover": string;
13
+ "primary-pressed": string;
14
+ "primary-text": string;
15
+ white: string;
16
+ "grey-text-dark": string;
17
+ "grey-text-light": string;
18
+ "grey-ui-dark": string;
19
+ "grey-ui-light": string;
20
+ "input-background": string;
21
+ background: string;
22
+ }
23
+ export declare const DEFAULT_FORM_COLORS: Colors;
24
+ export declare const DEFAULT_INFO_COLORS: Colors;
25
+ /**
26
+ * Mappings from the colors defined above and the colors downloaded from the BrandingAppearance.
27
+ * Bear in mind that font colors are calculated dynamically given the resulting background color.
28
+ */
29
+ export declare const ColorsToBrandingAppearanceMapping: Record<string, keyof BrandingAppearance>;
30
+ export declare const FormColorsToBrandingAppearanceMapping: {
31
+ "input-background": string;
32
+ background: string;
33
+ };
34
+ export declare const InfoColorsToBrandingAppearanceMapping: {
35
+ "input-background": string;
36
+ background: string;
37
+ };
@@ -0,0 +1,54 @@
1
+ export const DEFAULT_FORM_COLORS = {
2
+ error: "#B0171F",
3
+ warning: "#f4e971",
4
+ focus: "#1148B8",
5
+ accent: "#767676",
6
+ primary: "#576CDB",
7
+ "primary-hover": "rgba(87, 108, 219, .8)",
8
+ "primary-pressed": "rgba(87, 108, 219, .9)",
9
+ "primary-text": "#ffffff",
10
+ white: "#ffffff",
11
+ "grey-text-dark": "rgba(0,0,0,1)",
12
+ "grey-text-light": "rgba(0,0,0,0.7)",
13
+ "grey-ui-dark": "rgba(0,0,0,0.3)",
14
+ "grey-ui-light": "rgba(0,0,0,0.1)",
15
+ "input-background": "white",
16
+ background: "white",
17
+ };
18
+ export const DEFAULT_INFO_COLORS = {
19
+ error: "#B0171F",
20
+ warning: "#f4e971",
21
+ focus: "#1148B8",
22
+ accent: "#767676",
23
+ primary: "#576CDB",
24
+ "primary-hover": "rgba(87, 108, 219, .8)",
25
+ "primary-pressed": "rgba(87, 108, 219, .9)",
26
+ "primary-text": "#ffffff",
27
+ white: "#ffffff",
28
+ "grey-text-dark": "rgba(0,0,0,1)",
29
+ "grey-text-light": "rgba(0,0,0,0.7)",
30
+ "grey-ui-dark": "rgba(0,0,0,0.3)",
31
+ "grey-ui-light": "rgba(0,0,0,0.1)",
32
+ "input-background": "white",
33
+ background: "#EFF3FA",
34
+ };
35
+ /**
36
+ * Mappings from the colors defined above and the colors downloaded from the BrandingAppearance.
37
+ * Bear in mind that font colors are calculated dynamically given the resulting background color.
38
+ */
39
+ export const ColorsToBrandingAppearanceMapping = {
40
+ error: "color_error",
41
+ focus: "color_accent",
42
+ accent: "color_accent",
43
+ primary: "color_buttons_primary",
44
+ };
45
+ export const FormColorsToBrandingAppearanceMapping = {
46
+ ...ColorsToBrandingAppearanceMapping,
47
+ "input-background": "color_form_bg",
48
+ background: "color_form_bg",
49
+ };
50
+ export const InfoColorsToBrandingAppearanceMapping = {
51
+ ...ColorsToBrandingAppearanceMapping,
52
+ "input-background": "color_product_info_bg",
53
+ background: "color_product_info_bg",
54
+ };
@@ -0,0 +1,8 @@
1
+ export interface Shape {
2
+ "input-border-radius": string;
3
+ "input-button-border-radius": string;
4
+ }
5
+ export declare const RoundedShape: Shape;
6
+ export declare const RectangularShape: Shape;
7
+ export declare const PillsShape: Shape;
8
+ export declare const DefaultShape: Shape;
@@ -0,0 +1,13 @@
1
+ export const RoundedShape = {
2
+ "input-border-radius": "4px",
3
+ "input-button-border-radius": "8px",
4
+ };
5
+ export const RectangularShape = {
6
+ "input-border-radius": "0px",
7
+ "input-button-border-radius": "0px",
8
+ };
9
+ export const PillsShape = {
10
+ "input-border-radius": "12px",
11
+ "input-button-border-radius": "9999px",
12
+ };
13
+ export const DefaultShape = RoundedShape;
@@ -0,0 +1,7 @@
1
+ export interface Spacing {
2
+ [key: string]: {
3
+ mobile: string;
4
+ desktop: string;
5
+ };
6
+ }
7
+ export declare const DEFAULT_SPACING: Spacing;
@@ -0,0 +1,42 @@
1
+ export const DEFAULT_SPACING = {
2
+ outerPadding: {
3
+ mobile: "clamp(1.3125rem, 5.6vw, 1.5rem)",
4
+ desktop: "clamp(1.5rem, 9.44vw, 5rem)",
5
+ },
6
+ outerPaddingSmall: {
7
+ mobile: "clamp(0.75rem, 4.2vw, 1rem)",
8
+ desktop: "clamp(1.5rem, 9.44vw, 5rem)",
9
+ },
10
+ gapSmall: {
11
+ mobile: "0.25rem",
12
+ desktop: "0.375rem",
13
+ },
14
+ gapMedium: {
15
+ mobile: "0.5rem",
16
+ desktop: "0.75rem",
17
+ },
18
+ gapLarge: {
19
+ mobile: "0.75rem",
20
+ desktop: "0.75rem",
21
+ },
22
+ gapXLarge: {
23
+ mobile: "1rem",
24
+ desktop: "1.5rem",
25
+ },
26
+ gapXXLarge: {
27
+ mobile: "1.25rem",
28
+ desktop: "2.25rem",
29
+ },
30
+ gapXXXLarge: {
31
+ mobile: "2.25rem",
32
+ desktop: "4.5rem",
33
+ },
34
+ inputHeight: {
35
+ mobile: "3rem",
36
+ desktop: "3rem",
37
+ },
38
+ gapStripeElement: {
39
+ mobile: "0.70rem",
40
+ desktop: "1rem",
41
+ },
42
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * All text styles get translated into --rc-text-<property_name> CSS variables.
3
+ * i.e., --rc-text-title1-font-size or --rc-text-title1-line-height
4
+ */
5
+ export interface TextStyle {
6
+ fontSize: string;
7
+ lineHeight: string;
8
+ fontWeight: string;
9
+ letterSpacing?: string;
10
+ }
11
+ export type ScreenType = "mobile" | "desktop";
12
+ export type ScreenTextStyle = Record<TextStyleKey, TextStyle>;
13
+ export type TextStyleKey = "heading2xl" | "headingXl" | "headingLg" | "headingMd" | "bodyBase" | "bodySmall" | "labelButton" | "labelDefault" | "captionDefault" | "captionLink";
14
+ export type TextStyles = Record<TextStyleKey, {
15
+ mobile: TextStyle;
16
+ desktop: TextStyle;
17
+ }>;
18
+ export declare const DEFAULT_FONT_FAMILY = "-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif";
19
+ export declare const DEFAULT_TEXT_STYLES: TextStyles;
@@ -0,0 +1,173 @@
1
+ /**
2
+ * All text styles get translated into --rc-text-<property_name> CSS variables.
3
+ * i.e., --rc-text-title1-font-size or --rc-text-title1-line-height
4
+ */
5
+ export const DEFAULT_FONT_FAMILY = "-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif";
6
+ const FONT_WEIGHTS = {
7
+ regular: "400",
8
+ medium: "500",
9
+ semibold: "600",
10
+ };
11
+ const FONT_SIZES = {
12
+ "10": "10px",
13
+ "12": "12px",
14
+ "14": "14px",
15
+ "16": "16px",
16
+ "18": "18px",
17
+ "20": "20px",
18
+ "24": "24px",
19
+ "28": "28px",
20
+ "32": "32px",
21
+ "36": "36px",
22
+ "40": "40px",
23
+ };
24
+ const LINE_HEIGHTS = {
25
+ "120": "120%",
26
+ "130": "130%",
27
+ "140": "140%",
28
+ };
29
+ const LETTER_SPACING = {
30
+ tight: "0.20%",
31
+ regular: "0",
32
+ loose: "0.20%",
33
+ };
34
+ const MOBILE_TEXT_STYLES = {
35
+ heading2xl: {
36
+ fontSize: FONT_SIZES["28"],
37
+ lineHeight: LINE_HEIGHTS["120"],
38
+ fontWeight: FONT_WEIGHTS["semibold"],
39
+ letterSpacing: LETTER_SPACING["tight"],
40
+ },
41
+ headingXl: {
42
+ fontSize: FONT_SIZES["24"],
43
+ lineHeight: LINE_HEIGHTS["130"],
44
+ fontWeight: FONT_WEIGHTS["semibold"],
45
+ letterSpacing: LETTER_SPACING["regular"],
46
+ },
47
+ headingLg: {
48
+ fontSize: "20px",
49
+ lineHeight: LINE_HEIGHTS["130"],
50
+ fontWeight: FONT_WEIGHTS["semibold"],
51
+ letterSpacing: LETTER_SPACING["regular"],
52
+ },
53
+ headingMd: {
54
+ fontSize: "16px",
55
+ lineHeight: LINE_HEIGHTS["140"],
56
+ fontWeight: FONT_WEIGHTS["medium"],
57
+ letterSpacing: LETTER_SPACING["regular"],
58
+ },
59
+ bodyBase: {
60
+ fontSize: FONT_SIZES["16"],
61
+ lineHeight: LINE_HEIGHTS["140"],
62
+ fontWeight: FONT_WEIGHTS["regular"],
63
+ letterSpacing: LETTER_SPACING["regular"],
64
+ },
65
+ bodySmall: {
66
+ fontSize: FONT_SIZES["14"],
67
+ lineHeight: LINE_HEIGHTS["140"],
68
+ fontWeight: FONT_WEIGHTS["regular"],
69
+ letterSpacing: LETTER_SPACING["regular"],
70
+ },
71
+ labelButton: {
72
+ fontSize: FONT_SIZES["16"],
73
+ lineHeight: LINE_HEIGHTS["140"],
74
+ fontWeight: FONT_WEIGHTS["regular"],
75
+ letterSpacing: LETTER_SPACING["tight"],
76
+ },
77
+ labelDefault: {
78
+ fontSize: FONT_SIZES["14"],
79
+ lineHeight: LINE_HEIGHTS["140"],
80
+ fontWeight: FONT_WEIGHTS["regular"],
81
+ letterSpacing: LETTER_SPACING["tight"],
82
+ },
83
+ captionDefault: {
84
+ fontSize: FONT_SIZES["12"],
85
+ lineHeight: LINE_HEIGHTS["140"],
86
+ fontWeight: FONT_WEIGHTS["regular"],
87
+ letterSpacing: LETTER_SPACING["regular"],
88
+ },
89
+ captionLink: {
90
+ fontSize: FONT_SIZES["12"],
91
+ lineHeight: LINE_HEIGHTS["140"],
92
+ fontWeight: FONT_WEIGHTS["regular"],
93
+ letterSpacing: LETTER_SPACING["regular"],
94
+ },
95
+ };
96
+ const DESKTOP_TEXT_STYLES = {
97
+ heading2xl: {
98
+ ...MOBILE_TEXT_STYLES.heading2xl,
99
+ fontSize: FONT_SIZES["36"],
100
+ },
101
+ headingXl: {
102
+ ...MOBILE_TEXT_STYLES.headingXl,
103
+ fontSize: FONT_SIZES["32"],
104
+ },
105
+ headingLg: {
106
+ ...MOBILE_TEXT_STYLES.headingLg,
107
+ fontSize: FONT_SIZES["24"],
108
+ },
109
+ headingMd: {
110
+ ...MOBILE_TEXT_STYLES.headingMd,
111
+ fontSize: FONT_SIZES["18"],
112
+ },
113
+ bodyBase: {
114
+ ...MOBILE_TEXT_STYLES.bodyBase,
115
+ },
116
+ bodySmall: {
117
+ ...MOBILE_TEXT_STYLES.bodySmall,
118
+ },
119
+ labelButton: {
120
+ ...MOBILE_TEXT_STYLES.labelButton,
121
+ },
122
+ labelDefault: {
123
+ ...MOBILE_TEXT_STYLES.labelDefault,
124
+ },
125
+ captionDefault: {
126
+ ...MOBILE_TEXT_STYLES.captionDefault,
127
+ },
128
+ captionLink: {
129
+ ...MOBILE_TEXT_STYLES.captionLink,
130
+ },
131
+ };
132
+ export const DEFAULT_TEXT_STYLES = {
133
+ heading2xl: {
134
+ mobile: MOBILE_TEXT_STYLES.heading2xl,
135
+ desktop: DESKTOP_TEXT_STYLES.heading2xl,
136
+ },
137
+ headingXl: {
138
+ desktop: DESKTOP_TEXT_STYLES.headingXl,
139
+ mobile: MOBILE_TEXT_STYLES.headingXl,
140
+ },
141
+ headingLg: {
142
+ desktop: DESKTOP_TEXT_STYLES.headingLg,
143
+ mobile: MOBILE_TEXT_STYLES.headingLg,
144
+ },
145
+ headingMd: {
146
+ desktop: DESKTOP_TEXT_STYLES.headingMd,
147
+ mobile: MOBILE_TEXT_STYLES.headingMd,
148
+ },
149
+ bodyBase: {
150
+ desktop: DESKTOP_TEXT_STYLES.bodyBase,
151
+ mobile: MOBILE_TEXT_STYLES.bodyBase,
152
+ },
153
+ bodySmall: {
154
+ desktop: DESKTOP_TEXT_STYLES.bodySmall,
155
+ mobile: MOBILE_TEXT_STYLES.bodySmall,
156
+ },
157
+ labelButton: {
158
+ desktop: DESKTOP_TEXT_STYLES.labelButton,
159
+ mobile: MOBILE_TEXT_STYLES.labelButton,
160
+ },
161
+ labelDefault: {
162
+ desktop: DESKTOP_TEXT_STYLES.labelDefault,
163
+ mobile: MOBILE_TEXT_STYLES.labelDefault,
164
+ },
165
+ captionDefault: {
166
+ desktop: DESKTOP_TEXT_STYLES.captionDefault,
167
+ mobile: MOBILE_TEXT_STYLES.captionDefault,
168
+ },
169
+ captionLink: {
170
+ desktop: DESKTOP_TEXT_STYLES.captionLink,
171
+ mobile: MOBILE_TEXT_STYLES.captionLink,
172
+ },
173
+ };
@@ -0,0 +1,15 @@
1
+ import type { Shape } from "./shapes";
2
+ import type { Colors } from "./colors";
3
+ import type { BrandingAppearance } from "../utils/branding";
4
+ export declare class Theme {
5
+ private readonly brandingAppearance;
6
+ constructor(brandingAppearance?: BrandingAppearance | null | undefined);
7
+ get shape(): Shape;
8
+ get formColors(): Colors;
9
+ get formStyleVars(): string;
10
+ get productInfoStyleVars(): string;
11
+ get spacing(): import("./spacing").Spacing;
12
+ get textStyles(): import("./text").TextStyles;
13
+ get textStyleVars(): string;
14
+ get spacingStyleVars(): string;
15
+ }