@damarkuncoro/landing-page 0.1.4 → 0.1.6

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
@@ -22,6 +22,119 @@ Config-driven landing page library for building beautiful, responsive landing pa
22
22
  npm install @damarkuncoro/landing-page
23
23
  ```
24
24
 
25
+ ## Using "No Skin" (Base UI)
26
+
27
+ The library supports a "no skin" option that allows you to use the base UI components without any additional styling. This gives you full control over the styling through CSS or inline styles.
28
+
29
+ ### Usage
30
+
31
+ ```typescript
32
+ import { defineLandingPage } from '@damarkuncoro/landing-page'
33
+
34
+ const landingPage = defineLandingPage({
35
+ title: 'My Landing Page with Base UI',
36
+ description: 'A landing page using the base UI components',
37
+ sections: [
38
+ {
39
+ id: 'hero',
40
+ type: 'hero',
41
+ config: {
42
+ title: 'Welcome to Our Platform',
43
+ subtitle: 'Discover amazing features that will transform your workflow',
44
+ buttons: [
45
+ {
46
+ id: 'primary-button',
47
+ text: 'Get Started',
48
+ url: '/signup',
49
+ variant: 'primary',
50
+ size: 'md',
51
+ skin: 'none', // Use base UI without skin
52
+ },
53
+ {
54
+ id: 'secondary-button',
55
+ text: 'Learn More',
56
+ url: '/about',
57
+ variant: 'secondary',
58
+ size: 'md',
59
+ skin: 'none', // Use base UI without skin
60
+ },
61
+ ],
62
+ skin: 'none', // Use base UI without skin
63
+ },
64
+ },
65
+ {
66
+ id: 'features',
67
+ type: 'features',
68
+ config: {
69
+ features: [
70
+ {
71
+ id: 'feature-1',
72
+ title: 'Fast Performance',
73
+ description: 'Our platform is optimized for speed and efficiency',
74
+ },
75
+ {
76
+ id: 'feature-2',
77
+ title: 'Modern Design',
78
+ description: 'Beautiful, responsive interface that works on all devices',
79
+ },
80
+ {
81
+ id: 'feature-3',
82
+ title: 'Secure & Reliable',
83
+ description: 'Enterprise-grade security and reliability',
84
+ },
85
+ ],
86
+ skin: 'none', // Use base UI without skin
87
+ },
88
+ },
89
+ ],
90
+ })
91
+ ```
92
+
93
+ ### Customizing Base UI
94
+
95
+ When using `skin: 'none'`, you can customize the components using the `style` and `className` props:
96
+
97
+ ```typescript
98
+ const landingPage = defineLandingPage({
99
+ title: 'My Customized Landing Page',
100
+ description: 'A landing page with customized base UI components',
101
+ sections: [
102
+ {
103
+ id: 'hero',
104
+ type: 'hero',
105
+ config: {
106
+ title: 'Welcome to Our Platform',
107
+ subtitle: 'Discover amazing features that will transform your workflow',
108
+ buttons: [
109
+ {
110
+ id: 'primary-button',
111
+ text: 'Get Started',
112
+ url: '/signup',
113
+ variant: 'primary',
114
+ size: 'md',
115
+ skin: 'none',
116
+ className: 'my-custom-button', // Custom CSS class
117
+ style: {
118
+ backgroundColor: '#ff0000',
119
+ color: '#ffffff',
120
+ padding: '12px 24px',
121
+ borderRadius: '8px',
122
+ fontSize: '16px',
123
+ },
124
+ },
125
+ ],
126
+ skin: 'none',
127
+ className: 'my-custom-hero', // Custom CSS class
128
+ style: {
129
+ padding: '80px 0',
130
+ backgroundColor: '#f5f5f5',
131
+ },
132
+ },
133
+ },
134
+ ],
135
+ })
136
+ ```
137
+
25
138
  ## Quick Start
26
139
 
27
140
  1. Define your landing page configuration:
@@ -102,6 +215,112 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
102
215
  )
103
216
  ```
104
217
 
