@opensite/ui 2.9.0 → 2.9.2
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-feature-badge.cjs +4 -3
- package/dist/carousel-feature-badge.d.cts +1 -1
- package/dist/carousel-feature-badge.d.ts +1 -1
- package/dist/carousel-feature-badge.js +4 -3
- package/dist/carousel-scrolling-feature-showcase.cjs +47 -38
- package/dist/carousel-scrolling-feature-showcase.js +47 -38
- package/dist/registry.cjs +454 -265
- package/dist/registry.js +454 -265
- package/dist/testimonials-grid-add-review.cjs +578 -39
- package/dist/testimonials-grid-add-review.d.cts +26 -26
- package/dist/testimonials-grid-add-review.d.ts +26 -26
- package/dist/testimonials-grid-add-review.js +577 -38
- package/dist/testimonials-images-helpful.cjs +85 -74
- package/dist/testimonials-images-helpful.js +85 -74
- package/dist/testimonials-list-verified.cjs +1 -0
- package/dist/testimonials-list-verified.js +1 -0
- package/dist/testimonials-logo-cards.cjs +8 -5
- package/dist/testimonials-logo-cards.js +8 -5
- package/dist/testimonials-masonry-grid.cjs +87 -11
- package/dist/testimonials-masonry-grid.d.cts +14 -1
- package/dist/testimonials-masonry-grid.d.ts +14 -1
- package/dist/testimonials-masonry-grid.js +88 -12
- package/dist/testimonials-mini-dividers.cjs +438 -26
- package/dist/testimonials-mini-dividers.js +434 -22
- package/dist/testimonials-minimal-numbered.cjs +1 -1
- package/dist/testimonials-minimal-numbered.js +1 -1
- package/dist/testimonials-parallax-number.cjs +1 -1
- package/dist/testimonials-parallax-number.js +1 -1
- package/dist/testimonials-quote-carousel.cjs +39 -37
- package/dist/testimonials-quote-carousel.d.cts +5 -1
- package/dist/testimonials-quote-carousel.d.ts +5 -1
- package/dist/testimonials-quote-carousel.js +39 -37
- package/dist/testimonials-scrolling-columns.cjs +438 -8
- package/dist/testimonials-scrolling-columns.js +436 -6
- package/dist/testimonials-simple-grid.cjs +82 -6
- package/dist/testimonials-simple-grid.d.cts +14 -1
- package/dist/testimonials-simple-grid.d.ts +14 -1
- package/dist/testimonials-simple-grid.js +83 -7
- package/dist/testimonials-stats-header.cjs +88 -8
- package/dist/testimonials-stats-header.d.cts +14 -1
- package/dist/testimonials-stats-header.d.ts +14 -1
- package/dist/testimonials-stats-header.js +89 -9
- package/dist/testimonials-twitter-cards.cjs +150 -25
- package/dist/testimonials-twitter-cards.d.cts +14 -1
- package/dist/testimonials-twitter-cards.d.ts +14 -1
- package/dist/testimonials-twitter-cards.js +151 -26
- package/dist/testimonials-wall-compact.cjs +529 -50
- package/dist/testimonials-wall-compact.d.cts +14 -1
- package/dist/testimonials-wall-compact.d.ts +14 -1
- package/dist/testimonials-wall-compact.js +526 -44
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React4 = require('react');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var icon = require('@page-speed/icon');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
var AvatarPrimitive = require('@radix-ui/react-avatar');
|
|
10
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
10
11
|
|
|
11
12
|
function _interopNamespace(e) {
|
|
12
13
|
if (e && e.__esModule) return e;
|
|
@@ -26,7 +27,7 @@ function _interopNamespace(e) {
|
|
|
26
27
|
return Object.freeze(n);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
var
|
|
30
|
+
var React4__namespace = /*#__PURE__*/_interopNamespace(React4);
|
|
30
31
|
var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
|
|
31
32
|
|
|
32
33
|
// components/blocks/testimonials/testimonials-mini-dividers.tsx
|
|
@@ -34,7 +35,7 @@ function cn(...inputs) {
|
|
|
34
35
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
35
36
|
}
|
|
36
37
|
var DEFAULT_ICON_API_KEY = "au382bi7fsh96w9h9xlrnat2jglx";
|
|
37
|
-
var DynamicIcon =
|
|
38
|
+
var DynamicIcon = React4__namespace.memo(function DynamicIcon2({
|
|
38
39
|
apiKey,
|
|
39
40
|
...props
|
|
40
41
|
}) {
|
|
@@ -112,7 +113,7 @@ var maxWidthStyles = {
|
|
|
112
113
|
"4xl": "max-w-[1536px]",
|
|
113
114
|
full: "max-w-full"
|
|
114
115
|
};
|
|
115
|
-
var Container =
|
|
116
|
+
var Container = React4__namespace.default.forwardRef(
|
|
116
117
|
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
117
118
|
const Component = as;
|
|
118
119
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -418,7 +419,7 @@ var spacingStyles = {
|
|
|
418
419
|
};
|
|
419
420
|
var predefinedSpacings = ["none", "sm", "md", "lg", "xl", "hero"];
|
|
420
421
|
var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
|
|
421
|
-
var Section =
|
|
422
|
+
var Section = React4__namespace.default.forwardRef(
|
|
422
423
|
({
|
|
423
424
|
id,
|
|
424
425
|
title,
|
|
@@ -479,6 +480,424 @@ var Section = React__namespace.default.forwardRef(
|
|
|
479
480
|
}
|
|
480
481
|
);
|
|
481
482
|
Section.displayName = "Section";
|
|
483
|
+
var baseStyles = [
|
|
484
|
+
// Layout
|
|
485
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap shrink-0",
|
|
486
|
+
// Typography - using CSS variables with sensible defaults
|
|
487
|
+
"font-[var(--button-font-family,inherit)]",
|
|
488
|
+
"font-[var(--button-font-weight,500)]",
|
|
489
|
+
"tracking-[var(--button-letter-spacing,0)]",
|
|
490
|
+
"leading-[var(--button-line-height,1.25)]",
|
|
491
|
+
"[text-transform:var(--button-text-transform,none)]",
|
|
492
|
+
"text-sm",
|
|
493
|
+
// Border radius
|
|
494
|
+
"rounded-[var(--button-radius,var(--radius,0.375rem))]",
|
|
495
|
+
// Smooth transition - using [transition:...] to set full shorthand property (not just transition-property)
|
|
496
|
+
"[transition:var(--button-transition,all_250ms_cubic-bezier(0.4,0,0.2,1))]",
|
|
497
|
+
// Box shadow (master level) - using [box-shadow:...] for complex multi-value shadows
|
|
498
|
+
"[box-shadow:var(--button-shadow,none)]",
|
|
499
|
+
"hover:[box-shadow:var(--button-shadow-hover,var(--button-shadow,none))]",
|
|
500
|
+
// Disabled state
|
|
501
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
502
|
+
// SVG handling
|
|
503
|
+
"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
|
|
504
|
+
// Focus styles
|
|
505
|
+
"outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
506
|
+
// Invalid state
|
|
507
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
|
|
508
|
+
].join(" ");
|
|
509
|
+
var buttonVariants = classVarianceAuthority.cva(baseStyles, {
|
|
510
|
+
variants: {
|
|
511
|
+
variant: {
|
|
512
|
+
// Default (Primary) variant - full customization
|
|
513
|
+
default: [
|
|
514
|
+
"bg-[var(--button-default-bg,hsl(var(--primary)))]",
|
|
515
|
+
"text-[var(--button-default-fg,hsl(var(--primary-foreground)))]",
|
|
516
|
+
"border-[length:var(--button-default-border-width,0px)]",
|
|
517
|
+
"border-[color:var(--button-default-border,transparent)]",
|
|
518
|
+
"[box-shadow:var(--button-default-shadow,var(--button-shadow,none))]",
|
|
519
|
+
"hover:bg-[var(--button-default-hover-bg,hsl(var(--primary)/0.9))]",
|
|
520
|
+
"hover:text-[var(--button-default-hover-fg,var(--button-default-fg,hsl(var(--primary-foreground))))]",
|
|
521
|
+
"hover:border-[color:var(--button-default-hover-border,var(--button-default-border,transparent))]",
|
|
522
|
+
"hover:[box-shadow:var(--button-default-shadow-hover,var(--button-shadow-hover,var(--button-default-shadow,var(--button-shadow,none))))]"
|
|
523
|
+
].join(" "),
|
|
524
|
+
// Destructive variant - full customization
|
|
525
|
+
destructive: [
|
|
526
|
+
"bg-[var(--button-destructive-bg,hsl(var(--destructive)))]",
|
|
527
|
+
"text-[var(--button-destructive-fg,white)]",
|
|
528
|
+
"border-[length:var(--button-destructive-border-width,0px)]",
|
|
529
|
+
"border-[color:var(--button-destructive-border,transparent)]",
|
|
530
|
+
"[box-shadow:var(--button-destructive-shadow,var(--button-shadow,none))]",
|
|
531
|
+
"hover:bg-[var(--button-destructive-hover-bg,hsl(var(--destructive)/0.9))]",
|
|
532
|
+
"hover:text-[var(--button-destructive-hover-fg,var(--button-destructive-fg,white))]",
|
|
533
|
+
"hover:border-[color:var(--button-destructive-hover-border,var(--button-destructive-border,transparent))]",
|
|
534
|
+
"hover:[box-shadow:var(--button-destructive-shadow-hover,var(--button-shadow-hover,var(--button-destructive-shadow,var(--button-shadow,none))))]",
|
|
535
|
+
"focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
536
|
+
"dark:bg-destructive/60"
|
|
537
|
+
].join(" "),
|
|
538
|
+
// Outline variant - full customization with proper border handling
|
|
539
|
+
outline: [
|
|
540
|
+
"bg-[var(--button-outline-bg,hsl(var(--background)))]",
|
|
541
|
+
"text-[var(--button-outline-fg,inherit)]",
|
|
542
|
+
"border-[length:var(--button-outline-border-width,1px)]",
|
|
543
|
+
"border-[color:var(--button-outline-border,hsl(var(--border)))]",
|
|
544
|
+
"[box-shadow:var(--button-outline-shadow,var(--button-shadow,0_1px_2px_0_rgb(0_0_0/0.05)))]",
|
|
545
|
+
"hover:bg-[var(--button-outline-hover-bg,hsl(var(--accent)))]",
|
|
546
|
+
"hover:text-[var(--button-outline-hover-fg,hsl(var(--accent-foreground)))]",
|
|
547
|
+
"hover:border-[color:var(--button-outline-hover-border,var(--button-outline-border,hsl(var(--border))))]",
|
|
548
|
+
"hover:[box-shadow:var(--button-outline-shadow-hover,var(--button-shadow-hover,var(--button-outline-shadow,var(--button-shadow,none))))]",
|
|
549
|
+
"dark:bg-input/30 dark:border-input dark:hover:bg-input/50"
|
|
550
|
+
].join(" "),
|
|
551
|
+
// Secondary variant - full customization
|
|
552
|
+
secondary: [
|
|
553
|
+
"bg-[var(--button-secondary-bg,hsl(var(--secondary)))]",
|
|
554
|
+
"text-[var(--button-secondary-fg,hsl(var(--secondary-foreground)))]",
|
|
555
|
+
"border-[length:var(--button-secondary-border-width,0px)]",
|
|
556
|
+
"border-[color:var(--button-secondary-border,transparent)]",
|
|
557
|
+
"[box-shadow:var(--button-secondary-shadow,var(--button-shadow,none))]",
|
|
558
|
+
"hover:bg-[var(--button-secondary-hover-bg,hsl(var(--secondary)/0.8))]",
|
|
559
|
+
"hover:text-[var(--button-secondary-hover-fg,var(--button-secondary-fg,hsl(var(--secondary-foreground))))]",
|
|
560
|
+
"hover:border-[color:var(--button-secondary-hover-border,var(--button-secondary-border,transparent))]",
|
|
561
|
+
"hover:[box-shadow:var(--button-secondary-shadow-hover,var(--button-shadow-hover,var(--button-secondary-shadow,var(--button-shadow,none))))]"
|
|
562
|
+
].join(" "),
|
|
563
|
+
// Ghost variant - full customization
|
|
564
|
+
ghost: [
|
|
565
|
+
"bg-[var(--button-ghost-bg,transparent)]",
|
|
566
|
+
"text-[var(--button-ghost-fg,inherit)]",
|
|
567
|
+
"border-[length:var(--button-ghost-border-width,0px)]",
|
|
568
|
+
"border-[color:var(--button-ghost-border,transparent)]",
|
|
569
|
+
"[box-shadow:var(--button-ghost-shadow,var(--button-shadow,none))]",
|
|
570
|
+
"hover:bg-[var(--button-ghost-hover-bg,hsl(var(--accent)))]",
|
|
571
|
+
"hover:text-[var(--button-ghost-hover-fg,hsl(var(--accent-foreground)))]",
|
|
572
|
+
"hover:border-[color:var(--button-ghost-hover-border,var(--button-ghost-border,transparent))]",
|
|
573
|
+
"hover:[box-shadow:var(--button-ghost-shadow-hover,var(--button-shadow-hover,var(--button-ghost-shadow,var(--button-shadow,none))))]",
|
|
574
|
+
"dark:hover:bg-accent/50"
|
|
575
|
+
].join(" "),
|
|
576
|
+
// Link variant - full customization
|
|
577
|
+
link: [
|
|
578
|
+
"bg-[var(--button-link-bg,transparent)]",
|
|
579
|
+
"text-[var(--button-link-fg,hsl(var(--primary)))]",
|
|
580
|
+
"border-[length:var(--button-link-border-width,0px)]",
|
|
581
|
+
"border-[color:var(--button-link-border,transparent)]",
|
|
582
|
+
"[box-shadow:var(--button-link-shadow,none)]",
|
|
583
|
+
"hover:bg-[var(--button-link-hover-bg,transparent)]",
|
|
584
|
+
"hover:text-[var(--button-link-hover-fg,var(--button-link-fg,hsl(var(--primary))))]",
|
|
585
|
+
"hover:[box-shadow:var(--button-link-shadow-hover,none)]",
|
|
586
|
+
"underline-offset-4 hover:underline"
|
|
587
|
+
].join(" ")
|
|
588
|
+
},
|
|
589
|
+
size: {
|
|
590
|
+
default: [
|
|
591
|
+
"h-[var(--button-height-md,2.25rem)]",
|
|
592
|
+
"px-[var(--button-padding-x-md,1rem)]",
|
|
593
|
+
"py-[var(--button-padding-y-md,0.5rem)]",
|
|
594
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
|
|
595
|
+
].join(" "),
|
|
596
|
+
sm: [
|
|
597
|
+
"h-[var(--button-height-sm,2rem)]",
|
|
598
|
+
"px-[var(--button-padding-x-sm,0.75rem)]",
|
|
599
|
+
"py-[var(--button-padding-y-sm,0.25rem)]",
|
|
600
|
+
"gap-1.5",
|
|
601
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-sm,0.75rem)*0.83)]"
|
|
602
|
+
].join(" "),
|
|
603
|
+
md: [
|
|
604
|
+
"h-[var(--button-height-md,2.25rem)]",
|
|
605
|
+
"px-[var(--button-padding-x-md,1rem)]",
|
|
606
|
+
"py-[var(--button-padding-y-md,0.5rem)]",
|
|
607
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
|
|
608
|
+
].join(" "),
|
|
609
|
+
lg: [
|
|
610
|
+
"h-[var(--button-height-lg,2.5rem)]",
|
|
611
|
+
"px-[var(--button-padding-x-lg,1.5rem)]",
|
|
612
|
+
"py-[var(--button-padding-y-lg,0.5rem)]",
|
|
613
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-lg,1.5rem)*0.67)]"
|
|
614
|
+
].join(" "),
|
|
615
|
+
icon: "size-[var(--button-height-md,2.25rem)]",
|
|
616
|
+
"icon-sm": "size-[var(--button-height-sm,2rem)]",
|
|
617
|
+
"icon-lg": "size-[var(--button-height-lg,2.5rem)]"
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
defaultVariants: {
|
|
621
|
+
variant: "default",
|
|
622
|
+
size: "default"
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
function normalizePhoneNumber(input) {
|
|
626
|
+
const trimmed = input.trim();
|
|
627
|
+
if (trimmed.toLowerCase().startsWith("tel:")) {
|
|
628
|
+
return trimmed;
|
|
629
|
+
}
|
|
630
|
+
const match = trimmed.match(/^[\s\+\-\(\)]*(\d[\d\s\-\(\)\.]*\d)[\s\-]*(x|ext\.?|extension)?[\s\-]*(\d+)?$/i);
|
|
631
|
+
if (match) {
|
|
632
|
+
const mainNumber = match[1].replace(/[\s\-\(\)\.]/g, "");
|
|
633
|
+
const extension = match[3];
|
|
634
|
+
const normalized = mainNumber.length >= 10 && !trimmed.startsWith("+") ? `+${mainNumber}` : mainNumber;
|
|
635
|
+
const withExtension = extension ? `${normalized};ext=${extension}` : normalized;
|
|
636
|
+
return `tel:${withExtension}`;
|
|
637
|
+
}
|
|
638
|
+
const cleaned = trimmed.replace(/[\s\-\(\)\.]/g, "");
|
|
639
|
+
return `tel:${cleaned}`;
|
|
640
|
+
}
|
|
641
|
+
function normalizeEmail(input) {
|
|
642
|
+
const trimmed = input.trim();
|
|
643
|
+
if (trimmed.toLowerCase().startsWith("mailto:")) {
|
|
644
|
+
return trimmed;
|
|
645
|
+
}
|
|
646
|
+
return `mailto:${trimmed}`;
|
|
647
|
+
}
|
|
648
|
+
function isEmail(input) {
|
|
649
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
650
|
+
return emailRegex.test(input.trim());
|
|
651
|
+
}
|
|
652
|
+
function isPhoneNumber(input) {
|
|
653
|
+
const trimmed = input.trim();
|
|
654
|
+
if (trimmed.toLowerCase().startsWith("tel:")) {
|
|
655
|
+
return true;
|
|
656
|
+
}
|
|
657
|
+
const phoneRegex = /^[\s\+\-\(\)]*\d[\d\s\-\(\)\.]*\d[\s\-]*(x|ext\.?|extension)?[\s\-]*\d*$/i;
|
|
658
|
+
return phoneRegex.test(trimmed);
|
|
659
|
+
}
|
|
660
|
+
function isInternalUrl(href) {
|
|
661
|
+
if (typeof window === "undefined") {
|
|
662
|
+
return href.startsWith("/") && !href.startsWith("//");
|
|
663
|
+
}
|
|
664
|
+
const trimmed = href.trim();
|
|
665
|
+
if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
|
|
666
|
+
return true;
|
|
667
|
+
}
|
|
668
|
+
try {
|
|
669
|
+
const url = new URL(trimmed, window.location.href);
|
|
670
|
+
const currentOrigin = window.location.origin;
|
|
671
|
+
const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
|
|
672
|
+
return normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin);
|
|
673
|
+
} catch {
|
|
674
|
+
return false;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
function toRelativePath(href) {
|
|
678
|
+
if (typeof window === "undefined") {
|
|
679
|
+
return href;
|
|
680
|
+
}
|
|
681
|
+
const trimmed = href.trim();
|
|
682
|
+
if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
|
|
683
|
+
return trimmed;
|
|
684
|
+
}
|
|
685
|
+
try {
|
|
686
|
+
const url = new URL(trimmed, window.location.href);
|
|
687
|
+
const currentOrigin = window.location.origin;
|
|
688
|
+
const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
|
|
689
|
+
if (normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin)) {
|
|
690
|
+
return url.pathname + url.search + url.hash;
|
|
691
|
+
}
|
|
692
|
+
} catch {
|
|
693
|
+
}
|
|
694
|
+
return trimmed;
|
|
695
|
+
}
|
|
696
|
+
function useNavigation({
|
|
697
|
+
href,
|
|
698
|
+
onClick
|
|
699
|
+
} = {}) {
|
|
700
|
+
const linkType = React4__namespace.useMemo(() => {
|
|
701
|
+
if (!href || href.trim() === "") {
|
|
702
|
+
return onClick ? "none" : "none";
|
|
703
|
+
}
|
|
704
|
+
const trimmed = href.trim();
|
|
705
|
+
if (trimmed.toLowerCase().startsWith("mailto:") || isEmail(trimmed)) {
|
|
706
|
+
return "mailto";
|
|
707
|
+
}
|
|
708
|
+
if (trimmed.toLowerCase().startsWith("tel:") || isPhoneNumber(trimmed)) {
|
|
709
|
+
return "tel";
|
|
710
|
+
}
|
|
711
|
+
if (isInternalUrl(trimmed)) {
|
|
712
|
+
return "internal";
|
|
713
|
+
}
|
|
714
|
+
try {
|
|
715
|
+
new URL(trimmed, typeof window !== "undefined" ? window.location.href : "http://localhost");
|
|
716
|
+
return "external";
|
|
717
|
+
} catch {
|
|
718
|
+
return "internal";
|
|
719
|
+
}
|
|
720
|
+
}, [href, onClick]);
|
|
721
|
+
const normalizedHref = React4__namespace.useMemo(() => {
|
|
722
|
+
if (!href || href.trim() === "") {
|
|
723
|
+
return void 0;
|
|
724
|
+
}
|
|
725
|
+
const trimmed = href.trim();
|
|
726
|
+
switch (linkType) {
|
|
727
|
+
case "tel":
|
|
728
|
+
return normalizePhoneNumber(trimmed);
|
|
729
|
+
case "mailto":
|
|
730
|
+
return normalizeEmail(trimmed);
|
|
731
|
+
case "internal":
|
|
732
|
+
return toRelativePath(trimmed);
|
|
733
|
+
case "external":
|
|
734
|
+
return trimmed;
|
|
735
|
+
default:
|
|
736
|
+
return trimmed;
|
|
737
|
+
}
|
|
738
|
+
}, [href, linkType]);
|
|
739
|
+
const target = React4__namespace.useMemo(() => {
|
|
740
|
+
switch (linkType) {
|
|
741
|
+
case "external":
|
|
742
|
+
return "_blank";
|
|
743
|
+
case "internal":
|
|
744
|
+
return "_self";
|
|
745
|
+
case "mailto":
|
|
746
|
+
case "tel":
|
|
747
|
+
return void 0;
|
|
748
|
+
default:
|
|
749
|
+
return void 0;
|
|
750
|
+
}
|
|
751
|
+
}, [linkType]);
|
|
752
|
+
const rel = React4__namespace.useMemo(() => {
|
|
753
|
+
if (linkType === "external") {
|
|
754
|
+
return "noopener noreferrer";
|
|
755
|
+
}
|
|
756
|
+
return void 0;
|
|
757
|
+
}, [linkType]);
|
|
758
|
+
const isExternal = linkType === "external";
|
|
759
|
+
const isInternal = linkType === "internal";
|
|
760
|
+
const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
|
|
761
|
+
const handleClick = React4__namespace.useCallback(
|
|
762
|
+
(event) => {
|
|
763
|
+
if (onClick) {
|
|
764
|
+
try {
|
|
765
|
+
onClick(event);
|
|
766
|
+
} catch (error) {
|
|
767
|
+
console.error("Error in user onClick handler:", error);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
if (event.defaultPrevented) {
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
if (shouldUseRouter && normalizedHref && event.button === 0 && // left-click only
|
|
774
|
+
!event.metaKey && !event.altKey && !event.ctrlKey && !event.shiftKey) {
|
|
775
|
+
if (typeof window !== "undefined") {
|
|
776
|
+
const handler = window.__opensiteNavigationHandler;
|
|
777
|
+
if (typeof handler === "function") {
|
|
778
|
+
try {
|
|
779
|
+
const handled = handler(normalizedHref, event.nativeEvent || event);
|
|
780
|
+
if (handled !== false) {
|
|
781
|
+
event.preventDefault();
|
|
782
|
+
}
|
|
783
|
+
} catch (error) {
|
|
784
|
+
console.error("Error in navigation handler:", error);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
[onClick, shouldUseRouter, normalizedHref]
|
|
791
|
+
);
|
|
792
|
+
return {
|
|
793
|
+
linkType,
|
|
794
|
+
normalizedHref,
|
|
795
|
+
target,
|
|
796
|
+
rel,
|
|
797
|
+
isExternal,
|
|
798
|
+
isInternal,
|
|
799
|
+
shouldUseRouter,
|
|
800
|
+
handleClick
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
var Pressable = React4__namespace.forwardRef(
|
|
804
|
+
({
|
|
805
|
+
children,
|
|
806
|
+
className,
|
|
807
|
+
href,
|
|
808
|
+
onClick,
|
|
809
|
+
variant,
|
|
810
|
+
size,
|
|
811
|
+
asButton = false,
|
|
812
|
+
fallbackComponentType = "span",
|
|
813
|
+
componentType,
|
|
814
|
+
"aria-label": ariaLabel,
|
|
815
|
+
"aria-describedby": ariaDescribedby,
|
|
816
|
+
id,
|
|
817
|
+
...props
|
|
818
|
+
}, ref) => {
|
|
819
|
+
const navigation = useNavigation({ href, onClick });
|
|
820
|
+
const {
|
|
821
|
+
normalizedHref,
|
|
822
|
+
target,
|
|
823
|
+
rel,
|
|
824
|
+
linkType,
|
|
825
|
+
isInternal,
|
|
826
|
+
handleClick
|
|
827
|
+
} = navigation;
|
|
828
|
+
const shouldRenderLink = normalizedHref && linkType !== "none";
|
|
829
|
+
const shouldRenderButton = !shouldRenderLink && onClick;
|
|
830
|
+
const effectiveComponentType = componentType || (shouldRenderLink ? "a" : shouldRenderButton ? "button" : fallbackComponentType);
|
|
831
|
+
const finalComponentType = isInternal && shouldRenderLink ? "a" : effectiveComponentType;
|
|
832
|
+
const shouldApplyButtonStyles = asButton || variant || size;
|
|
833
|
+
const combinedClassName = cn(
|
|
834
|
+
shouldApplyButtonStyles && buttonVariants({ variant, size }),
|
|
835
|
+
className
|
|
836
|
+
);
|
|
837
|
+
const dataProps = Object.fromEntries(
|
|
838
|
+
Object.entries(props).filter(([key]) => key.startsWith("data-"))
|
|
839
|
+
);
|
|
840
|
+
const buttonDataAttributes = shouldApplyButtonStyles ? {
|
|
841
|
+
"data-slot": "button",
|
|
842
|
+
"data-variant": variant ?? "default",
|
|
843
|
+
"data-size": size ?? "default"
|
|
844
|
+
} : {};
|
|
845
|
+
const commonProps = {
|
|
846
|
+
className: combinedClassName,
|
|
847
|
+
onClick: handleClick,
|
|
848
|
+
"aria-label": ariaLabel,
|
|
849
|
+
"aria-describedby": ariaDescribedby,
|
|
850
|
+
id,
|
|
851
|
+
...dataProps,
|
|
852
|
+
...buttonDataAttributes
|
|
853
|
+
};
|
|
854
|
+
if (finalComponentType === "a" && shouldRenderLink) {
|
|
855
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
856
|
+
"a",
|
|
857
|
+
{
|
|
858
|
+
ref,
|
|
859
|
+
href: normalizedHref,
|
|
860
|
+
target,
|
|
861
|
+
rel,
|
|
862
|
+
...commonProps,
|
|
863
|
+
...props,
|
|
864
|
+
children
|
|
865
|
+
}
|
|
866
|
+
);
|
|
867
|
+
}
|
|
868
|
+
if (finalComponentType === "button") {
|
|
869
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
870
|
+
"button",
|
|
871
|
+
{
|
|
872
|
+
ref,
|
|
873
|
+
type: props.type || "button",
|
|
874
|
+
...commonProps,
|
|
875
|
+
...props,
|
|
876
|
+
children
|
|
877
|
+
}
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
if (finalComponentType === "div") {
|
|
881
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
882
|
+
"div",
|
|
883
|
+
{
|
|
884
|
+
ref,
|
|
885
|
+
...commonProps,
|
|
886
|
+
children
|
|
887
|
+
}
|
|
888
|
+
);
|
|
889
|
+
}
|
|
890
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
891
|
+
"span",
|
|
892
|
+
{
|
|
893
|
+
ref,
|
|
894
|
+
...commonProps,
|
|
895
|
+
children
|
|
896
|
+
}
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
);
|
|
900
|
+
Pressable.displayName = "Pressable";
|
|
482
901
|
function TestimonialsMiniDividers({
|
|
483
902
|
testimonials,
|
|
484
903
|
testimonialsSlot,
|
|
@@ -498,23 +917,23 @@ function TestimonialsMiniDividers({
|
|
|
498
917
|
pattern,
|
|
499
918
|
patternOpacity
|
|
500
919
|
}) {
|
|
501
|
-
const getAuthorName =
|
|
920
|
+
const getAuthorName = React4.useCallback(
|
|
502
921
|
(testimonial) => {
|
|
503
922
|
if (typeof testimonial.author === "string") return testimonial.author;
|
|
504
923
|
return "";
|
|
505
924
|
},
|
|
506
925
|
[]
|
|
507
926
|
);
|
|
508
|
-
const getAvatarSrc =
|
|
927
|
+
const getAvatarSrc = React4.useCallback(
|
|
509
928
|
(testimonial) => {
|
|
510
929
|
return testimonial.avatarSrc || testimonial.avatar?.src;
|
|
511
930
|
},
|
|
512
931
|
[]
|
|
513
932
|
);
|
|
514
|
-
const getInitials =
|
|
933
|
+
const getInitials = React4.useCallback((name) => {
|
|
515
934
|
return name.split(" ").map((n) => n[0]).join("");
|
|
516
935
|
}, []);
|
|
517
|
-
const renderedTestimonials =
|
|
936
|
+
const renderedTestimonials = React4.useMemo(() => {
|
|
518
937
|
if (testimonialsSlot) return testimonialsSlot;
|
|
519
938
|
if (!testimonials || testimonials.length === 0) return null;
|
|
520
939
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -545,11 +964,13 @@ function TestimonialsMiniDividers({
|
|
|
545
964
|
const authorName = getAuthorName(testimonial);
|
|
546
965
|
const avatarSrc = getAvatarSrc(testimonial);
|
|
547
966
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
548
|
-
|
|
967
|
+
Pressable,
|
|
549
968
|
{
|
|
969
|
+
href: testimonial.linkConfig?.href,
|
|
550
970
|
className: cn(
|
|
551
|
-
"group flex flex-col gap-4 border-t border-dashed p-
|
|
971
|
+
"group flex flex-col gap-4 border-t border-dashed p-6 lg:p-8",
|
|
552
972
|
index % 3 === 1 && "md:border-x md:border-dashed",
|
|
973
|
+
testimonial.linkConfig?.href ? "transition-all duration-500 hover:opacity-75 cursor-pointer" : "",
|
|
553
974
|
itemClassName
|
|
554
975
|
),
|
|
555
976
|
children: [
|
|
@@ -560,24 +981,15 @@ function TestimonialsMiniDividers({
|
|
|
560
981
|
] }),
|
|
561
982
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("min-w-0", authorClassName), children: [
|
|
562
983
|
testimonial.author && (typeof testimonial.author === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate font-medium", children: testimonial.author }) : testimonial.author),
|
|
563
|
-
testimonial.role && (typeof testimonial.role === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-sm
|
|
984
|
+
testimonial.role && (typeof testimonial.role === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-sm", children: testimonial.role }) : testimonial.role)
|
|
564
985
|
] })
|
|
565
986
|
] }),
|
|
566
987
|
testimonial.rating != null && /* @__PURE__ */ jsxRuntime.jsx(StarRating, { rating: testimonial.rating }),
|
|
567
|
-
testimonial.quote && (typeof testimonial.quote === "string" ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
568
|
-
"
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
quoteClassName
|
|
573
|
-
),
|
|
574
|
-
children: [
|
|
575
|
-
"\u201C",
|
|
576
|
-
testimonial.quote,
|
|
577
|
-
"\u201D"
|
|
578
|
-
]
|
|
579
|
-
}
|
|
580
|
-
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("text-sm", quoteClassName), children: testimonial.quote }))
|
|
988
|
+
testimonial.quote && (typeof testimonial.quote === "string" ? /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-sm leading-relaxed", quoteClassName), children: [
|
|
989
|
+
"\u201C",
|
|
990
|
+
testimonial.quote,
|
|
991
|
+
"\u201D"
|
|
992
|
+
] }) : testimonial.quote)
|
|
581
993
|
]
|
|
582
994
|
},
|
|
583
995
|
index
|