@arcblock/ux 2.12.8 → 2.12.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.
- package/lib/Address/did-address.js +4 -1
- package/lib/Header/header.js +1 -0
- package/lib/Locale/selector.js +9 -7
- package/lib/RelativeTime/index.d.ts +2 -1
- package/lib/RelativeTime/index.js +2 -1
- package/lib/SessionUser/components/un-login.js +4 -1
- package/package.json +5 -5
- package/src/Address/did-address.tsx +3 -2
- package/src/Header/header.tsx +1 -0
- package/src/Locale/selector.tsx +12 -7
- package/src/RelativeTime/index.tsx +3 -1
- package/src/SessionUser/components/un-login.tsx +4 -1
@@ -1,10 +1,11 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
2
|
import '@fontsource/ubuntu-mono/400.css';
|
3
|
-
import { Check as CheckIcon
|
3
|
+
import { Check as CheckIcon } from '@mui/icons-material';
|
4
4
|
import { Box, Tooltip } from '@mui/material';
|
5
5
|
import { green } from '@mui/material/colors';
|
6
6
|
import copy from 'copy-to-clipboard';
|
7
7
|
import noop from 'lodash/noop';
|
8
|
+
import CopyIcon from '@arcblock/icons/lib/Copy';
|
8
9
|
import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react';
|
9
10
|
import { styled } from '../Theme';
|
10
11
|
import { getFontSize } from '../Util';
|
@@ -97,6 +98,8 @@ const DidAddress = /*#__PURE__*/forwardRef((props, ref) => {
|
|
97
98
|
/* title prop 直接加在 icon 上不生效 */
|
98
99
|
_jsx(CopyIcon, {
|
99
100
|
className: "did-address-copy",
|
101
|
+
width: 16,
|
102
|
+
height: 16,
|
100
103
|
onClick: onCopy
|
101
104
|
})
|
102
105
|
});
|
package/lib/Header/header.js
CHANGED
package/lib/Locale/selector.js
CHANGED
@@ -10,6 +10,7 @@ import { getColor, getBackground } from '../Util';
|
|
10
10
|
import { temp as colors } from '../Colors';
|
11
11
|
import { LocaleContext } from './context';
|
12
12
|
import { styled, useTheme } from '../Theme';
|
13
|
+
import { mergeSx } from '../Util/style';
|
13
14
|
export default function LocaleSelector(props) {
|
14
15
|
const {
|
15
16
|
showText = true,
|
@@ -90,6 +91,14 @@ export default function LocaleSelector(props) {
|
|
90
91
|
open: open,
|
91
92
|
anchorEl: anchorEl.current,
|
92
93
|
...popperProps,
|
94
|
+
// @ts-ignore
|
95
|
+
sx: mergeSx(
|
96
|
+
// @ts-ignore
|
97
|
+
{
|
98
|
+
zIndex: _theme => _theme.zIndex.tooltip + 10
|
99
|
+
},
|
100
|
+
// @ts-ignore
|
101
|
+
popperProps?.sx),
|
93
102
|
children: /*#__PURE__*/_jsx(Box, {
|
94
103
|
className: "locales",
|
95
104
|
sx: {
|
@@ -161,11 +170,4 @@ const Div = styled('div', {
|
|
161
170
|
color: ${props => getColor(props)};
|
162
171
|
}
|
163
172
|
}
|
164
|
-
`;
|
165
|
-
const StyledPopper = styled(Popper)`
|
166
|
-
z-index: ${({
|
167
|
-
theme
|
168
|
-
}) => {
|
169
|
-
return theme.zIndex.modal + 1;
|
170
|
-
}};
|
171
173
|
`;
|
@@ -9,5 +9,6 @@ export interface RelativeTimeProps {
|
|
9
9
|
type?: 'relative' | 'absolute';
|
10
10
|
tz?: string;
|
11
11
|
relativeRange?: number;
|
12
|
+
enableTooltip?: boolean;
|
12
13
|
}
|
13
|
-
export default function RelativeTime({ value, locale, withoutSuffix, from, to, type, tz, relativeRange, ...rest }: RelativeTimeProps): "-" | import("react/jsx-runtime").JSX.Element;
|
14
|
+
export default function RelativeTime({ value, locale, withoutSuffix, from, to, type, tz, relativeRange, enableTooltip, ...rest }: RelativeTimeProps): "-" | import("react/jsx-runtime").JSX.Element;
|
@@ -42,6 +42,7 @@ export default function RelativeTime({
|
|
42
42
|
type = 'relative',
|
43
43
|
tz,
|
44
44
|
relativeRange,
|
45
|
+
enableTooltip = true,
|
45
46
|
...rest
|
46
47
|
}) {
|
47
48
|
if (!value) {
|
@@ -77,7 +78,7 @@ export default function RelativeTime({
|
|
77
78
|
popContent = relativeString;
|
78
79
|
}
|
79
80
|
return /*#__PURE__*/_jsx(Tooltip, {
|
80
|
-
title: popContent,
|
81
|
+
title: enableTooltip ? popContent : undefined,
|
81
82
|
placement: "top-end",
|
82
83
|
enterTouchDelay: 0,
|
83
84
|
children: /*#__PURE__*/_jsx("span", {
|
@@ -114,6 +114,9 @@ export default function UnLogin({
|
|
114
114
|
open: currentState.open,
|
115
115
|
anchorEl: userAnchorRef.current,
|
116
116
|
transition: true,
|
117
|
+
sx: {
|
118
|
+
zIndex: theme => theme.zIndex.appBar
|
119
|
+
},
|
117
120
|
placement: "bottom-end",
|
118
121
|
modifiers: [{
|
119
122
|
name: 'offset',
|
@@ -145,8 +148,8 @@ export default function UnLogin({
|
|
145
148
|
},
|
146
149
|
children: [loginAppLogo && !currentState.loadAppLogoError ? /*#__PURE__*/_jsx("img", {
|
147
150
|
src: loginAppLogo,
|
148
|
-
height: 20,
|
149
151
|
style: {
|
152
|
+
height: 20,
|
150
153
|
maxWidth: 100
|
151
154
|
},
|
152
155
|
onError: () => {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "2.12.
|
3
|
+
"version": "2.12.10",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -68,12 +68,12 @@
|
|
68
68
|
"react": ">=18.2.0",
|
69
69
|
"react-router-dom": ">=6.22.3"
|
70
70
|
},
|
71
|
-
"gitHead": "
|
71
|
+
"gitHead": "a4e740e658ec69a4889872ce0c4f1ef6746fa57b",
|
72
72
|
"dependencies": {
|
73
73
|
"@arcblock/did-motif": "^1.1.13",
|
74
|
-
"@arcblock/icons": "^2.12.
|
75
|
-
"@arcblock/nft-display": "^2.12.
|
76
|
-
"@arcblock/react-hooks": "^2.12.
|
74
|
+
"@arcblock/icons": "^2.12.10",
|
75
|
+
"@arcblock/nft-display": "^2.12.10",
|
76
|
+
"@arcblock/react-hooks": "^2.12.10",
|
77
77
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
78
78
|
"@fontsource/inter": "^5.0.16",
|
79
79
|
"@fontsource/ubuntu-mono": "^5.0.18",
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import '@fontsource/ubuntu-mono/400.css';
|
2
|
-
import { Check as CheckIcon
|
2
|
+
import { Check as CheckIcon } from '@mui/icons-material';
|
3
3
|
import { Box, BoxProps, Tooltip } from '@mui/material';
|
4
4
|
import { green } from '@mui/material/colors';
|
5
5
|
import copy from 'copy-to-clipboard';
|
6
6
|
import noop from 'lodash/noop';
|
7
|
+
import CopyIcon from '@arcblock/icons/lib/Copy';
|
7
8
|
import React, { forwardRef, ReactNode, useImperativeHandle, useRef, useState } from 'react';
|
8
9
|
import { styled } from '../Theme';
|
9
10
|
import { getFontSize } from '../Util';
|
@@ -119,7 +120,7 @@ const DidAddress = forwardRef<HTMLDidAddressElement, IDidAddressProps>((props, r
|
|
119
120
|
</Tooltip>
|
120
121
|
) : (
|
121
122
|
/* title prop 直接加在 icon 上不生效 */
|
122
|
-
<CopyIcon className="did-address-copy" onClick={onCopy} />
|
123
|
+
<CopyIcon className="did-address-copy" width={16} height={16} onClick={onCopy} />
|
123
124
|
)}
|
124
125
|
</span>
|
125
126
|
);
|
package/src/Header/header.tsx
CHANGED
package/src/Locale/selector.tsx
CHANGED
@@ -11,6 +11,7 @@ import { temp as colors } from '../Colors';
|
|
11
11
|
import { LocaleContext } from './context';
|
12
12
|
import { styled, useTheme } from '../Theme';
|
13
13
|
import type { Locale } from '../type';
|
14
|
+
import { mergeSx } from '../Util/style';
|
14
15
|
|
15
16
|
export interface LocaleSelectorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
16
17
|
showText?: true | false;
|
@@ -94,7 +95,17 @@ export default function LocaleSelector(props: LocaleSelectorProps) {
|
|
94
95
|
</Box>
|
95
96
|
</ButtonComponent>
|
96
97
|
|
97
|
-
<Popper
|
98
|
+
<Popper
|
99
|
+
open={open}
|
100
|
+
anchorEl={anchorEl.current}
|
101
|
+
{...popperProps}
|
102
|
+
// @ts-ignore
|
103
|
+
sx={mergeSx(
|
104
|
+
// @ts-ignore
|
105
|
+
{ zIndex: (_theme) => _theme.zIndex.tooltip + 10 },
|
106
|
+
// @ts-ignore
|
107
|
+
popperProps?.sx
|
108
|
+
)}>
|
98
109
|
<Box
|
99
110
|
className="locales"
|
100
111
|
sx={{
|
@@ -168,9 +179,3 @@ const Div = styled('div', {
|
|
168
179
|
}
|
169
180
|
}
|
170
181
|
`;
|
171
|
-
|
172
|
-
const StyledPopper = styled(Popper)`
|
173
|
-
z-index: ${({ theme }) => {
|
174
|
-
return theme.zIndex.modal + 1;
|
175
|
-
}};
|
176
|
-
`;
|
@@ -44,6 +44,7 @@ export interface RelativeTimeProps {
|
|
44
44
|
type?: 'relative' | 'absolute';
|
45
45
|
tz?: string;
|
46
46
|
relativeRange?: number;
|
47
|
+
enableTooltip?: boolean;
|
47
48
|
}
|
48
49
|
|
49
50
|
export default function RelativeTime({
|
@@ -55,6 +56,7 @@ export default function RelativeTime({
|
|
55
56
|
type = 'relative',
|
56
57
|
tz,
|
57
58
|
relativeRange,
|
59
|
+
enableTooltip = true,
|
58
60
|
...rest
|
59
61
|
}: RelativeTimeProps) {
|
60
62
|
if (!value) {
|
@@ -96,7 +98,7 @@ export default function RelativeTime({
|
|
96
98
|
}
|
97
99
|
|
98
100
|
return (
|
99
|
-
<Tooltip title={popContent} placement="top-end" enterTouchDelay={0}>
|
101
|
+
<Tooltip title={enableTooltip ? popContent : undefined} placement="top-end" enterTouchDelay={0}>
|
100
102
|
<span {...rest}>{innerContent}</span>
|
101
103
|
</Tooltip>
|
102
104
|
);
|
@@ -128,6 +128,9 @@ export default function UnLogin({ session, onLogin = noop, size = 24, dark = fal
|
|
128
128
|
open={currentState.open}
|
129
129
|
anchorEl={userAnchorRef.current}
|
130
130
|
transition
|
131
|
+
sx={{
|
132
|
+
zIndex: (theme) => theme.zIndex.appBar,
|
133
|
+
}}
|
131
134
|
placement="bottom-end"
|
132
135
|
modifiers={[
|
133
136
|
{
|
@@ -160,8 +163,8 @@ export default function UnLogin({ session, onLogin = noop, size = 24, dark = fal
|
|
160
163
|
{loginAppLogo && !currentState.loadAppLogoError ? (
|
161
164
|
<img
|
162
165
|
src={loginAppLogo}
|
163
|
-
height={20}
|
164
166
|
style={{
|
167
|
+
height: 20,
|
165
168
|
maxWidth: 100,
|
166
169
|
}}
|
167
170
|
onError={() => {
|