@opensite/ui 0.6.3 → 0.6.5
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/about-startup-team.cjs +2 -2
- package/dist/about-startup-team.js +2 -2
- package/dist/article-breadcrumb-social.cjs +434 -215
- package/dist/article-breadcrumb-social.d.cts +19 -1
- package/dist/article-breadcrumb-social.d.ts +19 -1
- package/dist/article-breadcrumb-social.js +434 -214
- package/dist/article-chapters-author.cjs +422 -204
- package/dist/article-chapters-author.d.cts +19 -1
- package/dist/article-chapters-author.d.ts +19 -1
- package/dist/article-chapters-author.js +422 -203
- package/dist/article-compact-toc.cjs +429 -73
- package/dist/article-compact-toc.d.cts +19 -1
- package/dist/article-compact-toc.d.ts +19 -1
- package/dist/article-compact-toc.js +430 -73
- package/dist/article-hero-prose.cjs +394 -347
- package/dist/article-hero-prose.d.cts +19 -1
- package/dist/article-hero-prose.d.ts +19 -1
- package/dist/article-hero-prose.js +396 -348
- package/dist/article-sidebar-sticky.cjs +398 -152
- package/dist/article-sidebar-sticky.d.cts +19 -1
- package/dist/article-sidebar-sticky.d.ts +19 -1
- package/dist/article-sidebar-sticky.js +400 -153
- package/dist/article-split-animated.cjs +422 -35
- package/dist/article-split-animated.d.cts +19 -1
- package/dist/article-split-animated.d.ts +19 -1
- package/dist/article-split-animated.js +423 -35
- package/dist/article-toc-sidebar.cjs +417 -356
- package/dist/article-toc-sidebar.d.cts +19 -1
- package/dist/article-toc-sidebar.d.ts +19 -1
- package/dist/article-toc-sidebar.js +417 -355
- package/dist/blog-cards-read-time.cjs +66 -27
- package/dist/blog-cards-read-time.js +66 -27
- package/dist/blog-cards-tagline-cta.cjs +64 -14
- package/dist/blog-cards-tagline-cta.js +64 -14
- package/dist/blog-carousel-apple.cjs +1255 -0
- package/dist/blog-carousel-apple.d.cts +113 -0
- package/dist/blog-carousel-apple.d.ts +113 -0
- package/dist/blog-carousel-apple.js +1234 -0
- package/dist/blog-category-overlay.cjs +77 -15
- package/dist/blog-category-overlay.js +77 -15
- package/dist/blog-featured-popular.cjs +72 -14
- package/dist/blog-featured-popular.js +72 -14
- package/dist/blog-filtered-results.cjs +122 -39
- package/dist/blog-filtered-results.js +122 -39
- package/dist/blog-grid-author-cards.cjs +40 -6
- package/dist/blog-grid-author-cards.js +40 -6
- package/dist/blog-grid-nine-posts.cjs +40 -6
- package/dist/blog-grid-nine-posts.js +40 -6
- package/dist/blog-horizontal-cards.cjs +34 -6
- package/dist/blog-horizontal-cards.js +34 -6
- package/dist/blog-horizontal-timeline.cjs +41 -12
- package/dist/blog-horizontal-timeline.js +41 -12
- package/dist/blog-masonry-featured.cjs +96 -52
- package/dist/blog-masonry-featured.js +96 -52
- package/dist/blog-related-articles.cjs +47 -9
- package/dist/blog-related-articles.js +47 -9
- package/dist/blog-tech-insights.cjs +78 -14
- package/dist/blog-tech-insights.js +78 -14
- package/dist/registry.cjs +1036 -687
- package/dist/registry.js +1036 -687
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
2
|
+
import * as React6 from 'react';
|
|
3
|
+
import React6__default from 'react';
|
|
3
4
|
import { clsx } from 'clsx';
|
|
4
5
|
import { twMerge } from 'tailwind-merge';
|
|
5
6
|
import { Img } from '@page-speed/img';
|
|
@@ -88,7 +89,7 @@ function useNavigation({
|
|
|
88
89
|
href,
|
|
89
90
|
onClick
|
|
90
91
|
} = {}) {
|
|
91
|
-
const linkType =
|
|
92
|
+
const linkType = React6.useMemo(() => {
|
|
92
93
|
if (!href || href.trim() === "") {
|
|
93
94
|
return onClick ? "none" : "none";
|
|
94
95
|
}
|
|
@@ -109,7 +110,7 @@ function useNavigation({
|
|
|
109
110
|
return "internal";
|
|
110
111
|
}
|
|
111
112
|
}, [href, onClick]);
|
|
112
|
-
const normalizedHref =
|
|
113
|
+
const normalizedHref = React6.useMemo(() => {
|
|
113
114
|
if (!href || href.trim() === "") {
|
|
114
115
|
return void 0;
|
|
115
116
|
}
|
|
@@ -127,7 +128,7 @@ function useNavigation({
|
|
|
127
128
|
return trimmed;
|
|
128
129
|
}
|
|
129
130
|
}, [href, linkType]);
|
|
130
|
-
const target =
|
|
131
|
+
const target = React6.useMemo(() => {
|
|
131
132
|
switch (linkType) {
|
|
132
133
|
case "external":
|
|
133
134
|
return "_blank";
|
|
@@ -140,7 +141,7 @@ function useNavigation({
|
|
|
140
141
|
return void 0;
|
|
141
142
|
}
|
|
142
143
|
}, [linkType]);
|
|
143
|
-
const rel =
|
|
144
|
+
const rel = React6.useMemo(() => {
|
|
144
145
|
if (linkType === "external") {
|
|
145
146
|
return "noopener noreferrer";
|
|
146
147
|
}
|
|
@@ -149,7 +150,7 @@ function useNavigation({
|
|
|
149
150
|
const isExternal = linkType === "external";
|
|
150
151
|
const isInternal = linkType === "internal";
|
|
151
152
|
const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
|
|
152
|
-
const handleClick =
|
|
153
|
+
const handleClick = React6.useCallback(
|
|
153
154
|
(event) => {
|
|
154
155
|
if (onClick) {
|
|
155
156
|
try {
|
|
@@ -333,7 +334,7 @@ var buttonVariants = cva(baseStyles, {
|
|
|
333
334
|
size: "default"
|
|
334
335
|
}
|
|
335
336
|
});
|
|
336
|
-
var Pressable =
|
|
337
|
+
var Pressable = React6.forwardRef(
|
|
337
338
|
({
|
|
338
339
|
children,
|
|
339
340
|
className,
|
|
@@ -439,10 +440,10 @@ function DynamicIcon({
|
|
|
439
440
|
className,
|
|
440
441
|
alt
|
|
441
442
|
}) {
|
|
442
|
-
const [svgContent, setSvgContent] =
|
|
443
|
-
const [isLoading, setIsLoading] =
|
|
444
|
-
const [error, setError] =
|
|
445
|
-
const { url, iconName } =
|
|
443
|
+
const [svgContent, setSvgContent] = React6.useState(null);
|
|
444
|
+
const [isLoading, setIsLoading] = React6.useState(true);
|
|
445
|
+
const [error, setError] = React6.useState(null);
|
|
446
|
+
const { url, iconName } = React6.useMemo(() => {
|
|
446
447
|
const separator = name.includes("/") ? "/" : ":";
|
|
447
448
|
const [prefix, iconName2] = name.split(separator);
|
|
448
449
|
const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}`;
|
|
@@ -451,7 +452,7 @@ function DynamicIcon({
|
|
|
451
452
|
iconName: iconName2
|
|
452
453
|
};
|
|
453
454
|
}, [name, size]);
|
|
454
|
-
|
|
455
|
+
React6.useEffect(() => {
|
|
455
456
|
let isMounted = true;
|
|
456
457
|
const fetchSvg = async () => {
|
|
457
458
|
const cached = svgCache.get(url);
|
|
@@ -672,174 +673,379 @@ function Separator({
|
|
|
672
673
|
}
|
|
673
674
|
);
|
|
674
675
|
}
|
|
676
|
+
var maxWidthStyles = {
|
|
677
|
+
sm: "max-w-screen-sm",
|
|
678
|
+
md: "max-w-screen-md",
|
|
679
|
+
lg: "max-w-screen-lg",
|
|
680
|
+
xl: "max-w-7xl",
|
|
681
|
+
"2xl": "max-w-screen-2xl",
|
|
682
|
+
"4xl": "max-w-[1536px]",
|
|
683
|
+
full: "max-w-full"
|
|
684
|
+
};
|
|
685
|
+
var Container = React6__default.forwardRef(
|
|
686
|
+
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
687
|
+
const Component = as;
|
|
688
|
+
return /* @__PURE__ */ jsx(
|
|
689
|
+
Component,
|
|
690
|
+
{
|
|
691
|
+
ref,
|
|
692
|
+
className: cn(
|
|
693
|
+
"mx-auto w-full px-2 sm:px-4 lg:px-8",
|
|
694
|
+
maxWidthStyles[maxWidth],
|
|
695
|
+
className
|
|
696
|
+
),
|
|
697
|
+
...props,
|
|
698
|
+
children
|
|
699
|
+
}
|
|
700
|
+
);
|
|
701
|
+
}
|
|
702
|
+
);
|
|
703
|
+
Container.displayName = "Container";
|
|
675
704
|
|
|
676
|
-
// lib/
|
|
677
|
-
var
|
|
678
|
-
"https://
|
|
679
|
-
"https://
|
|
680
|
-
"https://
|
|
681
|
-
"https://
|
|
682
|
-
"https://
|
|
683
|
-
"https://
|
|
684
|
-
"https://
|
|
685
|
-
"https://
|
|
686
|
-
"https://
|
|
687
|
-
"https://
|
|
688
|
-
"https://
|
|
689
|
-
"https://
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
"
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
"
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
"
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
"
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
705
|
+
// lib/patternSvgs.ts
|
|
706
|
+
var patternSvgs = {
|
|
707
|
+
squareAltGrid: "https://cdn.ing/assets/files/record/286187/4gpn0yq2ptra8iwlvmwwv860ggwv",
|
|
708
|
+
grid1: "https://cdn.ing/assets/files/record/286186/nbdflpgp4ostrno079hygibsflp3",
|
|
709
|
+
noise: "https://cdn.ing/assets/i/r/286188/zrqcp9hynh3j7p2laihwzfbujgrl/noise.png",
|
|
710
|
+
dots: "https://cdn.ing/assets/files/record/286198/yfsjx9thvtxzhl2qtshxyhkrm524",
|
|
711
|
+
dotPattern: "https://cdn.ing/assets/files/record/286192/7ig0cku8aqbboiza8nuk6hw0nnsr",
|
|
712
|
+
dotPattern2: "https://cdn.ing/assets/files/record/286189/arez6gd2s7isn9i1o6c7sexdq7bl",
|
|
713
|
+
circles: "https://cdn.ing/assets/files/record/286190/gtmia3sncjtzetdshc20zf1d3c17",
|
|
714
|
+
waves: "https://cdn.ing/assets/files/record/286191/mqlb33fzxz9cdth1bx7if0wmpkp1",
|
|
715
|
+
crossPattern: "https://cdn.ing/assets/files/record/286193/9yfqwdbnqaipbp7fsb3wbzzmq472",
|
|
716
|
+
architect: "https://cdn.ing/assets/files/record/286194/vgs88ugpvyhxu13wqgy0acvae6re",
|
|
717
|
+
tinyCheckers: "https://cdn.ing/assets/files/record/286195/65efaknsw8kcpf9o3c2gybytsl5b",
|
|
718
|
+
p6: "https://cdn.ing/assets/i/r/286196/6kl0rqnd6mjk8j7e525fo8fo0vkc/p6.webp"
|
|
719
|
+
};
|
|
720
|
+
var maskTop = "radial-gradient(ellipse 70% 60% at 50% 0%, #000 60%, transparent 100%)";
|
|
721
|
+
var maskBottom = "radial-gradient(ellipse 100% 80% at 50% 100%, #000 50%, transparent 90%)";
|
|
722
|
+
var maskCenter = "radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 70%)";
|
|
723
|
+
var maskTopLeft = "radial-gradient(ellipse 80% 80% at 0% 0%, #000 50%, transparent 90%)";
|
|
724
|
+
var maskTopRight = "radial-gradient(ellipse 80% 80% at 100% 0%, #000 50%, transparent 90%)";
|
|
725
|
+
var maskBottomLeft = "radial-gradient(ellipse 80% 80% at 0% 100%, #000 50%, transparent 90%)";
|
|
726
|
+
var maskBottomRight = "radial-gradient(ellipse 80% 80% at 100% 100%, #000 50%, transparent 90%)";
|
|
727
|
+
var circuitBoardPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
728
|
+
"svg",
|
|
729
|
+
{
|
|
730
|
+
className: "h-full w-full",
|
|
731
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
732
|
+
style: mask ? {
|
|
733
|
+
maskImage: mask,
|
|
734
|
+
WebkitMaskImage: mask
|
|
735
|
+
} : void 0,
|
|
736
|
+
children: [
|
|
737
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
738
|
+
"pattern",
|
|
739
|
+
{
|
|
740
|
+
id,
|
|
741
|
+
x: "0",
|
|
742
|
+
y: "0",
|
|
743
|
+
width: "100",
|
|
744
|
+
height: "100",
|
|
745
|
+
patternUnits: "userSpaceOnUse",
|
|
746
|
+
children: [
|
|
747
|
+
/* @__PURE__ */ jsx(
|
|
748
|
+
"path",
|
|
749
|
+
{
|
|
750
|
+
d: "M0 50h40M60 50h40M50 0v40M50 60v40",
|
|
751
|
+
stroke: "hsl(var(--muted))",
|
|
752
|
+
strokeWidth: "1",
|
|
753
|
+
fill: "none"
|
|
754
|
+
}
|
|
755
|
+
),
|
|
756
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "3", fill: "hsl(var(--muted))" }),
|
|
757
|
+
/* @__PURE__ */ jsx("circle", { cx: "0", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
758
|
+
/* @__PURE__ */ jsx("circle", { cx: "100", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
759
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "0", r: "2", fill: "hsl(var(--muted))" }),
|
|
760
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "100", r: "2", fill: "hsl(var(--muted))" })
|
|
761
|
+
]
|
|
762
|
+
}
|
|
763
|
+
) }),
|
|
764
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
765
|
+
]
|
|
766
|
+
}
|
|
767
|
+
);
|
|
768
|
+
var gridDotsPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
769
|
+
"svg",
|
|
770
|
+
{
|
|
771
|
+
className: "h-full w-full",
|
|
772
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
773
|
+
style: mask ? {
|
|
774
|
+
maskImage: mask,
|
|
775
|
+
WebkitMaskImage: mask
|
|
776
|
+
} : void 0,
|
|
777
|
+
children: [
|
|
778
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
779
|
+
"pattern",
|
|
780
|
+
{
|
|
781
|
+
id,
|
|
782
|
+
x: "0",
|
|
783
|
+
y: "0",
|
|
784
|
+
width: "40",
|
|
785
|
+
height: "40",
|
|
786
|
+
patternUnits: "userSpaceOnUse",
|
|
787
|
+
children: [
|
|
788
|
+
/* @__PURE__ */ jsx(
|
|
789
|
+
"path",
|
|
790
|
+
{
|
|
791
|
+
d: "M0 20h40M20 0v40",
|
|
792
|
+
stroke: "hsl(var(--muted))",
|
|
793
|
+
strokeWidth: "0.5",
|
|
794
|
+
fill: "none"
|
|
795
|
+
}
|
|
796
|
+
),
|
|
797
|
+
/* @__PURE__ */ jsx("circle", { cx: "20", cy: "20", r: "2", fill: "hsl(var(--muted))" })
|
|
798
|
+
]
|
|
799
|
+
}
|
|
800
|
+
) }),
|
|
801
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
802
|
+
]
|
|
803
|
+
}
|
|
804
|
+
);
|
|
805
|
+
var gridPattern = (size, mask) => /* @__PURE__ */ jsx(
|
|
806
|
+
"div",
|
|
807
|
+
{
|
|
808
|
+
className: "h-full w-full bg-[linear-gradient(to_right,_hsl(var(--muted))_1px,_transparent_1px),linear-gradient(to_bottom,_hsl(var(--muted))_1px,_transparent_1px)]",
|
|
809
|
+
style: {
|
|
810
|
+
backgroundSize: `${size}px ${size}px`,
|
|
811
|
+
...mask ? {
|
|
812
|
+
maskImage: mask,
|
|
813
|
+
WebkitMaskImage: mask
|
|
814
|
+
} : {}
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
);
|
|
818
|
+
var diagonalCrossPattern = (mask) => /* @__PURE__ */ jsx(
|
|
819
|
+
"div",
|
|
820
|
+
{
|
|
821
|
+
className: "h-full w-full",
|
|
822
|
+
style: {
|
|
823
|
+
backgroundImage: "repeating-linear-gradient(45deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px), repeating-linear-gradient(135deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px)",
|
|
824
|
+
...mask ? {
|
|
825
|
+
maskImage: mask,
|
|
826
|
+
WebkitMaskImage: mask
|
|
827
|
+
} : {}
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
);
|
|
831
|
+
var dashedGridMaskBase = "repeating-linear-gradient(to right, black 0px, black 3px, transparent 3px, transparent 8px), repeating-linear-gradient(to bottom, black 0px, black 3px, transparent 3px, transparent 8px)";
|
|
832
|
+
var dashedGridPattern = (fadeMask) => {
|
|
833
|
+
const mask = fadeMask ? `${dashedGridMaskBase}, ${fadeMask}` : dashedGridMaskBase;
|
|
834
|
+
return /* @__PURE__ */ jsx(
|
|
835
|
+
"div",
|
|
797
836
|
{
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
837
|
+
className: "h-full w-full",
|
|
838
|
+
style: {
|
|
839
|
+
backgroundImage: "linear-gradient(to right, hsl(var(--muted)) 1px, transparent 1px), linear-gradient(to bottom, hsl(var(--muted)) 1px, transparent 1px)",
|
|
840
|
+
backgroundSize: "20px 20px",
|
|
841
|
+
backgroundPosition: "0 0, 0 0",
|
|
842
|
+
maskImage: mask,
|
|
843
|
+
WebkitMaskImage: mask,
|
|
844
|
+
maskComposite: "intersect",
|
|
845
|
+
WebkitMaskComposite: "source-in"
|
|
846
|
+
}
|
|
802
847
|
}
|
|
803
|
-
)
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
848
|
+
);
|
|
849
|
+
};
|
|
850
|
+
var gradientGlow = (position) => /* @__PURE__ */ jsx(
|
|
851
|
+
"div",
|
|
852
|
+
{
|
|
853
|
+
className: cn(
|
|
854
|
+
"pointer-events-none absolute left-1/2 z-0 aspect-square w-3/4 -translate-x-1/2 rounded-full opacity-50 blur-3xl",
|
|
855
|
+
position === "top" ? "-top-1/4" : "-bottom-1/4"
|
|
856
|
+
),
|
|
857
|
+
style: {
|
|
858
|
+
background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
);
|
|
862
|
+
var spotlight = (position) => /* @__PURE__ */ jsx(
|
|
863
|
+
"div",
|
|
864
|
+
{
|
|
865
|
+
className: cn(
|
|
866
|
+
"pointer-events-none absolute top-1/2 z-0 aspect-square w-3/4 -translate-y-1/2 rounded-full opacity-40 blur-3xl",
|
|
867
|
+
position === "left" ? "-left-1/4" : "-right-1/4"
|
|
868
|
+
),
|
|
869
|
+
style: {
|
|
870
|
+
background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
);
|
|
874
|
+
var patternOverlays = {
|
|
875
|
+
circuitBoardBasic: () => circuitBoardPattern("circuit-board-basic"),
|
|
876
|
+
circuitBoardFadeTop: () => circuitBoardPattern("circuit-board-fade-top", maskTop),
|
|
877
|
+
circuitBoardFadeBottom: () => circuitBoardPattern("circuit-board-fade-bottom", maskBottom),
|
|
878
|
+
circuitBoardFadeCenter: () => circuitBoardPattern("circuit-board-fade-center", maskCenter),
|
|
879
|
+
circuitBoardFadeTopLeft: () => circuitBoardPattern("circuit-board-fade-top-left", maskTopLeft),
|
|
880
|
+
circuitBoardFadeTopRight: () => circuitBoardPattern("circuit-board-fade-top-right", maskTopRight),
|
|
881
|
+
circuitBoardFadeBottomLeft: () => circuitBoardPattern("circuit-board-fade-bottom-left", maskBottomLeft),
|
|
882
|
+
circuitBoardFadeBottomRight: () => circuitBoardPattern("circuit-board-fade-bottom-right", maskBottomRight),
|
|
883
|
+
dashedGridBasic: () => dashedGridPattern(),
|
|
884
|
+
dashedGridFadeTop: () => dashedGridPattern(maskTop),
|
|
885
|
+
dashedGridFadeBottom: () => dashedGridPattern(maskBottom),
|
|
886
|
+
dashedGridFadeCenter: () => dashedGridPattern(maskCenter),
|
|
887
|
+
dashedGridFadeTopLeft: () => dashedGridPattern(maskTopLeft),
|
|
888
|
+
dashedGridFadeTopRight: () => dashedGridPattern(maskTopRight),
|
|
889
|
+
dashedGridFadeBottomLeft: () => dashedGridPattern(maskBottomLeft),
|
|
890
|
+
dashedGridFadeBottomRight: () => dashedGridPattern(maskBottomRight),
|
|
891
|
+
diagonalCrossBasic: () => diagonalCrossPattern(),
|
|
892
|
+
diagonalCrossFadeTop: () => diagonalCrossPattern(maskTop),
|
|
893
|
+
diagonalCrossFadeBottom: () => diagonalCrossPattern(maskBottom),
|
|
894
|
+
diagonalCrossFadeCenter: () => diagonalCrossPattern(maskCenter),
|
|
895
|
+
diagonalCrossFadeTopLeft: () => diagonalCrossPattern(maskTopLeft),
|
|
896
|
+
diagonalCrossFadeTopRight: () => diagonalCrossPattern(maskTopRight),
|
|
897
|
+
diagonalCrossFadeBottomLeft: () => diagonalCrossPattern(maskBottomLeft),
|
|
898
|
+
diagonalCrossFadeBottomRight: () => diagonalCrossPattern(maskBottomRight),
|
|
899
|
+
gridBasic: () => gridPattern(40),
|
|
900
|
+
gridFadeTop: () => gridPattern(32, maskTop),
|
|
901
|
+
gridFadeBottom: () => gridPattern(32, maskBottom),
|
|
902
|
+
gridFadeCenter: () => gridPattern(40, maskCenter),
|
|
903
|
+
gridFadeTopLeft: () => gridPattern(32, maskTopLeft),
|
|
904
|
+
gridFadeTopRight: () => gridPattern(32, maskTopRight),
|
|
905
|
+
gridFadeBottomLeft: () => gridPattern(32, maskBottomLeft),
|
|
906
|
+
gridFadeBottomRight: () => gridPattern(32, maskBottomRight),
|
|
907
|
+
gridDotsBasic: () => gridDotsPattern("grid-dots-basic"),
|
|
908
|
+
gridDotsFadeCenter: () => gridDotsPattern("grid-dots-fade-center", maskCenter),
|
|
909
|
+
gradientGlowTop: () => gradientGlow("top"),
|
|
910
|
+
gradientGlowBottom: () => gradientGlow("bottom"),
|
|
911
|
+
spotlightLeft: () => spotlight("left"),
|
|
912
|
+
spotlightRight: () => spotlight("right")
|
|
913
|
+
};
|
|
914
|
+
var inlinePatternStyles = {
|
|
915
|
+
radialGradientTop: {
|
|
916
|
+
background: "radial-gradient(125% 125% at 50% 10%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
917
|
+
},
|
|
918
|
+
radialGradientBottom: {
|
|
919
|
+
background: "radial-gradient(125% 125% at 50% 90%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
920
|
+
}
|
|
921
|
+
};
|
|
922
|
+
function PatternBackground({
|
|
923
|
+
pattern,
|
|
924
|
+
opacity = 0.08,
|
|
925
|
+
className,
|
|
926
|
+
style
|
|
927
|
+
}) {
|
|
928
|
+
if (!pattern) {
|
|
929
|
+
return null;
|
|
930
|
+
}
|
|
931
|
+
if (pattern in inlinePatternStyles) {
|
|
932
|
+
const inlineStyle = inlinePatternStyles[pattern];
|
|
933
|
+
return /* @__PURE__ */ jsx(
|
|
934
|
+
"div",
|
|
820
935
|
{
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
optixFlowConfig
|
|
936
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
937
|
+
style: { ...inlineStyle, opacity, ...style },
|
|
938
|
+
"aria-hidden": "true"
|
|
825
939
|
}
|
|
826
|
-
)
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
/* @__PURE__ */ jsx(
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
940
|
+
);
|
|
941
|
+
}
|
|
942
|
+
if (pattern in patternOverlays) {
|
|
943
|
+
const Overlay = patternOverlays[pattern];
|
|
944
|
+
return /* @__PURE__ */ jsx(
|
|
945
|
+
"div",
|
|
946
|
+
{
|
|
947
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
948
|
+
style: { opacity, ...style },
|
|
949
|
+
"aria-hidden": "true",
|
|
950
|
+
children: Overlay()
|
|
951
|
+
}
|
|
952
|
+
);
|
|
953
|
+
}
|
|
954
|
+
const patternUrl = pattern in patternSvgs ? patternSvgs[pattern] : pattern;
|
|
955
|
+
return /* @__PURE__ */ jsx(
|
|
956
|
+
"div",
|
|
957
|
+
{
|
|
958
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
959
|
+
style: {
|
|
960
|
+
backgroundImage: `url(${patternUrl})`,
|
|
961
|
+
backgroundRepeat: "repeat",
|
|
962
|
+
backgroundSize: "auto",
|
|
963
|
+
opacity,
|
|
964
|
+
...style
|
|
965
|
+
},
|
|
966
|
+
"aria-hidden": "true"
|
|
967
|
+
}
|
|
968
|
+
);
|
|
969
|
+
}
|
|
970
|
+
var backgroundStyles = {
|
|
971
|
+
default: "bg-background text-foreground",
|
|
972
|
+
white: "bg-white text-dark",
|
|
973
|
+
gray: "bg-muted/30 text-foreground",
|
|
974
|
+
dark: "bg-foreground text-background",
|
|
975
|
+
transparent: "bg-transparent text-foreground",
|
|
976
|
+
gradient: "bg-linear-to-br from-primary via-primary/90 to-foreground text-primary-foreground",
|
|
977
|
+
primary: "bg-primary text-primary-foreground",
|
|
978
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
979
|
+
muted: "bg-muted text-muted-foreground"
|
|
980
|
+
};
|
|
981
|
+
var spacingStyles = {
|
|
982
|
+
none: "py-0 md:py-0",
|
|
983
|
+
sm: "py-12 md:py-16",
|
|
984
|
+
md: "py-16 md:py-24",
|
|
985
|
+
lg: "py-20 md:py-32",
|
|
986
|
+
xl: "py-24 md:py-40"
|
|
987
|
+
};
|
|
988
|
+
var Section = React6__default.forwardRef(
|
|
989
|
+
({
|
|
990
|
+
id,
|
|
991
|
+
title,
|
|
992
|
+
subtitle,
|
|
993
|
+
children,
|
|
994
|
+
className,
|
|
995
|
+
style,
|
|
996
|
+
background = "default",
|
|
997
|
+
spacing = "lg",
|
|
998
|
+
pattern,
|
|
999
|
+
patternOpacity,
|
|
1000
|
+
patternClassName,
|
|
1001
|
+
containerClassName,
|
|
1002
|
+
containerMaxWidth = "xl",
|
|
1003
|
+
...props
|
|
1004
|
+
}, ref) => {
|
|
1005
|
+
const effectivePatternOpacity = patternOpacity !== void 0 ? patternOpacity : pattern ? 1 : 0;
|
|
1006
|
+
return /* @__PURE__ */ jsxs(
|
|
1007
|
+
"section",
|
|
1008
|
+
{
|
|
1009
|
+
ref,
|
|
1010
|
+
id,
|
|
1011
|
+
className: cn(
|
|
1012
|
+
"relative",
|
|
1013
|
+
pattern ? "overflow-hidden" : null,
|
|
1014
|
+
backgroundStyles[background],
|
|
1015
|
+
spacingStyles[spacing],
|
|
1016
|
+
className
|
|
1017
|
+
),
|
|
1018
|
+
style,
|
|
1019
|
+
...props,
|
|
1020
|
+
children: [
|
|
1021
|
+
/* @__PURE__ */ jsx(
|
|
1022
|
+
PatternBackground,
|
|
1023
|
+
{
|
|
1024
|
+
pattern,
|
|
1025
|
+
opacity: effectivePatternOpacity,
|
|
1026
|
+
className: patternClassName
|
|
1027
|
+
}
|
|
1028
|
+
),
|
|
1029
|
+
/* @__PURE__ */ jsxs(
|
|
1030
|
+
Container,
|
|
1031
|
+
{
|
|
1032
|
+
maxWidth: containerMaxWidth,
|
|
1033
|
+
className: cn("relative z-10", containerClassName),
|
|
1034
|
+
children: [
|
|
1035
|
+
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "mb-12 text-center md:mb-16", children: [
|
|
1036
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "mb-2 text-sm font-semibold uppercase tracking-wider text-primary", children: subtitle }),
|
|
1037
|
+
title && /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold tracking-tight md:text-4xl lg:text-5xl", children: title })
|
|
1038
|
+
] }),
|
|
1039
|
+
children
|
|
1040
|
+
]
|
|
1041
|
+
}
|
|
1042
|
+
)
|
|
1043
|
+
]
|
|
1044
|
+
}
|
|
1045
|
+
);
|
|
1046
|
+
}
|
|
1047
|
+
);
|
|
1048
|
+
Section.displayName = "Section";
|
|
843
1049
|
function ArticleBreadcrumbSocialComponent({
|
|
844
1050
|
className,
|
|
845
1051
|
containerClassName,
|
|
@@ -874,7 +1080,11 @@ function ArticleBreadcrumbSocialComponent({
|
|
|
874
1080
|
children,
|
|
875
1081
|
enableTocTracking,
|
|
876
1082
|
enableBackToTop,
|
|
877
|
-
optixFlowConfig
|
|
1083
|
+
optixFlowConfig,
|
|
1084
|
+
background,
|
|
1085
|
+
spacing,
|
|
1086
|
+
pattern,
|
|
1087
|
+
patternOpacity
|
|
878
1088
|
}) {
|
|
879
1089
|
const author = authorProp ?? (authorName ? { name: authorName, image: authorImage, role: authorRole } : void 0);
|
|
880
1090
|
const platformLabels = {
|
|
@@ -891,11 +1101,11 @@ function ArticleBreadcrumbSocialComponent({
|
|
|
891
1101
|
"aria-label": `Share on ${platformLabels[platform] || platform.charAt(0).toUpperCase() + platform.slice(1)}`,
|
|
892
1102
|
className: void 0
|
|
893
1103
|
})) : []);
|
|
894
|
-
const [activeSection, setActiveSection] =
|
|
1104
|
+
const [activeSection, setActiveSection] = React6.useState(
|
|
895
1105
|
sections?.[0]?.id || ""
|
|
896
1106
|
);
|
|
897
|
-
const [showBackToTop, setShowBackToTop] =
|
|
898
|
-
|
|
1107
|
+
const [showBackToTop, setShowBackToTop] = React6.useState(false);
|
|
1108
|
+
React6.useEffect(() => {
|
|
899
1109
|
if (!enableTocTracking || !sections || sections.length === 0) return;
|
|
900
1110
|
const observer = new IntersectionObserver(
|
|
901
1111
|
(entries) => {
|
|
@@ -913,7 +1123,7 @@ function ArticleBreadcrumbSocialComponent({
|
|
|
913
1123
|
});
|
|
914
1124
|
return () => observer.disconnect();
|
|
915
1125
|
}, [sections, enableTocTracking]);
|
|
916
|
-
|
|
1126
|
+
React6.useEffect(() => {
|
|
917
1127
|
if (!enableBackToTop) return;
|
|
918
1128
|
const handleScroll = () => {
|
|
919
1129
|
setShowBackToTop(window.scrollY > 400);
|
|
@@ -921,15 +1131,15 @@ function ArticleBreadcrumbSocialComponent({
|
|
|
921
1131
|
window.addEventListener("scroll", handleScroll);
|
|
922
1132
|
return () => window.removeEventListener("scroll", handleScroll);
|
|
923
1133
|
}, [enableBackToTop]);
|
|
924
|
-
const scrollToTop =
|
|
1134
|
+
const scrollToTop = React6.useCallback(() => {
|
|
925
1135
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
|
926
1136
|
}, []);
|
|
927
|
-
const breadcrumbsContent =
|
|
1137
|
+
const breadcrumbsContent = React6.useMemo(() => {
|
|
928
1138
|
if (breadcrumbsSlot) return breadcrumbsSlot;
|
|
929
1139
|
if (!breadcrumbs || breadcrumbs.length === 0) return null;
|
|
930
1140
|
return /* @__PURE__ */ jsx(Breadcrumb, { className: cn("mb-8", breadcrumbClassName), children: /* @__PURE__ */ jsxs(BreadcrumbList, { children: [
|
|
931
1141
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx(Pressable, { href: "#", children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/home", size: 16 }) }) }) }),
|
|
932
|
-
breadcrumbs.map((crumb, index) => /* @__PURE__ */ jsxs(
|
|
1142
|
+
breadcrumbs.map((crumb, index) => /* @__PURE__ */ jsxs(React6.Fragment, { children: [
|
|
933
1143
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
934
1144
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx(Pressable, { href: crumb.href, children: crumb.label }) }) })
|
|
935
1145
|
] }, index)),
|
|
@@ -939,7 +1149,7 @@ function ArticleBreadcrumbSocialComponent({
|
|
|
939
1149
|
] })
|
|
940
1150
|
] }) });
|
|
941
1151
|
}, [breadcrumbsSlot, breadcrumbs, currentPage, breadcrumbClassName]);
|
|
942
|
-
const authorContent =
|
|
1152
|
+
const authorContent = React6.useMemo(() => {
|
|
943
1153
|
if (authorSlot) return authorSlot;
|
|
944
1154
|
if (!author) return null;
|
|
945
1155
|
return /* @__PURE__ */ jsxs("div", { className: cn("mt-6 flex items-center gap-4 not-prose", authorClassName), children: [
|
|
@@ -953,7 +1163,7 @@ function ArticleBreadcrumbSocialComponent({
|
|
|
953
1163
|
] })
|
|
954
1164
|
] });
|
|
955
1165
|
}, [authorSlot, author, publishDate, readTime, authorClassName]);
|
|
956
|
-
const heroMediaContent =
|
|
1166
|
+
const heroMediaContent = React6.useMemo(() => {
|
|
957
1167
|
if (heroMediaSlot) return heroMediaSlot;
|
|
958
1168
|
if (!heroImageSrc) return null;
|
|
959
1169
|
return /* @__PURE__ */ jsx(
|
|
@@ -966,7 +1176,7 @@ function ArticleBreadcrumbSocialComponent({
|
|
|
966
1176
|
}
|
|
967
1177
|
);
|
|
968
1178
|
}, [heroMediaSlot, heroImageSrc, heroImageAlt, heroImageClassName, optixFlowConfig]);
|
|
969
|
-
const tocContent =
|
|
1179
|
+
const tocContent = React6.useMemo(() => {
|
|
970
1180
|
if (tocSlot) return tocSlot;
|
|
971
1181
|
if (!sections || sections.length === 0) return null;
|
|
972
1182
|
return /* @__PURE__ */ jsxs("div", { className: cn("rounded-lg border p-4", tocClassName), children: [
|
|
@@ -974,7 +1184,7 @@ function ArticleBreadcrumbSocialComponent({
|
|
|
974
1184
|
/* @__PURE__ */ jsx("nav", { className: "space-y-2", children: sections.map((section) => {
|
|
975
1185
|
const isActive = activeSection === section.id;
|
|
976
1186
|
if (renderSectionLink) {
|
|
977
|
-
return /* @__PURE__ */ jsx(
|
|
1187
|
+
return /* @__PURE__ */ jsx(React6.Fragment, { children: renderSectionLink(section, isActive) }, section.id);
|
|
978
1188
|
}
|
|
979
1189
|
return /* @__PURE__ */ jsx(
|
|
980
1190
|
Pressable,
|
|
@@ -991,7 +1201,7 @@ function ArticleBreadcrumbSocialComponent({
|
|
|
991
1201
|
}) })
|
|
992
1202
|
] });
|
|
993
1203
|
}, [tocSlot, sections, activeSection, renderSectionLink, tocClassName]);
|
|
994
|
-
const shareButtonsContent =
|
|
1204
|
+
const shareButtonsContent = React6.useMemo(() => {
|
|
995
1205
|
if (shareSlot) return shareSlot;
|
|
996
1206
|
if (!socialLinks || socialLinks.length === 0) return null;
|
|
997
1207
|
return /* @__PURE__ */ jsxs("div", { className: cn("rounded-lg border p-4", shareClassName), children: [
|
|
@@ -1011,33 +1221,43 @@ function ArticleBreadcrumbSocialComponent({
|
|
|
1011
1221
|
)) })
|
|
1012
1222
|
] });
|
|
1013
1223
|
}, [shareSlot, socialLinks, shareClassName]);
|
|
1014
|
-
return /* @__PURE__ */ jsxs(
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1224
|
+
return /* @__PURE__ */ jsxs(
|
|
1225
|
+
Section,
|
|
1226
|
+
{
|
|
1227
|
+
background,
|
|
1228
|
+
spacing,
|
|
1229
|
+
pattern,
|
|
1230
|
+
patternOpacity,
|
|
1231
|
+
className,
|
|
1232
|
+
children: [
|
|
1233
|
+
/* @__PURE__ */ jsxs("div", { className: cn("container", containerClassName), children: [
|
|
1234
|
+
breadcrumbsContent,
|
|
1235
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-10 lg:grid-cols-[minmax(0,1fr)_280px]", children: [
|
|
1236
|
+
children && /* @__PURE__ */ jsxs("article", { className: cn("prose max-w-none dark:prose-invert", articleClassName), children: [
|
|
1237
|
+
title && (typeof title === "string" ? /* @__PURE__ */ jsx("h1", { className: cn("text-4xl font-bold tracking-tight md:text-5xl", titleClassName), children: title }) : /* @__PURE__ */ jsx("div", { className: titleClassName, children: title })),
|
|
1238
|
+
authorContent,
|
|
1239
|
+
/* @__PURE__ */ jsx(Separator, { className: "my-8" }),
|
|
1240
|
+
heroMediaContent,
|
|
1241
|
+
children
|
|
1242
|
+
] }),
|
|
1243
|
+
/* @__PURE__ */ jsx("aside", { className: cn("hidden lg:block", sidebarClassName), children: /* @__PURE__ */ jsxs("div", { className: "sticky top-8 space-y-6", children: [
|
|
1244
|
+
tocContent,
|
|
1245
|
+
shareButtonsContent
|
|
1246
|
+
] }) })
|
|
1247
|
+
] })
|
|
1024
1248
|
] }),
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/arrow-up", size: 20 })
|
|
1038
|
-
}
|
|
1039
|
-
)
|
|
1040
|
-
] });
|
|
1249
|
+
enableBackToTop && showBackToTop && /* @__PURE__ */ jsx(
|
|
1250
|
+
"button",
|
|
1251
|
+
{
|
|
1252
|
+
onClick: scrollToTop,
|
|
1253
|
+
className: "fixed bottom-8 right-8 flex h-10 w-10 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg transition-opacity hover:opacity-90",
|
|
1254
|
+
"aria-label": "Back to top",
|
|
1255
|
+
children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/arrow-up", size: 20 })
|
|
1256
|
+
}
|
|
1257
|
+
)
|
|
1258
|
+
]
|
|
1259
|
+
}
|
|
1260
|
+
);
|
|
1041
1261
|
}
|
|
1042
1262
|
|
|
1043
1263
|
export { ArticleBreadcrumbSocialComponent as ArticleBreadcrumbSocial };
|