@xihan-ui/styles 1.0.0-alpha.2 → 1.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 +2177 -0
- package/README.md +1 -1
- package/css/accordion.css +80 -6
- package/css/alert.css +43 -14
- package/css/anchor.css +8 -8
- package/css/avatar-group.css +7 -3
- package/css/avatar.css +9 -3
- package/css/back-top.css +22 -1
- package/css/badge.css +104 -32
- package/css/breadcrumb.css +25 -5
- package/css/button-group.css +18 -13
- package/css/button.css +48 -11
- package/css/calendar.css +150 -7
- package/css/card.css +20 -11
- package/css/carousel.css +36 -5
- package/css/cascader.css +211 -124
- package/css/checkbox-group.css +72 -22
- package/css/checkbox.css +70 -13
- package/css/clipboard.css +2 -1
- package/css/code-block.css +12 -7
- package/css/collapsible.css +49 -3
- package/css/color-picker.css +132 -46
- package/css/combobox.css +132 -60
- package/css/composer.css +5 -3
- package/css/context-menu.css +113 -74
- package/css/date-field.css +93 -16
- package/css/date-picker.css +293 -72
- package/css/descriptions.css +11 -5
- package/css/dialog.css +47 -14
- package/css/download-trigger.css +76 -0
- package/css/drawer.css +57 -16
- package/css/dynamic-input.css +75 -17
- package/css/editable.css +12 -10
- package/css/ellipsis.css +7 -1
- package/css/empty-state.css +22 -12
- package/css/field.css +16 -6
- package/css/fieldset.css +69 -0
- package/css/file-upload.css +46 -8
- package/css/flex.css +13 -7
- package/css/float-button.css +23 -1
- package/css/floating-panel.css +316 -0
- package/css/form.css +4 -4
- package/css/grid.css +11 -5
- package/css/heatmap.css +411 -0
- package/css/highlight.css +2 -2
- package/css/hotkeys.css +90 -0
- package/css/hover-card.css +43 -45
- package/css/image-cropper.css +233 -0
- package/css/image-viewer.css +155 -17
- package/css/image.css +2 -2
- package/css/infinite-scroll.css +1 -1
- package/css/json-viewer.css +274 -0
- package/css/layout.css +19 -15
- package/css/list.css +22 -13
- package/css/listbox.css +24 -6
- package/css/loading-bar.css +12 -5
- package/css/log.css +7 -3
- package/css/marquee.css +9 -0
- package/css/masonry.css +63 -0
- package/css/mention.css +100 -36
- package/css/menu.css +127 -50
- package/css/menubar.css +155 -61
- package/css/navigation-menu.css +56 -31
- package/css/notification.css +377 -0
- package/css/number-animation.css +3 -3
- package/css/number-field.css +182 -19
- package/css/overlay-arrow.css +51 -0
- package/css/page-header.css +12 -5
- package/css/pagination.css +171 -14
- package/css/password-input.css +356 -0
- package/css/pin-input.css +15 -12
- package/css/popconfirm.css +55 -12
- package/css/popover.css +73 -45
- package/css/popselect.css +207 -57
- package/css/progress.css +54 -8
- package/css/qr-code.css +1 -1
- package/css/radio-group.css +27 -10
- package/css/rating.css +4 -4
- package/css/reset.css +17 -0
- package/css/result.css +21 -11
- package/css/scroll-area.css +61 -89
- package/css/scrollbar.css +170 -0
- package/css/segmented.css +215 -0
- package/css/select.css +298 -131
- package/css/separator.css +2 -2
- package/css/side-nav.css +127 -24
- package/css/signature-pad.css +144 -0
- package/css/skeleton.css +7 -1
- package/css/slider.css +14 -12
- package/css/space.css +117 -0
- package/css/spinner.css +22 -10
- package/css/statistic.css +9 -9
- package/css/steps.css +29 -12
- package/css/switch.css +57 -8
- package/css/table.css +146 -44
- package/css/tabs.css +13 -5
- package/css/tag.css +179 -0
- package/css/tags-input.css +80 -42
- package/css/text-field.css +151 -38
- package/css/thread.css +11 -3
- package/css/time-field.css +99 -18
- package/css/time-picker.css +261 -71
- package/css/timeline.css +15 -15
- package/css/timer.css +119 -0
- package/css/toast.css +129 -55
- package/css/toggle-group.css +30 -4
- package/css/toggle.css +12 -6
- package/css/tone.css +57 -22
- package/css/toolbar.css +1 -1
- package/css/tooltip.css +40 -31
- package/css/tour.css +112 -61
- package/css/transfer.css +98 -21
- package/css/tree-select.css +215 -89
- package/css/tree.css +131 -5
- package/css/typography.css +5 -5
- package/css/undefined.css +12 -1
- package/css/virtualizer.css +3 -1
- package/css/watermark.css +1 -2
- package/index.css +18 -1
- package/index.unlayered.css +10356 -3255
- package/package.json +20 -4
- package/css/toaster.css +0 -74
package/css/dialog.css
CHANGED
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
[data-scope='dialog'][data-part='backdrop'] {
|
|
62
62
|
position: fixed;
|
|
63
63
|
inset: 0;
|
|
64
|
-
z-index: var(--xh-layer-modal);
|
|
64
|
+
z-index: var(--xh-dialog-backdrop-layer, var(--xh-layer-modal));
|
|
65
65
|
background: var(--xh-dialog-backdrop-bg, var(--xh-bg-overlay));
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -77,11 +77,11 @@
|
|
|
77
77
|
[data-scope='dialog'][data-part='positioner'] {
|
|
78
78
|
position: fixed;
|
|
79
79
|
inset: 0;
|
|
80
|
-
z-index: var(--xh-layer-modal);
|
|
80
|
+
z-index: var(--xh-dialog-layer, var(--xh-layer-modal));
|
|
81
81
|
display: flex;
|
|
82
82
|
align-items: center;
|
|
83
83
|
justify-content: center;
|
|
84
|
-
padding: var(--xh-space-4);
|
|
84
|
+
padding: var(--xh-dialog-positioner-padding, var(--xh-space-4));
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
[data-scope='dialog'][data-part='positioner'][data-position='top'] {
|
|
@@ -89,10 +89,13 @@
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
[data-scope='dialog'][data-part='content'] {
|
|
92
|
+
/* 作者塞进指示符槽的图标跟着字号走,与皮肤画的兜底字形同一把尺 */
|
|
93
|
+
--xh-icon-size: var(--xh-dialog-icon-size, var(--xh-glyph-size-text));
|
|
94
|
+
|
|
92
95
|
/* 尺寸档只换这一个私有槽。它声明在 content 而不是别处:dialog 的解剖里没有 root,
|
|
93
96
|
positioner 又不是必需部件,content 才是这层浮层恒在的最外层,且它会被 portal 到 body,
|
|
94
97
|
选择器只认得它自己身上那一份 data-size。 */
|
|
95
|
-
--xh-_dialog-max-w:
|
|
98
|
+
--xh-_dialog-max-w: var(--xh-overlay-sheet-w-md);
|
|
96
99
|
|
|
97
100
|
position: relative;
|
|
98
101
|
inline-size: 100%;
|
|
@@ -100,12 +103,12 @@
|
|
|
100
103
|
display: flex;
|
|
101
104
|
flex-direction: column;
|
|
102
105
|
gap: var(--xh-dialog-gap, var(--xh-stack-gap-md));
|
|
103
|
-
padding-block: var(--xh-dialog-py, var(--xh-
|
|
104
|
-
padding-inline: var(--xh-dialog-px, var(--xh-
|
|
106
|
+
padding-block: var(--xh-dialog-py, var(--xh-surface-py-md));
|
|
107
|
+
padding-inline: var(--xh-dialog-px, var(--xh-surface-px-md));
|
|
105
108
|
border-radius: var(--xh-dialog-radius, var(--xh-shape-surface));
|
|
106
109
|
background: var(--xh-dialog-bg, var(--xh-bg-surface));
|
|
107
110
|
color: var(--xh-dialog-fg, var(--xh-fg-default));
|
|
108
|
-
box-shadow: var(--xh-dialog-shadow, var(--xh-elevation-
|
|
111
|
+
box-shadow: var(--xh-dialog-shadow, var(--xh-elevation-sheet));
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
/* 这里刻意没有 [data-part='content'][hidden] { display: none },与 drawer 一致:
|
|
@@ -120,11 +123,11 @@
|
|
|
120
123
|
/* 只有最大宽度分档;中间档不写规则,缺省即中档。
|
|
121
124
|
宽度上限之外的一切(内边距、字号、圆角)都不随档位动:弹层的语气归里面的内容表达。 */
|
|
122
125
|
[data-scope='dialog'][data-part='content'][data-size='sm'] {
|
|
123
|
-
--xh-_dialog-max-w:
|
|
126
|
+
--xh-_dialog-max-w: var(--xh-overlay-sheet-w-sm);
|
|
124
127
|
}
|
|
125
128
|
|
|
126
129
|
[data-scope='dialog'][data-part='content'][data-size='lg'] {
|
|
127
|
-
--xh-_dialog-max-w:
|
|
130
|
+
--xh-_dialog-max-w: var(--xh-overlay-sheet-w-lg);
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
[data-scope='dialog'][data-part='content']:focus-visible {
|
|
@@ -156,7 +159,7 @@
|
|
|
156
159
|
否则长标题会直接钻到按钮底下。只在真有关闭按钮时让位。 */
|
|
157
160
|
[data-scope='dialog'][data-part='content']:has([data-scope='dialog'][data-part='close-trigger'])
|
|
158
161
|
[data-scope='dialog'][data-part='title'] {
|
|
159
|
-
padding-inline-end: calc(var(--xh-control-h-sm) + var(--xh-space-3));
|
|
162
|
+
padding-inline-end: calc(var(--xh-dialog-close-size, var(--xh-control-h-sm)) + var(--xh-space-3));
|
|
160
163
|
}
|
|
161
164
|
|
|
162
165
|
[data-scope='dialog'][data-part='close-trigger'] {
|
|
@@ -166,22 +169,52 @@
|
|
|
166
169
|
display: inline-flex;
|
|
167
170
|
align-items: center;
|
|
168
171
|
justify-content: center;
|
|
169
|
-
block-size: var(--xh-control-h-sm);
|
|
170
|
-
inline-size: var(--xh-control-h-sm);
|
|
172
|
+
block-size: var(--xh-dialog-close-size, var(--xh-control-h-sm));
|
|
173
|
+
inline-size: var(--xh-dialog-close-size, var(--xh-control-h-sm));
|
|
171
174
|
border: 0;
|
|
172
|
-
border-radius: var(--xh-shape-control);
|
|
175
|
+
border-radius: var(--xh-dialog-close-radius, var(--xh-shape-control));
|
|
173
176
|
background: transparent;
|
|
174
177
|
color: var(--xh-fg-muted);
|
|
175
178
|
cursor: pointer;
|
|
179
|
+
transition:
|
|
180
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
181
|
+
scale var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
[data-scope='dialog'][data-part='close-trigger'][hidden] {
|
|
185
|
+
display: none;
|
|
176
186
|
}
|
|
177
187
|
|
|
178
188
|
[data-scope='dialog'][data-part='close-trigger']:hover {
|
|
179
|
-
background: var(--xh-bg-subtle);
|
|
189
|
+
background: var(--xh-dialog-close-bg-hover, var(--xh-bg-subtle-hover));
|
|
180
190
|
color: var(--xh-fg-default);
|
|
181
191
|
}
|
|
182
192
|
|
|
193
|
+
[data-scope='dialog'][data-part='close-trigger']:active {
|
|
194
|
+
background: var(--xh-dialog-close-bg-active, var(--xh-bg-subtle-active));
|
|
195
|
+
scale: var(--xh-motion-scale-press);
|
|
196
|
+
}
|
|
197
|
+
|
|
183
198
|
[data-scope='dialog'][data-part='close-trigger']:focus-visible {
|
|
184
199
|
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
185
200
|
outline-offset: var(--xh-ring-offset);
|
|
186
201
|
}
|
|
202
|
+
|
|
203
|
+
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
|
|
204
|
+
[data-scope='dialog'][data-part='close-trigger']:empty::before {
|
|
205
|
+
content: '';
|
|
206
|
+
display: inline-block;
|
|
207
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
208
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
209
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
210
|
+
background-color: currentColor;
|
|
211
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
212
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
|
|
216
|
+
写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
|
|
217
|
+
[data-scope='dialog'][data-part='positioner'][hidden] {
|
|
218
|
+
display: none;
|
|
219
|
+
}
|
|
187
220
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@layer xihan.components {
|
|
2
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
3
|
+
[data-scope='download-trigger'] {
|
|
4
|
+
--xh-download-trigger-skin: 1;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* 触发器就是这一个原生按钮,两个适配器都由组件自己渲染它,
|
|
9
|
+
* 所以外观得由设计系统给出一份完整的中性按钮:底色、描边、高度、字号都上令牌,
|
|
10
|
+
* 要换成品牌样式的作者改 --xh-download-trigger-* 这一族槽位,或直接写自己的类名。
|
|
11
|
+
*/
|
|
12
|
+
[data-scope='download-trigger'][data-part='root'] {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
gap: var(--xh-download-trigger-gap, var(--xh-control-gap-md));
|
|
17
|
+
block-size: var(--xh-download-trigger-h, var(--xh-control-h-md));
|
|
18
|
+
padding-inline: var(--xh-download-trigger-px, var(--xh-control-px-md));
|
|
19
|
+
padding-block: 0;
|
|
20
|
+
border: var(--xh-stroke-thin) solid var(--xh-download-trigger-border, var(--xh-border-control));
|
|
21
|
+
border-radius: var(--xh-download-trigger-radius, var(--xh-shape-control));
|
|
22
|
+
background: var(--xh-download-trigger-bg, var(--xh-bg-canvas));
|
|
23
|
+
color: var(--xh-download-trigger-fg, var(--xh-fg-default));
|
|
24
|
+
/* 表单控件不继承页面字体,只给字号会让按钮用 UA 默认字族 */
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: var(--xh-download-trigger-font-size, var(--xh-text-label-size));
|
|
27
|
+
font-weight: var(--xh-download-trigger-font-weight, var(--xh-text-label-weight));
|
|
28
|
+
line-height: var(--xh-leading-none);
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
/* 导出键常被连点,触屏上默认会当成双击缩放 */
|
|
32
|
+
user-select: none;
|
|
33
|
+
touch-action: manipulation;
|
|
34
|
+
transition:
|
|
35
|
+
background var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
36
|
+
border-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* 上面声明了 display,会盖掉 UA 的 [hidden] 规则,收起态要在这里接回来 */
|
|
40
|
+
[data-scope='download-trigger'][data-part='root'][hidden] {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[data-scope='download-trigger'][data-part='root']:hover {
|
|
45
|
+
border-color: var(--xh-download-trigger-border-hover, var(--xh-border-control-hover));
|
|
46
|
+
background: var(--xh-download-trigger-bg-hover, var(--xh-bg-subtle-hover));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[data-scope='download-trigger'][data-part='root']:active {
|
|
50
|
+
background: var(--xh-download-trigger-bg-active, var(--xh-bg-subtle-active));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[data-scope='download-trigger'][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
|
+
/* 取数在途:按钮留在原地不动,只换指针形状——位置一变,正要再点的人就点空了 */
|
|
59
|
+
[data-scope='download-trigger'][data-part='root'][data-state='preparing'] {
|
|
60
|
+
cursor: progress;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/*
|
|
64
|
+
* 单体原生控件的禁用走 :disabled。前景与底色一起换,禁用前后两侧都由令牌管着;
|
|
65
|
+
* 用了 fg-disabled 就不再叠 opacity——两样一起用会压到读不出来。
|
|
66
|
+
* 这条排在悬停与按下之后,特异度相同、后写的赢。
|
|
67
|
+
* 描边仍按可操作区那一档:这是一颗独立按钮,四周没有别的结构标出它的位置,
|
|
68
|
+
* 描边一压下去整颗按钮在页面上就没影了。
|
|
69
|
+
*/
|
|
70
|
+
[data-scope='download-trigger'][data-part='root']:disabled {
|
|
71
|
+
border-color: var(--xh-download-trigger-border-disabled, var(--xh-border-control));
|
|
72
|
+
background: var(--xh-download-trigger-bg-disabled, var(--xh-bg-muted));
|
|
73
|
+
color: var(--xh-fg-disabled);
|
|
74
|
+
cursor: not-allowed;
|
|
75
|
+
}
|
|
76
|
+
}
|
package/css/drawer.css
CHANGED
|
@@ -118,9 +118,18 @@
|
|
|
118
118
|
/* root 留在页面原地,只是 data-side / data-state 的落点,不该凭空多出一层盒子把
|
|
119
119
|
trigger 从作者的 flex / grid 行里挤出去,故 display: contents。 */
|
|
120
120
|
[data-scope='drawer'][data-part='root'] {
|
|
121
|
+
/* 作者塞进指示符槽的图标跟着字号走,与皮肤画的兜底字形同一把尺 */
|
|
122
|
+
--xh-icon-size: var(--xh-drawer-icon-size, var(--xh-glyph-size-text));
|
|
123
|
+
|
|
121
124
|
display: contents;
|
|
122
125
|
}
|
|
123
126
|
|
|
127
|
+
/* 浮层被搬到 portal 落点,继承不到 root 上的槽:这把尺在被搬走的那一侧再声明一次,
|
|
128
|
+
关闭钮与条目里作者塞的图标才和皮肤画的兜底字形一样大 */
|
|
129
|
+
[data-scope='drawer'][data-part='content'] {
|
|
130
|
+
--xh-icon-size: var(--xh-drawer-icon-size, var(--xh-glyph-size-text));
|
|
131
|
+
}
|
|
132
|
+
|
|
124
133
|
/* 声明了 display 就盖掉了 UA 的 [hidden]{display:none},作者手写 hidden 时得还回去 */
|
|
125
134
|
[data-scope='drawer'][data-part='root'][hidden] {
|
|
126
135
|
display: none;
|
|
@@ -177,10 +186,21 @@
|
|
|
177
186
|
[data-scope='drawer'][data-part='backdrop'] {
|
|
178
187
|
position: fixed;
|
|
179
188
|
inset: 0;
|
|
180
|
-
z-index: var(--xh-layer-drawer);
|
|
189
|
+
z-index: var(--xh-drawer-backdrop-layer, var(--xh-layer-drawer));
|
|
181
190
|
background: var(--xh-drawer-backdrop-bg, var(--xh-bg-overlay));
|
|
182
191
|
}
|
|
183
192
|
|
|
193
|
+
/* 挂在局部容器里:遮罩、定位层与面板一起从视口坐标换成容器坐标,只罩住那个容器。
|
|
194
|
+
作者要给那个容器加 position(relative 之类),否则 absolute 会往上找到别的定位祖先——
|
|
195
|
+
这一条写进了示例与 props 说明。
|
|
196
|
+
content 必须一起换:它的贴边是 inset-block/inline 参照包含块算的,留在 fixed 上就会
|
|
197
|
+
照旧贴视口边,遮罩缩进容器、面板却跑到屏幕边上——与 contained 的承诺正好相反 */
|
|
198
|
+
[data-scope='drawer'][data-part='backdrop'][data-contained],
|
|
199
|
+
[data-scope='drawer'][data-part='positioner'][data-contained],
|
|
200
|
+
[data-scope='drawer'][data-part='content'][data-contained] {
|
|
201
|
+
position: absolute;
|
|
202
|
+
}
|
|
203
|
+
|
|
184
204
|
[data-scope='drawer'][data-part='backdrop'][data-state='open'] {
|
|
185
205
|
animation: xh-fade-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter);
|
|
186
206
|
}
|
|
@@ -196,15 +216,16 @@
|
|
|
196
216
|
[data-scope='drawer'][data-part='positioner'] {
|
|
197
217
|
position: fixed;
|
|
198
218
|
inset: 0;
|
|
199
|
-
z-index: var(--xh-layer-drawer);
|
|
219
|
+
z-index: var(--xh-drawer-layer, var(--xh-layer-drawer));
|
|
200
220
|
pointer-events: none;
|
|
201
221
|
}
|
|
202
222
|
|
|
203
223
|
/* 贴边写在 content 自己身上,而不是交给 positioner:
|
|
204
224
|
positioner 在抽屉里不是必需部件,最小合规结构只有 root + content,
|
|
205
225
|
贴边若挂在 positioner 上,那种结构下面板会直接塌回文档流。
|
|
206
|
-
content 是 fixed,包住它的 positioner 没有 transform / filter,
|
|
207
|
-
|
|
226
|
+
非 contained 时 content 是 fixed,包住它的 positioner 没有 transform / filter,
|
|
227
|
+
不构成固定定位的包含块,两种结构下参照的都是视口,位置一致;
|
|
228
|
+
contained 时上面那条把它一并换成 absolute,参照的就是作者那个容器。 */
|
|
208
229
|
[data-scope='drawer'][data-part='content'] {
|
|
209
230
|
/* 位移方向的私有槽位:默认按 LTR,RTL 在下面整体翻符号 */
|
|
210
231
|
--xh-_drawer-shift-inline: 100%;
|
|
@@ -212,18 +233,18 @@
|
|
|
212
233
|
/* 尺寸档只换这一个私有槽:左右放置时它是面板宽度、上下放置时是面板高度,
|
|
213
234
|
两种取法都在下面「四条边」那两条规则里。声明在 content 而不是 root:
|
|
214
235
|
content 会被 portal 到 body,root 上的槽位继承不过来(data-side 也是同一个道理) */
|
|
215
|
-
--xh-_drawer-size:
|
|
236
|
+
--xh-_drawer-size: var(--xh-overlay-drawer-w-md);
|
|
216
237
|
|
|
217
238
|
position: fixed;
|
|
218
|
-
z-index: var(--xh-layer-drawer);
|
|
239
|
+
z-index: var(--xh-drawer-layer, var(--xh-layer-drawer));
|
|
219
240
|
display: flex;
|
|
220
241
|
flex-direction: column;
|
|
221
242
|
gap: var(--xh-drawer-gap, var(--xh-stack-gap-md));
|
|
222
|
-
padding-block: var(--xh-drawer-py, var(--xh-
|
|
223
|
-
padding-inline: var(--xh-drawer-px, var(--xh-
|
|
243
|
+
padding-block: var(--xh-drawer-py, var(--xh-surface-py-md));
|
|
244
|
+
padding-inline: var(--xh-drawer-px, var(--xh-surface-px-md));
|
|
224
245
|
background: var(--xh-drawer-bg, var(--xh-bg-surface));
|
|
225
246
|
color: var(--xh-drawer-fg, var(--xh-fg-default));
|
|
226
|
-
box-shadow: var(--xh-drawer-shadow, var(--xh-elevation-
|
|
247
|
+
box-shadow: var(--xh-drawer-shadow, var(--xh-elevation-sheet));
|
|
227
248
|
overflow: auto;
|
|
228
249
|
/* 尺寸是照视口那条边算出来的,padding 再往外顶就会把面板挤出屏幕、
|
|
229
250
|
逼出一条横向滚动条。reset 层已有同款兜底,这里显式写一遍表明尺寸算法依赖它 */
|
|
@@ -254,11 +275,11 @@
|
|
|
254
275
|
/* 只有面板厚度分档;中间档不写规则,缺省即中档。
|
|
255
276
|
data-size 与 data-side 一样同时打在 root 与 content 上,这里只认 content 自己那一份。 */
|
|
256
277
|
[data-scope='drawer'][data-part='content'][data-size='sm'] {
|
|
257
|
-
--xh-_drawer-size:
|
|
278
|
+
--xh-_drawer-size: var(--xh-overlay-drawer-w-sm);
|
|
258
279
|
}
|
|
259
280
|
|
|
260
281
|
[data-scope='drawer'][data-part='content'][data-size='lg'] {
|
|
261
|
-
--xh-_drawer-size:
|
|
282
|
+
--xh-_drawer-size: var(--xh-overlay-drawer-w-lg);
|
|
262
283
|
}
|
|
263
284
|
|
|
264
285
|
/* —— 四条边 ——
|
|
@@ -358,7 +379,7 @@
|
|
|
358
379
|
否则长标题会直接钻到按钮底下。只在真有关闭按钮时让位。 */
|
|
359
380
|
[data-scope='drawer'][data-part='content']:has([data-scope='drawer'][data-part='close-trigger'])
|
|
360
381
|
[data-scope='drawer'][data-part='title'] {
|
|
361
|
-
padding-inline-end: calc(var(--xh-control-h-sm) + var(--xh-space-3));
|
|
382
|
+
padding-inline-end: calc(var(--xh-drawer-close-size, var(--xh-control-h-sm)) + var(--xh-space-3));
|
|
362
383
|
}
|
|
363
384
|
|
|
364
385
|
[data-scope='drawer'][data-part='close-trigger'] {
|
|
@@ -368,13 +389,16 @@
|
|
|
368
389
|
display: inline-flex;
|
|
369
390
|
align-items: center;
|
|
370
391
|
justify-content: center;
|
|
371
|
-
block-size: var(--xh-control-h-sm);
|
|
372
|
-
inline-size: var(--xh-control-h-sm);
|
|
392
|
+
block-size: var(--xh-drawer-close-size, var(--xh-control-h-sm));
|
|
393
|
+
inline-size: var(--xh-drawer-close-size, var(--xh-control-h-sm));
|
|
373
394
|
border: 0;
|
|
374
|
-
border-radius: var(--xh-shape-control);
|
|
395
|
+
border-radius: var(--xh-drawer-close-radius, var(--xh-shape-control));
|
|
375
396
|
background: transparent;
|
|
376
397
|
color: var(--xh-fg-muted);
|
|
377
398
|
cursor: pointer;
|
|
399
|
+
transition:
|
|
400
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
401
|
+
scale var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
378
402
|
}
|
|
379
403
|
|
|
380
404
|
[data-scope='drawer'][data-part='close-trigger'][hidden] {
|
|
@@ -382,12 +406,29 @@
|
|
|
382
406
|
}
|
|
383
407
|
|
|
384
408
|
[data-scope='drawer'][data-part='close-trigger']:hover {
|
|
385
|
-
background: var(--xh-bg-subtle);
|
|
409
|
+
background: var(--xh-drawer-close-bg-hover, var(--xh-bg-subtle-hover));
|
|
386
410
|
color: var(--xh-fg-default);
|
|
387
411
|
}
|
|
388
412
|
|
|
413
|
+
[data-scope='drawer'][data-part='close-trigger']:active {
|
|
414
|
+
background: var(--xh-drawer-close-bg-active, var(--xh-bg-subtle-active));
|
|
415
|
+
scale: var(--xh-motion-scale-press);
|
|
416
|
+
}
|
|
417
|
+
|
|
389
418
|
[data-scope='drawer'][data-part='close-trigger']:focus-visible {
|
|
390
419
|
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
391
420
|
outline-offset: var(--xh-ring-offset);
|
|
392
421
|
}
|
|
422
|
+
|
|
423
|
+
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
|
|
424
|
+
[data-scope='drawer'][data-part='close-trigger']:empty::before {
|
|
425
|
+
content: '';
|
|
426
|
+
display: inline-block;
|
|
427
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
428
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
429
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
430
|
+
background-color: currentColor;
|
|
431
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
432
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
433
|
+
}
|
|
393
434
|
}
|
package/css/dynamic-input.css
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
/* 一行一条,纵向堆叠;新增把手跟在最后一行下面 */
|
|
8
8
|
[data-scope='dynamic-input'][data-part='root'] {
|
|
9
|
+
/* 作者塞进指示符槽的图标跟着字号走,与皮肤画的兜底字形同一把尺 */
|
|
10
|
+
--xh-icon-size: var(--xh-dynamic-input-icon-size, var(--xh-glyph-size-text));
|
|
11
|
+
|
|
9
12
|
display: flex;
|
|
10
13
|
flex-direction: column;
|
|
11
14
|
gap: var(--xh-dynamic-input-gap, var(--xh-space-2));
|
|
@@ -47,55 +50,69 @@
|
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
/* —— 行内三个把手 —— */
|
|
50
|
-
[data-scope='dynamic-input'][data-part='
|
|
53
|
+
[data-scope='dynamic-input'][data-part='item-delete-trigger'],
|
|
51
54
|
[data-scope='dynamic-input'][data-part='move-up-trigger'],
|
|
52
55
|
[data-scope='dynamic-input'][data-part='move-down-trigger'] {
|
|
53
56
|
display: inline-flex;
|
|
54
57
|
flex: none;
|
|
55
58
|
align-items: center;
|
|
56
59
|
justify-content: center;
|
|
57
|
-
inline-size: var(--xh-dynamic-input-trigger-size, var(--xh-control-action-size));
|
|
58
|
-
block-size: var(--xh-dynamic-input-trigger-size, var(--xh-control-action-size));
|
|
59
60
|
padding: 0;
|
|
60
61
|
border: 0;
|
|
61
|
-
border-radius: var(--xh-dynamic-input-trigger-radius, var(--xh-shape-control));
|
|
62
62
|
background: var(--xh-dynamic-input-trigger-bg, transparent);
|
|
63
63
|
color: var(--xh-dynamic-input-trigger-fg, var(--xh-fg-muted));
|
|
64
64
|
font-family: inherit;
|
|
65
|
-
font-size: var(--xh-dynamic-input-trigger-font-size, var(--xh-
|
|
65
|
+
font-size: var(--xh-dynamic-input-trigger-font-size, var(--xh-text-secondary-size));
|
|
66
66
|
line-height: var(--xh-leading-none);
|
|
67
67
|
cursor: pointer;
|
|
68
|
-
transition:
|
|
68
|
+
transition:
|
|
69
|
+
background var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
70
|
+
scale var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* 行级删除把手:命中区取行内动作按钮尺寸,圆角取控件圆角 */
|
|
74
|
+
[data-scope='dynamic-input'][data-part='item-delete-trigger'] {
|
|
75
|
+
inline-size: var(--xh-dynamic-input-trigger-size, var(--xh-control-action-size));
|
|
76
|
+
block-size: var(--xh-dynamic-input-trigger-size, var(--xh-control-action-size));
|
|
77
|
+
border-radius: var(--xh-dynamic-input-trigger-radius, var(--xh-shape-control));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
[data-scope='dynamic-input'][data-part='move-up-trigger'],
|
|
81
|
+
[data-scope='dynamic-input'][data-part='move-down-trigger'] {
|
|
82
|
+
inline-size: var(--xh-dynamic-input-trigger-size, var(--xh-control-action-size));
|
|
83
|
+
block-size: var(--xh-dynamic-input-trigger-size, var(--xh-control-action-size));
|
|
84
|
+
border-radius: var(--xh-dynamic-input-trigger-radius, var(--xh-shape-control));
|
|
69
85
|
}
|
|
70
86
|
|
|
71
87
|
/* 不换序时连接层给换序把手写 hidden;上面那条 display 会把 UA 的 [hidden]{display:none}
|
|
72
88
|
盖掉,少了这条把手还留在原地。删除把手同样声明了 display,作者自己收起它时要的是同一条 */
|
|
73
|
-
[data-scope='dynamic-input'][data-part='
|
|
89
|
+
[data-scope='dynamic-input'][data-part='item-delete-trigger'][hidden],
|
|
74
90
|
[data-scope='dynamic-input'][data-part='move-up-trigger'][hidden],
|
|
75
91
|
[data-scope='dynamic-input'][data-part='move-down-trigger'][hidden] {
|
|
76
92
|
display: none;
|
|
77
93
|
}
|
|
78
94
|
|
|
79
95
|
/* 按不动的把手不给悬停与按下反馈:它仍然可聚焦、可点,反馈会让人以为点得动 */
|
|
80
|
-
[data-scope='dynamic-input'][data-part='
|
|
96
|
+
[data-scope='dynamic-input'][data-part='item-delete-trigger']:hover:not([aria-disabled='true']),
|
|
81
97
|
[data-scope='dynamic-input'][data-part='move-up-trigger']:hover:not([aria-disabled='true']),
|
|
82
98
|
[data-scope='dynamic-input'][data-part='move-down-trigger']:hover:not([aria-disabled='true']) {
|
|
83
99
|
background: var(--xh-dynamic-input-trigger-bg-hover, var(--xh-bg-subtle-hover));
|
|
84
100
|
color: var(--xh-dynamic-input-trigger-fg-hover, var(--xh-fg-default));
|
|
85
101
|
}
|
|
86
102
|
|
|
87
|
-
[data-scope='dynamic-input'][data-part='
|
|
88
|
-
[data-scope='dynamic-input'][data-part='move-up-trigger']:
|
|
89
|
-
[data-scope='dynamic-input'][data-part='move-down-trigger']:
|
|
103
|
+
[data-scope='dynamic-input'][data-part='item-delete-trigger']:not([aria-disabled='true']):active,
|
|
104
|
+
[data-scope='dynamic-input'][data-part='move-up-trigger']:not([aria-disabled='true']):active,
|
|
105
|
+
[data-scope='dynamic-input'][data-part='move-down-trigger']:not([aria-disabled='true']):active {
|
|
90
106
|
background: var(--xh-dynamic-input-trigger-bg-active, var(--xh-bg-subtle-active));
|
|
107
|
+
scale: var(--xh-motion-scale-press);
|
|
91
108
|
}
|
|
92
109
|
|
|
93
110
|
/* 删除把手悬停转危险色:它是这一行里唯一不可撤销的动作 */
|
|
94
|
-
[data-scope='dynamic-input'][data-part='
|
|
95
|
-
color: var(--xh-dynamic-input-
|
|
111
|
+
[data-scope='dynamic-input'][data-part='item-delete-trigger']:hover:not([aria-disabled='true']) {
|
|
112
|
+
color: var(--xh-dynamic-input-item-delete-fg-hover, var(--xh-fg-danger-hover));
|
|
96
113
|
}
|
|
97
114
|
|
|
98
|
-
[data-scope='dynamic-input'][data-part='
|
|
115
|
+
[data-scope='dynamic-input'][data-part='item-delete-trigger']:focus-visible,
|
|
99
116
|
[data-scope='dynamic-input'][data-part='move-up-trigger']:focus-visible,
|
|
100
117
|
[data-scope='dynamic-input'][data-part='move-down-trigger']:focus-visible {
|
|
101
118
|
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
@@ -104,7 +121,7 @@
|
|
|
104
121
|
|
|
105
122
|
/* 到上下限、或整份禁用时用 aria-disabled 表达(原生 disabled 不派 click,禁用守卫走不到),
|
|
106
123
|
所以样式也得认这个属性,写 :disabled 永远不命中 */
|
|
107
|
-
[data-scope='dynamic-input'][data-part='
|
|
124
|
+
[data-scope='dynamic-input'][data-part='item-delete-trigger'][aria-disabled='true'],
|
|
108
125
|
[data-scope='dynamic-input'][data-part='move-up-trigger'][aria-disabled='true'],
|
|
109
126
|
[data-scope='dynamic-input'][data-part='move-down-trigger'][aria-disabled='true'] {
|
|
110
127
|
background: transparent;
|
|
@@ -144,7 +161,7 @@
|
|
|
144
161
|
background: var(--xh-dynamic-input-add-bg-hover, var(--xh-bg-subtle-hover));
|
|
145
162
|
}
|
|
146
163
|
|
|
147
|
-
[data-scope='dynamic-input'][data-part='add-trigger']:
|
|
164
|
+
[data-scope='dynamic-input'][data-part='add-trigger']:not([aria-disabled='true']):active {
|
|
148
165
|
background: var(--xh-dynamic-input-add-bg-active, var(--xh-bg-subtle-active));
|
|
149
166
|
}
|
|
150
167
|
|
|
@@ -154,9 +171,50 @@
|
|
|
154
171
|
}
|
|
155
172
|
|
|
156
173
|
[data-scope='dynamic-input'][data-part='add-trigger'][aria-disabled='true'] {
|
|
157
|
-
border-color: var(--xh-border-subtle);
|
|
174
|
+
border-color: var(--xh-dynamic-input-add-border-disabled, var(--xh-border-subtle));
|
|
158
175
|
background: transparent;
|
|
159
176
|
color: var(--xh-fg-disabled);
|
|
160
177
|
cursor: not-allowed;
|
|
161
178
|
}
|
|
179
|
+
|
|
180
|
+
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
|
|
181
|
+
[data-scope='dynamic-input'][data-part='move-up-trigger']:empty::before {
|
|
182
|
+
content: '';
|
|
183
|
+
display: inline-block;
|
|
184
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
185
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
186
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
187
|
+
background-color: currentColor;
|
|
188
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-up) center / contain no-repeat;
|
|
189
|
+
mask: var(--xh-glyph-mark-chevron-up) center / contain no-repeat;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
[data-scope='dynamic-input'][data-part='move-down-trigger']:empty::before {
|
|
193
|
+
content: '';
|
|
194
|
+
display: inline-block;
|
|
195
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
196
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
197
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
198
|
+
background-color: currentColor;
|
|
199
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-down) center / contain no-repeat;
|
|
200
|
+
mask: var(--xh-glyph-mark-chevron-down) center / contain no-repeat;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
[data-scope='dynamic-input'][data-part='item-delete-trigger']:empty::before {
|
|
204
|
+
content: '';
|
|
205
|
+
display: inline-block;
|
|
206
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
207
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
208
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
209
|
+
background-color: currentColor;
|
|
210
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
211
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
|
|
215
|
+
写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
|
|
216
|
+
[data-scope='dynamic-input'][data-part='item-content'][hidden],
|
|
217
|
+
[data-scope='dynamic-input'][data-part='item-action'][hidden] {
|
|
218
|
+
display: none;
|
|
219
|
+
}
|
|
162
220
|
}
|
package/css/editable.css
CHANGED
|
@@ -34,8 +34,7 @@
|
|
|
34
34
|
cursor: not-allowed;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/* 预览区与输入框轮流上场,两者在同一处落脚:
|
|
38
|
-
area 定死最小宽高,切换形态时这一块不会忽大忽小地跳 */
|
|
37
|
+
/* 预览区与输入框轮流上场,两者在同一处落脚:area 给这一处定最小宽高 */
|
|
39
38
|
[data-scope='editable'][data-part='area'] {
|
|
40
39
|
display: inline-flex;
|
|
41
40
|
align-items: center;
|
|
@@ -47,21 +46,23 @@
|
|
|
47
46
|
display: none;
|
|
48
47
|
}
|
|
49
48
|
|
|
50
|
-
/*
|
|
51
|
-
|
|
49
|
+
/* 预览区的高度、内边距与边框都和输入框取同一档,只有描边是透明的:
|
|
50
|
+
单行值定在控件档上,多行值才往下长 */
|
|
52
51
|
[data-scope='editable'][data-part='preview'] {
|
|
53
|
-
display: inline-
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
align-items: center;
|
|
54
54
|
inline-size: 100%;
|
|
55
|
+
min-block-size: var(--xh-editable-preview-min-h, var(--xh-control-h-md));
|
|
55
56
|
padding-inline: var(--xh-editable-preview-px, var(--xh-control-px-md));
|
|
56
57
|
padding-block: 0;
|
|
57
58
|
border: var(--xh-stroke-thin) solid transparent;
|
|
58
59
|
border-radius: var(--xh-editable-preview-radius, var(--xh-shape-control));
|
|
59
60
|
color: var(--xh-editable-preview-fg, var(--xh-fg-default));
|
|
60
61
|
font-size: var(--xh-editable-preview-font-size, var(--xh-text-body-size));
|
|
61
|
-
line-height: var(--xh-
|
|
62
|
-
/*
|
|
62
|
+
line-height: var(--xh-leading-normal);
|
|
63
|
+
/* 值里的换行与连续空格照原样显示,过长的行断开而不撑破弹性行 */
|
|
63
64
|
white-space: pre-wrap;
|
|
64
|
-
overflow-wrap:
|
|
65
|
+
overflow-wrap: anywhere;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
/* 编辑态由连接层给 hidden;上面那条 display 会盖掉 UA 规则,少了这条就收不起来 */
|
|
@@ -140,12 +141,13 @@
|
|
|
140
141
|
}
|
|
141
142
|
|
|
142
143
|
[data-scope='editable'][data-part='input']:focus-visible {
|
|
144
|
+
border-color: var(--xh-editable-input-border-focus, var(--xh-_tone, var(--xh-border-control-focus)));
|
|
143
145
|
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
144
146
|
outline-offset: var(--xh-ring-offset);
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
[data-scope='editable'][data-part='input'][data-invalid] {
|
|
148
|
-
border-color: var(--xh-editable-input-border-invalid, var(--xh-
|
|
150
|
+
border-color: var(--xh-editable-input-border-invalid, var(--xh-border-invalid));
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
/* 只读仍可聚焦、可复制,不置灰,只把底色压下去表示"改不动" */
|
|
@@ -188,7 +190,7 @@
|
|
|
188
190
|
background: var(--xh-editable-trigger-bg, var(--xh-bg-subtle));
|
|
189
191
|
color: var(--xh-editable-trigger-fg, var(--xh-fg-default));
|
|
190
192
|
font-family: inherit;
|
|
191
|
-
font-size: var(--xh-editable-trigger-font-size, var(--xh-
|
|
193
|
+
font-size: var(--xh-editable-trigger-font-size, var(--xh-text-secondary-size));
|
|
192
194
|
line-height: var(--xh-leading-none);
|
|
193
195
|
white-space: nowrap;
|
|
194
196
|
cursor: pointer;
|
package/css/ellipsis.css
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/* 铺开:裁剪整个撤掉。写在两档之后,压得住上面同权重的那两条 */
|
|
30
|
-
[data-scope='ellipsis'][data-part='root'][data-
|
|
30
|
+
[data-scope='ellipsis'][data-part='root'][data-state='open'] {
|
|
31
31
|
display: block;
|
|
32
32
|
overflow: visible;
|
|
33
33
|
white-space: normal;
|
|
@@ -43,4 +43,10 @@
|
|
|
43
43
|
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
44
44
|
outline-offset: var(--xh-ring-offset);
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
/* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
|
|
48
|
+
写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
|
|
49
|
+
[data-scope='ellipsis'][data-part='root'][hidden] {
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
46
52
|
}
|