@opensite/ui 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ import React__default, { useCallback, useMemo } from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { jsx, jsxs } from 'react/jsx-runtime';
7
+ import { cva } from 'class-variance-authority';
7
8
 
8
9
  // components/blocks/features/feature-icon-grid-muted.tsx
9
10
  function cn(...inputs) {
@@ -515,41 +516,492 @@ var Section = React__default.forwardRef(
515
516
  }
516
517
  );
517
518
  Section.displayName = "Section";
519
+ var baseStyles = [
520
+ // Layout
521
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap shrink-0",
522
+ // Typography - using CSS variables with sensible defaults
523
+ "font-[var(--button-font-family,inherit)]",
524
+ "font-[var(--button-font-weight,500)]",
525
+ "tracking-[var(--button-letter-spacing,0)]",
526
+ "leading-[var(--button-line-height,1.25)]",
527
+ "[text-transform:var(--button-text-transform,none)]",
528
+ "text-sm",
529
+ // Border radius
530
+ "rounded-[var(--button-radius,var(--radius,0.375rem))]",
531
+ // Smooth transition - using [transition:...] to set full shorthand property (not just transition-property)
532
+ "[transition:var(--button-transition,all_250ms_cubic-bezier(0.4,0,0.2,1))]",
533
+ // Box shadow (master level) - using [box-shadow:...] for complex multi-value shadows
534
+ "[box-shadow:var(--button-shadow,none)]",
535
+ "hover:[box-shadow:var(--button-shadow-hover,var(--button-shadow,none))]",
536
+ // Disabled state
537
+ "disabled:pointer-events-none disabled:opacity-50",
538
+ // SVG handling
539
+ "[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
540
+ // Focus styles
541
+ "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
542
+ // Invalid state
543
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
544
+ ].join(" ");
545
+ var buttonVariants = cva(baseStyles, {
546
+ variants: {
547
+ variant: {
548
+ // Default (Primary) variant - full customization
549
+ default: [
550
+ "bg-[var(--button-default-bg,hsl(var(--primary)))]",
551
+ "text-[var(--button-default-fg,hsl(var(--primary-foreground)))]",
552
+ "border-[length:var(--button-default-border-width,0px)]",
553
+ "border-[color:var(--button-default-border,transparent)]",
554
+ "[box-shadow:var(--button-default-shadow,var(--button-shadow,none))]",
555
+ "hover:bg-[var(--button-default-hover-bg,hsl(var(--primary)/0.9))]",
556
+ "hover:text-[var(--button-default-hover-fg,var(--button-default-fg,hsl(var(--primary-foreground))))]",
557
+ "hover:border-[color:var(--button-default-hover-border,var(--button-default-border,transparent))]",
558
+ "hover:[box-shadow:var(--button-default-shadow-hover,var(--button-shadow-hover,var(--button-default-shadow,var(--button-shadow,none))))]"
559
+ ].join(" "),
560
+ // Destructive variant - full customization
561
+ destructive: [
562
+ "bg-[var(--button-destructive-bg,hsl(var(--destructive)))]",
563
+ "text-[var(--button-destructive-fg,white)]",
564
+ "border-[length:var(--button-destructive-border-width,0px)]",
565
+ "border-[color:var(--button-destructive-border,transparent)]",
566
+ "[box-shadow:var(--button-destructive-shadow,var(--button-shadow,none))]",
567
+ "hover:bg-[var(--button-destructive-hover-bg,hsl(var(--destructive)/0.9))]",
568
+ "hover:text-[var(--button-destructive-hover-fg,var(--button-destructive-fg,white))]",
569
+ "hover:border-[color:var(--button-destructive-hover-border,var(--button-destructive-border,transparent))]",
570
+ "hover:[box-shadow:var(--button-destructive-shadow-hover,var(--button-shadow-hover,var(--button-destructive-shadow,var(--button-shadow,none))))]",
571
+ "focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
572
+ "dark:bg-destructive/60"
573
+ ].join(" "),
574
+ // Outline variant - full customization with proper border handling
575
+ outline: [
576
+ "bg-[var(--button-outline-bg,hsl(var(--background)))]",
577
+ "text-[var(--button-outline-fg,inherit)]",
578
+ "border-[length:var(--button-outline-border-width,1px)]",
579
+ "border-[color:var(--button-outline-border,hsl(var(--border)))]",
580
+ "[box-shadow:var(--button-outline-shadow,var(--button-shadow,0_1px_2px_0_rgb(0_0_0/0.05)))]",
581
+ "hover:bg-[var(--button-outline-hover-bg,hsl(var(--accent)))]",
582
+ "hover:text-[var(--button-outline-hover-fg,hsl(var(--accent-foreground)))]",
583
+ "hover:border-[color:var(--button-outline-hover-border,var(--button-outline-border,hsl(var(--border))))]",
584
+ "hover:[box-shadow:var(--button-outline-shadow-hover,var(--button-shadow-hover,var(--button-outline-shadow,var(--button-shadow,none))))]",
585
+ "dark:bg-input/30 dark:border-input dark:hover:bg-input/50"
586
+ ].join(" "),
587
+ // Secondary variant - full customization
588
+ secondary: [
589
+ "bg-[var(--button-secondary-bg,hsl(var(--secondary)))]",
590
+ "text-[var(--button-secondary-fg,hsl(var(--secondary-foreground)))]",
591
+ "border-[length:var(--button-secondary-border-width,0px)]",
592
+ "border-[color:var(--button-secondary-border,transparent)]",
593
+ "[box-shadow:var(--button-secondary-shadow,var(--button-shadow,none))]",
594
+ "hover:bg-[var(--button-secondary-hover-bg,hsl(var(--secondary)/0.8))]",
595
+ "hover:text-[var(--button-secondary-hover-fg,var(--button-secondary-fg,hsl(var(--secondary-foreground))))]",
596
+ "hover:border-[color:var(--button-secondary-hover-border,var(--button-secondary-border,transparent))]",
597
+ "hover:[box-shadow:var(--button-secondary-shadow-hover,var(--button-shadow-hover,var(--button-secondary-shadow,var(--button-shadow,none))))]"
598
+ ].join(" "),
599
+ // Ghost variant - full customization
600
+ ghost: [
601
+ "bg-[var(--button-ghost-bg,transparent)]",
602
+ "text-[var(--button-ghost-fg,inherit)]",
603
+ "border-[length:var(--button-ghost-border-width,0px)]",
604
+ "border-[color:var(--button-ghost-border,transparent)]",
605
+ "[box-shadow:var(--button-ghost-shadow,var(--button-shadow,none))]",
606
+ "hover:bg-[var(--button-ghost-hover-bg,hsl(var(--accent)))]",
607
+ "hover:text-[var(--button-ghost-hover-fg,hsl(var(--accent-foreground)))]",
608
+ "hover:border-[color:var(--button-ghost-hover-border,var(--button-ghost-border,transparent))]",
609
+ "hover:[box-shadow:var(--button-ghost-shadow-hover,var(--button-shadow-hover,var(--button-ghost-shadow,var(--button-shadow,none))))]",
610
+ "dark:hover:bg-accent/50"
611
+ ].join(" "),
612
+ // Link variant - full customization
613
+ link: [
614
+ "bg-[var(--button-link-bg,transparent)]",
615
+ "text-[var(--button-link-fg,hsl(var(--primary)))]",
616
+ "border-[length:var(--button-link-border-width,0px)]",
617
+ "border-[color:var(--button-link-border,transparent)]",
618
+ "[box-shadow:var(--button-link-shadow,none)]",
619
+ "hover:bg-[var(--button-link-hover-bg,transparent)]",
620
+ "hover:text-[var(--button-link-hover-fg,var(--button-link-fg,hsl(var(--primary))))]",
621
+ "hover:[box-shadow:var(--button-link-shadow-hover,none)]",
622
+ "underline-offset-4 hover:underline"
623
+ ].join(" ")
624
+ },
625
+ size: {
626
+ default: [
627
+ "h-[var(--button-height-md,2.25rem)]",
628
+ "px-[var(--button-padding-x-md,1rem)]",
629
+ "py-[var(--button-padding-y-md,0.5rem)]",
630
+ "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
631
+ ].join(" "),
632
+ sm: [
633
+ "h-[var(--button-height-sm,2rem)]",
634
+ "px-[var(--button-padding-x-sm,0.75rem)]",
635
+ "py-[var(--button-padding-y-sm,0.25rem)]",
636
+ "gap-1.5",
637
+ "has-[>svg]:px-[calc(var(--button-padding-x-sm,0.75rem)*0.83)]"
638
+ ].join(" "),
639
+ md: [
640
+ "h-[var(--button-height-md,2.25rem)]",
641
+ "px-[var(--button-padding-x-md,1rem)]",
642
+ "py-[var(--button-padding-y-md,0.5rem)]",
643
+ "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
644
+ ].join(" "),
645
+ lg: [
646
+ "h-[var(--button-height-lg,2.5rem)]",
647
+ "px-[var(--button-padding-x-lg,1.5rem)]",
648
+ "py-[var(--button-padding-y-lg,0.5rem)]",
649
+ "has-[>svg]:px-[calc(var(--button-padding-x-lg,1.5rem)*0.67)]"
650
+ ].join(" "),
651
+ icon: "size-[var(--button-height-md,2.25rem)]",
652
+ "icon-sm": "size-[var(--button-height-sm,2rem)]",
653
+ "icon-lg": "size-[var(--button-height-lg,2.5rem)]"
654
+ }
655
+ },
656
+ defaultVariants: {
657
+ variant: "default",
658
+ size: "default"
659
+ }
660
+ });
661
+ function normalizePhoneNumber(input) {
662
+ const trimmed = input.trim();
663
+ if (trimmed.toLowerCase().startsWith("tel:")) {
664
+ return trimmed;
665
+ }
666
+ const match = trimmed.match(/^[\s\+\-\(\)]*(\d[\d\s\-\(\)\.]*\d)[\s\-]*(x|ext\.?|extension)?[\s\-]*(\d+)?$/i);
667
+ if (match) {
668
+ const mainNumber = match[1].replace(/[\s\-\(\)\.]/g, "");
669
+ const extension = match[3];
670
+ const normalized = mainNumber.length >= 10 && !trimmed.startsWith("+") ? `+${mainNumber}` : mainNumber;
671
+ const withExtension = extension ? `${normalized};ext=${extension}` : normalized;
672
+ return `tel:${withExtension}`;
673
+ }
674
+ const cleaned = trimmed.replace(/[\s\-\(\)\.]/g, "");
675
+ return `tel:${cleaned}`;
676
+ }
677
+ function normalizeEmail(input) {
678
+ const trimmed = input.trim();
679
+ if (trimmed.toLowerCase().startsWith("mailto:")) {
680
+ return trimmed;
681
+ }
682
+ return `mailto:${trimmed}`;
683
+ }
684
+ function isEmail(input) {
685
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
686
+ return emailRegex.test(input.trim());
687
+ }
688
+ function isPhoneNumber(input) {
689
+ const trimmed = input.trim();
690
+ if (trimmed.toLowerCase().startsWith("tel:")) {
691
+ return true;
692
+ }
693
+ const phoneRegex = /^[\s\+\-\(\)]*\d[\d\s\-\(\)\.]*\d[\s\-]*(x|ext\.?|extension)?[\s\-]*\d*$/i;
694
+ return phoneRegex.test(trimmed);
695
+ }
696
+ function isInternalUrl(href) {
697
+ if (typeof window === "undefined") {
698
+ return href.startsWith("/") && !href.startsWith("//");
699
+ }
700
+ const trimmed = href.trim();
701
+ if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
702
+ return true;
703
+ }
704
+ try {
705
+ const url = new URL(trimmed, window.location.href);
706
+ const currentOrigin = window.location.origin;
707
+ const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
708
+ return normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin);
709
+ } catch {
710
+ return false;
711
+ }
712
+ }
713
+ function toRelativePath(href) {
714
+ if (typeof window === "undefined") {
715
+ return href;
716
+ }
717
+ const trimmed = href.trim();
718
+ if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
719
+ return trimmed;
720
+ }
721
+ try {
722
+ const url = new URL(trimmed, window.location.href);
723
+ const currentOrigin = window.location.origin;
724
+ const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
725
+ if (normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin)) {
726
+ return url.pathname + url.search + url.hash;
727
+ }
728
+ } catch {
729
+ }
730
+ return trimmed;
731
+ }
732
+ function useNavigation({
733
+ href,
734
+ onClick
735
+ } = {}) {
736
+ const linkType = React.useMemo(() => {
737
+ if (!href || href.trim() === "") {
738
+ return onClick ? "none" : "none";
739
+ }
740
+ const trimmed = href.trim();
741
+ if (trimmed.toLowerCase().startsWith("mailto:") || isEmail(trimmed)) {
742
+ return "mailto";
743
+ }
744
+ if (trimmed.toLowerCase().startsWith("tel:") || isPhoneNumber(trimmed)) {
745
+ return "tel";
746
+ }
747
+ if (isInternalUrl(trimmed)) {
748
+ return "internal";
749
+ }
750
+ try {
751
+ new URL(trimmed, typeof window !== "undefined" ? window.location.href : "http://localhost");
752
+ return "external";
753
+ } catch {
754
+ return "internal";
755
+ }
756
+ }, [href, onClick]);
757
+ const normalizedHref = React.useMemo(() => {
758
+ if (!href || href.trim() === "") {
759
+ return void 0;
760
+ }
761
+ const trimmed = href.trim();
762
+ switch (linkType) {
763
+ case "tel":
764
+ return normalizePhoneNumber(trimmed);
765
+ case "mailto":
766
+ return normalizeEmail(trimmed);
767
+ case "internal":
768
+ return toRelativePath(trimmed);
769
+ case "external":
770
+ return trimmed;
771
+ default:
772
+ return trimmed;
773
+ }
774
+ }, [href, linkType]);
775
+ const target = React.useMemo(() => {
776
+ switch (linkType) {
777
+ case "external":
778
+ return "_blank";
779
+ case "internal":
780
+ return "_self";
781
+ case "mailto":
782
+ case "tel":
783
+ return void 0;
784
+ default:
785
+ return void 0;
786
+ }
787
+ }, [linkType]);
788
+ const rel = React.useMemo(() => {
789
+ if (linkType === "external") {
790
+ return "noopener noreferrer";
791
+ }
792
+ return void 0;
793
+ }, [linkType]);
794
+ const isExternal = linkType === "external";
795
+ const isInternal = linkType === "internal";
796
+ const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
797
+ const handleClick = React.useCallback(
798
+ (event) => {
799
+ if (onClick) {
800
+ try {
801
+ onClick(event);
802
+ } catch (error) {
803
+ console.error("Error in user onClick handler:", error);
804
+ }
805
+ }
806
+ if (event.defaultPrevented) {
807
+ return;
808
+ }
809
+ if (shouldUseRouter && normalizedHref && event.button === 0 && // left-click only
810
+ !event.metaKey && !event.altKey && !event.ctrlKey && !event.shiftKey) {
811
+ if (typeof window !== "undefined") {
812
+ const handler = window.__opensiteNavigationHandler;
813
+ if (typeof handler === "function") {
814
+ try {
815
+ const handled = handler(normalizedHref, event.nativeEvent || event);
816
+ if (handled !== false) {
817
+ event.preventDefault();
818
+ }
819
+ } catch (error) {
820
+ console.error("Error in navigation handler:", error);
821
+ }
822
+ }
823
+ }
824
+ }
825
+ },
826
+ [onClick, shouldUseRouter, normalizedHref]
827
+ );
828
+ return {
829
+ linkType,
830
+ normalizedHref,
831
+ target,
832
+ rel,
833
+ isExternal,
834
+ isInternal,
835
+ shouldUseRouter,
836
+ handleClick
837
+ };
838
+ }
839
+ var Pressable = React.forwardRef(
840
+ ({
841
+ children,
842
+ className,
843
+ href,
844
+ onClick,
845
+ variant,
846
+ size,
847
+ asButton = false,
848
+ fallbackComponentType = "span",
849
+ componentType,
850
+ "aria-label": ariaLabel,
851
+ "aria-describedby": ariaDescribedby,
852
+ id,
853
+ ...props
854
+ }, ref) => {
855
+ const navigation = useNavigation({ href, onClick });
856
+ const {
857
+ normalizedHref,
858
+ target,
859
+ rel,
860
+ linkType,
861
+ isInternal,
862
+ handleClick
863
+ } = navigation;
864
+ const shouldRenderLink = normalizedHref && linkType !== "none";
865
+ const shouldRenderButton = !shouldRenderLink && onClick;
866
+ const effectiveComponentType = componentType || (shouldRenderLink ? "a" : shouldRenderButton ? "button" : fallbackComponentType);
867
+ const finalComponentType = isInternal && shouldRenderLink ? "a" : effectiveComponentType;
868
+ const shouldApplyButtonStyles = asButton || variant || size;
869
+ const combinedClassName = cn(
870
+ shouldApplyButtonStyles && buttonVariants({ variant, size }),
871
+ className
872
+ );
873
+ const dataProps = Object.fromEntries(
874
+ Object.entries(props).filter(([key]) => key.startsWith("data-"))
875
+ );
876
+ const buttonDataAttributes = shouldApplyButtonStyles ? {
877
+ "data-slot": "button",
878
+ "data-variant": variant ?? "default",
879
+ "data-size": size ?? "default"
880
+ } : {};
881
+ const commonProps = {
882
+ className: combinedClassName,
883
+ onClick: handleClick,
884
+ "aria-label": ariaLabel,
885
+ "aria-describedby": ariaDescribedby,
886
+ id,
887
+ ...dataProps,
888
+ ...buttonDataAttributes
889
+ };
890
+ if (finalComponentType === "a" && shouldRenderLink) {
891
+ return /* @__PURE__ */ jsx(
892
+ "a",
893
+ {
894
+ ref,
895
+ href: normalizedHref,
896
+ target,
897
+ rel,
898
+ ...commonProps,
899
+ ...props,
900
+ children
901
+ }
902
+ );
903
+ }
904
+ if (finalComponentType === "button") {
905
+ return /* @__PURE__ */ jsx(
906
+ "button",
907
+ {
908
+ ref,
909
+ type: props.type || "button",
910
+ ...commonProps,
911
+ ...props,
912
+ children
913
+ }
914
+ );
915
+ }
916
+ if (finalComponentType === "div") {
917
+ return /* @__PURE__ */ jsx(
918
+ "div",
919
+ {
920
+ ref,
921
+ ...commonProps,
922
+ children
923
+ }
924
+ );
925
+ }
926
+ return /* @__PURE__ */ jsx(
927
+ "span",
928
+ {
929
+ ref,
930
+ ...commonProps,
931
+ children
932
+ }
933
+ );
934
+ }
935
+ );
936
+ Pressable.displayName = "Pressable";
518
937
  function FeatureIconGridMuted({
519
938
  title,
520
939
  description,
521
940
  features,
522
941
  featuresSlot,
523
942
  className,
524
- containerClassName,
525
943
  headerClassName,
526
944
  titleClassName,
527
945
  descriptionClassName,
528
946
  gridClassName,
529
947
  cardClassName,
530
948
  background,
531
- spacing,
532
949
  pattern,
533
950
  patternOpacity,
534
- patternClassName
951
+ patternClassName,
952
+ spacing = "py-12 md:py-32",
953
+ containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8"
535
954
  }) {
536
955
  const renderFeatureIcon = useCallback((feature) => {
537
956
  if (feature.icon) return feature.icon;
538
- if (feature.iconName) return /* @__PURE__ */ jsx(DynamicIcon, { name: feature.iconName, size: 24, className: feature.iconClassName });
957
+ if (feature.iconName)
958
+ return /* @__PURE__ */ jsx(
959
+ DynamicIcon,
960
+ {
961
+ name: feature.iconName,
962
+ size: 24,
963
+ className: feature.iconClassName
964
+ }
965
+ );
539
966
  return null;
540
967
  }, []);
541
968
  const featuresContent = useMemo(() => {
542
969
  if (featuresSlot) return featuresSlot;
543
970
  if (!features || features.length === 0) return null;
544
- return features.map((feature, index) => /* @__PURE__ */ jsxs(
971
+ return features.map((feature, index) => /* @__PURE__ */ jsx(
545
972
  "div",
546
973
  {
547
- className: cn("flex flex-col gap-2.5 rounded-xl border p-7", cardClassName, feature.className),
548
- children: [
974
+ className: cn(
975
+ "flex flex-col gap-2.5 rounded-xl border p-7 bg-muted text-muted-foreground",
976
+ cardClassName,
977
+ feature.className
978
+ ),
979
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 md:gap-12", children: [
549
980
  (feature.icon || feature.iconName) && renderFeatureIcon(feature),
550
- feature.title && (typeof feature.title === "string" ? /* @__PURE__ */ jsx("h3", { className: cn("font-semibold", feature.titleClassName), children: feature.title }) : /* @__PURE__ */ jsx("div", { className: cn("font-semibold", feature.titleClassName), children: feature.title })),
551
- feature.description && (typeof feature.description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-sm", getTextColor(background, "muted"), feature.descriptionClassName), children: feature.description }) : /* @__PURE__ */ jsx("div", { className: cn("text-sm", getTextColor(background, "muted"), feature.descriptionClassName), children: feature.description }))
552
- ]
981
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 md:gap-4", children: [
982
+ feature.title && (typeof feature.title === "string" ? /* @__PURE__ */ jsx(
983
+ Pressable,
984
+ {
985
+ href: feature.href,
986
+ className: cn(
987
+ "font-medium text-xl text-muted-foreground",
988
+ feature.titleClassName
989
+ ),
990
+ children: feature.title
991
+ }
992
+ ) : /* @__PURE__ */ jsx(
993
+ "div",
994
+ {
995
+ className: cn(
996
+ "font-medium text-xl text-muted-foreground",
997
+ feature.titleClassName
998
+ ),
999
+ children: feature.title
1000
+ }
1001
+ )),
1002
+ feature.description && (typeof feature.description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-sm", feature.descriptionClassName), children: feature.description }) : /* @__PURE__ */ jsx("div", { className: cn("text-sm", feature.descriptionClassName), children: feature.description }))
1003
+ ] })
1004
+ ] })
553
1005
  },
554
1006
  index
555
1007
  ));
@@ -565,11 +1017,65 @@ function FeatureIconGridMuted({
565
1017
  className,
566
1018
  containerClassName,
567
1019
  children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-10", children: [
568
- (title || description) && /* @__PURE__ */ jsxs("div", { className: cn("mx-auto flex max-w-xl flex-col gap-2.5 text-center", headerClassName), children: [
569
- title && (typeof title === "string" ? /* @__PURE__ */ jsx("h1", { className: cn("text-4xl font-semibold md:text-5xl", titleClassName), children: title }) : /* @__PURE__ */ jsx("div", { className: cn("text-4xl font-semibold md:text-5xl", titleClassName), children: title })),
570
- description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn(getTextColor(background, "muted"), descriptionClassName), children: description }) : /* @__PURE__ */ jsx("div", { className: cn(getTextColor(background, "muted"), descriptionClassName), children: description }))
571
- ] }),
572
- (featuresSlot || features && features.length > 0) && /* @__PURE__ */ jsx("div", { className: cn("mx-auto grid max-w-7xl gap-7 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5", gridClassName), children: featuresContent })
1020
+ (title || description) && /* @__PURE__ */ jsxs(
1021
+ "div",
1022
+ {
1023
+ className: cn(
1024
+ "mx-auto flex max-w-full md:max-w-md text-balance flex-col gap-2.5 text-center",
1025
+ headerClassName
1026
+ ),
1027
+ children: [
1028
+ title && (typeof title === "string" ? /* @__PURE__ */ jsx(
1029
+ "h2",
1030
+ {
1031
+ className: cn(
1032
+ "text-4xl font-semibold md:text-5xl",
1033
+ titleClassName
1034
+ ),
1035
+ children: title
1036
+ }
1037
+ ) : /* @__PURE__ */ jsx(
1038
+ "div",
1039
+ {
1040
+ className: cn(
1041
+ "text-4xl font-semibold md:text-5xl",
1042
+ titleClassName
1043
+ ),
1044
+ children: title
1045
+ }
1046
+ )),
1047
+ description && (typeof description === "string" ? /* @__PURE__ */ jsx(
1048
+ "p",
1049
+ {
1050
+ className: cn(
1051
+ getTextColor(background, "muted"),
1052
+ descriptionClassName
1053
+ ),
1054
+ children: description
1055
+ }
1056
+ ) : /* @__PURE__ */ jsx(
1057
+ "div",
1058
+ {
1059
+ className: cn(
1060
+ getTextColor(background, "muted"),
1061
+ descriptionClassName
1062
+ ),
1063
+ children: description
1064
+ }
1065
+ ))
1066
+ ]
1067
+ }
1068
+ ),
1069
+ (featuresSlot || features && features.length > 0) && /* @__PURE__ */ jsx(
1070
+ "div",
1071
+ {
1072
+ className: cn(
1073
+ "mx-auto grid w-full gap-4 md:gap-6 grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
1074
+ gridClassName
1075
+ ),
1076
+ children: featuresContent
1077
+ }
1078
+ )
573
1079
  ] })
574
1080
  }
575
1081
  );