@arcblock/ux 2.11.40 → 2.11.42

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,2 @@
1
+ import { type BoxProps } from '@mui/material';
2
+ export default function HeaderAddons({ children, ...rest }: BoxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box } from '@mui/material';
3
+ export default function HeaderAddons({
4
+ children,
5
+ ...rest
6
+ }) {
7
+ return /*#__PURE__*/_jsx(Box, {
8
+ sx: {
9
+ display: 'flex',
10
+ alignItems: 'center',
11
+ gap: 1.5,
12
+ '> *': {
13
+ m: '0px!important'
14
+ },
15
+ '.MuiIconButton-root': {
16
+ width: 32,
17
+ height: 32,
18
+ p: 0,
19
+ border: 1,
20
+ borderColor: 'divider'
21
+ },
22
+ '.MuiIconButton-root svg, .MuiButton-root svg': {
23
+ fontSize: 18,
24
+ width: '1em!important',
25
+ height: '1em!important'
26
+ },
27
+ '.arc-session-user-logged-in > *, .arc-session-user-logged-in svg': {
28
+ width: '100%!important',
29
+ height: '100%!important'
30
+ },
31
+ '.arc-session-user-unlogin svg': {
32
+ transform: 'scale(1)!important'
33
+ }
34
+ },
35
+ ...rest,
36
+ children: children
37
+ });
38
+ }
@@ -3,6 +3,7 @@ import { Box, Container } from '@mui/material';
3
3
  import { useRef, useState, useEffect } from 'react';
4
4
  import AutoHidden from './auto-hidden';
5
5
  import { styled } from '../Theme';
6
+ import HeaderAddons from './header-addons';
6
7
  /**
7
8
  * Header 组件
8
9
  * TODO: Layout/dashboard 可以复用此处的 header
@@ -89,35 +90,8 @@ function Header({
89
90
  }), children, align === 'left' && /*#__PURE__*/_jsx(Box, {
90
91
  display: "inline-block",
91
92
  flexGrow: 1
92
- }), /*#__PURE__*/_jsx(Box, {
93
+ }), /*#__PURE__*/_jsx(HeaderAddons, {
93
94
  className: "header-addons",
94
- sx: {
95
- display: 'flex',
96
- alignItems: 'center',
97
- gap: 1.5,
98
- '> *': {
99
- m: '0px!important'
100
- },
101
- '.MuiIconButton-root': {
102
- width: 32,
103
- height: 32,
104
- p: 0,
105
- border: 1,
106
- borderColor: 'divider'
107
- },
108
- '.MuiIconButton-root svg, .MuiButton-root svg': {
109
- fontSize: 18,
110
- width: '1em!important',
111
- height: '1em!important'
112
- },
113
- '.arc-session-user-logged-in > *, .arc-session-user-logged-in svg': {
114
- width: '100%!important',
115
- height: '100%!important'
116
- },
117
- '.arc-session-user-unlogin svg': {
118
- transform: 'scale(1)!important'
119
- }
120
- },
121
95
  children: addons
122
96
  })]
123
97
  })
@@ -1,2 +1,3 @@
1
1
  export { default as Header } from './header';
2
2
  export { default as ResponsiveHeader } from './responsive-header';
3
+ export { default as HeaderAddons } from './header-addons';
@@ -1,2 +1,3 @@
1
1
  export { default as Header } from './header';
2
- export { default as ResponsiveHeader } from './responsive-header';
2
+ export { default as ResponsiveHeader } from './responsive-header';
3
+ export { default as HeaderAddons } from './header-addons';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.11.40",
3
+ "version": "2.11.42",
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": "902304719f15accb2719003cc28a60f87cd00275",
71
+ "gitHead": "db05fbba511a4822d5c386fd31e7d079cbc5009f",
72
72
  "dependencies": {
73
73
  "@arcblock/did-motif": "^1.1.13",
74
- "@arcblock/icons": "^2.11.40",
75
- "@arcblock/nft-display": "^2.11.40",
76
- "@arcblock/react-hooks": "^2.11.40",
74
+ "@arcblock/icons": "^2.11.42",
75
+ "@arcblock/nft-display": "^2.11.42",
76
+ "@arcblock/react-hooks": "^2.11.42",
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",
@@ -0,0 +1,37 @@
1
+ import { Box, type BoxProps } from '@mui/material';
2
+
3
+ export default function HeaderAddons({ children, ...rest }: BoxProps) {
4
+ return (
5
+ <Box
6
+ sx={{
7
+ display: 'flex',
8
+ alignItems: 'center',
9
+ gap: 1.5,
10
+ '> *': {
11
+ m: '0px!important',
12
+ },
13
+ '.MuiIconButton-root': {
14
+ width: 32,
15
+ height: 32,
16
+ p: 0,
17
+ border: 1,
18
+ borderColor: 'divider',
19
+ },
20
+ '.MuiIconButton-root svg, .MuiButton-root svg': {
21
+ fontSize: 18,
22
+ width: '1em!important',
23
+ height: '1em!important',
24
+ },
25
+ '.arc-session-user-logged-in > *, .arc-session-user-logged-in svg': {
26
+ width: '100%!important',
27
+ height: '100%!important',
28
+ },
29
+ '.arc-session-user-unlogin svg': {
30
+ transform: 'scale(1)!important',
31
+ },
32
+ }}
33
+ {...rest}>
34
+ {children}
35
+ </Box>
36
+ );
37
+ }
@@ -2,6 +2,7 @@ import { Box, type BoxProps, Container, type Breakpoint } from '@mui/material';
2
2
  import { useRef, useState, useEffect } from 'react';
3
3
  import AutoHidden from './auto-hidden';
4
4
  import { styled } from '../Theme';
5
+ import HeaderAddons from './header-addons';
5
6
 
6
7
  export interface HeaderProps extends Omit<BoxProps, 'maxWidth'> {
7
8
  /** logo img/svg, 可以包裹一个 a 标签 */
@@ -89,37 +90,7 @@ function Header({
89
90
  {align === 'right' && <Box display="inline-block" flexGrow={1} />}
90
91
  {children}
91
92
  {align === 'left' && <Box display="inline-block" flexGrow={1} />}
92
- <Box
93
- className="header-addons"
94
- sx={{
95
- display: 'flex',
96
- alignItems: 'center',
97
- gap: 1.5,
98
- '> *': {
99
- m: '0px!important',
100
- },
101
- '.MuiIconButton-root': {
102
- width: 32,
103
- height: 32,
104
- p: 0,
105
- border: 1,
106
- borderColor: 'divider',
107
- },
108
- '.MuiIconButton-root svg, .MuiButton-root svg': {
109
- fontSize: 18,
110
- width: '1em!important',
111
- height: '1em!important',
112
- },
113
- '.arc-session-user-logged-in > *, .arc-session-user-logged-in svg': {
114
- width: '100%!important',
115
- height: '100%!important',
116
- },
117
- '.arc-session-user-unlogin svg': {
118
- transform: 'scale(1)!important',
119
- },
120
- }}>
121
- {addons}
122
- </Box>
93
+ <HeaderAddons className="header-addons">{addons}</HeaderAddons>
123
94
  </Container>
124
95
  </Root>
125
96
  );
@@ -1,2 +1,3 @@
1
1
  export { default as Header } from './header';
2
2
  export { default as ResponsiveHeader } from './responsive-header';
3
+ export { default as HeaderAddons } from './header-addons';