@designtools/docs 0.1.0 → 0.2.1
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 +16 -0
- package/README.md +24 -2
- package/dist/anatomy.js +2 -1
- package/dist/cli.js +1 -1
- package/dist/glossary.d.ts +1 -1
- package/dist/glossary.js +13 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/lib/live.d.ts +10 -0
- package/dist/lib/live.js +10 -0
- package/dist/lib/lookup.js +3 -2
- package/dist/lib/status.d.ts +2 -3
- package/dist/lib/terms.d.ts +15 -0
- package/dist/lib/terms.js +20 -0
- package/dist/next/config.d.ts +24 -4
- package/dist/next/index.d.ts +3 -0
- package/dist/next/index.js +3 -0
- package/dist/next/markdown.js +1 -1
- package/dist/next/pages.js +82 -16
- package/dist/next/prose.d.ts +2 -2
- package/dist/next/prose.js +6 -4
- package/dist/pattern.d.ts +4 -1
- package/dist/pattern.js +11 -8
- package/dist/playground.js +1 -1
- package/dist/rule.d.ts +9 -5
- package/dist/rule.js +14 -9
- package/dist/shell.d.ts +4 -1
- package/dist/shell.js +13 -11
- package/dist/styles.css +961 -754
- package/dist/swatches.d.ts +7 -6
- package/dist/swatches.js +50 -16
- package/dist/variant-matrix.js +11 -6
- package/dist/voice-terms.js +6 -5
- package/dist/workbench.js +2 -1
- package/package.json +1 -1
- package/src/anatomy.tsx +6 -1
- package/src/glossary.tsx +39 -40
- package/src/index.ts +2 -1
- package/src/lib/live.tsx +15 -0
- package/src/lib/lookup.tsx +3 -2
- package/src/lib/status.tsx +3 -3
- package/src/lib/terms.tsx +53 -0
- package/src/next/config.ts +25 -4
- package/src/next/index.tsx +3 -0
- package/src/next/markdown.ts +1 -1
- package/src/next/pages.tsx +172 -59
- package/src/next/prose.tsx +16 -6
- package/src/pattern.tsx +42 -37
- package/src/playground.tsx +7 -2
- package/src/rule.tsx +108 -59
- package/src/shell.tsx +30 -16
- package/src/styles.css +4 -2
- package/src/swatches.tsx +189 -120
- package/src/variant-matrix.tsx +63 -80
- package/src/voice-terms.tsx +20 -29
- package/src/workbench.tsx +6 -3
package/src/voice-terms.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TermEntry } from "./lib/manifest-types";
|
|
2
|
-
import {
|
|
2
|
+
import { TermHead, TermRow } from "./lib/terms";
|
|
3
|
+
import { DocsSection } from "./shell";
|
|
3
4
|
|
|
4
5
|
/** The words to use, beside the ones not to: the product's words first, then the system's names that have wrong forms. */
|
|
5
6
|
export function VoiceTerms({ terms }: { terms: TermEntry[] }) {
|
|
@@ -7,40 +8,30 @@ export function VoiceTerms({ terms }: { terms: TermEntry[] }) {
|
|
|
7
8
|
const system = terms.filter((t) => t.kind !== "product" && t.wrong?.length);
|
|
8
9
|
if (product.length + system.length === 0) return <p className="text-sm text-muted-foreground">No terms yet. Add them to the taxonomy file.</p>;
|
|
9
10
|
return (
|
|
10
|
-
|
|
11
|
-
{product.length > 0 &&
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
<>
|
|
12
|
+
{product.length > 0 && (
|
|
13
|
+
<DocsSection title="In the product" lead="The words the product uses with the people it serves, in copy, on screens and in emails.">
|
|
14
|
+
<Terms terms={product} />
|
|
15
|
+
</DocsSection>
|
|
16
|
+
)}
|
|
17
|
+
{system.length > 0 && (
|
|
18
|
+
<DocsSection title="In the system" lead="The names the design system gives its parts, and the ones people reach for instead.">
|
|
19
|
+
<Terms terms={system} />
|
|
20
|
+
</DocsSection>
|
|
21
|
+
)}
|
|
22
|
+
</>
|
|
14
23
|
);
|
|
15
24
|
}
|
|
16
25
|
|
|
17
|
-
function
|
|
26
|
+
function Terms({ terms }: { terms: TermEntry[] }) {
|
|
18
27
|
return (
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
<dl
|
|
28
|
+
<div data-slot="voice-terms">
|
|
29
|
+
<TermHead />
|
|
30
|
+
<dl>
|
|
22
31
|
{terms.map((t) => (
|
|
23
|
-
<
|
|
24
|
-
<dt className="text-3xl tracking-tight">
|
|
25
|
-
{t.name}
|
|
26
|
-
<span className="sr-only">, say this</span>
|
|
27
|
-
</dt>
|
|
28
|
-
{(t.wrong ?? []).length > 0 && (
|
|
29
|
-
<dd className="flex flex-wrap gap-x-3 text-base text-muted-foreground">
|
|
30
|
-
<span className="sr-only">not </span>
|
|
31
|
-
{(t.wrong ?? []).map((w) => (
|
|
32
|
-
<s key={w} className="decoration-destructive decoration-2">
|
|
33
|
-
{w}
|
|
34
|
-
</s>
|
|
35
|
-
))}
|
|
36
|
-
</dd>
|
|
37
|
-
)}
|
|
38
|
-
{(t.note || t.kind !== "product") && (
|
|
39
|
-
<dd className="text-sm text-muted-foreground">{t.note ? inline(t.note) : `The ${t.kind}'s name in the code.`}</dd>
|
|
40
|
-
)}
|
|
41
|
-
</div>
|
|
32
|
+
<TermRow key={`${t.kind}:${t.name}`} term={t} />
|
|
42
33
|
))}
|
|
43
34
|
</dl>
|
|
44
|
-
</
|
|
35
|
+
</div>
|
|
45
36
|
);
|
|
46
37
|
}
|
package/src/workbench.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import { Live } from "./lib/live";
|
|
3
4
|
import { Tabs } from "@base-ui/react/tabs";
|
|
4
5
|
import { Toggle } from "@base-ui/react/toggle";
|
|
5
6
|
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
@@ -267,9 +268,11 @@ export function Workbench({
|
|
|
267
268
|
const dotted = view.bg === "canvas";
|
|
268
269
|
|
|
269
270
|
const node = (
|
|
270
|
-
<
|
|
271
|
-
{
|
|
272
|
-
|
|
271
|
+
<Live>
|
|
272
|
+
<Component {...base} {...logged} {...chosen}>
|
|
273
|
+
{content ?? (text || undefined)}
|
|
274
|
+
</Component>
|
|
275
|
+
</Live>
|
|
273
276
|
);
|
|
274
277
|
const scope = [
|
|
275
278
|
entry.name,
|