@amsterdam/design-system-tokens 0.10.0 → 0.12.0

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 (64) hide show
  1. package/CHANGELOG.md +49 -13
  2. package/README.md +197 -1
  3. package/build.js +15 -14
  4. package/dist/compact.css +17 -13
  5. package/dist/compact.d.ts +10 -12
  6. package/dist/compact.json +12 -7
  7. package/dist/compact.mjs +13 -9
  8. package/dist/compact.scss +17 -13
  9. package/dist/compact.theme.css +17 -13
  10. package/dist/index.css +828 -770
  11. package/dist/index.d.ts +187 -85
  12. package/dist/index.json +349 -240
  13. package/dist/index.mjs +278 -220
  14. package/dist/index.scss +828 -770
  15. package/dist/index.theme.css +828 -770
  16. package/package.json +11 -5
  17. package/src/brand/ams/space.compact.tokens.json +5 -0
  18. package/src/brand/ams/space.tokens.json +10 -19
  19. package/src/brand/ams/text.compact.tokens.json +7 -7
  20. package/src/brand/ams/text.tokens.json +7 -7
  21. package/src/common/ams/link-appearance.tokens.json +18 -6
  22. package/src/components/ams/accordion.tokens.json +4 -4
  23. package/src/components/ams/action-group.tokens.json +7 -0
  24. package/src/components/ams/alert.tokens.json +6 -3
  25. package/src/components/ams/avatar.tokens.json +5 -2
  26. package/src/components/ams/badge.tokens.json +1 -1
  27. package/src/components/ams/breadcrumb.tokens.json +4 -1
  28. package/src/components/ams/breakout.tokens.json +11 -0
  29. package/src/components/ams/button.tokens.json +7 -3
  30. package/src/components/ams/card.tokens.json +4 -0
  31. package/src/components/ams/{form-field-character-counter.tokens.json → character-count.tokens.json} +1 -1
  32. package/src/components/ams/checkbox.tokens.json +1 -0
  33. package/src/components/ams/column.tokens.json +6 -5
  34. package/src/components/ams/date-input.tokens.json +2 -2
  35. package/src/components/ams/description-list.tokens.json +6 -6
  36. package/src/components/ams/dialog.tokens.json +7 -11
  37. package/src/components/ams/field-set.tokens.json +3 -7
  38. package/src/components/ams/field.tokens.json +3 -9
  39. package/src/components/ams/file-input.tokens.json +5 -5
  40. package/src/components/ams/form-error-list.tokens.json +7 -0
  41. package/src/components/ams/header.tokens.json +1 -1
  42. package/src/components/ams/hint.tokens.json +7 -0
  43. package/src/components/ams/icon-button.tokens.json +2 -2
  44. package/src/components/ams/image-slider.tokens.json +26 -0
  45. package/src/components/ams/link-list.tokens.json +8 -8
  46. package/src/components/ams/link.tokens.json +8 -8
  47. package/src/components/ams/mega-menu.tokens.json +1 -1
  48. package/src/components/ams/ordered-list.tokens.json +4 -1
  49. package/src/components/ams/page-menu.tokens.json +1 -1
  50. package/src/components/ams/pagination.tokens.json +2 -1
  51. package/src/components/ams/password-input.tokens.json +33 -0
  52. package/src/components/ams/radio.tokens.json +37 -35
  53. package/src/components/ams/row.tokens.json +6 -5
  54. package/src/components/ams/search-field.tokens.json +5 -7
  55. package/src/components/ams/select.tokens.json +3 -3
  56. package/src/components/ams/skip-link.tokens.json +2 -2
  57. package/src/components/ams/table-of-contents.tokens.json +4 -4
  58. package/src/components/ams/table.tokens.json +2 -2
  59. package/src/components/ams/tabs.tokens.json +3 -2
  60. package/src/components/ams/text-area.tokens.json +2 -2
  61. package/src/components/ams/text-input.tokens.json +2 -2
  62. package/src/components/ams/time-input.tokens.json +2 -2
  63. package/src/components/ams/top-task-link.tokens.json +1 -0
  64. package/src/components/ams/unordered-list.tokens.json +4 -1
