@carbon/ibm-products 2.54.0-canary.28 → 2.54.0-canary.31

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.
Files changed (39) hide show
  1. package/es/components/APIKeyModal/APIKeyModal.js +2 -14
  2. package/es/components/AboutModal/AboutModal.js +3 -6
  3. package/es/components/DecoratorDualButton/DecoratorDualButton.d.ts +1 -0
  4. package/es/components/DecoratorDualButton/DecoratorDualButton.js +5 -0
  5. package/es/components/DecoratorLink/DecoratorLink.d.ts +1 -0
  6. package/es/components/DecoratorLink/DecoratorLink.js +5 -0
  7. package/es/components/DecoratorSingleButton/DecoratorSingleButton.d.ts +1 -0
  8. package/es/components/DecoratorSingleButton/DecoratorSingleButton.js +5 -0
  9. package/es/components/DescriptionList/DescriptionList.d.ts +1 -0
  10. package/es/components/DescriptionList/DescriptionList.js +5 -0
  11. package/es/components/Nav/Nav.d.ts +3 -0
  12. package/es/components/Nav/Nav.js +8 -0
  13. package/es/components/StatusIndicator/StatusIndicator.d.ts +1 -0
  14. package/es/components/StatusIndicator/StatusIndicator.js +5 -0
  15. package/es/components/StatusIndicator/StatusIndicatorStep.d.ts +1 -0
  16. package/es/components/StatusIndicator/StatusIndicatorStep.js +5 -0
  17. package/es/components/Tearsheet/TearsheetShell.js +3 -24
  18. package/es/global/js/hooks/useFocus.d.ts +1 -0
  19. package/es/global/js/hooks/useFocus.js +21 -1
  20. package/lib/components/APIKeyModal/APIKeyModal.js +1 -13
  21. package/lib/components/AboutModal/AboutModal.js +2 -5
  22. package/lib/components/DecoratorDualButton/DecoratorDualButton.d.ts +1 -0
  23. package/lib/components/DecoratorDualButton/DecoratorDualButton.js +5 -0
  24. package/lib/components/DecoratorLink/DecoratorLink.d.ts +1 -0
  25. package/lib/components/DecoratorLink/DecoratorLink.js +5 -0
  26. package/lib/components/DecoratorSingleButton/DecoratorSingleButton.d.ts +1 -0
  27. package/lib/components/DecoratorSingleButton/DecoratorSingleButton.js +5 -0
  28. package/lib/components/DescriptionList/DescriptionList.d.ts +1 -0
  29. package/lib/components/DescriptionList/DescriptionList.js +5 -0
  30. package/lib/components/Nav/Nav.d.ts +3 -0
  31. package/lib/components/Nav/Nav.js +8 -0
  32. package/lib/components/StatusIndicator/StatusIndicator.d.ts +1 -0
  33. package/lib/components/StatusIndicator/StatusIndicator.js +5 -0
  34. package/lib/components/StatusIndicator/StatusIndicatorStep.d.ts +1 -0
  35. package/lib/components/StatusIndicator/StatusIndicatorStep.js +5 -0
  36. package/lib/components/Tearsheet/TearsheetShell.js +2 -23
  37. package/lib/global/js/hooks/useFocus.d.ts +1 -0
  38. package/lib/global/js/hooks/useFocus.js +21 -0
  39. package/package.json +2 -2
@@ -17,7 +17,7 @@ import { usePortalTarget } from '../../global/js/hooks/usePortalTarget.js';
17
17
  import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
18
18
  import { isRequiredIf } from '../../global/js/utils/props-helper.js';
19
19
  import uuidv4 from '../../global/js/utils/uuidv4.js';
20
- import { useFocus, getSpecificElement } from '../../global/js/hooks/useFocus.js';
20
+ import { useFocus, claimFocus } from '../../global/js/hooks/useFocus.js';
21
21
  import { usePreviousValue } from '../../global/js/hooks/usePreviousValue.js';
22
22
 
23
23
  var _ErrorFilled, _InformationFilled;
