@yunlefun/ui 0.1.0 → 0.3.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,8 @@ export const ylfNeutrals = {
149
165
  'text-on-accent': '#ffffff',
150
166
  'border': '#e2e8f0',
151
167
  'border-strong': '#cbd5e1',
168
+ 'border-control': '#cbd5e1',
169
+ 'border-indicator': '#7d8ca0',
152
170
  'overlay': 'rgba(13, 17, 32, 0.45)',
153
171
  },
154
172
  dark: {
@@ -168,6 +186,8 @@ export const ylfNeutrals = {
168
186
  'text-on-accent': '#0f172a',
169
187
  'border': '#24324a',
170
188
  'border-strong': '#36486a',
189
+ 'border-control': '#36486a',
190
+ 'border-indicator': '#64748b',
171
191
  'overlay': 'rgba(2, 6, 15, 0.72)',
172
192
  },
173
193
  }
@@ -181,7 +201,7 @@ export const ylfGlass = {
181
201
  },
182
202
  dark: {
183
203
  'glass-bg': 'rgba(20, 29, 43, 0.9)',
184
- 'glass-border': 'rgba(96, 165, 250, 0.18)',
204
+ 'glass-border': 'rgba(56, 172, 255, 0.18)',
185
205
  },
186
206
  }
187
207
 
@@ -200,21 +220,21 @@ export const ylfShadow = {
200
220
  'shadow-sm': '0 2px 8px -2px rgba(15, 23, 42, 0.12)',
201
221
  'shadow': '0 10px 28px -8px rgba(15, 23, 42, 0.16)',
202
222
  'shadow-lg': '0 22px 56px -14px rgba(15, 23, 42, 0.22)',
203
- '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)',
223
+ 'shadow-control': 'inset 0 1px 0 var(--ylf-c-highlight), 0 1px 2px rgba(15, 23, 42, 0.05)',
204
224
  'shadow-inset': 'inset 0 1px 3px rgba(15, 23, 42, 0.08)',
205
225
  '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)',
226
+ 'glow-brand': '0 6px 18px -8px rgba(0, 106, 235, 0.35)',
227
+ 'glow-brand-hover': '0 8px 22px -8px rgba(0, 106, 235, 0.4)',
208
228
  },
209
229
  dark: {
210
230
  'shadow-sm': '0 2px 10px -2px rgba(2, 6, 15, 0.55)',
211
231
  'shadow': '0 12px 30px -8px rgba(2, 6, 15, 0.6)',
212
232
  'shadow-lg': '0 24px 60px -14px rgba(2, 6, 15, 0.65)',
213
- '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)',
233
+ 'shadow-control': 'inset 0 1px 0 var(--ylf-c-highlight), 0 1px 2px rgba(2, 6, 15, 0.28)',
214
234
  'shadow-inset': 'inset 0 1px 4px rgba(2, 6, 15, 0.4)',
215
235
  '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)',
236
+ 'glow-brand': '0 6px 18px -8px rgba(56, 172, 255, 0.3)',
237
+ 'glow-brand-hover': '0 8px 22px -8px rgba(56, 172, 255, 0.4)',
218
238
  },
219
239
  }
220
240
 
@@ -278,6 +298,8 @@ export const ylfFocusAndControls = {
278
298
  'ring-width': '2px',
279
299
  'ring-offset': '2px',
280
300
  'ring-color': 'var(--ylf-c-brand)',
301
+ 'ring-soft': 'color-mix(in srgb, var(--ylf-ring-color) 16%, transparent)',
302
+ 'shadow-focus': '0 0 0 3px var(--ylf-ring-soft)',
281
303
  'disabled-opacity': '0.48',
282
304
  'control-h-sm': '34px',
283
305
  'control-h': '44px',
@@ -320,13 +342,13 @@ export const ylfReducedMotion = {
320
342
  export const ylfAtmosphere = {
321
343
  light: {
322
344
  'grid-size': '32px',
323
- 'c-grid': 'rgba(37, 99, 235, 0.06)',
324
- 'c-sky': '#dbeafe',
345
+ 'c-grid': 'rgba(0, 106, 235, 0.06)',
346
+ 'c-sky': '#d4ecff',
325
347
  'c-cloud': '#ffffff',
326
348
  },
327
349
  dark: {
328
- 'c-grid': 'rgba(96, 165, 250, 0.08)',
329
- 'c-sky': '#13233a',
350
+ 'c-grid': 'rgba(56, 172, 255, 0.08)',
351
+ 'c-sky': '#0e233d',
330
352
  'c-cloud': '#22304a',
331
353
  },
332
354
  }
@@ -413,6 +435,8 @@ export const ylfProfileTokens = {
413
435
  'placeholder': '#656e7b',
414
436
  'border': '#e1e5eb',
415
437
  'border-strong': '#c7cdd6',
438
+ 'border-control': '#c7cdd6',
439
+ 'border-indicator': '#7d8ca0',
416
440
  },
417
441
  dark: {
418
442
  'bg': '#111318',
@@ -424,6 +448,8 @@ export const ylfProfileTokens = {
424
448
  'placeholder': '#929cac',
425
449
  'border': '#303641',
426
450
  'border-strong': '#4d5869',
451
+ 'border-control': '#4d5869',
452
+ 'border-indicator': '#6a7587',
427
453
  },
428
454
  },
429
455
  editor: {
@@ -446,30 +472,34 @@ export const ylfProfileTokens = {
446
472
  'header': '44px',
447
473
  },
448
474
  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%)',
475
+ 'bg': '#f6f6f7',
476
+ 'chrome': '#ebebed',
477
+ 'panel': '#f6f6f7',
478
+ 'field': '#ffffff',
479
+ 'workspace': '#d7d7da',
480
+ 'fg': '#292a2e',
481
+ 'muted': '#5c5d65',
482
+ 'border': 'rgb(25 25 30 / 13%)',
483
+ 'border-control': '#c9cad0',
484
+ 'border-indicator': '#82848d',
485
+ 'accent': 'var(--ylf-c-brand, #006aeb)',
486
+ 'selection': 'color-mix(in srgb, var(--ylf-editor-accent) 10%, transparent)',
487
+ 'shadow': '0 1px 3px rgb(0 0 0 / 8%), 0 10px 28px -8px rgb(0 0 0 / 18%)',
460
488
  },
461
489
  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%)',
