ghostcn 1.2.0 → 1.4.1

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 (58) hide show
  1. package/README.md +16 -244
  2. package/dist/commands/add.d.ts +6 -1
  3. package/dist/commands/add.js +121 -83
  4. package/dist/commands/diff.d.ts +5 -0
  5. package/dist/commands/diff.js +54 -0
  6. package/dist/commands/playground.d.ts +3 -0
  7. package/dist/commands/playground.js +29 -0
  8. package/dist/index.js +18 -3
  9. package/dist/registry/components/alert.json +62 -0
  10. package/dist/registry/components/archive-header.json +57 -0
  11. package/dist/registry/components/author-card.json +23 -2
  12. package/dist/registry/components/author-list.json +55 -0
  13. package/dist/registry/components/badge.json +51 -0
  14. package/dist/registry/components/button.json +74 -0
  15. package/dist/registry/components/card.json +70 -0
  16. package/dist/registry/components/featured-posts.json +18 -1
  17. package/dist/registry/components/input.json +94 -0
  18. package/dist/registry/components/member-cta.json +15 -1
  19. package/dist/registry/components/newsletter-form.json +23 -2
  20. package/dist/registry/components/pagination.json +12 -1
  21. package/dist/registry/components/post-card.json +25 -2
  22. package/dist/registry/components/post-grid.json +54 -0
  23. package/dist/registry/components/post-header.json +18 -1
  24. package/dist/registry/components/post-navigation.json +41 -0
  25. package/dist/registry/components/pricing-table.json +31 -2
  26. package/dist/registry/components/related-posts.json +53 -0
  27. package/dist/registry/components/site-footer.json +15 -1
  28. package/dist/registry/components/site-header.json +16 -1
  29. package/dist/registry/components/table-of-contents.json +47 -0
  30. package/dist/registry/components/tag-grid.json +64 -0
  31. package/dist/registry/components/tag-list.json +38 -0
  32. package/dist/registry/index.json +131 -0
  33. package/dist/templates/playground/index.html +5 -0
  34. package/dist/templates/playground/playground.css +18 -0
  35. package/dist/templates/playground/playground.js +71 -0
  36. package/dist/templates/playground/preview.css +5 -0
  37. package/dist/templates/playground/preview.js +12 -0
  38. package/dist/templates/theme-tools.mjs +1 -1
  39. package/dist/utils/component-diff.d.ts +18 -0
  40. package/dist/utils/component-diff.js +93 -0
  41. package/dist/utils/component-files.d.ts +9 -0
  42. package/dist/utils/component-files.js +48 -0
  43. package/dist/utils/component-history.d.ts +11 -0
  44. package/dist/utils/component-history.js +47 -0
  45. package/dist/utils/component-installer.d.ts +2 -0
  46. package/dist/utils/component-installer.js +34 -37
  47. package/dist/utils/component-plan.d.ts +7 -0
  48. package/dist/utils/component-plan.js +43 -0
  49. package/dist/utils/playground-server.d.ts +9 -0
  50. package/dist/utils/playground-server.js +189 -0
  51. package/dist/utils/preview-renderer.d.ts +143 -0
  52. package/dist/utils/preview-renderer.js +70 -0
  53. package/dist/utils/registry.d.ts +7 -0
  54. package/dist/utils/registry.js +12 -18
  55. package/dist/utils/theme-files.d.ts +2 -0
  56. package/dist/utils/theme-files.js +41 -3
  57. package/dist/utils/theme-scaffold.js +14 -1
  58. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -11,12 +11,15 @@ const list_1 = require("./commands/list");
11
11
  const create_1 = require("./commands/create");
12
12
  const doctor_1 = require("./commands/doctor");
13
13
  const pack_1 = require("./commands/pack");
14
+ const diff_1 = require("./commands/diff");
15
+ const playground_1 = require("./commands/playground");
14
16
  const package_json_1 = __importDefault(require("../package.json"));
