nextworks 0.0.1 → 0.1.0-alpha.0
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.
- package/README.md +209 -30
- package/dist/.gitkeep +0 -0
- package/dist/cli_manifests/auth_manifest.json +86 -0
- package/dist/cli_manifests/blocks_manifest.json +185 -0
- package/dist/cli_manifests/data_manifest.json +51 -0
- package/dist/cli_manifests/forms_manifest.json +61 -0
- package/dist/commands/admin-posts.d.ts +2 -0
- package/dist/commands/admin-posts.d.ts.map +1 -0
- package/dist/commands/admin-posts.js +15 -0
- package/dist/commands/admin-posts.js.map +1 -0
- package/dist/commands/admin-users.d.ts +2 -0
- package/dist/commands/admin-users.d.ts.map +1 -0
- package/dist/commands/admin-users.js +15 -0
- package/dist/commands/admin-users.js.map +1 -0
- package/dist/commands/auth-core.d.ts +2 -0
- package/dist/commands/auth-core.d.ts.map +1 -0
- package/dist/commands/auth-core.js +83 -0
- package/dist/commands/auth-core.js.map +1 -0
- package/dist/commands/auth-forms.d.ts +2 -0
- package/dist/commands/auth-forms.d.ts.map +1 -0
- package/dist/commands/auth-forms.js +15 -0
- package/dist/commands/auth-forms.js.map +1 -0
- package/dist/commands/blocks-options.d.ts +7 -0
- package/dist/commands/blocks-options.d.ts.map +1 -0
- package/dist/commands/blocks-options.js +19 -0
- package/dist/commands/blocks-options.js.map +1 -0
- package/dist/commands/blocks.d.ts +7 -0
- package/dist/commands/blocks.d.ts.map +1 -0
- package/dist/commands/blocks.js +140 -0
- package/dist/commands/blocks.js.map +1 -0
- package/dist/commands/data.d.ts +3 -0
- package/dist/commands/data.d.ts.map +1 -0
- package/dist/commands/data.js +88 -0
- package/dist/commands/data.js.map +1 -0
- package/dist/commands/forms.d.ts +6 -0
- package/dist/commands/forms.d.ts.map +1 -0
- package/dist/commands/forms.js +107 -0
- package/dist/commands/forms.js.map +1 -0
- package/dist/commands/remove-auth-core.d.ts +2 -0
- package/dist/commands/remove-auth-core.d.ts.map +1 -0
- package/dist/commands/remove-auth-core.js +69 -0
- package/dist/commands/remove-auth-core.js.map +1 -0
- package/dist/commands/remove-blocks.d.ts +2 -0
- package/dist/commands/remove-blocks.d.ts.map +1 -0
- package/dist/commands/remove-blocks.js +36 -0
- package/dist/commands/remove-blocks.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/index.js.map +1 -0
- package/dist/kits/auth-core/README.md +82 -0
- package/dist/kits/auth-core/app/(protected)/dashboard/page.tsx +8 -0
- package/dist/kits/auth-core/app/(protected)/layout.tsx +18 -0
- package/dist/kits/auth-core/app/(protected)/settings/profile/page.tsx +15 -0
- package/dist/kits/auth-core/app/(protected)/settings/profile/profile-form.tsx +114 -0
- package/dist/kits/auth-core/app/api/auth/[...nextauth]/route.ts +1 -0
- package/dist/kits/auth-core/app/api/auth/forgot-password/route.ts +114 -0
- package/dist/kits/auth-core/app/api/auth/providers/route.ts +6 -0
- package/dist/kits/auth-core/app/api/auth/reset-password/route.ts +63 -0
- package/dist/kits/auth-core/app/api/auth/send-verify-email/route.ts +6 -0
- package/dist/kits/auth-core/app/api/signup/route.ts +41 -0
- package/dist/kits/auth-core/app/auth/forgot-password/page.tsx +21 -0
- package/dist/kits/auth-core/app/auth/login/page.tsx +5 -0
- package/dist/kits/auth-core/app/auth/reset-password/page.tsx +187 -0
- package/dist/kits/auth-core/app/auth/signup/page.tsx +5 -0
- package/dist/kits/auth-core/app/auth/verify-email/page.tsx +11 -0
- package/dist/kits/auth-core/components/admin/admin-header.tsx +57 -0
- package/dist/kits/auth-core/components/auth/dashboard.tsx +237 -0
- package/dist/kits/auth-core/components/auth/forgot-password-form.tsx +90 -0
- package/dist/kits/auth-core/components/auth/login-form.tsx +467 -0
- package/dist/kits/auth-core/components/auth/logout-button.tsx +50 -0
- package/dist/kits/auth-core/components/auth/minimal-logout-button.tsx +40 -0
- package/dist/kits/auth-core/components/auth/signup-form.tsx +468 -0
- package/dist/kits/auth-core/components/require-auth.tsx +59 -0
- package/dist/kits/auth-core/components/session-provider.tsx +11 -0
- package/dist/kits/auth-core/components/ui/README.txt +1 -0
- package/dist/kits/auth-core/components/ui/button.tsx +55 -0
- package/dist/kits/auth-core/components/ui/input.tsx +25 -0
- package/dist/kits/auth-core/components/ui/label.tsx +23 -0
- package/dist/kits/auth-core/lib/api/errors.ts +14 -0
- package/dist/kits/auth-core/lib/auth-helpers.ts +29 -0
- package/dist/kits/auth-core/lib/auth.ts +142 -0
- package/dist/kits/auth-core/lib/email/dev-transport.ts +42 -0
- package/dist/kits/auth-core/lib/email/index.ts +28 -0
- package/dist/kits/auth-core/lib/email/provider-smtp.ts +36 -0
- package/dist/kits/auth-core/lib/forms/map-errors.ts +11 -0
- package/dist/kits/auth-core/lib/hash.ts +6 -0
- package/dist/kits/auth-core/lib/prisma.ts +15 -0
- package/dist/kits/auth-core/lib/server/result.ts +45 -0
- package/dist/kits/auth-core/lib/utils.ts +6 -0
- package/dist/kits/auth-core/lib/validation/forms.ts +88 -0
- package/dist/kits/auth-core/package-deps.json +19 -0
- package/dist/kits/auth-core/prisma/auth-models.prisma +81 -0
- package/dist/kits/auth-core/prisma/schema.prisma +81 -0
- package/dist/kits/auth-core/scripts/populate-tokenhash.mjs +26 -0
- package/dist/kits/auth-core/scripts/promote-admin.mjs +33 -0
- package/dist/kits/auth-core/scripts/seed-demo.mjs +40 -0
- package/dist/kits/auth-core/types/next-auth.d.ts +25 -0
- package/dist/kits/blocks/README.md +53 -0
- package/dist/kits/blocks/app/globals.css +175 -0
- package/dist/kits/blocks/app/templates/digitalagency/PresetThemeVars.tsx +80 -0
- package/dist/kits/blocks/app/templates/digitalagency/README.md +36 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/About.tsx +99 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/CTA.tsx +74 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/Contact.tsx +227 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/Footer.tsx +89 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/Hero.tsx +90 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/Navbar.tsx +168 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/NetworkPattern.tsx +297 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/Portfolio.tsx +157 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/Pricing.tsx +114 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/Process.tsx +59 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/Services.tsx +55 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/Team.tsx +28 -0
- package/dist/kits/blocks/app/templates/digitalagency/components/Testimonials.tsx +65 -0
- package/dist/kits/blocks/app/templates/digitalagency/page.tsx +38 -0
- package/dist/kits/blocks/app/templates/gallery/PresetThemeVars.tsx +85 -0
- package/dist/kits/blocks/app/templates/gallery/page.tsx +303 -0
- package/dist/kits/blocks/app/templates/productlaunch/PresetThemeVars.tsx +74 -0
- package/dist/kits/blocks/app/templates/productlaunch/README.md +55 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/About.tsx +178 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/CTA.tsx +93 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/Contact.tsx +231 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/FAQ.tsx +93 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/Features.tsx +84 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/Footer.tsx +132 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/Hero.tsx +89 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/Navbar.tsx +162 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/Pricing.tsx +106 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/ProcessTimeline.tsx +110 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/ServicesGrid.tsx +68 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/Team.tsx +104 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/Testimonials.tsx +89 -0
- package/dist/kits/blocks/app/templates/productlaunch/components/TrustBadges.tsx +76 -0
- package/dist/kits/blocks/app/templates/productlaunch/page.tsx +45 -0
- package/dist/kits/blocks/app/templates/saasdashboard/PresetThemeVars.tsx +80 -0
- package/dist/kits/blocks/app/templates/saasdashboard/README.md +38 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/Contact.tsx +176 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/Dashboard.tsx +293 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/FAQ.tsx +55 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/Features.tsx +91 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/Footer.tsx +77 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/Hero.tsx +105 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/Hero_mask.tsx +127 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/Navbar.tsx +159 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/Pricing.tsx +90 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/SmoothScroll.tsx +97 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/Testimonials.tsx +72 -0
- package/dist/kits/blocks/app/templates/saasdashboard/components/TrustBadges.tsx +53 -0
- package/dist/kits/blocks/app/templates/saasdashboard/page.tsx +39 -0
- package/dist/kits/blocks/components/app-providers.tsx +1 -0
- package/dist/kits/blocks/components/enhanced-theme-provider.tsx +195 -0
- package/dist/kits/blocks/components/sections/About.tsx +291 -0
- package/dist/kits/blocks/components/sections/CTA.tsx +258 -0
- package/dist/kits/blocks/components/sections/Contact.tsx +267 -0
- package/dist/kits/blocks/components/sections/FAQ.tsx +226 -0
- package/dist/kits/blocks/components/sections/Features.tsx +269 -0
- package/dist/kits/blocks/components/sections/Footer.tsx +302 -0
- package/dist/kits/blocks/components/sections/HeroMotion.tsx +307 -0
- package/dist/kits/blocks/components/sections/HeroOverlay.tsx +358 -0
- package/dist/kits/blocks/components/sections/HeroSplit.tsx +352 -0
- package/dist/kits/blocks/components/sections/Navbar.tsx +353 -0
- package/dist/kits/blocks/components/sections/Newsletter.tsx +156 -0
- package/dist/kits/blocks/components/sections/PortfolioSimple.tsx +550 -0
- package/dist/kits/blocks/components/sections/Pricing.tsx +264 -0
- package/dist/kits/blocks/components/sections/ProcessTimeline.tsx +325 -0
- package/dist/kits/blocks/components/sections/ServicesGrid.tsx +210 -0
- package/dist/kits/blocks/components/sections/Team.tsx +309 -0
- package/dist/kits/blocks/components/sections/Testimonials.tsx +158 -0
- package/dist/kits/blocks/components/sections/TrustBadges.tsx +162 -0
- package/dist/kits/blocks/components/theme-provider.tsx +34 -0
- package/dist/kits/blocks/components/ui/alert-dialog.tsx +134 -0
- package/dist/kits/blocks/components/ui/brand-node.tsx +121 -0
- package/dist/kits/blocks/components/ui/button.tsx +122 -0
- package/dist/kits/blocks/components/ui/button_bck.tsx +93 -0
- package/dist/kits/blocks/components/ui/card.tsx +95 -0
- package/dist/kits/blocks/components/ui/checkbox.tsx +30 -0
- package/dist/kits/blocks/components/ui/cta-button.tsx +125 -0
- package/dist/kits/blocks/components/ui/dropdown-menu.tsx +201 -0
- package/dist/kits/blocks/components/ui/feature-card.tsx +91 -0
- package/dist/kits/blocks/components/ui/input.tsx +27 -0
- package/dist/kits/blocks/components/ui/label.tsx +29 -0
- package/dist/kits/blocks/components/ui/pricing-card.tsx +120 -0
- package/dist/kits/blocks/components/ui/select.tsx +25 -0
- package/dist/kits/blocks/components/ui/skeleton.tsx +13 -0
- package/dist/kits/blocks/components/ui/switch.tsx +78 -0
- package/dist/kits/blocks/components/ui/table.tsx +98 -0
- package/dist/kits/blocks/components/ui/testimonial-card.tsx +108 -0
- package/dist/kits/blocks/components/ui/textarea.tsx +26 -0
- package/dist/kits/blocks/components/ui/theme-selector.tsx +247 -0
- package/dist/kits/blocks/components/ui/theme-toggle.tsx +74 -0
- package/dist/kits/blocks/components/ui/toaster.tsx +7 -0
- package/dist/kits/blocks/lib/themes.ts +399 -0
- package/dist/kits/blocks/lib/themes_old.ts +37 -0
- package/dist/kits/blocks/lib/utils.ts +9 -0
- package/dist/kits/blocks/next.config.ts +11 -0
- package/dist/kits/blocks/notes/THEME_GUIDE.md +29 -0
- package/dist/kits/blocks/notes/THEMING_CONVERSION_SUMMARY.md +14 -0
- package/dist/kits/blocks/package-deps.json +22 -0
- package/dist/kits/blocks/public/placeholders/gallery/hero-pexels-broken-9945014.avif +0 -0
- package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626431.jpg +0 -0
- package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626432.jpg +0 -0
- package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626434.jpg +0 -0
- package/dist/kits/blocks/public/placeholders/gallery/pexels-googledeepmind-25626436.jpg +0 -0
- package/dist/kits/blocks/public/placeholders/product_launch/feature_1.png +0 -0
- package/dist/kits/blocks/public/placeholders/product_launch/feature_2.png +0 -0
- package/dist/kits/blocks/public/placeholders/product_launch/feature_3.png +0 -0
- package/dist/kits/blocks/public/placeholders/product_launch/feature_4.png +0 -0
- package/dist/kits/blocks/public/placeholders/product_launch/hero.png +0 -0
- package/dist/kits/blocks/public/placeholders/saas_dashboard/analytics.png +0 -0
- package/dist/kits/blocks/public/placeholders/saas_dashboard/chat.png +0 -0
- package/dist/kits/blocks/public/placeholders/saas_dashboard/projectBoard.png +0 -0
- package/dist/kits/data/.gitkeep +0 -0
- package/dist/kits/data/README.md +80 -0
- package/dist/kits/data/app/(protected)/admin/posts/page.tsx +5 -0
- package/dist/kits/data/app/(protected)/admin/users/page.tsx +5 -0
- package/dist/kits/data/app/api/posts/[id]/route.ts +83 -0
- package/dist/kits/data/app/api/posts/route.ts +138 -0
- package/dist/kits/data/app/api/seed-demo/route.ts +45 -0
- package/dist/kits/data/app/api/users/[id]/route.ts +127 -0
- package/dist/kits/data/app/api/users/check-email/route.ts +18 -0
- package/dist/kits/data/app/api/users/check-unique/route.ts +27 -0
- package/dist/kits/data/app/api/users/route.ts +79 -0
- package/dist/kits/data/app/examples/demo/README.md +4 -0
- package/dist/kits/data/app/examples/demo/create-post-form.tsx +106 -0
- package/dist/kits/data/app/examples/demo/page.tsx +118 -0
- package/dist/kits/data/app/examples/demo/seed-demo-button.tsx +37 -0
- package/dist/kits/data/components/admin/posts-manager.tsx +719 -0
- package/dist/kits/data/components/admin/users-manager.tsx +432 -0
- package/dist/kits/data/lib/prisma.ts +15 -0
- package/dist/kits/data/lib/server/result.ts +90 -0
- package/dist/kits/data/package-deps.json +11 -0
- package/dist/kits/data/scripts/seed-demo.mjs +41 -0
- package/dist/kits/forms/.gitkeep +0 -0
- package/dist/kits/forms/README.md +49 -0
- package/dist/kits/forms/app/.gitkeep +0 -0
- package/dist/kits/forms/app/api/wizard/route.ts +71 -0
- package/dist/kits/forms/app/examples/forms/basic/page.tsx +124 -0
- package/dist/kits/forms/app/examples/forms/server-action/form-client.tsx +28 -0
- package/dist/kits/forms/app/examples/forms/server-action/page.tsx +71 -0
- package/dist/kits/forms/app/examples/forms/wizard/page.tsx +15 -0
- package/dist/kits/forms/app/examples/forms/wizard/wizard-client.tsx +2 -0
- package/dist/kits/forms/components/.gitkeep +0 -0
- package/dist/kits/forms/components/examples/wizard-client.tsx +231 -0
- package/dist/kits/forms/components/hooks/useCheckUnique.ts +79 -0
- package/dist/kits/forms/components/ui/button.tsx +122 -0
- package/dist/kits/forms/components/ui/checkbox.tsx +30 -0
- package/dist/kits/forms/components/ui/form/context.ts +33 -0
- package/dist/kits/forms/components/ui/form/form-control.tsx +28 -0
- package/dist/kits/forms/components/ui/form/form-description.tsx +22 -0
- package/dist/kits/forms/components/ui/form/form-field.tsx +36 -0
- package/dist/kits/forms/components/ui/form/form-item.tsx +21 -0
- package/dist/kits/forms/components/ui/form/form-label.tsx +24 -0
- package/dist/kits/forms/components/ui/form/form-message.tsx +29 -0
- package/dist/kits/forms/components/ui/form/form.tsx +26 -0
- package/dist/kits/forms/components/ui/input.tsx +27 -0
- package/dist/kits/forms/components/ui/label.tsx +29 -0
- package/dist/kits/forms/components/ui/select.tsx +25 -0
- package/dist/kits/forms/components/ui/switch.tsx +78 -0
- package/dist/kits/forms/components/ui/textarea.tsx +26 -0
- package/dist/kits/forms/lib/.gitkeep +0 -0
- package/dist/kits/forms/lib/forms/map-errors.ts +29 -0
- package/dist/kits/forms/lib/prisma.ts +16 -0
- package/dist/kits/forms/lib/utils.ts +9 -0
- package/dist/kits/forms/lib/validation/forms.ts +88 -0
- package/dist/kits/forms/lib/validation/wizard.ts +32 -0
- package/dist/kits/forms/package-deps.json +17 -0
- package/dist/utils/file-operations.d.ts +18 -0
- package/dist/utils/file-operations.d.ts.map +1 -0
- package/dist/utils/file-operations.js +327 -0
- package/dist/utils/file-operations.js.map +1 -0
- package/dist/utils/installation-tracker.d.ts +26 -0
- package/dist/utils/installation-tracker.d.ts.map +1 -0
- package/dist/utils/installation-tracker.js +98 -0
- package/dist/utils/installation-tracker.js.map +1 -0
- package/package.json +51 -21
- package/index.js +0 -1
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
import { Button } from "@/components/ui/button";
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Props for the CTA section component.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Uses a slot-style API for Tailwind className overrides. Each slot's
|
|
13
|
+
* className is merged with component defaults via cn().
|
|
14
|
+
*
|
|
15
|
+
* Prefer customizing spacing via headingText.className and other slot
|
|
16
|
+
* classNames rather than legacy spacing props.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
interface CTAProps {
|
|
21
|
+
/**
|
|
22
|
+
* Optional id for the section.
|
|
23
|
+
* @defaultValue "cta"
|
|
24
|
+
*/
|
|
25
|
+
id?: string;
|
|
26
|
+
/** Optional top-level class to override the section root */
|
|
27
|
+
className?: string;
|
|
28
|
+
|
|
29
|
+
/** Styling configuration objects (slot-style pattern like Navbar) */
|
|
30
|
+
section?: { className?: string };
|
|
31
|
+
container?: { className?: string };
|
|
32
|
+
contentWrapper?: { className?: string };
|
|
33
|
+
headingText?: {
|
|
34
|
+
text?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
subheadingText?: {
|
|
38
|
+
text?: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
};
|
|
41
|
+
descriptionText?: {
|
|
42
|
+
text?: string;
|
|
43
|
+
className?: string;
|
|
44
|
+
};
|
|
45
|
+
actionsWrapper?: { className?: string };
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Primary CTA config or null to hide it (mirrors Navbar ctaButton pattern)
|
|
49
|
+
* Example: { label: "Get Started", href: "#contact" }
|
|
50
|
+
*/
|
|
51
|
+
ctaButton?: { label: string; href: string } | null;
|
|
52
|
+
/** Primary CTA button styles */
|
|
53
|
+
ctaButtonStyle?: {
|
|
54
|
+
unstyled?: boolean;
|
|
55
|
+
style?: React.CSSProperties;
|
|
56
|
+
variant?:
|
|
57
|
+
| "default"
|
|
58
|
+
| "destructive"
|
|
59
|
+
| "outline"
|
|
60
|
+
| "secondary"
|
|
61
|
+
| "ghost"
|
|
62
|
+
| "link";
|
|
63
|
+
size?: "default" | "sm" | "lg" | "icon";
|
|
64
|
+
className?: string;
|
|
65
|
+
};
|
|
66
|
+
/** Optional wrapper slot for the primary CTA */
|
|
67
|
+
ctaButtonWrapper?: { className?: string };
|
|
68
|
+
|
|
69
|
+
/** Optional secondary action */
|
|
70
|
+
secondaryButton?: { label: string; href: string } | null;
|
|
71
|
+
/** Secondary CTA button styles */
|
|
72
|
+
secondaryButtonStyle?: {
|
|
73
|
+
unstyled?: boolean;
|
|
74
|
+
style?: React.CSSProperties;
|
|
75
|
+
variant?:
|
|
76
|
+
| "default"
|
|
77
|
+
| "destructive"
|
|
78
|
+
| "outline"
|
|
79
|
+
| "secondary"
|
|
80
|
+
| "ghost"
|
|
81
|
+
| "link";
|
|
82
|
+
size?: "default" | "sm" | "lg" | "icon";
|
|
83
|
+
className?: string;
|
|
84
|
+
};
|
|
85
|
+
/** Optional wrapper slot for the secondary CTA */
|
|
86
|
+
secondaryButtonWrapper?: { className?: string };
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Legacy spacing hook applied to the heading.
|
|
90
|
+
* @deprecated Prefer margin utilities via headingText.className
|
|
91
|
+
*/
|
|
92
|
+
spacing?: { topMargin?: string };
|
|
93
|
+
|
|
94
|
+
/** Accessibility */
|
|
95
|
+
ariaLabel?: string;
|
|
96
|
+
role?: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Call-to-Action section with a heading, optional subheading/description,
|
|
101
|
+
* and up to two actions (primary and secondary).
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* - Styling: exposes slot-style className overrides (section, container,
|
|
105
|
+
* contentWrapper, headingText, subheadingText, descriptionText, actionsWrapper,
|
|
106
|
+
* ctaButtonStyle, secondaryButtonStyle). Consumer classes are merged after
|
|
107
|
+
* defaults via cn().
|
|
108
|
+
* - Accessibility: rendered as a semantic <section> with aria-label. The role
|
|
109
|
+
* defaults to "region" but can be customized with the role prop.
|
|
110
|
+
* - Motion: subtle hover lift effects on buttons are included by default.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* <CTA
|
|
114
|
+
* headingText={{ text: "Join The Launch Today!" }}
|
|
115
|
+
* descriptionText={{ text: "Start your free trial in minutes." }}
|
|
116
|
+
* ctaButton={{ label: "Sign Up", href: "#contact" }}
|
|
117
|
+
* secondaryButton={{ label: "Learn More", href: "#features" }}
|
|
118
|
+
* />
|
|
119
|
+
*/
|
|
120
|
+
export function CTA({
|
|
121
|
+
id = "cta",
|
|
122
|
+
className,
|
|
123
|
+
|
|
124
|
+
section = {
|
|
125
|
+
className: "bg-background text-foreground",
|
|
126
|
+
},
|
|
127
|
+
container = {
|
|
128
|
+
className:
|
|
129
|
+
"mx-auto flex min-h-[42vh] w-full max-w-6xl flex-col items-center justify-center overflow-hidden px-4 pb-7",
|
|
130
|
+
},
|
|
131
|
+
contentWrapper = {
|
|
132
|
+
className: "flex w-full flex-col items-center text-center",
|
|
133
|
+
},
|
|
134
|
+
headingText = {
|
|
135
|
+
text: "Join The Launch Today!",
|
|
136
|
+
className:
|
|
137
|
+
"text-3xl font-bold leading-[1.1] text-primary sm:text-4xl md:text-5xl text-[var(--heading-fg)]",
|
|
138
|
+
},
|
|
139
|
+
subheadingText = {
|
|
140
|
+
text: "",
|
|
141
|
+
className:
|
|
142
|
+
"mt-2 text-lg font-medium text-muted-foreground sm:text-xl text-[var(--subheading-fg)]",
|
|
143
|
+
},
|
|
144
|
+
descriptionText = {
|
|
145
|
+
text: "",
|
|
146
|
+
className:
|
|
147
|
+
"mt-3 max-w-2xl text-base text-foreground/80 sm:text-lg text-[var(--description-fg)]",
|
|
148
|
+
},
|
|
149
|
+
actionsWrapper = {
|
|
150
|
+
className: "mt-6 flex flex-col items-center gap-3 sm:flex-row",
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
ctaButton = { label: "Sign Up Now", href: "#contact" },
|
|
154
|
+
ctaButtonStyle = {
|
|
155
|
+
variant: "default",
|
|
156
|
+
size: "default",
|
|
157
|
+
className:
|
|
158
|
+
"shadow-lg transition-all duration-200 hover:-translate-y-0.5 hover:shadow-xl border-[var(--btn-border)] focus-visible:ring-[var(--btn-ring)]",
|
|
159
|
+
},
|
|
160
|
+
ctaButtonWrapper = { className: "" },
|
|
161
|
+
|
|
162
|
+
secondaryButton = null,
|
|
163
|
+
secondaryButtonStyle = {
|
|
164
|
+
variant: "outline",
|
|
165
|
+
size: "default",
|
|
166
|
+
className:
|
|
167
|
+
"transition-transform duration-200 hover:-translate-y-0.5 border-[var(--btn-border)] focus-visible:ring-[var(--btn-ring)]",
|
|
168
|
+
},
|
|
169
|
+
secondaryButtonWrapper = { className: "" },
|
|
170
|
+
|
|
171
|
+
spacing = { topMargin: "mt-0 sm:mt-12" },
|
|
172
|
+
// spacing = { topMargin: "mt-[17vh]" },
|
|
173
|
+
|
|
174
|
+
ariaLabel = "Call to action section",
|
|
175
|
+
role = "region",
|
|
176
|
+
}: CTAProps) {
|
|
177
|
+
// default class for actions wrapper (keeps a gap and responsive row layout)
|
|
178
|
+
const actionsWrapperDefault =
|
|
179
|
+
"mt-6 flex flex-col items-center gap-3 sm:flex-row";
|
|
180
|
+
|
|
181
|
+
return (
|
|
182
|
+
<section
|
|
183
|
+
id={id}
|
|
184
|
+
role={role}
|
|
185
|
+
aria-label={ariaLabel}
|
|
186
|
+
className={cn("w-full", section.className, className)}
|
|
187
|
+
>
|
|
188
|
+
<div className={cn(container.className)}>
|
|
189
|
+
<div className={cn(contentWrapper.className)}>
|
|
190
|
+
{headingText?.text ? (
|
|
191
|
+
<h2
|
|
192
|
+
className={cn(
|
|
193
|
+
"text-center",
|
|
194
|
+
spacing?.topMargin,
|
|
195
|
+
headingText.className,
|
|
196
|
+
)}
|
|
197
|
+
>
|
|
198
|
+
{headingText.text}
|
|
199
|
+
</h2>
|
|
200
|
+
) : null}
|
|
201
|
+
|
|
202
|
+
{subheadingText?.text ? (
|
|
203
|
+
<p className={cn(subheadingText.className)}>
|
|
204
|
+
{subheadingText.text}
|
|
205
|
+
</p>
|
|
206
|
+
) : null}
|
|
207
|
+
|
|
208
|
+
{descriptionText?.text ? (
|
|
209
|
+
<p className={cn(descriptionText.className)}>
|
|
210
|
+
{descriptionText.text}
|
|
211
|
+
</p>
|
|
212
|
+
) : null}
|
|
213
|
+
|
|
214
|
+
<div className={cn(actionsWrapperDefault, actionsWrapper.className)}>
|
|
215
|
+
{ctaButton && (
|
|
216
|
+
<Button
|
|
217
|
+
asChild
|
|
218
|
+
unstyled={ctaButtonStyle.unstyled}
|
|
219
|
+
variant={ctaButtonStyle.variant}
|
|
220
|
+
size={ctaButtonStyle.size}
|
|
221
|
+
className={cn(
|
|
222
|
+
ctaButtonWrapper.className,
|
|
223
|
+
ctaButtonStyle.className,
|
|
224
|
+
)}
|
|
225
|
+
style={ctaButtonStyle.style}
|
|
226
|
+
>
|
|
227
|
+
<Link href={ctaButton.href} aria-label={ctaButton.label}>
|
|
228
|
+
{ctaButton.label}
|
|
229
|
+
</Link>
|
|
230
|
+
</Button>
|
|
231
|
+
)}
|
|
232
|
+
|
|
233
|
+
{secondaryButton && (
|
|
234
|
+
<Button
|
|
235
|
+
asChild
|
|
236
|
+
unstyled={secondaryButtonStyle.unstyled}
|
|
237
|
+
variant={secondaryButtonStyle.variant}
|
|
238
|
+
size={secondaryButtonStyle.size}
|
|
239
|
+
className={cn(
|
|
240
|
+
secondaryButtonWrapper.className,
|
|
241
|
+
secondaryButtonStyle.className,
|
|
242
|
+
)}
|
|
243
|
+
style={secondaryButtonStyle.style}
|
|
244
|
+
>
|
|
245
|
+
<Link
|
|
246
|
+
href={secondaryButton.href}
|
|
247
|
+
aria-label={secondaryButton.label}
|
|
248
|
+
>
|
|
249
|
+
{secondaryButton.label}
|
|
250
|
+
</Link>
|
|
251
|
+
</Button>
|
|
252
|
+
)}
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
</section>
|
|
257
|
+
);
|
|
258
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
import { Button } from "@/components/ui/button";
|
|
6
|
+
import { Input } from "@/components/ui/input";
|
|
7
|
+
import { Textarea } from "@/components/ui/textarea";
|
|
8
|
+
import { Label } from "@/components/ui/label";
|
|
9
|
+
|
|
10
|
+
// Supported field types
|
|
11
|
+
type FieldType = "text" | "email" | "tel" | "textarea";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Configuration for a single form field in the Contact section.
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export interface ContactField {
|
|
18
|
+
/** Unique id/name for the field. Used for htmlFor and form submission. */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Visible label text for the field */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Placeholder text rendered inside the input */
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
/** Whether the field is required for form submission */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/** Type of field to render (text, email, tel, textarea). */
|
|
27
|
+
type?: FieldType;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Props for the Contact section component.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* - Styling: exposes slot-style className overrides (section, container,
|
|
35
|
+
* headerWrapper, headerText, subheaderText, form, fieldsWrapper, field,
|
|
36
|
+
* label, input, textarea, submitButtonWrapper, submitButtonStyle). Consumer
|
|
37
|
+
* classes are merged after defaults via cn().
|
|
38
|
+
* - Behavior: onSubmit is called with the form event after default
|
|
39
|
+
* prevention. Provide your own handler to integrate with APIs.
|
|
40
|
+
* - Motion: controlled by enableMotion; when false, removes button hover lift.
|
|
41
|
+
* - Accessibility: rendered as a semantic <section> with aria-label.
|
|
42
|
+
*/
|
|
43
|
+
export interface ContactProps {
|
|
44
|
+
/** Array of fields to render in the form. @defaultValue defaultFormData */
|
|
45
|
+
fields?: ContactField[];
|
|
46
|
+
/** Heading text above the form. @defaultValue "Ready to Grow Your Business?" */
|
|
47
|
+
contactHeaderText?: string;
|
|
48
|
+
/** Subheading under the header. @defaultValue "Schedule a free consultation with our experts." */
|
|
49
|
+
contactSubHeaderText?: string;
|
|
50
|
+
|
|
51
|
+
/** Optional id to attach to the root section element. @defaultValue "contact" */
|
|
52
|
+
id?: string;
|
|
53
|
+
/** Optional top-level class to override the section root */
|
|
54
|
+
className?: string;
|
|
55
|
+
|
|
56
|
+
/** Styling configuration objects (slots) */
|
|
57
|
+
section?: { className?: string };
|
|
58
|
+
container?: { className?: string };
|
|
59
|
+
headerWrapper?: { className?: string };
|
|
60
|
+
headerText?: { className?: string };
|
|
61
|
+
subheaderText?: { className?: string };
|
|
62
|
+
form?: { className?: string };
|
|
63
|
+
fieldsWrapper?: { className?: string };
|
|
64
|
+
field?: { className?: string };
|
|
65
|
+
label?: { className?: string };
|
|
66
|
+
input?: { className?: string };
|
|
67
|
+
textarea?: { className?: string };
|
|
68
|
+
submitButtonWrapper?: { className?: string };
|
|
69
|
+
submitButtonStyle?: {
|
|
70
|
+
unstyled?: boolean;
|
|
71
|
+
style?: React.CSSProperties;
|
|
72
|
+
variant?:
|
|
73
|
+
| "default"
|
|
74
|
+
| "destructive"
|
|
75
|
+
| "outline"
|
|
76
|
+
| "secondary"
|
|
77
|
+
| "ghost"
|
|
78
|
+
| "link";
|
|
79
|
+
size?: "default" | "sm" | "lg" | "icon";
|
|
80
|
+
className?: string;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** Text for the submit button. @defaultValue "Schedule Free Consultation" */
|
|
84
|
+
submitButtonText?: string;
|
|
85
|
+
/** Callback fired on submit; default prevented. */
|
|
86
|
+
onSubmit?: (e: React.FormEvent<HTMLFormElement>) => void;
|
|
87
|
+
/** ARIA label for the section. @defaultValue "Contact section" */
|
|
88
|
+
ariaLabel?: string;
|
|
89
|
+
|
|
90
|
+
/** When false, removes hover lift/transition on the submit button */
|
|
91
|
+
enableMotion?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const defaultFormData: ContactField[] = [
|
|
95
|
+
{
|
|
96
|
+
id: "name",
|
|
97
|
+
label: "Your Full Name",
|
|
98
|
+
placeholder: "John Doe",
|
|
99
|
+
required: true,
|
|
100
|
+
type: "text",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "email",
|
|
104
|
+
label: "Email Address",
|
|
105
|
+
placeholder: "you@example.com",
|
|
106
|
+
required: true,
|
|
107
|
+
type: "email",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: "phone",
|
|
111
|
+
label: "Phone Number",
|
|
112
|
+
placeholder: "Enter your phone number",
|
|
113
|
+
required: false,
|
|
114
|
+
type: "tel",
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "company",
|
|
118
|
+
label: "Company",
|
|
119
|
+
placeholder: "Enter your company name",
|
|
120
|
+
required: false,
|
|
121
|
+
type: "text",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: "message",
|
|
125
|
+
label: "Message",
|
|
126
|
+
placeholder: "Tell us about your project...",
|
|
127
|
+
required: true,
|
|
128
|
+
type: "textarea",
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Contact section with a configurable form and submit action.
|
|
134
|
+
*
|
|
135
|
+
* @remarks
|
|
136
|
+
* - Styling: slot-style className overrides are merged via cn().
|
|
137
|
+
* - Behavior: onSubmit is invoked with the form event after calling
|
|
138
|
+
* preventDefault().
|
|
139
|
+
* - Motion: enableMotion toggles the button hover lift/transition.
|
|
140
|
+
* - Accessibility: Uses a semantic <section> with aria-label.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* <Contact onSubmit={(e) => { // send to your API }} />
|
|
144
|
+
*/
|
|
145
|
+
export function Contact({
|
|
146
|
+
fields = defaultFormData,
|
|
147
|
+
contactHeaderText = "Ready to Grow Your Business?",
|
|
148
|
+
contactSubHeaderText = "Schedule a free consultation with our experts.",
|
|
149
|
+
id = "contact",
|
|
150
|
+
className,
|
|
151
|
+
section = { className: "py-16 px-4 bg-primary" },
|
|
152
|
+
container = { className: "mx-auto max-w-4xl" },
|
|
153
|
+
headerWrapper = { className: "mb-8 text-center" },
|
|
154
|
+
headerText = {
|
|
155
|
+
className: "text-2xl font-bold font-poppins text-primary-foreground",
|
|
156
|
+
},
|
|
157
|
+
subheaderText = {
|
|
158
|
+
className: "mt-2 text-lg font-inter text-primary-foreground px-4 md:px-14",
|
|
159
|
+
},
|
|
160
|
+
form = {
|
|
161
|
+
className:
|
|
162
|
+
"bg-card p-8 rounded-lg shadow-md border border-border bg-[var(--card-bg)] text-[var(--card-fg)] border-[var(--card-border)] shadow-[var(--card-shadow)]",
|
|
163
|
+
},
|
|
164
|
+
fieldsWrapper = { className: "space-y-4" },
|
|
165
|
+
field = { className: "space-y-2" },
|
|
166
|
+
label = {
|
|
167
|
+
className:
|
|
168
|
+
"text-card-foreground text-sm font-medium font-poppins block text-[var(--label-fg)]",
|
|
169
|
+
},
|
|
170
|
+
input = {
|
|
171
|
+
className:
|
|
172
|
+
"w-full p-3 border border-input rounded-md bg-background text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent font-inter border-[var(--input-border)] bg-[var(--input-bg)] text-[var(--input-fg)] placeholder:text-[var(--input-placeholder)] focus-visible:ring-[var(--input-focus-ring)] focus-visible:ring-offset-[var(--input-ring-offset)]",
|
|
173
|
+
},
|
|
174
|
+
textarea = {
|
|
175
|
+
className:
|
|
176
|
+
"w-full p-3 border border-input rounded-md bg-background text-foreground placeholder-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent resize-vertical min-h-[120px] font-inter border-[var(--input-border)] bg-[var(--input-bg)] text-[var(--input-fg)] placeholder:text-[var(--input-placeholder)] focus-visible:ring-[var(--input-focus-ring)] focus-visible:ring-offset-[var(--input-ring-offset)]",
|
|
177
|
+
},
|
|
178
|
+
submitButtonWrapper = { className: "pt-2" },
|
|
179
|
+
submitButtonStyle = {
|
|
180
|
+
variant: "default",
|
|
181
|
+
size: "lg",
|
|
182
|
+
className:
|
|
183
|
+
"w-full shadow-lg hover:shadow-xl transition-all duration-200 hover:-translate-y-0.5 border-[var(--btn-border)] focus-visible:ring-[var(--btn-ring)]",
|
|
184
|
+
},
|
|
185
|
+
submitButtonText = "Schedule Free Consultation",
|
|
186
|
+
onSubmit,
|
|
187
|
+
ariaLabel = "Contact section",
|
|
188
|
+
enableMotion = true,
|
|
189
|
+
}: ContactProps) {
|
|
190
|
+
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
|
191
|
+
e.preventDefault();
|
|
192
|
+
onSubmit?.(e);
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<section
|
|
197
|
+
id={id}
|
|
198
|
+
className={cn("w-full", section.className, className)}
|
|
199
|
+
aria-label={ariaLabel}
|
|
200
|
+
>
|
|
201
|
+
<div className={cn(container.className)}>
|
|
202
|
+
<div className={cn(headerWrapper.className)}>
|
|
203
|
+
{contactHeaderText && (
|
|
204
|
+
<h2 className={cn(headerText.className)}>{contactHeaderText}</h2>
|
|
205
|
+
)}
|
|
206
|
+
{contactSubHeaderText && (
|
|
207
|
+
<p className={cn(subheaderText.className)}>
|
|
208
|
+
{contactSubHeaderText}
|
|
209
|
+
</p>
|
|
210
|
+
)}
|
|
211
|
+
</div>
|
|
212
|
+
<form onSubmit={handleSubmit} className={cn(form.className)}>
|
|
213
|
+
<div className={cn(fieldsWrapper.className)}>
|
|
214
|
+
{fields.map((f) => {
|
|
215
|
+
const isTextarea = f.type === "textarea";
|
|
216
|
+
return (
|
|
217
|
+
<div key={f.id} className={cn(field.className)}>
|
|
218
|
+
<Label htmlFor={f.id} className={cn(label.className)}>
|
|
219
|
+
{f.label}
|
|
220
|
+
{f.required && (
|
|
221
|
+
<span className="text-destructive ml-1">*</span>
|
|
222
|
+
)}
|
|
223
|
+
</Label>
|
|
224
|
+
{isTextarea ? (
|
|
225
|
+
<Textarea
|
|
226
|
+
id={f.id}
|
|
227
|
+
name={f.id}
|
|
228
|
+
placeholder={f.placeholder}
|
|
229
|
+
required={f.required}
|
|
230
|
+
rows={4}
|
|
231
|
+
className={cn(textarea.className)}
|
|
232
|
+
/>
|
|
233
|
+
) : (
|
|
234
|
+
<Input
|
|
235
|
+
type={f.type ?? "text"}
|
|
236
|
+
id={f.id}
|
|
237
|
+
name={f.id}
|
|
238
|
+
placeholder={f.placeholder}
|
|
239
|
+
required={f.required}
|
|
240
|
+
className={cn(input.className)}
|
|
241
|
+
/>
|
|
242
|
+
)}
|
|
243
|
+
</div>
|
|
244
|
+
);
|
|
245
|
+
})}
|
|
246
|
+
<div className={cn(submitButtonWrapper.className)}>
|
|
247
|
+
<Button
|
|
248
|
+
type="submit"
|
|
249
|
+
unstyled={submitButtonStyle.unstyled}
|
|
250
|
+
variant={submitButtonStyle.variant}
|
|
251
|
+
size={submitButtonStyle.size}
|
|
252
|
+
className={cn(
|
|
253
|
+
submitButtonStyle.className,
|
|
254
|
+
!enableMotion &&
|
|
255
|
+
"transition-none hover:!translate-y-0 hover:shadow-none",
|
|
256
|
+
)}
|
|
257
|
+
style={submitButtonStyle.style}
|
|
258
|
+
>
|
|
259
|
+
{submitButtonText}
|
|
260
|
+
</Button>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
</form>
|
|
264
|
+
</div>
|
|
265
|
+
</section>
|
|
266
|
+
);
|
|
267
|
+
}
|