@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
@@ -18,3 +18,12 @@
18
18
  <button onclick={handleClick} class={clz} disabled={!onclick} {style}>
19
19
  {@render children?.()}
20
20
  </button>
21
+
22
+ <style>
23
+ button {
24
+ border: none;
25
+ cursor: pointer;
26
+ background: transparent;
27
+ width: fit-content;
28
+ }
29
+ </style>
@@ -7,7 +7,7 @@
7
7
  SupportedActions,
8
8
  } from "../../data/entities";
9
9
  import type { PurchaseState } from "../../data/state";
10
- import type { ColorMode } from "../../types";
10
+ import { DEFAULT_COLOR_MODE, DEFAULT_TEXT_COLOR } from "../../utils/constants";
11
11
 
12
12
  const onAction = (action: SupportedActions) => {
13
13
  alert(action.type);
@@ -51,7 +51,7 @@
51
51
  const purchaseState: PurchaseState = {
52
52
  locale: "en_US",
53
53
  defaultLocale: "en_US",
54
- colorMode: "light" as ColorMode,
54
+ colorMode: DEFAULT_COLOR_MODE,
55
55
  };
56
56
 
57
57
  export const labelsData = {
@@ -76,7 +76,7 @@
76
76
  light: { type: "hex", value: "transparent" },
77
77
  },
78
78
  color: {
79
- dark: { type: "hex", value: "#000000" },
79
+ dark: { type: "hex", value: DEFAULT_TEXT_COLOR },
80
80
  light: { type: "hex", value: "#ffffff" },
81
81
  },
82
82
  font_size: "body_m",
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import Button from "./Button.svelte";
2
+ import { ButtonDeprecated } from "../../index";
3
3
  import type { ButtonNodeProps } from "../../data/entities";
4
4
  import Stack from "../stack/Stack.svelte";
5
5
  import { getButtonStyles } from "./button-utils";
@@ -30,17 +30,19 @@
30
30
  );
31
31
  </script>
32
32
 
33
- <Button onclick={onClick} style={buttonStyles} class={"rc-pw-button"}>
33
+ <ButtonDeprecated onclick={onClick} style={buttonStyles} class={"rc-pw-button"}>
34
34
  <Stack {...stack} {labels} {purchaseState} {variableDictionary} />
35
- </Button>
35
+ </ButtonDeprecated>
36
36
 
37
37
  <style>
38
38
  .rc-pw-button {
39
39
  display: flex;
40
40
  margin: 0;
41
41
  padding: 0;
42
- background: initial;
43
- border: initial;
44
42
  text-align: initial;
43
+ border: none;
44
+ cursor: pointer;
45
+ background: transparent;
46
+ width: fit-content;
45
47
  }
46
48
  </style>
@@ -1,12 +1,12 @@
1
1
  <script module lang="ts">
2
2
  import { defineMeta } from "@storybook/addon-svelte-csf";
3
3
  import Footer from "./Footer.svelte";
4
- import type { ColorMode } from "../../types";
4
+ import { DEFAULT_COLOR_MODE } from "../../utils/constants";
5
5
 
6
6
  const purchaseState = {
7
7
  locale: "en_US",
8
8
  defaultLocale: "en_US",
9
- colorMode: "light" as ColorMode,
9
+ colorMode: DEFAULT_COLOR_MODE,
10
10
  };
11
11
 
12
12
  const { Story } = defineMeta({
@@ -2,10 +2,10 @@
2
2
  import { defineMeta } from "@storybook/addon-svelte-csf";
3
3
  import Image from "./Image.svelte";
4
4
  import type { PurchaseState } from "../../data/state";
5
- import type { ColorMode } from "../../types";
5
+ import { DEFAULT_COLOR_MODE } from "../../utils/constants";
6
6
 
7
7
  const purchaseState: PurchaseState = {
8
- colorMode: "light" as ColorMode,
8
+ colorMode: DEFAULT_COLOR_MODE,
9
9
  locale: "en_US",
10
10
  defaultLocale: "en_US",
11
11
  };
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import { getImageComponentStyles } from "./image-utils";
3
3
  import type { ImageProps } from "../../data/entities";
4
+ import { DEFAULT_COLOR_MODE } from "../../utils/constants";
4
5
 
5
6
  const { id, source, purchaseState, ...restProps }: ImageProps = $props();
6
7
 
@@ -29,7 +30,7 @@
29
30
  if (source[colorMode]?.original) {
30
31
  return source[colorMode].original;
31
32
  } else {
32
- return source["light"].original as string;
33
+ return source[DEFAULT_COLOR_MODE]?.original as string;
33
34
  }
34
35
  });
