@arcblock/ux 2.5.50 → 2.5.52

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.
@@ -11,6 +11,9 @@ var _wrap = _interopRequireDefault(require("./wrap"));
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- var _default = (0, _wrap.default)(_Button.default);
14
+ // @ts-check
15
15
 
16
+ /** @type {import('./wrap').ButtonComponent} */
17
+ const ButtonComponent = (0, _wrap.default)(_Button.default);
18
+ var _default = ButtonComponent;
16
19
  exports.default = _default;
@@ -62,11 +62,15 @@ const extendedColors = {
62
62
  * } & import('@mui/material').ButtonProps} ButtonProps
63
63
  */
64
64
 
65
+ /**
66
+ * @typedef {React.ForwardRefExoticComponent<React.PropsWithoutRef<ButtonProps> & React.RefAttributes<HTMLButtonElement>>} ButtonComponent
67
+ */
68
+
65
69
  /**
66
70
  * @description
67
71
  * @export
68
72
  * @param {import('@mui/material').ExtendButtonBase<import('@mui/material').ButtonTypeMap<{}, "button">>} BaseComponent
69
- * @return {React.ForwardRefExoticComponent<React.PropsWithoutRef<ButtonProps> & React.RefAttributes<HTMLButtonElement>>}
73
+ * @return {ButtonComponent}
70
74
  */
71
75
 