package/CHANGELOG.md CHANGED
@@ -3,8 +3,56 @@
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
- ## [0.10.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.9.0...design-system-tokens-v0.10.0) (2024-06-28)
6
+ ## [0.12.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.11.0...design-system-tokens-v0.12.0) (2024-10-25)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * Support various column widths for Description List ([#1697](https://github.com/Amsterdam/design-system/issues/1697))
11
+ * Make terms bold instead of descriptions in Description List ([#1693](https://github.com/Amsterdam/design-system/issues/1693))
12
+ * Add Action Group component, e.g. to wrap Dialog buttons in ([#1592](https://github.com/Amsterdam/design-system/issues/1592))
13
+ * Use inline SVG icon for Radio button ([#1460](https://github.com/Amsterdam/design-system/issues/1460))
14
+ * Remove unnecessary Dialog wrapper ([#1591](https://github.com/Amsterdam/design-system/issues/1591))
15
+ * Remove form from Dialog ([#1582](https://github.com/Amsterdam/design-system/issues/1582))
16
+ * Replace ‘on background’ props with ‘inverseColor’ and ‘contrastColor’ for Link, Link List Link, and Icon Button ([#1448](https://github.com/Amsterdam/design-system/issues/1448))
17
+
18
+ ### Features
19
+
20
+ * Add Action Group component, e.g. to wrap Dialog buttons in ([#1592](https://github.com/Amsterdam/design-system/issues/1592)) ([d0ea054](https://github.com/Amsterdam/design-system/commit/d0ea054b98a7f2ee41bd9a8434b76a85e9b8c9f2))
21
+ * Add border to Avatar in forced colors mode ([#1578](https://github.com/Amsterdam/design-system/issues/1578)) ([1f29f35](https://github.com/Amsterdam/design-system/commit/1f29f358ab7b831c502e8fa2cbd284d1853ff6af))
22
+ * Add Breakout component that lets a figure stick out of a Spotlight ([#1397](https://github.com/Amsterdam/design-system/issues/1397)) ([715f4d6](https://github.com/Amsterdam/design-system/commit/715f4d6241353b9b9f1f68dad7b7773b9c618492))
23
+ * Add Hint as component and Label and FieldSet props ([#1499](https://github.com/Amsterdam/design-system/issues/1499)) ([3d86882](https://github.com/Amsterdam/design-system/commit/3d86882f22e4629a17a98cbbf96f03ad56620be9))
24
+ * Add initial Password Input component ([#1449](https://github.com/Amsterdam/design-system/issues/1449)) ([3cc863e](https://github.com/Amsterdam/design-system/commit/3cc863ec8f1f2b50f79a426fd41676ab05838768))
25
+ * Allow Button to display an icon without a label ([#1654](https://github.com/Amsterdam/design-system/issues/1654), [#1700](https://github.com/Amsterdam/design-system/issues/1700)) ([2d347b6](https://github.com/Amsterdam/design-system/commit/2d347b654b701cd6cce9182d5b6837960f41b551), [33c4c0e](https://github.com/Amsterdam/design-system/commit/33c4c0edefdf9c785bb828b0c61f0a120d697b02))
26
+ * Image slider ([#1595](https://github.com/Amsterdam/design-system/issues/1595)) ([58e7766](https://github.com/Amsterdam/design-system/commit/58e77661ad99acb5d3f6e10cbfca981345dc8704))
27
+ * Make terms bold instead of descriptions in Description List ([#1693](https://github.com/Amsterdam/design-system/issues/1693)) ([cc8f40e](https://github.com/Amsterdam/design-system/commit/cc8f40e631669a2f3423b7f55b8b129c025efcf9))
28
+ * Remove form from Dialog ([#1582](https://github.com/Amsterdam/design-system/issues/1582)) ([4fb6e53](https://github.com/Amsterdam/design-system/commit/4fb6e53441f3bae914eb483da2f0537a65273fd2))
29
+ * Remove unnecessary Dialog wrapper ([#1591](https://github.com/Amsterdam/design-system/issues/1591)) ([450b0c3](https://github.com/Amsterdam/design-system/commit/450b0c3e9adf5bdd9fb868400e17aaaea4b2c545))
30
+ * Replace ‘on background’ props with ‘inverseColor’ and ‘contrastColor’ for Link, Link List Link, and Icon Button ([#1448](https://github.com/Amsterdam/design-system/issues/1448)) ([f5176b1](https://github.com/Amsterdam/design-system/commit/f5176b1e2c85c166fa2b6cb67d11ce0b1f9727a3))
31
+ * Support various column widths for Description List ([#1697](https://github.com/Amsterdam/design-system/issues/1697)) ([5a98c07](https://github.com/Amsterdam/design-system/commit/5a98c07cad19eea38a2ff299378dc4dc5b80018c))
32
+ * Update spacing in Ordered and Unordered List ([#1632](https://github.com/Amsterdam/design-system/issues/1632)) ([986e023](https://github.com/Amsterdam/design-system/commit/986e023b83007560911724e819f54fb18c97f1dc))
33
+ * Use inline SVG icon for Radio button ([#1460](https://github.com/Amsterdam/design-system/issues/1460)) ([c19055b](https://github.com/Amsterdam/design-system/commit/c19055bd6453ce40ca43b31d599f14ec65d6037a))
34
+
35
+ ## [0.11.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.10.0...design-system-tokens-v0.11.0) (2024-07-25)
36
+
37
+ ### ⚠ BREAKING CHANGES
38
+
39
+ * Rename Form Field Character Counter to Character Count ([#1363](https://github.com/Amsterdam/design-system/issues/1363))
40
+ * Improve sizing behaviour of Dialog ([#1329](https://github.com/Amsterdam/design-system/issues/1329))
41
+ * Merge ‘stack’ and ‘inside’ space categories and update components ([#1267](https://github.com/Amsterdam/design-system/issues/1267))
42
+
43
+ ### Features
44
+
45
+ * Add focus on initial render to Form Error List ([#1328](https://github.com/Amsterdam/design-system/issues/1328)) ([09387b7](https://github.com/Amsterdam/design-system/commit/09387b7b7d5f03a7422910314de4ae4d0ccbb983))
46
+ * Apply default gap in Row and Column without extra class ([#1422](https://github.com/Amsterdam/design-system/issues/1422)) ([3af0b1f](https://github.com/Amsterdam/design-system/commit/3af0b1fb40ca941fd3966d08e6afe18995e6d02f))
47
+ * Decrease space length in Compact Mode ([#1307](https://github.com/Amsterdam/design-system/issues/1307)) ([27af2a6](https://github.com/Amsterdam/design-system/commit/27af2a62df5304bb5d80324b235463a4409071b5))
48
+ * Decrease text size in Compact Mode ([#1306](https://github.com/Amsterdam/design-system/issues/1306)) ([991efda](https://github.com/Amsterdam/design-system/commit/991efdafe7a19fa32049687a700ae7a5a2806f98))
49
+ * Improve sizing behaviour of Dialog ([#1329](https://github.com/Amsterdam/design-system/issues/1329)) ([a54d239](https://github.com/Amsterdam/design-system/commit/a54d239e2aff832bc15f8f90ea8880c02fa0d6ce))
50
+ * Merge ‘stack’ and ‘inside’ space categories and update components ([#1267](https://github.com/Amsterdam/design-system/issues/1267)) ([a0de626](https://github.com/Amsterdam/design-system/commit/a0de626d4fbdc9e0eac71492d544d35ad4dc8769))
51
+ * Remove fluidity from body text and spacing in Compact Mode ([#1389](https://github.com/Amsterdam/design-system/issues/1389)) ([050b063](https://github.com/Amsterdam/design-system/commit/050b063ba968d4c4657611293f3d3798f0fd02de))
52
+ * Rename Form Field Character Counter to Character Count ([#1363](https://github.com/Amsterdam/design-system/issues/1363)) ([a5299db](https://github.com/Amsterdam/design-system/commit/a5299dbfb3659bada5565893be63f615b511c0ee))
53
+ * Use flexbox and regular space in Column as we do in Row ([#1388](https://github.com/Amsterdam/design-system/issues/1388)) ([86d693c](https://github.com/Amsterdam/design-system/commit/86d693cf75be205cd096abe339cdd3f97e9b1a2f))
7
54
 
55
+ ## [0.10.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.9.0...design-system-tokens-v0.10.0) (2024-06-28)
8
56
 
9
57
  ### ⚠ BREAKING CHANGES
10
58
 
@@ -18,7 +66,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
18
66
 
19
67
  ## [0.9.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.8.0...design-system-tokens-v0.9.0) (2024-06-05)
20
68
 
21
-
22
69
  ### ⚠ BREAKING CHANGES
23
70
 
24
71
  * Disallow directional style rules ([#1245](https://github.com/Amsterdam/design-system/issues/1245))
@@ -42,7 +89,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
42
89
  * Use invalid prop for most inputs ([#1240](https://github.com/Amsterdam/design-system/issues/1240)) ([9477186](https://github.com/Amsterdam/design-system/commit/9477186b8432d6d20991e93d92c64a4357d6f391))
43
90
  * Use logical properties for Search Field, Select, Text Area and Text Input ([#1226](https://github.com/Amsterdam/design-system/issues/1226)) ([4471c7a](https://github.com/Amsterdam/design-system/commit/4471c7a154e9f1f31dd92298f932f4bbc134dbf9))
44
91
 
45
-
46
92
  ### Bug Fixes
47
93
 
48
94
  * Disallow directional style rules ([#1245](https://github.com/Amsterdam/design-system/issues/1245)) ([8ab6f81](https://github.com/Amsterdam/design-system/commit/8ab6f81d4cbcdb75b7acb986a145d49ccd1895c8))
@@ -50,7 +96,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
50
96
 
51
97
  ## [0.8.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.7.1...design-system-tokens-v0.8.0) (2024-04-22)
52
98
 
53
-
54
99
  ### ⚠ BREAKING CHANGES
55
100
 
56
101
  * Rename Form Label to Label ([#1201](https://github.com/Amsterdam/design-system/issues/1201))
@@ -70,27 +115,23 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
70
115
  * Time input component ([#1202](https://github.com/Amsterdam/design-system/issues/1202)) ([ccec68e](https://github.com/Amsterdam/design-system/commit/ccec68efafa02d5f9ac9bd4abea6c5e7cb72d556))
71
116
  * Use fluid gaps in Page Menu ([#1146](https://github.com/Amsterdam/design-system/issues/1146)) ([848223b](https://github.com/Amsterdam/design-system/commit/848223bed7c0ad95de9ce1911c7313104a938f5b))
72
117
 
73
-
74
118
  ### Bug Fixes
75
119
 
76
120
  * Use correct text size in Text Input, Search Field, and Text Area ([#1150](https://github.com/Amsterdam/design-system/issues/1150)) ([d5462e4](https://github.com/Amsterdam/design-system/commit/d5462e4537cfb39d62d0cd31564cfff086238330))
77
121
 
78
122
  ## [0.7.1](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.7.0...design-system-tokens-v0.7.1) (2024-03-22)
79
123
 
80
-
81
124
  ### Features
82
125
 
83
126
  * Add Avatar component ([#1134](https://github.com/Amsterdam/design-system/issues/1134)) ([8dec2cf](https://github.com/Amsterdam/design-system/commit/8dec2cff8f7885ccb163774c0dc979fb2c781256))
84
127
  * Add Form Field Character Counter ([#1114](https://github.com/Amsterdam/design-system/issues/1114)) ([779ae8c](https://github.com/Amsterdam/design-system/commit/779ae8c9764b23508ffbfb38c6dc2f7a7c1cbd28))
85
128
 
86
-
87
129
  ### Bug Fixes
88
130
 
89
131
  * Use semantic Heading for the title of a Dialog ([#1123](https://github.com/Amsterdam/design-system/issues/1123)) ([0493fd8](https://github.com/Amsterdam/design-system/commit/0493fd87587d36a83bb7aa9cbb69b8debf5d66f0))
90
132
 
91
133
  ## [0.7.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.6.1...design-system-tokens-v0.7.0) (2024-03-12)
92
134
 
93
-
94
135
  ### ⚠ BREAKING CHANGES
95
136
 
96
137
  * Shorten namespaces in theme and tokens ([#1125](https://github.com/Amsterdam/design-system/issues/1125))
@@ -101,7 +142,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
101
142
 
102
143
  ## [0.6.1](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.6.0...design-system-tokens-v0.6.1) (2024-03-11)
103
144
 
104
-
105
145
  ### Bug Fixes
106
146
 
107
147
  * Button fixes ([#1122](https://github.com/Amsterdam/design-system/issues/1122)) ([b5a9504](https://github.com/Amsterdam/design-system/commit/b5a950491f46710d92526ce6012f7d76992a569f))
@@ -109,7 +149,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
109
149
 
110
150
  ## [0.6.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.5.1...design-system-tokens-v0.6.0) (2024-03-08)
111
151
 
112
-
113
152
  ### ⚠ BREAKING CHANGES
114
153
 
115
154
  * Rename ‘header logo’ to ‘header logo link’ and add missing token for outline offset ([#1108](https://github.com/Amsterdam/design-system/issues/1108))
@@ -135,21 +174,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
135
174
  * Rename ‘header logo’ to ‘header logo link’ and add missing token for outline offset ([#1108](https://github.com/Amsterdam/design-system/issues/1108)) ([f87e834](https://github.com/Amsterdam/design-system/commit/f87e8345ec900ab08941d5d7ab40f8abd16a569a))
136
175
  * Use spacing tokens in Grid component ([#1089](https://github.com/Amsterdam/design-system/issues/1089)) ([b55f0a3](https://github.com/Amsterdam/design-system/commit/b55f0a3b64dcfb660a878ade75033a1dd835ac2d))
137
176
 
138
-
139
177
  ### Bug Fixes
140
178
 
141
179
  * Remove whitespace at the right end of dialog content ([#1091](https://github.com/Amsterdam/design-system/issues/1091)) ([23e1253](https://github.com/Amsterdam/design-system/commit/23e1253e38bba8ac85ebbd696af37742d1c1a02d))
142
180
 
143
181
  ## [0.5.1](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.5.0...design-system-tokens-v0.5.1) (2024-02-13)
144
182
 
145
-
146
183
  ### Features
147
184
 
148
185
  * Create unique token classes ([#1071](https://github.com/Amsterdam/design-system/issues/1071)) ([d53d0a9](https://github.com/Amsterdam/design-system/commit/d53d0a93f18238759d85bd897a7b6ee537cc78b0))
149
186
 
150
187
  ## [0.5.0](https://github.com/Amsterdam/design-system/compare/@amsterdam/design-system-tokens@0.4.0...design-system-tokens-v0.5.0) (2024-02-09)
151
188
 
152
-
153
189
  ### ⚠ BREAKING CHANGES
154
190
 
155
191
  * Add theme setup and compact theme ([#1067](https://github.com/Amsterdam/design-system/issues/1067))
package/README.md CHANGED
@@ -1,3 +1,199 @@
1
1
  <!-- @license CC0-1.0 -->
2
2
 
3
- # TODO: write readme
3
+ # Amsterdam Design System: Tokens
4
+
5
+ This package provides all design tokens from the [Amsterdam Design System](https://designsystem.amsterdam).
6
+ Use it to apply its visual design to your website or application.
7
+ The tokens are exported in multiple formats, including CSS custom properties and JSON, making them compatible with most, if not all, technology stacks.
8
+
9
+ ## Introduction
10
+
11
+ Every design token is a variable representing a single visual design choice.
12
+ Tokens exist for colours, various aspects of text, spacing lengths, border widths, the configuration of animations, and more.
13
+ The value of every token is valid in CSS.
14
+ All tokens together form a theme that encodes the entire branding of the City of Amsterdam.
15
+
16
+ ## Installation
17
+
18
+ Install this package by itself if you want or need to reference tokens directly in your stylesheets.
19
+
20
+ Note that our [CSS components](https://www.npmjs.com/package/@amsterdam/design-system-css) and [React components](https://www.npmjs.com/package/@amsterdam/design-system-react) provide more functionality and apply the tokens automatically.
21
+ You should use those packages if your application uses React or if it allows you to apply our HTML classes.
22
+
23
+ ```sh
24
+ npm install @amsterdam/design-system-tokens
25
+ ```
26
+
27
+ ## Usage in CSS
28
+
29
+ Tokens are typically used as custom properties in CSS.
30
+ Their name starts with a prefix of `--ams-`; that of a component token (see below) with the property that uses it, e.g. `-font-size`.
31
+
32
+ ### Main stylesheet
33
+
34
+ This package offers a main stylesheet containing all tokens.
35
+ They are declared as global CSS variables through the `:root` selector.
36
+
37
+ <!-- prettier-ignore -->
38
+ ```ts
39
+ import "@amsterdam/design-system-tokens/dist/index.css"
40
+ ```
41
+
42
+ If that doesn’t work for your project, use `index.theme.css` instead, which uses an `.ams-theme` selector.
43
+ Add that class to a root element of your application.
44
+
45
+ <!-- prettier-ignore -->
46
+ ```ts
47
+ import "@amsterdam/design-system-tokens/dist/index.theme.css"
48
+ ```
49
+
50
+ ```html
51
+ <body class="ams-theme">
52
+
53
+ </body>
54
+ ```
55
+
56
+ ### Compact mode
57
+
58
+ Our branding is rather spacious for websites.
59
+ The main stylesheet implements this ‘spacious mode’ as the default.
60
+ A compact stylesheet is available for applications that require less white space and smaller text.
61
+
62
+ Note that the compact stylesheet is not independent – it only contains overrides.
63
+ Import it after the main stylesheet for the correct result.
64
+
65
+ <!-- prettier-ignore -->
66
+ ```ts
67
+ import "@amsterdam/design-system-tokens/dist/index.css"
68
+ import "@amsterdam/design-system-tokens/dist/compact.css"
69
+ ```
70
+
71
+ ### Three layers
72
+
73
+ The tokens are organised in three layers: brand, common and component.
74
+
75
+ #### Brand tokens
76
+
77
+ These express the corporate identity of the City of Amsterdam.
78
+ They are our fundamental selection from all possible colours, text characteristics, spacing lengths, border widths, etc.
79
+ Examples:
80
+
81
+ ```css
82
+ :root {
83
+ --ams-color-primary-red: #ec0000;
84
+ --ams-space-md: 1rem;
85
+ --ams-proportion-wide: 4/3;
86
+ --ams-border-width-lg: 0.1875rem;
87
+ }
88
+ ```
89
+
90
+ Find the [list of brand tokens](https://github.com/Amsterdam/design-system/tree/main/proprietary/tokens/src/brand/ams) on GitHub.
91
+
92
+ #### Common tokens
93
+
94
+ Related components share visual design characteristics.
95
+ For example, all links have the same colour, and the borders of various form inputs are equally thick.
96
+ Common tokens express these relations and streamline future changes.
97
+
98
+ Design system components use common tokens where possible.
99
+ The same goes for custom components that you may create in your application.
100
+
101
+ ```html
102
+ <a class="my-link" href="#">…</a>
103
+ ```
104
+
105
+ ```css
106
+ .my-input {
107
+ color: var(--ams-link-appearance-color);
108
+ text-underline-offset: var(--ams-link-appearance-text-underline-offset);
109
+ }
110
+ ```
111
+
112
+ Find the [list of common tokens](https://github.com/Amsterdam/design-system/tree/main/proprietary/tokens/src/common/ams) on GitHub.
113
+
114
+ #### Component tokens
115
+
116
+ Every design system component defines a token for every property that expresses branding and uses it in its stylesheet.
117
+
118
+ Use these tokens when recreating an existing component to receive the correct values for them – now and in the future.
119
+ Do not apply these tokens to other components – components must be independent.
120
+
121
+ ```html
122
+ <button class="my-button" type="button">Button label</button>
123
+ ```
124
+
125
+ ```css
126
+ .my-button {
127
+ font-family: var(--ams-button-font-family);
128
+ background-color: var(--ams-button-primary-background-color);
129
+ }
130
+ ```
131
+
132
+ Find the [list of component tokens](https://github.com/Amsterdam/design-system/tree/main/proprietary/tokens/src/component/ams) on GitHub.
133
+
134
+ ### Overriding tokens
135
+
136
+ This package allows the creation of a theme to reuse our components for a different brand.
137
+ This is a key feature of [NL Design System](https://nldesignsystem.nl/) of which we are part.
138
+
139
+ However, websites and applications for the City of Amsterdam must follow the design system as closely as possible.
140
+ We repeat: websites and applications for the City of Amsterdam must follow the design system as closely as possible.
141
+
142
+ At the same time, we are aware that adopting a design system can pose challenges in practice.
143
+ If there is a good reason to (temporarily) adapt a component, do so by overriding the values of its appropriate tokens in a separate stylesheet.
144
+ Note that redefining the value of a token is a much better approach than redeclaring styles, adding class names or even inline styles.
145
+
146
+ ## Usage in Sass
147
+
148
+ The tokens can be imported as Sass variables as well.
149
+
150
+ ```sass
151
+ @import "@amsterdam/design-system-tokens/dist/index.scss"
152
+ ```
153
+
154
+ Import the compact tokens if you need them.
155
+ Sass will override spacious values automatically.
156
+
157
+ ```sass
158
+ @import "@amsterdam/design-system-tokens/dist/compact.scss"
159
+ ```
160
+
161
+ ## Usage in JavaScript
162
+
163
+ Import the JSON file to use the tokens in TypeScript or JavaScript.
164
+ Here, tokens start their name with a prefix of `ams.`.
165
+ Use ‘dot notation’ or square brackets to access the tokens.
166
+
167
+ <!-- prettier-ignore -->
168
+ ```ts
169
+ import tokens from "@amsterdam/design-system-tokens/dist/index.json"
170
+
171
+ const buttonBackgroundColor = tokens.ams.color["primary-blue"]
172
+ const rowGap = tokens.ams.space.md
173
+ ```
174
+
175
+ Import and merge the compact tokens if you need them.
176
+ Then you can use the tokens in scripting or css-in-js libraries.
177
+
178
+ <!-- prettier-ignore -->
179
+ ```ts
180
+ import spaciousTokens from "@amsterdam/design-system-tokens/dist/index.json"
181
+ import compactTokens from "@amsterdam/design-system-tokens/dist/compact.json"
182
+
183
+ const tokens = { ...spaciousTokens, ...compactTokens }
184
+ ```
185
+
186
+ ## Usage in Figma
187
+
188
+ The tokens are used in our [Figma Library](https://www.figma.com/file/9IGm6IdPUYizBNGsUnueBd/Amsterdam-Design-System?type=design&node-id=741-19633&mode=design&t=N8P3h3W67O0KNdga-0) as well.
189
+
190
+ ## Updating
191
+
192
+ We follow semantic versioning and publish a [change log](https://github.com/Amsterdam/design-system/blob/main/proprietary/tokens/CHANGELOG.md) to guide you through updates.
193
+ The tokens are a public API of the design system.
194
+ Note that detecting changed or deleted tokens is still a manual process.
195
+
196
+ ## Support
197
+
198
+ Contact us if you have a question, find an issue, or want to contribute.
199
+ Find ways to reach us on [designsystem.amsterdam](https://designsystem.amsterdam/?path=/docs/docs-introduction--docs#send-a-message).
package/build.js CHANGED
@@ -1,4 +1,4 @@
1
- const StyleDictionary = require('style-dictionary')
1
+ import StyleDictionary from 'style-dictionary'
2
2
 
3
3
  const modes = ['compact']
4
4
 
@@ -7,7 +7,7 @@ function generateSharedConfig(mode) {
7
7
 
8
8
  return {
9
9
  css: {
10
- transforms: ['attribute/cti', 'name/cti/kebab', 'color/hsl-4'],
10
+ transforms: ['attribute/cti', 'name/kebab', 'color/hsl-4'],
11
11
  transformGroup: 'css',
12
12
  buildPath: 'dist/',
13
13
  files: [
@@ -21,7 +21,7 @@ function generateSharedConfig(mode) {
21
21
  ],
22
22
  },
23
23
  cssTheme: {
24
- transforms: ['attribute/cti', 'name/cti/kebab', 'color/hsl-4'],
24
+ transforms: ['attribute/cti', 'name/kebab', 'color/hsl-4'],
25
25
  buildPath: 'dist/',
26
26
  files: [
27
27
  {
@@ -35,7 +35,7 @@ function generateSharedConfig(mode) {
35
35
  ],
36
36
  },
37
37
  js: {
38
- transforms: ['attribute/cti', 'name/cti/camel', 'color/hsl-4'],
38
+ transforms: ['attribute/cti', 'name/camel', 'color/hsl-4'],
39
39
  buildPath: 'dist/',
40
40
  files: [
41
41
  {
@@ -45,7 +45,7 @@ function generateSharedConfig(mode) {
45
45
  ],
46
46
  },
47
47
  json: {
48
- transforms: ['attribute/cti', 'name/cti/camel', 'color/hsl-4'],
48
+ transforms: ['attribute/cti', 'name/camel', 'color/hsl-4'],
49
49
  buildPath: 'dist/',
50
50
  files: [
51
51
  {
@@ -55,7 +55,7 @@ function generateSharedConfig(mode) {
55
55
  ],
56
56
  },
57
57
  scss: {
58
- transforms: ['attribute/cti', 'name/cti/kebab', 'color/hsl-4'],
58
+ transforms: ['attribute/cti', 'name/kebab', 'color/hsl-4'],
59
59
  buildPath: 'dist/',
60
60
  files: [
61
61
  {
@@ -68,7 +68,7 @@ function generateSharedConfig(mode) {
68
68
  ],
69
69
  },
70
70
  typescript: {
71
- transforms: ['attribute/cti', 'name/cti/camel', 'color/hsl-4'],
71
+ transforms: ['attribute/cti', 'name/camel', 'color/hsl-4'],
72
72
  transformGroup: 'js',
73
73
  buildPath: 'dist/',
74
74
  files: [
@@ -81,19 +81,20 @@ function generateSharedConfig(mode) {
81
81
  }
82
82
  }
83
83
 
84
- console.log('Building default mode...')
85
- StyleDictionary.extend({
84
+ const defaultMode = new StyleDictionary({
86
85
  source: [
87
86
  // exclude non-default modes from source
88
87
  `./src/**/!(*.${modes.join(`|*.`)}).tokens.json`,
89
88
  ],
90
89
  platforms: generateSharedConfig(),
91
- }).buildAllPlatforms()
90
+ })
91
+
92
+ defaultMode.buildAllPlatforms()
92
93
 
93
- modes.forEach((mode) => {
94
- console.log(`\n\nBuilding ${mode} mode...`)
95
- StyleDictionary.extend({
94
+ modes.map((mode) => {
95
+ const styleDictionary = new StyleDictionary({
96
96
  source: [`./src/**/*.${mode}.tokens.json`],
97
97
  platforms: generateSharedConfig(mode),
98
- }).buildAllPlatforms()
98
+ })
99
+ return styleDictionary.buildAllPlatforms()
99
100
  })
package/dist/compact.css CHANGED
@@ -1,20 +1,24 @@
1
1
  /**
2
- * Do not edit directly
3
- * Generated on Fri, 28 Jun 2024 12:13:40 GMT
2
+ * Do not edit directly, this file was auto-generated.
4
3
  */
5
4
 
6
5
  :root {
7
- --ams-text-level-6-font-size: clamp(0.75rem, calc(0.188vw + 0.713rem), 0.9rem);
8
- --ams-text-level-5-font-size: clamp(0.875rem, calc(0.313vw + 0.813rem), 1.125rem);
9
- --ams-text-level-4-font-size: clamp(1.021rem, calc(0.481vw + 0.925rem), 1.406rem);
10
- --ams-text-level-3-font-size: clamp(1.191rem, calc(0.709vw + 1.049rem), 1.758rem);
11
- --ams-text-level-2-font-size: clamp(1.389rem, calc(1.01vw + 1.187rem), 2.197rem);
12
- --ams-text-level-1-font-size: clamp(1.621rem, calc(1.408vw + 1.34rem), 2.747rem);
13
- --ams-text-level-0-font-size: clamp(1.891rem, calc(1.927vw + 1.506rem), 3.433rem);
14
- --ams-space-grid-xl: clamp(2rem, calc(3.125vw - 0.125rem), 5rem);
15
- --ams-space-grid-lg: clamp(1.5rem, calc(2.34375vw - 0.09375rem), 3.75rem);
16
- --ams-space-grid-md: clamp(1rem, calc(1.5625vw - 0.0625rem), 2.5rem); /* Grows from 16px at 1088px wide to 40px at 2624px wide. */
17
- --ams-space-grid-sm: clamp(0.5rem, calc(0.78125vw - 0.03125rem), 1.25rem);
6
+ --ams-space-xs: 0.25rem;
7
+ --ams-space-sm: 0.5rem;
8
+ --ams-space-md: 1rem;
9
+ --ams-space-lg: 1.5rem;
10
+ --ams-space-xl: 2rem;
18
11
  --ams-space-grid-xs: clamp(0.25rem, calc(0.390625vw - 0.015625rem), 0.625rem);
12
+ --ams-space-grid-sm: clamp(0.5rem, calc(0.78125vw - 0.03125rem), 1.25rem);
13
+ --ams-space-grid-md: clamp(1rem, calc(1.5625vw - 0.0625rem), 2.5rem); /* Grows from 16px at 1088px wide to 40px at 2624px wide. */
14
+ --ams-space-grid-lg: clamp(1.5rem, calc(2.34375vw - 0.09375rem), 3.75rem);
15
+ --ams-space-grid-xl: clamp(2rem, calc(3.125vw - 0.125rem), 5rem);
16
+ --ams-text-level-0-font-size: clamp(1.6105rem, calc(1.5626rem + 0.2394vw), 1.802rem);
17
+ --ams-text-level-1-font-size: clamp(1.4641rem, calc(1.4297rem + 0.1721vw), 1.6018rem);
18
+ --ams-text-level-2-font-size: clamp(1.331rem, calc(1.3078rem + 0.116vw), 1.4238rem);
19
+ --ams-text-level-3-font-size: clamp(1.21rem, calc(1.1961rem + 0.0695vw), 1.2656rem);
20
+ --ams-text-level-4-font-size: clamp(1.1rem, calc(1.0938rem + 0.0313vw), 1.125rem);
21
+ --ams-text-level-5-font-size: 1rem;
22
+ --ams-text-level-6-font-size: clamp(0.8889rem, calc(0.9141rem + -0.0253vw), 0.9091rem);
19
23
  --ams-grid-padding-inline: var(--ams-space-grid-md);
20
24
  }
package/dist/compact.d.ts CHANGED
@@ -1,29 +1,27 @@
1
1
  /**
2
- * Do not edit directly
3
- * Generated on Fri, 28 Jun 2024 12:13:40 GMT
2
+ * Do not edit directly, this file was auto-generated.
4
3
  */
5
4
 
6
5
  export default tokens;
7
6
 
8
7
  declare interface DesignToken {
9
- value: any;
10
- name?: string;
8
+ value?: any;
9
+ type?: string;
11
10
  comment?: string;
11
+ name?: string;
12
12
  themeable?: boolean;
13
- attributes?: {
14
- category?: string;
15
- type?: string;
16
- item?: string;
17
- subitem?: string;
18
- state?: string;
19
- [key: string]: any;
20
- };
13
+ attributes?: Record<string, unknown>;
21
14
  [key: string]: any;
22
15
  }
23
16
 
24
17
  declare const tokens: {
25
18
  "ams": {
26
19
  "space": {
20
+ "xs": DesignToken,
21
+ "sm": DesignToken,
22
+ "md": DesignToken,
23
+ "lg": DesignToken,
24
+ "xl": DesignToken,
27
25
  "grid": {
28
26
  "xs": DesignToken,
29
27
  "sm": DesignToken,
package/dist/compact.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "ams": {
3
3
  "space": {
4
+ "xs": "0.25rem",
5
+ "sm": "0.5rem",
6
+ "md": "1rem",
7
+ "lg": "1.5rem",
8
+ "xl": "2rem",
4
9
  "grid": {
5
10
  "xs": "clamp(0.25rem, calc(0.390625vw - 0.015625rem), 0.625rem)",
6
11
  "sm": "clamp(0.5rem, calc(0.78125vw - 0.03125rem), 1.25rem)",
@@ -12,25 +17,25 @@
12
17
  "text": {
13
18
  "level": {
14
19
  "0": {
15
- "font-size": "clamp(1.891rem, calc(1.927vw + 1.506rem), 3.433rem)"
20
+ "font-size": "clamp(1.6105rem, calc(1.5626rem + 0.2394vw), 1.802rem)"
16
21
  },
17
22
  "1": {
18
- "font-size": "clamp(1.621rem, calc(1.408vw + 1.34rem), 2.747rem)"
23
+ "font-size": "clamp(1.4641rem, calc(1.4297rem + 0.1721vw), 1.6018rem)"
19
24
  },
20
25
  "2": {
21
- "font-size": "clamp(1.389rem, calc(1.01vw + 1.187rem), 2.197rem)"
26
+ "font-size": "clamp(1.331rem, calc(1.3078rem + 0.116vw), 1.4238rem)"
22
27
  },
23
28
  "3": {
24
- "font-size": "clamp(1.191rem, calc(0.709vw + 1.049rem), 1.758rem)"
29
+ "font-size": "clamp(1.21rem, calc(1.1961rem + 0.0695vw), 1.2656rem)"
25
30
  },
26
31
  "4": {
27
- "font-size": "clamp(1.021rem, calc(0.481vw + 0.925rem), 1.406rem)"
32
+ "font-size": "clamp(1.1rem, calc(1.0938rem + 0.0313vw), 1.125rem)"
28
33
  },
29
34
  "5": {
30
- "font-size": "clamp(0.875rem, calc(0.313vw + 0.813rem), 1.125rem)"
35
+ "font-size": "1rem"
31
36
  },
32
37
  "6": {
33
- "font-size": "clamp(0.75rem, calc(0.188vw + 0.713rem), 0.9rem)"
38
+ "font-size": "clamp(0.8889rem, calc(0.9141rem + -0.0253vw), 0.9091rem)"
34
39
  }
35
40
  }
36
41
  },
package/dist/compact.mjs CHANGED
@@ -1,18 +1,22 @@
1
1
  /**
2
- * Do not edit directly
3
- * Generated on Fri, 28 Jun 2024 12:13:40 GMT
2
+ * Do not edit directly, this file was auto-generated.
4
3
  */
5
4
 
5
+ export const amsSpaceXs = "0.25rem";
6
+ export const amsSpaceSm = "0.5rem";
7
+ export const amsSpaceMd = "1rem";
8
+ export const amsSpaceLg = "1.5rem";
9
+ export const amsSpaceXl = "2rem";
6
10
  export const amsSpaceGridXs = "clamp(0.25rem, calc(0.390625vw - 0.015625rem), 0.625rem)";
7
11
  export const amsSpaceGridSm = "clamp(0.5rem, calc(0.78125vw - 0.03125rem), 1.25rem)";
8
12
  export const amsSpaceGridMd = "clamp(1rem, calc(1.5625vw - 0.0625rem), 2.5rem)"; // Grows from 16px at 1088px wide to 40px at 2624px wide.
9
13
  export const amsSpaceGridLg = "clamp(1.5rem, calc(2.34375vw - 0.09375rem), 3.75rem)";
10
14
  export const amsSpaceGridXl = "clamp(2rem, calc(3.125vw - 0.125rem), 5rem)";
11
- export const amsTextLevel0FontSize = "clamp(1.891rem, calc(1.927vw + 1.506rem), 3.433rem)";
12
- export const amsTextLevel1FontSize = "clamp(1.621rem, calc(1.408vw + 1.34rem), 2.747rem)";
13
- export const amsTextLevel2FontSize = "clamp(1.389rem, calc(1.01vw + 1.187rem), 2.197rem)";
14
- export const amsTextLevel3FontSize = "clamp(1.191rem, calc(0.709vw + 1.049rem), 1.758rem)";
15
- export const amsTextLevel4FontSize = "clamp(1.021rem, calc(0.481vw + 0.925rem), 1.406rem)";
16
- export const amsTextLevel5FontSize = "clamp(0.875rem, calc(0.313vw + 0.813rem), 1.125rem)";
17
- export const amsTextLevel6FontSize = "clamp(0.75rem, calc(0.188vw + 0.713rem), 0.9rem)";
15
+ export const amsTextLevel0FontSize = "clamp(1.6105rem, calc(1.5626rem + 0.2394vw), 1.802rem)";
16
+ export const amsTextLevel1FontSize = "clamp(1.4641rem, calc(1.4297rem + 0.1721vw), 1.6018rem)";
17
+ export const amsTextLevel2FontSize = "clamp(1.331rem, calc(1.3078rem + 0.116vw), 1.4238rem)";
18
+ export const amsTextLevel3FontSize = "clamp(1.21rem, calc(1.1961rem + 0.0695vw), 1.2656rem)";
19
+ export const amsTextLevel4FontSize = "clamp(1.1rem, calc(1.0938rem + 0.0313vw), 1.125rem)";
20
+ export const amsTextLevel5FontSize = "1rem";
21
+ export const amsTextLevel6FontSize = "clamp(0.8889rem, calc(0.9141rem + -0.0253vw), 0.9091rem)";
18
22
  export const amsGridPaddingInline = "clamp(1rem, calc(1.5625vw - 0.0625rem), 2.5rem)";
package/dist/compact.scss CHANGED
@@ -1,17 +1,21 @@
1
1
 
2
- // Do not edit directly
3
- // Generated on Fri, 28 Jun 2024 12:13:40 GMT
2
+ // Do not edit directly, this file was auto-generated.
4
3
 
5
- $ams-text-level-6-font-size: clamp(0.75rem, calc(0.188vw + 0.713rem), 0.9rem);
6
- $ams-text-level-5-font-size: clamp(0.875rem, calc(0.313vw + 0.813rem), 1.125rem);
7
- $ams-text-level-4-font-size: clamp(1.021rem, calc(0.481vw + 0.925rem), 1.406rem);
8
- $ams-text-level-3-font-size: clamp(1.191rem, calc(0.709vw + 1.049rem), 1.758rem);
9
- $ams-text-level-2-font-size: clamp(1.389rem, calc(1.01vw + 1.187rem), 2.197rem);
10
- $ams-text-level-1-font-size: clamp(1.621rem, calc(1.408vw + 1.34rem), 2.747rem);
11
- $ams-text-level-0-font-size: clamp(1.891rem, calc(1.927vw + 1.506rem), 3.433rem);
12
- $ams-space-grid-xl: clamp(2rem, calc(3.125vw - 0.125rem), 5rem);
13
- $ams-space-grid-lg: clamp(1.5rem, calc(2.34375vw - 0.09375rem), 3.75rem);
14
- $ams-space-grid-md: clamp(1rem, calc(1.5625vw - 0.0625rem), 2.5rem); // Grows from 16px at 1088px wide to 40px at 2624px wide.
15
- $ams-space-grid-sm: clamp(0.5rem, calc(0.78125vw - 0.03125rem), 1.25rem);
4
+ $ams-space-xs: 0.25rem;
5
+ $ams-space-sm: 0.5rem;
6
+ $ams-space-md: 1rem;
7
+ $ams-space-lg: 1.5rem;
8
+ $ams-space-xl: 2rem;
16
9
  $ams-space-grid-xs: clamp(0.25rem, calc(0.390625vw - 0.015625rem), 0.625rem);
10
+ $ams-space-grid-sm: clamp(0.5rem, calc(0.78125vw - 0.03125rem), 1.25rem);
11
+ $ams-space-grid-md: clamp(1rem, calc(1.5625vw - 0.0625rem), 2.5rem); // Grows from 16px at 1088px wide to 40px at 2624px wide.
12
+ $ams-space-grid-lg: clamp(1.5rem, calc(2.34375vw - 0.09375rem), 3.75rem);
13
+ $ams-space-grid-xl: clamp(2rem, calc(3.125vw - 0.125rem), 5rem);
14
+ $ams-text-level-0-font-size: clamp(1.6105rem, calc(1.5626rem + 0.2394vw), 1.802rem);
15
+ $ams-text-level-1-font-size: clamp(1.4641rem, calc(1.4297rem + 0.1721vw), 1.6018rem);
16
+ $ams-text-level-2-font-size: clamp(1.331rem, calc(1.3078rem + 0.116vw), 1.4238rem);
17
+ $ams-text-level-3-font-size: clamp(1.21rem, calc(1.1961rem + 0.0695vw), 1.2656rem);
18
+ $ams-text-level-4-font-size: clamp(1.1rem, calc(1.0938rem + 0.0313vw), 1.125rem);
19
+ $ams-text-level-5-font-size: 1rem;
20
+ $ams-text-level-6-font-size: clamp(0.8889rem, calc(0.9141rem + -0.0253vw), 0.9091rem);
17
21
  $ams-grid-padding-inline: $ams-space-grid-md;