@damarkuncoro/landing-page 0.1.4 → 0.1.5
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 +109 -0
- package/lib/cjs/index.d.ts +118 -7
- package/lib/cjs/index.js +1128 -302
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.d.mts +118 -7
- package/lib/esm/index.mjs +1128 -302
- package/lib/esm/index.mjs.map +1 -1
- package/package.json +6 -12
package/README.md
CHANGED
|
@@ -102,6 +102,112 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
|
102
102
|
)
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
+
## Using Tailwind CSS
|
|
106
|
+
|
|
107
|
+
The library supports Tailwind CSS out of the box through Tailwind-based skins. To use Tailwind CSS:
|
|
108
|
+
|
|
109
|
+
1. Install Tailwind CSS in your project:
|
|
110
|
+
```bash
|
|
111
|
+
npm install -D tailwindcss postcss autoprefixer
|
|
112
|
+
npx tailwindcss init -p
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
2. Configure Tailwind CSS:
|
|
116
|
+
```javascript
|
|
117
|
+
// tailwind.config.js
|
|
118
|
+
/** @type {import('tailwindcss').Config} */
|
|
119
|
+
export default {
|
|
120
|
+
content: [
|
|
121
|
+
"./index.html",
|
|
122
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
123
|
+
],
|
|
124
|
+
theme: {
|
|
125
|
+
extend: {
|
|
126
|
+
colors: {
|
|
127
|
+
primary: '#3b82f6',
|
|
128
|
+
secondary: '#8b5cf6',
|
|
129
|
+
accent: '#10b981',
|
|
130
|
+
background: '#ffffff',
|
|
131
|
+
text: '#1f2937',
|
|
132
|
+
muted: '#6b7280',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
plugins: [],
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
3. Import Tailwind CSS in your main stylesheet:
|
|
141
|
+
```css
|
|
142
|
+
/* index.css */
|
|
143
|
+
@tailwind base;
|
|
144
|
+
@tailwind components;
|
|
145
|
+
@tailwind utilities;
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
4. Use Tailwind skins in your configuration:
|
|
149
|
+
```typescript
|
|
150
|
+
import { defineLandingPage } from '@damarkuncoro/landing-page'
|
|
151
|
+
|
|
152
|
+
const landingPage = defineLandingPage({
|
|
153
|
+
title: 'My Tailwind Landing Page',
|
|
154
|
+
description: 'A beautiful landing page using Tailwind CSS',
|
|
155
|
+
sections: [
|
|
156
|
+
{
|
|
157
|
+
id: 'hero',
|
|
158
|
+
type: 'hero',
|
|
159
|
+
config: {
|
|
160
|
+
title: 'Welcome to Our Platform',
|
|
161
|
+
subtitle: 'Discover amazing features that will transform your workflow',
|
|
162
|
+
buttons: [
|
|
163
|
+
{
|
|
164
|
+
id: 'primary-button',
|
|
165
|
+
text: 'Get Started',
|
|
166
|
+
url: '/signup',
|
|
167
|
+
variant: 'primary',
|
|
168
|
+
size: 'md',
|
|
169
|
+
skin: 'tailwind',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
id: 'secondary-button',
|
|
173
|
+
text: 'Learn More',
|
|
174
|
+
url: '/about',
|
|
175
|
+
variant: 'secondary',
|
|
176
|
+
size: 'md',
|
|
177
|
+
skin: 'tailwind',
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
skin: 'tailwind',
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: 'features',
|
|
185
|
+
type: 'features',
|
|
186
|
+
config: {
|
|
187
|
+
features: [
|
|
188
|
+
{
|
|
189
|
+
id: 'feature-1',
|
|
190
|
+
title: 'Fast Performance',
|
|
191
|
+
description: 'Our platform is optimized for speed and efficiency',
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: 'feature-2',
|
|
195
|
+
title: 'Modern Design',
|
|
196
|
+
description: 'Beautiful, responsive interface that works on all devices',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
id: 'feature-3',
|
|
200
|
+
title: 'Secure & Reliable',
|
|
201
|
+
description: 'Enterprise-grade security and reliability',
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
skin: 'tailwind',
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
})
|
|
209
|
+
```
|
|
210
|
+
|
|
105
211
|
## Schema & Validation
|
|
106
212
|
|
|
107
213
|
The library includes comprehensive JSON schemas for validating landing page configurations. You can use these schemas to:
|
|
@@ -211,6 +317,9 @@ Title, subtitle, dan buttons di atas gambar.
|
|
|
211
317
|
|
|
212
318
|
#### Skin 10
|
|
213
319
|
Full screen hero dengan latar belakang gradien dan konten di tengah.
|
|
320
|
+
|
|
321
|
+
#### Tailwind Skin
|
|
322
|
+
Tailwind-based skin that uses Tailwind CSS classes for styling. Requires Tailwind CSS to be installed in your project.
|
|
214
323
|
```
|
|
215
324
|
|
|
216
325
|
#### Features Section
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -4,19 +4,51 @@ interface ButtonConfig extends WithBaseConfig<{
|
|
|
4
4
|
text: string;
|
|
5
5
|
url: string;
|
|
6
6
|
variant: "primary" | "secondary" | "outline" | "ghost";
|
|
7
|
-
size
|
|
7
|
+
size?: "sm" | "md" | "lg";
|
|
8
8
|
target?: "_blank" | "_self";
|
|
9
|
+
skin?: "default" | "tailwind";
|
|
9
10
|
}> {
|
|
10
11
|
}
|
|
12
|
+
interface NavbarLinkConfig {
|
|
13
|
+
id?: string;
|
|
14
|
+
text: string;
|
|
15
|
+
url?: string;
|
|
16
|
+
target?: "_blank" | "_self";
|
|
17
|
+
isActive?: boolean;
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
children?: NavbarLinkConfig[];
|
|
20
|
+
}
|
|
21
|
+
interface LanguageConfig {
|
|
22
|
+
code: string;
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
25
|
+
interface LanguageSelectorConfig {
|
|
26
|
+
currentLanguage: string;
|
|
27
|
+
languages: LanguageConfig[];
|
|
28
|
+
onLanguageChange?: (code: string) => void;
|
|
29
|
+
}
|
|
30
|
+
interface ThemeSwitcherConfig {
|
|
31
|
+
currentTheme: "light" | "dark";
|
|
32
|
+
onThemeChange?: (theme: "light" | "dark") => void;
|
|
33
|
+
}
|
|
11
34
|
interface HeaderConfig extends WithBaseConfig<{
|
|
12
35
|
logo?: string;
|
|
13
36
|
title?: string;
|
|
14
|
-
links:
|
|
15
|
-
|
|
37
|
+
links: NavbarLinkConfig[];
|
|
38
|
+
buttons?: {
|
|
16
39
|
text: string;
|
|
17
40
|
url: string;
|
|
41
|
+
variant: "primary" | "secondary" | "outline" | "ghost";
|
|
18
42
|
target?: "_blank" | "_self";
|
|
19
43
|
}[];
|
|
44
|
+
fixed?: boolean;
|
|
45
|
+
scrollEffect?: boolean;
|
|
46
|
+
skin?: "default" | "tailwind";
|
|
47
|
+
searchPlaceholder?: string;
|
|
48
|
+
onSearch?: (query: string) => void;
|
|
49
|
+
initialSearchValue?: string;
|
|
50
|
+
languageSelector?: LanguageSelectorConfig;
|
|
51
|
+
themeSwitcher?: ThemeSwitcherConfig;
|
|
20
52
|
}> {
|
|
21
53
|
}
|
|
22
54
|
interface HeroConfig extends WithBaseConfig<{
|
|
@@ -28,7 +60,7 @@ interface HeroConfig extends WithBaseConfig<{
|
|
|
28
60
|
captionsSrc?: string;
|
|
29
61
|
buttons: ButtonConfig[];
|
|
30
62
|
alignment?: "left" | "center" | "right";
|
|
31
|
-
skin?: "default" | "skin2" | "skin3" | "skin4" | "skin5" | "skin6" | "skin7" | "skin8" | "skin9" | "skin10";
|
|
63
|
+
skin?: "default" | "skin2" | "skin3" | "skin4" | "skin5" | "skin6" | "skin7" | "skin8" | "skin9" | "skin10" | "tailwind";
|
|
32
64
|
}> {
|
|
33
65
|
}
|
|
34
66
|
interface FeatureConfig extends WithBaseConfig<{
|
|
@@ -36,6 +68,7 @@ interface FeatureConfig extends WithBaseConfig<{
|
|
|
36
68
|
description: string;
|
|
37
69
|
icon?: string;
|
|
38
70
|
image?: string;
|
|
71
|
+
skin?: "default" | "tailwind";
|
|
39
72
|
}> {
|
|
40
73
|
}
|
|
41
74
|
interface TestimonialConfig extends WithBaseConfig<{
|
|
@@ -167,11 +200,15 @@ type SectionConfig = WithBaseConfig<{
|
|
|
167
200
|
label?: string;
|
|
168
201
|
}> | WithBaseConfig<{
|
|
169
202
|
type: "features";
|
|
170
|
-
config:
|
|
203
|
+
config: {
|
|
204
|
+
features: FeatureConfig[];
|
|
205
|
+
};
|
|
171
206
|
label?: string;
|
|
172
207
|
}> | WithBaseConfig<{
|
|
173
208
|
type: "testimonials";
|
|
174
|
-
config:
|
|
209
|
+
config: {
|
|
210
|
+
testimonials: TestimonialConfig[];
|
|
211
|
+
};
|
|
175
212
|
label?: string;
|
|
176
213
|
}> | WithBaseConfig<{
|
|
177
214
|
type: "pricing";
|
|
@@ -187,7 +224,9 @@ type SectionConfig = WithBaseConfig<{
|
|
|
187
224
|
label?: string;
|
|
188
225
|
}> | WithBaseConfig<{
|
|
189
226
|
type: "stats";
|
|
190
|
-
config:
|
|
227
|
+
config: {
|
|
228
|
+
stats: StatConfig[];
|
|
229
|
+
};
|
|
191
230
|
label?: string;
|
|
192
231
|
}> | WithBaseConfig<{
|
|
193
232
|
type: "faq";
|
|
@@ -570,6 +609,10 @@ declare const landingPageSchema: {
|
|
|
570
609
|
type: string;
|
|
571
610
|
enum: string[];
|
|
572
611
|
};
|
|
612
|
+
skin: {
|
|
613
|
+
type: string;
|
|
614
|
+
enum: string[];
|
|
615
|
+
};
|
|
573
616
|
};
|
|
574
617
|
required: string[];
|
|
575
618
|
};
|
|
@@ -894,10 +937,78 @@ declare const sectionConfigSchemas: {
|
|
|
894
937
|
type: string;
|
|
895
938
|
enum: string[];
|
|
896
939
|
};
|
|
940
|
+
isActive: {
|
|
941
|
+
type: string;
|
|
942
|
+
};
|
|
943
|
+
isLoading: {
|
|
944
|
+
type: string;
|
|
945
|
+
};
|
|
946
|
+
children: {
|
|
947
|
+
type: string;
|
|
948
|
+
items: {
|
|
949
|
+
$ref: string;
|
|
950
|
+
};
|
|
951
|
+
};
|
|
897
952
|
};
|
|
898
953
|
required: string[];
|
|
899
954
|
};
|
|
900
955
|
};
|
|
956
|
+
buttons: {
|
|
957
|
+
type: string;
|
|
958
|
+
items: {
|
|
959
|
+
$ref: string;
|
|
960
|
+
};
|
|
961
|
+
};
|
|
962
|
+
fixed: {
|
|
963
|
+
type: string;
|
|
964
|
+
};
|
|
965
|
+
scrollEffect: {
|
|
966
|
+
type: string;
|
|
967
|
+
};
|
|
968
|
+
skin: {
|
|
969
|
+
type: string;
|
|
970
|
+
enum: string[];
|
|
971
|
+
};
|
|
972
|
+
searchPlaceholder: {
|
|
973
|
+
type: string;
|
|
974
|
+
};
|
|
975
|
+
initialSearchValue: {
|
|
976
|
+
type: string;
|
|
977
|
+
};
|
|
978
|
+
languageSelector: {
|
|
979
|
+
type: string;
|
|
980
|
+
properties: {
|
|
981
|
+
currentLanguage: {
|
|
982
|
+
type: string;
|
|
983
|
+
};
|
|
984
|
+
languages: {
|
|
985
|
+
type: string;
|
|
986
|
+
items: {
|
|
987
|
+
type: string;
|
|
988
|
+
properties: {
|
|
989
|
+
code: {
|
|
990
|
+
type: string;
|
|
991
|
+
};
|
|
992
|
+
name: {
|
|
993
|
+
type: string;
|
|
994
|
+
};
|
|
995
|
+
};
|
|
996
|
+
required: string[];
|
|
997
|
+
};
|
|
998
|
+
};
|
|
999
|
+
};
|
|
1000
|
+
required: string[];
|
|
1001
|
+
};
|
|
1002
|
+
themeSwitcher: {
|
|
1003
|
+
type: string;
|
|
1004
|
+
properties: {
|
|
1005
|
+
currentTheme: {
|
|
1006
|
+
type: string;
|
|
1007
|
+
enum: string[];
|
|
1008
|
+
};
|
|
1009
|
+
};
|
|
1010
|
+
required: string[];
|
|
1011
|
+
};
|
|
901
1012
|
};
|
|
902
1013
|
required: string[];
|
|
903
1014
|
};
|