@reqvire-org/ads 0.3.41 → 0.3.43
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/README.md +7 -4
- package/dist/bootstrap-ds/ADS.md +2 -1
- package/dist/bootstrap-ds/README.md +23 -14
- package/dist/bootstrap-ds/design-system/components/Actions/Button/Button.ads.fixture.ts +1 -0
- package/dist/bootstrap-ds/design-system/components/Actions/Button/Button.ads.scenario.tsx +13 -0
- package/dist/bootstrap-ds/design-system/components/Actions/Button/Button.tsx +49 -0
- package/dist/bootstrap-ds/design-system/components/Actions/Button/README.md +12 -0
- package/dist/bootstrap-ds/design-system/components/Forms/TextField/README.md +14 -0
- package/dist/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.fixture.ts +6 -0
- package/dist/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +13 -0
- package/dist/bootstrap-ds/design-system/components/Forms/TextField/TextField.tsx +57 -0
- package/dist/bootstrap-ds/design-system/composition/Search/SearchPage/README.md +4 -0
- package/dist/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +7 -0
- package/dist/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +16 -0
- package/dist/bootstrap-ds/design-system/index.ts +4 -1
- package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/README.md +12 -0
- package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +1 -0
- package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +11 -0
- package/dist/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.tsx +41 -0
- package/dist/bootstrap-ds/design-system/review/demo-frame/DemoFrame.tsx +29 -0
- package/dist/bootstrap-ds/design-system/review/index.ts +2 -0
- package/dist/bootstrap-ds/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
- package/dist/bootstrap-ds/design-system/review/token-preview/TokenPreview.tsx +107 -19
- package/dist/bootstrap-ds/design-system/tokens/Color.ads.fixture.ts +18 -0
- package/dist/bootstrap-ds/design-system/tokens/{Foundation.ads.scenario.tsx → Color.ads.scenario.tsx} +1 -1
- package/dist/{skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Foundation.ads.fixture.ts → bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.fixture.ts} +1 -13
- package/dist/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.scenario.tsx +4 -0
- package/dist/bootstrap-ds-preact/design-system/review/demo-frame/DemoFrame.tsx +29 -0
- package/dist/bootstrap-ds-preact/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
- package/dist/bootstrap-ds-preact/design-system/review/token-preview/TokenPreview.tsx +119 -0
- package/dist/bootstrap-ds-preact/design-system/showcase/mcp/main.tsx +6 -0
- package/dist/bootstrap-ds-preact/ds.config.json +19 -0
- package/dist/bootstrap-ds-preact/package.json +38 -0
- package/dist/bootstrap-ds-preact/src/vite-env.d.ts +7 -0
- package/dist/bootstrap-ds-preact/tsconfig.json +36 -0
- package/dist/bootstrap-ds-preact/vite.config.ts +23 -0
- package/dist/bun-compiler.mjs +8 -4
- package/dist/cli.mjs +7 -4
- package/dist/init.mjs +15 -7
- package/dist/mcp/execution-results.mjs +1 -0
- package/dist/mcp/mutations.mjs +1 -1
- package/dist/mcp/server.mjs +10 -8
- package/dist/mcp/showcase-host.mjs +5 -1
- package/dist/preview-builder.mjs +8 -2
- package/dist/scenarios-compiler.mjs +28 -1
- package/dist/skills/ads-break-ui/SKILL.md +2 -2
- package/dist/skills/ads-break-ui/references/validation.md +13 -0
- package/dist/skills/ads-designer/SKILL.md +33 -19
- package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +2 -1
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +23 -14
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.ads.fixture.ts +1 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.ads.scenario.tsx +13 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.tsx +49 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/README.md +12 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/README.md +14 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.fixture.ts +6 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +13 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.tsx +57 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/README.md +4 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +7 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +16 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +4 -1
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/README.md +12 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +1 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +11 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.tsx +41 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/demo-frame/DemoFrame.tsx +29 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/index.ts +2 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/token-preview/TokenPreview.tsx +107 -19
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Color.ads.fixture.ts +18 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/{Foundation.ads.scenario.tsx → Color.ads.scenario.tsx} +1 -1
- package/dist/{bootstrap-ds/design-system/tokens/Foundation.ads.fixture.ts → skills/ads-designer/assets/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.fixture.ts} +1 -13
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.scenario.tsx +4 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/demo-frame/DemoFrame.tsx +29 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/screen-frame/ScreenFrame.tsx +34 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/token-preview/TokenPreview.tsx +119 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/showcase/mcp/main.tsx +6 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/ds.config.json +19 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/package.json +38 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/src/vite-env.d.ts +7 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/tsconfig.json +36 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/vite.config.ts +23 -0
- package/dist/skills/ads-designer/references/cli.md +7 -2
- package/dist/skills/ads-designer/references/design-craft.md +1 -1
- package/dist/skills/ads-designer/references/validation.md +13 -0
- package/dist/skills/ads-import/SKILL.md +2 -2
- package/dist/skills/ads-import/references/cli.md +7 -2
- package/dist/skills/ads-import/references/validation.md +13 -0
- package/dist/skills/ads-motion/SKILL.md +2 -2
- package/dist/skills/ads-motion/references/validation.md +13 -0
- package/dist/skills/ads-port/SKILL.md +3 -3
- package/dist/skills/ads-port/references/cli.md +7 -2
- package/dist/skills/ads-port/references/validation.md +13 -0
- package/dist/task-cache.mjs +122 -0
- package/dist/task-worker.mjs +19 -0
- package/dist/validation-checks.mjs +7 -9
- package/dist/validation.mjs +3 -3
- package/docs/ADS.md +7 -7
- package/docs/ARCHITECTURE.md +12 -2
- package/docs/CACHING.md +99 -0
- package/docs/CHANGELOG.md +46 -12
- package/docs/GUIDE.md +16 -14
- package/docs/benchmarks/turbo-poc.md +266 -0
- package/package.json +4 -3
- package/dist/bootstrap-ds/design-system/components/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/composition/.gitkeep +0 -0
- package/dist/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
- package/dist/check-runner.mjs +0 -7
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/.gitkeep +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { css } from "@linaria/atomic";
|
|
3
|
+
|
|
4
|
+
export interface ScreenFrameProps { title: string; description?: string; children?: ReactNode; }
|
|
5
|
+
|
|
6
|
+
const frame = css`
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: var(--space-8);
|
|
10
|
+
max-width: calc(var(--space-16) * 20);
|
|
11
|
+
padding: var(--space-12);
|
|
12
|
+
`;
|
|
13
|
+
const heading = css`
|
|
14
|
+
margin: 0;
|
|
15
|
+
font-size: var(--text-xl);
|
|
16
|
+
font-weight: var(--weight-semibold);
|
|
17
|
+
line-height: var(--leading-tight);
|
|
18
|
+
color: var(--text-strong);
|
|
19
|
+
`;
|
|
20
|
+
const lead = css`
|
|
21
|
+
margin: 0;
|
|
22
|
+
color: var(--text-muted);
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
/** Development-only page framing for composition scenarios: a heading and the page width. */
|
|
26
|
+
export function ScreenFrame({ title, description, children }: ScreenFrameProps) {
|
|
27
|
+
return (
|
|
28
|
+
<main className={frame}>
|
|
29
|
+
<h1 className={heading}>{title}</h1>
|
|
30
|
+
{description ? <p className={lead}>{description}</p> : null}
|
|
31
|
+
{children}
|
|
32
|
+
</main>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -1,31 +1,119 @@
|
|
|
1
|
-
import { useLayoutEffect, useRef } from "react";
|
|
1
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
2
2
|
import { css, cx } from "@linaria/atomic";
|
|
3
3
|
|
|
4
4
|
export interface TokenSample { token: `--${string}`; property: string; }
|
|
5
5
|
export interface TokenPreviewProps { title: string; samples: readonly TokenSample[]; text: string; }
|
|
6
|
+
|
|
7
|
+
const grid = css`
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: repeat(auto-fill, minmax(calc(var(--space-8) * 10), 1fr));
|
|
10
|
+
gap: var(--space-8);
|
|
11
|
+
padding: var(--space-8);
|
|
12
|
+
`;
|
|
13
|
+
const heading = css`
|
|
14
|
+
grid-column: 1 / -1;
|
|
15
|
+
margin: 0;
|
|
16
|
+
font-size: var(--text-base);
|
|
17
|
+
font-weight: var(--weight-semibold);
|
|
18
|
+
color: var(--text-body);
|
|
19
|
+
`;
|
|
20
|
+
const tile = css`
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: var(--space-4);
|
|
24
|
+
padding: var(--space-8);
|
|
25
|
+
border: var(--border-w) solid var(--border-default);
|
|
26
|
+
border-radius: var(--radius-md);
|
|
27
|
+
background: var(--bg-surface);
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
`;
|
|
30
|
+
const label = css`
|
|
31
|
+
font-size: var(--text-sm);
|
|
32
|
+
color: var(--text-muted);
|
|
33
|
+
overflow-wrap: anywhere;
|
|
34
|
+
`;
|
|
35
|
+
// Each sample shows its token through the property it styles: colors as swatches, lengths as
|
|
36
|
+
// bars, radius as a shape, type as text.
|
|
6
37
|
const sampleStyle = css`
|
|
7
|
-
display:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
&[data-ads-property="
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
&[data-ads-property="
|
|
38
|
+
display: block;
|
|
39
|
+
min-height: calc(var(--space-8) * 2);
|
|
40
|
+
color: var(--text-body);
|
|
41
|
+
font-size: var(--text-base);
|
|
42
|
+
&[data-ads-property="background-color"] {
|
|
43
|
+
border: var(--border-w) solid var(--border-default);
|
|
44
|
+
border-radius: var(--radius-md);
|
|
45
|
+
background-color: var(--ux-token-preview-value);
|
|
46
|
+
}
|
|
47
|
+
&[data-ads-property="color"] { color: var(--ux-token-preview-value); font-size: calc(var(--text-base) * 2); line-height: 1; }
|
|
48
|
+
&[data-ads-property="width"] {
|
|
49
|
+
width: var(--ux-token-preview-value);
|
|
50
|
+
min-height: var(--space-8);
|
|
51
|
+
background: var(--accent);
|
|
52
|
+
}
|
|
53
|
+
&[data-ads-property="border-radius"] {
|
|
54
|
+
width: calc(var(--space-8) * 3);
|
|
55
|
+
border: var(--focus-w) solid var(--accent);
|
|
56
|
+
border-radius: var(--ux-token-preview-value);
|
|
57
|
+
}
|
|
58
|
+
&[data-ads-property="font-family"] { font-family: var(--ux-token-preview-value); font-size: calc(var(--text-base) * 2); line-height: 1; }
|
|
17
59
|
&[data-ads-property="font-size"] { font-size: var(--ux-token-preview-value); }
|
|
18
|
-
&[data-ads-property="font-weight"] { font-weight: var(--ux-token-preview-value); }
|
|
60
|
+
&[data-ads-property="font-weight"] { font-weight: var(--ux-token-preview-value); font-size: calc(var(--text-base) * 2); line-height: 1; }
|
|
19
61
|
&[data-ads-property="line-height"] { line-height: var(--ux-token-preview-value); }
|
|
20
|
-
&[data-ads-property="
|
|
21
|
-
|
|
62
|
+
&[data-ads-property="box-shadow"] {
|
|
63
|
+
border-radius: var(--radius-md);
|
|
64
|
+
background: var(--bg-surface);
|
|
65
|
+
box-shadow: var(--ux-token-preview-value);
|
|
66
|
+
}
|
|
67
|
+
/* Durations and easing move a dot across the tile. */
|
|
68
|
+
&[data-ads-property="animation-duration"], &[data-ads-property="animation-timing-function"] {
|
|
69
|
+
width: var(--space-8);
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
background: var(--accent);
|
|
72
|
+
animation-name: ux-token-preview-travel;
|
|
73
|
+
animation-iteration-count: infinite;
|
|
74
|
+
animation-direction: alternate;
|
|
75
|
+
}
|
|
76
|
+
&[data-ads-property="animation-duration"] {
|
|
77
|
+
animation-duration: calc(var(--ux-token-preview-value) * 8);
|
|
78
|
+
animation-timing-function: var(--ease-standard);
|
|
79
|
+
}
|
|
80
|
+
&[data-ads-property="animation-timing-function"] {
|
|
81
|
+
animation-duration: calc(var(--dur-normal) * 6);
|
|
82
|
+
animation-timing-function: var(--ux-token-preview-value);
|
|
83
|
+
}
|
|
84
|
+
&[data-ads-property="z-index"] { z-index: var(--ux-token-preview-value); position: relative; }
|
|
85
|
+
@keyframes ux-token-preview-travel { to { transform: translateX(calc(var(--space-8) * 6)); } }
|
|
22
86
|
`;
|
|
23
|
-
|
|
87
|
+
|
|
88
|
+
function TokenTile({ sample, text }: { sample: TokenSample; text: string }) {
|
|
24
89
|
const ref = useRef<HTMLSpanElement>(null);
|
|
25
|
-
|
|
26
|
-
|
|
90
|
+
const [value, setValue] = useState("");
|
|
91
|
+
useLayoutEffect(() => {
|
|
92
|
+
ref.current?.style.setProperty("--ux-token-preview-value", `var(${sample.token})`);
|
|
93
|
+
// The value as the page computes it now, again when the theme changes.
|
|
94
|
+
const read = () => setValue(getComputedStyle(document.documentElement).getPropertyValue(sample.token).trim());
|
|
95
|
+
read();
|
|
96
|
+
const observer = new MutationObserver(read);
|
|
97
|
+
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["data-theme"] });
|
|
98
|
+
return () => observer.disconnect();
|
|
99
|
+
}, [sample.token]);
|
|
100
|
+
return (
|
|
101
|
+
<article className={cx("ux-token-preview__item", tile)}>
|
|
102
|
+
<span ref={ref} className={cx("ux-token-preview__sample", sampleStyle)} data-ads-token={sample.token} data-ads-property={sample.property}>
|
|
103
|
+
{["background-color", "width", "border-radius", "box-shadow", "animation-duration", "animation-timing-function"].includes(sample.property) ? "" : text}
|
|
104
|
+
</span>
|
|
105
|
+
<code className={cx("ux-token-preview__name", label)}>{sample.token}</code>
|
|
106
|
+
<small className={label}>{value}</small>
|
|
107
|
+
</article>
|
|
108
|
+
);
|
|
27
109
|
}
|
|
28
|
-
|
|
110
|
+
|
|
111
|
+
/** Project-owned review UI: one tile per token. Values always come from the real foundation CSS. */
|
|
29
112
|
export function TokenPreview({ title, samples, text }: TokenPreviewProps) {
|
|
30
|
-
return
|
|
113
|
+
return (
|
|
114
|
+
<section aria-label={title} className={cx("ux-token-preview", grid)}>
|
|
115
|
+
<h1 className={heading}>{title}</h1>
|
|
116
|
+
{samples.map(sample => <TokenTile key={`${sample.token}:${sample.property}`} sample={sample} text={text} />)}
|
|
117
|
+
</section>
|
|
118
|
+
);
|
|
31
119
|
}
|
package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Color.ads.fixture.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const fixture = {
|
|
2
|
+
"title": "Color",
|
|
3
|
+
"text": "Aa",
|
|
4
|
+
samples: [
|
|
5
|
+
{"token": "--accent", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
6
|
+
{"token": "--accent-fg", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
7
|
+
{"token": "--accent-hover", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
8
|
+
{"token": "--bg-canvas", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
9
|
+
{"token": "--bg-hover", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
10
|
+
{"token": "--bg-surface", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
11
|
+
{"token": "--border-default", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
12
|
+
{"token": "--border-focus", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
13
|
+
{"token": "--text-body", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
14
|
+
{"token": "--text-inverse", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
15
|
+
{"token": "--text-muted", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
16
|
+
{"token": "--text-strong", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
17
|
+
]
|
|
18
|
+
} as const;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TokenPreview } from "@ds/review";
|
|
2
|
-
import { fixture } from "./
|
|
2
|
+
import { fixture } from "./Color.ads.fixture";
|
|
3
3
|
export const scenario = { title: fixture.title, covers: ["TokenPreview"], samples: fixture.samples };
|
|
4
4
|
export default function Scenario() { return <TokenPreview {...fixture} />; }
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
export const fixture = {
|
|
2
|
-
"title": "
|
|
2
|
+
"title": "Space, type & motion",
|
|
3
3
|
"text": "Aa",
|
|
4
4
|
samples: [
|
|
5
|
-
{"token": "--accent", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
6
|
-
{"token": "--accent-fg", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
7
|
-
{"token": "--accent-hover", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
8
|
-
{"token": "--bg-canvas", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
9
|
-
{"token": "--bg-hover", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
10
|
-
{"token": "--bg-surface", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
11
|
-
{"token": "--border-default", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
12
|
-
{"token": "--border-focus", "property": "background-color", "probe": "rgb(31, 97, 163)"},
|
|
13
5
|
{"token": "--border-w", "property": "width", "probe": "13.375px"},
|
|
14
6
|
{"token": "--dur-fast", "property": "animation-duration", "probe": "0.375s"},
|
|
15
7
|
{"token": "--dur-normal", "property": "animation-duration", "probe": "0.375s"},
|
|
@@ -33,12 +25,8 @@ export const fixture = {
|
|
|
33
25
|
{"token": "--space-6", "property": "width", "probe": "13.375px"},
|
|
34
26
|
{"token": "--space-8", "property": "width", "probe": "13.375px"},
|
|
35
27
|
{"token": "--text-base", "property": "font-size", "probe": "41.375px"},
|
|
36
|
-
{"token": "--text-body", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
37
|
-
{"token": "--text-inverse", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
38
28
|
{"token": "--text-lg", "property": "font-size", "probe": "41.375px"},
|
|
39
|
-
{"token": "--text-muted", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
40
29
|
{"token": "--text-sm", "property": "font-size", "probe": "41.375px"},
|
|
41
|
-
{"token": "--text-strong", "property": "color", "probe": "rgb(31, 97, 163)"},
|
|
42
30
|
{"token": "--text-xl", "property": "font-size", "probe": "41.375px"},
|
|
43
31
|
{"token": "--weight-medium", "property": "font-weight", "probe": "327"},
|
|
44
32
|
{"token": "--weight-normal", "property": "font-weight", "probe": "327"},
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TokenPreview } from "@ds/review";
|
|
2
|
+
import { fixture } from "./SpaceTypeMotion.ads.fixture";
|
|
3
|
+
export const scenario = { title: fixture.title, covers: ["TokenPreview"], samples: fixture.samples };
|
|
4
|
+
export default function Scenario() { return <TokenPreview {...fixture} />; }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ComponentChildren } from "preact";
|
|
2
|
+
import { css, cx } from "@linaria/atomic";
|
|
3
|
+
|
|
4
|
+
export interface DemoFrameProps {
|
|
5
|
+
/** `row` lays examples side by side; `column` stacks them at a readable width. */
|
|
6
|
+
layout?: "row" | "column";
|
|
7
|
+
children?: ComponentChildren;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const frame = css`
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: var(--space-8);
|
|
13
|
+
padding: var(--space-12);
|
|
14
|
+
`;
|
|
15
|
+
const layouts = {
|
|
16
|
+
row: css`
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
align-items: flex-start;
|
|
19
|
+
`,
|
|
20
|
+
column: css`
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
max-width: calc(var(--space-16) * 12);
|
|
23
|
+
`,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** Development-only framing for component and pattern scenarios: spacing between examples. */
|
|
27
|
+
export function DemoFrame({ layout = "row", children }: DemoFrameProps) {
|
|
28
|
+
return <div className={cx(frame, layouts[layout])}>{children}</div>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ComponentChildren } from "preact";
|
|
2
|
+
import { css } from "@linaria/atomic";
|
|
3
|
+
|
|
4
|
+
export interface ScreenFrameProps { title: string; description?: string; children?: ComponentChildren; }
|
|
5
|
+
|
|
6
|
+
const frame = css`
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: var(--space-8);
|
|
10
|
+
max-width: calc(var(--space-16) * 20);
|
|
11
|
+
padding: var(--space-12);
|
|
12
|
+
`;
|
|
13
|
+
const heading = css`
|
|
14
|
+
margin: 0;
|
|
15
|
+
font-size: var(--text-xl);
|
|
16
|
+
font-weight: var(--weight-semibold);
|
|
17
|
+
line-height: var(--leading-tight);
|
|
18
|
+
color: var(--text-strong);
|
|
19
|
+
`;
|
|
20
|
+
const lead = css`
|
|
21
|
+
margin: 0;
|
|
22
|
+
color: var(--text-muted);
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
/** Development-only page framing for composition scenarios: a heading and the page width. */
|
|
26
|
+
export function ScreenFrame({ title, description, children }: ScreenFrameProps) {
|
|
27
|
+
return (
|
|
28
|
+
<main className={frame}>
|
|
29
|
+
<h1 className={heading}>{title}</h1>
|
|
30
|
+
{description ? <p className={lead}>{description}</p> : null}
|
|
31
|
+
{children}
|
|
32
|
+
</main>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { useLayoutEffect, useRef, useState } from "preact/hooks";
|
|
2
|
+
import { css, cx } from "@linaria/atomic";
|
|
3
|
+
|
|
4
|
+
export interface TokenSample { token: `--${string}`; property: string; }
|
|
5
|
+
export interface TokenPreviewProps { title: string; samples: readonly TokenSample[]; text: string; }
|
|
6
|
+
|
|
7
|
+
const grid = css`
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: repeat(auto-fill, minmax(calc(var(--space-8) * 10), 1fr));
|
|
10
|
+
gap: var(--space-8);
|
|
11
|
+
padding: var(--space-8);
|
|
12
|
+
`;
|
|
13
|
+
const heading = css`
|
|
14
|
+
grid-column: 1 / -1;
|
|
15
|
+
margin: 0;
|
|
16
|
+
font-size: var(--text-base);
|
|
17
|
+
font-weight: var(--weight-semibold);
|
|
18
|
+
color: var(--text-body);
|
|
19
|
+
`;
|
|
20
|
+
const tile = css`
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: var(--space-4);
|
|
24
|
+
padding: var(--space-8);
|
|
25
|
+
border: var(--border-w) solid var(--border-default);
|
|
26
|
+
border-radius: var(--radius-md);
|
|
27
|
+
background: var(--bg-surface);
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
`;
|
|
30
|
+
const label = css`
|
|
31
|
+
font-size: var(--text-sm);
|
|
32
|
+
color: var(--text-muted);
|
|
33
|
+
overflow-wrap: anywhere;
|
|
34
|
+
`;
|
|
35
|
+
// Each sample shows its token through the property it styles: colors as swatches, lengths as
|
|
36
|
+
// bars, radius as a shape, type as text.
|
|
37
|
+
const sampleStyle = css`
|
|
38
|
+
display: block;
|
|
39
|
+
min-height: calc(var(--space-8) * 2);
|
|
40
|
+
color: var(--text-body);
|
|
41
|
+
font-size: var(--text-base);
|
|
42
|
+
&[data-ads-property="background-color"] {
|
|
43
|
+
border: var(--border-w) solid var(--border-default);
|
|
44
|
+
border-radius: var(--radius-md);
|
|
45
|
+
background-color: var(--ux-token-preview-value);
|
|
46
|
+
}
|
|
47
|
+
&[data-ads-property="color"] { color: var(--ux-token-preview-value); font-size: calc(var(--text-base) * 2); line-height: 1; }
|
|
48
|
+
&[data-ads-property="width"] {
|
|
49
|
+
width: var(--ux-token-preview-value);
|
|
50
|
+
min-height: var(--space-8);
|
|
51
|
+
background: var(--accent);
|
|
52
|
+
}
|
|
53
|
+
&[data-ads-property="border-radius"] {
|
|
54
|
+
width: calc(var(--space-8) * 3);
|
|
55
|
+
border: var(--focus-w) solid var(--accent);
|
|
56
|
+
border-radius: var(--ux-token-preview-value);
|
|
57
|
+
}
|
|
58
|
+
&[data-ads-property="font-family"] { font-family: var(--ux-token-preview-value); font-size: calc(var(--text-base) * 2); line-height: 1; }
|
|
59
|
+
&[data-ads-property="font-size"] { font-size: var(--ux-token-preview-value); }
|
|
60
|
+
&[data-ads-property="font-weight"] { font-weight: var(--ux-token-preview-value); font-size: calc(var(--text-base) * 2); line-height: 1; }
|
|
61
|
+
&[data-ads-property="line-height"] { line-height: var(--ux-token-preview-value); }
|
|
62
|
+
&[data-ads-property="box-shadow"] {
|
|
63
|
+
border-radius: var(--radius-md);
|
|
64
|
+
background: var(--bg-surface);
|
|
65
|
+
box-shadow: var(--ux-token-preview-value);
|
|
66
|
+
}
|
|
67
|
+
/* Durations and easing move a dot across the tile. */
|
|
68
|
+
&[data-ads-property="animation-duration"], &[data-ads-property="animation-timing-function"] {
|
|
69
|
+
width: var(--space-8);
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
background: var(--accent);
|
|
72
|
+
animation-name: ux-token-preview-travel;
|
|
73
|
+
animation-iteration-count: infinite;
|
|
74
|
+
animation-direction: alternate;
|
|
75
|
+
}
|
|
76
|
+
&[data-ads-property="animation-duration"] {
|
|
77
|
+
animation-duration: calc(var(--ux-token-preview-value) * 8);
|
|
78
|
+
animation-timing-function: var(--ease-standard);
|
|
79
|
+
}
|
|
80
|
+
&[data-ads-property="animation-timing-function"] {
|
|
81
|
+
animation-duration: calc(var(--dur-normal) * 6);
|
|
82
|
+
animation-timing-function: var(--ux-token-preview-value);
|
|
83
|
+
}
|
|
84
|
+
&[data-ads-property="z-index"] { z-index: var(--ux-token-preview-value); position: relative; }
|
|
85
|
+
@keyframes ux-token-preview-travel { to { transform: translateX(calc(var(--space-8) * 6)); } }
|
|
86
|
+
`;
|
|
87
|
+
|
|
88
|
+
function TokenTile({ sample, text }: { sample: TokenSample; text: string }) {
|
|
89
|
+
const ref = useRef<HTMLSpanElement>(null);
|
|
90
|
+
const [value, setValue] = useState("");
|
|
91
|
+
useLayoutEffect(() => {
|
|
92
|
+
ref.current?.style.setProperty("--ux-token-preview-value", `var(${sample.token})`);
|
|
93
|
+
// The value as the page computes it now, again when the theme changes.
|
|
94
|
+
const read = () => setValue(getComputedStyle(document.documentElement).getPropertyValue(sample.token).trim());
|
|
95
|
+
read();
|
|
96
|
+
const observer = new MutationObserver(read);
|
|
97
|
+
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["data-theme"] });
|
|
98
|
+
return () => observer.disconnect();
|
|
99
|
+
}, [sample.token]);
|
|
100
|
+
return (
|
|
101
|
+
<article className={cx("ux-token-preview__item", tile)}>
|
|
102
|
+
<span ref={ref} className={cx("ux-token-preview__sample", sampleStyle)} data-ads-token={sample.token} data-ads-property={sample.property}>
|
|
103
|
+
{["background-color", "width", "border-radius", "box-shadow", "animation-duration", "animation-timing-function"].includes(sample.property) ? "" : text}
|
|
104
|
+
</span>
|
|
105
|
+
<code className={cx("ux-token-preview__name", label)}>{sample.token}</code>
|
|
106
|
+
<small className={label}>{value}</small>
|
|
107
|
+
</article>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Project-owned review UI: one tile per token. Values always come from the real foundation CSS. */
|
|
112
|
+
export function TokenPreview({ title, samples, text }: TokenPreviewProps) {
|
|
113
|
+
return (
|
|
114
|
+
<section aria-label={title} className={cx("ux-token-preview", grid)}>
|
|
115
|
+
<h1 className={heading}>{title}</h1>
|
|
116
|
+
{samples.map(sample => <TokenTile key={`${sample.token}:${sample.property}`} sample={sample} text={text} />)}
|
|
117
|
+
</section>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"framework": "preact",
|
|
3
|
+
"behaviorLibraries": [],
|
|
4
|
+
"acceptance": { "checks": [], "behaviorChecks": false },
|
|
5
|
+
"validation": { "checks": [], "behaviorChecks": true, "inputs": [] },
|
|
6
|
+
"mcp": {
|
|
7
|
+
"previewManifest": ".ds/preview/manifest.json"
|
|
8
|
+
},
|
|
9
|
+
"boundaries": {
|
|
10
|
+
"styleWrites": [
|
|
11
|
+
{
|
|
12
|
+
"file": "design-system/review/token-preview/TokenPreview.tsx",
|
|
13
|
+
"properties": [
|
|
14
|
+
"--ux-token-preview-value"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "native-design-system",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Private starter workspace for a project's local Preact design system.",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.12.0",
|
|
9
|
+
"bun": ">=1.4.1"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": [
|
|
12
|
+
"**/*.css"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"dev": "ads showcase",
|
|
16
|
+
"dev:showcase": "ads showcase",
|
|
17
|
+
"lint": "oxlint --deny-warnings src design-system && biome lint --config-path=biome.css.json .",
|
|
18
|
+
"typecheck": "tsc --noEmit",
|
|
19
|
+
"build": "npm run lint && npm run typecheck && npm run build:lib",
|
|
20
|
+
"build:lib": "vite build && tsc --project tsconfig.build.json",
|
|
21
|
+
"build:showcase": "ads compile .",
|
|
22
|
+
"preview": "ads showcase",
|
|
23
|
+
"preview:showcase": "ads showcase",
|
|
24
|
+
"build:mcp-previews": "ads compile ."
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@babel/preset-react": "7.29.7",
|
|
28
|
+
"@babel/preset-typescript": "7.29.7",
|
|
29
|
+
"@biomejs/biome": "2.5.15",
|
|
30
|
+
"@linaria/atomic": "8.0.0",
|
|
31
|
+
"@types/node": "25.9.4",
|
|
32
|
+
"@wyw-in-js/vite": "2.1.3",
|
|
33
|
+
"oxlint": "1.72.0",
|
|
34
|
+
"preact": "11.0.1",
|
|
35
|
+
"typescript": "5.9.3",
|
|
36
|
+
"vite": "6.4.3"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": [
|
|
5
|
+
"ES2022",
|
|
6
|
+
"DOM",
|
|
7
|
+
"DOM.Iterable"
|
|
8
|
+
],
|
|
9
|
+
"module": "ESNext",
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
"jsxImportSource": "preact",
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"baseUrl": ".",
|
|
22
|
+
"paths": {
|
|
23
|
+
"@ds/review": [
|
|
24
|
+
"design-system/review/index.ts"
|
|
25
|
+
],
|
|
26
|
+
"@ds": [
|
|
27
|
+
"design-system/index.ts"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"include": [
|
|
32
|
+
"src",
|
|
33
|
+
"design-system",
|
|
34
|
+
"vite.config.ts"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
import wyw from "@wyw-in-js/vite";
|
|
4
|
+
import { linariaTagResolver } from "@reqvire-org/ads/linaria";
|
|
5
|
+
import { draftImportGuard } from "@reqvire-org/ads/scenarios/vite";
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
esbuild: { jsx: "automatic", jsxImportSource: "preact" },
|
|
9
|
+
plugins: [draftImportGuard(), wyw({ tagResolver: linariaTagResolver })],
|
|
10
|
+
resolve: {
|
|
11
|
+
alias: { "@ds/review": path.resolve(import.meta.dirname, "design-system/review/index.ts"), "@ds": path.resolve(import.meta.dirname, "design-system/index.ts") },
|
|
12
|
+
},
|
|
13
|
+
build: {
|
|
14
|
+
outDir: "dist",
|
|
15
|
+
lib: {
|
|
16
|
+
entry: path.resolve(import.meta.dirname, "design-system/index.ts"),
|
|
17
|
+
formats: ["es"],
|
|
18
|
+
fileName: () => "index.js",
|
|
19
|
+
cssFileName: "styles",
|
|
20
|
+
},
|
|
21
|
+
rollupOptions: { external: [/^preact(?:\/.*)?$/] },
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -8,7 +8,12 @@ Install Bun 1.4.1+ for ADS tooling and previews. The application keeps its own
|
|
|
8
8
|
Node/npm or Bun build pipeline. Use these commands alongside this skill's research,
|
|
9
9
|
implementation, documentation, and verification workflow. ADS must be a project
|
|
10
10
|
development dependency, and its checks must run before the project's build.
|
|
11
|
-
Routine builds use the local CLI.
|
|
11
|
+
Routine builds use the local CLI. ADS manages its internal Turbo dependency and
|
|
12
|
+
local task cache automatically; no project Turbo configuration is required.
|
|
13
|
+
In Hermit-managed projects, pin supported Bun (>=1.4.1); Turbo arrives through
|
|
14
|
+
ADS in devDependencies, so do not add a separate Hermit/global Turbo installation.
|
|
15
|
+
`ads check --fresh` and `ads validate --fresh` bypass task-cache reads. See
|
|
16
|
+
[validation](validation.md) for cache controls and CI wiring.
|
|
12
17
|
|
|
13
18
|
Select an actual published package/version or a real local tarball supplied by
|
|
14
19
|
the user or built from the tool checkout. Respect the project's installed
|
|
@@ -114,6 +119,6 @@ do not copy source, import values, or establish behavior/motion parity; continue
|
|
|
114
119
|
project type checking, meaningful tests, and browser comparisons.
|
|
115
120
|
|
|
116
121
|
If no CLI distribution is available, continue with the target's existing
|
|
117
|
-
checks. `ads-designer` includes
|
|
122
|
+
checks. `ads-designer` includes the starter for offline bootstrapping.
|
|
118
123
|
Install skills separately with `npx skills`; the tool does not install skills
|
|
119
124
|
or fetch an external UI catalogue.
|
|
@@ -39,7 +39,7 @@ contract rather than adding a delay to every nearby trigger.
|
|
|
39
39
|
|
|
40
40
|
Transient feedback can use a local Toast if present. Persistent errors and
|
|
41
41
|
required decisions need the appropriate form, inline, or dialog surface. The
|
|
42
|
-
|
|
42
|
+
starter does not contain those components; add only what the task needs.
|
|
43
43
|
|
|
44
44
|
## Content, layout, and visual detail
|
|
45
45
|
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Validation scope
|
|
2
2
|
|
|
3
|
+
ADS runs architecture batch checks through its internal pinned Turbo dependency.
|
|
4
|
+
Local task caching is on by default; projects need no Turbo config. Source/tool,
|
|
5
|
+
dependency, Git-tracking and runtime changes invalidate reports. A hit reuses only
|
|
6
|
+
the source analysis, never policy success, browser results, a baseline or a run ID.
|
|
7
|
+
Project scripts and registered behavior tests still follow the selected policy.
|
|
8
|
+
Use CLI `check/validate --fresh`, or MCP `ads_check`, `ads_validate`, `ads_accept`
|
|
9
|
+
with `fresh:true`, to bypass task-cache reads. `ADS_CACHE=off` disables reads and
|
|
10
|
+
writes; `ADS_CACHE_DIR` relocates the local store. Remote caching is opt-in with
|
|
11
|
+
`ADS_REMOTE_CACHE=1` and standard Turbo provider variables. For CI, persist only
|
|
12
|
+
`.ds/task-cache` with the CI cache action or configure that remote provider; no
|
|
13
|
+
ADS cache service/API is needed. Inspect task-cache status in source reports,
|
|
14
|
+
execution summaries and `ads_results`; it is not a new test execution claim.
|
|
15
|
+
|
|
3
16
|
These checks apply to both [direct editing and MCP-only editing](workflows.md).
|
|
4
17
|
Direct source edits need current checks and rendered review; ordinary edits do
|
|
5
18
|
not require a draft or acceptance call. Tracked proposals validate on acceptance.
|
|
@@ -149,8 +149,8 @@ production and scenario builds; never alias React to Preact just to shrink a
|
|
|
149
149
|
preview. Native Preact uses its own JSX transform, hooks and DOM events (live
|
|
150
150
|
text updates use `onInput`). Native SVG uses DOM names such as `stroke-width`,
|
|
151
151
|
not React presentation aliases. Keep Linaria extraction and the same public APIs.
|
|
152
|
-
The
|
|
153
|
-
uses Preact. Neither is a component dependency of the receiving project.
|
|
152
|
+
The starter comes for React and for Preact; the tool repository's working
|
|
153
|
+
example uses Preact. Neither is a component dependency of the receiving project.
|
|
154
154
|
|
|
155
155
|
ADS is tooling only. Components, patterns, themes and scenarios live in
|
|
156
156
|
external sources, not a built-in or optional tool catalogue. Import the selected
|