@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';
|
|
@@ -87,7 +88,7 @@ function useNavigation({
|
|
|
87
88
|
href,
|
|
88
89
|
onClick
|
|
89
90
|
} = {}) {
|
|
90
|
-
const linkType =
|
|
91
|
+
const linkType = React6.useMemo(() => {
|
|
91
92
|
if (!href || href.trim() === "") {
|
|
92
93
|
return onClick ? "none" : "none";
|
|
93
94
|
}
|
|
@@ -108,7 +109,7 @@ function useNavigation({
|
|
|
108
109
|
return "internal";
|
|
109
110
|
}
|
|
110
111
|
}, [href, onClick]);
|
|
111
|
-
const normalizedHref =
|
|
112
|
+
const normalizedHref = React6.useMemo(() => {
|
|
112
113
|
if (!href || href.trim() === "") {
|
|
113
114
|
return void 0;
|
|
114
115
|
}
|
|
@@ -126,7 +127,7 @@ function useNavigation({
|
|
|
126
127
|
return trimmed;
|
|
127
128
|
}
|
|
128
129
|
}, [href, linkType]);
|
|
129
|
-
const target =
|
|
130
|
+
const target = React6.useMemo(() => {
|
|
130
131
|
switch (linkType) {
|
|
131
132
|
case "external":
|
|
132
133
|
return "_blank";
|
|
@@ -139,7 +140,7 @@ function useNavigation({
|
|
|
139
140
|
return void 0;
|
|
140
141
|
}
|
|
141
142
|
}, [linkType]);
|
|
142
|
-
const rel =
|
|
143
|
+
const rel = React6.useMemo(() => {
|
|
143
144
|
if (linkType === "external") {
|
|
144
145
|
return "noopener noreferrer";
|
|
145
146
|
}
|
|
@@ -148,7 +149,7 @@ function useNavigation({
|
|
|
148
149
|
const isExternal = linkType === "external";
|
|
149
150
|
const isInternal = linkType === "internal";
|
|
150
151
|
const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
|
|
151
|
-
const handleClick =
|
|
152
|
+
const handleClick = React6.useCallback(
|
|
152
153
|
(event) => {
|
|
153
154
|
if (onClick) {
|
|
154
155
|
try {
|
|
@@ -332,7 +333,7 @@ var buttonVariants = cva(baseStyles, {
|
|
|
332
333
|
size: "default"
|
|
333
334
|
}
|
|
334
335
|
});
|
|
335
|
-
var Pressable =
|
|
336
|
+
var Pressable = React6.forwardRef(
|
|
336
337
|
({
|
|
337
338
|
children,
|
|
338
339
|
className,
|
|
@@ -438,10 +439,10 @@ function DynamicIcon({
|
|
|
438
439
|
className,
|
|
439
440
|
alt
|
|
440
441
|
}) {
|
|
441
|
-
const [svgContent, setSvgContent] =
|
|
442
|
-
const [isLoading, setIsLoading] =
|
|
443
|
-
const [error, setError] =
|
|
444
|
-
const { url, iconName } =
|
|
442
|
+
const [svgContent, setSvgContent] = React6.useState(null);
|
|
443
|
+
const [isLoading, setIsLoading] = React6.useState(true);
|
|
444
|
+
const [error, setError] = React6.useState(null);
|
|
445
|
+
const { url, iconName } = React6.useMemo(() => {
|
|
445
446
|
const separator = name.includes("/") ? "/" : ":";
|
|
446
447
|
const [prefix, iconName2] = name.split(separator);
|
|
447
448
|
const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}`;
|
|
@@ -450,7 +451,7 @@ function DynamicIcon({
|
|
|
450
451
|
iconName: iconName2
|
|
451
452
|
};
|
|
452
453
|
}, [name, size]);
|
|
453
|
-
|
|
454
|
+
React6.useEffect(() => {
|
|
454
455
|
let isMounted = true;
|
|
455
456
|
const fetchSvg = async () => {
|
|
456
457
|
const cached = svgCache.get(url);
|
|
@@ -651,175 +652,379 @@ function BreadcrumbSeparator({
|
|
|
651
652
|
}
|
|
652
653
|
);
|
|
653
654
|
}
|
|
655
|
+
var maxWidthStyles = {
|
|
656
|
+
sm: "max-w-screen-sm",
|
|
657
|
+
md: "max-w-screen-md",
|
|
658
|
+
lg: "max-w-screen-lg",
|
|
659
|
+
xl: "max-w-7xl",
|
|
660
|
+
"2xl": "max-w-screen-2xl",
|
|
661
|
+
"4xl": "max-w-[1536px]",
|
|
662
|
+
full: "max-w-full"
|
|
663
|
+
};
|
|
664
|
+
var Container = React6__default.forwardRef(
|
|
665
|
+
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
666
|
+
const Component = as;
|
|
667
|
+
return /* @__PURE__ */ jsx(
|
|
668
|
+
Component,
|
|
669
|
+
{
|
|
670
|
+
ref,
|
|
671
|
+
className: cn(
|
|
672
|
+
"mx-auto w-full px-2 sm:px-4 lg:px-8",
|
|
673
|
+
maxWidthStyles[maxWidth],
|
|
674
|
+
className
|
|
675
|
+
),
|
|
676
|
+
...props,
|
|
677
|
+
children
|
|
678
|
+
}
|
|
679
|
+
);
|
|
680
|
+
}
|
|
681
|
+
);
|
|
682
|
+
Container.displayName = "Container";
|
|
654
683
|
|
|
655
|
-
// lib/
|
|
656
|
-
var
|
|
657
|
-
"https://
|
|
658
|
-
"https://
|
|
659
|
-
"https://
|
|
660
|
-
"https://
|
|
661
|
-
"https://
|
|
662
|
-
"https://
|
|
663
|
-
"https://
|
|
664
|
-
"https://
|
|
665
|
-
"https://
|
|
666
|
-
"https://
|
|
667
|
-
"https://
|
|
668
|
-
"https://
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
"
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
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
|
-
|
|
684
|
+
// lib/patternSvgs.ts
|
|
685
|
+
var patternSvgs = {
|
|
686
|
+
squareAltGrid: "https://cdn.ing/assets/files/record/286187/4gpn0yq2ptra8iwlvmwwv860ggwv",
|
|
687
|
+
grid1: "https://cdn.ing/assets/files/record/286186/nbdflpgp4ostrno079hygibsflp3",
|
|
688
|
+
noise: "https://cdn.ing/assets/i/r/286188/zrqcp9hynh3j7p2laihwzfbujgrl/noise.png",
|
|
689
|
+
dots: "https://cdn.ing/assets/files/record/286198/yfsjx9thvtxzhl2qtshxyhkrm524",
|
|
690
|
+
dotPattern: "https://cdn.ing/assets/files/record/286192/7ig0cku8aqbboiza8nuk6hw0nnsr",
|
|
691
|
+
dotPattern2: "https://cdn.ing/assets/files/record/286189/arez6gd2s7isn9i1o6c7sexdq7bl",
|
|
692
|
+
circles: "https://cdn.ing/assets/files/record/286190/gtmia3sncjtzetdshc20zf1d3c17",
|
|
693
|
+
waves: "https://cdn.ing/assets/files/record/286191/mqlb33fzxz9cdth1bx7if0wmpkp1",
|
|
694
|
+
crossPattern: "https://cdn.ing/assets/files/record/286193/9yfqwdbnqaipbp7fsb3wbzzmq472",
|
|
695
|
+
architect: "https://cdn.ing/assets/files/record/286194/vgs88ugpvyhxu13wqgy0acvae6re",
|
|
696
|
+
tinyCheckers: "https://cdn.ing/assets/files/record/286195/65efaknsw8kcpf9o3c2gybytsl5b",
|
|
697
|
+
p6: "https://cdn.ing/assets/i/r/286196/6kl0rqnd6mjk8j7e525fo8fo0vkc/p6.webp"
|
|
698
|
+
};
|
|
699
|
+
var maskTop = "radial-gradient(ellipse 70% 60% at 50% 0%, #000 60%, transparent 100%)";
|
|
700
|
+
var maskBottom = "radial-gradient(ellipse 100% 80% at 50% 100%, #000 50%, transparent 90%)";
|
|
701
|
+
var maskCenter = "radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 70%)";
|
|
702
|
+
var maskTopLeft = "radial-gradient(ellipse 80% 80% at 0% 0%, #000 50%, transparent 90%)";
|
|
703
|
+
var maskTopRight = "radial-gradient(ellipse 80% 80% at 100% 0%, #000 50%, transparent 90%)";
|
|
704
|
+
var maskBottomLeft = "radial-gradient(ellipse 80% 80% at 0% 100%, #000 50%, transparent 90%)";
|
|
705
|
+
var maskBottomRight = "radial-gradient(ellipse 80% 80% at 100% 100%, #000 50%, transparent 90%)";
|
|
706
|
+
var circuitBoardPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
707
|
+
"svg",
|
|
708
|
+
{
|
|
709
|
+
className: "h-full w-full",
|
|
710
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
711
|
+
style: mask ? {
|
|
712
|
+
maskImage: mask,
|
|
713
|
+
WebkitMaskImage: mask
|
|
714
|
+
} : void 0,
|
|
715
|
+
children: [
|
|
716
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
717
|
+
"pattern",
|
|
718
|
+
{
|
|
719
|
+
id,
|
|
720
|
+
x: "0",
|
|
721
|
+
y: "0",
|
|
722
|
+
width: "100",
|
|
723
|
+
height: "100",
|
|
724
|
+
patternUnits: "userSpaceOnUse",
|
|
725
|
+
children: [
|
|
726
|
+
/* @__PURE__ */ jsx(
|
|
727
|
+
"path",
|
|
728
|
+
{
|
|
729
|
+
d: "M0 50h40M60 50h40M50 0v40M50 60v40",
|
|
730
|
+
stroke: "hsl(var(--muted))",
|
|
731
|
+
strokeWidth: "1",
|
|
732
|
+
fill: "none"
|
|
733
|
+
}
|
|
734
|
+
),
|
|
735
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "3", fill: "hsl(var(--muted))" }),
|
|
736
|
+
/* @__PURE__ */ jsx("circle", { cx: "0", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
737
|
+
/* @__PURE__ */ jsx("circle", { cx: "100", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
738
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "0", r: "2", fill: "hsl(var(--muted))" }),
|
|
739
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "100", r: "2", fill: "hsl(var(--muted))" })
|
|
740
|
+
]
|
|
741
|
+
}
|
|
742
|
+
) }),
|
|
743
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
744
|
+
]
|
|
745
|
+
}
|
|
746
|
+
);
|
|
747
|
+
var gridDotsPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
748
|
+
"svg",
|
|
749
|
+
{
|
|
750
|
+
className: "h-full w-full",
|
|
751
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
752
|
+
style: mask ? {
|
|
753
|
+
maskImage: mask,
|
|
754
|
+
WebkitMaskImage: mask
|
|
755
|
+
} : void 0,
|
|
756
|
+
children: [
|
|
757
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
758
|
+
"pattern",
|
|
759
|
+
{
|
|
760
|
+
id,
|
|
761
|
+
x: "0",
|
|
762
|
+
y: "0",
|
|
763
|
+
width: "40",
|
|
764
|
+
height: "40",
|
|
765
|
+
patternUnits: "userSpaceOnUse",
|
|
766
|
+
children: [
|
|
767
|
+
/* @__PURE__ */ jsx(
|
|
768
|
+
"path",
|
|
769
|
+
{
|
|
770
|
+
d: "M0 20h40M20 0v40",
|
|
771
|
+
stroke: "hsl(var(--muted))",
|
|
772
|
+
strokeWidth: "0.5",
|
|
773
|
+
fill: "none"
|
|
774
|
+
}
|
|
775
|
+
),
|
|
776
|
+
/* @__PURE__ */ jsx("circle", { cx: "20", cy: "20", r: "2", fill: "hsl(var(--muted))" })
|
|
777
|
+
]
|
|
778
|
+
}
|
|
779
|
+
) }),
|
|
780
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
781
|
+
]
|
|
782
|
+
}
|
|
783
|
+
);
|
|
784
|
+
var gridPattern = (size, mask) => /* @__PURE__ */ jsx(
|
|
785
|
+
"div",
|
|
786
|
+
{
|
|
787
|
+
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)]",
|
|
788
|
+
style: {
|
|
789
|
+
backgroundSize: `${size}px ${size}px`,
|
|
790
|
+
...mask ? {
|
|
791
|
+
maskImage: mask,
|
|
792
|
+
WebkitMaskImage: mask
|
|
793
|
+
} : {}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
);
|
|
797
|
+
var diagonalCrossPattern = (mask) => /* @__PURE__ */ jsx(
|
|
798
|
+
"div",
|
|
799
|
+
{
|
|
800
|
+
className: "h-full w-full",
|
|
801
|
+
style: {
|
|
802
|
+
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)",
|
|
803
|
+
...mask ? {
|
|
804
|
+
maskImage: mask,
|
|
805
|
+
WebkitMaskImage: mask
|
|
806
|
+
} : {}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
);
|
|
810
|
+
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)";
|
|
811
|
+
var dashedGridPattern = (fadeMask) => {
|
|
812
|
+
const mask = fadeMask ? `${dashedGridMaskBase}, ${fadeMask}` : dashedGridMaskBase;
|
|
813
|
+
return /* @__PURE__ */ jsx(
|
|
814
|
+
"div",
|
|
776
815
|
{
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
816
|
+
className: "h-full w-full",
|
|
817
|
+
style: {
|
|
818
|
+
backgroundImage: "linear-gradient(to right, hsl(var(--muted)) 1px, transparent 1px), linear-gradient(to bottom, hsl(var(--muted)) 1px, transparent 1px)",
|
|
819
|
+
backgroundSize: "20px 20px",
|
|
820
|
+
backgroundPosition: "0 0, 0 0",
|
|
821
|
+
maskImage: mask,
|
|
822
|
+
WebkitMaskImage: mask,
|
|
823
|
+
maskComposite: "intersect",
|
|
824
|
+
WebkitMaskComposite: "source-in"
|
|
825
|
+
}
|
|
781
826
|
}
|
|
782
|
-
)
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
827
|
+
);
|
|
828
|
+
};
|
|
829
|
+
var gradientGlow = (position) => /* @__PURE__ */ jsx(
|
|
830
|
+
"div",
|
|
831
|
+
{
|
|
832
|
+
className: cn(
|
|
833
|
+
"pointer-events-none absolute left-1/2 z-0 aspect-square w-3/4 -translate-x-1/2 rounded-full opacity-50 blur-3xl",
|
|
834
|
+
position === "top" ? "-top-1/4" : "-bottom-1/4"
|
|
835
|
+
),
|
|
836
|
+
style: {
|
|
837
|
+
background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
);
|
|
841
|
+
var spotlight = (position) => /* @__PURE__ */ jsx(
|
|
842
|
+
"div",
|
|
843
|
+
{
|
|
844
|
+
className: cn(
|
|
845
|
+
"pointer-events-none absolute top-1/2 z-0 aspect-square w-3/4 -translate-y-1/2 rounded-full opacity-40 blur-3xl",
|
|
846
|
+
position === "left" ? "-left-1/4" : "-right-1/4"
|
|
847
|
+
),
|
|
848
|
+
style: {
|
|
849
|
+
background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
);
|
|
853
|
+
var patternOverlays = {
|
|
854
|
+
circuitBoardBasic: () => circuitBoardPattern("circuit-board-basic"),
|
|
855
|
+
circuitBoardFadeTop: () => circuitBoardPattern("circuit-board-fade-top", maskTop),
|
|
856
|
+
circuitBoardFadeBottom: () => circuitBoardPattern("circuit-board-fade-bottom", maskBottom),
|
|
857
|
+
circuitBoardFadeCenter: () => circuitBoardPattern("circuit-board-fade-center", maskCenter),
|
|
858
|
+
circuitBoardFadeTopLeft: () => circuitBoardPattern("circuit-board-fade-top-left", maskTopLeft),
|
|
859
|
+
circuitBoardFadeTopRight: () => circuitBoardPattern("circuit-board-fade-top-right", maskTopRight),
|
|
860
|
+
circuitBoardFadeBottomLeft: () => circuitBoardPattern("circuit-board-fade-bottom-left", maskBottomLeft),
|
|
861
|
+
circuitBoardFadeBottomRight: () => circuitBoardPattern("circuit-board-fade-bottom-right", maskBottomRight),
|
|
862
|
+
dashedGridBasic: () => dashedGridPattern(),
|
|
863
|
+
dashedGridFadeTop: () => dashedGridPattern(maskTop),
|
|
864
|
+
dashedGridFadeBottom: () => dashedGridPattern(maskBottom),
|
|
865
|
+
dashedGridFadeCenter: () => dashedGridPattern(maskCenter),
|
|
866
|
+
dashedGridFadeTopLeft: () => dashedGridPattern(maskTopLeft),
|
|
867
|
+
dashedGridFadeTopRight: () => dashedGridPattern(maskTopRight),
|
|
868
|
+
dashedGridFadeBottomLeft: () => dashedGridPattern(maskBottomLeft),
|
|
869
|
+
dashedGridFadeBottomRight: () => dashedGridPattern(maskBottomRight),
|
|
870
|
+
diagonalCrossBasic: () => diagonalCrossPattern(),
|
|
871
|
+
diagonalCrossFadeTop: () => diagonalCrossPattern(maskTop),
|
|
872
|
+
diagonalCrossFadeBottom: () => diagonalCrossPattern(maskBottom),
|
|
873
|
+
diagonalCrossFadeCenter: () => diagonalCrossPattern(maskCenter),
|
|
874
|
+
diagonalCrossFadeTopLeft: () => diagonalCrossPattern(maskTopLeft),
|
|
875
|
+
diagonalCrossFadeTopRight: () => diagonalCrossPattern(maskTopRight),
|
|
876
|
+
diagonalCrossFadeBottomLeft: () => diagonalCrossPattern(maskBottomLeft),
|
|
877
|
+
diagonalCrossFadeBottomRight: () => diagonalCrossPattern(maskBottomRight),
|
|
878
|
+
gridBasic: () => gridPattern(40),
|
|
879
|
+
gridFadeTop: () => gridPattern(32, maskTop),
|
|
880
|
+
gridFadeBottom: () => gridPattern(32, maskBottom),
|
|
881
|
+
gridFadeCenter: () => gridPattern(40, maskCenter),
|
|
882
|
+
gridFadeTopLeft: () => gridPattern(32, maskTopLeft),
|
|
883
|
+
gridFadeTopRight: () => gridPattern(32, maskTopRight),
|
|
884
|
+
gridFadeBottomLeft: () => gridPattern(32, maskBottomLeft),
|
|
885
|
+
gridFadeBottomRight: () => gridPattern(32, maskBottomRight),
|
|
886
|
+
gridDotsBasic: () => gridDotsPattern("grid-dots-basic"),
|
|
887
|
+
gridDotsFadeCenter: () => gridDotsPattern("grid-dots-fade-center", maskCenter),
|
|
888
|
+
gradientGlowTop: () => gradientGlow("top"),
|
|
889
|
+
gradientGlowBottom: () => gradientGlow("bottom"),
|
|
890
|
+
spotlightLeft: () => spotlight("left"),
|
|
891
|
+
spotlightRight: () => spotlight("right")
|
|
892
|
+
};
|
|
893
|
+
var inlinePatternStyles = {
|
|
894
|
+
radialGradientTop: {
|
|
895
|
+
background: "radial-gradient(125% 125% at 50% 10%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
896
|
+
},
|
|
897
|
+
radialGradientBottom: {
|
|
898
|
+
background: "radial-gradient(125% 125% at 50% 90%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
function PatternBackground({
|
|
902
|
+
pattern,
|
|
903
|
+
opacity = 0.08,
|
|
904
|
+
className,
|
|
905
|
+
style
|
|
906
|
+
}) {
|
|
907
|
+
if (!pattern) {
|
|
908
|
+
return null;
|
|
909
|
+
}
|
|
910
|
+
if (pattern in inlinePatternStyles) {
|
|
911
|
+
const inlineStyle = inlinePatternStyles[pattern];
|
|
912
|
+
return /* @__PURE__ */ jsx(
|
|
913
|
+
"div",
|
|
793
914
|
{
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
optixFlowConfig
|
|
915
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
916
|
+
style: { ...inlineStyle, opacity, ...style },
|
|
917
|
+
"aria-hidden": "true"
|
|
798
918
|
}
|
|
799
|
-
)
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
/* @__PURE__ */ jsx(
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
if (pattern in patternOverlays) {
|
|
922
|
+
const Overlay = patternOverlays[pattern];
|
|
923
|
+
return /* @__PURE__ */ jsx(
|
|
924
|
+
"div",
|
|
925
|
+
{
|
|
926
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
927
|
+
style: { opacity, ...style },
|
|
928
|
+
"aria-hidden": "true",
|
|
929
|
+
children: Overlay()
|
|
930
|
+
}
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
const patternUrl = pattern in patternSvgs ? patternSvgs[pattern] : pattern;
|
|
934
|
+
return /* @__PURE__ */ jsx(
|
|
935
|
+
"div",
|
|
936
|
+
{
|
|
937
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
938
|
+
style: {
|
|
939
|
+
backgroundImage: `url(${patternUrl})`,
|
|
940
|
+
backgroundRepeat: "repeat",
|
|
941
|
+
backgroundSize: "auto",
|
|
942
|
+
opacity,
|
|
943
|
+
...style
|
|
944
|
+
},
|
|
945
|
+
"aria-hidden": "true"
|
|
946
|
+
}
|
|
947
|
+
);
|
|
948
|
+
}
|
|
949
|
+
var backgroundStyles = {
|
|
950
|
+
default: "bg-background text-foreground",
|
|
951
|
+
white: "bg-white text-dark",
|
|
952
|
+
gray: "bg-muted/30 text-foreground",
|
|
953
|
+
dark: "bg-foreground text-background",
|
|
954
|
+
transparent: "bg-transparent text-foreground",
|
|
955
|
+
gradient: "bg-linear-to-br from-primary via-primary/90 to-foreground text-primary-foreground",
|
|
956
|
+
primary: "bg-primary text-primary-foreground",
|
|
957
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
958
|
+
muted: "bg-muted text-muted-foreground"
|
|
959
|
+
};
|
|
960
|
+
var spacingStyles = {
|
|
961
|
+
none: "py-0 md:py-0",
|
|
962
|
+
sm: "py-12 md:py-16",
|
|
963
|
+
md: "py-16 md:py-24",
|
|
964
|
+
lg: "py-20 md:py-32",
|
|
965
|
+
xl: "py-24 md:py-40"
|
|
966
|
+
};
|
|
967
|
+
var Section = React6__default.forwardRef(
|
|
968
|
+
({
|
|
969
|
+
id,
|
|
970
|
+
title,
|
|
971
|
+
subtitle,
|
|
972
|
+
children,
|
|
973
|
+
className,
|
|
974
|
+
style,
|
|
975
|
+
background = "default",
|
|
976
|
+
spacing = "lg",
|
|
977
|
+
pattern,
|
|
978
|
+
patternOpacity,
|
|
979
|
+
patternClassName,
|
|
980
|
+
containerClassName,
|
|
981
|
+
containerMaxWidth = "xl",
|
|
982
|
+
...props
|
|
983
|
+
}, ref) => {
|
|
984
|
+
const effectivePatternOpacity = patternOpacity !== void 0 ? patternOpacity : pattern ? 1 : 0;
|
|
985
|
+
return /* @__PURE__ */ jsxs(
|
|
986
|
+
"section",
|
|
987
|
+
{
|
|
988
|
+
ref,
|
|
989
|
+
id,
|
|
990
|
+
className: cn(
|
|
991
|
+
"relative",
|
|
992
|
+
pattern ? "overflow-hidden" : null,
|
|
993
|
+
backgroundStyles[background],
|
|
994
|
+
spacingStyles[spacing],
|
|
995
|
+
className
|
|
996
|
+
),
|
|
997
|
+
style,
|
|
998
|
+
...props,
|
|
999
|
+
children: [
|
|
1000
|
+
/* @__PURE__ */ jsx(
|
|
1001
|
+
PatternBackground,
|
|
1002
|
+
{
|
|
1003
|
+
pattern,
|
|
1004
|
+
opacity: effectivePatternOpacity,
|
|
1005
|
+
className: patternClassName
|
|
1006
|
+
}
|
|
1007
|
+
),
|
|
1008
|
+
/* @__PURE__ */ jsxs(
|
|
1009
|
+
Container,
|
|
1010
|
+
{
|
|
1011
|
+
maxWidth: containerMaxWidth,
|
|
1012
|
+
className: cn("relative z-10", containerClassName),
|
|
1013
|
+
children: [
|
|
1014
|
+
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "mb-12 text-center md:mb-16", children: [
|
|
1015
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "mb-2 text-sm font-semibold uppercase tracking-wider text-primary", children: subtitle }),
|
|
1016
|
+
title && /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold tracking-tight md:text-4xl lg:text-5xl", children: title })
|
|
1017
|
+
] }),
|
|
1018
|
+
children
|
|
1019
|
+
]
|
|
1020
|
+
}
|
|
1021
|
+
)
|
|
1022
|
+
]
|
|
1023
|
+
}
|
|
1024
|
+
);
|
|
1025
|
+
}
|
|
1026
|
+
);
|
|
1027
|
+
Section.displayName = "Section";
|
|
823
1028
|
function ArticleChaptersAuthorComponent({
|
|
824
1029
|
className,
|
|
825
1030
|
containerClassName,
|
|
@@ -854,13 +1059,17 @@ function ArticleChaptersAuthorComponent({
|
|
|
854
1059
|
conclusionSlot,
|
|
855
1060
|
children,
|
|
856
1061
|
enableChapterTracking = true,
|
|
857
|
-
optixFlowConfig
|
|
1062
|
+
optixFlowConfig,
|
|
1063
|
+
background,
|
|
1064
|
+
spacing,
|
|
1065
|
+
pattern,
|
|
1066
|
+
patternOpacity
|
|
858
1067
|
}) {
|
|
859
1068
|
const conclusionActions = conclusionActionsProp ?? (conclusionButtonText ? [{ label: conclusionButtonText, href: conclusionButtonHref || "#", variant: "default" }] : []);
|
|
860
|
-
const [activeChapter, setActiveChapter] =
|
|
1069
|
+
const [activeChapter, setActiveChapter] = React6.useState(
|
|
861
1070
|
chapters?.[0]?.id || ""
|
|
862
1071
|
);
|
|
863
|
-
|
|
1072
|
+
React6.useEffect(() => {
|
|
864
1073
|
if (!enableChapterTracking || !chapters || chapters.length === 0) return;
|
|
865
1074
|
const observer = new IntersectionObserver(
|
|
866
1075
|
(entries) => {
|
|
@@ -878,12 +1087,12 @@ function ArticleChaptersAuthorComponent({
|
|
|
878
1087
|
});
|
|
879
1088
|
return () => observer.disconnect();
|
|
880
1089
|
}, [chapters, enableChapterTracking]);
|
|
881
|
-
const breadcrumbsContent =
|
|
1090
|
+
const breadcrumbsContent = React6.useMemo(() => {
|
|
882
1091
|
if (breadcrumbsSlot) return breadcrumbsSlot;
|
|
883
1092
|
if (!breadcrumbs || breadcrumbs.length === 0) return null;
|
|
884
1093
|
return /* @__PURE__ */ jsx(Breadcrumb, { className: cn("mb-8", breadcrumbClassName), children: /* @__PURE__ */ jsxs(BreadcrumbList, { children: [
|
|
885
1094
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx(Pressable, { href: "#", children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/home", size: 16 }) }) }) }),
|
|
886
|
-
breadcrumbs.map((crumb, index) => /* @__PURE__ */ jsxs(
|
|
1095
|
+
breadcrumbs.map((crumb, index) => /* @__PURE__ */ jsxs(React6.Fragment, { children: [
|
|
887
1096
|
/* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
|
|
888
1097
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbLink, { asChild: true, children: /* @__PURE__ */ jsx(Pressable, { href: crumb.href, children: crumb.label }) }) })
|
|
889
1098
|
] }, index)),
|
|
@@ -891,7 +1100,7 @@ function ArticleChaptersAuthorComponent({
|
|
|
891
1100
|
/* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbPage, { children: typeof currentPage === "string" ? currentPage : currentPage }) })
|
|
892
1101
|
] }) });
|
|
893
1102
|
}, [breadcrumbsSlot, breadcrumbs, currentPage, breadcrumbClassName]);
|
|
894
|
-
const chaptersNavContent =
|
|
1103
|
+
const chaptersNavContent = React6.useMemo(() => {
|
|
895
1104
|
if (chaptersSlot) return chaptersSlot;
|
|
896
1105
|
if (!chapters || chapters.length === 0) return null;
|
|
897
1106
|
return /* @__PURE__ */ jsxs("div", { className: cn("rounded-lg border p-4", chaptersClassName), children: [
|
|
@@ -899,7 +1108,7 @@ function ArticleChaptersAuthorComponent({
|
|
|
899
1108
|
/* @__PURE__ */ jsx("nav", { className: "space-y-2", children: chapters.map((chapter) => {
|
|
900
1109
|
const isActive = activeChapter === chapter.id;
|
|
901
1110
|
if (renderChapterLink) {
|
|
902
|
-
return /* @__PURE__ */ jsx(
|
|
1111
|
+
return /* @__PURE__ */ jsx(React6.Fragment, { children: renderChapterLink(chapter, isActive) }, chapter.id);
|
|
903
1112
|
}
|
|
904
1113
|
return /* @__PURE__ */ jsxs(
|
|
905
1114
|
Pressable,
|
|
@@ -919,7 +1128,7 @@ function ArticleChaptersAuthorComponent({
|
|
|
919
1128
|
}) })
|
|
920
1129
|
] });
|
|
921
1130
|
}, [chaptersSlot, chapters, activeChapter, renderChapterLink, chaptersClassName]);
|
|
922
|
-
const authorCardContent =
|
|
1131
|
+
const authorCardContent = React6.useMemo(() => {
|
|
923
1132
|
if (authorSlot) return authorSlot;
|
|
924
1133
|
if (!author) return null;
|
|
925
1134
|
let socialLinksContent = null;
|
|
@@ -980,7 +1189,7 @@ function ArticleChaptersAuthorComponent({
|
|
|
980
1189
|
socialLinksContent
|
|
981
1190
|
] });
|
|
982
1191
|
}, [authorSlot, author, authorClassName]);
|
|
983
|
-
const heroMediaContent =
|
|
1192
|
+
const heroMediaContent = React6.useMemo(() => {
|
|
984
1193
|
if (heroMediaSlot) return heroMediaSlot;
|
|
985
1194
|
if (!heroImageSrc) return null;
|
|
986
1195
|
return /* @__PURE__ */ jsx(
|
|
@@ -993,7 +1202,7 @@ function ArticleChaptersAuthorComponent({
|
|
|
993
1202
|
}
|
|
994
1203
|
);
|
|
995
1204
|
}, [heroMediaSlot, heroImageSrc, heroImageAlt, heroImageClassName, optixFlowConfig]);
|
|
996
|
-
const conclusionContent =
|
|
1205
|
+
const conclusionContent = React6.useMemo(() => {
|
|
997
1206
|
if (conclusionSlot) return conclusionSlot;
|
|
998
1207
|
if (!conclusionTitle && !conclusionDescription && (!conclusionActions || conclusionActions.length === 0)) return null;
|
|
999
1208
|
return /* @__PURE__ */ jsxs("div", { className: cn("mt-12 rounded-lg border bg-muted/50 p-6 not-prose", conclusionClassName), children: [
|
|
@@ -1018,24 +1227,34 @@ function ArticleChaptersAuthorComponent({
|
|
|
1018
1227
|
}) })
|
|
1019
1228
|
] });
|
|
1020
1229
|
}, [conclusionSlot, conclusionTitle, conclusionDescription, conclusionActions, conclusionClassName]);
|
|
1021
|
-
return /* @__PURE__ */ jsx(
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1230
|
+
return /* @__PURE__ */ jsx(
|
|
1231
|
+
Section,
|
|
1232
|
+
{
|
|
1233
|
+
background,
|
|
1234
|
+
spacing,
|
|
1235
|
+
pattern,
|
|
1236
|
+
patternOpacity,
|
|
1237
|
+
className,
|
|
1238
|
+
children: /* @__PURE__ */ jsxs("div", { className: cn("container", containerClassName), children: [
|
|
1239
|
+
breadcrumbsContent,
|
|
1240
|
+
/* @__PURE__ */ jsxs("div", { className: cn("mb-12 text-center", headerClassName), children: [
|
|
1241
|
+
title && (typeof title === "string" ? /* @__PURE__ */ jsx("h1", { className: cn("text-4xl font-bold tracking-tight md:text-5xl lg:text-6xl", titleClassName), children: title }) : /* @__PURE__ */ jsx("div", { className: titleClassName, children: title })),
|
|
1242
|
+
subtitle && (typeof subtitle === "string" ? /* @__PURE__ */ jsx("p", { className: cn("mt-4 text-lg text-muted-foreground md:text-xl", subtitleClassName), children: subtitle }) : /* @__PURE__ */ jsx("div", { className: cn("mt-4", subtitleClassName), children: subtitle }))
|
|
1243
|
+
] }),
|
|
1244
|
+
/* @__PURE__ */ jsxs("div", { className: "grid gap-10 lg:grid-cols-[280px_minmax(0,1fr)]", children: [
|
|
1245
|
+
/* @__PURE__ */ jsx("aside", { className: cn("hidden lg:block", sidebarClassName), children: /* @__PURE__ */ jsxs("div", { className: "sticky top-8 space-y-6", children: [
|
|
1246
|
+
chaptersNavContent,
|
|
1247
|
+
authorCardContent
|
|
1248
|
+
] }) }),
|
|
1249
|
+
/* @__PURE__ */ jsxs("article", { className: cn("prose max-w-none dark:prose-invert", articleClassName), children: [
|
|
1250
|
+
heroMediaContent,
|
|
1251
|
+
children,
|
|
1252
|
+
conclusionContent
|
|
1253
|
+
] })
|
|
1254
|
+
] })
|
|
1036
1255
|
] })
|
|
1037
|
-
|
|
1038
|
-
|
|
1256
|
+
}
|
|
1257
|
+
);
|
|
1039
1258
|
}
|
|
1040
1259
|
|
|
1041
1260
|
export { ArticleChaptersAuthorComponent as ArticleChaptersAuthor };
|