@revenuecat/purchases-ui-js 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/components/button/ButtonNode.stories.svelte +66 -102
  2. package/dist/components/button/ButtonNode.svelte +2 -27
  3. package/dist/components/footer/Footer.stories.svelte +112 -102
  4. package/dist/components/footer/Footer.svelte +8 -4
  5. package/dist/components/icon/Icon.stories.svelte +100 -0
  6. package/dist/components/icon/Icon.stories.svelte.d.ts +19 -0
  7. package/dist/components/icon/Icon.svelte +73 -0
  8. package/dist/components/icon/Icon.svelte.d.ts +4 -0
  9. package/dist/components/image/ClipPath.svelte +49 -0
  10. package/dist/components/image/ClipPath.svelte.d.ts +9 -0
  11. package/dist/components/image/Image.stories.svelte +83 -188
  12. package/dist/components/image/Image.svelte +152 -136
  13. package/dist/components/image/Image.svelte.d.ts +1 -1
  14. package/dist/components/image/Overlay.svelte +36 -0
  15. package/dist/components/image/Overlay.svelte.d.ts +8 -0
  16. package/dist/components/package/Package.stories.svelte +10 -21
  17. package/dist/components/package/Package.svelte +8 -35
  18. package/dist/components/paywall/Node.svelte +27 -28
  19. package/dist/components/paywall/Node.svelte.d.ts +3 -6
  20. package/dist/components/paywall/Paywall.stories.svelte +36 -140
  21. package/dist/components/paywall/Paywall.svelte +22 -6
  22. package/dist/components/paywall/Paywall.svelte.d.ts +3 -2
  23. package/dist/components/paywall/fixtures/override-paywall.d.ts +2 -0
  24. package/dist/components/paywall/fixtures/override-paywall.js +1310 -0
  25. package/dist/components/paywall/fixtures/stack-paywall.d.ts +2 -0
  26. package/dist/components/paywall/fixtures/stack-paywall.js +5223 -0
  27. package/dist/components/paywall/fixtures/variables.d.ts +261 -0
  28. package/dist/components/paywall/fixtures/variables.js +262 -0
  29. package/dist/components/purchase-button/PurchaseButton.stories.svelte +10 -21
  30. package/dist/components/purchase-button/PurchaseButton.svelte +2 -27
  31. package/dist/components/stack/Stack.stories.svelte +2354 -978
  32. package/dist/components/stack/Stack.svelte +111 -134
  33. package/dist/components/stack/Stack.svelte.d.ts +6 -2
  34. package/dist/components/stack/stack-utils.d.ts +10 -30
  35. package/dist/components/stack/stack-utils.js +77 -255
  36. package/dist/components/text/Text.svelte +3 -37
  37. package/dist/components/text/Text.svelte.d.ts +1 -2
  38. package/dist/components/text/TextNode.stories.svelte +10 -36
  39. package/dist/components/text/TextNode.svelte +25 -28
  40. package/dist/components/text/TextNode.svelte.d.ts +1 -1
  41. package/dist/components/text/text-utils.d.ts +4 -9
  42. package/dist/components/text/text-utils.js +32 -117
  43. package/dist/components/timeline/Timeline.stories.svelte +640 -251
  44. package/dist/components/timeline/Timeline.svelte +42 -28
  45. package/dist/components/timeline/Timeline.svelte.d.ts +1 -1
  46. package/dist/components/timeline/TimelineItem.svelte +80 -112
  47. package/dist/components/timeline/TimelineItem.svelte.d.ts +6 -2
  48. package/dist/components/timeline/timeline-utils.d.ts +24 -6
  49. package/dist/components/timeline/timeline-utils.js +21 -113
  50. package/dist/data/entities.d.ts +19 -135
  51. package/dist/index.d.ts +2 -1
  52. package/dist/index.js +2 -1
  53. package/dist/stores/color-mode.d.ts +1 -1
  54. package/dist/stores/paywall.d.ts +5 -2
  55. package/dist/stores/selected.d.ts +5 -0
  56. package/dist/stores/selected.js +12 -0
  57. package/dist/stores/variables.d.ts +1 -1
  58. package/dist/stores/variables.js +0 -1
  59. package/dist/stories/component-decorator.d.ts +2 -0
  60. package/dist/stories/component-decorator.js +12 -0
  61. package/dist/stories/fixtures.d.ts +5 -3
  62. package/dist/stories/fixtures.js +5214 -4422
  63. package/dist/stories/paywall-decorator.js +6 -0
  64. package/dist/stories/variables-decorator.d.ts +1 -1
  65. package/dist/stories/viewport-decorator.d.ts +2 -0
  66. package/dist/stories/viewport-decorator.js +8 -0
  67. package/dist/stories/viewport-wrapper.svelte +53 -0
  68. package/dist/stories/viewport-wrapper.svelte.d.ts +10 -0
  69. package/dist/stories/with-layout.d.ts +2 -10
  70. package/dist/stories/with-layout.js +3 -5
  71. package/dist/types/alignment.d.ts +5 -3
  72. package/dist/types/background.d.ts +6 -5
  73. package/dist/types/base.d.ts +7 -0
  74. package/dist/types/base.js +1 -0
  75. package/dist/types/colors.d.ts +4 -4
  76. package/dist/types/component.d.ts +6 -2
  77. package/dist/types/components/button.d.ts +4 -1
  78. package/dist/types/components/footer.d.ts +2 -1
  79. package/dist/types/components/icon.d.ts +28 -0
  80. package/dist/types/components/icon.js +1 -0
  81. package/dist/types/components/image.d.ts +20 -0
  82. package/dist/types/components/image.js +1 -0
  83. package/dist/types/components/package.d.ts +2 -1
  84. package/dist/types/components/purchase-button.d.ts +2 -1
  85. package/dist/types/components/stack.d.ts +32 -0
  86. package/dist/types/components/stack.js +1 -0
  87. package/dist/types/components/text.d.ts +20 -0
  88. package/dist/types/components/text.js +1 -0
  89. package/dist/types/components/timeline.d.ts +35 -0
  90. package/dist/types/components/timeline.js +1 -0
  91. package/dist/types/localization.d.ts +2 -1
  92. package/dist/types/media.d.ts +4 -3
  93. package/dist/types/overrides.d.ts +48 -0
  94. package/dist/types/overrides.js +1 -0
  95. package/dist/types/variables.d.ts +13 -0
  96. package/dist/types/variables.js +10 -0
  97. package/dist/types.d.ts +17 -9
  98. package/dist/ui/atoms/typography.stories.svelte +1 -27
  99. package/dist/ui/molecules/button.stories.svelte +3 -8
  100. package/dist/ui/theme/colors.d.ts +0 -6
  101. package/dist/ui/theme/colors.js +1 -1
  102. package/dist/ui/theme/text.d.ts +3 -4
  103. package/dist/ui/theme/utils.d.ts +0 -10
  104. package/dist/ui/theme/utils.js +5 -5
  105. package/dist/utils/background-utils.d.ts +4 -0
  106. package/dist/utils/background-utils.js +39 -0
  107. package/dist/utils/base-utils.d.ts +18 -0
  108. package/dist/utils/base-utils.js +124 -0
  109. package/dist/utils/constants.d.ts +2 -2
  110. package/dist/utils/constants.js +6 -1
  111. package/dist/utils/font-utils.d.ts +4 -0
  112. package/dist/utils/font-utils.js +47 -0
  113. package/dist/utils/style-utils.d.ts +7 -120
  114. package/dist/utils/style-utils.js +22 -302
  115. package/dist/utils/variable-utils.d.ts +1 -22
  116. package/dist/utils/variable-utils.js +28 -24
  117. package/dist/web-components/index.css +1 -1
  118. package/dist/web-components/index.js +1323 -895
  119. package/package.json +34 -24
  120. package/dist/components/button/button-utils.d.ts +0 -2
  121. package/dist/components/button/button-utils.js +0 -19
  122. package/dist/components/image/image-utils.d.ts +0 -19
  123. package/dist/components/image/image-utils.js +0 -33
  124. package/dist/components/purchase-button/purchase-button-utils.d.ts +0 -2
  125. package/dist/components/purchase-button/purchase-button-utils.js +0 -20
  126. package/dist/stories/meta-templates.d.ts +0 -12
  127. package/dist/stories/meta-templates.js +0 -155
