@opensite/ui 0.6.3 → 0.6.5

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