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,82 @@
1
+ {
2
+ "name": "sticky-subscribe",
3
+ "type": "components:members",
4
+ "description": "Scroll-triggered, session-dismissible native Ghost subscribe prompt that hides automatically for signed-in members.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Prompt style: default (floating card), bar (bottom banner), or minimal (pill).",
10
+ "options": [
11
+ "default",
12
+ "bar",
13
+ "minimal"
14
+ ],
15
+ "default": "default"
16
+ },
17
+ "heading": {
18
+ "description": "Short prompt headline.",
19
+ "default": "Enjoying this story?"
20
+ },
21
+ "description": {
22
+ "description": "Optional subtext line."
23
+ },
24
+ "placeholder": {
25
+ "description": "Email placeholder text.",
26
+ "default": "you@example.com"
27
+ },
28
+ "buttonText": {
29
+ "description": "Submit button label.",
30
+ "default": "Subscribe"
31
+ },
32
+ "threshold": {
33
+ "description": "Scroll depth percentage (5-95) before showing.",
34
+ "default": "35"
35
+ },
36
+ "dismissKey": {
37
+ "description": "Session storage key suffix for dismissal.",
38
+ "default": "default"
39
+ },
40
+ "alwaysVisible": {
41
+ "description": "Keep rendered inline without scroll gating when true."
42
+ }
43
+ },
44
+ "files": [
45
+ {
46
+ "name": "sticky-subscribe.hbs",
47
+ "type": "partial",
48
+ "target": "partials/components/sticky-subscribe.hbs",
49
+ "content": "{{!-- Styling parameters: class, titleClass, buttonClass --}}\n{{#with this as |ghostcnStyles|}}\n{{#if @site.members_enabled}}\n{{#unless @site.members_invite_only}}\n{{#if @site.allow_self_signup}}\n{{#unless @member}}\n<aside\n class=\"ghcn-sticky-sub{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\"\n data-ghcn-sticky-sub\n data-variant=\"{{#match variant \"bar\"}}bar{{else}}{{#match variant \"minimal\"}}minimal{{else}}default{{/match}}{{/match}}\"\n data-threshold=\"{{#if threshold}}{{threshold}}{{else}}35{{/if}}\"\n data-always-visible=\"{{#if alwaysVisible}}true{{else}}false{{/if}}\"\n data-dismiss-key=\"{{#if dismissKey}}{{dismissKey}}{{else}}default{{/if}}\"\n data-visible=\"{{#if alwaysVisible}}true{{else}}false{{/if}}\"\n aria-label=\"{{#if heading}}{{heading}}{{else}}Subscribe to newsletter{{/if}}\"\n>\n <div class=\"ghcn-sticky-sub__copy\">\n <p class=\"ghcn-sticky-sub__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{#if heading}}{{heading}}{{else}}Enjoying this story?{{/if}}</p>\n {{#if description}}<p class=\"ghcn-sticky-sub__desc\">{{description}}</p>{{/if}}\n </div>\n {{#if @site.portal_signup_checkbox_required}}\n <a class=\"ghcn-sticky-sub__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"#/portal/signup\" data-portal=\"signup\">{{#if buttonText}}{{buttonText}}{{else}}Subscribe{{/if}}</a>\n {{else}}\n <form class=\"ghcn-sticky-sub__form\" data-members-form=\"subscribe\">\n <input class=\"ghcn-sticky-sub__input\" data-members-email type=\"email\" autocomplete=\"email\" required aria-label=\"Email address\" placeholder=\"{{#if placeholder}}{{placeholder}}{{else}}you@example.com{{/if}}\" />\n <button class=\"ghcn-sticky-sub__btn{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" type=\"submit\">{{#if buttonText}}{{buttonText}}{{else}}Subscribe{{/if}}</button>\n <span class=\"ghcn-sticky-sub__msg ghcn-sticky-sub__msg--ok\" role=\"status\" data-members-success>Check your inbox to confirm.</span>\n <span class=\"ghcn-sticky-sub__msg ghcn-sticky-sub__msg--err\" role=\"alert\" data-members-error>Enter a valid email.</span>\n </form>\n {{/if}}\n <button type=\"button\" class=\"ghcn-sticky-sub__close\" data-sticky-sub-close aria-label=\"Dismiss subscribe prompt\">\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\"><path d=\"M4 4l8 8M12 4l-8 8\"/></svg>\n </button>\n</aside>\n{{/unless}}\n{{/if}}\n{{/unless}}\n{{/if}}\n{{/with}}"
50
+ },
51
+ {
52
+ "name": "sticky-subscribe.css",
53
+ "type": "style",
54
+ "target": "assets/css/components/sticky-subscribe.css",
55
+ "content": ".ghcn-sticky-sub { 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); position: fixed; right: 20px; bottom: 20px; z-index: 45; width: min(calc(100vw - 32px), 380px); padding: 18px 42px 18px 18px; display: grid; gap: 12px; font-family: inherit; box-shadow: 0 14px 36px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .06); opacity: 0; pointer-events: none; transform: translateY(14px); transition: opacity 200ms ease, transform 200ms ease; }\n.ghcn-sticky-sub *, .ghcn-sticky-sub *::before, .ghcn-sticky-sub *::after { box-sizing: border-box; }\n.ghcn-sticky-sub[hidden] { display: none; }\n.ghcn-sticky-sub[data-visible=\"true\"] { opacity: 1; pointer-events: auto; transform: translateY(0); }\n.ghcn-sticky-sub[data-always-visible=\"true\"] { position: relative; right: auto; bottom: auto; z-index: auto; width: 100%; max-width: 440px; }\n.ghcn-sticky-sub:where([data-variant=\"bar\"]) { left: 16px; right: 16px; bottom: 16px; width: auto; max-width: 960px; margin-inline: auto; padding: 14px 48px 14px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }\n.ghcn-sticky-sub:where([data-variant=\"bar\"][data-always-visible=\"true\"]) { left: auto; right: auto; bottom: auto; width: 100%; }\n.ghcn-sticky-sub:where([data-variant=\"minimal\"]) { border-radius: 9999px; padding: 10px 44px 10px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; max-width: 560px; }\n.ghcn-sticky-sub__copy { display: grid; gap: 3px; min-width: 0; }\n.ghcn-sticky-sub__title { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -.015em; color: var(--foreground); }\n.ghcn-sticky-sub__desc { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted-foreground); }\n.ghcn-sticky-sub__form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; flex: 1 1 240px; }\n.ghcn-sticky-sub__input { flex: 1 1 150px; min-width: 0; height: 36px; padding: 0 11px; border: 1px solid var(--input, var(--border)); border-radius: var(--ghcn-control-radius, var(--radius, 8px)); background: var(--background); color: var(--foreground); font: inherit; font-size: 13.5px; }\n.ghcn-sticky-sub:where([data-variant=\"minimal\"]) .ghcn-sticky-sub__input { border-radius: 9999px; }\n.ghcn-sticky-sub__btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--ghcn-control-radius, var(--radius, 8px)); background: var(--primary); color: var(--primary-foreground); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer; transition: opacity 150ms ease; }\n.ghcn-sticky-sub:where([data-variant=\"minimal\"]) .ghcn-sticky-sub__btn { border-radius: 9999px; }\n.ghcn-sticky-sub__btn:hover { opacity: .9; }\n.ghcn-sticky-sub__msg { display: none; flex-basis: 100%; font-size: 12px; font-weight: 500; }\n.ghcn-sticky-sub__form.success .ghcn-sticky-sub__msg--ok { display: block; color: var(--success, #15803d); }\n.ghcn-sticky-sub__form.error .ghcn-sticky-sub__msg--err { display: block; color: var(--destructive, #dc2626); }\n.ghcn-sticky-sub__close { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; border-radius: 9999px; background: transparent; color: var(--muted-foreground); cursor: pointer; transition: background-color 150ms ease, color 150ms ease; }\n.ghcn-sticky-sub__close:hover { background: var(--secondary); color: var(--foreground); }\n@media (prefers-reduced-motion: reduce) { .ghcn-sticky-sub { transition: none; transform: none; } }\n.ghcn-sticky-sub:focus-visible, :where(.ghcn-sticky-sub) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }"
56
+ },
57
+ {
58
+ "name": "sticky-subscribe.js",
59
+ "type": "js",
60
+ "target": "assets/js/components/sticky-subscribe.js",
61
+ "content": "/* ghostcn sticky-subscribe: scroll-triggered dismissible subscribe prompt, CSP-safe, repeat-safe. */\n(() => {\n const KEY = 'ghcn-sticky-sub-dismissed';\n\n function isDismissed(id) {\n try { return sessionStorage.getItem(KEY + ':' + id) === '1'; } catch { return false; }\n }\n\n function dismiss(el, id) {\n el.hidden = true;\n el.dataset.visible = 'false';\n try { sessionStorage.setItem(KEY + ':' + id, '1'); } catch {}\n }\n\n function init() {\n document.querySelectorAll('[data-ghcn-sticky-sub]').forEach(el => {\n if (el.dataset.ghcnStickySubReady) return;\n el.dataset.ghcnStickySubReady = 'true';\n const id = el.dataset.dismissKey || 'default';\n const always = el.dataset.alwaysVisible === 'true';\n if (!always && isDismissed(id)) {\n el.hidden = true;\n return;\n }\n const closeBtn = el.querySelector('[data-sticky-sub-close]');\n if (closeBtn) closeBtn.addEventListener('click', () => dismiss(el, id));\n if (always) {\n el.hidden = false;\n el.dataset.visible = 'true';\n return;\n }\n const pct = Math.min(95, Math.max(5, Number(el.dataset.threshold) || 35));\n let footerInView = false;\n const update = () => {\n if (el.hidden) return;\n const doc = document.documentElement;\n const max = doc.scrollHeight - window.innerHeight;\n const ratio = max > 40 ? (window.scrollY / max) * 100 : 0;\n el.dataset.visible = (!footerInView && ratio >= pct) ? 'true' : 'false';\n };\n const footers = document.querySelectorAll('body > footer, .folio-footer, .ghcn-footer');\n const footer = footers[footers.length - 1] || document.querySelector('footer');\n if (footer && typeof IntersectionObserver !== 'undefined') {\n const io = new IntersectionObserver(entries => {\n footerInView = entries.some(entry => entry.isIntersecting);\n update();\n }, { threshold: 0.05 });\n io.observe(footer);\n }\n update();\n window.addEventListener('scroll', update, { passive: true });\n window.addEventListener('resize', update, { passive: true });\n });\n }\n\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true });\n else init();\n})();"
62
+ }
63
+ ],
64
+ "gscan": {
65
+ "rules_satisfied": [
66
+ "GS010-PJ-VALID",
67
+ "GS050-MEMBERS-FORM"
68
+ ],
69
+ "notes": "Uses Ghost native data-members-form, Portal checkbox fallback, and CSP-safe sessionStorage dismissal."
70
+ },
71
+ "styleSlots": {
72
+ "class": [
73
+ ".ghcn-sticky-sub"
74
+ ],
75
+ "titleClass": [
76
+ ".ghcn-sticky-sub__title"
77
+ ],
78
+ "buttonClass": [
79
+ ".ghcn-sticky-sub__btn"
80
+ ]
81
+ }
82
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "subscribe-bar",
3
+ "type": "components:members",
4
+ "description": "Compact single-row native Ghost members subscribe bar for headers, footers, and hero sections.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Surface style: default, outline, or filled.",
10
+ "default": "default"
11
+ },
12
+ "size": {
13
+ "description": "Control height: sm, default, or lg.",
14
+ "default": "default"
15
+ },
16
+ "placeholder": {
17
+ "description": "Email input placeholder text.",
18
+ "default": "you@example.com"
19
+ },
20
+ "buttonText": {
21
+ "description": "Submit button text.",
22
+ "default": "Subscribe"
23
+ },
24
+ "ariaLabel": {
25
+ "description": "Accessible label for the email input.",
26
+ "default": "Email address"
27
+ }
28
+ },
29
+ "files": [
30
+ {
31
+ "name": "subscribe-bar.hbs",
32
+ "type": "partial",
33
+ "target": "partials/components/subscribe-bar.hbs",
34
+ "content": "{{!-- Styling parameters: class, inputClass, buttonClass --}}\n{{#with this as |ghostcnStyles|}}\n{{#if @site.members_enabled}}\n{{#unless @site.members_invite_only}}\n{{#if @site.allow_self_signup}}\n{{#unless @member}}\n<div class=\"ghcn-subscribe-bar{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match variant \"outline\"}}outline{{else}}{{#match variant \"filled\"}}filled{{else}}default{{/match}}{{/match}}\" data-size=\"{{#match size \"sm\"}}sm{{else}}{{#match size \"lg\"}}lg{{else}}default{{/match}}{{/match}}\">\n {{#if @site.portal_signup_checkbox_required}}\n <a class=\"ghcn-subscribe-bar__button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" href=\"#/portal/signup\" data-portal=\"signup\">{{#if buttonText}}{{buttonText}}{{else}}Subscribe{{/if}}</a>\n {{else}}\n <form class=\"ghcn-subscribe-bar__form\" data-members-form=\"subscribe\">\n <div class=\"ghcn-subscribe-bar__row\">\n <input\n class=\"ghcn-subscribe-bar__input{{#if ghostcnStyles.inputClass}} {{ghostcnStyles.inputClass}}{{/if}}\"\n data-members-email\n type=\"email\"\n autocomplete=\"email\"\n required\n aria-label=\"{{#if ariaLabel}}{{ariaLabel}}{{else}}Email address{{/if}}\"\n placeholder=\"{{#if placeholder}}{{placeholder}}{{else}}you@example.com{{/if}}\"\n />\n <button class=\"ghcn-subscribe-bar__button{{#if ghostcnStyles.buttonClass}} {{ghostcnStyles.buttonClass}}{{/if}}\" type=\"submit\">{{#if buttonText}}{{buttonText}}{{else}}Subscribe{{/if}}</button>\n </div>\n <p class=\"ghcn-subscribe-bar__status ghcn-subscribe-bar__status--success\" role=\"status\" data-members-success>\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3 8.5 6.5 12 13 4\"/></svg>\n <span>Check your inbox to confirm your subscription.</span>\n </p>\n <p class=\"ghcn-subscribe-bar__status ghcn-subscribe-bar__status--error\" role=\"alert\" data-members-error>\n <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 4l8 8M12 4l-8 8\"/></svg>\n <span>Please enter a valid email address.</span>\n </p>\n </form>\n {{/if}}\n</div>\n{{/unless}}\n{{/if}}\n{{/unless}}\n{{/if}}\n{{/with}}"
35
+ },
36
+ {
37
+ "name": "subscribe-bar.css",
38
+ "type": "style",
39
+ "target": "assets/css/components/subscribe-bar.css",
40
+ "content": ".ghcn-subscribe-bar { box-sizing: border-box; width: 100%; max-width: 460px; font-family: inherit; font-size: var(--ghcn-text-small, 14px); color: var(--foreground); }\n.ghcn-subscribe-bar *, .ghcn-subscribe-bar *::before, .ghcn-subscribe-bar *::after { box-sizing: border-box; }\n.ghcn-subscribe-bar__form { display: grid; gap: 6px; margin: 0; }\n.ghcn-subscribe-bar__row { display: flex; align-items: stretch; gap: 6px; padding: 4px; border: 1px solid var(--input, var(--border)); border-radius: calc(var(--ghcn-control-radius, var(--radius, 8px)) + 3px); background: var(--card, var(--background)); box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: border-color 150ms ease, box-shadow 150ms ease; }\n.ghcn-subscribe-bar__row:focus-within { border-color: var(--ring, var(--primary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring, var(--primary)) 16%, transparent); }\n.ghcn-subscribe-bar:where([data-variant=\"outline\"]) .ghcn-subscribe-bar__row { background: transparent; box-shadow: none; }\n.ghcn-subscribe-bar:where([data-variant=\"filled\"]) .ghcn-subscribe-bar__row { background: var(--secondary); border-color: transparent; box-shadow: none; }\n.ghcn-subscribe-bar:where([data-variant=\"filled\"]) .ghcn-subscribe-bar__row:focus-within { background: var(--background); border-color: var(--ring, var(--primary)); }\n.ghcn-subscribe-bar__input { flex: 1 1 auto; min-width: 0; min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--ghcn-control-radius, var(--radius, 8px)); background: transparent; color: var(--foreground); font: inherit; font-size: 14px; line-height: 1.25; outline: none; }\n.ghcn-subscribe-bar__input::placeholder { color: var(--muted-foreground); }\n.ghcn-subscribe-bar__button { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--ghcn-control-radius, var(--radius, 8px)); background: var(--primary); color: var(--primary-foreground); font: inherit; font-size: 13px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; transition: opacity 150ms ease; }\n.ghcn-subscribe-bar__button:hover { opacity: .9; }\n.ghcn-subscribe-bar:where([data-size=\"sm\"]) .ghcn-subscribe-bar__row { padding: 3px; }\n.ghcn-subscribe-bar:where([data-size=\"sm\"]) .ghcn-subscribe-bar__input { min-height: 30px; padding: 0 10px; font-size: 13px; }\n.ghcn-subscribe-bar:where([data-size=\"sm\"]) .ghcn-subscribe-bar__button { min-height: 30px; padding: 0 12px; font-size: 12px; }\n.ghcn-subscribe-bar:where([data-size=\"lg\"]) .ghcn-subscribe-bar__row { padding: 5px; }\n.ghcn-subscribe-bar:where([data-size=\"lg\"]) .ghcn-subscribe-bar__input { min-height: 44px; padding: 0 14px; font-size: 15px; }\n.ghcn-subscribe-bar:where([data-size=\"lg\"]) .ghcn-subscribe-bar__button { min-height: 44px; padding: 0 20px; font-size: 14px; }\n.ghcn-subscribe-bar__form.loading .ghcn-subscribe-bar__button { opacity: .65; pointer-events: none; }\n.ghcn-subscribe-bar__status { display: none; align-items: center; gap: 6px; margin: 2px 0 0 4px; font-size: 12px; font-weight: 500; line-height: 1.4; }\n.ghcn-subscribe-bar__form.success .ghcn-subscribe-bar__status--success,\n.ghcn-subscribe-bar__form.error .ghcn-subscribe-bar__status--error { display: inline-flex; }\n.ghcn-subscribe-bar__status--success { color: var(--success, #15803d); }\n.ghcn-subscribe-bar__status--error { color: var(--destructive, #dc2626); }\n@media (max-width: 420px) { .ghcn-subscribe-bar__row { flex-direction: column; padding: 6px; } .ghcn-subscribe-bar__button { width: 100%; } }\n.ghcn-subscribe-bar__button:focus-visible, :where(.ghcn-subscribe-bar__button) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }"
41
+ }
42
+ ],
43
+ "gscan": {
44
+ "rules_satisfied": [
45
+ "GS010-PJ-VALID",
46
+ "GS050-MEMBERS-FORM"
47
+ ],
48
+ "notes": "Uses Ghost native data-members-form and respects portal_signup_checkbox_required."
49
+ },
50
+ "styleSlots": {
51
+ "class": [
52
+ ".ghcn-subscribe-bar"
53
+ ],
54
+ "inputClass": [
55
+ ".ghcn-subscribe-bar__input"
56
+ ],
57
+ "buttonClass": [
58
+ ".ghcn-subscribe-bar__button"
59
+ ]
60
+ }
61
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "switch",
3
+ "type": "components:ui",
4
+ "description": "Accessible zero-JS native toggle switch (role=\"switch\") 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": "Switch scale: sm, default, or lg.",
18
+ "options": [
19
+ "sm",
20
+ "default",
21
+ "lg"
22
+ ],
23
+ "default": "default"
24
+ },
25
+ "label": {
26
+ "description": "Primary switch label.",
27
+ "default": "Weekly digest email"
28
+ },
29
+ "description": {
30
+ "description": "Optional muted helper text below the label."
31
+ },
32
+ "name": {
33
+ "description": "Optional native form input name."
34
+ },
35
+ "value": {
36
+ "description": "Optional form value."
37
+ },
38
+ "checked": {
39
+ "description": "Boolean. Checked state."
40
+ },
41
+ "disabled": {
42
+ "description": "Boolean. Disabled state."
43
+ }
44
+ },
45
+ "files": [
46
+ {
47
+ "name": "switch.hbs",
48
+ "type": "partial",
49
+ "target": "partials/components/switch.hbs",
50
+ "content": "{{!-- Styling parameters: class, inputClass, labelClass --}}\n{{#with this as |ghostcnStyles|}}\n<label class=\"ghcn-ui-switch{{#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 <span class=\"ghcn-ui-switch__copy\">\n <span class=\"ghcn-ui-switch__label{{#if ghostcnStyles.labelClass}} {{ghostcnStyles.labelClass}}{{/if}}\">{{#if label}}{{label}}{{else}}Weekly digest email{{/if}}</span>\n {{#if description}}<span class=\"ghcn-ui-switch__desc\">{{description}}</span>{{/if}}\n </span>\n <span class=\"ghcn-ui-switch__control\">\n <input\n class=\"ghcn-ui-switch__input{{#if ghostcnStyles.inputClass}} {{ghostcnStyles.inputClass}}{{/if}}\"\n type=\"checkbox\"\n role=\"switch\"\n {{#if name}}name=\"{{name}}\"{{/if}}\n {{#if value}}value=\"{{value}}\"{{/if}}\n {{#if checked}}checked{{/if}}\n {{#if disabled}}disabled{{/if}}\n />\n <span class=\"ghcn-ui-switch__track\" aria-hidden=\"true\"><span class=\"ghcn-ui-switch__thumb\"></span></span>\n </span>\n</label>\n{{/with}}"
51
+ },
52
+ {
53
+ "name": "switch.css",
54
+ "type": "style",
55
+ "target": "assets/css/components/switch.css",
56
+ "content": ".ghcn-ui-switch { box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; font-family: inherit; font-size: var(--ghcn-text-small, 14px); color: var(--foreground); cursor: pointer; }\n.ghcn-ui-switch *, .ghcn-ui-switch *::before, .ghcn-ui-switch *::after { box-sizing: border-box; }\n.ghcn-ui-switch: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); padding: 14px 16px; transition: border-color 150ms ease, background-color 150ms ease; }\n.ghcn-ui-switch:where([data-variant=\"card\"]):hover { border-color: color-mix(in srgb, var(--foreground) 22%, var(--border)); }\n.ghcn-ui-switch:where([data-variant=\"card\"]):has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--card)); }\n.ghcn-ui-switch:has(input:disabled) { opacity: .55; cursor: not-allowed; }\n.ghcn-ui-switch__copy { display: grid; gap: 3px; min-width: 0; }\n.ghcn-ui-switch__label { font-weight: 600; line-height: 1.35; color: var(--foreground); }\n.ghcn-ui-switch__desc { font-size: 13px; line-height: 1.45; color: var(--muted-foreground); }\n.ghcn-ui-switch__control { position: relative; flex: 0 0 auto; display: inline-flex; }\n.ghcn-ui-switch__input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; }\n.ghcn-ui-switch__track { position: relative; display: inline-flex; align-items: center; width: 42px; height: 24px; padding: 2px; border-radius: 9999px; background: var(--input, var(--border)); transition: background-color 160ms ease; }\n.ghcn-ui-switch__thumb { width: 20px; height: 20px; border-radius: 9999px; background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, .22); transform: translateX(0); transition: transform 160ms ease; }\n.ghcn-ui-switch__input:checked + .ghcn-ui-switch__track { background: var(--primary); }\n.ghcn-ui-switch__input:checked + .ghcn-ui-switch__track .ghcn-ui-switch__thumb { transform: translateX(18px); }\n.ghcn-ui-switch__input:focus-visible + .ghcn-ui-switch__track { outline: 2px solid var(--ring, var(--primary)); outline-offset: 2px; }\n.ghcn-ui-switch:where([data-size=\"sm\"]) .ghcn-ui-switch__track { width: 34px; height: 20px; }\n.ghcn-ui-switch:where([data-size=\"sm\"]) .ghcn-ui-switch__thumb { width: 16px; height: 16px; }\n.ghcn-ui-switch:where([data-size=\"sm\"]) .ghcn-ui-switch__input:checked + .ghcn-ui-switch__track .ghcn-ui-switch__thumb { transform: translateX(14px); }\n.ghcn-ui-switch:where([data-size=\"lg\"]) .ghcn-ui-switch__track { width: 50px; height: 28px; }\n.ghcn-ui-switch:where([data-size=\"lg\"]) .ghcn-ui-switch__thumb { width: 24px; height: 24px; }\n.ghcn-ui-switch:where([data-size=\"lg\"]) .ghcn-ui-switch__input:checked + .ghcn-ui-switch__track .ghcn-ui-switch__thumb { transform: translateX(22px); }\n@media (prefers-reduced-motion: reduce) { .ghcn-ui-switch__track, .ghcn-ui-switch__thumb { transition: none; } }"
57
+ }
58
+ ],
59
+ "gscan": {
60
+ "rules_satisfied": [
61
+ "GS010-PJ-VALID"
62
+ ],
63
+ "notes": "Zero-JS native checkbox input with role=\"switch\"."
64
+ },
65
+ "styleSlots": {
66
+ "class": [
67
+ ".ghcn-ui-switch"
68
+ ],
69
+ "inputClass": [
70
+ ".ghcn-ui-switch__input"
71
+ ],
72
+ "labelClass": [
73
+ ".ghcn-ui-switch__label"
74
+ ]
75
+ }
76
+ }
@@ -4,12 +4,22 @@
4
4
  "description": "Progressively enhanced h2/h3 navigation with collision-safe anchors and keyboard focus.",
