@yunlefun/vue 0.7.0 → 0.8.1

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 (76) hide show
  1. package/README.md +5 -6
  2. package/components/YlfAccordion.vue +30 -29
  3. package/components/YlfAgentCard.vue +6 -6
  4. package/components/YlfAgentStatus.vue +5 -5
  5. package/components/YlfAgentTask.vue +4 -4
  6. package/components/YlfAiPromptLauncher.vue +19 -9
  7. package/components/YlfAvatar.vue +31 -31
  8. package/components/YlfBadge.vue +93 -74
  9. package/components/YlfBottomMenu.vue +5 -5
  10. package/components/YlfBottomMenuItem.vue +15 -15
  11. package/components/YlfButton.vue +307 -267
  12. package/components/YlfCard.vue +32 -32
  13. package/components/YlfCheckbox.vue +62 -55
  14. package/components/YlfCloud.vue +5 -18
  15. package/components/YlfDialog.vue +47 -46
  16. package/components/YlfDropdownMenu.vue +55 -57
  17. package/components/YlfInput.vue +24 -17
  18. package/components/YlfLogo.vue +58 -42
  19. package/components/YlfNavigation.vue +24 -24
  20. package/components/YlfNavigationLink.vue +58 -25
  21. package/components/YlfNavigationTrigger.vue +49 -21
  22. package/components/YlfPopover.vue +34 -31
  23. package/components/YlfProgress.vue +12 -8
  24. package/components/YlfRadioGroup.vue +73 -58
  25. package/components/YlfScrollFade.vue +1 -1
  26. package/components/YlfSegmentedControl.vue +22 -16
  27. package/components/YlfSelect.vue +83 -79
  28. package/components/YlfSeparator.vue +31 -26
  29. package/components/YlfSlider.vue +49 -46
  30. package/components/YlfSwitch.vue +68 -64
  31. package/components/YlfTabs.vue +32 -30
  32. package/components/YlfTooltip.vue +30 -27
  33. package/components/ai-prompt.ts +33 -6
  34. package/components/badge/index.md +2 -2
  35. package/components/button/index.md +2 -2
  36. package/components/cloud.ts +21 -1
  37. package/components/navigation-indicator.ts +9 -3
  38. package/components/scroll-fade.ts +3 -1
  39. package/components/segmented-control/demo.vue +9 -2
  40. package/dist/ag-ui.cjs +11 -2
  41. package/dist/ag-ui.mjs +11 -2
  42. package/dist/ai-prompt.cjs +30 -5
  43. package/dist/ai-prompt.mjs +30 -5
  44. package/dist/components/YlfAccordion.vue.d.ts +5 -3
  45. package/dist/components/YlfAgentCard.vue.d.ts +9 -7
  46. package/dist/components/YlfAgentTask.vue.d.ts +7 -5
  47. package/dist/components/YlfBadge.vue.d.ts +5 -4
  48. package/dist/components/YlfBottomMenu.vue.d.ts +5 -3
  49. package/dist/components/YlfBottomMenuItem.vue.d.ts +5 -3
  50. package/dist/components/YlfButton.vue.d.ts +7 -6
  51. package/dist/components/YlfCard.vue.d.ts +5 -4
  52. package/dist/components/YlfDialog.vue.d.ts +11 -9
  53. package/dist/components/YlfDropdownMenu.vue.d.ts +5 -3
  54. package/dist/components/YlfNavigation.vue.d.ts +5 -3
  55. package/dist/components/YlfNavigationLink.vue.d.ts +5 -3
  56. package/dist/components/YlfNavigationTrigger.vue.d.ts +5 -3
  57. package/dist/components/YlfPopover.vue.d.ts +7 -5
  58. package/dist/components/YlfProgress.vue.d.ts +0 -1
  59. package/dist/components/YlfScrollFade.vue.d.ts +5 -3
  60. package/dist/components/YlfSeparator.vue.d.ts +0 -1
  61. package/dist/components/YlfSwitch.vue.d.ts +0 -1
  62. package/dist/components/YlfTabs.vue.d.ts +5 -3
  63. package/dist/components/YlfTooltip.vue.d.ts +7 -5
  64. package/dist/components/cloud.d.ts +2 -0
  65. package/dist/index.cjs +20 -10
  66. package/dist/index.d.cts +3 -4
  67. package/dist/index.d.mts +3 -4
  68. package/dist/index.d.ts +3 -4
  69. package/dist/index.mjs +20 -8
  70. package/dist/node.cjs +11 -0
  71. package/dist/node.d.cts +4 -0
  72. package/dist/node.d.mts +4 -0
  73. package/dist/node.d.ts +4 -0
  74. package/dist/node.mjs +7 -0
  75. package/package.json +6 -3
  76. package/components/_navigation.scss +0 -38