@@ -129,19 +129,7 @@ var APIKeyModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
129
129
  useEffect(function () {
130
130
  if (open) {
131
131
  // Focusing the first element or selectorPrimaryFocus element
132
- if (selectorPrimaryFocus && getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus)) {
133
- var _window;
134
- var specifiedEl = getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
135
- if (specifiedEl && ((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(specifiedEl)) === null || _window === void 0 ? void 0 : _window.display) !== 'none') {
136
- setTimeout(function () {
137
- return specifiedEl.focus();
138
- }, 0);
139
- return;
140
- }
141
- }
142
- setTimeout(function () {
143
- firstElement === null || firstElement === void 0 || firstElement.focus();
144
- }, 0);
132
+ claimFocus(firstElement, modalRef, selectorPrimaryFocus);
145
133
  }
146
134
  }, [firstElement, modalRef, open, selectorPrimaryFocus]);
147
135
  useEffect(function () {
@@ -11,7 +11,7 @@ import React__default, { useRef, useEffect } from 'react';
11
11
  import PropTypes from '../../_virtual/index.js';
12
12
  import cx from 'classnames';
13
13
  import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
14
- import { useFocus } from '../../global/js/hooks/useFocus.js';
14
+ import { useFocus, claimFocus } from '../../global/js/hooks/useFocus.js';
15
15
  import { pkg } from '../../settings.js';
16
16
  import { usePortalTarget } from '../../global/js/hooks/usePortalTarget.js';
17
17
  import uuidv4 from '../../global/js/utils/uuidv4.js';
@@ -62,12 +62,9 @@ var AboutModal = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
62
62
  }, [bodyRef]);
63
63
  useEffect(function () {
64
64
  if (open) {
65
- setTimeout(function () {
66
- return firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
67
- }, 0);
65
+ claimFocus(firstElement, modalRef);
68
66
  }
69
- // eslint-disable-next-line react-hooks/exhaustive-deps
70
- }, [open]);
67
+ }, [firstElement, modalRef, open]);
71
68
  return renderPortalUse( /*#__PURE__*/React__default.createElement(unstable_FeatureFlags, {
72
69
  enableExperimentalFocusWrapWithoutSentinels: true
73
70
  }, /*#__PURE__*/React__default.createElement(ComposedModal, _extends({}, rest, {
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * The DecoratorDualButton groups a key/value pair where the key and value each behave like a button.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let DecoratorDualButton: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -17,6 +17,7 @@ var componentName = 'DecoratorDualButton';
17
17
 
18
18
  /**
19
19
  * The DecoratorDualButton groups a key/value pair where the key and value each behave like a button.
20
+ * @deprecated This component is deprecated
20
21
  */
21
22
  var DecoratorDualButton = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
22
23
  var validProps = prepareProps(props, ['href', 'kind', 'onClick', 'onContextMenu']);
@@ -26,6 +27,10 @@ var DecoratorDualButton = /*#__PURE__*/React__default.forwardRef(function (props
26
27
  kind: "dual-button"
27
28
  }, getDevtoolsProps(componentName)));
28
29
  });
30
+ DecoratorDualButton.deprecated = {
31
+ level: 'warn',
32
+ details: "This component is deprecated"
33
+ };
29
34
 
30
35
  // Return a placeholder if not released and not enabled by feature flag
31
36
  DecoratorDualButton = pkg.checkComponentEnabled(DecoratorDualButton, componentName);
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * The DecoratorLink groups a key/value pair to behave like a link.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let DecoratorLink: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -17,6 +17,7 @@ var componentName = 'DecoratorLink';
17
17
 
18
18
  /**
19
19
  * The DecoratorLink groups a key/value pair to behave like a link.
20
+ * @deprecated This component is deprecated
20
21
  */
21
22
  var DecoratorLink = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
22
23
  var validProps = prepareProps(props, ['disabled', 'kind', 'onClickLabel', 'onClickValue', 'onContextMenuLabel', 'onContextMenuValue']);
@@ -26,6 +27,10 @@ var DecoratorLink = /*#__PURE__*/React__default.forwardRef(function (props, ref)
26
27
  kind: "link"
27
28
  }, getDevtoolsProps(componentName)));
28
29
  });
30
+ DecoratorLink.deprecated = {
31
+ level: 'warn',
32
+ details: "This component is deprecated"
33
+ };
29
34
 
30
35
  // Return a placeholder if not released and not enabled by feature flag
31
36
  DecoratorLink = pkg.checkComponentEnabled(DecoratorLink, componentName);
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * The DecoratorSingleButton groups a key/value pair to behave like a button.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let DecoratorSingleButton: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -17,6 +17,7 @@ var componentName = 'DecoratorSingleButton';
17
17
 
