@grove-dev/cli 0.7.0 → 0.9.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 (187) hide show
  1. package/README.md +53 -13
  2. package/dist/audit-cli.d.ts +1 -1
  3. package/dist/audit-cli.d.ts.map +1 -1
  4. package/dist/audit-cli.js +11 -11
  5. package/dist/audit-cli.js.map +1 -1
  6. package/dist/audit.d.ts +4 -4
  7. package/dist/audit.d.ts.map +1 -1
  8. package/dist/audit.js +91 -51
  9. package/dist/audit.js.map +1 -1
  10. package/dist/collection-cli.d.ts.map +1 -1
  11. package/dist/collection-cli.js +1 -1
  12. package/dist/collection-cli.js.map +1 -1
  13. package/dist/diff.d.ts +43 -0
  14. package/dist/diff.d.ts.map +1 -0
  15. package/dist/diff.js +70 -0
  16. package/dist/diff.js.map +1 -0
  17. package/dist/hash.d.ts +36 -0
  18. package/dist/hash.d.ts.map +1 -0
  19. package/dist/hash.js +82 -0
  20. package/dist/hash.js.map +1 -0
  21. package/dist/health-cli.d.ts +3 -0
  22. package/dist/health-cli.d.ts.map +1 -0
  23. package/dist/health-cli.js +15 -0
  24. package/dist/health-cli.js.map +1 -0
  25. package/dist/health.d.ts +7 -0
  26. package/dist/health.d.ts.map +1 -0
  27. package/dist/health.js +68 -0
  28. package/dist/health.js.map +1 -0
  29. package/dist/icons-cli.d.ts +1 -1
  30. package/dist/icons-cli.d.ts.map +1 -1
  31. package/dist/icons-cli.js +33 -14
  32. package/dist/icons-cli.js.map +1 -1
  33. package/dist/import-cli.d.ts +1 -1
  34. package/dist/import-cli.d.ts.map +1 -1
  35. package/dist/import-cli.js +6 -6
  36. package/dist/import-cli.js.map +1 -1
  37. package/dist/index.js +114 -70
  38. package/dist/index.js.map +1 -1
  39. package/dist/init.d.ts +52 -4
  40. package/dist/init.d.ts.map +1 -1
  41. package/dist/init.js +378 -57
  42. package/dist/init.js.map +1 -1
  43. package/dist/package-manager.d.ts +57 -0
  44. package/dist/package-manager.d.ts.map +1 -0
  45. package/dist/package-manager.js +157 -0
  46. package/dist/package-manager.js.map +1 -0
  47. package/dist/package.json +3 -2
  48. package/dist/r/about.json +23 -0
  49. package/dist/r/browse.json +90 -0
  50. package/dist/r/collections.json +60 -0
  51. package/dist/r/contributors.json +23 -0
  52. package/dist/r/default.json +439 -0
  53. package/dist/r/home.json +68 -0
  54. package/dist/r/not-found.json +23 -0
  55. package/dist/r/project-card.json +49 -0
  56. package/dist/r/record.json +60 -0
  57. package/dist/r/registry.json +916 -0
  58. package/dist/r/shell.json +76 -0
  59. package/dist/r/submit.json +29 -0
  60. package/dist/r/taxonomy.json +66 -0
  61. package/dist/r/ui.json +55 -0
  62. package/dist/readme-cli.d.ts +1 -1
  63. package/dist/readme-cli.d.ts.map +1 -1
  64. package/dist/readme-cli.js +37 -47
  65. package/dist/readme-cli.js.map +1 -1
  66. package/dist/registry.d.ts +80 -0
  67. package/dist/registry.d.ts.map +1 -0
  68. package/dist/registry.js +180 -0
  69. package/dist/registry.js.map +1 -0
  70. package/dist/run.d.ts +7 -0
  71. package/dist/run.d.ts.map +1 -0
  72. package/dist/run.js +20 -0
  73. package/dist/run.js.map +1 -0
  74. package/dist/unified-diff.d.ts +14 -0
  75. package/dist/unified-diff.d.ts.map +1 -0
  76. package/dist/unified-diff.js +103 -0
  77. package/dist/unified-diff.js.map +1 -0
  78. package/dist/update.d.ts +66 -0
  79. package/dist/update.d.ts.map +1 -0
  80. package/dist/update.js +311 -0
  81. package/dist/update.js.map +1 -0
  82. package/package.json +5 -4
  83. package/dist/site/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
  84. package/dist/site/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  85. package/dist/site/.github/ISSUE_TEMPLATE/record_submission.md +0 -48
  86. package/dist/site/.github/pull_request_template.md +0 -27
  87. package/dist/site/.github/workflows/ci.yml +0 -21
  88. package/dist/site/.github/workflows/cleanup.yml +0 -27
  89. package/dist/site/.github/workflows/deploy.yml +0 -36
  90. package/dist/site/.github/workflows/readme.yml +0 -41
  91. package/dist/site/.github/workflows/sync-contributors.yml +0 -28
  92. package/dist/site/.github/workflows/sync-github.yml +0 -31
  93. package/dist/site/README.md +0 -89
  94. package/dist/site/astro.config.mjs +0 -26
  95. package/dist/site/content/records/crewai.md +0 -898
  96. package/dist/site/content/records/dify.md +0 -35
  97. package/dist/site/content/records/flowise.md +0 -38
  98. package/dist/site/content/records/llamaindex.md +0 -45
  99. package/dist/site/content/records/ollama.md +0 -39
  100. package/dist/site/content/records/open-webui.md +0 -35
  101. package/dist/site/data/collections/top-ai-agents.yml +0 -14
  102. package/dist/site/data/collections/top-flutter.yml +0 -12
  103. package/dist/site/data/health.yml +0 -13
  104. package/dist/site/data/records/.gitkeep +0 -0
  105. package/dist/site/data/records/crewai.yml +0 -23
  106. package/dist/site/data/records/dify.yml +0 -23
  107. package/dist/site/data/records/flowise.yml +0 -23
  108. package/dist/site/data/records/llamaindex.yml +0 -23
  109. package/dist/site/data/records/ollama.yml +0 -30
  110. package/dist/site/data/records/open-webui.yml +0 -23
  111. package/dist/site/data/taxonomy/categories.yml +0 -10
  112. package/dist/site/data/taxonomy/distribution-channels.yml +0 -43
  113. package/dist/site/data/taxonomy/licenses.yml +0 -16
  114. package/dist/site/data/taxonomy/platforms.yml +0 -20
  115. package/dist/site/data/taxonomy/stacks.yml +0 -15
  116. package/dist/site/data/taxonomy/topics.yml +0 -29
  117. package/dist/site/grove.config.ts +0 -110
  118. package/dist/site/package.json +0 -34
  119. package/dist/site/public/icons/.grove-icons.json +0 -47
  120. package/dist/site/public/icons/platforms/android.svg +0 -1
  121. package/dist/site/public/icons/platforms/app.svg +0 -4
  122. package/dist/site/public/icons/platforms/chrome.svg +0 -1
  123. package/dist/site/public/icons/platforms/desktop.svg +0 -4
  124. package/dist/site/public/icons/platforms/embedded.svg +0 -5
  125. package/dist/site/public/icons/platforms/ios.svg +0 -1
  126. package/dist/site/public/icons/platforms/linux.svg +0 -1
  127. package/dist/site/public/icons/platforms/macos.svg +0 -1
  128. package/dist/site/public/icons/platforms/ubuntu.svg +0 -1
  129. package/dist/site/public/icons/platforms/web.svg +0 -5
  130. package/dist/site/public/icons/platforms/windows.svg +0 -1
  131. package/dist/site/public/icons/stacks/android.svg +0 -1
  132. package/dist/site/public/icons/stacks/apple.svg +0 -1
  133. package/dist/site/public/icons/stacks/bun.svg +0 -1
  134. package/dist/site/public/icons/stacks/capacitor.svg +0 -1
  135. package/dist/site/public/icons/stacks/clojure.svg +0 -1
  136. package/dist/site/public/icons/stacks/dart.svg +0 -1
  137. package/dist/site/public/icons/stacks/deno.svg +0 -1
  138. package/dist/site/public/icons/stacks/django.svg +0 -1
  139. package/dist/site/public/icons/stacks/docker.svg +0 -1
  140. package/dist/site/public/icons/stacks/firebase.svg +0 -1
  141. package/dist/site/public/icons/stacks/flutter.svg +0 -1
  142. package/dist/site/public/icons/stacks/go.svg +0 -1
  143. package/dist/site/public/icons/stacks/graphql.svg +0 -1
  144. package/dist/site/public/icons/stacks/ionic.svg +0 -1
  145. package/dist/site/public/icons/stacks/java.svg +0 -1
  146. package/dist/site/public/icons/stacks/javascript.svg +0 -1
  147. package/dist/site/public/icons/stacks/kotlin.svg +0 -1
  148. package/dist/site/public/icons/stacks/llm.svg +0 -4
  149. package/dist/site/public/icons/stacks/mongodb.svg +0 -1
  150. package/dist/site/public/icons/stacks/nodejs.svg +0 -1
  151. package/dist/site/public/icons/stacks/python.svg +0 -1
  152. package/dist/site/public/icons/stacks/rag.svg +0 -6
  153. package/dist/site/public/icons/stacks/react-native.svg +0 -1
  154. package/dist/site/public/icons/stacks/react.svg +0 -1
  155. package/dist/site/public/icons/stacks/rust.svg +0 -1
  156. package/dist/site/public/icons/stacks/solidity.svg +0 -1
  157. package/dist/site/public/icons/stacks/sveltekit.svg +0 -1
  158. package/dist/site/public/icons/stacks/swift.svg +0 -1
  159. package/dist/site/public/icons/stacks/tauri.svg +0 -1
  160. package/dist/site/public/icons/stacks/tensorflow.svg +0 -1
  161. package/dist/site/public/icons/stacks/typescript.svg +0 -1
  162. package/dist/site/public/icons/stacks/vue.svg +0 -1
  163. package/dist/site/public/logo.svg +0 -16
  164. package/dist/site/src/components/DirectoryBrowse.astro +0 -246
  165. package/dist/site/src/components/PipelineStrip.astro +0 -121
  166. package/dist/site/src/components/TaxonomyList.astro +0 -108
  167. package/dist/site/src/pages/404.astro +0 -63
  168. package/dist/site/src/pages/[slug]/[recordSlug].astro +0 -71
  169. package/dist/site/src/pages/[slug]/index.astro +0 -19
  170. package/dist/site/src/pages/[slug]/page/[page].astro +0 -32
  171. package/dist/site/src/pages/[slug]/page/cards.astro +0 -50
  172. package/dist/site/src/pages/[slug]/page/records.json.ts +0 -24
  173. package/dist/site/src/pages/about.astro +0 -130
  174. package/dist/site/src/pages/categories/[name].astro +0 -35
  175. package/dist/site/src/pages/categories/index.astro +0 -33
  176. package/dist/site/src/pages/collections/[slug].astro +0 -45
  177. package/dist/site/src/pages/collections/index.astro +0 -32
  178. package/dist/site/src/pages/contributors.astro +0 -115
  179. package/dist/site/src/pages/empty.astro +0 -24
  180. package/dist/site/src/pages/index.astro +0 -161
  181. package/dist/site/src/pages/licenses/[name].astro +0 -35
  182. package/dist/site/src/pages/stacks/[name].astro +0 -35
  183. package/dist/site/src/pages/stacks/index.astro +0 -35
  184. package/dist/site/src/pages/submit.astro +0 -183
  185. package/dist/site/src/styles/global.css +0 -21
  186. package/dist/site/tsconfig.json +0 -13
  187. /package/{dist/site/LICENSE → LICENSE} +0 -0
