@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,404 @@
|
|
|
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
|
+
/* 定义 command 样式。 */
|
|
7
|
+
|
|
8
|
+
/* 共享关键帧由 family/motion.css 提供,命令走 Collection Item 家族;本皮肤 @import 它们,单独引入仍成立。 */
|
|
9
|
+
@import '../family/collection-item.css';
|
|
10
|
+
@import '../family/field-chrome.css';
|
|
11
|
+
@import '../family/loading-ring.css';
|
|
12
|
+
@import '../family/motion.css';
|
|
13
|
+
|
|
14
|
+
@layer xihan.components {
|
|
15
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
16
|
+
.xh-scope-command {
|
|
17
|
+
--xh-command-skin: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* 私有槽同时声明在定位层与面板上:面板被搬到 portal 落点,两处各自带一份 data-size,
|
|
21
|
+
谁先命中谁给出这一档的取值;条目、检索框与提示条都从面板继承下去 */
|
|
22
|
+
.xh-scope-command:is([data-part='positioner'], [data-part='content']) {
|
|
23
|
+
/* 条目外的字形(分组标题、底部提示条)按档取尺,缺省 md,随 data-size 换档;命令里的图标由家族随
|
|
24
|
+
data-xh-collection-size 下发 */
|
|
25
|
+
--xh-icon-size: var(--xh-command-icon-size, var(--xh-glyph-size-md));
|
|
26
|
+
|
|
27
|
+
/* 尺寸档只换这六个私有槽,换档不必给每个部件各写一条选择器 */
|
|
28
|
+
--xh-_command-max-w: var(--xh-overlay-sheet-w-md);
|
|
29
|
+
--xh-_command-input-h: var(--xh-control-h-md);
|
|
30
|
+
--xh-_command-px: var(--xh-control-px-md);
|
|
31
|
+
--xh-_command-item-py: var(--xh-list-option-py-md);
|
|
32
|
+
--xh-_command-item-h: var(--xh-list-option-h-md);
|
|
33
|
+
--xh-_command-gap: var(--xh-control-gap-md);
|
|
34
|
+
--xh-_command-font-size: var(--xh-control-font-md);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* 面板从上方落下来一小段:起点在终点之上(up 一侧写 1),与锚在顶缘的缩放同向。
|
|
38
|
+
方向槽写在定位层上,面板继承过去喂给进场那支动画 */
|
|
39
|
+
.xh-scope-command[data-part='positioner'] {
|
|
40
|
+
--xh-_overlay-enter-up: 1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* —— 尺寸 —— */
|
|
44
|
+
/* 缺省档写在上面的基础规则里 */
|
|
45
|
+
.xh-scope-command:is([data-part='positioner'], [data-part='content'])[data-size='sm'] {
|
|
46
|
+
--xh-icon-size: var(--xh-command-icon-size, var(--xh-glyph-size-sm));
|
|
47
|
+
--xh-_command-max-w: var(--xh-overlay-sheet-w-sm);
|
|
48
|
+
--xh-_command-input-h: var(--xh-control-h-sm);
|
|
49
|
+
--xh-_command-px: var(--xh-control-px-sm);
|
|
50
|
+
--xh-_command-item-py: var(--xh-list-option-py-sm);
|
|
51
|
+
--xh-_command-item-h: var(--xh-list-option-h-sm);
|
|
52
|
+
--xh-_command-gap: var(--xh-control-gap-sm);
|
|
53
|
+
--xh-_command-font-size: var(--xh-control-font-sm);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.xh-scope-command:is([data-part='positioner'], [data-part='content'])[data-size='lg'] {
|
|
57
|
+
--xh-icon-size: var(--xh-command-icon-size, var(--xh-glyph-size-lg));
|
|
58
|
+
--xh-_command-max-w: var(--xh-overlay-sheet-w-lg);
|
|
59
|
+
--xh-_command-input-h: var(--xh-control-h-lg);
|
|
60
|
+
--xh-_command-px: var(--xh-control-px-lg);
|
|
61
|
+
--xh-_command-item-py: var(--xh-list-option-py-lg);
|
|
62
|
+
--xh-_command-item-h: var(--xh-list-option-h-lg);
|
|
63
|
+
--xh-_command-gap: var(--xh-control-gap-lg);
|
|
64
|
+
--xh-_command-font-size: var(--xh-control-font-lg);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* —— 遮罩 —— */
|
|
68
|
+
.xh-scope-command[data-part='backdrop'] {
|
|
69
|
+
position: fixed;
|
|
70
|
+
inset: 0;
|
|
71
|
+
z-index: var(--xh-command-backdrop-layer, var(--xh-_layer, var(--xh-layer-modal)));
|
|
72
|
+
background: var(--xh-command-backdrop-bg, var(--xh-bg-overlay));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* 同一层底色之上再糊背后的页面 */
|
|
76
|
+
.xh-scope-command[data-part='backdrop'][data-variant='blur'] {
|
|
77
|
+
backdrop-filter: blur(var(--xh-command-backdrop-blur, var(--xh-overlay-backdrop-blur)));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* 去掉底色,只留下这一层吃指针:交互外关闭与滚动锁定照旧 */
|
|
81
|
+
.xh-scope-command[data-part='backdrop'][data-variant='transparent'] {
|
|
82
|
+
background: transparent;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.xh-scope-command[data-part='backdrop'][data-state='open']:not([data-instant]) {
|
|
86
|
+
animation: xh-fade-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* 退场补 forwards:动画播完到宿主真正卸载之间还有一帧,不定住终态遮罩会闪回全黑 */
|
|
90
|
+
.xh-scope-command[data-part='backdrop'][data-state='closed'] {
|
|
91
|
+
animation: xh-fade-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* —— 定位层 —— */
|
|
95
|
+
/* 面板不居中,贴着上沿放:下方留出来的空间全归结果列表,条目多的时候面板往下长,
|
|
96
|
+
不像居中那样两头一起挪、每敲一个字整块面板都在动 */
|
|
97
|
+
.xh-scope-command[data-part='positioner'] {
|
|
98
|
+
position: fixed;
|
|
99
|
+
inset: 0;
|
|
100
|
+
z-index: var(--xh-command-layer, var(--xh-_layer, var(--xh-layer-modal)));
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: flex-start;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
/* 全屏定位层只负责排版,不截获页面指针;模态拦截由 backdrop 承担。 */
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
padding-block-start: max(var(--xh-command-inset-block-start, var(--xh-space-8)), env(safe-area-inset-top));
|
|
107
|
+
padding-block-end: max(var(--xh-command-positioner-pb, var(--xh-space-4)), env(safe-area-inset-bottom));
|
|
108
|
+
padding-inline: max(
|
|
109
|
+
var(--xh-command-positioner-px, var(--xh-space-4)),
|
|
110
|
+
env(safe-area-inset-left),
|
|
111
|
+
env(safe-area-inset-right)
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* —— 面板 —— */
|
|
116
|
+
.xh-scope-command[data-part='content'] {
|
|
117
|
+
/* 结果列表的自绘条浮在内容之上:轨道不上底色,实色轨道会在面板右缘糊一条竖灰带 */
|
|
118
|
+
--xh-scrollbar-track-bg: transparent;
|
|
119
|
+
|
|
120
|
+
position: relative;
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
inline-size: 100%;
|
|
124
|
+
max-inline-size: var(--xh-command-max-w, var(--xh-_command-max-w));
|
|
125
|
+
/* 封顶才有可滚的余量:不封顶结果列表会一路撑到视口外,滚动条永远出不来 */
|
|
126
|
+
max-block-size: var(--xh-command-max-h, var(--xh-overlay-max-h));
|
|
127
|
+
/* 模态命令面板与 Dialog 同档:overlay 圆角 + sheet 三件套(material-elevated 的边 / 底 / 影),
|
|
128
|
+
边界由描边承担,不再只靠落影 */
|
|
129
|
+
border: var(--xh-stroke-thin) solid var(--xh-command-border, var(--xh-material-elevated-border));
|
|
130
|
+
border-radius: var(--xh-command-radius, var(--xh-shape-overlay));
|
|
131
|
+
background: var(--xh-command-bg, var(--xh-material-elevated-bg));
|
|
132
|
+
color: var(--xh-command-fg, var(--xh-material-elevated-fg));
|
|
133
|
+
box-shadow: var(--xh-command-shadow, var(--xh-material-elevated-shadow));
|
|
134
|
+
/* 条目的高亮底色是方角,滚到两端时会探出面板的圆角 */
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
/* positioner 不吃指针,面板自身恢复交互。 */
|
|
137
|
+
pointer-events: auto;
|
|
138
|
+
/* 进退场的缩放锚在面板顶缘:它是从上方落下来的 */
|
|
139
|
+
transform-origin: var(--xh-_overlay-origin-x, 50%) var(--xh-_overlay-origin-y, 0);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* 这里刻意没有 [data-part='content'][hidden] { display: none },与 dialog 一致:
|
|
143
|
+
收起态连接层会给 content 打 hidden,而上面那条 display: flex 正是要盖掉 UA 的
|
|
144
|
+
[hidden]{display:none}——退场动画得先能播。presence 读的是 content 的 animationName,
|
|
145
|
+
读到才申领租约、等 animationend 才卸载;一旦 display: none,元素不生成盒子、
|
|
146
|
+
动画根本不启动,探测器直接放弃租约,退场动画一帧都播不出来。
|
|
147
|
+
真正的收起由适配器兜住:Vue 卸载整棵,WC 写内联 style.display。
|
|
148
|
+
其余声明了 display 的角色节点仍补 [hidden],那几处没有退场动画。 */
|
|
149
|
+
|
|
150
|
+
/* 面板本身只承接程序化聚焦(开场那一刻还没轮到检索框),不画环 */
|
|
151
|
+
.xh-scope-command[data-part='content']:focus-visible {
|
|
152
|
+
outline: none;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* 挂载时就开着的那一段(data-instant)属于首帧,直接呈现 */
|
|
156
|
+
.xh-scope-command[data-part='content'][data-state='open']:not([data-instant]) {
|
|
157
|
+
animation: xh-overlay-pop-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* 退场:收起那一帧 hidden 由退场闸门押后,这里才播得出来。forwards 把末态钉住,
|
|
161
|
+
免得动画结束到真收起之间闪一下原样 */
|
|
162
|
+
.xh-scope-command[data-part='content'][data-state='closed'] {
|
|
163
|
+
animation: xh-pop-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* —— 检索框 —— */
|
|
167
|
+
/* 面板内嵌的搜索框:通栏一行,控件高与字号随尺寸档,底下一道面内分隔(sheet 面的分隔令牌)把它与结果分开;
|
|
168
|
+
框自己不画边不画底,边界归面板。重置与占位前景由字段家族按 data-xh-field-input 给 */
|
|
169
|
+
.xh-scope-command[data-part='input'] {
|
|
170
|
+
--xh-field-placeholder-fg: var(--xh-command-placeholder-fg, var(--xh-fg-subtle));
|
|
171
|
+
|
|
172
|
+
flex: none;
|
|
173
|
+
inline-size: 100%;
|
|
174
|
+
block-size: var(--xh-command-input-h, var(--xh-_command-input-h));
|
|
175
|
+
padding-block: 0;
|
|
176
|
+
padding-inline: var(--xh-command-input-px, var(--xh-_command-px));
|
|
177
|
+
border: 0;
|
|
178
|
+
border-block-end: var(--xh-stroke-thin) solid var(--xh-command-input-border, var(--xh-material-elevated-border));
|
|
179
|
+
border-radius: 0;
|
|
180
|
+
background: transparent;
|
|
181
|
+
color: var(--xh-command-input-fg, var(--xh-fg-default));
|
|
182
|
+
font-family: inherit;
|
|
183
|
+
font-size: var(--xh-command-input-font-size, var(--xh-_command-font-size));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* 聚焦不画环:插入符就是焦点指示。框没有外壳,全局那圈键盘焦点环只会压在通栏一行上 */
|
|
187
|
+
.xh-scope-command[data-part='input']:focus-visible {
|
|
188
|
+
outline: none;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* 自动填充态:浏览器给填过的框强加一套系统色(多数引擎是黄底黑字),
|
|
192
|
+
优先级高到 background / color 改不动,也不跟主题走。
|
|
193
|
+
底用 box-shadow 的 inset 扩散铺满内容盒,字用 -webkit-text-fill-color 接回令牌。
|
|
194
|
+
两个选择器名分写两条:一条选择器列表里只要有一个名字不被认识,整条规则就被丢弃。
|
|
195
|
+
底取不透明的面令牌而不是 transparent:检索框自己不画底,铺透明等于没铺 */
|
|
196
|
+
.xh-scope-command[data-part='input']:autofill {
|
|
197
|
+
box-shadow: inset 0 0 0 100vmax var(--xh-command-input-autofill-bg, var(--xh-bg-surface));
|
|
198
|
+
-webkit-text-fill-color: var(--xh-command-input-autofill-fg, var(--xh-fg-default));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.xh-scope-command[data-part='input']:-webkit-autofill {
|
|
202
|
+
box-shadow: inset 0 0 0 100vmax var(--xh-command-input-autofill-bg, var(--xh-bg-surface));
|
|
203
|
+
-webkit-text-fill-color: var(--xh-command-input-autofill-fg, var(--xh-fg-default));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* —— 结果列表 —— */
|
|
207
|
+
/* 只管滚动,留白归条目。min-block-size: 0 是弹性子项能真正滚动的前提——
|
|
208
|
+
不给的话它按内容撑高,面板的 max-block-size 就只会把溢出的部分裁掉而不是交给它滚 */
|
|
209
|
+
.xh-scope-command[data-part='list'] {
|
|
210
|
+
display: flex;
|
|
211
|
+
flex: 1 1 auto;
|
|
212
|
+
flex-direction: column;
|
|
213
|
+
gap: var(--xh-command-list-gap, var(--xh-list-option-gap));
|
|
214
|
+
min-block-size: 0;
|
|
215
|
+
/* 行通栏:列表左右不留内衬,行面贴到面板两缘;上下各留 4px */
|
|
216
|
+
padding-block: var(--xh-command-list-py, var(--xh-space-1));
|
|
217
|
+
padding-inline: var(--xh-command-list-px, var(--xh-space-0));
|
|
218
|
+
/* 模态面板里的滚动面:到底后不把滚动链穿透给页面 */
|
|
219
|
+
overflow-y: auto;
|
|
220
|
+
overscroll-behavior: contain;
|
|
221
|
+
transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* 没有可见命令时不保留列表的上下内距;只排除列表内部 hidden 祖先,退场中的外壳不影响判断。 */
|
|
225
|
+
.xh-scope-command[data-part='list']:not(:has(
|
|
226
|
+
.xh-scope-command[data-part='item']:not([hidden]):not(
|
|
227
|
+
.xh-scope-command[data-part='list'] [hidden] *
|
|
228
|
+
)
|
|
229
|
+
)) {
|
|
230
|
+
display: none;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* 列表从不承载焦点(焦点恒在检索框,锚点走 aria-activedescendant),
|
|
234
|
+
可滚动容器在某些浏览器里会被自动塞进 Tab 序列,落焦时不画环 */
|
|
235
|
+
.xh-scope-command[data-part='list']:focus-visible {
|
|
236
|
+
outline: none;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* —— 分组 —— */
|
|
240
|
+
.xh-scope-command[data-part='group'] {
|
|
241
|
+
display: flex;
|
|
242
|
+
flex-direction: column;
|
|
243
|
+
gap: var(--xh-command-group-gap, var(--xh-list-option-gap));
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* 组间留白只加在后继分组上:首组顶上已经有列表的内边距,再加一层会显得头重 */
|
|
247
|
+
.xh-scope-command[data-part='group'] + .xh-scope-command[data-part='group'] {
|
|
248
|
+
margin-block-start: var(--xh-command-group-spacing, var(--xh-space-2));
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* 分组标题不是命令、进不了导航,画成小号次要文字,内缩与条目对齐 */
|
|
252
|
+
.xh-scope-command[data-part='group-label'] {
|
|
253
|
+
display: block;
|
|
254
|
+
padding-block: var(--xh-command-group-label-py, var(--xh-space-1));
|
|
255
|
+
padding-inline: var(--xh-command-group-label-px, var(--xh-_command-px));
|
|
256
|
+
color: var(--xh-command-group-label-fg, var(--xh-fg-subtle));
|
|
257
|
+
font-size: var(--xh-command-group-label-font-size, var(--xh-text-caption-size));
|
|
258
|
+
font-weight: var(--xh-command-group-label-font-weight, var(--xh-font-weight-regular));
|
|
259
|
+
line-height: var(--xh-leading-none);
|
|
260
|
+
user-select: none;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* —— 命令 —— */
|
|
264
|
+
/* 命令走 Collection Item 的 overlay 语境:悬停 / 键盘锚点(data-highlighted,白底承载 100)、按下(200)与禁用面
|
|
265
|
+
(aria-disabled)都由家族给,这里只把公开槽映射到桥接槽。aria-selected 跟着活动候选走(selection-follows-focus),
|
|
266
|
+
家族的浮层选中面缺省透明:这里把选中各态映射到与悬停 / 按下同一档,活动候选与指针悬停看上去是同一副面,
|
|
267
|
+
命令面板里没有第二档,选中即执行、不留状态。命令从不承载焦点(焦点恒在检索框),高亮不画环。
|
|
268
|
+
布局保持 flex:图标、正文、快捷键按作者顺序排成一行,不用家族网格;间距由行的 gap 给 */
|
|
269
|
+
.xh-scope-command[data-part='item'] {
|
|
270
|
+
--xh-collection-block-padding: var(--xh-command-item-py, var(--xh-_command-item-py));
|
|
271
|
+
--xh-collection-row-h: var(--xh-command-item-h, var(--xh-_command-item-h));
|
|
272
|
+
--xh-collection-inline-padding: var(--xh-command-item-px, var(--xh-_command-px));
|
|
273
|
+
--xh-collection-gap: 0;
|
|
274
|
+
--xh-collection-font-size: var(--xh-command-item-font-size, var(--xh-_command-font-size));
|
|
275
|
+
--xh-collection-radius: var(--xh-command-item-radius, 0);
|
|
276
|
+
--xh-collection-fg-rest: var(--xh-command-item-fg, var(--xh-fg-default));
|
|
277
|
+
--xh-collection-fg-hover: var(--xh-command-item-fg, var(--xh-fg-default));
|
|
278
|
+
--xh-collection-fg-keyboard-highlight: var(--xh-command-item-fg, var(--xh-fg-default));
|
|
279
|
+
--xh-collection-fg-pressed: var(--xh-command-item-fg, var(--xh-fg-default));
|
|
280
|
+
--xh-collection-fg-selected: var(--xh-command-item-fg, var(--xh-fg-default));
|
|
281
|
+
--xh-collection-fg-selected-hover: var(--xh-command-item-fg, var(--xh-fg-default));
|
|
282
|
+
--xh-collection-fg-selected-highlight: var(--xh-command-item-fg, var(--xh-fg-default));
|
|
283
|
+
--xh-collection-fg-selected-pressed: var(--xh-command-item-fg, var(--xh-fg-default));
|
|
284
|
+
--xh-collection-bg-hover: var(--xh-command-item-bg-hover, var(--xh-bg-subtle));
|
|
285
|
+
--xh-collection-bg-keyboard-highlight: var(--xh-command-item-bg-hover, var(--xh-bg-subtle));
|
|
286
|
+
--xh-collection-bg-selected: var(--xh-command-item-bg-hover, var(--xh-bg-subtle));
|
|
287
|
+
--xh-collection-bg-selected-hover: var(--xh-command-item-bg-hover, var(--xh-bg-subtle));
|
|
288
|
+
--xh-collection-bg-selected-highlight: var(--xh-command-item-bg-hover, var(--xh-bg-subtle));
|
|
289
|
+
--xh-collection-bg-pressed: var(--xh-command-item-bg-pressed, var(--xh-bg-subtle-hover));
|
|
290
|
+
--xh-collection-bg-selected-pressed: var(--xh-command-item-bg-pressed, var(--xh-bg-subtle-hover));
|
|
291
|
+
--xh-collection-outline-keyboard-highlight: transparent;
|
|
292
|
+
--xh-collection-outline-selected-highlight: transparent;
|
|
293
|
+
|
|
294
|
+
display: flex;
|
|
295
|
+
align-items: center;
|
|
296
|
+
gap: var(--xh-command-item-gap, var(--xh-_command-gap));
|
|
297
|
+
/* 行高留出文字的上下伸展空间,行内那层 overflow:hidden 才不会把字削掉 */
|
|
298
|
+
line-height: var(--xh-command-item-leading, var(--xh-leading-normal));
|
|
299
|
+
user-select: none;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/* 新插进列表的命令(宿主追加、异步取回的一批)自上而下逐条冒出来,同一批按到达顺序错开(序号封顶,命令再多也
|
|
303
|
+
不会拖出一条越来越慢的尾巴)。打开时已有的结果直接呈现:自己或本列表带 data-instant。
|
|
304
|
+
检索过滤筛掉的条目带 hidden 不生成盒子,重新露面只是换一批已有结果,机器给它打上 data-instant 直接呈现。
|
|
305
|
+
backwards 让每条在自己那份延迟里保持起始帧 */
|
|
306
|
+
.xh-scope-command[data-part='list'] [data-part='item']:where(.xh-scope-command):not([data-instant], .xh-scope-command[data-part='list'][data-instant] :where(.xh-scope-command)) {
|
|
307
|
+
animation: xh-rise-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong) backwards;
|
|
308
|
+
animation-delay: calc(var(--xh-_stagger-index, 0) * var(--xh-motion-stagger-step));
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.xh-scope-command[data-part='item-text'] {
|
|
312
|
+
flex: 1;
|
|
313
|
+
/* 弹性子项默认最小尺寸是内容尺寸,不归零则长文本把行撑破、省略号轮不上 */
|
|
314
|
+
min-inline-size: 0;
|
|
315
|
+
overflow: hidden;
|
|
316
|
+
white-space: nowrap;
|
|
317
|
+
text-overflow: ellipsis;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* —— 两个占位 —— */
|
|
321
|
+
/* 空态占位:待在面板里、列表的兄弟;盒与阴影归面板,这里只画一句居中的次要文字 */
|
|
322
|
+
.xh-scope-command[data-part='empty'] {
|
|
323
|
+
display: block;
|
|
324
|
+
flex: none;
|
|
325
|
+
padding-block: var(--xh-command-empty-py, var(--xh-space-3));
|
|
326
|
+
padding-inline: var(--xh-command-empty-px, var(--xh-_command-px));
|
|
327
|
+
color: var(--xh-command-empty-fg, var(--xh-fg-muted));
|
|
328
|
+
font-size: var(--xh-command-empty-font-size, var(--xh-_command-font-size));
|
|
329
|
+
line-height: var(--xh-leading-none);
|
|
330
|
+
text-align: center;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* 在途占位:与空态占位同一个位置、同一副观感,两者不同屏 */
|
|
334
|
+
.xh-scope-command[data-part='loading'] {
|
|
335
|
+
display: flex;
|
|
336
|
+
align-items: center;
|
|
337
|
+
justify-content: center;
|
|
338
|
+
gap: var(--xh-_command-gap);
|
|
339
|
+
flex: none;
|
|
340
|
+
padding-block: var(--xh-command-loading-py, var(--xh-space-3));
|
|
341
|
+
padding-inline: var(--xh-command-loading-px, var(--xh-_command-px));
|
|
342
|
+
color: var(--xh-command-loading-fg, var(--xh-fg-muted));
|
|
343
|
+
font-size: var(--xh-command-loading-font-size, var(--xh-_command-font-size));
|
|
344
|
+
line-height: var(--xh-leading-none);
|
|
345
|
+
text-align: center;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* 首次加载:文案前一枚加载环,由加载环配方画(连接层投影 data-xh-loading-ring 与 data-loading),
|
|
349
|
+
直径取所在尺寸档的图标档 */
|
|
350
|
+
.xh-scope-command[data-part='loading']::before {
|
|
351
|
+
content: '';
|
|
352
|
+
flex: none;
|
|
353
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
354
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/* 未提供状态内容时不渲染一块纯留白,提示文案仍由作者明确提供。 */
|
|
358
|
+
.xh-scope-command[data-part='empty']:empty,
|
|
359
|
+
.xh-scope-command[data-part='loading']:empty {
|
|
360
|
+
display: none;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/* 刷新:已有命令时后台在取,保留上一帧,列表按 micro 淡下,数据到了再淡回;在途占位此时让位 */
|
|
364
|
+
.xh-scope-command[data-part='list'][aria-busy='true'] {
|
|
365
|
+
opacity: var(--xh-command-list-busy-opacity, var(--xh-state-disabled-opacity));
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/* —— 底部提示条 —— */
|
|
369
|
+
/* 贴在列表下沿,用一道分隔线与命令断开;作者往里放什么由作者定 */
|
|
370
|
+
.xh-scope-command[data-part='footer'] {
|
|
371
|
+
display: flex;
|
|
372
|
+
flex: none;
|
|
373
|
+
align-items: center;
|
|
374
|
+
gap: var(--xh-command-footer-gap, var(--xh-space-2));
|
|
375
|
+
padding-block: var(--xh-command-footer-py, var(--xh-space-2));
|
|
376
|
+
padding-inline: var(--xh-command-footer-px, var(--xh-_command-px));
|
|
377
|
+
border-block-start: var(--xh-stroke-thin) solid var(--xh-command-footer-border, var(--xh-material-elevated-border));
|
|
378
|
+
color: var(--xh-command-footer-fg, var(--xh-fg-muted));
|
|
379
|
+
font-size: var(--xh-command-footer-font-size, var(--xh-text-caption-size));
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
|
|
383
|
+
写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
|
|
384
|
+
.xh-scope-command[data-part='positioner'][hidden],
|
|
385
|
+
.xh-scope-command[data-part='list'][hidden],
|
|
386
|
+
.xh-scope-command[data-part='group'][hidden],
|
|
387
|
+
.xh-scope-command[data-part='group-label'][hidden],
|
|
388
|
+
.xh-scope-command[data-part='item'][hidden],
|
|
389
|
+
.xh-scope-command[data-part='item-text'][hidden],
|
|
390
|
+
.xh-scope-command[data-part='empty'][hidden],
|
|
391
|
+
.xh-scope-command[data-part='loading'][hidden],
|
|
392
|
+
.xh-scope-command[data-part='footer'][hidden] {
|
|
393
|
+
display: none;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
@media print {
|
|
397
|
+
/* 打印:定位层与遮罩是交互期才存在的东西,落到纸上只会盖住底下的正文。
|
|
398
|
+
收起写在这份皮肤里而不是 reset:reset 层排在组件层之前,组件层里任何一条 display 都压得住它。 */
|
|
399
|
+
.xh-scope-command[data-part='backdrop'],
|
|
400
|
+
.xh-scope-command[data-part='positioner'] {
|
|
401
|
+
display: none;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|