@manohub/ui 0.10.4 → 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 (72) hide show
  1. package/README.md +155 -155
  2. package/dist/components/form/index.js +8 -1
  3. package/dist/components/tabs/index.d.ts +9 -6
  4. package/dist/components/tabs/index.js +6 -1
  5. package/dist/styles/components/avatar.css +131 -131
  6. package/dist/styles/components/avatar.tokens.css +24 -24
  7. package/dist/styles/components/badge.css +266 -266
  8. package/dist/styles/components/badge.tokens.css +24 -24
  9. package/dist/styles/components/button.css +460 -460
  10. package/dist/styles/components/capsule.css +128 -128
  11. package/dist/styles/components/capsule.tokens.css +27 -27
  12. package/dist/styles/components/card.css +198 -198
  13. package/dist/styles/components/checkbox.css +145 -145
  14. package/dist/styles/components/checkbox.tokens.css +26 -26
  15. package/dist/styles/components/code-block.css +216 -216
  16. package/dist/styles/components/code-block.tokens.css +40 -40
  17. package/dist/styles/components/collapse.css +62 -62
  18. package/dist/styles/components/collapse.tokens.css +20 -20
  19. package/dist/styles/components/dialog.css +158 -158
  20. package/dist/styles/components/dialog.tokens.css +24 -24
  21. package/dist/styles/components/divider.css +75 -75
  22. package/dist/styles/components/divider.tokens.css +22 -22
  23. package/dist/styles/components/drawer.css +143 -143
  24. package/dist/styles/components/drawer.tokens.css +22 -22
  25. package/dist/styles/components/filter.css +29 -29
  26. package/dist/styles/components/form.css +442 -430
  27. package/dist/styles/components/form.tokens.css +15 -15
  28. package/dist/styles/components/input.css +538 -533
  29. package/dist/styles/components/input.tokens.css +43 -43
  30. package/dist/styles/components/layout.css +200 -200
  31. package/dist/styles/components/list-view.css +244 -244
  32. package/dist/styles/components/loading.css +76 -76
  33. package/dist/styles/components/loading.tokens.css +23 -23
  34. package/dist/styles/components/nav.css +48 -48
  35. package/dist/styles/components/notice.css +153 -153
  36. package/dist/styles/components/notice.tokens.css +17 -17
  37. package/dist/styles/components/notification.css +159 -159
  38. package/dist/styles/components/notification.tokens.css +37 -37
  39. package/dist/styles/components/page.css +473 -473
  40. package/dist/styles/components/pagination.css +303 -303
  41. package/dist/styles/components/pagination.tokens.css +32 -32
  42. package/dist/styles/components/panel.css +77 -77
  43. package/dist/styles/components/query-state.css +88 -88
  44. package/dist/styles/components/radio.css +271 -271
  45. package/dist/styles/components/radio.tokens.css +26 -26
  46. package/dist/styles/components/search.css +34 -34
  47. package/dist/styles/components/select.css +326 -326
  48. package/dist/styles/components/select.tokens.css +44 -44
  49. package/dist/styles/components/skeleton.css +60 -60
  50. package/dist/styles/components/skeleton.tokens.css +27 -27
  51. package/dist/styles/components/steps.css +205 -205
  52. package/dist/styles/components/steps.tokens.css +44 -44
  53. package/dist/styles/components/switch.css +165 -165
  54. package/dist/styles/components/switch.tokens.css +26 -26
  55. package/dist/styles/components/tabbar.css +235 -235
  56. package/dist/styles/components/tabbar.tokens.css +30 -30
  57. package/dist/styles/components/table.css +504 -504
  58. package/dist/styles/components/table.tokens.css +44 -44
  59. package/dist/styles/components/tag.css +127 -127
  60. package/dist/styles/components/tag.tokens.css +24 -24
  61. package/dist/styles/components/toast.css +185 -185
  62. package/dist/styles/components/toast.tokens.css +26 -26
  63. package/dist/styles/components/tooltip.css +89 -89
  64. package/dist/styles/components/tooltip.tokens.css +25 -25
  65. package/dist/styles/components/tree.css +173 -173
  66. package/dist/styles/components/upload.css +151 -151
  67. package/dist/styles/components/upload.tokens.css +27 -27
  68. package/dist/styles/index.css +153 -153
  69. package/dist/styles/operations/collapse.css +84 -84
  70. package/dist/styles/operations/popup.css +193 -193
  71. package/dist/styles/operations/tabs.css +82 -73
  72. package/package.json +62 -62
