@opensite/ui 0.8.1 → 0.8.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.
Files changed (83) hide show
  1. package/dist/carousel-horizontal-cards.cjs +8 -6
  2. package/dist/carousel-horizontal-cards.js +8 -6
  3. package/dist/carousel-image-hero.cjs +119 -177
  4. package/dist/carousel-image-hero.d.cts +1 -5
  5. package/dist/carousel-image-hero.d.ts +1 -5
  6. package/dist/carousel-image-hero.js +119 -177
  7. package/dist/carousel-portfolio-hero.cjs +138 -59
  8. package/dist/carousel-portfolio-hero.js +138 -59
  9. package/dist/carousel-product-feature-showcase.cjs +148 -95
  10. package/dist/carousel-product-feature-showcase.js +148 -95
  11. package/dist/carousel-progress-slider.cjs +13 -9
  12. package/dist/carousel-progress-slider.js +13 -9
  13. package/dist/carousel-scrolling-feature-showcase.cjs +105 -54
  14. package/dist/carousel-scrolling-feature-showcase.js +105 -54
  15. package/dist/feature-accordion-image.cjs +9 -8
  16. package/dist/feature-accordion-image.js +9 -8
  17. package/dist/feature-animated-carousel.cjs +65 -49
  18. package/dist/feature-animated-carousel.js +65 -49
  19. package/dist/feature-badge-grid-six.cjs +20 -17
  20. package/dist/feature-badge-grid-six.js +21 -18
  21. package/dist/feature-bento-image-grid.cjs +12 -8
  22. package/dist/feature-bento-image-grid.js +12 -8
  23. package/dist/feature-bento-utilities.cjs +9 -5
  24. package/dist/feature-bento-utilities.js +9 -5
  25. package/dist/feature-capabilities-grid.cjs +41 -38
  26. package/dist/feature-capabilities-grid.js +41 -38
  27. package/dist/feature-card-grid-linked.cjs +18 -18
  28. package/dist/feature-card-grid-linked.js +19 -19
  29. package/dist/feature-carousel-progress.cjs +3 -3
  30. package/dist/feature-carousel-progress.js +4 -4
  31. package/dist/feature-category-image-cards.cjs +3 -3
  32. package/dist/feature-category-image-cards.js +4 -4
  33. package/dist/feature-checklist-image.cjs +2 -2
  34. package/dist/feature-checklist-image.js +2 -2
  35. package/dist/feature-checklist-three-column.cjs +6 -6
  36. package/dist/feature-checklist-three-column.js +7 -7
  37. package/dist/feature-icon-grid-accent.cjs +2 -2
  38. package/dist/feature-icon-grid-accent.js +2 -2
  39. package/dist/feature-icon-grid-bordered.cjs +29 -31
  40. package/dist/feature-icon-grid-bordered.d.cts +9 -9
  41. package/dist/feature-icon-grid-bordered.d.ts +9 -9
  42. package/dist/feature-icon-grid-bordered.js +30 -32
  43. package/dist/feature-icon-grid-muted.cjs +6 -6
  44. package/dist/feature-icon-grid-muted.d.cts +9 -9
  45. package/dist/feature-icon-grid-muted.d.ts +9 -9
  46. package/dist/feature-icon-grid-muted.js +7 -7
  47. package/dist/feature-icon-tabs-content.cjs +8 -8
  48. package/dist/feature-icon-tabs-content.d.cts +13 -13
  49. package/dist/feature-icon-tabs-content.d.ts +13 -13
  50. package/dist/feature-icon-tabs-content.js +9 -9
  51. package/dist/feature-image-cards-three-column.cjs +26 -27
  52. package/dist/feature-image-cards-three-column.js +27 -28
  53. package/dist/feature-image-overlay-badge.cjs +23 -21
  54. package/dist/feature-image-overlay-badge.js +24 -22
  55. package/dist/feature-integration-cards.cjs +19 -18
  56. package/dist/feature-integration-cards.js +20 -19
  57. package/dist/feature-numbered-cards.cjs +2 -2
  58. package/dist/feature-numbered-cards.js +3 -3
  59. package/dist/feature-pattern-grid-links.cjs +26 -29
  60. package/dist/feature-pattern-grid-links.d.cts +1 -5
  61. package/dist/feature-pattern-grid-links.d.ts +1 -5
  62. package/dist/feature-pattern-grid-links.js +27 -30
  63. package/dist/feature-showcase.cjs +441 -40
  64. package/dist/feature-showcase.d.cts +62 -5
  65. package/dist/feature-showcase.d.ts +62 -5
  66. package/dist/feature-showcase.js +438 -37
  67. package/dist/feature-split-image-reverse.cjs +15 -36
  68. package/dist/feature-split-image-reverse.js +16 -37
  69. package/dist/feature-split-image.cjs +15 -36
  70. package/dist/feature-split-image.js +16 -37
  71. package/dist/feature-stats-highlight.cjs +20 -32
  72. package/dist/feature-stats-highlight.js +21 -33
  73. package/dist/feature-tabbed-content-image.cjs +11 -6
  74. package/dist/feature-tabbed-content-image.js +11 -6
  75. package/dist/feature-three-column-values.cjs +6 -6
  76. package/dist/feature-three-column-values.js +6 -6
  77. package/dist/feature-utility-cards-grid.cjs +17 -15
  78. package/dist/feature-utility-cards-grid.js +18 -16
  79. package/dist/navbar-tabbed-sections.cjs +23 -16
  80. package/dist/navbar-tabbed-sections.js +23 -16
  81. package/dist/registry.cjs +964 -714
  82. package/dist/registry.js +966 -716
  83. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var React = require('react');
