@designtools/docs 0.2.2 → 0.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 (58) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +27 -3
  3. package/dist/adherence-summary.js +2 -2
  4. package/dist/anatomy.d.ts +6 -2
  5. package/dist/anatomy.js +3 -2
  6. package/dist/glossary.d.ts +1 -1
  7. package/dist/glossary.js +3 -8
  8. package/dist/lib/adherence-types.d.ts +2 -0
  9. package/dist/lib/colour.d.ts +16 -0
  10. package/dist/lib/colour.js +99 -0
  11. package/dist/lib/contrast.js +1 -7
  12. package/dist/lib/design-md.d.ts +27 -0
  13. package/dist/lib/design-md.js +176 -0
  14. package/dist/lib/markdown.js +1 -0
  15. package/dist/lib/terms.d.ts +1 -1
  16. package/dist/lib/terms.js +1 -1
  17. package/dist/lib/wrap.d.ts +5 -0
  18. package/dist/lib/wrap.js +5 -0
  19. package/dist/logo-usage.js +3 -3
  20. package/dist/next/config.d.ts +9 -0
  21. package/dist/next/markdown.d.ts +1 -1
  22. package/dist/next/markdown.js +15 -1
  23. package/dist/next/pages.js +5 -12
  24. package/dist/next/proxy.js +3 -2
  25. package/dist/page-actions.d.ts +2 -1
  26. package/dist/page-actions.js +4 -3
  27. package/dist/playground.js +1 -1
  28. package/dist/shell.js +6 -4
  29. package/dist/standards.js +1 -1
  30. package/dist/styles.css +65 -43
  31. package/dist/type-ramp.js +1 -1
  32. package/dist/variant-matrix.d.ts +6 -2
  33. package/dist/variant-matrix.js +3 -2
  34. package/dist/workbench.js +3 -2
  35. package/package.json +1 -1
  36. package/src/adherence-summary.tsx +7 -2
  37. package/src/anatomy.tsx +6 -4
  38. package/src/glossary.tsx +10 -22
  39. package/src/lib/adherence-types.ts +2 -0
  40. package/src/lib/colour.ts +104 -0
  41. package/src/lib/contrast.ts +2 -8
  42. package/src/lib/design-md.ts +193 -0
  43. package/src/lib/markdown.ts +1 -0
  44. package/src/lib/terms.tsx +1 -1
  45. package/src/lib/wrap.tsx +6 -0
  46. package/src/logo-usage.tsx +20 -12
  47. package/src/next/config.ts +7 -0
  48. package/src/next/markdown.ts +16 -1
  49. package/src/next/pages.tsx +21 -20
  50. package/src/next/proxy.ts +3 -2
  51. package/src/page-actions.tsx +10 -2
  52. package/src/playground.tsx +2 -2
  53. package/src/shell.tsx +6 -4
  54. package/src/standards.tsx +2 -2
  55. package/src/styles.css +9 -8
  56. package/src/type-ramp.tsx +3 -6
  57. package/src/variant-matrix.tsx +11 -4
  58. package/src/workbench.tsx +2 -1
@@ -20,7 +20,7 @@ export function LogoUsage({ assets, rules = [], rulesHref }) {
20
20
  return _jsx("p", { className: "text-sm text-muted-foreground", children: "No logos in the brand folder yet." });
21
21
  const brand = rules.filter((r) => r.kind === "brand");
22
22
  const general = brand.filter((r) => (r.appliesTo ?? []).some((x) => ["logo", "logos"].includes(x.toLowerCase())));
23
- return (_jsxs("div", { "data-slot": "logo-usage", className: "flex flex-col gap-16", children: [general.length > 0 && _jsx(RuleList, { rules: general, rulesHref: rulesHref }), logos.map((logo) => {
23
+ return (_jsxs("div", { "data-slot": "logo-usage", className: "flex flex-col gap-16 lg:gap-24", children: [logos.map((logo) => {
24
24
  const src = lookup.assetUrl(logo);
25
25
  const names = new Set([logo.name.toLowerCase(), logo.file.toLowerCase()]);
26
26
  const own = brand.filter((r) => !general.includes(r) && (r.appliesTo ?? []).some((x) => names.has(x.toLowerCase())));
@@ -38,8 +38,8 @@ export function LogoUsage({ assets, rules = [], rulesHref }) {
38
38
  if (logo.width && logo.height)
39
39
  facts.push(["Proportions", _jsxs("span", { className: "font-mono text-xs", children: [logo.width, " \u00D7 ", logo.height] }, "p")]);
40
40
  return (_jsxs("section", { "data-slot": "logo", className: "flex flex-col gap-5", children: [_jsxs("header", { className: "flex flex-col gap-1.5", children: [_jsx("h3", { className: "text-3xl tracking-tight", children: logo.name }), logo.usage && _jsx("p", { className: "max-w-2xl text-base text-muted-foreground", children: inline(logo.usage) })] }), _jsxs("div", { className: "grid gap-3 lg:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]", children: [_jsxs("div", { "data-slot": "logo-surface", "data-theme": "light", className: "relative flex min-h-72 items-center justify-center overflow-hidden rounded-2xl border border-border p-10", style: paint(surfaces[0]), children: [_jsx("span", { className: "absolute top-4 left-4 font-mono text-xs opacity-70", children: surfaces[0] }), _jsxs("span", { className: "relative inline-flex", children: [_jsx("span", { "data-slot": "logo-clear-space", className: "inline-flex border border-dashed", style: { padding: clear ? `calc(${clear[1]}${clear[2]} * 2)` : "1.5rem", borderColor: "color-mix(in oklch, currentColor 45%, transparent)" }, title: `Clear space: ${logo.clearSpace ?? "not set"}`, children: src ? _jsx("img", { src: src, alt: logo.alt ?? logo.name, className: "block h-16 w-auto sm:h-20" }) : _jsx("span", { className: "text-xs", children: logo.file }) }), clear && (_jsx("span", { className: "absolute -bottom-6 left-1/2 -translate-x-1/2 font-mono text-xs whitespace-nowrap opacity-70", children: "clear space, shown at 2\u00D7" }))] })] }), _jsxs("ul", { className: "grid grid-cols-2 gap-3 lg:grid-cols-1 lg:grid-rows-3", children: [surfaces.slice(1).map((surface) => (_jsxs("li", { "data-slot": "logo-surface", "data-theme": "light", className: "relative flex min-h-28 items-center justify-center rounded-2xl border border-border p-6", style: paint(surface), children: [_jsx("span", { className: "absolute top-3 left-3 font-mono text-xs opacity-70", children: surface }), src && _jsx("img", { src: src, alt: "", "aria-hidden": true, className: "block h-9 w-auto" })] }, surface))), surfaces.length === 1 && (_jsxs("li", { className: "col-span-2 flex items-center rounded-2xl border border-dashed border-border p-6 text-sm text-muted-foreground lg:col-span-1 lg:row-span-3", children: ["Only on ", surfaces[0], "."] }))] })] }), _jsx("dl", { className: "grid gap-x-10 gap-y-5 sm:grid-cols-3", children: facts.map(([term, detail]) => (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("dt", { className: "text-xs font-medium text-muted-foreground", children: term }), _jsx("dd", { className: "text-sm", children: detail })] }, term))) }), own.length > 0 && _jsx(RuleList, { rules: own, rulesHref: rulesHref })] }, logo.file));
41
- })] }));
41
+ }), general.length > 0 && (_jsxs("section", { "data-slot": "logo-rules", "aria-labelledby": "logo-rules", className: "flex flex-col gap-5", children: [_jsxs("header", { className: "flex flex-col gap-1.5", children: [_jsx("h3", { id: "logo-rules", className: "text-3xl tracking-tight", children: "Rules for the logo" }), _jsx("p", { className: "max-w-2xl text-base text-muted-foreground", children: "What holds for every logo above, each with how it is checked." })] }), _jsx(RuleList, { rules: general, rulesHref: rulesHref })] }))] }));
42
42
  }
