@tenphi/starlight 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ContrastSelect.astro +78 -0
- package/dist/components/GlobalStyles.js +1091 -170
- package/dist/components/LayoutComponents.js +148 -111
- package/dist/components/Logo.astro +4 -2
- package/dist/components/component-styles.test.ts +16 -0
- package/dist/icons/contrast.svg +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +494 -114
- package/dist/index.js.map +1 -1
- package/dist/overrides/Header.astro +4 -2
- package/dist/overrides/MobileMenuFooter.astro +2 -0
- package/package.json +2 -2
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/theme/defaults.ts","../src/theme/index.ts","../src/theme/tasty-config.ts","../src/components/component-styles.ts","../src/components/tasty-states.js","../src/integration.ts"],"sourcesContent":["import type {\n ThemeTokens,\n TypographyPreset,\n TypographyPresets,\n} from \"@tenphi/docs\";\n\nexport const DEFAULT_THEME_TOKENS = {\n $gap: \"0.5rem\",\n $radius: \"6px\",\n \"$card-radius\": \"10px\",\n \"$border-width\": \"1px\",\n \"$outline-width\": \"2px\",\n \"$outline-offset\": \"2px\",\n \"$layout-width\": \"87.5rem\",\n \"$content-width\": \"58rem\",\n \"$sidebar-width\": \"17.5rem\",\n \"$control-height\": \"2.5rem\",\n} satisfies ThemeTokens;\n\nconst BODY_FONT =\n \"'Onest Variable', Onest, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO_FONT =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\";\n\nexport const DEFAULT_TYPOGRAPHY_PRESETS: Record<string, TypographyPreset> = {\n body: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.65,\n letterSpacing: \"-0.006em\",\n fontWeight: 420,\n boldFontWeight: 640,\n },\n heading: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.15,\n letterSpacing: \"-0.025em\",\n fontWeight: 640,\n boldFontWeight: 720,\n },\n h1: heading(\"clamp(2.5rem, 5vw, 3.25rem)\", 1.05, \"-0.045em\"),\n h2: heading(\"clamp(1.75rem, 3vw, 2.125rem)\", 1.1, \"-0.035em\"),\n h3: heading(\"1.5rem\", 1.15, \"-0.025em\"),\n h4: heading(\"1.25rem\", 1.2, \"-0.018em\"),\n h5: heading(\"1.125rem\", 1.25, \"-0.012em\"),\n h6: heading(\"1rem\", 1.3, \"-0.006em\"),\n navigation: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.9375rem\",\n lineHeight: 1.4,\n letterSpacing: \"-0.006em\",\n fontWeight: 540,\n boldFontWeight: 650,\n },\n small: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.875rem\",\n lineHeight: 1.45,\n letterSpacing: \"-0.002em\",\n fontWeight: 420,\n boldFontWeight: 650,\n },\n code: {\n fontFamily: MONO_FONT,\n fontSize: \"0.875rem\",\n lineHeight: 1.65,\n letterSpacing: \"0\",\n fontWeight: 400,\n boldFontWeight: 650,\n },\n};\n\nexport function resolveThemeTokens(tokens: ThemeTokens = {}): ThemeTokens {\n return { ...DEFAULT_THEME_TOKENS, ...tokens };\n}\n\nexport function resolveTypographyPresets(\n presets: TypographyPresets = {},\n): Record<string, TypographyPreset> {\n const body = DEFAULT_TYPOGRAPHY_PRESETS.body;\n if (!body) throw new Error(\"The body typography preset is required.\");\n const names = new Set([\n ...Object.keys(DEFAULT_TYPOGRAPHY_PRESETS),\n ...Object.keys(presets),\n ]);\n return Object.fromEntries(\n [...names].map((name) => [\n name,\n {\n ...(DEFAULT_TYPOGRAPHY_PRESETS[name] ?? body),\n ...(presets[name] ?? {}),\n },\n ]),\n );\n}\n\nfunction heading(\n fontSize: string,\n lineHeight: number,\n letterSpacing: string,\n): TypographyPreset {\n return {\n fontFamily: \"var(--heading-font-family)\",\n fontSize,\n lineHeight,\n letterSpacing,\n fontWeight: \"var(--heading-font-weight)\",\n boldFontWeight: \"var(--heading-bold-font-weight)\",\n };\n}\n","import {\n apcaContrast,\n glaze,\n okhslToLinearSrgb,\n relativeLuminanceFromLinearRgb,\n variantToOkhsl,\n type GlazeColorValue,\n type ResolvedColorVariant,\n} from \"@tenphi/glaze\";\nimport type {\n BrandConfig,\n DocsDiagnostic,\n ThemeConfig,\n ThemeTokens,\n TypographyPreset,\n} from \"@tenphi/docs\";\nimport { resolveThemeTokens, resolveTypographyPresets } from \"./defaults.js\";\n\nexport interface ResolvedDocsTheme {\n colors: {\n surface: Record<string, string>;\n surface2: Record<string, string>;\n surface3: Record<string, string>;\n text: Record<string, string>;\n textSoft: Record<string, string>;\n accentText: Record<string, string>;\n accentSurface: Record<string, string>;\n accentSurfaceText: Record<string, string>;\n focus: Record<string, string>;\n shadow: Record<string, string>;\n };\n tokens: ThemeTokens;\n presets: Record<string, TypographyPreset>;\n contrast: {\n light: number;\n dark: number;\n lightContrast: number;\n darkContrast: number;\n };\n diagnostics: DocsDiagnostic[];\n}\n\nexport function resolveDocsTheme(theme: ThemeConfig = {}): ResolvedDocsTheme {\n const brand = normalizeBrand(theme.brand);\n const authoredTarget = brand.contrast?.apca ?? 45;\n const normalTarget = Array.isArray(authoredTarget)\n ? authoredTarget[0]\n : authoredTarget;\n const highTarget = Array.isArray(authoredTarget)\n ? authoredTarget[1]\n : normalTarget + 15;\n const glazeOptions = {\n autoFlip: true,\n ...(theme.contrastLevel !== undefined\n ? { contrastLevel: theme.contrastLevel }\n : {}),\n } as const;\n const surfaceFrom = theme.palette?.surface ?? \"#ffffff\";\n const surface = glaze.color({\n from: surfaceFrom,\n mode: \"auto\",\n // Near-white brand surfaces can carry a numerically large OKHSL\n // saturation that becomes vivid as the ramp moves away from white. Reduce\n // saturation along the light ramp and keep dark chrome nearly neutral.\n darkSaturation: 0.35,\n });\n const surface2 = glaze.color(\n {\n from: surfaceFrom,\n base: surface,\n tone: \"-2\",\n mode: \"auto\",\n saturationFactor: 0.9,\n darkSaturation: 0.325,\n },\n glazeOptions,\n );\n const surface3 = glaze.color(\n {\n from: surfaceFrom,\n base: surface2,\n tone: \"-2\",\n mode: \"auto\",\n saturationFactor: 0.8,\n darkSaturation: 0.3,\n },\n glazeOptions,\n );\n const text = glaze.color(\n {\n from: theme.palette?.text ?? \"#20232a\",\n base: surface,\n role: \"text\",\n contrast: { apca: [75, 90] },\n mode: \"auto\",\n },\n glazeOptions,\n );\n const textSoft = glaze.color(\n {\n from: theme.palette?.textSoft ?? \"#626875\",\n base: surface,\n role: \"text\",\n contrast: { apca: [60, 75] },\n mode: \"auto\",\n },\n glazeOptions,\n );\n const accentText = glaze.color(\n {\n from: brand.from,\n base: surface,\n role: \"text\",\n contrast: { apca: authoredTarget },\n mode: \"auto\",\n },\n glazeOptions,\n );\n const focus = glaze.color(\n {\n from: brand.from,\n base: surface,\n role: \"border\",\n contrast: { apca: authoredTarget },\n mode: \"auto\",\n },\n glazeOptions,\n );\n const accentSurface = glaze.color({ from: brand.from, mode: \"fixed\" });\n const accentSurfaceText = glaze.color({\n from: \"#ffffff\",\n base: accentSurface,\n role: \"text\",\n contrast: { apca: 60 },\n mode: \"auto\",\n });\n const resolvedSurface = surface.resolve();\n const resolvedAccent = accentText.resolve();\n const shadowTheme = glaze(\n {\n hue: variantToOkhsl(resolvedSurface.light).h,\n saturation: variantToOkhsl(resolvedSurface.light).s * 100,\n darkHue: variantToOkhsl(resolvedSurface.dark).h,\n darkSaturation: variantToOkhsl(resolvedSurface.dark).s * 100,\n },\n undefined,\n glazeOptions,\n );\n shadowTheme.colors({\n surface: {\n from: surfaceFrom,\n mode: \"auto\",\n darkSaturation: 0.35,\n },\n text: {\n from: theme.palette?.text ?? \"#20232a\",\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [75, 90] },\n mode: \"auto\",\n },\n shadow: {\n type: \"shadow\",\n bg: \"surface\",\n fg: \"text\",\n intensity: [12, 20],\n tuning: { alphaMax: 0.28 },\n },\n });\n\n const scores = {\n light: score(resolvedAccent.light, resolvedSurface.light),\n dark: score(resolvedAccent.dark, resolvedSurface.dark),\n lightContrast: score(\n resolvedAccent.lightContrast,\n resolvedSurface.lightContrast,\n ),\n darkContrast: score(\n resolvedAccent.darkContrast,\n resolvedSurface.darkContrast,\n ),\n };\n const diagnostics: DocsDiagnostic[] = [];\n for (const [scheme, measured] of Object.entries(scores)) {\n const required = scheme.includes(\"Contrast\") ? highTarget : normalTarget;\n if (measured + 0.05 < required) {\n diagnostics.push({\n code: \"DOCS_BRAND_CONTRAST_UNMET\",\n severity: \"error\",\n message: `Brand contrast in ${scheme} is Lc ${measured.toFixed(1)}; required Lc ${required}.`,\n hint: `Authored color: ${String(brand.from)}.`,\n });\n }\n }\n const outputOptions = { modes: { highContrast: true } } as const;\n const shadow = shadowTheme.json(outputOptions).shadow;\n if (!shadow) throw new Error(\"The Glaze shadow token failed to resolve.\");\n const colors = {\n surface: surface.json(outputOptions),\n surface2: surface2.json(outputOptions),\n surface3: surface3.json(outputOptions),\n text: text.json(outputOptions),\n textSoft: textSoft.json(outputOptions),\n accentText: accentText.json(outputOptions),\n accentSurface: accentSurface.json(outputOptions),\n accentSurfaceText: accentSurfaceText.json(outputOptions),\n focus: focus.json(outputOptions),\n shadow,\n };\n return {\n colors,\n tokens: resolveThemeTokens(theme.tokens),\n presets: resolveTypographyPresets(theme.presets),\n contrast: scores,\n diagnostics,\n };\n}\n\nfunction normalizeBrand(\n brand: BrandConfig | undefined,\n): Exclude<BrandConfig, GlazeColorValue> & { from: GlazeColorValue } {\n if (typeof brand === \"object\" && brand !== null && \"from\" in brand)\n return brand;\n return { from: brand ?? \"#315efb\" };\n}\n\nfunction score(\n foreground: ResolvedColorVariant,\n background: ResolvedColorVariant,\n): number {\n return Math.abs(apcaContrast(luminance(foreground), luminance(background)));\n}\n\nfunction luminance(variant: ResolvedColorVariant): number {\n const { h, s, l } = variantToOkhsl(variant);\n return relativeLuminanceFromLinearRgb(\n okhslToLinearSrgb(h, s, l, variant.pastel),\n );\n}\n","import type { ConfigTokens } from \"@tenphi/tasty/core\";\nimport type { ResolvedDocsTheme } from \"./index.js\";\n\nexport const TASTY_UNITS = {\n x: \"var(--gap)\",\n r: \"var(--radius)\",\n cr: \"var(--card-radius)\",\n bw: \"var(--border-width)\",\n} as const;\n\n// Token states are emitted on :root already. Keep these as ordinary state\n// selectors so Tasty attaches them to that root instead of generating an\n// impossible descendant `:root ... :root` selector.\nconst LIGHT =\n \"theme=light | (@media(prefers-color-scheme: light) & :not([data-theme]))\";\nconst HIGH_CONTRAST =\n \"contrast=more | (@media(prefers-contrast: more) & :not([data-contrast]))\";\n\nexport function tastyTokens(theme: ResolvedDocsTheme): ConfigTokens {\n const tokens = Object.fromEntries(\n Object.entries(theme.tokens).filter(([name]) => name.startsWith(\"$\")),\n ) as ConfigTokens;\n\n Object.assign(tokens, {\n \"#surface\": colorStates(theme.colors.surface),\n \"#surface-2\": colorStates(theme.colors.surface2),\n \"#surface-3\": colorStates(theme.colors.surface3),\n \"#surface-2-hover\": mix(\"#text\", 3, \"#surface-2\"),\n \"#surface-2-pressed\": mix(\"#text\", 9, \"#surface-2\"),\n \"#surface-3-hover\": mix(\"#text\", 3, \"#surface-3\"),\n \"#surface-3-pressed\": mix(\"#text\", 9, \"#surface-3\"),\n \"#text\": colorStates(theme.colors.text),\n \"#text-soft\": colorStates(theme.colors.textSoft),\n \"#border\": mix(\"#text\", 18, \"#surface\"),\n \"#border-strong\": mix(\"#text\", 34, \"#surface\"),\n \"#accent-text\": colorStates(theme.colors.accentText),\n \"#accent-surface\": colorStates(theme.colors.accentSurface),\n \"#accent-surface-text\": colorStates(theme.colors.accentSurfaceText),\n \"#focus\": colorStates(theme.colors.focus),\n \"#shadow\": colorStates(theme.colors.shadow),\n \"#overlay\": mix(\"#text\", 58, \"transparent\"),\n } satisfies ConfigTokens);\n\n return tokens;\n}\n\nfunction colorStates(colors: Record<string, string>) {\n return {\n \"\": colors.dark,\n [LIGHT]: colors.light,\n [HIGH_CONTRAST]: colors.darkContrast,\n [`(${LIGHT}) & (${HIGH_CONTRAST})`]: colors.lightContrast,\n };\n}\n\nfunction mix(foreground: string, percentage: number, background: string) {\n return `color-mix(in oklab, ${foreground} ${percentage}%, ${background})`;\n}\n","import { mergeStyles, type Styles } from \"@tenphi/tasty/core\";\nimport {\n COOKBOOK_COMPONENT_NAMES,\n type ComponentStyleConfig,\n type ComponentStylesConfig,\n type CookbookComponentName,\n} from \"@tenphi/docs\";\n\n// Astro can load the integration and renderer through separate module graphs.\n// Keep their component configuration on the shared process global.\nconst sharedConfiguration = globalThis as typeof globalThis & {\n __tenphiCookbookComponentStyles?: ComponentStylesConfig;\n};\nconst cookbookComponentNames = new Set<string>(COOKBOOK_COMPONENT_NAMES);\n\nexport function configureComponentStyles(\n styles: ComponentStylesConfig | undefined,\n): void {\n sharedConfiguration.__tenphiCookbookComponentStyles = styles ?? {};\n}\n\nexport function resolveComponentStyles(\n name: CookbookComponentName,\n defaults: Styles,\n): Styles {\n const configured = sharedConfiguration.__tenphiCookbookComponentStyles?.[\n name\n ] as ComponentStyleConfig | undefined;\n if (!configured) return defaults;\n if (isModeConfig(configured)) {\n const styles = configured.styles as Styles;\n return configured.mode === \"replace\"\n ? styles\n : mergeStyles(defaults, styles);\n }\n return mergeStyles(defaults, configured as Styles);\n}\n\nexport function resolveComponentStyleOverride(\n name: CookbookComponentName,\n): { mode: \"extend\" | \"replace\"; styles: Styles } | undefined {\n const configured = sharedConfiguration.__tenphiCookbookComponentStyles?.[\n name\n ] as ComponentStyleConfig | undefined;\n if (!configured) return undefined;\n if (isModeConfig(configured)) {\n return { mode: configured.mode, styles: configured.styles as Styles };\n }\n return { mode: \"extend\", styles: configured as Styles };\n}\n\n/** Preserve custom anatomy names from the pre-component style API. */\nexport function resolveLegacyAnatomyStyles(\n styles: ComponentStylesConfig | undefined,\n): Record<string, Styles> | undefined {\n if (!styles) return undefined;\n const entries = Object.entries(styles)\n .filter(\n (entry): entry is [string, ComponentStyleConfig] =>\n !cookbookComponentNames.has(entry[0]) && entry[1] !== undefined,\n )\n .map(([name, value]) => [\n `[data-tasty-anatomy=\"${name}\"]`,\n isModeConfig(value) ? value.styles : value,\n ]);\n return entries.length\n ? (Object.fromEntries(entries) as Record<string, Styles>)\n : undefined;\n}\n\nfunction isModeConfig(\n value: ComponentStyleConfig,\n): value is Extract<ComponentStyleConfig, { mode: string }> {\n return (\n \"mode\" in value &&\n (value.mode === \"extend\" || value.mode === \"replace\") &&\n \"styles\" in value\n );\n}\n","import { configure } from \"@tenphi/tasty\";\n\nexport const cookbookStates = {\n \"@mobile\": \"@media(w < 50rem)\",\n \"@desktop\": \"@media(w >= 50rem)\",\n \"@small\": \"@media(w <= 40rem)\",\n \"@shell-mobile\": \"@media(w <= 48rem)\",\n \"@shell-desktop\": \"@media(w > 48rem)\",\n \"@narrow-layout\": \"@media(w < 72rem)\",\n \"@medium-layout\": \"@media(w >= 50rem) & @media(w < 72rem)\",\n \"@reduced-motion\": \"@media(prefers-reduced-motion: reduce)\",\n};\n\nlet configured = false;\n\n/** Configure aliases in the renderer's Tasty module before styles are parsed. */\nexport function configureCookbookStates() {\n if (configured) return;\n configure({ states: cookbookStates });\n configured = true;\n}\n","import { existsSync } from \"node:fs\";\nimport { cp, mkdir, readFile } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport { dirname, extname, join } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport starlight from \"./starlight-runtime.js\";\nimport {\n createDocsGraph,\n assertValidDocs,\n type DocsConfig,\n type NavigationItem,\n} from \"@tenphi/docs\";\nimport {\n configure,\n type ConfigTokens,\n type Styles,\n type TypographyPreset,\n} from \"@tenphi/tasty/core\";\nimport { tastyIntegration } from \"@tenphi/tasty/ssr/astro\";\nimport type { AstroIntegration, HookParameters } from \"astro\";\nimport {\n resolveNavigationLayout,\n type ResolvedNavigationLayout,\n} from \"./navigation.js\";\nimport { resolveDocsTheme } from \"./theme/index.js\";\nimport { TASTY_UNITS, tastyTokens } from \"./theme/tasty-config.js\";\nimport {\n configureComponentStyles,\n resolveLegacyAnatomyStyles,\n} from \"./components/component-styles.js\";\nimport { cookbookStates } from \"./components/tasty-states.js\";\n\nconst packageRequire = createRequire(import.meta.url);\nconst starlightRoot = dirname(packageRequire.resolve(\"@astrojs/starlight\"));\nconst tastyStaticMiddleware = packageRequire.resolve(\n \"@tenphi/tasty/ssr/astro-middleware-static\",\n);\nconst tastyExtractStaticMiddleware = packageRequire.resolve(\n \"@tenphi/tasty/ssr/astro-middleware-extract-static\",\n);\nconst astroReactServer = packageRequire.resolve(\"@astrojs/react/server.js\");\nconst astroReactClient = packageRequire.resolve(\"@astrojs/react/client.js\");\nconst astroReactIntegration = packageRequire.resolve(\"@astrojs/react\");\nconst importNative = new Function(\"specifier\", \"return import(specifier)\") as (\n specifier: string,\n) => Promise<{ default: () => AstroIntegration }>;\n\nexport interface CookbookOptions {\n config?: DocsConfig;\n root?: string;\n}\n\nexport default function cookbook(\n options: CookbookOptions = {},\n): AstroIntegration {\n const docsTheme = resolveDocsTheme(options.config?.theme);\n if (\n docsTheme.diagnostics.some((diagnostic) => diagnostic.severity === \"error\")\n ) {\n throw new Error(\n docsTheme.diagnostics.map((diagnostic) => diagnostic.message).join(\"\\n\"),\n );\n }\n configureTastyTheme(options.config?.theme, docsTheme);\n configureComponentStyles(options.config?.theme?.styles);\n const headerPath = fileURLToPath(\n new URL(\"./overrides/Header.astro\", import.meta.url),\n );\n const sidebarPath = fileURLToPath(\n new URL(\"./overrides/Sidebar.astro\", import.meta.url),\n );\n const mobileMenuFooterPath = fileURLToPath(\n new URL(\"./overrides/MobileMenuFooter.astro\", import.meta.url),\n );\n const themeSelectPath = fileURLToPath(\n new URL(\"./overrides/ThemeSelect.astro\", import.meta.url),\n );\n const components = {\n Header: headerPath,\n Sidebar: sidebarPath,\n MobileMenuFooter: mobileMenuFooterPath,\n ThemeSelect: themeSelectPath,\n ...options.config?.components?.overrides,\n };\n const navigation = resolveNavigationLayout(options.config?.navigation);\n // Tasty 3.6's integration shape is structurally compatible with Astro 7;\n // its published helper type still models `site` as URL-only.\n const tasty = tastyIntegration({\n islands: false,\n css: { mode: \"extract\" },\n }) as unknown as AstroIntegration;\n let inner: AstroIntegration[] = [tasty];\n let projectRoot = options.root;\n let graphConfig = options.config;\n let graph: Awaited<ReturnType<typeof createDocsGraph>> | undefined;\n let usingContentCollection = false;\n\n async function loadGraph(refresh = false) {\n if (!graph || refresh) {\n graph = await createDocsGraph({\n ...(projectRoot ? { root: projectRoot } : {}),\n ...(graphConfig ? { config: graphConfig } : {}),\n });\n assertValidDocs(graph);\n }\n return graph;\n }\n\n return {\n name: \"cookbook\",\n hooks: {\n \"astro:config:setup\": async (context) => {\n const react = (\n await importNative(pathToFileURL(astroReactIntegration).href)\n ).default();\n if (\n context.config.integrations.some(\n (integration) => integration.name === \"@astrojs/starlight\",\n )\n ) {\n throw new Error(\n \"Cookbook already includes Starlight. Remove the direct @astrojs/starlight integration before continuing.\",\n );\n }\n projectRoot ??= fileURLToPath(context.config.root);\n const base = options.config?.build?.base ?? context.config.base;\n graphConfig = {\n ...options.config,\n build: { ...options.config?.build, base },\n };\n usingContentCollection = hasContentConfig(context.config.srcDir);\n const starlightIntegration = starlight({\n title: options.config?.site?.title ?? \"Documentation\",\n ...(options.config?.site?.description\n ? { description: options.config.site.description }\n : {}),\n ...(options.config?.search?.enabled === false\n ? { pagefind: false }\n : {}),\n ...(!usingContentCollection ? { disable404Route: true } : {}),\n components,\n sidebar: usingContentCollection ? starlightSidebar(navigation) : [],\n });\n inner = [react, tasty, starlightIntegration];\n let markdownRuntime = {\n image: context.config.image,\n markdown: context.config.markdown,\n srcDir: context.config.srcDir,\n };\n let markdownRenderer: ReturnType<\n typeof markdownRuntime.markdown.processor.createRenderer\n >;\n context.updateConfig({\n base,\n output: \"static\",\n vite: {\n ssr: {\n external: [\n \"@tenphi/docs\",\n \"react\",\n \"react-dom\",\n \"react-dom/server\",\n ],\n },\n plugins: [\n virtualDocsPlugin(async () => {\n const loaded = await loadGraph();\n const entries = usingContentCollection\n ? loaded.entries\n : await Promise.all(\n loaded.entries.map(async (entry) => {\n const { image, markdown, srcDir } = markdownRuntime;\n markdownRenderer ??= markdown.processor.createRenderer({\n image,\n syntaxHighlight: markdown.syntaxHighlight,\n shikiConfig: markdown.shikiConfig,\n gfm: markdown.gfm,\n smartypants: markdown.smartypants,\n } as unknown as Parameters<\n typeof markdown.processor.createRenderer\n >[0]);\n const renderer = await markdownRenderer;\n const rendered = await renderer.render(\n entry.transformedBody,\n {\n frontmatter: entry.frontmatter,\n fileURL: starlightContentUrl(entry.route, srcDir),\n },\n );\n return {\n ...entry,\n rendered: {\n html: rendered.code,\n headings: rendered.metadata.headings,\n },\n };\n }),\n );\n return {\n entries,\n routes: loaded.routes,\n site: documentedSite(loaded),\n base: loaded.config.build.base,\n search: loaded.config.search.enabled,\n };\n }, navigation),\n ],\n resolve: {\n alias: [\n {\n find: \"@astrojs/starlight\",\n replacement: starlightRoot,\n },\n {\n find: \"@tenphi/tasty/ssr/astro-middleware-static\",\n replacement: tastyStaticMiddleware,\n },\n {\n find: \"@tenphi/tasty/ssr/astro-middleware-extract-static\",\n replacement: tastyExtractStaticMiddleware,\n },\n {\n find: \"@astrojs/react/server.js\",\n replacement: astroReactServer,\n },\n {\n find: \"@astrojs/react/client.js\",\n replacement: astroReactClient,\n },\n ],\n },\n },\n });\n await callInner(inner.slice(0, 2), \"astro:config:setup\", context);\n\n if (!usingContentCollection) {\n graph = await createDocsGraph({\n root: projectRoot,\n config: graphConfig,\n });\n assertValidDocs(graph);\n context.injectRoute({\n pattern: \"[...route]\",\n entrypoint: new URL(\"./routes/DocsPage.astro\", import.meta.url),\n prerender: true,\n });\n }\n\n // Starlight inserts its own follow-up integrations immediately after\n // itself. Give it a temporary real position so Astro processes those\n // once, after this composite integration, rather than re-visiting us.\n const starlightWithPlugins = inner[2];\n if (starlightWithPlugins) {\n const selfIndex = context.config.integrations.findIndex(\n (integration) => integration.name === \"cookbook\",\n );\n context.config.integrations.splice(\n selfIndex + 1,\n 0,\n starlightWithPlugins,\n );\n try {\n await callInner(\n [starlightWithPlugins],\n \"astro:config:setup\",\n usingContentCollection\n ? context\n : withoutStarlightDocsRoute(context),\n );\n } finally {\n const placeholderIndex =\n context.config.integrations.indexOf(starlightWithPlugins);\n if (placeholderIndex >= 0)\n context.config.integrations.splice(placeholderIndex, 1);\n }\n }\n context.config.integrations.push({\n name: \"cookbook-markdown-renderer\",\n hooks: {\n \"astro:config:setup\": ({ config }) => {\n markdownRuntime = {\n image: config.image,\n markdown: config.markdown,\n srcDir: config.srcDir,\n };\n },\n },\n });\n },\n \"astro:config:done\": async (context) => {\n await callInner(inner, \"astro:config:done\", context);\n },\n \"astro:server:setup\": async ({ server }) => {\n let assets = docsAssetMap(await loadGraph());\n server.middlewares.use(async (request, response, next) => {\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n next();\n return;\n }\n const pathname = requestPath(request.url);\n if (!pathname.includes(\"/_tasty-assets/\")) {\n next();\n return;\n }\n let asset = assets.get(pathname);\n if (!asset) {\n try {\n assets = docsAssetMap(await loadGraph(true));\n } catch {\n next();\n return;\n }\n asset = assets.get(pathname);\n }\n if (!asset?.sourcePath) {\n next();\n return;\n }\n try {\n const body = await readFile(asset.sourcePath);\n response.statusCode = 200;\n response.setHeader(\"Content-Type\", assetContentType(pathname));\n response.setHeader(\"Content-Length\", body.byteLength);\n response.setHeader(\"Cache-Control\", \"no-cache\");\n response.end(request.method === \"HEAD\" ? undefined : body);\n } catch {\n next();\n }\n });\n },\n \"astro:build:start\": async (context) => {\n await loadGraph();\n await callInner(inner, \"astro:build:start\", context);\n },\n \"astro:build:done\": async (context) => {\n await callInner(inner, \"astro:build:done\", context);\n if (!graph) return;\n const output = fileURLToPath(context.dir);\n for (const asset of graph.assets) {\n if (!asset.sourcePath || !asset.publicPath) continue;\n const target = join(output, asset.publicPath.replace(/^\\//, \"\"));\n await mkdir(dirname(target), { recursive: true });\n await cp(asset.sourcePath, target);\n }\n },\n },\n };\n}\n\nfunction starlightContentUrl(route: string, srcDir: URL): URL {\n const slug = route === \"/\" ? \"index\" : route.replace(/^\\/+|\\/+$/g, \"\");\n return new URL(`content/docs/${slug}.md`, srcDir);\n}\n\nfunction docsAssetMap(graph: Awaited<ReturnType<typeof createDocsGraph>>) {\n return new Map(\n graph.assets.flatMap((asset) =>\n asset.publicPath && asset.sourcePath\n ? [[asset.publicPath, asset] as const]\n : [],\n ),\n );\n}\n\nfunction documentedSite(\n graph: Awaited<ReturnType<typeof createDocsGraph>>,\n): Awaited<ReturnType<typeof createDocsGraph>>[\"config\"][\"site\"] {\n if (graph.config.site.version) return graph.config.site;\n const packages = new Set(\n graph.entries.flatMap((entry) =>\n entry.package?.resolved ? [entry.package.resolved] : [],\n ),\n );\n if (packages.size !== 1) return graph.config.site;\n const resolved = packages.values().next().value;\n if (!resolved) return graph.config.site;\n const separator = resolved.lastIndexOf(\"@\");\n if (separator <= 0 || separator === resolved.length - 1)\n return graph.config.site;\n return { ...graph.config.site, version: resolved.slice(separator + 1) };\n}\n\nfunction requestPath(url: string | undefined): string {\n try {\n return decodeURIComponent(new URL(url ?? \"/\", \"http://localhost\").pathname);\n } catch {\n return \"\";\n }\n}\n\nfunction assetContentType(pathname: string): string {\n switch (extname(pathname).toLowerCase()) {\n case \".avif\":\n return \"image/avif\";\n case \".gif\":\n return \"image/gif\";\n case \".jpeg\":\n case \".jpg\":\n return \"image/jpeg\";\n case \".png\":\n return \"image/png\";\n case \".svg\":\n return \"image/svg+xml\";\n case \".webp\":\n return \"image/webp\";\n default:\n return \"application/octet-stream\";\n }\n}\n\nfunction configureTastyTheme(\n theme: DocsConfig[\"theme\"],\n resolved: ReturnType<typeof resolveDocsTheme>,\n): void {\n const tokens = tastyTokens(resolved) as ConfigTokens;\n const globalStyles = resolveLegacyAnatomyStyles(theme?.styles);\n\n configure({\n states: {\n ...cookbookStates,\n ...theme?.states,\n },\n units: TASTY_UNITS,\n tokens,\n presets: resolved.presets as Record<string, TypographyPreset>,\n ...(globalStyles\n ? { globalStyles: globalStyles as Record<string, Styles> }\n : {}),\n });\n}\n\nfunction starlightSidebar(layout: ResolvedNavigationLayout): unknown[] {\n const fallback = layout.items?.length\n ? layout.items.map(starlightSidebarItem)\n : [{ autogenerate: { directory: \"\" } }];\n if (!layout.sectioned) return fallback;\n\n return [\n ...(layout.fallbackSidebarGroup !== undefined\n ? [\n {\n label: \"Documentation\",\n items: (layout.items ?? []).map(starlightSidebarItem),\n },\n ]\n : []),\n ...layout.tabs.flatMap((tab) =>\n tab.items !== undefined\n ? [{ label: tab.label, items: tab.items.map(starlightSidebarItem) }]\n : [],\n ),\n ];\n}\n\nfunction starlightSidebarItem(item: NavigationItem): unknown {\n if (typeof item === \"string\") return { slug: routeToSlug(item) };\n if (\"items\" in item) {\n return {\n label: item.label,\n items: item.items.map(starlightSidebarItem),\n };\n }\n if (\"autogenerate\" in item) {\n return {\n label: item.label,\n items: [\n {\n autogenerate: {\n directory: routeToSlug(item.autogenerate.directory, false),\n },\n },\n ],\n };\n }\n return { label: item.label, link: item.link };\n}\n\nfunction routeToSlug(route: string, rootAsIndex = true): string {\n const slug = route.replace(/^\\/+|\\/+$/g, \"\");\n return slug || (rootAsIndex ? \"index\" : \"\");\n}\n\nexport function tastyStarlight(\n config: Parameters<typeof starlight>[0],\n): AstroIntegration {\n return starlight(config);\n}\n\nasync function callInner<K extends keyof AstroIntegration[\"hooks\"]>(\n integrations: AstroIntegration[],\n hook: K,\n context: HookParameters<K>,\n): Promise<void> {\n for (const integration of integrations) {\n const handler = integration.hooks[hook];\n if (typeof handler === \"function\") {\n await (handler as (value: HookParameters<K>) => void | Promise<void>)(\n context,\n );\n }\n }\n}\n\nfunction withoutStarlightDocsRoute(\n context: HookParameters<\"astro:config:setup\">,\n): HookParameters<\"astro:config:setup\"> {\n return new Proxy(context, {\n get(target, property, receiver) {\n if (property !== \"injectRoute\") {\n return Reflect.get(target, property, receiver);\n }\n return (route: Parameters<typeof context.injectRoute>[0]) => {\n if (route.pattern !== \"[...slug]\") context.injectRoute(route);\n };\n },\n });\n}\n\nfunction virtualDocsPlugin(\n getContent: () => unknown | Promise<unknown>,\n layout: ResolvedNavigationLayout,\n) {\n const configId = \"\\0virtual:cookbook/config\";\n const layoutId = \"\\0virtual:cookbook/layout\";\n return {\n name: \"cookbook-data\",\n resolveId(id: string) {\n if (id === \"virtual:cookbook/config\") return configId;\n if (id === \"virtual:cookbook/layout\") return layoutId;\n return undefined;\n },\n async load(id: string) {\n if (id === configId) {\n return `export const content = ${JSON.stringify(await getContent())};`;\n }\n if (id === layoutId) {\n return `export const layout = ${JSON.stringify(layout)};`;\n }\n return undefined;\n },\n };\n}\n\nfunction hasContentConfig(srcDir: URL): boolean {\n const source = fileURLToPath(srcDir);\n return [\n \"content.config.ts\",\n \"content.config.mts\",\n \"content.config.js\",\n \"content.config.mjs\",\n \"content/config.ts\",\n ].some((path) => existsSync(join(source, path)));\n}\n"],"mappings":";;;;;;;;;;;;;AAMA,MAAa,uBAAuB;CAClC,MAAM;CACN,SAAS;CACT,gBAAgB;CAChB,iBAAiB;CACjB,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;CACjB,kBAAkB;CAClB,kBAAkB;CAClB,mBAAmB;AACrB;AAEA,MAAM,YACJ;AAIF,MAAa,6BAA+D;CAC1E,MAAM;EACJ,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,SAAS;EACP,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,IAAI,QAAQ,+BAA+B,MAAM,UAAU;CAC3D,IAAI,QAAQ,iCAAiC,KAAK,UAAU;CAC5D,IAAI,QAAQ,UAA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;CACtC,OAAO,IAAI,MAAM,SAAS,EACxB,IAAI,QAAQ,UAAU,UAAU;EAC9B,IAAI,aAAa,eACf,OAAO,QAAQ,IAAI,QAAQ,UAAU,QAAQ;EAE/C,QAAQ,UAAqD;GAC3D,IAAI,MAAM,YAAY,aAAa,QAAQ,YAAY,KAAK;EAC9D;CACF,EACF,CAAC;AACH;AAEA,SAAS,kBACP,YACA,QACA;CACA,MAAM,WAAW;CACjB,MAAM,WAAW;CACjB,OAAO;EACL,MAAM;EACN,UAAU,IAAY;GACpB,IAAI,OAAO,2BAA2B,OAAO;GAC7C,IAAI,OAAO,2BAA2B,OAAO;EAE/C;EACA,MAAM,KAAK,IAAY;GACrB,IAAI,OAAO,UACT,OAAO,0BAA0B,KAAK,UAAU,MAAM,WAAW,CAAC,EAAE;GAEtE,IAAI,OAAO,UACT,OAAO,yBAAyB,KAAK,UAAU,MAAM,EAAE;EAG3D;CACF;AACF;AAEA,SAAS,iBAAiB,QAAsB;CAC9C,MAAM,SAAS,cAAc,MAAM;CACnC,OAAO;EACL;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,MAAM,SAAS,WAAW,KAAK,QAAQ,IAAI,CAAC,CAAC;AACjD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/theme/defaults.ts","../src/theme/index.ts","../src/theme/shiki-theme.ts","../src/theme/tasty-config.ts","../src/components/component-styles.ts","../src/components/tasty-states.js","../src/integration.ts"],"sourcesContent":["import type {\n ThemeTokens,\n TypographyPreset,\n TypographyPresets,\n} from \"@tenphi/docs\";\n\nexport const DEFAULT_THEME_TOKENS = {\n $gap: \"0.5rem\",\n $radius: \"6px\",\n \"$card-radius\": \"10px\",\n \"$border-width\": \"1px\",\n \"$outline-width\": \"2px\",\n \"$outline-offset\": \"2px\",\n \"$layout-width\": \"87.5rem\",\n \"$content-width\": \"58rem\",\n \"$sidebar-width\": \"17.5rem\",\n \"$control-height\": \"2.5rem\",\n} satisfies ThemeTokens;\n\nconst BODY_FONT =\n \"'Onest Variable', Onest, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO_FONT =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace\";\n\nexport const DEFAULT_TYPOGRAPHY_PRESETS: Record<string, TypographyPreset> = {\n body: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.65,\n letterSpacing: \"-0.006em\",\n fontWeight: 420,\n boldFontWeight: 640,\n },\n heading: {\n fontFamily: BODY_FONT,\n fontSize: \"1rem\",\n lineHeight: 1.15,\n letterSpacing: \"-0.025em\",\n fontWeight: 640,\n boldFontWeight: 720,\n },\n h1: heading(\"clamp(2.5rem, 5vw, 3.25rem)\", 1.05, \"-0.045em\"),\n h2: heading(\"clamp(1.75rem, 3vw, 2.125rem)\", 1.1, \"-0.035em\"),\n h3: heading(\"1.5rem\", 1.15, \"-0.025em\"),\n h4: heading(\"1.25rem\", 1.2, \"-0.018em\"),\n h5: heading(\"1.125rem\", 1.25, \"-0.012em\"),\n h6: heading(\"1rem\", 1.3, \"-0.006em\"),\n navigation: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.9375rem\",\n lineHeight: 1.4,\n letterSpacing: \"-0.006em\",\n fontWeight: 540,\n boldFontWeight: 650,\n },\n small: {\n fontFamily: \"var(--body-font-family)\",\n fontSize: \"0.875rem\",\n lineHeight: 1.45,\n letterSpacing: \"-0.002em\",\n fontWeight: 420,\n boldFontWeight: 650,\n },\n code: {\n fontFamily: MONO_FONT,\n fontSize: \"0.875rem\",\n lineHeight: 1.65,\n letterSpacing: \"0\",\n fontWeight: 400,\n boldFontWeight: 650,\n },\n};\n\nexport function resolveThemeTokens(tokens: ThemeTokens = {}): ThemeTokens {\n return { ...DEFAULT_THEME_TOKENS, ...tokens };\n}\n\nexport function resolveTypographyPresets(\n presets: TypographyPresets = {},\n): Record<string, TypographyPreset> {\n const body = DEFAULT_TYPOGRAPHY_PRESETS.body;\n if (!body) throw new Error(\"The body typography preset is required.\");\n const names = new Set([\n ...Object.keys(DEFAULT_TYPOGRAPHY_PRESETS),\n ...Object.keys(presets),\n ]);\n return Object.fromEntries(\n [...names].map((name) => [\n name,\n {\n ...(DEFAULT_TYPOGRAPHY_PRESETS[name] ?? body),\n ...(presets[name] ?? {}),\n },\n ]),\n );\n}\n\nfunction heading(\n fontSize: string,\n lineHeight: number,\n letterSpacing: string,\n): TypographyPreset {\n return {\n fontFamily: \"var(--heading-font-family)\",\n fontSize,\n lineHeight,\n letterSpacing,\n fontWeight: \"var(--heading-font-weight)\",\n boldFontWeight: \"var(--heading-bold-font-weight)\",\n };\n}\n","import {\n apcaContrast,\n glaze,\n okhslToLinearSrgb,\n relativeLuminanceFromLinearRgb,\n variantToOkhsl,\n type ColorMap,\n type GlazeColorValue,\n type ResolvedColorVariant,\n} from \"@tenphi/glaze\";\nimport type {\n BrandConfig,\n DocsDiagnostic,\n ThemeConfig,\n ThemeTokens,\n TypographyPreset,\n} from \"@tenphi/docs\";\nimport { resolveThemeTokens, resolveTypographyPresets } from \"./defaults.js\";\n\nexport interface ResolvedDocsTheme {\n colors: {\n surface: Record<string, string>;\n surface2: Record<string, string>;\n surface3: Record<string, string>;\n text: Record<string, string>;\n textSoft: Record<string, string>;\n accentText: Record<string, string>;\n accentSurface: Record<string, string>;\n accentSurfaceText: Record<string, string>;\n focus: Record<string, string>;\n shadow: Record<string, string>;\n };\n /** Glaze-generated Tasty color tokens, including interaction and status roles. */\n colorTokens: Record<string, Record<string, string>>;\n tokens: ThemeTokens;\n presets: Record<string, TypographyPreset>;\n contrast: {\n light: number;\n dark: number;\n lightContrast: number;\n darkContrast: number;\n };\n diagnostics: DocsDiagnostic[];\n}\n\nexport function resolveDocsTheme(theme: ThemeConfig = {}): ResolvedDocsTheme {\n const brand = normalizeBrand(theme.brand);\n const authoredTarget = brand.contrast?.apca ?? 45;\n const normalTarget = Array.isArray(authoredTarget)\n ? authoredTarget[0]\n : authoredTarget;\n const highTarget = Array.isArray(authoredTarget)\n ? authoredTarget[1]\n : normalTarget + 15;\n const glazeOptions = {\n autoFlip: true,\n ...(theme.contrastLevel !== undefined\n ? { contrastLevel: theme.contrastLevel }\n : {}),\n } as const;\n const surfaceFrom = theme.palette?.surface ?? \"#ffffff\";\n const surfaceSeed = glaze.color({\n from: surfaceFrom,\n mode: \"auto\",\n // Near-white brand surfaces can carry a numerically large OKHSL\n // saturation that becomes vivid as the ramp moves away from white. Reduce\n // saturation along the light ramp and keep dark chrome nearly neutral.\n darkSaturation: 0.35,\n });\n const resolvedSurfaceSeed = surfaceSeed.resolve();\n const lightSurface = variantToOkhsl(resolvedSurfaceSeed.light);\n const darkSurface = variantToOkhsl(resolvedSurfaceSeed.dark);\n const colorTheme = glaze(\n {\n hue: lightSurface.h,\n saturation: lightSurface.s * 100,\n darkHue: darkSurface.h,\n // The surface definition applies its 0.35 factor again. Normalize the\n // seed so dependent dark colors retain the authored surface chroma.\n darkSaturation: Math.min(100, (darkSurface.s * 100) / 0.35),\n },\n undefined,\n glazeOptions,\n );\n colorTheme.colors({\n surface: {\n from: surfaceFrom,\n mode: \"auto\",\n darkSaturation: 0.35,\n },\n \"surface-2\": {\n base: \"surface\",\n tone: \"-2\",\n mode: \"auto\",\n saturation: 0.75,\n darkSaturation: 0.275,\n },\n \"surface-3\": {\n base: \"surface-2\",\n tone: \"-2\",\n mode: \"auto\",\n saturation: 0.65,\n darkSaturation: 0.25,\n },\n text: {\n from: theme.palette?.text ?? \"#20232a\",\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [75, 90] },\n mode: \"auto\",\n },\n \"text-soft\": {\n from: theme.palette?.textSoft ?? \"#626875\",\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [60, 75] },\n mode: \"auto\",\n },\n \"text-muted\": mix(\"surface\", \"text\", 66),\n \"surface-2-hover\": mix(\"surface-2\", \"text\", [3, 6]),\n \"surface-2-pressed\": mix(\"surface-2\", \"text\", [9, 14]),\n \"surface-3-hover\": mix(\"surface-3\", \"text\", [3, 6]),\n \"surface-3-pressed\": mix(\"surface-3\", \"text\", [9, 14]),\n \"accent-text\": {\n from: brand.from,\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [normalTarget, highTarget] },\n mode: \"auto\",\n },\n focus: {\n from: brand.from,\n base: \"surface\",\n role: \"border\",\n contrast: { apca: [normalTarget, highTarget] },\n mode: \"auto\",\n },\n \"accent-surface\": { from: brand.from, mode: \"fixed\" },\n \"accent-surface-text\": {\n from: \"#ffffff\",\n base: \"accent-surface\",\n role: \"text\",\n contrast: { apca: [60, 75] },\n mode: \"auto\",\n },\n \"accent-surface-subtle\": mix(\"surface\", \"accent-surface\", [12, 18]),\n \"accent-surface-2-subtle\": mix(\"surface-2\", \"accent-surface\", [12, 18]),\n shadow: {\n type: \"shadow\",\n bg: \"surface\",\n fg: \"text\",\n intensity: [12, 20],\n tuning: { alphaMax: 0.28 },\n },\n overlay: {\n type: \"mix\",\n base: \"surface\",\n target: \"text\",\n value: [58, 68],\n blend: \"transparent\",\n },\n clear: { from: \"#ffffff\", mode: \"fixed\", opacity: 0 },\n ...statusColors(\"orange\", \"#d97706\"),\n ...statusColors(\"green\", \"#16a34a\"),\n ...statusColors(\"blue\", \"#2563eb\"),\n ...statusColors(\"purple\", \"#9333ea\"),\n ...statusColors(\"red\", \"#dc2626\"),\n } satisfies ColorMap);\n\n const resolvedBrandSeed = glaze\n .color({ from: brand.from, mode: \"fixed\" })\n .resolve();\n const lightBrand = variantToOkhsl(resolvedBrandSeed.light);\n const darkBrand = variantToOkhsl(resolvedBrandSeed.dark);\n const borderTheme = glaze(\n {\n hue: lightBrand.h,\n saturation: lightBrand.s * 100,\n darkHue: darkBrand.h,\n darkSaturation: darkBrand.s * 100,\n },\n undefined,\n glazeOptions,\n );\n borderTheme.colors({\n surface: {\n from: surfaceFrom,\n mode: \"auto\",\n darkSaturation: 0.35,\n },\n border: {\n base: \"surface\",\n tone: [\"-9\", \"-22\"],\n saturation: 0.205,\n mode: \"auto\",\n },\n \"border-strong\": {\n base: \"surface\",\n tone: [\"-20\", \"-38\"],\n saturation: 0.205,\n mode: \"auto\",\n },\n } satisfies ColorMap);\n\n // Syntax colors are intentionally resolved as their own Glaze palette.\n // This keeps code semantics vivid enough to scan without coupling them to\n // either the product brand ramp or the deliberately restrained UI chrome.\n const syntaxTheme = glaze(210, 90, glazeOptions);\n syntaxTheme.colors({\n bg: { tone: 100, saturation: 0.1 },\n text: {\n base: \"bg\",\n tone: 0,\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 0,\n },\n comment: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 0.01,\n hue: 210,\n },\n punctuation: {\n base: \"bg\",\n contrast: { wcag: [6, \"AAA\"] },\n saturation: 0.01,\n hue: 210,\n },\n keyword: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n },\n string: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 15,\n },\n token: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 125,\n },\n property: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 155,\n },\n number: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 70,\n },\n function: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 210,\n },\n value: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 210,\n },\n operator: {\n base: \"bg\",\n contrast: { wcag: [\"AA\", \"AAA\"] },\n saturation: 80,\n hue: 340,\n },\n } satisfies ColorMap);\n\n const resolvedColors = colorTheme.resolve();\n const resolvedSurface = requiredResolvedColor(resolvedColors, \"surface\");\n const resolvedAccent = requiredResolvedColor(resolvedColors, \"accent-text\");\n\n const scores = {\n light: score(resolvedAccent.light, resolvedSurface.light),\n dark: score(resolvedAccent.dark, resolvedSurface.dark),\n lightContrast: score(\n resolvedAccent.lightContrast,\n resolvedSurface.lightContrast,\n ),\n darkContrast: score(\n resolvedAccent.darkContrast,\n resolvedSurface.darkContrast,\n ),\n };\n const diagnostics: DocsDiagnostic[] = [];\n for (const [scheme, measured] of Object.entries(scores)) {\n const required = scheme.includes(\"Contrast\") ? highTarget : normalTarget;\n if (measured + 0.05 < required) {\n diagnostics.push({\n code: \"DOCS_BRAND_CONTRAST_UNMET\",\n severity: \"error\",\n message: `Brand contrast in ${scheme} is Lc ${measured.toFixed(1)}; required Lc ${required}.`,\n hint: `Authored color: ${String(brand.from)}.`,\n });\n }\n }\n const outputOptions = { modes: { highContrast: true } } as const;\n const tastyOptions = {\n ...outputOptions,\n states: {\n dark: \"theme=dark | (@media(prefers-color-scheme: dark) & :not([data-theme]))\",\n highContrast:\n \"contrast=more | (@media(prefers-contrast: more) & :not([data-contrast]))\",\n },\n } as const;\n const resolvedPalette = colorTheme.json(outputOptions);\n const colorTokens = colorTheme.tasty(tastyOptions);\n const borderTokens = borderTheme.tasty(tastyOptions);\n const syntaxTokens = glaze.palette({ syntax: syntaxTheme }).tasty({\n ...tastyOptions,\n prefix: true,\n primary: false,\n });\n const colors = {\n surface: requiredJsonColor(resolvedPalette, \"surface\"),\n surface2: requiredJsonColor(resolvedPalette, \"surface-2\"),\n surface3: requiredJsonColor(resolvedPalette, \"surface-3\"),\n text: requiredJsonColor(resolvedPalette, \"text\"),\n textSoft: requiredJsonColor(resolvedPalette, \"text-soft\"),\n accentText: requiredJsonColor(resolvedPalette, \"accent-text\"),\n accentSurface: requiredJsonColor(resolvedPalette, \"accent-surface\"),\n accentSurfaceText: requiredJsonColor(\n resolvedPalette,\n \"accent-surface-text\",\n ),\n focus: requiredJsonColor(resolvedPalette, \"focus\"),\n shadow: requiredJsonColor(resolvedPalette, \"shadow\"),\n };\n return {\n colors,\n colorTokens: {\n ...colorTokens,\n \"#border\": requiredJsonColor(borderTokens, \"#border\"),\n \"#border-strong\": requiredJsonColor(borderTokens, \"#border-strong\"),\n ...syntaxTokens,\n },\n tokens: resolveThemeTokens(theme.tokens),\n presets: resolveTypographyPresets(theme.presets),\n contrast: scores,\n diagnostics,\n };\n}\n\nfunction mix(\n base: string,\n target: string,\n value: number | [number, number],\n space: \"okhsl\" | \"srgb\" = \"okhsl\",\n): ColorMap[string] {\n return { type: \"mix\", base, target, value, space };\n}\n\nfunction statusColors(name: string, from: GlazeColorValue): ColorMap {\n return {\n [name]: {\n from,\n base: \"surface\",\n role: \"border\",\n contrast: { apca: [30, 45] },\n mode: \"auto\",\n },\n [`${name}-text`]: {\n from,\n base: \"surface\",\n role: \"text\",\n contrast: { apca: [60, 75] },\n mode: \"auto\",\n },\n [`${name}-surface`]: mix(\"surface\", name, [12, 18], \"srgb\"),\n };\n}\n\nfunction requiredResolvedColor(\n colors: ReturnType<ReturnType<typeof glaze>[\"resolve\"]>,\n name: string,\n) {\n const color = colors.get(name);\n if (!color) throw new Error(`The Glaze ${name} color failed to resolve.`);\n return color;\n}\n\nfunction requiredJsonColor(\n colors: Record<string, Record<string, string>>,\n name: string,\n): Record<string, string> {\n const color = colors[name];\n if (!color) throw new Error(`The Glaze ${name} token failed to export.`);\n return color;\n}\n\nfunction normalizeBrand(\n brand: BrandConfig | undefined,\n): Exclude<BrandConfig, GlazeColorValue> & { from: GlazeColorValue } {\n if (typeof brand === \"object\" && brand !== null && \"from\" in brand)\n return brand;\n return { from: brand ?? \"#315efb\" };\n}\n\nfunction score(\n foreground: ResolvedColorVariant,\n background: ResolvedColorVariant,\n): number {\n return Math.abs(apcaContrast(luminance(foreground), luminance(background)));\n}\n\nfunction luminance(variant: ResolvedColorVariant): number {\n const { h, s, l } = variantToOkhsl(variant);\n return relativeLuminanceFromLinearRgb(\n okhslToLinearSrgb(h, s, l, variant.pastel),\n );\n}\n","const comment = \"var(--syntax-comment-color)\";\nconst punctuation = \"var(--syntax-punctuation-color)\";\nconst keyword = \"var(--syntax-keyword-color)\";\nconst string = \"var(--syntax-string-color)\";\nconst token = \"var(--syntax-token-color)\";\nconst property = \"var(--syntax-property-color)\";\nconst number = \"var(--syntax-number-color)\";\nconst func = \"var(--syntax-function-color)\";\nconst value = \"var(--syntax-value-color)\";\nconst operator = \"var(--syntax-operator-color)\";\nconst foreground = \"var(--syntax-text-color)\";\nconst background = \"var(--syntax-bg-color)\";\n\n/**\n * Shiki performs the grammatical classification, while every emitted color\n * remains a reference to a Glaze-generated token owned by Tasty.\n */\nexport const tastyCodeTheme = {\n name: \"tasty-code\",\n type: \"light\" as const,\n fg: foreground,\n bg: background,\n colors: {\n \"editor.background\": background,\n \"editor.foreground\": foreground,\n },\n settings: [\n {\n scope: [\n \"comment\",\n \"comment.line\",\n \"comment.block\",\n \"punctuation.definition.comment\",\n ],\n settings: { foreground: comment, fontStyle: \"italic\" },\n },\n {\n scope: [\n \"keyword\",\n \"keyword.control\",\n \"keyword.other\",\n \"storage.type\",\n \"storage.modifier\",\n \"keyword.control.at-rule.tasty\",\n \"keyword.control.at-rule.media.tasty\",\n \"keyword.control.at-rule.media-type.tasty\",\n \"keyword.control.at-rule.starting.tasty\",\n \"keyword.control.state-alias.tasty\",\n ],\n settings: { foreground: keyword },\n },\n {\n scope: [\n \"string\",\n \"string.quoted\",\n \"string.template\",\n \"string.quoted.attribute-value.tasty\",\n \"string.unquoted.attribute-value.tasty\",\n ],\n settings: { foreground: string },\n },\n {\n scope: [\n \"support.constant.color.tasty-token\",\n \"support.constant.color.tasty-token.builtin\",\n \"constant.other.color.tasty-token\",\n \"constant.other.color.tasty\",\n \"constant.other.color.hex\",\n \"constant.other.color.rgb-value\",\n ],\n settings: { foreground: token },\n },\n {\n scope: [\n \"constant.numeric\",\n \"constant.numeric.tasty\",\n \"constant.numeric.custom-unit.tasty\",\n \"constant.numeric.css-with-unit\",\n \"constant.numeric.bare.tasty\",\n \"constant.numeric.css\",\n \"constant.numeric.keyframe-step.tasty\",\n \"constant.language.boolean.tasty\",\n ],\n settings: { foreground: number },\n },\n {\n scope: [\n \"support.type.property-name.tasty\",\n \"variable.other.constant.tasty\",\n ],\n settings: { foreground: property },\n },\n {\n scope: [\"variable\", \"variable.other\"],\n settings: { foreground },\n },\n {\n scope: [\n \"entity.name.function\",\n \"support.function\",\n \"support.function.misc.css\",\n \"entity.name.tag\",\n \"entity.name.tag.tsx\",\n \"entity.name.type.tasty\",\n \"entity.name.tag.tasty\",\n ],\n settings: { foreground: func },\n },\n {\n scope: [\n \"support.constant.property-value.tasty\",\n \"support.constant.property-value.tasty-display\",\n \"support.constant.property-value.tasty-directional\",\n \"support.constant.property-value.tasty-preset\",\n \"support.constant.property-value.tasty-shape\",\n \"support.constant.property-value.tasty-scrollbar\",\n \"support.constant.property-value.tasty-state\",\n \"support.constant.property-value.tasty-cursor\",\n \"support.constant.property-value.tasty-overflow\",\n \"support.constant.property-value.tasty-position\",\n \"support.constant.property-value.tasty-flex\",\n \"support.constant.property-value.tasty-font\",\n \"support.constant.property-value.tasty-text\",\n \"support.constant.property-value.tasty-alignment\",\n \"support.constant.property-value.tasty-border-style\",\n \"support.constant.property-value.tasty-whitespace\",\n \"support.constant.property-value.tasty-global\",\n \"support.constant.property-value.tasty-transition\",\n \"support.constant.property-value.css-syntax\",\n \"entity.other.attribute-name\",\n \"entity.other.attribute-name.tasty\",\n \"entity.other.attribute-name.pseudo-class.tasty\",\n \"entity.other.attribute-name.pseudo-class.css\",\n \"entity.other.attribute-name.class.tasty\",\n \"entity.other.attribute-name.pseudo-element.css\",\n \"punctuation.definition.entity.css\",\n ],\n settings: { foreground: value },\n },\n {\n scope: [\n \"keyword.operator\",\n \"keyword.operator.logical.tasty\",\n \"keyword.operator.arithmetic.css\",\n \"keyword.operator.assignment\",\n \"keyword.operator.selector-affix.tasty\",\n \"keyword.operator.attribute-selector.tasty\",\n \"keyword.operator.comparison.tasty\",\n ],\n settings: { foreground: operator },\n },\n {\n scope: [\n \"punctuation.definition.string\",\n \"punctuation.separator\",\n \"punctuation.definition.block\",\n \"punctuation.definition.array\",\n \"punctuation.section\",\n \"punctuation.definition.auto-calc\",\n \"punctuation.definition.attribute-selector\",\n \"punctuation.definition.pseudo-class\",\n \"punctuation.definition.fallback\",\n \"meta.brace\",\n ],\n settings: { foreground: punctuation },\n },\n {\n scope: [\"keyword.control.at-rule\", \"entity.name.tag.class.css\"],\n settings: { foreground: keyword },\n },\n {\n scope: [\"support.type.property-name.css\", \"meta.property-name.css\"],\n settings: { foreground: property },\n },\n ],\n};\n","import type { ConfigTokens } from \"@tenphi/tasty/core\";\nimport type { ResolvedDocsTheme } from \"./index.js\";\n\nexport const TASTY_UNITS = {\n x: \"var(--gap)\",\n r: \"var(--radius)\",\n cr: \"var(--card-radius)\",\n bw: \"var(--border-width)\",\n} as const;\n\nexport function tastyTokens(theme: ResolvedDocsTheme): ConfigTokens {\n const tokens = Object.fromEntries(\n Object.entries(theme.tokens).filter(([name]) => name.startsWith(\"$\")),\n ) as ConfigTokens;\n\n Object.assign(tokens, theme.colorTokens as ConfigTokens);\n\n return tokens;\n}\n","import { mergeStyles, type Styles } from \"@tenphi/tasty/core\";\nimport {\n COOKBOOK_COMPONENT_NAMES,\n type ComponentStyleConfig,\n type ComponentStylesConfig,\n type CookbookComponentName,\n} from \"@tenphi/docs\";\n\n// Astro can load the integration and renderer through separate module graphs.\n// Keep their component configuration on the shared process global.\nconst sharedConfiguration = globalThis as typeof globalThis & {\n __tenphiCookbookComponentStyles?: ComponentStylesConfig;\n};\nconst cookbookComponentNames = new Set<string>(COOKBOOK_COMPONENT_NAMES);\n\nexport function configureComponentStyles(\n styles: ComponentStylesConfig | undefined,\n): void {\n sharedConfiguration.__tenphiCookbookComponentStyles = styles ?? {};\n}\n\nexport function resolveComponentStyles(\n name: CookbookComponentName,\n defaults: Styles,\n): Styles {\n const configured = sharedConfiguration.__tenphiCookbookComponentStyles?.[\n name\n ] as ComponentStyleConfig | undefined;\n if (!configured) return defaults;\n if (isModeConfig(configured)) {\n const styles = configured.styles as Styles;\n return configured.mode === \"replace\"\n ? styles\n : mergeStyles(defaults, styles);\n }\n return mergeStyles(defaults, configured as Styles);\n}\n\nexport function resolveComponentStyleOverride(\n name: CookbookComponentName,\n): { mode: \"extend\" | \"replace\"; styles: Styles } | undefined {\n const configured = sharedConfiguration.__tenphiCookbookComponentStyles?.[\n name\n ] as ComponentStyleConfig | undefined;\n if (!configured) return undefined;\n if (isModeConfig(configured)) {\n return { mode: configured.mode, styles: configured.styles as Styles };\n }\n return { mode: \"extend\", styles: configured as Styles };\n}\n\n/** Preserve custom anatomy names from the pre-component style API. */\nexport function resolveLegacyAnatomyStyles(\n styles: ComponentStylesConfig | undefined,\n): Record<string, Styles> | undefined {\n if (!styles) return undefined;\n const entries = Object.entries(styles)\n .filter(\n (entry): entry is [string, ComponentStyleConfig] =>\n !cookbookComponentNames.has(entry[0]) && entry[1] !== undefined,\n )\n .map(([name, value]) => [\n `[data-tasty-anatomy=\"${name}\"]`,\n isModeConfig(value) ? value.styles : value,\n ]);\n return entries.length\n ? (Object.fromEntries(entries) as Record<string, Styles>)\n : undefined;\n}\n\nfunction isModeConfig(\n value: ComponentStyleConfig,\n): value is Extract<ComponentStyleConfig, { mode: string }> {\n return (\n \"mode\" in value &&\n (value.mode === \"extend\" || value.mode === \"replace\") &&\n \"styles\" in value\n );\n}\n","import { configure } from \"@tenphi/tasty\";\n\nexport const cookbookStates = {\n \"@mobile\": \"@media(w < 50rem)\",\n \"@desktop\": \"@media(w >= 50rem)\",\n \"@small\": \"@media(w <= 40rem)\",\n \"@shell-mobile\": \"@media(w <= 48rem)\",\n \"@shell-desktop\": \"@media(w > 48rem)\",\n \"@narrow-layout\": \"@media(w < 72rem)\",\n \"@medium-layout\": \"@media(w >= 50rem) & @media(w < 72rem)\",\n \"@reduced-motion\": \"@media(prefers-reduced-motion: reduce)\",\n};\n\nlet configured = false;\n\n/** Configure aliases in the renderer's Tasty module before styles are parsed. */\nexport function configureCookbookStates() {\n if (configured) return;\n configure({ states: cookbookStates });\n configured = true;\n}\n","import { existsSync } from \"node:fs\";\nimport {\n cp,\n mkdir,\n readFile,\n readdir,\n unlink,\n writeFile,\n} from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport { dirname, extname, join } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport starlight from \"./starlight-runtime.js\";\nimport {\n createDocsGraph,\n assertValidDocs,\n type DocsConfig,\n type NavigationItem,\n} from \"@tenphi/docs\";\nimport {\n configure,\n type ConfigTokens,\n type Styles,\n type TypographyPreset,\n} from \"@tenphi/tasty/core\";\nimport { tastyIntegration } from \"@tenphi/tasty/ssr/astro\";\nimport type { AstroIntegration, HookParameters } from \"astro\";\nimport {\n resolveNavigationLayout,\n type ResolvedNavigationLayout,\n} from \"./navigation.js\";\nimport { resolveDocsTheme } from \"./theme/index.js\";\nimport { tastyCodeTheme } from \"./theme/shiki-theme.js\";\nimport { TASTY_UNITS, tastyTokens } from \"./theme/tasty-config.js\";\nimport {\n configureComponentStyles,\n resolveLegacyAnatomyStyles,\n} from \"./components/component-styles.js\";\nimport { cookbookStates } from \"./components/tasty-states.js\";\n\nconst packageRequire = createRequire(import.meta.url);\nconst starlightRoot = dirname(packageRequire.resolve(\"@astrojs/starlight\"));\nconst tastyStaticMiddleware = packageRequire.resolve(\n \"@tenphi/tasty/ssr/astro-middleware-static\",\n);\nconst tastyExtractStaticMiddleware = packageRequire.resolve(\n \"@tenphi/tasty/ssr/astro-middleware-extract-static\",\n);\nconst astroReactServer = packageRequire.resolve(\"@astrojs/react/server.js\");\nconst astroReactClient = packageRequire.resolve(\"@astrojs/react/client.js\");\nconst astroReactIntegration = packageRequire.resolve(\"@astrojs/react\");\nconst importNative = new Function(\"specifier\", \"return import(specifier)\") as (\n specifier: string,\n) => Promise<{ default: () => AstroIntegration }>;\n\nexport interface CookbookOptions {\n config?: DocsConfig;\n root?: string;\n}\n\nexport default function cookbook(\n options: CookbookOptions = {},\n): AstroIntegration {\n const docsTheme = resolveDocsTheme(options.config?.theme);\n if (\n docsTheme.diagnostics.some((diagnostic) => diagnostic.severity === \"error\")\n ) {\n throw new Error(\n docsTheme.diagnostics.map((diagnostic) => diagnostic.message).join(\"\\n\"),\n );\n }\n configureTastyTheme(options.config?.theme, docsTheme);\n configureComponentStyles(options.config?.theme?.styles);\n const headerPath = fileURLToPath(\n new URL(\"./overrides/Header.astro\", import.meta.url),\n );\n const sidebarPath = fileURLToPath(\n new URL(\"./overrides/Sidebar.astro\", import.meta.url),\n );\n const mobileMenuFooterPath = fileURLToPath(\n new URL(\"./overrides/MobileMenuFooter.astro\", import.meta.url),\n );\n const themeSelectPath = fileURLToPath(\n new URL(\"./overrides/ThemeSelect.astro\", import.meta.url),\n );\n const components = {\n Header: headerPath,\n Sidebar: sidebarPath,\n MobileMenuFooter: mobileMenuFooterPath,\n ThemeSelect: themeSelectPath,\n ...options.config?.components?.overrides,\n };\n const navigation = resolveNavigationLayout(options.config?.navigation);\n // Tasty 3.6's integration shape is structurally compatible with Astro 7;\n // its published helper type still models `site` as URL-only.\n const tasty = tastyIntegration({\n islands: false,\n css: { mode: \"extract\" },\n }) as unknown as AstroIntegration;\n let inner: AstroIntegration[] = [tasty];\n let projectRoot = options.root;\n let graphConfig = options.config;\n let graph: Awaited<ReturnType<typeof createDocsGraph>> | undefined;\n let usingContentCollection = false;\n\n async function loadGraph(refresh = false) {\n if (!graph || refresh) {\n graph = await createDocsGraph({\n ...(projectRoot ? { root: projectRoot } : {}),\n ...(graphConfig ? { config: graphConfig } : {}),\n });\n assertValidDocs(graph);\n }\n return graph;\n }\n\n return {\n name: \"cookbook\",\n hooks: {\n \"astro:config:setup\": async (context) => {\n const react = (\n await importNative(pathToFileURL(astroReactIntegration).href)\n ).default();\n if (\n context.config.integrations.some(\n (integration) => integration.name === \"@astrojs/starlight\",\n )\n ) {\n throw new Error(\n \"Cookbook already includes Starlight. Remove the direct @astrojs/starlight integration before continuing.\",\n );\n }\n projectRoot ??= fileURLToPath(context.config.root);\n const base = options.config?.build?.base ?? context.config.base;\n graphConfig = {\n ...options.config,\n build: { ...options.config?.build, base },\n };\n usingContentCollection = hasContentConfig(context.config.srcDir);\n const starlightIntegration = starlight({\n title: options.config?.site?.title ?? \"Documentation\",\n expressiveCode: false,\n ...(options.config?.site?.description\n ? { description: options.config.site.description }\n : {}),\n ...(options.config?.search?.enabled === false\n ? { pagefind: false }\n : {}),\n ...(!usingContentCollection ? { disable404Route: true } : {}),\n components,\n sidebar: usingContentCollection ? starlightSidebar(navigation) : [],\n });\n inner = [react, tasty, starlightIntegration];\n let markdownRuntime = {\n image: context.config.image,\n markdown: {\n ...context.config.markdown,\n syntaxHighlight: \"shiki\" as const,\n shikiConfig: {\n ...context.config.markdown.shikiConfig,\n theme: tastyCodeTheme,\n },\n },\n srcDir: context.config.srcDir,\n };\n let markdownRenderer: ReturnType<\n typeof markdownRuntime.markdown.processor.createRenderer\n >;\n context.updateConfig({\n base,\n output: \"static\",\n markdown: {\n syntaxHighlight: \"shiki\",\n shikiConfig: { theme: tastyCodeTheme },\n },\n vite: {\n ssr: {\n external: [\n \"@tenphi/docs\",\n \"react\",\n \"react-dom\",\n \"react-dom/server\",\n ],\n },\n plugins: [\n stripStarlightStylesPlugin(starlightRoot),\n virtualDocsPlugin(async () => {\n const loaded = await loadGraph();\n const entries = usingContentCollection\n ? loaded.entries\n : await Promise.all(\n loaded.entries.map(async (entry) => {\n const { image, markdown, srcDir } = markdownRuntime;\n markdownRenderer ??= markdown.processor.createRenderer({\n image,\n syntaxHighlight: markdown.syntaxHighlight,\n shikiConfig: markdown.shikiConfig,\n gfm: markdown.gfm,\n smartypants: markdown.smartypants,\n } as unknown as Parameters<\n typeof markdown.processor.createRenderer\n >[0]);\n const renderer = await markdownRenderer;\n const rendered = await renderer.render(\n entry.transformedBody,\n {\n frontmatter: entry.frontmatter,\n fileURL: starlightContentUrl(entry.route, srcDir),\n },\n );\n return {\n ...entry,\n rendered: {\n html: rendered.code,\n headings: rendered.metadata.headings,\n },\n };\n }),\n );\n return {\n entries,\n routes: loaded.routes,\n site: documentedSite(loaded),\n base: loaded.config.build.base,\n search: loaded.config.search.enabled,\n };\n }, navigation),\n ],\n resolve: {\n alias: [\n {\n find: \"@astrojs/starlight\",\n replacement: starlightRoot,\n },\n {\n find: \"@tenphi/tasty/ssr/astro-middleware-static\",\n replacement: tastyStaticMiddleware,\n },\n {\n find: \"@tenphi/tasty/ssr/astro-middleware-extract-static\",\n replacement: tastyExtractStaticMiddleware,\n },\n {\n find: \"@astrojs/react/server.js\",\n replacement: astroReactServer,\n },\n {\n find: \"@astrojs/react/client.js\",\n replacement: astroReactClient,\n },\n ],\n },\n },\n });\n await callInner(inner.slice(0, 2), \"astro:config:setup\", context);\n\n if (!usingContentCollection) {\n graph = await createDocsGraph({\n root: projectRoot,\n config: graphConfig,\n });\n assertValidDocs(graph);\n context.injectRoute({\n pattern: \"[...route]\",\n entrypoint: new URL(\"./routes/DocsPage.astro\", import.meta.url),\n prerender: true,\n });\n }\n\n // Starlight inserts its own follow-up integrations immediately after\n // itself. Give it a temporary real position so Astro processes those\n // once, after this composite integration, rather than re-visiting us.\n const starlightWithPlugins = inner[2];\n if (starlightWithPlugins) {\n const selfIndex = context.config.integrations.findIndex(\n (integration) => integration.name === \"cookbook\",\n );\n context.config.integrations.splice(\n selfIndex + 1,\n 0,\n starlightWithPlugins,\n );\n try {\n await callInner(\n [starlightWithPlugins],\n \"astro:config:setup\",\n usingContentCollection\n ? context\n : withoutStarlightDocsRoute(context),\n );\n } finally {\n const placeholderIndex =\n context.config.integrations.indexOf(starlightWithPlugins);\n if (placeholderIndex >= 0)\n context.config.integrations.splice(placeholderIndex, 1);\n }\n }\n context.config.integrations.push({\n name: \"cookbook-markdown-renderer\",\n hooks: {\n \"astro:config:setup\": ({ config }) => {\n markdownRuntime = {\n image: config.image,\n markdown: {\n ...config.markdown,\n syntaxHighlight: \"shiki\" as const,\n shikiConfig: {\n ...config.markdown.shikiConfig,\n theme: tastyCodeTheme,\n },\n },\n srcDir: config.srcDir,\n };\n },\n },\n });\n },\n \"astro:config:done\": async (context) => {\n await callInner(inner, \"astro:config:done\", context);\n },\n \"astro:server:setup\": async ({ server }) => {\n let assets = docsAssetMap(await loadGraph());\n server.middlewares.use(async (request, response, next) => {\n if (request.method !== \"GET\" && request.method !== \"HEAD\") {\n next();\n return;\n }\n const pathname = requestPath(request.url);\n if (!pathname.includes(\"/_tasty-assets/\")) {\n next();\n return;\n }\n let asset = assets.get(pathname);\n if (!asset) {\n try {\n assets = docsAssetMap(await loadGraph(true));\n } catch {\n next();\n return;\n }\n asset = assets.get(pathname);\n }\n if (!asset?.sourcePath) {\n next();\n return;\n }\n try {\n const body = await readFile(asset.sourcePath);\n response.statusCode = 200;\n response.setHeader(\"Content-Type\", assetContentType(pathname));\n response.setHeader(\"Content-Length\", body.byteLength);\n response.setHeader(\"Cache-Control\", \"no-cache\");\n response.end(request.method === \"HEAD\" ? undefined : body);\n } catch {\n next();\n }\n });\n },\n \"astro:build:start\": async (context) => {\n await loadGraph();\n await callInner(inner, \"astro:build:start\", context);\n },\n \"astro:build:done\": async (context) => {\n await callInner(inner, \"astro:build:done\", context);\n const output = fileURLToPath(context.dir);\n for (const relativePath of await readdir(output, { recursive: true })) {\n if (extname(relativePath) !== \".html\") continue;\n const path = join(output, relativePath);\n const html = await readFile(path, \"utf8\");\n const sanitized = html\n .replace(\n /\\s*<link\\b(?=[^>]*rel=\"stylesheet\")(?=[^>]*href=\"data:text\\/css,\")[^>]*>/g,\n \"\",\n )\n .replace(/\\s*<style>\\s*<\\/style>/g, \"\")\n .replace(\n /\\sstyle=\"--sl-icon-size:\\s*([^;\\\"]+);?\"/g,\n ' width=\"$1\" height=\"$1\"',\n )\n .replace(/\\sstyle=\"--depth:\\s*([^;\\\"]+);?\"/g, ' data-depth=\"$1\"')\n .replace(\n /(<kbd\\b[^>]*)\\sstyle=\"display:\\s*none;?\"([^>]*>)/g,\n \"$1$2\",\n )\n .replace(\n /(<dialog\\b[^>]*)\\sstyle=\"padding:\\s*0;?\"([^>]*>)/g,\n \"$1$2\",\n );\n if (sanitized !== html) await writeFile(path, sanitized);\n }\n const pagefindOutput = join(output, \"pagefind\");\n if (existsSync(pagefindOutput)) {\n for (const name of await readdir(pagefindOutput)) {\n if (extname(name) === \".css\") {\n await unlink(join(pagefindOutput, name));\n }\n }\n }\n if (!graph) return;\n for (const asset of graph.assets) {\n if (!asset.sourcePath || !asset.publicPath) continue;\n const target = join(output, asset.publicPath.replace(/^\\//, \"\"));\n await mkdir(dirname(target), { recursive: true });\n await cp(asset.sourcePath, target);\n }\n },\n },\n };\n}\n\nfunction stripStarlightStylesPlugin(root: string) {\n const normalizedRoot = root.replaceAll(\"\\\\\", \"/\");\n const emptyPrintId = \"\\0cookbook:empty-starlight-print\";\n return {\n name: \"cookbook-strip-starlight-css\",\n enforce: \"pre\" as const,\n resolveId(source: string, importer: string | undefined) {\n if (\n importer?.replaceAll(\"\\\\\", \"/\").startsWith(`${normalizedRoot}/`) &&\n source.endsWith(\"/style/print.css?url&no-inline\")\n ) {\n return emptyPrintId;\n }\n return undefined;\n },\n load(id: string) {\n if (id === emptyPrintId) return 'export default \"data:text/css,\";';\n return undefined;\n },\n transform(code: string, id: string) {\n const normalizedId = id.replaceAll(\"\\\\\", \"/\");\n if (!normalizedId.startsWith(`${normalizedRoot}/`)) return undefined;\n const [pathname, query = \"\"] = normalizedId.split(\"?\", 2);\n const isStylesheet = pathname?.endsWith(\".css\");\n const isAstroStyle =\n pathname?.endsWith(\".astro\") && query.includes(\"type=style\");\n if (!isStylesheet && !isAstroStyle) return undefined;\n return { code: \"\", map: null };\n },\n };\n}\n\nfunction starlightContentUrl(route: string, srcDir: URL): URL {\n const slug = route === \"/\" ? \"index\" : route.replace(/^\\/+|\\/+$/g, \"\");\n return new URL(`content/docs/${slug}.md`, srcDir);\n}\n\nfunction docsAssetMap(graph: Awaited<ReturnType<typeof createDocsGraph>>) {\n return new Map(\n graph.assets.flatMap((asset) =>\n asset.publicPath && asset.sourcePath\n ? [[asset.publicPath, asset] as const]\n : [],\n ),\n );\n}\n\nfunction documentedSite(\n graph: Awaited<ReturnType<typeof createDocsGraph>>,\n): Awaited<ReturnType<typeof createDocsGraph>>[\"config\"][\"site\"] {\n if (graph.config.site.version) return graph.config.site;\n const packages = new Set(\n graph.entries.flatMap((entry) =>\n entry.package?.resolved ? [entry.package.resolved] : [],\n ),\n );\n if (packages.size !== 1) return graph.config.site;\n const resolved = packages.values().next().value;\n if (!resolved) return graph.config.site;\n const separator = resolved.lastIndexOf(\"@\");\n if (separator <= 0 || separator === resolved.length - 1)\n return graph.config.site;\n return { ...graph.config.site, version: resolved.slice(separator + 1) };\n}\n\nfunction requestPath(url: string | undefined): string {\n try {\n return decodeURIComponent(new URL(url ?? \"/\", \"http://localhost\").pathname);\n } catch {\n return \"\";\n }\n}\n\nfunction assetContentType(pathname: string): string {\n switch (extname(pathname).toLowerCase()) {\n case \".avif\":\n return \"image/avif\";\n case \".gif\":\n return \"image/gif\";\n case \".jpeg\":\n case \".jpg\":\n return \"image/jpeg\";\n case \".png\":\n return \"image/png\";\n case \".svg\":\n return \"image/svg+xml\";\n case \".webp\":\n return \"image/webp\";\n default:\n return \"application/octet-stream\";\n }\n}\n\nfunction configureTastyTheme(\n theme: DocsConfig[\"theme\"],\n resolved: ReturnType<typeof resolveDocsTheme>,\n): void {\n const tokens = tastyTokens(resolved) as ConfigTokens;\n const globalStyles = resolveLegacyAnatomyStyles(theme?.styles);\n\n configure({\n states: {\n ...cookbookStates,\n ...theme?.states,\n },\n units: TASTY_UNITS,\n tokens,\n presets: resolved.presets as Record<string, TypographyPreset>,\n ...(globalStyles\n ? { globalStyles: globalStyles as Record<string, Styles> }\n : {}),\n });\n}\n\nfunction starlightSidebar(layout: ResolvedNavigationLayout): unknown[] {\n const fallback = layout.items?.length\n ? layout.items.map(starlightSidebarItem)\n : [{ autogenerate: { directory: \"\" } }];\n if (!layout.sectioned) return fallback;\n\n return [\n ...(layout.fallbackSidebarGroup !== undefined\n ? [\n {\n label: \"Documentation\",\n items: (layout.items ?? []).map(starlightSidebarItem),\n },\n ]\n : []),\n ...layout.tabs.flatMap((tab) =>\n tab.items !== undefined\n ? [{ label: tab.label, items: tab.items.map(starlightSidebarItem) }]\n : [],\n ),\n ];\n}\n\nfunction starlightSidebarItem(item: NavigationItem): unknown {\n if (typeof item === \"string\") return { slug: routeToSlug(item) };\n if (\"items\" in item) {\n return {\n label: item.label,\n items: item.items.map(starlightSidebarItem),\n };\n }\n if (\"autogenerate\" in item) {\n return {\n label: item.label,\n items: [\n {\n autogenerate: {\n directory: routeToSlug(item.autogenerate.directory, false),\n },\n },\n ],\n };\n }\n return { label: item.label, link: item.link };\n}\n\nfunction routeToSlug(route: string, rootAsIndex = true): string {\n const slug = route.replace(/^\\/+|\\/+$/g, \"\");\n return slug || (rootAsIndex ? \"index\" : \"\");\n}\n\nexport function tastyStarlight(\n config: Parameters<typeof starlight>[0],\n): AstroIntegration {\n return starlight(config);\n}\n\nasync function callInner<K extends keyof AstroIntegration[\"hooks\"]>(\n integrations: AstroIntegration[],\n hook: K,\n context: HookParameters<K>,\n): Promise<void> {\n for (const integration of integrations) {\n const handler = integration.hooks[hook];\n if (typeof handler === \"function\") {\n await (handler as (value: HookParameters<K>) => void | Promise<void>)(\n context,\n );\n }\n }\n}\n\nfunction withoutStarlightDocsRoute(\n context: HookParameters<\"astro:config:setup\">,\n): HookParameters<\"astro:config:setup\"> {\n return new Proxy(context, {\n get(target, property, receiver) {\n if (property !== \"injectRoute\") {\n return Reflect.get(target, property, receiver);\n }\n return (route: Parameters<typeof context.injectRoute>[0]) => {\n if (route.pattern !== \"[...slug]\") context.injectRoute(route);\n };\n },\n });\n}\n\nfunction virtualDocsPlugin(\n getContent: () => unknown | Promise<unknown>,\n layout: ResolvedNavigationLayout,\n) {\n const configId = \"\\0virtual:cookbook/config\";\n const layoutId = \"\\0virtual:cookbook/layout\";\n return {\n name: \"cookbook-data\",\n resolveId(id: string) {\n if (id === \"virtual:cookbook/config\") return configId;\n if (id === \"virtual:cookbook/layout\") return layoutId;\n return undefined;\n },\n async load(id: string) {\n if (id === configId) {\n return `export const content = ${JSON.stringify(await getContent())};`;\n }\n if (id === layoutId) {\n return `export const layout = ${JSON.stringify(layout)};`;\n }\n return undefined;\n },\n };\n}\n\nfunction hasContentConfig(srcDir: URL): boolean {\n const source = fileURLToPath(srcDir);\n return [\n \"content.config.ts\",\n \"content.config.mts\",\n \"content.config.js\",\n \"content.config.mjs\",\n \"content/config.ts\",\n ].some((path) => existsSync(join(source, path)));\n}\n"],"mappings":";;;;;;;;;;;;;AAMA,MAAa,uBAAuB;CAClC,MAAM;CACN,SAAS;CACT,gBAAgB;CAChB,iBAAiB;CACjB,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;CACjB,kBAAkB;CAClB,kBAAkB;CAClB,mBAAmB;AACrB;AAEA,MAAM,YACJ;AAIF,MAAa,6BAA+D;CAC1E,MAAM;EACJ,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,SAAS;EACP,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,IAAI,QAAQ,+BAA+B,MAAM,UAAU;CAC3D,IAAI,QAAQ,iCAAiC,KAAK,UAAU;CAC5D,IAAI,QAAQ,UAAU,MAAM,UAAU;CACtC,IAAI,QAAQ,WAAW,KAAK,UAAU;CACtC,IAAI,QAAQ,YAAY,MAAM,UAAU;CACxC,IAAI,QAAQ,QAAQ,KAAK,UAAU;CACnC,YAAY;EACV,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAAe;EACf,YAAY;EACZ,gBAAgB;CAClB;CACA,OAAO;EACL,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,eAA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AAU,CAAC,CAAC;AAC5E;AAEA,SAAS,UAAU,SAAuC;CACxD,MAAM,EAAE,GAAG,GAAG,MAAM,eAAe,OAAO;CAC1C,OAAO,+BACL,kBAAkB,GAAG,GAAG,GAAG,QAAQ,MAAM,CAC3C;AACF;;;ACnaA,MAAM,UAAU;AAChB,MAAM,cAAc;AACpB,MAAM,UAAU;AAChB,MAAM,SAAS;AACf,MAAM,QAAQ;AACd,MAAM,WAAW;AACjB,MAAM,SAAS;AACf,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,WAAW;AACjB,MAAM,aAAa;AACnB,MAAM,aAAa;;;;;AAMnB,MAAa,iBAAiB;CAC5B,MAAM;CACN,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,QAAQ;EACN,qBAAqB;EACrB,qBAAqB;CACvB;CACA,UAAU;EACR;GACE,OAAO;IACL;IACA;IACA;IACA;GACF;GACA,UAAU;IAAE,YAAY;IAAS,WAAW;GAAS;EACvD;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,QAAQ;EAClC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,OAAO;EACjC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,MAAM;EAChC;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,OAAO;EACjC;EACA;GACE,OAAO,CACL,oCACA,+BACF;GACA,UAAU,EAAE,YAAY,SAAS;EACnC;EACA;GACE,OAAO,CAAC,YAAY,gBAAgB;GACpC,UAAU,EAAE,WAAW;EACzB;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,UAAU,EAAE,YAAY,KAAK;EAC/B;EACA;GACE,OAAO;IACL;IACA;IACA;IACA;IACA;IACA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K;AAC9C;AAEA,SAAS,YAAY,OAAe,cAAc,MAAc;CAE9D,OADa,MAAM,QAAQ,cAAc,EAC/B,MAAM,cAAc,UAAU;AAC1C;AAEA,SAAgB,eACd,QACkB;CAClB,OAAO,UAAU,MAAM;AACzB;AAEA,eAAe,UACb,cACA,MACA,SACe;CACf,KAAK,MAAM,eAAe,cAAc;EACtC,MAAM,UAAU,YAAY,MAAM;EAClC,IAAI,OAAO,YAAY,YACrB,MAAO,QACL,OACF;CAEJ;AACF;AAEA,SAAS,0BACP,SACsC;CACtC,OAAO,IAAI,MAAM,SAAS,EACxB,IAAI,QAAQ,UAAU,UAAU;EAC9B,IAAI,aAAa,eACf,OAAO,QAAQ,IAAI,QAAQ,UAAU,QAAQ;EAE/C,QAAQ,UAAqD;GAC3D,IAAI,MAAM,YAAY,aAAa,QAAQ,YAAY,KAAK;EAC9D;CACF,EACF,CAAC;AACH;AAEA,SAAS,kBACP,YACA,QACA;CACA,MAAM,WAAW;CACjB,MAAM,WAAW;CACjB,OAAO;EACL,MAAM;EACN,UAAU,IAAY;GACpB,IAAI,OAAO,2BAA2B,OAAO;GAC7C,IAAI,OAAO,2BAA2B,OAAO;EAE/C;EACA,MAAM,KAAK,IAAY;GACrB,IAAI,OAAO,UACT,OAAO,0BAA0B,KAAK,UAAU,MAAM,WAAW,CAAC,EAAE;GAEtE,IAAI,OAAO,UACT,OAAO,yBAAyB,KAAK,UAAU,MAAM,EAAE;EAG3D;CACF;AACF;AAEA,SAAS,iBAAiB,QAAsB;CAC9C,MAAM,SAAS,cAAc,MAAM;CACnC,OAAO;EACL;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,MAAM,SAAS,WAAW,KAAK,QAAQ,IAAI,CAAC,CAAC;AACjD"}
|
|
@@ -8,14 +8,14 @@ import ThemeSelect from "virtual:starlight/components/ThemeSelect";
|
|
|
8
8
|
import { content } from "virtual:cookbook/config";
|
|
9
9
|
import { layout } from "virtual:cookbook/layout";
|
|
10
10
|
import { activeNavigationTab, navigationPath } from "../navigation.js";
|
|
11
|
+
import ContrastSelect from "../components/ContrastSelect.astro";
|
|
11
12
|
import GlobalStyles from "../components/GlobalStyles.js";
|
|
13
|
+
import Logo from "../components/Logo.astro";
|
|
12
14
|
import PackageVersion from "../components/PackageVersion.astro";
|
|
13
15
|
import {
|
|
14
16
|
StarlightHeaderRoot,
|
|
15
17
|
TopNavigationRoot,
|
|
16
18
|
} from "../components/LayoutComponents.js";
|
|
17
|
-
import "@fontsource-variable/onest/wght.css";
|
|
18
|
-
import "@fontsource-variable/jetbrains-mono/wght.css";
|
|
19
19
|
|
|
20
20
|
const shouldRenderSearch =
|
|
21
21
|
config.pagefind ||
|
|
@@ -36,6 +36,7 @@ function tabHref(link: string): string {
|
|
|
36
36
|
>
|
|
37
37
|
<div class="td-header__primary">
|
|
38
38
|
<div class="td-header__title">
|
|
39
|
+
<Logo class="td-header__logo" decorative />
|
|
39
40
|
<SiteTitle />
|
|
40
41
|
<PackageVersion version={content.site.version} />
|
|
41
42
|
</div>
|
|
@@ -48,6 +49,7 @@ function tabHref(link: string): string {
|
|
|
48
49
|
<div class="td-header__tools sl-hidden md:sl-flex print:hidden">
|
|
49
50
|
<div class="td-header__social"><SocialIcons /></div>
|
|
50
51
|
<ThemeSelect />
|
|
52
|
+
<ContrastSelect />
|
|
51
53
|
<LanguageSelect />
|
|
52
54
|
</div>
|
|
53
55
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import LanguageSelect from "virtual:starlight/components/LanguageSelect";
|
|
3
3
|
import SocialIcons from "virtual:starlight/components/SocialIcons";
|
|
4
|
+
import ContrastSelect from "../components/ContrastSelect.astro";
|
|
4
5
|
import { MobileMenuFooterRoot } from "../components/LayoutComponents.js";
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -11,5 +12,6 @@ import { MobileMenuFooterRoot } from "../components/LayoutComponents.js";
|
|
|
11
12
|
<div class="td-mobile-preferences__social">
|
|
12
13
|
<SocialIcons />
|
|
13
14
|
</div>
|
|
15
|
+
<ContrastSelect />
|
|
14
16
|
<LanguageSelect />
|
|
15
17
|
</MobileMenuFooterRoot>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenphi/starlight",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Astro and Starlight renderer for Cookbook",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@astrojs/starlight": "^0.41.10",
|
|
50
50
|
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
|
51
51
|
"@fontsource-variable/onest": "^5.3.0",
|
|
52
|
-
"@tenphi/docs": "0.
|
|
52
|
+
"@tenphi/docs": "0.7.0",
|
|
53
53
|
"@tenphi/glaze": "2.0.0",
|
|
54
54
|
"@tenphi/tasty": "3.6.0",
|
|
55
55
|
"react": "^18.3.1 || ^19.0.0",
|