5
5
  "dependencies": [],
6
6
  "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "heading": {
9
+ "description": "Optional heading for the table of contents.",
10
+ "default": "On this page"
11
+ },
12
+ "contentSelector": {
13
+ "description": "CSS selector for the article container to scan.",
14
+ "default": ".ghcn-article-content"
15
+ }
16
+ },
7
17
  "files": [
8
18
  {
9
19
  "name": "table-of-contents.hbs",
10
20
  "type": "partial",
11
21
  "target": "partials/components/table-of-contents.hbs",
12
- "content": "{{!-- Styling parameters: class, titleClass, listClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- add manages the deferred script in default.hbs. Set contentSelector for existing themes. --}}\n<nav class=\"ghcn-toc{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-ghcn-toc data-toc-content=\"{{#if contentSelector}}{{contentSelector}}{{else}}.ghcn-article-content{{/if}}\" data-link-class=\"{{linkClass}}\" aria-label=\"{{#if heading}}{{heading}}{{else}}On this page{{/if}}\" hidden>\n <h2 class=\"ghcn-toc__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\"><svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"><path d=\"M5 5h11M5 10h8M5 15h5M2 5h.01M2 10h.01M2 15h.01\"/></svg>{{#if heading}}{{heading}}{{else}}On this page{{/if}}</h2>\n <ol class=\"ghcn-toc__list{{#if ghostcnStyles.listClass}} {{ghostcnStyles.listClass}}{{/if}}\" data-toc-list></ol>\n</nav>\n{{/with}}"
22
+ "content": "{{!-- Styling parameters: class, titleClass, listClass, linkClass --}}\n{{#with this as |ghostcnStyles|}}\n{{!-- add manages the deferred script in default.hbs. Set contentSelector for existing themes. --}}\n<nav class=\"ghcn-toc{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-ghcn-toc data-toc-content=\"{{#if contentSelector}}{{contentSelector}}{{else}}.ghcn-article-content{{/if}}\" data-link-class=\"{{linkClass}}\" aria-label=\"{{#if heading}}{{heading}}{{else}}On this page{{/if}}\" hidden>\n <h2 class=\"ghcn-toc__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\"><svg aria-hidden=\"true\" viewBox=\"0 0 20 20\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"><path d=\"M5 5h11M5 10h8M5 15h5M2 5h.01M2 10h.01M2 15h.01\"/></svg>{{#if heading}}{{heading}}{{else}}On this page{{/if}}</h2>\n <ol class=\"ghcn-toc__list{{#if ghostcnStyles.listClass}} {{ghostcnStyles.listClass}}{{/if}}\" data-toc-list></ol>\n</nav>\n{{/with}}"
13
23
  },
14
24
  {
15
25
  "name": "table-of-contents.css",
@@ -21,7 +31,7 @@
21
31
  "name": "table-of-contents.js",
22
32
  "type": "js",
23
33
  "target": "assets/js/components/table-of-contents.js",
24
- "content": "/* ghostcn table of contents: no dependencies, no HTML injection, repeat-safe. */\n(() => {\n function setCurrent(group, index) {\n if (index === group.current) return;\n group.views.forEach(links => {\n links[group.current]?.removeAttribute('aria-current');\n links[index]?.setAttribute('aria-current', 'location');\n });\n group.current = index;\n }\n\n function currentFromScroll(group) {\n const { headings } = group;\n const offset = Math.max(0, parseFloat(getComputedStyle(headings[0]).scrollMarginBlockStart) || 0);\n const limit = Math.min(offset + 4, window.innerHeight / 2);\n let index = 0;\n for (let i = 0; i < headings.length; i++) {\n if (headings[i].getBoundingClientRect().top > limit) break;\n index = i;\n }\n // The final heading may never reach the activation line on a short section.\n const page = document.scrollingElement;\n if (page && page.scrollHeight > page.clientHeight + 2 &&\n page.scrollTop + page.clientHeight >= page.scrollHeight - 2 &&\n headings.at(-1).getBoundingClientRect().top < window.innerHeight) {\n index = headings.length - 1;\n }\n setCurrent(group, index);\n }\n\n const init = () => {\n const groups = new Map();\n const used = new Set([...document.querySelectorAll('[id]')].map(el => el.id));\n document.querySelectorAll('[data-ghcn-toc]').forEach(nav => {\n if (nav.dataset.ghcnTocReady) return;\n let content;\n try { content = document.querySelector(nav.dataset.tocContent); } catch { return; }\n if (!content) return;\n const list = nav.querySelector('[data-toc-list]');\n if (!list) return;\n let group = groups.get(content);\n if (!group) {\n // Editor card UI titles are not article sections.\n const headings = [...content.querySelectorAll('h2, h3')]\n .filter(h => h.textContent.trim() && !h.closest('.kg-card, [hidden], [data-ghcn-toc]'));\n if (headings.length < 2) return;\n headings.forEach((heading, index) => {\n if (!heading.id) {\n const base = 'ghcn-' + (heading.textContent.toLowerCase().normalize('NFKD').replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') || 'section-' + (index + 1));\n let id = base, suffix = 2;\n while (used.has(id)) id = base + '-' + suffix++;\n heading.id = id; used.add(id);\n }\n heading.setAttribute('data-ghcn-toc-heading', '');\n });\n group = { headings, views: [], current: -1, jumpY: null };\n groups.set(content, group);\n }\n const links = group.headings.map((heading, index) => {\n const item = document.createElement('li');\n item.className = 'ghcn-toc__item' + (heading.tagName === 'H3' ? ' ghcn-toc__item--nested' : '');\n const link = document.createElement('a');\n link.className = 'ghcn-toc__link';\n if (nav.dataset.linkClass) nav.dataset.linkClass.split(/\\s+/).filter(Boolean).forEach(value => link.classList.add(value));\n link.href = '#' + encodeURIComponent(heading.id);\n link.textContent = heading.textContent.trim();\n link.addEventListener('click', event => {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n event.preventDefault();\n heading.scrollIntoView({ behavior: 'instant', block: 'start' });\n if (!heading.hasAttribute('tabindex')) {\n heading.setAttribute('tabindex', '-1');\n heading.addEventListener('blur', () => heading.removeAttribute('tabindex'), { once: true });\n }\n heading.focus({ preventScroll: true });\n try { history.replaceState(null, '', '#' + encodeURIComponent(heading.id)); } catch {}\n group.jumpY = window.scrollY;\n setCurrent(group, index);\n });\n item.append(link); list.append(item);\n return link;\n });\n group.views.push(links);\n nav.dataset.ghcnTocReady = 'true'; nav.hidden = false;\n });\n if (!groups.size) return;\n\n function syncHash() {\n let id = '';\n try { id = decodeURIComponent(location.hash.slice(1)); } catch {}\n groups.forEach(group => {\n const index = group.headings.findIndex(heading => heading.id === id);\n group.jumpY = index < 0 ? null : window.scrollY;\n if (index < 0) currentFromScroll(group);\n else setCurrent(group, index);\n });\n }\n\n let frame = 0;\n const schedule = () => {\n if (frame) return;\n frame = requestAnimationFrame(() => {\n frame = 0;\n groups.forEach(group => {\n if (group.jumpY !== null && Math.abs(group.jumpY - window.scrollY) < 2) return;\n group.jumpY = null;\n currentFromScroll(group);\n });\n });\n };\n syncHash();\n window.addEventListener('scroll', schedule, { passive: true });\n window.addEventListener('resize', schedule);\n window.addEventListener('load', schedule, { once: true });\n window.addEventListener('hashchange', syncHash);\n };\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true }); else init();\n})();"
34
+ "content": "/* ghostcn table of contents: no dependencies, no HTML injection, repeat-safe. */\n(() => {\n function setCurrent(group, index) {\n if (index === group.current) return;\n group.views.forEach(links => {\n links[group.current]?.removeAttribute('aria-current');\n links[index]?.setAttribute('aria-current', 'location');\n });\n group.current = index;\n }\n\n function currentFromScroll(group) {\n const { headings } = group;\n const offset = Math.max(0, parseFloat(getComputedStyle(headings[0]).scrollMarginBlockStart) || 0);\n const limit = Math.min(offset + 4, window.innerHeight / 2);\n let index = 0;\n for (let i = 0; i < headings.length; i++) {\n if (headings[i].getBoundingClientRect().top > limit) break;\n index = i;\n }\n // The final heading may never reach the activation line on a short section.\n const page = document.scrollingElement;\n if (page && page.scrollHeight > page.clientHeight + 2 &&\n page.scrollTop + page.clientHeight >= page.scrollHeight - 2 &&\n headings.at(-1).getBoundingClientRect().top < window.innerHeight) {\n index = headings.length - 1;\n }\n setCurrent(group, index);\n }\n\n const init = () => {\n const groups = new Map();\n const used = new Set([...document.querySelectorAll('[id]')].map(el => el.id));\n document.querySelectorAll('[data-ghcn-toc]').forEach(nav => {\n if (nav.dataset.ghcnTocReady) return;\n let content;\n try { content = document.querySelector(nav.dataset.tocContent); } catch { return; }\n if (!content) return;\n const list = nav.querySelector('[data-toc-list]');\n if (!list) return;\n let group = groups.get(content);\n if (!group) {\n // Editor card UI titles are not article sections.\n const headings = [...content.querySelectorAll('h2, h3')]\n .filter(h => h.textContent.trim() && !h.closest('.kg-card, [hidden], [data-ghcn-toc]'));\n if (headings.length < 2) return;\n headings.forEach((heading, index) => {\n if (!heading.id) {\n const slug = heading.textContent.toLowerCase().normalize('NFKD').replace(/[̀-ͯ]/g, '').replace(/[^p{L}p{N}]+/gu, '-').replace(/^-|-$/g, '');\n const base = 'ghcn-' + (slug || 'section-' + (index + 1));\n let id = base, suffix = 2;\n while (used.has(id)) id = base + '-' + suffix++;\n heading.id = id; used.add(id);\n }\n heading.setAttribute('data-ghcn-toc-heading', '');\n });\n group = { headings, views: [], current: -1, jumpY: null };\n groups.set(content, group);\n }\n const links = group.headings.map((heading, index) => {\n const item = document.createElement('li');\n item.className = 'ghcn-toc__item' + (heading.tagName === 'H3' ? ' ghcn-toc__item--nested' : '');\n const link = document.createElement('a');\n link.className = 'ghcn-toc__link';\n if (nav.dataset.linkClass) nav.dataset.linkClass.split(/\\s+/).filter(Boolean).forEach(value => link.classList.add(value));\n link.href = '#' + encodeURIComponent(heading.id);\n link.textContent = heading.textContent.trim();\n link.addEventListener('click', event => {\n if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;\n event.preventDefault();\n heading.scrollIntoView({ behavior: 'instant', block: 'start' });\n if (!heading.hasAttribute('tabindex')) {\n heading.setAttribute('tabindex', '-1');\n heading.addEventListener('blur', () => heading.removeAttribute('tabindex'), { once: true });\n }\n heading.focus({ preventScroll: true });\n try { history.replaceState(null, '', '#' + encodeURIComponent(heading.id)); } catch {}\n group.jumpY = window.scrollY;\n setCurrent(group, index);\n });\n item.append(link); list.append(item);\n return link;\n });\n group.views.push(links);\n nav.dataset.ghcnTocReady = 'true'; nav.hidden = false;\n });\n if (!groups.size) return;\n\n function syncHash() {\n let id = '';\n try { id = decodeURIComponent(location.hash.slice(1)); } catch {}\n groups.forEach(group => {\n const index = group.headings.findIndex(heading => heading.id === id);\n group.jumpY = index < 0 ? null : window.scrollY;\n if (index < 0) currentFromScroll(group);\n else setCurrent(group, index);\n });\n }\n\n let frame = 0;\n const schedule = () => {\n if (frame) return;\n frame = requestAnimationFrame(() => {\n frame = 0;\n groups.forEach(group => {\n if (group.jumpY !== null && Math.abs(group.jumpY - window.scrollY) < 2) return;\n group.jumpY = null;\n currentFromScroll(group);\n });\n });\n };\n syncHash();\n window.addEventListener('scroll', schedule, { passive: true });\n window.addEventListener('resize', schedule);\n window.addEventListener('load', schedule, { once: true });\n window.addEventListener('hashchange', syncHash);\n };\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true }); else init();\n})();"
25
35
  }
26
36
  ],