35
36
  </script>
@@ -71,7 +72,7 @@
71
72
  x2={linearGradientAngle.x2}
72
73
  y2={linearGradientAngle.y2}
73
74
  >
74
- {#each restProps.color_overlay?.[purchaseState.colorMode]?.points || restProps.color_overlay?.["light"]?.points || [] as stop}
75
+ {#each restProps.color_overlay?.[purchaseState.colorMode]?.points || restProps.color_overlay?.[DEFAULT_COLOR_MODE]?.points || [] as stop}
75
76
  <stop
76
77
  offset={`${stop.percent}%`}
77
78
  style={`stop-color: ${stop.color}`}
@@ -87,7 +88,7 @@
87
88
  fx="50%"
88
89
  fy="50%"
89
90
  >
90
- {#each restProps.color_overlay?.[purchaseState.colorMode]?.points || restProps.color_overlay?.["light"]?.points || [] as stop}
91
+ {#each restProps.color_overlay?.[purchaseState.colorMode]?.points || restProps.color_overlay?.[DEFAULT_COLOR_MODE]?.points || [] as stop}
91
92
  <stop
92
93
  offset={`${stop.percent}%`}
93
94
  style={`stop-color: ${stop.color}`}
@@ -100,7 +101,7 @@
100
101
  offset="0%"
101
102
  style={`stop-color: ${
102
103
  restProps.color_overlay[purchaseState.colorMode]?.value ||
103
- restProps.color_overlay?.["light"]?.value
104
+ restProps.color_overlay?.[DEFAULT_COLOR_MODE]?.value
104
105
  }`}
105
106
  />
106
107
  </linearGradient>
@@ -3,7 +3,7 @@
3
3
  import Package from "./Package.svelte";
4
4
  import type { Extra, SupportedActions } from "../../data/entities";
5
5
  import type { PurchaseState } from "../../data/state";
6
- import type { ColorMode } from "../../types";
6
+ import { DEFAULT_COLOR_MODE } from "../../utils/constants";
7
7
 
8
8
  const onAction = (action: SupportedActions, data?: Extra) => {
9
9
  alert(`${action.type} ${JSON.stringify(data)}`);
@@ -34,7 +34,7 @@
34
34
  },
35
35
  };
36
36
  const purchaseState: PurchaseState = {
37
- colorMode: "light" as ColorMode,
37
+ colorMode: DEFAULT_COLOR_MODE,
38
38
  locale: "en_US",
39
39
  defaultLocale: "en_US",
40
40
  };
@@ -21,6 +21,7 @@
21
21
  import { prefersDarkMode } from "../../stores/theme";
22
22
  import type { ColorMode } from "../../types";
23
23
  import Footer from "../footer/Footer.svelte";
24
+ import { DEFAULT_COLOR_MODE } from "../../utils/constants";
24
25
 
25
26
  interface Props {
26
27
  paywallData: PaywallData;
@@ -53,7 +54,8 @@
53
54
  locale: selectedLocale || paywallData.default_locale,
54
55
  defaultLocale: paywallData.default_locale,
55
56
  variablesPerPackage,
56
- colorMode: preferredColorMode || ($prefersDarkMode ? "dark" : "light"),
57
+ colorMode:
58
+ preferredColorMode || ($prefersDarkMode ? "dark" : DEFAULT_COLOR_MODE),
57
59
  });
58
60
 
59
61
  let variableDictionary = $state(
@@ -221,13 +223,6 @@
221
223
  select {
222
224
  font: inherit;
223
225
  }
224
- button {
225
- border: none;
226
- cursor: pointer;
227
- background: transparent;
228
- width: fit-content;
229
- }
230
-
231
226
  p,
232
227
  h1,
233
228
  h2,
@@ -1,7 +1,7 @@
1
1
  import type { PaywallData } from "../../data/entities";
2
2
  import { type VariableDictionary } from "../../utils/variable-utils";
3
3
  import type { ColorMode } from "../../types";
4
- declare const Paywall: import("svelte").Component<{
4
+ interface Props {
5
5
  paywallData: PaywallData;
6
6
  onPurchaseClicked?: (selectedPackageId: string) => void;
7
7
  onBackClicked?: () => void;
@@ -12,6 +12,7 @@ declare const Paywall: import("svelte").Component<{
12
12
  variablesPerPackage?: Record<string, VariableDictionary>;
13
13
  preferredColorMode?: ColorMode;
14
14
  onError?: (error: unknown) => void;
15
- }, {}, "">;
15
+ }
16
+ declare const Paywall: import("svelte").Component<Props, {}, "">;
16
17
  type Paywall = ReturnType<typeof Paywall>;
17
18
  export default Paywall;
@@ -4,4 +4,4 @@ export declare function getBackgroundStyles({ background, colorMode, }: {
4
4
  background?: BaseNodeBackgroundType;
5
5
  colorMode: ColorMode;
6
6
  }): string;
7
- export declare function getBackgroundImageSource(paywallData: PaywallData, colorMode: ColorMode): string;
7
+ export declare function getBackgroundImageSource(paywallData: PaywallData, colorMode: ColorMode): string | undefined;
@@ -1,3 +1,4 @@
1
+ import { DEFAULT_COLOR_MODE } from "../../utils/constants";
1
2
  import { getColor, prefixObject, stringifyStyles, } from "../../utils/style-utils";
2
3
  export function getBackgroundStyles({ background, colorMode, }) {
3
4
  const styles = { "--background": "initial" };
@@ -19,5 +20,5 @@ export function getBackgroundImageSource(paywallData, colorMode) {
19
20
  const backgroundObject = paywallData.components_config.base
20
21
  .background;
21
22
  return (backgroundObject.value[colorMode]?.original ||
22
- backgroundObject.value["light"]?.original);
23
+ backgroundObject.value[DEFAULT_COLOR_MODE]?.original);
23
24
  }
@@ -2,8 +2,9 @@
2
2
  import { defineMeta } from "@storybook/addon-svelte-csf";
3
3
  import PurchaseButton from "./PurchaseButton.svelte";
4
4
  import type { PurchaseState } from "../../data/state";
5
- import type { ColorMode, DimensionType } from "../../types";
5
+ import type { DimensionType } from "../../types";
6
6
  import type { SupportedActions } from "../../data/entities";
7
+ import { DEFAULT_COLOR_MODE } from "../../utils/constants";
7
8
 
8
9
  const onAction = (action: SupportedActions) => {
9
10
  alert(action.type);
@@ -33,7 +34,7 @@
33
34
  },
34
35
  };
35
36
  const purchaseState: PurchaseState = {
36
- colorMode: "light" as ColorMode,
37
+ colorMode: DEFAULT_COLOR_MODE,
37
38
  locale: "en_US",
38
39
  defaultLocale: "en_US",
39
40
  };
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import type { PurchaseButtonProps } from "../../data/entities";
3
3
  import Stack from "../stack/Stack.svelte";
4
- import { Button } from "../../index";
4
+ import { ButtonDeprecated } from "../../index";
5
5
  import { getPurchaseButtonStyles } from "./purchase-button-utils";
6
6
 
7
7
  const {
@@ -30,13 +30,13 @@
30
30
  );
31
31
  </script>
32
32
 
33
- <Button
33
+ <ButtonDeprecated
34
34
  onclick={handleClick}
35
35
  class="rc-pw-purchase-button"
36
36
  style={buttonStyles}
37
37
  >
38
38
  <Stack {...stack} {labels} {purchaseState} {variableDictionary} />
39
- </Button>
39
+ </ButtonDeprecated>
40
40
 
41
41
  <style>
42
42
  .rc-pw-purchase-button {
@@ -12,6 +12,11 @@
12
12
  import { labelsData as labels } from "../../stories/fixtures";
13
13
  import type { PurchaseState } from "../../data/state";
14
14
  import type { PaywallComponent } from "../../data/entities";
15
+ import {
16
+ DEFAULT_BACKGROUND_COLOR,
17
+ DEFAULT_COLOR_MODE,
18
+ DEFAULT_TEXT_COLOR,
19
+ } from "../../utils/constants";
15
20
 
16
21
  const { Story } = defineMeta({
17
22
  title: "Components/Stack",
@@ -35,7 +40,7 @@
35
40
  const purchaseState: PurchaseState = {
36
41
  locale: "en_US",
37
42
  defaultLocale: "en_US",
38
- colorMode: "light",
43
+ colorMode: DEFAULT_COLOR_MODE,
39
44
  };
40
45
 
41
46
  const components: PaywallComponent[] = [
@@ -379,7 +384,7 @@
379
384
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
380
385
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
381
386
  text_lid: "badge",
382
- color: { light: { type: "hex", value: "#000000" } },
387
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
383
388
  font_weight: "bold",
384
389
  font_size: "body_s",
385
390
  horizontal_alignment: "center",
@@ -422,7 +427,7 @@
422
427
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
423
428
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
424
429
  text_lid: "badge",
425
- color: { light: { type: "hex", value: "#000000" } },
430
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
426
431
  font_weight: "bold",
427
432
  font_size: "body_s",
428
433
  horizontal_alignment: "center",
@@ -465,7 +470,7 @@
465
470
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
466
471
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
467
472
  text_lid: "badge",
468
- color: { light: { type: "hex", value: "#000000" } },
473
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
469
474
  font_weight: "bold",
470
475
  font_size: "body_s",
471
476
  horizontal_alignment: "center",
@@ -508,7 +513,7 @@
508
513
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
509
514
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
510
515
  text_lid: "badge",
511
- color: { light: { type: "hex", value: "#000000" } },
516
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
512
517
  font_weight: "bold",
513
518
  font_size: "body_s",
514
519
  horizontal_alignment: "center",
@@ -551,7 +556,7 @@
551
556
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
552
557
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
553
558
  text_lid: "badge",
554
- color: { light: { type: "hex", value: "#000000" } },
559
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
555
560
  font_weight: "bold",
556
561
  font_size: "body_s",
557
562
  horizontal_alignment: "center",
@@ -594,7 +599,7 @@
594
599
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
595
600
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
596
601
  text_lid: "badge",
597
- color: { light: { type: "hex", value: "#000000" } },
602
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
598
603
  font_weight: "bold",
599
604
  font_size: "body_s",
600
605
  horizontal_alignment: "center",
@@ -637,7 +642,7 @@
637
642
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
638
643
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
639
644
  text_lid: "badge",
640
- color: { light: { type: "hex", value: "#000000" } },
645
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
641
646
  font_weight: "bold",
642
647
  font_size: "body_s",
643
648
  horizontal_alignment: "center",
@@ -680,7 +685,7 @@
680
685
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
681
686
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
682
687
  text_lid: "badge",
683
- color: { light: { type: "hex", value: "#000000" } },
688
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
684
689
  font_weight: "bold",
685
690
  font_size: "body_s",
686
691
  horizontal_alignment: "center",
@@ -775,7 +780,7 @@
775
780
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
776
781
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
777
782
  text_lid: "badge",
778
- color: { light: { type: "hex", value: "#000000" } },
783
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
779
784
  font_weight: "bold",
780
785
  font_size: "body_s",
781
786
  horizontal_alignment: "center",
@@ -818,7 +823,7 @@
818
823
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
819
824
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
820
825
  text_lid: "badge",
821
- color: { light: { type: "hex", value: "#000000" } },
826
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
822
827
  font_weight: "bold",
823
828
  font_size: "body_s",
824
829
  horizontal_alignment: "center",
@@ -861,7 +866,7 @@
861
866
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
862
867
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
863
868
  text_lid: "badge",
864
- color: { light: { type: "hex", value: "#000000" } },
869
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
865
870
  font_weight: "bold",
866
871
  font_size: "body_s",
867
872
  horizontal_alignment: "center",
@@ -904,7 +909,7 @@
904
909
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
905
910
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
906
911
  text_lid: "badge",
907
- color: { light: { type: "hex", value: "#000000" } },
912
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
908
913
  font_weight: "bold",
909
914
  font_size: "body_s",
910
915
  horizontal_alignment: "center",
@@ -947,7 +952,7 @@
947
952
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
948
953
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
949
954
  text_lid: "badge",
950
- color: { light: { type: "hex", value: "#000000" } },
955
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
951
956
  font_weight: "bold",
952
957
  font_size: "body_s",
953
958
  horizontal_alignment: "center",
@@ -990,7 +995,7 @@
990
995
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
991
996
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
992
997
  text_lid: "badge",
993
- color: { light: { type: "hex", value: "#000000" } },
998
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
994
999
  font_weight: "bold",
995
1000
  font_size: "body_s",
996
1001
  horizontal_alignment: "center",
@@ -1036,8 +1041,8 @@
1036
1041
  distribution: "space_around",
1037
1042
  },
1038
1043
  background_color: {
1039
- light: { type: "hex", value: "#FFFFFF" },
1040
- dark: { type: "hex", value: "#FFFFFF" },
1044
+ light: { type: "hex", value: DEFAULT_BACKGROUND_COLOR },
1045
+ dark: { type: "hex", value: DEFAULT_BACKGROUND_COLOR },
1041
1046
  },
1042
1047
  components,
1043
1048
  labels,
@@ -1082,7 +1087,7 @@
1082
1087
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1083
1088
  margin: { top: 0, trailing: 0, bottom: 0, leading: 0 },
1084
1089
  text_lid: "badge",
1085
- color: { light: { type: "hex", value: "#000000" } },
1090
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
1086
1091
  font_weight: "bold",
1087
1092
  font_size: "body_s",
1088
1093
  horizontal_alignment: "center",
@@ -1104,8 +1109,8 @@
1104
1109
  distribution: "space_around",
1105
1110
  },
1106
1111
  background_color: {
1107
- light: { type: "hex", value: "#FFFFFF" },
1108
- dark: { type: "hex", value: "#FFFFFF" },
1112
+ light: { type: "hex", value: DEFAULT_BACKGROUND_COLOR },
1113
+ dark: { type: "hex", value: DEFAULT_BACKGROUND_COLOR },
1109
1114
  },
1110
1115
  components,
1111
1116
  labels,
@@ -1150,7 +1155,7 @@
1150
1155
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1151
1156
  margin: { top: 0, trailing: 0, bottom: 0, leading: 0 },
1152
1157
  text_lid: "badge",
1153
- color: { light: { type: "hex", value: "#000000" } },
1158
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
1154
1159
  font_weight: "bold",
1155
1160
  font_size: "body_s",
1156
1161
  horizontal_alignment: "center",
@@ -1171,7 +1176,7 @@
1171
1176
  alignment: "center",
1172
1177
  },
1173
1178
  background_color: {
1174
- light: { type: "hex", value: "#FFFFFF" },
1179
+ light: { type: "hex", value: DEFAULT_BACKGROUND_COLOR },
1175
1180
  },
1176
1181
  components: [
1177
1182
  {
@@ -1231,7 +1236,7 @@
1231
1236
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1232
1237
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
1233
1238
  text_lid: "badge",
1234
- color: { light: { type: "hex", value: "#000000" } },
1239
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
1235
1240
  font_weight: "bold",
1236
1241
  font_size: "body_s",
1237
1242
  horizontal_alignment: "center",
@@ -1290,7 +1295,7 @@
1290
1295
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1291
1296
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
1292
1297
  text_lid: "badge",
1293
- color: { light: { type: "hex", value: "#000000" } },
1298
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
1294
1299
  font_weight: "bold",
1295
1300
  font_size: "body_s",
1296
1301
  horizontal_alignment: "center",
@@ -1349,7 +1354,7 @@
1349
1354
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1350
1355
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
1351
1356
  text_lid: "badge",
1352
- color: { light: { type: "hex", value: "#000000" } },
1357
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
1353
1358
  font_weight: "bold",
1354
1359
  font_size: "body_s",
1355
1360
  horizontal_alignment: "center",
@@ -1408,7 +1413,7 @@
1408
1413
  padding: { top: 4, trailing: 12, bottom: 4, leading: 12 },
1409
1414
  margin: { top: 4, trailing: 4, bottom: 4, leading: 4 },
1410
1415
  text_lid: "badge",
1411
- color: { light: { type: "hex", value: "#000000" } },
1416
+ color: { light: { type: "hex", value: DEFAULT_TEXT_COLOR } },
1412
1417
  font_weight: "bold",
1413
1418
  font_size: "body_s",
1414
1419
  horizontal_alignment: "center",
@@ -10,6 +10,7 @@
10
10
  horizontalAlignmentStoryMeta,
11
11
  } from "../../stories/meta-templates";
12
12
  import type { VariableDictionary } from "../../utils/variable-utils";
13
+ import { DEFAULT_COLOR_MODE, DEFAULT_TEXT_COLOR } from "../../utils/constants";
13
14
 
14
15
  /*
15
16
  * Documentation for this component can be found in https://www.notion.so/revenuecat/Text-e257cb046e104351861f8364ede617be?pvs=4
@@ -52,7 +53,7 @@
52
53
  purchaseState: {
53
54
  locale: "en_US",
54
55
  defaultLocale: "en_US",
55
- colorMode: "light",
56
+ colorMode: DEFAULT_COLOR_MODE,
56
57
  },
57
58
  },
58
59
  });
@@ -157,8 +158,8 @@
157
158
  },
158
159
  },
159
160
  background_color: {
160
- dark: { type: "hex", value: "#000000" },
161
- light: { type: "hex", value: "#000000" },
161
+ dark: { type: "hex", value: DEFAULT_TEXT_COLOR },
162
+ light: { type: "hex", value: DEFAULT_TEXT_COLOR },
162
163
  },
163
164
  name: "hello world!",
164
165
  }}
@@ -212,8 +213,8 @@
212
213
  },
213
214
  },
214
215
  background_color: {
215
- dark: { type: "hex", value: "#000000" },
216
- light: { type: "hex", value: "#000000" },
216
+ dark: { type: "hex", value: DEFAULT_TEXT_COLOR },
217
+ light: { type: "hex", value: DEFAULT_TEXT_COLOR },
217
218
  },
218
219
  name: "hello world!",
219
220
  }}
@@ -1,9 +1,10 @@
1
1
  import { getActiveStateProps, getComponentStyles, getSizeStyle, getTextComponentTag, getTextStyles, prefixObject, stringifyStyles, } from "../../utils/style-utils";
2
+ import { DEFAULT_BACKGROUND_COLOR, DEFAULT_TEXT_COLOR, } from "../../utils/constants";
2
3
  export const defaultColor = {
3
- light: { type: "hex", value: "#000000" },
4
+ light: { type: "hex", value: DEFAULT_TEXT_COLOR },
4
5
  };
5
6
  export const defaultBackgroundColor = {
6
- light: { type: "hex", value: "#FFFFFF" },
7
+ light: { type: "hex", value: DEFAULT_BACKGROUND_COLOR },
7
8
  };
8
9
  /**
9
10
  * Generates comprehensive styles for text components by combining text, component and size styles
@@ -4,6 +4,7 @@
4
4
  import type { PurchaseState } from "../../data/state";
5
5
  import { defaultColor } from "../text/text-utils";
6
6
  import { type TimelineProps } from "../../data/entities";
7
+ import { DEFAULT_COLOR_MODE } from "../../utils/constants";
7
8
 
8
9
  const { Story } = defineMeta({
9
10
  title: "Components/Timeline",
@@ -15,7 +16,7 @@
15
16
  const purchaseState: PurchaseState = {
16
17
  locale: "en_US",
17
18
  defaultLocale: "en_US",
18
- colorMode: "light",
19
+ colorMode: DEFAULT_COLOR_MODE,
19
20
  };
20
21
 
21
22
  const labels = {
package/dist/index.d.ts CHANGED
@@ -3,7 +3,8 @@ export { type PaywallData as PaywallData } from "./data/entities";
3
3
  export { type VariableDictionary } from "./utils/variable-utils";
4
4
  export { default as Paywall } from "./components/paywall/Paywall.svelte";
5
5
  export { default as Stack } from "./components/stack/Stack.svelte";
6
- export { default as Button } from "./components/button/Button.svelte";
6
+ export { default as ButtonDeprecated } from "./components/button/Button.svelte";
7
+ export { default as Button } from "./ui/molecules/button.svelte";
7
8
  export { default as Text } from "./components/text/Text.svelte";
8
9
  export { default as Image } from "./components/image/Image.svelte";
9
10
  export { default as PurchaseButton } from "./components/purchase-button/PurchaseButton.svelte";
package/dist/index.js CHANGED
@@ -4,7 +4,8 @@ export {} from "./data/entities";
4
4
  export {} from "./utils/variable-utils";
5
5
  export { default as Paywall } from "./components/paywall/Paywall.svelte";
6
6
  export { default as Stack } from "./components/stack/Stack.svelte";
7
- export { default as Button } from "./components/button/Button.svelte";
7
+ export { default as ButtonDeprecated } from "./components/button/Button.svelte";
8
+ export { default as Button } from "./ui/molecules/button.svelte";
8
9
  export { default as Text } from "./components/text/Text.svelte";
9
10
  export { default as Image } from "./components/image/Image.svelte";
10
11
  export { default as PurchaseButton } from "./components/purchase-button/PurchaseButton.svelte";
@@ -1,4 +1,5 @@
1
1
  import type { PaywallData } from "../data/entities";
2
+ import type { BrandingAppearance } from "../ui/utils/branding";
2
3
  export declare const paywallData: PaywallData;
3
4
  export declare const alignmentPaywallData: PaywallData;
4
5
  export declare const fontsPaywallData: PaywallData;
@@ -22,3 +23,4 @@ export declare const paywallWithFooter: PaywallData;
22
23
  export declare const errorPaywallData: PaywallData;
23
24
  export declare const fallbackPaywallData: PaywallData;
24
25
  export declare const e2eTestTemplate: PaywallData;
26
+ export declare const brandingAppearances: Record<string, BrandingAppearance | null>;
@@ -24333,3 +24333,39 @@ export const e2eTestTemplate = {
24333
24333
  google: ["TW", "KZ", "MX", "PH", "TH"],
24334
24334
  },
24335
24335
  };
24336
+ export const brandingAppearances = {
24337
+ None: null,
24338
+ Fantastic: {
24339
+ shapes: "rectangle",
24340
+ color_form_bg: "#313131",
24341
+ color_error: "#E79462",
24342
+ color_product_info_bg: "#ffffff",
24343
+ color_buttons_primary: "#AC7DE3",
24344
+ color_accent: "#99BB37",
24345
+ color_page_bg: "#ffffff",
24346
+ font: "sans-serif",
24347
+ show_product_description: true,
24348
+ },
24349
+ Igify: {
24350
+ color_accent: "#969696",
24351
+ color_buttons_primary: "#000000",
24352
+ color_error: "#e61054",
24353
+ color_form_bg: "#FFFFFF",
24354
+ color_page_bg: "#114ab8",
24355
+ color_product_info_bg: "#114ab8",
24356
+ font: "default",
24357
+ shapes: "default",
24358
+ show_product_description: true,
24359
+ },
24360
+ Dipsea: {
24361
+ color_accent: "#DF5539",
24362
+ color_buttons_primary: "#DF5539",
24363
+ color_error: "#F2545B",
24364
+ color_form_bg: "#372CBC",
24365
+ color_page_bg: "#26122F",
24366
+ color_product_info_bg: "#26122F",
24367
+ font: "default",
24368
+ shapes: "pill",
24369
+ show_product_description: false,
24370
+ },
24371
+ };