@damarkuncoro/landing-page 0.1.3 → 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 +125 -0
- package/{dist → lib/cjs}/index.d.ts +349 -106
- package/{dist → lib/cjs}/index.js +1430 -479
- package/lib/cjs/index.js.map +1 -0
- package/{dist → lib/esm}/index.d.mts +349 -106
- package/{dist → lib/esm}/index.mjs +1432 -481
- package/lib/esm/index.mjs.map +1 -0
- package/package.json +18 -22
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
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
|
|
@@ -323,12 +432,28 @@ interface ThemeConfig {
|
|
|
323
432
|
body: string
|
|
324
433
|
mono: string
|
|
325
434
|
}
|
|
435
|
+
typography: {
|
|
436
|
+
h1: string
|
|
437
|
+
h2: string
|
|
438
|
+
h3: string
|
|
439
|
+
body: string
|
|
440
|
+
small: string
|
|
441
|
+
}
|
|
442
|
+
fontWeights: {
|
|
443
|
+
normal: string | number
|
|
444
|
+
medium: string | number
|
|
445
|
+
bold: string | number
|
|
446
|
+
}
|
|
326
447
|
breakpoints: {
|
|
327
448
|
sm: string
|
|
328
449
|
md: string
|
|
329
450
|
lg: string
|
|
330
451
|
xl: string
|
|
331
452
|
}
|
|
453
|
+
sizes?: {
|
|
454
|
+
subtitleMaxWidth?: string
|
|
455
|
+
containerMaxWidth?: string
|
|
456
|
+
}
|
|
332
457
|
}
|
|
333
458
|
```
|
|
334
459
|
|