@revenuecat/purchases-ui-js 4.12.3 → 4.12.4

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.
@@ -360,6 +360,16 @@
360
360
 
361
361
  const lastPage = pages.length - 1;
362
362
 
363
+ const pagesWithShadow: CarouselProps["pages"] = pages.map((page) => ({
364
+ ...page,
365
+ shadow: {
366
+ x: 0,
367
+ y: 4,
368
+ radius: 14,
369
+ color: { light: { type: "hex", value: "#00000040" } },
370
+ },
371
+ }));
372
+
363
373
  const { Story } = defineMeta({
364
374
  title: "Components/Carousel",
365
375
  component: Carousel,
@@ -1085,3 +1095,45 @@
1085
1095
  },
1086
1096
  }}
1087
1097
  />
1098
+
1099
+ <Story
1100
+ name="Page shadows"
1101
+ args={{
1102
+ padding: { top: 16, bottom: 16, leading: 0, trailing: 0 },
1103
+ page_alignment: "top",
1104
+ page_control: null,
1105
+ auto_advance: null,
1106
+ pages: pagesWithShadow,
1107
+ }}
1108
+ />
1109
+
1110
+ <Story
1111
+ name="Rounded gradient border with page shadows"
1112
+ args={{
1113
+ padding: { top: 16, bottom: 16, leading: 16, trailing: 16 },
1114
+ shape: {
1115
+ type: "rectangle",
1116
+ corners: {
1117
+ top_leading: 24,
1118
+ top_trailing: 24,
1119
+ bottom_leading: 24,
1120
+ bottom_trailing: 24,
1121
+ },
1122
+ },
1123
+ border: {
1124
+ width: 4,
1125
+ color: {
1126
+ light: {
1127
+ type: "linear",
1128
+ degrees: 90,
1129
+ points: [
1130
+ { color: "#000000", percent: 0 },
1131
+ { color: "#FF0000", percent: 100 },
1132
+ ],
1133
+ },
1134
+ },
1135
+ },
1136
+ auto_advance: null,
1137
+ pages: pagesWithShadow,
1138
+ }}
1139
+ />
@@ -72,7 +72,6 @@
72
72
  const carouselStyle = $derived(
73
73
  css({
74
74
  margin: mapSpacing(margin),
75
- padding: mapSpacing(padding),
76
75
  ...videoBackgroundHostStyles({
77
76
  hasVideoBg,
78
77
  positionRelative: true,
@@ -85,6 +84,9 @@
85
84
  }),
86
85
  );
87
86
 
87
+ // Padding lives inside the clip so page shadows can paint into it.
88
+ const clipStyle = $derived(css({ padding: mapSpacing(padding) }));
89
+
88
90
  const sliderStyle = $derived(
89
91
  css({
90
92
  gap: px(page_spacing),
@@ -321,7 +323,7 @@
321
323
  />
322
324
  </div>
323
325
  {/if}
324
- <div class="carousel-clip">
326
+ <div class="carousel-clip" style={clipStyle}>
325
327
  <div
326
328
  bind:this={slider}
327
329
  bind:clientWidth={carouselWidth}
@@ -162,8 +162,9 @@ const conditionMatches = (condition, context) => {
162
162
  if (condition.type === "error")
163
163
  return !!context.error;
164
164
  if (condition.type === "multiple_intro_offers") {
165
- // No web data source for this; never matches.
166
- return false;
165
+ // A Web Billing multiphase offer has a free trial followed by an
166
+ // introductory price.
167
+ return (!!context.packageInfo?.hasTrial && !!context.packageInfo?.hasIntroOffer);
167
168
  }
168
169
  if (condition.type === "intro_offer" ||
169
170
  condition.type === "intro_offer_condition") {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@revenuecat/purchases-ui-js",
3
3
  "description": "Web components for Paywalls. Powered by RevenueCat",
4
4
  "private": false,
5
- "version": "4.12.3",
5
+ "version": "4.12.4",
6
6
  "author": {
7
7
  "name": "RevenueCat, Inc."
8
8
  },