@reqvire-org/ads 0.3.44 → 0.3.46
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 +29 -9
- package/dist/a11y.mjs +100 -0
- package/dist/assets.mjs +29 -5
- package/dist/brand-assets.mjs +41 -7
- package/dist/capture/worker.mjs +1 -1
- package/dist/capture-store.mjs +2 -1
- package/dist/capture.mjs +5 -2
- package/dist/check.mjs +2 -1
- package/dist/cli.mjs +33 -9
- package/dist/config.mjs +22 -10
- package/dist/contracts/tokens.json +1 -1
- package/dist/create.mjs +48 -0
- package/dist/design-values.mjs +8 -2
- package/dist/foundation.mjs +3 -0
- package/dist/image-size.mjs +28 -0
- package/dist/index.mjs +1 -0
- package/dist/init.mjs +4 -5
- package/dist/mcp/apps.mjs +1 -1
- package/dist/mcp/preview-widget.bundle.js +19 -13
- package/dist/mcp/project-widget.bundle.js +26 -26
- package/dist/mcp/server.mjs +6 -5
- package/dist/mcp/skills.mjs +1 -1
- package/dist/mcp/widget.bundle.js +15 -15
- package/dist/preview-resources.mjs +2 -2
- package/dist/scenario-groups.mjs +2 -2
- package/dist/scenario-registry.mjs +3 -3
- package/dist/scenarios-compiler.mjs +1 -1
- package/dist/scenarios.mjs +6 -11
- package/dist/showcase/client.bundle.js +27 -27
- package/dist/showcase/draft-navigation.js +1 -1
- package/dist/showcase/index.html +2 -1
- package/dist/skills/ads-break-ui/SKILL.md +1 -1
- package/dist/skills/ads-break-ui/references/captures.md +3 -2
- package/dist/skills/ads-break-ui/references/design-data.md +89 -0
- package/dist/skills/ads-designer/README.md +2 -2
- package/dist/skills/ads-designer/SKILL.md +47 -56
- package/dist/skills/ads-designer/references/accessibility.md +43 -0
- package/dist/skills/ads-designer/references/branding.md +52 -9
- package/dist/skills/ads-designer/references/captures.md +3 -2
- package/dist/skills/ads-designer/references/cli.md +5 -4
- package/dist/skills/ads-designer/references/design-data.md +89 -0
- package/dist/skills/ads-import/SKILL.md +1 -1
- package/dist/skills/ads-import/references/branding.md +4 -3
- package/dist/skills/ads-import/references/captures.md +3 -2
- package/dist/skills/ads-import/references/cli.md +5 -4
- package/dist/skills/ads-import/references/design-data.md +89 -0
- package/dist/skills/ads-motion/SKILL.md +1 -1
- package/dist/skills/ads-motion/references/build.md +33 -0
- package/dist/skills/ads-motion/references/captures.md +3 -2
- package/dist/skills/ads-motion/references/design-data.md +89 -0
- package/dist/skills/ads-motion/references/motion-review.md +2 -2
- package/dist/skills/ads-port/SKILL.md +1 -1
- package/dist/skills/ads-port/references/captures.md +3 -2
- package/dist/skills/ads-port/references/cli.md +5 -4
- package/dist/skills/ads-port/references/design-data.md +89 -0
- package/dist/starters/preact/design-system/components/Layout/Grid/Grid.tsx +76 -0
- package/dist/{skills/ads-designer/assets/bootstrap-ds-preact → starters/preact}/design-system/review/token-preview/TokenPreview.tsx +10 -1
- package/dist/starters/preact/ds.config.json +32 -0
- package/dist/{bootstrap-ds → starters/react}/README.md +65 -24
- package/dist/{skills/ads-designer/assets/bootstrap-ds → starters/react}/design-system/assets/brand/README.md +1 -1
- package/dist/starters/react/design-system/assets/glyphs/README.md +12 -0
- package/dist/starters/react/design-system/assets/glyphs/aliases.json +1 -0
- package/dist/starters/react/design-system/assets/glyphs/check.svg +1 -0
- package/dist/starters/react/design-system/assets/glyphs/chevron-down.svg +1 -0
- package/dist/starters/react/design-system/assets/glyphs/chevron-right.svg +1 -0
- package/dist/starters/react/design-system/assets/glyphs/close.svg +1 -0
- package/dist/starters/react/design-system/assets/glyphs/external-link.svg +1 -0
- package/dist/starters/react/design-system/assets/glyphs/info.svg +1 -0
- package/dist/starters/react/design-system/assets/glyphs/menu.svg +1 -0
- package/dist/starters/react/design-system/assets/glyphs/plus.svg +1 -0
- package/dist/starters/react/design-system/assets/glyphs/search.svg +1 -0
- package/dist/starters/react/design-system/assets/glyphs/warning.svg +1 -0
- package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.fixture.ts +7 -0
- package/dist/{bootstrap-ds/design-system/tokens/Brand.ads.scenario.tsx → starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.scenario.tsx} +2 -2
- package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.fixture.ts +7 -0
- package/dist/{skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Brand.ads.scenario.tsx → starters/react/design-system/brand/Identity/Logo/Logo.ads.scenario.tsx} +2 -2
- package/dist/{skills/ads-designer/assets/bootstrap-ds → starters/react}/design-system/components/Actions/Button/Button.tsx +11 -4
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.fixture.ts +9 -0
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.scenario.tsx +16 -0
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +44 -0
- package/dist/starters/react/design-system/components/Actions/IconButton/README.md +14 -0
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.fixture.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.scenario.tsx +15 -0
- package/dist/starters/react/design-system/components/Content/Icon/Icon.tsx +42 -0
- package/dist/starters/react/design-system/components/Content/Icon/README.md +16 -0
- package/dist/starters/react/design-system/components/Content/Icon/glyphs.ts +17 -0
- package/dist/{bootstrap-ds → starters/react}/design-system/components/Forms/TextField/TextField.tsx +9 -5
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.fixture.ts +12 -0
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.scenario.tsx +17 -0
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.tsx +75 -0
- package/dist/starters/react/design-system/components/Layout/Grid/README.md +21 -0
- package/dist/{bootstrap-ds → starters/react}/design-system/index.ts +3 -0
- package/dist/starters/react/design-system/review/grid-cell/GridCell.tsx +18 -0
- package/dist/{bootstrap-ds → starters/react}/design-system/review/index.ts +1 -0
- package/dist/{skills/ads-designer/assets/bootstrap-ds → starters/react}/design-system/review/token-preview/TokenPreview.tsx +10 -1
- package/dist/starters/react/design-system/tokens/Color.ads.fixture.ts +124 -0
- package/dist/starters/react/design-system/tokens/Layout.ads.fixture.ts +23 -0
- package/dist/{bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.scenario.tsx → starters/react/design-system/tokens/Layout.ads.scenario.tsx} +1 -1
- package/dist/starters/react/design-system/tokens/Motion.ads.fixture.ts +18 -0
- package/dist/{skills/ads-designer/assets/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.scenario.tsx → starters/react/design-system/tokens/Motion.ads.scenario.tsx} +1 -1
- package/dist/starters/react/design-system/tokens/Shape.ads.fixture.ts +30 -0
- package/dist/{skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Color.ads.scenario.tsx → starters/react/design-system/tokens/Shape.ads.scenario.tsx} +1 -1
- package/dist/starters/react/design-system/tokens/Space.ads.fixture.ts +37 -0
- package/dist/starters/react/design-system/tokens/Space.ads.scenario.tsx +4 -0
- package/dist/starters/react/design-system/tokens/Type.ads.fixture.ts +29 -0
- package/dist/starters/react/design-system/tokens/Type.ads.scenario.tsx +4 -0
- package/dist/{bootstrap-ds → starters/react}/design-system/tokens/base.css +6 -3
- package/dist/starters/react/design-system/tokens/colors.css +223 -0
- package/dist/starters/react/design-system/tokens/elevation.css +60 -0
- package/dist/starters/react/design-system/tokens/spacing.css +79 -0
- package/dist/starters/react/design-system/tokens/typography.css +31 -0
- package/dist/starters/react/ds.config.json +32 -0
- package/dist/{skills/ads-designer/assets/bootstrap-ds → starters/react}/tsconfig.build.json +2 -1
- package/dist/task-cache.mjs +1 -1
- package/dist/themes.mjs +106 -0
- package/dist/token-export.mjs +58 -0
- package/dist/token-fixtures.mjs +1 -1
- package/dist/token-quality.mjs +109 -0
- package/dist/tokens.mjs +9 -2
- package/dist/units.mjs +6 -6
- package/dist/validation.mjs +1 -1
- package/docs/ADS.md +38 -9
- package/docs/ARCHITECTURE.md +50 -5
- package/docs/CHANGELOG.md +88 -12
- package/docs/GUIDE.md +56 -25
- package/docs/MCP.md +13 -4
- package/package.json +3 -5
- package/dist/bootstrap-ds/design-system/assets/brand/README.md +0 -36
- package/dist/bootstrap-ds/design-system/components/Actions/Button/Button.tsx +0 -49
- package/dist/bootstrap-ds/design-system/review/token-preview/TokenPreview.tsx +0 -119
- package/dist/bootstrap-ds/design-system/tokens/Brand.ads.fixture.ts +0 -12
- package/dist/bootstrap-ds/design-system/tokens/Color.ads.fixture.ts +0 -18
- package/dist/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.fixture.ts +0 -36
- package/dist/bootstrap-ds/design-system/tokens/colors.css +0 -29
- package/dist/bootstrap-ds/design-system/tokens/elevation.css +0 -15
- package/dist/bootstrap-ds/design-system/tokens/spacing.css +0 -15
- package/dist/bootstrap-ds/design-system/tokens/typography.css +0 -13
- package/dist/bootstrap-ds/ds.config.json +0 -20
- package/dist/bootstrap-ds/tsconfig.build.json +0 -19
- package/dist/bootstrap-ds-preact/design-system/review/token-preview/TokenPreview.tsx +0 -119
- package/dist/bootstrap-ds-preact/ds.config.json +0 -20
- package/dist/skills/ads-designer/assets/bootstrap-ds/ADS.md +0 -258
- package/dist/skills/ads-designer/assets/bootstrap-ds/README.md +0 -122
- package/dist/skills/ads-designer/assets/bootstrap-ds/biome.css.json +0 -21
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/app-icon.svg +0 -4
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/logo.dark.svg +0 -6
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/brand/logo.svg +0 -6
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/assets/fonts/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.ads.fixture.ts +0 -1
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -13
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Actions/Button/README.md +0 -12
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Content/Logo/Logo.ads.fixture.ts +0 -1
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Content/Logo/Logo.ads.scenario.tsx +0 -12
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Content/Logo/Logo.tsx +0 -41
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Content/Logo/README.md +0 -10
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/README.md +0 -14
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.fixture.ts +0 -6
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -13
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/components/Forms/TextField/TextField.tsx +0 -57
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/README.md +0 -4
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +0 -7
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +0 -16
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/controllers/.gitkeep +0 -0
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/index.ts +0 -8
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/README.md +0 -12
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +0 -1
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +0 -11
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/patterns/Search/SearchBar/SearchBar.tsx +0 -41
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/brand-preview/BrandPreview.tsx +0 -115
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/demo-frame/DemoFrame.tsx +0 -29
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/index.ts +0 -4
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/review/screen-frame/ScreenFrame.tsx +0 -34
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/index.html +0 -1
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/showcase/mcp/main.tsx +0 -8
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/styles.css +0 -5
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Brand.ads.fixture.ts +0 -12
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/Color.ads.fixture.ts +0 -18
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/SpaceTypeMotion.ads.fixture.ts +0 -36
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/base.css +0 -30
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/colors.css +0 -29
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/elevation.css +0 -15
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/spacing.css +0 -15
- package/dist/skills/ads-designer/assets/bootstrap-ds/design-system/tokens/typography.css +0 -13
- package/dist/skills/ads-designer/assets/bootstrap-ds/ds.config.json +0 -20
- package/dist/skills/ads-designer/assets/bootstrap-ds/gitignore.template +0 -8
- package/dist/skills/ads-designer/assets/bootstrap-ds/package-lock.json +0 -4660
- package/dist/skills/ads-designer/assets/bootstrap-ds/package.json +0 -42
- package/dist/skills/ads-designer/assets/bootstrap-ds/scripts/build-mcp-previews.mjs +0 -3
- package/dist/skills/ads-designer/assets/bootstrap-ds/src/vite-env.d.ts +0 -7
- package/dist/skills/ads-designer/assets/bootstrap-ds/tsconfig.json +0 -35
- package/dist/skills/ads-designer/assets/bootstrap-ds/vite.config.ts +0 -23
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/demo-frame/DemoFrame.tsx +0 -29
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/review/screen-frame/ScreenFrame.tsx +0 -34
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/design-system/showcase/mcp/main.tsx +0 -6
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/ds.config.json +0 -20
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/package.json +0 -38
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/src/vite-env.d.ts +0 -7
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/tsconfig.json +0 -36
- package/dist/skills/ads-designer/assets/bootstrap-ds-preact/vite.config.ts +0 -23
- /package/dist/{bootstrap-ds-preact → starters/preact}/design-system/review/demo-frame/DemoFrame.tsx +0 -0
- /package/dist/{bootstrap-ds-preact → starters/preact}/design-system/review/screen-frame/ScreenFrame.tsx +0 -0
- /package/dist/{bootstrap-ds-preact → starters/preact}/design-system/showcase/mcp/main.tsx +0 -0
- /package/dist/{bootstrap-ds-preact → starters/preact}/package.json +0 -0
- /package/dist/{bootstrap-ds-preact → starters/preact}/src/vite-env.d.ts +0 -0
- /package/dist/{bootstrap-ds-preact → starters/preact}/tsconfig.json +0 -0
- /package/dist/{bootstrap-ds-preact → starters/preact}/vite.config.ts +0 -0
- /package/dist/{bootstrap-ds → starters/react}/ADS.md +0 -0
- /package/dist/{bootstrap-ds → starters/react}/biome.css.json +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/assets/brand/app-icon.svg +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/assets/brand/logo.dark.svg +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/assets/brand/logo.svg +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/assets/fonts/.gitkeep +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/components/Actions/Button/Button.ads.fixture.ts +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/components/Actions/Button/Button.ads.scenario.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/components/Actions/Button/README.md +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/components/Content/Logo/Logo.ads.fixture.ts +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/components/Content/Logo/Logo.ads.scenario.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/components/Content/Logo/Logo.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/components/Content/Logo/README.md +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/components/Forms/TextField/README.md +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/components/Forms/TextField/TextField.ads.fixture.ts +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/components/Forms/TextField/TextField.ads.scenario.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/composition/Search/SearchPage/README.md +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/composition/Search/SearchPage/SearchPage.ads.fixture.ts +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/composition/Search/SearchPage/SearchPage.ads.scenario.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/controllers/.gitkeep +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/patterns/Search/SearchBar/README.md +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/patterns/Search/SearchBar/SearchBar.ads.fixture.ts +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/patterns/Search/SearchBar/SearchBar.ads.scenario.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/patterns/Search/SearchBar/SearchBar.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/review/brand-preview/BrandPreview.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/review/demo-frame/DemoFrame.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/review/screen-frame/ScreenFrame.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/showcase/mcp/index.html +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/showcase/mcp/main.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/styles.css +0 -0
- /package/dist/{bootstrap-ds → starters/react}/design-system/tokens/Color.ads.scenario.tsx +0 -0
- /package/dist/{bootstrap-ds → starters/react}/gitignore.template +0 -0
- /package/dist/{bootstrap-ds → starters/react}/package-lock.json +0 -0
- /package/dist/{bootstrap-ds → starters/react}/package.json +0 -0
- /package/dist/{bootstrap-ds → starters/react}/scripts/build-mcp-previews.mjs +0 -0
- /package/dist/{bootstrap-ds → starters/react}/src/vite-env.d.ts +0 -0
- /package/dist/{bootstrap-ds → starters/react}/tsconfig.json +0 -0
- /package/dist/{bootstrap-ds → starters/react}/vite.config.ts +0 -0
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
This private React or Preact TypeScript workspace contains semantic CSS tokens, a project-owned
|
|
4
4
|
token review renderer, a public barrel, Linaria extraction and a preview compiler
|
|
5
|
-
adapter, plus one example of each layer to build on:
|
|
6
|
-
|
|
7
|
-
`components/Content/Logo`, `components/Forms/TextField
|
|
5
|
+
adapter, plus one example of each layer to build on: a token foundation in six groups (Color, Type, Space & sizing, Shape & elevation, Motion, Layout), Brand previews in two groups (`brand/Identity/Logo`, `brand/Icons/AppIcon`),
|
|
6
|
+
components in four groups (`components/Actions/Button`, `components/Actions/IconButton`,
|
|
7
|
+
`components/Content/Icon`, `components/Content/Logo`, `components/Forms/TextField`,
|
|
8
|
+
`components/Layout/Grid`), a 24 px icon set in `assets/glyphs/` generated into
|
|
9
|
+
`components/Content/Icon/glyphs.ts`, one pattern
|
|
8
10
|
(`patterns/Search/SearchBar`) and one composition (`composition/Search/SearchPage`),
|
|
9
11
|
plus placeholder brand artwork in `assets/brand/` (a logo with its dark-theme
|
|
10
12
|
variant, and the app icon that `assets.iconSource` names). Rename, restyle or
|
|
@@ -16,35 +18,28 @@ Read the local [contract](ADS.md) and the
|
|
|
16
18
|
|
|
17
19
|
## Start
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
skill contains the same files in `assets/bootstrap-ds/` and
|
|
24
|
-
`assets/bootstrap-ds-preact/`. Set the project name in `package.json`. Install Bun 1.4.1+ for ADS tooling and previews. The application can keep its
|
|
25
|
-
Node/npm build pipeline. Use a current ADS release.
|
|
21
|
+
This project was created by `ads create`, which copied the starter shipped in that
|
|
22
|
+
ADS version (the React starter, with the framework's files applied for Preact),
|
|
23
|
+
named the package and ran `ads init`. Install Bun 1.4.1+ for ADS tooling and
|
|
24
|
+
previews. The application can keep its Node/npm build pipeline.
|
|
26
25
|
|
|
27
26
|
```sh
|
|
28
|
-
npx @reqvire-org/ads
|
|
27
|
+
npx @reqvire-org/ads create my-design-system --framework react # or preact
|
|
28
|
+
cd my-design-system
|
|
29
29
|
npm install
|
|
30
30
|
npm run build
|
|
31
31
|
npm run dev:showcase
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
For unreleased tooling,
|
|
34
|
+
For unreleased tooling, create from the real local package:
|
|
35
35
|
|
|
36
36
|
```sh
|
|
37
|
-
ads_tool_package="/absolute/path/to/reqvire-org-ads-0.3.
|
|
38
|
-
npx --yes --package "$ads_tool_package" ads
|
|
39
|
-
npm install
|
|
40
|
-
npm run build
|
|
37
|
+
ads_tool_package="/absolute/path/to/reqvire-org-ads-0.3.45.tgz"
|
|
38
|
+
npx --yes --package "$ads_tool_package" ads create my-design-system --framework react --tool-package "$ads_tool_package"
|
|
41
39
|
```
|
|
42
40
|
|
|
43
|
-
For
|
|
44
|
-
|
|
45
|
-
`bunx @reqvire-org/ads init`. Init detects existing
|
|
46
|
-
Bun projects and preserves their scripts/lockfiles. Use `bun install` and
|
|
47
|
-
`bun --bun run build`/`bun --bun run dev:showcase`. Node is unnecessary with Bun
|
|
41
|
+
For Bun, add `--package-manager bun`: scripts use `bun run` and no npm lockfile is
|
|
42
|
+
kept. Use `bun install` and `bun --bun run build`/`bun --bun run dev:showcase`. Node is unnecessary with Bun
|
|
48
43
|
1.4.1+. ADS supplies its Bun preview compiler independently of the project build.
|
|
49
44
|
|
|
50
45
|
For an existing application, merge only the ADS source and required extraction,
|
|
@@ -67,9 +62,55 @@ Its MCP client discovers entries, invokes preview tools and follows notification
|
|
|
67
62
|
There are no required TokensPage/ComponentsPage/PatternsPage/CompositionPage
|
|
68
63
|
files, and no separate project browser app to implement or rebuild.
|
|
69
64
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
## Tokens
|
|
66
|
+
|
|
67
|
+
The foundation meets WCAG 2.2 AA:
|
|
68
|
+
|
|
69
|
+
- **Color** (`colors.css`): six 12-step ramps (`--slate-*`, `--color-accent-*`,
|
|
70
|
+
`--color-green|amber|red|blue-*`); each step has one job: 1–2 backgrounds, 3–5 component
|
|
71
|
+
rest/hover/pressed, 6–8 borders, 9–10 solid fills, 11–12 text. The dark theme redefines
|
|
72
|
+
the ramps under the same names. Semantic roles (`--bg-*`, `--text-*`, `--border-*`,
|
|
73
|
+
`--accent*`, `--success|warning|danger|info*`) alias ramp steps; text pairs reach 4.5:1
|
|
74
|
+
and focus and strong borders 3:1 in both themes. Layers go canvas → surface → raised,
|
|
75
|
+
each a step lighter in dark; inputs use `--bg-field`; `--bg-overlay` is the modal scrim and
|
|
76
|
+
`--bg-skeleton` the loading fill. Disabled roles (`--bg-|--text-|--border-disabled`) are
|
|
77
|
+
neutral for every variant and exempt from contrast. States move along a ramp: hover one
|
|
78
|
+
step, pressed two, selected the accent's step 3.
|
|
79
|
+
- **Type** (`typography.css`): a 16 px body on a modular ladder `--text-xs`…`--text-5xl`,
|
|
80
|
+
fluid from `3xl`; line height tightens as size grows (`--leading-*`), letter spacing turns
|
|
81
|
+
negative for display (`--tracking-*`); weights 400–700.
|
|
82
|
+
- **Space & sizing** (`spacing.css`): one rhythm, `--space-N` = N × 2 px from 0 to 160 px.
|
|
83
|
+
Use 0–8 px inside components, 12–24 px between related elements, 32–80 px between
|
|
84
|
+
sections and 96–160 px around hero and page sections; values do not change by screen
|
|
85
|
+
size, step down at narrow widths. Stack and prose-flow gaps, control heights 32/40/48 px
|
|
86
|
+
with padding, icons 16/20/24/32 px.
|
|
87
|
+
- **Shape & elevation**: radius `--radius-xs`…`--radius-2xl` and `--radius-full`, border
|
|
88
|
+
and focus widths, layered shadows `--shadow-xs`…`--shadow-xl` (stronger in dark), and
|
|
89
|
+
fixed stacking layers `--z-*`.
|
|
90
|
+
- **Themes**: light (default) and dark, declared in `ds.config.json`. Light ramps sit on
|
|
91
|
+
`:root, [data-theme="light"]`, roles on `:root, [data-theme]` and dark ramps on
|
|
92
|
+
`[data-theme="dark"]`, so `data-theme` themes the page on `<html>` or one section on any
|
|
93
|
+
element.
|
|
94
|
+
- **Motion** (`elevation.css`): durations 70/110/150/240/400/700 ms, easing for moving between
|
|
95
|
+
places (standard), entering and leaving, each with a `-strong` variant for rare important
|
|
96
|
+
moments; all durations are 0 under reduced motion.
|
|
97
|
+
- **Layout**: a column grid (`--grid-columns-sm/md/lg` = 4/8/16 columns from 0,
|
|
98
|
+
768 and 1024 px of container width; gutters 32/16/1 px for wide, narrow and condensed;
|
|
99
|
+
margins 0/16/24 px), `--content-max` (72ch), container widths `--container-*`, header,
|
|
100
|
+
side pane and rail. Breakpoints cannot be CSS variables: use 640, 768, 1024 and 1280 px
|
|
101
|
+
in media queries, or container queries as `components/Layout/Grid` does.
|
|
102
|
+
|
|
103
|
+
`components/Layout/Grid` (`Grid`, `GridItem`) lays content on that grid by container width,
|
|
104
|
+
so it fits any pane. The showcase's grid button draws the project's grid over every
|
|
105
|
+
preview to check alignment.
|
|
106
|
+
|
|
107
|
+
`ads check` warns when a text or control pair falls below WCAG AA in any theme
|
|
108
|
+
(`token-contrast`) and when a spacing step leaves the 2 px rhythm (`token-rhythm`).
|
|
109
|
+
`ads tokens --format dtcg` exports the tokens as W3C Design Tokens JSON for design tools.
|
|
110
|
+
|
|
111
|
+
The six token scenarios (`tokens/Color`, `Type`, `Space`, `Shape`, `Motion`, `Layout`)
|
|
112
|
+
and their colocated fixtures visually demonstrate every token value, one tile per token
|
|
113
|
+
with its current value. The fixture owns `{ token, property, probe }` bindings;
|
|
73
114
|
the development-only `TokenPreview` renderer, exported through `@ds/review`, owns their presentation and applies the real CSS
|
|
74
115
|
variables. Add/remove samples alongside token definitions. `ads check` rejects
|
|
75
116
|
missing coverage and invented names; the App verifies the declared CSS bindings
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The starter's placeholder artwork. Replace each file with the product's own and keep this
|
|
4
4
|
table current: `ads check` warns about artwork that is undescribed, unlicensed, unused or
|
|
5
|
-
missing from the
|
|
5
|
+
missing from the Brand previews (`brand/Identity/Logo`, `brand/Icons/AppIcon`).
|
|
6
6
|
|
|
7
7
|
| File | Use | Backgrounds |
|
|
8
8
|
|---|---|---|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Glyphs
|
|
2
|
+
|
|
3
|
+
The UI icon set: one 24 × 24 stroke drawing per file, colored by `currentColor` so an icon
|
|
4
|
+
takes the color of the text beside it. `ads assets` turns them into
|
|
5
|
+
`components/Content/Icon/glyphs.ts` (`assets.glyphs` in `ds.config.json`), adding
|
|
6
|
+
`fill="none"`, a 2 px stroke and round caps where a file does not set them. `aliases.json`
|
|
7
|
+
gives extra names to existing glyphs.
|
|
8
|
+
|
|
9
|
+
Keep every glyph on the same 24 × 24 `viewBox` and never set a fill or stroke color in the
|
|
10
|
+
file: `ads check` warns about both (`glyph-viewbox`, `glyph-color`).
|
|
11
|
+
|
|
12
|
+
License: drawn for the ADS starter, free to use, change or remove (MIT, like ADS).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "x": "close", "add": "plus" }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m9 6 6 6-6 6"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 6 6 18M6 6l12 12"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M12 16v-5M12 8h.01"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 6h16M4 12h16M4 18h16"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><path d="m20 20-4.35-4.35"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3 2 20h20L12 3Z"/><path d="M12 10v4M12 17h.01"/></svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import appIcon from "../../../assets/brand/app-icon.svg?url";
|
|
2
|
+
|
|
3
|
+
export const fixture = {
|
|
4
|
+
title: "App icon",
|
|
5
|
+
artwork: [{ name: "app-icon.svg", use: "Master for the web icons and committed targets", src: appIcon }],
|
|
6
|
+
icon: { name: "app-icon.svg", src: appIcon, sizes: [16, 32, 48, 180, 192, 512] },
|
|
7
|
+
} as const;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BrandPreview } from "@ds/review";
|
|
2
|
-
import { fixture } from "./
|
|
3
|
-
export const scenario = { title: fixture.title, covers: ["BrandPreview"]
|
|
2
|
+
import { fixture } from "./AppIcon.ads.fixture";
|
|
3
|
+
export const scenario = { title: fixture.title, covers: ["BrandPreview"] };
|
|
4
4
|
export default function Scenario() { return <BrandPreview {...fixture} />; }
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import logo from "../../../assets/brand/logo.svg?url";
|
|
2
|
+
import logoDark from "../../../assets/brand/logo.dark.svg?url";
|
|
3
|
+
|
|
4
|
+
export const fixture = {
|
|
5
|
+
title: "Logo",
|
|
6
|
+
artwork: [{ name: "logo.svg", use: "Logo in the UI (Logo component)", src: logo, darkSrc: logoDark }],
|
|
7
|
+
} as const;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { BrandPreview } from "@ds/review";
|
|
2
|
-
import { fixture } from "./
|
|
3
|
-
export const scenario = { title: fixture.title, covers: ["BrandPreview"]
|
|
2
|
+
import { fixture } from "./Logo.ads.fixture";
|
|
3
|
+
export const scenario = { title: fixture.title, covers: ["BrandPreview"] };
|
|
4
4
|
export default function Scenario() { return <BrandPreview {...fixture} />; }
|
|
@@ -13,17 +13,24 @@ const base = css`
|
|
|
13
13
|
display: inline-flex;
|
|
14
14
|
align-items: center;
|
|
15
15
|
justify-content: center;
|
|
16
|
-
|
|
17
|
-
padding-inline: var(--
|
|
16
|
+
min-height: var(--control-height-md);
|
|
17
|
+
padding-inline: var(--control-padding-md);
|
|
18
18
|
border-width: var(--border-w);
|
|
19
19
|
border-style: solid;
|
|
20
20
|
border-color: transparent;
|
|
21
21
|
border-radius: var(--radius-md);
|
|
22
22
|
font-size: var(--text-base);
|
|
23
23
|
font-weight: var(--weight-semibold);
|
|
24
|
-
line-height: var(--leading-
|
|
24
|
+
line-height: var(--leading-tight);
|
|
25
25
|
cursor: pointer;
|
|
26
|
-
|
|
26
|
+
transition: background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
|
|
27
|
+
/* Disabled is neutral, whatever the variant (exempt from contrast, WCAG 1.4.3). */
|
|
28
|
+
&:disabled {
|
|
29
|
+
cursor: default;
|
|
30
|
+
background: var(--bg-disabled);
|
|
31
|
+
border-color: var(--border-disabled);
|
|
32
|
+
color: var(--text-disabled);
|
|
33
|
+
}
|
|
27
34
|
`;
|
|
28
35
|
const variants = {
|
|
29
36
|
primary: css`
|
package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.scenario.tsx
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconButton } from "@ds";
|
|
2
|
+
import { DemoFrame } from "@ds/review";
|
|
3
|
+
import { fixture } from "./IconButton.ads.fixture";
|
|
4
|
+
export const scenario = { title: fixture.title, covers: ["IconButton"] };
|
|
5
|
+
export default function Scenario() {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
{(["sm", "md", "lg"] as const).map(size => (
|
|
9
|
+
<DemoFrame key={size}>
|
|
10
|
+
{fixture.actions.map(action => <IconButton key={action.icon} icon={action.icon} label={action.label} size={size} />)}
|
|
11
|
+
<IconButton icon="check" label="Unavailable" size={size} disabled />
|
|
12
|
+
</DemoFrame>
|
|
13
|
+
))}
|
|
14
|
+
</>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { css, cx } from "@linaria/atomic";
|
|
2
|
+
import { Icon, type IconName } from "../../Content/Icon/Icon";
|
|
3
|
+
|
|
4
|
+
export interface IconButtonProps {
|
|
5
|
+
icon: IconName;
|
|
6
|
+
/** Required: the button's accessible name, also shown as its tooltip. */
|
|
7
|
+
label: string;
|
|
8
|
+
size?: "sm" | "md" | "lg";
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// A square control-height target around a smaller glyph; only the background has states.
|
|
14
|
+
const base = css`
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
padding: 0;
|
|
19
|
+
border-width: var(--border-w);
|
|
20
|
+
border-style: solid;
|
|
21
|
+
border-color: transparent;
|
|
22
|
+
border-radius: var(--radius-md);
|
|
23
|
+
background: transparent;
|
|
24
|
+
color: var(--text-body);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
transition: background-color var(--dur-fast) var(--ease-standard);
|
|
27
|
+
&:hover:not(:disabled) { background: var(--bg-hover); }
|
|
28
|
+
&:active:not(:disabled) { background: var(--bg-active); }
|
|
29
|
+
&:disabled { cursor: default; color: var(--text-disabled); }
|
|
30
|
+
`;
|
|
31
|
+
const sizes = {
|
|
32
|
+
sm: css`width: var(--control-height-sm); height: var(--control-height-sm);`,
|
|
33
|
+
md: css`width: var(--control-height-md); height: var(--control-height-md);`,
|
|
34
|
+
lg: css`width: var(--control-height-lg); height: var(--control-height-lg);`,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** An action shown as an icon, named for assistive technology and in its tooltip. */
|
|
38
|
+
export function IconButton({ icon, label, size = "md", disabled, onClick }: IconButtonProps) {
|
|
39
|
+
return (
|
|
40
|
+
<button type="button" className={cx("ds-icon-button", base, sizes[size])} aria-label={label} title={label} disabled={disabled} onClick={onClick}>
|
|
41
|
+
<Icon name={icon} size={size === "lg" ? "md" : "sm"} />
|
|
42
|
+
</button>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# IconButton
|
|
2
|
+
|
|
3
|
+
An action shown as an icon. `label` is required: it is the button's accessible name and its
|
|
4
|
+
tooltip, so an icon-only control is never anonymous (WCAG 4.1.2). The glyph is centered in a
|
|
5
|
+
square target of the control height (32/40/48 px). Only the background has states (hover,
|
|
6
|
+
pressed, disabled); the icon keeps the text color.
|
|
7
|
+
|
|
8
|
+
| Prop | Type | Default |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| `icon` | `IconName` | — |
|
|
11
|
+
| `label` | `string` | — |
|
|
12
|
+
| `size` | `"sm" \| "md" \| "lg"` | `"md"` |
|
|
13
|
+
| `disabled` | `boolean` | `false` |
|
|
14
|
+
| `onClick` | `() => void` | — |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const fixture = { title: "Icons", sizes: ["sm", "md", "lg", "xl"] } as const;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Icon, iconNames } from "@ds";
|
|
2
|
+
import { DemoFrame } from "@ds/review";
|
|
3
|
+
import { fixture } from "./Icon.ads.fixture";
|
|
4
|
+
export const scenario = { title: fixture.title, covers: ["Icon"] };
|
|
5
|
+
export default function Scenario() {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
{fixture.sizes.map(size => (
|
|
9
|
+
<DemoFrame key={size}>
|
|
10
|
+
{iconNames.map(name => <Icon key={name} name={name} size={size} label={name} />)}
|
|
11
|
+
</DemoFrame>
|
|
12
|
+
))}
|
|
13
|
+
</>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { css, cx } from "@linaria/atomic";
|
|
2
|
+
import { glyphAliases, glyphs } from "./glyphs";
|
|
3
|
+
|
|
4
|
+
export type IconName = keyof typeof glyphs | keyof typeof glyphAliases;
|
|
5
|
+
export interface IconProps {
|
|
6
|
+
name: IconName;
|
|
7
|
+
/** 16 px beside sm/base text (default), 20 px beside lg, 24 and 32 px on their own. */
|
|
8
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
9
|
+
/** Announced name for an icon that carries meaning on its own; without it the icon is decorative. */
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Every canonical glyph, for catalogues; aliases name the same drawings. */
|
|
13
|
+
export const iconNames = Object.keys(glyphs).sort() as IconName[];
|
|
14
|
+
|
|
15
|
+
// Centered beside text, never on the baseline; colored by the text it sits in.
|
|
16
|
+
const base = css`
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
flex: none;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
vertical-align: middle;
|
|
22
|
+
color: inherit;
|
|
23
|
+
& > svg { display: block; width: 100%; height: 100%; }
|
|
24
|
+
`;
|
|
25
|
+
const sizes = {
|
|
26
|
+
sm: css`width: var(--icon-sm); height: var(--icon-sm);`,
|
|
27
|
+
md: css`width: var(--icon-md); height: var(--icon-md);`,
|
|
28
|
+
lg: css`width: var(--icon-lg); height: var(--icon-lg);`,
|
|
29
|
+
xl: css`width: var(--icon-xl); height: var(--icon-xl);`,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** A glyph from the project's icon set. */
|
|
33
|
+
export function Icon({ name, size = "sm", label }: IconProps) {
|
|
34
|
+
const canonical = (name in glyphAliases ? glyphAliases[name as keyof typeof glyphAliases] : name) as keyof typeof glyphs;
|
|
35
|
+
return (
|
|
36
|
+
<span
|
|
37
|
+
className={cx("ds-icon", base, sizes[size])}
|
|
38
|
+
{...(label ? { role: "img", "aria-label": label } : { "aria-hidden": true })}
|
|
39
|
+
dangerouslySetInnerHTML={{ __html: glyphs[canonical] }}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Icon
|
|
2
|
+
|
|
3
|
+
A glyph from the project's icon set (`assets/glyphs/`, generated into `glyphs.ts` by
|
|
4
|
+
`ads assets`). It takes the color of the surrounding text (`currentColor`) and sits centered
|
|
5
|
+
beside it. Sizes pair with text: `sm` (16 px) beside sm/base text, `md` (20 px) beside lg,
|
|
6
|
+
`lg` and `xl` (24 and 32 px) on their own; keep one size per context.
|
|
7
|
+
|
|
8
|
+
Without `label` the icon is decorative and hidden from assistive technology; pass `label`
|
|
9
|
+
when the icon alone carries meaning. Icons have no states of their own: interactive icons
|
|
10
|
+
live in an `IconButton`, whose background changes.
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| `name` | `IconName` (a glyph or alias) | — |
|
|
15
|
+
| `size` | `"sm" \| "md" \| "lg" \| "xl"` | `"sm"` |
|
|
16
|
+
| `label` | `string` | decorative |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Generated by `ads assets` from assets/glyphs/. Edit the SVGs, not this file.
|
|
2
|
+
export const glyphs = {
|
|
3
|
+
"check": "<svg fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M20 6 9 17l-5-5\"/></svg>",
|
|
4
|
+
"chevron-down": "<svg fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"m6 9 6 6 6-6\"/></svg>",
|
|
5
|
+
"chevron-right": "<svg fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"m9 6 6 6-6 6\"/></svg>",
|
|
6
|
+
"close": "<svg fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M18 6 6 18M6 6l12 12\"/></svg>",
|
|
7
|
+
"external-link": "<svg fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5\"/></svg>",
|
|
8
|
+
"info": "<svg fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M12 16v-5M12 8h.01\"/></svg>",
|
|
9
|
+
"menu": "<svg fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M4 6h16M4 12h16M4 18h16\"/></svg>",
|
|
10
|
+
"plus": "<svg fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 5v14M5 12h14\"/></svg>",
|
|
11
|
+
"search": "<svg fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><circle cx=\"11\" cy=\"11\" r=\"7\"/><path d=\"m20 20-4.35-4.35\"/></svg>",
|
|
12
|
+
"warning": "<svg fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 3 2 20h20L12 3Z\"/><path d=\"M12 10v4M12 17h.01\"/></svg>"
|
|
13
|
+
} as const;
|
|
14
|
+
export const glyphAliases = {
|
|
15
|
+
"x": "close",
|
|
16
|
+
"add": "plus"
|
|
17
|
+
} as const;
|
package/dist/{bootstrap-ds → starters/react}/design-system/components/Forms/TextField/TextField.tsx
RENAMED
|
@@ -25,16 +25,20 @@ const labelStyle = css`
|
|
|
25
25
|
color: var(--text-body);
|
|
26
26
|
`;
|
|
27
27
|
const input = css`
|
|
28
|
-
|
|
29
|
-
padding-inline: var(--
|
|
30
|
-
border: var(--border-w) solid var(--border-
|
|
28
|
+
min-height: var(--control-height-md);
|
|
29
|
+
padding-inline: var(--control-padding-md);
|
|
30
|
+
border: var(--border-w) solid var(--border-strong);
|
|
31
31
|
border-radius: var(--radius-md);
|
|
32
|
-
background: var(--bg-
|
|
32
|
+
background: var(--bg-field);
|
|
33
33
|
color: var(--text-body);
|
|
34
34
|
font-size: var(--text-base);
|
|
35
35
|
line-height: var(--leading-normal);
|
|
36
36
|
&::placeholder { color: var(--text-muted); }
|
|
37
|
-
&:disabled {
|
|
37
|
+
&:disabled {
|
|
38
|
+
background: var(--bg-disabled);
|
|
39
|
+
border-color: var(--border-disabled);
|
|
40
|
+
color: var(--text-disabled);
|
|
41
|
+
}
|
|
38
42
|
`;
|
|
39
43
|
|
|
40
44
|
/** A labelled single-line text input. */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const fixture = {
|
|
2
|
+
title: "Grid",
|
|
3
|
+
columns: Array.from({ length: 16 }, (_, index) => `${index + 1}`),
|
|
4
|
+
layout: [
|
|
5
|
+
{ label: "Main", span: { sm: 4, md: 5, lg: 11 } },
|
|
6
|
+
{ label: "Aside", span: { sm: 4, md: 3, lg: 5 } },
|
|
7
|
+
{ label: "Card", span: { sm: 2, md: 4, lg: 4 } },
|
|
8
|
+
{ label: "Card", span: { sm: 2, md: 4, lg: 4 } },
|
|
9
|
+
{ label: "Card", span: { sm: 2, md: 4, lg: 4 } },
|
|
10
|
+
{ label: "Card", span: { sm: 2, md: 4, lg: 4 } },
|
|
11
|
+
],
|
|
12
|
+
} as const;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Grid, GridItem } from "@ds";
|
|
2
|
+
import { GridCell } from "@ds/review";
|
|
3
|
+
import { fixture } from "./Grid.ads.fixture";
|
|
4
|
+
export const scenario = { title: fixture.title, covers: ["Grid", "GridItem"] };
|
|
5
|
+
// Edge to edge, so the grid lines up with the showcase's grid overlay at every width.
|
|
6
|
+
export default function Scenario() {
|
|
7
|
+
return (
|
|
8
|
+
<Grid>
|
|
9
|
+
{fixture.columns.map(column => (
|
|
10
|
+
<GridItem key={column} span={{ sm: 1, md: 1, lg: 1 }}><GridCell label={column} /></GridItem>
|
|
11
|
+
))}
|
|
12
|
+
{fixture.layout.map((cell, index) => (
|
|
13
|
+
<GridItem key={index} span={cell.span}><GridCell label={cell.label} /></GridItem>
|
|
14
|
+
))}
|
|
15
|
+
</Grid>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useLayoutEffect, useRef, type ReactNode } from "react";
|
|
2
|
+
import { css, cx } from "@linaria/atomic";
|
|
3
|
+
|
|
4
|
+
export interface GridProps {
|
|
5
|
+
/** `wide` 32 px gutters (default), `narrow` 16 px, `condensed` 1 px for tightly related content. */
|
|
6
|
+
gutter?: "wide" | "narrow" | "condensed";
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface GridItemProps {
|
|
10
|
+
/** Columns to span at each container size (of 4, 8 and 16). A size left out spans the full row. */
|
|
11
|
+
span?: { sm?: number; md?: number; lg?: number };
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// The grid follows its container, not the window: it sits in any pane at the right columns.
|
|
16
|
+
const container = css`
|
|
17
|
+
container-type: inline-size;
|
|
18
|
+
width: 100%;
|
|
19
|
+
`;
|
|
20
|
+
const grid = css`
|
|
21
|
+
display: grid;
|
|
22
|
+
grid-template-columns: repeat(var(--grid-columns-sm), minmax(0, 1fr));
|
|
23
|
+
padding-inline: var(--grid-margin-sm);
|
|
24
|
+
@container (min-width: 768px) {
|
|
25
|
+
grid-template-columns: repeat(var(--grid-columns-md), minmax(0, 1fr));
|
|
26
|
+
padding-inline: var(--grid-margin-md);
|
|
27
|
+
}
|
|
28
|
+
@container (min-width: 1024px) {
|
|
29
|
+
grid-template-columns: repeat(var(--grid-columns-lg), minmax(0, 1fr));
|
|
30
|
+
}
|
|
31
|
+
@container (min-width: 1280px) {
|
|
32
|
+
padding-inline: var(--grid-margin-lg);
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
const gutters = {
|
|
36
|
+
wide: css`gap: var(--grid-gutter);`,
|
|
37
|
+
narrow: css`gap: var(--grid-gutter-narrow);`,
|
|
38
|
+
condensed: css`gap: var(--grid-gutter-condensed);`,
|
|
39
|
+
};
|
|
40
|
+
const item = css`
|
|
41
|
+
min-width: 0;
|
|
42
|
+
grid-column: span var(--ds-grid-span-sm, var(--grid-columns-sm));
|
|
43
|
+
@container (min-width: 768px) {
|
|
44
|
+
grid-column: span var(--ds-grid-span-md, var(--grid-columns-md));
|
|
45
|
+
}
|
|
46
|
+
@container (min-width: 1024px) {
|
|
47
|
+
grid-column: span var(--ds-grid-span-lg, var(--grid-columns-lg));
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
/** A column grid: 4, 8 or 16 columns by its container's width, with spacing-scale gutters. */
|
|
52
|
+
export function Grid({ gutter = "wide", children }: GridProps) {
|
|
53
|
+
return (
|
|
54
|
+
<div className={cx("ds-grid", container)}>
|
|
55
|
+
<div className={cx(grid, gutters[gutter])}>{children}</div>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** One cell of a `Grid`, spanning some of its columns at each size. */
|
|
61
|
+
export function GridItem({ span, children }: GridItemProps) {
|
|
62
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
63
|
+
useLayoutEffect(() => {
|
|
64
|
+
const element = ref.current;
|
|
65
|
+
if (!element) return;
|
|
66
|
+
// Each size names its own variable: ADS allows only declared, literal style writes.
|
|
67
|
+
if (span?.sm) element.style.setProperty("--ds-grid-span-sm", String(span.sm));
|
|
68
|
+
else element.style.removeProperty("--ds-grid-span-sm");
|
|
69
|
+
if (span?.md) element.style.setProperty("--ds-grid-span-md", String(span.md));
|
|
70
|
+
else element.style.removeProperty("--ds-grid-span-md");
|
|
71
|
+
if (span?.lg) element.style.setProperty("--ds-grid-span-lg", String(span.lg));
|
|
72
|
+
else element.style.removeProperty("--ds-grid-span-lg");
|
|
73
|
+
}, [span?.sm, span?.md, span?.lg]);
|
|
74
|
+
return <div ref={ref} className={cx("ds-grid__item", item)}>{children}</div>;
|
|
75
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Grid
|
|
2
|
+
|
|
3
|
+
A column grid: 4 columns, then 8 from 768 px and 16 from 1024 px of
|
|
4
|
+
**container** width (container queries), so it fits any pane. Margins are 0, 16 and 24 px;
|
|
5
|
+
`gutter` is `wide` (32 px, default), `narrow` (16 px) or `condensed` (1 px, for tightly
|
|
6
|
+
related content). All lengths come from the `--grid-*` tokens, which alias spacing steps.
|
|
7
|
+
|
|
8
|
+
`GridItem` spans `span.sm`, `span.md` and `span.lg` columns; a size left out spans the full
|
|
9
|
+
row. Align text to the item's edge; never let content touch the gutter.
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
<Grid>
|
|
13
|
+
<GridItem span={{ md: 5, lg: 11 }}>Main</GridItem>
|
|
14
|
+
<GridItem span={{ md: 3, lg: 5 }}>Aside</GridItem>
|
|
15
|
+
</Grid>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
| Prop | Type | Default |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `Grid` `gutter` | `"wide" \| "narrow" \| "condensed"` | `"wide"` |
|
|
21
|
+
| `GridItem` `span` | `{ sm?: number; md?: number; lg?: number }` | full row |
|
|
@@ -3,6 +3,9 @@ import "./styles.css";
|
|
|
3
3
|
|
|
4
4
|
// Public components and patterns. Add new ones here as they are implemented.
|
|
5
5
|
export { Button, type ButtonProps } from "./components/Actions/Button/Button";
|
|
6
|
+
export { IconButton, type IconButtonProps } from "./components/Actions/IconButton/IconButton";
|
|
7
|
+
export { Icon, iconNames, type IconName, type IconProps } from "./components/Content/Icon/Icon";
|
|
6
8
|
export { Logo, type LogoProps } from "./components/Content/Logo/Logo";
|
|
7
9
|
export { TextField, type TextFieldProps } from "./components/Forms/TextField/TextField";
|
|
10
|
+
export { Grid, GridItem, type GridProps, type GridItemProps } from "./components/Layout/Grid/Grid";
|
|
8
11
|
export { SearchBar, type SearchBarProps } from "./patterns/Search/SearchBar/SearchBar";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { css } from "@linaria/atomic";
|
|
2
|
+
|
|
3
|
+
const cell = css`
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
min-height: calc(var(--space-16) * 2);
|
|
8
|
+
padding: var(--space-4);
|
|
9
|
+
border-radius: var(--radius-sm);
|
|
10
|
+
background: var(--accent-subtle);
|
|
11
|
+
color: var(--accent-text);
|
|
12
|
+
font-size: var(--text-sm);
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
/** Development-only fill for grid scenarios: makes a cell's columns visible. */
|
|
16
|
+
export function GridCell({ label }: { label: string }) {
|
|
17
|
+
return <div className={cell}>{label}</div>;
|
|
18
|
+
}
|