@motion-proto/live-tokens 0.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 (68) hide show
  1. package/README.md +41 -0
  2. package/dist-plugin/index.cjs +444 -0
  3. package/dist-plugin/index.d.cts +12 -0
  4. package/dist-plugin/index.d.ts +12 -0
  5. package/dist-plugin/index.js +407 -0
  6. package/package.json +86 -0
  7. package/src/components/Badge.svelte +82 -0
  8. package/src/components/Button.svelte +333 -0
  9. package/src/components/Card.svelte +83 -0
  10. package/src/components/CollapsibleSection.svelte +82 -0
  11. package/src/components/DetailNav.svelte +78 -0
  12. package/src/components/Dialog.svelte +269 -0
  13. package/src/components/InlineEditActions.svelte +73 -0
  14. package/src/components/Notification.svelte +308 -0
  15. package/src/components/ProgressBar.svelte +99 -0
  16. package/src/components/RadioButton.svelte +87 -0
  17. package/src/components/SectionDivider.svelte +121 -0
  18. package/src/components/TabBar.svelte +92 -0
  19. package/src/components/Toggle.svelte +86 -0
  20. package/src/components/Tooltip.svelte +64 -0
  21. package/src/lib/ColumnsOverlay.svelte +120 -0
  22. package/src/lib/LiveEditorOverlay.svelte +467 -0
  23. package/src/lib/columnsOverlay.ts +26 -0
  24. package/src/lib/cssVarSync.ts +72 -0
  25. package/src/lib/editorConfig.ts +9 -0
  26. package/src/lib/editorConfigStore.ts +14 -0
  27. package/src/lib/index.ts +51 -0
  28. package/src/lib/oklch.ts +129 -0
  29. package/src/lib/pageSource.ts +6 -0
  30. package/src/lib/tokenInit.ts +29 -0
  31. package/src/lib/tokenService.ts +144 -0
  32. package/src/lib/tokenTypes.ts +45 -0
  33. package/src/pages/Admin.svelte +100 -0
  34. package/src/pages/ShowcasePage.svelte +146 -0
  35. package/src/showcase/BackupBrowser.svelte +617 -0
  36. package/src/showcase/BezierCurveEditor.svelte +648 -0
  37. package/src/showcase/ColorEditPanel.svelte +498 -0
  38. package/src/showcase/ComponentsTab.svelte +107 -0
  39. package/src/showcase/EditorDialog.svelte +137 -0
  40. package/src/showcase/PaletteEditor.svelte +2579 -0
  41. package/src/showcase/PaletteSelector.svelte +627 -0
  42. package/src/showcase/SurfacesTab.svelte +409 -0
  43. package/src/showcase/TextTab.svelte +205 -0
  44. package/src/showcase/TokenFileManager.svelte +683 -0
  45. package/src/showcase/TokenMap.svelte +54 -0
  46. package/src/showcase/VariablesTab.svelte +2657 -0
  47. package/src/showcase/VisualsTab.svelte +233 -0
  48. package/src/showcase/curveEngine.ts +190 -0
  49. package/src/showcase/demos/BadgeDemo.svelte +58 -0
  50. package/src/showcase/demos/CardDemo.svelte +52 -0
  51. package/src/showcase/demos/ChoiceButtonsDemo.svelte +194 -0
  52. package/src/showcase/demos/CollapsibleSectionDemo.svelte +56 -0
  53. package/src/showcase/demos/DialogDemo.svelte +42 -0
  54. package/src/showcase/demos/InlineEditActionsDemo.svelte +27 -0
  55. package/src/showcase/demos/NotificationDemo.svelte +149 -0
  56. package/src/showcase/demos/ProgressBarDemo.svelte +56 -0
  57. package/src/showcase/demos/RadioButtonDemo.svelte +58 -0
  58. package/src/showcase/demos/SectionDividerDemo.svelte +79 -0
  59. package/src/showcase/demos/StandardButtonsDemo.svelte +457 -0
  60. package/src/showcase/demos/TabBarDemo.svelte +60 -0
  61. package/src/showcase/demos/TooltipDemo.svelte +54 -0
  62. package/src/showcase/editor.css +93 -0
  63. package/src/showcase/index.ts +17 -0
  64. package/src/styles/fonts/Domine/Domine-VariableFont_wght.ttf +0 -0
  65. package/src/styles/fonts/Domine/OFL.txt +97 -0
  66. package/src/styles/fonts/Domine/README.txt +66 -0
  67. package/src/styles/fonts.css +18 -0
  68. package/src/styles/form-controls.css +190 -0
