@neowhale/storefront 0.2.55 → 0.2.57

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.
@@ -1207,7 +1207,7 @@ var WhaleStorefront = (function (exports) {
1207
1207
  fontFamily: "inherit",
1208
1208
  transition: "border-color 0.2s"
1209
1209
  };
1210
- if (status === "success") return /* @__PURE__ */ jsx(SuccessState, { theme, heading: serverMessage?.heading || successHeading, message: serverMessage?.message || successMessage, couponCode: c.coupon_code });
1210
+ if (status === "success") return /* @__PURE__ */ jsx(SuccessState, { theme, heading: serverMessage?.heading || successHeading, message: serverMessage?.message || successMessage, couponCode: c.coupon_code, ctaText: c.success_cta_text, ctaUrl: c.success_cta_url });
1211
1211
  return /* @__PURE__ */ jsx("div", { style: { padding: "3.5rem 1.5rem", maxWidth: 560, margin: "0 auto" }, children: [
1212
1212
  /* @__PURE__ */ jsx("style", { children: `@keyframes lc-spin { to { transform: rotate(360deg) } }` }),
1213
1213
  /* @__PURE__ */ jsx("div", { style: { background: theme.surface, border: `1px solid ${theme.fg}12`, padding: "clamp(2rem, 6vw, 3rem)" }, children: [
@@ -1291,7 +1291,7 @@ var WhaleStorefront = (function (exports) {
1291
1291
  ] })
1292
1292
  ] });
1293
1293
  }
1294
- function SuccessState({ theme, heading, message, couponCode }) {
1294
+ function SuccessState({ theme, heading, message, couponCode, ctaText, ctaUrl }) {
1295
1295
  return /* @__PURE__ */ jsx("div", { style: { padding: "3.5rem 1.5rem", maxWidth: 560, margin: "0 auto" }, children: /* @__PURE__ */ jsx("div", { style: { background: theme.surface, border: `1px solid ${theme.fg}12`, padding: "clamp(2rem, 6vw, 3rem)", textAlign: "center" }, children: [
1296
1296
  /* @__PURE__ */ jsx("h2", { style: {
1297
1297
  fontSize: "clamp(1.5rem, 5vw, 2rem)",
@@ -1313,7 +1313,30 @@ var WhaleStorefront = (function (exports) {
1313
1313
  fontFamily: "monospace",
1314
1314
  letterSpacing: "0.12em",
1315
1315
  color: theme.accent
1316
- }, children: couponCode })
1316
+ }, children: couponCode }),
1317
+ /* @__PURE__ */ jsx(
1318
+ "button",
1319
+ {
1320
+ onClick: () => {
1321
+ window.location.href = ctaUrl || "/shop";
1322
+ },
1323
+ style: {
1324
+ marginTop: "1.5rem",
1325
+ width: "100%",
1326
+ padding: "0.875rem",
1327
+ background: theme.accent,
1328
+ color: "#fff",
1329
+ border: "none",
1330
+ fontSize: "0.85rem",
1331
+ fontWeight: 500,
1332
+ cursor: "pointer",
1333
+ letterSpacing: "0.08em",
1334
+ textTransform: "uppercase",
1335
+ fontFamily: "inherit"
1336
+ },
1337
+ children: ctaText || "shop now"
1338
+ }
1339
+ )
1317
1340
  ] }) });
1318
1341
  }
1319
1342
 
@@ -1930,6 +1953,7 @@ var WhaleStorefront = (function (exports) {
1930
1953
  }
1931
1954
  })();
1932
1955
  const sectionRef = useRef(null);
1956
+ const isHero = section.type === "hero" || section.type === "collage_hero";
1933
1957
  useEffect(() => {
1934
1958
  const el2 = sectionRef.current;
1935
1959
  if (!el2 || typeof IntersectionObserver === "undefined") return;
@@ -1937,18 +1961,28 @@ var WhaleStorefront = (function (exports) {
1937
1961
  ([entry]) => {
1938
1962
  if (entry.isIntersecting) {
1939
1963
  onEvent?.("section_view", { section_id: section.id, section_type: section.type });
1964
+ el2.setAttribute("data-reveal", "visible");
1940
1965
  obs.disconnect();
1941
1966
  }
1942
1967
  },
1943
- { threshold: 0.5 }
1968
+ { threshold: 0.15 }
1944
1969
  );
1945
1970
  obs.observe(el2);
1946
1971
  return () => obs.disconnect();
1947
1972
  }, [section.id, section.type, onEvent]);
1948
- return /* @__PURE__ */ jsx("div", { ref: sectionRef, "data-section-id": section.id, "data-section-type": section.type, children: [
1949
- el,
1950
- showCOA && data?.coa && /* @__PURE__ */ jsx(COAModal, { coa: data.coa, theme, onClose: () => setShowCOA(false) })
1951
- ] });
1973
+ return /* @__PURE__ */ jsx(
1974
+ "div",
1975
+ {
1976
+ ref: sectionRef,
1977
+ "data-section-id": section.id,
1978
+ "data-section-type": section.type,
1979
+ ...!isHero ? { "data-reveal": "" } : {},
1980
+ children: [
1981
+ el,
1982
+ showCOA && data?.coa && /* @__PURE__ */ jsx(COAModal, { coa: data.coa, theme, onClose: () => setShowCOA(false) })
1983
+ ]
1984
+ }
1985
+ );
1952
1986
  }
1953
1987
 
1954
1988
  // src/react/components/landing-page.tsx
@@ -2128,6 +2162,7 @@ var WhaleStorefront = (function (exports) {
2128
2162
  const sorted = [...lp.sections].sort((a, b) => a.order - b.order).filter((s) => isSectionVisible(s, urlParams));
2129
2163
  const sectionData = { ...data, gatewayUrl, landing_page: { slug: lp.slug }, analyticsContext };
2130
2164
  return /* @__PURE__ */ jsx("div", { style: { minHeight: "100dvh", background: theme.bg, color: theme.fg, fontFamily }, children: [
2165
+ /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: LANDING_ANIMATIONS } }),
2131
2166
  lp.custom_css && /* @__PURE__ */ jsx("style", { children: lp.custom_css }),
2132
2167
  logoUrl && /* @__PURE__ */ jsx("div", { style: { padding: "1.5rem", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsx("img", { src: logoUrl, alt: store?.name || "Store", style: { height: 40, objectFit: "contain" } }) }),
2133
2168
  sorted.map((section) => {
@@ -2151,6 +2186,49 @@ var WhaleStorefront = (function (exports) {
2151
2186
  });
2152
2187
  }
2153
2188
  }
2189
+ var LANDING_ANIMATIONS = `
2190
+ @keyframes lp-fadeUp{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}
2191
+ @keyframes lp-fadeIn{from{opacity:0}to{opacity:1}}
2192
+ @keyframes lp-scaleIn{from{opacity:0;transform:scale(0.96)}to{opacity:1;transform:scale(1)}}
2193
+ @keyframes spin{to{transform:rotate(360deg)}}
2194
+
2195
+ /* Hero staggered entrance */
2196
+ [data-section-type="hero"] h1{animation:lp-fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) both}
2197
+ [data-section-type="hero"] p{animation:lp-fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) 0.15s both}
2198
+ [data-section-type="hero"] button,[data-section-type="hero"] a[style*="inline-block"]{animation:lp-fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) 0.3s both}
2199
+ [data-section-type="hero"] form{animation:lp-scaleIn 0.4s cubic-bezier(0.22,1,0.36,1) both}
2200
+
2201
+ /* Scroll reveal \u2014 hidden by default, revealed by IntersectionObserver */
2202
+ [data-reveal]{opacity:0;transform:translateY(20px);transition:opacity 0.7s cubic-bezier(0.22,1,0.36,1),transform 0.7s cubic-bezier(0.22,1,0.36,1)}
2203
+ [data-reveal="visible"]{opacity:1;transform:translateY(0)}
2204
+
2205
+ /* Stagger children inside revealed sections */
2206
+ [data-reveal="visible"] > *{animation:lp-fadeUp 0.6s cubic-bezier(0.22,1,0.36,1) both}
2207
+ [data-reveal="visible"] > *:nth-child(1){animation-delay:0s}
2208
+ [data-reveal="visible"] > *:nth-child(2){animation-delay:0.08s}
2209
+ [data-reveal="visible"] > *:nth-child(3){animation-delay:0.16s}
2210
+ [data-reveal="visible"] > *:nth-child(4){animation-delay:0.24s}
2211
+
2212
+ /* Gallery image hover */
2213
+ [data-section-type="gallery"] img{transition:transform 1.2s cubic-bezier(0.22,1,0.36,1)}
2214
+ [data-section-type="gallery"] div:hover > img{transform:scale(1.03)}
2215
+
2216
+ /* Button hover effects */
2217
+ [data-section-type="cta"] a,[data-section-type="testimonials"] a{transition:opacity 0.3s,background 0.3s,transform 0.2s}
2218
+ [data-section-type="cta"] a:hover{opacity:0.88}
2219
+ [data-section-type="cta"] a:active{transform:scale(0.98)}
2220
+
2221
+ /* Review card hover */
2222
+ .rv-card > div{transition:border-color 0.4s}
2223
+ .rv-card:hover > div{border-color:rgba(255,255,255,0.12)!important}
2224
+
2225
+ /* Location card image hover */
2226
+ [data-section-type="gallery"] [style*="4/5"] img{transition:transform 1.2s cubic-bezier(0.22,1,0.36,1)}
2227
+ [data-section-type="gallery"] [style*="4/5"]:hover img{transform:scale(1.03)}
2228
+
2229
+ /* Smooth logo entrance */
2230
+ [style*="justify-content: center"] > img[alt]{animation:lp-fadeIn 1s cubic-bezier(0.22,1,0.36,1) both}
2231
+ `;
2154
2232
  var screenStyle = {
2155
2233
  minHeight: "100dvh",
2156
2234
  display: "flex",
@@ -2942,7 +2942,7 @@ function LeadCaptureSection({ section, data, theme, onEvent }) {
2942
2942
  fontFamily: "inherit",
2943
2943
  transition: "border-color 0.2s"
2944
2944
  };
2945
- if (status === "success") return /* @__PURE__ */ jsxRuntime.jsx(SuccessState, { theme, heading: serverMessage?.heading || successHeading, message: serverMessage?.message || successMessage, couponCode: c.coupon_code });
2945
+ if (status === "success") return /* @__PURE__ */ jsxRuntime.jsx(SuccessState, { theme, heading: serverMessage?.heading || successHeading, message: serverMessage?.message || successMessage, couponCode: c.coupon_code, ctaText: c.success_cta_text, ctaUrl: c.success_cta_url });
2946
2946
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "3.5rem 1.5rem", maxWidth: 560, margin: "0 auto" }, children: [
2947
2947
  /* @__PURE__ */ jsxRuntime.jsx("style", { children: `@keyframes lc-spin { to { transform: rotate(360deg) } }` }),
2948
2948
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { background: theme.surface, border: `1px solid ${theme.fg}12`, padding: "clamp(2rem, 6vw, 3rem)" }, children: [
@@ -3026,7 +3026,7 @@ function LeadCaptureSection({ section, data, theme, onEvent }) {
3026
3026
  ] })
3027
3027
  ] });
3028
3028
  }
