@arcblock/ux 2.11.50 → 2.12.1

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 (82) hide show
  1. package/lib/CloseButton/index.d.ts +5 -0
  2. package/lib/CloseButton/index.js +29 -0
  3. package/lib/Colors/index.d.ts +1 -0
  4. package/lib/Colors/index.js +2 -1
  5. package/lib/Colors/themes/did-connect.d.ts +55 -0
  6. package/lib/Colors/themes/did-connect.js +55 -0
  7. package/lib/Header/demo/images/boards.svg +3 -0
  8. package/lib/Header/demo/images/chatbot.svg +3 -0
  9. package/lib/Header/demo/images/gallery.svg +3 -0
  10. package/lib/NavMenu/images/OCAP.svg +16 -0
  11. package/lib/NavMenu/images/abt-network.svg +18 -0
  12. package/lib/NavMenu/images/ai-kit.svg +46 -0
  13. package/lib/NavMenu/images/aigne.svg +8 -0
  14. package/lib/NavMenu/images/aistro.svg +14 -0
  15. package/lib/NavMenu/images/blocklet-framework.svg +25 -0
  16. package/lib/NavMenu/images/blocklet-launcher.svg +9 -0
  17. package/lib/NavMenu/images/blocklet-server.svg +19 -0
  18. package/lib/NavMenu/images/blocklet-store.svg +11 -0
  19. package/lib/NavMenu/images/creator-studio.svg +42 -0
  20. package/lib/NavMenu/images/did-connect.svg +26 -0
  21. package/lib/NavMenu/images/did-name-service.svg +3 -0
  22. package/lib/NavMenu/images/did-wallet.svg +33 -0
  23. package/lib/NavMenu/images/did.svg +3 -0
  24. package/lib/NavMenu/images/nft-studio.svg +19 -0
  25. package/lib/NavMenu/images/vc.svg +7 -0
  26. package/lib/NavMenu/images/web3-kit.svg +56 -0
  27. package/lib/NavMenu/index.d.ts +1 -0
  28. package/lib/NavMenu/index.js +2 -1
  29. package/lib/NavMenu/nav-menu-context.d.ts +17 -0
  30. package/lib/NavMenu/nav-menu-context.js +19 -0
  31. package/lib/NavMenu/nav-menu.d.ts +10 -5
  32. package/lib/NavMenu/nav-menu.js +76 -36
  33. package/lib/NavMenu/products.d.ts +5 -0
  34. package/lib/NavMenu/products.js +1639 -0
  35. package/lib/NavMenu/style.d.ts +8 -3
  36. package/lib/NavMenu/style.js +215 -175
  37. package/lib/NavMenu/sub-item-group.d.ts +5 -0
  38. package/lib/NavMenu/sub-item-group.js +44 -0
  39. package/lib/RelativeTime/index.js +1 -0
  40. package/lib/SessionUser/components/quick-login-item.d.ts +19 -0
  41. package/lib/SessionUser/components/quick-login-item.js +122 -0
  42. package/lib/SessionUser/components/un-login.d.ts +2 -1
  43. package/lib/SessionUser/components/un-login.js +173 -30
  44. package/lib/SessionUser/index.js +1 -0
  45. package/lib/SessionUser/libs/translation.js +4 -2
  46. package/lib/Typography/index.js +6 -2
  47. package/lib/Util/style.d.ts +2 -0
  48. package/lib/Util/style.js +14 -0
  49. package/package.json +5 -5
  50. package/src/CloseButton/index.tsx +30 -0
  51. package/src/Colors/index.ts +1 -0
  52. package/src/Colors/themes/did-connect.ts +56 -0
  53. package/src/NavMenu/images/OCAP.svg +16 -0
  54. package/src/NavMenu/images/abt-network.svg +18 -0
  55. package/src/NavMenu/images/ai-kit.svg +46 -0
  56. package/src/NavMenu/images/aigne.svg +8 -0
  57. package/src/NavMenu/images/aistro.svg +14 -0
  58. package/src/NavMenu/images/blocklet-framework.svg +25 -0
  59. package/src/NavMenu/images/blocklet-launcher.svg +9 -0
  60. package/src/NavMenu/images/blocklet-server.svg +19 -0
  61. package/src/NavMenu/images/blocklet-store.svg +11 -0
  62. package/src/NavMenu/images/creator-studio.svg +42 -0
  63. package/src/NavMenu/images/did-connect.svg +26 -0
  64. package/src/NavMenu/images/did-name-service.svg +3 -0
  65. package/src/NavMenu/images/did-wallet.svg +33 -0
  66. package/src/NavMenu/images/did.svg +3 -0
  67. package/src/NavMenu/images/nft-studio.svg +19 -0
  68. package/src/NavMenu/images/vc.svg +7 -0
  69. package/src/NavMenu/images/web3-kit.svg +56 -0
  70. package/src/NavMenu/index.ts +1 -0
  71. package/src/NavMenu/nav-menu-context.tsx +30 -0
  72. package/src/NavMenu/nav-menu.tsx +98 -61
  73. package/src/NavMenu/products.tsx +378 -0
  74. package/src/NavMenu/style.ts +220 -183
  75. package/src/NavMenu/sub-item-group.tsx +36 -0
  76. package/src/RelativeTime/index.tsx +1 -0
  77. package/src/SessionUser/components/quick-login-item.tsx +131 -0
  78. package/src/SessionUser/components/un-login.tsx +179 -25
  79. package/src/SessionUser/index.tsx +1 -1
  80. package/src/SessionUser/libs/translation.ts +2 -0
  81. package/src/Typography/index.tsx +2 -2
  82. package/src/Util/style.ts +17 -0
