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,270 +1,268 @@
1
- "use client";
2
-
3
- import React from "react";
4
- import { motion } from "motion/react";
5
- import { cn } from "@/lib/utils";
6
- import { FeatureCard } from "@/components/ui/feature-card";
7
-
8
- /**
9
- * Data used to render a FeatureCard within the Features grid.
10
- * @public
11
- */
12
- export interface FeatureCardData {
13
- imageSrc: string;
14
- imageAlt: string;
15
- headingText: string;
16
- subheadingText: string;
17
- }
18
-
19
- /**
20
- * Props for the Features section component.
21
- *
22
- * @remarks
23
- * - Styling: slot-style className overrides are merged after defaults via cn().
24
- * - Motion: entrance animations respect enableMotion; prefers-reduced-motion
25
- * disables transforms and transitions where possible.
26
- *
27
- * @public
28
- */
29
- type MotionTransition = React.ComponentProps<typeof motion.div>["transition"];
30
-
31
- export interface FeaturesProps {
32
- /**
33
- * Optional id to attach to the root section element.
34
- * @defaultValue "features"
35
- */
36
- id?: string;
37
-
38
- /** Main section heading text */
39
- sectionHeading?: string;
40
- /** Subheading text displayed below the main heading */
41
- sectionSubheading?: string;
42
-
43
- /** Array of feature card data objects */
44
- featuresData?: FeatureCardData[];
45
-
46
- /** Optional top-level class to override the section root */
47
- className?: string;
48
-
49
- /** Styling configuration objects (slots) */
50
- section?: { className?: string };
51
- container?: { className?: string };
52
- header?: { className?: string };
53
- heading?: { className?: string };
54
- subheading?: { className?: string };
55
- grid?: { className?: string };
56
- /** Wrapper around each FeatureCard (the animated container) */
57
- cardWrapper?: { className?: string };
58
- /** Styles passed down to FeatureCard slots */
59
- card?: { className?: string };
60
- image?: { className?: string };
61
- cardHeading?: { className?: string };
62
- cardSubheading?: { className?: string };
63
-
64
- /** When false, disables entrance animations and hover transitions. */
65
- enableMotion?: boolean;
66
-
67
- /** Motion configuration for the feature items */
68
- motionConfig?: {
69
- initial?: { opacity?: number; y?: number };
70
- whileInView?: { opacity?: number; y?: number };
71
- viewport?: { once?: boolean; amount?: number };
72
- transition?: MotionTransition;
73
- };
74
-
75
- /** ARIA label for the features section */
76
- ariaLabel?: string;
77
- }
78
-
79
- const defaultFeaturesData: FeatureCardData[] = [
80
- {
81
- imageSrc: "/feature_1.png",
82
- imageAlt: "Advanced Analytics Dashboard",
83
- headingText: "Advanced Analytics",
84
- subheadingText:
85
- "Get deep insights into your business performance with our comprehensive analytics dashboard that tracks key metrics and provides actionable recommendations.",
86
- },
87
- {
88
- imageSrc: "/feature_2.png",
89
- imageAlt: "Real-time Collaboration Tools",
90
- headingText: "Real-time Collaboration",
91
- subheadingText:
92
- "Work seamlessly with your team using our real-time collaboration tools that keep everyone in sync and boost productivity across all projects.",
93
- },
94
- {
95
- imageSrc: "/feature_3.png",
96
- imageAlt: "Secure Data Management",
97
- headingText: "Secure Data Management",
98
- subheadingText:
99
- "Protect your sensitive information with enterprise-grade security features including encryption, access controls, and compliance monitoring.",
100
- },
101
- {
102
- imageSrc: "/feature_4.png",
103
- imageAlt: "Mobile-First Design",
104
- headingText: "Mobile-First Design",
105
- subheadingText:
106
- "Access your data and manage your workflow from anywhere with our responsive, mobile-optimized interface that works perfectly on all devices.",
107
- },
108
- ];
109
-
110
- /**
111
- * Responsive Features section that renders a heading, optional subheading,
112
- * and a grid of FeatureCard items with configurable entrance animations.
113
- *
114
- * @remarks
115
- * - Styling: slot-style className overrides are merged after defaults via cn().
116
- * - Motion: Controlled by enableMotion and motionConfig; animations are reduced
117
- * or disabled when users prefer reduced motion.
118
- * - Accessibility: Uses a semantic <section> with an aria-label.
119
- *
120
- * @example
121
- * <Features
122
- * sectionHeading="Key Features"
123
- * featuresData={[{ imageSrc: "/a.png", imageAlt: "", headingText: "Fast", subheadingText: "Blazing" }]}
124
- * />
125
- */
126
- export function Features({
127
- id = "features",
128
- sectionHeading = "Key Features",
129
- sectionSubheading = "Discover what makes our platform unique and powerful",
130
- featuresData = defaultFeaturesData,
131
-
132
- className,
133
-
134
- section = { className: "py-16 md:py-20 lg:py-24 bg-background" },
135
- container = { className: "max-w-7xl mx-auto px-4 md:px-6 lg:px-8" },
136
- header = { className: "text-center mb-12 md:mb-16" },
137
- heading = {
138
- className:
139
- "text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-4",
140
- },
141
- subheading = {
142
- className:
143
- "text-lg md:text-xl text-muted-foreground max-w-3xl mx-auto leading-relaxed",
144
- },
145
- grid = {
146
- className:
147
- "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-4 gap-6 md:gap-8",
148
- },
149
- cardWrapper = {
150
- className: "motion-reduce:transform-none motion-reduce:transition-none",
151
- },
152
- card = {
153
- className:
154
- "h-full bg-card border border-border rounded-lg shadow-md transition-all duration-200 hover:-translate-y-1 hover:shadow-lg overflow-hidden motion-reduce:transition-none motion-reduce:transform-none",
155
- },
156
- image = {
157
- className:
158
- "w-full h-48 md:h-56 object-cover transition-none hover:!scale-100 group-hover:!scale-100 [transform:none]",
159
- },
160
- cardHeading = {
161
- className:
162
- "text-xl md:text-2xl font-semibold text-card-foreground mb-3 leading-tight",
163
- },
164
- cardSubheading = {
165
- className: "text-sm md:text-base text-muted-foreground leading-relaxed",
166
- },
167
-
168
- enableMotion = true,
169
- motionConfig = {
170
- initial: { opacity: 0, y: 12 },
171
- whileInView: { opacity: 1, y: 0 },
172
- viewport: { once: true, amount: 0.2 },
173
- transition: {
174
- type: "tween",
175
- stiffness: 0,
176
- damping: 50,
177
- mass: 1,
178
- delay: 0.15,
179
- },
180
- },
181
- ariaLabel = "Features section",
182
- }: FeaturesProps) {
183
- return (
184
- <section
185
- id={id}
186
- className={cn(section.className, className)}
187
- aria-label={ariaLabel}
188
- >
189
- <div className={cn(container.className)}>
190
- <div className={cn(header.className)}>
191
- <h2 className={cn(heading.className)}>{sectionHeading}</h2>
192
- {sectionSubheading && (
193
- <p className={cn(subheading.className)}>{sectionSubheading}</p>
194
- )}
195
- </div>
196
-
197
- <div className={cn(grid.className)}>
198
- {featuresData.map((feature, index) => {
199
- const mConfig: NonNullable<FeaturesProps["motionConfig"]> =
200
- enableMotion
201
- ? (motionConfig as NonNullable<FeaturesProps["motionConfig"]>)
202
- : {
203
- initial: { opacity: 1, y: 0 },
204
- whileInView: { opacity: 1, y: 0 },
205
- viewport: { once: true, amount: 0 },
206
- transition: {
207
- type: "tween",
208
- duration: 0,
209
- } as const satisfies MotionTransition,
210
- };
211
-
212
- // Ensure we always spread a defined object into transition
213
- const baseTransition: MotionTransition = mConfig.transition ??
214
- ({
215
- type: "tween",
216
- duration: 0,
217
- } as const);
218
-
219
- const noMotionCard =
220
- "transition-none hover:!translate-y-0 hover:shadow-none motion-reduce:transition-none motion-reduce:transform-none";
221
- const noMotionImage =
222
- "transition-none hover:!scale-100 transform-none motion-reduce:transform-none group-hover:!scale-100";
223
-
224
- return (
225
- <motion.div
226
- key={index}
227
- initial={mConfig.initial}
228
- whileInView={mConfig.whileInView}
229
- viewport={mConfig.viewport}
230
- transition={{
231
- ...baseTransition,
232
- // Stagger based on index while preserving provided delay if any
233
- delay:
234
- (mConfig.transition?.delay ?? 0.15) +
235
- index * (enableMotion ? 0.06 : 0),
236
- }}
237
- className={cn(cardWrapper.className)}
238
- >
239
- <FeatureCard
240
- cardImageSrc={feature.imageSrc}
241
- cardImageAlt={feature.imageAlt}
242
- cardHeadingText={feature.headingText}
243
- cardSubheadingText={feature.subheadingText}
244
- card={{
245
- className: cn(
246
- card.className,
247
- !enableMotion && noMotionCard,
248
- ),
249
- }}
250
- image={{
251
- className: cn(
252
- image.className,
253
- !enableMotion && noMotionImage,
254
- ),
255
- }}
256
- // image={{
257
- // className: cn(image.className),
258
- // }}
259
- heading={{ className: cn(cardHeading.className) }}
260
- subheading={{ className: cn(cardSubheading.className) }}
261
- className={cn("h-full")}
262
- />
263
- </motion.div>
264
- );
265
- })}
266
- </div>
267
- </div>
268
- </section>
269
- );
270
- }
1
+ "use client";
2
+
3
+ import React from "react";
4
+ import { motion } from "motion/react";
5
+ import { cn } from "@/lib/utils";
6
+ import { FeatureCard } from "@/components/ui/feature-card";
7
+
8
+ /**
9
+ * Data used to render a FeatureCard within the Features grid.
10
+ * @public
11
+ */
12
+ export interface FeatureCardData {
13
+ imageSrc: string;
14
+ imageAlt: string;
15
+ headingText: string;
16
+ subheadingText: string;
17
+ }
18
+
19
+ /**
20
+ * Props for the Features section component.
21
+ *
22
+ * @remarks
23
+ * - Styling: slot-style className overrides are merged after defaults via cn().
24
+ * - Motion: entrance animations respect enableMotion; prefers-reduced-motion
25
+ * disables transforms and transitions where possible.
26
+ *
27
+ * @public
28
+ */
29
+ type MotionTransition = React.ComponentProps<typeof motion.div>["transition"];
30
+
31
+ export interface FeaturesProps {
32
+ /**
33
+ * Optional id to attach to the root section element.
34
+ * @defaultValue "features"
35
+ */
36
+ id?: string;
37
+
38
+ /** Main section heading text */
39
+ sectionHeading?: string;
40
+ /** Subheading text displayed below the main heading */
41
+ sectionSubheading?: string;
42
+
43
+ /** Array of feature card data objects */
44
+ featuresData?: FeatureCardData[];
45
+
46
+ /** Optional top-level class to override the section root */
47
+ className?: string;
48
+
49
+ /** Styling configuration objects (slots) */
50
+ section?: { className?: string };
51
+ container?: { className?: string };
52
+ header?: { className?: string };
53
+ heading?: { className?: string };
54
+ subheading?: { className?: string };
55
+ grid?: { className?: string };
56
+ /** Wrapper around each FeatureCard (the animated container) */
57
+ cardWrapper?: { className?: string };
58
+ /** Styles passed down to FeatureCard slots */
59
+ card?: { className?: string };
60
+ image?: { className?: string };
61
+ cardHeading?: { className?: string };
62
+ cardSubheading?: { className?: string };
63
+
64
+ /** When false, disables entrance animations and hover transitions. */
65
+ enableMotion?: boolean;
66
+
67
+ /** Motion configuration for the feature items */
68
+ motionConfig?: {
69
+ initial?: { opacity?: number; y?: number };
70
+ whileInView?: { opacity?: number; y?: number };
71
+ viewport?: { once?: boolean; amount?: number };
72
+ transition?: MotionTransition;
73
+ };
74
+
75
+ /** ARIA label for the features section */
76
+ ariaLabel?: string;
77
+ }
78
+
79
+ const defaultFeaturesData: FeatureCardData[] = [
80
+ {
81
+ imageSrc: "/feature_1.png",
82
+ imageAlt: "Advanced Analytics Dashboard",
83
+ headingText: "Advanced Analytics",
84
+ subheadingText:
85
+ "Get deep insights into your business performance with our comprehensive analytics dashboard that tracks key metrics and provides actionable recommendations.",
86
+ },
87
+ {
88
+ imageSrc: "/feature_2.png",
89
+ imageAlt: "Real-time Collaboration Tools",
90
+ headingText: "Real-time Collaboration",
91
+ subheadingText:
92
+ "Work seamlessly with your team using our real-time collaboration tools that keep everyone in sync and boost productivity across all projects.",
93
+ },
94
+ {
95
+ imageSrc: "/feature_3.png",
96
+ imageAlt: "Secure Data Management",
97
+ headingText: "Secure Data Management",
98
+ subheadingText:
99
+ "Protect your sensitive information with enterprise-grade security features including encryption, access controls, and compliance monitoring.",
100
+ },
101
+ {
102
+ imageSrc: "/feature_4.png",
103
+ imageAlt: "Mobile-First Design",
104
+ headingText: "Mobile-First Design",
105
+ subheadingText:
106
+ "Access your data and manage your workflow from anywhere with our responsive, mobile-optimized interface that works perfectly on all devices.",
107
+ },
108
+ ];
109
+
110
+ /**
111
+ * Responsive Features section that renders a heading, optional subheading,
112
+ * and a grid of FeatureCard items with configurable entrance animations.
113
+ *
114
+ * @remarks
115
+ * - Styling: slot-style className overrides are merged after defaults via cn().
116
+ * - Motion: Controlled by enableMotion and motionConfig; animations are reduced
117
+ * or disabled when users prefer reduced motion.
118
+ * - Accessibility: Uses a semantic <section> with an aria-label.
119
+ *
120
+ * @example
121
+ * <Features
122
+ * sectionHeading="Key Features"
123
+ * featuresData={[{ imageSrc: "/a.png", imageAlt: "", headingText: "Fast", subheadingText: "Blazing" }]}
124
+ * />
125
+ */
126
+ export function Features({
127
+ id = "features",
128
+ sectionHeading = "Key Features",
129
+ sectionSubheading = "Discover what makes our platform unique and powerful",
130
+ featuresData = defaultFeaturesData,
131
+
132
+ className,
133
+
134
+ section = { className: "py-16 md:py-20 lg:py-24 bg-background" },
135
+ container = { className: "max-w-7xl mx-auto px-4 md:px-6 lg:px-8" },
136
+ header = { className: "text-center mb-12 md:mb-16" },
137
+ heading = {
138
+ className:
139
+ "text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-4",
140
+ },
141
+ subheading = {
142
+ className:
143
+ "text-lg md:text-xl text-muted-foreground max-w-3xl mx-auto leading-relaxed",
144
+ },
145
+ grid = {
146
+ className:
147
+ "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-4 gap-6 md:gap-8",
148
+ },
149
+ cardWrapper = {
150
+ className: "motion-reduce:transform-none motion-reduce:transition-none",
151
+ },
152
+ card = {
153
+ className:
154
+ "h-full bg-card border border-border rounded-lg shadow-md transition-all duration-200 hover:-translate-y-1 hover:shadow-lg overflow-hidden motion-reduce:transition-none motion-reduce:transform-none",
155
+ },
156
+ image = {
157
+ className:
158
+ "w-full h-48 md:h-56 object-cover transition-none hover:!scale-100 group-hover:!scale-100 [transform:none]",
159
+ },
160
+ cardHeading = {
161
+ className:
162
+ "text-xl md:text-2xl font-semibold text-card-foreground mb-3 leading-tight",
163
+ },
164
+ cardSubheading = {
165
+ className: "text-sm md:text-base text-muted-foreground leading-relaxed",
166
+ },
167
+
168
+ enableMotion = true,
169
+ motionConfig = {
170
+ initial: { opacity: 0, y: 12 },
171
+ whileInView: { opacity: 1, y: 0 },
172
+ viewport: { once: true, amount: 0.2 },
173
+ transition: {
174
+ type: "tween",
175
+ stiffness: 0,
176
+ damping: 50,
177
+ mass: 1,
178
+ delay: 0.15,
179
+ },
180
+ },
181
+ ariaLabel = "Features section",
182
+ }: FeaturesProps) {
183
+ return (
184
+ <section
185
+ id={id}
186
+ className={cn(section.className, className)}
187
+ aria-label={ariaLabel}
188
+ >
189
+ <div className={cn(container.className)}>
190
+ <div className={cn(header.className)}>
191
+ <h2 className={cn(heading.className)}>{sectionHeading}</h2>
192
+ {sectionSubheading && (
193
+ <p className={cn(subheading.className)}>{sectionSubheading}</p>
194
+ )}
195
+ </div>
196
+
197
+ <div className={cn(grid.className)}>
198
+ {featuresData.map((feature, index) => {
199
+ const mConfig: NonNullable<FeaturesProps["motionConfig"]> =
200
+ enableMotion
201
+ ? (motionConfig as NonNullable<FeaturesProps["motionConfig"]>)
202
+ : {
203
+ initial: { opacity: 1, y: 0 },
204
+ whileInView: { opacity: 1, y: 0 },
205
+ viewport: { once: true, amount: 0 },
206
+ transition: {
207
+ type: "tween",
208
+ duration: 0,
209
+ } as const satisfies MotionTransition,
210
+ };
211
+
212
+ // Ensure we always spread a defined object into transition
213
+ const baseTransition: MotionTransition =
214
+ mConfig.transition ??
215
+ ({
216
+ type: "tween",
217
+ duration: 0,
218
+ } as const);
219
+
220
+ const noMotionCard =
221
+ "transition-none hover:!translate-y-0 hover:shadow-none motion-reduce:transition-none motion-reduce:transform-none";
222
+ const noMotionImage =
223
+ "transition-none hover:!scale-100 transform-none motion-reduce:transform-none group-hover:!scale-100";
224
+
225
+ return (
226
+ <motion.div
227
+ key={index}
228
+ initial={mConfig.initial}
229
+ whileInView={mConfig.whileInView}
230
+ viewport={mConfig.viewport}
231
+ transition={{
232
+ ...baseTransition,
233
+ // Stagger based on index while preserving provided delay if any
234
+ delay:
235
+ (mConfig.transition?.delay ?? 0.15) +
236
+ index * (enableMotion ? 0.06 : 0),
237
+ }}
238
+ className={cn(cardWrapper.className)}
239
+ >
240
+ <FeatureCard
241
+ cardImageSrc={feature.imageSrc}
242
+ cardImageAlt={feature.imageAlt}
243
+ cardHeadingText={feature.headingText}
244
+ cardSubheadingText={feature.subheadingText}
245
+ card={{
246
+ className: cn(
247
+ card.className,
248
+ !enableMotion && noMotionCard,
249
+ ),
250
+ }}
251
+ image={{
252
+ className: cn(
253
+ image.className,
254
+ !enableMotion && noMotionImage,
255
+ ),
256
+ }}
257
+ heading={{ className: cn(cardHeading.className) }}
258
+ subheading={{ className: cn(cardSubheading.className) }}
259
+ className={cn("h-full")}
260
+ />
261
+ </motion.div>
262
+ );
263
+ })}
264
+ </div>
265
+ </div>
266
+ </section>
267
+ );
268
+ }