490
+ 'bg': '#242426',
491
+ 'chrome': '#303033',
492
+ 'panel': '#292a2d',
493
+ 'field': '#353639',
494
+ 'workspace': '#202123',
495
+ 'fg': '#eeeef0',
496
+ 'muted': '#b1b1b8',
497
+ 'border': 'rgb(255 255 255 / 11%)',
498
+ 'border-control': '#4d4f58',
499
+ 'border-indicator': '#82848d',
500
+ 'accent': 'var(--ylf-c-brand, #38acff)',
501
+ 'selection': 'color-mix(in srgb, var(--ylf-editor-accent) 16%, transparent)',
502
+ 'shadow': '0 1px 3px rgb(0 0 0 / 20%), 0 10px 28px -8px rgb(0 0 0 / 40%)',
473
503
  },
474
504
  },
475
505
  }
@@ -530,7 +560,7 @@ export function buildBaseLightTokens() {
530
560
  tokens['--ylf-c-feature-bg'] = 'var(--ylf-accent-sun-soft)'
531
561
  tokens['--ylf-c-feature-text'] = 'var(--ylf-c-text)'
532
562
 
533
- Object.assign(tokens, buildStatusTokens())
563
+ Object.assign(tokens, buildStatusTokens('light', { includeBase: true }))
534
564
 
535
565
  for (const [key, value] of Object.entries(ylfNeutrals.light))
536
566
  tokens[`--ylf-c-${key}`] = value
@@ -598,7 +628,7 @@ export function buildThemeDerivedTokens(mode) {
598
628
  tokens[`--ylf-accent-${tone}-text`] = def[mode].text
599
629
  }
600
630
 
601
- Object.assign(tokens, buildStatusTokens())
631
+ Object.assign(tokens, buildStatusTokens(mode))
602
632
 
603
633
  tokens['--ylf-c-feature-bg'] = 'var(--ylf-accent-sun-soft)'
604
634
  tokens['--ylf-c-feature-text'] = 'var(--ylf-c-text)'
@@ -609,6 +639,8 @@ export function buildThemeDerivedTokens(mode) {
609
639
  tokens['--ylf-c-edge'] = neutrals.edge
610
640
  tokens['--ylf-c-overlay'] = neutrals.overlay
611
641
  tokens['--ylf-ring-color'] = 'var(--ylf-c-brand)'
642
+ tokens['--ylf-ring-soft'] = 'color-mix(in srgb, var(--ylf-ring-color) 16%, transparent)'
643
+ tokens['--ylf-shadow-focus'] = '0 0 0 3px var(--ylf-ring-soft)'
612
644
 
613
645
  for (const key of ['glass-bg', 'glass-border'])
614
646
  tokens[`--ylf-${key}`] = ylfGlass[mode][key]
@@ -649,7 +681,7 @@ export function buildBrandAccentTokens() {
649
681
  }
650
682
  }
651
683
 
652
- export function buildStatusTokens() {
684
+ export function buildStatusTokens(mode = 'light', { includeBase = false } = {}) {
653
685
  const tokens = {}
654
686
  for (const [status, tone] of Object.entries(ylfStatusMap)) {
655
687
  tokens[`--ylf-status-${status}`] = `var(--ylf-accent-${tone})`
@@ -658,6 +690,15 @@ export function buildStatusTokens() {
658
690
  tokens[`--ylf-status-${status}-soft`] = `var(--ylf-accent-${tone}-soft)`
659
691
  tokens[`--ylf-status-${status}-text`] = `var(--ylf-accent-${tone}-text)`
660
692
  }
693
+ for (const [status, def] of Object.entries(ylfStatusColors)) {
694
+ if (includeBase) {
695
+ tokens[`--ylf-status-${status}`] = def.light.base
696
+ tokens[`--ylf-status-${status}-hover`] = def.light.hover
697
+ tokens[`--ylf-status-${status}-on`] = def.light.on
698
+ }
699
+ tokens[`--ylf-status-${status}-soft`] = def[mode].soft
700
+ tokens[`--ylf-status-${status}-text`] = def[mode].text
701
+ }
661
702
  return tokens
662
703
  }
663
704
 
package/unocss.mjs CHANGED
@@ -64,6 +64,10 @@ export function presetYunlefun() {
64
64
  'shadow-control',
65
65
  { 'box-shadow': 'var(--ylf-shadow-control)' },
66
66
  ],
67
+ [
68
+ 'shadow-focus',
69
+ { 'box-shadow': 'var(--ylf-shadow-focus)' },
70
+ ],
67
71
  [
68
72
  'shadow-panel',
69
73
  { 'box-shadow': 'var(--ylf-shadow-panel)' },
@@ -121,6 +125,8 @@ export function presetYunlefun() {
121
125
  border: {
122
126
  DEFAULT: 'var(--ylf-c-border)',
123
127
  strong: 'var(--ylf-c-border-strong)',
128
+ control: 'var(--ylf-c-border-control)',
129
+ indicator: 'var(--ylf-c-border-indicator)',
124
130
  edge: 'var(--ylf-c-edge)',
125
131
  },
126
132
  },