@yunlefun/ui 0.1.0 → 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.
package/tokens/source.mjs CHANGED
@@ -4,7 +4,7 @@
4
4
  // =============================================================================
5
5
 
6
6
  export const ylfPalette = {
7
- blue: '#2563eb',
7
+ blue: '#006aeb',
8
8
  sun: '#facc15',
9
9
  cyan: '#06b6d4',
10
10
  coral: '#ff6b4a',
@@ -24,10 +24,26 @@ export const ylfAccentTones = /** @type {const} */ ([
24
24
  export const ylfStatusMap = /** @type {const} */ ({
25
25
  success: 'green',
26
26
  warning: 'sun',
27
- danger: 'coral',
28
27
  info: 'cyan',
29
28
  })
30
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
+
31
47
  export const ylfStatuses = /** @type {const} */ (['success', 'warning', 'danger', 'info'])
32
48
 
33
49
  export const ylfProfiles = /** @type {const} */ (['consumer', 'admin', 'editor'])
@@ -51,31 +67,31 @@ export const ylfCloudSilhouettes = {
51
67
  export const ylfBrand = {
52
68
  light: {
53
69
  'brand': 'var(--ylf-palette-blue)',
54
- 'brand-hover': '#1d4ed8',
55
- 'brand-active': '#1e40af',
56
- 'brand-soft': '#eff6ff',
70
+ 'brand-hover': '#0057c7',
71
+ 'brand-active': '#0047a6',
72
+ 'brand-soft': '#f0f7ff',
57
73
  },
58
74
  dark: {
59
- 'brand': '#60a5fa',
60
- 'brand-hover': '#93c5fd',
61
- 'brand-active': '#3b82f6',
62
- 'brand-soft': '#15264a',
75
+ 'brand': '#38acff',
76
+ 'brand-hover': '#73c5ff',
77
+ 'brand-active': '#1a95f0',
78
+ 'brand-soft': '#102845',
63
79
  },
64
80
  }
65
81
 
66
82
  export const ylfHero = {
67
- 'start': '#2563eb',
68
- 'middle': '#0f74b8',
69
- 'end': '#0369a1',
70
- 'hover-start': '#1d4ed8',
71
- 'hover-middle': '#096ba9',
72
- 'hover-end': '#075985',
83
+ 'start': 'var(--ylf-palette-blue)',
84
+ 'middle': '#005ed6',
85
+ 'end': '#0051bd',
86
+ 'hover-start': '#0057c7',
87
+ 'hover-middle': '#004db3',
88
+ 'hover-end': '#004199',
73
89
  'foreground': '#ffffff',
74
90
  'background': 'linear-gradient(115deg, var(--ylf-hero-start), var(--ylf-hero-middle) 58%, var(--ylf-hero-end))',
75
91
  'background-hover': 'linear-gradient(115deg, var(--ylf-hero-hover-start), var(--ylf-hero-hover-middle) 58%, var(--ylf-hero-hover-end))',
76
92
  'border': 'rgb(255 255 255 / 0.16)',
77
- 'shadow': 'inset 0 1px 0 rgb(255 255 255 / 0.24), 0 12px 26px -14px rgb(3 105 161 / 0.58)',
78
- 'shadow-hover': 'inset 0 1px 0 rgb(255 255 255 / 0.3), 0 14px 30px -14px rgb(3 105 161 / 0.58)',
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)',
79
95
  }
80
96
 
81
97
  export const ylfAccents = {
@@ -92,40 +108,40 @@ export const ylfAccents = {
92
108
  cyan: {
93
109
  light: {
94
110
  base: 'var(--ylf-palette-cyan)',
95
- hover: '#22d3ee',
111
+ hover: '#059cb8',
96
112
  soft: '#cffafe',
97
113
  text: '#155e75',
98
- on: '#083e4f',
114
+ on: '#032530',
99
115
  },
100
116
  dark: { soft: '#10313d', text: '#67e8f9' },
101
117
  },
102
118
  coral: {
103
119
  light: {
104
120
  base: 'var(--ylf-palette-coral)',
105
- hover: '#ff856b',
121
+ hover: '#ef5331',
106
122
  soft: '#ffede6',
107
123
  text: '#9a3412',
108
- on: '#551b0a',
124
+ on: '#3a0e03',
109
125
  },
110
126
  dark: { soft: '#39231f', text: '#fda48c' },
111
127
  },
112
128
  pink: {
113
129
  light: {
114
130
  base: 'var(--ylf-palette-pink)',
115
- hover: '#f472b6',
131
+ hover: '#e03588',
116
132
  soft: '#fce7f3',
117
133
  text: '#9d174d',
118
- on: '#400a2b',
134
+ on: '#240317',
119
135
  },
120
136
  dark: { soft: '#351e32', text: '#f9a8d4' },
121
137
  },
122
138
  green: {
123
139
  light: {
124
140
  base: 'var(--ylf-palette-green)',
125
- hover: '#4ade80',
141
+ hover: '#18a84e',
126
142
  soft: '#dcfce7',
127
143
  text: '#166534',
128
- on: '#124324',
144
+ on: '#052e16',
129
145
  },
130
146
  dark: { soft: '#142e26', text: '#86efac' },
131
147
  },
@@ -149,6 +165,7 @@ export const ylfNeutrals = {
149
165
  'text-on-accent': '#ffffff',
150
166
  'border': '#e2e8f0',
151
167
  'border-strong': '#cbd5e1',
168
+ 'border-control': '#7d8ca0',
152
169
  'overlay': 'rgba(13, 17, 32, 0.45)',
153
170
  },
154
171
  dark: {
@@ -168,6 +185,7 @@ export const ylfNeutrals = {
168
185
  'text-on-accent': '#0f172a',
169
186
  'border': '#24324a',
170
187
  'border-strong': '#36486a',
188
+ 'border-control': '#64748b',
171
189
  'overlay': 'rgba(2, 6, 15, 0.72)',
172
190
  },
173
191
  }
@@ -181,7 +199,7 @@ export const ylfGlass = {
181
199
  },
182
200
  dark: {
183
201
  'glass-bg': 'rgba(20, 29, 43, 0.9)',
184
- 'glass-border': 'rgba(96, 165, 250, 0.18)',
202
+ 'glass-border': 'rgba(56, 172, 255, 0.18)',
185
203
  },
186
204
  }
187
205
 
@@ -203,8 +221,8 @@ export const ylfShadow = {
203
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)',
204
222
  'shadow-inset': 'inset 0 1px 3px rgba(15, 23, 42, 0.08)',
205
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)',
206
- 'glow-brand': '0 6px 18px -8px rgba(37, 99, 235, 0.35)',
207
- 'glow-brand-hover': '0 8px 22px -8px rgba(37, 99, 235, 0.4)',
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)',
208
226
  },
209
227
  dark: {
210
228
  'shadow-sm': '0 2px 10px -2px rgba(2, 6, 15, 0.55)',
@@ -213,8 +231,8 @@ export const ylfShadow = {
213
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)',
214
232
  'shadow-inset': 'inset 0 1px 4px rgba(2, 6, 15, 0.4)',
215
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)',
216
- 'glow-brand': '0 6px 18px -8px rgba(96, 165, 250, 0.3)',
217
- 'glow-brand-hover': '0 8px 22px -8px rgba(96, 165, 250, 0.4)',
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)',
218
236
  },
