@manohub/ui 0.10.5 → 1.0.1
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/README.md +155 -155
- package/dist/components/form/index.js +8 -1
- package/dist/components/input/bordered.d.ts +15 -0
- package/dist/components/input/bordered.js +8 -0
- package/dist/components/input/index.d.ts +82 -31
- package/dist/components/input/index.js +16 -6
- package/dist/components/input/number-input.d.ts +239 -0
- package/dist/components/input/number-input.js +240 -0
- package/dist/components/select/index.d.ts +19 -0
- package/dist/components/select/index.js +10 -0
- package/dist/components/select/select-tree.d.ts +11 -0
- package/dist/components/select/select-tree.js +6 -0
- package/dist/components/select/select-trigger.d.ts +17 -0
- package/dist/components/select/select-trigger.js +9 -0
- package/dist/components/table/index.d.ts +85 -10
- package/dist/components/table/index.js +38 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -0
- package/dist/styles/components/avatar.css +131 -131
- package/dist/styles/components/avatar.tokens.css +24 -24
- package/dist/styles/components/badge.css +266 -266
- package/dist/styles/components/badge.tokens.css +24 -24
- package/dist/styles/components/button.css +460 -460
- package/dist/styles/components/capsule.css +128 -128
- package/dist/styles/components/capsule.tokens.css +27 -27
- package/dist/styles/components/card.css +198 -198
- package/dist/styles/components/checkbox.css +145 -145
- package/dist/styles/components/checkbox.tokens.css +26 -26
- package/dist/styles/components/code-block.css +216 -216
- package/dist/styles/components/code-block.tokens.css +40 -40
- package/dist/styles/components/collapse.css +62 -62
- package/dist/styles/components/collapse.tokens.css +20 -20
- package/dist/styles/components/dialog.css +158 -158
- package/dist/styles/components/dialog.tokens.css +24 -24
- package/dist/styles/components/divider.css +75 -75
- package/dist/styles/components/divider.tokens.css +22 -22
- package/dist/styles/components/drawer.css +143 -143
- package/dist/styles/components/drawer.tokens.css +22 -22
- package/dist/styles/components/filter.css +29 -29
- package/dist/styles/components/form.css +456 -425
- package/dist/styles/components/form.tokens.css +19 -15
- package/dist/styles/components/input.css +659 -538
- package/dist/styles/components/input.tokens.css +43 -43
- package/dist/styles/components/layout.css +200 -200
- package/dist/styles/components/list-view.css +244 -244
- package/dist/styles/components/loading.css +76 -76
- package/dist/styles/components/loading.tokens.css +23 -23
- package/dist/styles/components/nav.css +48 -48
- package/dist/styles/components/notice.css +153 -153
- package/dist/styles/components/notice.tokens.css +17 -17
- package/dist/styles/components/notification.css +159 -159
- package/dist/styles/components/notification.tokens.css +37 -37
- package/dist/styles/components/page.css +473 -473
- package/dist/styles/components/pagination.css +303 -303
- package/dist/styles/components/pagination.tokens.css +32 -32
- package/dist/styles/components/panel.css +77 -77
- package/dist/styles/components/query-state.css +88 -88
- package/dist/styles/components/radio.css +271 -271
- package/dist/styles/components/radio.tokens.css +26 -26
- package/dist/styles/components/search.css +34 -34
- package/dist/styles/components/select.css +326 -326
- package/dist/styles/components/select.tokens.css +44 -44
- package/dist/styles/components/skeleton.css +60 -60
- package/dist/styles/components/skeleton.tokens.css +27 -27
- package/dist/styles/components/steps.css +205 -205
- package/dist/styles/components/steps.tokens.css +44 -44
- package/dist/styles/components/switch.css +165 -165
- package/dist/styles/components/switch.tokens.css +26 -26
- package/dist/styles/components/tabbar.css +235 -235
- package/dist/styles/components/tabbar.tokens.css +30 -30
- package/dist/styles/components/table.css +510 -504
- package/dist/styles/components/table.tokens.css +44 -44
- package/dist/styles/components/tag.css +127 -127
- package/dist/styles/components/tag.tokens.css +24 -24
- package/dist/styles/components/toast.css +185 -185
- package/dist/styles/components/toast.tokens.css +26 -26
- package/dist/styles/components/tooltip.css +89 -89
- package/dist/styles/components/tooltip.tokens.css +25 -25
- package/dist/styles/components/tree.css +173 -173
- package/dist/styles/components/upload.css +151 -151
- package/dist/styles/components/upload.tokens.css +27 -27
- package/dist/styles/index.css +153 -153
- package/dist/styles/operations/collapse.css +84 -84
- package/dist/styles/operations/popup.css +193 -193
- package/dist/styles/operations/tabs.css +82 -82
- package/package.json +62 -62
|
@@ -1,235 +1,235 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TabBar —— 页签条(下划线指示条 + 禁用 + 「更多」页签)。
|
|
3
|
-
*
|
|
4
|
-
* 出处:`@aihub/theme` 的 `playground/components/tabbar.css` 与 `src/components/tabbar.css`
|
|
5
|
-
* (区高 26 / 项间距 30 / 字号 14 / 指示条高 3、距文字 3、两端与文字同宽 / 未选字 `#446a9f` /
|
|
6
|
-
* 滑过 `#529dff` / 选中 `#4e94ff` / 禁用 Te07)。
|
|
7
|
-
*
|
|
8
|
-
* 三条必须照做的几何(做错一眼就歪):
|
|
9
|
-
*
|
|
10
|
-
* 1. **不画轨线**:规范明确警告 —— 页签区没有底边框,选中只由指示条表达;加轨线会扣走区高 1px。
|
|
11
|
-
* 「像不像页签」全靠那道 3px 指示条,不靠一条横线。
|
|
12
|
-
* 2. **指示条是每个项自己的伪元素**(`::after`),不是一条共享滑块:所有项的指示条常驻,未选 `opacity:0; scale:.75`,
|
|
13
|
-
* 选中转 `opacity:1; scale:1` —— "滑过去"的观感来自这两个属性的过渡(`display` 直切补间不了)。
|
|
14
|
-
* 3. **文字贴底**:项高 26 = 文字框 20 + 留白 3 + 指示条 3,故 `align-items:flex-end` +
|
|
15
|
-
* `padding-bottom = indicator-gap + indicator-height`。少了这段内距,指示条会压在字上。
|
|
16
|
-
*
|
|
17
|
-
* **三源等价**(本仓通例):原生 `:checked +` / 组件下发 `[data-state='active']` / 静态档 `.is-selected`
|
|
18
|
-
* 指向同一份声明 —— 原生态给零 JS 用法(原生 radio 互斥 + ← → 换页签),组件态给受控值。
|
|
19
|
-
*/
|
|
20
|
-
.mh-tabbar {
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: flex-end;
|
|
23
|
-
gap: var(--ui-tabbar-gap);
|
|
24
|
-
height: var(--ui-tabbar-height);
|
|
25
|
-
flex-shrink: 0;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.mh-tabbar__tab {
|
|
29
|
-
position: relative;
|
|
30
|
-
display: inline-flex;
|
|
31
|
-
align-items: flex-end;
|
|
32
|
-
height: 100%;
|
|
33
|
-
padding: 0 0 calc(var(--ui-tabbar-indicator-gap) + var(--ui-tabbar-indicator-height));
|
|
34
|
-
border: none;
|
|
35
|
-
background: transparent;
|
|
36
|
-
font-family: inherit;
|
|
37
|
-
font-size: var(--ui-tabbar-font-size);
|
|
38
|
-
line-height: var(--ui-line-body);
|
|
39
|
-
color: var(--ui-tabbar-text);
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
white-space: nowrap;
|
|
42
|
-
}
|
|
43
|
-
/* 指示条:常驻、与文字同宽(不内缩),靠 opacity + scale 过渡出"滑动感" */
|
|
44
|
-
.mh-tabbar__tab::after {
|
|
45
|
-
content: '';
|
|
46
|
-
position: absolute;
|
|
47
|
-
right: 0;
|
|
48
|
-
bottom: 0;
|
|
49
|
-
left: 0;
|
|
50
|
-
height: var(--ui-tabbar-indicator-height);
|
|
51
|
-
border-radius: var(--ui-tabbar-indicator-radius);
|
|
52
|
-
background: var(--ui-tabbar-indicator);
|
|
53
|
-
opacity: 0;
|
|
54
|
-
scale: 0.75;
|
|
55
|
-
transition-property: opacity, scale;
|
|
56
|
-
transition-duration: 0.15s;
|
|
57
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.mh-tabbar__tab:hover {
|
|
61
|
-
color: var(--ui-tabbar-text-hover);
|
|
62
|
-
}
|
|
63
|
-
.mh-tabbar__tab:active {
|
|
64
|
-
color: var(--ui-tabbar-text-active);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* 选中(三源等价):字转主色 + 中粗,指示条亮起 */
|
|
68
|
-
.mh-tabbar__tab.is-selected,
|
|
69
|
-
.mh-tabbar__tab[data-state='active'],
|
|
70
|
-
.mh-tabbar > input:checked + .mh-tabbar__tab {
|
|
71
|
-
color: var(--ui-tabbar-text-active);
|
|
72
|
-
font-weight: var(--ui-weight-medium);
|
|
73
|
-
}
|
|
74
|
-
.mh-tabbar__tab.is-selected::after,
|
|
75
|
-
.mh-tabbar__tab[data-state='active']::after,
|
|
76
|
-
.mh-tabbar > input:checked + .mh-tabbar__tab::after {
|
|
77
|
-
opacity: 1;
|
|
78
|
-
scale: 1;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/* 禁用(三源等价):字转弱、不可点 */
|
|
82
|
-
.mh-tabbar__tab.is-disabled,
|
|
83
|
-
.mh-tabbar__tab:disabled,
|
|
84
|
-
.mh-tabbar > input:disabled + .mh-tabbar__tab {
|
|
85
|
-
color: var(--ui-tabbar-text-disabled);
|
|
86
|
-
cursor: not-allowed;
|
|
87
|
-
}
|
|
88
|
-
.mh-tabbar__tab.is-disabled::after,
|
|
89
|
-
.mh-tabbar__tab:disabled::after,
|
|
90
|
-
.mh-tabbar > input:disabled + .mh-tabbar__tab::after {
|
|
91
|
-
opacity: 0;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/* 「更多」页签:文字 + 转向箭头(字形来自 `@manohub/icon`,本层只排布) */
|
|
95
|
-
.mh-tabbar__tab--more {
|
|
96
|
-
display: inline-flex;
|
|
97
|
-
align-items: center;
|
|
98
|
-
gap: var(--ui-space-1);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/* 原生路径的隐身开关:可聚焦但不可见(焦点环画在可见的项上) */
|
|
102
|
-
.mh-tabbar > input {
|
|
103
|
-
position: absolute;
|
|
104
|
-
width: 1px;
|
|
105
|
-
height: 1px;
|
|
106
|
-
margin: -1px;
|
|
107
|
-
padding: 0;
|
|
108
|
-
border: 0;
|
|
109
|
-
overflow: hidden;
|
|
110
|
-
white-space: nowrap;
|
|
111
|
-
clip-path: inset(50%);
|
|
112
|
-
appearance: none;
|
|
113
|
-
pointer-events: none;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/* 键盘焦点环(两条路径各一处,不重叠) */
|
|
117
|
-
.mh-tabbar__tab:focus-visible,
|
|
118
|
-
.mh-tabbar > input:focus-visible + .mh-tabbar__tab {
|
|
119
|
-
outline: 2px solid var(--ui-primary);
|
|
120
|
-
outline-offset: -2px;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/* ===== 居中档:页签少、要撑满整行时用 ===== */
|
|
124
|
-
.mh-tabbar--centered {
|
|
125
|
-
justify-content: center;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/* ===== 尺寸档(只覆盖令牌) ===== */
|
|
129
|
-
.mh-tabbar--sm {
|
|
130
|
-
--ui-tabbar-height: var(--ui-control-height-sm);
|
|
131
|
-
--ui-tabbar-font-size: var(--ui-font-caption);
|
|
132
|
-
--ui-tabbar-gap: var(--ui-space-6);
|
|
133
|
-
}
|
|
134
|
-
.mh-tabbar--lg {
|
|
135
|
-
--ui-tabbar-height: var(--ui-control-height-lg);
|
|
136
|
-
--ui-tabbar-font-size: var(--ui-font-heading);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/* ===== 选项卡形态(type="card") =====
|
|
140
|
-
* 与内容区连成一体:页签有边框与浅底,选中项转白底 + 顶部主色条;
|
|
141
|
-
* 底边刻意不画 —— 让内容区自己的上边框接上(面板的 bordered 档就是为此)。 */
|
|
142
|
-
.mh-tabbar--card {
|
|
143
|
-
align-items: flex-end;
|
|
144
|
-
gap: var(--ui-space-1);
|
|
145
|
-
height: auto;
|
|
146
|
-
}
|
|
147
|
-
.mh-tabbar--card .mh-tabbar__tab {
|
|
148
|
-
align-items: center;
|
|
149
|
-
height: var(--ui-tabbar-height);
|
|
150
|
-
padding: 0 var(--ui-tabbar-card-padding-x);
|
|
151
|
-
border: 1px solid var(--ui-base-300);
|
|
152
|
-
border-bottom: none;
|
|
153
|
-
border-radius: var(--ui-radius-control) var(--ui-radius-control) 0 0;
|
|
154
|
-
background: var(--ui-base-200);
|
|
155
|
-
color: var(--ui-base-content-muted);
|
|
156
|
-
}
|
|
157
|
-
/* 卡片档不画指示条:选中由底色与顶边表达(两套选中语汇叠在一起会互相打架) */
|
|
158
|
-
.mh-tabbar--card .mh-tabbar__tab::after {
|
|
159
|
-
content: none;
|
|
160
|
-
}
|
|
161
|
-
.mh-tabbar--card .mh-tabbar__tab:hover {
|
|
162
|
-
color: var(--ui-primary);
|
|
163
|
-
}
|
|
164
|
-
.mh-tabbar--card .mh-tabbar__tab.is-selected,
|
|
165
|
-
.mh-tabbar--card .mh-tabbar__tab[data-state='active'],
|
|
166
|
-
.mh-tabbar--card > input:checked + .mh-tabbar__tab {
|
|
167
|
-
background: var(--ui-base-100);
|
|
168
|
-
color: var(--ui-primary);
|
|
169
|
-
box-shadow: inset 0 2px 0 var(--ui-primary);
|
|
170
|
-
}
|
|
171
|
-
.mh-tabbar--card .mh-tabbar__tab.is-disabled {
|
|
172
|
-
background: var(--ui-base-200);
|
|
173
|
-
color: var(--ui-tabbar-text-disabled);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/* ===== 关闭位 =====
|
|
177
|
-
* 页签自己是 `<button>`,所以关闭位用 `<span role="button">`(按钮里嵌按钮是非法 HTML);
|
|
178
|
-
* 线上档的文字是「贴底」的,故关闭位要自己把底部内距补回来才与文字同一水平线。 */
|
|
179
|
-
.mh-tabbar__close {
|
|
180
|
-
display: inline-flex;
|
|
181
|
-
align-items: center;
|
|
182
|
-
justify-content: center;
|
|
183
|
-
align-self: center;
|
|
184
|
-
flex: none;
|
|
185
|
-
width: 16px;
|
|
186
|
-
height: 16px;
|
|
187
|
-
margin-bottom: calc(var(--ui-tabbar-indicator-gap) + var(--ui-tabbar-indicator-height));
|
|
188
|
-
margin-left: var(--ui-space-1);
|
|
189
|
-
border-radius: var(--ui-radius-full);
|
|
190
|
-
color: inherit;
|
|
191
|
-
cursor: pointer;
|
|
192
|
-
opacity: 0.5;
|
|
193
|
-
transition: opacity 0.15s ease, background-color 0.15s ease;
|
|
194
|
-
}
|
|
195
|
-
.mh-tabbar--card .mh-tabbar__close {
|
|
196
|
-
margin-bottom: 0;
|
|
197
|
-
}
|
|
198
|
-
.mh-tabbar__close > svg {
|
|
199
|
-
width: 12px;
|
|
200
|
-
height: 12px;
|
|
201
|
-
}
|
|
202
|
-
.mh-tabbar__close:hover {
|
|
203
|
-
opacity: 1;
|
|
204
|
-
background: rgb(0 0 0 / 0.08);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/* ===== 新增位 ===== */
|
|
208
|
-
.mh-tabbar__add {
|
|
209
|
-
display: inline-flex;
|
|
210
|
-
align-items: center;
|
|
211
|
-
justify-content: center;
|
|
212
|
-
flex: none;
|
|
213
|
-
width: var(--ui-tabbar-height);
|
|
214
|
-
height: var(--ui-tabbar-height);
|
|
215
|
-
padding: 0;
|
|
216
|
-
border: none;
|
|
217
|
-
border-radius: var(--ui-radius-control);
|
|
218
|
-
background: transparent;
|
|
219
|
-
color: var(--ui-base-content-muted);
|
|
220
|
-
cursor: pointer;
|
|
221
|
-
transition: background-color 0.15s ease, color 0.15s ease;
|
|
222
|
-
}
|
|
223
|
-
.mh-tabbar__add > svg {
|
|
224
|
-
width: var(--ui-font-icon); /* 常规图标档 */
|
|
225
|
-
height: var(--ui-font-icon);
|
|
226
|
-
}
|
|
227
|
-
/* 「更多」的折叠箭头:改前无声明、掉到 `<svg>` 默认 16 —— 与新增位同取常规图标档 */
|
|
228
|
-
.mh-tabbar__tab--more > svg {
|
|
229
|
-
width: var(--ui-font-icon);
|
|
230
|
-
height: var(--ui-font-icon);
|
|
231
|
-
}
|
|
232
|
-
.mh-tabbar__add:hover {
|
|
233
|
-
background: var(--ui-base-200);
|
|
234
|
-
color: var(--ui-primary);
|
|
235
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* TabBar —— 页签条(下划线指示条 + 禁用 + 「更多」页签)。
|
|
3
|
+
*
|
|
4
|
+
* 出处:`@aihub/theme` 的 `playground/components/tabbar.css` 与 `src/components/tabbar.css`
|
|
5
|
+
* (区高 26 / 项间距 30 / 字号 14 / 指示条高 3、距文字 3、两端与文字同宽 / 未选字 `#446a9f` /
|
|
6
|
+
* 滑过 `#529dff` / 选中 `#4e94ff` / 禁用 Te07)。
|
|
7
|
+
*
|
|
8
|
+
* 三条必须照做的几何(做错一眼就歪):
|
|
9
|
+
*
|
|
10
|
+
* 1. **不画轨线**:规范明确警告 —— 页签区没有底边框,选中只由指示条表达;加轨线会扣走区高 1px。
|
|
11
|
+
* 「像不像页签」全靠那道 3px 指示条,不靠一条横线。
|
|
12
|
+
* 2. **指示条是每个项自己的伪元素**(`::after`),不是一条共享滑块:所有项的指示条常驻,未选 `opacity:0; scale:.75`,
|
|
13
|
+
* 选中转 `opacity:1; scale:1` —— "滑过去"的观感来自这两个属性的过渡(`display` 直切补间不了)。
|
|
14
|
+
* 3. **文字贴底**:项高 26 = 文字框 20 + 留白 3 + 指示条 3,故 `align-items:flex-end` +
|
|
15
|
+
* `padding-bottom = indicator-gap + indicator-height`。少了这段内距,指示条会压在字上。
|
|
16
|
+
*
|
|
17
|
+
* **三源等价**(本仓通例):原生 `:checked +` / 组件下发 `[data-state='active']` / 静态档 `.is-selected`
|
|
18
|
+
* 指向同一份声明 —— 原生态给零 JS 用法(原生 radio 互斥 + ← → 换页签),组件态给受控值。
|
|
19
|
+
*/
|
|
20
|
+
.mh-tabbar {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: flex-end;
|
|
23
|
+
gap: var(--ui-tabbar-gap);
|
|
24
|
+
height: var(--ui-tabbar-height);
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.mh-tabbar__tab {
|
|
29
|
+
position: relative;
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: flex-end;
|
|
32
|
+
height: 100%;
|
|
33
|
+
padding: 0 0 calc(var(--ui-tabbar-indicator-gap) + var(--ui-tabbar-indicator-height));
|
|
34
|
+
border: none;
|
|
35
|
+
background: transparent;
|
|
36
|
+
font-family: inherit;
|
|
37
|
+
font-size: var(--ui-tabbar-font-size);
|
|
38
|
+
line-height: var(--ui-line-body);
|
|
39
|
+
color: var(--ui-tabbar-text);
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
white-space: nowrap;
|
|
42
|
+
}
|
|
43
|
+
/* 指示条:常驻、与文字同宽(不内缩),靠 opacity + scale 过渡出"滑动感" */
|
|
44
|
+
.mh-tabbar__tab::after {
|
|
45
|
+
content: '';
|
|
46
|
+
position: absolute;
|
|
47
|
+
right: 0;
|
|
48
|
+
bottom: 0;
|
|
49
|
+
left: 0;
|
|
50
|
+
height: var(--ui-tabbar-indicator-height);
|
|
51
|
+
border-radius: var(--ui-tabbar-indicator-radius);
|
|
52
|
+
background: var(--ui-tabbar-indicator);
|
|
53
|
+
opacity: 0;
|
|
54
|
+
scale: 0.75;
|
|
55
|
+
transition-property: opacity, scale;
|
|
56
|
+
transition-duration: 0.15s;
|
|
57
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.mh-tabbar__tab:hover {
|
|
61
|
+
color: var(--ui-tabbar-text-hover);
|
|
62
|
+
}
|
|
63
|
+
.mh-tabbar__tab:active {
|
|
64
|
+
color: var(--ui-tabbar-text-active);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* 选中(三源等价):字转主色 + 中粗,指示条亮起 */
|
|
68
|
+
.mh-tabbar__tab.is-selected,
|
|
69
|
+
.mh-tabbar__tab[data-state='active'],
|
|
70
|
+
.mh-tabbar > input:checked + .mh-tabbar__tab {
|
|
71
|
+
color: var(--ui-tabbar-text-active);
|
|
72
|
+
font-weight: var(--ui-weight-medium);
|
|
73
|
+
}
|
|
74
|
+
.mh-tabbar__tab.is-selected::after,
|
|
75
|
+
.mh-tabbar__tab[data-state='active']::after,
|
|
76
|
+
.mh-tabbar > input:checked + .mh-tabbar__tab::after {
|
|
77
|
+
opacity: 1;
|
|
78
|
+
scale: 1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* 禁用(三源等价):字转弱、不可点 */
|
|
82
|
+
.mh-tabbar__tab.is-disabled,
|
|
83
|
+
.mh-tabbar__tab:disabled,
|
|
84
|
+
.mh-tabbar > input:disabled + .mh-tabbar__tab {
|
|
85
|
+
color: var(--ui-tabbar-text-disabled);
|
|
86
|
+
cursor: not-allowed;
|
|
87
|
+
}
|
|
88
|
+
.mh-tabbar__tab.is-disabled::after,
|
|
89
|
+
.mh-tabbar__tab:disabled::after,
|
|
90
|
+
.mh-tabbar > input:disabled + .mh-tabbar__tab::after {
|
|
91
|
+
opacity: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* 「更多」页签:文字 + 转向箭头(字形来自 `@manohub/icon`,本层只排布) */
|
|
95
|
+
.mh-tabbar__tab--more {
|
|
96
|
+
display: inline-flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
gap: var(--ui-space-1);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* 原生路径的隐身开关:可聚焦但不可见(焦点环画在可见的项上) */
|
|
102
|
+
.mh-tabbar > input {
|
|
103
|
+
position: absolute;
|
|
104
|
+
width: 1px;
|
|
105
|
+
height: 1px;
|
|
106
|
+
margin: -1px;
|
|
107
|
+
padding: 0;
|
|
108
|
+
border: 0;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
clip-path: inset(50%);
|
|
112
|
+
appearance: none;
|
|
113
|
+
pointer-events: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* 键盘焦点环(两条路径各一处,不重叠) */
|
|
117
|
+
.mh-tabbar__tab:focus-visible,
|
|
118
|
+
.mh-tabbar > input:focus-visible + .mh-tabbar__tab {
|
|
119
|
+
outline: 2px solid var(--ui-primary);
|
|
120
|
+
outline-offset: -2px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* ===== 居中档:页签少、要撑满整行时用 ===== */
|
|
124
|
+
.mh-tabbar--centered {
|
|
125
|
+
justify-content: center;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* ===== 尺寸档(只覆盖令牌) ===== */
|
|
129
|
+
.mh-tabbar--sm {
|
|
130
|
+
--ui-tabbar-height: var(--ui-control-height-sm);
|
|
131
|
+
--ui-tabbar-font-size: var(--ui-font-caption);
|
|
132
|
+
--ui-tabbar-gap: var(--ui-space-6);
|
|
133
|
+
}
|
|
134
|
+
.mh-tabbar--lg {
|
|
135
|
+
--ui-tabbar-height: var(--ui-control-height-lg);
|
|
136
|
+
--ui-tabbar-font-size: var(--ui-font-heading);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* ===== 选项卡形态(type="card") =====
|
|
140
|
+
* 与内容区连成一体:页签有边框与浅底,选中项转白底 + 顶部主色条;
|
|
141
|
+
* 底边刻意不画 —— 让内容区自己的上边框接上(面板的 bordered 档就是为此)。 */
|
|
142
|
+
.mh-tabbar--card {
|
|
143
|
+
align-items: flex-end;
|
|
144
|
+
gap: var(--ui-space-1);
|
|
145
|
+
height: auto;
|
|
146
|
+
}
|
|
147
|
+
.mh-tabbar--card .mh-tabbar__tab {
|
|
148
|
+
align-items: center;
|
|
149
|
+
height: var(--ui-tabbar-height);
|
|
150
|
+
padding: 0 var(--ui-tabbar-card-padding-x);
|
|
151
|
+
border: 1px solid var(--ui-base-300);
|
|
152
|
+
border-bottom: none;
|
|
153
|
+
border-radius: var(--ui-radius-control) var(--ui-radius-control) 0 0;
|
|
154
|
+
background: var(--ui-base-200);
|
|
155
|
+
color: var(--ui-base-content-muted);
|
|
156
|
+
}
|
|
157
|
+
/* 卡片档不画指示条:选中由底色与顶边表达(两套选中语汇叠在一起会互相打架) */
|
|
158
|
+
.mh-tabbar--card .mh-tabbar__tab::after {
|
|
159
|
+
content: none;
|
|
160
|
+
}
|
|
161
|
+
.mh-tabbar--card .mh-tabbar__tab:hover {
|
|
162
|
+
color: var(--ui-primary);
|
|
163
|
+
}
|
|
164
|
+
.mh-tabbar--card .mh-tabbar__tab.is-selected,
|
|
165
|
+
.mh-tabbar--card .mh-tabbar__tab[data-state='active'],
|
|
166
|
+
.mh-tabbar--card > input:checked + .mh-tabbar__tab {
|
|
167
|
+
background: var(--ui-base-100);
|
|
168
|
+
color: var(--ui-primary);
|
|
169
|
+
box-shadow: inset 0 2px 0 var(--ui-primary);
|
|
170
|
+
}
|
|
171
|
+
.mh-tabbar--card .mh-tabbar__tab.is-disabled {
|
|
172
|
+
background: var(--ui-base-200);
|
|
173
|
+
color: var(--ui-tabbar-text-disabled);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* ===== 关闭位 =====
|
|
177
|
+
* 页签自己是 `<button>`,所以关闭位用 `<span role="button">`(按钮里嵌按钮是非法 HTML);
|
|
178
|
+
* 线上档的文字是「贴底」的,故关闭位要自己把底部内距补回来才与文字同一水平线。 */
|
|
179
|
+
.mh-tabbar__close {
|
|
180
|
+
display: inline-flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
justify-content: center;
|
|
183
|
+
align-self: center;
|
|
184
|
+
flex: none;
|
|
185
|
+
width: 16px;
|
|
186
|
+
height: 16px;
|
|
187
|
+
margin-bottom: calc(var(--ui-tabbar-indicator-gap) + var(--ui-tabbar-indicator-height));
|
|
188
|
+
margin-left: var(--ui-space-1);
|
|
189
|
+
border-radius: var(--ui-radius-full);
|
|
190
|
+
color: inherit;
|
|
191
|
+
cursor: pointer;
|
|
192
|
+
opacity: 0.5;
|
|
193
|
+
transition: opacity 0.15s ease, background-color 0.15s ease;
|
|
194
|
+
}
|
|
195
|
+
.mh-tabbar--card .mh-tabbar__close {
|
|
196
|
+
margin-bottom: 0;
|
|
197
|
+
}
|
|
198
|
+
.mh-tabbar__close > svg {
|
|
199
|
+
width: 12px;
|
|
200
|
+
height: 12px;
|
|
201
|
+
}
|
|
202
|
+
.mh-tabbar__close:hover {
|
|
203
|
+
opacity: 1;
|
|
204
|
+
background: rgb(0 0 0 / 0.08);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* ===== 新增位 ===== */
|
|
208
|
+
.mh-tabbar__add {
|
|
209
|
+
display: inline-flex;
|
|
210
|
+
align-items: center;
|
|
211
|
+
justify-content: center;
|
|
212
|
+
flex: none;
|
|
213
|
+
width: var(--ui-tabbar-height);
|
|
214
|
+
height: var(--ui-tabbar-height);
|
|
215
|
+
padding: 0;
|
|
216
|
+
border: none;
|
|
217
|
+
border-radius: var(--ui-radius-control);
|
|
218
|
+
background: transparent;
|
|
219
|
+
color: var(--ui-base-content-muted);
|
|
220
|
+
cursor: pointer;
|
|
221
|
+
transition: background-color 0.15s ease, color 0.15s ease;
|
|
222
|
+
}
|
|
223
|
+
.mh-tabbar__add > svg {
|
|
224
|
+
width: var(--ui-font-icon); /* 常规图标档 */
|
|
225
|
+
height: var(--ui-font-icon);
|
|
226
|
+
}
|
|
227
|
+
/* 「更多」的折叠箭头:改前无声明、掉到 `<svg>` 默认 16 —— 与新增位同取常规图标档 */
|
|
228
|
+
.mh-tabbar__tab--more > svg {
|
|
229
|
+
width: var(--ui-font-icon);
|
|
230
|
+
height: var(--ui-font-icon);
|
|
231
|
+
}
|
|
232
|
+
.mh-tabbar__add:hover {
|
|
233
|
+
background: var(--ui-base-200);
|
|
234
|
+
color: var(--ui-primary);
|
|
235
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tabs —— 单件令牌(**基础值**)。
|
|
3
|
-
*
|
|
4
|
-
* 本件自己的几何 / 尺寸 / 色彩槽位;只服务本件,故不随主题进 `@manohub/theme`。
|
|
5
|
-
*
|
|
6
|
-
* ## 抽出说明
|
|
7
|
-
* 本文件从面文件里抽出(原先混写在 `tabbar.css` 顶部):这些是**基础值**,锚在
|
|
8
|
-
* `[data-manohub-ui]` —— 跨包唯一作用域锚,由入口层无条件写在应用容器上,因此**任何落在
|
|
9
|
-
* 容器里的分件都取得到值**,不再依赖「声明在某个组件根类上」这条脆弱假设
|
|
10
|
-
* (历史症状:跨件消费的 `--ui-*-group-*` 取不到值,组内间距变 0)。
|
|
11
|
-
*
|
|
12
|
-
* ⚠️ `.mh-<件>--<档>` 这类**档位改写**留在面文件的修饰符块里 —— 它们靠「同一元素上两个
|
|
13
|
-
* 选择器改写同一个令牌」生效,搬到本文件会让档位失效。
|
|
14
|
-
* ⚠️ 新增组件要登记两处:本文件 + `src/styles/index.css`(见其文件头「五处齐备」)。
|
|
15
|
-
*/
|
|
16
|
-
[data-manohub-ui] {
|
|
17
|
-
/* 单件令牌 */
|
|
18
|
-
--ui-tabbar-height: var(--ui-control-height-md); /* 标准控件高 32 */
|
|
19
|
-
--ui-tabbar-gap: 30px; /* 项间距(规范实测) */
|
|
20
|
-
--ui-tabbar-font-size: var(--ui-font-body);
|
|
21
|
-
--ui-tabbar-text: var(--ui-base-content); /* 规范未选档 #446a9f(偏蓝的正文色),本仓取正文色 */
|
|
22
|
-
--ui-tabbar-text-hover: var(--ui-primary-hover); /* 规范 #529dff */
|
|
23
|
-
--ui-tabbar-text-active: var(--ui-primary); /* 规范 #4e94ff */
|
|
24
|
-
--ui-tabbar-text-disabled: var(--ui-base-content-subtle); /* 规范 Te07 */
|
|
25
|
-
--ui-tabbar-indicator: var(--ui-primary);
|
|
26
|
-
--ui-tabbar-indicator-gap: 3px; /* 指示条与文字的留白 */
|
|
27
|
-
--ui-tabbar-indicator-height: 3px;
|
|
28
|
-
--ui-tabbar-indicator-radius: var(--ui-radius-full);
|
|
29
|
-
--ui-tabbar-card-padding-x: var(--ui-space-4);
|
|
30
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* tabs —— 单件令牌(**基础值**)。
|
|
3
|
+
*
|
|
4
|
+
* 本件自己的几何 / 尺寸 / 色彩槽位;只服务本件,故不随主题进 `@manohub/theme`。
|
|
5
|
+
*
|
|
6
|
+
* ## 抽出说明
|
|
7
|
+
* 本文件从面文件里抽出(原先混写在 `tabbar.css` 顶部):这些是**基础值**,锚在
|
|
8
|
+
* `[data-manohub-ui]` —— 跨包唯一作用域锚,由入口层无条件写在应用容器上,因此**任何落在
|
|
9
|
+
* 容器里的分件都取得到值**,不再依赖「声明在某个组件根类上」这条脆弱假设
|
|
10
|
+
* (历史症状:跨件消费的 `--ui-*-group-*` 取不到值,组内间距变 0)。
|
|
11
|
+
*
|
|
12
|
+
* ⚠️ `.mh-<件>--<档>` 这类**档位改写**留在面文件的修饰符块里 —— 它们靠「同一元素上两个
|
|
13
|
+
* 选择器改写同一个令牌」生效,搬到本文件会让档位失效。
|
|
14
|
+
* ⚠️ 新增组件要登记两处:本文件 + `src/styles/index.css`(见其文件头「五处齐备」)。
|
|
15
|
+
*/
|
|
16
|
+
[data-manohub-ui] {
|
|
17
|
+
/* 单件令牌 */
|
|
18
|
+
--ui-tabbar-height: var(--ui-control-height-md); /* 标准控件高 32 */
|
|
19
|
+
--ui-tabbar-gap: 30px; /* 项间距(规范实测) */
|
|
20
|
+
--ui-tabbar-font-size: var(--ui-font-body);
|
|
21
|
+
--ui-tabbar-text: var(--ui-base-content); /* 规范未选档 #446a9f(偏蓝的正文色),本仓取正文色 */
|
|
22
|
+
--ui-tabbar-text-hover: var(--ui-primary-hover); /* 规范 #529dff */
|
|
23
|
+
--ui-tabbar-text-active: var(--ui-primary); /* 规范 #4e94ff */
|
|
24
|
+
--ui-tabbar-text-disabled: var(--ui-base-content-subtle); /* 规范 Te07 */
|
|
25
|
+
--ui-tabbar-indicator: var(--ui-primary);
|
|
26
|
+
--ui-tabbar-indicator-gap: 3px; /* 指示条与文字的留白 */
|
|
27
|
+
--ui-tabbar-indicator-height: 3px;
|
|
28
|
+
--ui-tabbar-indicator-radius: var(--ui-radius-full);
|
|
29
|
+
--ui-tabbar-card-padding-x: var(--ui-space-4);
|
|
30
|
+
}
|