nextworks 0.2.0-alpha.11 → 0.2.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +283 -282
- package/dist/cli_manifests/blocks_manifest.json +198 -175
- package/dist/kits/blocks/.nextworks/docs/BLOCKS_QUICKSTART.md +101 -100
- package/dist/kits/blocks/.nextworks/docs/BLOCKS_README.md +105 -104
- package/dist/kits/blocks/.nextworks/docs/THEME_GUIDE.md +1 -1
- package/dist/kits/blocks/app/templates/aiworkflow/PresetThemeVars.tsx +58 -0
- package/dist/kits/blocks/app/templates/aiworkflow/README.md +46 -0
- package/dist/kits/blocks/app/templates/aiworkflow/components/CTA.tsx +44 -0
- package/dist/kits/blocks/app/templates/aiworkflow/components/Contact.tsx +105 -0
- package/dist/kits/blocks/app/templates/aiworkflow/components/FAQ.tsx +63 -0
- package/dist/kits/blocks/app/templates/aiworkflow/components/Features.tsx +65 -0
- package/dist/kits/blocks/app/templates/aiworkflow/components/Footer.tsx +109 -0
- package/dist/kits/blocks/app/templates/aiworkflow/components/Hero.tsx +636 -0
- package/dist/kits/blocks/app/templates/aiworkflow/components/Navbar.tsx +90 -0
- package/dist/kits/blocks/app/templates/aiworkflow/components/Pricing.tsx +86 -0
- package/dist/kits/blocks/app/templates/aiworkflow/components/ProcessTimeline.tsx +103 -0
- package/dist/kits/blocks/app/templates/aiworkflow/components/Testimonials.tsx +56 -0
- package/dist/kits/blocks/app/templates/aiworkflow/components/TrustBadges.tsx +59 -0
- package/dist/kits/blocks/app/templates/aiworkflow/page.tsx +43 -0
- package/dist/kits/blocks/app/templates/digitalagency/PresetThemeVars.tsx +80 -80
- package/dist/kits/blocks/app/templates/digitalagency/README.md +42 -42
- package/dist/kits/blocks/app/templates/digitalagency/components/Pricing.tsx +114 -114
- package/dist/kits/blocks/app/templates/digitalagency/components/Process.tsx +59 -59
- package/dist/kits/blocks/app/templates/digitalagency/components/Services.tsx +55 -55
- package/dist/kits/blocks/app/templates/digitalagency/components/Team.tsx +28 -28
- package/dist/kits/blocks/app/templates/digitalagency/components/Testimonials.tsx +65 -65
- package/dist/kits/blocks/app/templates/digitalagency/page.tsx +38 -38
- package/dist/kits/blocks/app/templates/gallery/PresetThemeVars.tsx +84 -84
- package/dist/kits/blocks/app/templates/productlaunch/PresetThemeVars.tsx +75 -75
- package/dist/kits/blocks/app/templates/productlaunch/README.md +62 -62
- package/dist/kits/blocks/app/templates/productlaunch/components/About.tsx +84 -84
- package/dist/kits/blocks/app/templates/productlaunch/components/CTA.tsx +50 -50
- package/dist/kits/blocks/app/templates/productlaunch/components/Contact.tsx +231 -231
- package/dist/kits/blocks/app/templates/productlaunch/components/FAQ.tsx +86 -86
- package/dist/kits/blocks/app/templates/productlaunch/components/Features.tsx +83 -83
- package/dist/kits/blocks/app/templates/productlaunch/components/Footer.tsx +132 -132
- package/dist/kits/blocks/app/templates/productlaunch/components/Hero.tsx +88 -88
- package/dist/kits/blocks/app/templates/productlaunch/components/Navbar.tsx +116 -116
- package/dist/kits/blocks/app/templates/productlaunch/components/Pricing.tsx +106 -106
- package/dist/kits/blocks/app/templates/productlaunch/components/ProcessTimeline.tsx +110 -110
- package/dist/kits/blocks/app/templates/productlaunch/components/ServicesGrid.tsx +68 -68
- package/dist/kits/blocks/app/templates/productlaunch/components/Team.tsx +104 -104
- package/dist/kits/blocks/app/templates/productlaunch/components/Testimonials.tsx +90 -90
- package/dist/kits/blocks/app/templates/productlaunch/components/TrustBadges.tsx +76 -76
- package/dist/kits/blocks/app/templates/productlaunch/page.tsx +43 -43
- package/dist/kits/blocks/app/templates/saasdashboard/PresetThemeVars.tsx +80 -80
- package/dist/kits/blocks/app/templates/saasdashboard/README.md +44 -44
- package/dist/kits/blocks/app/templates/saasdashboard/components/Contact.tsx +129 -129
- package/dist/kits/blocks/app/templates/saasdashboard/components/Dashboard.tsx +293 -293
- package/dist/kits/blocks/app/templates/saasdashboard/components/FAQ.tsx +55 -55
- package/dist/kits/blocks/app/templates/saasdashboard/components/Features.tsx +90 -90
- package/dist/kits/blocks/app/templates/saasdashboard/components/Footer.tsx +77 -77
- package/dist/kits/blocks/app/templates/saasdashboard/components/Hero.tsx +104 -104
- package/dist/kits/blocks/app/templates/saasdashboard/components/Hero_mask.tsx +126 -126
- package/dist/kits/blocks/app/templates/saasdashboard/components/Navbar.tsx +117 -117
- package/dist/kits/blocks/app/templates/saasdashboard/components/Pricing.tsx +90 -90
- package/dist/kits/blocks/app/templates/saasdashboard/components/SmoothScroll.tsx +96 -96
- package/dist/kits/blocks/app/templates/saasdashboard/components/Testimonials.tsx +72 -72
- package/dist/kits/blocks/app/templates/saasdashboard/components/TrustBadges.tsx +53 -53
- package/dist/kits/blocks/app/templates/saasdashboard/page.tsx +39 -39
- package/dist/kits/blocks/components/enhanced-theme-provider.tsx +195 -195
- package/dist/kits/blocks/components/providers/BlocksAppProviders.tsx +27 -27
- package/dist/kits/blocks/components/sections/About.tsx +291 -291
- package/dist/kits/blocks/components/sections/CTA.tsx +257 -257
- package/dist/kits/blocks/components/sections/Contact.tsx +267 -267
- package/dist/kits/blocks/components/sections/FAQ.tsx +214 -214
- package/dist/kits/blocks/components/sections/Features.tsx +268 -268
- package/dist/kits/blocks/components/sections/Footer.tsx +302 -302
- package/dist/kits/blocks/components/sections/HeroMotion.tsx +308 -308
- package/dist/kits/blocks/components/sections/HeroOverlay.tsx +358 -358
- package/dist/kits/blocks/components/sections/HeroProductDemo.tsx +236 -0
- package/dist/kits/blocks/components/sections/HeroSplit.tsx +352 -352
- package/dist/kits/blocks/components/sections/Navbar.tsx +350 -350
- package/dist/kits/blocks/components/sections/PortfolioSimple.tsx +549 -549
- package/dist/kits/blocks/components/sections/Pricing.tsx +264 -264
- package/dist/kits/blocks/components/sections/ProcessTimeline.tsx +325 -325
- package/dist/kits/blocks/components/sections/ServicesGrid.tsx +210 -210
- package/dist/kits/blocks/components/sections/Team.tsx +309 -309
- package/dist/kits/blocks/components/sections/Testimonials.tsx +158 -158
- package/dist/kits/blocks/components/sections/TrustBadges.tsx +162 -162
- package/dist/kits/blocks/components/sections/product-demo/ApprovalInboxPanel.tsx +125 -0
- package/dist/kits/blocks/components/sections/product-demo/DemoStage.tsx +397 -0
- package/dist/kits/blocks/components/sections/product-demo/DemoWindow.tsx +128 -0
- package/dist/kits/blocks/components/sections/product-demo/KnowledgePanel.tsx +127 -0
- package/dist/kits/blocks/components/sections/product-demo/RunConsolePanel.tsx +150 -0
- package/dist/kits/blocks/components/sections/product-demo/WorkflowStudioPanel.tsx +191 -0
- package/dist/kits/blocks/components/sections/product-demo/types.ts +193 -0
- package/dist/kits/blocks/components/theme-provider.tsx +1 -1
- package/dist/kits/blocks/components/ui/alert-dialog.tsx +134 -134
- package/dist/kits/blocks/components/ui/brand-node.tsx +121 -121
- package/dist/kits/blocks/components/ui/button.tsx +122 -122
- package/dist/kits/blocks/components/ui/card.tsx +95 -95
- package/dist/kits/blocks/components/ui/checkbox.tsx +30 -30
- package/dist/kits/blocks/components/ui/cta-button.tsx +125 -125
- package/dist/kits/blocks/components/ui/dropdown-menu.tsx +201 -201
- package/dist/kits/blocks/components/ui/feature-card.tsx +91 -91
- package/dist/kits/blocks/components/ui/input.tsx +27 -27
- package/dist/kits/blocks/components/ui/label.tsx +29 -29
- package/dist/kits/blocks/components/ui/pricing-card.tsx +120 -120
- package/dist/kits/blocks/components/ui/select.tsx +25 -25
- package/dist/kits/blocks/components/ui/skeleton.tsx +13 -13
- package/dist/kits/blocks/components/ui/table.tsx +98 -98
- package/dist/kits/blocks/components/ui/testimonial-card.tsx +108 -108
- package/dist/kits/blocks/components/ui/textarea.tsx +26 -26
- package/dist/kits/blocks/components/ui/theme-selector.tsx +243 -243
- package/dist/kits/blocks/components/ui/theme-toggle.tsx +74 -74
- package/dist/kits/blocks/components/ui/toaster.tsx +7 -7
- package/dist/kits/blocks/lib/themes.ts +400 -400
- package/dist/kits/blocks/lib/utils.ts +6 -6
- package/dist/kits/blocks/package-deps.json +3 -3
- package/package.json +1 -1
|
@@ -1,257 +1,257 @@
|
|
|
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
|
-
|
|
173
|
-
ariaLabel = "Call to action section",
|
|
174
|
-
role = "region",
|
|
175
|
-
}: CTAProps) {
|
|
176
|
-
// default class for actions wrapper (keeps a gap and responsive row layout)
|
|
177
|
-
const actionsWrapperDefault =
|
|
178
|
-
"mt-6 flex flex-col items-center gap-3 sm:flex-row";
|
|
179
|
-
|
|
180
|
-
return (
|
|
181
|
-
<section
|
|
182
|
-
id={id}
|
|
183
|
-
role={role}
|
|
184
|
-
aria-label={ariaLabel}
|
|
185
|
-
className={cn("w-full", section.className, className)}
|
|
186
|
-
>
|
|
187
|
-
<div className={cn(container.className)}>
|
|
188
|
-
<div className={cn(contentWrapper.className)}>
|
|
189
|
-
{headingText?.text ? (
|
|
190
|
-
<h2
|
|
191
|
-
className={cn(
|
|
192
|
-
"text-center",
|
|
193
|
-
spacing?.topMargin,
|
|
194
|
-
headingText.className,
|
|
195
|
-
)}
|
|
196
|
-
>
|
|
197
|
-
{headingText.text}
|
|
198
|
-
</h2>
|
|
199
|
-
) : null}
|
|
200
|
-
|
|
201
|
-
{subheadingText?.text ? (
|
|
202
|
-
<p className={cn(subheadingText.className)}>
|
|
203
|
-
{subheadingText.text}
|
|
204
|
-
</p>
|
|
205
|
-
) : null}
|
|
206
|
-
|
|
207
|
-
{descriptionText?.text ? (
|
|
208
|
-
<p className={cn(descriptionText.className)}>
|
|
209
|
-
{descriptionText.text}
|
|
210
|
-
</p>
|
|
211
|
-
) : null}
|
|
212
|
-
|
|
213
|
-
<div className={cn(actionsWrapperDefault, actionsWrapper.className)}>
|
|
214
|
-
{ctaButton && (
|
|
215
|
-
<Button
|
|
216
|
-
asChild
|
|
217
|
-
unstyled={ctaButtonStyle.unstyled}
|
|
218
|
-
variant={ctaButtonStyle.variant}
|
|
219
|
-
size={ctaButtonStyle.size}
|
|
220
|
-
className={cn(
|
|
221
|
-
ctaButtonWrapper.className,
|
|
222
|
-
ctaButtonStyle.className,
|
|
223
|
-
)}
|
|
224
|
-
style={ctaButtonStyle.style}
|
|
225
|
-
>
|
|
226
|
-
<Link href={ctaButton.href} aria-label={ctaButton.label}>
|
|
227
|
-
{ctaButton.label}
|
|
228
|
-
</Link>
|
|
229
|
-
</Button>
|
|
230
|
-
)}
|
|
231
|
-
|
|
232
|
-
{secondaryButton && (
|
|
233
|
-
<Button
|
|
234
|
-
asChild
|
|
235
|
-
unstyled={secondaryButtonStyle.unstyled}
|
|
236
|
-
variant={secondaryButtonStyle.variant}
|
|
237
|
-
size={secondaryButtonStyle.size}
|
|
238
|
-
className={cn(
|
|
239
|
-
secondaryButtonWrapper.className,
|
|
240
|
-
secondaryButtonStyle.className,
|
|
241
|
-
)}
|
|
242
|
-
style={secondaryButtonStyle.style}
|
|
243
|
-
>
|
|
244
|
-
<Link
|
|
245
|
-
href={secondaryButton.href}
|
|
246
|
-
aria-label={secondaryButton.label}
|
|
247
|
-
>
|
|
248
|
-
{secondaryButton.label}
|
|
249
|
-
</Link>
|
|
250
|
-
</Button>
|
|
251
|
-
)}
|
|
252
|
-
</div>
|
|
253
|
-
</div>
|
|
254
|
-
</div>
|
|
255
|
-
</section>
|
|
256
|
-
);
|
|
257
|
-
}
|
|
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
|
+
|
|
173
|
+
ariaLabel = "Call to action section",
|
|
174
|
+
role = "region",
|
|
175
|
+
}: CTAProps) {
|
|
176
|
+
// default class for actions wrapper (keeps a gap and responsive row layout)
|
|
177
|
+
const actionsWrapperDefault =
|
|
178
|
+
"mt-6 flex flex-col items-center gap-3 sm:flex-row";
|
|
179
|
+
|
|
180
|
+
return (
|
|
181
|
+
<section
|
|
182
|
+
id={id}
|
|
183
|
+
role={role}
|
|
184
|
+
aria-label={ariaLabel}
|
|
185
|
+
className={cn("w-full", section.className, className)}
|
|
186
|
+
>
|
|
187
|
+
<div className={cn(container.className)}>
|
|
188
|
+
<div className={cn(contentWrapper.className)}>
|
|
189
|
+
{headingText?.text ? (
|
|
190
|
+
<h2
|
|
191
|
+
className={cn(
|
|
192
|
+
"text-center",
|
|
193
|
+
spacing?.topMargin,
|
|
194
|
+
headingText.className,
|
|
195
|
+
)}
|
|
196
|
+
>
|
|
197
|
+
{headingText.text}
|
|
198
|
+
</h2>
|
|
199
|
+
) : null}
|
|
200
|
+
|
|
201
|
+
{subheadingText?.text ? (
|
|
202
|
+
<p className={cn(subheadingText.className)}>
|
|
203
|
+
{subheadingText.text}
|
|
204
|
+
</p>
|
|
205
|
+
) : null}
|
|
206
|
+
|
|
207
|
+
{descriptionText?.text ? (
|
|
208
|
+
<p className={cn(descriptionText.className)}>
|
|
209
|
+
{descriptionText.text}
|
|
210
|
+
</p>
|
|
211
|
+
) : null}
|
|
212
|
+
|
|
213
|
+
<div className={cn(actionsWrapperDefault, actionsWrapper.className)}>
|
|
214
|
+
{ctaButton && (
|
|
215
|
+
<Button
|
|
216
|
+
asChild
|
|
217
|
+
unstyled={ctaButtonStyle.unstyled}
|
|
218
|
+
variant={ctaButtonStyle.variant}
|
|
219
|
+
size={ctaButtonStyle.size}
|
|
220
|
+
className={cn(
|
|
221
|
+
ctaButtonWrapper.className,
|
|
222
|
+
ctaButtonStyle.className,
|
|
223
|
+
)}
|
|
224
|
+
style={ctaButtonStyle.style}
|
|
225
|
+
>
|
|
226
|
+
<Link href={ctaButton.href} aria-label={ctaButton.label}>
|
|
227
|
+
{ctaButton.label}
|
|
228
|
+
</Link>
|
|
229
|
+
</Button>
|
|
230
|
+
)}
|
|
231
|
+
|
|
232
|
+
{secondaryButton && (
|
|
233
|
+
<Button
|
|
234
|
+
asChild
|
|
235
|
+
unstyled={secondaryButtonStyle.unstyled}
|
|
236
|
+
variant={secondaryButtonStyle.variant}
|
|
237
|
+
size={secondaryButtonStyle.size}
|
|
238
|
+
className={cn(
|
|
239
|
+
secondaryButtonWrapper.className,
|
|
240
|
+
secondaryButtonStyle.className,
|
|
241
|
+
)}
|
|
242
|
+
style={secondaryButtonStyle.style}
|
|
243
|
+
>
|
|
244
|
+
<Link
|
|
245
|
+
href={secondaryButton.href}
|
|
246
|
+
aria-label={secondaryButton.label}
|
|
247
|
+
>
|
|
248
|
+
{secondaryButton.label}
|
|
249
|
+
</Link>
|
|
250
|
+
</Button>
|
|
251
|
+
)}
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
</section>
|
|
256
|
+
);
|
|
257
|
+
}
|