@hsu-react/ui 2.2.0 → 2.2.2

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.
@@ -153,10 +153,7 @@ var Header = observer(function (props) {
153
153
  children: /*#__PURE__*/_jsxs(Space, {
154
154
  className: styles.user,
155
155
  children: [/*#__PURE__*/_jsx(Avatar, {
156
- style: {
157
- backgroundColor: "#1677ff",
158
- verticalAlign: "middle"
159
- },
156
+ className: styles.avatar,
160
157
  icon: nickname ? undefined : /*#__PURE__*/_jsx(UserOutlined, {}),
161
158
  children: nickname === null || nickname === void 0 || (_nickname$ = nickname[0]) === null || _nickname$ === void 0 ? void 0 : _nickname$.toUpperCase()
162
159
  }), nickname]
@@ -91,6 +91,12 @@
91
91
 
92
92
  font-size: 16px;
93
93
 
94
+ .avatar {
95
+ background: var(--vita-primary);
96
+ color: var(--vita-primary-foreground);
97
+ vertical-align: middle;
98
+ }
99
+
94
100
  .user {
95
101
  width: max-content;
96
102
  min-width: max-content;
@@ -35,7 +35,10 @@
35
35
  margin: 0px;
36
36
 
37
37
  border: none;
38
- border-radius: 8px;
38
+ // 只圆上面两角:页签是「贴在内容区上沿」的,下沿要与内容区接平,
39
+ // 四角全圆会让它看起来像一颗浮在栏里的胶囊、和下方内容脱开。
40
+ // 与拖拽时的浮层(.dragOverlay)保持同一形状。
41
+ border-radius: 8px 8px 0 0;
39
42
  background: transparent;
40
43
 
41
44
  transition: background 0.2s;
@@ -166,7 +169,8 @@
166
169
  padding: 6px 16px;
167
170
 
168
171
  background: var(--vita-surface);
169
- border-radius: 6px 6px 0 0;
172
+ // 与页签同一形状(上圆下方、同一半径),拖起来才像是把那颗页签拎了起来
173
+ border-radius: 8px 8px 0 0;
170
174
  border: 1px solid var(--vita-border);
171
175
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
172
176
 
@@ -158,10 +158,7 @@ const Header = (0, _mobxReactLite.observer)(props => {
158
158
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
159
159
  className: _indexModule.default.user,
160
160
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Avatar, {
161
- style: {
162
- backgroundColor: "#1677ff",
163
- verticalAlign: "middle"
164
- },
161
+ className: _indexModule.default.avatar,
165
162
  icon: nickname ? undefined : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.UserOutlined, {}),
166
163
  children: nickname?.[0]?.toUpperCase()
167
164
  }), nickname]
@@ -91,6 +91,12 @@
91
91
 
92
92
  font-size: 16px;
93
93
 
94
+ .avatar {
95
+ background: var(--vita-primary);
96
+ color: var(--vita-primary-foreground);
97
+ vertical-align: middle;
98
+ }
99
+
94
100
  .user {
95
101
  width: max-content;
96
102
  min-width: max-content;
@@ -35,7 +35,10 @@
35
35
  margin: 0px;
36
36
 
37
37
  border: none;
38
- border-radius: 8px;
38
+ // 只圆上面两角:页签是「贴在内容区上沿」的,下沿要与内容区接平,
39
+ // 四角全圆会让它看起来像一颗浮在栏里的胶囊、和下方内容脱开。
40
+ // 与拖拽时的浮层(.dragOverlay)保持同一形状。
41
+ border-radius: 8px 8px 0 0;
39
42
  background: transparent;
40
43
 
41
44
  transition: background 0.2s;
@@ -166,7 +169,8 @@
166
169
  padding: 6px 16px;
167
170
 
168
171
  background: var(--vita-surface);
169
- border-radius: 6px 6px 0 0;
172
+ // 与页签同一形状(上圆下方、同一半径),拖起来才像是把那颗页签拎了起来
173
+ border-radius: 8px 8px 0 0;
170
174
  border: 1px solid var(--vita-border);
171
175
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
172
176
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hsu-react/ui",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "一套基于 React + Ant Design 的中后台业务组件库",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -91,6 +91,12 @@
91
91
 
92
92
  font-size: 16px;
93
93
 
94
+ .avatar {
95
+ background: var(--vita-primary);
96
+ color: var(--vita-primary-foreground);
97
+ vertical-align: middle;
98
+ }
99
+
94
100
  .user {
95
101
  width: max-content;
96
102
  min-width: max-content;
@@ -192,8 +192,10 @@ const Header: React.FC<HeaderProps> = observer((props) => {
192
192
  }
193
193
  >
194
194
  <Space className={styles.user}>
195
+ {/* 底色跟随主色。从前这里写死 antd 蓝 #1677ff,而且是**行内样式**——
196
+ 换过品牌色的项目连用 CSS 都盖不住,一颗蓝点钉在整套配色里 */}
195
197
  <Avatar
196
- style={{ backgroundColor: "#1677ff", verticalAlign: "middle" }}
198
+ className={styles.avatar}
197
199
  icon={nickname ? undefined : <UserOutlined />}
198
200
  >
199
201
  {nickname?.[0]?.toUpperCase()}
@@ -47,6 +47,8 @@ export default () => (
47
47
 
48
48
  ## 说明
49
49
 
50
+ 页签是「贴在内容区上沿」的形状:只圆上面两角,下沿与内容区接平(拖拽时的浮层同形)。
51
+
50
52
  页签由访问过的路由累积而来,文案取 `meta.name`、图标取 `meta.icon`。两个开关直接影响这里:
51
53
 
52
54
  - `meta.noTabsView` —— 该路由不进页签栏(它的子路由会顶上来)
@@ -35,7 +35,10 @@
35
35
  margin: 0px;
36
36
 
37
37
  border: none;
38
- border-radius: 8px;
38
+ // 只圆上面两角:页签是「贴在内容区上沿」的,下沿要与内容区接平,
39
+ // 四角全圆会让它看起来像一颗浮在栏里的胶囊、和下方内容脱开。
40
+ // 与拖拽时的浮层(.dragOverlay)保持同一形状。
41
+ border-radius: 8px 8px 0 0;
39
42
  background: transparent;
40
43
 
41
44
  transition: background 0.2s;
@@ -166,7 +169,8 @@
166
169
  padding: 6px 16px;
167
170
 
168
171
  background: var(--vita-surface);
169
- border-radius: 6px 6px 0 0;
172
+ // 与页签同一形状(上圆下方、同一半径),拖起来才像是把那颗页签拎了起来
173
+ border-radius: 8px 8px 0 0;
170
174
  border: 1px solid var(--vita-border);
171
175
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
172
176