@hsu-react/ui 2.2.1 → 2.2.3

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;
@@ -66,8 +66,11 @@
66
66
  }
67
67
  }
68
68
 
69
+ // 悬浮态用 --vita-hover,不要用 --vita-border-weak:后者是**边框**色,
70
+ // 消费方换配色时会连着边框一起调,没法单独把悬浮底改暖/改冷。默认值也不合适
71
+ // ——它比 --vita-hover 更实,压在自定义底色上会显出一块异色方块。
69
72
  &:hover {
70
- background: var(--vita-border-weak);
73
+ background: var(--vita-hover);
71
74
  }
72
75
 
73
76
  &:global(.ant-tabs-tab-active) {
@@ -117,7 +117,12 @@ export var toAntdTheme = function toAntdTheme(options) {
117
117
  colorBgContainer: t.surface,
118
118
  colorBgElevated: t.surface,
119
119
  colorBgLayout: t.background,
120
- colorBgSpotlight: t.muted,
120
+ // `colorBgSpotlight` 故意不接管。它只服务 Tooltip,而 antd 把 Tooltip 的文字色写死成
121
+ // `colorTextLightSolid`(白),底色必须是深色才读得出来——把它指到 `muted` 这种浅色
122
+ // 中性面,亮色下就成了白字打在近白底上,整条提示语看不见。
123
+ // antd 两套算法给的默认值本来就是深的(亮色 rgba(0,0,0,.85)、暗色抬亮的深灰),
124
+ // 交回给它。
125
+
121
126
  // antd paints table headers / filled controls from the Fill ramp; pointing the top of it at
122
127
  // `muted` is what keeps those surfaces on the zinc scale instead of antd's default greys.
123
128
  colorFillAlter: t.muted,
@@ -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;
@@ -66,8 +66,11 @@
66
66
  }
67
67
  }
68
68
 
69
+ // 悬浮态用 --vita-hover,不要用 --vita-border-weak:后者是**边框**色,
70
+ // 消费方换配色时会连着边框一起调,没法单独把悬浮底改暖/改冷。默认值也不合适
71
+ // ——它比 --vita-hover 更实,压在自定义底色上会显出一块异色方块。
69
72
  &:hover {
70
- background: var(--vita-border-weak);
73
+ background: var(--vita-hover);
71
74
  }
72
75
 
73
76
  &:global(.ant-tabs-tab-active) {
@@ -102,7 +102,12 @@ const toAntdTheme = options => {
102
102
  colorBgContainer: t.surface,
103
103
  colorBgElevated: t.surface,
104
104
  colorBgLayout: t.background,
105
- colorBgSpotlight: t.muted,
105
+ // `colorBgSpotlight` 故意不接管。它只服务 Tooltip,而 antd 把 Tooltip 的文字色写死成
106
+ // `colorTextLightSolid`(白),底色必须是深色才读得出来——把它指到 `muted` 这种浅色
107
+ // 中性面,亮色下就成了白字打在近白底上,整条提示语看不见。
108
+ // antd 两套算法给的默认值本来就是深的(亮色 rgba(0,0,0,.85)、暗色抬亮的深灰),
109
+ // 交回给它。
110
+
106
111
  // antd paints table headers / filled controls from the Fill ramp; pointing the top of it at
107
112
  // `muted` is what keeps those surfaces on the zinc scale instead of antd's default greys.
108
113
  colorFillAlter: t.muted,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hsu-react/ui",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
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()}
@@ -66,8 +66,11 @@
66
66
  }
67
67
  }
68
68
 
69
+ // 悬浮态用 --vita-hover,不要用 --vita-border-weak:后者是**边框**色,
70
+ // 消费方换配色时会连着边框一起调,没法单独把悬浮底改暖/改冷。默认值也不合适
71
+ // ——它比 --vita-hover 更实,压在自定义底色上会显出一块异色方块。
69
72
  &:hover {
70
- background: var(--vita-border-weak);
73
+ background: var(--vita-hover);
71
74
  }
72
75
 
73
76
  &:global(.ant-tabs-tab-active) {
@@ -149,7 +149,12 @@ export const toAntdTheme = (options?: {
149
149
  colorBgContainer: t.surface,
150
150
  colorBgElevated: t.surface,
151
151
  colorBgLayout: t.background,
152
- colorBgSpotlight: t.muted,
152
+
153
+ // `colorBgSpotlight` 故意不接管。它只服务 Tooltip,而 antd 把 Tooltip 的文字色写死成
154
+ // `colorTextLightSolid`(白),底色必须是深色才读得出来——把它指到 `muted` 这种浅色
155
+ // 中性面,亮色下就成了白字打在近白底上,整条提示语看不见。
156
+ // antd 两套算法给的默认值本来就是深的(亮色 rgba(0,0,0,.85)、暗色抬亮的深灰),
157
+ // 交回给它。
153
158
 
154
159
  // antd paints table headers / filled controls from the Fill ramp; pointing the top of it at
155
160
  // `muted` is what keeps those surfaces on the zinc scale instead of antd's default greys.