@reblu/site-blocks 0.11.0 → 0.12.0
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/CHANGELOG.md +11 -0
- package/README.md +24 -0
- package/dist/index.cjs +281 -249
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +280 -249
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -13328,8 +13328,54 @@ function Treatment({ page, className }) {
|
|
|
13328
13328
|
}
|
|
13329
13329
|
|
|
13330
13330
|
// src/components/parent-page.tsx
|
|
13331
|
+
import { cn as cn5 } from "@reblu/site-ui/utils";
|
|
13332
|
+
|
|
13333
|
+
// src/components/page-card-grid.tsx
|
|
13331
13334
|
import { cn as cn4 } from "@reblu/site-ui/utils";
|
|
13332
13335
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
13336
|
+
var defaultPageHref = (page) => `/${page.slug}`;
|
|
13337
|
+
var pageKey = (page) => `${page.category?.slug ?? ""}/${page.slug}`;
|
|
13338
|
+
function PageCardGrid(props) {
|
|
13339
|
+
return /* @__PURE__ */ jsx4(PageCardGridSection, { ...props });
|
|
13340
|
+
}
|
|
13341
|
+
function PageCardGridSection({
|
|
13342
|
+
pages,
|
|
13343
|
+
pageHref = defaultPageHref,
|
|
13344
|
+
heading,
|
|
13345
|
+
className,
|
|
13346
|
+
keepEmptyHeading = false
|
|
13347
|
+
}) {
|
|
13348
|
+
if (pages.length === 0) return null;
|
|
13349
|
+
const showHeading = keepEmptyHeading ? heading !== void 0 : !!heading;
|
|
13350
|
+
return /* @__PURE__ */ jsxs3("section", { className: cn4("space-y-6", className), children: [
|
|
13351
|
+
showHeading && /* @__PURE__ */ jsx4("h2", { className: "text-2xl font-bold", children: heading }),
|
|
13352
|
+
/* @__PURE__ */ jsx4("ul", { className: "grid list-none grid-cols-1 gap-6 p-0 sm:grid-cols-2 lg:grid-cols-3", children: pages.map((page) => /* @__PURE__ */ jsx4("li", { children: /* @__PURE__ */ jsxs3(
|
|
13353
|
+
"a",
|
|
13354
|
+
{
|
|
13355
|
+
href: pageHref(page),
|
|
13356
|
+
className: "group flex h-full flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-lg",
|
|
13357
|
+
children: [
|
|
13358
|
+
page.coverImageUrl && /* @__PURE__ */ jsx4("div", { className: "relative aspect-video overflow-hidden bg-muted", children: /* @__PURE__ */ jsx4(
|
|
13359
|
+
"img",
|
|
13360
|
+
{
|
|
13361
|
+
src: page.coverImageUrl,
|
|
13362
|
+
alt: "",
|
|
13363
|
+
loading: "lazy",
|
|
13364
|
+
className: "h-full w-full object-cover transition-transform group-hover:scale-105"
|
|
13365
|
+
}
|
|
13366
|
+
) }),
|
|
13367
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
|
|
13368
|
+
/* @__PURE__ */ jsx4("h3", { className: "font-semibold leading-tight transition-colors group-hover:text-primary", children: page.title }),
|
|
13369
|
+
page.excerpt && /* @__PURE__ */ jsx4("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: page.excerpt })
|
|
13370
|
+
] })
|
|
13371
|
+
]
|
|
13372
|
+
}
|
|
13373
|
+
) }, pageKey(page))) })
|
|
13374
|
+
] });
|
|
13375
|
+
}
|
|
13376
|
+
|
|
13377
|
+
// src/components/parent-page.tsx
|
|
13378
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
13333
13379
|
var defaultChildPageHref = (slug) => `/${slug}`;
|
|
13334
13380
|
function ParentPage({
|
|
13335
13381
|
page,
|
|
@@ -13344,34 +13390,18 @@ function ParentPage({
|
|
|
13344
13390
|
const pages = childPages ?? treatments ?? [];
|
|
13345
13391
|
const hrefFor = childPageHref ?? treatmentHref ?? defaultChildPageHref;
|
|
13346
13392
|
const label = childPagesLabel ?? treatmentsLabel ?? "Treatments";
|
|
13347
|
-
return /* @__PURE__ */
|
|
13348
|
-
/* @__PURE__ */
|
|
13349
|
-
/* @__PURE__ */
|
|
13350
|
-
|
|
13351
|
-
|
|
13352
|
-
|
|
13353
|
-
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
"img",
|
|
13360
|
-
{
|
|
13361
|
-
src: t.coverImageUrl,
|
|
13362
|
-
alt: "",
|
|
13363
|
-
loading: "lazy",
|
|
13364
|
-
className: "h-full w-full object-cover transition-transform group-hover:scale-105"
|
|
13365
|
-
}
|
|
13366
|
-
) }),
|
|
13367
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
|
|
13368
|
-
/* @__PURE__ */ jsx4("h3", { className: "font-semibold leading-tight transition-colors group-hover:text-primary", children: t.title }),
|
|
13369
|
-
t.excerpt && /* @__PURE__ */ jsx4("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: t.excerpt })
|
|
13370
|
-
] })
|
|
13371
|
-
]
|
|
13372
|
-
}
|
|
13373
|
-
) }, t.slug)) })
|
|
13374
|
-
] })
|
|
13393
|
+
return /* @__PURE__ */ jsxs4("article", { className: cn5("space-y-12", className), "data-slot": "specialty", children: [
|
|
13394
|
+
/* @__PURE__ */ jsx5(PageHero, { page }),
|
|
13395
|
+
/* @__PURE__ */ jsx5(PageSectionList, { sections: page.sections }),
|
|
13396
|
+
/* @__PURE__ */ jsx5(
|
|
13397
|
+
PageCardGridSection,
|
|
13398
|
+
{
|
|
13399
|
+
pages,
|
|
13400
|
+
heading: label,
|
|
13401
|
+
pageHref: (child) => hrefFor(child.slug),
|
|
13402
|
+
keepEmptyHeading: true
|
|
13403
|
+
}
|
|
13404
|
+
)
|
|
13375
13405
|
] });
|
|
13376
13406
|
}
|
|
13377
13407
|
|
|
@@ -13379,34 +13409,34 @@ function ParentPage({
|
|
|
13379
13409
|
var Specialty = ParentPage;
|
|
13380
13410
|
|
|
13381
13411
|
// src/components/profile-card.tsx
|
|
13382
|
-
import { cn as
|
|
13383
|
-
import { jsx as
|
|
13412
|
+
import { cn as cn6 } from "@reblu/site-ui/utils";
|
|
13413
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
13384
13414
|
function initials(name) {
|
|
13385
13415
|
return name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("");
|
|
13386
13416
|
}
|
|
13387
13417
|
function ProfileCard({ name, role, imageUrl, specialties = [], bio, href, className }) {
|
|
13388
13418
|
const NameTag = href ? "a" : "span";
|
|
13389
|
-
return /* @__PURE__ */
|
|
13419
|
+
return /* @__PURE__ */ jsxs5(
|
|
13390
13420
|
"article",
|
|
13391
13421
|
{
|
|
13392
|
-
className:
|
|
13422
|
+
className: cn6(
|
|
13393
13423
|
"flex flex-col items-center gap-3 rounded-lg border bg-card p-6 text-center",
|
|
13394
13424
|
className
|
|
13395
13425
|
),
|
|
13396
13426
|
"data-slot": "profile-card",
|
|
13397
13427
|
children: [
|
|
13398
|
-
/* @__PURE__ */
|
|
13399
|
-
/* @__PURE__ */
|
|
13400
|
-
/* @__PURE__ */
|
|
13428
|
+
/* @__PURE__ */ jsx6("div", { className: "relative h-24 w-24 overflow-hidden rounded-full bg-muted", children: imageUrl ? /* @__PURE__ */ jsx6("img", { src: imageUrl, alt: name, loading: "lazy", className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsx6("span", { className: "flex h-full w-full items-center justify-center text-2xl font-semibold text-muted-foreground", "aria-hidden": "true", children: initials(name) }) }),
|
|
13429
|
+
/* @__PURE__ */ jsxs5("div", { className: "space-y-1", children: [
|
|
13430
|
+
/* @__PURE__ */ jsx6("h3", { className: "text-lg font-semibold leading-tight", children: /* @__PURE__ */ jsx6(
|
|
13401
13431
|
NameTag,
|
|
13402
13432
|
{
|
|
13403
13433
|
...href ? { href, className: "transition-colors hover:text-primary" } : {},
|
|
13404
13434
|
children: name
|
|
13405
13435
|
}
|
|
13406
13436
|
) }),
|
|
13407
|
-
role && /* @__PURE__ */
|
|
13437
|
+
role && /* @__PURE__ */ jsx6("p", { className: "text-sm text-muted-foreground", children: role })
|
|
13408
13438
|
] }),
|
|
13409
|
-
specialties.length > 0 && /* @__PURE__ */
|
|
13439
|
+
specialties.length > 0 && /* @__PURE__ */ jsx6("ul", { className: "flex flex-wrap justify-center gap-1.5 p-0", children: specialties.map((s2) => /* @__PURE__ */ jsx6(
|
|
13410
13440
|
"li",
|
|
13411
13441
|
{
|
|
13412
13442
|
className: "inline-flex items-center rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium text-secondary-foreground",
|
|
@@ -13414,28 +13444,28 @@ function ProfileCard({ name, role, imageUrl, specialties = [], bio, href, classN
|
|
|
13414
13444
|
},
|
|
13415
13445
|
s2
|
|
13416
13446
|
)) }),
|
|
13417
|
-
bio && /* @__PURE__ */
|
|
13447
|
+
bio && /* @__PURE__ */ jsx6("p", { className: "text-sm text-muted-foreground", children: bio })
|
|
13418
13448
|
]
|
|
13419
13449
|
}
|
|
13420
13450
|
);
|
|
13421
13451
|
}
|
|
13422
13452
|
|
|
13423
13453
|
// src/components/product-card.tsx
|
|
13424
|
-
import { cn as
|
|
13425
|
-
import { jsx as
|
|
13454
|
+
import { cn as cn7 } from "@reblu/site-ui/utils";
|
|
13455
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
13426
13456
|
function ProductCard({ product, href, currencyCode = "EUR", locale, className }) {
|
|
13427
13457
|
const image = product.images.find((i) => i.isPrimary) ?? product.images[0];
|
|
13428
13458
|
const hasDiscount = product.comparePrice != null && product.comparePrice > product.price;
|
|
13429
|
-
return /* @__PURE__ */
|
|
13459
|
+
return /* @__PURE__ */ jsxs6(
|
|
13430
13460
|
"article",
|
|
13431
13461
|
{
|
|
13432
|
-
className:
|
|
13462
|
+
className: cn7(
|
|
13433
13463
|
"group flex flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-lg",
|
|
13434
13464
|
className
|
|
13435
13465
|
),
|
|
13436
13466
|
"data-slot": "product-card",
|
|
13437
13467
|
children: [
|
|
13438
|
-
/* @__PURE__ */
|
|
13468
|
+
/* @__PURE__ */ jsx7("div", { className: "relative aspect-square overflow-hidden bg-muted", children: image ? /* @__PURE__ */ jsx7(
|
|
13439
13469
|
"img",
|
|
13440
13470
|
{
|
|
13441
13471
|
src: image.url,
|
|
@@ -13443,14 +13473,14 @@ function ProductCard({ product, href, currencyCode = "EUR", locale, className })
|
|
|
13443
13473
|
loading: "lazy",
|
|
13444
13474
|
className: "h-full w-full object-cover transition-transform group-hover:scale-105"
|
|
13445
13475
|
}
|
|
13446
|
-
) : /* @__PURE__ */
|
|
13447
|
-
/* @__PURE__ */
|
|
13448
|
-
product.category && /* @__PURE__ */
|
|
13449
|
-
/* @__PURE__ */
|
|
13450
|
-
product.shortDescription && /* @__PURE__ */
|
|
13451
|
-
/* @__PURE__ */
|
|
13452
|
-
/* @__PURE__ */
|
|
13453
|
-
hasDiscount && /* @__PURE__ */
|
|
13476
|
+
) : /* @__PURE__ */ jsx7("div", { className: "flex h-full items-center justify-center text-4xl text-muted-foreground/30", "aria-hidden": "true", children: "\u{1F6CD}\uFE0F" }) }),
|
|
13477
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
|
|
13478
|
+
product.category && /* @__PURE__ */ jsx7("span", { className: "inline-flex w-fit items-center rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium text-secondary-foreground", children: product.category.name }),
|
|
13479
|
+
/* @__PURE__ */ jsx7("h3", { className: "text-base font-semibold leading-tight", children: href ? /* @__PURE__ */ jsx7("a", { href, className: "transition-colors hover:text-primary", children: product.name }) : product.name }),
|
|
13480
|
+
product.shortDescription && /* @__PURE__ */ jsx7("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: product.shortDescription }),
|
|
13481
|
+
/* @__PURE__ */ jsxs6("div", { className: "mt-auto flex items-baseline gap-2 pt-2", children: [
|
|
13482
|
+
/* @__PURE__ */ jsx7("span", { className: "text-lg font-bold text-foreground", children: formatPrice(product.price, currencyCode, locale) }),
|
|
13483
|
+
hasDiscount && /* @__PURE__ */ jsx7("span", { className: "text-sm text-muted-foreground line-through", children: formatPrice(product.comparePrice, currencyCode, locale) })
|
|
13454
13484
|
] })
|
|
13455
13485
|
] })
|
|
13456
13486
|
]
|
|
@@ -13652,8 +13682,8 @@ var __iconNode8 = [
|
|
|
13652
13682
|
var Truck = createLucideIcon("truck", __iconNode8);
|
|
13653
13683
|
|
|
13654
13684
|
// src/components/product-trust-items.tsx
|
|
13655
|
-
import { cn as
|
|
13656
|
-
import { jsx as
|
|
13685
|
+
import { cn as cn8 } from "@reblu/site-ui/utils";
|
|
13686
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
13657
13687
|
var DEFAULT_TRUST_ICONS = Object.freeze({
|
|
13658
13688
|
shipping: Truck,
|
|
13659
13689
|
returns: RotateCcw,
|
|
@@ -13687,17 +13717,17 @@ function ProductTrustItems({
|
|
|
13687
13717
|
return [{ key: `${index}-${icon}`, Icon: Icon2, text: text3 }];
|
|
13688
13718
|
});
|
|
13689
13719
|
if (rows.length === 0) return null;
|
|
13690
|
-
return /* @__PURE__ */
|
|
13691
|
-
/* @__PURE__ */
|
|
13692
|
-
/* @__PURE__ */
|
|
13720
|
+
return /* @__PURE__ */ jsx8(List, { "data-slot": "product-trust-items", className: cn8("space-y-2.5", className), children: rows.map(({ key: key2, Icon: Icon2, text: text3 }) => /* @__PURE__ */ jsxs7("li", { className: cn8("flex items-center gap-3 text-sm text-muted-foreground", itemClassName), children: [
|
|
13721
|
+
/* @__PURE__ */ jsx8(Icon2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-foreground/60" }),
|
|
13722
|
+
/* @__PURE__ */ jsx8("span", { children: text3 })
|
|
13693
13723
|
] }, key2)) });
|
|
13694
13724
|
}
|
|
13695
13725
|
|
|
13696
13726
|
// src/components/faq-accordion.tsx
|
|
13697
|
-
import { cn as
|
|
13727
|
+
import { cn as cn9 } from "@reblu/site-ui/utils";
|
|
13698
13728
|
|
|
13699
13729
|
// src/components/_heading.tsx
|
|
13700
|
-
import { jsx as
|
|
13730
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
13701
13731
|
function nextHeadingLevel(level) {
|
|
13702
13732
|
return Math.min(level + 1, 6);
|
|
13703
13733
|
}
|
|
@@ -13707,11 +13737,11 @@ function Heading({
|
|
|
13707
13737
|
children: children2
|
|
13708
13738
|
}) {
|
|
13709
13739
|
const Tag = `h${level}`;
|
|
13710
|
-
return /* @__PURE__ */
|
|
13740
|
+
return /* @__PURE__ */ jsx9(Tag, { className, children: children2 });
|
|
13711
13741
|
}
|
|
13712
13742
|
|
|
13713
13743
|
// src/components/faq-accordion.tsx
|
|
13714
|
-
import { jsx as
|
|
13744
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
13715
13745
|
function FaqAccordion({
|
|
13716
13746
|
items,
|
|
13717
13747
|
heading,
|
|
@@ -13722,18 +13752,18 @@ function FaqAccordion({
|
|
|
13722
13752
|
}) {
|
|
13723
13753
|
const visible = items.map((item, index) => ({ item, index })).filter(({ item }) => item.q.trim() !== "");
|
|
13724
13754
|
if (visible.length === 0) return null;
|
|
13725
|
-
return /* @__PURE__ */
|
|
13726
|
-
heading && /* @__PURE__ */
|
|
13727
|
-
/* @__PURE__ */
|
|
13755
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn9("space-y-4", className), "data-slot": "faq-accordion", children: [
|
|
13756
|
+
heading && /* @__PURE__ */ jsx10(Heading, { level: headingLevel, className: "text-2xl font-semibold tracking-tight", children: heading }),
|
|
13757
|
+
/* @__PURE__ */ jsx10("div", { className: "divide-y divide-border rounded-xl border border-border", children: visible.map(({ item, index }) => /* @__PURE__ */ jsxs8(
|
|
13728
13758
|
"details",
|
|
13729
13759
|
{
|
|
13730
13760
|
className: "group px-4",
|
|
13731
13761
|
"data-slot": "faq-item",
|
|
13732
13762
|
...defaultOpen.includes(index) ? { open: true } : {},
|
|
13733
13763
|
children: [
|
|
13734
|
-
/* @__PURE__ */
|
|
13735
|
-
questionHeadingLevel ? /* @__PURE__ */
|
|
13736
|
-
/* @__PURE__ */
|
|
13764
|
+
/* @__PURE__ */ jsxs8("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4 py-4 font-medium focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden", children: [
|
|
13765
|
+
questionHeadingLevel ? /* @__PURE__ */ jsx10(Heading, { level: questionHeadingLevel, className: "text-base font-medium", children: item.q }) : /* @__PURE__ */ jsx10("span", { children: item.q }),
|
|
13766
|
+
/* @__PURE__ */ jsx10(
|
|
13737
13767
|
"span",
|
|
13738
13768
|
{
|
|
13739
13769
|
"aria-hidden": "true",
|
|
@@ -13742,7 +13772,7 @@ function FaqAccordion({
|
|
|
13742
13772
|
}
|
|
13743
13773
|
)
|
|
13744
13774
|
] }),
|
|
13745
|
-
/* @__PURE__ */
|
|
13775
|
+
/* @__PURE__ */ jsx10("p", { className: "whitespace-pre-line pb-4 text-muted-foreground", children: item.a })
|
|
13746
13776
|
]
|
|
13747
13777
|
},
|
|
13748
13778
|
index
|
|
@@ -13751,40 +13781,40 @@ function FaqAccordion({
|
|
|
13751
13781
|
}
|
|
13752
13782
|
|
|
13753
13783
|
// src/components/page-blocks.tsx
|
|
13754
|
-
import { cn as
|
|
13784
|
+
import { cn as cn10 } from "@reblu/site-ui/utils";
|
|
13755
13785
|
import { buttonVariants as buttonVariants2 } from "@reblu/site-ui/button-variants";
|
|
13756
|
-
import { jsx as
|
|
13786
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
13757
13787
|
var ALIASES = {
|
|
13758
13788
|
doctor_embed: "profile_embed",
|
|
13759
13789
|
specialty_embed: "page_embed"
|
|
13760
13790
|
};
|
|
13761
13791
|
function HeroBlock({ block, headingLevel }) {
|
|
13762
13792
|
const { title, subtitle, imageUrl } = block.data;
|
|
13763
|
-
return /* @__PURE__ */
|
|
13764
|
-
/* @__PURE__ */
|
|
13765
|
-
subtitle && /* @__PURE__ */
|
|
13766
|
-
imageUrl && /* @__PURE__ */
|
|
13793
|
+
return /* @__PURE__ */ jsxs9("div", { className: "space-y-4", children: [
|
|
13794
|
+
/* @__PURE__ */ jsx11(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
|
|
13795
|
+
subtitle && /* @__PURE__ */ jsx11("p", { className: "text-lg opacity-80", children: subtitle }),
|
|
13796
|
+
imageUrl && /* @__PURE__ */ jsx11("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ jsx11("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
|
|
13767
13797
|
] });
|
|
13768
13798
|
}
|
|
13769
13799
|
function RichtextBlock({ block, headingLevel }) {
|
|
13770
|
-
return /* @__PURE__ */
|
|
13800
|
+
return /* @__PURE__ */ jsx11(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
|
|
13771
13801
|
}
|
|
13772
13802
|
function FaqBlock({ block }) {
|
|
13773
|
-
return /* @__PURE__ */
|
|
13803
|
+
return /* @__PURE__ */ jsx11(FaqAccordion, { items: block.data.items });
|
|
13774
13804
|
}
|
|
13775
13805
|
function StatsBlock({ block }) {
|
|
13776
|
-
return /* @__PURE__ */
|
|
13777
|
-
/* @__PURE__ */
|
|
13778
|
-
/* @__PURE__ */
|
|
13806
|
+
return /* @__PURE__ */ jsx11("dl", { className: "grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: block.data.items.map((item, i) => /* @__PURE__ */ jsxs9("div", { className: "flex flex-col-reverse gap-1", children: [
|
|
13807
|
+
/* @__PURE__ */ jsx11("dt", { className: "text-sm opacity-80", children: item.label }),
|
|
13808
|
+
/* @__PURE__ */ jsx11("dd", { className: "text-3xl font-bold", children: item.value })
|
|
13779
13809
|
] }, i)) });
|
|
13780
13810
|
}
|
|
13781
13811
|
function TestimonialBlock({ block }) {
|
|
13782
13812
|
const { quote, author, role, avatarUrl } = block.data;
|
|
13783
|
-
return /* @__PURE__ */
|
|
13784
|
-
/* @__PURE__ */
|
|
13785
|
-
/* @__PURE__ */
|
|
13813
|
+
return /* @__PURE__ */ jsxs9("figure", { className: "space-y-4", children: [
|
|
13814
|
+
/* @__PURE__ */ jsx11("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ jsx11("p", { children: quote }) }),
|
|
13815
|
+
/* @__PURE__ */ jsxs9("figcaption", { className: "flex items-center gap-3", children: [
|
|
13786
13816
|
avatarUrl && // eslint-disable-next-line @next/next/no-img-element
|
|
13787
|
-
/* @__PURE__ */
|
|
13817
|
+
/* @__PURE__ */ jsx11(
|
|
13788
13818
|
"img",
|
|
13789
13819
|
{
|
|
13790
13820
|
src: avatarUrl,
|
|
@@ -13793,9 +13823,9 @@ function TestimonialBlock({ block }) {
|
|
|
13793
13823
|
className: "h-10 w-10 rounded-full object-cover"
|
|
13794
13824
|
}
|
|
13795
13825
|
),
|
|
13796
|
-
/* @__PURE__ */
|
|
13797
|
-
/* @__PURE__ */
|
|
13798
|
-
role && /* @__PURE__ */
|
|
13826
|
+
/* @__PURE__ */ jsxs9("span", { children: [
|
|
13827
|
+
/* @__PURE__ */ jsx11("span", { className: "font-semibold", children: author }),
|
|
13828
|
+
role && /* @__PURE__ */ jsx11("span", { className: "block text-sm opacity-80", children: role })
|
|
13799
13829
|
] })
|
|
13800
13830
|
] })
|
|
13801
13831
|
] });
|
|
@@ -13804,19 +13834,19 @@ function CtaSlotBlock(_props) {
|
|
|
13804
13834
|
return null;
|
|
13805
13835
|
}
|
|
13806
13836
|
function FeatureListBlock({ block }) {
|
|
13807
|
-
return /* @__PURE__ */
|
|
13837
|
+
return /* @__PURE__ */ jsx11("ul", { className: "grid list-disc gap-2 pl-5 sm:grid-cols-2", children: block.data.items.map((item, i) => /* @__PURE__ */ jsx11("li", { children: item.text }, i)) });
|
|
13808
13838
|
}
|
|
13809
13839
|
function GalleryBlock({ block }) {
|
|
13810
13840
|
const { images } = block.data;
|
|
13811
|
-
return /* @__PURE__ */
|
|
13841
|
+
return /* @__PURE__ */ jsx11(
|
|
13812
13842
|
"div",
|
|
13813
13843
|
{
|
|
13814
|
-
className:
|
|
13844
|
+
className: cn10(
|
|
13815
13845
|
"grid gap-4",
|
|
13816
13846
|
images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
|
|
13817
13847
|
),
|
|
13818
|
-
children: images.map((img, i) => /* @__PURE__ */
|
|
13819
|
-
/* @__PURE__ */
|
|
13848
|
+
children: images.map((img, i) => /* @__PURE__ */ jsxs9("figure", { className: "space-y-1", children: [
|
|
13849
|
+
/* @__PURE__ */ jsx11("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsx11(
|
|
13820
13850
|
"img",
|
|
13821
13851
|
{
|
|
13822
13852
|
src: img.url,
|
|
@@ -13825,7 +13855,7 @@ function GalleryBlock({ block }) {
|
|
|
13825
13855
|
className: "h-full w-full object-cover"
|
|
13826
13856
|
}
|
|
13827
13857
|
) }),
|
|
13828
|
-
img.caption && /* @__PURE__ */
|
|
13858
|
+
img.caption && /* @__PURE__ */ jsx11("figcaption", { className: "text-sm opacity-80", children: img.caption })
|
|
13829
13859
|
] }, `${img.url}-${i}`))
|
|
13830
13860
|
}
|
|
13831
13861
|
);
|
|
@@ -13835,13 +13865,13 @@ function EmbedCard({
|
|
|
13835
13865
|
headingLevel,
|
|
13836
13866
|
embedHref
|
|
13837
13867
|
}) {
|
|
13838
|
-
return /* @__PURE__ */
|
|
13868
|
+
return /* @__PURE__ */ jsxs9(
|
|
13839
13869
|
"a",
|
|
13840
13870
|
{
|
|
13841
13871
|
href: embedHref(resolved),
|
|
13842
13872
|
className: "group block overflow-hidden rounded-xl border border-border bg-card text-card-foreground transition-shadow hover:shadow-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
|
|
13843
13873
|
children: [
|
|
13844
|
-
resolved.coverImageUrl && /* @__PURE__ */
|
|
13874
|
+
resolved.coverImageUrl && /* @__PURE__ */ jsx11("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ jsx11(
|
|
13845
13875
|
"img",
|
|
13846
13876
|
{
|
|
13847
13877
|
src: resolved.coverImageUrl,
|
|
@@ -13850,24 +13880,24 @@ function EmbedCard({
|
|
|
13850
13880
|
className: "h-full w-full object-cover"
|
|
13851
13881
|
}
|
|
13852
13882
|
) }),
|
|
13853
|
-
/* @__PURE__ */
|
|
13854
|
-
/* @__PURE__ */
|
|
13855
|
-
resolved.role && /* @__PURE__ */
|
|
13856
|
-
resolved.excerpt && /* @__PURE__ */
|
|
13883
|
+
/* @__PURE__ */ jsxs9("div", { className: "space-y-1 p-4", children: [
|
|
13884
|
+
/* @__PURE__ */ jsx11(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
|
|
13885
|
+
resolved.role && /* @__PURE__ */ jsx11("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
|
|
13886
|
+
resolved.excerpt && /* @__PURE__ */ jsx11("p", { className: "text-muted-foreground", children: resolved.excerpt })
|
|
13857
13887
|
] })
|
|
13858
13888
|
]
|
|
13859
13889
|
}
|
|
13860
13890
|
);
|
|
13861
13891
|
}
|
|
13862
13892
|
function PageEmbedBlock({ block, headingLevel, embedHref }) {
|
|
13863
|
-
return /* @__PURE__ */
|
|
13893
|
+
return /* @__PURE__ */ jsx11(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
13864
13894
|
}
|
|
13865
13895
|
function ProfileEmbedBlock({
|
|
13866
13896
|
block,
|
|
13867
13897
|
headingLevel,
|
|
13868
13898
|
embedHref
|
|
13869
13899
|
}) {
|
|
13870
|
-
return /* @__PURE__ */
|
|
13900
|
+
return /* @__PURE__ */ jsx11(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
13871
13901
|
}
|
|
13872
13902
|
var DEFAULT_RENDERERS = {
|
|
13873
13903
|
hero: HeroBlock,
|
|
@@ -13924,14 +13954,14 @@ function toIdFragment(value) {
|
|
|
13924
13954
|
function SectionCta2({ cta }) {
|
|
13925
13955
|
if (!hasUsableCta(cta)) return null;
|
|
13926
13956
|
const variant = toButtonVariant(cta.variant);
|
|
13927
|
-
return /* @__PURE__ */
|
|
13957
|
+
return /* @__PURE__ */ jsx11("div", { className: "pt-2", children: /* @__PURE__ */ jsx11(
|
|
13928
13958
|
"a",
|
|
13929
13959
|
{
|
|
13930
13960
|
href: cta.url,
|
|
13931
13961
|
"data-slot": "button",
|
|
13932
13962
|
"data-variant": variant,
|
|
13933
13963
|
"data-size": "default",
|
|
13934
|
-
className:
|
|
13964
|
+
className: cn10(buttonVariants2({ variant, size: "default" })),
|
|
13935
13965
|
...cta.isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
13936
13966
|
children: cta.label
|
|
13937
13967
|
}
|
|
@@ -13957,17 +13987,17 @@ function PageBlocks({
|
|
|
13957
13987
|
const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
|
|
13958
13988
|
const background = block.backgroundColor;
|
|
13959
13989
|
return [
|
|
13960
|
-
/* @__PURE__ */
|
|
13990
|
+
/* @__PURE__ */ jsxs9(
|
|
13961
13991
|
"section",
|
|
13962
13992
|
{
|
|
13963
13993
|
"data-slot": "page-block",
|
|
13964
13994
|
"data-block-type": type,
|
|
13965
13995
|
"aria-labelledby": headingId,
|
|
13966
13996
|
style: surfaceStyle(background),
|
|
13967
|
-
className:
|
|
13997
|
+
className: cn10("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
|
|
13968
13998
|
children: [
|
|
13969
|
-
block.heading && /* @__PURE__ */
|
|
13970
|
-
/* @__PURE__ */
|
|
13999
|
+
block.heading && /* @__PURE__ */ jsx11(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ jsx11("span", { id: headingId, children: block.heading }) }),
|
|
14000
|
+
/* @__PURE__ */ jsx11(
|
|
13971
14001
|
Renderer,
|
|
13972
14002
|
{
|
|
13973
14003
|
block,
|
|
@@ -13975,7 +14005,7 @@ function PageBlocks({
|
|
|
13975
14005
|
embedHref
|
|
13976
14006
|
}
|
|
13977
14007
|
),
|
|
13978
|
-
/* @__PURE__ */
|
|
14008
|
+
/* @__PURE__ */ jsx11(SectionCta2, { cta: block.cta })
|
|
13979
14009
|
]
|
|
13980
14010
|
},
|
|
13981
14011
|
block.id
|
|
@@ -13983,12 +14013,12 @@ function PageBlocks({
|
|
|
13983
14013
|
];
|
|
13984
14014
|
});
|
|
13985
14015
|
if (sections.length === 0) return null;
|
|
13986
|
-
return /* @__PURE__ */
|
|
14016
|
+
return /* @__PURE__ */ jsx11("div", { className: cn10("space-y-12", className), "data-slot": "page-blocks", children: sections });
|
|
13987
14017
|
}
|
|
13988
14018
|
|
|
13989
14019
|
// src/components/shop-filters.tsx
|
|
13990
|
-
import { cn as
|
|
13991
|
-
import { jsx as
|
|
14020
|
+
import { cn as cn11 } from "@reblu/site-ui/utils";
|
|
14021
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
13992
14022
|
var DEFAULT_SHOP_PRICE_BANDS = [
|
|
13993
14023
|
{ max: 2500 },
|
|
13994
14024
|
{ min: 2500, max: 5e3 },
|
|
@@ -14032,7 +14062,7 @@ function priceBandLabel(band, t, currencyCode, locale) {
|
|
|
14032
14062
|
return "";
|
|
14033
14063
|
}
|
|
14034
14064
|
function OptionLink({ href, active, label, onActivate }) {
|
|
14035
|
-
return /* @__PURE__ */
|
|
14065
|
+
return /* @__PURE__ */ jsx12(
|
|
14036
14066
|
"a",
|
|
14037
14067
|
{
|
|
14038
14068
|
href,
|
|
@@ -14041,7 +14071,7 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14041
14071
|
event.preventDefault();
|
|
14042
14072
|
onActivate();
|
|
14043
14073
|
} : void 0,
|
|
14044
|
-
className:
|
|
14074
|
+
className: cn11(
|
|
14045
14075
|
"inline-flex items-center rounded-full border px-3 py-1 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
14046
14076
|
active ? "border-transparent bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
14047
14077
|
),
|
|
@@ -14050,9 +14080,9 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14050
14080
|
);
|
|
14051
14081
|
}
|
|
14052
14082
|
function FilterFieldset({ legend, children: children2 }) {
|
|
14053
|
-
return /* @__PURE__ */
|
|
14054
|
-
/* @__PURE__ */
|
|
14055
|
-
/* @__PURE__ */
|
|
14083
|
+
return /* @__PURE__ */ jsxs10("fieldset", { className: "space-y-2", children: [
|
|
14084
|
+
/* @__PURE__ */ jsx12("legend", { className: "text-sm font-medium text-foreground", children: legend }),
|
|
14085
|
+
/* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-2", children: children2 })
|
|
14056
14086
|
] });
|
|
14057
14087
|
}
|
|
14058
14088
|
function ShopFilters({
|
|
@@ -14075,11 +14105,11 @@ function ShopFilters({
|
|
|
14075
14105
|
if (!shouldRenderShopFilters(facets, active)) {
|
|
14076
14106
|
return null;
|
|
14077
14107
|
}
|
|
14078
|
-
return /* @__PURE__ */
|
|
14108
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn11("space-y-6", className), "data-slot": "shop-filters", children: [
|
|
14079
14109
|
visibleTaxonomies.map((axis) => {
|
|
14080
14110
|
const activeSlug = active.taxonomy?.[axis.key];
|
|
14081
|
-
return /* @__PURE__ */
|
|
14082
|
-
/* @__PURE__ */
|
|
14111
|
+
return /* @__PURE__ */ jsxs10(FilterFieldset, { legend: axis.label, children: [
|
|
14112
|
+
/* @__PURE__ */ jsx12(
|
|
14083
14113
|
OptionLink,
|
|
14084
14114
|
{
|
|
14085
14115
|
href: hrefs.taxonomy(axis.key, void 0),
|
|
@@ -14094,7 +14124,7 @@ function ShopFilters({
|
|
|
14094
14124
|
),
|
|
14095
14125
|
axis.terms.map((term) => {
|
|
14096
14126
|
const isActive = activeSlug === term.slug;
|
|
14097
|
-
return /* @__PURE__ */
|
|
14127
|
+
return /* @__PURE__ */ jsx12(
|
|
14098
14128
|
OptionLink,
|
|
14099
14129
|
{
|
|
14100
14130
|
href: hrefs.taxonomy(axis.key, isActive ? void 0 : term.slug),
|
|
@@ -14114,9 +14144,9 @@ function ShopFilters({
|
|
|
14114
14144
|
}),
|
|
14115
14145
|
visibleAttributes.map((attr) => {
|
|
14116
14146
|
const activeValues = toValueArray(active.attr?.[attr.key]);
|
|
14117
|
-
return /* @__PURE__ */
|
|
14147
|
+
return /* @__PURE__ */ jsx12(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
|
|
14118
14148
|
const isActive = activeValues.includes(opt.value);
|
|
14119
|
-
return /* @__PURE__ */
|
|
14149
|
+
return /* @__PURE__ */ jsx12(
|
|
14120
14150
|
OptionLink,
|
|
14121
14151
|
{
|
|
14122
14152
|
href: hrefs.attr(attr.key, opt.value),
|
|
@@ -14134,11 +14164,11 @@ function ShopFilters({
|
|
|
14134
14164
|
);
|
|
14135
14165
|
}) }, attr.key);
|
|
14136
14166
|
}),
|
|
14137
|
-
showPriceGroup && /* @__PURE__ */
|
|
14167
|
+
showPriceGroup && /* @__PURE__ */ jsx12(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
|
|
14138
14168
|
const isActive = active.priceMin === band.min && active.priceMax === band.max;
|
|
14139
14169
|
const nextMin = isActive ? void 0 : band.min;
|
|
14140
14170
|
const nextMax = isActive ? void 0 : band.max;
|
|
14141
|
-
return /* @__PURE__ */
|
|
14171
|
+
return /* @__PURE__ */ jsx12(
|
|
14142
14172
|
OptionLink,
|
|
14143
14173
|
{
|
|
14144
14174
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -14149,7 +14179,7 @@ function ShopFilters({
|
|
|
14149
14179
|
i
|
|
14150
14180
|
);
|
|
14151
14181
|
}) }),
|
|
14152
|
-
hasOnSale && /* @__PURE__ */
|
|
14182
|
+
hasOnSale && /* @__PURE__ */ jsx12(
|
|
14153
14183
|
OptionLink,
|
|
14154
14184
|
{
|
|
14155
14185
|
href: hrefs.onSale(!active.onSale),
|
|
@@ -14158,7 +14188,7 @@ function ShopFilters({
|
|
|
14158
14188
|
onActivate: onChange ? () => onChange({ onSale: !active.onSale }) : void 0
|
|
14159
14189
|
}
|
|
14160
14190
|
),
|
|
14161
|
-
/* @__PURE__ */
|
|
14191
|
+
/* @__PURE__ */ jsx12(
|
|
14162
14192
|
"a",
|
|
14163
14193
|
{
|
|
14164
14194
|
href: hrefs.clearAll(),
|
|
@@ -14174,8 +14204,8 @@ function ShopFilters({
|
|
|
14174
14204
|
}
|
|
14175
14205
|
|
|
14176
14206
|
// src/components/cart-line-list.tsx
|
|
14177
|
-
import { cn as
|
|
14178
|
-
import { jsx as
|
|
14207
|
+
import { cn as cn12 } from "@reblu/site-ui/utils";
|
|
14208
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
14179
14209
|
var DEFAULT_LABELS2 = {
|
|
14180
14210
|
quantityLabel: "Cantidad",
|
|
14181
14211
|
decrease: "Reducir cantidad",
|
|
@@ -14200,9 +14230,9 @@ function CartLineList({
|
|
|
14200
14230
|
}) {
|
|
14201
14231
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
14202
14232
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14203
|
-
return /* @__PURE__ */
|
|
14204
|
-
/* @__PURE__ */
|
|
14205
|
-
noticeContent != null && noticeContent !== false && /* @__PURE__ */
|
|
14233
|
+
return /* @__PURE__ */ jsxs11("div", { className: cn12("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
14234
|
+
/* @__PURE__ */ jsx13("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
14235
|
+
noticeContent != null && noticeContent !== false && /* @__PURE__ */ jsx13(
|
|
14206
14236
|
"div",
|
|
14207
14237
|
{
|
|
14208
14238
|
role: "status",
|
|
@@ -14211,32 +14241,32 @@ function CartLineList({
|
|
|
14211
14241
|
children: noticeContent
|
|
14212
14242
|
}
|
|
14213
14243
|
),
|
|
14214
|
-
/* @__PURE__ */
|
|
14244
|
+
/* @__PURE__ */ jsx13("ul", { className: "space-y-4", children: items.map((item) => {
|
|
14215
14245
|
const maxQty = item.maxStock ?? Infinity;
|
|
14216
14246
|
const atMax = item.quantity >= maxQty;
|
|
14217
14247
|
const atMin = item.quantity <= 1;
|
|
14218
|
-
return /* @__PURE__ */
|
|
14248
|
+
return /* @__PURE__ */ jsxs11(
|
|
14219
14249
|
"li",
|
|
14220
14250
|
{
|
|
14221
14251
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
14222
14252
|
children: [
|
|
14223
|
-
/* @__PURE__ */
|
|
14224
|
-
/* @__PURE__ */
|
|
14225
|
-
/* @__PURE__ */
|
|
14226
|
-
item.variantName && /* @__PURE__ */
|
|
14227
|
-
/* @__PURE__ */
|
|
14253
|
+
/* @__PURE__ */ jsx13("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ jsx13("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
14254
|
+
/* @__PURE__ */ jsxs11("div", { className: "min-w-0 flex-1", children: [
|
|
14255
|
+
/* @__PURE__ */ jsx13("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
14256
|
+
item.variantName && /* @__PURE__ */ jsx13("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
14257
|
+
/* @__PURE__ */ jsxs11("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
14228
14258
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
14229
14259
|
" ",
|
|
14230
14260
|
t.unitPriceSuffix
|
|
14231
14261
|
] }),
|
|
14232
|
-
/* @__PURE__ */
|
|
14262
|
+
/* @__PURE__ */ jsxs11(
|
|
14233
14263
|
"div",
|
|
14234
14264
|
{
|
|
14235
14265
|
role: "group",
|
|
14236
14266
|
"aria-label": t.quantityLabel,
|
|
14237
14267
|
className: "mt-3 flex items-center gap-3",
|
|
14238
14268
|
children: [
|
|
14239
|
-
/* @__PURE__ */
|
|
14269
|
+
/* @__PURE__ */ jsx13(
|
|
14240
14270
|
"button",
|
|
14241
14271
|
{
|
|
14242
14272
|
type: "button",
|
|
@@ -14247,8 +14277,8 @@ function CartLineList({
|
|
|
14247
14277
|
children: "\u2212"
|
|
14248
14278
|
}
|
|
14249
14279
|
),
|
|
14250
|
-
/* @__PURE__ */
|
|
14251
|
-
/* @__PURE__ */
|
|
14280
|
+
/* @__PURE__ */ jsx13("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
|
|
14281
|
+
/* @__PURE__ */ jsx13(
|
|
14252
14282
|
"button",
|
|
14253
14283
|
{
|
|
14254
14284
|
type: "button",
|
|
@@ -14259,7 +14289,7 @@ function CartLineList({
|
|
|
14259
14289
|
children: "+"
|
|
14260
14290
|
}
|
|
14261
14291
|
),
|
|
14262
|
-
onRemove && /* @__PURE__ */
|
|
14292
|
+
onRemove && /* @__PURE__ */ jsx13(
|
|
14263
14293
|
"button",
|
|
14264
14294
|
{
|
|
14265
14295
|
type: "button",
|
|
@@ -14273,7 +14303,7 @@ function CartLineList({
|
|
|
14273
14303
|
}
|
|
14274
14304
|
)
|
|
14275
14305
|
] }),
|
|
14276
|
-
/* @__PURE__ */
|
|
14306
|
+
/* @__PURE__ */ jsx13("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ jsx13("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
|
|
14277
14307
|
]
|
|
14278
14308
|
},
|
|
14279
14309
|
lineKey(item.productId, item.variantId)
|
|
@@ -14283,8 +14313,8 @@ function CartLineList({
|
|
|
14283
14313
|
}
|
|
14284
14314
|
|
|
14285
14315
|
// src/components/cart-summary.tsx
|
|
14286
|
-
import { cn as
|
|
14287
|
-
import { jsx as
|
|
14316
|
+
import { cn as cn13 } from "@reblu/site-ui/utils";
|
|
14317
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
14288
14318
|
var DEFAULT_LABELS3 = {
|
|
14289
14319
|
subtotal: "Subtotal",
|
|
14290
14320
|
discountPrefix: "Descuento",
|
|
@@ -14311,40 +14341,40 @@ function CartSummary({
|
|
|
14311
14341
|
const hasDiscount = Boolean(discount && discount > 0);
|
|
14312
14342
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14313
14343
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
14314
|
-
const breakdown = /* @__PURE__ */
|
|
14344
|
+
const breakdown = /* @__PURE__ */ jsxs12(
|
|
14315
14345
|
"dl",
|
|
14316
14346
|
{
|
|
14317
|
-
className:
|
|
14347
|
+
className: cn13("space-y-2 text-sm", !hasNotice && className),
|
|
14318
14348
|
"data-slot": "cart-summary",
|
|
14319
14349
|
children: [
|
|
14320
|
-
/* @__PURE__ */
|
|
14321
|
-
/* @__PURE__ */
|
|
14322
|
-
/* @__PURE__ */
|
|
14350
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14351
|
+
/* @__PURE__ */ jsx14("dt", { children: t.subtotal }),
|
|
14352
|
+
/* @__PURE__ */ jsx14("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
14323
14353
|
] }),
|
|
14324
|
-
hasDiscount && /* @__PURE__ */
|
|
14325
|
-
/* @__PURE__ */
|
|
14354
|
+
hasDiscount && /* @__PURE__ */ jsxs12("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
14355
|
+
/* @__PURE__ */ jsxs12("dt", { children: [
|
|
14326
14356
|
t.discountPrefix,
|
|
14327
14357
|
discountCode ? ` (${discountCode})` : ""
|
|
14328
14358
|
] }),
|
|
14329
|
-
/* @__PURE__ */
|
|
14359
|
+
/* @__PURE__ */ jsxs12("dd", { children: [
|
|
14330
14360
|
"-",
|
|
14331
14361
|
formatPrice(discount, currencyCode, locale)
|
|
14332
14362
|
] })
|
|
14333
14363
|
] }),
|
|
14334
|
-
shippingEnabled && /* @__PURE__ */
|
|
14335
|
-
/* @__PURE__ */
|
|
14336
|
-
/* @__PURE__ */
|
|
14364
|
+
shippingEnabled && /* @__PURE__ */ jsxs12("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14365
|
+
/* @__PURE__ */ jsx14("dt", { children: t.shipping }),
|
|
14366
|
+
/* @__PURE__ */ jsx14("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
14337
14367
|
] }),
|
|
14338
|
-
/* @__PURE__ */
|
|
14339
|
-
/* @__PURE__ */
|
|
14340
|
-
/* @__PURE__ */
|
|
14368
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
14369
|
+
/* @__PURE__ */ jsx14("dt", { children: t.total }),
|
|
14370
|
+
/* @__PURE__ */ jsx14("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
14341
14371
|
] })
|
|
14342
14372
|
]
|
|
14343
14373
|
}
|
|
14344
14374
|
);
|
|
14345
14375
|
if (!hasNotice) return breakdown;
|
|
14346
|
-
return /* @__PURE__ */
|
|
14347
|
-
/* @__PURE__ */
|
|
14376
|
+
return /* @__PURE__ */ jsxs12("div", { className: cn13("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
14377
|
+
/* @__PURE__ */ jsx14(
|
|
14348
14378
|
"div",
|
|
14349
14379
|
{
|
|
14350
14380
|
role: "status",
|
|
@@ -14358,8 +14388,8 @@ function CartSummary({
|
|
|
14358
14388
|
}
|
|
14359
14389
|
|
|
14360
14390
|
// src/components/added-to-cart-toast.tsx
|
|
14361
|
-
import { cn as
|
|
14362
|
-
import { jsx as
|
|
14391
|
+
import { cn as cn14 } from "@reblu/site-ui/utils";
|
|
14392
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
14363
14393
|
var DEFAULT_LABELS4 = {
|
|
14364
14394
|
success: "A\xF1adido al carrito",
|
|
14365
14395
|
error: "No se pudo a\xF1adir al carrito",
|
|
@@ -14379,12 +14409,12 @@ function AddedToCartToast({
|
|
|
14379
14409
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
14380
14410
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
14381
14411
|
const variant = status === "success" ? "success" : "error";
|
|
14382
|
-
return /* @__PURE__ */
|
|
14412
|
+
return /* @__PURE__ */ jsxs13(
|
|
14383
14413
|
"div",
|
|
14384
14414
|
{
|
|
14385
14415
|
"data-slot": "added-to-cart-toast",
|
|
14386
14416
|
"data-variant": variant,
|
|
14387
|
-
className:
|
|
14417
|
+
className: cn14(
|
|
14388
14418
|
"flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
|
|
14389
14419
|
variant === "success" && "border-green-600/30 dark:border-green-400/30",
|
|
14390
14420
|
variant === "error" && "border-destructive/30",
|
|
@@ -14392,20 +14422,20 @@ function AddedToCartToast({
|
|
|
14392
14422
|
),
|
|
14393
14423
|
children: [
|
|
14394
14424
|
hasThumbnail && // eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
14395
|
-
/* @__PURE__ */
|
|
14396
|
-
/* @__PURE__ */
|
|
14397
|
-
/* @__PURE__ */
|
|
14398
|
-
/* @__PURE__ */
|
|
14425
|
+
/* @__PURE__ */ jsx15("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
14426
|
+
/* @__PURE__ */ jsxs13("div", { className: "min-w-0 flex-1", children: [
|
|
14427
|
+
/* @__PURE__ */ jsx15("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
14428
|
+
/* @__PURE__ */ jsx15("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
14399
14429
|
] }),
|
|
14400
|
-
/* @__PURE__ */
|
|
14430
|
+
/* @__PURE__ */ jsx15("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx15("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
|
|
14401
14431
|
]
|
|
14402
14432
|
}
|
|
14403
14433
|
);
|
|
14404
14434
|
}
|
|
14405
14435
|
|
|
14406
14436
|
// src/components/checkout-login-prompt.tsx
|
|
14407
|
-
import { cn as
|
|
14408
|
-
import { Fragment as Fragment3, jsx as
|
|
14437
|
+
import { cn as cn15 } from "@reblu/site-ui/utils";
|
|
14438
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
14409
14439
|
var DEFAULT_LABELS5 = {
|
|
14410
14440
|
title: "Identificaci\xF3n",
|
|
14411
14441
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -14432,26 +14462,26 @@ function CheckoutLoginPrompt({
|
|
|
14432
14462
|
if (!open) return null;
|
|
14433
14463
|
const t = { ...DEFAULT_LABELS5, ...labels };
|
|
14434
14464
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
14435
|
-
return /* @__PURE__ */
|
|
14436
|
-
/* @__PURE__ */
|
|
14437
|
-
/* @__PURE__ */
|
|
14465
|
+
return /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
14466
|
+
/* @__PURE__ */ jsx16("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
14467
|
+
/* @__PURE__ */ jsxs14(
|
|
14438
14468
|
"div",
|
|
14439
14469
|
{
|
|
14440
14470
|
role: "dialog",
|
|
14441
14471
|
"aria-modal": "true",
|
|
14442
14472
|
"aria-labelledby": "checkout-login-prompt-title",
|
|
14443
14473
|
"data-slot": "checkout-login-prompt",
|
|
14444
|
-
className:
|
|
14474
|
+
className: cn15(
|
|
14445
14475
|
"fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 space-y-5 rounded-2xl border border-border bg-background p-6 shadow-2xl",
|
|
14446
14476
|
className
|
|
14447
14477
|
),
|
|
14448
14478
|
children: [
|
|
14449
|
-
/* @__PURE__ */
|
|
14450
|
-
/* @__PURE__ */
|
|
14451
|
-
/* @__PURE__ */
|
|
14452
|
-
/* @__PURE__ */
|
|
14479
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-start justify-between gap-3", children: [
|
|
14480
|
+
/* @__PURE__ */ jsxs14("div", { children: [
|
|
14481
|
+
/* @__PURE__ */ jsx16("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
14482
|
+
/* @__PURE__ */ jsx16("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
14453
14483
|
] }),
|
|
14454
|
-
/* @__PURE__ */
|
|
14484
|
+
/* @__PURE__ */ jsx16(
|
|
14455
14485
|
"button",
|
|
14456
14486
|
{
|
|
14457
14487
|
type: "button",
|
|
@@ -14462,9 +14492,9 @@ function CheckoutLoginPrompt({
|
|
|
14462
14492
|
}
|
|
14463
14493
|
)
|
|
14464
14494
|
] }),
|
|
14465
|
-
/* @__PURE__ */
|
|
14466
|
-
/* @__PURE__ */
|
|
14467
|
-
/* @__PURE__ */
|
|
14495
|
+
/* @__PURE__ */ jsxs14("div", { className: "space-y-2", children: [
|
|
14496
|
+
/* @__PURE__ */ jsx16("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
14497
|
+
/* @__PURE__ */ jsx16(
|
|
14468
14498
|
"input",
|
|
14469
14499
|
{
|
|
14470
14500
|
id: "checkout-login-prompt-email",
|
|
@@ -14473,29 +14503,29 @@ function CheckoutLoginPrompt({
|
|
|
14473
14503
|
value: email,
|
|
14474
14504
|
onChange: (e) => onEmailChange(e.target.value),
|
|
14475
14505
|
placeholder: t.emailPlaceholder,
|
|
14476
|
-
className:
|
|
14506
|
+
className: cn15(
|
|
14477
14507
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
14478
14508
|
error ? "border-destructive" : "border-border focus:border-primary"
|
|
14479
14509
|
)
|
|
14480
14510
|
}
|
|
14481
14511
|
),
|
|
14482
|
-
error && /* @__PURE__ */
|
|
14512
|
+
error && /* @__PURE__ */ jsx16("p", { className: "text-xs text-destructive", children: error })
|
|
14483
14513
|
] }),
|
|
14484
|
-
/* @__PURE__ */
|
|
14485
|
-
/* @__PURE__ */
|
|
14514
|
+
/* @__PURE__ */ jsxs14("div", { className: "space-y-2", children: [
|
|
14515
|
+
/* @__PURE__ */ jsx16(
|
|
14486
14516
|
"button",
|
|
14487
14517
|
{
|
|
14488
14518
|
type: "button",
|
|
14489
14519
|
onClick: onSubmitEmail,
|
|
14490
14520
|
disabled: checking || !isValidEmail,
|
|
14491
|
-
className:
|
|
14521
|
+
className: cn15(
|
|
14492
14522
|
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
14493
14523
|
checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
14494
14524
|
),
|
|
14495
14525
|
children: checking ? t.checking : t.continueWithEmail
|
|
14496
14526
|
}
|
|
14497
14527
|
),
|
|
14498
|
-
/* @__PURE__ */
|
|
14528
|
+
/* @__PURE__ */ jsx16(
|
|
14499
14529
|
"button",
|
|
14500
14530
|
{
|
|
14501
14531
|
type: "button",
|
|
@@ -14512,9 +14542,9 @@ function CheckoutLoginPrompt({
|
|
|
14512
14542
|
}
|
|
14513
14543
|
|
|
14514
14544
|
// src/components/checkout-form.tsx
|
|
14515
|
-
import { cn as
|
|
14545
|
+
import { cn as cn16 } from "@reblu/site-ui/utils";
|
|
14516
14546
|
import { PhoneInput } from "@reblu/site-ui/phone-input";
|
|
14517
|
-
import { Fragment as Fragment4, jsx as
|
|
14547
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
14518
14548
|
var DEFAULT_LABELS6 = {
|
|
14519
14549
|
contactTitle: "Datos de contacto",
|
|
14520
14550
|
nameLabel: "Nombre completo",
|
|
@@ -14568,22 +14598,22 @@ function CheckoutForm({
|
|
|
14568
14598
|
event.preventDefault();
|
|
14569
14599
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
14570
14600
|
}
|
|
14571
|
-
return /* @__PURE__ */
|
|
14601
|
+
return /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
14572
14602
|
loginPrompt,
|
|
14573
|
-
/* @__PURE__ */
|
|
14603
|
+
/* @__PURE__ */ jsxs15(
|
|
14574
14604
|
"form",
|
|
14575
14605
|
{
|
|
14576
14606
|
"data-testid": "checkout-form",
|
|
14577
14607
|
onSubmit,
|
|
14578
|
-
className:
|
|
14608
|
+
className: cn16("space-y-8", className),
|
|
14579
14609
|
"data-slot": "checkout-form",
|
|
14580
14610
|
children: [
|
|
14581
|
-
/* @__PURE__ */
|
|
14582
|
-
/* @__PURE__ */
|
|
14583
|
-
/* @__PURE__ */
|
|
14584
|
-
/* @__PURE__ */
|
|
14585
|
-
/* @__PURE__ */
|
|
14586
|
-
/* @__PURE__ */
|
|
14611
|
+
/* @__PURE__ */ jsxs15("section", { className: "space-y-4", children: [
|
|
14612
|
+
/* @__PURE__ */ jsx17("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
14613
|
+
/* @__PURE__ */ jsxs15("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
14614
|
+
/* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
|
|
14615
|
+
/* @__PURE__ */ jsx17("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
14616
|
+
/* @__PURE__ */ jsx17(
|
|
14587
14617
|
"input",
|
|
14588
14618
|
{
|
|
14589
14619
|
id: "checkout-form-name",
|
|
@@ -14592,17 +14622,17 @@ function CheckoutForm({
|
|
|
14592
14622
|
value: contact.name,
|
|
14593
14623
|
onChange: (e) => patchContact({ name: e.target.value }),
|
|
14594
14624
|
placeholder: t.namePlaceholder,
|
|
14595
|
-
className:
|
|
14625
|
+
className: cn16(
|
|
14596
14626
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
14597
14627
|
contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
|
|
14598
14628
|
)
|
|
14599
14629
|
}
|
|
14600
14630
|
),
|
|
14601
|
-
contactErrors?.name && /* @__PURE__ */
|
|
14631
|
+
contactErrors?.name && /* @__PURE__ */ jsx17("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
14602
14632
|
] }),
|
|
14603
|
-
/* @__PURE__ */
|
|
14604
|
-
/* @__PURE__ */
|
|
14605
|
-
/* @__PURE__ */
|
|
14633
|
+
/* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
|
|
14634
|
+
/* @__PURE__ */ jsx17("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
14635
|
+
/* @__PURE__ */ jsx17(
|
|
14606
14636
|
"input",
|
|
14607
14637
|
{
|
|
14608
14638
|
id: "checkout-form-email",
|
|
@@ -14611,15 +14641,15 @@ function CheckoutForm({
|
|
|
14611
14641
|
value: contact.email,
|
|
14612
14642
|
onChange: (e) => patchContact({ email: e.target.value }),
|
|
14613
14643
|
placeholder: t.emailPlaceholder,
|
|
14614
|
-
className:
|
|
14644
|
+
className: cn16(
|
|
14615
14645
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
14616
14646
|
contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
|
|
14617
14647
|
)
|
|
14618
14648
|
}
|
|
14619
14649
|
),
|
|
14620
|
-
contactErrors?.email && /* @__PURE__ */
|
|
14650
|
+
contactErrors?.email && /* @__PURE__ */ jsx17("p", { className: "text-xs text-destructive", children: contactErrors.email })
|
|
14621
14651
|
] }),
|
|
14622
|
-
/* @__PURE__ */
|
|
14652
|
+
/* @__PURE__ */ jsx17("div", { className: "space-y-1", children: /* @__PURE__ */ jsx17(
|
|
14623
14653
|
PhoneInput,
|
|
14624
14654
|
{
|
|
14625
14655
|
id: "checkout-form-phone",
|
|
@@ -14633,15 +14663,15 @@ function CheckoutForm({
|
|
|
14633
14663
|
] })
|
|
14634
14664
|
] }),
|
|
14635
14665
|
children2,
|
|
14636
|
-
generalError ? /* @__PURE__ */
|
|
14637
|
-
/* @__PURE__ */
|
|
14638
|
-
/* @__PURE__ */
|
|
14639
|
-
appliedDiscount ? /* @__PURE__ */
|
|
14640
|
-
/* @__PURE__ */
|
|
14641
|
-
/* @__PURE__ */
|
|
14642
|
-
/* @__PURE__ */
|
|
14666
|
+
generalError ? /* @__PURE__ */ jsx17("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
14667
|
+
/* @__PURE__ */ jsxs15("section", { className: "space-y-3", children: [
|
|
14668
|
+
/* @__PURE__ */ jsx17("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
14669
|
+
appliedDiscount ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between rounded-lg border border-green-200 bg-green-50 px-4 py-3 dark:border-green-800 dark:bg-green-900/20", children: [
|
|
14670
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
14671
|
+
/* @__PURE__ */ jsx17("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
14672
|
+
/* @__PURE__ */ jsx17("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
14643
14673
|
] }),
|
|
14644
|
-
/* @__PURE__ */
|
|
14674
|
+
/* @__PURE__ */ jsx17(
|
|
14645
14675
|
"button",
|
|
14646
14676
|
{
|
|
14647
14677
|
type: "button",
|
|
@@ -14651,9 +14681,9 @@ function CheckoutForm({
|
|
|
14651
14681
|
children: t.removeDiscount
|
|
14652
14682
|
}
|
|
14653
14683
|
)
|
|
14654
|
-
] }) : /* @__PURE__ */
|
|
14655
|
-
/* @__PURE__ */
|
|
14656
|
-
/* @__PURE__ */
|
|
14684
|
+
] }) : /* @__PURE__ */ jsxs15("div", { className: "flex gap-2", children: [
|
|
14685
|
+
/* @__PURE__ */ jsx17("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
14686
|
+
/* @__PURE__ */ jsx17(
|
|
14657
14687
|
"input",
|
|
14658
14688
|
{
|
|
14659
14689
|
id: "checkout-form-discount-code",
|
|
@@ -14665,7 +14695,7 @@ function CheckoutForm({
|
|
|
14665
14695
|
className: "flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm uppercase transition focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
14666
14696
|
}
|
|
14667
14697
|
),
|
|
14668
|
-
/* @__PURE__ */
|
|
14698
|
+
/* @__PURE__ */ jsx17(
|
|
14669
14699
|
"button",
|
|
14670
14700
|
{
|
|
14671
14701
|
type: "button",
|
|
@@ -14676,14 +14706,14 @@ function CheckoutForm({
|
|
|
14676
14706
|
}
|
|
14677
14707
|
)
|
|
14678
14708
|
] }),
|
|
14679
|
-
discountError && /* @__PURE__ */
|
|
14709
|
+
discountError && /* @__PURE__ */ jsx17("p", { className: "text-xs text-destructive", children: discountError })
|
|
14680
14710
|
] }),
|
|
14681
|
-
/* @__PURE__ */
|
|
14711
|
+
/* @__PURE__ */ jsx17(
|
|
14682
14712
|
"button",
|
|
14683
14713
|
{
|
|
14684
14714
|
type: "submit",
|
|
14685
14715
|
disabled: submitting || submitDisabled,
|
|
14686
|
-
className:
|
|
14716
|
+
className: cn16(
|
|
14687
14717
|
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
14688
14718
|
submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
14689
14719
|
),
|
|
@@ -14697,8 +14727,8 @@ function CheckoutForm({
|
|
|
14697
14727
|
}
|
|
14698
14728
|
|
|
14699
14729
|
// src/components/order-confirmation.tsx
|
|
14700
|
-
import { cn as
|
|
14701
|
-
import { jsx as
|
|
14730
|
+
import { cn as cn17 } from "@reblu/site-ui/utils";
|
|
14731
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
14702
14732
|
var DEFAULT_LABELS7 = {
|
|
14703
14733
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
14704
14734
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
@@ -14760,48 +14790,48 @@ function OrderConfirmation({
|
|
|
14760
14790
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
14761
14791
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
14762
14792
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
14763
|
-
return /* @__PURE__ */
|
|
14764
|
-
/* @__PURE__ */
|
|
14765
|
-
/* @__PURE__ */
|
|
14766
|
-
showFullOrderSummary && order && /* @__PURE__ */
|
|
14767
|
-
/* @__PURE__ */
|
|
14768
|
-
/* @__PURE__ */
|
|
14769
|
-
/* @__PURE__ */
|
|
14793
|
+
return /* @__PURE__ */ jsxs16("div", { className: cn17("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
14794
|
+
/* @__PURE__ */ jsx18("h1", { className: "text-3xl font-bold", children: title }),
|
|
14795
|
+
/* @__PURE__ */ jsx18("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
14796
|
+
showFullOrderSummary && order && /* @__PURE__ */ jsxs16("div", { className: "space-y-6", children: [
|
|
14797
|
+
/* @__PURE__ */ jsxs16("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
14798
|
+
/* @__PURE__ */ jsx18("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
14799
|
+
/* @__PURE__ */ jsx18("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
14770
14800
|
] }),
|
|
14771
|
-
/* @__PURE__ */
|
|
14772
|
-
order.items.map((item, idx) => /* @__PURE__ */
|
|
14801
|
+
/* @__PURE__ */ jsxs16("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
14802
|
+
order.items.map((item, idx) => /* @__PURE__ */ jsxs16(
|
|
14773
14803
|
"div",
|
|
14774
14804
|
{
|
|
14775
14805
|
className: "flex justify-between gap-4 text-sm",
|
|
14776
14806
|
children: [
|
|
14777
|
-
/* @__PURE__ */
|
|
14807
|
+
/* @__PURE__ */ jsxs16("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
14778
14808
|
item.product.name,
|
|
14779
14809
|
item.variant ? ` (${item.variant.name})` : "",
|
|
14780
14810
|
" x",
|
|
14781
14811
|
item.quantity
|
|
14782
14812
|
] }),
|
|
14783
|
-
/* @__PURE__ */
|
|
14813
|
+
/* @__PURE__ */ jsx18("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
14784
14814
|
]
|
|
14785
14815
|
},
|
|
14786
14816
|
idx
|
|
14787
14817
|
)),
|
|
14788
|
-
/* @__PURE__ */
|
|
14789
|
-
/* @__PURE__ */
|
|
14790
|
-
/* @__PURE__ */
|
|
14818
|
+
/* @__PURE__ */ jsx18("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ jsxs16("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
14819
|
+
/* @__PURE__ */ jsx18("span", { children: t.totalLabel }),
|
|
14820
|
+
/* @__PURE__ */ jsx18("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
14791
14821
|
] }) })
|
|
14792
14822
|
] }),
|
|
14793
|
-
/* @__PURE__ */
|
|
14823
|
+
/* @__PURE__ */ jsxs16("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
14794
14824
|
t.confirmationEmailPrefix,
|
|
14795
14825
|
" ",
|
|
14796
|
-
/* @__PURE__ */
|
|
14826
|
+
/* @__PURE__ */ jsx18("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
14797
14827
|
"."
|
|
14798
14828
|
] })
|
|
14799
14829
|
] }),
|
|
14800
|
-
showOrderReference && order && /* @__PURE__ */
|
|
14801
|
-
/* @__PURE__ */
|
|
14802
|
-
/* @__PURE__ */
|
|
14830
|
+
showOrderReference && order && /* @__PURE__ */ jsxs16("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
14831
|
+
/* @__PURE__ */ jsx18("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
14832
|
+
/* @__PURE__ */ jsx18("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
14803
14833
|
] }),
|
|
14804
|
-
status === "failed" && cartHref && /* @__PURE__ */
|
|
14834
|
+
status === "failed" && cartHref && /* @__PURE__ */ jsx18(
|
|
14805
14835
|
"a",
|
|
14806
14836
|
{
|
|
14807
14837
|
href: cartHref,
|
|
@@ -14809,7 +14839,7 @@ function OrderConfirmation({
|
|
|
14809
14839
|
children: t.backToCartLabel
|
|
14810
14840
|
}
|
|
14811
14841
|
),
|
|
14812
|
-
showRecheck && /* @__PURE__ */
|
|
14842
|
+
showRecheck && /* @__PURE__ */ jsx18(
|
|
14813
14843
|
"button",
|
|
14814
14844
|
{
|
|
14815
14845
|
type: "button",
|
|
@@ -14818,9 +14848,9 @@ function OrderConfirmation({
|
|
|
14818
14848
|
children: t.recheckLabel
|
|
14819
14849
|
}
|
|
14820
14850
|
),
|
|
14821
|
-
showSessionReference && /* @__PURE__ */
|
|
14822
|
-
/* @__PURE__ */
|
|
14823
|
-
/* @__PURE__ */
|
|
14851
|
+
showSessionReference && /* @__PURE__ */ jsxs16("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
14852
|
+
/* @__PURE__ */ jsx18("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
14853
|
+
/* @__PURE__ */ jsx18("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
14824
14854
|
] })
|
|
14825
14855
|
] });
|
|
14826
14856
|
}
|
|
@@ -14839,6 +14869,7 @@ export {
|
|
|
14839
14869
|
MarkdownRenderer,
|
|
14840
14870
|
OrderConfirmation,
|
|
14841
14871
|
PageBlocks,
|
|
14872
|
+
PageCardGrid,
|
|
14842
14873
|
ParentPage,
|
|
14843
14874
|
ProductCard,
|
|
14844
14875
|
ProductTrustItems,
|