@arcblock/ux 3.4.9 → 3.4.10

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.
@@ -1,32 +1,32 @@
1
- import { jsxs as o, jsx as e, Fragment as w } from "react/jsx-runtime";
2
- import { Box as t, Typography as C, Chip as v, alpha as I } from "@mui/material";
3
- import { Icon as s } from "@iconify/react";
1
+ import { jsxs as n, jsx as e, Fragment as w } from "react/jsx-runtime";
2
+ import { Box as o, Typography as C, Chip as v, alpha as I } from "@mui/material";
3
+ import { Icon as p } from "@iconify/react";
4
4
  import S from "@iconify-icons/material-symbols/swap-horiz-rounded";
5
- import z from "@iconify-icons/material-symbols/arrow-right-alt-rounded";
6
- import { useMemoizedFn as R, useCreation as m } from "ahooks";
7
- import d from "lodash/noop";
8
- import D from "../../Avatar/index.js";
9
- import { getUserAvatar as k } from "../../Util/index.js";
10
- import A from "./session-user-switch.js";
11
- import { getWallet as U } from "../libs/utils.js";
12
- import { translations as W } from "../libs/translation.js";
13
- import { translate as j } from "../../Locale/util.js";
14
- import M from "../../Tag/index.js";
15
- function V({
5
+ import _ from "@iconify-icons/material-symbols/arrow-right-alt-rounded";
6
+ import { useMemoizedFn as z, useCreation as d } from "ahooks";
7
+ import m from "lodash/noop";
8
+ import R from "../../Avatar/index.js";
9
+ import { getUserAvatar as D } from "../../Util/index.js";
10
+ import k from "./session-user-switch.js";
11
+ import { getWallet as N } from "../libs/utils.js";
12
+ import { translations as A } from "../libs/translation.js";
13
+ import { translate as U } from "../../Locale/util.js";
14
+ import W from "../../Tag/index.js";
15
+ function Q({
16
16
  session: r,
17
17
  onSwitchPassport: l,
18
18
  onSwitchAccount: u,
19
19
  onBindWallet: f,
20
- onSwitchProfile: h = d,
20
+ onSwitchProfile: h = m,
21
21
  locale: c = "en",
22
- isBlocklet: i = !0,
23
- mode: a = "normal"
22
+ isBlocklet: a = !0,
23
+ mode: i = "normal"
24
24
  }) {
25
- const p = R((n, b = {}) => j(W, n, c, "en", b)), g = k(r.user?.avatar?.replace(/\s/g, encodeURIComponent(" ")), 64), x = m(() => r.user?.passports?.find(
26
- (n) => n.name === r.user.role || n.role === r.user.role
27
- ), [r?.user?.passports, r?.user?.role]), y = m(() => U(r?.user), [r?.user]);
28
- return /* @__PURE__ */ o(
29
- t,
25
+ const s = z((t, b = {}) => U(A, t, c, "en", b)), g = D(r.user?.avatar?.replace(/\s/g, encodeURIComponent(" ")), 64), x = d(() => r.user?.passports?.find(
26
+ (t) => t.name === r.user.role || t.role === r.user.role
27
+ ), [r?.user?.passports, r?.user?.role]), y = d(() => N(r?.user), [r?.user]);
28
+ return /* @__PURE__ */ n(
29
+ o,
30
30
  {
31
31
  sx: {
32
32
  py: 2,
@@ -37,8 +37,8 @@ function V({
37
37
  gap: 1.5
38
38
  },
39
39
  children: [
40
- /* @__PURE__ */ o(
41
- t,
40
+ /* @__PURE__ */ n(
41
+ o,
42
42
  {
43
43
  sx: {
44
44
  display: "flex",
@@ -48,8 +48,8 @@ function V({
48
48
  px: 2
49
49
  },
50
50
  children: [
51
- /* @__PURE__ */ o(
52
- t,
51
+ /* @__PURE__ */ n(
52
+ o,
53
53
  {
54
54
  sx: {
55
55
  display: "flex",
@@ -57,21 +57,21 @@ function V({
57
57
  gap: 1.5
58
58
  },
59
59
  children: [
60
- a === "normal" ? /* @__PURE__ */ e(
61
- t,
60
+ i === "normal" ? /* @__PURE__ */ e(
61
+ o,
62
62
  {
63
- onClick: i ? d : h,
63
+ onClick: a ? m : h,
64
64
  "data-cy": "sessionManager-switch-profile-trigger",
65
65
  sx: {
66
- cursor: i ? "default" : "pointer",
66
+ cursor: a ? "default" : "pointer",
67
67
  position: "relative",
68
68
  borderRadius: "100%",
69
69
  overflow: "hidden",
70
70
  fontSize: 0,
71
71
  flexShrink: 0,
72
- "&:hover": i ? {} : {
72
+ "&:hover": a ? {} : {
73
73
  "&::after": {
74
- content: `"${p("switch")}"`,
74
+ content: `"${s("switch")}"`,
75
75
  position: "absolute",
76
76
  bottom: 0,
77
77
  background: "rgba(0, 0, 0, 0.2)",
@@ -86,7 +86,7 @@ function V({
86
86
  }
87
87
  },
88
88
  children: /* @__PURE__ */ e(
89
- D,
89
+ R,
90
90
  {
91
91
  variant: "circle",
92
92
  did: r.user.did,
@@ -94,39 +94,40 @@ function V({
94
94
  size: 48,
95
95
  shape: "circle",
96
96
  sx: {
97
- cursor: i ? "unset" : "pointer"
97
+ cursor: a ? "unset" : "pointer"
98
98
  }
99
99
  }
100
100
  )
101
101
  }
102
102
  ) : null,
103
- /* @__PURE__ */ o(t, { children: [
104
- /* @__PURE__ */ e(C, { variant: a === "normal" ? "h6" : "h4", sx: { wordBreak: "break-word" }, children: r.user.fullName }),
105
- a === "normal" ? null : /* @__PURE__ */ o(
106
- M,
103
+ /* @__PURE__ */ n(o, { children: [
104
+ /* @__PURE__ */ e(C, { variant: i === "normal" ? "h6" : "h4", sx: { wordBreak: "break-word" }, children: r.user.fullName }),
105
+ i === "normal" ? null : /* @__PURE__ */ n(
106
+ W,
107
107
  {
108
+ className: "user-info__connected-tag",
108
109
  type: "primary",
109
110
  sx: {
110
111
  transform: "scale(0.85)",
111
112
  transformOrigin: "left",
112
- color: "white !important",
113
113
  display: "flex",
114
114
  alignItems: "center"
115
115
  },
116
116
  children: [
117
117
  /* @__PURE__ */ e(
118
- t,
118
+ o,
119
119
  {
120
+ className: "user-info__connected-tag__dot",
120
121
  sx: {
121
122
  mr: 0.75,
122
123
  width: 6,
123
124
  height: 6,
124
- backgroundColor: "white",
125
+ backgroundColor: (t) => t.palette.text.contrast,
125
126
  borderRadius: "100vw"
126
127
  }
127
128
  }
128
129
  ),
129
- /* @__PURE__ */ e(t, { children: "DID CONNECTED" })
130
+ /* @__PURE__ */ e(o, { className: "user-info__connected-tag__text", children: "DID CONNECTED" })
130
131
  ]
131
132
  }
132
133
  )
@@ -134,7 +135,7 @@ function V({
134
135
  ]
135
136
  }
136
137
  ),
137
- a === "normal" ? /* @__PURE__ */ e(
138
+ i === "normal" ? /* @__PURE__ */ e(
138
139
  v,
139
140
  {
140
141
  label: x?.title || r.user?.role.toUpperCase(),
@@ -153,7 +154,7 @@ function V({
153
154
  boxShadow: "none"
154
155
  }
155
156
  },
156
- deleteIcon: /* @__PURE__ */ e(s, { icon: S, color: "inherit" }),
157
+ deleteIcon: /* @__PURE__ */ e(p, { icon: S, color: "inherit" }),
157
158
  onDelete: l,
158
159
  onClick: l,
159
160
  "data-cy": "sessionManager-switch-passport-trigger"
@@ -162,14 +163,14 @@ function V({
162
163
  ]
163
164
  }
164
165
  ),
165
- a === "normal" ? /* @__PURE__ */ o(w, { children: [
166
- /* @__PURE__ */ e(A, { session: r, onSwitch: u, isBlocklet: i, locale: c }),
167
- y ? null : /* @__PURE__ */ o(
168
- t,
166
+ i === "normal" ? /* @__PURE__ */ n(w, { children: [
167
+ /* @__PURE__ */ e(k, { session: r, onSwitch: u, isBlocklet: a, locale: c }),
168
+ y ? null : /* @__PURE__ */ n(
169
+ o,
169
170
  {
170
171
  sx: {
171
172
  color: "secondary.main",
172
- bgcolor: ({ palette: n }) => I(n.secondary.main, 0.05),
173
+ bgcolor: ({ palette: t }) => I(t.secondary.main, 0.05),
173
174
  borderRadius: 1,
174
175
  display: "flex",
175
176
  justifyContent: "space-between",
@@ -183,8 +184,8 @@ function V({
183
184
  onClick: f,
184
185
  "data-cy": "sessionManager-bind-trigger",
185
186
  children: [
186
- p("connectDIDWallet"),
187
- /* @__PURE__ */ e(s, { icon: z, color: "inherit", fontSize: 16 })
187
+ s("connectDIDWallet"),
188
+ /* @__PURE__ */ e(p, { icon: _, color: "inherit", fontSize: 16 })
188
189
  ]
189
190
  }
190
191
  )
@@ -194,5 +195,5 @@ function V({
194
195
  );
195
196
  }
196
197
  export {
197
- V as default
198
+ Q as default
198
199
  };
@@ -1,4 +1,4 @@
1
- const e = "3.4.9", s = { "@blocklet/js-sdk": "^1.17.7" }, n = {
1
+ const e = "3.4.10", s = { "@blocklet/js-sdk": "^1.17.7" }, n = {
2
2
  version: e,
3
3
  dependencies: s
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "3.4.9",
3
+ "version": "3.4.10",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -74,16 +74,16 @@
74
74
  "react": "^19.0.0",
75
75
  "react-router-dom": "^6.22.3"
76
76
  },
77
- "gitHead": "e01324f3084f688f514eed2b5fb8d1c4b3e4247e",
77
+ "gitHead": "162768378bf0a1d1e0984d1f01235eafa5bd9bdb",
78
78
  "dependencies": {
79
- "@arcblock/bridge": "3.4.9",
79
+ "@arcblock/bridge": "3.4.10",
80
80
  "@arcblock/did": "^1.28.6",
81
81
  "@arcblock/did-motif": "^1.1.14",
82
- "@arcblock/icons": "3.4.9",
83
- "@arcblock/nft-display": "3.4.9",
84
- "@arcblock/react-hooks": "3.4.9",
82
+ "@arcblock/icons": "3.4.10",
83
+ "@arcblock/nft-display": "3.4.10",
84
+ "@arcblock/react-hooks": "3.4.10",
85
85
  "@blocklet/js-sdk": "^1.17.7",
86
- "@blocklet/theme": "3.4.9",
86
+ "@blocklet/theme": "3.4.10",
87
87
  "@fontsource/roboto": "~5.1.1",
88
88
  "@fontsource/ubuntu-mono": "^5.2.6",
89
89
  "@iconify-icons/logos": "^1.2.36",
@@ -122,24 +122,25 @@ export default function UserInfo({
122
122
  </Typography>
123
123
  {mode === 'normal' ? null : (
124
124
  <Tag
125
+ className="user-info__connected-tag"
125
126
  type="primary"
126
127
  sx={{
127
128
  transform: 'scale(0.85)',
128
129
  transformOrigin: 'left',
129
- color: 'white !important',
130
130
  display: 'flex',
131
131
  alignItems: 'center',
132
132
  }}>
133
133
  <Box
134
+ className="user-info__connected-tag__dot"
134
135
  sx={{
135
136
  mr: 0.75,
136
137
  width: 6,
137
138
  height: 6,
138
- backgroundColor: 'white',
139
+ backgroundColor: (theme) => theme.palette.text.contrast,
139
140
  borderRadius: '100vw',
140
141
  }}
141
142
  />
142
- <Box>DID CONNECTED</Box>
143
+ <Box className="user-info__connected-tag__text">DID CONNECTED</Box>
143
144
  </Tag>
144
145
  )}
145
146
  </Box>