ghostcn 1.5.0 → 1.7.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 (88) hide show
  1. package/dist/commands/create.js +10 -3
  2. package/dist/commands/diff.js +47 -5
  3. package/dist/commands/init.js +17 -8
  4. package/dist/commands/list.js +22 -4
  5. package/dist/registry/components/accordion.json +66 -0
  6. package/dist/registry/components/account-card.json +57 -0
  7. package/dist/registry/components/announcement-bar.json +79 -0
  8. package/dist/registry/components/archive-header.json +1 -1
  9. package/dist/registry/components/author-card.json +2 -2
  10. package/dist/registry/components/author-list.json +1 -1
  11. package/dist/registry/components/author-stack.json +63 -0
  12. package/dist/registry/components/avatar.json +62 -0
  13. package/dist/registry/components/back-to-top.json +72 -0
  14. package/dist/registry/components/breadcrumbs.json +59 -0
  15. package/dist/registry/components/button.json +1 -1
  16. package/dist/registry/components/callout.json +56 -0
  17. package/dist/registry/components/checkbox.json +82 -0
  18. package/dist/registry/components/code-copy.json +52 -0
  19. package/dist/registry/components/comments-section.json +56 -0
  20. package/dist/registry/components/dialog.json +83 -0
  21. package/dist/registry/components/dropdown.json +85 -0
  22. package/dist/registry/components/empty-state.json +65 -0
  23. package/dist/registry/components/error-card.json +74 -0
  24. package/dist/registry/components/faq-section.json +83 -0
  25. package/dist/registry/components/featured-posts.json +2 -2
  26. package/dist/registry/components/hero.json +89 -0
  27. package/dist/registry/components/image-lightbox.json +44 -0
  28. package/dist/registry/components/input.json +8 -2
  29. package/dist/registry/components/magazine-grid.json +62 -0
  30. package/dist/registry/components/member-cta.json +1 -1
  31. package/dist/registry/components/mobile-dock.json +69 -0
  32. package/dist/registry/components/newsletter-form.json +12 -3
  33. package/dist/registry/components/pagination.json +2 -2
  34. package/dist/registry/components/post-card.json +2 -2
  35. package/dist/registry/components/post-grid.json +2 -2
  36. package/dist/registry/components/post-header.json +2 -2
  37. package/dist/registry/components/post-list.json +62 -0
  38. package/dist/registry/components/pricing-table.json +24 -4
  39. package/dist/registry/components/pull-quote.json +70 -0
  40. package/dist/registry/components/radio-group.json +94 -0
  41. package/dist/registry/components/reader-controls.json +60 -0
  42. package/dist/registry/components/reading-meta.json +49 -0
  43. package/dist/registry/components/reading-progress.json +73 -0
  44. package/dist/registry/components/related-posts.json +7 -1
  45. package/dist/registry/components/search-trigger.json +68 -0
  46. package/dist/registry/components/select.json +94 -0
  47. package/dist/registry/components/separator.json +46 -0
  48. package/dist/registry/components/series-nav.json +62 -0
  49. package/dist/registry/components/share-buttons.json +76 -0
  50. package/dist/registry/components/site-footer.json +2 -2
  51. package/dist/registry/components/site-header.json +1 -1
  52. package/dist/registry/components/skeleton.json +48 -0
  53. package/dist/registry/components/skip-link.json +53 -0
  54. package/dist/registry/components/social-links.json +74 -0
  55. package/dist/registry/components/stat-strip.json +85 -0
  56. package/dist/registry/components/sticky-subscribe.json +82 -0
  57. package/dist/registry/components/subscribe-bar.json +61 -0
  58. package/dist/registry/components/switch.json +76 -0
  59. package/dist/registry/components/table-of-contents.json +12 -2
  60. package/dist/registry/components/tabs.json +81 -0
  61. package/dist/registry/components/tag-bar.json +63 -0
  62. package/dist/registry/components/tag-grid.json +1 -1
  63. package/dist/registry/components/tag-list.json +1 -1
  64. package/dist/registry/components/textarea.json +95 -0
  65. package/dist/registry/components/theme-toggle.json +65 -0
  66. package/dist/registry/components/tier-comparison.json +55 -0
  67. package/dist/registry/components/timeline.json +85 -0
  68. package/dist/registry/components/tooltip.json +65 -0
  69. package/dist/registry/components/visibility-badge.json +71 -0
  70. package/dist/registry/index.json +478 -4
  71. package/dist/templates/playground/index.html +2 -2
  72. package/dist/templates/playground/playground.css +8 -1
  73. package/dist/templates/playground/playground.js +39 -5
  74. package/dist/templates/playground/preview.css +1 -0
  75. package/dist/templates/theme-tools.mjs +62 -24
  76. package/dist/utils/component-diff.d.ts +1 -1
  77. package/dist/utils/component-diff.js +46 -17
  78. package/dist/utils/component-files.js +3 -2
  79. package/dist/utils/component-history.js +1 -1
  80. package/dist/utils/playground-server.js +40 -12
  81. package/dist/utils/preview-renderer.d.ts +77 -0
  82. package/dist/utils/preview-renderer.js +68 -8
  83. package/dist/utils/registry.js +15 -5
  84. package/dist/utils/theme-files.js +14 -7
  85. package/dist/utils/theme-project.js +6 -4
  86. package/dist/utils/theme-scaffold.js +22 -7
  87. package/dist/utils/theme.js +39 -32
  88. package/package.json +1 -1
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "pull-quote",
3
+ "type": "components:content",
4
+ "description": "Editorial pull quote and reader testimonial block with accent rule, optional avatar, and centered/card variants.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Quote layout: default, centered, or card.",
10
+ "options": [
11
+ "default",
12
+ "centered",
13
+ "card"
14
+ ],
15
+ "default": "default"
16
+ },
17
+ "size": {
18
+ "description": "Typography scale: sm, default, or lg.",
19
+ "options": [
20
+ "sm",
21
+ "default",
22
+ "lg"
23
+ ],
24
+ "default": "default"
25
+ },
26
+ "quote": {
27
+ "description": "Escaped quote text (or pass rich HTML as a partial block)."
28
+ },
29
+ "attribution": {
30
+ "description": "Attribution name."
31
+ },
32
+ "role": {
33
+ "description": "Optional publication, title, or source."
34
+ },
35
+ "avatar": {
36
+ "description": "Optional author avatar image URL."
37
+ }
38
+ },
39
+ "files": [
40
+ {
41
+ "name": "pull-quote.hbs",
42
+ "type": "partial",
43
+ "target": "partials/components/pull-quote.hbs",
44
+ "content": "{{!-- Styling parameters: class, quoteClass, citeClass --}}\n{{#with this as |ghostcnStyles|}}\n<figure class=\"ghcn-pull-quote{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"centered\"}}centered{{else}}{{#match variant \"card\"}}card{{else}}default{{/match}}{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\">\n <svg class=\"ghcn-pull-quote__mark\" aria-hidden=\"true\" viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" fill=\"currentColor\"><path d=\"M9.98 6.5c-2.6 1.24-4.18 3.38-4.44 6.13.45-.18.96-.28 1.5-.28 1.98 0 3.46 1.46 3.46 3.44 0 2.02-1.56 3.6-3.66 3.6-2.46 0-4.24-1.94-4.24-4.96 0-4.28 2.46-7.68 6.5-9.53l.88 1.6Zm10.5 0c-2.6 1.24-4.18 3.38-4.44 6.13.45-.18.96-.28 1.5-.28 1.98 0 3.46 1.46 3.46 3.44 0 2.02-1.56 3.6-3.66 3.6-2.46 0-4.24-1.94-4.24-4.96 0-4.28 2.46-7.68 6.5-9.53l.88 1.6Z\"/></svg>\n <blockquote class=\"ghcn-pull-quote__text{{#if ghostcnStyles.quoteClass}} {{ghostcnStyles.quoteClass}}{{/if}}\">\n {{#> @partial-block}}{{#if quote}}<p>{{quote}}</p>{{else}}<p>Independent publishing works best when the design gets out of the way and lets ideas breathe.</p>{{/if}}{{/@partial-block}}\n </blockquote>\n <figcaption class=\"ghcn-pull-quote__cite{{#if ghostcnStyles.citeClass}} {{ghostcnStyles.citeClass}}{{/if}}\">\n {{#if avatar}}<img class=\"ghcn-pull-quote__avatar\" src=\"{{img_url avatar size=\"xs\"}}\" alt=\"{{#if attribution}}{{attribution}}{{else}}Reader{{/if}}\" loading=\"lazy\" />{{/if}}\n <span class=\"ghcn-pull-quote__meta\">\n <strong class=\"ghcn-pull-quote__author\">{{#if attribution}}{{attribution}}{{else}}Alex Reader{{/if}}</strong>\n {{#if role}}<span class=\"ghcn-pull-quote__role\">{{role}}</span>{{/if}}\n </span>\n </figcaption>\n</figure>\n{{/with}}"
45
+ },
46
+ {
47
+ "name": "pull-quote.css",
48
+ "type": "style",
49
+ "target": "assets/css/components/pull-quote.css",
50
+ "content": ".ghcn-pull-quote { box-sizing: border-box; margin: var(--ghcn-section-space, clamp(24px, 4vw, 48px)) 0; padding: 6px 0 6px 22px; border-left: 3px solid var(--primary); font-family: inherit; color: var(--foreground); }\n.ghcn-pull-quote *, .ghcn-pull-quote *::before, .ghcn-pull-quote *::after { box-sizing: border-box; }\n.ghcn-pull-quote__mark { display: block; margin-bottom: 10px; color: var(--primary); opacity: .75; }\n.ghcn-pull-quote__text { margin: 0; font-size: clamp(19px, 2.2vw, 24px); font-weight: 500; line-height: 1.45; letter-spacing: -.018em; color: var(--foreground); }\n.ghcn-pull-quote__text p { margin: 0; }\n.ghcn-pull-quote__cite { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13.5px; color: var(--muted-foreground); }\n.ghcn-pull-quote__avatar { width: 32px; height: 32px; border-radius: 9999px; object-fit: cover; border: 1px solid var(--border); }\n.ghcn-pull-quote__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }\n.ghcn-pull-quote__author { color: var(--foreground); font-weight: 600; }\n.ghcn-pull-quote__role { color: var(--muted-foreground); }\n.ghcn-pull-quote:where([data-variant=\"centered\"]) { border-left: 0; border-block: 1px solid var(--border); padding: 28px 16px; text-align: center; }\n.ghcn-pull-quote:where([data-variant=\"centered\"]) .ghcn-pull-quote__mark { margin-inline: auto; }\n.ghcn-pull-quote:where([data-variant=\"centered\"]) .ghcn-pull-quote__text { max-width: 44ch; margin-inline: auto; }\n.ghcn-pull-quote:where([data-variant=\"centered\"]) .ghcn-pull-quote__cite { justify-content: center; }\n.ghcn-pull-quote:where([data-variant=\"card\"]) { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b); border-left: 1px solid var(--border); padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px)); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }\n.ghcn-pull-quote:where([data-size=\"sm\"]) .ghcn-pull-quote__text { font-size: 16.5px; }\n.ghcn-pull-quote:where([data-size=\"lg\"]) .ghcn-pull-quote__text { font-size: clamp(22px, 3vw, 30px); line-height: 1.35; }"
51
+ }
52
+ ],
53
+ "gscan": {
54
+ "rules_satisfied": [
55
+ "GS010-PJ-VALID"
56
+ ],
57
+ "notes": "Pure CSS editorial blockquote supporting plain text or nested partial blocks."
58
+ },
59
+ "styleSlots": {
60
+ "class": [
61
+ ".ghcn-pull-quote"
62
+ ],
63
+ "quoteClass": [
64
+ ".ghcn-pull-quote__text"
65
+ ],
66
+ "citeClass": [
67
+ ".ghcn-pull-quote__cite"
68
+ ]
69
+ }
70
+ }
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "radio-group",
3
+ "type": "components:ui",
4
+ "description": "Accessible native radio button group with default and selectable card styles.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Presentation: default or card.",
10
+ "options": [
11
+ "default",
12
+ "card"
13
+ ],
14
+ "default": "default"
15
+ },
16
+ "size": {
17
+ "description": "Control scale: sm, default, or lg.",
18
+ "options": [
19
+ "sm",
20
+ "default",
21
+ "lg"
22
+ ],
23
+ "default": "default"
24
+ },
25
+ "legend": {
26
+ "description": "Group heading label.",
27
+ "default": "Delivery frequency"
28
+ },
29
+ "name": {
30
+ "description": "Shared native radio group name.",
31
+ "default": "ghcn-radio"
32
+ },
33
+ "option1": {
34
+ "description": "First option label.",
35
+ "default": "Every new post"
36
+ },
37
+ "option1Desc": {
38
+ "description": "Optional first option description."
39
+ },
40
+ "option1Value": {
41
+ "description": "Optional first option value."
42
+ },
43
+ "option2": {
44
+ "description": "Second option label.",
45
+ "default": "Weekly Sunday digest"
46
+ },
47
+ "option2Desc": {
48
+ "description": "Optional second option description."
49
+ },
50
+ "option2Value": {
51
+ "description": "Optional second option value."
52
+ },
53
+ "option3": {
54
+ "description": "Optional third option label."
55
+ },
56
+ "option3Desc": {
57
+ "description": "Optional third option description."
58
+ },
59
+ "option3Value": {
60
+ "description": "Optional third option value."
61
+ }
62
+ },
63
+ "files": [
64
+ {
65
+ "name": "radio-group.hbs",
66
+ "type": "partial",
67
+ "target": "partials/components/radio-group.hbs",
68
+ "content": "{{!-- Styling parameters: class, legendClass, optionClass --}}\n{{#with this as |ghostcnStyles|}}\n<fieldset class=\"ghcn-ui-radio{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"card\"}}card{{else}}default{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\">\n <legend class=\"ghcn-ui-radio__legend{{#if ghostcnStyles.legendClass}} {{ghostcnStyles.legendClass}}{{/if}}\">{{#if legend}}{{legend}}{{else}}Delivery frequency{{/if}}</legend>\n <div class=\"ghcn-ui-radio__options\">\n <label class=\"ghcn-ui-radio__option{{#if ghostcnStyles.optionClass}} {{ghostcnStyles.optionClass}}{{/if}}\">\n <span class=\"ghcn-ui-radio__control\">\n <input class=\"ghcn-ui-radio__input\" type=\"radio\" name=\"{{#if name}}{{name}}{{else}}ghcn-radio{{/if}}\" value=\"{{#if option1Value}}{{option1Value}}{{else}}option-1{{/if}}\" checked />\n <span class=\"ghcn-ui-radio__dot\" aria-hidden=\"true\"></span>\n </span>\n <span class=\"ghcn-ui-radio__copy\">\n <span class=\"ghcn-ui-radio__label\">{{#if option1}}{{option1}}{{else}}Every new post{{/if}}</span>\n {{#if option1Desc}}<span class=\"ghcn-ui-radio__desc\">{{option1Desc}}</span>{{/if}}\n </span>\n </label>\n <label class=\"ghcn-ui-radio__option{{#if ghostcnStyles.optionClass}} {{ghostcnStyles.optionClass}}{{/if}}\">\n <span class=\"ghcn-ui-radio__control\">\n <input class=\"ghcn-ui-radio__input\" type=\"radio\" name=\"{{#if name}}{{name}}{{else}}ghcn-radio{{/if}}\" value=\"{{#if option2Value}}{{option2Value}}{{else}}option-2{{/if}}\" />\n <span class=\"ghcn-ui-radio__dot\" aria-hidden=\"true\"></span>\n </span>\n <span class=\"ghcn-ui-radio__copy\">\n <span class=\"ghcn-ui-radio__label\">{{#if option2}}{{option2}}{{else}}Weekly Sunday digest{{/if}}</span>\n {{#if option2Desc}}<span class=\"ghcn-ui-radio__desc\">{{option2Desc}}</span>{{/if}}\n </span>\n </label>\n {{#if option3}}\n <label class=\"ghcn-ui-radio__option{{#if ghostcnStyles.optionClass}} {{ghostcnStyles.optionClass}}{{/if}}\">\n <span class=\"ghcn-ui-radio__control\">\n <input class=\"ghcn-ui-radio__input\" type=\"radio\" name=\"{{#if name}}{{name}}{{else}}ghcn-radio{{/if}}\" value=\"{{#if option3Value}}{{option3Value}}{{else}}option-3{{/if}}\" />\n <span class=\"ghcn-ui-radio__dot\" aria-hidden=\"true\"></span>\n </span>\n <span class=\"ghcn-ui-radio__copy\">\n <span class=\"ghcn-ui-radio__label\">{{option3}}</span>\n {{#if option3Desc}}<span class=\"ghcn-ui-radio__desc\">{{option3Desc}}</span>{{/if}}\n </span>\n </label>\n {{/if}}\n </div>\n</fieldset>\n{{/with}}"
69
+ },
70
+ {
71
+ "name": "radio-group.css",
72
+ "type": "style",
73
+ "target": "assets/css/components/radio-group.css",
74
+ "content": ".ghcn-ui-radio { box-sizing: border-box; margin: 0; padding: 0; border: 0; width: 100%; font-family: inherit; font-size: var(--ghcn-text-small, 14px); color: var(--foreground); }\n.ghcn-ui-radio *, .ghcn-ui-radio *::before, .ghcn-ui-radio *::after { box-sizing: border-box; }\n.ghcn-ui-radio__legend { padding: 0; margin-bottom: 10px; font-size: 13.5px; font-weight: 600; color: var(--foreground); }\n.ghcn-ui-radio__options { display: grid; gap: 10px; }\n.ghcn-ui-radio__option { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }\n.ghcn-ui-radio:where([data-variant=\"card\"]) .ghcn-ui-radio__option { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b); padding: 13px 15px; transition: border-color 150ms ease, background-color 150ms ease; }\n.ghcn-ui-radio:where([data-variant=\"card\"]) .ghcn-ui-radio__option:hover { border-color: color-mix(in srgb, var(--foreground) 22%, var(--border)); }\n.ghcn-ui-radio:where([data-variant=\"card\"]) .ghcn-ui-radio__option:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--card)); }\n.ghcn-ui-radio__control { position: relative; flex: 0 0 auto; margin-top: 2px; display: inline-flex; }\n.ghcn-ui-radio__input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; }\n.ghcn-ui-radio__dot { width: 18px; height: 18px; border-radius: 9999px; border: 1.5px solid var(--input, var(--border)); background: var(--background); display: grid; place-items: center; transition: border-color 150ms ease; }\n.ghcn-ui-radio__dot::after { content: \"\"; width: 8px; height: 8px; border-radius: 9999px; background: var(--primary); transform: scale(0); transition: transform 140ms ease; }\n.ghcn-ui-radio__input:checked + .ghcn-ui-radio__dot { border-color: var(--primary); }\n.ghcn-ui-radio__input:checked + .ghcn-ui-radio__dot::after { transform: scale(1); }\n.ghcn-ui-radio__input:focus-visible + .ghcn-ui-radio__dot { outline: 2px solid var(--ring, var(--primary)); outline-offset: 2px; }\n.ghcn-ui-radio__copy { display: grid; gap: 2px; min-width: 0; }\n.ghcn-ui-radio__label { font-weight: 500; line-height: 1.4; color: var(--foreground); }\n.ghcn-ui-radio__desc { font-size: 12.5px; line-height: 1.45; color: var(--muted-foreground); }\n.ghcn-ui-radio:where([data-size=\"sm\"]) { font-size: 13px; }\n.ghcn-ui-radio:where([data-size=\"sm\"]) .ghcn-ui-radio__dot { width: 16px; height: 16px; }\n.ghcn-ui-radio:where([data-size=\"sm\"]) .ghcn-ui-radio__dot::after { width: 6px; height: 6px; }\n.ghcn-ui-radio:where([data-size=\"lg\"]) { font-size: 15px; }\n.ghcn-ui-radio:where([data-size=\"lg\"]) .ghcn-ui-radio__dot { width: 20px; height: 20px; }\n.ghcn-ui-radio:where([data-size=\"lg\"]) .ghcn-ui-radio__dot::after { width: 10px; height: 10px; }"
75
+ }
76
+ ],
77
+ "gscan": {
78
+ "rules_satisfied": [
79
+ "GS010-PJ-VALID"
80
+ ],
81
+ "notes": "Zero-JS semantic fieldset/legend native radio group."
82
+ },
83
+ "styleSlots": {
84
+ "class": [
85
+ ".ghcn-ui-radio"
86
+ ],
87
+ "legendClass": [
88
+ ".ghcn-ui-radio__legend"
89
+ ],
90
+ "optionClass": [
91
+ ".ghcn-ui-radio__option"
92
+ ]
93
+ }
94
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "reader-controls",
3
+ "type": "components:content",
4
+ "description": "Compact reading comfort toolbar letting readers adjust article font size and serif/sans typeface with localStorage persistence.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Toolbar style: default, outline, or compact.",
10
+ "options": [
11
+ "default",
12
+ "outline",
13
+ "compact"
14
+ ],
15
+ "default": "default"
16
+ },
17
+ "contentSelector": {
18
+ "description": "CSS selector of the article body container to style.",
19
+ "default": ".ghcn-article-content"
20
+ },
21
+ "ariaLabel": {
22
+ "description": "Accessible toolbar label.",
23
+ "default": "Reading display preferences"
24
+ }
25
+ },
26
+ "files": [
27
+ {
28
+ "name": "reader-controls.hbs",
29
+ "type": "partial",
30
+ "target": "partials/components/reader-controls.hbs",
31
+ "content": "{{!-- Styling parameters: class, buttonClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-reader-controls{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-ghcn-reader-controls data-variant=\"{{#match variant \"outline\"}}outline{{else}}{{#match variant \"compact\"}}compact{{else}}default{{/match}}{{/match}}\" data-content-selector=\"{{#if contentSelector}}{{contentSelector}}{{else}}.ghcn-article-content{{/if}}\" role=\"toolbar\" aria-label=\"{{#if ariaLabel}}{{ariaLabel}}{{else}}Reading display preferences{{/if}}\">\n <div class=\"ghcn-reader-controls__group\" role=\"group\" aria-label=\"Text size\">\n <button type=\"button\" class=\"ghcn-reader-controls__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" data-reader-size=\"sm\" aria-label=\"Smaller text\" aria-pressed=\"false\">A-</button>\n <button type=\"button\" class=\"ghcn-reader-controls__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" data-reader-size=\"md\" aria-label=\"Default text size\" aria-pressed=\"true\">A</button>\n <button type=\"button\" class=\"ghcn-reader-controls__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" data-reader-size=\"lg\" aria-label=\"Larger text\" aria-pressed=\"false\">A+</button>\n </div>\n <span class=\"ghcn-reader-controls__divider\" aria-hidden=\"true\"></span>\n <div class=\"ghcn-reader-controls__group\" role=\"group\" aria-label=\"Typeface\">\n <button type=\"button\" class=\"ghcn-reader-controls__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" data-reader-font=\"sans\" aria-pressed=\"true\">Sans</button>\n <button type=\"button\" class=\"ghcn-reader-controls__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}} ghcn-reader-controls__btn--serif\" data-reader-font=\"serif\" aria-pressed=\"false\">Serif</button>\n </div>\n</div>\n{{/with}}"
32
+ },
33
+ {
34
+ "name": "reader-controls.css",
35
+ "type": "style",
36
+ "target": "assets/css/components/reader-controls.css",
37
+ "content": ".ghcn-reader-controls { box-sizing: border-box; display: inline-flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid var(--border); border-radius: 9999px; background: var(--secondary); color: var(--foreground); font-family: inherit; font-size: 13px; line-height: 1; }\n.ghcn-reader-controls *, .ghcn-reader-controls *::before, .ghcn-reader-controls *::after { box-sizing: border-box; }\n.ghcn-reader-controls:where([data-variant=\"outline\"]) { background: var(--card, var(--background)); border-radius: var(--ghcn-control-radius, var(--radius, 8px)); }\n.ghcn-reader-controls:where([data-variant=\"compact\"]) { padding: 2px; gap: 4px; font-size: 12px; }\n.ghcn-reader-controls__group { display: inline-flex; align-items: center; gap: 2px; }\n.ghcn-reader-controls__divider { width: 1px; height: 18px; background: var(--border); }\n.ghcn-reader-controls__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 9px; border: 1px solid transparent; border-radius: 9999px; background: transparent; color: var(--muted-foreground); font: inherit; font-weight: 600; cursor: pointer; transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease; }\n.ghcn-reader-controls:where([data-variant=\"outline\"]) .ghcn-reader-controls__btn { border-radius: calc(var(--ghcn-control-radius, var(--radius, 8px)) - 2px); }\n.ghcn-reader-controls:where([data-variant=\"compact\"]) .ghcn-reader-controls__btn { min-width: 26px; height: 24px; padding: 0 7px; }\n.ghcn-reader-controls__btn--serif { font-family: Georgia, Cambria, \"Times New Roman\", Times, serif; }\n.ghcn-reader-controls__btn:hover { color: var(--foreground); }\n.ghcn-reader-controls__btn[aria-pressed=\"true\"] { background: var(--background); color: var(--foreground); border-color: var(--border); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }\n[data-ghcn-font-size=\"sm\"] { font-size: 15px; line-height: 1.65; }\n[data-ghcn-font-size=\"md\"] { font-size: 17px; line-height: 1.72; }\n[data-ghcn-font-size=\"lg\"] { font-size: 20px; line-height: 1.78; }\n[data-ghcn-font-family=\"serif\"] { font-family: Georgia, Cambria, \"Times New Roman\", Times, serif; }\n[data-ghcn-font-family=\"sans\"] { font-family: inherit; }\n.ghcn-reader-controls:focus-visible, :where(.ghcn-reader-controls) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }"
38
+ },
39
+ {
40
+ "name": "reader-controls.js",
41
+ "type": "js",
42
+ "target": "assets/js/components/reader-controls.js",
43
+ "content": "/* ghostcn reader-controls: persists article font size and serif/sans toggle via data attributes (CSP-safe). */\n(() => {\n const SIZE_KEY = 'ghcn-reader-size';\n const FONT_KEY = 'ghcn-reader-font';\n const SIZES = ['sm', 'md', 'lg'];\n\n function readStore(key, allowed, fallback) {\n try {\n const value = localStorage.getItem(key);\n if (allowed.includes(value)) return value;\n } catch {}\n return fallback;\n }\n\n function apply(root, size, font, persist) {\n const selector = root.dataset.contentSelector || '.ghcn-article-content';\n const target = root.parentElement?.querySelector(selector) || document.querySelector(selector);\n if (target) {\n target.dataset.ghcnFontSize = size;\n target.dataset.ghcnFontFamily = font;\n }\n if (persist) {\n try { localStorage.setItem(SIZE_KEY, size); localStorage.setItem(FONT_KEY, font); } catch {}\n }\n root.dataset.sizeValue = size;\n root.dataset.fontValue = font;\n root.querySelectorAll('[data-reader-size]').forEach(btn => {\n btn.setAttribute('aria-pressed', String(btn.dataset.readerSize === size));\n });\n root.querySelectorAll('[data-reader-font]').forEach(btn => {\n btn.setAttribute('aria-pressed', String(btn.dataset.readerFont === font));\n });\n }\n\n function init() {\n const initialSize = readStore(SIZE_KEY, SIZES, 'md');\n const initialFont = readStore(FONT_KEY, ['sans', 'serif'], 'sans');\n document.querySelectorAll('[data-ghcn-reader-controls]').forEach(root => {\n if (root.dataset.ghcnReaderReady) return;\n root.dataset.ghcnReaderReady = 'true';\n apply(root, initialSize, initialFont, false);\n root.querySelectorAll('[data-reader-size]').forEach(btn => {\n btn.addEventListener('click', () => {\n const next = btn.dataset.readerSize;\n if (SIZES.includes(next)) apply(root, next, root.dataset.fontValue || 'sans', true);\n });\n });\n root.querySelectorAll('[data-reader-font]').forEach(btn => {\n btn.addEventListener('click', () => {\n const next = btn.dataset.readerFont;\n if (next === 'sans' || next === 'serif') apply(root, root.dataset.sizeValue || 'md', next, true);\n });\n });\n });\n }\n\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true });\n else init();\n})();"
44
+ }
45
+ ],
46
+ "gscan": {
47
+ "rules_satisfied": [
48
+ "GS010-PJ-VALID"
49
+ ],
50
+ "notes": "CSP-safe data-attribute toggles persisted in localStorage; zero external dependencies."
51
+ },
52
+ "styleSlots": {
53
+ "class": [
54
+ ".ghcn-reader-controls"
55
+ ],
56
+ "buttonClass": [
57
+ ".ghcn-reader-controls__btn"
58
+ ]
59
+ }
60
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "reading-meta",
3
+ "type": "components:content",
4
+ "description": "Reusable post metadata row with author, date, reading time, and optional tag or comment count.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Metadata display style.",
10
+ "options": [
11
+ "default",
12
+ "compact",
13
+ "pill"
14
+ ],
15
+ "default": "default"
16
+ }
17
+ },
18
+ "files": [
19
+ {
20
+ "name": "reading-meta.hbs",
21
+ "type": "partial",
22
+ "target": "partials/components/reading-meta.hbs",
23
+ "content": "{{!-- Styling parameters: class, authorClass, tagClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-reading-meta{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"compact\"}}compact{{else}}{{#match variant \"pill\"}}pill{{else}}default{{/match}}{{/match}}\">\n {{#primary_author}}\n <a class=\"ghcn-reading-meta__author{{#if ghostcnStyles.authorClass}} {{ghostcnStyles.authorClass}}{{/if}}\" href=\"{{url}}\">\n {{#if profile_image}}<img class=\"ghcn-reading-meta__avatar\" src=\"{{img_url profile_image size=\"xs\"}}\" alt=\"\" loading=\"lazy\" />{{else}}<span class=\"ghcn-reading-meta__avatar ghcn-reading-meta__avatar--fallback\" aria-hidden=\"true\">{{name.[0]}}</span>{{/if}}\n <span>{{name}}</span>\n </a>\n <span class=\"ghcn-reading-meta__sep\" aria-hidden=\"true\">&bull;</span>\n {{/primary_author}}\n <time class=\"ghcn-reading-meta__date\" datetime=\"{{date format=\"YYYY-MM-DD\"}}\">{{date format=\"D MMM YYYY\"}}</time>\n <span class=\"ghcn-reading-meta__sep\" aria-hidden=\"true\">&bull;</span>\n <span class=\"ghcn-reading-meta__time\">{{reading_time}}</span>\n {{#if primary_tag}}\n <span class=\"ghcn-reading-meta__sep\" aria-hidden=\"true\">&bull;</span>\n <a class=\"ghcn-reading-meta__tag{{#if ghostcnStyles.tagClass}} {{ghostcnStyles.tagClass}}{{/if}}\" href=\"{{primary_tag.url}}\">{{primary_tag.name}}</a>\n {{/if}}\n {{#if @site.comments_enabled}}{{#if comments}}\n <span class=\"ghcn-reading-meta__sep\" aria-hidden=\"true\">&bull;</span>\n <span class=\"ghcn-reading-meta__comments\">{{comment_count empty=\"0 comments\" singular=\"1 comment\" plural=\"% comments\"}}</span>\n {{/if}}{{/if}}\n</div>\n{{/with}}"
24
+ },
25
+ {
26
+ "name": "reading-meta.css",
27
+ "type": "style",
28
+ "target": "assets/css/components/reading-meta.css",
29
+ "content": ".ghcn-reading-meta { box-sizing: border-box; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted-foreground); font-family: inherit; font-size: var(--ghcn-text-meta, 13px); line-height: 1.4; font-variant-numeric: tabular-nums; }\n.ghcn-reading-meta *, .ghcn-reading-meta *::before, .ghcn-reading-meta *::after { box-sizing: border-box; }\n.ghcn-reading-meta:where([data-variant=\"compact\"]) { font-size: 12px; gap: 4px 8px; }\n.ghcn-reading-meta:where([data-variant=\"pill\"]) { display: inline-flex; padding: 6px 14px; border: 1px solid var(--border); border-radius: 9999px; background: var(--card); }\n.ghcn-reading-meta__author { display: inline-flex; align-items: center; gap: 8px; color: var(--foreground); font-weight: 600; text-decoration: none; }\n.ghcn-reading-meta__author:hover { text-decoration: underline; text-underline-offset: 3px; }\n.ghcn-reading-meta__avatar { width: 24px; height: 24px; border-radius: 9999px; object-fit: cover; flex: 0 0 auto; }\n.ghcn-reading-meta__avatar--fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--secondary); color: var(--secondary-foreground); font-size: 11px; font-weight: 700; text-transform: uppercase; border: 1px solid var(--border); }\n.ghcn-reading-meta:where([data-variant=\"compact\"]) .ghcn-reading-meta__avatar { display: none; }\n.ghcn-reading-meta__sep { color: color-mix(in srgb, var(--muted-foreground) 45%, transparent); }\n.ghcn-reading-meta__tag { color: var(--foreground); font-weight: 600; text-decoration: none; }\n.ghcn-reading-meta__tag:hover { text-decoration: underline; text-underline-offset: 3px; }\n.ghcn-reading-meta:focus-visible, :where(.ghcn-reading-meta) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n"
30
+ }
31
+ ],
32
+ "gscan": {
33
+ "rules_satisfied": [
34
+ "GS010-PJ-VALID"
35
+ ],
36
+ "notes": "Uses native Ghost content and site helpers."
37
+ },
38
+ "styleSlots": {
39
+ "class": [
40
+ ".ghcn-reading-meta"
41
+ ],
42
+ "authorClass": [
43
+ ".ghcn-reading-meta__author"
44
+ ],
45
+ "tagClass": [
46
+ ".ghcn-reading-meta__tag"
47
+ ]
48
+ }
49
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "reading-progress",
3
+ "type": "components:content",
4
+ "description": "Thin scroll-linked reading progress bar tracking article scroll depth.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Progress bar fill style.",
10
+ "options": [
11
+ "default",
12
+ "subtle",
13
+ "gradient"
14
+ ],
15
+ "default": "default"
16
+ },
17
+ "size": {
18
+ "description": "Bar thickness (2px, 3px, or 5px).",
19
+ "options": [
20
+ "sm",
21
+ "default",
22
+ "lg"
23
+ ],
24
+ "default": "default"
25
+ },
26
+ "contentSelector": {
27
+ "description": "CSS selector for the article element to track.",
28
+ "default": ".ghcn-article-content"
29
+ },
30
+ "ariaLabel": {
31
+ "description": "Accessible label for the progress bar.",
32
+ "default": "Reading progress"
33
+ },
34
+ "initialValue": {
35
+ "description": "Optional initial percentage (0-100) for static previews.",
36
+ "default": "0"
37
+ }
38
+ },
39
+ "files": [
40
+ {
41
+ "name": "reading-progress.hbs",
42
+ "type": "partial",
43
+ "target": "partials/components/reading-progress.hbs",
44
+ "content": "{{!-- Styling parameters: class, barClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-reading-progress{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-ghcn-reading-progress data-variant=\"{{#match variant \"subtle\"}}subtle{{else}}{{#match variant \"gradient\"}}gradient{{else}}default{{/match}}{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\" data-content-selector=\"{{#if contentSelector}}{{contentSelector}}{{else}}.ghcn-article-content{{/if}}\">\n <progress class=\"ghcn-reading-progress__bar{{#if ghostcnStyles.barClass}} {{ghostcnStyles.barClass}}{{/if}}\" max=\"100\" value=\"{{#if initialValue}}{{initialValue}}{{else}}0{{/if}}\" aria-label=\"{{#if ariaLabel}}{{ariaLabel}}{{else}}Reading progress{{/if}}\"></progress>\n</div>\n{{/with}}"
45
+ },
46
+ {
47
+ "name": "reading-progress.css",
48
+ "type": "style",
49
+ "target": "assets/css/components/reading-progress.css",
50
+ "content": ".ghcn-reading-progress { box-sizing: border-box; position: sticky; top: 0; z-index: 40; width: 100%; height: 3px; background: color-mix(in srgb, var(--border) 60%, transparent); overflow: hidden; }\n.ghcn-reading-progress:where([data-size=\"sm\"]) { height: 2px; }\n.ghcn-reading-progress:where([data-size=\"lg\"]) { height: 5px; }\n.ghcn-reading-progress__bar { display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; appearance: none; background: transparent; color: var(--primary); accent-color: var(--primary); }\n.ghcn-reading-progress__bar::-webkit-progress-bar { background: transparent; }\n.ghcn-reading-progress__bar::-webkit-progress-value { background: var(--primary); transition: width 80ms linear; }\n.ghcn-reading-progress__bar::-moz-progress-bar { background: var(--primary); }\n.ghcn-reading-progress:where([data-variant=\"subtle\"]) .ghcn-reading-progress__bar { color: var(--muted-foreground); accent-color: var(--muted-foreground); }\n.ghcn-reading-progress:where([data-variant=\"subtle\"]) .ghcn-reading-progress__bar::-webkit-progress-value { background: var(--muted-foreground); }\n.ghcn-reading-progress:where([data-variant=\"subtle\"]) .ghcn-reading-progress__bar::-moz-progress-bar { background: var(--muted-foreground); }\n.ghcn-reading-progress:where([data-variant=\"gradient\"]) .ghcn-reading-progress__bar::-webkit-progress-value { background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--foreground))); }\n.ghcn-reading-progress:where([data-variant=\"gradient\"]) .ghcn-reading-progress__bar::-moz-progress-bar { background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--foreground))); }\n@media (prefers-reduced-motion: reduce) { .ghcn-reading-progress__bar::-webkit-progress-value { transition: none; } }\n"
51
+ },
52
+ {
53
+ "name": "reading-progress.js",
54
+ "type": "js",
55
+ "target": "assets/js/components/reading-progress.js",
56
+ "content": "/* ghostcn reading progress: scroll-linked article progress bar, CSP-safe via native <progress>. */\n(() => {\n function init() {\n const widgets = [...document.querySelectorAll('[data-ghcn-reading-progress]')].filter(el => !el.dataset.ghcnProgressReady);\n if (!widgets.length) return;\n const entries = widgets.map(el => {\n el.dataset.ghcnProgressReady = 'true';\n let target = null;\n try { target = document.querySelector(el.dataset.contentSelector || '.ghcn-article-content'); } catch {}\n const bar = el.querySelector('progress');\n return bar ? { el, bar, target } : null;\n }).filter(Boolean);\n if (!entries.length) return;\n\n let frame = 0;\n const update = () => {\n frame = 0;\n const vh = window.innerHeight || 1;\n for (const { bar, target } of entries) {\n let ratio = 0;\n if (target) {\n const rect = target.getBoundingClientRect();\n if (rect.height <= vh) continue;\n ratio = Math.min(1, Math.max(0, -rect.top / Math.max(1, rect.height - vh)));\n } else {\n const doc = document.scrollingElement || document.documentElement;\n if (doc.scrollHeight <= doc.clientHeight + 4) continue;\n ratio = Math.min(1, Math.max(0, doc.scrollTop / Math.max(1, doc.scrollHeight - doc.clientHeight)));\n }\n const percent = Math.round(ratio * 100);\n bar.value = percent;\n bar.setAttribute('aria-valuenow', String(percent));\n }\n };\n const schedule = () => { if (!frame) frame = requestAnimationFrame(update); };\n update();\n window.addEventListener('scroll', schedule, { passive: true });\n window.addEventListener('resize', schedule);\n }\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true });\n else init();\n})();"
57
+ }
58
+ ],
59
+ "gscan": {
60
+ "rules_satisfied": [
61
+ "GS010-PJ-VALID"
62
+ ],
63
+ "notes": "Uses native <progress> element updated on scroll via requestAnimationFrame; zero inline styles."
64
+ },
65
+ "styleSlots": {
66
+ "class": [
67
+ ".ghcn-reading-progress"
68
+ ],
69
+ "barClass": [
70
+ ".ghcn-reading-progress__bar"
71
+ ]
72
+ }
73
+ }
@@ -4,6 +4,12 @@
4
4
  "description": "Related reading from the same primary tag, excluding the current post; recent posts when untagged.",
