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