@manohub/ui 0.10.5 → 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 +155 -155
  2. package/dist/components/form/index.js +8 -1
  3. package/dist/styles/components/avatar.css +131 -131
  4. package/dist/styles/components/avatar.tokens.css +24 -24
  5. package/dist/styles/components/badge.css +266 -266
  6. package/dist/styles/components/badge.tokens.css +24 -24
  7. package/dist/styles/components/button.css +460 -460
  8. package/dist/styles/components/capsule.css +128 -128
  9. package/dist/styles/components/capsule.tokens.css +27 -27
  10. package/dist/styles/components/card.css +198 -198
  11. package/dist/styles/components/checkbox.css +145 -145
  12. package/dist/styles/components/checkbox.tokens.css +26 -26
  13. package/dist/styles/components/code-block.css +216 -216
  14. package/dist/styles/components/code-block.tokens.css +40 -40
  15. package/dist/styles/components/collapse.css +62 -62
  16. package/dist/styles/components/collapse.tokens.css +20 -20
  17. package/dist/styles/components/dialog.css +158 -158
  18. package/dist/styles/components/dialog.tokens.css +24 -24
  19. package/dist/styles/components/divider.css +75 -75
  20. package/dist/styles/components/divider.tokens.css +22 -22
  21. package/dist/styles/components/drawer.css +143 -143
  22. package/dist/styles/components/drawer.tokens.css +22 -22
  23. package/dist/styles/components/filter.css +29 -29
  24. package/dist/styles/components/form.css +442 -425
  25. package/dist/styles/components/form.tokens.css +15 -15
  26. package/dist/styles/components/input.css +538 -538
  27. package/dist/styles/components/input.tokens.css +43 -43
  28. package/dist/styles/components/layout.css +200 -200
  29. package/dist/styles/components/list-view.css +244 -244
  30. package/dist/styles/components/loading.css +76 -76
  31. package/dist/styles/components/loading.tokens.css +23 -23
  32. package/dist/styles/components/nav.css +48 -48
  33. package/dist/styles/components/notice.css +153 -153
  34. package/dist/styles/components/notice.tokens.css +17 -17
  35. package/dist/styles/components/notification.css +159 -159
  36. package/dist/styles/components/notification.tokens.css +37 -37
  37. package/dist/styles/components/page.css +473 -473
  38. package/dist/styles/components/pagination.css +303 -303
  39. package/dist/styles/components/pagination.tokens.css +32 -32
  40. package/dist/styles/components/panel.css +77 -77
  41. package/dist/styles/components/query-state.css +88 -88
  42. package/dist/styles/components/radio.css +271 -271
  43. package/dist/styles/components/radio.tokens.css +26 -26
  44. package/dist/styles/components/search.css +34 -34
  45. package/dist/styles/components/select.css +326 -326
  46. package/dist/styles/components/select.tokens.css +44 -44
  47. package/dist/styles/components/skeleton.css +60 -60
  48. package/dist/styles/components/skeleton.tokens.css +27 -27
  49. package/dist/styles/components/steps.css +205 -205
  50. package/dist/styles/components/steps.tokens.css +44 -44
  51. package/dist/styles/components/switch.css +165 -165
  52. package/dist/styles/components/switch.tokens.css +26 -26
  53. package/dist/styles/components/tabbar.css +235 -235
  54. package/dist/styles/components/tabbar.tokens.css +30 -30
  55. package/dist/styles/components/table.css +504 -504
  56. package/dist/styles/components/table.tokens.css +44 -44
  57. package/dist/styles/components/tag.css +127 -127
  58. package/dist/styles/components/tag.tokens.css +24 -24
  59. package/dist/styles/components/toast.css +185 -185
  60. package/dist/styles/components/toast.tokens.css +26 -26
  61. package/dist/styles/components/tooltip.css +89 -89
  62. package/dist/styles/components/tooltip.tokens.css +25 -25
  63. package/dist/styles/components/tree.css +173 -173
  64. package/dist/styles/components/upload.css +151 -151
  65. package/dist/styles/components/upload.tokens.css +27 -27
  66. package/dist/styles/index.css +153 -153
  67. package/dist/styles/operations/collapse.css +84 -84
  68. package/dist/styles/operations/popup.css +193 -193
  69. package/dist/styles/operations/tabs.css +82 -82
  70. package/package.json +62 -62
@@ -1,32 +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
- }
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
+ }
@@ -1,77 +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
- }
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
+ }
@@ -1,88 +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
- }
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
+ }