18
18
  /**
19
19
  * The DecoratorSingleButton groups a key/value pair to behave like a button.
20
+ * @deprecated This component is deprecated
20
21
  */
21
22
  var DecoratorSingleButton = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
22
23
  var validProps = prepareProps(props, ['href', 'kind', 'onClickLabel', 'onClickValue', 'onContextMenuLabel', 'onContextMenuValue']);
@@ -26,6 +27,10 @@ var DecoratorSingleButton = /*#__PURE__*/React__default.forwardRef(function (pro
26
27
  kind: "single-button"
27
28
  }, getDevtoolsProps(componentName)));
28
29
  });
30
+ DecoratorSingleButton.deprecated = {
31
+ level: 'warn',
32
+ details: "This component is deprecated"
33
+ };
29
34
 
30
35
  // Return a placeholder if not released and not enabled by feature flag
31
36
  DecoratorSingleButton = pkg.checkComponentEnabled(DecoratorSingleButton, componentName);
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Type layouts provide an orderly layout of terms and definitions.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let DescriptionList: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -39,6 +39,7 @@ var defaults = {
39
39
 
40
40
  /**
41
41
  * Type layouts provide an orderly layout of terms and definitions.
42
+ * @deprecated This component is deprecated
42
43
  */
43
44
  var DescriptionList = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
44
45
  var _ref$border = _ref.border,
@@ -58,6 +59,10 @@ var DescriptionList = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
58
59
  selection: false
59
60
  }, children));
60
61
  });
62
+ DescriptionList.deprecated = {
63
+ level: 'warn',
64
+ details: "This component is deprecated"
65
+ };
61
66
 
62
67
  // Return a placeholder if not released and not enabled by feature flag
63
68
  DescriptionList = pkg.checkComponentEnabled(DescriptionList, componentName);
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @deprecated This component is deprecated
3
+ */
1
4
  export let Nav: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
5
  export default Nav;
3
6
  import React from 'react';
@@ -17,6 +17,10 @@ import { pkg } from '../../settings.js';
17
17
  var _excluded = ["activeHref", "className", "children", "heading", "label"];
18
18
  var componentName = 'Nav';
19
19
  var blockClass = "".concat(pkg.prefix, "--nav");
20
+
21
+ /**
22
+ * @deprecated This component is deprecated
23
+ */
20
24
  var Nav = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
21
25
  var activeHref = _ref.activeHref,
22
26
  className = _ref.className,
@@ -121,6 +125,10 @@ var Nav = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
121
125
  return (child === null || child === void 0 || (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === NavList.displayName ? buildNewListChild(child, index) : buildNewItemChild(child, index);
122
126
  })));
123
127
  });
128
+ Nav.deprecated = {
129
+ level: 'warn',
130
+ details: "This component is deprecated"
131
+ };
124
132
  Nav.propTypes = {
125
133
  /**
126
134
  * Hypertext reference for active page.
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * A list of icon/description pairs used to show multiple states of progress.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let StatusIndicator: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -27,6 +27,7 @@ var defaults = {
27
27
 
28
28
  /**
29
29
  * A list of icon/description pairs used to show multiple states of progress.
30
+ * @deprecated This component is deprecated
30
31
  */
31
32
  var StatusIndicator = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
32
33
  var children = _ref.children,
@@ -57,6 +58,10 @@ var StatusIndicator = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
57
58
  }
58
59
  }, retryLabel));
59
60
  });
61
+ StatusIndicator.deprecated = {
62
+ level: 'warn',
63
+ details: "This component is deprecated"
64
+ };
60
65
 
61
66
  // Return a placeholder if not released and not enabled by feature flag
62
67
  StatusIndicator = pkg.checkComponentEnabled(StatusIndicator, componentName);
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * An icon/description pair that describes one step of the `StatusIndicator`.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let StatusIndicatorStep: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -26,6 +26,7 @@ var defaults = {
26
26
 
27
27
  /**
28
28
  * An icon/description pair that describes one step of the `StatusIndicator`.
29
+ * @deprecated This component is deprecated
29
30
  */
30
31
  var StatusIndicatorStep = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
31
32
  var className = _ref.className,
@@ -54,6 +55,10 @@ var StatusIndicatorStep = /*#__PURE__*/React__default.forwardRef(function (_ref,
54
55
  className: "".concat(blockClass, "__error-message")
55
56
  }, errorMessage));
