@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,6 +1,6 @@
1
1
  "use client";
2
- import * as React from 'react';
3
- import React__default from 'react';
2
+ import * as React5 from 'react';
3
+ import React5__default from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { cva } from 'class-variance-authority';
@@ -86,7 +86,7 @@ function useNavigation({
86
86
  href,
87
87
  onClick
88
88
  } = {}) {
89
- const linkType = React.useMemo(() => {
89
+ const linkType = React5.useMemo(() => {
90
90
  if (!href || href.trim() === "") {
91
91
  return onClick ? "none" : "none";
92
92
  }
@@ -107,7 +107,7 @@ function useNavigation({
107
107
  return "internal";
108
108
  }
109
109
  }, [href, onClick]);
110
- const normalizedHref = React.useMemo(() => {
110
+ const normalizedHref = React5.useMemo(() => {
111
111
  if (!href || href.trim() === "") {
112
112
  return void 0;
113
113
  }
@@ -125,7 +125,7 @@ function useNavigation({
125
125
  return trimmed;
126
126
  }
127
127
  }, [href, linkType]);
128
- const target = React.useMemo(() => {
128
+ const target = React5.useMemo(() => {
129
129
  switch (linkType) {
130
130
  case "external":
131
131
  return "_blank";
@@ -138,7 +138,7 @@ function useNavigation({
138
138
  return void 0;
139
139
  }
140
140
  }, [linkType]);
141
- const rel = React.useMemo(() => {
141
+ const rel = React5.useMemo(() => {
142
142
  if (linkType === "external") {
143
143
  return "noopener noreferrer";
144
144
  }
@@ -147,7 +147,7 @@ function useNavigation({
147
147
  const isExternal = linkType === "external";
148
148
  const isInternal = linkType === "internal";
149
149
  const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
150
- const handleClick = React.useCallback(
150
+ const handleClick = React5.useCallback(
151
151
  (event) => {
152
152
  if (onClick) {
153
153
  try {
@@ -331,7 +331,7 @@ var buttonVariants = cva(baseStyles, {
331
331
  size: "default"
332
332
  }
333
333
  });
334
- var Pressable = React.forwardRef(
334
+ var Pressable = React5.forwardRef(
335
335
  ({
336
336
  children,
337
337
  className,
@@ -429,111 +429,6 @@ var Pressable = React.forwardRef(
429
429
  }
430
430
  );
431
431
  Pressable.displayName = "Pressable";
432
- var svgCache = /* @__PURE__ */ new Map();
433
- function DynamicIcon({
434
- name,
435
- size = 28,
436
- color,
437
- className,
438
- alt
439
- }) {
440
- const [svgContent, setSvgContent] = React.useState(null);
441
- const [isLoading, setIsLoading] = React.useState(true);
442
- const [error, setError] = React.useState(null);
443
- const { url, iconName } = React.useMemo(() => {
444
- const separator = name.includes("/") ? "/" : ":";
445
- const [prefix, iconName2] = name.split(separator);
446
- const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}`;
447
- return {
448
- url: baseUrl,
449
- iconName: iconName2
450
- };
451
- }, [name, size]);
452
- React.useEffect(() => {
453
- let isMounted = true;
454
- const fetchSvg = async () => {
455
- const cached = svgCache.get(url);
456
- if (cached) {
457
- if (isMounted) {
458
- setSvgContent(cached);
459
- setIsLoading(false);
460
- }
461
- return;
462
- }
463
- try {
464
- setIsLoading(true);
465
- setError(null);
466
- const response = await fetch(url);
467
- if (!response.ok) {
468
- throw new Error(`Failed to fetch icon: ${response.status}`);
469
- }
470
- let svg = await response.text();
471
- svg = processSvgForCurrentColor(svg);
472
- svgCache.set(url, svg);
473
- if (isMounted) {
474
- setSvgContent(svg);
475
- setIsLoading(false);
476
- }
477
- } catch (err) {
478
- if (isMounted) {
479
- setError(err instanceof Error ? err.message : "Failed to load icon");
480
- setIsLoading(false);
481
- }
482
- }
483
- };
484
- fetchSvg();
485
- return () => {
486
- isMounted = false;
487
- };
488
- }, [url]);
489
- if (isLoading) {
490
- return /* @__PURE__ */ jsx(
491
- "span",
492
- {
493
- className: cn("inline-block", className),
494
- style: { width: size, height: size },
495
- "aria-hidden": "true"
496
- }
497
- );
498
- }
499
- if (error || !svgContent) {
500
- return /* @__PURE__ */ jsx(
501
- "span",
502
- {
503
- className: cn("inline-block", className),
504
- style: { width: size, height: size },
505
- role: "img",
506
- "aria-label": alt || iconName
507
- }
508
- );
509
- }
510
- return /* @__PURE__ */ jsx(
511
- "span",
512
- {
513
- className: cn("inline-flex items-center justify-center", className),
514
- style: {
515
- width: size,
516
- height: size,
517
- color: color || "inherit"
518
- },
519
- role: "img",
520
- "aria-label": alt || iconName,
521
- dangerouslySetInnerHTML: { __html: svgContent }
522
- }
523
- );
524
- }
525
- function processSvgForCurrentColor(svg) {
526
- let processed = svg;
527
- processed = processed.replace(
528
- /stroke=["'](#000000|#000|black)["']/gi,
529
- 'stroke="currentColor"'
530
- );
531
- processed = processed.replace(
532
- /fill=["'](#000000|#000|black)["']/gi,
533
- 'fill="currentColor"'
534
- );
535
- return processed;
536
- }
537
432
  var maxWidthStyles = {
538
433
  sm: "max-w-screen-sm",
539
434
  md: "max-w-screen-md",
@@ -543,7 +438,7 @@ var maxWidthStyles = {
543
438
  "4xl": "max-w-[1536px]",
544
439
  full: "max-w-full"
545
440
  };
546
- var Container = React__default.forwardRef(
441
+ var Container = React5__default.forwardRef(
547
442
  ({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
548
443
  const Component = as;
549
444
  return /* @__PURE__ */ jsx(
@@ -848,7 +743,7 @@ var spacingStyles = {
848
743
  };
849
744
  var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
850
745
  var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
851
- var Section = React__default.forwardRef(
746
+ var Section = React5__default.forwardRef(
852
747
  ({
853
748
  id,
854
749
  title,
@@ -916,43 +811,57 @@ function CarouselImageHero({
916
811
  actions,
917
812
  actionsSlot,
918
813
  images,
919
- autoPlayInterval = 5e3,
814
+ autoPlayInterval = 7500,
920
815
  className,
921
- containerClassName,
816
+ containerClassName = "mx-none md:mx-auto w-screen md:w-full max-w-screen md:max-w-7xl relative z-10 rounded-none md:rounded-2xl overflow-hidden shadow-none md:shadow-xl",
922
817
  contentClassName,
923
818
  badgeClassName,
924
819
  headingClassName,
925
820
  descriptionClassName,
926
821
  actionsClassName,
927
822
  imageClassName,
928
- navigationClassName,
929
823
  indicatorsClassName,
930
824
  optixFlowConfig,
931
- background = "white",
932
- spacing = "xl",
825
+ background,
826
+ spacing = "py-0 md:py-32",
933
827
  pattern,
934
828
  patternOpacity
935
829
  }) {
936
- const [currentImageIndex, setCurrentImageIndex] = React.useState(0);
937
- React.useEffect(() => {
938
- const interval = setInterval(() => {
939
- setCurrentImageIndex((prevIndex) => (prevIndex + 1) % (images?.length ?? 1));
940
- }, autoPlayInterval);
941
- return () => clearInterval(interval);
942
- }, [images?.length, autoPlayInterval]);
943
- const goToNextImage = () => {
830
+ const [currentImageIndex, setCurrentImageIndex] = React5.useState(0);
831
+ const intervalRef = React5.useRef(null);
832
+ const goToNext = React5.useCallback(() => {
944
833
  setCurrentImageIndex((prevIndex) => (prevIndex + 1) % (images?.length ?? 1));
945
- };
946
- const goToPreviousImage = () => {
947
- setCurrentImageIndex(
948
- (prevIndex) => (prevIndex - 1 + (images?.length ?? 1)) % (images?.length ?? 1)
949
- );
950
- };
834
+ }, [images?.length]);
835
+ const resetInterval = React5.useCallback(() => {
836
+ if (intervalRef.current) {
837
+ clearInterval(intervalRef.current);
838
+ }
839
+ intervalRef.current = setInterval(goToNext, autoPlayInterval);
840
+ }, [goToNext, autoPlayInterval]);
841
+ const goToSlide = React5.useCallback((index) => {
842
+ setCurrentImageIndex(index);
843
+ resetInterval();
844
+ }, [resetInterval]);
845
+ React5.useEffect(() => {
846
+ resetInterval();
847
+ return () => {
848
+ if (intervalRef.current) {
849
+ clearInterval(intervalRef.current);
850
+ }
851
+ };
852
+ }, [resetInterval]);
951
853
  const renderActions = () => {
952
854
  if (actionsSlot) return actionsSlot;
953
855
  if (!actions || actions.length === 0) return null;
954
856
  return actions.map((action, index) => {
955
- const { label, icon, iconAfter, children, className: actionClassName, ...pressableProps } = action;
857
+ const {
858
+ label,
859
+ icon,
860
+ iconAfter,
861
+ children,
862
+ className: actionClassName,
863
+ ...pressableProps
864
+ } = action;
956
865
  return /* @__PURE__ */ jsx(
957
866
  Pressable,
958
867
  {
@@ -974,11 +883,15 @@ function CarouselImageHero({
974
883
  {
975
884
  background,
976
885
  spacing,
977
- className: cn("relative min-h-[600px] overflow-hidden", className),
886
+ className: cn(
887
+ "relative min-h-screen md:min-h-[600px] overflow-hidden",
888
+ className
889
+ ),
978
890
  pattern,
979
891
  patternOpacity,
892
+ containerClassName,
980
893
  children: [
981
- /* @__PURE__ */ jsxs("div", { className: cn("absolute inset-0", imageClassName), children: [
894
+ /* @__PURE__ */ jsxs("div", { className: cn("absolute inset-0 bg-black", imageClassName), children: [
982
895
  images?.map((image, index) => /* @__PURE__ */ jsxs(
983
896
  "div",
984
897
  {
@@ -1002,50 +915,79 @@ function CarouselImageHero({
1002
915
  index
1003
916
  )),
1004
917
  /* @__PURE__ */ jsx(
1005
- Pressable,
1006
- {
1007
- onClick: goToPreviousImage,
1008
- asButton: true,
1009
- variant: "ghost",
1010
- size: "icon",
1011
- className: cn("absolute left-4 top-1/2 z-20 hidden -translate-y-1/2 rounded-full bg-background/30 p-2 backdrop-blur-sm transition-colors hover:bg-background/50 md:block", navigationClassName),
1012
- "aria-label": "Previous image",
1013
- children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/chevron-left", size: 24, className: "text-white" })
1014
- }
1015
- ),
1016
- /* @__PURE__ */ jsx(
1017
- Pressable,
1018
- {
1019
- onClick: goToNextImage,
1020
- asButton: true,
1021
- variant: "ghost",
1022
- size: "icon",
1023
- className: cn("absolute right-4 top-1/2 z-20 hidden -translate-y-1/2 rounded-full bg-background/30 p-2 backdrop-blur-sm transition-colors hover:bg-background/50 md:block", navigationClassName),
1024
- "aria-label": "Next image",
1025
- children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/chevron-right", size: 24, className: "text-white" })
1026
- }
1027
- ),
1028
- /* @__PURE__ */ jsx("div", { className: cn("absolute bottom-6 left-1/2 z-10 flex -translate-x-1/2 gap-3", indicatorsClassName), children: images?.map((_, index) => /* @__PURE__ */ jsx(
1029
- "button",
918
+ "div",
1030
919
  {
1031
- onClick: () => setCurrentImageIndex(index),
1032
920
  className: cn(
1033
- "flex h-3 w-3 items-center justify-center rounded-full transition-colors",
1034
- index === currentImageIndex ? "bg-white" : "bg-white/50 hover:bg-white/80"
921
+ "absolute bottom-6 left-1/2 z-10 flex -translate-x-1/2 gap-3",
922
+ indicatorsClassName
1035
923
  ),
1036
- "aria-label": `Go to image ${index + 1}`
1037
- },
1038
- index
1039
- )) })
924
+ children: images?.map((_, index) => /* @__PURE__ */ jsx(
925
+ "button",
926
+ {
927
+ onClick: () => goToSlide(index),
928
+ className: cn(
929
+ "flex h-4 w-4 items-center justify-center rounded-full transition-colors",
930
+ index === currentImageIndex ? "bg-white" : "bg-white/50 hover:bg-white/80"
931
+ ),
932
+ "aria-label": `Go to image ${index + 1}`
933
+ },
934
+ index
935
+ ))
936
+ }
937
+ )
1040
938
  ] }),
1041
- /* @__PURE__ */ jsx("div", { className: cn("container relative z-10 mx-auto flex min-h-[600px] flex-col items-center justify-center px-4 py-16 text-center md:px-6 md:py-20", containerClassName), children: /* @__PURE__ */ jsxs("div", { className: cn("max-w-4xl space-y-6", contentClassName), children: [
1042
- /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
1043
- badge && (typeof badge === "string" ? /* @__PURE__ */ jsx("div", { className: cn("inline-flex items-center rounded-full bg-white/10 px-3 py-1 text-sm font-medium text-white backdrop-blur-sm", badgeClassName), children: /* @__PURE__ */ jsx("span", { children: badge }) }) : /* @__PURE__ */ jsx("div", { className: badgeClassName, children: badge })),
1044
- heading && (typeof heading === "string" ? /* @__PURE__ */ jsx("h1", { className: cn("text-4xl font-bold tracking-tight text-primary-foreground dark:text-primary sm:text-5xl md:text-6xl", headingClassName), children: heading }) : /* @__PURE__ */ jsx("div", { className: headingClassName, children: heading })),
1045
- description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-xl text-primary-foreground dark:text-primary", descriptionClassName), children: description }) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description }))
1046
- ] }),
1047
- (actionsSlot || actions && actions.length > 0) && /* @__PURE__ */ jsx("div", { className: cn("flex flex-col justify-center gap-4 sm:flex-row", actionsClassName), children: renderActions() })
1048
- ] }) })
939
+ /* @__PURE__ */ jsx(
940
+ "div",
941
+ {
942
+ className: cn(
943
+ "relative z-10 mx-auto flex min-h-[600px] flex-col items-center justify-center px-4 py-16 text-center md:px-16 md:py-20"
944
+ ),
945
+ children: /* @__PURE__ */ jsxs("div", { className: cn("max-w-4xl space-y-6", contentClassName), children: [
946
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
947
+ badge && (typeof badge === "string" ? /* @__PURE__ */ jsx(
948
+ "div",
949
+ {
950
+ className: cn(
951
+ "inline-flex items-center rounded-full bg-white/10 px-3 py-1 text-sm font-medium text-white backdrop-blur-sm",
952
+ badgeClassName
953
+ ),
954
+ children: /* @__PURE__ */ jsx("span", { children: badge })
955
+ }
956
+ ) : /* @__PURE__ */ jsx("div", { className: badgeClassName, children: badge })),
957
+ heading && (typeof heading === "string" ? /* @__PURE__ */ jsx(
958
+ "h1",
959
+ {
960
+ className: cn(
961
+ "text-4xl font-bold sm:text-5xl md:text-6xl text-balance text-shadow",
962
+ headingClassName
963
+ ),
964
+ children: heading
965
+ }
966
+ ) : /* @__PURE__ */ jsx("div", { className: headingClassName, children: heading })),
967
+ description && (typeof description === "string" ? /* @__PURE__ */ jsx(
968
+ "p",
969
+ {
970
+ className: cn(
971
+ "text-xl text-balance text-shadow",
972
+ descriptionClassName
973
+ ),
974
+ children: description
975
+ }
976
+ ) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description }))
977
+ ] }),
978
+ (actionsSlot || actions && actions.length > 0) && /* @__PURE__ */ jsx(
979
+ "div",
980
+ {
981
+ className: cn(
982
+ "flex flex-col justify-center gap-4 sm:flex-row",
983
+ actionsClassName
984
+ ),
985
+ children: renderActions()
986
+ }
987
+ )
988
+ ] })
989
+ }
990
+ )
1049
991
  ]
1050
992
  }
1051
993
  );