@aleph-alpha/ui-library 5.11.0 → 6.1.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 (41) hide show
  1. package/README.md +2 -2
  2. package/config.d.ts +28 -4
  3. package/config.js +99 -23
  4. package/dist/system/components/UiTagsInput/UiTagsInput.vue.d.ts +2 -0
  5. package/dist/system/components/UiTagsInput/UiTagsInputItemDelete.vue.d.ts +2 -1
  6. package/dist/system/components/UiTagsInput/types.d.ts +21 -2
  7. package/dist/system/components/core/tags-input/TagsInputItemDelete.vue.d.ts +5 -0
  8. package/dist/system/icons/story-sidebar-icons.json +7 -0
  9. package/dist/system/lib.js +1752 -1708
  10. package/dist/system/story-sidebar-icons.json +7 -0
  11. package/docs/public-docs/migration-guide.md +402 -0
  12. package/docs/public-docs/quick-start.md +20 -11
  13. package/package.json +5 -2
  14. package/src/components/UiAlert/UiAlert.stories.ts +732 -0
  15. package/src/components/UiAlert/__tests__/UiAlert.test.ts +57 -11
  16. package/src/components/UiChip/UiChip.stories.ts +756 -2
  17. package/src/components/UiChip/UiChip.vue +7 -6
  18. package/src/components/UiChip/__tests__/UiChip.test.ts +38 -61
  19. package/src/components/UiDrawer/UiDrawer.stories.ts +665 -0
  20. package/src/components/UiDrawer/__tests__/UiDrawer.test.ts +6 -190
  21. package/src/components/UiLabel/UiLabel.stories.ts +691 -16
  22. package/src/components/UiLabel/__tests__/UiLabel.test.ts +18 -26
  23. package/src/components/UiSheet/UiSheet.stories.ts +751 -0
  24. package/src/components/UiSheet/__tests__/UiSheet.test.ts +6 -190
  25. package/src/components/UiSlider/UiSlider.stories.ts +716 -0
  26. package/src/components/UiSlider/__tests__/UiSlider.test.ts +8 -45
  27. package/src/components/UiSwitch/UiSwitch.stories.ts +11 -5
  28. package/src/components/UiTagsInput/UiTagsInput.stories.ts +850 -4
  29. package/src/components/UiTagsInput/UiTagsInput.vue +34 -0
  30. package/src/components/UiTagsInput/UiTagsInputItemDelete.vue +4 -1
  31. package/src/components/UiTagsInput/__tests__/UiTagsInput.test.ts +113 -29
  32. package/src/components/UiTagsInput/types.ts +24 -2
  33. package/src/components/core/sheet/SheetContent.vue +6 -1
  34. package/src/components/core/switch/index.ts +8 -7
  35. package/src/components/core/tags-input/TagsInput.vue +4 -1
  36. package/src/components/core/tags-input/TagsInputItem.vue +13 -1
  37. package/src/components/core/tags-input/TagsInputItemDelete.vue +40 -7
  38. package/src/theme/Typography.stories.ts +125 -133
  39. package/tokens.json +8132 -2475
  40. package/dist/system/icons/mobile-device-frame.png +0 -0
  41. package/dist/system/mobile-device-frame.png +0 -0
