@designtools/docs 0.2.2 → 0.2.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @designtools/docs
2
2
 
3
+ ## 0.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 62af842: The workbench no longer freezes on a component with a function prop it calls while rendering (Base UI's Meter and Progress, through `getAriaValueText`): only event handlers (`on…`) are logged to Actions, so logging can never re-render the component into calling it again. The overview's parts of the system are a typographic list: the name, why it exists and an arrow, with no glimpses or counts.
8
+
3
9
  ## 0.2.2
4
10
 
5
11
  ### Patch Changes
@@ -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";
@@ -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 ??
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 ??
172
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}.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 })] }));
173
166
  }
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
  }
@@ -1842,10 +1851,6 @@
1842
1851
  padding-block: 1.5rem;
1843
1852
  }
1844
1853
 
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
1854
  :where([data-designtools]) .py-8:not([data-docs-content] *), .py-8:where([data-designtools]):not([data-docs-content] *) {
1850
1855
  padding-block: 2rem;
1851
1856
  }
@@ -2300,10 +2305,6 @@
2300
2305
  text-underline-offset: 4px;
2301
2306
  }
2302
2307
 
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
2308
  :where([data-designtools]) .opacity-0:not([data-docs-content] *), .opacity-0:where([data-designtools]):not([data-docs-content] *) {
2308
2309
  opacity: 0;
2309
2310
  }
@@ -2458,6 +2459,12 @@
2458
2459
  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
2460
  }
2460
2461
 
2462
+ :where([data-designtools]) .transition:not([data-docs-content] *), .transition:where([data-designtools]):not([data-docs-content] *) {
2463
+ 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;
2464
+ transition-timing-function: var(--tw-ease, cubic-bezier(.4, 0, .2, 1));
2465
+ transition-duration: var(--tw-duration, .15s);
2466
+ }
2467
+
2461
2468
  :where([data-designtools]) .transition-\[height\]:not([data-docs-content] *), .transition-\[height\]:where([data-designtools]):not([data-docs-content] *) {
2462
2469
  transition-property: height;
2463
2470
  transition-timing-function: var(--tw-ease, cubic-bezier(.4, 0, .2, 1));
@@ -2564,11 +2571,21 @@
2564
2571
  translate: var(--tw-translate-x) var(--tw-translate-y);
2565
2572
  }
2566
2573
 
2574
+ :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] *) {
2575
+ --tw-translate-x: .25rem;
2576
+ translate: var(--tw-translate-x) var(--tw-translate-y);
2577
+ }
2578
+
2567
2579
  :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
2580
  --tw-translate-x: 100%;
2569
2581
  translate: var(--tw-translate-x) var(--tw-translate-y);
2570
2582
  }
2571
2583
 
2584
+ :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] *) {
2585
+ --tw-translate-y: calc(.25rem * -.5);
2586
+ translate: var(--tw-translate-x) var(--tw-translate-y);
2587
+ }
2588
+
2572
2589
  :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
2590
  color: var(--canvas-foreground, #1c1f26);
2574
2591
  }
@@ -2791,6 +2808,10 @@
2791
2808
  outline-offset: 2px;
2792
2809
  }
2793
2810
 
2811
+ :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] *) {
2812
+ outline-offset: 4px;
2813
+ }
2814
+
2794
2815
  :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
2816
  outline-offset: -2px;
2796
2817
  }
@@ -3010,6 +3031,10 @@
3010
3031
  grid-column-start: 4;
3011
3032
  }
3012
3033
 
3034
+ :where([data-designtools]) .md\:mt-1\.5:not([data-docs-content] *), .md\:mt-1\.5:where([data-designtools]):not([data-docs-content] *) {
3035
+ margin-top: .375rem;
3036
+ }
3037
+
3013
3038
  :where([data-designtools]) .md\:block:not([data-docs-content] *), .md\:block:where([data-designtools]):not([data-docs-content] *) {
3014
3039
  display: block;
3015
3040
  }
@@ -3038,6 +3063,10 @@
3038
3063
  grid-template-columns: 12rem minmax(0, 1fr);
3039
3064
  }
3040
3065
 
3066
+ :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] *) {
3067
+ grid-template-columns: 13rem minmax(0, 1fr) auto;
3068
+ }
3069
+
3041
3070
  :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
3071
  grid-template-columns: minmax(9rem, .9fr) minmax(0, 1.6fr) minmax(5rem, .6fr) 1.25rem;
3043
3072
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designtools/docs",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Design system docs as a package: pages, navigation, search, a workbench per component, rules, patterns, brand pages and markdown for agents, generated from the @designtools/manifest and themed by your tokens. One Next adapter serves them inside your app or as a standalone site.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,5 +1,6 @@
1
1
  import { ArrowRight, ArrowUpRight } from "lucide-react";
2
2
  import Link from "next/link";
3
+ import { cx, display } from "../lib/cx";
3
4
  import { AdherenceSummary } from "../adherence-summary";