3029
- function SuccessState({ theme, heading, message, couponCode }) {
3029
+ function SuccessState({ theme, heading, message, couponCode, ctaText, ctaUrl }) {
3030
3030
  return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "3.5rem 1.5rem", maxWidth: 560, margin: "0 auto" }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { background: theme.surface, border: `1px solid ${theme.fg}12`, padding: "clamp(2rem, 6vw, 3rem)", textAlign: "center" }, children: [
3031
3031
  /* @__PURE__ */ jsxRuntime.jsx("h2", { style: {
3032
3032
  fontSize: "clamp(1.5rem, 5vw, 2rem)",
@@ -3048,7 +3048,30 @@ function SuccessState({ theme, heading, message, couponCode }) {
3048
3048
  fontFamily: "monospace",
3049
3049
  letterSpacing: "0.12em",
3050
3050
  color: theme.accent
3051
- }, children: couponCode })
3051
+ }, children: couponCode }),
3052
+ /* @__PURE__ */ jsxRuntime.jsx(
3053
+ "button",
3054
+ {
3055
+ onClick: () => {
3056
+ window.location.href = ctaUrl || "/shop";
3057
+ },
3058
+ style: {
3059
+ marginTop: "1.5rem",
3060
+ width: "100%",
3061
+ padding: "0.875rem",
3062
+ background: theme.accent,
3063
+ color: "#fff",
3064
+ border: "none",
3065
+ fontSize: "0.85rem",
3066
+ fontWeight: 500,
3067
+ cursor: "pointer",
3068
+ letterSpacing: "0.08em",
3069
+ textTransform: "uppercase",
3070
+ fontFamily: "inherit"
3071
+ },
3072
+ children: ctaText || "shop now"
3073
+ }
3074
+ )
3052
3075
  ] }) });