15
17
  function main() {
16
18
  const program = new commander_1.Command()
17
19
  .name('ghostcn')
18
20
  .description('The shadcn/ui for Ghost CMS themes')
19
- .version(package_json_1.default.version || '1.0.0');
21
+ .version(package_json_1.default.version || '1.0.0')
22
+ .addHelpText('after', `\nDocumentation: ${package_json_1.default.homepage}`);
20
23
  program
21
24
  .command('create')
22
25
  .description('Create a complete Ghost theme with ghostcn components')
@@ -36,11 +39,23 @@ function main() {
36
39
  program
37
40
  .command('add')
38
41
  .description('Add one or more components to your Ghost theme')
39
- .argument('[component]', 'The component to add (leave blank for interactive selection)')
42
+ .argument('[components...]', 'Component names to add (leave blank for interactive selection)')
40
43
  .option('-y, --yes', 'Overwrite existing files without prompting')
44
+ .option('--skip-existing', 'Keep existing files and install missing files without prompting')
41
45
  .action(add_1.add);
42
46
  program.command('doctor').description('Check theme configuration, local assets, partials and build readiness').action(doctor_1.doctor);
47
+ program.command('diff').description('Review component changes without writing or overwriting any files')
48
+ .argument('[component]', 'Compare one component, or all installed components')
49
+ .option('--latest', 'Compare with the latest remote registry (main); fail if unavailable')
50
+ .option('--summary', 'Show file statuses without full diffs')
51
+ .option('--json', 'Return machine-readable comparisons with baseline, local and registry content')
52
+ .action(diff_1.diff);
43
53
  program.command('pack').description('Package built theme runtime files as a Ghost-uploadable ZIP').action(pack_1.pack);
44
- program.parse();
54
+ program.command('playground').description('Preview installed components locally with synthetic content (read-only)')
55
+ .option('--port <number>', 'Local loopback port (0 chooses an available port)', '4190').action(playground_1.playground);
56
+ program.parseAsync().catch(error => {
57
+ console.error(error.message);
58
+ process.exitCode = 1;
59
+ });
45
60
  }
46
61
  main();
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "alert",
3
+ "type": "components:ui",
4
+ "description": "An accessible status message with an optional urgent announcement.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Visual treatment; unknown values fall back to default.",
10
+ "options": [
11
+ "default",
12
+ "secondary",
13
+ "outline",
14
+ "destructive"
15
+ ],
16
+ "default": "default"
17
+ },
18
+ "size": {
19
+ "description": "Component scale; unknown values fall back to default.",
20
+ "options": [
21
+ "sm",
22
+ "default",
23
+ "lg"
24
+ ],
25
+ "default": "default"
26
+ },
27
+ "heading": {
28
+ "description": "Optional status heading."
29
+ },
30
+ "description": {
31
+ "description": "Escaped status text."
32
+ },
33
+ "urgent": {
34
+ "description": "Boolean. Use role=alert for urgent, dynamically inserted errors only."
35
+ }
36
+ },
37
+ "files": [
38
+ {
39
+ "name": "alert.hbs",
40
+ "type": "partial",
41
+ "target": "partials/components/alert.hbs",
42
+ "content": "{{!-- Styling parameters: class, titleClass, descriptionClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-ui-alert{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"secondary\"}}secondary{{else}}{{#match variant \"outline\"}}outline{{else}}{{#match variant \"destructive\"}}destructive{{else}}default{{/match}}{{/match}}{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\" role=\"{{#if urgent}}alert{{else}}status{{/if}}\">\n {{#if heading}}<h3 class=\"ghcn-ui-alert__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{heading}}</h3>{{/if}}\n <p class=\"ghcn-ui-alert__description{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">{{#if description}}{{description}}{{else}}An update for your readers.{{/if}}</p>\n</div>\n{{/with}}"
43
+ },
44
+ {
45
+ "name": "alert.css",
46
+ "type": "style",
47
+ "target": "assets/css/components/alert.css",
48
+ "content": ".ghcn-ui-alert { box-sizing: border-box; font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-alert, .ghcn-ui-alert * { box-sizing: border-box; }\n.ghcn-ui-alert:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-alert:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-alert:focus-visible, .ghcn-ui-alert :focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }\n.ghcn-ui-alert { padding: 1em; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); overflow-wrap: anywhere; }\n.ghcn-ui-alert:where([data-variant=\"secondary\"]) { background: var(--secondary); color: var(--secondary-foreground); }\n.ghcn-ui-alert:where([data-variant=\"outline\"]) { background: transparent; }\n.ghcn-ui-alert:where([data-variant=\"destructive\"]) { border-color: var(--destructive); color: var(--destructive); }\n.ghcn-ui-alert__title { font-size: 1em; margin: 0 0 .375em; font-weight: 600; }\n.ghcn-ui-alert__description { margin: 0; }\n"
49
+ }
50
+ ],
51
+ "styleSlots": {
52
+ "class": [
53
+ ".ghcn-ui-alert"
54
+ ],
55
+ "titleClass": [
56
+ ".ghcn-ui-alert__title"
57
+ ],
58
+ "descriptionClass": [
59
+ ".ghcn-ui-alert__description"
60
+ ]
61
+ }
62
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "archive-header",
3
+ "type": "components:content",
4
+ "description": "A reusable tag or author archive heading with an optional badge and image.",
5
+ "dependencies": [
6
+ "badge"
7
+ ],
8
+ "ghost_version": ">=5.0.0",
9
+ "parameters": {
10
+ "heading": {
11
+ "description": "Heading override; otherwise uses author/tag name or site title."
12
+ },
13
+ "eyebrow": {
14
+ "description": "Optional badge label."
15
+ },
16
+ "description": {
17
+ "description": "Description override; otherwise uses author bio."
18
+ },
19
+ "archiveImage": {
20
+ "description": "Optional archive feature image URL."
21
+ },
22
+ "imageAlt": {
23
+ "description": "Alternative text for the image (empty for decorative images)."
24
+ }
25
+ },
26
+ "files": [
27
+ {
28
+ "name": "archive-header.hbs",
29
+ "type": "partial",
30
+ "target": "partials/components/archive-header.hbs",
31
+ "content": "{{!-- Styling parameters: class, titleClass, descriptionClass, imageClass --}}\n{{#with this as |ghostcnStyles|}}\n<header class=\"ghcn-archive-header{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\">\n {{#if eyebrow}}{{> \"components/badge\" text=eyebrow variant=\"secondary\" class=ghostcnStyles.badgeClass}}{{/if}}\n <h1 class=\"ghcn-archive-header__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{#if heading}}{{heading}}{{else}}{{#if name}}{{name}}{{else}}{{@site.title}}{{/if}}{{/if}}</h1>\n {{#if description}}<p class=\"ghcn-archive-header__description{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">{{description}}</p>{{else}}{{#if bio}}<p class=\"ghcn-archive-header__description{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">{{bio}}</p>{{/if}}{{/if}}\n {{#if archiveImage}}<img class=\"ghcn-archive-header__image{{#if ghostcnStyles.imageClass}} {{ghostcnStyles.imageClass}}{{/if}}\" src=\"{{img_url archiveImage size=\"l\"}}\" alt=\"{{imageAlt}}\" />{{/if}}\n</header>\n{{/with}}"
32
+ },
33
+ {
34
+ "name": "archive-header.css",
35
+ "type": "style",
36
+ "target": "assets/css/components/archive-header.css",
37
+ "content": ".ghcn-archive-header { font-size: 16px; color: var(--foreground); text-align: center; margin-block: 2em; }\n.ghcn-archive-header__title { font-size: clamp(2em,5vw,3em); line-height: 1.1; margin: .5em 0; overflow-wrap: anywhere; }\n.ghcn-archive-header__description { max-width: 42em; margin: 1em auto; color: var(--muted-foreground); }\n.ghcn-archive-header__image { display: block; width: 100%; max-height: 28em; object-fit: cover; border-radius: var(--radius); margin-top: 2em; }\n"
38
+ }
39
+ ],
40
+ "styleSlots": {
41
+ "class": [
42
+ ".ghcn-archive-header"
43
+ ],
44
+ "titleClass": [
45
+ ".ghcn-archive-header__title"
46
+ ],
47
+ "descriptionClass": [
48
+ ".ghcn-archive-header__description"
49
+ ],
50
+ "imageClass": [
51
+ ".ghcn-archive-header__image"
52
+ ],
53
+ "badgeClass": [
54
+ ".ghcn-ui-badge"
55
+ ]
56
+ }
57
+ }
@@ -9,13 +9,13 @@
9
9
  "name": "author-card.hbs",
10
10
  "type": "partial",
11
11
  "target": "partials/components/author-card.hbs",
12
- "content": "{{!--\n Component: Author Card\n Usage: In post context {{> \"components/author-card\"}} or {{#primary_author}}{{> \"components/author-card\"}}{{/primary_author}}\n--}}\n<section class=\"gh-author-card bg-card text-card-foreground border border-border rounded-ghostcn p-6 my-8 max-w-2xl mx-auto flex flex-col sm:flex-row items-center sm:items-start gap-5 shadow-sm\">\n {{#if profile_image}}\n <img src=\"{{img_url profile_image size=\"m\"}}\" alt=\"{{name}}\" class=\"gh-author-avatar w-20 h-20 rounded-full object-cover border-2 border-border shadow-sm\" />\n {{else}}\n <div class=\"gh-author-avatar-fallback w-20 h-20 rounded-full bg-muted text-foreground flex items-center justify-center font-bold text-2xl border-2 border-border shadow-sm\">\n {{name.[0]}}\n </div>\n {{/if}}\n\n <div class=\"gh-author-details flex-1 text-center sm:text-left\">\n <div class=\"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2\">\n <h4 class=\"gh-author-name text-xl font-bold tracking-tight text-foreground\">\n <a href=\"{{url}}\" class=\"hover:text-primary transition-colors\">{{name}}</a>\n </h4>\n {{#if count.posts}}\n <span class=\"gh-author-post-count text-xs text-muted-foreground bg-muted px-2.5 py-1 rounded-full font-medium\">\n {{plural count.posts empty=\"0 posts\" singular=\"% post\" plural=\"% posts\"}}\n </span>\n {{/if}}\n </div>\n\n {{#if bio}}\n <p class=\"gh-author-bio text-muted-foreground text-sm mb-4 leading-relaxed\">{{bio}}</p>\n {{/if}}\n\n <div class=\"gh-author-meta flex flex-wrap items-center justify-center sm:justify-start gap-4 text-xs text-muted-foreground\">\n {{#if location}}\n <span class=\"gh-author-location flex items-center gap-1\">📍 {{location}}</span>\n {{/if}}\n {{#if website}}\n <a href=\"{{website}}\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"gh-author-link text-primary hover:underline\">Website</a>\n {{/if}}\n {{#if twitter}}\n <a href=\"{{social_url type=\"twitter\"}}\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"gh-author-link text-primary hover:underline\">Twitter/X</a>\n {{/if}}\n {{#if facebook}}\n <a href=\"{{social_url type=\"facebook\"}}\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"gh-author-link text-primary hover:underline\">Facebook</a>\n {{/if}}\n </div>\n </div>\n</section>"
12
+ "content": "{{!-- Styling parameters: class, avatarClass, contentClass, titleClass, descriptionClass, metaClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!--\n Component: Author Card\n Usage: In post context {{> \"components/author-card\"}} or {{#primary_author}}{{> \"components/author-card\"}}{{/primary_author}}\n--}}\n<section class=\"gh-author-card{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\">\n {{#if profile_image}}\n <img src=\"{{img_url profile_image size=\"m\"}}\" alt=\"{{name}}\" class=\"gh-author-avatar{{#if ghostcnStyles.avatarClass}} {{ghostcnStyles.avatarClass}}{{/if}}\" />\n {{else}}\n <div class=\"gh-author-avatar-fallback{{#if ghostcnStyles.avatarClass}} {{ghostcnStyles.avatarClass}}{{/if}}\">\n {{name.[0]}}\n </div>\n {{/if}}\n\n <div class=\"gh-author-details{{#if ghostcnStyles.contentClass}} {{ghostcnStyles.contentClass}}{{/if}}\">\n <div class=\"gh-author-heading\">\n <h4 class=\"gh-author-name{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">\n <a href=\"{{url}}\" >{{name}}</a>\n </h4>\n {{#if count.posts}}\n <span class=\"gh-author-post-count\">\n {{plural count.posts empty=\"0 posts\" singular=\"% post\" plural=\"% posts\"}}\n </span>\n {{/if}}\n </div>\n\n {{#if bio}}\n <p class=\"gh-author-bio{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">{{bio}}</p>\n {{/if}}\n\n <div class=\"gh-author-meta{{#if ghostcnStyles.metaClass}} {{ghostcnStyles.metaClass}}{{/if}}\">\n {{#if location}}\n <span class=\"gh-author-location\">📍 {{location}}</span>\n {{/if}}\n {{#if website}}\n <a href=\"{{website}}\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"gh-author-link\">Website</a>\n {{/if}}\n {{#if twitter}}\n <a href=\"{{social_url type=\"twitter\"}}\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"gh-author-link\">Twitter/X</a>\n {{/if}}\n {{#if facebook}}\n <a href=\"{{social_url type=\"facebook\"}}\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"gh-author-link\">Facebook</a>\n {{/if}}\n </div>\n </div>\n</section>\n{{/with}}"
13
13
  },
14
14
  {
15
15
  "name": "author-card.css",
16
16
  "type": "style",
17
17
  "target": "assets/css/components/author-card.css",
18
- "content": "/* ghostcn: Author Card Styles */\n.gh-author-card {\n box-sizing: border-box;\n font-family: inherit;\n font-size: 16px;\n line-height: 1.5;\n isolation: isolate;\n background-color: var(--card, #ffffff);\n color: var(--card-foreground, #09090b);\n border: 1px solid var(--border, #e4e4e7);\n border-radius: min(var(--radius, 0.5em), 1.5em);\n padding: 1.5em;\n margin: 2em auto;\n max-width: 42em;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1.25em;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-author-card *,\n.gh-author-card *::before,\n.gh-author-card *::after {\n box-sizing: border-box;\n}\n\n@media (min-width: 640px) {\n .gh-author-card {\n flex-direction: row;\n align-items: flex-start;\n }\n}\n\n.gh-author-avatar {\n width: 5em;\n height: 5em;\n border-radius: 9999px;\n object-fit: cover;\n border: 2px solid var(--border, #e4e4e7);\n}\n\n.gh-author-avatar-fallback {\n width: 5em;\n height: 5em;\n border-radius: 9999px;\n background-color: var(--muted, #f4f4f5);\n color: var(--foreground, #09090b);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.5em;\n font-weight: 700;\n border: 2px solid var(--border, #e4e4e7);\n}\n\n.gh-author-details {\n flex: 1;\n text-align: center;\n}\n\n@media (min-width: 640px) {\n .gh-author-details {\n text-align: left;\n }\n}\n\n.gh-author-name {\n font-size: 1.25em;\n font-weight: 700;\n letter-spacing: -0.025em;\n margin: 0;\n}\n\n.gh-author-name a {\n color: var(--foreground, #09090b);\n text-decoration: none;\n transition: color 0.15s ease;\n}\n\n.gh-author-name a:hover {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n}\n\n.gh-author-bio {\n color: var(--muted-foreground, #71717a);\n font-size: 0.875em;\n line-height: 1.5;\n margin: 0.5em 0 1em;\n}\n\n.gh-author-meta {\n display: flex;\n flex-wrap: wrap;\n gap: 1em;\n font-size: 0.75em;\n color: var(--muted-foreground, #71717a);\n}\n\n.gh-author-meta a {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n text-decoration: none;\n}\n\n.gh-author-meta a:hover {\n text-decoration: underline;\n}\n"
18
+ "content": "/* ghostcn: Author Card Styles */\n.gh-author-card {\n box-sizing: border-box;\n font-family: inherit;\n font-size: 16px;\n line-height: 1.5;\n isolation: isolate;\n background-color: var(--card, #ffffff);\n color: var(--card-foreground, #09090b);\n border: 1px solid var(--border, #e4e4e7);\n border-radius: min(var(--radius, 0.5em), 1.5em);\n padding: 1.5em;\n margin: 2em auto;\n max-width: 42em;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1.25em;\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-author-card *,\n.gh-author-card *::before,\n.gh-author-card *::after {\n box-sizing: border-box;\n}\n\n@media (min-width: 640px) {\n .gh-author-card {\n flex-direction: row;\n align-items: flex-start;\n }\n}\n\n.gh-author-avatar {\n width: 5em;\n height: 5em;\n border-radius: 9999px;\n object-fit: cover;\n border: 2px solid var(--border, #e4e4e7);\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-author-avatar-fallback {\n width: 5em;\n height: 5em;\n border-radius: 9999px;\n background-color: var(--muted, #f4f4f5);\n color: var(--foreground, #09090b);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.5em;\n font-weight: 700;\n border: 2px solid var(--border, #e4e4e7);\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n\n.gh-author-details {\n flex: 1;\n text-align: center;\n}\n\n@media (min-width: 640px) {\n .gh-author-details {\n text-align: left;\n }\n}\n\n.gh-author-name {\n font-size: 1.25em;\n font-weight: 700;\n letter-spacing: -0.025em;\n margin: 0;\n color: var(--foreground, #09090b);\n}\n\n.gh-author-name a {\n color: inherit;\n text-decoration: none;\n transition: color 0.15s ease;\n}\n\n.gh-author-name:hover {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n}\n\n.gh-author-bio {\n color: var(--muted-foreground, #71717a);\n font-size: 0.875em;\n line-height: 1.5;\n margin: 0.5em 0 1em;\n}\n\n.gh-author-meta {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n gap: 1em;\n font-size: 0.75em;\n color: var(--muted-foreground, #71717a);\n}\n\n.gh-author-meta a {\n color: var(--primary, var(--ghost-accent-color, #18181b));\n text-decoration: none;\n}\n\n.gh-author-meta a:hover {\n text-decoration: underline;\n}\n\n.gh-author-heading { display: flex; flex-direction: column; justify-content: space-between; gap: 0.5em; margin-bottom: 0.5em; }\n.gh-author-post-count { border-radius: 9999px; padding: 0.25em 0.625em; background: var(--muted); color: var(--muted-foreground); font-size: 0.75em; font-weight: 500; }\n.gh-author-location { display: inline-flex; align-items: center; gap: 0.25em; }\n@media (min-width: 640px) { .gh-author-heading { flex-direction: row; align-items: center; } .gh-author-meta { justify-content: flex-start; } }\n"
19
19
  }
20
20
  ],
21
21
  "gscan": {
@@ -23,5 +23,26 @@
23
23
  "GS010-PJ-VALID"
24
24
  ],
25
25
  "notes": "Uses standard Ghost author helpers (profile_image, img_url, plural, url, bio)."
26
+ },
27
+ "styleSlots": {
28
+ "class": [
29
+ ".gh-author-card"
30
+ ],
31
+ "avatarClass": [
32
+ ".gh-author-avatar",
33
+ ".gh-author-avatar-fallback"
34
+ ],
35
+ "contentClass": [
36
+ ".gh-author-details"
37
+ ],
38
+ "titleClass": [
39
+ ".gh-author-name"
40
+ ],
41
+ "descriptionClass": [
42
+ ".gh-author-bio"
43
+ ],
44
+ "metaClass": [
45
+ ".gh-author-meta"
46
+ ]
26
47
  }
