@yunlefun/vue 0.6.0 → 0.8.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/README.md +5 -6
- package/components/YlfAccordion.vue +30 -29
- package/components/YlfAgentCard.vue +4 -4
- package/components/YlfAgentStatus.vue +1 -1
- package/components/YlfAgentTask.vue +4 -4
- package/components/YlfAiPromptLauncher.vue +18 -8
- package/components/YlfAvatar.vue +30 -30
- package/components/YlfBadge.vue +92 -73
- package/components/YlfBottomMenu.vue +5 -5
- package/components/YlfBottomMenuItem.vue +15 -15
- package/components/YlfButton.vue +300 -265
- package/components/YlfCard.vue +32 -32
- package/components/YlfCheckbox.vue +61 -54
- package/components/YlfCloud.vue +5 -18
- package/components/YlfDialog.vue +47 -46
- package/components/YlfDropdownMenu.vue +55 -57
- package/components/YlfInput.vue +22 -15
- package/components/YlfLogo.vue +58 -42
- package/components/YlfNavigation.vue +24 -24
- package/components/YlfNavigationLink.vue +58 -25
- package/components/YlfNavigationTrigger.vue +49 -21
- package/components/YlfPopover.vue +34 -31
- package/components/YlfProgress.vue +10 -6
- package/components/YlfRadioGroup.vue +73 -58
- package/components/YlfScrollFade.vue +66 -0
- package/components/YlfSegmentedControl.vue +21 -15
- package/components/YlfSelect.vue +110 -99
- package/components/YlfSeparator.vue +31 -26
- package/components/YlfSlider.vue +49 -46
- package/components/YlfSwitch.vue +67 -64
- package/components/YlfTabs.vue +30 -28
- package/components/YlfTooltip.vue +30 -27
- package/components/ai-prompt.ts +33 -6
- package/components/cloud.ts +21 -1
- package/components/navigation-indicator.ts +9 -3
- package/components/scroll-fade/demo.vue +49 -0
- package/components/scroll-fade/index.md +40 -0
- package/components/scroll-fade.ts +54 -0
- package/components/segmented-control/demo.vue +9 -2
- package/dist/ag-ui.cjs +11 -2
- package/dist/ag-ui.mjs +11 -2
- package/dist/ai-prompt.cjs +30 -5
- package/dist/ai-prompt.mjs +30 -5
- package/dist/components/YlfAccordion.vue.d.ts +5 -3
- package/dist/components/YlfAgentCard.vue.d.ts +9 -7
- package/dist/components/YlfAgentTask.vue.d.ts +7 -5
- package/dist/components/YlfBadge.vue.d.ts +5 -4
- package/dist/components/YlfBottomMenu.vue.d.ts +5 -3
- package/dist/components/YlfBottomMenuItem.vue.d.ts +5 -3
- package/dist/components/YlfButton.vue.d.ts +7 -6
- package/dist/components/YlfCard.vue.d.ts +5 -4
- package/dist/components/YlfDialog.vue.d.ts +11 -9
- package/dist/components/YlfDropdownMenu.vue.d.ts +5 -3
- package/dist/components/YlfNavigation.vue.d.ts +5 -3
- package/dist/components/YlfNavigationLink.vue.d.ts +5 -3
- package/dist/components/YlfNavigationTrigger.vue.d.ts +5 -3
- package/dist/components/YlfPopover.vue.d.ts +7 -5
- package/dist/components/YlfProgress.vue.d.ts +0 -1
- package/dist/components/YlfScrollFade.vue.d.ts +26 -0
- package/dist/components/YlfSeparator.vue.d.ts +0 -1
- package/dist/components/YlfSwitch.vue.d.ts +0 -1
- package/dist/components/YlfTabs.vue.d.ts +5 -3
- package/dist/components/YlfTooltip.vue.d.ts +7 -5
- package/dist/components/cloud.d.ts +2 -0
- package/dist/components/scroll-fade.d.ts +3 -0
- package/dist/index.cjs +20 -10
- package/dist/index.d.cts +3 -4
- package/dist/index.d.mts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.mjs +20 -8
- package/dist/node.cjs +11 -0
- package/dist/node.d.cts +4 -0
- package/dist/node.d.mts +4 -0
- package/dist/node.d.ts +4 -0
- package/dist/node.mjs +7 -0
- package/package.json +11 -4
- package/components/_navigation.scss +0 -38
|
@@ -12,7 +12,6 @@ withDefaults(defineProps<{
|
|
|
12
12
|
orientation: 'horizontal',
|
|
13
13
|
decorative: true,
|
|
14
14
|
variant: 'neutral',
|
|
15
|
-
tone: 'blue',
|
|
16
15
|
})
|
|
17
16
|
</script>
|
|
18
17
|
|
|
@@ -26,43 +25,49 @@ withDefaults(defineProps<{
|
|
|
26
25
|
/>
|
|
27
26
|
</template>
|
|
28
27
|
|
|
29
|
-
<style
|
|
28
|
+
<style>
|
|
30
29
|
.ylf-separator {
|
|
31
30
|
--_separator-size: 1px;
|
|
32
31
|
|
|
33
32
|
flex: none;
|
|
34
33
|
background: var(--ylf-c-border, #e2e8f0);
|
|
34
|
+
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
.ylf-separator--horizontal {
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: var(--_separator-size);
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
.ylf-separator--vertical {
|
|
42
|
+
width: var(--_separator-size);
|
|
43
|
+
height: 100%;
|
|
44
|
+
align-self: stretch;
|
|
45
|
+
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
.ylf-separator--brand {
|
|
48
|
+
background: var(--ylf-c-brand, #2563eb);
|
|
49
|
+
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
.ylf-separator--accent {
|
|
52
|
+
--_separator-size: 2px;
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
background: var(--ylf-accent, var(--ylf-c-brand, #2563eb));
|
|
55
|
+
}
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
.ylf-separator--spectrum {
|
|
58
|
+
--_separator-size: 4px;
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
border-radius: var(--ylf-radius-pill, 999px);
|
|
61
|
+
background: linear-gradient(
|
|
62
|
+
90deg,
|
|
63
|
+
var(--ylf-spectrum-stops, var(--ylf-palette-blue, #2563eb), var(--ylf-palette-sun, #facc15))
|
|
64
|
+
);
|
|
65
|
+
}
|
|
62
66
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
.ylf-separator--spectrum.ylf-separator--vertical {
|
|
68
|
+
background: linear-gradient(
|
|
69
|
+
180deg,
|
|
70
|
+
var(--ylf-spectrum-stops, var(--ylf-palette-blue, #2563eb), var(--ylf-palette-sun, #facc15))
|
|
71
|
+
);
|
|
67
72
|
}
|
|
68
73
|
</style>
|
package/components/YlfSlider.vue
CHANGED
|
@@ -19,7 +19,9 @@ withDefaults(defineProps<{
|
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
const emit = defineEmits<{ valueCommit: [value: number[]] }>()
|
|
22
|
-
const model = defineModel<number[]>({
|
|
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
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
.ylf-slider[data-disabled] {
|
|
61
|
+
opacity: var(--ylf-disabled-opacity, 0.48);
|
|
62
|
+
}
|
|
60
63
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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, #2563eb);
|
|
77
|
+
}
|
|
75
78
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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, #2563eb);
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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, #eff6ff);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
95
99
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
.ylf-slider__thumb:focus-visible {
|
|
101
|
+
outline: var(--ylf-ring-width, 2px) solid var(--ylf-ring-color, var(--ylf-c-brand, #2563eb));
|
|
102
|
+
outline-offset: 2px;
|
|
103
|
+
box-shadow: 0 0 0 4px var(--ylf-c-brand-soft, #eff6ff);
|
|
104
|
+
}
|
|
100
105
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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, #eff6ff);
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
@media (pointer: coarse) {
|
package/components/YlfSwitch.vue
CHANGED
|
@@ -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
|
|
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,72 @@ 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,
|
|
52
|
+
inset 0 0 0 1px var(--ylf-c-edge, rgba(30, 64, 115, 0.12));
|
|
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,
|
|
58
|
-
box-shadow var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard,
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
.ylf-switch--sm {
|
|
61
|
+
--_w: 40px;
|
|
62
|
+
--_h: 24px;
|
|
63
|
+
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
.ylf-switch:focus-visible {
|
|
66
|
+
outline: var(--ylf-ring-width, 2px) solid var(--ylf-ring-color, var(--ylf-c-brand, #2563eb));
|
|
67
|
+
outline-offset: 2px;
|
|
68
|
+
box-shadow:
|
|
69
|
+
0 0 0 3px var(--ylf-c-brand-soft, #eff6ff),
|
|
70
|
+
0 0 0 5px var(--ylf-ring-color, var(--ylf-c-brand, #2563eb));
|
|
71
|
+
}
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
.ylf-switch[data-disabled] {
|
|
74
|
+
opacity: var(--ylf-disabled-opacity, 0.48);
|
|
75
|
+
cursor: not-allowed;
|
|
76
|
+
}
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
/* on 态:晴空蓝主色 */
|
|
79
|
+
.ylf-switch[data-state='checked'] {
|
|
80
|
+
background: var(--ylf-c-brand, #2563eb);
|
|
81
|
+
}
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
/* 选中的强调轨道,前景与填充色成组。 */
|
|
84
|
+
.ylf-switch--accent[data-state='checked'],
|
|
85
|
+
.ylf-switch--aurora[data-state='checked'] {
|
|
86
|
+
background: var(--ylf-accent, var(--ylf-c-brand, #2563eb));
|
|
87
|
+
}
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
.ylf-switch:active:not([data-disabled]) {
|
|
90
|
+
--_stretch: 6px;
|
|
91
|
+
}
|
|
91
92
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
93
|
+
.ylf-switch__thumb {
|
|
94
|
+
display: block;
|
|
95
|
+
width: calc(var(--_h) - var(--_pad) * 2 + var(--_stretch));
|
|
96
|
+
height: calc(var(--_h) - var(--_pad) * 2);
|
|
97
|
+
border-radius: 50%;
|
|
98
|
+
background: #fff;
|
|
99
|
+
box-shadow:
|
|
100
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.4),
|
|
101
|
+
0 1px 2px rgba(0, 0, 0, 0.12),
|
|
102
|
+
0 3px 5px rgba(0, 0, 0, 0.18);
|
|
103
|
+
transform: translateX(var(--_pad));
|
|
104
|
+
transition:
|
|
105
|
+
transform var(--ylf-duration-slow, 480ms)
|
|
106
|
+
var(--ylf-ease-spring, var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1))),
|
|
107
|
+
width var(--ylf-duration-normal, 240ms) var(--ylf-ease-spring, var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)));
|
|
108
|
+
}
|
|
107
109
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
.ylf-switch[data-state='checked'] .ylf-switch__thumb {
|
|
111
|
+
background: var(--ylf-c-text-on-accent, #fff);
|
|
112
|
+
transform: translateX(calc(var(--_w) - var(--_h) + var(--_pad) - var(--_stretch)));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ylf-switch--accent[data-state='checked'] .ylf-switch__thumb,
|
|
116
|
+
.ylf-switch--aurora[data-state='checked'] .ylf-switch__thumb {
|
|
117
|
+
background: var(--ylf-accent-on, var(--ylf-c-text-on-accent, #fff));
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -121,6 +123,7 @@ const checked = defineModel<boolean>({ default: false })
|
|
|
121
123
|
transition: none;
|
|
122
124
|
}
|
|
123
125
|
}
|
|
126
|
+
|
|
124
127
|
@media (pointer: coarse) {
|
|
125
128
|
.ylf-switch {
|
|
126
129
|
position: relative;
|
|
@@ -128,16 +131,16 @@ const checked = defineModel<boolean>({ default: false })
|
|
|
128
131
|
margin-block: max(0px, calc((var(--ylf-touch-target, 44px) - var(--_h)) / 2));
|
|
129
132
|
margin-inline: max(0px, calc((var(--ylf-touch-target, 44px) - var(--_w)) / 2));
|
|
130
133
|
touch-action: manipulation;
|
|
134
|
+
}
|
|
131
135
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
136
|
+
.ylf-switch::before {
|
|
137
|
+
position: absolute;
|
|
138
|
+
top: 50%;
|
|
139
|
+
left: 50%;
|
|
140
|
+
width: max(100%, var(--ylf-touch-target, 44px));
|
|
141
|
+
height: max(100%, var(--ylf-touch-target, 44px));
|
|
142
|
+
transform: translate(-50%, -50%);
|
|
143
|
+
content: '';
|
|
141
144
|
}
|
|
142
145
|
}
|
|
143
146
|
</style>
|
package/components/YlfTabs.vue
CHANGED
|
@@ -47,7 +47,7 @@ const model = defineModel<string>()
|
|
|
47
47
|
</TabsRoot>
|
|
48
48
|
</template>
|
|
49
49
|
|
|
50
|
-
<style
|
|
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:
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
.ylf-tabs__trigger[data-state='active'] {
|
|
81
|
+
color: var(--ylf-c-brand, #2563eb);
|
|
82
|
+
background: color-mix(in srgb, var(--ylf-c-brand-soft, #eff6ff) 65%, transparent);
|
|
83
|
+
}
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
.ylf-tabs__trigger[data-disabled] {
|
|
86
|
+
opacity: var(--ylf-disabled-opacity, 0.48);
|
|
87
|
+
cursor: not-allowed;
|
|
88
|
+
}
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
90
|
+
.ylf-tabs__trigger:focus-visible {
|
|
91
|
+
outline: var(--ylf-ring-width, 2px) solid var(--ylf-ring-color, var(--ylf-c-brand, #2563eb));
|
|
92
|
+
outline-offset: -3px;
|
|
93
|
+
border-radius: var(--ylf-radius-sm, 10px);
|
|
94
|
+
box-shadow: 0 0 0 3px var(--ylf-c-brand-soft, #eff6ff);
|
|
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;
|
|
103
|
+
border-radius: var(--ylf-radius-pill, 999px);
|
|
104
104
|
background: var(--ylf-c-brand, #2563eb);
|
|
105
105
|
box-shadow: 0 1px 4px color-mix(in srgb, var(--ylf-c-brand, #2563eb) 25%, transparent);
|
|
106
106
|
transform: translateX(var(--reka-tabs-indicator-position));
|
|
107
107
|
transition:
|
|
108
|
-
transform var(--ylf-duration-slow, 480ms)
|
|
109
|
-
|
|
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
|
-
|
|
116
|
-
|
|
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
|
|
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:
|
|
43
|
+
font-size: var(--ylf-control-font-size-sm, 0.8125rem);
|
|
44
44
|
line-height: 1.5;
|
|
45
|
-
color: var(--ylf-c-bg, #
|
|
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, #
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
58
|
-
|
|
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
|
-
|
|
62
|
-
|
|
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
|
-
|
|
75
|
-
|
|
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 {
|
package/components/ai-prompt.ts
CHANGED
|
@@ -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
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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 => ({
|
|
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'
|
|
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')
|
package/components/cloud.ts
CHANGED
|
@@ -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 = [
|
|
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
|
+
}
|