@damarkuncoro/landing-page 0.1.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.
@@ -0,0 +1,720 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ type SectionType = 'hero' | 'features' | 'testimonials' | 'pricing' | 'cta' | 'footer' | 'stats' | 'faq' | 'header';
4
+ type ComponentType = 'button' | 'card' | 'image' | 'text' | 'video';
5
+ interface BaseConfig {
6
+ id?: string;
7
+ className?: string;
8
+ }
9
+ interface LandingPageConfig extends BaseConfig {
10
+ title: string;
11
+ description: string;
12
+ sections: SectionConfig[];
13
+ theme?: Partial<ThemeConfig>;
14
+ }
15
+ interface ThemeConfig {
16
+ colors: {
17
+ primary: string;
18
+ secondary: string;
19
+ accent: string;
20
+ background: string;
21
+ text: string;
22
+ muted: string;
23
+ };
24
+ spacing: {
25
+ xs: string;
26
+ sm: string;
27
+ md: string;
28
+ lg: string;
29
+ xl: string;
30
+ };
31
+ fonts: {
32
+ heading: string;
33
+ body: string;
34
+ mono: string;
35
+ };
36
+ breakpoints: {
37
+ sm: string;
38
+ md: string;
39
+ lg: string;
40
+ xl: string;
41
+ };
42
+ }
43
+ interface SectionConfig extends BaseConfig {
44
+ type: SectionType;
45
+ config: any;
46
+ }
47
+
48
+ declare function defineLandingPage(config: LandingPageConfig): {
49
+ theme: ThemeConfig;
50
+ getSection(id: string): SectionConfig | undefined;
51
+ addSection(section: SectionConfig): /*elided*/ any;
52
+ removeSection(id: string): /*elided*/ any;
53
+ updateSection(id: string, updates: Partial<SectionConfig>): /*elided*/ any;
54
+ toJSON(): any;
55
+ validate(): string[];
56
+ getSectionsByType(type: string): SectionConfig[];
57
+ isValid(): boolean;
58
+ title: string;
59
+ description: string;
60
+ sections: SectionConfig[];
61
+ id?: string;
62
+ className?: string;
63
+ };
64
+
65
+ interface ButtonConfig extends BaseConfig {
66
+ text: string;
67
+ url: string;
68
+ variant: 'primary' | 'secondary' | 'outline' | 'ghost';
69
+ size: 'sm' | 'md' | 'lg';
70
+ target?: '_blank' | '_self';
71
+ }
72
+ interface HeaderConfig extends BaseConfig {
73
+ logo?: string;
74
+ title?: string;
75
+ links: {
76
+ id?: string;
77
+ text: string;
78
+ url: string;
79
+ target?: '_blank' | '_self';
80
+ }[];
81
+ }
82
+ interface HeroConfig extends BaseConfig {
83
+ title: string;
84
+ subtitle: string;
85
+ image?: string;
86
+ video?: string;
87
+ buttons: ButtonConfig[];
88
+ alignment?: 'left' | 'center' | 'right';
89
+ }
90
+ interface FeatureConfig extends BaseConfig {
91
+ title: string;
92
+ description: string;
93
+ icon?: string;
94
+ image?: string;
95
+ }
96
+ interface TestimonialConfig extends BaseConfig {
97
+ quote: string;
98
+ author: string;
99
+ role?: string;
100
+ avatar?: string;
101
+ }
102
+ interface PricingConfig extends BaseConfig {
103
+ plans: {
104
+ id?: string;
105
+ title: string;
106
+ description: string;
107
+ price: number;
108
+ period?: string;
109
+ features: string[];
110
+ button: ButtonConfig;
111
+ featured?: boolean;
112
+ }[];
113
+ }
114
+ interface FooterConfig extends BaseConfig {
115
+ logo?: string;
116
+ title?: string;
117
+ description?: string;
118
+ links: {
119
+ title: string;
120
+ items: {
121
+ text: string;
122
+ url: string;
123
+ target?: '_blank' | '_self';
124
+ }[];
125
+ }[];
126
+ socialLinks: {
127
+ platform: string;
128
+ url: string;
129
+ icon?: string;
130
+ }[];
131
+ copyright?: string;
132
+ }
133
+ interface CtaConfig extends BaseConfig {
134
+ title: string;
135
+ description: string;
136
+ button: ButtonConfig;
137
+ image?: string;
138
+ }
139
+ interface StatConfig extends BaseConfig {
140
+ number: string;
141
+ label: string;
142
+ icon?: string;
143
+ prefix?: string;
144
+ suffix?: string;
145
+ }
146
+ interface FaqConfig extends BaseConfig {
147
+ items: {
148
+ id?: string;
149
+ question: string;
150
+ answer: string;
151
+ }[];
152
+ }
153
+
154
+ interface HeaderSection extends SectionConfig {
155
+ type: 'header';
156
+ config: HeaderConfig;
157
+ }
158
+ declare function createHeaderSection(config: HeaderConfig, id?: string, className?: string): HeaderSection;
159
+
160
+ interface HeroSection extends SectionConfig {
161
+ type: 'hero';
162
+ config: HeroConfig;
163
+ }
164
+ declare function createHeroSection(config: HeroConfig, id?: string, className?: string): HeroSection;
165
+
166
+ interface FeaturesSection extends SectionConfig {
167
+ type: 'features';
168
+ config: {
169
+ features: FeatureConfig[];
170
+ };
171
+ }
172
+ declare function createFeaturesSection(config: {
173
+ features: FeatureConfig[];
174
+ }, id?: string, className?: string): FeaturesSection;
175
+
176
+ interface TestimonialsSection extends SectionConfig {
177
+ type: 'testimonials';
178
+ config: {
179
+ testimonials: TestimonialConfig[];
180
+ };
181
+ }
182
+ declare function createTestimonialsSection(config: {
183
+ testimonials: TestimonialConfig[];
184
+ }, id?: string, className?: string): TestimonialsSection;
185
+
186
+ interface PricingSection extends SectionConfig {
187
+ type: 'pricing';
188
+ config: PricingConfig;
189
+ }
190
+ declare function createPricingSection(config: PricingConfig, id?: string, className?: string): PricingSection;
191
+
192
+ interface CtaSection extends SectionConfig {
193
+ type: 'cta';
194
+ config: CtaConfig;
195
+ }
196
+ declare function createCtaSection(config: CtaConfig, id?: string, className?: string): CtaSection;
197
+
198
+ interface FooterSection extends SectionConfig {
199
+ type: 'footer';
200
+ config: FooterConfig;
201
+ }
202
+ declare function createFooterSection(config: FooterConfig, id?: string, className?: string): FooterSection;
203
+
204
+ interface StatsSection extends SectionConfig {
205
+ type: 'stats';
206
+ config: {
207
+ stats: StatConfig[];
208
+ };
209
+ }
210
+ declare function createStatsSection(config: {
211
+ stats: StatConfig[];
212
+ }, id?: string, className?: string): StatsSection;
213
+
214
+ interface FaqSection extends SectionConfig {
215
+ type: 'faq';
216
+ config: FaqConfig;
217
+ }
218
+ declare function createFaqSection(config: FaqConfig, id?: string, className?: string): FaqSection;
219
+
220
+ declare const defaultTheme: ThemeConfig;
221
+
222
+ declare const createReactRenderer: () => ({ config }: {
223
+ config: LandingPageConfig;
224
+ }) => react_jsx_runtime.JSX.Element;
225
+
226
+ declare const landingPageSchema: {
227
+ $id: string;
228
+ title: string;
229
+ description: string;
230
+ type: string;
231
+ properties: {
232
+ id: {
233
+ type: string;
234
+ description: string;
235
+ };
236
+ className: {
237
+ type: string;
238
+ description: string;
239
+ };
240
+ title: {
241
+ type: string;
242
+ description: string;
243
+ minLength: number;
244
+ };
245
+ description: {
246
+ type: string;
247
+ description: string;
248
+ minLength: number;
249
+ };
250
+ sections: {
251
+ type: string;
252
+ description: string;
253
+ minItems: number;
254
+ items: {
255
+ $ref: string;
256
+ };
257
+ };
258
+ theme: {
259
+ $ref: string;
260
+ };
261
+ };
262
+ required: string[];
263
+ definitions: {
264
+ Section: {
265
+ type: string;
266
+ properties: {
267
+ id: {
268
+ type: string;
269
+ description: string;
270
+ };
271
+ className: {
272
+ type: string;
273
+ description: string;
274
+ };
275
+ type: {
276
+ type: string;
277
+ description: string;
278
+ enum: string[];
279
+ };
280
+ config: {
281
+ type: string;
282
+ description: string;
283
+ };
284
+ };
285
+ required: string[];
286
+ };
287
+ Theme: {
288
+ type: string;
289
+ properties: {
290
+ colors: {
291
+ $ref: string;
292
+ };
293
+ spacing: {
294
+ $ref: string;
295
+ };
296
+ fonts: {
297
+ $ref: string;
298
+ };
299
+ breakpoints: {
300
+ $ref: string;
301
+ };
302
+ };
303
+ };
304
+ Colors: {
305
+ type: string;
306
+ properties: {
307
+ primary: {
308
+ type: string;
309
+ description: string;
310
+ pattern: string;
311
+ };
312
+ secondary: {
313
+ type: string;
314
+ description: string;
315
+ pattern: string;
316
+ };
317
+ accent: {
318
+ type: string;
319
+ description: string;
320
+ pattern: string;
321
+ };
322
+ background: {
323
+ type: string;
324
+ description: string;
325
+ pattern: string;
326
+ };
327
+ text: {
328
+ type: string;
329
+ description: string;
330
+ pattern: string;
331
+ };
332
+ muted: {
333
+ type: string;
334
+ description: string;
335
+ pattern: string;
336
+ };
337
+ };
338
+ required: string[];
339
+ };
340
+ Spacing: {
341
+ type: string;
342
+ properties: {
343
+ xs: {
344
+ type: string;
345
+ description: string;
346
+ };
347
+ sm: {
348
+ type: string;
349
+ description: string;
350
+ };
351
+ md: {
352
+ type: string;
353
+ description: string;
354
+ };
355
+ lg: {
356
+ type: string;
357
+ description: string;
358
+ };
359
+ xl: {
360
+ type: string;
361
+ description: string;
362
+ };
363
+ };
364
+ required: string[];
365
+ };
366
+ Fonts: {
367
+ type: string;
368
+ properties: {
369
+ heading: {
370
+ type: string;
371
+ description: string;
372
+ };
373
+ body: {
374
+ type: string;
375
+ description: string;
376
+ };
377
+ mono: {
378
+ type: string;
379
+ description: string;
380
+ };
381
+ };
382
+ required: string[];
383
+ };
384
+ Breakpoints: {
385
+ type: string;
386
+ properties: {
387
+ sm: {
388
+ type: string;
389
+ description: string;
390
+ };
391
+ md: {
392
+ type: string;
393
+ description: string;
394
+ };
395
+ lg: {
396
+ type: string;
397
+ description: string;
398
+ };
399
+ xl: {
400
+ type: string;
401
+ description: string;
402
+ };
403
+ };
404
+ required: string[];
405
+ };
406
+ ButtonConfig: {
407
+ type: string;
408
+ properties: {
409
+ text: {
410
+ type: string;
411
+ };
412
+ url: {
413
+ type: string;
414
+ format: string;
415
+ };
416
+ variant: {
417
+ type: string;
418
+ enum: string[];
419
+ };
420
+ size: {
421
+ type: string;
422
+ enum: string[];
423
+ };
424
+ target: {
425
+ type: string;
426
+ enum: string[];
427
+ };
428
+ };
429
+ required: string[];
430
+ };
431
+ };
432
+ };
433
+
434
+ declare const sectionConfigSchemas: {
435
+ hero: {
436
+ type: string;
437
+ properties: {
438
+ title: {
439
+ type: string;
440
+ };
441
+ subtitle: {
442
+ type: string;
443
+ };
444
+ image: {
445
+ type: string;
446
+ format: string;
447
+ };
448
+ video: {
449
+ type: string;
450
+ format: string;
451
+ };
452
+ buttons: {
453
+ type: string;
454
+ items: {
455
+ $ref: string;
456
+ };
457
+ };
458
+ alignment: {
459
+ type: string;
460
+ enum: string[];
461
+ };
462
+ };
463
+ required: string[];
464
+ };
465
+ features: {
466
+ type: string;
467
+ properties: {
468
+ title: {
469
+ type: string;
470
+ };
471
+ description: {
472
+ type: string;
473
+ };
474
+ icon: {
475
+ type: string;
476
+ };
477
+ image: {
478
+ type: string;
479
+ format: string;
480
+ };
481
+ };
482
+ required: string[];
483
+ };
484
+ testimonials: {
485
+ type: string;
486
+ properties: {
487
+ quote: {
488
+ type: string;
489
+ };
490
+ author: {
491
+ type: string;
492
+ };
493
+ role: {
494
+ type: string;
495
+ };
496
+ avatar: {
497
+ type: string;
498
+ format: string;
499
+ };
500
+ };
501
+ required: string[];
502
+ };
503
+ pricing: {
504
+ type: string;
505
+ properties: {
506
+ plans: {
507
+ type: string;
508
+ items: {
509
+ type: string;
510
+ properties: {
511
+ id: {
512
+ type: string;
513
+ };
514
+ title: {
515
+ type: string;
516
+ };
517
+ description: {
518
+ type: string;
519
+ };
520
+ price: {
521
+ type: string;
522
+ };
523
+ period: {
524
+ type: string;
525
+ };
526
+ features: {
527
+ type: string;
528
+ items: {
529
+ type: string;
530
+ };
531
+ };
532
+ button: {
533
+ $ref: string;
534
+ };
535
+ featured: {
536
+ type: string;
537
+ };
538
+ };
539
+ required: string[];
540
+ };
541
+ };
542
+ };
543
+ required: string[];
544
+ };
545
+ cta: {
546
+ type: string;
547
+ properties: {
548
+ title: {
549
+ type: string;
550
+ };
551
+ description: {
552
+ type: string;
553
+ };
554
+ button: {
555
+ $ref: string;
556
+ };
557
+ image: {
558
+ type: string;
559
+ format: string;
560
+ };
561
+ };
562
+ required: string[];
563
+ };
564
+ footer: {
565
+ type: string;
566
+ properties: {
567
+ logo: {
568
+ type: string;
569
+ format: string;
570
+ };
571
+ title: {
572
+ type: string;
573
+ };
574
+ description: {
575
+ type: string;
576
+ };
577
+ links: {
578
+ type: string;
579
+ items: {
580
+ type: string;
581
+ properties: {
582
+ title: {
583
+ type: string;
584
+ };
585
+ items: {
586
+ type: string;
587
+ items: {
588
+ type: string;
589
+ properties: {
590
+ text: {
591
+ type: string;
592
+ };
593
+ url: {
594
+ type: string;
595
+ format: string;
596
+ };
597
+ target: {
598
+ type: string;
599
+ enum: string[];
600
+ };
601
+ };
602
+ required: string[];
603
+ };
604
+ };
605
+ };
606
+ required: string[];
607
+ };
608
+ };
609
+ socialLinks: {
610
+ type: string;
611
+ items: {
612
+ type: string;
613
+ properties: {
614
+ platform: {
615
+ type: string;
616
+ };
617
+ url: {
618
+ type: string;
619
+ format: string;
620
+ };
621
+ icon: {
622
+ type: string;
623
+ };
624
+ };
625
+ required: string[];
626
+ };
627
+ };
628
+ copyright: {
629
+ type: string;
630
+ };
631
+ };
632
+ required: string[];
633
+ };
634
+ stats: {
635
+ type: string;
636
+ properties: {
637
+ number: {
638
+ type: string;
639
+ };
640
+ label: {
641
+ type: string;
642
+ };
643
+ icon: {
644
+ type: string;
645
+ };
646
+ prefix: {
647
+ type: string;
648
+ };
649
+ suffix: {
650
+ type: string;
651
+ };
652
+ };
653
+ required: string[];
654
+ };
655
+ faq: {
656
+ type: string;
657
+ properties: {
658
+ items: {
659
+ type: string;
660
+ items: {
661
+ type: string;
662
+ properties: {
663
+ id: {
664
+ type: string;
665
+ };
666
+ question: {
667
+ type: string;
668
+ };
669
+ answer: {
670
+ type: string;
671
+ };
672
+ };
673
+ required: string[];
674
+ };
675
+ };
676
+ };
677
+ required: string[];
678
+ };
679
+ header: {
680
+ type: string;
681
+ properties: {
682
+ logo: {
683
+ type: string;
684
+ format: string;
685
+ };
686
+ title: {
687
+ type: string;
688
+ };
689
+ links: {
690
+ type: string;
691
+ items: {
692
+ type: string;
693
+ properties: {
694
+ id: {
695
+ type: string;
696
+ };
697
+ text: {
698
+ type: string;
699
+ };
700
+ url: {
701
+ type: string;
702
+ format: string;
703
+ };
704
+ target: {
705
+ type: string;
706
+ enum: string[];
707
+ };
708
+ };
709
+ required: string[];
710
+ };
711
+ };
712
+ };
713
+ required: string[];
714
+ };
715
+ };
716
+
717
+ declare function validateConfig(config: Partial<LandingPageConfig>): string[];
718
+ declare function validateSection(section: Partial<SectionConfig>): string[];
719
+
720
+ export { ButtonConfig, ComponentType, CtaConfig, FaqConfig, FeatureConfig, FooterConfig, HeaderConfig, HeroConfig, LandingPageConfig, PricingConfig, SectionType, StatConfig, TestimonialConfig, createCtaSection, createFaqSection, createFeaturesSection, createFooterSection, createHeaderSection, createHeroSection, createPricingSection, createReactRenderer, createStatsSection, createTestimonialsSection, defaultTheme, defineLandingPage, landingPageSchema, sectionConfigSchemas, validateConfig, validateSection };