@bison-lab/ui 1.10.0 → 1.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/dist/index.d.mts +184 -57
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +348 -136
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2347,6 +2347,74 @@ function Badge({ className, variant, ...props }) {
|
|
|
2347
2347
|
});
|
|
2348
2348
|
}
|
|
2349
2349
|
//#endregion
|
|
2350
|
+
//#region src/components/rotating-badge.tsx
|
|
2351
|
+
const DEFAULT_SIZE = 160;
|
|
2352
|
+
const DEFAULT_DURATION = 26;
|
|
2353
|
+
const REPEAT_COUNT = 4;
|
|
2354
|
+
const DEFAULT_DIVIDER = "•";
|
|
2355
|
+
const VIEWBOX = 200;
|
|
2356
|
+
function ringChars(text, divider) {
|
|
2357
|
+
return Array.from(`${text} ${divider} `.repeat(REPEAT_COUNT));
|
|
2358
|
+
}
|
|
2359
|
+
function renderChar(char) {
|
|
2360
|
+
return char === " " ? "\xA0" : char;
|
|
2361
|
+
}
|
|
2362
|
+
/**
|
|
2363
|
+
* A circular seal: a consumer-supplied center mark with rim copy on a slow
|
|
2364
|
+
* continuous spin (paused for `prefers-reduced-motion`). Purely presentational.
|
|
2365
|
+
*/
|
|
2366
|
+
const RotatingBadge = React.forwardRef(({ text, image, divider = DEFAULT_DIVIDER, size = DEFAULT_SIZE, duration = DEFAULT_DURATION, className, imageClassName, rule = false, ruleClassName, style, ...props }, ref) => {
|
|
2367
|
+
const chars = React.useMemo(() => ringChars(text, divider), [text, divider]);
|
|
2368
|
+
const step = 360 / chars.length;
|
|
2369
|
+
const clearRadius = size / 2 + 60;
|
|
2370
|
+
const fadeWidth = 20;
|
|
2371
|
+
const maskImage = `linear-gradient(to right, black 0, black calc(50% - ${clearRadius}px), transparent calc(50% - ${clearRadius - fadeWidth}px), transparent calc(50% + ${clearRadius - fadeWidth}px), black calc(50% + ${clearRadius}px), black 100%)`;
|
|
2372
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2373
|
+
ref,
|
|
2374
|
+
className: cn("relative flex shrink-0 items-center justify-center rounded-full font-bold", className),
|
|
2375
|
+
style: {
|
|
2376
|
+
width: size,
|
|
2377
|
+
height: size,
|
|
2378
|
+
...style
|
|
2379
|
+
},
|
|
2380
|
+
...props,
|
|
2381
|
+
children: [
|
|
2382
|
+
rule ? /* @__PURE__ */ jsx("div", {
|
|
2383
|
+
"aria-hidden": true,
|
|
2384
|
+
className: cn("pointer-events-none absolute top-1/2 left-1/2 h-px w-screen -translate-x-1/2 -translate-y-1/2 bg-border opacity-80", ruleClassName),
|
|
2385
|
+
style: {
|
|
2386
|
+
maskImage,
|
|
2387
|
+
WebkitMaskImage: maskImage
|
|
2388
|
+
}
|
|
2389
|
+
}) : null,
|
|
2390
|
+
/* @__PURE__ */ jsx("svg", {
|
|
2391
|
+
viewBox: `0 0 ${VIEWBOX} ${VIEWBOX}`,
|
|
2392
|
+
"aria-hidden": true,
|
|
2393
|
+
className: "absolute inset-0 size-full origin-center animate-spin fill-current motion-reduce:animate-none [font-family:inherit] [font-weight:inherit]",
|
|
2394
|
+
style: {
|
|
2395
|
+
animationDuration: `${duration}s`,
|
|
2396
|
+
animationTimingFunction: "linear"
|
|
2397
|
+
},
|
|
2398
|
+
children: chars.map((char, i) => /* @__PURE__ */ jsx("text", {
|
|
2399
|
+
x: VIEWBOX / 2,
|
|
2400
|
+
y: 18,
|
|
2401
|
+
textAnchor: "middle",
|
|
2402
|
+
fontSize: 14,
|
|
2403
|
+
fill: "currentColor",
|
|
2404
|
+
transform: `rotate(${-90 + i * step} ${VIEWBOX / 2} ${VIEWBOX / 2})`,
|
|
2405
|
+
children: renderChar(char)
|
|
2406
|
+
}, i))
|
|
2407
|
+
}),
|
|
2408
|
+
/* @__PURE__ */ jsx("div", {
|
|
2409
|
+
className: cn("relative z-10 flex items-center justify-center [&_img]:block [&_img]:h-auto [&_img]:w-full [&_svg]:h-auto [&_svg]:w-full", imageClassName),
|
|
2410
|
+
style: { width: size * .34 },
|
|
2411
|
+
children: image
|
|
2412
|
+
})
|
|
2413
|
+
]
|
|
2414
|
+
});
|
|
2415
|
+
});
|
|
2416
|
+
RotatingBadge.displayName = "RotatingBadge";
|
|
2417
|
+
//#endregion
|
|
2350
2418
|
//#region src/components/avatar.tsx
|
|
2351
2419
|
const avatarVariants = cva("relative flex h-10 w-10 shrink-0", {
|
|
2352
2420
|
variants: { shape: {
|
|
@@ -5995,141 +6063,6 @@ const MediaCard = React.forwardRef(({ image, fallbackIcon, badge, title, descrip
|
|
|
5995
6063
|
});
|
|
5996
6064
|
MediaCard.displayName = "MediaCard";
|
|
5997
6065
|
//#endregion
|
|
5998
|
-
//#region src/blocks/data-display/reviews-block.tsx
|
|
5999
|
-
function initials(name) {
|
|
6000
|
-
return name.split(" ").map((n) => n[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
6001
|
-
}
|
|
6002
|
-
const SKELETON_CARDS = 4;
|
|
6003
|
-
const ReviewsBlock = React.forwardRef(({ reviews, averageRating, totalReviews, title = "Customer Reviews", distribution, badgeVariant = "secondary", ratingClassName, loading, error, className, ...props }, ref) => {
|
|
6004
|
-
const displayRating = Math.round(averageRating * 10) / 10;
|
|
6005
|
-
return /* @__PURE__ */ jsx("section", {
|
|
6006
|
-
ref,
|
|
6007
|
-
className: cn("py-16 md:py-24", className),
|
|
6008
|
-
...props,
|
|
6009
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
6010
|
-
className: "mx-auto max-w-5xl px-4 sm:px-6",
|
|
6011
|
-
children: [/* @__PURE__ */ jsx("h2", {
|
|
6012
|
-
className: "mb-8 text-2xl font-semibold tracking-tight md:text-3xl",
|
|
6013
|
-
children: title
|
|
6014
|
-
}), error ? /* @__PURE__ */ jsx("p", {
|
|
6015
|
-
className: "text-sm text-muted-foreground",
|
|
6016
|
-
children: error
|
|
6017
|
-
}) : /* @__PURE__ */ jsxs("div", {
|
|
6018
|
-
className: "grid gap-8 lg:grid-cols-[280px_1fr] lg:gap-12",
|
|
6019
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
6020
|
-
className: "space-y-6",
|
|
6021
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
6022
|
-
className: "text-center lg:text-left",
|
|
6023
|
-
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6024
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "mx-auto h-12 w-20 lg:mx-0" }),
|
|
6025
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "mx-auto mt-2 h-5 w-28 lg:mx-0" }),
|
|
6026
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "mx-auto mt-1 h-4 w-36 lg:mx-0" })
|
|
6027
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6028
|
-
/* @__PURE__ */ jsx("div", {
|
|
6029
|
-
className: "text-5xl font-bold",
|
|
6030
|
-
children: displayRating.toFixed(1)
|
|
6031
|
-
}),
|
|
6032
|
-
/* @__PURE__ */ jsx(Rating, {
|
|
6033
|
-
rate: displayRating,
|
|
6034
|
-
size: "lg",
|
|
6035
|
-
className: cn("mt-2 justify-center lg:justify-start", ratingClassName)
|
|
6036
|
-
}),
|
|
6037
|
-
/* @__PURE__ */ jsxs("p", {
|
|
6038
|
-
className: "mt-1 text-sm text-muted-foreground",
|
|
6039
|
-
children: [
|
|
6040
|
-
"Based on ",
|
|
6041
|
-
totalReviews.toLocaleString(),
|
|
6042
|
-
" reviews"
|
|
6043
|
-
]
|
|
6044
|
-
})
|
|
6045
|
-
] })
|
|
6046
|
-
}), !loading && distribution && distribution.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
6047
|
-
className: "space-y-2",
|
|
6048
|
-
children: [...distribution].sort((a, b) => b.star - a.star).map(({ star, count }) => /* @__PURE__ */ jsxs("div", {
|
|
6049
|
-
className: "flex items-center gap-3",
|
|
6050
|
-
children: [
|
|
6051
|
-
/* @__PURE__ */ jsxs("span", {
|
|
6052
|
-
className: "w-8 text-sm text-muted-foreground",
|
|
6053
|
-
children: [star, " ★"]
|
|
6054
|
-
}),
|
|
6055
|
-
/* @__PURE__ */ jsx(Progress, {
|
|
6056
|
-
value: totalReviews > 0 ? count / totalReviews * 100 : 0,
|
|
6057
|
-
className: "h-2 flex-1"
|
|
6058
|
-
}),
|
|
6059
|
-
/* @__PURE__ */ jsx("span", {
|
|
6060
|
-
className: "w-8 text-right text-sm text-muted-foreground",
|
|
6061
|
-
children: count
|
|
6062
|
-
})
|
|
6063
|
-
]
|
|
6064
|
-
}, star))
|
|
6065
|
-
})]
|
|
6066
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
6067
|
-
className: "grid gap-4 sm:grid-cols-2",
|
|
6068
|
-
children: loading ? Array.from({ length: SKELETON_CARDS }).map((_, i) => /* @__PURE__ */ jsx(Card, {
|
|
6069
|
-
className: "gap-0 p-0 shadow-none",
|
|
6070
|
-
children: /* @__PURE__ */ jsxs(CardContent, {
|
|
6071
|
-
className: "space-y-3 p-5",
|
|
6072
|
-
children: [
|
|
6073
|
-
/* @__PURE__ */ jsxs("div", {
|
|
6074
|
-
className: "flex items-center gap-2.5",
|
|
6075
|
-
children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-9 rounded-full" }), /* @__PURE__ */ jsxs("div", {
|
|
6076
|
-
className: "space-y-1.5",
|
|
6077
|
-
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-16" })]
|
|
6078
|
-
})]
|
|
6079
|
-
}),
|
|
6080
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }),
|
|
6081
|
-
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4/5" })
|
|
6082
|
-
]
|
|
6083
|
-
})
|
|
6084
|
-
}, i)) : reviews.map((review) => /* @__PURE__ */ jsx(Card, {
|
|
6085
|
-
className: "gap-0 p-0 shadow-none",
|
|
6086
|
-
children: /* @__PURE__ */ jsxs(CardContent, {
|
|
6087
|
-
className: "space-y-3 p-5",
|
|
6088
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
6089
|
-
className: "flex items-start justify-between gap-2",
|
|
6090
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
6091
|
-
className: "flex items-center gap-2.5",
|
|
6092
|
-
children: [/* @__PURE__ */ jsxs(Avatar, {
|
|
6093
|
-
className: "size-9",
|
|
6094
|
-
children: [review.author.avatarUrl && /* @__PURE__ */ jsx(AvatarImage, {
|
|
6095
|
-
src: review.author.avatarUrl,
|
|
6096
|
-
alt: review.author.name
|
|
6097
|
-
}), /* @__PURE__ */ jsx(AvatarFallback, {
|
|
6098
|
-
className: "text-xs",
|
|
6099
|
-
children: initials(review.author.name)
|
|
6100
|
-
})]
|
|
6101
|
-
}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
6102
|
-
className: "flex items-center gap-1.5",
|
|
6103
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
6104
|
-
className: "text-sm font-medium",
|
|
6105
|
-
children: review.author.name
|
|
6106
|
-
}), review.badgeLabel && /* @__PURE__ */ jsx(Badge, {
|
|
6107
|
-
variant: badgeVariant,
|
|
6108
|
-
className: "h-5 px-1.5 text-[0.625rem]",
|
|
6109
|
-
children: review.badgeLabel
|
|
6110
|
-
})]
|
|
6111
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
6112
|
-
className: "text-xs text-muted-foreground",
|
|
6113
|
-
children: review.date
|
|
6114
|
-
})] })]
|
|
6115
|
-
}), /* @__PURE__ */ jsx(Rating, {
|
|
6116
|
-
rate: review.rating,
|
|
6117
|
-
size: "sm",
|
|
6118
|
-
className: ratingClassName
|
|
6119
|
-
})]
|
|
6120
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
6121
|
-
className: "line-clamp-4 text-sm leading-relaxed text-muted-foreground",
|
|
6122
|
-
children: review.content
|
|
6123
|
-
})]
|
|
6124
|
-
})
|
|
6125
|
-
}, review.id))
|
|
6126
|
-
})]
|
|
6127
|
-
})]
|
|
6128
|
-
})
|
|
6129
|
-
});
|
|
6130
|
-
});
|
|
6131
|
-
ReviewsBlock.displayName = "ReviewsBlock";
|
|
6132
|
-
//#endregion
|
|
6133
6066
|
//#region src/blocks/marketing/json-ld.tsx
|
|
6134
6067
|
/**
|
|
6135
6068
|
* Maps a `NapRecord` — the same object rendered by `NapBlock` — onto
|
|
@@ -6875,6 +6808,285 @@ const FAQColumnsBlock = React.forwardRef(({ items, title, description, eyebrow,
|
|
|
6875
6808
|
});
|
|
6876
6809
|
FAQColumnsBlock.displayName = "FAQColumnsBlock";
|
|
6877
6810
|
//#endregion
|
|
6811
|
+
//#region src/blocks/marketing/reviews-block.tsx
|
|
6812
|
+
function initials$1(name) {
|
|
6813
|
+
return name.split(" ").map((n) => n[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
6814
|
+
}
|
|
6815
|
+
const SKELETON_CARDS = 4;
|
|
6816
|
+
const ReviewsBlock = React.forwardRef(({ reviews, averageRating, totalReviews, title = "Customer Reviews", distribution, badgeVariant = "secondary", ratingClassName, loading, error, className, ...props }, ref) => {
|
|
6817
|
+
const displayRating = Math.round(averageRating * 10) / 10;
|
|
6818
|
+
return /* @__PURE__ */ jsx("section", {
|
|
6819
|
+
ref,
|
|
6820
|
+
className: cn("py-16 md:py-24", className),
|
|
6821
|
+
...props,
|
|
6822
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
6823
|
+
className: "mx-auto max-w-5xl px-4 sm:px-6",
|
|
6824
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
6825
|
+
className: "mb-8 text-2xl font-semibold tracking-tight md:text-3xl",
|
|
6826
|
+
children: title
|
|
6827
|
+
}), error ? /* @__PURE__ */ jsx("p", {
|
|
6828
|
+
className: "text-sm text-muted-foreground",
|
|
6829
|
+
children: error
|
|
6830
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
6831
|
+
className: "grid gap-8 lg:grid-cols-[280px_1fr] lg:gap-12",
|
|
6832
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6833
|
+
className: "space-y-6",
|
|
6834
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
6835
|
+
className: "text-center lg:text-left",
|
|
6836
|
+
children: loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6837
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "mx-auto h-12 w-20 lg:mx-0" }),
|
|
6838
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "mx-auto mt-2 h-5 w-28 lg:mx-0" }),
|
|
6839
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "mx-auto mt-1 h-4 w-36 lg:mx-0" })
|
|
6840
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6841
|
+
/* @__PURE__ */ jsx("div", {
|
|
6842
|
+
className: "text-5xl font-bold",
|
|
6843
|
+
children: displayRating.toFixed(1)
|
|
6844
|
+
}),
|
|
6845
|
+
/* @__PURE__ */ jsx(Rating, {
|
|
6846
|
+
rate: displayRating,
|
|
6847
|
+
size: "lg",
|
|
6848
|
+
className: cn("mt-2 justify-center lg:justify-start", ratingClassName)
|
|
6849
|
+
}),
|
|
6850
|
+
/* @__PURE__ */ jsxs("p", {
|
|
6851
|
+
className: "mt-1 text-sm text-muted-foreground",
|
|
6852
|
+
children: [
|
|
6853
|
+
"Based on ",
|
|
6854
|
+
totalReviews.toLocaleString(),
|
|
6855
|
+
" reviews"
|
|
6856
|
+
]
|
|
6857
|
+
})
|
|
6858
|
+
] })
|
|
6859
|
+
}), !loading && distribution && distribution.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
6860
|
+
className: "space-y-2",
|
|
6861
|
+
children: [...distribution].sort((a, b) => b.star - a.star).map(({ star, count }) => /* @__PURE__ */ jsxs("div", {
|
|
6862
|
+
className: "flex items-center gap-3",
|
|
6863
|
+
children: [
|
|
6864
|
+
/* @__PURE__ */ jsxs("span", {
|
|
6865
|
+
className: "w-8 text-sm text-muted-foreground",
|
|
6866
|
+
children: [star, " ★"]
|
|
6867
|
+
}),
|
|
6868
|
+
/* @__PURE__ */ jsx(Progress, {
|
|
6869
|
+
value: totalReviews > 0 ? count / totalReviews * 100 : 0,
|
|
6870
|
+
className: "h-2 flex-1"
|
|
6871
|
+
}),
|
|
6872
|
+
/* @__PURE__ */ jsx("span", {
|
|
6873
|
+
className: "w-8 text-right text-sm text-muted-foreground",
|
|
6874
|
+
children: count
|
|
6875
|
+
})
|
|
6876
|
+
]
|
|
6877
|
+
}, star))
|
|
6878
|
+
})]
|
|
6879
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
6880
|
+
className: "grid gap-4 sm:grid-cols-2",
|
|
6881
|
+
children: loading ? Array.from({ length: SKELETON_CARDS }).map((_, i) => /* @__PURE__ */ jsx(Card, {
|
|
6882
|
+
className: "gap-0 p-0 shadow-none",
|
|
6883
|
+
children: /* @__PURE__ */ jsxs(CardContent, {
|
|
6884
|
+
className: "space-y-3 p-5",
|
|
6885
|
+
children: [
|
|
6886
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6887
|
+
className: "flex items-center gap-2.5",
|
|
6888
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-9 rounded-full" }), /* @__PURE__ */ jsxs("div", {
|
|
6889
|
+
className: "space-y-1.5",
|
|
6890
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-16" })]
|
|
6891
|
+
})]
|
|
6892
|
+
}),
|
|
6893
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }),
|
|
6894
|
+
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-4/5" })
|
|
6895
|
+
]
|
|
6896
|
+
})
|
|
6897
|
+
}, i)) : reviews.map((review) => /* @__PURE__ */ jsx(Card, {
|
|
6898
|
+
className: "gap-0 p-0 shadow-none",
|
|
6899
|
+
children: /* @__PURE__ */ jsxs(CardContent, {
|
|
6900
|
+
className: "space-y-3 p-5",
|
|
6901
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6902
|
+
className: "flex items-start justify-between gap-2",
|
|
6903
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
6904
|
+
className: "flex items-center gap-2.5",
|
|
6905
|
+
children: [/* @__PURE__ */ jsxs(Avatar, {
|
|
6906
|
+
className: "size-9",
|
|
6907
|
+
children: [review.author.avatarUrl && /* @__PURE__ */ jsx(AvatarImage, {
|
|
6908
|
+
src: review.author.avatarUrl,
|
|
6909
|
+
alt: review.author.name
|
|
6910
|
+
}), /* @__PURE__ */ jsx(AvatarFallback, {
|
|
6911
|
+
className: "text-xs",
|
|
6912
|
+
children: initials$1(review.author.name)
|
|
6913
|
+
})]
|
|
6914
|
+
}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
6915
|
+
className: "flex items-center gap-1.5",
|
|
6916
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6917
|
+
className: "text-sm font-medium",
|
|
6918
|
+
children: review.author.name
|
|
6919
|
+
}), review.badgeLabel && /* @__PURE__ */ jsx(Badge, {
|
|
6920
|
+
variant: badgeVariant,
|
|
6921
|
+
className: "h-5 px-1.5 text-[0.625rem]",
|
|
6922
|
+
children: review.badgeLabel
|
|
6923
|
+
})]
|
|
6924
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
6925
|
+
className: "text-xs text-muted-foreground",
|
|
6926
|
+
children: review.date
|
|
6927
|
+
})] })]
|
|
6928
|
+
}), /* @__PURE__ */ jsx(Rating, {
|
|
6929
|
+
rate: review.rating,
|
|
6930
|
+
size: "sm",
|
|
6931
|
+
className: ratingClassName
|
|
6932
|
+
})]
|
|
6933
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
6934
|
+
className: "line-clamp-4 text-sm leading-relaxed text-muted-foreground",
|
|
6935
|
+
children: review.content
|
|
6936
|
+
})]
|
|
6937
|
+
})
|
|
6938
|
+
}, review.id))
|
|
6939
|
+
})]
|
|
6940
|
+
})]
|
|
6941
|
+
})
|
|
6942
|
+
});
|
|
6943
|
+
});
|
|
6944
|
+
ReviewsBlock.displayName = "ReviewsBlock";
|
|
6945
|
+
//#endregion
|
|
6946
|
+
//#region src/blocks/marketing/testimonial-masonry-block.tsx
|
|
6947
|
+
function initials(name) {
|
|
6948
|
+
return name.split(" ").map((part) => part[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
6949
|
+
}
|
|
6950
|
+
function groupCardsByRow(cards) {
|
|
6951
|
+
const rows = /* @__PURE__ */ new Map();
|
|
6952
|
+
for (const card of cards) {
|
|
6953
|
+
const top = Math.round(card.getBoundingClientRect().top);
|
|
6954
|
+
const row = rows.get(top) ?? [];
|
|
6955
|
+
row.push(card);
|
|
6956
|
+
rows.set(top, row);
|
|
6957
|
+
}
|
|
6958
|
+
return rows;
|
|
6959
|
+
}
|
|
6960
|
+
function measureClampHeight(cards, gridTop, maxVisibleRows) {
|
|
6961
|
+
const rows = groupCardsByRow(cards);
|
|
6962
|
+
const visibleTops = [...rows.keys()].sort((a, b) => a - b).slice(0, maxVisibleRows);
|
|
6963
|
+
let bottom = gridTop;
|
|
6964
|
+
for (const top of visibleTops) for (const card of rows.get(top) ?? []) bottom = Math.max(bottom, card.getBoundingClientRect().bottom);
|
|
6965
|
+
return bottom - gridTop;
|
|
6966
|
+
}
|
|
6967
|
+
const TestimonialMasonry = React.forwardRef(({ items, title, description, eyebrow, link, minItemsForFade = 7, minItemsForClamp = 10, maxVisibleRows = 2, containerClassName, eyebrowClassName, titleClassName, descriptionClassName, gridWrapperClassName, gridClassName, cardClassName, contentClassName, authorNameClassName, authorTitleClassName, avatarClassName, fadeClassName, linkClassName, className, ...props }, ref) => {
|
|
6968
|
+
const headingId = React.useId();
|
|
6969
|
+
const gridRef = React.useRef(null);
|
|
6970
|
+
const [clampHeight, setClampHeight] = React.useState();
|
|
6971
|
+
const showFade = items.length >= minItemsForFade;
|
|
6972
|
+
React.useLayoutEffect(() => {
|
|
6973
|
+
const grid = gridRef.current;
|
|
6974
|
+
if (!grid) return;
|
|
6975
|
+
const measure = () => {
|
|
6976
|
+
if (items.length < minItemsForClamp) {
|
|
6977
|
+
setClampHeight(void 0);
|
|
6978
|
+
return;
|
|
6979
|
+
}
|
|
6980
|
+
const cards = Array.from(grid.querySelectorAll("[data-testimonial-card]"));
|
|
6981
|
+
if (cards.length === 0) {
|
|
6982
|
+
setClampHeight(void 0);
|
|
6983
|
+
return;
|
|
6984
|
+
}
|
|
6985
|
+
const gridTop = grid.getBoundingClientRect().top;
|
|
6986
|
+
setClampHeight(measureClampHeight(cards, gridTop, maxVisibleRows));
|
|
6987
|
+
};
|
|
6988
|
+
measure();
|
|
6989
|
+
const observer = new ResizeObserver(measure);
|
|
6990
|
+
observer.observe(grid);
|
|
6991
|
+
window.addEventListener("resize", measure);
|
|
6992
|
+
return () => {
|
|
6993
|
+
observer.disconnect();
|
|
6994
|
+
window.removeEventListener("resize", measure);
|
|
6995
|
+
};
|
|
6996
|
+
}, [
|
|
6997
|
+
items,
|
|
6998
|
+
maxVisibleRows,
|
|
6999
|
+
minItemsForClamp
|
|
7000
|
+
]);
|
|
7001
|
+
return /* @__PURE__ */ jsx("section", {
|
|
7002
|
+
ref,
|
|
7003
|
+
"aria-labelledby": props["aria-label"] ? void 0 : headingId,
|
|
7004
|
+
className: cn("bg-accent px-6 lg:px-0", className),
|
|
7005
|
+
...props,
|
|
7006
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
7007
|
+
className: cn("mx-auto max-w-6xl px-0 py-16 sm:py-20 md:px-6 md:py-28", containerClassName),
|
|
7008
|
+
children: [
|
|
7009
|
+
eyebrow != null ? typeof eyebrow === "string" ? /* @__PURE__ */ jsx("p", {
|
|
7010
|
+
className: cn("mb-4 text-center text-sm font-normal leading-tight text-muted-foreground sm:text-base", eyebrowClassName),
|
|
7011
|
+
children: eyebrow
|
|
7012
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
7013
|
+
className: cn("mb-4 text-center", eyebrowClassName),
|
|
7014
|
+
children: eyebrow
|
|
7015
|
+
}) : null,
|
|
7016
|
+
/* @__PURE__ */ jsx("h2", {
|
|
7017
|
+
id: headingId,
|
|
7018
|
+
className: cn("mx-auto max-w-4xl text-balance text-center text-3xl font-medium leading-tight tracking-tight sm:text-4xl md:text-5xl", titleClassName),
|
|
7019
|
+
children: title
|
|
7020
|
+
}),
|
|
7021
|
+
description ? /* @__PURE__ */ jsx("p", {
|
|
7022
|
+
className: cn("mx-auto mt-4 max-w-2xl text-center text-base font-normal text-muted-foreground sm:text-lg", descriptionClassName),
|
|
7023
|
+
children: description
|
|
7024
|
+
}) : null,
|
|
7025
|
+
/* @__PURE__ */ jsxs("div", {
|
|
7026
|
+
className: cn("relative mt-10 md:mt-14", gridWrapperClassName),
|
|
7027
|
+
style: clampHeight != null ? {
|
|
7028
|
+
maxHeight: clampHeight,
|
|
7029
|
+
overflow: "hidden"
|
|
7030
|
+
} : void 0,
|
|
7031
|
+
children: [showFade ? /* @__PURE__ */ jsx("div", {
|
|
7032
|
+
"aria-hidden": true,
|
|
7033
|
+
className: cn("pointer-events-none absolute inset-x-0 bottom-0 z-10 h-24 bg-gradient-to-t from-accent to-accent/0", fadeClassName)
|
|
7034
|
+
}) : null, /* @__PURE__ */ jsx("ul", {
|
|
7035
|
+
ref: gridRef,
|
|
7036
|
+
className: cn("flex flex-wrap justify-center gap-4", gridClassName),
|
|
7037
|
+
children: items.map((item) => /* @__PURE__ */ jsxs("li", {
|
|
7038
|
+
"data-testimonial-card": true,
|
|
7039
|
+
className: cn("flex w-full flex-col justify-between rounded-2xl bg-card p-6", "sm:w-[calc((100%-1rem)/2)]", "lg:w-[calc((100%-2rem)/3)]", cardClassName),
|
|
7040
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
7041
|
+
className: cn("text-base font-normal leading-relaxed", contentClassName),
|
|
7042
|
+
children: item.content
|
|
7043
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
7044
|
+
className: "mt-6 flex items-center gap-3",
|
|
7045
|
+
children: [/* @__PURE__ */ jsx(Avatar, {
|
|
7046
|
+
className: cn("size-9", avatarClassName),
|
|
7047
|
+
children: item.author.avatar ? /* @__PURE__ */ jsx(AvatarFallback, {
|
|
7048
|
+
className: "text-xs",
|
|
7049
|
+
children: item.author.avatar
|
|
7050
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [item.author.avatarUrl ? /* @__PURE__ */ jsx(AvatarImage, {
|
|
7051
|
+
src: item.author.avatarUrl,
|
|
7052
|
+
alt: item.author.name
|
|
7053
|
+
}) : null, /* @__PURE__ */ jsx(AvatarFallback, {
|
|
7054
|
+
className: "text-xs",
|
|
7055
|
+
children: initials(item.author.name)
|
|
7056
|
+
})] })
|
|
7057
|
+
}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
|
|
7058
|
+
className: cn("mb-0.5 text-base font-medium leading-tight", authorNameClassName),
|
|
7059
|
+
children: item.author.name
|
|
7060
|
+
}), item.author.title ? /* @__PURE__ */ jsx("div", {
|
|
7061
|
+
className: cn("text-sm font-normal text-muted-foreground", authorTitleClassName),
|
|
7062
|
+
children: item.author.title
|
|
7063
|
+
}) : null] })]
|
|
7064
|
+
})]
|
|
7065
|
+
}, item.id))
|
|
7066
|
+
})]
|
|
7067
|
+
}),
|
|
7068
|
+
showFade && link ? /* @__PURE__ */ jsx("div", {
|
|
7069
|
+
className: cn("relative z-20 -mt-6 flex justify-center transition-all duration-300", linkClassName),
|
|
7070
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
7071
|
+
asChild: true,
|
|
7072
|
+
variant: link.variant ?? "default",
|
|
7073
|
+
size: link.size ?? "lg",
|
|
7074
|
+
children: /* @__PURE__ */ jsx("a", {
|
|
7075
|
+
href: link.href,
|
|
7076
|
+
...link.newTab ? {
|
|
7077
|
+
target: "_blank",
|
|
7078
|
+
rel: "noopener noreferrer"
|
|
7079
|
+
} : {},
|
|
7080
|
+
children: link.label
|
|
7081
|
+
})
|
|
7082
|
+
})
|
|
7083
|
+
}) : null
|
|
7084
|
+
]
|
|
7085
|
+
})
|
|
7086
|
+
});
|
|
7087
|
+
});
|
|
7088
|
+
TestimonialMasonry.displayName = "TestimonialMasonry";
|
|
7089
|
+
//#endregion
|
|
6878
7090
|
//#region src/blocks/settings/profile-settings-block.tsx
|
|
6879
7091
|
function ProfileSettingsBlock({ initialData, onSave, onAvatarChange, loading = false, error, disabled = false, className }) {
|
|
6880
7092
|
const fileInputRef = React.useRef(null);
|
|
@@ -7153,6 +7365,6 @@ function NotificationSettingsBlock({ groups, onSave, loading = false, error, dis
|
|
|
7153
7365
|
});
|
|
7154
7366
|
}
|
|
7155
7367
|
//#endregion
|
|
7156
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountSettingsBlock, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppSidebarBlock, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, BisonProvider, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeInput, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CurrencyInput, DataTable, DataTableColumnHeader, DatePicker, DateRangePicker, DensityProvider, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditableTitle, EmptyStateBlock, FAQColumnsBlock, FieldGroupScope, FieldProvider, FloatingNavBlock, FooterBlock, ForgotPasswordBlock, Form, FormError, FormField, HeaderBlock, Input, InputGroup, JsonLd, Label, MaintenanceBlock, MediaCard, NapBlock, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NotFoundBlock, NotificationSettingsBlock, OutlinedField, PageShell, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, PhoneInput, Popover, PopoverContent, PopoverTrigger, ProcessStepsBlock, ProfileSettingsBlock, Progress, ProgressBar, RadioGroup, RadioGroupItem, Rating, ResetPasswordBlock, ReviewsBlock, SavedPing, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, ServerErrorBlock, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, ShowcasePanelsBlock, Sidebar, SidebarBlock, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignInBlock, SignUpBlock, Skeleton, Slider, SocialProviders, Spinner, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperLabel, StepperSeparator, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TextContent, TextEditor, Textarea, ThemeProvider, ThemeScope, TimePicker, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VerifyBlock, actionNegativeToneClasses, actionNeutralIconChromeClasses, actionNeutralToneClasses, actionPositiveToneClasses, alertVariants, avatarVariants, badgeVariants, buttonVariants, cn, dateRangePresets, editableTitleVariants, formatUsPhone, napRecordToJsonLd, navigationMenuTriggerStyle, outlinedFieldNestResetClasses, parseUsPhoneDigits, progressBarVariants, ratingVariants, spinnerVariants, stepperIndicatorVariants, stepperItemVariants, stepperLabelVariants, switchVariants, toast, useDensity, useField, useFieldControl, useFieldGroup, useFieldIds, useFormContext, useHideOnScroll, useIsMobile, useScrollReveal, useSidebar, useTheme };
|
|
7368
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountSettingsBlock, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppSidebarBlock, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, BisonProvider, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeInput, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CurrencyInput, DataTable, DataTableColumnHeader, DatePicker, DateRangePicker, DensityProvider, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditableTitle, EmptyStateBlock, FAQColumnsBlock, FieldGroupScope, FieldProvider, FloatingNavBlock, FooterBlock, ForgotPasswordBlock, Form, FormError, FormField, HeaderBlock, Input, InputGroup, JsonLd, Label, MaintenanceBlock, MediaCard, NapBlock, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NotFoundBlock, NotificationSettingsBlock, OutlinedField, PageShell, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, PhoneInput, Popover, PopoverContent, PopoverTrigger, ProcessStepsBlock, ProfileSettingsBlock, Progress, ProgressBar, RadioGroup, RadioGroupItem, Rating, ResetPasswordBlock, ReviewsBlock, RotatingBadge, SavedPing, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, ServerErrorBlock, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, ShowcasePanelsBlock, Sidebar, SidebarBlock, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SignInBlock, SignUpBlock, Skeleton, Slider, SocialProviders, Spinner, Stepper, StepperDescription, StepperIndicator, StepperItem, StepperLabel, StepperSeparator, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TestimonialMasonry, TextContent, TextEditor, Textarea, ThemeProvider, ThemeScope, TimePicker, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VerifyBlock, actionNegativeToneClasses, actionNeutralIconChromeClasses, actionNeutralToneClasses, actionPositiveToneClasses, alertVariants, avatarVariants, badgeVariants, buttonVariants, cn, dateRangePresets, editableTitleVariants, formatUsPhone, napRecordToJsonLd, navigationMenuTriggerStyle, outlinedFieldNestResetClasses, parseUsPhoneDigits, progressBarVariants, ratingVariants, spinnerVariants, stepperIndicatorVariants, stepperItemVariants, stepperLabelVariants, switchVariants, toast, useDensity, useField, useFieldControl, useFieldGroup, useFieldIds, useFormContext, useHideOnScroll, useIsMobile, useScrollReveal, useSidebar, useTheme };
|
|
7157
7369
|
|
|
7158
7370
|
//# sourceMappingURL=index.mjs.map
|