5
5
  "dependencies": [],
6
6
  "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "heading": {
9
+ "description": "Optional section heading override.",
10
+ "default": "Keep reading"
11
+ }
12
+ },
7
13
  "files": [
8
14
  {
9
15
  "name": "related-posts.hbs",
@@ -15,7 +21,7 @@
15
21
  "name": "related-posts.css",
16
22
  "type": "style",
17
23
  "target": "assets/css/components/related-posts.css",
18
- "content": "\n.ghcn-related { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-related__title { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; margin: 0 0 var(--ghcn-section-gap, 20px); }\n.ghcn-related__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--ghcn-grid-gap, 16px); }\n.ghcn-related__card { box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; border: 1px solid var(--border, #e4e4e7); border-radius: var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)); background: var(--card, #fff); color: var(--card-foreground, #09090b); overflow: hidden; }\n.ghcn-related__image-link { display: block; aspect-ratio: 16/9; overflow: hidden; }\n.ghcn-related__image { display: block; width: 100%; height: 100%; object-fit: cover; }\n.ghcn-related__content { padding: var(--ghcn-panel-padding, clamp(16px, 3vw, 24px)); }\n.ghcn-related__card-title { font-size: var(--ghcn-title-card, 20px); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; color: inherit; margin: 0 0 8px; }\n.ghcn-related__card-title a { color: inherit; text-decoration: none; }\n.ghcn-related__card-title a:hover { text-decoration: underline; }\n.ghcn-related__description { color: var(--muted-foreground); font-size: var(--ghcn-text-small, 14px); margin: 0; }\n.ghcn-related a:focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n"
24
+ "content": "\n.ghcn-related { box-sizing: border-box; min-width: 0; margin-block: var(--ghcn-section-space, clamp(24px, 4vw, 48px)); font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-related__title { font-size: var(--ghcn-title-section, clamp(24px, 3vw, 32px)); font-weight: 700; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; margin: 0 0 24px; }\n.ghcn-related__grid { display: grid; grid-template-columns: 1fr; gap: 32px 28px; }\n@media (min-width: 640px) { .ghcn-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n@media (min-width: 980px) { .ghcn-related__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }\n.ghcn-related__card { box-sizing: border-box; min-width: 0; background: transparent; color: var(--foreground); display: flex; flex-direction: column; gap: 14px; }\n.ghcn-related__image-link { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: calc(var(--ghcn-panel-radius, min(var(--radius, 8px), 24px)) + 4px); border: 1px solid color-mix(in srgb, var(--border) 75%, transparent); background: var(--muted); }\n.ghcn-related__image { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1); }\n.ghcn-related__card:hover .ghcn-related__image { transform: scale(1.03); }\n.ghcn-related__content { padding: 0 2px; }\n.ghcn-related__card-title { font-size: var(--ghcn-title-card, 20px); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; color: inherit; margin: 0 0 6px; line-height: 1.3; }\n.ghcn-related__card-title a { color: inherit; text-decoration: none; transition: opacity 150ms ease; }\n.ghcn-related__card-title a:hover { opacity: 0.78; }\n.ghcn-related__description { color: var(--muted-foreground); font-size: 14.5px; line-height: 1.55; margin: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }\n.ghcn-related a:focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n"
19
25
  }
20
26
  ],
