@amsterdam/design-system-tokens 0.13.0 → 0.15.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 (95) hide show
  1. package/CHANGELOG.md +89 -1
  2. package/README.md +27 -14
  3. package/build.js +42 -13
  4. package/dist/compact.css +18 -18
  5. package/dist/compact.d.ts +44 -38
  6. package/dist/compact.json +21 -15
  7. package/dist/compact.mjs +27 -18
  8. package/dist/compact.scss +18 -18
  9. package/dist/compact.theme.css +18 -18
  10. package/dist/index.css +789 -744
  11. package/dist/index.d.ts +1544 -1473
  12. package/dist/index.json +687 -616
  13. package/dist/index.mjs +900 -636
  14. package/dist/index.scss +789 -744
  15. package/dist/index.theme.css +789 -744
  16. package/package.json +4 -3
  17. package/src/brand/ams/aspect-ratio.tokens.json +12 -0
  18. package/src/brand/ams/border.tokens.json +3 -3
  19. package/src/brand/ams/color.tokens.json +34 -15
  20. package/src/brand/ams/cursor.tokens.json +8 -0
  21. package/src/brand/ams/space.compact.tokens.json +6 -15
  22. package/src/brand/ams/space.tokens.json +5 -14
  23. package/src/brand/ams/{text.compact.tokens.json → typography.compact.tokens.json} +14 -2
  24. package/src/brand/ams/typography.tokens.json +59 -0
  25. package/src/common/ams/links.tokens.json +32 -0
  26. package/src/components/ams/accordion.tokens.json +11 -12
  27. package/src/components/ams/action-group.tokens.json +1 -1
  28. package/src/components/ams/alert.tokens.json +26 -19
  29. package/src/components/ams/avatar.tokens.json +23 -53
  30. package/src/components/ams/badge.tokens.json +22 -48
  31. package/src/components/ams/blockquote.tokens.json +8 -6
  32. package/src/components/ams/breadcrumb.tokens.json +10 -10
  33. package/src/components/ams/button.tokens.json +31 -33
  34. package/src/components/ams/card.tokens.json +8 -8
  35. package/src/components/ams/character-count.tokens.json +6 -6
  36. package/src/components/ams/checkbox.tokens.json +31 -29
  37. package/src/components/ams/column.tokens.json +5 -6
  38. package/src/components/ams/date-input.tokens.json +18 -16
  39. package/src/components/ams/description-list.tokens.json +21 -10
  40. package/src/components/ams/dialog.tokens.json +19 -8
  41. package/src/components/ams/error-message.tokens.json +6 -5
  42. package/src/components/ams/field-set.tokens.json +8 -8
  43. package/src/components/ams/field.tokens.json +3 -3
  44. package/src/components/ams/figure.tokens.json +17 -0
  45. package/src/components/ams/file-input.tokens.json +29 -26
  46. package/src/components/ams/file-list.tokens.json +21 -0
  47. package/src/components/ams/footer.tokens.json +30 -0
  48. package/src/components/ams/grid.compact.tokens.json +1 -1
  49. package/src/components/ams/grid.tokens.json +12 -10
  50. package/src/components/ams/header.tokens.json +50 -4
  51. package/src/components/ams/heading.tokens.json +29 -29
  52. package/src/components/ams/hint.tokens.json +1 -1
  53. package/src/components/ams/icon-button.tokens.json +18 -16
  54. package/src/components/ams/icon.tokens.json +25 -12
  55. package/src/components/ams/image-slider.tokens.json +1 -1
  56. package/src/components/ams/image.tokens.json +7 -0
  57. package/src/components/ams/{form-error-list.tokens.json → invalid-form-alert.tokens.json} +1 -1
  58. package/src/components/ams/label.tokens.json +5 -5
  59. package/src/components/ams/link-list.tokens.json +22 -22
  60. package/src/components/ams/link.tokens.json +20 -31
  61. package/src/components/ams/logo.tokens.json +11 -4
  62. package/src/components/ams/mark.tokens.json +1 -1
  63. package/src/components/ams/mega-menu.tokens.json +3 -3
  64. package/src/components/ams/ordered-list.tokens.json +13 -11
  65. package/src/components/ams/page-heading.tokens.json +8 -6
  66. package/src/components/ams/page-menu.tokens.json +13 -13
  67. package/src/components/ams/pagination.tokens.json +13 -13
  68. package/src/components/ams/paragraph.tokens.json +12 -10
  69. package/src/components/ams/password-input.tokens.json +17 -16
  70. package/src/components/ams/radio.tokens.json +40 -25
  71. package/src/components/ams/row.tokens.json +5 -6
  72. package/src/components/ams/screen.tokens.json +1 -1
  73. package/src/components/ams/search-field.tokens.json +17 -28
  74. package/src/components/ams/select.tokens.json +17 -16
  75. package/src/components/ams/skip-link.tokens.json +9 -9
  76. package/src/components/ams/spotlight.tokens.json +10 -15
  77. package/src/components/ams/switch.tokens.json +7 -6
  78. package/src/components/ams/table-of-contents.tokens.json +17 -17
  79. package/src/components/ams/table.tokens.json +10 -10
  80. package/src/components/ams/tabs.tokens.json +16 -17
  81. package/src/components/ams/text-area.tokens.json +18 -18
  82. package/src/components/ams/text-input.tokens.json +17 -16
  83. package/src/components/ams/time-input.tokens.json +18 -16
  84. package/src/components/ams/top-task-link.tokens.json +16 -16
  85. package/src/components/ams/unordered-list.tokens.json +15 -13
  86. package/src/brand/ams/proportion.tokens.json +0 -12
  87. package/src/brand/ams/text.tokens.json +0 -41
  88. package/src/common/ams/action.tokens.json +0 -12
  89. package/src/common/ams/hyphenation.tokens.json +0 -9
  90. package/src/common/ams/link-appearance.tokens.json +0 -43
  91. package/src/components/ams/aspect-ratio.tokens.json +0 -12
  92. package/src/components/ams/breakout.tokens.json +0 -11
  93. package/src/components/ams/gap.tokens.json +0 -11
  94. package/src/components/ams/margin.tokens.json +0 -11
  95. /package/src/{common → brand}/ams/focus.tokens.json +0 -0