27
37
  "gscan": {
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "tabs",
3
+ "type": "components:ui",
4
+ "description": "Accessible tabbed panel switcher with underline, pills, and boxed variants plus arrow-key navigation.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Tab bar treatment (underline default, pills, or boxed).",
10
+ "options": [
11
+ "default",
12
+ "pills",
13
+ "boxed"
14
+ ],
15
+ "default": "default"
16
+ },
17
+ "ariaLabel": {
18
+ "description": "Accessible label for the tablist.",
19
+ "default": "Content tabs"
20
+ },
21
+ "tab1Label": {
22
+ "description": "First tab label.",
23
+ "default": "Overview"
24
+ },
25
+ "tab1Body": {
26
+ "description": "First tab escaped text body."
27
+ },
28
+ "tab2Label": {
29
+ "description": "Optional second tab label."
30
+ },
31
+ "tab2Body": {
32
+ "description": "Second tab escaped text body."
33
+ },
34
+ "tab3Label": {
35
+ "description": "Optional third tab label."
36
+ },
37
+ "tab3Body": {
38
+ "description": "Third tab escaped text body."
39
+ }
40
+ },
41
+ "files": [
42
+ {
43
+ "name": "tabs.hbs",
44
+ "type": "partial",
45
+ "target": "partials/components/tabs.hbs",
46
+ "content": "{{!-- Styling parameters: class, listClass, triggerClass, panelClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-tabs{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-ghcn-tabs data-variant=\"{{#match variant \"pills\"}}pills{{else}}{{#match variant \"boxed\"}}boxed{{else}}default{{/match}}{{/match}}\">\n <div class=\"ghcn-tabs__list{{#if ghostcnStyles.listClass}} {{ghostcnStyles.listClass}}{{/if}}\" role=\"tablist\" aria-label=\"{{#if ariaLabel}}{{ariaLabel}}{{else}}Content tabs{{/if}}\">\n <button type=\"button\" class=\"ghcn-tabs__trigger{{#if ghostcnStyles.triggerClass}} {{ghostcnStyles.triggerClass}}{{/if}}\" role=\"tab\" data-tab-trigger aria-selected=\"true\" tabindex=\"0\">{{#if tab1Label}}{{tab1Label}}{{else}}Overview{{/if}}</button>\n {{#if tab2Label}}<button type=\"button\" class=\"ghcn-tabs__trigger{{#if ghostcnStyles.triggerClass}} {{ghostcnStyles.triggerClass}}{{/if}}\" role=\"tab\" data-tab-trigger aria-selected=\"false\" tabindex=\"-1\">{{tab2Label}}</button>{{/if}}\n {{#if tab3Label}}<button type=\"button\" class=\"ghcn-tabs__trigger{{#if ghostcnStyles.triggerClass}} {{ghostcnStyles.triggerClass}}{{/if}}\" role=\"tab\" data-tab-trigger aria-selected=\"false\" tabindex=\"-1\">{{tab3Label}}</button>{{/if}}\n </div>\n <div class=\"ghcn-tabs__panel{{#if ghostcnStyles.panelClass}} {{ghostcnStyles.panelClass}}{{/if}}\" role=\"tabpanel\" data-tab-panel>\n {{#> @partial-block}}{{#if tab1Body}}<p>{{tab1Body}}</p>{{else}}<p>Use tabs to organize related content without cluttering the page.</p>{{/if}}{{/@partial-block}}\n </div>\n {{#if tab2Label}}\n <div class=\"ghcn-tabs__panel{{#if ghostcnStyles.panelClass}} {{ghostcnStyles.panelClass}}{{/if}}\" role=\"tabpanel\" data-tab-panel hidden>\n {{#if tab2Body}}<p>{{tab2Body}}</p>{{/if}}\n </div>\n {{/if}}\n {{#if tab3Label}}\n <div class=\"ghcn-tabs__panel{{#if ghostcnStyles.panelClass}} {{ghostcnStyles.panelClass}}{{/if}}\" role=\"tabpanel\" data-tab-panel hidden>\n {{#if tab3Body}}<p>{{tab3Body}}</p>{{/if}}\n </div>\n {{/if}}\n</div>\n{{/with}}"
47
+ },
48
+ {
49
+ "name": "tabs.css",
50
+ "type": "style",
51
+ "target": "assets/css/components/tabs.css",
52
+ "content": ".ghcn-tabs { box-sizing: border-box; font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-tabs *, .ghcn-tabs *::before, .ghcn-tabs *::after { box-sizing: border-box; }\n.ghcn-tabs:focus-visible, :where(.ghcn-tabs) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n.ghcn-tabs { width: 100%; }\n.ghcn-tabs__list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; border-bottom: 1px solid var(--border); }\n.ghcn-tabs:where([data-variant=\"pills\"]) .ghcn-tabs__list { border-bottom: 0; gap: 6px; }\n.ghcn-tabs:where([data-variant=\"boxed\"]) .ghcn-tabs__list { display: inline-flex; border-bottom: 0; padding: 4px; border: 1px solid var(--border); border-radius: var(--ghcn-control-radius, var(--radius, 8px)); background: var(--secondary); }\n.ghcn-tabs__trigger { position: relative; padding: 9px 14px; border: 1px solid transparent; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted-foreground); font: inherit; font-size: var(--ghcn-text-small, 14px); font-weight: 600; cursor: pointer; transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease; }\n.ghcn-tabs__trigger:hover { color: var(--foreground); }\n.ghcn-tabs__trigger[aria-selected=\"true\"] { color: var(--foreground); border-bottom-color: var(--primary); }\n.ghcn-tabs:where([data-variant=\"pills\"]) .ghcn-tabs__trigger { margin-bottom: 0; padding: 6px 13px; border-radius: 9999px; border: 1px solid transparent; }\n.ghcn-tabs:where([data-variant=\"pills\"]) .ghcn-tabs__trigger[aria-selected=\"true\"] { background: var(--primary); color: var(--primary-foreground); border-color: transparent; }\n.ghcn-tabs:where([data-variant=\"boxed\"]) .ghcn-tabs__trigger { margin-bottom: 0; padding: 6px 13px; border-radius: calc(var(--ghcn-control-radius, var(--radius, 8px)) - 2px); border: 1px solid transparent; }\n.ghcn-tabs:where([data-variant=\"boxed\"]) .ghcn-tabs__trigger[aria-selected=\"true\"] { background: var(--background); color: var(--foreground); border-color: var(--border); box-shadow: 0 1px 2px #0001; }\n.ghcn-tabs__panel { padding-top: 16px; color: var(--muted-foreground); font-size: var(--ghcn-text-small, 14px); }\n.ghcn-tabs__panel[hidden] { display: none; }\n.ghcn-tabs__panel > :first-child { margin-top: 0; }\n.ghcn-tabs__panel > :last-child { margin-bottom: 0; }\n@media (prefers-reduced-motion: reduce) { .ghcn-tabs__trigger { transition: none; } }\n"
53
+ },
54
+ {
55
+ "name": "tabs.js",
56
+ "type": "js",
57
+ "target": "assets/js/components/tabs.js",
58
+ "content": "/* ghostcn tabs: accessible WAI-ARIA tablist with arrow-key navigation and zero-JS fallback. */\n(() => {\n function init() {\n document.querySelectorAll('[data-ghcn-tabs]').forEach(root => {\n if (root.dataset.ghcnTabsReady) return;\n const buttons = [...root.querySelectorAll('[data-tab-trigger]')];\n const panels = [...root.querySelectorAll('[data-tab-panel]')];\n if (!buttons.length || !panels.length) return;\n root.dataset.ghcnTabsReady = 'true';\n const activate = (index, focus) => {\n const idx = ((index % buttons.length) + buttons.length) % buttons.length;\n buttons.forEach((btn, i) => {\n const active = i === idx;\n btn.setAttribute('aria-selected', String(active));\n btn.tabIndex = active ? 0 : -1;\n if (active && focus) btn.focus();\n });\n panels.forEach((panel, i) => { panel.hidden = i !== idx; });\n };\n buttons.forEach((btn, index) => {\n btn.addEventListener('click', () => activate(index, false));\n btn.addEventListener('keydown', event => {\n if (event.key === 'ArrowRight') { event.preventDefault(); activate(index + 1, true); }\n else if (event.key === 'ArrowLeft') { event.preventDefault(); activate(index - 1, true); }\n else if (event.key === 'Home') { event.preventDefault(); activate(0, true); }\n else if (event.key === 'End') { event.preventDefault(); activate(buttons.length - 1, true); }\n });\n });\n activate(0, false);\n });\n }\n if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true });\n else init();\n})();"
59
+ }
60
+ ],
61
+ "gscan": {
62
+ "rules_satisfied": [
63
+ "GS010-PJ-VALID"
64
+ ],
65
+ "notes": "Self-contained Ghostcn UI primitive."
66
+ },
67
+ "styleSlots": {
68
+ "class": [
69
+ ".ghcn-tabs"
70
+ ],
71
+ "listClass": [
72
+ ".ghcn-tabs__list"
73
+ ],
74
+ "triggerClass": [
75
+ ".ghcn-tabs__trigger"
76
+ ],
77
+ "panelClass": [
78
+ ".ghcn-tabs__panel"
79
+ ]
80
+ }
81
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "tag-bar",
3
+ "type": "components:content",
4
+ "description": "Horizontal snap-scrolling topic bar populated from public Ghost tags for quick category browsing.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Bar style: default, outline, or underline.",
10
+ "options": [
11
+ "default",
12
+ "outline",
13
+ "underline"
14
+ ],
15
+ "default": "default"
16
+ },
17
+ "allLabel": {
18
+ "description": "Label for the leading \"All stories\" link.",
19
+ "default": "All stories"
20
+ },
21
+ "hideAll": {
22
+ "description": "Hide the leading \"All stories\" link when true."
23
+ },
24
+ "showCounts": {
25
+ "description": "Display post counts next to each tag when true."
26
+ },
27
+ "ariaLabel": {
28
+ "description": "Accessible navigation label.",
29
+ "default": "Browse topics"
30
+ }
31
+ },
32
+ "files": [
33
+ {
34
+ "name": "tag-bar.hbs",
35
+ "type": "partial",
36
+ "target": "partials/components/tag-bar.hbs",
37
+ "content": "{{!-- Styling parameters: class, listClass, linkClass --}}\n{{#with this as |ghostcnStyles|}}\n{{#get \"tags\" filter=\"visibility:public\" limit=\"20\" include=\"count.posts\"}}\n{{#if tags}}\n<nav class=\"ghcn-tag-bar{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" data-variant=\"{{#match ghostcnStyles.variant \"outline\"}}outline{{else}}{{#match ghostcnStyles.variant \"underline\"}}underline{{else}}default{{/match}}{{/match}}\" aria-label=\"{{#if ghostcnStyles.ariaLabel}}{{ghostcnStyles.ariaLabel}}{{else}}Browse topics{{/if}}\">\n <ul class=\"ghcn-tag-bar__list{{#if ghostcnStyles.listClass}} {{ghostcnStyles.listClass}}{{/if}}\" role=\"list\">\n {{#unless ghostcnStyles.hideAll}}\n <li class=\"ghcn-tag-bar__item\">\n <a class=\"ghcn-tag-bar__link{{#if ghostcnStyles.linkClass}} {{ghostcnStyles.linkClass}}{{/if}} ghcn-tag-bar__link--all\" href=\"{{@site.url}}\">{{#if ghostcnStyles.allLabel}}{{ghostcnStyles.allLabel}}{{else}}All stories{{/if}}</a>\n </li>\n {{/unless}}\n {{#foreach tags visibility=\"public\"}}\n <li class=\"ghcn-tag-bar__item\">\n <a class=\"ghcn-tag-bar__link{{#if ghostcnStyles.linkClass}} {{ghostcnStyles.linkClass}}{{/if}}\" href=\"{{url}}\">\n <span>{{name}}</span>\n {{#if ghostcnStyles.showCounts}}{{#if count.posts}}<span class=\"ghcn-tag-bar__count\">{{count.posts}}</span>{{/if}}{{/if}}\n </a>\n </li>\n {{/foreach}}\n </ul>\n</nav>\n{{/if}}\n{{/get}}\n{{/with}}"
38
+ },
39
+ {
40
+ "name": "tag-bar.css",
41
+ "type": "style",
42
+ "target": "assets/css/components/tag-bar.css",
43
+ "content": ".ghcn-tag-bar { 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); width: min(100% - 32px, 1152px); margin-inline: auto; margin-block: 16px; }\n.ghcn-tag-bar *, .ghcn-tag-bar *::before, .ghcn-tag-bar *::after { box-sizing: border-box; }\n.ghcn-tag-bar__list { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 2px; list-style: none; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }\n.ghcn-tag-bar__list::-webkit-scrollbar { display: none; }\n.ghcn-tag-bar__item { flex: 0 0 auto; scroll-snap-align: start; }\n.ghcn-tag-bar__link { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border: 1px solid transparent; border-radius: 9999px; background: var(--secondary); color: var(--secondary-foreground); font-size: 13.5px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }\n.ghcn-tag-bar__link:hover { background: var(--primary); color: var(--primary-foreground); }\n.ghcn-tag-bar__link--all { background: var(--primary); color: var(--primary-foreground); font-weight: 600; }\n.ghcn-tag-bar__link--all:hover { opacity: .9; }\n.ghcn-tag-bar__count { font-size: 11.5px; opacity: .72; font-variant-numeric: tabular-nums; }\n.ghcn-tag-bar:where([data-variant=\"outline\"]) .ghcn-tag-bar__link { background: var(--card, var(--background)); border-color: var(--border); color: var(--muted-foreground); }\n.ghcn-tag-bar:where([data-variant=\"outline\"]) .ghcn-tag-bar__link:hover { border-color: var(--foreground); color: var(--foreground); background: var(--secondary); }\n.ghcn-tag-bar:where([data-variant=\"outline\"]) .ghcn-tag-bar__link--all { border-color: var(--foreground); background: var(--foreground); color: var(--background); }\n.ghcn-tag-bar:where([data-variant=\"underline\"]) .ghcn-tag-bar__list { gap: 4px; padding: 0; border-bottom: 1px solid var(--border); }\n.ghcn-tag-bar:where([data-variant=\"underline\"]) .ghcn-tag-bar__link { min-height: 40px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted-foreground); margin-bottom: -1px; }\n.ghcn-tag-bar:where([data-variant=\"underline\"]) .ghcn-tag-bar__link:hover { color: var(--foreground); border-bottom-color: var(--border); background: transparent; }\n.ghcn-tag-bar:where([data-variant=\"underline\"]) .ghcn-tag-bar__link--all { color: var(--foreground); border-bottom-color: var(--primary); background: transparent; }\n.ghcn-tag-bar:focus-visible, :where(.ghcn-tag-bar) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }"
44
+ }
45
+ ],
46
+ "gscan": {
47
+ "rules_satisfied": [
48
+ "GS010-PJ-VALID"
49
+ ],
50
+ "notes": "Uses Ghost native #get tags helper with public visibility filtering."
51
+ },
52
+ "styleSlots": {
53
+ "class": [
54
+ ".ghcn-tag-bar"
55
+ ],
56
+ "listClass": [
57
+ ".ghcn-tag-bar__list"
58
+ ],
59
+ "linkClass": [
60
+ ".ghcn-tag-bar__link"
61
+ ]
62
+ }
63
+ }
@@ -29,7 +29,7 @@
29
29
  "name": "tag-grid.hbs",
