@reqvire-org/ads 0.3.43 → 0.3.45

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 (165) hide show
  1. package/README.md +32 -10
  2. package/dist/assets.mjs +49 -3
  3. package/dist/brand-assets.mjs +174 -7
  4. package/dist/check.mjs +4 -2
  5. package/dist/cli.mjs +21 -9
  6. package/dist/config.mjs +60 -3
  7. package/dist/create.mjs +48 -0
  8. package/dist/image-size.mjs +28 -0
  9. package/dist/index.mjs +1 -0
  10. package/dist/init.mjs +2 -2
  11. package/dist/mcp/server.mjs +3 -1
  12. package/dist/mcp/skills.mjs +1 -1
  13. package/dist/preview-bun.mjs +4 -2
  14. package/dist/scenario-groups.mjs +2 -2
  15. package/dist/scenario-registry.mjs +3 -3
  16. package/dist/scenarios-compiler.mjs +1 -1
  17. package/dist/scenarios.mjs +4 -2
  18. package/dist/showcase/client.bundle.js +22 -22
  19. package/dist/showcase/draft-navigation.js +1 -1
  20. package/dist/showcase/index.html +1 -0
  21. package/dist/skills/ads-break-ui/SKILL.md +1 -1
  22. package/dist/skills/ads-designer/README.md +2 -2
  23. package/dist/skills/ads-designer/SKILL.md +44 -54
  24. package/dist/skills/ads-designer/references/branding.md +104 -0
  25. package/dist/skills/ads-designer/references/cli.md +5 -4
  26. package/dist/skills/ads-import/SKILL.md +1 -1
  27. package/dist/skills/ads-import/references/branding.md +13 -5
  28. package/dist/skills/ads-import/references/cli.md +5 -4
  29. package/dist/skills/ads-motion/SKILL.md +1 -1
  30. package/dist/skills/ads-port/SKILL.md +1 -1
  31. package/dist/skills/ads-port/references/cli.md +5 -4
  32. package/dist/{bootstrap-ds-preact → starters/preact}/ds.config.json +2 -1
  33. package/dist/{bootstrap-ds → starters/react}/ADS.md +2 -2
  34. package/dist/{bootstrap-ds → starters/react}/README.md +18 -22
  35. package/dist/starters/react/design-system/assets/brand/README.md +36 -0
  36. package/dist/starters/react/design-system/assets/brand/app-icon.svg +4 -0
  37. package/dist/starters/react/design-system/assets/brand/logo.dark.svg +6 -0
  38. package/dist/starters/react/design-system/assets/brand/logo.svg +6 -0
  39. package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.fixture.ts +7 -0
  40. package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.scenario.tsx +4 -0
  41. package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.fixture.ts +7 -0
  42. package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.scenario.tsx +4 -0
  43. package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.fixture.ts +1 -0
  44. package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.scenario.tsx +12 -0
  45. package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +41 -0
  46. package/dist/starters/react/design-system/components/Content/Logo/README.md +10 -0
  47. package/dist/{bootstrap-ds → starters/react}/design-system/index.ts +1 -0
  48. package/dist/starters/react/design-system/review/brand-preview/BrandPreview.tsx +115 -0
  49. package/dist/{bootstrap-ds → starters/react}/design-system/review/index.ts +1 -0
  50. package/dist/{skills/ads-designer/assets/bootstrap-ds → starters/react}/ds.config.json +2 -1
  51. package/dist/{bootstrap-ds → starters/react}/tsconfig.build.json +2 -1
  52. package/dist/task-cache.mjs +1 -1
  53. package/dist/token-fixtures.mjs +1 -1
  54. package/dist/units.mjs +6 -6
  55. package/dist/validation.mjs +1 -1
  56. package/docs/ADS.md +9 -6
  57. package/docs/ARCHITECTURE.md +1 -1
  58. package/docs/CHANGELOG.md +59 -12
  59. package/docs/GUIDE.md +61 -18
  60. package/package.json +3 -5
  61. package/dist/bootstrap-ds/design-system/assets/brand/README.md +0 -29
  62. package/dist/bootstrap-ds/ds.config.json +0 -19
  63. package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +0 -258
  64. package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +0 -120
  65. package/dist/skills/ads-designer/assets/bootstrap-ds/biome.css.json +0 -21
  66. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/README.md +0 -29
  67. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/fonts/.gitkeep +0 -0
  68. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.ads.fixture.ts +0 -1
  69. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -13
  70. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.tsx +0 -49
  71. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/README.md +0 -12
  72. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/README.md +0 -14
  73. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.fixture.ts +0 -6
  74. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -13
  75. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.tsx +0 -57
  76. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/README.md +0 -4
  77. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +0 -7
  78. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +0 -16
  79. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/controllers/.gitkeep +0 -0
  80. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +0 -7
  81. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/README.md +0 -12
  82. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +0 -1
  83. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +0 -11
  84. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.tsx +0 -41
  85. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/demo-frame/DemoFrame.tsx +0 -29
  86. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/index.ts +0 -3
  87. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/screen-frame/ScreenFrame.tsx +0 -34
  88. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/token-preview/TokenPreview.tsx +0 -119
  89. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/index.html +0 -1
  90. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/main.tsx +0 -8
  91. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/styles.css +0 -5
  92. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Color.ads.fixture.ts +0 -18
  93. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Color.ads.scenario.tsx +0 -4
  94. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.fixture.ts +0 -36
  95. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.scenario.tsx +0 -4
  96. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/base.css +0 -30
  97. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/colors.css +0 -29
  98. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/elevation.css +0 -15
  99. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/spacing.css +0 -15
  100. package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/typography.css +0 -13
  101. package/dist/skills/ads-designer/assets/bootstrap-ds/gitignore.template +0 -8
  102. package/dist/skills/ads-designer/assets/bootstrap-ds/package-lock.json +0 -4660
  103. package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +0 -42
  104. package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +0 -3
  105. package/dist/skills/ads-designer/assets/bootstrap-ds/src/vite-env.d.ts +0 -7
  106. package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.build.json +0 -19
  107. package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.json +0 -35
  108. package/dist/skills/ads-designer/assets/bootstrap-ds/vite.config.ts +0 -23
  109. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/demo-frame/DemoFrame.tsx +0 -29
  110. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/screen-frame/ScreenFrame.tsx +0 -34
  111. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/token-preview/TokenPreview.tsx +0 -119
  112. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/showcase/mcp/main.tsx +0 -6
  113. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/ds.config.json +0 -19
  114. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/package.json +0 -38
  115. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/src/vite-env.d.ts +0 -7
  116. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/tsconfig.json +0 -36
  117. package/dist/skills/ads-designer/assets/bootstrap-ds-preact/vite.config.ts +0 -23
  118. /package/dist/{bootstrap-ds-preact → starters/preact}/design-system/review/demo-frame/DemoFrame.tsx +0 -0
  119. /package/dist/{bootstrap-ds-preact → starters/preact}/design-system/review/screen-frame/ScreenFrame.tsx +0 -0
  120. /package/dist/{bootstrap-ds-preact → starters/preact}/design-system/review/token-preview/TokenPreview.tsx +0 -0
  121. /package/dist/{bootstrap-ds-preact → starters/preact}/design-system/showcase/mcp/main.tsx +0 -0
  122. /package/dist/{bootstrap-ds-preact → starters/preact}/package.json +0 -0
  123. /package/dist/{bootstrap-ds-preact → starters/preact}/src/vite-env.d.ts +0 -0
  124. /package/dist/{bootstrap-ds-preact → starters/preact}/tsconfig.json +0 -0
  125. /package/dist/{bootstrap-ds-preact → starters/preact}/vite.config.ts +0 -0
  126. /package/dist/{bootstrap-ds → starters/react}/biome.css.json +0 -0
  127. /package/dist/{bootstrap-ds → starters/react}/design-system/assets/fonts/.gitkeep +0 -0
  128. /package/dist/{bootstrap-ds → starters/react}/design-system/components/Actions/Button/Button.ads.fixture.ts +0 -0
  129. /package/dist/{bootstrap-ds → starters/react}/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -0
  130. /package/dist/{bootstrap-ds → starters/react}/design-system/components/Actions/Button/Button.tsx +0 -0
  131. /package/dist/{bootstrap-ds → starters/react}/design-system/components/Actions/Button/README.md +0 -0
  132. /package/dist/{bootstrap-ds → starters/react}/design-system/components/Forms/TextField/README.md +0 -0
  133. /package/dist/{bootstrap-ds → starters/react}/design-system/components/Forms/TextField/TextField.ads.fixture.ts +0 -0
  134. /package/dist/{bootstrap-ds → starters/react}/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -0
  135. /package/dist/{bootstrap-ds → starters/react}/design-system/components/Forms/TextField/TextField.tsx +0 -0
  136. /package/dist/{bootstrap-ds → starters/react}/design-system/composition/Search/SearchPage/README.md +0 -0
  137. /package/dist/{bootstrap-ds → starters/react}/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +0 -0
  138. /package/dist/{bootstrap-ds → starters/react}/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +0 -0
  139. /package/dist/{bootstrap-ds → starters/react}/design-system/controllers/.gitkeep +0 -0
  140. /package/dist/{bootstrap-ds → starters/react}/design-system/patterns/Search/SearchBar/README.md +0 -0
  141. /package/dist/{bootstrap-ds → starters/react}/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +0 -0
  142. /package/dist/{bootstrap-ds → starters/react}/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +0 -0
  143. /package/dist/{bootstrap-ds → starters/react}/design-system/patterns/Search/SearchBar/SearchBar.tsx +0 -0
  144. /package/dist/{bootstrap-ds → starters/react}/design-system/review/demo-frame/DemoFrame.tsx +0 -0
  145. /package/dist/{bootstrap-ds → starters/react}/design-system/review/screen-frame/ScreenFrame.tsx +0 -0
  146. /package/dist/{bootstrap-ds → starters/react}/design-system/review/token-preview/TokenPreview.tsx +0 -0
  147. /package/dist/{bootstrap-ds → starters/react}/design-system/showcase/mcp/index.html +0 -0
  148. /package/dist/{bootstrap-ds → starters/react}/design-system/showcase/mcp/main.tsx +0 -0
  149. /package/dist/{bootstrap-ds → starters/react}/design-system/styles.css +0 -0
  150. /package/dist/{bootstrap-ds → starters/react}/design-system/tokens/Color.ads.fixture.ts +0 -0
  151. /package/dist/{bootstrap-ds → starters/react}/design-system/tokens/Color.ads.scenario.tsx +0 -0
  152. /package/dist/{bootstrap-ds → starters/react}/design-system/tokens/SpaceTypeMotion.ads.fixture.ts +0 -0
  153. /package/dist/{bootstrap-ds → starters/react}/design-system/tokens/SpaceTypeMotion.ads.scenario.tsx +0 -0
  154. /package/dist/{bootstrap-ds → starters/react}/design-system/tokens/base.css +0 -0
  155. /package/dist/{bootstrap-ds → starters/react}/design-system/tokens/colors.css +0 -0
  156. /package/dist/{bootstrap-ds → starters/react}/design-system/tokens/elevation.css +0 -0
  157. /package/dist/{bootstrap-ds → starters/react}/design-system/tokens/spacing.css +0 -0
  158. /package/dist/{bootstrap-ds → starters/react}/design-system/tokens/typography.css +0 -0
  159. /package/dist/{bootstrap-ds → starters/react}/gitignore.template +0 -0
  160. /package/dist/{bootstrap-ds → starters/react}/package-lock.json +0 -0
  161. /package/dist/{bootstrap-ds → starters/react}/package.json +0 -0
  162. /package/dist/{bootstrap-ds → starters/react}/scripts/build-mcp-previews.mjs +0 -0
  163. /package/dist/{bootstrap-ds → starters/react}/src/vite-env.d.ts +0 -0
  164. /package/dist/{bootstrap-ds → starters/react}/tsconfig.json +0 -0
  165. /package/dist/{bootstrap-ds → starters/react}/vite.config.ts +0 -0
