@damarkuncoro/landing-page 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @damarkuncoro/landing-page
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/%40damarkuncoro%2Flanding-page)](https://www.npmjs.com/package/@damarkuncoro/landing-page)
4
+ [![npm downloads](https://img.shields.io/npm/dm/%40damarkuncoro%2Flanding-page)](https://www.npmjs.com/package/@damarkuncoro/landing-page)
5
+ [![license](https://img.shields.io/npm/l/%40damarkuncoro%2Flanding-page)](./LICENSE)
6
+
3
7
  Config-driven landing page library for building beautiful, responsive landing pages with minimal code.
4
8
 
5
9
  ## Features
@@ -355,4 +359,4 @@ switch (section.type) {
355
359
 
356
360
  ## License
357
361
 
358
- MIT
362
+ MIT
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
 
3
- type SectionType = 'hero' | 'features' | 'testimonials' | 'pricing' | 'cta' | 'footer' | 'stats' | 'faq' | 'header';
4
- type ComponentType = 'button' | 'card' | 'image' | 'text' | 'video';
3
+ type SectionType = "hero" | "features" | "testimonials" | "pricing" | "cta" | "footer" | "stats" | "faq" | "header";
4
+ type ComponentType = "button" | "card" | "image" | "text" | "video";
5
5
  interface BaseConfig {
6
6
  id?: string;
7
7
  className?: string;
@@ -51,7 +51,14 @@ declare function defineLandingPage(config: LandingPageConfig): {
51
51
  addSection(section: SectionConfig): /*elided*/ any;
52
52
  removeSection(id: string): /*elided*/ any;
53
53
  updateSection(id: string, updates: Partial<SectionConfig>): /*elided*/ any;
54
- toJSON(): any;
54
+ toJSON(): {
55
+ id: any;
56
+ className: any;
57
+ title: any;
58
+ description: any;
59
+ sections: any;
60
+ theme: any;
61
+ };
55
62
  validate(): string[];
56
63
  getSectionsByType(type: string): SectionConfig[];
57
64
  isValid(): boolean;
@@ -65,9 +72,9 @@ declare function defineLandingPage(config: LandingPageConfig): {
65
72
  interface ButtonConfig extends BaseConfig {
66
73
  text: string;
67
74
  url: string;
68
- variant: 'primary' | 'secondary' | 'outline' | 'ghost';
69
- size: 'sm' | 'md' | 'lg';
70
- target?: '_blank' | '_self';
75
+ variant: "primary" | "secondary" | "outline" | "ghost";
76
+ size: "sm" | "md" | "lg";
77
+ target?: "_blank" | "_self";
71
78
  }
72
79
  interface HeaderConfig extends BaseConfig {
73
80
  logo?: string;
@@ -76,7 +83,7 @@ interface HeaderConfig extends BaseConfig {
76
83
  id?: string;
77
84
  text: string;
78
85
  url: string;
79
- target?: '_blank' | '_self';
86
+ target?: "_blank" | "_self";
80
87
  }[];
81
88
  }
82
89
  interface HeroConfig extends BaseConfig {
@@ -85,7 +92,7 @@ interface HeroConfig extends BaseConfig {
85
92
  image?: string;
86
93
  video?: string;
87
94
  buttons: ButtonConfig[];
88
- alignment?: 'left' | 'center' | 'right';
95
+ alignment?: "left" | "center" | "right";
89
96
  }
90
97
  interface FeatureConfig extends BaseConfig {
91
98
  title: string;
@@ -120,7 +127,7 @@ interface FooterConfig extends BaseConfig {
120
127
  items: {
121
128
  text: string;
122
129
  url: string;
123
- target?: '_blank' | '_self';
130
+ target?: "_blank" | "_self";
124
131
  }[];
125
132
  }[];
126
133
  socialLinks: {
@@ -152,19 +159,19 @@ interface FaqConfig extends BaseConfig {
152
159
  }
153
160
 
154
161
  interface HeaderSection extends SectionConfig {
155
- type: 'header';
162
+ type: "header";
156
163
  config: HeaderConfig;
157
164
  }
158
165
  declare function createHeaderSection(config: HeaderConfig, id?: string, className?: string): HeaderSection;
159
166
 
160
167
  interface HeroSection extends SectionConfig {
161
- type: 'hero';
168
+ type: "hero";
162
169
  config: HeroConfig;
163
170
  }
164
171
  declare function createHeroSection(config: HeroConfig, id?: string, className?: string): HeroSection;
165
172
 
166
173
  interface FeaturesSection extends SectionConfig {
167
- type: 'features';
174
+ type: "features";
168
175
  config: {
169
176
  features: FeatureConfig[];
170
177
  };
@@ -174,7 +181,7 @@ declare function createFeaturesSection(config: {
174
181
  }, id?: string, className?: string): FeaturesSection;
175
182
 
176
183
  interface TestimonialsSection extends SectionConfig {
177
- type: 'testimonials';
184
+ type: "testimonials";
178
185
  config: {
179
186
  testimonials: TestimonialConfig[];
180
187
  };
@@ -184,25 +191,25 @@ declare function createTestimonialsSection(config: {
184
191
  }, id?: string, className?: string): TestimonialsSection;
185
192
 
186
193
  interface PricingSection extends SectionConfig {
187
- type: 'pricing';
194
+ type: "pricing";
188
195
  config: PricingConfig;
189
196
  }
190
197
  declare function createPricingSection(config: PricingConfig, id?: string, className?: string): PricingSection;
191
198
 
192
199
  interface CtaSection extends SectionConfig {
193
- type: 'cta';
200
+ type: "cta";
194
201
  config: CtaConfig;
195
202
  }
196
203
  declare function createCtaSection(config: CtaConfig, id?: string, className?: string): CtaSection;
197
204
 
198
205
  interface FooterSection extends SectionConfig {
199
- type: 'footer';
206
+ type: "footer";
200
207
  config: FooterConfig;
201
208
  }
202
209
  declare function createFooterSection(config: FooterConfig, id?: string, className?: string): FooterSection;
203
210
 
204
211
  interface StatsSection extends SectionConfig {
205
- type: 'stats';
212
+ type: "stats";
206
213
  config: {
207
214
  stats: StatConfig[];
208
215
  };
@@ -212,7 +219,7 @@ declare function createStatsSection(config: {
212
219
  }, id?: string, className?: string): StatsSection;
213
220
 
214
221
  interface FaqSection extends SectionConfig {
215
- type: 'faq';
222
+ type: "faq";
216
223
  config: FaqConfig;
217
224
  }
218
225
  declare function createFaqSection(config: FaqConfig, id?: string, className?: string): FaqSection;
@@ -465,18 +472,33 @@ declare const sectionConfigSchemas: {
465
472
  features: {
466
473
  type: string;
467
474
  properties: {
468
- title: {
469
- type: string;
470
- };
471
- description: {
475
+ features: {
472
476
  type: string;
473
- };
474
- icon: {
475
- type: string;
476
- };
477
- image: {
478
- type: string;
479
- format: string;
477
+ items: {
478
+ type: string;
479
+ properties: {
480
+ id: {
481
+ type: string;
482
+ };
483
+ className: {
484
+ type: string;
485
+ };
486
+ title: {
487
+ type: string;
488
+ };
489
+ description: {
490
+ type: string;
491
+ };
492
+ icon: {
493
+ type: string;
494
+ };
495
+ image: {
496
+ type: string;
497
+ format: string;
498
+ };
499
+ };
500
+ required: string[];
501
+ };
480
502
  };
481
503
  };
482
504
  required: string[];
@@ -484,18 +506,27 @@ declare const sectionConfigSchemas: {
484
506
  testimonials: {
485
507
  type: string;
486
508
  properties: {
487
- quote: {
488
- type: string;
489
- };
490
- author: {
509
+ testimonials: {
491
510
  type: string;
492
- };
493
- role: {
494
- type: string;
495
- };
496
- avatar: {
497
- type: string;
498
- format: string;
511
+ items: {
512
+ type: string;
513
+ properties: {
514
+ quote: {
515
+ type: string;
516
+ };
517
+ author: {
518
+ type: string;
519
+ };
520
+ role: {
521
+ type: string;
522
+ };
523
+ avatar: {
524
+ type: string;
525
+ format: string;
526
+ };
527
+ };
528
+ required: string[];
529
+ };
499
530
  };
500
531
  };
501
532
  required: string[];
@@ -634,20 +665,29 @@ declare const sectionConfigSchemas: {
634
665
  stats: {
635
666
  type: string;
636
667
  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: {
668
+ stats: {
650
669
  type: string;
670
+ items: {
671
+ type: string;
672
+ properties: {
673
+ number: {
674
+ type: string;
675
+ };
676
+ label: {
677
+ type: string;
678
+ };
679
+ icon: {
680
+ type: string;
681
+ };
682
+ prefix: {
683
+ type: string;
684
+ };
685
+ suffix: {
686
+ type: string;
687
+ };
688
+ };
689
+ required: string[];
690
+ };
651
691
  };
652
692
  };
653
693
  required: string[];
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
 
3
- type SectionType = 'hero' | 'features' | 'testimonials' | 'pricing' | 'cta' | 'footer' | 'stats' | 'faq' | 'header';
4
- type ComponentType = 'button' | 'card' | 'image' | 'text' | 'video';
3
+ type SectionType = "hero" | "features" | "testimonials" | "pricing" | "cta" | "footer" | "stats" | "faq" | "header";
4
+ type ComponentType = "button" | "card" | "image" | "text" | "video";
5
5
  interface BaseConfig {
6
6
  id?: string;
7
7
  className?: string;
@@ -51,7 +51,14 @@ declare function defineLandingPage(config: LandingPageConfig): {
51
51
  addSection(section: SectionConfig): /*elided*/ any;
52
52
  removeSection(id: string): /*elided*/ any;
53
53
  updateSection(id: string, updates: Partial<SectionConfig>): /*elided*/ any;
54
- toJSON(): any;
54
+ toJSON(): {
55
+ id: any;
56
+ className: any;
57
+ title: any;
58
+ description: any;
59
+ sections: any;
60
+ theme: any;
61
+ };
55
62
  validate(): string[];
56
63
  getSectionsByType(type: string): SectionConfig[];
57
64
  isValid(): boolean;
@@ -65,9 +72,9 @@ declare function defineLandingPage(config: LandingPageConfig): {
65
72
  interface ButtonConfig extends BaseConfig {
66
73
  text: string;
67
74
  url: string;
68
- variant: 'primary' | 'secondary' | 'outline' | 'ghost';
69
- size: 'sm' | 'md' | 'lg';
70
- target?: '_blank' | '_self';
75
+ variant: "primary" | "secondary" | "outline" | "ghost";
76
+ size: "sm" | "md" | "lg";
77
+ target?: "_blank" | "_self";
71
78
  }
72
79
  interface HeaderConfig extends BaseConfig {
73
80
  logo?: string;
@@ -76,7 +83,7 @@ interface HeaderConfig extends BaseConfig {
76
83
  id?: string;
77
84
  text: string;
78
85
  url: string;
79
- target?: '_blank' | '_self';
86
+ target?: "_blank" | "_self";
80
87
  }[];
81
88
  }
82
89
  interface HeroConfig extends BaseConfig {
@@ -85,7 +92,7 @@ interface HeroConfig extends BaseConfig {
85
92
  image?: string;
86
93
  video?: string;
87
94
  buttons: ButtonConfig[];
88
- alignment?: 'left' | 'center' | 'right';
95
+ alignment?: "left" | "center" | "right";
89
96
  }
90
97
  interface FeatureConfig extends BaseConfig {
91
98
  title: string;
@@ -120,7 +127,7 @@ interface FooterConfig extends BaseConfig {
120
127
  items: {
121
128
  text: string;
122
129
  url: string;
123
- target?: '_blank' | '_self';
130
+ target?: "_blank" | "_self";
124
131
  }[];
125
132
  }[];
126
133
  socialLinks: {
@@ -152,19 +159,19 @@ interface FaqConfig extends BaseConfig {
152
159
  }
153
160
 
154
161
  interface HeaderSection extends SectionConfig {
155
- type: 'header';
162
+ type: "header";
156
163
  config: HeaderConfig;
157
164
  }
158
165
  declare function createHeaderSection(config: HeaderConfig, id?: string, className?: string): HeaderSection;
159
166
 
160
167
  interface HeroSection extends SectionConfig {
161
- type: 'hero';
168
+ type: "hero";
162
169
  config: HeroConfig;
163
170
  }
164
171
  declare function createHeroSection(config: HeroConfig, id?: string, className?: string): HeroSection;
165
172
 
166
173
  interface FeaturesSection extends SectionConfig {
167
- type: 'features';
174
+ type: "features";
168
175
  config: {
169
176
  features: FeatureConfig[];
170
177
  };
@@ -174,7 +181,7 @@ declare function createFeaturesSection(config: {
174
181
  }, id?: string, className?: string): FeaturesSection;
175
182
 
176
183
  interface TestimonialsSection extends SectionConfig {
177
- type: 'testimonials';
184
+ type: "testimonials";
178
185
  config: {
179
186
  testimonials: TestimonialConfig[];
180
187
  };
@@ -184,25 +191,25 @@ declare function createTestimonialsSection(config: {
184
191
  }, id?: string, className?: string): TestimonialsSection;
185
192
 
186
193
  interface PricingSection extends SectionConfig {
187
- type: 'pricing';
194
+ type: "pricing";
188
195
  config: PricingConfig;
189
196
  }
190
197
  declare function createPricingSection(config: PricingConfig, id?: string, className?: string): PricingSection;
191
198
 
192
199
  interface CtaSection extends SectionConfig {
193
- type: 'cta';
200
+ type: "cta";
194
201
  config: CtaConfig;
195
202
  }
196
203
  declare function createCtaSection(config: CtaConfig, id?: string, className?: string): CtaSection;
197
204
 
198
205
  interface FooterSection extends SectionConfig {
199
- type: 'footer';
206
+ type: "footer";
200
207
  config: FooterConfig;
201
208
  }
202
209
  declare function createFooterSection(config: FooterConfig, id?: string, className?: string): FooterSection;
203
210
 
204
211
  interface StatsSection extends SectionConfig {
205
- type: 'stats';
212
+ type: "stats";
206
213
  config: {
207
214
  stats: StatConfig[];
208
215
  };
@@ -212,7 +219,7 @@ declare function createStatsSection(config: {
212
219
  }, id?: string, className?: string): StatsSection;
213
220
 
214
221
  interface FaqSection extends SectionConfig {
215
- type: 'faq';
222
+ type: "faq";
216
223
  config: FaqConfig;
217
224
  }
218
225
  declare function createFaqSection(config: FaqConfig, id?: string, className?: string): FaqSection;
@@ -465,18 +472,33 @@ declare const sectionConfigSchemas: {
465
472
  features: {
466
473
  type: string;
467
474
  properties: {
468
- title: {
469
- type: string;
470
- };
471
- description: {
475
+ features: {
472
476
  type: string;
473
- };
474
- icon: {
475
- type: string;
476
- };
477
- image: {
478
- type: string;
479
- format: string;
477
+ items: {
478
+ type: string;
479
+ properties: {
480
+ id: {
481
+ type: string;
482
+ };
483
+ className: {
484
+ type: string;
485
+ };
486
+ title: {
487
+ type: string;
488
+ };
489
+ description: {
490
+ type: string;
491
+ };
492
+ icon: {
493
+ type: string;
494
+ };
495
+ image: {
496
+ type: string;
497
+ format: string;
498
+ };
499
+ };
500
+ required: string[];
501
+ };
480
502
  };
481
503
  };
482
504
  required: string[];
@@ -484,18 +506,27 @@ declare const sectionConfigSchemas: {
484
506
  testimonials: {
485
507
  type: string;
486
508
  properties: {
487
- quote: {
488
- type: string;
489
- };
490
- author: {
509
+ testimonials: {
491
510
  type: string;
492
- };
493
- role: {
494
- type: string;
495
- };
496
- avatar: {
497
- type: string;
498
- format: string;
511
+ items: {
512
+ type: string;
513
+ properties: {
514
+ quote: {
515
+ type: string;
516
+ };
517
+ author: {
518
+ type: string;
519
+ };
520
+ role: {
521
+ type: string;
522
+ };
523
+ avatar: {
524
+ type: string;
525
+ format: string;
526
+ };
527
+ };
528
+ required: string[];
529
+ };
499
530
  };
500
531
  };
501
532
  required: string[];
@@ -634,20 +665,29 @@ declare const sectionConfigSchemas: {
634
665
  stats: {
635
666
  type: string;
636
667
  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: {
668
+ stats: {
650
669
  type: string;
670
+ items: {
671
+ type: string;
672
+ properties: {
673
+ number: {
674
+ type: string;
675
+ };
676
+ label: {
677
+ type: string;
678
+ };
679
+ icon: {
680
+ type: string;
681
+ };
682
+ prefix: {
683
+ type: string;
684
+ };
685
+ suffix: {
686
+ type: string;
687
+ };
688
+ };
689
+ required: string[];
690
+ };
651
691
  };
652
692
  };
653
693
  required: string[];