30
30
  "type": "partial",
31
31
  "target": "partials/components/tag-grid.hbs",
32
- "content": "{{!-- Styling parameters: class, titleClass, gridClass --}}\n{{#with this as |ghostcnStyles|}}\n{{#get \"tags\" filter=\"visibility:public\" limit=\"100\" include=\"count.posts\"}}\n{{#if tags}}<section class=\"ghcn-tag-grid{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" aria-label=\"Topics\">\n {{#if ghostcnStyles.heading}}<h2 class=\"ghcn-tag-grid__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{ghostcnStyles.heading}}</h2>{{/if}}\n <div class=\"ghcn-tag-grid__grid{{#if ghostcnStyles.gridClass}} {{ghostcnStyles.gridClass}}{{/if}}\">{{#foreach tags visibility=\"public\"}}\n {{#> \"components/card\" heading=name description=description class=ghostcnStyles.cardClass titleClass=ghostcnStyles.cardTitleClass descriptionClass=ghostcnStyles.descriptionClass variant=ghostcnStyles.cardVariant}}\n {{> \"components/button\" href=url text=\"Explore topic\" variant=\"outline\" size=\"sm\" class=ghostcnStyles.buttonClass}}\n {{/components/card}}\n {{/foreach}}</div>\n</section>{{else}}{{#if ghostcnStyles.emptyText}}<section class=\"ghcn-tag-grid{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\"><p class=\"ghcn-tag-grid__empty\">{{ghostcnStyles.emptyText}}</p></section>{{/if}}{{/if}}\n{{/get}}\n{{/with}}"
32
+ "content": "{{!-- Styling parameters: class, titleClass, gridClass, cardClass, cardTitleClass, descriptionClass, buttonClass --}}\n{{#with this as |ghostcnStyles|}}\n{{#get \"tags\" filter=\"visibility:public\" limit=\"100\" include=\"count.posts\"}}\n{{#if tags}}<section class=\"ghcn-tag-grid{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\" aria-label=\"Topics\">\n {{#if ghostcnStyles.heading}}<h2 class=\"ghcn-tag-grid__title{{#if ghostcnStyles.titleClass}} {{ghostcnStyles.titleClass}}{{/if}}\">{{ghostcnStyles.heading}}</h2>{{/if}}\n <div class=\"ghcn-tag-grid__grid{{#if ghostcnStyles.gridClass}} {{ghostcnStyles.gridClass}}{{/if}}\">{{#foreach tags visibility=\"public\"}}\n {{#> \"components/card\" heading=name description=description class=ghostcnStyles.cardClass titleClass=ghostcnStyles.cardTitleClass descriptionClass=ghostcnStyles.descriptionClass variant=ghostcnStyles.cardVariant}}\n {{> \"components/button\" href=url text=\"Explore topic\" ariaLabel=name variant=\"outline\" size=\"sm\" class=ghostcnStyles.buttonClass}}\n {{/components/card}}\n {{/foreach}}</div>\n</section>{{else}}{{#if ghostcnStyles.emptyText}}<section class=\"ghcn-tag-grid{{#if ghostcnStyles.class}} {{ghostcnStyles.class}}{{/if}}\"><p class=\"ghcn-tag-grid__empty\">{{ghostcnStyles.emptyText}}</p></section>{{/if}}{{/if}}\n{{/get}}\n{{/with}}"
33
33
  },
