@xihan-ui/styles 3.1.0 → 4.0.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/CHANGELOG.md +470 -0
- package/component-tokens.d.ts +230 -60
- package/components.tokens.json +5156 -1557
- package/css/accordion.css +47 -20
- package/css/alert.css +16 -17
- package/css/anchor.css +2 -2
- package/css/approval.css +41 -17
- package/css/avatar-group.css +9 -12
- package/css/avatar.css +20 -18
- package/css/back-top.css +21 -7
- package/css/badge.css +5 -5
- package/css/breadcrumb.css +18 -16
- package/css/button-group.css +4 -6
- package/css/button.css +13 -12
- package/css/calendar-picker.css +178 -95
- package/css/calendar-range-picker.css +207 -122
- package/css/card.css +34 -6
- package/css/carousel.css +94 -46
- package/css/cartesian-chart.css +11 -11
- package/css/cascader.css +51 -39
- package/css/checkbox-group.css +9 -6
- package/css/checkbox.css +5 -4
- package/css/citation.css +9 -4
- package/css/clipboard.css +20 -4
- package/css/code-view.css +6 -6
- package/css/collapsible.css +29 -14
- package/css/color-field.css +4 -4
- package/css/color-picker.css +77 -23
- package/css/color-slider.css +10 -8
- package/css/color-swatch-picker.css +14 -9
- package/css/combobox.css +26 -14
- package/css/command.css +14 -9
- package/css/context-menu.css +10 -5
- package/css/date-field.css +12 -6
- package/css/date-picker.css +178 -109
- package/css/date-range-picker.css +199 -130
- package/css/description.css +10 -6
- package/css/descriptions.css +47 -19
- package/css/dialog.css +50 -35
- package/css/diff-view.css +8 -8
- package/css/drawer.css +75 -21
- package/css/editable.css +15 -41
- package/css/empty-state.css +21 -3
- package/css/field-array.css +5 -2
- package/css/field.css +17 -18
- package/css/fieldset.css +33 -13
- package/css/file-upload.css +66 -33
- package/css/float-button.css +60 -35
- package/css/floating-panel.css +1 -1
- package/css/form.css +30 -16
- package/css/graph-chart.css +2 -2
- package/css/grid-list.css +1 -1
- package/css/highlight.css +5 -5
- package/css/hover-card.css +19 -12
- package/css/image-viewer.css +77 -27
- package/css/image.css +13 -5
- package/css/infinite-scroll.css +8 -4
- package/css/input-group.css +74 -26
- package/css/kbd.css +1 -1
- package/css/label.css +27 -11
- package/css/layout.css +17 -10
- package/css/list.css +13 -9
- package/css/listbox.css +12 -7
- package/css/loading-bar.css +3 -0
- package/css/mention.css +11 -9
- package/css/menu.css +10 -5
- package/css/menubar.css +13 -8
- package/css/message-feed.css +1 -1
- package/css/navigation-menu.css +2 -2
- package/css/notification.css +132 -49
- package/css/number-animation.css +2 -2
- package/css/number-field.css +75 -52
- package/css/page-header.css +64 -27
- package/css/pagination.css +35 -38
- package/css/password-input.css +12 -68
- package/css/pin-input.css +18 -26
- package/css/popconfirm.css +23 -14
- package/css/popover.css +18 -12
- package/css/progress.css +14 -13
- package/css/prompt-input.css +3 -3
- package/css/question-flow.css +41 -15
- package/css/radar-chart.css +6 -6
- package/css/radio-group.css +120 -55
- package/css/rating.css +32 -15
- package/css/select.css +16 -12
- package/css/separator.css +24 -6
- package/css/side-nav.css +29 -24
- package/css/signature-pad.css +23 -9
- package/css/skeleton.css +12 -12
- package/css/slider.css +77 -48
- package/css/sortable.css +2 -2
- package/css/sparkline.css +8 -2
- package/css/spinner.css +40 -20
- package/css/statistic.css +14 -14
- package/css/steps.css +115 -84
- package/css/switch.css +9 -7
- package/css/table.css +29 -12
- package/css/tabs.css +35 -12
- package/css/tag-group.css +17 -6
- package/css/tag.css +54 -29
- package/css/tags-input.css +39 -20
- package/css/text-field.css +5 -5
- package/css/time-field.css +4 -4
- package/css/time-picker.css +150 -64
- package/css/time-range-picker.css +91 -62
- package/css/timeline.css +37 -20
- package/css/timer.css +3 -3
- package/css/toggle-group.css +4 -4
- package/css/tool-call.css +13 -11
- package/css/toolbar.css +6 -5
- package/css/tooltip.css +16 -17
- package/css/tour.css +14 -7
- package/css/transfer.css +22 -16
- package/css/tree-select.css +12 -12
- package/css/tree.css +26 -25
- package/css/typography.css +28 -25
- package/dist/css/accordion.css +296 -0
- package/dist/css/affix.css +47 -0
- package/dist/css/alert.css +246 -0
- package/dist/css/anchor.css +252 -0
- package/dist/css/approval.css +525 -0
- package/dist/css/avatar-group.css +96 -0
- package/dist/css/avatar.css +100 -0
- package/dist/css/back-top.css +175 -0
- package/dist/css/badge.css +205 -0
- package/dist/css/bar-code.css +62 -0
- package/dist/css/breadcrumb.css +232 -0
- package/dist/css/button-group.css +261 -0
- package/dist/css/button.css +216 -0
- package/dist/css/calendar-picker.css +550 -0
- package/dist/css/calendar-range-picker.css +639 -0
- package/dist/css/card.css +249 -0
- package/dist/css/carousel.css +726 -0
- package/dist/css/cartesian-chart.css +830 -0
- package/dist/css/cascader.css +973 -0
- package/dist/css/checkbox-group.css +361 -0
- package/dist/css/checkbox.css +258 -0
- package/dist/css/citation.css +475 -0
- package/dist/css/clipboard.css +331 -0
- package/dist/css/code-view.css +374 -0
- package/dist/css/collapsible.css +200 -0
- package/dist/css/color-field.css +176 -0
- package/dist/css/color-picker.css +649 -0
- package/dist/css/color-slider.css +283 -0
- package/dist/css/color-swatch-picker.css +250 -0
- package/dist/css/color-swatch.css +35 -0
- package/dist/css/combobox.css +578 -0
- package/dist/css/command.css +404 -0
- package/dist/css/context-menu.css +425 -0
- package/dist/css/date-field.css +317 -0
- package/dist/css/date-picker.css +931 -0
- package/dist/css/date-range-picker.css +949 -0
- package/dist/css/description.css +71 -0
- package/dist/css/descriptions.css +327 -0
- package/dist/css/dialog.css +470 -0
- package/dist/css/diff-view.css +513 -0
- package/dist/css/download-trigger.css +151 -0
- package/dist/css/drawer.css +606 -0
- package/dist/css/editable.css +269 -0
- package/dist/css/empty-state.css +181 -0
- package/dist/css/field-array.css +229 -0
- package/dist/css/field.css +165 -0
- package/dist/css/fieldset.css +122 -0
- package/dist/css/file-upload.css +462 -0
- package/dist/css/flex.css +441 -0
- package/dist/css/float-button.css +579 -0
- package/dist/css/floating-panel.css +429 -0
- package/dist/css/focus.css +46 -0
- package/dist/css/forced-colors.css +93 -0
- package/dist/css/form.css +407 -0
- package/dist/css/funnel-chart.css +106 -0
- package/dist/css/graph-chart.css +205 -0
- package/dist/css/grid-list.css +235 -0
- package/dist/css/grid.css +1201 -0
- package/dist/css/heatmap.css +552 -0
- package/dist/css/hierarchy-chart.css +298 -0
- package/dist/css/highlight.css +41 -0
- package/dist/css/hover-card.css +233 -0
- package/dist/css/icon.css +225 -0
- package/dist/css/image-cropper.css +373 -0
- package/dist/css/image-viewer.css +588 -0
- package/dist/css/image.css +106 -0
- package/dist/css/infinite-scroll.css +81 -0
- package/dist/css/input-group.css +323 -0
- package/dist/css/json-viewer.css +379 -0
- package/dist/css/kbd.css +72 -0
- package/dist/css/label.css +94 -0
- package/dist/css/layers.css +7 -0
- package/dist/css/layout.css +379 -0
- package/dist/css/liquid.css +106 -0
- package/dist/css/list.css +156 -0
- package/dist/css/listbox.css +395 -0
- package/dist/css/loading-bar.css +144 -0
- package/dist/css/log.css +306 -0
- package/dist/css/markdown-stream.css +149 -0
- package/dist/css/marquee.css +378 -0
- package/dist/css/masonry.css +70 -0
- package/dist/css/matrix-code.css +67 -0
- package/dist/css/mention.css +395 -0
- package/dist/css/menu.css +369 -0
- package/dist/css/menubar.css +461 -0
- package/dist/css/message-feed.css +318 -0
- package/dist/css/navigation-menu.css +513 -0
- package/dist/css/notification.css +865 -0
- package/dist/css/number-animation.css +44 -0
- package/dist/css/number-field.css +275 -0
- package/dist/css/overlay-arrow.css +56 -0
- package/dist/css/page-header.css +221 -0
- package/dist/css/pagination.css +447 -0
- package/dist/css/password-input.css +335 -0
- package/dist/css/pie-chart.css +247 -0
- package/dist/css/pin-input.css +191 -0
- package/dist/css/pointer.css +36 -0
- package/dist/css/popconfirm.css +329 -0
- package/dist/css/popover.css +285 -0
- package/dist/css/progress.css +502 -0
- package/dist/css/prompt-input.css +260 -0
- package/dist/css/question-flow.css +579 -0
- package/dist/css/radar-chart.css +233 -0
- package/dist/css/radio-group.css +663 -0
- package/dist/css/rating.css +311 -0
- package/dist/css/reasoning.css +343 -0
- package/dist/css/reset.css +117 -0
- package/dist/css/resizable.css +242 -0
- package/dist/css/sankey-chart.css +174 -0
- package/dist/css/scroll-area.css +240 -0
- package/dist/css/scrollbar.css +204 -0
- package/dist/css/select.css +616 -0
- package/dist/css/separator.css +140 -0
- package/dist/css/side-nav.css +481 -0
- package/dist/css/signature-pad.css +193 -0
- package/dist/css/skeleton.css +161 -0
- package/dist/css/slider.css +403 -0
- package/dist/css/sortable.css +228 -0
- package/dist/css/sparkline.css +170 -0
- package/dist/css/spinner.css +256 -0
- package/dist/css/splitter.css +159 -0
- package/dist/css/statistic.css +137 -0
- package/dist/css/steps.css +658 -0
- package/dist/css/switch.css +353 -0
- package/dist/css/table.css +1162 -0
- package/dist/css/tabs.css +967 -0
- package/dist/css/tag-group.css +258 -0
- package/dist/css/tag.css +335 -0
- package/dist/css/tags-input.css +341 -0
- package/dist/css/text-field.css +197 -0
- package/dist/css/time-field.css +277 -0
- package/dist/css/time-picker.css +793 -0
- package/dist/css/time-range-picker.css +775 -0
- package/dist/css/timeline.css +440 -0
- package/dist/css/timer.css +123 -0
- package/dist/css/timestamp.css +34 -0
- package/dist/css/toggle-group.css +424 -0
- package/dist/css/toggle.css +146 -0
- package/dist/css/tone.css +189 -0
- package/dist/css/tool-call.css +431 -0
- package/dist/css/toolbar.css +366 -0
- package/dist/css/tooltip.css +217 -0
- package/dist/css/tour.css +446 -0
- package/dist/css/transfer.css +644 -0
- package/dist/css/tree-select.css +878 -0
- package/dist/css/tree.css +734 -0
- package/dist/css/truncate.css +108 -0
- package/dist/css/typography.css +475 -0
- package/dist/css/undefined.css +58 -0
- package/dist/css/virtualizer.css +166 -0
- package/dist/css/visually-hidden.css +20 -0
- package/dist/css/watermark.css +82 -0
- package/dist/family/action-control.css +493 -0
- package/dist/family/chart.css +537 -0
- package/dist/family/check-mark.css +94 -0
- package/dist/family/choice-card.css +97 -0
- package/dist/family/collection-item.css +768 -0
- package/dist/family/field-chrome.css +296 -0
- package/dist/family/loading-ring.css +102 -0
- package/dist/family/material.css +72 -0
- package/dist/family/menu-choice.css +56 -0
- package/dist/family/motion.css +363 -0
- package/dist/family/swatch.css +59 -0
- package/dist/family/tag-list.css +65 -0
- package/family/action-control.css +33 -36
- package/family/chart.css +57 -0
- package/family/collection-item.css +12 -8
- package/family/field-chrome.css +28 -19
- package/family/loading-ring.css +20 -13
- package/family/swatch.css +4 -4
- package/family/tag-list.css +6 -0
- package/index.css +10349 -8756
- package/index.unlayered.css +10350 -8758
- package/package.json +165 -164
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-Present XiHanFun and contributors.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* Mention 独立皮肤同时传递引入字段视觉盒与浮层集合行;full bundle 递归去重。 */
|
|
7
|
+
@import '../family/field-chrome.css';
|
|
8
|
+
@import '../family/collection-item.css';
|
|
9
|
+
@import '../family/loading-ring.css';
|
|
10
|
+
|
|
11
|
+
/* 共享关键帧由 family/motion.css 提供,本皮肤 @import 它,单独引入仍成立。 */
|
|
12
|
+
@import '../family/motion.css';
|
|
13
|
+
@import '../family/material.css';
|
|
14
|
+
|
|
15
|
+
@layer xihan.components {
|
|
16
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
17
|
+
.xh-scope-mention {
|
|
18
|
+
--xh-mention-skin: 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* 坐标由定位引擎写进 style(inset-inline-start / inset-block-start),这里只定位模式与层级 */
|
|
22
|
+
.xh-scope-mention[data-part='positioner'] {
|
|
23
|
+
/* 落定那一侧的可用高度,由定位引擎经内联自定义属性写进来,内容层继承它限高;
|
|
24
|
+
引擎没算(尚未落位 / 无引擎)时不额外限高 */
|
|
25
|
+
--xh-_mention-available-h: 100vh;
|
|
26
|
+
/* 落定那一侧的可用宽度,同样由定位引擎经内联自定义属性写进来,行内轴据此夹取;
|
|
27
|
+
引擎没算(尚未落位 / 无引擎 / 贴边归零)时退到视口宽 */
|
|
28
|
+
--xh-_mention-available-w: 100vw;
|
|
29
|
+
/* 本层先清空祖先方向,再使用实际落位方向。 */
|
|
30
|
+
--xh-_overlay-enter-up: 0;
|
|
31
|
+
--xh-_overlay-enter-down: 0;
|
|
32
|
+
--xh-_overlay-enter-left: 0;
|
|
33
|
+
--xh-_overlay-enter-right: 0;
|
|
34
|
+
|
|
35
|
+
/* 候选列表的自绘条浮在内容之上:轨道不上底色,实色轨道会在列表右缘糊一条竖灰带 */
|
|
36
|
+
--xh-scrollbar-track-bg: transparent;
|
|
37
|
+
|
|
38
|
+
position: fixed;
|
|
39
|
+
/* listbox 与同级状态文字占同一个格;content 始终是唯一拥有材质的表面。 */
|
|
40
|
+
display: grid;
|
|
41
|
+
z-index: var(--xh-mention-layer, var(--xh-_layer, var(--xh-layer-popover)));
|
|
42
|
+
/* 空壳不吃指针,交互只发生在 content 上 */
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* 输入框被滚出可视区:整个浮层随之收起 */
|
|
47
|
+
.xh-scope-mention[data-part='positioner'][data-hidden] {
|
|
48
|
+
visibility: hidden;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.xh-scope-mention[data-part='positioner'][hidden] {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* 进退场按实际落位的物理方向移动,不随书写方向翻转。 */
|
|
56
|
+
.xh-scope-mention[data-part='positioner'][data-placement^='top'] {
|
|
57
|
+
--xh-_overlay-enter-down: 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.xh-scope-mention[data-part='positioner'][data-placement^='bottom'] {
|
|
61
|
+
--xh-_overlay-enter-up: 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.xh-scope-mention[data-part='positioner'][data-placement^='left'] {
|
|
65
|
+
--xh-_overlay-enter-right: 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.xh-scope-mention[data-part='positioner'][data-placement^='right'] {
|
|
69
|
+
--xh-_overlay-enter-left: 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* 私有槽同时声明在根与 positioner 上:浮层被搬到 portal 落点,不是根的后代,继承不过去 */
|
|
73
|
+
.xh-scope-mention:is([data-part='root'], [data-part='positioner']) {
|
|
74
|
+
/* 尺寸档只换这六个私有槽,输入框与候选都从这两处继承它们,换档不必给每个部件各写一条选择器 */
|
|
75
|
+
--xh-_mention-h: var(--xh-control-h-md);
|
|
76
|
+
--xh-_mention-px: var(--xh-control-px-md);
|
|
77
|
+
--xh-_mention-item-py: var(--xh-list-option-py-md);
|
|
78
|
+
--xh-_mention-item-h: var(--xh-list-option-h-md);
|
|
79
|
+
--xh-_mention-item-px: var(--xh-control-px-md);
|
|
80
|
+
--xh-_mention-gap: var(--xh-control-gap-md);
|
|
81
|
+
--xh-_mention-font-size: var(--xh-control-font-md);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.xh-scope-mention[data-part='root'] {
|
|
85
|
+
display: block;
|
|
86
|
+
|
|
87
|
+
/* 不传尺寸时一律这么宽,宽度不随内容走;父容器给不出这么宽时整件跟着收,地板同步让步,不越出父容器。
|
|
88
|
+
地板不高过缺省宽:使用者把缺省宽钉到底线以下时不必再放开底线 */
|
|
89
|
+
inline-size: var(--xh-mention-input-w, var(--xh-control-w));
|
|
90
|
+
min-inline-size: min(var(--xh-mention-input-w, var(--xh-control-w)), var(--xh-mention-input-min-w, var(--xh-control-min-w)), 100%);
|
|
91
|
+
max-inline-size: 100%;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* 只要声明了 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去 */
|
|
95
|
+
.xh-scope-mention[data-part='root'][hidden] {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* 标题:与输入框上下排,行距不留额外空白 */
|
|
100
|
+
.xh-scope-mention[data-part='label'] {
|
|
101
|
+
display: block;
|
|
102
|
+
margin-block-end: var(--xh-mention-label-gap, var(--xh-space-2));
|
|
103
|
+
color: var(--xh-mention-label-fg, var(--xh-fg-muted));
|
|
104
|
+
font-size: var(--xh-mention-label-font-size, var(--xh-text-label-size));
|
|
105
|
+
font-weight: var(--xh-mention-label-font-weight, var(--xh-text-label-weight));
|
|
106
|
+
line-height: var(--xh-leading-none);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.xh-scope-mention[data-part='label'][hidden] {
|
|
110
|
+
display: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.xh-scope-mention[data-part='label'][data-disabled] {
|
|
114
|
+
color: var(--xh-mention-label-fg-disabled, var(--xh-fg-muted));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* —— 尺寸 —— */
|
|
118
|
+
/* 缺省档写在上面的基础规则里 */
|
|
119
|
+
.xh-scope-mention:is([data-part='root'], [data-part='positioner'])[data-size='sm'] {
|
|
120
|
+
--xh-_mention-h: var(--xh-control-h-sm);
|
|
121
|
+
--xh-_mention-px: var(--xh-control-px-sm);
|
|
122
|
+
--xh-_mention-item-py: var(--xh-list-option-py-sm);
|
|
123
|
+
--xh-_mention-item-h: var(--xh-list-option-h-sm);
|
|
124
|
+
--xh-_mention-item-px: var(--xh-control-px-sm);
|
|
125
|
+
--xh-_mention-gap: var(--xh-control-gap-sm);
|
|
126
|
+
--xh-_mention-font-size: var(--xh-control-font-sm);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.xh-scope-mention:is([data-part='root'], [data-part='positioner'])[data-size='lg'] {
|
|
130
|
+
--xh-_mention-h: var(--xh-control-h-lg);
|
|
131
|
+
--xh-_mention-px: var(--xh-control-px-lg);
|
|
132
|
+
--xh-_mention-item-py: var(--xh-list-option-py-lg);
|
|
133
|
+
--xh-_mention-item-h: var(--xh-list-option-h-lg);
|
|
134
|
+
--xh-_mention-item-px: var(--xh-control-px-lg);
|
|
135
|
+
--xh-_mention-gap: var(--xh-control-gap-lg);
|
|
136
|
+
--xh-_mention-font-size: var(--xh-control-font-lg);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* 框与聚焦环都长在输入框自己身上:这里没有把输入框和别的控件裹成一体的输入行,
|
|
140
|
+
整个组件在视觉上就是这一个可打字的方框。描边、底色、圆角、聚焦环、五态与悬停由 Field Chrome
|
|
141
|
+
家族画在它身上(自身聚焦同样命中家族的 :focus-within);组件只映射既有公开槽。
|
|
142
|
+
家族 chrome 不设字号,输入框的字号仍由本皮肤给;形态三档由家族按 data-variant 生成 */
|
|
143
|
+
.xh-scope-mention[data-part='input'] {
|
|
144
|
+
--xh-field-control-height: var(--xh-mention-input-h, var(--xh-_mention-h));
|
|
145
|
+
--xh-field-control-padding-inline: var(--xh-mention-input-px, var(--xh-_mention-px));
|
|
146
|
+
--xh-field-control-gap: 0;
|
|
147
|
+
--xh-field-control-min-inline-size: var(--xh-mention-input-min-w, var(--xh-control-min-w));
|
|
148
|
+
--xh-field-control-radius: var(--xh-mention-input-radius, var(--xh-shape-control));
|
|
149
|
+
--xh-field-bg-rest: var(--xh-mention-input-bg, var(--xh-_field-variant-bg-rest));
|
|
150
|
+
--xh-field-bg-hover: var(--xh-mention-input-bg-hover, var(--xh-_field-variant-bg-hover));
|
|
151
|
+
--xh-field-bg-read-only: var(--xh-mention-input-bg-readonly, var(--xh-_field-variant-bg-read-only));
|
|
152
|
+
--xh-field-bg-disabled: var(--xh-mention-input-bg-disabled, var(--xh-_field-variant-bg-disabled));
|
|
153
|
+
--xh-field-fg-rest: var(--xh-mention-input-fg, var(--xh-fg-default));
|
|
154
|
+
--xh-field-border-rest: var(--xh-mention-input-border, var(--xh-_field-variant-border-rest));
|
|
155
|
+
--xh-field-border-hover: var(--xh-mention-input-border-hover, var(--xh-_field-variant-border-hover));
|
|
156
|
+
--xh-field-border-focus: var(--xh-mention-input-border-focus, var(--xh-_field-variant-border-focus));
|
|
157
|
+
--xh-field-border-invalid: var(--xh-mention-input-border-invalid, var(--xh-_field-variant-border-invalid));
|
|
158
|
+
--xh-field-shadow-rest: var(--xh-mention-input-shadow, none);
|
|
159
|
+
|
|
160
|
+
inline-size: 100%;
|
|
161
|
+
/* 表单控件不继承页面字体,只给字号会让输入框用 UA 默认字族,与周围文本对不上 */
|
|
162
|
+
font-family: inherit;
|
|
163
|
+
font-size: var(--xh-mention-input-font-size, var(--xh-_mention-font-size));
|
|
164
|
+
line-height: var(--xh-leading-normal);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.xh-scope-mention[data-part='input'][hidden] {
|
|
168
|
+
display: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* 多行形态:正文可以换行,框随 rows 定起始高度、不钉单行控件高(家族的多行布局给);
|
|
172
|
+
框自己就是 chrome,家族多行布局把上下内衬归零,这里按文本字段多行档同一支令牌补回,只许纵向拉伸 */
|
|
173
|
+
.xh-scope-mention[data-part='input'][data-xh-field-layout='textarea'] {
|
|
174
|
+
padding-block: var(--xh-mention-textarea-py, var(--xh-space-1));
|
|
175
|
+
resize: vertical;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* 输入框自身即 chrome,家族按 data-xh-field-input 给的占位色命不中它,占位色仍由本皮肤给 */
|
|
179
|
+
.xh-scope-mention[data-part='input']::placeholder {
|
|
180
|
+
color: var(--xh-mention-placeholder-fg, var(--xh-fg-subtle));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/* 自动填充:引擎给填过的框强加一套系统色(多数是黄底黑字),盖得过 background 与 color,
|
|
184
|
+
深色档下就剩一个不跟主题走的黄框。底改用 inset 阴影铺回来,扩散量 100vmax 填满内容盒;
|
|
185
|
+
字改用 -webkit-text-fill-color 接回来,那是这个态下唯一还听样式表的前景通道。
|
|
186
|
+
不去拉长 transition 把系统底推迟显现:那只是把它藏起来,减弱动效通道一关过渡就当场露出。
|
|
187
|
+
两个选择器名分写两条:一条选择器列表里只要有一个名字不被认识,整条规则就被丢弃。
|
|
188
|
+
家族按 data-xh-field-input 给的两条命不中自身即 chrome 的输入框,这里自写;底取不透明的面令牌,
|
|
189
|
+
ghost 档下透明底铺了等于没铺。描边式静息无影,不再叠落影 */
|
|
190
|
+
.xh-scope-mention[data-part='input']:autofill {
|
|
191
|
+
box-shadow: inset 0 0 0 100vmax var(--xh-mention-input-autofill-bg, var(--xh-bg-canvas));
|
|
192
|
+
-webkit-text-fill-color: var(--xh-mention-input-autofill-fg, var(--xh-fg-default));
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.xh-scope-mention[data-part='input']:-webkit-autofill {
|
|
196
|
+
box-shadow: inset 0 0 0 100vmax var(--xh-mention-input-autofill-bg, var(--xh-bg-canvas));
|
|
197
|
+
-webkit-text-fill-color: var(--xh-mention-input-autofill-fg, var(--xh-fg-default));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.xh-scope-mention[data-part='content'] {
|
|
201
|
+
/* 材质由家族配方画(family/material.css 的 frosted 面:描边、底、1px 顶光、前景、投影与背景滤镜),
|
|
202
|
+
这里只把使用者槽接进来 */
|
|
203
|
+
--xh-frosted-bg: var(--xh-mention-content-bg, var(--xh-_material-bg));
|
|
204
|
+
--xh-frosted-border: var(--xh-mention-content-border, var(--xh-_material-border));
|
|
205
|
+
--xh-frosted-fg: var(--xh-mention-content-fg, var(--xh-_material-fg));
|
|
206
|
+
--xh-frosted-shadow: var(--xh-mention-content-shadow, var(--xh-_material-shadow));
|
|
207
|
+
--xh-frosted-backdrop: var(--xh-mention-content-backdrop, var(--xh-_material-backdrop));
|
|
208
|
+
--xh-frosted-highlight: var(--xh-mention-content-highlight, var(--xh-_material-highlight));
|
|
209
|
+
|
|
210
|
+
position: relative;
|
|
211
|
+
display: flex;
|
|
212
|
+
flex-direction: column;
|
|
213
|
+
gap: var(--xh-mention-content-gap, var(--xh-list-option-gap));
|
|
214
|
+
grid-area: 1 / 1;
|
|
215
|
+
min-inline-size: min(var(--xh-mention-content-min-w, var(--xh-overlay-min-w)), var(--xh-_mention-available-w));
|
|
216
|
+
/* 静态档与落位后的可用宽度取小:窄视口下面板伸出去,最右侧的内容就点不到了 */
|
|
217
|
+
max-inline-size: min(var(--xh-mention-content-max-w, var(--xh-overlay-max-w)), var(--xh-_mention-available-w));
|
|
218
|
+
/* 状态文字先隐藏时仍保留完整退场面,不塌回一条空边。 */
|
|
219
|
+
min-block-size: var(--xh-mention-content-min-h, var(--xh-_mention-h));
|
|
220
|
+
max-block-size: min(var(--xh-mention-content-max-h, var(--xh-overlay-max-h)), var(--xh-_mention-available-h));
|
|
221
|
+
padding-block: var(--xh-mention-content-py, var(--xh-space-1));
|
|
222
|
+
padding-inline: var(--xh-mention-content-px, 0);
|
|
223
|
+
border-radius: var(--xh-mention-content-radius, var(--xh-shape-overlay));
|
|
224
|
+
overflow-y: auto;
|
|
225
|
+
/* 浮层滚动面:滚到头不把页面一起带走 */
|
|
226
|
+
overscroll-behavior: contain;
|
|
227
|
+
pointer-events: auto;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* 这里刻意没有 [data-part='content'][hidden] { display: none },与 dialog 一致:
|
|
231
|
+
收起态连接层会给 content 打 hidden,而上面那条 display 正是要盖掉 UA 的
|
|
232
|
+
[hidden]{display:none}——退场动画得先能播。presence 读的是 content 的 animationName,
|
|
233
|
+
真正的收起由宿主在退场结束后落成内联 display:none(Vue 那边直接不渲染)。
|
|
234
|
+
其余声明了 display 的角色节点仍补 [hidden],那几处没有退场动画。 */
|
|
235
|
+
|
|
236
|
+
/* 列表从不承载焦点(焦点恒在输入框,高亮走 aria-activedescendant),
|
|
237
|
+
可滚动容器在某些浏览器里会被自动塞进 Tab 序列,落焦时不画环 */
|
|
238
|
+
.xh-scope-mention[data-part='content']:focus-visible {
|
|
239
|
+
outline: none;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.xh-scope-mention[data-part='content'][data-state='open'] {
|
|
243
|
+
animation: xh-overlay-slide-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* 退场:收起那一帧 hidden 由退场闸门押后,这里才播得出来。forwards 把末态钉住,
|
|
247
|
+
免得动画结束到真收起之间闪一下原样 */
|
|
248
|
+
.xh-scope-mention[data-part='content'][data-state='closed'] {
|
|
249
|
+
animation: xh-overlay-slide-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* 候选行:网格、尺寸档、悬停 / 高亮 100、按下 200 与禁用面由 Collection Item 家族按 overlay 语境给,
|
|
253
|
+
公开 Mention 槽只映射到家族合同。提及即选即执行,aria-selected 只标当前高亮那一条:
|
|
254
|
+
overlay 语境的选中面透明,高亮与悬停同走 --xh-bg-subtle,正文保持常规字重 */
|
|
255
|
+
.xh-scope-mention[data-part='item'] {
|
|
256
|
+
--xh-collection-block-padding: var(--xh-mention-item-py, var(--xh-_mention-item-py));
|
|
257
|
+
--xh-collection-row-h: var(--xh-mention-item-h, var(--xh-_mention-item-h));
|
|
258
|
+
--xh-collection-inline-padding: var(--xh-mention-item-px, var(--xh-_mention-item-px));
|
|
259
|
+
--xh-collection-gap: var(--xh-mention-item-gap, var(--xh-_mention-gap));
|
|
260
|
+
--xh-collection-font-size: var(--xh-mention-item-font-size, var(--xh-_mention-font-size));
|
|
261
|
+
--xh-collection-radius: var(--xh-mention-item-radius, 0);
|
|
262
|
+
--xh-collection-fg-rest: var(--xh-mention-item-fg, var(--xh-material-frosted-fg));
|
|
263
|
+
--xh-collection-fg-hover: var(--xh-mention-item-fg, var(--xh-material-frosted-fg));
|
|
264
|
+
--xh-collection-fg-keyboard-highlight: var(--xh-mention-item-fg, var(--xh-material-frosted-fg));
|
|
265
|
+
--xh-collection-fg-selected: var(--xh-mention-item-fg, var(--xh-material-frosted-fg));
|
|
266
|
+
--xh-collection-fg-selected-highlight: var(--xh-mention-item-fg, var(--xh-material-frosted-fg));
|
|
267
|
+
--xh-collection-fg-selected-hover: var(--xh-mention-item-fg, var(--xh-material-frosted-fg));
|
|
268
|
+
--xh-collection-fg-selected-pressed: var(--xh-mention-item-fg, var(--xh-material-frosted-fg));
|
|
269
|
+
--xh-collection-fg-pressed: var(--xh-mention-item-fg, var(--xh-material-frosted-fg));
|
|
270
|
+
--xh-collection-font-weight-selected: var(--xh-font-weight-regular);
|
|
271
|
+
--xh-collection-font-weight-selected-highlight: var(--xh-font-weight-regular);
|
|
272
|
+
--xh-collection-font-weight-selected-hover: var(--xh-font-weight-regular);
|
|
273
|
+
--xh-collection-font-weight-selected-pressed: var(--xh-font-weight-regular);
|
|
274
|
+
--xh-collection-bg-hover: var(--xh-mention-item-bg-hover, var(--xh-bg-subtle));
|
|
275
|
+
--xh-collection-bg-keyboard-highlight: var(--xh-mention-item-bg-hover, var(--xh-bg-subtle));
|
|
276
|
+
--xh-collection-bg-selected-highlight: var(--xh-mention-item-bg-hover, var(--xh-bg-subtle));
|
|
277
|
+
--xh-collection-bg-selected-hover: var(--xh-mention-item-bg-hover, var(--xh-bg-subtle));
|
|
278
|
+
--xh-collection-bg-pressed: var(--xh-mention-item-bg-pressed, var(--xh-bg-subtle-hover));
|
|
279
|
+
--xh-collection-bg-selected-pressed: var(--xh-mention-item-bg-pressed, var(--xh-bg-subtle-hover));
|
|
280
|
+
/* data-highlighted 同时覆盖指针与键盘路径;焦点恒在输入框,候选不接环 */
|
|
281
|
+
--xh-collection-outline-keyboard-highlight: transparent;
|
|
282
|
+
--xh-collection-outline-selected-highlight: transparent;
|
|
283
|
+
|
|
284
|
+
/* 行高留出文字的上下伸展空间,行内那层 overflow:hidden 才不会把字削掉 */
|
|
285
|
+
line-height: var(--xh-mention-item-leading, var(--xh-leading-normal));
|
|
286
|
+
white-space: nowrap;
|
|
287
|
+
user-select: none;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* 家族给了 display,UA 的 [hidden]{display:none} 已被盖掉,这里补回来 */
|
|
291
|
+
.xh-scope-mention[data-part='item'][hidden] {
|
|
292
|
+
display: none;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/* 只读时正文插不进东西,候选也就不该再摆出可点的样子。
|
|
296
|
+
标记读定位层那一份:候选被搬到 portal 落点,根上的只读标记够不着它们。
|
|
297
|
+
排掉禁用条目是因为这条选择器权重高过上面那条,不排就会把 not-allowed 覆盖回 default */
|
|
298
|
+
.xh-scope-mention[data-part='positioner'][data-readonly]
|
|
299
|
+
[data-part='item']:where(.xh-scope-mention):not([data-disabled]) {
|
|
300
|
+
cursor: default;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/* 正文落在家族网格的 text 列;网格项默认最小尺寸是内容尺寸,不归零则长文本把行撑破、省略号轮不上 */
|
|
304
|
+
.xh-scope-mention[data-part='item-text'] {
|
|
305
|
+
min-inline-size: 0;
|
|
306
|
+
overflow: hidden;
|
|
307
|
+
white-space: nowrap;
|
|
308
|
+
text-overflow: ellipsis;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.xh-scope-mention[data-part='item-text'][hidden] {
|
|
312
|
+
display: none;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
/* 空态保持为 listbox 的同级 role=status,只把文字叠到 content 的唯一表面。 */
|
|
318
|
+
.xh-scope-mention[data-part='empty'] {
|
|
319
|
+
/* 同级定位保证状态文字绘制在磨砂 content 上方,不需要额外层号。 */
|
|
320
|
+
position: relative;
|
|
321
|
+
display: flex;
|
|
322
|
+
align-items: center;
|
|
323
|
+
justify-content: center;
|
|
324
|
+
grid-area: 1 / 1;
|
|
325
|
+
padding-block: var(--xh-mention-empty-py, var(--xh-space-3));
|
|
326
|
+
padding-inline: var(--xh-mention-empty-px, var(--xh-_mention-item-px));
|
|
327
|
+
color: var(--xh-mention-empty-fg, var(--xh-material-frosted-fg-muted));
|
|
328
|
+
font-size: var(--xh-mention-empty-font-size, var(--xh-_mention-font-size));
|
|
329
|
+
line-height: var(--xh-leading-none);
|
|
330
|
+
text-align: center;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.xh-scope-mention[data-part='empty'][hidden] {
|
|
334
|
+
display: none;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/* 在途占位与空态同格、两者不同屏;它同样不重复绘制表面。 */
|
|
338
|
+
.xh-scope-mention[data-part='loading'] {
|
|
339
|
+
position: relative;
|
|
340
|
+
display: flex;
|
|
341
|
+
align-items: center;
|
|
342
|
+
justify-content: center;
|
|
343
|
+
gap: var(--xh-_mention-gap);
|
|
344
|
+
grid-area: 1 / 1;
|
|
345
|
+
padding-block: var(--xh-mention-loading-py, var(--xh-space-3));
|
|
346
|
+
padding-inline: var(--xh-mention-loading-px, var(--xh-_mention-item-px));
|
|
347
|
+
color: var(--xh-mention-loading-fg, var(--xh-material-frosted-fg-muted));
|
|
348
|
+
font-size: var(--xh-mention-loading-font-size, var(--xh-_mention-font-size));
|
|
349
|
+
line-height: var(--xh-leading-none);
|
|
350
|
+
text-align: center;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.xh-scope-mention[data-part='loading'][hidden] {
|
|
354
|
+
display: none;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/* 首次加载:文案前一枚加载环,由加载环配方画(连接层投影 data-xh-loading-ring 与 data-loading),
|
|
358
|
+
直径取所在尺寸档的图标档 */
|
|
359
|
+
.xh-scope-mention[data-part='loading']::before {
|
|
360
|
+
content: '';
|
|
361
|
+
flex: none;
|
|
362
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
363
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.xh-scope-mention[data-part='empty']:empty,
|
|
367
|
+
.xh-scope-mention[data-part='loading']:empty {
|
|
368
|
+
display: none;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/* 刷新:已有候选时后台在取,保留上一帧,候选按 micro 淡下,数据到了再淡回;在途占位此时让位。
|
|
372
|
+
淡的是候选不是面:content 是整块磨砂面,整块淡下去面就透了 */
|
|
373
|
+
.xh-scope-mention[data-part='content'][aria-busy='true'] .xh-scope-mention[data-part='item'] {
|
|
374
|
+
opacity: var(--xh-state-disabled-opacity);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/* 手写结构可以把全部候选留在 DOM 里只加 hidden;没有可见 item 也没有状态文案时,
|
|
378
|
+
打开的空 listbox 不画无意义框。closed 不命中,content 仍能完成 Presence 退场。 */
|
|
379
|
+
.xh-scope-mention[data-part='positioner']:not(:has(
|
|
380
|
+
> .xh-scope-mention[data-part='empty']:not([hidden]):not(:empty),
|
|
381
|
+
> .xh-scope-mention[data-part='loading']:not([hidden]):not(:empty)
|
|
382
|
+
)) > .xh-scope-mention[data-part='content'][data-state='open']:not(:has(
|
|
383
|
+
> .xh-scope-mention[data-part='item']:not([hidden])
|
|
384
|
+
)) {
|
|
385
|
+
visibility: hidden;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
@media print {
|
|
389
|
+
/* 打印:定位层与遮罩是交互期才存在的东西,落到纸上只会盖住底下的正文。
|
|
390
|
+
收起写在这份皮肤里而不是 reset:reset 层排在组件层之前,组件层里任何一条 display 都压得住它。 */
|
|
391
|
+
.xh-scope-mention[data-part='positioner'] {
|
|
392
|
+
display: none;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|