@xihan-ui/styles 3.0.0 → 3.2.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 +63 -0
- package/README.md +1 -1
- package/component-tokens.d.ts +29 -0
- package/components.tokens.json +683 -27
- package/css/alert.css +2 -2
- package/css/approval.css +4 -4
- package/css/button.css +9 -5
- package/css/calendar-picker.css +3 -3
- package/css/calendar-range-picker.css +7 -7
- package/css/carousel.css +45 -13
- package/css/cartesian-chart.css +11 -11
- package/css/cascader.css +10 -10
- package/css/citation.css +2 -2
- package/css/code-view.css +6 -6
- package/css/color-picker.css +81 -0
- package/css/color-swatch-picker.css +9 -4
- package/css/combobox.css +12 -4
- package/css/command.css +1 -1
- package/css/date-field.css +39 -0
- package/css/date-picker.css +86 -9
- package/css/date-range-picker.css +47 -7
- package/css/diff-view.css +8 -8
- package/css/field-array.css +1 -1
- package/css/field.css +4 -0
- package/css/file-upload.css +1 -1
- package/css/float-button.css +140 -27
- package/css/form.css +14 -6
- package/css/graph-chart.css +2 -2
- package/css/highlight.css +1 -1
- package/css/image.css +1 -1
- package/css/mention.css +1 -1
- package/css/message-feed.css +1 -1
- package/css/notification.css +26 -20
- package/css/number-field.css +18 -18
- package/css/page-header.css +2 -2
- package/css/password-input.css +2 -2
- package/css/popconfirm.css +3 -3
- package/css/question-flow.css +8 -8
- package/css/radar-chart.css +6 -6
- package/css/rating.css +1 -1
- package/css/select.css +2 -2
- package/css/separator.css +2 -2
- package/css/side-nav.css +13 -13
- package/css/skeleton.css +5 -5
- package/css/slider.css +6 -6
- package/css/sortable.css +2 -2
- package/css/table.css +19 -2
- package/css/tags-input.css +1 -1
- package/css/time-picker.css +59 -2
- package/css/tool-call.css +7 -7
- package/css/tooltip.css +1 -1
- package/css/tree-select.css +2 -2
- package/css/tree.css +81 -11
- package/dist/css/accordion.css +269 -0
- package/dist/css/affix.css +47 -0
- package/dist/css/alert.css +247 -0
- package/dist/css/anchor.css +252 -0
- package/dist/css/approval.css +501 -0
- package/dist/css/avatar-group.css +99 -0
- package/dist/css/avatar.css +98 -0
- package/dist/css/back-top.css +161 -0
- package/dist/css/badge.css +205 -0
- package/dist/css/bar-code.css +62 -0
- package/dist/css/breadcrumb.css +230 -0
- package/dist/css/button-group.css +263 -0
- package/dist/css/button.css +219 -0
- package/dist/css/calendar-picker.css +467 -0
- package/dist/css/calendar-range-picker.css +554 -0
- package/dist/css/card.css +221 -0
- package/dist/css/carousel.css +710 -0
- package/dist/css/cartesian-chart.css +830 -0
- package/dist/css/cascader.css +961 -0
- package/dist/css/checkbox-group.css +358 -0
- package/dist/css/checkbox.css +257 -0
- package/dist/css/citation.css +470 -0
- package/dist/css/clipboard.css +315 -0
- package/dist/css/code-view.css +374 -0
- package/dist/css/collapsible.css +185 -0
- package/dist/css/color-field.css +176 -0
- package/dist/css/color-picker.css +595 -0
- package/dist/css/color-slider.css +281 -0
- package/dist/css/color-swatch-picker.css +250 -0
- package/dist/css/color-swatch.css +35 -0
- package/dist/css/combobox.css +574 -0
- package/dist/css/command.css +399 -0
- package/dist/css/context-menu.css +420 -0
- package/dist/css/date-field.css +317 -0
- package/dist/css/date-picker.css +868 -0
- package/dist/css/date-range-picker.css +886 -0
- package/dist/css/description.css +67 -0
- package/dist/css/descriptions.css +299 -0
- package/dist/css/dialog.css +455 -0
- package/dist/css/diff-view.css +513 -0
- package/dist/css/download-trigger.css +151 -0
- package/dist/css/drawer.css +552 -0
- package/dist/css/editable.css +295 -0
- package/dist/css/empty-state.css +163 -0
- package/dist/css/field-array.css +226 -0
- package/dist/css/field.css +166 -0
- package/dist/css/fieldset.css +102 -0
- package/dist/css/file-upload.css +429 -0
- package/dist/css/flex.css +441 -0
- package/dist/css/float-button.css +569 -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 +393 -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 +226 -0
- package/dist/css/icon.css +225 -0
- package/dist/css/image-cropper.css +373 -0
- package/dist/css/image-viewer.css +538 -0
- package/dist/css/image.css +98 -0
- package/dist/css/infinite-scroll.css +77 -0
- package/dist/css/input-group.css +275 -0
- package/dist/css/json-viewer.css +379 -0
- package/dist/css/kbd.css +72 -0
- package/dist/css/label.css +78 -0
- package/dist/css/layers.css +7 -0
- package/dist/css/layout.css +372 -0
- package/dist/css/liquid.css +106 -0
- package/dist/css/list.css +152 -0
- package/dist/css/listbox.css +390 -0
- package/dist/css/loading-bar.css +141 -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 +393 -0
- package/dist/css/menu.css +364 -0
- package/dist/css/menubar.css +456 -0
- package/dist/css/message-feed.css +318 -0
- package/dist/css/navigation-menu.css +513 -0
- package/dist/css/notification.css +782 -0
- package/dist/css/number-animation.css +44 -0
- package/dist/css/number-field.css +252 -0
- package/dist/css/overlay-arrow.css +56 -0
- package/dist/css/page-header.css +184 -0
- package/dist/css/pagination.css +450 -0
- package/dist/css/password-input.css +391 -0
- package/dist/css/pie-chart.css +247 -0
- package/dist/css/pin-input.css +199 -0
- package/dist/css/pointer.css +36 -0
- package/dist/css/popconfirm.css +320 -0
- package/dist/css/popover.css +279 -0
- package/dist/css/progress.css +501 -0
- package/dist/css/prompt-input.css +260 -0
- package/dist/css/question-flow.css +553 -0
- package/dist/css/radar-chart.css +233 -0
- package/dist/css/radio-group.css +598 -0
- package/dist/css/rating.css +294 -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 +612 -0
- package/dist/css/separator.css +122 -0
- package/dist/css/side-nav.css +476 -0
- package/dist/css/signature-pad.css +179 -0
- package/dist/css/skeleton.css +161 -0
- package/dist/css/slider.css +374 -0
- package/dist/css/sortable.css +228 -0
- package/dist/css/sparkline.css +164 -0
- package/dist/css/spinner.css +236 -0
- package/dist/css/splitter.css +159 -0
- package/dist/css/statistic.css +137 -0
- package/dist/css/steps.css +627 -0
- package/dist/css/switch.css +351 -0
- package/dist/css/table.css +1145 -0
- package/dist/css/tabs.css +944 -0
- package/dist/css/tag-group.css +247 -0
- package/dist/css/tag.css +310 -0
- package/dist/css/tags-input.css +322 -0
- package/dist/css/text-field.css +197 -0
- package/dist/css/time-field.css +277 -0
- package/dist/css/time-picker.css +707 -0
- package/dist/css/time-range-picker.css +746 -0
- package/dist/css/timeline.css +423 -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 +429 -0
- package/dist/css/toolbar.css +365 -0
- package/dist/css/tooltip.css +218 -0
- package/dist/css/tour.css +439 -0
- package/dist/css/transfer.css +638 -0
- package/dist/css/tree-select.css +878 -0
- package/dist/css/tree.css +733 -0
- package/dist/css/truncate.css +108 -0
- package/dist/css/typography.css +472 -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 +487 -0
- package/dist/family/chart.css +480 -0
- package/dist/family/check-mark.css +94 -0
- package/dist/family/choice-card.css +97 -0
- package/dist/family/collection-item.css +764 -0
- package/dist/family/field-chrome.css +287 -0
- package/dist/family/loading-ring.css +95 -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 +59 -0
- package/family/action-control.css +3 -12
- package/index.css +7307 -6759
- package/index.unlayered.css +7309 -6761
- package/package.json +165 -164
|
@@ -0,0 +1,205 @@
|
|
|
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
|
+
/* 定义 graph chart 样式。 */
|
|
7
|
+
|
|
8
|
+
/* 标题、视口、图例、提示框、空态与焦点环走 Chart 家族配方。本皮肤 @import 它,单独引入仍成立。 */
|
|
9
|
+
@import '../family/motion.css';
|
|
10
|
+
@import '../family/chart.css';
|
|
11
|
+
@import '../family/loading-ring.css';
|
|
12
|
+
|
|
13
|
+
@layer xihan.components {
|
|
14
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
15
|
+
.xh-scope-graph-chart {
|
|
16
|
+
--xh-graph-chart-skin: 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* 几何要用的像素值以这里的私有槽为真源:机器挂载后从计算样式读它们,作者覆盖组件槽即改变几何。
|
|
20
|
+
节点的基准半径借点径那一格传进去 */
|
|
21
|
+
.xh-scope-graph-chart[data-part='root'] {
|
|
22
|
+
--xh-_chart-metric-bar-max: var(--xh-chart-bar-max);
|
|
23
|
+
--xh-_chart-metric-gap: var(--xh-chart-gap);
|
|
24
|
+
--xh-_chart-metric-line-width: var(--xh-chart-line-width);
|
|
25
|
+
--xh-_chart-metric-point-size: var(--xh-graph-chart-node-size, var(--xh-chart-point-size));
|
|
26
|
+
--xh-_chart-metric-hit-min: var(--xh-chart-hit-min);
|
|
27
|
+
--xh-_chart-metric-tick-length: var(--xh-chart-tick-length);
|
|
28
|
+
--xh-_chart-metric-label-gap: var(--xh-chart-label-gap);
|
|
29
|
+
--xh-_chart-metric-radius: var(--xh-shape-inset);
|
|
30
|
+
--xh-_chart-metric-font-size: var(--xh-text-caption-size);
|
|
31
|
+
--xh-_chart-metric-leading: var(--xh-leading-tight);
|
|
32
|
+
--xh-_chart-gap: var(--xh-graph-chart-gap, var(--xh-space-3));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* —— 家族配方的组件槽:标题、视口、图例、提示框与空态由 family/chart.css 画,本图表的覆盖槽写在
|
|
36
|
+
对应部件上接进配方的私有槽,作者在部件或它的祖先上覆盖都生效 —— */
|
|
37
|
+
.xh-scope-graph-chart[data-part='viewport'] {
|
|
38
|
+
--xh-_chart-height: var(--xh-graph-chart-height, var(--xh-chart-height));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.xh-scope-graph-chart[data-part='legend'] {
|
|
42
|
+
--xh-_chart-legend-gap: var(--xh-graph-chart-legend-gap, var(--xh-space-1));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.xh-scope-graph-chart[data-part='legend-swatch'] {
|
|
46
|
+
--xh-_chart-legend-swatch-radius: var(--xh-graph-chart-legend-swatch-radius, var(--xh-shape-inset));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.xh-scope-graph-chart[data-part='tooltip'] {
|
|
50
|
+
--xh-_chart-tooltip-gap: var(--xh-graph-chart-tooltip-gap, var(--xh-space-1));
|
|
51
|
+
--xh-_chart-tooltip-py: var(--xh-graph-chart-tooltip-py, var(--xh-surface-pad-sm));
|
|
52
|
+
--xh-_chart-tooltip-px: var(--xh-graph-chart-tooltip-px, var(--xh-surface-pad-sm));
|
|
53
|
+
--xh-_chart-tooltip-radius: var(--xh-graph-chart-tooltip-radius, var(--xh-shape-overlay));
|
|
54
|
+
--xh-_chart-tooltip-shadow: var(--xh-graph-chart-tooltip-shadow, var(--xh-material-frosted-shadow));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.xh-scope-graph-chart[data-part='tooltip-row'] {
|
|
58
|
+
--xh-_chart-tooltip-row-gap: var(--xh-graph-chart-tooltip-row-gap, var(--xh-space-2));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.xh-scope-graph-chart[data-part='empty'][data-state='loading'] {
|
|
62
|
+
--xh-_chart-empty-gap: var(--xh-graph-chart-empty-gap, var(--xh-space-2));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* —— 色槽:分组由色槽承担,作者可以在节点上覆盖 --xh-graph-chart-series-color ——
|
|
66
|
+
节点、被强调的连线、图例项都带着色槽,各自从这里取系列色 */
|
|
67
|
+
.xh-scope-graph-chart[data-xh-chart-slot='1'] {
|
|
68
|
+
--xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-1));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.xh-scope-graph-chart[data-xh-chart-slot='2'] {
|
|
72
|
+
--xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-2));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.xh-scope-graph-chart[data-xh-chart-slot='3'] {
|
|
76
|
+
--xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-3));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.xh-scope-graph-chart[data-xh-chart-slot='4'] {
|
|
80
|
+
--xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-4));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.xh-scope-graph-chart[data-xh-chart-slot='5'] {
|
|
84
|
+
--xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-5));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.xh-scope-graph-chart[data-xh-chart-slot='6'] {
|
|
88
|
+
--xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-6));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.xh-scope-graph-chart[data-xh-chart-slot='7'] {
|
|
92
|
+
--xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-7));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.xh-scope-graph-chart[data-xh-chart-slot='8'] {
|
|
96
|
+
--xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-8));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* —— 连线:次要的中性色细线,有权重时按权重加粗(宽度由连接层写进私有槽);箭头与线同色。
|
|
100
|
+
指着一个节点时连着它的线换成它的颜色,其余淡出 —— */
|
|
101
|
+
.xh-scope-graph-chart[data-part='link'],
|
|
102
|
+
.xh-scope-graph-chart[data-part='arrow'] {
|
|
103
|
+
--xh-_graph-link: var(--xh-graph-chart-link-color, var(--xh-fg-subtle));
|
|
104
|
+
|
|
105
|
+
transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.xh-scope-graph-chart[data-part='link'] {
|
|
109
|
+
fill: none;
|
|
110
|
+
stroke: var(--xh-_graph-link);
|
|
111
|
+
stroke-width: var(--xh-_graph-link-width, var(--xh-graph-chart-link-width, var(--xh-stroke-thin)));
|
|
112
|
+
stroke-linecap: round;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.xh-scope-graph-chart[data-part='arrow'] {
|
|
116
|
+
fill: var(--xh-_graph-link);
|
|
117
|
+
stroke: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.xh-scope-graph-chart[data-part='link'][data-highlighted],
|
|
121
|
+
.xh-scope-graph-chart[data-part='arrow'][data-highlighted] {
|
|
122
|
+
--xh-_graph-link: var(--xh-_chart-series);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* —— 节点:取分组的系列色,外面描一圈承载面色,节点挨在一起、压在连线上时边界照样分明 —— */
|
|
126
|
+
.xh-scope-graph-chart[data-part='node'] {
|
|
127
|
+
fill: var(--xh-_chart-series);
|
|
128
|
+
stroke: var(--xh-chart-surface);
|
|
129
|
+
stroke-width: var(--xh-chart-gap);
|
|
130
|
+
transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.xh-scope-graph-chart[data-part='link'][data-dimmed],
|
|
134
|
+
.xh-scope-graph-chart[data-part='arrow'][data-dimmed],
|
|
135
|
+
.xh-scope-graph-chart[data-part='node'][data-dimmed],
|
|
136
|
+
.xh-scope-graph-chart[data-part='node-label'][data-dimmed],
|
|
137
|
+
.xh-scope-graph-chart[data-part='link-label'][data-dimmed] {
|
|
138
|
+
opacity: var(--xh-chart-dim-alpha);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* 节点名可能压在连线上:正文色,描一圈承载面色,交叠处也读得清。名字不接指针,命中归节点 */
|
|
142
|
+
.xh-scope-graph-chart[data-part='node-label'] {
|
|
143
|
+
fill: var(--xh-fg-default);
|
|
144
|
+
stroke: var(--xh-chart-surface);
|
|
145
|
+
stroke-width: var(--xh-stroke-thick);
|
|
146
|
+
stroke-linejoin: round;
|
|
147
|
+
paint-order: stroke;
|
|
148
|
+
pointer-events: none;
|
|
149
|
+
transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* 连线上的字就压在线上:次级文字色与节点名分出主次,同样描一圈承载面色把线从字底下断开 */
|
|
153
|
+
.xh-scope-graph-chart[data-part='link-label'] {
|
|
154
|
+
fill: var(--xh-fg-muted);
|
|
155
|
+
stroke: var(--xh-chart-surface);
|
|
156
|
+
stroke-width: var(--xh-stroke-thick);
|
|
157
|
+
stroke-linejoin: round;
|
|
158
|
+
paint-order: stroke;
|
|
159
|
+
pointer-events: none;
|
|
160
|
+
transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* —— 直接操纵:能拖的节点给抓手,拖着时整张图是抓紧的手;放大后空白处也能拖着平移。
|
|
164
|
+
触屏在节点上的拖动归图,其余地方照常滚动页面 —— */
|
|
165
|
+
.xh-scope-graph-chart[data-part='plot'][data-draggable] [data-part='node']:where(.xh-scope-graph-chart) {
|
|
166
|
+
cursor: grab;
|
|
167
|
+
touch-action: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.xh-scope-graph-chart[data-part='plot'][data-zoomed] {
|
|
171
|
+
cursor: grab;
|
|
172
|
+
touch-action: none;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.xh-scope-graph-chart[data-part='plot'][data-dragging],
|
|
176
|
+
.xh-scope-graph-chart[data-part='plot'][data-dragging] [data-part='node']:where(.xh-scope-graph-chart) {
|
|
177
|
+
cursor: grabbing;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* 强制色:节点改成系统色的面与描边,连线取次级系统色、被强调的取高亮色,名字取正文色;
|
|
181
|
+
焦点环、图例与色标在配方里 */
|
|
182
|
+
@media (forced-colors: active) {
|
|
183
|
+
.xh-scope-graph-chart[data-part='node'] {
|
|
184
|
+
fill: Canvas;
|
|
185
|
+
stroke: CanvasText;
|
|
186
|
+
stroke-width: var(--xh-stroke-thin);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.xh-scope-graph-chart[data-part='link'],
|
|
190
|
+
.xh-scope-graph-chart[data-part='arrow'] {
|
|
191
|
+
--xh-_graph-link: GrayText;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.xh-scope-graph-chart[data-part='link'][data-highlighted],
|
|
195
|
+
.xh-scope-graph-chart[data-part='arrow'][data-highlighted] {
|
|
196
|
+
--xh-_graph-link: Highlight;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.xh-scope-graph-chart[data-part='node-label'],
|
|
200
|
+
.xh-scope-graph-chart[data-part='link-label'] {
|
|
201
|
+
fill: CanvasText;
|
|
202
|
+
stroke: Canvas;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
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
|
+
/* GridList 的行复用 Collection Item;拖动把手由组合进来的 Sortable 负责。 */
|
|
7
|
+
@import '../family/action-control.css';
|
|
8
|
+
@import '../family/check-mark.css';
|
|
9
|
+
@import '../family/collection-item.css';
|
|
10
|
+
@import '../family/loading-ring.css';
|
|
11
|
+
@import '../family/motion.css';
|
|
12
|
+
|
|
13
|
+
@layer xihan.components {
|
|
14
|
+
.xh-scope-grid-list {
|
|
15
|
+
--xh-grid-list-skin: 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.xh-scope-grid-list[data-part='root'] {
|
|
19
|
+
--xh-_grid-list-indicator: var(--xh-control-indicator-md);
|
|
20
|
+
--xh-_grid-list-indicator-glyph: calc(var(--xh-_grid-list-indicator) * 0.75);
|
|
21
|
+
--xh-_grid-list-indicator-accent: var(--xh-_tone-border-control, var(--xh-bg-brand));
|
|
22
|
+
--xh-_grid-list-indicator-on-accent: var(--xh-_tone-on, var(--xh-fg-on-brand));
|
|
23
|
+
--xh-icon-size: var(--xh-grid-list-icon-size, var(--xh-glyph-size-md));
|
|
24
|
+
/* 占位文案与条目同档:字号与行内内衬随尺寸档 */
|
|
25
|
+
--xh-_grid-list-state-font-size: var(--xh-control-font-md);
|
|
26
|
+
--xh-_grid-list-state-px: var(--xh-control-px-md);
|
|
27
|
+
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
gap: var(--xh-grid-list-gap, var(--xh-list-option-gap));
|
|
32
|
+
inline-size: 100%;
|
|
33
|
+
min-inline-size: 0;
|
|
34
|
+
padding: var(--xh-grid-list-p, var(--xh-space-1));
|
|
35
|
+
border: var(--xh-stroke-thin) solid transparent;
|
|
36
|
+
border-radius: var(--xh-grid-list-radius, var(--xh-shape-surface));
|
|
37
|
+
background: var(--xh-grid-list-bg, transparent);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.xh-scope-grid-list[data-part='root'][data-variant='outline'] {
|
|
41
|
+
border-color: var(--xh-grid-list-border, var(--xh-border-default));
|
|
42
|
+
background: var(--xh-grid-list-bg, var(--xh-bg-surface));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.xh-scope-grid-list[data-part='root'][data-variant='subtle'] {
|
|
46
|
+
background: var(--xh-grid-list-bg, var(--xh-bg-subtle));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.xh-scope-grid-list[data-part='root'][data-invalid] {
|
|
50
|
+
border-color: var(--xh-grid-list-border-invalid, var(--xh-border-invalid));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.xh-scope-grid-list[data-part='root']:focus-visible {
|
|
54
|
+
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
55
|
+
outline-offset: var(--xh-ring-offset);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.xh-scope-grid-list[data-part='root'][data-size='sm'] {
|
|
59
|
+
--xh-_grid-list-indicator: var(--xh-control-indicator-sm);
|
|
60
|
+
--xh-_grid-list-state-font-size: var(--xh-control-font-sm);
|
|
61
|
+
--xh-_grid-list-state-px: var(--xh-control-px-sm);
|
|
62
|
+
--xh-icon-size: var(--xh-grid-list-icon-size, var(--xh-glyph-size-sm));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.xh-scope-grid-list[data-part='root'][data-size='lg'] {
|
|
66
|
+
--xh-_grid-list-indicator: var(--xh-control-indicator-lg);
|
|
67
|
+
--xh-_grid-list-state-font-size: var(--xh-control-font-lg);
|
|
68
|
+
--xh-_grid-list-state-px: var(--xh-control-px-lg);
|
|
69
|
+
--xh-icon-size: var(--xh-grid-list-icon-size, var(--xh-glyph-size-lg));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.xh-scope-grid-list[data-part='label'] {
|
|
73
|
+
padding-block: var(--xh-grid-list-label-py, var(--xh-space-1));
|
|
74
|
+
padding-inline: var(--xh-grid-list-label-px, var(--xh-control-px-md));
|
|
75
|
+
color: var(--xh-grid-list-label-fg, var(--xh-fg-default));
|
|
76
|
+
font-size: var(--xh-grid-list-label-font-size, var(--xh-text-label-size));
|
|
77
|
+
font-weight: var(--xh-grid-list-label-font-weight, var(--xh-font-weight-semibold));
|
|
78
|
+
line-height: var(--xh-leading-normal);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* 行走 Collection Item 的 page 语境(页内持久集合),与 Table、Transfer 同一种选中标记:品牌淡底行面 +
|
|
82
|
+
淡底前景(selected+hover 20% / +pressed 28%),外加行首勾选框;两者都由家族与勾选标记配方给,
|
|
83
|
+
这里只映射圆角与选中面的公开槽 */
|
|
84
|
+
.xh-scope-grid-list[data-part='row'] {
|
|
85
|
+
--xh-collection-radius: var(--xh-grid-list-row-radius, var(--xh-shape-control));
|
|
86
|
+
--xh-collection-bg-selected: var(--xh-grid-list-row-bg-selected, var(--xh-bg-brand-subtle));
|
|
87
|
+
--xh-collection-fg-selected: var(--xh-grid-list-row-fg-selected, var(--xh-fg-on-brand-subtle));
|
|
88
|
+
--xh-collection-fg-selected-hover: var(--xh-grid-list-row-fg-selected, var(--xh-fg-on-brand-subtle));
|
|
89
|
+
--xh-collection-fg-selected-highlight: var(--xh-grid-list-row-fg-selected, var(--xh-fg-on-brand-subtle));
|
|
90
|
+
--xh-collection-fg-selected-pressed: var(--xh-grid-list-row-fg-selected, var(--xh-fg-on-brand-subtle));
|
|
91
|
+
|
|
92
|
+
/* 家族只过渡换面的两支;重新取数时整列淡下同样走 micro,opacity 补进同一份列表 */
|
|
93
|
+
transition:
|
|
94
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
95
|
+
color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
96
|
+
opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Headless 会预先保留下一次 roving focus 的 highlighted 行(指针点过的行也记着);容器尚未真正获得
|
|
100
|
+
键盘焦点时,这只是内部导航位置,不能提前画成焦点态:面退回静息(选中行退回选中面),指针移入仍按
|
|
101
|
+
悬停那一档回应 */
|
|
102
|
+
.xh-scope-grid-list[data-part='row'][data-highlighted]:not(:focus-visible) {
|
|
103
|
+
--xh-collection-bg-keyboard-highlight: transparent;
|
|
104
|
+
--xh-collection-outline-keyboard-highlight: transparent;
|
|
105
|
+
--xh-collection-bg-selected-highlight: var(--xh-grid-list-row-bg-selected, var(--xh-bg-brand-subtle));
|
|
106
|
+
--xh-collection-outline-selected-highlight: transparent;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.xh-scope-grid-list[data-part='row'][data-highlighted]:not(:focus-visible):hover {
|
|
110
|
+
--xh-collection-bg-keyboard-highlight: var(--xh-bg-subtle);
|
|
111
|
+
--xh-collection-bg-selected-highlight: var(--xh-bg-brand-subtle-hover);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.xh-scope-grid-list[data-part='root'][data-readonly]
|
|
115
|
+
.xh-scope-grid-list[data-part='row'] {
|
|
116
|
+
cursor: default;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* 已有行时重新取数:不换成占位,行保留上一帧、按 micro 淡到禁用透明度,数据到了再淡回;
|
|
120
|
+
这一段不接指针——取数在途时选中与行内动作都不生效。aria-busy 与这一副可见回执同源 */
|
|
121
|
+
.xh-scope-grid-list[data-part='root'][data-loading]
|
|
122
|
+
.xh-scope-grid-list[data-part='row'] {
|
|
123
|
+
opacity: var(--xh-grid-list-row-loading-opacity, var(--xh-state-disabled-opacity));
|
|
124
|
+
pointer-events: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* content 保持真实 gridcell 盒;里面两行自己排,不依赖 Collection Item 的直接子项网格。 */
|
|
128
|
+
.xh-scope-grid-list[data-part='row-content'] {
|
|
129
|
+
display: flex;
|
|
130
|
+
grid-row: 1 / span 2;
|
|
131
|
+
grid-column: text;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
gap: var(--xh-grid-list-row-content-gap, var(--xh-space-1));
|
|
134
|
+
min-inline-size: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.xh-scope-grid-list[data-part='row-text'],
|
|
138
|
+
.xh-scope-grid-list[data-part='row-description'] {
|
|
139
|
+
grid-row: auto;
|
|
140
|
+
grid-column: auto;
|
|
141
|
+
min-inline-size: 0;
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
text-overflow: ellipsis;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.xh-scope-grid-list[data-part='row-text'] {
|
|
147
|
+
color: inherit;
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.xh-scope-grid-list[data-part='row-description'] {
|
|
152
|
+
color: var(--xh-grid-list-row-description-fg, var(--xh-fg-muted));
|
|
153
|
+
font-size: var(--xh-grid-list-row-description-font-size, var(--xh-control-caption-md));
|
|
154
|
+
white-space: nowrap;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.xh-scope-grid-list[data-part='row-actions'] {
|
|
158
|
+
display: flex;
|
|
159
|
+
grid-row: 1 / span 2;
|
|
160
|
+
grid-column: suffix / span 2;
|
|
161
|
+
gap: var(--xh-grid-list-row-actions-gap, var(--xh-space-1));
|
|
162
|
+
align-items: center;
|
|
163
|
+
margin-inline-start: var(--xh-grid-list-row-actions-ms, var(--xh-control-gap-md));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.xh-scope-grid-list[data-part='row-action'] {
|
|
167
|
+
--xh-action-font-size: var(--xh-grid-list-row-action-font-size, var(--xh-control-font-sm));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* 行首方框:静息透明底 + 控件盒描边,勾上换语气实心面。框里的勾由勾选标记配方画(常驻、按状态淡变并轻缩放),
|
|
171
|
+
尺寸读这里改接的 --xh-icon-size:方框边长 × 0.75,与 Checkbox 同一比例 */
|
|
172
|
+
.xh-scope-grid-list[data-part='row-selection-indicator'] {
|
|
173
|
+
--xh-icon-size: var(--xh-grid-list-row-indicator-glyph-size, var(--xh-_grid-list-indicator-glyph));
|
|
174
|
+
|
|
175
|
+
display: grid;
|
|
176
|
+
grid-row: 1 / span 2;
|
|
177
|
+
grid-column: prefix;
|
|
178
|
+
place-items: center;
|
|
179
|
+
inline-size: var(--xh-grid-list-row-indicator-size, var(--xh-_grid-list-indicator));
|
|
180
|
+
block-size: var(--xh-grid-list-row-indicator-size, var(--xh-_grid-list-indicator));
|
|
181
|
+
margin-inline-end: var(--xh-grid-list-row-indicator-me, var(--xh-control-gap-md));
|
|
182
|
+
border: var(--xh-stroke-thin) solid var(--xh-grid-list-row-indicator-border, var(--xh-border-control));
|
|
183
|
+
border-radius: var(--xh-grid-list-row-indicator-radius, var(--xh-shape-inset));
|
|
184
|
+
background: var(--xh-grid-list-row-indicator-bg, transparent);
|
|
185
|
+
color: var(--xh-grid-list-row-indicator-fg-selected, var(--xh-_grid-list-indicator-on-accent));
|
|
186
|
+
transition:
|
|
187
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
188
|
+
border-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.xh-scope-grid-list[data-part='row-selection-indicator'][data-state='checked'] {
|
|
192
|
+
border-color: var(--xh-grid-list-row-indicator-border-selected, var(--xh-_grid-list-indicator-accent));
|
|
193
|
+
background: var(--xh-grid-list-row-indicator-bg-selected, var(--xh-_grid-list-indicator-accent));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* 空态与加载态占同一个位置、同一副排版:一行文案居中,字号与行内内衬随尺寸档与条目同档,次要文字色,
|
|
197
|
+
块向内距一档,不设最小高 */
|
|
198
|
+
.xh-scope-grid-list[data-part='empty'],
|
|
199
|
+
.xh-scope-grid-list[data-part='loading'] {
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
justify-content: center;
|
|
203
|
+
gap: var(--xh-grid-list-state-gap, var(--xh-control-gap-md));
|
|
204
|
+
padding-block: var(--xh-grid-list-state-py, var(--xh-space-3));
|
|
205
|
+
padding-inline: var(--xh-grid-list-state-px, var(--xh-_grid-list-state-px));
|
|
206
|
+
color: var(--xh-grid-list-state-fg, var(--xh-fg-muted));
|
|
207
|
+
font-size: var(--xh-grid-list-state-font-size, var(--xh-_grid-list-state-font-size));
|
|
208
|
+
line-height: var(--xh-leading-normal);
|
|
209
|
+
text-align: center;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* 还没有行、正在取:一枚加载环排在文案之前。环由加载环配方画成(轨道 + 起始边、随 data-loading 淡入并转),
|
|
213
|
+
这里只给它盒子:直径取尺寸档的图标档 */
|
|
214
|
+
.xh-scope-grid-list[data-part='loading']::before {
|
|
215
|
+
content: '';
|
|
216
|
+
flex: none;
|
|
217
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
218
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.xh-scope-grid-list[data-part='row-selection-indicator'][hidden],
|
|
222
|
+
.xh-scope-grid-list[data-part='row-content'][hidden],
|
|
223
|
+
.xh-scope-grid-list[data-part='row-actions'][hidden],
|
|
224
|
+
.xh-scope-grid-list[data-part='empty'][hidden],
|
|
225
|
+
.xh-scope-grid-list[data-part='loading'][hidden],
|
|
226
|
+
.xh-scope-grid-list[data-part='root'][hidden] {
|
|
227
|
+
display: none;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@media print {
|
|
231
|
+
.xh-scope-grid-list[data-part='row-actions'] {
|
|
232
|
+
display: none;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|