ghostcn 1.4.1 → 1.6.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/dist/commands/create.js +16 -9
- package/dist/commands/diff.js +47 -5
- package/dist/commands/init.js +22 -10
- package/dist/commands/list.js +22 -4
- package/dist/registry/components/accordion.json +66 -0
- package/dist/registry/components/alert.json +1 -1
- package/dist/registry/components/announcement-bar.json +79 -0
- package/dist/registry/components/archive-header.json +2 -2
- package/dist/registry/components/author-card.json +2 -2
- package/dist/registry/components/author-list.json +2 -2
- package/dist/registry/components/avatar.json +62 -0
- package/dist/registry/components/badge.json +1 -1
- package/dist/registry/components/breadcrumbs.json +59 -0
- package/dist/registry/components/button.json +1 -1
- package/dist/registry/components/card.json +1 -1
- package/dist/registry/components/featured-posts.json +2 -2
- package/dist/registry/components/input.json +8 -2
- package/dist/registry/components/member-cta.json +1 -1
- package/dist/registry/components/newsletter-form.json +12 -3
- package/dist/registry/components/pagination.json +2 -2
- package/dist/registry/components/post-card.json +2 -2
- package/dist/registry/components/post-grid.json +2 -2
- package/dist/registry/components/post-header.json +2 -2
- package/dist/registry/components/post-navigation.json +1 -1
- package/dist/registry/components/pricing-table.json +24 -4
- package/dist/registry/components/reading-progress.json +73 -0
- package/dist/registry/components/related-posts.json +7 -1
- package/dist/registry/components/share-buttons.json +76 -0
- package/dist/registry/components/site-footer.json +2 -2
- package/dist/registry/components/site-header.json +1 -1
- package/dist/registry/components/table-of-contents.json +13 -3
- package/dist/registry/components/tag-grid.json +2 -2
- package/dist/registry/components/tag-list.json +1 -1
- package/dist/registry/components/theme-toggle.json +65 -0
- package/dist/registry/components/visibility-badge.json +71 -0
- package/dist/registry/index.json +89 -4
- package/dist/templates/playground/index.html +2 -2
- package/dist/templates/playground/playground.css +8 -1
- package/dist/templates/playground/playground.js +39 -5
- package/dist/templates/playground/preview.css +1 -0
- package/dist/templates/theme-tools.mjs +62 -24
- package/dist/utils/component-diff.d.ts +1 -1
- package/dist/utils/component-diff.js +46 -17
- package/dist/utils/component-files.js +3 -2
- package/dist/utils/component-history.js +1 -1
- package/dist/utils/design-defaults.json +17 -0
- package/dist/utils/playground-server.js +34 -12
- package/dist/utils/preview-renderer.d.ts +5 -0
- package/dist/utils/preview-renderer.js +30 -8
- package/dist/utils/registry.js +15 -5
- package/dist/utils/theme-files.js +14 -7
- package/dist/utils/theme-project.js +6 -4
- package/dist/utils/theme-scaffold.js +27 -14
- package/dist/utils/theme.d.ts +3 -3
- package/dist/utils/theme.js +108 -49
- package/package.json +1 -1
package/dist/utils/theme.js
CHANGED
|
@@ -1,9 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.ACCENT_COLORS = exports.BASE_PALETTES = void 0;
|
|
4
7
|
exports.generateThemeCss = generateThemeCss;
|
|
5
8
|
const styles_1 = require("./styles");
|
|
9
|
+
const design_defaults_json_1 = __importDefault(require("./design-defaults.json"));
|
|
6
10
|
exports.BASE_PALETTES = {
|
|
11
|
+
doks: {
|
|
12
|
+
light: {
|
|
13
|
+
background: '#f6f4f0',
|
|
14
|
+
foreground: '#0a0a0a',
|
|
15
|
+
card: '#ffffff',
|
|
16
|
+
cardForeground: '#0a0a0a',
|
|
17
|
+
popover: '#ffffff',
|
|
18
|
+
popoverForeground: '#0a0a0a',
|
|
19
|
+
secondary: '#f5f5f5',
|
|
20
|
+
secondaryForeground: '#171717',
|
|
21
|
+
muted: '#f5f5f5',
|
|
22
|
+
mutedForeground: '#68645f',
|
|
23
|
+
accent: '#f5f5f5',
|
|
24
|
+
accentForeground: '#171717',
|
|
25
|
+
destructive: '#b91c1c',
|
|
26
|
+
destructiveForeground: '#ffffff',
|
|
27
|
+
border: '#e5e5e5',
|
|
28
|
+
input: '#aaa6a0',
|
|
29
|
+
ring: '#68645f'
|
|
30
|
+
},
|
|
31
|
+
dark: {
|
|
32
|
+
background: '#171614',
|
|
33
|
+
foreground: '#fafafa',
|
|
34
|
+
card: '#22211e',
|
|
35
|
+
cardForeground: '#fafafa',
|
|
36
|
+
popover: '#22211e',
|
|
37
|
+
popoverForeground: '#fafafa',
|
|
38
|
+
secondary: '#333333',
|
|
39
|
+
secondaryForeground: '#fafafa',
|
|
40
|
+
muted: '#333333',
|
|
41
|
+
mutedForeground: '#b4afa8',
|
|
42
|
+
accent: '#333333',
|
|
43
|
+
accentForeground: '#fafafa',
|
|
44
|
+
destructive: '#fca5a5',
|
|
45
|
+
destructiveForeground: '#450a0a',
|
|
46
|
+
border: '#393835',
|
|
47
|
+
input: '#77736d',
|
|
48
|
+
ring: '#b4afa8'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
7
51
|
zinc: {
|
|
8
52
|
light: {
|
|
9
53
|
background: '#ffffff',
|
|
@@ -18,8 +62,8 @@ exports.BASE_PALETTES = {
|
|
|
18
62
|
mutedForeground: '#71717a',
|
|
19
63
|
accent: '#f4f4f5',
|
|
20
64
|
accentForeground: '#18181b',
|
|
21
|
-
destructive: '#
|
|
22
|
-
destructiveForeground: '#
|
|
65
|
+
destructive: '#dc2626',
|
|
66
|
+
destructiveForeground: '#ffffff',
|
|
23
67
|
border: '#e4e4e7',
|
|
24
68
|
input: '#e4e4e7',
|
|
25
69
|
ring: '#18181b'
|
|
@@ -37,8 +81,8 @@ exports.BASE_PALETTES = {
|
|
|
37
81
|
mutedForeground: '#a1a1aa',
|
|
38
82
|
accent: '#27272a',
|
|
39
83
|
accentForeground: '#fafafa',
|
|
40
|
-
destructive: '#
|
|
41
|
-
destructiveForeground: '#
|
|
84
|
+
destructive: '#f87171',
|
|
85
|
+
destructiveForeground: '#450a0a',
|
|
42
86
|
border: '#27272a',
|
|
43
87
|
input: '#27272a',
|
|
44
88
|
ring: '#d4d4d8'
|
|
@@ -58,8 +102,8 @@ exports.BASE_PALETTES = {
|
|
|
58
102
|
mutedForeground: '#64748b',
|
|
59
103
|
accent: '#f1f5f9',
|
|
60
104
|
accentForeground: '#0f172a',
|
|
61
|
-
destructive: '#
|
|
62
|
-
destructiveForeground: '#
|
|
105
|
+
destructive: '#dc2626',
|
|
106
|
+
destructiveForeground: '#ffffff',
|
|
63
107
|
border: '#e2e8f0',
|
|
64
108
|
input: '#e2e8f0',
|
|
65
109
|
ring: '#0f172a'
|
|
@@ -77,8 +121,8 @@ exports.BASE_PALETTES = {
|
|
|
77
121
|
mutedForeground: '#94a3b8',
|
|
78
122
|
accent: '#1e293b',
|
|
79
123
|
accentForeground: '#f8fafc',
|
|
80
|
-
destructive: '#
|
|
81
|
-
destructiveForeground: '#
|
|
124
|
+
destructive: '#f87171',
|
|
125
|
+
destructiveForeground: '#450a0a',
|
|
82
126
|
border: '#1e293b',
|
|
83
127
|
input: '#1e293b',
|
|
84
128
|
ring: '#cbd5e1'
|
|
@@ -98,8 +142,8 @@ exports.BASE_PALETTES = {
|
|
|
98
142
|
mutedForeground: '#78716c',
|
|
99
143
|
accent: '#f5f5f4',
|
|
100
144
|
accentForeground: '#1c1917',
|
|
101
|
-
destructive: '#
|
|
102
|
-
destructiveForeground: '#
|
|
145
|
+
destructive: '#dc2626',
|
|
146
|
+
destructiveForeground: '#ffffff',
|
|
103
147
|
border: '#e7e5e4',
|
|
104
148
|
input: '#e7e5e4',
|
|
105
149
|
ring: '#1c1917'
|
|
@@ -117,8 +161,8 @@ exports.BASE_PALETTES = {
|
|
|
117
161
|
mutedForeground: '#a8a29e',
|
|
118
162
|
accent: '#292524',
|
|
119
163
|
accentForeground: '#fafaf9',
|
|
120
|
-
destructive: '#
|
|
121
|
-
destructiveForeground: '#
|
|
164
|
+
destructive: '#f87171',
|
|
165
|
+
destructiveForeground: '#450a0a',
|
|
122
166
|
border: '#292524',
|
|
123
167
|
input: '#292524',
|
|
124
168
|
ring: '#d6d3d1'
|
|
@@ -138,8 +182,8 @@ exports.BASE_PALETTES = {
|
|
|
138
182
|
mutedForeground: '#6b7280',
|
|
139
183
|
accent: '#f3f4f6',
|
|
140
184
|
accentForeground: '#1f2937',
|
|
141
|
-
destructive: '#
|
|
142
|
-
destructiveForeground: '#
|
|
185
|
+
destructive: '#dc2626',
|
|
186
|
+
destructiveForeground: '#ffffff',
|
|
143
187
|
border: '#e5e7eb',
|
|
144
188
|
input: '#e5e7eb',
|
|
145
189
|
ring: '#1f2937'
|
|
@@ -157,8 +201,8 @@ exports.BASE_PALETTES = {
|
|
|
157
201
|
mutedForeground: '#9ca3af',
|
|
158
202
|
accent: '#1f2937',
|
|
159
203
|
accentForeground: '#f9fafb',
|
|
160
|
-
destructive: '#
|
|
161
|
-
destructiveForeground: '#
|
|
204
|
+
destructive: '#f87171',
|
|
205
|
+
destructiveForeground: '#450a0a',
|
|
162
206
|
border: '#1f2937',
|
|
163
207
|
input: '#1f2937',
|
|
164
208
|
ring: '#d1d5db'
|
|
@@ -178,8 +222,8 @@ exports.BASE_PALETTES = {
|
|
|
178
222
|
mutedForeground: '#737373',
|
|
179
223
|
accent: '#f5f5f5',
|
|
180
224
|
accentForeground: '#171717',
|
|
181
|
-
destructive: '#
|
|
182
|
-
destructiveForeground: '#
|
|
225
|
+
destructive: '#dc2626',
|
|
226
|
+
destructiveForeground: '#ffffff',
|
|
183
227
|
border: '#e5e5e5',
|
|
184
228
|
input: '#e5e5e5',
|
|
185
229
|
ring: '#171717'
|
|
@@ -197,8 +241,8 @@ exports.BASE_PALETTES = {
|
|
|
197
241
|
mutedForeground: '#a3a3a3',
|
|
198
242
|
accent: '#262626',
|
|
199
243
|
accentForeground: '#fafafa',
|
|
200
|
-
destructive: '#
|
|
201
|
-
destructiveForeground: '#
|
|
244
|
+
destructive: '#f87171',
|
|
245
|
+
destructiveForeground: '#450a0a',
|
|
202
246
|
border: '#262626',
|
|
203
247
|
input: '#262626',
|
|
204
248
|
ring: '#d4d4d4'
|
|
@@ -206,6 +250,10 @@ exports.BASE_PALETTES = {
|
|
|
206
250
|
}
|
|
207
251
|
};
|
|
208
252
|
exports.ACCENT_COLORS = {
|
|
253
|
+
doks: {
|
|
254
|
+
light: { primary: '#171717', primaryForeground: '#fafafa' },
|
|
255
|
+
dark: { primary: '#ededed', primaryForeground: '#171717' }
|
|
256
|
+
},
|
|
209
257
|
ghost: {
|
|
210
258
|
light: {
|
|
211
259
|
primary: 'var(--ghost-accent-color, #18181b)',
|
|
@@ -213,9 +261,9 @@ exports.ACCENT_COLORS = {
|
|
|
213
261
|
ring: 'var(--ghost-accent-color, #18181b)'
|
|
214
262
|
},
|
|
215
263
|
dark: {
|
|
216
|
-
primary: 'var(--ghost-accent-color, #
|
|
217
|
-
primaryForeground: '#
|
|
218
|
-
ring: 'var(--ghost-accent-color, #
|
|
264
|
+
primary: 'var(--ghost-accent-color, #4f46e5)',
|
|
265
|
+
primaryForeground: '#ffffff',
|
|
266
|
+
ring: 'var(--ghost-accent-color, #a5b4fc)'
|
|
219
267
|
}
|
|
220
268
|
},
|
|
221
269
|
zinc: {
|
|
@@ -224,27 +272,27 @@ exports.ACCENT_COLORS = {
|
|
|
224
272
|
},
|
|
225
273
|
indigo: {
|
|
226
274
|
light: { primary: '#4f46e5', primaryForeground: '#ffffff', ring: '#4f46e5' },
|
|
227
|
-
dark: { primary: '#
|
|
275
|
+
dark: { primary: '#818cf8', primaryForeground: '#1e1b4b', ring: '#818cf8' }
|
|
228
276
|
},
|
|
229
277
|
violet: {
|
|
230
278
|
light: { primary: '#7c3aed', primaryForeground: '#ffffff', ring: '#7c3aed' },
|
|
231
|
-
dark: { primary: '#
|
|
279
|
+
dark: { primary: '#a78bfa', primaryForeground: '#1e1b4b', ring: '#a78bfa' }
|
|
232
280
|
},
|
|
233
281
|
blue: {
|
|
234
282
|
light: { primary: '#2563eb', primaryForeground: '#ffffff', ring: '#2563eb' },
|
|
235
|
-
dark: { primary: '#
|
|
283
|
+
dark: { primary: '#60a5fa', primaryForeground: '#0f172a', ring: '#60a5fa' }
|
|
236
284
|
},
|
|
237
285
|
emerald: {
|
|
238
|
-
light: { primary: '#
|
|
239
|
-
dark: { primary: '#
|
|
286
|
+
light: { primary: '#047857', primaryForeground: '#ffffff', ring: '#047857' },
|
|
287
|
+
dark: { primary: '#34d399', primaryForeground: '#022c22', ring: '#34d399' }
|
|
240
288
|
},
|
|
241
289
|
rose: {
|
|
242
|
-
light: { primary: '#
|
|
243
|
-
dark: { primary: '#
|
|
290
|
+
light: { primary: '#be123c', primaryForeground: '#ffffff', ring: '#be123c' },
|
|
291
|
+
dark: { primary: '#fb7185', primaryForeground: '#4c0519', ring: '#fb7185' }
|
|
244
292
|
},
|
|
245
293
|
orange: {
|
|
246
|
-
light: { primary: '#
|
|
247
|
-
dark: { primary: '#
|
|
294
|
+
light: { primary: '#c2410c', primaryForeground: '#ffffff', ring: '#c2410c' },
|
|
295
|
+
dark: { primary: '#fb923c', primaryForeground: '#431407', ring: '#fb923c' }
|
|
248
296
|
}
|
|
249
297
|
};
|
|
250
298
|
function generateThemeCss(config) {
|
|
@@ -269,6 +317,8 @@ function generateThemeCss(config) {
|
|
|
269
317
|
--accent-foreground: ${base.dark.accentForeground};
|
|
270
318
|
--destructive: ${base.dark.destructive};
|
|
271
319
|
--destructive-foreground: ${base.dark.destructiveForeground};
|
|
320
|
+
--success: #4ade80;
|
|
321
|
+
--success-foreground: #052e16;
|
|
272
322
|
--border: ${base.dark.border};
|
|
273
323
|
--input: ${base.dark.input};
|
|
274
324
|
--ring: ${accent.dark.ring || base.dark.ring};`;
|
|
@@ -295,10 +345,13 @@ function generateThemeCss(config) {
|
|
|
295
345
|
--accent-foreground: ${base.light.accentForeground};
|
|
296
346
|
--destructive: ${base.light.destructive};
|
|
297
347
|
--destructive-foreground: ${base.light.destructiveForeground};
|
|
348
|
+
--success: #15803d;
|
|
349
|
+
--success-foreground: #ffffff;
|
|
298
350
|
--border: ${base.light.border};
|
|
299
351
|
--input: ${base.light.input};
|
|
300
352
|
--ring: ${accent.light.ring || base.light.ring};
|
|
301
353
|
--radius: ${radius};
|
|
354
|
+
${Object.entries(design_defaults_json_1.default).map(([name, value]) => ` --ghcn-${name}: ${value};`).join('\n')}
|
|
302
355
|
|
|
303
356
|
/* Ghost Native Compatibility Fallbacks */
|
|
304
357
|
--ghost-card-bg: var(--card);
|
|
@@ -347,17 +400,17 @@ function generateThemeCss(config) {
|
|
|
347
400
|
display: inline-flex;
|
|
348
401
|
align-items: center;
|
|
349
402
|
justify-content: center;
|
|
350
|
-
gap:
|
|
351
|
-
min-height:
|
|
403
|
+
gap: var(--ghcn-control-gap);
|
|
404
|
+
min-height: var(--ghcn-control-height);
|
|
352
405
|
border: 1px solid transparent;
|
|
353
|
-
border-radius: var(--radius);
|
|
354
|
-
padding:
|
|
406
|
+
border-radius: var(--ghcn-control-radius);
|
|
407
|
+
padding: var(--ghcn-control-padding);
|
|
355
408
|
color: var(--primary-foreground);
|
|
356
409
|
background: var(--primary);
|
|
357
410
|
font: inherit;
|
|
358
|
-
font-size:
|
|
411
|
+
font-size: var(--ghcn-text-small);
|
|
359
412
|
font-weight: 600;
|
|
360
|
-
line-height: 1;
|
|
413
|
+
line-height: 1.25;
|
|
361
414
|
text-decoration: none;
|
|
362
415
|
cursor: pointer;
|
|
363
416
|
transition: opacity 150ms ease, background-color 150ms ease, border-color 150ms ease;
|
|
@@ -373,38 +426,41 @@ function generateThemeCss(config) {
|
|
|
373
426
|
.ghcn-button--outline {
|
|
374
427
|
border-color: var(--border);
|
|
375
428
|
color: var(--foreground);
|
|
376
|
-
background:
|
|
429
|
+
background: transparent;
|
|
377
430
|
}
|
|
378
431
|
.ghcn-button--ghost {
|
|
379
432
|
color: var(--foreground);
|
|
380
433
|
background: transparent;
|
|
381
434
|
}
|
|
382
435
|
.ghcn-icon-button {
|
|
383
|
-
width:
|
|
436
|
+
width: var(--ghcn-control-height);
|
|
384
437
|
padding: 0;
|
|
385
438
|
}
|
|
386
439
|
.ghcn-input {
|
|
387
440
|
box-sizing: border-box;
|
|
388
|
-
min-height:
|
|
441
|
+
min-height: var(--ghcn-control-height);
|
|
389
442
|
width: 100%;
|
|
390
443
|
border: 1px solid var(--input);
|
|
391
|
-
border-radius: var(--radius);
|
|
392
|
-
padding:
|
|
444
|
+
border-radius: var(--ghcn-control-radius);
|
|
445
|
+
padding: var(--ghcn-control-padding);
|
|
393
446
|
color: var(--foreground);
|
|
394
447
|
background: var(--background);
|
|
395
448
|
font: inherit;
|
|
396
|
-
font-size:
|
|
449
|
+
font-size: var(--ghcn-text-small);
|
|
450
|
+
line-height: 1.25;
|
|
397
451
|
}
|
|
398
452
|
.ghcn-badge {
|
|
399
453
|
display: inline-flex;
|
|
400
454
|
align-items: center;
|
|
401
455
|
border-radius: 9999px;
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
456
|
+
border: 1px solid var(--border);
|
|
457
|
+
padding: 3px 9px;
|
|
458
|
+
color: var(--secondary-foreground);
|
|
459
|
+
background: var(--secondary);
|
|
405
460
|
font-size: 12px;
|
|
406
|
-
font-weight:
|
|
407
|
-
line-height: 1;
|
|
461
|
+
font-weight: 600;
|
|
462
|
+
line-height: 1.25;
|
|
463
|
+
text-decoration: none;
|
|
408
464
|
}
|
|
409
465
|
.ghcn-avatar {
|
|
410
466
|
display: block;
|
|
@@ -424,6 +480,9 @@ function generateThemeCss(config) {
|
|
|
424
480
|
white-space: nowrap;
|
|
425
481
|
border: 0;
|
|
426
482
|
}
|
|
483
|
+
@media (prefers-reduced-motion: reduce) {
|
|
484
|
+
.ghcn-button, .ghcn-icon-button { transition: none; }
|
|
485
|
+
}
|
|
427
486
|
`;
|
|
428
487
|
return (0, styles_1.componentCss)(css, config.style);
|
|
429
488
|
}
|