@@ -33,138 +33,136 @@ const copyScript = `
33
33
 
34
34
  const sample = 'Sovereign AI Solutions for Enterprises and Governments';
35
35
 
36
+ const copyChrome = `
37
+ <style>
38
+ .copy-btn { cursor: pointer; transition: all 0.15s; }
39
+ .copy-btn:hover { background: rgba(0,0,0,0.05); }
40
+ .copy-btn.copied { background: #22c55e22; }
41
+ .copy-btn.copied::after { content: ' ✓'; color: #22c55e; }
42
+ </style>
43
+ <script>${copyScript}</script>`;
44
+
45
+ /** Weights every body and label step provides. */
46
+ const WEIGHTS = ['regular', 'medium', 'bold'] as const;
47
+
48
+ type SampleTag = 'span' | 'p';
49
+
50
+ /**
51
+ * One row: the class name to copy, then the sample rendered in that class.
52
+ * @param className Utility class to demonstrate.
53
+ * @param tag Element the sample renders into; `p` also gets a prose width.
54
+ * @returns Row markup.
55
+ */
56
+ const row = (className: string, tag: SampleTag = 'span') => `
57
+ <div class="flex flex-wrap items-baseline gap-4 border-b border-border-surface-default pb-4">
58
+ <code class="copy-btn label-xs-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('${className}', this)">${className}</code>
59
+ <${tag} class="${className} text-content-on-surface-primary${tag === 'p' ? ' max-w-prose' : ''}">${sample}</${tag}>
60
+ </div>`;
61
+
62
+ /**
63
+ * A size step of the scale, one row per weight.
64
+ * @param title Section heading, e.g. `Label S · 14px`.
65
+ * @param prefix Class prefix without the weight, e.g. `label-s`.
66
+ * @param tag Element the samples render into.
67
+ * @returns Section markup.
68
+ */
69
+ const stepSection = (
70
+ title: string,
71
+ prefix: string,
72
+ tag: SampleTag = 'span',
73
+ ) => `
74
+ <section class="mb-10 gap-y-3">
75
+ <h3 class="label-xs-medium text-content-on-surface-muted uppercase tracking-wide">${title}</h3>${WEIGHTS.map(
76
+ (weight) => row(`${prefix}-${weight}`, tag),
77
+ ).join('')}
78
+ </section>`;
79
+
36
80
  /**
37
- * Global typography tokens `Label 12`, `Label 14`, `Label 16` — utility classes `label-12-*`, `label-14-*`, `label-16-*`.
38
- * (`regular` tokens also register `*-normal` aliases, e.g. `label-12-normal`.)
81
+ * The superseded numbered classes, still rendered so it is visible that they
82
+ * resolve to the same declarations as the step name replacing them.
83
+ * @param renames Pairs of deprecated prefix and its replacement.
84
+ * @param tag Element the samples render into.
85
+ * @returns Section markup.
86
+ */
87
+ const deprecatedSection = (
88
+ renames: [from: string, to: string][],
89
+ tag: SampleTag = 'span',
90
+ ) => `
91
+ <section class="mt-4 border-t border-border-surface-default pt-8">
92
+ <h3 class="label-s-medium text-content-on-surface-primary mb-1">Deprecated: numbered classes</h3>
93
+ <p class="body-s-regular text-content-on-surface-muted mb-6 max-w-prose">
94
+ Superseded by the step names above and removed in <code class="label-xs-medium">@aleph-alpha/ui-library</code> <strong>7.0.0</strong>.
95
+ Each pair resolves to identical declarations, so migrating is a rename.
96
+ </p>${renames
97
+ .map(
98
+ ([from, to]) => `
99
+ <div class="mb-8 gap-y-3">
100
+ <h4 class="label-xs-medium text-content-on-surface-muted uppercase tracking-wide">
101
+ <s>${from}-*</s> &rarr; ${to}-*
102
+ </h4>${WEIGHTS.map((weight) => row(`${from}-${weight}`, tag)).join('')}
103
+ </div>`,
104
+ )
105
+ .join('')}
106
+ </section>`;
107
+
108
+ /**
109
+ * Global typography tokens `Label 12`, `Label 14`, `Label 16`, named by size
110
+ * step — utility classes `label-xs-*`, `label-s-*`, `label-m-*`.
111
+ * (`regular` tokens also register `*-normal` aliases, e.g. `label-xs-normal`.)
112
+ *
113
+ * The numbered classes (`label-12-*`, `label-14-*`, `label-16-*`) are
114
+ * deprecated and removed in 7.0.0. They are listed at the bottom with the step
115
+ * name that replaces each one.
39
116
  */
40
117
  export const Labels: Story = {
41
118
  render: () => ({
42
119
  template: `
43
120
  <div class="p-8 bg-background-surface-primary">
44
- <style>
45
- .copy-btn { cursor: pointer; transition: all 0.15s; }
46
- .copy-btn:hover { background: rgba(0,0,0,0.05); }
47
- .copy-btn.copied { background: #22c55e22; }
48
- .copy-btn.copied::after { content: ' ✓'; color: #22c55e; }
49
- </style>
50
- <script>${copyScript}</script>
121
+ ${copyChrome}
51
122
 
52
123
  <div class="mb-8">
53
124
  <h2 class="heading-s text-content-on-surface-primary mb-1">Labels</h2>
54
- <p class="body-14-regular text-content-on-surface-muted">From global <code class="label-12-medium">Label 12</code>, <code class="label-12-medium">Label 14</code>, <code class="label-12-medium">Label 16</code>. Click a class name to copy.</p>
125
+ <p class="body-s-regular text-content-on-surface-muted">From global <code class="label-xs-medium">Label 12</code>, <code class="label-xs-medium">Label 14</code>, <code class="label-xs-medium">Label 16</code>. Click a class name to copy.</p>
55
126
  </div>
56
-
57
- <section class="mb-10 gap-y-4">
58
- <h3 class="label-12-medium text-content-on-surface-muted uppercase tracking-wide">Label 12</h3>
59
- <div class="gap-y-3 border-b border-border-surface-default pb-6">
60
- <div class="flex flex-wrap items-baseline gap-4">
61
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('label-12-regular', this)">label-12-regular</code>
62
- <span class="label-12-regular text-content-on-surface-primary">${sample}</span>
63
- </div>
64
- <div class="flex flex-wrap items-baseline gap-4">
65
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('label-12-medium', this)">label-12-medium</code>
66
- <span class="label-12-medium text-content-on-surface-primary">${sample}</span>
67
- </div>
68
- <div class="flex flex-wrap items-baseline gap-4">
69
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('label-12-bold', this)">label-12-bold</code>
70
- <span class="label-12-bold text-content-on-surface-primary">${sample}</span>
71
- </div>
72
- </div>
73
- </section>
74
-
75
- <section class="mb-10 gap-y-4">
76
- <h3 class="label-12-medium text-content-on-surface-muted uppercase tracking-wide">Label 14</h3>
77
- <div class="gap-y-3 border-b border-border-surface-default pb-6">
78
- <div class="flex flex-wrap items-baseline gap-4">
79
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('label-14-regular', this)">label-14-regular</code>
80
- <span class="label-14-regular text-content-on-surface-primary">${sample}</span>
81
- </div>
82
- <div class="flex flex-wrap items-baseline gap-4">
83
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('label-14-medium', this)">label-14-medium</code>
84
- <span class="label-14-medium text-content-on-surface-primary">${sample}</span>
85
- </div>
86
- <div class="flex flex-wrap items-baseline gap-4">
87
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('label-14-bold', this)">label-14-bold</code>
88
- <span class="label-14-bold text-content-on-surface-primary">${sample}</span>
89
- </div>
90
- </div>
91
- </section>
92
-
93
- <section class="gap-y-4">
94
- <h3 class="label-12-medium text-content-on-surface-muted uppercase tracking-wide">Label 16</h3>
95
- <div class="gap-y-3">
96
- <div class="flex flex-wrap items-baseline gap-4">
97
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('label-16-regular', this)">label-16-regular</code>
98
- <span class="label-16-regular text-content-on-surface-primary">${sample}</span>
99
- </div>
100
- <div class="flex flex-wrap items-baseline gap-4">
101
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('label-16-medium', this)">label-16-medium</code>
102
- <span class="label-16-medium text-content-on-surface-primary">${sample}</span>
103
- </div>
104
- <div class="flex flex-wrap items-baseline gap-4">
105
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('label-16-bold', this)">label-16-bold</code>
106
- <span class="label-16-bold text-content-on-surface-primary">${sample}</span>
107
- </div>
108
- </div>
109
- </section>
127
+ ${stepSection('Label XS · 12px', 'label-xs')}
128
+ ${stepSection('Label S · 14px', 'label-s')}
129
+ ${stepSection('Label M · 16px', 'label-m')}
130
+ ${deprecatedSection([
131
+ ['label-12', 'label-xs'],
132
+ ['label-14', 'label-s'],
133
+ ['label-16', 'label-m'],
134
+ ])}
110
135
  </div>
111
136
  `,
112
137
  }),
113
138
  };
114
139
 
115
140
  /**
116
- * Global `Body 14` and `Body 16` — classes `body-14-*`, `body-16-*`.
141
+ * Global `Body 14` and `Body 16`, named by size step — classes `body-s-*`,
142
+ * `body-m-*`.
143
+ *
144
+ * The numbered classes (`body-14-*`, `body-16-*`) are deprecated and removed in
145
+ * 7.0.0. They are listed at the bottom with the step name that replaces each one.
117
146
  */
118
147
  export const Body: Story = {
119
148
  render: () => ({
120
149
  template: `
121
150
  <div class="p-8 bg-background-surface-primary">
122
- <style>
123
- .copy-btn { cursor: pointer; transition: all 0.15s; }
124
- .copy-btn:hover { background: rgba(0,0,0,0.05); }
125
- .copy-btn.copied { background: #22c55e22; }
126
- .copy-btn.copied::after { content: ' ✓'; color: #22c55e; }
127
- </style>
128
- <script>${copyScript}</script>
151
+ ${copyChrome}
129
152
 
130
153
  <div class="mb-8">
131
154
  <h2 class="heading-s text-content-on-surface-primary mb-1">Body</h2>
132
- <p class="body-14-regular text-content-on-surface-muted">From global <code class="label-12-medium">Body 14</code> and <code class="label-12-medium">Body 16</code>.</p>
133
- </div>
134
-
135
- <div class="gap-y-8">
136
- <section class="gap-y-3">
137
- <h3 class="label-12-medium text-content-on-surface-muted uppercase tracking-wide">Body 14</h3>
138
- <div class="flex flex-wrap items-baseline gap-4 border-b border-border-surface-default pb-4">
139
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('body-14-regular', this)">body-14-regular</code>
140
- <p class="body-14-regular text-content-on-surface-primary max-w-prose">${sample}</p>
141
- </div>
142
- <div class="flex flex-wrap items-baseline gap-4 border-b border-border-surface-default pb-4">
143
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('body-14-medium', this)">body-14-medium</code>
144
- <p class="body-14-medium text-content-on-surface-primary max-w-prose">${sample}</p>
145
- </div>
146
- <div class="flex flex-wrap items-baseline gap-4">
147
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('body-14-bold', this)">body-14-bold</code>
148
- <p class="body-14-bold text-content-on-surface-primary max-w-prose">${sample}</p>
149
- </div>
150
- </section>
151
-
152
- <section class="gap-y-3">
153
- <h3 class="label-12-medium text-content-on-surface-muted uppercase tracking-wide">Body 16</h3>
154
- <div class="flex flex-wrap items-baseline gap-4 border-b border-border-surface-default pb-4">
155
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('body-16-regular', this)">body-16-regular</code>
156
- <p class="body-16-regular text-content-on-surface-primary max-w-prose">${sample}</p>
157
- </div>
158
- <div class="flex flex-wrap items-baseline gap-4 border-b border-border-surface-default pb-4">
159
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('body-16-medium', this)">body-16-medium</code>
160
- <p class="body-16-medium text-content-on-surface-primary max-w-prose">${sample}</p>
161
- </div>
162
- <div class="flex flex-wrap items-baseline gap-4">
163
- <code class="copy-btn label-12-medium text-content-on-surface-muted w-44 shrink-0" onclick="copyToClipboard('body-16-bold', this)">body-16-bold</code>
164
- <p class="body-16-bold text-content-on-surface-primary max-w-prose">${sample}</p>
165
- </div>
166
- </section>
155
+ <p class="body-s-regular text-content-on-surface-muted">From global <code class="label-xs-medium">Body 14</code> and <code class="label-xs-medium">Body 16</code>.</p>
167
156
  </div>
157
+ ${stepSection('Body S · 14px', 'body-s', 'p')}
158
+ ${stepSection('Body M · 16px', 'body-m', 'p')}
159
+ ${deprecatedSection(
160
+ [
161
+ ['body-14', 'body-s'],
162
+ ['body-16', 'body-m'],
163
+ ],
164
+ 'p',
165
+ )}
168
166
  </div>
169
167
  `,
170
168
  }),
@@ -179,55 +177,49 @@ export const Headings: Story = {
179
177
  render: () => ({
180
178
  template: `
181
179
  <div class="p-8 bg-background-surface-primary">
182
- <style>
183
- .copy-btn { cursor: pointer; transition: all 0.15s; }
184
- .copy-btn:hover { background: rgba(0,0,0,0.05); }
185
- .copy-btn.copied { background: #22c55e22; }
186
- .copy-btn.copied::after { content: ' ✓'; color: #22c55e; }
187
- </style>
188
- <script>${copyScript}</script>
180
+ ${copyChrome}
189
181
 
190
182
  <div class="mb-8 max-w-3xl">
191
183
  <h2 class="heading-s text-content-on-surface-primary mb-1">Headings</h2>
192
- <p class="body-14-regular text-content-on-surface-muted mb-2">
193
- No weight suffix: each step is a single class: <code class="label-12-medium">heading-s</code>, <code class="label-12-medium">heading-m</code>, <code class="label-12-medium">heading-l</code>, <code class="label-12-medium">heading-xl</code>, <code class="label-12-medium">heading-2xl</code> (match <code class="label-12-medium">Heading S</code> … <code class="label-12-medium">Heading 2XL</code>).
184
+ <p class="body-s-regular text-content-on-surface-muted mb-2">
185
+ No weight suffix: each step is a single class: <code class="label-xs-medium">heading-s</code>, <code class="label-xs-medium">heading-m</code>, <code class="label-xs-medium">heading-l</code>, <code class="label-xs-medium">heading-xl</code>, <code class="label-xs-medium">heading-2xl</code> (match <code class="label-xs-medium">Heading S</code> … <code class="label-xs-medium">Heading 2XL</code>).
194
186
  </p>
195
- <p class="label-12-regular text-content-on-surface-muted">Font size, line height, and weight come from the matching global heading typography token. Font family resolves from <code class="label-12-medium">2-theme/AA Base</code>.</p>
187
+ <p class="label-xs-regular text-content-on-surface-muted">Font size, line height, and weight come from the matching global heading typography token. Font family resolves from <code class="label-xs-medium">2-theme/AA Base</code>.</p>
196
188
  </div>
197
189
 
198
190
  <div class="gap-y-6">
199
191
  <div class="flex flex-wrap items-baseline gap-x-4 gap-y-2 border-b border-border-surface-default pb-4">
200
192
  <div class="w-52 shrink-0 gap-y-1">
201
- <code class="copy-btn block label-12-medium text-content-on-surface-muted" onclick="copyToClipboard('heading-s', this)">heading-s</code>
202
- <span class="label-12-regular text-content-on-surface-muted">Heading S</span>
193
+ <code class="copy-btn block label-xs-medium text-content-on-surface-muted" onclick="copyToClipboard('heading-s', this)">heading-s</code>
194
+ <span class="label-xs-regular text-content-on-surface-muted">Heading S</span>
203
195
  </div>
204
196
  <span class="heading-s text-content-on-surface-primary min-w-0 flex-1">${sample}</span>
205
197
  </div>
206
198
  <div class="flex flex-wrap items-baseline gap-x-4 gap-y-2 border-b border-border-surface-default pb-4">
207
199
  <div class="w-52 shrink-0 gap-y-1">
208
- <code class="copy-btn block label-12-medium text-content-on-surface-muted" onclick="copyToClipboard('heading-m', this)">heading-m</code>
209
- <span class="label-12-regular text-content-on-surface-muted">Heading M</span>
200
+ <code class="copy-btn block label-xs-medium text-content-on-surface-muted" onclick="copyToClipboard('heading-m', this)">heading-m</code>
201
+ <span class="label-xs-regular text-content-on-surface-muted">Heading M</span>
210
202
  </div>
211
203
  <span class="heading-m text-content-on-surface-primary min-w-0 flex-1">${sample}</span>
212
204
  </div>
213
205
  <div class="flex flex-wrap items-baseline gap-x-4 gap-y-2 border-b border-border-surface-default pb-4">
214
206
  <div class="w-52 shrink-0 gap-y-1">
215
- <code class="copy-btn block label-12-medium text-content-on-surface-muted" onclick="copyToClipboard('heading-l', this)">heading-l</code>
216
- <span class="label-12-regular text-content-on-surface-muted">Heading L</span>
207
+ <code class="copy-btn block label-xs-medium text-content-on-surface-muted" onclick="copyToClipboard('heading-l', this)">heading-l</code>
208
+ <span class="label-xs-regular text-content-on-surface-muted">Heading L</span>
217
209
  </div>
218
210
  <span class="heading-l text-content-on-surface-primary min-w-0 flex-1">${sample}</span>
219
211
  </div>
220
212
  <div class="flex flex-wrap items-baseline gap-x-4 gap-y-2 border-b border-border-surface-default pb-4">
221
213
  <div class="w-52 shrink-0 gap-y-1">
222
- <code class="copy-btn block label-12-medium text-content-on-surface-muted" onclick="copyToClipboard('heading-xl', this)">heading-xl</code>
223
- <span class="label-12-regular text-content-on-surface-muted">Heading XL</span>
214
+ <code class="copy-btn block label-xs-medium text-content-on-surface-muted" onclick="copyToClipboard('heading-xl', this)">heading-xl</code>
215
+ <span class="label-xs-regular text-content-on-surface-muted">Heading XL</span>
224
216
  </div>
225
217
  <span class="heading-xl text-content-on-surface-primary min-w-0 flex-1">${sample}</span>
226
218
  </div>
227
219
  <div class="flex flex-wrap items-baseline gap-x-4 gap-y-2">
228
220
  <div class="w-52 shrink-0 gap-y-1">
229
- <code class="copy-btn block label-12-medium text-content-on-surface-muted" onclick="copyToClipboard('heading-2xl', this)">heading-2xl</code>
230
- <span class="label-12-regular text-content-on-surface-muted">Heading 2XL</span>
221
+ <code class="copy-btn block label-xs-medium text-content-on-surface-muted" onclick="copyToClipboard('heading-2xl', this)">heading-2xl</code>
222
+ <span class="label-xs-regular text-content-on-surface-muted">Heading 2XL</span>
231
223
  </div>
232
224
  <span class="heading-2xl text-content-on-surface-primary min-w-0 flex-1">${sample}</span>
233
225
  </div>
@@ -247,19 +239,19 @@ export const Article: Story = {
247
239
  <div class="max-w-2xl mx-auto">
248
240
  <article class="text-content-on-surface-primary">
249
241
  <header class="mb-8">
250
- <p class="label-14-medium text-content-on-surface-muted mb-2">Design system</p>
242
+ <p class="label-s-medium text-content-on-surface-muted mb-2">Design system</p>
251
243
  <h1 class="heading-2xl mb-4">Building consistent UI with design tokens</h1>
252
- <p class="body-16-regular text-content-on-surface-secondary">A short guide to typography utilities aligned with global token groups.</p>
244
+ <p class="body-m-regular text-content-on-surface-secondary">A short guide to typography utilities aligned with global token groups.</p>
253
245
  </header>
254
246
  <div class="gap-y-6">
255
- <p class="body-14-regular">Design tokens store visual attributes in one place. Prefer named classes such as <code class="label-12-medium">body-14-regular</code> over ad-hoc font sizes.</p>
247
+ <p class="body-s-regular">Design tokens store visual attributes in one place. Prefer named classes such as <code class="label-xs-medium">body-s-regular</code> over ad-hoc font sizes.</p>
256
248
  <h2 class="heading-m mt-8">Why tokens?</h2>
257
- <p class="body-14-regular">They keep typography consistent when the underlying font metrics change.</p>
258
- <ul class="list-disc list-inside gap-y-2 body-14-regular">
249
+ <p class="body-s-regular">They keep typography consistent when the underlying font metrics change.</p>
250
+ <ul class="list-disc list-inside gap-y-2 body-s-regular">
259
251
  <li>Single source of truth</li>
260
252
  <li>Easier theming</li>
261
253
  </ul>
262
- <p class="label-12-regular text-content-on-surface-muted mt-8">Last updated · 2026</p>
254
+ <p class="label-xs-regular text-content-on-surface-muted mt-8">Last updated · 2026</p>
263
255
  </div>
264
256
  </article>
265
257
  </div>