56
57
  });
58
+ StatusIndicatorStep.deprecated = {
59
+ level: 'warn',
60
+ details: "This component is deprecated"
61
+ };
57
62
 
58
63
  // Return a placeholder if not released and not enabled by feature flag
59
64
  StatusIndicatorStep = pkg.checkComponentEnabled(StatusIndicatorStep, componentName);
@@ -18,7 +18,7 @@ import { Button, usePrefix, unstable_FeatureFlags, ComposedModal, ModalHeader, L
18
18
  import { ActionSet } from '../ActionSet/ActionSet.js';
19
19
  import { Wrap } from '../../global/js/utils/Wrap.js';
20
20
  import { usePortalTarget } from '../../global/js/hooks/usePortalTarget.js';
21
- import { useFocus, getSpecificElement } from '../../global/js/hooks/useFocus.js';
21
+ import { useFocus, claimFocus } from '../../global/js/hooks/useFocus.js';
22
22
  import { usePreviousValue } from '../../global/js/hooks/usePreviousValue.js';
23
23
 
24
24
  var _excluded = ["actions", "aiLabel", "ariaLabel", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "portalTarget", "selectorPrimaryFocus", "selectorsFloatingMenus", "size", "slug", "title", "verticalPosition", "launcherButtonRef"];
@@ -146,33 +146,12 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
146
146
 
147
147
  // Callback to give the tearsheet the opportunity to claim focus
148
148
  handleStackChange.claimFocus = function () {
149
- if (selectorPrimaryFocus && getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus)) {
150
- var _window;
151
- var specifiedEl = getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
152
- if (specifiedEl && ((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(specifiedEl)) === null || _window === void 0 ? void 0 : _window.display) !== 'none') {
153
- return specifiedEl.focus();
154
- }
155
- }
156
- setTimeout(function () {
157
- return firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
158
- }, 0);
149
+ claimFocus(firstElement, modalRef, selectorPrimaryFocus);
159
150
  };
160
151
  useEffect(function () {
161
152
  if (open) {
162
153
  // Focusing the first element or selectorPrimaryFocus element
163
- if (selectorPrimaryFocus && getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus)) {
164
- var _window2;
165
- var specifiedEl = getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
166
- if (specifiedEl && ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.getComputedStyle(specifiedEl)) === null || _window2 === void 0 ? void 0 : _window2.display) !== 'none') {
167
- setTimeout(function () {
168
- return specifiedEl.focus();
169
- }, 0);
170
- return;
171
- }
172
- }
173
- setTimeout(function () {
174
- return firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
175
- }, 0);
154
+ claimFocus(firstElement, modalRef, selectorPrimaryFocus);
176
155
  }
177
156
  }, [firstElement, modalRef, open, selectorPrimaryFocus]);
178
157
  useEffect(function () {
@@ -12,3 +12,4 @@ export function useFocus(modalRef: any, selectorPrimaryFocus: any): {
12
12
  specified: any;
13
13
  };
14
14
  };
15
+ export function claimFocus(firstElement: any, modalRef: any, selectorPrimaryFocus?: string | undefined): any;
@@ -104,4 +104,24 @@ var useFocus = function useFocus(modalRef, selectorPrimaryFocus) {
104
104
  };
105
105
  };
106
106
 
107
- export { getSpecificElement, useFocus };
107
+ /**
108
+ *
109
+ * @param {*} firstElement
110
+ * @param {*} modalRef
111
+ * @param {string | undefined} selectorPrimaryFocus
112
+ */
113
+ var claimFocus = function claimFocus(firstElement, modalRef) {
114
+ var selectorPrimaryFocus = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
115
+ if (selectorPrimaryFocus && getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus)) {
116
+ var _window2;
117
+ var specifiedEl = getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
118
+ if (specifiedEl && ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.getComputedStyle(specifiedEl)) === null || _window2 === void 0 ? void 0 : _window2.display) !== 'none') {
119
+ return specifiedEl.focus();
120
+ }
121
+ }
122
+ setTimeout(function () {
123
+ return firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
124
+ }, 0);
125
+ };
126
+
127
+ export { claimFocus, getSpecificElement, useFocus };
@@ -131,19 +131,7 @@ exports.APIKeyModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
131
131
  React.useEffect(function () {
132
132
  if (open) {
133
133
  // Focusing the first element or selectorPrimaryFocus element
134
- if (selectorPrimaryFocus && useFocus.getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus)) {
135
- var _window;
136
- var specifiedEl = useFocus.getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
137
- if (specifiedEl && ((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(specifiedEl)) === null || _window === void 0 ? void 0 : _window.display) !== 'none') {
138
- setTimeout(function () {
139
- return specifiedEl.focus();
140
- }, 0);
141
- return;
142
- }
143
- }
144
- setTimeout(function () {
145
- firstElement === null || firstElement === void 0 || firstElement.focus();
146
- }, 0);
134
+ useFocus.claimFocus(firstElement, modalRef, selectorPrimaryFocus);
147
135
  }
148
136
  }, [firstElement, modalRef, open, selectorPrimaryFocus]);
