@opensite/ui 3.5.0 → 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hero-tech-carousel.cjs +490 -292
- package/dist/hero-tech-carousel.d.cts +137 -32
- package/dist/hero-tech-carousel.d.ts +137 -32
- package/dist/hero-tech-carousel.js +491 -289
- package/dist/navbar-platform-resources.cjs +21 -21
- package/dist/navbar-platform-resources.d.cts +6 -6
- package/dist/navbar-platform-resources.d.ts +6 -6
- package/dist/navbar-platform-resources.js +21 -21
- package/dist/registry.cjs +302 -193
- package/dist/registry.js +302 -193
- package/package.json +1 -1
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var Autoplay = require('embla-carousel-autoplay');
|
|
4
|
+
var React3 = require('react');
|
|
6
5
|
var clsx = require('clsx');
|
|
7
6
|
var tailwindMerge = require('tailwind-merge');
|
|
8
7
|
var img = require('@page-speed/img');
|
|
9
|
-
var useEmblaCarousel = require('embla-carousel-react');
|
|
10
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var react = require('motion/react');
|
|
10
|
+
var pressable = require('@page-speed/pressable');
|
|
13
11
|
|
|
14
12
|
function _interopNamespace(e) {
|
|
15
13
|
if (e && e.__esModule) return e;
|
|
@@ -29,143 +27,12 @@ function _interopNamespace(e) {
|
|
|
29
27
|
return Object.freeze(n);
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
var
|
|
33
|
-
var Autoplay__default = /*#__PURE__*/_interopDefault(Autoplay);
|
|
34
|
-
var useEmblaCarousel__default = /*#__PURE__*/_interopDefault(useEmblaCarousel);
|
|
30
|
+
var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
|
|
35
31
|
|
|
36
32
|
// components/blocks/hero/hero-tech-carousel.tsx
|
|
37
33
|
function cn(...inputs) {
|
|
38
34
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
39
35
|
}
|
|
40
|
-
var CarouselContext = React__namespace.createContext(null);
|
|
41
|
-
function useCarousel() {
|
|
42
|
-
const context = React__namespace.useContext(CarouselContext);
|
|
43
|
-
if (!context) {
|
|
44
|
-
throw new Error("useCarousel must be used within a <Carousel />");
|
|
45
|
-
}
|
|
46
|
-
return context;
|
|
47
|
-
}
|
|
48
|
-
function Carousel({
|
|
49
|
-
orientation = "horizontal",
|
|
50
|
-
opts,
|
|
51
|
-
setApi,
|
|
52
|
-
plugins,
|
|
53
|
-
className,
|
|
54
|
-
children,
|
|
55
|
-
...props
|
|
56
|
-
}) {
|
|
57
|
-
const [carouselRef, api] = useEmblaCarousel__default.default(
|
|
58
|
-
{
|
|
59
|
-
...opts,
|
|
60
|
-
axis: orientation === "horizontal" ? "x" : "y"
|
|
61
|
-
},
|
|
62
|
-
plugins
|
|
63
|
-
);
|
|
64
|
-
const [canScrollPrev, setCanScrollPrev] = React__namespace.useState(false);
|
|
65
|
-
const [canScrollNext, setCanScrollNext] = React__namespace.useState(false);
|
|
66
|
-
const onSelect = React__namespace.useCallback((api2) => {
|
|
67
|
-
if (!api2) return;
|
|
68
|
-
setCanScrollPrev(api2.canScrollPrev());
|
|
69
|
-
setCanScrollNext(api2.canScrollNext());
|
|
70
|
-
}, []);
|
|
71
|
-
const scrollPrev = React__namespace.useCallback(() => {
|
|
72
|
-
api?.scrollPrev();
|
|
73
|
-
}, [api]);
|
|
74
|
-
const scrollNext = React__namespace.useCallback(() => {
|
|
75
|
-
api?.scrollNext();
|
|
76
|
-
}, [api]);
|
|
77
|
-
const handleKeyDown = React__namespace.useCallback(
|
|
78
|
-
(event) => {
|
|
79
|
-
if (event.key === "ArrowLeft") {
|
|
80
|
-
event.preventDefault();
|
|
81
|
-
scrollPrev();
|
|
82
|
-
} else if (event.key === "ArrowRight") {
|
|
83
|
-
event.preventDefault();
|
|
84
|
-
scrollNext();
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
[scrollPrev, scrollNext]
|
|
88
|
-
);
|
|
89
|
-
React__namespace.useEffect(() => {
|
|
90
|
-
if (!api || !setApi) return;
|
|
91
|
-
setApi(api);
|
|
92
|
-
}, [api, setApi]);
|
|
93
|
-
React__namespace.useEffect(() => {
|
|
94
|
-
if (!api) return;
|
|
95
|
-
onSelect(api);
|
|
96
|
-
api.on("reInit", onSelect);
|
|
97
|
-
api.on("select", onSelect);
|
|
98
|
-
return () => {
|
|
99
|
-
api?.off("select", onSelect);
|
|
100
|
-
};
|
|
101
|
-
}, [api, onSelect]);
|
|
102
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
103
|
-
CarouselContext.Provider,
|
|
104
|
-
{
|
|
105
|
-
value: {
|
|
106
|
-
carouselRef,
|
|
107
|
-
api,
|
|
108
|
-
opts,
|
|
109
|
-
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
110
|
-
scrollPrev,
|
|
111
|
-
scrollNext,
|
|
112
|
-
canScrollPrev,
|
|
113
|
-
canScrollNext
|
|
114
|
-
},
|
|
115
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
116
|
-
"div",
|
|
117
|
-
{
|
|
118
|
-
onKeyDownCapture: handleKeyDown,
|
|
119
|
-
className: cn("relative", className),
|
|
120
|
-
role: "region",
|
|
121
|
-
"aria-roledescription": "carousel",
|
|
122
|
-
"data-slot": "carousel",
|
|
123
|
-
...props,
|
|
124
|
-
children
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
function CarouselContent({ className, ...props }) {
|
|
131
|
-
const { carouselRef, orientation } = useCarousel();
|
|
132
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
133
|
-
"div",
|
|
134
|
-
{
|
|
135
|
-
ref: carouselRef,
|
|
136
|
-
className: "overflow-hidden",
|
|
137
|
-
"data-slot": "carousel-content",
|
|
138
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
139
|
-
"div",
|
|
140
|
-
{
|
|
141
|
-
className: cn(
|
|
142
|
-
"flex",
|
|
143
|
-
orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
|
|
144
|
-
className
|
|
145
|
-
),
|
|
146
|
-
...props
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
function CarouselItem({ className, ...props }) {
|
|
153
|
-
const { orientation } = useCarousel();
|
|
154
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
155
|
-
"div",
|
|
156
|
-
{
|
|
157
|
-
role: "group",
|
|
158
|
-
"aria-roledescription": "slide",
|
|
159
|
-
"data-slot": "carousel-item",
|
|
160
|
-
className: cn(
|
|
161
|
-
"min-w-0 shrink-0 grow-0 basis-full",
|
|
162
|
-
orientation === "horizontal" ? "pl-4" : "pt-4",
|
|
163
|
-
className
|
|
164
|
-
),
|
|
165
|
-
...props
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
36
|
var maxWidthStyles = {
|
|
170
37
|
sm: "max-w-screen-sm",
|
|
171
38
|
md: "max-w-screen-md",
|
|
@@ -175,7 +42,7 @@ var maxWidthStyles = {
|
|
|
175
42
|
"4xl": "max-w-[1536px]",
|
|
176
43
|
full: "max-w-full"
|
|
177
44
|
};
|
|
178
|
-
var Container =
|
|
45
|
+
var Container = React3__namespace.default.forwardRef(
|
|
179
46
|
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
180
47
|
const Component = as;
|
|
181
48
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -481,7 +348,7 @@ var spacingStyles = {
|
|
|
481
348
|
};
|
|
482
349
|
var predefinedSpacings = ["none", "sm", "md", "lg", "xl", "hero"];
|
|
483
350
|
var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
|
|
484
|
-
var Section =
|
|
351
|
+
var Section = React3__namespace.default.forwardRef(
|
|
485
352
|
({
|
|
486
353
|
id,
|
|
487
354
|
title,
|
|
@@ -542,105 +409,479 @@ var Section = React__namespace.default.forwardRef(
|
|
|
542
409
|
}
|
|
543
410
|
);
|
|
544
411
|
Section.displayName = "Section";
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
412
|
+
var slideVariants = {
|
|
413
|
+
initial: {
|
|
414
|
+
scale: 0.98,
|
|
415
|
+
opacity: 0,
|
|
416
|
+
rotateX: 12
|
|
417
|
+
},
|
|
418
|
+
visible: {
|
|
419
|
+
scale: 1,
|
|
420
|
+
rotateX: 0,
|
|
421
|
+
opacity: 1,
|
|
422
|
+
transition: {
|
|
423
|
+
duration: 0.55,
|
|
424
|
+
ease: [0.645, 0.045, 0.355, 1]
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
upExit: {
|
|
428
|
+
opacity: 0.8,
|
|
429
|
+
y: "-120%",
|
|
430
|
+
transition: {
|
|
431
|
+
duration: 0.8
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
downExit: {
|
|
435
|
+
opacity: 0.8,
|
|
436
|
+
y: "120%",
|
|
437
|
+
transition: {
|
|
438
|
+
duration: 0.8
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
var normalizeIndex = (index, length) => {
|
|
443
|
+
if (!length) return 0;
|
|
444
|
+
const safeIndex = index % length;
|
|
445
|
+
return safeIndex < 0 ? safeIndex + length : safeIndex;
|
|
446
|
+
};
|
|
447
|
+
var ImageSlider = ({
|
|
448
|
+
images,
|
|
449
|
+
children,
|
|
450
|
+
overlay = true,
|
|
451
|
+
overlaySlot,
|
|
452
|
+
overlayClassName,
|
|
555
453
|
className,
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
454
|
+
imageClassName,
|
|
455
|
+
contentClassName,
|
|
456
|
+
autoplay = true,
|
|
457
|
+
autoplayIntervalMs = 6e3,
|
|
458
|
+
direction = "up",
|
|
459
|
+
transition = "slide",
|
|
460
|
+
startIndex = 0,
|
|
461
|
+
enableKeyboard = true,
|
|
462
|
+
onSlideChange,
|
|
560
463
|
optixFlowConfig
|
|
561
|
-
}) {
|
|
562
|
-
const
|
|
563
|
-
|
|
464
|
+
}) => {
|
|
465
|
+
const hasImages = images.length > 0;
|
|
466
|
+
const [currentIndex, setCurrentIndex] = React3__namespace.useState(
|
|
467
|
+
() => normalizeIndex(startIndex, images.length)
|
|
564
468
|
);
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
469
|
+
const handleNext = React3__namespace.useCallback(() => {
|
|
470
|
+
if (!hasImages) return;
|
|
471
|
+
setCurrentIndex((prevIndex) => {
|
|
472
|
+
const nextIndex = prevIndex + 1 >= images.length ? 0 : prevIndex + 1;
|
|
473
|
+
onSlideChange?.(nextIndex);
|
|
474
|
+
return nextIndex;
|
|
475
|
+
});
|
|
476
|
+
}, [hasImages, images.length, onSlideChange]);
|
|
477
|
+
const handlePrevious = React3__namespace.useCallback(() => {
|
|
478
|
+
if (!hasImages) return;
|
|
479
|
+
setCurrentIndex((prevIndex) => {
|
|
480
|
+
const nextIndex = prevIndex - 1 < 0 ? images.length - 1 : prevIndex - 1;
|
|
481
|
+
onSlideChange?.(nextIndex);
|
|
482
|
+
return nextIndex;
|
|
483
|
+
});
|
|
484
|
+
}, [hasImages, images.length, onSlideChange]);
|
|
485
|
+
React3__namespace.useEffect(() => {
|
|
486
|
+
if (!hasImages) return;
|
|
487
|
+
setCurrentIndex(normalizeIndex(startIndex, images.length));
|
|
488
|
+
}, [startIndex, images.length, hasImages]);
|
|
489
|
+
React3__namespace.useEffect(() => {
|
|
490
|
+
if (!enableKeyboard || !hasImages) return;
|
|
491
|
+
const handleKeyDown = (event) => {
|
|
492
|
+
if (event.key === "ArrowRight") {
|
|
493
|
+
handleNext();
|
|
494
|
+
} else if (event.key === "ArrowLeft") {
|
|
495
|
+
handlePrevious();
|
|
496
|
+
}
|
|
577
497
|
};
|
|
578
|
-
|
|
579
|
-
api.on("settle", updateCurrent);
|
|
498
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
580
499
|
return () => {
|
|
581
|
-
|
|
582
|
-
api.off("settle", updateCurrent);
|
|
500
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
583
501
|
};
|
|
584
|
-
}, [
|
|
585
|
-
|
|
586
|
-
if (
|
|
587
|
-
|
|
502
|
+
}, [enableKeyboard, handleNext, handlePrevious, hasImages]);
|
|
503
|
+
React3__namespace.useEffect(() => {
|
|
504
|
+
if (!autoplay || images.length < 2) return;
|
|
505
|
+
const interval = window.setInterval(handleNext, autoplayIntervalMs);
|
|
506
|
+
return () => window.clearInterval(interval);
|
|
507
|
+
}, [autoplay, autoplayIntervalMs, handleNext, images.length]);
|
|
508
|
+
const activeImage = hasImages ? images[currentIndex] : null;
|
|
509
|
+
const overlayContent = overlaySlot ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("absolute inset-0 z-10", overlayClassName), children: overlaySlot }) : overlay ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
510
|
+
"div",
|
|
511
|
+
{
|
|
512
|
+
className: cn(
|
|
513
|
+
"absolute inset-0 z-10 bg-linear-to-b from-black/35 via-black/50 to-black/70",
|
|
514
|
+
overlayClassName
|
|
515
|
+
)
|
|
588
516
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
onMouseLeave: plugin.current.reset,
|
|
604
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(CarouselContent, { children: technologies.map((technology, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
605
|
-
CarouselItem,
|
|
517
|
+
) : null;
|
|
518
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
519
|
+
"div",
|
|
520
|
+
{
|
|
521
|
+
className: cn(
|
|
522
|
+
"relative flex min-h-[420px] w-full items-center justify-center overflow-hidden rounded-3xl border border-border/40 bg-muted/30 shadow-2xl",
|
|
523
|
+
className
|
|
524
|
+
),
|
|
525
|
+
style: {
|
|
526
|
+
perspective: "1000px"
|
|
527
|
+
},
|
|
528
|
+
children: [
|
|
529
|
+
transition === "fade" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0", children: images.map((image, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
530
|
+
"div",
|
|
606
531
|
{
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
"
|
|
532
|
+
"aria-hidden": index !== currentIndex,
|
|
533
|
+
className: cn(
|
|
534
|
+
"absolute inset-0 opacity-0 transition-opacity duration-1000 ease-in-out motion-reduce:transition-none",
|
|
535
|
+
index === currentIndex && "opacity-100"
|
|
536
|
+
),
|
|
537
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
538
|
+
img.Img,
|
|
610
539
|
{
|
|
540
|
+
src: image.src,
|
|
541
|
+
alt: image.alt,
|
|
611
542
|
className: cn(
|
|
612
|
-
"
|
|
613
|
-
|
|
543
|
+
"h-full w-full object-cover object-center",
|
|
544
|
+
imageClassName,
|
|
545
|
+
image.className
|
|
614
546
|
),
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
technology.logo && /* @__PURE__ */ jsxRuntime.jsx(
|
|
618
|
-
img.Img,
|
|
619
|
-
{
|
|
620
|
-
className: "h-4 shrink-0 md:h-7",
|
|
621
|
-
src: technology.logo,
|
|
622
|
-
alt: technology.name,
|
|
623
|
-
optixFlowConfig
|
|
624
|
-
}
|
|
625
|
-
),
|
|
626
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-nowrap", children: technology.name })
|
|
627
|
-
]
|
|
547
|
+
optixFlowConfig: image.optixFlowConfig ?? optixFlowConfig,
|
|
548
|
+
loading: "eager"
|
|
628
549
|
}
|
|
629
550
|
)
|
|
630
551
|
},
|
|
631
|
-
|
|
632
|
-
)) })
|
|
552
|
+
`${image.src ?? "image"}-${index}`
|
|
553
|
+
)) }) : /* @__PURE__ */ jsxRuntime.jsx(react.AnimatePresence, { mode: "wait", initial: false, children: activeImage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
554
|
+
react.motion.div,
|
|
555
|
+
{
|
|
556
|
+
initial: "initial",
|
|
557
|
+
animate: "visible",
|
|
558
|
+
exit: direction === "up" ? "upExit" : "downExit",
|
|
559
|
+
variants: slideVariants,
|
|
560
|
+
className: "absolute inset-0",
|
|
561
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
562
|
+
img.Img,
|
|
563
|
+
{
|
|
564
|
+
src: activeImage.src,
|
|
565
|
+
alt: activeImage.alt,
|
|
566
|
+
className: cn(
|
|
567
|
+
"h-full w-full object-cover object-center",
|
|
568
|
+
imageClassName,
|
|
569
|
+
activeImage.className
|
|
570
|
+
),
|
|
571
|
+
optixFlowConfig: activeImage.optixFlowConfig ?? optixFlowConfig,
|
|
572
|
+
loading: "eager"
|
|
573
|
+
}
|
|
574
|
+
)
|
|
575
|
+
},
|
|
576
|
+
`${currentIndex}-${activeImage.src ?? "image"}`
|
|
577
|
+
) : null }),
|
|
578
|
+
overlayContent,
|
|
579
|
+
children ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
580
|
+
"div",
|
|
581
|
+
{
|
|
582
|
+
className: cn(
|
|
583
|
+
"relative z-20 flex w-full flex-col items-center justify-center px-6 py-12 text-center text-white md:px-12",
|
|
584
|
+
contentClassName
|
|
585
|
+
),
|
|
586
|
+
children
|
|
587
|
+
}
|
|
588
|
+
) : null
|
|
589
|
+
]
|
|
590
|
+
}
|
|
591
|
+
);
|
|
592
|
+
};
|
|
593
|
+
var MOBILE_CLASSES = {
|
|
594
|
+
"fit-left": "items-start md:items-center",
|
|
595
|
+
"fit-center": "items-center",
|
|
596
|
+
"fit-right": "items-end md:items-center",
|
|
597
|
+
"full-left": "items-stretch md:items-center",
|
|
598
|
+
"full-center": "items-stretch md:items-center",
|
|
599
|
+
"full-right": "items-stretch md:items-center"
|
|
600
|
+
};
|
|
601
|
+
function BlockActions({
|
|
602
|
+
mobileConfig,
|
|
603
|
+
actionsClassName,
|
|
604
|
+
verticalSpacing = "mt-4 md:mt-8",
|
|
605
|
+
actions,
|
|
606
|
+
actionsSlot
|
|
607
|
+
}) {
|
|
608
|
+
const width = mobileConfig?.width ?? "full";
|
|
609
|
+
const position = mobileConfig?.position ?? "center";
|
|
610
|
+
const mobileLayoutClass = MOBILE_CLASSES[`${width}-${position}`];
|
|
611
|
+
if (actionsSlot) {
|
|
612
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { children: actionsSlot });
|
|
613
|
+
} else if (actions && actions?.length > 0) {
|
|
614
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
615
|
+
"div",
|
|
616
|
+
{
|
|
617
|
+
className: cn(
|
|
618
|
+
"flex flex-col md:flex-row flex-wrap gap-4",
|
|
619
|
+
mobileLayoutClass,
|
|
620
|
+
actionsClassName,
|
|
621
|
+
verticalSpacing
|
|
622
|
+
),
|
|
623
|
+
children: actions.map((action, index) => /* @__PURE__ */ jsxRuntime.jsx(ActionComponent, { action }, index))
|
|
633
624
|
}
|
|
634
625
|
);
|
|
626
|
+
} else {
|
|
627
|
+
return null;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
function ActionComponent({ action }) {
|
|
631
|
+
const {
|
|
632
|
+
label,
|
|
633
|
+
icon,
|
|
634
|
+
iconAfter,
|
|
635
|
+
children,
|
|
636
|
+
href,
|
|
637
|
+
onClick,
|
|
638
|
+
asButton,
|
|
639
|
+
variant,
|
|
640
|
+
size,
|
|
641
|
+
className: actionClassName,
|
|
642
|
+
...pressableProps
|
|
643
|
+
} = action;
|
|
644
|
+
const shouldStyleAsButton = asButton ?? true;
|
|
645
|
+
const resolvedVariant = shouldStyleAsButton ? variant ?? "default" : void 0;
|
|
646
|
+
const resolvedSize = shouldStyleAsButton ? size ?? "default" : void 0;
|
|
647
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
648
|
+
pressable.Pressable,
|
|
649
|
+
{
|
|
650
|
+
href,
|
|
651
|
+
onClick,
|
|
652
|
+
asButton: shouldStyleAsButton,
|
|
653
|
+
variant: resolvedVariant,
|
|
654
|
+
size: resolvedSize,
|
|
655
|
+
"data-slot": shouldStyleAsButton ? "button" : void 0,
|
|
656
|
+
"data-variant": resolvedVariant,
|
|
657
|
+
"data-size": resolvedSize,
|
|
658
|
+
className: cn(
|
|
659
|
+
shouldStyleAsButton && pressable.buttonVariants({ variant: resolvedVariant, size: resolvedSize }),
|
|
660
|
+
actionClassName
|
|
661
|
+
),
|
|
662
|
+
...pressableProps,
|
|
663
|
+
children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
664
|
+
icon,
|
|
665
|
+
label,
|
|
666
|
+
iconAfter
|
|
667
|
+
] })
|
|
668
|
+
}
|
|
669
|
+
);
|
|
670
|
+
}
|
|
671
|
+
var HERO_TECH_CAROUSEL_MAX_ITEMS = 4;
|
|
672
|
+
function resolveLogoSrc(logo) {
|
|
673
|
+
if (typeof logo.src === "string") return logo.src;
|
|
674
|
+
return logo.src?.light;
|
|
675
|
+
}
|
|
676
|
+
function HeroPanel({
|
|
677
|
+
item,
|
|
678
|
+
defaultAutoplayIntervalMs,
|
|
679
|
+
optixFlowConfig,
|
|
680
|
+
panelContentClassName
|
|
681
|
+
}) {
|
|
682
|
+
const {
|
|
683
|
+
logo,
|
|
684
|
+
logoSlot,
|
|
685
|
+
title,
|
|
686
|
+
content,
|
|
687
|
+
actions,
|
|
688
|
+
backgroundMedia,
|
|
689
|
+
backgroundAutoplayIntervalMs,
|
|
690
|
+
id,
|
|
691
|
+
className,
|
|
692
|
+
contentClassName,
|
|
693
|
+
logoClassName,
|
|
694
|
+
titleClassName,
|
|
695
|
+
textClassName,
|
|
696
|
+
actionsClassName,
|
|
697
|
+
overlayClassName,
|
|
698
|
+
optixFlowConfig: itemOptixFlowConfig
|
|
699
|
+
} = item;
|
|
700
|
+
const resolvedOptixFlow = itemOptixFlowConfig ?? optixFlowConfig;
|
|
701
|
+
const renderBackground = React3.useMemo(() => {
|
|
702
|
+
if (!backgroundMedia || backgroundMedia.length === 0) return null;
|
|
703
|
+
if (backgroundMedia.length === 1) {
|
|
704
|
+
const image = backgroundMedia[0];
|
|
705
|
+
if (!image?.src) return null;
|
|
706
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 z-0", children: [
|
|
707
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
708
|
+
img.Img,
|
|
709
|
+
{
|
|
710
|
+
src: image.src,
|
|
711
|
+
alt: image.alt ?? "",
|
|
712
|
+
className: cn(
|
|
713
|
+
"h-full w-full object-cover object-center",
|
|
714
|
+
image.className
|
|
715
|
+
),
|
|
716
|
+
optixFlowConfig: image.optixFlowConfig ?? resolvedOptixFlow,
|
|
717
|
+
loading: "eager"
|
|
718
|
+
}
|
|
719
|
+
),
|
|
720
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
721
|
+
"div",
|
|
722
|
+
{
|
|
723
|
+
className: cn(
|
|
724
|
+
"absolute inset-0 bg-linear-to-b from-black/55 via-black/45 to-black/65",
|
|
725
|
+
overlayClassName
|
|
726
|
+
)
|
|
727
|
+
}
|
|
728
|
+
)
|
|
729
|
+
] });
|
|
730
|
+
}
|
|
731
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 z-0", children: [
|
|
732
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
733
|
+
ImageSlider,
|
|
734
|
+
{
|
|
735
|
+
images: backgroundMedia,
|
|
736
|
+
className: "h-full w-full rounded-none border-0 shadow-none",
|
|
737
|
+
imageClassName: "object-cover object-center",
|
|
738
|
+
transition: "fade",
|
|
739
|
+
autoplay: true,
|
|
740
|
+
autoplayIntervalMs: backgroundAutoplayIntervalMs ?? defaultAutoplayIntervalMs,
|
|
741
|
+
enableKeyboard: false,
|
|
742
|
+
overlay: false,
|
|
743
|
+
optixFlowConfig: resolvedOptixFlow
|
|
744
|
+
}
|
|
745
|
+
),
|
|
746
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
747
|
+
"div",
|
|
748
|
+
{
|
|
749
|
+
className: cn(
|
|
750
|
+
"absolute inset-0 bg-linear-to-b from-black/55 via-black/45 to-black/65",
|
|
751
|
+
overlayClassName
|
|
752
|
+
)
|
|
753
|
+
}
|
|
754
|
+
)
|
|
755
|
+
] });
|
|
635
756
|
}, [
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
selectTechnology,
|
|
642
|
-
optixFlowConfig
|
|
757
|
+
backgroundMedia,
|
|
758
|
+
backgroundAutoplayIntervalMs,
|
|
759
|
+
defaultAutoplayIntervalMs,
|
|
760
|
+
resolvedOptixFlow,
|
|
761
|
+
overlayClassName
|
|
643
762
|
]);
|
|
763
|
+
const hasBackground = !!backgroundMedia && backgroundMedia.length > 0;
|
|
764
|
+
const renderLogo = React3.useMemo(() => {
|
|
765
|
+
if (logoSlot) return logoSlot;
|
|
766
|
+
if (!logo) return null;
|
|
767
|
+
const src = resolveLogoSrc(logo);
|
|
768
|
+
if (!src) return null;
|
|
769
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
770
|
+
img.Img,
|
|
771
|
+
{
|
|
772
|
+
src,
|
|
773
|
+
alt: logo.alt,
|
|
774
|
+
className: cn(
|
|
775
|
+
"h-10 md:h-12 lg:h-14 w-auto max-w-[70%] object-contain",
|
|
776
|
+
logo.imgClassName,
|
|
777
|
+
logoClassName
|
|
778
|
+
),
|
|
779
|
+
optixFlowConfig: resolvedOptixFlow
|
|
780
|
+
}
|
|
781
|
+
);
|
|
782
|
+
}, [logoSlot, logo, logoClassName, resolvedOptixFlow]);
|
|
783
|
+
const renderTitle = React3.useMemo(() => {
|
|
784
|
+
if (title === void 0 || title === null || title === "") return null;
|
|
785
|
+
if (typeof title === "string") {
|
|
786
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
787
|
+
"h2",
|
|
788
|
+
{
|
|
789
|
+
className: cn(
|
|
790
|
+
"text-2xl md:text-3xl lg:text-4xl font-semibold text-balance",
|
|
791
|
+
hasBackground && "text-white text-shadow-lg",
|
|
792
|
+
titleClassName
|
|
793
|
+
),
|
|
794
|
+
children: title
|
|
795
|
+
}
|
|
796
|
+
);
|
|
797
|
+
}
|
|
798
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: titleClassName, children: title });
|
|
799
|
+
}, [title, titleClassName, hasBackground]);
|
|
800
|
+
const renderContent = React3.useMemo(() => {
|
|
801
|
+
if (content === void 0 || content === null || content === "")
|
|
802
|
+
return null;
|
|
803
|
+
if (typeof content === "string") {
|
|
804
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
805
|
+
"p",
|
|
806
|
+
{
|
|
807
|
+
className: cn(
|
|
808
|
+
"text-sm md:text-base leading-snug text-balance",
|
|
809
|
+
hasBackground ? "text-white text-shadow-lg" : "",
|
|
810
|
+
textClassName
|
|
811
|
+
),
|
|
812
|
+
children: content
|
|
813
|
+
}
|
|
814
|
+
);
|
|
815
|
+
}
|
|
816
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: textClassName, children: content });
|
|
817
|
+
}, [content, textClassName, hasBackground]);
|
|
818
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
819
|
+
"div",
|
|
820
|
+
{
|
|
821
|
+
id,
|
|
822
|
+
"data-slot": "hero-tech-carousel-panel",
|
|
823
|
+
className: cn(
|
|
824
|
+
// Mobile: stack vertically with content-fit height + padding.
|
|
825
|
+
"relative w-full overflow-hidden",
|
|
826
|
+
// Desktop: flex children share the row equally and fill height.
|
|
827
|
+
"md:h-full md:flex-1 md:basis-0 md:min-w-0",
|
|
828
|
+
// Provide a default panel background when no media is supplied so
|
|
829
|
+
// separators between panels remain visible.
|
|
830
|
+
!hasBackground && "bg-muted/30",
|
|
831
|
+
className
|
|
832
|
+
),
|
|
833
|
+
children: [
|
|
834
|
+
renderBackground,
|
|
835
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
836
|
+
"div",
|
|
837
|
+
{
|
|
838
|
+
className: cn(
|
|
839
|
+
"relative z-10 flex h-full w-full flex-col items-center justify-center gap-4 md:gap-6",
|
|
840
|
+
// Mobile padding keeps content readable when stacked.
|
|
841
|
+
"px-6 py-12 md:px-8 md:py-12 lg:px-10",
|
|
842
|
+
// Center content vertically; on desktop columns can be quite tall.
|
|
843
|
+
"text-center",
|
|
844
|
+
panelContentClassName,
|
|
845
|
+
contentClassName
|
|
846
|
+
),
|
|
847
|
+
children: [
|
|
848
|
+
renderLogo,
|
|
849
|
+
renderTitle,
|
|
850
|
+
renderContent,
|
|
851
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
852
|
+
BlockActions,
|
|
853
|
+
{
|
|
854
|
+
actions,
|
|
855
|
+
actionsClassName,
|
|
856
|
+
verticalSpacing: "mt-2 md:mt-4",
|
|
857
|
+
mobileConfig: { width: "fit", position: "center" }
|
|
858
|
+
}
|
|
859
|
+
)
|
|
860
|
+
]
|
|
861
|
+
}
|
|
862
|
+
)
|
|
863
|
+
]
|
|
864
|
+
}
|
|
865
|
+
);
|
|
866
|
+
}
|
|
867
|
+
function HeroTechCarousel({
|
|
868
|
+
sectionId = "hero-tech-carousel",
|
|
869
|
+
items,
|
|
870
|
+
backgroundAutoplayIntervalMs = 5e3,
|
|
871
|
+
background,
|
|
872
|
+
spacing = "none",
|
|
873
|
+
pattern,
|
|
874
|
+
patternOpacity,
|
|
875
|
+
className,
|
|
876
|
+
containerClassName = "px-0 sm:px-0 lg:px-0 max-w-full relative z-10 h-auto md:h-dvh w-screen flex items-stretch",
|
|
877
|
+
panelsClassName,
|
|
878
|
+
panelContentClassName,
|
|
879
|
+
optixFlowConfig
|
|
880
|
+
}) {
|
|
881
|
+
const visibleItems = React3.useMemo(() => {
|
|
882
|
+
if (!items || items.length === 0) return [];
|
|
883
|
+
return items.slice(0, HERO_TECH_CAROUSEL_MAX_ITEMS);
|
|
884
|
+
}, [items]);
|
|
644
885
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
645
886
|
Section,
|
|
646
887
|
{
|
|
@@ -649,80 +890,37 @@ function HeroTechCarousel({
|
|
|
649
890
|
spacing,
|
|
650
891
|
pattern,
|
|
651
892
|
patternOpacity,
|
|
652
|
-
className
|
|
893
|
+
className: cn(
|
|
894
|
+
"relative w-screen overflow-hidden",
|
|
895
|
+
// Desktop fills the viewport; on mobile content drives the height.
|
|
896
|
+
"h-auto md:h-dvh",
|
|
897
|
+
"px-0 pt-0 pb-0",
|
|
898
|
+
className
|
|
899
|
+
),
|
|
653
900
|
containerClassName,
|
|
654
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
)
|
|
666
|
-
|
|
667
|
-
{
|
|
668
|
-
className: cn(
|
|
669
|
-
"mx-auto mb-4 max-w-2xl text-center text-4xl font-bold md:text-6xl text-balance",
|
|
670
|
-
headingClassName
|
|
671
|
-
),
|
|
672
|
-
children: heading
|
|
673
|
-
}
|
|
674
|
-
)),
|
|
675
|
-
description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
676
|
-
"p",
|
|
677
|
-
{
|
|
678
|
-
className: cn(
|
|
679
|
-
"mx-auto mt-4 max-w-xl text-center text-lg text-balance",
|
|
680
|
-
descriptionClassName
|
|
681
|
-
),
|
|
682
|
-
children: description
|
|
683
|
-
}
|
|
684
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description })),
|
|
685
|
-
technologies && technologies.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
686
|
-
"div",
|
|
901
|
+
children: visibleItems.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(
|
|
902
|
+
"div",
|
|
903
|
+
{
|
|
904
|
+
"data-slot": "hero-tech-carousel-panels",
|
|
905
|
+
className: cn(
|
|
906
|
+
// Mobile: vertical stack with auto height per panel.
|
|
907
|
+
"flex w-full flex-col",
|
|
908
|
+
// Desktop: equal-width row that fills section height.
|
|
909
|
+
"md:h-full md:flex-row md:items-stretch",
|
|
910
|
+
panelsClassName
|
|
911
|
+
),
|
|
912
|
+
children: visibleItems.map((item, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
913
|
+
HeroPanel,
|
|
687
914
|
{
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
),
|
|
698
|
-
children: [
|
|
699
|
-
technologies && current && technologies[current] && technologies[current].logo ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
700
|
-
img.Img,
|
|
701
|
-
{
|
|
702
|
-
src: technologies[current]?.logo,
|
|
703
|
-
alt: technologies[current]?.name,
|
|
704
|
-
className: "h-4 md:h-7",
|
|
705
|
-
optixFlowConfig
|
|
706
|
-
}
|
|
707
|
-
) : null,
|
|
708
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
709
|
-
"p",
|
|
710
|
-
{
|
|
711
|
-
className: cn(
|
|
712
|
-
"px-2 font-mono text-sm",
|
|
713
|
-
technologies && technologies[current] && technologies[current].logo ? "border-l" : ""
|
|
714
|
-
),
|
|
715
|
-
children: technologies[current]?.command
|
|
716
|
-
}
|
|
717
|
-
)
|
|
718
|
-
]
|
|
719
|
-
}
|
|
720
|
-
)
|
|
721
|
-
}
|
|
722
|
-
)
|
|
723
|
-
] }),
|
|
724
|
-
renderCarousel
|
|
725
|
-
] })
|
|
915
|
+
item,
|
|
916
|
+
defaultAutoplayIntervalMs: backgroundAutoplayIntervalMs,
|
|
917
|
+
optixFlowConfig,
|
|
918
|
+
panelContentClassName
|
|
919
|
+
},
|
|
920
|
+
item.id ?? idx
|
|
921
|
+
))
|
|
922
|
+
}
|
|
923
|
+
)
|
|
726
924
|
}
|
|
727
925
|
);
|
|
728
926
|
}
|