ghostcn 1.4.0 → 1.5.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.
Files changed (33) hide show
  1. package/README.md +16 -425
  2. package/dist/commands/create.js +6 -6
  3. package/dist/commands/init.js +5 -2
  4. package/dist/index.js +2 -1
  5. package/dist/registry/components/alert.json +1 -1
  6. package/dist/registry/components/archive-header.json +1 -1
  7. package/dist/registry/components/author-card.json +1 -1
  8. package/dist/registry/components/author-list.json +1 -1
  9. package/dist/registry/components/badge.json +1 -1
  10. package/dist/registry/components/button.json +1 -1
  11. package/dist/registry/components/card.json +1 -1
  12. package/dist/registry/components/featured-posts.json +2 -2
  13. package/dist/registry/components/input.json +1 -1
  14. package/dist/registry/components/member-cta.json +1 -1
  15. package/dist/registry/components/newsletter-form.json +1 -1
  16. package/dist/registry/components/pagination.json +1 -1
  17. package/dist/registry/components/post-card.json +1 -1
  18. package/dist/registry/components/post-grid.json +1 -1
  19. package/dist/registry/components/post-header.json +1 -1
  20. package/dist/registry/components/post-navigation.json +1 -1
  21. package/dist/registry/components/pricing-table.json +2 -2
  22. package/dist/registry/components/related-posts.json +1 -1
  23. package/dist/registry/components/site-footer.json +1 -1
  24. package/dist/registry/components/site-header.json +1 -1
  25. package/dist/registry/components/table-of-contents.json +3 -3
  26. package/dist/registry/components/tag-grid.json +1 -1
  27. package/dist/registry/components/tag-list.json +1 -1
  28. package/dist/utils/design-defaults.json +17 -0
  29. package/dist/utils/preview-renderer.js +11 -3
  30. package/dist/utils/theme-scaffold.js +7 -8
  31. package/dist/utils/theme.d.ts +3 -3
  32. package/dist/utils/theme.js +69 -17
  33. package/package.json +3 -3
@@ -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',
@@ -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)',
@@ -299,6 +347,7 @@ function generateThemeCss(config) {
299
347
  --input: ${base.light.input};
300
348
  --ring: ${accent.light.ring || base.light.ring};
301
349
  --radius: ${radius};
350
+ ${Object.entries(design_defaults_json_1.default).map(([name, value]) => ` --ghcn-${name}: ${value};`).join('\n')}
302
351
 
303
352
  /* Ghost Native Compatibility Fallbacks */
304
353
  --ghost-card-bg: var(--card);
@@ -347,17 +396,17 @@ function generateThemeCss(config) {
347
396
  display: inline-flex;
348
397
  align-items: center;
349
398
  justify-content: center;
350
- gap: 8px;
351
- min-height: 40px;
399
+ gap: var(--ghcn-control-gap);
400
+ min-height: var(--ghcn-control-height);
352
401
  border: 1px solid transparent;
353
- border-radius: var(--radius);
354
- padding: 10px 16px;
402
+ border-radius: var(--ghcn-control-radius);
403
+ padding: var(--ghcn-control-padding);
355
404
  color: var(--primary-foreground);
356
405
  background: var(--primary);
357
406
  font: inherit;
358
- font-size: 14px;
407
+ font-size: var(--ghcn-text-small);
359
408
  font-weight: 600;
360
- line-height: 1;
409
+ line-height: 1.25;
361
410
  text-decoration: none;
362
411
  cursor: pointer;
363
412
  transition: opacity 150ms ease, background-color 150ms ease, border-color 150ms ease;
@@ -373,38 +422,41 @@ function generateThemeCss(config) {
373
422
  .ghcn-button--outline {
374
423
  border-color: var(--border);
375
424
  color: var(--foreground);
376
- background: var(--background);
425
+ background: transparent;
377
426
  }
378
427
  .ghcn-button--ghost {
379
428
  color: var(--foreground);
380
429
  background: transparent;
381
430
  }
382
431
  .ghcn-icon-button {
383
- width: 40px;
432
+ width: var(--ghcn-control-height);
384
433
  padding: 0;
385
434
  }
386
435
  .ghcn-input {
387
436
  box-sizing: border-box;
388
- min-height: 40px;
437
+ min-height: var(--ghcn-control-height);
389
438
  width: 100%;
390
439
  border: 1px solid var(--input);
391
- border-radius: var(--radius);
392
- padding: 10px 14px;
440
+ border-radius: var(--ghcn-control-radius);
441
+ padding: var(--ghcn-control-padding);
393
442
  color: var(--foreground);
394
443
  background: var(--background);
395
444
  font: inherit;
396
- font-size: 14px;
445
+ font-size: var(--ghcn-text-small);
446
+ line-height: 1.25;
397
447
  }
398
448
  .ghcn-badge {
399
449
  display: inline-flex;
400
450
  align-items: center;
401
451
  border-radius: 9999px;
402
- padding: 4px 10px;
403
- color: var(--primary-foreground);
404
- background: var(--primary);
452
+ border: 1px solid var(--border);
453
+ padding: 3px 9px;
454
+ color: var(--secondary-foreground);
455
+ background: var(--secondary);
405
456
  font-size: 12px;
406
- font-weight: 700;
407
- line-height: 1;
457
+ font-weight: 600;
458
+ line-height: 1.25;
459
+ text-decoration: none;
408
460
  }
409
461
  .ghcn-avatar {
410
462
  display: block;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghostcn",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "The shadcn/ui for Ghost CMS themes - component distribution system",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,7 +14,7 @@
14
14
  "README.md"
15
15
  ],
16
16
  "scripts": {
17
- "build": "tsc && node -e \"const fs=require('fs'); fs.cpSync('templates', 'dist/templates', {recursive:true}); if(fs.existsSync('../../registry')){fs.cpSync('../../registry', 'dist/registry', {recursive:true});} if(fs.existsSync('../../README.md')){fs.copyFileSync('../../README.md', 'README.md');}\"",
17
+ "build": "tsc && node -e \"const fs=require('fs'); fs.cpSync('templates', 'dist/templates', {recursive:true}); if(fs.existsSync('../../registry')){fs.cpSync('../../registry', 'dist/registry', {recursive:true});}\"",
18
18
  "prepublishOnly": "npm run build",
19
19
  "start": "ts-node src/index.ts",
20
20
  "dev": "ts-node src/index.ts",
@@ -40,7 +40,7 @@
40
40
  "bugs": {
41
41
  "url": "https://github.com/Geekbits-Org/ghost-ui/issues"
42
42
  },
43
- "homepage": "https://github.com/Geekbits-Org/ghost-ui#readme",
43
+ "homepage": "https://ghostcn.geekbits.dev",
44
44
  "dependencies": {
45
45
  "handlebars": "^4.7.9",
46
46
  "chalk": "^4.1.2",