@opensite/ui 2.0.6 → 2.0.8
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/hero-adaptable-product-grid.cjs +1 -1
- package/dist/hero-adaptable-product-grid.js +1 -1
- package/dist/hero-agency-animated-images.cjs +795 -631
- package/dist/hero-agency-animated-images.d.cts +13 -9
- package/dist/hero-agency-animated-images.d.ts +13 -9
- package/dist/hero-agency-animated-images.js +794 -630
- package/dist/hero-business-carousel-dots.cjs +822 -911
- package/dist/hero-business-carousel-dots.d.cts +5 -1
- package/dist/hero-business-carousel-dots.d.ts +5 -1
- package/dist/hero-business-carousel-dots.js +824 -910
- package/dist/hero-coming-soon-countdown.cjs +267 -110
- package/dist/hero-coming-soon-countdown.d.cts +8 -11
- package/dist/hero-coming-soon-countdown.d.ts +8 -11
- package/dist/hero-coming-soon-countdown.js +268 -111
- package/dist/hero-conversation-intelligence.cjs +673 -639
- package/dist/hero-conversation-intelligence.js +663 -629
- package/dist/hero-creative-studio-stacked.cjs +899 -861
- package/dist/hero-creative-studio-stacked.d.cts +16 -15
- package/dist/hero-creative-studio-stacked.d.ts +16 -15
- package/dist/hero-creative-studio-stacked.js +897 -859
- package/dist/hero-customer-support-layered.cjs +89 -76
- package/dist/hero-customer-support-layered.js +89 -76
- package/dist/hero-developer-tools-code.cjs +721 -669
- package/dist/hero-developer-tools-code.d.cts +5 -1
- package/dist/hero-developer-tools-code.d.ts +5 -1
- package/dist/hero-developer-tools-code.js +719 -667
- package/dist/hero-digital-agency-fullscreen.cjs +722 -680
- package/dist/hero-digital-agency-fullscreen.d.cts +4 -20
- package/dist/hero-digital-agency-fullscreen.d.ts +4 -20
- package/dist/hero-digital-agency-fullscreen.js +722 -680
- package/dist/hero-ecommerce-product-showcase.cjs +892 -846
- package/dist/hero-ecommerce-product-showcase.js +889 -843
- package/dist/hero-enterprise-security.cjs +168 -132
- package/dist/hero-enterprise-security.d.cts +12 -19
- package/dist/hero-enterprise-security.d.ts +12 -19
- package/dist/hero-enterprise-security.js +168 -132
- package/dist/hero-event-registration.cjs +39 -39
- package/dist/hero-event-registration.js +39 -39
- package/dist/hero-fullscreen-background-image.cjs +3 -2
- package/dist/hero-fullscreen-background-image.js +3 -2
- package/dist/hero-fullscreen-logo-cta.cjs +4 -2
- package/dist/hero-fullscreen-logo-cta.js +4 -2
- package/dist/hero-innovation-image-grid.cjs +2 -2
- package/dist/hero-innovation-image-grid.js +2 -2
- package/dist/hero-mental-health-team.cjs +17 -17
- package/dist/hero-mental-health-team.d.cts +5 -5
- package/dist/hero-mental-health-team.d.ts +5 -5
- package/dist/hero-mental-health-team.js +17 -17
- package/dist/hero-mobile-app-download.cjs +2 -2
- package/dist/hero-mobile-app-download.js +2 -2
- package/dist/hero-newsletter-minimal.cjs +97 -57
- package/dist/hero-newsletter-minimal.d.cts +5 -1
- package/dist/hero-newsletter-minimal.d.ts +5 -1
- package/dist/hero-newsletter-minimal.js +97 -57
- package/dist/hero-shared-inbox-layered.cjs +522 -42
- package/dist/hero-shared-inbox-layered.d.cts +20 -4
- package/dist/hero-shared-inbox-layered.d.ts +20 -4
- package/dist/hero-shared-inbox-layered.js +505 -40
- package/dist/hero-startup-launch-cta.cjs +859 -816
- package/dist/hero-startup-launch-cta.d.cts +3 -2
- package/dist/hero-startup-launch-cta.d.ts +3 -2
- package/dist/hero-startup-launch-cta.js +858 -815
- package/dist/hero-therapy-testimonial-grid.cjs +1 -1
- package/dist/hero-therapy-testimonial-grid.js +1 -1
- package/dist/hero-video-dialog-gradient-BnCFFec0.d.ts +99 -0
- package/dist/hero-video-dialog-gradient-Dapebkzu.d.cts +99 -0
- package/dist/hero-video-dialog-gradient.cjs +24 -23
- package/dist/hero-video-dialog-gradient.d.cts +4 -94
- package/dist/hero-video-dialog-gradient.d.ts +4 -94
- package/dist/hero-video-dialog-gradient.js +24 -23
- package/dist/hero-welcome-asymmetric-images.cjs +652 -617
- package/dist/hero-welcome-asymmetric-images.d.cts +5 -1
- package/dist/hero-welcome-asymmetric-images.d.ts +5 -1
- package/dist/hero-welcome-asymmetric-images.js +651 -616
- package/dist/registry.cjs +1111 -848
- package/dist/registry.js +1111 -848
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import * as React3 from 'react';
|
|
3
|
+
import React3__default, { useMemo } from 'react';
|
|
3
4
|
import { clsx } from 'clsx';
|
|
4
5
|
import { twMerge } from 'tailwind-merge';
|
|
5
6
|
import { Img } from '@page-speed/img';
|
|
6
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
9
9
|
|
|
10
10
|
// components/blocks/hero/hero-shared-inbox-layered.tsx
|
|
@@ -20,7 +20,7 @@ var maxWidthStyles = {
|
|
|
20
20
|
"4xl": "max-w-[1536px]",
|
|
21
21
|
full: "max-w-full"
|
|
22
22
|
};
|
|
23
|
-
var Container =
|
|
23
|
+
var Container = React3__default.forwardRef(
|
|
24
24
|
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
25
25
|
const Component = as;
|
|
26
26
|
return /* @__PURE__ */ jsx(
|
|
@@ -325,7 +325,7 @@ var spacingStyles = {
|
|
|
325
325
|
};
|
|
326
326
|
var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
|
|
327
327
|
var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
|
|
328
|
-
var Section =
|
|
328
|
+
var Section = React3__default.forwardRef(
|
|
329
329
|
({
|
|
330
330
|
id,
|
|
331
331
|
title,
|
|
@@ -386,47 +386,501 @@ var Section = React.forwardRef(
|
|
|
386
386
|
}
|
|
387
387
|
);
|
|
388
388
|
Section.displayName = "Section";
|
|
389
|
-
var
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
389
|
+
var baseStyles = [
|
|
390
|
+
// Layout
|
|
391
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap shrink-0",
|
|
392
|
+
// Typography - using CSS variables with sensible defaults
|
|
393
|
+
"font-[var(--button-font-family,inherit)]",
|
|
394
|
+
"font-[var(--button-font-weight,500)]",
|
|
395
|
+
"tracking-[var(--button-letter-spacing,0)]",
|
|
396
|
+
"leading-[var(--button-line-height,1.25)]",
|
|
397
|
+
"[text-transform:var(--button-text-transform,none)]",
|
|
398
|
+
"text-sm",
|
|
399
|
+
// Border radius
|
|
400
|
+
"rounded-[var(--button-radius,var(--radius,0.375rem))]",
|
|
401
|
+
// Smooth transition - using [transition:...] to set full shorthand property (not just transition-property)
|
|
402
|
+
"[transition:var(--button-transition,all_250ms_cubic-bezier(0.4,0,0.2,1))]",
|
|
403
|
+
// Box shadow (master level) - using [box-shadow:...] for complex multi-value shadows
|
|
404
|
+
"[box-shadow:var(--button-shadow,none)]",
|
|
405
|
+
"hover:[box-shadow:var(--button-shadow-hover,var(--button-shadow,none))]",
|
|
406
|
+
// Disabled state
|
|
407
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
408
|
+
// SVG handling
|
|
409
|
+
"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
|
|
410
|
+
// Focus styles
|
|
411
|
+
"outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
412
|
+
// Invalid state
|
|
413
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
|
|
414
|
+
].join(" ");
|
|
415
|
+
var buttonVariants = cva(baseStyles, {
|
|
416
|
+
variants: {
|
|
417
|
+
variant: {
|
|
418
|
+
// Default (Primary) variant - full customization
|
|
419
|
+
default: [
|
|
420
|
+
"bg-[var(--button-default-bg,hsl(var(--primary)))]",
|
|
421
|
+
"text-[var(--button-default-fg,hsl(var(--primary-foreground)))]",
|
|
422
|
+
"border-[length:var(--button-default-border-width,0px)]",
|
|
423
|
+
"border-[color:var(--button-default-border,transparent)]",
|
|
424
|
+
"[box-shadow:var(--button-default-shadow,var(--button-shadow,none))]",
|
|
425
|
+
"hover:bg-[var(--button-default-hover-bg,hsl(var(--primary)/0.9))]",
|
|
426
|
+
"hover:text-[var(--button-default-hover-fg,var(--button-default-fg,hsl(var(--primary-foreground))))]",
|
|
427
|
+
"hover:border-[color:var(--button-default-hover-border,var(--button-default-border,transparent))]",
|
|
428
|
+
"hover:[box-shadow:var(--button-default-shadow-hover,var(--button-shadow-hover,var(--button-default-shadow,var(--button-shadow,none))))]"
|
|
429
|
+
].join(" "),
|
|
430
|
+
// Destructive variant - full customization
|
|
431
|
+
destructive: [
|
|
432
|
+
"bg-[var(--button-destructive-bg,hsl(var(--destructive)))]",
|
|
433
|
+
"text-[var(--button-destructive-fg,white)]",
|
|
434
|
+
"border-[length:var(--button-destructive-border-width,0px)]",
|
|
435
|
+
"border-[color:var(--button-destructive-border,transparent)]",
|
|
436
|
+
"[box-shadow:var(--button-destructive-shadow,var(--button-shadow,none))]",
|
|
437
|
+
"hover:bg-[var(--button-destructive-hover-bg,hsl(var(--destructive)/0.9))]",
|
|
438
|
+
"hover:text-[var(--button-destructive-hover-fg,var(--button-destructive-fg,white))]",
|
|
439
|
+
"hover:border-[color:var(--button-destructive-hover-border,var(--button-destructive-border,transparent))]",
|
|
440
|
+
"hover:[box-shadow:var(--button-destructive-shadow-hover,var(--button-shadow-hover,var(--button-destructive-shadow,var(--button-shadow,none))))]",
|
|
441
|
+
"focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
442
|
+
"dark:bg-destructive/60"
|
|
443
|
+
].join(" "),
|
|
444
|
+
// Outline variant - full customization with proper border handling
|
|
445
|
+
outline: [
|
|
446
|
+
"bg-[var(--button-outline-bg,hsl(var(--background)))]",
|
|
447
|
+
"text-[var(--button-outline-fg,inherit)]",
|
|
448
|
+
"border-[length:var(--button-outline-border-width,1px)]",
|
|
449
|
+
"border-[color:var(--button-outline-border,hsl(var(--border)))]",
|
|
450
|
+
"[box-shadow:var(--button-outline-shadow,var(--button-shadow,0_1px_2px_0_rgb(0_0_0/0.05)))]",
|
|
451
|
+
"hover:bg-[var(--button-outline-hover-bg,hsl(var(--accent)))]",
|
|
452
|
+
"hover:text-[var(--button-outline-hover-fg,hsl(var(--accent-foreground)))]",
|
|
453
|
+
"hover:border-[color:var(--button-outline-hover-border,var(--button-outline-border,hsl(var(--border))))]",
|
|
454
|
+
"hover:[box-shadow:var(--button-outline-shadow-hover,var(--button-shadow-hover,var(--button-outline-shadow,var(--button-shadow,none))))]",
|
|
455
|
+
"dark:bg-input/30 dark:border-input dark:hover:bg-input/50"
|
|
456
|
+
].join(" "),
|
|
457
|
+
// Secondary variant - full customization
|
|
458
|
+
secondary: [
|
|
459
|
+
"bg-[var(--button-secondary-bg,hsl(var(--secondary)))]",
|
|
460
|
+
"text-[var(--button-secondary-fg,hsl(var(--secondary-foreground)))]",
|
|
461
|
+
"border-[length:var(--button-secondary-border-width,0px)]",
|
|
462
|
+
"border-[color:var(--button-secondary-border,transparent)]",
|
|
463
|
+
"[box-shadow:var(--button-secondary-shadow,var(--button-shadow,none))]",
|
|
464
|
+
"hover:bg-[var(--button-secondary-hover-bg,hsl(var(--secondary)/0.8))]",
|
|
465
|
+
"hover:text-[var(--button-secondary-hover-fg,var(--button-secondary-fg,hsl(var(--secondary-foreground))))]",
|
|
466
|
+
"hover:border-[color:var(--button-secondary-hover-border,var(--button-secondary-border,transparent))]",
|
|
467
|
+
"hover:[box-shadow:var(--button-secondary-shadow-hover,var(--button-shadow-hover,var(--button-secondary-shadow,var(--button-shadow,none))))]"
|
|
468
|
+
].join(" "),
|
|
469
|
+
// Ghost variant - full customization
|
|
470
|
+
ghost: [
|
|
471
|
+
"bg-[var(--button-ghost-bg,transparent)]",
|
|
472
|
+
"text-[var(--button-ghost-fg,inherit)]",
|
|
473
|
+
"border-[length:var(--button-ghost-border-width,0px)]",
|
|
474
|
+
"border-[color:var(--button-ghost-border,transparent)]",
|
|
475
|
+
"[box-shadow:var(--button-ghost-shadow,var(--button-shadow,none))]",
|
|
476
|
+
"hover:bg-[var(--button-ghost-hover-bg,hsl(var(--accent)))]",
|
|
477
|
+
"hover:text-[var(--button-ghost-hover-fg,hsl(var(--accent-foreground)))]",
|
|
478
|
+
"hover:border-[color:var(--button-ghost-hover-border,var(--button-ghost-border,transparent))]",
|
|
479
|
+
"hover:[box-shadow:var(--button-ghost-shadow-hover,var(--button-shadow-hover,var(--button-ghost-shadow,var(--button-shadow,none))))]",
|
|
480
|
+
"dark:hover:bg-accent/50"
|
|
481
|
+
].join(" "),
|
|
482
|
+
// Link variant - full customization
|
|
483
|
+
link: [
|
|
484
|
+
"bg-[var(--button-link-bg,transparent)]",
|
|
485
|
+
"text-[var(--button-link-fg,hsl(var(--primary)))]",
|
|
486
|
+
"border-[length:var(--button-link-border-width,0px)]",
|
|
487
|
+
"border-[color:var(--button-link-border,transparent)]",
|
|
488
|
+
"[box-shadow:var(--button-link-shadow,none)]",
|
|
489
|
+
"hover:bg-[var(--button-link-hover-bg,transparent)]",
|
|
490
|
+
"hover:text-[var(--button-link-hover-fg,var(--button-link-fg,hsl(var(--primary))))]",
|
|
491
|
+
"hover:[box-shadow:var(--button-link-shadow-hover,none)]",
|
|
492
|
+
"underline-offset-4 hover:underline"
|
|
493
|
+
].join(" ")
|
|
494
|
+
},
|
|
495
|
+
size: {
|
|
496
|
+
default: [
|
|
497
|
+
"h-[var(--button-height-md,2.25rem)]",
|
|
498
|
+
"px-[var(--button-padding-x-md,1rem)]",
|
|
499
|
+
"py-[var(--button-padding-y-md,0.5rem)]",
|
|
500
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
|
|
501
|
+
].join(" "),
|
|
502
|
+
sm: [
|
|
503
|
+
"h-[var(--button-height-sm,2rem)]",
|
|
504
|
+
"px-[var(--button-padding-x-sm,0.75rem)]",
|
|
505
|
+
"py-[var(--button-padding-y-sm,0.25rem)]",
|
|
506
|
+
"gap-1.5",
|
|
507
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-sm,0.75rem)*0.83)]"
|
|
508
|
+
].join(" "),
|
|
509
|
+
md: [
|
|
510
|
+
"h-[var(--button-height-md,2.25rem)]",
|
|
511
|
+
"px-[var(--button-padding-x-md,1rem)]",
|
|
512
|
+
"py-[var(--button-padding-y-md,0.5rem)]",
|
|
513
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
|
|
514
|
+
].join(" "),
|
|
515
|
+
lg: [
|
|
516
|
+
"h-[var(--button-height-lg,2.5rem)]",
|
|
517
|
+
"px-[var(--button-padding-x-lg,1.5rem)]",
|
|
518
|
+
"py-[var(--button-padding-y-lg,0.5rem)]",
|
|
519
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-lg,1.5rem)*0.67)]"
|
|
520
|
+
].join(" "),
|
|
521
|
+
icon: "size-[var(--button-height-md,2.25rem)]",
|
|
522
|
+
"icon-sm": "size-[var(--button-height-sm,2rem)]",
|
|
523
|
+
"icon-lg": "size-[var(--button-height-lg,2.5rem)]"
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
defaultVariants: {
|
|
527
|
+
variant: "default",
|
|
528
|
+
size: "default"
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
function normalizePhoneNumber(input) {
|
|
532
|
+
const trimmed = input.trim();
|
|
533
|
+
if (trimmed.toLowerCase().startsWith("tel:")) {
|
|
534
|
+
return trimmed;
|
|
535
|
+
}
|
|
536
|
+
const match = trimmed.match(/^[\s\+\-\(\)]*(\d[\d\s\-\(\)\.]*\d)[\s\-]*(x|ext\.?|extension)?[\s\-]*(\d+)?$/i);
|
|
537
|
+
if (match) {
|
|
538
|
+
const mainNumber = match[1].replace(/[\s\-\(\)\.]/g, "");
|
|
539
|
+
const extension = match[3];
|
|
540
|
+
const normalized = mainNumber.length >= 10 && !trimmed.startsWith("+") ? `+${mainNumber}` : mainNumber;
|
|
541
|
+
const withExtension = extension ? `${normalized};ext=${extension}` : normalized;
|
|
542
|
+
return `tel:${withExtension}`;
|
|
543
|
+
}
|
|
544
|
+
const cleaned = trimmed.replace(/[\s\-\(\)\.]/g, "");
|
|
545
|
+
return `tel:${cleaned}`;
|
|
546
|
+
}
|
|
547
|
+
function normalizeEmail(input) {
|
|
548
|
+
const trimmed = input.trim();
|
|
549
|
+
if (trimmed.toLowerCase().startsWith("mailto:")) {
|
|
550
|
+
return trimmed;
|
|
551
|
+
}
|
|
552
|
+
return `mailto:${trimmed}`;
|
|
553
|
+
}
|
|
554
|
+
function isEmail(input) {
|
|
555
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
556
|
+
return emailRegex.test(input.trim());
|
|
557
|
+
}
|
|
558
|
+
function isPhoneNumber(input) {
|
|
559
|
+
const trimmed = input.trim();
|
|
560
|
+
if (trimmed.toLowerCase().startsWith("tel:")) {
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
563
|
+
const phoneRegex = /^[\s\+\-\(\)]*\d[\d\s\-\(\)\.]*\d[\s\-]*(x|ext\.?|extension)?[\s\-]*\d*$/i;
|
|
564
|
+
return phoneRegex.test(trimmed);
|
|
565
|
+
}
|
|
566
|
+
function isInternalUrl(href) {
|
|
567
|
+
if (typeof window === "undefined") {
|
|
568
|
+
return href.startsWith("/") && !href.startsWith("//");
|
|
569
|
+
}
|
|
570
|
+
const trimmed = href.trim();
|
|
571
|
+
if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
|
|
572
|
+
return true;
|
|
573
|
+
}
|
|
574
|
+
try {
|
|
575
|
+
const url = new URL(trimmed, window.location.href);
|
|
576
|
+
const currentOrigin = window.location.origin;
|
|
577
|
+
const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
|
|
578
|
+
return normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin);
|
|
579
|
+
} catch {
|
|
580
|
+
return false;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
function toRelativePath(href) {
|
|
584
|
+
if (typeof window === "undefined") {
|
|
585
|
+
return href;
|
|
586
|
+
}
|
|
587
|
+
const trimmed = href.trim();
|
|
588
|
+
if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
|
|
589
|
+
return trimmed;
|
|
590
|
+
}
|
|
591
|
+
try {
|
|
592
|
+
const url = new URL(trimmed, window.location.href);
|
|
593
|
+
const currentOrigin = window.location.origin;
|
|
594
|
+
const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
|
|
595
|
+
if (normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin)) {
|
|
596
|
+
return url.pathname + url.search + url.hash;
|
|
597
|
+
}
|
|
598
|
+
} catch {
|
|
599
|
+
}
|
|
600
|
+
return trimmed;
|
|
601
|
+
}
|
|
602
|
+
function useNavigation({
|
|
603
|
+
href,
|
|
604
|
+
onClick
|
|
605
|
+
} = {}) {
|
|
606
|
+
const linkType = React3.useMemo(() => {
|
|
607
|
+
if (!href || href.trim() === "") {
|
|
608
|
+
return onClick ? "none" : "none";
|
|
609
|
+
}
|
|
610
|
+
const trimmed = href.trim();
|
|
611
|
+
if (trimmed.toLowerCase().startsWith("mailto:") || isEmail(trimmed)) {
|
|
612
|
+
return "mailto";
|
|
613
|
+
}
|
|
614
|
+
if (trimmed.toLowerCase().startsWith("tel:") || isPhoneNumber(trimmed)) {
|
|
615
|
+
return "tel";
|
|
616
|
+
}
|
|
617
|
+
if (isInternalUrl(trimmed)) {
|
|
618
|
+
return "internal";
|
|
619
|
+
}
|
|
620
|
+
try {
|
|
621
|
+
new URL(trimmed, typeof window !== "undefined" ? window.location.href : "http://localhost");
|
|
622
|
+
return "external";
|
|
623
|
+
} catch {
|
|
624
|
+
return "internal";
|
|
625
|
+
}
|
|
626
|
+
}, [href, onClick]);
|
|
627
|
+
const normalizedHref = React3.useMemo(() => {
|
|
628
|
+
if (!href || href.trim() === "") {
|
|
629
|
+
return void 0;
|
|
630
|
+
}
|
|
631
|
+
const trimmed = href.trim();
|
|
632
|
+
switch (linkType) {
|
|
633
|
+
case "tel":
|
|
634
|
+
return normalizePhoneNumber(trimmed);
|
|
635
|
+
case "mailto":
|
|
636
|
+
return normalizeEmail(trimmed);
|
|
637
|
+
case "internal":
|
|
638
|
+
return toRelativePath(trimmed);
|
|
639
|
+
case "external":
|
|
640
|
+
return trimmed;
|
|
641
|
+
default:
|
|
642
|
+
return trimmed;
|
|
643
|
+
}
|
|
644
|
+
}, [href, linkType]);
|
|
645
|
+
const target = React3.useMemo(() => {
|
|
646
|
+
switch (linkType) {
|
|
647
|
+
case "external":
|
|
648
|
+
return "_blank";
|
|
649
|
+
case "internal":
|
|
650
|
+
return "_self";
|
|
651
|
+
case "mailto":
|
|
652
|
+
case "tel":
|
|
653
|
+
return void 0;
|
|
654
|
+
default:
|
|
655
|
+
return void 0;
|
|
656
|
+
}
|
|
657
|
+
}, [linkType]);
|
|
658
|
+
const rel = React3.useMemo(() => {
|
|
659
|
+
if (linkType === "external") {
|
|
660
|
+
return "noopener noreferrer";
|
|
661
|
+
}
|
|
662
|
+
return void 0;
|
|
663
|
+
}, [linkType]);
|
|
664
|
+
const isExternal = linkType === "external";
|
|
665
|
+
const isInternal = linkType === "internal";
|
|
666
|
+
const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
|
|
667
|
+
const handleClick = React3.useCallback(
|
|
668
|
+
(event) => {
|
|
669
|
+
if (onClick) {
|
|
670
|
+
try {
|
|
671
|
+
onClick(event);
|
|
672
|
+
} catch (error) {
|
|
673
|
+
console.error("Error in user onClick handler:", error);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
if (event.defaultPrevented) {
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
if (shouldUseRouter && normalizedHref && event.button === 0 && // left-click only
|
|
680
|
+
!event.metaKey && !event.altKey && !event.ctrlKey && !event.shiftKey) {
|
|
681
|
+
if (typeof window !== "undefined") {
|
|
682
|
+
const handler = window.__opensiteNavigationHandler;
|
|
683
|
+
if (typeof handler === "function") {
|
|
684
|
+
try {
|
|
685
|
+
const handled = handler(normalizedHref, event.nativeEvent || event);
|
|
686
|
+
if (handled !== false) {
|
|
687
|
+
event.preventDefault();
|
|
688
|
+
}
|
|
689
|
+
} catch (error) {
|
|
690
|
+
console.error("Error in navigation handler:", error);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
398
694
|
}
|
|
399
695
|
},
|
|
400
|
-
|
|
401
|
-
|
|
696
|
+
[onClick, shouldUseRouter, normalizedHref]
|
|
697
|
+
);
|
|
698
|
+
return {
|
|
699
|
+
linkType,
|
|
700
|
+
normalizedHref,
|
|
701
|
+
target,
|
|
702
|
+
rel,
|
|
703
|
+
isExternal,
|
|
704
|
+
isInternal,
|
|
705
|
+
shouldUseRouter,
|
|
706
|
+
handleClick
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
var Pressable = React3.forwardRef(
|
|
710
|
+
({
|
|
711
|
+
children,
|
|
712
|
+
className,
|
|
713
|
+
href,
|
|
714
|
+
onClick,
|
|
715
|
+
variant,
|
|
716
|
+
size,
|
|
717
|
+
asButton = false,
|
|
718
|
+
fallbackComponentType = "span",
|
|
719
|
+
componentType,
|
|
720
|
+
"aria-label": ariaLabel,
|
|
721
|
+
"aria-describedby": ariaDescribedby,
|
|
722
|
+
id,
|
|
723
|
+
...props
|
|
724
|
+
}, ref) => {
|
|
725
|
+
const navigation = useNavigation({ href, onClick });
|
|
726
|
+
const {
|
|
727
|
+
normalizedHref,
|
|
728
|
+
target,
|
|
729
|
+
rel,
|
|
730
|
+
linkType,
|
|
731
|
+
isInternal,
|
|
732
|
+
handleClick
|
|
733
|
+
} = navigation;
|
|
734
|
+
const shouldRenderLink = normalizedHref && linkType !== "none";
|
|
735
|
+
const shouldRenderButton = !shouldRenderLink && onClick;
|
|
736
|
+
const effectiveComponentType = componentType || (shouldRenderLink ? "a" : shouldRenderButton ? "button" : fallbackComponentType);
|
|
737
|
+
const finalComponentType = isInternal && shouldRenderLink ? "a" : effectiveComponentType;
|
|
738
|
+
const shouldApplyButtonStyles = asButton || variant || size;
|
|
739
|
+
const combinedClassName = cn(
|
|
740
|
+
shouldApplyButtonStyles && buttonVariants({ variant, size }),
|
|
741
|
+
className
|
|
742
|
+
);
|
|
743
|
+
const dataProps = Object.fromEntries(
|
|
744
|
+
Object.entries(props).filter(([key]) => key.startsWith("data-"))
|
|
745
|
+
);
|
|
746
|
+
const buttonDataAttributes = shouldApplyButtonStyles ? {
|
|
747
|
+
"data-slot": "button",
|
|
748
|
+
"data-variant": variant ?? "default",
|
|
749
|
+
"data-size": size ?? "default"
|
|
750
|
+
} : {};
|
|
751
|
+
const commonProps = {
|
|
752
|
+
className: combinedClassName,
|
|
753
|
+
onClick: handleClick,
|
|
754
|
+
"aria-label": ariaLabel,
|
|
755
|
+
"aria-describedby": ariaDescribedby,
|
|
756
|
+
id,
|
|
757
|
+
...dataProps,
|
|
758
|
+
...buttonDataAttributes
|
|
759
|
+
};
|
|
760
|
+
if (finalComponentType === "a" && shouldRenderLink) {
|
|
761
|
+
return /* @__PURE__ */ jsx(
|
|
762
|
+
"a",
|
|
763
|
+
{
|
|
764
|
+
ref,
|
|
765
|
+
href: normalizedHref,
|
|
766
|
+
target,
|
|
767
|
+
rel,
|
|
768
|
+
...commonProps,
|
|
769
|
+
...props,
|
|
770
|
+
children
|
|
771
|
+
}
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
if (finalComponentType === "button") {
|
|
775
|
+
return /* @__PURE__ */ jsx(
|
|
776
|
+
"button",
|
|
777
|
+
{
|
|
778
|
+
ref,
|
|
779
|
+
type: props.type || "button",
|
|
780
|
+
...commonProps,
|
|
781
|
+
...props,
|
|
782
|
+
children
|
|
783
|
+
}
|
|
784
|
+
);
|
|
402
785
|
}
|
|
786
|
+
if (finalComponentType === "div") {
|
|
787
|
+
return /* @__PURE__ */ jsx(
|
|
788
|
+
"div",
|
|
789
|
+
{
|
|
790
|
+
ref,
|
|
791
|
+
...commonProps,
|
|
792
|
+
children
|
|
793
|
+
}
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
return /* @__PURE__ */ jsx(
|
|
797
|
+
"span",
|
|
798
|
+
{
|
|
799
|
+
ref,
|
|
800
|
+
...commonProps,
|
|
801
|
+
children
|
|
802
|
+
}
|
|
803
|
+
);
|
|
403
804
|
}
|
|
404
805
|
);
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
806
|
+
Pressable.displayName = "Pressable";
|
|
807
|
+
var MOBILE_CLASSES = {
|
|
808
|
+
"fit-left": "items-start md:items-center",
|
|
809
|
+
"fit-center": "items-center",
|
|
810
|
+
"fit-right": "items-end md:items-center",
|
|
811
|
+
"full-left": "items-stretch md:items-center",
|
|
812
|
+
"full-center": "items-stretch md:items-center",
|
|
813
|
+
"full-right": "items-stretch md:items-center"
|
|
814
|
+
};
|
|
815
|
+
function BlockActions({
|
|
816
|
+
mobileConfig,
|
|
817
|
+
actionsClassName,
|
|
818
|
+
verticalSpacing = "mt-4 md:mt-8",
|
|
819
|
+
actions,
|
|
820
|
+
actionsSlot
|
|
410
821
|
}) {
|
|
411
|
-
const
|
|
822
|
+
const width = mobileConfig?.width ?? "full";
|
|
823
|
+
const position = mobileConfig?.position ?? "center";
|
|
824
|
+
const mobileLayoutClass = MOBILE_CLASSES[`${width}-${position}`];
|
|
825
|
+
if (actionsSlot) {
|
|
826
|
+
return /* @__PURE__ */ jsx("div", { children: actionsSlot });
|
|
827
|
+
} else if (actions && actions?.length > 0) {
|
|
828
|
+
return /* @__PURE__ */ jsx(
|
|
829
|
+
"div",
|
|
830
|
+
{
|
|
831
|
+
className: cn(
|
|
832
|
+
"flex flex-col md:flex-row flex-wrap gap-4",
|
|
833
|
+
mobileLayoutClass,
|
|
834
|
+
actionsClassName,
|
|
835
|
+
verticalSpacing
|
|
836
|
+
),
|
|
837
|
+
children: actions.map((action, index) => /* @__PURE__ */ jsx(ActionComponent, { action }, index))
|
|
838
|
+
}
|
|
839
|
+
);
|
|
840
|
+
} else {
|
|
841
|
+
return null;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
function ActionComponent({ action }) {
|
|
845
|
+
const {
|
|
846
|
+
label,
|
|
847
|
+
icon,
|
|
848
|
+
iconAfter,
|
|
849
|
+
children,
|
|
850
|
+
href,
|
|
851
|
+
onClick,
|
|
852
|
+
className: actionClassName,
|
|
853
|
+
...pressableProps
|
|
854
|
+
} = action;
|
|
412
855
|
return /* @__PURE__ */ jsx(
|
|
413
|
-
|
|
856
|
+
Pressable,
|
|
414
857
|
{
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
858
|
+
href,
|
|
859
|
+
onClick,
|
|
860
|
+
asButton: action.asButton ?? true,
|
|
861
|
+
className: actionClassName,
|
|
862
|
+
...pressableProps,
|
|
863
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
864
|
+
icon,
|
|
865
|
+
label,
|
|
866
|
+
iconAfter
|
|
867
|
+
] })
|
|
418
868
|
}
|
|
419
869
|
);
|
|
420
870
|
}
|
|
421
871
|
function HeroSharedInboxLayered({
|
|
422
|
-
|
|
872
|
+
eyebrow,
|
|
873
|
+
eyebrowClassName,
|
|
423
874
|
heading,
|
|
424
875
|
description,
|
|
425
876
|
layeredImages,
|
|
426
877
|
layeredImagesSlot,
|
|
427
878
|
background,
|
|
879
|
+
actions,
|
|
880
|
+
actionsSlot,
|
|
881
|
+
actionsClassName,
|
|
428
882
|
containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
|
|
429
|
-
spacing = "
|
|
883
|
+
spacing = "xl",
|
|
430
884
|
pattern,
|
|
431
885
|
patternOpacity,
|
|
432
886
|
className,
|
|
@@ -486,7 +940,7 @@ function HeroSharedInboxLayered({
|
|
|
486
940
|
patternClassName,
|
|
487
941
|
className,
|
|
488
942
|
containerClassName,
|
|
489
|
-
children: /* @__PURE__ */ jsx("div", { className: "
|
|
943
|
+
children: /* @__PURE__ */ jsx("div", { className: "pt-8 md:pt-0", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 items-center gap-4 md:gap-20 md:grid-cols-2", children: [
|
|
490
944
|
/* @__PURE__ */ jsxs(
|
|
491
945
|
"div",
|
|
492
946
|
{
|
|
@@ -495,33 +949,44 @@ function HeroSharedInboxLayered({
|
|
|
495
949
|
contentClassName
|
|
496
950
|
),
|
|
497
951
|
children: [
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
"h1",
|
|
952
|
+
eyebrow && (typeof eyebrow === "string" ? /* @__PURE__ */ jsx(
|
|
953
|
+
"div",
|
|
501
954
|
{
|
|
502
955
|
className: cn(
|
|
503
|
-
"
|
|
504
|
-
|
|
956
|
+
"font-light tracking-widest text-sm md:text-md uppercase",
|
|
957
|
+
eyebrowClassName
|
|
505
958
|
),
|
|
506
|
-
children:
|
|
959
|
+
children: eyebrow
|
|
507
960
|
}
|
|
508
|
-
) :
|
|
961
|
+
) : eyebrow),
|
|
962
|
+
heading && (typeof heading === "string" ? /* @__PURE__ */ jsx(
|
|
509
963
|
"h1",
|
|
510
964
|
{
|
|
511
965
|
className: cn(
|
|
512
|
-
"text-
|
|
966
|
+
"text-4xl font-semibold text-balance md:text-7xl",
|
|
513
967
|
headingClassName
|
|
514
968
|
),
|
|
515
969
|
children: heading
|
|
516
970
|
}
|
|
517
|
-
)),
|
|
971
|
+
) : heading),
|
|
518
972
|
description && (typeof description === "string" ? /* @__PURE__ */ jsx(
|
|
519
973
|
"p",
|
|
520
974
|
{
|
|
521
|
-
className: cn(
|
|
975
|
+
className: cn(
|
|
976
|
+
"max-w-full md:max-w-[70%] text-lg md:text-xl font-normal text-balance",
|
|
977
|
+
descriptionClassName
|
|
978
|
+
),
|
|
522
979
|
children: description
|
|
523
980
|
}
|
|
524
|
-
) :
|
|
981
|
+
) : description),
|
|
982
|
+
/* @__PURE__ */ jsx(
|
|
983
|
+
BlockActions,
|
|
984
|
+
{
|
|
985
|
+
actions,
|
|
986
|
+
actionsSlot,
|
|
987
|
+
actionsClassName
|
|
988
|
+
}
|
|
989
|
+
)
|
|
525
990
|
]
|
|
526
991
|
}
|
|
527
992
|
),
|