@sprintup-cms/sdk 1.8.42 → 1.8.45
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.
- package/dist/next/index.cjs +120 -0
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +120 -0
- package/dist/next/index.js.map +1 -1
- package/dist/react/index.cjs +120 -0
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +120 -0
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -442,6 +442,119 @@ function PricingTableBlock({ block }) {
|
|
|
442
442
|
}) })
|
|
443
443
|
] });
|
|
444
444
|
}
|
|
445
|
+
function SplitHeroBlock({ block }) {
|
|
446
|
+
const d = getData(block);
|
|
447
|
+
const imgLeft = d.imagePosition === "left";
|
|
448
|
+
return /* @__PURE__ */ jsx("section", { className: "py-16", children: /* @__PURE__ */ jsxs("div", { className: `flex flex-col ${imgLeft ? "md:flex-row-reverse" : "md:flex-row"} items-center gap-10 md:gap-16 max-w-6xl mx-auto px-4`, children: [
|
|
449
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-5", children: [
|
|
450
|
+
d.title && /* @__PURE__ */ jsx("h1", { className: "text-3xl md:text-5xl font-extrabold tracking-tight text-balance leading-tight", children: d.title }),
|
|
451
|
+
d.subtitle && /* @__PURE__ */ jsx("p", { className: "text-lg text-muted-foreground leading-relaxed text-pretty", children: d.subtitle }),
|
|
452
|
+
(d.button || d.secondaryButton) && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-3 pt-2", children: [
|
|
453
|
+
d.button && /* @__PURE__ */ jsx("a", { href: d.buttonUrl || "#", className: "inline-flex items-center px-6 py-3 rounded-lg bg-primary text-primary-foreground font-semibold text-sm hover:opacity-90 transition-opacity", children: d.button }),
|
|
454
|
+
d.secondaryButton && /* @__PURE__ */ jsx("a", { href: d.secondaryUrl || "#", className: "inline-flex items-center px-6 py-3 rounded-lg border border-border text-foreground font-semibold text-sm hover:bg-muted transition-colors", children: d.secondaryButton })
|
|
455
|
+
] })
|
|
456
|
+
] }),
|
|
457
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 w-full", children: d.image ? /* @__PURE__ */ jsx("img", { src: d.image, alt: d.title || "", className: "w-full rounded-2xl object-cover shadow-lg border border-border" }) : /* @__PURE__ */ jsx("div", { className: "w-full rounded-2xl bg-muted border border-border aspect-video flex items-center justify-center", children: /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "No image set" }) }) })
|
|
458
|
+
] }) });
|
|
459
|
+
}
|
|
460
|
+
function NavbarBlock({ block }) {
|
|
461
|
+
const d = getData(block);
|
|
462
|
+
const links = Array.isArray(d.links) ? d.links : [];
|
|
463
|
+
return /* @__PURE__ */ jsx("header", { className: `w-full border-b border-border bg-background/95 backdrop-blur ${d.sticky ? "sticky top-0 z-50" : ""}`, children: /* @__PURE__ */ jsxs("div", { className: "max-w-6xl mx-auto px-4 h-16 flex items-center justify-between gap-4", children: [
|
|
464
|
+
/* @__PURE__ */ jsxs("a", { href: "/", className: "flex items-center gap-2", children: [
|
|
465
|
+
d.logo && /* @__PURE__ */ jsx("img", { src: d.logo, alt: d.logoText || "Logo", className: "h-8 w-auto" }),
|
|
466
|
+
d.logoText && /* @__PURE__ */ jsx("span", { className: "font-bold text-base", children: d.logoText })
|
|
467
|
+
] }),
|
|
468
|
+
/* @__PURE__ */ jsx("nav", { className: "hidden md:flex items-center gap-6", children: links.map((link, i) => /* @__PURE__ */ jsx("a", { href: link.url || "#", className: "text-sm text-muted-foreground hover:text-foreground transition-colors", children: link.label }, i)) }),
|
|
469
|
+
d.ctaLabel && /* @__PURE__ */ jsx("a", { href: d.ctaUrl || "#", className: "inline-flex items-center px-4 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-semibold hover:opacity-90 transition-opacity", children: d.ctaLabel })
|
|
470
|
+
] }) });
|
|
471
|
+
}
|
|
472
|
+
function AccordionBlock({ block }) {
|
|
473
|
+
const d = getData(block);
|
|
474
|
+
const items = Array.isArray(d.items) ? d.items : [];
|
|
475
|
+
const [open, setOpen] = React.useState(null);
|
|
476
|
+
return /* @__PURE__ */ jsxs("section", { className: "py-8", children: [
|
|
477
|
+
d.title && /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-center mb-6 text-balance", children: d.title }),
|
|
478
|
+
/* @__PURE__ */ jsx("div", { className: "max-w-2xl mx-auto divide-y divide-border border border-border rounded-xl overflow-hidden", children: items.map((item, i) => /* @__PURE__ */ jsxs("div", { children: [
|
|
479
|
+
/* @__PURE__ */ jsxs(
|
|
480
|
+
"button",
|
|
481
|
+
{
|
|
482
|
+
type: "button",
|
|
483
|
+
className: "w-full flex items-center justify-between px-5 py-4 text-left text-sm font-medium hover:bg-muted/50 transition-colors",
|
|
484
|
+
onClick: () => setOpen(open === i ? null : i),
|
|
485
|
+
"aria-expanded": open === i,
|
|
486
|
+
children: [
|
|
487
|
+
/* @__PURE__ */ jsx("span", { children: item.title }),
|
|
488
|
+
/* @__PURE__ */ jsx("svg", { className: `w-4 h-4 text-muted-foreground transition-transform ${open === i ? "rotate-180" : ""}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" }) })
|
|
489
|
+
]
|
|
490
|
+
}
|
|
491
|
+
),
|
|
492
|
+
open === i && /* @__PURE__ */ jsx("div", { className: "px-5 pb-4 text-sm text-muted-foreground leading-relaxed", dangerouslySetInnerHTML: { __html: item.content || "" } })
|
|
493
|
+
] }, i)) })
|
|
494
|
+
] });
|
|
495
|
+
}
|
|
496
|
+
function TabsBlock({ block }) {
|
|
497
|
+
const d = getData(block);
|
|
498
|
+
const tabs = Array.isArray(d.tabs) ? d.tabs : [];
|
|
499
|
+
const [active, setActive] = React.useState(0);
|
|
500
|
+
if (!tabs.length) return null;
|
|
501
|
+
return /* @__PURE__ */ jsxs("div", { className: "py-6", children: [
|
|
502
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1 border-b border-border mb-6 overflow-x-auto", children: tabs.map((tab, i) => /* @__PURE__ */ jsx(
|
|
503
|
+
"button",
|
|
504
|
+
{
|
|
505
|
+
type: "button",
|
|
506
|
+
onClick: () => setActive(i),
|
|
507
|
+
className: `px-4 py-2 text-sm font-medium whitespace-nowrap transition-colors border-b-2 -mb-px ${active === i ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground"}`,
|
|
508
|
+
children: tab.label
|
|
509
|
+
},
|
|
510
|
+
i
|
|
511
|
+
)) }),
|
|
512
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm text-foreground leading-relaxed", dangerouslySetInnerHTML: { __html: tabs[active]?.content || "" } })
|
|
513
|
+
] });
|
|
514
|
+
}
|
|
515
|
+
function ColumnsBlock({ block }) {
|
|
516
|
+
const d = getData(block);
|
|
517
|
+
const items = Array.isArray(d.items) ? d.items : [];
|
|
518
|
+
const cols = Number(d.columns) || 3;
|
|
519
|
+
const gridCols = cols === 2 ? "md:grid-cols-2" : cols === 4 ? "md:grid-cols-4" : "md:grid-cols-3";
|
|
520
|
+
const gap = d.gap === "sm" ? "gap-4" : d.gap === "lg" ? "gap-12" : "gap-8";
|
|
521
|
+
if (!items.length) return null;
|
|
522
|
+
return /* @__PURE__ */ jsx("div", { className: `grid grid-cols-1 ${gridCols} ${gap}`, children: items.map((item, i) => /* @__PURE__ */ jsx("div", { className: "text-sm leading-relaxed", dangerouslySetInnerHTML: { __html: item.content || "" } }, i)) });
|
|
523
|
+
}
|
|
524
|
+
function ContainerBlock({ block }) {
|
|
525
|
+
const d = getData(block);
|
|
526
|
+
const maxW = { sm: "max-w-sm", md: "max-w-md", lg: "max-w-lg", xl: "max-w-xl", "2xl": "max-w-2xl", "4xl": "max-w-4xl", full: "max-w-full" };
|
|
527
|
+
const pad = { none: "", sm: "px-4 py-4", md: "px-6 py-8", lg: "px-8 py-12" };
|
|
528
|
+
return /* @__PURE__ */ jsx("div", { className: `mx-auto ${maxW[d.maxWidth || "4xl"] ?? "max-w-4xl"} ${pad[d.padding || "md"] ?? "px-6 py-8"}`, children: d.content && /* @__PURE__ */ jsx("div", { className: "text-sm leading-relaxed", dangerouslySetInnerHTML: { __html: d.content } }) });
|
|
529
|
+
}
|
|
530
|
+
function CarouselBlock({ block }) {
|
|
531
|
+
const d = getData(block);
|
|
532
|
+
const slides = Array.isArray(d.slides) ? d.slides : [];
|
|
533
|
+
const [current, setCurrent] = React.useState(0);
|
|
534
|
+
React.useEffect(() => {
|
|
535
|
+
if (!d.autoplay || slides.length < 2) return;
|
|
536
|
+
const id = setInterval(() => setCurrent((c) => (c + 1) % slides.length), Number(d.interval) || 4e3);
|
|
537
|
+
return () => clearInterval(id);
|
|
538
|
+
}, [d.autoplay, d.interval, slides.length]);
|
|
539
|
+
if (!slides.length) return null;
|
|
540
|
+
const prev = () => setCurrent((c) => (c - 1 + slides.length) % slides.length);
|
|
541
|
+
const next = () => setCurrent((c) => (c + 1) % slides.length);
|
|
542
|
+
const slide = slides[current];
|
|
543
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative w-full overflow-hidden rounded-xl border border-border bg-muted", children: [
|
|
544
|
+
/* @__PURE__ */ jsxs("div", { className: "relative aspect-video", children: [
|
|
545
|
+
slide.image ? /* @__PURE__ */ jsx("img", { src: slide.image, alt: slide.title || "", className: "w-full h-full object-cover" }) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center text-muted-foreground text-sm", children: "No image" }),
|
|
546
|
+
(slide.title || slide.subtitle) && /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-end pb-8 bg-gradient-to-t from-black/60 to-transparent text-white text-center px-6", children: [
|
|
547
|
+
slide.title && /* @__PURE__ */ jsx("h3", { className: "text-xl font-bold text-balance", children: slide.title }),
|
|
548
|
+
slide.subtitle && /* @__PURE__ */ jsx("p", { className: "text-sm opacity-80 mt-1", children: slide.subtitle })
|
|
549
|
+
] })
|
|
550
|
+
] }),
|
|
551
|
+
d.showArrows !== false && slides.length > 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
552
|
+
/* @__PURE__ */ jsx("button", { onClick: prev, className: "absolute left-3 top-1/2 -translate-y-1/2 w-9 h-9 rounded-full bg-black/40 text-white flex items-center justify-center hover:bg-black/60 transition-colors", "aria-label": "Previous", children: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("polyline", { points: "15 18 9 12 15 6" }) }) }),
|
|
553
|
+
/* @__PURE__ */ jsx("button", { onClick: next, className: "absolute right-3 top-1/2 -translate-y-1/2 w-9 h-9 rounded-full bg-black/40 text-white flex items-center justify-center hover:bg-black/60 transition-colors", "aria-label": "Next", children: /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" }) }) })
|
|
554
|
+
] }),
|
|
555
|
+
d.showDots !== false && slides.length > 1 && /* @__PURE__ */ jsx("div", { className: "absolute bottom-3 left-1/2 -translate-x-1/2 flex gap-1.5", children: slides.map((_, i) => /* @__PURE__ */ jsx("button", { onClick: () => setCurrent(i), className: `w-2 h-2 rounded-full transition-colors ${i === current ? "bg-white" : "bg-white/40"}`, "aria-label": `Slide ${i + 1}` }, i)) })
|
|
556
|
+
] });
|
|
557
|
+
}
|
|
445
558
|
function CardGridBlock({ block }) {
|
|
446
559
|
const d = getData(block);
|
|
447
560
|
const cards = Array.isArray(d.cards) ? d.cards : [];
|
|
@@ -606,6 +719,13 @@ var BUILT_IN = {
|
|
|
606
719
|
"icon-feature": (b) => /* @__PURE__ */ jsx(IconFeatureBlock, { block: b }),
|
|
607
720
|
"feature-grid": (b) => /* @__PURE__ */ jsx(FeatureGridBlock, { block: b }),
|
|
608
721
|
"two-column": (b) => /* @__PURE__ */ jsx(TwoColumnBlock, { block: b }),
|
|
722
|
+
"split-hero": (b) => /* @__PURE__ */ jsx(SplitHeroBlock, { block: b }),
|
|
723
|
+
navbar: (b) => /* @__PURE__ */ jsx(NavbarBlock, { block: b }),
|
|
724
|
+
accordion: (b) => /* @__PURE__ */ jsx(AccordionBlock, { block: b }),
|
|
725
|
+
tabs: (b) => /* @__PURE__ */ jsx(TabsBlock, { block: b }),
|
|
726
|
+
columns: (b) => /* @__PURE__ */ jsx(ColumnsBlock, { block: b }),
|
|
727
|
+
container: (b) => /* @__PURE__ */ jsx(ContainerBlock, { block: b }),
|
|
728
|
+
carousel: (b) => /* @__PURE__ */ jsx(CarouselBlock, { block: b }),
|
|
609
729
|
"product-list": (b) => /* @__PURE__ */ jsx(ProductListBlock, { block: b })
|
|
610
730
|
};
|
|
611
731
|
function CMSBlocks({ blocks, pageType, className = "", custom = {} }) {
|