@@ -1,8 +1,13 @@
1
- type NavMenuBaseProps = {
1
+ type NavMenuProps = {
2
2
  $bgColor: string;
3
3
  $textColor: string;
4
+ };
5
+ export declare const NavMenuRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & NavMenuProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
6
+ export declare const NavMenuList: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
7
+ type NavMenuItemProps = {
4
8
  $activeTextColor: string;
5
9
  };
6
- export declare const HorizontalStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & NavMenuBaseProps & import("react").ClassAttributes<HTMLElement> & import("react").HTMLAttributes<HTMLElement>, {}, {}>;
7
- export declare const InlineStyle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & NavMenuBaseProps & import("react").ClassAttributes<HTMLElement> & import("react").HTMLAttributes<HTMLElement>, {}, {}>;
10
+ export declare const NavMenuItem: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & NavMenuItemProps, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
11
+ export declare const NavMenuSub: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & NavMenuItemProps & import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement>, {}, {}>;
12
+ export declare const NavMenuSubList: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
8
13
  export {};
@@ -1,185 +1,225 @@
1
1
  import { styled } from '../Theme';
2
- const NavMenuBase = styled('nav', {
3
- shouldForwardProp: prop => prop !== '$bgColor' && prop !== '$textColor' && prop !== '$activeTextColor'
4
- })`
5
- background-color: ${props => props.$bgColor};
6
- font-size: 16px;
7
- // width: 100%;
8
- ul {
9
- list-style: none;
10
- margin: 0;
11
- padding: 0;
12
- }
13
- .navmenu-item,
14
- .navmenu-sub {
15
- display: flex;
16
- align-items: center;
17
- }
18
- a {
19
- color: inherit;
20
- text-decoration: none;
21
- }
22
- /* active/hover */
23
- .navmenu-item,
24
- .navmenu-sub {
25
- color: ${props => props.$textColor};
26
- }
27
- .navmenu-item--active,
28
- .navmenu-item:hover,
29
- .navmenu-sub--opened {
30
- color: ${props => props.$activeTextColor};
31
- }
32
-
33
- .navmenu-item {
34
- position: relative;
35
- cursor: pointer;
36
- transition: color 0.2s ease-in-out;
37
- a {
38
- white-space: nowrap;
39
- }
40
- a::before {
41
- position: absolute;
42
- top: 0;
43
- right: 0;
44
- bottom: 0;
45
- left: 0;
46
- background-color: transparent;
47
- content: '';
48
- }
49
- }
50
-
51
- .navmenu-sub {
52
- position: relative;
53
- cursor: pointer;
54
- }
55
- /* icon & expand icon */
56
- .navmenu-item-icon,
57
- .navmenu-sub-icon,
58
- .navmenu-sub-expand-icon {
59
- display: flex;
60
- line-height: 1;
61
- }
62
- .navmenu-item-icon,
63
- .navmenu-sub-icon {
64
- margin-right: 4px;
65
- }
66
- .navmenu-item-icon > *,
67
- .navmenu-sub-icon > * {
68
- width: auto;
69
- height: 22px;
70
- max-height: 22px;
71
- font-size: 1.5em;
72
- }
73
- .navmenu-sub-expand-icon {
74
- margin-left: 8px;
75
- > * {
76
- width: 0.8em;
77
- height: 0.8em;
78
- transition: transform 0.2s ease-in-out;
79
- }
80
- }
81
- `;
82
- export const HorizontalStyle = styled(NavMenuBase)`
83
- padding: 8px 16px;
84
- min-width: 50px;
2
+ // .navmenu-root
3
+ export const NavMenuRoot = styled('nav', {
4
+ shouldForwardProp: prop => prop !== '$bgColor' && prop !== '$textColor'
5
+ })(({
6
+ $bgColor,
7
+ $textColor
8
+ }) => ({
9
+ padding: '8px 16px',
10
+ minWidth: '50px',
85
11
  // FIXME: @zhanghan 这个只是临时的解决方案,会导致 header align right 不能真正的右对齐,需要修改 header 才能真正解决这个问题
86
- flex-grow: 100;
12
+ flexGrow: 100,
13
+ backgroundColor: $bgColor,
14
+ color: $textColor,
15
+ fontSize: '16px'
16
+ }));
87
17
 
88
- .navmenu-root {
89
- display: flex;
90
- align-items: center;
91
- }
92
- /* 顶级菜单间隔 */
93
- .navmenu-root > .navmenu-item,
94
- .navmenu-root > .navmenu-sub {
95
- margin-left: 24px;
96
- white-space: nowrap;
97
- }
98
- .navmenu-root > .navmenu-item:first-of-type,
99
- .navmenu-root > .navmenu-sub:first-of-type {
100
- margin-left: 0;
101
- }
102
-
103
- /* 子级列表 */
104
- .navmenu-sub-container {
105
- display: none;
106
- position: absolute;
107
- top: 100%;
108
- }
109
- .navmenu-sub-list {
110
- padding: 16px;
111
- border-radius: 4px;
112
- background: #fff;
113
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
114
- .navmenu-item + .navmenu-item {
115
- margin-top: 8px;
18
+ // .navmenu-list
19
+ export const NavMenuList = styled('ul')(() => ({
20
+ listStyle: 'none',
21
+ margin: 0,
22
+ padding: 0,
23
+ display: 'flex',
24
+ alignItems: 'center',
25
+ // inline 布局
26
+ '&.navmenu-list--inline ': {
27
+ flexDirection: 'column',
28
+ alignItems: 'stretch'
29
+ }
30
+ }));
31
+ // 菜单项 .navmenu-item
32
+ export const NavMenuItem = styled('li', {
33
+ shouldForwardProp: prop => prop !== '$activeTextColor'
34
+ })(({
35
+ $activeTextColor
36
+ }) => ({
37
+ display: 'flex',
38
+ alignItems: 'center',
39
+ position: 'relative',
40
+ padding: '0 12px',
41
+ whiteSpace: 'nowrap',
42
+ cursor: 'pointer',
43
+ transition: 'color 0.2s ease-in-out',
44
+ // 间距调整
45
+ '&:first-of-type': {
46
+ paddingLeft: 0
47
+ },
48
+ '&:last-of-type': {
49
+ paddingRight: 0
50
+ },
51
+ // 内部链接
52
+ a: {
53
+ whiteSpace: 'nowrap',
54
+ color: 'inherit',
55
+ textDecoration: 'none',
56
+ // 扩大点击区域
57
+ '&::before': {
58
+ position: 'absolute',
59
+ top: 0,
60
+ right: 0,
61
+ bottom: 0,
62
+ left: 0,
63
+ backgroundColor: 'transparent',
64
+ content: '""'
116
65
  }
117
- }
118
- /* 二级 sub menu */
119
- .navmenu-root > .navmenu-sub {
120
- white-space: nowrap;
121
- > .navmenu-sub-container {
122
- left: 50%;
123
- transform: translateX(-50%);
124
- padding-top: 16px;
66
+ },
67
+ // 图标
68
+ '.navmenu-item__icon': {
69
+ display: 'flex',
70
+ alignItems: 'center',
71
+ justifyContent: 'center',
72
+ marginRight: '4px',
73
+ '& > *': {
74
+ width: 'auto',
75
+ height: '22px',
76
+ maxHeight: '22px',
77
+ fontSize: '1.5em'
125
78
  }
126
- &.navmenu-sub--opened > .navmenu-sub-container {
127
- display: block;
79
+ },
80
+ // 右侧内容
81
+ '.navmenu-item__content': {
82
+ height: '32px',
83
+ display: 'flex',
84
+ flexDirection: 'column',
85
+ justifyContent: 'center',
86
+ alignItems: 'flex-start',
87
+ gap: '5px'
88
+ },
89
+ '.navmenu-item__label': {
90
+ display: 'flex',
91
+ alignItems: 'center',
92
+ '&-arrow': {
93
+ marginLeft: '6px',
94
+ fontSize: '14px',
95
+ opacity: 0,
96
+ transition: 'opacity 0.2s ease-in-out'
128
97
  }
129
- }
130
- `;
98
+ },
99
+ '.navmenu-item__desc': {
100
+ fontSize: '14px'
101
+ },
102
+ // 悬停状态下
103
+ '&:hover': {
104
+ color: $activeTextColor
105
+ },
106
+ // 选中状态下
107
+ '&.navmenu-item--active': {
108
+ color: $activeTextColor
109
+ },
110
+ // Panel 形态下
111
+ '&.navmenu-item--panel': {
112
+ padding: '8px 16px',
113
+ borderRadius: '8px',
114
+ '.navmenu-item__icon': {
115
+ width: '32px',
116
+ height: '32px',
117
+ marginRight: '16px',
118
+ border: '1px solid #eff1f5',
119
+ borderRadius: '4px',
120
+ color: '#9497a0'
121
+ },
122
+ '.navmenu-item__label': {
123
+ fontSize: '14px',
124
+ lineHeight: 1,
125
+ color: '#26292e'
126
+ },
127
+ '.navmenu-item__desc': {
128
+ fontSize: '12px',
129
+ lineHeight: 1,
130
+ color: '#9497a0'
131
+ },
132
+ '&:hover': {
133
+ background: '#f9f9fb',
134
+ transition: 'background 0.2s ease-in-out',
135
+ '.navmenu-item__label-arrow': {
136
+ opacity: 1
137
+ },
138
+ '.navmenu-item__desc': {
139
+ color: '#26292e',
140
+ transition: 'color 0.2s ease-in-out'
141
+ }
142
+ },
143
+ '&.navmenu-item--active': {
144
+ background: '#f9f9fb'
145
+ }
146
+ },
147
+ // inline 布局中
148
+ '&.navmenu-item--inline': {
149
+ margin: 0,
150
+ padding: '0 16px',
151
+ minHeight: '48px',
152
+ lineHeight: '48px',
153
+ flexWrap: 'wrap'
154
+ }
155
+ }));
131
156
 
