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