@revenuecat/purchases-ui-js 2.0.1 → 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 -108
- package/dist/components/button/ButtonNode.svelte +3 -31
- package/dist/components/footer/Footer.stories.svelte +112 -106
- package/dist/components/footer/Footer.svelte +10 -6
- 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 -199
- package/dist/components/image/Image.svelte +152 -137
- 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 +12 -27
- package/dist/components/package/Package.svelte +10 -44
- package/dist/components/paywall/Node.svelte +45 -43
- package/dist/components/paywall/Node.svelte.d.ts +10 -12
- package/dist/components/paywall/Paywall.stories.svelte +36 -140
- package/dist/components/paywall/Paywall.svelte +38 -20
- 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 -29
- package/dist/components/purchase-button/PurchaseButton.svelte +2 -34
- package/dist/components/stack/Stack.stories.svelte +2364 -1020
- package/dist/components/stack/Stack.svelte +108 -151
- 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 -257
- 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 -48
- package/dist/components/text/TextNode.svelte +25 -37
- 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 -256
- package/dist/components/timeline/Timeline.svelte +42 -30
- 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 -114
- package/dist/data/entities.d.ts +23 -169
- package/dist/index.d.ts +11 -10
- package/dist/index.js +11 -10
- package/dist/stores/color-mode.d.ts +1 -1
- package/dist/stores/localization.d.ts +1 -1
- package/dist/stores/localization.js +3 -2
- package/dist/stores/paywall.d.ts +7 -3
- package/dist/stores/selected.d.ts +5 -0
- package/dist/stores/selected.js +12 -0
- package/dist/stores/variables.d.ts +2 -3
- 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 +6 -4
- package/dist/stories/fixtures.js +6241 -5485
- package/dist/stories/localization-decorator.js +1 -1
- package/dist/stories/paywall-decorator.js +8 -1
- 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/stories/with-layout.svelte +3 -3
- 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/colors.d.ts +4 -4
- package/dist/types/component.d.ts +10 -0
- package/dist/types/component.js +1 -0
- package/dist/types/components/button.d.ts +5 -2
- package/dist/types/components/footer.d.ts +3 -2
- 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 +3 -2
- package/dist/types/components/purchase-button.d.ts +3 -2
- 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 +3 -29
- package/dist/ui/atoms/typography.stories.svelte.d.ts +1 -1
- package/dist/ui/layout/main-block.svelte +2 -2
- package/dist/ui/molecules/button.stories.svelte +5 -10
- package/dist/ui/molecules/button.svelte +1 -1
- 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/theme.d.ts +2 -2
- package/dist/ui/theme/theme.js +2 -2
- package/dist/ui/theme/utils.d.ts +2 -12
- 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 +35 -314
- 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 +1415 -987
- 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/data/state.d.ts +0 -4
- package/dist/stories/meta-templates.d.ts +0 -12
- package/dist/stories/meta-templates.js +0 -155
- /package/dist/{data/state.js → types/base.js} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Icon from "./Icon.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 Icon: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Icon = InstanceType<typeof Icon>;
|
|
19
|
+
export default Icon;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getColorModeContext } from "../../stores/color-mode";
|
|
3
|
+
import { getSelectedStateContext } from "../../stores/selected";
|
|
4
|
+
import type { IconProps } from "../../types/components/icon";
|
|
5
|
+
import {
|
|
6
|
+
css,
|
|
7
|
+
mapBorder,
|
|
8
|
+
mapBorderRadius,
|
|
9
|
+
mapColor,
|
|
10
|
+
mapShadow,
|
|
11
|
+
mapSize,
|
|
12
|
+
mapSpacing,
|
|
13
|
+
} from "../../utils/base-utils";
|
|
14
|
+
import { getActiveStateProps } from "../../utils/style-utils";
|
|
15
|
+
|
|
16
|
+
const props: IconProps = $props();
|
|
17
|
+
const selectedState = getSelectedStateContext();
|
|
18
|
+
const {
|
|
19
|
+
base_url,
|
|
20
|
+
formats,
|
|
21
|
+
size,
|
|
22
|
+
margin,
|
|
23
|
+
padding,
|
|
24
|
+
color,
|
|
25
|
+
icon_background: background,
|
|
26
|
+
} = $derived.by(() => {
|
|
27
|
+
return {
|
|
28
|
+
...props,
|
|
29
|
+
...getActiveStateProps($selectedState, props.overrides),
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const getColorMode = getColorModeContext();
|
|
34
|
+
const colorMode = $derived(getColorMode());
|
|
35
|
+
|
|
36
|
+
const container = $derived(
|
|
37
|
+
css({
|
|
38
|
+
width: mapSize(size.width),
|
|
39
|
+
height: mapSize(size.height),
|
|
40
|
+
margin: mapSpacing(margin),
|
|
41
|
+
padding: mapSpacing(padding),
|
|
42
|
+
"background-color": mapColor(colorMode, background?.color),
|
|
43
|
+
border: mapBorder(colorMode, background?.border),
|
|
44
|
+
"border-radius": mapBorderRadius(background?.shape),
|
|
45
|
+
"box-shadow": mapShadow(colorMode, background?.shadow),
|
|
46
|
+
flex: "0 0 auto",
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const webpUrl = $derived(`${base_url}/${formats.webp}`);
|
|
51
|
+
const icon = $derived(
|
|
52
|
+
css({
|
|
53
|
+
width: "100%",
|
|
54
|
+
height: "100%",
|
|
55
|
+
position: "relative",
|
|
56
|
+
"z-index": 1,
|
|
57
|
+
overflow: "hidden",
|
|
58
|
+
"background-color": mapColor(colorMode, color),
|
|
59
|
+
"mask-image": `url(${webpUrl})`,
|
|
60
|
+
"webkit-mask-image": `url(${webpUrl})`,
|
|
61
|
+
"mask-size": "contain",
|
|
62
|
+
"webkit-mask-size": "contain",
|
|
63
|
+
"mask-position": "center",
|
|
64
|
+
"webkit-mask-position": "center",
|
|
65
|
+
"mask-repeat": "no-repeat",
|
|
66
|
+
"webkit-mask-repeat": "no-repeat",
|
|
67
|
+
}),
|
|
68
|
+
);
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<div style={container}>
|
|
72
|
+
<div style={icon}></div>
|
|
73
|
+
</div>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ImageProps } from "../../types/components/image";
|
|
3
|
+
|
|
4
|
+
interface ClipPathProps {
|
|
5
|
+
shape: ImageProps["mask_shape"];
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { shape, width, height }: ClipPathProps = $props();
|
|
11
|
+
|
|
12
|
+
const [topLeft, topRight, bottomRight, bottomLeft] = $derived.by(() => {
|
|
13
|
+
if (shape?.type !== "rectangle") {
|
|
14
|
+
return [0, 0, 0, 0];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const { corners } = shape;
|
|
18
|
+
return [
|
|
19
|
+
corners?.top_leading ?? 0,
|
|
20
|
+
corners?.top_trailing ?? 0,
|
|
21
|
+
corners?.bottom_trailing ?? 0,
|
|
22
|
+
corners?.bottom_leading ?? 0,
|
|
23
|
+
];
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
{#if shape?.type === "circle"}
|
|
28
|
+
<circle cx={width / 2} cy={height / 2} r={Math.min(width, height) / 2} />
|
|
29
|
+
{/if}
|
|
30
|
+
|
|
31
|
+
{#if shape?.type === "concave"}
|
|
32
|
+
<path
|
|
33
|
+
d={`M 0 0 L ${width} 0 L ${width} ${height} Q ${width / 2} ${height - 54} 0 ${height} Z`}
|
|
34
|
+
/>
|
|
35
|
+
{/if}
|
|
36
|
+
{#if shape?.type === "convex"}
|
|
37
|
+
<path
|
|
38
|
+
d={`M 0 0 L ${width} 0 L ${width} ${height - 27} Q ${width / 2} ${height + 27} 0 ${height - 27} Z`}
|
|
39
|
+
/>
|
|
40
|
+
{/if}
|
|
41
|
+
|
|
42
|
+
{#if shape?.type === "rectangle" || shape?.type === undefined}
|
|
43
|
+
<path
|
|
44
|
+
d={`M ${topLeft} 0 H ${width - topRight} A ${topRight} ${topRight} 0 0 1 ${width} ${topRight}
|
|
45
|
+
V ${height - bottomRight} A ${bottomRight} ${bottomRight} 0 0 1 ${width - bottomRight} ${height}
|
|
46
|
+
H ${bottomLeft} A ${bottomLeft} ${bottomLeft} 0 0 1 0 ${height - bottomLeft}
|
|
47
|
+
V ${topLeft} A ${topLeft} ${topLeft} 0 0 1 ${topLeft} 0 Z`}
|
|
48
|
+
/>
|
|
49
|
+
{/if}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ImageProps } from "../../types/components/image";
|
|
2
|
+
interface ClipPathProps {
|
|
3
|
+
shape: ImageProps["mask_shape"];
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
declare const ClipPath: import("svelte").Component<ClipPathProps, {}, "">;
|
|
8
|
+
type ClipPath = ReturnType<typeof ClipPath>;
|
|
9
|
+
export default ClipPath;
|
|
@@ -1,91 +1,55 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import Image from "./Image.svelte";
|
|
3
|
-
import
|
|
3
|
+
import { componentDecorator } from "../../stories/component-decorator";
|
|
4
4
|
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
5
5
|
|
|
6
|
-
const purchaseState: PurchaseState = {};
|
|
7
|
-
|
|
8
6
|
const { Story } = defineMeta({
|
|
9
7
|
title: "Components/Image",
|
|
10
8
|
component: Image,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
9
|
+
decorators: [componentDecorator()],
|
|
10
|
+
args: {
|
|
11
|
+
type: "image",
|
|
12
|
+
id: "image",
|
|
13
|
+
name: "Image",
|
|
14
|
+
fit_mode: "fill",
|
|
18
15
|
size: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
description: "Fit mode for the image",
|
|
16
|
+
width: { type: "fill" },
|
|
17
|
+
height: { type: "fill" },
|
|
18
|
+
},
|
|
19
|
+
source: {
|
|
20
|
+
dark: null,
|
|
21
|
+
light: {
|
|
22
|
+
width: 600,
|
|
23
|
+
height: 400,
|
|
24
|
+
original: "https://placehold.co/600x400",
|
|
25
|
+
heic: "https://placehold.co/600x400",
|
|
26
|
+
heic_low_res: "https://placehold.co/600x400",
|
|
27
|
+
webp: "https://placehold.co/600x400",
|
|
28
|
+
webp_low_res: "https://placehold.co/600x400",
|
|
29
|
+
},
|
|
34
30
|
},
|
|
35
31
|
},
|
|
36
32
|
});
|
|
37
33
|
</script>
|
|
38
34
|
|
|
39
|
-
<!-- Rectangle story -->
|
|
40
35
|
<Story
|
|
41
36
|
name="Rectangle"
|
|
42
37
|
args={{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
source: {
|
|
51
|
-
light: {
|
|
52
|
-
width: 600,
|
|
53
|
-
height: 400,
|
|
54
|
-
original: "https://placehold.co/600x400",
|
|
55
|
-
heic: "https://placehold.co/600x400",
|
|
56
|
-
heic_low_res: "https://placehold.co/600x400",
|
|
57
|
-
webp: "https://placehold.co/600x400",
|
|
58
|
-
webp_low_res: "https://placehold.co/600x400",
|
|
38
|
+
mask_shape: {
|
|
39
|
+
type: "rectangle",
|
|
40
|
+
corners: {
|
|
41
|
+
top_leading: 0,
|
|
42
|
+
top_trailing: 0,
|
|
43
|
+
bottom_leading: 0,
|
|
44
|
+
bottom_trailing: 0,
|
|
59
45
|
},
|
|
60
|
-
dark: null,
|
|
61
46
|
},
|
|
62
|
-
mask_shape: { type: "rectangle" },
|
|
63
47
|
}}
|
|
64
48
|
/>
|
|
65
49
|
|
|
66
|
-
<!-- Rounded Rectangle story -->
|
|
67
50
|
<Story
|
|
68
51
|
name="Rounded Rectangle"
|
|
69
52
|
args={{
|
|
70
|
-
purchaseState,
|
|
71
|
-
id: "example-id",
|
|
72
|
-
fit_mode: "fit",
|
|
73
|
-
size: {
|
|
74
|
-
width: { type: "fill" },
|
|
75
|
-
height: { type: "fill" },
|
|
76
|
-
},
|
|
77
|
-
source: {
|
|
78
|
-
light: {
|
|
79
|
-
width: 600,
|
|
80
|
-
height: 400,
|
|
81
|
-
original: "https://placehold.co/600x400",
|
|
82
|
-
heic: "https://placehold.co/600x400",
|
|
83
|
-
heic_low_res: "https://placehold.co/600x400",
|
|
84
|
-
webp: "https://placehold.co/600x400",
|
|
85
|
-
webp_low_res: "https://placehold.co/600x400",
|
|
86
|
-
},
|
|
87
|
-
dark: null,
|
|
88
|
-
},
|
|
89
53
|
mask_shape: {
|
|
90
54
|
type: "rectangle",
|
|
91
55
|
corners: {
|
|
@@ -97,166 +61,63 @@
|
|
|
97
61
|
},
|
|
98
62
|
}}
|
|
99
63
|
/>
|
|
100
|
-
|
|
64
|
+
|
|
101
65
|
<Story
|
|
102
66
|
name="Circle"
|
|
103
67
|
args={{
|
|
104
|
-
purchaseState,
|
|
105
|
-
id: "example-id",
|
|
106
|
-
fit_mode: "fit",
|
|
107
|
-
size: {
|
|
108
|
-
width: { type: "fill" },
|
|
109
|
-
height: { type: "fill" },
|
|
110
|
-
},
|
|
111
|
-
source: {
|
|
112
|
-
light: {
|
|
113
|
-
width: 600,
|
|
114
|
-
height: 400,
|
|
115
|
-
original: "https://placehold.co/600x400",
|
|
116
|
-
heic: "https://placehold.co/600x400",
|
|
117
|
-
heic_low_res: "https://placehold.co/600x400",
|
|
118
|
-
webp: "https://placehold.co/600x400",
|
|
119
|
-
webp_low_res: "https://placehold.co/600x400",
|
|
120
|
-
},
|
|
121
|
-
dark: null,
|
|
122
|
-
},
|
|
123
68
|
mask_shape: { type: "circle" },
|
|
124
69
|
}}
|
|
125
70
|
/>
|
|
126
|
-
|
|
71
|
+
|
|
127
72
|
<Story
|
|
128
73
|
name="Concave"
|
|
129
74
|
args={{
|
|
130
|
-
purchaseState,
|
|
131
|
-
id: "example-id",
|
|
132
|
-
fit_mode: "fit",
|
|
133
|
-
size: {
|
|
134
|
-
width: { type: "fill" },
|
|
135
|
-
height: { type: "fill" },
|
|
136
|
-
},
|
|
137
|
-
source: {
|
|
138
|
-
light: {
|
|
139
|
-
width: 600,
|
|
140
|
-
height: 400,
|
|
141
|
-
original: "https://placehold.co/600x400",
|
|
142
|
-
heic: "https://placehold.co/600x400",
|
|
143
|
-
heic_low_res: "https://placehold.co/600x400",
|
|
144
|
-
webp: "https://placehold.co/600x400",
|
|
145
|
-
webp_low_res: "https://placehold.co/600x400",
|
|
146
|
-
},
|
|
147
|
-
dark: null,
|
|
148
|
-
},
|
|
149
75
|
mask_shape: { type: "concave" },
|
|
150
76
|
}}
|
|
151
77
|
/>
|
|
152
|
-
|
|
78
|
+
|
|
153
79
|
<Story
|
|
154
80
|
name="Convex"
|
|
155
81
|
args={{
|
|
156
|
-
purchaseState,
|
|
157
|
-
id: "example-id",
|
|
158
|
-
fit_mode: "fit",
|
|
159
|
-
size: {
|
|
160
|
-
width: { type: "fill" },
|
|
161
|
-
height: { type: "fill" },
|
|
162
|
-
},
|
|
163
|
-
source: {
|
|
164
|
-
light: {
|
|
165
|
-
width: 600,
|
|
166
|
-
height: 400,
|
|
167
|
-
original: "https://placehold.co/600x400",
|
|
168
|
-
heic: "https://placehold.co/600x400",
|
|
169
|
-
heic_low_res: "https://placehold.co/600x400",
|
|
170
|
-
webp: "https://placehold.co/600x400",
|
|
171
|
-
webp_low_res: "https://placehold.co/600x400",
|
|
172
|
-
},
|
|
173
|
-
dark: null,
|
|
174
|
-
},
|
|
175
82
|
mask_shape: { type: "convex" },
|
|
176
83
|
}}
|
|
177
84
|
/>
|
|
178
|
-
|
|
85
|
+
|
|
179
86
|
<Story
|
|
180
87
|
name="Overlay Radial Gradient"
|
|
181
88
|
args={{
|
|
182
|
-
purchaseState,
|
|
183
|
-
id: "example-id",
|
|
184
|
-
fit_mode: "fit",
|
|
185
|
-
size: {
|
|
186
|
-
width: { type: "fill" },
|
|
187
|
-
height: { type: "fill" },
|
|
188
|
-
},
|
|
189
|
-
source: {
|
|
190
|
-
light: {
|
|
191
|
-
width: 600,
|
|
192
|
-
height: 400,
|
|
193
|
-
original: "https://placehold.co/600x400",
|
|
194
|
-
heic: "https://placehold.co/600x400",
|
|
195
|
-
heic_low_res: "https://placehold.co/600x400",
|
|
196
|
-
webp: "https://placehold.co/600x400",
|
|
197
|
-
webp_low_res: "https://placehold.co/600x400",
|
|
198
|
-
},
|
|
199
|
-
dark: null,
|
|
200
|
-
},
|
|
201
89
|
color_overlay: {
|
|
202
|
-
dark: {
|
|
203
|
-
type: "hex",
|
|
204
|
-
value: "#000000FF",
|
|
205
|
-
},
|
|
206
90
|
light: {
|
|
91
|
+
type: "radial",
|
|
207
92
|
points: [
|
|
208
93
|
{
|
|
209
|
-
color: "#020024ff",
|
|
210
94
|
percent: 0,
|
|
95
|
+
color: "#020024ff",
|
|
211
96
|
},
|
|
212
97
|
{
|
|
213
|
-
color: "#00d4ff00",
|
|
214
98
|
percent: 100,
|
|
99
|
+
color: "#00d4ff00",
|
|
215
100
|
},
|
|
216
101
|
],
|
|
217
|
-
type: "radial",
|
|
218
102
|
},
|
|
219
103
|
},
|
|
220
104
|
}}
|
|
221
105
|
/>
|
|
222
|
-
|
|
106
|
+
|
|
223
107
|
<Story
|
|
224
108
|
name="Overlay Linear Gradient"
|
|
225
109
|
args={{
|
|
226
|
-
purchaseState,
|
|
227
|
-
id: "example-id",
|
|
228
|
-
fit_mode: "fit",
|
|
229
|
-
size: {
|
|
230
|
-
width: { type: "fill" },
|
|
231
|
-
height: { type: "fill" },
|
|
232
|
-
},
|
|
233
|
-
source: {
|
|
234
|
-
light: {
|
|
235
|
-
width: 600,
|
|
236
|
-
height: 400,
|
|
237
|
-
original: "https://placehold.co/600x400",
|
|
238
|
-
heic: "https://placehold.co/600x400",
|
|
239
|
-
heic_low_res: "https://placehold.co/600x400",
|
|
240
|
-
webp: "https://placehold.co/600x400",
|
|
241
|
-
webp_low_res: "https://placehold.co/600x400",
|
|
242
|
-
},
|
|
243
|
-
dark: null,
|
|
244
|
-
},
|
|
245
110
|
color_overlay: {
|
|
246
|
-
dark: {
|
|
247
|
-
type: "hex",
|
|
248
|
-
value: "#000000FF",
|
|
249
|
-
},
|
|
250
111
|
light: {
|
|
251
112
|
degrees: 180,
|
|
252
113
|
points: [
|
|
253
114
|
{
|
|
254
|
-
color: "#020024ff",
|
|
255
115
|
percent: 0,
|
|
116
|
+
color: "#020024ff",
|
|
256
117
|
},
|
|
257
118
|
{
|
|
258
|
-
color: "#00d4ff00",
|
|
259
119
|
percent: 100,
|
|
120
|
+
color: "#00d4ff00",
|
|
260
121
|
},
|
|
261
122
|
],
|
|
262
123
|
type: "linear",
|
|
@@ -264,37 +125,60 @@
|
|
|
264
125
|
},
|
|
265
126
|
}}
|
|
266
127
|
/>
|
|
267
|
-
|
|
128
|
+
|
|
268
129
|
<Story
|
|
269
130
|
name="Overlay Solid"
|
|
270
131
|
args={{
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
132
|
+
color_overlay: {
|
|
133
|
+
light: {
|
|
134
|
+
type: "hex",
|
|
135
|
+
value: "#e7c00069",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
}}
|
|
139
|
+
/>
|
|
140
|
+
|
|
141
|
+
<Story
|
|
142
|
+
name="Complex"
|
|
143
|
+
args={{
|
|
274
144
|
size: {
|
|
275
|
-
width: { type: "
|
|
276
|
-
height: { type: "
|
|
145
|
+
width: { type: "fixed", value: 128 },
|
|
146
|
+
height: { type: "fixed", value: 128 },
|
|
277
147
|
},
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
webp: "https://placehold.co/600x400",
|
|
286
|
-
webp_low_res: "https://placehold.co/600x400",
|
|
148
|
+
mask_shape: {
|
|
149
|
+
type: "rectangle",
|
|
150
|
+
corners: {
|
|
151
|
+
top_leading: 0,
|
|
152
|
+
top_trailing: 16,
|
|
153
|
+
bottom_trailing: 32,
|
|
154
|
+
bottom_leading: 64,
|
|
287
155
|
},
|
|
288
|
-
dark: null,
|
|
289
156
|
},
|
|
157
|
+
fit_mode: "fill",
|
|
158
|
+
padding: { top: 0, bottom: 0, leading: 0, trailing: 0 },
|
|
159
|
+
margin: { top: 0, bottom: 0, leading: 0, trailing: 0 },
|
|
290
160
|
color_overlay: {
|
|
291
|
-
dark: {
|
|
292
|
-
type: "hex",
|
|
293
|
-
value: "#000000FF",
|
|
294
|
-
},
|
|
295
161
|
light: {
|
|
296
|
-
type: "
|
|
297
|
-
|
|
162
|
+
type: "linear",
|
|
163
|
+
degrees: 180,
|
|
164
|
+
points: [
|
|
165
|
+
{ percent: 0, color: "#ff000080" },
|
|
166
|
+
{ percent: 100, color: "#ff00ff00" },
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
border: {
|
|
171
|
+
width: 3,
|
|
172
|
+
color: {
|
|
173
|
+
light: { type: "hex", value: "#00ff0080" },
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
shadow: {
|
|
177
|
+
x: 0,
|
|
178
|
+
y: 0,
|
|
179
|
+
radius: 16,
|
|
180
|
+
color: {
|
|
181
|
+
light: { type: "hex", value: "#0000ff80" },
|
|
298
182
|
},
|
|
299
183
|
},
|
|
300
184
|
}}
|