@carbon/react 1.46.1-rc.0 → 1.47.0-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.
Files changed (101) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +933 -899
  2. package/es/components/Accordion/AccordionItem.js +3 -1
  3. package/es/components/ContentSwitcher/index.d.ts +11 -0
  4. package/es/components/DataTable/TableExpandRow.d.ts +1 -1
  5. package/es/components/DataTable/TableHeader.d.ts +1 -1
  6. package/es/components/ErrorBoundary/ErrorBoundary.d.ts +47 -0
  7. package/es/components/ErrorBoundary/ErrorBoundary.js +2 -0
  8. package/es/components/ErrorBoundary/ErrorBoundaryContext.d.ts +11 -0
  9. package/es/components/ErrorBoundary/index.d.ts +8 -0
  10. package/es/components/FeatureFlags/index.js +2 -2
  11. package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +3 -2
  12. package/es/components/InlineCheckbox/InlineCheckbox.js +8 -1
  13. package/es/components/ModalWrapper/ModalWrapper.d.ts +75 -0
  14. package/es/components/ModalWrapper/ModalWrapper.js +15 -14
  15. package/es/components/ModalWrapper/index.d.ts +9 -0
  16. package/es/components/OverflowMenu/OverflowMenu.js +1 -1
  17. package/es/components/PrimaryButton/PrimaryButton.d.ts +10 -0
  18. package/es/components/PrimaryButton/PrimaryButton.js +1 -2
  19. package/es/components/PrimaryButton/index.d.ts +9 -0
  20. package/es/components/ProgressBar/ProgressBar.d.ts +88 -0
  21. package/es/components/ProgressBar/ProgressBar.js +13 -11
  22. package/es/components/ProgressBar/index.d.ts +9 -0
  23. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts +33 -0
  24. package/es/components/ProgressIndicator/ProgressIndicator.d.ts +179 -0
  25. package/es/components/ProgressIndicator/ProgressIndicator.js +4 -6
  26. package/es/components/ProgressIndicator/index.d.ts +8 -0
  27. package/es/components/Search/Search.js +3 -2
  28. package/es/components/SecondaryButton/SecondaryButton.d.ts +10 -0
  29. package/es/components/SecondaryButton/SecondaryButton.js +1 -2
  30. package/es/components/SecondaryButton/index.d.ts +9 -0
  31. package/es/components/SkeletonIcon/SkeletonIcon.js +1 -2
  32. package/es/components/SkeletonIcon/index.d.ts +9 -0
  33. package/es/components/Slider/Slider.Skeleton.js +1 -2
  34. package/es/components/Slider/Slider.d.ts +1 -1
  35. package/es/components/Slider/index.d.ts +11 -0
  36. package/es/components/Stack/Stack.d.ts +58 -0
  37. package/es/components/Stack/Stack.js +0 -1
  38. package/es/components/Stack/index.d.ts +11 -0
  39. package/es/components/Switch/Switch.js +1 -2
  40. package/es/components/Switch/index.d.ts +10 -0
  41. package/es/components/TextArea/TextArea.d.ts +5 -0
  42. package/es/components/TextArea/TextArea.js +9 -0
  43. package/es/components/TileGroup/TileGroup.d.ts +83 -0
  44. package/es/components/TileGroup/TileGroup.js +67 -79
  45. package/es/components/Toggle/Toggle.d.ts +1 -1
  46. package/es/components/TreeView/TreeNode.js +3 -0
  47. package/es/components/UIShell/SideNavMenu.js +0 -8
  48. package/es/components/UIShell/SideNavSwitcher.d.ts +1 -1
  49. package/es/index.js +12 -12
  50. package/es/internal/createClassWrapper.d.ts +12 -0
  51. package/es/internal/createClassWrapper.js +0 -3
  52. package/lib/components/Accordion/AccordionItem.js +3 -1
  53. package/lib/components/ContentSwitcher/index.d.ts +11 -0
  54. package/lib/components/DataTable/TableExpandRow.d.ts +1 -1
  55. package/lib/components/DataTable/TableHeader.d.ts +1 -1
  56. package/lib/components/ErrorBoundary/ErrorBoundary.d.ts +47 -0
  57. package/lib/components/ErrorBoundary/ErrorBoundary.js +2 -0
  58. package/lib/components/ErrorBoundary/ErrorBoundaryContext.d.ts +11 -0
  59. package/lib/components/ErrorBoundary/index.d.ts +8 -0
  60. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +3 -2
  61. package/lib/components/InlineCheckbox/InlineCheckbox.js +8 -1
  62. package/lib/components/ModalWrapper/ModalWrapper.d.ts +75 -0
  63. package/lib/components/ModalWrapper/ModalWrapper.js +15 -14
  64. package/lib/components/ModalWrapper/index.d.ts +9 -0
  65. package/lib/components/OverflowMenu/OverflowMenu.js +1 -1
  66. package/lib/components/PrimaryButton/PrimaryButton.d.ts +10 -0
  67. package/lib/components/PrimaryButton/PrimaryButton.js +1 -2
  68. package/lib/components/PrimaryButton/index.d.ts +9 -0
  69. package/lib/components/ProgressBar/ProgressBar.d.ts +88 -0
  70. package/lib/components/ProgressBar/ProgressBar.js +13 -11
  71. package/lib/components/ProgressBar/index.d.ts +9 -0
  72. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.d.ts +33 -0
  73. package/lib/components/ProgressIndicator/ProgressIndicator.d.ts +179 -0
  74. package/lib/components/ProgressIndicator/ProgressIndicator.js +4 -6
  75. package/lib/components/ProgressIndicator/index.d.ts +8 -0
  76. package/lib/components/Search/Search.js +3 -2
  77. package/lib/components/SecondaryButton/SecondaryButton.d.ts +10 -0
  78. package/lib/components/SecondaryButton/SecondaryButton.js +1 -2
  79. package/lib/components/SecondaryButton/index.d.ts +9 -0
  80. package/lib/components/SkeletonIcon/SkeletonIcon.js +1 -2
  81. package/lib/components/SkeletonIcon/index.d.ts +9 -0
  82. package/lib/components/Slider/Slider.Skeleton.js +1 -2
  83. package/lib/components/Slider/Slider.d.ts +1 -1
  84. package/lib/components/Slider/index.d.ts +11 -0
  85. package/lib/components/Stack/Stack.d.ts +58 -0
  86. package/lib/components/Stack/Stack.js +0 -1
  87. package/lib/components/Stack/index.d.ts +11 -0
  88. package/lib/components/Switch/Switch.js +1 -2
  89. package/lib/components/Switch/index.d.ts +10 -0
  90. package/lib/components/TextArea/TextArea.d.ts +5 -0
  91. package/lib/components/TextArea/TextArea.js +9 -0
  92. package/lib/components/TileGroup/TileGroup.d.ts +83 -0
  93. package/lib/components/TileGroup/TileGroup.js +64 -76
  94. package/lib/components/Toggle/Toggle.d.ts +1 -1
  95. package/lib/components/TreeView/TreeNode.js +3 -0
  96. package/lib/components/UIShell/SideNavMenu.js +0 -8
  97. package/lib/components/UIShell/SideNavSwitcher.d.ts +1 -1
  98. package/lib/index.js +25 -25
  99. package/lib/internal/createClassWrapper.d.ts +12 -0
  100. package/lib/internal/createClassWrapper.js +0 -3
  101. package/package.json +6 -5
