@arcblock/ux 2.6.9 → 2.7.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 (164) hide show
  1. package/babel.config.es.js +12 -0
  2. package/es/ActionButton/index.js +99 -0
  3. package/es/ActivityIndicator/index.js +180 -0
  4. package/es/Address/compact-text.js +105 -0
  5. package/es/Address/did-address.js +211 -0
  6. package/es/Address/index.js +23 -0
  7. package/es/Address/responsive-did-address.js +88 -0
  8. package/es/Alert/index.js +134 -0
  9. package/es/AnimationWaiter/default-animation.json +1 -0
  10. package/es/AnimationWaiter/index.js +239 -0
  11. package/es/Async/index.js +38 -0
  12. package/es/Avatar/did-motif.js +64 -0
  13. package/es/Avatar/etherscan-blockies.js +83 -0
  14. package/es/Avatar/index.js +176 -0
  15. package/es/Badge/index.js +98 -0
  16. package/es/Blocklet/blocklet.js +298 -0
  17. package/es/Blocklet/index.js +4 -0
  18. package/es/Blocklet/utils.js +52 -0
  19. package/es/BlockletNFT/index.js +412 -0
  20. package/es/Button/index.js +8 -0
  21. package/es/Button/wrap.js +140 -0
  22. package/es/ButtonGroup/index.js +6 -0
  23. package/es/CardSelector/index.js +131 -0
  24. package/es/Center/index.js +41 -0
  25. package/es/ClickToCopy/copy-button.js +72 -0
  26. package/es/ClickToCopy/hook.js +39 -0
  27. package/es/ClickToCopy/index.js +93 -0
  28. package/es/CodeBlock/LightBox.js +85 -0
  29. package/es/CodeBlock/index.js +226 -0
  30. package/es/Colors/index.js +2 -0
  31. package/es/Colors/themes/default.js +78 -0
  32. package/es/ContactForm/index.js +230 -0
  33. package/es/CookieConsent/index.js +113 -0
  34. package/es/CountDown/index.js +178 -0
  35. package/es/DID/index.js +105 -0
  36. package/es/Datatable/CustomToolbar.js +396 -0
  37. package/es/Datatable/DatatableContext.js +34 -0
  38. package/es/Datatable/TableSearch.js +165 -0
  39. package/es/Datatable/index.js +627 -0
  40. package/es/Datatable/utils.js +132 -0
  41. package/es/Dialog/confirm.js +90 -0
  42. package/es/Dialog/dialog.js +192 -0
  43. package/es/Dialog/index.js +3 -0
  44. package/es/DidLogo/index.js +31 -0
  45. package/es/DriftBot/index.js +70 -0
  46. package/es/Earth/countries.json +8057 -0
  47. package/es/Earth/index.js +521 -0
  48. package/es/Earth/util.js +51 -0
  49. package/es/Empty/index.js +64 -0
  50. package/es/ErrorBoundary/fallback.js +73 -0
  51. package/es/ErrorBoundary/index.js +1 -0
  52. package/es/Footer/index.js +172 -0
  53. package/es/Header/auto-hidden.js +35 -0
  54. package/es/Header/header.js +211 -0
  55. package/es/Header/index.js +2 -0
  56. package/es/Header/responsive-header.js +111 -0
  57. package/es/Icon/image.js +65 -0
  58. package/es/Icon/index.js +84 -0
  59. package/es/Img/index.js +217 -0
  60. package/es/InfoRow/index.js +87 -0
  61. package/es/Layout/dashboard/external-link.js +58 -0
  62. package/es/Layout/dashboard/full-page.js +53 -0
  63. package/es/Layout/dashboard/index.js +275 -0
  64. package/es/Layout/dashboard/sidebar.js +209 -0
  65. package/es/Layout/dashboard-legacy/header.js +174 -0
  66. package/es/Layout/dashboard-legacy/index.js +149 -0
  67. package/es/Layout/dashboard-legacy/sidebar.js +129 -0
  68. package/es/Layout/index.js +335 -0
  69. package/es/Locale/browser-lang.js +52 -0
  70. package/es/Locale/context.js +114 -0
  71. package/es/Locale/languages.js +60 -0
  72. package/es/Locale/selector.js +180 -0
  73. package/es/Locale/util.js +13 -0
  74. package/es/Logo/images/logo-dark-text.svg +3 -0
  75. package/es/Logo/images/logo-dark-top.svg +6 -0
  76. package/es/Logo/images/logo-light-text.svg +3 -0
  77. package/es/Logo/images/logo-light-top.svg +6 -0
  78. package/es/Logo/index.js +136 -0
  79. package/es/Metric/index.js +132 -0
  80. package/es/NFTDisplay/README.md +59 -0
  81. package/es/NFTDisplay/aspect-ratio-container.js +39 -0
  82. package/es/NFTDisplay/broken.js +18 -0
  83. package/es/NFTDisplay/demo/data/asset-state-display-url.json +7 -0
  84. package/es/NFTDisplay/demo/data/asset-state-gzipped-svg-1-1.json +10 -0
  85. package/es/NFTDisplay/demo/data/asset-state-gzipped-svg-374-130.json +10 -0
  86. package/es/NFTDisplay/demo/data/asset-state-gzipped-svg-with-foreign-object.json +20 -0
  87. package/es/NFTDisplay/demo/data/asset-state-svg.json +29 -0
  88. package/es/NFTDisplay/demo/data/asset-state-url.json +10 -0
  89. package/es/NFTDisplay/index.js +323 -0
  90. package/es/NFTDisplay/loading.js +18 -0
  91. package/es/NFTDisplay/svg-embedder/img.js +45 -0
  92. package/es/NFTDisplay/svg-embedder/inline-svg.js +39 -0
  93. package/es/NavMenu/index.js +2 -0
  94. package/es/NavMenu/nav-menu.js +286 -0
  95. package/es/NavMenu/style.js +176 -0
  96. package/es/PageScroller/index.js +286 -0
  97. package/es/PageScroller/story/FifthComponent.js +9 -0
  98. package/es/PageScroller/story/FirstComponent.js +9 -0
  99. package/es/PageScroller/story/FourthComponent.js +12 -0
  100. package/es/PageScroller/story/FullPage.js +47 -0
  101. package/es/PageScroller/story/PageContain.js +59 -0
  102. package/es/PageScroller/story/SecondComponent.js +9 -0
  103. package/es/PageScroller/story/ThirdComponent.js +9 -0
  104. package/es/PageScroller/story/index.css +115 -0
  105. package/es/PageScroller/usePrevValue.js +9 -0
  106. package/es/PricingTable/PricingPlan.js +124 -0
  107. package/es/PricingTable/index.js +53 -0
  108. package/es/QRCode/index.js +72 -0
  109. package/es/RelativeTime/index.js +98 -0
  110. package/es/Result/common.js +140 -0
  111. package/es/Result/demo/fixtures/result-image-404.svg +1 -0
  112. package/es/Result/index.js +33 -0
  113. package/es/Result/result.js +59 -0
  114. package/es/Result/translations.js +54 -0
  115. package/es/Screenshot/BaseScreenshot/index.js +91 -0
  116. package/es/Screenshot/BaseScreenshot/shells/Macbook.js +51 -0
  117. package/es/Screenshot/BaseScreenshot/shells/Phone.js +36 -0
  118. package/es/Screenshot/demo/images/bg-00.jpg +0 -0
  119. package/es/Screenshot/demo/images/bg-01.jpg +0 -0
  120. package/es/Screenshot/demo/images/bg-02.jpg +0 -0
  121. package/es/Screenshot/demo/images/bg-03.jpg +0 -0
  122. package/es/Screenshot/demo/images/bg-04.jpg +0 -0
  123. package/es/Screenshot/demo/images/bg-05.jpg +0 -0
  124. package/es/Screenshot/demo/images/bg-06.jpg +0 -0
  125. package/es/Screenshot/demo/images/bg-07.jpg +0 -0
  126. package/es/Screenshot/demo/images/bg-08.jpg +0 -0
  127. package/es/Screenshot/demo/images/bg-09.jpg +0 -0
  128. package/es/Screenshot/devices.css +1366 -0
  129. package/es/Screenshot/index.js +299 -0
  130. package/es/SessionManager/federated-login-detecter.js +166 -0
  131. package/es/SessionManager/index.js +468 -0
  132. package/es/SessionManager/user-popper.js +132 -0
  133. package/es/Sparkline/index.js +193 -0
  134. package/es/Spinner/index.js +28 -0
  135. package/es/SplitButton/index.js +144 -0
  136. package/es/Switch/index.js +96 -0
  137. package/es/Tabs/index.js +48 -0
  138. package/es/Tag/index.js +108 -0
  139. package/es/TextCollapse/index.js +92 -0
  140. package/es/Theme/index.js +16 -0
  141. package/es/Theme/theme-provider.js +39 -0
  142. package/es/Theme/theme.js +133 -0
  143. package/es/Toast/index.js +95 -0
  144. package/es/Util/deprecate.js +28 -0
  145. package/es/Util/index.js +298 -0
  146. package/es/Util/wallet.js +32 -0
  147. package/es/Video/index.js +89 -0
  148. package/es/Wallet/Action.js +119 -0
  149. package/es/Wallet/Download.js +331 -0
  150. package/es/Wallet/Open.js +45 -0
  151. package/es/Wallet/images/abtwallet.png +0 -0
  152. package/es/Wallet/images/android_download.svg +23 -0
  153. package/es/Wallet/images/app-store.svg +20 -0
  154. package/es/Wallet/images/google-play.svg +70 -0
  155. package/es/WebWalletSWKeeper/index.js +115 -0
  156. package/es/WechatPrompt/images/android.png +0 -0
  157. package/es/WechatPrompt/images/ios.png +0 -0
  158. package/es/WechatPrompt/index.js +88 -0
  159. package/es/index.js +38 -0
  160. package/es/withTheme/index.js +69 -0
  161. package/es/withTracker/README.md +34 -0
  162. package/es/withTracker/error_boundary.js +34 -0
  163. package/es/withTracker/index.js +56 -0
  164. package/package.json +272 -5