3053
3076
  }
3054
3077
  var GOOGLE_G_LG = '<svg width="28" height="28" viewBox="0 0 48 48"><path fill="#EA4335" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"/><path fill="#4285F4" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"/><path fill="#FBBC05" d="M10.53 28.59a14.5 14.5 0 010-9.18l-7.98-6.19a24.03 24.03 0 000 21.56l7.98-6.19z"/><path fill="#34A853" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"/></svg>';
@@ -3661,6 +3684,7 @@ function SectionRenderer({
3661
3684
  }
3662
3685
  })();
3663
3686
  const sectionRef = react.useRef(null);
3687
+ const isHero = section.type === "hero" || section.type === "collage_hero";
3664
3688
  react.useEffect(() => {
3665
3689
  const el2 = sectionRef.current;
3666
3690
  if (!el2 || typeof IntersectionObserver === "undefined") return;
@@ -3668,18 +3692,28 @@ function SectionRenderer({
3668
3692
  ([entry]) => {
3669
3693
  if (entry.isIntersecting) {
3670
3694
  onEvent?.("section_view", { section_id: section.id, section_type: section.type });
3695
+ el2.setAttribute("data-reveal", "visible");
3671
3696
  obs.disconnect();
3672
3697
  }
3673
3698
  },
3674
- { threshold: 0.5 }
3699
+ { threshold: 0.15 }
3675
3700
  );
3676
3701
  obs.observe(el2);
3677
3702
  return () => obs.disconnect();
3678
3703
  }, [section.id, section.type, onEvent]);
3679
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: sectionRef, "data-section-id": section.id, "data-section-type": section.type, children: [
3680
- el,
3681
- showCOA && data?.coa && /* @__PURE__ */ jsxRuntime.jsx(COAModal, { coa: data.coa, theme, onClose: () => setShowCOA(false) })
3682
- ] });
3704
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3705
+ "div",
3706
+ {
3707
+ ref: sectionRef,
3708
+ "data-section-id": section.id,
3709
+ "data-section-type": section.type,
3710
+ ...!isHero ? { "data-reveal": "" } : {},
3711
+ children: [
3712
+ el,
3713
+ showCOA && data?.coa && /* @__PURE__ */ jsxRuntime.jsx(COAModal, { coa: data.coa, theme, onClose: () => setShowCOA(false) })
3714
+ ]
3715
+ }
3716
+ );
3683
3717
  }
