@arcblock/ux 2.1.9 → 2.1.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.
@@ -43,7 +43,7 @@ function Footer(props) {
43
43
  className: "footer-item"
44
44
  }, /*#__PURE__*/_react.default.createElement("span", {
45
45
  className: "footer-copy"
46
- }, "\xA9 Copyright ", copyYear, " "), /*#__PURE__*/_react.default.createElement("span", {
46
+ }, "Copyright \xA9 ", copyYear, " "), /*#__PURE__*/_react.default.createElement("span", {
47
47
  className: "footer-brand"
48
48
  }, brand)), /*#__PURE__*/_react.default.createElement(_Typography.default, {
49
49
  component: "p",
@@ -68,7 +68,7 @@ Footer.propTypes = {
68
68
  };
69
69
  Footer.defaultProps = {
70
70
  dark: false,
71
- brand: 'ArcBlock Inc.',
71
+ brand: 'ArcBlock, Inc.',
72
72
  copyStart: '2017',
73
73
  className: '',
74
74
  style: {}
@@ -17,7 +17,7 @@ var _Container = _interopRequireDefault(require("@mui/material/Container"));
17
17
 
18
18
  var _useTheme = _interopRequireDefault(require("@mui/styles/useTheme"));
19
19
 
20
- const _excluded = ["logo", "brand", "brandAddon", "description", "children", "addons", "prepend", "containerComponent"];
20
+ const _excluded = ["logo", "brand", "brandAddon", "description", "children", "addons", "prepend"];
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
@@ -37,15 +37,14 @@ function Header(_ref) {
37
37
  description,
38
38
  children,
39
39
  addons,
40
- prepend,
41
- containerComponent: ContainerComponent
40
+ prepend
42
41
  } = _ref,
43
42
  rest = _objectWithoutProperties(_ref, _excluded);
44
43
 
45
44
  const theme = (0, _useTheme.default)();
46
45
  return /*#__PURE__*/_react.default.createElement(Root, Object.assign({}, rest, {
47
46
  $theme: theme
48
- }), /*#__PURE__*/_react.default.createElement(ContainerComponent, {
47
+ }), /*#__PURE__*/_react.default.createElement(_Container.default, {
49
48
  className: "header-container"
50
49
  }, prepend, logo && /*#__PURE__*/_react.default.createElement("div", {
51
50
  className: "header-logo"
@@ -76,9 +75,7 @@ Header.propTypes = {
76
75
  // 右侧区域, 可以放置 icons/actions/login 等
77
76
  addons: _propTypes.default.node,
78
77
  // logo 左侧内容
79
- prepend: _propTypes.default.node,
80
- // 默认使用 mui 的 Container, 如果不想限制 header 内容区域的宽度, 可以设置为 div
81
- containerComponent: _propTypes.default.elementType
78
+ prepend: _propTypes.default.node
82
79
  };
83
80
  Header.defaultProps = {
84
81
  logo: null,
@@ -87,14 +84,13 @@ Header.defaultProps = {
87
84
  description: null,
88
85
  children: null,
89
86
  addons: null,
90
- prepend: null,
91
- containerComponent: _Container.default
87
+ prepend: null
92
88
  };
93
89
 
94
90
  const Root = _styledComponents.default.div.withConfig({
95
91
  displayName: "header__Root",
96
92
  componentId: "sc-15qnwg1-0"
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'));
93
+ })(["position:relative;z-index:", ";font-size:14px;background:", ";.header-container{display:flex;align-items:center;height:64px;}.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.down('lg'), props => props.$theme.breakpoints.down('md'));
98
94
 
99
95
  var _default = Header;
100
96
  exports.default = _default;
@@ -12,7 +12,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
12
12
  const NavMenuBase = _styledComponents.default.nav.withConfig({
13
13
  displayName: "style__NavMenuBase",
14
14
  componentId: "sc-2g7isz-0"
15
- })(["--text-color:", ";--active-text-color:", ";--bg-color:", ";background-color:var(--bg-color);font-size:14px;ul{list-style:none;margin:0;padding:0;}.navmenu-item,.navmenu-sub{display:flex;align-items:center;}.navmenu-item,.navmenu-item a,.navmenu-sub{color:var(--text-color);}.navmenu-item--active,.navmenu-item:hover,.navmenu-item:hover a,.navmenu-item--active a,.navmenu-sub--opened{color:var(--active-text-color);}.navmenu-item{position:relative;cursor:pointer;a{text-decoration:none;white-space:nowrap;}a::before{position:absolute;top:0;right:0;bottom:0;left:0;background-color:transparent;content:'';}}.navmenu-sub{position:relative;cursor:pointer;}.navmenu-item-icon,.navmenu-sub-icon,.navmenu-sub-expand-icon{display:flex;line-height:1;}.navmenu-item-icon,.navmenu-sub-icon{margin-right:4px;}.navmenu-item-icon > *,.navmenu-sub-icon > *{font-size:1.5em;}.navmenu-sub-expand-icon{margin-left:8px;> *{width:0.8em;height:0.8em;transition:transform 0.2s ease-in-out;}}"], props => props.$textColor, props => props.$activeTextColor, props => props.$bgColor);
15
+ })(["background-color:", ";font-size:14px;ul{list-style:none;margin:0;padding:0;}.navmenu-item,.navmenu-sub{display:flex;align-items:center;}a{color:inherit;}.navmenu-item,.navmenu-sub{color:", ";}.navmenu-item--active,.navmenu-item:hover,.navmenu-sub--opened{color:", ";}.navmenu-item{position:relative;cursor:pointer;transition:color 0.2s ease-in-out;a{text-decoration:none;white-space:nowrap;}a::before{position:absolute;top:0;right:0;bottom:0;left:0;background-color:transparent;content:'';}}.navmenu-sub{position:relative;cursor:pointer;}.navmenu-item-icon,.navmenu-sub-icon,.navmenu-sub-expand-icon{display:flex;line-height:1;}.navmenu-item-icon,.navmenu-sub-icon{margin-right:4px;}.navmenu-item-icon > *,.navmenu-sub-icon > *{font-size:1.5em;}.navmenu-sub-expand-icon{margin-left:8px;> *{width:0.8em;height:0.8em;transition:transform 0.2s ease-in-out;}}"], props => props.$bgColor, props => props.$textColor, props => props.$activeTextColor);
16
16
 
17
17
  const HorizontalStyle = (0, _styledComponents.default)(NavMenuBase).withConfig({
18
18
  displayName: "style__HorizontalStyle",
@@ -24,5 +24,5 @@ exports.HorizontalStyle = HorizontalStyle;
24
24
  const InlineStyle = (0, _styledComponents.default)(NavMenuBase).withConfig({
25
25
  displayName: "style__InlineStyle",
26
26
  componentId: "sc-2g7isz-2"
27
- })([".navmenu-root{display:flex;flex-direction:column;align-items:stretch;}.navmenu-item,.navmenu-sub{padding:0 16px;}.navmenu-root > .navmenu-item,.navmenu-root > .navmenu-sub{height:48px;line-height:48px;border-bottom:1px solid #eee;}.navmenu-item-icon,.navmenu-sub-icon{width:32px;margin:0;}.navmenu-sub-expand-icon{margin-left:auto;}.navmenu-sub-container{display:none;position:absolute;top:100%;left:0;right:0;.navmenu-item,.navmenu-sub{line-height:24px;}}.navmenu-sub-list{padding-left:16px;.navmenu-item,.navmenu-sub{padding-left:32px;margin-top:8px;font-size:13px;}}.navmenu-root > .navmenu-sub{&.navmenu-sub--opened{background:#eee;}}.navmenu-sub--opened > .navmenu-sub-container{display:block;}"]);
27
+ })([".navmenu-root{display:flex;flex-direction:column;align-items:stretch;}.navmenu-item,.navmenu-sub{padding:0 16px;}& .navmenu-sub{flex-wrap:wrap;}.navmenu-root > .navmenu-item,.navmenu-root > .navmenu-sub{line-height:48px;border-bottom:1px solid #eee;}.navmenu-item-icon,.navmenu-sub-icon{width:32px;margin:0;}.navmenu-sub-expand-icon{margin-left:auto;}.navmenu-sub-container{display:none;flex:1 0 100%;margin:0 -16px;padding-bottom:8px;.navmenu-item,.navmenu-sub{line-height:32px;}}.navmenu-sub-list{padding-left:16px;.navmenu-item,.navmenu-sub{padding-left:32px;font-size:13px;}}.navmenu-root > .navmenu-sub{&.navmenu-sub--opened{background:#eee;}}.navmenu-sub--opened > .navmenu-sub-container{display:block;}"]);
28
28
  exports.InlineStyle = InlineStyle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.1.9",
3
+ "version": "2.1.10",
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": "7a3efb456e1dbe3318ab8757feb9e58a88c08d8e",
55
+ "gitHead": "f31615cda7024bde33cc8b4be093ab8e0baf46a1",
56
56
  "dependencies": {
57
- "@arcblock/icons": "^2.1.9",
58
- "@arcblock/react-hooks": "^2.1.9",
57
+ "@arcblock/icons": "^2.1.10",
58
+ "@arcblock/react-hooks": "^2.1.10",
59
59
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
60
60
  "@emotion/react": "^11.9.0",
61
61
  "@emotion/styled": "^11.8.1",
@@ -18,7 +18,7 @@ export default function Footer(props) {
18
18
  <Container className={className} style={style} dark={dark}>
19
19
  <Typography component="div" className="footer">
20
20
  <Typography component="p" className="footer-item">
21
- <span className="footer-copy">&copy; Copyright {copyYear} </span>
21
+ <span className="footer-copy">Copyright &copy; {copyYear} </span>
22
22
  <span className="footer-brand">{brand}</span>
23
23
  </Typography>
24
24
  <Typography
@@ -43,7 +43,7 @@ Footer.propTypes = {
43
43
 
44
44
  Footer.defaultProps = {
45
45
  dark: false,
46
- brand: 'ArcBlock Inc.',
46
+ brand: 'ArcBlock, Inc.',
47
47
  copyStart: '2017',
48
48
  className: '',
49
49
  style: {},
@@ -9,21 +9,11 @@ import useTheme from '@mui/styles/useTheme';
9
9
  * Header 组件
10
10
  * TODO: Layout/dashboard 可以复用此处的 header
11
11
  */
12
- function Header({
13
- logo,
14
- brand,
15
- brandAddon,
16
- description,
17
- children,
18
- addons,
19
- prepend,
20
- containerComponent: ContainerComponent,
21
- ...rest
22
- }) {
12
+ function Header({ logo, brand, brandAddon, description, children, addons, prepend, ...rest }) {
23
13
  const theme = useTheme();
24
14
  return (
25
15
  <Root {...rest} $theme={theme}>
26
- <ContainerComponent className="header-container">
16
+ <Container className="header-container">
27
17
  {prepend}
28
18
  {logo && <div className="header-logo">{logo}</div>}
29
19
  <div className="header-brand">
@@ -36,7 +26,7 @@ function Header({
36
26
  {children}
37
27
  <Box flexGrow={1} />
38
28
  <div className="header-addons">{addons}</div>
39
- </ContainerComponent>
29
+ </Container>
40
30
  </Root>
41
31
  );
42
32
  }
@@ -54,8 +44,6 @@ Header.propTypes = {
54
44
  addons: PropTypes.node,
55
45
  // logo 左侧内容
56
46
  prepend: PropTypes.node,
57
- // 默认使用 mui 的 Container, 如果不想限制 header 内容区域的宽度, 可以设置为 div
58
- containerComponent: PropTypes.elementType,
59
47
  };
60
48
 
61
49
  Header.defaultProps = {
@@ -66,7 +54,6 @@ Header.defaultProps = {
66
54
  children: null,
67
55
  addons: null,
68
56
  prepend: null,
69
- containerComponent: Container,
70
57
  };
71
58
 
72
59
  const Root = styled.div`
@@ -78,11 +65,6 @@ const Root = styled.div`
78
65
  display: flex;
79
66
  align-items: center;
80
67
  height: 64px;
81
- /* mui container 左右 padding 控制, 宽屏下不需要 padding (与 content 对齐), 窄屏下设置 16px padding */
82
- padding: 0 16px;
83
- ${props => props.$theme.breakpoints.up('lg')} {
84
- padding: 0;
85
- }
86
68
  }
87
69
  .header-logo {
88
70
  display: inline-flex;
@@ -1,11 +1,7 @@
1
1
  import styled from 'styled-components';
2
2
 
3
3
  const NavMenuBase = styled.nav`
4
- --text-color: ${props => props.$textColor};
5
- --active-text-color: ${props => props.$activeTextColor};
6
- --bg-color: ${props => props.$bgColor};
7
-
8
- background-color: var(--bg-color);
4
+ background-color: ${props => props.$bgColor};
9
5
  font-size: 14px;
10
6
  ul {
11
7
  list-style: none;
@@ -17,23 +13,24 @@ const NavMenuBase = styled.nav`
17
13
  display: flex;
18
14
  align-items: center;
19
15
  }
20
- // active/hover
16
+ a {
17
+ color: inherit;
18
+ }
19
+ /* active/hover */
21
20
  .navmenu-item,
22
- .navmenu-item a,
23
21
  .navmenu-sub {
24
- color: var(--text-color);
22
+ color: ${props => props.$textColor};
25
23
  }
26
24
  .navmenu-item--active,
27
25
  .navmenu-item:hover,
28
- .navmenu-item:hover a,
29
- .navmenu-item--active a,
30
26
  .navmenu-sub--opened {
31
- color: var(--active-text-color);
27
+ color: ${props => props.$activeTextColor};
32
28
  }
33
29
 
34
30
  .navmenu-item {
35
31
  position: relative;
36
32
  cursor: pointer;
33
+ transition: color 0.2s ease-in-out;
37
34
  a {
38
35
  text-decoration: none;
39
36
  white-space: nowrap;
@@ -53,7 +50,7 @@ const NavMenuBase = styled.nav`
53
50
  position: relative;
54
51
  cursor: pointer;
55
52
  }
56
- // icon & expand icon
53
+ /* icon & expand icon */
57
54
  .navmenu-item-icon,
58
55
  .navmenu-sub-icon,
59
56
  .navmenu-sub-expand-icon {
@@ -84,7 +81,7 @@ export const HorizontalStyle = styled(NavMenuBase)`
84
81
  display: flex;
85
82
  align-items: center;
86
83
  }
87
- // 顶级菜单间隔
84
+ /* 顶级菜单间隔 */
88
85
  .navmenu-root > .navmenu-item,
89
86
  .navmenu-root > .navmenu-sub {
90
87
  margin-left: 24px;
@@ -109,7 +106,7 @@ export const HorizontalStyle = styled(NavMenuBase)`
109
106
  margin-top: 8px;
110
107
  }
111
108
  }
112
- // 二级 sub menu
109
+ /* 二级 sub menu */
113
110
  .navmenu-root > .navmenu-sub {
114
111
  > .navmenu-sub-container {
115
112
  left: 50%;
@@ -133,14 +130,16 @@ export const InlineStyle = styled(NavMenuBase)`
133
130
  .navmenu-sub {
134
131
  padding: 0 16px;
135
132
  }
136
- // 顶级
133
+ & .navmenu-sub {
134
+ flex-wrap: wrap;
135
+ }
136
+ /* 顶级 */
137
137
  .navmenu-root > .navmenu-item,
138
138
  .navmenu-root > .navmenu-sub {
139
- height: 48px;
140
139
  line-height: 48px;
141
140
  border-bottom: 1px solid #eee;
142
141
  }
143
- // icon
142
+ /* icon */
144
143
  .navmenu-item-icon,
145
144
  .navmenu-sub-icon {
146
145
  width: 32px;
@@ -152,13 +151,12 @@ export const InlineStyle = styled(NavMenuBase)`
152
151
  /* 子级列表 */
153
152
  .navmenu-sub-container {
154
153
  display: none;
155
- position: absolute;
156
- top: 100%;
157
- left: 0;
158
- right: 0;
154
+ flex: 1 0 100%;
155
+ margin: 0 -16px;
156
+ padding-bottom: 8px;
159
157
  .navmenu-item,
160
158
  .navmenu-sub {
161
- line-height: 24px;
159
+ line-height: 32px;
162
160
  }
163
161
  }
164
162
  .navmenu-sub-list {
@@ -166,11 +164,10 @@ export const InlineStyle = styled(NavMenuBase)`
166
164
  .navmenu-item,
167
165
  .navmenu-sub {
168
166
  padding-left: 32px;
169
- margin-top: 8px;
170
167
  font-size: 13px;
171
168
  }
172
169
  }
173
- // 二级 menu
170
+ /* 二级 menu */
174
171
  .navmenu-root > .navmenu-sub {
175
172
  &.navmenu-sub--opened {
176
173
  background: #eee;