27
48
  }
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "author-list",
3
+ "type": "components:content",
4
+ "description": "Publication authors rendered with reusable author cards.",
5
+ "dependencies": [
6
+ "author-card"
7
+ ],
8
+ "ghost_version": ">=5.0.0",
9
+ "parameters": {
10
+ "heading": {
11
+ "description": "Optional section heading."
12
+ },
13
+ "emptyText": {
14
+ "description": "Optional message when no content is available; otherwise render nothing."
15
+ }
16
+ },
17
+ "files": [
18
+ {
19
+ "name": "author-list.hbs",
20
+ "type": "partial",
21
+ "target": "partials/components/author-list.hbs",
22
+ "content": "{{!-- Styling parameters: class, titleClass, gridClass --}}\n{{#with this as |ghostcnStyles|}}\n{{#get \"authors\" limit=\"100\" include=\"count.posts\"}}\n{{#if authors}}<section class=\"ghcn-author-list{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" aria-label=\"Authors\">\n {{#if ghostcnStyles.heading}}<h2 class=\"ghcn-author-list__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{ghostcnStyles.heading}}</h2>{{/if}}\n <div class=\"ghcn-author-list__grid{{#if ghostcnStyles.gridClass}} {{ghostcnStyles.gridClass}}{{/if}}\">{{#foreach authors}}\n {{> \"components/author-card\" class=ghostcnStyles.cardClass titleClass=ghostcnStyles.cardTitleClass avatarClass=ghostcnStyles.avatarClass descriptionClass=ghostcnStyles.descriptionClass}}\n {{/foreach}}</div>\n</section>{{else}}{{#if ghostcnStyles.emptyText}}<section class=\"ghcn-author-list{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\"><p class=\"ghcn-author-list__empty\">{{ghostcnStyles.emptyText}}</p></section>{{/if}}{{/if}}\n{{/get}}\n{{/with}}"
23
+ },
24
+ {
25
+ "name": "author-list.css",
26
+ "type": "style",
27
+ "target": "assets/css/components/author-list.css",
28
+ "content": ".ghcn-author-list { font-size: 16px; color: var(--foreground); margin-block: 2em; }\n.ghcn-author-list__title { font-size: 1.5em; line-height: 1.25; margin: 0 0 1em; }\n.ghcn-author-list__grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.5em; }\n.ghcn-author-list__grid > * { min-width: 0; }\n.ghcn-author-list__empty { color: var(--muted-foreground); }\n@media(max-width:900px) { .ghcn-author-list__grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }\n@media(max-width:620px) { .ghcn-author-list__grid { grid-template-columns: 1fr; } }"
29
+ }
30
+ ],
31
+ "styleSlots": {
32
+ "class": [
33
+ ".ghcn-author-list"
34
+ ],
35
+ "titleClass": [
36
+ ".ghcn-author-list__title"
37
+ ],
38
+ "gridClass": [
39
+ ".ghcn-author-list__grid"
40
+ ],
41
+ "cardClass": [
42
+ ".gh-author-card"
43
+ ],
44
+ "cardTitleClass": [
45
+ ".gh-author-name"
46
+ ],
47
+ "avatarClass": [
48
+ ".gh-author-avatar",
49
+ ".gh-author-avatar-fallback"
50
+ ],
51
+ "descriptionClass": [
52
+ ".gh-author-bio"
53
+ ]
54
+ }
55
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "badge",
3
+ "type": "components:ui",
4
+ "description": "A small non-interactive label with variants and sizes.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Visual treatment; unknown values fall back to default.",
10
+ "options": [
11
+ "default",
12
+ "secondary",
13
+ "outline",
14
+ "destructive"
15
+ ],
16
+ "default": "default"
17
+ },
18
+ "size": {
19
+ "description": "Component scale; unknown values fall back to default.",
20
+ "options": [
21
+ "sm",
22
+ "default",
23
+ "lg"
24
+ ],
25
+ "default": "default"
26
+ },
27
+ "text": {
28
+ "description": "Escaped badge label.",
29
+ "default": "Label"
30
+ }
31
+ },
32
+ "files": [
33
+ {
34
+ "name": "badge.hbs",
35
+ "type": "partial",
36
+ "target": "partials/components/badge.hbs",
37
+ "content": "{{!-- Styling parameters: class --}}\n{{#with this as |ghostcnStyles|}}\n<span class=\"ghcn-ui-badge{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"secondary\"}}secondary{{else}}{{#match variant \"outline\"}}outline{{else}}{{#match variant \"destructive\"}}destructive{{else}}default{{/match}}{{/match}}{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\">{{#if text}}{{text}}{{else}}Label{{/if}}</span>\n{{/with}}"
38
+ },
39
+ {
40
+ "name": "badge.css",
41
+ "type": "style",
42
+ "target": "assets/css/components/badge.css",
43
+ "content": ".ghcn-ui-badge { box-sizing: border-box; font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-badge, .ghcn-ui-badge * { box-sizing: border-box; }\n.ghcn-ui-badge:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-badge:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-badge:focus-visible, .ghcn-ui-badge :focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }\n.ghcn-ui-badge { display: inline-flex; align-items: center; padding: .125em .625em; border: 1px solid transparent; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); font-weight: 600; }\n.ghcn-ui-badge:where([data-variant=\"secondary\"]) { background: var(--secondary); color: var(--secondary-foreground); }\n.ghcn-ui-badge:where([data-variant=\"outline\"]) { background: transparent; color: var(--foreground); border-color: var(--border); }\n.ghcn-ui-badge:where([data-variant=\"destructive\"]) { background: var(--destructive); color: var(--destructive-foreground); }\n"
44
+ }
45
+ ],
46
+ "styleSlots": {
47
+ "class": [
48
+ ".ghcn-ui-badge"
49
+ ]
50
+ }
51
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "button",
3
+ "type": "components:ui",
4
+ "description": "A native button or link with variants, sizes and per-instance classes.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Visual treatment; unknown values fall back to default.",
10
+ "options": [
11
+ "default",
12
+ "secondary",
13
+ "outline",
14
+ "ghost",
15
+ "destructive",
16
+ "link"
17
+ ],
18
+ "default": "default"
19
+ },
20
+ "size": {
21
+ "description": "Component scale; unknown values fall back to default.",
22
+ "options": [
23
+ "sm",
24
+ "default",
25
+ "lg"
26
+ ],
27
+ "default": "default"
28
+ },
29
+ "text": {
30
+ "description": "Visible, escaped label.",
31
+ "default": "Button"
32
+ },
33
+ "href": {
34
+ "description": "Trusted link URL. Omit to render a button."
35
+ },
36
+ "type": {
37
+ "description": "Button type (ignored for links).",
38
+ "options": [
39
+ "button",
40
+ "submit",
41
+ "reset"
42
+ ],
43
+ "default": "button"
44
+ },
45
+ "disabled": {
46
+ "description": "Boolean. Disables a button or removes navigation from a link."
47
+ },
48
+ "ariaLabel": {
49
+ "description": "Optional accessible name."
50
+ },
51
+ "dataPortal": {
52
+ "description": "Optional native Ghost Portal action for enabled links."
53
+ }
54
+ },
55
+ "files": [
56
+ {
57
+ "name": "button.hbs",
58
+ "type": "partial",
59
+ "target": "partials/components/button.hbs",
60
+ "content": "{{!-- Styling parameters: class --}}\n{{#with this as |ghostcnStyles|}}\n{{#if href}}\n<a class=\"ghcn-ui-button{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"secondary\"}}secondary{{else}}{{#match variant \"outline\"}}outline{{else}}{{#match variant \"ghost\"}}ghost{{else}}{{#match variant \"destructive\"}}destructive{{else}}{{#match variant \"link\"}}link{{else}}default{{/match}}{{/match}}{{/match}}{{/match}}{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\" {{#if ariaLabel}}aria-label=\"{{ariaLabel}}\"{{/if}} {{#if id}}id=\"{{id}}\"{{/if}} {{#if disabled}}role=\"link\" aria-disabled=\"true\" tabindex=\"-1\"{{else}}href=\"{{href}}\" {{#if dataPortal}}data-portal=\"{{dataPortal}}\"{{/if}}{{/if}}>{{#if text}}{{text}}{{else}}Button{{/if}}</a>\n{{else}}\n<button class=\"ghcn-ui-button{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"secondary\"}}secondary{{else}}{{#match variant \"outline\"}}outline{{else}}{{#match variant \"ghost\"}}ghost{{else}}{{#match variant \"destructive\"}}destructive{{else}}{{#match variant \"link\"}}link{{else}}default{{/match}}{{/match}}{{/match}}{{/match}}{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\" {{#if ariaLabel}}aria-label=\"{{ariaLabel}}\"{{/if}} {{#if id}}id=\"{{id}}\"{{/if}} type=\"{{#match type \"submit\"}}submit{{else}}{{#match type \"reset\"}}reset{{else}}button{{/match}}{{/match}}\" {{#if disabled}}disabled{{/if}}>{{#if text}}{{text}}{{else}}Button{{/if}}</button>\n{{/if}}\n{{/with}}"
61
+ },
62
+ {
63
+ "name": "button.css",
64
+ "type": "style",
65
+ "target": "assets/css/components/button.css",
66
+ "content": ".ghcn-ui-button { box-sizing: border-box; font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-button, .ghcn-ui-button * { box-sizing: border-box; }\n.ghcn-ui-button:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-button:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-button:focus-visible, .ghcn-ui-button :focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }\n.ghcn-ui-button { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 2.5em; padding: .5em 1em; border: 1px solid transparent; border-radius: var(--radius); background: var(--primary); color: var(--primary-foreground); font-weight: 600; text-decoration: none; cursor: pointer; }\n.ghcn-ui-button:hover { filter: brightness(.94); }\n.ghcn-ui-button:where([data-variant=\"secondary\"]) { background: var(--secondary); color: var(--secondary-foreground); }\n.ghcn-ui-button:where([data-variant=\"outline\"]) { background: transparent; color: var(--foreground); border-color: var(--border); }\n.ghcn-ui-button:where([data-variant=\"ghost\"]), .ghcn-ui-button:where([data-variant=\"link\"]) { background: transparent; color: var(--foreground); }\n.ghcn-ui-button:where([data-variant=\"link\"]) { color: var(--primary); text-decoration: underline; }\n.ghcn-ui-button:where([data-variant=\"destructive\"]) { background: var(--destructive); color: var(--destructive-foreground); }\n.ghcn-ui-button:disabled, .ghcn-ui-button[aria-disabled=\"true\"] { opacity: .5; cursor: not-allowed; filter: none; }\n"
67
+ }
68
+ ],
69
+ "styleSlots": {
70
+ "class": [
71
+ ".ghcn-ui-button"
72
+ ]
73
+ }
74
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "card",
3
+ "type": "components:ui",
4
+ "description": "A composable content card with optional heading, description and footer.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Visual treatment; unknown values fall back to default.",
10
+ "options": [
11
+ "default",
12
+ "secondary",
13
+ "outline"
14
+ ],
15
+ "default": "default"
16
+ },
17
+ "size": {
18
+ "description": "Component scale; unknown values fall back to default.",
19
+ "options": [
20
+ "sm",
21
+ "default",
22
+ "lg"
23
+ ],
24
+ "default": "default"
25
+ },
26
+ "heading": {
27
+ "description": "Optional card heading (h3)."
28
+ },
29
+ "description": {
30
+ "description": "Optional introductory text."
31
+ },
32
+ "body": {
33
+ "description": "Escaped text body when called as an ordinary partial."
34
+ },
35
+ "footer": {
36
+ "description": "Optional escaped footer text."
37
+ }
38
+ },
39
+ "files": [
40
+ {
41
+ "name": "card.hbs",
42
+ "type": "partial",
43
+ "target": "partials/components/card.hbs",
44
+ "content": "{{!-- Styling parameters: class, titleClass, descriptionClass, contentClass, footerClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-ui-card{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"secondary\"}}secondary{{else}}{{#match variant \"outline\"}}outline{{else}}default{{/match}}{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\">\n {{#if heading}}<h3 class=\"ghcn-ui-card__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{heading}}</h3>{{/if}}\n {{#if description}}<p class=\"ghcn-ui-card__description{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\">{{description}}</p>{{/if}}\n <div class=\"ghcn-ui-card__content{{#if ghostcnStyles.contentClass}} {{ghostcnStyles.contentClass}}{{/if}}\">{{#> @partial-block}}{{body}}{{/@partial-block}}</div>\n {{#if footer}}<div class=\"ghcn-ui-card__footer{{#if ghostcnStyles.footerClass}} {{ghostcnStyles.footerClass}}{{/if}}\">{{footer}}</div>{{/if}}\n</div>\n{{/with}}"
45
+ },
46
+ {
47
+ "name": "card.css",
48
+ "type": "style",
49
+ "target": "assets/css/components/card.css",
50
+ "content": ".ghcn-ui-card { box-sizing: border-box; font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-card, .ghcn-ui-card * { box-sizing: border-box; }\n.ghcn-ui-card:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-card:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-card:focus-visible, .ghcn-ui-card :focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }\n.ghcn-ui-card { min-width: 0; padding: 1.5em; background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 2px 6px #0000000d; overflow-wrap: anywhere; }\n.ghcn-ui-card:where([data-variant=\"secondary\"]) { background: var(--secondary); color: var(--secondary-foreground); }\n.ghcn-ui-card:where([data-variant=\"outline\"]) { background: transparent; box-shadow: none; }\n.ghcn-ui-card__title { font-size: 1.25em; line-height: 1.3; margin: 0 0 .5em; color: inherit; }\n.ghcn-ui-card__description { color: inherit; margin: 0 0 1em; }\n.ghcn-ui-card__content:empty { display: none; }\n.ghcn-ui-card__footer { margin-top: 1em; padding-top: 1em; border-top: 1px solid var(--border); }\n"
51
+ }
52
+ ],
53
+ "styleSlots": {
54
+ "class": [
55
+ ".ghcn-ui-card"
56
+ ],
57
+ "titleClass": [
58
+ ".ghcn-ui-card__title"
59
+ ],
60
+ "descriptionClass": [
61
+ ".ghcn-ui-card__description"
62
+ ],
63
+ "contentClass": [
64
+ ".ghcn-ui-card__content"
65
+ ],
66
+ "footerClass": [
67
+ ".ghcn-ui-card__footer"
68
+ ]
69
+ }
70
+ }
@@ -9,7 +9,7 @@
9
9
  "name": "featured-posts.hbs",
