@arcblock/ux 2.5.42 → 2.5.44

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.
@@ -53,9 +53,32 @@ const extendedColors = {
53
53
  }
54
54
  }
55
55
  };
56
+ /**
57
+ * @typedef {{
58
+ * rounded?: boolean,
59
+ * loading?: boolean,
60
+ * forwardedRef: import('react').ForwardedRef<any>,
61
+ * color?: 'default' | 'inherit' | 'primary' | 'secondary' | 'danger' | 'warning' | 'reverse' | 'did'
62
+ * } & import('@mui/material').ButtonProps} ButtonProps
63
+ */
64
+
65
+ /**
66
+ * @description
67
+ * @export
68
+ * @param {import('@mui/material').ExtendButtonBase<import('@mui/material').ButtonTypeMap<{}, "button">>} BaseComponent
69
+ * @return {React.ForwardRefExoticComponent<React.PropsWithoutRef<ButtonProps> & React.RefAttributes<HTMLButtonElement>>}
70
+ */
56
71
 
57
72
  function _default(BaseComponent) {
73
+ /**
74
+ *
75
+ * @param {ButtonProps} props
76
+ * @returns
77
+ */
58
78
  function WrappedComponent(props) {
79
+ /**
80
+ * @type {ButtonProps}
81
+ */
59
82
  const newProps = (0, _Util.mergeProps)(props, WrappedComponent, ['style']);
60
83
 
61
84
  const {
@@ -88,6 +111,10 @@ function _default(BaseComponent) {
88
111
 
89
112
 
90
113
  const matched = extendedColors[color] && extendedColors[color][rest.variant];
114
+ /**
115
+ * @type {import('react').CSSProperties}
116
+ */
117
+
91
118
  const styles = Object.assign({}, style, _objectSpread({
92
119
  boxShadow: 'none',
93
120
  textTransform: 'capitalize'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.5.42",
3
+ "version": "2.5.44",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -45,11 +45,11 @@
45
45
  "peerDependencies": {
46
46
  "react": ">=18.1.0"
47
47
  },
48
- "gitHead": "2644a25c631bdd648701fa3aa365a35edebfac34",
48
+ "gitHead": "42d3d6971f3ba3bf78e1385677e830edbbd869fb",
49
49
  "dependencies": {
50
50
  "@arcblock/did-motif": "^1.1.10",
51
- "@arcblock/icons": "^2.5.42",
52
- "@arcblock/react-hooks": "^2.5.42",
51
+ "@arcblock/icons": "^2.5.44",
52
+ "@arcblock/react-hooks": "^2.5.44",
53
53
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
54
54
  "@emotion/react": "^11.10.4",
55
55
  "@emotion/styled": "^11.10.4",
@@ -18,8 +18,31 @@ const extendedColors = {
18
18
  },
19
19
  };
20
20
 
21
+ /**
22
+ * @typedef {{
23
+ * rounded?: boolean,
24
+ * loading?: boolean,
25
+ * forwardedRef: import('react').ForwardedRef<any>,
26
+ * color?: 'default' | 'inherit' | 'primary' | 'secondary' | 'danger' | 'warning' | 'reverse' | 'did'
27
+ * } & import('@mui/material').ButtonProps} ButtonProps
28
+ */
29
+
30
+ /**
31
+ * @description
32
+ * @export
33
+ * @param {import('@mui/material').ExtendButtonBase<import('@mui/material').ButtonTypeMap<{}, "button">>} BaseComponent
34
+ * @return {React.ForwardRefExoticComponent<React.PropsWithoutRef<ButtonProps> & React.RefAttributes<HTMLButtonElement>>}
35
+ */
21
36
  export default function (BaseComponent) {
37
+ /**
38
+ *
39
+ * @param {ButtonProps} props
40
+ * @returns
41
+ */
22
42
  function WrappedComponent(props) {
43
+ /**
44
+ * @type {ButtonProps}
45
+ */
23
46
  const newProps = mergeProps(props, WrappedComponent, ['style']);
24
47
  const { children, rounded, loading, disabled, style, forwardedRef, color, ...rest } = newProps;
25
48
 
@@ -40,6 +63,10 @@ export default function (BaseComponent) {
40
63
  // 这里扩展 danger/warning/reverse/did 四种 color
41
64
  // !! 已升级到 mui v5, error/warning 等 color 已经默认支持, extendedColors 只扩展了 did/reverse
42
65
  const matched = extendedColors[color] && extendedColors[color][rest.variant];
66
+
67
+ /**
68
+ * @type {import('react').CSSProperties}
69
+ */
43
70
  const styles = Object.assign({}, style, {
44
71
  boxShadow: 'none',
45
72
  textTransform: 'capitalize',