@frontlit/page-builder 0.1.0-alpha.8 → 0.1.0-alpha.9

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.
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { NavLink, VideoWithPreview, TextRenderer, InlineEmbed } from './chunk-QMUIISN3.js';
3
- import { Button2, Section, cn, Image, Preheader, Display, Subheader1, CodeSnippet, Caption, PageCard, PageCardContent, Header2, Header1, Header4, Text2, Badge, PageCardHeader, Text1, Link, Header3, Drawer, Label, Switch2, Input } from './chunk-KRQWGGAJ.js';
3
+ import { Button2, Section, cn, Image, Preheader, Display, Subheader1, CodeSnippet, Caption, PageCard, PageCardContent, Header2, Header1, Header4, Text2, Badge, PageCardHeader, Text1, Link, Header3, Drawer, Label, Switch2, Input } from './chunk-BLCA5IS5.js';
4
4
  import { getMediaUrl, getMediaAlt } from './chunk-XU7ALPGQ.js';
5
5
  import clsx3 from 'clsx';
6
6
  import * as Icons from 'lucide-react';
@@ -882,6 +882,9 @@ function renderTitle(title, theme) {
882
882
  (part, index) => /^\*[^*]+\*$/.test(part) ? React2.createElement("span", { key: index, className }, part.slice(1, -1)) : part
883
883
  );
884
884
  }
885
+ function itemHeadingLevel(titleLevel = "h2") {
886
+ return titleLevel === "h1" ? "h2" : titleLevel === "h2" ? "h3" : "h4";
887
+ }
885
888
  var roundedMap = {
886
889
  0: "rounded-none",
887
890
  1: "rounded-sm",
@@ -1427,6 +1430,7 @@ function FeaturedWidget({
1427
1430
  const overriddenTheme = JSON.parse(JSON.stringify(theme.theme));
1428
1431
  overriddenTheme.structure.page.width = maxWidth || theme.theme.structure.page.width;
1429
1432
  overriddenTheme.structure.section.padding.y = verticalPadding || theme.theme.structure.section.padding.y;
1433
+ const itemLevel = itemHeadingLevel(titleLevel);
1430
1434
  return /* @__PURE__ */ jsx(Section, { theme: overriddenTheme, id: cssId, background, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8", children: [
1431
1435
  /* @__PURE__ */ jsxs(
1432
1436
  "div",
@@ -1443,7 +1447,7 @@ function FeaturedWidget({
1443
1447
  ),
1444
1448
  items && items.length > 0 && layout === "numbered" && /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8", children: items.map((item, index) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
1445
1449
  /* @__PURE__ */ jsx("span", { className: "text-3xl font-bold text-primary/30", children: String(index + 1).padStart(2, "0") }),
1446
- /* @__PURE__ */ jsx(Header4, { theme: overriddenTheme, children: item.title }),
1450
+ /* @__PURE__ */ jsx(Header4, { theme: overriddenTheme, as: itemLevel, children: item.title }),
1447
1451
  item.description && /* @__PURE__ */ jsx(Text2, { theme: overriddenTheme, children: item.description })
1448
1452
  ] }, index)) }),
1449
1453
  items && items.length > 0 && layout !== "numbered" && /* @__PURE__ */ jsx(
@@ -1484,7 +1488,7 @@ function FeaturedWidget({
1484
1488
  layout === "compact" && "items-center gap-1"
1485
1489
  ),
1486
1490
  children: [
1487
- /* @__PURE__ */ jsx(Header4, { theme: overriddenTheme, children: item.title }),
1491
+ /* @__PURE__ */ jsx(Header4, { theme: overriddenTheme, as: itemLevel, children: item.title }),
1488
1492
  item.description && layout !== "compact" && /* @__PURE__ */ jsx(Text2, { theme: overriddenTheme, children: item.description })
1489
1493
  ]
1490
1494
  }
@@ -1941,7 +1945,7 @@ function PricingWidget({
1941
1945
  /* @__PURE__ */ jsx(Preheader, { theme: overriddenTheme, children: tier.name }),
1942
1946
  tier.highlighted && /* @__PURE__ */ jsx(Badge, { theme: overriddenTheme, children: "Most popular" })
1943
1947
  ] }),
1944
- /* @__PURE__ */ jsx(PageCardHeader, { theme: overriddenTheme, children: pricingSwitcher ? /* @__PURE__ */ jsxs(Fragment, { children: [
1948
+ /* @__PURE__ */ jsx(PageCardHeader, { theme: overriddenTheme, as: "p", children: pricingSwitcher ? /* @__PURE__ */ jsxs(Fragment, { children: [
1945
1949
  /* @__PURE__ */ jsx("span", { className: monthlyOnly, children: tier.price }),
1946
1950
  /* @__PURE__ */ jsx("span", { className: yearlyOnly, children: tier.priceYearly || tier.price })
1947
1951
  ] }) : tier.price }),
@@ -3440,7 +3444,11 @@ function resolveIcon2(name) {
3440
3444
  if (!name) return null;
3441
3445
  return Icons[name] ?? null;
3442
3446
  }
3443
- function GridItemCard({ item, theme }) {
3447
+ function GridItemCard({
3448
+ item,
3449
+ theme,
3450
+ headingLevel
3451
+ }) {
3444
3452
  const Icon = resolveIcon2(item.icon);
3445
3453
  const mediaUrl = getMediaUrl(item.media);
3446
3454
  const mediaAlt = getMediaAlt(item.media);
@@ -3462,13 +3470,13 @@ function GridItemCard({ item, theme }) {
3462
3470
  }
3463
3471
  ),
3464
3472
  /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/70 via-black/10 to-transparent" }),
3465
- /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 bottom-0 p-4", children: /* @__PURE__ */ jsx(Header4, { theme, className: "text-white", children: item.title }) })
3473
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 bottom-0 p-4", children: /* @__PURE__ */ jsx(Header4, { theme, as: headingLevel, className: "text-white", children: item.title }) })
3466
3474
  ] }) });
3467
3475
  return item.buttonAction ? /* @__PURE__ */ jsx(NavLink, { href: item.buttonAction, className: "block", children: card }) : card;
3468
3476
  }
3469
3477
  const media = hasMedia ? /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-md", children: /* @__PURE__ */ jsx(Image, { src: mediaUrl || "", alt: mediaAlt }) }) : Icon ? /* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }) }) : null;
3470
3478
  const text = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
3471
- /* @__PURE__ */ jsx(Header4, { theme, children: item.title }),
3479
+ /* @__PURE__ */ jsx(Header4, { theme, as: headingLevel, children: item.title }),
3472
3480
  item.description && /* @__PURE__ */ jsx(Text2, { theme, children: item.description }),
3473
3481
  item.buttonAction && item.buttonCaption && /* @__PURE__ */ jsx(NavLink, { href: item.buttonAction, className: "mt-2", children: /* @__PURE__ */ jsx(Button2, { theme, variant: "secondary", size: "sm", children: item.buttonCaption }) })
3474
3482
  ] });