@@ -0,0 +1,409 @@
1
+ <script lang="ts">
2
+ interface Swatch {
3
+ name: string;
4
+ variable: string;
5
+ description: string;
6
+ }
7
+
8
+ interface SwatchGroup {
9
+ title: string;
10
+ swatches: Swatch[];
11
+ }
12
+
13
+ interface BorderGroup {
14
+ title: string;
15
+ borders: Array<{ name: string; variable: string }>;
16
+ }
17
+
18
+ const swatchGroups: SwatchGroup[] = [
19
+ {
20
+ title: 'Base Surfaces',
21
+ swatches: [
22
+ { name: 'Lowest', variable: '--surface-neutral-lowest', description: '10% - Deepest surface layer' },
23
+ { name: 'Lower', variable: '--surface-neutral-lower', description: '~11% - Very subtle lift' },
24
+ { name: 'Low', variable: '--surface-neutral-low', description: '~12% - Subtle panels' },
25
+ { name: 'Surface', variable: '--surface-neutral', description: '~13% - Standard surface (MIDPOINT)' },
26
+ { name: 'High', variable: '--surface-neutral-high', description: '~14% - Elevated panels' },
27
+ { name: 'Higher', variable: '--surface-neutral-higher', description: '~14.5% - Prominent elements' },
28
+ { name: 'Highest', variable: '--surface-neutral-highest', description: '15% - Most elevated (modals, tooltips)' }
29
+ ]
30
+ },
31
+ {
32
+ title: 'Overlays',
33
+ swatches: [
34
+ { name: 'Lowest', variable: '--overlay-lowest', description: 'Barely visible tint' },
35
+ { name: 'Lower', variable: '--overlay-lower', description: 'Very subtle overlay' },
36
+ { name: 'Low', variable: '--overlay-low', description: 'Light overlay' },
37
+ { name: 'Overlay', variable: '--overlay', description: 'Standard overlay' },
38
+ { name: 'High', variable: '--overlay-high', description: 'Heavy overlay' },
39
+ { name: 'Higher', variable: '--overlay-higher', description: 'Modal backdrop' },
40
+ { name: 'Highest', variable: '--overlay-highest', description: 'Nearly opaque' }
41
+ ]
42
+ },
43
+ {
44
+ title: 'Primary (Crimson)',
45
+ swatches: [
46
+ { name: 'Lowest', variable: '--surface-primary-lowest', description: 'Deepest' },
47
+ { name: 'Lower', variable: '--surface-primary-lower', description: 'Barely perceptible' },
48
+ { name: 'Low', variable: '--surface-primary-low', description: 'Subtle' },
49
+ { name: 'Primary', variable: '--surface-primary', description: 'Default' },
50
+ { name: 'High', variable: '--surface-primary-high', description: 'More prominent' },
51
+ { name: 'Higher', variable: '--surface-primary-higher', description: 'Very prominent' },
52
+ { name: 'Highest', variable: '--surface-primary-highest', description: 'Most prominent' }
53
+ ]
54
+ },
55
+ {
56
+ title: 'Accent (Amber)',
57
+ swatches: [
58
+ { name: 'Lowest', variable: '--surface-accent-lowest', description: 'Deepest' },
59
+ { name: 'Lower', variable: '--surface-accent-lower', description: 'Barely perceptible' },
60
+ { name: 'Low', variable: '--surface-accent-low', description: 'Subtle' },
61
+ { name: 'Accent', variable: '--surface-accent', description: 'Default' },
62
+ { name: 'High', variable: '--surface-accent-high', description: 'More prominent' },
63
+ { name: 'Higher', variable: '--surface-accent-higher', description: 'Very prominent' },
64
+ { name: 'Highest', variable: '--surface-accent-highest', description: 'Most prominent' }
65
+ ]
66
+ },
67
+ {
68
+ title: 'Success (Green)',
69
+ swatches: [
70
+ { name: 'Lowest', variable: '--surface-success-lowest', description: 'Deepest' },
71
+ { name: 'Lower', variable: '--surface-success-lower', description: 'Barely perceptible' },
72
+ { name: 'Low', variable: '--surface-success-low', description: 'Subtle' },
73
+ { name: 'Success', variable: '--surface-success', description: 'Default' },
74
+ { name: 'High', variable: '--surface-success-high', description: 'More prominent' },
75
+ { name: 'Higher', variable: '--surface-success-higher', description: 'Very prominent' },
76
+ { name: 'Highest', variable: '--surface-success-highest', description: 'Most prominent' }
77
+ ]
78
+ },
79
+ {
80
+ title: 'Warning (Orange)',
81
+ swatches: [
82
+ { name: 'Lowest', variable: '--surface-warning-lowest', description: 'Deepest' },
83
+ { name: 'Lower', variable: '--surface-warning-lower', description: 'Barely perceptible' },
84
+ { name: 'Low', variable: '--surface-warning-low', description: 'Subtle' },
85
+ { name: 'Warning', variable: '--surface-warning', description: 'Default' },
86
+ { name: 'High', variable: '--surface-warning-high', description: 'More prominent' },
87
+ { name: 'Higher', variable: '--surface-warning-higher', description: 'Very prominent' },
88
+ { name: 'Highest', variable: '--surface-warning-highest', description: 'Most prominent' }
89
+ ]
90
+ },
91
+ {
92
+ title: 'Info (Blue)',
93
+ swatches: [
94
+ { name: 'Lowest', variable: '--surface-info-lowest', description: 'Deepest' },
95
+ { name: 'Lower', variable: '--surface-info-lower', description: 'Barely perceptible' },
96
+ { name: 'Low', variable: '--surface-info-low', description: 'Subtle' },
97
+ { name: 'Info', variable: '--surface-info', description: 'Default' },
98
+ { name: 'High', variable: '--surface-info-high', description: 'More prominent' },
99
+ { name: 'Higher', variable: '--surface-info-higher', description: 'Very prominent' },
100
+ { name: 'Highest', variable: '--surface-info-highest', description: 'Most prominent' }
101
+ ]
102
+ },
103
+ {
104
+ title: 'Danger (Bright Red)',
105
+ swatches: [
106
+ { name: 'Lowest', variable: '--surface-danger-lowest', description: 'Deepest' },
107
+ { name: 'Lower', variable: '--surface-danger-lower', description: 'Barely perceptible' },
108
+ { name: 'Low', variable: '--surface-danger-low', description: 'Subtle' },
109
+ { name: 'Danger', variable: '--surface-danger', description: 'Default' },
110
+ { name: 'High', variable: '--surface-danger-high', description: 'More prominent' },
111
+ { name: 'Higher', variable: '--surface-danger-higher', description: 'Very prominent' },
112
+ { name: 'Highest', variable: '--surface-danger-highest', description: 'Most prominent' }
113
+ ]
114
+ },
115
+ {
116
+ title: 'Hover States',
117
+ swatches: [
118
+ { name: '', variable: '', description: 'Empty slot' },
119
+ { name: '', variable: '', description: 'Empty slot' },
120
+ { name: 'Low', variable: '--hover-low', description: 'Subtle hover' },
121
+ { name: 'Hover', variable: '--hover', description: 'Standard hover' },
122
+ { name: 'High', variable: '--hover-high', description: 'Prominent hover' },
123
+ { name: '', variable: '', description: 'Empty slot' },
124
+ { name: '', variable: '', description: 'Empty slot' }
125
+ ]
126
+ }
127
+ ];
128
+
129
+ let copiedVar: string | null = null;
130
+ function copyVariable(v: string) {
131
+ navigator.clipboard.writeText(v);
132
+ copiedVar = v;
133
+ setTimeout(() => { copiedVar = null; }, 1000);
134
+ }
135
+
136
+ const borderGroups: BorderGroup[] = [
137
+ {
138
+ title: 'Base Borders',
139
+ borders: [
140
+ { name: 'Faint', variable: '--border-neutral-faint' },
141
+ { name: 'Subtle', variable: '--border-neutral-subtle' },
142
+ { name: 'Default', variable: '--border-neutral-default' },
143
+ { name: 'Medium', variable: '--border-neutral-medium' },
144
+ { name: 'Strong', variable: '--border-neutral-strong' }
145
+ ]
146
+ },
147
+ {
148
+ title: 'Primary (Crimson)',
149
+ borders: [
150
+ { name: 'Faint', variable: '--border-primary-faint' },
151
+ { name: 'Subtle', variable: '--border-primary-subtle' },
152
+ { name: 'Primary', variable: '--border-primary' },
153
+ { name: 'Medium', variable: '--border-primary-medium' },
154
+ { name: 'Strong', variable: '--border-primary-strong' }
155
+ ]
156
+ },
157
+ {
158
+ title: 'Accent (Amber)',
159
+ borders: [
160
+ { name: 'Faint', variable: '--border-accent-faint' },
161
+ { name: 'Subtle', variable: '--border-accent-subtle' },
162
+ { name: 'Accent', variable: '--border-accent' },
163
+ { name: 'Medium', variable: '--border-accent-medium' },
164
+ { name: 'Strong', variable: '--border-accent-strong' }
165
+ ]
166
+ },
167
+ {
168
+ title: 'Success (Green)',
169
+ borders: [
170
+ { name: 'Faint', variable: '--border-success-faint' },
171
+ { name: 'Subtle', variable: '--border-success-subtle' },
172
+ { name: 'Success', variable: '--border-success' },
173
+ { name: 'Medium', variable: '--border-success-medium' },
174
+ { name: 'Strong', variable: '--border-success-strong' }
175
+ ]
176
+ },
177
+ {
178
+ title: 'Warning (Orange)',
179
+ borders: [
180
+ { name: 'Faint', variable: '--border-warning-faint' },
181
+ { name: 'Subtle', variable: '--border-warning-subtle' },
182
+ { name: 'Warning', variable: '--border-warning' },
183
+ { name: 'Medium', variable: '--border-warning-medium' },
184
+ { name: 'Strong', variable: '--border-warning-strong' }
185
+ ]
186
+ },
187
+ {
188
+ title: 'Info (Blue)',
189
+ borders: [
190
+ { name: 'Faint', variable: '--border-info-faint' },
191
+ { name: 'Subtle', variable: '--border-info-subtle' },
192
+ { name: 'Info', variable: '--border-info' },
193
+ { name: 'Medium', variable: '--border-info-medium' },
194
+ { name: 'Strong', variable: '--border-info-strong' }
195
+ ]
196
+ },
197
+ {
198
+ title: 'Danger (Bright Red)',
199
+ borders: [
200
+ { name: 'Faint', variable: '--border-danger-faint' },
201
+ { name: 'Subtle', variable: '--border-danger-subtle' },
202
+ { name: 'Danger', variable: '--border-danger' },
203
+ { name: 'Medium', variable: '--border-danger-medium' },
204
+ { name: 'Strong', variable: '--border-danger-strong' }
205
+ ]
206
+ }
207
+ ];
208
+ </script>
209
+
210
+ <div class="surfaces-container">
211
+ <section class="section">
212
+ <h2 class="section-title">Surfaces</h2>
213
+ <div class="swatch-groups-grid">
214
+ {#each swatchGroups as group}
215
+ <div class="swatch-group">
216
+ <h3 class="group-title">{group.title}</h3>
217
+ <div class="swatches-row">
218
+ {#each group.swatches as swatch}
219
+ <div class="swatch-card">
220
+ {#if swatch.variable !== ''}
221
+ <div
222
+ class="swatch-box"
223
+ style="background: var({swatch.variable});"
224
+ ></div>
225
+ <button class="swatch-name copyable" class:copied={copiedVar === swatch.variable} on:click={() => copyVariable(swatch.variable)}>{copiedVar === swatch.variable ? 'copied!' : swatch.name}</button>
226
+ {:else}
227
+ <div class="swatch-box empty"></div>
228
+ <div class="swatch-name">&nbsp;</div>
229
+ {/if}
230
+ </div>
231
+ {/each}
232
+ </div>
233
+ </div>
234
+ {/each}
235
+ </div>
236
+ </section>
237
+
238
+ <section class="section">
239
+ <h2 class="section-title">Borders</h2>
240
+ <div class="border-groups-grid">
241
+ {#each borderGroups as group}
242
+ <div class="border-group">
243
+ <h3 class="group-title">{group.title}</h3>
244
+ <div class="borders-row">
245
+ {#each group.borders as border}
246
+ <div class="border-card">
247
+ <div
248
+ class="border-box"
249
+ style="border: 2px solid var({border.variable});"
250
+ ></div>
251
+ <button class="border-name copyable" class:copied={copiedVar === border.variable} on:click={() => copyVariable(border.variable)}>{copiedVar === border.variable ? 'copied!' : border.name}</button>
252
+ </div>
253
+ {/each}
254
+ </div>
255
+ </div>
256
+ {/each}
257
+ </div>
258
+ </section>
259
+ </div>
260
+
261
+ <style>
262
+ @import '../styles/variables.css';
263
+
264
+ .surfaces-container {
265
+ display: flex;
266
+ flex-direction: column;
267
+ gap: var(--space-32);
268
+ }
269
+
270
+ .section {
271
+ display: flex;
272
+ flex-direction: column;
273
+ gap: var(--space-16);
274
+ }
275
+
276
+ .section-title {
277
+ font-size: var(--font-lg);
278
+ font-weight: var(--font-weight-semibold);
279
+ color: var(--ui-text-primary);
280
+ margin: 0;
281
+ padding-bottom: var(--space-8);
282
+ border-bottom: 1px solid var(--ui-border-subtle);
283
+ }
284
+
285
+ .swatch-groups-grid {
286
+ display: grid;
287
+ grid-template-columns: repeat(auto-fill, minmax(min(28rem, 100%), 1fr));
288
+ gap: var(--space-24);
289
+ }
290
+
291
+ .swatch-group {
292
+ display: flex;
293
+ flex-direction: column;
294
+ gap: var(--space-8);
295
+ min-width: 0;
296
+ }
297
+
298
+ .group-title {
299
+ font-size: var(--font-sm);
300
+ font-weight: var(--font-weight-semibold);
301
+ color: var(--ui-text-secondary);
302
+ margin: 0;
303
+ }
304
+
305
+ .swatches-row {
306
+ display: grid;
307
+ grid-template-columns: repeat(auto-fill, minmax(3.5rem, 1fr));
308
+ gap: var(--space-8);
309
+ max-width: calc(7 * 3.5rem + 6 * var(--space-8));
310
+ }
311
+
312
+ .swatch-card {
313
+ display: flex;
314
+ flex-direction: column;
315
+ gap: var(--space-4);
316
+ align-items: center;
317
+ }
318
+
319
+ .swatch-box {
320
+ width: 3.5rem;
321
+ height: 3.5rem;
322
+ border-radius: var(--radius-md);
323
+ flex-shrink: 0;
324
+ }
325
+
326
+ .swatch-box.empty {
327
+ opacity: 0;
328
+ }
329
+
330
+ .swatch-name {
331
+ font-size: var(--font-xs);
332
+ color: var(--ui-text-tertiary);
333
+ text-align: center;
334
+ }
335
+
336
+ .swatch-name.copyable {
337
+ all: unset;
338
+ font-size: var(--font-xs);
339
+ color: var(--ui-text-tertiary);
340
+ text-align: center;
341
+ cursor: pointer;
342
+ transition: color var(--transition-fast);
343
+ }
344
+
345
+ .swatch-name.copyable:hover {
346
+ color: var(--ui-text-accent);
347
+ }
348
+
349
+ .swatch-name.copyable.copied {
350
+ color: var(--ui-text-success);
351
+ }
352
+
353
+ .border-groups-grid {
354
+ display: grid;
355
+ grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr));
356
+ gap: var(--space-24);
357
+ }
358
+
359
+ .border-group {
360
+ display: flex;
361
+ flex-direction: column;
362
+ gap: var(--space-8);
363
+ min-width: 0;
364
+ }
365
+
366
+ .borders-row {
367
+ display: flex;
368
+ gap: var(--space-8);
369
+ flex-wrap: wrap;
370
+ }
371
+
372
+ .border-card {
373
+ display: flex;
374
+ flex-direction: column;
375
+ gap: var(--space-4);
376
+ align-items: center;
377
+ }
378
+
379
+ .border-box {
380
+ width: 3.5rem;
381
+ height: 3.5rem;
382
+ background: var(--ui-surface-low);
383
+ border-radius: var(--radius-md);
384
+ flex-shrink: 0;
385
+ }
386
+
387
+ .border-name {
388
+ font-size: var(--font-xs);
389
+ color: var(--ui-text-tertiary);
390
+ text-align: center;
391
+ }
392
+
393
+ .border-name.copyable {
394
+ all: unset;
395
+ font-size: var(--font-xs);
396
+ color: var(--ui-text-tertiary);
397
+ text-align: center;
398
+ cursor: pointer;
399
+ transition: color var(--transition-fast);
400
+ }
401
+
402
+ .border-name.copyable:hover {
403
+ color: var(--ui-text-accent);
404
+ }
405
+
406
+ .border-name.copyable.copied {
407
+ color: var(--ui-text-success);
408
+ }
409
+ </style>
@@ -0,0 +1,205 @@
1
+ <script lang="ts">
2
+ interface TextColorGroup {
3
+ title: string;
4
+ colors: Array<{ name: string; variable: string; description: string }>;
5
+ }
6
+
7
+ const textColorGroups: TextColorGroup[] = [
8
+ {
9
+ title: 'Base Text Colors',
10
+ colors: [
11
+ { name: 'Primary', variable: '--text-primary', description: 'Main text color' },
12
+ { name: 'Secondary', variable: '--text-secondary', description: 'Less prominent text' },
13
+ { name: 'Tertiary', variable: '--text-tertiary', description: 'Subtle text' },
14
+ { name: 'Muted', variable: '--text-muted', description: 'De-emphasized text' },
15
+ { name: 'Disabled', variable: '--text-disabled', description: 'Disabled state text' },
16
+ { name: 'Inverted', variable: '--text-inverted', description: 'Dark text for light backgrounds' }
17
+ ]
18
+ },
19
+ {
20
+ title: 'Primary Text Colors (Crimson)',
21
+ colors: [
22
+ { name: 'Primary', variable: '--text-primary-color', description: 'Primary - Main text color' },
23
+ { name: 'Primary Secondary', variable: '--text-primary-secondary', description: 'Secondary - Less prominent' },
24
+ { name: 'Primary Tertiary', variable: '--text-primary-tertiary', description: 'Tertiary - Subtle text' },
25
+ { name: 'Primary Muted', variable: '--text-primary-muted', description: 'Muted - De-emphasized' },
26
+ { name: 'Primary Disabled', variable: '--text-primary-disabled', description: 'Disabled - Disabled state' }
27
+ ]
28
+ },
29
+ {
30
+ title: 'Accent Text Colors (Amber)',
31
+ colors: [
32
+ { name: 'Accent', variable: '--text-accent', description: 'Primary - Main text color' },
33
+ { name: 'Accent Secondary', variable: '--text-accent-secondary', description: 'Secondary - Less prominent' },
34
+ { name: 'Accent Tertiary', variable: '--text-accent-tertiary', description: 'Tertiary - Subtle text' },
35
+ { name: 'Accent Muted', variable: '--text-accent-muted', description: 'Muted - De-emphasized' },
36
+ { name: 'Accent Disabled', variable: '--text-accent-disabled', description: 'Disabled - Disabled state' }
37
+ ]
38
+ },
39
+ {
40
+ title: 'Success Text Colors',
41
+ colors: [
42
+ { name: 'Success', variable: '--text-success', description: 'Primary - Main text color' },
43
+ { name: 'Success Secondary', variable: '--text-success-secondary', description: 'Secondary - Less prominent' },
44
+ { name: 'Success Tertiary', variable: '--text-success-tertiary', description: 'Tertiary - Subtle text' },
45
+ { name: 'Success Muted', variable: '--text-success-muted', description: 'Muted - De-emphasized' },
46
+ { name: 'Success Disabled', variable: '--text-success-disabled', description: 'Disabled - Disabled state' }
47
+ ]
48
+ },
49
+ {
50
+ title: 'Warning Text Colors',
51
+ colors: [
52
+ { name: 'Warning', variable: '--text-warning', description: 'Primary - Main text color' },
53
+ { name: 'Warning Secondary', variable: '--text-warning-secondary', description: 'Secondary - Less prominent' },
54
+ { name: 'Warning Tertiary', variable: '--text-warning-tertiary', description: 'Tertiary - Subtle text' },
55
+ { name: 'Warning Muted', variable: '--text-warning-muted', description: 'Muted - De-emphasized' },
56
+ { name: 'Warning Disabled', variable: '--text-warning-disabled', description: 'Disabled - Disabled state' }
57
+ ]
58
+ },
59
+ {
60
+ title: 'Info Text Colors',
61
+ colors: [
62
+ { name: 'Info', variable: '--text-info', description: 'Primary - Main text color' },
63
+ { name: 'Info Secondary', variable: '--text-info-secondary', description: 'Secondary - Less prominent' },
64
+ { name: 'Info Tertiary', variable: '--text-info-tertiary', description: 'Tertiary - Subtle text' },
65
+ { name: 'Info Muted', variable: '--text-info-muted', description: 'Muted - De-emphasized' },
66
+ { name: 'Info Disabled', variable: '--text-info-disabled', description: 'Disabled - Disabled state' }
67
+ ]
68
+ },
69
+ {
70
+ title: 'Danger Text Colors',
71
+ colors: [
72
+ { name: 'Danger', variable: '--text-danger', description: 'Primary - Main text color' },
73
+ { name: 'Danger Secondary', variable: '--text-danger-secondary', description: 'Secondary - Less prominent' },
74
+ { name: 'Danger Tertiary', variable: '--text-danger-tertiary', description: 'Tertiary - Subtle text' },
75
+ { name: 'Danger Muted', variable: '--text-danger-muted', description: 'Muted - De-emphasized' },
76
+ { name: 'Danger Disabled', variable: '--text-danger-disabled', description: 'Disabled - Disabled state' }
77
+ ]
78
+ }
79
+ ];
80
+
81
+ let copiedVar: string | null = null;
82
+ function copyVariable(v: string) {
83
+ navigator.clipboard.writeText(v);
84
+ copiedVar = v;
85
+ setTimeout(() => { copiedVar = null; }, 1000);
86
+ }
87
+ </script>
88
+
89
+ <div class="text-container">
90
+ {#each textColorGroups as group}
91
+ <section class="color-group">
92
+ <h3 class="group-title">{group.title}</h3>
93
+ <div class="text-colors-grid">
94
+ {#each group.colors as color}
95
+ <div class="text-color-card">
96
+ <div
97
+ class="text-color-preview"
98
+ style="color: var({color.variable});"
99
+ >
100
+ Ag
101
+ </div>
102
+ <div class="text-color-info">
103
+ <button class="text-color-name copyable" class:copied={copiedVar === color.variable} on:click={() => copyVariable(color.variable)}>{copiedVar === color.variable ? 'copied!' : color.name}</button>
104
+ <div class="text-color-variable">{color.variable}</div>
105
+ <div class="text-color-description">{color.description}</div>
106
+ </div>
107
+ </div>
108
+ {/each}
109
+ </div>
110
+ </section>
111
+ {/each}
112
+ </div>
113
+
114
+ <style>
115
+ @import '../styles/variables.css';
116
+
117
+ .text-container {
118
+ display: flex;
119
+ flex-direction: column;
120
+ gap: var(--space-24);
121
+ }
122
+
123
+ .color-group {
124
+ display: flex;
125
+ flex-direction: column;
126
+ gap: var(--space-12);
127
+ }
128
+
129
+ .group-title {
130
+ font-size: var(--font-sm);
131
+ font-weight: var(--font-weight-semibold);
132
+ color: var(--ui-text-secondary);
133
+ margin: 0;
134
+ padding-bottom: var(--space-4);
135
+ border-bottom: 1px solid var(--ui-border-faint);
136
+ }
137
+
138
+ .text-colors-grid {
139
+ display: grid;
140
+ grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
141
+ gap: var(--space-12);
142
+ }
143
+
144
+ .text-color-card {
145
+ background: var(--ui-surface-low);
146
+ border: 1px solid var(--ui-border-subtle);
147
+ border-radius: var(--radius-md);
148
+ padding: var(--space-12);
149
+ display: flex;
150
+ flex-direction: column;
151
+ gap: var(--space-8);
152
+ align-items: center;
153
+ }
154
+
155
+ .text-color-preview {
156
+ font-size: var(--font-4xl);
157
+ font-weight: var(--font-weight-bold);
158
+ line-height: 1;
159
+ }
160
+
161
+ .text-color-info {
162
+ display: flex;
163
+ flex-direction: column;
164
+ gap: var(--space-2);
165
+ align-items: center;
166
+ text-align: center;
167
+ }
168
+
169
+ .text-color-name {
170
+ font-size: var(--font-sm);
171
+ font-weight: var(--font-weight-semibold);
172
+ color: var(--ui-text-primary);
173
+ }
174
+
175
+ .text-color-name.copyable {
176
+ all: unset;
177
+ font-size: var(--font-sm);
178
+ font-weight: var(--font-weight-semibold);
179
+ color: var(--ui-text-primary);
180
+ cursor: pointer;
181
+ transition: color var(--transition-fast);
182
+ }
183
+
184
+ .text-color-name.copyable:hover {
185
+ color: var(--ui-text-accent);
186
+ }
187
+
188
+ .text-color-name.copyable.copied {
189
+ color: var(--ui-text-success);
190
+ }
191
+
192
+ .text-color-variable {
193
+ font-size: var(--font-xs);
194
+ color: var(--ui-text-tertiary);
195
+ font-family: var(--ui-font-mono);
196
+ background: var(--ui-surface-lowest);
197
+ padding: var(--space-2) var(--space-4);
198
+ border-radius: var(--radius-sm);
199
+ }
200
+
201
+ .text-color-description {
202
+ font-size: var(--font-xs);
203
+ color: var(--ui-text-muted);
204
+ }
205
+ </style>