nextworks 0.2.0-alpha.11 → 0.2.0-alpha.13

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 (111) hide show
  1. package/README.md +283 -282
  2. package/dist/cli_manifests/blocks_manifest.json +198 -175
  3. package/dist/kits/blocks/.nextworks/docs/BLOCKS_QUICKSTART.md +101 -100
  4. package/dist/kits/blocks/.nextworks/docs/BLOCKS_README.md +105 -104
  5. package/dist/kits/blocks/.nextworks/docs/THEME_GUIDE.md +1 -1
  6. package/dist/kits/blocks/app/templates/aiworkflow/PresetThemeVars.tsx +58 -0
  7. package/dist/kits/blocks/app/templates/aiworkflow/README.md +46 -0
  8. package/dist/kits/blocks/app/templates/aiworkflow/components/CTA.tsx +44 -0
  9. package/dist/kits/blocks/app/templates/aiworkflow/components/Contact.tsx +105 -0
  10. package/dist/kits/blocks/app/templates/aiworkflow/components/FAQ.tsx +63 -0
  11. package/dist/kits/blocks/app/templates/aiworkflow/components/Features.tsx +65 -0
  12. package/dist/kits/blocks/app/templates/aiworkflow/components/Footer.tsx +109 -0
  13. package/dist/kits/blocks/app/templates/aiworkflow/components/Hero.tsx +636 -0
  14. package/dist/kits/blocks/app/templates/aiworkflow/components/Navbar.tsx +90 -0
  15. package/dist/kits/blocks/app/templates/aiworkflow/components/Pricing.tsx +86 -0
  16. package/dist/kits/blocks/app/templates/aiworkflow/components/ProcessTimeline.tsx +103 -0
  17. package/dist/kits/blocks/app/templates/aiworkflow/components/Testimonials.tsx +56 -0
  18. package/dist/kits/blocks/app/templates/aiworkflow/components/TrustBadges.tsx +59 -0
  19. package/dist/kits/blocks/app/templates/aiworkflow/page.tsx +43 -0
  20. package/dist/kits/blocks/app/templates/digitalagency/PresetThemeVars.tsx +80 -80
  21. package/dist/kits/blocks/app/templates/digitalagency/README.md +42 -42
  22. package/dist/kits/blocks/app/templates/digitalagency/components/Pricing.tsx +114 -114
  23. package/dist/kits/blocks/app/templates/digitalagency/components/Process.tsx +59 -59
  24. package/dist/kits/blocks/app/templates/digitalagency/components/Services.tsx +55 -55
  25. package/dist/kits/blocks/app/templates/digitalagency/components/Team.tsx +28 -28
  26. package/dist/kits/blocks/app/templates/digitalagency/components/Testimonials.tsx +65 -65
  27. package/dist/kits/blocks/app/templates/digitalagency/page.tsx +38 -38
  28. package/dist/kits/blocks/app/templates/gallery/PresetThemeVars.tsx +84 -84
  29. package/dist/kits/blocks/app/templates/productlaunch/PresetThemeVars.tsx +75 -75
  30. package/dist/kits/blocks/app/templates/productlaunch/README.md +62 -62
  31. package/dist/kits/blocks/app/templates/productlaunch/components/About.tsx +84 -84
  32. package/dist/kits/blocks/app/templates/productlaunch/components/CTA.tsx +50 -50
  33. package/dist/kits/blocks/app/templates/productlaunch/components/Contact.tsx +231 -231
  34. package/dist/kits/blocks/app/templates/productlaunch/components/FAQ.tsx +86 -86
  35. package/dist/kits/blocks/app/templates/productlaunch/components/Features.tsx +83 -83
  36. package/dist/kits/blocks/app/templates/productlaunch/components/Footer.tsx +132 -132
  37. package/dist/kits/blocks/app/templates/productlaunch/components/Hero.tsx +88 -88
  38. package/dist/kits/blocks/app/templates/productlaunch/components/Navbar.tsx +116 -116
  39. package/dist/kits/blocks/app/templates/productlaunch/components/Pricing.tsx +106 -106
  40. package/dist/kits/blocks/app/templates/productlaunch/components/ProcessTimeline.tsx +110 -110
  41. package/dist/kits/blocks/app/templates/productlaunch/components/ServicesGrid.tsx +68 -68
  42. package/dist/kits/blocks/app/templates/productlaunch/components/Team.tsx +104 -104
  43. package/dist/kits/blocks/app/templates/productlaunch/components/Testimonials.tsx +90 -90
  44. package/dist/kits/blocks/app/templates/productlaunch/components/TrustBadges.tsx +76 -76
  45. package/dist/kits/blocks/app/templates/productlaunch/page.tsx +43 -43
  46. package/dist/kits/blocks/app/templates/saasdashboard/PresetThemeVars.tsx +80 -80
  47. package/dist/kits/blocks/app/templates/saasdashboard/README.md +44 -44
  48. package/dist/kits/blocks/app/templates/saasdashboard/components/Contact.tsx +129 -129
  49. package/dist/kits/blocks/app/templates/saasdashboard/components/Dashboard.tsx +293 -293
  50. package/dist/kits/blocks/app/templates/saasdashboard/components/FAQ.tsx +55 -55
  51. package/dist/kits/blocks/app/templates/saasdashboard/components/Features.tsx +90 -90
  52. package/dist/kits/blocks/app/templates/saasdashboard/components/Footer.tsx +77 -77
  53. package/dist/kits/blocks/app/templates/saasdashboard/components/Hero.tsx +104 -104
  54. package/dist/kits/blocks/app/templates/saasdashboard/components/Hero_mask.tsx +126 -126
  55. package/dist/kits/blocks/app/templates/saasdashboard/components/Navbar.tsx +117 -117
  56. package/dist/kits/blocks/app/templates/saasdashboard/components/Pricing.tsx +90 -90
  57. package/dist/kits/blocks/app/templates/saasdashboard/components/SmoothScroll.tsx +96 -96
  58. package/dist/kits/blocks/app/templates/saasdashboard/components/Testimonials.tsx +72 -72
  59. package/dist/kits/blocks/app/templates/saasdashboard/components/TrustBadges.tsx +53 -53
  60. package/dist/kits/blocks/app/templates/saasdashboard/page.tsx +39 -39
  61. package/dist/kits/blocks/components/enhanced-theme-provider.tsx +195 -195
  62. package/dist/kits/blocks/components/providers/BlocksAppProviders.tsx +27 -27
  63. package/dist/kits/blocks/components/sections/About.tsx +291 -291
  64. package/dist/kits/blocks/components/sections/CTA.tsx +257 -257
  65. package/dist/kits/blocks/components/sections/Contact.tsx +267 -267
  66. package/dist/kits/blocks/components/sections/FAQ.tsx +214 -214
  67. package/dist/kits/blocks/components/sections/Features.tsx +268 -268
  68. package/dist/kits/blocks/components/sections/Footer.tsx +302 -302
  69. package/dist/kits/blocks/components/sections/HeroMotion.tsx +308 -308
  70. package/dist/kits/blocks/components/sections/HeroOverlay.tsx +358 -358
  71. package/dist/kits/blocks/components/sections/HeroProductDemo.tsx +236 -0
  72. package/dist/kits/blocks/components/sections/HeroSplit.tsx +352 -352
  73. package/dist/kits/blocks/components/sections/Navbar.tsx +350 -350
  74. package/dist/kits/blocks/components/sections/PortfolioSimple.tsx +549 -549
  75. package/dist/kits/blocks/components/sections/Pricing.tsx +264 -264
  76. package/dist/kits/blocks/components/sections/ProcessTimeline.tsx +325 -325
  77. package/dist/kits/blocks/components/sections/ServicesGrid.tsx +210 -210
  78. package/dist/kits/blocks/components/sections/Team.tsx +309 -309
  79. package/dist/kits/blocks/components/sections/Testimonials.tsx +158 -158
  80. package/dist/kits/blocks/components/sections/TrustBadges.tsx +162 -162
  81. package/dist/kits/blocks/components/sections/product-demo/ApprovalInboxPanel.tsx +125 -0
  82. package/dist/kits/blocks/components/sections/product-demo/DemoStage.tsx +397 -0
  83. package/dist/kits/blocks/components/sections/product-demo/DemoWindow.tsx +128 -0
  84. package/dist/kits/blocks/components/sections/product-demo/KnowledgePanel.tsx +127 -0
  85. package/dist/kits/blocks/components/sections/product-demo/RunConsolePanel.tsx +150 -0
  86. package/dist/kits/blocks/components/sections/product-demo/WorkflowStudioPanel.tsx +191 -0
  87. package/dist/kits/blocks/components/sections/product-demo/types.ts +193 -0
  88. package/dist/kits/blocks/components/theme-provider.tsx +1 -1
  89. package/dist/kits/blocks/components/ui/alert-dialog.tsx +134 -134
  90. package/dist/kits/blocks/components/ui/brand-node.tsx +121 -121
  91. package/dist/kits/blocks/components/ui/button.tsx +122 -122
  92. package/dist/kits/blocks/components/ui/card.tsx +95 -95
  93. package/dist/kits/blocks/components/ui/checkbox.tsx +30 -30
  94. package/dist/kits/blocks/components/ui/cta-button.tsx +125 -125
  95. package/dist/kits/blocks/components/ui/dropdown-menu.tsx +201 -201
  96. package/dist/kits/blocks/components/ui/feature-card.tsx +91 -91
  97. package/dist/kits/blocks/components/ui/input.tsx +27 -27
  98. package/dist/kits/blocks/components/ui/label.tsx +29 -29
  99. package/dist/kits/blocks/components/ui/pricing-card.tsx +120 -120
  100. package/dist/kits/blocks/components/ui/select.tsx +25 -25
  101. package/dist/kits/blocks/components/ui/skeleton.tsx +13 -13
  102. package/dist/kits/blocks/components/ui/table.tsx +98 -98
  103. package/dist/kits/blocks/components/ui/testimonial-card.tsx +108 -108
  104. package/dist/kits/blocks/components/ui/textarea.tsx +26 -26
  105. package/dist/kits/blocks/components/ui/theme-selector.tsx +243 -243
  106. package/dist/kits/blocks/components/ui/theme-toggle.tsx +74 -74
  107. package/dist/kits/blocks/components/ui/toaster.tsx +7 -7
  108. package/dist/kits/blocks/lib/themes.ts +400 -400
  109. package/dist/kits/blocks/lib/utils.ts +6 -6
  110. package/dist/kits/blocks/package-deps.json +3 -3
  111. package/package.json +1 -1
