@arcblock/ux 2.1.3 → 2.1.6
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/blocklet.js
CHANGED
|
@@ -36,7 +36,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
36
36
|
const Div = _styledComponents.default.div.withConfig({
|
|
37
37
|
displayName: "blocklet__Div",
|
|
38
38
|
componentId: "sc-atxvkd-0"
|
|
39
|
-
})(["&.arcblock-blocklet{padding:
|
|
39
|
+
})(["&.arcblock-blocklet{padding:", " ", " 0 ", ";}.arcblock-blocklet__content{cursor:pointer;display:flex;", "{align-items:center;}}.arcblock-blocklet__cover{width:64px;height:64px;margin-right:", ";overflow:hidden;border-radius:12px;transform:translateZ(0);", "{width:80px;height:80px;margin-bottom:12px;}}.arcblock-blocklet__button--hover{&:not(.Mui-disabled){position:relative;z-index:1;&::before{content:'';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;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:transparent !important;color:", ";}&:not(.Mui-disabled){&:hover{color:", ";}}}.arcblock-blocklet__info{flex:1;overflow:hidden;border-bottom:1px solid ", ";padding-bottom:", ";}.arcblock-blocklet__text{height:57px;overflow:hidden;}.arcblock-blocklet__title{margin:0;font-size:16px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.arcblock-blocklet__describe{margin-top:", ";color:", ";font-size:14px;font-weight:500;line-height:17px;max-height:34px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;word-break:break-word;}.arcblock-blocklet__version{color:", ";font-size:12px;}"], props => props.theme.spacing(2), props => props.theme.spacing(2), props => props.theme.spacing(2), props => props.theme.breakpoints.up('sm'), props => props.theme.spacing(2), props => props.theme.breakpoints.up('sm'), props => props.theme.palette.primary.main, props => props.theme.palette.primary.main, props => props.theme.palette.common.white, props => props.theme.palette.divider, props => props.theme.spacing(2), props => props.theme.spacing(0.5), props => props.theme.palette.grey[600], props => props.theme.palette.grey[600]);
|
|
40
40
|
|
|
41
41
|
function BlockletStore(_ref) {
|
|
42
42
|
let {
|
package/lib/Header/header.js
CHANGED
|
@@ -94,7 +94,7 @@ Header.defaultProps = {
|
|
|
94
94
|
const Root = _styledComponents.default.div.withConfig({
|
|
95
95
|
displayName: "header__Root",
|
|
96
96
|
componentId: "sc-15qnwg1-0"
|
|
97
|
-
})(["position:relative;z-index:", ";font-size:14px;background:", ";.header-container{display:flex;align-items:center;height:64px;padding:
|
|
97
|
+
})(["position:relative;z-index:", ";font-size:14px;background:", ";.header-container{display:flex;align-items:center;height:64px;padding:0 16px;", "{padding:0;}}.header-logo{display:inline-flex;justify-content:center;position:relative;height:40px;margin-right:16px;img,svg{width:auto;height:100%;}> a{height:100%;line-height:1;}> a::before{position:absolute;top:0;right:0;bottom:0;left:0;background-color:transparent;content:'';}}.header-brand{display:flex;flex-direction:column;flex-shrink:0;margin-right:16px;.header-brand-title{display:flex;align-items:center;h2{font-size:16px;}.header-brand-addon{margin-left:8px;}}.header-brand-desc{color:#9397a1;}}.header-addons{display:flex;align-items:center;}", "{.header-brand{margin-right:12px;.header-brand-title{h2{font-size:14px;}}}}", "{.header-container{height:56px;}.header-menu{display:inline-block;}.header-logo{height:32px;}.header-brand{display:none;}}"], props => props.$theme.zIndex.drawer + 1, props => props.$theme.palette.common.white, props => props.$theme.breakpoints.up('lg'), props => props.$theme.breakpoints.down('lg'), props => props.$theme.breakpoints.down('md'));
|
|
98
98
|
|
|
99
99
|
var _default = Header;
|
|
100
100
|
exports.default = _default;
|
package/lib/NavMenu/nav-menu.js
CHANGED
|
@@ -74,7 +74,7 @@ function NavMenu(_ref) {
|
|
|
74
74
|
children = filterItems(children);
|
|
75
75
|
|
|
76
76
|
if (!(items !== null && items !== void 0 && items.length) && !((_children = children) !== null && _children !== void 0 && _children.length)) {
|
|
77
|
-
|
|
77
|
+
throw new Error("One of 'items' or 'children' is required by NavMenu component.");
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
const [state, setState] = (0, _react.useState)({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/ux",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "Common used react components for arcblock products",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"react": ">=18.1.0",
|
|
53
53
|
"react-ga": "^2.7.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "2b8a9723f5280a51416f34afd78472d2e4dbb353",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@arcblock/icons": "^2.1.
|
|
58
|
-
"@arcblock/react-hooks": "^2.1.
|
|
57
|
+
"@arcblock/icons": "^2.1.6",
|
|
58
|
+
"@arcblock/react-hooks": "^2.1.6",
|
|
59
59
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
60
60
|
"@emotion/react": "^11.9.0",
|
|
61
61
|
"@emotion/styled": "^11.8.1",
|
package/src/Blocklet/blocklet.js
CHANGED
|
@@ -12,7 +12,8 @@ import Img from '../Img';
|
|
|
12
12
|
|
|
13
13
|
const Div = styled.div`
|
|
14
14
|
&.arcblock-blocklet {
|
|
15
|
-
padding:
|
|
15
|
+
padding: ${props => props.theme.spacing(2)} ${props => props.theme.spacing(2)} 0
|
|
16
|
+
${props => props.theme.spacing(2)};
|
|
16
17
|
}
|
|
17
18
|
.arcblock-blocklet__content {
|
|
18
19
|
cursor: pointer;
|
|
@@ -24,7 +25,7 @@ const Div = styled.div`
|
|
|
24
25
|
.arcblock-blocklet__cover {
|
|
25
26
|
width: 64px;
|
|
26
27
|
height: 64px;
|
|
27
|
-
margin-right:
|
|
28
|
+
margin-right: ${props => props.theme.spacing(2)};
|
|
28
29
|
overflow: hidden;
|
|
29
30
|
border-radius: 12px;
|
|
30
31
|
/* see: https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */
|
|
@@ -83,7 +84,7 @@ const Div = styled.div`
|
|
|
83
84
|
flex: 1;
|
|
84
85
|
overflow: hidden;
|
|
85
86
|
border-bottom: 1px solid ${props => props.theme.palette.divider};
|
|
86
|
-
padding-bottom:
|
|
87
|
+
padding-bottom: ${props => props.theme.spacing(2)};
|
|
87
88
|
}
|
|
88
89
|
.arcblock-blocklet__text {
|
|
89
90
|
height: 57px;
|
|
@@ -94,14 +95,12 @@ const Div = styled.div`
|
|
|
94
95
|
margin: 0;
|
|
95
96
|
font-size: 16px;
|
|
96
97
|
font-weight: 500;
|
|
97
|
-
line-height: 19px;
|
|
98
|
-
max-height: 19px;
|
|
99
98
|
overflow: hidden;
|
|
100
99
|
text-overflow: ellipsis;
|
|
101
100
|
white-space: nowrap;
|
|
102
101
|
}
|
|
103
102
|
.arcblock-blocklet__describe {
|
|
104
|
-
margin-top:
|
|
103
|
+
margin-top: ${props => props.theme.spacing(0.5)};
|
|
105
104
|
color: ${props => props.theme.palette.grey[600]};
|
|
106
105
|
font-size: 14px;
|
|
107
106
|
font-weight: 500;
|
|
@@ -112,7 +111,7 @@ const Div = styled.div`
|
|
|
112
111
|
display: -webkit-box;
|
|
113
112
|
-webkit-line-clamp: 2;
|
|
114
113
|
-webkit-box-orient: vertical;
|
|
115
|
-
word-break: break-
|
|
114
|
+
word-break: break-word;
|
|
116
115
|
}
|
|
117
116
|
.arcblock-blocklet__version {
|
|
118
117
|
color: ${props => props.theme.palette.grey[600]};
|
package/src/Header/header.js
CHANGED
|
@@ -78,7 +78,11 @@ const Root = styled.div`
|
|
|
78
78
|
display: flex;
|
|
79
79
|
align-items: center;
|
|
80
80
|
height: 64px;
|
|
81
|
-
padding
|
|
81
|
+
/* mui container 左右 padding 控制, 宽屏下不需要 padding (与 content 对齐), 窄屏下设置 16px padding */
|
|
82
|
+
padding: 0 16px;
|
|
83
|
+
${props => props.$theme.breakpoints.up('lg')} {
|
|
84
|
+
padding: 0;
|
|
85
|
+
}
|
|
82
86
|
}
|
|
83
87
|
.header-logo {
|
|
84
88
|
display: inline-flex;
|
package/src/NavMenu/nav-menu.js
CHANGED
|
@@ -38,7 +38,7 @@ function NavMenu({
|
|
|
38
38
|
// eslint-disable-next-line no-param-reassign
|
|
39
39
|
children = filterItems(children);
|
|
40
40
|
if (!items?.length && !children?.length) {
|
|
41
|
-
|
|
41
|
+
throw new Error("One of 'items' or 'children' is required by NavMenu component.");
|
|
42
42
|
}
|
|
43
43
|
const [state, setState] = useState({ activeId: defaultActiveId, openedIds: [] });
|
|
44
44
|
const contextValue = useMemo(() => {
|