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