43
43
  function RuleList({ rules, rulesHref }) {
44
- return (_jsx("ul", { "data-slot": "logo-rules", className: "grid gap-x-12 sm:grid-cols-2", children: rules.map((r) => (_jsx("li", { className: "border-t border-border", children: _jsxs("a", { href: rulesHref ? `${rulesHref}#${r.id}` : `#${r.id}`, className: "group flex h-full flex-col gap-1.5 py-4 text-sm focus-visible:outline-2 focus-visible:outline-ring", children: [_jsxs("span", { className: "flex items-center justify-between gap-2", children: [_jsxs("span", { className: "flex items-center gap-2 text-base font-medium group-hover:underline group-hover:underline-offset-4", children: [_jsx(Scale, { "aria-hidden": true, className: "size-(--dt-size-xs) text-muted-foreground" }), r.title] }), _jsx(StatusBadge, { status: r.status })] }), _jsx("span", { className: "text-muted-foreground", children: inline(r.statement) })] }) }, r.id))) }));
44
+ return (_jsx("ul", { "data-slot": "logo-rules", className: "flex flex-col divide-y divide-border border-y border-border", children: rules.map((r) => (_jsx("li", { children: _jsxs("a", { href: rulesHref ? `${rulesHref}#${r.id}` : `#${r.id}`, className: "group grid items-baseline gap-x-8 gap-y-1.5 py-5 focus-visible:outline-2 focus-visible:outline-ring md:grid-cols-[14rem_minmax(0,1fr)_auto]", children: [_jsxs("span", { className: "flex items-center gap-2 text-base font-medium underline-offset-4 group-hover:underline", children: [_jsx(Scale, { "aria-hidden": true, className: "size-(--dt-size-xs) shrink-0 text-muted-foreground" }), r.title] }), _jsx("span", { className: "text-sm leading-relaxed text-muted-foreground", children: inline(r.statement) }), _jsx(StatusBadge, { status: r.status })] }) }, r.id))) }));
45
45
  }
@@ -88,6 +88,15 @@ export interface DocsConfig {
88
88
  provenance?: string;
89
89
  /** `designtools-adherence --json`, for the standards page. */
90
90
  adherence?: AdherenceReport;
91
+ /**
92
+ * design.md, served at `<base>/design.md`: the brand in one file for anything made outside the repo's
93
+ * components (a page built elsewhere, a slide, a document). `body` is its hand-written half, in markdown
94
+ * `##` sections: what comes first when guidance conflicts, how to work, the reflexes to avoid, a review
95
+ * list. The values after it are generated. Without a body the file still serves, with the values alone.
96
+ */
97
+ designMd?: {
98
+ body: string;
99
+ };
91
100
  /** Pages people write, in the order they appear. */
92
101
  editorial?: EditorialPage[];
93
102
  /** Built-in pages to leave out. */
@@ -2,7 +2,7 @@ import { type Site } from "./site.js";
2
2
  /**
3
3
  * The markdown form of a docs page, generated from the manifest rather than
4
4
  * converted from HTML, or nothing when there is no such page. `context` is the
5
- * whole system in one file.
5
+ * whole system in one file; `design` is design.md, the brand for work outside the repo.
6
6
  */
7
7
  export declare function markdownFor(site: Site, path: string): string | undefined;
8
8
  /** The route handler for `md/[[...path]]`: the page's markdown with `Vary: Accept` and its canonical link, or a markdown 404. */
@@ -1,16 +1,29 @@
1
1
  import { groupByCategory, slugOf } from "../lib/manifest.js";
2
2
  import { adherenceMarkdown, assetsMarkdown, coloursMarkdown, componentMarkdown, editorialHeader, generatedHeader, glossaryMarkdown, manifestLinks, patternMarkdown, ruleMarkdown, scaleMarkdown, standardsMarkdown, systemMarkdown, typeMarkdown, } from "../lib/markdown.js";
3
+ import { designMarkdown } from "../lib/design-md.js";
3
4
  import { navOf, resolve } from "./site.js";
4
5
  /**
5
6
  * The markdown form of a docs page, generated from the manifest rather than
6
7
  * converted from HTML, or nothing when there is no such page. `context` is the
7
- * whole system in one file.
8
+ * whole system in one file; `design` is design.md, the brand for work outside the repo.
8
9
  */
9
10
  export function markdownFor(site, path) {
10
11
  const { base, title, components, tokens, rules, patterns, taxonomy, assets, config } = site;
11
12
  const generated = (md) => generatedHeader(config.provenance ?? "") + md;
12
13
  if (path === "context")
13
14
  return systemMarkdown({ components, tokens, rules: rules.rules, patterns: patterns.patterns, terms: taxonomy.terms }, title, config.provenance ?? "");
15
+ if (path === "design")
16
+ return designMarkdown({
17
+ title,
18
+ base,
19
+ provenance: config.provenance,
20
+ components,
21
+ tokens,
22
+ rules: rules.rules,
23
+ assets: assets.assets,
24
+ terms: taxonomy.terms,
25
+ body: config.designMd?.body,
26
+ });
14
27
  const page = resolve(site, path ? path.split("/") : []);
15
28
  if (!page)
16
29
  return undefined;
@@ -32,6 +45,7 @@ export function markdownFor(site, path) {
32
45
  ...groupByCategory(components).flatMap((g) => g.components.map((c) => `- ${g.category}: [${c.name}](${base}/components/${slugOf(c)}.md), ${c.status ?? "status not set"}`)),
33
46
  ...(nav.standards.length ? [`- Standards: ${links(nav.standards)}`] : []),
34
47
  `- Everything in [one file](${base}/context.md)`,
48
+ `- The brand for work outside the repo, a page, a slide or a document: [design.md](${base}/design.md)`,
35
49
  "",
36
50
  manifestLinks(`${base}/manifest`),
37
51
  ].join("\n"));
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ArrowRight, ArrowUpRight } from "lucide-react";
3
3
  import Link from "next/link";
4
+ import { cx, display } from "../lib/cx.js";
4
5
  import { AdherenceSummary } from "../adherence-summary.js";
5
6
  import { Anatomy } from "../anatomy.js";
6
7
  import { Examples } from "../examples.js";
@@ -101,7 +102,7 @@ function ComponentPage({ site, blocks: B, entry }) {
101
102
  const first = entry.examples?.canonical?.name;
102
103
  // the brand's named backgrounds (--surface-<name>), offered on the workbench's stage
103
104
  const backgrounds = site.tokens.tokens.map((t) => t.name.slice(2)).filter((n) => /^surface-[a-z]/.test(n) && !n.endsWith("-foreground"));
104
- return (_jsxs(_Fragment, { children: [_jsx(DocsHeader, { title: entry.name, lead: entry.description, children: _jsx(PageActions, { basePath: base }) }), _jsx(DocsSection, { title: "Usage", children: _jsx(B.Usage, { entry: entry, manifest: site.components, basePath: base }) }), _jsx(B.Workbench, { entry: entry, props: setup.props, content: setup.content, wrap: setup.wrap, backgrounds: backgrounds, previewHref: first && `${preview}/${first}`, children: setup.children }), _jsx(DocsSection, { title: "Anatomy", children: _jsx(B.Anatomy, { entry: entry }) }), _jsx(DocsSection, { title: "Examples", lead: "The usual use first, then each do beside its don't. Every one is the real component.", children: _jsx(B.Examples, { entry: entry, previewHref: preview }) }), !!entry.variants?.axes.length && (_jsx(DocsSection, { title: "Variants", lead: `Every combination, from the ${entry.variants.from === "props" ? "props' types" : `${entry.variants.from}() config`}, then each state.`, children: _jsx(B.VariantMatrix, { entry: entry, props: setup.props, children: setup.children === "" ? undefined : (setup.content ?? entry.name) }) })), first && (_jsx(DocsSection, { title: "At each width", children: _jsx(B.PreviewFrame, { src: `${preview}/${first}`, title: `${entry.name}: ${first}` }) })), _jsx(DocsFooter, { source: entry.source, provenance: config.provenance })] }));
105
+ return (_jsxs(_Fragment, { children: [_jsx(DocsHeader, { title: entry.name, lead: entry.description, children: _jsx(PageActions, { basePath: base }) }), _jsx(DocsSection, { title: "Usage", children: _jsx(B.Usage, { entry: entry, manifest: site.components, basePath: base }) }), _jsx(B.Workbench, { entry: entry, props: setup.props, content: setup.content, wrap: setup.wrap, backgrounds: backgrounds, previewHref: first && `${preview}/${first}`, children: setup.children }), _jsx(DocsSection, { title: "Anatomy", children: _jsx(B.Anatomy, { entry: entry, wrap: setup.wrap }) }), _jsx(DocsSection, { title: "Examples", lead: "The usual use first, then each do beside its don't. Every one is the real component.", children: _jsx(B.Examples, { entry: entry, previewHref: preview }) }), !!entry.variants?.axes.length && (_jsx(DocsSection, { title: "Variants", lead: `Every combination, from the ${entry.variants.from === "props" ? "props' types" : `${entry.variants.from}() config`}, then each state.`, children: _jsx(B.VariantMatrix, { entry: entry, props: setup.props, wrap: setup.wrap, children: setup.children === "" ? undefined : (setup.content ?? entry.name) }) })), first && (_jsx(DocsSection, { title: "At each width", children: _jsx(B.PreviewFrame, { src: `${preview}/${first}`, title: `${entry.name}: ${first}` }) })), _jsx(DocsFooter, { source: entry.source, provenance: config.provenance })] }));
105
106
  }
106
107
  /** The overview, below the hero when there is one: each part of the system and why it exists, then why it is agentic. */
