@reblu/site-blocks 0.18.0 → 0.19.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 +17 -0
- package/README.md +123 -0
- package/dist/_heading-BsNbc1wc.d.cts +4 -0
- package/dist/_heading-BsNbc1wc.d.ts +4 -0
- package/dist/client.cjs +256 -49
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +60 -2
- package/dist/client.d.ts +60 -2
- package/dist/client.js +255 -50
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +352 -302
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -6
- package/dist/index.d.ts +28 -6
- package/dist/index.js +351 -302
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -47,6 +47,7 @@ __export(src_exports, {
|
|
|
47
47
|
ParentPage: () => ParentPage,
|
|
48
48
|
ProductCard: () => ProductCard,
|
|
49
49
|
ProductTrustItems: () => ProductTrustItems,
|
|
50
|
+
ProfessionalFields: () => ProfessionalFields,
|
|
50
51
|
ProfileCard: () => ProfileCard,
|
|
51
52
|
SafeHtml: () => SafeHtml,
|
|
52
53
|
ShopFilters: () => ShopFilters,
|
|
@@ -13699,34 +13700,82 @@ function ParentPage({
|
|
|
13699
13700
|
var Specialty = ParentPage;
|
|
13700
13701
|
|
|
13701
13702
|
// src/components/profile-card.tsx
|
|
13703
|
+
var import_utils7 = require("@reblu/site-ui/utils");
|
|
13704
|
+
|
|
13705
|
+
// src/components/professional-fields.tsx
|
|
13702
13706
|
var import_utils6 = require("@reblu/site-ui/utils");
|
|
13703
13707
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
13708
|
+
function ProfessionalFields({
|
|
13709
|
+
fields,
|
|
13710
|
+
variant = "profile",
|
|
13711
|
+
className
|
|
13712
|
+
}) {
|
|
13713
|
+
const shown = (fields ?? []).filter((f) => variant !== "card" || f.showOnCard);
|
|
13714
|
+
if (shown.length === 0) return null;
|
|
13715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
13716
|
+
"dl",
|
|
13717
|
+
{
|
|
13718
|
+
className: (0, import_utils6.cn)(
|
|
13719
|
+
"grid gap-x-3 gap-y-1 text-sm",
|
|
13720
|
+
variant === "card" ? "justify-center" : "grid-cols-[auto_1fr]",
|
|
13721
|
+
className
|
|
13722
|
+
),
|
|
13723
|
+
"data-slot": "professional-fields",
|
|
13724
|
+
"data-variant": variant,
|
|
13725
|
+
children: shown.map((field, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
13726
|
+
"div",
|
|
13727
|
+
{
|
|
13728
|
+
className: variant === "card" ? "flex justify-center gap-1" : "contents",
|
|
13729
|
+
children: [
|
|
13730
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dt", { className: "text-muted-foreground", children: field.label }),
|
|
13731
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dd", { className: "m-0 font-medium", children: field.value })
|
|
13732
|
+
]
|
|
13733
|
+
},
|
|
13734
|
+
`${field.label}-${index}`
|
|
13735
|
+
))
|
|
13736
|
+
}
|
|
13737
|
+
);
|
|
13738
|
+
}
|
|
13739
|
+
|
|
13740
|
+
// src/components/profile-card.tsx
|
|
13741
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
13704
13742
|
function initials(name) {
|
|
13705
13743
|
return name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("");
|
|
13706
13744
|
}
|
|
13707
|
-
function ProfileCard({
|
|
13745
|
+
function ProfileCard({
|
|
13746
|
+
name,
|
|
13747
|
+
role,
|
|
13748
|
+
imageUrl,
|
|
13749
|
+
specialties = [],
|
|
13750
|
+
bio,
|
|
13751
|
+
fields,
|
|
13752
|
+
href,
|
|
13753
|
+
className
|
|
13754
|
+
}) {
|
|
13708
13755
|
const NameTag = href ? "a" : "span";
|
|
13709
|
-
return /* @__PURE__ */ (0,
|
|
13756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
13710
13757
|
"article",
|
|
13711
13758
|
{
|
|
13712
|
-
className: (0,
|
|
13759
|
+
className: (0, import_utils7.cn)(
|
|
13713
13760
|
"flex flex-col items-center gap-3 rounded-lg border bg-card p-6 text-center",
|
|
13714
13761
|
className
|
|
13715
13762
|
),
|
|
13716
13763
|
"data-slot": "profile-card",
|
|
13717
13764
|
children: [
|
|
13718
|
-
/* @__PURE__ */ (0,
|
|
13719
|
-
|
|
13720
|
-
|
|
13721
|
-
|
|
13722
|
-
|
|
13723
|
-
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
|
|
13727
|
-
|
|
13765
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative h-24 w-24 overflow-hidden rounded-full bg-muted", children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: imageUrl, alt: name, loading: "lazy", className: "h-full w-full object-cover" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
13766
|
+
"span",
|
|
13767
|
+
{
|
|
13768
|
+
className: "flex h-full w-full items-center justify-center text-2xl font-semibold text-muted-foreground",
|
|
13769
|
+
"aria-hidden": "true",
|
|
13770
|
+
children: initials(name)
|
|
13771
|
+
}
|
|
13772
|
+
) }),
|
|
13773
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "space-y-1", children: [
|
|
13774
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { className: "text-lg font-semibold leading-tight", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NameTag, { ...href ? { href, className: "transition-colors hover:text-primary" } : {}, children: name }) }),
|
|
13775
|
+
role && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-muted-foreground", children: role })
|
|
13728
13776
|
] }),
|
|
13729
|
-
|
|
13777
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ProfessionalFields, { fields, variant: "card" }),
|
|
13778
|
+
specialties.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { className: "flex flex-wrap justify-center gap-1.5 p-0", children: specialties.map((s2) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
13730
13779
|
"li",
|
|
13731
13780
|
{
|
|
13732
13781
|
className: "inline-flex items-center rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium text-secondary-foreground",
|
|
@@ -13734,28 +13783,28 @@ function ProfileCard({ name, role, imageUrl, specialties = [], bio, href, classN
|
|
|
13734
13783
|
},
|
|
13735
13784
|
s2
|
|
13736
13785
|
)) }),
|
|
13737
|
-
bio && /* @__PURE__ */ (0,
|
|
13786
|
+
bio && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-muted-foreground", children: bio })
|
|
13738
13787
|
]
|
|
13739
13788
|
}
|
|
13740
13789
|
);
|
|
13741
13790
|
}
|
|
13742
13791
|
|
|
13743
13792
|
// src/components/product-card.tsx
|
|
13744
|
-
var
|
|
13745
|
-
var
|
|
13793
|
+
var import_utils8 = require("@reblu/site-ui/utils");
|
|
13794
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
13746
13795
|
function ProductCard({ product, href, currencyCode = "EUR", locale, className }) {
|
|
13747
13796
|
const image = product.images.find((i) => i.isPrimary) ?? product.images[0];
|
|
13748
13797
|
const hasDiscount = product.comparePrice != null && product.comparePrice > product.price;
|
|
13749
|
-
return /* @__PURE__ */ (0,
|
|
13798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13750
13799
|
"article",
|
|
13751
13800
|
{
|
|
13752
|
-
className: (0,
|
|
13801
|
+
className: (0, import_utils8.cn)(
|
|
13753
13802
|
"group flex flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-lg",
|
|
13754
13803
|
className
|
|
13755
13804
|
),
|
|
13756
13805
|
"data-slot": "product-card",
|
|
13757
13806
|
children: [
|
|
13758
|
-
/* @__PURE__ */ (0,
|
|
13807
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "relative aspect-square overflow-hidden bg-muted", children: image ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13759
13808
|
"img",
|
|
13760
13809
|
{
|
|
13761
13810
|
src: image.url,
|
|
@@ -13763,14 +13812,14 @@ function ProductCard({ product, href, currencyCode = "EUR", locale, className })
|
|
|
13763
13812
|
loading: "lazy",
|
|
13764
13813
|
className: "h-full w-full object-cover transition-transform group-hover:scale-105"
|
|
13765
13814
|
}
|
|
13766
|
-
) : /* @__PURE__ */ (0,
|
|
13767
|
-
/* @__PURE__ */ (0,
|
|
13768
|
-
product.category && /* @__PURE__ */ (0,
|
|
13769
|
-
/* @__PURE__ */ (0,
|
|
13770
|
-
product.shortDescription && /* @__PURE__ */ (0,
|
|
13771
|
-
/* @__PURE__ */ (0,
|
|
13772
|
-
/* @__PURE__ */ (0,
|
|
13773
|
-
hasDiscount && /* @__PURE__ */ (0,
|
|
13815
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex h-full items-center justify-center text-4xl text-muted-foreground/30", "aria-hidden": "true", children: "\u{1F6CD}\uFE0F" }) }),
|
|
13816
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
|
|
13817
|
+
product.category && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("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 }),
|
|
13818
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "text-base font-semibold leading-tight", children: href ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("a", { href, className: "transition-colors hover:text-primary", children: product.name }) : product.name }),
|
|
13819
|
+
product.shortDescription && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: product.shortDescription }),
|
|
13820
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-auto flex items-baseline gap-2 pt-2", children: [
|
|
13821
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-lg font-bold text-foreground", children: formatPrice(product.price, currencyCode, locale) }),
|
|
13822
|
+
hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm text-muted-foreground line-through", children: formatPrice(product.comparePrice, currencyCode, locale) })
|
|
13774
13823
|
] })
|
|
13775
13824
|
] })
|
|
13776
13825
|
]
|
|
@@ -13972,7 +14021,7 @@ var __iconNode8 = [
|
|
|
13972
14021
|
var Truck = createLucideIcon("truck", __iconNode8);
|
|
13973
14022
|
|
|
13974
14023
|
// src/components/product-trust-items.tsx
|
|
13975
|
-
var
|
|
14024
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
13976
14025
|
var DEFAULT_TRUST_ICONS = Object.freeze({
|
|
13977
14026
|
shipping: Truck,
|
|
13978
14027
|
returns: RotateCcw,
|
|
@@ -14006,17 +14055,17 @@ function ProductTrustItems({
|
|
|
14006
14055
|
return [{ key: `${index}-${icon}`, Icon: Icon2, text: text3 }];
|
|
14007
14056
|
});
|
|
14008
14057
|
if (rows.length === 0) return null;
|
|
14009
|
-
return /* @__PURE__ */ (0,
|
|
14010
|
-
/* @__PURE__ */ (0,
|
|
14011
|
-
/* @__PURE__ */ (0,
|
|
14058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(List, { "data-slot": "product-trust-items", className: slotClassName("space-y-2.5", "", className), children: rows.map(({ key: key2, Icon: Icon2, text: text3 }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("li", { className: slotClassName("flex items-center gap-3", "text-sm text-muted-foreground", itemClassName), children: [
|
|
14059
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-foreground/60" }),
|
|
14060
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: text3 })
|
|
14012
14061
|
] }, key2)) });
|
|
14013
14062
|
}
|
|
14014
14063
|
|
|
14015
14064
|
// src/components/faq-accordion.tsx
|
|
14016
|
-
var
|
|
14065
|
+
var import_utils11 = require("@reblu/site-ui/utils");
|
|
14017
14066
|
|
|
14018
14067
|
// src/components/_heading.tsx
|
|
14019
|
-
var
|
|
14068
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
14020
14069
|
function nextHeadingLevel(level) {
|
|
14021
14070
|
return Math.min(level + 1, 6);
|
|
14022
14071
|
}
|
|
@@ -14026,11 +14075,11 @@ function Heading({
|
|
|
14026
14075
|
children: children2
|
|
14027
14076
|
}) {
|
|
14028
14077
|
const Tag = `h${level}`;
|
|
14029
|
-
return /* @__PURE__ */ (0,
|
|
14078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Tag, { className, children: children2 });
|
|
14030
14079
|
}
|
|
14031
14080
|
|
|
14032
14081
|
// src/components/faq-accordion.tsx
|
|
14033
|
-
var
|
|
14082
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
14034
14083
|
function FaqAccordion({
|
|
14035
14084
|
items,
|
|
14036
14085
|
heading,
|
|
@@ -14041,18 +14090,18 @@ function FaqAccordion({
|
|
|
14041
14090
|
}) {
|
|
14042
14091
|
const visible = items.map((item, index) => ({ item, index })).filter(({ item }) => item.q.trim() !== "");
|
|
14043
14092
|
if (visible.length === 0) return null;
|
|
14044
|
-
return /* @__PURE__ */ (0,
|
|
14045
|
-
heading && /* @__PURE__ */ (0,
|
|
14046
|
-
/* @__PURE__ */ (0,
|
|
14093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_utils11.cn)("space-y-4", className), "data-slot": "faq-accordion", children: [
|
|
14094
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Heading, { level: headingLevel, className: "text-2xl font-semibold tracking-tight", children: heading }),
|
|
14095
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "divide-y divide-border rounded-xl border border-border", children: visible.map(({ item, index }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
14047
14096
|
"details",
|
|
14048
14097
|
{
|
|
14049
14098
|
className: "group px-4",
|
|
14050
14099
|
"data-slot": "faq-item",
|
|
14051
14100
|
...defaultOpen.includes(index) ? { open: true } : {},
|
|
14052
14101
|
children: [
|
|
14053
|
-
/* @__PURE__ */ (0,
|
|
14054
|
-
questionHeadingLevel ? /* @__PURE__ */ (0,
|
|
14055
|
-
/* @__PURE__ */ (0,
|
|
14102
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("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: [
|
|
14103
|
+
questionHeadingLevel ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Heading, { level: questionHeadingLevel, className: "text-base font-medium", children: item.q }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: item.q }),
|
|
14104
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
14056
14105
|
"span",
|
|
14057
14106
|
{
|
|
14058
14107
|
"aria-hidden": "true",
|
|
@@ -14061,7 +14110,7 @@ function FaqAccordion({
|
|
|
14061
14110
|
}
|
|
14062
14111
|
)
|
|
14063
14112
|
] }),
|
|
14064
|
-
/* @__PURE__ */ (0,
|
|
14113
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "whitespace-pre-line pb-4 text-muted-foreground", children: item.a })
|
|
14065
14114
|
]
|
|
14066
14115
|
},
|
|
14067
14116
|
index
|
|
@@ -14070,8 +14119,8 @@ function FaqAccordion({
|
|
|
14070
14119
|
}
|
|
14071
14120
|
|
|
14072
14121
|
// src/components/trust-badges.tsx
|
|
14073
|
-
var
|
|
14074
|
-
var
|
|
14122
|
+
var import_utils12 = require("@reblu/site-ui/utils");
|
|
14123
|
+
var import_jsx_runtime13 = (
|
|
14075
14124
|
// eslint-disable-next-line @next/next/no-img-element -- framework-agnostic SDK; the SITE owns image optimisation
|
|
14076
14125
|
require("react/jsx-runtime")
|
|
14077
14126
|
);
|
|
@@ -14114,17 +14163,17 @@ function safeLogoSrc(url) {
|
|
|
14114
14163
|
function BadgeContent({ badge, logoClassName }) {
|
|
14115
14164
|
const src = safeLogoSrc(badge.logoUrl);
|
|
14116
14165
|
if (src) {
|
|
14117
|
-
return /* @__PURE__ */ (0,
|
|
14166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
14118
14167
|
"img",
|
|
14119
14168
|
{
|
|
14120
14169
|
src,
|
|
14121
14170
|
alt: badge.name,
|
|
14122
14171
|
loading: "lazy",
|
|
14123
|
-
className: (0,
|
|
14172
|
+
className: (0, import_utils12.cn)("h-12 w-auto object-contain", logoClassName)
|
|
14124
14173
|
}
|
|
14125
14174
|
);
|
|
14126
14175
|
}
|
|
14127
|
-
return /* @__PURE__ */ (0,
|
|
14176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-sm font-medium", children: badge.name });
|
|
14128
14177
|
}
|
|
14129
14178
|
function TrustBadges({
|
|
14130
14179
|
badges,
|
|
@@ -14152,14 +14201,14 @@ function TrustBadges({
|
|
|
14152
14201
|
if (groups.length === 0) return null;
|
|
14153
14202
|
const hasHeading = heading !== void 0 && heading !== null && heading !== "";
|
|
14154
14203
|
const groupHeadingLevel = hasHeading ? nextHeadingLevel(headingLevel) : headingLevel;
|
|
14155
|
-
const content = groups.map(({ type, groupHeading, items }) => /* @__PURE__ */ (0,
|
|
14204
|
+
const content = groups.map(({ type, groupHeading, items }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
14156
14205
|
"div",
|
|
14157
14206
|
{
|
|
14158
14207
|
"data-slot": "trust-badge-group",
|
|
14159
14208
|
"data-type": type,
|
|
14160
|
-
className: (0,
|
|
14209
|
+
className: (0, import_utils12.cn)("space-y-3", groupClassName),
|
|
14161
14210
|
children: [
|
|
14162
|
-
groupHeading ? /* @__PURE__ */ (0,
|
|
14211
|
+
groupHeading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
14163
14212
|
Heading,
|
|
14164
14213
|
{
|
|
14165
14214
|
level: groupHeadingLevel,
|
|
@@ -14171,30 +14220,30 @@ function TrustBadges({
|
|
|
14171
14220
|
children: groupHeading
|
|
14172
14221
|
}
|
|
14173
14222
|
) : null,
|
|
14174
|
-
/* @__PURE__ */ (0,
|
|
14223
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: (0, import_utils12.cn)("flex flex-wrap items-center gap-6", listClassName), children: items.map((badge) => {
|
|
14175
14224
|
const href = safeHref(badge.url);
|
|
14176
|
-
return /* @__PURE__ */ (0,
|
|
14177
|
-
/* @__PURE__ */ (0,
|
|
14225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: href ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("a", { href, target: "_blank", rel: "noopener noreferrer", className: "inline-flex", children: [
|
|
14226
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BadgeContent, { badge, logoClassName }),
|
|
14178
14227
|
" ",
|
|
14179
|
-
/* @__PURE__ */ (0,
|
|
14180
|
-
] }) : /* @__PURE__ */ (0,
|
|
14228
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: newWindowLabel })
|
|
14229
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BadgeContent, { badge, logoClassName }) }, badge.id);
|
|
14181
14230
|
}) })
|
|
14182
14231
|
]
|
|
14183
14232
|
},
|
|
14184
14233
|
type
|
|
14185
14234
|
));
|
|
14186
14235
|
if (!hasHeading) {
|
|
14187
|
-
return /* @__PURE__ */ (0,
|
|
14236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { "data-slot": "trust-badges", className: (0, import_utils12.cn)("space-y-6", className), children: content });
|
|
14188
14237
|
}
|
|
14189
14238
|
const Tag = `h${headingLevel}`;
|
|
14190
|
-
return /* @__PURE__ */ (0,
|
|
14239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
14191
14240
|
"section",
|
|
14192
14241
|
{
|
|
14193
14242
|
"data-slot": "trust-badges",
|
|
14194
14243
|
"aria-labelledby": headingId,
|
|
14195
|
-
className: (0,
|
|
14244
|
+
className: (0, import_utils12.cn)("space-y-6", className),
|
|
14196
14245
|
children: [
|
|
14197
|
-
/* @__PURE__ */ (0,
|
|
14246
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
14198
14247
|
Tag,
|
|
14199
14248
|
{
|
|
14200
14249
|
id: headingId,
|
|
@@ -14209,40 +14258,40 @@ function TrustBadges({
|
|
|
14209
14258
|
}
|
|
14210
14259
|
|
|
14211
14260
|
// src/components/page-blocks.tsx
|
|
14212
|
-
var
|
|
14261
|
+
var import_utils13 = require("@reblu/site-ui/utils");
|
|
14213
14262
|
var import_button_variants2 = require("@reblu/site-ui/button-variants");
|
|
14214
|
-
var
|
|
14263
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
14215
14264
|
var ALIASES = {
|
|
14216
14265
|
doctor_embed: "profile_embed",
|
|
14217
14266
|
specialty_embed: "page_embed"
|
|
14218
14267
|
};
|
|
14219
14268
|
function HeroBlock({ block, headingLevel }) {
|
|
14220
14269
|
const { title, subtitle, imageUrl } = block.data;
|
|
14221
|
-
return /* @__PURE__ */ (0,
|
|
14222
|
-
/* @__PURE__ */ (0,
|
|
14223
|
-
subtitle && /* @__PURE__ */ (0,
|
|
14224
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
14270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-4", children: [
|
|
14271
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
|
|
14272
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-lg opacity-80", children: subtitle }),
|
|
14273
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
|
|
14225
14274
|
] });
|
|
14226
14275
|
}
|
|
14227
14276
|
function RichtextBlock({ block, headingLevel }) {
|
|
14228
|
-
return /* @__PURE__ */ (0,
|
|
14277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
|
|
14229
14278
|
}
|
|
14230
14279
|
function FaqBlock({ block }) {
|
|
14231
|
-
return /* @__PURE__ */ (0,
|
|
14280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FaqAccordion, { items: block.data.items });
|
|
14232
14281
|
}
|
|
14233
14282
|
function StatsBlock({ block }) {
|
|
14234
|
-
return /* @__PURE__ */ (0,
|
|
14235
|
-
/* @__PURE__ */ (0,
|
|
14236
|
-
/* @__PURE__ */ (0,
|
|
14283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dl", { className: "grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: block.data.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex flex-col-reverse gap-1", children: [
|
|
14284
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { className: "text-sm opacity-80", children: item.label }),
|
|
14285
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { className: "text-3xl font-bold", children: item.value })
|
|
14237
14286
|
] }, i)) });
|
|
14238
14287
|
}
|
|
14239
14288
|
function TestimonialBlock({ block }) {
|
|
14240
14289
|
const { quote, author, role, avatarUrl } = block.data;
|
|
14241
|
-
return /* @__PURE__ */ (0,
|
|
14242
|
-
/* @__PURE__ */ (0,
|
|
14243
|
-
/* @__PURE__ */ (0,
|
|
14290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("figure", { className: "space-y-4", children: [
|
|
14291
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: quote }) }),
|
|
14292
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("figcaption", { className: "flex items-center gap-3", children: [
|
|
14244
14293
|
avatarUrl && // eslint-disable-next-line @next/next/no-img-element
|
|
14245
|
-
/* @__PURE__ */ (0,
|
|
14294
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14246
14295
|
"img",
|
|
14247
14296
|
{
|
|
14248
14297
|
src: avatarUrl,
|
|
@@ -14251,9 +14300,9 @@ function TestimonialBlock({ block }) {
|
|
|
14251
14300
|
className: "h-10 w-10 rounded-full object-cover"
|
|
14252
14301
|
}
|
|
14253
14302
|
),
|
|
14254
|
-
/* @__PURE__ */ (0,
|
|
14255
|
-
/* @__PURE__ */ (0,
|
|
14256
|
-
role && /* @__PURE__ */ (0,
|
|
14303
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
14304
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "font-semibold", children: author }),
|
|
14305
|
+
role && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "block text-sm opacity-80", children: role })
|
|
14257
14306
|
] })
|
|
14258
14307
|
] })
|
|
14259
14308
|
] });
|
|
@@ -14262,19 +14311,19 @@ function CtaSlotBlock(_props) {
|
|
|
14262
14311
|
return null;
|
|
14263
14312
|
}
|
|
14264
14313
|
function FeatureListBlock({ block }) {
|
|
14265
|
-
return /* @__PURE__ */ (0,
|
|
14314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "grid list-disc gap-2 pl-5 sm:grid-cols-2", children: block.data.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: item.text }, i)) });
|
|
14266
14315
|
}
|
|
14267
14316
|
function GalleryBlock({ block }) {
|
|
14268
14317
|
const { images } = block.data;
|
|
14269
|
-
return /* @__PURE__ */ (0,
|
|
14318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14270
14319
|
"div",
|
|
14271
14320
|
{
|
|
14272
|
-
className: (0,
|
|
14321
|
+
className: (0, import_utils13.cn)(
|
|
14273
14322
|
"grid gap-4",
|
|
14274
14323
|
images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
|
|
14275
14324
|
),
|
|
14276
|
-
children: images.map((img, i) => /* @__PURE__ */ (0,
|
|
14277
|
-
/* @__PURE__ */ (0,
|
|
14325
|
+
children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("figure", { className: "space-y-1", children: [
|
|
14326
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14278
14327
|
"img",
|
|
14279
14328
|
{
|
|
14280
14329
|
src: img.url,
|
|
@@ -14283,7 +14332,7 @@ function GalleryBlock({ block }) {
|
|
|
14283
14332
|
className: "h-full w-full object-cover"
|
|
14284
14333
|
}
|
|
14285
14334
|
) }),
|
|
14286
|
-
img.caption && /* @__PURE__ */ (0,
|
|
14335
|
+
img.caption && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("figcaption", { className: "text-sm opacity-80", children: img.caption })
|
|
14287
14336
|
] }, `${img.url}-${i}`))
|
|
14288
14337
|
}
|
|
14289
14338
|
);
|
|
@@ -14293,13 +14342,13 @@ function EmbedCard({
|
|
|
14293
14342
|
headingLevel,
|
|
14294
14343
|
embedHref
|
|
14295
14344
|
}) {
|
|
14296
|
-
return /* @__PURE__ */ (0,
|
|
14345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
14297
14346
|
"a",
|
|
14298
14347
|
{
|
|
14299
14348
|
href: embedHref(resolved),
|
|
14300
14349
|
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",
|
|
14301
14350
|
children: [
|
|
14302
|
-
resolved.coverImageUrl && /* @__PURE__ */ (0,
|
|
14351
|
+
resolved.coverImageUrl && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14303
14352
|
"img",
|
|
14304
14353
|
{
|
|
14305
14354
|
src: resolved.coverImageUrl,
|
|
@@ -14308,24 +14357,24 @@ function EmbedCard({
|
|
|
14308
14357
|
className: "h-full w-full object-cover"
|
|
14309
14358
|
}
|
|
14310
14359
|
) }),
|
|
14311
|
-
/* @__PURE__ */ (0,
|
|
14312
|
-
/* @__PURE__ */ (0,
|
|
14313
|
-
resolved.role && /* @__PURE__ */ (0,
|
|
14314
|
-
resolved.excerpt && /* @__PURE__ */ (0,
|
|
14360
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-1 p-4", children: [
|
|
14361
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
|
|
14362
|
+
resolved.role && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
|
|
14363
|
+
resolved.excerpt && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-muted-foreground", children: resolved.excerpt })
|
|
14315
14364
|
] })
|
|
14316
14365
|
]
|
|
14317
14366
|
}
|
|
14318
14367
|
);
|
|
14319
14368
|
}
|
|
14320
14369
|
function PageEmbedBlock({ block, headingLevel, embedHref }) {
|
|
14321
|
-
return /* @__PURE__ */ (0,
|
|
14370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14322
14371
|
}
|
|
14323
14372
|
function ProfileEmbedBlock({
|
|
14324
14373
|
block,
|
|
14325
14374
|
headingLevel,
|
|
14326
14375
|
embedHref
|
|
14327
14376
|
}) {
|
|
14328
|
-
return /* @__PURE__ */ (0,
|
|
14377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14329
14378
|
}
|
|
14330
14379
|
var DEFAULT_RENDERERS = {
|
|
14331
14380
|
hero: HeroBlock,
|
|
@@ -14382,14 +14431,14 @@ function toIdFragment(value) {
|
|
|
14382
14431
|
function SectionCta2({ cta }) {
|
|
14383
14432
|
if (!hasUsableCta(cta)) return null;
|
|
14384
14433
|
const variant = toButtonVariant(cta.variant);
|
|
14385
|
-
return /* @__PURE__ */ (0,
|
|
14434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14386
14435
|
"a",
|
|
14387
14436
|
{
|
|
14388
14437
|
href: cta.url,
|
|
14389
14438
|
"data-slot": "button",
|
|
14390
14439
|
"data-variant": variant,
|
|
14391
14440
|
"data-size": "default",
|
|
14392
|
-
className: (0,
|
|
14441
|
+
className: (0, import_utils13.cn)((0, import_button_variants2.buttonVariants)({ variant, size: "default" })),
|
|
14393
14442
|
...cta.isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
14394
14443
|
children: cta.label
|
|
14395
14444
|
}
|
|
@@ -14415,17 +14464,17 @@ function PageBlocks({
|
|
|
14415
14464
|
const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
|
|
14416
14465
|
const background = block.backgroundColor;
|
|
14417
14466
|
return [
|
|
14418
|
-
/* @__PURE__ */ (0,
|
|
14467
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
14419
14468
|
"section",
|
|
14420
14469
|
{
|
|
14421
14470
|
"data-slot": "page-block",
|
|
14422
14471
|
"data-block-type": type,
|
|
14423
14472
|
"aria-labelledby": headingId,
|
|
14424
14473
|
style: surfaceStyle(background),
|
|
14425
|
-
className: (0,
|
|
14474
|
+
className: (0, import_utils13.cn)("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
|
|
14426
14475
|
children: [
|
|
14427
|
-
block.heading && /* @__PURE__ */ (0,
|
|
14428
|
-
/* @__PURE__ */ (0,
|
|
14476
|
+
block.heading && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { id: headingId, children: block.heading }) }),
|
|
14477
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14429
14478
|
Renderer,
|
|
14430
14479
|
{
|
|
14431
14480
|
block,
|
|
@@ -14433,7 +14482,7 @@ function PageBlocks({
|
|
|
14433
14482
|
embedHref
|
|
14434
14483
|
}
|
|
14435
14484
|
),
|
|
14436
|
-
/* @__PURE__ */ (0,
|
|
14485
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SectionCta2, { cta: block.cta })
|
|
14437
14486
|
]
|
|
14438
14487
|
},
|
|
14439
14488
|
block.id
|
|
@@ -14441,12 +14490,12 @@ function PageBlocks({
|
|
|
14441
14490
|
];
|
|
14442
14491
|
});
|
|
14443
14492
|
if (sections.length === 0) return null;
|
|
14444
|
-
return /* @__PURE__ */ (0,
|
|
14493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_utils13.cn)("space-y-12", className), "data-slot": "page-blocks", children: sections });
|
|
14445
14494
|
}
|
|
14446
14495
|
|
|
14447
14496
|
// src/components/shop-filters.tsx
|
|
14448
|
-
var
|
|
14449
|
-
var
|
|
14497
|
+
var import_utils14 = require("@reblu/site-ui/utils");
|
|
14498
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
14450
14499
|
var DEFAULT_SHOP_PRICE_BANDS = [
|
|
14451
14500
|
{ max: 2500 },
|
|
14452
14501
|
{ min: 2500, max: 5e3 },
|
|
@@ -14490,7 +14539,7 @@ function priceBandLabel(band, t, currencyCode, locale) {
|
|
|
14490
14539
|
return "";
|
|
14491
14540
|
}
|
|
14492
14541
|
function OptionLink({ href, active, label, onActivate }) {
|
|
14493
|
-
return /* @__PURE__ */ (0,
|
|
14542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14494
14543
|
"a",
|
|
14495
14544
|
{
|
|
14496
14545
|
href,
|
|
@@ -14499,7 +14548,7 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14499
14548
|
event.preventDefault();
|
|
14500
14549
|
onActivate();
|
|
14501
14550
|
} : void 0,
|
|
14502
|
-
className: (0,
|
|
14551
|
+
className: (0, import_utils14.cn)(
|
|
14503
14552
|
"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",
|
|
14504
14553
|
active ? "border-transparent bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
14505
14554
|
),
|
|
@@ -14508,9 +14557,9 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14508
14557
|
);
|
|
14509
14558
|
}
|
|
14510
14559
|
function FilterFieldset({ legend, children: children2 }) {
|
|
14511
|
-
return /* @__PURE__ */ (0,
|
|
14512
|
-
/* @__PURE__ */ (0,
|
|
14513
|
-
/* @__PURE__ */ (0,
|
|
14560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("fieldset", { className: "space-y-2", children: [
|
|
14561
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("legend", { className: "text-sm font-medium text-foreground", children: legend }),
|
|
14562
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-wrap gap-2", children: children2 })
|
|
14514
14563
|
] });
|
|
14515
14564
|
}
|
|
14516
14565
|
function ShopFilters({
|
|
@@ -14533,11 +14582,11 @@ function ShopFilters({
|
|
|
14533
14582
|
if (!shouldRenderShopFilters(facets, active)) {
|
|
14534
14583
|
return null;
|
|
14535
14584
|
}
|
|
14536
|
-
return /* @__PURE__ */ (0,
|
|
14585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_utils14.cn)("space-y-6", className), "data-slot": "shop-filters", children: [
|
|
14537
14586
|
visibleTaxonomies.map((axis) => {
|
|
14538
14587
|
const activeSlug = active.taxonomy?.[axis.key];
|
|
14539
|
-
return /* @__PURE__ */ (0,
|
|
14540
|
-
/* @__PURE__ */ (0,
|
|
14588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(FilterFieldset, { legend: axis.label, children: [
|
|
14589
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14541
14590
|
OptionLink,
|
|
14542
14591
|
{
|
|
14543
14592
|
href: hrefs.taxonomy(axis.key, void 0),
|
|
@@ -14552,7 +14601,7 @@ function ShopFilters({
|
|
|
14552
14601
|
),
|
|
14553
14602
|
axis.terms.map((term) => {
|
|
14554
14603
|
const isActive = activeSlug === term.slug;
|
|
14555
|
-
return /* @__PURE__ */ (0,
|
|
14604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14556
14605
|
OptionLink,
|
|
14557
14606
|
{
|
|
14558
14607
|
href: hrefs.taxonomy(axis.key, isActive ? void 0 : term.slug),
|
|
@@ -14572,9 +14621,9 @@ function ShopFilters({
|
|
|
14572
14621
|
}),
|
|
14573
14622
|
visibleAttributes.map((attr) => {
|
|
14574
14623
|
const activeValues = toValueArray(active.attr?.[attr.key]);
|
|
14575
|
-
return /* @__PURE__ */ (0,
|
|
14624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
|
|
14576
14625
|
const isActive = activeValues.includes(opt.value);
|
|
14577
|
-
return /* @__PURE__ */ (0,
|
|
14626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14578
14627
|
OptionLink,
|
|
14579
14628
|
{
|
|
14580
14629
|
href: hrefs.attr(attr.key, opt.value),
|
|
@@ -14592,11 +14641,11 @@ function ShopFilters({
|
|
|
14592
14641
|
);
|
|
14593
14642
|
}) }, attr.key);
|
|
14594
14643
|
}),
|
|
14595
|
-
showPriceGroup && /* @__PURE__ */ (0,
|
|
14644
|
+
showPriceGroup && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
|
|
14596
14645
|
const isActive = active.priceMin === band.min && active.priceMax === band.max;
|
|
14597
14646
|
const nextMin = isActive ? void 0 : band.min;
|
|
14598
14647
|
const nextMax = isActive ? void 0 : band.max;
|
|
14599
|
-
return /* @__PURE__ */ (0,
|
|
14648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14600
14649
|
OptionLink,
|
|
14601
14650
|
{
|
|
14602
14651
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -14607,7 +14656,7 @@ function ShopFilters({
|
|
|
14607
14656
|
i
|
|
14608
14657
|
);
|
|
14609
14658
|
}) }),
|
|
14610
|
-
hasOnSale && /* @__PURE__ */ (0,
|
|
14659
|
+
hasOnSale && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14611
14660
|
OptionLink,
|
|
14612
14661
|
{
|
|
14613
14662
|
href: hrefs.onSale(!active.onSale),
|
|
@@ -14616,7 +14665,7 @@ function ShopFilters({
|
|
|
14616
14665
|
onActivate: onChange ? () => onChange({ onSale: !active.onSale }) : void 0
|
|
14617
14666
|
}
|
|
14618
14667
|
),
|
|
14619
|
-
/* @__PURE__ */ (0,
|
|
14668
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14620
14669
|
"a",
|
|
14621
14670
|
{
|
|
14622
14671
|
href: hrefs.clearAll(),
|
|
@@ -14632,8 +14681,8 @@ function ShopFilters({
|
|
|
14632
14681
|
}
|
|
14633
14682
|
|
|
14634
14683
|
// src/components/cart-line-list.tsx
|
|
14635
|
-
var
|
|
14636
|
-
var
|
|
14684
|
+
var import_utils15 = require("@reblu/site-ui/utils");
|
|
14685
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
14637
14686
|
var DEFAULT_LABELS2 = {
|
|
14638
14687
|
quantityLabel: "Cantidad",
|
|
14639
14688
|
decrease: "Reducir cantidad",
|
|
@@ -14659,9 +14708,9 @@ function CartLineList({
|
|
|
14659
14708
|
}) {
|
|
14660
14709
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
14661
14710
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14662
|
-
return /* @__PURE__ */ (0,
|
|
14663
|
-
/* @__PURE__ */ (0,
|
|
14664
|
-
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0,
|
|
14711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0, import_utils15.cn)("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
14712
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
14713
|
+
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14665
14714
|
"div",
|
|
14666
14715
|
{
|
|
14667
14716
|
role: "status",
|
|
@@ -14670,69 +14719,69 @@ function CartLineList({
|
|
|
14670
14719
|
children: noticeContent
|
|
14671
14720
|
}
|
|
14672
14721
|
),
|
|
14673
|
-
/* @__PURE__ */ (0,
|
|
14722
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "space-y-4", children: items.map((item) => {
|
|
14674
14723
|
const maxQty = item.maxStock ?? Infinity;
|
|
14675
14724
|
const atMax = item.quantity >= maxQty;
|
|
14676
14725
|
const atMin = item.quantity <= 1;
|
|
14677
14726
|
const message = lineMessage?.(item);
|
|
14678
|
-
return /* @__PURE__ */ (0,
|
|
14727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
14679
14728
|
"li",
|
|
14680
14729
|
{
|
|
14681
14730
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
14682
14731
|
children: [
|
|
14683
|
-
/* @__PURE__ */ (0,
|
|
14684
|
-
/* @__PURE__ */ (0,
|
|
14685
|
-
/* @__PURE__ */ (0,
|
|
14686
|
-
item.variantName && /* @__PURE__ */ (0,
|
|
14687
|
-
/* @__PURE__ */ (0,
|
|
14732
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
14733
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
14734
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
14735
|
+
item.variantName && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
14736
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
14688
14737
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
14689
14738
|
" ",
|
|
14690
14739
|
t.unitPriceSuffix
|
|
14691
14740
|
] }),
|
|
14692
|
-
/* @__PURE__ */ (0,
|
|
14741
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
14693
14742
|
"div",
|
|
14694
14743
|
{
|
|
14695
14744
|
role: "group",
|
|
14696
14745
|
"aria-label": t.quantityLabel,
|
|
14697
14746
|
className: "mt-3 flex items-center gap-3",
|
|
14698
14747
|
children: [
|
|
14699
|
-
/* @__PURE__ */ (0,
|
|
14748
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14700
14749
|
"button",
|
|
14701
14750
|
{
|
|
14702
14751
|
type: "button",
|
|
14703
14752
|
"aria-label": t.decrease,
|
|
14704
14753
|
disabled: !onQuantityChange || atMin,
|
|
14705
14754
|
onClick: onQuantityChange ? () => onQuantityChange(item.productId, item.variantId, item.quantity - 1) : void 0,
|
|
14706
|
-
className: "flex h-7 w-7 items-center justify-center rounded border border-border transition hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",
|
|
14755
|
+
className: "flex h-7 w-7 cursor-pointer items-center justify-center rounded border border-border transition hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",
|
|
14707
14756
|
children: "\u2212"
|
|
14708
14757
|
}
|
|
14709
14758
|
),
|
|
14710
|
-
/* @__PURE__ */ (0,
|
|
14711
|
-
/* @__PURE__ */ (0,
|
|
14759
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
|
|
14760
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14712
14761
|
"button",
|
|
14713
14762
|
{
|
|
14714
14763
|
type: "button",
|
|
14715
14764
|
"aria-label": t.increase,
|
|
14716
14765
|
disabled: !onQuantityChange || atMax,
|
|
14717
14766
|
onClick: onQuantityChange ? () => onQuantityChange(item.productId, item.variantId, item.quantity + 1) : void 0,
|
|
14718
|
-
className: "flex h-7 w-7 items-center justify-center rounded border border-border transition hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",
|
|
14767
|
+
className: "flex h-7 w-7 cursor-pointer items-center justify-center rounded border border-border transition hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",
|
|
14719
14768
|
children: "+"
|
|
14720
14769
|
}
|
|
14721
14770
|
),
|
|
14722
|
-
onRemove && /* @__PURE__ */ (0,
|
|
14771
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14723
14772
|
"button",
|
|
14724
14773
|
{
|
|
14725
14774
|
type: "button",
|
|
14726
14775
|
"aria-label": `${t.remove} ${item.name}`,
|
|
14727
14776
|
onClick: () => onRemove(item.productId, item.variantId),
|
|
14728
|
-
className: "ml-2 text-muted-foreground transition-colors hover:text-destructive",
|
|
14777
|
+
className: "ml-2 cursor-pointer text-muted-foreground transition-colors hover:text-destructive",
|
|
14729
14778
|
children: t.remove
|
|
14730
14779
|
}
|
|
14731
14780
|
)
|
|
14732
14781
|
]
|
|
14733
14782
|
}
|
|
14734
14783
|
),
|
|
14735
|
-
message != null && message !== false && /* @__PURE__ */ (0,
|
|
14784
|
+
message != null && message !== false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14736
14785
|
"p",
|
|
14737
14786
|
{
|
|
14738
14787
|
className: "mt-2 text-sm text-destructive",
|
|
@@ -14741,7 +14790,7 @@ function CartLineList({
|
|
|
14741
14790
|
}
|
|
14742
14791
|
)
|
|
14743
14792
|
] }),
|
|
14744
|
-
/* @__PURE__ */ (0,
|
|
14793
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
|
|
14745
14794
|
]
|
|
14746
14795
|
},
|
|
14747
14796
|
lineKey(item.productId, item.variantId)
|
|
@@ -14751,8 +14800,8 @@ function CartLineList({
|
|
|
14751
14800
|
}
|
|
14752
14801
|
|
|
14753
14802
|
// src/components/cart-summary.tsx
|
|
14754
|
-
var
|
|
14755
|
-
var
|
|
14803
|
+
var import_utils16 = require("@reblu/site-ui/utils");
|
|
14804
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
14756
14805
|
var DEFAULT_LABELS3 = {
|
|
14757
14806
|
subtotal: "Subtotal",
|
|
14758
14807
|
discountPrefix: "Descuento",
|
|
@@ -14779,40 +14828,40 @@ function CartSummary({
|
|
|
14779
14828
|
const hasDiscount = Boolean(discount && discount > 0);
|
|
14780
14829
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14781
14830
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
14782
|
-
const breakdown = /* @__PURE__ */ (0,
|
|
14831
|
+
const breakdown = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
14783
14832
|
"dl",
|
|
14784
14833
|
{
|
|
14785
|
-
className: (0,
|
|
14834
|
+
className: (0, import_utils16.cn)("space-y-2 text-sm", !hasNotice && className),
|
|
14786
14835
|
"data-slot": "cart-summary",
|
|
14787
14836
|
children: [
|
|
14788
|
-
/* @__PURE__ */ (0,
|
|
14789
|
-
/* @__PURE__ */ (0,
|
|
14790
|
-
/* @__PURE__ */ (0,
|
|
14837
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14838
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dt", { children: t.subtotal }),
|
|
14839
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
14791
14840
|
] }),
|
|
14792
|
-
hasDiscount && /* @__PURE__ */ (0,
|
|
14793
|
-
/* @__PURE__ */ (0,
|
|
14841
|
+
hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
14842
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("dt", { children: [
|
|
14794
14843
|
t.discountPrefix,
|
|
14795
14844
|
discountCode ? ` (${discountCode})` : ""
|
|
14796
14845
|
] }),
|
|
14797
|
-
/* @__PURE__ */ (0,
|
|
14846
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("dd", { children: [
|
|
14798
14847
|
"-",
|
|
14799
14848
|
formatPrice(discount, currencyCode, locale)
|
|
14800
14849
|
] })
|
|
14801
14850
|
] }),
|
|
14802
|
-
shippingEnabled && /* @__PURE__ */ (0,
|
|
14803
|
-
/* @__PURE__ */ (0,
|
|
14804
|
-
/* @__PURE__ */ (0,
|
|
14851
|
+
shippingEnabled && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14852
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dt", { children: t.shipping }),
|
|
14853
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
14805
14854
|
] }),
|
|
14806
|
-
/* @__PURE__ */ (0,
|
|
14807
|
-
/* @__PURE__ */ (0,
|
|
14808
|
-
/* @__PURE__ */ (0,
|
|
14855
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
14856
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dt", { children: t.total }),
|
|
14857
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
14809
14858
|
] })
|
|
14810
14859
|
]
|
|
14811
14860
|
}
|
|
14812
14861
|
);
|
|
14813
14862
|
if (!hasNotice) return breakdown;
|
|
14814
|
-
return /* @__PURE__ */ (0,
|
|
14815
|
-
/* @__PURE__ */ (0,
|
|
14863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: (0, import_utils16.cn)("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
14864
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14816
14865
|
"div",
|
|
14817
14866
|
{
|
|
14818
14867
|
role: "status",
|
|
@@ -14826,8 +14875,8 @@ function CartSummary({
|
|
|
14826
14875
|
}
|
|
14827
14876
|
|
|
14828
14877
|
// src/components/cart-adjustments-notice.tsx
|
|
14829
|
-
var
|
|
14830
|
-
var
|
|
14878
|
+
var import_utils17 = require("@reblu/site-ui/utils");
|
|
14879
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
14831
14880
|
var DEFAULT_LABELS4 = {
|
|
14832
14881
|
removed: (names) => names.length === 1 ? `Hemos quitado del carrito: ${names[0]}, ya no est\xE1 disponible.` : `Hemos quitado del carrito: ${names.join(", ")}, ya no est\xE1n disponibles.`,
|
|
14833
14882
|
quantityChanged: (name, quantity) => `Hemos ajustado la cantidad de ${name} a ${quantity} por el stock disponible.`,
|
|
@@ -14861,20 +14910,20 @@ function CartAdjustmentsNotice({
|
|
|
14861
14910
|
);
|
|
14862
14911
|
}
|
|
14863
14912
|
if (messages.length === 0) return null;
|
|
14864
|
-
return /* @__PURE__ */ (0,
|
|
14913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14865
14914
|
"div",
|
|
14866
14915
|
{
|
|
14867
14916
|
role: "status",
|
|
14868
|
-
className: (0,
|
|
14917
|
+
className: (0, import_utils17.cn)("rounded-lg border border-border bg-muted px-3 py-2 text-sm", className),
|
|
14869
14918
|
"data-slot": "cart-adjustments-notice",
|
|
14870
|
-
children: messages.length === 1 ? /* @__PURE__ */ (0,
|
|
14919
|
+
children: messages.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: messages[0] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ul", { className: "list-disc space-y-1 pl-4", children: messages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("li", { children: message }, index)) })
|
|
14871
14920
|
}
|
|
14872
14921
|
);
|
|
14873
14922
|
}
|
|
14874
14923
|
|
|
14875
14924
|
// src/components/added-to-cart-toast.tsx
|
|
14876
|
-
var
|
|
14877
|
-
var
|
|
14925
|
+
var import_utils18 = require("@reblu/site-ui/utils");
|
|
14926
|
+
var import_jsx_runtime19 = (
|
|
14878
14927
|
// eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
14879
14928
|
require("react/jsx-runtime")
|
|
14880
14929
|
);
|
|
@@ -14897,32 +14946,32 @@ function AddedToCartToast({
|
|
|
14897
14946
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
14898
14947
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
14899
14948
|
const variant = status === "success" ? "success" : "error";
|
|
14900
|
-
return /* @__PURE__ */ (0,
|
|
14949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
14901
14950
|
"div",
|
|
14902
14951
|
{
|
|
14903
14952
|
"data-slot": "added-to-cart-toast",
|
|
14904
14953
|
"data-variant": variant,
|
|
14905
|
-
className: (0,
|
|
14954
|
+
className: (0, import_utils18.cn)(
|
|
14906
14955
|
"flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
|
|
14907
14956
|
variant === "success" && "border-green-600/30 dark:border-green-400/30",
|
|
14908
14957
|
variant === "error" && "border-destructive/30",
|
|
14909
14958
|
className
|
|
14910
14959
|
),
|
|
14911
14960
|
children: [
|
|
14912
|
-
hasThumbnail && /* @__PURE__ */ (0,
|
|
14913
|
-
/* @__PURE__ */ (0,
|
|
14914
|
-
/* @__PURE__ */ (0,
|
|
14915
|
-
/* @__PURE__ */ (0,
|
|
14961
|
+
hasThumbnail && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
14962
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
14963
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
14964
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
14916
14965
|
] }),
|
|
14917
|
-
/* @__PURE__ */ (0,
|
|
14966
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
|
|
14918
14967
|
]
|
|
14919
14968
|
}
|
|
14920
14969
|
);
|
|
14921
14970
|
}
|
|
14922
14971
|
|
|
14923
14972
|
// src/components/checkout-login-prompt.tsx
|
|
14924
|
-
var
|
|
14925
|
-
var
|
|
14973
|
+
var import_utils19 = require("@reblu/site-ui/utils");
|
|
14974
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
14926
14975
|
var DEFAULT_LABELS6 = {
|
|
14927
14976
|
title: "Identificaci\xF3n",
|
|
14928
14977
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -14949,39 +14998,39 @@ function CheckoutLoginPrompt({
|
|
|
14949
14998
|
if (!open) return null;
|
|
14950
14999
|
const t = { ...DEFAULT_LABELS6, ...labels };
|
|
14951
15000
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
14952
|
-
return /* @__PURE__ */ (0,
|
|
14953
|
-
/* @__PURE__ */ (0,
|
|
14954
|
-
/* @__PURE__ */ (0,
|
|
15001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
15002
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
15003
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
14955
15004
|
"div",
|
|
14956
15005
|
{
|
|
14957
15006
|
role: "dialog",
|
|
14958
15007
|
"aria-modal": "true",
|
|
14959
15008
|
"aria-labelledby": "checkout-login-prompt-title",
|
|
14960
15009
|
"data-slot": "checkout-login-prompt",
|
|
14961
|
-
className: (0,
|
|
15010
|
+
className: (0, import_utils19.cn)(
|
|
14962
15011
|
"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",
|
|
14963
15012
|
className
|
|
14964
15013
|
),
|
|
14965
15014
|
children: [
|
|
14966
|
-
/* @__PURE__ */ (0,
|
|
14967
|
-
/* @__PURE__ */ (0,
|
|
14968
|
-
/* @__PURE__ */ (0,
|
|
14969
|
-
/* @__PURE__ */ (0,
|
|
15015
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
15016
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
15017
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
15018
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
14970
15019
|
] }),
|
|
14971
|
-
/* @__PURE__ */ (0,
|
|
15020
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14972
15021
|
"button",
|
|
14973
15022
|
{
|
|
14974
15023
|
type: "button",
|
|
14975
15024
|
onClick: onClose,
|
|
14976
15025
|
"aria-label": t.close,
|
|
14977
|
-
className: "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
15026
|
+
className: "flex h-8 w-8 flex-shrink-0 cursor-pointer items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
14978
15027
|
children: "\u2715"
|
|
14979
15028
|
}
|
|
14980
15029
|
)
|
|
14981
15030
|
] }),
|
|
14982
|
-
/* @__PURE__ */ (0,
|
|
14983
|
-
/* @__PURE__ */ (0,
|
|
14984
|
-
/* @__PURE__ */ (0,
|
|
15031
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "space-y-2", children: [
|
|
15032
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15033
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14985
15034
|
"input",
|
|
14986
15035
|
{
|
|
14987
15036
|
id: "checkout-login-prompt-email",
|
|
@@ -14990,34 +15039,34 @@ function CheckoutLoginPrompt({
|
|
|
14990
15039
|
value: email,
|
|
14991
15040
|
onChange: (e) => onEmailChange(e.target.value),
|
|
14992
15041
|
placeholder: t.emailPlaceholder,
|
|
14993
|
-
className: (0,
|
|
15042
|
+
className: (0, import_utils19.cn)(
|
|
14994
15043
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
14995
15044
|
error ? "border-destructive" : "border-border focus:border-primary"
|
|
14996
15045
|
)
|
|
14997
15046
|
}
|
|
14998
15047
|
),
|
|
14999
|
-
error && /* @__PURE__ */ (0,
|
|
15048
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs text-destructive", children: error })
|
|
15000
15049
|
] }),
|
|
15001
|
-
/* @__PURE__ */ (0,
|
|
15002
|
-
/* @__PURE__ */ (0,
|
|
15050
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "space-y-2", children: [
|
|
15051
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15003
15052
|
"button",
|
|
15004
15053
|
{
|
|
15005
15054
|
type: "button",
|
|
15006
15055
|
onClick: onSubmitEmail,
|
|
15007
15056
|
disabled: checking || !isValidEmail,
|
|
15008
|
-
className: (0,
|
|
15009
|
-
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
15057
|
+
className: (0, import_utils19.cn)(
|
|
15058
|
+
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
15010
15059
|
checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15011
15060
|
),
|
|
15012
15061
|
children: checking ? t.checking : t.continueWithEmail
|
|
15013
15062
|
}
|
|
15014
15063
|
),
|
|
15015
|
-
/* @__PURE__ */ (0,
|
|
15064
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15016
15065
|
"button",
|
|
15017
15066
|
{
|
|
15018
15067
|
type: "button",
|
|
15019
15068
|
onClick: onContinueAsGuest,
|
|
15020
|
-
className: "flex w-full items-center justify-center gap-2 rounded-xl bg-muted px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-colors hover:bg-muted/70",
|
|
15069
|
+
className: "flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl bg-muted px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-colors hover:bg-muted/70",
|
|
15021
15070
|
children: t.continueAsGuest
|
|
15022
15071
|
}
|
|
15023
15072
|
)
|
|
@@ -15029,9 +15078,9 @@ function CheckoutLoginPrompt({
|
|
|
15029
15078
|
}
|
|
15030
15079
|
|
|
15031
15080
|
// src/components/checkout-form.tsx
|
|
15032
|
-
var
|
|
15081
|
+
var import_utils20 = require("@reblu/site-ui/utils");
|
|
15033
15082
|
var import_phone_input = require("@reblu/site-ui/phone-input");
|
|
15034
|
-
var
|
|
15083
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
15035
15084
|
var DEFAULT_LABELS7 = {
|
|
15036
15085
|
contactTitle: "Datos de contacto",
|
|
15037
15086
|
nameLabel: "Nombre completo",
|
|
@@ -15085,22 +15134,22 @@ function CheckoutForm({
|
|
|
15085
15134
|
event.preventDefault();
|
|
15086
15135
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
15087
15136
|
}
|
|
15088
|
-
return /* @__PURE__ */ (0,
|
|
15137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
15089
15138
|
loginPrompt,
|
|
15090
|
-
/* @__PURE__ */ (0,
|
|
15139
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15091
15140
|
"form",
|
|
15092
15141
|
{
|
|
15093
15142
|
"data-testid": "checkout-form",
|
|
15094
15143
|
onSubmit,
|
|
15095
|
-
className: (0,
|
|
15144
|
+
className: (0, import_utils20.cn)("space-y-8", className),
|
|
15096
15145
|
"data-slot": "checkout-form",
|
|
15097
15146
|
children: [
|
|
15098
|
-
/* @__PURE__ */ (0,
|
|
15099
|
-
/* @__PURE__ */ (0,
|
|
15100
|
-
/* @__PURE__ */ (0,
|
|
15101
|
-
/* @__PURE__ */ (0,
|
|
15102
|
-
/* @__PURE__ */ (0,
|
|
15103
|
-
/* @__PURE__ */ (0,
|
|
15147
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("section", { className: "space-y-4", children: [
|
|
15148
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
15149
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15150
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-1", children: [
|
|
15151
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
15152
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15104
15153
|
"input",
|
|
15105
15154
|
{
|
|
15106
15155
|
id: "checkout-form-name",
|
|
@@ -15109,17 +15158,17 @@ function CheckoutForm({
|
|
|
15109
15158
|
value: contact.name,
|
|
15110
15159
|
onChange: (e) => patchContact({ name: e.target.value }),
|
|
15111
15160
|
placeholder: t.namePlaceholder,
|
|
15112
|
-
className: (0,
|
|
15161
|
+
className: (0, import_utils20.cn)(
|
|
15113
15162
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15114
15163
|
contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
|
|
15115
15164
|
)
|
|
15116
15165
|
}
|
|
15117
15166
|
),
|
|
15118
|
-
contactErrors?.name && /* @__PURE__ */ (0,
|
|
15167
|
+
contactErrors?.name && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
15119
15168
|
] }),
|
|
15120
|
-
/* @__PURE__ */ (0,
|
|
15121
|
-
/* @__PURE__ */ (0,
|
|
15122
|
-
/* @__PURE__ */ (0,
|
|
15169
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-1", children: [
|
|
15170
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15171
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15123
15172
|
"input",
|
|
15124
15173
|
{
|
|
15125
15174
|
id: "checkout-form-email",
|
|
@@ -15128,15 +15177,15 @@ function CheckoutForm({
|
|
|
15128
15177
|
value: contact.email,
|
|
15129
15178
|
onChange: (e) => patchContact({ email: e.target.value }),
|
|
15130
15179
|
placeholder: t.emailPlaceholder,
|
|
15131
|
-
className: (0,
|
|
15180
|
+
className: (0, import_utils20.cn)(
|
|
15132
15181
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15133
15182
|
contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
|
|
15134
15183
|
)
|
|
15135
15184
|
}
|
|
15136
15185
|
),
|
|
15137
|
-
contactErrors?.email && /* @__PURE__ */ (0,
|
|
15186
|
+
contactErrors?.email && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.email })
|
|
15138
15187
|
] }),
|
|
15139
|
-
/* @__PURE__ */ (0,
|
|
15188
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15140
15189
|
import_phone_input.PhoneInput,
|
|
15141
15190
|
{
|
|
15142
15191
|
id: "checkout-form-phone",
|
|
@@ -15150,27 +15199,27 @@ function CheckoutForm({
|
|
|
15150
15199
|
] })
|
|
15151
15200
|
] }),
|
|
15152
15201
|
children2,
|
|
15153
|
-
generalError ? /* @__PURE__ */ (0,
|
|
15154
|
-
/* @__PURE__ */ (0,
|
|
15155
|
-
/* @__PURE__ */ (0,
|
|
15156
|
-
appliedDiscount ? /* @__PURE__ */ (0,
|
|
15157
|
-
/* @__PURE__ */ (0,
|
|
15158
|
-
/* @__PURE__ */ (0,
|
|
15159
|
-
/* @__PURE__ */ (0,
|
|
15202
|
+
generalError ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
15203
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("section", { className: "space-y-3", children: [
|
|
15204
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
15205
|
+
appliedDiscount ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("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: [
|
|
15206
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
15207
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
15208
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
15160
15209
|
] }),
|
|
15161
|
-
/* @__PURE__ */ (0,
|
|
15210
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15162
15211
|
"button",
|
|
15163
15212
|
{
|
|
15164
15213
|
type: "button",
|
|
15165
15214
|
onClick: onRemoveDiscount,
|
|
15166
15215
|
"aria-label": t.removeDiscount,
|
|
15167
|
-
className: "text-green-600 transition-colors hover:text-green-800 dark:text-green-400 dark:hover:text-green-200",
|
|
15216
|
+
className: "cursor-pointer text-green-600 transition-colors hover:text-green-800 dark:text-green-400 dark:hover:text-green-200",
|
|
15168
15217
|
children: t.removeDiscount
|
|
15169
15218
|
}
|
|
15170
15219
|
)
|
|
15171
|
-
] }) : /* @__PURE__ */ (0,
|
|
15172
|
-
/* @__PURE__ */ (0,
|
|
15173
|
-
/* @__PURE__ */ (0,
|
|
15220
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex gap-2", children: [
|
|
15221
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
15222
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15174
15223
|
"input",
|
|
15175
15224
|
{
|
|
15176
15225
|
id: "checkout-form-discount-code",
|
|
@@ -15182,26 +15231,26 @@ function CheckoutForm({
|
|
|
15182
15231
|
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"
|
|
15183
15232
|
}
|
|
15184
15233
|
),
|
|
15185
|
-
/* @__PURE__ */ (0,
|
|
15234
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15186
15235
|
"button",
|
|
15187
15236
|
{
|
|
15188
15237
|
type: "button",
|
|
15189
15238
|
onClick: onApplyDiscount,
|
|
15190
15239
|
disabled: !discountCode.trim() || discountApplying,
|
|
15191
|
-
className: "rounded-lg bg-muted px-4 py-2 text-sm font-medium text-foreground transition hover:bg-muted/70 disabled:cursor-not-allowed disabled:opacity-50",
|
|
15240
|
+
className: "cursor-pointer rounded-lg bg-muted px-4 py-2 text-sm font-medium text-foreground transition hover:bg-muted/70 disabled:cursor-not-allowed disabled:opacity-50",
|
|
15192
15241
|
children: discountApplying ? t.applyingDiscount : t.applyDiscount
|
|
15193
15242
|
}
|
|
15194
15243
|
)
|
|
15195
15244
|
] }),
|
|
15196
|
-
discountError && /* @__PURE__ */ (0,
|
|
15245
|
+
discountError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-destructive", children: discountError })
|
|
15197
15246
|
] }),
|
|
15198
|
-
/* @__PURE__ */ (0,
|
|
15247
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15199
15248
|
"button",
|
|
15200
15249
|
{
|
|
15201
15250
|
type: "submit",
|
|
15202
15251
|
disabled: submitting || submitDisabled,
|
|
15203
|
-
className: (0,
|
|
15204
|
-
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
15252
|
+
className: (0, import_utils20.cn)(
|
|
15253
|
+
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
15205
15254
|
submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15206
15255
|
),
|
|
15207
15256
|
children: submitting ? t.submitting : t.submit
|
|
@@ -15214,11 +15263,11 @@ function CheckoutForm({
|
|
|
15214
15263
|
}
|
|
15215
15264
|
|
|
15216
15265
|
// src/components/order-confirmation.tsx
|
|
15217
|
-
var
|
|
15266
|
+
var import_utils22 = require("@reblu/site-ui/utils");
|
|
15218
15267
|
|
|
15219
15268
|
// src/components/order-invoice-link.tsx
|
|
15220
|
-
var
|
|
15221
|
-
var
|
|
15269
|
+
var import_utils21 = require("@reblu/site-ui/utils");
|
|
15270
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
15222
15271
|
var DEFAULT_LABELS8 = {
|
|
15223
15272
|
linkLabel: "Descargar la factura {number}",
|
|
15224
15273
|
signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
@@ -15226,8 +15275,8 @@ var DEFAULT_LABELS8 = {
|
|
|
15226
15275
|
function OrderInvoiceLink({ invoice, labels, className }) {
|
|
15227
15276
|
if (!invoice) return null;
|
|
15228
15277
|
const t = { ...DEFAULT_LABELS8, ...labels };
|
|
15229
|
-
return /* @__PURE__ */ (0,
|
|
15230
|
-
/* @__PURE__ */ (0,
|
|
15278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: (0, import_utils21.cn)("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
|
|
15279
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15231
15280
|
"a",
|
|
15232
15281
|
{
|
|
15233
15282
|
href: invoice.url,
|
|
@@ -15235,12 +15284,12 @@ function OrderInvoiceLink({ invoice, labels, className }) {
|
|
|
15235
15284
|
children: t.linkLabel.replace("{number}", invoice.number)
|
|
15236
15285
|
}
|
|
15237
15286
|
),
|
|
15238
|
-
/* @__PURE__ */ (0,
|
|
15287
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-muted-foreground", children: t.signInHint })
|
|
15239
15288
|
] });
|
|
15240
15289
|
}
|
|
15241
15290
|
|
|
15242
15291
|
// src/components/order-confirmation.tsx
|
|
15243
|
-
var
|
|
15292
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
15244
15293
|
var DEFAULT_LABELS9 = {
|
|
15245
15294
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
15246
15295
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
@@ -15304,43 +15353,43 @@ function OrderConfirmation({
|
|
|
15304
15353
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
15305
15354
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
15306
15355
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
15307
|
-
return /* @__PURE__ */ (0,
|
|
15308
|
-
/* @__PURE__ */ (0,
|
|
15309
|
-
/* @__PURE__ */ (0,
|
|
15310
|
-
showFullOrderSummary && order && /* @__PURE__ */ (0,
|
|
15311
|
-
/* @__PURE__ */ (0,
|
|
15312
|
-
/* @__PURE__ */ (0,
|
|
15313
|
-
/* @__PURE__ */ (0,
|
|
15356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: (0, import_utils22.cn)("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
15357
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h1", { className: "text-3xl font-bold", children: title }),
|
|
15358
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
15359
|
+
showFullOrderSummary && order && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-6", children: [
|
|
15360
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15361
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
15362
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15314
15363
|
] }),
|
|
15315
|
-
/* @__PURE__ */ (0,
|
|
15316
|
-
order.items.map((item, idx) => /* @__PURE__ */ (0,
|
|
15364
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
15365
|
+
order.items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
15317
15366
|
"div",
|
|
15318
15367
|
{
|
|
15319
15368
|
className: "flex justify-between gap-4 text-sm",
|
|
15320
15369
|
children: [
|
|
15321
|
-
/* @__PURE__ */ (0,
|
|
15370
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
15322
15371
|
item.product.name,
|
|
15323
15372
|
item.variant ? ` (${item.variant.name})` : "",
|
|
15324
15373
|
" x",
|
|
15325
15374
|
item.quantity
|
|
15326
15375
|
] }),
|
|
15327
|
-
/* @__PURE__ */ (0,
|
|
15376
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
15328
15377
|
]
|
|
15329
15378
|
},
|
|
15330
15379
|
idx
|
|
15331
15380
|
)),
|
|
15332
|
-
/* @__PURE__ */ (0,
|
|
15333
|
-
/* @__PURE__ */ (0,
|
|
15334
|
-
/* @__PURE__ */ (0,
|
|
15381
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
15382
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: t.totalLabel }),
|
|
15383
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
15335
15384
|
] }) })
|
|
15336
15385
|
] }),
|
|
15337
|
-
/* @__PURE__ */ (0,
|
|
15386
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
15338
15387
|
t.confirmationEmailPrefix,
|
|
15339
15388
|
" ",
|
|
15340
|
-
/* @__PURE__ */ (0,
|
|
15389
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
15341
15390
|
"."
|
|
15342
15391
|
] }),
|
|
15343
|
-
/* @__PURE__ */ (0,
|
|
15392
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15344
15393
|
OrderInvoiceLink,
|
|
15345
15394
|
{
|
|
15346
15395
|
invoice: order.invoice,
|
|
@@ -15348,11 +15397,11 @@ function OrderConfirmation({
|
|
|
15348
15397
|
}
|
|
15349
15398
|
)
|
|
15350
15399
|
] }),
|
|
15351
|
-
showOrderReference && order && /* @__PURE__ */ (0,
|
|
15352
|
-
/* @__PURE__ */ (0,
|
|
15353
|
-
/* @__PURE__ */ (0,
|
|
15400
|
+
showOrderReference && order && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15401
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
15402
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15354
15403
|
] }),
|
|
15355
|
-
status === "failed" && cartHref && /* @__PURE__ */ (0,
|
|
15404
|
+
status === "failed" && cartHref && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15356
15405
|
"a",
|
|
15357
15406
|
{
|
|
15358
15407
|
href: cartHref,
|
|
@@ -15360,25 +15409,25 @@ function OrderConfirmation({
|
|
|
15360
15409
|
children: t.backToCartLabel
|
|
15361
15410
|
}
|
|
15362
15411
|
),
|
|
15363
|
-
showRecheck && /* @__PURE__ */ (0,
|
|
15412
|
+
showRecheck && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15364
15413
|
"button",
|
|
15365
15414
|
{
|
|
15366
15415
|
type: "button",
|
|
15367
15416
|
onClick: onRecheck,
|
|
15368
|
-
className: "inline-flex items-center justify-center rounded-xl bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-colors hover:bg-primary/90",
|
|
15417
|
+
className: "inline-flex cursor-pointer items-center justify-center rounded-xl bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-colors hover:bg-primary/90",
|
|
15369
15418
|
children: t.recheckLabel
|
|
15370
15419
|
}
|
|
15371
15420
|
),
|
|
15372
|
-
showSessionReference && /* @__PURE__ */ (0,
|
|
15373
|
-
/* @__PURE__ */ (0,
|
|
15374
|
-
/* @__PURE__ */ (0,
|
|
15421
|
+
showSessionReference && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15422
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
15423
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
15375
15424
|
] })
|
|
15376
15425
|
] });
|
|
15377
15426
|
}
|
|
15378
15427
|
|
|
15379
15428
|
// src/components/full-invoice-fields.tsx
|
|
15380
|
-
var
|
|
15381
|
-
var
|
|
15429
|
+
var import_utils23 = require("@reblu/site-ui/utils");
|
|
15430
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
15382
15431
|
var EMPTY_FULL_INVOICE_VALUE = {
|
|
15383
15432
|
wantsFullInvoice: false,
|
|
15384
15433
|
billingIdType: "NIF",
|
|
@@ -15495,12 +15544,12 @@ function FullInvoiceFields({
|
|
|
15495
15544
|
const showFields = value.wantsFullInvoice || overCap;
|
|
15496
15545
|
const isSpanishNif = value.billingIdType === "NIF";
|
|
15497
15546
|
const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
|
|
15498
|
-
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0,
|
|
15547
|
+
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
|
|
15499
15548
|
const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
|
|
15500
|
-
return /* @__PURE__ */ (0,
|
|
15501
|
-
overCap ? /* @__PURE__ */ (0,
|
|
15502
|
-
/* @__PURE__ */ (0,
|
|
15503
|
-
/* @__PURE__ */ (0,
|
|
15549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: (0, import_utils23.cn)("space-y-4", className), "data-slot": "full-invoice-fields", children: [
|
|
15550
|
+
overCap ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15551
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
15552
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15504
15553
|
"input",
|
|
15505
15554
|
{
|
|
15506
15555
|
type: "checkbox",
|
|
@@ -15510,12 +15559,12 @@ function FullInvoiceFields({
|
|
|
15510
15559
|
),
|
|
15511
15560
|
t.toggle
|
|
15512
15561
|
] }),
|
|
15513
|
-
/* @__PURE__ */ (0,
|
|
15562
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
|
|
15514
15563
|
] }),
|
|
15515
|
-
showFields && /* @__PURE__ */ (0,
|
|
15516
|
-
/* @__PURE__ */ (0,
|
|
15517
|
-
/* @__PURE__ */ (0,
|
|
15518
|
-
/* @__PURE__ */ (0,
|
|
15564
|
+
showFields && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15565
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15566
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
|
|
15567
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15519
15568
|
"select",
|
|
15520
15569
|
{
|
|
15521
15570
|
id: "full-invoice-id-type",
|
|
@@ -15524,14 +15573,14 @@ function FullInvoiceFields({
|
|
|
15524
15573
|
value: value.billingIdType,
|
|
15525
15574
|
onChange: (e) => set("billingIdType", e.target.value),
|
|
15526
15575
|
...invalid2("billingIdType"),
|
|
15527
|
-
children: ID_TYPES.map((type) => /* @__PURE__ */ (0,
|
|
15576
|
+
children: ID_TYPES.map((type) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: type, children: t.idTypeOptions[type] }, type))
|
|
15528
15577
|
}
|
|
15529
15578
|
),
|
|
15530
15579
|
error("billingIdType")
|
|
15531
15580
|
] }),
|
|
15532
|
-
!isSpanishNif && /* @__PURE__ */ (0,
|
|
15533
|
-
/* @__PURE__ */ (0,
|
|
15534
|
-
/* @__PURE__ */ (0,
|
|
15581
|
+
!isSpanishNif && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15582
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
|
|
15583
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
15535
15584
|
"select",
|
|
15536
15585
|
{
|
|
15537
15586
|
id: "full-invoice-id-country",
|
|
@@ -15541,16 +15590,16 @@ function FullInvoiceFields({
|
|
|
15541
15590
|
onChange: (e) => set("billingIdCountry", e.target.value),
|
|
15542
15591
|
...invalid2("billingIdCountry"),
|
|
15543
15592
|
children: [
|
|
15544
|
-
/* @__PURE__ */ (0,
|
|
15545
|
-
countries.map((c) => /* @__PURE__ */ (0,
|
|
15593
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", disabled: true, children: t.chooseCountry }),
|
|
15594
|
+
countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
15546
15595
|
]
|
|
15547
15596
|
}
|
|
15548
15597
|
),
|
|
15549
15598
|
error("billingIdCountry")
|
|
15550
15599
|
] }),
|
|
15551
|
-
/* @__PURE__ */ (0,
|
|
15552
|
-
/* @__PURE__ */ (0,
|
|
15553
|
-
/* @__PURE__ */ (0,
|
|
15600
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15601
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
|
|
15602
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15554
15603
|
"input",
|
|
15555
15604
|
{
|
|
15556
15605
|
id: "full-invoice-nif",
|
|
@@ -15563,9 +15612,9 @@ function FullInvoiceFields({
|
|
|
15563
15612
|
),
|
|
15564
15613
|
error("billingNif")
|
|
15565
15614
|
] }),
|
|
15566
|
-
/* @__PURE__ */ (0,
|
|
15567
|
-
/* @__PURE__ */ (0,
|
|
15568
|
-
/* @__PURE__ */ (0,
|
|
15615
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15616
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
|
|
15617
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15569
15618
|
"input",
|
|
15570
15619
|
{
|
|
15571
15620
|
id: "full-invoice-name",
|
|
@@ -15578,9 +15627,9 @@ function FullInvoiceFields({
|
|
|
15578
15627
|
),
|
|
15579
15628
|
error("billingName")
|
|
15580
15629
|
] }),
|
|
15581
|
-
/* @__PURE__ */ (0,
|
|
15582
|
-
/* @__PURE__ */ (0,
|
|
15583
|
-
/* @__PURE__ */ (0,
|
|
15630
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1 sm:col-span-2", children: [
|
|
15631
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
|
|
15632
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15584
15633
|
"input",
|
|
15585
15634
|
{
|
|
15586
15635
|
id: "full-invoice-street",
|
|
@@ -15592,9 +15641,9 @@ function FullInvoiceFields({
|
|
|
15592
15641
|
}
|
|
15593
15642
|
)
|
|
15594
15643
|
] }),
|
|
15595
|
-
/* @__PURE__ */ (0,
|
|
15596
|
-
/* @__PURE__ */ (0,
|
|
15597
|
-
/* @__PURE__ */ (0,
|
|
15644
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15645
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
|
|
15646
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15598
15647
|
"input",
|
|
15599
15648
|
{
|
|
15600
15649
|
id: "full-invoice-postal-code",
|
|
@@ -15605,9 +15654,9 @@ function FullInvoiceFields({
|
|
|
15605
15654
|
}
|
|
15606
15655
|
)
|
|
15607
15656
|
] }),
|
|
15608
|
-
/* @__PURE__ */ (0,
|
|
15609
|
-
/* @__PURE__ */ (0,
|
|
15610
|
-
/* @__PURE__ */ (0,
|
|
15657
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15658
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
|
|
15659
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15611
15660
|
"input",
|
|
15612
15661
|
{
|
|
15613
15662
|
id: "full-invoice-city",
|
|
@@ -15618,9 +15667,9 @@ function FullInvoiceFields({
|
|
|
15618
15667
|
}
|
|
15619
15668
|
)
|
|
15620
15669
|
] }),
|
|
15621
|
-
/* @__PURE__ */ (0,
|
|
15622
|
-
/* @__PURE__ */ (0,
|
|
15623
|
-
/* @__PURE__ */ (0,
|
|
15670
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15671
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
|
|
15672
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15624
15673
|
"select",
|
|
15625
15674
|
{
|
|
15626
15675
|
id: "full-invoice-country",
|
|
@@ -15628,11 +15677,11 @@ function FullInvoiceFields({
|
|
|
15628
15677
|
required: true,
|
|
15629
15678
|
value: value.country,
|
|
15630
15679
|
onChange: (e) => set("country", e.target.value),
|
|
15631
|
-
children: countries.map((c) => /* @__PURE__ */ (0,
|
|
15680
|
+
children: countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
15632
15681
|
}
|
|
15633
15682
|
)
|
|
15634
15683
|
] }),
|
|
15635
|
-
/* @__PURE__ */ (0,
|
|
15684
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "sm:col-span-2", children: error("address") })
|
|
15636
15685
|
] })
|
|
15637
15686
|
] });
|
|
15638
15687
|
}
|
|
@@ -15668,6 +15717,7 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
15668
15717
|
ParentPage,
|
|
15669
15718
|
ProductCard,
|
|
15670
15719
|
ProductTrustItems,
|
|
15720
|
+
ProfessionalFields,
|
|
15671
15721
|
ProfileCard,
|
|
15672
15722
|
SafeHtml,
|
|
15673
15723
|
ShopFilters,
|