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