@damarkuncoro/landing-page 0.1.2 → 0.1.4

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
@@ -177,7 +177,40 @@ interface HeroConfig {
177
177
  video?: string
178
178
  buttons: ButtonConfig[]
179
179
  alignment?: 'left' | 'center' | 'right'
180
+ skin?: 'default' | 'skin2' | 'skin3' | 'skin4' | 'skin5' | 'skin6' | 'skin7' | 'skin8'
180
181
  }
182
+
183
+ ### Hero Skins
184
+
185
+ #### Default Skin
186
+ Simple centered layout with image below text.
187
+
188
+ #### Skin 2
189
+ Two-column layout with image on the left and text on the right.
190
+
191
+ #### Skin 3
192
+ Gradient background with white text.
193
+
194
+ #### Skin 4
195
+ Video background with dark overlay.
196
+
197
+ #### Skin 5
198
+ Gambar di atas dengan teks di bawah, latar belakang berwarna terang.
199
+
200
+ #### Skin 6
201
+ Gambar di sebelah kanan dengan teks di kiri, latar belakang hitam dengan gradien.
202
+
203
+ #### Skin 7
204
+ Desain minimalis dengan latar belakang putih dan elemen yang bersih. Gambar di atas teks.
205
+
206
+ #### Skin 8
207
+ Desain dengan latar belakang gradien biru muda dan teks berwarna putih. Gambar di sebelah kanan dengan teks di kiri.
208
+
209
+ #### Skin 9
210
+ Title, subtitle, dan buttons di atas gambar.
211
+
212
+ #### Skin 10
213
+ Full screen hero dengan latar belakang gradien dan konten di tengah.
181
214
  ```
182
215
 
183
216
  #### Features Section
@@ -290,12 +323,28 @@ interface ThemeConfig {
290
323
  body: string
291
324
  mono: string
292
325
  }
326
+ typography: {
327
+ h1: string
328
+ h2: string
329
+ h3: string
330
+ body: string
331
+ small: string
332
+ }
333
+ fontWeights: {
334
+ normal: string | number
335
+ medium: string | number
336
+ bold: string | number
337
+ }
293
338
  breakpoints: {
294
339
  sm: string
295
340
  md: string
296
341
  lg: string
297
342
  xl: string
298
343
  }
344
+ sizes?: {
345
+ subtitleMaxWidth?: string
346
+ containerMaxWidth?: string
347
+ }
299
348
  }
300
349
  ```
301
350
 
