@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,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notice(说明条 / 警告提示,自建)。
|
|
3
|
+
*
|
|
4
|
+
* 依据:@aihub/theme 的 components/alert.css(通栏高 42 / 圆角 6 / 投影 / 语义「底·边·字」三件套);
|
|
5
|
+
* 与主题包的两处有意差异(success·warning 取 -strong 档、警示/错误底取专页实测值)见下方原注释。
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/* ===== Notice(说明条 / 警告提示,自建)=====
|
|
9
|
+
规范对齐 `@aihub/theme` 的 Alert(`.sem-bar`):通栏 100% 宽、高 42、圆角 6、
|
|
10
|
+
投影 0 2 10 黑 8%、文案 15px、语义「底 / 边 / 字」三件套;操作位为文字按钮。
|
|
11
|
+
|
|
12
|
+
与主题包的两处有意差异(都不改结构,只保可读性):
|
|
13
|
+
1. 文案色:success/warning 取 `-strong` 档(主题包调色板另给了该槽位)——直接用 500 档主色
|
|
14
|
+
在浅底上对比度不足(如 #22C55E on #ECFDF5 ≈ 1.9:1),属可读性缺陷;
|
|
15
|
+
2. 警示 / 错误的底色仍按主题包 Alert 专页实测值(#FDF4EA / #FDECEC),不用语义 03 档。 */
|
|
16
|
+
|
|
17
|
+
.mh-notice {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--ui-space-2);
|
|
21
|
+
width: 100%;
|
|
22
|
+
min-height: var(--ui-notice-height);
|
|
23
|
+
padding: var(--ui-space-3) var(--ui-space-4);
|
|
24
|
+
border-radius: var(--ui-radius-control);
|
|
25
|
+
box-shadow: var(--ui-notice-shadow);
|
|
26
|
+
font-size: var(--ui-notice-font);
|
|
27
|
+
line-height: var(--ui-line-body);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.mh-notice__body {
|
|
31
|
+
flex: 1;
|
|
32
|
+
min-width: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* 说明文案可能是多段(原页面按段落渲染),块间距交给容器,避免与外层再叠一层间距 */
|
|
36
|
+
|
|
37
|
+
.mh-notice__body p {
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.mh-notice__action {
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
margin-left: auto;
|
|
44
|
+
border: none;
|
|
45
|
+
background: transparent;
|
|
46
|
+
padding: 0;
|
|
47
|
+
font: inherit;
|
|
48
|
+
/* 文字按钮取主色(主题包 --f-alert-action-text = --f-primary) */
|
|
49
|
+
color: var(--ui-primary);
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.mh-notice__close {
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
margin-left: auto;
|
|
56
|
+
border: none;
|
|
57
|
+
background: transparent;
|
|
58
|
+
padding: 0;
|
|
59
|
+
font-size: var(--ui-font-caption);
|
|
60
|
+
/* 主题包为 --f-text-muted(Te07),本仓对应 --ui-base-content-muted */
|
|
61
|
+
color: var(--ui-base-content-muted);
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.mh-notice--info {
|
|
66
|
+
background: var(--ui-info-weak);
|
|
67
|
+
border: 1px solid var(--ui-info-border);
|
|
68
|
+
color: var(--ui-info);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.mh-notice--success {
|
|
72
|
+
background: var(--ui-success-weak);
|
|
73
|
+
border: 1px solid var(--ui-success-border);
|
|
74
|
+
color: var(--ui-success-strong);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.mh-notice--warning {
|
|
78
|
+
background: var(--ui-notice-warning-bg);
|
|
79
|
+
border: 1px solid var(--ui-warning-border);
|
|
80
|
+
color: var(--ui-warning-strong);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.mh-notice--error {
|
|
84
|
+
background: var(--ui-notice-error-bg);
|
|
85
|
+
border: 1px solid var(--ui-error-border);
|
|
86
|
+
color: var(--ui-error);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* ===== 语义图标 / 两行排版 / 关闭位 ===== */
|
|
90
|
+
.mh-notice__icon {
|
|
91
|
+
flex: none;
|
|
92
|
+
/* 语义图标是常规图标:尺寸取全局图标档(改前硬写 16) */
|
|
93
|
+
width: var(--ui-font-icon);
|
|
94
|
+
height: var(--ui-font-icon);
|
|
95
|
+
margin-top: 1px; /* 与首行文字视觉对齐(文字行高比图标高) */
|
|
96
|
+
}
|
|
97
|
+
.mh-notice__body {
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
gap: 2px;
|
|
101
|
+
flex: 1;
|
|
102
|
+
min-width: 0;
|
|
103
|
+
}
|
|
104
|
+
.mh-notice__message {
|
|
105
|
+
font-weight: var(--ui-weight-medium);
|
|
106
|
+
}
|
|
107
|
+
.mh-notice__description {
|
|
108
|
+
color: inherit;
|
|
109
|
+
}
|
|
110
|
+
.mh-notice__close {
|
|
111
|
+
display: inline-flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
gap: var(--ui-space-1);
|
|
114
|
+
flex: none;
|
|
115
|
+
padding: 0;
|
|
116
|
+
border: none;
|
|
117
|
+
background: transparent;
|
|
118
|
+
font-family: inherit;
|
|
119
|
+
font-size: inherit;
|
|
120
|
+
color: inherit;
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
opacity: 0.7;
|
|
123
|
+
transition: opacity 0.15s ease;
|
|
124
|
+
}
|
|
125
|
+
.mh-notice__close:hover {
|
|
126
|
+
opacity: 1;
|
|
127
|
+
}
|
|
128
|
+
.mh-notice__close-icon {
|
|
129
|
+
flex: none;
|
|
130
|
+
width: 14px;
|
|
131
|
+
height: 14px;
|
|
132
|
+
}
|
|
133
|
+
.mh-notice__close-text {
|
|
134
|
+
text-decoration: underline;
|
|
135
|
+
text-underline-offset: 2px;
|
|
136
|
+
}
|
|
137
|
+
/* 只给读屏的文本(关闭位缺省只有图标,必须补一个可读名字) */
|
|
138
|
+
.mh-notice__visually-hidden {
|
|
139
|
+
position: absolute;
|
|
140
|
+
width: 1px;
|
|
141
|
+
height: 1px;
|
|
142
|
+
margin: -1px;
|
|
143
|
+
padding: 0;
|
|
144
|
+
border: 0;
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
white-space: nowrap;
|
|
147
|
+
clip-path: inset(50%);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* 两行排版(有 `message`):整体改顶对齐 —— 两行内容在条里居中会让上下空得奇怪 */
|
|
151
|
+
.mh-notice--titled {
|
|
152
|
+
align-items: flex-start;
|
|
153
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组件几何令牌:取自 @aihub/theme 的 components/alert.css 实测(通栏高 42 / 文案 15px /
|
|
3
|
+
* 警示与错误底取 Alert 专页样张,与语义 03 档两说时以专页为准)
|
|
4
|
+
*
|
|
5
|
+
* ## 抽出说明
|
|
6
|
+
* 本文件从面文件里抽出:这些是**基础值**,锚在 `[data-manohub-ui]`(跨包唯一作用域锚,
|
|
7
|
+
* 由入口层无条件写在应用容器上)—— 任何落在容器里的分件都取得到值,不再依赖
|
|
8
|
+
* 「声明在某个组件根类上」这条脆弱假设。
|
|
9
|
+
* ⚠️ `.mh-<件>--<档>` 这类**档位改写**留在面文件的修饰符块里(拆开会让档位失效)。
|
|
10
|
+
*/
|
|
11
|
+
[data-manohub-ui] {
|
|
12
|
+
--ui-notice-height: 42px;
|
|
13
|
+
--ui-notice-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
|
|
14
|
+
--ui-notice-font: 15px;
|
|
15
|
+
--ui-notice-warning-bg: #fdf4ea;
|
|
16
|
+
--ui-notice-error-bg: #fdecec;
|
|
17
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification —— 通知卡(带标题 / 正文 / 头像 / 标签 / 操作 / 关闭的结构)。
|
|
3
|
+
*
|
|
4
|
+
* 出处:`@aihub/theme` 的 `playground/components/notification.html` 与 `src/components/toast.css`
|
|
5
|
+
* 里的 `--mh-notice-*` 令牌(面板 430 宽 / 最小高 100 / 正文最大高 180 / 圆角 10 / 左边线 6px;
|
|
6
|
+
* 语义淡底五档;标题 16px Te01、正文 14px Te04、关闭槽 10x10 Te07;内距 上下右 16、左 24)。
|
|
7
|
+
* ⚠️ 关闭字形按**组件内联 12** 渲染(规范注记的 10x10 登记为偏差;关闭位是贴小控件的字形,
|
|
8
|
+
* 不并入常规图标档 —— 改前静态样例页按规范画 10、与组件不一致,已同步为 12)。
|
|
9
|
+
*
|
|
10
|
+
* **与 `Notice` 的判据**(两者都在本仓,别互相顶替):
|
|
11
|
+
* - `Notice`(`.mh-notice*`)= **条状提示**(对齐规范 alert 族):一行话 + 可选操作,不带头像 / 标签 / 关闭;
|
|
12
|
+
* - 本件(`.mh-notification*`)= **通知卡**:有标题行(含关闭位)、可带头像与标签、多行正文。
|
|
13
|
+
* 类名刻意不同前缀 —— 规范里两族的类名都叫 `.notice*`,本仓若照抄就会出现两套 `.mh-notice*` 互撞。
|
|
14
|
+
*
|
|
15
|
+
* **左边线用绝对定位伪元素画,不用 `border-left` + `border-image`**:后者会吃掉圆角(规范踩过这个坑)。
|
|
16
|
+
* 语义八档的线色是规范 04 档**渐变**,色板编号写在令牌注释里;底色复用本仓语义弱底令牌(一处定义)。
|
|
17
|
+
*
|
|
18
|
+
* **标签位与操作位不重复实现**:标签用标签族的 `mh-tag mh-tag--status mh-tag--error|--warning`,
|
|
19
|
+
* 操作用按钮族(`.mh-button--sm`)—— 本件只给它们的容器与间距。
|
|
20
|
+
*/
|
|
21
|
+
.mh-notification {
|
|
22
|
+
position: relative;
|
|
23
|
+
overflow: hidden; /* 让伪元素画的左边线跟着圆角走 */
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: var(--ui-space-3);
|
|
26
|
+
width: var(--ui-notification-width);
|
|
27
|
+
min-height: var(--ui-notification-min-height);
|
|
28
|
+
padding: var(--ui-notification-pad) var(--ui-notification-pad) var(--ui-notification-pad)
|
|
29
|
+
var(--ui-notification-pad-left);
|
|
30
|
+
border-radius: var(--ui-notification-radius);
|
|
31
|
+
background: var(--ui-info-weak); /* 缺省档 = info 淡底(规范通知淡底) */
|
|
32
|
+
box-shadow: var(--ui-shadow-elevated);
|
|
33
|
+
}
|
|
34
|
+
.mh-notification::before {
|
|
35
|
+
content: '';
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset: 0 auto 0 0;
|
|
38
|
+
width: var(--ui-notification-line-width);
|
|
39
|
+
background: var(--ui-notification-line);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* 语义档:底色与左边线成对换(`submit` 与 `success` 共用底色,只换线 —— 与规范同构) */
|
|
43
|
+
.mh-notification--info {
|
|
44
|
+
background: var(--ui-info-weak);
|
|
45
|
+
--ui-notification-line: var(--ui-notification-line-info);
|
|
46
|
+
}
|
|
47
|
+
.mh-notification--success {
|
|
48
|
+
background: var(--ui-success-weak);
|
|
49
|
+
--ui-notification-line: var(--ui-notification-line-success);
|
|
50
|
+
}
|
|
51
|
+
.mh-notification--warning {
|
|
52
|
+
background: var(--ui-warning-weak);
|
|
53
|
+
--ui-notification-line: var(--ui-notification-line-warning);
|
|
54
|
+
}
|
|
55
|
+
.mh-notification--error {
|
|
56
|
+
background: var(--ui-error-weak);
|
|
57
|
+
--ui-notification-line: var(--ui-notification-line-error);
|
|
58
|
+
}
|
|
59
|
+
.mh-notification--submit {
|
|
60
|
+
background: var(--ui-success-weak);
|
|
61
|
+
--ui-notification-line: var(--ui-notification-line-submit);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* 正文列:有头像时占余宽 */
|
|
65
|
+
.mh-notification__body {
|
|
66
|
+
flex: 1;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* 标题行:标题左、关闭位右(`space-between` 让关闭位贴右) */
|
|
71
|
+
.mh-notification__title {
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: space-between;
|
|
75
|
+
gap: var(--ui-space-2);
|
|
76
|
+
margin: 0;
|
|
77
|
+
font-size: var(--ui-font-heading); /* 规范 16px */
|
|
78
|
+
font-weight: var(--ui-weight-medium);
|
|
79
|
+
color: var(--ui-base-content);
|
|
80
|
+
}
|
|
81
|
+
.mh-notification__close {
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
flex: none;
|
|
86
|
+
width: var(--ui-notification-close-size);
|
|
87
|
+
height: var(--ui-notification-close-size);
|
|
88
|
+
padding: 0;
|
|
89
|
+
border: none;
|
|
90
|
+
background: transparent;
|
|
91
|
+
color: var(--ui-base-content-muted);
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
.mh-notification__close:hover,
|
|
95
|
+
.mh-notification__close.is-hover {
|
|
96
|
+
color: var(--ui-base-content);
|
|
97
|
+
}
|
|
98
|
+
.mh-notification__close:focus-visible {
|
|
99
|
+
outline: 2px solid var(--ui-primary);
|
|
100
|
+
outline-offset: 2px;
|
|
101
|
+
}
|
|
102
|
+
.mh-notification__text {
|
|
103
|
+
max-height: var(--ui-notification-max-height);
|
|
104
|
+
margin: var(--ui-space-1) 0 0;
|
|
105
|
+
font-size: var(--ui-font-body); /* 规范 14px */
|
|
106
|
+
line-height: var(--ui-line-body);
|
|
107
|
+
color: var(--ui-base-content-muted); /* Te04 */
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* 头像位(静态页 / 无 Avatar 时的兜底字标) */
|
|
111
|
+
.mh-notification__avatar {
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
flex: none;
|
|
116
|
+
width: var(--ui-notification-avatar-size);
|
|
117
|
+
height: var(--ui-notification-avatar-size);
|
|
118
|
+
border-radius: var(--ui-radius-full);
|
|
119
|
+
background: var(--ui-primary-weak);
|
|
120
|
+
color: var(--ui-primary);
|
|
121
|
+
font-size: var(--ui-font-caption);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* 操作位与标签位(标签/按钮的面各归其族,这里只给容器与间距) */
|
|
125
|
+
.mh-notification__actions {
|
|
126
|
+
display: inline-flex;
|
|
127
|
+
gap: var(--ui-space-2);
|
|
128
|
+
margin-top: var(--ui-space-1);
|
|
129
|
+
}
|
|
130
|
+
.mh-notification__tags {
|
|
131
|
+
display: inline-flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
gap: var(--ui-space-1);
|
|
134
|
+
margin-top: var(--ui-space-1);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* 叠放(多条通知纵向排) */
|
|
138
|
+
.mh-notification + .mh-notification {
|
|
139
|
+
margin-top: var(--ui-space-2);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* ===== 语义图标 / 标题行占位 / 关闭位图标 ===== */
|
|
143
|
+
.mh-notification__icon {
|
|
144
|
+
flex: none;
|
|
145
|
+
/* 语义图标是常规图标:尺寸取全局图标档(改前硬写 16) */
|
|
146
|
+
width: var(--ui-font-icon);
|
|
147
|
+
height: var(--ui-font-icon);
|
|
148
|
+
}
|
|
149
|
+
/* 标题文字占满剩余宽度:关闭位自然贴到行尾(不靠 padding 硬挤) */
|
|
150
|
+
.mh-notification__title-text {
|
|
151
|
+
flex: 1;
|
|
152
|
+
min-width: 0;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
text-overflow: ellipsis;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
}
|
|
157
|
+
.mh-notification__close-icon {
|
|
158
|
+
flex: none;
|
|
159
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* notification —— 单件令牌(**基础值**)。
|
|
3
|
+
*
|
|
4
|
+
* 本件自己的几何 / 尺寸 / 色彩槽位;只服务本件,故不随主题进 `@manohub/theme`。
|
|
5
|
+
*
|
|
6
|
+
* ## 抽出说明
|
|
7
|
+
* 本文件从面文件里抽出(原先混写在 `notification.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-notification-width: 430px; /* 规范标准宽 */
|
|
19
|
+
--ui-notification-min-height: 100px;
|
|
20
|
+
--ui-notification-max-height: 180px; /* 正文区最大高 */
|
|
21
|
+
/* 10:规范对「通知条」给的实测值就是 r10(见 `@aihub/theme` 的 `components/toast.css`)。
|
|
22
|
+
**有意不复用 `--ui-radius-md`** —— 该档在 default 主题是 **10**、在 farris 主题是 **8**
|
|
23
|
+
(规范的卡片圆角),引用它会让通知卡在两套主题下不是同一个体量。 */
|
|
24
|
+
--ui-notification-radius: 10px;
|
|
25
|
+
--ui-notification-line-width: 6px; /* 规范左边线实测 6px */
|
|
26
|
+
--ui-notification-pad: var(--ui-space-4); /* 上下右 16 */
|
|
27
|
+
--ui-notification-pad-left: var(--ui-space-6); /* 左 24:让开 6px 线后与内容左缘对齐 */
|
|
28
|
+
--ui-notification-line: var(--ui-primary); /* 缺省档 = info 线 */
|
|
29
|
+
/* 语义左边线:规范 04 档渐变(色板编号见注释,逐条有出处) */
|
|
30
|
+
--ui-notification-line-info: linear-gradient(135deg, #657cff, #4190ff); /* Focus04 常规 */
|
|
31
|
+
--ui-notification-line-submit: linear-gradient(135deg, #12bfd3, #41d5b9); /* Submit04 提交 */
|
|
32
|
+
--ui-notification-line-success: linear-gradient(135deg, #3ca78d, #7bca8b); /* Success04 成功 */
|
|
33
|
+
--ui-notification-line-warning: linear-gradient(135deg, #fc8249, #fe9539); /* Warning04 警告 */
|
|
34
|
+
--ui-notification-line-error: linear-gradient(135deg, #e55875, #ff7878); /* Danger04 失败 */
|
|
35
|
+
--ui-notification-close-size: 10px; /* 规范关闭槽 10x10(Te07) */
|
|
36
|
+
--ui-notification-avatar-size: 36px;
|
|
37
|
+
}
|