nextworks 0.2.0-alpha.2 → 0.2.0-alpha.21

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 (145) hide show
  1. package/README.md +280 -228
  2. package/dist/cli_manifests/blocks_manifest.json +193 -194
  3. package/dist/commands/blocks.d.ts +3 -0
  4. package/dist/commands/blocks.d.ts.map +1 -1
  5. package/dist/commands/blocks.js +128 -19
  6. package/dist/commands/blocks.js.map +1 -1
  7. package/dist/commands/doctor.d.ts +136 -0
  8. package/dist/commands/doctor.d.ts.map +1 -0
  9. package/dist/commands/doctor.js +696 -0
  10. package/dist/commands/doctor.js.map +1 -0
  11. package/dist/commands/remove-blocks.d.ts +4 -1
  12. package/dist/commands/remove-blocks.d.ts.map +1 -1
  13. package/dist/commands/remove-blocks.js +24 -6
  14. package/dist/commands/remove-blocks.js.map +1 -1
  15. package/dist/index.js +125 -4
  16. package/dist/index.js.map +1 -1
  17. package/dist/kits/blocks/.nextworks/docs/BLOCKS_QUICKSTART.md +104 -194
  18. package/dist/kits/blocks/.nextworks/docs/BLOCKS_README.md +115 -75
  19. package/dist/kits/blocks/.nextworks/docs/THEME_GUIDE.md +269 -251
  20. package/dist/kits/blocks/app/templates/digitalagency/PresetThemeVars.tsx +80 -80
  21. package/dist/kits/blocks/app/templates/digitalagency/README.md +42 -36
  22. package/dist/kits/blocks/app/templates/digitalagency/components/About.tsx +71 -99
  23. package/dist/kits/blocks/app/templates/digitalagency/components/CTA.tsx +40 -74
  24. package/dist/kits/blocks/app/templates/digitalagency/components/Contact.tsx +123 -227
  25. package/dist/kits/blocks/app/templates/digitalagency/components/Footer.tsx +89 -89
  26. package/dist/kits/blocks/app/templates/digitalagency/components/Hero.tsx +83 -90
  27. package/dist/kits/blocks/app/templates/digitalagency/components/Navbar.tsx +121 -168
  28. package/dist/kits/blocks/app/templates/digitalagency/components/NetworkPattern.tsx +288 -297
  29. package/dist/kits/blocks/app/templates/digitalagency/components/Portfolio.tsx +157 -157
  30. package/dist/kits/blocks/app/templates/digitalagency/components/Pricing.tsx +114 -114
  31. package/dist/kits/blocks/app/templates/digitalagency/components/Process.tsx +59 -59
  32. package/dist/kits/blocks/app/templates/digitalagency/components/Services.tsx +55 -55
  33. package/dist/kits/blocks/app/templates/digitalagency/components/Team.tsx +28 -28
  34. package/dist/kits/blocks/app/templates/digitalagency/components/Testimonials.tsx +65 -65
  35. package/dist/kits/blocks/app/templates/digitalagency/page.tsx +38 -38
  36. package/dist/kits/blocks/app/templates/gallery/PresetThemeVars.tsx +130 -85
  37. package/dist/kits/blocks/app/templates/gallery/page.tsx +357 -303
  38. package/dist/kits/blocks/app/templates/productlaunch/PresetThemeVars.tsx +75 -74
  39. package/dist/kits/blocks/app/templates/productlaunch/README.md +62 -55
  40. package/dist/kits/blocks/app/templates/productlaunch/components/About.tsx +84 -178
  41. package/dist/kits/blocks/app/templates/productlaunch/components/CTA.tsx +50 -93
  42. package/dist/kits/blocks/app/templates/productlaunch/components/Contact.tsx +231 -231
  43. package/dist/kits/blocks/app/templates/productlaunch/components/FAQ.tsx +86 -93
  44. package/dist/kits/blocks/app/templates/productlaunch/components/Features.tsx +83 -84
  45. package/dist/kits/blocks/app/templates/productlaunch/components/Footer.tsx +132 -132
  46. package/dist/kits/blocks/app/templates/productlaunch/components/Hero.tsx +88 -89
  47. package/dist/kits/blocks/app/templates/productlaunch/components/Navbar.tsx +116 -162
  48. package/dist/kits/blocks/app/templates/productlaunch/components/Pricing.tsx +106 -106
  49. package/dist/kits/blocks/app/templates/productlaunch/components/ProcessTimeline.tsx +110 -110
  50. package/dist/kits/blocks/app/templates/productlaunch/components/ServicesGrid.tsx +68 -68
  51. package/dist/kits/blocks/app/templates/productlaunch/components/Team.tsx +104 -104
  52. package/dist/kits/blocks/app/templates/productlaunch/components/Testimonials.tsx +90 -89
  53. package/dist/kits/blocks/app/templates/productlaunch/components/TrustBadges.tsx +76 -76
  54. package/dist/kits/blocks/app/templates/productlaunch/page.tsx +43 -43
  55. package/dist/kits/blocks/app/templates/saasdashboard/PresetThemeVars.tsx +80 -80
  56. package/dist/kits/blocks/app/templates/saasdashboard/README.md +44 -38
  57. package/dist/kits/blocks/app/templates/saasdashboard/components/Contact.tsx +129 -176
  58. package/dist/kits/blocks/app/templates/saasdashboard/components/Dashboard.tsx +293 -293
  59. package/dist/kits/blocks/app/templates/saasdashboard/components/FAQ.tsx +55 -55
  60. package/dist/kits/blocks/app/templates/saasdashboard/components/Features.tsx +90 -91
  61. package/dist/kits/blocks/app/templates/saasdashboard/components/Footer.tsx +77 -77
  62. package/dist/kits/blocks/app/templates/saasdashboard/components/Hero.tsx +104 -105
  63. package/dist/kits/blocks/app/templates/saasdashboard/components/Hero_mask.tsx +126 -127
  64. package/dist/kits/blocks/app/templates/saasdashboard/components/Navbar.tsx +117 -159
  65. package/dist/kits/blocks/app/templates/saasdashboard/components/Pricing.tsx +90 -90
  66. package/dist/kits/blocks/app/templates/saasdashboard/components/SmoothScroll.tsx +96 -97
  67. package/dist/kits/blocks/app/templates/saasdashboard/components/Testimonials.tsx +72 -72
  68. package/dist/kits/blocks/app/templates/saasdashboard/components/TrustBadges.tsx +53 -53
  69. package/dist/kits/blocks/app/templates/saasdashboard/page.tsx +39 -39
  70. package/dist/kits/blocks/components/enhanced-theme-provider.tsx +195 -183
  71. package/dist/kits/blocks/components/providers/BlocksAppProviders.tsx +27 -27
  72. package/dist/kits/blocks/components/sections/About.tsx +291 -291
  73. package/dist/kits/blocks/components/sections/CTA.tsx +257 -258
  74. package/dist/kits/blocks/components/sections/CommandShowcase.tsx +517 -0
  75. package/dist/kits/blocks/components/sections/Contact.tsx +267 -267
  76. package/dist/kits/blocks/components/sections/FAQ.tsx +214 -225
  77. package/dist/kits/blocks/components/sections/FeaturedProjectShowcase.tsx +687 -0
  78. package/dist/kits/blocks/components/sections/Features.tsx +268 -270
  79. package/dist/kits/blocks/components/sections/Footer.tsx +302 -302
  80. package/dist/kits/blocks/components/sections/HeroMotion.tsx +308 -308
  81. package/dist/kits/blocks/components/sections/HeroOverlay.tsx +358 -358
  82. package/dist/kits/blocks/components/sections/HeroProductDemo.tsx +246 -0
  83. package/dist/kits/blocks/components/sections/HeroSplit.tsx +352 -352
  84. package/dist/kits/blocks/components/sections/HeroWithVideo.tsx +495 -0
  85. package/dist/kits/blocks/components/sections/Navbar.tsx +352 -353
  86. package/dist/kits/blocks/components/sections/PortfolioSimple.tsx +549 -550
  87. package/dist/kits/blocks/components/sections/Pricing.tsx +264 -264
  88. package/dist/kits/blocks/components/sections/ProcessTimeline.tsx +325 -325
  89. package/dist/kits/blocks/components/sections/ProjectDeepDive.tsx +805 -0
  90. package/dist/kits/blocks/components/sections/SelectedWorkRail.tsx +485 -0
  91. package/dist/kits/blocks/components/sections/ServicesGrid.tsx +210 -210
  92. package/dist/kits/blocks/components/sections/Team.tsx +309 -309
  93. package/dist/kits/blocks/components/sections/Testimonials.tsx +158 -158
  94. package/dist/kits/blocks/components/sections/TrustBadges.tsx +162 -162
  95. package/dist/kits/blocks/components/sections/product-demo/ApprovalInboxPanel.tsx +128 -0
  96. package/dist/kits/blocks/components/sections/product-demo/DemoStage.tsx +519 -0
  97. package/dist/kits/blocks/components/sections/product-demo/DemoWindow.tsx +140 -0
  98. package/dist/kits/blocks/components/sections/product-demo/KnowledgePanel.tsx +130 -0
  99. package/dist/kits/blocks/components/sections/product-demo/RunConsolePanel.tsx +430 -0
  100. package/dist/kits/blocks/components/sections/product-demo/TaskListPanel.tsx +302 -0
  101. package/dist/kits/blocks/components/sections/product-demo/WorkflowStudioPanel.tsx +744 -0
  102. package/dist/kits/blocks/components/sections/product-demo/types.ts +262 -0
  103. package/dist/kits/blocks/components/theme-provider.tsx +1 -34
  104. package/dist/kits/blocks/components/ui/alert-dialog.tsx +134 -134
  105. package/dist/kits/blocks/components/ui/brand-node.tsx +121 -121
  106. package/dist/kits/blocks/components/ui/button.tsx +122 -122
  107. package/dist/kits/blocks/components/ui/card.tsx +95 -95
  108. package/dist/kits/blocks/components/ui/checkbox.tsx +30 -30
  109. package/dist/kits/blocks/components/ui/cta-button.tsx +125 -125
  110. package/dist/kits/blocks/components/ui/dropdown-menu.tsx +201 -201
  111. package/dist/kits/blocks/components/ui/feature-card.tsx +91 -91
  112. package/dist/kits/blocks/components/ui/input.tsx +27 -27
  113. package/dist/kits/blocks/components/ui/label.tsx +29 -29
  114. package/dist/kits/blocks/components/ui/pricing-card.tsx +120 -120
  115. package/dist/kits/blocks/components/ui/select.tsx +25 -25
  116. package/dist/kits/blocks/components/ui/skeleton.tsx +13 -13
  117. package/dist/kits/blocks/components/ui/table.tsx +98 -98
  118. package/dist/kits/blocks/components/ui/testimonial-card.tsx +108 -108
  119. package/dist/kits/blocks/components/ui/textarea.tsx +26 -26
  120. package/dist/kits/blocks/components/ui/theme-selector.tsx +243 -247
  121. package/dist/kits/blocks/components/ui/theme-toggle.tsx +74 -74
  122. package/dist/kits/blocks/components/ui/toaster.tsx +7 -7
  123. package/dist/kits/blocks/lib/themes.ts +400 -400
  124. package/dist/kits/blocks/lib/utils.ts +6 -9
  125. package/dist/kits/blocks/package-deps.json +40 -28
  126. package/dist/kits/blocks/tsconfig.json +11 -0
  127. package/dist/kits/blocks/tsconfig.tsbuildinfo +1 -0
  128. package/dist/utils/file-operations.d.ts +3 -1
  129. package/dist/utils/file-operations.d.ts.map +1 -1
  130. package/dist/utils/file-operations.js +84 -12
  131. package/dist/utils/file-operations.js.map +1 -1
  132. package/dist/utils/installation-tracker.d.ts +2 -2
  133. package/dist/utils/installation-tracker.d.ts.map +1 -1
  134. package/dist/utils/installation-tracker.js +11 -11
  135. package/dist/utils/installation-tracker.js.map +1 -1
  136. package/dist/utils/package-manager.d.ts +6 -0
  137. package/dist/utils/package-manager.d.ts.map +1 -0
  138. package/dist/utils/package-manager.js +58 -0
  139. package/dist/utils/package-manager.js.map +1 -0
  140. package/dist/utils/yarn-pnp.d.ts +6 -0
  141. package/dist/utils/yarn-pnp.d.ts.map +1 -0
  142. package/dist/utils/yarn-pnp.js +39 -0
  143. package/dist/utils/yarn-pnp.js.map +1 -0
  144. package/package.json +5 -2
  145. package/dist/kits/blocks/notes/THEME_GUIDE.md +0 -29
