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