@arcblock/ux 1.16.60 → 1.16.63

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.
@@ -0,0 +1,257 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = BlockletNFT;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
11
+
12
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
+
14
+ var _Portal = _interopRequireDefault(require("@material-ui/core/Portal"));
15
+
16
+ var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
17
+
18
+ var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress"));
19
+
20
+ var _useMediaQuery = _interopRequireDefault(require("@material-ui/core/useMediaQuery"));
21
+
22
+ var _useTheme = _interopRequireDefault(require("@material-ui/core/styles/useTheme"));
23
+
24
+ var _Avatar = _interopRequireDefault(require("@arcblock/did-connect/lib/Avatar"));
25
+
26
+ var _Icon = _interopRequireDefault(require("../Icon"));
27
+
28
+ var _Button = _interopRequireDefault(require("../Button"));
29
+
30
+ var _Img = _interopRequireDefault(require("../Img"));
31
+
32
+ const _excluded = ["title", "did", "description", "cover", "size", "addons", "button", "buttonText", "buttonDisabled", "buttonLoading", "isStickyButton", "onButtonClick", "onMainClick", "onTagClick", "className", "scaleClickZone"];
33
+
34
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
+
36
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
37
+
38
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
39
+
40
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
41
+
42
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
43
+
44
+ /**
45
+ * 美化数字 1000-->1k
46
+ * @param {*} _size
47
+ * @param {*} digits
48
+ * @returns
49
+ */
50
+ function prettySize(_size) {
51
+ let digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
52
+ let size = _size;
53
+ const list = ['', 'k', 'm', 'b'];
54
+ let index = 0;
55
+
56
+ while (size > 1000 && index < list.length - 1) {
57
+ size = (size / 1000).toFixed(digits);
58
+ index += 1;
59
+ }
60
+
61
+ return _size && "".concat(size).concat(list[index]);
62
+ }
63
+
64
+ const Div = _styledComponents.default.div.withConfig({
65
+ displayName: "BlockletNFT__Div",
66
+ componentId: "sc-19lczgp-0"
67
+ })(["&.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__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;.arcblock-blocklet__button{margin-top:16px;display:inline-block;}}.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);
68
+
69
+ function BlockletIcon(_ref) {
70
+ let {
71
+ name
72
+ } = _ref;
73
+ return /*#__PURE__*/_react.default.createElement(_Icon.default, {
74
+ name: name,
75
+ color: "inherit",
76
+ size: 15,
77
+ style: {
78
+ marginRight: 8
79
+ }
80
+ });
81
+ }
82
+
83
+ BlockletIcon.propTypes = {
84
+ name: _propTypes.default.string.isRequired
85
+ };
86
+
87
+ function BlockletNFT(_ref2) {
88
+ let {
89
+ title,
90
+ did,
91
+ description,
92
+ cover,
93
+ size,
94
+ addons,
95
+ button,
96
+ buttonText,
97
+ buttonDisabled,
98
+ buttonLoading,
99
+ isStickyButton,
100
+ onButtonClick,
101
+ onMainClick,
102
+ onTagClick,
103
+ className,
104
+ scaleClickZone
105
+ } = _ref2,
106
+ rest = _objectWithoutProperties(_ref2, _excluded);
107
+
108
+ const wrapHandler = function wrapHandler(handler) {
109
+ let stopFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => false;
110
+ return function (e) {
111
+ if (stopFn()) {
112
+ e.preventDefault();
113
+ e.stopPropagation();
114
+ } else if (handler instanceof Function) {
115
+ e.preventDefault();
116
+ e.stopPropagation();
117
+
118
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
119
+ args[_key - 1] = arguments[_key];
120
+ }
121
+
122
+ handler(...args);
123
+ }
124
+ };
125
+ };
126
+
127
+ const _onButtonClick = wrapHandler(onButtonClick, () => {
128
+ // stop click while custom button or buttonDisabled or buttondLoading
129
+ if (button || buttonDisabled || buttonLoading) {
130
+ return true;
131
+ }
132
+
133
+ return false;
134
+ });
135
+
136
+ const _onMainClick = wrapHandler(onMainClick);
137
+
138
+ const theme = (0, _useTheme.default)();
139
+ const isDownSm = (0, _useMediaQuery.default)(theme.breakpoints.down('sm'));
140
+ const isDownMd = (0, _useMediaQuery.default)(theme.breakpoints.down('md'));
141
+ const isUpLg = (0, _useMediaQuery.default)(theme.breakpoints.up('lg')); // If size is auto, need calculate actual size according to screen size
142
+ // eslint-disable-next-line no-nested-ternary
143
+
144
+ const actualSize = size === 'auto' ? isDownSm ? 'xs' : isDownMd ? 'sm' : 'md' : size; // eslint-disable-next-line no-nested-ternary
145
+
146
+ const didAvatarSize = size === 'auto' ? isUpLg ? 80 : 40 : size === 'md' ? 80 : 40;
147
+ const container = (0, _react.useRef)(null);
148
+ return /*#__PURE__*/_react.default.createElement(Div, Object.assign({}, rest, {
149
+ scaleClickZone: scaleClickZone,
150
+ className: "".concat(className, " arcblock-blocklet arcblock-blocklet--size-").concat(actualSize)
151
+ }), /*#__PURE__*/_react.default.createElement("div", {
152
+ className: "arcblock-blocklet__content"
153
+ }, /*#__PURE__*/_react.default.createElement("div", {
154
+ className: "arcblock-blocklet__content--main",
155
+ onClick: _onMainClick,
156
+ ref: container
157
+ }, /*#__PURE__*/_react.default.createElement("div", {
158
+ className: "arcblock-blocklet__content--body"
159
+ }, cover ? /*#__PURE__*/_react.default.createElement("div", {
160
+ className: "arcblock-blocklet__cover"
161
+ }, /*#__PURE__*/_react.default.createElement(_Img.default, {
162
+ src: cover
163
+ })) : did && /*#__PURE__*/_react.default.createElement("div", {
164
+ className: "arcblock-blocklet__cover"
165
+ }, /*#__PURE__*/_react.default.createElement(_Avatar.default, {
166
+ did: did,
167
+ size: didAvatarSize
168
+ })), /*#__PURE__*/_react.default.createElement("div", {
169
+ className: "arcblock-blocklet__info"
170
+ }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
171
+ component: "h3",
172
+ variant: "h3",
173
+ className: "arcblock-blocklet__title",
174
+ title: title
175
+ }, title), description && /*#__PURE__*/_react.default.createElement(_Typography.default, {
176
+ component: "div",
177
+ variant: "body2",
178
+ className: "arcblock-blocklet__describe",
179
+ title: description
180
+ }, description), ['md', 'sm', 'xs'].includes(actualSize) && /*#__PURE__*/_react.default.createElement(_Portal.default, {
181
+ container: container.current,
182
+ disablePortal: actualSize === 'md'
183
+ }, /*#__PURE__*/_react.default.createElement("div", {
184
+ className: "arcblock-blocklet__button",
185
+ onClick: _onButtonClick,
186
+ style: {
187
+ display: isStickyButton ? 'block' : ''
188
+ }
189
+ }, button || onButtonClick && /*#__PURE__*/_react.default.createElement(_Button.default, {
190
+ className: "arcblock-blocklet__button--hover",
191
+ variant: "outlined",
192
+ color: "primary",
193
+ size: "small",
194
+ disabled: buttonDisabled || buttonLoading,
195
+ style: actualSize === 'md' ? {
196
+ padding: '3px 20px',
197
+ fontSize: '14px'
198
+ } : {
199
+ padding: '3px 15px',
200
+ minWidth: '54px',
201
+ fontSize: '13px'
202
+ }
203
+ }, buttonLoading && /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
204
+ size: actualSize === 'md' ? 15 : 13,
205
+ style: {
206
+ marginRight: 3,
207
+ color: 'inherit'
208
+ }
209
+ }), buttonText))))))), /*#__PURE__*/_react.default.createElement("div", {
210
+ className: "arcblock-blocklet__addons"
211
+ }, addons.map((item, index) => /*#__PURE__*/_react.default.createElement(_Typography.default, {
212
+ component: "span",
213
+ variant: "caption",
214
+ className: "arcblock-blocklet__addons--item" // eslint-disable-next-line react/no-array-index-key
215
+ ,
216
+ key: index,
217
+ title: item.title
218
+ }, item.empty ? null : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(BlockletIcon, {
219
+ name: item.icon
220
+ }), item.pretty ? prettySize(item.value) : item.value)))));
221
+ }
222
+
223
+ BlockletNFT.propTypes = {
224
+ title: _propTypes.default.string.isRequired,
225
+ did: _propTypes.default.string,
226
+ isStickyButton: _propTypes.default.bool,
227
+ description: _propTypes.default.string,
228
+ cover: _propTypes.default.string,
229
+ buttonText: _propTypes.default.string,
230
+ buttonDisabled: _propTypes.default.bool,
231
+ buttonLoading: _propTypes.default.bool,
232
+ button: _propTypes.default.element,
233
+ addons: _propTypes.default.arrayOf(_propTypes.default.object),
234
+ size: _propTypes.default.oneOf(['xs', 'sm', 'md', 'auto']),
235
+ onButtonClick: _propTypes.default.func,
236
+ onMainClick: _propTypes.default.func,
237
+ onTagClick: _propTypes.default.func,
238
+ className: _propTypes.default.string,
239
+ scaleClickZone: _propTypes.default.number
240
+ };
241
+ BlockletNFT.defaultProps = {
242
+ description: null,
243
+ cover: null,
244
+ did: null,
245
+ isStickyButton: false,
246
+ buttonText: 'Install',
247
+ buttonDisabled: false,
248
+ buttonLoading: false,
249
+ button: null,
250
+ size: 'auto',
251
+ addons: [],
252
+ onButtonClick: null,
253
+ onMainClick: null,
254
+ onTagClick: null,
255
+ className: null,
256
+ scaleClickZone: 1.5
257
+ };
@@ -29,6 +29,49 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
29
29
 
