nextworks 0.0.1 → 0.1.0-alpha.1

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 (277) hide show
  1. package/README.md +209 -30
  2. package/dist/.gitkeep +0 -0
  3. package/dist/cli_manifests/auth_manifest.json +86 -0
  4. package/dist/cli_manifests/blocks_manifest.json +185 -0
  5. package/dist/cli_manifests/data_manifest.json +51 -0
  6. package/dist/cli_manifests/forms_manifest.json +61 -0
  7. package/dist/commands/admin-posts.d.ts +2 -0
  8. package/dist/commands/admin-posts.d.ts.map +1 -0
  9. package/dist/commands/admin-posts.js +15 -0
  10. package/dist/commands/admin-posts.js.map +1 -0
  11. package/dist/commands/admin-users.d.ts +2 -0
  12. package/dist/commands/admin-users.d.ts.map +1 -0
  13. package/dist/commands/admin-users.js +15 -0
  14. package/dist/commands/admin-users.js.map +1 -0
  15. package/dist/commands/auth-core.d.ts +2 -0
  16. package/dist/commands/auth-core.d.ts.map +1 -0
  17. package/dist/commands/auth-core.js +83 -0
  18. package/dist/commands/auth-core.js.map +1 -0
  19. package/dist/commands/auth-forms.d.ts +2 -0
  20. package/dist/commands/auth-forms.d.ts.map +1 -0
  21. package/dist/commands/auth-forms.js +15 -0
  22. package/dist/commands/auth-forms.js.map +1 -0
  23. package/dist/commands/blocks-options.d.ts +7 -0
  24. package/dist/commands/blocks-options.d.ts.map +1 -0
  25. package/dist/commands/blocks-options.js +19 -0
  26. package/dist/commands/blocks-options.js.map +1 -0
  27. package/dist/commands/blocks.d.ts +7 -0
  28. package/dist/commands/blocks.d.ts.map +1 -0
  29. package/dist/commands/blocks.js +145 -0
  30. package/dist/commands/blocks.js.map +1 -0
  31. package/dist/commands/data.d.ts +3 -0
  32. package/dist/commands/data.d.ts.map +1 -0
  33. package/dist/commands/data.js +88 -0
  34. package/dist/commands/data.js.map +1 -0
  35. package/dist/commands/forms.d.ts +6 -0
  36. package/dist/commands/forms.d.ts.map +1 -0
  37. package/dist/commands/forms.js +107 -0
  38. package/dist/commands/forms.js.map +1 -0
  39. package/dist/commands/remove-auth-core.d.ts +2 -0
  40. package/dist/commands/remove-auth-core.d.ts.map +1 -0
  41. package/dist/commands/remove-auth-core.js +69 -0
  42. package/dist/commands/remove-auth-core.js.map +1 -0
  43. package/dist/commands/remove-blocks.d.ts +2 -0
  44. package/dist/commands/remove-blocks.d.ts.map +1 -0
  45. package/dist/commands/remove-blocks.js +36 -0
  46. package/dist/commands/remove-blocks.js.map +1 -0
  47. package/dist/index.d.ts +3 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +109 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/kits/auth-core/README.md +106 -0
  52. package/dist/kits/auth-core/app/(protected)/dashboard/page.tsx +8 -0
  53. package/dist/kits/auth-core/app/(protected)/layout.tsx +18 -0
  54. package/dist/kits/auth-core/app/(protected)/settings/profile/page.tsx +15 -0
  55. package/dist/kits/auth-core/app/(protected)/settings/profile/profile-form.tsx +114 -0
  56. package/dist/kits/auth-core/app/api/auth/[...nextauth]/route.ts +1 -0
  57. package/dist/kits/auth-core/app/api/auth/forgot-password/route.ts +114 -0
  58. package/dist/kits/auth-core/app/api/auth/providers/route.ts +6 -0
  59. package/dist/kits/auth-core/app/api/auth/reset-password/route.ts +63 -0
  60. package/dist/kits/auth-core/app/api/auth/send-verify-email/route.ts +6 -0
  61. package/dist/kits/auth-core/app/api/signup/route.ts +41 -0
  62. package/dist/kits/auth-core/app/auth/forgot-password/page.tsx +21 -0
  63. package/dist/kits/auth-core/app/auth/login/page.tsx +5 -0
  64. package/dist/kits/auth-core/app/auth/reset-password/page.tsx +187 -0
  65. package/dist/kits/auth-core/app/auth/signup/page.tsx +5 -0
  66. package/dist/kits/auth-core/app/auth/verify-email/page.tsx +11 -0
  67. package/dist/kits/auth-core/components/admin/admin-header.tsx +57 -0
  68. package/dist/kits/auth-core/components/auth/dashboard.tsx +237 -0
  69. package/dist/kits/auth-core/components/auth/forgot-password-form.tsx +90 -0
  70. package/dist/kits/auth-core/components/auth/login-form.tsx +467 -0
  71. package/dist/kits/auth-core/components/auth/logout-button.tsx +50 -0
  72. package/dist/kits/auth-core/components/auth/minimal-logout-button.tsx +40 -0
  73. package/dist/kits/auth-core/components/auth/signup-form.tsx +468 -0
  74. package/dist/kits/auth-core/components/require-auth.tsx +59 -0
  75. package/dist/kits/auth-core/components/session-provider.tsx +11 -0
  76. package/dist/kits/auth-core/components/ui/README.txt +1 -0
  77. package/dist/kits/auth-core/components/ui/button.tsx +55 -0
  78. package/dist/kits/auth-core/components/ui/input.tsx +25 -0
  79. package/dist/kits/auth-core/components/ui/label.tsx +23 -0
  80. package/dist/kits/auth-core/lib/api/errors.ts +14 -0
  81. package/dist/kits/auth-core/lib/auth-helpers.ts +29 -0
  82. package/dist/kits/auth-core/lib/auth.ts +142 -0
  83. package/dist/kits/auth-core/lib/email/dev-transport.ts +42 -0
  84. package/dist/kits/auth-core/lib/email/index.ts +28 -0
  85. package/dist/kits/auth-core/lib/email/provider-smtp.ts +36 -0
  86. package/dist/kits/auth-core/lib/forms/map-errors.ts +11 -0
  87. package/dist/kits/auth-core/lib/hash.ts +6 -0
  88. package/dist/kits/auth-core/lib/prisma.ts +15 -0
  89. package/dist/kits/auth-core/lib/server/result.ts +45 -0
  90. package/dist/kits/auth-core/lib/utils.ts +6 -0
  91. package/dist/kits/auth-core/lib/validation/forms.ts +88 -0
  92. package/dist/kits/auth-core/package-deps.json +19 -0
  93. package/dist/kits/auth-core/prisma/auth-models.prisma +81 -0
  94. package/dist/kits/auth-core/prisma/schema.prisma +81 -0
  95. package/dist/kits/auth-core/scripts/populate-tokenhash.mjs +26 -0
  96. package/dist/kits/auth-core/scripts/promote-admin.mjs +33 -0
  97. package/dist/kits/auth-core/scripts/seed-demo.mjs +40 -0
  98. package/dist/kits/auth-core/types/next-auth.d.ts +25 -0
  99. package/dist/kits/blocks/README.md +53 -0
  100. package/dist/kits/blocks/app/globals.css +175 -0
  101. package/dist/kits/blocks/app/templates/digitalagency/PresetThemeVars.tsx +80 -0
  102. package/dist/kits/blocks/app/templates/digitalagency/README.md +36 -0
  103. package/dist/kits/blocks/app/templates/digitalagency/components/About.tsx +99 -0
  104. package/dist/kits/blocks/app/templates/digitalagency/components/CTA.tsx +74 -0
  105. package/dist/kits/blocks/app/templates/digitalagency/components/Contact.tsx +227 -0
  106. package/dist/kits/blocks/app/templates/digitalagency/components/Footer.tsx +89 -0
  107. package/dist/kits/blocks/app/templates/digitalagency/components/Hero.tsx +90 -0
  108. package/dist/kits/blocks/app/templates/digitalagency/components/Navbar.tsx +168 -0
  109. package/dist/kits/blocks/app/templates/digitalagency/components/NetworkPattern.tsx +297 -0
  110. package/dist/kits/blocks/app/templates/digitalagency/components/Portfolio.tsx +157 -0
  111. package/dist/kits/blocks/app/templates/digitalagency/components/Pricing.tsx +114 -0
  112. package/dist/kits/blocks/app/templates/digitalagency/components/Process.tsx +59 -0
  113. package/dist/kits/blocks/app/templates/digitalagency/components/Services.tsx +55 -0
  114. package/dist/kits/blocks/app/templates/digitalagency/components/Team.tsx +28 -0
  115. package/dist/kits/blocks/app/templates/digitalagency/components/Testimonials.tsx +65 -0
  116. package/dist/kits/blocks/app/templates/digitalagency/page.tsx +38 -0
  117. package/dist/kits/blocks/app/templates/gallery/PresetThemeVars.tsx +85 -0
  118. package/dist/kits/blocks/app/templates/gallery/page.tsx +303 -0
  119. package/dist/kits/blocks/app/templates/productlaunch/PresetThemeVars.tsx +74 -0
  120. package/dist/kits/blocks/app/templates/productlaunch/README.md +55 -0
  121. package/dist/kits/blocks/app/templates/productlaunch/components/About.tsx +178 -0
  122. package/dist/kits/blocks/app/templates/productlaunch/components/CTA.tsx +93 -0
  123. package/dist/kits/blocks/app/templates/productlaunch/components/Contact.tsx +231 -0
  124. package/dist/kits/blocks/app/templates/productlaunch/components/FAQ.tsx +93 -0
  125. package/dist/kits/blocks/app/templates/productlaunch/components/Features.tsx +84 -0
  126. package/dist/kits/blocks/app/templates/productlaunch/components/Footer.tsx +132 -0
  127. package/dist/kits/blocks/app/templates/productlaunch/components/Hero.tsx +89 -0
  128. package/dist/kits/blocks/app/templates/productlaunch/components/Navbar.tsx +162 -0
  129. package/dist/kits/blocks/app/templates/productlaunch/components/Pricing.tsx +106 -0
  130. package/dist/kits/blocks/app/templates/productlaunch/components/ProcessTimeline.tsx +110 -0
  131. package/dist/kits/blocks/app/templates/productlaunch/components/ServicesGrid.tsx +68 -0
  132. package/dist/kits/blocks/app/templates/productlaunch/components/Team.tsx +104 -0
  133. package/dist/kits/blocks/app/templates/productlaunch/components/Testimonials.tsx +89 -0
  134. package/dist/kits/blocks/app/templates/productlaunch/components/TrustBadges.tsx +76 -0
  135. package/dist/kits/blocks/app/templates/productlaunch/page.tsx +45 -0
  136. package/dist/kits/blocks/app/templates/saasdashboard/PresetThemeVars.tsx +80 -0
  137. package/dist/kits/blocks/app/templates/saasdashboard/README.md +38 -0
  138. package/dist/kits/blocks/app/templates/saasdashboard/components/Contact.tsx +176 -0
  139. package/dist/kits/blocks/app/templates/saasdashboard/components/Dashboard.tsx +293 -0
  140. package/dist/kits/blocks/app/templates/saasdashboard/components/FAQ.tsx +55 -0
  141. package/dist/kits/blocks/app/templates/saasdashboard/components/Features.tsx +91 -0
  142. package/dist/kits/blocks/app/templates/saasdashboard/components/Footer.tsx +77 -0
  143. package/dist/kits/blocks/app/templates/saasdashboard/components/Hero.tsx +105 -0
  144. package/dist/kits/blocks/app/templates/saasdashboard/components/Hero_mask.tsx +127 -0
  145. package/dist/kits/blocks/app/templates/saasdashboard/components/Navbar.tsx +159 -0
  146. package/dist/kits/blocks/app/templates/saasdashboard/components/Pricing.tsx +90 -0
  147. package/dist/kits/blocks/app/templates/saasdashboard/components/SmoothScroll.tsx +97 -0
  148. package/dist/kits/blocks/app/templates/saasdashboard/components/Testimonials.tsx +72 -0
  149. package/dist/kits/blocks/app/templates/saasdashboard/components/TrustBadges.tsx +53 -0
  150. package/dist/kits/blocks/app/templates/saasdashboard/page.tsx +39 -0
  151. package/dist/kits/blocks/components/app-providers.tsx +1 -0
  152. package/dist/kits/blocks/components/enhanced-theme-provider.tsx +195 -0
  153. package/dist/kits/blocks/components/sections/About.tsx +291 -0
  154. package/dist/kits/blocks/components/sections/CTA.tsx +258 -0
  155. package/dist/kits/blocks/components/sections/Contact.tsx +267 -0
  156. package/dist/kits/blocks/components/sections/FAQ.tsx +226 -0
  157. package/dist/kits/blocks/components/sections/Features.tsx +269 -0
  158. package/dist/kits/blocks/components/sections/Footer.tsx +302 -0
  159. package/dist/kits/blocks/components/sections/HeroMotion.tsx +307 -0
  160. package/dist/kits/blocks/components/sections/HeroOverlay.tsx +358 -0
  161. package/dist/kits/blocks/components/sections/HeroSplit.tsx +352 -0
  162. package/dist/kits/blocks/components/sections/Navbar.tsx +353 -0
  163. package/dist/kits/blocks/components/sections/Newsletter.tsx +156 -0
  164. package/dist/kits/blocks/components/sections/PortfolioSimple.tsx +550 -0
  165. package/dist/kits/blocks/components/sections/Pricing.tsx +264 -0
  166. package/dist/kits/blocks/components/sections/ProcessTimeline.tsx +325 -0
  167. package/dist/kits/blocks/components/sections/ServicesGrid.tsx +210 -0
  168. package/dist/kits/blocks/components/sections/Team.tsx +309 -0
  169. package/dist/kits/blocks/components/sections/Testimonials.tsx +158 -0
  170. package/dist/kits/blocks/components/sections/TrustBadges.tsx +162 -0
  171. package/dist/kits/blocks/components/theme-provider.tsx +34 -0
  172. package/dist/kits/blocks/components/ui/alert-dialog.tsx +134 -0
  173. package/dist/kits/blocks/components/ui/brand-node.tsx +121 -0
  174. package/dist/kits/blocks/components/ui/button.tsx +122 -0
  175. package/dist/kits/blocks/components/ui/button_bck.tsx +93 -0
  176. package/dist/kits/blocks/components/ui/card.tsx +95 -0
  177. package/dist/kits/blocks/components/ui/checkbox.tsx +30 -0
  178. package/dist/kits/blocks/components/ui/cta-button.tsx +125 -0
  179. package/dist/kits/blocks/components/ui/dropdown-menu.tsx +201 -0
  180. package/dist/kits/blocks/components/ui/feature-card.tsx +91 -0
  181. package/dist/kits/blocks/components/ui/input.tsx +27 -0
  182. package/dist/kits/blocks/components/ui/label.tsx +29 -0
  183. package/dist/kits/blocks/components/ui/pricing-card.tsx +120 -0
  184. package/dist/kits/blocks/components/ui/select.tsx +25 -0
  185. package/dist/kits/blocks/components/ui/skeleton.tsx +13 -0
  186. package/dist/kits/blocks/components/ui/switch.tsx +78 -0
  187. package/dist/kits/blocks/components/ui/table.tsx +98 -0
  188. package/dist/kits/blocks/components/ui/testimonial-card.tsx +108 -0
  189. package/dist/kits/blocks/components/ui/textarea.tsx +26 -0
  190. package/dist/kits/blocks/components/ui/theme-selector.tsx +247 -0
  191. package/dist/kits/blocks/components/ui/theme-toggle.tsx +74 -0
  192. package/dist/kits/blocks/components/ui/toaster.tsx +7 -0
  193. package/dist/kits/blocks/lib/themes.ts +399 -0
  194. package/dist/kits/blocks/lib/themes_old.ts +37 -0
  195. package/dist/kits/blocks/lib/utils.ts +9 -0
  196. package/dist/kits/blocks/next.config.ts +11 -0
  197. package/dist/kits/blocks/notes/THEME_GUIDE.md +29 -0
  198. package/dist/kits/blocks/notes/THEMING_CONVERSION_SUMMARY.md +14 -0
  199. package/dist/kits/blocks/package-deps.json +22 -0
  200. package/dist/kits/blocks/public/placeholders/gallery/hero-pexels-broken-9945014.avif +0 -0
  201. package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626431.jpg +0 -0
  202. package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626432.jpg +0 -0
  203. package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626434.jpg +0 -0
  204. package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626436.jpg +0 -0
  205. package/dist/kits/blocks/public/placeholders/product_launch/feature_1.png +0 -0
  206. package/dist/kits/blocks/public/placeholders/product_launch/feature_2.png +0 -0
  207. package/dist/kits/blocks/public/placeholders/product_launch/feature_3.png +0 -0
  208. package/dist/kits/blocks/public/placeholders/product_launch/feature_4.png +0 -0
  209. package/dist/kits/blocks/public/placeholders/product_launch/hero.png +0 -0
  210. package/dist/kits/blocks/public/placeholders/saas_dashboard/analytics.png +0 -0
  211. package/dist/kits/blocks/public/placeholders/saas_dashboard/chat.png +0 -0
  212. package/dist/kits/blocks/public/placeholders/saas_dashboard/projectBoard.png +0 -0
  213. package/dist/kits/data/.gitkeep +0 -0
  214. package/dist/kits/data/README.md +104 -0
  215. package/dist/kits/data/app/(protected)/admin/posts/page.tsx +5 -0
  216. package/dist/kits/data/app/(protected)/admin/users/page.tsx +5 -0
  217. package/dist/kits/data/app/api/posts/[id]/route.ts +83 -0
  218. package/dist/kits/data/app/api/posts/route.ts +138 -0
  219. package/dist/kits/data/app/api/seed-demo/route.ts +45 -0
  220. package/dist/kits/data/app/api/users/[id]/route.ts +127 -0
  221. package/dist/kits/data/app/api/users/check-email/route.ts +18 -0
  222. package/dist/kits/data/app/api/users/check-unique/route.ts +27 -0
  223. package/dist/kits/data/app/api/users/route.ts +79 -0
  224. package/dist/kits/data/app/examples/demo/README.md +4 -0
  225. package/dist/kits/data/app/examples/demo/create-post-form.tsx +106 -0
  226. package/dist/kits/data/app/examples/demo/page.tsx +118 -0
  227. package/dist/kits/data/app/examples/demo/seed-demo-button.tsx +37 -0
  228. package/dist/kits/data/components/admin/posts-manager.tsx +719 -0
  229. package/dist/kits/data/components/admin/users-manager.tsx +432 -0
  230. package/dist/kits/data/lib/prisma.ts +15 -0
  231. package/dist/kits/data/lib/server/result.ts +90 -0
  232. package/dist/kits/data/package-deps.json +11 -0
  233. package/dist/kits/data/scripts/seed-demo.mjs +41 -0
  234. package/dist/kits/forms/.gitkeep +0 -0
  235. package/dist/kits/forms/README.md +49 -0
  236. package/dist/kits/forms/app/.gitkeep +0 -0
  237. package/dist/kits/forms/app/api/wizard/route.ts +71 -0
  238. package/dist/kits/forms/app/examples/forms/basic/page.tsx +124 -0
  239. package/dist/kits/forms/app/examples/forms/server-action/form-client.tsx +28 -0
  240. package/dist/kits/forms/app/examples/forms/server-action/page.tsx +71 -0
  241. package/dist/kits/forms/app/examples/forms/wizard/page.tsx +15 -0
  242. package/dist/kits/forms/app/examples/forms/wizard/wizard-client.tsx +2 -0
  243. package/dist/kits/forms/components/.gitkeep +0 -0
  244. package/dist/kits/forms/components/examples/wizard-client.tsx +231 -0
  245. package/dist/kits/forms/components/hooks/useCheckUnique.ts +79 -0
  246. package/dist/kits/forms/components/ui/button.tsx +122 -0
  247. package/dist/kits/forms/components/ui/checkbox.tsx +30 -0
  248. package/dist/kits/forms/components/ui/form/context.ts +33 -0
  249. package/dist/kits/forms/components/ui/form/form-control.tsx +28 -0
  250. package/dist/kits/forms/components/ui/form/form-description.tsx +22 -0
  251. package/dist/kits/forms/components/ui/form/form-field.tsx +36 -0
  252. package/dist/kits/forms/components/ui/form/form-item.tsx +21 -0
  253. package/dist/kits/forms/components/ui/form/form-label.tsx +24 -0
  254. package/dist/kits/forms/components/ui/form/form-message.tsx +29 -0
  255. package/dist/kits/forms/components/ui/form/form.tsx +26 -0
  256. package/dist/kits/forms/components/ui/input.tsx +27 -0
  257. package/dist/kits/forms/components/ui/label.tsx +29 -0
  258. package/dist/kits/forms/components/ui/select.tsx +25 -0
  259. package/dist/kits/forms/components/ui/switch.tsx +78 -0
  260. package/dist/kits/forms/components/ui/textarea.tsx +26 -0
  261. package/dist/kits/forms/lib/.gitkeep +0 -0
  262. package/dist/kits/forms/lib/forms/map-errors.ts +29 -0
  263. package/dist/kits/forms/lib/prisma.ts +16 -0
  264. package/dist/kits/forms/lib/utils.ts +9 -0
  265. package/dist/kits/forms/lib/validation/forms.ts +88 -0
  266. package/dist/kits/forms/lib/validation/wizard.ts +32 -0
  267. package/dist/kits/forms/package-deps.json +17 -0
  268. package/dist/utils/file-operations.d.ts +18 -0
  269. package/dist/utils/file-operations.d.ts.map +1 -0
  270. package/dist/utils/file-operations.js +327 -0
  271. package/dist/utils/file-operations.js.map +1 -0
  272. package/dist/utils/installation-tracker.d.ts +26 -0
  273. package/dist/utils/installation-tracker.d.ts.map +1 -0
  274. package/dist/utils/installation-tracker.js +98 -0
  275. package/dist/utils/installation-tracker.js.map +1 -0
  276. package/package.json +51 -21
  277. package/index.js +0 -1
