@amsterdam/design-system-tokens 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md ADDED
@@ -0,0 +1,71 @@
1
+ <!-- @license CC0-1.0 -->
2
+
3
+ # Tokens Package — Agent Instructions
4
+
5
+ These instructions are additive to the root [AGENTS.md](../../AGENTS.md). Read that first.
6
+
7
+ See [README.md](README.md) for full token usage and design guidance; this file focuses on agent-specific rules for editing token source files.
8
+
9
+ ## Overview
10
+
11
+ This package defines design tokens using the [Design Tokens Community Group (DTCG)](https://tr.designtokens.org/format/) format and builds them into CSS custom properties, JSON, and Sass variables via [Style Dictionary](https://styledictionary.com/).
12
+
13
+ ## Token structure
14
+
15
+ Tokens are organized into three layers:
16
+
17
+ | Directory | Purpose |
18
+ | ------------------ | ------------------------------------------------- |
19
+ | `src/brand/ams/` | Brand-level values (colors, typography, spacing) |
20
+ | `src/common/ams/` | Shared patterns across components (inputs, links) |
21
+ | `src/components/ams/` | Component-specific tokens |
22
+
23
+ ## Token file format
24
+
25
+ Token files use the `.tokens.json` extension and follow the DTCG format:
26
+
27
+ ```json
28
+ {
29
+ "ams": {
30
+ "<component-name>": {
31
+ "<property>": {
32
+ "$value": "{ams.<reference>}",
33
+ "$type": "<dtcg-type>"
34
+ }
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ - Always reference existing brand or common tokens where possible — do not hardcode raw values.
41
+ - Valid `$type` values used in this project: `color`, `dimension`, `fontFamily`, `fontWeight`, `shadow`. Do not invent other `$type` values.
42
+ - Use the `$extensions` field for Amsterdam-specific metadata (e.g. `nl.amsterdam.type`, `nl.amsterdam.subtype`). Common `$extensions` types include `fontSize`, `lineHeight`, and `space` (via `nl.amsterdam.subtype`). See existing component tokens for examples.
43
+ - Variant tokens are nested under the component (e.g. `ams.badge.azure.background-color`).
44
+
45
+ ## Compact mode
46
+
47
+ Some token categories have `.compact.tokens.json` variants (e.g. `space.compact.tokens.json`, `typography.compact.tokens.json`). These provide denser values for compact layouts.
48
+
49
+ ## Build
50
+
51
+ - Build command: `pnpm build` (runs `node build.js`)
52
+ - Watch mode: `pnpm build:watch`
53
+ - Output: `dist/` — never edit generated output directly.
54
+ - Build config: `build.js` with custom Style Dictionary logic in `style-dictionary/` (includes `transforms/` and `dimensionToString.js`).
55
+
56
+ ## File locations
57
+
58
+ - Component tokens: `src/components/ams/<name>.tokens.json`
59
+ - Brand tokens: `src/brand/ams/`
60
+ - Common tokens: `src/common/ams/`
61
+ - Build script: `build.js`
62
+ - Custom transforms: `style-dictionary/transforms/`
63
+
64
+ ## Key rules
65
+
66
+ - Every token must have a `$value`. Type information is provided through either `$type` (DTCG standard) or `$extensions` with `nl.amsterdam.type` / `nl.amsterdam.subtype`. Some tokens (e.g. cursors, aspect ratios) have no type annotation — follow the existing pattern for the token category you are editing.
67
+ - Token names use kebab-case and mirror CSS property names where applicable.
68
+ - No unused tokens — every defined token must be consumed by CSS or another token.
69
+ - No hardcoded design values in CSS or React — if a value is missing, add a token here first.
70
+ - Changes to brand-level tokens in `src/brand/ams/` have wide impact; do not change them unless the task explicitly calls for brand updates.
71
+ - When adding new component tokens, wire them into CSS (and React where applicable) in the same change so they are immediately used.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.0.1](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v4.0.0...design-system-tokens-v4.0.1) (2026-04-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **Grid:** Set correct horizontal padding in Compact Mode ([#2582](https://github.com/Amsterdam/design-system/issues/2582)) ([049fa6c](https://github.com/Amsterdam/design-system/commit/049fa6c205e2a73f3a4eac66642e000e90aa8369))
12
+
6
13
  ## [4.0.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v3.4.0...design-system-tokens-v4.0.0) (2026-04-20)
7
14
 
8
15
 
@@ -0,0 +1,18 @@
1
+ <!-- @license CC0-1.0 -->
2
+
3
+ # Contributing to the tokens package
4
+
5
+ See the [repository-wide contributing guidelines](../../CONTRIBUTING.md) for general instructions.
6
+ The notes below apply specifically to design tokens.
7
+
8
+ ## Compact Mode and responsive overrides
9
+
10
+ Components may expose separate tokens for responsive variants, such as `vi-medium` and `vi-wide` for the Grid.
11
+ These are applied at breakpoints in the component stylesheet and override the base token.
12
+
13
+ When you add or change a token in a `*.compact.tokens.json` file, check whether the component stylesheet also applies a responsive variant of that token at larger breakpoints.
14
+ If it does, override every responsive variant in the compact file as well.
15
+ Otherwise, the compact value only applies below the first breakpoint, and the component silently reverts to the default token at larger viewports.
16
+
17
+ For example, the Grid mixin sets `padding-inline` from `--ams-grid-padding-inline`, then overrides it with `--ams-grid-vi-medium-padding-inline` and `--ams-grid-vi-wide-padding-inline` at the medium and wide breakpoints.
18
+ Compact Mode must override all three, not just the base.
package/dist/compact.css CHANGED
@@ -37,7 +37,9 @@
37
37
  --ams-typography-heading-4-font-size: var(--ams-typography-body-text-font-size);
38
38
  --ams-typography-heading-5-font-size: var(--ams-typography-body-text-small-font-size);
39
39
  --ams-body-background-color: var(--ams-color-background-body);
40
- --ams-grid-padding-inline: var(--ams-space-xl);
40
+ --ams-grid-padding-inline: var(--ams-space-m);
41
+ --ams-grid-vi-medium-padding-inline: var(--ams-space-l);
42
+ --ams-grid-vi-wide-padding-inline: var(--ams-space-xl);
41
43
  --ams-grid-cell-background-color: var(--ams-color-background);
42
44
  --ams-grid-cell-padding-block: var(--ams-space-m);
43
45
  --ams-grid-cell-padding-inline: var(--ams-space-m);
package/dist/compact.d.ts CHANGED
@@ -87,6 +87,12 @@ declare const tokens: {
87
87
  };
88
88
  grid: {
89
89
  "padding-inline": DesignToken;
90
+ "vi-medium": {
91
+ "padding-inline": DesignToken;
92
+ };
93
+ "vi-wide": {
94
+ "padding-inline": DesignToken;
95
+ };
90
96
  cell: {
91
97
  "background-color": DesignToken;
92
98
  "padding-block": DesignToken;
package/dist/compact.json CHANGED
@@ -70,7 +70,13 @@
70
70
  "background-color": "#e8e8e8"
71
71
  },
72
72
  "grid": {
73
- "padding-inline": "clamp(1.5rem, 1.2857rem + 1.0714vw, 2.25rem)",
73
+ "padding-inline": "clamp(0.75rem, 0.6786rem + 0.3571vw, 1rem)",
74
+ "vi-medium": {
75
+ "padding-inline": "clamp(1rem, 0.8571rem + 0.7143vw, 1.5rem)"
76
+ },
77
+ "vi-wide": {
78
+ "padding-inline": "clamp(1.5rem, 1.2857rem + 1.0714vw, 2.25rem)"
79
+ },
74
80
  "cell": {
75
81
  "background-color": "#ffffff",
76
82
  "padding-block": "clamp(0.75rem, 0.6786rem + 0.3571vw, 1rem)",
package/dist/compact.mjs CHANGED
@@ -41,6 +41,10 @@ export const amsTypographyHeading_5FontSize = "0.875rem";
41
41
  export const amsTypographyHeading_5LineHeight = 1.4;
42
42
  export const amsBodyBackgroundColor = "#e8e8e8";
43
43
  export const amsGridPaddingInline =
44
+ "clamp(0.75rem, 0.6786rem + 0.3571vw, 1rem)";
45
+ export const amsGridViMediumPaddingInline =
46
+ "clamp(1rem, 0.8571rem + 0.7143vw, 1.5rem)";
47
+ export const amsGridViWidePaddingInline =
44
48
  "clamp(1.5rem, 1.2857rem + 1.0714vw, 2.25rem)";
45
49
  export const amsGridCellBackgroundColor = "#ffffff";
46
50
  export const amsGridCellPaddingBlock =
package/dist/compact.scss CHANGED
@@ -35,7 +35,9 @@ $ams-typography-heading-3-font-size: $ams-typography-body-text-large-font-size;
35
35
  $ams-typography-heading-4-font-size: $ams-typography-body-text-font-size;
36
36
  $ams-typography-heading-5-font-size: $ams-typography-body-text-small-font-size;
37
37
  $ams-body-background-color: $ams-color-background-body;
38
- $ams-grid-padding-inline: $ams-space-xl;
38
+ $ams-grid-padding-inline: $ams-space-m;
39
+ $ams-grid-vi-medium-padding-inline: $ams-space-l;
40
+ $ams-grid-vi-wide-padding-inline: $ams-space-xl;
39
41
  $ams-grid-cell-background-color: $ams-color-background;
40
42
  $ams-grid-cell-padding-block: $ams-space-m;
41
43
  $ams-grid-cell-padding-inline: $ams-space-m;
@@ -37,7 +37,9 @@
37
37
  --ams-typography-heading-4-font-size: var(--ams-typography-body-text-font-size);
38
38
  --ams-typography-heading-5-font-size: var(--ams-typography-body-text-small-font-size);
39
39
  --ams-body-background-color: var(--ams-color-background-body);
40
- --ams-grid-padding-inline: var(--ams-space-xl);
40
+ --ams-grid-padding-inline: var(--ams-space-m);
41
+ --ams-grid-vi-medium-padding-inline: var(--ams-space-l);
42
+ --ams-grid-vi-wide-padding-inline: var(--ams-space-xl);
41
43
  --ams-grid-cell-background-color: var(--ams-color-background);
42
44
  --ams-grid-cell-padding-block: var(--ams-space-m);
43
45
  --ams-grid-cell-padding-inline: var(--ams-space-m);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.0",
2
+ "version": "4.0.1",
3
3
  "author": "Design System Team, City of Amsterdam <designsystem@amsterdam.nl>",
4
4
  "description": "All design tokens from the Amsterdam Design System. Use it to apply its visual design to your website or application.",
5
5
  "homepage": "https://designsystem.amsterdam",
@@ -30,6 +30,6 @@
30
30
  "scripts": {
31
31
  "clean": "rimraf dist/",
32
32
  "build": "node build.js",
33
- "build:watch": "chokidar --follow-symlinks --initial --command \"npm run build\" \"src/**/*.tokens.json\""
33
+ "build:watch": "chokidar --follow-symlinks --initial --command \"pnpm run build\" \"src/**/*.tokens.json\""
34
34
  }
35
35
  }
@@ -2,12 +2,30 @@
2
2
  "ams": {
3
3
  "grid": {
4
4
  "padding-inline": {
5
- "$value": "{ams.space.xl}",
5
+ "$value": "{ams.space.m}",
6
6
  "$extensions": {
7
7
  "nl.amsterdam.subtype": "space",
8
8
  "nl.amsterdam.type": "dimension"
9
9
  }
10
10
  },
11
+ "vi-medium": {
12
+ "padding-inline": {
13
+ "$value": "{ams.space.l}",
14
+ "$extensions": {
15
+ "nl.amsterdam.subtype": "space",
16
+ "nl.amsterdam.type": "dimension"
17
+ }
18
+ }
19
+ },
20
+ "vi-wide": {
21
+ "padding-inline": {
22
+ "$value": "{ams.space.xl}",
23
+ "$extensions": {
24
+ "nl.amsterdam.subtype": "space",
25
+ "nl.amsterdam.type": "dimension"
26
+ }
27
+ }
28
+ },
11
29
  "cell": {
12
30
  "background-color": {
13
31
  "$value": "{ams.color.background.default}",