@yunlefun/ui 0.0.7 → 0.2.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.
@@ -0,0 +1,734 @@
1
+ // =============================================================================
2
+ // YunLeFun Design · Single Source of Truth for Design Tokens
3
+ // 晴空蓝为主,高饱和纯色点缀
4
+ // =============================================================================
5
+
6
+ export const ylfPalette = {
7
+ blue: '#006aeb',
8
+ sun: '#facc15',
9
+ cyan: '#06b6d4',
10
+ coral: '#ff6b4a',
11
+ pink: '#ec4899',
12
+ green: '#22c55e',
13
+ }
14
+
15
+ export const ylfAccentTones = /** @type {const} */ ([
16
+ 'blue',
17
+ 'sun',
18
+ 'cyan',
19
+ 'coral',
20
+ 'pink',
21
+ 'green',
22
+ ])
23
+
24
+ export const ylfStatusMap = /** @type {const} */ ({
25
+ success: 'green',
26
+ warning: 'sun',
27
+ info: 'cyan',
28
+ })
29
+
30
+ // Dedicated semantic status colors that stay distinct from category accents (e.g. danger vs coral events).
31
+ export const ylfStatusColors = {
32
+ danger: {
33
+ light: {
34
+ base: '#dc2626',
35
+ hover: '#b91c1c',
36
+ soft: '#fef2f2',
37
+ text: '#b91c1c',
38
+ on: '#ffffff',
39
+ },
40
+ dark: {
41
+ soft: '#3b151a',
42
+ text: '#fca5a5',
43
+ },
44
+ },
45
+ }
46
+
47
+ export const ylfStatuses = /** @type {const} */ (['success', 'warning', 'danger', 'info'])
48
+
49
+ export const ylfProfiles = /** @type {const} */ (['consumer', 'admin', 'editor'])
50
+
51
+ export const ylfCloudShapes = /** @type {const} */ ([
52
+ 'billow',
53
+ 'heap',
54
+ 'bank',
55
+ 'puff',
56
+ 'wisp',
57
+ ])
58
+
59
+ export const ylfCloudSilhouettes = {
60
+ billow: 'M 58 199 C 26 199 8 185 8 164 C 8 144 22 130 43 128 C 39 102 55 81 79 80 C 94 79 106 85 115 94 C 106 57 129 24 164 23 C 191 22 211 38 220 61 C 232 43 251 36 269 40 C 295 45 310 66 309 90 C 325 80 345 83 357 95 C 367 104 371 117 369 129 C 392 119 417 130 424 151 C 449 147 477 163 477 183 C 477 207 453 218 422 218 C 391 218 367 213 341 216 C 303 222 272 218 246 215 C 211 222 176 217 151 212 C 118 218 84 214 58 199 Z',
61
+ heap: 'M 40 205 C 14 205 4 190 10 174 C 16 158 34 152 52 156 C 50 126 74 106 102 112 C 112 78 150 62 182 76 C 198 44 240 30 274 46 C 302 30 344 38 360 66 C 392 58 424 78 426 108 C 456 110 482 132 480 162 C 486 190 466 208 436 210 C 380 214 330 212 280 214 C 220 216 160 214 110 212 C 84 212 60 208 40 205 Z',
62
+ bank: 'M 30 212 C 10 212 2 200 8 188 C 14 176 30 172 46 176 C 52 156 74 148 94 156 C 108 136 138 132 156 146 C 172 124 208 120 228 138 C 246 118 284 118 300 140 C 318 126 352 128 362 150 C 380 140 410 144 418 162 C 444 158 470 172 474 190 C 478 206 462 214 440 214 C 380 216 300 214 230 216 C 160 218 90 214 30 212 Z',
63
+ puff: 'M 120 210 C 88 210 70 192 76 170 C 82 150 102 142 122 148 C 120 112 150 86 186 90 C 204 60 250 52 278 76 C 300 64 336 74 344 104 C 376 102 404 126 400 156 C 412 182 396 210 366 212 C 300 214 220 214 120 210 Z',
64
+ wisp: 'M 20 200 C 6 200 2 190 10 184 C 18 178 30 178 40 180 C 52 166 80 162 98 170 C 120 156 160 154 182 166 C 206 152 248 150 270 164 C 296 152 336 154 352 168 C 376 160 410 162 426 174 C 452 170 482 178 484 190 C 486 202 470 206 446 206 C 380 208 300 206 230 208 C 160 210 80 206 20 200 Z',
65
+ }
66
+
67
+ export const ylfBrand = {
68
+ light: {
69
+ 'brand': 'var(--ylf-palette-blue)',
70
+ 'brand-hover': '#0057c7',
71
+ 'brand-active': '#0047a6',
72
+ 'brand-soft': '#f0f7ff',
73
+ },
74
+ dark: {
75
+ 'brand': '#38acff',
76
+ 'brand-hover': '#73c5ff',
77
+ 'brand-active': '#1a95f0',
78
+ 'brand-soft': '#102845',
79
+ },
80
+ }
81
+
82
+ export const ylfHero = {
83
+ 'start': 'var(--ylf-palette-blue)',
84
+ 'middle': '#005ed6',
85
+ 'end': '#0051bd',
86
+ 'hover-start': '#0057c7',
87
+ 'hover-middle': '#004db3',
88
+ 'hover-end': '#004199',
89
+ 'foreground': '#ffffff',
90
+ 'background': 'linear-gradient(115deg, var(--ylf-hero-start), var(--ylf-hero-middle) 58%, var(--ylf-hero-end))',
91
+ 'background-hover': 'linear-gradient(115deg, var(--ylf-hero-hover-start), var(--ylf-hero-hover-middle) 58%, var(--ylf-hero-hover-end))',
92
+ 'border': 'rgb(255 255 255 / 0.16)',
93
+ 'shadow': 'inset 0 1px 0 rgb(255 255 255 / 0.24), 0 12px 26px -14px rgb(0 81 189 / 0.58)',
94
+ 'shadow-hover': 'inset 0 1px 0 rgb(255 255 255 / 0.3), 0 14px 30px -14px rgb(0 81 189 / 0.58)',
95
+ }
96
+
97
+ export const ylfAccents = {
98
+ sun: {
99
+ light: {
100
+ base: 'var(--ylf-palette-sun)',
101
+ hover: '#eab308',
102
+ soft: '#fef9c3',
103
+ text: '#854d0e',
104
+ on: '#64380e',
105
+ },
106
+ dark: { soft: '#30290f', text: '#fde047' },
107
+ },
108
+ cyan: {
109
+ light: {
110
+ base: 'var(--ylf-palette-cyan)',
111
+ hover: '#059cb8',
112
+ soft: '#cffafe',
113
+ text: '#155e75',
114
+ on: '#032530',
115
+ },
116
+ dark: { soft: '#10313d', text: '#67e8f9' },
117
+ },
118
+ coral: {
119
+ light: {
120
+ base: 'var(--ylf-palette-coral)',
121
+ hover: '#ef5331',
122
+ soft: '#ffede6',
123
+ text: '#9a3412',
124
+ on: '#3a0e03',
125
+ },
126
+ dark: { soft: '#39231f', text: '#fda48c' },
127
+ },
128
+ pink: {
129
+ light: {
130
+ base: 'var(--ylf-palette-pink)',
131
+ hover: '#e03588',
132
+ soft: '#fce7f3',
133
+ text: '#9d174d',
134
+ on: '#240317',
135
+ },
136
+ dark: { soft: '#351e32', text: '#f9a8d4' },
137
+ },
138
+ green: {
139
+ light: {
140
+ base: 'var(--ylf-palette-green)',
141
+ hover: '#18a84e',
142
+ soft: '#dcfce7',
143
+ text: '#166534',
144
+ on: '#052e16',
145
+ },
146
+ dark: { soft: '#142e26', text: '#86efac' },
147
+ },
148
+ }
149
+
150
+ export const ylfNeutrals = {
151
+ light: {
152
+ 'bg': '#f8fafc',
153
+ 'bg-soft': '#f1f5f9',
154
+ 'bg-mute': '#e2e8f0',
155
+ 'surface': '#ffffff',
156
+ 'surface-raised': '#f6f9ff',
157
+ 'surface-inset': '#edf2f8',
158
+ 'highlight': 'rgba(255, 255, 255, 0.9)',
159
+ 'panel': 'rgba(255, 255, 255, 0.96)',
160
+ 'edge': 'rgba(30, 64, 115, 0.12)',
161
+ 'text': '#0f172a',
162
+ 'text-2': '#475569',
163
+ 'text-3': '#5a697e',
164
+ 'placeholder': 'var(--ylf-c-text-3)',
165
+ 'text-on-accent': '#ffffff',
166
+ 'border': '#e2e8f0',
167
+ 'border-strong': '#cbd5e1',
168
+ 'border-control': '#7d8ca0',
169
+ 'overlay': 'rgba(13, 17, 32, 0.45)',
170
+ },
171
+ dark: {
172
+ 'bg': '#0b111c',
173
+ 'bg-soft': '#101826',
174
+ 'bg-mute': '#22304a',
175
+ 'surface': '#141d2b',
176
+ 'surface-raised': '#1b2638',
177
+ 'surface-inset': '#080d16',
178
+ 'highlight': 'rgba(186, 214, 255, 0.1)',
179
+ 'panel': 'rgba(20, 29, 43, 0.96)',
180
+ 'edge': 'rgba(2, 6, 15, 0.55)',
181
+ 'text': '#e7eef8',
182
+ 'text-2': '#b9c6d9',
183
+ 'text-3': '#8d9db4',
184
+ 'placeholder': 'var(--ylf-c-text-3)',
185
+ 'text-on-accent': '#0f172a',
186
+ 'border': '#24324a',
187
+ 'border-strong': '#36486a',
188
+ 'border-control': '#64748b',
189
+ 'overlay': 'rgba(2, 6, 15, 0.72)',
190
+ },
191
+ }
192
+
193
+ export const ylfGlass = {
194
+ light: {
195
+ 'glass-bg': 'rgba(255, 255, 255, 0.82)',
196
+ 'glass-border': 'rgba(255, 255, 255, 0.7)',
197
+ 'glass-blur': 'saturate(160%) blur(16px)',
198
+ 'overlay-blur': 'saturate(85%) blur(10px)',
199
+ },
200
+ dark: {
201
+ 'glass-bg': 'rgba(20, 29, 43, 0.9)',
202
+ 'glass-border': 'rgba(56, 172, 255, 0.18)',
203
+ },
204
+ }
205
+
206
+ export const ylfRadius = {
207
+ '2xs': '4px',
208
+ 'xs': '6px',
209
+ 'sm': '10px',
210
+ 'DEFAULT': '14px',
211
+ 'lg': '20px',
212
+ 'xl': '28px',
213
+ 'pill': '999px',
214
+ }
215
+
216
+ export const ylfShadow = {
217
+ light: {
218
+ 'shadow-sm': '0 2px 8px -2px rgba(15, 23, 42, 0.12)',
219
+ 'shadow': '0 10px 28px -8px rgba(15, 23, 42, 0.16)',
220
+ 'shadow-lg': '0 22px 56px -14px rgba(15, 23, 42, 0.22)',
221
+ 'shadow-control': 'inset 0 1px 0 var(--ylf-c-highlight), 0 1px 2px rgba(15, 23, 42, 0.06), 0 3px 6px -4px rgba(15, 23, 42, 0.16)',
222
+ 'shadow-inset': 'inset 0 1px 3px rgba(15, 23, 42, 0.08)',
223
+ 'shadow-panel': 'inset 0 1px 0 var(--ylf-c-highlight), 0 0 0 1px var(--ylf-c-edge), 0 8px 16px -8px rgba(15, 23, 42, 0.14), 0 28px 64px -20px rgba(24, 52, 102, 0.24)',
224
+ 'glow-brand': '0 6px 18px -8px rgba(0, 106, 235, 0.35)',
225
+ 'glow-brand-hover': '0 8px 22px -8px rgba(0, 106, 235, 0.4)',
226
+ },
227
+ dark: {
228
+ 'shadow-sm': '0 2px 10px -2px rgba(2, 6, 15, 0.55)',
229
+ 'shadow': '0 12px 30px -8px rgba(2, 6, 15, 0.6)',
230
+ 'shadow-lg': '0 24px 60px -14px rgba(2, 6, 15, 0.65)',
231
+ 'shadow-control': 'inset 0 1px 0 var(--ylf-c-highlight), 0 1px 2px rgba(2, 6, 15, 0.3), 0 4px 8px -4px rgba(2, 6, 15, 0.35)',
232
+ 'shadow-inset': 'inset 0 1px 4px rgba(2, 6, 15, 0.4)',
233
+ 'shadow-panel': 'inset 0 1px 0 var(--ylf-c-highlight), 0 0 0 1px var(--ylf-c-edge), 0 10px 20px -8px rgba(2, 6, 15, 0.4), 0 32px 72px -18px rgba(2, 6, 15, 0.6)',
234
+ 'glow-brand': '0 6px 18px -8px rgba(56, 172, 255, 0.3)',
235
+ 'glow-brand-hover': '0 8px 22px -8px rgba(56, 172, 255, 0.4)',
236
+ },
237
+ }
238
+
239
+ export const ylfTypography = {
240
+ fontFamily: {
241
+ display: `'Baloo 2', 'ZCOOL KuaiLe', ui-rounded, 'Hiragino Maru Gothic ProN', 'Hiragino Maru Gothic Pro', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', sans-serif`,
242
+ wordmark: 'var(--ylf-font-display)',
243
+ heading: `ui-rounded, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', system-ui, sans-serif`,
244
+ body: `'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif`,
245
+ ui: `-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif`,
246
+ mono: `'SFMono-Regular', Consolas, 'Liberation Mono', monospace`,
247
+ },
248
+ fontSize: {
249
+ '2xs': '0.6875rem',
250
+ 'xs': '0.75rem',
251
+ 'sm': '0.875rem',
252
+ 'base': '1rem',
253
+ 'lg': '1.25rem',
254
+ 'xl': '1.5rem',
255
+ '2xl': '2rem',
256
+ 'display': 'clamp(2.25rem, 4.5vw, 4rem)',
257
+ },
258
+ lineHeight: {
259
+ heading: '1.25',
260
+ normal: '1.5',
261
+ body: '1.75',
262
+ },
263
+ }
264
+
265
+ export const ylfSpace = {
266
+ '0_5': '2px',
267
+ '1': '4px',
268
+ '1_5': '6px',
269
+ '2': '8px',
270
+ '3': '12px',
271
+ '4': '16px',
272
+ '5': '20px',
273
+ '6': '24px',
274
+ '8': '32px',
275
+ '10': '40px',
276
+ '12': '48px',
277
+ '16': '64px',
278
+ }
279
+
280
+ export const ylfLayout = {
281
+ page: '1200px',
282
+ reading: '720px',
283
+ }
284
+
285
+ export const ylfZIndex = {
286
+ base: '1',
287
+ sticky: '50',
288
+ overlay: '100',
289
+ modal: '101',
290
+ popover: '105',
291
+ tooltip: '110',
292
+ toast: '120',
293
+ }
294
+
295
+ export const ylfFocusAndControls = {
296
+ 'ring-width': '2px',
297
+ 'ring-offset': '2px',
298
+ 'ring-color': 'var(--ylf-c-brand)',
299
+ 'disabled-opacity': '0.48',
300
+ 'control-h-sm': '34px',
301
+ 'control-h': '44px',
302
+ 'control-h-lg': '48px',
303
+ 'control-h-xl': '56px',
304
+ 'control-radius-sm': 'var(--ylf-radius-sm)',
305
+ 'control-radius': 'var(--ylf-radius)',
306
+ 'panel-radius': 'var(--ylf-radius-lg)',
307
+ 'control-font-size-sm': '0.8125rem',
308
+ 'control-font-size': '0.9375rem',
309
+ }
310
+
311
+ export const ylfInteractionAndMotion = {
312
+ 'touch-target': '44px',
313
+ 'viewport-gutter': '16px',
314
+ 'duration-press': '100ms',
315
+ 'duration-enter': '240ms',
316
+ 'duration-exit': '160ms',
317
+ 'press-scale': '0.98',
318
+ 'hover-lift': '-1px',
319
+ 'duration-fast': '160ms',
320
+ 'duration-normal': '240ms',
321
+ 'duration-slow': '480ms',
322
+ 'ease-standard': 'cubic-bezier(0.2, 0, 0, 1)',
323
+ 'ease-bounce': 'cubic-bezier(0.34, 1.56, 0.64, 1)',
324
+ 'ease-spring': 'linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%, 1.067, 1.089 24.6%, 1.088 27.4%, 1.061 31.2%, 1.008 38.7%, 0.988 44.4%, 0.999 61.5%, 1)',
325
+ }
326
+
327
+ export const ylfReducedMotion = {
328
+ 'duration-press': '0ms',
329
+ 'duration-enter': '0ms',
330
+ 'duration-exit': '0ms',
331
+ 'press-scale': '1',
332
+ 'hover-lift': '0px',
333
+ 'duration-fast': '0ms',
334
+ 'duration-normal': '0ms',
335
+ 'duration-slow': '0ms',
336
+ }
337
+
338
+ export const ylfAtmosphere = {
339
+ light: {
340
+ 'grid-size': '32px',
341
+ 'c-grid': 'rgba(0, 106, 235, 0.06)',
342
+ 'c-sky': '#d4ecff',
343
+ 'c-cloud': '#ffffff',
344
+ },
345
+ dark: {
346
+ 'c-grid': 'rgba(56, 172, 255, 0.08)',
347
+ 'c-sky': '#0e233d',
348
+ 'c-cloud': '#22304a',
349
+ },
350
+ }
351
+
352
+ export const ylfCloud = {
353
+ light: {
354
+ 'highlight': '#fffefa',
355
+ 'body': '#f2f8ff',
356
+ 'shade': '#c6dff5',
357
+ 'shadow': '#83addb',
358
+ 'rim': '#ffffff',
359
+ 'face': '#5a7fae',
360
+ 'haze-color': '#9cc6ef',
361
+ },
362
+ dark: {
363
+ 'highlight': '#a6bcd8',
364
+ 'body': '#3e5679',
365
+ 'shade': '#1c2b44',
366
+ 'shadow': '#0a1424',
367
+ 'rim': '#cfdff2',
368
+ 'face': '#0e1a2d',
369
+ 'haze-color': '#1f3354',
370
+ },
371
+ }
372
+
373
+ export const ylfCompat = {
374
+ light: {
375
+ 'aurora-sky': 'var(--ylf-accent-cyan)',
376
+ 'aurora-iris': 'var(--ylf-accent-coral)',
377
+ 'aurora-pink': 'var(--ylf-accent-pink)',
378
+ 'gradient-aurora': 'linear-gradient(var(--ylf-accent-sun), var(--ylf-accent-sun))',
379
+ 'gradient-brand': 'linear-gradient(var(--ylf-c-brand), var(--ylf-c-brand))',
380
+ 'c-text-on-aurora': 'var(--ylf-accent-sun-on)',
381
+ 'glow-aurora': 'var(--ylf-shadow-sm)',
382
+ 'glow-aurora-hover': 'var(--ylf-shadow-sm)',
383
+ 'c-primary': 'var(--ylf-c-brand)',
384
+ 'c-text-light': 'var(--ylf-c-text-2)',
385
+ 'c-text-lighter': 'var(--ylf-c-text-3)',
386
+ 'c-text-lightest': 'var(--ylf-c-border-strong)',
387
+ 'c-bg-light': 'var(--ylf-c-bg-soft)',
388
+ 'c-bg-lighter': 'var(--ylf-c-bg-mute)',
389
+ },
390
+ // Re-declare derived aliases on dark boundaries so local .ylf-theme-dark wrappers resolve dark values.
391
+ dark: {
392
+ 'c-success': 'var(--ylf-status-success-text)',
393
+ 'c-warning': 'var(--ylf-status-warning-text)',
394
+ 'c-danger': 'var(--ylf-status-danger-text)',
395
+ 'c-info': 'var(--ylf-status-info-text)',
396
+ 'gradient-brand': 'linear-gradient(var(--ylf-c-brand), var(--ylf-c-brand))',
397
+ 'glow-aurora': 'var(--ylf-shadow-sm)',
398
+ 'glow-aurora-hover': 'var(--ylf-shadow-sm)',
399
+ 'c-primary': 'var(--ylf-c-brand)',
400
+ 'c-text-light': 'var(--ylf-c-text-2)',
401
+ 'c-text-lighter': 'var(--ylf-c-text-3)',
402
+ 'c-text-lightest': 'var(--ylf-c-border-strong)',
403
+ 'c-bg-light': 'var(--ylf-c-bg-soft)',
404
+ 'c-bg-lighter': 'var(--ylf-c-bg-mute)',
405
+ },
406
+ }
407
+
408
+ export const ylfProfileTokens = {
409
+ admin: {
410
+ base: {
411
+ 'font': 'var(--ylf-font-ui, -apple-system, BlinkMacSystemFont, \'Segoe UI\', \'PingFang SC\', \'Hiragino Sans GB\', \'Microsoft YaHei\', system-ui, sans-serif)',
412
+ 'control-sm': '28px',
413
+ 'control': '32px',
414
+ 'control-lg': '40px',
415
+ 'radius': '6px',
416
+ 'panel-radius': '10px',
417
+ 'icon-gap': '8px',
418
+ },
419
+ coarse: {
420
+ 'control-sm': '40px',
421
+ 'control': '44px',
422
+ 'control-lg': '48px',
423
+ },
424
+ light: {
425
+ 'bg': '#f6f7f9',
426
+ 'surface': '#ffffff',
427
+ 'raised': '#f0f2f5',
428
+ 'inset': '#f8f9fb',
429
+ 'fg': '#20242c',
430
+ 'muted': '#626b78',
431
+ 'placeholder': '#656e7b',
432
+ 'border': '#e1e5eb',
433
+ 'border-strong': '#c7cdd6',
434
+ 'border-control': '#7d8ca0',
435
+ },
436
+ dark: {
437
+ 'bg': '#111318',
438
+ 'surface': '#191c22',
439
+ 'raised': '#252a33',
440
+ 'inset': '#15181e',
441
+ 'fg': '#eef1f6',
442
+ 'muted': '#aab2c0',
443
+ 'placeholder': '#929cac',
444
+ 'border': '#303641',
445
+ 'border-strong': '#4d5869',
446
+ 'border-control': '#6a7587',
447
+ },
448
+ },
449
+ editor: {
450
+ base: {
451
+ 'font': 'var(--ylf-font-ui, -apple-system, BlinkMacSystemFont, \'Segoe UI\', \'PingFang SC\', \'Hiragino Sans GB\', \'Microsoft YaHei\', system-ui, sans-serif)',
452
+ 'text': '12px',
453
+ 'caption': '11px',
454
+ 'control-sm': '24px',
455
+ 'control': '28px',
456
+ 'row': '32px',
457
+ 'header': '32px',
458
+ 'radius': '5px',
459
+ 'panel-radius': '10px',
460
+ 'panel-width': '272px',
461
+ },
462
+ coarse: {
463
+ 'control-sm': '40px',
464
+ 'control': '40px',
465
+ 'row': '44px',
466
+ 'header': '44px',
467
+ },
468
+ light: {
469
+ 'bg': '#f6f6f7',
470
+ 'chrome': '#ebebed',
471
+ 'panel': '#f6f6f7',
472
+ 'field': '#ffffff',
473
+ 'workspace': '#d7d7da',
474
+ 'fg': '#292a2e',
475
+ 'muted': '#5c5d65',
476
+ 'border': 'rgb(25 25 30 / 13%)',
477
+ 'border-control': '#82848d',
478
+ 'accent': 'var(--ylf-c-brand, #006aeb)',
479
+ 'selection': 'color-mix(in srgb, var(--ylf-editor-accent) 10%, transparent)',
480
+ 'shadow': '0 1px 3px rgb(0 0 0 / 8%), 0 10px 28px -8px rgb(0 0 0 / 18%)',
481
+ },
482
+ dark: {
483
+ 'bg': '#242426',
484
+ 'chrome': '#303033',
485
+ 'panel': '#292a2d',
486
+ 'field': '#353639',
487
+ 'workspace': '#202123',
488
+ 'fg': '#eeeef0',
489
+ 'muted': '#b1b1b8',
490
+ 'border': 'rgb(255 255 255 / 11%)',
491
+ 'border-control': '#82848d',
492
+ 'accent': 'var(--ylf-c-brand, #38acff)',
493
+ 'selection': 'color-mix(in srgb, var(--ylf-editor-accent) 16%, transparent)',
494
+ 'shadow': '0 1px 3px rgb(0 0 0 / 20%), 0 10px 28px -8px rgb(0 0 0 / 40%)',
495
+ },
496
+ },
497
+ }
498
+
499
+ // Documented component hook tokens consumed by @yunlefun/vue components.
500
+ export const ylfComponentTokenNames = /** @type {const} */ ([
501
+ '--ylf-ai-accent',
502
+ '--ylf-ai-action-size',
503
+ '--ylf-ai-background',
504
+ '--ylf-ai-border',
505
+ '--ylf-ai-columns',
506
+ '--ylf-ai-gap',
507
+ '--ylf-ai-item-gap',
508
+ '--ylf-ai-item-height',
509
+ '--ylf-ai-item-padding',
510
+ '--ylf-ai-logo-size',
511
+ '--ylf-ai-muted',
512
+ '--ylf-ai-name-size',
513
+ '--ylf-ai-radius',
514
+ '--ylf-ai-surface',
515
+ '--ylf-ai-text',
516
+ '--ylf-bottom-menu-c-bg',
517
+ '--ylf-cloud-face-opacity',
518
+ '--ylf-cloud-haze',
519
+ '--ylf-scroll-fade-size',
520
+ '--ylf-scroll-fade-surface',
521
+ '--ylf-segmented-item-size',
522
+ ])
523
+
524
+ export function buildBaseLightTokens() {
525
+ const tokens = {}
526
+
527
+ for (const [tone, value] of Object.entries(ylfPalette))
528
+ tokens[`--ylf-palette-${tone}`] = value
529
+
530
+ tokens['--ylf-spectrum-stops']
531
+ = 'var(--ylf-palette-blue) 0% 16.667%, var(--ylf-palette-cyan) 16.667% 33.333%, var(--ylf-palette-green) 33.333% 50%, var(--ylf-palette-sun) 50% 66.667%, var(--ylf-palette-coral) 66.667% 83.333%, var(--ylf-palette-pink) 83.333% 100%'
532
+
533
+ tokens['--ylf-c-brand'] = ylfBrand.light.brand
534
+ tokens['--ylf-c-brand-hover'] = ylfBrand.light['brand-hover']
535
+ tokens['--ylf-c-brand-active'] = ylfBrand.light['brand-active']
536
+ tokens['--ylf-c-brand-soft'] = ylfBrand.light['brand-soft']
537
+
538
+ Object.assign(tokens, buildBrandAccentTokens())
539
+
540
+ for (const [key, value] of Object.entries(ylfHero))
541
+ tokens[`--ylf-hero-${key}`] = value
542
+
543
+ for (const [tone, def] of Object.entries(ylfAccents)) {
544
+ tokens[`--ylf-accent-${tone}`] = def.light.base
545
+ tokens[`--ylf-accent-${tone}-hover`] = def.light.hover
546
+ tokens[`--ylf-accent-${tone}-soft`] = def.light.soft
547
+ tokens[`--ylf-accent-${tone}-text`] = def.light.text
548
+ tokens[`--ylf-accent-${tone}-on`] = def.light.on
549
+ }
550
+
551
+ tokens['--ylf-c-feature'] = 'var(--ylf-accent-sun)'
552
+ tokens['--ylf-c-feature-bg'] = 'var(--ylf-accent-sun-soft)'
553
+ tokens['--ylf-c-feature-text'] = 'var(--ylf-c-text)'
554
+
555
+ Object.assign(tokens, buildStatusTokens('light', { includeBase: true }))
556
+
557
+ for (const [key, value] of Object.entries(ylfNeutrals.light))
558
+ tokens[`--ylf-c-${key}`] = value
559
+
560
+ for (const [key, value] of Object.entries(ylfGlass.light))
561
+ tokens[`--ylf-${key}`] = value
562
+
563
+ for (const [key, value] of Object.entries(ylfRadius)) {
564
+ const suffix = key === 'DEFAULT'
565
+ ? ''
566
+ : `-${key}`
567
+ tokens[`--ylf-radius${suffix}`] = value
568
+ }
569
+
570
+ for (const [key, value] of Object.entries(ylfShadow.light))
571
+ tokens[`--ylf-${key}`] = value
572
+
573
+ for (const [key, value] of Object.entries(ylfTypography.fontFamily))
574
+ tokens[`--ylf-font-${key}`] = value
575
+
576
+ for (const [key, value] of Object.entries(ylfTypography.fontSize))
577
+ tokens[`--ylf-text-${key}`] = value
578
+
579
+ for (const [key, value] of Object.entries(ylfTypography.lineHeight))
580
+ tokens[`--ylf-leading-${key}`] = value
581
+
582
+ for (const [key, value] of Object.entries(ylfSpace))
583
+ tokens[`--ylf-space-${key}`] = value
584
+
585
+ for (const [key, value] of Object.entries(ylfLayout))
586
+ tokens[`--ylf-layout-${key}`] = value
587
+
588
+ for (const [key, value] of Object.entries(ylfZIndex))
589
+ tokens[`--ylf-z-${key}`] = value
590
+
591
+ for (const [key, value] of Object.entries(ylfFocusAndControls))
592
+ tokens[`--ylf-${key}`] = value
593
+
594
+ for (const [key, value] of Object.entries(ylfAtmosphere.light))
595
+ tokens[`--ylf-${key}`] = value
596
+
597
+ for (const [key, value] of Object.entries(ylfCloud.light))
598
+ tokens[`--ylf-cloud-${key}`] = value
599
+
600
+ for (const [key, value] of Object.entries(ylfInteractionAndMotion))
601
+ tokens[`--ylf-${key}`] = value
602
+
603
+ return tokens
604
+ }
605
+
606
+ export function buildThemeDerivedTokens(mode) {
607
+ const tokens = {}
608
+ const brand = ylfBrand[mode]
609
+ const neutrals = ylfNeutrals[mode]
610
+
611
+ tokens['--ylf-c-brand'] = brand.brand
612
+ tokens['--ylf-c-brand-hover'] = brand['brand-hover']
613
+ tokens['--ylf-c-brand-active'] = brand['brand-active']
614
+ tokens['--ylf-c-brand-soft'] = brand['brand-soft']
615
+
616
+ Object.assign(tokens, buildBrandAccentTokens())
617
+
618
+ for (const [tone, def] of Object.entries(ylfAccents)) {
619
+ tokens[`--ylf-accent-${tone}-soft`] = def[mode].soft
620
+ tokens[`--ylf-accent-${tone}-text`] = def[mode].text
621
+ }
622
+
623
+ Object.assign(tokens, buildStatusTokens(mode))
624
+
625
+ tokens['--ylf-c-feature-bg'] = 'var(--ylf-accent-sun-soft)'
626
+ tokens['--ylf-c-feature-text'] = 'var(--ylf-c-text)'
627
+ tokens['--ylf-c-text-on-accent'] = neutrals['text-on-accent']
628
+ tokens['--ylf-c-bg-mute'] = neutrals['bg-mute']
629
+ tokens['--ylf-c-panel'] = neutrals.panel
630
+ tokens['--ylf-c-highlight'] = neutrals.highlight
631
+ tokens['--ylf-c-edge'] = neutrals.edge
632
+ tokens['--ylf-c-overlay'] = neutrals.overlay
633
+ tokens['--ylf-ring-color'] = 'var(--ylf-c-brand)'
634
+
635
+ for (const key of ['glass-bg', 'glass-border'])
636
+ tokens[`--ylf-${key}`] = ylfGlass[mode][key]
637
+
638
+ for (const [key, value] of Object.entries(ylfShadow[mode]))
639
+ tokens[`--ylf-${key}`] = value
640
+
641
+ return tokens
642
+ }
643
+
644
+ export function buildBaseDarkTokens() {
645
+ const tokens = buildThemeDerivedTokens('dark')
646
+
647
+ for (const [key, value] of Object.entries(ylfNeutrals.dark))
648
+ tokens[`--ylf-c-${key}`] = value
649
+
650
+ for (const [key, value] of Object.entries(ylfAtmosphere.dark))
651
+ tokens[`--ylf-${key}`] = value
652
+
653
+ for (const [key, value] of Object.entries(ylfCloud.dark))
654
+ tokens[`--ylf-cloud-${key}`] = value
655
+
656
+ return tokens
657
+ }
658
+
659
+ export function buildBrandAccentTokens() {
660
+ return {
661
+ '--ylf-accent-blue': 'var(--ylf-c-brand)',
662
+ '--ylf-accent-blue-hover': 'var(--ylf-c-brand-hover)',
663
+ '--ylf-accent-blue-soft': 'var(--ylf-c-brand-soft)',
664
+ '--ylf-accent-blue-text': 'var(--ylf-c-brand)',
665
+ '--ylf-accent-blue-on': 'var(--ylf-c-text-on-accent)',
666
+ '--ylf-accent': 'var(--ylf-accent-blue)',
667
+ '--ylf-accent-hover': 'var(--ylf-accent-blue-hover)',
668
+ '--ylf-accent-soft': 'var(--ylf-accent-blue-soft)',
669
+ '--ylf-accent-text': 'var(--ylf-accent-blue-text)',
670
+ '--ylf-accent-on': 'var(--ylf-accent-blue-on)',
671
+ }
672
+ }
673
+
674
+ export function buildStatusTokens(mode = 'light', { includeBase = false } = {}) {
675
+ const tokens = {}
676
+ for (const [status, tone] of Object.entries(ylfStatusMap)) {
677
+ tokens[`--ylf-status-${status}`] = `var(--ylf-accent-${tone})`
678
+ tokens[`--ylf-status-${status}-hover`] = `var(--ylf-accent-${tone}-hover)`
679
+ tokens[`--ylf-status-${status}-on`] = `var(--ylf-accent-${tone}-on)`
680
+ tokens[`--ylf-status-${status}-soft`] = `var(--ylf-accent-${tone}-soft)`
681
+ tokens[`--ylf-status-${status}-text`] = `var(--ylf-accent-${tone}-text)`
682
+ }
683
+ for (const [status, def] of Object.entries(ylfStatusColors)) {
684
+ if (includeBase) {
685
+ tokens[`--ylf-status-${status}`] = def.light.base
686
+ tokens[`--ylf-status-${status}-hover`] = def.light.hover
687
+ tokens[`--ylf-status-${status}-on`] = def.light.on
688
+ }
689
+ tokens[`--ylf-status-${status}-soft`] = def[mode].soft
690
+ tokens[`--ylf-status-${status}-text`] = def[mode].text
691
+ }
692
+ return tokens
693
+ }
694
+
695
+ export function buildCompatLightTokens() {
696
+ const tokens = {}
697
+ for (const status of ylfStatuses)
698
+ tokens[`--ylf-c-${status}`] = `var(--ylf-status-${status}-text)`
699
+ for (const [key, value] of Object.entries(ylfCompat.light))
700
+ tokens[`--ylf-${key}`] = value
701
+ return tokens
702
+ }
703
+
704
+ export function buildCompatDarkTokens() {
705
+ const tokens = {}
706
+ for (const [key, value] of Object.entries(ylfCompat.dark))
707
+ tokens[`--ylf-${key}`] = value
708
+ return tokens
709
+ }
710
+
711
+ export function buildAllTokenNames() {
712
+ const core = new Set(Object.keys(buildBaseLightTokens()))
713
+ for (const key of Object.keys(ylfProfileTokens.admin.base))
714
+ core.add(`--ylf-admin-${key}`)
715
+ for (const key of Object.keys(ylfProfileTokens.admin.light))
716
+ core.add(`--ylf-admin-${key}`)
717
+ for (const key of Object.keys(ylfProfileTokens.editor.base))
718
+ core.add(`--ylf-editor-${key}`)
719
+ for (const key of Object.keys(ylfProfileTokens.editor.light))
720
+ core.add(`--ylf-editor-${key}`)
721
+
722
+ const compat = new Set([
723
+ ...Object.keys(buildCompatLightTokens()),
724
+ ...Object.keys(buildCompatDarkTokens()),
725
+ ])
726
+
727
+ const component = new Set(ylfComponentTokenNames)
728
+
729
+ return {
730
+ core: [...core].sort(),
731
+ compat: [...compat].sort(),
732
+ component: [...component].sort(),
733
+ }
734
+ }