nextworks 0.2.0-alpha.2 → 0.2.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/README.md +280 -228
  2. package/dist/cli_manifests/blocks_manifest.json +193 -194
  3. package/dist/commands/blocks.d.ts +3 -0
  4. package/dist/commands/blocks.d.ts.map +1 -1
  5. package/dist/commands/blocks.js +128 -19
  6. package/dist/commands/blocks.js.map +1 -1
  7. package/dist/commands/doctor.d.ts +136 -0
  8. package/dist/commands/doctor.d.ts.map +1 -0
  9. package/dist/commands/doctor.js +696 -0
  10. package/dist/commands/doctor.js.map +1 -0
  11. package/dist/commands/remove-blocks.d.ts +4 -1
  12. package/dist/commands/remove-blocks.d.ts.map +1 -1
  13. package/dist/commands/remove-blocks.js +24 -6
  14. package/dist/commands/remove-blocks.js.map +1 -1
  15. package/dist/index.js +125 -4
  16. package/dist/index.js.map +1 -1
  17. package/dist/kits/blocks/.nextworks/docs/BLOCKS_QUICKSTART.md +104 -194
  18. package/dist/kits/blocks/.nextworks/docs/BLOCKS_README.md +115 -75
  19. package/dist/kits/blocks/.nextworks/docs/THEME_GUIDE.md +269 -251
  20. package/dist/kits/blocks/app/templates/digitalagency/PresetThemeVars.tsx +80 -80
  21. package/dist/kits/blocks/app/templates/digitalagency/README.md +42 -36
  22. package/dist/kits/blocks/app/templates/digitalagency/components/About.tsx +71 -99
  23. package/dist/kits/blocks/app/templates/digitalagency/components/CTA.tsx +40 -74
  24. package/dist/kits/blocks/app/templates/digitalagency/components/Contact.tsx +123 -227
  25. package/dist/kits/blocks/app/templates/digitalagency/components/Footer.tsx +89 -89
  26. package/dist/kits/blocks/app/templates/digitalagency/components/Hero.tsx +83 -90
  27. package/dist/kits/blocks/app/templates/digitalagency/components/Navbar.tsx +121 -168
  28. package/dist/kits/blocks/app/templates/digitalagency/components/NetworkPattern.tsx +288 -297
  29. package/dist/kits/blocks/app/templates/digitalagency/components/Portfolio.tsx +157 -157
  30. package/dist/kits/blocks/app/templates/digitalagency/components/Pricing.tsx +114 -114
  31. package/dist/kits/blocks/app/templates/digitalagency/components/Process.tsx +59 -59
  32. package/dist/kits/blocks/app/templates/digitalagency/components/Services.tsx +55 -55
  33. package/dist/kits/blocks/app/templates/digitalagency/components/Team.tsx +28 -28
  34. package/dist/kits/blocks/app/templates/digitalagency/components/Testimonials.tsx +65 -65
  35. package/dist/kits/blocks/app/templates/digitalagency/page.tsx +38 -38
  36. package/dist/kits/blocks/app/templates/gallery/PresetThemeVars.tsx +130 -85
  37. package/dist/kits/blocks/app/templates/gallery/page.tsx +357 -303
  38. package/dist/kits/blocks/app/templates/productlaunch/PresetThemeVars.tsx +75 -74
  39. package/dist/kits/blocks/app/templates/productlaunch/README.md +62 -55
  40. package/dist/kits/blocks/app/templates/productlaunch/components/About.tsx +84 -178
  41. package/dist/kits/blocks/app/templates/productlaunch/components/CTA.tsx +50 -93
  42. package/dist/kits/blocks/app/templates/productlaunch/components/Contact.tsx +231 -231
  43. package/dist/kits/blocks/app/templates/productlaunch/components/FAQ.tsx +86 -93
  44. package/dist/kits/blocks/app/templates/productlaunch/components/Features.tsx +83 -84
  45. package/dist/kits/blocks/app/templates/productlaunch/components/Footer.tsx +132 -132
  46. package/dist/kits/blocks/app/templates/productlaunch/components/Hero.tsx +88 -89
  47. package/dist/kits/blocks/app/templates/productlaunch/components/Navbar.tsx +116 -162
  48. package/dist/kits/blocks/app/templates/productlaunch/components/Pricing.tsx +106 -106
  49. package/dist/kits/blocks/app/templates/productlaunch/components/ProcessTimeline.tsx +110 -110
  50. package/dist/kits/blocks/app/templates/productlaunch/components/ServicesGrid.tsx +68 -68
  51. package/dist/kits/blocks/app/templates/productlaunch/components/Team.tsx +104 -104
  52. package/dist/kits/blocks/app/templates/productlaunch/components/Testimonials.tsx +90 -89
  53. package/dist/kits/blocks/app/templates/productlaunch/components/TrustBadges.tsx +76 -76
  54. package/dist/kits/blocks/app/templates/productlaunch/page.tsx +43 -43
  55. package/dist/kits/blocks/app/templates/saasdashboard/PresetThemeVars.tsx +80 -80
  56. package/dist/kits/blocks/app/templates/saasdashboard/README.md +44 -38
  57. package/dist/kits/blocks/app/templates/saasdashboard/components/Contact.tsx +129 -176
  58. package/dist/kits/blocks/app/templates/saasdashboard/components/Dashboard.tsx +293 -293
  59. package/dist/kits/blocks/app/templates/saasdashboard/components/FAQ.tsx +55 -55
  60. package/dist/kits/blocks/app/templates/saasdashboard/components/Features.tsx +90 -91
  61. package/dist/kits/blocks/app/templates/saasdashboard/components/Footer.tsx +77 -77
  62. package/dist/kits/blocks/app/templates/saasdashboard/components/Hero.tsx +104 -105
  63. package/dist/kits/blocks/app/templates/saasdashboard/components/Hero_mask.tsx +126 -127
  64. package/dist/kits/blocks/app/templates/saasdashboard/components/Navbar.tsx +117 -159
  65. package/dist/kits/blocks/app/templates/saasdashboard/components/Pricing.tsx +90 -90
  66. package/dist/kits/blocks/app/templates/saasdashboard/components/SmoothScroll.tsx +96 -97
  67. package/dist/kits/blocks/app/templates/saasdashboard/components/Testimonials.tsx +72 -72
  68. package/dist/kits/blocks/app/templates/saasdashboard/components/TrustBadges.tsx +53 -53
  69. package/dist/kits/blocks/app/templates/saasdashboard/page.tsx +39 -39
  70. package/dist/kits/blocks/components/enhanced-theme-provider.tsx +195 -183
  71. package/dist/kits/blocks/components/providers/BlocksAppProviders.tsx +27 -27
  72. package/dist/kits/blocks/components/sections/About.tsx +291 -291
  73. package/dist/kits/blocks/components/sections/CTA.tsx +257 -258
  74. package/dist/kits/blocks/components/sections/CommandShowcase.tsx +517 -0
  75. package/dist/kits/blocks/components/sections/Contact.tsx +267 -267
  76. package/dist/kits/blocks/components/sections/FAQ.tsx +214 -225
  77. package/dist/kits/blocks/components/sections/FeaturedProjectShowcase.tsx +687 -0
  78. package/dist/kits/blocks/components/sections/Features.tsx +268 -270
  79. package/dist/kits/blocks/components/sections/Footer.tsx +302 -302
  80. package/dist/kits/blocks/components/sections/HeroMotion.tsx +308 -308
  81. package/dist/kits/blocks/components/sections/HeroOverlay.tsx +358 -358
  82. package/dist/kits/blocks/components/sections/HeroProductDemo.tsx +246 -0
  83. package/dist/kits/blocks/components/sections/HeroSplit.tsx +352 -352
  84. package/dist/kits/blocks/components/sections/HeroWithVideo.tsx +495 -0
  85. package/dist/kits/blocks/components/sections/Navbar.tsx +352 -353
  86. package/dist/kits/blocks/components/sections/PortfolioSimple.tsx +549 -550
  87. package/dist/kits/blocks/components/sections/Pricing.tsx +264 -264
  88. package/dist/kits/blocks/components/sections/ProcessTimeline.tsx +325 -325
  89. package/dist/kits/blocks/components/sections/ProjectDeepDive.tsx +805 -0
  90. package/dist/kits/blocks/components/sections/SelectedWorkRail.tsx +485 -0
  91. package/dist/kits/blocks/components/sections/ServicesGrid.tsx +210 -210
  92. package/dist/kits/blocks/components/sections/Team.tsx +309 -309
  93. package/dist/kits/blocks/components/sections/Testimonials.tsx +158 -158
  94. package/dist/kits/blocks/components/sections/TrustBadges.tsx +162 -162
  95. package/dist/kits/blocks/components/sections/product-demo/ApprovalInboxPanel.tsx +128 -0
  96. package/dist/kits/blocks/components/sections/product-demo/DemoStage.tsx +519 -0
  97. package/dist/kits/blocks/components/sections/product-demo/DemoWindow.tsx +140 -0
  98. package/dist/kits/blocks/components/sections/product-demo/KnowledgePanel.tsx +130 -0
  99. package/dist/kits/blocks/components/sections/product-demo/RunConsolePanel.tsx +430 -0
  100. package/dist/kits/blocks/components/sections/product-demo/TaskListPanel.tsx +302 -0
  101. package/dist/kits/blocks/components/sections/product-demo/WorkflowStudioPanel.tsx +744 -0
  102. package/dist/kits/blocks/components/sections/product-demo/types.ts +262 -0
  103. package/dist/kits/blocks/components/theme-provider.tsx +1 -34
  104. package/dist/kits/blocks/components/ui/alert-dialog.tsx +134 -134
  105. package/dist/kits/blocks/components/ui/brand-node.tsx +121 -121
  106. package/dist/kits/blocks/components/ui/button.tsx +122 -122
  107. package/dist/kits/blocks/components/ui/card.tsx +95 -95
  108. package/dist/kits/blocks/components/ui/checkbox.tsx +30 -30
  109. package/dist/kits/blocks/components/ui/cta-button.tsx +125 -125
  110. package/dist/kits/blocks/components/ui/dropdown-menu.tsx +201 -201
  111. package/dist/kits/blocks/components/ui/feature-card.tsx +91 -91
  112. package/dist/kits/blocks/components/ui/input.tsx +27 -27
  113. package/dist/kits/blocks/components/ui/label.tsx +29 -29
  114. package/dist/kits/blocks/components/ui/pricing-card.tsx +120 -120
  115. package/dist/kits/blocks/components/ui/select.tsx +25 -25
  116. package/dist/kits/blocks/components/ui/skeleton.tsx +13 -13
  117. package/dist/kits/blocks/components/ui/table.tsx +98 -98
  118. package/dist/kits/blocks/components/ui/testimonial-card.tsx +108 -108
  119. package/dist/kits/blocks/components/ui/textarea.tsx +26 -26
  120. package/dist/kits/blocks/components/ui/theme-selector.tsx +243 -247
  121. package/dist/kits/blocks/components/ui/theme-toggle.tsx +74 -74
  122. package/dist/kits/blocks/components/ui/toaster.tsx +7 -7
  123. package/dist/kits/blocks/lib/themes.ts +400 -400
  124. package/dist/kits/blocks/lib/utils.ts +6 -9
  125. package/dist/kits/blocks/package-deps.json +40 -28
  126. package/dist/kits/blocks/tsconfig.json +11 -0
  127. package/dist/kits/blocks/tsconfig.tsbuildinfo +1 -0
  128. package/dist/utils/file-operations.d.ts +3 -1
  129. package/dist/utils/file-operations.d.ts.map +1 -1
  130. package/dist/utils/file-operations.js +84 -12
  131. package/dist/utils/file-operations.js.map +1 -1
  132. package/dist/utils/installation-tracker.d.ts +2 -2
  133. package/dist/utils/installation-tracker.d.ts.map +1 -1
  134. package/dist/utils/installation-tracker.js +11 -11
  135. package/dist/utils/installation-tracker.js.map +1 -1
  136. package/dist/utils/package-manager.d.ts +6 -0
  137. package/dist/utils/package-manager.d.ts.map +1 -0
  138. package/dist/utils/package-manager.js +58 -0
  139. package/dist/utils/package-manager.js.map +1 -0
  140. package/dist/utils/yarn-pnp.d.ts +6 -0
  141. package/dist/utils/yarn-pnp.d.ts.map +1 -0
  142. package/dist/utils/yarn-pnp.js +39 -0
  143. package/dist/utils/yarn-pnp.js.map +1 -0
  144. package/package.json +5 -2
  145. package/dist/kits/blocks/notes/THEME_GUIDE.md +0 -29
@@ -1,267 +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
- }
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
+ }