@@ -15,9 +15,10 @@ var React = require('react');
15
15
  var Modal = require('../Modal/Modal.js');
16
16
  var Button = require('../Button/Button.js');
17
17
  require('../Button/Button.Skeleton.js');
18
- var types = require('../../prop-types/types.js');
19
18
  var warning = require('../../internal/warning.js');
20
19
  var noopFn = require('../../internal/noopFn.js');
20
+ var match = require('../../internal/keyboard/match.js');
21
+ var keys = require('../../internal/keyboard/keys.js');
21
22
 
22
23
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
23
24
 
@@ -39,25 +40,25 @@ class ModalWrapper extends React__default["default"].Component {
39
40
  });
40
41
  });
41
42
  _rollupPluginBabelHelpers.defineProperty(this, "handleClose", evt => {
42
- const innerModal = this.modal.current.querySelector('div');
43
- if (this.modal.current && evt && !innerModal.contains(evt.target) && this.props.preventCloseOnClickOutside) {
43
+ const innerModal = this.modal.current?.querySelector('div');
44
+ if (this.modal.current && evt && !innerModal?.contains(evt.target) && this.props.preventCloseOnClickOutside) {
44
45
  return;
45
46
  } else {
46
47
  this.setState({
47
48
  isOpen: false
48
- }, () => this.triggerButton.current.focus());
49
+ }, () => this.triggerButton.current?.focus());
49
50
  }
50
51
  });
