@takazudo/zudo-doc 3.2.0 → 3.3.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 (48) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/chrome/derive.d.ts +7 -1
  3. package/dist/chrome/derive.js +13 -2
  4. package/dist/chrome-bindings.d.ts +159 -0
  5. package/dist/chrome-bindings.js +6 -0
  6. package/dist/color-scheme-utils.d.ts +1 -1
  7. package/dist/color-schemes-defaults/index.d.ts +23 -0
  8. package/dist/color-schemes-defaults/index.js +121 -0
  9. package/dist/config.d.ts +443 -0
  10. package/dist/config.js +116 -0
  11. package/dist/design-token-panel-bootstrap.d.ts +57 -7
  12. package/dist/design-token-panel-bootstrap.js +12 -0
  13. package/dist/design-token-panel-config/index.d.ts +49 -0
  14. package/dist/design-token-panel-config/index.js +214 -0
  15. package/dist/design-token-panel-config/manifest.d.ts +46 -0
  16. package/dist/design-token-panel-config/manifest.js +105 -0
  17. package/dist/directive-vocabulary-defaults/index.d.ts +16 -0
  18. package/dist/directive-vocabulary-defaults/index.js +12 -0
  19. package/dist/doc-body-end-islands/index.d.ts +30 -7
  20. package/dist/doc-body-end-islands/index.js +27 -0
  21. package/dist/docs-schema/index.d.ts +67 -0
  22. package/dist/docs-schema/index.js +47 -0
  23. package/dist/factory-context/index.d.ts +14 -0
  24. package/dist/features.css +10 -0
  25. package/dist/find-in-page/find-bar.d.ts +9 -0
  26. package/dist/find-in-page/find-bar.js +114 -0
  27. package/dist/find-in-page/find-in-page.d.ts +17 -0
  28. package/dist/find-in-page/find-in-page.js +131 -0
  29. package/dist/find-in-page/index.d.ts +11 -0
  30. package/dist/find-in-page/index.js +49 -0
  31. package/dist/frontmatter-preview-defaults/index.d.ts +16 -0
  32. package/dist/frontmatter-preview-defaults/index.js +25 -0
  33. package/dist/i18n-defaults/index.d.ts +22 -0
  34. package/dist/i18n-defaults/index.js +167 -0
  35. package/dist/plugins/routes.js +44 -20
  36. package/dist/preset.d.ts +9 -0
  37. package/dist/routes/_chrome.js +2 -1
  38. package/dist/safelist.css +1 -1
  39. package/dist/settings.d.ts +37 -0
  40. package/dist/theme.css +319 -0
  41. package/dist/z-index-defaults/index.d.ts +45 -0
  42. package/dist/z-index-defaults/index.js +34 -0
  43. package/package.json +50 -3
  44. package/routes-src/_chrome.tsx +30 -8
  45. package/routes-src/_virtual.d.ts +34 -2
  46. package/tsconfig.base.json +29 -0
  47. package/virtual-modules.d.ts +79 -0
  48. package/zfb-config-shim.d.ts +188 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,35 @@ All notable changes to `@takazudo/zudo-doc` are documented in this file.
4
4
 
5
5
  The format is based on Keep a Changelog, and release notes are generated from the changelog MDX pages.
6
6
 
