@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
@@ -19,7 +19,9 @@ withDefaults(defineProps<{
19
19
  })
20
20
 
21
21
  const emit = defineEmits<{ valueCommit: [value: number[]] }>()
22
- const model = defineModel<number[]>({ default: () => [50] })
22
+ const model = defineModel<number[]>({
23
+ default: () => [50],
24
+ })
23
25
  </script>
24
26
 
25
27
  <template>
@@ -44,7 +46,7 @@ const model = defineModel<number[]>({ default: () => [50] })
44
46
  </SliderRoot>
45
47
  </template>
46
48
 
47
- <style lang="scss">
49
+ <style>
48
50
  .ylf-slider {
49
51
  position: relative;
50
52
  display: flex;
@@ -53,57 +55,58 @@ const model = defineModel<number[]>({ default: () => [50] })
53
55
  height: 20px;
54
56
  touch-action: none;
55
57
  user-select: none;
58
+ }
56
59
 
57
- &[data-disabled] {
58
- opacity: 0.5;
59
- }
60
+ .ylf-slider[data-disabled] {
61
+ opacity: var(--ylf-disabled-opacity, 0.48);
62
+ }
60
63
 
61
- &__track {
62
- position: relative;
63
- flex-grow: 1;
64
- height: 6px;
65
- border-radius: 999px;
66
- background: var(--ylf-c-bg-mute, #e2e8f0);
67
- }
64
+ .ylf-slider__track {
65
+ position: relative;
66
+ flex-grow: 1;
67
+ height: 6px;
68
+ border-radius: var(--ylf-radius-pill, 999px);
69
+ background: var(--ylf-c-bg-mute, #e2e8f0);
70
+ }
68
71
 
69
- &__range {
70
- position: absolute;
71
- height: 100%;
72
- border-radius: 999px;
73
- background: var(--ylf-c-brand, #2563eb);
74
- }
72
+ .ylf-slider__range {
73
+ position: absolute;
74
+ height: 100%;
75
+ border-radius: var(--ylf-radius-pill, 999px);
76
+ background: var(--ylf-c-brand, #006aeb);
77
+ }
75
78
 
76
- &__thumb {
77
- position: relative;
78
- display: block;
79
- width: 18px;
80
- height: 18px;
81
- border-radius: 50%;
82
- background: var(--ylf-c-surface, #fff);
83
- border: 2px solid var(--ylf-c-brand, #2563eb);
84
- box-shadow: var(--ylf-shadow-sm, 0 2px 8px -2px rgba(15, 23, 42, 0.12));
85
- cursor: grab;
86
- transition:
87
- box-shadow var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, ease),
88
- scale var(--ylf-duration-slow, 480ms) var(--ylf-ease-spring, var(--ylf-ease-standard, ease));
79
+ .ylf-slider__thumb {
80
+ position: relative;
81
+ display: block;
82
+ width: 18px;
83
+ height: 18px;
84
+ border-radius: 50%;
85
+ background: var(--ylf-c-surface, #fff);
86
+ border: 2px solid var(--ylf-c-brand, #006aeb);
87
+ box-shadow: var(--ylf-shadow-sm, 0 2px 8px -2px rgba(15, 23, 42, 0.12));
88
+ cursor: grab;
89
+ transition:
90
+ box-shadow var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
91
+ scale var(--ylf-duration-slow, 480ms) var(--ylf-ease-spring, var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)));
92
+ }
89
93
 
90
- @media (hover: hover) and (pointer: fine) {
91
- &:hover {
92
- box-shadow: 0 0 0 6px var(--ylf-c-brand-soft, #eff6ff);
93
- }
94
- }
94
+ @media (hover: hover) and (pointer: fine) {
95
+ .ylf-slider__thumb:hover {
96
+ box-shadow: 0 0 0 6px var(--ylf-c-brand-soft, #f0f7ff);
97
+ }
98
+ }
95
99
 
96
- &:focus-visible {
97
- outline: none;
98
- box-shadow: 0 0 0 4px var(--ylf-c-brand-soft, #eff6ff);
99
- }
100
+ .ylf-slider__thumb:focus-visible {
101
+ outline: var(--ylf-ring-width, 2px) solid var(--ylf-ring-color, var(--ylf-c-brand, #006aeb));
102
+ outline-offset: 2px;
103
+ box-shadow: 0 0 0 4px var(--ylf-c-brand-soft, #f0f7ff);
104
+ }
100
105
 
101
- &:active {
102
- cursor: grabbing;
103
- scale: 1.2;
104
- box-shadow: 0 0 0 6px var(--ylf-c-brand-soft, #eff6ff);
105
- }
106
- }
106
+ .ylf-slider__thumb:active {
107
+ cursor: grabbing;
108
+ scale: 1.2;
109
+ box-shadow: 0 0 0 6px var(--ylf-c-brand-soft, #f0f7ff);
107
110
  }
108
111
 
109
112
  @media (pointer: coarse) {
@@ -12,7 +12,6 @@ withDefaults(defineProps<{
12
12
  disabled?: boolean
13
13
  }>(), {
14
14
  variant: 'brand',
15
- tone: 'blue',
16
15
  size: 'md',
17
16
  disabled: false,
18
17
  })
@@ -32,12 +31,12 @@ const checked = defineModel<boolean>({ default: false })
32
31
  </SwitchRoot>
33
32
  </template>
34
33
 
35
- <style lang="scss">
34
+ <style>
36
35
  .ylf-switch {
37
36
  --_w: 52px;
38
37
  --_h: 30px;
39
38
  --_pad: 3px;
40
- // 按下时拇指横向拉长,像被捏住的软糖;松开后弹回。
39
+ /* 按下时拇指横向拉长,像被捏住的软糖;松开后弹回。 */
41
40
  --_stretch: 0px;
42
41
 
43
42
  position: relative;
@@ -50,69 +49,73 @@ const checked = defineModel<boolean>({ default: false })
50
49
  background: var(--ylf-c-bg-mute, #e2e8f0);
51
50
  box-shadow:
52
51
  var(--ylf-shadow-inset),
53
- inset 0 0 0 1px var(--ylf-c-edge, transparent);
52
+ inset 0 0 0 1px var(--ylf-c-border-control, #7d8ca0);
54
53
  cursor: pointer;
55
54
  -webkit-tap-highlight-color: transparent;
56
55
  transition:
57
- background var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, ease),
58
- box-shadow var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, ease);
56
+ background var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
57
+ box-shadow var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
58
+ }
59
59
 
60
- &--sm {
61
- --_w: 40px;
62
- --_h: 24px;
63
- }
60
+ .ylf-switch--sm {
61
+ --_w: 40px;
62
+ --_h: 24px;
63
+ }
64
64
 
65
- &:focus-visible {
66
- outline: none;
67
- box-shadow:
68
- 0 0 0 3px var(--ylf-c-brand-soft, #eff6ff),
69
- 0 0 0 5px var(--ylf-c-brand, #2563eb);
70
- }
65
+ .ylf-switch:focus-visible {
66
+ outline: var(--ylf-ring-width, 2px) solid var(--ylf-ring-color, var(--ylf-c-brand, #006aeb));
67
+ outline-offset: 2px;
68
+ box-shadow:
69
+ 0 0 0 3px var(--ylf-c-brand-soft, #f0f7ff),
70
+ 0 0 0 5px var(--ylf-ring-color, var(--ylf-c-brand, #006aeb));
71
+ }
71
72
 
72
- &[data-disabled] {
73
- opacity: 0.5;
74
- cursor: not-allowed;
75
- }
73
+ .ylf-switch[data-disabled] {
74
+ opacity: var(--ylf-disabled-opacity, 0.48);
75
+ cursor: not-allowed;
76
+ }
76
77
 
77
- // on 态:晴空蓝主色
78
- &[data-state='checked'] {
79
- background: var(--ylf-c-brand, #2563eb);
80
- }
78
+ /* on 态:晴空蓝主色 */
79
+ .ylf-switch[data-state='checked'] {
80
+ background: var(--ylf-c-brand, #006aeb);
81
+ box-shadow: var(--ylf-shadow-inset);
82
+ }
81
83
 
82
- // 选中的强调轨道,前景与填充色成组。
83
- &--accent[data-state='checked'],
84
- &--aurora[data-state='checked'] {
85
- background: var(--ylf-accent, var(--ylf-c-brand, #2563eb));
86
- }
84
+ /* 选中的强调轨道,前景与填充色成组。 */
85
+ .ylf-switch--accent[data-state='checked'],
86
+ .ylf-switch--aurora[data-state='checked'] {
87
+ background: var(--ylf-accent, var(--ylf-c-brand, #006aeb));
88
+ }
87
89
 
88
- &:active:not([data-disabled]) {
89
- --_stretch: 6px;
90
- }
90
+ .ylf-switch:active:not([data-disabled]) {
91
+ --_stretch: 6px;
92
+ }
91
93
 
92
- &__thumb {
93
- display: block;
94
- width: calc(var(--_h) - var(--_pad) * 2 + var(--_stretch));
95
- height: calc(var(--_h) - var(--_pad) * 2);
96
- border-radius: 50%;
97
- background: #fff;
98
- box-shadow:
99
- inset 0 1px 0 rgba(255, 255, 255, 0.4),
100
- 0 1px 2px rgba(0, 0, 0, 0.12),
101
- 0 3px 5px rgba(0, 0, 0, 0.18);
102
- transform: translateX(var(--_pad));
103
- transition:
104
- transform var(--ylf-duration-slow, 480ms) var(--ylf-ease-spring, var(--ylf-ease-standard, ease)),
105
- width var(--ylf-duration-normal, 240ms) var(--ylf-ease-spring, var(--ylf-ease-standard, ease));
106
- }
94
+ .ylf-switch__thumb {
95
+ display: block;
96
+ width: calc(var(--_h) - var(--_pad) * 2 + var(--_stretch));
97
+ height: calc(var(--_h) - var(--_pad) * 2);
98
+ border-radius: 50%;
99
+ background: #fff;
100
+ box-shadow:
101
+ inset 0 1px 0 rgba(255, 255, 255, 0.4),
102
+ 0 1px 2px rgba(0, 0, 0, 0.12),
103
+ 0 3px 5px rgba(0, 0, 0, 0.18);
104
+ transform: translateX(var(--_pad));
105
+ transition:
106
+ transform var(--ylf-duration-slow, 480ms)
107
+ var(--ylf-ease-spring, var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1))),
108
+ width var(--ylf-duration-normal, 240ms) var(--ylf-ease-spring, var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)));
109
+ }
107
110
 
108
- &[data-state='checked'] &__thumb {
109
- background: var(--ylf-c-text-on-accent, #fff);
110
- transform: translateX(calc(var(--_w) - var(--_h) + var(--_pad) - var(--_stretch)));
111
- }
112
- &--accent[data-state='checked'] &__thumb,
113
- &--aurora[data-state='checked'] &__thumb {
114
- background: var(--ylf-accent-on, var(--ylf-c-text-on-accent, #fff));
115
- }
111
+ .ylf-switch[data-state='checked'] .ylf-switch__thumb {
112
+ background: var(--ylf-c-text-on-accent, #fff);
113
+ transform: translateX(calc(var(--_w) - var(--_h) + var(--_pad) - var(--_stretch)));
114
+ }
115
+
116
+ .ylf-switch--accent[data-state='checked'] .ylf-switch__thumb,
117
+ .ylf-switch--aurora[data-state='checked'] .ylf-switch__thumb {
118
+ background: var(--ylf-accent-on, var(--ylf-c-text-on-accent, #fff));
116
119
  }
117
120
 
118
121
  @media (prefers-reduced-motion: reduce) {
@@ -121,6 +124,7 @@ const checked = defineModel<boolean>({ default: false })
121
124
  transition: none;
122
125
  }
123
126
  }
127
+
124
128
  @media (pointer: coarse) {
125
129
  .ylf-switch {
126
130
  position: relative;
@@ -128,16 +132,16 @@ const checked = defineModel<boolean>({ default: false })
128
132
  margin-block: max(0px, calc((var(--ylf-touch-target, 44px) - var(--_h)) / 2));
129
133
  margin-inline: max(0px, calc((var(--ylf-touch-target, 44px) - var(--_w)) / 2));
130
134
  touch-action: manipulation;
135
+ }
131
136
 
132
- &::before {
133
- position: absolute;
134
- top: 50%;
135
- left: 50%;
136
- width: max(100%, var(--ylf-touch-target, 44px));
137
- height: max(100%, var(--ylf-touch-target, 44px));
138
- transform: translate(-50%, -50%);
139
- content: '';
140
- }
137
+ .ylf-switch::before {
138
+ position: absolute;
139
+ top: 50%;
140
+ left: 50%;
141
+ width: max(100%, var(--ylf-touch-target, 44px));
142
+ height: max(100%, var(--ylf-touch-target, 44px));
143
+ transform: translate(-50%, -50%);
144
+ content: '';
141
145
  }
142
146
  }
143
147
  </style>
@@ -47,7 +47,7 @@ const model = defineModel<string>()
47
47
  </TabsRoot>
48
48
  </template>
49
49
 
50
- <style lang="scss">
50
+ <style>
51
51
  .ylf-tabs__list {
52
52
  position: relative;
53
53
  display: flex;
@@ -59,7 +59,7 @@ const model = defineModel<string>()
59
59
  position: relative;
60
60
  padding: 10px 16px;
61
61
  font-family: inherit;
62
- font-size: 15px;
62
+ font-size: var(--ylf-control-font-size, 0.9375rem);
63
63
  font-weight: 500;
64
64
  color: var(--ylf-c-text-2, #475569);
65
65
  background: transparent;
@@ -67,31 +67,31 @@ const model = defineModel<string>()
67
67
  cursor: pointer;
68
68
  border-radius: var(--ylf-radius-sm, 10px) var(--ylf-radius-sm, 10px) 0 0;
69
69
  transition:
70
- color var(--ylf-duration-fast, 160ms) ease,
71
- background var(--ylf-duration-fast, 160ms) ease;
70
+ color var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
71
+ background var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
72
+ }
72
73
 
73
- @media (hover: hover) and (pointer: fine) {
74
- &:hover:not([data-disabled]) {
75
- color: var(--ylf-c-text, #0f172a);
76
- }
74
+ @media (hover: hover) and (pointer: fine) {
75
+ .ylf-tabs__trigger:hover:not([data-disabled]) {
76
+ color: var(--ylf-c-text, #0f172a);
77
77
  }
78
+ }
78
79
 
79
- &[data-state='active'] {
80
- color: var(--ylf-c-brand, #2563eb);
81
- background: color-mix(in srgb, var(--ylf-c-brand-soft, #eff6ff) 65%, transparent);
82
- }
80
+ .ylf-tabs__trigger[data-state='active'] {
81
+ color: var(--ylf-c-brand, #006aeb);
82
+ background: color-mix(in srgb, var(--ylf-c-brand-soft, #f0f7ff) 65%, transparent);
83
+ }
83
84
 
84
- &[data-disabled] {
85
- opacity: 0.45;
86
- cursor: not-allowed;
87
- }
85
+ .ylf-tabs__trigger[data-disabled] {
86
+ opacity: var(--ylf-disabled-opacity, 0.48);
87
+ cursor: not-allowed;
88
+ }
88
89
 
89
- &:focus-visible {
90
- outline: 2px solid var(--ylf-c-brand, #2563eb);
91
- outline-offset: -3px;
92
- border-radius: var(--ylf-radius-sm, 10px);
93
- box-shadow: 0 0 0 3px var(--ylf-c-brand-soft, #eff6ff);
94
- }
90
+ .ylf-tabs__trigger:focus-visible {
91
+ outline: var(--ylf-ring-width, 2px) solid var(--ylf-ring-color, var(--ylf-c-brand, #006aeb));
92
+ outline-offset: -3px;
93
+ border-radius: var(--ylf-radius-sm, 10px);
94
+ box-shadow: 0 0 0 3px var(--ylf-c-brand-soft, #f0f7ff);
95
95
  }
96
96
 
97
97
  .ylf-tabs__indicator {
@@ -100,21 +100,22 @@ const model = defineModel<string>()
100
100
  left: 0;
101
101
  width: var(--reka-tabs-indicator-size);
102
102
  height: 2.5px;
103
- border-radius: 999px;
104
- background: var(--ylf-c-brand, #2563eb);
105
- box-shadow: 0 1px 4px color-mix(in srgb, var(--ylf-c-brand, #2563eb) 25%, transparent);
103
+ border-radius: var(--ylf-radius-pill, 999px);
104
+ background: var(--ylf-c-brand, #006aeb);
105
+ box-shadow: 0 1px 4px color-mix(in srgb, var(--ylf-c-brand, #006aeb) 25%, transparent);
106
106
  transform: translateX(var(--reka-tabs-indicator-position));
107
107
  transition:
108
- transform var(--ylf-duration-slow, 480ms) var(--ylf-ease-spring, var(--ylf-ease-standard, ease)),
109
- width var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, ease);
108
+ transform var(--ylf-duration-slow, 480ms)
109
+ var(--ylf-ease-spring, var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1))),
110
+ width var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
110
111
  }
111
112
 
112
113
  .ylf-tabs__content {
113
114
  padding-top: 16px;
115
+ }
114
116
 
115
- &:focus-visible {
116
- outline: none;
117
- }
117
+ .ylf-tabs__content:focus-visible {
118
+ outline: none;
118
119
  }
119
120
 
120
121
  @media (prefers-reduced-motion: reduce) {
@@ -123,6 +124,7 @@ const model = defineModel<string>()
123
124
  transition: none;
124
125
  }
125
126
  }
127
+
126
128
  @media (pointer: coarse) {
127
129
  .ylf-tabs__trigger {
128
130
  min-height: var(--ylf-touch-target, 44px);
@@ -35,45 +35,48 @@ withDefaults(defineProps<{
35
35
  </TooltipProvider>
36
36
  </template>
37
37
 
38
- <style lang="scss">
38
+ <style>
39
39
  .ylf-tooltip {
40
- z-index: 110;
40
+ z-index: var(--ylf-z-tooltip, 110);
41
41
  max-width: 240px;
42
42
  padding: 8px 12px;
43
- font-size: 13px;
43
+ font-size: var(--ylf-control-font-size-sm, 0.8125rem);
44
44
  line-height: 1.5;
45
- color: var(--ylf-c-bg, #fbfcff);
45
+ color: var(--ylf-c-bg, #f8fafc);
46
46
  background: var(--ylf-c-text, #0f172a);
47
47
  border-radius: var(--ylf-radius-sm, 10px);
48
- border: 1px solid color-mix(in srgb, var(--ylf-c-bg, #fbfcff) 15%, transparent);
48
+ border: 1px solid color-mix(in srgb, var(--ylf-c-bg, #f8fafc) 15%, transparent);
49
49
  box-shadow: var(--ylf-shadow, 0 10px 28px -8px rgba(15, 23, 42, 0.16));
50
50
  transform-origin: var(--reka-tooltip-content-transform-origin);
51
+ }
51
52
 
52
- &[data-state='delayed-open'],
53
- &[data-state='instant-open'] {
54
- animation: ylf-tooltip-in var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, ease);
55
- }
53
+ .ylf-tooltip[data-state='delayed-open'],
54
+ .ylf-tooltip[data-state='instant-open'] {
55
+ animation: ylf-tooltip-in var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
56
+ }
56
57
 
57
- &[data-state='closed'] {
58
- animation: ylf-tooltip-out var(--ylf-duration-exit, 160ms) var(--ylf-ease-standard, ease);
59
- }
58
+ .ylf-tooltip[data-state='closed'] {
59
+ animation: ylf-tooltip-out var(--ylf-duration-exit, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
60
+ }
60
61
 
61
- &[data-side='bottom'] {
62
- --_enter-y: -4px;
63
- }
64
- &[data-side='top'] {
65
- --_enter-y: 4px;
66
- }
67
- &[data-side='left'] {
68
- --_enter-x: 4px;
69
- }
70
- &[data-side='right'] {
71
- --_enter-x: -4px;
72
- }
62
+ .ylf-tooltip[data-side='bottom'] {
63
+ --_enter-y: -4px;
64
+ }
73
65
 
74
- &__arrow {
75
- fill: var(--ylf-c-text, #0f172a);
76
- }
66
+ .ylf-tooltip[data-side='top'] {
67
+ --_enter-y: 4px;
68
+ }
69
+
70
+ .ylf-tooltip[data-side='left'] {
71
+ --_enter-x: 4px;
72
+ }
73
+
74
+ .ylf-tooltip[data-side='right'] {
75
+ --_enter-x: -4px;
76
+ }
77
+
78
+ .ylf-tooltip__arrow {
79
+ fill: var(--ylf-c-text, #0f172a);
77
80
  }
78
81
 
79
82
  @keyframes ylf-tooltip-in {
@@ -12,10 +12,30 @@ export interface AiProvider {
12
12
  export const aiProviders: readonly AiProvider[] = [
13
13
  { id: 'yuanbao', name: '元宝', url: 'https://yuanbao.tencent.com/' },
14
14
  { id: 'doubao', name: '豆包', url: 'https://www.doubao.com/chat/' },
15
- { id: 'deepseek', name: 'DeepSeek', url: 'https://chat.deepseek.com/', promptParameter: 'q' },
16
- { id: 'chatgpt', name: 'ChatGPT', url: 'https://chatgpt.com/', promptParameter: 'q' },
17
- { id: 'claude', name: 'Claude', url: 'https://claude.ai/new', promptParameter: 'q' },
18
- { id: 'cursor', name: 'Cursor', url: 'https://cursor.com/link/prompt', promptParameter: 'text' },
15
+ {
16
+ id: 'deepseek',
17
+ name: 'DeepSeek',
18
+ url: 'https://chat.deepseek.com/',
19
+ promptParameter: 'q',
20
+ },
21
+ {
22
+ id: 'chatgpt',
23
+ name: 'ChatGPT',
24
+ url: 'https://chatgpt.com/',
25
+ promptParameter: 'q',
26
+ },
27
+ {
28
+ id: 'claude',
29
+ name: 'Claude',
30
+ url: 'https://claude.ai/new',
31
+ promptParameter: 'q',
32
+ },
33
+ {
34
+ id: 'cursor',
35
+ name: 'Cursor',
36
+ url: 'https://cursor.com/link/prompt',
37
+ promptParameter: 'text',
38
+ },
19
39
  ]
20
40
 
21
41
  export interface AiPromptOptions {
@@ -37,7 +57,12 @@ export function buildAiPromptTarget(id: AiProviderId, prompt: string, options: A
37
57
  const provider = aiProviders.find(item => item.id === id)
38
58
  if (!provider)
39
59
  throw new Error(`Unknown AI provider: ${id}`)
40
- const fallback = (reason: AiPromptTarget['reason']): AiPromptTarget => ({ provider, url: provider.url, mode: 'copy', reason })
60
+ const fallback = (reason: AiPromptTarget['reason']): AiPromptTarget => ({
61
+ provider,
62
+ url: provider.url,
63
+ mode: 'copy',
64
+ reason,
65
+ })
41
66
  if (!prompt.trim())
42
67
  return fallback('empty')
43
68
  if (!provider.promptParameter)
@@ -48,7 +73,9 @@ export function buildAiPromptTarget(id: AiProviderId, prompt: string, options: A
48
73
  if (id === 'chatgpt' && options.chatgptSearch)
49
74
  url.searchParams.set('hints', 'search')
50
75
  // Cursor's HTTPS landing page builds a slightly longer cursor:// deeplink.
51
- const providerLimit = id === 'cursor' ? 9900 : Number.POSITIVE_INFINITY
76
+ const providerLimit = id === 'cursor'
77
+ ? 9900
78
+ : Number.POSITIVE_INFINITY
52
79
  const limit = Math.min(options.maxUrlLength ?? 8192, providerLimit)
53
80
  if (!Number.isFinite(limit) || limit <= 0 || url.href.length > limit)
54
81
  return fallback('too-long')
@@ -11,11 +11,11 @@ title_zh: 徽标
11
11
  - `featured`:精选、推荐等品牌标记,明黄星芒、浅黄底和中性文字。
12
12
  - `accent`:高饱和实色,默认晴空蓝,使用 `tone` 选择明黄、青、珊瑚橙、桃粉或鲜绿。
13
13
  - `neutral`:已归档、草稿等普通信息,无需暗示成功或错误。
14
- - `success` / `warning` / `danger` / `info`:分别使用鲜绿、明黄、珊瑚橙与青色实底,配套状态图形和文字。
14
+ - `success` / `warning` / `danger` / `info`:分别使用鲜绿、明黄、警戒红与青色实底,配套状态图形和文字。
15
15
 
16
16
  徽标使用系统正文字体,默认 12px、500 字重,无阴影、发光或持续动画。前景、底色和描边使用配套 token,随明暗主题调整。使用简短明确的文字描述状态,颜色辅助识别。
17
17
 
18
- 晴空蓝实底在浅色主题使用白字、深色主题使用深蓝字;其余纯色标签使用同色相深色文字,保证各组填充与前景的对比度。状态与强调色共享 token,详见[色彩与组件](/guide/colors#状态也来自同一套色板)。
18
+ 晴空蓝实底在浅色主题使用白字、深色主题使用深蓝字;错误警戒红在明暗主题下均使用白字;其余纯色标签使用同色相深色文字,保证各组填充与前景的对比度。详见[色彩与组件](/guide/colors#状态也来自同一套色板)。
19
19
 
20
20
  徽标用于展示信息;需要点击筛选或执行操作时,使用按钮等交互组件。
21
21
 
@@ -5,11 +5,11 @@ title_zh: 按钮
5
5
 
6
6
  主操作默认使用晴空蓝实色;品牌展示可选择 `accent` 纯色变体,配合 `tone` 指定强调色。描边、柔色和透明按钮用于次级操作,成功、提醒与危险变体表达对应的状态语义。
7
7
 
8
- 状态按钮与徽标使用同一套多巴胺色板:成功为鲜绿、提醒为明黄、危险为珊瑚橙,文字使用配套的同色相深色 token。
8
+ 状态按钮与徽标共享语义色:成功为鲜绿、提醒为明黄、危险为独立警戒红(白字),避免与珊瑚橙的活动入口混淆。
9
9
 
10
10
  ## 品牌入口
11
11
 
12
- 首页或活动区的主入口使用 `variant="hero" size="xl"`:深蓝到青蓝渐变、白色文案、柔光投影,以及 56px 点击高度。明暗主题均保留深色渐变和白字,不使用偏亮的天空装饰渐变作为按钮底色。悬停时加深颜色,键盘聚焦使用双色外圈,减少动态效果时关闭位移。
12
+ 首页或活动区的主入口使用 `variant="hero" size="xl"`:由晴空蓝延展至深海蓝的同色系渐变、白色文案、柔光投影,以及 56px 点击高度。明暗主题均保留深色渐变和白字,不使用偏亮的天空装饰渐变作为按钮底色。悬停时加深颜色,键盘聚焦使用双色外圈,减少动态效果时关闭位移。
13
13
 
14
14
  每个区块保留一个 hero 主入口。日常保存、确认和导航使用 `primary` 或次级变体。`tone` 和 `appearance` 不改变 hero 的专用配色;颜色与阴影统一由 `--ylf-hero-*` 提供,业务可保留自己的路由行为封装。
15
15
 
@@ -1,4 +1,24 @@
1
1
  /** Silhouettes of the shared cloud illustration, from a tall billow to a thin distant wisp. */
2
- export const ylfCloudShapes = ['billow', 'heap', 'bank', 'puff', 'wisp'] as const
2
+ export const ylfCloudShapes = [
3
+ 'billow',
4
+ 'heap',
5
+ 'bank',
6
+ 'puff',
7
+ 'wisp',
8
+ ] as const
3
9
 
4
10
  export type YlfCloudShape = typeof ylfCloudShapes[number]
11
+
12
+ /** Shared SVG paths for cloud silhouettes (`viewBox="0 0 490 250"`). */
13
+ export const ylfCloudSilhouettes: Record<YlfCloudShape, string> = {
14
+ // 层层鼓起的主云。
15
+ 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',
16
+ // 宽厚的近景积云,右侧堆得更高。
17
+ 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',
18
+ // 贴着地平线的扁长云堤。
19
+ 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',
20
+ // 圆鼓鼓的小团云。
21
+ 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',
22
+ // 远处拉长的薄云。
23
+ 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',
24
+ }
@@ -29,8 +29,12 @@ export function useNavigationIndicator(root: Readonly<Ref<HTMLElement | null>>,
29
29
  return
30
30
  }
31
31
  // Convert viewport coordinates to the padding box, including scaled previews.
32
- const scaleX = element.offsetWidth ? bounds.width / element.offsetWidth : 1
33
- const scaleY = element.offsetHeight ? bounds.height / element.offsetHeight : 1
32
+ const scaleX = element.offsetWidth
33
+ ? bounds.width / element.offsetWidth
34
+ : 1
35
+ const scaleY = element.offsetHeight
36
+ ? bounds.height / element.offsetHeight
37
+ : 1
34
38
  const x = (target.left - bounds.left + target.width / 2) / scaleX - element.clientLeft + element.scrollLeft - 8
35
39
  const y = (target.bottom - bounds.top) / scaleY - element.clientTop + element.scrollTop - 6
36
40
  if (indicator.value?.x !== x || indicator.value?.y !== y)
@@ -47,7 +51,9 @@ export function useNavigationIndicator(root: Readonly<Ref<HTMLElement | null>>,
47
51
  }
48
52
 
49
53
  function observeLinks() {
50
- const current = new Set(root.value ? options.links(root.value) : [])
54
+ const current = new Set(root.value
55
+ ? options.links(root.value)
56
+ : [])
51
57
  for (const link of observedLinks) {
52
58
  if (!current.has(link)) {
53
59
  resizeObserver?.unobserve(link)
@@ -3,7 +3,9 @@ import { computed, shallowRef, watch } from 'vue'
3
3
 
4
4
  function edgeOpacity(distance: number): number {
5
5
  // Layout heights are rounded to whole pixels, but scrollTop can be fractional.
6
- return distance <= 1 ? 0 : Math.min(1, distance / 24)
6
+ return distance <= 1
7
+ ? 0
8
+ : Math.min(1, distance / 24)
7
9
  }
8
10
 
9
11
  /** Reveal the edges with more content, including before the first scroll. */