@@ -1,131 +1,131 @@
1
- /**
2
- * Avatar —— 头像(四档尺寸 / 文字 / 图标 / 占位 / 方角 / 带框 / 计数 / 头像组 / 角标)。
3
- *
4
- * 出处:`@aihub/theme` 的 `playground/components/avatar.css` 与 `src/components/avatar.css`
5
- * (实测四档 24 / 36 / 60 / 80;字母底色取主色;角标高 20 白描边)。
6
- *
7
- * 两条来自规范的硬结论,改前先读:
8
- * 1. **圆形裁切归图片自身,容器不裁**:角上的角标(`__badge`)与徽章(`__chip`)是绝对定位件,
9
- * 容器若带 `overflow: hidden`,会沿圆弧把它们各切掉一半(实测反馈)。故容器 `overflow: visible`,
10
- * 图片用 `border-radius: inherit` 跟着形态自裁。
11
- * 2. **头像组靠负边距堆叠**(`.mh-avatar-group`),每个头像带 2px 的底描边把相邻项隔开。
12
- */
13
- .mh-avatar {
14
- display: inline-flex;
15
- align-items: center;
16
- justify-content: center;
17
- position: relative;
18
- flex-shrink: 0;
19
- overflow: visible; /* 见文件头第 1 条:裁切归图片 */
20
- border-radius: var(--ui-radius-full);
21
- background: var(--ui-base-400); /* Ne04 占位底 */
22
- color: var(--ui-base-100); /* 占位前景 */
23
- }
24
-
25
- /* 图片:撑满 + 跟随形态自裁(否则去掉容器 overflow 后长宽不符的图会外溢)。
26
- `display: block` 必须自己写:元素级基线不再把 `img` 转块级(那条会压消费方的 `h-*` / `hidden`),
27
- 否则行内基线间隙会把圆形头像顶偏。 */
28
- .mh-avatar > img {
29
- display: block;
30
- width: 100%;
31
- height: 100%;
32
- border-radius: inherit;
33
- object-fit: cover;
34
- }
35
-
36
- /* ===== 尺寸四档 ===== */
37
- .mh-avatar--sm {
38
- width: var(--ui-avatar-size-sm);
39
- height: var(--ui-avatar-size-sm);
40
- font-size: var(--ui-font-caption);
41
- }
42
- .mh-avatar--md {
43
- width: var(--ui-avatar-size-md);
44
- height: var(--ui-avatar-size-md);
45
- font-size: var(--ui-font-caption);
46
- }
47
- .mh-avatar--lg {
48
- width: var(--ui-avatar-size-lg);
49
- height: var(--ui-avatar-size-lg);
50
- font-size: var(--ui-font-title);
51
- }
52
- .mh-avatar--xl {
53
- width: var(--ui-avatar-size-xl);
54
- height: var(--ui-avatar-size-xl);
55
- font-size: var(--ui-font-display);
56
- }
57
-
58
- /* ===== 内容形态 ===== */
59
- /* 文字头像:底取主色(业务要按人名哈希换色时给 `.mh-avatar--letter` 覆盖 background 即可) */
60
- .mh-avatar--letter {
61
- background: var(--ui-primary);
62
- }
63
- /* 图标头像:图标由 @manohub/icon 渲染,这里只给尺寸档 */
64
- .mh-avatar--icon {
65
- color: var(--ui-base-100);
66
- }
67
- /* 占位:虚线框 + 说明字(虚线线色取线型档,口径「实线 base-300 / 虚线 base-400」) */
68
- .mh-avatar--placeholder {
69
- border: 1px dashed var(--ui-line-dashed);
70
- background: var(--ui-base-100);
71
- color: var(--ui-base-content-subtle);
72
- font-size: var(--ui-font-caption);
73
- }
74
- /* 方角(商业图像):圆角矩形 */
75
- .mh-avatar--square {
76
- border-radius: var(--ui-radius-control);
77
- }
78
- /* 带框:靠阴影画出 2px 底环(不占布局,避免与角标抢位) */
79
- .mh-avatar--framed {
80
- box-shadow: 0 0 0 2px var(--ui-base-100), var(--ui-shadow-card);
81
- }
82
- /* 计数档(头像组末位的「+N」) */
83
- .mh-avatar--count {
84
- background: var(--ui-base-200);
85
- color: var(--ui-base-content-muted);
86
- font-size: var(--ui-font-caption);
87
- }
88
-
89
- /* ===== 角上外挂件(见文件头第 1 条:容器不裁,故它们不会被切)===== */
90
- .mh-avatar__badge {
91
- position: absolute;
92
- top: 0;
93
- right: 0;
94
- display: flex;
95
- align-items: center;
96
- justify-content: center;
97
- min-width: var(--ui-avatar-badge-size);
98
- height: var(--ui-avatar-badge-size);
99
- padding: 0 var(--ui-space-1);
100
- border-radius: var(--ui-radius-full);
101
- background: var(--ui-error); /* 红底(规范 Badge 专页实测) */
102
- border: 2px solid var(--ui-base-100); /* 白描边 */
103
- color: var(--ui-error-content);
104
- font-size: var(--ui-font-caption);
105
- }
106
- .mh-avatar__chip {
107
- position: absolute;
108
- right: -2px;
109
- bottom: -2px;
110
- display: flex;
111
- align-items: center;
112
- justify-content: center;
113
- width: 24px;
114
- height: 24px;
115
- border-radius: var(--ui-radius-full);
116
- background: var(--ui-primary);
117
- border: 2px solid var(--ui-base-100);
118
- cursor: pointer;
119
- }
120
-
121
- /* ===== 头像组:负边距堆叠,靠 2px 底描边分隔 ===== */
122
- .mh-avatar-group {
123
- display: inline-flex;
124
- align-items: center;
125
- }
126
- .mh-avatar-group .mh-avatar {
127
- border: 2px solid var(--ui-base-100);
128
- }
129
- .mh-avatar-group .mh-avatar + .mh-avatar {
130
- margin-left: calc(-1 * var(--ui-avatar-gap));
131
- }
1
+ /**
2
+ * Avatar —— 头像(四档尺寸 / 文字 / 图标 / 占位 / 方角 / 带框 / 计数 / 头像组 / 角标)。
3
+ *
4
+ * 出处:`@aihub/theme` 的 `playground/components/avatar.css` 与 `src/components/avatar.css`
5
+ * (实测四档 24 / 36 / 60 / 80;字母底色取主色;角标高 20 白描边)。
6
+ *
7
+ * 两条来自规范的硬结论,改前先读:
8
+ * 1. **圆形裁切归图片自身,容器不裁**:角上的角标(`__badge`)与徽章(`__chip`)是绝对定位件,
9
+ * 容器若带 `overflow: hidden`,会沿圆弧把它们各切掉一半(实测反馈)。故容器 `overflow: visible`,
10
+ * 图片用 `border-radius: inherit` 跟着形态自裁。
11
+ * 2. **头像组靠负边距堆叠**(`.mh-avatar-group`),每个头像带 2px 的底描边把相邻项隔开。
12
+ */
13
+ .mh-avatar {
14
+ display: inline-flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ position: relative;
18
+ flex-shrink: 0;
19
+ overflow: visible; /* 见文件头第 1 条:裁切归图片 */
20
+ border-radius: var(--ui-radius-full);
21
+ background: var(--ui-base-400); /* Ne04 占位底 */
22
+ color: var(--ui-base-100); /* 占位前景 */
23
+ }
24
+
25
+ /* 图片:撑满 + 跟随形态自裁(否则去掉容器 overflow 后长宽不符的图会外溢)。
26
+ `display: block` 必须自己写:元素级基线不再把 `img` 转块级(那条会压消费方的 `h-*` / `hidden`),
27
+ 否则行内基线间隙会把圆形头像顶偏。 */
28
+ .mh-avatar > img {
29
+ display: block;
30
+ width: 100%;
31
+ height: 100%;
32
+ border-radius: inherit;
33
+ object-fit: cover;
34
+ }
35
+
36
+ /* ===== 尺寸四档 ===== */
37
+ .mh-avatar--sm {
38
+ width: var(--ui-avatar-size-sm);
39
+ height: var(--ui-avatar-size-sm);
40
+ font-size: var(--ui-font-caption);
41
+ }
42
+ .mh-avatar--md {
43
+ width: var(--ui-avatar-size-md);
44
+ height: var(--ui-avatar-size-md);
45
+ font-size: var(--ui-font-caption);
46
+ }
47
+ .mh-avatar--lg {
48
+ width: var(--ui-avatar-size-lg);
49
+ height: var(--ui-avatar-size-lg);
50
+ font-size: var(--ui-font-title);
51
+ }
52
+ .mh-avatar--xl {
53
+ width: var(--ui-avatar-size-xl);
54
+ height: var(--ui-avatar-size-xl);
55
+ font-size: var(--ui-font-display);
56
+ }
57
+
58
+ /* ===== 内容形态 ===== */
59
+ /* 文字头像:底取主色(业务要按人名哈希换色时给 `.mh-avatar--letter` 覆盖 background 即可) */
60
+ .mh-avatar--letter {
61
+ background: var(--ui-primary);
62
+ }
63
+ /* 图标头像:图标由 @manohub/icon 渲染,这里只给尺寸档 */
64
+ .mh-avatar--icon {
65
+ color: var(--ui-base-100);
66
+ }
67
+ /* 占位:虚线框 + 说明字(虚线线色取线型档,口径「实线 base-300 / 虚线 base-400」) */
68
+ .mh-avatar--placeholder {
69
+ border: 1px dashed var(--ui-line-dashed);
70
+ background: var(--ui-base-100);
71
+ color: var(--ui-base-content-subtle);
72
+ font-size: var(--ui-font-caption);
73
+ }
74
+ /* 方角(商业图像):圆角矩形 */
75
+ .mh-avatar--square {
76
+ border-radius: var(--ui-radius-control);
77
+ }
78
+ /* 带框:靠阴影画出 2px 底环(不占布局,避免与角标抢位) */
79
+ .mh-avatar--framed {
80
+ box-shadow: 0 0 0 2px var(--ui-base-100), var(--ui-shadow-card);
81
+ }
82
+ /* 计数档(头像组末位的「+N」) */
83
+ .mh-avatar--count {
84
+ background: var(--ui-base-200);
85
+ color: var(--ui-base-content-muted);
86
+ font-size: var(--ui-font-caption);
87
+ }
88
+
89
+ /* ===== 角上外挂件(见文件头第 1 条:容器不裁,故它们不会被切)===== */
90
+ .mh-avatar__badge {
91
+ position: absolute;
92
+ top: 0;
93
+ right: 0;
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: center;
97
+ min-width: var(--ui-avatar-badge-size);
98
+ height: var(--ui-avatar-badge-size);
99
+ padding: 0 var(--ui-space-1);
100
+ border-radius: var(--ui-radius-full);
101
+ background: var(--ui-error); /* 红底(规范 Badge 专页实测) */
102
+ border: 2px solid var(--ui-base-100); /* 白描边 */
103
+ color: var(--ui-error-content);
104
+ font-size: var(--ui-font-caption);
105
+ }
106
+ .mh-avatar__chip {
107
+ position: absolute;
108
+ right: -2px;
109
+ bottom: -2px;
110
+ display: flex;
111
+ align-items: center;
112
+ justify-content: center;
113
+ width: 24px;
114
+ height: 24px;
115
+ border-radius: var(--ui-radius-full);
116
+ background: var(--ui-primary);
117
+ border: 2px solid var(--ui-base-100);
118
+ cursor: pointer;
119
+ }
120
+
121
+ /* ===== 头像组:负边距堆叠,靠 2px 底描边分隔 ===== */
122
+ .mh-avatar-group {
123
+ display: inline-flex;
124
+ align-items: center;
125
+ }
126
+ .mh-avatar-group .mh-avatar {
127
+ border: 2px solid var(--ui-base-100);
128
+ }
129
+ .mh-avatar-group .mh-avatar + .mh-avatar {
130
+ margin-left: calc(-1 * var(--ui-avatar-gap));
131
+ }
@@ -1,24 +1,24 @@
1
- /**
2
- * avatar —— 单件令牌(**基础值**)。
3
- *
4
- * 本件自己的几何 / 尺寸 / 色彩槽位;只服务本件,故不随主题进 `@manohub/theme`。
5
- *
6
- * ## 抽出说明
7
- * 本文件从面文件里抽出(原先混写在 `avatar.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
- /* 单件令牌(只服务本件;跨件令牌才进 theme/) */
18
- --ui-avatar-size-sm: 24px;
19
- --ui-avatar-size-md: 36px;
20
- --ui-avatar-size-lg: 60px;
21
- --ui-avatar-size-xl: 80px;
22
- --ui-avatar-badge-size: 20px; /* 角标高 20,宽按位数撑开 */
23
- --ui-avatar-gap: 10px; /* 堆叠重叠量(组件可用 gap 覆盖) */
24
- }
1
+ /**
2
+ * avatar —— 单件令牌(**基础值**)。
3
+ *
4
+ * 本件自己的几何 / 尺寸 / 色彩槽位;只服务本件,故不随主题进 `@manohub/theme`。
5
+ *
6
+ * ## 抽出说明
7
+ * 本文件从面文件里抽出(原先混写在 `avatar.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
+ /* 单件令牌(只服务本件;跨件令牌才进 theme/) */
18
+ --ui-avatar-size-sm: 24px;
19
+ --ui-avatar-size-md: 36px;
20
+ --ui-avatar-size-lg: 60px;
21
+ --ui-avatar-size-xl: 80px;
22
+ --ui-avatar-badge-size: 20px; /* 角标高 20,宽按位数撑开 */
23
+ --ui-avatar-gap: 10px; /* 堆叠重叠量(组件可用 gap 覆盖) */
24
+ }