10
10
  "type": "partial",
11
11
  "target": "partials/components/featured-posts.hbs",
12
- "content": "{{!-- Component: Featured Posts | Usage: {{> \"components/featured-posts\"}} --}}\n{{#get \"posts\" filter=\"featured:true\" limit=\"3\" include=\"authors,tags\"}}\n{{#if posts}}\n<section class=\"ghcn-featured ghcn-container\" aria-labelledby=\"ghcn-featured-title\">\n <div class=\"ghcn-featured__heading\">\n <div><span class=\"ghcn-badge\">Featured</span><h2 id=\"ghcn-featured-title\">Editor’s picks</h2></div>\n <a href=\"{{@site.url}}\">View all posts <span aria-hidden=\"true\">&rarr;</span></a>\n </div>\n <div class=\"ghcn-featured__grid\">\n {{#foreach posts}}\n <article class=\"ghcn-featured__card{{#has index=\"0\"}} ghcn-featured__card--lead{{/has}}\">\n <a class=\"ghcn-featured__image\" href=\"{{url}}\">\n {{#if feature_image}}<img src=\"{{img_url feature_image size=\"l\"}}\" alt=\"{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}\" loading=\"{{#has index=\"0\"}}eager{{else}}lazy{{/has}}\" />{{/if}}\n </a>\n <div class=\"ghcn-featured__content\">\n <div class=\"ghcn-featured__meta\">{{#if primary_tag}}<a href=\"{{primary_tag.url}}\">{{primary_tag.name}}</a><span>&bull;</span>{{/if}}<span>{{reading_time}}</span></div>\n <h3><a href=\"{{url}}\">{{title}}</a></h3>\n {{#has index=\"0\"}}{{#if excerpt}}<p>{{excerpt words=\"30\"}}</p>{{/if}}{{/has}}\n </div>\n </article>\n {{/foreach}}\n </div>\n</section>\n{{/if}}\n{{/get}}"
12
+ "content": "{{!-- Styling parameters: class, titleClass, gridClass, cardClass, contentClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- Component: Featured Posts | Usage: {{> \"components/featured-posts\"}} --}}\n{{#get \"posts\" filter=\"featured:true\" limit=\"3\" include=\"authors,tags\"}}\n{{#if posts}}\n<section class=\"ghcn-featured{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}} ghcn-container\" aria-label=\"Featured posts\">\n <div class=\"ghcn-featured__heading\">\n <div><span class=\"ghcn-badge\">Featured</span><h2 class=\"ghcn-featured__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">Editor’s picks</h2></div>\n <a href=\"{{@site.url}}\">View all posts <span aria-hidden=\"true\">&rarr;</span></a>\n </div>\n <div class=\"ghcn-featured__grid{{#if ghostcnStyles.gridClass}} {{ghostcnStyles.gridClass}}{{/if}}\">\n {{#foreach posts}}\n <article class=\"ghcn-featured__card{{#if ghostcnStyles.cardClass}} {{ghostcnStyles.cardClass}}{{/if}}{{#has index=\"0\"}} ghcn-featured__card--lead{{/has}}\">\n <a class=\"ghcn-featured__image\" href=\"{{url}}\">\n {{#if feature_image}}<img src=\"{{img_url feature_image size=\"l\"}}\" alt=\"{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}\" loading=\"{{#has index=\"0\"}}eager{{else}}lazy{{/has}}\" />{{/if}}\n </a>\n <div class=\"ghcn-featured__content{{#if ghostcnStyles.contentClass}} {{ghostcnStyles.contentClass}}{{/if}}\">\n <div class=\"ghcn-featured__meta\">{{#if primary_tag}}<a href=\"{{primary_tag.url}}\">{{primary_tag.name}}</a><span>&bull;</span>{{/if}}<span>{{reading_time}}</span></div>\n <h3><a href=\"{{url}}\">{{title}}</a></h3>\n {{#has index=\"0\"}}{{#if excerpt}}<p>{{excerpt words=\"30\"}}</p>{{/if}}{{/has}}\n </div>\n </article>\n {{/foreach}}\n </div>\n</section>\n{{/if}}\n{{/get}}\n{{/with}}"
13
13
  },
