@sprintup-cms/sdk 1.8.38 → 1.8.41

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.
@@ -638,6 +638,80 @@ var FEATURE_ICONS = {
638
638
  /* @__PURE__ */ jsx("polyline", { points: "17 6 23 6 23 12" })
639
639
  ] })
640
640
  };
641
+ function ButtonBlock({ block }) {
642
+ const d = getData(block);
643
+ const label = d.label || d.text || "Button";
644
+ const url = d.url || "#";
645
+ const variant = d.variant || "default";
646
+ const base = "inline-flex items-center justify-center px-5 py-2.5 rounded-lg text-sm font-medium transition-opacity hover:opacity-90";
647
+ const cls = variant === "outline" ? `${base} border border-primary text-primary bg-transparent` : variant === "ghost" ? `${base} text-primary hover:bg-primary/10` : `${base} bg-primary text-primary-foreground`;
648
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("a", { href: url, className: cls, children: label }) });
649
+ }
650
+ function ListBlock({ block }) {
651
+ const d = getData(block);
652
+ const items = Array.isArray(d.items) ? d.items : [];
653
+ const ordered = Boolean(d.ordered);
654
+ const Tag = ordered ? "ol" : "ul";
655
+ const listCls = ordered ? "list-decimal" : "list-disc";
656
+ return /* @__PURE__ */ jsx(Tag, { className: `${listCls} pl-6 space-y-1.5 text-base text-foreground leading-relaxed`, children: items.map((item, i) => /* @__PURE__ */ jsx("li", { children: item }, i)) });
657
+ }
658
+ function GalleryBlock({ block }) {
659
+ const d = getData(block);
660
+ const images = Array.isArray(d.images) ? d.images : [];
661
+ const cols = Number(d.columns) || 3;
662
+ const gridCols = cols === 2 ? "grid-cols-2" : cols === 4 ? "grid-cols-2 md:grid-cols-4" : "grid-cols-2 md:grid-cols-3";
663
+ if (!images.length) return null;
664
+ return /* @__PURE__ */ jsx("div", { className: `grid gap-3 ${gridCols}`, children: images.filter((img) => img.src).map((img, i) => /* @__PURE__ */ jsxs("figure", { className: "overflow-hidden rounded-lg border border-border", children: [
665
+ /* @__PURE__ */ jsx("img", { src: img.src, alt: img.alt || "", className: "w-full h-48 object-cover" }),
666
+ img.caption && /* @__PURE__ */ jsx("figcaption", { className: "px-2 py-1 text-xs text-muted-foreground text-center", children: img.caption })
667
+ ] }, i)) });
668
+ }
669
+ function PricingTableBlock({ block }) {
670
+ const d = getData(block);
671
+ const tiers = Array.isArray(d.tiers) ? d.tiers : [];
672
+ const [yearly, setYearly] = React.useState(false);
673
+ return /* @__PURE__ */ jsxs("section", { className: "py-12", children: [
674
+ (d.title || d.subtitle) && /* @__PURE__ */ jsxs("div", { className: "text-center mb-8", children: [
675
+ d.title && /* @__PURE__ */ jsx("h2", { className: "text-2xl md:text-3xl font-bold tracking-tight", children: d.title }),
676
+ d.subtitle && /* @__PURE__ */ jsx("p", { className: "mt-2 text-muted-foreground", children: d.subtitle })
677
+ ] }),
678
+ d.billingToggle && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-3 mb-8", children: [
679
+ /* @__PURE__ */ jsx("span", { className: `text-sm ${!yearly ? "font-semibold" : "text-muted-foreground"}`, children: "Monthly" }),
680
+ /* @__PURE__ */ jsx(
681
+ "button",
682
+ {
683
+ onClick: () => setYearly((v) => !v),
684
+ className: `relative w-10 h-6 rounded-full transition-colors ${yearly ? "bg-primary" : "bg-muted"}`,
685
+ "aria-label": "Toggle billing period",
686
+ children: /* @__PURE__ */ jsx("span", { className: `absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-all ${yearly ? "left-5" : "left-1"}` })
687
+ }
688
+ ),
689
+ /* @__PURE__ */ jsx("span", { className: `text-sm ${yearly ? "font-semibold" : "text-muted-foreground"}`, children: "Yearly" })
690
+ ] }),
691
+ /* @__PURE__ */ jsx("div", { className: `grid gap-6 ${tiers.length === 2 ? "md:grid-cols-2" : tiers.length >= 3 ? "md:grid-cols-3" : ""}`, children: tiers.map((tier, i) => {
692
+ const price = yearly ? tier.yearlyPrice ?? tier.monthlyPrice : tier.monthlyPrice;
693
+ const featured = Boolean(tier.featured);
694
+ return /* @__PURE__ */ jsxs("div", { className: `flex flex-col rounded-2xl border p-8 ${featured ? "border-primary bg-primary text-primary-foreground shadow-xl" : "border-border bg-card"}`, children: [
695
+ /* @__PURE__ */ jsxs("div", { className: "mb-6", children: [
696
+ /* @__PURE__ */ jsx("h3", { className: `text-xl font-bold ${featured ? "text-primary-foreground" : ""}`, children: tier.name }),
697
+ tier.description && /* @__PURE__ */ jsx("p", { className: `text-sm mt-1 ${featured ? "text-primary-foreground/70" : "text-muted-foreground"}`, children: tier.description }),
698
+ /* @__PURE__ */ jsxs("div", { className: "mt-4 flex items-end gap-1", children: [
699
+ /* @__PURE__ */ jsxs("span", { className: `text-4xl font-extrabold ${featured ? "text-primary-foreground" : ""}`, children: [
700
+ d.currency ?? "$",
701
+ price ?? 0
702
+ ] }),
703
+ /* @__PURE__ */ jsx("span", { className: `text-sm mb-1 ${featured ? "text-primary-foreground/70" : "text-muted-foreground"}`, children: "/mo" })
704
+ ] })
705
+ ] }),
706
+ /* @__PURE__ */ jsx("ul", { className: "space-y-2 flex-1 mb-8", children: (tier.features ?? []).map((f, j) => /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 text-sm", children: [
707
+ /* @__PURE__ */ jsx("svg", { className: `w-4 h-4 flex-shrink-0 ${f.included ? featured ? "text-primary-foreground" : "text-primary" : "text-muted-foreground opacity-40"}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: f.included ? /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" }) : /* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }) }),
708
+ /* @__PURE__ */ jsx("span", { className: !f.included ? "opacity-50" : "", children: f.text })
709
+ ] }, j)) }),
710
+ tier.cta && /* @__PURE__ */ jsx("a", { href: tier.ctaUrl || "#", className: `block text-center py-2.5 px-6 rounded-lg font-semibold text-sm transition-opacity hover:opacity-90 ${featured ? "bg-primary-foreground text-primary" : "bg-primary text-primary-foreground"}`, children: tier.cta })
711
+ ] }, tier.id || i);
712
+ }) })
713
+ ] });
714
+ }
641
715
  function CardGridBlock({ block }) {
642
716
  const d = getData(block);
643
717
  const cards = Array.isArray(d.cards) ? d.cards : [];
@@ -740,7 +814,7 @@ function FeatureGridBlock({ block }) {
740
814
  feat.icon && /* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-lg bg-primary/10 text-primary flex items-center justify-center flex-shrink-0", children: FEATURE_ICONS[feat.icon] ?? /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "w-5 h-5", children: /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }) }) }),
741
815
  /* @__PURE__ */ jsxs("div", { children: [
742
816
  feat.title && /* @__PURE__ */ jsx("h3", { className: "font-semibold text-base", children: feat.title }),
743
- feat.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1 leading-relaxed", children: feat.description })
817
+ feat.description && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground mt-1 leading-relaxed prose prose-sm max-w-none", dangerouslySetInnerHTML: { __html: feat.description } })
744
818
  ] })
745
819
  ] }, i)) })
746
820
  ] }) });
@@ -780,6 +854,10 @@ var BUILT_IN = {
780
854
  text: (b) => /* @__PURE__ */ jsx(TextBlock, { block: b }),
781
855
  richtext: (b) => /* @__PURE__ */ jsx(RichTextBlock, { block: b }),
782
856
  image: (b) => /* @__PURE__ */ jsx(ImageBlock, { block: b }),
857
+ button: (b) => /* @__PURE__ */ jsx(ButtonBlock, { block: b }),
858
+ list: (b) => /* @__PURE__ */ jsx(ListBlock, { block: b }),
859
+ gallery: (b) => /* @__PURE__ */ jsx(GalleryBlock, { block: b }),
860
+ "pricing-table": (b) => /* @__PURE__ */ jsx(PricingTableBlock, { block: b }),
783
861
  hero: (b) => /* @__PURE__ */ jsx(HeroBlock, { block: b }),
784
862
  "hero-section": (b) => /* @__PURE__ */ jsx(HeroBlock, { block: b }),
785
863
  cta: (b) => /* @__PURE__ */ jsx(CTABlock, { block: b }),
@@ -802,9 +880,7 @@ var BUILT_IN = {
802
880
  };
803
881
  function CMSBlocks({ blocks, pageType, className = "", custom = {} }) {
804
882
  if (!blocks?.length) return null;
805
- console.log("[v0] CMSBlocks received blocks:", blocks.map((b) => ({ id: b.id, type: b.type, hasData: !!b.data, hasContent: !!b.content, dataKeys: Object.keys(b.data ?? b.content ?? {}) })));
806
883
  return /* @__PURE__ */ jsx("div", { className: `space-y-8 ${className}`, children: blocks.map((block) => {
807
- console.log("[v0] rendering block type:", block.type, "inBuiltIn:", !!BUILT_IN[block.type]);
808
884
  if (custom[block.type]) return /* @__PURE__ */ jsx(React.Fragment, { children: custom[block.type](block) }, block.id);
809
885
  if (BUILT_IN[block.type]) return /* @__PURE__ */ jsx(React.Fragment, { children: BUILT_IN[block.type](block, pageType) }, block.id);
810
886
  return /* @__PURE__ */ jsx(SectionBlock, { block, pageType }, block.id);