@arcblock/ux 2.13.37 → 2.13.39
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/Metric/index.d.ts
CHANGED
@@ -6,5 +6,7 @@ export interface MetricProps {
|
|
6
6
|
animated?: false | true;
|
7
7
|
LinkComponent?: React.ElementType;
|
8
8
|
prefix?: string;
|
9
|
+
iconColor?: string;
|
10
|
+
iconStyle?: React.CSSProperties;
|
9
11
|
}
|
10
|
-
export default function Metric({ icon, value, name, url, animated, LinkComponent, prefix, }: MetricProps): import("react/jsx-runtime").JSX.Element;
|
12
|
+
export default function Metric({ icon, value, name, url, animated, LinkComponent, prefix, iconColor, iconStyle, }: MetricProps): import("react/jsx-runtime").JSX.Element;
|
package/lib/Metric/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
2
|
/* eslint-disable react/no-danger */
|
3
|
-
import { Link
|
3
|
+
import { Link } from '@mui/material';
|
4
4
|
import ImageIcon from '../Icon/image';
|
5
5
|
import { styled } from '../Theme';
|
6
6
|
export default function Metric({
|
@@ -10,11 +10,10 @@ export default function Metric({
|
|
10
10
|
url = '',
|
11
11
|
animated = false,
|
12
12
|
LinkComponent = Link,
|
13
|
-
prefix = '/images'
|
13
|
+
prefix = '/images',
|
14
|
+
iconColor = '#222222',
|
15
|
+
iconStyle = {}
|
14
16
|
}) {
|
15
|
-
const {
|
16
|
-
palette
|
17
|
-
} = useTheme();
|
18
17
|
const metric = /*#__PURE__*/_jsxs(_Fragment, {
|
19
18
|
children: [/*#__PURE__*/_jsx("div", {
|
20
19
|
className: "metric__image",
|
@@ -23,7 +22,8 @@ export default function Metric({
|
|
23
22
|
alt: typeof name === 'string' ? name : '',
|
24
23
|
size: 30,
|
25
24
|
prefix: prefix,
|
26
|
-
color:
|
25
|
+
color: iconColor,
|
26
|
+
style: iconStyle
|
27
27
|
})
|
28
28
|
}), /*#__PURE__*/_jsxs("div", {
|
29
29
|
children: [/*#__PURE__*/_jsx("div", {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arcblock/ux",
|
3
|
-
"version": "2.13.
|
3
|
+
"version": "2.13.39",
|
4
4
|
"description": "Common used react components for arcblock products",
|
5
5
|
"keywords": [
|
6
6
|
"react",
|
@@ -71,14 +71,14 @@
|
|
71
71
|
"react": ">=18.2.0",
|
72
72
|
"react-router-dom": ">=6.22.3"
|
73
73
|
},
|
74
|
-
"gitHead": "
|
74
|
+
"gitHead": "c50c5ab905df69e60880c0f127a4d3e9bfc70c1a",
|
75
75
|
"dependencies": {
|
76
76
|
"@arcblock/did-motif": "^1.1.13",
|
77
|
-
"@arcblock/icons": "^2.13.
|
78
|
-
"@arcblock/nft-display": "^2.13.
|
79
|
-
"@arcblock/react-hooks": "^2.13.
|
77
|
+
"@arcblock/icons": "^2.13.39",
|
78
|
+
"@arcblock/nft-display": "^2.13.39",
|
79
|
+
"@arcblock/react-hooks": "^2.13.39",
|
80
80
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
81
|
-
"@blocklet/theme": "^2.13.
|
81
|
+
"@blocklet/theme": "^2.13.39",
|
82
82
|
"@fontsource/roboto": "~5.1.1",
|
83
83
|
"@fontsource/ubuntu-mono": "^5.0.18",
|
84
84
|
"@iconify-icons/logos": "^1.2.36",
|
package/src/Metric/index.tsx
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* eslint-disable react/no-danger */
|
2
|
-
import { Link
|
2
|
+
import { Link } from '@mui/material';
|
3
3
|
|
4
4
|
import ImageIcon from '../Icon/image';
|
5
5
|
import { styled } from '../Theme';
|
@@ -12,6 +12,8 @@ export interface MetricProps {
|
|
12
12
|
animated?: false | true;
|
13
13
|
LinkComponent?: React.ElementType;
|
14
14
|
prefix?: string;
|
15
|
+
iconColor?: string;
|
16
|
+
iconStyle?: React.CSSProperties;
|
15
17
|
}
|
16
18
|
|
17
19
|
export default function Metric({
|
@@ -22,8 +24,9 @@ export default function Metric({
|
|
22
24
|
animated = false,
|
23
25
|
LinkComponent = Link,
|
24
26
|
prefix = '/images',
|
27
|
+
iconColor = '#222222',
|
28
|
+
iconStyle = {},
|
25
29
|
}: MetricProps) {
|
26
|
-
const { palette } = useTheme();
|
27
30
|
const metric = (
|
28
31
|
<>
|
29
32
|
<div className="metric__image">
|
@@ -32,7 +35,8 @@ export default function Metric({
|
|
32
35
|
alt={typeof name === 'string' ? name : ''}
|
33
36
|
size={30}
|
34
37
|
prefix={prefix}
|
35
|
-
color={
|
38
|
+
color={iconColor}
|
39
|
+
style={iconStyle}
|
36
40
|
/>
|
37
41
|
</div>
|
38
42
|
<div>
|
@@ -129,6 +129,10 @@ function BaseThemeProvider({
|
|
129
129
|
darkSchemeClass = '',
|
130
130
|
}: BaseThemeProviderProps) {
|
131
131
|
const _theme = useMemo(() => {
|
132
|
+
if (typeof theme === 'function') {
|
133
|
+
return theme;
|
134
|
+
}
|
135
|
+
|
132
136
|
if (isTheme(theme)) return theme;
|
133
137
|
|
134
138
|
// 是 ThemeOptions 则创建一个 theme
|