@kilivi/payloadcms-theme-management 0.5.9 → 1.0.0
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 +531 -40
- package/dist/app/api/google-fonts/route.d.ts +31 -0
- package/dist/app/api/google-fonts/route.d.ts.map +1 -0
- package/dist/app/api/google-fonts/route.js +925 -0
- package/dist/app/api/google-fonts/route.js.map +1 -0
- package/dist/fields/themeConfigurationField.d.ts.map +1 -1
- package/dist/fields/themeConfigurationField.js +16 -8
- package/dist/fields/themeConfigurationField.js.map +1 -1
- package/dist/globals/ThemeSettings/FontPicker/FontPreview.d.ts +17 -0
- package/dist/globals/ThemeSettings/FontPicker/FontPreview.d.ts.map +1 -0
- package/dist/globals/ThemeSettings/FontPicker/FontPreview.js +229 -0
- package/dist/globals/ThemeSettings/FontPicker/FontPreview.js.map +1 -0
- package/dist/globals/ThemeSettings/FontPicker/PreviewContent.d.ts +20 -0
- package/dist/globals/ThemeSettings/FontPicker/PreviewContent.d.ts.map +1 -0
- package/dist/globals/ThemeSettings/FontPicker/PreviewContent.js +400 -0
- package/dist/globals/ThemeSettings/FontPicker/PreviewContent.js.map +1 -0
- package/dist/globals/ThemeSettings/FontPicker/index.d.ts +25 -0
- package/dist/globals/ThemeSettings/FontPicker/index.d.ts.map +1 -0
- package/dist/globals/ThemeSettings/FontPicker/index.js +483 -0
- package/dist/globals/ThemeSettings/FontPicker/index.js.map +1 -0
- package/dist/globals/ThemeSettings/FontPicker/styles.css +337 -0
- package/dist/globals/ThemeSettings/FontPicker/translations.d.ts +76 -0
- package/dist/globals/ThemeSettings/FontPicker/translations.d.ts.map +1 -0
- package/dist/globals/ThemeSettings/FontPicker/translations.js +147 -0
- package/dist/globals/ThemeSettings/FontPicker/translations.js.map +1 -0
- package/dist/globals/ThemeSettings/config.d.ts +10 -0
- package/dist/globals/ThemeSettings/config.d.ts.map +1 -0
- package/dist/globals/ThemeSettings/config.js +171 -0
- package/dist/globals/ThemeSettings/config.js.map +1 -0
- package/dist/globals/ThemeSettings/fields/FontLoadingGuideField.d.ts +5 -0
- package/dist/globals/ThemeSettings/fields/FontLoadingGuideField.d.ts.map +1 -0
- package/dist/globals/ThemeSettings/fields/FontLoadingGuideField.js +177 -0
- package/dist/globals/ThemeSettings/fields/FontLoadingGuideField.js.map +1 -0
- package/dist/globals/ThemeSettings/fields/TypographyInfoField.d.ts +5 -0
- package/dist/globals/ThemeSettings/fields/TypographyInfoField.d.ts.map +1 -0
- package/dist/globals/ThemeSettings/fields/TypographyInfoField.js +89 -0
- package/dist/globals/ThemeSettings/fields/TypographyInfoField.js.map +1 -0
- package/dist/globals/ThemeSettings/index.d.ts +4 -0
- package/dist/globals/ThemeSettings/index.d.ts.map +1 -0
- package/dist/globals/ThemeSettings/index.js +4 -0
- package/dist/globals/ThemeSettings/index.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +119 -20
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +9 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utilities/getThemeSettings.d.ts +34 -0
- package/dist/utilities/getThemeSettings.d.ts.map +1 -0
- package/dist/utilities/getThemeSettings.js +67 -0
- package/dist/utilities/getThemeSettings.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { FontPreview } from './FontPreview';
|
|
5
|
+
/**
|
|
6
|
+
* PreviewContent component
|
|
7
|
+
*
|
|
8
|
+
* Displays different preview modes for the selected font:
|
|
9
|
+
* - Typography: Headers and body text with different weights
|
|
10
|
+
* - Blog Post: Simulated blog post layout
|
|
11
|
+
* - Landing Page: Hero section with CTA
|
|
12
|
+
* - UI Elements: Buttons, inputs, and links
|
|
13
|
+
*/ export const PreviewContent = ({ font, activeTab, translations })=>{
|
|
14
|
+
if (!font) {
|
|
15
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
16
|
+
style: {
|
|
17
|
+
padding: '40px',
|
|
18
|
+
textAlign: 'center',
|
|
19
|
+
color: 'var(--theme-elevation-400)'
|
|
20
|
+
},
|
|
21
|
+
children: translations.selectFont
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const renderTypography = ()=>/*#__PURE__*/ _jsxs("div", {
|
|
25
|
+
style: {
|
|
26
|
+
padding: '24px'
|
|
27
|
+
},
|
|
28
|
+
children: [
|
|
29
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
30
|
+
style: {
|
|
31
|
+
marginBottom: '32px'
|
|
32
|
+
},
|
|
33
|
+
children: [
|
|
34
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
35
|
+
style: {
|
|
36
|
+
fontSize: '12px',
|
|
37
|
+
fontWeight: 600,
|
|
38
|
+
textTransform: 'uppercase',
|
|
39
|
+
letterSpacing: '0.05em',
|
|
40
|
+
color: 'var(--theme-elevation-500)',
|
|
41
|
+
marginBottom: '8px'
|
|
42
|
+
},
|
|
43
|
+
children: [
|
|
44
|
+
translations.typography.h1.split(' ')[0],
|
|
45
|
+
" (H1)"
|
|
46
|
+
]
|
|
47
|
+
}),
|
|
48
|
+
/*#__PURE__*/ _jsx(FontPreview, {
|
|
49
|
+
font: font,
|
|
50
|
+
variant: "h1",
|
|
51
|
+
text: translations.typography.h1
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
56
|
+
style: {
|
|
57
|
+
marginBottom: '32px'
|
|
58
|
+
},
|
|
59
|
+
children: [
|
|
60
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
61
|
+
style: {
|
|
62
|
+
fontSize: '12px',
|
|
63
|
+
fontWeight: 600,
|
|
64
|
+
textTransform: 'uppercase',
|
|
65
|
+
letterSpacing: '0.05em',
|
|
66
|
+
color: 'var(--theme-elevation-500)',
|
|
67
|
+
marginBottom: '8px'
|
|
68
|
+
},
|
|
69
|
+
children: [
|
|
70
|
+
translations.typography.h2.split(' ')[0],
|
|
71
|
+
" (H2)"
|
|
72
|
+
]
|
|
73
|
+
}),
|
|
74
|
+
/*#__PURE__*/ _jsx(FontPreview, {
|
|
75
|
+
font: font,
|
|
76
|
+
variant: "h2",
|
|
77
|
+
text: translations.typography.h2
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
}),
|
|
81
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
82
|
+
style: {
|
|
83
|
+
marginBottom: '32px'
|
|
84
|
+
},
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
87
|
+
style: {
|
|
88
|
+
fontSize: '12px',
|
|
89
|
+
fontWeight: 600,
|
|
90
|
+
textTransform: 'uppercase',
|
|
91
|
+
letterSpacing: '0.05em',
|
|
92
|
+
color: 'var(--theme-elevation-500)',
|
|
93
|
+
marginBottom: '8px'
|
|
94
|
+
},
|
|
95
|
+
children: [
|
|
96
|
+
translations.typography.h3.split(' ')[0],
|
|
97
|
+
" (H3)"
|
|
98
|
+
]
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ _jsx(FontPreview, {
|
|
101
|
+
font: font,
|
|
102
|
+
variant: "h3",
|
|
103
|
+
text: translations.typography.h3
|
|
104
|
+
})
|
|
105
|
+
]
|
|
106
|
+
}),
|
|
107
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
108
|
+
style: {
|
|
109
|
+
marginBottom: '32px'
|
|
110
|
+
},
|
|
111
|
+
children: [
|
|
112
|
+
/*#__PURE__*/ _jsx("div", {
|
|
113
|
+
style: {
|
|
114
|
+
fontSize: '12px',
|
|
115
|
+
fontWeight: 600,
|
|
116
|
+
textTransform: 'uppercase',
|
|
117
|
+
letterSpacing: '0.05em',
|
|
118
|
+
color: 'var(--theme-elevation-500)',
|
|
119
|
+
marginBottom: '8px'
|
|
120
|
+
},
|
|
121
|
+
children: "Body"
|
|
122
|
+
}),
|
|
123
|
+
/*#__PURE__*/ _jsx(FontPreview, {
|
|
124
|
+
font: font,
|
|
125
|
+
variant: "body",
|
|
126
|
+
text: translations.typography.body
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
}),
|
|
130
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
131
|
+
style: {
|
|
132
|
+
marginBottom: '32px'
|
|
133
|
+
},
|
|
134
|
+
children: [
|
|
135
|
+
/*#__PURE__*/ _jsx("div", {
|
|
136
|
+
style: {
|
|
137
|
+
fontSize: '12px',
|
|
138
|
+
fontWeight: 600,
|
|
139
|
+
textTransform: 'uppercase',
|
|
140
|
+
letterSpacing: '0.05em',
|
|
141
|
+
color: 'var(--theme-elevation-500)',
|
|
142
|
+
marginBottom: '8px'
|
|
143
|
+
},
|
|
144
|
+
children: "Small"
|
|
145
|
+
}),
|
|
146
|
+
/*#__PURE__*/ _jsx(FontPreview, {
|
|
147
|
+
font: font,
|
|
148
|
+
variant: "small",
|
|
149
|
+
text: translations.typography.small
|
|
150
|
+
})
|
|
151
|
+
]
|
|
152
|
+
}),
|
|
153
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
154
|
+
children: [
|
|
155
|
+
/*#__PURE__*/ _jsx("div", {
|
|
156
|
+
style: {
|
|
157
|
+
fontSize: '12px',
|
|
158
|
+
fontWeight: 600,
|
|
159
|
+
textTransform: 'uppercase',
|
|
160
|
+
letterSpacing: '0.05em',
|
|
161
|
+
color: 'var(--theme-elevation-500)',
|
|
162
|
+
marginBottom: '8px'
|
|
163
|
+
},
|
|
164
|
+
children: "Characters"
|
|
165
|
+
}),
|
|
166
|
+
/*#__PURE__*/ _jsx(FontPreview, {
|
|
167
|
+
font: font,
|
|
168
|
+
variant: "chars"
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
});
|
|
174
|
+
const renderBlog = ()=>/*#__PURE__*/ _jsxs("div", {
|
|
175
|
+
style: {
|
|
176
|
+
padding: '24px',
|
|
177
|
+
maxWidth: '700px',
|
|
178
|
+
margin: '0 auto'
|
|
179
|
+
},
|
|
180
|
+
children: [
|
|
181
|
+
/*#__PURE__*/ _jsx("div", {
|
|
182
|
+
style: {
|
|
183
|
+
marginBottom: '24px'
|
|
184
|
+
},
|
|
185
|
+
children: /*#__PURE__*/ _jsx(FontPreview, {
|
|
186
|
+
font: font,
|
|
187
|
+
variant: "h1",
|
|
188
|
+
text: translations.blog.title
|
|
189
|
+
})
|
|
190
|
+
}),
|
|
191
|
+
/*#__PURE__*/ _jsx("div", {
|
|
192
|
+
style: {
|
|
193
|
+
marginBottom: '24px',
|
|
194
|
+
opacity: 0.7
|
|
195
|
+
},
|
|
196
|
+
children: /*#__PURE__*/ _jsx(FontPreview, {
|
|
197
|
+
font: font,
|
|
198
|
+
variant: "h3",
|
|
199
|
+
text: translations.blog.subtitle
|
|
200
|
+
})
|
|
201
|
+
}),
|
|
202
|
+
/*#__PURE__*/ _jsx("div", {
|
|
203
|
+
style: {
|
|
204
|
+
marginBottom: '16px'
|
|
205
|
+
},
|
|
206
|
+
children: /*#__PURE__*/ _jsx(FontPreview, {
|
|
207
|
+
font: font,
|
|
208
|
+
variant: "body",
|
|
209
|
+
text: translations.blog.body
|
|
210
|
+
})
|
|
211
|
+
}),
|
|
212
|
+
/*#__PURE__*/ _jsx("div", {
|
|
213
|
+
style: {
|
|
214
|
+
marginBottom: '16px'
|
|
215
|
+
},
|
|
216
|
+
children: /*#__PURE__*/ _jsx(FontPreview, {
|
|
217
|
+
font: font,
|
|
218
|
+
variant: "body",
|
|
219
|
+
text: translations.blog.body.split('.')[1] + '.'
|
|
220
|
+
})
|
|
221
|
+
})
|
|
222
|
+
]
|
|
223
|
+
});
|
|
224
|
+
const renderLanding = ()=>/*#__PURE__*/ _jsxs("div", {
|
|
225
|
+
style: {
|
|
226
|
+
padding: '48px 24px',
|
|
227
|
+
textAlign: 'center',
|
|
228
|
+
background: 'linear-gradient(135deg, var(--theme-elevation-50) 0%, var(--theme-elevation-100) 100%)',
|
|
229
|
+
minHeight: '400px',
|
|
230
|
+
display: 'flex',
|
|
231
|
+
flexDirection: 'column',
|
|
232
|
+
justifyContent: 'center',
|
|
233
|
+
alignItems: 'center',
|
|
234
|
+
gap: '24px'
|
|
235
|
+
},
|
|
236
|
+
children: [
|
|
237
|
+
/*#__PURE__*/ _jsx("div", {
|
|
238
|
+
style: {
|
|
239
|
+
maxWidth: '800px'
|
|
240
|
+
},
|
|
241
|
+
children: /*#__PURE__*/ _jsx(FontPreview, {
|
|
242
|
+
font: font,
|
|
243
|
+
variant: "h1",
|
|
244
|
+
text: translations.landing.hero
|
|
245
|
+
})
|
|
246
|
+
}),
|
|
247
|
+
/*#__PURE__*/ _jsx("div", {
|
|
248
|
+
style: {
|
|
249
|
+
maxWidth: '600px',
|
|
250
|
+
opacity: 0.8
|
|
251
|
+
},
|
|
252
|
+
children: /*#__PURE__*/ _jsx(FontPreview, {
|
|
253
|
+
font: font,
|
|
254
|
+
variant: "h3",
|
|
255
|
+
text: translations.landing.subheading
|
|
256
|
+
})
|
|
257
|
+
}),
|
|
258
|
+
/*#__PURE__*/ _jsx("div", {
|
|
259
|
+
style: {
|
|
260
|
+
marginTop: '16px'
|
|
261
|
+
},
|
|
262
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
263
|
+
style: {
|
|
264
|
+
display: 'inline-block',
|
|
265
|
+
padding: '12px 32px',
|
|
266
|
+
background: 'var(--theme-elevation-900)',
|
|
267
|
+
color: 'var(--theme-elevation-0)',
|
|
268
|
+
borderRadius: '8px',
|
|
269
|
+
fontSize: '18px',
|
|
270
|
+
fontWeight: 600,
|
|
271
|
+
cursor: 'pointer'
|
|
272
|
+
},
|
|
273
|
+
children: /*#__PURE__*/ _jsx(FontPreview, {
|
|
274
|
+
font: font,
|
|
275
|
+
variant: "body",
|
|
276
|
+
text: translations.landing.cta
|
|
277
|
+
})
|
|
278
|
+
})
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
});
|
|
282
|
+
const renderUI = ()=>/*#__PURE__*/ _jsxs("div", {
|
|
283
|
+
style: {
|
|
284
|
+
padding: '24px'
|
|
285
|
+
},
|
|
286
|
+
children: [
|
|
287
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
288
|
+
style: {
|
|
289
|
+
marginBottom: '32px'
|
|
290
|
+
},
|
|
291
|
+
children: [
|
|
292
|
+
/*#__PURE__*/ _jsx("div", {
|
|
293
|
+
style: {
|
|
294
|
+
fontSize: '12px',
|
|
295
|
+
fontWeight: 600,
|
|
296
|
+
textTransform: 'uppercase',
|
|
297
|
+
letterSpacing: '0.05em',
|
|
298
|
+
color: 'var(--theme-elevation-500)',
|
|
299
|
+
marginBottom: '12px'
|
|
300
|
+
},
|
|
301
|
+
children: "Button"
|
|
302
|
+
}),
|
|
303
|
+
/*#__PURE__*/ _jsx("div", {
|
|
304
|
+
style: {
|
|
305
|
+
display: 'inline-block',
|
|
306
|
+
padding: '10px 24px',
|
|
307
|
+
background: 'var(--theme-elevation-900)',
|
|
308
|
+
color: 'var(--theme-elevation-0)',
|
|
309
|
+
borderRadius: '6px',
|
|
310
|
+
fontSize: '16px',
|
|
311
|
+
fontWeight: 500,
|
|
312
|
+
cursor: 'pointer'
|
|
313
|
+
},
|
|
314
|
+
children: /*#__PURE__*/ _jsx(FontPreview, {
|
|
315
|
+
font: font,
|
|
316
|
+
variant: "body",
|
|
317
|
+
text: translations.ui.button
|
|
318
|
+
})
|
|
319
|
+
})
|
|
320
|
+
]
|
|
321
|
+
}),
|
|
322
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
323
|
+
style: {
|
|
324
|
+
marginBottom: '32px'
|
|
325
|
+
},
|
|
326
|
+
children: [
|
|
327
|
+
/*#__PURE__*/ _jsx("div", {
|
|
328
|
+
style: {
|
|
329
|
+
fontSize: '12px',
|
|
330
|
+
fontWeight: 600,
|
|
331
|
+
textTransform: 'uppercase',
|
|
332
|
+
letterSpacing: '0.05em',
|
|
333
|
+
color: 'var(--theme-elevation-500)',
|
|
334
|
+
marginBottom: '12px'
|
|
335
|
+
},
|
|
336
|
+
children: "Input"
|
|
337
|
+
}),
|
|
338
|
+
/*#__PURE__*/ _jsx("div", {
|
|
339
|
+
style: {
|
|
340
|
+
width: '100%',
|
|
341
|
+
maxWidth: '400px',
|
|
342
|
+
padding: '10px 16px',
|
|
343
|
+
background: 'var(--theme-elevation-0)',
|
|
344
|
+
border: '1px solid var(--theme-elevation-300)',
|
|
345
|
+
borderRadius: '6px',
|
|
346
|
+
fontSize: '16px'
|
|
347
|
+
},
|
|
348
|
+
children: /*#__PURE__*/ _jsx(FontPreview, {
|
|
349
|
+
font: font,
|
|
350
|
+
variant: "body",
|
|
351
|
+
text: translations.ui.input
|
|
352
|
+
})
|
|
353
|
+
})
|
|
354
|
+
]
|
|
355
|
+
}),
|
|
356
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
357
|
+
children: [
|
|
358
|
+
/*#__PURE__*/ _jsx("div", {
|
|
359
|
+
style: {
|
|
360
|
+
fontSize: '12px',
|
|
361
|
+
fontWeight: 600,
|
|
362
|
+
textTransform: 'uppercase',
|
|
363
|
+
letterSpacing: '0.05em',
|
|
364
|
+
color: 'var(--theme-elevation-500)',
|
|
365
|
+
marginBottom: '12px'
|
|
366
|
+
},
|
|
367
|
+
children: "Link"
|
|
368
|
+
}),
|
|
369
|
+
/*#__PURE__*/ _jsx("div", {
|
|
370
|
+
style: {
|
|
371
|
+
color: 'var(--theme-elevation-700)',
|
|
372
|
+
fontSize: '16px',
|
|
373
|
+
textDecoration: 'underline',
|
|
374
|
+
cursor: 'pointer'
|
|
375
|
+
},
|
|
376
|
+
children: /*#__PURE__*/ _jsx(FontPreview, {
|
|
377
|
+
font: font,
|
|
378
|
+
variant: "body",
|
|
379
|
+
text: translations.ui.link
|
|
380
|
+
})
|
|
381
|
+
})
|
|
382
|
+
]
|
|
383
|
+
})
|
|
384
|
+
]
|
|
385
|
+
});
|
|
386
|
+
switch(activeTab){
|
|
387
|
+
case 'typography':
|
|
388
|
+
return renderTypography();
|
|
389
|
+
case 'blog':
|
|
390
|
+
return renderBlog();
|
|
391
|
+
case 'landing':
|
|
392
|
+
return renderLanding();
|
|
393
|
+
case 'ui':
|
|
394
|
+
return renderUI();
|
|
395
|
+
default:
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
//# sourceMappingURL=PreviewContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/globals/ThemeSettings/FontPicker/PreviewContent.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\nimport type { GoogleFont } from '../../../app/api/google-fonts/route'\nimport { FontPreview } from './FontPreview'\nimport type { Translations } from './translations'\n\nexport type PreviewTab = 'typography' | 'blog' | 'landing' | 'ui'\n\nexport interface PreviewContentProps {\n font: GoogleFont | null\n activeTab: PreviewTab\n translations: Translations\n}\n\n/**\n * PreviewContent component\n *\n * Displays different preview modes for the selected font:\n * - Typography: Headers and body text with different weights\n * - Blog Post: Simulated blog post layout\n * - Landing Page: Hero section with CTA\n * - UI Elements: Buttons, inputs, and links\n */\nexport const PreviewContent: React.FC<PreviewContentProps> = ({\n font,\n activeTab,\n translations,\n}) => {\n if (!font) {\n return (\n <div\n style={{\n padding: '40px',\n textAlign: 'center',\n color: 'var(--theme-elevation-400)',\n }}\n >\n {translations.selectFont}\n </div>\n )\n }\n\n const renderTypography = () => (\n <div style={{ padding: '24px' }}>\n <div style={{ marginBottom: '32px' }}>\n <div\n style={{\n fontSize: '12px',\n fontWeight: 600,\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n color: 'var(--theme-elevation-500)',\n marginBottom: '8px',\n }}\n >\n {translations.typography.h1.split(' ')[0]} (H1)\n </div>\n <FontPreview font={font} variant=\"h1\" text={translations.typography.h1} />\n </div>\n\n <div style={{ marginBottom: '32px' }}>\n <div\n style={{\n fontSize: '12px',\n fontWeight: 600,\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n color: 'var(--theme-elevation-500)',\n marginBottom: '8px',\n }}\n >\n {translations.typography.h2.split(' ')[0]} (H2)\n </div>\n <FontPreview font={font} variant=\"h2\" text={translations.typography.h2} />\n </div>\n\n <div style={{ marginBottom: '32px' }}>\n <div\n style={{\n fontSize: '12px',\n fontWeight: 600,\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n color: 'var(--theme-elevation-500)',\n marginBottom: '8px',\n }}\n >\n {translations.typography.h3.split(' ')[0]} (H3)\n </div>\n <FontPreview font={font} variant=\"h3\" text={translations.typography.h3} />\n </div>\n\n <div style={{ marginBottom: '32px' }}>\n <div\n style={{\n fontSize: '12px',\n fontWeight: 600,\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n color: 'var(--theme-elevation-500)',\n marginBottom: '8px',\n }}\n >\n Body\n </div>\n <FontPreview font={font} variant=\"body\" text={translations.typography.body} />\n </div>\n\n <div style={{ marginBottom: '32px' }}>\n <div\n style={{\n fontSize: '12px',\n fontWeight: 600,\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n color: 'var(--theme-elevation-500)',\n marginBottom: '8px',\n }}\n >\n Small\n </div>\n <FontPreview font={font} variant=\"small\" text={translations.typography.small} />\n </div>\n\n <div>\n <div\n style={{\n fontSize: '12px',\n fontWeight: 600,\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n color: 'var(--theme-elevation-500)',\n marginBottom: '8px',\n }}\n >\n Characters\n </div>\n <FontPreview font={font} variant=\"chars\" />\n </div>\n </div>\n )\n\n const renderBlog = () => (\n <div style={{ padding: '24px', maxWidth: '700px', margin: '0 auto' }}>\n <div style={{ marginBottom: '24px' }}>\n <FontPreview font={font} variant=\"h1\" text={translations.blog.title} />\n </div>\n\n <div style={{ marginBottom: '24px', opacity: 0.7 }}>\n <FontPreview font={font} variant=\"h3\" text={translations.blog.subtitle} />\n </div>\n\n <div style={{ marginBottom: '16px' }}>\n <FontPreview font={font} variant=\"body\" text={translations.blog.body} />\n </div>\n\n <div style={{ marginBottom: '16px' }}>\n <FontPreview font={font} variant=\"body\" text={translations.blog.body.split('.')[1] + '.'} />\n </div>\n </div>\n )\n\n const renderLanding = () => (\n <div\n style={{\n padding: '48px 24px',\n textAlign: 'center',\n background:\n 'linear-gradient(135deg, var(--theme-elevation-50) 0%, var(--theme-elevation-100) 100%)',\n minHeight: '400px',\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n gap: '24px',\n }}\n >\n <div style={{ maxWidth: '800px' }}>\n <FontPreview font={font} variant=\"h1\" text={translations.landing.hero} />\n </div>\n\n <div style={{ maxWidth: '600px', opacity: 0.8 }}>\n <FontPreview font={font} variant=\"h3\" text={translations.landing.subheading} />\n </div>\n\n <div style={{ marginTop: '16px' }}>\n <div\n style={{\n display: 'inline-block',\n padding: '12px 32px',\n background: 'var(--theme-elevation-900)',\n color: 'var(--theme-elevation-0)',\n borderRadius: '8px',\n fontSize: '18px',\n fontWeight: 600,\n cursor: 'pointer',\n }}\n >\n <FontPreview font={font} variant=\"body\" text={translations.landing.cta} />\n </div>\n </div>\n </div>\n )\n\n const renderUI = () => (\n <div style={{ padding: '24px' }}>\n <div style={{ marginBottom: '32px' }}>\n <div\n style={{\n fontSize: '12px',\n fontWeight: 600,\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n color: 'var(--theme-elevation-500)',\n marginBottom: '12px',\n }}\n >\n Button\n </div>\n <div\n style={{\n display: 'inline-block',\n padding: '10px 24px',\n background: 'var(--theme-elevation-900)',\n color: 'var(--theme-elevation-0)',\n borderRadius: '6px',\n fontSize: '16px',\n fontWeight: 500,\n cursor: 'pointer',\n }}\n >\n <FontPreview font={font} variant=\"body\" text={translations.ui.button} />\n </div>\n </div>\n\n <div style={{ marginBottom: '32px' }}>\n <div\n style={{\n fontSize: '12px',\n fontWeight: 600,\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n color: 'var(--theme-elevation-500)',\n marginBottom: '12px',\n }}\n >\n Input\n </div>\n <div\n style={{\n width: '100%',\n maxWidth: '400px',\n padding: '10px 16px',\n background: 'var(--theme-elevation-0)',\n border: '1px solid var(--theme-elevation-300)',\n borderRadius: '6px',\n fontSize: '16px',\n }}\n >\n <FontPreview font={font} variant=\"body\" text={translations.ui.input} />\n </div>\n </div>\n\n <div>\n <div\n style={{\n fontSize: '12px',\n fontWeight: 600,\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n color: 'var(--theme-elevation-500)',\n marginBottom: '12px',\n }}\n >\n Link\n </div>\n <div\n style={{\n color: 'var(--theme-elevation-700)',\n fontSize: '16px',\n textDecoration: 'underline',\n cursor: 'pointer',\n }}\n >\n <FontPreview font={font} variant=\"body\" text={translations.ui.link} />\n </div>\n </div>\n </div>\n )\n\n switch (activeTab) {\n case 'typography':\n return renderTypography()\n case 'blog':\n return renderBlog()\n case 'landing':\n return renderLanding()\n case 'ui':\n return renderUI()\n default:\n return null\n }\n}\n"],"names":["React","FontPreview","PreviewContent","font","activeTab","translations","div","style","padding","textAlign","color","selectFont","renderTypography","marginBottom","fontSize","fontWeight","textTransform","letterSpacing","typography","h1","split","variant","text","h2","h3","body","small","renderBlog","maxWidth","margin","blog","title","opacity","subtitle","renderLanding","background","minHeight","display","flexDirection","justifyContent","alignItems","gap","landing","hero","subheading","marginTop","borderRadius","cursor","cta","renderUI","ui","button","width","border","input","textDecoration","link"],"mappings":"AAAA;;AAEA,OAAOA,WAAW,QAAO;AAEzB,SAASC,WAAW,QAAQ,gBAAe;AAW3C;;;;;;;;CAQC,GACD,OAAO,MAAMC,iBAAgD,CAAC,EAC5DC,IAAI,EACJC,SAAS,EACTC,YAAY,EACb;IACC,IAAI,CAACF,MAAM;QACT,qBACE,KAACG;YACCC,OAAO;gBACLC,SAAS;gBACTC,WAAW;gBACXC,OAAO;YACT;sBAECL,aAAaM,UAAU;;IAG9B;IAEA,MAAMC,mBAAmB,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AAc;gCACdhC,UAAU;gCACVC,YAAY;gCACZgC,QAAQ;4BACV;sCAEA,cAAA,KAAC9C;gCAAYE,MAAMA;gCAAMkB,SAAQ;gCAAOC,MAAMjB,aAAa6C,EAAE,CAACC,MAAM;;;;;8BAIxE,MAAC7C;oBAAIC,OAAO;wBAAEM,cAAc;oBAAO;;sCACjC,KAACP;4BACCC,OAAO;gCACLO,UAAU;gCACVC,YAAY;gCACZC,eAAe;gCACfC,eAAe;gCACfP,OAAO;gCACPG,cAAc;4BAChB;sCACD;;sCAGD,KAACP;4BACCC,OAAO;gCACL6C,OAAO;gCACPxB,UAAU;gCACVpB,SAAS;gCACT2B,YAAY;gCACZkB,QAAQ;gCACRP,cAAc;gCACdhC,UAAU;4BACZ;sCAEA,cAAA,KAACb;gCAAYE,MAAMA;gCAAMkB,SAAQ;gCAAOC,MAAMjB,aAAa6C,EAAE,CAACI,KAAK;;;;;8BAIvE,MAAChD;;sCACC,KAACA;4BACCC,OAAO;gCACLO,UAAU;gCACVC,YAAY;gCACZC,eAAe;gCACfC,eAAe;gCACfP,OAAO;gCACPG,cAAc;4BAChB;sCACD;;sCAGD,KAACP;4BACCC,OAAO;gCACLG,OAAO;gCACPI,UAAU;gCACVyC,gBAAgB;gCAChBR,QAAQ;4BACV;sCAEA,cAAA,KAAC9C;gCAAYE,MAAMA;gCAAMkB,SAAQ;gCAAOC,MAAMjB,aAAa6C,EAAE,CAACM,IAAI;;;;;;;IAM1E,OAAQpD;QACN,KAAK;YACH,OAAOQ;QACT,KAAK;YACH,OAAOe;QACT,KAAK;YACH,OAAOO;QACT,KAAK;YACH,OAAOe;QACT;YACE,OAAO;IACX;AACF,EAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TextFieldClientProps } from 'payload';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type Language } from './translations.js';
|
|
4
|
+
export interface FontPickerProps {
|
|
5
|
+
value?: string;
|
|
6
|
+
onChange: (fontFamily: string) => void;
|
|
7
|
+
language?: Language;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* FontPicker component
|
|
11
|
+
*
|
|
12
|
+
* A comprehensive Google Fonts picker with:
|
|
13
|
+
* - Two-column layout (preview panel + selection panel)
|
|
14
|
+
* - Search and filters (category, language subset)
|
|
15
|
+
* - Multiple preview modes (typography, blog, landing, ui)
|
|
16
|
+
* - Lazy font loading (only on hover/scroll)
|
|
17
|
+
* - Infinite scroll with pagination
|
|
18
|
+
* - Favorites system with localStorage
|
|
19
|
+
* - View mode toggle (row/grid)
|
|
20
|
+
*/
|
|
21
|
+
declare const FontPickerField: React.FC<TextFieldClientProps>;
|
|
22
|
+
declare const FontPickerComponent: React.FC<FontPickerProps>;
|
|
23
|
+
export { FontPickerComponent };
|
|
24
|
+
export default FontPickerField;
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/globals/ThemeSettings/FontPicker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,KAAmD,MAAM,OAAO,CAAA;AAQvE,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAQlE,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB;AAED;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAanD,CAAA;AAED,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2TlD,CAAA;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA;AAC9B,eAAe,eAAe,CAAA"}
|