132
- /* inline mode */
133
- export const InlineStyle = styled(NavMenuBase)`
134
- font-size: 16px;
135
- .navmenu-root {
136
- display: flex;
137
- flex-direction: column;
138
- align-items: stretch;
139
- }
140
- .navmenu-item,
141
- .navmenu-sub {
142
- padding: 0 16px;
143
- }
144
- & .navmenu-sub {
145
- flex-wrap: wrap;
146
- }
147
- /* 顶级 */
148
- .navmenu-root > .navmenu-item,
149
- .navmenu-root > .navmenu-sub {
150
- line-height: 48px;
151
- border-bottom: 1px solid #eee;
152
- }
153
- /* icon */
154
- .navmenu-item-icon,
155
- .navmenu-sub-icon {
156
- width: 30px;
157
- margin: 0;
158
- }
159
- .navmenu-sub-expand-icon {
160
- margin-left: auto;
161
- }
162
- /* 子级列表 */
163
- .navmenu-sub-container {
164
- display: none;
165
- flex: 1 0 100%;
166
- margin: 0 -16px;
167
- padding-bottom: 8px;
168
- .navmenu-item,
169
- .navmenu-sub {
170
- line-height: 32px;
157
+ // 包含子菜单的导航项 .navmenu-item .navmenu-sub
158
+ export const NavMenuSub = styled(NavMenuItem)(() => ({
159
+ '.navmenu-item': {
160
+ marginLeft: 0
161
+ },
162
+ '& .navmenu-sub__container': {
163
+ visibility: 'hidden',
164
+ opacity: 0,
165
+ position: 'absolute',
166
+ top: '100%',
167
+ left: '50%',
168
+ zIndex: 1,
169
+ transform: 'translateX(-50%)',
170
+ paddingTop: '16px',
171
+ transition: 'opacity 0.2s ease-in-out, visibility 0.2s ease-in-out'
172
+ },
173
+ '&.navmenu-sub--opened > .navmenu-sub__container': {
174
+ visibility: 'visible',
175
+ opacity: 1
176
+ },
177
+ // 扩展图标
178
+ '.navmenu-sub__expand-icon': {
179
+ display: 'flex',
180
+ alignItems: 'center',
181
+ justifyContent: 'center',
182
+ marginLeft: '8px',
183
+ '& > *': {
184
+ width: '0.8em',
185
+ height: '0.8em',
186
+ transition: 'transform 0.2s ease-in-out'
187
+ },
188
+ '.navmenu-item--inline &': {
189
+ marginLeft: 'auto'
171
190
  }
172
- }
173
- .navmenu-sub-list {
174
- padding-left: 16px;
175
- .navmenu-item,
176
- .navmenu-sub {
177
- padding-left: 30px;
178
- font-size: 13px;
191
+ },
192
+ // inline 布局
193
+ '&.navmenu-item--inline': {
194
+ '.navmenu-sub__container': {
195
+ position: 'static',
196
+ transform: 'none',
197
+ flex: '1 0 100%',
198
+ margin: '0 -16px',
199
+ padding: 0,
200
+ height: 0,
201
+ overflow: 'hidden',
202
+ transition: 'height 0.2s ease-in-out'
203
+ },
204
+ '&.navmenu-sub--opened > .navmenu-sub__container': {
205
+ height: 'auto'
206
+ },
207
+ '.navmenu-sub__list': {
208
+ padding: 0,
209
+ paddingLeft: '16px',
210
+ boxShadow: 'none'
179
211
  }
180
212
  }
181
- /* 二级 menu */
182
- .navmenu-sub--opened > .navmenu-sub-container {
183
- display: block;
184
- }
185
- `;
213
+ }));
214
+
215
+ // 下拉子菜单 .navmenu-sub-list
216
+ export const NavMenuSubList = styled('ul')(() => ({
217
+ margin: 0,
218
+ padding: '16px',
219
+ borderRadius: '4px',
220
+ background: '#fff',
221
+ boxShadow: '0 2px 8px rgba(0, 0, 0, 0.15)',
222
+ '& .navmenu-item + .navmenu-item': {
223
+ marginTop: '8px'
224
+ }
225
+ }));
@@ -0,0 +1,5 @@
1
+ import { BoxProps } from '@mui/material';
2
+ export interface NavMenuSubItemGroupProps extends BoxProps {
3
+ label: React.ReactNode;
4
+ }
5
+ export default function NavMenuSubItemGroup({ label, children, className, sx, ...rest }: NavMenuSubItemGroupProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box } from '@mui/material';
3
+ import { styled } from '../Theme';
4
+ const Group = styled(Box)`
5
+ padding: 16px 24px;
6
+ border-radius: 8px;
7
+ background-color: white;
8
+ cursor: auto;
9
+
10
+ .group-label {
11
+ margin-bottom: 8px;
12
+ color: #71717b;
13
+ font-size: 12px;
14
+ }
15
+
16
+ .nav {
17
+ list-style: none;
18
+ margin: 0;
19
+ padding: 0;
20
+ }
21
+ `;
22
+ export default function NavMenuSubItemGroup({
23
+ label,
24
+ children,
25
+ className,
26
+ sx,
27
+ ...rest
28
+ }) {
29
+ return /*#__PURE__*/_jsxs(Group, {
30
+ className: `nav-menu-sub-item-group ${className}`,
31
+ sx: {
32
+ ...sx
33
+ },
34
+ ...rest,
35
+ children: [/*#__PURE__*/_jsx(Box, {
36
+ className: "group-label",
37
+ children: label
38
+ }), /*#__PURE__*/_jsx(Box, {
39
+ component: "ul",
40
+ className: "nav",
41
+ children: children
42
+ })]
43
+ });
44
+ }
@@ -31,6 +31,7 @@ dayjs.updateLocale('zh-cn', {
31
31
  yy: '%d 年'
32
32
  }
33
33
  });