4
5
  import { Anatomy } from "../anatomy";
5
6
  import { Examples } from "../examples";
@@ -305,57 +306,49 @@ function Overview({ site }: { site: Site }) {
305
306
  const count = families.reduce((n, g) => n + g.families.length, 0);
306
307
  const brandPages = site.editorial.filter((p) => (p.section ?? "brand") === "brand");
307
308
  const brandFirst = brandPages[0];
308
- const share = config.adherence?.summary.share;
309
309
 
310
- // each section of the system, why it exists and how much is in it
311
- const sections: { title: string; href: string; why: string; count: string }[] = [];
310
+ // each section of the system, and why it exists
311
+ const sections: { title: string; href: string; why: string }[] = [];
312
312
  if (brandFirst || site.shows("logo"))
313
313
  sections.push({
314
314
  title: "Brand",
315
315
  href: `${base}/${brandFirst?.slug ?? "brand/logo"}`,
316
316
  why: "What the brand believes, how it sounds and how it looks, so every screen and sentence comes from the same place.",
317
- count: `${brandPages.length + (site.assets.assets.some((a) => a.kind === "logo") ? 1 : 0)} pages`
318
317
  });
319
318
  sections.push({
320
319
  title: "Foundations",
321
320
  href: `${base}/colour`,
322
321
  why: "Colour, type and the scale, generated from the tokens and measured in both modes, so nothing is a guess.",
323
- count: `${site.tokens.tokens.length} tokens`,
324
322
  });
325
323
  if (site.rules.rules.length)
326
324
  sections.push({
327
325
  title: "Rules",
328
326
  href: `${base}/rules`,
329
327
  why: "The lines the brand and the interface hold, each written for people, with the check that proves it.",
330
- count: `${site.rules.rules.length} rules, ${site.rules.rules.filter((r) => r.status === "confirmed").length} confirmed`
331
328
  });
332
329
  if (site.shows("components") && count)
333
330
  sections.push({
334
331
  title: "Components",
335
332
  href: `${base}/components/${slugOf(families[0].families[0].head)}`,
336
333
  why: "The real components the product is built from, each with when to use it, a live workbench and an accessibility report.",
337
- count: `${count} components`
338
334
  });
339
335
  if (site.patterns.patterns.length)
340
336
  sections.push({
341
337
  title: "Patterns",
342
338
  href: `${base}/patterns/${site.patterns.patterns[0].id}`,
343
339
  why: "The screens the product keeps making, composed of the components, so a recurring problem is solved once.",
344
- count: `${site.patterns.patterns.length} patterns`
345
340
  });
346
341
  if (site.shows("standards") && (config.baselines || config.adherence))
347
342
  sections.push({
348
343
  title: "Standards",
349
344
  href: `${base}/standards`,
350
345
  why: "The bar the product is held to, and how closely it follows the system today, reported on every change.",
351
- count: share == null ? "Baselines agreed" : `${Math.round(share * 100)}% of the product on the system`
352
346
  });
353
347
  if (site.shows("vocabulary") && site.taxonomy.terms.length)
354
348
  sections.push({
355
349
  title: "Vocabulary",
356
350
  href: `${base}/vocabulary`,
357
351
  why: "One name for each thing, and the names people reach for instead, so people and agents mean the same thing.",
358
- count: `${site.taxonomy.terms.length} terms`
359
352
  });
360
353
 
361
354
  const loop = [
@@ -375,15 +368,19 @@ function Overview({ site }: { site: Site }) {
375
368
  )}
376
369
 
377
370
  <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.">
378
- <ul data-slot="overview-sections" className="grid gap-x-12 md:grid-cols-2">
371
+ <ul data-slot="overview-sections" className="flex flex-col border-b border-border">
379
372
  {sections.map((sec) => (
380
373
  <li key={sec.title} className="border-t border-border">
381
- <Link href={sec.href} className="group flex h-full flex-col gap-4 py-7 focus-visible:outline-2 focus-visible:outline-ring">
382
- <span className="flex items-baseline justify-between gap-4">
383
- <span className="text-2xl leading-tight tracking-tight underline-offset-[6px] group-hover:underline">{sec.title}</span>
384
- <span className="shrink-0 text-xs text-muted-foreground tabular-nums">{sec.count}</span>
385
- </span>
386
- <span className="max-w-md text-base leading-relaxed text-muted-foreground">{sec.why}</span>
374
+ <Link
375
+ href={sec.href}
376
+ 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]"
377
+ >
378
+ <span className={cx(display, "text-2xl leading-snug tracking-tight underline-offset-4 group-hover:underline")}>{sec.title}</span>
379
+ <span className="max-w-2xl text-base leading-relaxed text-muted-foreground">{sec.why}</span>
380
+ <ArrowUpRight
381
+ aria-hidden
382
+ 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"
383
+ />
387
384
  </Link>
388
385
  </li>
389
386
  ))}