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