@@ -8,11 +8,17 @@ export function paywallDecorator() {
8
8
  window.alert(`Selected package ${packageId}`);
9
9
  }
10
10
  });
11
+ const emptyUiConfig = {
12
+ app: {
13
+ fonts: {},
14
+ },
15
+ };
11
16
  setPaywallContext({
12
17
  selectedPackageId,
13
18
  variablesPerPackage: readable(undefined),
14
19
  onPurchase: () => window.alert("Purchase clicked"),
15
20
  onButtonAction: (action) => window.alert(`Button clicked: ${JSON.stringify(action, undefined, 2)}`),
21
+ uiConfig: emptyUiConfig,
16
22
  });
17
23
  return Story();
18
24
  };
@@ -1,3 +1,3 @@
1
- import type { VariableDictionary } from "../utils/variable-utils";
1
+ import type { VariableDictionary } from "../types/variables";
2
2
  import type { DecoratorFunction, Renderer } from "storybook/internal/csf";
3
3
  export declare function variablesDecorator<TRenderer extends Renderer, TArgs>(variables?: VariableDictionary): DecoratorFunction<TRenderer, TArgs>;
@@ -0,0 +1,2 @@
1
+ import type { DecoratorFunction, Renderer } from "storybook/internal/csf";
2
+ export declare function viewportDecorator<TRenderer extends Renderer, TArgs>(width: number, height: number, elements: number): DecoratorFunction<TRenderer, TArgs>;
@@ -0,0 +1,8 @@
1
+ import ViewportWrapper from "./viewport-wrapper.svelte";
2
+ export function viewportDecorator(width, height, elements) {
3
+ return (Story) => ({
4
+ Component: ViewportWrapper,
5
+ props: { width, height, elements },
6
+ Slot: Story(),
7
+ });
8
+ }
@@ -0,0 +1,53 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+
4
+ interface Props {
5
+ width: number;
6
+ height: number;
7
+ elements: number;
8
+ children: Snippet;
9
+ }
10
+
11
+ const { width, height, elements, children }: Props = $props();
12
+
13
+ const style = $derived(`width: ${width}px; height: ${height}px`);
14
+ </script>
15
+
16
+ <div class="container" {style}>
17
+ <div class="content">
18
+ {#each Array(elements) as _, index}
19
+ <div>Item {index + 1}</div>
20
+ {/each}
21
+ </div>
22
+ {@render children()}
23
+ </div>
24
+
25
+ <style>
26
+ .container {
27
+ position: relative;
28
+ overflow: hidden;
29
+ outline: 1px solid #dddddd;
30
+ display: flex;
31
+ flex-direction: column;
32
+ justify-content: flex-start;
33
+ align-items: stretch;
34
+ }
35
+
36
+ .content {
37
+ flex: 1;
38
+ overflow: auto;
39
+ display: flex;
40
+ flex-direction: column;
41
+ justify-content: flex-start;
42
+ align-items: stretch;
43
+
44
+ & > div {
45
+ min-height: 50px;
46
+ border-bottom: 1px solid #dddddd;
47
+ display: flex;
48
+ flex-direction: column;
49
+ justify-content: center;
50
+ align-items: center;
51
+ }
52
+ }
53
+ </style>
@@ -0,0 +1,10 @@
1
+ import type { Snippet } from "svelte";
2
+ interface Props {
3
+ width: number;
4
+ height: number;
5
+ elements: number;
6
+ children: Snippet;
7
+ }
8
+ declare const ViewportWrapper: import("svelte").Component<Props, {}, "">;
9
+ type ViewportWrapper = ReturnType<typeof ViewportWrapper>;
10
+ export default ViewportWrapper;
@@ -1,10 +1,2 @@
1
- export declare function withLayout(Story: unknown, context: unknown): {
2
- Component: import("svelte").Component<import("./with-layout.svelte").Props, {}, "">;
3
- props: {
4
- globals: any;
5
- children: () => {
6
- Component: unknown;
7
- props: any;
8
- };
9
- };
10
- };
1
+ import type { DecoratorFunction, Renderer } from "storybook/internal/types";
2
+ export declare function withLayout<TRenderer extends Renderer, TArgs>(): DecoratorFunction<TRenderer, TArgs>;
@@ -1,15 +1,13 @@
1
1
  import WithLayout from "./with-layout.svelte";
2
- export function withLayout(Story, context) {
3
- return {
2
+ export function withLayout() {
3
+ return (Story, context) => ({
4
4
  Component: WithLayout,
5
5
  props: {
6
- // @ts-expect-error too hard to get the type right
7
6
  globals: context.globals,
8
7
  children: () => ({
9
8
  Component: Story,
10
- // @ts-expect-error too hard to get the type right
11
9
  props: context.args,
12
10
  }),
13
11
  },
14
- };
12
+ });
15
13
  }
@@ -1,19 +1,21 @@
1
1
  export type Distribution = "start" | "center" | "end" | "space_between" | "space_around" | "space_evenly";
2
2
  export type VerticalAlignment = "top" | "center" | "bottom";
3
- export type HorizontalDimension = {
3
+ type HorizontalDimension = {
4
4
  type: "horizontal";
5
5
  alignment: VerticalAlignment;
6
6
  distribution: Distribution;
7
7
  };
8
8
  export type HorizontalAlignment = "leading" | "center" | "trailing";
9
- export type VerticalDimension = {
9
+ type VerticalDimension = {
10
10
  type: "vertical";
11
11
  alignment: HorizontalAlignment;
12
12
  distribution: Distribution;
13
13
  };
14
14
  export type ZAlignment = "top_leading" | "top" | "top_trailing" | "leading" | "center" | "trailing" | "bottom_leading" | "bottom" | "bottom_trailing";
15
- export type ZDimension = {
15
+ type ZDimension = {
16
16
  type: "zlayer";
17
17
  alignment: ZAlignment;
18
+ distribution?: unknown;
18
19
  };
19
20
  export type Dimension = HorizontalDimension | VerticalDimension | ZDimension;
21
+ export {};
@@ -1,18 +1,19 @@
1
1
  import type { ColorGradientScheme } from "./colors";
2
- import type { ImageInfo, ImageObjectFit, VideoInfo } from "./media";
3
- export type BackgroundColor = {
2
+ import type { ImageInfo, FitMode, VideoInfo } from "./media";
3
+ type BackgroundColor = {
4
4
  type: "color";
5
5
  value: ColorGradientScheme;
6
6
  };
7
- export type BackgroundImage = {
7
+ type BackgroundImage = {
8
8
  type: "image";
9
9
  value: ImageInfo;
10
10
  color_overlay: ColorGradientScheme | null;
11
- fit_mode: ImageObjectFit;
11
+ fit_mode: FitMode;
12
12
  };
13
- export type BackgroundVideo = {
13
+ type BackgroundVideo = {
14
14
  type: "video";
15
15
  value: VideoInfo;
16
16
  color_overlay: ColorGradientScheme | null;
17
17
  };
18
18
  export type Background = BackgroundColor | BackgroundImage | BackgroundVideo;
19
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { Component } from "./component";
2
+ export interface BaseComponent {
3
+ type: string;
4
+ id: string;
5
+ name: string;
6
+ fallback?: Component;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- export type GradientPoint = {
1
+ type GradientPoint = {
2
2
  percent: number;
3
3
  color: string;
4
4
  };
@@ -6,11 +6,11 @@ type GradientColorInfo = {
6
6
  type: "linear" | "radial";
7
7
  points: GradientPoint[];
8
8
  };
9
- export type LinearGradientColorInfo = GradientColorInfo & {
9
+ type LinearGradientColorInfo = GradientColorInfo & {
10
10
  type: "linear";
11
11
  degrees: number;
12
12
  };
13
- export type RadialGradientColorInfo = GradientColorInfo & {
13
+ type RadialGradientColorInfo = GradientColorInfo & {
14
14
  type: "radial";
15
15
  };
16
16
  type AliasColorInfo = {
@@ -21,7 +21,7 @@ type HexColorInfo = {
21
21
  type: "hex";
22
22
  value: string;
23
23
  };
24
- export type ColorInfo = AliasColorInfo | HexColorInfo;
24
+ type ColorInfo = AliasColorInfo | HexColorInfo;
25
25
  export type ColorGradientInfo = ColorInfo | LinearGradientColorInfo | RadialGradientColorInfo;
26
26
  export type ColorScheme = {
27
27
  light: ColorInfo;
@@ -1,6 +1,10 @@
1
- import type { ImageProps, StackProps, TextNodeProps, TimelineProps } from "../data/entities";
1
+ import type { TimelineProps } from "./components/timeline";
2
+ import type { TextNodeProps } from "./components/text";
2
3
  import type { ButtonProps } from "./components/button";
3
4
  import type { FooterProps } from "./components/footer";
5
+ import type { IconProps } from "./components/icon";
6
+ import type { ImageProps } from "./components/image";
4
7
  import type { PackageProps } from "./components/package";
5
8
  import type { PurchaseButtonProps } from "./components/purchase-button";
6
- export type Component = ButtonProps | FooterProps | ImageProps | PackageProps | PurchaseButtonProps | StackProps | TextNodeProps | TimelineProps;
9
+ import type { StackProps } from "./components/stack";
10
+ export type Component = ButtonProps | FooterProps | IconProps | ImageProps | PackageProps | PurchaseButtonProps | StackProps | TextNodeProps | TimelineProps;
@@ -1,4 +1,5 @@
1
- import type { BaseComponent, StackProps } from "../../data/entities";
1
+ import type { BaseComponent } from "../base";
2
+ import type { StackProps } from "./stack";
2
3
  interface RestorePurchasesAction {
3
4
  type: "restore_purchases";
4
5
  }
@@ -22,6 +23,7 @@ interface NavigateToWebPurchase {
22
23
  interface NavigateToUrlAction {
23
24
  type: "navigate_to";
24
25
  destination: "privacy_policy" | "terms" | "url";
26
+ sheet?: null;
25
27
  url: {
26
28
  url_lid: string;
27
29
  method: "deep_link" | "external_browser" | "in_app_browser";
@@ -32,5 +34,6 @@ export interface ButtonProps extends BaseComponent {
32
34
  type: "button";
33
35
  action: Action;
34
36
  stack: StackProps;
37
+ transition?: null;
35
38
  }
36
39
  export {};
@@ -1,4 +1,5 @@
1
- import type { BaseComponent, StackProps } from "../../data/entities";
1
+ import type { BaseComponent } from "../base";
2
+ import type { StackProps } from "./stack";
2
3
  export interface FooterProps extends BaseComponent {
3
4
  type: "footer";
4
5
  stack: StackProps;
@@ -0,0 +1,28 @@
1
+ import type { BorderType, CircleShape, RectangleShape, ShadowType, SizeType, Spacing } from "..";
2
+ import type { BaseComponent } from "../base";
3
+ import type { ColorScheme } from "../colors";
4
+ import type { Overrides } from "../overrides";
5
+ export interface IconBackground {
6
+ color: ColorScheme | null;
7
+ shape: RectangleShape | CircleShape;
8
+ border?: BorderType | null;
9
+ shadow?: ShadowType | null;
10
+ }
11
+ export interface IconProps extends BaseComponent {
12
+ type: "icon";
13
+ visible?: boolean | null;
14
+ icon_name: string;
15
+ base_url: string;
16
+ formats: {
17
+ svg?: string;
18
+ png?: string;
19
+ webp?: string;
20
+ heic?: string;
21
+ };
22
+ size: SizeType;
23
+ padding?: Spacing | null;
24
+ margin?: Spacing | null;
25
+ color: ColorScheme;
26
+ icon_background?: IconBackground | null;
27
+ overrides?: Overrides<IconProps>;
28
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { BorderType, CircleShape, ConcaveShape, ConvexShape, RectangleShape, ShadowType, SizeType, Spacing } from "..";
2
+ import type { BaseComponent } from "../base";
3
+ import type { ColorGradientScheme } from "../colors";
4
+ import type { FitMode, ImageInfo } from "../media";
5
+ import type { Overrides } from "../overrides";
6
+ export interface ImageProps extends BaseComponent {
7
+ type: "image";
8
+ visible?: boolean | null;
9
+ source: ImageInfo;
10
+ override_source_lid?: string;
11
+ size: SizeType;
12
+ mask_shape?: RectangleShape | CircleShape | ConcaveShape | ConvexShape | null;
13
+ fit_mode: FitMode;
14
+ padding?: Spacing | null;
15
+ margin?: Spacing | null;
16
+ color_overlay?: ColorGradientScheme | null;
17
+ border?: BorderType | null;
18
+ shadow?: ShadowType | null;
19
+ overrides?: Overrides<ImageProps>;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
- import type { BaseComponent, StackProps } from "../../data/entities";
1
+ import type { BaseComponent } from "../base";
2
+ import type { StackProps } from "./stack";
2
3
  export interface PackageProps extends BaseComponent {
3
4
  type: "package";
4
5
  package_id: string;
@@ -1,4 +1,5 @@
1
- import type { BaseComponent, StackProps } from "../../data/entities";
1
+ import type { BaseComponent } from "../base";
2
+ import type { StackProps } from "./stack";
2
3
  export interface PurchaseButtonProps extends BaseComponent {
3
4
  type: "purchase_button";
4
5
  stack: StackProps;
@@ -0,0 +1,32 @@
1
+ import type { BorderType, ShadowType, ShapeType, SizeType, Spacing } from "..";
2
+ import type { Dimension } from "../alignment";
3
+ import type { Background } from "../background";
4
+ import type { ColorGradientScheme } from "../colors";
5
+ import type { Component } from "../component";
6
+ import type { BaseComponent } from "../base";
7
+ import type { Overrides } from "../overrides";
8
+ type BadgeStyle = "overlay" | "nested" | "edge_to_edge";
9
+ type BadgeAlignment = "top_leading" | "top" | "top_trailing" | "bottom_leading" | "bottom" | "bottom_trailing";
10
+ export type Badge = {
11
+ style: BadgeStyle;
12
+ alignment: BadgeAlignment;
13
+ stack: StackProps;
14
+ };
15
+ export interface StackProps extends BaseComponent {
16
+ type: "stack";
17
+ visible?: boolean | null;
18
+ components: Component[];
19
+ size: SizeType;
20
+ dimension: Dimension;
21
+ spacing: number;
22
+ margin: Spacing;
23
+ padding: Spacing;
24
+ background_color: ColorGradientScheme | null;
25
+ background: Background | null;
26
+ border: BorderType | null;
27
+ shape: ShapeType | null;
28
+ shadow: ShadowType | null;
29
+ badge?: Badge | null;
30
+ overrides?: Overrides<StackProps>;
31
+ }
32
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { FontSizes, FontWeights, SizeType, Spacing, TextAlignments } from "..";
2
+ import type { BaseComponent } from "../base";
3
+ import type { ColorGradientScheme, ColorScheme } from "../colors";
4
+ import type { Overrides } from "../overrides";
5
+ export interface TextNodeProps extends BaseComponent {
6
+ text_lid: string;
7
+ font_name?: string | null;
8
+ font_size: number | keyof typeof FontSizes;
9
+ font_weight: keyof typeof FontWeights;
10
+ font_weight_int?: number;
11
+ horizontal_alignment: keyof typeof TextAlignments;
12
+ color: ColorScheme;
13
+ background_color?: ColorGradientScheme | null;
14
+ type: "text";
15
+ visible?: boolean | null;
16
+ padding: Spacing;
17
+ margin: Spacing;
18
+ size: SizeType;
19
+ overrides?: Overrides<TextNodeProps>;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,35 @@
1
+ import type { SizeType, Spacing } from "..";
2
+ import type { BaseComponent } from "../base";
3
+ import type { ColorGradientScheme } from "../colors";
4
+ import type { Overrides } from "../overrides";
5
+ import type { IconProps } from "./icon";
6
+ import type { TextNodeProps } from "./text";
7
+ export interface TimelineProps extends BaseComponent {
8
+ type: "timeline";
9
+ visible?: boolean | null;
10
+ icon_alignment: "title" | "title_and_description";
11
+ item_spacing: number;
12
+ text_spacing: number;
13
+ column_gutter: number;
14
+ size: SizeType;
15
+ padding: Spacing;
16
+ margin: Spacing;
17
+ items: TimelineItemProps[];
18
+ overrides?: Overrides<TimelineProps>;
19
+ }
20
+ export interface TimelineConnectorProps {
21
+ width: number;
22
+ margin: {
23
+ top: number;
24
+ bottom: number;
25
+ };
26
+ color: ColorGradientScheme | null;
27
+ }
28
+ export interface TimelineItemProps extends BaseComponent {
29
+ type: "timeline_item";
30
+ icon: IconProps;
31
+ title: TextNodeProps;
32
+ description?: TextNodeProps | null;
33
+ connector?: TimelineConnectorProps;
34
+ overrides?: Overrides<TimelineItemProps>;
35
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { ImageInfo } from "./media";
2
2
  export type LocalizationValue = string | ImageInfo;
3
- export type Localization = Partial<Record<string, string>>;
3
+ type Localization = Partial<Record<string, string>>;
4
4
  export type Localizations = Partial<Record<string, Localization>>;
5
+ export {};
@@ -1,4 +1,4 @@
1
- export type ImageFiles = {
1
+ type ImageFiles = {
2
2
  width: number;
3
3
  height: number;
4
4
  original: string;
@@ -9,10 +9,11 @@ export type ImageFiles = {
9
9
  };
10
10
  export type ImageInfo = {
11
11
  light: ImageFiles;
12
- dark: ImageFiles | null;
12
+ dark?: ImageFiles | null;
13
13
  };
14
14
  export type VideoInfo = {
15
15
  light: string;
16
16
  dark: string | null;
17
17
  };
18
- export type ImageObjectFit = "fit" | "fill";
18
+ export type FitMode = "fit" | "fill";
19
+ export {};
@@ -0,0 +1,48 @@
1
+ type ScreenSize = "desktop" | "tablet" | "mobile";
2
+ type Orientation = "portrait" | "landscape";
3
+ type EqualityOperator = "is" | "is not";
4
+ type ArrayOperator = "in" | "not in";
5
+ type IntroOfferCondition = {
6
+ type: "intro_offer";
7
+ };
8
+ type MultipleIntroOffersCondition = {
9
+ type: "multiple_intro_offers";
10
+ };
11
+ type SelectedCondition = {
12
+ type: "selected";
13
+ };
14
+ type ScreenSizeCondition = {
15
+ type: "screen_size";
16
+ operator: ArrayOperator;
17
+ sizes: ScreenSize[];
18
+ };
19
+ type OrientationCondition = {
20
+ type: "orientation";
21
+ operator: ArrayOperator;
22
+ orientations: Orientation[];
23
+ };
24
+ type IntroductoryOfferCondition = {
25
+ type: "introductory_offer";
26
+ operator: EqualityOperator;
27
+ value: boolean;
28
+ };
29
+ type SelectedPackageCondition = {
30
+ type: "selected_package";
31
+ operator: ArrayOperator;
32
+ packages: string[];
33
+ };
34
+ type PromoOfferCondition = {
35
+ type: "promo_offer";
36
+ };
37
+ type OverrideCondition = IntroOfferCondition | MultipleIntroOffersCondition | SelectedCondition | ScreenSizeCondition | OrientationCondition | IntroductoryOfferCondition | SelectedPackageCondition | PromoOfferCondition;
38
+ /**
39
+ * The reserved properties of an override that should not be included in the override properties
40
+ */
41
+ type ReservedProperty = "id" | "type" | "overrides" | "stack" | "components" | "items" | "pages" | "tabs";
42
+ type OverrideProperties<C> = Partial<Omit<C, ReservedProperty>>;
43
+ type Override<C> = {
44
+ conditions: OverrideCondition[];
45
+ properties: OverrideProperties<C>;
46
+ };
47
+ export type Overrides<C> = Override<C>[];
48
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export declare enum PackageIdentifier {
2
+ weekly = "$rc_weekly",
3
+ monthly = "$rc_monthly",
4
+ two_month = "$rc_two_month",
5
+ three_month = "$rc_three_month",
6
+ six_month = "$rc_six_month",
7
+ annual = "$rc_annual",
8
+ lifetime = "$rc_lifetime"
9
+ }
10
+ type VariableName = "product.price" | "product.price_per_period" | "product.price_per_period_abbreviated" | "product.price_per_day" | "product.price_per_week" | "product.price_per_month" | "product.price_per_year" | "product.period" | "product.period_abbreviated" | "product.periodly" | "product.period_in_days" | "product.period_in_weeks" | "product.period_in_months" | "product.period_in_years" | "product.period_with_unit" | "product.currency_code" | "product.currency_symbol" | "product.offer_price" | "product.offer_price_per_day" | "product.offer_price_per_week" | "product.offer_price_per_month" | "product.offer_price_per_year" | "product.offer_period" | "product.offer_period_abbreviated" | "product.offer_period_in_days" | "product.offer_period_in_weeks" | "product.offer_period_in_months" | "product.offer_period_in_years" | "product.offer_period_with_unit" | "product.offer_end_date" | "product.secondary_offer_price" | "product.secondary_offer_period" | "product.secondary_offer_period_abbreviated" | "product.relative_discount" | "product.store_product_name";
11
+ export type VariableDictionary = Record<VariableName, string>;
12
+ export type VariablesDictionary = Record<PackageIdentifier, VariableDictionary>;
13
+ export {};
@@ -0,0 +1,10 @@
1
+ export var PackageIdentifier;
2
+ (function (PackageIdentifier) {
3
+ PackageIdentifier["weekly"] = "$rc_weekly";
4
+ PackageIdentifier["monthly"] = "$rc_monthly";
5
+ PackageIdentifier["two_month"] = "$rc_two_month";
6
+ PackageIdentifier["three_month"] = "$rc_three_month";
7
+ PackageIdentifier["six_month"] = "$rc_six_month";
8
+ PackageIdentifier["annual"] = "$rc_annual";
9
+ PackageIdentifier["lifetime"] = "$rc_lifetime";
10
+ })(PackageIdentifier || (PackageIdentifier = {}));
package/dist/types.d.ts CHANGED
@@ -40,29 +40,37 @@ export declare enum TextAlignments {
40
40
  center = "center",
41
41
  trailing = "end"
42
42
  }
43
- export type SizeType = {
44
- width: Size;
45
- height: Size;
46
- };
47
- export type Size = FixedSize | RelativeSize;
48
43
  type FixedSize = {
49
44
  type: "fixed";
50
45
  value: number;
51
46
  };
52
47
  type RelativeSize = {
53
- type: "fit" | "fill";
48
+ type: "fit" | "fill" | "relative";
54
49
  value?: null;
55
50
  };
56
- export type ShapeType = RectangleShape | PillShape;
51
+ export type Size = FixedSize | RelativeSize;
52
+ export type SizeType = {
53
+ width: Size;
54
+ height: Size;
55
+ };
56
+ export type ShapeType = CircleShape | RectangleShape | PillShape;
57
57
  export type RectangleShape = {
58
58
  type: "rectangle";
59
- corners: CornerRadiusType;
59
+ corners: CornerRadiusType | null;
60
60
  };
61
61
  export type CircleShape = {
62
62
  type: "circle";
63
+ corners?: null;
63
64
  };
64
- type PillShape = {
65
+ export type PillShape = {
65
66
  type: "pill";
67
+ corners?: CornerRadiusType | null;
68
+ };
69
+ export type ConcaveShape = {
70
+ type: "concave";
71
+ };
72
+ export type ConvexShape = {
73
+ type: "convex";
66
74
  };
67
75
  export type BorderType = {
68
76
  color: ColorScheme;
@@ -3,35 +3,11 @@
3
3
  import { default as Typography } from "./typography.svelte";
4
4
  import { defineMeta } from "@storybook/addon-svelte-csf";
5
5
  import { type ComponentProps } from "svelte";
6
- import { brandingViewportModes } from "../../../../.storybook/modes";
7
6
 
8
7
  const { Story } = defineMeta({
9
8
  component: Typography,
10
9
  title: "Atoms/Typography",
11
- // @ts-expect-error ignore typing of decorator
12
- decorators: [withLayout],
13
- argTypes: {
14
- size: {
15
- control: "select",
16
- options: [
17
- "heading-2xl",
18
- "heading-xl",
19
- "heading-lg",
20
- "heading-md",
21
- "body-base",
22
- "body-small",
23
- "label-button",
24
- "label-default",
25
- "caption-default",
26
- "caption-link",
27
- ],
28
- },
29
- },
30
- parameters: {
31
- chromatic: {
32
- modes: brandingViewportModes,
33
- },
34
- },
10
+ decorators: [withLayout()],
35
11
  render: template,
36
12
  });
37
13
 
@@ -46,7 +22,6 @@
46
22
  </Typography>
47
23
  {/snippet}
48
24
 
49
- <!-- Stories for each typography variant -->
50
25
  <Story name="Heading 2XL">
51
26
  <Typography size="heading-2xl">
52
27
  Heading 2XL - {baseContent}
@@ -107,7 +82,6 @@
107
82
  </Typography>
108
83
  </Story>
109
84
 
110
- <!-- Story showing all variants -->
111
85
  <Story name="All Variants">
112
86
  <div class="story-container">
113
87
  <div class="variant-row">