@arcblock/ux 1.16.23 → 1.16.27
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/Blocklet/index.js +9 -1
- package/lib/Footer/index.js +7 -6
- package/lib/Locale/selector.js +6 -4
- package/package.json +4 -4
- package/src/Blocklet/index.js +53 -7
- package/src/Footer/index.js +38 -12
- package/src/Locale/selector.js +5 -8
package/lib/Blocklet/index.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = Blocklet;
|
|
7
|
+
exports.ActionButton = void 0;
|
|
7
8
|
|
|
8
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
10
|
|
|
@@ -44,7 +45,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
44
45
|
const Div = _styledComponents.default.div.withConfig({
|
|
45
46
|
displayName: "Blocklet__Div",
|
|
46
47
|
componentId: "sc-3dga5l-0"
|
|
47
|
-
})(["&.arcblock-blocklet{padding:0 16px;background:", ";overflow:hidden;&:hover{
|
|
48
|
+
})(["&.arcblock-blocklet{padding:0 16px;background:", ";overflow:hidden;box-shadow:0px 0px 8px #f0f0f0;&:hover{box-shadow:0px 2px 12px #f0f0f0;}}.arcblock-blocklet__content{padding:16px 0 0 0;}.arcblock-blocklet__content--main{display:flex;align-items:center;cursor:pointer;}.arcblock-blocklet__content--body{overflow:hidden;flex:1;display:flex;align-items:flex-start;}.arcblock-blocklet__addons{padding:16px 0;}.arcblock-blocklet__cover{width:80px;height:80px;margin-right:12px;overflow:hidden;border-radius:12px;transform:translateZ(0);}.arcblock-blocklet__info{flex:1;overflow:hidden;.arcblock-blocklet__button{margin-top:16px;display:inline-block;}}.arcblock-blocklet__button--hover{&:not(.Mui-disabled){position:relative;z-index:1;&::before{content:'';border-radius:100vw;position:absolute;height:100%;width:100%;left:0;top:0;transition:opacity 0.3s;}&:hover::before{opacity:0;}&::after{content:'';position:absolute;height:100%;width:100%;background-color:", ";transform:scale(0.1);opacity:0;z-index:-1;border-radius:100vw;transition:transform 0.3s,opacity 0.3s,background-color 0.3s;}&:hover::after{opacity:1;transform-origin:center;transform:scale(1);}}&:not(.Mui-disabled){background-color:rgba(79,106,246,0.06);color:", ";}&:not(.Mui-disabled){&:hover{color:", ";}}}.arcblock-blocklet__title{margin:0;font-size:18px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.arcblock-blocklet__describe{margin:0 0 2px 0;color:#999;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.arcblock-blocklet__addons{display:flex;justify-content:space-between;color:#999;font-size:14px;position:relative;}.arcblock-blocklet__addons--item{white-space:nowrap;}&.arcblock-blocklet--size-md{&:hover{position:relative;}.arcblock-blocklet__title{height:2.3em;margin-bottom:3px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:initial;white-space:initial;word-break:break-all;}.arcblock-blocklet__describe{white-space:normal;height:2.86em;}.arcblock-blocklet__button{margin-top:5px;}}&.arcblock-blocklet--size-sm,&.arcblock-blocklet--size-xs{.arcblock-blocklet__cover{width:40px;height:40px;border-radius:6px;}.arcblock-blocklet__content{padding:16px 0;}.arcblock-blocklet__addons{padding:8px 0;.arcblock-blocklet__addons--item{font-size:12px;}}}&.arcblock-blocklet--size-xs{.arcblock-blocklet__addons{display:none !important;}}"], props => props.theme.palette.common.white, props => props.theme.palette.primary.main, props => props.theme.palette.primary.main, props => props.theme.palette.common.white);
|
|
49
|
+
|
|
50
|
+
const ActionButton = _styledComponents.default.div.withConfig({
|
|
51
|
+
displayName: "Blocklet__ActionButton",
|
|
52
|
+
componentId: "sc-3dga5l-1"
|
|
53
|
+
})(["background-color:transparent !important;& >:not(.Mui-disabled){position:relative;z-index:1;&::before{content:'';border-radius:100vw;position:absolute;height:100%;width:100%;left:0;top:0;transition:opacity 0.3s;}&:hover::before{opacity:0;}&::after{content:'';position:absolute;height:100%;width:100%;background-color:", ";transform:scale(0.1);opacity:0;z-index:-1;border-radius:100vw;transition:transform 0.3s,opacity 0.3s,background-color 0.3s;}&:hover::after{opacity:1;transform-origin:center;transform:scale(1);}}& >:not(.Mui-disabled){background-color:rgba(79,106,246,0.06) !important;color:", "!important;}& >:not(.Mui-disabled){&:hover{color:", "!important;}}"], props => props.theme.palette.primary.main, props => props.theme.palette.primary.main, props => props.theme.palette.common.white);
|
|
54
|
+
|
|
55
|
+
exports.ActionButton = ActionButton;
|
|
48
56
|
|
|
49
57
|
function BlockletIcon(_ref) {
|
|
50
58
|
let {
|
package/lib/Footer/index.js
CHANGED
|
@@ -47,14 +47,15 @@ function Footer(props) {
|
|
|
47
47
|
className: "footer-brand"
|
|
48
48
|
}, brand)), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
49
49
|
component: "p",
|
|
50
|
-
className: "footer-item"
|
|
50
|
+
className: "footer-item",
|
|
51
|
+
style: {
|
|
52
|
+
justifyContent: 'flex-end',
|
|
53
|
+
flexShrink: 0
|
|
54
|
+
}
|
|
51
55
|
}, "Powered by", /*#__PURE__*/_react.default.createElement(_Logo.default, {
|
|
52
56
|
mode: dark ? 'light' : 'dark',
|
|
53
57
|
layout: "horizontal",
|
|
54
|
-
|
|
55
|
-
transform: 'scale(0.6)',
|
|
56
|
-
opacity: 0.5
|
|
57
|
-
}
|
|
58
|
+
className: "logo-container"
|
|
58
59
|
}))));
|
|
59
60
|
}
|
|
60
61
|
|
|
@@ -76,4 +77,4 @@ Footer.defaultProps = {
|
|
|
76
77
|
const Container = _styledComponents.default.div.withConfig({
|
|
77
78
|
displayName: "Footer__Container",
|
|
78
79
|
componentId: "sc-1qpifuv-0"
|
|
79
|
-
})(["margin-top:64px;padding:24px 0 32px;border-top:1px solid ", ";box-sizing:border-box;width:100
|
|
80
|
+
})(["margin-top:64px;padding:24px 0 32px;border-top:1px solid ", ";box-sizing:border-box;width:100%;@media (max-width:540px){padding:8px 0;}.footer{display:flex;align-items:center;justify-content:space-between;.footer-item{color:", ";display:flex;align-items:center;flex-wrap:wrap;font-size:0.9rem;}.footer-brand{margin-left:8px;margin-right:8px;}.logo-container{margin:0 24px;width:90px;opacity:0.5;}@media (max-width:540px){.footer-item{font-size:0.7rem;}.logo-container{margin:0 0 0 16px;width:70px;height:40px;}}@media (max-width:380px){.footer-item{font-size:0.65rem;}.logo-container{margin:0 0 0 8px;height:24px;}}}"], props => props.dark ? props.theme.palette.grey[900] : '#dee2e7', props => props.theme.palette.grey[900]);
|
package/lib/Locale/selector.js
CHANGED
|
@@ -61,7 +61,7 @@ function LocaleSelector(props) {
|
|
|
61
61
|
locale,
|
|
62
62
|
changeLocale
|
|
63
63
|
} = (0, _react.useContext)(_context.LocaleContext);
|
|
64
|
-
const
|
|
64
|
+
const anchorEl = (0, _react.useRef)(null);
|
|
65
65
|
const [open, setOpen] = (0, _react.useState)(false);
|
|
66
66
|
const theme = (0, _styles.useTheme)();
|
|
67
67
|
|
|
@@ -75,7 +75,9 @@ function LocaleSelector(props) {
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
function onClose(e) {
|
|
78
|
-
|
|
78
|
+
var _anchorEl$current;
|
|
79
|
+
|
|
80
|
+
if ((_anchorEl$current = anchorEl.current) !== null && _anchorEl$current !== void 0 && _anchorEl$current.contains(e.target)) return;
|
|
79
81
|
setOpen(false);
|
|
80
82
|
}
|
|
81
83
|
|
|
@@ -85,7 +87,7 @@ function LocaleSelector(props) {
|
|
|
85
87
|
dark: dark,
|
|
86
88
|
theme: theme
|
|
87
89
|
}, rest), /*#__PURE__*/_react.default.createElement(ButtonComponent, {
|
|
88
|
-
|
|
90
|
+
ref: anchorEl,
|
|
89
91
|
className: "trigger",
|
|
90
92
|
onClick: () => setOpen(!open)
|
|
91
93
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
@@ -97,7 +99,7 @@ function LocaleSelector(props) {
|
|
|
97
99
|
className: "trigger-text"
|
|
98
100
|
}, _context.languages.find(x => x.value === locale).text) : ''), /*#__PURE__*/_react.default.createElement(_Popper.default, Object.assign({
|
|
99
101
|
open: open,
|
|
100
|
-
anchorEl: anchorEl
|
|
102
|
+
anchorEl: anchorEl.current
|
|
101
103
|
}, popperProps, {
|
|
102
104
|
disablePortal: true
|
|
103
105
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.27",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"react": ">=16.12.0",
|
|
54
54
|
"react-ga": "^2.7.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "2b31a3a7be899aeb694485bec6defd4689dffc51",
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@arcblock/icons": "^1.16.
|
|
59
|
-
"@arcblock/react-hooks": "^1.16.
|
|
58
|
+
"@arcblock/icons": "^1.16.27",
|
|
59
|
+
"@arcblock/react-hooks": "^1.16.27",
|
|
60
60
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
61
61
|
"@material-ui/core": "^4.12.3",
|
|
62
62
|
"@material-ui/icons": "4.11.2",
|
package/src/Blocklet/index.js
CHANGED
|
@@ -17,10 +17,10 @@ const Div = styled.div`
|
|
|
17
17
|
padding: 0 16px;
|
|
18
18
|
background: ${props => props.theme.palette.common.white};
|
|
19
19
|
overflow: hidden;
|
|
20
|
+
box-shadow: 0px 0px 8px #f0f0f0;
|
|
20
21
|
&:hover {
|
|
21
|
-
|
|
22
|
+
box-shadow: 0px 2px 12px #f0f0f0;
|
|
22
23
|
}
|
|
23
|
-
border-bottom: 1px solid #f0f0f0;
|
|
24
24
|
}
|
|
25
25
|
.arcblock-blocklet__content {
|
|
26
26
|
padding: 16px 0 0 0;
|
|
@@ -45,6 +45,8 @@ const Div = styled.div`
|
|
|
45
45
|
margin-right: 12px;
|
|
46
46
|
overflow: hidden;
|
|
47
47
|
border-radius: 12px;
|
|
48
|
+
/* see: https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */
|
|
49
|
+
transform: translateZ(0);
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
.arcblock-blocklet__info {
|
|
@@ -112,7 +114,7 @@ const Div = styled.div`
|
|
|
112
114
|
white-space: nowrap;
|
|
113
115
|
}
|
|
114
116
|
.arcblock-blocklet__describe {
|
|
115
|
-
margin:
|
|
117
|
+
margin: 0 0 2px 0;
|
|
116
118
|
color: #999;
|
|
117
119
|
font-size: 14px;
|
|
118
120
|
overflow: hidden;
|
|
@@ -134,10 +136,8 @@ const Div = styled.div`
|
|
|
134
136
|
&:hover {
|
|
135
137
|
position: relative;
|
|
136
138
|
}
|
|
137
|
-
.arcblock-blocklet__content {
|
|
138
|
-
height: 8.5em;
|
|
139
|
-
}
|
|
140
139
|
.arcblock-blocklet__title {
|
|
140
|
+
height: 2.3em;
|
|
141
141
|
margin-bottom: 3px;
|
|
142
142
|
display: -webkit-box;
|
|
143
143
|
-webkit-box-orient: vertical;
|
|
@@ -178,6 +178,52 @@ const Div = styled.div`
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
`;
|
|
181
|
+
const ActionButton = styled.div`
|
|
182
|
+
background-color: transparent !important;
|
|
183
|
+
& > :not(.Mui-disabled) {
|
|
184
|
+
position: relative;
|
|
185
|
+
z-index: 1;
|
|
186
|
+
&::before {
|
|
187
|
+
content: '';
|
|
188
|
+
border-radius: 100vw;
|
|
189
|
+
position: absolute;
|
|
190
|
+
height: 100%;
|
|
191
|
+
width: 100%;
|
|
192
|
+
left: 0;
|
|
193
|
+
top: 0;
|
|
194
|
+
transition: opacity 0.3s;
|
|
195
|
+
}
|
|
196
|
+
&:hover::before {
|
|
197
|
+
opacity: 0;
|
|
198
|
+
}
|
|
199
|
+
&::after {
|
|
200
|
+
content: '';
|
|
201
|
+
position: absolute;
|
|
202
|
+
height: 100%;
|
|
203
|
+
width: 100%;
|
|
204
|
+
background-color: ${props => props.theme.palette.primary.main};
|
|
205
|
+
transform: scale(0.1);
|
|
206
|
+
opacity: 0;
|
|
207
|
+
z-index: -1;
|
|
208
|
+
border-radius: 100vw;
|
|
209
|
+
transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
|
|
210
|
+
}
|
|
211
|
+
&:hover::after {
|
|
212
|
+
opacity: 1;
|
|
213
|
+
transform-origin: center;
|
|
214
|
+
transform: scale(1);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
& > :not(.Mui-disabled) {
|
|
218
|
+
background-color: rgba(79, 106, 246, 0.06) !important;
|
|
219
|
+
color: ${props => props.theme.palette.primary.main}!important;
|
|
220
|
+
}
|
|
221
|
+
& > :not(.Mui-disabled) {
|
|
222
|
+
&:hover {
|
|
223
|
+
color: ${props => props.theme.palette.common.white}!important;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
`;
|
|
181
227
|
function BlockletIcon({ name }) {
|
|
182
228
|
return <Icon name={name} color="inherit" size={15} style={{ marginRight: 8 }} />;
|
|
183
229
|
}
|
|
@@ -342,7 +388,7 @@ export default function Blocklet({
|
|
|
342
388
|
</Div>
|
|
343
389
|
);
|
|
344
390
|
}
|
|
345
|
-
|
|
391
|
+
export { ActionButton };
|
|
346
392
|
Blocklet.propTypes = {
|
|
347
393
|
title: PropTypes.string.isRequired,
|
|
348
394
|
did: PropTypes.string,
|
package/src/Footer/index.js
CHANGED
|
@@ -21,13 +21,12 @@ export default function Footer(props) {
|
|
|
21
21
|
<span className="footer-copy">© Copyright {copyYear} </span>
|
|
22
22
|
<span className="footer-brand">{brand}</span>
|
|
23
23
|
</Typography>
|
|
24
|
-
<Typography
|
|
24
|
+
<Typography
|
|
25
|
+
component="p"
|
|
26
|
+
className="footer-item"
|
|
27
|
+
style={{ justifyContent: 'flex-end', flexShrink: 0 }}>
|
|
25
28
|
Powered by
|
|
26
|
-
<Logo
|
|
27
|
-
mode={dark ? 'light' : 'dark'}
|
|
28
|
-
layout="horizontal"
|
|
29
|
-
style={{ transform: 'scale(0.6)', opacity: 0.5 }}
|
|
30
|
-
/>
|
|
29
|
+
<Logo mode={dark ? 'light' : 'dark'} layout="horizontal" className="logo-container" />
|
|
31
30
|
</Typography>
|
|
32
31
|
</Typography>
|
|
33
32
|
</Container>
|
|
@@ -57,17 +56,15 @@ const Container = styled.div`
|
|
|
57
56
|
box-sizing: border-box;
|
|
58
57
|
width: 100%;
|
|
59
58
|
|
|
59
|
+
@media (max-width: 540px) {
|
|
60
|
+
padding: 8px 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
60
63
|
.footer {
|
|
61
64
|
display: flex;
|
|
62
65
|
align-items: center;
|
|
63
66
|
justify-content: space-between;
|
|
64
67
|
|
|
65
|
-
@media (max-width: 540px) {
|
|
66
|
-
flex-direction: column;
|
|
67
|
-
align-items: flex-start;
|
|
68
|
-
justify-content: flex-start;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
68
|
.footer-item {
|
|
72
69
|
color: ${props => props.theme.palette.grey[900]};
|
|
73
70
|
display: flex;
|
|
@@ -80,5 +77,34 @@ const Container = styled.div`
|
|
|
80
77
|
margin-left: 8px;
|
|
81
78
|
margin-right: 8px;
|
|
82
79
|
}
|
|
80
|
+
|
|
81
|
+
.logo-container {
|
|
82
|
+
margin: 0 24px;
|
|
83
|
+
width: 90px;
|
|
84
|
+
opacity: 0.5;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@media (max-width: 540px) {
|
|
88
|
+
.footer-item {
|
|
89
|
+
font-size: 0.7rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.logo-container {
|
|
93
|
+
margin: 0 0 0 16px;
|
|
94
|
+
width: 70px;
|
|
95
|
+
height: 40px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@media (max-width: 380px) {
|
|
100
|
+
.footer-item {
|
|
101
|
+
font-size: 0.65rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.logo-container {
|
|
105
|
+
margin: 0 0 0 8px;
|
|
106
|
+
height: 24px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
83
109
|
}
|
|
84
110
|
`;
|
package/src/Locale/selector.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useContext } from 'react';
|
|
1
|
+
import React, { useState, useContext, useRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
@@ -22,7 +22,7 @@ import globeLight from './images/globe-light.png';
|
|
|
22
22
|
function LocaleSelector(props) {
|
|
23
23
|
const { dark, showText, popperProps, ...rest } = props;
|
|
24
24
|
const { locale, changeLocale } = useContext(LocaleContext);
|
|
25
|
-
const
|
|
25
|
+
const anchorEl = useRef(null);
|
|
26
26
|
const [open, setOpen] = useState(false);
|
|
27
27
|
const theme = useTheme();
|
|
28
28
|
|
|
@@ -35,7 +35,7 @@ function LocaleSelector(props) {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
function onClose(e) {
|
|
38
|
-
if (anchorEl
|
|
38
|
+
if (anchorEl.current?.contains(e.target)) return;
|
|
39
39
|
setOpen(false);
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -43,10 +43,7 @@ function LocaleSelector(props) {
|
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
45
|
<Div component="div" dark={dark} theme={theme} {...rest}>
|
|
46
|
-
<ButtonComponent
|
|
47
|
-
buttonRef={node => setAnchorEl(node)}
|
|
48
|
-
className="trigger"
|
|
49
|
-
onClick={() => setOpen(!open)}>
|
|
46
|
+
<ButtonComponent ref={anchorEl} className="trigger" onClick={() => setOpen(!open)}>
|
|
50
47
|
<img src={dark ? globeDark : globeLight} className="trigger-image" alt="globe" />
|
|
51
48
|
{showText ? (
|
|
52
49
|
<Typography component="strong" className="trigger-text">
|
|
@@ -56,7 +53,7 @@ function LocaleSelector(props) {
|
|
|
56
53
|
''
|
|
57
54
|
)}
|
|
58
55
|
</ButtonComponent>
|
|
59
|
-
<Popper open={open} anchorEl={anchorEl} {...popperProps} disablePortal>
|
|
56
|
+
<Popper open={open} anchorEl={anchorEl.current} {...popperProps} disablePortal>
|
|
60
57
|
<div className="locales">
|
|
61
58
|
<ClickAwayListener onClickAway={onClose}>
|
|
62
59
|
<MenuList>
|