@w-run/wdesign-ui 0.0.0-stage → 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.
Files changed (70) hide show
  1. package/README.md +174 -2
  2. package/dist/index.d.ts +83 -0
  3. package/dist/style/ai-msg.css +187 -0
  4. package/dist/style/alert.css +64 -0
  5. package/dist/style/audio.css +1363 -0
  6. package/dist/style/avatar.css +88 -0
  7. package/dist/style/badge.css +48 -0
  8. package/dist/style/breadcrumb.css +54 -0
  9. package/dist/style/button.css +234 -0
  10. package/dist/style/card.css +71 -0
  11. package/dist/style/carousel.css +101 -0
  12. package/dist/style/checkbox.css +129 -0
  13. package/dist/style/chevron.css +33 -0
  14. package/dist/style/collapse.css +69 -0
  15. package/dist/style/command.css +201 -0
  16. package/dist/style/container.css +7 -0
  17. package/dist/style/datepicker.css +205 -0
  18. package/dist/style/descriptions.css +119 -0
  19. package/dist/style/divider.css +62 -0
  20. package/dist/style/dot.css +30 -0
  21. package/dist/style/drawer.css +145 -0
  22. package/dist/style/dropdown.css +83 -0
  23. package/dist/style/empty.css +36 -0
  24. package/dist/style/explorer.css +336 -0
  25. package/dist/style/file-list.css +92 -0
  26. package/dist/style/form.css +96 -0
  27. package/dist/style/grid.css +4 -0
  28. package/dist/style/group.css +478 -0
  29. package/dist/style/icon-btn.css +75 -0
  30. package/dist/style/image-preview.css +81 -0
  31. package/dist/style/input.css +119 -0
  32. package/dist/style/list.css +81 -0
  33. package/dist/style/markdown.css +312 -0
  34. package/dist/style/modal.css +164 -0
  35. package/dist/style/notification.css +52 -0
  36. package/dist/style/otp.css +139 -0
  37. package/dist/style/pagination.css +120 -0
  38. package/dist/style/popconfirm.css +87 -0
  39. package/dist/style/popover.css +110 -0
  40. package/dist/style/post-item.css +134 -0
  41. package/dist/style/progress.css +34 -0
  42. package/dist/style/radio.css +126 -0
  43. package/dist/style/rate.css +44 -0
  44. package/dist/style/result.css +54 -0
  45. package/dist/style/segmented-picker.css +120 -0
  46. package/dist/style/segmented.css +190 -0
  47. package/dist/style/select.css +281 -0
  48. package/dist/style/skeleton.css +31 -0
  49. package/dist/style/slider.css +81 -0
  50. package/dist/style/sortable.css +128 -0
  51. package/dist/style/space.css +25 -0
  52. package/dist/style/spinner.css +27 -0
  53. package/dist/style/statistic.css +44 -0
  54. package/dist/style/steps.css +100 -0
  55. package/dist/style/switch.css +95 -0
  56. package/dist/style/table.css +379 -0
  57. package/dist/style/tabs.css +167 -0
  58. package/dist/style/tag.css +97 -0
  59. package/dist/style/timeline.css +521 -0
  60. package/dist/style/toast.css +37 -0
  61. package/dist/style/tooltip.css +45 -0
  62. package/dist/style/tree.css +189 -0
  63. package/dist/style/typography.css +66 -0
  64. package/dist/style/upload.css +169 -0
  65. package/dist/style/vlist.css +49 -0
  66. package/dist/style/vplayer.css +846 -0
  67. package/dist/wdesign-ui.css +10300 -0
  68. package/dist/wdesign-ui.esm.js +16333 -0
  69. package/package.json +47 -3
  70. package/tokens.json +385 -0