219
237
  }
220
238
 
@@ -320,13 +338,13 @@ export const ylfReducedMotion = {
320
338
  export const ylfAtmosphere = {
321
339
  light: {
322
340
  'grid-size': '32px',
323
- 'c-grid': 'rgba(37, 99, 235, 0.06)',
324
- 'c-sky': '#dbeafe',
341
+ 'c-grid': 'rgba(0, 106, 235, 0.06)',
342
+ 'c-sky': '#d4ecff',
325
343
  'c-cloud': '#ffffff',
326
344
  },
327
345
  dark: {
328
- 'c-grid': 'rgba(96, 165, 250, 0.08)',
329
- 'c-sky': '#13233a',
346
+ 'c-grid': 'rgba(56, 172, 255, 0.08)',
347
+ 'c-sky': '#0e233d',
330
348
  'c-cloud': '#22304a',
331
349
  },
332
350
  }
@@ -413,6 +431,7 @@ export const ylfProfileTokens = {
413
431
  'placeholder': '#656e7b',
414
432
  'border': '#e1e5eb',
415
433
  'border-strong': '#c7cdd6',
434
+ 'border-control': '#7d8ca0',
416
435
  },
417
436
  dark: {
418
437
  'bg': '#111318',
@@ -424,6 +443,7 @@ export const ylfProfileTokens = {
424
443
  'placeholder': '#929cac',
425
444
  'border': '#303641',
426
445
  'border-strong': '#4d5869',
446
+ 'border-control': '#6a7587',
427
447
  },
428
448
  },
429
449
  editor: {
@@ -446,30 +466,32 @@ export const ylfProfileTokens = {
446
466
  'header': '44px',
447
467
  },
448
468
  light: {
449
- bg: '#f6f6f7',
450
- chrome: '#ebebed',
451
- panel: '#f6f6f7',
452
- field: '#ffffff',
453
- workspace: '#d7d7da',
454
- fg: '#292a2e',
455
- muted: '#5c5d65',
456
- border: 'rgb(25 25 30 / 13%)',
457
- accent: 'var(--ylf-c-brand, #2563eb)',
458
- selection: 'color-mix(in srgb, var(--ylf-editor-accent) 10%, transparent)',
459
- shadow: '0 1px 3px rgb(0 0 0 / 8%), 0 10px 28px -8px rgb(0 0 0 / 18%)',
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%)',
460
481
  },
461
482
  dark: {
462
- bg: '#242426',
463
- chrome: '#303033',
464
- panel: '#292a2d',
465
- field: '#353639',
466
- workspace: '#202123',
467
- fg: '#eeeef0',
468
- muted: '#b1b1b8',
469
- border: 'rgb(255 255 255 / 11%)',
470
- accent: 'var(--ylf-c-brand, #60a5fa)',
471
- selection: 'color-mix(in srgb, var(--ylf-editor-accent) 16%, transparent)',
472
- shadow: '0 1px 3px rgb(0 0 0 / 20%), 0 10px 28px -8px rgb(0 0 0 / 40%)',
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%)',
473
495
  },
