@yh-ui/components 0.1.12 → 0.1.15

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 (90) hide show
  1. package/dist/ai-artifacts/src/ai-artifacts.d.ts +1 -1
  2. package/dist/ai-artifacts/src/ai-artifacts.d.vue.ts +18 -1
  3. package/dist/ai-artifacts/src/ai-artifacts.vue +30 -2
  4. package/dist/ai-artifacts/src/ai-artifacts.vue.d.ts +18 -1
  5. package/dist/ai-editor-sender/src/ai-editor-sender.d.vue.ts +2 -2
  6. package/dist/ai-editor-sender/src/ai-editor-sender.vue.d.ts +2 -2
  7. package/dist/ai-mention/__tests__/ai-mention.ssr.test.cjs +38 -0
  8. package/dist/ai-mention/__tests__/ai-mention.ssr.test.d.ts +1 -0
  9. package/dist/ai-mention/__tests__/ai-mention.ssr.test.mjs +37 -0
  10. package/dist/ai-mention/__tests__/ai-mention.test.cjs +113 -0
  11. package/dist/ai-mention/__tests__/ai-mention.test.d.ts +1 -0
  12. package/dist/ai-mention/__tests__/ai-mention.test.mjs +84 -0
  13. package/dist/ai-mention/index.cjs +26 -0
  14. package/dist/ai-mention/index.d.ts +29 -0
  15. package/dist/ai-mention/index.mjs +5 -0
  16. package/dist/ai-mention/src/ai-mention.cjs +95 -0
  17. package/dist/ai-mention/src/ai-mention.css +545 -0
  18. package/dist/ai-mention/src/ai-mention.d.ts +99 -0
  19. package/dist/ai-mention/src/ai-mention.d.vue.ts +68 -0
  20. package/dist/ai-mention/src/ai-mention.mjs +89 -0
  21. package/dist/ai-mention/src/ai-mention.vue +650 -0
  22. package/dist/ai-mention/src/ai-mention.vue.d.ts +68 -0
  23. package/dist/ai-sender/__tests__/ai-sender.test.cjs +17 -10
  24. package/dist/ai-sender/__tests__/ai-sender.test.mjs +17 -10
  25. package/dist/ai-sender/src/ai-sender.cjs +7 -0
  26. package/dist/ai-sender/src/ai-sender.d.ts +7 -0
  27. package/dist/ai-sender/src/ai-sender.d.vue.ts +8 -3
  28. package/dist/ai-sender/src/ai-sender.mjs +7 -0
  29. package/dist/ai-sender/src/ai-sender.vue +25 -18
  30. package/dist/ai-sender/src/ai-sender.vue.d.ts +8 -3
  31. package/dist/ai-sources/src/ai-sources.d.vue.ts +2 -2
  32. package/dist/ai-sources/src/ai-sources.vue +41 -57
  33. package/dist/ai-sources/src/ai-sources.vue.d.ts +2 -2
  34. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.cjs +19 -2
  35. package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.mjs +12 -2
  36. package/dist/ai-voice-trigger/src/ai-voice-trigger.cjs +32 -0
  37. package/dist/ai-voice-trigger/src/ai-voice-trigger.css +111 -12
  38. package/dist/ai-voice-trigger/src/ai-voice-trigger.d.ts +32 -0
  39. package/dist/ai-voice-trigger/src/ai-voice-trigger.d.vue.ts +22 -2
  40. package/dist/ai-voice-trigger/src/ai-voice-trigger.mjs +32 -0
  41. package/dist/ai-voice-trigger/src/ai-voice-trigger.vue +201 -50
  42. package/dist/ai-voice-trigger/src/ai-voice-trigger.vue.d.ts +22 -2
  43. package/dist/alert/src/alert.d.vue.ts +1 -1
  44. package/dist/alert/src/alert.vue.d.ts +1 -1
  45. package/dist/autocomplete/src/autocomplete.d.vue.ts +2 -2
  46. package/dist/autocomplete/src/autocomplete.vue.d.ts +2 -2
  47. package/dist/calendar/src/calendar.d.vue.ts +1 -1
  48. package/dist/calendar/src/calendar.vue.d.ts +1 -1
  49. package/dist/date-picker/src/date-picker.d.vue.ts +2 -2
  50. package/dist/date-picker/src/date-picker.vue.d.ts +2 -2
  51. package/dist/dialog/src/dialog.d.vue.ts +8 -8
  52. package/dist/dialog/src/dialog.vue.d.ts +8 -8
  53. package/dist/drawer/index.d.ts +42 -1
  54. package/dist/drawer/src/drawer.d.vue.ts +4 -4
  55. package/dist/drawer/src/drawer.vue.d.ts +4 -4
  56. package/dist/icon/src/icons/index.cjs +7 -2
  57. package/dist/icon/src/icons/index.d.ts +1 -0
  58. package/dist/icon/src/icons/index.mjs +7 -1
  59. package/dist/index.cjs +13 -1
  60. package/dist/index.d.ts +1 -0
  61. package/dist/index.mjs +4 -1
  62. package/dist/infinite-scroll/src/infinite-scroll.d.vue.ts +1 -1
  63. package/dist/infinite-scroll/src/infinite-scroll.vue.d.ts +1 -1
  64. package/dist/input/index.d.ts +3 -3
  65. package/dist/input/src/input.d.vue.ts +1 -1
  66. package/dist/input/src/input.vue.d.ts +1 -1
  67. package/dist/input-number/index.d.ts +3 -3
  68. package/dist/input-number/src/input-number.d.vue.ts +1 -1
  69. package/dist/input-number/src/input-number.vue.d.ts +1 -1
  70. package/dist/input-tag/src/input-tag.d.vue.ts +2 -2
  71. package/dist/input-tag/src/input-tag.vue.d.ts +2 -2
  72. package/dist/mention/index.d.ts +181 -1
  73. package/dist/mention/src/mention.d.vue.ts +5 -5
  74. package/dist/mention/src/mention.vue +6 -2
  75. package/dist/mention/src/mention.vue.d.ts +5 -5
  76. package/dist/message/src/message.d.vue.ts +1 -1
  77. package/dist/message/src/message.vue.d.ts +1 -1
  78. package/dist/notification/src/notification.d.vue.ts +1 -1
  79. package/dist/notification/src/notification.vue.d.ts +1 -1
  80. package/dist/select/src/select.d.vue.ts +3 -3
  81. package/dist/select/src/select.vue.d.ts +3 -3
  82. package/dist/skeleton/src/skeleton.d.vue.ts +1 -1
  83. package/dist/skeleton/src/skeleton.vue.d.ts +1 -1
  84. package/dist/table/src/table-column.d.vue.ts +1 -1
  85. package/dist/table/src/table-column.vue.d.ts +1 -1
  86. package/dist/table/src/table.d.vue.ts +2 -2
  87. package/dist/table/src/table.vue.d.ts +2 -2
  88. package/dist/time-picker/src/time-picker.d.vue.ts +1 -1
  89. package/dist/time-picker/src/time-picker.vue.d.ts +1 -1
  90. package/package.json +5 -5
