@opensite/ui 2.6.1 → 2.6.3
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/article-hero-prose.cjs +7 -6
- package/dist/article-hero-prose.d.cts +1 -1
- package/dist/article-hero-prose.d.ts +1 -1
- package/dist/article-hero-prose.js +7 -6
- package/dist/article-toc-sidebar.cjs +77 -57
- package/dist/article-toc-sidebar.d.cts +5 -11
- package/dist/article-toc-sidebar.d.ts +5 -11
- package/dist/article-toc-sidebar.js +77 -57
- package/dist/blog-masonry-featured.cjs +13 -10
- package/dist/blog-masonry-featured.d.cts +5 -1
- package/dist/blog-masonry-featured.d.ts +5 -1
- package/dist/blog-masonry-featured.js +13 -10
- package/dist/carousel-portfolio-hero.cjs +79 -32
- package/dist/carousel-portfolio-hero.js +79 -32
- package/dist/feature-badge-grid-six.cjs +1 -38
- package/dist/feature-badge-grid-six.js +1 -38
- package/dist/feature-bento-image-grid.cjs +3 -12
- package/dist/feature-bento-image-grid.d.cts +1 -1
- package/dist/feature-bento-image-grid.d.ts +1 -1
- package/dist/feature-bento-image-grid.js +3 -12
- package/dist/feature-bento-utilities.cjs +5 -41
- package/dist/feature-bento-utilities.js +5 -41
- package/dist/registry.cjs +121 -114
- package/dist/registry.js +121 -114
- package/package.json +2 -2
|
@@ -877,7 +877,6 @@ Section.displayName = "Section";
|
|
|
877
877
|
function ArticleHeroProseComponent({
|
|
878
878
|
post,
|
|
879
879
|
className,
|
|
880
|
-
containerClassName,
|
|
881
880
|
headerClassName,
|
|
882
881
|
titleClassName,
|
|
883
882
|
descriptionClassName,
|
|
@@ -890,7 +889,8 @@ function ArticleHeroProseComponent({
|
|
|
890
889
|
dateFormat = "MMMM d, yyyy",
|
|
891
890
|
optixFlowConfig,
|
|
892
891
|
background,
|
|
893
|
-
|
|
892
|
+
containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
|
|
893
|
+
spacing = "hero",
|
|
894
894
|
pattern,
|
|
895
895
|
patternOpacity
|
|
896
896
|
}) {
|
|
@@ -961,8 +961,9 @@ function ArticleHeroProseComponent({
|
|
|
961
961
|
pattern,
|
|
962
962
|
patternOpacity,
|
|
963
963
|
className,
|
|
964
|
+
containerClassName,
|
|
964
965
|
children: [
|
|
965
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
966
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
966
967
|
"div",
|
|
967
968
|
{
|
|
968
969
|
className: cn(
|
|
@@ -974,7 +975,7 @@ function ArticleHeroProseComponent({
|
|
|
974
975
|
"h1",
|
|
975
976
|
{
|
|
976
977
|
className: cn(
|
|
977
|
-
"max-w-3xl text-
|
|
978
|
+
"max-w-full md:max-w-3xl text-2xl font-semibold text-pretty md:text-5xl",
|
|
978
979
|
titleClassName
|
|
979
980
|
),
|
|
980
981
|
children: title
|
|
@@ -984,7 +985,7 @@ function ArticleHeroProseComponent({
|
|
|
984
985
|
"h3",
|
|
985
986
|
{
|
|
986
987
|
className: cn(
|
|
987
|
-
"max-w-3xl text-lg text-muted-foreground md:text-xl text-balance",
|
|
988
|
+
"max-w-full md:max-w-3xl text-lg text-muted-foreground md:text-xl text-balance",
|
|
988
989
|
descriptionClassName
|
|
989
990
|
),
|
|
990
991
|
children: description
|
|
@@ -995,7 +996,7 @@ function ArticleHeroProseComponent({
|
|
|
995
996
|
]
|
|
996
997
|
}
|
|
997
998
|
) }),
|
|
998
|
-
children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("
|
|
999
|
+
children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative", containerClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
999
1000
|
"div",
|
|
1000
1001
|
{
|
|
1001
1002
|
className: cn(
|
|
@@ -91,6 +91,6 @@ interface ArticleHeroProseProps {
|
|
|
91
91
|
*/
|
|
92
92
|
patternOpacity?: number;
|
|
93
93
|
}
|
|
94
|
-
declare function ArticleHeroProseComponent({ post, className,
|
|
94
|
+
declare function ArticleHeroProseComponent({ post, className, headerClassName, titleClassName, descriptionClassName, authorClassName, heroImageClassName, proseClassName, heroMediaSlot, authorSlot, children, dateFormat, optixFlowConfig, background, containerClassName, spacing, pattern, patternOpacity, }: ArticleHeroProseProps): react_jsx_runtime.JSX.Element;
|
|
95
95
|
|
|
96
96
|
export { ArticleHeroProseComponent as ArticleHeroProse, type ArticleHeroProsePost, type ArticleHeroProseProps };
|
|
@@ -91,6 +91,6 @@ interface ArticleHeroProseProps {
|
|
|
91
91
|
*/
|
|
92
92
|
patternOpacity?: number;
|
|
93
93
|
}
|
|
94
|
-
declare function ArticleHeroProseComponent({ post, className,
|
|
94
|
+
declare function ArticleHeroProseComponent({ post, className, headerClassName, titleClassName, descriptionClassName, authorClassName, heroImageClassName, proseClassName, heroMediaSlot, authorSlot, children, dateFormat, optixFlowConfig, background, containerClassName, spacing, pattern, patternOpacity, }: ArticleHeroProseProps): react_jsx_runtime.JSX.Element;
|
|
95
95
|
|
|
96
96
|
export { ArticleHeroProseComponent as ArticleHeroProse, type ArticleHeroProsePost, type ArticleHeroProseProps };
|
|
@@ -855,7 +855,6 @@ Section.displayName = "Section";
|
|
|
855
855
|
function ArticleHeroProseComponent({
|
|
856
856
|
post,
|
|
857
857
|
className,
|
|
858
|
-
containerClassName,
|
|
859
858
|
headerClassName,
|
|
860
859
|
titleClassName,
|
|
861
860
|
descriptionClassName,
|
|
@@ -868,7 +867,8 @@ function ArticleHeroProseComponent({
|
|
|
868
867
|
dateFormat = "MMMM d, yyyy",
|
|
869
868
|
optixFlowConfig,
|
|
870
869
|
background,
|
|
871
|
-
|
|
870
|
+
containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
|
|
871
|
+
spacing = "hero",
|
|
872
872
|
pattern,
|
|
873
873
|
patternOpacity
|
|
874
874
|
}) {
|
|
@@ -939,8 +939,9 @@ function ArticleHeroProseComponent({
|
|
|
939
939
|
pattern,
|
|
940
940
|
patternOpacity,
|
|
941
941
|
className,
|
|
942
|
+
containerClassName,
|
|
942
943
|
children: [
|
|
943
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
944
|
+
/* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsxs(
|
|
944
945
|
"div",
|
|
945
946
|
{
|
|
946
947
|
className: cn(
|
|
@@ -952,7 +953,7 @@ function ArticleHeroProseComponent({
|
|
|
952
953
|
"h1",
|
|
953
954
|
{
|
|
954
955
|
className: cn(
|
|
955
|
-
"max-w-3xl text-
|
|
956
|
+
"max-w-full md:max-w-3xl text-2xl font-semibold text-pretty md:text-5xl",
|
|
956
957
|
titleClassName
|
|
957
958
|
),
|
|
958
959
|
children: title
|
|
@@ -962,7 +963,7 @@ function ArticleHeroProseComponent({
|
|
|
962
963
|
"h3",
|
|
963
964
|
{
|
|
964
965
|
className: cn(
|
|
965
|
-
"max-w-3xl text-lg text-muted-foreground md:text-xl text-balance",
|
|
966
|
+
"max-w-full md:max-w-3xl text-lg text-muted-foreground md:text-xl text-balance",
|
|
966
967
|
descriptionClassName
|
|
967
968
|
),
|
|
968
969
|
children: description
|
|
@@ -973,7 +974,7 @@ function ArticleHeroProseComponent({
|
|
|
973
974
|
]
|
|
974
975
|
}
|
|
975
976
|
) }),
|
|
976
|
-
children && /* @__PURE__ */ jsx("div", { className: cn("
|
|
977
|
+
children && /* @__PURE__ */ jsx("div", { className: cn("relative", containerClassName), children: /* @__PURE__ */ jsx(
|
|
977
978
|
"div",
|
|
978
979
|
{
|
|
979
980
|
className: cn(
|
|
@@ -35,36 +35,6 @@ var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive)
|
|
|
35
35
|
function cn(...inputs) {
|
|
36
36
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
37
37
|
}
|
|
38
|
-
function getNestedCardBg(parentBg, variant = "muted", options) {
|
|
39
|
-
const isDark = parentBg === "dark" || parentBg === "secondary" || parentBg === "primary";
|
|
40
|
-
if (isDark) {
|
|
41
|
-
switch (variant) {
|
|
42
|
-
case "muted":
|
|
43
|
-
return "bg-background";
|
|
44
|
-
case "card":
|
|
45
|
-
return "bg-card";
|
|
46
|
-
case "accent":
|
|
47
|
-
return "bg-accent";
|
|
48
|
-
case "subtle":
|
|
49
|
-
return "bg-background/50";
|
|
50
|
-
}
|
|
51
|
-
} else {
|
|
52
|
-
switch (variant) {
|
|
53
|
-
case "muted":
|
|
54
|
-
return "bg-muted";
|
|
55
|
-
case "card":
|
|
56
|
-
return "bg-card";
|
|
57
|
-
case "accent":
|
|
58
|
-
return "bg-accent";
|
|
59
|
-
case "subtle":
|
|
60
|
-
return "bg-muted/50";
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
function getNestedCardTextColor(parentBg, options) {
|
|
65
|
-
const isDark = parentBg === "dark" || parentBg === "secondary" || parentBg === "primary";
|
|
66
|
-
return isDark ? "text-foreground" : "";
|
|
67
|
-
}
|
|
68
38
|
function normalizePhoneNumber(input) {
|
|
69
39
|
const trimmed = input.trim();
|
|
70
40
|
if (trimmed.toLowerCase().startsWith("tel:")) {
|
|
@@ -938,7 +908,6 @@ var Section = React5__namespace.default.forwardRef(
|
|
|
938
908
|
Section.displayName = "Section";
|
|
939
909
|
function ArticleTocSidebarComponent({
|
|
940
910
|
className,
|
|
941
|
-
containerClassName,
|
|
942
911
|
articleClassName,
|
|
943
912
|
sidebarClassName,
|
|
944
913
|
headerClassName,
|
|
@@ -966,19 +935,18 @@ function ArticleTocSidebarComponent({
|
|
|
966
935
|
heroMediaSlot,
|
|
967
936
|
ctaTitle,
|
|
968
937
|
ctaDescription,
|
|
969
|
-
ctaActions
|
|
970
|
-
ctaButtonText,
|
|
971
|
-
ctaButtonHref,
|
|
938
|
+
ctaActions,
|
|
972
939
|
ctaSlot,
|
|
973
940
|
children,
|
|
974
941
|
enableTocTracking = true,
|
|
975
942
|
optixFlowConfig,
|
|
976
943
|
background,
|
|
977
|
-
|
|
944
|
+
containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
|
|
945
|
+
spacing = "hero",
|
|
978
946
|
pattern,
|
|
979
|
-
patternOpacity
|
|
947
|
+
patternOpacity,
|
|
948
|
+
patternClassName
|
|
980
949
|
}) {
|
|
981
|
-
const ctaActions = ctaActionsProp ?? (ctaButtonText ? [{ label: ctaButtonText, href: ctaButtonHref || "#", variant: "default", className: "w-full" }] : []);
|
|
982
950
|
const [activeSection, setActiveSection] = React5__namespace.useState(
|
|
983
951
|
sections?.[0]?.id || ""
|
|
984
952
|
);
|
|
@@ -1014,7 +982,14 @@ function ArticleTocSidebarComponent({
|
|
|
1014
982
|
/* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { children: authorName.charAt(0) })
|
|
1015
983
|
] }),
|
|
1016
984
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1017
|
-
authorHref ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
985
|
+
authorHref ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
986
|
+
Pressable,
|
|
987
|
+
{
|
|
988
|
+
href: authorHref,
|
|
989
|
+
className: "text-sm font-medium hover:underline",
|
|
990
|
+
children: authorName
|
|
991
|
+
}
|
|
992
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: authorName }),
|
|
1018
993
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
1019
994
|
publishDate,
|
|
1020
995
|
readTime && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -1024,7 +999,15 @@ function ArticleTocSidebarComponent({
|
|
|
1024
999
|
] })
|
|
1025
1000
|
] })
|
|
1026
1001
|
] });
|
|
1027
|
-
}, [
|
|
1002
|
+
}, [
|
|
1003
|
+
authorSlot,
|
|
1004
|
+
authorName,
|
|
1005
|
+
authorImage,
|
|
1006
|
+
authorHref,
|
|
1007
|
+
publishDate,
|
|
1008
|
+
readTime,
|
|
1009
|
+
authorClassName
|
|
1010
|
+
]);
|
|
1028
1011
|
const heroMediaContent = React5__namespace.useMemo(() => {
|
|
1029
1012
|
if (heroMediaSlot) return heroMediaSlot;
|
|
1030
1013
|
if (!heroImageSrc) return null;
|
|
@@ -1033,11 +1016,20 @@ function ArticleTocSidebarComponent({
|
|
|
1033
1016
|
{
|
|
1034
1017
|
src: heroImageSrc,
|
|
1035
1018
|
alt: heroImageAlt,
|
|
1036
|
-
className: cn(
|
|
1019
|
+
className: cn(
|
|
1020
|
+
"my-8 aspect-video w-full rounded-lg object-cover",
|
|
1021
|
+
heroImageClassName
|
|
1022
|
+
),
|
|
1037
1023
|
optixFlowConfig
|
|
1038
1024
|
}
|
|
1039
1025
|
);
|
|
1040
|
-
}, [
|
|
1026
|
+
}, [
|
|
1027
|
+
heroMediaSlot,
|
|
1028
|
+
heroImageSrc,
|
|
1029
|
+
heroImageAlt,
|
|
1030
|
+
heroImageClassName,
|
|
1031
|
+
optixFlowConfig
|
|
1032
|
+
]);
|
|
1041
1033
|
const tocContent = React5__namespace.useMemo(() => {
|
|
1042
1034
|
if (tocSlot) return tocSlot;
|
|
1043
1035
|
if (!sections || sections.length === 0) return null;
|
|
@@ -1065,12 +1057,20 @@ function ArticleTocSidebarComponent({
|
|
|
1065
1057
|
}, [tocSlot, sections, activeSection, renderSectionLink, tocClassName]);
|
|
1066
1058
|
const ctaContent = React5__namespace.useMemo(() => {
|
|
1067
1059
|
if (ctaSlot) return ctaSlot;
|
|
1068
|
-
if (!ctaTitle && !ctaDescription && (!ctaActions || ctaActions.length === 0))
|
|
1069
|
-
|
|
1060
|
+
if (!ctaTitle && !ctaDescription && (!ctaActions || ctaActions.length === 0))
|
|
1061
|
+
return null;
|
|
1062
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("rounded-lg border p-4", ctaClassName), children: [
|
|
1070
1063
|
ctaTitle && (typeof ctaTitle === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 text-sm font-semibold", children: ctaTitle }) : ctaTitle),
|
|
1071
|
-
ctaDescription && (typeof ctaDescription === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-4 text-sm
|
|
1064
|
+
ctaDescription && (typeof ctaDescription === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-4 text-sm", children: ctaDescription }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4", children: ctaDescription })),
|
|
1072
1065
|
ctaActions && ctaActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: ctaActions.map((action, index) => {
|
|
1073
|
-
const {
|
|
1066
|
+
const {
|
|
1067
|
+
label,
|
|
1068
|
+
icon,
|
|
1069
|
+
iconAfter,
|
|
1070
|
+
children: actionChildren,
|
|
1071
|
+
className: actionClassName,
|
|
1072
|
+
...pressableProps
|
|
1073
|
+
} = action;
|
|
1074
1074
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1075
1075
|
Pressable,
|
|
1076
1076
|
{
|
|
@@ -1095,18 +1095,38 @@ function ArticleTocSidebarComponent({
|
|
|
1095
1095
|
spacing,
|
|
1096
1096
|
pattern,
|
|
1097
1097
|
patternOpacity,
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1098
|
+
patternClassName,
|
|
1099
|
+
className: cn(pattern && "overflow-visible", className),
|
|
1100
|
+
containerClassName,
|
|
1101
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-10 lg:grid-cols-[minmax(0,1fr)_300px]", children: [
|
|
1102
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1103
|
+
"article",
|
|
1104
|
+
{
|
|
1105
|
+
className: cn(
|
|
1106
|
+
"prose max-w-none dark:prose-invert",
|
|
1107
|
+
articleClassName
|
|
1108
|
+
),
|
|
1109
|
+
children: [
|
|
1110
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("mb-8 not-prose", headerClassName), children: [
|
|
1111
|
+
categoryContent,
|
|
1112
|
+
title && (typeof title === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1113
|
+
"h1",
|
|
1114
|
+
{
|
|
1115
|
+
className: cn(
|
|
1116
|
+
"mt-4 text-2xl font-bold tracking-tight md:text-4xl",
|
|
1117
|
+
titleClassName
|
|
1118
|
+
),
|
|
1119
|
+
children: title
|
|
1120
|
+
}
|
|
1121
|
+
) : title),
|
|
1122
|
+
description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("mt-4 text-lg", descriptionClassName), children: description }) : description),
|
|
1123
|
+
authorContent
|
|
1124
|
+
] }),
|
|
1125
|
+
heroMediaContent,
|
|
1126
|
+
children
|
|
1127
|
+
]
|
|
1128
|
+
}
|
|
1129
|
+
),
|
|
1110
1130
|
/* @__PURE__ */ jsxRuntime.jsx("aside", { className: cn("hidden lg:block", sidebarClassName), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "sticky top-8 space-y-6", children: [
|
|
1111
1131
|
tocContent,
|
|
1112
1132
|
ctaContent
|
|
@@ -132,16 +132,6 @@ interface ArticleTocSidebarProps {
|
|
|
132
132
|
* CTA actions
|
|
133
133
|
*/
|
|
134
134
|
ctaActions?: ActionConfig[];
|
|
135
|
-
/**
|
|
136
|
-
* @deprecated Use ctaActions instead
|
|
137
|
-
* CTA button text (backward compatibility)
|
|
138
|
-
*/
|
|
139
|
-
ctaButtonText?: string;
|
|
140
|
-
/**
|
|
141
|
-
* @deprecated Use ctaActions instead
|
|
142
|
-
* CTA button href (backward compatibility)
|
|
143
|
-
*/
|
|
144
|
-
ctaButtonHref?: string;
|
|
145
135
|
/**
|
|
146
136
|
* Custom slot for CTA section (overrides CTA props)
|
|
147
137
|
*/
|
|
@@ -175,7 +165,11 @@ interface ArticleTocSidebarProps {
|
|
|
175
165
|
* Pattern opacity (0-1)
|
|
176
166
|
*/
|
|
177
167
|
patternOpacity?: number;
|
|
168
|
+
/**
|
|
169
|
+
* Additional CSS classes for the pattern overlay
|
|
170
|
+
*/
|
|
171
|
+
patternClassName?: string;
|
|
178
172
|
}
|
|
179
|
-
declare function ArticleTocSidebarComponent({ className,
|
|
173
|
+
declare function ArticleTocSidebarComponent({ className, articleClassName, sidebarClassName, headerClassName, titleClassName, descriptionClassName, authorClassName, tocClassName, ctaClassName, heroImageClassName, title, description, authorName, authorImage, authorHref, publishDate, readTime, authorSlot, category, categorySlot, sections, tocSlot, renderSectionLink, heroImageSrc, heroImageAlt, heroMediaSlot, ctaTitle, ctaDescription, ctaActions, ctaSlot, children, enableTocTracking, optixFlowConfig, background, containerClassName, spacing, pattern, patternOpacity, patternClassName, }: ArticleTocSidebarProps): react_jsx_runtime.JSX.Element;
|
|
180
174
|
|
|
181
175
|
export { type ArticleTocSection, ArticleTocSidebarComponent as ArticleTocSidebar, type ArticleTocSidebarProps };
|
|
@@ -132,16 +132,6 @@ interface ArticleTocSidebarProps {
|
|
|
132
132
|
* CTA actions
|
|
133
133
|
*/
|
|
134
134
|
ctaActions?: ActionConfig[];
|
|
135
|
-
/**
|
|
136
|
-
* @deprecated Use ctaActions instead
|
|
137
|
-
* CTA button text (backward compatibility)
|
|
138
|
-
*/
|
|
139
|
-
ctaButtonText?: string;
|
|
140
|
-
/**
|
|
141
|
-
* @deprecated Use ctaActions instead
|
|
142
|
-
* CTA button href (backward compatibility)
|
|
143
|
-
*/
|
|
144
|
-
ctaButtonHref?: string;
|
|
145
135
|
/**
|
|
146
136
|
* Custom slot for CTA section (overrides CTA props)
|
|
147
137
|
*/
|
|
@@ -175,7 +165,11 @@ interface ArticleTocSidebarProps {
|
|
|
175
165
|
* Pattern opacity (0-1)
|
|
176
166
|
*/
|
|
177
167
|
patternOpacity?: number;
|
|
168
|
+
/**
|
|
169
|
+
* Additional CSS classes for the pattern overlay
|
|
170
|
+
*/
|
|
171
|
+
patternClassName?: string;
|
|
178
172
|
}
|
|
179
|
-
declare function ArticleTocSidebarComponent({ className,
|
|
173
|
+
declare function ArticleTocSidebarComponent({ className, articleClassName, sidebarClassName, headerClassName, titleClassName, descriptionClassName, authorClassName, tocClassName, ctaClassName, heroImageClassName, title, description, authorName, authorImage, authorHref, publishDate, readTime, authorSlot, category, categorySlot, sections, tocSlot, renderSectionLink, heroImageSrc, heroImageAlt, heroMediaSlot, ctaTitle, ctaDescription, ctaActions, ctaSlot, children, enableTocTracking, optixFlowConfig, background, containerClassName, spacing, pattern, patternOpacity, patternClassName, }: ArticleTocSidebarProps): react_jsx_runtime.JSX.Element;
|
|
180
174
|
|
|
181
175
|
export { type ArticleTocSection, ArticleTocSidebarComponent as ArticleTocSidebar, type ArticleTocSidebarProps };
|
|
@@ -13,36 +13,6 @@ import { Slot } from '@radix-ui/react-slot';
|
|
|
13
13
|
function cn(...inputs) {
|
|
14
14
|
return twMerge(clsx(inputs));
|
|
15
15
|
}
|
|
16
|
-
function getNestedCardBg(parentBg, variant = "muted", options) {
|
|
17
|
-
const isDark = parentBg === "dark" || parentBg === "secondary" || parentBg === "primary";
|
|
18
|
-
if (isDark) {
|
|
19
|
-
switch (variant) {
|
|
20
|
-
case "muted":
|
|
21
|
-
return "bg-background";
|
|
22
|
-
case "card":
|
|
23
|
-
return "bg-card";
|
|
24
|
-
case "accent":
|
|
25
|
-
return "bg-accent";
|
|
26
|
-
case "subtle":
|
|
27
|
-
return "bg-background/50";
|
|
28
|
-
}
|
|
29
|
-
} else {
|
|
30
|
-
switch (variant) {
|
|
31
|
-
case "muted":
|
|
32
|
-
return "bg-muted";
|
|
33
|
-
case "card":
|
|
34
|
-
return "bg-card";
|
|
35
|
-
case "accent":
|
|
36
|
-
return "bg-accent";
|
|
37
|
-
case "subtle":
|
|
38
|
-
return "bg-muted/50";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function getNestedCardTextColor(parentBg, options) {
|
|
43
|
-
const isDark = parentBg === "dark" || parentBg === "secondary" || parentBg === "primary";
|
|
44
|
-
return isDark ? "text-foreground" : "";
|
|
45
|
-
}
|
|
46
16
|
function normalizePhoneNumber(input) {
|
|
47
17
|
const trimmed = input.trim();
|
|
48
18
|
if (trimmed.toLowerCase().startsWith("tel:")) {
|
|
@@ -916,7 +886,6 @@ var Section = React5__default.forwardRef(
|
|
|
916
886
|
Section.displayName = "Section";
|
|
917
887
|
function ArticleTocSidebarComponent({
|
|
918
888
|
className,
|
|
919
|
-
containerClassName,
|
|
920
889
|
articleClassName,
|
|
921
890
|
sidebarClassName,
|
|
922
891
|
headerClassName,
|
|
@@ -944,19 +913,18 @@ function ArticleTocSidebarComponent({
|
|
|
944
913
|
heroMediaSlot,
|
|
945
914
|
ctaTitle,
|
|
946
915
|
ctaDescription,
|
|
947
|
-
ctaActions
|
|
948
|
-
ctaButtonText,
|
|
949
|
-
ctaButtonHref,
|
|
916
|
+
ctaActions,
|
|
950
917
|
ctaSlot,
|
|
951
918
|
children,
|
|
952
919
|
enableTocTracking = true,
|
|
953
920
|
optixFlowConfig,
|
|
954
921
|
background,
|
|
955
|
-
|
|
922
|
+
containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
|
|
923
|
+
spacing = "hero",
|
|
956
924
|
pattern,
|
|
957
|
-
patternOpacity
|
|
925
|
+
patternOpacity,
|
|
926
|
+
patternClassName
|
|
958
927
|
}) {
|
|
959
|
-
const ctaActions = ctaActionsProp ?? (ctaButtonText ? [{ label: ctaButtonText, href: ctaButtonHref || "#", variant: "default", className: "w-full" }] : []);
|
|
960
928
|
const [activeSection, setActiveSection] = React5.useState(
|
|
961
929
|
sections?.[0]?.id || ""
|
|
962
930
|
);
|
|
@@ -992,7 +960,14 @@ function ArticleTocSidebarComponent({
|
|
|
992
960
|
/* @__PURE__ */ jsx(AvatarFallback, { children: authorName.charAt(0) })
|
|
993
961
|
] }),
|
|
994
962
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
995
|
-
authorHref ? /* @__PURE__ */ jsx(
|
|
963
|
+
authorHref ? /* @__PURE__ */ jsx(
|
|
964
|
+
Pressable,
|
|
965
|
+
{
|
|
966
|
+
href: authorHref,
|
|
967
|
+
className: "text-sm font-medium hover:underline",
|
|
968
|
+
children: authorName
|
|
969
|
+
}
|
|
970
|
+
) : /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: authorName }),
|
|
996
971
|
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
997
972
|
publishDate,
|
|
998
973
|
readTime && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1002,7 +977,15 @@ function ArticleTocSidebarComponent({
|
|
|
1002
977
|
] })
|
|
1003
978
|
] })
|
|
1004
979
|
] });
|
|
1005
|
-
}, [
|
|
980
|
+
}, [
|
|
981
|
+
authorSlot,
|
|
982
|
+
authorName,
|
|
983
|
+
authorImage,
|
|
984
|
+
authorHref,
|
|
985
|
+
publishDate,
|
|
986
|
+
readTime,
|
|
987
|
+
authorClassName
|
|
988
|
+
]);
|
|
1006
989
|
const heroMediaContent = React5.useMemo(() => {
|
|
1007
990
|
if (heroMediaSlot) return heroMediaSlot;
|
|
1008
991
|
if (!heroImageSrc) return null;
|
|
@@ -1011,11 +994,20 @@ function ArticleTocSidebarComponent({
|
|
|
1011
994
|
{
|
|
1012
995
|
src: heroImageSrc,
|
|
1013
996
|
alt: heroImageAlt,
|
|
1014
|
-
className: cn(
|
|
997
|
+
className: cn(
|
|
998
|
+
"my-8 aspect-video w-full rounded-lg object-cover",
|
|
999
|
+
heroImageClassName
|
|
1000
|
+
),
|
|
1015
1001
|
optixFlowConfig
|
|
1016
1002
|
}
|
|
1017
1003
|
);
|
|
1018
|
-
}, [
|
|
1004
|
+
}, [
|
|
1005
|
+
heroMediaSlot,
|
|
1006
|
+
heroImageSrc,
|
|
1007
|
+
heroImageAlt,
|
|
1008
|
+
heroImageClassName,
|
|
1009
|
+
optixFlowConfig
|
|
1010
|
+
]);
|
|
1019
1011
|
const tocContent = React5.useMemo(() => {
|
|
1020
1012
|
if (tocSlot) return tocSlot;
|
|
1021
1013
|
if (!sections || sections.length === 0) return null;
|
|
@@ -1043,12 +1035,20 @@ function ArticleTocSidebarComponent({
|
|
|
1043
1035
|
}, [tocSlot, sections, activeSection, renderSectionLink, tocClassName]);
|
|
1044
1036
|
const ctaContent = React5.useMemo(() => {
|
|
1045
1037
|
if (ctaSlot) return ctaSlot;
|
|
1046
|
-
if (!ctaTitle && !ctaDescription && (!ctaActions || ctaActions.length === 0))
|
|
1047
|
-
|
|
1038
|
+
if (!ctaTitle && !ctaDescription && (!ctaActions || ctaActions.length === 0))
|
|
1039
|
+
return null;
|
|
1040
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("rounded-lg border p-4", ctaClassName), children: [
|
|
1048
1041
|
ctaTitle && (typeof ctaTitle === "string" ? /* @__PURE__ */ jsx("h3", { className: "mb-2 text-sm font-semibold", children: ctaTitle }) : ctaTitle),
|
|
1049
|
-
ctaDescription && (typeof ctaDescription === "string" ? /* @__PURE__ */ jsx("p", { className: "mb-4 text-sm
|
|
1042
|
+
ctaDescription && (typeof ctaDescription === "string" ? /* @__PURE__ */ jsx("p", { className: "mb-4 text-sm", children: ctaDescription }) : /* @__PURE__ */ jsx("div", { className: "mb-4", children: ctaDescription })),
|
|
1050
1043
|
ctaActions && ctaActions.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: ctaActions.map((action, index) => {
|
|
1051
|
-
const {
|
|
1044
|
+
const {
|
|
1045
|
+
label,
|
|
1046
|
+
icon,
|
|
1047
|
+
iconAfter,
|
|
1048
|
+
children: actionChildren,
|
|
1049
|
+
className: actionClassName,
|
|
1050
|
+
...pressableProps
|
|
1051
|
+
} = action;
|
|
1052
1052
|
return /* @__PURE__ */ jsx(
|
|
1053
1053
|
Pressable,
|
|
1054
1054
|
{
|
|
@@ -1073,18 +1073,38 @@ function ArticleTocSidebarComponent({
|
|
|
1073
1073
|
spacing,
|
|
1074
1074
|
pattern,
|
|
1075
1075
|
patternOpacity,
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1076
|
+
patternClassName,
|
|
1077
|
+
className: cn(pattern && "overflow-visible", className),
|
|
1078
|
+
containerClassName,
|
|
1079
|
+
children: /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsxs("div", { className: "grid gap-10 lg:grid-cols-[minmax(0,1fr)_300px]", children: [
|
|
1080
|
+
/* @__PURE__ */ jsxs(
|
|
1081
|
+
"article",
|
|
1082
|
+
{
|
|
1083
|
+
className: cn(
|
|
1084
|
+
"prose max-w-none dark:prose-invert",
|
|
1085
|
+
articleClassName
|
|
1086
|
+
),
|
|
1087
|
+
children: [
|
|
1088
|
+
/* @__PURE__ */ jsxs("div", { className: cn("mb-8 not-prose", headerClassName), children: [
|
|
1089
|
+
categoryContent,
|
|
1090
|
+
title && (typeof title === "string" ? /* @__PURE__ */ jsx(
|
|
1091
|
+
"h1",
|
|
1092
|
+
{
|
|
1093
|
+
className: cn(
|
|
1094
|
+
"mt-4 text-2xl font-bold tracking-tight md:text-4xl",
|
|
1095
|
+
titleClassName
|
|
1096
|
+
),
|
|
1097
|
+
children: title
|
|
1098
|
+
}
|
|
1099
|
+
) : title),
|
|
1100
|
+
description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("mt-4 text-lg", descriptionClassName), children: description }) : description),
|
|
1101
|
+
authorContent
|
|
1102
|
+
] }),
|
|
1103
|
+
heroMediaContent,
|
|
1104
|
+
children
|
|
1105
|
+
]
|
|
1106
|
+
}
|
|
1107
|
+
),
|
|
1088
1108
|
/* @__PURE__ */ jsx("aside", { className: cn("hidden lg:block", sidebarClassName), children: /* @__PURE__ */ jsxs("div", { className: "sticky top-8 space-y-6", children: [
|
|
1089
1109
|
tocContent,
|
|
1090
1110
|
ctaContent
|