@vite-hub/docs 0.8.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 (69) hide show
  1. package/README.md +1 -1
  2. package/dist/{assistant-shared-JcfjK-qg.js → assistant-shared-BmCHVfEd.js} +0 -1
  3. package/dist/assistant-worker.js +1 -1
  4. package/dist/assistant.js +1 -1
  5. package/dist/{content-Chgcvz1q.js → content-Df5eeqTg.js} +1 -3
  6. package/dist/{draft-BKQg2PLU.js → draft-CYScbH80.js} +0 -1
  7. package/dist/{manifest-E4mohC7O.js → manifest-BgBIScEV.js} +0 -16
  8. package/dist/{markdown-BzZkYb24.js → markdown-DgQg53dB.js} +0 -28
  9. package/dist/navigation.js +0 -2
  10. package/dist/nuxt.d.ts +1 -1
  11. package/dist/nuxt.js +4 -43
  12. package/dist/primitive-rail.js +0 -4
  13. package/dist/runtime/app/assistant/DocsAssistant.vue +0 -3
  14. package/dist/runtime/app/assistant/DocsAssistantOff.vue +0 -2
  15. package/dist/runtime/app/assistant/DocsAssistantPanel.vue +0 -12
  16. package/dist/runtime/app/components/DocsAppShell.vue +0 -7
  17. package/dist/runtime/app/components/DocsArticle.vue +0 -8
  18. package/dist/runtime/app/components/DocsAsideFooter.vue +0 -5
  19. package/dist/runtime/app/components/DocsAsideLeftBody.vue +0 -18
  20. package/dist/runtime/app/components/DocsBrandMark.vue +0 -6
  21. package/dist/runtime/app/components/DocsCodePanel.vue +0 -19
  22. package/dist/runtime/app/components/DocsMarkdown.vue +0 -9
  23. package/dist/runtime/app/components/DocsPage.vue +0 -10
  24. package/dist/runtime/app/components/DocsPageCredits.vue +0 -1
  25. package/dist/runtime/app/components/DocsSidebars.vue +0 -8
  26. package/dist/runtime/app/components/OgImage/DocsPage.takumi.vue +0 -2
  27. package/dist/runtime/app/components/content/AgentOnly.vue +0 -1
  28. package/dist/runtime/app/components/content/CodeTree.vue +0 -6
  29. package/dist/runtime/app/components/content/ComarkHtml.vue +0 -9
  30. package/dist/runtime/app/components/content/Correct.vue +0 -1
  31. package/dist/runtime/app/components/content/Example.vue +0 -11
  32. package/dist/runtime/app/components/content/Examples.vue +0 -4
  33. package/dist/runtime/app/components/content/Incorrect.vue +0 -1
  34. package/dist/runtime/app/components/content/McpClient.vue +0 -5
  35. package/dist/runtime/app/components/content/McpInstall.vue +0 -4
  36. package/dist/runtime/app/components/content/PageList.vue +0 -11
  37. package/dist/runtime/app/components/content/ProductFeatureItem.vue +0 -3
  38. package/dist/runtime/app/components/content/ProductFeatures.vue +0 -3
  39. package/dist/runtime/app/composables/docs-assistant-problem.ts +0 -8
  40. package/dist/runtime/app/composables/docs-theme.ts +0 -6
  41. package/dist/runtime/app/composables/headerActions.ts +0 -1
  42. package/dist/runtime/app/composables/icons.ts +0 -1
  43. package/dist/runtime/app/composables/seo.ts +0 -11
  44. package/dist/runtime/app/composables/tutorial.ts +0 -8
  45. package/dist/runtime/app/composables/useDocsAssistant.ts +0 -2
  46. package/dist/runtime/app/error.vue +0 -4
  47. package/dist/runtime/app/layouts/docs.vue +0 -6
  48. package/dist/runtime/app/middleware/docs-layout.ts +0 -9
  49. package/dist/runtime/app/plugins/comark-css.ts +0 -5
  50. package/dist/runtime/app/plugins/icon-stroke.ts +0 -3
  51. package/dist/runtime/app/plugins/theme-color.ts +0 -5
  52. package/dist/runtime/app/utils/docs-theme.ts +0 -9
  53. package/dist/runtime/app/utils/file-tree.ts +0 -4
  54. package/dist/runtime/server/llms.js +1 -1
  55. package/dist/runtime/server/markdown.js +2 -7
  56. package/dist/runtime/server/mcp.js +1 -1
  57. package/dist/runtime/server/page.js +2 -2
  58. package/dist/runtime/server/raw.js +1 -1
  59. package/dist/runtime/server/search.js +2 -3
  60. package/dist/runtime/server/sitemap.js +1 -1
  61. package/dist/runtime/theme/design.css +1 -1
  62. package/dist/runtime/theme/vitehub.css +386 -0
  63. package/dist/server.js +2 -2
  64. package/dist/snapshot-worker.mjs +0 -5
  65. package/dist/{theme-Bju84I9x.js → theme-DowEsyAx.js} +289 -6
  66. package/dist/{theme-CgJRnVdT.d.ts → theme-aPbJMLsc.d.ts} +0 -6
  67. package/dist/theme.d.ts +1 -1
  68. package/dist/theme.js +1 -1
  69. package/package.json +12 -12
@@ -4,12 +4,10 @@ import { useState } from "#imports"
4
4
 
5
5
  import { useDocsConfig } from "./docs"
6
6
 
