@carbon/ibm-products 2.57.0 → 2.57.1-rc.0
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/components/APIKeyModal/APIKeyModal.js +4 -5
- package/es/components/APIKeyModal/APIKeyModal.types.d.ts +0 -5
- package/es/components/ConditionBuilder/ConditionBuilder.js +14 -2
- package/es/components/ConditionBuilder/ConditionBuilder.types.d.ts +14 -5
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +12 -6
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +4 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +1 -1
- package/es/components/ConditionBuilder/utils/useDataConfigs.d.ts +3 -4
- package/es/components/ConditionBuilder/utils/useDataConfigs.js +14 -14
- package/es/components/CreateTearsheet/CreateTearsheet.d.ts +20 -6
- package/es/components/CreateTearsheet/CreateTearsheet.js +32 -11
- package/es/components/EmptyStates/EmptyState.d.ts +6 -1
- package/es/components/EmptyStates/EmptyState.js +12 -3
- package/es/components/EmptyStates/EmptyStateContent.d.ts +3 -1
- package/es/components/EmptyStates/EmptyStateContent.js +8 -2
- package/es/components/EmptyStates/EmptyStateIllustration.js +4 -2
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +5 -1
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +8 -1
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +5 -1
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +8 -1
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.d.ts +5 -1
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +8 -1
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +5 -1
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +8 -1
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.d.ts +5 -1
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +8 -1
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.d.ts +5 -1
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +8 -1
- package/es/components/EmptyStates/assets/ErrorIllustration.js +2 -1
- package/es/components/EmptyStates/assets/NoDataIllustration.js +2 -1
- package/es/components/EmptyStates/assets/NoTagsIllustration.js +2 -1
- package/es/components/EmptyStates/assets/NotFoundIllustration.js +2 -1
- package/es/components/EmptyStates/assets/NotificationsIllustration.js +2 -1
- package/es/components/EmptyStates/assets/UnauthorizedIllustration.js +2 -1
- package/es/components/FilterSummary/FilterSummary.js +1 -1
- package/es/components/Tearsheet/TearsheetShell.d.ts +11 -7
- package/es/components/Tearsheet/TearsheetShell.js +14 -14
- package/es/global/js/hooks/useFocus.js +21 -19
- package/lib/components/APIKeyModal/APIKeyModal.js +4 -5
- package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +0 -5
- package/lib/components/ConditionBuilder/ConditionBuilder.js +14 -2
- package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts +14 -5
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +12 -6
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +4 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +1 -1
- package/lib/components/ConditionBuilder/utils/useDataConfigs.d.ts +3 -4
- package/lib/components/ConditionBuilder/utils/useDataConfigs.js +14 -14
- package/lib/components/CreateTearsheet/CreateTearsheet.d.ts +20 -6
- package/lib/components/CreateTearsheet/CreateTearsheet.js +31 -10
- package/lib/components/EmptyStates/EmptyState.d.ts +6 -1
- package/lib/components/EmptyStates/EmptyState.js +12 -3
- package/lib/components/EmptyStates/EmptyStateContent.d.ts +3 -1
- package/lib/components/EmptyStates/EmptyStateContent.js +7 -1
- package/lib/components/EmptyStates/EmptyStateIllustration.js +3 -1
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +5 -1
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +8 -1
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +5 -1
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +8 -1
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.d.ts +5 -1
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +8 -1
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +5 -1
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +8 -1
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.d.ts +5 -1
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +8 -1
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.d.ts +5 -1
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +8 -1
- package/lib/components/EmptyStates/assets/ErrorIllustration.js +2 -1
- package/lib/components/EmptyStates/assets/NoDataIllustration.js +2 -1
- package/lib/components/EmptyStates/assets/NoTagsIllustration.js +2 -1
- package/lib/components/EmptyStates/assets/NotFoundIllustration.js +2 -1
- package/lib/components/EmptyStates/assets/NotificationsIllustration.js +2 -1
- package/lib/components/EmptyStates/assets/UnauthorizedIllustration.js +2 -1
- package/lib/components/FilterSummary/FilterSummary.js +1 -1
- package/lib/components/Tearsheet/TearsheetShell.d.ts +11 -7
- package/lib/components/Tearsheet/TearsheetShell.js +14 -14
- package/lib/global/js/hooks/useFocus.js +21 -19
- package/package.json +6 -6
- package/telemetry.yml +3 -0
@@ -16,7 +16,7 @@ import { EmptyStateContent } from '../EmptyStateContent.js';
|
|
16
16
|
import { ErrorIllustration } from '../assets/ErrorIllustration.js';
|
17
17
|
import { defaults } from '../EmptyState.js';
|
18
18
|
|
19
|
-
var _excluded = ["action", "className", "illustrationPosition", "illustrationDescription", "illustrationTheme", "link", "size", "subtitle", "title"];
|
19
|
+
var _excluded = ["action", "className", "illustrationPosition", "illustrationDescription", "illustrationTheme", "link", "size", "headingAs", "subtitle", "title"];
|
20
20
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
21
21
|
var blockClass = "".concat(pkg.prefix, "--empty-state");
|
22
22
|
var componentName = 'ErrorEmptyState';
|
@@ -33,6 +33,8 @@ var ErrorEmptyState = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
33
33
|
link = _ref.link,
|
34
34
|
_ref$size = _ref.size,
|
35
35
|
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
36
|
+
_ref$headingAs = _ref.headingAs,
|
37
|
+
headingAs = _ref$headingAs === void 0 ? defaults.headingAs : _ref$headingAs,
|
36
38
|
subtitle = _ref.subtitle,
|
37
39
|
title = _ref.title,
|
38
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
@@ -47,6 +49,7 @@ var ErrorEmptyState = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
47
49
|
action: action,
|
48
50
|
link: link,
|
49
51
|
size: size,
|
52
|
+
headingAs: headingAs,
|
50
53
|
subtitle: subtitle,
|
51
54
|
title: title || ''
|
52
55
|
}));
|
@@ -77,6 +80,10 @@ ErrorEmptyState.propTypes = {
|
|
77
80
|
* Provide an optional class to be applied to the containing node.
|
78
81
|
*/
|
79
82
|
className: PropTypes.string,
|
83
|
+
/**
|
84
|
+
* Empty state headingAs allows you to customize the type of heading element
|
85
|
+
*/
|
86
|
+
headingAs: PropTypes.elementType,
|
80
87
|
/**
|
81
88
|
* The alt text for empty state svg images. If not provided , title will be used.
|
82
89
|
*/
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
/// <reference path="../../../../src/custom-typings/index.d.ts" />
|
8
|
-
import React, { ReactNode } from 'react';
|
8
|
+
import React, { ElementType, ReactNode } from 'react';
|
9
9
|
import { ButtonProps } from '@carbon/react';
|
10
10
|
import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
|
11
11
|
export interface NoDataEmptyStateProps {
|
@@ -44,6 +44,10 @@ export interface NoDataEmptyStateProps {
|
|
44
44
|
text?: string | ReactNode;
|
45
45
|
href?: string;
|
46
46
|
};
|
47
|
+
/**
|
48
|
+
* Empty state headingAs allows you to customize the type of heading element
|
49
|
+
*/
|
50
|
+
headingAs?: (() => ReactNode) | string | ElementType;
|
47
51
|
/**
|
48
52
|
* Empty state size
|
49
53
|
*/
|
@@ -16,7 +16,7 @@ import { EmptyStateContent } from '../EmptyStateContent.js';
|
|
16
16
|
import { NoDataIllustration } from '../assets/NoDataIllustration.js';
|
17
17
|
import { defaults } from '../EmptyState.js';
|
18
18
|
|
19
|
-
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "subtitle", "title"];
|
19
|
+
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "headingAs", "subtitle", "title"];
|
20
20
|
|
21
21
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
22
22
|
var blockClass = "".concat(pkg.prefix, "--empty-state");
|
@@ -34,6 +34,8 @@ var NoDataEmptyState = /*#__PURE__*/React__default.forwardRef(function (_ref, re
|
|
34
34
|
link = _ref.link,
|
35
35
|
_ref$size = _ref.size,
|
36
36
|
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
37
|
+
_ref$headingAs = _ref.headingAs,
|
38
|
+
headingAs = _ref$headingAs === void 0 ? defaults.headingAs : _ref$headingAs,
|
37
39
|
subtitle = _ref.subtitle,
|
38
40
|
title = _ref.title,
|
39
41
|
rest = _objectWithoutProperties(_ref, _excluded);
|
@@ -48,6 +50,7 @@ var NoDataEmptyState = /*#__PURE__*/React__default.forwardRef(function (_ref, re
|
|
48
50
|
action: action,
|
49
51
|
link: link,
|
50
52
|
size: size,
|
53
|
+
headingAs: headingAs,
|
51
54
|
subtitle: subtitle,
|
52
55
|
title: title || ''
|
53
56
|
}));
|
@@ -78,6 +81,10 @@ NoDataEmptyState.propTypes = {
|
|
78
81
|
* Provide an optional class to be applied to the containing node.
|
79
82
|
*/
|
80
83
|
className: PropTypes.string,
|
84
|
+
/**
|
85
|
+
* Empty state headingAs allows you to customize the type of heading element
|
86
|
+
*/
|
87
|
+
headingAs: PropTypes.elementType,
|
81
88
|
/**
|
82
89
|
* The alt text for empty state svg images. If not provided , title will be used.
|
83
90
|
*/
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
/// <reference path="../../../../src/custom-typings/index.d.ts" />
|
8
|
-
import React, { ReactNode } from 'react';
|
8
|
+
import React, { ElementType, ReactNode } from 'react';
|
9
9
|
import { ButtonProps } from '@carbon/react';
|
10
10
|
import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
|
11
11
|
export interface NoTagsEmptyStateProps {
|
@@ -44,6 +44,10 @@ export interface NoTagsEmptyStateProps {
|
|
44
44
|
text?: string | ReactNode;
|
45
45
|
href?: string;
|
46
46
|
};
|
47
|
+
/**
|
48
|
+
* Empty state headingAs allows you to customize the type of heading element
|
49
|
+
*/
|
50
|
+
headingAs?: (() => ReactNode) | string | ElementType;
|
47
51
|
/**
|
48
52
|
* Empty state size
|
49
53
|
*/
|
@@ -16,7 +16,7 @@ import { EmptyStateContent } from '../EmptyStateContent.js';
|
|
16
16
|
import { NoTagsIllustration } from '../assets/NoTagsIllustration.js';
|
17
17
|
import { defaults } from '../EmptyState.js';
|
18
18
|
|
19
|
-
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "subtitle", "title"];
|
19
|
+
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "headingAs", "subtitle", "title"];
|
20
20
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
21
21
|
var blockClass = "".concat(pkg.prefix, "--empty-state");
|
22
22
|
var componentName = 'NoTagsEmptyState';
|
@@ -33,6 +33,8 @@ var NoTagsEmptyState = /*#__PURE__*/React__default.forwardRef(function (_ref, re
|
|
33
33
|
link = _ref.link,
|
34
34
|
_ref$size = _ref.size,
|
35
35
|
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
36
|
+
_ref$headingAs = _ref.headingAs,
|
37
|
+
headingAs = _ref$headingAs === void 0 ? defaults.headingAs : _ref$headingAs,
|
36
38
|
subtitle = _ref.subtitle,
|
37
39
|
title = _ref.title,
|
38
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
@@ -47,6 +49,7 @@ var NoTagsEmptyState = /*#__PURE__*/React__default.forwardRef(function (_ref, re
|
|
47
49
|
action: action,
|
48
50
|
link: link,
|
49
51
|
size: size,
|
52
|
+
headingAs: headingAs,
|
50
53
|
subtitle: subtitle,
|
51
54
|
title: title = ''
|
52
55
|
}));
|
@@ -77,6 +80,10 @@ NoTagsEmptyState.propTypes = {
|
|
77
80
|
* Provide an optional class to be applied to the containing node.
|
78
81
|
*/
|
79
82
|
className: PropTypes.string,
|
83
|
+
/**
|
84
|
+
* Empty state headingAs allows you to customize the type of heading element
|
85
|
+
*/
|
86
|
+
headingAs: PropTypes.elementType,
|
80
87
|
/**
|
81
88
|
* The alt text for empty state svg images. If not provided , title will be used.
|
82
89
|
*/
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
/// <reference path="../../../../src/custom-typings/index.d.ts" />
|
8
|
-
import React, { ReactNode } from 'react';
|
8
|
+
import React, { ElementType, ReactNode } from 'react';
|
9
9
|
import { ButtonProps } from '@carbon/react';
|
10
10
|
import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
|
11
11
|
export interface NotFoundEmptyStateProps {
|
@@ -44,6 +44,10 @@ export interface NotFoundEmptyStateProps {
|
|
44
44
|
text?: string | ReactNode;
|
45
45
|
href?: string;
|
46
46
|
};
|
47
|
+
/**
|
48
|
+
* Empty state headingAs allows you to customize the type of heading element
|
49
|
+
*/
|
50
|
+
headingAs?: (() => ReactNode) | string | ElementType;
|
47
51
|
/**
|
48
52
|
* Empty state size
|
49
53
|
*/
|
@@ -16,7 +16,7 @@ import { EmptyStateContent } from '../EmptyStateContent.js';
|
|
16
16
|
import { NotFoundIllustration } from '../assets/NotFoundIllustration.js';
|
17
17
|
import { defaults } from '../EmptyState.js';
|
18
18
|
|
19
|
-
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "subtitle", "title"];
|
19
|
+
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "headingAs", "subtitle", "title"];
|
20
20
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
21
21
|
var blockClass = "".concat(pkg.prefix, "--empty-state");
|
22
22
|
var componentName = 'NotFoundEmptyState';
|
@@ -33,6 +33,8 @@ var NotFoundEmptyState = /*#__PURE__*/React__default.forwardRef(function (_ref,
|
|
33
33
|
link = _ref.link,
|
34
34
|
_ref$size = _ref.size,
|
35
35
|
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
36
|
+
_ref$headingAs = _ref.headingAs,
|
37
|
+
headingAs = _ref$headingAs === void 0 ? defaults.headingAs : _ref$headingAs,
|
36
38
|
subtitle = _ref.subtitle,
|
37
39
|
title = _ref.title,
|
38
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
@@ -47,6 +49,7 @@ var NotFoundEmptyState = /*#__PURE__*/React__default.forwardRef(function (_ref,
|
|
47
49
|
action: action,
|
48
50
|
link: link,
|
49
51
|
size: size,
|
52
|
+
headingAs: headingAs,
|
50
53
|
subtitle: subtitle,
|
51
54
|
title: title || ''
|
52
55
|
}));
|
@@ -77,6 +80,10 @@ NotFoundEmptyState.propTypes = {
|
|
77
80
|
* Provide an optional class to be applied to the containing node.
|
78
81
|
*/
|
79
82
|
className: PropTypes.string,
|
83
|
+
/**
|
84
|
+
* Empty state headingAs allows you to customize the type of heading element
|
85
|
+
*/
|
86
|
+
headingAs: PropTypes.elementType,
|
80
87
|
/**
|
81
88
|
* The alt text for empty state svg images. If not provided , title will be used.
|
82
89
|
*/
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
/// <reference path="../../../../src/custom-typings/index.d.ts" />
|
8
|
-
import React, { ReactNode } from 'react';
|
8
|
+
import React, { ElementType, ReactNode } from 'react';
|
9
9
|
import { ButtonProps } from '@carbon/react';
|
10
10
|
import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
|
11
11
|
export interface NotificationsEmptyStateProps {
|
@@ -44,6 +44,10 @@ export interface NotificationsEmptyStateProps {
|
|
44
44
|
text?: string | ReactNode;
|
45
45
|
href?: string;
|
46
46
|
};
|
47
|
+
/**
|
48
|
+
* Empty state headingAs allows you to customize the type of heading element
|
49
|
+
*/
|
50
|
+
headingAs?: (() => ReactNode) | string | ElementType;
|
47
51
|
/**
|
48
52
|
* Empty state size
|
49
53
|
*/
|
@@ -16,7 +16,7 @@ import { EmptyStateContent } from '../EmptyStateContent.js';
|
|
16
16
|
import { NotificationsIllustration } from '../assets/NotificationsIllustration.js';
|
17
17
|
import { defaults } from '../EmptyState.js';
|
18
18
|
|
19
|
-
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "subtitle", "title"];
|
19
|
+
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "headingAs", "subtitle", "title"];
|
20
20
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
21
21
|
var blockClass = "".concat(pkg.prefix, "--empty-state");
|
22
22
|
var componentName = 'NotificationsEmptyState';
|
@@ -33,6 +33,8 @@ var NotificationsEmptyState = /*#__PURE__*/React__default.forwardRef(function (_
|
|
33
33
|
link = _ref.link,
|
34
34
|
_ref$size = _ref.size,
|
35
35
|
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
36
|
+
_ref$headingAs = _ref.headingAs,
|
37
|
+
headingAs = _ref$headingAs === void 0 ? defaults.headingAs : _ref$headingAs,
|
36
38
|
subtitle = _ref.subtitle,
|
37
39
|
title = _ref.title,
|
38
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
@@ -47,6 +49,7 @@ var NotificationsEmptyState = /*#__PURE__*/React__default.forwardRef(function (_
|
|
47
49
|
action: action,
|
48
50
|
link: link,
|
49
51
|
size: size,
|
52
|
+
headingAs: headingAs,
|
50
53
|
subtitle: subtitle,
|
51
54
|
title: title || ''
|
52
55
|
}));
|
@@ -77,6 +80,10 @@ NotificationsEmptyState.propTypes = {
|
|
77
80
|
* Provide an optional class to be applied to the containing node.
|
78
81
|
*/
|
79
82
|
className: PropTypes.string,
|
83
|
+
/**
|
84
|
+
* Empty state headingAs allows you to customize the type of heading element
|
85
|
+
*/
|
86
|
+
headingAs: PropTypes.elementType,
|
80
87
|
/**
|
81
88
|
* The alt text for empty state svg images. If not provided , title will be used.
|
82
89
|
*/
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
/// <reference path="../../../../src/custom-typings/index.d.ts" />
|
8
|
-
import React, { ReactNode } from 'react';
|
8
|
+
import React, { ElementType, ReactNode } from 'react';
|
9
9
|
import { ButtonProps } from '@carbon/react';
|
10
10
|
import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
|
11
11
|
export interface UnauthorizedEmptyStateProps {
|
@@ -44,6 +44,10 @@ export interface UnauthorizedEmptyStateProps {
|
|
44
44
|
text?: string | ReactNode;
|
45
45
|
href?: string;
|
46
46
|
};
|
47
|
+
/**
|
48
|
+
* Empty state headingAs allows you to customize the type of heading element
|
49
|
+
*/
|
50
|
+
headingAs?: (() => ReactNode) | string | ElementType;
|
47
51
|
/**
|
48
52
|
* Empty state size
|
49
53
|
*/
|
@@ -16,7 +16,7 @@ import { EmptyStateContent } from '../EmptyStateContent.js';
|
|
16
16
|
import { UnauthorizedIllustration } from '../assets/UnauthorizedIllustration.js';
|
17
17
|
import { defaults } from '../EmptyState.js';
|
18
18
|
|
19
|
-
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "subtitle", "title"];
|
19
|
+
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "headingAs", "subtitle", "title"];
|
20
20
|
|
21
21
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
22
22
|
var blockClass = "".concat(pkg.prefix, "--empty-state");
|
@@ -34,6 +34,8 @@ var UnauthorizedEmptyState = /*#__PURE__*/React__default.forwardRef(function (_r
|
|
34
34
|
link = _ref.link,
|
35
35
|
_ref$size = _ref.size,
|
36
36
|
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
37
|
+
_ref$headingAs = _ref.headingAs,
|
38
|
+
headingAs = _ref$headingAs === void 0 ? defaults.headingAs : _ref$headingAs,
|
37
39
|
subtitle = _ref.subtitle,
|
38
40
|
title = _ref.title,
|
39
41
|
rest = _objectWithoutProperties(_ref, _excluded);
|
@@ -48,6 +50,7 @@ var UnauthorizedEmptyState = /*#__PURE__*/React__default.forwardRef(function (_r
|
|
48
50
|
action: action,
|
49
51
|
link: link,
|
50
52
|
size: size,
|
53
|
+
headingAs: headingAs,
|
51
54
|
subtitle: subtitle,
|
52
55
|
title: title || ''
|
53
56
|
}));
|
@@ -78,6 +81,10 @@ UnauthorizedEmptyState.propTypes = {
|
|
78
81
|
* Provide an optional class to be applied to the containing node.
|
79
82
|
*/
|
80
83
|
className: PropTypes.string,
|
84
|
+
/**
|
85
|
+
* Empty state headingAs allows you to customize the type of heading element
|
86
|
+
*/
|
87
|
+
headingAs: PropTypes.elementType,
|
81
88
|
/**
|
82
89
|
* The alt text for empty state svg images. If not provided , title will be used.
|
83
90
|
*/
|
@@ -29,7 +29,8 @@ var ErrorIllustration = function ErrorIllustration(_ref) {
|
|
29
29
|
height: 80,
|
30
30
|
viewBox: "0 0 80 80",
|
31
31
|
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-error"), "".concat(blockClass, "__illustration--").concat(size)]),
|
32
|
-
role: "img"
|
32
|
+
role: "img",
|
33
|
+
"aria-hidden": "true"
|
33
34
|
}), /*#__PURE__*/React__default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("linearGradient", {
|
34
35
|
id: "prefix__a_dark_".concat(svgId),
|
35
36
|
x1: 38.9,
|
@@ -29,7 +29,8 @@ var NoDataIllustration = function NoDataIllustration(_ref) {
|
|
29
29
|
height: 80,
|
30
30
|
viewBox: "0 0 80 80",
|
31
31
|
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-noData"), "".concat(blockClass, "__illustration--").concat(size)]),
|
32
|
-
role: "img"
|
32
|
+
role: "img",
|
33
|
+
"aria-hidden": "true"
|
33
34
|
}), /*#__PURE__*/React__default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("linearGradient", {
|
34
35
|
id: "prefix__a_dark_".concat(svgId),
|
35
36
|
x1: 11.12,
|
@@ -30,7 +30,8 @@ var NoTagsIllustration = function NoTagsIllustration(_ref) {
|
|
30
30
|
height: 80,
|
31
31
|
viewBox: "0 0 80 80",
|
32
32
|
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-noTags"), "".concat(blockClass, "__illustration--").concat(size)]),
|
33
|
-
role: "img"
|
33
|
+
role: "img",
|
34
|
+
"aria-hidden": "true"
|
34
35
|
}), /*#__PURE__*/React__default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("linearGradient", {
|
35
36
|
id: "prefix__c_dark_".concat(svgId),
|
36
37
|
x1: 34.96,
|
@@ -29,7 +29,8 @@ var NotFoundIllustration = function NotFoundIllustration(_ref) {
|
|
29
29
|
height: 80,
|
30
30
|
viewBox: "0 0 80 80",
|
31
31
|
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-notFound"), "".concat(blockClass, "__illustration--").concat(size)]),
|
32
|
-
role: "img"
|
32
|
+
role: "img",
|
33
|
+
"aria-hidden": "true"
|
33
34
|
}), /*#__PURE__*/React__default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("linearGradient", {
|
34
35
|
id: "prefix__a_dark_".concat(svgId),
|
35
36
|
x1: 2.6,
|
@@ -28,7 +28,8 @@ var NotificationsIllustration = function NotificationsIllustration(_ref) {
|
|
28
28
|
width: 80,
|
29
29
|
height: 80,
|
30
30
|
viewBox: "0 0 80 80",
|
31
|
-
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-notification"), "".concat(blockClass, "__illustration--").concat(size)])
|
31
|
+
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-notification"), "".concat(blockClass, "__illustration--").concat(size)]),
|
32
|
+
"aria-hidden": "true"
|
32
33
|
}), /*#__PURE__*/React__default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("linearGradient", {
|
33
34
|
id: "prefix__a_dark_".concat(svgId),
|
34
35
|
x1: 30.05,
|
@@ -30,7 +30,8 @@ var UnauthorizedIllustration = function UnauthorizedIllustration(_ref) {
|
|
30
30
|
height: 80,
|
31
31
|
viewBox: "0 0 80 80",
|
32
32
|
className: cx(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-unauthorized"), "".concat(blockClass, "__illustration--").concat(size)]),
|
33
|
-
role: "img"
|
33
|
+
role: "img",
|
34
|
+
"aria-hidden": "true"
|
34
35
|
}), /*#__PURE__*/React__default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("linearGradient", {
|
35
36
|
id: "prefix__b_dark_".concat(svgId),
|
36
37
|
x1: 17.33,
|
@@ -126,7 +126,7 @@ var FilterSummary = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
126
126
|
ref: localRef,
|
127
127
|
className: cx([blockClass, className], _defineProperty({}, "".concat(blockClass, "__expanded"), multiline))
|
128
128
|
}), /*#__PURE__*/React__default.createElement(AnimatePresence, {
|
129
|
-
|
129
|
+
exitBeforeEnter: true
|
130
130
|
}, !multiline && renderTagSet('single'), multiline && renderTagSet('multiline')), /*#__PURE__*/React__default.createElement(Button, {
|
131
131
|
kind: "ghost",
|
132
132
|
size: "sm",
|
@@ -9,11 +9,6 @@ import PropTypes from 'prop-types';
|
|
9
9
|
import { TearsheetAction } from './Tearsheet';
|
10
10
|
interface TearsheetShellProps extends PropsWithChildren {
|
11
11
|
actions?: TearsheetAction[];
|
12
|
-
/**
|
13
|
-
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency,
|
14
|
-
* accountability, and explainability at the UI level.
|
15
|
-
*/
|
16
|
-
aiLabel?: ReactNode;
|
17
12
|
ariaLabel?: string;
|
18
13
|
/**
|
19
14
|
* An optional class or classes to be added to the outermost element.
|
@@ -23,6 +18,10 @@ interface TearsheetShellProps extends PropsWithChildren {
|
|
23
18
|
* Used to track the current step on components which use `StepsContext` and `TearsheetShell`
|
24
19
|
*/
|
25
20
|
currentStep?: number;
|
21
|
+
/**
|
22
|
+
* Optional prop that allows you to pass any component.
|
23
|
+
*/
|
24
|
+
decorator?: ReactNode;
|
26
25
|
/**
|
27
26
|
* A description of the flow, displayed in the header area of the tearsheet.
|
28
27
|
*/
|
@@ -36,6 +35,11 @@ interface TearsheetShellProps extends PropsWithChildren {
|
|
36
35
|
* this prop to either true or false.
|
37
36
|
*/
|
38
37
|
hasCloseIcon?: boolean;
|
38
|
+
/**
|
39
|
+
* To indicate an error occurred in the Tearsheet step
|
40
|
+
* Mainly used by CreateTearsheet component to pass error state
|
41
|
+
*/
|
42
|
+
hasError?: boolean;
|
39
43
|
/**
|
40
44
|
* The content for the header actions area, displayed alongside the title in
|
41
45
|
* the header area of the tearsheet. This is typically a drop-down, or a set
|
@@ -110,7 +114,7 @@ interface TearsheetShellProps extends PropsWithChildren {
|
|
110
114
|
title?: ReactNode;
|
111
115
|
verticalPosition?: 'normal' | 'lower';
|
112
116
|
/**
|
113
|
-
* @deprecated Property replaced by `
|
117
|
+
* @deprecated Property replaced by `decorator`
|
114
118
|
*/
|
115
119
|
slug?: ReactNode;
|
116
120
|
}
|
@@ -135,7 +139,7 @@ export declare const TearsheetShell: React.ForwardRefExoticComponent<(TearsheetS
|
|
135
139
|
export declare const portalType: PropTypes.Requireable<object>;
|
136
140
|
export declare const deprecatedProps: {
|
137
141
|
/**
|
138
|
-
* @deprecated Property replaced by `
|
142
|
+
* @deprecated Property replaced by `decorator`
|
139
143
|
*/
|
140
144
|
slug: (props: any, propName: any, comp: any, loc: any, propFullName: any, secret: any) => any;
|
141
145
|
/**
|
@@ -21,7 +21,7 @@ import { usePortalTarget } from '../../global/js/hooks/usePortalTarget.js';
|
|
21
21
|
import { useFocus, claimFocus } from '../../global/js/hooks/useFocus.js';
|
22
22
|
import { usePreviousValue } from '../../global/js/hooks/usePreviousValue.js';
|
23
23
|
|
24
|
-
var _excluded = ["actions", "
|
24
|
+
var _excluded = ["actions", "decorator", "ariaLabel", "children", "className", "closeIconDescription", "currentStep", "description", "hasCloseIcon", "hasError", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "portalTarget", "selectorPrimaryFocus", "selectorsFloatingMenus", "size", "slug", "title", "verticalPosition", "launcherButtonRef"];
|
25
25
|
// The block part of our conventional BEM class names (bc__E--M).
|
26
26
|
var bc = "".concat(pkg.prefix, "--tearsheet");
|
27
27
|
var componentName = 'TearsheetShell';
|
@@ -63,7 +63,7 @@ var tearsheetHasCloseIcon = function tearsheetHasCloseIcon(actions, hasCloseIcon
|
|
63
63
|
* */
|
64
64
|
var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
65
65
|
var actions = _ref.actions,
|
66
|
-
|
66
|
+
decorator = _ref.decorator,
|
67
67
|
ariaLabel = _ref.ariaLabel,
|
68
68
|
children = _ref.children,
|
69
69
|
className = _ref.className,
|
@@ -71,6 +71,7 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
71
71
|
currentStep = _ref.currentStep,
|
72
72
|
description = _ref.description,
|
73
73
|
hasCloseIcon = _ref.hasCloseIcon,
|
74
|
+
hasError = _ref.hasError,
|
74
75
|
headerActions = _ref.headerActions,
|
75
76
|
influencer = _ref.influencer,
|
76
77
|
influencerPosition = _ref.influencerPosition,
|
@@ -142,7 +143,7 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
142
143
|
// Focusing the first element or selectorPrimaryFocus element
|
143
144
|
claimFocus(firstElement, modalRef, selectorPrimaryFocus);
|
144
145
|
}
|
145
|
-
}, [currentStep, depth, firstElement, modalRef, modalRefValue, open, position, selectorPrimaryFocus]);
|
146
|
+
}, [currentStep, depth, firstElement, modalRef, modalRefValue, open, position, selectorPrimaryFocus, hasError]);
|
146
147
|
useEffect(function () {
|
147
148
|
if (prevOpen && !open && launcherButtonRef) {
|
148
149
|
setTimeout(function () {
|
@@ -189,7 +190,7 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
189
190
|
};
|
190
191
|
}, [open, size]);
|
191
192
|
if (position <= depth) {
|
192
|
-
var _prevDepth$current;
|
193
|
+
var _prevDepth$current, _decorator$type, _decorator$type2;
|
193
194
|
// Include a modal header if and only if one or more of these is given.
|
194
195
|
// We can't use a Wrap for the ModalHeader because ComposedModal requires
|
195
196
|
// the direct child to be the ModalHeader instance.
|
@@ -210,10 +211,10 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
210
211
|
enableExperimentalFocusWrapWithoutSentinels: true
|
211
212
|
}, /*#__PURE__*/React__default.createElement(ComposedModal, _extends({}, rest, {
|
212
213
|
"aria-label": ariaLabel || getNodeTextContent(title),
|
213
|
-
className: cx(bc, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(bc, "--stacked-").concat(position, "-of-").concat(depth),
|
214
|
+
className: cx(bc, className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(bc, "--stacked-").concat(position, "-of-").concat(depth),
|
214
215
|
// Don't apply this on the initial open of a single tearsheet.
|
215
|
-
depth > 1 || depth === 1 && ((_prevDepth$current = prevDepth === null || prevDepth === void 0 ? void 0 : prevDepth.current) !== null && _prevDepth$current !== void 0 ? _prevDepth$current : 0) > 1), "".concat(bc, "--wide"), wide), "".concat(bc, "--narrow"), !wide), "".concat(bc, "--has-slug"), deprecated_slug), "".concat(bc, "--has-ai-label"),
|
216
|
-
|
216
|
+
depth > 1 || depth === 1 && ((_prevDepth$current = prevDepth === null || prevDepth === void 0 ? void 0 : prevDepth.current) !== null && _prevDepth$current !== void 0 ? _prevDepth$current : 0) > 1), "".concat(bc, "--wide"), wide), "".concat(bc, "--narrow"), !wide), "".concat(bc, "--has-slug"), deprecated_slug), "".concat(bc, "--has-ai-label"), !!decorator && ((_decorator$type = decorator['type']) === null || _decorator$type === void 0 ? void 0 : _decorator$type.displayName) === 'AILabel'), "".concat(bc, "--has-decorator"), !!decorator && ((_decorator$type2 = decorator['type']) === null || _decorator$type2 === void 0 ? void 0 : _decorator$type2.displayName) !== 'AILabel'), "".concat(bc, "--has-close"), effectiveHasCloseIcon)),
|
217
|
+
decorator: decorator || deprecated_slug,
|
217
218
|
style: setScaleValues(),
|
218
219
|
containerClassName: cx("".concat(bc, "__container"), _defineProperty(_defineProperty({}, "".concat(bc, "__container--lower"), verticalPosition === 'lower'), "".concat(bc, "__container--mixed-size-stacking"), !areAllSameSizeVariant())),
|
219
220
|
onClose: onClose,
|
@@ -291,9 +292,9 @@ var portalType = typeof Element === 'undefined' ? PropTypes.object :
|
|
291
292
|
PropTypes.instanceOf(Element);
|
292
293
|
var deprecatedProps = {
|
293
294
|
/**
|
294
|
-
* @deprecated Property replaced by `
|
295
|
+
* @deprecated Property replaced by `decorator`
|
295
296
|
*/
|
296
|
-
slug: deprecateProp(PropTypes.node, 'Property replaced by `
|
297
|
+
slug: deprecateProp(PropTypes.node, 'Property replaced by `decorator`'),
|
297
298
|
/**
|
298
299
|
* **Deprecated**
|
299
300
|
*
|
@@ -338,11 +339,6 @@ TearsheetShell.propTypes = _objectSpread2({
|
|
338
339
|
/**@ts-ignore*/
|
339
340
|
onClick: Button.propTypes.onClick
|
340
341
|
}))),
|
341
|
-
/**
|
342
|
-
* Optional prop that is intended for any scenario where something is being generated by AI to reinforce AI transparency,
|
343
|
-
* accountability, and explainability at the UI level.
|
344
|
-
*/
|
345
|
-
aiLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
|
346
342
|
/**
|
347
343
|
* The main content of the tearsheet.
|
348
344
|
*/
|
@@ -363,6 +359,10 @@ TearsheetShell.propTypes = _objectSpread2({
|
|
363
359
|
hasCloseIcon = _ref4.hasCloseIcon;
|
364
360
|
return tearsheetHasCloseIcon(actions, hasCloseIcon);
|
365
361
|
}),
|
362
|
+
/**
|
363
|
+
* Optional prop that allows you to pass any component.
|
364
|
+
*/
|
365
|
+
decorator: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
|
366
366
|
/**
|
367
367
|
* A description of the flow, displayed in the header area of the tearsheet.
|
368
368
|
*/
|
@@ -16,6 +16,7 @@ var getSpecificElement = function getSpecificElement(parentEl, elementId) {
|
|
16
16
|
return elementId && !(element !== null && element !== void 0 && element.disabled) ? element : null;
|
17
17
|
};
|
18
18
|
var useFocus = function useFocus(modalRef, selectorPrimaryFocus) {
|
19
|
+
var _getFocusable2, _getFocusable3, _getFocusable4, _getFocusable5;
|
19
20
|
var carbonPrefix = usePrefix();
|
20
21
|
var tearsheetBaseClass = "".concat(pkg.prefix, "--tearsheet");
|
21
22
|
var sidePanelBaseClass = "".concat(pkg.prefix, "--side-panel");
|
@@ -29,15 +30,15 @@ var useFocus = function useFocus(modalRef, selectorPrimaryFocus) {
|
|
29
30
|
var querySelect = "select".concat(notQuery);
|
30
31
|
var queryTextarea = "textarea".concat(notQuery);
|
31
32
|
var queryLink = "[href]".concat(notQuery);
|
33
|
+
var queryAnchor = "a".concat(notQuery);
|
32
34
|
var queryTabIndex = "[tabindex=\"0\"]".concat(notQuery);
|
33
35
|
var querySidePanelScroll = ".".concat(sidePanelBaseClass, "--scrolls");
|
34
36
|
// Final query
|
35
|
-
var query = "".concat(queryButton, ",").concat(queryLink, ",").concat(queryInput, ",").concat(querySelect, ",").concat(queryTextarea, ",").concat(queryTabIndex, ",").concat(querySidePanelScroll);
|
36
|
-
var modalEl = modalRef === null || modalRef === void 0 ? void 0 : modalRef.current;
|
37
|
+
var query = "".concat(queryButton, ",").concat(queryLink, ",").concat(queryAnchor, ",").concat(queryInput, ",").concat(querySelect, ",").concat(queryTextarea, ",").concat(queryTabIndex, ",").concat(querySidePanelScroll);
|
37
38
|
var getFocusable = useCallback(function () {
|
38
|
-
var _focusableElements, _focusableElements2, _focusableElements3, _focusableElements4;
|
39
|
+
var _modalRef$current, _focusableElements, _focusableElements2, _focusableElements3, _focusableElements4;
|
39
40
|
// Selecting all focusable elements based on the above conditions
|
40
|
-
var focusableElements =
|
41
|
+
var focusableElements = modalRef === null || modalRef === void 0 || (_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 ? void 0 : _modalRef$current.querySelectorAll("".concat(query));
|
41
42
|
if ((_focusableElements = focusableElements) !== null && _focusableElements !== void 0 && _focusableElements.length) {
|
42
43
|
focusableElements = Array.prototype.filter.call(focusableElements, function (el) {
|
43
44
|
var _window;
|
@@ -47,17 +48,17 @@ var useFocus = function useFocus(modalRef, selectorPrimaryFocus) {
|
|
47
48
|
var first = (_focusableElements2 = focusableElements) === null || _focusableElements2 === void 0 ? void 0 : _focusableElements2[0];
|
48
49
|
var last = (_focusableElements3 = focusableElements) === null || _focusableElements3 === void 0 ? void 0 : _focusableElements3[((_focusableElements4 = focusableElements) === null || _focusableElements4 === void 0 ? void 0 : _focusableElements4.length) - 1];
|
49
50
|
var all = focusableElements;
|
50
|
-
var specified = getSpecificElement(
|
51
|
+
var specified = getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
|
51
52
|
return {
|
52
53
|
first: first,
|
53
54
|
last: last,
|
54
55
|
all: all,
|
55
56
|
specified: specified
|
56
57
|
};
|
57
|
-
}, [
|
58
|
+
}, [modalRef, query, selectorPrimaryFocus]);
|
58
59
|
useEffect(function () {
|
59
60
|
getFocusable();
|
60
|
-
}, [getFocusable]);
|
61
|
+
}, [getFocusable, modalRef]);
|
61
62
|
var handleKeyDown = /*#__PURE__*/function () {
|
62
63
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(event) {
|
63
64
|
var _document, _document2, _getFocusable, first, last, all;
|
@@ -95,10 +96,10 @@ var useFocus = function useFocus(modalRef, selectorPrimaryFocus) {
|
|
95
96
|
};
|
96
97
|
}();
|
97
98
|
return {
|
98
|
-
firstElement: getFocusable().first,
|
99
|
-
lastElement: getFocusable().last,
|
100
|
-
allElements: getFocusable().all,
|
101
|
-
specifiedElement: getFocusable().specified,
|
99
|
+
firstElement: (_getFocusable2 = getFocusable()) === null || _getFocusable2 === void 0 ? void 0 : _getFocusable2.first,
|
100
|
+
lastElement: (_getFocusable3 = getFocusable()) === null || _getFocusable3 === void 0 ? void 0 : _getFocusable3.last,
|
101
|
+
allElements: (_getFocusable4 = getFocusable()) === null || _getFocusable4 === void 0 ? void 0 : _getFocusable4.all,
|
102
|
+
specifiedElement: (_getFocusable5 = getFocusable()) === null || _getFocusable5 === void 0 ? void 0 : _getFocusable5.specified,
|
102
103
|
keyDownListener: handleKeyDown,
|
103
104
|
getFocusable: getFocusable
|
104
105
|
};
|
@@ -111,15 +112,16 @@ var useFocus = function useFocus(modalRef, selectorPrimaryFocus) {
|
|
111
112
|
* @param {string | undefined} selectorPrimaryFocus
|
112
113
|
*/
|
113
114
|
var claimFocus = function claimFocus(firstElement, modalRef) {
|
115
|
+
var _window2, _specifiedEl;
|
114
116
|
var selectorPrimaryFocus = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
}
|
117
|
+
var specifiedEl;
|
118
|
+
if (selectorPrimaryFocus) {
|
119
|
+
specifiedEl = getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
|
120
|
+
}
|
121
|
+
if (specifiedEl && ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.getComputedStyle(specifiedEl)) === null || _window2 === void 0 ? void 0 : _window2.display) !== 'none' && ((_specifiedEl = specifiedEl) === null || _specifiedEl === void 0 ? void 0 : _specifiedEl.tabIndex) !== -1) {
|
122
|
+
setTimeout(function () {
|
123
|
+
return specifiedEl.focus();
|
124
|
+
}, 0);
|
123
125
|
} else {
|
124
126
|
setTimeout(function () {
|
125
127
|
return firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
|