@opensite/ui 0.8.1 → 0.8.2
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/carousel-horizontal-cards.cjs +8 -6
- package/dist/carousel-horizontal-cards.js +8 -6
- package/dist/carousel-image-hero.cjs +85 -160
- package/dist/carousel-image-hero.d.cts +1 -5
- package/dist/carousel-image-hero.d.ts +1 -5
- package/dist/carousel-image-hero.js +85 -160
- package/dist/carousel-portfolio-hero.cjs +138 -59
- package/dist/carousel-portfolio-hero.js +138 -59
- package/dist/carousel-product-feature-showcase.cjs +148 -95
- package/dist/carousel-product-feature-showcase.js +148 -95
- package/dist/carousel-progress-slider.cjs +13 -9
- package/dist/carousel-progress-slider.js +13 -9
- package/dist/carousel-scrolling-feature-showcase.cjs +105 -54
- package/dist/carousel-scrolling-feature-showcase.js +105 -54
- package/dist/feature-accordion-image.cjs +9 -8
- package/dist/feature-accordion-image.js +9 -8
- package/dist/feature-animated-carousel.cjs +65 -49
- package/dist/feature-animated-carousel.js +65 -49
- package/dist/feature-badge-grid-six.cjs +20 -17
- package/dist/feature-badge-grid-six.js +21 -18
- package/dist/feature-bento-image-grid.cjs +12 -8
- package/dist/feature-bento-image-grid.js +12 -8
- package/dist/feature-bento-utilities.cjs +9 -5
- package/dist/feature-bento-utilities.js +9 -5
- package/dist/feature-capabilities-grid.cjs +41 -38
- package/dist/feature-capabilities-grid.js +41 -38
- package/dist/feature-card-grid-linked.cjs +18 -18
- package/dist/feature-card-grid-linked.js +19 -19
- package/dist/feature-carousel-progress.cjs +3 -3
- package/dist/feature-carousel-progress.js +4 -4
- package/dist/feature-category-image-cards.cjs +3 -3
- package/dist/feature-category-image-cards.js +4 -4
- package/dist/feature-checklist-image.cjs +2 -2
- package/dist/feature-checklist-image.js +2 -2
- package/dist/feature-checklist-three-column.cjs +6 -6
- package/dist/feature-checklist-three-column.js +7 -7
- package/dist/feature-icon-grid-accent.cjs +2 -2
- package/dist/feature-icon-grid-accent.js +2 -2
- package/dist/feature-icon-grid-bordered.cjs +29 -31
- package/dist/feature-icon-grid-bordered.d.cts +9 -9
- package/dist/feature-icon-grid-bordered.d.ts +9 -9
- package/dist/feature-icon-grid-bordered.js +30 -32
- package/dist/feature-icon-grid-muted.cjs +6 -6
- package/dist/feature-icon-grid-muted.d.cts +9 -9
- package/dist/feature-icon-grid-muted.d.ts +9 -9
- package/dist/feature-icon-grid-muted.js +7 -7
- package/dist/feature-icon-tabs-content.cjs +8 -8
- package/dist/feature-icon-tabs-content.d.cts +13 -13
- package/dist/feature-icon-tabs-content.d.ts +13 -13
- package/dist/feature-icon-tabs-content.js +9 -9
- package/dist/feature-image-cards-three-column.cjs +26 -27
- package/dist/feature-image-cards-three-column.js +27 -28
- package/dist/feature-image-overlay-badge.cjs +23 -21
- package/dist/feature-image-overlay-badge.js +24 -22
- package/dist/feature-integration-cards.cjs +19 -18
- package/dist/feature-integration-cards.js +20 -19
- package/dist/feature-numbered-cards.cjs +2 -2
- package/dist/feature-numbered-cards.js +3 -3
- package/dist/feature-pattern-grid-links.cjs +26 -29
- package/dist/feature-pattern-grid-links.d.cts +1 -5
- package/dist/feature-pattern-grid-links.d.ts +1 -5
- package/dist/feature-pattern-grid-links.js +27 -30
- package/dist/feature-showcase.cjs +441 -40
- package/dist/feature-showcase.d.cts +62 -5
- package/dist/feature-showcase.d.ts +62 -5
- package/dist/feature-showcase.js +438 -37
- package/dist/feature-split-image-reverse.cjs +15 -36
- package/dist/feature-split-image-reverse.js +16 -37
- package/dist/feature-split-image.cjs +15 -36
- package/dist/feature-split-image.js +16 -37
- package/dist/feature-stats-highlight.cjs +20 -32
- package/dist/feature-stats-highlight.js +21 -33
- package/dist/feature-tabbed-content-image.cjs +11 -6
- package/dist/feature-tabbed-content-image.js +11 -6
- package/dist/feature-three-column-values.cjs +6 -6
- package/dist/feature-three-column-values.js +6 -6
- package/dist/feature-utility-cards-grid.cjs +17 -15
- package/dist/feature-utility-cards-grid.js +18 -16
- package/dist/navbar-tabbed-sections.cjs +23 -16
- package/dist/navbar-tabbed-sections.js +23 -16
- package/dist/registry.cjs +941 -708
- package/dist/registry.js +943 -710
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React4 from 'react';
|
|
3
|
+
import React4__default, { useMemo, useCallback } from 'react';
|
|
4
4
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -19,10 +19,10 @@ function DynamicIcon({
|
|
|
19
19
|
className,
|
|
20
20
|
alt
|
|
21
21
|
}) {
|
|
22
|
-
const [svgContent, setSvgContent] =
|
|
23
|
-
const [isLoading, setIsLoading] =
|
|
24
|
-
const [error, setError] =
|
|
25
|
-
const { url, iconName } =
|
|
22
|
+
const [svgContent, setSvgContent] = React4.useState(null);
|
|
23
|
+
const [isLoading, setIsLoading] = React4.useState(true);
|
|
24
|
+
const [error, setError] = React4.useState(null);
|
|
25
|
+
const { url, iconName } = React4.useMemo(() => {
|
|
26
26
|
const separator = name.includes("/") ? "/" : ":";
|
|
27
27
|
const [prefix, iconName2] = name.split(separator);
|
|
28
28
|
const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}`;
|
|
@@ -31,7 +31,7 @@ function DynamicIcon({
|
|
|
31
31
|
iconName: iconName2
|
|
32
32
|
};
|
|
33
33
|
}, [name, size]);
|
|
34
|
-
|
|
34
|
+
React4.useEffect(() => {
|
|
35
35
|
let isMounted = true;
|
|
36
36
|
const fetchSvg = async () => {
|
|
37
37
|
const cached = svgCache.get(url);
|
|
@@ -125,7 +125,7 @@ var maxWidthStyles = {
|
|
|
125
125
|
"4xl": "max-w-[1536px]",
|
|
126
126
|
full: "max-w-full"
|
|
127
127
|
};
|
|
128
|
-
var Container =
|
|
128
|
+
var Container = React4__default.forwardRef(
|
|
129
129
|
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
130
130
|
const Component = as;
|
|
131
131
|
return /* @__PURE__ */ jsx(
|
|
@@ -430,7 +430,7 @@ var spacingStyles = {
|
|
|
430
430
|
};
|
|
431
431
|
var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
|
|
432
432
|
var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
|
|
433
|
-
var Section =
|
|
433
|
+
var Section = React4__default.forwardRef(
|
|
434
434
|
({
|
|
435
435
|
id,
|
|
436
436
|
title,
|
|
@@ -491,7 +491,7 @@ var Section = React__default.forwardRef(
|
|
|
491
491
|
}
|
|
492
492
|
);
|
|
493
493
|
Section.displayName = "Section";
|
|
494
|
-
var Controls = ({
|
|
494
|
+
var Controls = React4.memo(({
|
|
495
495
|
handleNext,
|
|
496
496
|
handlePrevious,
|
|
497
497
|
isPreviousDisabled,
|
|
@@ -519,9 +519,9 @@ var Controls = ({
|
|
|
519
519
|
}
|
|
520
520
|
)
|
|
521
521
|
] });
|
|
522
|
-
};
|
|
523
|
-
var FeatureCard = ({ feature, isActive, onClick }) => {
|
|
524
|
-
const variants = {
|
|
522
|
+
});
|
|
523
|
+
var FeatureCard = React4.memo(({ feature, isActive, onClick }) => {
|
|
524
|
+
const variants = useMemo(() => ({
|
|
525
525
|
initial: {
|
|
526
526
|
opacity: 0
|
|
527
527
|
},
|
|
@@ -531,7 +531,7 @@ var FeatureCard = ({ feature, isActive, onClick }) => {
|
|
|
531
531
|
exit: {
|
|
532
532
|
opacity: 0
|
|
533
533
|
}
|
|
534
|
-
};
|
|
534
|
+
}), []);
|
|
535
535
|
return /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ jsx(
|
|
536
536
|
motion.div,
|
|
537
537
|
{
|
|
@@ -561,13 +561,13 @@ var FeatureCard = ({ feature, isActive, onClick }) => {
|
|
|
561
561
|
ease: "easeOut"
|
|
562
562
|
},
|
|
563
563
|
className: "p-6 text-sm md:p-8 md:text-base",
|
|
564
|
-
children: /* @__PURE__ */ jsxs("p", { children: [
|
|
565
|
-
/* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
|
|
564
|
+
children: (feature.title || feature.description) && /* @__PURE__ */ jsxs("p", { children: [
|
|
565
|
+
feature.title && /* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
|
|
566
566
|
feature.title,
|
|
567
567
|
"."
|
|
568
568
|
] }),
|
|
569
|
-
" ",
|
|
570
|
-
/* @__PURE__ */ jsx("span", { children: feature.description })
|
|
569
|
+
feature.title && feature.description && " ",
|
|
570
|
+
feature.description && /* @__PURE__ */ jsx("span", { children: feature.description })
|
|
571
571
|
] })
|
|
572
572
|
},
|
|
573
573
|
`feature-description-active-${feature.title}`
|
|
@@ -601,15 +601,15 @@ var FeatureCard = ({ feature, isActive, onClick }) => {
|
|
|
601
601
|
className: "shrink-0"
|
|
602
602
|
}
|
|
603
603
|
),
|
|
604
|
-
/* @__PURE__ */ jsx("p", { className: "shrink-0 font-semibold", children: feature.title })
|
|
604
|
+
feature.title && /* @__PURE__ */ jsx("p", { className: "shrink-0 font-semibold", children: feature.title })
|
|
605
605
|
]
|
|
606
606
|
},
|
|
607
607
|
`feature-description-inactive-${feature.title}`
|
|
608
608
|
)
|
|
609
609
|
}
|
|
610
610
|
) });
|
|
611
|
-
};
|
|
612
|
-
var FeaturesDesktop = ({
|
|
611
|
+
});
|
|
612
|
+
var FeaturesDesktop = React4.memo(({
|
|
613
613
|
features,
|
|
614
614
|
handleNext,
|
|
615
615
|
handlePrevious,
|
|
@@ -640,8 +640,8 @@ var FeaturesDesktop = ({
|
|
|
640
640
|
);
|
|
641
641
|
}) })
|
|
642
642
|
] });
|
|
643
|
-
};
|
|
644
|
-
var FeaturesMobile = ({
|
|
643
|
+
});
|
|
644
|
+
var FeaturesMobile = React4.memo(({
|
|
645
645
|
features,
|
|
646
646
|
handleNext,
|
|
647
647
|
handlePrevious,
|
|
@@ -650,7 +650,7 @@ var FeaturesMobile = ({
|
|
|
650
650
|
isPreviousDisabled,
|
|
651
651
|
isNextDisabled
|
|
652
652
|
}) => {
|
|
653
|
-
const variants = {
|
|
653
|
+
const variants = useMemo(() => ({
|
|
654
654
|
enter: (direction2) => ({
|
|
655
655
|
x: direction2 > 0 ? 100 : -100,
|
|
656
656
|
opacity: 0
|
|
@@ -663,7 +663,8 @@ var FeaturesMobile = ({
|
|
|
663
663
|
x: direction2 < 0 ? 100 : -100,
|
|
664
664
|
opacity: 0
|
|
665
665
|
})
|
|
666
|
-
};
|
|
666
|
+
}), []);
|
|
667
|
+
const currentFeature = features[activeIndex];
|
|
667
668
|
return /* @__PURE__ */ jsx("div", { className: "relative z-10 flex flex-col items-center gap-6 md:hidden", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between gap-4", children: [
|
|
668
669
|
/* @__PURE__ */ jsx(
|
|
669
670
|
"button",
|
|
@@ -688,13 +689,13 @@ var FeaturesMobile = ({
|
|
|
688
689
|
opacity: { duration: 0.2 }
|
|
689
690
|
},
|
|
690
691
|
className: "absolute inset-0 flex items-center justify-center rounded-3xl bg-background p-4",
|
|
691
|
-
children: /* @__PURE__ */ jsxs("p", { className: "text-center text-sm", children: [
|
|
692
|
-
/* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
|
|
693
|
-
|
|
692
|
+
children: (currentFeature?.title || currentFeature?.description) && /* @__PURE__ */ jsxs("p", { className: "text-center text-sm", children: [
|
|
693
|
+
currentFeature.title && /* @__PURE__ */ jsxs("span", { className: "font-semibold", children: [
|
|
694
|
+
currentFeature.title,
|
|
694
695
|
"."
|
|
695
696
|
] }),
|
|
696
|
-
" ",
|
|
697
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
697
|
+
currentFeature.title && currentFeature.description && " ",
|
|
698
|
+
currentFeature.description && /* @__PURE__ */ jsx("span", { children: currentFeature.description })
|
|
698
699
|
] })
|
|
699
700
|
},
|
|
700
701
|
activeIndex
|
|
@@ -710,9 +711,9 @@ var FeaturesMobile = ({
|
|
|
710
711
|
}
|
|
711
712
|
)
|
|
712
713
|
] }) });
|
|
713
|
-
};
|
|
714
|
+
});
|
|
714
715
|
function FeatureAnimatedCarousel({
|
|
715
|
-
features
|
|
716
|
+
features,
|
|
716
717
|
className,
|
|
717
718
|
optixFlowConfig,
|
|
718
719
|
background,
|
|
@@ -721,27 +722,27 @@ function FeatureAnimatedCarousel({
|
|
|
721
722
|
patternOpacity,
|
|
722
723
|
patternClassName
|
|
723
724
|
}) {
|
|
724
|
-
const [activeIndex, setActiveIndex] =
|
|
725
|
-
const [direction, setDirection] =
|
|
726
|
-
const handleNext = () => {
|
|
727
|
-
if (activeIndex < features.length - 1) {
|
|
725
|
+
const [activeIndex, setActiveIndex] = React4.useState(0);
|
|
726
|
+
const [direction, setDirection] = React4.useState(1);
|
|
727
|
+
const handleNext = useCallback(() => {
|
|
728
|
+
if (features && activeIndex < features.length - 1) {
|
|
728
729
|
setDirection(1);
|
|
729
730
|
setActiveIndex(activeIndex + 1);
|
|
730
731
|
}
|
|
731
|
-
};
|
|
732
|
-
const handlePrevious = () => {
|
|
732
|
+
}, [activeIndex, features]);
|
|
733
|
+
const handlePrevious = useCallback(() => {
|
|
733
734
|
if (activeIndex > 0) {
|
|
734
735
|
setDirection(-1);
|
|
735
736
|
setActiveIndex(activeIndex - 1);
|
|
736
737
|
}
|
|
737
|
-
};
|
|
738
|
-
const handleFeatureClick = (index) => {
|
|
738
|
+
}, [activeIndex]);
|
|
739
|
+
const handleFeatureClick = useCallback((index) => {
|
|
739
740
|
setDirection(index > activeIndex ? 1 : -1);
|
|
740
741
|
setActiveIndex(index);
|
|
741
|
-
};
|
|
742
|
+
}, [activeIndex]);
|
|
742
743
|
const isPreviousDisabled = activeIndex === 0;
|
|
743
|
-
const isNextDisabled = activeIndex === features.length - 1;
|
|
744
|
-
const imageVariants = {
|
|
744
|
+
const isNextDisabled = !features || activeIndex === features.length - 1;
|
|
745
|
+
const imageVariants = useMemo(() => ({
|
|
745
746
|
enter: (direction2) => ({
|
|
746
747
|
x: direction2 > 0 ? 300 : -300,
|
|
747
748
|
opacity: 0
|
|
@@ -754,7 +755,22 @@ function FeatureAnimatedCarousel({
|
|
|
754
755
|
x: direction2 < 0 ? 300 : -300,
|
|
755
756
|
opacity: 0
|
|
756
757
|
})
|
|
757
|
-
};
|
|
758
|
+
}), []);
|
|
759
|
+
if (!features || features.length === 0) {
|
|
760
|
+
return /* @__PURE__ */ jsx(
|
|
761
|
+
Section,
|
|
762
|
+
{
|
|
763
|
+
background,
|
|
764
|
+
spacing,
|
|
765
|
+
pattern,
|
|
766
|
+
patternOpacity,
|
|
767
|
+
patternClassName,
|
|
768
|
+
className,
|
|
769
|
+
children: /* @__PURE__ */ jsx("div", { className: "relative flex min-h-[500px] flex-col-reverse gap-8 overflow-hidden rounded-3xl bg-muted p-6 md:flex-row md:items-center md:p-12 lg:min-h-[600px]" })
|
|
770
|
+
}
|
|
771
|
+
);
|
|
772
|
+
}
|
|
773
|
+
const currentFeature = features[activeIndex];
|
|
758
774
|
return /* @__PURE__ */ jsx(
|
|
759
775
|
Section,
|
|
760
776
|
{
|
|
@@ -765,7 +781,7 @@ function FeatureAnimatedCarousel({
|
|
|
765
781
|
patternClassName,
|
|
766
782
|
className,
|
|
767
783
|
children: /* @__PURE__ */ jsxs("div", { className: "relative flex min-h-[500px] flex-col-reverse gap-8 overflow-hidden rounded-3xl bg-muted p-6 md:flex-row md:items-center md:p-12 lg:min-h-[600px]", children: [
|
|
768
|
-
|
|
784
|
+
/* @__PURE__ */ jsx(
|
|
769
785
|
FeaturesDesktop,
|
|
770
786
|
{
|
|
771
787
|
features,
|
|
@@ -777,7 +793,7 @@ function FeatureAnimatedCarousel({
|
|
|
777
793
|
isNextDisabled
|
|
778
794
|
}
|
|
779
795
|
),
|
|
780
|
-
|
|
796
|
+
/* @__PURE__ */ jsx(
|
|
781
797
|
FeaturesMobile,
|
|
782
798
|
{
|
|
783
799
|
features,
|
|
@@ -789,7 +805,7 @@ function FeatureAnimatedCarousel({
|
|
|
789
805
|
isNextDisabled
|
|
790
806
|
}
|
|
791
807
|
),
|
|
792
|
-
/* @__PURE__ */ jsx("div", { className: "relative flex-1 overflow-hidden rounded-2xl md:absolute md:right-8 md:top-8 md:bottom-8 md:w-1/2", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", custom: direction, children: /* @__PURE__ */ jsx(
|
|
808
|
+
currentFeature?.image && /* @__PURE__ */ jsx("div", { className: "relative flex-1 overflow-hidden rounded-2xl md:absolute md:right-8 md:top-8 md:bottom-8 md:w-1/2", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", custom: direction, children: /* @__PURE__ */ jsx(
|
|
793
809
|
motion.div,
|
|
794
810
|
{
|
|
795
811
|
custom: direction,
|
|
@@ -805,8 +821,8 @@ function FeatureAnimatedCarousel({
|
|
|
805
821
|
children: /* @__PURE__ */ jsx(
|
|
806
822
|
Img,
|
|
807
823
|
{
|
|
808
|
-
src:
|
|
809
|
-
alt:
|
|
824
|
+
src: currentFeature.image,
|
|
825
|
+
alt: currentFeature.imageAlt || (typeof currentFeature.title === "string" ? currentFeature.title : "Feature image"),
|
|
810
826
|
className: "h-full w-full object-cover",
|
|
811
827
|
optixFlowConfig
|
|
812
828
|
}
|
|
@@ -989,7 +989,7 @@ function FeatureBadgeGridSix({
|
|
|
989
989
|
if (!label) return null;
|
|
990
990
|
return /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "secondary", className: badgeClassName, children: label });
|
|
991
991
|
}, [badgeSlot, label, badgeClassName]);
|
|
992
|
-
const renderFeatureIcon = (feature) => {
|
|
992
|
+
const renderFeatureIcon = React.useCallback((feature) => {
|
|
993
993
|
if (feature.icon) return feature.icon;
|
|
994
994
|
if (feature.iconName) {
|
|
995
995
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1002,25 +1002,28 @@ function FeatureBadgeGridSix({
|
|
|
1002
1002
|
);
|
|
1003
1003
|
}
|
|
1004
1004
|
return null;
|
|
1005
|
-
};
|
|
1005
|
+
}, []);
|
|
1006
1006
|
const featuresContent = React.useMemo(() => {
|
|
1007
1007
|
if (featuresSlot) return featuresSlot;
|
|
1008
1008
|
if (!features || features.length === 0) return null;
|
|
1009
|
-
return features.map((feature, index) =>
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1009
|
+
return features.map((feature, index) => {
|
|
1010
|
+
const iconContent = renderFeatureIcon(feature);
|
|
1011
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1012
|
+
"div",
|
|
1013
|
+
{
|
|
1014
|
+
className: cn("flex gap-6 space-y-4 rounded-lg md:block", cardClassName, feature.className),
|
|
1015
|
+
children: [
|
|
1016
|
+
iconContent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-10 shrink-0 items-center justify-center rounded-full bg-accent md:size-12", children: iconContent }),
|
|
1017
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1018
|
+
feature.heading && (typeof feature.heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h3", { className: cn("font-medium md:mb-2 md:text-xl", feature.headingClassName), children: feature.heading }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("font-medium md:mb-2 md:text-xl", feature.headingClassName), children: feature.heading })),
|
|
1019
|
+
feature.description && (typeof feature.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-sm text-muted-foreground md:text-base", feature.descriptionClassName), children: feature.description }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("text-sm text-muted-foreground md:text-base", feature.descriptionClassName), children: feature.description }))
|
|
1020
|
+
] })
|
|
1021
|
+
]
|
|
1022
|
+
},
|
|
1023
|
+
index
|
|
1024
|
+
);
|
|
1025
|
+
});
|
|
1026
|
+
}, [featuresSlot, features, cardClassName, renderFeatureIcon]);
|
|
1024
1027
|
const actionContent = React.useMemo(() => {
|
|
1025
1028
|
if (actionSlot) return actionSlot;
|
|
1026
1029
|
if (!action) return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { useMemo } from 'react';
|
|
3
|
+
import React__default, { useMemo, useCallback } from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -968,7 +968,7 @@ function FeatureBadgeGridSix({
|
|
|
968
968
|
if (!label) return null;
|
|
969
969
|
return /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: badgeClassName, children: label });
|
|
970
970
|
}, [badgeSlot, label, badgeClassName]);
|
|
971
|
-
const renderFeatureIcon = (feature) => {
|
|
971
|
+
const renderFeatureIcon = useCallback((feature) => {
|
|
972
972
|
if (feature.icon) return feature.icon;
|
|
973
973
|
if (feature.iconName) {
|
|
974
974
|
return /* @__PURE__ */ jsx(
|
|
@@ -981,25 +981,28 @@ function FeatureBadgeGridSix({
|
|
|
981
981
|
);
|
|
982
982
|
}
|
|
983
983
|
return null;
|
|
984
|
-
};
|
|
984
|
+
}, []);
|
|
985
985
|
const featuresContent = useMemo(() => {
|
|
986
986
|
if (featuresSlot) return featuresSlot;
|
|
987
987
|
if (!features || features.length === 0) return null;
|
|
988
|
-
return features.map((feature, index) =>
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
988
|
+
return features.map((feature, index) => {
|
|
989
|
+
const iconContent = renderFeatureIcon(feature);
|
|
990
|
+
return /* @__PURE__ */ jsxs(
|
|
991
|
+
"div",
|
|
992
|
+
{
|
|
993
|
+
className: cn("flex gap-6 space-y-4 rounded-lg md:block", cardClassName, feature.className),
|
|
994
|
+
children: [
|
|
995
|
+
iconContent && /* @__PURE__ */ jsx("span", { className: "flex size-10 shrink-0 items-center justify-center rounded-full bg-accent md:size-12", children: iconContent }),
|
|
996
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
997
|
+
feature.heading && (typeof feature.heading === "string" ? /* @__PURE__ */ jsx("h3", { className: cn("font-medium md:mb-2 md:text-xl", feature.headingClassName), children: feature.heading }) : /* @__PURE__ */ jsx("div", { className: cn("font-medium md:mb-2 md:text-xl", feature.headingClassName), children: feature.heading })),
|
|
998
|
+
feature.description && (typeof feature.description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-sm text-muted-foreground md:text-base", feature.descriptionClassName), children: feature.description }) : /* @__PURE__ */ jsx("div", { className: cn("text-sm text-muted-foreground md:text-base", feature.descriptionClassName), children: feature.description }))
|
|
999
|
+
] })
|
|
1000
|
+
]
|
|
1001
|
+
},
|
|
1002
|
+
index
|
|
1003
|
+
);
|
|
1004
|
+
});
|
|
1005
|
+
}, [featuresSlot, features, cardClassName, renderFeatureIcon]);
|
|
1003
1006
|
const actionContent = useMemo(() => {
|
|
1004
1007
|
if (actionSlot) return actionSlot;
|
|
1005
1008
|
if (!action) return null;
|
|
@@ -949,12 +949,12 @@ function FeatureBentoImageGrid({
|
|
|
949
949
|
patternOpacity,
|
|
950
950
|
patternClassName
|
|
951
951
|
}) {
|
|
952
|
-
const renderItemIcon =
|
|
952
|
+
const renderItemIcon = React__namespace.useCallback((item) => {
|
|
953
953
|
if (item.icon) return item.icon;
|
|
954
954
|
if (item.iconName) return /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: item.iconName, size: 24 });
|
|
955
955
|
return null;
|
|
956
956
|
}, []);
|
|
957
|
-
const renderItemImage =
|
|
957
|
+
const renderItemImage = React__namespace.useCallback((item, imageClassName) => {
|
|
958
958
|
if (item.imageSlot) return item.imageSlot;
|
|
959
959
|
if (item.imageSrc) {
|
|
960
960
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -970,13 +970,15 @@ function FeatureBentoImageGrid({
|
|
|
970
970
|
}
|
|
971
971
|
return null;
|
|
972
972
|
}, [optixFlowConfig]);
|
|
973
|
-
const renderLargeCard =
|
|
973
|
+
const renderLargeCard = React__namespace.useCallback((item) => {
|
|
974
|
+
const iconContent = renderItemIcon(item);
|
|
975
|
+
const hasIconBadgeContent = iconContent || item.iconBadge;
|
|
974
976
|
const cardContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
975
977
|
renderItemImage(item, "h-full max-h-[580px] w-full rounded-xl object-cover object-center"),
|
|
976
978
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 right-0 bottom-0 left-0 translate-y-20 rounded-xl bg-linear-to-t from-primary to-transparent transition-transform duration-300 group-hover:translate-y-0" }),
|
|
977
979
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-0 flex h-full w-full flex-col justify-between p-7", children: [
|
|
978
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("ml-auto flex w-fit items-center gap-1 p-2.5 text-sm font-semibold text-background", item.iconBadgeClassName), children: [
|
|
979
|
-
|
|
980
|
+
hasIconBadgeContent && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("ml-auto flex w-fit items-center gap-1 p-2.5 text-sm font-semibold text-background", item.iconBadgeClassName), children: [
|
|
981
|
+
iconContent,
|
|
980
982
|
item.iconBadge
|
|
981
983
|
] }),
|
|
982
984
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5 text-background", children: [
|
|
@@ -1000,7 +1002,9 @@ function FeatureBentoImageGrid({
|
|
|
1000
1002
|
}
|
|
1001
1003
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("group relative col-span-2 row-span-3 overflow-hidden rounded-xl", largeCardClassName, item.className), children: cardContent });
|
|
1002
1004
|
}, [largeCardClassName, renderItemImage, renderItemIcon]);
|
|
1003
|
-
const renderSmallCard =
|
|
1005
|
+
const renderSmallCard = React__namespace.useCallback((item, index) => {
|
|
1006
|
+
const iconContent = renderItemIcon(item);
|
|
1007
|
+
const hasIconBadgeContent = iconContent || item.iconBadge;
|
|
1004
1008
|
const cardContent = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1005
1009
|
renderItemImage(item, cn(
|
|
1006
1010
|
"h-full w-full rounded-xl object-cover object-center",
|
|
@@ -1008,8 +1012,8 @@ function FeatureBentoImageGrid({
|
|
|
1008
1012
|
)),
|
|
1009
1013
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 right-0 bottom-0 left-0 translate-y-10 rounded-xl bg-linear-to-t from-primary to-transparent opacity-80 transition-transform duration-300 group-hover:translate-y-0" }),
|
|
1010
1014
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-0 flex h-full w-full flex-col justify-between p-7", children: [
|
|
1011
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("ml-auto flex w-fit items-center gap-1 p-2.5 text-sm font-semibold text-background", item.iconBadgeClassName), children: [
|
|
1012
|
-
|
|
1015
|
+
hasIconBadgeContent && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("ml-auto flex w-fit items-center gap-1 p-2.5 text-sm font-semibold text-background", item.iconBadgeClassName), children: [
|
|
1016
|
+
iconContent,
|
|
1013
1017
|
item.iconBadge
|
|
1014
1018
|
] }),
|
|
1015
1019
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5 text-background", children: [
|
|
@@ -928,12 +928,12 @@ function FeatureBentoImageGrid({
|
|
|
928
928
|
patternOpacity,
|
|
929
929
|
patternClassName
|
|
930
930
|
}) {
|
|
931
|
-
const renderItemIcon =
|
|
931
|
+
const renderItemIcon = React.useCallback((item) => {
|
|
932
932
|
if (item.icon) return item.icon;
|
|
933
933
|
if (item.iconName) return /* @__PURE__ */ jsx(DynamicIcon, { name: item.iconName, size: 24 });
|
|
934
934
|
return null;
|
|
935
935
|
}, []);
|
|
936
|
-
const renderItemImage =
|
|
936
|
+
const renderItemImage = React.useCallback((item, imageClassName) => {
|
|
937
937
|
if (item.imageSlot) return item.imageSlot;
|
|
938
938
|
if (item.imageSrc) {
|
|
939
939
|
return /* @__PURE__ */ jsx(
|
|
@@ -949,13 +949,15 @@ function FeatureBentoImageGrid({
|
|
|
949
949
|
}
|
|
950
950
|
return null;
|
|
951
951
|
}, [optixFlowConfig]);
|
|
952
|
-
const renderLargeCard =
|
|
952
|
+
const renderLargeCard = React.useCallback((item) => {
|
|
953
|
+
const iconContent = renderItemIcon(item);
|
|
954
|
+
const hasIconBadgeContent = iconContent || item.iconBadge;
|
|
953
955
|
const cardContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
954
956
|
renderItemImage(item, "h-full max-h-[580px] w-full rounded-xl object-cover object-center"),
|
|
955
957
|
/* @__PURE__ */ jsx("div", { className: "absolute top-0 right-0 bottom-0 left-0 translate-y-20 rounded-xl bg-linear-to-t from-primary to-transparent transition-transform duration-300 group-hover:translate-y-0" }),
|
|
956
958
|
/* @__PURE__ */ jsxs("div", { className: "absolute top-0 flex h-full w-full flex-col justify-between p-7", children: [
|
|
957
|
-
/* @__PURE__ */ jsxs("span", { className: cn("ml-auto flex w-fit items-center gap-1 p-2.5 text-sm font-semibold text-background", item.iconBadgeClassName), children: [
|
|
958
|
-
|
|
959
|
+
hasIconBadgeContent && /* @__PURE__ */ jsxs("span", { className: cn("ml-auto flex w-fit items-center gap-1 p-2.5 text-sm font-semibold text-background", item.iconBadgeClassName), children: [
|
|
960
|
+
iconContent,
|
|
959
961
|
item.iconBadge
|
|
960
962
|
] }),
|
|
961
963
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 text-background", children: [
|
|
@@ -979,7 +981,9 @@ function FeatureBentoImageGrid({
|
|
|
979
981
|
}
|
|
980
982
|
return /* @__PURE__ */ jsx("div", { className: cn("group relative col-span-2 row-span-3 overflow-hidden rounded-xl", largeCardClassName, item.className), children: cardContent });
|
|
981
983
|
}, [largeCardClassName, renderItemImage, renderItemIcon]);
|
|
982
|
-
const renderSmallCard =
|
|
984
|
+
const renderSmallCard = React.useCallback((item, index) => {
|
|
985
|
+
const iconContent = renderItemIcon(item);
|
|
986
|
+
const hasIconBadgeContent = iconContent || item.iconBadge;
|
|
983
987
|
const cardContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
984
988
|
renderItemImage(item, cn(
|
|
985
989
|
"h-full w-full rounded-xl object-cover object-center",
|
|
@@ -987,8 +991,8 @@ function FeatureBentoImageGrid({
|
|
|
987
991
|
)),
|
|
988
992
|
/* @__PURE__ */ jsx("div", { className: "absolute top-0 right-0 bottom-0 left-0 translate-y-10 rounded-xl bg-linear-to-t from-primary to-transparent opacity-80 transition-transform duration-300 group-hover:translate-y-0" }),
|
|
989
993
|
/* @__PURE__ */ jsxs("div", { className: "absolute top-0 flex h-full w-full flex-col justify-between p-7", children: [
|
|
990
|
-
/* @__PURE__ */ jsxs("span", { className: cn("ml-auto flex w-fit items-center gap-1 p-2.5 text-sm font-semibold text-background", item.iconBadgeClassName), children: [
|
|
991
|
-
|
|
994
|
+
hasIconBadgeContent && /* @__PURE__ */ jsxs("span", { className: cn("ml-auto flex w-fit items-center gap-1 p-2.5 text-sm font-semibold text-background", item.iconBadgeClassName), children: [
|
|
995
|
+
iconContent,
|
|
992
996
|
item.iconBadge
|
|
993
997
|
] }),
|
|
994
998
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 text-background", children: [
|
|
@@ -582,7 +582,7 @@ var Section = React__namespace.default.forwardRef(
|
|
|
582
582
|
Section.displayName = "Section";
|
|
583
583
|
function FeatureBentoUtilities({
|
|
584
584
|
label,
|
|
585
|
-
labelIconName
|
|
585
|
+
labelIconName,
|
|
586
586
|
labelIcon,
|
|
587
587
|
title,
|
|
588
588
|
description,
|
|
@@ -605,7 +605,7 @@ function FeatureBentoUtilities({
|
|
|
605
605
|
patternOpacity,
|
|
606
606
|
patternClassName
|
|
607
607
|
}) {
|
|
608
|
-
const renderCard =
|
|
608
|
+
const renderCard = React__namespace.useCallback((card, index) => {
|
|
609
609
|
const hasImage = card.imageSrc || card.imageSlot;
|
|
610
610
|
const cardClasses = cn(
|
|
611
611
|
hasImage ? "overflow-hidden pt-0" : "p-6",
|
|
@@ -651,12 +651,16 @@ function FeatureBentoUtilities({
|
|
|
651
651
|
card.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: card.description })
|
|
652
652
|
] }, index);
|
|
653
653
|
}, [optixFlowConfig]);
|
|
654
|
-
const renderColumn =
|
|
654
|
+
const renderColumn = React__namespace.useCallback((cards, slot) => {
|
|
655
655
|
if (slot) return slot;
|
|
656
656
|
if (!cards || cards.length === 0) return null;
|
|
657
657
|
return cards.map((card, index) => renderCard(card, index));
|
|
658
658
|
}, [renderCard]);
|
|
659
|
-
const labelIconElement = React.useMemo(() =>
|
|
659
|
+
const labelIconElement = React.useMemo(() => {
|
|
660
|
+
if (labelIcon) return labelIcon;
|
|
661
|
+
if (labelIconName) return /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: labelIconName, size: 20 });
|
|
662
|
+
return null;
|
|
663
|
+
}, [labelIcon, labelIconName]);
|
|
660
664
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
661
665
|
Section,
|
|
662
666
|
{
|
|
@@ -668,7 +672,7 @@ function FeatureBentoUtilities({
|
|
|
668
672
|
className: cn("bg-gray-50 dark:bg-background", className),
|
|
669
673
|
containerClassName: cn("max-w-7xl", containerClassName),
|
|
670
674
|
children: [
|
|
671
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center gap-2 text-muted-foreground", labelClassName), children: [
|
|
675
|
+
(labelIconElement || label) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center gap-2 text-muted-foreground", labelClassName), children: [
|
|
672
676
|
labelIconElement,
|
|
673
677
|
label && (typeof label === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: label }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm", children: label }))
|
|
674
678
|
] }),
|
|
@@ -560,7 +560,7 @@ var Section = React__default.forwardRef(
|
|
|
560
560
|
Section.displayName = "Section";
|
|
561
561
|
function FeatureBentoUtilities({
|
|
562
562
|
label,
|
|
563
|
-
labelIconName
|
|
563
|
+
labelIconName,
|
|
564
564
|
labelIcon,
|
|
565
565
|
title,
|
|
566
566
|
description,
|
|
@@ -583,7 +583,7 @@ function FeatureBentoUtilities({
|
|
|
583
583
|
patternOpacity,
|
|
584
584
|
patternClassName
|
|
585
585
|
}) {
|
|
586
|
-
const renderCard =
|
|
586
|
+
const renderCard = React.useCallback((card, index) => {
|
|
587
587
|
const hasImage = card.imageSrc || card.imageSlot;
|
|
588
588
|
const cardClasses = cn(
|
|
589
589
|
hasImage ? "overflow-hidden pt-0" : "p-6",
|
|
@@ -629,12 +629,16 @@ function FeatureBentoUtilities({
|
|
|
629
629
|
card.description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: card.description })
|
|
630
630
|
] }, index);
|
|
631
631
|
}, [optixFlowConfig]);
|
|
632
|
-
const renderColumn =
|
|
632
|
+
const renderColumn = React.useCallback((cards, slot) => {
|
|
633
633
|
if (slot) return slot;
|
|
634
634
|
if (!cards || cards.length === 0) return null;
|
|
635
635
|
return cards.map((card, index) => renderCard(card, index));
|
|
636
636
|
}, [renderCard]);
|
|
637
|
-
const labelIconElement = useMemo(() =>
|
|
637
|
+
const labelIconElement = useMemo(() => {
|
|
638
|
+
if (labelIcon) return labelIcon;
|
|
639
|
+
if (labelIconName) return /* @__PURE__ */ jsx(DynamicIcon, { name: labelIconName, size: 20 });
|
|
640
|
+
return null;
|
|
641
|
+
}, [labelIcon, labelIconName]);
|
|
638
642
|
return /* @__PURE__ */ jsxs(
|
|
639
643
|
Section,
|
|
640
644
|
{
|
|
@@ -646,7 +650,7 @@ function FeatureBentoUtilities({
|
|
|
646
650
|
className: cn("bg-gray-50 dark:bg-background", className),
|
|
647
651
|
containerClassName: cn("max-w-7xl", containerClassName),
|
|
648
652
|
children: [
|
|
649
|
-
/* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2 text-muted-foreground", labelClassName), children: [
|
|
653
|
+
(labelIconElement || label) && /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2 text-muted-foreground", labelClassName), children: [
|
|
650
654
|
labelIconElement,
|
|
651
655
|
label && (typeof label === "string" ? /* @__PURE__ */ jsx("p", { className: "text-sm", children: label }) : /* @__PURE__ */ jsx("div", { className: "text-sm", children: label }))
|
|
652
656
|
] }),
|