@kubuild/components 0.2.0 → 0.3.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.
Files changed (133) hide show
  1. package/dist/blocks/forms.d.ts +6 -0
  2. package/dist/blocks/forms.d.ts.map +1 -0
  3. package/dist/blocks/index.cjs +1661 -0
  4. package/dist/blocks/index.cjs.map +1 -0
  5. package/dist/blocks/index.d.ts +11 -0
  6. package/dist/blocks/index.d.ts.map +1 -0
  7. package/dist/blocks/index.js +15 -0
  8. package/dist/blocks/index.js.map +1 -0
  9. package/dist/blocks/layout.d.ts +6 -0
  10. package/dist/blocks/layout.d.ts.map +1 -0
  11. package/dist/blocks/sections.d.ts +6 -0
  12. package/dist/blocks/sections.d.ts.map +1 -0
  13. package/dist/{blocks.d.ts → blocks/types.d.ts} +2 -5
  14. package/dist/blocks/types.d.ts.map +1 -0
  15. package/dist/chunk-JTQ35OQQ.js +1631 -0
  16. package/dist/chunk-JTQ35OQQ.js.map +1 -0
  17. package/dist/chunk-K6I6U7F3.js +2707 -0
  18. package/dist/chunk-K6I6U7F3.js.map +1 -0
  19. package/dist/chunk-OK53DS7G.js +911 -0
  20. package/dist/chunk-OK53DS7G.js.map +1 -0
  21. package/dist/definitions/constants.d.ts +10 -0
  22. package/dist/definitions/constants.d.ts.map +1 -0
  23. package/dist/definitions/data/collection.d.ts +3 -0
  24. package/dist/definitions/data/collection.d.ts.map +1 -0
  25. package/dist/definitions/data/index.d.ts +4 -0
  26. package/dist/definitions/data/index.d.ts.map +1 -0
  27. package/dist/definitions/data/list.d.ts +4 -0
  28. package/dist/definitions/data/list.d.ts.map +1 -0
  29. package/dist/definitions/data/table.d.ts +5 -0
  30. package/dist/definitions/data/table.d.ts.map +1 -0
  31. package/dist/definitions/form/button.d.ts +4 -0
  32. package/dist/definitions/form/button.d.ts.map +1 -0
  33. package/dist/definitions/form/checkbox.d.ts +3 -0
  34. package/dist/definitions/form/checkbox.d.ts.map +1 -0
  35. package/dist/definitions/form/file-upload.d.ts +3 -0
  36. package/dist/definitions/form/file-upload.d.ts.map +1 -0
  37. package/dist/definitions/form/form.d.ts +3 -0
  38. package/dist/definitions/form/form.d.ts.map +1 -0
  39. package/dist/definitions/form/index.d.ts +10 -0
  40. package/dist/definitions/form/index.d.ts.map +1 -0
  41. package/dist/definitions/form/input.d.ts +3 -0
  42. package/dist/definitions/form/input.d.ts.map +1 -0
  43. package/dist/definitions/form/radio.d.ts +5 -0
  44. package/dist/definitions/form/radio.d.ts.map +1 -0
  45. package/dist/definitions/form/select.d.ts +3 -0
  46. package/dist/definitions/form/select.d.ts.map +1 -0
  47. package/dist/definitions/form/switch.d.ts +3 -0
  48. package/dist/definitions/form/switch.d.ts.map +1 -0
  49. package/dist/definitions/form/textarea.d.ts +3 -0
  50. package/dist/definitions/form/textarea.d.ts.map +1 -0
  51. package/dist/definitions/index.cjs +3512 -0
  52. package/dist/definitions/index.cjs.map +1 -0
  53. package/dist/definitions/index.d.ts +12 -0
  54. package/dist/definitions/index.d.ts.map +1 -0
  55. package/dist/definitions/index.js +90 -0
  56. package/dist/definitions/index.js.map +1 -0
  57. package/dist/definitions/interactive/collapsible.d.ts +3 -0
  58. package/dist/definitions/interactive/collapsible.d.ts.map +1 -0
  59. package/dist/definitions/interactive/drawer.d.ts +3 -0
  60. package/dist/definitions/interactive/drawer.d.ts.map +1 -0
  61. package/dist/definitions/interactive/index.d.ts +4 -0
  62. package/dist/definitions/interactive/index.d.ts.map +1 -0
  63. package/dist/definitions/interactive/modal.d.ts +3 -0
  64. package/dist/definitions/interactive/modal.d.ts.map +1 -0
  65. package/dist/definitions/layout/columns.d.ts +3 -0
  66. package/dist/definitions/layout/columns.d.ts.map +1 -0
  67. package/dist/definitions/layout/container.d.ts +3 -0
  68. package/dist/definitions/layout/container.d.ts.map +1 -0
  69. package/dist/definitions/layout/flex.d.ts +7 -0
  70. package/dist/definitions/layout/flex.d.ts.map +1 -0
  71. package/dist/definitions/layout/grid.d.ts +7 -0
  72. package/dist/definitions/layout/grid.d.ts.map +1 -0
  73. package/dist/definitions/layout/index.d.ts +7 -0
  74. package/dist/definitions/layout/index.d.ts.map +1 -0
  75. package/dist/definitions/layout/page.d.ts +3 -0
  76. package/dist/definitions/layout/page.d.ts.map +1 -0
  77. package/dist/definitions/layout/section.d.ts +3 -0
  78. package/dist/definitions/layout/section.d.ts.map +1 -0
  79. package/dist/definitions/media/html-embed.d.ts +3 -0
  80. package/dist/definitions/media/html-embed.d.ts.map +1 -0
  81. package/dist/definitions/media/icon.d.ts +3 -0
  82. package/dist/definitions/media/icon.d.ts.map +1 -0
  83. package/dist/definitions/media/image.d.ts +3 -0
  84. package/dist/definitions/media/image.d.ts.map +1 -0
  85. package/dist/definitions/media/index.d.ts +5 -0
  86. package/dist/definitions/media/index.d.ts.map +1 -0
  87. package/dist/definitions/media/video.d.ts +3 -0
  88. package/dist/definitions/media/video.d.ts.map +1 -0
  89. package/dist/definitions/types.d.ts +5 -0
  90. package/dist/definitions/types.d.ts.map +1 -0
  91. package/dist/definitions/typography/badge.d.ts +3 -0
  92. package/dist/definitions/typography/badge.d.ts.map +1 -0
  93. package/dist/definitions/typography/blockquote.d.ts +3 -0
  94. package/dist/definitions/typography/blockquote.d.ts.map +1 -0
  95. package/dist/definitions/typography/code-block.d.ts +3 -0
  96. package/dist/definitions/typography/code-block.d.ts.map +1 -0
  97. package/dist/definitions/typography/heading.d.ts +3 -0
  98. package/dist/definitions/typography/heading.d.ts.map +1 -0
  99. package/dist/definitions/typography/index.d.ts +8 -0
  100. package/dist/definitions/typography/index.d.ts.map +1 -0
  101. package/dist/definitions/typography/link.d.ts +3 -0
  102. package/dist/definitions/typography/link.d.ts.map +1 -0
  103. package/dist/definitions/typography/paragraph.d.ts +3 -0
  104. package/dist/definitions/typography/paragraph.d.ts.map +1 -0
  105. package/dist/definitions/typography/text.d.ts +3 -0
  106. package/dist/definitions/typography/text.d.ts.map +1 -0
  107. package/dist/index.cjs +1568 -814
  108. package/dist/index.cjs.map +1 -1
  109. package/dist/index.js +120 -4332
  110. package/dist/index.js.map +1 -1
  111. package/dist/traits/common.d.ts +8 -0
  112. package/dist/traits/common.d.ts.map +1 -0
  113. package/dist/{traits.d.ts → traits/form.d.ts} +2 -109
  114. package/dist/traits/form.d.ts.map +1 -0
  115. package/dist/traits/index.cjs +998 -0
  116. package/dist/traits/index.cjs.map +1 -0
  117. package/dist/traits/index.d.ts +7 -0
  118. package/dist/traits/index.d.ts.map +1 -0
  119. package/dist/traits/index.js +129 -0
  120. package/dist/traits/index.js.map +1 -0
  121. package/dist/traits/link.d.ts +8 -0
  122. package/dist/traits/link.d.ts.map +1 -0
  123. package/dist/traits/media.d.ts +18 -0
  124. package/dist/traits/media.d.ts.map +1 -0
  125. package/dist/traits/structure.d.ts +10 -0
  126. package/dist/traits/structure.d.ts.map +1 -0
  127. package/dist/traits/types.d.ts +69 -0
  128. package/dist/traits/types.d.ts.map +1 -0
  129. package/package.json +20 -4
  130. package/dist/blocks.d.ts.map +0 -1
  131. package/dist/definitions.d.ts +0 -37
  132. package/dist/definitions.d.ts.map +0 -1
  133. package/dist/traits.d.ts.map +0 -1