package/CHANGELOG.md CHANGED
@@ -3,8 +3,96 @@
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.13.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.12.0...design-system-tokens-v0.13.0) (2024-10-28)
6
+ ## [0.15.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.14.0...design-system-tokens-v0.15.0) (2025-03-28)
7
+
8
+
9
+ ### ⚠ BREAKING CHANGES
10
+
11
+ * Shorten size labels in prop values for Row and Column, tokens and utility classes ([#1940](https://github.com/Amsterdam/design-system/issues/1940), [#1951](https://github.com/Amsterdam/design-system/issues/1951))
12
+ * Shorten size labels in border tokens ([#1941](https://github.com/Amsterdam/design-system/issues/1941))
13
+ * Consolidate Grid Space and Component Space into one set of spacing tokens ([#1910](https://github.com/Amsterdam/design-system/issues/1910))
14
+ * **Tabs:** Remove unnecessary token, reuse color value ([#1932](https://github.com/Amsterdam/design-system/issues/1932))
15
+ * Update aspect ratio tokens and CSS utility classes ([#1913](https://github.com/Amsterdam/design-system/issues/1913))
16
+ * Update and document focus tokens ([#1919](https://github.com/Amsterdam/design-system/issues/1919))
17
+ * Update hyphenation tokens ([#1914](https://github.com/Amsterdam/design-system/issues/1914))
18
+ * **Header:** Add responsive version of Amsterdam Logo, remove Heading level 1 ([#1880](https://github.com/Amsterdam/design-system/issues/1880))
19
+ * Split typography tokens into ‘body text’ and ‘heading’ groups ([#1890](https://github.com/Amsterdam/design-system/issues/1890))
20
+ * **Dialog:** Prevent a focus indicator from being cut off ([#1879](https://github.com/Amsterdam/design-system/issues/1879))
21
+ * **Footer:** add FooterMenu component to replace PageMenu in Footer ([#1871](https://github.com/Amsterdam/design-system/issues/1871))
22
+ * Rename and document common tokens for links ([#1870](https://github.com/Amsterdam/design-system/issues/1870))
23
+ * **Avatar:** Use updated color names for azure, lime and green ([#1867](https://github.com/Amsterdam/design-system/issues/1867))
24
+ * **Badge:** Use updated color names for azure and lime ([#1866](https://github.com/Amsterdam/design-system/issues/1866))
25
+ * **Spotlight:** Use updated color names for lime and green and remove purple as an explicit option ([#1865](https://github.com/Amsterdam/design-system/issues/1865))
26
+ * Remove action tokens, add and implement cursor tokens ([#1860](https://github.com/Amsterdam/design-system/issues/1860))
27
+ * Combine contrast and inverse color options into a single prop ([#1822](https://github.com/Amsterdam/design-system/issues/1822))
28
+ * Change all brand colour tokens to use semantic names ([#1820](https://github.com/Amsterdam/design-system/issues/1820))
29
+ * Rename Form Error List to Invalid Form Alert ([#1835](https://github.com/Amsterdam/design-system/issues/1835))
30
+ * **Pagination:** Use links instead of buttons ([#1821](https://github.com/Amsterdam/design-system/issues/1821))
31
+ * **Badge:** Remove some colour options ([#1826](https://github.com/Amsterdam/design-system/issues/1826))
32
+ * **Avatar:** Remove some colour options and make purple the default ([#1825](https://github.com/Amsterdam/design-system/issues/1825))
33
+ * Move alert icon into thick left border ([#1792](https://github.com/Amsterdam/design-system/issues/1792))
34
+
35
+ ### Features
36
+
37
+ * **Accordion:** Increase text size for Heading to level 4 ([#1837](https://github.com/Amsterdam/design-system/issues/1837)) ([1e914c9](https://github.com/Amsterdam/design-system/commit/1e914c9efd9087a0855e3f03661b46f6b228740a))
38
+ * **Avatar:** Remove some colour options and make purple the default ([#1825](https://github.com/Amsterdam/design-system/issues/1825)) ([52d8c64](https://github.com/Amsterdam/design-system/commit/52d8c64f653309cce34e222d250f56c7265078e0))
39
+ * **Avatar:** Use updated color names for azure, lime and green ([#1867](https://github.com/Amsterdam/design-system/issues/1867)) ([e8a2638](https://github.com/Amsterdam/design-system/commit/e8a2638882b95141c5e5e345bb7656f1f9968253))
40
+ * **Badge:** Remove some colour options ([#1826](https://github.com/Amsterdam/design-system/issues/1826)) ([1325e1b](https://github.com/Amsterdam/design-system/commit/1325e1b213e4704fd738dada1a92b5362a1a5174))
41
+ * **Badge:** Use updated color names for azure and lime ([#1866](https://github.com/Amsterdam/design-system/issues/1866)) ([fd25778](https://github.com/Amsterdam/design-system/commit/fd25778db56eeeecf2e716a72d25b91c49193fa1))
42
+ * Change all brand colour tokens to use semantic names ([#1820](https://github.com/Amsterdam/design-system/issues/1820)) ([778222b](https://github.com/Amsterdam/design-system/commit/778222b5f7176648c647315287f2e2ceff3de491))
43
+ * Combine contrast and inverse color options into a single prop ([#1822](https://github.com/Amsterdam/design-system/issues/1822)) ([51640be](https://github.com/Amsterdam/design-system/commit/51640bed21deee54d5dddcbaa22e2213155cd08a))
44
+ * Consolidate Grid Space and Component Space into one set of spacing tokens ([#1910](https://github.com/Amsterdam/design-system/issues/1910)) ([f36e985](https://github.com/Amsterdam/design-system/commit/f36e9855c78f582df95fa0906f0849c2832c25a3))
45
+ * **Description List:** Rename values for terms column widths ([#1942](https://github.com/Amsterdam/design-system/issues/1942)) ([e1a9669](https://github.com/Amsterdam/design-system/commit/e1a9669925927f1608433a4ae68676b925ba8bd2))
46
+ * **Dialog:** Change background colour of backdrop and add token for it ([#1876](https://github.com/Amsterdam/design-system/issues/1876)) ([d071bb4](https://github.com/Amsterdam/design-system/commit/d071bb4149d2789d967abcdb84ccdfa4d5b7aecc))
47
+ * **Footer:** add FooterMenu component to replace PageMenu in Footer ([#1871](https://github.com/Amsterdam/design-system/issues/1871)) ([85e0f0f](https://github.com/Amsterdam/design-system/commit/85e0f0f8c7fd9c281ba68155999e835921e4443d))
48
+ * **Header:** Add responsive version of Amsterdam Logo, remove Heading level 1 ([#1880](https://github.com/Amsterdam/design-system/issues/1880)) ([7de8138](https://github.com/Amsterdam/design-system/commit/7de813861a565da89fee246731dc1525bc5d2643))
49
+ * Move alert icon into thick left border ([#1792](https://github.com/Amsterdam/design-system/issues/1792)) ([ec53af7](https://github.com/Amsterdam/design-system/commit/ec53af73d05f22f5e077efdf3ce9a73ed4d7e235))
50
+ * **Pagination:** Use links instead of buttons ([#1821](https://github.com/Amsterdam/design-system/issues/1821)) ([6980251](https://github.com/Amsterdam/design-system/commit/698025132af2c0b944e9cc99f9754b065127fb68))
51
+ * Remove action tokens, add and implement cursor tokens ([#1860](https://github.com/Amsterdam/design-system/issues/1860)) ([40a04a8](https://github.com/Amsterdam/design-system/commit/40a04a88e8c5829df54eb3a6ca338557249aec5d))
52
+ * Rename and document common tokens for links ([#1870](https://github.com/Amsterdam/design-system/issues/1870)) ([551743d](https://github.com/Amsterdam/design-system/commit/551743d11436ff2363f8dd1187afe166e6c4a02b))
53
+ * Rename Form Error List to Invalid Form Alert ([#1835](https://github.com/Amsterdam/design-system/issues/1835)) ([e8d015a](https://github.com/Amsterdam/design-system/commit/e8d015ae6a1e785a29505c033f29cd67aaab3d66))
54
+ * Shorten size labels in border tokens ([#1941](https://github.com/Amsterdam/design-system/issues/1941)) ([fa154a6](https://github.com/Amsterdam/design-system/commit/fa154a6c96a11a43623f959a51f782abae27449e))
55
+ * Shorten size labels in prop values for Row and Column, space tokens and utility classes ([#1940](https://github.com/Amsterdam/design-system/issues/1940)) ([694987c](https://github.com/Amsterdam/design-system/commit/694987c88773983e4cd12d518cc957d34ec29d7e))
56
+ * Split typography tokens into ‘body text’ and ‘heading’ groups ([#1890](https://github.com/Amsterdam/design-system/issues/1890)) ([3126aa2](https://github.com/Amsterdam/design-system/commit/3126aa29d5aebccfca272892d55f140783a94d43))
57
+ * **Spotlight:** Use updated color names for lime and green and remove purple as an explicit option ([#1865](https://github.com/Amsterdam/design-system/issues/1865)) ([387ae45](https://github.com/Amsterdam/design-system/commit/387ae45ce263ae3b6a12fc9a3b22a37dc0aed997))
58
+ * **typography:** Improve line heights for all body text and headings ([#1894](https://github.com/Amsterdam/design-system/issues/1894)) ([8a57198](https://github.com/Amsterdam/design-system/commit/8a571988a8f11fb5aa1dfe550ca8b74e9d8b3e55))
59
+ * Update and document focus tokens ([#1919](https://github.com/Amsterdam/design-system/issues/1919)) ([4c85170](https://github.com/Amsterdam/design-system/commit/4c85170f2b8eec5ce956cecdbb41430ce2c37639))
60
+ * Update aspect ratio tokens and CSS utility classes ([#1913](https://github.com/Amsterdam/design-system/issues/1913)) ([968ef2b](https://github.com/Amsterdam/design-system/commit/968ef2bf053803c356e36424836fd9934da123fd))
61
+ * Update hyphenation tokens ([#1914](https://github.com/Amsterdam/design-system/issues/1914)) ([0c7f359](https://github.com/Amsterdam/design-system/commit/0c7f359ff094e281022441d171bd617047c660b2))
62
+
63
+
64
+ ### Bug Fixes
65
+
66
+ * **Column, Row:** Do not use utility classes ([#1951](https://github.com/Amsterdam/design-system/issues/1951)) ([a5a74f8](https://github.com/Amsterdam/design-system/commit/a5a74f8bbb55ab54c7b179be29d4a804b088044a))
67
+ * **Dialog:** Prevent a focus indicator from being cut off ([#1879](https://github.com/Amsterdam/design-system/issues/1879)) ([336ff55](https://github.com/Amsterdam/design-system/commit/336ff554d2a4a213c1f62bd32b02219ca41a802c))
68
+ * **Dialog:** Update Dialog border to fix forced color mode ([#1893](https://github.com/Amsterdam/design-system/issues/1893)) ([8b83271](https://github.com/Amsterdam/design-system/commit/8b83271a06dbdef42600d82e92cd56f1ec7d5509))
69
+ * **Tabs:** Remove unnecessary token, reuse color value ([#1932](https://github.com/Amsterdam/design-system/issues/1932)) ([cabfd59](https://github.com/Amsterdam/design-system/commit/cabfd5967a9c0cb17ab0bac627f19261f29bcf2e))
70
+
71
+ ## [0.14.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.13.0...design-system-tokens-v0.14.0) (2025-01-10)
72
+
73
+ ### ⚠ BREAKING CHANGES
7
74
 
75
+ * Add collapsible menu to Header ([#1784](https://github.com/Amsterdam/design-system/issues/1784))
76
+ * Disallow blue Spotlight and make purple the default ([#1798](https://github.com/Amsterdam/design-system/issues/1798))
77
+ * Make active Tab look less like a primary Button ([#1773](https://github.com/Amsterdam/design-system/issues/1773))
78
+ * Replace Aspect Ratio component with utility classes and prop on Image ([#1593](https://github.com/Amsterdam/design-system/issues/1593))
79
+ * Use new Button features for SearchField ([#1695](https://github.com/Amsterdam/design-system/issues/1695))
80
+
81
+ ### Features
82
+
83
+ * Add collapsible menu to Header ([#1784](https://github.com/Amsterdam/design-system/issues/1784)) ([44ce6d8](https://github.com/Amsterdam/design-system/commit/44ce6d8ac5a3fc48fd7de258c48fbafdd9928b9f))
84
+ * Add Figure component ([#1795](https://github.com/Amsterdam/design-system/issues/1795)) ([3505dcc](https://github.com/Amsterdam/design-system/commit/3505dcca183551dce318046f54ad4570cc6e6d2b))
85
+ * Add File List component to display below a File Input ([#1751](https://github.com/Amsterdam/design-system/issues/1751)) ([0192404](https://github.com/Amsterdam/design-system/commit/01924048c53805eb1536d2aa9b5454bcd44375b8))
86
+ * Add Icon to Error Message ([#1746](https://github.com/Amsterdam/design-system/issues/1746)) ([eca5fe4](https://github.com/Amsterdam/design-system/commit/eca5fe4ed0325b01860f816c70247c26e2158f9c))
87
+ * Allow an icon to display with an inverse color ([#1787](https://github.com/Amsterdam/design-system/issues/1787)) ([1f5d166](https://github.com/Amsterdam/design-system/commit/1f5d16697a1b332b6c1bbd830cda1220010a78d6))
88
+ * Disallow blue Spotlight and make purple the default ([#1798](https://github.com/Amsterdam/design-system/issues/1798)) ([8d1c266](https://github.com/Amsterdam/design-system/commit/8d1c266f3f7e90b02bcb240c41256578a80c7668))
89
+ * Let Footer set its own background colour ([#1797](https://github.com/Amsterdam/design-system/issues/1797)) ([310f595](https://github.com/Amsterdam/design-system/commit/310f59553a9ad057f3fe80b23bfda5acf108906d))
90
+ * Make active Tab look less like a primary Button ([#1773](https://github.com/Amsterdam/design-system/issues/1773)) ([2ec0102](https://github.com/Amsterdam/design-system/commit/2ec010286dd64ecebefa040a0ab18cf192542d0f))
91
+ * Make border of Radio thicker when hovering ([#1696](https://github.com/Amsterdam/design-system/issues/1696)) ([8839012](https://github.com/Amsterdam/design-system/commit/88390124aa5197f6c784dae4fc2a7c3e18d75ca6))
92
+ * Replace Aspect Ratio component with utility classes and prop on Image ([#1593](https://github.com/Amsterdam/design-system/issues/1593)) ([766efba](https://github.com/Amsterdam/design-system/commit/766efbac45e8831a19f3e99bd9d0550028d8d4fd))
93
+ * Use new Button features for SearchField ([#1695](https://github.com/Amsterdam/design-system/issues/1695)) ([7b275d0](https://github.com/Amsterdam/design-system/commit/7b275d0c803b309095ba7c425bb6bf04630775a9))
94
+
95
+ ## [0.13.0](https://github.com/Amsterdam/design-system/compare/design-system-tokens-v0.12.0...design-system-tokens-v0.13.0) (2024-10-28)
8
96
 
9
97
  ### ⚠ BREAKING CHANGES
10
98
 
package/README.md CHANGED
@@ -80,15 +80,22 @@ Examples:
80
80
 
81
81
  ```css
82
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;
83
+ --ams-color-feedback-error: #ec0000;
84
+ --ams-space-m: 1rem;
85
+ --ams-aspect-ratio-wide: 4/3;
86
+ --ams-border-width-l: 0.1875rem;
87
87
  }
88
88
  ```
89
89
 
90
90
  Find the [list of brand tokens](https://github.com/Amsterdam/design-system/tree/main/proprietary/tokens/src/brand/ams) on GitHub.
91
91
 
92
+ ##### Removing ‘default’ keys
93
+
94
+ Some brand tokens include a ‘default’ key in JSON to allow for additional variants, such as `ams.color.interactive.default` and `ams.color.interactive.disabled`
95
+ However, this key is not needed for collections of variables that are flat, like our CSS custom properties.
96
+ Therefore, we remove this key in non-nested variables.
97
+ For instance, `--ams-color-interactive` and `--ams-color-interactive-disabled`.
98
+
92
99
  #### Common tokens
93
100
 
94
101
  Related components share visual design characteristics.
@@ -104,8 +111,8 @@ The same goes for custom components that you may create in your application.
104
111
 
105
112
  ```css
106
113
  .my-input {
107
- color: var(--ams-link-appearance-color);
108
- text-underline-offset: var(--ams-link-appearance-text-underline-offset);
114
+ color: var(--ams-links-color);
115
+ text-underline-offset: var(--ams-links-text-underline-offset);
109
116
  }
110
117
  ```
111
118
 
@@ -146,16 +153,22 @@ Note that redefining the value of a token is a much better approach than redecla
146
153
  ## Usage in Sass
147
154
 
148
155
  The tokens can be imported as Sass variables as well.
156
+ As they are already prefixed, the namespace that Sass would assign isn’t necessary.
149
157
 
150
158
  ```sass
151
- @import "@amsterdam/design-system-tokens/dist/index.scss"
159
+ @use "@amsterdam/design-system-tokens/dist/index.scss" as *;
152
160
  ```
153
161
 
154
- Import the compact tokens if you need them.
155
- Sass will override spacious values automatically.
162
+ Import the compact tokens if needed.
163
+ Note that Sass doesn't allow importing them alongside the default set due to naming conflicts.
164
+ Address these tokens through the `compact` namespace and do not use the spacious tokens they replace.
156
165
 
157
166
  ```sass
158
- @import "@amsterdam/design-system-tokens/dist/compact.scss"
167
+ @use "@amsterdam/design-system-tokens/dist/compact.scss";
168
+
169
+ .class {
170
+ padding-block: compact.$ams-space-m;
171
+ }
159
172
  ```
160
173
 
161
174
  ## Usage in JavaScript
@@ -165,20 +178,20 @@ Here, tokens start their name with a prefix of `ams.`.
165
178
  Use ‘dot notation’ or square brackets to access the tokens.
166
179
 
167
180
  <!-- prettier-ignore -->
168
- ```ts
181
+ ```tsx
169
182
  import tokens from "@amsterdam/design-system-tokens/dist/index.json"
170
183
 
171
184
  const buttonBackgroundColor = tokens.ams.color["primary-blue"]
172
- const rowGap = tokens.ams.space.md
185
+ const rowGap = tokens.ams.space.m
173
186
  ```
174
187
 
175
188
  Import and merge the compact tokens if you need them.
176
189
  Then you can use the tokens in scripting or css-in-js libraries.
177
190
 
178
191
  <!-- prettier-ignore -->
179
- ```ts
180
- import spaciousTokens from "@amsterdam/design-system-tokens/dist/index.json"
192
+ ```tsx
181
193
  import compactTokens from "@amsterdam/design-system-tokens/dist/compact.json"
194
+ import spaciousTokens from "@amsterdam/design-system-tokens/dist/index.json"
182
195
 
183
196
  const tokens = { ...spaciousTokens, ...compactTokens }
184
197
  ```
package/build.js CHANGED
@@ -1,4 +1,30 @@
1
+ import { camelCase, kebabCase } from 'change-case'
1
2
  import StyleDictionary from 'style-dictionary'
3
+ import { transformTypes } from 'style-dictionary/enums'
4
+
5
+ // Remove last key if it is 'default' when transforming to kebab-case
6
+ // i.e. `ams.color.default` becomes `--ams-color`
7
+ StyleDictionary.registerTransform({
8
+ name: 'name/customKebab',
9
+ transform: function (token) {
10
+ const filteredPath = token.path[token.path.length - 1] === 'default' ? token.path.slice(0, -1) : token.path
11
+
12
+ return kebabCase(filteredPath.join(' '))
13
+ },
14
+ type: transformTypes.name,
15
+ })
16
+
17
+ // Remove last key if it is 'default' when transforming to camelCase
18
+ // i.e. `ams.color.default` becomes `amsColor`
19
+ StyleDictionary.registerTransform({
20
+ name: 'name/customCamel',
21
+ transform: function (token) {
22
+ const filteredPath = token.path[token.path.length - 1] === 'default' ? token.path.slice(0, -1) : token.path
23
+
24
+ return camelCase(filteredPath.join(' '))
25
+ },
26
+ type: transformTypes.name,
27
+ })
2
28
 
3
29
  const modes = ['compact']
4
30
 
@@ -7,8 +33,6 @@ function generateSharedConfig(mode) {
7
33
 
8
34
  return {
9
35
  css: {
10
- transforms: ['attribute/cti', 'name/kebab', 'color/hsl-4'],
11
- transformGroup: 'css',
12
36
  buildPath: 'dist/',
13
37
  files: [
14
38
  {
@@ -19,33 +43,34 @@ function generateSharedConfig(mode) {
19
43
  },
20
44
  },
21
45
  ],
46
+ transformGroup: 'css',
47
+ transforms: ['attribute/cti', 'name/customKebab', 'color/hsl-4'],
22
48
  },
23
49
  cssTheme: {
24
- transforms: ['attribute/cti', 'name/kebab', 'color/hsl-4'],
25
50
  buildPath: 'dist/',
26
51
  files: [
27
52
  {
28
53
  destination: `${name}.theme.css`,
29
54
  format: 'css/variables',
30
55
  options: {
31
- selector: `.ams-theme${name === 'index' ? '' : `--${name}`}`,
32
56
  outputReferences: true,
57
+ selector: `.ams-theme${name === 'index' ? '' : `--${name}`}`,
33
58
  },
34
59
  },
35
60
  ],
61
+ transforms: ['attribute/cti', 'name/customKebab', 'color/hsl-4'],
36
62
  },
37
63
  js: {
38
- transforms: ['attribute/cti', 'name/camel', 'color/hsl-4'],
39
64
  buildPath: 'dist/',
40
65
  files: [
41
66
  {
42
- format: 'javascript/es6',
43
67
  destination: `${name}.mjs`,
68
+ format: 'javascript/es6',
44
69
  },
45
70
  ],
71
+ transforms: ['attribute/cti', 'name/customCamel', 'color/hsl-4'],
46
72
  },
47
73
  json: {
48
- transforms: ['attribute/cti', 'name/camel', 'color/hsl-4'],
49
74
  buildPath: 'dist/',
50
75
  files: [
51
76
  {
@@ -53,9 +78,9 @@ function generateSharedConfig(mode) {
53
78
  format: 'json/nested',
54
79
  },
55
80
  ],
81
+ transforms: ['attribute/cti', 'name/camel', 'color/hsl-4'],
56
82
  },
57
83
  scss: {
58
- transforms: ['attribute/cti', 'name/kebab', 'color/hsl-4'],
59
84
  buildPath: 'dist/',
60
85
  files: [
61
86
  {
@@ -66,35 +91,39 @@ function generateSharedConfig(mode) {
66
91
  },
67
92
  },
68
93
  ],
94
+ transforms: ['attribute/cti', 'name/customKebab', 'color/hsl-4'],
69
95
  },
70
96
  typescript: {
71
- transforms: ['attribute/cti', 'name/camel', 'color/hsl-4'],
72
- transformGroup: 'js',
73
97
  buildPath: 'dist/',
74
98
  files: [
75
99
  {
76
- format: 'typescript/module-declarations',
77
100
  destination: `${name}.d.ts`,
101
+ format: 'typescript/module-declarations',
78
102
  },
79
103
  ],
104
+ transformGroup: 'js',
105
+ transforms: ['attribute/cti', 'name/camel', 'color/hsl-4'],
80
106
  },
81
107
  }
82
108
  }
83
109
 
84
110
  const defaultMode = new StyleDictionary({
111
+ log: {
112
+ verbosity: 'verbose',
113
+ },
114
+ platforms: generateSharedConfig(),
85
115
  source: [
86
116
  // exclude non-default modes from source
87
117
  `./src/**/!(*.${modes.join(`|*.`)}).tokens.json`,
88
118
  ],
89
- platforms: generateSharedConfig(),
90
119
  })
91
120
 
92
121
  defaultMode.buildAllPlatforms()
93
122
 
94
123
  modes.map((mode) => {
95
124
  const styleDictionary = new StyleDictionary({
96
- source: [`./src/**/*.${mode}.tokens.json`],
97
125
  platforms: generateSharedConfig(mode),
126
+ source: [`./src/**/*.${mode}.tokens.json`],
98
127
  })
99
128
  return styleDictionary.buildAllPlatforms()
100
129
  })
package/dist/compact.css CHANGED
@@ -3,22 +3,22 @@
3
3
  */
4
4
 
5
5
  :root {
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;
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);
23
- --ams-grid-padding-inline: var(--ams-space-grid-md);
6
+ --ams-space-xs: clamp(0.1875rem, 0.1719rem + 0.0781vw, 0.25rem);
7
+ --ams-space-s: clamp(0.375rem, 0.3438rem + 0.1563vw, 0.5rem);
8
+ --ams-space-m: clamp(0.75rem, 0.6875rem + 0.3125vw, 1rem);
9
+ --ams-space-l: clamp(1rem, 0.875rem + 0.625vw, 1.5rem);
10
+ --ams-space-xl: clamp(1.25rem, 1rem + 1.25vw, 2.25rem);
11
+ --ams-space-2xl: clamp(1.5rem, 1.125rem + 1.875vw, 3rem);
12
+ --ams-typography-body-text-font-size: 1rem;
13
+ --ams-typography-body-text-small-font-size: clamp(0.8889rem, calc(0.9141rem + -0.0253vw), 0.9091rem);
14
+ --ams-typography-body-text-large-font-size: clamp(1.1rem, calc(1.0938rem + 0.0313vw), 1.125rem);
15
+ --ams-typography-body-text-x-large-font-size: clamp(1.21rem, calc(1.1961rem + 0.0695vw), 1.2656rem);
16
+ --ams-typography-heading-0-font-size: clamp(1.6105rem, calc(1.5626rem + 0.2394vw), 1.802rem);
17
+ --ams-typography-heading-1-font-size: clamp(1.4641rem, calc(1.4297rem + 0.1721vw), 1.6018rem);
18
+ --ams-typography-heading-2-font-size: clamp(1.331rem, calc(1.3078rem + 0.116vw), 1.4238rem);
19
+ --ams-typography-heading-3-font-size: clamp(1.21rem, calc(1.1961rem + 0.0695vw), 1.2656rem);
20
+ --ams-typography-heading-4-font-size: clamp(1.1rem, calc(1.0938rem + 0.0313vw), 1.125rem);
21
+ --ams-typography-heading-5-font-size: 1rem;
22
+ --ams-typography-heading-6-font-size: clamp(0.8889rem, calc(0.9141rem + -0.0253vw), 0.9091rem);
23
+ --ams-grid-padding-inline: var(--ams-space-xl);
24
24
  }
package/dist/compact.d.ts CHANGED
@@ -15,48 +15,54 @@ declare interface DesignToken {
15
15
  }
16
16
 
17
17
  declare const tokens: {
18
- "ams": {
19
- "space": {
20
- "xs": DesignToken,
21
- "sm": DesignToken,
22
- "md": DesignToken,
23
- "lg": DesignToken,
24
- "xl": DesignToken,
25
- "grid": {
26
- "xs": DesignToken,
27
- "sm": DesignToken,
28
- "md": DesignToken,
29
- "lg": DesignToken,
30
- "xl": DesignToken
31
- }
32
- },
33
- "text": {
34
- "level": {
18
+ ams: {
19
+ space: {
20
+ xs: DesignToken;
21
+ s: DesignToken;
22
+ m: DesignToken;
23
+ l: DesignToken;
24
+ xl: DesignToken;
25
+ "2xl": DesignToken;
26
+ };
27
+ typography: {
28
+ "body-text": {
29
+ "font-size": DesignToken;
30
+ small: {
31
+ "font-size": DesignToken;
32
+ };
33
+ large: {
34
+ "font-size": DesignToken;
35
+ };
36
+ "x-large": {
37
+ "font-size": DesignToken;
38
+ };
39
+ };
40
+ heading: {
35
41
  "0": {
36
- "font-size": DesignToken
37
- },
42
+ "font-size": DesignToken;
43
+ };
38
44
  "1": {
39
- "font-size": DesignToken
40
- },
45
+ "font-size": DesignToken;
46
+ };
41
47
  "2": {
42
- "font-size": DesignToken
43
- },
48
+ "font-size": DesignToken;
49
+ };
44
50
  "3": {
45
- "font-size": DesignToken
46
- },
51
+ "font-size": DesignToken;
52
+ };
47
53
  "4": {
48
- "font-size": DesignToken
49
- },
54
+ "font-size": DesignToken;
55
+ };
50
56
  "5": {
51
- "font-size": DesignToken
52
- },
57
+ "font-size": DesignToken;
58
+ };
53
59
  "6": {
54
- "font-size": DesignToken
55
- }
56
- }
57
- },
58
- "grid": {
59
- "padding-inline": DesignToken
60
- }
61
- }
62
- }
60
+ "font-size": DesignToken;
61
+ };
62
+ };
63
+ };
64
+ grid: {
65
+ "padding-inline": DesignToken;
66
+ };
67
+ };
68
+ };
package/dist/compact.json CHANGED
@@ -1,21 +1,27 @@
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",
9
- "grid": {
10
- "xs": "clamp(0.25rem, calc(0.390625vw - 0.015625rem), 0.625rem)",
11
- "sm": "clamp(0.5rem, calc(0.78125vw - 0.03125rem), 1.25rem)",
12
- "md": "clamp(1rem, calc(1.5625vw - 0.0625rem), 2.5rem)",
13
- "lg": "clamp(1.5rem, calc(2.34375vw - 0.09375rem), 3.75rem)",
14
- "xl": "clamp(2rem, calc(3.125vw - 0.125rem), 5rem)"
15
- }
4
+ "xs": "clamp(0.1875rem, 0.1719rem + 0.0781vw, 0.25rem)",
5
+ "s": "clamp(0.375rem, 0.3438rem + 0.1563vw, 0.5rem)",
6
+ "m": "clamp(0.75rem, 0.6875rem + 0.3125vw, 1rem)",
7
+ "l": "clamp(1rem, 0.875rem + 0.625vw, 1.5rem)",
8
+ "xl": "clamp(1.25rem, 1rem + 1.25vw, 2.25rem)",
9
+ "2xl": "clamp(1.5rem, 1.125rem + 1.875vw, 3rem)"
16
10
  },
17
- "text": {
18
- "level": {
11
+ "typography": {
12
+ "body-text": {
13
+ "font-size": "1rem",
14
+ "small": {
15
+ "font-size": "clamp(0.8889rem, calc(0.9141rem + -0.0253vw), 0.9091rem)"
16
+ },
17
+ "large": {
18
+ "font-size": "clamp(1.1rem, calc(1.0938rem + 0.0313vw), 1.125rem)"
19
+ },
20
+ "x-large": {
21
+ "font-size": "clamp(1.21rem, calc(1.1961rem + 0.0695vw), 1.2656rem)"
22
+ }
23
+ },
24
+ "heading": {
19
25
  "0": {
20
26
  "font-size": "clamp(1.6105rem, calc(1.5626rem + 0.2394vw), 1.802rem)"
21
27
  },
@@ -40,7 +46,7 @@
40
46
  }
41
47
  },
42
48
  "grid": {
43
- "padding-inline": "clamp(1rem, calc(1.5625vw - 0.0625rem), 2.5rem)"
49
+ "padding-inline": "clamp(1.25rem, 1rem + 1.25vw, 2.25rem)"
44
50
  }
45
51
  }
46
52
  }
package/dist/compact.mjs CHANGED
@@ -2,21 +2,30 @@
2
2
  * Do not edit directly, this file was auto-generated.
3
3
  */
4
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";
10
- export const amsSpaceGridXs = "clamp(0.25rem, calc(0.390625vw - 0.015625rem), 0.625rem)";
11
- export const amsSpaceGridSm = "clamp(0.5rem, calc(0.78125vw - 0.03125rem), 1.25rem)";
12
- export const amsSpaceGridMd = "clamp(1rem, calc(1.5625vw - 0.0625rem), 2.5rem)"; // Grows from 16px at 1088px wide to 40px at 2624px wide.
13
- export const amsSpaceGridLg = "clamp(1.5rem, calc(2.34375vw - 0.09375rem), 3.75rem)";
14
- export const amsSpaceGridXl = "clamp(2rem, calc(3.125vw - 0.125rem), 5rem)";
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)";
22
- export const amsGridPaddingInline = "clamp(1rem, calc(1.5625vw - 0.0625rem), 2.5rem)";
5
+ export const amsSpaceXs = "clamp(0.1875rem, 0.1719rem + 0.0781vw, 0.25rem)";
6
+ export const amsSpaceS = "clamp(0.375rem, 0.3438rem + 0.1563vw, 0.5rem)";
7
+ export const amsSpaceM = "clamp(0.75rem, 0.6875rem + 0.3125vw, 1rem)";
8
+ export const amsSpaceL = "clamp(1rem, 0.875rem + 0.625vw, 1.5rem)";
9
+ export const amsSpaceXl = "clamp(1.25rem, 1rem + 1.25vw, 2.25rem)";
10
+ export const amsSpace_2xl = "clamp(1.5rem, 1.125rem + 1.875vw, 3rem)";
11
+ export const amsTypographyBodyTextFontSize = "1rem";
12
+ export const amsTypographyBodyTextSmallFontSize =
13
+ "clamp(0.8889rem, calc(0.9141rem + -0.0253vw), 0.9091rem)";
14
+ export const amsTypographyBodyTextLargeFontSize =
15
+ "clamp(1.1rem, calc(1.0938rem + 0.0313vw), 1.125rem)";
16
+ export const amsTypographyBodyTextXLargeFontSize =
17
+ "clamp(1.21rem, calc(1.1961rem + 0.0695vw), 1.2656rem)";
18
+ export const amsTypographyHeading_0FontSize =
19
+ "clamp(1.6105rem, calc(1.5626rem + 0.2394vw), 1.802rem)";
20
+ export const amsTypographyHeading_1FontSize =
21
+ "clamp(1.4641rem, calc(1.4297rem + 0.1721vw), 1.6018rem)";
22
+ export const amsTypographyHeading_2FontSize =
23
+ "clamp(1.331rem, calc(1.3078rem + 0.116vw), 1.4238rem)";
24
+ export const amsTypographyHeading_3FontSize =
25
+ "clamp(1.21rem, calc(1.1961rem + 0.0695vw), 1.2656rem)";
26
+ export const amsTypographyHeading_4FontSize =
27
+ "clamp(1.1rem, calc(1.0938rem + 0.0313vw), 1.125rem)";
28
+ export const amsTypographyHeading_5FontSize = "1rem";
29
+ export const amsTypographyHeading_6FontSize =
30
+ "clamp(0.8889rem, calc(0.9141rem + -0.0253vw), 0.9091rem)";
31
+ export const amsGridPaddingInline = "clamp(1.25rem, 1rem + 1.25vw, 2.25rem)";
package/dist/compact.scss CHANGED
@@ -1,21 +1,21 @@
1
1
 
2
2
  // Do not edit directly, this file was auto-generated.
3
3
 
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;
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);
21
- $ams-grid-padding-inline: $ams-space-grid-md;
4
+ $ams-space-xs: clamp(0.1875rem, 0.1719rem + 0.0781vw, 0.25rem);
5
+ $ams-space-s: clamp(0.375rem, 0.3438rem + 0.1563vw, 0.5rem);
6
+ $ams-space-m: clamp(0.75rem, 0.6875rem + 0.3125vw, 1rem);
7
+ $ams-space-l: clamp(1rem, 0.875rem + 0.625vw, 1.5rem);
8
+ $ams-space-xl: clamp(1.25rem, 1rem + 1.25vw, 2.25rem);
9
+ $ams-space-2xl: clamp(1.5rem, 1.125rem + 1.875vw, 3rem);
10
+ $ams-typography-body-text-font-size: 1rem;
11
+ $ams-typography-body-text-small-font-size: clamp(0.8889rem, calc(0.9141rem + -0.0253vw), 0.9091rem);
12
+ $ams-typography-body-text-large-font-size: clamp(1.1rem, calc(1.0938rem + 0.0313vw), 1.125rem);
13
+ $ams-typography-body-text-x-large-font-size: clamp(1.21rem, calc(1.1961rem + 0.0695vw), 1.2656rem);
14
+ $ams-typography-heading-0-font-size: clamp(1.6105rem, calc(1.5626rem + 0.2394vw), 1.802rem);
15
+ $ams-typography-heading-1-font-size: clamp(1.4641rem, calc(1.4297rem + 0.1721vw), 1.6018rem);
16
+ $ams-typography-heading-2-font-size: clamp(1.331rem, calc(1.3078rem + 0.116vw), 1.4238rem);
17
+ $ams-typography-heading-3-font-size: clamp(1.21rem, calc(1.1961rem + 0.0695vw), 1.2656rem);
18
+ $ams-typography-heading-4-font-size: clamp(1.1rem, calc(1.0938rem + 0.0313vw), 1.125rem);
19
+ $ams-typography-heading-5-font-size: 1rem;
20
+ $ams-typography-heading-6-font-size: clamp(0.8889rem, calc(0.9141rem + -0.0253vw), 0.9091rem);
21
+ $ams-grid-padding-inline: $ams-space-xl;