@arcblock/ux 2.11.10 → 2.11.11

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.
@@ -5,9 +5,9 @@ export interface IBlockletStore extends CardProps {
5
5
  title: string;
6
6
  description?: string;
7
7
  cover?: string;
8
- avatar: string;
9
- author: string;
10
- download: string;
8
+ avatar?: string;
9
+ author?: string;
10
+ download?: string;
11
11
  official?: {
12
12
  tooltip: React.ReactNode;
13
13
  size?: number;
@@ -15,16 +15,16 @@ export interface IBlockletStore extends CardProps {
15
15
  };
16
16
  button?: React.ReactNode;
17
17
  buttonText?: string;
18
- buttonDisabled?: false | true;
19
- buttonLoading?: false | true;
18
+ buttonDisabled?: boolean;
19
+ buttonLoading?: boolean;
20
20
  onButtonClick?: Function;
21
21
  onMainClick?: Function;
22
22
  className?: string;
23
23
  status?: {
24
24
  key: string;
25
25
  icon: React.ReactNode;
26
- text: string;
27
- title?: string;
26
+ text: React.ReactNode;
27
+ title?: React.ReactNode;
28
28
  maxWidth?: number;
29
29
  color?: string;
30
30
  align?: 'left' | 'right';
@@ -32,7 +32,7 @@ export interface IBlockletStore extends CardProps {
32
32
  icons?: {
33
33
  key: string;
34
34
  icon: string | React.ReactElement;
35
- title: string;
35
+ title: React.ReactNode;
36
36
  color?: string;
37
37
  }[];
38
38
  }
@@ -8,7 +8,7 @@ import Avatar from '../Avatar';
8
8
  import Button from '../Button';
9
9
  import { useTheme } from '../Theme';
10
10
  import IconText from './components/icon-text';
11
- import TooltipIcon from './tooltip-icon';
11
+ import TooltipIcon from './components/tooltip-icon';
12
12
  import { formatDownloadCount, strippedString } from './utils';
13
13
  export default function BlockletStore(props) {
14
14
  const {
@@ -104,6 +104,7 @@ export default function BlockletStore(props) {
104
104
  textOverflow: 'ellipsis',
105
105
  whiteSpace: 'nowrap',
106
106
  overflow: 'hidden',
107
+ cursor: 'default',
107
108
  pl: 0.5,
108
109
  '&&': {
109
110
  flexShrink: 1
@@ -133,7 +134,7 @@ export default function BlockletStore(props) {
133
134
  }
134
135
  }) : item.icon
135
136
  }, item.key))]
136
- }), button || onButtonClick && /*#__PURE__*/_jsxs(Button, {
137
+ }), onButtonClick && /*#__PURE__*/_jsxs(Button, {
137
138
  color: "reverse",
138
139
  variant: "outlined",
139
140
  size: "small",
@@ -152,7 +153,7 @@ export default function BlockletStore(props) {
152
153
  color: 'inherit'
153
154
  }
154
155
  }), buttonText]