72
76
  function _default(BaseComponent) {
@@ -72,7 +72,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
72
72
  /**
73
73
  * @description
74
74
  * @param {DialogProps} props
75
- * @return {React.ReactComponentElement}
75
+ * @return {React.ReactComponentElement<any, DialogProps>}
76
76
  */
77
77
  function Dialog(_ref) {
78
78
  let {
@@ -52,7 +52,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
52
52
  * @typedef {{
53
53
  * size?: 'small' | 'medium' | 'large';
54
54
  * color?: 'primary' | 'secondary' | 'inherit';
55
- * menu?: Array<import('@mui/material').MenuItem> | import('@mui/material').MenuItem>;
55
+ * menu?: Array<import('@mui/material').MenuItem> | import('@mui/material').MenuItem;
56
56
  * children?: JSX.Element | (() => JSX.Element);
57
57
  * variant?: 'outlined' | 'contained';
58
58
  * onClick?: () => void;
@@ -61,12 +61,13 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
61
61
  */
62
62
 
63
63
  /**
64
- * SplitButton allows the user to execute a default action which is bound to a Button or to choose a predefined action from a drop-down list.
64
+ * @description SplitButton allows the user to execute a default action which is bound to a Button or to choose a predefined action from a drop-down list.
65
+ * @export
65
66
  * @param {SplitButtonProps} props
66
- * @returns {JSX.Element}
67
+ * @return {JSX.Element}
67
68
  */
68
- function SplitButton(_ref) {
69
- let {
69
+ function SplitButton(props) {
70
+ const {
70
71
  size,
71
72
  color,
72
73
  menu,
@@ -74,8 +75,8 @@ function SplitButton(_ref) {
74
75
  variant,
75
76
  onClick,
76
77
  menuButtonProps
77
- } = _ref,
78
- rest = _objectWithoutProperties(_ref, _excluded);
78
+ } = props,
79
+ rest = _objectWithoutProperties(props, _excluded);
79
80
 
80
81
  const [open, setOpen] = (0, _react.useState)(false);
81
82
  const anchorRef = (0, _react.useRef)(null);
@@ -24,6 +24,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
24
24
 
25
25
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
26
26
 
27
+ /**
28
+ *
29
+ * @typedef {(message: import('notistack').SnackbarMessage, options?: import('notistack').OptionsObject, ...args: any[]) => import('notistack').SnackbarKey} EnqueueSnackbarFunc
30
+ *
31
+ */
32
+
27
33
  /**
28
34
  * @type {import('notistack').ProviderContext['enqueueSnackbar']}
29
35
  */
@@ -95,10 +101,7 @@ function Toast() {
95
101
 
96
102
  var _default = {
97
103
  /**
98
- *
99
- * @param {import('notistack').SnackbarMessage} message
100
- * @param {import('notistack').OptionsObject} options
101
- * @returns {import('notistack').SnackbarKey}
104
+ * @type {EnqueueSnackbarFunc}
102
105
  */
103
106
  success: function success(message) {
104
107
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -111,10 +114,7 @@ var _default = {
111
114
  },
112
115
 
113
116
  /**
114
- *
115
- * @param {import('notistack').SnackbarMessage} message
116
- * @param {import('notistack').OptionsObject} options
117
- * @returns {import('notistack').SnackbarKey}
117
+ * @type {EnqueueSnackbarFunc}
118
118
  */
119
119
  error: function error(message) {
120
120
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -127,10 +127,7 @@ var _default = {
127
127
  },
128
128
 
129
129
  /**
130
- *
131
- * @param {import('notistack').SnackbarMessage} message
132
- * @param {import('notistack').OptionsObject} options
133
- * @returns {import('notistack').SnackbarKey}
130
+ * @type {EnqueueSnackbarFunc}
134
131
  */
135
132
  warning: function warning(message) {
136
133
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -143,10 +140,7 @@ var _default = {
143
140
  },
144
141
 
145
142
  /**
146
- *
147
- * @param {import('notistack').SnackbarMessage} message
148
- * @param {import('notistack').OptionsObject} options
149
- * @returns {import('notistack').SnackbarKey}
143
+ * @type {EnqueueSnackbarFunc}
150
144
  */
151
145
  info: function info(message) {
152
146
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.5.50",
3
+ "version": "2.5.52",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -47,11 +47,11 @@
47
47
  "peerDependencies": {
48
48
  "react": ">=18.1.0"
49
49
  },
50
- "gitHead": "8969051be94b3e5107e3f25034661a60fd3da6bb",
50
+ "gitHead": "6ce02db5c5b7fdf26509dd37161ccb35f3a22ff2",
51
51
  "dependencies": {
52
52
  "@arcblock/did-motif": "^1.1.10",
53
- "@arcblock/icons": "^2.5.50",
54
- "@arcblock/react-hooks": "^2.5.50",
53
+ "@arcblock/icons": "^2.5.52",
54
+ "@arcblock/react-hooks": "^2.5.52",
55
55
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
56
56
  "@emotion/react": "^11.10.4",
57
57
  "@emotion/styled": "^11.10.4",
@@ -1,4 +1,9 @@
1
+ // @ts-check
2
+
1
3
  import Button from '@mui/material/Button';
2
4
  import wrap from './wrap';
3
5
 
4
- export default wrap(Button);
6
+ /** @type {import('./wrap').ButtonComponent} */
7
+ const ButtonComponent = wrap(Button);
8
+
9
+ export default ButtonComponent;
@@ -27,11 +27,15 @@ const extendedColors = {
27
27
  * } & import('@mui/material').ButtonProps} ButtonProps
28
28
  */
29
29
 
30
+ /**
31
+ * @typedef {React.ForwardRefExoticComponent<React.PropsWithoutRef<ButtonProps> & React.RefAttributes<HTMLButtonElement>>} ButtonComponent
32
+ */
33
+
30
34
  /**
31
35
  * @description
32
36
  * @export
33
37
  * @param {import('@mui/material').ExtendButtonBase<import('@mui/material').ButtonTypeMap<{}, "button">>} BaseComponent
34
- * @return {React.ForwardRefExoticComponent<React.PropsWithoutRef<ButtonProps> & React.RefAttributes<HTMLButtonElement>>}
38
+ * @return {ButtonComponent}
35
39
  */
36
40
  export default function (BaseComponent) {
37
41
  /**
@@ -38,7 +38,7 @@ import { styled, useTheme } from '../Theme';
38
38
  /**
39
39
  * @description
40
40
  * @param {DialogProps} props
41
- * @return {React.ReactComponentElement}
41
+ * @return {React.ReactComponentElement<any, DialogProps>}
42
42
  */
43
43
  function Dialog({ children, title, prepend, toolbar, actions, showCloseButton, actionsPosition, PaperProps, ...rest }) {
44
44
  const theme = useTheme();
@@ -16,7 +16,7 @@ import { styled } from '../Theme';
16
16
  * @typedef {{
17
17
  * size?: 'small' | 'medium' | 'large';
18
18
  * color?: 'primary' | 'secondary' | 'inherit';
19
- * menu?: Array<import('@mui/material').MenuItem> | import('@mui/material').MenuItem>;
19
+ * menu?: Array<import('@mui/material').MenuItem> | import('@mui/material').MenuItem;
20
20
  * children?: JSX.Element | (() => JSX.Element);
21
21
  * variant?: 'outlined' | 'contained';
22
22
  * onClick?: () => void;
@@ -25,11 +25,14 @@ import { styled } from '../Theme';
25
25
  */
26
26
 
27
27
  /**
28
- * SplitButton allows the user to execute a default action which is bound to a Button or to choose a predefined action from a drop-down list.
28
+ * @description SplitButton allows the user to execute a default action which is bound to a Button or to choose a predefined action from a drop-down list.
29
+ * @export
29
30
  * @param {SplitButtonProps} props
30
- * @returns {JSX.Element}
31
+ * @return {JSX.Element}
31
32
  */
32
- export default function SplitButton({ size, color, menu, children, variant, onClick, menuButtonProps, ...rest }) {
33
+ export default function SplitButton(props) {
34
+ const { size, color, menu, children, variant, onClick, menuButtonProps, ...rest } = props;
35
+
33
36
  const [open, setOpen] = useState(false);
34
37
  const anchorRef = useRef(null);
35
38
  const menuItems = Array.isArray(menu)
@@ -3,6 +3,12 @@ import { SnackbarProvider, useSnackbar } from 'notistack';
3
3
  import IconButton from '@mui/material/IconButton';
4
4
  import CloseIcon from '@mui/icons-material/Close';
5
5
 
6
+ /**
7
+ *
8
+ * @typedef {(message: import('notistack').SnackbarMessage, options?: import('notistack').OptionsObject, ...args: any[]) => import('notistack').SnackbarKey} EnqueueSnackbarFunc
9
+ *
10
+ */
11
+
6
12
  /**
7
13
  * @type {import('notistack').ProviderContext['enqueueSnackbar']}
8
14
  */
@@ -70,34 +76,22 @@ export { ToastProvider };
70
76
 
71
77
  export default {
72
78
  /**
73
- *
74
- * @param {import('notistack').SnackbarMessage} message
75
- * @param {import('notistack').OptionsObject} options
76
- * @returns {import('notistack').SnackbarKey}
79
+ * @type {EnqueueSnackbarFunc}
77
80
  */
78
81
  success: (message, options = {}, ...args) => success(message, options, ...args),
79
82
 
80
83
  /**
81
- *
82
- * @param {import('notistack').SnackbarMessage} message
83
- * @param {import('notistack').OptionsObject} options
84
- * @returns {import('notistack').SnackbarKey}
84
+ * @type {EnqueueSnackbarFunc}
85
85
  */
86
86
  error: (message, options = {}, ...args) => error(message, options, ...args),
87
87
 
88
88
  /**
89
- *
90
- * @param {import('notistack').SnackbarMessage} message
91
- * @param {import('notistack').OptionsObject} options
92
- * @returns {import('notistack').SnackbarKey}
89
+ * @type {EnqueueSnackbarFunc}
93
90
  */
94
91
  warning: (message, options = {}, ...args) => warning(message, options, ...args),
95
92
 
96
93
  /**
97
- *
98
- * @param {import('notistack').SnackbarMessage} message
99
- * @param {import('notistack').OptionsObject} options
100
- * @returns {import('notistack').SnackbarKey}
94
+ * @type {EnqueueSnackbarFunc}
101
95
  */
102
96
  info: (message, options = {}, ...args) => info(message, options, ...args),
103
97
  };