@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,844 +1,908 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React3 from 'react';
|
|
3
|
+
import React3__default, { useMemo } from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { cva } from 'class-variance-authority';
|
|
7
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
6
|
import { Icon } from '@page-speed/icon';
|
|
7
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
8
|
import { Img } from '@page-speed/img';
|
|
9
|
+
import { cva } from 'class-variance-authority';
|
|
10
10
|
import { Slot } from '@radix-ui/react-slot';
|
|
11
11
|
|
|
12
12
|
// components/blocks/hero/hero-ecommerce-product-showcase.tsx
|
|
13
13
|
function cn(...inputs) {
|
|
14
14
|
return twMerge(clsx(inputs));
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return trimmed;
|
|
20
|
-
}
|
|
21
|
-
const match = trimmed.match(/^[\s\+\-\(\)]*(\d[\d\s\-\(\)\.]*\d)[\s\-]*(x|ext\.?|extension)?[\s\-]*(\d+)?$/i);
|
|
22
|
-
if (match) {
|
|
23
|
-
const mainNumber = match[1].replace(/[\s\-\(\)\.]/g, "");
|
|
24
|
-
const extension = match[3];
|
|
25
|
-
const normalized = mainNumber.length >= 10 && !trimmed.startsWith("+") ? `+${mainNumber}` : mainNumber;
|
|
26
|
-
const withExtension = extension ? `${normalized};ext=${extension}` : normalized;
|
|
27
|
-
return `tel:${withExtension}`;
|
|
28
|
-
}
|
|
29
|
-
const cleaned = trimmed.replace(/[\s\-\(\)\.]/g, "");
|
|
30
|
-
return `tel:${cleaned}`;
|
|
31
|
-
}
|
|
32
|
-
function normalizeEmail(input) {
|
|
33
|
-
const trimmed = input.trim();
|
|
34
|
-
if (trimmed.toLowerCase().startsWith("mailto:")) {
|
|
35
|
-
return trimmed;
|
|
36
|
-
}
|
|
37
|
-
return `mailto:${trimmed}`;
|
|
38
|
-
}
|
|
39
|
-
function isEmail(input) {
|
|
40
|
-
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
41
|
-
return emailRegex.test(input.trim());
|
|
42
|
-
}
|
|
43
|
-
function isPhoneNumber(input) {
|
|
44
|
-
const trimmed = input.trim();
|
|
45
|
-
if (trimmed.toLowerCase().startsWith("tel:")) {
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
const phoneRegex = /^[\s\+\-\(\)]*\d[\d\s\-\(\)\.]*\d[\s\-]*(x|ext\.?|extension)?[\s\-]*\d*$/i;
|
|
49
|
-
return phoneRegex.test(trimmed);
|
|
16
|
+
var DEFAULT_ICON_API_KEY = "au382bi7fsh96w9h9xlrnat2jglx";
|
|
17
|
+
function DynamicIcon({ apiKey, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(Icon, { ...props, apiKey: apiKey ?? DEFAULT_ICON_API_KEY });
|
|
50
19
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
20
|
+
var maxWidthStyles = {
|
|
21
|
+
sm: "max-w-screen-sm",
|
|
22
|
+
md: "max-w-screen-md",
|
|
23
|
+
lg: "max-w-screen-lg",
|
|
24
|
+
xl: "max-w-7xl",
|
|
25
|
+
"2xl": "max-w-screen-2xl",
|
|
26
|
+
"4xl": "max-w-[1536px]",
|
|
27
|
+
full: "max-w-full"
|
|
28
|
+
};
|
|
29
|
+
var Container = React3__default.forwardRef(
|
|
30
|
+
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
31
|
+
const Component = as;
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
Component,
|
|
34
|
+
{
|
|
35
|
+
ref,
|
|
36
|
+
className: cn(
|
|
37
|
+
"mx-auto w-full px-2 sm:px-4 lg:px-8",
|
|
38
|
+
maxWidthStyles[maxWidth],
|
|
39
|
+
className
|
|
40
|
+
),
|
|
41
|
+
...props,
|
|
42
|
+
children
|
|
43
|
+
}
|
|
44
|
+
);
|
|
58
45
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
46
|
+
);
|
|
47
|
+
Container.displayName = "Container";
|
|
48
|
+
|
|
49
|
+
// lib/patternSvgs.ts
|
|
50
|
+
var patternSvgs = {
|
|
51
|
+
squareAltGrid: "https://cdn.ing/assets/files/record/286187/4gpn0yq2ptra8iwlvmwwv860ggwv",
|
|
52
|
+
grid1: "https://cdn.ing/assets/files/record/286186/nbdflpgp4ostrno079hygibsflp3",
|
|
53
|
+
noise: "https://cdn.ing/assets/i/r/286188/zrqcp9hynh3j7p2laihwzfbujgrl/noise.png",
|
|
54
|
+
dots: "https://cdn.ing/assets/files/record/286198/yfsjx9thvtxzhl2qtshxyhkrm524",
|
|
55
|
+
dotPattern: "https://cdn.ing/assets/files/record/286192/7ig0cku8aqbboiza8nuk6hw0nnsr",
|
|
56
|
+
dotPattern2: "https://cdn.ing/assets/files/record/286189/arez6gd2s7isn9i1o6c7sexdq7bl",
|
|
57
|
+
circles: "https://cdn.ing/assets/files/record/286190/gtmia3sncjtzetdshc20zf1d3c17",
|
|
58
|
+
waves: "https://cdn.ing/assets/files/record/286191/mqlb33fzxz9cdth1bx7if0wmpkp1",
|
|
59
|
+
crossPattern: "https://cdn.ing/assets/files/record/286193/9yfqwdbnqaipbp7fsb3wbzzmq472",
|
|
60
|
+
architect: "https://cdn.ing/assets/files/record/286194/vgs88ugpvyhxu13wqgy0acvae6re",
|
|
61
|
+
tinyCheckers: "https://cdn.ing/assets/files/record/286195/65efaknsw8kcpf9o3c2gybytsl5b",
|
|
62
|
+
p6: "https://cdn.ing/assets/i/r/286196/6kl0rqnd6mjk8j7e525fo8fo0vkc/p6.webp"
|
|
63
|
+
};
|
|
64
|
+
var maskTop = "radial-gradient(ellipse 70% 60% at 50% 0%, #000 60%, transparent 100%)";
|
|
65
|
+
var maskBottom = "radial-gradient(ellipse 100% 80% at 50% 100%, #000 50%, transparent 90%)";
|
|
66
|
+
var maskCenter = "radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 70%)";
|
|
67
|
+
var maskTopLeft = "radial-gradient(ellipse 80% 80% at 0% 0%, #000 50%, transparent 90%)";
|
|
68
|
+
var maskTopRight = "radial-gradient(ellipse 80% 80% at 100% 0%, #000 50%, transparent 90%)";
|
|
69
|
+
var maskBottomLeft = "radial-gradient(ellipse 80% 80% at 0% 100%, #000 50%, transparent 90%)";
|
|
70
|
+
var maskBottomRight = "radial-gradient(ellipse 80% 80% at 100% 100%, #000 50%, transparent 90%)";
|
|
71
|
+
var circuitBoardPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
72
|
+
"svg",
|
|
73
|
+
{
|
|
74
|
+
className: "h-full w-full",
|
|
75
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
76
|
+
style: mask ? {
|
|
77
|
+
maskImage: mask,
|
|
78
|
+
WebkitMaskImage: mask
|
|
79
|
+
} : void 0,
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
82
|
+
"pattern",
|
|
83
|
+
{
|
|
84
|
+
id,
|
|
85
|
+
x: "0",
|
|
86
|
+
y: "0",
|
|
87
|
+
width: "100",
|
|
88
|
+
height: "100",
|
|
89
|
+
patternUnits: "userSpaceOnUse",
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
"path",
|
|
93
|
+
{
|
|
94
|
+
d: "M0 50h40M60 50h40M50 0v40M50 60v40",
|
|
95
|
+
stroke: "hsl(var(--muted))",
|
|
96
|
+
strokeWidth: "1",
|
|
97
|
+
fill: "none"
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "3", fill: "hsl(var(--muted))" }),
|
|
101
|
+
/* @__PURE__ */ jsx("circle", { cx: "0", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
102
|
+
/* @__PURE__ */ jsx("circle", { cx: "100", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
103
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "0", r: "2", fill: "hsl(var(--muted))" }),
|
|
104
|
+
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "100", r: "2", fill: "hsl(var(--muted))" })
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
) }),
|
|
108
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
109
|
+
]
|
|
66
110
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
111
|
+
);
|
|
112
|
+
var gridDotsPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
113
|
+
"svg",
|
|
114
|
+
{
|
|
115
|
+
className: "h-full w-full",
|
|
116
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
117
|
+
style: mask ? {
|
|
118
|
+
maskImage: mask,
|
|
119
|
+
WebkitMaskImage: mask
|
|
120
|
+
} : void 0,
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
123
|
+
"pattern",
|
|
124
|
+
{
|
|
125
|
+
id,
|
|
126
|
+
x: "0",
|
|
127
|
+
y: "0",
|
|
128
|
+
width: "40",
|
|
129
|
+
height: "40",
|
|
130
|
+
patternUnits: "userSpaceOnUse",
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
"path",
|
|
134
|
+
{
|
|
135
|
+
d: "M0 20h40M20 0v40",
|
|
136
|
+
stroke: "hsl(var(--muted))",
|
|
137
|
+
strokeWidth: "0.5",
|
|
138
|
+
fill: "none"
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ jsx("circle", { cx: "20", cy: "20", r: "2", fill: "hsl(var(--muted))" })
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
) }),
|
|
145
|
+
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
146
|
+
]
|
|
71
147
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
148
|
+
);
|
|
149
|
+
var gridPattern = (size, mask) => /* @__PURE__ */ jsx(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
className: "h-full w-full bg-[linear-gradient(to_right,_hsl(var(--muted))_1px,_transparent_1px),linear-gradient(to_bottom,_hsl(var(--muted))_1px,_transparent_1px)]",
|
|
153
|
+
style: {
|
|
154
|
+
backgroundSize: `${size}px ${size}px`,
|
|
155
|
+
...mask ? {
|
|
156
|
+
maskImage: mask,
|
|
157
|
+
WebkitMaskImage: mask
|
|
158
|
+
} : {}
|
|
159
|
+
}
|
|
75
160
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
161
|
+
);
|
|
162
|
+
var diagonalCrossPattern = (mask) => /* @__PURE__ */ jsx(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
className: "h-full w-full",
|
|
166
|
+
style: {
|
|
167
|
+
backgroundImage: "repeating-linear-gradient(45deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px), repeating-linear-gradient(135deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px)",
|
|
168
|
+
...mask ? {
|
|
169
|
+
maskImage: mask,
|
|
170
|
+
WebkitMaskImage: mask
|
|
171
|
+
} : {}
|
|
82
172
|
}
|
|
83
|
-
} catch {
|
|
84
173
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
174
|
+
);
|
|
175
|
+
var dashedGridMaskBase = "repeating-linear-gradient(to right, black 0px, black 3px, transparent 3px, transparent 8px), repeating-linear-gradient(to bottom, black 0px, black 3px, transparent 3px, transparent 8px)";
|
|
176
|
+
var dashedGridPattern = (fadeMask) => {
|
|
177
|
+
const mask = fadeMask ? `${dashedGridMaskBase}, ${fadeMask}` : dashedGridMaskBase;
|
|
178
|
+
return /* @__PURE__ */ jsx(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
className: "h-full w-full",
|
|
182
|
+
style: {
|
|
183
|
+
backgroundImage: "linear-gradient(to right, hsl(var(--muted)) 1px, transparent 1px), linear-gradient(to bottom, hsl(var(--muted)) 1px, transparent 1px)",
|
|
184
|
+
backgroundSize: "20px 20px",
|
|
185
|
+
backgroundPosition: "0 0, 0 0",
|
|
186
|
+
maskImage: mask,
|
|
187
|
+
WebkitMaskImage: mask,
|
|
188
|
+
maskComposite: "intersect",
|
|
189
|
+
WebkitMaskComposite: "source-in"
|
|
190
|
+
}
|
|
94
191
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
192
|
+
);
|
|
193
|
+
};
|
|
194
|
+
var gradientGlow = (position) => /* @__PURE__ */ jsx(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
className: cn(
|
|
198
|
+
"pointer-events-none absolute left-1/2 z-0 aspect-square w-3/4 -translate-x-1/2 rounded-full opacity-50 blur-3xl",
|
|
199
|
+
position === "top" ? "-top-1/4" : "-bottom-1/4"
|
|
200
|
+
),
|
|
201
|
+
style: {
|
|
202
|
+
background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
|
|
98
203
|
}
|
|
99
|
-
if (trimmed.toLowerCase().startsWith("tel:") || isPhoneNumber(trimmed)) {
|
|
100
|
-
return "tel";
|
|
101
|
-
}
|
|
102
|
-
if (isInternalUrl(trimmed)) {
|
|
103
|
-
return "internal";
|
|
104
|
-
}
|
|
105
|
-
try {
|
|
106
|
-
new URL(trimmed, typeof window !== "undefined" ? window.location.href : "http://localhost");
|
|
107
|
-
return "external";
|
|
108
|
-
} catch {
|
|
109
|
-
return "internal";
|
|
110
|
-
}
|
|
111
|
-
}, [href, onClick]);
|
|
112
|
-
const normalizedHref = React.useMemo(() => {
|
|
113
|
-
if (!href || href.trim() === "") {
|
|
114
|
-
return void 0;
|
|
115
|
-
}
|
|
116
|
-
const trimmed = href.trim();
|
|
117
|
-
switch (linkType) {
|
|
118
|
-
case "tel":
|
|
119
|
-
return normalizePhoneNumber(trimmed);
|
|
120
|
-
case "mailto":
|
|
121
|
-
return normalizeEmail(trimmed);
|
|
122
|
-
case "internal":
|
|
123
|
-
return toRelativePath(trimmed);
|
|
124
|
-
case "external":
|
|
125
|
-
return trimmed;
|
|
126
|
-
default:
|
|
127
|
-
return trimmed;
|
|
128
|
-
}
|
|
129
|
-
}, [href, linkType]);
|
|
130
|
-
const target = React.useMemo(() => {
|
|
131
|
-
switch (linkType) {
|
|
132
|
-
case "external":
|
|
133
|
-
return "_blank";
|
|
134
|
-
case "internal":
|
|
135
|
-
return "_self";
|
|
136
|
-
case "mailto":
|
|
137
|
-
case "tel":
|
|
138
|
-
return void 0;
|
|
139
|
-
default:
|
|
140
|
-
return void 0;
|
|
141
|
-
}
|
|
142
|
-
}, [linkType]);
|
|
143
|
-
const rel = React.useMemo(() => {
|
|
144
|
-
if (linkType === "external") {
|
|
145
|
-
return "noopener noreferrer";
|
|
146
|
-
}
|
|
147
|
-
return void 0;
|
|
148
|
-
}, [linkType]);
|
|
149
|
-
const isExternal = linkType === "external";
|
|
150
|
-
const isInternal = linkType === "internal";
|
|
151
|
-
const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
|
|
152
|
-
const handleClick = React.useCallback(
|
|
153
|
-
(event) => {
|
|
154
|
-
if (onClick) {
|
|
155
|
-
try {
|
|
156
|
-
onClick(event);
|
|
157
|
-
} catch (error) {
|
|
158
|
-
console.error("Error in user onClick handler:", error);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (event.defaultPrevented) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
if (shouldUseRouter && normalizedHref && event.button === 0 && // left-click only
|
|
165
|
-
!event.metaKey && !event.altKey && !event.ctrlKey && !event.shiftKey) {
|
|
166
|
-
if (typeof window !== "undefined") {
|
|
167
|
-
const handler = window.__opensiteNavigationHandler;
|
|
168
|
-
if (typeof handler === "function") {
|
|
169
|
-
try {
|
|
170
|
-
const handled = handler(normalizedHref, event.nativeEvent || event);
|
|
171
|
-
if (handled !== false) {
|
|
172
|
-
event.preventDefault();
|
|
173
|
-
}
|
|
174
|
-
} catch (error) {
|
|
175
|
-
console.error("Error in navigation handler:", error);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
[onClick, shouldUseRouter, normalizedHref]
|
|
182
|
-
);
|
|
183
|
-
return {
|
|
184
|
-
linkType,
|
|
185
|
-
normalizedHref,
|
|
186
|
-
target,
|
|
187
|
-
rel,
|
|
188
|
-
isExternal,
|
|
189
|
-
isInternal,
|
|
190
|
-
shouldUseRouter,
|
|
191
|
-
handleClick
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
var baseStyles = [
|
|
195
|
-
// Layout
|
|
196
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap shrink-0",
|
|
197
|
-
// Typography - using CSS variables with sensible defaults
|
|
198
|
-
"font-[var(--button-font-family,inherit)]",
|
|
199
|
-
"font-[var(--button-font-weight,500)]",
|
|
200
|
-
"tracking-[var(--button-letter-spacing,0)]",
|
|
201
|
-
"leading-[var(--button-line-height,1.25)]",
|
|
202
|
-
"[text-transform:var(--button-text-transform,none)]",
|
|
203
|
-
"text-sm",
|
|
204
|
-
// Border radius
|
|
205
|
-
"rounded-[var(--button-radius,var(--radius,0.375rem))]",
|
|
206
|
-
// Smooth transition - using [transition:...] to set full shorthand property (not just transition-property)
|
|
207
|
-
"[transition:var(--button-transition,all_250ms_cubic-bezier(0.4,0,0.2,1))]",
|
|
208
|
-
// Box shadow (master level) - using [box-shadow:...] for complex multi-value shadows
|
|
209
|
-
"[box-shadow:var(--button-shadow,none)]",
|
|
210
|
-
"hover:[box-shadow:var(--button-shadow-hover,var(--button-shadow,none))]",
|
|
211
|
-
// Disabled state
|
|
212
|
-
"disabled:pointer-events-none disabled:opacity-50",
|
|
213
|
-
// SVG handling
|
|
214
|
-
"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
|
|
215
|
-
// Focus styles
|
|
216
|
-
"outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
217
|
-
// Invalid state
|
|
218
|
-
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
|
|
219
|
-
].join(" ");
|
|
220
|
-
var buttonVariants = cva(baseStyles, {
|
|
221
|
-
variants: {
|
|
222
|
-
variant: {
|
|
223
|
-
// Default (Primary) variant - full customization
|
|
224
|
-
default: [
|
|
225
|
-
"bg-[var(--button-default-bg,hsl(var(--primary)))]",
|
|
226
|
-
"text-[var(--button-default-fg,hsl(var(--primary-foreground)))]",
|
|
227
|
-
"border-[length:var(--button-default-border-width,0px)]",
|
|
228
|
-
"border-[color:var(--button-default-border,transparent)]",
|
|
229
|
-
"[box-shadow:var(--button-default-shadow,var(--button-shadow,none))]",
|
|
230
|
-
"hover:bg-[var(--button-default-hover-bg,hsl(var(--primary)/0.9))]",
|
|
231
|
-
"hover:text-[var(--button-default-hover-fg,var(--button-default-fg,hsl(var(--primary-foreground))))]",
|
|
232
|
-
"hover:border-[color:var(--button-default-hover-border,var(--button-default-border,transparent))]",
|
|
233
|
-
"hover:[box-shadow:var(--button-default-shadow-hover,var(--button-shadow-hover,var(--button-default-shadow,var(--button-shadow,none))))]"
|
|
234
|
-
].join(" "),
|
|
235
|
-
// Destructive variant - full customization
|
|
236
|
-
destructive: [
|
|
237
|
-
"bg-[var(--button-destructive-bg,hsl(var(--destructive)))]",
|
|
238
|
-
"text-[var(--button-destructive-fg,white)]",
|
|
239
|
-
"border-[length:var(--button-destructive-border-width,0px)]",
|
|
240
|
-
"border-[color:var(--button-destructive-border,transparent)]",
|
|
241
|
-
"[box-shadow:var(--button-destructive-shadow,var(--button-shadow,none))]",
|
|
242
|
-
"hover:bg-[var(--button-destructive-hover-bg,hsl(var(--destructive)/0.9))]",
|
|
243
|
-
"hover:text-[var(--button-destructive-hover-fg,var(--button-destructive-fg,white))]",
|
|
244
|
-
"hover:border-[color:var(--button-destructive-hover-border,var(--button-destructive-border,transparent))]",
|
|
245
|
-
"hover:[box-shadow:var(--button-destructive-shadow-hover,var(--button-shadow-hover,var(--button-destructive-shadow,var(--button-shadow,none))))]",
|
|
246
|
-
"focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
247
|
-
"dark:bg-destructive/60"
|
|
248
|
-
].join(" "),
|
|
249
|
-
// Outline variant - full customization with proper border handling
|
|
250
|
-
outline: [
|
|
251
|
-
"bg-[var(--button-outline-bg,hsl(var(--background)))]",
|
|
252
|
-
"text-[var(--button-outline-fg,inherit)]",
|
|
253
|
-
"border-[length:var(--button-outline-border-width,1px)]",
|
|
254
|
-
"border-[color:var(--button-outline-border,hsl(var(--border)))]",
|
|
255
|
-
"[box-shadow:var(--button-outline-shadow,var(--button-shadow,0_1px_2px_0_rgb(0_0_0/0.05)))]",
|
|
256
|
-
"hover:bg-[var(--button-outline-hover-bg,hsl(var(--accent)))]",
|
|
257
|
-
"hover:text-[var(--button-outline-hover-fg,hsl(var(--accent-foreground)))]",
|
|
258
|
-
"hover:border-[color:var(--button-outline-hover-border,var(--button-outline-border,hsl(var(--border))))]",
|
|
259
|
-
"hover:[box-shadow:var(--button-outline-shadow-hover,var(--button-shadow-hover,var(--button-outline-shadow,var(--button-shadow,none))))]",
|
|
260
|
-
"dark:bg-input/30 dark:border-input dark:hover:bg-input/50"
|
|
261
|
-
].join(" "),
|
|
262
|
-
// Secondary variant - full customization
|
|
263
|
-
secondary: [
|
|
264
|
-
"bg-[var(--button-secondary-bg,hsl(var(--secondary)))]",
|
|
265
|
-
"text-[var(--button-secondary-fg,hsl(var(--secondary-foreground)))]",
|
|
266
|
-
"border-[length:var(--button-secondary-border-width,0px)]",
|
|
267
|
-
"border-[color:var(--button-secondary-border,transparent)]",
|
|
268
|
-
"[box-shadow:var(--button-secondary-shadow,var(--button-shadow,none))]",
|
|
269
|
-
"hover:bg-[var(--button-secondary-hover-bg,hsl(var(--secondary)/0.8))]",
|
|
270
|
-
"hover:text-[var(--button-secondary-hover-fg,var(--button-secondary-fg,hsl(var(--secondary-foreground))))]",
|
|
271
|
-
"hover:border-[color:var(--button-secondary-hover-border,var(--button-secondary-border,transparent))]",
|
|
272
|
-
"hover:[box-shadow:var(--button-secondary-shadow-hover,var(--button-shadow-hover,var(--button-secondary-shadow,var(--button-shadow,none))))]"
|
|
273
|
-
].join(" "),
|
|
274
|
-
// Ghost variant - full customization
|
|
275
|
-
ghost: [
|
|
276
|
-
"bg-[var(--button-ghost-bg,transparent)]",
|
|
277
|
-
"text-[var(--button-ghost-fg,inherit)]",
|
|
278
|
-
"border-[length:var(--button-ghost-border-width,0px)]",
|
|
279
|
-
"border-[color:var(--button-ghost-border,transparent)]",
|
|
280
|
-
"[box-shadow:var(--button-ghost-shadow,var(--button-shadow,none))]",
|
|
281
|
-
"hover:bg-[var(--button-ghost-hover-bg,hsl(var(--accent)))]",
|
|
282
|
-
"hover:text-[var(--button-ghost-hover-fg,hsl(var(--accent-foreground)))]",
|
|
283
|
-
"hover:border-[color:var(--button-ghost-hover-border,var(--button-ghost-border,transparent))]",
|
|
284
|
-
"hover:[box-shadow:var(--button-ghost-shadow-hover,var(--button-shadow-hover,var(--button-ghost-shadow,var(--button-shadow,none))))]",
|
|
285
|
-
"dark:hover:bg-accent/50"
|
|
286
|
-
].join(" "),
|
|
287
|
-
// Link variant - full customization
|
|
288
|
-
link: [
|
|
289
|
-
"bg-[var(--button-link-bg,transparent)]",
|
|
290
|
-
"text-[var(--button-link-fg,hsl(var(--primary)))]",
|
|
291
|
-
"border-[length:var(--button-link-border-width,0px)]",
|
|
292
|
-
"border-[color:var(--button-link-border,transparent)]",
|
|
293
|
-
"[box-shadow:var(--button-link-shadow,none)]",
|
|
294
|
-
"hover:bg-[var(--button-link-hover-bg,transparent)]",
|
|
295
|
-
"hover:text-[var(--button-link-hover-fg,var(--button-link-fg,hsl(var(--primary))))]",
|
|
296
|
-
"hover:[box-shadow:var(--button-link-shadow-hover,none)]",
|
|
297
|
-
"underline-offset-4 hover:underline"
|
|
298
|
-
].join(" ")
|
|
299
|
-
},
|
|
300
|
-
size: {
|
|
301
|
-
default: [
|
|
302
|
-
"h-[var(--button-height-md,2.25rem)]",
|
|
303
|
-
"px-[var(--button-padding-x-md,1rem)]",
|
|
304
|
-
"py-[var(--button-padding-y-md,0.5rem)]",
|
|
305
|
-
"has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
|
|
306
|
-
].join(" "),
|
|
307
|
-
sm: [
|
|
308
|
-
"h-[var(--button-height-sm,2rem)]",
|
|
309
|
-
"px-[var(--button-padding-x-sm,0.75rem)]",
|
|
310
|
-
"py-[var(--button-padding-y-sm,0.25rem)]",
|
|
311
|
-
"gap-1.5",
|
|
312
|
-
"has-[>svg]:px-[calc(var(--button-padding-x-sm,0.75rem)*0.83)]"
|
|
313
|
-
].join(" "),
|
|
314
|
-
md: [
|
|
315
|
-
"h-[var(--button-height-md,2.25rem)]",
|
|
316
|
-
"px-[var(--button-padding-x-md,1rem)]",
|
|
317
|
-
"py-[var(--button-padding-y-md,0.5rem)]",
|
|
318
|
-
"has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
|
|
319
|
-
].join(" "),
|
|
320
|
-
lg: [
|
|
321
|
-
"h-[var(--button-height-lg,2.5rem)]",
|
|
322
|
-
"px-[var(--button-padding-x-lg,1.5rem)]",
|
|
323
|
-
"py-[var(--button-padding-y-lg,0.5rem)]",
|
|
324
|
-
"has-[>svg]:px-[calc(var(--button-padding-x-lg,1.5rem)*0.67)]"
|
|
325
|
-
].join(" "),
|
|
326
|
-
icon: "size-[var(--button-height-md,2.25rem)]",
|
|
327
|
-
"icon-sm": "size-[var(--button-height-sm,2rem)]",
|
|
328
|
-
"icon-lg": "size-[var(--button-height-lg,2.5rem)]"
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
defaultVariants: {
|
|
332
|
-
variant: "default",
|
|
333
|
-
size: "default"
|
|
334
204
|
}
|
|
335
|
-
|
|
336
|
-
var
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
className
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
fallbackComponentType = "span",
|
|
346
|
-
componentType,
|
|
347
|
-
"aria-label": ariaLabel,
|
|
348
|
-
"aria-describedby": ariaDescribedby,
|
|
349
|
-
id,
|
|
350
|
-
...props
|
|
351
|
-
}, ref) => {
|
|
352
|
-
const navigation = useNavigation({ href, onClick });
|
|
353
|
-
const {
|
|
354
|
-
normalizedHref,
|
|
355
|
-
target,
|
|
356
|
-
rel,
|
|
357
|
-
linkType,
|
|
358
|
-
isInternal,
|
|
359
|
-
handleClick
|
|
360
|
-
} = navigation;
|
|
361
|
-
const shouldRenderLink = normalizedHref && linkType !== "none";
|
|
362
|
-
const shouldRenderButton = !shouldRenderLink && onClick;
|
|
363
|
-
const effectiveComponentType = componentType || (shouldRenderLink ? "a" : shouldRenderButton ? "button" : fallbackComponentType);
|
|
364
|
-
const finalComponentType = isInternal && shouldRenderLink ? "a" : effectiveComponentType;
|
|
365
|
-
const shouldApplyButtonStyles = asButton || variant || size;
|
|
366
|
-
const combinedClassName = cn(
|
|
367
|
-
shouldApplyButtonStyles && buttonVariants({ variant, size }),
|
|
368
|
-
className
|
|
369
|
-
);
|
|
370
|
-
const dataProps = Object.fromEntries(
|
|
371
|
-
Object.entries(props).filter(([key]) => key.startsWith("data-"))
|
|
372
|
-
);
|
|
373
|
-
const buttonDataAttributes = shouldApplyButtonStyles ? {
|
|
374
|
-
"data-slot": "button",
|
|
375
|
-
"data-variant": variant ?? "default",
|
|
376
|
-
"data-size": size ?? "default"
|
|
377
|
-
} : {};
|
|
378
|
-
const commonProps = {
|
|
379
|
-
className: combinedClassName,
|
|
380
|
-
onClick: handleClick,
|
|
381
|
-
"aria-label": ariaLabel,
|
|
382
|
-
"aria-describedby": ariaDescribedby,
|
|
383
|
-
id,
|
|
384
|
-
...dataProps,
|
|
385
|
-
...buttonDataAttributes
|
|
386
|
-
};
|
|
387
|
-
if (finalComponentType === "a" && shouldRenderLink) {
|
|
388
|
-
return /* @__PURE__ */ jsx(
|
|
389
|
-
"a",
|
|
390
|
-
{
|
|
391
|
-
ref,
|
|
392
|
-
href: normalizedHref,
|
|
393
|
-
target,
|
|
394
|
-
rel,
|
|
395
|
-
...commonProps,
|
|
396
|
-
...props,
|
|
397
|
-
children
|
|
398
|
-
}
|
|
399
|
-
);
|
|
400
|
-
}
|
|
401
|
-
if (finalComponentType === "button") {
|
|
402
|
-
return /* @__PURE__ */ jsx(
|
|
403
|
-
"button",
|
|
404
|
-
{
|
|
405
|
-
ref,
|
|
406
|
-
type: props.type || "button",
|
|
407
|
-
...commonProps,
|
|
408
|
-
...props,
|
|
409
|
-
children
|
|
410
|
-
}
|
|
411
|
-
);
|
|
412
|
-
}
|
|
413
|
-
if (finalComponentType === "div") {
|
|
414
|
-
return /* @__PURE__ */ jsx(
|
|
415
|
-
"div",
|
|
416
|
-
{
|
|
417
|
-
ref,
|
|
418
|
-
...commonProps,
|
|
419
|
-
children
|
|
420
|
-
}
|
|
421
|
-
);
|
|
205
|
+
);
|
|
206
|
+
var spotlight = (position) => /* @__PURE__ */ jsx(
|
|
207
|
+
"div",
|
|
208
|
+
{
|
|
209
|
+
className: cn(
|
|
210
|
+
"pointer-events-none absolute top-1/2 z-0 aspect-square w-3/4 -translate-y-1/2 rounded-full opacity-40 blur-3xl",
|
|
211
|
+
position === "left" ? "-left-1/4" : "-right-1/4"
|
|
212
|
+
),
|
|
213
|
+
style: {
|
|
214
|
+
background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
|
|
422
215
|
}
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
var patternOverlays = {
|
|
219
|
+
circuitBoardBasic: () => circuitBoardPattern("circuit-board-basic"),
|
|
220
|
+
circuitBoardFadeTop: () => circuitBoardPattern("circuit-board-fade-top", maskTop),
|
|
221
|
+
circuitBoardFadeBottom: () => circuitBoardPattern("circuit-board-fade-bottom", maskBottom),
|
|
222
|
+
circuitBoardFadeCenter: () => circuitBoardPattern("circuit-board-fade-center", maskCenter),
|
|
223
|
+
circuitBoardFadeTopLeft: () => circuitBoardPattern("circuit-board-fade-top-left", maskTopLeft),
|
|
224
|
+
circuitBoardFadeTopRight: () => circuitBoardPattern("circuit-board-fade-top-right", maskTopRight),
|
|
225
|
+
circuitBoardFadeBottomLeft: () => circuitBoardPattern("circuit-board-fade-bottom-left", maskBottomLeft),
|
|
226
|
+
circuitBoardFadeBottomRight: () => circuitBoardPattern("circuit-board-fade-bottom-right", maskBottomRight),
|
|
227
|
+
dashedGridBasic: () => dashedGridPattern(),
|
|
228
|
+
dashedGridFadeTop: () => dashedGridPattern(maskTop),
|
|
229
|
+
dashedGridFadeBottom: () => dashedGridPattern(maskBottom),
|
|
230
|
+
dashedGridFadeCenter: () => dashedGridPattern(maskCenter),
|
|
231
|
+
dashedGridFadeTopLeft: () => dashedGridPattern(maskTopLeft),
|
|
232
|
+
dashedGridFadeTopRight: () => dashedGridPattern(maskTopRight),
|
|
233
|
+
dashedGridFadeBottomLeft: () => dashedGridPattern(maskBottomLeft),
|
|
234
|
+
dashedGridFadeBottomRight: () => dashedGridPattern(maskBottomRight),
|
|
235
|
+
diagonalCrossBasic: () => diagonalCrossPattern(),
|
|
236
|
+
diagonalCrossFadeTop: () => diagonalCrossPattern(maskTop),
|
|
237
|
+
diagonalCrossFadeBottom: () => diagonalCrossPattern(maskBottom),
|
|
238
|
+
diagonalCrossFadeCenter: () => diagonalCrossPattern(maskCenter),
|
|
239
|
+
diagonalCrossFadeTopLeft: () => diagonalCrossPattern(maskTopLeft),
|
|
240
|
+
diagonalCrossFadeTopRight: () => diagonalCrossPattern(maskTopRight),
|
|
241
|
+
diagonalCrossFadeBottomLeft: () => diagonalCrossPattern(maskBottomLeft),
|
|
242
|
+
diagonalCrossFadeBottomRight: () => diagonalCrossPattern(maskBottomRight),
|
|
243
|
+
gridBasic: () => gridPattern(40),
|
|
244
|
+
gridFadeTop: () => gridPattern(32, maskTop),
|
|
245
|
+
gridFadeBottom: () => gridPattern(32, maskBottom),
|
|
246
|
+
gridFadeCenter: () => gridPattern(40, maskCenter),
|
|
247
|
+
gridFadeTopLeft: () => gridPattern(32, maskTopLeft),
|
|
248
|
+
gridFadeTopRight: () => gridPattern(32, maskTopRight),
|
|
249
|
+
gridFadeBottomLeft: () => gridPattern(32, maskBottomLeft),
|
|
250
|
+
gridFadeBottomRight: () => gridPattern(32, maskBottomRight),
|
|
251
|
+
gridDotsBasic: () => gridDotsPattern("grid-dots-basic"),
|
|
252
|
+
gridDotsFadeCenter: () => gridDotsPattern("grid-dots-fade-center", maskCenter),
|
|
253
|
+
gradientGlowTop: () => gradientGlow("top"),
|
|
254
|
+
gradientGlowBottom: () => gradientGlow("bottom"),
|
|
255
|
+
spotlightLeft: () => spotlight("left"),
|
|
256
|
+
spotlightRight: () => spotlight("right")
|
|
257
|
+
};
|
|
258
|
+
var inlinePatternStyles = {
|
|
259
|
+
radialGradientTop: {
|
|
260
|
+
background: "radial-gradient(125% 125% at 50% 10%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
261
|
+
},
|
|
262
|
+
radialGradientBottom: {
|
|
263
|
+
background: "radial-gradient(125% 125% at 50% 90%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
function PatternBackground({
|
|
267
|
+
pattern,
|
|
268
|
+
opacity = 0.08,
|
|
269
|
+
className,
|
|
270
|
+
style
|
|
271
|
+
}) {
|
|
272
|
+
if (!pattern) {
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
if (pattern in inlinePatternStyles) {
|
|
276
|
+
const inlineStyle = inlinePatternStyles[pattern];
|
|
423
277
|
return /* @__PURE__ */ jsx(
|
|
424
|
-
"
|
|
278
|
+
"div",
|
|
425
279
|
{
|
|
426
|
-
|
|
427
|
-
...
|
|
428
|
-
|
|
280
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
281
|
+
style: { ...inlineStyle, opacity, ...style },
|
|
282
|
+
"aria-hidden": "true"
|
|
429
283
|
}
|
|
430
284
|
);
|
|
431
285
|
}
|
|
432
|
-
)
|
|
433
|
-
|
|
434
|
-
var DEFAULT_ICON_API_KEY = "au382bi7fsh96w9h9xlrnat2jglx";
|
|
435
|
-
function DynamicIcon({ apiKey, ...props }) {
|
|
436
|
-
return /* @__PURE__ */ jsx(Icon, { ...props, apiKey: apiKey ?? DEFAULT_ICON_API_KEY });
|
|
437
|
-
}
|
|
438
|
-
var maxWidthStyles = {
|
|
439
|
-
sm: "max-w-screen-sm",
|
|
440
|
-
md: "max-w-screen-md",
|
|
441
|
-
lg: "max-w-screen-lg",
|
|
442
|
-
xl: "max-w-7xl",
|
|
443
|
-
"2xl": "max-w-screen-2xl",
|
|
444
|
-
"4xl": "max-w-[1536px]",
|
|
445
|
-
full: "max-w-full"
|
|
446
|
-
};
|
|
447
|
-
var Container = React__default.forwardRef(
|
|
448
|
-
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
449
|
-
const Component = as;
|
|
286
|
+
if (pattern in patternOverlays) {
|
|
287
|
+
const Overlay = patternOverlays[pattern];
|
|
450
288
|
return /* @__PURE__ */ jsx(
|
|
451
|
-
|
|
289
|
+
"div",
|
|
452
290
|
{
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
className
|
|
458
|
-
),
|
|
459
|
-
...props,
|
|
460
|
-
children
|
|
291
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
292
|
+
style: { opacity, ...style },
|
|
293
|
+
"aria-hidden": "true",
|
|
294
|
+
children: Overlay()
|
|
461
295
|
}
|
|
462
296
|
);
|
|
463
297
|
}
|
|
464
|
-
|
|
465
|
-
Container.displayName = "Container";
|
|
466
|
-
|
|
467
|
-
// lib/patternSvgs.ts
|
|
468
|
-
var patternSvgs = {
|
|
469
|
-
squareAltGrid: "https://cdn.ing/assets/files/record/286187/4gpn0yq2ptra8iwlvmwwv860ggwv",
|
|
470
|
-
grid1: "https://cdn.ing/assets/files/record/286186/nbdflpgp4ostrno079hygibsflp3",
|
|
471
|
-
noise: "https://cdn.ing/assets/i/r/286188/zrqcp9hynh3j7p2laihwzfbujgrl/noise.png",
|
|
472
|
-
dots: "https://cdn.ing/assets/files/record/286198/yfsjx9thvtxzhl2qtshxyhkrm524",
|
|
473
|
-
dotPattern: "https://cdn.ing/assets/files/record/286192/7ig0cku8aqbboiza8nuk6hw0nnsr",
|
|
474
|
-
dotPattern2: "https://cdn.ing/assets/files/record/286189/arez6gd2s7isn9i1o6c7sexdq7bl",
|
|
475
|
-
circles: "https://cdn.ing/assets/files/record/286190/gtmia3sncjtzetdshc20zf1d3c17",
|
|
476
|
-
waves: "https://cdn.ing/assets/files/record/286191/mqlb33fzxz9cdth1bx7if0wmpkp1",
|
|
477
|
-
crossPattern: "https://cdn.ing/assets/files/record/286193/9yfqwdbnqaipbp7fsb3wbzzmq472",
|
|
478
|
-
architect: "https://cdn.ing/assets/files/record/286194/vgs88ugpvyhxu13wqgy0acvae6re",
|
|
479
|
-
tinyCheckers: "https://cdn.ing/assets/files/record/286195/65efaknsw8kcpf9o3c2gybytsl5b",
|
|
480
|
-
p6: "https://cdn.ing/assets/i/r/286196/6kl0rqnd6mjk8j7e525fo8fo0vkc/p6.webp"
|
|
481
|
-
};
|
|
482
|
-
var maskTop = "radial-gradient(ellipse 70% 60% at 50% 0%, #000 60%, transparent 100%)";
|
|
483
|
-
var maskBottom = "radial-gradient(ellipse 100% 80% at 50% 100%, #000 50%, transparent 90%)";
|
|
484
|
-
var maskCenter = "radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 70%)";
|
|
485
|
-
var maskTopLeft = "radial-gradient(ellipse 80% 80% at 0% 0%, #000 50%, transparent 90%)";
|
|
486
|
-
var maskTopRight = "radial-gradient(ellipse 80% 80% at 100% 0%, #000 50%, transparent 90%)";
|
|
487
|
-
var maskBottomLeft = "radial-gradient(ellipse 80% 80% at 0% 100%, #000 50%, transparent 90%)";
|
|
488
|
-
var maskBottomRight = "radial-gradient(ellipse 80% 80% at 100% 100%, #000 50%, transparent 90%)";
|
|
489
|
-
var circuitBoardPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
490
|
-
"svg",
|
|
491
|
-
{
|
|
492
|
-
className: "h-full w-full",
|
|
493
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
494
|
-
style: mask ? {
|
|
495
|
-
maskImage: mask,
|
|
496
|
-
WebkitMaskImage: mask
|
|
497
|
-
} : void 0,
|
|
498
|
-
children: [
|
|
499
|
-
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
500
|
-
"pattern",
|
|
501
|
-
{
|
|
502
|
-
id,
|
|
503
|
-
x: "0",
|
|
504
|
-
y: "0",
|
|
505
|
-
width: "100",
|
|
506
|
-
height: "100",
|
|
507
|
-
patternUnits: "userSpaceOnUse",
|
|
508
|
-
children: [
|
|
509
|
-
/* @__PURE__ */ jsx(
|
|
510
|
-
"path",
|
|
511
|
-
{
|
|
512
|
-
d: "M0 50h40M60 50h40M50 0v40M50 60v40",
|
|
513
|
-
stroke: "hsl(var(--muted))",
|
|
514
|
-
strokeWidth: "1",
|
|
515
|
-
fill: "none"
|
|
516
|
-
}
|
|
517
|
-
),
|
|
518
|
-
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "50", r: "3", fill: "hsl(var(--muted))" }),
|
|
519
|
-
/* @__PURE__ */ jsx("circle", { cx: "0", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
520
|
-
/* @__PURE__ */ jsx("circle", { cx: "100", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
|
|
521
|
-
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "0", r: "2", fill: "hsl(var(--muted))" }),
|
|
522
|
-
/* @__PURE__ */ jsx("circle", { cx: "50", cy: "100", r: "2", fill: "hsl(var(--muted))" })
|
|
523
|
-
]
|
|
524
|
-
}
|
|
525
|
-
) }),
|
|
526
|
-
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
527
|
-
]
|
|
528
|
-
}
|
|
529
|
-
);
|
|
530
|
-
var gridDotsPattern = (id, mask) => /* @__PURE__ */ jsxs(
|
|
531
|
-
"svg",
|
|
532
|
-
{
|
|
533
|
-
className: "h-full w-full",
|
|
534
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
535
|
-
style: mask ? {
|
|
536
|
-
maskImage: mask,
|
|
537
|
-
WebkitMaskImage: mask
|
|
538
|
-
} : void 0,
|
|
539
|
-
children: [
|
|
540
|
-
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs(
|
|
541
|
-
"pattern",
|
|
542
|
-
{
|
|
543
|
-
id,
|
|
544
|
-
x: "0",
|
|
545
|
-
y: "0",
|
|
546
|
-
width: "40",
|
|
547
|
-
height: "40",
|
|
548
|
-
patternUnits: "userSpaceOnUse",
|
|
549
|
-
children: [
|
|
550
|
-
/* @__PURE__ */ jsx(
|
|
551
|
-
"path",
|
|
552
|
-
{
|
|
553
|
-
d: "M0 20h40M20 0v40",
|
|
554
|
-
stroke: "hsl(var(--muted))",
|
|
555
|
-
strokeWidth: "0.5",
|
|
556
|
-
fill: "none"
|
|
557
|
-
}
|
|
558
|
-
),
|
|
559
|
-
/* @__PURE__ */ jsx("circle", { cx: "20", cy: "20", r: "2", fill: "hsl(var(--muted))" })
|
|
560
|
-
]
|
|
561
|
-
}
|
|
562
|
-
) }),
|
|
563
|
-
/* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
|
|
564
|
-
]
|
|
565
|
-
}
|
|
566
|
-
);
|
|
567
|
-
var gridPattern = (size, mask) => /* @__PURE__ */ jsx(
|
|
568
|
-
"div",
|
|
569
|
-
{
|
|
570
|
-
className: "h-full w-full bg-[linear-gradient(to_right,_hsl(var(--muted))_1px,_transparent_1px),linear-gradient(to_bottom,_hsl(var(--muted))_1px,_transparent_1px)]",
|
|
571
|
-
style: {
|
|
572
|
-
backgroundSize: `${size}px ${size}px`,
|
|
573
|
-
...mask ? {
|
|
574
|
-
maskImage: mask,
|
|
575
|
-
WebkitMaskImage: mask
|
|
576
|
-
} : {}
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
);
|
|
580
|
-
var diagonalCrossPattern = (mask) => /* @__PURE__ */ jsx(
|
|
581
|
-
"div",
|
|
582
|
-
{
|
|
583
|
-
className: "h-full w-full",
|
|
584
|
-
style: {
|
|
585
|
-
backgroundImage: "repeating-linear-gradient(45deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px), repeating-linear-gradient(135deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px)",
|
|
586
|
-
...mask ? {
|
|
587
|
-
maskImage: mask,
|
|
588
|
-
WebkitMaskImage: mask
|
|
589
|
-
} : {}
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
);
|
|
593
|
-
var dashedGridMaskBase = "repeating-linear-gradient(to right, black 0px, black 3px, transparent 3px, transparent 8px), repeating-linear-gradient(to bottom, black 0px, black 3px, transparent 3px, transparent 8px)";
|
|
594
|
-
var dashedGridPattern = (fadeMask) => {
|
|
595
|
-
const mask = fadeMask ? `${dashedGridMaskBase}, ${fadeMask}` : dashedGridMaskBase;
|
|
298
|
+
const patternUrl = pattern in patternSvgs ? patternSvgs[pattern] : pattern;
|
|
596
299
|
return /* @__PURE__ */ jsx(
|
|
597
|
-
"div",
|
|
598
|
-
{
|
|
599
|
-
className: "
|
|
600
|
-
style: {
|
|
601
|
-
backgroundImage:
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
}
|
|
300
|
+
"div",
|
|
301
|
+
{
|
|
302
|
+
className: cn("pointer-events-none absolute inset-0 z-0", className),
|
|
303
|
+
style: {
|
|
304
|
+
backgroundImage: `url(${patternUrl})`,
|
|
305
|
+
backgroundRepeat: "repeat",
|
|
306
|
+
backgroundSize: "auto",
|
|
307
|
+
opacity,
|
|
308
|
+
...style
|
|
309
|
+
},
|
|
310
|
+
"aria-hidden": "true"
|
|
609
311
|
}
|
|
610
312
|
);
|
|
313
|
+
}
|
|
314
|
+
var backgroundStyles = {
|
|
315
|
+
default: "bg-background text-foreground",
|
|
316
|
+
white: "bg-white text-dark",
|
|
317
|
+
gray: "bg-muted/30 text-foreground",
|
|
318
|
+
dark: "bg-foreground text-background",
|
|
319
|
+
transparent: "bg-transparent text-foreground",
|
|
320
|
+
gradient: "bg-linear-to-br from-primary via-primary/90 to-foreground text-primary-foreground",
|
|
321
|
+
primary: "bg-primary text-primary-foreground",
|
|
322
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
323
|
+
muted: "bg-muted text-muted-foreground"
|
|
611
324
|
};
|
|
612
|
-
var
|
|
613
|
-
"
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
325
|
+
var spacingStyles = {
|
|
326
|
+
none: "py-0 md:py-0",
|
|
327
|
+
sm: "py-12 md:py-16",
|
|
328
|
+
md: "py-16 md:py-24",
|
|
329
|
+
lg: "py-20 md:py-32",
|
|
330
|
+
xl: "py-24 md:py-40"
|
|
331
|
+
};
|
|
332
|
+
var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
|
|
333
|
+
var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
|
|
334
|
+
var Section = React3__default.forwardRef(
|
|
335
|
+
({
|
|
336
|
+
id,
|
|
337
|
+
title,
|
|
338
|
+
subtitle,
|
|
339
|
+
children,
|
|
340
|
+
className,
|
|
341
|
+
style,
|
|
342
|
+
background = "default",
|
|
343
|
+
spacing = "lg",
|
|
344
|
+
pattern,
|
|
345
|
+
patternOpacity,
|
|
346
|
+
patternClassName,
|
|
347
|
+
containerClassName,
|
|
348
|
+
containerMaxWidth = "xl",
|
|
349
|
+
...props
|
|
350
|
+
}, ref) => {
|
|
351
|
+
const effectivePatternOpacity = patternOpacity !== void 0 ? patternOpacity : pattern ? 1 : 0;
|
|
352
|
+
return /* @__PURE__ */ jsxs(
|
|
353
|
+
"section",
|
|
354
|
+
{
|
|
355
|
+
ref,
|
|
356
|
+
id,
|
|
357
|
+
className: cn(
|
|
358
|
+
"relative",
|
|
359
|
+
pattern ? "overflow-hidden" : null,
|
|
360
|
+
backgroundStyles[background],
|
|
361
|
+
isPredefinedSpacing(spacing) ? spacingStyles[spacing] : spacing,
|
|
362
|
+
className
|
|
363
|
+
),
|
|
364
|
+
style,
|
|
365
|
+
...props,
|
|
366
|
+
children: [
|
|
367
|
+
/* @__PURE__ */ jsx(
|
|
368
|
+
PatternBackground,
|
|
369
|
+
{
|
|
370
|
+
pattern,
|
|
371
|
+
opacity: effectivePatternOpacity,
|
|
372
|
+
className: patternClassName
|
|
373
|
+
}
|
|
374
|
+
),
|
|
375
|
+
/* @__PURE__ */ jsxs(
|
|
376
|
+
Container,
|
|
377
|
+
{
|
|
378
|
+
maxWidth: containerMaxWidth,
|
|
379
|
+
className: cn("relative z-10", containerClassName),
|
|
380
|
+
children: [
|
|
381
|
+
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "mb-6 text-center md:mb-16", children: [
|
|
382
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "mb-2 text-sm font-semibold uppercase tracking-wider", children: subtitle }),
|
|
383
|
+
title && /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold tracking-tight md:text-4xl lg:text-5xl", children: title })
|
|
384
|
+
] }),
|
|
385
|
+
children
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
)
|
|
389
|
+
]
|
|
390
|
+
}
|
|
391
|
+
);
|
|
622
392
|
}
|
|
623
393
|
);
|
|
624
|
-
|
|
625
|
-
|
|
394
|
+
Section.displayName = "Section";
|
|
395
|
+
var baseStyles = [
|
|
396
|
+
// Layout
|
|
397
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap shrink-0",
|
|
398
|
+
// Typography - using CSS variables with sensible defaults
|
|
399
|
+
"font-[var(--button-font-family,inherit)]",
|
|
400
|
+
"font-[var(--button-font-weight,500)]",
|
|
401
|
+
"tracking-[var(--button-letter-spacing,0)]",
|
|
402
|
+
"leading-[var(--button-line-height,1.25)]",
|
|
403
|
+
"[text-transform:var(--button-text-transform,none)]",
|
|
404
|
+
"text-sm",
|
|
405
|
+
// Border radius
|
|
406
|
+
"rounded-[var(--button-radius,var(--radius,0.375rem))]",
|
|
407
|
+
// Smooth transition - using [transition:...] to set full shorthand property (not just transition-property)
|
|
408
|
+
"[transition:var(--button-transition,all_250ms_cubic-bezier(0.4,0,0.2,1))]",
|
|
409
|
+
// Box shadow (master level) - using [box-shadow:...] for complex multi-value shadows
|
|
410
|
+
"[box-shadow:var(--button-shadow,none)]",
|
|
411
|
+
"hover:[box-shadow:var(--button-shadow-hover,var(--button-shadow,none))]",
|
|
412
|
+
// Disabled state
|
|
413
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
414
|
+
// SVG handling
|
|
415
|
+
"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
|
|
416
|
+
// Focus styles
|
|
417
|
+
"outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
418
|
+
// Invalid state
|
|
419
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
|
|
420
|
+
].join(" ");
|
|
421
|
+
var buttonVariants = cva(baseStyles, {
|
|
422
|
+
variants: {
|
|
423
|
+
variant: {
|
|
424
|
+
// Default (Primary) variant - full customization
|
|
425
|
+
default: [
|
|
426
|
+
"bg-[var(--button-default-bg,hsl(var(--primary)))]",
|
|
427
|
+
"text-[var(--button-default-fg,hsl(var(--primary-foreground)))]",
|
|
428
|
+
"border-[length:var(--button-default-border-width,0px)]",
|
|
429
|
+
"border-[color:var(--button-default-border,transparent)]",
|
|
430
|
+
"[box-shadow:var(--button-default-shadow,var(--button-shadow,none))]",
|
|
431
|
+
"hover:bg-[var(--button-default-hover-bg,hsl(var(--primary)/0.9))]",
|
|
432
|
+
"hover:text-[var(--button-default-hover-fg,var(--button-default-fg,hsl(var(--primary-foreground))))]",
|
|
433
|
+
"hover:border-[color:var(--button-default-hover-border,var(--button-default-border,transparent))]",
|
|
434
|
+
"hover:[box-shadow:var(--button-default-shadow-hover,var(--button-shadow-hover,var(--button-default-shadow,var(--button-shadow,none))))]"
|
|
435
|
+
].join(" "),
|
|
436
|
+
// Destructive variant - full customization
|
|
437
|
+
destructive: [
|
|
438
|
+
"bg-[var(--button-destructive-bg,hsl(var(--destructive)))]",
|
|
439
|
+
"text-[var(--button-destructive-fg,white)]",
|
|
440
|
+
"border-[length:var(--button-destructive-border-width,0px)]",
|
|
441
|
+
"border-[color:var(--button-destructive-border,transparent)]",
|
|
442
|
+
"[box-shadow:var(--button-destructive-shadow,var(--button-shadow,none))]",
|
|
443
|
+
"hover:bg-[var(--button-destructive-hover-bg,hsl(var(--destructive)/0.9))]",
|
|
444
|
+
"hover:text-[var(--button-destructive-hover-fg,var(--button-destructive-fg,white))]",
|
|
445
|
+
"hover:border-[color:var(--button-destructive-hover-border,var(--button-destructive-border,transparent))]",
|
|
446
|
+
"hover:[box-shadow:var(--button-destructive-shadow-hover,var(--button-shadow-hover,var(--button-destructive-shadow,var(--button-shadow,none))))]",
|
|
447
|
+
"focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
448
|
+
"dark:bg-destructive/60"
|
|
449
|
+
].join(" "),
|
|
450
|
+
// Outline variant - full customization with proper border handling
|
|
451
|
+
outline: [
|
|
452
|
+
"bg-[var(--button-outline-bg,hsl(var(--background)))]",
|
|
453
|
+
"text-[var(--button-outline-fg,inherit)]",
|
|
454
|
+
"border-[length:var(--button-outline-border-width,1px)]",
|
|
455
|
+
"border-[color:var(--button-outline-border,hsl(var(--border)))]",
|
|
456
|
+
"[box-shadow:var(--button-outline-shadow,var(--button-shadow,0_1px_2px_0_rgb(0_0_0/0.05)))]",
|
|
457
|
+
"hover:bg-[var(--button-outline-hover-bg,hsl(var(--accent)))]",
|
|
458
|
+
"hover:text-[var(--button-outline-hover-fg,hsl(var(--accent-foreground)))]",
|
|
459
|
+
"hover:border-[color:var(--button-outline-hover-border,var(--button-outline-border,hsl(var(--border))))]",
|
|
460
|
+
"hover:[box-shadow:var(--button-outline-shadow-hover,var(--button-shadow-hover,var(--button-outline-shadow,var(--button-shadow,none))))]",
|
|
461
|
+
"dark:bg-input/30 dark:border-input dark:hover:bg-input/50"
|
|
462
|
+
].join(" "),
|
|
463
|
+
// Secondary variant - full customization
|
|
464
|
+
secondary: [
|
|
465
|
+
"bg-[var(--button-secondary-bg,hsl(var(--secondary)))]",
|
|
466
|
+
"text-[var(--button-secondary-fg,hsl(var(--secondary-foreground)))]",
|
|
467
|
+
"border-[length:var(--button-secondary-border-width,0px)]",
|
|
468
|
+
"border-[color:var(--button-secondary-border,transparent)]",
|
|
469
|
+
"[box-shadow:var(--button-secondary-shadow,var(--button-shadow,none))]",
|
|
470
|
+
"hover:bg-[var(--button-secondary-hover-bg,hsl(var(--secondary)/0.8))]",
|
|
471
|
+
"hover:text-[var(--button-secondary-hover-fg,var(--button-secondary-fg,hsl(var(--secondary-foreground))))]",
|
|
472
|
+
"hover:border-[color:var(--button-secondary-hover-border,var(--button-secondary-border,transparent))]",
|
|
473
|
+
"hover:[box-shadow:var(--button-secondary-shadow-hover,var(--button-shadow-hover,var(--button-secondary-shadow,var(--button-shadow,none))))]"
|
|
474
|
+
].join(" "),
|
|
475
|
+
// Ghost variant - full customization
|
|
476
|
+
ghost: [
|
|
477
|
+
"bg-[var(--button-ghost-bg,transparent)]",
|
|
478
|
+
"text-[var(--button-ghost-fg,inherit)]",
|
|
479
|
+
"border-[length:var(--button-ghost-border-width,0px)]",
|
|
480
|
+
"border-[color:var(--button-ghost-border,transparent)]",
|
|
481
|
+
"[box-shadow:var(--button-ghost-shadow,var(--button-shadow,none))]",
|
|
482
|
+
"hover:bg-[var(--button-ghost-hover-bg,hsl(var(--accent)))]",
|
|
483
|
+
"hover:text-[var(--button-ghost-hover-fg,hsl(var(--accent-foreground)))]",
|
|
484
|
+
"hover:border-[color:var(--button-ghost-hover-border,var(--button-ghost-border,transparent))]",
|
|
485
|
+
"hover:[box-shadow:var(--button-ghost-shadow-hover,var(--button-shadow-hover,var(--button-ghost-shadow,var(--button-shadow,none))))]",
|
|
486
|
+
"dark:hover:bg-accent/50"
|
|
487
|
+
].join(" "),
|
|
488
|
+
// Link variant - full customization
|
|
489
|
+
link: [
|
|
490
|
+
"bg-[var(--button-link-bg,transparent)]",
|
|
491
|
+
"text-[var(--button-link-fg,hsl(var(--primary)))]",
|
|
492
|
+
"border-[length:var(--button-link-border-width,0px)]",
|
|
493
|
+
"border-[color:var(--button-link-border,transparent)]",
|
|
494
|
+
"[box-shadow:var(--button-link-shadow,none)]",
|
|
495
|
+
"hover:bg-[var(--button-link-hover-bg,transparent)]",
|
|
496
|
+
"hover:text-[var(--button-link-hover-fg,var(--button-link-fg,hsl(var(--primary))))]",
|
|
497
|
+
"hover:[box-shadow:var(--button-link-shadow-hover,none)]",
|
|
498
|
+
"underline-offset-4 hover:underline"
|
|
499
|
+
].join(" ")
|
|
500
|
+
},
|
|
501
|
+
size: {
|
|
502
|
+
default: [
|
|
503
|
+
"h-[var(--button-height-md,2.25rem)]",
|
|
504
|
+
"px-[var(--button-padding-x-md,1rem)]",
|
|
505
|
+
"py-[var(--button-padding-y-md,0.5rem)]",
|
|
506
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
|
|
507
|
+
].join(" "),
|
|
508
|
+
sm: [
|
|
509
|
+
"h-[var(--button-height-sm,2rem)]",
|
|
510
|
+
"px-[var(--button-padding-x-sm,0.75rem)]",
|
|
511
|
+
"py-[var(--button-padding-y-sm,0.25rem)]",
|
|
512
|
+
"gap-1.5",
|
|
513
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-sm,0.75rem)*0.83)]"
|
|
514
|
+
].join(" "),
|
|
515
|
+
md: [
|
|
516
|
+
"h-[var(--button-height-md,2.25rem)]",
|
|
517
|
+
"px-[var(--button-padding-x-md,1rem)]",
|
|
518
|
+
"py-[var(--button-padding-y-md,0.5rem)]",
|
|
519
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
|
|
520
|
+
].join(" "),
|
|
521
|
+
lg: [
|
|
522
|
+
"h-[var(--button-height-lg,2.5rem)]",
|
|
523
|
+
"px-[var(--button-padding-x-lg,1.5rem)]",
|
|
524
|
+
"py-[var(--button-padding-y-lg,0.5rem)]",
|
|
525
|
+
"has-[>svg]:px-[calc(var(--button-padding-x-lg,1.5rem)*0.67)]"
|
|
526
|
+
].join(" "),
|
|
527
|
+
icon: "size-[var(--button-height-md,2.25rem)]",
|
|
528
|
+
"icon-sm": "size-[var(--button-height-sm,2rem)]",
|
|
529
|
+
"icon-lg": "size-[var(--button-height-lg,2.5rem)]"
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
defaultVariants: {
|
|
533
|
+
variant: "default",
|
|
534
|
+
size: "default"
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
var badgeVariants = cva(
|
|
538
|
+
"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
626
539
|
{
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
540
|
+
variants: {
|
|
541
|
+
variant: {
|
|
542
|
+
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
543
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
544
|
+
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
545
|
+
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
defaultVariants: {
|
|
549
|
+
variant: "default"
|
|
633
550
|
}
|
|
634
551
|
}
|
|
635
552
|
);
|
|
636
|
-
|
|
637
|
-
circuitBoardBasic: () => circuitBoardPattern("circuit-board-basic"),
|
|
638
|
-
circuitBoardFadeTop: () => circuitBoardPattern("circuit-board-fade-top", maskTop),
|
|
639
|
-
circuitBoardFadeBottom: () => circuitBoardPattern("circuit-board-fade-bottom", maskBottom),
|
|
640
|
-
circuitBoardFadeCenter: () => circuitBoardPattern("circuit-board-fade-center", maskCenter),
|
|
641
|
-
circuitBoardFadeTopLeft: () => circuitBoardPattern("circuit-board-fade-top-left", maskTopLeft),
|
|
642
|
-
circuitBoardFadeTopRight: () => circuitBoardPattern("circuit-board-fade-top-right", maskTopRight),
|
|
643
|
-
circuitBoardFadeBottomLeft: () => circuitBoardPattern("circuit-board-fade-bottom-left", maskBottomLeft),
|
|
644
|
-
circuitBoardFadeBottomRight: () => circuitBoardPattern("circuit-board-fade-bottom-right", maskBottomRight),
|
|
645
|
-
dashedGridBasic: () => dashedGridPattern(),
|
|
646
|
-
dashedGridFadeTop: () => dashedGridPattern(maskTop),
|
|
647
|
-
dashedGridFadeBottom: () => dashedGridPattern(maskBottom),
|
|
648
|
-
dashedGridFadeCenter: () => dashedGridPattern(maskCenter),
|
|
649
|
-
dashedGridFadeTopLeft: () => dashedGridPattern(maskTopLeft),
|
|
650
|
-
dashedGridFadeTopRight: () => dashedGridPattern(maskTopRight),
|
|
651
|
-
dashedGridFadeBottomLeft: () => dashedGridPattern(maskBottomLeft),
|
|
652
|
-
dashedGridFadeBottomRight: () => dashedGridPattern(maskBottomRight),
|
|
653
|
-
diagonalCrossBasic: () => diagonalCrossPattern(),
|
|
654
|
-
diagonalCrossFadeTop: () => diagonalCrossPattern(maskTop),
|
|
655
|
-
diagonalCrossFadeBottom: () => diagonalCrossPattern(maskBottom),
|
|
656
|
-
diagonalCrossFadeCenter: () => diagonalCrossPattern(maskCenter),
|
|
657
|
-
diagonalCrossFadeTopLeft: () => diagonalCrossPattern(maskTopLeft),
|
|
658
|
-
diagonalCrossFadeTopRight: () => diagonalCrossPattern(maskTopRight),
|
|
659
|
-
diagonalCrossFadeBottomLeft: () => diagonalCrossPattern(maskBottomLeft),
|
|
660
|
-
diagonalCrossFadeBottomRight: () => diagonalCrossPattern(maskBottomRight),
|
|
661
|
-
gridBasic: () => gridPattern(40),
|
|
662
|
-
gridFadeTop: () => gridPattern(32, maskTop),
|
|
663
|
-
gridFadeBottom: () => gridPattern(32, maskBottom),
|
|
664
|
-
gridFadeCenter: () => gridPattern(40, maskCenter),
|
|
665
|
-
gridFadeTopLeft: () => gridPattern(32, maskTopLeft),
|
|
666
|
-
gridFadeTopRight: () => gridPattern(32, maskTopRight),
|
|
667
|
-
gridFadeBottomLeft: () => gridPattern(32, maskBottomLeft),
|
|
668
|
-
gridFadeBottomRight: () => gridPattern(32, maskBottomRight),
|
|
669
|
-
gridDotsBasic: () => gridDotsPattern("grid-dots-basic"),
|
|
670
|
-
gridDotsFadeCenter: () => gridDotsPattern("grid-dots-fade-center", maskCenter),
|
|
671
|
-
gradientGlowTop: () => gradientGlow("top"),
|
|
672
|
-
gradientGlowBottom: () => gradientGlow("bottom"),
|
|
673
|
-
spotlightLeft: () => spotlight("left"),
|
|
674
|
-
spotlightRight: () => spotlight("right")
|
|
675
|
-
};
|
|
676
|
-
var inlinePatternStyles = {
|
|
677
|
-
radialGradientTop: {
|
|
678
|
-
background: "radial-gradient(125% 125% at 50% 10%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
679
|
-
},
|
|
680
|
-
radialGradientBottom: {
|
|
681
|
-
background: "radial-gradient(125% 125% at 50% 90%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
|
|
682
|
-
}
|
|
683
|
-
};
|
|
684
|
-
function PatternBackground({
|
|
685
|
-
pattern,
|
|
686
|
-
opacity = 0.08,
|
|
553
|
+
function Badge({
|
|
687
554
|
className,
|
|
688
|
-
|
|
555
|
+
variant,
|
|
556
|
+
asChild = false,
|
|
557
|
+
...props
|
|
689
558
|
}) {
|
|
690
|
-
|
|
691
|
-
|
|
559
|
+
const Comp = asChild ? Slot : "span";
|
|
560
|
+
return /* @__PURE__ */ jsx(
|
|
561
|
+
Comp,
|
|
562
|
+
{
|
|
563
|
+
"data-slot": "badge",
|
|
564
|
+
className: cn(badgeVariants({ variant }), className),
|
|
565
|
+
...props
|
|
566
|
+
}
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
function normalizePhoneNumber(input) {
|
|
570
|
+
const trimmed = input.trim();
|
|
571
|
+
if (trimmed.toLowerCase().startsWith("tel:")) {
|
|
572
|
+
return trimmed;
|
|
692
573
|
}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
"aria-hidden": "true"
|
|
701
|
-
}
|
|
702
|
-
);
|
|
574
|
+
const match = trimmed.match(/^[\s\+\-\(\)]*(\d[\d\s\-\(\)\.]*\d)[\s\-]*(x|ext\.?|extension)?[\s\-]*(\d+)?$/i);
|
|
575
|
+
if (match) {
|
|
576
|
+
const mainNumber = match[1].replace(/[\s\-\(\)\.]/g, "");
|
|
577
|
+
const extension = match[3];
|
|
578
|
+
const normalized = mainNumber.length >= 10 && !trimmed.startsWith("+") ? `+${mainNumber}` : mainNumber;
|
|
579
|
+
const withExtension = extension ? `${normalized};ext=${extension}` : normalized;
|
|
580
|
+
return `tel:${withExtension}`;
|
|
703
581
|
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
"aria-hidden": "true",
|
|
712
|
-
children: Overlay()
|
|
713
|
-
}
|
|
714
|
-
);
|
|
582
|
+
const cleaned = trimmed.replace(/[\s\-\(\)\.]/g, "");
|
|
583
|
+
return `tel:${cleaned}`;
|
|
584
|
+
}
|
|
585
|
+
function normalizeEmail(input) {
|
|
586
|
+
const trimmed = input.trim();
|
|
587
|
+
if (trimmed.toLowerCase().startsWith("mailto:")) {
|
|
588
|
+
return trimmed;
|
|
715
589
|
}
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
590
|
+
return `mailto:${trimmed}`;
|
|
591
|
+
}
|
|
592
|
+
function isEmail(input) {
|
|
593
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
594
|
+
return emailRegex.test(input.trim());
|
|
595
|
+
}
|
|
596
|
+
function isPhoneNumber(input) {
|
|
597
|
+
const trimmed = input.trim();
|
|
598
|
+
if (trimmed.toLowerCase().startsWith("tel:")) {
|
|
599
|
+
return true;
|
|
600
|
+
}
|
|
601
|
+
const phoneRegex = /^[\s\+\-\(\)]*\d[\d\s\-\(\)\.]*\d[\s\-]*(x|ext\.?|extension)?[\s\-]*\d*$/i;
|
|
602
|
+
return phoneRegex.test(trimmed);
|
|
603
|
+
}
|
|
604
|
+
function isInternalUrl(href) {
|
|
605
|
+
if (typeof window === "undefined") {
|
|
606
|
+
return href.startsWith("/") && !href.startsWith("//");
|
|
607
|
+
}
|
|
608
|
+
const trimmed = href.trim();
|
|
609
|
+
if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
|
|
610
|
+
return true;
|
|
611
|
+
}
|
|
612
|
+
try {
|
|
613
|
+
const url = new URL(trimmed, window.location.href);
|
|
614
|
+
const currentOrigin = window.location.origin;
|
|
615
|
+
const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
|
|
616
|
+
return normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin);
|
|
617
|
+
} catch {
|
|
618
|
+
return false;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
function toRelativePath(href) {
|
|
622
|
+
if (typeof window === "undefined") {
|
|
623
|
+
return href;
|
|
624
|
+
}
|
|
625
|
+
const trimmed = href.trim();
|
|
626
|
+
if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
|
|
627
|
+
return trimmed;
|
|
628
|
+
}
|
|
629
|
+
try {
|
|
630
|
+
const url = new URL(trimmed, window.location.href);
|
|
631
|
+
const currentOrigin = window.location.origin;
|
|
632
|
+
const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
|
|
633
|
+
if (normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin)) {
|
|
634
|
+
return url.pathname + url.search + url.hash;
|
|
635
|
+
}
|
|
636
|
+
} catch {
|
|
637
|
+
}
|
|
638
|
+
return trimmed;
|
|
639
|
+
}
|
|
640
|
+
function useNavigation({
|
|
641
|
+
href,
|
|
642
|
+
onClick
|
|
643
|
+
} = {}) {
|
|
644
|
+
const linkType = React3.useMemo(() => {
|
|
645
|
+
if (!href || href.trim() === "") {
|
|
646
|
+
return onClick ? "none" : "none";
|
|
647
|
+
}
|
|
648
|
+
const trimmed = href.trim();
|
|
649
|
+
if (trimmed.toLowerCase().startsWith("mailto:") || isEmail(trimmed)) {
|
|
650
|
+
return "mailto";
|
|
651
|
+
}
|
|
652
|
+
if (trimmed.toLowerCase().startsWith("tel:") || isPhoneNumber(trimmed)) {
|
|
653
|
+
return "tel";
|
|
654
|
+
}
|
|
655
|
+
if (isInternalUrl(trimmed)) {
|
|
656
|
+
return "internal";
|
|
657
|
+
}
|
|
658
|
+
try {
|
|
659
|
+
new URL(trimmed, typeof window !== "undefined" ? window.location.href : "http://localhost");
|
|
660
|
+
return "external";
|
|
661
|
+
} catch {
|
|
662
|
+
return "internal";
|
|
663
|
+
}
|
|
664
|
+
}, [href, onClick]);
|
|
665
|
+
const normalizedHref = React3.useMemo(() => {
|
|
666
|
+
if (!href || href.trim() === "") {
|
|
667
|
+
return void 0;
|
|
668
|
+
}
|
|
669
|
+
const trimmed = href.trim();
|
|
670
|
+
switch (linkType) {
|
|
671
|
+
case "tel":
|
|
672
|
+
return normalizePhoneNumber(trimmed);
|
|
673
|
+
case "mailto":
|
|
674
|
+
return normalizeEmail(trimmed);
|
|
675
|
+
case "internal":
|
|
676
|
+
return toRelativePath(trimmed);
|
|
677
|
+
case "external":
|
|
678
|
+
return trimmed;
|
|
679
|
+
default:
|
|
680
|
+
return trimmed;
|
|
681
|
+
}
|
|
682
|
+
}, [href, linkType]);
|
|
683
|
+
const target = React3.useMemo(() => {
|
|
684
|
+
switch (linkType) {
|
|
685
|
+
case "external":
|
|
686
|
+
return "_blank";
|
|
687
|
+
case "internal":
|
|
688
|
+
return "_self";
|
|
689
|
+
case "mailto":
|
|
690
|
+
case "tel":
|
|
691
|
+
return void 0;
|
|
692
|
+
default:
|
|
693
|
+
return void 0;
|
|
694
|
+
}
|
|
695
|
+
}, [linkType]);
|
|
696
|
+
const rel = React3.useMemo(() => {
|
|
697
|
+
if (linkType === "external") {
|
|
698
|
+
return "noopener noreferrer";
|
|
729
699
|
}
|
|
700
|
+
return void 0;
|
|
701
|
+
}, [linkType]);
|
|
702
|
+
const isExternal = linkType === "external";
|
|
703
|
+
const isInternal = linkType === "internal";
|
|
704
|
+
const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
|
|
705
|
+
const handleClick = React3.useCallback(
|
|
706
|
+
(event) => {
|
|
707
|
+
if (onClick) {
|
|
708
|
+
try {
|
|
709
|
+
onClick(event);
|
|
710
|
+
} catch (error) {
|
|
711
|
+
console.error("Error in user onClick handler:", error);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
if (event.defaultPrevented) {
|
|
715
|
+
return;
|
|
716
|
+
}
|
|
717
|
+
if (shouldUseRouter && normalizedHref && event.button === 0 && // left-click only
|
|
718
|
+
!event.metaKey && !event.altKey && !event.ctrlKey && !event.shiftKey) {
|
|
719
|
+
if (typeof window !== "undefined") {
|
|
720
|
+
const handler = window.__opensiteNavigationHandler;
|
|
721
|
+
if (typeof handler === "function") {
|
|
722
|
+
try {
|
|
723
|
+
const handled = handler(normalizedHref, event.nativeEvent || event);
|
|
724
|
+
if (handled !== false) {
|
|
725
|
+
event.preventDefault();
|
|
726
|
+
}
|
|
727
|
+
} catch (error) {
|
|
728
|
+
console.error("Error in navigation handler:", error);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
},
|
|
734
|
+
[onClick, shouldUseRouter, normalizedHref]
|
|
730
735
|
);
|
|
736
|
+
return {
|
|
737
|
+
linkType,
|
|
738
|
+
normalizedHref,
|
|
739
|
+
target,
|
|
740
|
+
rel,
|
|
741
|
+
isExternal,
|
|
742
|
+
isInternal,
|
|
743
|
+
shouldUseRouter,
|
|
744
|
+
handleClick
|
|
745
|
+
};
|
|
731
746
|
}
|
|
732
|
-
var
|
|
733
|
-
default: "bg-background text-foreground",
|
|
734
|
-
white: "bg-white text-dark",
|
|
735
|
-
gray: "bg-muted/30 text-foreground",
|
|
736
|
-
dark: "bg-foreground text-background",
|
|
737
|
-
transparent: "bg-transparent text-foreground",
|
|
738
|
-
gradient: "bg-linear-to-br from-primary via-primary/90 to-foreground text-primary-foreground",
|
|
739
|
-
primary: "bg-primary text-primary-foreground",
|
|
740
|
-
secondary: "bg-secondary text-secondary-foreground",
|
|
741
|
-
muted: "bg-muted text-muted-foreground"
|
|
742
|
-
};
|
|
743
|
-
var spacingStyles = {
|
|
744
|
-
none: "py-0 md:py-0",
|
|
745
|
-
sm: "py-12 md:py-16",
|
|
746
|
-
md: "py-16 md:py-24",
|
|
747
|
-
lg: "py-20 md:py-32",
|
|
748
|
-
xl: "py-24 md:py-40"
|
|
749
|
-
};
|
|
750
|
-
var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
|
|
751
|
-
var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
|
|
752
|
-
var Section = React__default.forwardRef(
|
|
747
|
+
var Pressable = React3.forwardRef(
|
|
753
748
|
({
|
|
754
|
-
id,
|
|
755
|
-
title,
|
|
756
|
-
subtitle,
|
|
757
749
|
children,
|
|
758
750
|
className,
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
751
|
+
href,
|
|
752
|
+
onClick,
|
|
753
|
+
variant,
|
|
754
|
+
size,
|
|
755
|
+
asButton = false,
|
|
756
|
+
fallbackComponentType = "span",
|
|
757
|
+
componentType,
|
|
758
|
+
"aria-label": ariaLabel,
|
|
759
|
+
"aria-describedby": ariaDescribedby,
|
|
760
|
+
id,
|
|
767
761
|
...props
|
|
768
762
|
}, ref) => {
|
|
769
|
-
const
|
|
770
|
-
|
|
771
|
-
|
|
763
|
+
const navigation = useNavigation({ href, onClick });
|
|
764
|
+
const {
|
|
765
|
+
normalizedHref,
|
|
766
|
+
target,
|
|
767
|
+
rel,
|
|
768
|
+
linkType,
|
|
769
|
+
isInternal,
|
|
770
|
+
handleClick
|
|
771
|
+
} = navigation;
|
|
772
|
+
const shouldRenderLink = normalizedHref && linkType !== "none";
|
|
773
|
+
const shouldRenderButton = !shouldRenderLink && onClick;
|
|
774
|
+
const effectiveComponentType = componentType || (shouldRenderLink ? "a" : shouldRenderButton ? "button" : fallbackComponentType);
|
|
775
|
+
const finalComponentType = isInternal && shouldRenderLink ? "a" : effectiveComponentType;
|
|
776
|
+
const shouldApplyButtonStyles = asButton || variant || size;
|
|
777
|
+
const combinedClassName = cn(
|
|
778
|
+
shouldApplyButtonStyles && buttonVariants({ variant, size }),
|
|
779
|
+
className
|
|
780
|
+
);
|
|
781
|
+
const dataProps = Object.fromEntries(
|
|
782
|
+
Object.entries(props).filter(([key]) => key.startsWith("data-"))
|
|
783
|
+
);
|
|
784
|
+
const buttonDataAttributes = shouldApplyButtonStyles ? {
|
|
785
|
+
"data-slot": "button",
|
|
786
|
+
"data-variant": variant ?? "default",
|
|
787
|
+
"data-size": size ?? "default"
|
|
788
|
+
} : {};
|
|
789
|
+
const commonProps = {
|
|
790
|
+
className: combinedClassName,
|
|
791
|
+
onClick: handleClick,
|
|
792
|
+
"aria-label": ariaLabel,
|
|
793
|
+
"aria-describedby": ariaDescribedby,
|
|
794
|
+
id,
|
|
795
|
+
...dataProps,
|
|
796
|
+
...buttonDataAttributes
|
|
797
|
+
};
|
|
798
|
+
if (finalComponentType === "a" && shouldRenderLink) {
|
|
799
|
+
return /* @__PURE__ */ jsx(
|
|
800
|
+
"a",
|
|
801
|
+
{
|
|
802
|
+
ref,
|
|
803
|
+
href: normalizedHref,
|
|
804
|
+
target,
|
|
805
|
+
rel,
|
|
806
|
+
...commonProps,
|
|
807
|
+
...props,
|
|
808
|
+
children
|
|
809
|
+
}
|
|
810
|
+
);
|
|
811
|
+
}
|
|
812
|
+
if (finalComponentType === "button") {
|
|
813
|
+
return /* @__PURE__ */ jsx(
|
|
814
|
+
"button",
|
|
815
|
+
{
|
|
816
|
+
ref,
|
|
817
|
+
type: props.type || "button",
|
|
818
|
+
...commonProps,
|
|
819
|
+
...props,
|
|
820
|
+
children
|
|
821
|
+
}
|
|
822
|
+
);
|
|
823
|
+
}
|
|
824
|
+
if (finalComponentType === "div") {
|
|
825
|
+
return /* @__PURE__ */ jsx(
|
|
826
|
+
"div",
|
|
827
|
+
{
|
|
828
|
+
ref,
|
|
829
|
+
...commonProps,
|
|
830
|
+
children
|
|
831
|
+
}
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
return /* @__PURE__ */ jsx(
|
|
835
|
+
"span",
|
|
772
836
|
{
|
|
773
837
|
ref,
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
"relative",
|
|
777
|
-
pattern ? "overflow-hidden" : null,
|
|
778
|
-
backgroundStyles[background],
|
|
779
|
-
isPredefinedSpacing(spacing) ? spacingStyles[spacing] : spacing,
|
|
780
|
-
className
|
|
781
|
-
),
|
|
782
|
-
style,
|
|
783
|
-
...props,
|
|
784
|
-
children: [
|
|
785
|
-
/* @__PURE__ */ jsx(
|
|
786
|
-
PatternBackground,
|
|
787
|
-
{
|
|
788
|
-
pattern,
|
|
789
|
-
opacity: effectivePatternOpacity,
|
|
790
|
-
className: patternClassName
|
|
791
|
-
}
|
|
792
|
-
),
|
|
793
|
-
/* @__PURE__ */ jsxs(
|
|
794
|
-
Container,
|
|
795
|
-
{
|
|
796
|
-
maxWidth: containerMaxWidth,
|
|
797
|
-
className: cn("relative z-10", containerClassName),
|
|
798
|
-
children: [
|
|
799
|
-
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "mb-6 text-center md:mb-16", children: [
|
|
800
|
-
subtitle && /* @__PURE__ */ jsx("p", { className: "mb-2 text-sm font-semibold uppercase tracking-wider", children: subtitle }),
|
|
801
|
-
title && /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold tracking-tight md:text-4xl lg:text-5xl", children: title })
|
|
802
|
-
] }),
|
|
803
|
-
children
|
|
804
|
-
]
|
|
805
|
-
}
|
|
806
|
-
)
|
|
807
|
-
]
|
|
838
|
+
...commonProps,
|
|
839
|
+
children
|
|
808
840
|
}
|
|
809
841
|
);
|
|
810
842
|
}
|
|
811
843
|
);
|
|
812
|
-
|
|
813
|
-
var
|
|
814
|
-
"
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
844
|
+
Pressable.displayName = "Pressable";
|
|
845
|
+
var MOBILE_CLASSES = {
|
|
846
|
+
"fit-left": "items-start md:items-center",
|
|
847
|
+
"fit-center": "items-center",
|
|
848
|
+
"fit-right": "items-end md:items-center",
|
|
849
|
+
"full-left": "items-stretch md:items-center",
|
|
850
|
+
"full-center": "items-stretch md:items-center",
|
|
851
|
+
"full-right": "items-stretch md:items-center"
|
|
852
|
+
};
|
|
853
|
+
function BlockActions({
|
|
854
|
+
mobileConfig,
|
|
855
|
+
actionsClassName,
|
|
856
|
+
verticalSpacing = "mt-4 md:mt-8",
|
|
857
|
+
actions,
|
|
858
|
+
actionsSlot
|
|
859
|
+
}) {
|
|
860
|
+
const width = mobileConfig?.width ?? "full";
|
|
861
|
+
const position = mobileConfig?.position ?? "center";
|
|
862
|
+
const mobileLayoutClass = MOBILE_CLASSES[`${width}-${position}`];
|
|
863
|
+
if (actionsSlot) {
|
|
864
|
+
return /* @__PURE__ */ jsx("div", { children: actionsSlot });
|
|
865
|
+
} else if (actions && actions?.length > 0) {
|
|
866
|
+
return /* @__PURE__ */ jsx(
|
|
867
|
+
"div",
|
|
868
|
+
{
|
|
869
|
+
className: cn(
|
|
870
|
+
"flex flex-col md:flex-row flex-wrap gap-4",
|
|
871
|
+
mobileLayoutClass,
|
|
872
|
+
actionsClassName,
|
|
873
|
+
verticalSpacing
|
|
874
|
+
),
|
|
875
|
+
children: actions.map((action, index) => /* @__PURE__ */ jsx(ActionComponent, { action }, index))
|
|
822
876
|
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
}
|
|
877
|
+
);
|
|
878
|
+
} else {
|
|
879
|
+
return null;
|
|
827
880
|
}
|
|
828
|
-
|
|
829
|
-
function
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
881
|
+
}
|
|
882
|
+
function ActionComponent({ action }) {
|
|
883
|
+
const {
|
|
884
|
+
label,
|
|
885
|
+
icon,
|
|
886
|
+
iconAfter,
|
|
887
|
+
children,
|
|
888
|
+
href,
|
|
889
|
+
onClick,
|
|
890
|
+
className: actionClassName,
|
|
891
|
+
...pressableProps
|
|
892
|
+
} = action;
|
|
836
893
|
return /* @__PURE__ */ jsx(
|
|
837
|
-
|
|
894
|
+
Pressable,
|
|
838
895
|
{
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
896
|
+
href,
|
|
897
|
+
onClick,
|
|
898
|
+
asButton: action.asButton ?? true,
|
|
899
|
+
className: actionClassName,
|
|
900
|
+
...pressableProps,
|
|
901
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
902
|
+
icon,
|
|
903
|
+
label,
|
|
904
|
+
iconAfter
|
|
905
|
+
] })
|
|
842
906
|
}
|
|
843
907
|
);
|
|
844
908
|
}
|
|
@@ -856,7 +920,7 @@ function HeroEcommerceProductShowcase({
|
|
|
856
920
|
imagesSlot,
|
|
857
921
|
background,
|
|
858
922
|
containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
|
|
859
|
-
spacing = "
|
|
923
|
+
spacing = "xl",
|
|
860
924
|
pattern,
|
|
861
925
|
patternOpacity,
|
|
862
926
|
patternClassName,
|
|
@@ -876,41 +940,34 @@ function HeroEcommerceProductShowcase({
|
|
|
876
940
|
/* @__PURE__ */ jsx("span", { children: badgeText })
|
|
877
941
|
] });
|
|
878
942
|
}, [badgeSlot, badgeIcon, badgeText]);
|
|
879
|
-
const renderActions = useMemo(() => {
|
|
880
|
-
if (actionsSlot) return actionsSlot;
|
|
881
|
-
if (!actions || actions.length === 0) return null;
|
|
882
|
-
return /* @__PURE__ */ jsx("div", { className: cn("flex flex-col gap-4 sm:flex-row", actionsClassName), children: actions.map((action, index) => {
|
|
883
|
-
const {
|
|
884
|
-
label,
|
|
885
|
-
icon,
|
|
886
|
-
iconAfter,
|
|
887
|
-
children,
|
|
888
|
-
className: actionClassName,
|
|
889
|
-
...pressableProps
|
|
890
|
-
} = action;
|
|
891
|
-
return /* @__PURE__ */ jsx(
|
|
892
|
-
Pressable,
|
|
893
|
-
{
|
|
894
|
-
asButton: true,
|
|
895
|
-
className: actionClassName,
|
|
896
|
-
...pressableProps,
|
|
897
|
-
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
898
|
-
icon,
|
|
899
|
-
label,
|
|
900
|
-
iconAfter
|
|
901
|
-
] })
|
|
902
|
-
},
|
|
903
|
-
index
|
|
904
|
-
);
|
|
905
|
-
}) });
|
|
906
|
-
}, [actionsSlot, actions, actionsClassName]);
|
|
907
943
|
const renderStats = useMemo(() => {
|
|
908
944
|
if (statsSlot) return statsSlot;
|
|
909
945
|
if (!stats || stats.length === 0) return null;
|
|
910
|
-
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-6 pt-4", statsClassName), children: stats.map((stat, index) => /* @__PURE__ */ jsxs(
|
|
946
|
+
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-6 pt-4", statsClassName), children: stats.map((stat, index) => /* @__PURE__ */ jsxs(React3.Fragment, { children: [
|
|
911
947
|
index > 0 && /* @__PURE__ */ jsx("div", { className: "h-12 w-px bg-border" }),
|
|
912
948
|
/* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
913
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ jsxs(
|
|
950
|
+
"div",
|
|
951
|
+
{
|
|
952
|
+
className: cn(
|
|
953
|
+
"flex items-center",
|
|
954
|
+
stat.icon ? "justify-between" : "justify-center"
|
|
955
|
+
),
|
|
956
|
+
children: [
|
|
957
|
+
stat.icon,
|
|
958
|
+
/* @__PURE__ */ jsx(
|
|
959
|
+
"div",
|
|
960
|
+
{
|
|
961
|
+
className: cn(
|
|
962
|
+
"font-bold ",
|
|
963
|
+
stat.icon ? "text-xl" : "text-2xl"
|
|
964
|
+
),
|
|
965
|
+
children: stat.value
|
|
966
|
+
}
|
|
967
|
+
)
|
|
968
|
+
]
|
|
969
|
+
}
|
|
970
|
+
),
|
|
914
971
|
/* @__PURE__ */ jsx("div", { className: cn("text-sm"), children: stat.label })
|
|
915
972
|
] })
|
|
916
973
|
] }, index)) });
|
|
@@ -983,42 +1040,31 @@ function HeroEcommerceProductShowcase({
|
|
|
983
1040
|
patternClassName,
|
|
984
1041
|
className,
|
|
985
1042
|
containerClassName,
|
|
986
|
-
children: /* @__PURE__ */ jsx("div", { className: "
|
|
987
|
-
/* @__PURE__ */ jsx("div", { className: "order-
|
|
988
|
-
/* @__PURE__ */ jsxs(
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
headingClassName
|
|
1012
|
-
),
|
|
1013
|
-
children: heading
|
|
1014
|
-
}
|
|
1015
|
-
)),
|
|
1016
|
-
description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-lg text-balance", descriptionClassName), children: description }) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description })),
|
|
1017
|
-
renderActions,
|
|
1018
|
-
renderStats
|
|
1019
|
-
]
|
|
1020
|
-
}
|
|
1021
|
-
)
|
|
1043
|
+
children: /* @__PURE__ */ jsx("div", { className: "pt-8 md:pt-0", children: /* @__PURE__ */ jsxs("div", { className: "grid items-center gap-12 lg:grid-cols-2 lg:gap-20", children: [
|
|
1044
|
+
/* @__PURE__ */ jsx("div", { className: "order-1", children: renderImages }),
|
|
1045
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-8 order-2", contentClassName), children: [
|
|
1046
|
+
renderBadge,
|
|
1047
|
+
heading && (typeof heading === "string" ? /* @__PURE__ */ jsx(
|
|
1048
|
+
"h1",
|
|
1049
|
+
{
|
|
1050
|
+
className: cn(
|
|
1051
|
+
"text-4xl font-bold tracking-tight md:text-5xl lg:text-6xl text-balance",
|
|
1052
|
+
headingClassName
|
|
1053
|
+
),
|
|
1054
|
+
children: heading
|
|
1055
|
+
}
|
|
1056
|
+
) : heading),
|
|
1057
|
+
description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-lg text-balance", descriptionClassName), children: description }) : description),
|
|
1058
|
+
/* @__PURE__ */ jsx(
|
|
1059
|
+
BlockActions,
|
|
1060
|
+
{
|
|
1061
|
+
actions,
|
|
1062
|
+
actionsSlot,
|
|
1063
|
+
actionsClassName
|
|
1064
|
+
}
|
|
1065
|
+
),
|
|
1066
|
+
renderStats
|
|
1067
|
+
] })
|
|
1022
1068
|
] }) })
|
|
1023
1069
|
}
|
|
1024
1070
|
);
|