14
14
  {
15
15
  "name": "featured-posts.css",
@@ -23,5 +23,22 @@
23
23
  "GS010-PJ-VALID"
24
24
  ],
25
25
  "notes": "Uses the Ghost get helper and featured post filter."
26
+ },
27
+ "styleSlots": {
28
+ "class": [
29
+ ".ghcn-featured"
30
+ ],
31
+ "titleClass": [
32
+ ".ghcn-featured__title"
33
+ ],
34
+ "gridClass": [
35
+ ".ghcn-featured__grid"
36
+ ],
37
+ "cardClass": [
38
+ ".ghcn-featured__card"
39
+ ],
40
+ "contentClass": [
41
+ ".ghcn-featured__content"
42
+ ]
26
43
  }
27
44
  }
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "input",
3
+ "type": "components:ui",
4
+ "description": "An accessible labeled native input, with optional hint and invalid/disabled states.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Visual treatment; unknown values fall back to default.",
10
+ "options": [
11
+ "default",
12
+ "filled"
13
+ ],
14
+ "default": "default"
15
+ },
16
+ "size": {
17
+ "description": "Component scale; unknown values fall back to default.",
18
+ "options": [
19
+ "sm",
20
+ "default",
21
+ "lg"
22
+ ],
23
+ "default": "default"
24
+ },
25
+ "label": {
26
+ "description": "Visible accessible label.",
27
+ "default": "Input"
28
+ },
29
+ "type": {
30
+ "description": "Native input type.",
31
+ "options": [
32
+ "text",
33
+ "email",
34
+ "search",
35
+ "url",
36
+ "number",
37
+ "password"
38
+ ],
39
+ "default": "text"
40
+ },
41
+ "name": {
42
+ "description": "Form field name."
43
+ },
44
+ "value": {
45
+ "description": "Initial field value."
46
+ },
47
+ "placeholder": {
48
+ "description": "Optional placeholder (not a label)."
49
+ },
50
+ "hint": {
51
+ "description": "Optional help text."
52
+ },
53
+ "hintId": {
54
+ "description": "Unique ID for help text; provide with hint for aria-describedby."
55
+ },
56
+ "invalid": {
57
+ "description": "Boolean invalid state."
58
+ },
59
+ "required": {
60
+ "description": "Boolean required state."
61
+ },
62
+ "disabled": {
63
+ "description": "Boolean disabled state."
64
+ }
65
+ },
66
+ "files": [
67
+ {
68
+ "name": "input.hbs",
69
+ "type": "partial",
70
+ "target": "partials/components/input.hbs",
71
+ "content": "{{!-- Styling parameters: class, labelClass, inputClass, descriptionClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-ui-field{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"filled\"}}filled{{else}}default{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\">\n <label class=\"ghcn-ui-field__label\"><span class=\"ghcn-ui-field__label-text{{#if ghostcnStyles.labelClass}} {{ghostcnStyles.labelClass}}{{/if}}\">{{#if label}}{{label}}{{else}}Input{{/if}}{{#if required}} (required){{/if}}</span>\n <input class=\"ghcn-ui-field__input{{#if ghostcnStyles.inputClass}} {{ghostcnStyles.inputClass}}{{/if}}\" type=\"{{#match type \"email\"}}email{{else}}{{#match type \"search\"}}search{{else}}{{#match type \"url\"}}url{{else}}{{#match type \"number\"}}number{{else}}{{#match type \"password\"}}password{{else}}text{{/match}}{{/match}}{{/match}}{{/match}}{{/match}}\" {{#if name}}name=\"{{name}}\"{{/if}} value=\"{{value}}\" placeholder=\"{{placeholder}}\" {{#if required}}required{{/if}} {{#if disabled}}disabled{{/if}} {{#if invalid}}aria-invalid=\"true\"{{/if}} {{#if hintId}}aria-describedby=\"{{hintId}}\"{{/if}} />\n </label>\n {{#if hint}}<p class=\"ghcn-ui-field__hint{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\" {{#if hintId}}id=\"{{hintId}}\"{{/if}}>{{hint}}</p>{{/if}}\n</div>\n{{/with}}"
72
+ },
73
+ {
74
+ "name": "input.css",
75
+ "type": "style",
76
+ "target": "assets/css/components/input.css",
77
+ "content": ".ghcn-ui-field { box-sizing: border-box; font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-field, .ghcn-ui-field * { box-sizing: border-box; }\n.ghcn-ui-field:where([data-size=\"sm\"]) { font-size: 14px; }\n.ghcn-ui-field:where([data-size=\"lg\"]) { font-size: 18px; }\n.ghcn-ui-field:focus-visible, .ghcn-ui-field :focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }\n.ghcn-ui-field { width: 100%; }\n.ghcn-ui-field__label { display: grid; gap: .375em; font-weight: 500; }\n.ghcn-ui-field__input { width: 100%; min-width: 0; min-height: 2.5em; padding: .5em .75em; border: 1px solid var(--input); border-radius: var(--radius); background: var(--background); color: var(--foreground); font: inherit; }\n:where(.ghcn-ui-field[data-variant=\"filled\"]) .ghcn-ui-field__input { background: var(--muted); }\n.ghcn-ui-field__input::placeholder { color: var(--muted-foreground); }\n.ghcn-ui-field__input[aria-invalid=\"true\"] { border-color: var(--destructive); }\n.ghcn-ui-field__input:disabled { opacity: .5; cursor: not-allowed; }\n.ghcn-ui-field__hint { color: var(--muted-foreground); font-size: .875em; margin: .5em 0 0; }\n"
78
+ }
79
+ ],
80
+ "styleSlots": {
81
+ "class": [
82
+ ".ghcn-ui-field"
83
+ ],
84
+ "labelClass": [
85
+ ".ghcn-ui-field__label-text"
86
+ ],
87
+ "inputClass": [
88
+ ".ghcn-ui-field__input"
89
+ ],
90
+ "descriptionClass": [
91
+ ".ghcn-ui-field__hint"
92
+ ]
93
+ }
94
+ }