@@ -0,0 +1,226 @@
1
+ "use client";
2
+
3
+ import React, { useMemo, useState } from "react";
4
+ import { cn } from "@/lib/utils";
5
+ import { ChevronDown, ChevronUp } from "lucide-react";
6
+ import { Button } from "../ui/button";
7
+
8
+ /**
9
+ * Represents a single FAQ item.
10
+ * @public
11
+ */
12
+ export interface FAQS {
13
+ /** The question text */
14
+ question?: string;
15
+ /** The answer text */
16
+ answer?: string;
17
+ }
18
+
19
+ /**
20
+ * Props for the FAQ section component.
21
+ *
22
+ * @remarks
23
+ * - Styling: exposes slot-style className overrides; consumer classes are
24
+ * merged after defaults via cn().
25
+ * - Behavior: supports single or multiple open items; default open indices
26
+ * are respected. Controlled internally with a Set.
27
+ * - Motion: when enableMotion is false, collapse/expand transitions are
28
+ * removed for a hard-cut.
29
+ * - Accessibility: each item uses button+region with aria-controls and
30
+ * aria-expanded. Section uses aria-label.
31
+ */
32
+ export interface FAQProps {
33
+ /** Header text displayed at the top of the FAQ section. @defaultValue "Frequently Asked Questions" */
34
+ faqSectionHeaderText?: string;
35
+ /** Array of question/answer items. @defaultValue defaultFaqData */
36
+ faqData?: FAQS[];
37
+ /** Optional id for the section root. @defaultValue "faq" */
38
+ sectionId?: string;
39
+ /** Optional top-level class override */
40
+ className?: string;
41
+ /** When false, only one item can be open at a time. @defaultValue true */
42
+ allowMultipleOpen?: boolean;
43
+ /** Indices of items that should be open by default. @defaultValue [] */
44
+ defaultOpenIndices?: number[];
45
+ /** Optional icons for open/closed states */
46
+ openIcon?: React.ReactNode;
47
+ closedIcon?: React.ReactNode;
48
+ /** ARIA label for the FAQ section. @defaultValue "Frequently asked questions section" */
49
+ ariaLabel?: string;
50
+ /** Slot-style overrides */
51
+ section?: { className?: string };
52
+ container?: { className?: string };
53
+ heading?: { className?: string };
54
+ grid?: { className?: string };
55
+ item?: { className?: string };
56
+ questionButton?: { className?: string };
57
+ questionText?: { className?: string };
58
+ chevronIcon?: { className?: string };
59
+ answer?: { className?: string };
60
+ answerText?: { className?: string };
61
+ /** When false, removes transition on collapse/expand for a hard-cut */
62
+ enableMotion?: boolean;
63
+ }
64
+
65
+ // const defaultFaqData: FAQS[] = [
66
+ // {
67
+ // question: "What does IntelliOpAI do?",
68
+ // answer: "Automates ops with real-time insights.",
69
+ // },
70
+ // {
71
+ // question: "Do I need coding skills?",
72
+ // answer: "No, it's designed for ease of use.",
73
+ // },
74
+ // ];
75
+
76
+ const defaultFaqData: FAQS[] = [
77
+ {
78
+ question: "What does IntelliOpAI do?",
79
+ answer: "Automates ops with real-time insights.",
80
+ },
81
+ {
82
+ question: "How secure is my data?",
83
+ answer: "We use industry-standard encryption and strict access controls.",
84
+ },
85
+ {
86
+ question: "Can I integrate with other tools?",
87
+ answer:
88
+ "Yes — supports APIs and popular integrations like Slack, GitHub, and Jira.",
89
+ },
90
+ {
91
+ question: "How do I get support?",
92
+ answer:
93
+ "Contact our support team via in-app chat or the help center for assistance.",
94
+ },
95
+ ];
96
+
97
+ /**
98
+ * Expandable FAQ section with accessible toggles and optional icons.
99
+ *
100
+ * @remarks
101
+ * - Supports multiple or single open item behavior via allowMultipleOpen.
102
+ * - Uses button with aria-expanded and a region with aria-labelledby.
103
+ * - Motion can be disabled via enableMotion for reduced animation.
104
+ *
105
+ * @example
106
+ * <FAQ faqData={[{ question: 'What is X?', answer: 'Y' }]} />
107
+ */
108
+ export function FAQ({
109
+ faqSectionHeaderText = "Frequently Asked Questions",
110
+ faqData = defaultFaqData,
111
+ sectionId = "faq",
112
+ className,
113
+ allowMultipleOpen = true,
114
+ defaultOpenIndices = [],
115
+ openIcon,
116
+ closedIcon,
117
+ ariaLabel = "Frequently asked questions section",
118
+ section = { className: "py-10 px-5 bg-muted text-foreground" },
119
+ container = { className: "mx-auto max-w-7xl" },
120
+ heading = {
121
+ className: "mb-6 text-center text-2xl font-bold text-foreground",
122
+ },
123
+ grid = { className: "grid grid-cols-1 gap-4 md:grid-cols-2 md:gap-6" },
124
+ item = { className: "mb-4" },
125
+ questionButton = {
126
+ className:
127
+ "shadow-md hover:shadow-lg border-[var(--btn-border)] focus-visible:ring-[var(--btn-ring)] bg-[var(--faq-btn-bg,var(--btn-bg))] text-[var(--faq-btn-fg,var(--btn-fg))] hover:bg-[var(--faq-btn-hover-bg,var(--btn-hover-bg))] hover:text-[var(--faq-btn-hover-fg,var(--btn-hover-fg))]",
128
+ },
129
+ questionText = { className: "" },
130
+ chevronIcon = { className: "transition-transform duration-200" },
131
+ answer = {
132
+ className:
133
+ "bg-[var(--faq-answer-bg,var(--card-bg))] text-[var(--faq-answer-fg,var(--card-fg))] border-[var(--card-border)]",
134
+ },
135
+ answerText = { className: "leading-relaxed" },
136
+ enableMotion = true,
137
+ }: FAQProps) {
138
+ const [openSet, setOpenSet] = useState<Set<number>>(
139
+ () => new Set(defaultOpenIndices),
140
+ );
141
+ const idPrefix = useMemo(() => sectionId || "faq", [sectionId]);
142
+
143
+ const onToggle = (idx: number) => {
144
+ setOpenSet((prev) => {
145
+ const next = new Set(prev);
146
+ if (next.has(idx)) next.delete(idx);
147
+ else {
148
+ if (!allowMultipleOpen) next.clear();
149
+ next.add(idx);
150
+ }
151
+ return next;
152
+ });
153
+ };
154
+
155
+ return (
156
+ <section
157
+ id={sectionId}
158
+ className={cn(section.className, className)}
159
+ aria-label={ariaLabel}
160
+ >
161
+ <div className={cn(container.className)}>
162
+ {faqSectionHeaderText && (
163
+ <h2 className={cn(heading.className)}>{faqSectionHeaderText}</h2>
164
+ )}
165
+ <div className={cn(grid.className)}>
166
+ {faqData.map((faq, index) => {
167
+ const transitionCls = enableMotion
168
+ ? "transition-all duration-300 ease-in-out"
169
+ : "transition-none";
170
+ const isOpen = openSet.has(index);
171
+ return (
172
+ <div
173
+ key={`${idPrefix}-item-${index}`}
174
+ className={cn("w-full", item.className)}
175
+ >
176
+ <button
177
+ id={`${idPrefix}-trigger-${index}`}
178
+ aria-controls={`${idPrefix}-panel-${index}`}
179
+ aria-expanded={isOpen}
180
+ onClick={() => onToggle(index)}
181
+ className={cn(
182
+ "flex w-full items-center justify-between rounded-md p-4 text-left focus:outline-none",
183
+ // preset-first ring/border
184
+ "border-[var(--btn-border)] focus-visible:ring-2 focus-visible:ring-[var(--btn-ring)] focus-visible:ring-offset-2",
185
+ questionButton.className,
186
+ )}
187
+ >
188
+ <span
189
+ className={cn(
190
+ "flex-1 font-medium select-none",
191
+ questionText.className,
192
+ )}
193
+ >
194
+ {faq.question}
195
+ </span>
196
+ <span
197
+ className={cn("ml-3 flex-shrink-0", chevronIcon.className)}
198
+ >
199
+ {isOpen
200
+ ? (openIcon ?? <ChevronUp className="h-5 w-5" />)
201
+ : (closedIcon ?? <ChevronDown className="h-5 w-5" />)}
202
+ </span>
203
+ </button>
204
+ <div
205
+ id={`${idPrefix}-panel-${index}`}
206
+ role="region"
207
+ aria-labelledby={`${idPrefix}-trigger-${index}`}
208
+ className={cn(
209
+ "border-border overflow-hidden rounded-md border",
210
+ isOpen ? "max-h-96 opacity-100" : "max-h-0 opacity-0",
211
+ transitionCls,
212
+ answer.className,
213
+ )}
214
+ >
215
+ <div className={cn("p-4", answerText.className)}>
216
+ {faq.answer}
217
+ </div>
218
+ </div>
219
+ </div>
220
+ );
221
+ })}
222
+ </div>
223
+ </div>
224
+ </section>
225
+ );
226
+ }
@@ -0,0 +1,269 @@
1
+ "use client";
2
+
3
+ import React from "react";
4
+ import { motion } from "motion/react";
5
+ import type { Transition } from "motion";
6
+ import { cn } from "@/lib/utils";
7
+ import { FeatureCard } from "@/components/ui/feature-card";
8
+
9
+ /**
10
+ * Data used to render a FeatureCard within the Features grid.
11
+ * @public
12
+ */
13
+ export interface FeatureCardData {
14
+ imageSrc: string;
15
+ imageAlt: string;
16
+ headingText: string;
17
+ subheadingText: string;
18
+ }
19
+
20
+ /**
21
+ * Props for the Features section component.
22
+ *
23
+ * @remarks
24
+ * - Styling: slot-style className overrides are merged after defaults via cn().
25
+ * - Motion: entrance animations respect enableMotion; prefers-reduced-motion
26
+ * disables transforms and transitions where possible.
27
+ *
28
+ * @public
29
+ */
30
+ export interface FeaturesProps {
31
+ /**
32
+ * Optional id to attach to the root section element.
33
+ * @defaultValue "features"
34
+ */
35
+ id?: string;
36
+
37
+ /** Main section heading text */
38
+ sectionHeading?: string;
39
+ /** Subheading text displayed below the main heading */
40
+ sectionSubheading?: string;
41
+
42
+ /** Array of feature card data objects */
43
+ featuresData?: FeatureCardData[];
44
+
45
+ /** Optional top-level class to override the section root */
46
+ className?: string;
47
+
48
+ /** Styling configuration objects (slots) */
49
+ section?: { className?: string };
50
+ container?: { className?: string };
51
+ header?: { className?: string };
52
+ heading?: { className?: string };
53
+ subheading?: { className?: string };
54
+ grid?: { className?: string };
55
+ /** Wrapper around each FeatureCard (the animated container) */
56
+ cardWrapper?: { className?: string };
57
+ /** Styles passed down to FeatureCard slots */
58
+ card?: { className?: string };
59
+ image?: { className?: string };
60
+ cardHeading?: { className?: string };
61
+ cardSubheading?: { className?: string };
62
+
63
+ /** When false, disables entrance animations and hover transitions. */
64
+ enableMotion?: boolean;
65
+
66
+ /** Motion configuration for the feature items */
67
+ motionConfig?: {
68
+ initial?: { opacity?: number; y?: number };
69
+ whileInView?: { opacity?: number; y?: number };
70
+ viewport?: { once?: boolean; amount?: number };
71
+ transition?: Transition;
72
+ };
73
+
74
+ /** ARIA label for the features section */
75
+ ariaLabel?: string;
76
+ }
77
+
78
+ const defaultFeaturesData: FeatureCardData[] = [
79
+ {
80
+ imageSrc: "/feature_1.png",
81
+ imageAlt: "Advanced Analytics Dashboard",
82
+ headingText: "Advanced Analytics",
83
+ subheadingText:
84
+ "Get deep insights into your business performance with our comprehensive analytics dashboard that tracks key metrics and provides actionable recommendations.",
85
+ },
86
+ {
87
+ imageSrc: "/feature_2.png",
88
+ imageAlt: "Real-time Collaboration Tools",
89
+ headingText: "Real-time Collaboration",
90
+ subheadingText:
91
+ "Work seamlessly with your team using our real-time collaboration tools that keep everyone in sync and boost productivity across all projects.",
92
+ },
93
+ {
94
+ imageSrc: "/feature_3.png",
95
+ imageAlt: "Secure Data Management",
96
+ headingText: "Secure Data Management",
97
+ subheadingText:
98
+ "Protect your sensitive information with enterprise-grade security features including encryption, access controls, and compliance monitoring.",
99
+ },
100
+ {
101
+ imageSrc: "/feature_4.png",
102
+ imageAlt: "Mobile-First Design",
103
+ headingText: "Mobile-First Design",
104
+ subheadingText:
105
+ "Access your data and manage your workflow from anywhere with our responsive, mobile-optimized interface that works perfectly on all devices.",
106
+ },
107
+ ];
108
+
109
+ /**
110
+ * Responsive Features section that renders a heading, optional subheading,
111
+ * and a grid of FeatureCard items with configurable entrance animations.
112
+ *
113
+ * @remarks
114
+ * - Styling: slot-style className overrides are merged after defaults via cn().
115
+ * - Motion: Controlled by enableMotion and motionConfig; animations are reduced
116
+ * or disabled when users prefer reduced motion.
117
+ * - Accessibility: Uses a semantic <section> with an aria-label.
118
+ *
119
+ * @example
120
+ * <Features
121
+ * sectionHeading="Key Features"
122
+ * featuresData={[{ imageSrc: "/a.png", imageAlt: "", headingText: "Fast", subheadingText: "Blazing" }]}
123
+ * />
124
+ */
125
+ export function Features({
126
+ id = "features",
127
+ sectionHeading = "Key Features",
128
+ sectionSubheading = "Discover what makes our platform unique and powerful",
129
+ featuresData = defaultFeaturesData,
130
+
131
+ className,
132
+
133
+ section = { className: "py-16 md:py-20 lg:py-24 bg-background" },
134
+ container = { className: "max-w-7xl mx-auto px-4 md:px-6 lg:px-8" },
135
+ header = { className: "text-center mb-12 md:mb-16" },
136
+ heading = {
137
+ className:
138
+ "text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-4",
139
+ },
140
+ subheading = {
141
+ className:
142
+ "text-lg md:text-xl text-muted-foreground max-w-3xl mx-auto leading-relaxed",
143
+ },
144
+ grid = {
145
+ className:
146
+ "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-4 gap-6 md:gap-8",
147
+ },
148
+ cardWrapper = {
149
+ className: "motion-reduce:transform-none motion-reduce:transition-none",
150
+ },
151
+ card = {
152
+ className:
153
+ "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",
154
+ },
155
+ image = {
156
+ className:
157
+ "w-full h-48 md:h-56 object-cover transition-none hover:!scale-100 group-hover:!scale-100 [transform:none]",
158
+ },
159
+ cardHeading = {
160
+ className:
161
+ "text-xl md:text-2xl font-semibold text-card-foreground mb-3 leading-tight",
162
+ },
163
+ cardSubheading = {
164
+ className: "text-sm md:text-base text-muted-foreground leading-relaxed",
165
+ },
166
+
167
+ enableMotion = true,
168
+ motionConfig = {
169
+ initial: { opacity: 0, y: 12 },
170
+ whileInView: { opacity: 1, y: 0 },
171
+ viewport: { once: true, amount: 0.2 },
172
+ transition: {
173
+ type: "tween",
174
+ stiffness: 0,
175
+ damping: 50,
176
+ mass: 1,
177
+ delay: 0.15,
178
+ },
179
+ },
180
+ ariaLabel = "Features section",
181
+ }: FeaturesProps) {
182
+ return (
183
+ <section
184
+ id={id}
185
+ className={cn(section.className, className)}
186
+ aria-label={ariaLabel}
187
+ >
188
+ <div className={cn(container.className)}>
189
+ <div className={cn(header.className)}>
190
+ <h2 className={cn(heading.className)}>{sectionHeading}</h2>
191
+ {sectionSubheading && (
192
+ <p className={cn(subheading.className)}>{sectionSubheading}</p>
193
+ )}
194
+ </div>
195
+
196
+ <div className={cn(grid.className)}>
197
+ {featuresData.map((feature, index) => {
198
+ const mConfig: NonNullable<FeaturesProps["motionConfig"]> =
199
+ enableMotion
200
+ ? (motionConfig as NonNullable<FeaturesProps["motionConfig"]>)
201
+ : {
202
+ initial: { opacity: 1, y: 0 },
203
+ whileInView: { opacity: 1, y: 0 },
204
+ viewport: { once: true, amount: 0 },
205
+ transition: {
206
+ type: "tween",
207
+ duration: 0,
208
+ } as const satisfies Transition,
209
+ };
210
+
211
+ // Ensure we always spread a defined object into transition
212
+ const baseTransition: Transition = (mConfig.transition ??
213
+ ({
214
+ type: "tween",
215
+ duration: 0,
216
+ } as const)) as Transition;
217
+
218
+ const noMotionCard =
219
+ "transition-none hover:!translate-y-0 hover:shadow-none motion-reduce:transition-none motion-reduce:transform-none";
220
+ const noMotionImage =
221
+ "transition-none hover:!scale-100 transform-none motion-reduce:transform-none group-hover:!scale-100";
222
+
223
+ return (
224
+ <motion.div
225
+ key={index}
226
+ initial={mConfig.initial}
227
+ whileInView={mConfig.whileInView}
228
+ viewport={mConfig.viewport}
229
+ transition={{
230
+ ...baseTransition,
231
+ // Stagger based on index while preserving provided delay if any
232
+ delay:
233
+ (mConfig.transition?.delay ?? 0.15) +
234
+ index * (enableMotion ? 0.06 : 0),
235
+ }}
236
+ className={cn(cardWrapper.className)}
237
+ >
238
+ <FeatureCard
239
+ cardImageSrc={feature.imageSrc}
240
+ cardImageAlt={feature.imageAlt}
241
+ cardHeadingText={feature.headingText}
242
+ cardSubheadingText={feature.subheadingText}
243
+ card={{
244
+ className: cn(
245
+ card.className,
246
+ !enableMotion && noMotionCard,
247
+ ),
248
+ }}
249
+ image={{
250
+ className: cn(
251
+ image.className,
252
+ !enableMotion && noMotionImage,
253
+ ),
254
+ }}
255
+ // image={{
256
+ // className: cn(image.className),
257
+ // }}
258
+ heading={{ className: cn(cardHeading.className) }}
259
+ subheading={{ className: cn(cardSubheading.className) }}
260
+ className={cn("h-full")}
261
+ />
262
+ </motion.div>
263
+ );
264
+ })}
265
+ </div>
266
+ </div>
267
+ </section>
268
+ );
269
+ }