@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.
- package/README.md +5 -6
- package/components/YlfAccordion.vue +30 -29
- package/components/YlfAgentCard.vue +6 -6
- package/components/YlfAgentStatus.vue +5 -5
- package/components/YlfAgentTask.vue +4 -4
- package/components/YlfAiPromptLauncher.vue +19 -9
- package/components/YlfAvatar.vue +31 -31
- package/components/YlfBadge.vue +93 -74
- package/components/YlfBottomMenu.vue +5 -5
- package/components/YlfBottomMenuItem.vue +15 -15
- package/components/YlfButton.vue +307 -267
- package/components/YlfCard.vue +32 -32
- package/components/YlfCheckbox.vue +62 -55
- package/components/YlfCloud.vue +5 -18
- package/components/YlfDialog.vue +47 -46
- package/components/YlfDropdownMenu.vue +55 -57
- package/components/YlfInput.vue +24 -17
- 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 +12 -8
- package/components/YlfRadioGroup.vue +73 -58
- package/components/YlfScrollFade.vue +1 -1
- package/components/YlfSegmentedControl.vue +22 -16
- package/components/YlfSelect.vue +83 -79
- package/components/YlfSeparator.vue +31 -26
- package/components/YlfSlider.vue +49 -46
- package/components/YlfSwitch.vue +68 -64
- package/components/YlfTabs.vue +32 -30
- package/components/YlfTooltip.vue +30 -27
- package/components/ai-prompt.ts +33 -6
- package/components/badge/index.md +2 -2
- package/components/button/index.md +2 -2
- package/components/cloud.ts +21 -1
- package/components/navigation-indicator.ts +9 -3
- package/components/scroll-fade.ts +3 -1
- 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 +5 -3
- 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/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 +6 -3
- package/components/_navigation.scss +0 -38
package/components/YlfButton.vue
CHANGED
|
@@ -35,7 +35,6 @@ const props = withDefaults(defineProps<{
|
|
|
35
35
|
tag?: string
|
|
36
36
|
}>(), {
|
|
37
37
|
variant: 'primary',
|
|
38
|
-
tone: 'blue',
|
|
39
38
|
appearance: 'solid',
|
|
40
39
|
size: 'md',
|
|
41
40
|
iconOnly: false,
|
|
@@ -62,8 +61,11 @@ const classes = computed(() => [
|
|
|
62
61
|
])
|
|
63
62
|
|
|
64
63
|
function onClick(e: MouseEvent) {
|
|
65
|
-
if (props.disabled || props.loading)
|
|
64
|
+
if (props.disabled || props.loading) {
|
|
65
|
+
e.preventDefault()
|
|
66
|
+
e.stopPropagation()
|
|
66
67
|
return
|
|
68
|
+
}
|
|
67
69
|
emit('click', e)
|
|
68
70
|
}
|
|
69
71
|
</script>
|
|
@@ -75,7 +77,9 @@ function onClick(e: MouseEvent) {
|
|
|
75
77
|
:class="classes"
|
|
76
78
|
:data-ylf-tone="tone"
|
|
77
79
|
:type="tag === 'button' ? 'button' : undefined"
|
|
78
|
-
:disabled="tag === 'button' ?
|
|
80
|
+
:disabled="tag === 'button' ? disabled : undefined"
|
|
81
|
+
:aria-disabled="disabled || loading ? 'true' : undefined"
|
|
82
|
+
:tabindex="tag !== 'button' && disabled ? -1 : undefined"
|
|
79
83
|
:aria-busy="loading || undefined"
|
|
80
84
|
@click="onClick"
|
|
81
85
|
>
|
|
@@ -85,10 +89,10 @@ function onClick(e: MouseEvent) {
|
|
|
85
89
|
</component>
|
|
86
90
|
</template>
|
|
87
91
|
|
|
88
|
-
<style
|
|
92
|
+
<style>
|
|
89
93
|
.ylf-button {
|
|
90
|
-
--_radius: var(--ylf-radius, 14px);
|
|
91
|
-
--_fill: var(--ylf-c-brand, #
|
|
94
|
+
--_radius: var(--ylf-control-radius, var(--ylf-radius, 14px));
|
|
95
|
+
--_fill: var(--ylf-c-brand, #006aeb);
|
|
92
96
|
|
|
93
97
|
box-sizing: border-box;
|
|
94
98
|
max-width: 100%;
|
|
@@ -109,322 +113,358 @@ function onClick(e: MouseEvent) {
|
|
|
109
113
|
user-select: none;
|
|
110
114
|
text-decoration: none;
|
|
111
115
|
transition:
|
|
112
|
-
transform var(--ylf-duration-slow, 480ms)
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
--_radius: var(--ylf-radius-pill, 999px);
|
|
120
|
-
}
|
|
116
|
+
transform var(--ylf-duration-slow, 480ms)
|
|
117
|
+
var(--ylf-ease-spring, var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1))),
|
|
118
|
+
box-shadow var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
|
|
119
|
+
background var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
|
|
120
|
+
color var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
|
|
121
|
+
border-color var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
|
|
122
|
+
}
|
|
121
123
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
124
|
+
.ylf-button.is-round {
|
|
125
|
+
--_radius: var(--ylf-radius-pill, 999px);
|
|
126
|
+
}
|
|
126
127
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
0 0 0 3px var(--ylf-c-brand-soft, #eff6ff),
|
|
132
|
-
0 0 0 5px var(--ylf-c-brand, #2563eb);
|
|
133
|
-
}
|
|
128
|
+
.ylf-button.is-block {
|
|
129
|
+
display: flex;
|
|
130
|
+
width: 100%;
|
|
131
|
+
}
|
|
134
132
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
133
|
+
.ylf-button:focus-visible {
|
|
134
|
+
outline: var(--ylf-ring-width, 2px) solid var(--ylf-ring-color, var(--ylf-c-brand, #006aeb));
|
|
135
|
+
outline-offset: 4px;
|
|
136
|
+
box-shadow:
|
|
137
|
+
0 0 0 3px var(--ylf-c-brand-soft, #f0f7ff),
|
|
138
|
+
0 0 0 5px var(--ylf-ring-color, var(--ylf-c-brand, #006aeb));
|
|
139
|
+
}
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
/* --- sizes --- */
|
|
142
|
+
.ylf-button--sm {
|
|
143
|
+
padding: 8px 18px;
|
|
144
|
+
font-size: var(--ylf-control-font-size-sm, 0.8125rem);
|
|
145
|
+
}
|
|
145
146
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
.ylf-button--md {
|
|
148
|
+
padding: 11px 24px;
|
|
149
|
+
font-size: var(--ylf-control-font-size, 0.9375rem);
|
|
150
|
+
}
|
|
150
151
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
font-size: 16px;
|
|
156
|
-
line-height: 22px;
|
|
157
|
-
}
|
|
152
|
+
.ylf-button--lg {
|
|
153
|
+
padding: 14px 30px;
|
|
154
|
+
font-size: 17px;
|
|
155
|
+
}
|
|
158
156
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
157
|
+
.ylf-button--xl {
|
|
158
|
+
--_min-height: var(--ylf-control-h-xl, 56px);
|
|
159
|
+
min-height: var(--_min-height);
|
|
160
|
+
padding: 16px 28px;
|
|
161
|
+
font-size: var(--ylf-text-base, 1rem);
|
|
162
|
+
line-height: 22px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.ylf-button.is-icon-only {
|
|
166
|
+
width: 36px;
|
|
167
|
+
height: 36px;
|
|
168
|
+
min-height: 36px;
|
|
169
|
+
flex: none;
|
|
170
|
+
padding: 0;
|
|
171
|
+
font-size: 18px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.ylf-button.is-icon-only.ylf-button--sm {
|
|
175
|
+
width: 32px;
|
|
176
|
+
height: 32px;
|
|
177
|
+
min-height: 32px;
|
|
178
|
+
font-size: 16px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.ylf-button.is-icon-only.ylf-button--lg,
|
|
182
|
+
.ylf-button.is-icon-only.ylf-button--xl {
|
|
183
|
+
width: var(--ylf-touch-target, 44px);
|
|
184
|
+
height: var(--ylf-touch-target, 44px);
|
|
185
|
+
min-height: var(--ylf-touch-target, 44px);
|
|
186
|
+
font-size: 20px;
|
|
187
|
+
}
|
|
187
188
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
box-shadow: 0 0 0 5px var(--ylf-hero-end, #0369a1);
|
|
211
|
-
}
|
|
189
|
+
.ylf-button.is-icon-only:focus-visible {
|
|
190
|
+
outline-offset: -2px;
|
|
191
|
+
box-shadow: none;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* Opt-in brand entrance; everyday primary actions keep their solid appearance. */
|
|
195
|
+
.ylf-button--hero {
|
|
196
|
+
color: var(--ylf-hero-foreground, #fff);
|
|
197
|
+
background: var(--ylf-hero-background, linear-gradient(115deg, #006aeb, #005ed6 58%, #0051bd));
|
|
198
|
+
border-color: var(--ylf-hero-border, rgb(255 255 255 / 0.16));
|
|
199
|
+
box-shadow: var(--ylf-hero-shadow, inset 0 1px 0 rgb(255 255 255 / 0.24), 0 12px 26px -14px rgb(0 81 189 / 0.58));
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@media (hover: hover) and (pointer: fine) {
|
|
203
|
+
.ylf-button--hero:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
204
|
+
background: var(--ylf-hero-background-hover, linear-gradient(115deg, #0057c7, #004db3 58%, #004199));
|
|
205
|
+
box-shadow: var(
|
|
206
|
+
--ylf-hero-shadow-hover,
|
|
207
|
+
inset 0 1px 0 rgb(255 255 255 / 0.3),
|
|
208
|
+
0 14px 30px -14px rgb(0 81 189 / 0.58)
|
|
209
|
+
);
|
|
210
|
+
transform: translateY(var(--ylf-hover-lift, -1px));
|
|
212
211
|
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.ylf-button--hero:focus-visible {
|
|
215
|
+
outline: var(--ylf-ring-width, 2px) solid var(--ylf-hero-foreground, #fff);
|
|
216
|
+
outline-offset: 3px;
|
|
217
|
+
box-shadow: 0 0 0 5px var(--ylf-hero-end, #0051bd);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* --- primary:晴空蓝实色(主操作,单色不花) --- */
|
|
221
|
+
.ylf-button--primary {
|
|
222
|
+
color: var(--ylf-c-text-on-accent, #fff);
|
|
223
|
+
background: var(--ylf-c-brand, #006aeb);
|
|
224
|
+
border-color: color-mix(in srgb, var(--_fill) 85%, #000);
|
|
225
|
+
box-shadow:
|
|
226
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.22),
|
|
227
|
+
0 2px 0 color-mix(in srgb, var(--_fill) 80%, #000),
|
|
228
|
+
0 6px 14px -6px color-mix(in srgb, var(--_fill) 40%, transparent);
|
|
229
|
+
}
|
|
213
230
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
border-color: color-mix(in srgb, var(--_fill) 85%, #000);
|
|
231
|
+
@media (hover: hover) and (pointer: fine) {
|
|
232
|
+
.ylf-button--primary:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
233
|
+
background: var(--ylf-c-brand-hover, #0057c7);
|
|
234
|
+
transform: translateY(var(--ylf-hover-lift, -1px));
|
|
219
235
|
box-shadow:
|
|
220
236
|
inset 0 1px 0 rgba(255, 255, 255, 0.22),
|
|
221
|
-
0
|
|
222
|
-
0
|
|
223
|
-
|
|
224
|
-
@media (hover: hover) and (pointer: fine) {
|
|
225
|
-
&:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
226
|
-
background: var(--ylf-c-brand-hover, #1d4ed8);
|
|
227
|
-
transform: translateY(var(--ylf-hover-lift, -1px));
|
|
228
|
-
box-shadow:
|
|
229
|
-
inset 0 1px 0 rgba(255, 255, 255, 0.22),
|
|
230
|
-
0 3px 0 color-mix(in srgb, var(--_fill) 80%, #000),
|
|
231
|
-
0 8px 18px -6px color-mix(in srgb, var(--_fill) 35%, transparent);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
237
|
+
0 3px 0 color-mix(in srgb, var(--_fill) 80%, #000),
|
|
238
|
+
0 8px 18px -6px color-mix(in srgb, var(--_fill) 35%, transparent);
|
|
234
239
|
}
|
|
240
|
+
}
|
|
235
241
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
&:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
253
|
-
background: var(--ylf-accent-hover, var(--ylf-c-brand-hover, #1d4ed8));
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
242
|
+
/* 强调色来自共享上下文;实色上的文字与填充色成组维护。 */
|
|
243
|
+
.ylf-button--accent,
|
|
244
|
+
.ylf-button--aurora {
|
|
245
|
+
--_fill: var(--ylf-accent, var(--ylf-c-brand, #006aeb));
|
|
246
|
+
--_color: var(--ylf-accent, var(--ylf-c-brand, #006aeb));
|
|
247
|
+
--_soft: var(--ylf-accent-soft, var(--ylf-c-brand-soft, #f0f7ff));
|
|
248
|
+
--_text: var(--ylf-accent-text, var(--ylf-c-brand, #006aeb));
|
|
249
|
+
|
|
250
|
+
color: var(--ylf-accent-on, var(--ylf-c-text-on-accent, #fff));
|
|
251
|
+
background: var(--ylf-accent, var(--ylf-c-brand, #006aeb));
|
|
252
|
+
border-color: color-mix(in srgb, var(--_fill) 85%, #000);
|
|
253
|
+
box-shadow:
|
|
254
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.22),
|
|
255
|
+
0 2px 0 color-mix(in srgb, var(--_fill) 80%, #000),
|
|
256
|
+
0 6px 14px -6px color-mix(in srgb, var(--_fill) 32%, transparent);
|
|
257
|
+
}
|
|
257
258
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
background: var(--ylf-c-
|
|
262
|
-
|
|
263
|
-
box-shadow: var(--ylf-shadow-control);
|
|
264
|
-
|
|
265
|
-
@media (hover: hover) and (pointer: fine) {
|
|
266
|
-
&:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
267
|
-
color: var(--ylf-c-brand, #2563eb);
|
|
268
|
-
border-color: var(--ylf-c-brand, #2563eb);
|
|
269
|
-
transform: translateY(var(--ylf-hover-lift, -1px));
|
|
270
|
-
}
|
|
271
|
-
}
|
|
259
|
+
@media (hover: hover) and (pointer: fine) {
|
|
260
|
+
.ylf-button--accent:hover:not(.is-disabled, .is-loading, :disabled),
|
|
261
|
+
.ylf-button--aurora:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
262
|
+
background: var(--ylf-accent-hover, var(--ylf-c-brand-hover, #0057c7));
|
|
263
|
+
transform: translateY(var(--ylf-hover-lift, -1px));
|
|
272
264
|
}
|
|
265
|
+
}
|
|
273
266
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
&:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
282
|
-
transform: translateY(var(--ylf-hover-lift, -1px));
|
|
283
|
-
box-shadow: var(--ylf-shadow-sm, 0 2px 8px -2px rgba(15, 23, 42, 0.12));
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
267
|
+
/* --- secondary:描边 --- */
|
|
268
|
+
.ylf-button--secondary {
|
|
269
|
+
color: var(--ylf-c-text, #0f172a);
|
|
270
|
+
background: var(--ylf-c-surface, #fff);
|
|
271
|
+
border-color: var(--ylf-c-border-control, #7d8ca0);
|
|
272
|
+
box-shadow: var(--ylf-shadow-control);
|
|
273
|
+
}
|
|
287
274
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
color: var(--ylf-c-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
@media (hover: hover) and (pointer: fine) {
|
|
294
|
-
&:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
295
|
-
color: var(--ylf-c-brand, #2563eb);
|
|
296
|
-
background: var(--ylf-c-brand-soft, #eff6ff);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
&[aria-pressed='true'] {
|
|
301
|
-
color: var(--ylf-c-brand, #2563eb);
|
|
302
|
-
background: var(--ylf-c-brand-soft, #eff6ff);
|
|
303
|
-
}
|
|
275
|
+
@media (hover: hover) and (pointer: fine) {
|
|
276
|
+
.ylf-button--secondary:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
277
|
+
color: var(--ylf-c-brand, #006aeb);
|
|
278
|
+
border-color: var(--ylf-c-brand, #006aeb);
|
|
279
|
+
transform: translateY(var(--ylf-hover-lift, -1px));
|
|
304
280
|
}
|
|
281
|
+
}
|
|
305
282
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
--_soft: var(--ylf-status-#{$status}-soft, var(--ylf-c-bg-soft, #f1f5f9));
|
|
313
|
-
--_text: var(--ylf-status-#{$status}-text, #{$on});
|
|
314
|
-
|
|
315
|
-
color: var(--ylf-status-#{$status}-on, $on);
|
|
316
|
-
background: var(--ylf-status-#{$status}, $fill);
|
|
317
|
-
|
|
318
|
-
@media (hover: hover) and (pointer: fine) {
|
|
319
|
-
&:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
320
|
-
background: var(--ylf-status-#{$status}-hover, $hover);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
283
|
+
/* --- soft:柔色填充 --- */
|
|
284
|
+
.ylf-button--soft {
|
|
285
|
+
color: var(--ylf-c-brand, #006aeb);
|
|
286
|
+
background: var(--ylf-c-brand-soft, #f0f7ff);
|
|
287
|
+
border-color: color-mix(in srgb, var(--ylf-c-brand, #006aeb) 12%, transparent);
|
|
288
|
+
}
|
|
325
289
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
&--danger {
|
|
331
|
-
&.is-soft,
|
|
332
|
-
&.is-outline {
|
|
333
|
-
color: var(--_text);
|
|
334
|
-
box-shadow: none;
|
|
335
|
-
|
|
336
|
-
@media (hover: hover) and (pointer: fine) {
|
|
337
|
-
&:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
338
|
-
background: var(--_soft);
|
|
339
|
-
border-color: var(--_text);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
&:focus-visible {
|
|
344
|
-
outline: 2px solid var(--ylf-c-brand, #2563eb);
|
|
345
|
-
outline-offset: 3px;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
&.is-soft {
|
|
350
|
-
background: var(--_soft);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
&.is-outline {
|
|
354
|
-
background: transparent;
|
|
355
|
-
border-color: var(--_text);
|
|
356
|
-
}
|
|
290
|
+
@media (hover: hover) and (pointer: fine) {
|
|
291
|
+
.ylf-button--soft:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
292
|
+
transform: translateY(var(--ylf-hover-lift, -1px));
|
|
293
|
+
box-shadow: var(--ylf-shadow-sm, 0 2px 8px -2px rgba(15, 23, 42, 0.12));
|
|
357
294
|
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/* --- ghost:幽灵 --- */
|
|
298
|
+
.ylf-button--ghost {
|
|
299
|
+
color: var(--ylf-c-text-2, #475569);
|
|
300
|
+
background: transparent;
|
|
301
|
+
}
|
|
358
302
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
303
|
+
@media (hover: hover) and (pointer: fine) {
|
|
304
|
+
.ylf-button--ghost:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
305
|
+
color: var(--ylf-c-brand, #006aeb);
|
|
306
|
+
background: var(--ylf-c-brand-soft, #f0f7ff);
|
|
363
307
|
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.ylf-button--ghost[aria-pressed='true'] {
|
|
311
|
+
color: var(--ylf-c-brand, #006aeb);
|
|
312
|
+
background: var(--ylf-c-brand-soft, #f0f7ff);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* --- 语义色 --- */
|
|
316
|
+
.ylf-button--success {
|
|
317
|
+
--_color: var(--ylf-status-success, #22c55e);
|
|
318
|
+
--_soft: var(--ylf-status-success-soft, var(--ylf-c-bg-soft, #f1f5f9));
|
|
319
|
+
--_text: var(--ylf-status-success-text, #166534);
|
|
320
|
+
|
|
321
|
+
color: var(--ylf-status-success-on, #052e16);
|
|
322
|
+
background: var(--ylf-status-success, #22c55e);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.ylf-button--warning {
|
|
326
|
+
--_color: var(--ylf-status-warning, #facc15);
|
|
327
|
+
--_soft: var(--ylf-status-warning-soft, var(--ylf-c-bg-soft, #f1f5f9));
|
|
328
|
+
--_text: var(--ylf-status-warning-text, #854d0e);
|
|
329
|
+
|
|
330
|
+
color: var(--ylf-status-warning-on, #64380e);
|
|
331
|
+
background: var(--ylf-status-warning, #facc15);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.ylf-button--danger {
|
|
335
|
+
--_color: var(--ylf-status-danger, #dc2626);
|
|
336
|
+
--_soft: var(--ylf-status-danger-soft, var(--ylf-c-bg-soft, #f1f5f9));
|
|
337
|
+
--_text: var(--ylf-status-danger-text, #b91c1c);
|
|
338
|
+
|
|
339
|
+
color: var(--ylf-status-danger-on, #fff);
|
|
340
|
+
background: var(--ylf-status-danger, #dc2626);
|
|
341
|
+
}
|
|
364
342
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
box-shadow: none;
|
|
370
|
-
transform: none !important;
|
|
343
|
+
@media (hover: hover) and (pointer: fine) {
|
|
344
|
+
.ylf-button--success:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
345
|
+
background: var(--ylf-status-success-hover, #18a84e);
|
|
346
|
+
transform: translateY(var(--ylf-hover-lift, -1px));
|
|
371
347
|
}
|
|
372
348
|
|
|
373
|
-
|
|
374
|
-
|
|
349
|
+
.ylf-button--warning:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
350
|
+
background: var(--ylf-status-warning-hover, #eab308);
|
|
351
|
+
transform: translateY(var(--ylf-hover-lift, -1px));
|
|
375
352
|
}
|
|
376
353
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
box-sizing: border-box;
|
|
381
|
-
max-width: 100%;
|
|
382
|
-
display: inline-flex;
|
|
383
|
-
align-items: center;
|
|
354
|
+
.ylf-button--danger:hover:not(.is-disabled, .is-loading, :disabled) {
|
|
355
|
+
background: var(--ylf-status-danger-hover, #b91c1c);
|
|
356
|
+
transform: translateY(var(--ylf-hover-lift, -1px));
|
|
384
357
|
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
:is(.ylf-button--accent, .ylf-button--aurora, .ylf-button--success, .ylf-button--warning, .ylf-button--danger):is(
|
|
361
|
+
.is-soft,
|
|
362
|
+
.is-outline
|
|
363
|
+
) {
|
|
364
|
+
color: var(--_text);
|
|
365
|
+
box-shadow: none;
|
|
366
|
+
}
|
|
385
367
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
368
|
+
@media (hover: hover) and (pointer: fine) {
|
|
369
|
+
:is(.ylf-button--accent, .ylf-button--aurora, .ylf-button--success, .ylf-button--warning, .ylf-button--danger):is(
|
|
370
|
+
.is-soft,
|
|
371
|
+
.is-outline
|
|
372
|
+
):hover:not(.is-disabled, .is-loading, :disabled) {
|
|
373
|
+
background: var(--_soft);
|
|
374
|
+
border-color: var(--_text);
|
|
393
375
|
}
|
|
394
376
|
}
|
|
395
377
|
|
|
378
|
+
:is(.ylf-button--accent, .ylf-button--aurora, .ylf-button--success, .ylf-button--warning, .ylf-button--danger):is(
|
|
379
|
+
.is-soft,
|
|
380
|
+
.is-outline
|
|
381
|
+
):focus-visible {
|
|
382
|
+
outline: var(--ylf-ring-width, 2px) solid var(--ylf-ring-color, var(--ylf-c-brand, #006aeb));
|
|
383
|
+
outline-offset: 3px;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
:is(.ylf-button--accent, .ylf-button--aurora, .ylf-button--success, .ylf-button--warning, .ylf-button--danger).is-soft {
|
|
387
|
+
background: var(--_soft);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
:is(
|
|
391
|
+
.ylf-button--accent,
|
|
392
|
+
.ylf-button--aurora,
|
|
393
|
+
.ylf-button--success,
|
|
394
|
+
.ylf-button--warning,
|
|
395
|
+
.ylf-button--danger
|
|
396
|
+
).is-outline {
|
|
397
|
+
background: transparent;
|
|
398
|
+
border-color: var(--_text);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/* --- 状态 --- */
|
|
402
|
+
.ylf-button:active:not(.is-disabled, .is-loading, :disabled) {
|
|
403
|
+
transition-duration: var(--ylf-duration-press, 100ms);
|
|
404
|
+
transform: scale(var(--ylf-press-scale, 0.98));
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.ylf-button.is-disabled,
|
|
408
|
+
.ylf-button:disabled {
|
|
409
|
+
opacity: var(--ylf-disabled-opacity, 0.48);
|
|
410
|
+
cursor: not-allowed;
|
|
411
|
+
box-shadow: none;
|
|
412
|
+
transform: none !important;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.ylf-button.is-loading {
|
|
416
|
+
cursor: progress;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.ylf-button__label {
|
|
420
|
+
min-width: 0;
|
|
421
|
+
line-height: inherit;
|
|
422
|
+
box-sizing: border-box;
|
|
423
|
+
max-width: 100%;
|
|
424
|
+
display: inline-flex;
|
|
425
|
+
align-items: center;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.ylf-button__spinner {
|
|
429
|
+
width: 1em;
|
|
430
|
+
height: 1em;
|
|
431
|
+
border: 2px solid currentColor;
|
|
432
|
+
border-right-color: transparent;
|
|
433
|
+
border-radius: 50%;
|
|
434
|
+
animation: ylf-button-spin 0.7s linear infinite;
|
|
435
|
+
}
|
|
436
|
+
|
|
396
437
|
@keyframes ylf-button-spin {
|
|
397
438
|
to {
|
|
398
439
|
transform: rotate(360deg);
|
|
399
440
|
}
|
|
400
441
|
}
|
|
401
442
|
|
|
402
|
-
@media (pointer: coarse) {
|
|
403
|
-
.ylf-button.is-icon-only {
|
|
404
|
-
min-width: 44px;
|
|
405
|
-
min-height: 44px;
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
443
|
@media (prefers-reduced-motion: reduce) {
|
|
410
444
|
.ylf-button {
|
|
411
445
|
transition: none;
|
|
446
|
+
}
|
|
412
447
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
}
|
|
448
|
+
.ylf-button:is(:hover, :active):not(.is-disabled, .is-loading, :disabled) {
|
|
449
|
+
transform: none;
|
|
450
|
+
transition: none;
|
|
417
451
|
}
|
|
418
452
|
|
|
419
453
|
.ylf-button__spinner {
|
|
420
454
|
animation: none;
|
|
421
455
|
}
|
|
422
456
|
}
|
|
457
|
+
|
|
423
458
|
@media (pointer: coarse) {
|
|
424
459
|
.ylf-button {
|
|
425
460
|
min-width: var(--ylf-touch-target, 44px);
|
|
426
461
|
min-height: max(var(--_min-height, 0px), var(--ylf-touch-target, 44px));
|
|
427
462
|
line-height: 1.4;
|
|
428
463
|
}
|
|
464
|
+
|
|
465
|
+
.ylf-button.is-icon-only {
|
|
466
|
+
min-width: var(--ylf-touch-target, 44px);
|
|
467
|
+
min-height: var(--ylf-touch-target, 44px);
|
|
468
|
+
}
|
|
429
469
|
}
|
|
430
470
|
</style>
|