30
30
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
31
31
 
32
+ const extendedColors = {
33
+ danger: {
34
+ contained: {
35
+ backgroundColor: _Colors.default.error.main,
36
+ color: _Colors.default.common.white
37
+ },
38
+ outlined: {
39
+ borderColor: _Colors.default.error.main,
40
+ color: _Colors.default.error.main
41
+ }
42
+ },
43
+ warning: {
44
+ contained: {
45
+ backgroundColor: _Colors.default.warning.main,
46
+ color: _Colors.default.common.white
47
+ },
48
+ outlined: {
49
+ borderColor: _Colors.default.warning.main,
50
+ color: _Colors.default.warning.main
51
+ }
52
+ },
53
+ did: {
54
+ contained: {
55
+ backgroundColor: _Colors.default.did.primary,
56
+ color: _Colors.default.common.white
57
+ },
58
+ outlined: {
59
+ borderColor: _Colors.default.did.primary,
60
+ color: _Colors.default.did.primary
61
+ }
62
+ },
63
+ reverse: {
64
+ contained: {
65
+ backgroundColor: 'rgba(255, 255, 255, 0.9)',
66
+ color: _Colors.default.grey[900]
67
+ },
68
+ outlined: {
69
+ borderColor: _Colors.default.grey[900],
70
+ color: _Colors.default.grey[900]
71
+ }
72
+ }
73
+ };
74
+
32
75
  function _default(BaseComponent) {
33
76
  function WrappedComponent(props) {
34
77
  const newProps = (0, _Util.mergeProps)(props, WrappedComponent, ['style']);
@@ -57,64 +100,22 @@ function _default(BaseComponent) {
57
100
  break;
58
101
 
59
102
  default:
60
- }
103
+ } // mui 只支持 4 种 color 值: default/inherit/primary/secondary (传入这 4 种之外的值会报 warning),
104
+ // 这里扩展 danger/warning/reverse/did 四种 color
105
+
61
106
 
62
- const styles = Object.assign({}, style, {
107
+ const matched = extendedColors[color] && extendedColors[color][rest.variant];
108
+ const styles = Object.assign({}, style, _objectSpread({
63
109
  boxShadow: 'none',
64
110
  textTransform: 'capitalize'
65
- }); // mui 只支持 4 种 color 值: default/inherit/primary/secondary (传入这 4 种之外的值会报 warning),
66
- // 这里扩展 danger/warning/reverse 三种 color
67
-
111
+ }, matched));
68
112
  let _rest = rest;
69
113
 
70
- switch (color) {
71
- case 'error':
72
- case 'danger':
73
- {
74
- if (rest.variant === 'contained') {
75
- styles.backgroundColor = _Colors.default.error.main;
76
- styles.color = _Colors.default.common.white;
77
- } else {
78
- styles.borderColor = _Colors.default.error.main;
79
- styles.color = _Colors.default.error.main;
80
- }
81
-
82
- break;
83
- }
84
-
85
- case 'warning':
86
- {
87
- if (rest.variant === 'contained') {
88
- styles.backgroundColor = _Colors.default.warning.main;
89
- styles.color = _Colors.default.common.white;
90
- } else {
91
- styles.borderColor = _Colors.default.warning.main;
92
- styles.color = _Colors.default.warning.main;
93
- }
94
-
95
- break;
96
- }
97
-
98
- case 'reverse':
99
- {
100
- if (rest.variant === 'contained') {
101
- styles.backgroundColor = 'rgba(255, 255, 255, 0.9)';
102
- styles.color = _Colors.default.grey[900];
103
- } else {
104
- styles.borderColor = _Colors.default.grey[900];
105
- styles.color = _Colors.default.grey[900];
106
- }
107
-
108
- break;
109
- }
110
- // 除扩展的几种 color 外, 由 mui button 自己处理 color
111
-
112
- default:
113
- {
114
- _rest = _objectSpread(_objectSpread({}, _rest), {}, {
115
- color
116
- });
117
- }
114
+ if (!matched) {
115
+ // mui button 本身支持的 color 交由 mui 处理
116
+ _rest = _objectSpread(_objectSpread({}, _rest), {}, {
117
+ color
118
+ });
118
119
  }
119
120
 
120
121
  if (rounded) {
@@ -21,6 +21,8 @@ var _Box = _interopRequireDefault(require("@material-ui/core/Box"));
21
21
 
22
22
  var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
23
23
 
24
+ var _Hidden = _interopRequireDefault(require("@material-ui/core/Hidden"));
25
+
24
26
  var _Menu = _interopRequireDefault(require("@material-ui/icons/Menu"));
25
27
 
26
28
  var _reactRouterDom = require("react-router-dom");
@@ -38,7 +40,16 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
38
40
  const StyledAppBar = (0, _styledComponents.default)(_AppBar.default).withConfig({
39
41
  displayName: "header__StyledAppBar",
40
42
  componentId: "sc-yt81c4-0"
41
- })(["&&{z-index:", ";background:", ";box-shadow:none;top:0;height:auto;}.header-toolbar{background:", ";color:", ";margin:", "px 0;}.header-link{display:flex;text-decoration:none;flex-shrink:1;overflow:hidden;}.header-logo{margin-right:20px;}.header-title{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;}.header-title__primary{font-size:24px;font-weight:800;color:", ";text-transform:uppercase;display:flex;align-items:center;}.header-title__secondary{font-size:14px;line-height:1.71;color:", ";}.header-addons{display:flex;justify-content:center;align-items:center;flex-shrink:9999999;.user-addon{.header-avatar{width:32px;border-radius:16px;height:auto;}}}.header-menu{display:none;}@media (max-width:", "px){.header-logo{position:absolute;width:0;height:0;overflow:hidden;}.header-title{display:none;}.header-title__primary{font-size:20px;}.header-menu{display:block;}}"], props => props.theme.zIndex.drawer + 1, props => props.theme.palette.background.default, props => props.theme.palette.background.default, props => props.theme.palette.text.primary, props => props.theme.spacing(1), props => props.theme.typography.color.main, props => props.theme.typography.color.gray, props => props.theme.breakpoints.values.md);
43
+ })(["&&{z-index:", ";background:", ";box-shadow:none;top:0;height:auto;}.header-toolbar{background:", ";color:", ";margin:", "px 0;}.header-link{display:flex;text-decoration:none;flex-shrink:1;overflow:hidden;}.header-logo{margin-right:20px;}.header-title{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;}.header-title__primary{font-size:24px;font-weight:800;color:", ";text-transform:uppercase;display:flex;align-items:center;}.header-title__secondary{font-size:14px;line-height:1.71;color:", ";}.header-addons{display:flex;justify-content:center;align-items:center;flex-shrink:9999999;.user-addon{.header-avatar{width:32px;border-radius:16px;height:auto;}}}.header-menu{display:none;}", "{.header-title{display:none;}.header-title__primary{font-size:20px;}.header-menu{display:block;}}"], props => props.theme.zIndex.drawer + 1, props => props.theme.palette.background.default, props => props.theme.palette.background.default, props => props.theme.palette.text.primary, props => props.theme.spacing(1), props => props.theme.typography.color.main, props => props.theme.typography.color.gray, props => props.theme.breakpoints.down('sm'));
44
+ /*
45
+ 自定义 logo 相关:
46
+ 如果为 logo prop 传入一个自定义的 svg, 并且 svg 中的元素通过 id 引用了 defs 中的元素 (比如 linearGradient),
47
+ 这种情况下因为 header 和 sidebar 中会各有一个相同的 svg, defs 中元素的 id 会出现冲突,
48
+ 当屏幕较窄时, header 会通过设置 display:none 将 svg logo 隐藏,
49
+ 这会导致 svg defs 中的元素不能被正常引用 (比如 fill 引用的 color 失效), 这会进一步导致 sidebar 中的 logo 不能正常显示.
50
+ 考虑到上述问题, 目前使用 Hidden 组件控制 logo 的显示/隐藏
51
+ 参考: https://blog.patw.me/archives/1820/inline-svg-same-id-and-display-none-issue/
52
+ */
42
53
 
43
54
  function Header(_ref) {
44
55
  let {
@@ -68,11 +79,13 @@ function Header(_ref) {
68
79
  }, /*#__PURE__*/_react.default.createElement(_Menu.default, null)), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, {
69
80
  to: homeUrl,
70
81
  className: "header-link"
82
+ }, /*#__PURE__*/_react.default.createElement(_Hidden.default, {
83
+ smDown: true
71
84
  }, /*#__PURE__*/_react.default.createElement("div", {
72
85
  className: "header-logo"
73
86
  }, logo || /*#__PURE__*/_react.default.createElement(_Logo.default, {
74
87
  showText: false
75
- })), /*#__PURE__*/_react.default.createElement("div", {
88
+ }))), /*#__PURE__*/_react.default.createElement("div", {
76
89
  className: "header-title"
77
90
  }, /*#__PURE__*/_react.default.createElement(_Typography.default, {
78
91
  component: "h2",
@@ -67,10 +67,10 @@ function Dashboard(_ref) {
67
67
  const {
68
68
  width
69
69
  } = (0, _useWindowSize.default)();
70
- const [drawerMode, setDrawerMode] = (0, _react.useState)(width > breakpoint ? 'permanent' : 'temporary');
70
+ const [drawerMode, setDrawerMode] = (0, _react.useState)(width >= breakpoint ? 'permanent' : 'temporary');
71
71
  const [drawerOpen, setDrawerOpen] = (0, _react.useState)(drawerMode === 'permanent');
72
72
  (0, _react.useEffect)(() => {
73
- const newMode = width > breakpoint ? 'permanent' : 'temporary';
73
+ const newMode = width >= breakpoint ? 'permanent' : 'temporary';
74
74
  setDrawerMode(newMode);
75
75
  setDrawerOpen(newMode !== 'temporary');
76
76
  }, [width]);
@@ -104,13 +104,13 @@ Sidebar.defaultProps = {
104
104
  const MenuItems = /*#__PURE__*/_react.default.memo(_styledComponents.default.div.withConfig({
105
105
  displayName: "sidebar__MenuItems",
106
106
  componentId: "sc-gaosgy-0"
107
- })(["flex:1;display:flex;flex-direction:column;&& .sidebar-logo{display:none;border-bottom:1px solid #eee;background:", ";position:sticky;top:0;z-index:1;padding:10px 0;text-align:center;font-size:0;}@media (max-width:", "px){&& .sidebar-logo{display:block;}}"], props => props.theme.palette.background.default, props => props.theme.breakpoints.values.md));
107
+ })(["flex:1;display:flex;flex-direction:column;&& .sidebar-logo{display:none;border-bottom:1px solid #eee;background:", ";position:sticky;top:0;z-index:1;padding:10px 0;text-align:center;font-size:0;}", "{&& .sidebar-logo{display:block;}}"], props => props.theme.palette.background.default, props => props.theme.breakpoints.down('sm')));
108
108
 
109
109
  const gradient = 'linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))';
110
110
  const MenuItem = (0, _styledComponents.default)(_Button.default).withConfig({
111
111
  displayName: "sidebar__MenuItem",
112
112
  componentId: "sc-gaosgy-1"
113
- })(["&&{display:block;width:100%;transition:all 200ms ease-in-out;background:", ";padding:24px 0;border-left:2px solid ", ";&:hover{background:", ";border-left-color:", ";}.menu-title{margin-top:8px;font-size:12px;font-weight:500;text-align:center;text-transform:capitalize;letter-spacing:normal;width:80%;}.MuiButton-label{display:flex;flex-direction:column;justify-content:center;align-items:center;}}"], props => props.selected ? gradient : '', props => props.selected ? _teal.default.A700 : 'transparent', gradient, _teal.default.A700);
113
+ })(["&&{display:block;width:100%;transition:all 200ms ease-in-out;background:", ";padding:24px 0;border-left:2px solid ", ";border-radius:0;&:hover{background:", ";border-left-color:", ";}.menu-title{margin-top:8px;font-size:12px;font-weight:500;text-align:center;text-transform:capitalize;letter-spacing:normal;width:80%;}.MuiButton-label{display:flex;flex-direction:column;justify-content:center;align-items:center;}}"], props => props.selected ? gradient : '', props => props.selected ? _teal.default.A700 : 'transparent', gradient, _teal.default.A700);
114
114
 
115
115
  var _default = (0, _reactRouterDom.withRouter)((0, _withTheme.default)(Sidebar));
116
116
 
@@ -232,7 +232,7 @@ Layout.defaultProps = {
232
232
  const Div = _styledComponents.default.div.withConfig({
233
233
  displayName: "Layout__Div",
234
234
  componentId: "sc-12bllvc-0"
235
- })(["width:100%;min-height:100vh;display:flex;flex-direction:column;.appbar{&.appbar--border{box-shadow:none;&::before{content:'';position:absolute;left:0;right:0;height:1px;bottom:-1px;display:block;background-color:rgba(0,0,0,0.12);}}}.toolbar{min-height:56px;background:inherit;white-space:nowrap;.menu-logo{font-size:0;margin-right:8px;}.nav-links{display:flex;align-items:center;.nav-link{margin:8px 12px;font-size:16px;display:flex;align-items:center;}.highlight-nav{font-weight:bolder;}}.brand{cursor:pointer;text-decoration:none;overflow:hidden;text-overflow:ellipsis;flex-shrink:1;}.description{color:#999;font-size:15px;margin-left:10px;font-weight:normal;flex-shrink:999999;}}@media (min-width:", "px){.toolbar{.menu-button{display:none;}.menu-logo{& + .brand{padding-left:45px;margin-left:-45px;}}}}@media (max-width:", "px){.toolbar{.nav-links,.menu-logo,.description{display:none;}}}"], props => props.theme.breakpoints.values.md, props => props.theme.breakpoints.values.md - 1);
235
+ })(["width:100%;min-height:100vh;display:flex;flex-direction:column;.appbar{&.appbar--border{box-shadow:none;&::before{content:'';position:absolute;left:0;right:0;height:1px;bottom:-1px;display:block;background-color:rgba(0,0,0,0.12);}}}.toolbar{min-height:56px;background:inherit;white-space:nowrap;.menu-logo{font-size:0;margin-right:8px;}.nav-links{display:flex;align-items:center;.nav-link{margin:8px 12px;font-size:16px;display:flex;align-items:center;}.highlight-nav{font-weight:bolder;}}.brand{cursor:pointer;text-decoration:none;overflow:hidden;text-overflow:ellipsis;flex-shrink:1;}.description{color:#999;font-size:15px;margin-left:10px;font-weight:normal;flex-shrink:999999;}}", "{.toolbar{.menu-button{display:none;}.menu-logo{& + .brand{padding-left:45px;margin-left:-45px;}}}}", "{.toolbar{.nav-links,.menu-logo,.description{display:none;}}}"], props => props.theme.breakpoints.up('md'), props => props.theme.breakpoints.down('sm'));
236
236
 
237
237
  const DrawerDiv = _styledComponents.default.nav.withConfig({
238
238
  displayName: "Layout__DrawerDiv",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "1.16.60",
3
+ "version": "1.16.63",
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": "7747d27c27d53c64a05209031851e02d70f3dae0",
56
+ "gitHead": "78ad4d4975b6f5afcf1e5b7f02e497cd90d9abbb",
57
57
  "dependencies": {
58
- "@arcblock/icons": "^1.16.60",
59
- "@arcblock/react-hooks": "^1.16.60",
58
+ "@arcblock/icons": "^1.16.63",
59
+ "@arcblock/react-hooks": "^1.16.63",
60
60
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
61
61
  "@fontsource/lato": "^4.5.3",
62
62
  "@material-ui/core": "^4.12.3",