@manohub/ui 0.6.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/README.md +141 -0
- package/dist/components/avatar/index.d.ts +283 -0
- package/dist/components/avatar/index.js +167 -0
- package/dist/components/badge/index.d.ts +132 -0
- package/dist/components/badge/index.js +99 -0
- package/dist/components/button/index.d.ts +578 -0
- package/dist/components/button/index.js +191 -0
- package/dist/components/capsule/index.d.ts +161 -0
- package/dist/components/capsule/index.js +101 -0
- package/dist/components/card/index.d.ts +456 -0
- package/dist/components/card/index.js +231 -0
- package/dist/components/checkbox/index.d.ts +331 -0
- package/dist/components/checkbox/index.js +165 -0
- package/dist/components/code/index.d.ts +134 -0
- package/dist/components/code/index.js +117 -0
- package/dist/components/code-editor/index.d.ts +163 -0
- package/dist/components/code-editor/index.js +98 -0
- package/dist/components/collapse/index.d.ts +125 -0
- package/dist/components/collapse/index.js +95 -0
- package/dist/components/control-size.d.ts +8 -0
- package/dist/components/dialog/index.d.ts +224 -0
- package/dist/components/dialog/index.js +194 -0
- package/dist/components/divider/index.d.ts +64 -0
- package/dist/components/divider/index.js +62 -0
- package/dist/components/drawer/index.d.ts +226 -0
- package/dist/components/drawer/index.js +190 -0
- package/dist/components/filter/index.d.ts +391 -0
- package/dist/components/filter/index.js +203 -0
- package/dist/components/form/index.d.ts +704 -0
- package/dist/components/form/index.js +329 -0
- package/dist/components/input/index.d.ts +980 -0
- package/dist/components/input/index.js +334 -0
- package/dist/components/layout/index.d.ts +162 -0
- package/dist/components/layout/index.js +100 -0
- package/dist/components/list-view/index.d.ts +563 -0
- package/dist/components/list-view/index.js +221 -0
- package/dist/components/loading/index.d.ts +77 -0
- package/dist/components/loading/index.js +40 -0
- package/dist/components/nav/index.d.ts +293 -0
- package/dist/components/nav/index.js +164 -0
- package/dist/components/notice/index.d.ts +137 -0
- package/dist/components/notice/index.js +101 -0
- package/dist/components/notification/index.d.ts +118 -0
- package/dist/components/notification/index.js +99 -0
- package/dist/components/page/index.d.ts +276 -0
- package/dist/components/page/index.js +351 -0
- package/dist/components/page/split-resize.d.ts +42 -0
- package/dist/components/page/split-resize.js +36 -0
- package/dist/components/pagination/index.d.ts +171 -0
- package/dist/components/pagination/index.js +226 -0
- package/dist/components/panel/index.d.ts +401 -0
- package/dist/components/panel/index.js +193 -0
- package/dist/components/part-padding.d.ts +27 -0
- package/dist/components/part-padding.js +23 -0
- package/dist/components/query-state/index.d.ts +207 -0
- package/dist/components/query-state/index.js +181 -0
- package/dist/components/radio/index.d.ts +473 -0
- package/dist/components/radio/index.js +250 -0
- package/dist/components/search/index.d.ts +167 -0
- package/dist/components/search/index.js +105 -0
- package/dist/components/select/index.d.ts +252 -0
- package/dist/components/select/index.js +281 -0
- package/dist/components/skeleton/index.d.ts +88 -0
- package/dist/components/skeleton/index.js +56 -0
- package/dist/components/steps/index.d.ts +199 -0
- package/dist/components/steps/index.js +117 -0
- package/dist/components/switch/index.d.ts +150 -0
- package/dist/components/switch/index.js +103 -0
- package/dist/components/table/index.d.ts +351 -0
- package/dist/components/table/index.js +286 -0
- package/dist/components/tabs/index.d.ts +179 -0
- package/dist/components/tabs/index.js +153 -0
- package/dist/components/tabset/index.d.ts +105 -0
- package/dist/components/tabset/index.js +68 -0
- package/dist/components/tag/index.d.ts +203 -0
- package/dist/components/tag/index.js +144 -0
- package/dist/components/toast/index.d.ts +271 -0
- package/dist/components/toast/index.js +116 -0
- package/dist/components/tooltip/index.d.ts +126 -0
- package/dist/components/tooltip/index.js +97 -0
- package/dist/components/tree/index.d.ts +317 -0
- package/dist/components/tree/index.js +251 -0
- package/dist/components/upload/index.d.ts +384 -0
- package/dist/components/upload/index.js +172 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +102 -0
- package/dist/services/base.d.ts +21 -0
- package/dist/services/base.js +42 -0
- package/dist/services/dialog.d.ts +41 -0
- package/dist/services/dialog.js +83 -0
- package/dist/services/index.d.ts +12 -0
- package/dist/services/loading.d.ts +21 -0
- package/dist/services/loading.js +41 -0
- package/dist/services/toast.d.ts +40 -0
- package/dist/services/toast.js +74 -0
- package/dist/styles/components/avatar.css +128 -0
- package/dist/styles/components/avatar.tokens.css +24 -0
- package/dist/styles/components/badge.css +237 -0
- package/dist/styles/components/button.css +454 -0
- package/dist/styles/components/button.tokens.css +56 -0
- package/dist/styles/components/capsule.css +120 -0
- package/dist/styles/components/capsule.tokens.css +27 -0
- package/dist/styles/components/card.css +192 -0
- package/dist/styles/components/checkbox.css +145 -0
- package/dist/styles/components/checkbox.tokens.css +26 -0
- package/dist/styles/components/code-editor.css +91 -0
- package/dist/styles/components/code-editor.tokens.css +24 -0
- package/dist/styles/components/code.css +153 -0
- package/dist/styles/components/code.tokens.css +29 -0
- package/dist/styles/components/collapse.css +62 -0
- package/dist/styles/components/collapse.tokens.css +20 -0
- package/dist/styles/components/dialog.css +106 -0
- package/dist/styles/components/dialog.tokens.css +24 -0
- package/dist/styles/components/divider.css +71 -0
- package/dist/styles/components/divider.tokens.css +21 -0
- package/dist/styles/components/drawer.css +143 -0
- package/dist/styles/components/drawer.tokens.css +22 -0
- package/dist/styles/components/filter.css +41 -0
- package/dist/styles/components/filter.tokens.css +14 -0
- package/dist/styles/components/form.css +220 -0
- package/dist/styles/components/form.tokens.css +15 -0
- package/dist/styles/components/input.css +445 -0
- package/dist/styles/components/input.tokens.css +41 -0
- package/dist/styles/components/layout.css +198 -0
- package/dist/styles/components/list-view.css +244 -0
- package/dist/styles/components/loading.css +76 -0
- package/dist/styles/components/loading.tokens.css +23 -0
- package/dist/styles/components/nav.css +48 -0
- package/dist/styles/components/notice.css +153 -0
- package/dist/styles/components/notice.tokens.css +17 -0
- package/dist/styles/components/notification.css +159 -0
- package/dist/styles/components/notification.tokens.css +37 -0
- package/dist/styles/components/page.css +473 -0
- package/dist/styles/components/pagination.css +297 -0
- package/dist/styles/components/pagination.tokens.css +32 -0
- package/dist/styles/components/panel.css +77 -0
- package/dist/styles/components/query-state.css +88 -0
- package/dist/styles/components/radio.css +271 -0
- package/dist/styles/components/radio.tokens.css +26 -0
- package/dist/styles/components/search.css +30 -0
- package/dist/styles/components/select.css +242 -0
- package/dist/styles/components/select.tokens.css +33 -0
- package/dist/styles/components/skeleton.css +60 -0
- package/dist/styles/components/skeleton.tokens.css +27 -0
- package/dist/styles/components/steps.css +157 -0
- package/dist/styles/components/steps.tokens.css +42 -0
- package/dist/styles/components/switch.css +165 -0
- package/dist/styles/components/switch.tokens.css +26 -0
- package/dist/styles/components/table.css +439 -0
- package/dist/styles/components/table.tokens.css +41 -0
- package/dist/styles/components/tabs.css +234 -0
- package/dist/styles/components/tabs.tokens.css +30 -0
- package/dist/styles/components/tag.css +200 -0
- package/dist/styles/components/tag.tokens.css +30 -0
- package/dist/styles/components/toast.css +150 -0
- package/dist/styles/components/toast.tokens.css +26 -0
- package/dist/styles/components/tooltip.css +89 -0
- package/dist/styles/components/tooltip.tokens.css +25 -0
- package/dist/styles/components/tree.css +139 -0
- package/dist/styles/components/tree.tokens.css +20 -0
- package/dist/styles/components/upload.css +150 -0
- package/dist/styles/components/upload.tokens.css +27 -0
- package/dist/styles/index.css +149 -0
- package/dist/styles/operations/collapse.css +84 -0
- package/dist/styles/operations/popup.css +189 -0
- package/dist/styles/operations/tabset.css +57 -0
- package/dist/utils/state-illustration.d.ts +31 -0
- package/dist/utils/state-illustration.js +156 -0
- package/package.json +62 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination —— 分页条(总数文案 + 每页条数 + 页码窗口 + 翻页箭头 + 空态 + 简单档)。
|
|
3
|
+
*
|
|
4
|
+
* 出处:设计稿《MH后台-0911》的分页器(`0:4047` 466×28:页码项 **28×28 / r6 / 白底 / 边 `#e6e6e6`**、
|
|
5
|
+
* 选中页码底 `#eff5ff`、条数选择器 `0:4092` 28×28 r6)与 `@aihub/theme` 的 `src/components/pagination.css`
|
|
6
|
+
* (圆角控件档 / 字号 13 / 组间 12 / 页码间 4 / 省略号 subtle)。
|
|
7
|
+
* ⚠️ 设计给 **28**、规范给 **26**、改前本件取 32 —— 三者都不同;本轮按设计取 28(规范值登记为偏差)。
|
|
8
|
+
*
|
|
9
|
+
* **顺序是一维右对齐流**:`共 N 条,` → `每页 N 条 ▾` → `‹ 1 … 10 11 12 … 50 ›`。别把总数额外搬到左侧。
|
|
10
|
+
*
|
|
11
|
+
* **不做跳页输入框**:规范里没有「跳至第 N 页」的样张(重写者若需要须自行定位置),本仓按"不做规范没演示的"
|
|
12
|
+
* 处理 —— 要保持族谱齐全的判据就该守在规范有标记示例的范围内,而不是替规范发明控件。
|
|
13
|
+
*
|
|
14
|
+
* **页码项三源等价**(本仓通例):原生 `:has(> input:checked)` / 组件下发 `[data-state='selected']` /
|
|
15
|
+
* 静态档 `.is-selected` 指向同一份声明 —— 原生态给零 JS 用法(原生 radio 互斥 + ← → 换页),组件态给 v-model。
|
|
16
|
+
*
|
|
17
|
+
* 翻页箭头用**两个字形**(上一页 `chevron-left` / 下一页 `chevron-right`),本层不转向:方位由字形自表达
|
|
18
|
+
* (包内硬约束:不得靠 `transform: rotate()` 把别的图标转成方位,`back` 只作"返回"语义)。条数选择器的
|
|
19
|
+
* 折叠指示走操作层 `.mh-popup-caret`(展开时翻向),与本层同样零自画折线。
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/* 几何只挂在页码条上:令牌在同名 `.tokens.css`(锚 `[data-manohub-ui]`),几何若跟着挂会把空态也排成右对齐的行 */
|
|
23
|
+
.mh-pagination {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: flex-end;
|
|
27
|
+
gap: var(--ui-pagination-gap);
|
|
28
|
+
font-size: var(--ui-pagination-font-size);
|
|
29
|
+
color: var(--ui-pagination-text);
|
|
30
|
+
}
|
|
31
|
+
/* 外框档:规范只给了「1px 描边 + 控件圆角」,内距本仓定为横 12、竖不额外加(项高即条高) */
|
|
32
|
+
.mh-pagination--boxed {
|
|
33
|
+
padding: 0 var(--ui-space-4);
|
|
34
|
+
border: 1px solid var(--ui-base-300);
|
|
35
|
+
border-radius: var(--ui-pagination-item-radius);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* ===== 总数文案 / 空态 / 简单档 ===== */
|
|
39
|
+
.mh-pagination__total {
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
}
|
|
42
|
+
.mh-pagination__empty {
|
|
43
|
+
color: var(--ui-pagination-ellipsis);
|
|
44
|
+
}
|
|
45
|
+
.mh-pagination__plain {
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* ===== 每页条数选择器(触发器:文字 + 转向箭头) =====
|
|
50
|
+
面板是「操作层 + 本件皮肤」的组合写法:`class="mh-popup mh-pagination__panel"` ——
|
|
51
|
+
开合 / Esc / 点外部关闭 / 顶层渲染 / 定位档归 `styles/operations/popup.css`,面(底 / 圆角 / 内距 / 阴影)归本件。 */
|
|
52
|
+
.mh-pagination__size {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: var(--ui-space-1);
|
|
56
|
+
padding: 0;
|
|
57
|
+
border: none;
|
|
58
|
+
background: transparent;
|
|
59
|
+
font-family: inherit;
|
|
60
|
+
font-size: inherit;
|
|
61
|
+
color: inherit;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
.mh-pagination__size:hover,
|
|
65
|
+
.mh-pagination__size[data-state='hover'] {
|
|
66
|
+
color: var(--ui-pagination-border-hover);
|
|
67
|
+
}
|
|
68
|
+
.mh-pagination__size[data-state='active'] {
|
|
69
|
+
color: var(--ui-pagination-text-active);
|
|
70
|
+
}
|
|
71
|
+
.mh-pagination__size:disabled {
|
|
72
|
+
color: var(--ui-base-content-subtle);
|
|
73
|
+
cursor: not-allowed;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* 面板皮肤:**组件自渲染的菜单必须自带面** —— 操作层把 popover 的 UA 装饰(含 `background`)归零成
|
|
77
|
+
`transparent`,只挂 `.mh-popup` 的面板会整个透出底下的表格(实测踩坑,就是这条缺失造成的)。
|
|
78
|
+
只给面,不碰开合与定位(那些归操作层)。 */
|
|
79
|
+
.mh-pagination__panel {
|
|
80
|
+
padding: var(--ui-space-1) 0;
|
|
81
|
+
border-radius: var(--ui-radius-control); /* 控件圆角档(与选择器面板同档) */
|
|
82
|
+
background: var(--ui-base-100);
|
|
83
|
+
box-shadow: var(--ui-shadow-popover); /* 条数选择器是锚定浮层,不是居中浮层 */
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* 菜单里的单选项:本件是**单选组**(原生 radio,箭头键可选),与选择器的 listbox 面板不是一回事,故不复用其皮肤 */
|
|
87
|
+
.mh-pagination__size-option {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
gap: var(--ui-space-2);
|
|
91
|
+
padding: var(--ui-space-1) var(--ui-space-3);
|
|
92
|
+
border-radius: var(--ui-radius-sm);
|
|
93
|
+
font-size: var(--ui-pagination-font-size);
|
|
94
|
+
color: var(--ui-pagination-text);
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
}
|
|
98
|
+
.mh-pagination__size-option:hover {
|
|
99
|
+
background: var(--ui-pagination-bg-selected);
|
|
100
|
+
}
|
|
101
|
+
.mh-pagination__size-option input {
|
|
102
|
+
position: absolute;
|
|
103
|
+
width: 1px;
|
|
104
|
+
height: 1px;
|
|
105
|
+
margin: -1px;
|
|
106
|
+
border: 0;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
clip-path: inset(50%);
|
|
110
|
+
appearance: none;
|
|
111
|
+
pointer-events: none;
|
|
112
|
+
}
|
|
113
|
+
.mh-pagination__size-option:has(input:focus-visible) {
|
|
114
|
+
outline: 2px solid var(--ui-primary);
|
|
115
|
+
outline-offset: -2px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* ===== 页码行 ===== */
|
|
119
|
+
.mh-pagination__pages {
|
|
120
|
+
display: flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
gap: var(--ui-pagination-page-gap);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.mh-pagination__btn {
|
|
126
|
+
display: inline-flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
min-width: var(--ui-pagination-item-size);
|
|
131
|
+
height: var(--ui-pagination-item-size);
|
|
132
|
+
padding: 0 var(--ui-space-1);
|
|
133
|
+
border: 1px solid transparent;
|
|
134
|
+
border-radius: var(--ui-pagination-item-radius);
|
|
135
|
+
background: transparent;
|
|
136
|
+
font-family: inherit;
|
|
137
|
+
font-size: var(--ui-pagination-font-size);
|
|
138
|
+
color: var(--ui-pagination-text);
|
|
139
|
+
cursor: pointer;
|
|
140
|
+
transition-property: background-color, border-color, color;
|
|
141
|
+
transition-duration: 0.15s;
|
|
142
|
+
transition-timing-function: ease;
|
|
143
|
+
}
|
|
144
|
+
/* 滑过 / 按下:只描边转色(底仍透明,规范如此) */
|
|
145
|
+
.mh-pagination__btn:hover,
|
|
146
|
+
.mh-pagination__btn.is-hover {
|
|
147
|
+
border-color: var(--ui-pagination-border-hover);
|
|
148
|
+
}
|
|
149
|
+
.mh-pagination__btn:active,
|
|
150
|
+
.mh-pagination__btn.is-active {
|
|
151
|
+
border-color: var(--ui-pagination-border-active);
|
|
152
|
+
}
|
|
153
|
+
/* 选中:淡底 + 主色描边 + 主色字 + 中粗(三源等价) */
|
|
154
|
+
.mh-pagination__btn.is-selected,
|
|
155
|
+
.mh-pagination__btn[data-state='selected'],
|
|
156
|
+
.mh-pagination__btn:has(> input:checked) {
|
|
157
|
+
border-color: var(--ui-pagination-border-active);
|
|
158
|
+
background: var(--ui-pagination-bg-selected);
|
|
159
|
+
color: var(--ui-pagination-text-active);
|
|
160
|
+
font-weight: var(--ui-weight-medium);
|
|
161
|
+
}
|
|
162
|
+
.mh-pagination__btn:disabled {
|
|
163
|
+
color: var(--ui-base-content-subtle);
|
|
164
|
+
cursor: not-allowed;
|
|
165
|
+
}
|
|
166
|
+
.mh-pagination__btn:disabled:hover {
|
|
167
|
+
border-color: transparent;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* 省略号:不可点、字距拉开(规范 2px) */
|
|
171
|
+
.mh-pagination__btn--ellipsis {
|
|
172
|
+
color: var(--ui-pagination-ellipsis);
|
|
173
|
+
letter-spacing: 2px;
|
|
174
|
+
cursor: default;
|
|
175
|
+
}
|
|
176
|
+
.mh-pagination__btn--ellipsis:hover {
|
|
177
|
+
border-color: transparent;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* 翻页箭头:**朝向在字形里**(上一页 `chevron-left` / 下一页 `chevron-right`),本层只给颜色 ——
|
|
181
|
+
整段零 `transform`,不走"把别的图标转成方位"的老路(包内硬约束)。
|
|
182
|
+
`--prev` / `--next` 保留为**状态钩子**(消费方与测试按它们定位两端的箭头按钮),不再承载转向。 */
|
|
183
|
+
.mh-pagination__btn--arrow {
|
|
184
|
+
color: var(--ui-pagination-arrow);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* 槽位尺寸:**常规图标一律取全局图标档**(`--ui-font-icon`)—— 翻页箭头与条数选择器的折叠箭头
|
|
188
|
+
改前无声明、掉到 `<svg>` 的默认 16,本层不另定数值(字形由 `@manohub/icon` 给)。 */
|
|
189
|
+
.mh-pagination__btn--arrow > svg,
|
|
190
|
+
.mh-pagination__size > svg {
|
|
191
|
+
width: var(--ui-font-icon);
|
|
192
|
+
height: var(--ui-font-icon);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* ===== 外框档内的三态:不描边、不落底,只靠**文字变色** =====
|
|
196
|
+
判据:boxed 档自己已经画了一圈外框,框内再来一圈描边(滑过/按下/选中)或一块淡底(选中)就是双重勾线,
|
|
197
|
+
故框内的态一律收敛成「文字色」这一种手段 —— 滑过转浅主色(复用描边档的滑过色 `#529dff`)、按下与选中
|
|
198
|
+
转主色。中粗**不在此重复声明**:基类选中规则已给 `--ui-weight-medium`,这里只覆盖 border/底/字色三件,
|
|
199
|
+
旧口径(主色字 + 中粗)完整保留。
|
|
200
|
+
两处排除都是必须的:`--ellipsis`(省略号与按钮共用基类,但它不可点、只该保持浅色)与 `:disabled`
|
|
201
|
+
(不可点的箭头不该被悬停染成主色);排除项包在 `:where()` 里,使其**不抬特异性** —— 这样三条覆盖同为
|
|
202
|
+
0-3-0,靠源序让「选中」压住「悬停」(悬停已选中的项仍显示选中色,与非 boxed 档一致)。
|
|
203
|
+
三源等价(原生 `:has(> input:checked)` / 组件 `[data-state='selected']` / 静态 `.is-selected`)一并覆盖。 */
|
|
204
|
+
.mh-pagination--boxed .mh-pagination__btn:not(:where(.mh-pagination__btn--ellipsis, :disabled)):hover,
|
|
205
|
+
.mh-pagination--boxed .mh-pagination__btn:not(:where(.mh-pagination__btn--ellipsis, :disabled)).is-hover {
|
|
206
|
+
border-color: transparent;
|
|
207
|
+
color: var(--ui-pagination-border-hover);
|
|
208
|
+
}
|
|
209
|
+
.mh-pagination--boxed .mh-pagination__btn:not(:where(.mh-pagination__btn--ellipsis, :disabled)):active,
|
|
210
|
+
.mh-pagination--boxed .mh-pagination__btn:not(:where(.mh-pagination__btn--ellipsis, :disabled)).is-active {
|
|
211
|
+
border-color: transparent;
|
|
212
|
+
color: var(--ui-pagination-border-active);
|
|
213
|
+
}
|
|
214
|
+
.mh-pagination--boxed .mh-pagination__btn.is-selected,
|
|
215
|
+
.mh-pagination--boxed .mh-pagination__btn[data-state='selected'],
|
|
216
|
+
.mh-pagination--boxed .mh-pagination__btn:has(> input:checked) {
|
|
217
|
+
border-color: transparent;
|
|
218
|
+
background: transparent;
|
|
219
|
+
color: var(--ui-pagination-text-active);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* 原生态的开关(同名 radio)隐身但可聚焦:零 JS 用法下选中态由 `:has(> input:checked)` 驱动 */
|
|
223
|
+
.mh-pagination__btn > input {
|
|
224
|
+
position: absolute;
|
|
225
|
+
width: 1px;
|
|
226
|
+
height: 1px;
|
|
227
|
+
margin: -1px;
|
|
228
|
+
padding: 0;
|
|
229
|
+
border: 0;
|
|
230
|
+
overflow: hidden;
|
|
231
|
+
white-space: nowrap;
|
|
232
|
+
clip-path: inset(50%);
|
|
233
|
+
appearance: none;
|
|
234
|
+
pointer-events: none;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* 键盘焦点环画在可见项上(原生态的开关是隐身的) */
|
|
238
|
+
.mh-pagination__btn:focus-visible,
|
|
239
|
+
.mh-pagination__btn:has(> input:focus-visible) {
|
|
240
|
+
outline: 2px solid var(--ui-primary);
|
|
241
|
+
outline-offset: -2px;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* ===== 尺寸档(只覆盖令牌)=====
|
|
245
|
+
标准档 28 拿的是设计实测值,故两档以它为中心各让 4px(24 / 32),而不是继续引用控件三档
|
|
246
|
+
(24 / 32 / 40 —— 那样标准档就落不到 28 上)。 */
|
|
247
|
+
.mh-pagination--sm {
|
|
248
|
+
--ui-pagination-item-size: 24px;
|
|
249
|
+
--ui-pagination-font-size: var(--ui-font-caption);
|
|
250
|
+
}
|
|
251
|
+
.mh-pagination--lg {
|
|
252
|
+
--ui-pagination-item-size: 32px;
|
|
253
|
+
--ui-pagination-font-size: var(--ui-font-body);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/* ===== 跳页(showQuickJumper) ===== */
|
|
257
|
+
.mh-pagination__jump {
|
|
258
|
+
display: inline-flex;
|
|
259
|
+
align-items: center;
|
|
260
|
+
gap: var(--ui-space-2);
|
|
261
|
+
font-size: var(--ui-pagination-font-size);
|
|
262
|
+
color: var(--ui-pagination-text);
|
|
263
|
+
}
|
|
264
|
+
.mh-pagination__jump-input {
|
|
265
|
+
width: 56px;
|
|
266
|
+
height: var(--ui-pagination-item-size);
|
|
267
|
+
padding: 0 var(--ui-space-2);
|
|
268
|
+
border: 1px solid var(--ui-base-400);
|
|
269
|
+
border-radius: var(--ui-pagination-item-radius);
|
|
270
|
+
background: var(--ui-base-100);
|
|
271
|
+
font-family: inherit;
|
|
272
|
+
font-size: var(--ui-pagination-font-size);
|
|
273
|
+
color: var(--ui-base-content);
|
|
274
|
+
text-align: center;
|
|
275
|
+
outline: none;
|
|
276
|
+
/* 数字输入的上下箭头在 56px 宽里会挤掉数字,直接收掉 */
|
|
277
|
+
appearance: textfield;
|
|
278
|
+
-moz-appearance: textfield;
|
|
279
|
+
}
|
|
280
|
+
.mh-pagination__jump-input::-webkit-outer-spin-button,
|
|
281
|
+
.mh-pagination__jump-input::-webkit-inner-spin-button {
|
|
282
|
+
appearance: none;
|
|
283
|
+
margin: 0;
|
|
284
|
+
}
|
|
285
|
+
.mh-pagination__jump-input:hover {
|
|
286
|
+
border-color: var(--ui-pagination-border-hover);
|
|
287
|
+
}
|
|
288
|
+
.mh-pagination__jump-input:focus {
|
|
289
|
+
border-color: var(--ui-pagination-border-active);
|
|
290
|
+
box-shadow: 0 0 0 2px var(--ui-primary-weak);
|
|
291
|
+
}
|
|
292
|
+
.mh-pagination__jump-input:disabled {
|
|
293
|
+
background: var(--ui-base-200);
|
|
294
|
+
border-color: var(--ui-base-300);
|
|
295
|
+
color: var(--ui-base-content-subtle);
|
|
296
|
+
cursor: not-allowed;
|
|
297
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pagination —— 单件令牌(**基础值**)。
|
|
3
|
+
*
|
|
4
|
+
* 本件自己的几何 / 尺寸 / 色彩槽位;只服务本件,故不随主题进 `@manohub/theme`。
|
|
5
|
+
*
|
|
6
|
+
* ## 抽出说明
|
|
7
|
+
* 本文件从面文件里抽出(原先混写在 `pagination.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
|
+
/* 单件令牌 */
|
|
19
|
+
/* 页码方块 28(设计实测):它是「页码格」,体量由数字字号 + 内距决定,不属控件三档 */
|
|
20
|
+
--ui-pagination-item-size: 28px;
|
|
21
|
+
--ui-pagination-item-radius: var(--ui-radius-control);
|
|
22
|
+
--ui-pagination-font-size: var(--ui-font-caption);
|
|
23
|
+
--ui-pagination-text: var(--ui-base-content);
|
|
24
|
+
--ui-pagination-gap: var(--ui-space-3); /* 组间 12 */
|
|
25
|
+
--ui-pagination-page-gap: var(--ui-space-1); /* 页码间 4 */
|
|
26
|
+
--ui-pagination-bg-selected: var(--ui-primary-weak); /* 规范 #e9f3ff */
|
|
27
|
+
--ui-pagination-text-active: var(--ui-primary); /* 规范 #2a87ff */
|
|
28
|
+
--ui-pagination-border-hover: var(--ui-primary-hover); /* 规范 #529dff */
|
|
29
|
+
--ui-pagination-border-active: var(--ui-primary); /* 规范 #0e6ded → 本仓主色档(主题无更深一档) */
|
|
30
|
+
--ui-pagination-arrow: var(--ui-base-content);
|
|
31
|
+
--ui-pagination-ellipsis: var(--ui-base-content-subtle); /* 规范 Te07 */
|
|
32
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Panel(区域容器,**无框契约**:分区感只由 Header 下方 1px 分隔线提供)。
|
|
3
|
+
*
|
|
4
|
+
* 依据:@aihub/theme 的 components/card.css(分区手法)+ base/spacing.css(头高与内距档)。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* ===== Panel(区域容器,无框)=====
|
|
8
|
+
无框契约:面板自身不写描边 / 圆角 / 阴影 / 独立底色 / 单侧边框,
|
|
9
|
+
分区感只由 Header 下方 1px 分隔线提供(与 .mh-page__header 同一手法);
|
|
10
|
+
两栏之间的竖直分隔线由 Page.Split 提供;卡片外观由内容件承载(表格用 Table.framed)。
|
|
11
|
+
|
|
12
|
+
滚动归属:Header 固定(flex-shrink:0),Body 承担**区域内**滚动(overflow:auto)。
|
|
13
|
+
Split 两栏因此让出滚动(overflow:hidden),避免同栏两层滚动容器。 */
|
|
14
|
+
|
|
15
|
+
.mh-panel {
|
|
16
|
+
height: 100%;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
min-height: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.mh-panel__header {
|
|
23
|
+
flex-shrink: 0;
|
|
24
|
+
height: var(--ui-header-height);
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
gap: var(--ui-space-3);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.mh-panel__header-title {
|
|
32
|
+
font-size: var(--ui-font-heading);
|
|
33
|
+
font-weight: var(--ui-weight-semibold);
|
|
34
|
+
color: var(--ui-base-content);
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
text-overflow: ellipsis;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* 右侧组:toolbar(本区域筛选)在左、actions(本区域操作)在右,内部间距锁死 */
|
|
41
|
+
|
|
42
|
+
.mh-panel__header-right {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: var(--ui-space-2);
|
|
46
|
+
min-width: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.mh-panel__header-toolbar,
|
|
50
|
+
.mh-panel__header-actions {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: var(--ui-space-2);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.mh-panel__body {
|
|
57
|
+
flex: 1;
|
|
58
|
+
min-height: 0;
|
|
59
|
+
min-width: 0;
|
|
60
|
+
overflow: auto;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* 面板页脚:区域内**常驻**控件(本区域表格的分页条等),不随内容滚动。
|
|
64
|
+
与 Header 同款 flex-shrink:0;不加边框(面板无框契约只管分区感由 Header 下边线提供),
|
|
65
|
+
左右内距与 Body 对齐,让分页条与表格左右边缘齐平。 */
|
|
66
|
+
|
|
67
|
+
.mh-panel__footer {
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* 标题位收任意节点(`title` 插槽可放图标 / 计数 / 状态点),故按行内弹性排布 */
|
|
72
|
+
.mh-panel__header-title {
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: var(--ui-space-2);
|
|
76
|
+
min-width: 0;
|
|
77
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QueryState —— 三态(loading / empty / error)容器。
|
|
3
|
+
*
|
|
4
|
+
* 依据:@aihub/theme 的 components/empty.css(空态图形与文案层级)与 components/skeleton.css(shimmer 微光)。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 本面只含组件自身的类与骨架屏动画。
|
|
9
|
+
* 允许的视觉声明集中在组件面;应用侧 CSS 只写布局。
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* ===== 骨架屏 =====
|
|
13
|
+
微光(动画 + 色值)的**唯一来源是 `./skeleton.css`(Skeleton)**:
|
|
14
|
+
本文件不再自带一份 —— 两处各写一份必然漂(时长/色值改一处漏一处,
|
|
15
|
+
同一屏会出现两种呼吸节奏)。这里只保留三态容器自己的排布(`.mh-state-skeletons`)。 */
|
|
16
|
+
|
|
17
|
+
/* ===== 三态(QueryState)=====
|
|
18
|
+
构成顺序固定:**插画 → 主文案 → 副文案 → 操作区**(整块垂直居中)。
|
|
19
|
+
留白节奏同控制台空态一档:插画下 16、标题下 4、副文案下 16;文案层级用字号 + 字重 + 灰度拉开,
|
|
20
|
+
不靠多色分隔 —— 状态块是页面的「静默区」,视觉噪音要低。 */
|
|
21
|
+
|
|
22
|
+
.mh-state {
|
|
23
|
+
height: 100%;
|
|
24
|
+
min-height: 200px;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
padding: var(--ui-space-6);
|
|
30
|
+
text-align: center;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.mh-state-title {
|
|
34
|
+
font-size: var(--ui-font-heading);
|
|
35
|
+
font-weight: var(--ui-weight-medium);
|
|
36
|
+
color: var(--ui-base-content);
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.mh-state-description {
|
|
41
|
+
font-size: var(--ui-font-caption);
|
|
42
|
+
line-height: var(--ui-line-caption);
|
|
43
|
+
color: var(--ui-base-content-subtle);
|
|
44
|
+
max-width: 420px;
|
|
45
|
+
word-break: break-word;
|
|
46
|
+
margin: var(--ui-space-1) 0 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* 操作区:默认一颗主按钮;用 actions 插槽时可放多颗(横向排列) */
|
|
50
|
+
|
|
51
|
+
.mh-state-actions {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
gap: var(--ui-space-2);
|
|
56
|
+
margin-top: var(--ui-space-4);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.mh-state-skeletons {
|
|
60
|
+
width: 100%;
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
gap: var(--ui-space-3);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ===== 插画壳 =====
|
|
67
|
+
内建插画是**设计交付的 SVG 原样注入**(见 `utils/state-illustration.ts`:结构 / 坐标 / 固定色值 /
|
|
68
|
+
`id` / `<title>` 全保留),面里因此只有外壳这一件事:壳宽(264 = 设计画布宽)、窄容器里按比例收缩、
|
|
69
|
+
与下方文案的间距,以及把设计稿写死 `264 × 246` 的画布拉成「随壳自适应」。
|
|
70
|
+
同理,插画**不跟随主题**(图里是设计终值色,不走 `--ui-*`)——这是「原样引用」的取舍。
|
|
71
|
+
`illustration` 属性给的图片地址复用同一个壳(`<img>` 自带比例,不需要第二条规则)。 */
|
|
72
|
+
|
|
73
|
+
.mh-state-illustration {
|
|
74
|
+
display: inline-block;
|
|
75
|
+
width: 264px;
|
|
76
|
+
max-width: 70%;
|
|
77
|
+
height: auto;
|
|
78
|
+
margin-bottom: var(--ui-space-4);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* 设计画布写死的 `width="264px" height="246px"` 是表现属性,CSS 优先 —— 这里把它拉成
|
|
82
|
+
「宽随壳、高按 264 : 246 等比」,设计稿本身一个字节没改(改属性才是动设计稿) */
|
|
83
|
+
|
|
84
|
+
.mh-state-illustration > svg {
|
|
85
|
+
display: block;
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: auto;
|
|
88
|
+
}
|