51
- _rollupPluginBabelHelpers.defineProperty(this, "handleOnRequestSubmit", () => {
52
+ _rollupPluginBabelHelpers.defineProperty(this, "handleOnRequestSubmit", evt => {
52
53
  const {
53
54
  handleSubmit,
54
55
  shouldCloseAfterSubmit
55
56
  } = this.props;
56
57
  if (handleSubmit && shouldCloseAfterSubmit) {
57
- handleSubmit();
58
- this.handleClose();
58
+ handleSubmit(evt);
59
+ this.handleClose(evt);
59
60
  }
60
- handleSubmit();
61
+ handleSubmit?.(evt);
61
62
  });
62
63
  }
63
64
  if(__DEV__) {
@@ -77,12 +78,12 @@ class ModalWrapper extends React__default["default"].Component {
77
78
  triggerButtonKind = 'primary',
78
79
  disabled = false,
79
80
  handleSubmit,
80
- // eslint-disable-line no-unused-vars
81
+ // eslint-disable-line @typescript-eslint/no-unused-vars
81
82
  shouldCloseAfterSubmit = true,
82
- // eslint-disable-line no-unused-vars
83
+ // eslint-disable-line @typescript-eslint/no-unused-vars
83
84
  selectorPrimaryFocus = '[data-modal-primary-focus]',
84
85
  preventCloseOnClickOutside = false,
85
- // eslint-disable-line no-unused-vars
86
+ // eslint-disable-line @typescript-eslint/no-unused-vars
86
87
  ...other
87
88
  } = this.props;
88
89
  const props = {
@@ -95,8 +96,8 @@ class ModalWrapper extends React__default["default"].Component {
95
96
  return /*#__PURE__*/React__default["default"].createElement("div", {
96
97
  role: "presentation",
97
98
  onKeyDown: evt => {
98
- if (evt.which === 27) {
99
- this.handleClose();
99
+ if (match.match(evt, keys.Escape)) {
100
+ this.handleClose(evt);
100
101
  onKeyDown(evt);
101
102
  }
102
103
  }
@@ -137,7 +138,7 @@ _rollupPluginBabelHelpers.defineProperty(ModalWrapper, "propTypes", {
137
138
  shouldCloseAfterSubmit: PropTypes__default["default"].bool,
138
139
  status: PropTypes__default["default"].string,
139
140
  triggerButtonIconDescription: PropTypes__default["default"].string,
140
- triggerButtonKind: PropTypes__default["default"].oneOf(types.ButtonKinds),
141
+ triggerButtonKind: PropTypes__default["default"].oneOf(Button.ButtonKinds),
141
142
  withHeader: PropTypes__default["default"].bool
142
143
  });
143
144
 
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import ModalWrapper from './ModalWrapper';
8
+ export default ModalWrapper;
9
+ export { ModalWrapper };
@@ -252,7 +252,7 @@ class OverflowMenu extends React.Component {
252
252
  current: triggerEl
253
253
  } = this._triggerRef;
254
254
  if (typeof target.matches === 'function') {
255
- if (!menuBody.contains(target) && triggerEl && !target.matches(`.${this.context}--overflow-menu,.${this.context}--overflow-menu-options`)) {
255
+ if (!menuBody.contains(target) && triggerEl && !target.matches(`.${this.context}--overflow-menu:first-child,.${this.context}--overflow-menu-options:first-child`)) {
256
256
  this.closeMenuAndFocus();
257
257
  }
258
258
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ import { ButtonProps } from '../Button';
9
+ declare const PrimaryButton: <T extends React.ElementType<any>>(props: ButtonProps<T>) => JSX.Element;
10
+ export default PrimaryButton;
@@ -21,6 +21,5 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
21
  const PrimaryButton = props => /*#__PURE__*/React__default["default"].createElement(Button["default"], _rollupPluginBabelHelpers["extends"]({
22
22
  kind: "primary"
23
23
  }, props));
24
- var PrimaryButton$1 = PrimaryButton;
25
24
 
26
- exports["default"] = PrimaryButton$1;
25
+ exports["default"] = PrimaryButton;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import PrimaryButton from './PrimaryButton';
8
+ export default PrimaryButton;
9
+ export { PrimaryButton };
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Copyright IBM Corp. 2021
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /// <reference types="react" />
8
+ import PropTypes from 'prop-types';
9
+ interface ProgressBarProps {
10
+ /**
11
+ * Additional CSS class names.
12
+ */
13
+ className?: string;
14
+ /**
15
+ * The current progress as a textual representation.
16
+ */
17
+ helperText?: string;
18
+ /**
19
+ * Whether the label should be visually hidden.
20
+ */
21
+ hideLabel?: boolean;
22
+ /**
23
+ * A label describing the progress bar.
24
+ */
25
+ label: string;
26
+ /**
27
+ * The maximum value.
28
+ */
29
+ max?: number;
30
+ /**
31
+ * Specify the size of the progress bar.
32
+ */
33
+ size?: 'small' | 'big';
34
+ /**
35
+ * Specify the status.
36
+ */
37
+ status?: 'active' | 'finished' | 'error';
38
+ /**
39
+ * Defines the alignment variant of the progress bar.
40
+ */
41
+ type?: 'default' | 'inline' | 'indented';
42
+ /**
43
+ * The current value.
44
+ */
45
+ value?: number;
46
+ }
47
+ declare function ProgressBar({ className, helperText, hideLabel, label, max, size, status, type, value, }: ProgressBarProps): JSX.Element;
48
+ declare namespace ProgressBar {
49
+ var propTypes: {
50
+ /**
51
+ * Additional CSS class names.
52
+ */
53
+ className: PropTypes.Requireable<string>;
54
+ /**
55
+ * The current progress as a textual representation.
56
+ */
57
+ helperText: PropTypes.Requireable<string>;
58
+ /**
59
+ * Whether the label should be visually hidden.
60
+ */
61
+ hideLabel: PropTypes.Requireable<boolean>;
62
+ /**
63
+ * A label describing the progress bar.
64
+ */
65
+ label: PropTypes.Validator<string>;
66
+ /**
67
+ * The maximum value.
68
+ */
69
+ max: PropTypes.Requireable<number>;
70
+ /**
71
+ * Specify the size of the ProgressBar.
72
+ */
73
+ size: PropTypes.Requireable<string>;
74
+ /**
75
+ * Specify the status.
76
+ */
77
+ status: PropTypes.Requireable<string>;
78
+ /**
79
+ * Defines the alignment variant of the progress bar.
80
+ */
81
+ type: PropTypes.Requireable<string>;
82
+ /**
83
+ * The current value.
84
+ */
85
+ value: PropTypes.Requireable<number>;
86
+ };
87
+ }
88
+ export default ProgressBar;
@@ -44,10 +44,10 @@ function ProgressBar(_ref) {
44
44
  const isError = status === 'error';
45
45
  const indeterminate = !isFinished && !isError && (value === null || value === undefined);
46
46
  let cappedValue = value;
47
- if (cappedValue > max) {
47
+ if (cappedValue && cappedValue > max) {
48
48
  cappedValue = max;
49
49
  }
50
- if (cappedValue < 0) {
50
+ if (cappedValue && cappedValue < 0) {
51
51
  cappedValue = 0;
52
52
  }
53
53
  if (isError) {
@@ -55,7 +55,7 @@ function ProgressBar(_ref) {
55
55
  } else if (isFinished) {
56
56
  cappedValue = max;
57
57
  }
58
- const percentage = cappedValue / max;
58
+ const percentage = (cappedValue ?? NaN) / max;
59
59
  const wrapperClasses = cx__default["default"](`${prefix}--progress-bar`, `${prefix}--progress-bar--${size}`, `${prefix}--progress-bar--${type}`, {
60
60
  [`${prefix}--progress-bar--indeterminate`]: indeterminate,
61
61
  [`${prefix}--progress-bar--finished`]: isFinished,
@@ -80,12 +80,14 @@ function ProgressBar(_ref) {
80
80
  }, props));
81
81
  });
82
82
  }
83
- const ref = React.useRef();
83
+ const ref = React.useRef(null);
84
84
  useIsomorphicEffect["default"](() => {
85
- if (!isFinished && !isError) {
86
- ref.current.style.transform = `scaleX(${percentage})`;
87
- } else {
88
- ref.current.style.transform = null;
85
+ if (ref.current) {
86
+ if (!isFinished && !isError) {
87
+ ref.current.style.transform = `scaleX(${percentage})`;
88
+ } else {
89
+ ref.current.style.transform = '';
90
+ }
89
91
  }
90
92
  }, [percentage, isFinished, isError]);
91
93
  return /*#__PURE__*/React__default["default"].createElement("div", {
@@ -104,9 +106,9 @@ function ProgressBar(_ref) {
104
106
  "aria-invalid": isError,
105
107
  "aria-labelledby": labelId,
106
108
  "aria-describedby": helperText ? helperTextId : undefined,
107
- "aria-valuemin": !indeterminate ? 0 : null,
108
- "aria-valuemax": !indeterminate ? max : null,
109
- "aria-valuenow": !indeterminate ? cappedValue : null
109
+ "aria-valuemin": !indeterminate ? 0 : undefined,
110
+ "aria-valuemax": !indeterminate ? max : undefined,
111
+ "aria-valuenow": !indeterminate ? cappedValue : undefined
110
112
  }, /*#__PURE__*/React__default["default"].createElement("div", {
111
113
  className: `${prefix}--progress-bar__bar`,
112
114
  ref: ref
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2021
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import ProgressBar from './ProgressBar';
8
+ export default ProgressBar;
9
+ export { ProgressBar };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /// <reference types="react" />
8
+ import PropTypes from 'prop-types';
9
+ interface ProgressIndicatorSkeletonProps {
10
+ /**
11
+ * Specify an optional className to add.
12
+ */
13
+ className?: string;
14
+ /**
15
+ * Determines whether or not the ProgressIndicator should be rendered vertically.
16
+ */
17
+ vertical?: boolean;
18
+ }
19
+ declare function ProgressIndicatorSkeleton({ className, vertical, ...rest }: ProgressIndicatorSkeletonProps): JSX.Element;
20
+ declare namespace ProgressIndicatorSkeleton {
21
+ var propTypes: {
22
+ /**
23
+ * Specify an optional className to add.
24
+ */
25
+ className: PropTypes.Requireable<string>;
26
+ /**
27
+ * Determines whether or not the ProgressIndicator should be rendered vertically.
28
+ */
29
+ vertical: PropTypes.Requireable<boolean>;
30
+ };
31
+ }
32
+ export default ProgressIndicatorSkeleton;
33
+ export { ProgressIndicatorSkeleton };
@@ -0,0 +1,179 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import PropTypes from 'prop-types';
8
+ import React from 'react';
9
+ interface ProgressIndicatorProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onChange'> {
10
+ /**
11
+ * Provide `<ProgressStep>` components to be rendered in the
12
+ * `<ProgressIndicator>`
13
+ */
14
+ children?: React.ReactNode;
15
+ /**
16
+ * Provide an optional className to be applied to the containing node
17
+ */
18
+ className?: string;
19
+ /**
20
+ * Optionally specify the current step array index
21
+ */
22
+ currentIndex?: number;
23
+ /**
24
+ * Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
25
+ */
26
+ onChange?: (data: number) => void;
27
+ /**
28
+ * Specify whether the progress steps should be split equally in size in the div
29
+ */
30
+ spaceEqually?: boolean;
31
+ /**
32
+ * Determines whether or not the ProgressIndicator should be rendered vertically.
33
+ */
34
+ vertical?: boolean;
35
+ }
36
+ declare function ProgressIndicator({ children, className: customClassName, currentIndex: controlledIndex, onChange, spaceEqually, vertical, ...rest }: ProgressIndicatorProps): JSX.Element;
37
+ declare namespace ProgressIndicator {
38
+ var propTypes: {
39
+ /**
40
+ * Provide `<ProgressStep>` components to be rendered in the
41
+ * `<ProgressIndicator>`
42
+ */
43
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
44
+ /**
45
+ * Provide an optional className to be applied to the containing node
46
+ */
47
+ className: PropTypes.Requireable<string>;
48
+ /**
49
+ * Optionally specify the current step array index
50
+ */
51
+ currentIndex: PropTypes.Requireable<number>;
52
+ /**
53
+ * Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
54
+ */
55
+ onChange: PropTypes.Requireable<(...args: any[]) => any>;
56
+ /**
57
+ * Specify whether the progress steps should be split equally in size in the div
58
+ */
59
+ spaceEqually: PropTypes.Requireable<boolean>;
60
+ /**
61
+ * Determines whether or not the ProgressIndicator should be rendered vertically.
62
+ */
63
+ vertical: PropTypes.Requireable<boolean>;
64
+ };
65
+ }
66
+ interface ProgressStepProps {
67
+ /**
68
+ * Provide an optional className to be applied to the containing `<li>` node
69
+ */
70
+ className?: string;
71
+ /**
72
+ * Specify whether the step has been completed
73
+ */
74
+ complete?: boolean;
75
+ /**
76
+ * Specify whether the step is the current step
77
+ */
78
+ current?: boolean;
79
+ /**
80
+ * Provide a description for the `<ProgressStep>`
81
+ */
82
+ description?: string;
83
+ /**
84
+ * Specify whether the step is disabled
85
+ */
86
+ disabled?: boolean;
87
+ /**
88
+ * Index of the current step within the ProgressIndicator
89
+ */
90
+ index?: number;
91
+ /**
92
+ * Specify whether the step is invalid
93
+ */
94
+ invalid?: boolean;
95
+ /**
96
+ * Provide the label for the `<ProgressStep>`
97
+ */
98
+ label: string;
99
+ /**
100
+ * A callback called if the step is clicked or the enter key is pressed
101
+ */
102
+ onClick?: (event: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>) => void;
103
+ /**
104
+ * Provide the props that describe a progress step tooltip
105
+ */
106
+ overflowTooltipProps?: object;
107
+ /**
108
+ * Provide an optional secondary label
109
+ */
110
+ secondaryLabel?: string;
111
+ /**
112
+ * The ID of the tooltip content.
113
+ */
114
+ tooltipId?: string;
115
+ /**
116
+ * Optional method that takes in a message id and returns an
117
+ * internationalized string.
118
+ */
119
+ translateWithId?: (id: string) => string;
120
+ }
121
+ declare function ProgressStep({ label, description, className, current, complete, invalid, secondaryLabel, disabled, onClick, translateWithId: t, ...rest }: ProgressStepProps): JSX.Element;
122
+ declare namespace ProgressStep {
123
+ var propTypes: {
124
+ /**
125
+ * Provide an optional className to be applied to the containing `<li>` node
126
+ */
127
+ className: PropTypes.Requireable<string>;
128
+ /**
129
+ * Specify whether the step has been completed
130
+ */
131
+ complete: PropTypes.Requireable<boolean>;
132
+ /**
133
+ * Specify whether the step is the current step
134
+ */
135
+ current: PropTypes.Requireable<boolean>;
136
+ /**
137
+ * Provide a description for the `<ProgressStep>`
138
+ */
139
+ description: PropTypes.Requireable<string>;
140
+ /**
141
+ * Specify whether the step is disabled
142
+ */
143
+ disabled: PropTypes.Requireable<boolean>;
144
+ /**
145
+ * Index of the current step within the ProgressIndicator
146
+ */
147
+ index: PropTypes.Requireable<number>;
148
+ /**
149
+ * Specify whether the step is invalid
150
+ */
151
+ invalid: PropTypes.Requireable<boolean>;
152
+ /**
153
+ * Provide the label for the `<ProgressStep>`
154
+ */
155
+ label: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
156
+ /**
157
+ * A callback called if the step is clicked or the enter key is pressed
158
+ */
159
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
160
+ /**
161
+ * Provide the props that describe a progress step tooltip
162
+ */
163
+ overflowTooltipProps: PropTypes.Requireable<object>;
164
+ /**
165
+ * Provide an optional secondary label
166
+ */
167
+ secondaryLabel: PropTypes.Requireable<string>;
168
+ /**
169
+ * The ID of the tooltip content.
170
+ */
171
+ tooltipId: PropTypes.Requireable<string>;
172
+ /**
173
+ * Optional method that takes in a message id and returns an
174
+ * internationalized string.
175
+ */
176
+ translateWithId: PropTypes.Requireable<(...args: any[]) => any>;
177
+ };
178
+ }
179
+ export { ProgressIndicator, ProgressStep };
@@ -52,7 +52,7 @@ function ProgressIndicator(_ref) {
52
52
  [`${prefix}--progress`]: true,
53
53
  [`${prefix}--progress--vertical`]: vertical,
54
54
  [`${prefix}--progress--space-equal`]: spaceEqually && !vertical,
55
- [customClassName]: customClassName
55
+ [customClassName ?? '']: customClassName
56
56
  });
57
57
  if (controlledIndex !== prevControlledIndex) {
58
58
  setCurrentIndex(controlledIndex);
@@ -140,15 +140,13 @@ function ProgressStep(_ref2) {
140
140
  [`${prefix}--progress-step--complete`]: complete,
141
141
  [`${prefix}--progress-step--incomplete`]: !complete && !current,
142
142
  [`${prefix}--progress-step--disabled`]: disabled,
143
- [className]: className
143
+ [className ?? '']: className
144
144
  });
145
145
  const handleKeyDown = e => {
146
- if (match.matches(e, [keys.Enter, keys.Space])) {
147
- onClick();
146
+ if (match.matches(e, [keys.Enter, keys.Space]) && onClick) {
147
+ onClick(e);
148
148
  }
149
149
  };
150
-
151
- // eslint-disable-next-line react/prop-types
152
150
  const SVGIcon = _ref3 => {
153
151
  let {
154
152
  complete,
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export { default as ProgressIndicatorSkeleton } from './ProgressIndicator.Skeleton';
8
+ export * from './ProgressIndicator';
@@ -130,14 +130,15 @@ const Search = /*#__PURE__*/React__default["default"].forwardRef(function Search
130
130
  "aria-label": placeholder,
131
131
  className: searchClasses
132
132
  }, /*#__PURE__*/React__default["default"].createElement("div", {
133
+ "aria-label": "button",
133
134
  "aria-labelledby": onExpand ? uniqueId : undefined,
134
- role: onExpand ? 'button' : undefined,
135
+ role: "button",
135
136
  className: `${prefix}--search-magnifier`,
136
137
  onClick: onExpand,
137
138
  onKeyDown: handleExpandButtonKeyDown,
138
139
  tabIndex: onExpand && !isExpanded ? 0 : -1,
139
140
  ref: expandButtonRef,
140
- "aria-expanded": onExpand && isExpanded ? true : undefined,
141
+ "aria-expanded": onExpand && isExpanded ? true : false,
141
142
  "aria-controls": onExpand ? uniqueId : undefined
142
143
  }, /*#__PURE__*/React__default["default"].createElement(CustomSearchIcon, {
143
144
  icon: renderIcon
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ import { ButtonProps } from '../Button';
9
+ declare const SecondaryButton: <T extends React.ElementType<any>>(props: ButtonProps<T>) => JSX.Element;
10
+ export default SecondaryButton;
@@ -21,6 +21,5 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
21
  const SecondaryButton = props => /*#__PURE__*/React__default["default"].createElement(Button["default"], _rollupPluginBabelHelpers["extends"]({
22
22
  kind: "secondary"
23
23
  }, props));
24
- var SecondaryButton$1 = SecondaryButton;
25
24
 
26
- exports["default"] = SecondaryButton$1;
25
+ exports["default"] = SecondaryButton;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import SecondaryButton from './SecondaryButton';
8
+ export default SecondaryButton;
9
+ export { SecondaryButton };
@@ -44,6 +44,5 @@ SkeletonIcon.propTypes = {
44
44
  */
45
45
  style: PropTypes__default["default"].object
46
46
  };
47
- var SkeletonIcon$1 = SkeletonIcon;
48
47
 
49
- exports["default"] = SkeletonIcon$1;
48
+ exports["default"] = SkeletonIcon;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import SkeletonIcon from './SkeletonIcon';
8
+ export default SkeletonIcon;
9
+ export { SkeletonIcon };
@@ -88,7 +88,6 @@ SliderSkeleton.propTypes = {
88
88
  */
89
89
  twoHandles: PropTypes__default["default"].bool
90
90
  };
91
- var SliderSkeleton$1 = SliderSkeleton;
92
91
 
93
92
  exports.SliderSkeleton = SliderSkeleton;
94
- exports["default"] = SliderSkeleton$1;
93
+ exports["default"] = SliderSkeleton;
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React, { KeyboardEventHandler, PureComponent } from 'react';
7
+ import React, { type KeyboardEventHandler, PureComponent } from 'react';
8
8
  import PropTypes, { ReactNodeLike } from 'prop-types';
9
9
  /**
10
10
  * Distinguish two handles by lower and upper positions.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /// <reference types="react" />
8
+ declare const Slider: import("react").FunctionComponent<import("./Slider").SliderProps>;
9
+ export { default as SliderSkeleton } from './Slider.Skeleton';
10
+ export default Slider;
11
+ export { Slider };