21
27
  "gscan": {
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "search-trigger",
3
+ "type": "components:layout",
4
+ "description": "Keyboard-hinted search trigger wired directly to Ghost native Sodo Search (data-ghost-search).",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Style: default (search bar), button, or icon.",
10
+ "default": "default"
11
+ },
12
+ "size": {
13
+ "description": "Control height: sm, default, or lg.",
14
+ "default": "default"
15
+ },
16
+ "label": {
17
+ "description": "Visible placeholder or button label.",
18
+ "default": "Search posts..."
19
+ },
20
+ "shortcut": {
21
+ "description": "Keyboard shortcut badge text.",
22
+ "default": "⌘K"
23
+ },
24
+ "hideShortcut": {
25
+ "description": "Hide the keyboard shortcut badge when true."
26
+ },
27
+ "ariaLabel": {
28
+ "description": "Accessible button label override."
29
+ }
30
+ },
31
+ "files": [
32
+ {
33
+ "name": "search-trigger.hbs",
34
+ "type": "partial",
35
+ "target": "partials/components/search-trigger.hbs",
36
+ "content": "{{!-- Styling parameters: class, labelClass, kbdClass --}}\n{{#with this as |ghostcnStyles|}}\n<button\n type=\"button\"\n class=\"ghcn-search-trigger{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\"\n data-ghcn-search-trigger\n data-ghost-search\n data-variant=\"{{#match variant \"button\"}}button{{else}}{{#match variant \"icon\"}}icon{{else}}default{{/match}}{{/match}}\"\n data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\"\n aria-label=\"{{#if ariaLabel}}{{ariaLabel}}{{else}}{{#if label}}{{label}}{{else}}Search posts{{/if}}{{/if}}\"\n>\n <svg class=\"ghcn-search-trigger__icon\" aria-hidden=\"true\" viewBox=\"0 0 20 20\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"9\" cy=\"9\" r=\"5.75\"/><path d=\"m13.5 13.5 4 4\"/></svg>\n <span class=\"ghcn-search-trigger__label{{#if ghostcnStyles.labelClass}} {{ghostcnStyles.labelClass}}{{/if}}\">{{#if label}}{{label}}{{else}}Search posts...{{/if}}</span>\n {{#unless hideShortcut}}\n <kbd class=\"ghcn-search-trigger__kbd{{#if ghostcnStyles.kbdClass}} {{ghostcnStyles.kbdClass}}{{/if}}\">{{#if shortcut}}{{shortcut}}{{else}}⌘K{{/if}}</kbd>\n {{/unless}}\n</button>\n{{/with}}"
37
+ },
38
+ {
39
+ "name": "search-trigger.css",
40
+ "type": "style",
41
+ "target": "assets/css/components/search-trigger.css",
42
+ "content": ".ghcn-search-trigger { box-sizing: border-box; display: inline-flex; align-items: center; gap: 10px; min-height: 38px; min-width: 220px; padding: 0 10px 0 12px; border: 1px solid var(--input, var(--border)); border-radius: var(--ghcn-control-radius, var(--radius, 8px)); background: var(--card, var(--background)); color: var(--muted-foreground); font-family: inherit; font-size: 13.5px; font-weight: 500; line-height: 1; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease; }\n.ghcn-search-trigger *, .ghcn-search-trigger *::before, .ghcn-search-trigger *::after { box-sizing: border-box; }\n.ghcn-search-trigger:hover { border-color: color-mix(in srgb, var(--foreground) 24%, var(--border)); color: var(--foreground); background: var(--secondary); }\n.ghcn-search-trigger__icon { flex: 0 0 auto; color: currentColor; }\n.ghcn-search-trigger__label { flex: 1 1 auto; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.ghcn-search-trigger__kbd { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 0 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--secondary); color: var(--muted-foreground); font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1; }\n.ghcn-search-trigger:where([data-variant=\"button\"]) { min-width: auto; gap: 10px; padding: 0 8px 0 12px; background: var(--secondary); border-color: var(--border); color: var(--secondary-foreground); box-shadow: none; }\n.ghcn-search-trigger:where([data-variant=\"button\"]):hover { background: color-mix(in srgb, var(--foreground) 8%, var(--secondary)); }\n.ghcn-search-trigger:where([data-variant=\"icon\"]) { min-width: 38px; width: 38px; padding: 0; justify-content: center; gap: 0; background: transparent; box-shadow: none; }\n.ghcn-search-trigger:where([data-variant=\"icon\"]) .ghcn-search-trigger__label,\n.ghcn-search-trigger:where([data-variant=\"icon\"]) .ghcn-search-trigger__kbd { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }\n.ghcn-search-trigger:where([data-size=\"sm\"]) { min-height: 32px; font-size: 12.5px; }\n.ghcn-search-trigger:where([data-size=\"sm\"][data-variant=\"default\"]) { min-width: 184px; padding: 0 8px 0 10px; }\n.ghcn-search-trigger:where([data-size=\"sm\"][data-variant=\"icon\"]) { min-width: 32px; width: 32px; }\n.ghcn-search-trigger:where([data-size=\"lg\"]) { min-height: 44px; font-size: 14.5px; }\n.ghcn-search-trigger:where([data-size=\"lg\"][data-variant=\"default\"]) { min-width: 268px; padding: 0 12px 0 14px; }\n.ghcn-search-trigger:where([data-size=\"lg\"][data-variant=\"icon\"]) { min-width: 44px; width: 44px; }\n.ghcn-search-trigger:focus-visible, :where(.ghcn-search-trigger) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }"
43
+ },
44
+ {
45
+ "name": "search-trigger.js",
46
+ "type": "js",
47
+ "target": "assets/js/components/search-trigger.js",
48
+ "content": "/* ghostcn search trigger: opens Ghost native search on Cmd/Ctrl+K or / outside form inputs. */\n(() => {\n function isEditable(el) {\n if (!el) return false;\n const tag = el.tagName;\n return tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || el.isContentEditable;\n }\n\n function init() {\n if (document.documentElement.dataset.ghcnSearchShortcutReady) return;\n document.documentElement.dataset.ghcnSearchShortcutReady = 'true';\n document.addEventListener('keydown', event => {\n const trigger = document.querySelector('[data-ghcn-search-trigger][data-ghost-search]');\n if (!trigger) return;\n const isCmdK = (event.metaKey || event.ctrlKey) && event.key.toLowerCase() === 'k';\n const isSlash = event.key === '/' && !event.metaKey && !event.ctrlKey && !event.altKey && !isEditable(document.activeElement);\n if (isCmdK || isSlash) {\n event.preventDefault();\n trigger.click();\n }\n });\n }\n\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true });\n else init();\n})();"
49
+ }
50
+ ],
51
+ "gscan": {
52
+ "rules_satisfied": [
53
+ "GS010-PJ-VALID"
54
+ ],
55
+ "notes": "Uses Ghost native data-ghost-search with optional Cmd/Ctrl+K and / keyboard shortcut."
56
+ },
57
+ "styleSlots": {
58
+ "class": [
59
+ ".ghcn-search-trigger"
60
+ ],
61
+ "labelClass": [
62
+ ".ghcn-search-trigger__label"
63
+ ],
64
+ "kbdClass": [
65
+ ".ghcn-search-trigger__kbd"
66
+ ]
67
+ }
68
+ }
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "select",
3
+ "type": "components:ui",
4
+ "description": "Accessible labeled native select dropdown with custom chevron icon and filled variant.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Surface treatment.",
10
+ "options": [
11
+ "default",
12
+ "filled"
13
+ ],
14
+ "default": "default"
15
+ },
16
+ "size": {
17
+ "description": "Control scale.",
18
+ "options": [
19
+ "sm",
20
+ "default",
21
+ "lg"
22
+ ],
23
+ "default": "default"
24
+ },
25
+ "label": {
26
+ "description": "Visible accessible label.",
27
+ "default": "Topic"
28
+ },
29
+ "name": {
30
+ "description": "Form field name."
31
+ },
32
+ "placeholder": {
33
+ "description": "Optional disabled placeholder option."
34
+ },
35
+ "option1": {
36
+ "description": "First option (or pass <option> elements in a partial block)."
37
+ },
38
+ "option2": {
39
+ "description": "Second option."
40
+ },
41
+ "option3": {
42
+ "description": "Third option."
43
+ },
44
+ "hint": {
45
+ "description": "Optional help text."
46
+ },
47
+ "hintId": {
48
+ "description": "Unique ID for help text."
49
+ },
50
+ "invalid": {
51
+ "description": "Boolean invalid state."
52
+ },
53
+ "required": {
54
+ "description": "Boolean required state."
55
+ },
56
+ "disabled": {
57
+ "description": "Boolean disabled state."
58
+ }
59
+ },
60
+ "files": [
61
+ {
62
+ "name": "select.hbs",
63
+ "type": "partial",
64
+ "target": "partials/components/select.hbs",
65
+ "content": "{{!-- Styling parameters: class, labelClass, inputClass, descriptionClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-ui-select{{#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-select__label\">\n <span class=\"ghcn-ui-select__label-text{{#if ghostcnStyles.labelClass}} {{ghostcnStyles.labelClass}}{{/if}}\">{{#if label}}{{label}}{{else}}Topic{{/if}}{{#if required}} (required){{/if}}</span>\n <span class=\"ghcn-ui-select__wrap\">\n <select class=\"ghcn-ui-select__control{{#if ghostcnStyles.inputClass}} {{ghostcnStyles.inputClass}}{{/if}}\"{{#if id}} id=\"{{id}}\"{{/if}}{{#if name}} name=\"{{name}}\"{{/if}}{{#if required}} required{{/if}}{{#if disabled}} disabled{{/if}}{{#if invalid}} aria-invalid=\"true\"{{/if}}{{#if hint}}{{#if hintId}} aria-describedby=\"{{hintId}}\"{{/if}}{{/if}}>\n {{#> @partial-block}}\n {{#if placeholder}}<option value=\"\" disabled selected>{{placeholder}}</option>{{/if}}\n {{#if option1}}<option value=\"{{option1}}\">{{option1}}</option>{{/if}}\n {{#if option2}}<option value=\"{{option2}}\">{{option2}}</option>{{/if}}\n {{#if option3}}<option value=\"{{option3}}\">{{option3}}</option>{{/if}}\n {{/@partial-block}}\n </select>\n <svg class=\"ghcn-ui-select__chevron\" aria-hidden=\"true\" viewBox=\"0 0 16 16\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"m4 6 4 4 4-4\"/></svg>\n </span>\n </label>\n {{#if hint}}<p class=\"ghcn-ui-select__hint{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\"{{#if hintId}} id=\"{{hintId}}\"{{/if}}>{{hint}}</p>{{/if}}\n</div>\n{{/with}}"
66
+ },
67
+ {
68
+ "name": "select.css",
69
+ "type": "style",
70
+ "target": "assets/css/components/select.css",
71
+ "content": ".ghcn-ui-select { box-sizing: border-box; font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-select *, .ghcn-ui-select *::before, .ghcn-ui-select *::after { box-sizing: border-box; }\n.ghcn-ui-select:focus-visible, :where(.ghcn-ui-select) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n.ghcn-ui-select { width: 100%; }\n.ghcn-ui-select__label { display: grid; gap: 6px; font-weight: 500; font-size: var(--ghcn-text-small, 14px); }\n.ghcn-ui-select__wrap { position: relative; display: block; }\n.ghcn-ui-select__control { min-height: var(--ghcn-control-height, 40px); padding: var(--ghcn-control-padding, 8px 14px); border-radius: var(--ghcn-control-radius, var(--radius, 8px)); font-size: var(--ghcn-text-small, 14px); line-height: 1.4; appearance: none; width: 100%; min-width: 0; padding-inline-end: 36px; border: 1px solid var(--input); background: var(--background); color: var(--foreground); font-family: inherit; cursor: pointer; }\n.ghcn-ui-select:where([data-size=\"sm\"]) .ghcn-ui-select__control { min-height: 34px; padding: 5px 32px 5px 11px; font-size: 13px; }\n.ghcn-ui-select:where([data-size=\"lg\"]) .ghcn-ui-select__control { min-height: 46px; padding: 10px 40px 10px 17px; font-size: 16px; }\n.ghcn-ui-select:where([data-variant=\"filled\"]) .ghcn-ui-select__control { background: var(--muted); }\n.ghcn-ui-select__control[aria-invalid=\"true\"] { border-color: var(--destructive); }\n.ghcn-ui-select__control:disabled { opacity: .5; cursor: not-allowed; }\n.ghcn-ui-select__chevron { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted-foreground); }\n.ghcn-ui-select__hint { color: var(--muted-foreground); font-size: 13px; margin: 6px 0 0; }\n"
72
+ }
73
+ ],
74
+ "gscan": {
75
+ "rules_satisfied": [
76
+ "GS010-PJ-VALID"
77
+ ],
78
+ "notes": "Self-contained Ghostcn UI primitive."
79
+ },
80
+ "styleSlots": {
81
+ "class": [
82
+ ".ghcn-ui-select"
83
+ ],
84
+ "labelClass": [
85
+ ".ghcn-ui-select__label-text"
86
+ ],
87
+ "inputClass": [
88
+ ".ghcn-ui-select__control"
89
+ ],
90
+ "descriptionClass": [
91
+ ".ghcn-ui-select__hint"
92
+ ]
93
+ }
94
+ }