@xihan-ui/styles 3.0.0 → 3.1.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 +34 -0
- package/README.md +1 -1
- package/component-tokens.d.ts +28 -0
- package/components.tokens.json +651 -25
- package/css/color-picker.css +81 -0
- package/css/date-field.css +33 -0
- package/css/date-picker.css +75 -4
- package/css/date-range-picker.css +36 -2
- package/css/field.css +4 -0
- package/css/float-button.css +98 -0
- package/css/form.css +8 -0
- package/css/notification.css +8 -2
- package/css/table.css +17 -0
- package/css/time-picker.css +59 -2
- package/css/tree.css +81 -11
- package/index.css +496 -21
- package/index.unlayered.css +496 -21
- package/package.json +2 -2
package/css/color-picker.css
CHANGED
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
/* 定义 color picker 样式。 */
|
|
7
7
|
|
|
8
8
|
@import '../family/field-chrome.css';
|
|
9
|
+
@import '../family/action-control.css';
|
|
9
10
|
@import '../family/swatch.css';
|
|
10
11
|
@import '../family/motion.css';
|
|
12
|
+
@import '../family/tag-list.css';
|
|
11
13
|
|
|
12
14
|
@layer xihan.components {
|
|
13
15
|
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
@@ -90,6 +92,46 @@
|
|
|
90
92
|
display: none;
|
|
91
93
|
}
|
|
92
94
|
|
|
95
|
+
/* 多选的标签行:选中的颜色在盒里排成标签,超过 maxTagCount 的折进 +N。
|
|
96
|
+
行里每一枚都是 tag(data-scope="tag"),样子归 tag.css;行怎么排、标签怎么进出归标签行家族配方。
|
|
97
|
+
基准取 0:只吃触发钮剩下的宽度、在自己里面折行;按内容宽算基准的话,盒子会先在钮前面折行,把钮挤到最后一行 */
|
|
98
|
+
[data-scope='color-picker'][data-part='tag-list'] {
|
|
99
|
+
--xh-tag-list-gap: var(--xh-color-picker-tag-list-gap, var(--xh-space-1));
|
|
100
|
+
|
|
101
|
+
flex: 1 1 0;
|
|
102
|
+
flex-wrap: wrap;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* 颜色标签是定长的值串,截短了就读不出是哪个颜色:不收缩,排不下就折到下一行,
|
|
106
|
+
盒随行数长高(字段家族的 multi-tag 布局给),到上限后在盒内滚动 */
|
|
107
|
+
[data-scope='color-picker'][data-part='tag-list'] > [data-scope='tag'][data-part='root'] {
|
|
108
|
+
flex: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* 每枚标签前一个色点,颜色由连接层写进内联私有槽;+N 那一枚没有 data-value,不画。
|
|
112
|
+
白色与近底色的颜色靠一圈默认描边从标签底上分出来 */
|
|
113
|
+
[data-scope='color-picker'][data-part='tag-list'] > [data-scope='tag'][data-part='root'][data-value]::before {
|
|
114
|
+
flex: none;
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
inline-size: var(--xh-color-picker-tag-dot-size, var(--xh-control-indicator-sm));
|
|
117
|
+
block-size: var(--xh-color-picker-tag-dot-size, var(--xh-control-indicator-sm));
|
|
118
|
+
border: var(--xh-stroke-thin) solid var(--xh-color-picker-tag-dot-border, var(--xh-border-default));
|
|
119
|
+
border-radius: var(--xh-shape-circle);
|
|
120
|
+
background-color: var(--xh-_color-picker-tag-color, transparent);
|
|
121
|
+
content: '';
|
|
122
|
+
print-color-adjust: exact;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
[data-scope='color-picker'][data-part='control'][data-xh-field-layout='multi-tag'] {
|
|
126
|
+
max-block-size: var(--xh-color-picker-control-max-h, var(--xh-viewport-h-sm));
|
|
127
|
+
overflow-y: auto;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* 多选时值文字让位,触发钮只剩一颗显示工作色的色块:不再占满剩余宽度,标签行吃掉余下的位置 */
|
|
131
|
+
[data-scope='color-picker'][data-part='control'][data-xh-field-layout='multi-tag'] > [data-scope='color-picker'][data-part='trigger'] {
|
|
132
|
+
flex: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
93
135
|
/* 盒内那颗可聚焦的按钮:不画描边不铺底也不自带高度,只占满剩余宽度、排布色块与值文本 */
|
|
94
136
|
[data-scope='color-picker'][data-part='trigger'] {
|
|
95
137
|
display: inline-flex;
|
|
@@ -427,6 +469,39 @@
|
|
|
427
469
|
color: var(--xh-fg-disabled);
|
|
428
470
|
}
|
|
429
471
|
|
|
472
|
+
/* 「添加」沉到面板的行尾:它是多选时整块面板的出口,不跟取色面左对齐 */
|
|
473
|
+
[data-scope='color-picker'][data-part='content'] > [data-scope='color-picker'][data-part='confirm-trigger'] {
|
|
474
|
+
flex: none;
|
|
475
|
+
align-self: flex-end;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/* 「添加」是面板里唯一的主要动作:品牌实心、悬停 / 按下与 0.97 按压、焦点环全由 Action Control 的
|
|
479
|
+
text solid 档给;槽名统一按部件取 --xh-color-picker-confirm-trigger-*,只映射到家族桥接槽 */
|
|
480
|
+
[data-scope='color-picker'][data-part='confirm-trigger'] {
|
|
481
|
+
--xh-action-visual-size: var(--xh-color-picker-confirm-trigger-h, var(--xh-_action-profile-visual-size));
|
|
482
|
+
--xh-action-padding-inline: var(--xh-color-picker-confirm-trigger-px, var(--xh-_action-profile-padding-inline));
|
|
483
|
+
--xh-action-radius: var(--xh-color-picker-confirm-trigger-radius, var(--xh-shape-control));
|
|
484
|
+
--xh-action-bg-rest: var(--xh-color-picker-confirm-trigger-bg, var(--xh-_action-variant-bg-rest));
|
|
485
|
+
--xh-action-bg-hover: var(--xh-color-picker-confirm-trigger-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
486
|
+
--xh-action-bg-pressed: var(--xh-color-picker-confirm-trigger-bg-active, var(--xh-_action-variant-bg-pressed));
|
|
487
|
+
--xh-action-fg-rest: var(--xh-color-picker-confirm-trigger-fg, var(--xh-_action-variant-fg-rest));
|
|
488
|
+
--xh-action-fg-hover: var(--xh-color-picker-confirm-trigger-fg, var(--xh-_action-variant-fg-hover));
|
|
489
|
+
--xh-action-fg-pressed: var(--xh-color-picker-confirm-trigger-fg, var(--xh-_action-variant-fg-pressed));
|
|
490
|
+
--xh-action-border-rest: transparent;
|
|
491
|
+
--xh-action-highlight-rest: transparent;
|
|
492
|
+
--xh-action-shadow-rest: var(--xh-color-picker-confirm-trigger-shadow, none);
|
|
493
|
+
--xh-action-shadow-hover: var(--xh-color-picker-confirm-trigger-shadow, none);
|
|
494
|
+
--xh-action-shadow-pressed: var(--xh-color-picker-confirm-trigger-shadow, none);
|
|
495
|
+
--xh-action-font-size: var(--xh-text-secondary-size);
|
|
496
|
+
|
|
497
|
+
border-width: 0;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/* 单选时连接层给的是 hidden 属性;家族那条 display 会把 UA 规则盖掉 */
|
|
501
|
+
[data-scope='color-picker'][data-part='confirm-trigger'][hidden] {
|
|
502
|
+
display: none;
|
|
503
|
+
}
|
|
504
|
+
|
|
430
505
|
/* 预设色板的挂载点,同时充当色板的根节点:color-swatch-picker 那份皮的 root 规则落在
|
|
431
506
|
[data-scope='color-swatch-picker'][data-part='root'] 上,而这里没有那个节点,所以根上挂的那几个私有槽
|
|
432
507
|
(格子边长、间距、徽标尺寸、语气色、图标尺)与排布得在这儿照抄一遍;格子的皮仍归色板那一份。
|
|
@@ -510,5 +585,11 @@
|
|
|
510
585
|
outline: var(--xh-stroke-thin) solid ButtonBorder;
|
|
511
586
|
outline-offset: calc(-1 * var(--xh-stroke-thin));
|
|
512
587
|
}
|
|
588
|
+
|
|
589
|
+
/* 标签前的色点画的也是颜色本身:同样退出强制着色,用系统文字色描一圈 */
|
|
590
|
+
[data-scope='color-picker'][data-part='tag-list'] > [data-scope='tag'][data-part='root'][data-value]::before {
|
|
591
|
+
forced-color-adjust: none;
|
|
592
|
+
border-color: CanvasText;
|
|
593
|
+
}
|
|
513
594
|
}
|
|
514
595
|
}
|
package/css/date-field.css
CHANGED
|
@@ -123,6 +123,30 @@
|
|
|
123
123
|
display: none;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
/* 整条占位:一段都没填、焦点也不在段上时,段位与分隔符让位给一句占位文字,焦点一进到段上就换回段位。
|
|
127
|
+
段位只是淡出(仍可聚焦、仍在读屏树里),文字以生成内容压在同一行上、不吃指针,点下去落到底下的段位 */
|
|
128
|
+
[data-scope='date-field'][data-part='segment-group'][data-placeholder-shown] {
|
|
129
|
+
position: relative;
|
|
130
|
+
color: transparent;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
[data-scope='date-field'][data-part='segment-group'][data-placeholder-shown] > * {
|
|
134
|
+
opacity: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
[data-scope='date-field'][data-part='segment-group'][data-placeholder-shown]::before {
|
|
138
|
+
content: attr(data-placeholder-text);
|
|
139
|
+
position: absolute;
|
|
140
|
+
inset-inline: 0;
|
|
141
|
+
inset-block-start: 50%;
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
color: var(--xh-date-field-placeholder-fg, var(--xh-fg-subtle));
|
|
144
|
+
white-space: nowrap;
|
|
145
|
+
text-overflow: ellipsis;
|
|
146
|
+
pointer-events: none;
|
|
147
|
+
translate: 0 -50%;
|
|
148
|
+
}
|
|
149
|
+
|
|
126
150
|
[data-scope='date-field'][data-part='segment-group'] > :not([data-scope]) {
|
|
127
151
|
color: var(--xh-date-field-literal-fg, var(--xh-fg-subtle));
|
|
128
152
|
}
|
|
@@ -235,6 +259,15 @@
|
|
|
235
259
|
}
|
|
236
260
|
|
|
237
261
|
@media (forced-colors: active) {
|
|
262
|
+
/* 整条占位的文字照系统的弱色画;段位让位时的透明字不被强制换色顶回来 */
|
|
263
|
+
[data-scope='date-field'][data-part='segment-group'][data-placeholder-shown] {
|
|
264
|
+
forced-color-adjust: none;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
[data-scope='date-field'][data-part='segment-group'][data-placeholder-shown]::before {
|
|
268
|
+
color: GrayText;
|
|
269
|
+
}
|
|
270
|
+
|
|
238
271
|
[data-scope='date-field'][data-part='segment'][data-invalid]:is([data-focus], :focus-visible) {
|
|
239
272
|
outline: var(--xh-ring-width) solid Highlight;
|
|
240
273
|
outline-offset: var(--xh-ring-offset);
|
package/css/date-picker.css
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
/* 共享关键帧由 family/motion.css 提供,本皮肤 @import 它,单独引入仍成立。 */
|
|
14
14
|
@import '../family/motion.css';
|
|
15
|
+
@import '../family/tag-list.css';
|
|
15
16
|
|
|
16
17
|
@layer xihan.components {
|
|
17
18
|
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
@@ -203,11 +204,69 @@
|
|
|
203
204
|
color: var(--xh-date-picker-literal-fg, var(--xh-fg-subtle));
|
|
204
205
|
}
|
|
205
206
|
|
|
207
|
+
/* 整条占位:一段都没填、焦点也不在段上时,段位与分隔符让位给一句占位文字,焦点一进到段上就换回段位。
|
|
208
|
+
段位只是淡出(仍可聚焦、仍在读屏树里),文字以生成内容压在同一行上、不吃指针,点下去落到底下的段位 */
|
|
209
|
+
[data-scope='date-picker'][data-part='segment-group'][data-placeholder-shown] {
|
|
210
|
+
position: relative;
|
|
211
|
+
color: transparent;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
[data-scope='date-picker'][data-part='segment-group'][data-placeholder-shown] > * {
|
|
215
|
+
opacity: 0;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
[data-scope='date-picker'][data-part='segment-group'][data-placeholder-shown]::before {
|
|
219
|
+
content: attr(data-placeholder-text);
|
|
220
|
+
position: absolute;
|
|
221
|
+
inset-inline: 0;
|
|
222
|
+
inset-block-start: 50%;
|
|
223
|
+
overflow: hidden;
|
|
224
|
+
color: var(--xh-date-picker-placeholder-fg, var(--xh-fg-subtle));
|
|
225
|
+
white-space: nowrap;
|
|
226
|
+
text-overflow: ellipsis;
|
|
227
|
+
pointer-events: none;
|
|
228
|
+
translate: 0 -50%;
|
|
229
|
+
}
|
|
230
|
+
|
|
206
231
|
/* 容器自己不占 Tab 位、也不承载焦点,环由 control 画,这里不再套一圈 */
|
|
207
232
|
[data-scope='date-picker'][data-part='segment-group']:focus-visible {
|
|
208
233
|
outline: none;
|
|
209
234
|
}
|
|
210
235
|
|
|
236
|
+
/* 多选的标签行:段位让位,选中的日期在盒里排成标签,超过 maxTagCount 的折进 +N。
|
|
237
|
+
行里每一枚都是 tag(data-scope="tag"),样子归 tag.css;行怎么排、标签怎么进出归标签行家族配方,
|
|
238
|
+
这里只接使用者的间距槽,并让它像段位那样占满输入行剩下的宽度 */
|
|
239
|
+
[data-scope='date-picker'][data-part='tag-list'] {
|
|
240
|
+
--xh-tag-list-gap: var(--xh-date-picker-tag-list-gap, var(--xh-space-1));
|
|
241
|
+
|
|
242
|
+
/* 基准取 0:只吃两颗钮剩下的宽度、在自己里面折行;按内容宽算基准的话,盒子会先在钮前面折行,把钮挤到最后一行 */
|
|
243
|
+
flex: 1 1 0;
|
|
244
|
+
flex-wrap: wrap;
|
|
245
|
+
font-size: var(--xh-date-picker-font-size, var(--xh-_date-picker-font-size));
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* 日期标签是定长文字,截短了就读不出是哪天:不收缩,排不下就折到下一行(与标签输入同一种排法),
|
|
249
|
+
盒随行数长高(字段家族的 multi-tag 布局给),到上限后在盒内滚动 */
|
|
250
|
+
[data-scope='date-picker'][data-part='tag-list'] > [data-scope='tag'][data-part='root'] {
|
|
251
|
+
flex: none;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
[data-scope='date-picker'][data-part='control'][data-xh-field-layout='multi-tag'] {
|
|
255
|
+
max-block-size: var(--xh-date-picker-control-max-h, var(--xh-viewport-h-sm));
|
|
256
|
+
overflow-y: auto;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/* 没有选中时这一行承载整条占位:与单选那条占位同一句文字、同一个颜色槽 */
|
|
260
|
+
[data-scope='date-picker'][data-part='tag-list'][data-placeholder-shown]::before {
|
|
261
|
+
content: attr(data-placeholder-text);
|
|
262
|
+
min-inline-size: 0;
|
|
263
|
+
overflow: hidden;
|
|
264
|
+
color: var(--xh-date-picker-placeholder-fg, var(--xh-fg-subtle));
|
|
265
|
+
white-space: nowrap;
|
|
266
|
+
text-overflow: ellipsis;
|
|
267
|
+
pointer-events: none;
|
|
268
|
+
}
|
|
269
|
+
|
|
211
270
|
/* 两个按钮同一副长相:贴在框内末端的小方钮,不占宽度也不撑高 control。正方视觉盒、inset 圆角、
|
|
212
271
|
悬停 100 / 按下 200 与 0.97 按压、粗指针热区、禁用面与 :focus-visible 关环(盒的 :focus-within
|
|
213
272
|
已画了一圈)全由 Action Control 的 field-inset ghost 档给,组件只映射既有覆盖槽。
|
|
@@ -247,10 +306,11 @@
|
|
|
247
306
|
--xh-action-fg-rest: var(--xh-date-picker-action-fg-hover, var(--xh-fg-default));
|
|
248
307
|
}
|
|
249
308
|
|
|
250
|
-
/*
|
|
309
|
+
/* 有值时清空钮顶上来,日历钮让位:两颗并排堆着用户分不清点哪个。
|
|
310
|
+
多选不让位:段位收起后日历钮是唯一的键盘入口(退格摘标签也在它身上),藏了键盘就进不来 */
|
|
251
311
|
[data-scope='date-picker'][data-part='control']:has(
|
|
252
312
|
> [data-scope='date-picker'][data-part='clear-trigger']:not([hidden])
|
|
253
|
-
)
|
|
313
|
+
):not(:has(> [data-scope='date-picker'][data-part='tag-list']:not([hidden])))
|
|
254
314
|
> [data-scope='date-picker'][data-part='trigger'] {
|
|
255
315
|
display: none;
|
|
256
316
|
}
|
|
@@ -269,9 +329,10 @@
|
|
|
269
329
|
border-radius: var(--xh-date-picker-content-radius, var(--xh-shape-overlay));
|
|
270
330
|
background: var(--xh-date-picker-content-bg, var(--xh-bg-surface));
|
|
271
331
|
color: var(--xh-date-picker-content-fg, var(--xh-fg-default));
|
|
272
|
-
/*
|
|
332
|
+
/* 日历是定高结构:网格、时间列与确认行都按 px 排,天然高度就是它们的和,缺省不另设上限
|
|
333
|
+
(按 rem 的滚动面档会随根字号缩小,根字号低于 16px 时确认行就被挤到滚动里);
|
|
273
334
|
可用高度是定位引擎算出的视口余量,视口真放不下时再收一截 */
|
|
274
|
-
max-block-size: min(var(--xh-date-picker-max-h, var(--xh-
|
|
335
|
+
max-block-size: min(var(--xh-date-picker-max-h, var(--xh-_date-picker-available-h)), var(--xh-_date-picker-available-h));
|
|
275
336
|
/* 两轴都滚:块轴放不下时面板内自己竖滚,行内轴放不下时面板内自己横滚,
|
|
276
337
|
日历那几块保持各自的天然宽度,不被压 */
|
|
277
338
|
overflow: auto;
|
|
@@ -734,6 +795,16 @@
|
|
|
734
795
|
}
|
|
735
796
|
|
|
736
797
|
@media (forced-colors: active) {
|
|
798
|
+
/* 整条占位的文字照系统的弱色画;段位让位时的透明字不被强制换色顶回来 */
|
|
799
|
+
[data-scope='date-picker'][data-part='segment-group'][data-placeholder-shown] {
|
|
800
|
+
forced-color-adjust: none;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
[data-scope='date-picker'][data-part='segment-group'][data-placeholder-shown]::before,
|
|
804
|
+
[data-scope='date-picker'][data-part='tag-list'][data-placeholder-shown]::before {
|
|
805
|
+
color: GrayText;
|
|
806
|
+
}
|
|
807
|
+
|
|
737
808
|
/* 系统接管底色后仍保住末端对号;禁用标记改用系统失效色。 */
|
|
738
809
|
[data-scope='date-picker'][data-part='preset']::after,
|
|
739
810
|
[data-scope='date-picker'][data-part='time-item']::after {
|
|
@@ -232,6 +232,30 @@
|
|
|
232
232
|
color: var(--xh-date-range-picker-literal-fg, var(--xh-fg-subtle));
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
/* 整条占位:一段都没填、焦点也不在段上时,段位与分隔符让位给一句占位文字,焦点一进到段上就换回段位。
|
|
236
|
+
段位只是淡出(仍可聚焦、仍在读屏树里),文字以生成内容压在同一行上、不吃指针,点下去落到底下的段位 */
|
|
237
|
+
[data-scope='date-range-picker'][data-part='segment-group'][data-placeholder-shown] {
|
|
238
|
+
position: relative;
|
|
239
|
+
color: transparent;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
[data-scope='date-range-picker'][data-part='segment-group'][data-placeholder-shown] > * {
|
|
243
|
+
opacity: 0;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
[data-scope='date-range-picker'][data-part='segment-group'][data-placeholder-shown]::before {
|
|
247
|
+
content: attr(data-placeholder-text);
|
|
248
|
+
position: absolute;
|
|
249
|
+
inset-inline: 0;
|
|
250
|
+
inset-block-start: 50%;
|
|
251
|
+
overflow: hidden;
|
|
252
|
+
color: var(--xh-date-range-picker-placeholder-fg, var(--xh-fg-subtle));
|
|
253
|
+
white-space: nowrap;
|
|
254
|
+
text-overflow: ellipsis;
|
|
255
|
+
pointer-events: none;
|
|
256
|
+
translate: 0 -50%;
|
|
257
|
+
}
|
|
258
|
+
|
|
235
259
|
/* 容器自己不占 Tab 位、也不承载焦点,环由 control 画,这里不再套一圈 */
|
|
236
260
|
[data-scope='date-range-picker'][data-part='segment-group']:focus-visible {
|
|
237
261
|
outline: none;
|
|
@@ -298,9 +322,10 @@
|
|
|
298
322
|
border-radius: var(--xh-date-range-picker-content-radius, var(--xh-shape-overlay));
|
|
299
323
|
background: var(--xh-date-range-picker-content-bg, var(--xh-bg-surface));
|
|
300
324
|
color: var(--xh-date-range-picker-content-fg, var(--xh-fg-default));
|
|
301
|
-
/*
|
|
325
|
+
/* 日历是定高结构:网格、时间列与确认行都按 px 排,天然高度就是它们的和,缺省不另设上限
|
|
326
|
+
(按 rem 的滚动面档会随根字号缩小,根字号低于 16px 时确认行就被挤到滚动里);
|
|
302
327
|
可用高度是定位引擎算出的视口余量,视口真放不下时再收一截 */
|
|
303
|
-
max-block-size: min(var(--xh-date-range-picker-max-h, var(--xh-
|
|
328
|
+
max-block-size: min(var(--xh-date-range-picker-max-h, var(--xh-_date-range-picker-available-h)), var(--xh-_date-range-picker-available-h));
|
|
304
329
|
/* 两轴都滚:块轴放不下时面板内自己竖滚,行内轴放不下时面板内自己横滚,
|
|
305
330
|
日历那几块保持各自的天然宽度,不被压 */
|
|
306
331
|
overflow: auto;
|
|
@@ -784,6 +809,15 @@
|
|
|
784
809
|
}
|
|
785
810
|
|
|
786
811
|
@media (forced-colors: active) {
|
|
812
|
+
/* 整条占位的文字照系统的弱色画;段位让位时的透明字不被强制换色顶回来 */
|
|
813
|
+
[data-scope='date-range-picker'][data-part='segment-group'][data-placeholder-shown] {
|
|
814
|
+
forced-color-adjust: none;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
[data-scope='date-range-picker'][data-part='segment-group'][data-placeholder-shown]::before {
|
|
818
|
+
color: GrayText;
|
|
819
|
+
}
|
|
820
|
+
|
|
787
821
|
/* 系统接管底色后仍保住末端对号;禁用标记改用系统失效色。 */
|
|
788
822
|
[data-scope='date-range-picker'][data-part='preset']::after,
|
|
789
823
|
[data-scope='date-range-picker'][data-part='time-item']::after {
|
package/css/field.css
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-direction: column;
|
|
20
20
|
gap: var(--xh-field-gap, var(--xh-space-1));
|
|
21
|
+
/* 字段族控件放进字段即铺满字段宽:字段的宽由表单的列给,控件跟着列走,
|
|
22
|
+
不必逐个组件在根上写 inline-size: 100%。单独摆放的控件仍是 16rem 缺省宽;
|
|
23
|
+
单类钉宽(--xh-<组件>-control-w)照旧压过这一条 */
|
|
24
|
+
--xh-control-w: 100%;
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
/* 表单横排(标签左置):字段转两列网格,标签列宽由表单的 --xh-form-label-w 统一给,
|
package/css/float-button.css
CHANGED
|
@@ -66,6 +66,104 @@
|
|
|
66
66
|
inset-inline-end: max(var(--xh-_float-button-offset), env(safe-area-inset-left), env(safe-area-inset-right));
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
/* —— 位置 ——
|
|
70
|
+
拖到别处、或作者给了位置时,角落那两条贴边里有一条换掉:data-placement 由连接层按位置推出
|
|
71
|
+
(离触发器最近的恒是视口的那条边、展开组朝页面中间长),这里只换沿边的那一条。
|
|
72
|
+
百分比按固定定位的包含块(视口去掉滚动条)量,与连接层量的视口同一块;
|
|
73
|
+
夹取的上下界与四角同样和安全区取大的一头,比例再怎么写,钮也不会压进刘海与横条。
|
|
74
|
+
触发器边长取它自己那一档(使用者槽在前):沿边的比例量的是触发器中心 */
|
|
75
|
+
[data-scope='float-button'][data-part='root'] {
|
|
76
|
+
--xh-_float-button-span: var(--xh-float-button-size, var(--xh-_float-button-size));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* 贴左右边:上下按比例,锚在离触发器近的那一头 */
|
|
80
|
+
[data-scope='float-button'][data-part='root'][data-edge^='inline'][data-placement^='top'] {
|
|
81
|
+
inset-block-start: clamp(
|
|
82
|
+
max(var(--xh-_float-button-offset), env(safe-area-inset-top)),
|
|
83
|
+
calc(var(--xh-_float-button-ratio) * 100% - var(--xh-_float-button-span) / 2),
|
|
84
|
+
calc(100% - var(--xh-_float-button-span) - max(var(--xh-_float-button-offset), env(safe-area-inset-bottom)))
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[data-scope='float-button'][data-part='root'][data-edge^='inline'][data-placement^='bottom'] {
|
|
89
|
+
inset-block-end: clamp(
|
|
90
|
+
max(var(--xh-_float-button-offset), env(safe-area-inset-bottom)),
|
|
91
|
+
calc((1 - var(--xh-_float-button-ratio)) * 100% - var(--xh-_float-button-span) / 2),
|
|
92
|
+
calc(100% - var(--xh-_float-button-span) - max(var(--xh-_float-button-offset), env(safe-area-inset-top)))
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* 贴上下边:行内方向按比例,从行首量起 */
|
|
97
|
+
[data-scope='float-button'][data-part='root'][data-edge^='block'][data-placement$='-start'] {
|
|
98
|
+
inset-inline-start: clamp(
|
|
99
|
+
max(var(--xh-_float-button-offset), env(safe-area-inset-left), env(safe-area-inset-right)),
|
|
100
|
+
calc(var(--xh-_float-button-ratio) * 100% - var(--xh-_float-button-span) / 2),
|
|
101
|
+
calc(100% - var(--xh-_float-button-span) - max(var(--xh-_float-button-offset), env(safe-area-inset-left), env(safe-area-inset-right)))
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[data-scope='float-button'][data-part='root'][data-edge^='block'][data-placement$='-end'] {
|
|
106
|
+
inset-inline-end: clamp(
|
|
107
|
+
max(var(--xh-_float-button-offset), env(safe-area-inset-left), env(safe-area-inset-right)),
|
|
108
|
+
calc((1 - var(--xh-_float-button-ratio)) * 100% - var(--xh-_float-button-span) / 2),
|
|
109
|
+
calc(100% - var(--xh-_float-button-span) - max(var(--xh-_float-button-offset), env(safe-area-inset-left), env(safe-area-inset-right)))
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/* 停在一点、或正跟着指针走:坐标是触发器左上角的物理像素,横向一律从左边量,不随书写方向翻。
|
|
114
|
+
竖向锚在离触发器近的那一头:朝下长的锚上沿,朝上长的锚下沿,展开组冒出来时触发器不挪窝。
|
|
115
|
+
停着的点仍夹在视口里(视口变小时不跑出去);跟手的坐标由连接层夹好,这里原样用 */
|
|
116
|
+
[data-scope='float-button'][data-part='root'][data-point][data-placement] {
|
|
117
|
+
inset-inline: auto;
|
|
118
|
+
/* stylelint-disable-next-line property-disallowed-list -- 停点由连接层按指针的物理坐标写成 x,横向从左边量、不随书写方向翻 */
|
|
119
|
+
left: clamp(
|
|
120
|
+
max(var(--xh-_float-button-offset), env(safe-area-inset-left)),
|
|
121
|
+
var(--xh-_float-button-x),
|
|
122
|
+
calc(100% - var(--xh-_float-button-span) - max(var(--xh-_float-button-offset), env(safe-area-inset-right)))
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[data-scope='float-button'][data-part='root'][data-point][data-placement^='top'] {
|
|
127
|
+
top: clamp(
|
|
128
|
+
max(var(--xh-_float-button-offset), env(safe-area-inset-top)),
|
|
129
|
+
var(--xh-_float-button-y),
|
|
130
|
+
calc(100% - var(--xh-_float-button-span) - max(var(--xh-_float-button-offset), env(safe-area-inset-bottom)))
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
[data-scope='float-button'][data-part='root'][data-point][data-placement^='bottom'] {
|
|
135
|
+
bottom: clamp(
|
|
136
|
+
max(var(--xh-_float-button-offset), env(safe-area-inset-bottom)),
|
|
137
|
+
calc(100% - var(--xh-_float-button-y) - var(--xh-_float-button-span)),
|
|
138
|
+
calc(100% - var(--xh-_float-button-span) - max(var(--xh-_float-button-offset), env(safe-area-inset-top)))
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* 跟手排在贴边与停点之后:拖动与落定途中压过提交了的位置 */
|
|
143
|
+
[data-scope='float-button'][data-part='root'][data-moving][data-placement] {
|
|
144
|
+
inset-inline: auto;
|
|
145
|
+
/* stylelint-disable-next-line property-disallowed-list -- 同上:跟手坐标是指针的物理 x */
|
|
146
|
+
left: var(--xh-_float-button-x);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
[data-scope='float-button'][data-part='root'][data-moving][data-placement^='top'] {
|
|
150
|
+
top: var(--xh-_float-button-y);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
[data-scope='float-button'][data-part='root'][data-moving][data-placement^='bottom'] {
|
|
154
|
+
bottom: calc(100% - var(--xh-_float-button-y) - var(--xh-_float-button-span));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* 能拖时触屏手指在触发器上的移动归拖动,不让浏览器拿去滚页面;光标提示能抓、正抓着 */
|
|
158
|
+
[data-scope='float-button'][data-part='root'][data-draggable] [data-scope='float-button'][data-part='trigger'] {
|
|
159
|
+
touch-action: none;
|
|
160
|
+
cursor: grab;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
[data-scope='float-button'][data-part='root'][data-dragging] [data-scope='float-button'][data-part='trigger'] {
|
|
164
|
+
cursor: grabbing;
|
|
165
|
+
}
|
|
166
|
+
|
|
69
167
|
/* —— 尺寸:原生动作项与触发器的 floating 档逐档同表 —— */
|
|
70
168
|
[data-scope='float-button'][data-part='root'][data-size='sm'] {
|
|
71
169
|
--xh-_float-button-size: var(--xh-control-box-md);
|
package/css/form.css
CHANGED
|
@@ -44,6 +44,14 @@
|
|
|
44
44
|
flex-flow: row wrap;
|
|
45
45
|
align-items: start;
|
|
46
46
|
column-gap: var(--xh-form-inline-gap, var(--xh-space-4));
|
|
47
|
+
/* 一行流里字段按内容收,没有列宽可铺:在表单根上取下此处的字段缺省宽,交给下面的字段还原 */
|
|
48
|
+
--xh-_form-inline-control-w: var(--xh-control-w);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* 字段会把里面的控件铺满字段宽,而一行流的字段宽正是由控件撑出来的,两者互相指望就塌成内容宽;
|
|
52
|
+
这一档的字段还原成表单根上的缺省宽 */
|
|
53
|
+
[data-scope='form'][data-part='root'][data-layout='inline'] [data-scope='field'][data-part='root'] {
|
|
54
|
+
--xh-control-w: var(--xh-_form-inline-control-w);
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
/* 一列是网格档的缺省,这里从两列起逐档写 */
|
package/css/notification.css
CHANGED
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
[data-scope='notification'][data-part='group'][data-stacked][data-preset='toast'] {
|
|
156
|
-
inline-size: min(var(--xh-notification-item-w,
|
|
156
|
+
inline-size: min(var(--xh-notification-item-w, var(--xh-overlay-toast-w)), calc(100vw - var(--xh-space-8)));
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
[data-scope='notification'][data-part='group'][data-stacked][data-placement^='bottom'] {
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
display: flex;
|
|
263
263
|
align-items: flex-start;
|
|
264
264
|
column-gap: var(--xh-notification-item-gap, var(--xh-space-2));
|
|
265
|
-
inline-size: var(--xh-notification-item-w,
|
|
265
|
+
inline-size: var(--xh-notification-item-w, var(--xh-overlay-toast-w));
|
|
266
266
|
padding-block: var(--xh-notification-item-py, var(--xh-space-3));
|
|
267
267
|
padding-inline: var(--xh-notification-item-px, var(--xh-space-4));
|
|
268
268
|
font-size: var(--xh-notification-item-font-size, var(--xh-text-label-size));
|
|
@@ -547,8 +547,14 @@
|
|
|
547
547
|
);
|
|
548
548
|
}
|
|
549
549
|
|
|
550
|
+
/* 正文有上限:推一段长文(公告全文)进来时卡片不被撑到整屏高——摞是整面视口的定位面、不吃指针也不裁切,
|
|
551
|
+
撑出视口的那截既看不到也滚不到。超出的部分在正文自己里面滚,标题与操作钮留在卡片上;
|
|
552
|
+
滚到头不把滚动量传给页面 */
|
|
550
553
|
[data-scope='notification'][data-part='item-description'] {
|
|
551
554
|
margin: 0;
|
|
555
|
+
max-block-size: var(--xh-notification-description-max-h, var(--xh-viewport-h-md));
|
|
556
|
+
overflow-y: auto;
|
|
557
|
+
overscroll-behavior: contain;
|
|
552
558
|
color: var(--xh-notification-description-fg, var(--xh-fg-muted));
|
|
553
559
|
font-size: var(--xh-notification-description-font-size, var(--xh-text-secondary-size));
|
|
554
560
|
}
|
package/css/table.css
CHANGED
|
@@ -307,6 +307,23 @@
|
|
|
307
307
|
user-select: none;
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
+
/* 列对齐:data-align 控制列头与数据格的文本与内容对齐方向;
|
|
311
|
+
显式写出三档以便 start 能重置自定义皮肤里可能存在的非默认对齐 */
|
|
312
|
+
[data-scope='table']:is([data-part='column-header'], [data-part='cell'])[data-align='start'] {
|
|
313
|
+
text-align: start;
|
|
314
|
+
justify-content: start;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
[data-scope='table']:is([data-part='column-header'], [data-part='cell'])[data-align='center'] {
|
|
318
|
+
text-align: center;
|
|
319
|
+
justify-content: center;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
[data-scope='table']:is([data-part='column-header'], [data-part='cell'])[data-align='end'] {
|
|
323
|
+
text-align: end;
|
|
324
|
+
justify-content: end;
|
|
325
|
+
}
|
|
326
|
+
|
|
310
327
|
/* 列名是列头里唯一可收窄的一格:flex: 1 吃掉余量、把排序钮 / 列宽把手推到行尾,min-inline-size: 0 让它在
|
|
311
328
|
窄列上收得下去并出省略号。列名不能裸写成文本节点:flex 行里的裸文本是匿名 flex item,min-inline-size 取 auto
|
|
312
329
|
(nowrap 文本的 min-content)缩不下去,96px 的列配一串长列名时定尺的把手连同 auto 外边距一起被挤出列头盒、
|
package/css/time-picker.css
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
/* 共享关键帧由 family/motion.css 提供,本皮肤 @import 它,单独引入仍成立。 */
|
|
14
14
|
@import '../family/motion.css';
|
|
15
|
+
@import '../family/tag-list.css';
|
|
15
16
|
|
|
16
17
|
@layer xihan.components {
|
|
17
18
|
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
@@ -176,6 +177,27 @@
|
|
|
176
177
|
display: none;
|
|
177
178
|
}
|
|
178
179
|
|
|
180
|
+
/* 多选的标签行:段位让位,选中的时刻在盒里排成标签,超过 maxTagCount 的折进 +N。
|
|
181
|
+
行里每一枚都是 tag(data-scope="tag"),样子归 tag.css;行怎么排、标签怎么进出归标签行家族配方。
|
|
182
|
+
基准取 0:只吃两颗钮剩下的宽度、在自己里面折行;按内容宽算基准的话,盒子会先在钮前面折行,把钮挤到最后一行 */
|
|
183
|
+
[data-scope='time-picker'][data-part='tag-list'] {
|
|
184
|
+
--xh-tag-list-gap: var(--xh-time-picker-tag-list-gap, var(--xh-space-1));
|
|
185
|
+
|
|
186
|
+
flex: 1 1 0;
|
|
187
|
+
flex-wrap: wrap;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* 时刻标签是定长文字,截短了就读不出是几点:不收缩,排不下就折到下一行(与标签输入同一种排法),
|
|
191
|
+
盒随行数长高(字段家族的 multi-tag 布局给),到上限后在盒内滚动 */
|
|
192
|
+
[data-scope='time-picker'][data-part='tag-list'] > [data-scope='tag'][data-part='root'] {
|
|
193
|
+
flex: none;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
[data-scope='time-picker'][data-part='control'][data-xh-field-layout='multi-tag'] {
|
|
197
|
+
max-block-size: var(--xh-time-picker-control-max-h, var(--xh-viewport-h-sm));
|
|
198
|
+
overflow-y: auto;
|
|
199
|
+
}
|
|
200
|
+
|
|
179
201
|
[data-scope='time-picker'][data-part='segment-group'] > :not([data-scope]) {
|
|
180
202
|
color: var(--xh-time-picker-literal-fg, var(--xh-fg-subtle));
|
|
181
203
|
}
|
|
@@ -281,10 +303,11 @@
|
|
|
281
303
|
--xh-action-fg-rest: var(--xh-time-picker-action-fg-hover, var(--xh-fg-default));
|
|
282
304
|
}
|
|
283
305
|
|
|
284
|
-
/*
|
|
306
|
+
/* 有值时清空钮顶上来,展开钮让位:两颗并排堆着用户分不清点哪个。
|
|
307
|
+
多选不让位:段位收起后展开钮是唯一的键盘入口(退格摘标签也在它身上),藏了键盘就进不来 */
|
|
285
308
|
[data-scope='time-picker'][data-part='control']:has(
|
|
286
309
|
> [data-scope='time-picker'][data-part='clear-trigger']:not([hidden])
|
|
287
|
-
)
|
|
310
|
+
):not(:has(> [data-scope='time-picker'][data-part='tag-list']:not([hidden])))
|
|
288
311
|
> [data-scope='time-picker'][data-part='trigger'] {
|
|
289
312
|
display: none;
|
|
290
313
|
}
|
|
@@ -334,6 +357,40 @@
|
|
|
334
357
|
animation: xh-overlay-slide-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
335
358
|
}
|
|
336
359
|
|
|
360
|
+
/* 「添加」沉到各列的右下角:它是多选时整块面板的出口,不跟列顶对齐 */
|
|
361
|
+
[data-scope='time-picker'][data-part='content'] > [data-scope='time-picker'][data-part='confirm-trigger'] {
|
|
362
|
+
flex: none;
|
|
363
|
+
align-self: flex-end;
|
|
364
|
+
margin-inline-start: var(--xh-time-picker-confirm-trigger-gap, var(--xh-space-1));
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/* 「添加」是面板里唯一的主要动作:品牌实心、悬停 / 按下与 0.97 按压、焦点环全由 Action Control 的
|
|
368
|
+
text solid 档给;槽名统一按部件取 --xh-time-picker-confirm-trigger-*,只映射到家族桥接槽 */
|
|
369
|
+
[data-scope='time-picker'][data-part='confirm-trigger'] {
|
|
370
|
+
--xh-action-visual-size: var(--xh-time-picker-confirm-trigger-h, var(--xh-_action-profile-visual-size));
|
|
371
|
+
--xh-action-padding-inline: var(--xh-time-picker-confirm-trigger-px, var(--xh-_action-profile-padding-inline));
|
|
372
|
+
--xh-action-radius: var(--xh-time-picker-confirm-trigger-radius, var(--xh-shape-control));
|
|
373
|
+
--xh-action-bg-rest: var(--xh-time-picker-confirm-trigger-bg, var(--xh-_action-variant-bg-rest));
|
|
374
|
+
--xh-action-bg-hover: var(--xh-time-picker-confirm-trigger-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
375
|
+
--xh-action-bg-pressed: var(--xh-time-picker-confirm-trigger-bg-active, var(--xh-_action-variant-bg-pressed));
|
|
376
|
+
--xh-action-fg-rest: var(--xh-time-picker-confirm-trigger-fg, var(--xh-_action-variant-fg-rest));
|
|
377
|
+
--xh-action-fg-hover: var(--xh-time-picker-confirm-trigger-fg, var(--xh-_action-variant-fg-hover));
|
|
378
|
+
--xh-action-fg-pressed: var(--xh-time-picker-confirm-trigger-fg, var(--xh-_action-variant-fg-pressed));
|
|
379
|
+
--xh-action-border-rest: transparent;
|
|
380
|
+
--xh-action-highlight-rest: transparent;
|
|
381
|
+
--xh-action-shadow-rest: var(--xh-time-picker-confirm-trigger-shadow, none);
|
|
382
|
+
--xh-action-shadow-hover: var(--xh-time-picker-confirm-trigger-shadow, none);
|
|
383
|
+
--xh-action-shadow-pressed: var(--xh-time-picker-confirm-trigger-shadow, none);
|
|
384
|
+
--xh-action-font-size: var(--xh-text-secondary-size);
|
|
385
|
+
|
|
386
|
+
border-width: 0;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/* 单选时连接层给的是 hidden 属性;家族那条 display 会把 UA 规则盖掉 */
|
|
390
|
+
[data-scope='time-picker'][data-part='confirm-trigger'][hidden] {
|
|
391
|
+
display: none;
|
|
392
|
+
}
|
|
393
|
+
|
|
337
394
|
/* 快捷选项也是一列,与时分秒那几列并排,排在行内起始一侧 */
|
|
338
395
|
[data-scope='time-picker'][data-part='preset-group'] {
|
|
339
396
|
display: flex;
|