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