@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
@@ -1,104 +1,52 @@
1
1
  <script module lang="ts">
2
2
  import ButtonNode from "./ButtonNode.svelte";
3
- import type { StackProps, TextNodeProps } from "../../data/entities";
3
+ import type { TextNodeProps } from "../../types/components/text";
4
+ import { componentDecorator } from "../../stories/component-decorator";
4
5
  import { localizationDecorator } from "../../stories/localization-decorator";
6
+ import type { ButtonProps } from "../../types/components/button";
7
+ import type { StackProps } from "../../types/components/stack";
5
8
  import { DEFAULT_TEXT_COLOR } from "../../utils/constants";
6
9
  import { defineMeta } from "@storybook/addon-svelte-csf";
7
10
 
8
- const defaultLocale = "en_US";
9
-
10
- const { Story } = defineMeta({
11
- title: "Components/Button",
12
- component: ButtonNode,
13
- tags: ["autodocs"],
14
- decorators: [
15
- localizationDecorator({
16
- defaultLocale,
17
- localizations: {
18
- [defaultLocale]: {
19
- id1: "Restore purchases",
20
- id2: "Navigate back",
21
- id3: "Navigate to",
22
- id4: "URL navigation",
23
- },
24
- },
25
- }),
26
- ],
27
- argTypes: {
28
- action: {
29
- control: { type: "object" },
30
- description: "Action configuration for the button",
31
- table: {
32
- type: {
33
- summary: "object",
34
- detail: `{
35
- type: "restore_purchases" | "navigate_back" | "navigate_to",
36
- destination?: "customer_center" | "privacy_policy" | "terms" | "url",
37
- url?: {
38
- url_lid: string,
39
- method: "in_app_browser" | "external_browser" | "deep_link"
40
- }
41
- }`,
42
- },
43
- },
44
- },
45
- stack: {
46
- control: { type: "object" },
47
- description: "Stack configuration for button content",
48
- table: {
49
- type: {
50
- summary: "object",
51
- detail: "StackProps",
52
- },
53
- },
54
- },
11
+ const textProps = (id: number): TextNodeProps => ({
12
+ type: "text",
13
+ id: `button-text-${id}`,
14
+ name: `button-text-${id}`,
15
+ text_lid: `id${id}`,
16
+ font_size: "body_m",
17
+ font_weight: "medium",
18
+ horizontal_alignment: "center",
19
+ size: {
20
+ width: { type: "fit" },
21
+ height: { type: "fit" },
22
+ },
23
+ margin: { top: 0, trailing: 0, bottom: 0, leading: 0 },
24
+ padding: { top: 0, trailing: 0, bottom: 0, leading: 0 },
25
+ color: {
26
+ dark: { type: "hex", value: DEFAULT_TEXT_COLOR },
27
+ light: { type: "hex", value: "#ffffff" },
28
+ },
29
+ background_color: {
30
+ dark: { type: "hex", value: "transparent" },
31
+ light: { type: "hex", value: "transparent" },
55
32
  },
56
33
  });
57
34
 
58
- const textProps = (id: number) =>
59
- ({
60
- type: "text",
61
- name: "Button Text",
62
- id: "button-text-1",
63
- text_lid: `id${id}`,
64
- font_weight: "medium",
65
- horizontal_alignment: "center",
66
- background_color: {
67
- dark: { type: "hex", value: "transparent" },
68
- light: { type: "hex", value: "transparent" },
69
- },
70
- color: {
71
- dark: { type: "hex", value: DEFAULT_TEXT_COLOR },
72
- light: { type: "hex", value: "#ffffff" },
73
- },
74
- font_size: "body_m",
75
- margin: { top: 0, trailing: 0, bottom: 0, leading: 0 },
76
- padding: { top: 0, trailing: 0, bottom: 0, leading: 0 },
77
- size: {
78
- width: { type: "fit" },
79
- height: { type: "fit" },
80
- },
81
- }) satisfies Partial<TextNodeProps>;
82
-
83
- const baseStackProps = {
35
+ const stackProps = (id: number): StackProps => ({
84
36
  type: "stack",
37
+ id: `stack-${id}`,
38
+ name: `Stack ${id}`,
39
+ components: [textProps(id)],
85
40
  size: { width: { type: "fill" }, height: { type: "fill" } },
86
41
  dimension: {
87
42
  type: "horizontal",
88
43
  alignment: "center",
89
44
  distribution: "center",
90
45
  },
91
- components: [],
92
46
  spacing: 16,
93
- padding: { top: 16, trailing: 16, bottom: 16, leading: 16 },
94
47
  margin: { top: 0, trailing: 0, bottom: 0, leading: 0 },
95
- shape: { type: "pill" },
96
- id: "vertical-stack",
97
- name: "Vertical Stack",
98
- background_color: {
99
- dark: { type: "hex", value: "#3471eb" },
100
- light: { type: "hex", value: "#3471eb" },
101
- },
48
+ padding: { top: 16, trailing: 16, bottom: 16, leading: 16 },
49
+ background_color: null,
102
50
  background: {
103
51
  type: "color",
104
52
  value: {
@@ -107,31 +55,54 @@
107
55
  },
108
56
  },
109
57
  border: null,
58
+ shape: { type: "pill" },
110
59
  shadow: null,
111
- } satisfies Partial<StackProps>;
60
+ badge: null,
61
+ });
62
+
63
+ const defaultLocale = "en_US";
64
+
65
+ const { Story } = defineMeta({
66
+ title: "Components/Button",
67
+ component: ButtonNode,
68
+ decorators: [
69
+ componentDecorator(),
70
+ localizationDecorator({
71
+ defaultLocale,
72
+ localizations: {
73
+ [defaultLocale]: {
74
+ id1: "Restore purchases",
75
+ id2: "Navigate back",
76
+ id3: "Navigate to",
77
+ id4: "URL navigation",
78
+ },
79
+ },
80
+ }),
81
+ ],
82
+ args: {
83
+ type: "button",
84
+ id: "button",
85
+ name: "Button",
86
+ action: { type: "navigate_back" },
87
+ stack: stackProps(1),
88
+ } satisfies ButtonProps,
89
+ });
112
90
  </script>
113
91
 
114
- <!-- Restore purchases -->
115
92
  <Story
116
93
  name="Restore purchases"
117
94
  args={{
118
- type: "button",
119
95
  action: { type: "restore_purchases" },
120
- stack: {
121
- ...baseStackProps,
122
- components: [textProps(1)],
123
- },
96
+ stack: stackProps(1),
124
97
  }}
125
98
  />
126
99
 
127
- <!-- Navigate Back story -->
128
100
  <Story
129
101
  name="Navigate Back"
130
102
  args={{
131
- type: "button",
132
103
  action: { type: "navigate_back" },
133
104
  stack: {
134
- ...baseStackProps,
105
+ ...stackProps(2),
135
106
  shape: {
136
107
  type: "rectangle",
137
108
  corners: {
@@ -145,22 +116,19 @@
145
116
  dark: { type: "hex", value: "#2E7D32" },
146
117
  light: { type: "hex", value: "#2E7D32" },
147
118
  },
148
- components: [textProps(2)],
149
119
  },
150
120
  }}
151
121
  />
152
122
 
153
- <!-- Navigate To story -->
154
123
  <Story
155
124
  name="Navigate To"
156
125
  args={{
157
- type: "button",
158
126
  action: {
159
127
  type: "navigate_to",
160
128
  destination: "customer_center",
161
129
  },
162
130
  stack: {
163
- ...baseStackProps,
131
+ ...stackProps(3),
164
132
  shape: {
165
133
  type: "rectangle",
166
134
  corners: {
@@ -174,16 +142,13 @@
174
142
  dark: { type: "hex", value: "#D32F2F" },
175
143
  light: { type: "hex", value: "#D32F2F" },
176
144
  },
177
- components: [textProps(3)],
178
145
  },
179
146
  }}
180
147
  />
181
148
 
182
- <!-- URL Navigation story -->
183
149
  <Story
184
150
  name="URL Navigation"
185
151
  args={{
186
- type: "button",
187
152
  action: {
188
153
  type: "navigate_to",
189
154
  destination: "url",
@@ -193,12 +158,11 @@
193
158
  },
194
159
  },
195
160
  stack: {
196
- ...baseStackProps,
161
+ ...stackProps(4),
197
162
  background_color: {
198
163
  dark: { type: "hex", value: "#4A90E2" },
199
164
  light: { type: "hex", value: "#4A90E2" },
200
165
  },
201
- components: [textProps(4)],
202
166
  },
203
167
  }}
204
168
  />
@@ -1,37 +1,12 @@
1
1
  <script lang="ts">
2
- import { getButtonStyles } from "./button-utils";
3
2
  import Stack from "../stack/Stack.svelte";
4
- import { ButtonDeprecated } from "../../index";
5
3
  import { getPaywallContext } from "../../stores/paywall";
6
4
  import type { ButtonProps } from "../../types/components/button";
7
5
 
8
- const { stack, action, ...restProps }: ButtonProps = $props();
6
+ const { stack, action }: ButtonProps = $props();
9
7
  const { onButtonAction } = getPaywallContext();
10
8
 
11
9
  const onclick = () => onButtonAction(action);
12
-
13
- const buttonStyles = $derived(
14
- getButtonStyles({
15
- stack,
16
- action,
17
- ...restProps,
18
- }),
19
- );
20
10
  </script>
21
11
 
22
- <ButtonDeprecated {onclick} style={buttonStyles} class={"rc-pw-button"}>
23
- <Stack {...stack} />
24
- </ButtonDeprecated>
25
-
26
- <style>
27
- .rc-pw-button {
28
- display: flex;
29
- margin: 0;
30
- padding: 0;
31
- text-align: initial;
32
- border: none;
33
- cursor: pointer;
34
- background: transparent;
35
- width: fit-content;
36
- }
37
- </style>
12
+ <Stack {...stack} {onclick} />
@@ -1,6 +1,9 @@
1
1
  <script module lang="ts">
2
2
  import Footer from "./Footer.svelte";
3
+ import { componentDecorator } from "../../stories/component-decorator";
3
4
  import { localizationDecorator } from "../../stories/localization-decorator";
5
+ import { viewportDecorator } from "../../stories/viewport-decorator";
6
+ import type { FooterProps } from "../../types/components/footer";
4
7
  import { defineMeta } from "@storybook/addon-svelte-csf";
5
8
 
6
9
  const defaultLocale = "en_US";
@@ -8,8 +11,8 @@
8
11
  const { Story } = defineMeta({
9
12
  title: "Components/Footer",
10
13
  component: Footer,
11
- tags: ["autodocs"],
12
14
  decorators: [
15
+ componentDecorator(),
13
16
  localizationDecorator({
14
17
  defaultLocale,
15
18
  localizations: {
@@ -19,123 +22,130 @@
19
22
  },
20
23
  }),
21
24
  ],
22
- });
23
- </script>
24
-
25
- <!-- Default -->
26
- <Story
27
- name="Footer component"
28
- args={{
29
- id: "kHhCWlo9au",
30
- name: "",
31
- stack: {
32
- background_color: {
33
- light: {
34
- type: "hex",
35
- value: "#6c6c6cFF",
36
- },
37
- },
38
- background: {
39
- type: "color",
40
- value: {
25
+ args: {
26
+ type: "footer",
27
+ id: "footer",
28
+ name: "Footer",
29
+ stack: {
30
+ background_color: {
41
31
  light: {
42
32
  type: "hex",
43
33
  value: "#6c6c6cFF",
44
34
  },
45
35
  },
46
- },
47
- border: null,
48
- components: [
49
- {
50
- background_color: null,
51
- color: {
36
+ background: {
37
+ type: "color",
38
+ value: {
52
39
  light: {
53
40
  type: "hex",
54
- value: "#ffffffFF",
41
+ value: "#6c6c6cFF",
55
42
  },
56
43
  },
57
- font_name: null,
58
- font_size: "body_m",
59
- font_weight: "extra_bold",
60
- horizontal_alignment: "center",
61
- id: "pFC3qrx4-c",
62
- margin: {
63
- bottom: 0,
64
- leading: 0,
65
- top: 0,
66
- trailing: 0,
67
- },
68
- name: "",
69
- padding: {
70
- bottom: 10,
71
- leading: 10,
72
- top: 10,
73
- trailing: 10,
74
- },
75
- size: {
76
- height: {
77
- type: "fit",
78
- value: null,
44
+ },
45
+ border: null,
46
+ components: [
47
+ {
48
+ background_color: null,
49
+ color: {
50
+ light: {
51
+ type: "hex",
52
+ value: "#ffffffFF",
53
+ },
54
+ },
55
+ font_name: null,
56
+ font_size: "body_m",
57
+ font_weight: "extra_bold",
58
+ horizontal_alignment: "center",
59
+ id: "pFC3qrx4-c",
60
+ margin: {
61
+ bottom: 0,
62
+ leading: 0,
63
+ top: 0,
64
+ trailing: 0,
79
65
  },
80
- width: {
81
- type: "fit",
82
- value: null,
66
+ name: "",
67
+ padding: {
68
+ bottom: 10,
69
+ leading: 10,
70
+ top: 10,
71
+ trailing: 10,
83
72
  },
73
+ size: {
74
+ height: {
75
+ type: "fit",
76
+ value: null,
77
+ },
78
+ width: {
79
+ type: "fit",
80
+ value: null,
81
+ },
82
+ },
83
+ text_lid: "GM2Sytqd5p",
84
+ type: "text",
84
85
  },
85
- text_lid: "GM2Sytqd5p",
86
- type: "text",
86
+ ],
87
+ dimension: {
88
+ type: "vertical",
89
+ alignment: "center",
90
+ distribution: "center",
87
91
  },
88
- ],
89
- dimension: {
90
- type: "vertical",
91
- alignment: "center",
92
- distribution: "center",
93
- },
94
- id: "yI_0xF4hlJ",
95
- margin: {
96
- bottom: 0,
97
- leading: 0,
98
- top: 0,
99
- trailing: 0,
100
- },
101
- name: "Footer",
102
- padding: {
103
- bottom: 0,
104
- leading: 0,
105
- top: 0,
106
- trailing: 0,
107
- },
108
- shadow: {
109
- color: {
110
- light: {
111
- type: "hex",
112
- value: "#00000033",
113
- },
92
+ id: "yI_0xF4hlJ",
93
+ margin: {
94
+ bottom: 0,
95
+ leading: 0,
96
+ top: 0,
97
+ trailing: 0,
114
98
  },
115
- radius: 16,
116
- x: 0,
117
- y: -4,
118
- },
119
- shape: {
120
- corners: {
121
- bottom_leading: 0,
122
- bottom_trailing: 0,
123
- top_leading: 8,
124
- top_trailing: 8,
99
+ name: "Footer",
100
+ padding: {
101
+ bottom: 0,
102
+ leading: 0,
103
+ top: 0,
104
+ trailing: 0,
125
105
  },
126
- type: "rectangle",
127
- },
128
- size: {
129
- height: {
130
- type: "fit",
106
+ shadow: {
107
+ color: {
108
+ light: {
109
+ type: "hex",
110
+ value: "#00FF007F",
111
+ },
112
+ },
113
+ radius: 16,
114
+ x: 0,
115
+ y: -8,
116
+ },
117
+ shape: {
118
+ corners: {
119
+ bottom_leading: 0,
120
+ bottom_trailing: 0,
121
+ top_leading: 8,
122
+ top_trailing: 8,
123
+ },
124
+ type: "rectangle",
131
125
  },
132
- width: {
133
- type: "fill",
126
+ size: {
127
+ height: {
128
+ type: "fit",
129
+ },
130
+ width: {
131
+ type: "fill",
132
+ },
134
133
  },
134
+ spacing: 0,
135
+ type: "stack",
135
136
  },
136
- spacing: 0,
137
- type: "stack",
138
- },
139
- type: "footer",
140
- }}
137
+ } satisfies FooterProps,
138
+ });
139
+ </script>
140
+
141
+ <Story name="Footer component" />
142
+
143
+ <Story
144
+ name="Footer - no overflow"
145
+ decorators={[viewportDecorator(300, 600, 3)]}
146
+ />
147
+
148
+ <Story
149
+ name="Footer - overflow"
150
+ decorators={[viewportDecorator(300, 600, 50)]}
141
151
  />
@@ -2,18 +2,22 @@
2
2
  import Stack from "../stack/Stack.svelte";
3
3
  import type { FooterProps } from "../../types/components/footer";
4
4
 
5
- const { stack, id }: FooterProps = $props();
5
+ const { stack }: FooterProps = $props();
6
6
  </script>
7
7
 
8
- <div class="rc-pw-footer" {id}>
8
+ <div>
9
9
  <Stack {...stack} />
10
10
  </div>
11
11
 
12
12
  <style>
13
- .rc-pw-footer {
13
+ div {
14
14
  position: sticky;
15
15
  bottom: 0;
16
- transform: translateY(50%);
17
16
  width: 100%;
17
+ z-index: 1000;
18
+
19
+ display: flex;
20
+ flex-direction: row;
21
+ justify-content: center;
18
22
  }
19
23
  </style>
@@ -0,0 +1,100 @@
1
+ <script module lang="ts">
2
+ import { componentDecorator } from "../../stories/component-decorator";
3
+ import type { IconBackground, IconProps } from "../../types/components/icon";
4
+ import { defineMeta } from "@storybook/addon-svelte-csf";
5
+ import Icon from "./Icon.svelte";
6
+
7
+ const icon_background = {
8
+ color: {
9
+ light: { type: "hex", value: "#345e0aFF" },
10
+ },
11
+ shape: {
12
+ type: "rectangle",
13
+ corners: {
14
+ top_leading: 0,
15
+ top_trailing: 8,
16
+ bottom_trailing: 16,
17
+ bottom_leading: 32,
18
+ },
19
+ },
20
+ border: {
21
+ width: 4,
22
+ color: {
23
+ light: { type: "hex", value: "#8fb43fff" },
24
+ },
25
+ },
26
+ shadow: {
27
+ x: 4,
28
+ y: 4,
29
+ radius: 8,
30
+ color: {
31
+ light: { type: "hex", value: "#00000040" },
32
+ },
33
+ },
34
+ } satisfies IconBackground;
35
+
36
+ const { Story } = defineMeta({
37
+ title: "Components/Icon",
38
+ component: Icon,
39
+ decorators: [componentDecorator()],
40
+ args: {
41
+ type: "icon",
42
+ id: "icon",
43
+ name: "Icon",
44
+ icon_name: "filled-star",
45
+ base_url: "https://icons.pawwalls.com/icons",
46
+ formats: {
47
+ heic: "filled-star.heic",
48
+ png: "filled-star.png",
49
+ svg: "filled-star.svg",
50
+ webp: "filled-star.webp",
51
+ },
52
+ size: {
53
+ width: { type: "fixed", value: 64 },
54
+ height: { type: "fixed", value: 64 },
55
+ },
56
+ margin: { top: 16, trailing: 16, bottom: 16, leading: 16 },
57
+ padding: { top: 8, trailing: 8, bottom: 8, leading: 8 },
58
+ color: {
59
+ light: { type: "hex", value: "#92c91bFF" },
60
+ },
61
+ icon_background,
62
+ } satisfies IconProps,
63
+ });
64
+ </script>
65
+
66
+ <Story name="Square" />
67
+
68
+ <Story
69
+ name="Rectangle"
70
+ args={{
71
+ size: {
72
+ width: { type: "fixed", value: 128 },
73
+ height: { type: "fixed", value: 64 },
74
+ },
75
+ }}
76
+ />
77
+
78
+ <Story
79
+ name="Circle"
80
+ args={{
81
+ icon_background: {
82
+ ...icon_background,
83
+ shape: { type: "circle" },
84
+ },
85
+ }}
86
+ />
87
+
88
+ <Story
89
+ name="Pill"
90
+ args={{
91
+ size: {
92
+ width: { type: "fixed", value: 128 },
93
+ height: { type: "fixed", value: 64 },
94
+ },
95
+ icon_background: {
96
+ ...icon_background,
97
+ shape: { type: "circle" },
98
+ },
99
+ }}
100
+ />
@@ -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;