474
496
  },
475
497
  }
@@ -530,7 +552,7 @@ export function buildBaseLightTokens() {
530
552
  tokens['--ylf-c-feature-bg'] = 'var(--ylf-accent-sun-soft)'
531
553
  tokens['--ylf-c-feature-text'] = 'var(--ylf-c-text)'
532
554
 
533
- Object.assign(tokens, buildStatusTokens())
555
+ Object.assign(tokens, buildStatusTokens('light', { includeBase: true }))
534
556
 
535
557
  for (const [key, value] of Object.entries(ylfNeutrals.light))
536
558
  tokens[`--ylf-c-${key}`] = value
@@ -598,7 +620,7 @@ export function buildThemeDerivedTokens(mode) {
598
620
  tokens[`--ylf-accent-${tone}-text`] = def[mode].text
599
621
  }
600
622
 
601
- Object.assign(tokens, buildStatusTokens())
623
+ Object.assign(tokens, buildStatusTokens(mode))
602
624
 
603
625
  tokens['--ylf-c-feature-bg'] = 'var(--ylf-accent-sun-soft)'
604
626
  tokens['--ylf-c-feature-text'] = 'var(--ylf-c-text)'
@@ -649,7 +671,7 @@ export function buildBrandAccentTokens() {
649
671
  }
650
672
  }
651
673
 
652
- export function buildStatusTokens() {
674
+ export function buildStatusTokens(mode = 'light', { includeBase = false } = {}) {
653
675
  const tokens = {}
654
676
  for (const [status, tone] of Object.entries(ylfStatusMap)) {
655
677
  tokens[`--ylf-status-${status}`] = `var(--ylf-accent-${tone})`
@@ -658,6 +680,15 @@ export function buildStatusTokens() {
658
680
  tokens[`--ylf-status-${status}-soft`] = `var(--ylf-accent-${tone}-soft)`
659
681
  tokens[`--ylf-status-${status}-text`] = `var(--ylf-accent-${tone}-text)`
660
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
+ }
661
692
  return tokens
662
693
  }
663
694
 
package/unocss.mjs CHANGED
@@ -121,6 +121,7 @@ export function presetYunlefun() {
121
121
  border: {
122
122
  DEFAULT: 'var(--ylf-c-border)',
123
123
  strong: 'var(--ylf-c-border-strong)',
124
+ control: 'var(--ylf-c-border-control)',
124
125
  edge: 'var(--ylf-c-edge)',
125
126
  },
126
127
  },