@@ -1,352 +1,352 @@
1
- "use client";
2
- import React from "react";
3
- import Image from "next/image";
4
- import Link from "next/link";
5
- import { Button } from "@/components/ui/button";
6
- import { cn } from "@/lib/utils";
7
-
8
- /**
9
- * Props for the HeroSplit component.
10
- *
11
- * @remarks
12
- * - Layout: split hero with text and image. imageLayout controls whether the
13
- * image is full-bleed or padded.
14
- * - Styling: slot-style className overrides are merged via cn(). Heading and
15
- * subheading accept either a string or a { text, className } object.
16
- * - Motion: enableMotion toggles button hover lift transitions.
17
- * - Accessibility: uses a semantic <section> with aria-label.
18
- */
19
- interface HeroSplitProps {
20
- /** Optional id to attach to the root section element */
21
- id?: string;
22
- /** Optional top-level class to override the root */
23
- className?: string;
24
- /** Section slot override */
25
- section?: { className?: string };
26
- /** Heading string or object with text and className */
27
- heading?: string | { text?: string; className?: string };
28
- /** Subheading string or object with text and className */
29
- subheading?: string | { text?: string; className?: string };
30
- /** Primary CTA configuration */
31
- cta1?: {
32
- label?: string;
33
- href?: string;
34
- variant?:
35
- | "default"
36
- | "destructive"
37
- | "outline"
38
- | "secondary"
39
- | "ghost"
40
- | "link";
41
- size?: "default" | "sm" | "lg" | "icon";
42
- className?: string;
43
- /** When true, renders the Button in unstyled mode to avoid token bleed from variants */
44
- unstyled?: boolean;
45
- /** Optional inline style forwarded to Button */
46
- style?: React.CSSProperties;
47
- };
48
- /** Secondary CTA configuration */
49
- cta2?: {
50
- label?: string;
51
- href?: string;
52
- variant?:
53
- | "default"
54
- | "destructive"
55
- | "outline"
56
- | "secondary"
57
- | "ghost"
58
- | "link";
59
- size?: "default" | "sm" | "lg" | "icon";
60
- className?: string;
61
- /** When true, renders the Button in unstyled mode to avoid token bleed from variants */
62
- unstyled?: boolean;
63
- /** Optional inline style forwarded to Button */
64
- style?: React.CSSProperties;
65
- };
66
- /** Image configuration */
67
- image?: { src?: string; alt?: string; className?: string };
68
- /** Image container slot */
69
- imageContainer?: { className?: string };
70
- /** Text container slot */
71
- textContainer?: { className?: string };
72
- /** Buttons container slot */
73
- buttonsContainer?: { className?: string };
74
- /** Text alignment at large breakpoints. @defaultValue "center" */
75
- textAlign?: "left" | "center" | "right";
76
- /** Fallback node shown when no image.src is provided */
77
- fallback?: React.ReactNode;
78
- /** ARIA label for the section. @defaultValue "Hero section" */
79
- ariaLabel?: string;
80
- /** When false, removes button hover lifts, keeps layout static */
81
- enableMotion?: boolean;
82
- /** "padded" keeps default gutters. "full-bleed" allows the image to touch page edges. @defaultValue "full-bleed" */
83
- imageLayout?: "padded" | "full-bleed";
84
- }
85
-
86
- /**
87
- * Split hero with text on one side and an image on the other.
88
- *
89
- * @remarks
90
- * - Text props accept string or object forms to easily override classes.
91
- * - Full-bleed layout absolutely positions the image on larger screens.
92
- * - Motion only affects the subtle hover lift on CTA buttons.
93
- *
94
- * @example
95
- * <HeroSplit heading="Build faster" subheading="Launch confidently" />
96
- */
97
- export function HeroSplit({
98
- id,
99
- className,
100
- heading,
101
- subheading,
102
- section,
103
- cta1,
104
- cta2,
105
- image = {
106
- src: "/placeholders/gallery/hero-pexels-broken-9945014.avif",
107
- alt: "Hero image",
108
- className: "object-contain",
109
- },
110
- imageContainer,
111
- textContainer = { className: "flex-1 p-5" },
112
- buttonsContainer = { className: "flex flex-col md:flex-row gap-4 mt-6" },
113
- textAlign = "center",
114
- fallback,
115
- ariaLabel = "Hero section",
116
- enableMotion = true,
117
- imageLayout = "full-bleed",
118
- }: HeroSplitProps) {
119
- const lgTextAlignClasses = {
120
- left: "lg:text-left",
121
- right: "lg:text-right",
122
- center: "lg:text-center",
123
- } as const;
124
- const lgItemsAlignClasses = {
125
- left: "lg:items-start",
126
- right: "lg:items-end",
127
- center: "lg:items-center",
128
- } as const;
129
- const lgJustifyAlignClasses = {
130
- left: "lg:justify-start",
131
- right: "lg:justify-end",
132
- center: "lg:justify-center",
133
- } as const;
134
- const buttonLift = enableMotion
135
- ? "transition-all duration-200 hover:-translate-y-0.5"
136
- : "transition-none hover:!translate-y-0";
137
-
138
- // Defaults for text props (normalized below)
139
- const defaultHeading = {
140
- text: "Lorem ipsum dolor sit amet",
141
- className: "text-3xl md:text-4xl font-bold leading-tight text-foreground",
142
- };
143
- const defaultSubheading = {
144
- text: "Consectetur adipiscing elit, sed do eiusmod tempor.",
145
- className: "text-lg md:text-xl text-foreground mt-4 mb-6",
146
- };
147
-
148
- const normalizedHeading =
149
- typeof heading === "string"
150
- ? { text: heading, className: defaultHeading.className }
151
- : {
152
- text: heading?.text ?? defaultHeading.text,
153
- className: cn(defaultHeading.className, heading?.className),
154
- };
155
-
156
- const normalizedSubheading =
157
- typeof subheading === "string"
158
- ? { text: subheading, className: defaultSubheading.className }
159
- : {
160
- text: subheading?.text ?? defaultSubheading.text,
161
- className: cn(defaultSubheading.className, subheading?.className),
162
- };
163
-
164
- // CTA defaults and normalization (merge, don't replace)
165
- const defaultCta1 = {
166
- label: "Get Started",
167
- href: "#contact",
168
- variant: "default" as const,
169
- size: "default" as const,
170
- className:
171
- "shadow-lg hover:shadow-xl transition-all duration-200 hover:-translate-y-0.5",
172
- };
173
-
174
- const mergedCta1 = {
175
- ...defaultCta1,
176
- ...(cta1 ?? {}),
177
- className: cn(defaultCta1.className, cta1?.className, buttonLift),
178
- };
179
-
180
- const defaultCta2 = {
181
- label: "Learn More",
182
- href: "#",
183
- variant: "outline" as const,
184
- size: "default" as const,
185
- className: "",
186
- };
187
-
188
- const mergedCta2 = cta2
189
- ? {
190
- ...defaultCta2,
191
- ...cta2,
192
- className: cn(defaultCta2.className, cta2.className, buttonLift),
193
- }
194
- : undefined;
195
-
196
- const defaultSectionPadded = cn(
197
- "px-8 pt-8 pb-8 md:min-h-[60vh] lg:min-h-[70vh]",
198
- );
199
-
200
- const defaultSectionFull = cn(
201
- "relative overflow-hidden pt-0 pb-0 md:min-h-[60vh] lg:min-h-[70vh]",
202
- );
203
-
204
- const defaultImageContainerPadded = cn(
205
- "relative mb-4 h-48 min-h-[12rem] w-full md:mb-0 md:h-72 md:w-1/2",
206
- );
207
-
208
- // For full-bleed: absolute positioning on large screens to break out completely
209
- const defaultImageContainerFull = cn(
210
- "relative h-48 w-full md:absolute md:inset-y-0 md:right-0 md:h-full md:w-1/2",
211
- );
212
-
213
- const baseSectionClass =
214
- imageLayout === "full-bleed" ? defaultSectionFull : defaultSectionPadded;
215
-
216
- const finalSectionClass = cn(baseSectionClass, section?.className);
217
-
218
- const baseImageContainerClass =
219
- imageLayout === "full-bleed"
220
- ? defaultImageContainerFull
221
- : defaultImageContainerPadded;
222
-
223
- const finalImageContainerClass = cn(
224
- baseImageContainerClass,
225
- imageContainer?.className,
226
- );
227
-
228
- // Note: Don’t override `image.className` here—leave object-fit (e.g. `object-cover` / `object-contain`) up to the importing component.
229
- const finalImageClass = cn(
230
- image?.className,
231
- imageLayout === "full-bleed"
232
- ? "object-cover object-center md:object-right"
233
- : "object-contain object-center",
234
- );
235
-
236
- return (
237
- <section
238
- id={id}
239
- className={cn(finalSectionClass, className)}
240
- aria-label={ariaLabel}
241
- >
242
- <div
243
- className={cn(
244
- "flex flex-col items-stretch",
245
- imageLayout === "full-bleed"
246
- ? "md:block"
247
- : "md:flex-row md:items-start",
248
- )}
249
- >
250
- {/* Text container - takes up left side on large screens */}
251
- <div
252
- className={cn(
253
- "w-full",
254
- imageLayout === "full-bleed" &&
255
- "relative z-10 md:w-1/2 md:px-8 md:py-12",
256
- textContainer.className,
257
- )}
258
- >
259
- <div
260
- className={cn(
261
- "flex flex-col items-center",
262
- lgItemsAlignClasses[textAlign],
263
- )}
264
- >
265
- <h1
266
- className={cn(
267
- "text-center",
268
- lgTextAlignClasses[textAlign],
269
- normalizedHeading.className,
270
- )}
271
- >
272
- {normalizedHeading.text}
273
- </h1>
274
-
275
- <p
276
- className={cn(
277
- "text-center",
278
- lgTextAlignClasses[textAlign],
279
- normalizedSubheading.className,
280
- )}
281
- >
282
- {normalizedSubheading.text}
283
- </p>
284
-
285
- <div
286
- className={cn(
287
- "flex flex-col items-center justify-center gap-4 sm:flex-row",
288
- lgJustifyAlignClasses[textAlign],
289
- lgItemsAlignClasses[textAlign],
290
- buttonsContainer.className,
291
- )}
292
- >
293
- {mergedCta1.label && (
294
- <Button
295
- asChild
296
- variant={mergedCta1.variant}
297
- size={mergedCta1.size}
298
- className={mergedCta1.className}
299
- unstyled={mergedCta1.unstyled}
300
- style={mergedCta1.style}
301
- >
302
- <Link
303
- href={mergedCta1.href || "#"}
304
- aria-label={mergedCta1.label}
305
- >
306
- {mergedCta1.label}
307
- </Link>
308
- </Button>
309
- )}
310
-
311
- {mergedCta2?.label && (
312
- <Button
313
- asChild
314
- variant={mergedCta2.variant}
315
- size={mergedCta2.size}
316
- className={mergedCta2.className}
317
- unstyled={mergedCta2.unstyled}
318
- style={mergedCta2.style}
319
- >
320
- <Link
321
- href={mergedCta2.href || "#"}
322
- aria-label={mergedCta2.label}
323
- >
324
- {mergedCta2.label}
325
- </Link>
326
- </Button>
327
- )}
328
- </div>
329
- </div>
330
- </div>
331
-
332
- {/* Image container - absolutely positioned on right side for full-bleed */}
333
- <div className={cn(finalImageContainerClass)}>
334
- {image?.src ? (
335
- <Image
336
- priority
337
- fetchPriority="high"
338
- src={image.src}
339
- alt={image.alt || "Hero image"}
340
- className={finalImageClass}
341
- fill
342
- sizes="(min-width: 768px) 50vw, 100vw"
343
- quality={75}
344
- />
345
- ) : (
346
- <div className="absolute inset-0">{fallback || null}</div>
347
- )}
348
- </div>
349
- </div>
350
- </section>
351
- );
352
- }
1
+ "use client";
2
+ import React from "react";
3
+ import Image from "next/image";
4
+ import Link from "next/link";
5
+ import { Button } from "@/components/ui/button";
6
+ import { cn } from "@/lib/utils";
7
+
8
+ /**
9
+ * Props for the HeroSplit component.
10
+ *
11
+ * @remarks
12
+ * - Layout: split hero with text and image. imageLayout controls whether the
13
+ * image is full-bleed or padded.
14
+ * - Styling: slot-style className overrides are merged via cn(). Heading and
15
+ * subheading accept either a string or a { text, className } object.
16
+ * - Motion: enableMotion toggles button hover lift transitions.
17
+ * - Accessibility: uses a semantic <section> with aria-label.
18
+ */
19
+ interface HeroSplitProps {
20
+ /** Optional id to attach to the root section element */
21
+ id?: string;
22
+ /** Optional top-level class to override the root */
23
+ className?: string;
24
+ /** Section slot override */
25
+ section?: { className?: string };
26
+ /** Heading string or object with text and className */
27
+ heading?: string | { text?: string; className?: string };
28
+ /** Subheading string or object with text and className */
29
+ subheading?: string | { text?: string; className?: string };
30
+ /** Primary CTA configuration */
31
+ cta1?: {
32
+ label?: string;
33
+ href?: string;
34
+ variant?:
35
+ | "default"
36
+ | "destructive"
37
+ | "outline"
38
+ | "secondary"
39
+ | "ghost"
40
+ | "link";
41
+ size?: "default" | "sm" | "lg" | "icon";
42
+ className?: string;
43
+ /** When true, renders the Button in unstyled mode to avoid token bleed from variants */
44
+ unstyled?: boolean;
45
+ /** Optional inline style forwarded to Button */
46
+ style?: React.CSSProperties;
47
+ };
48
+ /** Secondary CTA configuration */
49
+ cta2?: {
50
+ label?: string;
51
+ href?: string;
52
+ variant?:
53
+ | "default"
54
+ | "destructive"
55
+ | "outline"
56
+ | "secondary"
57
+ | "ghost"
58
+ | "link";
59
+ size?: "default" | "sm" | "lg" | "icon";
60
+ className?: string;
61
+ /** When true, renders the Button in unstyled mode to avoid token bleed from variants */
62
+ unstyled?: boolean;
63
+ /** Optional inline style forwarded to Button */
64
+ style?: React.CSSProperties;
65
+ };
66
+ /** Image configuration */
67
+ image?: { src?: string; alt?: string; className?: string };
68
+ /** Image container slot */
69
+ imageContainer?: { className?: string };
70
+ /** Text container slot */
71
+ textContainer?: { className?: string };
72
+ /** Buttons container slot */
73
+ buttonsContainer?: { className?: string };
74
+ /** Text alignment at large breakpoints. @defaultValue "center" */
75
+ textAlign?: "left" | "center" | "right";
76
+ /** Fallback node shown when no image.src is provided */
77
+ fallback?: React.ReactNode;
78
+ /** ARIA label for the section. @defaultValue "Hero section" */
79
+ ariaLabel?: string;
80
+ /** When false, removes button hover lifts, keeps layout static */
81
+ enableMotion?: boolean;
82
+ /** "padded" keeps default gutters. "full-bleed" allows the image to touch page edges. @defaultValue "full-bleed" */
83
+ imageLayout?: "padded" | "full-bleed";
84
+ }
85
+
86
+ /**
87
+ * Split hero with text on one side and an image on the other.
88
+ *
89
+ * @remarks
90
+ * - Text props accept string or object forms to easily override classes.
91
+ * - Full-bleed layout absolutely positions the image on larger screens.
92
+ * - Motion only affects the subtle hover lift on CTA buttons.
93
+ *
94
+ * @example
95
+ * <HeroSplit heading="Build faster" subheading="Launch confidently" />
96
+ */
97
+ export function HeroSplit({
98
+ id,
99
+ className,
100
+ heading,
101
+ subheading,
102
+ section,
103
+ cta1,
104
+ cta2,
105
+ image = {
106
+ src: "/placeholders/gallery/hero-pexels-broken-9945014.avif",
107
+ alt: "Hero image",
108
+ className: "object-contain",
109
+ },
110
+ imageContainer,
111
+ textContainer = { className: "flex-1 p-5" },
112
+ buttonsContainer = { className: "flex flex-col md:flex-row gap-4 mt-6" },
113
+ textAlign = "center",
114
+ fallback,
115
+ ariaLabel = "Hero section",
116
+ enableMotion = true,
117
+ imageLayout = "full-bleed",
118
+ }: HeroSplitProps) {
119
+ const lgTextAlignClasses = {
120
+ left: "lg:text-left",
121
+ right: "lg:text-right",
122
+ center: "lg:text-center",
123
+ } as const;
124
+ const lgItemsAlignClasses = {
125
+ left: "lg:items-start",
126
+ right: "lg:items-end",
127
+ center: "lg:items-center",
128
+ } as const;
129
+ const lgJustifyAlignClasses = {
130
+ left: "lg:justify-start",
131
+ right: "lg:justify-end",
132
+ center: "lg:justify-center",
133
+ } as const;
134
+ const buttonLift = enableMotion
135
+ ? "transition-all duration-200 hover:-translate-y-0.5"
136
+ : "transition-none hover:!translate-y-0";
137
+
138
+ // Defaults for text props (normalized below)
139
+ const defaultHeading = {
140
+ text: "Lorem ipsum dolor sit amet",
141
+ className: "text-3xl md:text-4xl font-bold leading-tight text-foreground",
142
+ };
143
+ const defaultSubheading = {
144
+ text: "Consectetur adipiscing elit, sed do eiusmod tempor.",
145
+ className: "text-lg md:text-xl text-foreground mt-4 mb-6",
146
+ };
147
+
148
+ const normalizedHeading =
149
+ typeof heading === "string"
150
+ ? { text: heading, className: defaultHeading.className }
151
+ : {
152
+ text: heading?.text ?? defaultHeading.text,
153
+ className: cn(defaultHeading.className, heading?.className),
154
+ };
155
+
156
+ const normalizedSubheading =
157
+ typeof subheading === "string"
158
+ ? { text: subheading, className: defaultSubheading.className }
159
+ : {
160
+ text: subheading?.text ?? defaultSubheading.text,
161
+ className: cn(defaultSubheading.className, subheading?.className),
162
+ };
163
+
164
+ // CTA defaults and normalization (merge, don't replace)
165
+ const defaultCta1 = {
166
+ label: "Get Started",
167
+ href: "#contact",
168
+ variant: "default" as const,
169
+ size: "default" as const,
170
+ className:
171
+ "shadow-lg hover:shadow-xl transition-all duration-200 hover:-translate-y-0.5",
172
+ };
173
+
174
+ const mergedCta1 = {
175
+ ...defaultCta1,
176
+ ...(cta1 ?? {}),
177
+ className: cn(defaultCta1.className, cta1?.className, buttonLift),
178
+ };
179
+
180
+ const defaultCta2 = {
181
+ label: "Learn More",
182
+ href: "#",
183
+ variant: "outline" as const,
184
+ size: "default" as const,
185
+ className: "",
186
+ };
187
+
188
+ const mergedCta2 = cta2
189
+ ? {
190
+ ...defaultCta2,
191
+ ...cta2,
192
+ className: cn(defaultCta2.className, cta2.className, buttonLift),
193
+ }
194
+ : undefined;
195
+
196
+ const defaultSectionPadded = cn(
197
+ "px-8 pt-8 pb-8 md:min-h-[60vh] lg:min-h-[70vh]",
198
+ );
199
+
200
+ const defaultSectionFull = cn(
201
+ "relative overflow-hidden pt-0 pb-0 md:min-h-[60vh] lg:min-h-[70vh]",
202
+ );
203
+
204
+ const defaultImageContainerPadded = cn(
205
+ "relative mb-4 h-48 min-h-[12rem] w-full md:mb-0 md:h-72 md:w-1/2",
206
+ );
207
+
208
+ // For full-bleed: absolute positioning on large screens to break out completely
209
+ const defaultImageContainerFull = cn(
210
+ "relative h-48 w-full md:absolute md:inset-y-0 md:right-0 md:h-full md:w-1/2",
211
+ );
212
+
213
+ const baseSectionClass =
214
+ imageLayout === "full-bleed" ? defaultSectionFull : defaultSectionPadded;
215
+
216
+ const finalSectionClass = cn(baseSectionClass, section?.className);
217
+
218
+ const baseImageContainerClass =
219
+ imageLayout === "full-bleed"
220
+ ? defaultImageContainerFull
221
+ : defaultImageContainerPadded;
222
+
223
+ const finalImageContainerClass = cn(
224
+ baseImageContainerClass,
225
+ imageContainer?.className,
226
+ );
227
+
228
+ // Note: Don’t override `image.className` here—leave object-fit (e.g. `object-cover` / `object-contain`) up to the importing component.
229
+ const finalImageClass = cn(
230
+ image?.className,
231
+ imageLayout === "full-bleed"
232
+ ? "object-cover object-center md:object-right"
233
+ : "object-contain object-center",
234
+ );
235
+
236
+ return (
237
+ <section
238
+ id={id}
239
+ className={cn(finalSectionClass, className)}
240
+ aria-label={ariaLabel}
241
+ >
242
+ <div
243
+ className={cn(
244
+ "flex flex-col items-stretch",
245
+ imageLayout === "full-bleed"
246
+ ? "md:block"
247
+ : "md:flex-row md:items-start",
248
+ )}
249
+ >
250
+ {/* Text container - takes up left side on large screens */}
251
+ <div
252
+ className={cn(
253
+ "w-full",
254
+ imageLayout === "full-bleed" &&
255
+ "relative z-10 md:w-1/2 md:px-8 md:py-12",
256
+ textContainer.className,
257
+ )}
258
+ >
259
+ <div
260
+ className={cn(
261
+ "flex flex-col items-center",
262
+ lgItemsAlignClasses[textAlign],
263
+ )}
264
+ >
265
+ <h1
266
+ className={cn(
267
+ "text-center",
268
+ lgTextAlignClasses[textAlign],
269
+ normalizedHeading.className,
270
+ )}
271
+ >
272
+ {normalizedHeading.text}
273
+ </h1>
274
+
275
+ <p
276
+ className={cn(
277
+ "text-center",
278
+ lgTextAlignClasses[textAlign],
279
+ normalizedSubheading.className,
280
+ )}
281
+ >
282
+ {normalizedSubheading.text}
283
+ </p>
284
+
285
+ <div
286
+ className={cn(
287
+ "flex flex-col items-center justify-center gap-4 sm:flex-row",
288
+ lgJustifyAlignClasses[textAlign],
289
+ lgItemsAlignClasses[textAlign],
290
+ buttonsContainer.className,
291
+ )}
292
+ >
293
+ {mergedCta1.label && (
294
+ <Button
295
+ asChild
296
+ variant={mergedCta1.variant}
297
+ size={mergedCta1.size}
298
+ className={mergedCta1.className}
299
+ unstyled={mergedCta1.unstyled}
300
+ style={mergedCta1.style}
301
+ >
302
+ <Link
303
+ href={mergedCta1.href || "#"}
304
+ aria-label={mergedCta1.label}
305
+ >
306
+ {mergedCta1.label}
307
+ </Link>
308
+ </Button>
309
+ )}
310
+
311
+ {mergedCta2?.label && (
312
+ <Button
313
+ asChild
314
+ variant={mergedCta2.variant}
315
+ size={mergedCta2.size}
316
+ className={mergedCta2.className}
317
+ unstyled={mergedCta2.unstyled}
318
+ style={mergedCta2.style}
319
+ >
320
+ <Link
321
+ href={mergedCta2.href || "#"}
322
+ aria-label={mergedCta2.label}
323
+ >
324
+ {mergedCta2.label}
325
+ </Link>
326
+ </Button>
327
+ )}
328
+ </div>
329
+ </div>
330
+ </div>
331
+
332
+ {/* Image container - absolutely positioned on right side for full-bleed */}
333
+ <div className={cn(finalImageContainerClass)}>
334
+ {image?.src ? (
335
+ <Image
336
+ priority
337
+ fetchPriority="high"
338
+ src={image.src}
339
+ alt={image.alt || "Hero image"}
340
+ className={finalImageClass}
341
+ fill
342
+ sizes="(min-width: 768px) 50vw, 100vw"
343
+ quality={75}
344
+ />
345
+ ) : (
346
+ <div className="absolute inset-0">{fallback || null}</div>
347
+ )}
348
+ </div>
349
+ </div>
350
+ </section>
351
+ );
352
+ }