@@ -0,0 +1,96 @@
1
+ @charset "UTF-8";
2
+ .wd-form {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: 18px;
6
+ width: 100%;
7
+ }
8
+
9
+ .wd-form--disabled {
10
+ opacity: 0.6;
11
+ }
12
+
13
+ .wd-form-item {
14
+ display: flex;
15
+ flex-direction: column;
16
+ gap: 8px;
17
+ min-width: 0;
18
+ }
19
+
20
+ /* 标签在左侧:横向排布 */
21
+ .wd-form--label-left .wd-form-item {
22
+ flex-direction: row;
23
+ align-items: flex-start;
24
+ gap: 14px;
25
+ }
26
+
27
+ .wd-form--label-left .wd-form-item__label {
28
+ flex: none;
29
+ padding-top: 12px; /* 与控件首行文字对齐 */
30
+ text-align: right;
31
+ }
32
+
33
+ .wd-form-item__label {
34
+ font-size: 13px;
35
+ font-weight: 600;
36
+ color: var(--wd-ink-2);
37
+ line-height: 1.4;
38
+ display: inline-flex;
39
+ align-items: center;
40
+ gap: 3px;
41
+ }
42
+
43
+ .wd-form-item__req {
44
+ color: var(--wd-red-text);
45
+ font-weight: 700;
46
+ line-height: 1;
47
+ }
48
+
49
+ .wd-form-item__control {
50
+ flex: 1;
51
+ min-width: 0;
52
+ display: flex;
53
+ flex-direction: column;
54
+ gap: 6px;
55
+ }
56
+
57
+ /* ---- 状态:错误 ---- */
58
+ .wd-form-item--error :is(.wd-input, .wd-select__trigger, .wd-datepicker__trigger) {
59
+ box-shadow: 0 0 0 2px var(--wd-red-text);
60
+ }
61
+
62
+ .wd-form-item__error {
63
+ margin: 0;
64
+ font-size: 12.5px;
65
+ line-height: 1.5;
66
+ color: var(--wd-red-text);
67
+ display: flex;
68
+ align-items: center;
69
+ gap: 5px;
70
+ }
71
+
72
+ .wd-form-item__error::before {
73
+ content: "";
74
+ width: 5px;
75
+ height: 5px;
76
+ flex: none;
77
+ border-radius: 50%;
78
+ background: var(--wd-red-text);
79
+ }
80
+
81
+ .wd-form-item__hint {
82
+ margin: 0;
83
+ font-size: 12.5px;
84
+ line-height: 1.5;
85
+ color: var(--wd-ink-2);
86
+ }
87
+
88
+ /* ---- 状态:校验中 ---- */
89
+ .wd-form-item--validating .wd-form-item__control {
90
+ opacity: 0.75;
91
+ }
92
+
93
+ /* ---- 状态:通过(轻微标识,不喧宾夺主)---- */
94
+ .wd-form-item--success :is(.wd-input, .wd-select__trigger) {
95
+ box-shadow: 0 0 0 1px var(--wd-success-ink);
96
+ }
@@ -0,0 +1,4 @@
1
+ .wd-grid {
2
+ display: grid;
3
+ gap: var(--wd-space-4);
4
+ }
@@ -0,0 +1,478 @@
1
+ @charset "UTF-8";
2
+ .wd-group {
3
+ display: inline-flex;
4
+ align-items: stretch;
5
+ min-width: 0;
6
+ vertical-align: middle;
7
+ /* ⚠️ 不能 overflow:hidden —— 会裁掉子项的 focus ring */
8
+ }
9
+
10
+ .wd-group--block {
11
+ display: flex;
12
+ width: 100%;
13
+ }
14
+
15
+ .wd-group--col {
16
+ flex-direction: column;
17
+ align-items: stretch;
18
+ }
19
+
20
+ /* ---------------- 尺寸 ---------------- */
21
+ .wd-group--sm {
22
+ --wd-group-h: 32px;
23
+ --wd-group-pad: 10px;
24
+ --wd-group-fs: 12.5px;
25
+ }
26
+
27
+ .wd-group--md {
28
+ --wd-group-h: 40px;
29
+ --wd-group-pad: 14px;
30
+ --wd-group-fs: 13px;
31
+ }
32
+
33
+ .wd-group--lg {
34
+ --wd-group-h: 48px;
35
+ --wd-group-pad: 18px;
36
+ --wd-group-fs: 14px;
37
+ }
38
+
39
+ /* ---------------- 子项基础 ---------------- */
40
+ .wd-group__item {
41
+ flex: 0 0 auto;
42
+ min-width: 0;
43
+ display: inline-flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ gap: 6px;
47
+ min-height: var(--wd-group-h);
48
+ font-size: var(--wd-group-fs);
49
+ }
50
+
51
+ .wd-group--equal .wd-group__item {
52
+ flex: 1 1 0;
53
+ }
54
+
55
+ /* 让输入类子项能撑开 */
56
+ .wd-group--block .wd-group__item {
57
+ flex: 1 1 0;
58
+ }
59
+
60
+ /* ---------------- 子项「缴械」:去掉自带外框 ---------------- */
61
+ /*
62
+ * 组合容器统一提供背景与边框,子项必须变成「透明内容块」。
63
+ * 覆盖范围要够宽 —— 任何自带底色/边框/圆角的组件放进来都要被压平,
64
+ * 否则会出现「胶囊里套小胶囊」。
65
+ */
66
+ /*
67
+ * 「缴械」的边界要精确:
68
+ * 要去掉的是**容器级外框**(边框、阴影、外层圆角、块状底色)
69
+ * 要保留的是**组件语义色**(primary 按钮的红底、danger 的危险色)
70
+ *
71
+ * 第一版把 background 一刀切成 transparent,结果 primary 按钮
72
+ * 变成一片空白 —— 按钮还在,但看不出是按钮。
73
+ */
74
+ .wd-group--seamless > .wd-group__item {
75
+ border-radius: 0;
76
+ min-height: var(--wd-group-h);
77
+ }
78
+
79
+ /* 输入类 / 选择器:这些的底色就是"外框",要压平 */
80
+ .wd-group--seamless > .wd-group__item > .wd-input,
81
+ .wd-group--seamless > .wd-group__item > .wd-select {
82
+ background-color: transparent;
83
+ border: 0;
84
+ box-shadow: none;
85
+ border-radius: 0;
86
+ min-height: var(--wd-group-h);
87
+ }
88
+
89
+ /* 按钮:只去外框与圆角,保留 variant 决定的底色 */
90
+ .wd-group--seamless > .wd-group__item > .wd-btn {
91
+ border: 0;
92
+ box-shadow: none;
93
+ border-radius: 0;
94
+ min-height: var(--wd-group-h);
95
+ }
96
+
97
+ /* 输入类:内边距统一,文字左对齐(居中会怪) */
98
+ .wd-group--seamless > .wd-group__item > .wd-input,
99
+ .wd-group--seamless > .wd-group__item > .wd-select {
100
+ justify-content: flex-start;
101
+ padding-left: var(--wd-group-pad);
102
+ padding-right: var(--wd-group-pad);
103
+ width: 100%;
104
+ }
105
+
106
+ .wd-group--seamless > .wd-group__item > .wd-input > input {
107
+ flex: 1 1 auto;
108
+ min-width: 0;
109
+ }
110
+
111
+ /* 按钮类:保留可点区域,去掉自身圆角与外框 */
112
+ .wd-group--seamless > .wd-group__item > .wd-btn {
113
+ border-radius: 0;
114
+ height: 100%;
115
+ padding: 0 var(--wd-group-pad);
116
+ }
117
+
118
+ /* ---------------- 变体:胶囊 ---------------- */
119
+ /*
120
+ * 胶囊:浅底 + 全圆角,无边框。
121
+ * ⚠️ 之前留了 `border: 1px solid transparent` 想复用 joined 的逻辑,
122
+ * 但透明边框仍然占 1px 盒模型空间、也不符合无边框语言。
123
+ */
124
+ .wd-group--capsule {
125
+ background: var(--wd-field);
126
+ border-radius: var(--wd-radius-pill);
127
+ }
128
+
129
+ /*
130
+ * ⚠️ 圆角必须同时压到**内层控件**。
131
+ * 只给 .wd-group__item 设圆角没用 —— 真正有背景的是里面的 .wd-btn,
132
+ * 它的直角会盖住父级圆角,表现为「按钮右端被切平」。
133
+ */
134
+ /*
135
+ * 圆角覆盖要同时命中两种结构:
136
+ * A) <div class="item"><button class="wd-btn"> ← 控件在内部
137
+ * B) <button class="wd-btn item"> ← 控件本身就是 item
138
+ * B 更常见(按钮直接作为插槽子节点),第一版漏了它,
139
+ * 表现为「最后一个按钮右端被切平」。
140
+ */
141
+ /* 横向专用:用 :not(--col) 排除纵向,避免与纵向规则互相覆盖 */
142
+ .wd-group--row.wd-group--capsule > .wd-group__item--first,
143
+ .wd-group--row.wd-group--capsule > .wd-group__item--first > * {
144
+ border-radius: var(--wd-radius-pill) 0 0 var(--wd-radius-pill) !important;
145
+ }
146
+
147
+ .wd-group--row.wd-group--capsule > .wd-group__item--last,
148
+ .wd-group--row.wd-group--capsule > .wd-group__item--last > * {
149
+ border-radius: 0 var(--wd-radius-pill) var(--wd-radius-pill) 0 !important;
150
+ }
151
+
152
+ .wd-group--capsule > .wd-group__item--only,
153
+ .wd-group--capsule > .wd-group__item--only > * {
154
+ border-radius: var(--wd-radius-pill) !important;
155
+ }
156
+
157
+ /*
158
+ * 纵向胶囊。
159
+ *
160
+ * 横向胶囊的圆角是"整条高度的一半"(pill),
161
+ * 纵向时这个语义反过来:上端只圆上面两角、下端只圆下面两角,
162
+ * 且半径应等于**容器宽度的一半**才能形成真正的胶囊端头。
163
+ * 这里用 50% 而不是 pill 令牌 —— 令牌是固定 px,纵向会算错。
164
+ */
165
+ /*
166
+ * ⚠️ 不能用 overflow:hidden 做端头圆角 —— 会裁掉子项的 focus ring
167
+ * (这是本库已记录过的坑)。
168
+ * 改用「按容器宽度算半径」:纵向胶囊的端头半径 = 宽度的一半。
169
+ * 容器宽度由 CSS 变量传入,组件那边不用改。
170
+ */
171
+ .wd-group--capsule.wd-group--col > .wd-group__item,
172
+ .wd-group--capsule.wd-group--col > .wd-group__item > * {
173
+ border-radius: 0 !important;
174
+ }
175
+
176
+ /* 上端:只圆上面两角;下同 */
177
+ .wd-group--capsule.wd-group--col > .wd-group__item--first,
178
+ .wd-group--capsule.wd-group--col > .wd-group__item--first > * {
179
+ border-radius: 50vw 50vw 0 0 !important;
180
+ }
181
+
182
+ .wd-group--capsule.wd-group--col > .wd-group__item--last,
183
+ .wd-group--capsule.wd-group--col > .wd-group__item--last > * {
184
+ border-radius: 0 0 50vw 50vw !important;
185
+ }
186
+
187
+ /*
188
+ * 纵向末项是实心按钮(primary)时,圆角要跟随按钮自身的背景块。
189
+ * 之前只给 .wd-group__item 设了,按钮内部还有一层背景色块
190
+ * 会把圆角盖掉,看起来像"下缘被切平"。
191
+ */
192
+ /*
193
+ * 纵向末项若自身是实心按钮:圆角要作用在按钮自身背景上。
194
+ * 之前只写了 `> .wd-btn`(子元素),漏掉了「自己就是按钮」的情况。
195
+ */
196
+ .wd-group--capsule.wd-group--col > .wd-group__item--last.wd-btn,
197
+ .wd-group--capsule.wd-group--col > .wd-group__item--last > .wd-btn {
198
+ border-radius: 0 0 50vw 50vw !important;
199
+ }
200
+
201
+ /* 首个若自身是按钮也一样 */
202
+ .wd-group--capsule.wd-group--col > .wd-group__item--first.wd-btn,
203
+ .wd-group--capsule.wd-group--col > .wd-group__item--first > .wd-btn {
204
+ border-radius: 50vw 50vw 0 0 !important;
205
+ }
206
+
207
+ /* 纵向 joined:普通圆角即可 */
208
+ /*
209
+ * 纵向 joined 的圆角。
210
+ * ⚠️ 必须同时覆盖「自身是按钮」的情况 —— 按钮直接做插槽子节点时,
211
+ * `> *` 选不中它自己。
212
+ */
213
+ .wd-group--col > .wd-group__item,
214
+ .wd-group--col > .wd-group__item > * {
215
+ border-radius: 0 !important;
216
+ }
217
+
218
+ /*
219
+ * 纵向的端头圆角用 --wd-radius-md,**不用 pill**。
220
+ *
221
+ * 原因:pill(999px)在纵向时会把首项顶边做成半圆拱、末项底边做成半圆拱 ——
222
+ * 视觉上像两个胶囊叠在一起,非常怪。胶囊的语义是"横向的胶囊形",
223
+ * 只在横向(row)成立;纵向应该退回常规圆角。
224
+ */
225
+ .wd-group--col > .wd-group__item--first,
226
+ .wd-group--col > .wd-group__item--first > * {
227
+ border-radius: var(--wd-radius-md) var(--wd-radius-md) 0 0 !important;
228
+ }
229
+
230
+ .wd-group--col > .wd-group__item--last,
231
+ .wd-group--col > .wd-group__item--last > * {
232
+ border-radius: 0 0 var(--wd-radius-md) var(--wd-radius-md) !important;
233
+ }
234
+
235
+ /* 只有 capsule 才用 pill 端头 */
236
+ .wd-group--capsule.wd-group--col > .wd-group__item--first,
237
+ .wd-group--capsule.wd-group--col > .wd-group__item--first > * {
238
+ border-radius: 50vw 50vw 0 0 !important;
239
+ }
240
+
241
+ .wd-group--capsule.wd-group--col > .wd-group__item--last,
242
+ .wd-group--capsule.wd-group--col > .wd-group__item--last > * {
243
+ border-radius: 0 0 50vw 50vw !important;
244
+ }
245
+
246
+ /* 胶囊内的按钮:hover 时整块变浅,不单独做胶囊 */
247
+ /*
248
+ * 胶囊内的按钮:
249
+ * ghost / tint 这类浅底变体在组合里会显得"脏"(同一容器里两种底色),
250
+ * 统一改为透明 + 悬停才浮起。
251
+ * primary 等实心变体保留自身底色(它是强调,不该被压平)。
252
+ */
253
+ /*
254
+ * ⚠️ 子控件可能「自身就是 .wd-group__item」(按钮直接做插槽子节点),
255
+ * 也可能是它的子元素。两种都要命中,否则规则形同虚设。
256
+ */
257
+ /*
258
+ * 去掉子按钮的底色时**必须用 background-color**,不能用 background 简写。
259
+ *
260
+ * ⚠️ 踩坑记录:写 `background: transparent` 会被编译成 `background: none`,
261
+ * 而简写里的 `none` 只重置 background-image,**不清除 background-color** ——
262
+ * 于是 .wd-btn--tint 的粉色依然生效,规则看起来"完全没起作用"。
263
+ * 这个问题很难查,因为选择器匹配、!important 都是对的。
264
+ */
265
+ /*
266
+ * 压制子按钮的浅色底。
267
+ *
268
+ * ⚠️ 踩坑记录(很值得记):
269
+ * 这条规则加了 !important 也"不生效" —— 实测计算值一直是粉色。
270
+ * 排查很久后发现根本原因**不在选择器**,而是:
271
+ * .wd-btn 上有 `transition: background 0.12s`,在动画时钟停摆的环境
272
+ * (后台标签页 / 无头渲染)里 transition 永远停在起始值,
273
+ * `getAnimations()` 显示 background-color 一直处于 running 状态,
274
+ * 于是 computed style 恒为旧值 —— 看起来就像"样式没生效"。
275
+ *
276
+ * 修法:**背景色不做 transition**。这类"压制"性质的样式切换,
277
+ * 本来也不需要动画。
278
+ */
279
+ .wd-group--capsule > .wd-group__item.wd-btn--tint,
280
+ .wd-group--capsule > .wd-group__item.wd-btn--ghost,
281
+ .wd-group--capsule > .wd-group__item > .wd-btn--tint,
282
+ .wd-group--capsule > .wd-group__item > .wd-btn--ghost {
283
+ background-color: transparent !important;
284
+ /* 关键:切断 transition,否则背景色会卡在旧值(时钟停摆时永远不完成) */
285
+ transition: none !important;
286
+ }
287
+
288
+ .wd-group--capsule > .wd-group__item.wd-btn--tint:hover:not(:disabled),
289
+ .wd-group--capsule > .wd-group__item.wd-btn--ghost:hover:not(:disabled),
290
+ .wd-group--capsule > .wd-group__item > .wd-btn--tint:hover:not(:disabled),
291
+ .wd-group--capsule > .wd-group__item > .wd-btn--ghost:hover:not(:disabled) {
292
+ background-color: rgba(0, 0, 0, 0.05) !important;
293
+ transition: none !important;
294
+ }
295
+
296
+ /* ---------------- 变体:拼合 ---------------- */
297
+ /*
298
+ * joined:外缘圆角、内部直角拼接。
299
+ *
300
+ * ⚠️ 容器**不设背景**。
301
+ * 之前给 joined 容器铺 --wd-card 白底 + 阴影,结果:
302
+ * · 子项本身也是白底(按钮/输入框),两层白叠着看不出区分
303
+ * · 圆角处容器白底从子项缝隙里透出来 → 出现"白边"
304
+ * 无边框语言里,拼合的分段靠**子项自身的底色**区分即可,
305
+ * 容器只是几何容器,不该有可见的填充。
306
+ */
307
+ .wd-group--joined {
308
+ background: transparent;
309
+ border-radius: var(--wd-radius-md);
310
+ }
311
+
312
+ .wd-group--row.wd-group--joined > .wd-group__item--first,
313
+ .wd-group--row.wd-group--joined > .wd-group__item--first > * {
314
+ border-radius: var(--wd-radius-pill) 0 0 var(--wd-radius-pill) !important;
315
+ }
316
+
317
+ .wd-group--row.wd-group--joined > .wd-group__item--last,
318
+ .wd-group--row.wd-group--joined > .wd-group__item--last > * {
319
+ border-radius: 0 var(--wd-radius-pill) var(--wd-radius-pill) 0 !important;
320
+ }
321
+
322
+ .wd-group--row.wd-group--joined > .wd-group__item--only,
323
+ .wd-group--row.wd-group--joined > .wd-group__item--only > * {
324
+ border-radius: var(--wd-radius-pill) !important;
325
+ }
326
+
327
+ /* 纵向退回常规圆角(pill 在纵向会变成半圆拱) */
328
+ .wd-group--joined.wd-group--col > .wd-group__item--first {
329
+ border-radius: var(--wd-radius-md) var(--wd-radius-md) 0 0;
330
+ }
331
+
332
+ .wd-group--joined.wd-group--col > .wd-group__item--last {
333
+ border-radius: 0 0 var(--wd-radius-md) var(--wd-radius-md);
334
+ }
335
+
336
+ /*
337
+ * 分段之间**不画任何分隔线**。
338
+ *
339
+ * 设计语言是「无边框 · 色块分层」,分隔靠**底色差 + 留白 + 外缘圆角**表达。
340
+ * 曾经用 ::before 画 1px 线(横 40% / 纵 40px),问题在于:
341
+ * · 灰线在白底上永远是"多出来的东西",纵向时像一条莫名其妙的竖杠
342
+ * · 线宽在不同缩放下会取整成 2px,比背景还显眼
343
+ * · 每个 variant × direction 都要单独调位置,容易漏
344
+ * 去掉后拼合仍然成立 —— 圆角 + 相邻底色已经足够暗示分段。
345
+ */
346
+ /* ---------------- 变体:内嵌 ---------------- */
347
+ /*
348
+ * 容器是「底色凹槽」,子项浮在上面。
349
+ * 适合:搜索框、分段切换、小工具条。
350
+ */
351
+ /*
352
+ * inset:凹槽底 + 子项浮起。
353
+ *
354
+ * ⚠️ 之前和 joined 几乎看不出区别(都是浅底 + 圆角)。
355
+ * 差异要在「内距 + 子项自身底色」上做出来:
356
+ * inset = 容器是深一档的凹槽,子项选中时有白底浮起
357
+ * joined = 容器与子项同色,只靠外缘圆角和分隔线拼合
358
+ */
359
+ .wd-group--inset {
360
+ background: var(--wd-field);
361
+ border-radius: var(--wd-radius-md);
362
+ padding: 4px;
363
+ gap: 3px;
364
+ box-shadow: none;
365
+ }
366
+
367
+ /* inset 的子项默认透明,悬停/选中才有底色(浮起感) */
368
+ .wd-group--inset > .wd-group__item {
369
+ border-radius: var(--wd-radius-xs) !important;
370
+ transition: background var(--wd-dur-fast) ease, box-shadow var(--wd-dur-fast) ease;
371
+ }
372
+
373
+ .wd-group--inset > .wd-group__item:hover {
374
+ background-color: var(--wd-field-hover);
375
+ }
376
+
377
+ .wd-group--inset > .wd-group__item > .wd-btn--primary {
378
+ background-color: var(--wd-card);
379
+ box-shadow: var(--wd-shadow-sm);
380
+ }
381
+
382
+ .wd-group--inset > .wd-group__item {
383
+ border-radius: var(--wd-radius-xs);
384
+ transition: background var(--wd-dur-fast) ease;
385
+ }
386
+
387
+ .wd-group--inset > .wd-group__item:hover {
388
+ background: var(--wd-field-hover);
389
+ }
390
+
391
+ /* inset 靠间距区分,不画分隔线 */
392
+ /* 纵向:每一项都要撑满宽度,否则会各自缩成一团 */
393
+ .wd-group--col > .wd-group__item {
394
+ width: 100%;
395
+ }
396
+
397
+ .wd-group--col > .wd-group__item > .wd-btn,
398
+ .wd-group--col > .wd-group__item > .wd-input {
399
+ width: 100%;
400
+ }
401
+
402
+ /* ---------------- 焦点与禁用 ---------------- */
403
+ /*
404
+ * 焦点环**只在 group 容器上画一次**。
405
+ *
406
+ * ⚠️ 曾经的重叠问题:
407
+ * 1. `.wd-input:focus-within` 给自己加了 4px 环
408
+ * 2. `.wd-group:focus-within` 又给容器加了一圈
409
+ * 3. 上面那条 `.wd-group__item:focus-within` 再叠一层 outline
410
+ * 三层环同色但半径不同,叠起来就是截图里那种"粗重、边缘不齐"的框。
411
+ *
412
+ * 规则:**组内所有子控件一律放弃自己的焦点环**,
413
+ * 由 group 统一表达"这里有焦点"。这也符合"一个整体只有一个边界"的语义。
414
+ */
415
+ /* 组内子控件统统缴械:不管它是 input、select、button 还是自定义控件 */
416
+ .wd-group .wd-input:focus-within,
417
+ .wd-group .wd-select:focus-within,
418
+ .wd-group .wd-btn:focus-visible,
419
+ .wd-group .wd-cascader:focus-within,
420
+ .wd-group .wd-datepicker:focus-within,
421
+ .wd-group .wd-colorpicker:focus-visible,
422
+ .wd-group [class*=__item]:focus-within,
423
+ .wd-group [class*=__item]:focus-visible {
424
+ box-shadow: none !important;
425
+ outline: none !important;
426
+ }
427
+
428
+ /*
429
+ * 焦点项提升层级:否则后一项的背景会盖住前一项的边。
430
+ * 注意这里**不画任何环**,只提层级 —— 环由 group 负责。
431
+ */
432
+ .wd-group__item:focus-within {
433
+ position: relative;
434
+ z-index: 2;
435
+ }
436
+
437
+ .wd-group--disabled {
438
+ opacity: 0.55;
439
+ pointer-events: none;
440
+ }
441
+
442
+ /* ---------------- 子项是纯文字/图标时的对齐 ---------------- */
443
+ .wd-group__item > span,
444
+ .wd-group__item > svg {
445
+ flex: none;
446
+ }
447
+
448
+ .wd-group__item--static {
449
+ color: var(--wd-ink-2);
450
+ padding: 0 calc(var(--wd-group-pad) * 0.7);
451
+ font-weight: 600;
452
+ user-select: none;
453
+ }
454
+
455
+ /* =============================================================
456
+ * 选中态高亮:呼吸光环
457
+ *
458
+ * ===== 为什么需要改 =====
459
+ * 拼接(joined)布局里相邻项的边缘是完全贴合的:
460
+ * 选中项如果画**外**描边或阴影,就会被后一项的背景盖掉一半,
461
+ * 看起来像"边框重叠"或"只画了三条边"。
462
+ *
463
+ * ===== 做法 =====
464
+ * 1. 用 `inset` 内阴影而不是外描边 —— 内阴影永远在元素内部,
465
+ * 不会被相邻项遮挡
466
+ * 2. 叠在 :focus-within / .is-active 上,用极缓慢的透明度呼吸
467
+ * (2.6s,往返),提示"这里是当前项"但不刺眼
468
+ * 3. 拼接布局加 2px 间隙:视觉上仍是连续的,但边缘不再互相压
469
+ * ============================================================= */
470
+ /*
471
+ * 选中态(.is-active):只在项**内部**画一层内阴影。
472
+ * 内阴影不会被相邻项遮挡,也不会和 group 的焦点环冲突 ——
473
+ * 它是"这一项被选中",而 group 环是"焦点在这个组合里",语义不同。
474
+ */
475
+ .wd-group__item.is-active {
476
+ position: relative;
477
+ z-index: 1;
478
+ }
@@ -0,0 +1,75 @@
1
+ @charset "UTF-8";
2
+ .wd-icon-btn {
3
+ display: inline-flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ flex: none;
7
+ width: 36px;
8
+ height: 36px;
9
+ border: 0;
10
+ border-radius: 50%;
11
+ background: var(--wd-field);
12
+ color: var(--wd-ink-2);
13
+ cursor: pointer;
14
+ transition: background var(--wd-dur-fast) ease, color var(--wd-dur-fast) ease, transform var(--wd-dur-fast) ease;
15
+ }
16
+
17
+ @media (hover: hover) {
18
+ .wd-icon-btn:hover {
19
+ background: var(--wd-field-hover);
20
+ color: var(--wd-ink);
21
+ }
22
+ }
23
+ /* JS 增强(addHover):同一份声明,由 .is-hover 驱动,不受 hover 媒体查询限制 */
24
+ .wd-icon-btn.is-hover {
25
+ background: var(--wd-field-hover);
26
+ color: var(--wd-ink);
27
+ }
28
+
29
+ .wd-icon-btn:focus-visible {
30
+ outline: none;
31
+ box-shadow: 0 0 0 4px var(--wd-focus-ring-soft);
32
+ }
33
+
34
+ .wd-icon-btn--ghost {
35
+ background: transparent;
36
+ }
37
+
38
+ @media (hover: hover) {
39
+ .wd-icon-btn--ghost:hover {
40
+ background: var(--wd-field-hover);
41
+ color: var(--wd-ink);
42
+ }
43
+ }
44
+ .wd-icon-btn--ghost.is-hover {
45
+ background: var(--wd-field-hover);
46
+ color: var(--wd-ink);
47
+ }
48
+
49
+ .wd-icon-btn--sm {
50
+ width: 30px;
51
+ height: 30px;
52
+ }
53
+
54
+ .wd-icon-btn--lg {
55
+ width: 40px;
56
+ height: 40px;
57
+ }
58
+
59
+ /* ---- 微交互(精致版)---- */
60
+ .wd-icon-btn {
61
+ transition: background var(--wd-dur-fast) var(--wd-ease-out), color var(--wd-dur-fast) var(--wd-ease-out), box-shadow var(--wd-dur) var(--wd-ease-out);
62
+ }
63
+
64
+ @media (hover: hover) {
65
+ .wd-icon-btn:hover {
66
+ box-shadow: 0 0 0 6px var(--wd-tint-1);
67
+ }
68
+ }
69
+ .wd-icon-btn.is-hover {
70
+ box-shadow: 0 0 0 6px var(--wd-tint-1);
71
+ }
72
+
73
+ .wd-icon-btn:active {
74
+ box-shadow: 0 0 0 3px var(--wd-ink-5);
75
+ }