155
- })]
156
+ }), button]
156
157
  }), /*#__PURE__*/_jsx(Stack, {
157
158
  py: 2,
158
159
  children: /*#__PURE__*/_jsx(Typography, {
@@ -165,6 +166,7 @@ export default function BlockletStore(props) {
165
166
  WebkitLineClamp: 2,
166
167
  WebkitBoxOrient: 'vertical',
167
168
  overflow: 'hidden',
169
+ cursor: 'default',
168
170
  height: 40
169
171
  },
170
172
  ...descriptionProps
@@ -4,6 +4,6 @@ export default function IconText({ icon, children, maxWidth, title, sx, }: {
4
4
  icon?: React.ReactNode;
5
5
  children?: React.ReactNode;
6
6
  maxWidth?: number;
7
- title?: string;
7
+ title?: React.ReactNode;
8
8
  sx?: StackProps['sx'];
9
9
  }): false | "" | 0 | import("react/jsx-runtime").JSX.Element | null | undefined;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Stack, Typography } from '@mui/material';
3
3
  import React from 'react';
4
+ import TooltipIcon from './tooltip-icon';
4
5
  export default function IconText({
5
6
  icon,
6
7
  children,
@@ -16,16 +17,19 @@ export default function IconText({
16
17
  maxWidth,
17
18
  overflow: 'hidden'
18
19
  }, ...(Array.isArray(sx) ? sx : [sx])],
19
- children: [icon, /*#__PURE__*/_jsx(Typography, {
20
- flex: 1,
21
- variant: "body2",
22
- sx: {
23
- overflow: 'hidden',
24
- textOverflow: 'ellipsis',
25
- whiteSpace: 'nowrap'
26
- },
27
- title: title || (typeof children === 'string' ? children : undefined),
28
- children: children
20
+ children: [icon, /*#__PURE__*/_jsx(TooltipIcon, {
21
+ title: title || (typeof children === 'string' ? children : ''),
22
+ children: /*#__PURE__*/_jsx(Typography, {
23
+ flex: 1,
24
+ variant: "body2",
25
+ sx: {
26
+ overflow: 'hidden',
27
+ textOverflow: 'ellipsis',
28
+ whiteSpace: 'nowrap',
29
+ cursor: 'default'
30
+ },
31
+ children: children
32
+ })
29
33
  })]
30
34
  });
31
35
  }
@@ -4,4 +4,4 @@ export interface TooltipIconProps extends TooltipProps {
4
4
  fontWeight?: number | string;
5
5
  color?: string;
6
6
  }
7
- export default function TooltipIcon({ title, sx, children, PopperProps, fontSize, fontWeight, color, ...props }: TooltipIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default function TooltipIcon({ title, sx, children, slotProps, fontSize, fontWeight, color, ...props }: TooltipIconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Tooltip, tooltipClasses } from '@mui/material';
3
+ export default function TooltipIcon({
4
+ title,
5
+ sx,
6
+ children,
7
+ slotProps,
8
+ fontSize = 12,
9
+ fontWeight = 500,
10
+ color = 'text.secondary',
11
+ ...props
12
+ }) {
13
+ return title ? /*#__PURE__*/_jsx(Tooltip, {
14
+ title: title,
15
+ placement: "top",
16
+ ...props,
17
+ slotProps: {
18
+ popper: {
19
+ ...slotProps?.popper,
20
+ sx: [{
21
+ [`& .${tooltipClasses.tooltip}`]: {
22
+ backgroundColor: 'common.white',
23
+ fontSize,
24
+ fontWeight,
25
+ boxShadow: '0px 4px 8px 0px #03071214, 0px 0px 0px 1px #03071214',
26
+ marginBottom: '6px !important',
27
+ borderRadius: '8px',
28
+ cursor: 'default',
29
+ color,
30
+ display: 'flex',
31
+ alignItems: 'center'
32
+ }
33
+ }, ...(Array.isArray(slotProps?.popper?.sx) ? slotProps.popper.sx : [slotProps?.popper?.sx])]
34
+ }
35
+ },
36
+ children: children
37
+ }) : children;
38
+ }
@@ -1,5 +1,5 @@
1
1
  import ActionButton, { strippedString } from './utils';
2
2
  import Blocklet from './blocklet';
3
- import TooltipIcon from './tooltip-icon';
3
+ import TooltipIcon from './components/tooltip-icon';
4
4
  export { ActionButton, strippedString, TooltipIcon };
5
5
  export default Blocklet;
@@ -1,5 +1,5 @@
1
1
  import ActionButton, { strippedString } from './utils';
2
2
  import Blocklet from './blocklet';
3
- import TooltipIcon from './tooltip-icon';
3
+ import TooltipIcon from './components/tooltip-icon';
4
4
  export { ActionButton, strippedString, TooltipIcon };
5
5
  export default Blocklet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.11.10",
3
+ "version": "2.11.11",
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": "3c56d08b46485ae49fdfd32fc8c92df9c8ddf25e",
71
+ "gitHead": "fc251e65f592a96d6fe876dda5d6158f7fbd2613",
72
72
  "dependencies": {
73
73
  "@arcblock/did-motif": "^1.1.13",
74
- "@arcblock/icons": "^2.11.10",
75
- "@arcblock/nft-display": "^2.11.10",
76
- "@arcblock/react-hooks": "^2.11.10",
74
+ "@arcblock/icons": "^2.11.11",
75
+ "@arcblock/nft-display": "^2.11.11",
76
+ "@arcblock/react-hooks": "^2.11.11",
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",
@@ -8,7 +8,7 @@ import Avatar from '../Avatar';
8
8
  import Button from '../Button';
9
9
  import { useTheme } from '../Theme';
10
10
  import IconText from './components/icon-text';
11
- import TooltipIcon from './tooltip-icon';
11
+ import TooltipIcon from './components/tooltip-icon';
12
12
  import { formatDownloadCount, strippedString } from './utils';
13
13
 
14
14
  export interface IBlockletStore extends CardProps {
@@ -16,9 +16,9 @@ export interface IBlockletStore extends CardProps {
16
16
  title: string;
17
17
  description?: string;
18
18
  cover?: string;
19
- avatar: string;
20
- author: string;
21
- download: string;
19
+ avatar?: string;
20
+ author?: string;
21
+ download?: string;
22
22
  official?: {
23
23
  tooltip: React.ReactNode;
24
24
  size?: number;
@@ -26,16 +26,16 @@ export interface IBlockletStore extends CardProps {
26
26
  };
27
27
  button?: React.ReactNode;
28
28
  buttonText?: string;
29
- buttonDisabled?: false | true;
30
- buttonLoading?: false | true;
29
+ buttonDisabled?: boolean;
30
+ buttonLoading?: boolean;
31
31
  onButtonClick?: Function;
32
32
  onMainClick?: Function;
33
33
  className?: string;
34
34
  status?: {
35
35
  key: string;
36
36
  icon: React.ReactNode;
37
- text: string;
38
- title?: string;
37
+ text: React.ReactNode;
38
+ title?: React.ReactNode;
39
39
  maxWidth?: number;
40
40
  color?: string;
41
41
  align?: 'left' | 'right';
@@ -43,7 +43,7 @@ export interface IBlockletStore extends CardProps {
43
43
  icons?: {
44
44
  key: string;
45
45
  icon: string | React.ReactElement;
46
- title: string;
46
+ title: React.ReactNode;
47
47
  color?: string;
48
48
  }[];
49
49
  }
@@ -116,6 +116,7 @@ export default function BlockletStore(props: IBlockletStore) {
116
116
  textOverflow: 'ellipsis',
117
117
  whiteSpace: 'nowrap',
118
118
  overflow: 'hidden',
119
+ cursor: 'default',
119
120
  pl: 0.5,
120
121
  '&&': { flexShrink: 1 },
121
122
  }}
@@ -133,24 +134,24 @@ export default function BlockletStore(props: IBlockletStore) {
133
134
  </TooltipIcon>
134
135
  ))}
135
136
  </Box>
136
- {button ||
137
- (onButtonClick && (
138
- <Button
139
- color="reverse"
140
- variant="outlined"
141
- size="small"
142
- disabled={buttonDisabled || buttonLoading}
143
- style={{
144
- borderColor: theme.palette.grey[300],
145
- borderRadius: 8,
146
- fontSize: 13,
147
- fontWeight: theme.typography.fontWeightMedium,
148
- }}
149
- onClick={handleButtonClick}>
150
- {buttonLoading && <CircularProgress size={15} style={{ marginRight: 3, color: 'inherit' }} />}
151
- {buttonText}
152
- </Button>
153
- ))}
137
+ {onButtonClick && (
138
+ <Button
139
+ color="reverse"
140
+ variant="outlined"
141
+ size="small"
142
+ disabled={buttonDisabled || buttonLoading}
143
+ style={{
144
+ borderColor: theme.palette.grey[300],
145
+ borderRadius: 8,
146
+ fontSize: 13,
147
+ fontWeight: theme.typography.fontWeightMedium,
148
+ }}
149
+ onClick={handleButtonClick}>
150
+ {buttonLoading && <CircularProgress size={15} style={{ marginRight: 3, color: 'inherit' }} />}
151
+ {buttonText}
152
+ </Button>
153
+ )}
154
+ {button}
154
155
  </Stack>
155
156
  <Stack py={2}>
156
157
  <Typography
@@ -163,6 +164,7 @@ export default function BlockletStore(props: IBlockletStore) {
163
164
  WebkitLineClamp: 2,
164
165
  WebkitBoxOrient: 'vertical',
165
166
  overflow: 'hidden',
167
+ cursor: 'default',
166
168
  height: 40,
167
169
  }}
168
170
  {...descriptionProps}
@@ -1,5 +1,6 @@
1
1
  import { Stack, StackProps, Typography } from '@mui/material';
2
2
  import React from 'react';
3
+ import TooltipIcon from './tooltip-icon';
3
4
 
4
5
  export default function IconText({
5
6
  icon,
@@ -11,7 +12,7 @@ export default function IconText({
11
12
  icon?: React.ReactNode;
12
13
  children?: React.ReactNode;
13
14
  maxWidth?: number;
14
- title?: string;
15
+ title?: React.ReactNode;
15
16
  sx?: StackProps['sx'];
16
17
  }) {
17
18
  return (
@@ -22,13 +23,14 @@ export default function IconText({
22
23
  gap={0.5}
23
24
  sx={[{ maxWidth, overflow: 'hidden' }, ...(Array.isArray(sx) ? sx : [sx])]}>
24
25
  {icon}
25
- <Typography
26
- flex={1}
27
- variant="body2"
28
- sx={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}
29
- title={title || (typeof children === 'string' ? children : undefined)}>
30
- {children}
31
- </Typography>
26
+ <TooltipIcon title={title || (typeof children === 'string' ? children : '')}>
27
+ <Typography
28
+ flex={1}
29
+ variant="body2"
30
+ sx={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', cursor: 'default' }}>
31
+ {children}
32
+ </Typography>
33
+ </TooltipIcon>
32
34
  </Stack>
33
35
  )
34
36
  );
@@ -0,0 +1,51 @@
1
+ import { Tooltip, TooltipProps, tooltipClasses } from '@mui/material';
2
+
3
+ export interface TooltipIconProps extends TooltipProps {
4
+ fontSize?: number | string;
5
+ fontWeight?: number | string;
6
+ color?: string;
7
+ }
8
+
9
+ export default function TooltipIcon({
10
+ title,
11
+ sx,
12
+ children,
13
+ slotProps,
14
+ fontSize = 12,
15
+ fontWeight = 500,
16
+ color = 'text.secondary',
17
+ ...props
18
+ }: TooltipIconProps) {
19
+ return title ? (
20
+ <Tooltip
21
+ title={title}
22
+ placement="top"
23
+ {...props}
24
+ slotProps={{
25
+ popper: {
26
+ ...slotProps?.popper,
27
+ sx: [
28
+ {
29
+ [`& .${tooltipClasses.tooltip}`]: {
30
+ backgroundColor: 'common.white',
31
+ fontSize,
32
+ fontWeight,
33
+ boxShadow: '0px 4px 8px 0px #03071214, 0px 0px 0px 1px #03071214',
34
+ marginBottom: '6px !important',
35
+ borderRadius: '8px',
36
+ cursor: 'default',
37
+ color,
38
+ display: 'flex',
39
+ alignItems: 'center',
40
+ },
41
+ },
42
+ ...(Array.isArray(slotProps?.popper?.sx) ? slotProps.popper.sx : [slotProps?.popper?.sx]),
43
+ ],
44
+ },
45
+ }}>
46
+ {children}
47
+ </Tooltip>
48
+ ) : (
49
+ children
50
+ );
51
+ }
@@ -1,6 +1,6 @@
1
1
  import ActionButton, { strippedString } from './utils';
2
2
  import Blocklet from './blocklet';
3
- import TooltipIcon from './tooltip-icon';
3
+ import TooltipIcon from './components/tooltip-icon';
4
4
 
5
5
  export { ActionButton, strippedString, TooltipIcon };
6
6
  export default Blocklet;
@@ -1,33 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Tooltip, tooltipClasses } from '@mui/material';
3
- export default function TooltipIcon({
4
- title,
5
- sx,
6
- children,
7
- PopperProps,
8
- fontSize = 12,
9
- fontWeight = 500,
10
- color = 'text.secondary',
11
- ...props
12
- }) {
13
- return title ? /*#__PURE__*/_jsx(Tooltip, {
14
- title: title,
15
- placement: "top",
16
- ...props,
17
- PopperProps: {
18
- ...PopperProps,
19
- sx: [{
20
- [`& .${tooltipClasses.tooltip}`]: {
21
- backgroundColor: 'common.white',
22
- boxShadow: 1,
23
- fontSize,
24
- fontWeight,
25
- color,
26
- display: 'flex',
27
- alignItems: 'center'
28
- }
29
- }, ...(Array.isArray(PopperProps?.sx) ? PopperProps.sx : [PopperProps?.sx])]
30
- },
31
- children: children
32
- }) : children;
33
- }
@@ -1,46 +0,0 @@
1
- import { Tooltip, TooltipProps, tooltipClasses } from '@mui/material';
2
-
3
- export interface TooltipIconProps extends TooltipProps {
4
- fontSize?: number | string;
5
- fontWeight?: number | string;
6
- color?: string;
7
- }
8
-
9
- export default function TooltipIcon({
10
- title,
11
- sx,
12
- children,
13
- PopperProps,
14
- fontSize = 12,
15
- fontWeight = 500,
16
- color = 'text.secondary',
17
- ...props
18
- }: TooltipIconProps) {
19
- return title ? (
20
- <Tooltip
21
- title={title}
22
- placement="top"
23
- {...props}
24
- PopperProps={{
25
- ...PopperProps,
26
- sx: [
27
- {
28
- [`& .${tooltipClasses.tooltip}`]: {
29
- backgroundColor: 'common.white',
30
- boxShadow: 1,
31
- fontSize,
32
- fontWeight,
33
- color,
34
- display: 'flex',
35
- alignItems: 'center',
36
- },
37
- },
38
- ...(Array.isArray(PopperProps?.sx) ? PopperProps.sx : [PopperProps?.sx]),
39
- ],
40
- }}>
41
- {children}
42
- </Tooltip>
43
- ) : (
44
- children
45
- );
46
- }