@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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Snippet } from "svelte";
|
|
2
|
+
import type { BrandingAppearance } from "../utils/branding";
|
|
3
|
+
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> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
13
|
+
};
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
15
|
+
}
|
|
16
|
+
declare const Container: $$__sveltets_2_IsomorphicComponent<{
|
|
17
|
+
brandingAppearance?: BrandingAppearance | null | undefined;
|
|
18
|
+
isInElement?: boolean;
|
|
19
|
+
children: Snippet;
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}, {}, string>;
|
|
23
|
+
type Container = InstanceType<typeof Container>;
|
|
24
|
+
export default Container;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
export let style = "";
|
|
5
|
+
export let children: Snippet;
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div id="layout-query-container">
|
|
9
|
+
<div class="rcb-ui-layout" {style}>
|
|
10
|
+
{@render children?.()}
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<style>
|
|
15
|
+
#layout-query-container {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
container-type: size;
|
|
19
|
+
container-name: layout-query-container;
|
|
20
|
+
overflow-y: auto;
|
|
21
|
+
overscroll-behavior: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.rcb-ui-layout {
|
|
25
|
+
width: 100%;
|
|
26
|
+
min-height: 100%;
|
|
27
|
+
display: flex;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
overflow-y: auto;
|
|
31
|
+
overscroll-behavior: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@container layout-query-container (width < 768px) {
|
|
35
|
+
.rcb-ui-layout {
|
|
36
|
+
flex-grow: 1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@container layout-query-container (width >= 768px) {
|
|
41
|
+
.rcb-ui-layout {
|
|
42
|
+
flex-direction: row;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Snippet } from "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: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Layout: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
style?: string;
|
|
17
|
+
children: Snippet;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, string>;
|
|
21
|
+
type Layout = InstanceType<typeof Layout>;
|
|
22
|
+
export default Layout;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Theme } from "../theme/theme";
|
|
3
|
+
import { onMount } from "svelte";
|
|
4
|
+
import SectionLayout from "./section-layout.svelte";
|
|
5
|
+
import type { BrandingAppearance } from "../utils/branding";
|
|
6
|
+
|
|
7
|
+
export let brandingAppearance: BrandingAppearance | null | undefined =
|
|
8
|
+
undefined;
|
|
9
|
+
// Make style reactive to changes in brandingAppearance
|
|
10
|
+
$: style = new Theme(brandingAppearance).formStyleVars;
|
|
11
|
+
|
|
12
|
+
export let body;
|
|
13
|
+
export let header: (() => any) | null = null;
|
|
14
|
+
|
|
15
|
+
let showContent = true;
|
|
16
|
+
// This makes the tests fail
|
|
17
|
+
onMount(() => {
|
|
18
|
+
setTimeout(() => (showContent = true), 10);
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<div class="rcb-ui-main" {style}>
|
|
23
|
+
<SectionLayout show={showContent} layoutStyle="" {header} {body} />
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<style>
|
|
27
|
+
.rcb-ui-main {
|
|
28
|
+
flex: 1;
|
|
29
|
+
display: flex;
|
|
30
|
+
background-color: var(--rc-color-background);
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -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,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;
|