nextworks 0.2.0-alpha.2 → 0.2.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +280 -228
- package/dist/cli_manifests/blocks_manifest.json +193 -194
- package/dist/commands/blocks.d.ts +3 -0
- package/dist/commands/blocks.d.ts.map +1 -1
- package/dist/commands/blocks.js +128 -19
- package/dist/commands/blocks.js.map +1 -1
- package/dist/commands/doctor.d.ts +136 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +696 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/remove-blocks.d.ts +4 -1
- package/dist/commands/remove-blocks.d.ts.map +1 -1
- package/dist/commands/remove-blocks.js +24 -6
- package/dist/commands/remove-blocks.js.map +1 -1
- package/dist/index.js +125 -4
- package/dist/index.js.map +1 -1
- package/dist/kits/blocks/.nextworks/docs/BLOCKS_QUICKSTART.md +104 -194
- package/dist/kits/blocks/.nextworks/docs/BLOCKS_README.md +115 -75
- package/dist/kits/blocks/.nextworks/docs/THEME_GUIDE.md +269 -251
- package/dist/kits/blocks/app/templates/digitalagency/PresetThemeVars.tsx +80 -80
- package/dist/kits/blocks/app/templates/digitalagency/README.md +42 -36
- package/dist/kits/blocks/app/templates/digitalagency/components/About.tsx +71 -99
- package/dist/kits/blocks/app/templates/digitalagency/components/CTA.tsx +40 -74
- package/dist/kits/blocks/app/templates/digitalagency/components/Contact.tsx +123 -227
- package/dist/kits/blocks/app/templates/digitalagency/components/Footer.tsx +89 -89
- package/dist/kits/blocks/app/templates/digitalagency/components/Hero.tsx +83 -90
- package/dist/kits/blocks/app/templates/digitalagency/components/Navbar.tsx +121 -168
- package/dist/kits/blocks/app/templates/digitalagency/components/NetworkPattern.tsx +288 -297
- package/dist/kits/blocks/app/templates/digitalagency/components/Portfolio.tsx +157 -157
- 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 +130 -85
- package/dist/kits/blocks/app/templates/gallery/page.tsx +357 -303
- package/dist/kits/blocks/app/templates/productlaunch/PresetThemeVars.tsx +75 -74
- package/dist/kits/blocks/app/templates/productlaunch/README.md +62 -55
- package/dist/kits/blocks/app/templates/productlaunch/components/About.tsx +84 -178
- package/dist/kits/blocks/app/templates/productlaunch/components/CTA.tsx +50 -93
- package/dist/kits/blocks/app/templates/productlaunch/components/Contact.tsx +231 -231
- package/dist/kits/blocks/app/templates/productlaunch/components/FAQ.tsx +86 -93
- package/dist/kits/blocks/app/templates/productlaunch/components/Features.tsx +83 -84
- package/dist/kits/blocks/app/templates/productlaunch/components/Footer.tsx +132 -132
- package/dist/kits/blocks/app/templates/productlaunch/components/Hero.tsx +88 -89
- package/dist/kits/blocks/app/templates/productlaunch/components/Navbar.tsx +116 -162
- 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 -89
- 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 -38
- package/dist/kits/blocks/app/templates/saasdashboard/components/Contact.tsx +129 -176
- 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 -91
- package/dist/kits/blocks/app/templates/saasdashboard/components/Footer.tsx +77 -77
- package/dist/kits/blocks/app/templates/saasdashboard/components/Hero.tsx +104 -105
- package/dist/kits/blocks/app/templates/saasdashboard/components/Hero_mask.tsx +126 -127
- package/dist/kits/blocks/app/templates/saasdashboard/components/Navbar.tsx +117 -159
- package/dist/kits/blocks/app/templates/saasdashboard/components/Pricing.tsx +90 -90
- package/dist/kits/blocks/app/templates/saasdashboard/components/SmoothScroll.tsx +96 -97
- 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 -183
- 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 -258
- package/dist/kits/blocks/components/sections/CommandShowcase.tsx +517 -0
- package/dist/kits/blocks/components/sections/Contact.tsx +267 -267
- package/dist/kits/blocks/components/sections/FAQ.tsx +214 -225
- package/dist/kits/blocks/components/sections/FeaturedProjectShowcase.tsx +687 -0
- package/dist/kits/blocks/components/sections/Features.tsx +268 -270
- 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 +246 -0
- package/dist/kits/blocks/components/sections/HeroSplit.tsx +352 -352
- package/dist/kits/blocks/components/sections/HeroWithVideo.tsx +495 -0
- package/dist/kits/blocks/components/sections/Navbar.tsx +352 -353
- package/dist/kits/blocks/components/sections/PortfolioSimple.tsx +549 -550
- 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/ProjectDeepDive.tsx +805 -0
- package/dist/kits/blocks/components/sections/SelectedWorkRail.tsx +485 -0
- 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 +128 -0
- package/dist/kits/blocks/components/sections/product-demo/DemoStage.tsx +519 -0
- package/dist/kits/blocks/components/sections/product-demo/DemoWindow.tsx +140 -0
- package/dist/kits/blocks/components/sections/product-demo/KnowledgePanel.tsx +130 -0
- package/dist/kits/blocks/components/sections/product-demo/RunConsolePanel.tsx +430 -0
- package/dist/kits/blocks/components/sections/product-demo/TaskListPanel.tsx +302 -0
- package/dist/kits/blocks/components/sections/product-demo/WorkflowStudioPanel.tsx +744 -0
- package/dist/kits/blocks/components/sections/product-demo/types.ts +262 -0
- package/dist/kits/blocks/components/theme-provider.tsx +1 -34
- 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 -247
- 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 -9
- package/dist/kits/blocks/package-deps.json +40 -28
- package/dist/kits/blocks/tsconfig.json +11 -0
- package/dist/kits/blocks/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/file-operations.d.ts +3 -1
- package/dist/utils/file-operations.d.ts.map +1 -1
- package/dist/utils/file-operations.js +84 -12
- package/dist/utils/file-operations.js.map +1 -1
- package/dist/utils/installation-tracker.d.ts +2 -2
- package/dist/utils/installation-tracker.d.ts.map +1 -1
- package/dist/utils/installation-tracker.js +11 -11
- package/dist/utils/installation-tracker.js.map +1 -1
- package/dist/utils/package-manager.d.ts +6 -0
- package/dist/utils/package-manager.d.ts.map +1 -0
- package/dist/utils/package-manager.js +58 -0
- package/dist/utils/package-manager.js.map +1 -0
- package/dist/utils/yarn-pnp.d.ts +6 -0
- package/dist/utils/yarn-pnp.d.ts.map +1 -0
- package/dist/utils/yarn-pnp.js +39 -0
- package/dist/utils/yarn-pnp.js.map +1 -0
- package/package.json +5 -2
- package/dist/kits/blocks/notes/THEME_GUIDE.md +0 -29
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "@/lib/utils";
|
|
4
|
-
|
|
5
|
-
function Card({ className, ...props }: React.ComponentProps<"div">) {
|
|
6
|
-
return (
|
|
7
|
-
<div
|
|
8
|
-
data-slot="card"
|
|
9
|
-
className={cn(
|
|
10
|
-
// Structural + token fallbacks
|
|
11
|
-
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
12
|
-
// CSS variable hooks for preset-first overrides
|
|
13
|
-
"border-[var(--card-border)] bg-[var(--card-bg)] text-[var(--card-fg)] shadow-[var(--card-shadow)]",
|
|
14
|
-
className,
|
|
15
|
-
)}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
22
|
-
return (
|
|
23
|
-
<div
|
|
24
|
-
data-slot="card-header"
|
|
25
|
-
className={cn(
|
|
26
|
-
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
27
|
-
className,
|
|
28
|
-
)}
|
|
29
|
-
{...props}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
35
|
-
return (
|
|
36
|
-
<div
|
|
37
|
-
data-slot="card-title"
|
|
38
|
-
className={cn("leading-none font-semibold", className)}
|
|
39
|
-
{...props}
|
|
40
|
-
/>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
45
|
-
return (
|
|
46
|
-
<div
|
|
47
|
-
data-slot="card-description"
|
|
48
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
55
|
-
return (
|
|
56
|
-
<div
|
|
57
|
-
data-slot="card-action"
|
|
58
|
-
className={cn(
|
|
59
|
-
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
60
|
-
className,
|
|
61
|
-
)}
|
|
62
|
-
{...props}
|
|
63
|
-
/>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
68
|
-
return (
|
|
69
|
-
<div
|
|
70
|
-
data-slot="card-content"
|
|
71
|
-
className={cn("px-6", className)}
|
|
72
|
-
{...props}
|
|
73
|
-
/>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
78
|
-
return (
|
|
79
|
-
<div
|
|
80
|
-
data-slot="card-footer"
|
|
81
|
-
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
|
|
82
|
-
{...props}
|
|
83
|
-
/>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export {
|
|
88
|
-
Card,
|
|
89
|
-
CardHeader,
|
|
90
|
-
CardFooter,
|
|
91
|
-
CardTitle,
|
|
92
|
-
CardAction,
|
|
93
|
-
CardDescription,
|
|
94
|
-
CardContent,
|
|
95
|
-
};
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
|
|
5
|
+
function Card({ className, ...props }: React.ComponentProps<"div">) {
|
|
6
|
+
return (
|
|
7
|
+
<div
|
|
8
|
+
data-slot="card"
|
|
9
|
+
className={cn(
|
|
10
|
+
// Structural + token fallbacks
|
|
11
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
12
|
+
// CSS variable hooks for preset-first overrides
|
|
13
|
+
"border-[var(--card-border)] bg-[var(--card-bg)] text-[var(--card-fg)] shadow-[var(--card-shadow)]",
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
22
|
+
return (
|
|
23
|
+
<div
|
|
24
|
+
data-slot="card-header"
|
|
25
|
+
className={cn(
|
|
26
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
35
|
+
return (
|
|
36
|
+
<div
|
|
37
|
+
data-slot="card-title"
|
|
38
|
+
className={cn("leading-none font-semibold", className)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
45
|
+
return (
|
|
46
|
+
<div
|
|
47
|
+
data-slot="card-description"
|
|
48
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
55
|
+
return (
|
|
56
|
+
<div
|
|
57
|
+
data-slot="card-action"
|
|
58
|
+
className={cn(
|
|
59
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
60
|
+
className,
|
|
61
|
+
)}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
68
|
+
return (
|
|
69
|
+
<div
|
|
70
|
+
data-slot="card-content"
|
|
71
|
+
className={cn("px-6", className)}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
78
|
+
return (
|
|
79
|
+
<div
|
|
80
|
+
data-slot="card-footer"
|
|
81
|
+
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
Card,
|
|
89
|
+
CardHeader,
|
|
90
|
+
CardFooter,
|
|
91
|
+
CardTitle,
|
|
92
|
+
CardAction,
|
|
93
|
+
CardDescription,
|
|
94
|
+
CardContent,
|
|
95
|
+
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { cn } from "@/lib/utils";
|
|
3
|
-
|
|
4
|
-
export type CheckboxProps = React.InputHTMLAttributes<HTMLInputElement>;
|
|
5
|
-
|
|
6
|
-
const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(
|
|
7
|
-
({ className, ...props }, ref) => {
|
|
8
|
-
// Use the native accent-color where supported for consistent checkbox fill
|
|
9
|
-
const style: React.CSSProperties = { accentColor: "var(--primary)" }; // fallback; modern browsers will use this accent color
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<input
|
|
13
|
-
type="checkbox"
|
|
14
|
-
ref={ref}
|
|
15
|
-
style={style}
|
|
16
|
-
className={cn(
|
|
17
|
-
// Keep layout small but add smooth transitions and focus ring
|
|
18
|
-
"h-4 w-4 rounded border-[var(--input-border)] bg-[var(--input-bg)] text-[var(--input-fg)] transition-colors duration-200 ease-in-out",
|
|
19
|
-
"focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:outline-none",
|
|
20
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
);
|
|
26
|
-
},
|
|
27
|
-
);
|
|
28
|
-
Checkbox.displayName = "Checkbox";
|
|
29
|
-
|
|
30
|
-
export { Checkbox };
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { cn } from "@/lib/utils";
|
|
3
|
+
|
|
4
|
+
export type CheckboxProps = React.InputHTMLAttributes<HTMLInputElement>;
|
|
5
|
+
|
|
6
|
+
const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(
|
|
7
|
+
({ className, ...props }, ref) => {
|
|
8
|
+
// Use the native accent-color where supported for consistent checkbox fill
|
|
9
|
+
const style: React.CSSProperties = { accentColor: "var(--primary)" }; // fallback; modern browsers will use this accent color
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<input
|
|
13
|
+
type="checkbox"
|
|
14
|
+
ref={ref}
|
|
15
|
+
style={style}
|
|
16
|
+
className={cn(
|
|
17
|
+
// Keep layout small but add smooth transitions and focus ring
|
|
18
|
+
"h-4 w-4 rounded border-[var(--input-border)] bg-[var(--input-bg)] text-[var(--input-fg)] transition-colors duration-200 ease-in-out",
|
|
19
|
+
"focus-visible:ring-2 focus-visible:ring-[var(--ring)] focus-visible:ring-offset-2 focus-visible:outline-none",
|
|
20
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
21
|
+
className,
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
Checkbox.displayName = "Checkbox";
|
|
29
|
+
|
|
30
|
+
export { Checkbox };
|
|
@@ -1,125 +1,125 @@
|
|
|
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
|
-
export interface CTAButtonProps {
|
|
9
|
-
/** Optional id on the root anchor/button */
|
|
10
|
-
id?: string;
|
|
11
|
-
/** Additional className merged with the button slot */
|
|
12
|
-
className?: string;
|
|
13
|
-
|
|
14
|
-
/** onClick handler for the CTA button (anchor element) */
|
|
15
|
-
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
16
|
-
/** Label text for the CTA button */
|
|
17
|
-
ctaButtonLabel?: string;
|
|
18
|
-
/** URL or anchor target for the CTA button */
|
|
19
|
-
ctaButtonHref?: string;
|
|
20
|
-
|
|
21
|
-
/** Deprecated style shorthands (kept for backward-compat). Prefer button.className */
|
|
22
|
-
ctaButtonTextColor?: string;
|
|
23
|
-
ctaButtonBgColor?: string;
|
|
24
|
-
ctaButtonBorderColor?: string;
|
|
25
|
-
ctaButtonDarkMode?: {
|
|
26
|
-
color?: string;
|
|
27
|
-
bg?: string;
|
|
28
|
-
borderColor?: string;
|
|
29
|
-
};
|
|
30
|
-
ctaButtonHoverStyle?: {
|
|
31
|
-
color?: string;
|
|
32
|
-
bg?: string;
|
|
33
|
-
borderColor?: string;
|
|
34
|
-
transform?: string;
|
|
35
|
-
boxShadow?: string;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/** Slot for shadcn Button styling */
|
|
39
|
-
button?: {
|
|
40
|
-
variant?:
|
|
41
|
-
| "default"
|
|
42
|
-
| "destructive"
|
|
43
|
-
| "outline"
|
|
44
|
-
| "secondary"
|
|
45
|
-
| "ghost"
|
|
46
|
-
| "link";
|
|
47
|
-
size?: "default" | "sm" | "lg" | "icon";
|
|
48
|
-
className?: string;
|
|
49
|
-
/** Forward-through escape hatch matching Button */
|
|
50
|
-
unstyled?: boolean;
|
|
51
|
-
style?: React.CSSProperties;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function CTAButton({
|
|
56
|
-
id,
|
|
57
|
-
className,
|
|
58
|
-
onClick,
|
|
59
|
-
ctaButtonLabel = "Get Started",
|
|
60
|
-
ctaButtonHref = "#contact",
|
|
61
|
-
ctaButtonTextColor,
|
|
62
|
-
ctaButtonBgColor,
|
|
63
|
-
ctaButtonBorderColor,
|
|
64
|
-
ctaButtonDarkMode,
|
|
65
|
-
ctaButtonHoverStyle,
|
|
66
|
-
button = {
|
|
67
|
-
variant: "default",
|
|
68
|
-
size: "lg",
|
|
69
|
-
className:
|
|
70
|
-
"bg-primary text-primary-foreground hover:bg-primary/90 font-medium shadow-md hover:shadow-lg transition-all duration-200 hover:-translate-y-0.5",
|
|
71
|
-
},
|
|
72
|
-
}: CTAButtonProps) {
|
|
73
|
-
if (!ctaButtonLabel) return null;
|
|
74
|
-
|
|
75
|
-
// Build dynamic classes from deprecated style props (kept for compatibility)
|
|
76
|
-
const dynamic: string[] = [];
|
|
77
|
-
if (ctaButtonTextColor) dynamic.push(`text-${ctaButtonTextColor}`);
|
|
78
|
-
if (ctaButtonBgColor) dynamic.push(`bg-${ctaButtonBgColor}`);
|
|
79
|
-
if (ctaButtonBorderColor) dynamic.push(`border-${ctaButtonBorderColor}`);
|
|
80
|
-
|
|
81
|
-
if (ctaButtonHoverStyle) {
|
|
82
|
-
const { color, bg, borderColor, transform, boxShadow } =
|
|
83
|
-
ctaButtonHoverStyle;
|
|
84
|
-
if (color) dynamic.push(`hover:text-${color}`);
|
|
85
|
-
if (bg) dynamic.push(`hover:bg-${bg}`);
|
|
86
|
-
if (borderColor) dynamic.push(`hover:border-${borderColor}`);
|
|
87
|
-
if (transform) dynamic.push(`hover:${transform}`);
|
|
88
|
-
if (boxShadow) dynamic.push(`hover:${boxShadow}`);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (ctaButtonDarkMode) {
|
|
92
|
-
const { color, bg, borderColor } = ctaButtonDarkMode;
|
|
93
|
-
if (color) dynamic.push(`dark:text-${color}`);
|
|
94
|
-
if (bg) dynamic.push(`dark:bg-${bg}`);
|
|
95
|
-
if (borderColor) dynamic.push(`dark:border-${borderColor}`);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const finalClassName = cn(
|
|
99
|
-
// Allow var hooks to flow through to Button
|
|
100
|
-
"border-[var(--btn-border)] focus-visible:ring-[var(--btn-ring)]",
|
|
101
|
-
button.className,
|
|
102
|
-
className,
|
|
103
|
-
dynamic.join(" "),
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<Button
|
|
108
|
-
asChild
|
|
109
|
-
variant={button.variant}
|
|
110
|
-
size={button.size}
|
|
111
|
-
className={finalClassName}
|
|
112
|
-
{...(button.unstyled ? { unstyled: true } : {})}
|
|
113
|
-
style={button.style}
|
|
114
|
-
>
|
|
115
|
-
<Link
|
|
116
|
-
id={id}
|
|
117
|
-
href={ctaButtonHref || "#"}
|
|
118
|
-
onClick={onClick}
|
|
119
|
-
aria-label={ctaButtonLabel}
|
|
120
|
-
>
|
|
121
|
-
{ctaButtonLabel}
|
|
122
|
-
</Link>
|
|
123
|
-
</Button>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
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
|
+
export interface CTAButtonProps {
|
|
9
|
+
/** Optional id on the root anchor/button */
|
|
10
|
+
id?: string;
|
|
11
|
+
/** Additional className merged with the button slot */
|
|
12
|
+
className?: string;
|
|
13
|
+
|
|
14
|
+
/** onClick handler for the CTA button (anchor element) */
|
|
15
|
+
onClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
16
|
+
/** Label text for the CTA button */
|
|
17
|
+
ctaButtonLabel?: string;
|
|
18
|
+
/** URL or anchor target for the CTA button */
|
|
19
|
+
ctaButtonHref?: string;
|
|
20
|
+
|
|
21
|
+
/** Deprecated style shorthands (kept for backward-compat). Prefer button.className */
|
|
22
|
+
ctaButtonTextColor?: string;
|
|
23
|
+
ctaButtonBgColor?: string;
|
|
24
|
+
ctaButtonBorderColor?: string;
|
|
25
|
+
ctaButtonDarkMode?: {
|
|
26
|
+
color?: string;
|
|
27
|
+
bg?: string;
|
|
28
|
+
borderColor?: string;
|
|
29
|
+
};
|
|
30
|
+
ctaButtonHoverStyle?: {
|
|
31
|
+
color?: string;
|
|
32
|
+
bg?: string;
|
|
33
|
+
borderColor?: string;
|
|
34
|
+
transform?: string;
|
|
35
|
+
boxShadow?: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** Slot for shadcn Button styling */
|
|
39
|
+
button?: {
|
|
40
|
+
variant?:
|
|
41
|
+
| "default"
|
|
42
|
+
| "destructive"
|
|
43
|
+
| "outline"
|
|
44
|
+
| "secondary"
|
|
45
|
+
| "ghost"
|
|
46
|
+
| "link";
|
|
47
|
+
size?: "default" | "sm" | "lg" | "icon";
|
|
48
|
+
className?: string;
|
|
49
|
+
/** Forward-through escape hatch matching Button */
|
|
50
|
+
unstyled?: boolean;
|
|
51
|
+
style?: React.CSSProperties;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function CTAButton({
|
|
56
|
+
id,
|
|
57
|
+
className,
|
|
58
|
+
onClick,
|
|
59
|
+
ctaButtonLabel = "Get Started",
|
|
60
|
+
ctaButtonHref = "#contact",
|
|
61
|
+
ctaButtonTextColor,
|
|
62
|
+
ctaButtonBgColor,
|
|
63
|
+
ctaButtonBorderColor,
|
|
64
|
+
ctaButtonDarkMode,
|
|
65
|
+
ctaButtonHoverStyle,
|
|
66
|
+
button = {
|
|
67
|
+
variant: "default",
|
|
68
|
+
size: "lg",
|
|
69
|
+
className:
|
|
70
|
+
"bg-primary text-primary-foreground hover:bg-primary/90 font-medium shadow-md hover:shadow-lg transition-all duration-200 hover:-translate-y-0.5",
|
|
71
|
+
},
|
|
72
|
+
}: CTAButtonProps) {
|
|
73
|
+
if (!ctaButtonLabel) return null;
|
|
74
|
+
|
|
75
|
+
// Build dynamic classes from deprecated style props (kept for compatibility)
|
|
76
|
+
const dynamic: string[] = [];
|
|
77
|
+
if (ctaButtonTextColor) dynamic.push(`text-${ctaButtonTextColor}`);
|
|
78
|
+
if (ctaButtonBgColor) dynamic.push(`bg-${ctaButtonBgColor}`);
|
|
79
|
+
if (ctaButtonBorderColor) dynamic.push(`border-${ctaButtonBorderColor}`);
|
|
80
|
+
|
|
81
|
+
if (ctaButtonHoverStyle) {
|
|
82
|
+
const { color, bg, borderColor, transform, boxShadow } =
|
|
83
|
+
ctaButtonHoverStyle;
|
|
84
|
+
if (color) dynamic.push(`hover:text-${color}`);
|
|
85
|
+
if (bg) dynamic.push(`hover:bg-${bg}`);
|
|
86
|
+
if (borderColor) dynamic.push(`hover:border-${borderColor}`);
|
|
87
|
+
if (transform) dynamic.push(`hover:${transform}`);
|
|
88
|
+
if (boxShadow) dynamic.push(`hover:${boxShadow}`);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (ctaButtonDarkMode) {
|
|
92
|
+
const { color, bg, borderColor } = ctaButtonDarkMode;
|
|
93
|
+
if (color) dynamic.push(`dark:text-${color}`);
|
|
94
|
+
if (bg) dynamic.push(`dark:bg-${bg}`);
|
|
95
|
+
if (borderColor) dynamic.push(`dark:border-${borderColor}`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const finalClassName = cn(
|
|
99
|
+
// Allow var hooks to flow through to Button
|
|
100
|
+
"border-[var(--btn-border)] focus-visible:ring-[var(--btn-ring)]",
|
|
101
|
+
button.className,
|
|
102
|
+
className,
|
|
103
|
+
dynamic.join(" "),
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<Button
|
|
108
|
+
asChild
|
|
109
|
+
variant={button.variant}
|
|
110
|
+
size={button.size}
|
|
111
|
+
className={finalClassName}
|
|
112
|
+
{...(button.unstyled ? { unstyled: true } : {})}
|
|
113
|
+
style={button.style}
|
|
114
|
+
>
|
|
115
|
+
<Link
|
|
116
|
+
id={id}
|
|
117
|
+
href={ctaButtonHref || "#"}
|
|
118
|
+
onClick={onClick}
|
|
119
|
+
aria-label={ctaButtonLabel}
|
|
120
|
+
>
|
|
121
|
+
{ctaButtonLabel}
|
|
122
|
+
</Link>
|
|
123
|
+
</Button>
|
|
124
|
+
);
|
|
125
|
+
}
|