@@ -0,0 +1,76 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "shell",
4
+ "title": "Site shell",
5
+ "description": "The document shell every page renders inside: base layout, header, footer, container, section header, SEO head, theme toggle, the Powered-by-Grove mark, and system.css (design tokens, light/dark theme, Tailwind theme).",
6
+ "dependencies": [
7
+ "astro@^7.1.3",
8
+ "@astrojs/check@^0.9.9",
9
+ "tailwindcss@^4.3.3",
10
+ "@tailwindcss/vite@^4.3.0"
11
+ ],
12
+ "registryDependencies": [
13
+ "@grove/ui"
14
+ ],
15
+ "files": [
16
+ {
17
+ "path": "default/layouts/base-layout.astro",
18
+ "content": "---\n/**\n * BaseLayout — wraps every page. Owns the theme-detection inline\n * script and the global shell (Header, Footer). Per-page SEO\n * (title, description, OG, JSON-LD) is delegated to `<Seo />` so\n * each page can declare what it needs without polluting the layout\n * file.\n *\n * Generic: takes a `site` prop with brand + nav + stats. No\n * `siteConfig` import — consumers compose the props from their\n * own config (typically `data/generated/site-config.json` for the\n * showcase).\n *\n * GA4 can be configured once through `site.analytics.googleAnalyticsId`\n * or overridden per page with `gaId`. Omit both for privacy-first deployments.\n */\nimport '../styles/system.css';\nimport { derivePrimaryPalette } from '@grove-dev/astro/server';\nimport Footer from './footer.astro';\nimport Header from './header.astro';\nimport Seo from './seo.astro';\n\ninterface NavItem {\n label: string;\n href: string;\n}\n\ninterface SiteStats {\n totalApps?: number;\n totalCategories?: number;\n totalStacks?: number;\n totalOwners?: number;\n totalStars?: number;\n repositoryStars?: number;\n repositoryForks?: number;\n repositoryContributors?: number;\n originalRepo?: string;\n originalStars?: number;\n originalForks?: number;\n originalContributors?: number;\n}\n\ninterface Site {\n name: string;\n tagline?: string;\n description?: string;\n nav: NavItem[];\n footer?: {\n columns?: Array<{\n heading: string;\n items: Array<{ label: string; href: string; external?: boolean }>;\n }>;\n copyright?: string;\n license?: string;\n };\n submission?: {\n eyebrow?: string;\n title?: string;\n description?: string;\n good?: string[];\n avoid?: string[];\n };\n repoUrl?: string;\n url?: string;\n /** Header logo path under `public/` (e.g. `/logo.svg`). */\n logo?: string;\n /** Favicon path under `public/` (e.g. `/favicon.svg`). */\n favicon?: string;\n /** BCP-47 language tag (e.g. \"en\"). Drives `<html lang>` and og:locale. */\n locale?: string;\n /** Twitter/X handle (e.g. \"@grove\") — emitted as twitter:site. */\n twitter?: string;\n analytics?: {\n googleAnalyticsId?: string;\n };\n /** Optional directory-level stats — populated from site-config.json\n * at generate time. Components use it to render hero counts,\n * origin card stats, and footer summary lines. */\n stats?: SiteStats;\n /** Theme knobs from grove.config.ts — resolved into CSS custom\n * properties on `<html>` so the package stylesheet picks them up.\n * Values are plain strings because the prop usually arrives from a\n * JSON import; unknown values fall back to the package defaults. */\n theme?: {\n primaryColor?: string;\n /** \"none\" | \"soft\" | \"round\" */\n radius?: string;\n /** \"compact\" | \"comfortable\" | \"spacious\" */\n density?: string;\n containerWidth?: string;\n };\n blueprintConfig?: {\n routeSlug?: string;\n labelSingular?: string;\n labelPlural?: string;\n };\n}\n\ninterface Props {\n title: string;\n description: string;\n site: Site;\n type?: 'website' | 'article' | 'profile';\n noindex?: boolean;\n jsonLd?: Record<string, unknown> | Record<string, unknown>[];\n /** Open Graph / Twitter image path (e.g. \"/og/records/foo.png\").\n * Defaults to the site-wide /og-image.svg inside <Seo />. */\n image?: string;\n /** Alt text for the OG/Twitter image. */\n imageAlt?: string;\n /** Optional Google Analytics 4 Measurement ID (e.g. \"G-XXXXXX\"). */\n gaId?: string;\n /** Path used for JSON-LD `SearchAction` target. Defaults to \"/items\". */\n searchPath?: string;\n /** Submit button label rendered in the header. Omit to hide. */\n submitLabel?: string;\n /** Submit button href rendered in the header. */\n submitHref?: string;\n}\n\nconst {\n title,\n description,\n site,\n type,\n noindex,\n jsonLd,\n image,\n imageAlt,\n gaId,\n searchPath,\n submitLabel,\n submitHref,\n} = Astro.props;\nconst directoryPath = searchPath ?? `/${site.blueprintConfig?.routeSlug ?? 'items'}`;\nconst effectiveGaId = gaId ?? site.analytics?.googleAnalyticsId;\n\n// ── Theme wiring ─────────────────────────────────────────────────\n// `theme.*` from grove.config.ts resolves to CSS custom properties\n// on the <html> style attribute. An attribute (not an inline\n// <style>) so the override wins over the bundled stylesheet\n// regardless of how Vite orders the CSS output.\nconst RADIUS_PRESETS: Record<string, [string, string, string]> = {\n none: ['0rem', '0rem', '0rem'],\n soft: ['0.625rem', '0.5rem', '0.75rem'],\n round: ['0.875rem', '0.75rem', '1rem'],\n};\nconst DENSITY_SPACING: Record<string, string> = {\n compact: '0.225rem',\n comfortable: '0.25rem',\n spacious: '0.28rem',\n};\n\n// Brand fill and text derive from ONE WCAG computation (contrast.ts)\n// so background and foreground can never drift apart across themes.\n\nconst themeConfig = site.theme;\nconst themeStyleParts: string[] = [];\nif (themeConfig) {\n const radius = RADIUS_PRESETS[themeConfig.radius ?? 'soft'];\n if (radius && themeConfig.radius && themeConfig.radius !== 'soft') {\n themeStyleParts.push(\n `--grove-radius: ${radius[0]}`,\n `--grove-radius-lg: ${radius[1]}`,\n `--grove-radius-xl: ${radius[2]}`,\n );\n }\n const spacing = DENSITY_SPACING[themeConfig.density ?? 'comfortable'];\n if (spacing && themeConfig.density && themeConfig.density !== 'comfortable') {\n themeStyleParts.push(`--spacing: ${spacing}`);\n }\n if (themeConfig.containerWidth) {\n themeStyleParts.push(`--grove-container: ${themeConfig.containerWidth}`);\n }\n const primary = themeConfig.primaryColor;\n if (typeof primary === 'string' && /^#[0-9a-fA-F]{3,8}$/.test(primary)) {\n const palette = derivePrimaryPalette(primary);\n if (palette) {\n themeStyleParts.push(\n `--grove-theme-primary: ${palette.solid}`,\n `--grove-theme-primary-foreground: ${palette.solidForeground}`,\n `--grove-theme-primary-dark: ${palette.dark}`,\n `--grove-theme-primary-dark-foreground: ${palette.darkForeground}`,\n );\n }\n }\n}\nconst themeStyle = themeStyleParts.length > 0 ? `${themeStyleParts.join('; ')};` : undefined;\n\n// `site.favicon` points at a file the consumer owns under `public/`.\n// The fallback is a generated square — tinted with the configured\n// brand color rather than a hardcoded near-black, so an unconfigured\n// site still gets a tab mark that is recognisably its own.\nconst faviconFill = (site.theme?.primaryColor ?? '#18181b').trim();\nconst favicon =\n site.favicon ??\n `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect width='16' height='16' rx='3' fill='${encodeURIComponent(faviconFill)}'/%3E%3C/svg%3E`;\n---\n\n<!doctype html>\n<html lang={site.locale ?? 'en'} style={themeStyle}>\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta name=\"generator\" content={Astro.generator} />\n <meta name=\"theme-color\" content=\"#0a0a0c\" media=\"(prefers-color-scheme: dark)\" />\n <meta name=\"theme-color\" content=\"#fafafa\" media=\"(prefers-color-scheme: light)\" />\n <link rel=\"icon\" href={favicon} />\n <link rel=\"sitemap\" href=\"/sitemap.xml\" />\n {/* Preconnect to GitHub's avatar CDN — most pages render at least\n one avatar (record list cards, detail page logo) and the\n connection is reusable across cards. Cross-origin only, no\n document fetch, so the cost is one TLS handshake per page. */}\n <link rel=\"preconnect\" href=\"https://avatars.githubusercontent.com\" crossorigin=\"anonymous\" />\n <link\n rel=\"alternate\"\n type=\"text/plain\"\n href=\"/llms.txt\"\n title=\"LLM usage guidance\"\n />\n\n {effectiveGaId && (\n <>\n <script\n is:inline\n async\n src={`https://www.googletagmanager.com/gtag/js?id=${effectiveGaId}`}\n />\n <script is:inline define:vars={{ gaId: effectiveGaId }}>\n window.dataLayer = window.dataLayer || [];\n function gtag() {\n dataLayer.push(arguments);\n }\n gtag(\"js\", new Date());\n gtag(\"config\", gaId, {\n page_path: window.location.pathname + window.location.search,\n page_title: document.title,\n });\n </script>\n </>\n )}\n\n <Seo\n title={title}\n description={description}\n type={type}\n noindex={noindex}\n jsonLd={jsonLd}\n {...(image ? { image } : {})}\n imageAlt={imageAlt}\n site={site}\n searchPath={directoryPath}\n />\n\n <slot name=\"head\" />\n\n <script is:inline>\n // THEME_INIT — runs before paint so the user never sees a\n // flash of the wrong theme. State is persisted in localStorage\n // under the key \"grove-theme\" (matching ThemeToggle.astro).\n (function () {\n var STORAGE_KEY = \"grove-theme\";\n function getMode() {\n try {\n var stored = localStorage.getItem(STORAGE_KEY);\n if (stored === \"light\" || stored === \"dark\" || stored === \"system\")\n return stored;\n } catch (e) {\n // localStorage may be blocked (private mode, etc.) —\n // fall through to the system default.\n }\n return \"system\";\n }\n function apply(mode) {\n var resolved =\n mode === \"system\"\n ? (window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n ? \"dark\"\n : \"light\")\n : mode;\n var root = document.documentElement;\n if (resolved === \"dark\") root.classList.add(\"dark\");\n else root.classList.remove(\"dark\");\n root.dataset.theme = mode;\n root.dataset.resolvedTheme = resolved;\n }\n apply(getMode());\n window.addEventListener(\"theme:set\", function (e) {\n apply(e.detail);\n });\n var mq = window.matchMedia(\"(prefers-color-scheme: dark)\");\n mq.addEventListener(\"change\", function () {\n if (getMode() === \"system\") apply(\"system\");\n });\n })();\n </script>\n </head>\n <body class=\"min-h-screen bg-background text-foreground\">\n <a\n href=\"#main\"\n class=\"sr-only z-50 rounded-md bg-background px-3 py-2 text-sm font-medium text-foreground outline-none ring-2 ring-ring focus:not-sr-only focus:fixed focus:left-3 focus:top-3\"\n >\n Skip to content\n </a>\n <slot name=\"header\">\n <Header\n site={site}\n submitLabel={submitLabel ?? (site.blueprintConfig ? `Submit ${site.blueprintConfig.labelSingular ?? \"item\"}` : undefined)}\n submitHref={submitHref ?? (site.blueprintConfig ? \"/submit\" : undefined)}\n />\n </slot>\n\n <main id=\"main\">\n <slot />\n </main>\n\n <slot name=\"footer\">\n <Footer\n site={site}\n stats={{\n totalApps: site.stats?.totalApps,\n totalCategories: site.stats?.totalCategories,\n totalStacks: site.stats?.totalStacks,\n totalOwners: site.stats?.totalOwners,\n }}\n itemsLabel={site.blueprintConfig?.labelPlural ?? \"items\"}\n discover={{\n heading: \"Discover\",\n items: [\n ...(site.stats?.totalApps\n ? [{ label: \"Browse all\", href: directoryPath }]\n : []),\n { label: \"Community\", href: \"/contributors\" },\n ...(site.stats?.originalRepo\n ? [{ label: \"View on GitHub\", href: site.stats.originalRepo, external: true }]\n : []),\n ],\n }}\n contribute={{\n heading: \"Contribute\",\n items: [\n ...(site.repoUrl\n ? [\n {\n label: \"Submit via GitHub\",\n href: `${site.repoUrl}/blob/main/CONTRIBUTING.md`,\n external: true,\n },\n ]\n : []),\n ...(site.repoUrl\n ? [\n {\n label: \"Report an issue\",\n href: `${site.repoUrl}/issues`,\n external: true,\n },\n ]\n : []),\n ],\n }}\n project={{\n heading: \"Project\",\n items: [\n ...(site.repoUrl\n ? [\n {\n label: \"Source on GitHub\",\n href: site.repoUrl,\n external: true,\n },\n ]\n : []),\n ...(site.repoUrl\n ? [\n {\n label: \"Changelog\",\n href: `${site.repoUrl}/blob/main/CHANGELOG.md`,\n external: true,\n },\n ]\n : []),\n ],\n }}\n />\n </slot>\n\n <slot name=\"body-end\" />\n\n {effectiveGaId && (\n <script is:inline define:vars={{ gaId: effectiveGaId }}>\n (function () {\n // GA4's `gtag('config', id)` call in the <head> already auto-pings\n // `page_view` on full navigations, so this block only needs to\n // catch history changes (back/forward). No history.pushState /\n // replaceState wrap: the package does not install\n // @astrojs/transitions' ClientRouter, and those wraps\n // double-fired page_view events on every navigation.\n var last = location.pathname + location.search;\n function report() {\n var next = location.pathname + location.search;\n if (next === last) return;\n last = next;\n window.gtag(\"event\", \"page_view\", {\n page_path: next,\n page_title: document.title,\n page_location: location.href,\n });\n }\n window.addEventListener(\"popstate\", report);\n })();\n </script>\n )}\n </body>\n</html>\n",
19
+ "type": "registry:component",
20
+ "target": "~/src/layouts/base-layout.astro"
21
+ },
22
+ {
23
+ "path": "default/layouts/container.astro",
24
+ "content": "---\ninterface Props {\n size?: 'default' | 'wide' | 'narrow';\n class?: string;\n}\n\nconst { size = 'default', class: className = '' } = Astro.props;\nconst sizeClass =\n size === 'wide'\n ? 'mx-auto w-full max-w-wide'\n : size === 'narrow'\n ? 'mx-auto w-full max-w-narrow'\n : 'mx-auto w-full max-w-container';\n---\n\n<div class={`${sizeClass} px-5 sm:px-7 ${className}`}>\n <slot />\n</div>\n",
25
+ "type": "registry:component",
26
+ "target": "~/src/layouts/container.astro"
27
+ },
28
+ {
29
+ "path": "default/layouts/footer.astro",
30
+ "content": "---\n/**\n * Footer — 4-column grid (brand + Discover + Contribute + Project) plus\n * a thin bar at the bottom with copyright + repo link.\n *\n * Generic: takes a `site` prop with brand + repoUrl + stats, plus\n * pre-computed column data. No `siteConfig` import — consumers\n * compose props from their own config (or from\n * `data/generated/site-config.json` for the showcase).\n *\n * Each column's links are passed in as a `{ heading, items[] }` shape\n * so consumers can customize the order and copy. Defaults are\n * provided so the footer still renders if no extra data is supplied.\n */\nimport PoweredBy from '../components/grove/powered-by.astro';\n\ninterface NavItem {\n label: string;\n href: string;\n /** When true, opens in a new tab (external). */\n external?: boolean;\n}\n\ninterface FooterColumn {\n heading: string;\n items: NavItem[];\n}\n\ninterface Site {\n name: string;\n tagline?: string;\n description?: string;\n repoUrl?: string;\n footer?: {\n columns?: FooterColumn[];\n copyright?: string;\n license?: string;\n /** \"Powered by Grove\" under the brand block. Defaults to on. */\n poweredBy?: boolean;\n };\n stats?: {\n totalApps?: number;\n totalCategories?: number;\n totalStacks?: number;\n totalOwners?: number;\n };\n}\n\ninterface Props {\n site: Site;\n /** Discover links — first content column. */\n discover?: FooterColumn;\n /** Contribute links — second content column. */\n contribute?: FooterColumn;\n /** Project links — third content column. */\n project?: FooterColumn;\n /** Stats line under brand blurb. */\n stats?: {\n totalApps?: number;\n totalCategories?: number;\n totalStacks?: number;\n totalOwners?: number;\n };\n /**\n * Plural label for the primary count stat. Default \"items\" so the\n * footer reads naturally regardless of blueprint.\n */\n itemsLabel?: string;\n /** Copyright suffix. Defaults to site.name. */\n copyrightHolder?: string;\n /** License line under the bar (e.g. \"Content under CC BY-SA 4.0.\"). */\n licenseLine?: string;\n /**\n * \"Powered by Grove\" under the brand block. Falls back to\n * `site.footer.poweredBy`, which defaults to on.\n */\n poweredBy?: boolean;\n /** Extra class for the outer footer element. */\n class?: string;\n}\n\nconst {\n site,\n discover = { heading: 'Discover', items: [] },\n contribute = { heading: 'Contribute', items: [] },\n project = { heading: 'Project', items: [] },\n stats,\n itemsLabel = 'items',\n copyrightHolder,\n licenseLine,\n poweredBy,\n class: className = '',\n} = Astro.props;\n\nconst showPoweredBy = poweredBy ?? site.footer?.poweredBy ?? true;\n\nconst year = new Date().getFullYear();\nconst holder = copyrightHolder ?? site.footer?.copyright ?? site.name;\nconst gh = site.repoUrl;\nconst showOwners = (stats?.totalOwners ?? 0) > 0;\n\nconst defaultDiscover: NavItem[] = gh\n ? [\n { label: 'Source on GitHub', href: gh, external: true },\n { label: 'Latest release', href: `${gh}/releases`, external: true },\n ]\n : [];\nconst defaultContribute: NavItem[] = gh\n ? [\n { label: 'Submit via GitHub', href: `${gh}/blob/main/CONTRIBUTING.md`, external: true },\n { label: 'Report an issue', href: `${gh}/issues`, external: true },\n { label: 'Contributing guide', href: `${gh}/blob/main/CONTRIBUTING.md`, external: true },\n ]\n : [];\nconst defaultProject: NavItem[] = gh\n ? [\n { label: 'README', href: `${gh}/blob/main/README.md`, external: true },\n { label: 'Changelog', href: `${gh}/blob/main/CHANGELOG.md`, external: true },\n ]\n : [];\n\nconst discoverItems = discover.items.length ? discover.items : defaultDiscover;\nconst contributeItems = contribute.items.length ? contribute.items : defaultContribute;\nconst projectItems = project.items.length ? project.items : defaultProject;\nconst configuredColumns = site.footer?.columns ?? [];\nconst columns = configuredColumns.length\n ? configuredColumns\n : [\n { heading: discover.heading, items: discoverItems },\n { heading: contribute.heading, items: contributeItems },\n { heading: project.heading, items: projectItems },\n ].filter((column) => column.items.length > 0);\nconst resolvedLicenseLine = licenseLine ?? site.footer?.license;\n---\n\n<footer\n class:list={[\n \"border-border bg-background mt-16 border-t text-ink-500 dark:text-ink-400\",\n className,\n ]}\n>\n <div\n class=\"mx-auto grid w-full max-w-container grid-cols-2 gap-8 px-5 py-12 md:grid-cols-4 sm:px-7\"\n >\n <div class=\"col-span-2 md:col-span-1\">\n <div\n class=\"mb-2 inline-flex items-center gap-2 text-[0.95rem] font-semibold text-ink-900 dark:text-ink-100\"\n >\n <span\n aria-hidden=\"true\"\n class=\"inline-block h-3.5 w-3.5 rounded bg-ink-900 dark:bg-ink-100\"\n ></span>\n <span>{site.name}</span>\n </div>\n {site.tagline && (\n <p class=\"m-0 max-w-[36ch] text-[0.8125rem] leading-relaxed text-ink-500 dark:text-ink-400\">\n {site.tagline}\n </p>\n )}\n {stats && (\n <p class=\"mt-3 m-0 text-2xs text-ink-500 dark:text-ink-400\">\n {stats.totalApps !== undefined && (\n <>\n <span class=\"font-mono\">{stats.totalApps}</span> {itemsLabel}\n </>\n )}\n {stats.totalApps !== undefined && (stats.totalCategories !== undefined || showOwners) && (\n <span class=\"mx-1 text-ink-300 dark:text-ink-700\">·</span>\n )}\n {stats.totalCategories !== undefined && (\n <>\n <span class=\"font-mono\">{stats.totalCategories}</span> categories\n </>\n )}\n {stats.totalCategories !== undefined && showOwners && (\n <span class=\"mx-1 text-ink-300 dark:text-ink-700\">·</span>\n )}\n {showOwners && (\n <>\n <span class=\"font-mono\">{stats.totalOwners}</span> project owners\n </>\n )}\n </p>\n )}\n {showPoweredBy && (\n <p class=\"mt-4 m-0 text-[0.8125rem] text-ink-500 dark:text-ink-400\">\n <PoweredBy size={16} />\n </p>\n )}\n </div>\n\n {columns.map((column) => (\n <div>\n <h2 class=\"mb-3 text-2xs font-semibold uppercase tracking-wider text-ink-900 dark:text-ink-100\">\n {column.heading}\n </h2>\n <ul class=\"m-0 flex list-none flex-col gap-2 p-0\">\n {column.items.map((item) => (\n <li>\n <a\n href={item.href}\n class=\"text-sm transition-colors hover:text-ink-900 dark:hover:text-ink-100\"\n {...(item.external\n ? { target: \"_blank\", rel: \"noopener noreferrer\" }\n : {})}\n >\n {item.label}\n </a>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n\n <div class=\"border-t border-ink-200 dark:border-ink-800\">\n <div\n class=\"mx-auto flex w-full max-w-container flex-wrap items-center gap-3 px-5 py-4 text-2xs text-ink-500 sm:px-7 dark:text-ink-400\"\n >\n <span>© {year} {holder}{resolvedLicenseLine ? `. ${resolvedLicenseLine}` : \".\"}</span>\n {gh && (\n <>\n <span class=\"text-ink-300 dark:text-ink-700\">·</span>\n <a\n href={gh}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"transition-colors hover:text-ink-900 dark:hover:text-ink-100\"\n >\n View source on GitHub\n </a>\n </>\n )}\n </div>\n </div>\n</footer>\n",
31
+ "type": "registry:component",
32
+ "target": "~/src/layouts/footer.astro"
33
+ },
34
+ {
35
+ "path": "default/layouts/header.astro",
36
+ "content": "---\n/**\n * Header — sticky brand + nav + theme toggle.\n *\n * Generic: takes a `site` prop with brand + nav. No `siteConfig`\n * import — consumers compose the props from their own config.\n *\n * Optional `submit` button renders a \"Submit app\" / \"Submit project\"\n * call-to-action on the right side of the nav. Set `submitHref` /\n * `submitLabel` to enable, leave them undefined for a clean header.\n *\n * Optional `repoUrl` adds a \"View source\" GitHub button. Set\n * `repoLabel` to change the visible text.\n */\n\nimport { compact } from '@grove-dev/core';\nimport ThemeToggle from '../components/site/theme-toggle.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\ninterface NavItem {\n label: string;\n href: string;\n}\n\ninterface Site {\n name: string;\n tagline?: string;\n nav: NavItem[];\n description?: string;\n repoUrl?: string;\n url?: string;\n /** Logo path under `public/` (e.g. `/logo.svg`). */\n logo?: string;\n stats?: {\n /** Stars on this site's own source repository. */\n repositoryStars?: number;\n };\n blueprintConfig?: {\n routeSlug?: string;\n };\n}\n\ninterface Props {\n site: Site;\n /** Submit button label, e.g. \"Submit app\". Omit to hide. */\n submitLabel?: string;\n /** Submit button href, e.g. \"/submit\". Omit to hide. */\n submitHref?: string;\n /** GitHub button label, e.g. \"View source\". */\n repoLabel?: string;\n /** Extra class for the outer header element. */\n class?: string;\n}\n\nconst { site, submitLabel, submitHref, repoLabel = 'Star', class: className = '' } = Astro.props;\nconst directoryPath = `/${site.blueprintConfig?.routeSlug ?? 'items'}`;\nconst defaultNavItems = site.blueprintConfig\n ? [\n { label: 'Recently added', href: `${directoryPath}?sort=recently-added` },\n { label: 'Trending', href: `${directoryPath}?label=hot` },\n { label: 'Categories', href: '/categories' },\n { label: 'Stacks', href: '/stacks' },\n { label: 'About', href: '/about' },\n ]\n : [];\nconst navItems = site.nav?.length ? site.nav : defaultNavItems;\nconst stars = site.stats?.repositoryStars;\nconst starsLabel = typeof stars === 'number' ? compact(stars) : null;\n---\n\n<header\n class:list={[\n \"border-border bg-background/85 sticky top-0 z-50 border-b backdrop-blur\",\n className,\n ]}\n>\n <div\n class=\"mx-auto flex w-full max-w-container items-center gap-3 px-5 py-3 sm:gap-6 sm:px-7\"\n >\n <a\n href=\"/\"\n class=\"inline-flex min-w-0 shrink items-center gap-2 text-[0.95rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\"\n >\n {site.logo ? (\n <img\n src={site.logo}\n alt=\"\"\n aria-hidden=\"true\"\n width=\"18\"\n height=\"18\"\n class=\"inline-block h-[18px] w-[18px] shrink-0 object-contain\"\n />\n ) : (\n /* No logo configured — a neutral mark is the honest default.\n Set `site.logo` in grove.config.ts to replace it. */\n <span\n aria-hidden=\"true\"\n class=\"inline-block h-[18px] w-[18px] rounded bg-ink-900 dark:bg-ink-100\"\n ></span>\n )}\n <span class=\"truncate\">{site.name}</span>\n </a>\n\n <nav class=\"hidden flex-1 md:block\" aria-label=\"Primary\">\n <ul class=\"m-0 flex list-none gap-5 p-0\">\n {navItems.map((item) => (\n <li>\n <a\n href={item.href}\n class=\"text-[0.875rem] font-medium text-ink-500 transition-colors hover:text-ink-900 dark:text-ink-400 dark:hover:text-ink-100\"\n >\n {item.label}\n </a>\n </li>\n ))}\n </ul>\n </nav>\n\n <div class=\"ml-auto flex items-center gap-2\">\n <details class=\"group relative md:hidden\">\n <summary class=\"inline-flex h-9 cursor-pointer list-none items-center justify-center rounded-[var(--radius)] border border-border bg-secondary px-2.5 text-sm font-medium text-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/35\">\n Menu\n </summary>\n <nav aria-label=\"Mobile primary\" class=\"absolute right-0 top-[calc(100%+0.5rem)] z-50 w-56 rounded-[var(--radius)] border border-border bg-background p-2 shadow-lg\">\n <ul class=\"m-0 flex list-none flex-col gap-1 p-0\">\n {navItems.map((item) => (\n <li><a href={item.href} class=\"block rounded-md px-3 py-2 text-sm font-medium text-foreground no-underline hover:bg-accent\">{item.label}</a></li>\n ))}\n {submitHref && (\n <li class=\"border-t border-border pt-1\"><a href={submitHref} class=\"block rounded-md px-3 py-2 text-sm font-medium text-foreground no-underline hover:bg-accent\">{submitLabel ?? \"Submit\"}</a></li>\n )}\n </ul>\n </nav>\n </details>\n\n {submitHref && (\n <a\n href={submitHref}\n class={buttonClass(\"secondary\", \"sm\", \"max-sm:!hidden\")}\n >\n <svg\n viewBox=\"0 0 16 16\"\n width=\"13\"\n height=\"13\"\n aria-hidden=\"true\"\n fill=\"currentColor\"\n >\n <path d=\"M7.75 2a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 7.75 2Z\"></path>\n </svg>\n <span>{submitLabel ?? \"Submit\"}</span>\n </a>\n )}\n\n {site.repoUrl && (\n <a\n href={site.repoUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={`${repoLabel} on GitHub${starsLabel ? ` — ${starsLabel} stars` : \"\"}`}\n title={`${repoLabel} on GitHub`}\n class={buttonClass(\"secondary\", \"bare\", \"h-8 overflow-hidden p-0 text-sm\")}\n >\n <span class=\"flex items-center gap-1.5 px-2.5 py-1.5 text-ink-900 dark:text-ink-100\">\n <svg viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" aria-hidden=\"true\" fill=\"currentColor\">\n <path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38v-1.33c-2.22.48-2.69-1.07-2.69-1.07-.36-.92-.89-1.17-.89-1.17-.73-.5.05-.49.05-.49.8.06 1.23.83 1.23.83.72 1.22 1.87.87 2.33.67.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48v2.19c0 .21.15.46.55.38A8 8 0 0 0 8 0Z\"></path>\n </svg>\n <span class=\"hidden lg:inline\">{repoLabel}</span>\n </span>\n {starsLabel && <span class=\"hidden items-center gap-1 border-s border-border bg-secondary px-2 py-1.5 text-secondary-foreground sm:flex\">\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-warning\">\n <path d=\"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z\"></path>\n </svg>\n <span class=\"font-mono\">{starsLabel}</span>\n </span>}\n </a>\n )}\n\n <ThemeToggle />\n </div>\n </div>\n</header>\n\n<script>\n // Smooth-scroll for in-page anchor links (Header nav + Hero CTA).\n // Works on any <a href=\"#…\"> that points to an existing element on\n // the current page. External links (e.g. /about, /projects?…) are\n // skipped because they don't start with \"#\". Modifier-clicks\n // (Cmd/Ctrl/Shift/middle) let the browser handle the anchor\n // normally so users can open the same section in a new tab.\n document.addEventListener(\"click\", (e) => {\n if (e.defaultPrevented) return;\n if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;\n if (e.button !== 0) return;\n const link = (e.target as HTMLElement).closest<HTMLAnchorElement>(\n 'a[href^=\"#\"]',\n );\n if (!link) return;\n const id = link.getAttribute(\"href\")!;\n if (id.length <= 1) return;\n const target = document.querySelector(id);\n if (!target) return;\n e.preventDefault();\n target.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n history.replaceState(null, \"\", id);\n });\n</script>\n",
37
+ "type": "registry:component",
38
+ "target": "~/src/layouts/header.astro"
39
+ },
40
+ {
41
+ "path": "default/layouts/section-header.astro",
42
+ "content": "---\ninterface Props {\n eyebrow?: string;\n title: string;\n description?: string;\n align?: 'left' | 'center';\n /** Pass 1 when this header IS the page title (one h1 per route). */\n level?: 1 | 2 | 3;\n}\n\nconst { eyebrow, title, description, align = 'left', level = 2 } = Astro.props;\nconst Heading = `h${level}` as 'h1' | 'h2' | 'h3';\n---\n\n<header\n class={`mb-6 flex flex-col gap-2 ${\n align === \"center\" ? \"items-center text-center\" : \"\"\n }`}\n>\n {\n eyebrow && (\n <span class=\"text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n {eyebrow}\n </span>\n )\n }\n <Heading\n class=\"text-[1.5rem] sm:text-[1.625rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100 m-0\"\n >\n {title}\n </Heading>\n {\n description && (\n <p\n class={`text-[0.9375rem] leading-relaxed text-ink-500 dark:text-ink-400 m-0 ${\n align === \"center\" ? \"max-w-2xl\" : \"max-w-[56ch]\"\n }`}\n >\n {description}\n </p>\n )\n }\n</header>\n",
43
+ "type": "registry:component",
44
+ "target": "~/src/layouts/section-header.astro"
45
+ },
46
+ {
47
+ "path": "default/layouts/seo.astro",
48
+ "content": "---\n// SPDX-License-Identifier: MIT\n\n/**\n * Per-page SEO: <title>, description, canonical, Open Graph, Twitter Card,\n * and JSON-LD structured data. Designed to be used inside <head> by the\n * BaseLayout. Pages pass the rich props they care about; everything else\n * has a sensible default derived from the site config and the Astro URL.\n *\n * Renders:\n * - <title>, meta description, canonical link, robots\n * - Open Graph (og:*) for Facebook, LinkedIn, Discord, Slack, etc.\n * - Twitter Card (twitter:*) for X / Twitter\n * - JSON-LD WebSite+Organization identity graph on every page\n * (built by @grove-dev/core's `siteSchema`, with a SearchAction\n * pointing at the directory's browse page)\n * - Per-page JSON-LD nodes when `jsonLd` is provided (SoftwareSourceCode\n * on record pages, CollectionPage/ItemList/BreadcrumbList on\n * collection and taxonomy pages, ...)\n *\n * Noindex is opt-in via the `noindex` prop. By default everything is\n * indexable; noindex targets today are /submit, /404, and /empty.\n */\nimport { type JsonLdNode, siteSchema, validateJsonLd } from '@grove-dev/core';\n\ninterface Props {\n title: string;\n description: string;\n site: {\n name: string;\n description?: string;\n repoUrl?: string;\n /** Header logo path under `public/` — used as Organization logo when set. */\n logo?: string;\n /** BCP-47 language tag (e.g. \"en\"). Drives og:locale + JSON-LD inLanguage. */\n locale?: string;\n /** Twitter/X handle (e.g. \"@grove\") — emitted as twitter:site. */\n twitter?: string;\n };\n searchPath?: string;\n /** Open Graph / Twitter image. Default: /og-image.svg. Should be absolute or root-relative. */\n image?: string;\n /** Alt text for the OG/Twitter image. Default: \"<site name> social preview\". */\n imageAlt?: string;\n /** og:type. Default: \"website\". Use \"article\" for blog posts / changelog. */\n type?: 'website' | 'article' | 'profile';\n /** Set true to add noindex,nofollow. */\n noindex?: boolean;\n /** Extra JSON-LD payload (object) — typically SoftwareSourceCode on item pages. */\n jsonLd?: Record<string, unknown> | Record<string, unknown>[];\n}\n\nconst {\n title,\n description,\n site: siteConfig,\n searchPath = '/items',\n image = '/og-image.svg',\n imageAlt,\n type = 'website',\n noindex = false,\n jsonLd,\n} = Astro.props;\n\n// `Astro.site` is required for canonical / OG / Twitter / JSON-LD URLs to\n// resolve to the consumer's domain. Failing the build (rather than silently\n// emitting `https://example.com/...`) is the right call: every canonical,\n// OG, and JSON-LD URL would otherwise leak to a domain the consumer doesn't\n// own, which search engines either ignore or treat as canonical to the\n// wrong host.\nif (!Astro.site) {\n throw new Error(\n \"Seo: `site` is not set on the Astro config. Add `site: 'https://your-domain'` to astro.config.mjs so canonical / Open Graph / Twitter / JSON-LD URLs resolve correctly.\",\n );\n}\nconst siteUrl = Astro.site;\nconst canonical = new URL(Astro.url.pathname, siteUrl).toString();\nconst ogImage = new URL(image, siteUrl).toString();\nconst ogImageAlt = imageAlt ?? `${siteConfig.name} social preview`;\nconst locale = siteConfig.locale ?? 'en';\n\n// Truncate description for OG/Twitter where longer is worse (160–200 chars).\nfunction truncate(s: string, max: number): string {\n if (s.length <= max) return s;\n return s.slice(0, max - 1).trimEnd() + '…';\n}\nconst shortDescription = truncate(description, 200);\n\n// WebSite+Organization identity graph — site-wide signals that appear on\n// every page (Google uses them for site links and the knowledge panel).\n// Built by core's `siteSchema` so the @id graph shape is shared with the\n// rest of the JSON-LD registry; the SearchAction is appended here because\n// the browse path is an adapter concern, not a core one.\nconst bareSiteUrl = siteUrl.toString().replace(/\\/$/, '');\nconst [siteLd] = siteSchema({\n url: bareSiteUrl,\n name: siteConfig.name,\n description: siteConfig.description ?? description,\n inLanguage: locale,\n orgName: siteConfig.name,\n orgUrl: bareSiteUrl,\n ...(siteConfig.logo ? { orgLogo: new URL(siteConfig.logo, siteUrl).toString() } : {}),\n ...(siteConfig.repoUrl ? { sameAs: [siteConfig.repoUrl] } : {}),\n});\nsiteLd.potentialAction = {\n '@type': 'SearchAction',\n target: `${bareSiteUrl}${searchPath}?q={search_term_string}`,\n 'query-input': 'required name=search_term_string',\n};\n\nconst perPageNodes = jsonLd ? (Array.isArray(jsonLd) ? jsonLd : [jsonLd]) : null;\n\n// Dev-only well-formedness check — surfaces malformed nodes (relative\n// URLs, missing @context, duplicate @ids) in the terminal during\n// `astro dev` without ever failing or slowing a production build.\nif (import.meta.env.DEV && perPageNodes) {\n const issues = validateJsonLd(perPageNodes as JsonLdNode[]);\n for (const issue of issues) {\n console.warn(`[grove seo] ${Astro.url.pathname}: ${issue.message}`);\n }\n}\n\n// Pre-stringify the JSON-LD payloads in the frontmatter so the\n// template body just interpolates the resulting strings. For SSR\n// this saves the JSON.stringify call on every render; for static\n// builds the cost is unchanged but the template reads cleaner.\nconst siteLdJson = JSON.stringify(siteLd);\nconst perPageLdJson = perPageNodes ? JSON.stringify(perPageNodes) : null;\n---\n\n<!-- Primary meta -->\n<title>{title}</title>\n<meta name=\"description\" content={description} />\n<link rel=\"canonical\" href={canonical} />\n{noindex ? (\n <meta name=\"robots\" content=\"noindex,nofollow\" />\n) : (\n <meta name=\"robots\" content=\"index,follow,max-image-preview:large\" />\n)}\n\n<!-- Open Graph -->\n<meta property=\"og:type\" content={type} />\n<meta property=\"og:url\" content={canonical} />\n<meta property=\"og:title\" content={title} />\n<meta property=\"og:description\" content={shortDescription} />\n<meta property=\"og:image\" content={ogImage} />\n<meta property=\"og:image:width\" content=\"1200\" />\n<meta property=\"og:image:height\" content=\"630\" />\n<meta property=\"og:image:alt\" content={ogImageAlt} />\n<meta property=\"og:site_name\" content={siteConfig.name} />\n<meta property=\"og:locale\" content={locale} />\n\n<!-- Twitter Card -->\n<meta name=\"twitter:card\" content=\"summary_large_image\" />\n{siteConfig.twitter && <meta name=\"twitter:site\" content={siteConfig.twitter} />}\n<meta name=\"twitter:title\" content={title} />\n<meta name=\"twitter:description\" content={shortDescription} />\n<meta name=\"twitter:image\" content={ogImage} />\n<meta name=\"twitter:image:alt\" content={ogImageAlt} />\n\n<!-- JSON-LD: site-wide identity graph -->\n<script is:inline type=\"application/ld+json\" set:html={siteLdJson} />\n\n<!-- JSON-LD: per-page (SoftwareSourceCode, CollectionPage, BreadcrumbList, ...) -->\n{perPageLdJson && (\n <script\n is:inline\n type=\"application/ld+json\"\n set:html={perPageLdJson}\n />\n)}\n",
49
+ "type": "registry:component",
50
+ "target": "~/src/layouts/seo.astro"
51
+ },
52
+ {
53
+ "path": "default/components/site/theme-toggle.astro",
54
+ "content": "---\n// A three-position theme switcher: light / dark / system.\n//\n// State is persisted in `localStorage` under the key \"grove-theme\".\n// On mount it reads the stored value (or \"system\" if none), applies\n// the corresponding class to <html>, and re-syncs when the OS\n// preference changes (only meaningful when mode is \"system\").\n//\n// Implementation note: the actual <html class=\"dark\"> toggle happens\n// in the inline script in `src/components/layout/BaseLayout.astro`\n// (THEME_INIT). That script runs before paint so the user never sees\n// a flash of the wrong theme.\n\ninterface Props {\n class?: string;\n}\n\nconst { class: className = '' } = Astro.props;\n---\n\n<button\n type=\"button\"\n id=\"theme-toggle\"\n data-theme-toggle\n aria-label=\"Theme: system — switch to light\"\n title=\"Toggle theme\"\n class={`inline-flex h-9 w-9 shrink-0 cursor-pointer items-center justify-center rounded-[var(--radius)] border border-border bg-secondary p-0 text-foreground outline-none transition-colors hover:bg-accent focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35 ${className}`}\n>\n {/* Sun — shown in dark mode (click to go light) */}\n <svg\n width=\"18\"\n height=\"18\"\n class=\"hidden shrink-0 dark:block\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\"/>\n <path d=\"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41\"/>\n </svg>\n {/* Moon — shown in light mode (click to go dark) */}\n <svg\n width=\"18\"\n height=\"18\"\n class=\"block shrink-0 dark:hidden\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.8\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79Z\"/>\n </svg>\n</button>\n{/* Announces theme changes to assistive tech — the icon alone can't\n distinguish \"dark\" from \"system resolving to dark\". */}\n<span data-theme-toggle-status role=\"status\" class=\"sr-only\"></span>\n\n<script>\n // The toggle button simply rotates between the three modes on\n // click. The actual class application lives in the page-level\n // THEME_INIT script so behaviour stays consistent.\n const STORAGE_KEY = \"grove-theme\";\n type Mode = \"light\" | \"dark\" | \"system\";\n\n function currentMode(): Mode {\n const stored = localStorage.getItem(STORAGE_KEY);\n return stored === \"light\" || stored === \"dark\" || stored === \"system\"\n ? stored\n : \"system\";\n }\n\n function rotate(): Mode {\n const order: Mode[] = [\"light\", \"dark\", \"system\"];\n const next = order[(order.indexOf(currentMode()) + 1) % order.length];\n localStorage.setItem(STORAGE_KEY, next);\n // Notify the page-level listener.\n window.dispatchEvent(new CustomEvent(\"theme:set\", { detail: next }));\n return next;\n }\n\n function nextMode(): Mode {\n const order: Mode[] = [\"light\", \"dark\", \"system\"];\n return order[(order.indexOf(currentMode()) + 1) % order.length];\n }\n\n // The accessible name carries BOTH the current state and the next\n // action (\"Theme: dark — switch to system\"); title mirrors it for\n // sighted tooltip users. Re-read on focus/hover so another tab or\n // toggle instance can't leave it stale.\n function updateLabel(btn: HTMLButtonElement) {\n const label = `Theme: ${currentMode()} — switch to ${nextMode()}`;\n btn.setAttribute(\"aria-label\", label);\n btn.title = label;\n }\n\n function announce(mode: Mode) {\n const status = document.querySelector(\"[data-theme-toggle-status]\");\n if (status) status.textContent = `Theme set to ${mode}`;\n }\n\n document.querySelectorAll<HTMLButtonElement>(\"[data-theme-toggle]\").forEach((btn) => {\n updateLabel(btn);\n btn.addEventListener(\"click\", () => {\n const mode = rotate();\n updateLabel(btn);\n announce(mode);\n });\n btn.addEventListener(\"mouseenter\", () => updateLabel(btn));\n btn.addEventListener(\"focus\", () => updateLabel(btn));\n });\n</script>\n",
55
+ "type": "registry:component",
56
+ "target": "~/src/components/site/theme-toggle.astro"
57
+ },
58
+ {
59
+ "path": "default/components/grove/powered-by.astro",
60
+ "content": "---\n/**\n * PoweredBy — \"Powered by Grove\" attribution.\n *\n * The mark is **inlined**, not loaded through `<img src>`: an SVG\n * served as its own document cannot see page CSS, so `currentColor`\n * never resolves there (the bug that cost the packaged icon set both\n * themes before 0.5.3). Inlined, the mark simply inherits the\n * surrounding text colour and follows the site's theme toggle — no\n * second file, no script.\n *\n * Generic: no `siteConfig` import. `Footer` renders it under the brand\n * block when `footer.poweredBy` is on; consumers can also drop it\n * anywhere themselves — e.g. into `Hero`'s `eyebrow` slot.\n */\n\ninterface Props {\n /** Where the link points. Override only for a staging/docs mirror. */\n href?: string;\n /** Mark size in px. Default 16 — sized for 13px text. */\n size?: number;\n /** Extra class on the link. */\n class?: string;\n}\n\nconst { href = 'https://withgrove.dev', size = 16, class: className = '' } = Astro.props;\n---\n\n<a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class:list={[\n \"inline-flex items-center gap-1.5 transition-colors hover:text-ink-900 dark:hover:text-ink-100\",\n className,\n ]}\n>\n <span>Powered by</span>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 32 32\"\n width={size}\n height={size}\n style={`width:${size}px;height:${size}px`}\n fill=\"none\"\n aria-hidden=\"true\"\n class=\"shrink-0 align-middle\"\n >\n <path d=\"M16 28V14\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"></path>\n <path d=\"M16 14C16 14 16 8 22 6C22 6 22 12 16 14Z\" fill=\"currentColor\" fill-opacity=\"0.85\"></path>\n <path d=\"M16 14C16 14 16 8 10 6C10 6 10 12 16 14Z\" fill=\"currentColor\" fill-opacity=\"0.6\"></path>\n <path d=\"M16 18C16 18 16 22 20 23\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n <path d=\"M16 21C16 21 16 24 12 25\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"></path>\n </svg>\n <span class=\"font-semibold\">Grove</span>\n</a>\n",
61
+ "type": "registry:component",
62
+ "target": "~/src/components/grove/powered-by.astro"
63
+ },
64
+ {
65
+ "path": "default/styles/system.css",
66
+ "content": "/*\n * Grove design system — your copy.\n *\n * The registry installed this file into your project; it is yours to\n * edit. `base-layout.astro` imports it, so it is the single entry point\n * for the whole stack. It owns Tailwind theme tokens, runtime light/dark\n * values, base element defaults, and rendered Markdown styles. Astro\n * components keep their presentation in HTML with Tailwind utilities.\n *\n * For overrides you would rather keep separate from upstream, create\n * `src/styles/global.css` — the Grove integration auto-loads it after\n * this file, and `grove update` never touches it.\n */\n\n@import \"tailwindcss\";\n/*\n * Custom `dark` variant — `dark:` utilities must key off the `.dark`\n * class on <html> (set by the THEME_INIT script in BaseLayout.astro),\n * NOT off `prefers-color-scheme`. Tailwind v4.3.0 splits the selector\n * argument on commas — including commas inside `:where(...)` — so\n * `(&:where(.dark, .dark *))` is silently parsed as two separate\n * (and broken) selectors and the variant never registers. Use two\n * selectors joined by a space instead.\n */\n@custom-variant dark (&:where(.dark), &:where(.dark *));\n@source \"./**/*.{astro,html,js,jsx,ts,tsx}\";\n\n@theme {\n /* ── Starlight-aligned neutral scale ──────────────────────────── */\n --color-ink-50: oklch(98.5% 0 0);\n --color-ink-100: oklch(97% 0 0);\n --color-ink-200: oklch(92.2% 0 0);\n --color-ink-300: oklch(87% 0 0);\n --color-ink-400: oklch(70.8% 0 0);\n --color-ink-500: oklch(55.6% 0 0);\n --color-ink-600: oklch(43.9% 0 0);\n --color-ink-700: oklch(37.1% 0 0);\n --color-ink-800: oklch(26.9% 0 0);\n --color-ink-900: oklch(20.5% 0 0);\n --color-ink-950: oklch(14.5% 0 0);\n\n /* ── Semantic colors ────────────────────────────────────────────\n * These point at runtime variables instead of fixed palette steps so\n * Tailwind utilities such as `bg-background` and `text-foreground`\n * follow the resolved theme without requiring a `dark:` twin. The\n * values below mirror packages/starlight/styles/{theme,base}.css.\n */\n --color-background: var(--grove-background);\n --color-foreground: var(--grove-foreground);\n --color-primary: var(--grove-primary);\n --color-primary-foreground: var(--grove-primary-foreground);\n --color-secondary: var(--grove-secondary);\n --color-secondary-foreground: var(--grove-secondary-foreground);\n --color-muted: var(--grove-muted);\n --color-muted-foreground: var(--grove-muted-foreground);\n --color-accent: var(--grove-accent);\n --color-accent-foreground: var(--grove-accent-foreground);\n --color-border: var(--grove-border);\n --color-input: var(--grove-input);\n --color-ring: var(--grove-ring);\n --color-card: var(--grove-card);\n --color-card-foreground: var(--grove-card-foreground);\n --color-popover: var(--grove-popover);\n --color-popover-foreground: var(--grove-popover-foreground);\n\n /* ── Surfaces ───────────────────────────────────────────────────\n * Elevation roles. `card` and `popover` above resolve to these so\n * legacy utilities keep working while new components can name the\n * elevation they mean.\n */\n --color-surface-raised: var(--grove-surface-raised);\n --color-surface-sunken: var(--grove-surface-sunken);\n --color-surface-overlay: var(--grove-surface-overlay);\n\n /* ── Selection (neutral inversion) ──────────────────────────────\n * Active filters, current lens/page, and other \"you are here\"\n * states. Deliberately decoupled from the brand primary so green\n * can mean brand action or success — never selection.\n */\n --color-selected: var(--grove-selected);\n --color-selected-foreground: var(--grove-selected-foreground);\n\n /* ── Status roles (solid fill + text-on-fill pairs) ───────────── */\n --color-success: var(--grove-success);\n --color-success-foreground: var(--grove-success-foreground);\n --color-warning: var(--grove-warning);\n --color-warning-foreground: var(--grove-warning-foreground);\n --color-danger: var(--grove-danger);\n --color-danger-foreground: var(--grove-danger-foreground);\n --color-info: var(--grove-info);\n --color-info-foreground: var(--grove-info-foreground);\n\n /* ── Accent (interactive states) ─────────────────────────────── */\n --color-accent-muted: color-mix(in oklab, var(--grove-foreground) 8%, transparent);\n\n /* ── Status palettes (badges only) ───────────────────────────── */\n --color-emerald-50: oklch(98.2% 0.018 155.826);\n --color-emerald-300: oklch(87.1% 0.15 154.449);\n --color-emerald-400: oklch(79.2% 0.209 151.711);\n --color-emerald-500: oklch(72.3% 0.219 149.579);\n --color-emerald-600: oklch(52.7% 0.154 150.069);\n --color-emerald-700: oklch(52.7% 0.154 150.069);\n --color-emerald-800: oklch(26.6% 0.065 152.934);\n --color-emerald-950: oklch(26.6% 0.065 152.934);\n\n --color-orange-50: oklch(98% 0.016 73.684);\n --color-orange-300: oklch(90.1% 0.076 70.697);\n --color-orange-400: oklch(83.7% 0.128 66.29);\n --color-orange-500: oklch(70.5% 0.213 47.604);\n --color-orange-700: oklch(70.5% 0.213 47.604);\n --color-orange-800: oklch(55.3% 0.195 38.402);\n --color-orange-950: oklch(40.8% 0.123 38.172);\n\n --color-blue-50: oklch(97% 0.014 254.604);\n --color-blue-300: oklch(82.8% 0.111 230.318);\n --color-blue-400: oklch(70.7% 0.165 254.624);\n --color-blue-700: oklch(48.8% 0.243 264.376);\n --color-blue-800: oklch(29.3% 0.066 243.157);\n --color-blue-950: oklch(29.3% 0.066 243.157);\n\n --color-amber-50: oklch(98% 0.016 73.684);\n --color-amber-300: oklch(90.1% 0.076 70.697);\n --color-amber-400: oklch(83.7% 0.128 66.29);\n --color-amber-500: oklch(83.7% 0.128 66.29);\n --color-amber-600: oklch(70.5% 0.213 47.604);\n --color-amber-700: oklch(70.5% 0.213 47.604);\n --color-amber-800: oklch(55.3% 0.195 38.402);\n --color-amber-900: oklch(40.8% 0.123 38.172);\n --color-amber-950: oklch(40.8% 0.123 38.172);\n\n /* ── Font stacks ─────────────────────────────────────────────── */\n --font-sans:\n -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", \"Noto Sans\", Arial,\n sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n --font-mono:\n ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\",\n monospace;\n\n /* ── Starlight typography weight/rhythm ──────────────────────── */\n --font-weight-semibold: 500;\n --font-weight-bold: 600;\n --leading-relaxed: 1.75;\n\n /* ── Font size extensions (2xs) ──────────────────────────────── */\n --text-2xs: 0.6875rem;\n --text-2xs--line-height: 1rem;\n\n /* ── Container widths (showcase rhythm) ──────────────────────────\n * The default container tracks `theme.containerWidth` from\n * grove.config.ts: BaseLayout emits `--grove-container` on <html>\n * and the token falls back to the package default when unset. */\n --container-container: var(--grove-container, 1160px);\n /* `wide` is an opt-in escape hatch, not a second site width. It is\n clamped to the configured container so a wide section can never\n overhang the header, footer, and the rest of the page — every\n shell and page template uses `max-w-container`. */\n --container-wide: min(var(--grove-container, 1400px), 1400px);\n /* `narrow` is the reading measure for prose pages (about, 404,\n empty). Clamped for the same reason — a site narrower than 720px\n should not have its prose pages spill past its own frame. */\n --container-narrow: min(var(--grove-container, 720px), 720px);\n\n /* ── Border radius scale ──────────────────────────────────────────\n * Driven by `theme.radius` (\"none\" | \"soft\" | \"round\") the same\n * way — BaseLayout emits the `--grove-radius*` overrides. */\n --radius: var(--grove-radius, 0.625rem);\n --radius-lg: var(--grove-radius-lg, 0.5rem);\n --radius-xl: var(--grove-radius-xl, 0.75rem);\n\n /* ── Animations ──────────────────────────────────────────────── */\n --animate-fade-in-up: fade-in-up 0.6s ease-out both;\n --animate-fade-in: fade-in 0.8s ease-out both;\n --animate-gradient-shift: gradient-shift 8s ease-in-out infinite;\n --animate-subtle-bob: subtle-bob 3s ease-in-out infinite;\n}\n\n@keyframes fade-in-up {\n 0% {\n opacity: 0;\n transform: translateY(8px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes gradient-shift {\n 0%,\n 100% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n}\n\n@keyframes subtle-bob {\n 0%,\n 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-2px);\n }\n}\n\n/* Respect the OS-level \"reduce motion\" setting. Neutralizes every\n * animation/transition (the `--animate-*` custom properties above,\n * plus one-off `animate-pulse` / `animate-ping` utility classes used\n * directly in components) rather than trying to freeze each keyframe\n * mid-motion, which isn't meaningful for e.g. `background-position`. */\n@media (prefers-reduced-motion: reduce) {\n *,\n *::before,\n *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n}\n\n/* ──────────────────────────────────────────────────────────────────\n * Base\n * ────────────────────────────────────────────────────────────────── */\n\n@layer base {\n :root {\n color-scheme: light;\n\n /* Starlight light theme, expressed as Grove's public semantic API. */\n --grove-background: oklch(100% 0 0);\n --grove-foreground: var(--color-ink-950);\n --grove-gray-1: var(--color-ink-900);\n --grove-gray-2: var(--color-ink-800);\n --grove-gray-3: var(--color-ink-700);\n --grove-gray-4: var(--color-ink-500);\n --grove-gray-5: var(--color-ink-400);\n --grove-gray-6: var(--color-ink-300);\n --grove-gray-7: var(--color-ink-100);\n /* Brand color from `theme.primaryColor` (grove.config.ts) —\n * BaseLayout emits `--grove-theme-primary*` on <html>; without\n * a config the site keeps the neutral ink treatment. */\n --grove-primary: var(--grove-theme-primary, var(--grove-foreground));\n --grove-primary-foreground: var(--grove-theme-primary-foreground, var(--grove-gray-7));\n --grove-secondary: var(--grove-gray-7);\n --grove-secondary-foreground: var(--grove-foreground);\n --grove-muted: var(--grove-gray-7);\n --grove-muted-foreground: var(--grove-gray-4);\n --grove-accent: var(--grove-gray-7);\n --grove-accent-foreground: var(--grove-foreground);\n --grove-border: var(--grove-gray-6);\n --grove-input: var(--grove-gray-6);\n --grove-ring: var(--grove-gray-4);\n /* Elevation: raised surfaces stay in the light family — cards sit\n * on the page via border, not a dark fill. */\n --grove-surface-raised: var(--grove-background);\n --grove-surface-sunken: var(--color-ink-100);\n --grove-surface-overlay: var(--grove-background);\n --grove-card: var(--grove-surface-raised);\n --grove-card-foreground: var(--grove-foreground);\n --grove-popover: var(--grove-surface-overlay);\n --grove-popover-foreground: var(--grove-foreground);\n /* Selection: neutral inversion (vite.dev-style), never the brand\n * primary. */\n --grove-selected: var(--color-ink-900);\n --grove-selected-foreground: var(--color-ink-50);\n /* Status fills with AA text-on-fill partners. */\n --grove-success: #15803d;\n --grove-success-foreground: #ffffff;\n --grove-warning: #92400e;\n --grove-warning-foreground: #ffffff;\n --grove-danger: #b91c1c;\n --grove-danger-foreground: #ffffff;\n --grove-info: #1d4ed8;\n --grove-info-foreground: #ffffff;\n }\n\n :root.dark {\n color-scheme: dark;\n --grove-background: var(--color-ink-950);\n --grove-foreground: var(--color-ink-50);\n --grove-gray-1: var(--color-ink-50);\n --grove-gray-2: var(--color-ink-300);\n --grove-gray-3: var(--color-ink-400);\n --grove-gray-4: var(--color-ink-500);\n --grove-gray-5: var(--color-ink-700);\n --grove-gray-6: var(--color-ink-800);\n --grove-gray-7: var(--color-ink-900);\n /* Dark mode lifts the brand color toward white (see BaseLayout's\n * emitted `--grove-theme-primary-dark`) so contrast holds. The\n * foreground is computed against that lifted value, never assumed. */\n --grove-primary: var(--grove-theme-primary-dark, var(--grove-foreground));\n --grove-primary-foreground: var(--grove-theme-primary-dark-foreground, var(--grove-gray-7));\n --grove-secondary: var(--grove-gray-6);\n --grove-secondary-foreground: var(--grove-foreground);\n --grove-muted: var(--grove-gray-6);\n --grove-muted-foreground: var(--grove-gray-3);\n --grove-accent: var(--grove-gray-5);\n --grove-accent-foreground: var(--grove-foreground);\n --grove-border: var(--grove-gray-6);\n --grove-input: var(--grove-gray-5);\n --grove-ring: var(--grove-gray-4);\n /* Elevation: the dark raised surface sits just above the ink-950\n * page (deliberate landing-page value; hover lifts to ink-900). */\n --grove-surface-raised: #141516;\n --grove-surface-sunken: oklch(11.5% 0 0);\n --grove-surface-overlay: var(--grove-gray-7);\n --grove-card: var(--grove-surface-raised);\n --grove-card-foreground: var(--grove-foreground);\n --grove-popover: var(--grove-surface-overlay);\n --grove-popover-foreground: var(--grove-foreground);\n /* Selection: neutral inversion, mirrored. */\n --grove-selected: var(--color-ink-100);\n --grove-selected-foreground: var(--color-ink-950);\n /* Status fills lift toward pastels with dark text-on-fill. */\n --grove-success: #4ade80;\n --grove-success-foreground: var(--color-ink-950);\n --grove-warning: #fbbf24;\n --grove-warning-foreground: var(--color-ink-950);\n --grove-danger: #f87171;\n --grove-danger-foreground: var(--color-ink-950);\n --grove-info: #60a5fa;\n --grove-info-foreground: var(--color-ink-950);\n }\n\n html {\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n body {\n margin: 0;\n background: var(--grove-background);\n color: var(--grove-foreground);\n font-family: var(--font-sans);\n font-size: 15px;\n line-height: 1.75;\n }\n\n a {\n color: inherit;\n text-decoration: none;\n }\n\n /* Subtle selection */\n ::selection {\n background: var(--grove-muted);\n color: var(--grove-foreground);\n }\n\n /* Slim, neutral scrollbar */\n * {\n scrollbar-width: thin;\n scrollbar-color: var(--grove-border) transparent;\n }\n *::-webkit-scrollbar {\n width: 8px;\n height: 8px;\n }\n *::-webkit-scrollbar-thumb {\n background: var(--grove-border);\n border-radius: 4px;\n }\n\n input,\n select,\n textarea,\n button {\n font: inherit;\n }\n\n :where(\n input[type=\"text\"],\n input[type=\"search\"],\n input[type=\"url\"],\n input[type=\"email\"],\n input:not([type]),\n textarea\n ) {\n appearance: none;\n -webkit-appearance: none;\n }\n\n input[type=\"search\"]::-webkit-search-cancel-button,\n input[type=\"search\"]::-webkit-search-results-button,\n input[type=\"search\"]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n display: none;\n }\n\n /* Inputs that live INSIDE a styled shell (the hero search pill)\n * opt out with `.grove-input-unstyled`: the shell owns the border,\n * radius, background, and the focus treatment via `focus-within` —\n * forcing a second background/radius/focus ring on the inner input\n * paints a box-within-a-box. */\n :where(\n input[type=\"text\"],\n input[type=\"search\"],\n input[type=\"url\"],\n input[type=\"email\"],\n input:not([type]),\n select,\n textarea\n ):not(.grove-input-unstyled) {\n border-color: var(--grove-input) !important;\n border-radius: var(--radius) !important;\n background-color: var(--grove-background) !important;\n color: var(--grove-foreground) !important;\n }\n\n :where(\n input[type=\"text\"],\n input[type=\"search\"],\n input[type=\"url\"],\n input[type=\"email\"],\n input:not([type]),\n select,\n textarea\n ):not(.grove-input-unstyled):focus-visible {\n border-color: var(--grove-ring) !important;\n outline: none;\n box-shadow: 0 0 0 3px color-mix(in oklab, var(--grove-ring) 35%, transparent);\n }\n}\n\n/* ──────────────────────────────────────────────────────────────────\n * Rendered record Markdown\n *\n * The `.grove-prose` class wraps any rendered Markdown body (record\n * sidecar or consumer-authored page). Sizing follows the editorial\n * recipe:\n * body 17px / 1.75\n * h2 28px h3 21px h4 17px h5/h6 smaller, uppercase tracker\n * The parent column owns the measure (≈760–820px on lg+), so the\n * `.grove-prose` wrapper intentionally omits a `max-width`.\n *\n * Colors come from the package's `ink-*` scale via CSS variables so\n * every consumer gets the same baseline regardless of brand overrides.\n * ────────────────────────────────────────────────────────────────── */\n\n/* ──────────────────────────────────────────────────────────────────\n * Monochrome brand marks (`Icon.astro`, kind: \"mono\")\n *\n * An SVG loaded through `<img src>` is an independent document that\n * page CSS cannot reach, so `currentColor` inside it never resolves\n * against the theme — it silently renders black in both modes. That\n * is why single-color marks (Apple, Rust, Tauri, Deno, …) used to\n * need a hand-maintained `-light`/`-dark` file pair plus a JS `src`\n * swap, and why the pair was easy to get backwards.\n *\n * Masking inverts the relationship: the SVG supplies the *shape*\n * (via its alpha channel) and the page supplies the *color* — no\n * script and no second file.\n *\n * The paint is `--grove-foreground`, NOT `currentColor`. These are\n * brand marks, and a brand mark's real presentation is solid black on\n * light and solid white on dark — not whatever tint the surrounding\n * chip label happens to use. Inheriting `currentColor` washed the\n * Apple mark down to the chip's muted `ink-500`, which reads as a\n * greyed-out logo rather than a logo. Callers that genuinely want a\n * tinted mark can override `--grove-icon-mono`.\n *\n * The URL is per-icon and computed at render time, so it can never\n * appear literally in a source file for Tailwind's extractor to find\n * — arbitrary `mask-[url(…)]` utilities are structurally impossible\n * here. Everything static lives in this class; only the URL travels\n * inline, as `--grove-icon-url`.\n * ────────────────────────────────────────────────────────────────── */\n.grove-icon-mask {\n display: inline-block;\n flex-shrink: 0;\n vertical-align: middle;\n background-color: var(--grove-icon-mono, var(--grove-foreground));\n -webkit-mask-image: var(--grove-icon-url);\n mask-image: var(--grove-icon-url);\n -webkit-mask-size: contain;\n mask-size: contain;\n -webkit-mask-repeat: no-repeat;\n mask-repeat: no-repeat;\n -webkit-mask-position: center;\n mask-position: center;\n}\n\n/* Print stylesheets drop background colors, which would erase the\n * glyph entirely — an `<img>` would still print. */\n@media print {\n .grove-icon-mask {\n -webkit-print-color-adjust: exact;\n print-color-adjust: exact;\n }\n}\n\n/* Forced-colors mode overrides `background-color`; pin it to the\n * system text color so the mark stays visible. */\n@media (forced-colors: active) {\n .grove-icon-mask {\n background-color: CanvasText;\n }\n}\n\n.grove-prose {\n font-size: 1.0625rem; /* 17px */\n line-height: 1.75;\n color: var(--color-ink-700, #3a3a3a);\n overflow-wrap: break-word;\n word-wrap: break-word;\n}\n.dark .grove-prose {\n color: var(--color-ink-200, #d4d4d4);\n}\n.grove-prose > :first-child {\n margin-top: 0;\n}\n.grove-prose > :last-child {\n margin-bottom: 0;\n}\n\n/* Headings — full depth. */\n.grove-prose :where(h1, h2, h3, h4, h5, h6) {\n font-weight: 600;\n line-height: 1.25;\n letter-spacing: -0.015em;\n color: var(--color-ink-900, #1a1a1a);\n scroll-margin-top: 5rem;\n}\n.dark .grove-prose :where(h1, h2, h3, h4, h5, h6) {\n color: var(--color-ink-100, #f0f0f0);\n}\n/* Page bodies open with a `# <Page name>` heading that duplicates\n the page title. Hide the first heading so the body flows from a\n top-level paragraph into sections. */\n.grove-prose > h1:first-child {\n display: none;\n}\n.grove-prose h1:not(:first-child) {\n font-size: 2.5rem; /* 40px */\n margin-top: 2.5rem;\n margin-bottom: 1rem;\n}\n.grove-prose h2 {\n font-size: 1.75rem; /* 28px */\n margin-top: 2.5rem;\n margin-bottom: 0.75rem;\n padding-bottom: 0.5rem;\n border-bottom: 1px solid var(--color-ink-200, #e5e5e5);\n}\n.dark .grove-prose h2 {\n border-bottom-color: var(--color-ink-800, #2a2a2a);\n}\n.grove-prose h3 {\n font-size: 1.3125rem; /* 21px */\n margin-top: 2rem;\n margin-bottom: 0.5rem;\n}\n.grove-prose h4 {\n font-size: 1.0625rem; /* 17px */\n margin-top: 1.5rem;\n margin-bottom: 0.4rem;\n}\n.grove-prose h5 {\n font-size: 0.9375rem; /* 15px */\n margin-top: 1.25rem;\n margin-bottom: 0.4rem;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n color: var(--color-ink-600, #555555);\n}\n.grove-prose h6 {\n font-size: 0.875rem; /* 14px */\n margin-top: 1rem;\n margin-bottom: 0.35rem;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n color: var(--color-ink-500, #6a6a6a);\n}\n.dark .grove-prose h5 {\n color: var(--color-ink-400, #8a8a8a);\n}\n.dark .grove-prose h6 {\n color: var(--color-ink-500, #6a6a6a);\n}\n\n/* Paragraphs + lists. */\n.grove-prose p {\n margin: 0 0 1rem 0;\n}\n.grove-prose :where(ul, ol) {\n margin: 0 0 1rem 0;\n padding-left: 1.5rem;\n}\n.grove-prose ul {\n list-style: disc;\n}\n.grove-prose ol {\n list-style: decimal;\n}\n.grove-prose li {\n margin-bottom: 0.35rem;\n padding-left: 0.25rem;\n}\n.grove-prose li > :where(ul, ol) {\n margin-top: 0.35rem;\n margin-bottom: 0;\n}\n\n/* Definition lists. */\n.grove-prose dl {\n margin: 0 0 1rem 0;\n}\n.grove-prose dt {\n font-weight: 600;\n color: var(--color-ink-900, #1a1a1a);\n margin-top: 0.5rem;\n}\n.grove-prose dd {\n margin-left: 1.5rem;\n margin-bottom: 0.5rem;\n color: var(--color-ink-700, #3a3a3a);\n}\n.dark .grove-prose dt {\n color: var(--color-ink-100, #f0f0f0);\n}\n.dark .grove-prose dd {\n color: var(--color-ink-200, #d4d4d4);\n}\n\n/* Inline emphasis. */\n.grove-prose strong {\n font-weight: 600;\n color: var(--color-ink-900, #1a1a1a);\n}\n.grove-prose em {\n font-style: italic;\n}\n.grove-prose u {\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.grove-prose :where(s, del) {\n text-decoration: line-through;\n color: var(--color-ink-500, #6a6a6a);\n}\n.grove-prose ins {\n text-decoration: underline;\n text-decoration-style: double;\n text-underline-offset: 2px;\n}\n.grove-prose small {\n font-size: 0.85em;\n color: var(--color-ink-500, #6a6a6a);\n}\n.dark .grove-prose strong {\n color: var(--color-ink-100, #f0f0f0);\n}\n.dark .grove-prose small {\n color: var(--color-ink-400, #8a8a8a);\n}\n\n/* Inline marks / keys / abbreviations. */\n.grove-prose mark {\n background-color: oklch(95% 0.05 90);\n color: var(--color-ink-900, #1a1a1a);\n padding: 0.05em 0.25em;\n border-radius: 0.2rem;\n}\n.dark .grove-prose mark {\n background-color: oklch(35% 0.08 80);\n color: var(--color-ink-50, #fafafa);\n}\n.grove-prose kbd {\n font-family: var(--font-mono);\n font-size: 0.8em;\n background-color: var(--color-ink-100, #f0f0f0);\n color: var(--color-ink-900, #1a1a1a);\n border: 1px solid var(--color-ink-300, #c0c0c0);\n border-bottom-width: 2px;\n border-radius: 0.3rem;\n padding: 0.05em 0.4em;\n line-height: 1;\n display: inline-block;\n vertical-align: baseline;\n box-shadow: 0 1px 0 var(--color-ink-300, #c0c0c0);\n}\n.dark .grove-prose kbd {\n background-color: var(--color-ink-900, #1a1a1a);\n color: var(--color-ink-100, #f0f0f0);\n border-color: var(--color-ink-700, #4a4a4a);\n box-shadow: 0 1px 0 var(--color-ink-700, #4a4a4a);\n}\n.grove-prose abbr[title] {\n text-decoration: underline dotted;\n text-underline-offset: 2px;\n cursor: help;\n}\n.grove-prose :where(sub, sup) {\n font-size: 0.75em;\n line-height: 1;\n position: relative;\n vertical-align: baseline;\n}\n.grove-prose sub {\n bottom: -0.25em;\n}\n.grove-prose sup {\n top: -0.5em;\n}\n.grove-prose time {\n font-variant-numeric: tabular-nums;\n}\n\n/* Links. */\n.grove-prose a {\n color: var(--color-ink-900, #1a1a1a);\n text-decoration: underline;\n text-decoration-color: var(--color-ink-300, #c0c0c0);\n text-underline-offset: 2px;\n text-decoration-thickness: 1px;\n transition: text-decoration-color 120ms ease;\n}\n.grove-prose a:hover {\n text-decoration-color: currentColor;\n text-decoration-thickness: 2px;\n}\n.dark .grove-prose a {\n color: var(--color-ink-100, #f0f0f0);\n text-decoration-color: var(--color-ink-700, #4a4a4a);\n}\n\n/* Inline code. */\n.grove-prose code {\n font-family: var(--font-mono);\n font-size: 0.875em;\n background-color: var(--color-ink-100, #f0f0f0);\n color: var(--color-ink-900, #1a1a1a);\n padding: 0.15em 0.4em;\n border-radius: 0.3rem;\n word-break: break-word;\n}\n.dark .grove-prose code {\n background-color: var(--color-ink-900, #1a1a1a);\n color: var(--color-ink-100, #f0f0f0);\n}\n\n/* Code blocks — full column width, internal scroll on overflow. */\n.grove-prose pre {\n background-color: var(--color-ink-100, #f0f0f0);\n color: var(--color-ink-900, #1a1a1a);\n padding: 1rem 1.25rem;\n border-radius: 0.5rem;\n overflow-x: auto;\n margin: 0 0 1.5rem 0;\n font-size: 0.875rem;\n line-height: 1.6;\n border: 1px solid var(--color-ink-200, #e5e5e5);\n max-width: 100%;\n}\n.dark .grove-prose pre {\n background-color: var(--color-ink-900, #1a1a1a);\n color: var(--color-ink-100, #f0f0f0);\n border-color: var(--color-ink-800, #2a2a2a);\n}\n.grove-prose pre code {\n background: transparent;\n padding: 0;\n border-radius: 0;\n font-size: inherit;\n word-break: normal;\n white-space: pre;\n}\n\n/* Shiki-themed code blocks. Shiki emits `<pre class=\"shiki …\">`\n with per-token `<span style=\"--shiki-light: …; --shiki-dark: …\">`\n when configured with `defaultColor: false`. Our job is to:\n 1. Give the block a slightly different background to read as\n \"code\" (lighter than the prose surface in light mode,\n darker in dark mode).\n 2. Make the foreground colour resolve through the dual\n variables so the same HTML is themed correctly when\n `.dark` toggles on `<html>`. */\n.grove-prose pre.shiki {\n background-color: var(--color-ink-50, #fafafa) !important;\n color: var(--shiki-light, var(--color-ink-900, #1a1a1a));\n border-color: var(--color-ink-200, #e5e5e5);\n}\n.dark .grove-prose pre.shiki {\n background-color: var(--color-ink-950, #0a0a0a) !important;\n color: var(--shiki-dark, var(--color-ink-100, #f0f0f0));\n border-color: var(--color-ink-800, #2a2a2a);\n}\n.grove-prose pre.shiki code {\n color: inherit;\n}\n.grove-prose pre.shiki span {\n color: var(--shiki-light);\n}\n.dark .grove-prose pre.shiki span {\n color: var(--shiki-dark);\n}\n\n/* Blockquotes — italic + left border + background tint. */\n.grove-prose blockquote {\n margin: 0 0 1rem 0;\n padding: 0.65rem 1rem 0.65rem 1.1rem;\n border-left: 3px solid var(--color-ink-300, #c0c0c0);\n color: var(--color-ink-500, #6a6a6a);\n font-style: italic;\n background-color: var(--color-ink-50, #fafafa);\n border-radius: 0 0.4rem 0.4rem 0;\n}\n.grove-prose blockquote > :first-child {\n margin-top: 0;\n}\n.grove-prose blockquote > :last-child {\n margin-bottom: 0;\n}\n.grove-prose blockquote p {\n margin: 0 0 0.5rem 0;\n}\n.grove-prose blockquote blockquote {\n margin: 0.5rem 0;\n border-left-width: 2px;\n}\n.dark .grove-prose blockquote {\n border-left-color: var(--color-ink-700, #4a4a4a);\n color: var(--color-ink-400, #8a8a8a);\n background-color: var(--color-ink-900, #1a1a1a);\n}\n\n/* Horizontal rules. */\n.grove-prose hr {\n border: 0;\n border-top: 1px solid var(--color-ink-200, #e5e5e5);\n margin: 2.25rem 0;\n}\n.dark .grove-prose hr {\n border-top-color: var(--color-ink-800, #2a2a2a);\n}\n\n/* Images — rounded border, full column width. */\n.grove-prose img {\n max-width: 100%;\n height: auto;\n border-radius: 0.5rem;\n border: 1px solid var(--color-ink-200, #e5e5e5);\n display: block;\n margin: 1.25rem 0;\n}\n.dark .grove-prose img {\n border-color: var(--color-ink-800, #2a2a2a);\n}\n\n/* Figures + captions. */\n.grove-prose figure {\n margin: 1.25rem 0;\n padding: 0;\n}\n.grove-prose figure > img {\n margin: 0 0 0.5rem 0;\n}\n.grove-prose figcaption {\n font-size: 0.85rem;\n color: var(--color-ink-500, #6a6a6a);\n text-align: center;\n margin-top: 0.4rem;\n}\n.dark .grove-prose figcaption {\n color: var(--color-ink-400, #8a8a8a);\n}\n\n/* GFM tables — the renderer wraps them in `.grove-prose-table-wrap`\n so the column-width overflow is contained. */\n.grove-prose-table-wrap {\n margin: 0 0 1.5rem 0;\n overflow-x: auto;\n border-radius: 0.5rem;\n border: 1px solid var(--color-ink-200, #e5e5e5);\n background-color: var(--grove-background, #ffffff);\n}\n.dark .grove-prose-table-wrap {\n border-color: var(--color-ink-800, #2a2a2a);\n}\n.grove-prose table {\n width: 100%;\n border-collapse: collapse;\n font-size: 0.95rem;\n line-height: 1.55;\n}\n.grove-prose table caption {\n text-align: left;\n font-size: 0.85rem;\n color: var(--color-ink-500, #6a6a6a);\n padding: 0.5rem 1rem;\n caption-side: bottom;\n}\n.grove-prose thead {\n background-color: var(--color-ink-50, #fafafa);\n border-bottom: 2px solid var(--color-ink-200, #e5e5e5);\n}\n.dark .grove-prose thead {\n background-color: var(--color-ink-900, #1a1a1a);\n border-bottom-color: var(--color-ink-700, #4a4a4a);\n}\n.grove-prose th {\n text-align: left;\n font-weight: 600;\n padding: 0.75rem 1rem;\n color: var(--color-ink-900, #1a1a1a);\n border-bottom: 1px solid var(--color-ink-200, #e5e5e5);\n}\n.grove-prose td {\n padding: 0.65rem 1rem;\n border-bottom: 1px solid var(--color-ink-100, #f0f0f0);\n color: var(--color-ink-700, #3a3a3a);\n vertical-align: top;\n}\n.grove-prose th[align=\"center\"],\n.grove-prose td[align=\"center\"] {\n text-align: center;\n}\n.grove-prose th[align=\"right\"],\n.grove-prose td[align=\"right\"] {\n text-align: right;\n}\n.grove-prose tbody tr:last-child td {\n border-bottom: 0;\n}\n.grove-prose tbody tr:hover {\n background-color: var(--color-ink-50, #fafafa);\n}\n.dark .grove-prose th {\n color: var(--color-ink-100, #f0f0f0);\n border-bottom-color: var(--color-ink-700, #4a4a4a);\n}\n.dark .grove-prose td {\n color: var(--color-ink-200, #d4d4d4);\n border-bottom-color: var(--color-ink-800, #2a2a2a);\n}\n.dark .grove-prose tbody tr:hover {\n background-color: var(--color-ink-900, #1a1a1a);\n}\n\n/* GFM task-list checkboxes — read-only at runtime. */\n.grove-prose input[type=\"checkbox\"] {\n appearance: none;\n -webkit-appearance: none;\n width: 1em;\n height: 1em;\n border: 1.5px solid var(--color-ink-400, #999999);\n border-radius: 0.25rem;\n margin-right: 0.45rem;\n margin-top: 0.15rem;\n vertical-align: middle;\n position: relative;\n top: -0.05em;\n background-color: var(--grove-background, #ffffff);\n cursor: default;\n flex-shrink: 0;\n}\n.grove-prose input[type=\"checkbox\"]:checked {\n background-color: var(--color-ink-900, #1a1a1a);\n border-color: var(--color-ink-900, #1a1a1a);\n}\n.grove-prose input[type=\"checkbox\"]:checked::after {\n content: \"\";\n position: absolute;\n left: 4px;\n top: 1px;\n width: 4px;\n height: 8px;\n border: solid var(--grove-background, #ffffff);\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n}\n.grove-prose input[type=\"checkbox\"]:disabled {\n opacity: 0.7;\n}\n.dark .grove-prose input[type=\"checkbox\"] {\n border-color: var(--color-ink-600, #555555);\n background-color: var(--grove-background, #1a1a1a);\n}\n.dark .grove-prose input[type=\"checkbox\"]:checked {\n background-color: var(--color-ink-100, #f0f0f0);\n border-color: var(--color-ink-100, #f0f0f0);\n}\n.dark .grove-prose input[type=\"checkbox\"]:checked::after {\n border-color: var(--grove-background, #1a1a1a);\n}\n.grove-prose li:has(> input[type=\"checkbox\"]) {\n list-style: none;\n margin-left: -1.25rem;\n display: flex;\n align-items: flex-start;\n gap: 0.15rem;\n}\n.grove-prose li:has(> input[type=\"checkbox\"]) > input[type=\"checkbox\"] {\n margin-right: 0.55rem;\n margin-left: 0.15rem;\n}\n\n/* Collapsibles (details / summary). */\n.grove-prose details {\n margin: 0 0 1rem 0;\n border: 1px solid var(--color-ink-200, #e5e5e5);\n border-radius: 0.5rem;\n background-color: var(--color-ink-50, #fafafa);\n overflow: hidden;\n}\n.grove-prose details[open] {\n background-color: var(--grove-background, #ffffff);\n}\n.grove-prose details + details {\n margin-top: -0.5rem;\n}\n.dark .grove-prose details {\n border-color: var(--color-ink-800, #2a2a2a);\n background-color: var(--color-ink-900, #1a1a1a);\n}\n.dark .grove-prose details[open] {\n background-color: var(--grove-background, #1a1a1a);\n}\n.grove-prose summary {\n cursor: pointer;\n padding: 0.75rem 1rem;\n font-weight: 600;\n color: var(--color-ink-900, #1a1a1a);\n list-style: none;\n user-select: none;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n transition: background-color 120ms ease;\n}\n.grove-prose summary::-webkit-details-marker {\n display: none;\n}\n.grove-prose summary::before {\n content: \"\";\n width: 0;\n height: 0;\n border-style: solid;\n border-width: 0.35rem 0 0.35rem 0.55rem;\n border-color: transparent transparent transparent var(--color-ink-500, #6a6a6a);\n transition: transform 120ms ease;\n flex-shrink: 0;\n}\n.grove-prose details[open] > summary::before {\n transform: rotate(90deg);\n}\n.grove-prose summary:hover {\n background-color: var(--color-ink-100, #f0f0f0);\n}\n.grove-prose summary strong {\n font-weight: inherit;\n}\n.dark .grove-prose summary {\n color: var(--color-ink-100, #f0f0f0);\n}\n.dark .grove-prose summary:hover {\n background-color: var(--color-ink-800, #2a2a2a);\n}\n.grove-prose details > :not(summary) {\n padding: 0 1rem 1rem 1rem;\n}\n.grove-prose details > :not(summary):first-of-type {\n padding-top: 0;\n}\n\n/* ──────────────────────────────────────────────────────────────────\n * On-page TOC component (`.grove-toc-*`)\n * Selectors are static so Tailwind purges nothing. The active state\n * is set imperatively by the TableOfContents script via\n * `[data-toc-active]` on the matching anchor.\n * ────────────────────────────────────────────────────────────────── */\n.grove-toc summary {\n color: inherit;\n}\n.grove-toc[open] .grove-toc-chevron,\n.grove-toc > summary:hover .grove-toc-chevron {\n transform: rotate(90deg);\n}\n/* Desktop (lg+): keep the TOC contents visible even before the\n * component script sets the `open` attribute (and with JS disabled).\n * Closed `<details>` content lives in a hidden UA shadow slot, so\n * both the legacy child rule and the modern `::details-content`\n * override are needed for cross-browser coverage; the script in\n * `TableOfContents.astro` sets `open` as the primary mechanism. */\n@media (width >= 64rem) {\n .grove-toc:not([open]) > *:not(summary) {\n display: block;\n }\n .grove-toc:not([open])::details-content {\n content-visibility: visible;\n display: block;\n }\n}\n/* Active item: text-color + a left-rail accent on the link's\n * leading edge. A full pill background reads as a button, not a\n * nav indicator, so it is reserved for hover; the rail stays put\n * while the visitor moves between sections. */\n.grove-toc-item > .grove-toc-link {\n position: relative;\n}\n.grove-toc-link {\n border-left: 2px solid transparent;\n}\n.grove-toc-item--h3 > .grove-toc-link {\n border-left-style: dashed;\n}\n.grove-toc-link[data-toc-active] {\n color: var(--color-ink-900, #1a1a1a);\n border-left-color: currentColor;\n font-weight: 600;\n}\n.dark .grove-toc-link[data-toc-active] {\n color: var(--color-ink-100, #f0f0f0);\n}\n\n/* ──────────────────────────────────────────────────────────────────\n * Activity-badge tone classes.\n *\n * Tone is set via `data-activity-tone` on the element. The rules\n * below are static strings, so Tailwind's content scanner can see\n * them at build time and ship the CSS. Avoid rebuilding tone\n * strings from variables — Tailwind purges anything it can't see.\n * ────────────────────────────────────────────────────────────────── */\n.grove-pill--activity {\n border-color: var(--color-ink-300, #c0c0c0);\n background-color: var(--color-ink-100, #f0f0f0);\n color: var(--color-ink-700, #3a3a3a);\n}\n[data-activity-tone=\"fresh\"] {\n border-color: oklch(87% 0.15 154);\n background-color: oklch(98% 0.018 156);\n color: oklch(40% 0.12 152);\n}\n[data-activity-tone=\"ok\"] {\n border-color: oklch(83% 0.11 230);\n background-color: oklch(97% 0.014 255);\n color: oklch(40% 0.16 255);\n}\n[data-activity-tone=\"low\"] {\n border-color: oklch(90% 0.08 70);\n background-color: oklch(98% 0.016 74);\n color: oklch(40% 0.13 60);\n}\n[data-activity-tone=\"dead\"] {\n border-color: oklch(90% 0.08 40);\n background-color: oklch(98% 0.016 38);\n color: oklch(40% 0.13 40);\n}\n.dark [data-activity-tone=\"fresh\"] {\n border-color: oklch(35% 0.1 154);\n background-color: oklch(20% 0.05 156);\n color: oklch(85% 0.15 154);\n}\n.dark [data-activity-tone=\"ok\"] {\n border-color: oklch(30% 0.1 230);\n background-color: oklch(20% 0.05 255);\n color: oklch(80% 0.13 230);\n}\n.dark [data-activity-tone=\"low\"] {\n border-color: oklch(35% 0.1 60);\n background-color: oklch(20% 0.05 74);\n color: oklch(85% 0.13 70);\n}\n.dark [data-activity-tone=\"dead\"] {\n border-color: oklch(35% 0.1 40);\n background-color: oklch(20% 0.05 40);\n color: oklch(85% 0.13 40);\n}\n\n/* ──────────────────────────────────────────────────────────────────\n * Sidebar key-value rows.\n * Static selector (no dynamic class concatenation) — Tailwind ships\n * the CSS because the class string appears literally here.\n * ────────────────────────────────────────────────────────────────── */\n.grove-kv div {\n line-height: 1.4;\n}\n.grove-card-title {\n letter-spacing: 0.04em;\n}\n.grove-card--muted {\n background-color: color-mix(in oklab, var(--grove-background) 60%, transparent);\n}\n",
67
+ "type": "registry:file",
68
+ "target": "~/src/styles/system.css"
69
+ }
70
+ ],
71
+ "meta": {
72
+ "version": "1.1.0",
73
+ "requiresGrove": "0.9.0"
74
+ },
75
+ "type": "registry:block"
76
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "submit",
4
+ "title": "Submit page",
5
+ "description": "The submission route and its client: fetch a repository, validate against the taxonomy, and draft a record YAML for a pull request.",
6
+ "registryDependencies": [
7
+ "@grove/shell",
8
+ "@grove/ui"
9
+ ],
10
+ "files": [
11
+ {
12
+ "path": "default/pages/submit.astro",
13
+ "content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport { getSubmissionPageModel } from '@grove-dev/astro/server';\nimport SubmissionClient from '../components/grove/submission-client.astro';\nimport BaseLayout from '../layouts/base-layout.astro';\nimport Container from '../layouts/container.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\nconst {\n singular,\n title,\n description,\n repoUrl,\n copy,\n fields,\n categories,\n stacks,\n existingSlugs,\n existingFullNames,\n platformOptions,\n licenseOptions,\n taxonomy,\n} = getSubmissionPageModel(siteConfig);\nconst goodSubmissions = [\n ...(copy.good?.length\n ? copy.good\n : [\n `A real, usable ${singular}, not a tutorial or one-screen demo`,\n 'A public repository with a clear open-source license',\n 'Enough documentation to understand, run, or contribute',\n 'Recent maintenance, releases, or meaningful project history',\n ]),\n];\nconst pleaseAvoid = [\n ...(copy.avoid?.length\n ? copy.avoid\n : [\n 'Snippets, exercises, abandoned experiments, or duplicate entries',\n 'Private repositories or projects without source',\n 'Marketing pages with no usable project behind them',\n 'Records with no license or verifiable repository',\n ]),\n];\n---\n\n<BaseLayout title={title} description={description} site={siteConfig} noindex>\n <Container>\n <section class=\"py-10 sm:py-14\">\n <div class=\"max-w-3xl\">\n <p class=\"m-0 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n {copy.eyebrow ?? `${singular} submission`}\n </p>\n <h1 class=\"mt-2 text-[2rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\">\n {copy.title ?? `Add ${singular === \"app\" ? \"an\" : \"a\"} ${singular} to the directory`}\n </h1>\n <p class=\"m-0 mt-3 max-w-[60ch] text-[0.9375rem] leading-relaxed text-ink-500 dark:text-ink-400\">\n {copy.description ?? `Paste a GitHub URL to pull in the basics, edit the generated draft, then open a pull request. The data stays in this repository.`}\n </p>\n </div>\n\n {/* One compact line, not three cards — on mobile the form\n starts within the first viewport. */}\n <ol class=\"mt-4 flex flex-wrap gap-x-6 gap-y-1.5 text-2xs text-muted-foreground\" aria-label=\"Submission steps\">\n {[\n [\"1\", \"Paste a GitHub URL\"],\n [\"2\", \"Review the draft\"],\n [\"3\", \"Open a pull request\"],\n ].map(([number, heading]) => (\n <li class=\"flex items-center gap-1.5\">\n <span class=\"inline-flex h-4.5 w-4.5 shrink-0 items-center justify-center rounded-full border border-border font-mono text-[10px] font-semibold text-foreground\">{number}</span>\n <span class=\"font-medium text-foreground\">{heading}</span>\n </li>\n ))}\n </ol>\n\n <div class=\"mt-8 grid grid-cols-1 items-start gap-6 md:grid-cols-[minmax(0,1fr)_minmax(300px,0.72fr)]\">\n <form id=\"submit-form\" class=\"rounded-[calc(var(--radius)+0.25rem)] border border-ink-200 bg-background p-5 shadow-sm dark:border-ink-800\">\n <div class=\"grid gap-5\">\n <label class=\"grid gap-1.5\">\n <span class=\"text-2xs font-medium uppercase tracking-[.05em] text-muted-foreground\">GitHub URL</span>\n <div class=\"flex flex-col gap-2 sm:flex-row\">\n <input id=\"repo-url\" type=\"url\" required placeholder=\"https://github.com/owner/repo\" class=\"min-h-10 flex-1 rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\" />\n <button id=\"fetch-repo\" type=\"button\" class={buttonClass(\"primary\", \"bare\", \"min-h-10 whitespace-nowrap px-3 text-sm\")}>Generate draft</button>\n </div>\n <span class=\"text-2xs text-muted-foreground\">The repository must be public. We never write to it.</span>\n </label>\n\n <div class=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <label class=\"grid gap-1.5\"><span class=\"text-2xs font-medium uppercase tracking-[.05em] text-muted-foreground\">Name</span><input id=\"item-name\" type=\"text\" class=\"min-h-10 rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\" /></label>\n <label class=\"grid gap-1.5\"><span class=\"text-2xs font-medium uppercase tracking-[.05em] text-muted-foreground\">Slug</span><input id=\"item-slug\" type=\"text\" class=\"min-h-10 rounded-[var(--radius)] border border-input bg-background px-3 py-2 font-mono text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\" /><span class=\"text-2xs text-muted-foreground\">URL fragment, auto-filled from the repository name.</span></label>\n </div>\n\n <label class=\"grid gap-1.5\">\n <span class=\"text-2xs font-medium uppercase tracking-[.05em] text-muted-foreground\">Description</span>\n <textarea id=\"item-description\" rows=\"3\" class=\"min-h-10 resize-y rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\"></textarea>\n <span class=\"text-2xs text-muted-foreground\">One or two sentences in plain language.</span>\n </label>\n\n {(fields.category || fields.stack) && <div class:list={[\"grid grid-cols-1 gap-4\", fields.category && fields.stack && \"sm:grid-cols-2\"]}>\n {fields.category && (\n <label class=\"grid gap-1.5\">\n <span class=\"text-2xs font-medium uppercase tracking-[.05em] text-muted-foreground\">Category</span>\n <select id=\"item-category\" class=\"min-h-10 rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\">\n <option value=\"\">Choose a category</option>\n {categories.map((option) => <option value={option.id}>{option.label}</option>)}\n </select>\n </label>\n )}\n {fields.stack && (\n <label class=\"grid gap-1.5\">\n <span class=\"text-2xs font-medium uppercase tracking-[.05em] text-muted-foreground\">Primary stack</span>\n <select id=\"primary-stack\" class=\"min-h-10 rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\">\n <option value=\"\">Choose a stack</option>\n {stacks.map((option) => <option value={option.id}>{option.label}</option>)}\n </select>\n </label>\n )}\n </div>}\n\n {fields.platforms && <fieldset class=\"grid gap-2\">\n <legend class=\"text-2xs font-medium uppercase tracking-[.05em] text-muted-foreground\">Platforms</legend>\n <div class=\"grid grid-cols-2 gap-2 sm:grid-cols-3\">\n {platformOptions.map((platform) => (\n <label class=\"flex min-h-9 items-center gap-2 rounded-md border border-ink-200 px-2 text-sm dark:border-ink-800\">\n <input type=\"checkbox\" name=\"platform\" value={platform.id} class=\"h-4 w-4\" />\n <span>{platform.label}</span>\n </label>\n ))}\n </div>\n </fieldset>}\n\n {fields.tags && <label class=\"grid gap-1.5\"><span class=\"text-2xs font-medium uppercase tracking-[.05em] text-muted-foreground\">Tags</span><input id=\"item-tags\" type=\"text\" placeholder=\"self-hosted, developer-tools, offline-first\" class=\"min-h-10 rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\" /></label>}\n\n {fields.license && licenseOptions.length > 0 && (\n <label class=\"grid gap-1.5\">\n <span class=\"text-2xs font-medium uppercase tracking-[.05em] text-muted-foreground\">License</span>\n <select id=\"item-license\" class=\"min-h-10 rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\">\n <option value=\"\">Detected from the repository if left empty</option>\n {licenseOptions.map((option) => <option value={option.id}>{option.label}</option>)}\n </select>\n </label>\n )}\n <label class=\"grid gap-1.5\"><span class=\"text-2xs font-medium uppercase tracking-[.05em] text-muted-foreground\">Website</span><input id=\"item-website\" type=\"url\" placeholder=\"https://example.com\" class=\"min-h-10 rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\" /></label>\n <label class=\"grid gap-1.5\"><span class=\"text-2xs font-medium uppercase tracking-[.05em] text-muted-foreground\">Best for</span><textarea id=\"best-for\" rows=\"3\" class=\"min-h-10 resize-y rounded-[var(--radius)] border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\" placeholder=\"One use case per line\"></textarea></label>\n </div>\n </form>\n\n <aside class=\"flex flex-col gap-4 md:sticky md:top-24\">\n <div class=\"rounded-[calc(var(--radius)+0.25rem)] border border-border bg-card p-5\">\n <h2 class=\"m-0 text-[0.9375rem] font-semibold text-ink-900 dark:text-ink-100\">Submission criteria</h2>\n <p class=\"m-0 mt-1 text-2xs text-ink-500 dark:text-ink-400\">Use this checklist before opening the draft.</p>\n <div class=\"mt-4 grid grid-cols-1 gap-4 text-2xs sm:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2\">\n <div>\n <div class=\"font-semibold uppercase tracking-wider text-emerald-700 dark:text-emerald-400\">Good submissions</div>\n <ul class=\"m-0 mt-2 list-none space-y-1 p-0 text-ink-700 dark:text-ink-200\">{goodSubmissions.map((item) => <li class=\"flex gap-2\"><span class=\"text-emerald-600\">✓</span><span>{item}</span></li>)}</ul>\n </div>\n <div>\n <div class=\"font-semibold uppercase tracking-wider text-amber-700 dark:text-amber-400\">Please avoid</div>\n <ul class=\"m-0 mt-2 list-none space-y-1 p-0 text-ink-700 dark:text-ink-200\">{pleaseAvoid.map((item) => <li class=\"flex gap-2\"><span class=\"text-amber-600\">·</span><span>{item}</span></li>)}</ul>\n </div>\n </div>\n </div>\n\n <div class=\"flex min-h-[360px] flex-col rounded-[calc(var(--radius)+0.25rem)] border border-border bg-card p-5\">\n <div class=\"flex flex-wrap items-center justify-between gap-3\">\n <h2 class=\"m-0 text-base font-semibold text-ink-900 dark:text-ink-100\">YAML draft</h2>\n <div class=\"flex items-center gap-2\">\n <button id=\"copy-yaml\" type=\"button\" class={buttonClass(\"secondary\", \"sm\", \"whitespace-nowrap pointer-events-none opacity-50\")} disabled>Copy YAML</button>\n <a id=\"open-pr-link\" href=\"#\" target=\"_blank\" rel=\"noopener noreferrer\" class={buttonClass(\"secondary\", \"sm\", \"whitespace-nowrap pointer-events-none opacity-50\")}>Open PR draft</a>\n </div>\n </div>\n <pre class=\"mt-4 min-h-0 flex-1 overflow-auto rounded-md border border-ink-200 bg-ink-50 p-3 text-xs leading-relaxed text-ink-800 dark:border-ink-800 dark:bg-ink-900/60 dark:text-ink-200\"><code id=\"yaml-preview\">Paste a GitHub URL to generate a draft.</code></pre>\n <p id=\"submit-status\" class=\"mt-3 min-h-5 text-2xs text-ink-500 dark:text-ink-400\" aria-live=\"polite\"></p>\n </div>\n </aside>\n </div>\n </section>\n </Container>\n\n <SubmissionClient\n existingSlugs={existingSlugs}\n existingFullNames={existingFullNames}\n repoUrl={repoUrl}\n fields={fields}\n taxonomy={taxonomy}\n />\n</BaseLayout>\n",
14
+ "type": "registry:page",
15
+ "target": "~/src/pages/submit.astro"
16
+ },
17
+ {
18
+ "path": "default/components/grove/submission-client.astro",
19
+ "content": "---\nimport {\n inferStackFromTopics,\n parseGithubRepo,\n recordSlugify,\n yamlLines,\n yamlQuote,\n} from '@grove-dev/core';\n\ninterface Props {\n existingSlugs: string[];\n existingFullNames: string[];\n repoUrl: string;\n fields: {\n category: boolean;\n stack: boolean;\n platforms: boolean;\n tags: boolean;\n license?: boolean;\n };\n /** Taxonomy ids for client-side validation. */\n taxonomy?: {\n categoryIds?: string[];\n stackIds?: string[];\n platformIds?: string[];\n };\n /**\n * Optional path of a server-side proxy endpoint that wraps\n * `api.github.com` (SSR consumers with an adapter can wire one and\n * read a `GITHUB_TOKEN` env var to lift the rate limit). When\n * omitted — the static-build default — the visitor's browser calls\n * `https://api.github.com/repos/{owner}/{repo}` directly, which\n * works on any static host but is subject to GitHub's per-IP\n * unauthenticated limit (60 requests/hour).\n */\n githubProxyPath?: string;\n}\nconst {\n existingSlugs,\n existingFullNames,\n repoUrl,\n fields,\n taxonomy,\n githubProxyPath = '',\n} = Astro.props;\n---\n\n<script is:inline define:vars={{ existingSlugs, existingFullNames, repoUrl, fields, taxonomy, githubProxyPath, recordSlugify, parseGithubRepo, yamlQuote, yamlLines, inferStackFromTopics }}>\n /** @typedef {{ name: string; description: string | null; html_url: string; homepage: string | null; language: string | null; private: boolean; topics: string[] }} GitHubRepo */\n /** @type {GitHubRepo | null} */\n let repository = null;\n\n const $ = /** @param {string} selector */ (selector) => /** @type {HTMLElement | null} */ (document.querySelector(selector));\n /** @type {Record<string, HTMLInputElement | HTMLTextAreaElement | null>} */\n const inputs = {\n repo: /** @type {HTMLInputElement | null} */ ($(\"#repo-url\")),\n name: /** @type {HTMLInputElement | null} */ ($(\"#item-name\")),\n slug: /** @type {HTMLInputElement | null} */ ($(\"#item-slug\")),\n description: /** @type {HTMLInputElement | null} */ ($(\"#item-description\")),\n category: /** @type {HTMLSelectElement | null} */ ($(\"#item-category\")),\n stack: /** @type {HTMLSelectElement | null} */ ($(\"#primary-stack\")),\n tags: /** @type {HTMLInputElement | null} */ ($(\"#item-tags\")),\n license: /** @type {HTMLSelectElement | null} */ ($(\"#item-license\")),\n website: /** @type {HTMLInputElement | null} */ ($(\"#item-website\")),\n bestFor: /** @type {HTMLTextAreaElement | null} */ ($(\"#best-for\")),\n };\n const fetchButton = /** @type {HTMLButtonElement | null} */ ($(\"#fetch-repo\"));\n const preview = /** @type {HTMLElement | null} */ ($(\"#yaml-preview\"));\n const status = /** @type {HTMLElement | null} */ ($(\"#submit-status\"));\n const copyButton = /** @type {HTMLButtonElement | null} */ ($(\"#copy-yaml\"));\n const openPrLink = /** @type {HTMLAnchorElement | null} */ ($(\"#open-pr-link\"));\n const slugSet = new Set(existingSlugs);\n const repoSet = new Set(existingFullNames);\n const categoryIds = new Set(taxonomy?.categoryIds ?? []);\n const stackIds = new Set(taxonomy?.stackIds ?? []);\n const platformIds = new Set(taxonomy?.platformIds ?? []);\n\n const slugify = recordSlugify;\n const parseRepo = parseGithubRepo;\n const quote = yamlQuote;\n const lines = yamlLines;\n const inferStack = /** @param {GitHubRepo} repo */ (repo) =>\n inferStackFromTopics({ language: repo.language, topics: repo.topics });\n const selectedPlatforms = () =>\n /** @type {string[]} */ ([...document.querySelectorAll(\"input[name=platform]:checked\")].map((input) => /** @type {HTMLInputElement} */ (input).value));\n const setStatus = (text, tone = \"muted\") => {\n if (!status) return;\n status.textContent = text;\n // Status tokens (danger/warning/success) so the submit states use\n // the same semantic roles as the rest of the system.\n status.className = `mt-3 min-h-5 text-2xs ${tone === \"error\" ? \"text-danger\" : tone === \"warn\" ? \"text-warning\" : tone === \"success\" ? \"text-success\" : \"text-muted-foreground\"}`;\n };\n const generateYaml = () => {\n if (!repository) return \"\";\n const parsed = parseRepo(inputs.repo?.value ?? \"\");\n if (!parsed) return \"\";\n const tags = String(inputs.tags?.value ?? \"\").split(\",\").map((tag) => tag.trim()).filter(Boolean);\n const platforms = selectedPlatforms();\n const bestFor = String(inputs.bestFor?.value ?? \"\").split(\"\\n\").map((item) => item.trim()).filter(Boolean);\n return [\n \"kind: project\",\n `slug: ${slugify(inputs.slug?.value ?? repository.name)}`,\n // The day the record joins the directory. Without it the\n // `recently-added` sort has nothing to sort a new record on and\n // drops it to the bottom of the list built to show it off.\n `addedAt: ${new Date().toISOString().slice(0, 10)}`,\n `name: ${quote(inputs.name?.value ?? \"\")}`,\n `description: ${quote(inputs.description?.value ?? \"\")}`,\n ...(fields.category ? [`category: ${inputs.category?.value || \"uncategorized\"}`] : []),\n \"projectType: real-app\",\n ...(fields.stack && inputs.stack?.value ? [`stack: ${quote(inputs.stack.value)}`] : []),\n ...(fields.platforms ? [\"platforms:\", platforms.length ? lines(platforms) : \" []\"] : []),\n ...(fields.tags ? [\"tags:\", tags.length ? lines(tags) : \" []\"] : []),\n ...(fields.license && inputs.license?.value ? [\"licenses:\", lines([inputs.license.value])] : []),\n `repoUrl: ${repository.html_url}`,\n \"links:\",\n ` github: ${repository.html_url}`,\n ...(inputs.website?.value ? [` website: ${inputs.website.value}`] : []),\n \"bestFor:\", bestFor.length ? lines(bestFor) : \" []\",\n \"source:\",\n \" type: manual\",\n ` owner: ${parsed.owner}`,\n ` repo: ${parsed.repo}`,\n \"curation:\",\n \" reviewed: false\",\n \" labels: []\",\n \" lenses: []\",\n \"\",\n ].join(\"\\n\");\n };\n // NOTE: this taxonomy/slug membership logic duplicates a concern\n // that belongs in `@grove-dev/core` (domain/taxonomy rules, not\n // UI), but it can't be moved into an import here. This `<script>`\n // uses `define:vars` (see the tag above), which Astro's compiler\n // implicitly treats as `is:inline` — the script is emitted\n // verbatim into the page and is NOT run through Vite's bundler,\n // so a bare-specifier `import ... from \"@grove-dev/core\"` would\n // not resolve in the browser (no bundler rewrite, no import map).\n // `define:vars` itself only hands the script JSON-serializable\n // data (see `taxonomy`, `existingSlugs`, etc. above) — a function\n // reference can't cross that boundary either. Moving this out\n // would require converting the script off `is:inline`/`define:vars`\n // to a regular bundled `<script>` that reads its props from\n // `data-*` attributes or a JSON island, which is a larger\n // structural change than this fix warrants.\n const validationIssues = () => {\n const issues = [];\n if (inputs.slug && slugSet.has(slugify(inputs.slug.value))) {\n issues.push(\"A record with that slug already exists — update the existing one instead of opening a duplicate PR.\");\n }\n const description = String(inputs.description?.value ?? \"\");\n if (description.trim().length < 40) {\n issues.push(\"Description must be at least 40 characters.\");\n }\n if (fields.category && inputs.category) {\n const v = inputs.category.value;\n if (!v || v === \"uncategorized\" || (categoryIds.size > 0 && !categoryIds.has(v))) {\n issues.push(\"Choose a category from the taxonomy.\");\n }\n }\n if (fields.stack && inputs.stack) {\n const v = inputs.stack.value;\n if (!v || (stackIds.size > 0 && !stackIds.has(v))) {\n issues.push(\"Choose a primary stack from the taxonomy.\");\n }\n }\n if (fields.platforms && selectedPlatforms().length === 0) {\n issues.push(\"Select at least one platform.\");\n } else if (fields.platforms && platformIds.size > 0) {\n const bad = selectedPlatforms().find((p) => !platformIds.has(p));\n if (bad) issues.push(`Platform \"${bad}\" is not in the taxonomy.`);\n }\n return issues;\n };\n const refresh = () => {\n const yaml = generateYaml();\n if (preview) preview.textContent = yaml || \"Paste a GitHub URL to generate a draft.\";\n if (!yaml || !openPrLink || !copyButton) return;\n const issues = validationIssues();\n if (issues.length > 0) {\n setStatus(issues[0], \"error\");\n openPrLink.classList.add(\"pointer-events-none\", \"opacity-50\");\n copyButton.disabled = true;\n copyButton.classList.add(\"pointer-events-none\", \"opacity-50\");\n return;\n }\n const params = new URLSearchParams({ filename: `data/records/${slugify(inputs.slug?.value ?? \"\")}.yml`, value: yaml });\n openPrLink.href = `${repoUrl}/new/main?${params}`;\n openPrLink.classList.remove(\"pointer-events-none\", \"opacity-50\");\n copyButton.disabled = false;\n copyButton.classList.remove(\"pointer-events-none\", \"opacity-50\");\n };\n\n fetchButton?.addEventListener(\"click\", async () => {\n const parsed = parseRepo(inputs.repo?.value ?? \"\");\n if (!parsed) return setStatus(\"Enter a valid GitHub repository URL.\", \"error\");\n const fullName = `${parsed.owner}/${parsed.repo}`.toLowerCase();\n if (repoSet.has(fullName)) setStatus(\"This repository is already listed. The draft can update its record.\", \"warn\");\n if (fetchButton) fetchButton.disabled = true;\n setStatus(\"Fetching GitHub metadata...\");\n try {\n if (githubProxyPath) {\n // Server-side proxy (SSR consumers) — the endpoint reads an\n // optional `GITHUB_TOKEN` env var and forwards the request\n // with a Bearer header (or unauthenticated, if no token).\n const proxyUrl = `${githubProxyPath}?owner=${encodeURIComponent(parsed.owner)}&repo=${encodeURIComponent(parsed.repo)}`;\n const response = await fetch(proxyUrl);\n const payload = /** @type {{ ok: boolean; status?: number; message?: string; data?: GitHubRepo }} */ (await response.json());\n if (!response.ok || !payload.ok || !payload.data) {\n throw new Error(payload.message || `GitHub returned ${response.status}.`);\n }\n repository = payload.data;\n } else {\n // Static-build default — call api.github.com directly. The\n // raw payload carries the same field names the form fill\n // logic consumes (name, description, html_url, homepage,\n // language, private, topics).\n const response = await fetch(\n `https://api.github.com/repos/${encodeURIComponent(parsed.owner)}/${encodeURIComponent(parsed.repo)}`,\n { headers: { Accept: \"application/vnd.github+json\" } },\n );\n if (response.status === 404) {\n throw new Error(\"Repository not found or not public.\");\n }\n if (response.status === 403 || response.status === 429) {\n throw new Error(\n \"GitHub rate limit reached (60 requests/hour per visitor). Try again later or fill the fields manually.\",\n );\n }\n if (!response.ok) {\n throw new Error(`GitHub returned ${response.status}.`);\n }\n const data = /** @type {GitHubRepo & { topics?: string[] }} */ (await response.json());\n repository = {\n name: data.name,\n description: data.description ?? null,\n html_url: data.html_url,\n homepage: data.homepage ?? null,\n language: data.language ?? null,\n private: Boolean(data.private),\n topics: Array.isArray(data.topics) ? data.topics : [],\n };\n }\n if (repository.private) throw new Error(\"Private repositories cannot be submitted.\");\n if (inputs.name) inputs.name.value = repository.name || parsed.repo;\n if (inputs.slug) inputs.slug.value = slugify(repository.name || parsed.repo);\n if (inputs.description) inputs.description.value = repository.description || \"\";\n if (inputs.stack) inputs.stack.value = inferStack(repository);\n if (inputs.tags) inputs.tags.value = (repository.topics || []).slice(0, 8).join(\", \");\n if (inputs.website) inputs.website.value = repository.homepage || \"\";\n const duplicate = inputs.slug ? slugSet.has(inputs.slug.value) : false;\n setStatus(\n duplicate ? \"That slug already exists. Choose another or update the existing record.\" : \"Draft generated. Edit any field and the YAML will refresh.\",\n duplicate ? \"warn\" : \"success\",\n );\n refresh();\n } catch (error) {\n repository = null;\n setStatus(error instanceof Error ? error.message : \"Unable to fetch repository metadata.\", \"error\");\n } finally {\n if (fetchButton) fetchButton.disabled = false;\n }\n });\n $(\"#submit-form\")?.addEventListener(\"input\", refresh);\n $(\"#submit-form\")?.addEventListener(\"change\", refresh);\n copyButton?.addEventListener(\"click\", async () => {\n try {\n await navigator.clipboard.writeText(preview?.textContent || \"\");\n setStatus(\"Copied YAML to clipboard.\", \"success\");\n } catch {\n setStatus(\"Couldn't copy automatically. Select the YAML and copy it.\", \"error\");\n }\n });\n </script>\n",
20
+ "type": "registry:component",
21
+ "target": "~/src/components/grove/submission-client.astro"
22
+ }
23
+ ],
24
+ "meta": {
25
+ "version": "1.1.0",
26
+ "requiresGrove": "0.9.0"
27
+ },
28
+ "type": "registry:block"
29
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "taxonomy",
4
+ "title": "Taxonomy pages",
5
+ "description": "Browse-by-category, -stack, and -license: the three index/detail route pairs, the shared list body, and the stack/category grids the home page also renders.",
6
+ "registryDependencies": [
7
+ "@grove/shell",
8
+ "@grove/project-card",
9
+ "@grove/ui"
10
+ ],
11
+ "files": [
12
+ {
13
+ "path": "default/pages/categories/index.astro",
14
+ "content": "---\n/**\n * Categories index — every category with live counts. Linked from the\n * default header nav; each tile opens the browse page pre-filtered to\n * the category (detail pages live at `/categories/<id>/`).\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getTaxonomyIndexModel,\n getTaxonomyIndexSeo,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\n\nimport CategoryGrid from '../../components/grove/category-grid.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst { categories } = getTaxonomyIndexModel();\nconst itemNoun = { singular: itemLabel(), plural: itemLabelPlural() };\nconst seo = getTaxonomyIndexSeo('categories', siteConfig);\n---\n\n<BaseLayout\n title={seo.title}\n description={seo.description}\n image={seo.image}\n jsonLd={seo.jsonLd}\n site={siteConfig}\n>\n <CategoryGrid\n categories={categories}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemLabelPlural()}\n itemNoun={itemNoun}\n level={1}\n hrefFor={(categorySlug: string) => `/categories/${categorySlug}`}\n />\n</BaseLayout>\n",
15
+ "type": "registry:page",
16
+ "target": "~/src/pages/categories/index.astro"
17
+ },
18
+ {
19
+ "path": "default/pages/categories/[name].astro",
20
+ "content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport { getTaxonomyPageModel, itemLabelPlural } from '@grove-dev/astro/server';\nimport TaxonomyList from '../../components/grove/taxonomy-list.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nexport function getStaticPaths() {\n const categories = siteConfig.taxonomy?.categories ?? [];\n // A category no record currently uses gets no page at all — the\n // static host 404s the request instead of publishing a thin,\n // indexable \"0 apps\" page for it.\n return categories\n .filter(({ count }) => (count ?? 0) > 0)\n .map(({ id, name }) => ({\n params: { name: id },\n props: { displayName: name },\n }));\n}\n\nconst { displayName } = Astro.props;\nconst name = Astro.params.name;\nconst model = getTaxonomyPageModel('categories', name, displayName, siteConfig);\n---\n\n<BaseLayout\n title={model.seo.title}\n description={model.seo.description}\n image={model.seo.image}\n imageAlt={model.seo.imageAlt}\n jsonLd={model.seo.jsonLd}\n site={siteConfig}\n>\n <TaxonomyList\n eyebrow=\"Category\"\n displayName={displayName}\n lede={`Browse ${itemLabelPlural()} in this directory in the ${displayName} category.`}\n records={model.records}\n />\n</BaseLayout>\n",
21
+ "type": "registry:page",
22
+ "target": "~/src/pages/categories/[name].astro"
23
+ },
24
+ {
25
+ "path": "default/pages/stacks/index.astro",
26
+ "content": "---\n/**\n * Stacks index — every stack with live counts. Linked from the\n * default header nav; each tile opens the browse page pre-filtered to\n * the stack (detail pages live at `/stacks/<id>/`).\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getTaxonomyIndexModel,\n getTaxonomyIndexSeo,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\nimport StackGrid from '../../components/grove/stack-grid.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\n// Uncapped: the index page lists EVERY stack (the homepage grid's\n// 12-item cap is a homepage layout choice, not a data truth).\nconst { stacks } = getTaxonomyIndexModel();\nconst itemNoun = { singular: itemLabel(), plural: itemLabelPlural() };\nconst seo = getTaxonomyIndexSeo('stacks', siteConfig);\n---\n\n<BaseLayout\n title={seo.title}\n description={seo.description}\n image={seo.image}\n jsonLd={seo.jsonLd}\n site={siteConfig}\n>\n <StackGrid\n stacks={stacks}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemLabelPlural()}\n itemNoun={itemNoun}\n level={1}\n hrefFor={(stackSlug: string) => `/stacks/${stackSlug}`}\n />\n</BaseLayout>\n",
27
+ "type": "registry:page",
28
+ "target": "~/src/pages/stacks/index.astro"
29
+ },
30
+ {
31
+ "path": "default/pages/stacks/[name].astro",
32
+ "content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport { getTaxonomyPageModel, itemLabelPlural } from '@grove-dev/astro/server';\nimport TaxonomyList from '../../components/grove/taxonomy-list.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nexport function getStaticPaths() {\n const stacks = siteConfig.taxonomy?.stacks ?? [];\n // A stack no record currently uses gets no page at all — the\n // static host 404s the request instead of publishing a thin,\n // indexable \"0 apps\" page for it.\n return stacks\n .filter(({ count }) => (count ?? 0) > 0)\n .map(({ id, name }) => ({\n params: { name: id },\n props: { displayName: name },\n }));\n}\n\nconst { displayName } = Astro.props;\nconst name = Astro.params.name;\nconst model = getTaxonomyPageModel('stacks', name, displayName, siteConfig);\n---\n\n<BaseLayout\n title={model.seo.title}\n description={model.seo.description}\n image={model.seo.image}\n imageAlt={model.seo.imageAlt}\n jsonLd={model.seo.jsonLd}\n site={siteConfig}\n>\n <TaxonomyList\n eyebrow=\"Stack\"\n displayName={displayName}\n lede={`Browse ${itemLabelPlural()} in this directory built with ${displayName}.`}\n records={model.records}\n />\n</BaseLayout>\n",
33
+ "type": "registry:page",
34
+ "target": "~/src/pages/stacks/[name].astro"
35
+ },
36
+ {
37
+ "path": "default/pages/licenses/[name].astro",
38
+ "content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport { getTaxonomyPageModel, itemLabelPlural } from '@grove-dev/astro/server';\nimport TaxonomyList from '../../components/grove/taxonomy-list.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nexport function getStaticPaths() {\n const licenses = siteConfig.taxonomy?.licenses ?? [];\n // A license no record currently uses gets no page at all — the\n // static host 404s the request instead of publishing a thin,\n // indexable \"0 apps\" page for it.\n return licenses\n .filter(({ count }) => (count ?? 0) > 0)\n .map(({ id, name }) => ({\n params: { name: id },\n props: { displayName: name },\n }));\n}\n\nconst { displayName } = Astro.props;\nconst name = Astro.params.name;\nconst model = getTaxonomyPageModel('licenses', name, displayName, siteConfig);\n---\n\n<BaseLayout\n title={model.seo.title}\n description={model.seo.description}\n image={model.seo.image}\n imageAlt={model.seo.imageAlt}\n jsonLd={model.seo.jsonLd}\n site={siteConfig}\n>\n <TaxonomyList\n eyebrow=\"License\"\n displayName={displayName}\n lede={`Browse ${itemLabelPlural()} in this directory licensed under ${displayName}.`}\n records={model.records}\n />\n</BaseLayout>\n",
39
+ "type": "registry:page",
40
+ "target": "~/src/pages/licenses/[name].astro"
41
+ },
42
+ {
43
+ "path": "default/components/grove/taxonomy-list.astro",
44
+ "content": "---\nimport {\n buildProjectCardModel,\n indexSlug,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\nimport type { IndexRecord } from '@grove-dev/core';\nimport { formatCount } from '@grove-dev/core';\nimport EmptyState from '../ui/empty-state.astro';\n/**\n * TaxonomyList.astro\n *\n * Shared body for the three taxonomy pages — `stacks/[name].astro`,\n * `categories/[name].astro`, `licenses/[name].astro`. The pages\n * differ only in the heading copy and the filterRecords field;\n * everything below the heading — the count, the card grid, the\n * empty state, the back link — is identical, so it lives here.\n *\n * Records render through the package's canonical `ProjectCard` inside\n * `CardGrid`, so taxonomy pages read as the same site as the browse\n * and collection pages.\n */\nimport CardGrid from './card-grid.astro';\nimport ProjectCard from './project-card.astro';\n\ntype TaxonomyRecord = IndexRecord;\n\ninterface Props {\n /** Eyebrow label above the heading (\"Stack\", \"Category\", \"License\"). */\n eyebrow: string;\n /** Display name shown in the heading and intro copy. */\n displayName: string;\n /** Lede copy under the heading. */\n lede: string;\n /**\n * Noun pair for the heading and count label. Defaults to the\n * blueprint's singular/plural labels so irregular plurals render\n * correctly on every blueprint.\n */\n itemNoun?: { singular: string; plural: string };\n /** Records filtered by `filterRecords` upstream. */\n records: TaxonomyRecord[];\n /**\n * Index route for the back link and card hrefs. Defaults to the\n * configured directory route (`routes.directory` in `grove.config.ts`),\n * so a site that browses at `/apps` links to `/apps`, not `/projects`.\n */\n backHref?: string;\n /** Back-link label. */\n backLabel?: string;\n}\n\nconst {\n eyebrow,\n displayName,\n lede,\n itemNoun = { singular: itemLabel(), plural: itemLabelPlural() },\n records,\n backHref = `/${indexSlug()}`,\n backLabel = `← Back to all ${itemLabelPlural()}`,\n} = Astro.props;\n\nconst count = records.length;\nconst hrefPrefix = backHref.replace(/\\/$/, '');\n---\n\n<section class=\"mx-auto w-full max-w-container px-5 py-12 sm:px-7 sm:py-16\">\n <p class=\"m-0 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">{eyebrow}</p>\n <h1 class=\"m-0 mt-2 text-[1.875rem] font-semibold tracking-tight text-ink-900 sm:text-[2.125rem] dark:text-ink-100\">\n {displayName} {itemNoun.plural}\n </h1>\n <p class=\"m-0 mt-3 max-w-2xl text-[0.9375rem] leading-relaxed text-ink-500 dark:text-ink-400\">{lede}</p>\n\n <div class=\"mt-10\">\n <p class=\"m-0 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n {formatCount(count, itemNoun)}\n </p>\n\n {count === 0 ? (\n <EmptyState class=\"mt-4\" title={`No ${itemNoun.plural} yet in ${displayName}.`} />\n ) : (\n <CardGrid class=\"mt-6\">\n {records.map((record, i) => (\n <li class=\"m-0 p-0\">\n <ProjectCard\n model={buildProjectCardModel(record)}\n href={`${hrefPrefix}/${record.slug}`}\n eager={i < 3}\n />\n </li>\n ))}\n </CardGrid>\n )}\n </div>\n\n <p class=\"mt-12 text-2xs text-ink-500 dark:text-ink-400\">\n <a href={backHref} class=\"text-inherit no-underline hover:underline\">\n {backLabel}\n </a>\n </p>\n</section>\n",
45
+ "type": "registry:component",
46
+ "target": "~/src/components/grove/taxonomy-list.astro"
47
+ },
48
+ {
49
+ "path": "default/components/grove/stack-grid.astro",
50
+ "content": "---\nimport { formatCount } from '@grove-dev/core';\nimport Icon from './icon.astro';\n\n/**\n * StackGrid — browse-by-stack grid for the home page.\n *\n * Renders a card per stack with name, blurb, status pill\n * (live/expanding/planned), and a count. The href is the list\n * page filtered to that stack, so consumers compose the URL via\n * the `hrefFor` prop.\n *\n * Generic: no blueprint-specific terms. A \"stack\" here is just a\n * slug + display name + status; consumers derive both from their\n * own data.\n */\n\ninterface StackEntry {\n name: string;\n slug: string;\n blurb?: string;\n status?: 'live' | 'expanding' | 'planned';\n count?: number;\n}\n\ninterface Props {\n stacks: StackEntry[];\n /** List page base. */\n pathPrefix?: string;\n /** Stack icon registry — maps slug → icon file name. Optional. */\n iconAliases?: Record<string, string>;\n /** Extra class. */\n class?: string;\n /** Hide the section eyebrow / header entirely. */\n bare?: boolean;\n itemLabelPlural?: string;\n /** Noun pair for count chips — singular fixes \"1 projects\". */\n itemNoun?: { singular: string; plural: string };\n /** Pass 1 when this grid IS the page (`/stacks` index). */\n level?: 1 | 2;\n /**\n * Card link builder. Defaults to the browse page filtered by stack\n * (`{pathPrefix}?stack=…`); pass e.g. `(slug) => \\`/stacks/${slug}\\``\n * to link to taxonomy detail routes instead.\n */\n hrefFor?: (slug: string) => string;\n}\n\nconst {\n stacks,\n pathPrefix = '/',\n iconAliases,\n class: className = '',\n bare = false,\n itemLabelPlural = 'items',\n itemNoun = { singular: 'item', plural: 'items' },\n level = 2,\n hrefFor,\n} = Astro.props;\n\nconst Heading = `h${level}` as 'h1' | 'h2';\n\nfunction buildHref(slug: string): string {\n if (hrefFor) return hrefFor(slug);\n const base = pathPrefix.replace(/\\/$/, '');\n return `${base}?stack=${encodeURIComponent(slug)}`;\n}\n\nfunction statusLabel(s: StackEntry['status']): string | null {\n switch (s) {\n case 'live':\n return 'Available now';\n case 'expanding':\n return 'Expanding';\n case 'planned':\n return 'Planned';\n default:\n return null;\n }\n}\n---\n\n<section\n id=\"stacks\"\n class:list={[\"py-12 sm:py-16 scroll-mt-20 border-b border-ink-200 dark:border-ink-800\", className]}\n aria-labelledby={bare ? undefined : \"grove-stackgrid-heading\"}\n>\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n {!bare && (\n <header class=\"mb-6\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n Stacks\n </span>\n <Heading\n id=\"grove-stackgrid-heading\"\n class=\"m-0 mt-1 text-[1.5rem] sm:text-[1.625rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\"\n >\n Browse by stack\n </Heading>\n <p class=\"m-0 max-w-[60ch] text-[0.9375rem] text-ink-500 dark:text-ink-400\">\n Pick a stack to see real {itemLabelPlural} built with it.\n </p>\n </header>\n )}\n\n <div class=\"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3\">\n {stacks.map((s) => (\n <a\n href={buildHref(s.slug)}\n class=\"rounded-[calc(var(--radius)+0.25rem)] border border-border bg-card shadow-none transition-colors hover:border-ink-300 dark:hover:border-ink-700 group flex h-full items-center gap-3 p-3.5 no-underline\"\n data-event=\"stack_grid_click\"\n data-event-source=\"stack_grid\"\n >\n <div class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-ink-200 bg-white dark:border-ink-800 dark:bg-ink-950\" aria-hidden=\"true\">\n <Icon name={iconAliases?.[s.slug] ?? s.slug} category=\"stack\" size={18} />\n </div>\n\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <div class=\"flex items-center gap-2\">\n {/* Not a heading: these tiles are links in a grid, and\n heading-per-card breaks the outline when the grid\n sits directly under the page h1 (/stacks). */}\n <span class=\"m-0 text-[0.875rem] font-semibold tracking-tight text-ink-900 group-hover:underline dark:text-ink-100\">\n {s.name}\n </span>\n {typeof s.count === \"number\" && (\n <span class=\"inline-flex items-center rounded-md border border-ink-200 bg-ink-50 px-1.5 py-0.5 font-mono text-[10px] font-medium text-ink-600 dark:border-ink-800 dark:bg-ink-900/60 dark:text-ink-400\">\n {formatCount(s.count, itemNoun)}\n </span>\n )}\n </div>\n {s.blurb && <p class=\"m-0 truncate text-2xs text-ink-500 dark:text-ink-400\">{s.blurb}</p>}\n </div>\n {statusLabel(s.status) && (\n <span\n class:list={[\n \"shrink-0 inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider\",\n s.status === \"live\"\n ? \"!bg-success/10 !text-success\"\n : s.status === \"expanding\"\n ? \"!bg-info/10 !text-info\"\n : \"!bg-warning/10 !text-warning\",\n ]}\n >\n {statusLabel(s.status)}\n </span>\n )}\n </a>\n ))}\n </div>\n </div>\n</section>\n",
51
+ "type": "registry:component",
52
+ "target": "~/src/components/grove/stack-grid.astro"
53
+ },
54
+ {
55
+ "path": "default/components/grove/category-grid.astro",
56
+ "content": "---\nimport { formatCount } from '@grove-dev/core';\n\n/**\n * CategoryGrid — browse-by-category grid for the home page.\n *\n * The lighter sibling of StackGrid. Renders a card per category with\n * name, blurb, and count. Generic: takes a list of plain\n * `{ name, slug, blurb, count }` entries.\n */\n\ninterface CategoryEntry {\n name: string;\n slug: string;\n blurb?: string;\n count?: number;\n}\n\ninterface Props {\n categories: CategoryEntry[];\n /** List page base. */\n pathPrefix?: string;\n /** Extra class. */\n class?: string;\n /** Hide the section header. */\n bare?: boolean;\n itemLabelPlural?: string;\n /** Noun pair for count chips — singular fixes \"1 projects\". */\n itemNoun?: { singular: string; plural: string };\n /** Pass 1 when this grid IS the page (`/categories` index). */\n level?: 1 | 2;\n /** Card link builder (defaults to browse filtered by category). */\n hrefFor?: (slug: string) => string;\n}\n\nconst {\n categories,\n pathPrefix = '/',\n class: className = '',\n bare = false,\n itemLabelPlural = 'items',\n itemNoun = { singular: 'item', plural: 'items' },\n level = 2,\n hrefFor,\n} = Astro.props;\n\nconst Heading: 'h1' | 'h2' = level === 1 ? 'h1' : 'h2';\n\nfunction buildHref(slug: string): string {\n if (hrefFor) return hrefFor(slug);\n const base = pathPrefix.replace(/\\/$/, '');\n return `${base}?category=${encodeURIComponent(slug)}`;\n}\n---\n\n<section\n id=\"categories\"\n class:list={[\"py-12 sm:py-16 scroll-mt-20 border-b border-ink-200 dark:border-ink-800\", className]}\n aria-labelledby={bare ? undefined : \"grove-categorygrid-heading\"}\n>\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n {!bare && (\n <header class=\"mb-6\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n Categories\n </span>\n <Heading\n id=\"grove-categorygrid-heading\"\n class=\"m-0 mt-1 text-[1.5rem] sm:text-[1.625rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\"\n >\n Browse by category\n </Heading>\n <p class=\"m-0 max-w-[60ch] text-[0.9375rem] text-ink-500 dark:text-ink-400\">\n Find {itemLabelPlural} by what they do, not by which stack they use.\n </p>\n </header>\n )}\n\n <div class=\"overflow-hidden rounded-lg border border-ink-200 dark:border-ink-800\">\n <ul class=\"m-0 grid list-none grid-cols-1 divide-y divide-ink-200 p-0 sm:grid-cols-2 sm:divide-x sm:divide-y-0 lg:grid-cols-3 dark:divide-ink-800\">\n {categories.map((c) => (\n <li class=\"divide-x divide-ink-200 dark:divide-ink-800\">\n <a\n href={buildHref(c.slug)}\n class=\"group flex h-full items-start gap-3 p-4 no-underline transition-colors hover:bg-ink-50/60 dark:hover:bg-ink-900/40\"\n >\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <div class=\"flex items-center gap-2\">\n {/* Not a heading — see StackGrid: link tiles under a\n page h1 must not introduce h3 skips. */}\n <span class=\"m-0 text-[0.9375rem] font-semibold tracking-tight text-ink-900 group-hover:underline dark:text-ink-100\">\n {c.name}\n </span>\n {typeof c.count === \"number\" && (\n <span class=\"inline-flex items-center rounded-md border border-ink-200 bg-ink-50 px-1.5 py-0.5 font-mono text-[10px] font-medium text-ink-600 dark:border-ink-800 dark:bg-ink-900/60 dark:text-ink-400\">\n {formatCount(c.count, itemNoun)}\n </span>\n )}\n </div>\n {c.blurb && (\n <p class=\"m-0 text-2xs leading-relaxed text-ink-500 dark:text-ink-400\">\n {c.blurb}\n </p>\n )}\n </div>\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\" class=\"mt-1 shrink-0 text-ink-300 transition-colors group-hover:text-ink-500 dark:text-ink-700 dark:group-hover:text-ink-400\" fill=\"currentColor\">\n <path d=\"M6.22 3.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 0 1 0-1.06Z\" />\n </svg>\n </a>\n </li>\n ))}\n </ul>\n </div>\n </div>\n</section>\n",
57
+ "type": "registry:component",
58
+ "target": "~/src/components/grove/category-grid.astro"
59
+ }
60
+ ],
61
+ "meta": {
62
+ "version": "1.1.0",
63
+ "requiresGrove": "0.9.0"
64
+ },
65
+ "type": "registry:block"
66
+ }
package/dist/r/ui.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "ui",
4
+ "title": "UI primitives",
5
+ "description": "Grove's stateless presentation primitives — button, badge, empty-state, filter-drawer, page-header, search-field — plus the classnames builders that keep server-rendered and client-rebuilt controls byte-identical.",
6
+ "files": [
7
+ {
8
+ "path": "default/components/ui/badge.astro",
9
+ "content": "---\n/**\n * Badge — small labeled state indicator.\n *\n * Variant is the MEANING, not the color:\n * - `neutral` — plain metadata (counts, kinds).\n * - `selected` — \"you are here\" (neutral inversion, never green).\n * - `success` / `warning` / `danger` / `info` — actual status. These\n * use the status tokens, so green here means \"healthy/succeeded\",\n * not \"brand\" and not \"selected\".\n */\n\nexport type BadgeVariant = 'neutral' | 'selected' | 'success' | 'warning' | 'danger' | 'info';\n\ninterface Props {\n variant?: BadgeVariant;\n class?: string;\n [key: string]: unknown;\n}\n\nconst VARIANTS: Record<BadgeVariant, string> = {\n neutral: 'border-border bg-secondary text-secondary-foreground',\n selected: 'border-transparent bg-selected text-selected-foreground',\n success: 'border-transparent bg-success text-success-foreground',\n warning: 'border-transparent bg-warning text-warning-foreground',\n danger: 'border-transparent bg-danger text-danger-foreground',\n info: 'border-transparent bg-info text-info-foreground',\n};\n\nconst { variant = 'neutral', class: className = '', ...rest } = Astro.props;\n---\n\n<span\n class={`inline-flex min-h-5 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium leading-none ${VARIANTS[variant]} ${className}`}\n {...rest}\n>\n <slot />\n</span>\n",
10
+ "type": "registry:ui",
11
+ "target": "~/src/components/ui/badge.astro"
12
+ },
13
+ {
14
+ "path": "default/components/ui/button.astro",
15
+ "content": "---\n/**\n * Button — the shared interactive control.\n *\n * Renders an `<a>` when `href` is given, otherwise a `<button>`.\n * Styling comes exclusively from `buttonClass()` (ui/button.ts) so\n * server components, consumer pages, and the client script share one\n * definition. Pass layout-only extras (widths, one-off spacing)\n * through `class`.\n */\nimport {\n type ButtonSize,\n type ButtonVariant,\n buttonClass,\n PAGINATION_DISABLED,\n} from '../../lib/classnames.ts';\n\ninterface Props {\n variant?: ButtonVariant;\n size?: ButtonSize;\n href?: string;\n type?: 'button' | 'submit' | 'reset';\n rel?: string;\n target?: string;\n disabled?: boolean;\n id?: string;\n class?: string;\n [key: string]: unknown;\n}\n\nconst {\n variant = 'secondary',\n size = 'sm',\n href,\n type = 'button',\n disabled,\n class: className = '',\n ...rest\n} = Astro.props;\n\nconst classes = buttonClass(variant, size, className);\n---\n\n{href ? (\n <a\n href={href}\n class:list={[classes, disabled && PAGINATION_DISABLED]}\n aria-disabled={disabled ? \"true\" : undefined}\n tabindex={disabled ? -1 : undefined}\n {...rest}\n ><slot /></a>\n) : (\n <button type={type} class={classes} disabled={disabled} {...rest}><slot /></button>\n)}\n",
16
+ "type": "registry:ui",
17
+ "target": "~/src/components/ui/button.astro"
18
+ },
19
+ {
20
+ "path": "default/components/ui/empty-state.astro",
21
+ "content": "---\n/**\n * EmptyState — a deliberate \"nothing here\" block that cannot be\n * mistaken for normal content. Explains WHY the area is empty and\n * offers a recovery action.\n *\n * Marked with `data-grove-empty-state` so quality gates can assert\n * that empty regions render as empty states, not silent gaps.\n */\nimport { type ButtonVariant, buttonClass } from '../../lib/classnames.ts';\n\ninterface Props {\n title: string;\n /** Why it's empty / what will make it non-empty. */\n description?: string;\n /** Recovery action (rendered as a button-styled link). */\n action?: { label: string; href: string; variant?: ButtonVariant };\n class?: string;\n}\n\nconst { title, description, action, class: className = '' } = Astro.props;\n---\n\n<div\n data-grove-empty-state\n class={`flex flex-col items-center gap-2 rounded-[calc(var(--radius)+0.25rem)] border border-dashed border-border bg-surface-sunken px-6 py-10 text-center ${className}`}\n>\n <p class=\"m-0 text-sm font-medium text-foreground\">{title}</p>\n {description && (\n <p class=\"m-0 max-w-[52ch] text-sm leading-relaxed text-muted-foreground\">{description}</p>\n )}\n <slot />\n {action && (\n <a href={action.href} class={buttonClass(action.variant ?? \"secondary\", \"sm\", \"mt-2\")}>\n {action.label}\n </a>\n )}\n</div>\n",
22
+ "type": "registry:ui",
23
+ "target": "~/src/components/ui/empty-state.astro"
24
+ },
25
+ {
26
+ "path": "default/components/ui/filter-drawer.astro",
27
+ "content": "---\n/**\n * FilterDrawer — mobile filter surface built on native `<dialog>`.\n *\n * `showModal()` gives focus trapping, Escape handling, and the\n * top-layer backdrop for free — no dependency, no hand-rolled trap.\n * On viewports ≥ md the trigger button hides and the slotted filter\n * controls render inline through the same slot used on desktop, so\n * there is exactly one copy of the filter markup.\n *\n * No-JS fallback: the slot content stays in normal flow (the dialog\n * only wraps it once the client script moves it), so filters remain\n * usable without JavaScript.\n */\nimport { buttonClass } from '../../lib/classnames.ts';\n\ninterface Props {\n /** Trigger button label. */\n label?: string;\n /** Count of active filters shown on the trigger. */\n activeCount?: number;\n /** URL that clears every filter — offered inside the sheet. */\n clearHref?: string;\n class?: string;\n}\n\nconst { label = 'Filters', activeCount = 0, clearHref, class: className = '' } = Astro.props;\n---\n\n<div class={`grove-filter-drawer ${className}`} data-grove-filter-drawer>\n <button\n type=\"button\"\n data-drawer-open\n class={buttonClass(\"secondary\", \"md\", \"w-full md:hidden\")}\n aria-haspopup=\"dialog\"\n >\n {label}\n {/* Always in the DOM (hidden at zero) so the client script can\n update it from the live URL state on this prerendered page. */}\n <span\n data-drawer-count\n class:list={[\n \"inline-flex min-w-5 items-center justify-center rounded-full bg-selected px-1.5 py-0.5 font-mono text-2xs leading-none text-selected-foreground\",\n activeCount === 0 && \"hidden\",\n ]}\n >\n {activeCount}\n </span>\n </button>\n\n {/* On mobile the client script moves this content into the dialog;\n on ≥ md it stays inline. Not hidden by CSS — without JS the\n filters must remain visible in flow on every viewport. */}\n <div data-drawer-content class=\"md:contents\">\n <slot />\n </div>\n\n <dialog\n data-drawer-dialog\n class=\"m-0 mt-auto w-full max-w-none rounded-t-[calc(var(--radius)+0.5rem)] border-0 bg-surface-overlay p-0 text-foreground backdrop:bg-black/40 md:hidden\"\n aria-label={label}\n >\n <div class=\"flex items-center justify-between gap-3 border-b border-border px-4 py-3\">\n <p class=\"m-0 text-sm font-semibold\">{label}</p>\n <div class=\"flex items-center gap-2\">\n {clearHref && (\n /* Clearing from inside the sheet is the only way out of a\n stack of filters on mobile — the chips row is behind it. */\n <a\n href={clearHref}\n data-drawer-clear\n class:list={[buttonClass(\"ghost\", \"sm\"), activeCount === 0 && \"hidden\"]}\n >\n Clear all\n </a>\n )}\n <button type=\"button\" data-drawer-close class={buttonClass(\"ghost\", \"sm\")}>\n Done\n </button>\n </div>\n </div>\n <div data-drawer-body class=\"max-h-[70vh] overflow-y-auto p-4\"></div>\n </dialog>\n</div>\n\n<script>\n document.querySelectorAll<HTMLElement>(\"[data-grove-filter-drawer]\").forEach((root) => {\n const dialog = root.querySelector<HTMLDialogElement>(\"[data-drawer-dialog]\");\n const content = root.querySelector<HTMLElement>(\"[data-drawer-content]\");\n const body = root.querySelector<HTMLElement>(\"[data-drawer-body]\");\n const open = root.querySelector<HTMLButtonElement>(\"[data-drawer-open]\");\n const close = root.querySelector<HTMLButtonElement>(\"[data-drawer-close]\");\n if (!dialog || !content || !body || !open) return;\n\n const mobile = window.matchMedia(\"(max-width: 47.999rem)\");\n const place = () => {\n // One copy of the filter markup, moved between the inline slot\n // (desktop) and the dialog body (mobile).\n if (mobile.matches) {\n body.append(...content.children);\n content.classList.add(\"hidden\");\n } else {\n if (dialog.open) dialog.close();\n content.append(...body.children);\n content.classList.remove(\"hidden\");\n }\n };\n place();\n mobile.addEventListener(\"change\", place);\n\n open.addEventListener(\"click\", () => dialog.showModal());\n close?.addEventListener(\"click\", () => dialog.close());\n dialog.addEventListener(\"click\", (event) => {\n // Backdrop click closes: the dialog element itself is the\n // target only when the click lands outside the panel content.\n if (event.target === dialog) dialog.close();\n });\n });\n</script>\n",
28
+ "type": "registry:ui",
29
+ "target": "~/src/components/ui/filter-drawer.astro"
30
+ },
31
+ {
32
+ "path": "default/components/ui/page-header.astro",
33
+ "content": "---\n/**\n * PageHeader — the page's title block. Always renders a semantic\n * heading (h1 by default — every route needs exactly one) with an\n * optional eyebrow and description.\n *\n * For section headings INSIDE a page keep using `SectionHeader`\n * (layouts/), which defaults to h2/h3.\n */\n\ninterface Props {\n eyebrow?: string;\n title: string;\n description?: string;\n /** Escape hatch for embedded use; the default 1 is the point. */\n level?: 1 | 2;\n class?: string;\n}\n\nconst { eyebrow, title, description, level = 1, class: className = '' } = Astro.props;\nconst Heading = `h${level}` as 'h1' | 'h2';\n---\n\n<header class={`flex flex-col gap-1 ${className}`}>\n {eyebrow && (\n <span class=\"text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n {eyebrow}\n </span>\n )}\n <Heading class=\"m-0 text-[1.875rem] font-semibold tracking-tight text-foreground sm:text-[2.125rem]\">\n {title}\n </Heading>\n {description && (\n <p class=\"m-0 mt-1 max-w-[64ch] text-[0.9375rem] leading-relaxed text-muted-foreground\">\n {description}\n </p>\n )}\n <slot />\n</header>\n",
34
+ "type": "registry:ui",
35
+ "target": "~/src/components/ui/page-header.astro"
36
+ },
37
+ {
38
+ "path": "default/components/ui/search-field.astro",
39
+ "content": "---\n/**\n * SearchField — labeled search input with the leading glass icon.\n *\n * The label is visually hidden but always present; placeholder text\n * is display copy, not the accessible name. Pass the derived\n * placeholder from `getDirectoryIndexModel().searchPlaceholder` so it\n * only names ENABLED facets.\n *\n * `shortcut` renders the `/` hint and wires the global key handler.\n * The hint is hidden once the field has focus — it is an invitation,\n * not a persistent label — and on coarse pointers, where there is no\n * key to press.\n */\n\ninterface Props {\n label: string;\n name?: string;\n id?: string;\n value?: string;\n placeholder?: string;\n /** Show the `/` hint and focus this field when `/` is pressed. */\n shortcut?: boolean;\n class?: string;\n}\n\nconst {\n label,\n name = 'q',\n id = 'search-input',\n value = '',\n placeholder,\n shortcut = false,\n class: className = '',\n} = Astro.props;\n---\n\n<label class={`grove-search relative block ${className}`}>\n <span class=\"sr-only\">{label}</span>\n <svg\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n aria-hidden=\"true\"\n class=\"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground\"\n fill=\"currentColor\"\n >\n <path d=\"M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.5 4.5 0 1 0-9 0 4.5 4.5 0 0 0 9 0Z\" />\n </svg>\n <input\n id={id}\n type=\"search\"\n name={name}\n value={value}\n placeholder={placeholder}\n autocomplete=\"off\"\n data-search-input\n class=\"peer h-10 w-full rounded-md border border-input bg-background py-2 pl-9 pr-10 text-sm text-foreground placeholder:text-muted-foreground focus:border-ring focus:outline-none focus:ring-2 focus:ring-ring/20 [&::-webkit-search-cancel-button]:appearance-none\"\n />\n {shortcut && (\n <kbd\n data-search-hint\n aria-hidden=\"true\"\n class=\"pointer-events-none absolute right-2 top-1/2 hidden h-6 w-6 -translate-y-1/2 select-none items-center justify-center rounded-md border border-border bg-secondary font-mono text-[11px] leading-none text-muted-foreground peer-focus:!hidden peer-not-placeholder-shown:hidden sm:inline-flex\"\n >/</kbd\n >\n )}\n <button\n type=\"button\"\n data-search-clear\n hidden={!value}\n aria-label=\"Clear search\"\n class=\"absolute right-2 top-1/2 inline-flex h-6 w-6 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full border-0 bg-transparent p-0 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/35\"\n >\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\" fill=\"currentColor\">\n <path\n d=\"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.75.75 0 1 1 1.06 1.06L9.06 8l3.22 3.22a.75.75 0 1 1-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 0 1-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z\"\n />\n </svg>\n </button>\n</label>\n\n{shortcut && (\n <script>\n // `/` focuses the directory search from anywhere on the page, but\n // never while the visitor is already typing somewhere — otherwise\n // the shortcut eats a literal slash out of another field.\n document.addEventListener(\"keydown\", (event) => {\n if (event.key !== \"/\" || event.metaKey || event.ctrlKey || event.altKey) return;\n const active = document.activeElement as HTMLElement | null;\n if (\n active &&\n (active.tagName === \"INPUT\" ||\n active.tagName === \"TEXTAREA\" ||\n active.tagName === \"SELECT\" ||\n active.isContentEditable)\n )\n return;\n const input = document.querySelector(\"[data-search-input]\");\n if (!(input instanceof HTMLInputElement)) return;\n event.preventDefault();\n input.focus();\n input.select();\n });\n </script>\n)}\n",
40
+ "type": "registry:ui",
41
+ "target": "~/src/components/ui/search-field.astro"
42
+ },
43
+ {
44
+ "path": "default/lib/classnames.ts",
45
+ "content": "/**\n * Button / chip class builders — the single source for interactive\n * control styling.\n *\n * Plain TS (not an .astro component) on purpose: `DirectoryIndexClient`\n * rebuilds pagination links and active-filter chips in CLIENT-side JS,\n * and those class strings must stay byte-identical with the server\n * render. Both sides import these builders, so they cannot drift.\n *\n * Variant semantics (see styles.css):\n * - `primary` — the brand action (config `theme.primaryColor`).\n * - `secondary` — default chrome buttons.\n * - `outline` / `ghost` — quieter chrome.\n * - `selected` — \"you are here\" state (active filter, current lens,\n * current page). Neutral inversion via the `selected` tokens —\n * deliberately NOT the brand primary, so green never doubles as a\n * selection indicator.\n */\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'selected';\n/** `bare` emits no size classes — pass custom geometry via `extra`. */\nexport type ButtonSize = 'sm' | 'md' | 'lg' | 'bare';\n\nconst BASE =\n 'inline-flex cursor-pointer items-center justify-center gap-1.5 rounded-[var(--radius)] border border-transparent font-medium leading-none no-underline outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35';\n\n/**\n * `md`/`lg` guarantee a ≥44px hit target on small viewports\n * (`max-sm:min-h-11`) while keeping the compact desktop height.\n */\nconst SIZES: Record<ButtonSize, string> = {\n sm: 'h-8 px-3 text-sm',\n md: 'h-9 px-3 text-sm max-sm:min-h-11',\n lg: 'h-11 px-4 text-sm',\n bare: '',\n};\n\nconst VARIANTS: Record<ButtonVariant, string> = {\n primary: 'bg-primary text-primary-foreground hover:bg-primary/90',\n secondary: 'border-border bg-secondary text-foreground hover:bg-accent',\n outline: 'border-border bg-transparent text-foreground hover:bg-accent',\n ghost: 'text-foreground hover:bg-accent',\n selected: 'bg-selected text-selected-foreground hover:bg-selected/90',\n};\n\nexport function buttonClass(\n variant: ButtonVariant = 'secondary',\n size: ButtonSize = 'sm',\n extra = '',\n): string {\n return [BASE, SIZES[size], VARIANTS[variant], extra].filter(Boolean).join(' ');\n}\n\n/**\n * Layout extras for pagination controls — shared by `Pagination.astro`\n * and the client-side pagination rebuild in `DirectoryIndexClient`.\n */\nexport const PAGINATION_EXTRA = 'min-w-9 px-2 py-1.5 text-2xs';\n\n/**\n * The dead end of a pagination row — \"Previous\" on page 1.\n *\n * Dimming to `opacity-40` put it at 3.37:1 against the dark surface,\n * which is a contrast failure, not a disabled state. 60% still reads\n * as unavailable and clears 4.5:1.\n */\nexport const PAGINATION_DISABLED = 'pointer-events-none opacity-60';\n\n/**\n * Facet filter trigger (the \"Stack: Any\" dropdown buttons). Includes\n * the `grove-filter-trigger` hook class because the client script\n * reassigns the whole className when the active state changes — the\n * hook must survive that reassignment.\n */\nexport function filterTriggerClass(active: boolean): string {\n return [\n 'grove-filter-trigger',\n BASE,\n 'h-9 px-3 text-[0.8125rem] max-sm:min-h-11',\n active ? `${VARIANTS.selected} hover:text-selected-foreground` : VARIANTS.secondary,\n ].join(' ');\n}\n\n/**\n * Lens tab (the All / Hot / Mature row). Same geometry as the filter\n * trigger; `data-lens-id` targeting keeps its own hook attribute.\n */\nexport function lensTabClass(active: boolean): string {\n return [\n BASE,\n 'h-9 px-3 text-[0.8125rem] max-sm:min-h-11',\n active ? `${VARIANTS.selected} hover:text-selected-foreground` : VARIANTS.secondary,\n ].join(' ');\n}\n\n/**\n * Active-filter chip (the removable \"Stack: Python ×\" pills). One\n * definition for the server render and the client rebuild.\n */\nexport function chipClass(extra = ''): string {\n return [\n 'inline-flex min-h-5 items-center justify-center gap-1 rounded-full border border-transparent bg-secondary px-2 py-0.5 align-middle text-xs font-medium leading-none text-secondary-foreground transition-colors hover:border-ink-400',\n extra,\n ]\n .filter(Boolean)\n .join(' ');\n}\n",
46
+ "type": "registry:file",
47
+ "target": "~/src/lib/classnames.ts"
48
+ }
49
+ ],
50
+ "meta": {
51
+ "version": "1.1.0",
52
+ "requiresGrove": "0.9.0"
53
+ },
54
+ "type": "registry:ui"
55
+ }