34
34
  {
35
35
  "name": "tag-grid.css",
@@ -15,7 +15,7 @@
15
15
  "name": "tag-list.css",
16
16
  "type": "style",
17
17
  "target": "assets/css/components/tag-list.css",
18
- "content": "\n.ghcn-tag-list { 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-tag-list__items { display: flex; flex-wrap: wrap; gap: .5em; list-style: none; padding: 0; margin: 0; }\n.ghcn-tag-list__link { display: block; padding: 5px 10px; background: var(--secondary); color: var(--secondary-foreground); border: 1px solid var(--border); border-radius: 999px; font-size: var(--ghcn-text-meta, 13px); font-weight: 600; text-decoration: none; }\n.ghcn-tag-list__link:hover { background: var(--secondary); text-decoration: underline; }\n.ghcn-tag-list__link:focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n"
18
+ "content": "\n.ghcn-tag-list { 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-tag-list__items { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }\n.ghcn-tag-list__link { display: block; padding: 5px 10px; background: var(--secondary); color: var(--secondary-foreground); border: 1px solid var(--border); border-radius: 999px; font-size: var(--ghcn-text-meta, 13px); font-weight: 600; text-decoration: none; }\n.ghcn-tag-list__link:hover { background: var(--secondary); text-decoration: underline; }\n.ghcn-tag-list__link:focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n"
19
19
  }
