glints-aries 4.0.235 → 4.0.237
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/es/@next/Alert/AlertProvider.js +5 -5
- package/es/@next/EmptyState/EmptyState.d.ts +1 -1
- package/es/@next/EmptyState/EmptyState.stories.d.ts +1 -0
- package/lib/@next/Alert/AlertProvider.js +4 -4
- package/lib/@next/EmptyState/EmptyState.d.ts +1 -1
- package/lib/@next/EmptyState/EmptyState.stories.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useState } from 'react';
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
3
3
|
import { AlertContext } from './AlertContext';
|
|
4
4
|
export var AlertProvider = function AlertProvider(_ref) {
|
|
5
5
|
var children = _ref.children;
|
|
@@ -8,16 +8,16 @@ export var AlertProvider = function AlertProvider(_ref) {
|
|
|
8
8
|
}),
|
|
9
9
|
state = _useState[0],
|
|
10
10
|
setState = _useState[1];
|
|
11
|
-
var open = function
|
|
11
|
+
var open = useCallback(function (props) {
|
|
12
12
|
return setState(_extends({}, props, {
|
|
13
13
|
show: true
|
|
14
14
|
}));
|
|
15
|
-
};
|
|
16
|
-
var close = function
|
|
15
|
+
}, [setState]);
|
|
16
|
+
var close = useCallback(function () {
|
|
17
17
|
return setState({
|
|
18
18
|
show: false
|
|
19
19
|
});
|
|
20
|
-
};
|
|
20
|
+
}, [setState]);
|
|
21
21
|
var alertContextValue = _extends({}, state, {
|
|
22
22
|
open: open,
|
|
23
23
|
close: close
|
|
@@ -8,7 +8,7 @@ export declare type ButtonAction = {
|
|
|
8
8
|
export interface EmptyStateProps {
|
|
9
9
|
basicButtonAction?: ButtonAction;
|
|
10
10
|
primaryButtonAction?: ButtonAction;
|
|
11
|
-
description?:
|
|
11
|
+
description?: React.ReactNode;
|
|
12
12
|
fullWidth?: boolean;
|
|
13
13
|
helpText?: string;
|
|
14
14
|
imageName?: ImageName;
|
|
@@ -15,16 +15,16 @@ var AlertProvider = function AlertProvider(_ref) {
|
|
|
15
15
|
}),
|
|
16
16
|
state = _useState[0],
|
|
17
17
|
setState = _useState[1];
|
|
18
|
-
var open = function
|
|
18
|
+
var open = (0, _react.useCallback)(function (props) {
|
|
19
19
|
return setState((0, _extends2["default"])({}, props, {
|
|
20
20
|
show: true
|
|
21
21
|
}));
|
|
22
|
-
};
|
|
23
|
-
var close = function
|
|
22
|
+
}, [setState]);
|
|
23
|
+
var close = (0, _react.useCallback)(function () {
|
|
24
24
|
return setState({
|
|
25
25
|
show: false
|
|
26
26
|
});
|
|
27
|
-
};
|
|
27
|
+
}, [setState]);
|
|
28
28
|
var alertContextValue = (0, _extends2["default"])({}, state, {
|
|
29
29
|
open: open,
|
|
30
30
|
close: close
|
|
@@ -8,7 +8,7 @@ export declare type ButtonAction = {
|
|
|
8
8
|
export interface EmptyStateProps {
|
|
9
9
|
basicButtonAction?: ButtonAction;
|
|
10
10
|
primaryButtonAction?: ButtonAction;
|
|
11
|
-
description?:
|
|
11
|
+
description?: React.ReactNode;
|
|
12
12
|
fullWidth?: boolean;
|
|
13
13
|
helpText?: string;
|
|
14
14
|
imageName?: ImageName;
|