149
137
  React.useEffect(function () {
@@ -64,12 +64,9 @@ exports.AboutModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
64
64
  }, [bodyRef]);
65
65
  React.useEffect(function () {
66
66
  if (open) {
67
- setTimeout(function () {
68
- return firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
69
- }, 0);
67
+ useFocus.claimFocus(firstElement, modalRef);
70
68
  }
71
- // eslint-disable-next-line react-hooks/exhaustive-deps
72
- }, [open]);
69
+ }, [firstElement, modalRef, open]);
73
70
  return renderPortalUse( /*#__PURE__*/React.createElement(react.unstable_FeatureFlags, {
74
71
  enableExperimentalFocusWrapWithoutSentinels: true
75
72
  }, /*#__PURE__*/React.createElement(react.ComposedModal, _rollupPluginBabelHelpers.extends({}, rest, {
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * The DecoratorDualButton groups a key/value pair where the key and value each behave like a button.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let DecoratorDualButton: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -19,6 +19,7 @@ var componentName = 'DecoratorDualButton';
19
19
 
20
20
  /**
21
21
  * The DecoratorDualButton groups a key/value pair where the key and value each behave like a button.
22
+ * @deprecated This component is deprecated
22
23
  */
23
24
  exports.DecoratorDualButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
24
25
  var validProps = propsHelper.prepareProps(props, ['href', 'kind', 'onClick', 'onContextMenu']);
@@ -28,6 +29,10 @@ exports.DecoratorDualButton = /*#__PURE__*/React.forwardRef(function (props, ref
28
29
  kind: "dual-button"
29
30
  }, devtools.getDevtoolsProps(componentName)));
30
31
  });
32
+ exports.DecoratorDualButton.deprecated = {
33
+ level: 'warn',
34
+ details: "This component is deprecated"
35
+ };
31
36
 
32
37
  // Return a placeholder if not released and not enabled by feature flag
33
38
  exports.DecoratorDualButton = settings.pkg.checkComponentEnabled(exports.DecoratorDualButton, componentName);
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * The DecoratorLink groups a key/value pair to behave like a link.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let DecoratorLink: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -19,6 +19,7 @@ var componentName = 'DecoratorLink';
19
19
 
20
20
  /**
21
21
  * The DecoratorLink groups a key/value pair to behave like a link.
22
+ * @deprecated This component is deprecated
22
23
  */
23
24
  exports.DecoratorLink = /*#__PURE__*/React.forwardRef(function (props, ref) {
24
25
  var validProps = propsHelper.prepareProps(props, ['disabled', 'kind', 'onClickLabel', 'onClickValue', 'onContextMenuLabel', 'onContextMenuValue']);
@@ -28,6 +29,10 @@ exports.DecoratorLink = /*#__PURE__*/React.forwardRef(function (props, ref) {
28
29
  kind: "link"
29
30
  }, devtools.getDevtoolsProps(componentName)));
30
31
  });
32
+ exports.DecoratorLink.deprecated = {
33
+ level: 'warn',
34
+ details: "This component is deprecated"
35
+ };
31
36
 
32
37
  // Return a placeholder if not released and not enabled by feature flag
33
38
  exports.DecoratorLink = settings.pkg.checkComponentEnabled(exports.DecoratorLink, componentName);
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * The DecoratorSingleButton groups a key/value pair to behave like a button.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let DecoratorSingleButton: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -19,6 +19,7 @@ var componentName = 'DecoratorSingleButton';
19
19
 
20
20
  /**
21
21
  * The DecoratorSingleButton groups a key/value pair to behave like a button.
22
+ * @deprecated This component is deprecated
22
23
  */
23
24
  exports.DecoratorSingleButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
24
25
  var validProps = propsHelper.prepareProps(props, ['href', 'kind', 'onClickLabel', 'onClickValue', 'onContextMenuLabel', 'onContextMenuValue']);
@@ -28,6 +29,10 @@ exports.DecoratorSingleButton = /*#__PURE__*/React.forwardRef(function (props, r
28
29
  kind: "single-button"
29
30
  }, devtools.getDevtoolsProps(componentName)));