218
+ ## Using Tailwind CSS
219
+
220
+ The library supports Tailwind CSS out of the box through Tailwind-based skins. To use Tailwind CSS:
221
+
222
+ 1. Install Tailwind CSS in your project:
223
+ ```bash
224
+ npm install -D tailwindcss postcss autoprefixer
225
+ npx tailwindcss init -p
226
+ ```
227
+
228
+ 2. Configure Tailwind CSS:
229
+ ```javascript
230
+ // tailwind.config.js
231
+ /** @type {import('tailwindcss').Config} */
232
+ export default {
233
+ content: [
234
+ "./index.html",
235
+ "./src/**/*.{js,ts,jsx,tsx}",
236
+ ],
237
+ theme: {
238
+ extend: {
239
+ colors: {
240
+ primary: '#3b82f6',
241
+ secondary: '#8b5cf6',
242
+ accent: '#10b981',
243
+ background: '#ffffff',
244
+ text: '#1f2937',
245
+ muted: '#6b7280',
246
+ },
247
+ },
248
+ },
249
+ plugins: [],
250
+ }
251
+ ```
252
+
253
+ 3. Import Tailwind CSS in your main stylesheet:
254
+ ```css
255
+ /* index.css */
256
+ @tailwind base;
257
+ @tailwind components;
258
+ @tailwind utilities;
259
+ ```
260
+
261
+ 4. Use Tailwind skins in your configuration:
262
+ ```typescript
263
+ import { defineLandingPage } from '@damarkuncoro/landing-page'
264
+
265
+ const landingPage = defineLandingPage({
266
+ title: 'My Tailwind Landing Page',
267
+ description: 'A beautiful landing page using Tailwind CSS',
268
+ sections: [
269
+ {
270
+ id: 'hero',
271
+ type: 'hero',
272
+ config: {
273
+ title: 'Welcome to Our Platform',
274
+ subtitle: 'Discover amazing features that will transform your workflow',
275
+ buttons: [
276
+ {
277
+ id: 'primary-button',
278
+ text: 'Get Started',
279
+ url: '/signup',
280
+ variant: 'primary',
281
+ size: 'md',
282
+ skin: 'tailwind',
283
+ },
284
+ {
285
+ id: 'secondary-button',
286
+ text: 'Learn More',
287
+ url: '/about',
288
+ variant: 'secondary',
289
+ size: 'md',
290
+ skin: 'tailwind',
291
+ },
292
+ ],
293
+ skin: 'tailwind',
294
+ },
295
+ },
296
+ {
297
+ id: 'features',
298
+ type: 'features',
299
+ config: {
300
+ features: [
301
+ {
302
+ id: 'feature-1',
303
+ title: 'Fast Performance',
304
+ description: 'Our platform is optimized for speed and efficiency',
305
+ },
306
+ {
307
+ id: 'feature-2',
308
+ title: 'Modern Design',
309
+ description: 'Beautiful, responsive interface that works on all devices',
310
+ },
311
+ {
312
+ id: 'feature-3',
313
+ title: 'Secure & Reliable',
314
+ description: 'Enterprise-grade security and reliability',
315
+ },
316
+ ],
317
+ skin: 'tailwind',
318
+ },
319
+ },
320
+ ],
321
+ })
322
+ ```
323
+
105
324
  ## Schema & Validation
106
325
 
107
326
  The library includes comprehensive JSON schemas for validating landing page configurations. You can use these schemas to:
@@ -177,7 +396,7 @@ interface HeroConfig {
177
396
  video?: string
178
397
  buttons: ButtonConfig[]
179
398
  alignment?: 'left' | 'center' | 'right'
180
- skin?: 'default' | 'skin2' | 'skin3' | 'skin4' | 'skin5' | 'skin6' | 'skin7' | 'skin8'
399
+ skin?: 'default' | 'skin2' | 'skin3' | 'skin4' | 'skin5' | 'skin6' | 'skin7' | 'skin8' | 'none'
181
400
  }
182
401
 
183
402
  ### Hero Skins
@@ -211,6 +430,9 @@ Title, subtitle, dan buttons di atas gambar.
211
430
 
212
431
  #### Skin 10
213
432
  Full screen hero dengan latar belakang gradien dan konten di tengah.
