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