@@ -3523,7 +3531,15 @@ function GridWidget({
3523
3531
  "grid grid-cols-1 md:grid-cols-2 gap-6 items-stretch",
3524
3532
  columns === 3 ? "lg:grid-cols-3" : "lg:grid-cols-2"
3525
3533
  ),
3526
- children: items.map((item, index) => /* @__PURE__ */ jsx(GridItemCard, { item, theme: overriddenTheme }, index))
3534
+ children: items.map((item, index) => /* @__PURE__ */ jsx(
3535
+ GridItemCard,
3536
+ {
3537
+ item,
3538
+ theme: overriddenTheme,
3539
+ headingLevel: itemHeadingLevel(titleLevel)
3540
+ },
3541
+ index
3542
+ ))
3527
3543
  }
3528
3544
  )
3529
3545
  ] }) });
@@ -4529,5 +4545,5 @@ var DataSlot = {
4529
4545
  };
4530
4546
 
4531
4547
  export { Banner, CodeSnippetBlock, Content, DataSlot, EmailForm2 as EmailForm, Embed, Faq, Featured, FieldGroup, Footer, Grid, Header, Hero, Marquee, MediaBlock, Pricing, RichText, SupportForm2 as SupportForm, TextField, TitleSizeField, ToggleField, generateUniqueId };
4532
- //# sourceMappingURL=chunk-XQE4RVNO.js.map
4533
- //# sourceMappingURL=chunk-XQE4RVNO.js.map
4548
+ //# sourceMappingURL=chunk-5THGEJHP.js.map
4549
+ //# sourceMappingURL=chunk-5THGEJHP.js.map