7
+ ## [3.3.0] - 2026-07-12
8
+
9
+ ### Features
10
+
11
+ - **Minimal Scaffold (epic #2651).** `create-zudo-doc` now emits a locked ~12-file minimal manifest — a generated project is one config file (`zfb.config.ts` using the diff-from-defaults `zudoDoc({...})`) plus Markdown content, extended via eject. The package now owns the defaults that were previously copied into every scaffold: default `@theme` tokens ship as `@takazudo/zudo-doc/theme.css`, and i18n, color schemes, docs schema, z-index, frontmatter-preview, and directives ship as package-default data modules. (98a56931, 257fa9aa, 5f45bf15, 2056824f)
12
+ - Added the `zudoDoc()` single-entry config API returning a full `ZfbConfig`; the showcase and generated scaffolds migrate their `zfb.config.ts` and the four doc-route stubs to the self-contained form. (a06f5990, 1fc470f0, 6e4a6d08)
13
+ - Added the `defineChromeBindings` widening adapter — a typed helper that replaces chrome-binding casts; the generator now injects it instead of a `DocHistory` cast. (5915707b, aa29e479, 0e49a6ad)
14
+ - Absorbed the Tauri find-in-page island (Cmd/Ctrl+F find bar) into `@takazudo/zudo-doc/find-in-page`, mounted from the package's body-end islands behind a new `findInPage` setting (default `false`). The island self-gates on `window.__TAURI_INTERNALS__`, so it stays a safe no-op outside a Tauri shell. `create-zudo-doc`'s tauri feature now emits `findInPage: true` for generated Tauri scaffolds. (97885c5d, cc1bc846, f5e4c953)
15
+ - Added a package-owned `DesignTokenPanelBootstrap` island, mounted from the package's routes. (5f75a9ed, 105a3b40)
16
+ - The package now ships `tsconfig.base`, a `zfb-config` shim, and generated virtual-module types. (3de2b209)
17
+
18
+ ### Bug Fixes
19
+
20
+ - Corrected the `create-zudo-doc` Node engine floor and documented the built-in MDX components (#2702, #2703). (edf5cc4f)
21
+ - Exported the `./find-in-page` subpath so hosts can mount `FindInPageInit`. (a4c4f8e5)
22
+ - Stopped the generator dropping unlisted config keys and guarded `DEFAULT_MIRROR` drift. (ac0c6afa)
23
+ - The i18n locale doc stub now threads `isFallback` and a per-locale content directory. (8355e537)
24
+ - Routed package-manager script commands through a single `pmRunCommand` helper. (cb88bde6)
25
+ - Made the `pages` typecheck project Preact-native. (a24dfef4)
26
+ - Warn on a missing color scheme, and clarified the `zudoDoc` shallow-merge docs. (8f913319)
27
+ - Tightened `frontmatterRenderers`/`buildFrontmatterPreviewEntries` slot types so drift is detected for real. (d9d9b828)
28
+ - Fixed the default header chrome background. (f0245086)
29
+
30
+ ### Other Changes
31
+
32
+ - Retired `packages/md-plugins` and dropped the showcase Design Token Panel config copy in favor of the package default. (e99ebe7d, c74c481a)
33
+ - Patched transitive security advisories via pnpm overrides and bumped `@takazudo/zdtp` 0.4.5 → 0.4.6. (24013cd1, 731c8677)
34
+ - Rewrote the core structure docs for the minimal→extend model (EN + JA). (f57d092e)
35
+
7
36
  ## [3.2.0] - 2026-07-08
8
37
 
9
38
  ### Features
@@ -47,7 +47,13 @@ export declare function deriveSearchWidgetSlot(ctx: ChromeContext): (props: {
47
47
  noResultsText: string;
48
48
  }) => JSX.Element;
49
49
  /** Derive the body-end islands: `ctx.hostBindings.BodyEndIslands` when supplied,
50
- * else the package-island subset reconstructed from `settings`. */
50
+ * else the package-island subset reconstructed from `settings`. The design-
51
+ * token-panel bootstrap slot defaults to the PACKAGE-DEFAULT
52
+ * `DesignTokenPanelBootstrap` island (statically imported above — #2658
53
+ * gate-2 fix, Wave-5 confirm #2659) so a bare `createChrome(routeCtx)` call
54
+ * (the locked-manifest self-contained doc stub, #2653) still mounts the
55
+ * settings-gated panel; `ctx.hostBindings.DesignTokenPanelBootstrap`
56
+ * overrides it when a host supplies its own. */
51
57
  export declare function deriveBodyEndIslands(ctx: ChromeContext): ReturnType<typeof createBodyEndIslands>;
52
58
  /** Derive the DocHistory island: `ctx.hostBindings.DocHistory` when supplied,
53
59
  * else the package no-op stub. */
@@ -6,6 +6,7 @@ import {
6
6
  SEMANTIC_RAMP_DEFAULTS
7
7
  } from "../color-scheme-utils.js";
8
8
  import { createBodyEndIslands } from "../doc-body-end-islands/index.js";
9
+ import { DesignTokenPanelBootstrap } from "../design-token-panel-bootstrap.js";
9
10
  import { SearchWidget } from "../search-widget/index.js";
10
11
  import { createMdxComponents } from "../mdx-components/index.js";
11
12
  import { createCategoryNavWrapper } from "../category-nav/index.js";
@@ -64,7 +65,14 @@ function deriveComposeMetaTitle(ctx) {
64
65
  }
65
66
  function resolveHostScheme(ctx, key) {
66
67
  if (!ctx.colorSchemes) return DEFAULT_SCHEME;
67
- return ctx.colorSchemes[key] ?? DEFAULT_SCHEME;
68
+ const scheme = ctx.colorSchemes[key];
69
+ if (!scheme) {
70
+ console.warn(
71
+ `[zudo-doc] color scheme "${key}" not found in the configured colorSchemes \u2014 falling back to the neutral default scheme. Available schemes: ${Object.keys(ctx.colorSchemes).join(", ") || "(none)"}`
72
+ );
73
+ return DEFAULT_SCHEME;
74
+ }
75
+ return scheme;
68
76
  }
69
77
  function deriveColorSchemeGenerators(ctx) {
70
78
  return {
@@ -139,7 +147,10 @@ function deriveSearchWidgetSlot(ctx) {
139
147
  return ctx.hostBindings.SearchWidget ?? SearchWidgetBound;
140
148
  }
141
149
  function deriveBodyEndIslands(ctx) {
142
- return ctx.hostBindings.BodyEndIslands ?? createBodyEndIslands({ settings: ctx.settings });
150
+ return ctx.hostBindings.BodyEndIslands ?? createBodyEndIslands({
151
+ settings: ctx.settings,
152
+ DesignTokenPanelBootstrap: ctx.hostBindings.DesignTokenPanelBootstrap ?? DesignTokenPanelBootstrap
153
+ });
143
154
  }
144
155
  function deriveDocHistorySlot(ctx) {
145
156
  return ctx.hostBindings.DocHistory ?? DocHistoryStub;
@@ -0,0 +1,159 @@
1
+ import type { ChromeHostBindings } from "./factory-context/index.js";
2
+ /**
3
+ * Props the header passes to the `SearchWidget` slot — the 7 locale-aware
4
+ * strings from `header-with-defaults`'s `<SearchWidget … />` render (via
5
+ * `deriveSearchWidgetSlot`'s `SearchWidgetBound`, `chrome/derive.tsx`). NOTE
6
+ * the package's own `SearchWidget` also takes `base`, but the chrome binds that
7
+ * internally — a host-supplied widget is called with these 7 props ONLY, so
8
+ * requiring `base` here would (correctly) be drift.
9
+ */
10
+ export interface SearchWidgetSlotProps {
11
+ placeholderText: string;
12
+ shortcutHint: string;
13
+ resultCountTemplate: string;
14
+ searchLabel: string;
15
+ searchUnavailableText: string;
16
+ loadingIndexText: string;
17
+ noResultsText: string;
18
+ }
19
+ /**
20
+ * Props the chrome passes to the `BodyEndIslands` slot — matches
21
+ * `BodyEndIslandsProps` (`doc-body-end-islands`); called as
22
+ * `<BodyEndIslands basePath={…} />` in `home-page` / `doc-body-end`.
23
+ */
24
+ export interface BodyEndIslandsSlotProps {
25
+ basePath: string;
26
+ aiChatBodyLabel?: string;
27
+ }
28
+ /**
29
+ * Props the chrome passes to the `DocHistory` island slot — matches
30
+ * `DocHistoryProps` (`doc-history/index.tsx`) / `DocHistoryComponent`
31
+ * (`doc-history-area`), rendered as
32
+ * `<DocHistory slug=… locale=… basePath=… />`.
33
+ */
34
+ export interface DocHistorySlotProps {
35
+ slug: string;
36
+ locale?: string;
37
+ basePath?: string;
38
+ }
39
+ /**
40
+ * Props the chrome passes to the `DesignTokenPanelBootstrap` slot — NONE. It is
41
+ * rendered as `<DesignTokenPanelBootstrap />` (zero props) inside
42
+ * `createBodyEndIslands`. An empty object type (no index signature) so a
43
+ * zero-prop or all-optional-prop component is accepted while a component that
44
+ * REQUIRES any prop is drift.
45
+ */
46
+ export type DesignTokenPanelBootstrapSlotProps = Record<never, never>;
47
+ /**
48
+ * One footer tag entry the `loadTagsForLocale` result is read for —
49
+ * `footer-with-defaults` maps over the array reading `{ tag, count }`. The
50
+ * return contract is a `readonly` array of these (extra per-entry fields, e.g.
51
+ * the `docs` on `collectTags`' `TagInfo`, are allowed — a supertype element).
52
+ */
53
+ export interface FooterTagEntry {
54
+ tag: string;
55
+ count: number;
56
+ }
57
+ /**
58
+ * Props the chrome passes to each `frontmatterRenderers[key]` renderer —
59
+ * mirrors `FrontmatterCellRendererProps` at the real call site
60
+ * (`metainfo/frontmatter-preview.tsx`: `rendererFn({ value, entryKey, data,
61
+ * locale })`). A provided renderer's parameter must be a SUPERTYPE of this (it
62
+ * may read a subset), so a renderer REQUIRING a prop the chrome never passes is
63
+ * a compile error — the #2674 drift check this slot would otherwise erase.
64
+ */
65
+ export interface FrontmatterRendererSlotProps {
66
+ value: NonNullable<unknown>;
67
+ entryKey: string;
68
+ data: Record<string, unknown>;
69
+ locale?: string;
70
+ }
71
+ /**
72
+ * The compile-time-checked input for {@link defineChromeBindings}. See the
73
+ * module header for the drift-detection rationale.
74
+ */
75
+ export interface ChromeBindingsInput {
76
+ /** Header search widget — see {@link SearchWidgetSlotProps}. */
77
+ SearchWidget?: (props: SearchWidgetSlotProps) => unknown;
78
+ /** Body-end bootstrap islands — see {@link BodyEndIslandsSlotProps}. */
79
+ BodyEndIslands?: (props: BodyEndIslandsSlotProps) => unknown;
80
+ /** DocHistory island — see {@link DocHistorySlotProps}. */
81
+ DocHistory?: (props: DocHistorySlotProps) => unknown;
82
+ /** Design-token-panel bootstrap island — see {@link DesignTokenPanelBootstrapSlotProps}. */
83
+ DesignTokenPanelBootstrap?: (props: DesignTokenPanelBootstrapSlotProps) => unknown;
84
+ /**
85
+ * Per-page git-history meta manifest (data slot). Read as
86
+ * `Record<string, DocHistoryMetaEntry>` inside `doc-metainfo-area` /
87
+ * `doc-history-area`; the loose `Record<string, unknown>` is the boundary shape.
88
+ */
89
+ docHistoryMeta?: Record<string, unknown>;
90
+ /**
91
+ * Sidebar section config (opaque data blob — the chrome casts it to `never`
92
+ * before handing it to `buildSidebarForSection`). Typed `object` NOT
93
+ * `Record<string, unknown>` on purpose: a concrete interface-typed sidebars
94
+ * object (no index signature) must be accepted WITHOUT a cast.
95
+ */
96
+ sidebarsConfig?: object;
97
+ /** Footer tag vocabulary (data slot); read structurally by `footer-with-defaults`. */
98
+ tagVocabulary?: readonly unknown[];
99
+ /**
100
+ * Frontmatter preview renderers keyed by field (renderer record). Each value
101
+ * must be callable with {@link FrontmatterRendererSlotProps} (the fixed
102
+ * package call-side contract), so a non-function or a renderer requiring an
103
+ * unpassed prop is a compile error. Narrow-props renderers still work
104
+ * (parameter contravariance). Unlike `mdxExtras`, this slot has a fixed call
105
+ * site, so it carries the real contract rather than a loose `Record`.
106
+ */
107
+ frontmatterRenderers?: Record<string, (props: FrontmatterRendererSlotProps) => unknown>;
108
+ /**
109
+ * MDX content-component overrides (renderer record). Same loose value type as
110
+ * `frontmatterRenderers`; the showcase's `MdxStub = (_props: unknown) => null`
111
+ * is accepted deliberately (`unknown` props are a safe supertype).
112
+ */
113
+ mdxExtras?: Record<string, unknown>;
114
+ /**
115
+ * Frontmatter preview entry builder. `doc-content-header` calls it with the
116
+ * page `data` (`Record<string, unknown>`) and spreads the result into
117
+ * `<FrontmatterPreview entries={…} />`, which destructures each entry as
118
+ * `[key, value]` — so the return must be an array of `[string, unknown]`
119
+ * tuples, not merely an array.
120
+ */
121
+ buildFrontmatterPreviewEntries?: (data: Record<string, unknown>) => readonly (readonly [string, unknown])[];
122
+ /**
123
+ * Footer tag-list loader. `footer-with-defaults` calls it with the locale and
124
+ * maps the result reading `{ tag, count }` — see {@link FooterTagEntry}.
125
+ * A wrong return type (e.g. a non-array) is a compile error.
126
+ */
127
+ loadTagsForLocale?: (lang: string) => readonly FooterTagEntry[];
128
+ /**
129
+ * Extra content rendered inside the doc content header. An arg-object
130
+ * RENDERER — the `ChromeHostBindings` type is already call-side-precise, so
131
+ * reuse it verbatim (no widening friction).
132
+ */
133
+ docContentHeaderExtras?: ChromeHostBindings["docContentHeaderExtras"];
134
+ /**
135
+ * Extra content rendered in the home hero. An arg-object RENDERER — reuse the
136
+ * already call-side-precise `ChromeHostBindings` type verbatim.
137
+ */
138
+ homeExtras?: ChromeHostBindings["homeExtras"];
139
+ }
140
+ /**
141
+ * Reject unknown slot names. Generic inference (below) turns OFF the
142
+ * excess-property check that a plain `input: ChromeBindingsInput` parameter
143
+ * would get for an object literal, so re-impose it explicitly: any key of `T`
144
+ * that is NOT a `ChromeBindingsInput` slot is mapped to `never`, making a real
145
+ * value for it fail to assign.
146
+ */
147
+ type NoExtraKeys<T> = ChromeBindingsInput & Record<Exclude<keyof T, keyof ChromeBindingsInput>, never>;
148
+ /**
149
+ * Widen a compile-time-checked host bindings object to `ChromeHostBindings`.
150
+ *
151
+ * The generic `T` captures the caller's exact object so {@link NoExtraKeys}
152
+ * can reject unknown slot names; `T extends ChromeBindingsInput` enforces every
153
+ * slot's per-call-site contract (a component requiring a prop the chrome never
154
+ * passes, or a function slot with an incompatible return type, is a COMPILE
155
+ * ERROR). Runtime behaviour is pure PASS-THROUGH — the returned object IS the
156
+ * input.
157
+ */
158
+ export declare function defineChromeBindings<T extends ChromeBindingsInput>(input: T & NoExtraKeys<T>): ChromeHostBindings;
159
+ export {};
@@ -0,0 +1,6 @@
1
+ function defineChromeBindings(input) {
2
+ return input;
3
+ }
4
+ export {
5
+ defineChromeBindings
6
+ };
@@ -115,7 +115,7 @@ export interface TierItem {
115
115
  *
116
116
  * Always the explicit form (independent of `referencesRamps` declaration
117
117
  * order) — see item-id contract in `buildRampTiers`
118
- * (`src/config/design-token-panel-config.ts`): tier ids `base`/`accent`/`state`,
118
+ * (`./design-token-panel-config/index.ts`): tier ids `base`/`accent`/`state`,
119
119
  * item ids `base-0..4`/`accent-0..2`/`state-{danger,success,warning,info}`.
120
120
  */
121
121
  export declare function rampRefToPanelDefault(ref: RampRef): string;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Default color schemes — Default Light + Default Dark.
3
+ *
4
+ * Ported verbatim from the `create-zudo-doc` base template's
5
+ * `src/config/color-schemes.ts` `colorSchemes` export (epic
6
+ * zudolab/zudo-doc#2651, S4 #2654), so a generated project needs no
7
+ * color-schemes config file of its own.
8
+ *
9
+ * Ramp-native model (Color Ramp Restructure — zudolab/zudo-doc#2584;
10
+ * minimized to 5/3 in #2602). A `ColorScheme` is `{ ramps, map }` — the
11
+ * MECHANISM type is owned by `@takazudo/zudo-doc/color-scheme-utils` and is
12
+ * reused here, not re-declared:
13
+ * - `ramps` — the shared Tier-1 source of truth: a warm-neutral `base` ramp
14
+ * (5 stops, index 0 = lightest), an `accent` ramp (3 stops), and 4 `state`
15
+ * colors. Light and dark modes SHARE these values.
16
+ * - `map` — the per-mode Tier-2 wiring: which ramp stop (or literal OKLCH)
17
+ * each UI role points at.
18
+ *
19
+ * A project's `ZudoDocConfig.colorSchemes` override is merged over this
20
+ * default by `zudoDoc()` (#2657).
21
+ */
22
+ import type { ColorScheme } from "../color-scheme-utils.js";
23
+ export declare const defaultColorSchemes: Record<string, ColorScheme>;
@@ -0,0 +1,121 @@
1
+ const ramps = {
2
+ base: [
3
+ "oklch(.965 .004 65)",
4
+ // 0 — lightest (light bg / dark fg)
5
+ "oklch(.705 .008 65)",
6
+ // 1 — dark muted / light selection & mermaid fill
7
+ "oklch(.480 .008 65)",
8
+ // 2 — light muted / dark selection & mermaid note
9
+ "oklch(.300 .006 65)",
10
+ // 3 — dark codeBg / mermaid fill
11
+ "oklch(.185 .005 65)"
12
+ // 4 — darkest (dark bg / light fg)
13
+ ],
14
+ accent: [
15
+ "oklch(.755 .130 64)",
16
+ // 0 — dark hover (was accent2)
17
+ "oklch(.700 .158 62)",
18
+ // 1 — dark accent (was accent3)
19
+ "oklch(.470 .120 56)"
20
+ // 2 — light accent (was accent6)
21
+ ],
22
+ state: {
23
+ danger: "oklch(.640 .170 25)",
24
+ success: "oklch(.680 .145 145)",
25
+ warning: "oklch(.760 .135 82)",
26
+ info: "oklch(.680 .130 245)"
27
+ }
28
+ };
29
+ const darkMap = {
30
+ bg: { base: 4 },
31
+ fg: { base: 0 },
32
+ selectionBg: { base: 2 },
33
+ selectionFg: { base: 0 },
34
+ semantic: {
35
+ // Merged onto bg (b4) — elevated panels read as page-bg + border, no gray fill.
36
+ surface: { base: 4 },
37
+ muted: { base: 1 },
38
+ accent: { accent: 1 },
39
+ accentHover: { accent: 0 },
40
+ codeBg: { base: 3 },
41
+ codeFg: { base: 0 },
42
+ success: { state: "success" },
43
+ // Per-mode AA-tuned literal — shared state.danger oklch(.640 .170 25) is too
44
+ // dark for the danger-admonition title on its 12%-tint dark bg. L .640→.655
45
+ // (H/C fixed) — admonition-danger at threshold+0.1; carried from #2593.
46
+ danger: "oklch(.655 .170 25)",
47
+ warning: { state: "warning" },
48
+ info: { state: "info" },
49
+ mermaidNodeBg: { base: 3 },
50
+ mermaidText: { base: 0 },
51
+ mermaidLine: { base: 1 },
52
+ mermaidLabelBg: { base: 3 },
53
+ mermaidNoteBg: { base: 2 },
54
+ chatUserBg: { accent: 1 },
55
+ chatUserText: { base: 4 },
56
+ // Merged onto bg (b4) — the chat assistant bubble reads as page-bg + border.
57
+ chatAssistantBg: { base: 4 },
58
+ chatAssistantText: { base: 0 },
59
+ imageOverlayBg: { base: 4 },
60
+ imageOverlayFg: { base: 0 },
61
+ // Search-result <mark> highlight: an amber (accent-hue) fill with dark text —
62
+ // the classic highlighter look, identical in both modes. Kept as literals so
63
+ // the amber fill is scheme-stable; matchedKeywordFg dark so text clears AA on
64
+ // the amber bg — matched-keyword at threshold+0.1; carried from #2593.
65
+ matchedKeywordBg: "oklch(.700 .158 62)",
66
+ matchedKeywordFg: "oklch(.300 .003 65)"
67
+ }
68
+ };
69
+ const lightMap = {
70
+ bg: { base: 0 },
71
+ fg: { base: 4 },
72
+ selectionBg: { base: 1 },
73
+ selectionFg: { base: 4 },
74
+ semantic: {
75
+ // Merged onto bg (b0) — elevated panels read as page-bg + border, no gray fill.
76
+ surface: { base: 0 },
77
+ muted: { base: 2 },
78
+ accent: { accent: 2 },
79
+ // Light: per-mode literal — the accent ramp has no stop darker than accent2,
80
+ // so the link-hover state darkens further (hover-darkens-on-light
81
+ // convention). L .400, C fitted to the sRGB gamut edge at that L; carried
82
+ // from #2595. accent-hover-vs-bg clears threshold+0.1.
83
+ accentHover: "oklch(.400 .096 56)",
84
+ // Merged onto bg (b0) — inline/code-block fill reads as page-bg + border.
85
+ codeBg: { base: 0 },
86
+ codeFg: { base: 4 },
87
+ // Light: per-mode literals — the shared state colors are authored for a dark
88
+ // bg and are too light on the 12%-tint admonition backgrounds over a light
89
+ // page bg. Each darkened (H fixed; C at gamut max, clipped where noted) to
90
+ // clear its admonition pair at threshold+0.1; carried from #2595.
91
+ success: "oklch(.470 .140 145)",
92
+ danger: "oklch(.505 .170 25)",
93
+ warning: "oklch(.490 .100 82)",
94
+ // C .135→.100 (gamut-clips at this L)
95
+ info: "oklch(.485 .122 245)",
96
+ mermaidNodeBg: { base: 1 },
97
+ mermaidText: { base: 4 },
98
+ mermaidLine: { base: 2 },
99
+ mermaidLabelBg: { base: 1 },
100
+ mermaidNoteBg: { base: 1 },
101
+ chatUserBg: { accent: 1 },
102
+ // Dark text on the amber user bubble (matches Default Dark).
103
+ chatUserText: { base: 4 },
104
+ // Merged onto bg (b0) — the chat assistant bubble reads as page-bg + border.
105
+ chatAssistantBg: { base: 0 },
106
+ chatAssistantText: { base: 4 },
107
+ imageOverlayBg: { base: 4 },
108
+ imageOverlayFg: { base: 0 },
109
+ // Search-result <mark>: amber highlighter fill with dark text — same look as
110
+ // Default Dark (an amber-on-white highlight reads identically in both modes).
111
+ matchedKeywordBg: "oklch(.700 .158 62)",
112
+ matchedKeywordFg: "oklch(.300 .003 65)"
113
+ }
114
+ };
115
+ const defaultColorSchemes = {
116
+ "Default Light": { ramps, map: lightMap },
117
+ "Default Dark": { ramps, map: darkMap }
118
+ };
119
+ export {
120
+ defaultColorSchemes
121
+ };