7
- /** The docs assistant panel state. Any component can open it, for example an "Ask" link in the page header. */
8
7
  export function useDocsAssistant() {
9
8
  const config = useDocsConfig()
10
9
  const open = useState("docs-assistant-open", () => false)
11
10
  return {
12
- /** The Agent name, or `undefined` when `docs.assistant` is off. */
13
11
  agent: computed(() => config.assistant ? config.assistant.agent : undefined),
14
12
  open,
15
13
  toggle: (value = !open.value) => { open.value = value },
@@ -9,8 +9,6 @@ const props = defineProps<{
9
9
 
10
10
  const config = useDocsConfig()
11
11
  const manifest = useDocsManifest()
12
- // Nuxt 5 names the code `status`. An error that the server rendered reaches the client as a plain object, which has no
13
- // `statusCode` getter.
14
12
  const status = computed(() => props.error.status ?? props.error.statusCode)
15
13
  const isNotFound = computed(() => status.value === 404)
16
14
  const title = computed(() => isNotFound.value ? "Page not found" : "This page failed to load")
@@ -19,7 +17,6 @@ const description = computed(() => isNotFound.value
19
17
  : "Reload the page to try again. If it still fails, search the docs or open one of these sections.")
20
18
 
21
19
  const start = manifest.sections.find(section => section.id === config.start?.section)
22
- // Each link opens a real page. Without `content/docs/index.md` the docs base itself is a 404, so "Docs" opens the first section.
23
20
  const docsHome = docsHomePath(manifest, config.start)
24
21
  const sections = [
25
22
  ...docsHome ? [{ label: "Docs", to: docsHome }] : [],
@@ -27,7 +24,6 @@ const sections = [
27
24
  ...(config.start?.links ?? []).filter(link => link.to !== config.base),
28
25
  ].filter((link, index, links) => links.findIndex(other => other.to === link.to) === index)
29
26
 
30
- // The error page replaces the app shell, so it mounts the search dialog that the header button and Ctrl K open.
31
27
  const { open: openSearch } = useContentSearch()
32
28
 
33
29
  useSeoMeta({
@@ -3,17 +3,11 @@ import { isDocsWorkspaceLayout } from "#docs/navigation"
3
3
 
4
4
  const { banner } = useDocsConfig()
5
5
  const found = useDocsPage()
6
- // A tutorial with a code panel uses the whole page column, half for prose and half for files.
7
6
  const hasCodePanel = computed(() => found.value?.page.codePanel === true)
8
- // Pages show the sidebar unless they set `sidebar: false`. A page with `sidebar: "collapsed"`, and a code panel tutorial,
9
- // shows a narrow strip until the reader opens the sidebar.
10
7
  const sidebar = useDocsSidebar()
11
- // A `playground` or `learn` page, and an app page that sets `sidebar: "collapsed"` in its page meta, fill the viewport
12
- // under the header. Markdown pages with a collapsed sidebar, and code panel tutorials, keep the window scroll.
13
8
  const route = useRoute()
14
9
  const fills = computed(() => isDocsWorkspaceLayout(found.value?.page.layout) || (sidebar.value.collapsible && route.meta.sidebar === "collapsed"))
15
10
 
16
- // The sidebar sits on the left edge of the viewport on every docs page. The page content centers in the remaining space.
17
11
  const docsShellUi = {
18
12
  root: "lg:!flex lg:!flex-row lg:!items-start lg:!gap-0",
19
13
  left: "lg:!w-(--vh-sidebar-width) lg:shrink-0",
@@ -4,20 +4,11 @@ import panels from "#docs/panels"
4
4
  import { docsAppPath, docsSectionForPath, findDocsPage, isDocsWorkspaceLayout, loadDocsPanels } from "#docs/navigation"
5
5
  import { articleLayout } from "#docs/shell"
6
6
 
7
- // A docs page renders in the docs shell whichever app page serves its path. A page outside the docs base, such as
8
- // `/about`, is a plain article under the site header, and a `home` page is its own blocks under it. A page that
9
- // `start.links` lists opens inside the start section, so it gets the shell too. With an app-owned `app.vue`, plain
10
- // articles use `docs-article`, so the app keeps its `default` layout.
11
7
  export default defineNuxtRouteMiddleware(async (to, from) => {
12
- // The pages inside a panel load when the reader opens it, before anything reads the manifest for this route.
13
8
  await loadDocsPanels(manifest, to.path, panels)
14
9
  const found = findDocsPage(manifest, to.path)
15
10
  if (found) to.meta.layout = isDocsWorkspaceLayout(found.page.layout) || (found.page.layout !== "home" && (found.section || found.page.path === manifest.root?.path || isDocsStartLink(useDocsConfig(), to.path))) ? "docs" : articleLayout
16
- // A new page that exists only as a Content draft renders in the shell of its section.
17
11
  else if (docsSectionForPath(manifest, to.path)) to.meta.layout = "docs"
18
- // No docs page and no app page answers the path, but the host may: a static app copied into the output, such as a
19
- // playground at `/play/`, or a file in `public/`. A client navigation would draw the docs 404 for it, so the browser
20
- // loads it. The first load and a reload come from the server already, so they never reach this.
21
12
  else if (import.meta.client && from.matched.length > 0 && to.name === "docs-page" && to.path !== from.path)
22
13
  return navigateTo(docsAppPath(to.fullPath, useRuntimeConfig().app.baseURL), { external: true })
23
14
  })
@@ -1,11 +1,6 @@
1
1
  import file, { names } from "#docs/comark-css"
2
2
  import { defineNuxtPlugin, useHead, useRuntimeConfig } from "#imports"
3
3
 
4
- // The comark-ui stylesheet that every page needs, the error page too. It is a public asset, so its URL follows Nuxt's
5
- // rule for those: below `app.cdnURL` when set, else below `app.baseURL`. Both are read at runtime, since
6
- // `NUXT_APP_BASE_URL` and `NUXT_APP_CDN_URL` can change them after the build.
7
- // The link goes after the app's CSS, where the components add their styles, since some of their unlayered rules tie
8
- // with the app's and must still win. Its `data-comark-<name>` attributes tell each component its styles are on the page.
9
4
  export default defineNuxtPlugin(() => {
10
5
  const { baseURL, cdnURL } = useRuntimeConfig().app
11
6
  const base = (cdnURL || baseURL).replace(/\/*$/, "/")
@@ -1,9 +1,6 @@
1
1
  import { docsIconStroke } from "#docs/navigation"
2
2
  import { defineNuxtPlugin, useAppConfig, useDocsConfig } from "#imports"
3
3
 
4
- // Lucide draws its lines 2px wide. The docs draw them at `docs.icons.stroke`, 1.5px by default, the stroke of the
5
- // ViteHub set, so a section icon and the page icons under it look like one set. A site that sets `icon.customize` in
6
- // its app config keeps its own.
7
4
  export default defineNuxtPlugin(() => {
8
5
  const icon = useAppConfig().icon
9
6
  const { stroke } = useDocsConfig().icons
@@ -1,10 +1,6 @@
1
1
  import { defineNuxtPlugin, nextTick, ref, useHead, watch } from "#imports"
2
2
  import { ownsApp } from "#docs/shell"
3
3
 
4
- // The browser bar matches the page canvas: the `--ui-bg` of the design system, read from the page, so the theme stays
5
- // the only place that names the color. It follows the mode that the reader picks. A plugin, and not `app.vue`, so the
6
- // error page has it too. An app with its own `app.vue` keeps its browser bar color. Prerendered HTML has no value, and
7
- // browsers use their own bar color until the app starts.
8
4
  export default defineNuxtPlugin((nuxtApp) => {
9
5
  if (!ownsApp || import.meta.server) return
10
6
  const color = ref<string>()
@@ -12,7 +8,6 @@ export default defineNuxtPlugin((nuxtApp) => {
12
8
  color.value = getComputedStyle(document.documentElement).backgroundColor || undefined
13
9
  }
14
10
  nuxtApp.hook("app:mounted", read)
15
- // The color mode module sets the class on `<html>` after the value changes, so read after that render.
16
11
  watch(() => nuxtApp.$colorMode?.value, () => nextTick(() => requestAnimationFrame(read)))
17
12
  useHead({ meta: [{ name: "theme-color", content: color }] })
18
13
  })
@@ -1,19 +1,12 @@
1
- // A Nuxt app maps `defu` to its package folder, where its types are `export =`. Only a default import reads them.
2
1
  import defu from "defu"
3
2
 
4
3
  type DocsThemeUi = Record<string, unknown>
5
4
 
6
- /** What Nuxt UI's `<UTheme>` takes: slot classes per component in `ui`, and default props per component in `props`. */
7
5
  export interface DocsThemeScope {
8
6
  ui: Record<string, unknown>
9
7
  props: Record<string, unknown>
10
8
  }
11
9
 
12
- /**
13
- * The theme as `<UTheme>` props, for the docs pages of an app with its own `app.vue`. The app's `app.config.ts` then
14
- * stays as written on the app's own pages. `<UTheme>` sets slot classes and default props only, so the docs pages keep
15
- * the app's colors, icons, and variant classes, such as the color of a callout.
16
- */
17
10
  export function docsThemeScope(theme: DocsThemeUi): DocsThemeScope {
18
11
  const scope: DocsThemeScope = { ui: {}, props: {} }
19
12
  for (const [name, entry] of Object.entries(theme)) {
@@ -24,7 +17,6 @@ export function docsThemeScope(theme: DocsThemeUi): DocsThemeScope {
24
17
  if (Object.keys(prose.props).length) scope.props.prose = prose.props
25
18
  continue
26
19
  }
27
- // A component with one element has a `base` class instead of slots, and reads it from `ui.base`.
28
20
  const slots = isRecord(entry.slots) ? entry.slots : typeof entry.base === "string" ? { base: entry.base } : null
29
21
  if (slots) scope.ui[name] = slots
30
22
  if (isRecord(entry.defaultVariants)) scope.props[name] = entry.defaultVariants
@@ -32,7 +24,6 @@ export function docsThemeScope(theme: DocsThemeUi): DocsThemeScope {
32
24
  return scope
33
25
  }
34
26
 
35
- /** Resolve the live app config above the docs defaults, without adding a scope to standalone docs sites. */
36
27
  export function resolveDocsTheme(scope: DocsThemeScope, ui: DocsThemeUi = {}): DocsThemeScope {
37
28
  if (!Object.keys(scope.ui).length && !Object.keys(scope.props).length) return scope
38
29
  return defu(docsThemeScope(ui), scope)
@@ -4,10 +4,6 @@ export type FileTreeRow = FileTreeFolderRow | FileTreeFileRow
4
4
 
5
5
  type Folder = { folders: Map<string, Folder>; files: { name: string; path: string; index: number }[] }
6
6
 
7
- /**
8
- * Lays out file paths as an editor file tree: folders first, then files, each sorted by name.
9
- * `index` keeps the position of the path in the input, so callers can map a row back to its file.
10
- */
11
7
  export function buildFileTree(paths: readonly string[]): FileTreeRow[] {
12
8
  const root: Folder = { folders: new Map(), files: [] }
13
9
  paths.forEach((path, index) => {
@@ -1,4 +1,4 @@
1
- import { n as docsContent } from "../../content-Chgcvz1q.js";
1
+ import { n as docsContent } from "../../content-Df5eeqTg.js";
2
2
  import { defineContentLlmsHandler } from "@vite-hub/content";
3
3
  // src/runtime/server/llms.ts
4
4
  /** `/llms.txt`, `/llms-full.txt`, and `/sitemap.md`, from Content. The build prerenders them. */
@@ -3,13 +3,8 @@ import { useRuntimeConfig } from "nitro/runtime-config";
3
3
  import { defineContentMarkdownHandler } from "@vite-hub/content/markdown";
4
4
  import { serverFetch } from "nitro";
5
5
  // src/runtime/server/markdown.ts
6
- /**
7
- * The Markdown copy of each app page that is not a docs page, at its URL plus `.md` and for `Accept: text/markdown`.
8
- * Content converts the HTML that Nitro renders for the same request. nuxt-agent-discovery answers the docs pages first.
9
- * Content loads on the first request that asks for Markdown or gets an HTML page.
10
- */
11
- const markdown = defineContentMarkdownHandler(() => import("../../content-Chgcvz1q.js").then((n) => n.t).then((module) => module.docsMarkdownContent()), { render: (request) => serverFetch(request) });
12
- const rawMarkdown = defineContentMarkdownHandler(() => import("../../content-Chgcvz1q.js").then((n) => n.t).then((module) => module.docsMarkdownContent(true)));
6
+ const markdown = defineContentMarkdownHandler(() => import("../../content-Df5eeqTg.js").then((n) => n.t).then((module) => module.docsMarkdownContent()), { render: (request) => serverFetch(request) });
7
+ const rawMarkdown = defineContentMarkdownHandler(() => import("../../content-Df5eeqTg.js").then((n) => n.t).then((module) => module.docsMarkdownContent(true)));
13
8
  const handler = async (event, next) => {
14
9
  const path = new URL(event.req.url).pathname;
15
10
  const raw = docsAppPath("/raw/", useRuntimeConfig().public.docs.appBase);
@@ -1,4 +1,4 @@
1
- import { n as docsContent } from "../../content-Chgcvz1q.js";
1
+ import { n as docsContent } from "../../content-Df5eeqTg.js";
2
2
  import { defineContentMcpHandler } from "@vite-hub/content";
3
3
  // src/runtime/server/mcp.ts
4
4
  /** The docs MCP server at `/mcp`, with the `list-pages` and `get-page` tools of Content. */
@@ -1,4 +1,4 @@
1
- import { a as parseDocsDocument, r as readDocsPage } from "../../content-Chgcvz1q.js";
1
+ import { a as parseDocsDocument, r as readDocsPage } from "../../content-Df5eeqTg.js";
2
2
  import { findDocsPage } from "../../navigation.js";
3
3
  import { i as docsPageResponse } from "../../page-DWsretqk.js";
4
4
  import manifest from "#docs/manifest";
@@ -9,7 +9,7 @@ import { content } from "#docs/content";
9
9
  const handler = defineHandler(async (event) => {
10
10
  const path = `/${(getRouterParam(event, "_") ?? "").replace(/\.json$/, "")}`;
11
11
  if (content && (content.preview.active() || content.preview.frame())) {
12
- const { docsDraftResponse } = await import("../../draft-BKQg2PLU.js");
12
+ const { docsDraftResponse } = await import("../../draft-CYScbH80.js");
13
13
  const draft = await docsDraftResponse(content, manifest, path, parseDocsDocument);
14
14
  if (draft) {
15
15
  event.res.headers.set("cache-control", "private, no-store");
@@ -1,4 +1,4 @@
1
- import { i as readDocsRawCopy } from "../../content-Chgcvz1q.js";
1
+ import { i as readDocsRawCopy } from "../../content-Df5eeqTg.js";
2
2
  import { HTTPError, defineHandler } from "nitro/h3";
3
3
  // src/runtime/server/raw.ts
4
4
  /**
@@ -1,10 +1,9 @@
1
1
  import { docsIndexedPages, docsManifestPages, docsPanelSearchSections, docsUnindexedSearchSections } from "../../navigation.js";
2
- import { a as docsSearchSections } from "../../markdown-BzZkYb24.js";
3
- import { r as readDocsPage } from "../../content-Chgcvz1q.js";
2
+ import { a as docsSearchSections } from "../../markdown-DgQg53dB.js";
3
+ import { r as readDocsPage } from "../../content-Df5eeqTg.js";
4
4
  import manifest from "#docs/manifest";
5
5
  import { defineHandler } from "nitro/h3";
6
6
  // src/runtime/server/search.ts
7
- /** Every page split by heading, read through the Content of the page route, for the search dialog. The build prerenders it. */
8
7
  async function buildIndex() {
9
8
  const sections = [];
10
9
  for (const page of docsIndexedPages(manifest)) {
@@ -1,5 +1,5 @@
1
1
  import { docsCanonicalUrl } from "../../navigation.js";
2
- import { n as docsContent } from "../../content-Chgcvz1q.js";
2
+ import { n as docsContent } from "../../content-Df5eeqTg.js";
3
3
  import { useRuntimeConfig } from "nitro/runtime-config";
4
4
  import { defineHandler } from "nitro/h3";
5
5
  // ../internal/dist/sitemap.js
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * The docs design, after the comark-ui site: column widths, a faint grain on the page, prose, highlighted code, and the
3
- * search modal. Colors, radii, fonts, and focus come from the ViteHub design system (`@vite-hub/ui/theme.css`), which
3
+ * search modal. Colors, radii, fonts, and focus come from the ViteHub design system (`vitehub.css`), which
4
4
  * the module scopes to `.vh-docs` before this file, so comark-ui's blocks, which read the Nuxt UI variables, follow along.
5
5
  */
6
6
 
@@ -0,0 +1,386 @@
1
+ /*
2
+ * The ViteHub design system for Nuxt UI: the tokens and the global rules of the docs. The module imports it after
3
+ * Tailwind and Nuxt UI and passes `vitehubTheme` (src/vitehub-theme.ts) as the `ui` app config. The Tailwind classes of
4
+ * that app config reach Tailwind through `docs/design.json`, and the focus rules that it shares with the parts come
5
+ * from `@vite-hub/ui/styles.css`.
6
+ *
7
+ * The rules here are unlayered, so they win over the utility classes of Nuxt UI. DESIGN.md in docs/ says when to use
8
+ * which token and component.
9
+ */
10
+
11
+ @theme {
12
+ /* @nuxt/fonts serves Geist on the docs. */
13
+ --font-sans: "Geist Variable", "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
14
+ --font-mono: "Geist Mono Variable", "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
15
+ }
16
+
17
+ /*
18
+ * The shadcn/ui neutral palette. Hierarchy comes from four text tones, not from size: highlighted for names, default
19
+ * for body text, muted for descriptions, and dimmed for meta. Every tone keeps at least 4.5:1 (WCAG AA) on the page and
20
+ * on the neutral surfaces.
21
+ *
22
+ * The colors that shadcn/ui has a name for are set under that name, and the Nuxt UI and ViteHub tokens read them. An app
23
+ * changes one by setting the shadcn/ui name after this file: on `:root` for light, and on `:root.dark` for dark. The
24
+ * steps that shadcn/ui has no name for, such as `--ui-text` and `--ui-bg-muted`, keep their values on the Nuxt UI token.
25
+ * The dark blocks repeat the Nuxt UI tokens, so each token keeps the specificity of its color mode selector.
26
+ */
27
+ :root {
28
+ /* Tokens for the scoped kit family. Nuxt UI keeps its own --ui-* aliases. */
29
+ --primary-foreground: oklch(0.985 0 0);
30
+ --input: oklch(0.87 0 0);
31
+ --destructive: oklch(0.577 0.245 27.325);
32
+ --overlay: oklch(0 0 0 / 25%);
33
+ --popover-foreground: oklch(0.205 0 0);
34
+ --shadow-popover: 0 0 0 1px var(--border), 0 4px 8px -4px rgb(0 0 0 / 4%), 0 16px 24px -8px rgb(0 0 0 / 6%);
35
+ --shadow-dialog: 0 0 0 1px var(--border), 0 8px 16px -4px rgb(0 0 0 / 4%), 0 24px 32px -8px rgb(0 0 0 / 6%);
36
+ color-scheme: light;
37
+ --background: oklch(1 0 0);
38
+ --foreground: oklch(0.205 0 0);
39
+ --muted: oklch(0.97 0 0);
40
+ --muted-foreground: oklch(0.5 0 0);
41
+ --border: oklch(0.922 0 0);
42
+ /* Primary actions are black on light and white on dark, as in the Vercel dashboard. */
43
+ --primary: oklch(0.205 0 0);
44
+ /* Menus, popovers, and tooltips: a translucent surface over the page, with the Geist layered shadow. */
45
+ --popover: rgb(255 255 255 / 92%);
46
+ /*
47
+ * Blue marks focus, and the areas drawn for comments (`--vh-comment-mark` in styles.css), so it stands apart from the
48
+ * black and white buttons. Sky 600 keeps 3:1 on white. An area in the text color would vanish on a white image in a
49
+ * dark page.
50
+ */
51
+ --ring: oklch(0.588 0.158 241.966);
52
+ /*
53
+ * Nuxt UI multiplies this base: rounded-sm is 1x, rounded-md 1.5x, rounded-lg 2x, rounded-xl 3x. At 0.25rem, buttons,
54
+ * inputs, and tabs get 6px, cards and code panels 8px, and menus and dialogs 12px (Geist). It is the base step, as in
55
+ * the tokens of @vite-hub/kit, not the card radius of shadcn/ui.
56
+ */
57
+ --radius: 0.25rem;
58
+ --ui-bg: var(--background);
59
+ --ui-bg-muted: oklch(0.985 0 0);
60
+ --ui-bg-elevated: var(--muted);
61
+ --ui-bg-accented: oklch(0.94 0 0);
62
+ --ui-bg-inverted: var(--foreground);
63
+ --ui-border: var(--border);
64
+ --ui-border-muted: oklch(0.96 0 0);
65
+ --ui-border-accented: oklch(0.87 0 0);
66
+ --ui-border-inverted: var(--foreground);
67
+ --ui-text: oklch(0.371 0 0);
68
+ --ui-text-toned: oklch(0.439 0 0);
69
+ --ui-text-muted: var(--muted-foreground);
70
+ --ui-text-dimmed: oklch(0.52 0 0);
71
+ --ui-text-highlighted: var(--foreground);
72
+ --ui-text-inverted: var(--background);
73
+ --ui-radius: var(--radius);
74
+ --ui-primary: var(--primary);
75
+ --vh-focus: var(--ring);
76
+ /*
77
+ * Status colors as text. Nuxt UI draws text and dots with the same 500 shade, which reaches only 2.1:1 (amber) to
78
+ * 3.8:1 (red) on white. These shades keep 4.5:1 on the page and on a 10% tint of the same color.
79
+ */
80
+ --vh-text-error: var(--ui-color-error-700);
81
+ --vh-text-info: var(--ui-color-info-700);
82
+ --vh-text-success: var(--ui-color-success-700);
83
+ --vh-text-warning: var(--ui-color-warning-800);
84
+ --ui-error: var(--ui-color-error-600, var(--destructive));
85
+ --vh-floating: var(--popover);
86
+ --vh-shadow-floating: 0 0 0 1px var(--ui-border), 0 4px 8px -4px rgb(0 0 0 / 4%), 0 16px 24px -8px rgb(0 0 0 / 6%);
87
+ --vh-shadow-dialog: 0 0 0 1px var(--ui-border), 0 8px 16px -4px rgb(0 0 0 / 4%), 0 24px 32px -8px rgb(0 0 0 / 6%);
88
+ --vh-scrollbar: oklch(0.87 0 0);
89
+ --vh-scrollbar-hover: oklch(0.708 0 0);
90
+ /* Marks over an image or a video, such as a focal point or a play button, stay white on a dark scrim in both modes. */
91
+ /* Selected text: a neutral tint, because blue marks focus only. */
92
+ --vh-selection: color-mix(in oklab, var(--ui-text-highlighted) 14%, transparent);
93
+ --vh-on-media: oklch(1 0 0);
94
+ --vh-media-scrim: rgb(0 0 0 / 50%);
95
+ }
96
+
97
+ /* Dark is its own palette, not an inversion: the page is near black, and surfaces are white at low alpha. */
98
+ :root.dark {
99
+ /* Tokens for the scoped kit family. Nuxt UI keeps its own --ui-* aliases. */
100
+ --primary-foreground: oklch(0.205 0 0);
101
+ --input: oklch(1 0 0 / 16%);
102
+ --destructive: oklch(0.704 0.191 22.216);
103
+ --overlay: oklch(0 0 0 / 60%);
104
+ --popover-foreground: oklch(0.985 0 0);
105
+ --shadow-popover: 0 0 0 1px var(--border), 0 4px 8px -4px rgb(0 0 0 / 24%), 0 16px 24px -8px rgb(0 0 0 / 32%);
106
+ --shadow-dialog: 0 0 0 1px var(--border), 0 8px 16px -4px rgb(0 0 0 / 24%), 0 24px 32px -8px rgb(0 0 0 / 32%);
107
+ color-scheme: dark;
108
+ --background: oklch(0.145 0 0);
109
+ --foreground: oklch(0.985 0 0);
110
+ --muted: rgb(255 255 255 / 5%);
111
+ --muted-foreground: oklch(0.708 0 0);
112
+ --border: rgb(255 255 255 / 10%);
113
+ --primary: oklch(0.985 0 0);
114
+ /* Dark floating surfaces sit one step above the page instead of matching it. */
115
+ --popover: rgb(23 23 23 / 92%);
116
+ /* Sky 400 keeps 3:1 on the dark page. */
117
+ --ring: oklch(0.746 0.16 232.661);
118
+ --ui-bg: var(--background);
119
+ --ui-bg-muted: oklch(0.178 0 0);
120
+ --ui-bg-elevated: var(--muted);
121
+ --ui-bg-accented: rgb(255 255 255 / 8%);
122
+ --ui-bg-inverted: var(--foreground);
123
+ --ui-border: var(--border);
124
+ --ui-border-muted: rgb(255 255 255 / 5%);
125
+ --ui-border-accented: rgb(255 255 255 / 16%);
126
+ --ui-border-inverted: var(--foreground);
127
+ --ui-text: oklch(0.87 0 0);
128
+ --ui-text-toned: oklch(0.8 0 0);
129
+ --ui-text-muted: var(--muted-foreground);
130
+ --ui-text-dimmed: oklch(0.62 0 0);
131
+ --ui-text-highlighted: var(--foreground);
132
+ --ui-text-inverted: var(--background);
133
+ --ui-primary: var(--primary);
134
+ --vh-focus: var(--ring);
135
+ --ui-error: var(--ui-color-error-400, var(--destructive));
136
+ --vh-text-error: var(--ui-color-error-400);
137
+ --vh-text-info: var(--ui-color-info-400);
138
+ --vh-text-success: var(--ui-color-success-400);
139
+ --vh-text-warning: var(--ui-color-warning-400);
140
+ --vh-floating: var(--popover);
141
+ --vh-shadow-floating: 0 0 0 1px var(--ui-border), 0 4px 8px -4px rgb(0 0 0 / 24%), 0 16px 24px -8px rgb(0 0 0 / 32%);
142
+ --vh-shadow-dialog: 0 0 0 1px var(--ui-border), 0 8px 16px -4px rgb(0 0 0 / 24%), 0 24px 32px -8px rgb(0 0 0 / 32%);
143
+ --vh-scrollbar: rgb(255 255 255 / 12%);
144
+ --vh-scrollbar-hover: rgb(255 255 255 / 22%);
145
+ }
146
+
147
+ /* Before the app sets a color mode class, the page follows the system. */
148
+ @media (prefers-color-scheme: dark) {
149
+ :root:not(.light):not(.dark) {
150
+ /* Tokens for the scoped kit family. Nuxt UI keeps its own --ui-* aliases. */
151
+ --primary-foreground: oklch(0.205 0 0);
152
+ --input: oklch(1 0 0 / 16%);
153
+ --destructive: oklch(0.704 0.191 22.216);
154
+ --overlay: oklch(0 0 0 / 60%);
155
+ --popover-foreground: oklch(0.985 0 0);
156
+ --shadow-popover: 0 0 0 1px var(--border), 0 4px 8px -4px rgb(0 0 0 / 24%), 0 16px 24px -8px rgb(0 0 0 / 32%);
157
+ --shadow-dialog: 0 0 0 1px var(--border), 0 8px 16px -4px rgb(0 0 0 / 24%), 0 24px 32px -8px rgb(0 0 0 / 32%);
158
+ color-scheme: dark;
159
+ --background: oklch(0.145 0 0);
160
+ --foreground: oklch(0.985 0 0);
161
+ --muted: rgb(255 255 255 / 5%);
162
+ --muted-foreground: oklch(0.708 0 0);
163
+ --border: rgb(255 255 255 / 10%);
164
+ --primary: oklch(0.985 0 0);
165
+ /* Dark floating surfaces sit one step above the page instead of matching it. */
166
+ --popover: rgb(23 23 23 / 92%);
167
+ /* Sky 400 keeps 3:1 on the dark page. */
168
+ --ring: oklch(0.746 0.16 232.661);
169
+ --ui-bg: var(--background);
170
+ --ui-bg-muted: oklch(0.178 0 0);
171
+ --ui-bg-elevated: var(--muted);
172
+ --ui-bg-accented: rgb(255 255 255 / 8%);
173
+ --ui-bg-inverted: var(--foreground);
174
+ --ui-border: var(--border);
175
+ --ui-border-muted: rgb(255 255 255 / 5%);
176
+ --ui-border-accented: rgb(255 255 255 / 16%);
177
+ --ui-border-inverted: var(--foreground);
178
+ --ui-text: oklch(0.87 0 0);
179
+ --ui-text-toned: oklch(0.8 0 0);
180
+ --ui-text-muted: var(--muted-foreground);
181
+ --ui-text-dimmed: oklch(0.62 0 0);
182
+ --ui-text-highlighted: var(--foreground);
183
+ --ui-text-inverted: var(--background);
184
+ --ui-primary: var(--primary);
185
+ --vh-focus: var(--ring);
186
+ --ui-error: var(--ui-color-error-400, var(--destructive));
187
+ --vh-text-error: var(--ui-color-error-400);
188
+ --vh-text-info: var(--ui-color-info-400);
189
+ --vh-text-success: var(--ui-color-success-400);
190
+ --vh-text-warning: var(--ui-color-warning-400);
191
+ --vh-floating: var(--popover);
192
+ --vh-shadow-floating: 0 0 0 1px var(--ui-border), 0 4px 8px -4px rgb(0 0 0 / 24%), 0 16px 24px -8px rgb(0 0 0 / 32%);
193
+ --vh-shadow-dialog: 0 0 0 1px var(--ui-border), 0 8px 16px -4px rgb(0 0 0 / 24%), 0 24px 32px -8px rgb(0 0 0 / 32%);
194
+ --vh-scrollbar: rgb(255 255 255 / 12%);
195
+ --vh-scrollbar-hover: rgb(255 255 255 / 22%);
196
+ }
197
+ }
198
+
199
+ html {
200
+ background: var(--ui-bg);
201
+ color: var(--ui-text);
202
+ font-family: var(--font-sans);
203
+ -webkit-font-smoothing: antialiased;
204
+ -moz-osx-font-smoothing: grayscale;
205
+ }
206
+
207
+ /* Status text uses the darker shades above. Dots, bars, and fills keep the brighter Nuxt UI shade. */
208
+ .text-error {
209
+ color: var(--vh-text-error);
210
+ }
211
+
212
+ .text-info {
213
+ color: var(--vh-text-info);
214
+ }
215
+
216
+ .text-success {
217
+ color: var(--vh-text-success);
218
+ }
219
+
220
+ .text-warning {
221
+ color: var(--vh-text-warning);
222
+ }
223
+
224
+ ::selection {
225
+ background: var(--vh-selection);
226
+ }
227
+
228
+ button,
229
+ a {
230
+ -webkit-tap-highlight-color: transparent;
231
+ }
232
+
233
+ /*
234
+ * Focus. One rule draws the ring of every control, so no component sets its own. Nuxt UI 4 draws a 3px outline at 25%
235
+ * alpha and also darkens the border of a framed control, which reads as two rings. Here, the element that has focus gets
236
+ * one 2px blue ring.
237
+ *
238
+ * Every element keeps the focus color as its outline color, also without focus. Then `transition-colors` has no color
239
+ * change to animate, and the ring appears at once. The rule sits in the `base` layer, so an outline that a component
240
+ * draws on purpose, such as a 1px image outline, keeps its own color.
241
+ */
242
+ @layer base {
243
+ *,
244
+ ::before,
245
+ ::after {
246
+ outline-color: var(--vh-focus);
247
+ }
248
+ }
249
+
250
+ :focus-visible {
251
+ outline: 2px solid var(--vh-focus);
252
+ outline-offset: 2px;
253
+ }
254
+
255
+ /*
256
+ * Items in a list that clips its overflow, such as menu items, options, tabs, tab panels, and table rows, keep the ring inside. A row
257
+ * that is a link in a framed list opts in with `data-focus-inset`.
258
+ */
259
+ :where([role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"], [role="tab"], [role="treeitem"], [role="row"], [role="gridcell"], [role="tabpanel"], tr, [data-focus-inset]):focus-visible {
260
+ outline-offset: -2px;
261
+ }
262
+
263
+ /*
264
+ * Code moves focus to a region, a heading, or a dialog so that the next Tab starts there, such as the skip link target or
265
+ * a page after navigation, or an overlay moves focus to its menu or dialog when it opens. The user did not choose that
266
+ * element, so it gets no ring. Menu items also have `tabindex="-1"`, but they have a role, so they keep it.
267
+ */
268
+ :where(main, section, article, div:not([role]), h1, h2, h3, h4, [role="dialog"], [role="alertdialog"], [role="menu"], [role="region"], [role="tabpanel"])[tabindex="-1"]:focus-visible {
269
+ outline: none;
270
+ }
271
+
272
+ /*
273
+ * A text field shows focus on its own frame. Nuxt UI draws the frame as a ring, so the ring turns blue, and 2px wide on a
274
+ * framed field (`focus-visible:ring-2` in the theme), instead of getting a second ring outside it. A field with an error
275
+ * keeps its red frame. A field without a frame, such as the command palette input, shows focus with its caret.
276
+ */
277
+ :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]), textarea, select, [role="combobox"]):focus-visible {
278
+ outline: none;
279
+ --tw-ring-color: var(--vh-focus);
280
+ }
281
+
282
+ /* A rich text editor, such as the document editor, is a writing surface: the caret shows focus. */
283
+ :where([contenteditable]:not([contenteditable="false"])):focus-visible {
284
+ outline: none;
285
+ }
286
+
287
+ /*
288
+ * A field whose frame is a wrapper, such as the prompt input of @vite-hub/ui, marks the wrapper with data-focus-frame. A
289
+ * plain field that draws its own border, such as the size fields of DeviceFrame, marks itself.
290
+ */
291
+ :where([data-focus-frame]):is(:focus-visible, :has(:is(input, textarea):focus-visible)) {
292
+ border-color: var(--vh-focus);
293
+ box-shadow: 0 0 0 1px var(--vh-focus);
294
+ }
295
+
296
+ :where([data-focus-frame]):has(:is(input, textarea)[aria-invalid="true"]:focus-visible) {
297
+ border-color: var(--ui-error);
298
+ box-shadow: 0 0 0 1px var(--ui-error);
299
+ }
300
+
301
+ :where(input, textarea, select, [role="combobox"])[aria-invalid="true"]:focus-visible {
302
+ --tw-ring-color: var(--ui-error);
303
+ }
304
+
305
+ /*
306
+ * A field drawn from ui-sdk parts in a Nuxt UI app, such as a Console form control, draws its frame as a 1px inset ring
307
+ * and marks the framed element with data-focus-ring-frame. On focus the ring turns blue and 2px wide, as
308
+ * `focus-visible:ring-2` does on a Nuxt UI field. A field with an error sets `data-focus-ring-frame="error"` and keeps
309
+ * its red frame.
310
+ */
311
+ :where([data-focus-ring-frame]):focus-visible {
312
+ outline: none;
313
+ box-shadow: inset 0 0 0 2px var(--vh-focus);
314
+ }
315
+
316
+ :where([data-focus-ring-frame="error"], [data-focus-ring-frame][aria-invalid="true"]):focus-visible {
317
+ box-shadow: inset 0 0 0 2px var(--ui-error);
318
+ }
319
+
320
+ /* A framed button darkens its frame on focus. The blue ring is enough, so the frame keeps its color. */
321
+ :where(button, a)[class*="focus-visible:ring-inverted"]:focus-visible {
322
+ --tw-ring-color: var(--ui-border-accented);
323
+ }
324
+
325
+ /*
326
+ * Nuxt UI also rings the `::before` of a focused navigation link, the code inside a link, and the card around a focused
327
+ * checkbox or radio. The ring of the focused element is enough, so those second rings go.
328
+ */
329
+ :where([class*="focus-visible:before:outline"]):focus-visible::before,
330
+ :where(a:focus-visible > code),
331
+ :where([class*="has-focus-visible:outline"]):has(:focus-visible) {
332
+ outline: none;
333
+ }
334
+
335
+ /*
336
+ * A page card links through an empty `a` laid over the card. The card draws the ring, so the ring has the card's shape,
337
+ * and its frame keeps its color.
338
+ */
339
+ :where([class*="has-[>a:focus-visible]:outline"]):has(> a:focus-visible) {
340
+ outline: 2px solid var(--vh-focus);
341
+ outline-offset: 2px;
342
+ --tw-ring-color: var(--ui-border);
343
+ }
344
+
345
+ :where([class*="has-[>a:focus-visible]:outline"]) > a:focus-visible {
346
+ outline: none;
347
+ }
348
+
349
+ :where([class*="has-focus-visible:ring"]):has(:focus-visible) {
350
+ --tw-ring-color: var(--ui-border-accented);
351
+ }
352
+
353
+ /* The tag input is a text field whose frame is its root, so its frame turns blue like the frame of an input. */
354
+ :where([class*="has-focus-visible:ring-2"]):has(input:focus-visible) {
355
+ --tw-ring-color: var(--vh-focus);
356
+ }
357
+
358
+ :where([class*="has-focus-visible:ring-2"]):has(input[aria-invalid="true"]:focus-visible) {
359
+ --tw-ring-color: var(--ui-error);
360
+ }
361
+
362
+ /*
363
+ * Parts that the rules above cannot reach. The file tree of @pierre/trees renders in shadow DOM and reads these
364
+ * variables, which inherit into it from the page: the selected row is a neutral fill like every selected item, and the
365
+ * focused row gets the blue ring inside. Comark adds a shadow to its heading anchors.
366
+ */
367
+ :root {
368
+ --trees-accent-override: var(--ui-text-highlighted);
369
+ --trees-bg-muted-override: var(--ui-bg-elevated);
370
+ --trees-bg-override: var(--ui-bg);
371
+ --trees-border-color-override: var(--ui-border);
372
+ --trees-border-radius-override: calc(var(--ui-radius) * 1.5);
373
+ --trees-fg-override: var(--ui-text-toned);
374
+ --trees-font-family-override: var(--font-sans);
375
+ --trees-input-bg-override: var(--ui-bg);
376
+ --trees-focus-ring-color-override: var(--vh-focus);
377
+ --trees-focus-ring-offset-override: -2px;
378
+ --trees-focus-ring-width-override: 2px;
379
+ --trees-selected-bg-override: var(--ui-bg-elevated);
380
+ --trees-selected-fg-override: var(--ui-text-highlighted);
381
+ --trees-selected-focused-border-color-override: var(--vh-focus);
382
+ }
383
+
384
+ :where(.cl-anchor):focus-visible {
385
+ box-shadow: none;
386
+ }
package/dist/server.js CHANGED
@@ -1,5 +1,5 @@
1
- import { l as checkDocsLinks, n as createDocsContent, r as createDocsManifest } from "./manifest-E4mohC7O.js";
2
- import { a as docsSearchSections, i as docsMarkdown, t as createDocsParser } from "./markdown-BzZkYb24.js";
1
+ import { l as checkDocsLinks, n as createDocsContent, r as createDocsManifest } from "./manifest-BgBIScEV.js";
2
+ import { a as docsSearchSections, i as docsMarkdown, t as createDocsParser } from "./markdown-DgQg53dB.js";
3
3
  import { t as toRawMarkdown } from "./raw-Dh38kL9g.js";
4
4
  import { i as docsPageResponse } from "./page-DWsretqk.js";
5
5
  export { checkDocsLinks, createDocsContent, createDocsManifest, createDocsParser, docsMarkdown, docsPageResponse, docsSearchSections, toRawMarkdown };