@neowhale/storefront 0.2.25 → 0.2.27

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.
@@ -2783,6 +2783,7 @@ function LeadCaptureSection({ section, data, theme }) {
2783
2783
  const c = section.content;
2784
2784
  const [firstName, setFirstName] = react.useState("");
2785
2785
  const [email, setEmail] = react.useState("");
2786
+ const [newsletterOptIn, setNewsletterOptIn] = react.useState(false);
2786
2787
  const [status, setStatus] = react.useState("idle");
2787
2788
  const [errorMsg, setErrorMsg] = react.useState("");
2788
2789
  const gatewayUrl = c.gateway_url || data.gatewayUrl || "https://whale-gateway.fly.dev";
@@ -2802,7 +2803,12 @@ function LeadCaptureSection({ section, data, theme }) {
2802
2803
  first_name: firstName || void 0,
2803
2804
  source: c.source || "landing_page",
2804
2805
  landing_page_slug: slug || void 0,
2805
- tags: c.tags || void 0
2806
+ newsletter_opt_in: newsletterOptIn || void 0,
2807
+ tags: (() => {
2808
+ const t = [...c.tags || []];
2809
+ if (newsletterOptIn) t.push(c.newsletter_tag || "newsletter-subscriber");
2810
+ return t.length > 0 ? t : void 0;
2811
+ })()
2806
2812
  })
2807
2813
  });
2808
2814
  if (!res.ok) {
@@ -2912,6 +2918,33 @@ function LeadCaptureSection({ section, data, theme }) {
2912
2918
  }
2913
2919
  )
2914
2920
  ] }),
2921
+ c.show_newsletter_opt_in !== false && /* @__PURE__ */ jsxRuntime.jsxs("label", { style: {
2922
+ display: "flex",
2923
+ alignItems: "center",
2924
+ gap: "0.5rem",
2925
+ cursor: "pointer",
2926
+ fontSize: "0.8rem",
2927
+ color: `${theme.fg}90`,
2928
+ fontWeight: 300,
2929
+ lineHeight: 1.4
2930
+ }, children: [
2931
+ /* @__PURE__ */ jsxRuntime.jsx(
2932
+ "input",
2933
+ {
2934
+ type: "checkbox",
2935
+ checked: newsletterOptIn,
2936
+ onChange: (e) => setNewsletterOptIn(e.target.checked),
2937
+ style: {
2938
+ width: 16,
2939
+ height: 16,
2940
+ accentColor: theme.accent,
2941
+ cursor: "pointer",
2942
+ flexShrink: 0
2943
+ }
2944
+ }
2945
+ ),
2946
+ c.newsletter_label || "Also sign me up for the newsletter \u2014 new drops, deals, and company news."
2947
+ ] }),
2915
2948
  status === "error" && errorMsg && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "0.8rem", color: "#e55", margin: 0, fontWeight: 400 }, children: errorMsg }),
2916
2949
  /* @__PURE__ */ jsxRuntime.jsxs(
2917
2950
  "button",