@@ -1,82 +1,14 @@
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";
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(): {
55
- id: any;
56
- className: any;
57
- title: any;
58
- description: any;
59
- sections: any;
60
- theme: any;
61
- };
62
- validate(): string[];
63
- getSectionsByType(type: string): SectionConfig[];
64
- isValid(): boolean;
65
- title: string;
66
- description: string;
67
- sections: SectionConfig[];
68
- id?: string;
69
- className?: string;
70
- };
71
-
72
- interface ButtonConfig extends BaseConfig {
3
+ interface ButtonConfig extends WithBaseConfig<{
73
4
  text: string;
74
5
  url: string;
75
6
  variant: "primary" | "secondary" | "outline" | "ghost";
76
7
  size: "sm" | "md" | "lg";
77
8
  target?: "_blank" | "_self";
9
+ }> {
78
10
  }
79
- interface HeaderConfig extends BaseConfig {
11
+ interface HeaderConfig extends WithBaseConfig<{
80
12
  logo?: string;
81
13
  title?: string;
82
14
  links: {
@@ -85,28 +17,35 @@ interface HeaderConfig extends BaseConfig {
85
17
  url: string;
86
18
  target?: "_blank" | "_self";
87
19
  }[];
20
+ }> {
88
21
  }
89
- interface HeroConfig extends BaseConfig {
22
+ interface HeroConfig extends WithBaseConfig<{
90
23
  title: string;
91
- subtitle: string;
24
+ subtitle?: string;
92
25
  image?: string;
26
+ imageAlt?: string;
93
27
  video?: string;
28
+ captionsSrc?: string;
94
29
  buttons: ButtonConfig[];
95
30
  alignment?: "left" | "center" | "right";
31
+ skin?: "default" | "skin2" | "skin3" | "skin4" | "skin5" | "skin6" | "skin7" | "skin8" | "skin9" | "skin10";
32
+ }> {
96
33
  }
97
- interface FeatureConfig extends BaseConfig {
34
+ interface FeatureConfig extends WithBaseConfig<{
98
35
  title: string;
99
36
  description: string;
100
37
  icon?: string;
101
38
  image?: string;
39
+ }> {
102
40
  }
103
- interface TestimonialConfig extends BaseConfig {
41
+ interface TestimonialConfig extends WithBaseConfig<{
104
42
  quote: string;
105
43
  author: string;
106
44
  role?: string;
107
45
  avatar?: string;
46
+ }> {
108
47
  }
109
- interface PricingConfig extends BaseConfig {
48
+ interface PricingConfig extends WithBaseConfig<{
110
49
  plans: {
111
50
  id?: string;
112
51
  title: string;
@@ -117,8 +56,9 @@ interface PricingConfig extends BaseConfig {
117
56
  button: ButtonConfig;
118
57
  featured?: boolean;
119
58
  }[];
59
+ }> {
120
60
  }
121
- interface FooterConfig extends BaseConfig {
61
+ interface FooterConfig extends WithBaseConfig<{
122
62
  logo?: string;
123
63
  title?: string;
124
64
  description?: string;
@@ -136,41 +76,173 @@ interface FooterConfig extends BaseConfig {
136
76
  icon?: string;
137
77
  }[];
138
78
  copyright?: string;
79
+ }> {
139
80
  }
140
- interface CtaConfig extends BaseConfig {
81
+ interface CtaConfig extends WithBaseConfig<{
141
82
  title: string;
142
83
  description: string;
143
84
  button: ButtonConfig;
144
85
  image?: string;
86
+ }> {
145
87
  }
146
- interface StatConfig extends BaseConfig {
88
+ interface StatConfig extends WithBaseConfig<{
147
89
  number: string;
148
90
  label: string;
149
91
  icon?: string;
150
92
  prefix?: string;
151
93
  suffix?: string;
94
+ }> {
152
95
  }
153
- interface FaqConfig extends BaseConfig {
96
+ interface FaqConfig extends WithBaseConfig<{
154
97
  items: {
155
98
  id?: string;
156
99
  question: string;
157
100
  answer: string;
158
101
  }[];
102
+ }> {
159
103
  }
160
104
 
161
- interface HeaderSection extends SectionConfig {
105
+ type SectionType = "hero" | "features" | "testimonials" | "pricing" | "cta" | "footer" | "stats" | "faq" | "header";
106
+ type ComponentType = "button" | "card" | "image" | "text" | "video";
107
+ type WithBaseConfig<T> = T & {
108
+ id?: string;
109
+ className?: string;
110
+ };
111
+ type DeepPartial<T> = {
112
+ [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
113
+ };
114
+ interface ThemeConfig {
115
+ colors: {
116
+ primary: string;
117
+ secondary: string;
118
+ accent: string;
119
+ background: string;
120
+ text: string;
121
+ muted: string;
122
+ };
123
+ spacing: {
124
+ xs: string;
125
+ sm: string;
126
+ md: string;
127
+ lg: string;
128
+ xl: string;
129
+ };
130
+ fonts: {
131
+ heading: string;
132
+ body: string;
133
+ mono: string;
134
+ };
135
+ typography: {
136
+ h1: string;
137
+ h2: string;
138
+ h3: string;
139
+ body: string;
140
+ small: string;
141
+ };
142
+ fontWeights: {
143
+ normal: string | number;
144
+ medium: string | number;
145
+ bold: string | number;
146
+ };
147
+ breakpoints: {
148
+ sm: string;
149
+ md: string;
150
+ lg: string;
151
+ xl: string;
152
+ };
153
+ sizes?: {
154
+ subtitleMaxWidth?: string;
155
+ containerMaxWidth?: string;
156
+ };
157
+ }
158
+ interface BaseSectionConfig {
159
+ type: SectionType;
160
+ id?: string;
161
+ className?: string;
162
+ label?: string;
163
+ }
164
+ type SectionConfig = WithBaseConfig<{
165
+ type: "hero";
166
+ config: HeroConfig;
167
+ label?: string;
168
+ }> | WithBaseConfig<{
169
+ type: "features";
170
+ config: FeatureConfig[];
171
+ label?: string;
172
+ }> | WithBaseConfig<{
173
+ type: "testimonials";
174
+ config: TestimonialConfig[];
175
+ label?: string;
176
+ }> | WithBaseConfig<{
177
+ type: "pricing";
178
+ config: PricingConfig;
179
+ label?: string;
180
+ }> | WithBaseConfig<{
181
+ type: "cta";
182
+ config: CtaConfig;
183
+ label?: string;
184
+ }> | WithBaseConfig<{
185
+ type: "footer";
186
+ config: FooterConfig;
187
+ label?: string;
188
+ }> | WithBaseConfig<{
189
+ type: "stats";
190
+ config: StatConfig[];
191
+ label?: string;
192
+ }> | WithBaseConfig<{
193
+ type: "faq";
194
+ config: FaqConfig;
195
+ label?: string;
196
+ }> | WithBaseConfig<{
197
+ type: "header";
198
+ config: HeaderConfig;
199
+ label?: string;
200
+ }>;
201
+ interface LandingPageConfig extends WithBaseConfig<{
202
+ title: string;
203
+ description: string;
204
+ sections: readonly SectionConfig[];
205
+ theme?: DeepPartial<ThemeConfig>;
206
+ }> {
207
+ }
208
+
209
+ declare function defineLandingPage(config: LandingPageConfig): {
210
+ sections: SectionConfig[];
211
+ theme: ThemeConfig;
212
+ getSection(id: string): SectionConfig | undefined;
213
+ addSection(section: SectionConfig): /*elided*/ any;
214
+ removeSection(id: string): /*elided*/ any;
215
+ updateSection(id: string, updates: Partial<SectionConfig>): /*elided*/ any;
216
+ toJSON(): {
217
+ id: any;
218
+ className: any;
219
+ title: any;
220
+ description: any;
221
+ sections: any;
222
+ theme: any;
223
+ };
224
+ validate(): string[];
225
+ getSectionsByType(type: string): SectionConfig[];
226
+ isValid(): boolean;
227
+ title: string;
228
+ description: string;
229
+ id?: string;
230
+ className?: string;
231
+ };
232
+
233
+ interface HeaderSection extends BaseSectionConfig {
162
234
  type: "header";
163
235
  config: HeaderConfig;
164
236
  }
165
237
  declare function createHeaderSection(config: HeaderConfig, id?: string, className?: string): HeaderSection;
166
238
 
167
- interface HeroSection extends SectionConfig {
239
+ interface HeroSection extends BaseSectionConfig {
168
240
  type: "hero";
169
241
  config: HeroConfig;
170
242
  }
171
243
  declare function createHeroSection(config: HeroConfig, id?: string, className?: string): HeroSection;
172
244
 
173
- interface FeaturesSection extends SectionConfig {
245
+ interface FeaturesSection extends BaseSectionConfig {
174
246
  type: "features";
175
247
  config: {
176
248
  features: FeatureConfig[];
@@ -180,7 +252,7 @@ declare function createFeaturesSection(config: {
180
252
  features: FeatureConfig[];
181
253
  }, id?: string, className?: string): FeaturesSection;
182
254
 
183
- interface TestimonialsSection extends SectionConfig {
255
+ interface TestimonialsSection extends BaseSectionConfig {
184
256
  type: "testimonials";
185
257
  config: {
186
258
  testimonials: TestimonialConfig[];
@@ -190,25 +262,25 @@ declare function createTestimonialsSection(config: {
190
262
  testimonials: TestimonialConfig[];
191
263
  }, id?: string, className?: string): TestimonialsSection;
192
264
 
193
- interface PricingSection extends SectionConfig {
265
+ interface PricingSection extends BaseSectionConfig {
194
266
  type: "pricing";
195
267
  config: PricingConfig;
196
268
  }
197
269
  declare function createPricingSection(config: PricingConfig, id?: string, className?: string): PricingSection;
198
270
 
199
- interface CtaSection extends SectionConfig {
271
+ interface CtaSection extends BaseSectionConfig {
200
272
  type: "cta";
201
273
  config: CtaConfig;
202
274
  }
203
275
  declare function createCtaSection(config: CtaConfig, id?: string, className?: string): CtaSection;
204
276
 
205
- interface FooterSection extends SectionConfig {
277
+ interface FooterSection extends BaseSectionConfig {
206
278
  type: "footer";
207
279
  config: FooterConfig;
208
280
  }
209
281
  declare function createFooterSection(config: FooterConfig, id?: string, className?: string): FooterSection;
210
282
 
211
- interface StatsSection extends SectionConfig {
283
+ interface StatsSection extends BaseSectionConfig {
212
284
  type: "stats";
213
285
  config: {
214
286
  stats: StatConfig[];
@@ -218,7 +290,7 @@ declare function createStatsSection(config: {
218
290
  stats: StatConfig[];
219
291
  }, id?: string, className?: string): StatsSection;
220
292
 
221
- interface FaqSection extends SectionConfig {
293
+ interface FaqSection extends BaseSectionConfig {
222
294
  type: "faq";
223
295
  config: FaqConfig;
224
296
  }
@@ -303,9 +375,75 @@ declare const landingPageSchema: {
303
375
  fonts: {
304
376
  $ref: string;
305
377
  };
378
+ typography: {
379
+ $ref: string;
380
+ };
381
+ fontWeights: {
382
+ $ref: string;
383
+ };
306
384
  breakpoints: {
307
385
  $ref: string;
308
386
  };
387
+ sizes: {
388
+ $ref: string;
389
+ };
390
+ };
391
+ };
392
+ Typography: {
393
+ type: string;
394
+ properties: {
395
+ h1: {
396
+ type: string;
397
+ description: string;
398
+ };
399
+ h2: {
400
+ type: string;
401
+ description: string;
402
+ };
403
+ h3: {
404
+ type: string;
405
+ description: string;
406
+ };
407
+ body: {
408
+ type: string;
409
+ description: string;
410
+ };
411
+ small: {
412
+ type: string;
413
+ description: string;
414
+ };
415
+ };
416
+ required: string[];
417
+ };
418
+ FontWeights: {
419
+ type: string;
420
+ properties: {
421
+ normal: {
422
+ type: string[];
423
+ description: string;
424
+ };
425
+ medium: {
426
+ type: string[];
427
+ description: string;
428
+ };
429
+ bold: {
430
+ type: string[];
431
+ description: string;
432
+ };
433
+ };
434
+ required: string[];
435
+ };
436
+ Sizes: {
437
+ type: string;
438
+ properties: {
439
+ subtitleMaxWidth: {
440
+ type: string;
441
+ description: string;
442
+ };
443
+ containerMaxWidth: {
444
+ type: string;
445
+ description: string;
446
+ };
309
447
  };
310
448
  };
311
449
  Colors: {
@@ -452,10 +590,17 @@ declare const sectionConfigSchemas: {
452
590
  type: string;
453
591
  format: string;
454
592
  };
593
+ imageAlt: {
594
+ type: string;
595
+ };
455
596
  video: {
456
597
  type: string;
457
598
  format: string;
458
599
  };
600
+ captionsSrc: {
601
+ type: string;
602
+ format: string;
603
+ };
459
604
  buttons: {
460
605
  type: string;
461
606
  items: {
@@ -466,6 +611,10 @@ declare const sectionConfigSchemas: {
466
611
  type: string;
467
612
  enum: string[];
468
613
  };
614
+ skin: {
615
+ type: string;
616
+ enum: string[];
617
+ };
469
618
  };
470
619
  required: string[];
471
620
  };
@@ -755,6 +904,6 @@ declare const sectionConfigSchemas: {
755
904
  };
756
905
 
757
906
  declare function validateConfig(config: Partial<LandingPageConfig>): string[];
758
- declare function validateSection(section: Partial<SectionConfig>): string[];
907
+ declare function validateSection(section: any): string[];
759
908
 
760
- 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 };
909
+ export { ButtonConfig, ComponentType, CtaConfig, FaqConfig, FeatureConfig, FooterConfig, HeaderConfig, HeroConfig, LandingPageConfig, PricingConfig, SectionType, StatConfig, TestimonialConfig, ThemeConfig, createCtaSection, createFaqSection, createFeaturesSection, createFooterSection, createHeaderSection, createHeroSection, createPricingSection, createReactRenderer, createStatsSection, createTestimonialsSection, defaultTheme, defineLandingPage, landingPageSchema, sectionConfigSchemas, validateConfig, validateSection };