@@ -1,16 +0,0 @@
1
- import { Button, SearchBar } from "@ds";
2
- import { ScreenFrame } from "@ds/review";
3
- import { fixture } from "./SearchPage.ads.fixture";
4
-
5
- // A screen composed from public parts, for review only: it is not exported from @ds.
6
- export const scenario = { title: fixture.title, covers: ["SearchBar", "Button"] };
7
- export default function Scenario() {
8
- return (
9
- <ScreenFrame title={fixture.heading} description={fixture.description}>
10
- <SearchBar {...fixture.search} />
11
- <div>
12
- <Button label={fixture.browse} />
13
- </div>
14
- </ScreenFrame>
15
- );
16
- }
@@ -1,7 +0,0 @@
1
- // Load local foundation styles; the compile check also extracts dist/styles.css.
2
- import "./styles.css";
3
-
4
- // Public components and patterns. Add new ones here as they are implemented.
5
- export { Button, type ButtonProps } from "./components/Actions/Button/Button";
6
- export { TextField, type TextFieldProps } from "./components/Forms/TextField/TextField";
7
- export { SearchBar, type SearchBarProps } from "./patterns/Search/SearchBar/SearchBar";
@@ -1,12 +0,0 @@
1
- # SearchBar
2
-
3
- A search form built from `TextField` and a primary `Button`. Enter or the button calls
4
- `onSearch` with the trimmed query; the page decides what searching means.
5
-
6
- | Prop | Type | Default |
7
- |---|---|---|
8
- | `id` | `string` | — |
9
- | `label` | `string` | — |
10
- | `placeholder` | `string` | — |
11
- | `submitLabel` | `string` | `"Search"` |
12
- | `onSearch` | `(query: string) => void` | — |
@@ -1 +0,0 @@
1
- export const fixture = { title: "Search bar", id: "search-bar-query", label: "Search the docs", placeholder: "Tokens, components…" } as const;
@@ -1,11 +0,0 @@
1
- import { SearchBar } from "@ds";
2
- import { DemoFrame } from "@ds/review";
3
- import { fixture } from "./SearchBar.ads.fixture";
4
- export const scenario = { title: fixture.title, covers: ["SearchBar"] };
5
- export default function Scenario() {
6
- return (
7
- <DemoFrame layout="column">
8
- <SearchBar id={fixture.id} label={fixture.label} placeholder={fixture.placeholder} />
9
- </DemoFrame>
10
- );
11
- }
@@ -1,41 +0,0 @@
1
- import { css, cx } from "@linaria/atomic";
2
- import { Button } from "../../../components/Actions/Button/Button";
3
- import { TextField } from "../../../components/Forms/TextField/TextField";
4
-
5
- export interface SearchBarProps {
6
- id: string;
7
- label: string;
8
- placeholder?: string;
9
- submitLabel?: string;
10
- /** Called with the typed query when the person searches. */
11
- onSearch?: (query: string) => void;
12
- }
13
-
14
- const form = css`
15
- display: flex;
16
- align-items: flex-end;
17
- gap: var(--space-4);
18
- `;
19
- const query = css`
20
- flex: 1;
21
- min-width: 0;
22
- `;
23
-
24
- /** A search field with its submit action: Enter or the button searches. */
25
- export function SearchBar({ id, label, placeholder, submitLabel = "Search", onSearch }: SearchBarProps) {
26
- return (
27
- <form
28
- role="search"
29
- className={cx("ds-search-bar", form)}
30
- onSubmit={event => {
31
- event.preventDefault();
32
- onSearch?.(String(new FormData(event.currentTarget).get("query") ?? "").trim());
33
- }}
34
- >
35
- <div className={query}>
36
- <TextField id={id} label={label} name="query" placeholder={placeholder} />
37
- </div>
38
- <Button label={submitLabel} variant="primary" type="submit" />
39
- </form>
40
- );
41
- }
@@ -1,29 +0,0 @@
1
- import type { ReactNode } from "react";
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?: ReactNode;
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
- }
@@ -1,3 +0,0 @@
1
- export { TokenPreview } from "./token-preview/TokenPreview";
2
- export { ScreenFrame } from "./screen-frame/ScreenFrame";
3
- export { DemoFrame } from "./demo-frame/DemoFrame";
@@ -1,34 +0,0 @@
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,119 +0,0 @@
1
- import { useLayoutEffect, useRef, useState } from "react";
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
- }
@@ -1 +0,0 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>ADS scenario</title><style>html,body,#root{height:100%}body{overflow:hidden}</style></head><body><div id="root"></div><script type="module" src="./main.tsx"></script></body></html>
@@ -1,8 +0,0 @@
1
- import { createRoot } from "react-dom/client";
2
- import type { ComponentType } from "react";
3
- import "@ds";
4
- export function mountScenario(Scenario: ComponentType, container: HTMLElement) {
5
- const root = createRoot(container);
6
- root.render(<Scenario />);
7
- return () => root.unmount();
8
- }
@@ -1,5 +0,0 @@
1
- @import "./tokens/colors.css";
2
- @import "./tokens/typography.css";
3
- @import "./tokens/spacing.css";
4
- @import "./tokens/elevation.css";
5
- @import "./tokens/base.css";
@@ -1,18 +0,0 @@
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 +0,0 @@
1
- import { TokenPreview } from "@ds/review";
2
- import { fixture } from "./Color.ads.fixture";
3
- export const scenario = { title: fixture.title, covers: ["TokenPreview"], samples: fixture.samples };
4
- export default function Scenario() { return <TokenPreview {...fixture} />; }
@@ -1,36 +0,0 @@
1
- export const fixture = {
2
- "title": "Space, type & motion",
3
- "text": "Aa",
4
- samples: [
5
- {"token": "--border-w", "property": "width", "probe": "13.375px"},
6
- {"token": "--dur-fast", "property": "animation-duration", "probe": "0.375s"},
7
- {"token": "--dur-normal", "property": "animation-duration", "probe": "0.375s"},
8
- {"token": "--ease-standard", "property": "animation-timing-function", "probe": "cubic-bezier(.13,.27,.61,.83)"},
9
- {"token": "--focus-offset", "property": "width", "probe": "13.375px"},
10
- {"token": "--focus-w", "property": "width", "probe": "13.375px"},
11
- {"token": "--font-mono", "property": "font-family", "probe": "monospace, serif"},
12
- {"token": "--font-sans", "property": "font-family", "probe": "monospace, serif"},
13
- {"token": "--leading-normal", "property": "line-height", "probe": "2.375"},
14
- {"token": "--leading-tight", "property": "line-height", "probe": "2.375"},
15
- {"token": "--radius-lg", "property": "border-radius", "probe": "13.375px"},
16
- {"token": "--radius-md", "property": "border-radius", "probe": "13.375px"},
17
- {"token": "--radius-sm", "property": "border-radius", "probe": "13.375px"},
18
- {"token": "--shadow-raised", "property": "box-shadow", "probe": "1px 3px 5px rgb(31, 97, 163)"},
19
- {"token": "--shadow-xs", "property": "box-shadow", "probe": "1px 3px 5px rgb(31, 97, 163)"},
20
- {"token": "--space-0", "property": "width", "probe": "13.375px"},
21
- {"token": "--space-12", "property": "width", "probe": "13.375px"},
22
- {"token": "--space-16", "property": "width", "probe": "13.375px"},
23
- {"token": "--space-2", "property": "width", "probe": "13.375px"},
24
- {"token": "--space-4", "property": "width", "probe": "13.375px"},
25
- {"token": "--space-6", "property": "width", "probe": "13.375px"},
26
- {"token": "--space-8", "property": "width", "probe": "13.375px"},
27
- {"token": "--text-base", "property": "font-size", "probe": "41.375px"},
28
- {"token": "--text-lg", "property": "font-size", "probe": "41.375px"},
29
- {"token": "--text-sm", "property": "font-size", "probe": "41.375px"},
30
- {"token": "--text-xl", "property": "font-size", "probe": "41.375px"},
31
- {"token": "--weight-medium", "property": "font-weight", "probe": "327"},
32
- {"token": "--weight-normal", "property": "font-weight", "probe": "327"},
33
- {"token": "--weight-semibold", "property": "font-weight", "probe": "327"},
34
- {"token": "--z-overlay", "property": "z-index", "probe": "367"},
35
- ]
36
- } as const;
@@ -1,4 +0,0 @@
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} />; }
@@ -1,30 +0,0 @@
1
- :root { color-scheme: light; }
2
- :root[data-theme="dark"] { color-scheme: dark; }
3
-
4
- *,
5
- *::before,
6
- *::after {
7
- box-sizing: border-box;
8
- }
9
-
10
- body {
11
- margin: 0;
12
- background: var(--bg-canvas);
13
- color: var(--text-body);
14
- font-family: var(--font-sans);
15
- font-size: var(--text-sm);
16
- font-weight: var(--weight-normal);
17
- line-height: var(--leading-normal);
18
- }
19
-
20
- button,
21
- input,
22
- select,
23
- textarea {
24
- font: inherit;
25
- }
26
-
27
- :focus-visible {
28
- outline: var(--focus-w) solid var(--border-focus);
29
- outline-offset: var(--focus-offset);
30
- }
@@ -1,29 +0,0 @@
1
- :root {
2
-
3
- --bg-canvas: #faf9f6;
4
- --bg-surface: #fff;
5
- --bg-hover: #f1efea;
6
- --text-strong: #1e293b;
7
- --text-body: #334155;
8
- --text-muted: #64748b;
9
- --text-inverse: #fff;
10
- --border-default: #d6d3cc;
11
- --accent: #c62648;
12
- --accent-hover: #a91c3a;
13
- --accent-fg: #fff;
14
- --border-focus: var(--accent);
15
- }
16
-
17
- :root[data-theme="dark"] {
18
-
19
- --bg-canvas: #17191e;
20
- --bg-surface: #20232a;
21
- --bg-hover: #2c3039;
22
- --text-strong: #f8fafc;
23
- --text-body: #e2e8f0;
24
- --text-muted: #94a3b8;
25
- --border-default: #3b414c;
26
- --accent: #fb7185;
27
- --accent-hover: #fda4af;
28
- --accent-fg: #17191e;
29
- }
@@ -1,15 +0,0 @@
1
- :root {
2
- --shadow-xs: 0 1px 2px rgb(15 23 42 / 8%);
3
- --shadow-raised: 0 4px 12px rgb(15 23 42 / 12%);
4
- --dur-fast: 120ms;
5
- --dur-normal: 200ms;
6
- --ease-standard: cubic-bezier(0.2, 0, 0, 1);
7
- --z-overlay: 1000;
8
- }
9
-
10
- @media (prefers-reduced-motion: reduce) {
11
- :root {
12
- --dur-fast: 0ms;
13
- --dur-normal: 0ms;
14
- }
15
- }
@@ -1,15 +0,0 @@
1
- :root {
2
- --space-0: 0;
3
- --space-2: 4px;
4
- --space-4: 8px;
5
- --space-6: 12px;
6
- --space-8: 16px;
7
- --space-12: 24px;
8
- --space-16: 32px;
9
- --radius-sm: 4px;
10
- --radius-md: 8px;
11
- --radius-lg: 12px;
12
- --border-w: 1px;
13
- --focus-w: 2px;
14
- --focus-offset: 2px;
15
- }
@@ -1,13 +0,0 @@
1
- :root {
2
- --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
3
- --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
4
- --text-sm: 13px;
5
- --text-base: 14px;
6
- --text-lg: 17px;
7
- --text-xl: 21px;
8
- --weight-normal: 400;
9
- --weight-medium: 500;
10
- --weight-semibold: 600;
11
- --leading-tight: 1.25;
12
- --leading-normal: 1.5;
13
- }
@@ -1,8 +0,0 @@
1
- node_modules/
2
- .ds/
3
- dist/
4
- dist-showcase/
5
- .vite/
6
- coverage/
7
- *.local
8
- *.log