30
31
  });
32
+ exports.DecoratorSingleButton.deprecated = {
33
+ level: 'warn',
34
+ details: "This component is deprecated"
35
+ };
31
36
 
32
37
  // Return a placeholder if not released and not enabled by feature flag
33
38
  exports.DecoratorSingleButton = settings.pkg.checkComponentEnabled(exports.DecoratorSingleButton, componentName);
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Type layouts provide an orderly layout of terms and definitions.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let DescriptionList: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -41,6 +41,7 @@ var defaults = {
41
41
 
42
42
  /**
43
43
  * Type layouts provide an orderly layout of terms and definitions.
44
+ * @deprecated This component is deprecated
44
45
  */
45
46
  exports.DescriptionList = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
46
47
  var _ref$border = _ref.border,
@@ -60,6 +61,10 @@ exports.DescriptionList = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
60
61
  selection: false
61
62
  }, children));
62
63
  });
64
+ exports.DescriptionList.deprecated = {
65
+ level: 'warn',
66
+ details: "This component is deprecated"
67
+ };
63
68
 
64
69
  // Return a placeholder if not released and not enabled by feature flag
65
70
  exports.DescriptionList = settings.pkg.checkComponentEnabled(exports.DescriptionList, componentName);
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @deprecated This component is deprecated
3
+ */
1
4
  export let Nav: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
5
  export default Nav;
3
6
  import React from 'react';
@@ -19,6 +19,10 @@ var settings = require('../../settings.js');
19
19
  var _excluded = ["activeHref", "className", "children", "heading", "label"];
20
20
  var componentName = 'Nav';
21
21
  var blockClass = "".concat(settings.pkg.prefix, "--nav");
22
+
23
+ /**
24
+ * @deprecated This component is deprecated
25
+ */
22
26
  exports.Nav = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
23
27
  var activeHref = _ref.activeHref,
24
28
  className = _ref.className,
@@ -123,6 +127,10 @@ exports.Nav = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
123
127
  return (child === null || child === void 0 || (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === NavList.default.displayName ? buildNewListChild(child, index) : buildNewItemChild(child, index);
124
128
  })));
125
129
  });
130
+ exports.Nav.deprecated = {
131
+ level: 'warn',
132
+ details: "This component is deprecated"
133
+ };
126
134
  exports.Nav.propTypes = {
127
135
  /**
128
136
  * Hypertext reference for active page.
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * A list of icon/description pairs used to show multiple states of progress.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let StatusIndicator: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -29,6 +29,7 @@ var defaults = {
29
29
 
30
30
  /**
31
31
  * A list of icon/description pairs used to show multiple states of progress.
32
+ * @deprecated This component is deprecated
32
33
  */
33
34
  exports.StatusIndicator = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
34
35
  var children = _ref.children,
@@ -59,6 +60,10 @@ exports.StatusIndicator = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
59
60
  }
60
61
  }, retryLabel));
61
62
  });
63
+ exports.StatusIndicator.deprecated = {
64
+ level: 'warn',
65
+ details: "This component is deprecated"
66
+ };
62
67
 
63
68
  // Return a placeholder if not released and not enabled by feature flag
64
69
  exports.StatusIndicator = settings.pkg.checkComponentEnabled(exports.StatusIndicator, componentName);
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * An icon/description pair that describes one step of the `StatusIndicator`.
3
+ * @deprecated This component is deprecated
3
4
  */
4
5
  export let StatusIndicatorStep: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
6
  import React from 'react';
@@ -28,6 +28,7 @@ var defaults = {
28
28
 
29
29
  /**
30
30
  * An icon/description pair that describes one step of the `StatusIndicator`.
31
+ * @deprecated This component is deprecated
31
32
  */
32
33
  exports.StatusIndicatorStep = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
33
34
  var className = _ref.className,
@@ -56,6 +57,10 @@ exports.StatusIndicatorStep = /*#__PURE__*/React.forwardRef(function (_ref, ref)
56
57
  className: "".concat(blockClass, "__error-message")
57
58
  }, errorMessage));