package/README.md CHANGED
@@ -6,13 +6,12 @@ YunLeFun Design 的 Vue 组件实现,提供 `Ylf*` 组件与 Nuxt 集成。
6
6
 
7
7
  ```bash
8
8
  pnpm add @yunlefun/ui @yunlefun/vue
9
- pnpm add -D sass
10
9
  ```
11
10
 
12
- 在应用 SCSS 入口加载共享主题:
11
+ 在应用入口加载共享主题(原生 CSS,无需安装 `sass`):
13
12
 
14
- ```scss
15
- @use '@yunlefun/ui/styles';
13
+ ```ts
14
+ import '@yunlefun/ui/css'
16
15
  ```
17
16
 
18
17
  ## Vue / Vite
@@ -32,11 +31,11 @@ import YlfButton from '@yunlefun/vue/components/YlfButton.vue'
32
31
  ```ts
33
32
  export default defineNuxtConfig({
34
33
  modules: ['@yunlefun/vue/nuxt'],
35
- css: ['@yunlefun/ui/styles'],
34
+ css: ['@yunlefun/ui/css'],
36
35
  })
37
36
  ```
38
37
 
39
- 根入口目前提供类型和组件目录信息,组件通过 `components/*.vue` 子路径或 Nuxt 模块使用;没有公开的 `YlfResolver`。
38
+ 根入口 `@yunlefun/vue` 仅导出浏览器安全的类型声明,Node 路径信息(如 `componentsDir`)位于 `@yunlefun/vue/node`;组件通过 `components/*.vue` 子路径或 Nuxt 模块使用;没有公开的 `YlfResolver`。
40
39
 
41
40
  组件子路径提供预生成类型声明,运行时继续使用原始 SFC。现有 15 个 Reka UI 封装的验收范围见[组件验收](../guide/component-acceptance.md)。
42
41
 
@@ -53,7 +53,7 @@ const model = defineModel<string | string[]>()
53
53
  </AccordionRoot>
54
54
  </template>
55
55
 
56
- <style lang="scss">
56
+ <style>
57
57
  .ylf-accordion {
58
58
  border: 1px solid var(--ylf-c-border, #e2e8f0);
59
59
  border-radius: var(--ylf-radius, 14px);
@@ -78,45 +78,46 @@ const model = defineModel<string | string[]>()
78
78
  width: 100%;
79
79
  padding: 16px;
80
80
  font-family: inherit;
81
- font-size: 15px;
81
+ font-size: var(--ylf-control-font-size, 0.9375rem);
82
82
  font-weight: 500;
83
83
  text-align: left;
84
84
  color: var(--ylf-c-text, #0f172a);
85
85
  background: transparent;
86
86
  border: none;
87
87
  cursor: pointer;
88
- min-height: var(--ylf-touch-target, 44px);
88
+ min-height: var(--ylf-control-h, var(--ylf-touch-target, 44px));
89
89
  overflow-wrap: anywhere;
90
- transition: background var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, ease);
90
+ transition: background var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
91
+ }
91
92
 
92
- @media (hover: hover) and (pointer: fine) {
93
- &:hover {
94
- background: var(--ylf-c-bg-soft, #f1f5f9);
95
- }
93
+ @media (hover: hover) and (pointer: fine) {
94
+ .ylf-accordion__trigger:hover {
95
+ background: var(--ylf-c-bg-soft, #f1f5f9);
96
96
  }
97
+ }
97
98
 
98
- &[data-state='open'] {
99
- color: var(--ylf-c-brand, #2563eb);
100
- background: color-mix(in srgb, var(--ylf-c-brand-soft, #eff6ff) 60%, transparent);
101
- }
99
+ .ylf-accordion__trigger[data-state='open'] {
100
+ color: var(--ylf-c-brand, #006aeb);
101
+ background: color-mix(in srgb, var(--ylf-c-brand-soft, #f0f7ff) 60%, transparent);
102
+ }
102
103
 
103
- &[data-disabled] {
104
- opacity: 0.45;
105
- cursor: not-allowed;
106
- }
104
+ .ylf-accordion__trigger[data-disabled] {
105
+ opacity: var(--ylf-disabled-opacity, 0.48);
106
+ cursor: not-allowed;
107
+ }
107
108
 
108
- &:focus-visible {
109
- outline: none;
110
- box-shadow: inset 0 0 0 2px var(--ylf-c-brand, #2563eb);
111
- }
109
+ .ylf-accordion__trigger:focus-visible {
110
+ outline: var(--ylf-ring-width, 2px) solid transparent;
111
+ outline-offset: -2px;
112
+ box-shadow: inset 0 0 0 var(--ylf-ring-width, 2px) var(--ylf-ring-color, var(--ylf-c-brand, #006aeb));
112
113
  }
113
114
 
114
115
  .ylf-accordion__chevron {
115
116
  flex: none;
116
117
  width: 18px;
117
118
  height: 18px;
118
- color: var(--ylf-c-text-3, #64748b);
119
- transition: transform var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, ease);
119
+ color: var(--ylf-c-text-3, #5a697e);
120
+ transition: transform var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
120
121
  }
121
122
 
122
123
  .ylf-accordion__trigger[data-state='open'] .ylf-accordion__chevron {
@@ -125,17 +126,17 @@ const model = defineModel<string | string[]>()
125
126
 
126
127
  .ylf-accordion__content {
127
128
  overflow: hidden;
128
- font-size: 14px;
129
+ font-size: var(--ylf-text-sm, 0.875rem);
129
130
  line-height: 1.6;
130
131
  color: var(--ylf-c-text-2, #475569);
132
+ }
131
133
 
132
- &[data-state='open'] {
133
- animation: ylf-acc-down var(--ylf-duration-enter, 240ms) var(--ylf-ease-standard, ease);
134
- }
134
+ .ylf-accordion__content[data-state='open'] {
135
+ animation: ylf-acc-down var(--ylf-duration-enter, 240ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
136
+ }
135
137
 
136
- &[data-state='closed'] {
137
- animation: ylf-acc-up var(--ylf-duration-exit, 160ms) var(--ylf-ease-standard, ease);
138
- }
138
+ .ylf-accordion__content[data-state='closed'] {
139
+ animation: ylf-acc-up var(--ylf-duration-exit, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
139
140
  }
140
141
 
141
142
  .ylf-accordion__body {
@@ -48,10 +48,10 @@ const titleId = useId()
48
48
  min-width: 0;
49
49
  padding: var(--ylf-space-6, 24px);
50
50
  border: 1px solid var(--ylf-c-border, #e2e8f0);
51
- border-radius: var(--ylf-radius-lg, 20px);
51
+ border-radius: var(--ylf-panel-radius, var(--ylf-radius-lg, 20px));
52
52
  background: var(--ylf-c-surface, #fff);
53
53
  color: var(--ylf-c-text, #0f172a);
54
- box-shadow: var(--ylf-shadow-control, none);
54
+ box-shadow: var(--ylf-shadow-control);
55
55
  font-family: var(--ylf-font-body, inherit);
56
56
  }
57
57
  .ylf-agent-card__header {
@@ -67,8 +67,8 @@ const titleId = useId()
67
67
  width: 52px;
68
68
  height: 52px;
69
69
  border-radius: var(--ylf-radius, 14px);
70
- background: var(--ylf-c-brand-soft, #eff6ff);
71
- color: var(--ylf-c-brand, #2563eb);
70
+ background: var(--ylf-c-brand-soft, #f0f7ff);
71
+ color: var(--ylf-c-brand, #006aeb);
72
72
  }
73
73
  .ylf-agent-card__avatar svg {
74
74
  width: 32px;
@@ -81,14 +81,14 @@ const titleId = useId()
81
81
  .ylf-agent-card__name {
82
82
  margin: 0;
83
83
  font-family: var(--ylf-font-heading, inherit);
84
- font-size: var(--ylf-text-lg, 20px);
84
+ font-size: var(--ylf-text-lg, 1.25rem);
85
85
  line-height: var(--ylf-leading-heading, 1.25);
86
86
  overflow-wrap: anywhere;
87
87
  }
88
88
  .ylf-agent-card__description {
89
89
  margin: var(--ylf-space-2, 8px) 0 0;
90
90
  color: var(--ylf-c-text-2, #475569);
91
- font-size: var(--ylf-text-sm, 14px);
91
+ font-size: var(--ylf-text-sm, 0.875rem);
92
92
  line-height: 1.6;
93
93
  overflow-wrap: anywhere;
94
94
  }
@@ -31,7 +31,7 @@ withDefaults(defineProps<{
31
31
  background: var(--agent-surface);
32
32
  color: var(--agent-color);
33
33
  font-family: var(--ylf-font-body, inherit);
34
- font-size: var(--ylf-text-xs, 12px);
34
+ font-size: var(--ylf-text-xs, 0.75rem);
35
35
  line-height: 1.5;
36
36
  overflow-wrap: anywhere;
37
37
  }
@@ -41,16 +41,16 @@ withDefaults(defineProps<{
41
41
  }
42
42
  .ylf-agent-status[data-state='connecting'],
43
43
  .ylf-agent-status[data-state='working'] {
44
- --agent-color: var(--ylf-c-brand, #2563eb);
45
- --agent-surface: var(--ylf-c-brand-soft, #eff6ff);
44
+ --agent-color: var(--ylf-c-brand, #006aeb);
45
+ --agent-surface: var(--ylf-c-brand-soft, #f0f7ff);
46
46
  }
47
47
  .ylf-agent-status[data-state='waiting'] {
48
48
  --agent-color: var(--ylf-status-warning-text, #854d0e);
49
49
  --agent-surface: var(--ylf-status-warning-soft, #fef9c3);
50
50
  }
51
51
  .ylf-agent-status[data-state='error'] {
52
- --agent-color: var(--ylf-status-danger-text, #9a3412);
53
- --agent-surface: var(--ylf-status-danger-soft, #ffede6);
52
+ --agent-color: var(--ylf-status-danger-text, #b91c1c);
53
+ --agent-surface: var(--ylf-status-danger-soft, #fef2f2);
54
54
  }
55
55
  .ylf-agent-status__mark {
56
56
  flex: none;
@@ -53,7 +53,7 @@ const titleId = useId()
53
53
  }
54
54
  .ylf-agent-task__title {
55
55
  margin: 0;
56
- font-size: var(--ylf-text-sm, 14px);
56
+ font-size: var(--ylf-text-sm, 0.875rem);
57
57
  font-weight: 600;
58
58
  line-height: 1.5;
59
59
  overflow-wrap: anywhere;
@@ -61,15 +61,15 @@ const titleId = useId()
61
61
  .ylf-agent-task__id {
62
62
  display: block;
63
63
  margin-top: var(--ylf-space-3, 12px);
64
- font-family: var(--ylf-font-mono, monospace);
65
- font-size: var(--ylf-text-xs, 12px);
64
+ font-family: var(--ylf-font-mono, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace);
65
+ font-size: var(--ylf-text-xs, 0.75rem);
66
66
  color: var(--ylf-c-text-2, #475569);
67
67
  overflow-wrap: anywhere;
68
68
  }
69
69
  .ylf-agent-task__description {
70
70
  margin: var(--ylf-space-3, 12px) 0 0;
71
71
  color: var(--ylf-c-text-2, #475569);
72
- font-size: var(--ylf-text-sm, 14px);
72
+ font-size: var(--ylf-text-sm, 0.875rem);
73
73
  line-height: var(--ylf-leading-body, 1.75);
74
74
  overflow-wrap: anywhere;
75
75
  }
@@ -28,8 +28,14 @@ const expanded = shallowRef(false)
28
28
  const fallback = shallowRef<AiPromptTarget>()
29
29
  const manualPrompt = useTemplateRef<HTMLTextAreaElement>('manual-prompt')
30
30
  const unavailable = computed(() => props.disabled || busy.value || !props.prompt.trim())
31
- const targets = computed(() => [...new Set(props.providers ?? aiProviders.map(provider => provider.id))].map(provider => buildAiPromptTarget(provider, props.prompt, props.options)))
32
- const text = (zh: string, en: string) => props.locale === 'en' ? en : zh
31
+ const targets = computed(() => [
32
+ ...new Set(props.providers ?? aiProviders.map(provider => provider.id)),
33
+ ].map(provider => buildAiPromptTarget(provider, props.prompt, props.options)))
34
+ function text(zh: string, en: string) {
35
+ return props.locale === 'en'
36
+ ? en
37
+ : zh
38
+ }
33
39
  let revision = 0
34
40
  watch(() => props.prompt, () => {
35
41
  revision++
@@ -56,7 +62,9 @@ async function copyOnly() {
56
62
  const currentRevision = revision
57
63
  setBusy(true)
58
64
  try {
59
- await (props.copyText ? props.copyText(props.prompt) : navigator.clipboard.writeText(props.prompt))
65
+ await (props.copyText
66
+ ? props.copyText(props.prompt)
67
+ : navigator.clipboard.writeText(props.prompt))
60
68
  if (currentRevision === revision)
61
69
  message.value = text('提示词已复制,可粘贴到你常用的 AI。', 'Prompt copied. Paste it into your preferred AI.')
62
70
  }
@@ -89,7 +97,9 @@ async function open(event: MouseEvent, target: AiPromptTarget) {
89
97
  event.preventDefault()
90
98
  setBusy(true)
91
99
  try {
92
- const status = await (props.launch ? props.launch(target, prompt) : copyAndOpenAiPrompt(target, prompt))
100
+ const status = await (props.launch
101
+ ? props.launch(target, prompt)
102
+ : copyAndOpenAiPrompt(target, prompt))
93
103
  emit('result', { target, status })
94
104
  if (currentRevision !== revision)
95
105
  return
@@ -175,8 +185,8 @@ async function open(event: MouseEvent, target: AiPromptTarget) {
175
185
  --_muted: var(--ylf-ai-muted, var(--ylf-c-text-2, #475569));
176
186
  --_border: var(--ylf-ai-border, var(--ylf-c-border, #e2e8f0));
177
187
  --_surface: var(--ylf-ai-surface, var(--ylf-c-surface, #fff));
178
- --_soft: var(--ylf-ai-background, var(--ylf-c-bg-soft, #f8fafc));
179
- --_brand: var(--ylf-ai-accent, var(--ylf-c-brand, #2563eb));
188
+ --_soft: var(--ylf-ai-background, var(--ylf-c-bg-soft, #f1f5f9));
189
+ --_brand: var(--ylf-ai-accent, var(--ylf-c-brand, #006aeb));
180
190
  color: var(--_ink);
181
191
  container: ylf-ai / inline-size;
182
192
  }
@@ -203,8 +213,8 @@ async function open(event: MouseEvent, target: AiPromptTarget) {
203
213
  text-align: left;
204
214
  cursor: pointer;
205
215
  transition:
206
- border-color 160ms ease,
207
- background-color 160ms ease;
216
+ border-color var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
217
+ background-color var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
208
218
  }
209
219
  .ylf-ai-launcher__provider:not([aria-disabled='true']):hover {
210
220
  border-color: var(--_brand);
@@ -304,7 +314,7 @@ async function open(event: MouseEvent, target: AiPromptTarget) {
304
314
  outline-offset: 3px;
305
315
  }
306
316
  :is(button:disabled, [aria-disabled='true']) {
307
- opacity: 0.5;
317
+ opacity: var(--ylf-disabled-opacity, 0.48);
308
318
  cursor: not-allowed;
309
319
  }
310
320
  @container ylf-ai (max-width: 620px) {
@@ -23,7 +23,7 @@ withDefaults(defineProps<{
23
23
  </AvatarRoot>
24
24
  </template>
25
25
 
26
- <style lang="scss">
26
+ <style>
27
27
  .ylf-avatar {
28
28
  display: inline-flex;
29
29
  align-items: center;
@@ -32,40 +32,40 @@ withDefaults(defineProps<{
32
32
  overflow: hidden;
33
33
  border-radius: 50%;
34
34
  user-select: none;
35
- background: var(--ylf-c-brand-soft, #eff6ff);
35
+ background: var(--ylf-c-brand-soft, #f0f7ff);
36
+ }
36
37
 
37
- &--sm {
38
- width: 32px;
39
- height: 32px;
40
- font-size: 13px;
41
- }
38
+ .ylf-avatar--sm {
39
+ width: 32px;
40
+ height: 32px;
41
+ font-size: 13px;
42
+ }
42
43
 
43
- &--md {
44
- width: 44px;
45
- height: 44px;
46
- font-size: 16px;
47
- }
44
+ .ylf-avatar--md {
45
+ width: 44px;
46
+ height: 44px;
47
+ font-size: 16px;
48
+ }
48
49
 
49
- &--lg {
50
- width: 64px;
51
- height: 64px;
52
- font-size: 22px;
53
- }
50
+ .ylf-avatar--lg {
51
+ width: 64px;
52
+ height: 64px;
53
+ font-size: 22px;
54
+ }
54
55
 
55
- &__img {
56
- width: 100%;
57
- height: 100%;
58
- object-fit: cover;
59
- }
56
+ .ylf-avatar__img {
57
+ width: 100%;
58
+ height: 100%;
59
+ object-fit: cover;
60
+ }
60
61
 
61
- &__fallback {
62
- display: flex;
63
- align-items: center;
64
- justify-content: center;
65
- width: 100%;
66
- height: 100%;
67
- font-weight: 600;
68
- color: var(--ylf-c-brand, #2563eb);
69
- }
62
+ .ylf-avatar__fallback {
63
+ display: flex;
64
+ align-items: center;
65
+ justify-content: center;
66
+ width: 100%;
67
+ height: 100%;
68
+ font-weight: 600;
69
+ color: var(--ylf-c-brand, #006aeb);
70
70
  }
71
71
  </style>
@@ -23,7 +23,6 @@ const props = withDefaults(defineProps<{
23
23
  round?: boolean
24
24
  }>(), {
25
25
  variant: 'brand',
26
- tone: 'blue',
27
26
  appearance: 'solid',
28
27
  round: true,
29
28
  })
@@ -47,9 +46,9 @@ const statusPath = computed(() => statusPaths[props.variant])
47
46
  </span>
48
47
  </template>
49
48
 
50
- <style lang="scss">
49
+ <style>
51
50
  .ylf-badge {
52
- --_badge-tone: var(--ylf-c-brand, #2563eb);
51
+ --_badge-tone: var(--ylf-c-brand, #006aeb);
53
52
 
54
53
  display: inline-flex;
55
54
  align-items: center;
@@ -63,80 +62,100 @@ const statusPath = computed(() => statusPaths[props.variant])
63
62
  background: color-mix(in srgb, var(--_badge-tone) 6%, var(--ylf-c-surface, #fff));
64
63
  color: var(--_badge-tone);
65
64
  font-family: var(--ylf-font-body, inherit);
66
- font-size: 12px;
65
+ font-size: var(--ylf-text-xs, 0.75rem);
67
66
  font-weight: 500;
68
67
  line-height: 1.5;
69
68
  white-space: nowrap;
69
+ }
70
+
71
+ .ylf-badge.is-round {
72
+ border-radius: var(--ylf-radius-pill, 999px);
73
+ }
74
+
75
+ .ylf-badge--accent {
76
+ --_color: var(--ylf-accent, var(--ylf-c-brand, #006aeb));
77
+ --_soft: var(--ylf-accent-soft, var(--ylf-c-brand-soft, #f0f7ff));
78
+ --_text: var(--ylf-accent-text, var(--ylf-c-brand, #006aeb));
79
+
80
+ color: var(--ylf-accent-on, var(--ylf-c-text-on-accent, #fff));
81
+ background: var(--ylf-accent, var(--ylf-c-brand, #006aeb));
82
+ border-color: transparent;
83
+ }
84
+
85
+ .ylf-badge--featured,
86
+ .ylf-badge--aurora {
87
+ color: var(--ylf-c-feature-text, var(--ylf-c-text, #0f172a));
88
+ background: var(--ylf-c-feature-bg, var(--ylf-accent-sun-soft, #fef9c3));
89
+ border-color: color-mix(in srgb, var(--ylf-c-feature, #facc15) 45%, var(--ylf-c-surface, #fff));
90
+ }
91
+
92
+ /* 装饰星芒不承担状态语义,标签文字保持清晰。 */
93
+ .ylf-badge__spark {
94
+ flex: none;
95
+ width: 12px;
96
+ height: 12px;
97
+ background: var(--ylf-c-feature, #facc15);
98
+ clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%);
99
+ }
100
+
101
+ .ylf-badge--neutral {
102
+ --_badge-tone: var(--ylf-c-text-2, #475569);
103
+ }
104
+
105
+ .ylf-badge__status-icon {
106
+ flex: none;
107
+ width: 12px;
108
+ height: 12px;
109
+ }
110
+
111
+ .ylf-badge--success {
112
+ --_color: var(--ylf-status-success, #22c55e);
113
+ --_soft: var(--ylf-status-success-soft, var(--ylf-c-bg-soft, #f1f5f9));
114
+ --_text: var(--ylf-status-success-text, #166534);
115
+
116
+ color: var(--ylf-status-success-on, #052e16);
117
+ background: var(--ylf-status-success, #22c55e);
118
+ border-color: transparent;
119
+ }
120
+
121
+ .ylf-badge--warning {
122
+ --_color: var(--ylf-status-warning, #facc15);
123
+ --_soft: var(--ylf-status-warning-soft, var(--ylf-c-bg-soft, #f1f5f9));
124
+ --_text: var(--ylf-status-warning-text, #854d0e);
125
+
126
+ color: var(--ylf-status-warning-on, #64380e);
127
+ background: var(--ylf-status-warning, #facc15);
128
+ border-color: transparent;
129
+ }
130
+
131
+ .ylf-badge--danger {
132
+ --_color: var(--ylf-status-danger, #dc2626);
133
+ --_soft: var(--ylf-status-danger-soft, var(--ylf-c-bg-soft, #f1f5f9));
134
+ --_text: var(--ylf-status-danger-text, #b91c1c);
135
+
136
+ color: var(--ylf-status-danger-on, #fff);
137
+ background: var(--ylf-status-danger, #dc2626);
138
+ border-color: transparent;
139
+ }
140
+
141
+ .ylf-badge--info {
142
+ --_color: var(--ylf-status-info, #06b6d4);
143
+ --_soft: var(--ylf-status-info-soft, var(--ylf-c-bg-soft, #f1f5f9));
144
+ --_text: var(--ylf-status-info-text, #155e75);
145
+
146
+ color: var(--ylf-status-info-on, #032530);
147
+ background: var(--ylf-status-info, #06b6d4);
148
+ border-color: transparent;
149
+ }
150
+
151
+ :is(.ylf-badge--accent, .ylf-badge--success, .ylf-badge--warning, .ylf-badge--danger, .ylf-badge--info).is-soft {
152
+ color: var(--_text);
153
+ background: var(--_soft);
154
+ }
70
155
 
71
- &.is-round {
72
- border-radius: var(--ylf-radius-pill, 999px);
73
- }
74
-
75
- &--accent {
76
- --_color: var(--ylf-accent, var(--ylf-c-brand, #2563eb));
77
- --_soft: var(--ylf-accent-soft, var(--ylf-c-brand-soft, #eff6ff));
78
- --_text: var(--ylf-accent-text, var(--ylf-c-brand, #2563eb));
79
-
80
- color: var(--ylf-accent-on, var(--ylf-c-text-on-accent, #fff));
81
- background: var(--ylf-accent, var(--ylf-c-brand, #2563eb));
82
- border-color: transparent;
83
- }
84
-
85
- &--featured,
86
- &--aurora {
87
- color: var(--ylf-c-feature-text, #0f172a);
88
- background: var(--ylf-c-feature-bg, #fef9c3);
89
- border-color: color-mix(in srgb, var(--ylf-c-feature, #facc15) 45%, var(--ylf-c-surface, #fff));
90
- }
91
-
92
- // 装饰星芒不承担状态语义,标签文字保持清晰。
93
- &__spark {
94
- flex: none;
95
- width: 12px;
96
- height: 12px;
97
- background: var(--ylf-c-feature, #facc15);
98
- clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%);
99
- }
100
-
101
- &--neutral {
102
- --_badge-tone: var(--ylf-c-text-2, #475569);
103
- }
104
-
105
- &__status-icon {
106
- flex: none;
107
- width: 12px;
108
- height: 12px;
109
- }
110
-
111
- @each $status, $fill, $on in (success, #22c55e, #124324), (warning, #facc15, #64380e), (danger, #ff6b4a, #551b0a),
112
- (info, #06b6d4, #083e4f)
113
- {
114
- &--#{$status} {
115
- --_color: var(--ylf-status-#{$status}, #{$fill});
116
- --_soft: var(--ylf-status-#{$status}-soft, var(--ylf-c-bg-soft, #f1f5f9));
117
- --_text: var(--ylf-status-#{$status}-text, #{$on});
118
-
119
- color: var(--ylf-status-#{$status}-on, $on);
120
- background: var(--ylf-status-#{$status}, $fill);
121
- border-color: transparent;
122
- }
123
- }
124
-
125
- &--accent,
126
- &--success,
127
- &--warning,
128
- &--danger,
129
- &--info {
130
- &.is-soft {
131
- color: var(--_text);
132
- background: var(--_soft);
133
- }
134
-
135
- &.is-outline {
136
- color: var(--_text);
137
- background: transparent;
138
- border-color: var(--_color);
139
- }
140
- }
156
+ :is(.ylf-badge--accent, .ylf-badge--success, .ylf-badge--warning, .ylf-badge--danger, .ylf-badge--info).is-outline {
157
+ color: var(--_text);
158
+ background: transparent;
159
+ border-color: var(--_color);
141
160
  }
142
161
  </style>
@@ -13,20 +13,20 @@ withDefaults(defineProps<{
13
13
  </nav>
14
14
  </template>
15
15
 
16
- <style lang="scss">
16
+ <style>
17
17
  .ylf-bottom-menu {
18
18
  display: flex;
19
19
  align-items: stretch;
20
20
  justify-content: space-around;
21
21
  gap: 4px;
22
22
  padding: 8px 6px;
23
- background: var(--ylf-bottom-menu-c-bg, var(--ylf-glass-bg, rgba(255, 255, 255, 0.62)));
23
+ background: var(--ylf-bottom-menu-c-bg, var(--ylf-glass-bg, rgba(255, 255, 255, 0.82)));
24
24
  -webkit-backdrop-filter: var(--ylf-glass-blur, saturate(160%) blur(16px));
25
25
  backdrop-filter: var(--ylf-glass-blur, saturate(160%) blur(16px));
26
26
  border-top: 1px solid var(--ylf-c-border, #e2e8f0);
27
+ }
27
28
 
28
- &.is-shadow {
29
- box-shadow: var(--ylf-shadow, 0 10px 28px -8px rgba(15, 23, 42, 0.16));
30
- }
29
+ .ylf-bottom-menu.is-shadow {
30
+ box-shadow: var(--ylf-shadow, 0 10px 28px -8px rgba(15, 23, 42, 0.16));
31
31
  }
32
32
  </style>
@@ -23,7 +23,7 @@ const emit = defineEmits(['click'])
23
23
  </button>
24
24
  </template>
25
25
 
26
- <style lang="scss">
26
+ <style>
27
27
  .ylf-bottom-menu-item {
28
28
  flex: 1;
29
29
  display: flex;
@@ -35,26 +35,26 @@ const emit = defineEmits(['click'])
35
35
  border: none;
36
36
  background: transparent;
37
37
  cursor: pointer;
38
- color: var(--ylf-c-text-3, #64748b);
38
+ color: var(--ylf-c-text-3, #5a697e);
39
39
  transition:
40
- color 0.2s ease,
40
+ color 0.2s var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
41
41
  transform 0.2s var(--ylf-ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
42
+ }
42
43
 
43
- &__icon {
44
- font-size: 22px;
45
- }
44
+ .ylf-bottom-menu-item__icon {
45
+ font-size: 22px;
46
+ }
46
47
 
47
- &__label {
48
- font-size: 12px;
49
- }
48
+ .ylf-bottom-menu-item__label {
49
+ font-size: var(--ylf-text-xs, 0.75rem);
50
+ }
50
51
 
51
- &:active {
52
- transform: scale(0.92);
53
- }
52
+ .ylf-bottom-menu-item:active {
53
+ transform: scale(0.92);
54
+ }
54
55
 
55
- &.active {
56
- color: var(--ylf-c-brand, #2563eb);
57
- }
56
+ .ylf-bottom-menu-item.active {
57
+ color: var(--ylf-c-brand, #006aeb);
58
58
  }
59
59
 
60
60
  @media (prefers-reduced-motion: reduce) {