107
108
  function Overview({ site }) {
@@ -110,56 +111,48 @@ function Overview({ site }) {
110
111
  const count = families.reduce((n, g) => n + g.families.length, 0);
111
112
  const brandPages = site.editorial.filter((p) => (p.section ?? "brand") === "brand");
112
113
  const brandFirst = brandPages[0];
113
- const share = config.adherence?.summary.share;
114
- // each section of the system, why it exists and how much is in it
114
+ // each section of the system, and why it exists
115
115
  const sections = [];
116
116
  if (brandFirst || site.shows("logo"))
117
117
  sections.push({
118
118
  title: "Brand",
119
119
  href: `${base}/${brandFirst?.slug ?? "brand/logo"}`,
120
120
  why: "What the brand believes, how it sounds and how it looks, so every screen and sentence comes from the same place.",
121
- count: `${brandPages.length + (site.assets.assets.some((a) => a.kind === "logo") ? 1 : 0)} pages`
122
121
  });
123
122
  sections.push({
124
123
  title: "Foundations",
125
124
  href: `${base}/colour`,
126
125
  why: "Colour, type and the scale, generated from the tokens and measured in both modes, so nothing is a guess.",
127
- count: `${site.tokens.tokens.length} tokens`,
128
126
  });
129
127
  if (site.rules.rules.length)
130
128
  sections.push({
131
129
  title: "Rules",
132
130
  href: `${base}/rules`,
133
131
  why: "The lines the brand and the interface hold, each written for people, with the check that proves it.",
134
- count: `${site.rules.rules.length} rules, ${site.rules.rules.filter((r) => r.status === "confirmed").length} confirmed`
135
132
  });
136
133
  if (site.shows("components") && count)
137
134
  sections.push({
138
135
  title: "Components",
139
136
  href: `${base}/components/${slugOf(families[0].families[0].head)}`,
140
137
  why: "The real components the product is built from, each with when to use it, a live workbench and an accessibility report.",
141
- count: `${count} components`
142
138
  });
143
139
  if (site.patterns.patterns.length)
144
140
  sections.push({
145
141
  title: "Patterns",
146
142
  href: `${base}/patterns/${site.patterns.patterns[0].id}`,
147
143
  why: "The screens the product keeps making, composed of the components, so a recurring problem is solved once.",
148
- count: `${site.patterns.patterns.length} patterns`
149
144
  });
150
145
  if (site.shows("standards") && (config.baselines || config.adherence))
151
146
  sections.push({
152
147
  title: "Standards",
153
148
  href: `${base}/standards`,
154
149
  why: "The bar the product is held to, and how closely it follows the system today, reported on every change.",
155
- count: share == null ? "Baselines agreed" : `${Math.round(share * 100)}% of the product on the system`
156
150
  });
157
151
  if (site.shows("vocabulary") && site.taxonomy.terms.length)
158
152
  sections.push({
159
153
  title: "Vocabulary",
160
154
  href: `${base}/vocabulary`,
161
155
  why: "One name for each thing, and the names people reach for instead, so people and agents mean the same thing.",
162
- count: `${site.taxonomy.terms.length} terms`
163
156
  });
164
157
  const loop = [
165
158
  ["Written once", "The components, tokens and rules live in the product's own code. Nobody keeps a second copy in a slide deck or a wiki."],
@@ -168,6 +161,6 @@ function Overview({ site }) {
168
161
  ["Checked", "Each rule names the check that proves it. Stale docs stop a commit; everything else is reported."],
169
162
  ["Measured", "A report on every change shows how closely the product follows the system. It informs the conversation; it never blocks the work."],
170
163
  ];
171
- return (_jsxs(_Fragment, { children: [!config.hero && (_jsx(DocsHeader, { title: site.title, lead: config.lead ?? "The brand and the design system in one place, for the people who make the product and the agents that build it with them.", children: _jsx(PageActions, { basePath: base }) })), _jsx(DocsSection, { title: "What's here, and why", lead: "Each part of the system has one job. Together they mean the product, its people and its agents work from the same source.", children: _jsx("ul", { "data-slot": "overview-sections", className: "grid gap-x-12 md:grid-cols-2", children: sections.map((sec) => (_jsx("li", { className: "border-t border-border", children: _jsxs(Link, { href: sec.href, className: "group flex h-full flex-col gap-4 py-7 focus-visible:outline-2 focus-visible:outline-ring", children: [_jsxs("span", { className: "flex items-baseline justify-between gap-4", children: [_jsx("span", { className: "text-2xl leading-tight tracking-tight underline-offset-[6px] group-hover:underline", children: sec.title }), _jsx("span", { className: "shrink-0 text-xs text-muted-foreground tabular-nums", children: sec.count })] }), _jsx("span", { className: "max-w-md text-base leading-relaxed text-muted-foreground", children: sec.why })] }) }, sec.title))) }) }), config.overview?.agentic !== false && (_jsxs(DocsSection, { title: "Why this is agentic", lead: config.overview?.agenticLead ??
172
- "A design system used to be a document people were asked to follow. This one is the source the product, its people and its AI agents all work from, and it checks itself.", children: [_jsx("ol", { "data-slot": "overview-loop", className: "grid gap-x-6 gap-y-8 sm:grid-cols-2 xl:grid-cols-5", children: loop.map(([title, body], i) => (_jsxs("li", { className: "relative flex flex-col gap-3 xl:pr-2", children: [_jsxs("span", { className: "flex items-center gap-3", children: [_jsx("span", { className: "grid size-8 shrink-0 place-items-center rounded-full bg-canvas-foreground text-sm font-medium text-canvas tabular-nums", children: i + 1 }), i < loop.length - 1 && _jsx("span", { "aria-hidden": true, className: "hidden h-px flex-1 bg-border xl:block" })] }), _jsx("span", { className: "text-lg leading-snug tracking-tight", children: title }), _jsx("span", { className: "text-sm leading-relaxed text-muted-foreground", children: body })] }, title))) }), _jsxs("p", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground", children: ["See it the way an agent does:", _jsxs("a", { href: `${base}.md`, className: "inline-flex items-center gap-1 font-medium text-canvas-foreground underline underline-offset-4 hover:decoration-2", children: ["this page as markdown ", _jsx(ArrowUpRight, { "aria-hidden": true, className: "size-3.5" })] })] })] })), _jsx(DocsFooter, { provenance: config.provenance })] }));
164
+ return (_jsxs(_Fragment, { children: [!config.hero && (_jsx(DocsHeader, { title: site.title, lead: config.lead ?? "The brand and the design system in one place, for the people who make the product and the agents that build it with them.", children: _jsx(PageActions, { basePath: base }) })), _jsx(DocsSection, { title: "What's here, and why", lead: "Each part of the system has one job. Together they mean the product, its people and its agents work from the same source.", children: _jsx("ul", { "data-slot": "overview-sections", className: "flex flex-col border-b border-border", children: sections.map((sec) => (_jsx("li", { className: "border-t border-border", children: _jsxs(Link, { href: sec.href, className: "group grid items-baseline gap-x-10 gap-y-2 py-6 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-ring md:grid-cols-[13rem_minmax(0,1fr)_auto]", children: [_jsx("span", { className: cx(display, "text-2xl leading-snug tracking-tight underline-offset-4 group-hover:underline"), children: sec.title }), _jsx("span", { className: "max-w-2xl text-base leading-relaxed text-muted-foreground", children: sec.why }), _jsx(ArrowUpRight, { "aria-hidden": true, className: "hidden size-(--dt-size-sm) translate-y-0.5 self-start text-muted-foreground transition duration-(--dt-duration-base) ease-(--dt-ease-out) group-hover:translate-x-1 group-hover:-translate-y-0.5 group-hover:text-canvas-foreground md:mt-1.5 md:block" })] }) }, sec.title))) }) }), config.overview?.agentic !== false && (_jsxs(DocsSection, { title: "Why this is agentic", lead: config.overview?.agenticLead ??
165
+ "A design system used to be a document people were asked to follow. This one is the source the product, its people and its AI agents all work from, and it checks itself.", children: [_jsx("ol", { "data-slot": "overview-loop", className: "grid gap-x-6 gap-y-8 sm:grid-cols-2 xl:grid-cols-5", children: loop.map(([title, body], i) => (_jsxs("li", { className: "relative flex flex-col gap-3 xl:pr-2", children: [_jsxs("span", { className: "flex items-center gap-3", children: [_jsx("span", { className: "grid size-8 shrink-0 place-items-center rounded-full bg-canvas-foreground text-sm font-medium text-canvas tabular-nums", children: i + 1 }), i < loop.length - 1 && _jsx("span", { "aria-hidden": true, className: "hidden h-px flex-1 bg-border xl:block" })] }), _jsx("span", { className: "text-lg leading-snug tracking-tight", children: title }), _jsx("span", { className: "text-sm leading-relaxed text-muted-foreground", children: body })] }, title))) }), _jsxs("p", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground", children: ["See it the way an agent does:", _jsxs("a", { href: base ? `${base}.md` : "/.md", className: "inline-flex items-center gap-1 font-medium text-canvas-foreground underline underline-offset-4 hover:decoration-2", children: ["this page as markdown ", _jsx(ArrowUpRight, { "aria-hidden": true, className: "size-3.5" })] }), "or, for a page, slide or document made outside the repo,", _jsxs("a", { href: `${base}/design.md`, className: "inline-flex items-center gap-1 font-medium text-canvas-foreground underline underline-offset-4 hover:decoration-2", children: ["design.md ", _jsx(ArrowUpRight, { "aria-hidden": true, className: "size-3.5" })] })] })] })), _jsx(DocsFooter, { provenance: config.provenance })] }));
173
166
  }
@@ -28,7 +28,7 @@ export function docsProxy({ basePath = "/design/system", production } = {}) {
28
28
  // the markdown responses keep theirs.
29
29
  const res = NextResponse.next();
30
30
  res.headers.set("vary", "Accept");
31
- res.headers.set("link", `<${page}.md>; rel="alternate"; type="text/markdown"`);
31
+ res.headers.set("link", `<${page ? `${page}.md` : "/.md"}>; rel="alternate"; type="text/markdown"`);
32
32
  res.headers.set("x-robots-tag", "noindex");
33
33
  return res;
34
34
  };
@@ -36,7 +36,8 @@ export function docsProxy({ basePath = "/design/system", production } = {}) {
36
36
  /** The proxy's matcher for a base path. Next reads `config.matcher` statically, so write the result out where it must be a literal. */
37
37
  export function docsMatcher(basePath = "/design/system") {
38
38
  const base = basePath.replace(/\/$/, "");
39
- return [base, `${base}.md`, `${base}/:path*`];
39
+ // served at the site root, every path is a docs path
40
+ return base ? [base, `${base}.md`, `${base}/:path*`] : ["/", "/:path*"];
40
41
  }
41
42
  /** text/markdown ranked above text/html in the Accept header. */
42
43
  export function prefersMarkdown(accept) {
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * What a reader can take from a page, as one split button: copy the page as
3
3
  * markdown, the same markdown any agent gets at `.md`, with a menu beside it to
4
- * view that markdown, copy the whole system as one file, or open the manifest.
4
+ * view that markdown, copy the whole system as one file, copy design.md (the
5
+ * brand for work outside the repo), or open the manifest.
5
6
  * Put it in a `DocsHeader`.
6
7
  */
7
8
  export declare function PageActions({ basePath }: {
@@ -1,13 +1,14 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Menu } from "@base-ui/react/menu";
4
- import { Braces, Check, ChevronDown, Copy, FileText, Files } from "lucide-react";
4
+ import { Braces, Check, ChevronDown, Copy, FileText, Files, Palette } from "lucide-react";
5
5
  import { usePathname } from "next/navigation";
6
6
  import { useState } from "react";
7
7
  /**
8
8
  * What a reader can take from a page, as one split button: copy the page as
9
9
  * markdown, the same markdown any agent gets at `.md`, with a menu beside it to
10
- * view that markdown, copy the whole system as one file, or open the manifest.
10
+ * view that markdown, copy the whole system as one file, copy design.md (the
11
+ * brand for work outside the repo), or open the manifest.
11
12
  * Put it in a `DocsHeader`.
12
13
  */
13
14
  export function PageActions({ basePath = "/design/system" }) {
@@ -28,5 +29,5 @@ export function PageActions({ basePath = "/design/system" }) {
28
29
  };
29
30
  const item = "flex min-h-(--docs-target,2.75rem) cursor-pointer items-center gap-3 rounded-md px-3 text-sm outline-none select-none data-highlighted:bg-muted";
30
31
  const icon = "size-4 shrink-0 text-muted-foreground";
31
- return (_jsxs("div", { "data-slot": "page-actions", className: "inline-flex items-stretch rounded-lg border border-border bg-canvas text-sm shadow-xs", children: [_jsxs("button", { type: "button", onClick: () => copyFrom(`${path}.md`, "Page copied"), className: "inline-flex min-h-9 cursor-pointer items-center gap-2 rounded-l-lg py-1.5 pr-3 pl-3 font-medium hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring", children: [done === "Page copied" ? _jsx(Check, { "aria-hidden": true, className: "size-4" }) : _jsx(Copy, { "aria-hidden": true, className: icon }), done === "Page copied" ? "Copied" : "Copy page"] }), _jsxs(Menu.Root, { children: [_jsx(Menu.Trigger, { "aria-label": "More ways to take this page", className: "inline-flex min-h-9 w-9 cursor-pointer items-center justify-center rounded-r-lg border-l border-border text-muted-foreground hover:bg-muted hover:text-canvas-foreground focus-visible:outline-2 focus-visible:outline-ring data-popup-open:bg-muted", children: _jsx(ChevronDown, { "aria-hidden": true, className: "size-4" }) }), _jsx(Menu.Portal, { children: _jsx(Menu.Positioner, { "data-designtools": "", align: "end", sideOffset: 6, className: "z-50", children: _jsxs(Menu.Popup, { className: "w-72 rounded-xl border border-border bg-overlay p-1.5 text-overlay-foreground shadow-lg transition-[opacity,scale] duration-(--dt-duration-fast) data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0", children: [_jsxs(Menu.Item, { className: item, onClick: () => copyFrom(`${path}.md`, "Page copied"), children: [_jsx(Copy, { "aria-hidden": true, className: icon }), _jsxs("span", { className: "flex flex-col", children: ["Copy page", _jsx("span", { className: "text-xs text-muted-foreground", children: "As markdown, for an assistant" })] })] }), _jsxs(Menu.LinkItem, { className: item, href: `${path}.md`, target: "_blank", rel: "noreferrer", children: [_jsx(FileText, { "aria-hidden": true, className: icon }), _jsxs("span", { className: "flex flex-col", children: ["View as markdown", _jsx("span", { className: "text-xs text-muted-foreground", children: "What an agent reads at this address" })] })] }), _jsx(Menu.Separator, { className: "my-1.5 h-px bg-border" }), _jsxs(Menu.Item, { className: item, onClick: () => copyFrom(`${basePath}/context.md`, "System copied"), children: [_jsx(Files, { "aria-hidden": true, className: icon }), _jsxs("span", { className: "flex flex-col", children: ["Copy the whole system", _jsx("span", { className: "text-xs text-muted-foreground", children: "Every page in one markdown file" })] })] }), _jsxs(Menu.LinkItem, { className: item, href: `${basePath}/manifest/components.json`, target: "_blank", rel: "noreferrer", children: [_jsx(Braces, { "aria-hidden": true, className: icon }), _jsxs("span", { className: "flex flex-col", children: ["Open the manifest", _jsx("span", { className: "text-xs text-muted-foreground", children: "Components, tokens and rules as JSON" })] })] })] }) }) })] }), _jsx("span", { className: "sr-only", "aria-live": "polite", children: done ?? "" })] }));
32
+ return (_jsxs("div", { "data-slot": "page-actions", className: "inline-flex items-stretch rounded-lg border border-border bg-canvas text-sm shadow-xs", children: [_jsxs("button", { type: "button", onClick: () => copyFrom(`${path}.md`, "Page copied"), className: "inline-flex min-h-9 cursor-pointer items-center gap-2 rounded-l-lg py-1.5 pr-3 pl-3 font-medium hover:bg-muted focus-visible:outline-2 focus-visible:outline-ring", children: [done === "Page copied" ? _jsx(Check, { "aria-hidden": true, className: "size-4" }) : _jsx(Copy, { "aria-hidden": true, className: icon }), done === "Page copied" ? "Copied" : "Copy page"] }), _jsxs(Menu.Root, { children: [_jsx(Menu.Trigger, { "aria-label": "More ways to take this page", className: "inline-flex min-h-9 w-9 cursor-pointer items-center justify-center rounded-r-lg border-l border-border text-muted-foreground hover:bg-muted hover:text-canvas-foreground focus-visible:outline-2 focus-visible:outline-ring data-popup-open:bg-muted", children: _jsx(ChevronDown, { "aria-hidden": true, className: "size-4" }) }), _jsx(Menu.Portal, { children: _jsx(Menu.Positioner, { "data-designtools": "", align: "end", sideOffset: 6, className: "z-50", children: _jsxs(Menu.Popup, { className: "w-72 rounded-xl border border-border bg-overlay p-1.5 text-overlay-foreground shadow-lg transition-[opacity,scale] duration-(--dt-duration-fast) data-ending-style:scale-95 data-ending-style:opacity-0 data-starting-style:scale-95 data-starting-style:opacity-0", children: [_jsxs(Menu.Item, { className: item, onClick: () => copyFrom(`${path}.md`, "Page copied"), children: [_jsx(Copy, { "aria-hidden": true, className: icon }), _jsxs("span", { className: "flex flex-col", children: ["Copy page", _jsx("span", { className: "text-xs text-muted-foreground", children: "As markdown, for an assistant" })] })] }), _jsxs(Menu.LinkItem, { className: item, href: `${path}.md`, target: "_blank", rel: "noreferrer", children: [_jsx(FileText, { "aria-hidden": true, className: icon }), _jsxs("span", { className: "flex flex-col", children: ["View as markdown", _jsx("span", { className: "text-xs text-muted-foreground", children: "What an agent reads at this address" })] })] }), _jsx(Menu.Separator, { className: "my-1.5 h-px bg-border" }), _jsxs(Menu.Item, { className: item, onClick: () => copyFrom(`${basePath}/context.md`, "System copied"), children: [_jsx(Files, { "aria-hidden": true, className: icon }), _jsxs("span", { className: "flex flex-col", children: ["Copy the whole system", _jsx("span", { className: "text-xs text-muted-foreground", children: "Every page in one markdown file" })] })] }), _jsxs(Menu.Item, { className: item, onClick: () => copyFrom(`${basePath}/design.md`, "design.md copied"), children: [_jsx(Palette, { "aria-hidden": true, className: icon }), _jsxs("span", { className: "flex flex-col", children: ["Copy design.md", _jsx("span", { className: "text-xs text-muted-foreground", children: "The brand for a page, slide or document made elsewhere" })] })] }), _jsxs(Menu.LinkItem, { className: item, href: `${basePath}/manifest/components.json`, target: "_blank", rel: "noreferrer", children: [_jsx(Braces, { "aria-hidden": true, className: icon }), _jsxs("span", { className: "flex flex-col", children: ["Open the manifest", _jsx("span", { className: "text-xs text-muted-foreground", children: "Components, tokens and rules as JSON" })] })] })] }) }) })] }), _jsx("span", { className: "sr-only", "aria-live": "polite", children: done ?? "" })] }));
32
33
  }
@@ -72,7 +72,7 @@ export function FlagControl({ name, checked, onChange }) {
72
72
  const id = useId();
73
73
  return (_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("label", { htmlFor: id, className: "text-sm font-medium", children: title(name) }), _jsx(Switch.Root, { id: id, checked: checked, onCheckedChange: onChange,
74
74
  // drawn small, pressed large: the hit area reaches the docs' target without the switch growing
75
- className: "relative h-6 w-10 shrink-0 cursor-pointer rounded-full bg-input p-0.5 transition-colors duration-(--dt-duration-fast) after:absolute after:-inset-2.5 after:content-[''] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring data-[checked]:bg-primary", children: _jsx(Switch.Thumb, { className: "block size-5 rounded-full bg-primary-foreground shadow-xs transition-transform duration-(--dt-duration-fast) data-[checked]:translate-x-4" }) })] }));
75
+ className: "relative h-6 w-10 shrink-0 cursor-pointer rounded-full bg-input p-0.5 transition-colors duration-(--dt-duration-fast) after:absolute after:-inset-2.5 after:content-[''] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring data-[checked]:bg-[var(--docs-accent,var(--primary))]", children: _jsx(Switch.Thumb, { className: "block size-5 rounded-full bg-canvas shadow-xs ring-1 ring-border transition-transform duration-(--dt-duration-fast) data-[checked]:translate-x-4" }) })] }));
76
76
  }
77
77
  export function TextControl({ value, onChange }) {
78
78
  const id = useId();
package/dist/shell.js CHANGED
@@ -29,6 +29,8 @@ const DocsPage = createContext({});
29
29
  */
30
30
  export function DocsShell({ manifest, rules, patterns, terms, search = true, themeSwitch = true, title = "Design system", logo, basePath = "/design/system", brand = [], foundations = [], standards = [], hero, children, }) {
31
31
  const current = usePathname();
32
+ // the overview's own address: the base path, or the site root when the docs are served there (basePath "")
33
+ const home = basePath || "/";
32
34
  const searchItems = useMemo(() => searchIndex({
33
35
  manifest,
34
36
  rules: rules?.rules,
@@ -40,7 +42,7 @@ export function DocsShell({ manifest, rules, patterns, terms, search = true, the
40
42
  const sections = useMemo(() => {
41
43
  const families = groupFamilies(manifest);
42
44
  const all = [
43
- { id: "overview", label: "Overview", icon: House, href: basePath, groups: [] },
45
+ { id: "overview", label: "Overview", icon: House, href: home, groups: [] },
44
46
  { id: "brand", label: "Brand", icon: BookOpen, groups: [{ links: brand }] },
45
47
  { id: "foundations", label: "Foundations", icon: Palette, groups: [{ links: foundations }] },
46
48
  ...(rules?.rules.length ? [{ id: "rules", label: "Rules", icon: Scale, href: `${basePath}/rules`, groups: [] }] : []),
@@ -66,7 +68,7 @@ export function DocsShell({ manifest, rules, patterns, terms, search = true, the
66
68
  { id: "standards", label: "Standards", icon: Gauge, groups: [{ links: standards }] },
67
69
  ];
68
70
  return all.filter((s) => s.href || s.groups.some((g) => g.links.length));
69
- }, [manifest, rules, patterns, brand, foundations, standards, basePath]);
71
+ }, [manifest, rules, patterns, brand, foundations, standards, basePath, home]);
70
72
  // every page in navigation order, for the section a page sits in and its neighbours
71
73
  const page = useMemo(() => {
72
74
  // a section of one page has no section above it: the page is the section
@@ -87,8 +89,8 @@ export function DocsShell({ manifest, rules, patterns, terms, search = true, the
87
89
  useThemeScript();
88
90
  const [menu, setMenu] = useState(false);
89
91
  useEffect(() => setMenu(false), [current]);
90
- const brandLink = (_jsxs(Link, { href: basePath, "data-slot": "docs-title", className: cx(target, "flex min-w-0 items-center gap-3 rounded-md focus-visible:outline-2 focus-visible:outline-ring"), children: [logo && (_jsx("span", { "data-slot": "docs-logo", className: "shrink-0", children: _jsx(Live, { children: logo }) })), _jsx("span", { className: cx(logo ? "sr-only" : "truncate text-base font-semibold tracking-tight"), children: title })] }));
91
- return (_jsx(DocsPage.Provider, { value: page, children: _jsxs("div", { "data-designtools": "", "data-slot": "docs-shell", className: "min-h-dvh bg-canvas text-canvas-foreground lg:grid lg:grid-cols-[19rem_minmax(0,1fr)]", children: [_jsx("aside", { "data-slot": "docs-sidebar", className: "sticky top-0 hidden h-dvh p-3 lg:block", children: _jsxs("div", { className: "flex h-full flex-col overflow-hidden rounded-xl border border-border bg-surface text-surface-foreground shadow-xs", children: [_jsxs("div", { className: "flex flex-col gap-3 p-4 pb-3", children: [brandLink, search && _jsx(DocsSearch, { items: searchItems })] }), _jsx(Nav, { sections: sections, current: current, title: title }), themeSwitch && (_jsxs("div", { "data-slot": "docs-sidebar-foot", className: "flex items-center justify-between gap-3 border-t border-border px-4 py-3", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "Appearance" }), _jsx(ThemeSwitch, {})] }))] }) }), _jsxs("div", { className: "min-w-0", children: [_jsxs("header", { "data-slot": "docs-topbar", className: "sticky top-0 z-20 flex h-16 items-center gap-2 border-b border-border bg-canvas/85 px-3 backdrop-blur-md lg:hidden", children: [_jsxs(Dialog.Root, { open: menu, onOpenChange: setMenu, children: [_jsx(Dialog.Trigger, { "aria-label": "Open the navigation", className: iconButton, children: _jsx(Menu, { "aria-hidden": true, className: "size-(--dt-size-sm)" }) }), _jsxs(Dialog.Portal, { children: [_jsx(Dialog.Backdrop, { "data-designtools": "", className: "fixed inset-0 z-40 bg-canvas-foreground/30 transition-opacity duration-(--dt-duration-base) data-ending-style:opacity-0 data-starting-style:opacity-0" }), _jsxs(Dialog.Popup, { "data-designtools": "", "data-slot": "docs-drawer", "aria-label": title, className: "fixed inset-y-0 left-0 z-50 flex w-[min(21rem,88vw)] flex-col bg-surface text-surface-foreground shadow-xl transition-transform duration-(--dt-duration-slow) ease-(--dt-ease-out) data-ending-style:-translate-x-full data-starting-style:-translate-x-full", children: [_jsxs("div", { className: "flex items-center justify-between gap-2 border-b border-border p-3 pl-4", children: [brandLink, _jsx(Dialog.Close, { "aria-label": "Close the navigation", className: iconButton, children: _jsx(X, { "aria-hidden": true, className: "size-(--dt-size-sm)" }) })] }), _jsx(Nav, { sections: sections, current: current, title: title, className: "pt-4" }), themeSwitch && (_jsxs("div", { className: "flex items-center justify-between gap-3 border-t border-border px-4 py-3", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "Appearance" }), _jsx(ThemeSwitch, {})] }))] })] })] }), _jsx("div", { className: "min-w-0 flex-1", children: brandLink }), search && _jsx(DocsSearch, { items: searchItems, shortcuts: false, variant: "icon" })] }), hero && current === basePath && (_jsx("div", { "data-slot": "docs-hero", className: "w-full", children: _jsx(Live, { children: hero }) })), _jsxs("div", { className: "mx-auto flex w-full max-w-[90rem] gap-16 px-5 pt-12 pb-20 sm:px-8 lg:px-12 lg:pt-20 xl:px-20", children: [_jsxs("main", { "data-slot": "docs-main", className: "flex min-w-0 flex-1 flex-col gap-16 [counter-reset:docs-section] lg:gap-24", children: [children, _jsx(Pager, { prev: page.prev, next: page.next })] }), _jsx(OnThisPage, { current: current })] })] })] }) }));
92
+ const brandLink = (_jsxs(Link, { href: home, "data-slot": "docs-title", className: cx(target, "flex min-w-0 items-center gap-3 rounded-md focus-visible:outline-2 focus-visible:outline-ring"), children: [logo && (_jsx("span", { "data-slot": "docs-logo", className: "shrink-0", children: _jsx(Live, { children: logo }) })), _jsx("span", { className: cx(logo ? "sr-only" : "truncate text-base font-semibold tracking-tight"), children: title })] }));
93
+ return (_jsx(DocsPage.Provider, { value: page, children: _jsxs("div", { "data-designtools": "", "data-slot": "docs-shell", className: "min-h-dvh bg-canvas text-canvas-foreground lg:grid lg:grid-cols-[19rem_minmax(0,1fr)]", children: [_jsx("aside", { "data-slot": "docs-sidebar", className: "sticky top-0 hidden h-dvh p-3 lg:block", children: _jsxs("div", { className: "flex h-full flex-col overflow-hidden rounded-xl border border-border bg-surface text-surface-foreground shadow-xs", children: [_jsxs("div", { className: "flex flex-col gap-3 p-4 pb-3", children: [brandLink, search && _jsx(DocsSearch, { items: searchItems })] }), _jsx(Nav, { sections: sections, current: current, title: title }), themeSwitch && (_jsxs("div", { "data-slot": "docs-sidebar-foot", className: "flex items-center justify-between gap-3 border-t border-border px-4 py-3", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "Appearance" }), _jsx(ThemeSwitch, {})] }))] }) }), _jsxs("div", { className: "min-w-0", children: [_jsxs("header", { "data-slot": "docs-topbar", className: "sticky top-0 z-20 flex h-16 items-center gap-2 border-b border-border bg-canvas/85 px-3 backdrop-blur-md lg:hidden", children: [_jsxs(Dialog.Root, { open: menu, onOpenChange: setMenu, children: [_jsx(Dialog.Trigger, { "aria-label": "Open the navigation", className: iconButton, children: _jsx(Menu, { "aria-hidden": true, className: "size-(--dt-size-sm)" }) }), _jsxs(Dialog.Portal, { children: [_jsx(Dialog.Backdrop, { "data-designtools": "", className: "fixed inset-0 z-40 bg-canvas-foreground/30 transition-opacity duration-(--dt-duration-base) data-ending-style:opacity-0 data-starting-style:opacity-0" }), _jsxs(Dialog.Popup, { "data-designtools": "", "data-slot": "docs-drawer", "aria-label": title, className: "fixed inset-y-0 left-0 z-50 flex w-[min(21rem,88vw)] flex-col bg-surface text-surface-foreground shadow-xl transition-transform duration-(--dt-duration-slow) ease-(--dt-ease-out) data-ending-style:-translate-x-full data-starting-style:-translate-x-full", children: [_jsxs("div", { className: "flex items-center justify-between gap-2 border-b border-border p-3 pl-4", children: [brandLink, _jsx(Dialog.Close, { "aria-label": "Close the navigation", className: iconButton, children: _jsx(X, { "aria-hidden": true, className: "size-(--dt-size-sm)" }) })] }), _jsx(Nav, { sections: sections, current: current, title: title, className: "pt-4" }), themeSwitch && (_jsxs("div", { className: "flex items-center justify-between gap-3 border-t border-border px-4 py-3", children: [_jsx("span", { className: "text-xs font-medium text-muted-foreground", children: "Appearance" }), _jsx(ThemeSwitch, {})] }))] })] })] }), _jsx("div", { className: "min-w-0 flex-1", children: brandLink }), search && _jsx(DocsSearch, { items: searchItems, shortcuts: false, variant: "icon" })] }), hero && current === home && (_jsx("div", { "data-slot": "docs-hero", className: "w-full", children: _jsx(Live, { children: hero }) })), _jsxs("div", { className: "mx-auto flex w-full max-w-[90rem] gap-16 px-5 pt-12 pb-20 sm:px-8 lg:px-12 lg:pt-20 xl:px-20", children: [_jsxs("main", { "data-slot": "docs-main", className: "flex min-w-0 flex-1 flex-col gap-16 [counter-reset:docs-section] lg:gap-24", children: [children, _jsx(Pager, { prev: page.prev, next: page.next })] }), _jsx(OnThisPage, { current: current })] })] })] }) }));
92
94
  }
93
95
  const iconButton = "inline-flex size-(--docs-target,2.75rem) shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-canvas-foreground focus-visible:outline-2 focus-visible:outline-ring";
94
96
  /** The sections, each a link or a fold that opens where the current page is. */
package/dist/standards.js CHANGED
@@ -14,6 +14,6 @@ export function Standards({ baselines, children }) {
14
14
  return (_jsxs("div", { "data-slot": "standards", className: "flex flex-col gap-6", children: [_jsx("div", { className: "grid gap-x-12 gap-y-10 md:grid-cols-2 xl:grid-cols-3", children: standardsSections(baselines).map((section) => {
15
15
  const Icon = ICON[section.key] ?? Ruler;
16
16
  const single = section.rows.length === 1 && !section.rows[0].label;
17
- return (_jsxs("section", { "data-slot": "standard", className: "flex flex-col gap-4 border-t border-border pt-5", children: [_jsxs("h3", { className: "flex items-center gap-2 text-sm font-medium text-muted-foreground", children: [_jsx(Icon, { "aria-hidden": true, className: "size-(--dt-size-xs)" }), section.title] }), single ? (_jsx("p", { className: "text-5xl font-light tracking-tight", children: section.rows[0].value })) : section.rows.length ? (_jsx("dl", { className: "flex flex-col gap-3", children: section.rows.map((row) => (_jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("dt", { className: "text-xs text-muted-foreground", children: row.label }), _jsx("dd", { className: "text-2xl font-light tracking-tight tabular-nums", children: row.value })] }, row.label))) })) : null, section.notes.map((note) => (_jsx("p", { className: "text-sm text-muted-foreground", children: note }, note)))] }, section.key));
17
+ return (_jsxs("section", { "data-slot": "standard", className: "flex flex-col gap-4 border-t border-border pt-5", children: [_jsxs("h3", { className: "flex items-center gap-2 text-sm font-medium text-muted-foreground", children: [_jsx(Icon, { "aria-hidden": true, className: "size-(--dt-size-xs)" }), section.title] }), single ? (_jsx("p", { className: "text-xl leading-snug tracking-tight text-pretty", children: section.rows[0].value })) : section.rows.length ? (_jsx("dl", { className: "flex flex-col gap-3", children: section.rows.map((row) => (_jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("dt", { className: "text-xs text-muted-foreground", children: row.label }), _jsx("dd", { className: "text-lg leading-snug tracking-tight tabular-nums", children: row.value })] }, row.label))) })) : null, section.notes.map((note) => (_jsx("p", { className: "text-sm text-muted-foreground", children: note }, note)))] }, section.key));
18
18
  }) }), typeof baselines.$note === "string" && (_jsxs("p", { className: "flex items-start gap-2 text-sm text-muted-foreground", children: [_jsx(Info, { "aria-hidden": true, className: "mt-0.5 size-(--dt-size-xs) shrink-0" }), baselines.$note] })), children] }));
19
19
  }
package/dist/styles.css CHANGED
@@ -1100,6 +1100,11 @@
1100
1100
  translate: var(--tw-translate-x) var(--tw-translate-y);
1101
1101
  }
1102
1102
 
1103
+ :where([data-designtools]) .translate-y-0\.5:not([data-docs-content] *), .translate-y-0\.5:where([data-designtools]):not([data-docs-content] *) {
1104
+ --tw-translate-y: calc(.25rem * .5);
1105
+ translate: var(--tw-translate-x) var(--tw-translate-y);
1106
+ }
1107
+
1103
1108
  :where([data-designtools]) .transform:not([data-docs-content] *), .transform:where([data-designtools]):not([data-docs-content] *) {
1104
1109
  transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
1105
1110
  }
@@ -1380,6 +1385,10 @@
1380
1385
  align-self: flex-end;
1381
1386
  }
1382
1387
 
1388
+ :where([data-designtools]) .self-start:not([data-docs-content] *), .self-start:where([data-designtools]):not([data-docs-content] *) {
1389
+ align-self: flex-start;
1390
+ }
1391
+
1383
1392
  :where([data-designtools]) .justify-self-end:not([data-docs-content] *), .justify-self-end:where([data-designtools]):not([data-docs-content] *) {
1384
1393
  justify-self: flex-end;
1385
1394
  }
@@ -1419,7 +1428,7 @@
1419
1428
  }
1420
1429
 
1421
1430
  :where([data-designtools]) .rounded-2xl:not([data-docs-content] *), .rounded-2xl:where([data-designtools]):not([data-docs-content] *) {
1422
- border-radius: var(--docs-radius-2xl, var(--radius-2xl, 1rem));
1431
+ border-radius: var(--docs-radius-2xl, 1rem);
1423
1432
  }
1424
1433
 
1425
1434
  :where([data-designtools]) .rounded-full:not([data-docs-content] *), .rounded-full:where([data-designtools]):not([data-docs-content] *) {
@@ -1427,29 +1436,29 @@
1427
1436
  }
1428
1437
 
1429
1438
  :where([data-designtools]) .rounded-lg:not([data-docs-content] *), .rounded-lg:where([data-designtools]):not([data-docs-content] *) {
1430
- border-radius: var(--docs-radius-lg, var(--radius-lg, .5rem));
1439
+ border-radius: var(--docs-radius-lg, .5rem);
1431
1440
  }
1432
1441
 
1433
1442
  :where([data-designtools]) .rounded-md:not([data-docs-content] *), .rounded-md:where([data-designtools]):not([data-docs-content] *) {
1434
- border-radius: var(--docs-radius-md, var(--radius-md, .375rem));
1443
+ border-radius: var(--docs-radius-md, .375rem);
1435
1444
  }
1436
1445
 
1437
1446
  :where([data-designtools]) .rounded-sm:not([data-docs-content] *), .rounded-sm:where([data-designtools]):not([data-docs-content] *) {
1438
- border-radius: var(--docs-radius-sm, var(--radius-sm, .25rem));
1447
+ border-radius: var(--docs-radius-sm, .25rem);
1439
1448
  }
1440
1449
 
1441
1450
  :where([data-designtools]) .rounded-xl:not([data-docs-content] *), .rounded-xl:where([data-designtools]):not([data-docs-content] *) {
1442
- border-radius: var(--docs-radius-xl, var(--radius-xl, .75rem));
1451
+ border-radius: var(--docs-radius-xl, .75rem);
1443
1452
  }
1444
1453
 
1445
1454
  :where([data-designtools]) .rounded-l-lg:not([data-docs-content] *), .rounded-l-lg:where([data-designtools]):not([data-docs-content] *) {
1446
- border-top-left-radius: var(--docs-radius-lg, var(--radius-lg, .5rem));
1447
- border-bottom-left-radius: var(--docs-radius-lg, var(--radius-lg, .5rem));
1455
+ border-top-left-radius: var(--docs-radius-lg, .5rem);
1456
+ border-bottom-left-radius: var(--docs-radius-lg, .5rem);
1448
1457
  }
1449
1458
 
1450
1459
  :where([data-designtools]) .rounded-r-lg:not([data-docs-content] *), .rounded-r-lg:where([data-designtools]):not([data-docs-content] *) {
1451
- border-top-right-radius: var(--docs-radius-lg, var(--radius-lg, .5rem));
1452
- border-bottom-right-radius: var(--docs-radius-lg, var(--radius-lg, .5rem));
1460
+ border-top-right-radius: var(--docs-radius-lg, .5rem);
1461
+ border-bottom-right-radius: var(--docs-radius-lg, .5rem);
1453
1462
  }
1454
1463
 
1455
1464
  :where([data-designtools]) .border:not([data-docs-content] *), .border:where([data-designtools]):not([data-docs-content] *) {
@@ -1487,6 +1496,11 @@
1487
1496
  border-left-width: 1px;
1488
1497
  }
1489
1498
 
1499
+ :where([data-designtools]) .border-l-2:not([data-docs-content] *), .border-l-2:where([data-designtools]):not([data-docs-content] *) {
1500
+ border-left-style: var(--tw-border-style);
1501
+ border-left-width: 2px;
1502
+ }
1503
+
1490
1504
  :where([data-designtools]) .border-dashed:not([data-docs-content] *), .border-dashed:where([data-designtools]):not([data-docs-content] *) {
1491
1505
  --tw-border-style: dashed;
1492
1506
  border-style: dashed;
@@ -1543,6 +1557,10 @@
1543
1557
  border-color: #0000;
1544
1558
  }
1545
1559
 
1560
+ :where([data-designtools]) .border-warning:not([data-docs-content] *), .border-warning:where([data-designtools]):not([data-docs-content] *) {
1561
+ border-color: var(--warning, #ed8a3c);
1562
+ }
1563
+
1546
1564
  :where([data-designtools]) .bg-\[var\(--docs-accent\,var\(--primary\)\)\]:not([data-docs-content] *), .bg-\[var\(--docs-accent\,var\(--primary\)\)\]:where([data-designtools]):not([data-docs-content] *) {
1547
1565
  background-color: var(--docs-accent, var(--primary));
1548
1566
  }
@@ -1637,10 +1655,6 @@
1637
1655
  background-color: var(--primary, #2b5ce6);
1638
1656
  }
1639
1657
 
1640
- :where([data-designtools]) .bg-primary-foreground:not([data-docs-content] *), .bg-primary-foreground:where([data-designtools]):not([data-docs-content] *) {
1641
- background-color: var(--primary-foreground, #fff);
1642
- }
1643
-
1644
1658
  :where([data-designtools]) .bg-primary-subdued:not([data-docs-content] *), .bg-primary-subdued:where([data-designtools]):not([data-docs-content] *) {
1645
1659
  background-color: var(--primary-subdued, #eef2fd);
1646
1660
  }
@@ -1842,10 +1856,6 @@
1842
1856
  padding-block: 1.5rem;
1843
1857
  }
1844
1858
 
1845
- :where([data-designtools]) .py-7:not([data-docs-content] *), .py-7:where([data-designtools]):not([data-docs-content] *) {
1846
- padding-block: 1.75rem;
1847
- }
1848
-
1849
1859
  :where([data-designtools]) .py-8:not([data-docs-content] *), .py-8:where([data-designtools]):not([data-docs-content] *) {
1850
1860
  padding-block: 2rem;
1851
1861
  }
@@ -2155,6 +2165,10 @@
2155
2165
  letter-spacing: var(--tracking-wide, .04em);
2156
2166
  }
2157
2167
 
2168
+ :where([data-designtools]) .text-pretty:not([data-docs-content] *), .text-pretty:where([data-designtools]):not([data-docs-content] *) {
2169
+ text-wrap: pretty;
2170
+ }
2171
+
2158
2172
  :where([data-designtools]) .break-words:not([data-docs-content] *), .break-words:where([data-designtools]):not([data-docs-content] *) {
2159
2173
  overflow-wrap: break-word;
2160
2174
  }
@@ -2300,10 +2314,6 @@
2300
2314
  text-underline-offset: 4px;
2301
2315
  }
2302
2316
 
2303
- :where([data-designtools]) .underline-offset-\[6px\]:not([data-docs-content] *), .underline-offset-\[6px\]:where([data-designtools]):not([data-docs-content] *) {
2304
- text-underline-offset: 6px;
2305
- }
2306
-
2307
2317
  :where([data-designtools]) .opacity-0:not([data-docs-content] *), .opacity-0:where([data-designtools]):not([data-docs-content] *) {
2308
2318
  opacity: 0;
2309
2319
  }
@@ -2458,6 +2468,12 @@
2458
2468
  backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
2459
2469
  }
2460
2470
 
2471
+ :where([data-designtools]) .transition:not([data-docs-content] *), .transition:where([data-designtools]):not([data-docs-content] *) {
2472
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
2473
+ transition-timing-function: var(--tw-ease, cubic-bezier(.4, 0, .2, 1));
2474
+ transition-duration: var(--tw-duration, .15s);
2475
+ }
2476
+
2461
2477
  :where([data-designtools]) .transition-\[height\]:not([data-docs-content] *), .transition-\[height\]:where([data-designtools]):not([data-docs-content] *) {
2462
2478
  transition-property: height;
2463
2479
  transition-timing-function: var(--tw-ease, cubic-bezier(.4, 0, .2, 1));
@@ -2564,11 +2580,21 @@
2564
2580
  translate: var(--tw-translate-x) var(--tw-translate-y);
2565
2581
  }
2566
2582
 
2583
+ :where([data-designtools]) .group-hover\:translate-x-1:is(:where(.group):hover *):not([data-docs-content] *), .group-hover\:translate-x-1:is(:where(.group):hover *):where([data-designtools]):not([data-docs-content] *) {
2584
+ --tw-translate-x: .25rem;
2585
+ translate: var(--tw-translate-x) var(--tw-translate-y);
2586
+ }
2587
+
2567
2588
  :where([data-designtools]) .group-hover\:translate-x-full:is(:where(.group):hover *):not([data-docs-content] *), .group-hover\:translate-x-full:is(:where(.group):hover *):where([data-designtools]):not([data-docs-content] *) {
2568
2589
  --tw-translate-x: 100%;
2569
2590
  translate: var(--tw-translate-x) var(--tw-translate-y);
2570
2591
  }
2571
2592
 
2593
+ :where([data-designtools]) .group-hover\:-translate-y-0\.5:is(:where(.group):hover *):not([data-docs-content] *), .group-hover\:-translate-y-0\.5:is(:where(.group):hover *):where([data-designtools]):not([data-docs-content] *) {
2594
+ --tw-translate-y: calc(.25rem * -.5);
2595
+ translate: var(--tw-translate-x) var(--tw-translate-y);
2596
+ }
2597
+
2572
2598
  :where([data-designtools]) .group-hover\:text-canvas-foreground:is(:where(.group):hover *):not([data-docs-content] *), .group-hover\:text-canvas-foreground:is(:where(.group):hover *):where([data-designtools]):not([data-docs-content] *) {
2573
2599
  color: var(--canvas-foreground, #1c1f26);
2574
2600
  }
@@ -2577,10 +2603,6 @@
2577
2603
  text-decoration-line: underline;
2578
2604
  }
2579
2605
 
2580
- :where([data-designtools]) .group-hover\:underline-offset-4:is(:where(.group):hover *):not([data-docs-content] *), .group-hover\:underline-offset-4:is(:where(.group):hover *):where([data-designtools]):not([data-docs-content] *) {
2581
- text-underline-offset: 4px;
2582
- }
2583
-
2584
2606
  :where([data-designtools]) .group-hover\:opacity-100:is(:where(.group):hover *):not([data-docs-content] *), .group-hover\:opacity-100:is(:where(.group):hover *):where([data-designtools]):not([data-docs-content] *) {
2585
2607
  opacity: 1;
2586
2608
  }
@@ -2791,6 +2813,10 @@
2791
2813
  outline-offset: 2px;
2792
2814
  }
2793
2815
 
2816
+ :where([data-designtools]) .focus-visible\:outline-offset-4:focus-visible:not([data-docs-content] *), .focus-visible\:outline-offset-4:focus-visible:where([data-designtools]):not([data-docs-content] *) {
2817
+ outline-offset: 4px;
2818
+ }
2819
+
2794
2820
  :where([data-designtools]) .focus-visible\:outline-offset-\[-2px\]:focus-visible:not([data-docs-content] *), .focus-visible\:outline-offset-\[-2px\]:focus-visible:where([data-designtools]):not([data-docs-content] *) {
2795
2821
  outline-offset: -2px;
2796
2822
  }
@@ -2918,8 +2944,8 @@
2918
2944
  translate: var(--tw-translate-x) var(--tw-translate-y);
2919
2945
  }
2920
2946
 
2921
- :where([data-designtools]) .data-\[checked\]\:bg-primary[data-checked]:not([data-docs-content] *), .data-\[checked\]\:bg-primary[data-checked]:where([data-designtools]):not([data-docs-content] *) {
2922
- background-color: var(--primary, #2b5ce6);
2947
+ :where([data-designtools]) .data-\[checked\]\:bg-\[var\(--docs-accent\,var\(--primary\)\)\][data-checked]:not([data-docs-content] *), .data-\[checked\]\:bg-\[var\(--docs-accent\,var\(--primary\)\)\][data-checked]:where([data-designtools]):not([data-docs-content] *) {
2948
+ background-color: var(--docs-accent, var(--primary));
2923
2949
  }
2924
2950
 
2925
2951
  :where([data-designtools]) .data-\[highlighted\]\:bg-muted[data-highlighted]:not([data-docs-content] *), .data-\[highlighted\]\:bg-muted[data-highlighted]:where([data-designtools]):not([data-docs-content] *) {
@@ -3010,6 +3036,10 @@
3010
3036
  grid-column-start: 4;
3011
3037
  }
3012
3038
 
3039
+ :where([data-designtools]) .md\:mt-1\.5:not([data-docs-content] *), .md\:mt-1\.5:where([data-designtools]):not([data-docs-content] *) {
3040
+ margin-top: .375rem;
3041
+ }
3042
+
3013
3043
  :where([data-designtools]) .md\:block:not([data-docs-content] *), .md\:block:where([data-designtools]):not([data-docs-content] *) {
3014
3044
  display: block;
3015
3045
  }
@@ -3038,6 +3068,14 @@
3038
3068
  grid-template-columns: 12rem minmax(0, 1fr);
3039
3069
  }
3040
3070
 
3071
+ :where([data-designtools]) .md\:grid-cols-\[13rem_minmax\(0\,1fr\)_auto\]:not([data-docs-content] *), .md\:grid-cols-\[13rem_minmax\(0\,1fr\)_auto\]:where([data-designtools]):not([data-docs-content] *) {
3072
+ grid-template-columns: 13rem minmax(0, 1fr) auto;
3073
+ }
3074
+
3075
+ :where([data-designtools]) .md\:grid-cols-\[14rem_minmax\(0\,1fr\)_auto\]:not([data-docs-content] *), .md\:grid-cols-\[14rem_minmax\(0\,1fr\)_auto\]:where([data-designtools]):not([data-docs-content] *) {
3076
+ grid-template-columns: 14rem minmax(0, 1fr) auto;
3077
+ }
3078
+
3041
3079
  :where([data-designtools]) .md\:grid-cols-\[minmax\(9rem\,0\.9fr\)_minmax\(0\,1\.6fr\)_minmax\(5rem\,0\.6fr\)_1\.25rem\]:not([data-docs-content] *), .md\:grid-cols-\[minmax\(9rem\,0\.9fr\)_minmax\(0\,1\.6fr\)_minmax\(5rem\,0\.6fr\)_1\.25rem\]:where([data-designtools]):not([data-docs-content] *) {
3042
3080
  grid-template-columns: minmax(9rem, .9fr) minmax(0, 1.6fr) minmax(5rem, .6fr) 1.25rem;
3043
3081
  }
@@ -3089,14 +3127,6 @@
3089
3127
  }
3090
3128
 
3091
3129
  @media (min-width: 64rem) {
3092
- :where([data-designtools]) .lg\:sticky:not([data-docs-content] *), .lg\:sticky:where([data-designtools]):not([data-docs-content] *) {
3093
- position: sticky;
3094
- }
3095
-
3096
- :where([data-designtools]) .lg\:top-24:not([data-docs-content] *), .lg\:top-24:where([data-designtools]):not([data-docs-content] *) {
3097
- top: 6rem;
3098
- }
3099
-
3100
3130
  :where([data-designtools]) .lg\:col-span-1:not([data-docs-content] *), .lg\:col-span-1:where([data-designtools]):not([data-docs-content] *) {
3101
3131
  grid-column: span 1 / span 1;
3102
3132
  }
@@ -3145,10 +3175,6 @@
3145
3175
  grid-template-columns: repeat(4, minmax(0, 1fr));
3146
3176
  }
3147
3177
 
3148
- :where([data-designtools]) .lg\:grid-cols-\[3rem_minmax\(0\,1fr\)\]:not([data-docs-content] *), .lg\:grid-cols-\[3rem_minmax\(0\,1fr\)\]:where([data-designtools]):not([data-docs-content] *) {
3149
- grid-template-columns: 3rem minmax(0, 1fr);
3150
- }
3151
-
3152
3178
  :where([data-designtools]) .lg\:grid-cols-\[19rem_minmax\(0\,1fr\)\]:not([data-docs-content] *), .lg\:grid-cols-\[19rem_minmax\(0\,1fr\)\]:where([data-designtools]):not([data-docs-content] *) {
3153
3179
  grid-template-columns: 19rem minmax(0, 1fr);
3154
3180
  }
@@ -3177,10 +3203,6 @@
3177
3203
  gap: 6rem;
3178
3204
  }
3179
3205
 
3180
- :where([data-designtools]) .lg\:self-start:not([data-docs-content] *), .lg\:self-start:where([data-designtools]):not([data-docs-content] *) {
3181
- align-self: flex-start;
3182
- }
3183
-
3184
3206
  :where([data-designtools]) .lg\:overflow-y-auto:not([data-docs-content] *), .lg\:overflow-y-auto:where([data-designtools]):not([data-docs-content] *) {
3185
3207
  overflow-y: auto;
3186
3208
  }