433
+
434
+ #### Tailwind Skin
435
+ Tailwind-based skin that uses Tailwind CSS classes for styling. Requires Tailwind CSS to be installed in your project.
214
436
  ```
215
437
 
216
438
  #### Features Section
@@ -4,19 +4,49 @@ interface ButtonConfig extends WithBaseConfig<{
4
4
  text: string;
5
5
  url: string;
6
6
  variant: "primary" | "secondary" | "outline" | "ghost";
7
- size: "sm" | "md" | "lg";
7
+ size?: "sm" | "md" | "lg";
8
8
  target?: "_blank" | "_self";
9
+ skin?: "default" | "tailwind";
10
+ padding?: string;
11
+ fontSize?: string;
9
12
  }> {
10
13
  }
14
+ interface NavbarLinkConfig {
15
+ id?: string;
16
+ text: string;
17
+ url?: string;
18
+ target?: "_blank" | "_self";
19
+ isActive?: boolean;
20
+ isLoading?: boolean;
21
+ children?: NavbarLinkConfig[];
22
+ }
23
+ interface LanguageConfig {
24
+ code: string;
25
+ name: string;
26
+ }
27
+ interface LanguageSelectorConfig {
28
+ currentLanguage: string;
29
+ languages: LanguageConfig[];
30
+ onLanguageChange?: (code: string) => void;
31
+ }
32
+ interface ThemeSwitcherConfig {
33
+ currentTheme: "light" | "dark";
34
+ onThemeChange?: (theme: "light" | "dark") => void;
35
+ }
11
36
  interface HeaderConfig extends WithBaseConfig<{
12
37
  logo?: string;
13
38
  title?: string;
14
- links: {
15
- id?: string;
16
- text: string;
17
- url: string;
18
- target?: "_blank" | "_self";
19
- }[];
39
+ links: NavbarLinkConfig[];
40
+ buttons?: ButtonConfig[];
41
+ fixed?: boolean;
42
+ scrollEffect?: boolean;
43
+ skin?: "default" | "tailwind";
44
+ searchPlaceholder?: string;
45
+ onSearch?: (query: string) => void;
46
+ initialSearchValue?: string;
47
+ showSearchInMobileMenu?: boolean;
48
+ languageSelector?: LanguageSelectorConfig;
49
+ themeSwitcher?: ThemeSwitcherConfig;
20
50
  }> {
21
51
  }
22
52
  interface HeroConfig extends WithBaseConfig<{
@@ -28,7 +58,7 @@ interface HeroConfig extends WithBaseConfig<{
28
58
  captionsSrc?: string;
29
59
  buttons: ButtonConfig[];
30
60
  alignment?: "left" | "center" | "right";
31
- skin?: "default" | "skin2" | "skin3" | "skin4" | "skin5" | "skin6" | "skin7" | "skin8" | "skin9" | "skin10";
61
+ skin?: "default" | "skin2" | "skin3" | "skin4" | "skin5" | "skin6" | "skin7" | "skin8" | "skin9" | "skin10" | "tailwind";
32
62
  }> {
33
63
  }
34
64
  interface FeatureConfig extends WithBaseConfig<{
@@ -36,6 +66,7 @@ interface FeatureConfig extends WithBaseConfig<{
36
66
  description: string;
37
67
  icon?: string;
38
68
  image?: string;
69
+ skin?: "default" | "tailwind";
39
70
  }> {
40
71
  }
41
72
  interface TestimonialConfig extends WithBaseConfig<{
@@ -167,11 +198,15 @@ type SectionConfig = WithBaseConfig<{
167
198
  label?: string;
168
199
  }> | WithBaseConfig<{
169
200
  type: "features";
170
- config: FeatureConfig[];
201
+ config: {
202
+ features: FeatureConfig[];
203
+ };
171
204
  label?: string;
172
205
  }> | WithBaseConfig<{
173
206
  type: "testimonials";
174
- config: TestimonialConfig[];
207
+ config: {
208
+ testimonials: TestimonialConfig[];
209
+ };
175
210
  label?: string;
176
211
  }> | WithBaseConfig<{
177
212
  type: "pricing";
@@ -187,7 +222,9 @@ type SectionConfig = WithBaseConfig<{
187
222
  label?: string;
188
223
  }> | WithBaseConfig<{
189
224
  type: "stats";
190
- config: StatConfig[];
225
+ config: {
226
+ stats: StatConfig[];
227
+ };
191
228
  label?: string;
192
229
  }> | WithBaseConfig<{
193
230
  type: "faq";
@@ -570,6 +607,10 @@ declare const landingPageSchema: {
570
607
  type: string;
571
608
  enum: string[];
572
609
  };
610
+ skin: {
611
+ type: string;
612
+ enum: string[];
613
+ };
573
614
  };
574
615
  required: string[];
575
616
  };
@@ -894,10 +935,81 @@ declare const sectionConfigSchemas: {
894
935
  type: string;
895
936
  enum: string[];
896
937
  };
938
+ isActive: {
939
+ type: string;
940
+ };
941
+ isLoading: {
942
+ type: string;
943
+ };
944
+ children: {
945
+ type: string;
946
+ items: {
947
+ $ref: string;
948
+ };
949
+ };
897
950
  };
898
951
  required: string[];
899
952
  };
900
953
  };
954
+ buttons: {
955
+ type: string;
956
+ items: {
957
+ $ref: string;
958
+ };
959
+ };
960
+ fixed: {
961
+ type: string;
962
+ };
963
+ scrollEffect: {
964
+ type: string;
965
+ };
966
+ skin: {
967
+ type: string;
968
+ enum: string[];
969
+ };
970
+ searchPlaceholder: {
971
+ type: string;
972
+ };
973
+ initialSearchValue: {
974
+ type: string;
975
+ };
976
+ showSearchInMobileMenu: {
977
+ type: string;
978
+ };
979
+ languageSelector: {
980
+ type: string;
981
+ properties: {
982
+ currentLanguage: {
983
+ type: string;
984
+ };
985
+ languages: {
986
+ type: string;
987
+ items: {
988
+ type: string;
989
+ properties: {
990
+ code: {
991
+ type: string;
992
+ };
993
+ name: {
994
+ type: string;
995
+ };
996
+ };
997
+ required: string[];
998
+ };
999
+ };
1000
+ };
1001
+ required: string[];
1002
+ };
1003
+ themeSwitcher: {
1004
+ type: string;
1005
+ properties: {
1006
+ currentTheme: {
1007
+ type: string;
1008
+ enum: string[];
1009
+ };
1010
+ };
1011
+ required: string[];
1012
+ };
901
1013
  };
902
1014
  required: string[];
903
1015
  };