@@ -0,0 +1,299 @@
1
+ import { createElement, Children, cloneElement, useEffect, useRef, useState } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { mergeProps } from '../Util';
4
+ import { styled } from '../Theme';
5
+ import BaseScreenshot from './BaseScreenshot';
6
+ import './devices.css';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ const types = {
10
+ 'iphone-x': {
11
+ borderRadius: 32,
12
+ width: 342,
13
+ scale: 0.78
14
+ },
15
+ 'iphone-8': {
16
+ borderRadius: 0,
17
+ width: 336,
18
+ scale: 0.78
19
+ },
20
+ 'ipad-pro': {
21
+ borderRadius: 0,
22
+ width: 560,
23
+ scale: 0.62
24
+ },
25
+ 'imac-pro': {
26
+ borderRadius: 0,
27
+ width: 624,
28
+ scale: 0.56
29
+ },
30
+ macbook: {
31
+ borderRadius: 0,
32
+ width: 740,
33
+ scale: 0.47
34
+ },
35
+ 'macbook-pro': {
36
+ borderRadius: 0,
37
+ width: 740,
38
+ scale: 0.47
39
+ },
40
+ 'surface-pro': {
41
+ borderRadius: 0,
42
+ width: 561,
43
+ scale: 0.62
44
+ },
45
+ 'surface-book': {
46
+ borderRadius: 0,
47
+ width: 728,
48
+ scale: 0.47
49
+ },
50
+ 'surface-studio': {
51
+ borderRadius: 0,
52
+ width: 640,
53
+ scale: 0.55
54
+ },
55
+ 'galaxy-s8': {
56
+ borderRadius: 0,
57
+ width: 321,
58
+ scale: 0.8
59
+ },
60
+ 'google-pixel': {
61
+ borderRadius: 0,
62
+ width: 360,
63
+ scale: 0.72
64
+ },
65
+ 'google-pixel-2-xl': {
66
+ borderRadius: 0,
67
+ width: 360,
68
+ scale: 0.72
69
+ },
70
+ 'apple-watch': {
71
+ borderRadius: 0,
72
+ width: 200,
73
+ scale: 1
74
+ }
75
+ };
76
+ const childProps = {
77
+ img: ['alt', 'title', 'src', 'srcSet', 'sizes', 'loading', 'key', 'children'],
78
+ video: ['alt', 'title', 'muted', 'autoplay', 'loop', 'key', 'children']
79
+ };
80
+ const createChild = child => [/*#__PURE__*/createElement(child.type, childProps[child.type].reduce((acc, x) => {
81
+ acc[x] = child.props[x];
82
+ return acc;
83
+ }, {}))];
84
+ const findChildren = (children, returnArgWhenNotFound = true) => {
85
+ for (let i = 0; i < children.length; i++) {
86
+ const child = children[i];
87
+ if (['img', 'video'].includes(child.type)) {
88
+ return createChild(child);
89
+ }
90
+ if (child.props && child.props.children) {
91
+ const subChildren = Children.toArray(child.props.children);
92
+ const result = findChildren(subChildren, false);
93
+ if (result) {
94
+ return result;
95
+ }
96
+ }
97
+ }
98
+ if (returnArgWhenNotFound) {
99
+ return children;
100
+ }
101
+ return null;
102
+ };
103
+
104
+ // This component is built upon the awesome device.css lib
105
+ // By default it will find and only render img/video tags in the children
106
+ // If neither of them are found, the whole child tree is rendered
107
+ function OldScreenshot(props) {
108
+ const newProps = mergeProps(props, OldScreenshot, ['style', 'width', 'height']);
109
+ const {
110
+ type,
111
+ children,
112
+ style,
113
+ className,
114
+ width,
115
+ height,
116
+ ...rest
117
+ } = newProps;
118
+ const {
119
+ zIndex = 0,
120
+ borderRadius = 0
121
+ } = types[type] || {};
122
+ return /*#__PURE__*/_jsxs(Div, {
123
+ ...rest,
124
+ type: type,
125
+ className: `device device-${type} ${className}`.trim(),
126
+ style: style,
127
+ contentRadius: borderRadius,
128
+ contentZIndex: zIndex,
129
+ children: [/*#__PURE__*/_jsx("div", {
130
+ className: "device-frame",
131
+ children: /*#__PURE__*/_jsx("div", {
132
+ className: "device-content",
133
+ children: findChildren(Children.toArray(children)).map((item, index) => /*#__PURE__*/cloneElement(item, {
134
+ key: index
135
+ }))
136
+ })
137
+ }), /*#__PURE__*/_jsx("div", {
138
+ className: "device-stripe"
139
+ }), /*#__PURE__*/_jsx("div", {
140
+ className: "device-header"
141
+ }), /*#__PURE__*/_jsx("div", {
142
+ className: "device-sensors"
143
+ }), /*#__PURE__*/_jsx("div", {
144
+ className: "device-btns"
145
+ }), /*#__PURE__*/_jsx("div", {
146
+ className: "device-power"
147
+ })]
148
+ });
149
+ }
150
+ const Div = styled('div')`
151
+ @media (max-width: ${props => types[props.type].width}px) {
152
+ transform-origin: 0 0;
153
+ transform: scale(${props => types[props.type].scale});
154
+ }
155
+ .device-content {
156
+ overflow: hidden;
157
+ }
158
+ .device-content video,
159
+ .device-content img {
160
+ border-radius: ${props => props.contentRadius}px;
161
+ background-color: #fff;
162
+ background-position: center center;
163
+ background-size: cover;
164
+ object-fit: cover;
165
+ width: 100.1%;
166
+ height: 100.1%;
167
+ }
168
+ `;
169
+ OldScreenshot.propTypes = {
170
+ type: PropTypes.oneOf(Object.keys(types)),
171
+ children: PropTypes.any.isRequired,
172
+ className: PropTypes.string,
173
+ width: PropTypes.number,
174
+ height: PropTypes.number,
175
+ style: PropTypes.oneOfType([PropTypes.object, PropTypes.string])
176
+ };
177
+ OldScreenshot.defaultProps = {
178
+ type: 'iphone-x',
179
+ className: '',
180
+ style: '{}',
181
+ width: 0,
182
+ height: 0
183
+ };
184
+
185
+ /**
186
+ * 用于修正旧版 Screenshot 无法匹配尺寸的问题
187
+ * @param {*} props params to OldScreenshot
188
+ * @returns <OldScreenshot />
189
+ */
190
+ function ScreenFixer(props) {
191
+ const screenEl = useRef(null);
192
+ const [height, setHeight] = useState(undefined);
193
+ const [scale, setScale] = useState(null);
194
+ useEffect(() => {
195
+ let resizeObs;
196
+ const fixSize = () => {
197
+ const {
198
+ clientWidth
199
+ } = screenEl.current;
200
+
201
+ // 获取内部元素的宽高
202
+ const {
203
+ clientWidth: targetWidth,
204
+ clientHeight: targetHeight
205
+ } = screenEl.current.children[0];
206
+ const realScale = clientWidth / targetWidth;
207
+ if (realScale < 1) {
208
+ setScale(realScale);
209
+ setHeight(realScale * targetHeight);
210
+ } else {
211
+ setScale(null);
212
+ setHeight(undefined);
213
+ }
214
+ };
215
+ if (screenEl.current) {
216
+ resizeObs = new ResizeObserver(fixSize);
217
+ resizeObs.observe(screenEl.current);
218
+ }
219
+ return () => {
220
+ if (resizeObs) {
221
+ resizeObs.disconnect();
222
+ }
223
+ };
224
+ // eslint-disable-next-line react-hooks/exhaustive-deps
225
+ }, [screenEl.current]);
226
+ return /*#__PURE__*/_jsx(ReScreen, {
227
+ ref: screenEl,
228
+ style: {
229
+ height
230
+ },
231
+ children: /*#__PURE__*/_jsx(OldScreenshot, {
232
+ ...props,
233
+ style: {
234
+ transform: scale ? `scale(${scale})` : undefined
235
+ }
236
+ })
237
+ });
238
+ }
239
+ const ReScreen = styled('div')`
240
+ div[type] {
241
+ transform: scale(1);
242
+ transform-origin: 0 0;
243
+ }
244
+ `;
245
+ function Screenshot({
246
+ type,
247
+ src,
248
+ children,
249
+ style,
250
+ sx,
251
+ ...rest
252
+ }) {
253
+ const _type = type.toLowerCase();
254
+
255
+ // 新版采用容器采用BaseScreenshot,svg集成,更容易拓展,响应式更好
256
+ if (['phone', 'macbook'].includes(_type)) {
257
+ return /*#__PURE__*/_jsx(BaseScreenshot, {
258
+ type: _type,
259
+ sx: {
260
+ ...sx,
261
+ ...style
262
+ },
263
+ ...rest,
264
+ children: children || (src ? /*#__PURE__*/_jsx("img", {
265
+ src: src,
266
+ alt: "screenshot"
267
+ }) : null)
268
+ });
269
+ }
270
+
271
+ // 旧版采用纯css制作,定制性欠缺,暂时保留使用
272
+ return /*#__PURE__*/_jsx(ScreenFixer, {
273
+ type: type,
274
+ ...rest,
275
+ sx: {
276
+ ...sx,
277
+ ...style,
278
+ margin: 'auto'
279
+ },
280
+ children: children || (src ? /*#__PURE__*/_jsx("img", {
281
+ src: src,
282
+ alt: "screenshot"
283
+ }) : null)
284
+ });
285
+ }
286
+ Screenshot.propTypes = {
287
+ type: PropTypes.string.isRequired,
288
+ src: PropTypes.string,
289
+ style: PropTypes.object,
290
+ sx: PropTypes.object,
291
+ children: PropTypes.any
292
+ };
293
+ Screenshot.defaultProps = {
294
+ src: '',
295
+ children: null,
296
+ style: {},
297
+ sx: {}
298
+ };
299
+ export default Screenshot;
@@ -0,0 +1,166 @@
1
+ import PropTypes from 'prop-types';
2
+ import { useCallback, useState } from 'react';
3
+ import Box from '@mui/material/Box';
4
+ import Chip from '@mui/material/Chip';
5
+ import Divider from '@mui/material/Divider';
6
+ import SvgIcon from '@mui/material/SvgIcon';
7
+ import ShieldCheck from 'mdi-material-ui/ShieldCheck';
8
+ import UserPopper from './user-popper';
9
+ import DidAvatar from '../Avatar';
10
+ import DidAddress from '../Address';
11
+ import Button from '../Button';
12
+ import Toast from '../Toast';
13
+ import { getUserAvatar } from '../Util';
14
+ import { Fragment as _Fragment } from "react/jsx-runtime";
15
+ import { jsxs as _jsxs } from "react/jsx-runtime";
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ const translations = {
18
+ en: {
19
+ useToConnect({
20
+ master,
21
+ member
22
+ }) {
23
+ return /*#__PURE__*/_jsxs(_Fragment, {
24
+ children: ["Use ", master, " account to connect ", member]
25
+ });
26
+ },
27
+ connect: 'Connect Account',
28
+ loginFederatedFailed: 'Login federated account failed'
29
+ },
30
+ zh: {
31
+ useToConnect({
32
+ master,
33
+ member
34
+ }) {
35
+ return /*#__PURE__*/_jsxs(_Fragment, {
36
+ children: ["\u4F7F\u7528 ", master, " \u8D26\u53F7\u8FDE\u63A5 ", member]
37
+ });
38
+ },
39
+ connect: '连接账号',
40
+ loginFederatedFailed: '登录统一登录账号失败'
41
+ }
42
+ };
43
+ export default function FederatedLoginDetecter({
44
+ session,
45
+ anchorEl,
46
+ dark,
47
+ locale: _locale
48
+ }) {
49
+ const [federatedLoginOpen, setFederatedLoginOpen] = useState(true);
50
+ const siteInfo = session.federatedMaster?.site;
51
+ const userInfo = session.federatedMaster?.user;
52
+ const localeList = Object.keys(translations);
53
+ const locale = localeList.includes(_locale) ? _locale : localeList[0];
54
+ const onLoginFederated = useCallback(() => {
55
+ session?.loginFederated(err => {
56
+ if (err) {
57
+ Toast.error(err || translations[_locale].loginFederatedFailed);
58
+ } else {
59
+ setFederatedLoginOpen(false);
60
+ }
61
+ }, {
62
+ mode: userInfo ? 'auto' : 'manual'
63
+ });
64
+ }, [session, userInfo, _locale]);
65
+ return siteInfo && /*#__PURE__*/_jsx(UserPopper, {
66
+ open: federatedLoginOpen,
67
+ anchorEl: anchorEl,
68
+ dark: dark,
69
+ onClose: () => setFederatedLoginOpen(false),
70
+ children: /*#__PURE__*/_jsxs(Box, {
71
+ p: 2,
72
+ children: [siteInfo && /*#__PURE__*/_jsxs(Box, {
73
+ display: "flex",
74
+ alignItems: "center",
75
+ children: [/*#__PURE__*/_jsx(Box, {
76
+ component: "img",
77
+ mr: 2,
78
+ src: `${siteInfo.appUrl}${siteInfo.appLogo}`,
79
+ alt: siteInfo.appName,
80
+ width: "30px",
81
+ height: "30px"
82
+ }), /*#__PURE__*/_jsx(Box, {
83
+ children: translations[locale].useToConnect({
84
+ master: /*#__PURE__*/_jsx(Box, {
85
+ component: "a",
86
+ href: siteInfo.appUrl,
87
+ target: "_blank",
88
+ sx: {
89
+ textDecoration: 'none',
90
+ fontWeight: 'bold',
91
+ color: 'primary.main',
92
+ fontSize: '1.2em'
93
+ },
94
+ children: siteInfo.appName
95
+ }),
96
+ member: window.blocklet.appName
97
+ })
98
+ })]
99
+ }), siteInfo && userInfo && /*#__PURE__*/_jsx(Divider, {
100
+ style: {
101
+ margin: '15px 0 10px 0'
102
+ }
103
+ }), userInfo && /*#__PURE__*/_jsxs(Box, {
104
+ display: "flex",
105
+ alignItems: "center",
106
+ children: [/*#__PURE__*/_jsx(DidAvatar, {
107
+ variant: "circle",
108
+ did: userInfo.did,
109
+ src: getUserAvatar(userInfo.avatar),
110
+ size: 28,
111
+ shape: "circle"
112
+ }), /*#__PURE__*/_jsxs(Box, {
113
+ ml: 2,
114
+ children: [/*#__PURE__*/_jsxs(Box, {
115
+ display: "flex",
116
+ justifyContent: "space-between",
117
+ alignItems: "center",
118
+ children: [/*#__PURE__*/_jsx(Box, {
119
+ fontSize: 18,
120
+ children: userInfo.fullName
121
+ }), userInfo.role?.toUpperCase() && /*#__PURE__*/_jsx(Chip, {
122
+ label: userInfo.role?.toUpperCase(),
123
+ size: "small",
124
+ variant: "outlined",
125
+ sx: {
126
+ height: 'auto',
127
+ marginRight: 0,
128
+ fontSize: 12
129
+ },
130
+ icon: /*#__PURE__*/_jsx(SvgIcon, {
131
+ component: ShieldCheck,
132
+ style: {
133
+ fontSize: '14px'
134
+ }
135
+ })
136
+ })]
137
+ }), /*#__PURE__*/_jsx(DidAddress, {
138
+ responsive: false,
139
+ children: userInfo.did
140
+ })]
141
+ })]
142
+ }), siteInfo && /*#__PURE__*/_jsx(Box, {
143
+ display: "flex",
144
+ justifyContent: "center",
145
+ mt: 2,
146
+ children: /*#__PURE__*/_jsx(Button, {
147
+ variant: "contained",
148
+ size: "small",
149
+ onClick: onLoginFederated,
150
+ children: translations[locale].connect
151
+ })
152
+ })]
153
+ })
154
+ });
155
+ }
156
+ FederatedLoginDetecter.propTypes = {
157
+ session: PropTypes.object.isRequired,
158
+ anchorEl: PropTypes.instanceOf(Element),
159
+ dark: PropTypes.bool,
160
+ locale: PropTypes.string
161
+ };
162
+ FederatedLoginDetecter.defaultProps = {
163
+ dark: false,
164
+ anchorEl: null,
165
+ locale: 'en'
166
+ };