34
+ // FIXME: @@ 此处不能真正的将 relativeTime 设置为支持中文
34
35
  setDateTool(dayjs);
35
36
  export default function RelativeTime({
36
37
  value,
@@ -0,0 +1,19 @@
1
+ export default function QuickLoginItem({ userSession, locale, onClick, }: {
2
+ onClick?: () => void;
3
+ locale?: string;
4
+ userSession: {
5
+ user: {
6
+ avatar: string;
7
+ did: string;
8
+ fullName: string;
9
+ role: string;
10
+ roleTitle: string;
11
+ email: string;
12
+ };
13
+ extra: {
14
+ walletOS: string;
15
+ provider: string;
16
+ };
17
+ updatedAt: string;
18
+ };
19
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,122 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import DID from '@arcblock/ux/lib/DID';
3
+ import RelativeTime from '@arcblock/ux/lib/RelativeTime';
4
+ import WalletOSIcon from '@arcblock/ux/lib/WalletOSIcon';
5
+ import { Box, Chip, Typography } from '@mui/material';
6
+ import { temp as colors } from '@arcblock/ux/lib/Colors';
7
+ import noop from 'lodash/noop';
8
+ import Avatar from '../../Avatar';
9
+ import { getSourceProvider } from '../libs/utils';
10
+ export default function QuickLoginItem({
11
+ userSession,
12
+ locale = 'en',
13
+ onClick = noop
14
+ }) {
15
+ const isRawWalletAccount = getSourceProvider(userSession?.user) === 'wallet';
16
+ return /*#__PURE__*/_jsxs(Box, {
17
+ sx: {
18
+ borderRadius: 2,
19
+ p: 2,
20
+ transition: 'background-color 0.5s',
21
+ '&:hover, &:active': {
22
+ backgroundColor: colors.backgroundsBgSubtileHover
23
+ },
24
+ display: 'flex',
25
+ justifyContent: 'space-between',
26
+ alignItems: 'center',
27
+ cursor: 'pointer',
28
+ '&:hover': {
29
+ backgroundColor: colors.surfacePrimarySubtitle
30
+ },
31
+ width: '100%',
32
+ backgroundColor: 'white'
33
+ },
34
+ onClick: onClick,
35
+ children: [/*#__PURE__*/_jsxs(Box, {
36
+ sx: {
37
+ display: 'flex',
38
+ alignItems: 'center',
39
+ gap: 1.5,
40
+ flex: 1,
41
+ overflow: 'hidden'
42
+ },
43
+ children: [/*#__PURE__*/_jsx(Avatar, {
44
+ src: userSession.user.avatar,
45
+ did: userSession.user.did,
46
+ size: 44,
47
+ variant: "circle",
48
+ shape: "circle"
49
+ }), /*#__PURE__*/_jsxs(Box, {
50
+ sx: {
51
+ flex: 1,
52
+ overflow: 'hidden'
53
+ },
54
+ children: [/*#__PURE__*/_jsxs(Typography, {
55
+ sx: {
56
+ fontSize: '16px',
57
+ fontWeight: 500,
58
+ display: 'flex',
59
+ alignItems: 'center',
60
+ gap: 1,
61
+ color: colors.textBase
62
+ },
63
+ children: [userSession.user.fullName, /*#__PURE__*/_jsx(Chip, {
64
+ label: userSession.user?.roleTitle || userSession.user?.role,
65
+ size: "small",
66
+ variant: "outlined",
67
+ sx: () => ({
68
+ height: 'auto',
69
+ fontWeight: 'bold',
70
+ fontSize: '12px',
71
+ borderColor: colors.lineBorderStrong,
72
+ color: colors.textSubtitle
73
+ })
74
+ })]
75
+ }), isRawWalletAccount ? /*#__PURE__*/_jsxs(Box, {
76
+ sx: {
77
+ display: 'flex',
78
+ alignItems: 'center',
79
+ gap: 0.5
80
+ },
81
+ children: [/*#__PURE__*/_jsx(WalletOSIcon, {
82
+ provider: userSession?.extra?.provider,
83
+ walletOS: userSession?.extra?.walletOS,
84
+ color: colors.textSubtitle
85
+ }), /*#__PURE__*/_jsx(DID
86
+ // @ts-ignore
87
+ , {
88
+ locale: locale,
89
+ did: userSession.user.did,
90
+ size: 12,
91
+ sx: {
92
+ lineHeight: 1,
93
+ fontSize: '12px',
94
+ mt: 0.5,
95
+ '& span.arc-avatar-did-motif': {
96
+ display: 'none !important'
97
+ }
98
+ },
99
+ compact: true
100
+ })]
101
+ }) : /*#__PURE__*/_jsx(Typography, {
102
+ sx: {
103
+ fontSize: '12px',
104
+ color: colors.textSubtitle
105
+ },
106
+ children: userSession.user.email
107
+ })]
108
+ })]
109
+ }), userSession.updatedAt && /*#__PURE__*/_jsx(Box, {
110
+ component: "span",
111
+ sx: {
112
+ color: colors.textMuted,
113
+ fontSize: '12px',
114
+ flexShrink: 0
115
+ },
116
+ children: /*#__PURE__*/_jsx(RelativeTime, {
117
+ value: userSession.updatedAt,
118
+ locale: locale
119
+ })
120
+ })]
121
+ });
122
+ }
@@ -4,5 +4,6 @@ export interface UnLoginProps {
4
4
  onLogin?: () => void;
5
5
  size?: number;
6
6
  dark?: false | true;
7
+ locale?: string;
7
8
  }
8
- export default function UnLogin({ session, onLogin, size, dark }: UnLoginProps): import("react/jsx-runtime").JSX.Element;
9
+ export default function UnLogin({ session, onLogin, size, dark, locale }: UnLoginProps): import("react/jsx-runtime").JSX.Element;