4
+ var React6 = require('react');
5
5
  var clsx = require('clsx');
6
6
  var tailwindMerge = require('tailwind-merge');
7
7
  var classVarianceAuthority = require('class-variance-authority');
@@ -26,7 +26,7 @@ function _interopNamespace(e) {
26
26
  return Object.freeze(n);
27
27
  }
28
28
 
29
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
29
+ var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
30
30
 
31
31
  // components/blocks/carousel/carousel-portfolio-hero.tsx
32
32
  function cn(...inputs) {
@@ -117,7 +117,7 @@ function useNavigation({
117
117
  href,
118
118
  onClick
119
119
  } = {}) {
120
- const linkType = React__namespace.useMemo(() => {
120
+ const linkType = React6__namespace.useMemo(() => {
121
121
  if (!href || href.trim() === "") {
122
122
  return onClick ? "none" : "none";
123
123
  }
@@ -138,7 +138,7 @@ function useNavigation({
138
138
  return "internal";
139
139
  }
140
140
  }, [href, onClick]);
141
- const normalizedHref = React__namespace.useMemo(() => {
141
+ const normalizedHref = React6__namespace.useMemo(() => {
142
142
  if (!href || href.trim() === "") {
143
143
  return void 0;
144
144
  }
@@ -156,7 +156,7 @@ function useNavigation({
156
156
  return trimmed;
157
157
  }
158
158
  }, [href, linkType]);
159
- const target = React__namespace.useMemo(() => {
159
+ const target = React6__namespace.useMemo(() => {
160
160
  switch (linkType) {
161
161
  case "external":
162
162
  return "_blank";
@@ -169,7 +169,7 @@ function useNavigation({
169
169
  return void 0;
170
170
  }
171
171
  }, [linkType]);
172
- const rel = React__namespace.useMemo(() => {
172
+ const rel = React6__namespace.useMemo(() => {
173
173
  if (linkType === "external") {
174
174
  return "noopener noreferrer";
175
175
  }
@@ -178,7 +178,7 @@ function useNavigation({
178
178
  const isExternal = linkType === "external";
179
179
  const isInternal = linkType === "internal";
180
180
  const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
181
- const handleClick = React__namespace.useCallback(
181
+ const handleClick = React6__namespace.useCallback(
182
182
  (event) => {
183
183
  if (onClick) {
184
184
  try {
@@ -362,7 +362,7 @@ var buttonVariants = classVarianceAuthority.cva(baseStyles, {
362
362
  size: "default"
363
363
  }
364
364
  });
365
- var Pressable = React__namespace.forwardRef(
365
+ var Pressable = React6__namespace.forwardRef(
366
366
  ({
367
367
  children,
368
368
  className,
@@ -468,10 +468,10 @@ function DynamicIcon({
468
468
  className,
469
469
  alt
470
470
  }) {
471
- const [svgContent, setSvgContent] = React__namespace.useState(null);
472
- const [isLoading, setIsLoading] = React__namespace.useState(true);
473
- const [error, setError] = React__namespace.useState(null);
474
- const { url, iconName } = React__namespace.useMemo(() => {
471
+ const [svgContent, setSvgContent] = React6__namespace.useState(null);
472
+ const [isLoading, setIsLoading] = React6__namespace.useState(true);
473
+ const [error, setError] = React6__namespace.useState(null);
474
+ const { url, iconName } = React6__namespace.useMemo(() => {
475
475
  const separator = name.includes("/") ? "/" : ":";
476
476
  const [prefix, iconName2] = name.split(separator);
477
477
  const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}`;
@@ -480,7 +480,7 @@ function DynamicIcon({
480
480
  iconName: iconName2
481
481
  };
482
482
  }, [name, size]);
483
- React__namespace.useEffect(() => {
483
+ React6__namespace.useEffect(() => {
484
484
  let isMounted = true;
485
485
  const fetchSvg = async () => {
486
486
  const cached = svgCache.get(url);
@@ -574,7 +574,7 @@ var maxWidthStyles = {
574
574
  "4xl": "max-w-[1536px]",
575
575
  full: "max-w-full"
576
576
  };
577
- var Container = React__namespace.default.forwardRef(
577
+ var Container = React6__namespace.default.forwardRef(
578
578
  ({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
579
579
  const Component = as;
580
580
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -879,7 +879,7 @@ var spacingStyles = {
879
879
  };
880
880
  var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
881
881
  var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
882
- var Section = React__namespace.default.forwardRef(
882
+ var Section = React6__namespace.default.forwardRef(
883
883
  ({
884
884
  id,
885
885
  title,
@@ -947,7 +947,7 @@ function CarouselPortfolioHero({
947
947
  actionsSlot,
948
948
  autoPlayInterval = 5e3,
949
949
  className,
950
- containerClassName,
950
+ containerClassName = "mx-auto w-full p-0 px-0 sm:px-0 lg:px-0 max-w-full relative z-10 h-full flex flex-col justify-center",
951
951
  contentClassName,
952
952
  tagClassName,
953
953
  titleClassName,
@@ -962,24 +962,46 @@ function CarouselPortfolioHero({
962
962
  patternOpacity,
963
963
  slideMediaBrightness = "50"
964
964
  }) {
965
- const [currentIndex, setCurrentIndex] = React__namespace.useState(0);
966
- const goToNext = React__namespace.useCallback(() => {
965
+ const [currentIndex, setCurrentIndex] = React6__namespace.useState(0);
966
+ const intervalRef = React6__namespace.useRef(null);
967
+ const resetInterval = React6__namespace.useCallback(() => {
968
+ if (intervalRef.current) {
969
+ clearInterval(intervalRef.current);
970
+ }
971
+ intervalRef.current = setInterval(() => {
972
+ setCurrentIndex((prevIndex) => (prevIndex + 1) % (slides?.length ?? 1));
973
+ }, autoPlayInterval);
974
+ }, [autoPlayInterval, slides?.length]);
975
+ const goToNext = React6__namespace.useCallback(() => {
967
976
  setCurrentIndex((prevIndex) => (prevIndex + 1) % (slides?.length ?? 1));
968
- }, [slides?.length]);
969
- const goToPrev = React__namespace.useCallback(() => {
977
+ resetInterval();
978
+ }, [slides?.length, resetInterval]);
979
+ const goToPrev = React6__namespace.useCallback(() => {
970
980
  setCurrentIndex(
971
981
  (prevIndex) => (prevIndex - 1 + (slides?.length ?? 1)) % (slides?.length ?? 1)
972
982
  );
973
- }, [slides?.length]);
974
- React__namespace.useEffect(() => {
975
- const interval = setInterval(goToNext, autoPlayInterval);
976
- return () => clearInterval(interval);
977
- }, [goToNext, autoPlayInterval]);
983
+ resetInterval();
984
+ }, [slides?.length, resetInterval]);
985
+ React6__namespace.useEffect(() => {
986
+ resetInterval();
987
+ return () => {
988
+ if (intervalRef.current) {
989
+ clearInterval(intervalRef.current);
990
+ }
991
+ };
992
+ }, [resetInterval]);
978
993
  const renderActions = () => {
979
994
  if (actionsSlot) return actionsSlot;
980
995
  if (!actions || actions.length === 0) return null;
981
996
  return actions.map((action, index) => {
982
- const { label, icon, iconAfter, children, className: actionClassName, ...pressableProps } = action;
997
+ const {
998
+ label,
999
+ icon,
1000
+ iconAfter,
1001
+ children,
1002
+ className: actionClassName,
1003
+ ...pressableProps
1004
+ } = action;
983
1005
  return /* @__PURE__ */ jsxRuntime.jsx(
984
1006
  Pressable,
985
1007
  {
@@ -1005,6 +1027,7 @@ function CarouselPortfolioHero({
1005
1027
  className: cn("relative h-screen w-full overflow-hidden", className),
1006
1028
  pattern,
1007
1029
  patternOpacity,
1030
+ containerClassName,
1008
1031
  children: [
1009
1032
  slidesSlot ? slidesSlot : slides?.map((slide, index) => /* @__PURE__ */ jsxRuntime.jsx(
1010
1033
  "div",
@@ -1030,43 +1053,99 @@ function CarouselPortfolioHero({
1030
1053
  },
1031
1054
  slide.id
1032
1055
  )),
1033
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("relative z-10 flex h-full w-full flex-col justify-end px-6 pb-16 text-white md:px-8 lg:px-12", containerClassName), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "container mx-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("max-w-4xl", contentClassName), children: [
1034
- currentSlide?.tag && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4", children: typeof currentSlide.tag === "string" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("inline-block rounded-full bg-primary px-3 py-1 text-sm font-medium", tagClassName), children: currentSlide.tag }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: tagClassName, children: currentSlide.tag }) }),
1035
- currentSlide?.title && (typeof currentSlide.title === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h1", { className: cn("text-4xl font-bold sm:text-5xl md:text-6xl", titleClassName), children: currentSlide.title }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: titleClassName, children: currentSlide.title })),
1036
- currentSlide?.description && (typeof currentSlide.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("mt-4 text-lg text-white/80 sm:text-xl md:max-w-2xl", descriptionClassName), children: currentSlide.description }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: currentSlide.description })),
1037
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("mt-8 flex items-center gap-4", actionsClassName), children: [
1038
- renderActions(),
1039
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("ml-auto flex items-center gap-2", navigationClassName), children: [
1040
- /* @__PURE__ */ jsxRuntime.jsx(
1041
- Pressable,
1056
+ /* @__PURE__ */ jsxRuntime.jsx(
1057
+ "div",
1058
+ {
1059
+ className: cn(
1060
+ "relative z-10 flex h-full w-full flex-col justify-end px-6 pb-16 text-white md:px-8 lg:px-12"
1061
+ ),
1062
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("max-w-4xl", contentClassName), children: [
1063
+ currentSlide?.tag && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4", children: typeof currentSlide.tag === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1064
+ "span",
1042
1065
  {
1043
- variant: "outline",
1044
- size: "icon",
1045
- className: "rounded-full border-white/40 bg-black/30 text-white hover:bg-black/50 hover:text-white",
1046
- onClick: goToPrev,
1047
- asButton: true,
1048
- children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/chevron-left", size: 20 })
1066
+ className: cn(
1067
+ "inline-block rounded-full bg-primary px-3 py-1 text-sm font-medium",
1068
+ tagClassName
1069
+ ),
1070
+ children: currentSlide.tag
1049
1071
  }
1050
- ),
1051
- /* @__PURE__ */ jsxRuntime.jsx(
1052
- Pressable,
1072
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: tagClassName, children: currentSlide.tag }) }),
1073
+ currentSlide?.title && (typeof currentSlide.title === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1074
+ "h1",
1053
1075
  {
1054
- variant: "outline",
1055
- size: "icon",
1056
- className: "rounded-full border-white/40 bg-black/30 text-white hover:bg-black/50 hover:text-white",
1057
- onClick: goToNext,
1058
- asButton: true,
1059
- children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/chevron-right", size: 20 })
1076
+ className: cn(
1077
+ "text-4xl font-bold sm:text-5xl md:text-6xl text-balance text-shadow",
1078
+ titleClassName
1079
+ ),
1080
+ children: currentSlide.title
1060
1081
  }
1061
- ),
1062
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("ml-3 text-sm text-white/80", counterClassName), children: [
1063
- currentIndex + 1,
1064
- " / ",
1065
- slides?.length ?? 0
1066
- ] })
1067
- ] })
1068
- ] })
1069
- ] }) }) })
1082
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: titleClassName, children: currentSlide.title })),
1083
+ currentSlide?.description && (typeof currentSlide.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1084
+ "p",
1085
+ {
1086
+ className: cn(
1087
+ "mt-4 text-lg text-white/80 sm:text-xl md:max-w-2xl text-balance text-shadow",
1088
+ descriptionClassName
1089
+ ),
1090
+ children: currentSlide.description
1091
+ }
1092
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: currentSlide.description })),
1093
+ /* @__PURE__ */ jsxRuntime.jsxs(
1094
+ "div",
1095
+ {
1096
+ className: cn("mt-8 flex items-center gap-4", actionsClassName),
1097
+ children: [
1098
+ renderActions(),
1099
+ /* @__PURE__ */ jsxRuntime.jsxs(
1100
+ "div",
1101
+ {
1102
+ className: cn(
1103
+ "ml-auto flex items-center gap-2",
1104
+ navigationClassName
1105
+ ),
1106
+ children: [
1107
+ /* @__PURE__ */ jsxRuntime.jsx(
1108
+ Pressable,
1109
+ {
1110
+ variant: "outline",
1111
+ size: "icon",
1112
+ className: "rounded-full border-white/40 bg-black/30 text-white hover:bg-black/50 hover:text-white",
1113
+ onClick: goToPrev,
1114
+ asButton: true,
1115
+ children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/chevron-left", size: 20 })
1116
+ }
1117
+ ),
1118
+ /* @__PURE__ */ jsxRuntime.jsx(
1119
+ Pressable,
1120
+ {
1121
+ variant: "outline",
1122
+ size: "icon",
1123
+ className: "rounded-full border-white/40 bg-black/30 text-white hover:bg-black/50 hover:text-white",
1124
+ onClick: goToNext,
1125
+ asButton: true,
1126
+ children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/chevron-right", size: 20 })
1127
+ }
1128
+ ),
1129
+ /* @__PURE__ */ jsxRuntime.jsxs(
1130
+ "div",
1131
+ {
1132
+ className: cn("ml-3 text-sm text-white/80", counterClassName),
1133
+ children: [
1134
+ currentIndex + 1,
1135
+ " / ",
1136
+ slides?.length ?? 0
1137
+ ]
1138
+ }
1139
+ )
1140
+ ]
1141
+ }
1142
+ )
1143
+ ]
1144
+ }
1145
+ )
1146
+ ] }) })
1147
+ }
1148
+ )
1070
1149
  ]
1071
1150
  }
1072
1151
  );
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import * as React from 'react';
3
- import React__default from 'react';
2
+ import * as React6 from 'react';
3
+ import React6__default from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { cva } from 'class-variance-authority';
@@ -96,7 +96,7 @@ function useNavigation({
96
96
  href,
97
97
  onClick
98
98
  } = {}) {
99
- const linkType = React.useMemo(() => {
99
+ const linkType = React6.useMemo(() => {
100
100
  if (!href || href.trim() === "") {
101
101
  return onClick ? "none" : "none";
102
102
  }
@@ -117,7 +117,7 @@ function useNavigation({
117
117
  return "internal";
118
118
  }
119
119
  }, [href, onClick]);
120
- const normalizedHref = React.useMemo(() => {
120
+ const normalizedHref = React6.useMemo(() => {
121
121
  if (!href || href.trim() === "") {
122
122
  return void 0;
123
123
  }
@@ -135,7 +135,7 @@ function useNavigation({
135
135
  return trimmed;
136
136
  }
137
137
  }, [href, linkType]);
138
- const target = React.useMemo(() => {
138
+ const target = React6.useMemo(() => {
139
139
  switch (linkType) {
140
140
  case "external":
141
141
  return "_blank";
@@ -148,7 +148,7 @@ function useNavigation({
148
148
  return void 0;
149
149
  }
150
150
  }, [linkType]);
151
- const rel = React.useMemo(() => {
151
+ const rel = React6.useMemo(() => {
152
152
  if (linkType === "external") {
153
153
  return "noopener noreferrer";
154
154
  }
@@ -157,7 +157,7 @@ function useNavigation({
157
157
  const isExternal = linkType === "external";
158
158
  const isInternal = linkType === "internal";
159
159
  const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
160
- const handleClick = React.useCallback(
160
+ const handleClick = React6.useCallback(
161
161
  (event) => {
162
162
  if (onClick) {
163
163
  try {
@@ -341,7 +341,7 @@ var buttonVariants = cva(baseStyles, {
341
341
  size: "default"
342
342
  }
343
343
  });
344
- var Pressable = React.forwardRef(
344
+ var Pressable = React6.forwardRef(
345
345
  ({
346
346
  children,
347
347
  className,
@@ -447,10 +447,10 @@ function DynamicIcon({
447
447
  className,
448
448
  alt
449
449
  }) {
450
- const [svgContent, setSvgContent] = React.useState(null);
451
- const [isLoading, setIsLoading] = React.useState(true);
452
- const [error, setError] = React.useState(null);
453
- const { url, iconName } = React.useMemo(() => {
450
+ const [svgContent, setSvgContent] = React6.useState(null);
451
+ const [isLoading, setIsLoading] = React6.useState(true);
452
+ const [error, setError] = React6.useState(null);
453
+ const { url, iconName } = React6.useMemo(() => {
454
454
  const separator = name.includes("/") ? "/" : ":";
455
455
  const [prefix, iconName2] = name.split(separator);
456
456
  const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}`;
@@ -459,7 +459,7 @@ function DynamicIcon({
459
459
  iconName: iconName2
460
460
  };
461
461
  }, [name, size]);
462
- React.useEffect(() => {
462
+ React6.useEffect(() => {
463
463
  let isMounted = true;
464
464
  const fetchSvg = async () => {
465
465
  const cached = svgCache.get(url);
@@ -553,7 +553,7 @@ var maxWidthStyles = {
553
553
  "4xl": "max-w-[1536px]",
554
554
  full: "max-w-full"
555
555
  };
556
- var Container = React__default.forwardRef(
556
+ var Container = React6__default.forwardRef(
557
557
  ({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
558
558
  const Component = as;
559
559
  return /* @__PURE__ */ jsx(
@@ -858,7 +858,7 @@ var spacingStyles = {
858
858
  };
859
859
  var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
860
860
  var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
861
- var Section = React__default.forwardRef(
861
+ var Section = React6__default.forwardRef(
862
862
  ({
863
863
  id,
864
864
  title,
@@ -926,7 +926,7 @@ function CarouselPortfolioHero({
926
926
  actionsSlot,
927
927
  autoPlayInterval = 5e3,
928
928
  className,
929
- containerClassName,
929
+ containerClassName = "mx-auto w-full p-0 px-0 sm:px-0 lg:px-0 max-w-full relative z-10 h-full flex flex-col justify-center",
930
930
  contentClassName,
931
931
  tagClassName,
932
932
  titleClassName,
@@ -941,24 +941,46 @@ function CarouselPortfolioHero({
941
941
  patternOpacity,
942
942
  slideMediaBrightness = "50"
943
943
  }) {
944
- const [currentIndex, setCurrentIndex] = React.useState(0);
945
- const goToNext = React.useCallback(() => {
944
+ const [currentIndex, setCurrentIndex] = React6.useState(0);
945
+ const intervalRef = React6.useRef(null);
946
+ const resetInterval = React6.useCallback(() => {
947
+ if (intervalRef.current) {
948
+ clearInterval(intervalRef.current);
949
+ }
950
+ intervalRef.current = setInterval(() => {
951
+ setCurrentIndex((prevIndex) => (prevIndex + 1) % (slides?.length ?? 1));
952
+ }, autoPlayInterval);
953
+ }, [autoPlayInterval, slides?.length]);
954
+ const goToNext = React6.useCallback(() => {
946
955
  setCurrentIndex((prevIndex) => (prevIndex + 1) % (slides?.length ?? 1));
947
- }, [slides?.length]);
948
- const goToPrev = React.useCallback(() => {
956
+ resetInterval();
957
+ }, [slides?.length, resetInterval]);
958
+ const goToPrev = React6.useCallback(() => {
949
959
  setCurrentIndex(
950
960
  (prevIndex) => (prevIndex - 1 + (slides?.length ?? 1)) % (slides?.length ?? 1)
951
961
  );
952
- }, [slides?.length]);
953
- React.useEffect(() => {
954
- const interval = setInterval(goToNext, autoPlayInterval);
955
- return () => clearInterval(interval);
956
- }, [goToNext, autoPlayInterval]);
962
+ resetInterval();
963
+ }, [slides?.length, resetInterval]);
964
+ React6.useEffect(() => {
965
+ resetInterval();
966
+ return () => {
967
+ if (intervalRef.current) {
968
+ clearInterval(intervalRef.current);
969
+ }
970
+ };
971
+ }, [resetInterval]);
957
972
  const renderActions = () => {
958
973
  if (actionsSlot) return actionsSlot;
959
974
  if (!actions || actions.length === 0) return null;
960
975
  return actions.map((action, index) => {
961
- const { label, icon, iconAfter, children, className: actionClassName, ...pressableProps } = action;
976
+ const {
977
+ label,
978
+ icon,
979
+ iconAfter,
980
+ children,
981
+ className: actionClassName,
982
+ ...pressableProps
983
+ } = action;
962
984
  return /* @__PURE__ */ jsx(
963
985
  Pressable,
964
986
  {
@@ -984,6 +1006,7 @@ function CarouselPortfolioHero({
984
1006
  className: cn("relative h-screen w-full overflow-hidden", className),
985
1007
  pattern,
986
1008
  patternOpacity,
1009
+ containerClassName,
987
1010
  children: [
988
1011
  slidesSlot ? slidesSlot : slides?.map((slide, index) => /* @__PURE__ */ jsx(
989
1012
  "div",
@@ -1009,43 +1032,99 @@ function CarouselPortfolioHero({
1009
1032
  },
1010
1033
  slide.id
1011
1034
  )),
1012
- /* @__PURE__ */ jsx("div", { className: cn("relative z-10 flex h-full w-full flex-col justify-end px-6 pb-16 text-white md:px-8 lg:px-12", containerClassName), children: /* @__PURE__ */ jsx("div", { className: "container mx-auto", children: /* @__PURE__ */ jsxs("div", { className: cn("max-w-4xl", contentClassName), children: [
1013
- currentSlide?.tag && /* @__PURE__ */ jsx("div", { className: "mb-4", children: typeof currentSlide.tag === "string" ? /* @__PURE__ */ jsx("span", { className: cn("inline-block rounded-full bg-primary px-3 py-1 text-sm font-medium", tagClassName), children: currentSlide.tag }) : /* @__PURE__ */ jsx("div", { className: tagClassName, children: currentSlide.tag }) }),
1014
- currentSlide?.title && (typeof currentSlide.title === "string" ? /* @__PURE__ */ jsx("h1", { className: cn("text-4xl font-bold sm:text-5xl md:text-6xl", titleClassName), children: currentSlide.title }) : /* @__PURE__ */ jsx("div", { className: titleClassName, children: currentSlide.title })),
1015
- currentSlide?.description && (typeof currentSlide.description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("mt-4 text-lg text-white/80 sm:text-xl md:max-w-2xl", descriptionClassName), children: currentSlide.description }) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: currentSlide.description })),
1016
- /* @__PURE__ */ jsxs("div", { className: cn("mt-8 flex items-center gap-4", actionsClassName), children: [
1017
- renderActions(),
1018
- /* @__PURE__ */ jsxs("div", { className: cn("ml-auto flex items-center gap-2", navigationClassName), children: [
1019
- /* @__PURE__ */ jsx(
1020
- Pressable,
1035
+ /* @__PURE__ */ jsx(
1036
+ "div",
1037
+ {
1038
+ className: cn(
1039
+ "relative z-10 flex h-full w-full flex-col justify-end px-6 pb-16 text-white md:px-8 lg:px-12"
1040
+ ),
1041
+ children: /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsxs("div", { className: cn("max-w-4xl", contentClassName), children: [
1042
+ currentSlide?.tag && /* @__PURE__ */ jsx("div", { className: "mb-4", children: typeof currentSlide.tag === "string" ? /* @__PURE__ */ jsx(
1043
+ "span",
1021
1044
  {
1022
- variant: "outline",
1023
- size: "icon",
1024
- className: "rounded-full border-white/40 bg-black/30 text-white hover:bg-black/50 hover:text-white",
1025
- onClick: goToPrev,
1026
- asButton: true,
1027
- children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/chevron-left", size: 20 })
1045
+ className: cn(
1046
+ "inline-block rounded-full bg-primary px-3 py-1 text-sm font-medium",
1047
+ tagClassName
1048
+ ),
1049
+ children: currentSlide.tag
1028
1050
  }
1029
- ),
1030
- /* @__PURE__ */ jsx(
1031
- Pressable,
1051
+ ) : /* @__PURE__ */ jsx("div", { className: tagClassName, children: currentSlide.tag }) }),
1052
+ currentSlide?.title && (typeof currentSlide.title === "string" ? /* @__PURE__ */ jsx(
1053
+ "h1",
1032
1054
  {
1033
- variant: "outline",
1034
- size: "icon",
1035
- className: "rounded-full border-white/40 bg-black/30 text-white hover:bg-black/50 hover:text-white",
1036
- onClick: goToNext,
1037
- asButton: true,
1038
- children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/chevron-right", size: 20 })
1055
+ className: cn(
1056
+ "text-4xl font-bold sm:text-5xl md:text-6xl text-balance text-shadow",
1057
+ titleClassName
1058
+ ),
1059
+ children: currentSlide.title
1039
1060
  }
1040
- ),
1041
- /* @__PURE__ */ jsxs("div", { className: cn("ml-3 text-sm text-white/80", counterClassName), children: [
1042
- currentIndex + 1,
1043
- " / ",
1044
- slides?.length ?? 0
1045
- ] })
1046
- ] })
1047
- ] })
1048
- ] }) }) })
1061
+ ) : /* @__PURE__ */ jsx("div", { className: titleClassName, children: currentSlide.title })),
1062
+ currentSlide?.description && (typeof currentSlide.description === "string" ? /* @__PURE__ */ jsx(
1063
+ "p",
1064
+ {
1065
+ className: cn(
1066
+ "mt-4 text-lg text-white/80 sm:text-xl md:max-w-2xl text-balance text-shadow",
1067
+ descriptionClassName
1068
+ ),
1069
+ children: currentSlide.description
1070
+ }
1071
+ ) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: currentSlide.description })),
1072
+ /* @__PURE__ */ jsxs(
1073
+ "div",
1074
+ {
1075
+ className: cn("mt-8 flex items-center gap-4", actionsClassName),
1076
+ children: [
1077
+ renderActions(),
1078
+ /* @__PURE__ */ jsxs(
1079
+ "div",
1080
+ {
1081
+ className: cn(
1082
+ "ml-auto flex items-center gap-2",
1083
+ navigationClassName
1084
+ ),
1085
+ children: [
1086
+ /* @__PURE__ */ jsx(
1087
+ Pressable,
1088
+ {
1089
+ variant: "outline",
1090
+ size: "icon",
1091
+ className: "rounded-full border-white/40 bg-black/30 text-white hover:bg-black/50 hover:text-white",
1092
+ onClick: goToPrev,
1093
+ asButton: true,
1094
+ children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/chevron-left", size: 20 })
1095
+ }
1096
+ ),
1097
+ /* @__PURE__ */ jsx(
1098
+ Pressable,
1099
+ {
1100
+ variant: "outline",
1101
+ size: "icon",
1102
+ className: "rounded-full border-white/40 bg-black/30 text-white hover:bg-black/50 hover:text-white",
1103
+ onClick: goToNext,
1104
+ asButton: true,
1105
+ children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/chevron-right", size: 20 })
1106
+ }
1107
+ ),
1108
+ /* @__PURE__ */ jsxs(
1109
+ "div",
1110
+ {
1111
+ className: cn("ml-3 text-sm text-white/80", counterClassName),
1112
+ children: [
1113
+ currentIndex + 1,
1114
+ " / ",
1115
+ slides?.length ?? 0
1116
+ ]
1117
+ }
1118
+ )
1119
+ ]
1120
+ }
1121
+ )
1122
+ ]
1123
+ }
1124
+ )
1125
+ ] }) })
1126
+ }
1127
+ )
1049
1128
  ]
1050
1129
  }
1051
1130
  );