58
59
  });
60
+ exports.StatusIndicatorStep.deprecated = {
61
+ level: 'warn',
62
+ details: "This component is deprecated"
63
+ };
59
64
 
60
65
  // Return a placeholder if not released and not enabled by feature flag
61
66
  exports.StatusIndicatorStep = settings.pkg.checkComponentEnabled(exports.StatusIndicatorStep, componentName);
@@ -148,33 +148,12 @@ var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
148
148
 
149
149
  // Callback to give the tearsheet the opportunity to claim focus
150
150
  handleStackChange.claimFocus = function () {
151
- if (selectorPrimaryFocus && useFocus.getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus)) {
152
- var _window;
153
- var specifiedEl = useFocus.getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
154
- if (specifiedEl && ((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(specifiedEl)) === null || _window === void 0 ? void 0 : _window.display) !== 'none') {
155
- return specifiedEl.focus();
156
- }
157
- }
158
- setTimeout(function () {
159
- return firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
160
- }, 0);
151
+ useFocus.claimFocus(firstElement, modalRef, selectorPrimaryFocus);
161
152
  };
162
153
  React.useEffect(function () {
163
154
  if (open) {
164
155
  // Focusing the first element or selectorPrimaryFocus element
165
- if (selectorPrimaryFocus && useFocus.getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus)) {
166
- var _window2;
167
- var specifiedEl = useFocus.getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
168
- if (specifiedEl && ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.getComputedStyle(specifiedEl)) === null || _window2 === void 0 ? void 0 : _window2.display) !== 'none') {
169
- setTimeout(function () {
170
- return specifiedEl.focus();
171
- }, 0);
172
- return;
173
- }
174
- }
175
- setTimeout(function () {
176
- return firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
177
- }, 0);
156
+ useFocus.claimFocus(firstElement, modalRef, selectorPrimaryFocus);
178
157
  }
179
158
  }, [firstElement, modalRef, open, selectorPrimaryFocus]);
180
159
  React.useEffect(function () {
@@ -12,3 +12,4 @@ export function useFocus(modalRef: any, selectorPrimaryFocus: any): {
12
12
  specified: any;
13
13
  };
14
14
  };
15
+ export function claimFocus(firstElement: any, modalRef: any, selectorPrimaryFocus?: string | undefined): any;
@@ -106,5 +106,26 @@ var useFocus = function useFocus(modalRef, selectorPrimaryFocus) {
106
106
  };
107
107
  };
108
108
 
109
+ /**
110
+ *
111
+ * @param {*} firstElement
112
+ * @param {*} modalRef
113
+ * @param {string | undefined} selectorPrimaryFocus
114
+ */
115
+ var claimFocus = function claimFocus(firstElement, modalRef) {
116
+ var selectorPrimaryFocus = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
117
+ if (selectorPrimaryFocus && getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus)) {
118
+ var _window2;
119
+ var specifiedEl = getSpecificElement(modalRef === null || modalRef === void 0 ? void 0 : modalRef.current, selectorPrimaryFocus);
120
+ if (specifiedEl && ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.getComputedStyle(specifiedEl)) === null || _window2 === void 0 ? void 0 : _window2.display) !== 'none') {
121
+ return specifiedEl.focus();
122
+ }
123
+ }
124
+ setTimeout(function () {
125
+ return firstElement === null || firstElement === void 0 ? void 0 : firstElement.focus();
126
+ }, 0);
127
+ };
128
+
129
+ exports.claimFocus = claimFocus;
109
130
  exports.getSpecificElement = getSpecificElement;
110
131
  exports.useFocus = useFocus;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products",
3
3
  "description": "Carbon for IBM Products",
4
- "version": "2.54.0-canary.28+5fb804a6e",
4
+ "version": "2.54.0-canary.31+0cf0f70e0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -120,5 +120,5 @@
120
120
  "react": "^16.8.6 || ^17.0.1 || ^18.2.0",
121
121
  "react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
122
122
  },
123
- "gitHead": "5fb804a6e7ffc3b139e2bd6f9541922473b2279c"
123
+ "gitHead": "0cf0f70e0987b59b5c98b159bc67a4a82f26aa3a"
124
124
  }