@@ -0,0 +1,650 @@
1
+ <script setup>
2
+ import { useNamespace, useLocale } from "@yh-ui/hooks";
3
+ import { computed, ref, useSlots } from "vue";
4
+ import { aiMentionProps, aiMentionEmits } from "./ai-mention";
5
+ import { YhMention } from "../../mention";
6
+ import { YhIcon } from "../../icon";
7
+ import { useComponentTheme } from "@yh-ui/theme";
8
+ defineOptions({
9
+ name: "YhAiMention"
10
+ });
11
+ const props = defineProps(aiMentionProps);
12
+ const emit = defineEmits(aiMentionEmits);
13
+ const slots = useSlots();
14
+ const ns = useNamespace("ai-mention");
15
+ const { t } = useLocale();
16
+ const { themeStyle } = useComponentTheme("ai-mention", props.themeOverrides);
17
+ const mentionRef = ref(null);
18
+ const filteredOptions = computed(() => {
19
+ if (!props.types || props.types.length === 0) return props.options;
20
+ return props.options.filter((option) => !option.type || props.types.includes(option.type));
21
+ });
22
+ const handleUpdateValue = (val) => {
23
+ emit("update:modelValue", val);
24
+ };
25
+ const handleSelect = (option, trigger) => {
26
+ emit("select", option, trigger);
27
+ };
28
+ const handleSearch = (keyword, trigger) => {
29
+ emit("search", keyword, trigger);
30
+ };
31
+ const getIcon = (type) => {
32
+ switch (type) {
33
+ case "agent":
34
+ return "robot";
35
+ case "document":
36
+ return "document";
37
+ case "table":
38
+ return "table";
39
+ case "knowledge":
40
+ return "book";
41
+ default:
42
+ return "sparkles";
43
+ }
44
+ };
45
+ defineExpose({
46
+ focus: () => mentionRef.value?.focus(),
47
+ blur: () => mentionRef.value?.blur(),
48
+ clear: () => mentionRef.value?.clear(),
49
+ getRef: () => mentionRef.value?.ref,
50
+ insertMention: (option, trigger) => mentionRef.value?.insertMention(option, trigger)
51
+ });
52
+ </script>
53
+
54
+ <template>
55
+ <div :class="ns.b()" :style="themeStyle">
56
+ <YhMention
57
+ ref="mentionRef"
58
+ v-bind="$attrs"
59
+ :model-value="modelValue"
60
+ :options="filteredOptions"
61
+ :triggers="triggers"
62
+ :type="type"
63
+ :placeholder="placeholder || t('ai.mention.placeholder') || '@ \u547C\u53EB Agent\u3001\u6587\u6863\u6216\u8868\u683C...'"
64
+ :disabled="disabled"
65
+ :size="size"
66
+ :loading="loading"
67
+ :filter-option="filterOption"
68
+ :maxlength="maxLength"
69
+ :rows="rows"
70
+ @update:model-value="handleUpdateValue"
71
+ @select="handleSelect"
72
+ @search="handleSearch"
73
+ @focus="emit('focus', $event)"
74
+ @blur="emit('blur', $event)"
75
+ @input="emit('input', $event)"
76
+ @keydown="emit('keydown', $event)"
77
+ >
78
+ <!-- 自定义选项渲染 -->
79
+ <template #option="{ option }: { option: AiMentionOption }">
80
+ <div :class="ns.e('option-item')">
81
+ <div :class="[ns.e('option-icon'), option.type ? ns.em('option-icon', option.type) : '']">
82
+ <YhIcon :name="option.icon || getIcon(option.type)" />
83
+ </div>
84
+ <div :class="ns.e('option-info')">
85
+ <div :class="ns.e('option-label')">{{ option.label || option.value }}</div>
86
+ <div v-if="option.description" :class="ns.e('option-desc')">
87
+ {{ option.description }}
88
+ </div>
89
+ </div>
90
+ <div v-if="option.type" :class="[ns.e('option-tag'), ns.em('option-tag', option.type)]">
91
+ {{ t(`ai.mention.${option.type}`) || option.type }}
92
+ </div>
93
+ </div>
94
+ </template>
95
+
96
+ <!-- 适配其他插槽 -->
97
+ <template v-for="(_, name) in slots" :key="name" #[name]="slotProps">
98
+ <slot :name="name" v-bind="slotProps"></slot>
99
+ </template>
100
+ </YhMention>
101
+ </div>
102
+ </template>
103
+
104
+ <style>
105
+ @charset "UTF-8";
106
+ /**
107
+ * YH-UI CSS Variables
108
+ * 全局 CSS 变量定义 - 业内最佳主题系统
109
+ */
110
+ :root {
111
+ /* ==================== 密度/紧凑度系统 ==================== */
112
+ --yh-density-factor: 1;
113
+ --yh-component-size-default: 32px;
114
+ --yh-component-size-small: 24px;
115
+ --yh-component-size-large: 40px;
116
+ --yh-padding-default: 12px 16px;
117
+ --yh-padding-small: 8px 12px;
118
+ --yh-padding-large: 16px 20px;
119
+ --yh-spacing-unit: 8px;
120
+ /* ==================== 基础颜色 ==================== */
121
+ --yh-color-white: #ffffff;
122
+ --yh-color-black: #000000;
123
+ /* ==================== 颜色系统 ==================== */
124
+ /* 主色 */
125
+ --yh-color-primary: #409eff;
126
+ --yh-color-primary-light-1: #53a8ff;
127
+ --yh-color-primary-light-2: #66b1ff;
128
+ --yh-color-primary-light-3: #79bbff;
129
+ --yh-color-primary-light-4: #8cc5ff;
130
+ --yh-color-primary-light-5: #a0cfff;
131
+ --yh-color-primary-light-6: #b3d8ff;
132
+ --yh-color-primary-light-7: #c6e2ff;
133
+ --yh-color-primary-light-8: #d9ecff;
134
+ --yh-color-primary-light-9: #ecf5ff;
135
+ --yh-color-primary-dark-2: #337ecc;
136
+ /* 成功色 */
137
+ --yh-color-success: #67c23a;
138
+ --yh-color-success-light-3: #95d475;
139
+ --yh-color-success-light-5: #b3e19d;
140
+ --yh-color-success-light-7: #d1edc4;
141
+ --yh-color-success-light-9: #f0f9eb;
142
+ --yh-color-success-dark-2: #529b2e;
143
+ /* 警告色 */
144
+ --yh-color-warning: #e6a23c;
145
+ --yh-color-warning-light-3: #eebe77;
146
+ --yh-color-warning-light-5: #f3d19e;
147
+ --yh-color-warning-light-7: #f8e3c5;
148
+ --yh-color-warning-light-9: #fdf6ec;
149
+ --yh-color-warning-dark-2: #b88230;
150
+ /* 危险色 */
151
+ --yh-color-danger: #f56c6c;
152
+ --yh-color-danger-light-3: #f89898;
153
+ --yh-color-danger-light-5: #fab6b6;
154
+ --yh-color-danger-light-7: #fcd3d3;
155
+ --yh-color-danger-light-9: #fef0f0;
156
+ --yh-color-danger-dark-2: #c45656;
157
+ /* 信息色 */
158
+ --yh-color-info: #909399;
159
+ --yh-color-info-light-3: #b1b3b8;
160
+ --yh-color-info-light-5: #c8c9cc;
161
+ --yh-color-info-light-7: #dedfe0;
162
+ --yh-color-info-light-9: #f4f4f5;
163
+ --yh-color-info-dark-2: #73767a;
164
+ /* 文字颜色 */
165
+ --yh-text-color-primary: #303133;
166
+ --yh-text-color-regular: #606266;
167
+ --yh-text-color-secondary: #909399;
168
+ --yh-text-color-placeholder: #a8abb2;
169
+ --yh-text-color-disabled: #c0c4cc;
170
+ /* 边框颜色 */
171
+ --yh-border-color: #dcdfe6;
172
+ --yh-border-color-hover: var(--yh-color-primary);
173
+ --yh-border-color-light: #e4e7ed;
174
+ --yh-border-color-lighter: #ebeef5;
175
+ --yh-border-color-extra-light: #f2f6fc;
176
+ --yh-border-color-dark: #d4d7de;
177
+ --yh-border-color-darker: #cdd0d6;
178
+ /* 填充颜色 */
179
+ --yh-fill-color: #f0f2f5;
180
+ --yh-fill-color-light: #f5f7fa;
181
+ --yh-fill-color-lighter: #fafafa;
182
+ --yh-fill-color-extra-light: #fafcff;
183
+ --yh-fill-color-dark: #ebedf0;
184
+ --yh-fill-color-darker: #e6e8eb;
185
+ --yh-fill-color-blank: #ffffff;
186
+ /* 背景颜色 */
187
+ --yh-bg-color: #ffffff;
188
+ --yh-bg-color-page: #f2f3f5;
189
+ --yh-bg-color-overlay: #ffffff;
190
+ /* ==================== 间距系统 ==================== */
191
+ --yh-spacing-none: 0;
192
+ --yh-spacing-xs: 4px;
193
+ --yh-spacing-sm: 8px;
194
+ --yh-spacing-md: 16px;
195
+ --yh-spacing-lg: 24px;
196
+ --yh-spacing-xl: 32px;
197
+ --yh-spacing-xxl: 48px;
198
+ /* ==================== 圆角系统 ==================== */
199
+ --yh-radius-none: 0;
200
+ --yh-radius-sm: 2px;
201
+ --yh-radius-base: 4px;
202
+ --yh-radius-md: 8px;
203
+ --yh-radius-lg: 12px;
204
+ --yh-radius-xl: 16px;
205
+ --yh-radius-round: 20px;
206
+ --yh-radius-circle: 50%;
207
+ /* ==================== 字体系统 ==================== */
208
+ --yh-font-family:
209
+ -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans',
210
+ sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
211
+ /* 字号 */
212
+ --yh-font-size-xs: 12px;
213
+ --yh-font-size-sm: 13px;
214
+ --yh-font-size-base: 14px;
215
+ --yh-font-size-md: 16px;
216
+ --yh-font-size-lg: 18px;
217
+ --yh-font-size-xl: 20px;
218
+ --yh-font-size-xxl: 24px;
219
+ /* 行高 */
220
+ --yh-line-height-none: 1;
221
+ --yh-line-height-tight: 1.25;
222
+ --yh-line-height-snug: 1.375;
223
+ --yh-line-height-normal: 1.5;
224
+ --yh-line-height-relaxed: 1.625;
225
+ --yh-line-height-loose: 2;
226
+ /* 字重 */
227
+ --yh-font-weight-light: 300;
228
+ --yh-font-weight-normal: 400;
229
+ --yh-font-weight-medium: 500;
230
+ --yh-font-weight-semibold: 600;
231
+ --yh-font-weight-bold: 700;
232
+ /* ==================== 阴影系统 ==================== */
233
+ --yh-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
234
+ --yh-shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
235
+ --yh-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
236
+ --yh-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
237
+ --yh-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
238
+ /* ==================== 过渡动效 ==================== */
239
+ --yh-duration-fast: 150ms;
240
+ --yh-duration-base: 200ms;
241
+ --yh-duration-slow: 300ms;
242
+ --yh-timing-ease: ease;
243
+ --yh-timing-ease-in: cubic-bezier(0.4, 0, 1, 1);
244
+ --yh-timing-ease-out: cubic-bezier(0, 0, 0.2, 1);
245
+ --yh-timing-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
246
+ --yh-timing-linear: linear;
247
+ --yh-transition-base: all var(--yh-duration-base) var(--yh-timing-ease-in-out);
248
+ --yh-transition-fast: all var(--yh-duration-fast) var(--yh-timing-ease-in-out);
249
+ --yh-transition-slow: all var(--yh-duration-slow) var(--yh-timing-ease-in-out);
250
+ /* ==================== 层级系统 ==================== */
251
+ --yh-z-index-normal: 1;
252
+ --yh-z-index-top: 1000;
253
+ --yh-z-index-popper: 2000;
254
+ --yh-z-index-overlay: 2001;
255
+ --yh-z-index-modal: 2002;
256
+ --yh-z-index-popover: 2003;
257
+ --yh-z-index-tooltip: 2004;
258
+ --yh-z-index-loading: 2005;
259
+ /* ==================== 组件尺寸 ==================== */
260
+ /* Large */
261
+ --yh-component-size-large: 40px;
262
+ --yh-component-size-large-font: 14px;
263
+ --yh-component-size-large-padding: 20px;
264
+ /* Default */
265
+ --yh-component-size-default: 32px;
266
+ --yh-component-size-default-font: 14px;
267
+ --yh-component-size-default-padding: 16px;
268
+ /* Small */
269
+ --yh-component-size-small: 24px;
270
+ --yh-component-size-small-font: 12px;
271
+ --yh-component-size-small-padding: 12px;
272
+ /* ==================== 组件语义化变量 ==================== */
273
+ --yh-border-radius-base: var(--yh-radius-base);
274
+ --yh-border-radius-small: var(--yh-radius-sm);
275
+ --yh-border-radius-round: var(--yh-radius-round);
276
+ /* Message 消息提示 */
277
+ --yh-message-bg-color: var(--yh-bg-color-overlay);
278
+ --yh-message-border-color: var(--yh-border-color-lighter);
279
+ --yh-message-shadow: var(--yh-shadow-lg);
280
+ --yh-message-text-color: var(--yh-text-color-primary);
281
+ --yh-message-close-color: var(--yh-text-color-secondary);
282
+ --yh-message-close-hover-color: var(--yh-text-color-primary);
283
+ /* Notification 通知 */
284
+ --yh-notification-bg-color: var(--yh-bg-color-overlay);
285
+ --yh-notification-border-color: var(--yh-border-color-lighter);
286
+ --yh-notification-shadow: var(--yh-shadow-lg);
287
+ --yh-notification-title-color: var(--yh-text-color-primary);
288
+ --yh-notification-content-color: var(--yh-text-color-regular);
289
+ /* Badge 徽标 */
290
+ --yh-badge-bg-color: var(--yh-color-danger);
291
+ --yh-badge-text-color: #ffffff;
292
+ --yh-badge-border-color: var(--yh-bg-color);
293
+ /* Card 卡片 */
294
+ --yh-card-bg-color: var(--yh-bg-color-overlay);
295
+ --yh-card-border-color: var(--yh-border-color-lighter);
296
+ --yh-card-shadow: var(--yh-shadow-base);
297
+ --yh-card-header-padding: 18px 20px;
298
+ --yh-card-body-padding: 20px;
299
+ /* Input 输入框 */
300
+ --yh-input-bg-color: var(--yh-fill-color-blank);
301
+ --yh-input-text-color: var(--yh-text-color-regular);
302
+ --yh-input-border-color: var(--yh-border-color);
303
+ --yh-input-hover-border-color: var(--yh-color-primary);
304
+ --yh-input-focus-border-color: var(--yh-color-primary);
305
+ --yh-input-placeholder-color: var(--yh-text-color-placeholder);
306
+ --yh-input-icon-color: var(--yh-text-color-placeholder);
307
+ --yh-input-disabled-bg-color: var(--yh-fill-color-light);
308
+ --yh-input-disabled-text-color: var(--yh-text-color-disabled);
309
+ --yh-input-disabled-border-color: var(--yh-border-color-light);
310
+ /* Image 图片 */
311
+ --yh-image-placeholder-bg-color: var(--yh-fill-color-light);
312
+ --yh-image-placeholder-text-color: var(--yh-text-color-placeholder);
313
+ --yh-image-error-bg-color: var(--yh-fill-color-extra-light);
314
+ --yh-image-error-text-color: var(--yh-text-color-placeholder);
315
+ /* Image Viewer 预览器 */
316
+ --yh-image-viewer-mask-bg-color: rgba(0, 0, 0, 0.5);
317
+ --yh-image-viewer-btn-bg-color: var(--yh-text-color-regular);
318
+ --yh-image-viewer-btn-color: #ffffff;
319
+ --yh-image-viewer-btn-hover-bg-color: var(--yh-color-primary);
320
+ /* Calendar 日历 */
321
+ --yh-calendar-bg: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
322
+ --yh-calendar-border-color: rgba(0, 0, 0, 0.06);
323
+ --yh-calendar-border-radius: var(--yh-radius-xl);
324
+ --yh-calendar-header-bg: rgba(255, 255, 255, 0.95);
325
+ --yh-calendar-header-border: rgba(0, 0, 0, 0.04);
326
+ --yh-calendar-header-padding: 18px 22px;
327
+ --yh-calendar-body-padding: 14px 18px 18px;
328
+ /* Calendar 尺寸 */
329
+ --yh-calendar-cell-height: 85px;
330
+ --yh-calendar-cell-height-small: 52px;
331
+ --yh-calendar-cell-height-large: 110px;
332
+ --yh-calendar-cell-radius: 10px;
333
+ --yh-calendar-cell-radius-small: 6px;
334
+ --yh-calendar-cell-radius-large: 12px;
335
+ /* Calendar 颜色 */
336
+ --yh-calendar-primary: var(--yh-color-primary);
337
+ --yh-calendar-primary-light: rgba(59, 130, 246, 0.1);
338
+ --yh-calendar-selected-bg: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
339
+ --yh-calendar-selected-border: rgba(59, 130, 246, 0.4);
340
+ --yh-calendar-today-dot: var(--yh-color-primary);
341
+ --yh-calendar-weekend-color: #f97316;
342
+ --yh-calendar-disabled-color: var(--yh-text-color-disabled);
343
+ --yh-calendar-other-month-opacity: 0.35;
344
+ /* Calendar 假日 */
345
+ --yh-calendar-holiday-color: var(--yh-color-success);
346
+ --yh-calendar-holiday-bg: rgba(16, 185, 129, 0.12);
347
+ --yh-calendar-holiday-border: rgba(16, 185, 129, 0.25);
348
+ --yh-calendar-workday-color: var(--yh-color-warning);
349
+ --yh-calendar-workday-bg: rgba(245, 158, 11, 0.12);
350
+ --yh-calendar-workday-border: rgba(245, 158, 11, 0.25);
351
+ /* Calendar 范围选择 */
352
+ --yh-calendar-range-bg: rgba(59, 130, 246, 0.08);
353
+ --yh-calendar-range-border: rgba(59, 130, 246, 0.2);
354
+ /* Calendar 字体 */
355
+ --yh-calendar-weekday-font-size: var(--yh-font-size-sm);
356
+ --yh-calendar-weekday-color: var(--yh-text-color-secondary);
357
+ --yh-calendar-day-font-size: 15px;
358
+ --yh-calendar-day-color: var(--yh-text-color-primary);
359
+ --yh-calendar-badge-font-size: 9px;
360
+ /* Table 表格 */
361
+ --yh-table-border-color: var(--yh-border-color-lighter);
362
+ --yh-table-header-bg: var(--yh-fill-color-light);
363
+ --yh-table-header-text-color: var(--yh-text-color-primary);
364
+ --yh-table-header-font-weight: var(--yh-font-weight-semibold);
365
+ --yh-table-row-bg: var(--yh-bg-color);
366
+ --yh-table-row-hover-bg: var(--yh-fill-color-light);
367
+ --yh-table-row-stripe-bg: var(--yh-fill-color-lighter);
368
+ --yh-table-row-current-bg: var(--yh-color-primary-light-9);
369
+ --yh-table-row-selected-bg: var(--yh-color-primary-light-8);
370
+ --yh-table-row-success-bg: var(--yh-color-success-light-9);
371
+ --yh-table-row-warning-bg: var(--yh-color-warning-light-9);
372
+ --yh-table-text-color: var(--yh-text-color-regular);
373
+ --yh-table-empty-text-color: var(--yh-text-color-secondary);
374
+ --yh-table-font-size: var(--yh-font-size-base);
375
+ --yh-table-cell-padding: 12px 0;
376
+ --yh-table-cell-spacing: 12px;
377
+ --yh-table-fixed-left-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.15);
378
+ --yh-table-fixed-right-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
379
+ /* ==================== 边框基础 ==================== */
380
+ --yh-border-width: 1px;
381
+ --yh-border-style: solid;
382
+ --yh-border: var(--yh-border-width) var(--yh-border-style) var(--yh-border-color);
383
+ /* ==================== 断点系统 ==================== */
384
+ --yh-breakpoint-xs: 0;
385
+ --yh-breakpoint-sm: 576px;
386
+ --yh-breakpoint-md: 768px;
387
+ --yh-breakpoint-lg: 992px;
388
+ --yh-breakpoint-xl: 1200px;
389
+ --yh-breakpoint-xxl: 1400px;
390
+ /* ==================== 字体系统扩展 ==================== */
391
+ --yh-font-family-monospace:
392
+ 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
393
+ --yh-font-family-serif: Georgia, Cambria, 'Times New Roman', Times, serif;
394
+ /* ==================== 无障碍/聚焦系统 ==================== */
395
+ --yh-focus-ring-color: var(--yh-color-primary);
396
+ --yh-focus-ring-width: 2px;
397
+ --yh-focus-ring-offset: 2px;
398
+ --yh-focus-ring-opacity: 0.2;
399
+ --yh-focus-ring:
400
+ 0 0 0 var(--yh-focus-ring-offset) var(--yh-bg-color),
401
+ 0 0 0 calc(var(--yh-focus-ring-offset) + var(--yh-focus-ring-width)) var(--yh-focus-ring-color);
402
+ /* 高对比度模式支持 */
403
+ --yh-high-contrast-outline: 2px solid transparent;
404
+ --yh-high-contrast-outline-offset: 2px;
405
+ /* ==================== 滚动条样式 ==================== */
406
+ --yh-scrollbar-width: 6px;
407
+ --yh-scrollbar-thumb-color: var(--yh-text-color-disabled);
408
+ --yh-scrollbar-thumb-hover-color: var(--yh-text-color-secondary);
409
+ --yh-scrollbar-track-color: transparent;
410
+ --yh-scrollbar-thumb-radius: 3px;
411
+ /* ==================== 遮罩层 ==================== */
412
+ --yh-mask-color: rgba(0, 0, 0, 0.5);
413
+ --yh-mask-color-light: rgba(0, 0, 0, 0.3);
414
+ --yh-mask-color-extra-light: rgba(0, 0, 0, 0.1);
415
+ }
416
+
417
+ /* ==================== 暗黑模式 ==================== */
418
+ html.dark {
419
+ --yh-color-primary: #409eff;
420
+ --yh-color-primary-light-3: #3375b9;
421
+ --yh-color-primary-light-5: #2a598a;
422
+ --yh-color-primary-light-7: #213d5b;
423
+ --yh-color-primary-light-9: #18222c;
424
+ --yh-color-primary-dark-2: #66b1ff;
425
+ --yh-color-success: #67c23a;
426
+ --yh-color-success-light-3: #4e8e2f;
427
+ --yh-color-success-light-5: #3e6b27;
428
+ --yh-color-success-light-7: #2d481f;
429
+ --yh-color-success-light-9: #1d2518;
430
+ --yh-color-warning: #e6a23c;
431
+ --yh-color-warning-light-3: #a77730;
432
+ --yh-color-warning-light-5: #7d5b28;
433
+ --yh-color-warning-light-7: #533f20;
434
+ --yh-color-warning-light-9: #292218;
435
+ --yh-color-danger: #f56c6c;
436
+ --yh-color-danger-light-3: #b25252;
437
+ --yh-color-danger-light-5: #854040;
438
+ --yh-color-danger-light-7: #582e2e;
439
+ --yh-color-danger-light-9: #2b1d1d;
440
+ --yh-color-info: #909399;
441
+ --yh-color-info-light-3: #6b6d71;
442
+ --yh-color-info-light-5: #525457;
443
+ --yh-color-info-light-7: #393b3e;
444
+ --yh-color-info-light-9: #202124;
445
+ --yh-text-color-primary: #e5eaf3;
446
+ --yh-text-color-regular: #cfd3dc;
447
+ --yh-text-color-secondary: #a3a6ad;
448
+ --yh-text-color-placeholder: #8d9095;
449
+ --yh-text-color-disabled: #6c6e72;
450
+ --yh-border-color: #4c4d4f;
451
+ --yh-border-color-light: #414243;
452
+ --yh-border-color-lighter: #363637;
453
+ --yh-border-color-extra-light: #2b2b2c;
454
+ --yh-border-color-dark: #58585b;
455
+ --yh-border-color-darker: #636466;
456
+ --yh-fill-color: #303030;
457
+ --yh-fill-color-light: #262727;
458
+ --yh-fill-color-lighter: #1d1d1d;
459
+ --yh-fill-color-extra-light: #191919;
460
+ --yh-fill-color-dark: #39393a;
461
+ --yh-fill-color-darker: #424243;
462
+ --yh-fill-color-blank: transparent;
463
+ --yh-bg-color: #141414;
464
+ --yh-bg-color-page: #0a0a0a;
465
+ --yh-bg-color-overlay: #1d1e1f;
466
+ /* 组件暗色模式覆盖 */
467
+ --yh-message-bg-color: var(--yh-bg-color-overlay);
468
+ --yh-message-border-color: var(--yh-border-color-lighter);
469
+ --yh-notification-bg-color: var(--yh-bg-color-overlay);
470
+ --yh-notification-border-color: var(--yh-border-color-lighter);
471
+ --yh-badge-border-color: var(--yh-bg-color);
472
+ --yh-card-bg-color: var(--yh-bg-color-overlay);
473
+ --yh-card-border-color: var(--yh-border-color-lighter);
474
+ /* Calendar 暗黑模式 */
475
+ --yh-calendar-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
476
+ --yh-calendar-border-color: rgba(255, 255, 255, 0.08);
477
+ --yh-calendar-header-bg: rgba(30, 30, 30, 0.95);
478
+ --yh-calendar-header-border: rgba(255, 255, 255, 0.06);
479
+ --yh-calendar-day-color: var(--yh-text-color-primary);
480
+ --yh-calendar-weekday-color: var(--yh-text-color-secondary);
481
+ --yh-calendar-selected-bg: linear-gradient(
482
+ 135deg,
483
+ rgba(59, 130, 246, 0.2) 0%,
484
+ rgba(59, 130, 246, 0.1) 100%
485
+ );
486
+ /* Table 暗黑模式 */
487
+ --yh-table-border-color: var(--yh-border-color-lighter);
488
+ --yh-table-header-bg: var(--yh-fill-color-dark);
489
+ --yh-table-header-text-color: var(--yh-text-color-primary);
490
+ --yh-table-row-bg: var(--yh-bg-color);
491
+ --yh-table-row-hover-bg: var(--yh-fill-color);
492
+ --yh-table-row-stripe-bg: var(--yh-fill-color-light);
493
+ --yh-table-row-current-bg: var(--yh-color-primary-light-9);
494
+ --yh-table-row-selected-bg: var(--yh-color-primary-light-9);
495
+ --yh-table-row-success-bg: var(--yh-color-success-light-9);
496
+ --yh-table-row-warning-bg: var(--yh-color-warning-light-9);
497
+ --yh-table-fixed-left-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.3);
498
+ --yh-table-fixed-right-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.3);
499
+ /* 遮罩层暗黑模式 */
500
+ --yh-mask-color: rgba(0, 0, 0, 0.7);
501
+ --yh-mask-color-light: rgba(0, 0, 0, 0.5);
502
+ --yh-mask-color-extra-light: rgba(0, 0, 0, 0.3);
503
+ /* 滚动条暗黑模式 */
504
+ --yh-scrollbar-thumb-color: var(--yh-fill-color-darker);
505
+ --yh-scrollbar-thumb-hover-color: var(--yh-text-color-placeholder);
506
+ }
507
+
508
+ /* ==================== 减少动画偏好支持 ==================== */
509
+ @media (prefers-reduced-motion: reduce) {
510
+ :root,
511
+ html.dark {
512
+ --yh-duration-fast: 0ms;
513
+ --yh-duration-base: 0ms;
514
+ --yh-duration-slow: 0ms;
515
+ --yh-transition-base: none;
516
+ --yh-transition-fast: none;
517
+ --yh-transition-slow: none;
518
+ }
519
+ *,
520
+ *::before,
521
+ *::after {
522
+ animation-duration: 0.01ms !important;
523
+ animation-iteration-count: 1 !important;
524
+ transition-duration: 0.01ms !important;
525
+ scroll-behavior: auto !important;
526
+ }
527
+ }
528
+ /* ==================== 高对比度模式支持 ==================== */
529
+ @media (prefers-contrast: high) {
530
+ :root {
531
+ --yh-border-color: #000000;
532
+ --yh-border-color-light: #333333;
533
+ --yh-text-color-primary: #000000;
534
+ --yh-text-color-regular: #1a1a1a;
535
+ --yh-focus-ring-width: 3px;
536
+ --yh-focus-ring-color: #000000;
537
+ }
538
+ html.dark {
539
+ --yh-border-color: #ffffff;
540
+ --yh-border-color-light: #cccccc;
541
+ --yh-text-color-primary: #ffffff;
542
+ --yh-text-color-regular: #e5e5e5;
543
+ --yh-focus-ring-color: #ffffff;
544
+ }
545
+ }
546
+ /* ==================== 强制颜色模式支持 (Windows 高对比度) ==================== */
547
+ @media (forced-colors: active) {
548
+ :root {
549
+ --yh-color-primary: LinkText;
550
+ --yh-border-color: ButtonBorder;
551
+ --yh-bg-color: Canvas;
552
+ --yh-text-color-primary: CanvasText;
553
+ --yh-focus-ring-color: Highlight;
554
+ }
555
+ }
556
+ .yh-ai-mention {
557
+ width: 100%;
558
+ }
559
+ .yh-ai-mention__option-item {
560
+ display: flex;
561
+ align-items: center;
562
+ gap: 12px;
563
+ padding: 8px 4px;
564
+ width: 100%;
565
+ }
566
+
567
+ .yh-ai-mention__option-icon {
568
+ display: flex;
569
+ align-items: center;
570
+ justify-content: center;
571
+ width: 32px;
572
+ height: 32px;
573
+ border-radius: 8px;
574
+ background: var(--yh-color-primary-light-9);
575
+ color: var(--yh-color-primary);
576
+ font-size: 18px;
577
+ }
578
+ .yh-ai-mention__option-icon--agent {
579
+ background: var(--yh-color-success-light-9);
580
+ color: var(--yh-color-success);
581
+ }
582
+
583
+ .yh-ai-mention__option-icon--document {
584
+ background: var(--yh-color-warning-light-9);
585
+ color: var(--yh-color-warning);
586
+ }
587
+
588
+ .yh-ai-mention__option-icon--table {
589
+ background: var(--yh-color-info-light-9);
590
+ color: var(--yh-color-info);
591
+ }
592
+
593
+ .yh-ai-mention__option-icon--knowledge {
594
+ background: var(--yh-color-danger-light-9);
595
+ color: var(--yh-color-danger);
596
+ }
597
+
598
+ .yh-ai-mention__option-info {
599
+ flex: 1;
600
+ min-width: 0;
601
+ }
602
+
603
+ .yh-ai-mention__option-label {
604
+ font-size: 14px;
605
+ font-weight: 500;
606
+ color: var(--yh-text-color-primary);
607
+ line-height: 1.4;
608
+ overflow: hidden;
609
+ text-overflow: ellipsis;
610
+ white-space: nowrap;
611
+ }
612
+
613
+ .yh-ai-mention__option-desc {
614
+ font-size: 12px;
615
+ color: var(--yh-text-color-secondary);
616
+ line-height: 1.2;
617
+ margin-top: 2px;
618
+ overflow: hidden;
619
+ text-overflow: ellipsis;
620
+ white-space: nowrap;
621
+ }
622
+
623
+ .yh-ai-mention__option-tag {
624
+ font-size: 11px;
625
+ padding: 2px 6px;
626
+ border-radius: 4px;
627
+ background: var(--yh-fill-color-light);
628
+ color: var(--yh-text-color-placeholder);
629
+ text-transform: capitalize;
630
+ }
631
+ .yh-ai-mention__option-tag--agent {
632
+ background: var(--yh-color-success-light-9);
633
+ color: var(--yh-color-success);
634
+ }
635
+
636
+ .yh-ai-mention__option-tag--document {
637
+ background: var(--yh-color-warning-light-9);
638
+ color: var(--yh-color-warning);
639
+ }
640
+
641
+ .yh-ai-mention__option-tag--table {
642
+ background: var(--yh-color-info-light-9);
643
+ color: var(--yh-color-info);
644
+ }
645
+
646
+ .yh-ai-mention__option-tag--knowledge {
647
+ background: var(--yh-color-danger-light-9);
648
+ color: var(--yh-color-danger);
649
+ }
650
+ </style>