20
20
  ],
21
21
  "gscan": {
@@ -0,0 +1,95 @@
1
+ {
2
+ "name": "textarea",
3
+ "type": "components:ui",
4
+ "description": "Accessible labeled multiline textarea with optional hint, invalid, and disabled states.",
5
+ "dependencies": [],
6
+ "ghost_version": ">=5.0.0",
7
+ "parameters": {
8
+ "variant": {
9
+ "description": "Field surface style.",
10
+ "options": [
11
+ "default",
12
+ "filled"
13
+ ],
14
+ "default": "default"
15
+ },
16
+ "size": {
17
+ "description": "Field scale.",
18
+ "options": [
19
+ "sm",
20
+ "default",
21
+ "lg"
22
+ ],
23
+ "default": "default"
24
+ },
25
+ "label": {
26
+ "description": "Visible accessible label.",
27
+ "default": "Message"
28
+ },
29
+ "name": {
30
+ "description": "Form field name."
31
+ },
32
+ "id": {
33
+ "description": "Optional unique ID."
34
+ },
35
+ "rows": {
36
+ "description": "Initial visible text rows.",
37
+ "default": "4"
38
+ },
39
+ "value": {
40
+ "description": "Initial value."
41
+ },
42
+ "placeholder": {
43
+ "description": "Optional placeholder."
44
+ },
45
+ "hint": {
46
+ "description": "Optional help text."
47
+ },
48
+ "hintId": {
49
+ "description": "Unique ID for help text."
50
+ },
51
+ "invalid": {
52
+ "description": "Boolean invalid state."
53
+ },
54
+ "required": {
55
+ "description": "Boolean required state."
56
+ },
57
+ "disabled": {
58
+ "description": "Boolean disabled state."
59
+ }
60
+ },
61
+ "files": [
62
+ {
63
+ "name": "textarea.hbs",
64
+ "type": "partial",
65
+ "target": "partials/components/textarea.hbs",
66
+ "content": "{{!-- Styling parameters: class, labelClass, inputClass, descriptionClass --}}\n{{#with this as |ghostcnStyles|}}\n<div class=\"ghcn-ui-textarea{{#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-textarea__label\">\n <span class=\"ghcn-ui-textarea__label-text{{#if ghostcnStyles.labelClass}} {{ghostcnStyles.labelClass}}{{/if}}\">{{#if label}}{{label}}{{else}}Message{{/if}}{{#if required}} (required){{/if}}</span>\n <textarea class=\"ghcn-ui-textarea__control{{#if ghostcnStyles.inputClass}} {{ghostcnStyles.inputClass}}{{/if}}\" rows=\"{{#if rows}}{{rows}}{{else}}4{{/if}}\"{{#if id}} id=\"{{id}}\"{{/if}}{{#if name}} name=\"{{name}}\"{{/if}}{{#if placeholder}} placeholder=\"{{placeholder}}\"{{/if}}{{#if required}} required{{/if}}{{#if disabled}} disabled{{/if}}{{#if invalid}} aria-invalid=\"true\"{{/if}}{{#if hint}}{{#if hintId}} aria-describedby=\"{{hintId}}\"{{/if}}{{/if}}>{{value}}</textarea>\n </label>\n {{#if hint}}<p class=\"ghcn-ui-textarea__hint{{#if ghostcnStyles.descriptionClass}} {{ghostcnStyles.descriptionClass}}{{/if}}\"{{#if hintId}} id=\"{{hintId}}\"{{/if}}>{{hint}}</p>{{/if}}\n</div>\n{{/with}}"
67
+ },
68
+ {
69
+ "name": "textarea.css",
70
+ "type": "style",
71
+ "target": "assets/css/components/textarea.css",
72
+ "content": ".ghcn-ui-textarea { box-sizing: border-box; font-family: inherit; font-size: var(--ghcn-text-body, 16px); line-height: 1.5; color: var(--foreground); }\n.ghcn-ui-textarea *, .ghcn-ui-textarea *::before, .ghcn-ui-textarea *::after { box-sizing: border-box; }\n.ghcn-ui-textarea:focus-visible, :where(.ghcn-ui-textarea) :focus-visible { outline: 2px solid var(--ring, currentColor); outline-offset: 2px; }\n.ghcn-ui-textarea { width: 100%; }\n.ghcn-ui-textarea__label { display: grid; gap: 6px; font-weight: 500; font-size: var(--ghcn-text-small, 14px); }\n.ghcn-ui-textarea__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; width: 100%; min-width: 0; border: 1px solid var(--input); background: var(--background); color: var(--foreground); font-family: inherit; resize: vertical; transition: border-color 150ms ease, background-color 150ms ease; }\n.ghcn-ui-textarea:where([data-size=\"sm\"]) .ghcn-ui-textarea__control { padding: 7px 11px; font-size: 13px; }\n.ghcn-ui-textarea:where([data-size=\"lg\"]) .ghcn-ui-textarea__control { padding: 12px 16px; font-size: 16px; }\n.ghcn-ui-textarea:where([data-variant=\"filled\"]) .ghcn-ui-textarea__control { background: var(--muted); }\n.ghcn-ui-textarea__control::placeholder { color: var(--muted-foreground); }\n.ghcn-ui-textarea__control[aria-invalid=\"true\"] { border-color: var(--destructive); }\n.ghcn-ui-textarea__control:disabled { opacity: .5; cursor: not-allowed; }\n.ghcn-ui-textarea__hint { color: var(--muted-foreground); font-size: 13px; margin: 6px 0 0; }\n@media (prefers-reduced-motion: reduce) { .ghcn-ui-textarea__control { transition: none; } }\n"
73
+ }
74
+ ],
75
+ "gscan": {
76
+ "rules_satisfied": [
77
+ "GS010-PJ-VALID"
78
+ ],
79
+ "notes": "Self-contained Ghostcn UI primitive."
80
+ },
81
+ "styleSlots": {
82
+ "class": [
83
+ ".ghcn-ui-textarea"
84
+ ],
85
+ "labelClass": [
86
+ ".ghcn-ui-textarea__label-text"
87
+ ],
88
+ "inputClass": [
89
+ ".ghcn-ui-textarea__control"
90
+ ],
91
+ "descriptionClass": [
92
+ ".ghcn-ui-textarea__hint"
93
+ ]
94
+ }
95
+ }