@arcblock/ux 2.9.13 → 2.9.15
Sign up to get free protection for your applications and to get access to all the features.
- package/es/Address/did-address.js +18 -13
- package/es/Colors/themes/default.js +0 -1
- package/es/Colors/themes/temp.js +10 -1
- package/es/ContactForm/index.js +2 -2
- package/es/DID/index.js +0 -1
- package/es/Dialog/confirm.js +1 -99
- package/es/Dialog/dialog.js +4 -7
- package/es/Dialog/index.js +1 -1
- package/es/Dialog/use-confirm.js +105 -0
- package/es/Locale/selector.js +1 -1
- package/es/Locale/util.js +10 -5
- package/es/NFTDisplay/index.js +0 -1
- package/es/Passport/index.js +2 -0
- package/es/Passport/passport.js +103 -0
- package/es/SessionBlocklet/index.js +1 -1
- package/es/SessionUser/components/logged-in.js +1 -1
- package/es/SessionUser/components/un-login.js +1 -1
- package/es/SessionUser/components/user-info.js +1 -1
- package/es/SessionUser/index.js +2 -2
- package/es/Tabs/index.js +88 -2
- package/es/Theme/theme.js +12 -3
- package/es/Util/passport.js +62 -0
- package/lib/ActionButton/index.js +6 -7
- package/lib/ActivityIndicator/index.js +4 -4
- package/lib/Address/compact-text.js +6 -6
- package/lib/Address/did-address.js +25 -21
- package/lib/Address/index.js +4 -4
- package/lib/Address/responsive-did-address.js +4 -4
- package/lib/Alert/index.js +5 -6
- package/lib/AnimationWaiter/index.js +4 -4
- package/lib/Async/index.js +6 -6
- package/lib/Avatar/did-motif.js +5 -6
- package/lib/Avatar/etherscan-blockies.js +2 -3
- package/lib/Avatar/index.js +4 -4
- package/lib/Badge/index.js +5 -6
- package/lib/Blocklet/blocklet.js +4 -4
- package/lib/Blocklet/index.js +3 -4
- package/lib/Blocklet/utils.js +3 -5
- package/lib/BlockletContext/index.js +1 -2
- package/lib/BlockletNFT/index.js +4 -4
- package/lib/Button/index.js +1 -2
- package/lib/Button/wrap.js +4 -4
- package/lib/ButtonGroup/index.js +1 -2
- package/lib/ClickToCopy/copy-button.js +4 -4
- package/lib/ClickToCopy/index.js +6 -6
- package/lib/CodeBlock/LightBox.js +1 -2
- package/lib/CodeBlock/index.js +4 -4
- package/lib/Colors/themes/default.js +1 -2
- package/lib/Colors/themes/temp.js +11 -3
- package/lib/ContactForm/index.js +2 -2
- package/lib/CookieConsent/index.js +6 -6
- package/lib/CountDown/index.js +4 -4
- package/lib/DID/index.js +7 -9
- package/lib/Datatable/CustomToolbar.js +2 -2
- package/lib/Datatable/index.js +49 -49
- package/lib/Datatable/utils.js +2 -3
- package/lib/Dialog/confirm.js +5 -113
- package/lib/Dialog/dialog.js +14 -18
- package/lib/Dialog/index.js +3 -4
- package/lib/Dialog/use-confirm.js +126 -0
- package/lib/Earth/index.js +7 -8
- package/lib/Empty/index.js +5 -6
- package/lib/Header/auto-hidden.js +5 -6
- package/lib/Header/header.js +5 -6
- package/lib/Header/responsive-header.js +5 -6
- package/lib/Icon/image.js +4 -4
- package/lib/Icon/index.js +6 -7
- package/lib/Img/index.js +5 -6
- package/lib/InfoRow/index.js +5 -6
- package/lib/Layout/dashboard/external-link.js +4 -4
- package/lib/Layout/dashboard/full-page.js +5 -6
- package/lib/Layout/dashboard/index.js +4 -4
- package/lib/Layout/dashboard/sidebar.js +5 -6
- package/lib/Layout/dashboard-legacy/header.js +4 -4
- package/lib/Layout/dashboard-legacy/index.js +4 -4
- package/lib/Layout/dashboard-legacy/sidebar.js +4 -4
- package/lib/Layout/index.js +4 -4
- package/lib/Locale/browser-lang.js +1 -2
- package/lib/Locale/context.js +6 -8
- package/lib/Locale/languages.js +7 -9
- package/lib/Locale/selector.js +5 -5
- package/lib/Locale/util.js +12 -11
- package/lib/Logo/index.js +4 -4
- package/lib/NFTDisplay/aspect-ratio-container.js +5 -6
- package/lib/NFTDisplay/broken.js +4 -4
- package/lib/NFTDisplay/index.js +5 -7
- package/lib/NFTDisplay/svg-embedder/img.js +5 -6
- package/lib/NFTDisplay/svg-embedder/inline-svg.js +5 -6
- package/lib/NavMenu/nav-menu.js +5 -6
- package/lib/NavMenu/style.js +2 -4
- package/lib/PageScroller/index.js +6 -7
- package/lib/Passport/index.js +9 -0
- package/lib/Passport/passport.js +116 -0
- package/lib/PoweredByArcBlock/index.js +4 -4
- package/lib/PricingTable/PricingPlan.js +1 -2
- package/lib/PricingTable/index.js +1 -2
- package/lib/QRCode/index.js +5 -6
- package/lib/RelativeTime/index.js +4 -4
- package/lib/Result/common.js +4 -4
- package/lib/Result/index.js +7 -8
- package/lib/Result/result.js +5 -6
- package/lib/Result/translations.js +2 -3
- package/lib/Screenshot/BaseScreenshot/index.js +5 -6
- package/lib/Screenshot/BaseScreenshot/shells/Macbook.js +10 -15
- package/lib/Screenshot/BaseScreenshot/shells/Phone.js +10 -15
- package/lib/Screenshot/index.js +5 -6
- package/lib/SessionBlocklet/index.js +5 -5
- package/lib/SessionManager/index.js +1 -2
- package/lib/SessionUser/components/logged-in.js +5 -5
- package/lib/SessionUser/components/session-user-item.js +5 -6
- package/lib/SessionUser/components/session-user-switch.js +4 -4
- package/lib/SessionUser/components/un-login.js +1 -1
- package/lib/SessionUser/components/user-info.js +1 -1
- package/lib/SessionUser/index.js +2 -2
- package/lib/SessionUser/libs/translation.js +2 -3
- package/lib/Spinner/index.js +13 -14
- package/lib/SplitButton/index.js +4 -4
- package/lib/Switch/index.js +5 -6
- package/lib/Tabs/index.js +98 -11
- package/lib/Tag/index.js +5 -6
- package/lib/TextCollapse/index.js +5 -6
- package/lib/Theme/index.js +6 -7
- package/lib/Theme/theme.js +18 -11
- package/lib/Toast/index.js +12 -13
- package/lib/Typography/index.js +4 -4
- package/lib/Util/constant.js +10 -20
- package/lib/Util/deprecate.js +4 -4
- package/lib/Util/index.js +2 -4
- package/lib/Util/passport.js +72 -0
- package/lib/Util/wallet.js +1 -2
- package/lib/Video/index.js +4 -4
- package/lib/Wallet/Action.js +4 -4
- package/lib/Wallet/Download.js +4 -4
- package/lib/WebWalletSWKeeper/index.js +5 -6
- package/lib/withTheme/index.js +5 -6
- package/lib/withTracker/error_boundary.js +2 -2
- package/lib/withTracker/index.js +8 -9
- package/package.json +12 -6
- package/src/Address/did-address.jsx +15 -12
- package/src/Colors/themes/temp.js +9 -0
- package/src/Dialog/confirm.jsx +94 -0
- package/src/Dialog/{dialog.js → dialog.jsx} +14 -7
- package/src/Dialog/index.js +1 -1
- package/src/Dialog/use-confirm.jsx +114 -0
- package/src/Locale/selector.jsx +1 -1
- package/src/Locale/util.js +12 -5
- package/src/Passport/index.jsx +3 -0
- package/src/Passport/passport.jsx +99 -0
- package/src/SessionBlocklet/index.jsx +1 -1
- package/src/SessionUser/components/logged-in.jsx +1 -1
- package/src/SessionUser/components/un-login.jsx +1 -1
- package/src/SessionUser/components/user-info.jsx +1 -1
- package/src/SessionUser/index.jsx +1 -1
- package/src/Tabs/index.jsx +124 -0
- package/src/Theme/theme.js +13 -3
- package/src/Util/passport.js +75 -0
- package/src/Dialog/confirm.js +0 -201
- package/src/Tabs/index.js +0 -45
@@ -96,22 +96,18 @@ const DidAddress = /*#__PURE__*/forwardRef(({
|
|
96
96
|
size: size,
|
97
97
|
...rest,
|
98
98
|
ref: ref,
|
99
|
-
children: [prepend, /*#__PURE__*/
|
99
|
+
children: [prepend, /*#__PURE__*/_jsx(Box, {
|
100
|
+
sx: {
|
101
|
+
display: 'none'
|
102
|
+
},
|
103
|
+
ref: textRef,
|
104
|
+
children: children
|
105
|
+
}), /*#__PURE__*/_jsx(Tooltip, {
|
100
106
|
title: copyable ? '' : translations[locale].copied,
|
101
107
|
placement: "bottom",
|
102
108
|
arrow: true,
|
103
109
|
open: copied,
|
104
|
-
children:
|
105
|
-
ref: textRef,
|
106
|
-
component: "span",
|
107
|
-
className: "did-address-text did-address-truncate",
|
108
|
-
sx: {
|
109
|
-
display: compact ? 'none' : 'inline',
|
110
|
-
cursor: copyable ? 'text' : 'pointer'
|
111
|
-
},
|
112
|
-
onDoubleClick: copyable ? noop : onCopy,
|
113
|
-
children: children
|
114
|
-
}), compact && /*#__PURE__*/_jsx(Box, {
|
110
|
+
children: compact ? /*#__PURE__*/_jsx(Box, {
|
115
111
|
component: "span",
|
116
112
|
className: "did-address-text",
|
117
113
|
sx: {
|
@@ -124,7 +120,16 @@ const DidAddress = /*#__PURE__*/forwardRef(({
|
|
124
120
|
showCopyButtonInTooltip: showCopyButtonInTooltip,
|
125
121
|
children: children
|
126
122
|
})
|
127
|
-
})
|
123
|
+
}) : /*#__PURE__*/_jsx(Box, {
|
124
|
+
component: "span",
|
125
|
+
className: "did-address-text did-address-truncate",
|
126
|
+
sx: {
|
127
|
+
display: compact ? 'none' : 'inline',
|
128
|
+
cursor: copyable ? 'text' : 'pointer'
|
129
|
+
},
|
130
|
+
onDoubleClick: copyable ? noop : onCopy,
|
131
|
+
children: children
|
132
|
+
})
|
128
133
|
}), copyElement, append]
|
129
134
|
});
|
130
135
|
});
|
package/es/Colors/themes/temp.js
CHANGED
@@ -12,6 +12,15 @@ const colors = {
|
|
12
12
|
surfaceSuccess: 'rgba(13, 202, 134, 1)',
|
13
13
|
primaryBase: 'rgba(19, 125, 250, 1)',
|
14
14
|
primary100: 'rgba(19, 125, 250, 1)',
|
15
|
-
gray6: 'rgba(17, 22, 24, 0.06)'
|
15
|
+
gray6: 'rgba(17, 22, 24, 0.06)',
|
16
|
+
backgroundsBgSubtitle: 'rgba(249, 250, 251, 1)',
|
17
|
+
backgroundsBgComponent: 'rgba(241, 243, 245, 1)',
|
18
|
+
backgroundsBgField: 'rgba(249, 250, 251, 1)',
|
19
|
+
foregroundsFgBase: 'rgba(3, 7, 18, 1)',
|
20
|
+
foregroundsFgSubtile: 'rgba(75, 85, 99, 1)',
|
21
|
+
strokeBorderBase: 'rgba(229, 231, 235, 1)',
|
22
|
+
strokeBorderStrong: 'rgba(209, 213, 219, 1)',
|
23
|
+
buttonsButtonNeutral: 'rgba(255, 255, 255, 1)',
|
24
|
+
buttonsButtonNeutralHover: 'rgba(243, 244, 246, 1)'
|
16
25
|
};
|
17
26
|
export default colors;
|
package/es/ContactForm/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
|
-
function _toPropertyKey(
|
3
|
-
function _toPrimitive(
|
2
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
3
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
4
4
|
/* eslint-disable react/no-unused-prop-types */
|
5
5
|
/* eslint-disable react/static-property-placement */
|
6
6
|
import React from 'react';
|
package/es/DID/index.js
CHANGED
package/es/Dialog/confirm.js
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
|
-
import { forwardRef, useRef, useImperativeHandle } from 'react';
|
3
|
-
import { useMemoizedFn, useReactive } from 'ahooks';
|
4
|
-
import noop from 'lodash/noop';
|
5
2
|
import Button from '../Button';
|
6
3
|
import Dialog from './dialog';
|
7
4
|
|
@@ -90,99 +87,4 @@ Confirm.defaultProps = {
|
|
90
87
|
text: 'Cancel'
|
91
88
|
},
|
92
89
|
PaperProps: {}
|
93
|
-
};
|
94
|
-
const ConfirmHolder = /*#__PURE__*/forwardRef((props, ref) => {
|
95
|
-
const state = useReactive({
|
96
|
-
show: false,
|
97
|
-
title: '',
|
98
|
-
content: '',
|
99
|
-
onConfirm: noop,
|
100
|
-
onCancel: noop,
|
101
|
-
loading: false,
|
102
|
-
confirmButtonText: 'Confirm',
|
103
|
-
cancelButtonText: 'Cancel'
|
104
|
-
});
|
105
|
-
const open = useMemoizedFn((params = {}) => {
|
106
|
-
state.show = true;
|
107
|
-
state.title = params.title;
|
108
|
-
state.content = params.content;
|
109
|
-
state.onConfirm = params.onConfirm || noop;
|
110
|
-
state.onCancel = params.onCancel || noop;
|
111
|
-
if (params.confirmButtonText) state.confirmButtonText = params.confirmButtonText;
|
112
|
-
if (params.cancelButtonText) state.cancelButtonText = params.cancelButtonText;
|
113
|
-
state.loading = false;
|
114
|
-
});
|
115
|
-
const reset = useMemoizedFn(() => {
|
116
|
-
state.title = '';
|
117
|
-
state.content = '';
|
118
|
-
state.onConfirm = noop;
|
119
|
-
state.onCancel = noop;
|
120
|
-
state.confirmButtonText = 'Confirm';
|
121
|
-
state.cancelButtonText = 'Cancel';
|
122
|
-
});
|
123
|
-
const close = useMemoizedFn(() => {
|
124
|
-
state.show = false;
|
125
|
-
setTimeout(() => {
|
126
|
-
reset();
|
127
|
-
}, 300);
|
128
|
-
});
|
129
|
-
const onCancel = useMemoizedFn(() => {
|
130
|
-
close();
|
131
|
-
state?.onCancel();
|
132
|
-
}, []);
|
133
|
-
const onConfirm = useMemoizedFn(async () => {
|
134
|
-
state.loading = true;
|
135
|
-
try {
|
136
|
-
await state?.onConfirm(close);
|
137
|
-
} finally {
|
138
|
-
state.loading = false;
|
139
|
-
}
|
140
|
-
}, []);
|
141
|
-
useImperativeHandle(ref, () => {
|
142
|
-
return {
|
143
|
-
open,
|
144
|
-
close
|
145
|
-
};
|
146
|
-
}, [open, close]);
|
147
|
-
return /*#__PURE__*/_jsx(Confirm, {
|
148
|
-
open: state.show,
|
149
|
-
title: state.title,
|
150
|
-
onConfirm: onConfirm,
|
151
|
-
onCancel: onCancel,
|
152
|
-
confirmButton: {
|
153
|
-
text: state.confirmButtonText,
|
154
|
-
props: {
|
155
|
-
variant: 'contained',
|
156
|
-
color: 'primary',
|
157
|
-
loading: state.loading
|
158
|
-
}
|
159
|
-
},
|
160
|
-
cancelButton: {
|
161
|
-
text: state.cancelButtonText,
|
162
|
-
props: {
|
163
|
-
variant: 'outlined',
|
164
|
-
color: 'primary'
|
165
|
-
}
|
166
|
-
},
|
167
|
-
children: state.content
|
168
|
-
});
|
169
|
-
});
|
170
|
-
export function useConfirm() {
|
171
|
-
const confirmRef = useRef(null);
|
172
|
-
const open = useMemoizedFn((...args) => {
|
173
|
-
confirmRef.current?.open(...args);
|
174
|
-
});
|
175
|
-
const close = useMemoizedFn((...args) => {
|
176
|
-
confirmRef.current?.close(...args);
|
177
|
-
});
|
178
|
-
const confirmApi = {
|
179
|
-
open,
|
180
|
-
close
|
181
|
-
};
|
182
|
-
return {
|
183
|
-
confirmHolder: /*#__PURE__*/_jsx(ConfirmHolder, {
|
184
|
-
ref: confirmRef
|
185
|
-
}),
|
186
|
-
confirmApi
|
187
|
-
};
|
188
|
-
}
|
90
|
+
};
|
package/es/Dialog/dialog.js
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
|
-
import MuiDialog from '@mui/material/Dialog';
|
3
|
-
import MuiDialogContent from '@mui/material/DialogContent';
|
4
|
-
import DialogActions from '@mui/material/DialogActions';
|
5
|
-
import IconButton from '@mui/material/IconButton';
|
6
|
-
import useMediaQuery from '@mui/material/useMediaQuery';
|
7
2
|
import CloseIcon from '@mui/icons-material/Close';
|
3
|
+
import { Typography, Dialog as MuiDialog, DialogContent as MuiDialogContent, DialogActions, IconButton, useMediaQuery } from '@mui/material';
|
8
4
|
import { styled, useTheme } from '../Theme';
|
9
5
|
|
10
6
|
/**
|
@@ -24,7 +20,7 @@ import { styled, useTheme } from '../Theme';
|
|
24
20
|
@property {boolean} [showCloseButton=true] - Whether or not to show the close button.
|
25
21
|
@property {'left'|'center'|'right'} [actionsPosition='right'] - The position of the actions toolbar.
|
26
22
|
@property {PaperStyle} [PaperProps] - Props to be passed down to the dialog paper.
|
27
|
-
@property {(event: React.SyntheticEvent, reason: string) => void} [onClose] - Callback function fired when the dialog is closed.
|
23
|
+
@property {(event: React.SyntheticEvent, reason: string) => void} [onClose] - Callback function fired when the dialog is closed.
|
28
24
|
*/
|
29
25
|
|
30
26
|
/**
|
@@ -89,7 +85,8 @@ function Dialog({
|
|
89
85
|
children: [showCloseButton && isMobile && closeButton, prepend && /*#__PURE__*/_jsx("div", {
|
90
86
|
className: "ux-dialog_prepend",
|
91
87
|
children: prepend
|
92
|
-
}), title && /*#__PURE__*/_jsx(
|
88
|
+
}), title && /*#__PURE__*/_jsx(Typography, {
|
89
|
+
variant: "h6",
|
93
90
|
className: "ux-dialog_title",
|
94
91
|
children: title
|
95
92
|
})]
|
package/es/Dialog/index.js
CHANGED
@@ -0,0 +1,105 @@
|
|
1
|
+
import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
2
|
+
import { useMemoizedFn, useReactive } from 'ahooks';
|
3
|
+
import noop from 'lodash/noop';
|
4
|
+
import Confirm from './confirm';
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
const ConfirmHolder = /*#__PURE__*/forwardRef((props, ref) => {
|
7
|
+
// HACK: 这里默认值不使用 null,来避免开发环境中的字段必填警告
|
8
|
+
const [title, setTitle] = useState('');
|
9
|
+
const [content, setContent] = useState('');
|
10
|
+
const state = useReactive({
|
11
|
+
show: false,
|
12
|
+
onConfirm: noop,
|
13
|
+
onCancel: noop,
|
14
|
+
loading: false,
|
15
|
+
confirmButtonText: 'Confirm',
|
16
|
+
cancelButtonText: 'Cancel'
|
17
|
+
});
|
18
|
+
const open = useMemoizedFn((params = {}) => {
|
19
|
+
setTitle(params.title);
|
20
|
+
setContent(params.content);
|
21
|
+
state.onConfirm = params.onConfirm || noop;
|
22
|
+
state.onCancel = params.onCancel || noop;
|
23
|
+
state.showCancelButton = params.showCancelButton ?? true;
|
24
|
+
if (params.confirmButtonText) state.confirmButtonText = params.confirmButtonText;
|
25
|
+
if (params.cancelButtonText) state.cancelButtonText = params.cancelButtonText;
|
26
|
+
state.loading = false;
|
27
|
+
state.show = true;
|
28
|
+
});
|
29
|
+
const reset = useMemoizedFn(() => {
|
30
|
+
setTitle('');
|
31
|
+
setContent('');
|
32
|
+
state.onConfirm = noop;
|
33
|
+
state.onCancel = noop;
|
34
|
+
state.confirmButtonText = 'Confirm';
|
35
|
+
state.cancelButtonText = 'Cancel';
|
36
|
+
});
|
37
|
+
const close = useMemoizedFn(() => {
|
38
|
+
state.show = false;
|
39
|
+
setTimeout(() => {
|
40
|
+
reset();
|
41
|
+
}, 300);
|
42
|
+
});
|
43
|
+
const onCancel = useMemoizedFn(() => {
|
44
|
+
close();
|
45
|
+
state?.onCancel();
|
46
|
+
}, []);
|
47
|
+
const onConfirm = useMemoizedFn(async () => {
|
48
|
+
state.loading = true;
|
49
|
+
try {
|
50
|
+
await state?.onConfirm(close);
|
51
|
+
} finally {
|
52
|
+
state.loading = false;
|
53
|
+
}
|
54
|
+
}, []);
|
55
|
+
useImperativeHandle(ref, () => {
|
56
|
+
return {
|
57
|
+
open,
|
58
|
+
close
|
59
|
+
};
|
60
|
+
}, [open, close]);
|
61
|
+
return /*#__PURE__*/_jsx(Confirm, {
|
62
|
+
...props,
|
63
|
+
open: state.show,
|
64
|
+
title: title,
|
65
|
+
onConfirm: onConfirm,
|
66
|
+
onCancel: onCancel,
|
67
|
+
confirmButton: {
|
68
|
+
text: state.confirmButtonText,
|
69
|
+
props: {
|
70
|
+
variant: 'contained',
|
71
|
+
color: 'primary',
|
72
|
+
loading: state.loading
|
73
|
+
}
|
74
|
+
},
|
75
|
+
showCancelButton: state.showCancelButton,
|
76
|
+
cancelButton: {
|
77
|
+
text: state.cancelButtonText,
|
78
|
+
props: {
|
79
|
+
variant: 'outlined',
|
80
|
+
color: 'primary'
|
81
|
+
}
|
82
|
+
},
|
83
|
+
children: content
|
84
|
+
});
|
85
|
+
});
|
86
|
+
export default function useConfirm(props = {}) {
|
87
|
+
const confirmRef = useRef(null);
|
88
|
+
const open = useMemoizedFn((...args) => {
|
89
|
+
confirmRef.current?.open(...args);
|
90
|
+
});
|
91
|
+
const close = useMemoizedFn((...args) => {
|
92
|
+
confirmRef.current?.close(...args);
|
93
|
+
});
|
94
|
+
const confirmApi = {
|
95
|
+
open,
|
96
|
+
close
|
97
|
+
};
|
98
|
+
return {
|
99
|
+
confirmHolder: /*#__PURE__*/_jsx(ConfirmHolder, {
|
100
|
+
...props,
|
101
|
+
ref: confirmRef
|
102
|
+
}),
|
103
|
+
confirmApi
|
104
|
+
};
|
105
|
+
}
|
package/es/Locale/selector.js
CHANGED
@@ -3,8 +3,8 @@ import { useState, useContext, useRef, useMemo } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
4
4
|
import { Button, Typography, IconButton, Popper, MenuItem, MenuList, Box, ClickAwayListener } from '@mui/material';
|
5
5
|
import { Icon as IconifyIcon } from '@iconify/react';
|
6
|
-
import LanguageIcon from '@iconify-icons/material-symbols/language';
|
7
6
|
import CheckIcon from '@iconify-icons/material-symbols/check';
|
7
|
+
import LanguageIcon from 'iconify-icons-material-symbols-400/language';
|
8
8
|
import noop from 'lodash/noop';
|
9
9
|
import { getColor, getBackground } from '../Util';
|
10
10
|
import { temp as colors } from '../Colors';
|
package/es/Locale/util.js
CHANGED
@@ -1,16 +1,21 @@
|
|
1
|
+
import get from 'lodash/get';
|
2
|
+
|
1
3
|
/* eslint-disable no-prototype-builtins */
|
2
4
|
export const replace = (template, data) => template.replace(/{(\w*)}/g, (m, key) => data.hasOwnProperty(key) ? data[key] : '');
|
3
5
|
export const translate = (translations, key, locale, fallbackLocale = 'en', data = {}) => {
|
4
|
-
|
6
|
+
const translation = translations[locale];
|
7
|
+
const translationValue = get(translation, key);
|
8
|
+
const fallbackValue = get(translations[fallbackLocale], key);
|
9
|
+
if (!translation || !translationValue) {
|
5
10
|
console.warn(`Warning: no ${key} translation of ${locale}`);
|
6
|
-
if (fallbackLocale &&
|
7
|
-
return replace(
|
11
|
+
if (fallbackLocale && fallbackValue) {
|
12
|
+
return replace(fallbackValue, data);
|
8
13
|
}
|
9
14
|
return key;
|
10
15
|
}
|
11
16
|
if (typeof translations[locale] === 'function' || translations[locale].then) {
|
12
|
-
return replace(
|
17
|
+
return replace(fallbackValue, data);
|
13
18
|
}
|
14
|
-
return replace(
|
19
|
+
return replace(translationValue, data);
|
15
20
|
};
|
16
21
|
export const t = translate;
|
package/es/NFTDisplay/index.js
CHANGED
@@ -0,0 +1,103 @@
|
|
1
|
+
import PropTypes from 'prop-types';
|
2
|
+
import upperFirst from 'lodash/upperFirst';
|
3
|
+
import { Box } from '@mui/material';
|
4
|
+
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
5
|
+
import RevokeIcon from '@arcblock/icons/lib/RevokeIcon';
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
7
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
8
|
+
export default function Passport({
|
9
|
+
passport,
|
10
|
+
user,
|
11
|
+
color,
|
12
|
+
width,
|
13
|
+
icon,
|
14
|
+
children,
|
15
|
+
createPassportSvg,
|
16
|
+
...rest
|
17
|
+
}) {
|
18
|
+
const {
|
19
|
+
t
|
20
|
+
} = useLocaleContext();
|
21
|
+
return /*#__PURE__*/_jsxs(Box, {
|
22
|
+
...rest,
|
23
|
+
sx: {
|
24
|
+
display: 'flex',
|
25
|
+
alignItems: 'center',
|
26
|
+
...rest?.sx
|
27
|
+
},
|
28
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
29
|
+
className: "passport-item__display"
|
30
|
+
// eslint-disable-next-line react/no-danger
|
31
|
+
,
|
32
|
+
dangerouslySetInnerHTML: {
|
33
|
+
__html: createPassportSvg({
|
34
|
+
title: passport.title || passport.name,
|
35
|
+
issuer: passport.issuer && passport.issuer.name,
|
36
|
+
issuerDid: passport.issuer && passport.issuer.id,
|
37
|
+
ownerName: user.fullName,
|
38
|
+
ownerDid: user.did,
|
39
|
+
ownerAvatarUrl: user.avatar,
|
40
|
+
revoked: passport.revoked,
|
41
|
+
preferredColor: color,
|
42
|
+
width
|
43
|
+
})
|
44
|
+
}
|
45
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
46
|
+
className: "passport-item__body",
|
47
|
+
sx: {
|
48
|
+
p: 0,
|
49
|
+
ml: 3,
|
50
|
+
mt: 0
|
51
|
+
},
|
52
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
53
|
+
className: "passport-item__title",
|
54
|
+
sx: {
|
55
|
+
display: 'flex',
|
56
|
+
alignItems: 'center',
|
57
|
+
fontWeight: 400,
|
58
|
+
fontSize: '16px',
|
59
|
+
lineHeight: 1.1875,
|
60
|
+
color: '#222222'
|
61
|
+
},
|
62
|
+
children: [upperFirst(passport.title), /*#__PURE__*/_jsxs(Box, {
|
63
|
+
className: "passport-item__status-icon",
|
64
|
+
sx: {
|
65
|
+
svg: {
|
66
|
+
fill: '#bfbfbf',
|
67
|
+
height: '1.2em',
|
68
|
+
marginLeft: '0.4em'
|
69
|
+
}
|
70
|
+
},
|
71
|
+
children: [icon, passport.revoked && /*#__PURE__*/_jsx(RevokeIcon, {})]
|
72
|
+
})]
|
73
|
+
}), passport.expirationDate && /*#__PURE__*/_jsx(Box, {
|
74
|
+
className: "passport-item__title",
|
75
|
+
sx: {
|
76
|
+
display: 'flex',
|
77
|
+
alignItems: 'center',
|
78
|
+
fontWeight: 400,
|
79
|
+
fontSize: '16px',
|
80
|
+
lineHeight: 1.1875,
|
81
|
+
color: '#222222'
|
82
|
+
},
|
83
|
+
children: t('team.passport.validUntil', {
|
84
|
+
date: passport.expirationDate
|
85
|
+
})
|
86
|
+
}), children]
|
87
|
+
})]
|
88
|
+
});
|
89
|
+
}
|
90
|
+
Passport.propTypes = {
|
91
|
+
passport: PropTypes.any.isRequired,
|
92
|
+
user: PropTypes.any.isRequired,
|
93
|
+
color: PropTypes.string.isRequired,
|
94
|
+
createPassportSvg: PropTypes.func.isRequired,
|
95
|
+
icon: PropTypes.any,
|
96
|
+
children: PropTypes.any,
|
97
|
+
width: PropTypes.number
|
98
|
+
};
|
99
|
+
Passport.defaultProps = {
|
100
|
+
icon: null,
|
101
|
+
children: null,
|
102
|
+
width: 150
|
103
|
+
};
|
@@ -2,7 +2,7 @@ import { useRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
3
3
|
import { Box, ClickAwayListener, Fade, IconButton, List, ListItem, ListItemButton, Paper, Popper, Typography } from '@mui/material';
|
4
4
|
import { Icon } from '@iconify/react';
|
5
|
-
import DashboardOutlineRoundedIcon from '
|
5
|
+
import DashboardOutlineRoundedIcon from 'iconify-icons-material-symbols-400/dashboard-outline-rounded';
|
6
6
|
import WidgetsOutlineRoundedIcon from '@iconify-icons/material-symbols/widgets-outline-rounded';
|
7
7
|
import { useMemoizedFn, useReactive } from 'ahooks';
|
8
8
|
import Button from '../Button';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
2
|
import { Box, CircularProgress, IconButton } from '@mui/material';
|
3
3
|
import { Icon } from '@iconify/react';
|
4
|
-
import PersonOutlineRoundedIcon from '
|
4
|
+
import PersonOutlineRoundedIcon from 'iconify-icons-material-symbols-400/person-outline-rounded';
|
5
5
|
import { useRef } from 'react';
|
6
6
|
import { useMemoizedFn } from 'ahooks';
|
7
7
|
import noop from 'lodash/noop';
|
package/es/SessionUser/index.js
CHANGED
@@ -34,8 +34,8 @@ SessionUser.propTypes = {
|
|
34
34
|
user: PropTypes.shape({
|
35
35
|
did: PropTypes.string.isRequired,
|
36
36
|
fullName: PropTypes.string.isRequired,
|
37
|
-
|
38
|
-
|
37
|
+
avatar: PropTypes.string.isRequired,
|
38
|
+
email: PropTypes.string
|
39
39
|
})
|
40
40
|
}).isRequired,
|
41
41
|
onBindWallet: PropTypes.func,
|
package/es/Tabs/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import PropTypes from 'prop-types';
|
2
|
-
import MuiTabs from '@mui/material
|
3
|
-
import
|
2
|
+
import { Tabs as MuiTabs, Tab as MuiTab } from '@mui/material';
|
3
|
+
import { temp as colors } from '../Colors';
|
4
4
|
import { styled } from '../Theme';
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
6
|
const PREFIX = 'index';
|
@@ -19,12 +19,98 @@ const StyledMuiTabs = styled(MuiTabs)(({
|
|
19
19
|
}
|
20
20
|
}
|
21
21
|
}));
|
22
|
+
function CardTabs({
|
23
|
+
tabs,
|
24
|
+
current,
|
25
|
+
onChange,
|
26
|
+
...rest
|
27
|
+
}) {
|
28
|
+
return /*#__PURE__*/_jsx(MuiTabs, {
|
29
|
+
scrollButtons: "auto",
|
30
|
+
value: current,
|
31
|
+
onChange: (_, newValue) => onChange(newValue),
|
32
|
+
...rest,
|
33
|
+
variant: "scrollable",
|
34
|
+
sx: {
|
35
|
+
minHeight: 'auto',
|
36
|
+
'.MuiTabs-scrollButtons.Mui-disabled': {
|
37
|
+
opacity: 0.3,
|
38
|
+
cursor: 'not-allowed',
|
39
|
+
pointerEvents: 'auto'
|
40
|
+
},
|
41
|
+
'.MuiTabs-scroller': {
|
42
|
+
borderRadius: '100vw'
|
43
|
+
},
|
44
|
+
'.MuiTabs-flexContainer': {
|
45
|
+
borderRadius: '100vw',
|
46
|
+
backgroundColor: colors.backgroundsBgComponent,
|
47
|
+
padding: 0.5,
|
48
|
+
display: 'inline-flex',
|
49
|
+
columnGap: 0.25
|
50
|
+
},
|
51
|
+
'.MuiTab-root': {
|
52
|
+
borderRadius: '100vw',
|
53
|
+
border: '1px solid transparent',
|
54
|
+
minHeight: 'auto',
|
55
|
+
lineHeight: 1,
|
56
|
+
py: 1,
|
57
|
+
color: colors.foregroundsFgSubtile,
|
58
|
+
fontSize: '13px',
|
59
|
+
fontWeight: 'normal',
|
60
|
+
textTransform: 'capitalize',
|
61
|
+
transition: 'background-color 0.2s ease',
|
62
|
+
'&.Mui-selected, &:hover': {
|
63
|
+
backgroundColor: 'white',
|
64
|
+
borderColor: colors.lineBorderBase,
|
65
|
+
color: colors.foregroundsFgBase
|
66
|
+
}
|
67
|
+
},
|
68
|
+
'.MuiTabs-indicator': {
|
69
|
+
display: 'none'
|
70
|
+
},
|
71
|
+
...rest.sx
|
72
|
+
},
|
73
|
+
children: tabs.map(x => /*#__PURE__*/_jsx(MuiTab, {
|
74
|
+
className: classes.tab,
|
75
|
+
value: x.value,
|
76
|
+
label: x.label,
|
77
|
+
icon: x.icon || null
|
78
|
+
}, x.value))
|
79
|
+
});
|
80
|
+
}
|
81
|
+
CardTabs.propTypes = {
|
82
|
+
tabs: PropTypes.array.isRequired,
|
83
|
+
current: PropTypes.string.isRequired,
|
84
|
+
onChange: PropTypes.func.isRequired
|
85
|
+
};
|
86
|
+
|
87
|
+
/**
|
88
|
+
* @typedef {import('@mui/material').TabsProps & {
|
89
|
+
* tabs: string[];
|
90
|
+
* onChange: (value) => {};
|
91
|
+
* variant: 'card' | 'fullWidth' | 'scrollable' | 'standard'
|
92
|
+
* }} TabsProps
|
93
|
+
*/
|
94
|
+
|
95
|
+
/**
|
96
|
+
* @description
|
97
|
+
* @param { TabsProps} props
|
98
|
+
* @return {import('react').ReactNode}
|
99
|
+
*/
|
100
|
+
|
22
101
|
export default function Tabs({
|
23
102
|
tabs,
|
24
103
|
current,
|
25
104
|
onChange,
|
26
105
|
...rest
|
27
106
|
}) {
|
107
|
+
if (rest.variant === 'card') {
|
108
|
+
return /*#__PURE__*/_jsx(CardTabs, {
|
109
|
+
tabs: tabs,
|
110
|
+
current: current,
|
111
|
+
onChange: onChange
|
112
|
+
});
|
113
|
+
}
|
28
114
|
return /*#__PURE__*/_jsx(StyledMuiTabs, {
|
29
115
|
scrollButtons: "auto",
|
30
116
|
variant: "scrollable",
|