@@ -1,308 +1,308 @@
1
- "use client";
2
-
3
- import React from "react";
4
- import Link from "next/link";
5
- import { motion } from "motion/react";
6
- import { Button } from "@/components/ui/button";
7
- import { cn } from "@/lib/utils";
8
-
9
- /**
10
- * Props for the HeroMotion component.
11
- *
12
- * @remarks
13
- * - Styling: exposes slot-style className overrides merged via cn().
14
- * - Motion: controlled by enableMotion and motionOptions; respects
15
- * prefers-reduced-motion by allowing disabling transforms.
16
- * - Accessibility: rendered as a semantic <section> with aria-label.
17
- * - CTA: primary/secondary CTA can be links (href provided) or buttons.
18
- */
19
- type MotionTransition = React.ComponentProps<typeof motion.div>["transition"];
20
-
21
- export interface HeroMotionProps {
22
- /** Optional id to attach to the section root */
23
- id?: string;
24
- /** ARIA label for the section. @defaultValue "Hero section" */
25
- ariaLabel?: string;
26
- /** Optional top-level class to override the root */
27
- className?: string;
28
-
29
- /** Primary heading text. Ignored when headingNode is provided. */
30
- heading?: string;
31
- /** Custom heading node; use for advanced layouts or styling. */
32
- headingNode?: React.ReactNode;
33
- /** Inline highlight node rendered next to heading text. */
34
- highlight?: React.ReactNode;
35
- /** Optional description paragraph/node */
36
- description?: React.ReactNode;
37
-
38
- /** Primary call to action config or null to hide */
39
- primaryCta?: { label: string; href?: string } | null;
40
- /** Secondary call to action config or null to hide */
41
- secondaryCta?: { label: string; href?: string } | null;
42
-
43
- /** Slot-style overrides */
44
- section?: { className?: string };
45
- container?: { className?: string };
46
- content?: { className?: string };
47
- headingText?: { className?: string };
48
- highlightText?: { className?: string };
49
- descriptionText?: { className?: string };
50
- actions?: { className?: string };
51
- primaryButtonStyle?: {
52
- unstyled?: boolean;
53
- style?: React.CSSProperties;
54
- variant?:
55
- | "default"
56
- | "destructive"
57
- | "outline"
58
- | "secondary"
59
- | "ghost"
60
- | "link";
61
- size?: "default" | "sm" | "lg" | "icon";
62
- className?: string;
63
- };
64
- secondaryButtonStyle?: {
65
- unstyled?: boolean;
66
- style?: React.CSSProperties;
67
- variant?:
68
- | "default"
69
- | "destructive"
70
- | "outline"
71
- | "secondary"
72
- | "ghost"
73
- | "link";
74
- size?: "default" | "sm" | "lg" | "icon";
75
- className?: string;
76
- };
77
-
78
- /** Optional background node (e.g., SVGs, gradients, images) */
79
- backgroundNode?: React.ReactNode;
80
-
81
- /** When false, disables entrance animations */
82
- enableMotion?: boolean;
83
-
84
- /** Motion configuration for entrance sequences */
85
- motionOptions?: {
86
- viewport?: { once?: boolean; amount?: number };
87
- headingDelay?: number;
88
- descriptionDelay?: number;
89
- actionsDelay?: number;
90
- transition: MotionTransition;
91
- };
92
- }
93
-
94
- const defaultChildTransition: MotionTransition = {
95
- type: "tween",
96
- duration: 0.5,
97
- ease: [0.22, 1, 0.36, 1], // smooth easeOut
98
- };
99
-
100
- /**
101
- * Motion-first hero with heading/highlight, optional description and CTAs.
102
- *
103
- * @remarks
104
- * - Styling: slot-style className overrides are merged after defaults via cn().
105
- * - Motion: enableMotion toggles entrance transitions; motionOptions controls
106
- * delays and viewport.
107
- * - Accessibility: semantic <section> with aria-label.
108
- *
109
- * @example
110
- * <HeroMotion
111
- * heading="Supercharge growth with"
112
- * highlight="AI-powered insights"
113
- * primaryCta={{ label: 'Get Started', href: '#contact' }}
114
- * />
115
- */
116
- export function HeroMotion({
117
- id,
118
- ariaLabel = "Hero section",
119
- className,
120
- heading = "Supercharge growth with",
121
- headingNode,
122
- highlight = "AI-powered insights",
123
- description = (
124
- <>
125
- Real-time trends, accurate user signals, and smarter, data-driven
126
- decisions.
127
- </>
128
- ),
129
- primaryCta = { label: "Get Started" },
130
- secondaryCta = { label: "See Demo" },
131
- section = { className: "bg-background relative overflow-hidden" },
132
- container = { className: "mx-auto max-w-7xl px-6 py-24 sm:py-28 lg:py-32" },
133
- content = { className: "mx-auto max-w-3xl text-center" },
134
- headingText = {
135
- className:
136
- "transform-gpu will-change-transform text-foreground text-4xl font-semibold tracking-tight text-balance sm:text-5xl md:text-6xl",
137
- },
138
- highlightText = {
139
- className:
140
- "from-primary via-primary/80 to-primary/60 bg-gradient-to-r bg-clip-text text-transparent",
141
- },
142
- descriptionText = {
143
- className:
144
- "transform-gpu will-change-transform text-muted-foreground mt-5 text-base text-pretty sm:text-lg",
145
- },
146
- actions = { className: "mt-8 flex items-center justify-center gap-3" },
147
- primaryButtonStyle = { size: "lg", variant: "default", className: "" },
148
- secondaryButtonStyle = { size: "lg", variant: "outline", className: "" },
149
- enableMotion = true,
150
- motionOptions = {
151
- viewport: { once: true, amount: 0.25 },
152
- headingDelay: 0.5,
153
- descriptionDelay: 0.58,
154
- actionsDelay: 0.66,
155
- transition: defaultChildTransition,
156
- },
157
- backgroundNode,
158
- }: HeroMotionProps) {
159
- const viewport = enableMotion
160
- ? {
161
- once: motionOptions?.viewport?.once ?? true,
162
- amount: motionOptions?.viewport?.amount ?? 0.25,
163
- }
164
- : { once: true, amount: 0 };
165
-
166
- const transition: MotionTransition = {
167
- ...defaultChildTransition,
168
- ...(motionOptions?.transition ?? {}),
169
- };
170
-
171
- return (
172
- <section
173
- id={id}
174
- aria-label={ariaLabel}
175
- className={cn(section.className, className)}
176
- >
177
- {backgroundNode}
178
- <div className={cn(container.className)}>
179
- <motion.div className={cn(content.className)}>
180
- <motion.h1
181
- initial={
182
- enableMotion ? { opacity: 0, y: 12 } : { opacity: 1, y: 0 }
183
- }
184
- whileInView={{ opacity: 1, y: 0 }}
185
- viewport={viewport}
186
- transition={
187
- enableMotion
188
- ? { ...transition, delay: motionOptions?.headingDelay ?? 0.5 }
189
- : { type: "tween", duration: 0 }
190
- }
191
- className={cn(headingText.className)}
192
- >
193
- {headingNode ? (
194
- headingNode
195
- ) : (
196
- <>
197
- {heading}
198
- {highlight ? (
199
- <span className={cn(highlightText.className)}>
200
- {" "}
201
- {highlight}
202
- </span>
203
- ) : null}
204
- </>
205
- )}
206
- </motion.h1>
207
-
208
- {description ? (
209
- <motion.p
210
- initial={
211
- enableMotion ? { opacity: 0, y: 10 } : { opacity: 1, y: 0 }
212
- }
213
- whileInView={{ opacity: 1, y: 0 }}
214
- viewport={viewport}
215
- transition={
216
- enableMotion
217
- ? {
218
- ...transition,
219
- delay: motionOptions?.descriptionDelay ?? 0.58,
220
- }
221
- : { type: "tween", duration: 0 }
222
- }
223
- className={cn(descriptionText.className)}
224
- >
225
- {description}
226
- </motion.p>
227
- ) : null}
228
-
229
- {(primaryCta || secondaryCta) && (
230
- <motion.div
231
- initial={
232
- enableMotion ? { opacity: 0, y: 10 } : { opacity: 1, y: 0 }
233
- }
234
- whileInView={{ opacity: 1, y: 0 }}
235
- viewport={viewport}
236
- transition={
237
- enableMotion
238
- ? {
239
- ...transition,
240
- delay: motionOptions?.actionsDelay ?? 0.66,
241
- }
242
- : { type: "tween", duration: 0 }
243
- }
244
- className={cn(actions.className)}
245
- >
246
- {primaryCta &&
247
- (primaryCta.href ? (
248
- <Button
249
- asChild
250
- unstyled={primaryButtonStyle.unstyled}
251
- variant={primaryButtonStyle.variant}
252
- size={primaryButtonStyle.size}
253
- className={cn(primaryButtonStyle.className)}
254
- style={primaryButtonStyle.style}
255
- >
256
- <Link href={primaryCta.href} aria-label={primaryCta.label}>
257
- {primaryCta.label}
258
- </Link>
259
- </Button>
260
- ) : (
261
- <Button
262
- variant={primaryButtonStyle.variant}
263
- size={primaryButtonStyle.size}
264
- className={cn(primaryButtonStyle.className)}
265
- unstyled={primaryButtonStyle.unstyled}
266
- style={primaryButtonStyle.style}
267
- aria-label={primaryCta.label}
268
- >
269
- {primaryCta.label}
270
- </Button>
271
- ))}
272
-
273
- {secondaryCta &&
274
- (secondaryCta.href ? (
275
- <Button
276
- asChild
277
- unstyled={secondaryButtonStyle.unstyled}
278
- variant={secondaryButtonStyle.variant}
279
- size={secondaryButtonStyle.size}
280
- className={cn(secondaryButtonStyle.className)}
281
- style={secondaryButtonStyle.style}
282
- >
283
- <Link
284
- href={secondaryCta.href}
285
- aria-label={secondaryCta.label}
286
- >
287
- {secondaryCta.label}
288
- </Link>
289
- </Button>
290
- ) : (
291
- <Button
292
- variant={secondaryButtonStyle.variant}
293
- size={secondaryButtonStyle.size}
294
- className={cn(secondaryButtonStyle.className)}
295
- unstyled={secondaryButtonStyle.unstyled}
296
- style={secondaryButtonStyle.style}
297
- aria-label={secondaryCta.label}
298
- >
299
- {secondaryCta.label}
300
- </Button>
301
- ))}
302
- </motion.div>
303
- )}
304
- </motion.div>
305
- </div>
306
- </section>
307
- );
308
- }
1
+ "use client";
2
+
3
+ import React from "react";
4
+ import Link from "next/link";
5
+ import { motion } from "motion/react";
6
+ import { Button } from "@/components/ui/button";
7
+ import { cn } from "@/lib/utils";
8
+
9
+ /**
10
+ * Props for the HeroMotion component.
11
+ *
12
+ * @remarks
13
+ * - Styling: exposes slot-style className overrides merged via cn().
14
+ * - Motion: controlled by enableMotion and motionOptions; respects
15
+ * prefers-reduced-motion by allowing disabling transforms.
16
+ * - Accessibility: rendered as a semantic <section> with aria-label.
17
+ * - CTA: primary/secondary CTA can be links (href provided) or buttons.
18
+ */
19
+ type MotionTransition = React.ComponentProps<typeof motion.div>["transition"];
20
+
21
+ export interface HeroMotionProps {
22
+ /** Optional id to attach to the section root */
23
+ id?: string;
24
+ /** ARIA label for the section. @defaultValue "Hero section" */
25
+ ariaLabel?: string;
26
+ /** Optional top-level class to override the root */
27
+ className?: string;
28
+
29
+ /** Primary heading text. Ignored when headingNode is provided. */
30
+ heading?: string;
31
+ /** Custom heading node; use for advanced layouts or styling. */
32
+ headingNode?: React.ReactNode;
33
+ /** Inline highlight node rendered next to heading text. */
34
+ highlight?: React.ReactNode;
35
+ /** Optional description paragraph/node */
36
+ description?: React.ReactNode;
37
+
38
+ /** Primary call to action config or null to hide */
39
+ primaryCta?: { label: string; href?: string } | null;
40
+ /** Secondary call to action config or null to hide */
41
+ secondaryCta?: { label: string; href?: string } | null;
42
+
43
+ /** Slot-style overrides */
44
+ section?: { className?: string };
45
+ container?: { className?: string };
46
+ content?: { className?: string };
47
+ headingText?: { className?: string };
48
+ highlightText?: { className?: string };
49
+ descriptionText?: { className?: string };
50
+ actions?: { className?: string };
51
+ primaryButtonStyle?: {
52
+ unstyled?: boolean;
53
+ style?: React.CSSProperties;
54
+ variant?:
55
+ | "default"
56
+ | "destructive"
57
+ | "outline"
58
+ | "secondary"
59
+ | "ghost"
60
+ | "link";
61
+ size?: "default" | "sm" | "lg" | "icon";
62
+ className?: string;
63
+ };
64
+ secondaryButtonStyle?: {
65
+ unstyled?: boolean;
66
+ style?: React.CSSProperties;
67
+ variant?:
68
+ | "default"
69
+ | "destructive"
70
+ | "outline"
71
+ | "secondary"
72
+ | "ghost"
73
+ | "link";
74
+ size?: "default" | "sm" | "lg" | "icon";
75
+ className?: string;
76
+ };
77
+
78
+ /** Optional background node (e.g., SVGs, gradients, images) */
79
+ backgroundNode?: React.ReactNode;
80
+
81
+ /** When false, disables entrance animations */
82
+ enableMotion?: boolean;
83
+
84
+ /** Motion configuration for entrance sequences */
85
+ motionOptions?: {
86
+ viewport?: { once?: boolean; amount?: number };
87
+ headingDelay?: number;
88
+ descriptionDelay?: number;
89
+ actionsDelay?: number;
90
+ transition: MotionTransition;
91
+ };
92
+ }
93
+
94
+ const defaultChildTransition: MotionTransition = {
95
+ type: "tween",
96
+ duration: 0.5,
97
+ ease: [0.22, 1, 0.36, 1],
98
+ };
99
+
100
+ /**
101
+ * Motion-first hero with heading/highlight, optional description and CTAs.
102
+ *
103
+ * @remarks
104
+ * - Styling: slot-style className overrides are merged after defaults via cn().
105
+ * - Motion: enableMotion toggles entrance transitions; motionOptions controls
106
+ * delays and viewport.
107
+ * - Accessibility: semantic <section> with aria-label.
108
+ *
109
+ * @example
110
+ * <HeroMotion
111
+ * heading="Supercharge growth with"
112
+ * highlight="AI-powered insights"
113
+ * primaryCta={{ label: 'Get Started', href: '#contact' }}
114
+ * />
115
+ */
116
+ export function HeroMotion({
117
+ id,
118
+ ariaLabel = "Hero section",
119
+ className,
120
+ heading = "Supercharge growth with",
121
+ headingNode,
122
+ highlight = "AI-powered insights",
123
+ description = (
124
+ <>
125
+ Real-time trends, accurate user signals, and smarter, data-driven
126
+ decisions.
127
+ </>
128
+ ),
129
+ primaryCta = { label: "Get Started" },
130
+ secondaryCta = { label: "See Demo" },
131
+ section = { className: "bg-background relative overflow-hidden" },
132
+ container = { className: "mx-auto max-w-7xl px-6 py-24 sm:py-28 lg:py-32" },
133
+ content = { className: "mx-auto max-w-3xl text-center" },
134
+ headingText = {
135
+ className:
136
+ "transform-gpu will-change-transform text-foreground text-4xl font-semibold tracking-tight text-balance sm:text-5xl md:text-6xl",
137
+ },
138
+ highlightText = {
139
+ className:
140
+ "from-primary via-primary/80 to-primary/60 bg-gradient-to-r bg-clip-text text-transparent",
141
+ },
142
+ descriptionText = {
143
+ className:
144
+ "transform-gpu will-change-transform text-muted-foreground mt-5 text-base text-pretty sm:text-lg",
145
+ },
146
+ actions = { className: "mt-8 flex items-center justify-center gap-3" },
147
+ primaryButtonStyle = { size: "lg", variant: "default", className: "" },
148
+ secondaryButtonStyle = { size: "lg", variant: "outline", className: "" },
149
+ enableMotion = true,
150
+ motionOptions = {
151
+ viewport: { once: true, amount: 0.25 },
152
+ headingDelay: 0.5,
153
+ descriptionDelay: 0.58,
154
+ actionsDelay: 0.66,
155
+ transition: defaultChildTransition,
156
+ },
157
+ backgroundNode,
158
+ }: HeroMotionProps) {
159
+ const viewport = enableMotion
160
+ ? {
161
+ once: motionOptions?.viewport?.once ?? true,
162
+ amount: motionOptions?.viewport?.amount ?? 0.25,
163
+ }
164
+ : { once: true, amount: 0 };
165
+
166
+ const transition: MotionTransition = {
167
+ ...defaultChildTransition,
168
+ ...(motionOptions?.transition ?? {}),
169
+ };
170
+
171
+ return (
172
+ <section
173
+ id={id}
174
+ aria-label={ariaLabel}
175
+ className={cn(section.className, className)}
176
+ >
177
+ {backgroundNode}
178
+ <div className={cn(container.className)}>
179
+ <motion.div className={cn(content.className)}>
180
+ <motion.h1
181
+ initial={
182
+ enableMotion ? { opacity: 0, y: 12 } : { opacity: 1, y: 0 }
183
+ }
184
+ whileInView={{ opacity: 1, y: 0 }}
185
+ viewport={viewport}
186
+ transition={
187
+ enableMotion
188
+ ? { ...transition, delay: motionOptions?.headingDelay ?? 0.5 }
189
+ : { type: "tween", duration: 0 }
190
+ }
191
+ className={cn(headingText.className)}
192
+ >
193
+ {headingNode ? (
194
+ headingNode
195
+ ) : (
196
+ <>
197
+ {heading}
198
+ {highlight ? (
199
+ <span className={cn(highlightText.className)}>
200
+ {" "}
201
+ {highlight}
202
+ </span>
203
+ ) : null}
204
+ </>
205
+ )}
206
+ </motion.h1>
207
+
208
+ {description ? (
209
+ <motion.p
210
+ initial={
211
+ enableMotion ? { opacity: 0, y: 10 } : { opacity: 1, y: 0 }
212
+ }
213
+ whileInView={{ opacity: 1, y: 0 }}
214
+ viewport={viewport}
215
+ transition={
216
+ enableMotion
217
+ ? {
218
+ ...transition,
219
+ delay: motionOptions?.descriptionDelay ?? 0.58,
220
+ }
221
+ : { type: "tween", duration: 0 }
222
+ }
223
+ className={cn(descriptionText.className)}
224
+ >
225
+ {description}
226
+ </motion.p>
227
+ ) : null}
228
+
229
+ {(primaryCta || secondaryCta) && (
230
+ <motion.div
231
+ initial={
232
+ enableMotion ? { opacity: 0, y: 10 } : { opacity: 1, y: 0 }
233
+ }
234
+ whileInView={{ opacity: 1, y: 0 }}
235
+ viewport={viewport}
236
+ transition={
237
+ enableMotion
238
+ ? {
239
+ ...transition,
240
+ delay: motionOptions?.actionsDelay ?? 0.66,
241
+ }
242
+ : { type: "tween", duration: 0 }
243
+ }
244
+ className={cn(actions.className)}
245
+ >
246
+ {primaryCta &&
247
+ (primaryCta.href ? (
248
+ <Button
249
+ asChild
250
+ unstyled={primaryButtonStyle.unstyled}
251
+ variant={primaryButtonStyle.variant}
252
+ size={primaryButtonStyle.size}
253
+ className={cn(primaryButtonStyle.className)}
254
+ style={primaryButtonStyle.style}
255
+ >
256
+ <Link href={primaryCta.href} aria-label={primaryCta.label}>
257
+ {primaryCta.label}
258
+ </Link>
259
+ </Button>
260
+ ) : (
261
+ <Button
262
+ variant={primaryButtonStyle.variant}
263
+ size={primaryButtonStyle.size}
264
+ className={cn(primaryButtonStyle.className)}
265
+ unstyled={primaryButtonStyle.unstyled}
266
+ style={primaryButtonStyle.style}
267
+ aria-label={primaryCta.label}
268
+ >
269
+ {primaryCta.label}
270
+ </Button>
271
+ ))}
272
+
273
+ {secondaryCta &&
274
+ (secondaryCta.href ? (
275
+ <Button
276
+ asChild
277
+ unstyled={secondaryButtonStyle.unstyled}
278
+ variant={secondaryButtonStyle.variant}
279
+ size={secondaryButtonStyle.size}
280
+ className={cn(secondaryButtonStyle.className)}
281
+ style={secondaryButtonStyle.style}
282
+ >
283
+ <Link
284
+ href={secondaryCta.href}
285
+ aria-label={secondaryCta.label}
286
+ >
287
+ {secondaryCta.label}
288
+ </Link>
289
+ </Button>
290
+ ) : (
291
+ <Button
292
+ variant={secondaryButtonStyle.variant}
293
+ size={secondaryButtonStyle.size}
294
+ className={cn(secondaryButtonStyle.className)}
295
+ unstyled={secondaryButtonStyle.unstyled}
296
+ style={secondaryButtonStyle.style}
297
+ aria-label={secondaryCta.label}
298
+ >
299
+ {secondaryCta.label}
300
+ </Button>
301
+ ))}
302
+ </motion.div>
303
+ )}
304
+ </motion.div>
305
+ </div>
306
+ </section>
307
+ );
308
+ }