@@ -0,0 +1,1661 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/blocks/index.ts
21
+ var blocks_exports = {};
22
+ __export(blocks_exports, {
23
+ FORM_STARTER_BLOCKS: () => FORM_STARTER_BLOCKS,
24
+ LAYOUT_STARTER_BLOCKS: () => LAYOUT_STARTER_BLOCKS,
25
+ STARTER_BLOCKS: () => STARTER_BLOCKS,
26
+ UI_STARTER_BLOCKS: () => UI_STARTER_BLOCKS,
27
+ defaultGenId: () => defaultGenId
28
+ });
29
+ module.exports = __toCommonJS(blocks_exports);
30
+
31
+ // src/blocks/types.ts
32
+ var nextId = 1;
33
+ function defaultGenId(prefix = "node") {
34
+ return `${prefix}-${Date.now().toString(36)}-${(nextId++).toString(36)}`;
35
+ }
36
+
37
+ // src/blocks/layout.ts
38
+ var LAYOUT_STARTER_BLOCKS = [
39
+ {
40
+ id: "layout-1-col",
41
+ name: "1 Column",
42
+ category: "layout",
43
+ categoryLabel: "Layout Blocks",
44
+ description: "Full-width single column container inside a section",
45
+ icon: "layout",
46
+ createNodeTree: (gen = defaultGenId) => ({
47
+ id: gen("section"),
48
+ type: "section",
49
+ styles: { base: { padding: "40px 20px", width: "100%" } },
50
+ children: [
51
+ {
52
+ id: gen("container"),
53
+ type: "container",
54
+ props: { tag: "div" },
55
+ styles: { base: { maxWidth: "1200px", margin: "0 auto", width: "100%" } },
56
+ children: []
57
+ }
58
+ ]
59
+ })
60
+ },
61
+ {
62
+ id: "layout-2-col-50-50",
63
+ name: "2 Columns (50/50)",
64
+ category: "layout",
65
+ categoryLabel: "Layout Blocks",
66
+ description: "Two equal-width 50/50 columns with flexible layout",
67
+ icon: "columns",
68
+ createNodeTree: (gen = defaultGenId) => ({
69
+ id: gen("section"),
70
+ type: "section",
71
+ styles: { base: { padding: "40px 20px", width: "100%" } },
72
+ children: [
73
+ {
74
+ id: gen("columns"),
75
+ type: "columns",
76
+ props: { columns: 2, gap: "24px" },
77
+ styles: { base: { display: "flex", gap: "24px", width: "100%", maxWidth: "1200px", margin: "0 auto" } },
78
+ children: [
79
+ {
80
+ id: gen("container"),
81
+ type: "container",
82
+ props: { tag: "div" },
83
+ styles: { base: { flex: "1 1 0%", minWidth: "0" } },
84
+ children: []
85
+ },
86
+ {
87
+ id: gen("container"),
88
+ type: "container",
89
+ props: { tag: "div" },
90
+ styles: { base: { flex: "1 1 0%", minWidth: "0" } },
91
+ children: []
92
+ }
93
+ ]
94
+ }
95
+ ]
96
+ })
97
+ },
98
+ {
99
+ id: "layout-2-col-30-70",
100
+ name: "2 Columns (30/70)",
101
+ category: "layout",
102
+ categoryLabel: "Layout Blocks",
103
+ description: "Two asymmetric columns: 30% sidebar and 70% main area",
104
+ icon: "columns",
105
+ createNodeTree: (gen = defaultGenId) => ({
106
+ id: gen("section"),
107
+ type: "section",
108
+ styles: { base: { padding: "40px 20px", width: "100%" } },
109
+ children: [
110
+ {
111
+ id: gen("columns"),
112
+ type: "columns",
113
+ props: { columns: 2, gap: "24px" },
114
+ styles: { base: { display: "flex", gap: "24px", width: "100%", maxWidth: "1200px", margin: "0 auto" } },
115
+ children: [
116
+ {
117
+ id: gen("container"),
118
+ type: "container",
119
+ props: { tag: "div" },
120
+ styles: { base: { flex: "0 0 30%", minWidth: "0" } },
121
+ children: []
122
+ },
123
+ {
124
+ id: gen("container"),
125
+ type: "container",
126
+ props: { tag: "div" },
127
+ styles: { base: { flex: "1 1 0%", minWidth: "0" } },
128
+ children: []
129
+ }
130
+ ]
131
+ }
132
+ ]
133
+ })
134
+ },
135
+ {
136
+ id: "layout-3-col",
137
+ name: "3 Columns",
138
+ category: "layout",
139
+ categoryLabel: "Layout Blocks",
140
+ description: "Three equal-width columns for grid showcases or card groups",
141
+ icon: "grid",
142
+ createNodeTree: (gen = defaultGenId) => ({
143
+ id: gen("section"),
144
+ type: "section",
145
+ styles: { base: { padding: "40px 20px", width: "100%" } },
146
+ children: [
147
+ {
148
+ id: gen("columns"),
149
+ type: "columns",
150
+ props: { columns: 3, gap: "24px" },
151
+ styles: { base: { display: "flex", gap: "24px", width: "100%", maxWidth: "1200px", margin: "0 auto" } },
152
+ children: [
153
+ {
154
+ id: gen("container"),
155
+ type: "container",
156
+ props: { tag: "div" },
157
+ styles: { base: { flex: "1 1 0%", minWidth: "0" } },
158
+ children: []
159
+ },
160
+ {
161
+ id: gen("container"),
162
+ type: "container",
163
+ props: { tag: "div" },
164
+ styles: { base: { flex: "1 1 0%", minWidth: "0" } },
165
+ children: []
166
+ },
167
+ {
168
+ id: gen("container"),
169
+ type: "container",
170
+ props: { tag: "div" },
171
+ styles: { base: { flex: "1 1 0%", minWidth: "0" } },
172
+ children: []
173
+ }
174
+ ]
175
+ }
176
+ ]
177
+ })
178
+ },
179
+ {
180
+ id: "layout-4-col",
181
+ name: "4 Columns",
182
+ category: "layout",
183
+ categoryLabel: "Layout Blocks",
184
+ description: "Four equal columns for metric stats, logos, or compact feature cards",
185
+ icon: "grid",
186
+ createNodeTree: (gen = defaultGenId) => ({
187
+ id: gen("section"),
188
+ type: "section",
189
+ styles: { base: { padding: "40px 20px", width: "100%" } },
190
+ children: [
191
+ {
192
+ id: gen("columns"),
193
+ type: "columns",
194
+ props: { columns: 4, gap: "16px" },
195
+ styles: { base: { display: "flex", gap: "16px", width: "100%", maxWidth: "1200px", margin: "0 auto" } },
196
+ children: [
197
+ {
198
+ id: gen("container"),
199
+ type: "container",
200
+ props: { tag: "div" },
201
+ styles: { base: { flex: "1 1 0%", minWidth: "0" } },
202
+ children: []
203
+ },
204
+ {
205
+ id: gen("container"),
206
+ type: "container",
207
+ props: { tag: "div" },
208
+ styles: { base: { flex: "1 1 0%", minWidth: "0" } },
209
+ children: []
210
+ },
211
+ {
212
+ id: gen("container"),
213
+ type: "container",
214
+ props: { tag: "div" },
215
+ styles: { base: { flex: "1 1 0%", minWidth: "0" } },
216
+ children: []
217
+ },
218
+ {
219
+ id: gen("container"),
220
+ type: "container",
221
+ props: { tag: "div" },
222
+ styles: { base: { flex: "1 1 0%", minWidth: "0" } },
223
+ children: []
224
+ }
225
+ ]
226
+ }
227
+ ]
228
+ })
229
+ }
230
+ ];
231
+
232
+ // src/blocks/sections.ts
233
+ var UI_STARTER_BLOCKS = [
234
+ {
235
+ id: "navbar",
236
+ name: "Navbar",
237
+ category: "sections",
238
+ categoryLabel: "Navigation & Headers",
239
+ description: "Responsive top navigation bar with brand logo, nav links, CTA button, and mobile hamburger menu",
240
+ icon: "layout",
241
+ createNodeTree: (gen = defaultGenId) => ({
242
+ id: gen("section"),
243
+ type: "section",
244
+ styles: {
245
+ base: {
246
+ paddingTop: "16px",
247
+ paddingBottom: "16px",
248
+ paddingLeft: "24px",
249
+ paddingRight: "24px",
250
+ backgroundColor: "#ffffff",
251
+ borderBottom: "1px solid #e2e8f0",
252
+ width: "100%"
253
+ },
254
+ mobile: {
255
+ paddingLeft: "16px",
256
+ paddingRight: "16px",
257
+ paddingTop: "12px",
258
+ paddingBottom: "12px"
259
+ }
260
+ },
261
+ children: [
262
+ {
263
+ id: gen("container"),
264
+ type: "container",
265
+ props: { tag: "div" },
266
+ styles: {
267
+ base: {
268
+ maxWidth: "1200px",
269
+ margin: "0 auto",
270
+ display: "flex",
271
+ alignItems: "center",
272
+ justifyContent: "space-between",
273
+ width: "100%",
274
+ flexWrap: "wrap"
275
+ }
276
+ },
277
+ children: [
278
+ // 1. Brand Logo
279
+ {
280
+ id: gen("heading"),
281
+ type: "heading",
282
+ props: { text: "Brand", level: 3 },
283
+ styles: {
284
+ base: {
285
+ fontSize: "20px",
286
+ fontWeight: "800",
287
+ color: "#0f172a",
288
+ margin: "0"
289
+ }
290
+ }
291
+ },
292
+ // 2. Desktop Navigation Links (hidden on mobile)
293
+ {
294
+ id: gen("flex"),
295
+ type: "flex",
296
+ styles: {
297
+ base: {
298
+ display: "flex",
299
+ flexDirection: "row",
300
+ alignItems: "center",
301
+ gap: "24px"
302
+ },
303
+ mobile: {
304
+ display: "none"
305
+ }
306
+ },
307
+ children: [
308
+ {
309
+ id: gen("link"),
310
+ type: "link",
311
+ props: { text: "Home", href: "#home" },
312
+ styles: {
313
+ base: {
314
+ fontSize: "14px",
315
+ fontWeight: "500",
316
+ color: "#0f172a",
317
+ textDecoration: "none"
318
+ }
319
+ }
320
+ },
321
+ {
322
+ id: gen("link"),
323
+ type: "link",
324
+ props: { text: "Features", href: "#features" },
325
+ styles: {
326
+ base: {
327
+ fontSize: "14px",
328
+ fontWeight: "500",
329
+ color: "#64748b",
330
+ textDecoration: "none"
331
+ }
332
+ }
333
+ },
334
+ {
335
+ id: gen("link"),
336
+ type: "link",
337
+ props: { text: "Pricing", href: "#pricing" },
338
+ styles: {
339
+ base: {
340
+ fontSize: "14px",
341
+ fontWeight: "500",
342
+ color: "#64748b",
343
+ textDecoration: "none"
344
+ }
345
+ }
346
+ },
347
+ {
348
+ id: gen("link"),
349
+ type: "link",
350
+ props: { text: "About", href: "#about" },
351
+ styles: {
352
+ base: {
353
+ fontSize: "14px",
354
+ fontWeight: "500",
355
+ color: "#64748b",
356
+ textDecoration: "none"
357
+ }
358
+ }
359
+ }
360
+ ]
361
+ },
362
+ // 3. Desktop CTA Buttons (hidden on mobile)
363
+ {
364
+ id: gen("flex"),
365
+ type: "flex",
366
+ styles: {
367
+ base: {
368
+ display: "flex",
369
+ flexDirection: "row",
370
+ alignItems: "center",
371
+ gap: "12px"
372
+ },
373
+ mobile: {
374
+ display: "none"
375
+ }
376
+ },
377
+ children: [
378
+ {
379
+ id: gen("link"),
380
+ type: "link",
381
+ props: { text: "Sign In", href: "#signin" },
382
+ styles: {
383
+ base: {
384
+ fontSize: "14px",
385
+ fontWeight: "500",
386
+ color: "#475569",
387
+ textDecoration: "none",
388
+ padding: "8px 12px"
389
+ }
390
+ }
391
+ },
392
+ {
393
+ id: gen("button"),
394
+ type: "button",
395
+ props: { label: "Get Started", href: "#signup" },
396
+ styles: {
397
+ base: {
398
+ backgroundColor: "#2563eb",
399
+ color: "#ffffff",
400
+ padding: "8px 18px",
401
+ borderRadius: "8px",
402
+ fontSize: "14px",
403
+ fontWeight: "600",
404
+ display: "inline-block"
405
+ },
406
+ states: {
407
+ ":hover": { backgroundColor: "#1d4ed8" }
408
+ }
409
+ }
410
+ }
411
+ ]
412
+ },
413
+ // 4. Mobile Hamburger Button (hidden on desktop, visible on mobile)
414
+ {
415
+ id: gen("button"),
416
+ type: "button",
417
+ props: {
418
+ label: "\u2630",
419
+ activeLabel: "\u2715",
420
+ isEditable: false,
421
+ modalId: "mobile-nav-drawer",
422
+ ariaLabel: "Toggle navigation menu",
423
+ variant: "secondary"
424
+ },
425
+ styles: {
426
+ base: {
427
+ display: "none"
428
+ },
429
+ mobile: {
430
+ display: "inline-flex",
431
+ alignItems: "center",
432
+ justifyContent: "center",
433
+ padding: "6px 12px",
434
+ fontSize: "18px",
435
+ backgroundColor: "#f8fafc",
436
+ border: "1px solid #e2e8f0",
437
+ borderRadius: "6px",
438
+ color: "#0f172a",
439
+ cursor: "pointer"
440
+ }
441
+ },
442
+ actions: [
443
+ {
444
+ id: gen("pipeline"),
445
+ trigger: "click",
446
+ label: "Toggle Mobile Menu",
447
+ enabled: true,
448
+ steps: [
449
+ {
450
+ id: gen("step"),
451
+ type: "open_modal",
452
+ label: "Toggle Navigation Drawer",
453
+ payload: {
454
+ modalId: "mobile-nav-drawer",
455
+ toggle: true
456
+ }
457
+ }
458
+ ]
459
+ }
460
+ ]
461
+ },
462
+ // 5. Mobile Navigation Dropdown (hidden on desktop, stacked on mobile)
463
+ // A `collapsible`, not a plain flex: this is an in-flow disclosure that expands
464
+ // inside the navbar (its width/border styles depend on staying there), so it must
465
+ // not be treated as a floating overlay. The dedicated renderer also keeps it
466
+ // visible while editing, so the menu's links stay reachable on the canvas, and
467
+ // only honours the open/closed state at runtime.
468
+ {
469
+ id: gen("collapsible"),
470
+ type: "collapsible",
471
+ props: {
472
+ modalId: "mobile-nav-drawer",
473
+ ariaLabel: "Mobile navigation menu",
474
+ defaultOpen: false,
475
+ animated: true
476
+ },
477
+ styles: {
478
+ base: {
479
+ display: "none"
480
+ },
481
+ mobile: {
482
+ display: "flex",
483
+ flexDirection: "column",
484
+ width: "100%",
485
+ gap: "8px",
486
+ paddingTop: "16px",
487
+ marginTop: "12px",
488
+ borderTop: "1px solid #f1f5f9"
489
+ }
490
+ },
491
+ children: [
492
+ {
493
+ id: gen("link"),
494
+ type: "link",
495
+ props: { text: "Home", href: "#home" },
496
+ styles: {
497
+ base: {
498
+ fontSize: "14px",
499
+ fontWeight: "500",
500
+ color: "#0f172a",
501
+ textDecoration: "none",
502
+ padding: "6px 0"
503
+ }
504
+ }
505
+ },
506
+ {
507
+ id: gen("link"),
508
+ type: "link",
509
+ props: { text: "Features", href: "#features" },
510
+ styles: {
511
+ base: {
512
+ fontSize: "14px",
513
+ fontWeight: "500",
514
+ color: "#64748b",
515
+ textDecoration: "none",
516
+ padding: "6px 0"
517
+ }
518
+ }
519
+ },
520
+ {
521
+ id: gen("link"),
522
+ type: "link",
523
+ props: { text: "Pricing", href: "#pricing" },
524
+ styles: {
525
+ base: {
526
+ fontSize: "14px",
527
+ fontWeight: "500",
528
+ color: "#64748b",
529
+ textDecoration: "none",
530
+ padding: "6px 0"
531
+ }
532
+ }
533
+ },
534
+ {
535
+ id: gen("link"),
536
+ type: "link",
537
+ props: { text: "About", href: "#about" },
538
+ styles: {
539
+ base: {
540
+ fontSize: "14px",
541
+ fontWeight: "500",
542
+ color: "#64748b",
543
+ textDecoration: "none",
544
+ padding: "6px 0"
545
+ }
546
+ }
547
+ },
548
+ {
549
+ id: gen("button"),
550
+ type: "button",
551
+ props: { label: "Get Started", href: "#signup" },
552
+ styles: {
553
+ base: {
554
+ backgroundColor: "#2563eb",
555
+ color: "#ffffff",
556
+ padding: "10px 16px",
557
+ borderRadius: "8px",
558
+ fontSize: "14px",
559
+ fontWeight: "600",
560
+ textAlign: "center",
561
+ display: "block",
562
+ marginTop: "8px"
563
+ },
564
+ states: {
565
+ ":hover": { backgroundColor: "#1d4ed8" }
566
+ }
567
+ }
568
+ }
569
+ ]
570
+ }
571
+ ]
572
+ }
573
+ ]
574
+ })
575
+ },
576
+ {
577
+ id: "hero-section",
578
+ name: "Hero Section",
579
+ category: "sections",
580
+ categoryLabel: "Hero & Headers",
581
+ description: "Engaging hero banner with headline, lead paragraph, and call-to-action button",
582
+ icon: "layout",
583
+ createNodeTree: (gen = defaultGenId) => ({
584
+ id: gen("section"),
585
+ type: "section",
586
+ styles: {
587
+ base: {
588
+ padding: "80px 24px",
589
+ backgroundColor: "#f8fafc",
590
+ textAlign: "center",
591
+ width: "100%"
592
+ }
593
+ },
594
+ children: [
595
+ {
596
+ id: gen("container"),
597
+ type: "container",
598
+ props: { tag: "div" },
599
+ styles: { base: { maxWidth: "768px", margin: "0 auto" } },
600
+ children: [
601
+ {
602
+ id: gen("heading"),
603
+ type: "heading",
604
+ props: { text: "Build Remarkable Experiences", level: 1 },
605
+ styles: {
606
+ base: {
607
+ fontSize: "44px",
608
+ fontWeight: "800",
609
+ color: "#0f172a",
610
+ marginBottom: "16px",
611
+ lineHeight: "1.2"
612
+ }
613
+ }
614
+ },
615
+ {
616
+ id: gen("paragraph"),
617
+ type: "paragraph",
618
+ props: {
619
+ content: "A visual builder designed for maximum craft, responsiveness, and performance."
620
+ },
621
+ styles: {
622
+ base: {
623
+ fontSize: "18px",
624
+ color: "#475569",
625
+ marginBottom: "32px",
626
+ lineHeight: "1.6"
627
+ }
628
+ }
629
+ },
630
+ {
631
+ id: gen("button"),
632
+ type: "button",
633
+ props: { label: "Get Started Today", href: "#explore" },
634
+ styles: {
635
+ base: {
636
+ backgroundColor: "#2563eb",
637
+ color: "#ffffff",
638
+ padding: "12px 28px",
639
+ borderRadius: "8px",
640
+ fontWeight: "600",
641
+ display: "inline-block"
642
+ },
643
+ states: {
644
+ ":hover": { backgroundColor: "#1d4ed8" }
645
+ }
646
+ }
647
+ }
648
+ ]
649
+ }
650
+ ]
651
+ })
652
+ },
653
+ {
654
+ id: "feature-card",
655
+ name: "Feature Card",
656
+ category: "ui",
657
+ categoryLabel: "UI Blocks",
658
+ description: "Clean elevated feature card with badge, title, text, and action link",
659
+ icon: "box",
660
+ createNodeTree: (gen = defaultGenId) => ({
661
+ id: gen("container"),
662
+ type: "container",
663
+ props: { tag: "div" },
664
+ styles: {
665
+ base: {
666
+ padding: "24px",
667
+ backgroundColor: "#ffffff",
668
+ borderRadius: "12px",
669
+ border: "1px solid #e2e8f0",
670
+ boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.05)"
671
+ }
672
+ },
673
+ children: [
674
+ {
675
+ id: gen("badge"),
676
+ type: "badge",
677
+ props: { label: "PRO FEATURE", variant: "primary" },
678
+ styles: { base: { marginBottom: "12px", display: "inline-block" } }
679
+ },
680
+ {
681
+ id: gen("heading"),
682
+ type: "heading",
683
+ props: { text: "Next-Gen Performance", level: 3 },
684
+ styles: {
685
+ base: { fontSize: "20px", fontWeight: "700", color: "#1e293b", marginBottom: "8px" }
686
+ }
687
+ },
688
+ {
689
+ id: gen("paragraph"),
690
+ type: "paragraph",
691
+ props: {
692
+ content: "Engineered for sub-millisecond render updates and zero runtime overhead."
693
+ },
694
+ styles: { base: { fontSize: "14px", color: "#64748b", lineHeight: "1.5" } }
695
+ }
696
+ ]
697
+ })
698
+ },
699
+ {
700
+ id: "media-object",
701
+ name: "Media Object",
702
+ category: "ui",
703
+ categoryLabel: "UI Blocks",
704
+ description: "Horizontal media layout with image beside text content",
705
+ icon: "image",
706
+ createNodeTree: (gen = defaultGenId) => ({
707
+ id: gen("container"),
708
+ type: "container",
709
+ props: { tag: "div" },
710
+ styles: {
711
+ base: {
712
+ display: "flex",
713
+ gap: "16px",
714
+ alignItems: "flex-start",
715
+ padding: "16px",
716
+ backgroundColor: "#ffffff",
717
+ borderRadius: "8px",
718
+ border: "1px solid #e2e8f0"
719
+ }
720
+ },
721
+ children: [
722
+ {
723
+ id: gen("image"),
724
+ type: "image",
725
+ props: {
726
+ src: "https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=160&auto=format&fit=crop&q=80",
727
+ alt: "Visual preview"
728
+ },
729
+ styles: {
730
+ base: {
731
+ width: "80px",
732
+ height: "80px",
733
+ borderRadius: "8px",
734
+ objectFit: "cover",
735
+ flexShrink: "0"
736
+ }
737
+ }
738
+ },
739
+ {
740
+ id: gen("container"),
741
+ type: "container",
742
+ props: { tag: "div" },
743
+ styles: { base: { flex: "1 1 0%" } },
744
+ children: [
745
+ {
746
+ id: gen("heading"),
747
+ type: "heading",
748
+ props: { text: "Creative Studio Asset", level: 4 },
749
+ styles: {
750
+ base: { fontSize: "16px", fontWeight: "600", color: "#0f172a", marginBottom: "4px" }
751
+ }
752
+ },
753
+ {
754
+ id: gen("paragraph"),
755
+ type: "paragraph",
756
+ props: { content: "High dynamic range gradients crafted for modern presentations." },
757
+ styles: { base: { fontSize: "13px", color: "#64748b", lineHeight: "1.4" } }
758
+ }
759
+ ]
760
+ }
761
+ ]
762
+ })
763
+ },
764
+ {
765
+ id: "pricing-table",
766
+ name: "Pricing Table",
767
+ category: "pricing",
768
+ categoryLabel: "Pricing",
769
+ description: "Highlighted subscription pricing plan with price, feature list, and buy button",
770
+ icon: "table",
771
+ createNodeTree: (gen = defaultGenId) => ({
772
+ id: gen("container"),
773
+ type: "container",
774
+ props: { tag: "div" },
775
+ styles: {
776
+ base: {
777
+ padding: "32px 24px",
778
+ backgroundColor: "#ffffff",
779
+ borderRadius: "16px",
780
+ border: "2px solid #3b82f6",
781
+ boxShadow: "0 10px 15px -3px rgba(59, 130, 246, 0.1)",
782
+ textAlign: "center",
783
+ maxWidth: "360px"
784
+ }
785
+ },
786
+ children: [
787
+ {
788
+ id: gen("badge"),
789
+ type: "badge",
790
+ props: { label: "MOST POPULAR", variant: "primary" },
791
+ styles: { base: { marginBottom: "12px", display: "inline-block" } }
792
+ },
793
+ {
794
+ id: gen("heading"),
795
+ type: "heading",
796
+ props: { text: "Professional", level: 3 },
797
+ styles: { base: { fontSize: "22px", fontWeight: "700", color: "#0f172a" } }
798
+ },
799
+ {
800
+ id: gen("heading"),
801
+ type: "heading",
802
+ props: { text: "$29 / mo", level: 2 },
803
+ styles: {
804
+ base: { fontSize: "36px", fontWeight: "800", color: "#2563eb", margin: "16px 0 24px 0" }
805
+ }
806
+ },
807
+ {
808
+ id: gen("paragraph"),
809
+ type: "paragraph",
810
+ props: { content: "Includes unlimited pages, custom domains, and team collaboration." },
811
+ styles: { base: { fontSize: "14px", color: "#64748b", marginBottom: "24px" } }
812
+ },
813
+ {
814
+ id: gen("button"),
815
+ type: "button",
816
+ props: { label: "Upgrade to Pro", href: "#checkout" },
817
+ styles: {
818
+ base: {
819
+ width: "100%",
820
+ backgroundColor: "#2563eb",
821
+ color: "#ffffff",
822
+ padding: "12px",
823
+ borderRadius: "8px",
824
+ fontWeight: "600",
825
+ display: "block"
826
+ },
827
+ states: {
828
+ ":hover": { backgroundColor: "#1d4ed8" }
829
+ }
830
+ }
831
+ }
832
+ ]
833
+ })
834
+ },
835
+ {
836
+ id: "cta-banner",
837
+ name: "CTA Banner",
838
+ category: "cta",
839
+ categoryLabel: "Call to Action",
840
+ description: "High-contrast conversion banner with title and action button",
841
+ icon: "layout",
842
+ createNodeTree: (gen = defaultGenId) => ({
843
+ id: gen("section"),
844
+ type: "section",
845
+ styles: {
846
+ base: {
847
+ padding: "60px 24px",
848
+ backgroundColor: "#0f172a",
849
+ color: "#ffffff",
850
+ borderRadius: "16px",
851
+ textAlign: "center",
852
+ width: "100%"
853
+ }
854
+ },
855
+ children: [
856
+ {
857
+ id: gen("heading"),
858
+ type: "heading",
859
+ props: { text: "Ready to boost your workflow?", level: 2 },
860
+ styles: {
861
+ base: { fontSize: "32px", fontWeight: "700", color: "#ffffff", marginBottom: "12px" }
862
+ }
863
+ },
864
+ {
865
+ id: gen("paragraph"),
866
+ type: "paragraph",
867
+ props: { content: "Start building with zero installation and instant live preview." },
868
+ styles: {
869
+ base: { fontSize: "16px", color: "#94a3b8", marginBottom: "24px", maxWidth: "600px", margin: "0 auto 24px auto" }
870
+ }
871
+ },
872
+ {
873
+ id: gen("button"),
874
+ type: "button",
875
+ props: { label: "Start Free Trial", href: "#signup" },
876
+ styles: {
877
+ base: {
878
+ backgroundColor: "#ffffff",
879
+ color: "#0f172a",
880
+ padding: "12px 28px",
881
+ borderRadius: "8px",
882
+ fontWeight: "700",
883
+ display: "inline-block"
884
+ },
885
+ states: {
886
+ ":hover": { backgroundColor: "#f1f5f9" }
887
+ }
888
+ }
889
+ }
890
+ ]
891
+ })
892
+ }
893
+ ];
894
+
895
+ // src/blocks/forms.ts
896
+ var FORM_STARTER_BLOCKS = [
897
+ {
898
+ id: "form-contact-us",
899
+ name: "Contact Us Form",
900
+ category: "forms",
901
+ categoryLabel: "Form Templates",
902
+ description: "Contact form with Name, Email, Subject, Message, and submit action pipeline with API request and toast notifications",
903
+ icon: "form",
904
+ createNodeTree: (gen = defaultGenId) => ({
905
+ id: gen("section"),
906
+ type: "section",
907
+ styles: {
908
+ base: {
909
+ padding: "64px 20px",
910
+ backgroundColor: "#f8fafc",
911
+ width: "100%"
912
+ }
913
+ },
914
+ children: [
915
+ {
916
+ id: gen("container"),
917
+ type: "container",
918
+ props: { tag: "div", maxWidth: "640px" },
919
+ styles: {
920
+ base: {
921
+ maxWidth: "640px",
922
+ margin: "0 auto",
923
+ width: "100%",
924
+ backgroundColor: "#ffffff",
925
+ padding: "36px",
926
+ borderRadius: "16px",
927
+ boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05)",
928
+ border: "1px solid #e2e8f0"
929
+ }
930
+ },
931
+ children: [
932
+ {
933
+ id: gen("heading"),
934
+ type: "heading",
935
+ props: { text: "Contact Us", level: 2 },
936
+ styles: {
937
+ base: {
938
+ fontSize: "28px",
939
+ fontWeight: "700",
940
+ color: "#0f172a",
941
+ marginBottom: "8px",
942
+ textAlign: "center"
943
+ }
944
+ }
945
+ },
946
+ {
947
+ id: gen("paragraph"),
948
+ type: "paragraph",
949
+ props: {
950
+ content: "Have questions or need assistance? Fill out the form below and we will get back to you shortly."
951
+ },
952
+ styles: {
953
+ base: {
954
+ fontSize: "15px",
955
+ color: "#64748b",
956
+ marginBottom: "28px",
957
+ textAlign: "center",
958
+ lineHeight: "1.5"
959
+ }
960
+ }
961
+ },
962
+ {
963
+ id: gen("form"),
964
+ type: "form",
965
+ props: {
966
+ name: "contact_us_form",
967
+ method: "POST",
968
+ preventDefault: true,
969
+ scrollToFirstError: true,
970
+ resetOnSubmit: true
971
+ },
972
+ styles: {
973
+ base: {
974
+ display: "flex",
975
+ flexDirection: "column",
976
+ gap: "20px",
977
+ width: "100%"
978
+ }
979
+ },
980
+ actions: [
981
+ {
982
+ id: gen("pipeline"),
983
+ trigger: "submit",
984
+ label: "Submit Contact Form",
985
+ enabled: true,
986
+ steps: [
987
+ {
988
+ id: gen("step"),
989
+ type: "api_request",
990
+ label: "Send Contact Message",
991
+ payload: {
992
+ url: "/api/mock/submit-lead",
993
+ method: "POST",
994
+ bodyFormat: "json"
995
+ },
996
+ onSuccess: [
997
+ {
998
+ id: gen("step"),
999
+ type: "show_toast",
1000
+ label: "Show Success Toast",
1001
+ payload: {
1002
+ message: "Thank you! Your message has been sent successfully.",
1003
+ type: "success",
1004
+ title: "Message Sent",
1005
+ duration: 4e3
1006
+ }
1007
+ },
1008
+ {
1009
+ id: gen("step"),
1010
+ type: "reset_form",
1011
+ label: "Reset Form",
1012
+ payload: {}
1013
+ }
1014
+ ],
1015
+ onError: [
1016
+ {
1017
+ id: gen("step"),
1018
+ type: "show_toast",
1019
+ label: "Show Error Toast",
1020
+ payload: {
1021
+ message: "Failed to send message. Please check your connection and try again.",
1022
+ type: "error",
1023
+ title: "Submission Failed",
1024
+ duration: 5e3
1025
+ }
1026
+ }
1027
+ ]
1028
+ }
1029
+ ]
1030
+ }
1031
+ ],
1032
+ children: [
1033
+ {
1034
+ id: gen("input"),
1035
+ type: "input",
1036
+ props: {
1037
+ name: "name",
1038
+ label: "Your Name",
1039
+ type: "text",
1040
+ placeholder: "Jane Doe",
1041
+ required: true,
1042
+ rules: [
1043
+ { type: "required", message: "Please enter your name" },
1044
+ { type: "min_length", value: 2, message: "Name must be at least 2 characters" }
1045
+ ]
1046
+ },
1047
+ styles: {
1048
+ base: {
1049
+ width: "100%",
1050
+ padding: "10px 14px",
1051
+ borderRadius: "8px",
1052
+ border: "1px solid #cbd5e1",
1053
+ fontSize: "14px"
1054
+ }
1055
+ }
1056
+ },
1057
+ {
1058
+ id: gen("input"),
1059
+ type: "input",
1060
+ props: {
1061
+ name: "email",
1062
+ label: "Email Address",
1063
+ type: "email",
1064
+ placeholder: "jane@example.com",
1065
+ required: true,
1066
+ rules: [
1067
+ { type: "required", message: "Please enter your email" },
1068
+ { type: "email", message: "Please enter a valid email address" }
1069
+ ]
1070
+ },
1071
+ styles: {
1072
+ base: {
1073
+ width: "100%",
1074
+ padding: "10px 14px",
1075
+ borderRadius: "8px",
1076
+ border: "1px solid #cbd5e1",
1077
+ fontSize: "14px"
1078
+ }
1079
+ }
1080
+ },
1081
+ {
1082
+ id: gen("input"),
1083
+ type: "input",
1084
+ props: {
1085
+ name: "subject",
1086
+ label: "Subject",
1087
+ type: "text",
1088
+ placeholder: "How can we help you?",
1089
+ required: true,
1090
+ rules: [
1091
+ { type: "required", message: "Please enter a subject" }
1092
+ ]
1093
+ },
1094
+ styles: {
1095
+ base: {
1096
+ width: "100%",
1097
+ padding: "10px 14px",
1098
+ borderRadius: "8px",
1099
+ border: "1px solid #cbd5e1",
1100
+ fontSize: "14px"
1101
+ }
1102
+ }
1103
+ },
1104
+ {
1105
+ id: gen("textarea"),
1106
+ type: "textarea",
1107
+ props: {
1108
+ name: "message",
1109
+ label: "Message",
1110
+ placeholder: "Write your message here...",
1111
+ rows: 4,
1112
+ required: true,
1113
+ rules: [
1114
+ { type: "required", message: "Please enter your message" },
1115
+ { type: "min_length", value: 10, message: "Message must be at least 10 characters" }
1116
+ ]
1117
+ },
1118
+ styles: {
1119
+ base: {
1120
+ width: "100%",
1121
+ padding: "10px 14px",
1122
+ borderRadius: "8px",
1123
+ border: "1px solid #cbd5e1",
1124
+ fontSize: "14px"
1125
+ }
1126
+ }
1127
+ },
1128
+ {
1129
+ id: gen("button"),
1130
+ type: "button",
1131
+ props: {
1132
+ label: "Send Message",
1133
+ variant: "primary",
1134
+ buttonType: "submit"
1135
+ },
1136
+ styles: {
1137
+ base: {
1138
+ width: "100%",
1139
+ backgroundColor: "#2563eb",
1140
+ color: "#ffffff",
1141
+ padding: "12px",
1142
+ borderRadius: "8px",
1143
+ fontWeight: "600",
1144
+ fontSize: "15px",
1145
+ display: "inline-block",
1146
+ textAlign: "center"
1147
+ },
1148
+ states: {
1149
+ ":hover": { backgroundColor: "#1d4ed8" }
1150
+ }
1151
+ }
1152
+ }
1153
+ ]
1154
+ }
1155
+ ]
1156
+ }
1157
+ ]
1158
+ })
1159
+ },
1160
+ {
1161
+ id: "form-newsletter",
1162
+ name: "Newsletter Subscribe Form",
1163
+ category: "forms",
1164
+ categoryLabel: "Form Templates",
1165
+ description: "Inline email newsletter subscription form with real-time feedback",
1166
+ icon: "mail",
1167
+ createNodeTree: (gen = defaultGenId) => ({
1168
+ id: gen("section"),
1169
+ type: "section",
1170
+ styles: {
1171
+ base: {
1172
+ padding: "48px 20px",
1173
+ backgroundColor: "#f1f5f9",
1174
+ width: "100%"
1175
+ }
1176
+ },
1177
+ children: [
1178
+ {
1179
+ id: gen("container"),
1180
+ type: "container",
1181
+ props: { tag: "div", maxWidth: "580px" },
1182
+ styles: {
1183
+ base: {
1184
+ maxWidth: "580px",
1185
+ margin: "0 auto",
1186
+ width: "100%",
1187
+ textAlign: "center"
1188
+ }
1189
+ },
1190
+ children: [
1191
+ {
1192
+ id: gen("heading"),
1193
+ type: "heading",
1194
+ props: { text: "Stay in the Loop", level: 3 },
1195
+ styles: {
1196
+ base: {
1197
+ fontSize: "26px",
1198
+ fontWeight: "700",
1199
+ color: "#0f172a",
1200
+ marginBottom: "8px"
1201
+ }
1202
+ }
1203
+ },
1204
+ {
1205
+ id: gen("paragraph"),
1206
+ type: "paragraph",
1207
+ props: {
1208
+ content: "Subscribe to our newsletter for weekly curated insights, updates, and best practices."
1209
+ },
1210
+ styles: {
1211
+ base: {
1212
+ fontSize: "15px",
1213
+ color: "#64748b",
1214
+ marginBottom: "24px",
1215
+ lineHeight: "1.5"
1216
+ }
1217
+ }
1218
+ },
1219
+ {
1220
+ id: gen("form"),
1221
+ type: "form",
1222
+ props: {
1223
+ name: "newsletter_form",
1224
+ method: "POST",
1225
+ preventDefault: true,
1226
+ resetOnSubmit: true
1227
+ },
1228
+ styles: {
1229
+ base: {
1230
+ display: "flex",
1231
+ flexDirection: "row",
1232
+ gap: "8px",
1233
+ alignItems: "center",
1234
+ width: "100%"
1235
+ },
1236
+ mobile: {
1237
+ flexDirection: "column"
1238
+ }
1239
+ },
1240
+ actions: [
1241
+ {
1242
+ id: gen("pipeline"),
1243
+ trigger: "submit",
1244
+ label: "Subscribe to Newsletter",
1245
+ enabled: true,
1246
+ steps: [
1247
+ {
1248
+ id: gen("step"),
1249
+ type: "api_request",
1250
+ label: "Submit Subscription",
1251
+ payload: {
1252
+ url: "/api/mock/submit-lead",
1253
+ method: "POST",
1254
+ bodyFormat: "json"
1255
+ },
1256
+ onSuccess: [
1257
+ {
1258
+ id: gen("step"),
1259
+ type: "show_toast",
1260
+ label: "Show Success Toast",
1261
+ payload: {
1262
+ message: "Thank you for subscribing to our newsletter!",
1263
+ type: "success",
1264
+ title: "Subscription Confirmed",
1265
+ duration: 4e3
1266
+ }
1267
+ },
1268
+ {
1269
+ id: gen("step"),
1270
+ type: "reset_form",
1271
+ label: "Reset Form",
1272
+ payload: {}
1273
+ }
1274
+ ],
1275
+ onError: [
1276
+ {
1277
+ id: gen("step"),
1278
+ type: "show_toast",
1279
+ label: "Show Error Toast",
1280
+ payload: {
1281
+ message: "Unable to subscribe right now. Please try again later.",
1282
+ type: "error",
1283
+ title: "Error",
1284
+ duration: 5e3
1285
+ }
1286
+ }
1287
+ ]
1288
+ }
1289
+ ]
1290
+ }
1291
+ ],
1292
+ children: [
1293
+ {
1294
+ id: gen("input"),
1295
+ type: "input",
1296
+ props: {
1297
+ name: "email",
1298
+ type: "email",
1299
+ placeholder: "Enter your email address...",
1300
+ required: true,
1301
+ rules: [
1302
+ { type: "required", message: "Email address is required" },
1303
+ { type: "email", message: "Please enter a valid email address" }
1304
+ ]
1305
+ },
1306
+ styles: {
1307
+ base: {
1308
+ flex: "1 1 0%",
1309
+ minWidth: "0",
1310
+ padding: "12px 16px",
1311
+ borderRadius: "8px",
1312
+ border: "1px solid #cbd5e1",
1313
+ backgroundColor: "#ffffff",
1314
+ fontSize: "14px"
1315
+ }
1316
+ }
1317
+ },
1318
+ {
1319
+ id: gen("button"),
1320
+ type: "button",
1321
+ props: {
1322
+ label: "Subscribe",
1323
+ variant: "primary",
1324
+ buttonType: "submit"
1325
+ },
1326
+ styles: {
1327
+ base: {
1328
+ backgroundColor: "#2563eb",
1329
+ color: "#ffffff",
1330
+ padding: "12px 24px",
1331
+ borderRadius: "8px",
1332
+ fontWeight: "600",
1333
+ fontSize: "14px",
1334
+ whiteSpace: "nowrap"
1335
+ },
1336
+ states: {
1337
+ ":hover": { backgroundColor: "#1d4ed8" }
1338
+ }
1339
+ }
1340
+ }
1341
+ ]
1342
+ }
1343
+ ]
1344
+ }
1345
+ ]
1346
+ })
1347
+ },
1348
+ {
1349
+ id: "form-lead-gen",
1350
+ name: "Lead Generation Form",
1351
+ category: "forms",
1352
+ categoryLabel: "Form Templates",
1353
+ description: "Multi-field lead generation form with phone validation, interest dropdown, and API submission pipeline",
1354
+ icon: "users",
1355
+ createNodeTree: (gen = defaultGenId) => ({
1356
+ id: gen("section"),
1357
+ type: "section",
1358
+ styles: {
1359
+ base: {
1360
+ padding: "64px 20px",
1361
+ backgroundColor: "#ffffff",
1362
+ width: "100%"
1363
+ }
1364
+ },
1365
+ children: [
1366
+ {
1367
+ id: gen("container"),
1368
+ type: "container",
1369
+ props: { tag: "div", maxWidth: "640px" },
1370
+ styles: {
1371
+ base: {
1372
+ maxWidth: "640px",
1373
+ margin: "0 auto",
1374
+ width: "100%",
1375
+ backgroundColor: "#ffffff",
1376
+ padding: "36px",
1377
+ borderRadius: "16px",
1378
+ border: "1px solid #e2e8f0",
1379
+ boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.05)"
1380
+ }
1381
+ },
1382
+ children: [
1383
+ {
1384
+ id: gen("badge"),
1385
+ type: "badge",
1386
+ props: { label: "FREE CONSULTATION", variant: "primary" },
1387
+ styles: { base: { marginBottom: "12px", display: "inline-block" } }
1388
+ },
1389
+ {
1390
+ id: gen("heading"),
1391
+ type: "heading",
1392
+ props: { text: "Schedule a Consultation", level: 2 },
1393
+ styles: {
1394
+ base: {
1395
+ fontSize: "28px",
1396
+ fontWeight: "700",
1397
+ color: "#0f172a",
1398
+ marginBottom: "8px"
1399
+ }
1400
+ }
1401
+ },
1402
+ {
1403
+ id: gen("paragraph"),
1404
+ type: "paragraph",
1405
+ props: {
1406
+ content: "Share your project details with our solutions team. We will analyze your needs and provide a personalized roadmap."
1407
+ },
1408
+ styles: {
1409
+ base: {
1410
+ fontSize: "15px",
1411
+ color: "#64748b",
1412
+ marginBottom: "28px",
1413
+ lineHeight: "1.5"
1414
+ }
1415
+ }
1416
+ },
1417
+ {
1418
+ id: gen("form"),
1419
+ type: "form",
1420
+ props: {
1421
+ name: "lead_generation_form",
1422
+ method: "POST",
1423
+ preventDefault: true,
1424
+ scrollToFirstError: true,
1425
+ resetOnSubmit: true
1426
+ },
1427
+ styles: {
1428
+ base: {
1429
+ display: "flex",
1430
+ flexDirection: "column",
1431
+ gap: "18px",
1432
+ width: "100%"
1433
+ }
1434
+ },
1435
+ actions: [
1436
+ {
1437
+ id: gen("pipeline"),
1438
+ trigger: "submit",
1439
+ label: "Submit Lead Form",
1440
+ enabled: true,
1441
+ steps: [
1442
+ {
1443
+ id: gen("step"),
1444
+ type: "api_request",
1445
+ label: "Send Lead Data",
1446
+ payload: {
1447
+ url: "/api/mock/submit-lead",
1448
+ method: "POST",
1449
+ bodyFormat: "json"
1450
+ },
1451
+ onSuccess: [
1452
+ {
1453
+ id: gen("step"),
1454
+ type: "show_toast",
1455
+ label: "Show Success Toast",
1456
+ payload: {
1457
+ message: "Thank you! Your request has been received. Our team will contact you shortly.",
1458
+ type: "success",
1459
+ title: "Request Submitted",
1460
+ duration: 4e3
1461
+ }
1462
+ },
1463
+ {
1464
+ id: gen("step"),
1465
+ type: "reset_form",
1466
+ label: "Reset Form",
1467
+ payload: {}
1468
+ }
1469
+ ],
1470
+ onError: [
1471
+ {
1472
+ id: gen("step"),
1473
+ type: "show_toast",
1474
+ label: "Show Error Toast",
1475
+ payload: {
1476
+ message: "Submission failed. Please verify your information and try again.",
1477
+ type: "error",
1478
+ title: "Submission Error",
1479
+ duration: 5e3
1480
+ }
1481
+ }
1482
+ ]
1483
+ }
1484
+ ]
1485
+ }
1486
+ ],
1487
+ children: [
1488
+ {
1489
+ id: gen("input"),
1490
+ type: "input",
1491
+ props: {
1492
+ name: "full_name",
1493
+ label: "Full Name",
1494
+ type: "text",
1495
+ placeholder: "Alex Morgan",
1496
+ required: true,
1497
+ rules: [
1498
+ { type: "required", message: "Full name is required" },
1499
+ { type: "min_length", value: 2, message: "Name must be at least 2 characters" }
1500
+ ]
1501
+ },
1502
+ styles: {
1503
+ base: {
1504
+ width: "100%",
1505
+ padding: "10px 14px",
1506
+ borderRadius: "8px",
1507
+ border: "1px solid #cbd5e1",
1508
+ fontSize: "14px"
1509
+ }
1510
+ }
1511
+ },
1512
+ {
1513
+ id: gen("input"),
1514
+ type: "input",
1515
+ props: {
1516
+ name: "email",
1517
+ label: "Business Email",
1518
+ type: "email",
1519
+ placeholder: "alex@company.com",
1520
+ required: true,
1521
+ rules: [
1522
+ { type: "required", message: "Business email is required" },
1523
+ { type: "email", message: "Please enter a valid email address" }
1524
+ ]
1525
+ },
1526
+ styles: {
1527
+ base: {
1528
+ width: "100%",
1529
+ padding: "10px 14px",
1530
+ borderRadius: "8px",
1531
+ border: "1px solid #cbd5e1",
1532
+ fontSize: "14px"
1533
+ }
1534
+ }
1535
+ },
1536
+ {
1537
+ id: gen("input"),
1538
+ type: "input",
1539
+ props: {
1540
+ name: "phone",
1541
+ label: "Phone Number",
1542
+ type: "tel",
1543
+ placeholder: "+62 812-3456-7890",
1544
+ required: true,
1545
+ rules: [
1546
+ { type: "required", message: "Phone number is required" },
1547
+ {
1548
+ type: "custom_regex",
1549
+ value: "^[+]?[0-9\\s-()]{8,20}$",
1550
+ message: "Please enter a valid phone number (min 8 digits)"
1551
+ }
1552
+ ]
1553
+ },
1554
+ styles: {
1555
+ base: {
1556
+ width: "100%",
1557
+ padding: "10px 14px",
1558
+ borderRadius: "8px",
1559
+ border: "1px solid #cbd5e1",
1560
+ fontSize: "14px"
1561
+ }
1562
+ }
1563
+ },
1564
+ {
1565
+ id: gen("select"),
1566
+ type: "select",
1567
+ props: {
1568
+ name: "interest",
1569
+ label: "Area of Interest",
1570
+ placeholder: "Select your interest / service...",
1571
+ required: true,
1572
+ defaultValue: "",
1573
+ options: [
1574
+ { label: "Web Platform Development", value: "web_platform" },
1575
+ { label: "Mobile Application", value: "mobile_app" },
1576
+ { label: "Cloud Architecture & DevOps", value: "cloud_devops" },
1577
+ { label: "UI/UX Product Design", value: "product_design" },
1578
+ { label: "General Inquiry", value: "general" }
1579
+ ],
1580
+ rules: [
1581
+ { type: "required", message: "Please select an area of interest" }
1582
+ ]
1583
+ },
1584
+ styles: {
1585
+ base: {
1586
+ width: "100%",
1587
+ padding: "10px 14px",
1588
+ borderRadius: "8px",
1589
+ border: "1px solid #cbd5e1",
1590
+ fontSize: "14px",
1591
+ backgroundColor: "#ffffff"
1592
+ }
1593
+ }
1594
+ },
1595
+ {
1596
+ id: gen("input"),
1597
+ type: "input",
1598
+ props: {
1599
+ name: "company",
1600
+ label: "Company Name (Optional)",
1601
+ type: "text",
1602
+ placeholder: "Company / Organization"
1603
+ },
1604
+ styles: {
1605
+ base: {
1606
+ width: "100%",
1607
+ padding: "10px 14px",
1608
+ borderRadius: "8px",
1609
+ border: "1px solid #cbd5e1",
1610
+ fontSize: "14px"
1611
+ }
1612
+ }
1613
+ },
1614
+ {
1615
+ id: gen("button"),
1616
+ type: "button",
1617
+ props: {
1618
+ label: "Request Consultation",
1619
+ variant: "primary",
1620
+ buttonType: "submit"
1621
+ },
1622
+ styles: {
1623
+ base: {
1624
+ width: "100%",
1625
+ backgroundColor: "#2563eb",
1626
+ color: "#ffffff",
1627
+ padding: "12px 24px",
1628
+ borderRadius: "8px",
1629
+ fontWeight: "600",
1630
+ fontSize: "15px",
1631
+ marginTop: "4px"
1632
+ },
1633
+ states: {
1634
+ ":hover": { backgroundColor: "#1d4ed8" }
1635
+ }
1636
+ }
1637
+ }
1638
+ ]
1639
+ }
1640
+ ]
1641
+ }
1642
+ ]
1643
+ })
1644
+ }
1645
+ ];
1646
+
1647
+ // src/blocks/index.ts
1648
+ var STARTER_BLOCKS = [
1649
+ ...LAYOUT_STARTER_BLOCKS,
1650
+ ...UI_STARTER_BLOCKS,
1651
+ ...FORM_STARTER_BLOCKS
1652
+ ];
1653
+ // Annotate the CommonJS export names for ESM import in node:
1654
+ 0 && (module.exports = {
1655
+ FORM_STARTER_BLOCKS,
1656
+ LAYOUT_STARTER_BLOCKS,
1657
+ STARTER_BLOCKS,
1658
+ UI_STARTER_BLOCKS,
1659
+ defaultGenId
1660
+ });
1661
+ //# sourceMappingURL=index.cjs.map