@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 React5 from 'react';
|
|
3
|
+
import React5__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 = React5.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 = React5.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 = React5.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 = React5.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 = React5.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 = React5.forwardRef(
|
|
336
337
|
({
|
|
337
338
|
children,
|
|
338
339
|
className,
|
|
@@ -430,169 +431,6 @@ var Pressable = React4.forwardRef(
|
|
|
430
431
|
}
|
|
431
432
|
);
|
|
432
433
|
Pressable.displayName = "Pressable";
|
|
433
|
-
var svgCache = /* @__PURE__ */ new Map();
|
|
434
|
-
function DynamicIcon({
|
|
435
|
-
name,
|
|
436
|
-
size = 28,
|
|
437
|
-
color,
|
|
438
|
-
className,
|
|
439
|
-
alt
|
|
440
|
-
}) {
|
|
441
|
-
const [svgContent, setSvgContent] = React4.useState(null);
|
|
442
|
-
const [isLoading, setIsLoading] = React4.useState(true);
|
|
443
|
-
const [error, setError] = React4.useState(null);
|
|
444
|
-
const { url, iconName } = React4.useMemo(() => {
|
|
445
|
-
const separator = name.includes("/") ? "/" : ":";
|
|
446
|
-
const [prefix, iconName2] = name.split(separator);
|
|
447
|
-
const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}`;
|
|
448
|
-
return {
|
|
449
|
-
url: baseUrl,
|
|
450
|
-
iconName: iconName2
|
|
451
|
-
};
|
|
452
|
-
}, [name, size]);
|
|
453
|
-
React4.useEffect(() => {
|
|
454
|
-
let isMounted = true;
|
|
455
|
-
const fetchSvg = async () => {
|
|
456
|
-
const cached = svgCache.get(url);
|
|
457
|
-
if (cached) {
|
|
458
|
-
if (isMounted) {
|
|
459
|
-
setSvgContent(cached);
|
|
460
|
-
setIsLoading(false);
|
|
461
|
-
}
|
|
462
|
-
return;
|
|
463
|
-
}
|
|
464
|
-
try {
|
|
465
|
-
setIsLoading(true);
|
|
466
|
-
setError(null);
|
|
467
|
-
const response = await fetch(url);
|
|
468
|
-
if (!response.ok) {
|
|
469
|
-
throw new Error(`Failed to fetch icon: ${response.status}`);
|
|
470
|
-
}
|
|
471
|
-
let svg = await response.text();
|
|
472
|
-
svg = processSvgForCurrentColor(svg);
|
|
473
|
-
svgCache.set(url, svg);
|
|
474
|
-
if (isMounted) {
|
|
475
|
-
setSvgContent(svg);
|
|
476
|
-
setIsLoading(false);
|
|
477
|
-
}
|
|
478
|
-
} catch (err) {
|
|
479
|
-
if (isMounted) {
|
|
480
|
-
setError(err instanceof Error ? err.message : "Failed to load icon");
|
|
481
|
-
setIsLoading(false);
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
fetchSvg();
|
|
486
|
-
return () => {
|
|
487
|
-
isMounted = false;
|
|
488
|
-
};
|
|
489
|
-
}, [url]);
|
|
490
|
-
if (isLoading) {
|
|
491
|
-
return /* @__PURE__ */ jsx(
|
|
492
|
-
"span",
|
|
493
|
-
{
|
|
494
|
-
className: cn("inline-block", className),
|
|
495
|
-
style: { width: size, height: size },
|
|
496
|
-
"aria-hidden": "true"
|
|
497
|
-
}
|
|
498
|
-
);
|
|
499
|
-
}
|
|
500
|
-
if (error || !svgContent) {
|
|
501
|
-
return /* @__PURE__ */ jsx(
|
|
502
|
-
"span",
|
|
503
|
-
{
|
|
504
|
-
className: cn("inline-block", className),
|
|
505
|
-
style: { width: size, height: size },
|
|
506
|
-
role: "img",
|
|
507
|
-
"aria-label": alt || iconName
|
|
508
|
-
}
|
|
509
|
-
);
|
|
510
|
-
}
|
|
511
|
-
return /* @__PURE__ */ jsx(
|
|
512
|
-
"span",
|
|
513
|
-
{
|
|
514
|
-
className: cn("inline-flex items-center justify-center", className),
|
|
515
|
-
style: {
|
|
516
|
-
width: size,
|
|
517
|
-
height: size,
|
|
518
|
-
color: color || "inherit"
|
|
519
|
-
},
|
|
520
|
-
role: "img",
|
|
521
|
-
"aria-label": alt || iconName,
|
|
522
|
-
dangerouslySetInnerHTML: { __html: svgContent }
|
|
523
|
-
}
|
|
524
|
-
);
|
|
525
|
-
}
|
|
526
|
-
function processSvgForCurrentColor(svg) {
|
|
527
|
-
let processed = svg;
|
|
528
|
-
processed = processed.replace(
|
|
529
|
-
/stroke=["'](#000000|#000|black)["']/gi,
|
|
530
|
-
'stroke="currentColor"'
|
|
531
|
-
);
|
|
532
|
-
processed = processed.replace(
|
|
533
|
-
/fill=["'](#000000|#000|black)["']/gi,
|
|
534
|
-
'fill="currentColor"'
|
|
535
|
-
);
|
|
536
|
-
return processed;
|
|
537
|
-
}
|
|
538
|
-
var alertVariants = cva(
|
|
539
|
-
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
540
|
-
{
|
|
541
|
-
variants: {
|
|
542
|
-
variant: {
|
|
543
|
-
default: "bg-card text-card-foreground",
|
|
544
|
-
destructive: "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"
|
|
545
|
-
}
|
|
546
|
-
},
|
|
547
|
-
defaultVariants: {
|
|
548
|
-
variant: "default"
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
);
|
|
552
|
-
function Alert({
|
|
553
|
-
className,
|
|
554
|
-
variant,
|
|
555
|
-
...props
|
|
556
|
-
}) {
|
|
557
|
-
return /* @__PURE__ */ jsx(
|
|
558
|
-
"div",
|
|
559
|
-
{
|
|
560
|
-
"data-slot": "alert",
|
|
561
|
-
role: "alert",
|
|
562
|
-
className: cn(alertVariants({ variant }), className),
|
|
563
|
-
...props
|
|
564
|
-
}
|
|
565
|
-
);
|
|
566
|
-
}
|
|
567
|
-
function AlertTitle({ className, ...props }) {
|
|
568
|
-
return /* @__PURE__ */ jsx(
|
|
569
|
-
"div",
|
|
570
|
-
{
|
|
571
|
-
"data-slot": "alert-title",
|
|
572
|
-
className: cn(
|
|
573
|
-
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
574
|
-
className
|
|
575
|
-
),
|
|
576
|
-
...props
|
|
577
|
-
}
|
|
578
|
-
);
|
|
579
|
-
}
|
|
580
|
-
function AlertDescription({
|
|
581
|
-
className,
|
|
582
|
-
...props
|
|
583
|
-
}) {
|
|
584
|
-
return /* @__PURE__ */ jsx(
|
|
585
|
-
"div",
|
|
586
|
-
{
|
|
587
|
-
"data-slot": "alert-description",
|
|
588
|
-
className: cn(
|
|
589
|
-
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
590
|
-
className
|
|
591
|
-
),
|
|
592
|
-
...props
|
|
593
|
-
}
|
|
594
|
-
);
|
|
595
|
-
}
|
|
596
434
|
function Avatar({
|
|
597
435
|
className,
|
|
598
436
|
...props
|
|
@@ -670,169 +508,379 @@ function Badge({
|
|
|
670
508
|
}
|
|
671
509
|
);
|
|
672
510
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
"
|
|
677
|
-
"
|
|
678
|
-
"
|
|
679
|
-
"
|
|
680
|
-
"
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
"
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
"https://toastability-production.s3.amazonaws.com/qhz2kawawq3bbh7nusz3bvahln3v",
|
|
688
|
-
"https://toastability-production.s3.amazonaws.com/zykfhuapdqzu94ee1535gsgnvyac",
|
|
689
|
-
"https://toastability-production.s3.amazonaws.com/kh1p8y15v55ctp5ulobm4pd77etm",
|
|
690
|
-
"https://toastability-production.s3.amazonaws.com/8x62o6350p1ejm3pjrp1jwvcbh4v",
|
|
691
|
-
"https://toastability-production.s3.amazonaws.com/vvixyoo7ybq3h04q2q0kact0s5wc",
|
|
692
|
-
"https://toastability-production.s3.amazonaws.com/t502cfynqso7ntkdvmcmfc87yjkt",
|
|
693
|
-
"https://toastability-production.s3.amazonaws.com/ihgx63s5nfzp2e93e3ccljjnnrov",
|
|
694
|
-
"https://toastability-production.s3.amazonaws.com/b555hwjt7ltr81et05v5254q1ak6",
|
|
695
|
-
"https://toastability-production.s3.amazonaws.com/c4sgsy0g7o2rrjmvm9x7evxems82",
|
|
696
|
-
"https://toastability-production.s3.amazonaws.com/a3m42usevv0iet0fpfwa1fsytxmv",
|
|
697
|
-
"https://toastability-production.s3.amazonaws.com/qghzqu1i99vaubyew9s5dxcbel9l",
|
|
698
|
-
"https://toastability-production.s3.amazonaws.com/9covpitzpuuobkg1m4mfokpi0enw",
|
|
699
|
-
"https://toastability-production.s3.amazonaws.com/2d4k8d5shwg82276hzj2ztbj7mxq",
|
|
700
|
-
"https://toastability-production.s3.amazonaws.com/op92dycs7w856e2jsvx20st0nyz9",
|
|
701
|
-
"https://toastability-production.s3.amazonaws.com/f921uoblxbv8f9bmr4s2ik7xxugl",
|
|
702
|
-
"https://toastability-production.s3.amazonaws.com/gl7n7p6atndufbsm6q2ac5jeqttp",
|
|
703
|
-
"https://toastability-production.s3.amazonaws.com/sj8cs2gpbanaowqwxar1uhhwd23z",
|
|
704
|
-
"https://toastability-production.s3.amazonaws.com/hu4gmd93sp95wdyr9qijze0rgim9",
|
|
705
|
-
"https://toastability-production.s3.amazonaws.com/uh2vd59np82h8sevbmfnsha89sf1",
|
|
706
|
-
"https://toastability-production.s3.amazonaws.com/gxs6zevccphti0hdq5l9fwytprpr",
|
|
707
|
-
"https://toastability-production.s3.amazonaws.com/s4vho0wfbjhf758oife8qfuekou8",
|
|
708
|
-
"https://toastability-production.s3.amazonaws.com/1b0gd8ul22q799d62dvm3sgyll85",
|
|
709
|
-
"https://toastability-production.s3.amazonaws.com/102grjqg8aigxkj585s9x3xbxfv7",
|
|
710
|
-
"https://toastability-production.s3.amazonaws.com/dvz0441h9fxjhh88lzqbwdoyxv52",
|
|
711
|
-
"https://toastability-production.s3.amazonaws.com/50y066ms7rb5sw62u9u08jzkk8rj",
|
|
712
|
-
"https://toastability-production.s3.amazonaws.com/9uxe0jw1zl1tujy0m5yalo7m2ht8",
|
|
713
|
-
"https://toastability-production.s3.amazonaws.com/cyhcpla6me8vs936i3fw6wbhypi2",
|
|
714
|
-
"https://toastability-production.s3.amazonaws.com/6ntdz6xwid3fswjz8y0otdxmzs40",
|
|
715
|
-
"https://toastability-production.s3.amazonaws.com/y1aezpa78m2fhfvj8whcx337y9cb",
|
|
716
|
-
"https://toastability-production.s3.amazonaws.com/eoa76d31ynbg34urr6e4619la1f7",
|
|
717
|
-
"https://toastability-production.s3.amazonaws.com/0mh8a1dg7ftcqnyzgv303u501c8y",
|
|
718
|
-
"https://toastability-production.s3.amazonaws.com/vvucxqs128w2d0z3n4s2z131rq7p",
|
|
719
|
-
"https://toastability-production.s3.amazonaws.com/2rbqbw9778770i8izdeabx8v2w2k",
|
|
720
|
-
"https://toastability-production.s3.amazonaws.com/90rcw2mljzpeuxlac8q77mor15xz",
|
|
721
|
-
"https://toastability-production.s3.amazonaws.com/vh1aowwr93yz4qrzct2s4je0cxdo",
|
|
722
|
-
"https://toastability-production.s3.amazonaws.com/ssgb7unxdwdqokfvhkp7cok2v79s",
|
|
723
|
-
"https://toastability-production.s3.amazonaws.com/vvkma6b8whdkiq5nq8z4eyfe00vo",
|
|
724
|
-
"https://toastability-production.s3.amazonaws.com/9797jh6slgbf9oq6lzlimcdiuziv",
|
|
725
|
-
"https://toastability-production.s3.amazonaws.com/betxbx61fkijt0aygineplf489ze",
|
|
726
|
-
"https://toastability-production.s3.amazonaws.com/0o6d7z4mm9nzeufhv9kefrhihbip",
|
|
727
|
-
"https://toastability-production.s3.amazonaws.com/1xdx70c7gp9l883soyh5d3exesvt",
|
|
728
|
-
"https://toastability-production.s3.amazonaws.com/jhjfvkmdzktacyijd9fh6acc7o2c",
|
|
729
|
-
"https://toastability-production.s3.amazonaws.com/n001o4pfpszmyw03ubctig7kvf0e",
|
|
730
|
-
"https://toastability-production.s3.amazonaws.com/l080sx0lcx51x44dqrb8006nqf08",
|
|
731
|
-
"https://toastability-production.s3.amazonaws.com/2t36c7l0ywchaz4nys8yj2l5amae",
|
|
732
|
-
"https://toastability-production.s3.amazonaws.com/gg5qnvb4nsl2k3g4dw4ls8bsllwh",
|
|
733
|
-
"https://toastability-production.s3.amazonaws.com/3nqc7xvjy3e8d7jo1gdvbzty0oqg",
|
|
734
|
-
"https://toastability-production.s3.amazonaws.com/0kx9umbfmv881wt9dfqnohv8efgi",
|
|
735
|
-
"https://toastability-production.s3.amazonaws.com/9z0sbfnskx70vse99e3dfhper7i1",
|
|
736
|
-
"https://toastability-production.s3.amazonaws.com/9keidwrag6g7jtqr7rdwb1ryt6ht",
|
|
737
|
-
"https://toastability-production.s3.amazonaws.com/zm88vf14geh1gh0frd3yrdlb6pl8",
|
|
738
|
-
"https://toastability-production.s3.amazonaws.com/0x7ktdk01jfaoysst0emzvqevu19",
|
|
739
|
-
"https://toastability-production.s3.amazonaws.com/e83zsyvl0an0owzdmpwjnnty641x",
|
|
740
|
-
"https://toastability-production.s3.amazonaws.com/t3k42fbzq7r7j93feldqm5cj1o1n",
|
|
741
|
-
"https://toastability-production.s3.amazonaws.com/5sm6wc4no8fyzxfki5njmnv6gql5",
|
|
742
|
-
"https://toastability-production.s3.amazonaws.com/w41h7890eivogu3sr78vlwkpzz8g",
|
|
743
|
-
"https://toastability-production.s3.amazonaws.com/vrezhtksoqbw1nyo4hwnoqizrus5",
|
|
744
|
-
"https://toastability-production.s3.amazonaws.com/8qkikcd43paeqgvw9gc1032j3yup",
|
|
745
|
-
"https://toastability-production.s3.amazonaws.com/ihhq8unynafk4aikmys3rhbfibaz",
|
|
746
|
-
"https://toastability-production.s3.amazonaws.com/rews5enr9ynu6izioj66s8ec90nc",
|
|
747
|
-
"https://toastability-production.s3.amazonaws.com/6ku135fhv528eei3agnoc3zd7y75",
|
|
748
|
-
"https://toastability-production.s3.amazonaws.com/x4scuzhsozrwrg703df5wbhygkgo",
|
|
749
|
-
"https://toastability-production.s3.amazonaws.com/73e0s79u4crdu7cmjfp99j1l2v55",
|
|
750
|
-
"https://toastability-production.s3.amazonaws.com/rddfyzvfpdlbzwhgep2myppwxn05",
|
|
751
|
-
"https://toastability-production.s3.amazonaws.com/mat88x8zzdek7wpgtocjrehfivsh",
|
|
752
|
-
"https://toastability-production.s3.amazonaws.com/3vwfdbekbkskxj2mvlvu85fz787u",
|
|
753
|
-
"https://toastability-production.s3.amazonaws.com/ms4s4zyqpmboh0slez1cwat9qhw4",
|
|
754
|
-
"https://toastability-production.s3.amazonaws.com/5jsc0b4e3gxnjs81iotw2c3e6da3",
|
|
755
|
-
"https://toastability-production.s3.amazonaws.com/0g6t701zqr2r7najmdgftpeqnxmz",
|
|
756
|
-
"https://toastability-production.s3.amazonaws.com/u3p1hlbm2c1vvkwlm8h668pe132z",
|
|
757
|
-
"https://toastability-production.s3.amazonaws.com/ehgbcugs782765ke1l2dtbtzd918",
|
|
758
|
-
"https://toastability-production.s3.amazonaws.com/kka8f550on7acx1lf82xleu6zhzo",
|
|
759
|
-
"https://toastability-production.s3.amazonaws.com/67fnapqepn7f8vwt0x4nqho70hbz",
|
|
760
|
-
"https://toastability-production.s3.amazonaws.com/t4cidbsfz3z468bn45yqdrkbx7ou",
|
|
761
|
-
"https://toastability-production.s3.amazonaws.com/gq3c9qalkiomu0rzdzxymkdaazdu",
|
|
762
|
-
"https://toastability-production.s3.amazonaws.com/9ujya2tfhxja7y5s9wb7d2u8crhd",
|
|
763
|
-
"https://toastability-production.s3.amazonaws.com/hotlo54tsvl2k3eht9gg0460l9zw",
|
|
764
|
-
"https://toastability-production.s3.amazonaws.com/ytbyjrcvrghc7wl6w1g7g8fwka22",
|
|
765
|
-
"https://toastability-production.s3.amazonaws.com/uv0g605yf5mz106nrm1uspt9l0rr",
|
|
766
|
-
"https://toastability-production.s3.amazonaws.com/yrp5k5xszwpe26fquupey6a6g0uu",
|
|
767
|
-
"https://toastability-production.s3.amazonaws.com/97gctpna2hdozl1f8u5xq4ew8h0o",
|
|
768
|
-
"https://toastability-production.s3.amazonaws.com/xjtepune0scj9yjkkqgaiwlq9hls",
|
|
769
|
-
"https://toastability-production.s3.amazonaws.com/g607vblaarqctl1cvgxffhx4pw6g",
|
|
770
|
-
"https://toastability-production.s3.amazonaws.com/4xpu1ljr9c8g6qzmfum5ygjzbzpb",
|
|
771
|
-
"https://toastability-production.s3.amazonaws.com/yw5f7iwyypf4kctpr5ye5e495swt",
|
|
772
|
-
"https://toastability-production.s3.amazonaws.com/z37cidvud212bzqhhalrhvk7ipaa",
|
|
773
|
-
"https://toastability-production.s3.amazonaws.com/pfllskt7q7144l288lrnpc6gx606",
|
|
774
|
-
"https://toastability-production.s3.amazonaws.com/fokd3hxzvdtsomagbfhqooyvndyv",
|
|
775
|
-
"https://toastability-production.s3.amazonaws.com/6fffnb4phovtqkjhtzifs4rhb84u",
|
|
776
|
-
"https://toastability-production.s3.amazonaws.com/mt87xjr79wxdhjy7496v3r6m2m9t",
|
|
777
|
-
"https://toastability-production.s3.amazonaws.com/3dy9ge962uarlaf2xl7imdcviqgx",
|
|
778
|
-
"https://toastability-production.s3.amazonaws.com/okf6fg4n9yv59up8ivgcdjy3w030",
|
|
779
|
-
"https://toastability-production.s3.amazonaws.com/t7iteqw4xhtppkiws88bsoia25hv",
|
|
780
|
-
"https://toastability-production.s3.amazonaws.com/klr5tuvulkyqfb721txtu4hgzxdm",
|
|
781
|
-
"https://toastability-production.s3.amazonaws.com/9eddibiq5ovc9cvs3ekijkrjpahg",
|
|
782
|
-
"https://toastability-production.s3.amazonaws.com/3ghn8dz3g9qtt4pf4nwbriaydvzb",
|
|
783
|
-
"https://toastability-production.s3.amazonaws.com/82ykd8s8boiqaxypkulb0v0s2qiw",
|
|
784
|
-
"https://toastability-production.s3.amazonaws.com/4eqmdeanxfk6jzvigo42y5ryv2c8",
|
|
785
|
-
"https://toastability-production.s3.amazonaws.com/9ughnl9wnko2vdboib8n3wl3cxsy",
|
|
786
|
-
"https://toastability-production.s3.amazonaws.com/4xjcgtlwseruezhoh3o1ga4umhj4",
|
|
787
|
-
"https://toastability-production.s3.amazonaws.com/xwh1zzxgyd887thfm1j9lu9qnd6c",
|
|
788
|
-
"https://toastability-production.s3.amazonaws.com/ri0dqx79spe6771np76mkmno5xfd",
|
|
789
|
-
"https://toastability-production.s3.amazonaws.com/e13qu3083lkhdg7th64vb628172a",
|
|
790
|
-
"https://toastability-production.s3.amazonaws.com/w87w0fyjdol9yzwo7yywkgxidvzo"
|
|
791
|
-
];
|
|
792
|
-
var defaultArticleContent = (optixFlowConfig) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
793
|
-
/* @__PURE__ */ jsxs("section", { id: "introduction", children: [
|
|
794
|
-
/* @__PURE__ */ jsx("h2", { children: "Introduction" }),
|
|
795
|
-
/* @__PURE__ */ jsx("p", { children: "Building scalable applications requires careful consideration of architecture, design patterns, and infrastructure. In this guide, we'll explore the key principles that enable applications to grow gracefully with increasing demand." }),
|
|
796
|
-
/* @__PURE__ */ jsxs(Alert, { children: [
|
|
797
|
-
/* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/lightbulb", size: 16 }),
|
|
798
|
-
/* @__PURE__ */ jsx(AlertTitle, { children: "Pro Tip" }),
|
|
799
|
-
/* @__PURE__ */ jsx(AlertDescription, { children: "Start with a simple architecture and evolve it as your needs grow. Premature optimization can lead to unnecessary complexity." })
|
|
800
|
-
] })
|
|
801
|
-
] }),
|
|
802
|
-
/* @__PURE__ */ jsxs("section", { id: "getting-started", children: [
|
|
803
|
-
/* @__PURE__ */ jsx("h2", { children: "Getting Started" }),
|
|
804
|
-
/* @__PURE__ */ jsx("p", { children: "Before diving into complex architectural patterns, ensure you have a solid understanding of your application's requirements. Consider factors like expected traffic, data volume, and team expertise." }),
|
|
805
|
-
/* @__PURE__ */ jsx("p", { children: "A well-designed system starts with clear requirements and constraints. Document your assumptions and validate them with stakeholders before making architectural decisions." })
|
|
806
|
-
] }),
|
|
807
|
-
/* @__PURE__ */ jsxs("section", { id: "core-concepts", children: [
|
|
808
|
-
/* @__PURE__ */ jsx("h2", { children: "Core Concepts" }),
|
|
809
|
-
/* @__PURE__ */ jsx("p", { children: "Scalability encompasses both horizontal and vertical scaling strategies. Horizontal scaling adds more machines to handle load, while vertical scaling increases the capacity of existing machines." }),
|
|
810
|
-
/* @__PURE__ */ jsx(
|
|
811
|
-
Img,
|
|
511
|
+
var maxWidthStyles = {
|
|
512
|
+
sm: "max-w-screen-sm",
|
|
513
|
+
md: "max-w-screen-md",
|
|
514
|
+
lg: "max-w-screen-lg",
|
|
515
|
+
xl: "max-w-7xl",
|
|
516
|
+
"2xl": "max-w-screen-2xl",
|
|
517
|
+
"4xl": "max-w-[1536px]",
|
|
518
|
+
full: "max-w-full"
|
|
519
|
+
};
|
|
520
|
+
var Container = React5__default.forwardRef(
|
|
521
|
+
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
522
|
+
const Component = as;
|
|
523
|
+
return /* @__PURE__ */ jsx(
|
|
524
|
+
Component,
|
|
812
525
|
{
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
526
|
+
ref,
|
|
527
|
+
className: cn(
|
|
528
|
+
"mx-auto w-full px-2 sm:px-4 lg:px-8",
|
|
529
|
+
maxWidthStyles[maxWidth],
|
|
530
|
+
className
|
|
531
|
+
),
|
|
532
|
+
...props,
|
|
533
|
+
children
|
|
817
534
|
}
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
Container.displayName = "Container";
|
|
539
|
+
|
|
540
|
+
// lib/patternSvgs.ts
|
|
541
|
+
var patternSvgs = {
|
|
542
|
+
squareAltGrid: "https://cdn.ing/assets/files/record/286187/4gpn0yq2ptra8iwlvmwwv860ggwv",
|
|
543
|
+
grid1: "https://cdn.ing/assets/files/record/286186/nbdflpgp4ostrno079hygibsflp3",
|
|
544
|
+
noise: "https://cdn.ing/assets/i/r/286188/zrqcp9hynh3j7p2laihwzfbujgrl/noise.png",
|
|
545
|
+
dots: "https://cdn.ing/assets/files/record/286198/yfsjx9thvtxzhl2qtshxyhkrm524",
|
|
546
|
+
dotPattern: "https://cdn.ing/assets/files/record/286192/7ig0cku8aqbboiza8nuk6hw0nnsr",
|
|
547
|
+
dotPattern2: "https://cdn.ing/assets/files/record/286189/arez6gd2s7isn9i1o6c7sexdq7bl",
|
|
548
|
+
circles: "https://cdn.ing/assets/files/record/286190/gtmia3sncjtzetdshc20zf1d3c17",
|
|
549
|
+
waves: "https://cdn.ing/assets/files/record/286191/mqlb33fzxz9cdth1bx7if0wmpkp1",
|
|
550
|
+
crossPattern: "https://cdn.ing/assets/files/record/286193/9yfqwdbnqaipbp7fsb3wbzzmq472",
|
|
551
|
+
architect: "https://cdn.ing/assets/files/record/286194/vgs88ugpvyhxu13wqgy0acvae6re",
|
|
552
|
+
tinyCheckers: "https://cdn.ing/assets/files/record/286195/65efaknsw8kcpf9o3c2gybytsl5b",
|
|
553
|
+
p6: "https://cdn.ing/assets/i/r/286196/6kl0rqnd6mjk8j7e525fo8fo0vkc/p6.webp"
|
|
554
|
+
};
|
|
555
|
+
var maskTop = "radial-gradient(ellipse 70% 60% at 50% 0%, #000 60%, transparent 100%)";
|
|
556
|
+
var maskBottom = "radial-gradient(ellipse 100% 80% at 50% 100%, #000 50%, transparent 90%)";
|
|
557
|
+
var maskCenter = "radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 70%)";
|
|
558
|
+
var maskTopLeft = "radial-gradient(ellipse 80% 80% at 0% 0%, #000 50%, transparent 90%)";
|
|
559
|
+
var maskTopRight = "radial-gradient(ellipse 80% 80% at 100% 0%, #000 50%, transparent 90%)";
|
|
560
|
+
var maskBottomLeft = "radial-gradient(ellipse 80% 80% at 0% 100%, #000 50%, transparent 90%)";
|
|
561
|
+
var maskBottomRight = "radial-gradient(ellipse 80% 80% at 100% 100%, #000 50%, transparent 90%)";
|
|
562
|
+
var circuitBoardPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
563
|
+
"svg",
|
|
564
|
+
{
|
|
565
|
+
className: "h-full w-full",
|
|
566
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
567
|
+
style: mask ? {
|
|
568
|
+
maskImage: mask,
|
|
569
|
+
WebkitMaskImage: mask
|
|
570
|
+
} : void 0,
|
|
571
|
+
children: [
|
|
572
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
573
|
+
"pattern",
|
|
574
|
+
{
|
|
575
|
+
id,
|
|
576
|
+
x: "0",
|
|
577
|
+
y: "0",
|
|
578
|
+
width: "100",
|
|
579
|
+
height: "100",
|
|
580
|
+
patternUnits: "userSpaceOnUse",
|
|
581
|
+
children: [
|
|
582
|
+
/* @__PURE__ */ jsx(
|
|
583
|
+
"path",
|
|
584
|
+
{
|
|
585
|
+
d: "M0 50h40M60 50h40M50 0v40M50 60v40",
|
|
586
|
+
stroke: "hsl(var(--muted))",
|
|
587
|
+
strokeWidth: "1",
|
|
588
|
+
fill: "none"
|
|
589
|
+
}
|
|
590
|
+
),
|
|
591
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "3", fill: "hsl(var(--muted))" }),
|
|
592
|
+
/* @__PURE__ */ jsx("circle", { cx: "0", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
593
|
+
/* @__PURE__ */ jsx("circle", { cx: "100", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
594
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "0", r: "2", fill: "hsl(var(--muted))" }),
|
|
595
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "100", r: "2", fill: "hsl(var(--muted))" })
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
) }),
|
|
599
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
);
|
|
603
|
+
var gridDotsPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
604
|
+
"svg",
|
|
605
|
+
{
|
|
606
|
+
className: "h-full w-full",
|
|
607
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
608
|
+
style: mask ? {
|
|
609
|
+
maskImage: mask,
|
|
610
|
+
WebkitMaskImage: mask
|
|
611
|
+
} : void 0,
|
|
612
|
+
children: [
|
|
613
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
614
|
+
"pattern",
|
|
615
|
+
{
|
|
616
|
+
id,
|
|
617
|
+
x: "0",
|
|
618
|
+
y: "0",
|
|
619
|
+
width: "40",
|
|
620
|
+
height: "40",
|
|
621
|
+
patternUnits: "userSpaceOnUse",
|
|
622
|
+
children: [
|
|
623
|
+
/* @__PURE__ */ jsx(
|
|
624
|
+
"path",
|
|
625
|
+
{
|
|
626
|
+
d: "M0 20h40M20 0v40",
|
|
627
|
+
stroke: "hsl(var(--muted))",
|
|
628
|
+
strokeWidth: "0.5",
|
|
629
|
+
fill: "none"
|
|
630
|
+
}
|
|
631
|
+
),
|
|
632
|
+
/* @__PURE__ */ jsx("circle", { cx: "20", cy: "20", r: "2", fill: "hsl(var(--muted))" })
|
|
633
|
+
]
|
|
634
|
+
}
|
|
635
|
+
) }),
|
|
636
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
637
|
+
]
|
|
638
|
+
}
|
|
639
|
+
);
|
|
640
|
+
var gridPattern = (size, mask) => /* @__PURE__ */ jsx(
|
|
641
|
+
"div",
|
|
642
|
+
{
|
|
643
|
+
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)]",
|
|
644
|
+
style: {
|
|
645
|
+
backgroundSize: `${size}px ${size}px`,
|
|
646
|
+
...mask ? {
|
|
647
|
+
maskImage: mask,
|
|
648
|
+
WebkitMaskImage: mask
|
|
649
|
+
} : {}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
);
|
|
653
|
+
var diagonalCrossPattern = (mask) => /* @__PURE__ */ jsx(
|
|
654
|
+
"div",
|
|
655
|
+
{
|
|
656
|
+
className: "h-full w-full",
|
|
657
|
+
style: {
|
|
658
|
+
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)",
|
|
659
|
+
...mask ? {
|
|
660
|
+
maskImage: mask,
|
|
661
|
+
WebkitMaskImage: mask
|
|
662
|
+
} : {}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
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)";
|
|
667
|
+
var dashedGridPattern = (fadeMask) => {
|
|
668
|
+
const mask = fadeMask ? `${dashedGridMaskBase}, ${fadeMask}` : dashedGridMaskBase;
|
|
669
|
+
return /* @__PURE__ */ jsx(
|
|
670
|
+
"div",
|
|
671
|
+
{
|
|
672
|
+
className: "h-full w-full",
|
|
673
|
+
style: {
|
|
674
|
+
backgroundImage: "linear-gradient(to right, hsl(var(--muted)) 1px, transparent 1px), linear-gradient(to bottom, hsl(var(--muted)) 1px, transparent 1px)",
|
|
675
|
+
backgroundSize: "20px 20px",
|
|
676
|
+
backgroundPosition: "0 0, 0 0",
|
|
677
|
+
maskImage: mask,
|
|
678
|
+
WebkitMaskImage: mask,
|
|
679
|
+
maskComposite: "intersect",
|
|
680
|
+
WebkitMaskComposite: "source-in"
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
);
|
|
684
|
+
};
|
|
685
|
+
var gradientGlow = (position) => /* @__PURE__ */ jsx(
|
|
686
|
+
"div",
|
|
687
|
+
{
|
|
688
|
+
className: cn(
|
|
689
|
+
"pointer-events-none absolute left-1/2 z-0 aspect-square w-3/4 -translate-x-1/2 rounded-full opacity-50 blur-3xl",
|
|
690
|
+
position === "top" ? "-top-1/4" : "-bottom-1/4"
|
|
818
691
|
),
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
692
|
+
style: {
|
|
693
|
+
background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
);
|
|
697
|
+
var spotlight = (position) => /* @__PURE__ */ jsx(
|
|
698
|
+
"div",
|
|
699
|
+
{
|
|
700
|
+
className: cn(
|
|
701
|
+
"pointer-events-none absolute top-1/2 z-0 aspect-square w-3/4 -translate-y-1/2 rounded-full opacity-40 blur-3xl",
|
|
702
|
+
position === "left" ? "-left-1/4" : "-right-1/4"
|
|
703
|
+
),
|
|
704
|
+
style: {
|
|
705
|
+
background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
var patternOverlays = {
|
|
710
|
+
circuitBoardBasic: () => circuitBoardPattern("circuit-board-basic"),
|
|
711
|
+
circuitBoardFadeTop: () => circuitBoardPattern("circuit-board-fade-top", maskTop),
|
|
712
|
+
circuitBoardFadeBottom: () => circuitBoardPattern("circuit-board-fade-bottom", maskBottom),
|
|
713
|
+
circuitBoardFadeCenter: () => circuitBoardPattern("circuit-board-fade-center", maskCenter),
|
|
714
|
+
circuitBoardFadeTopLeft: () => circuitBoardPattern("circuit-board-fade-top-left", maskTopLeft),
|
|
715
|
+
circuitBoardFadeTopRight: () => circuitBoardPattern("circuit-board-fade-top-right", maskTopRight),
|
|
716
|
+
circuitBoardFadeBottomLeft: () => circuitBoardPattern("circuit-board-fade-bottom-left", maskBottomLeft),
|
|
717
|
+
circuitBoardFadeBottomRight: () => circuitBoardPattern("circuit-board-fade-bottom-right", maskBottomRight),
|
|
718
|
+
dashedGridBasic: () => dashedGridPattern(),
|
|
719
|
+
dashedGridFadeTop: () => dashedGridPattern(maskTop),
|
|
720
|
+
dashedGridFadeBottom: () => dashedGridPattern(maskBottom),
|
|
721
|
+
dashedGridFadeCenter: () => dashedGridPattern(maskCenter),
|
|
722
|
+
dashedGridFadeTopLeft: () => dashedGridPattern(maskTopLeft),
|
|
723
|
+
dashedGridFadeTopRight: () => dashedGridPattern(maskTopRight),
|
|
724
|
+
dashedGridFadeBottomLeft: () => dashedGridPattern(maskBottomLeft),
|
|
725
|
+
dashedGridFadeBottomRight: () => dashedGridPattern(maskBottomRight),
|
|
726
|
+
diagonalCrossBasic: () => diagonalCrossPattern(),
|
|
727
|
+
diagonalCrossFadeTop: () => diagonalCrossPattern(maskTop),
|
|
728
|
+
diagonalCrossFadeBottom: () => diagonalCrossPattern(maskBottom),
|
|
729
|
+
diagonalCrossFadeCenter: () => diagonalCrossPattern(maskCenter),
|
|
730
|
+
diagonalCrossFadeTopLeft: () => diagonalCrossPattern(maskTopLeft),
|
|
731
|
+
diagonalCrossFadeTopRight: () => diagonalCrossPattern(maskTopRight),
|
|
732
|
+
diagonalCrossFadeBottomLeft: () => diagonalCrossPattern(maskBottomLeft),
|
|
733
|
+
diagonalCrossFadeBottomRight: () => diagonalCrossPattern(maskBottomRight),
|
|
734
|
+
gridBasic: () => gridPattern(40),
|
|
735
|
+
gridFadeTop: () => gridPattern(32, maskTop),
|
|
736
|
+
gridFadeBottom: () => gridPattern(32, maskBottom),
|
|
737
|
+
gridFadeCenter: () => gridPattern(40, maskCenter),
|
|
738
|
+
gridFadeTopLeft: () => gridPattern(32, maskTopLeft),
|
|
739
|
+
gridFadeTopRight: () => gridPattern(32, maskTopRight),
|
|
740
|
+
gridFadeBottomLeft: () => gridPattern(32, maskBottomLeft),
|
|
741
|
+
gridFadeBottomRight: () => gridPattern(32, maskBottomRight),
|
|
742
|
+
gridDotsBasic: () => gridDotsPattern("grid-dots-basic"),
|
|
743
|
+
gridDotsFadeCenter: () => gridDotsPattern("grid-dots-fade-center", maskCenter),
|
|
744
|
+
gradientGlowTop: () => gradientGlow("top"),
|
|
745
|
+
gradientGlowBottom: () => gradientGlow("bottom"),
|
|
746
|
+
spotlightLeft: () => spotlight("left"),
|
|
747
|
+
spotlightRight: () => spotlight("right")
|
|
748
|
+
};
|
|
749
|
+
var inlinePatternStyles = {
|
|
750
|
+
radialGradientTop: {
|
|
751
|
+
background: "radial-gradient(125% 125% at 50% 10%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
752
|
+
},
|
|
753
|
+
radialGradientBottom: {
|
|
754
|
+
background: "radial-gradient(125% 125% at 50% 90%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
function PatternBackground({
|
|
758
|
+
pattern,
|
|
759
|
+
opacity = 0.08,
|
|
760
|
+
className,
|
|
761
|
+
style
|
|
762
|
+
}) {
|
|
763
|
+
if (!pattern) {
|
|
764
|
+
return null;
|
|
765
|
+
}
|
|
766
|
+
if (pattern in inlinePatternStyles) {
|
|
767
|
+
const inlineStyle = inlinePatternStyles[pattern];
|
|
768
|
+
return /* @__PURE__ */ jsx(
|
|
769
|
+
"div",
|
|
770
|
+
{
|
|
771
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
772
|
+
style: { ...inlineStyle, opacity, ...style },
|
|
773
|
+
"aria-hidden": "true"
|
|
774
|
+
}
|
|
775
|
+
);
|
|
776
|
+
}
|
|
777
|
+
if (pattern in patternOverlays) {
|
|
778
|
+
const Overlay = patternOverlays[pattern];
|
|
779
|
+
return /* @__PURE__ */ jsx(
|
|
780
|
+
"div",
|
|
781
|
+
{
|
|
782
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
783
|
+
style: { opacity, ...style },
|
|
784
|
+
"aria-hidden": "true",
|
|
785
|
+
children: Overlay()
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
const patternUrl = pattern in patternSvgs ? patternSvgs[pattern] : pattern;
|
|
790
|
+
return /* @__PURE__ */ jsx(
|
|
791
|
+
"div",
|
|
792
|
+
{
|
|
793
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
794
|
+
style: {
|
|
795
|
+
backgroundImage: `url(${patternUrl})`,
|
|
796
|
+
backgroundRepeat: "repeat",
|
|
797
|
+
backgroundSize: "auto",
|
|
798
|
+
opacity,
|
|
799
|
+
...style
|
|
800
|
+
},
|
|
801
|
+
"aria-hidden": "true"
|
|
802
|
+
}
|
|
803
|
+
);
|
|
804
|
+
}
|
|
805
|
+
var backgroundStyles = {
|
|
806
|
+
default: "bg-background text-foreground",
|
|
807
|
+
white: "bg-white text-dark",
|
|
808
|
+
gray: "bg-muted/30 text-foreground",
|
|
809
|
+
dark: "bg-foreground text-background",
|
|
810
|
+
transparent: "bg-transparent text-foreground",
|
|
811
|
+
gradient: "bg-linear-to-br from-primary via-primary/90 to-foreground text-primary-foreground",
|
|
812
|
+
primary: "bg-primary text-primary-foreground",
|
|
813
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
814
|
+
muted: "bg-muted text-muted-foreground"
|
|
815
|
+
};
|
|
816
|
+
var spacingStyles = {
|
|
817
|
+
none: "py-0 md:py-0",
|
|
818
|
+
sm: "py-12 md:py-16",
|
|
819
|
+
md: "py-16 md:py-24",
|
|
820
|
+
lg: "py-20 md:py-32",
|
|
821
|
+
xl: "py-24 md:py-40"
|
|
822
|
+
};
|
|
823
|
+
var Section = React5__default.forwardRef(
|
|
824
|
+
({
|
|
825
|
+
id,
|
|
826
|
+
title,
|
|
827
|
+
subtitle,
|
|
828
|
+
children,
|
|
829
|
+
className,
|
|
830
|
+
style,
|
|
831
|
+
background = "default",
|
|
832
|
+
spacing = "lg",
|
|
833
|
+
pattern,
|
|
834
|
+
patternOpacity,
|
|
835
|
+
patternClassName,
|
|
836
|
+
containerClassName,
|
|
837
|
+
containerMaxWidth = "xl",
|
|
838
|
+
...props
|
|
839
|
+
}, ref) => {
|
|
840
|
+
const effectivePatternOpacity = patternOpacity !== void 0 ? patternOpacity : pattern ? 1 : 0;
|
|
841
|
+
return /* @__PURE__ */ jsxs(
|
|
842
|
+
"section",
|
|
843
|
+
{
|
|
844
|
+
ref,
|
|
845
|
+
id,
|
|
846
|
+
className: cn(
|
|
847
|
+
"relative",
|
|
848
|
+
pattern ? "overflow-hidden" : null,
|
|
849
|
+
backgroundStyles[background],
|
|
850
|
+
spacingStyles[spacing],
|
|
851
|
+
className
|
|
852
|
+
),
|
|
853
|
+
style,
|
|
854
|
+
...props,
|
|
855
|
+
children: [
|
|
856
|
+
/* @__PURE__ */ jsx(
|
|
857
|
+
PatternBackground,
|
|
858
|
+
{
|
|
859
|
+
pattern,
|
|
860
|
+
opacity: effectivePatternOpacity,
|
|
861
|
+
className: patternClassName
|
|
862
|
+
}
|
|
863
|
+
),
|
|
864
|
+
/* @__PURE__ */ jsxs(
|
|
865
|
+
Container,
|
|
866
|
+
{
|
|
867
|
+
maxWidth: containerMaxWidth,
|
|
868
|
+
className: cn("relative z-10", containerClassName),
|
|
869
|
+
children: [
|
|
870
|
+
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "mb-12 text-center md:mb-16", children: [
|
|
871
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "mb-2 text-sm font-semibold uppercase tracking-wider text-primary", children: subtitle }),
|
|
872
|
+
title && /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold tracking-tight md:text-4xl lg:text-5xl", children: title })
|
|
873
|
+
] }),
|
|
874
|
+
children
|
|
875
|
+
]
|
|
876
|
+
}
|
|
877
|
+
)
|
|
878
|
+
]
|
|
879
|
+
}
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
);
|
|
883
|
+
Section.displayName = "Section";
|
|
836
884
|
function ArticleTocSidebarComponent({
|
|
837
885
|
className,
|
|
838
886
|
containerClassName,
|
|
@@ -869,13 +917,17 @@ function ArticleTocSidebarComponent({
|
|
|
869
917
|
ctaSlot,
|
|
870
918
|
children,
|
|
871
919
|
enableTocTracking = true,
|
|
872
|
-
optixFlowConfig
|
|
920
|
+
optixFlowConfig,
|
|
921
|
+
background,
|
|
922
|
+
spacing,
|
|
923
|
+
pattern,
|
|
924
|
+
patternOpacity
|
|
873
925
|
}) {
|
|
874
926
|
const ctaActions = ctaActionsProp ?? (ctaButtonText ? [{ label: ctaButtonText, href: ctaButtonHref || "#", variant: "default", className: "w-full" }] : []);
|
|
875
|
-
const [activeSection, setActiveSection] =
|
|
927
|
+
const [activeSection, setActiveSection] = React5.useState(
|
|
876
928
|
sections?.[0]?.id || ""
|
|
877
929
|
);
|
|
878
|
-
|
|
930
|
+
React5.useEffect(() => {
|
|
879
931
|
if (!enableTocTracking || !sections || sections.length === 0) return;
|
|
880
932
|
const observer = new IntersectionObserver(
|
|
881
933
|
(entries) => {
|
|
@@ -893,12 +945,12 @@ function ArticleTocSidebarComponent({
|
|
|
893
945
|
});
|
|
894
946
|
return () => observer.disconnect();
|
|
895
947
|
}, [sections, enableTocTracking]);
|
|
896
|
-
const categoryContent =
|
|
948
|
+
const categoryContent = React5.useMemo(() => {
|
|
897
949
|
if (categorySlot) return categorySlot;
|
|
898
950
|
if (!category) return null;
|
|
899
951
|
return /* @__PURE__ */ jsx(Badge, { variant: "secondary", children: category });
|
|
900
952
|
}, [categorySlot, category]);
|
|
901
|
-
const authorContent =
|
|
953
|
+
const authorContent = React5.useMemo(() => {
|
|
902
954
|
if (authorSlot) return authorSlot;
|
|
903
955
|
if (!authorName) return null;
|
|
904
956
|
return /* @__PURE__ */ jsxs("div", { className: cn("mt-6 flex items-center gap-4", authorClassName), children: [
|
|
@@ -918,7 +970,7 @@ function ArticleTocSidebarComponent({
|
|
|
918
970
|
] })
|
|
919
971
|
] });
|
|
920
972
|
}, [authorSlot, authorName, authorImage, authorHref, publishDate, readTime, authorClassName]);
|
|
921
|
-
const heroMediaContent =
|
|
973
|
+
const heroMediaContent = React5.useMemo(() => {
|
|
922
974
|
if (heroMediaSlot) return heroMediaSlot;
|
|
923
975
|
if (!heroImageSrc) return null;
|
|
924
976
|
return /* @__PURE__ */ jsx(
|
|
@@ -931,7 +983,7 @@ function ArticleTocSidebarComponent({
|
|
|
931
983
|
}
|
|
932
984
|
);
|
|
933
985
|
}, [heroMediaSlot, heroImageSrc, heroImageAlt, heroImageClassName, optixFlowConfig]);
|
|
934
|
-
const tocContent =
|
|
986
|
+
const tocContent = React5.useMemo(() => {
|
|
935
987
|
if (tocSlot) return tocSlot;
|
|
936
988
|
if (!sections || sections.length === 0) return null;
|
|
937
989
|
return /* @__PURE__ */ jsxs("div", { className: cn("rounded-lg border p-4", tocClassName), children: [
|
|
@@ -939,7 +991,7 @@ function ArticleTocSidebarComponent({
|
|
|
939
991
|
/* @__PURE__ */ jsx("nav", { className: "space-y-2", children: sections.map((section) => {
|
|
940
992
|
const isActive = activeSection === section.id;
|
|
941
993
|
if (renderSectionLink) {
|
|
942
|
-
return /* @__PURE__ */ jsx(
|
|
994
|
+
return /* @__PURE__ */ jsx(React5.Fragment, { children: renderSectionLink(section, isActive) }, section.id);
|
|
943
995
|
}
|
|
944
996
|
return /* @__PURE__ */ jsx(
|
|
945
997
|
Pressable,
|
|
@@ -956,7 +1008,7 @@ function ArticleTocSidebarComponent({
|
|
|
956
1008
|
}) })
|
|
957
1009
|
] });
|
|
958
1010
|
}, [tocSlot, sections, activeSection, renderSectionLink, tocClassName]);
|
|
959
|
-
const ctaContent =
|
|
1011
|
+
const ctaContent = React5.useMemo(() => {
|
|
960
1012
|
if (ctaSlot) return ctaSlot;
|
|
961
1013
|
if (!ctaTitle && !ctaDescription && (!ctaActions || ctaActions.length === 0)) return null;
|
|
962
1014
|
return /* @__PURE__ */ jsxs("div", { className: cn("rounded-lg border bg-muted/50 p-4", ctaClassName), children: [
|
|
@@ -981,22 +1033,32 @@ function ArticleTocSidebarComponent({
|
|
|
981
1033
|
}) })
|
|
982
1034
|
] });
|
|
983
1035
|
}, [ctaSlot, ctaTitle, ctaDescription, ctaActions, ctaClassName]);
|
|
984
|
-
return /* @__PURE__ */ jsx(
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1036
|
+
return /* @__PURE__ */ jsx(
|
|
1037
|
+
Section,
|
|
1038
|
+
{
|
|
1039
|
+
background,
|
|
1040
|
+
spacing,
|
|
1041
|
+
pattern,
|
|
1042
|
+
patternOpacity,
|
|
1043
|
+
className,
|
|
1044
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("container", containerClassName), children: /* @__PURE__ */ jsxs("div", { className: "grid gap-10 lg:grid-cols-[minmax(0,1fr)_300px]", children: [
|
|
1045
|
+
/* @__PURE__ */ jsxs("article", { className: cn("prose max-w-none dark:prose-invert", articleClassName), children: [
|
|
1046
|
+
/* @__PURE__ */ jsxs("div", { className: cn("mb-8 not-prose", headerClassName), children: [
|
|
1047
|
+
categoryContent,
|
|
1048
|
+
title && (typeof title === "string" ? /* @__PURE__ */ jsx("h1", { className: cn("mt-4 text-4xl font-bold tracking-tight md:text-5xl", titleClassName), children: title }) : /* @__PURE__ */ jsx("div", { className: cn("mt-4", titleClassName), children: title })),
|
|
1049
|
+
description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("mt-4 text-lg text-muted-foreground", descriptionClassName), children: description }) : /* @__PURE__ */ jsx("div", { className: cn("mt-4", descriptionClassName), children: description })),
|
|
1050
|
+
authorContent
|
|
1051
|
+
] }),
|
|
1052
|
+
heroMediaContent,
|
|
1053
|
+
children
|
|
1054
|
+
] }),
|
|
1055
|
+
/* @__PURE__ */ jsx("aside", { className: cn("hidden lg:block", sidebarClassName), children: /* @__PURE__ */ jsxs("div", { className: "sticky top-8 space-y-6", children: [
|
|
1056
|
+
tocContent,
|
|
1057
|
+
ctaContent
|
|
1058
|
+
] }) })
|
|
1059
|
+
] }) })
|
|
1060
|
+
}
|
|
1061
|
+
);
|
|
1000
1062
|
}
|
|
1001
1063
|
|
|
1002
1064
|
export { ArticleTocSidebarComponent as ArticleTocSidebar };
|