3684
3718
  function QRLandingPage({
3685
3719
  code,
@@ -4155,6 +4189,7 @@ function PageLayout({
4155
4189
  const sorted = [...lp.sections].sort((a, b) => a.order - b.order).filter((s) => isSectionVisible(s, urlParams));
4156
4190
  const sectionData = { ...data, gatewayUrl, landing_page: { slug: lp.slug }, analyticsContext };
4157
4191
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minHeight: "100dvh", background: theme.bg, color: theme.fg, fontFamily }, children: [
4192
+ /* @__PURE__ */ jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: LANDING_ANIMATIONS } }),
4158
4193
  lp.custom_css && /* @__PURE__ */ jsxRuntime.jsx("style", { children: lp.custom_css }),
4159
4194
  logoUrl && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "1.5rem", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoUrl, alt: store?.name || "Store", style: { height: 40, objectFit: "contain" } }) }),
4160
4195
  sorted.map((section) => {
@@ -4178,6 +4213,49 @@ function sendEvents(gwUrl, slug, events) {
4178
4213
  });
4179
4214
  }
4180
4215
  }
4216
+ var LANDING_ANIMATIONS = `
4217
+ @keyframes lp-fadeUp{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}
4218
+ @keyframes lp-fadeIn{from{opacity:0}to{opacity:1}}
4219
+ @keyframes lp-scaleIn{from{opacity:0;transform:scale(0.96)}to{opacity:1;transform:scale(1)}}
4220
+ @keyframes spin{to{transform:rotate(360deg)}}
4221
+
4222
+ /* Hero staggered entrance */
4223
+ [data-section-type="hero"] h1{animation:lp-fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) both}
4224
+ [data-section-type="hero"] p{animation:lp-fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) 0.15s both}
4225
+ [data-section-type="hero"] button,[data-section-type="hero"] a[style*="inline-block"]{animation:lp-fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) 0.3s both}
4226
+ [data-section-type="hero"] form{animation:lp-scaleIn 0.4s cubic-bezier(0.22,1,0.36,1) both}
4227
+
4228
+ /* Scroll reveal \u2014 hidden by default, revealed by IntersectionObserver */
4229
+ [data-reveal]{opacity:0;transform:translateY(20px);transition:opacity 0.7s cubic-bezier(0.22,1,0.36,1),transform 0.7s cubic-bezier(0.22,1,0.36,1)}
4230
+ [data-reveal="visible"]{opacity:1;transform:translateY(0)}
4231
+
4232
+ /* Stagger children inside revealed sections */
4233
+ [data-reveal="visible"] > *{animation:lp-fadeUp 0.6s cubic-bezier(0.22,1,0.36,1) both}
4234
+ [data-reveal="visible"] > *:nth-child(1){animation-delay:0s}
4235
+ [data-reveal="visible"] > *:nth-child(2){animation-delay:0.08s}
4236
+ [data-reveal="visible"] > *:nth-child(3){animation-delay:0.16s}
4237
+ [data-reveal="visible"] > *:nth-child(4){animation-delay:0.24s}
4238
+
4239
+ /* Gallery image hover */
4240
+ [data-section-type="gallery"] img{transition:transform 1.2s cubic-bezier(0.22,1,0.36,1)}
4241
+ [data-section-type="gallery"] div:hover > img{transform:scale(1.03)}
4242
+
4243
+ /* Button hover effects */
4244
+ [data-section-type="cta"] a,[data-section-type="testimonials"] a{transition:opacity 0.3s,background 0.3s,transform 0.2s}
4245
+ [data-section-type="cta"] a:hover{opacity:0.88}
4246
+ [data-section-type="cta"] a:active{transform:scale(0.98)}
4247
+
4248
+ /* Review card hover */
4249
+ .rv-card > div{transition:border-color 0.4s}
4250
+ .rv-card:hover > div{border-color:rgba(255,255,255,0.12)!important}
4251
+
4252
+ /* Location card image hover */
4253
+ [data-section-type="gallery"] [style*="4/5"] img{transition:transform 1.2s cubic-bezier(0.22,1,0.36,1)}
4254
+ [data-section-type="gallery"] [style*="4/5"]:hover img{transform:scale(1.03)}
4255
+
4256
+ /* Smooth logo entrance */
4257
+ [style*="justify-content: center"] > img[alt]{animation:lp-fadeIn 1s cubic-bezier(0.22,1,0.36,1) both}
4258
+ `;
4181
4259
  var screenStyle = {
4182
4260
  minHeight: "100dvh",
4183
4261
  display: "flex",