@neowhale/storefront 0.2.25 → 0.2.26

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