@carbon/ibm-products 2.66.0 → 2.67.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 (63) hide show
  1. package/README.md +1 -1
  2. package/css/carbon.css +27142 -0
  3. package/css/carbon.css.map +1 -0
  4. package/css/index-full-carbon.css +11 -5
  5. package/css/index-full-carbon.css.map +1 -1
  6. package/css/index-full-carbon.min.css +1 -1
  7. package/css/index-full-carbon.min.css.map +1 -1
  8. package/css/index-without-carbon-released-only.css +11 -5
  9. package/css/index-without-carbon-released-only.css.map +1 -1
  10. package/css/index-without-carbon-released-only.min.css +1 -1
  11. package/css/index-without-carbon-released-only.min.css.map +1 -1
  12. package/css/index-without-carbon.css +11 -5
  13. package/css/index-without-carbon.css.map +1 -1
  14. package/css/index-without-carbon.min.css +1 -1
  15. package/css/index-without-carbon.min.css.map +1 -1
  16. package/css/index.css +11 -5
  17. package/css/index.css.map +1 -1
  18. package/css/index.min.css +1 -1
  19. package/css/index.min.css.map +1 -1
  20. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +14 -14
  21. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +0 -3
  22. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +5 -0
  23. package/es/components/Datagrid/useSelectRows.js +21 -23
  24. package/es/components/EmptyStates/EmptyState.d.ts +9 -8
  25. package/es/components/EmptyStates/EmptyState.js +4 -9
  26. package/es/components/EmptyStates/EmptyStateContent.d.ts +34 -20
  27. package/es/components/EmptyStates/EmptyStateContent.js +12 -14
  28. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +3 -7
  29. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +3 -7
  30. package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +3 -7
  31. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +3 -7
  32. package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +3 -7
  33. package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -1
  34. package/es/components/ImportModal/ImportModal.js +1 -1
  35. package/es/components/OptionsTile/OptionsTile.d.ts +2 -2
  36. package/es/components/OptionsTile/OptionsTile.js +6 -2
  37. package/es/components/PageHeader/PageHeader.js +4 -6
  38. package/es/components/TagSet/TagSet.js +2 -0
  39. package/es/components/Tearsheet/Tearsheet.d.ts +1 -0
  40. package/es/components/Tearsheet/TearsheetNarrow.d.ts +2 -2
  41. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +12 -12
  42. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +0 -3
  43. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +5 -0
  44. package/lib/components/Datagrid/useSelectRows.js +20 -22
  45. package/lib/components/EmptyStates/EmptyState.d.ts +9 -8
  46. package/lib/components/EmptyStates/EmptyState.js +3 -8
  47. package/lib/components/EmptyStates/EmptyStateContent.d.ts +34 -20
  48. package/lib/components/EmptyStates/EmptyStateContent.js +11 -13
  49. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +2 -6
  50. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +2 -6
  51. package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +2 -6
  52. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +2 -6
  53. package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +2 -6
  54. package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -1
  55. package/lib/components/ImportModal/ImportModal.js +1 -1
  56. package/lib/components/OptionsTile/OptionsTile.d.ts +2 -2
  57. package/lib/components/OptionsTile/OptionsTile.js +6 -2
  58. package/lib/components/PageHeader/PageHeader.js +4 -6
  59. package/lib/components/TagSet/TagSet.js +2 -0
  60. package/lib/components/Tearsheet/Tearsheet.d.ts +1 -0
  61. package/lib/components/Tearsheet/TearsheetNarrow.d.ts +2 -2
  62. package/package.json +31 -6
  63. package/scss/components/PageHeader/_page-header.scss +15 -6
@@ -8,6 +8,7 @@ import { type ButtonProps } from '@carbon/react';
8
8
  import React, { PropsWithChildren, ReactNode, RefObject } from 'react';
9
9
  export interface TearsheetAction extends ButtonProps<'button'> {
10
10
  label?: string;
11
+ loading?: boolean;
11
12
  }
12
13
  export interface TearsheetProps extends PropsWithChildren {
13
14
  /**
@@ -4,8 +4,8 @@
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 { ButtonProps } from '@carbon/react';
8
7
  import React, { PropsWithChildren, ReactNode, RefObject } from 'react';
8
+ import { TearsheetAction } from './Tearsheet';
9
9
  export interface TearsheetNarrowProps extends PropsWithChildren {
10
10
  /**
11
11
  * The navigation actions to be shown as buttons in the action area at the
@@ -20,7 +20,7 @@ export interface TearsheetNarrowProps extends PropsWithChildren {
20
20
  *
21
21
  * See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
22
22
  */
23
- actions?: ButtonProps<React.ElementType>[];
23
+ actions?: TearsheetAction[];
24
24
  /**
25
25
  * The aria-label for the tearsheet, which is optional.
26
26
  * if it is not passed, the title will be used as the aria-label.
@@ -46,14 +46,6 @@ const SelectAll = datagridState => {
46
46
  onAllRowSelect
47
47
  } = datagridState;
48
48
  const isFirstColumnStickyLeft = columns[0]?.sticky === 'left' && withStickyColumn;
49
- if (hideSelectAll || radio) {
50
- return /*#__PURE__*/React.createElement("th", {
51
- className: cx(`${blockClass}__head-hidden-select-all`, {
52
- [`${blockClass}__select-all-sticky-left`]: /* istanbul ignore next */
53
- isFirstColumnStickyLeft && Number(windowSize) > 671
54
- })
55
- });
56
- }
57
49
  const getProps = DatagridPagination ? getToggleAllPageRowsSelectedProps : getToggleAllRowsSelectedProps;
58
50
  const {
59
51
  onChange,
@@ -62,7 +54,7 @@ const SelectAll = datagridState => {
62
54
  const {
63
55
  indeterminate
64
56
  } = selectProps;
65
- const handleOnPageSelectAllChange = event => {
57
+ const handleOnPageSelectAllChange = React.useCallback(event => {
66
58
  stateReducer.handleOnPageSelectAllRowData({
67
59
  dispatch,
68
60
  rows,
@@ -72,8 +64,8 @@ const SelectAll = datagridState => {
72
64
  });
73
65
  onAllRowSelect?.(rows, event);
74
66
  return onChange?.(event);
75
- };
76
- const handleSelectAllChange = event => {
67
+ }, [dispatch, getRowId, indeterminate, onAllRowSelect, onChange, rows]);
68
+ const handleSelectAllChange = React.useCallback(event => {
77
69
  if (indeterminate) {
78
70
  stateReducer.handleSelectAllRowData({
79
71
  dispatch,
@@ -99,7 +91,15 @@ const SelectAll = datagridState => {
99
91
  });
100
92
  onAllRowSelect?.(rows, event);
101
93
  return onChange?.(event);
102
- };
94
+ }, [dispatch, getRowId, indeterminate, onAllRowSelect, onChange, rows, toggleAllRowsSelected]);
95
+ if (hideSelectAll || radio) {
96
+ return /*#__PURE__*/React.createElement("th", {
97
+ className: cx(`${blockClass}__head-hidden-select-all`, {
98
+ [`${blockClass}__select-all-sticky-left`]: /* istanbul ignore next */
99
+ isFirstColumnStickyLeft && Number(windowSize) > 671
100
+ })
101
+ });
102
+ }
103
103
  return /*#__PURE__*/React.createElement(react.TableSelectAll, _rollupPluginBabelHelpers.extends({}, selectProps, {
104
104
  checked: selectProps?.checked || false,
105
105
  className: cx(`${blockClass}__head-select-all`, `${blockClass}__checkbox-cell`, {
@@ -224,9 +224,6 @@ const FilterFlyout = _ref => {
224
224
  useSubscribeToEventEmitter.default(constants.CLEAR_FILTERS, tableId => {
225
225
  reset(tableId);
226
226
  });
227
- React.useEffect(function reflectLastAppliedFiltersWhenReactTableUpdates() {
228
- lastAppliedFilters.current = JSON.stringify(reactTableFiltersState);
229
- }, [reactTableFiltersState, lastAppliedFilters]);
230
227
  return /*#__PURE__*/React.createElement("div", {
231
228
  className: `${componentClass}__container`,
232
229
  ref: filterFlyoutRef
@@ -440,6 +440,11 @@ const useFilters = _ref => {
440
440
  }
441
441
  // eslint-disable-next-line react-hooks/exhaustive-deps
442
442
  }, [isFetching, reactTableFiltersState, setAllFilters, fetchingReset, savedFilters, filtersObjectArray]);
443
+
444
+ // This useEffect will update the last applied filters when the react-table filters change, this helps keeps all states in sync
445
+ React.useEffect(function reflectLastAppliedFiltersWhenReactTableUpdates() {
446
+ lastAppliedFilters.current = JSON.stringify(reactTableFiltersState);
447
+ }, [reactTableFiltersState, lastAppliedFilters]);
443
448
  const cancel = () => {
444
449
  // Reverting to previous filters only applies when using batch actions
445
450
  if (updateMethod === constants.BATCH) {
@@ -20,6 +20,8 @@ var stateReducer = require('./Datagrid/addons/stateReducer.js');
20
20
 
21
21
  const blockClass = `${settings.pkg.prefix}--datagrid`;
22
22
  const checkboxClass = `${settings.pkg.prefix}--datagrid__checkbox-cell`;
23
+ const renderSelectAll = gridState => /*#__PURE__*/React.createElement(DatagridSelectAll.SelectAll, gridState);
24
+ const renderSelectCell = gridState => /*#__PURE__*/React.createElement(SelectRow, gridState);
23
25
  const useSelectRows = hooks => {
24
26
  useHighlightSelection(hooks);
25
27
  const useInstance = instance => {
@@ -48,8 +50,8 @@ const useSelectRows = hooks => {
48
50
  const expanderCol = expanderColumnIndex > -1 ? newColOrder.splice(expanderColumnIndex, 1) : [];
49
51
  return [...(expanderColumnIndex > -1 && expanderCol && expanderCol.length ? expanderCol : []), {
50
52
  id: commonColumnIds.selectionColumnId,
51
- Header: gridState => /*#__PURE__*/React.createElement(DatagridSelectAll.SelectAll, gridState),
52
- Cell: gridState => /*#__PURE__*/React.createElement(SelectRow, gridState)
53
+ Header: renderSelectAll,
54
+ Cell: renderSelectCell
53
55
  }, ...newColOrder];
54
56
  });
55
57
  };
@@ -94,7 +96,20 @@ const SelectRow = datagridState => {
94
96
  window.addEventListener('resize', updateSize);
95
97
  return () => window.removeEventListener('resize', updateSize);
96
98
  }, []);
97
- const onSelectHandler = async event => {
99
+ const selectDisabled = isFetching || row.getRowProps().disabled;
100
+ const {
101
+ onChange,
102
+ title,
103
+ ...selectProps
104
+ } = row.getToggleRowSelectedProps();
105
+ const cellProps = cell.getCellProps();
106
+ const isFirstColumnStickyLeft = columns[0]?.sticky === 'left' && withStickyColumn;
107
+ const rowId = `${tableId}-${row.id}-${row.index}`;
108
+ const {
109
+ key,
110
+ _cellProps
111
+ } = cellProps;
112
+ const onSelectHandler = React.useCallback(event => {
98
113
  event.stopPropagation(); // avoid triggering onRowClick
99
114
  if (radio) {
100
115
  toggleAllRowsSelected(false);
@@ -111,24 +126,7 @@ const SelectRow = datagridState => {
111
126
  getRowId,
112
127
  selectAll: null
113
128
  });
114
- // focus the radio / checkbox if lost
115
- const activeElement = document?.activeElement?.id ?? '';
116
- await undefined;
117
- document?.getElementById(activeElement)?.focus();
118
- };
119
- const selectDisabled = isFetching || row.getRowProps().disabled;
120
- const {
121
- onChange,
122
- title,
123
- ...selectProps
124
- } = row.getToggleRowSelectedProps();
125
- const cellProps = cell.getCellProps();
126
- const isFirstColumnStickyLeft = columns[0]?.sticky === 'left' && withStickyColumn;
127
- const rowId = `${tableId}-${row.id}-${row.index}`;
128
- const {
129
- key,
130
- _cellProps
131
- } = cellProps;
129
+ }, [dispatch, getRowId, onChange, onRadioSelect, onRowSelect, radio, row, toggleAllRowsSelected]);
132
130
  return /*#__PURE__*/React.createElement(react.TableSelectRow, _rollupPluginBabelHelpers.extends({
133
131
  key: key
134
132
  }, _cellProps, selectProps, {
@@ -139,7 +137,7 @@ const SelectRow = datagridState => {
139
137
  className: cx([checkboxClass, cellProps.className, {
140
138
  [`${checkboxClass}-sticky-left`]: isFirstColumnStickyLeft && Number(windowSize) > 671
141
139
  }]),
142
- ariaLabel: title,
140
+ "aria-label": title,
143
141
  disabled: selectDisabled
144
142
  }));
145
143
  };
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React, { ElementType, ReactNode } from 'react';
8
8
  import '../../global/js/utils/props-helper';
9
- import { ButtonProps } from '@carbon/react';
9
+ import { ButtonProps, LinkProps } from '@carbon/react';
10
10
  declare enum sizes {
11
11
  lg = "lg",
12
12
  sm = "sm"
@@ -14,12 +14,14 @@ declare enum sizes {
14
14
  export declare const defaults: {
15
15
  position: string;
16
16
  size: sizes;
17
- headingAs: string;
18
17
  };
19
- interface EmptyStateAction extends ButtonProps<React.ElementType> {
18
+ export interface EmptyStateAction extends ButtonProps<React.ElementType> {
20
19
  kind?: 'primary' | 'secondary' | 'tertiary';
21
20
  text?: string;
22
21
  }
22
+ export interface CustomLink extends LinkProps<React.ElementType> {
23
+ text?: ReactNode;
24
+ }
23
25
  export interface EmptyStateProps {
24
26
  /**
25
27
  * Empty state action button
@@ -45,12 +47,11 @@ export interface EmptyStateProps {
45
47
  /**
46
48
  * Empty state link object
47
49
  */
48
- link?: {
49
- text?: string | ReactNode;
50
- href?: string;
51
- };
50
+ link?: CustomLink;
52
51
  /**
53
- * Empty state headingAs allows you to customize the type of heading element
52
+ * Customize the heading element. Set to "h1" when EmptyState is full page, i.e. there is no higher header.
53
+ * Otherwise, you normally don't need to specify this: EmptyState will automatically pick the right heading level
54
+ * (h2-h6) by leveraging Section and Heading.
54
55
  */
55
56
  headingAs?: (() => ReactNode) | string | ElementType;
56
57
  /**
@@ -34,8 +34,7 @@ var sizes = /*#__PURE__*/function (sizes) {
34
34
  }(sizes || {}); // Default values for props
35
35
  const defaults = {
36
36
  position: 'top',
37
- size: sizes.lg,
38
- headingAs: 'h3'
37
+ size: sizes.lg
39
38
  };
40
39
  /**
41
40
  * The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
@@ -57,7 +56,7 @@ exports.EmptyState = /*#__PURE__*/React.forwardRef((_ref, ref) => {
57
56
  illustrationPosition = defaults.position,
58
57
  link,
59
58
  size = defaults.size,
60
- headingAs = defaults.headingAs,
59
+ headingAs,
61
60
  subtitle,
62
61
  title,
63
62
  ...rest
@@ -128,11 +127,7 @@ exports.EmptyState.propTypes = {
128
127
  * Empty state link object
129
128
  */
130
129
  /**@ts-ignore*/
131
- link: index.default.shape({
132
- ...react.Link.propTypes,
133
- text: index.default.oneOfType([index.default.string, index.default.node]),
134
- href: index.default.string
135
- }),
130
+ link: index.default.any,
136
131
  /**
137
132
  * Empty state size
138
133
  */
@@ -1,22 +1,36 @@
1
- export function EmptyStateContent({ action, link, headingAs, size, subtitle, title, }: {
2
- action: any;
3
- link: any;
4
- headingAs: any;
5
- size: any;
6
- subtitle: any;
7
- title: any;
8
- }): React.JSX.Element;
9
- export namespace EmptyStateContent {
10
- export { componentName as displayName };
11
- export namespace propTypes {
12
- let action: any;
13
- let headingAs: any;
14
- let link: any;
15
- let size: any;
16
- let subtitle: any;
17
- let title: any;
18
- }
1
+ /**
2
+ * Copyright IBM Corp. 2020, 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 React, { ElementType, ReactNode } from 'react';
8
+ import { CustomLink, EmptyStateAction } from './EmptyState';
9
+ interface EmptyStateProps {
10
+ /**
11
+ * Empty state action button
12
+ */
13
+ action?: EmptyStateAction;
14
+ /**
15
+ * Empty state headingAs allows you to customize the type of heading element
16
+ */
17
+ headingAs?: (() => ReactNode) | string | ElementType;
18
+ /**
19
+ * Empty state link object
20
+ */
21
+ link?: CustomLink;
22
+ /**
23
+ * Empty state size
24
+ */
25
+ size?: 'lg' | 'sm';
26
+ /**
27
+ * Empty state subtitle
28
+ */
29
+ subtitle?: string | ReactNode;
30
+ /**
31
+ * Empty state title
32
+ */
33
+ title: string | ReactNode;
19
34
  }
20
- import React from 'react';
21
- declare const componentName: "EmptyStateContent";
35
+ export declare const EmptyStateContent: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
22
36
  export {};
@@ -17,19 +17,19 @@ var react = require('@carbon/react');
17
17
  // The block part of our conventional BEM class names (blockClass__E--M).
18
18
  const blockClass = `${settings.pkg.prefix}--empty-state`;
19
19
  const componentName = 'EmptyStateContent';
20
- const EmptyStateContent = _ref => {
21
- let {
20
+ const EmptyStateContent = /*#__PURE__*/React.forwardRef(props => {
21
+ const {
22
22
  action,
23
23
  link,
24
24
  headingAs,
25
25
  size,
26
26
  subtitle,
27
27
  title
28
- } = _ref;
29
- return /*#__PURE__*/React.createElement("div", {
28
+ } = props;
29
+ const HeadingComponent = headingAs ?? react.Heading;
30
+ return /*#__PURE__*/React.createElement(react.Section, {
30
31
  className: `${blockClass}__content`
31
- }, /*#__PURE__*/React.createElement(react.Section, {
32
- as: headingAs,
32
+ }, /*#__PURE__*/React.createElement(HeadingComponent, {
33
33
  className: cx(`${blockClass}__header`, {
34
34
  [`${blockClass}__header--small`]: size === 'sm'
35
35
  })
@@ -41,13 +41,13 @@ const EmptyStateContent = _ref => {
41
41
  className: `${blockClass}__action-button`,
42
42
  kind: action.kind || 'tertiary',
43
43
  onClick: action.onClick,
44
- renderIcon: action.renderIcon || null,
44
+ renderIcon: action.renderIcon ?? undefined,
45
45
  size: 'sm'
46
46
  }), action.text), link?.text && link?.href && /*#__PURE__*/React.createElement(react.Link, _rollupPluginBabelHelpers.extends({}, link, {
47
47
  className: `${blockClass}__link`,
48
48
  href: link.href
49
49
  }), link.text));
50
- };
50
+ });
51
51
 
52
52
  // The display name of the component, used by React. Note that displayName
53
53
  // is used in preference to relying on function.name.
@@ -61,10 +61,12 @@ EmptyStateContent.propTypes = {
61
61
  * Empty state action button
62
62
  */
63
63
  action: index.default.shape({
64
+ /**@ts-ignore*/
64
65
  ...react.Button.propTypes,
65
66
  iconDescription: index.default.string,
66
67
  kind: index.default.oneOf(['primary', 'secondary', 'tertiary']),
67
68
  renderIcon: index.default.oneOfType([index.default.func, index.default.object]),
69
+ /**@ts-ignore*/
68
70
  onClick: react.Button.propTypes.onClick,
69
71
  text: index.default.string
70
72
  }),
@@ -75,11 +77,7 @@ EmptyStateContent.propTypes = {
75
77
  /**
76
78
  * Empty state link object
77
79
  */
78
- link: index.default.shape({
79
- ...react.Link.propTypes,
80
- text: index.default.oneOfType([index.default.string, index.default.node]),
81
- href: index.default.string
82
- }),
80
+ link: index.default.any,
83
81
  /**
84
82
  * Empty state size
85
83
  */
@@ -35,7 +35,7 @@ exports.ErrorEmptyState = /*#__PURE__*/React.forwardRef((_ref, ref) => {
35
35
  illustrationTheme,
36
36
  link,
37
37
  size = EmptyState.defaults.size,
38
- headingAs = EmptyState.defaults.headingAs,
38
+ headingAs,
39
39
  subtitle,
40
40
  title,
41
41
  // Collect any other property values passed in.
@@ -108,11 +108,7 @@ exports.ErrorEmptyState.propTypes = {
108
108
  * Empty state link object
109
109
  */
110
110
  /**@ts-ignore*/
111
- link: index.default.shape({
112
- ...react.Link.propTypes,
113
- text: index.default.oneOfType([index.default.string, index.default.node]),
114
- href: index.default.string
115
- }),
111
+ link: index.default.any,
116
112
  /**
117
113
  * Empty state size
118
114
  */
@@ -35,7 +35,7 @@ exports.NoDataEmptyState = /*#__PURE__*/React.forwardRef((_ref, ref) => {
35
35
  illustrationDescription,
36
36
  link,
37
37
  size = EmptyState.defaults.size,
38
- headingAs = EmptyState.defaults.headingAs,
38
+ headingAs,
39
39
  subtitle,
40
40
  title,
41
41
  // Collect any other property values passed in.
@@ -108,11 +108,7 @@ exports.NoDataEmptyState.propTypes = {
108
108
  * Empty state link object
109
109
  */
110
110
  /**@ts-ignore */
111
- link: index.default.shape({
112
- ...react.Link.propTypes,
113
- text: index.default.oneOfType([index.default.string, index.default.node]),
114
- href: index.default.string
115
- }),
111
+ link: index.default.any,
116
112
  /**
117
113
  * Empty state size
118
114
  */
@@ -35,7 +35,7 @@ exports.NoTagsEmptyState = /*#__PURE__*/React.forwardRef((_ref, ref) => {
35
35
  illustrationDescription,
36
36
  link,
37
37
  size = EmptyState.defaults.size,
38
- headingAs = EmptyState.defaults.headingAs,
38
+ headingAs,
39
39
  subtitle,
40
40
  title,
41
41
  // Collect any other property values passed in.
@@ -108,11 +108,7 @@ exports.NoTagsEmptyState.propTypes = {
108
108
  * Empty state link object
109
109
  */
110
110
  /**@ts-ignore*/
111
- link: index.default.shape({
112
- ...react.Link.propTypes,
113
- text: index.default.oneOfType([index.default.string, index.default.node]),
114
- href: index.default.string
115
- }),
111
+ link: index.default.any,
116
112
  /**
117
113
  * Empty state size
118
114
  */
@@ -35,7 +35,7 @@ exports.NotFoundEmptyState = /*#__PURE__*/React.forwardRef((_ref, ref) => {
35
35
  illustrationDescription,
36
36
  link,
37
37
  size = EmptyState.defaults.size,
38
- headingAs = EmptyState.defaults.headingAs,
38
+ headingAs,
39
39
  subtitle,
40
40
  title,
41
41
  // Collect any other property values passed in.
@@ -108,11 +108,7 @@ exports.NotFoundEmptyState.propTypes = {
108
108
  * Empty state link object
109
109
  */
110
110
  /**@ts-ignore*/
111
- link: index.default.shape({
112
- ...react.Link.propTypes,
113
- text: index.default.oneOfType([index.default.string, index.default.node]),
114
- href: index.default.string
115
- }),
111
+ link: index.default.any,
116
112
  /**
117
113
  * Empty state size
118
114
  */
@@ -35,7 +35,7 @@ exports.NotificationsEmptyState = /*#__PURE__*/React.forwardRef((_ref, ref) => {
35
35
  illustrationDescription,
36
36
  link,
37
37
  size = EmptyState.defaults.size,
38
- headingAs = EmptyState.defaults.headingAs,
38
+ headingAs,
39
39
  subtitle,
40
40
  title,
41
41
  // Collect any other property values passed in.
@@ -108,11 +108,7 @@ exports.NotificationsEmptyState.propTypes = {
108
108
  * Empty state link object
109
109
  */
110
110
  /**@ts-ignore*/
111
- link: index.default.shape({
112
- ...react.Link.propTypes,
113
- text: index.default.oneOfType([index.default.string, index.default.node]),
114
- href: index.default.string
115
- }),
111
+ link: index.default.any,
116
112
  /**
117
113
  * Empty state size
118
114
  */
@@ -35,7 +35,7 @@ exports.UnauthorizedEmptyState = /*#__PURE__*/React.forwardRef((_ref, ref) => {
35
35
  illustrationDescription,
36
36
  link,
37
37
  size = EmptyState.defaults.size,
38
- headingAs = EmptyState.defaults.headingAs,
38
+ headingAs,
39
39
  subtitle,
40
40
  title,
41
41
  // Collect any other property values passed in.
@@ -197,7 +197,7 @@ exports.ImportModal = /*#__PURE__*/React.forwardRef((_ref, ref) => {
197
197
  }), /*#__PURE__*/React.createElement(react.Button, {
198
198
  onClick: fetchFile,
199
199
  className: `${blockClass}__import-button`,
200
- size: "sm",
200
+ size: "md",
201
201
  disabled: importButtonDisabled,
202
202
  renderIcon: inputButtonIcon ? props => /*#__PURE__*/React.createElement(icons.Add, _rollupPluginBabelHelpers.extends({
203
203
  size: 20
@@ -58,9 +58,9 @@ export interface OptionsTileProps {
58
58
  */
59
59
  summary?: string;
60
60
  /**
61
- * Provide the title for this OptionsTile.
61
+ * Provide the title for this OptionsTile. Must not contain any interactive elements.
62
62
  */
63
- title: string;
63
+ title: ReactNode;
64
64
  /**
65
65
  * Optionally provide an id which should be used for the title.
66
66
  */
@@ -12,6 +12,7 @@ var carbonMotion = require('@carbon/motion');
12
12
  var icons = require('@carbon/react/icons');
13
13
  var react = require('@carbon/react');
14
14
  var React = require('react');
15
+ var utilitiesReact = require('@carbon/utilities-react');
15
16
  var index = require('../../_virtual/index.js');
16
17
  var cx = require('classnames');
17
18
  var devtools = require('../../global/js/utils/devtools.js');
@@ -70,6 +71,8 @@ exports.OptionsTile = /*#__PURE__*/React.forwardRef((props, ref) => {
70
71
  const [open, setOpen] = useControllableState.useControllableState(userOpen ?? false, onChange);
71
72
  const detailsRef = React.useRef(null);
72
73
  const contentRef = React.useRef(null);
74
+ const headingRef = React.useRef(null);
75
+ utilitiesReact.useNoInteractiveChildren(headingRef);
73
76
  const titleId = userDefinedTitleId ?? `${uuidv4.default()}-title`;
74
77
  const isExpandable = children !== undefined;
75
78
  const isWarn = !invalid && warn;
@@ -175,6 +178,7 @@ exports.OptionsTile = /*#__PURE__*/React.forwardRef((props, ref) => {
175
178
  return /*#__PURE__*/React.createElement("div", {
176
179
  className: `${blockClass}__heading`
177
180
  }, /*#__PURE__*/React.createElement(react.Heading, {
181
+ ref: headingRef,
178
182
  id: titleId,
179
183
  className: `${blockClass}__title`
180
184
  }, title), text && /*#__PURE__*/React.createElement("span", {
@@ -290,9 +294,9 @@ exports.OptionsTile.propTypes = {
290
294
  */
291
295
  summary: index.default.string,
292
296
  /**
293
- * Provide the title for this OptionsTile.
297
+ * Provide the title for this OptionsTile. Must not contain any interactive elements.
294
298
  */
295
- title: index.default.string.isRequired,
299
+ title: index.default.oneOfType([index.default.string, index.default.node]).isRequired,
296
300
  /**
297
301
  * Optionally provide an id which should be used for the title.
298
302
  */
@@ -208,10 +208,7 @@ exports.PageHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
208
208
  }, [pageActions]);
209
209
  React.useEffect(() => {
210
210
  // Determine the location of the pageAction buttons
211
- /* istanbul ignore next */
212
- if (metrics?.titleRowSpaceAbove && metrics?.pageActionsSpaceAbove) {
213
- setPageActionsInBreadcrumbRow(collapseTitle || hasActionBar && scrollYValue > metrics?.titleRowSpaceAbove || widthIsNarrow && scrollYValue > metrics?.pageActionsSpaceAbove);
214
- }
211
+ setPageActionsInBreadcrumbRow(collapseTitle || hasActionBar && !!metrics?.titleRowSpaceAbove && scrollYValue > metrics?.titleRowSpaceAbove || widthIsNarrow && !!metrics?.pageActionsSpaceAbove && scrollYValue > metrics?.pageActionsSpaceAbove);
215
212
  }, [hasActionBar, metrics.breadcrumbRowSpaceBelow, metrics.titleRowSpaceAbove, metrics.pageActionsSpaceAbove, collapseTitle, scrollYValue, widthIsNarrow]);
216
213
  React.useEffect(() => {
217
214
  // Assesses the size of the action bar and page action area and their required
@@ -391,7 +388,8 @@ exports.PageHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
391
388
  [`${PageHeaderUtils.blockClass}__breadcrumb-row--next-to-tabs`]: nextToTabsCheck(),
392
389
  [`${PageHeaderUtils.blockClass}__breadcrumb-row--has-breadcrumbs`]: breadcrumbs || breadcrumbItemForTitle,
393
390
  [`${PageHeaderUtils.blockClass}__breadcrumb-row--has-action-bar`]: hasActionBar || widthIsNarrow,
394
- [`${PageHeaderUtils.blockClass}__has-page-actions-without-action-bar`]: !hasActionBar && !widthIsNarrow && pageActions
391
+ [`${PageHeaderUtils.blockClass}__has-page-actions-without-action-bar`]: !hasActionBar && !widthIsNarrow && pageActions,
392
+ [`${PageHeaderUtils.blockClass}__has-page-actions-with-title-collapsed`]: collapseTitle && pageActions
395
393
  })
396
394
  }, /*#__PURE__*/React.createElement("div", {
397
395
  className: `${PageHeaderUtils.blockClass}__breadcrumb-row--container`
@@ -426,7 +424,7 @@ exports.PageHeader = /*#__PURE__*/React.forwardRef((_ref, ref) => {
426
424
  overflowAriaLabel: actionBarOverflowAriaLabel,
427
425
  overflowMenuRef,
428
426
  rightAlign: true
429
- })) : widthIsNarrow && thePageActions(true, pageActionsInBreadcrumbRow))))) : null, !collapseTitle && (title || pageActions) ? /*#__PURE__*/React.createElement(react.Row, {
427
+ })) : (widthIsNarrow || pageActions) && thePageActions(true, pageActionsInBreadcrumbRow))))) : null, !collapseTitle && (title || pageActions) ? /*#__PURE__*/React.createElement(react.Row, {
430
428
  className: cx(`${PageHeaderUtils.blockClass}__title-row`, {
431
429
  [`${PageHeaderUtils.blockClass}__title-row--no-breadcrumb-row`]: !hasBreadcrumbRow,
432
430
  [`${PageHeaderUtils.blockClass}__title-row--under-action-bar`]: hasActionBar || widthIsNarrow,
@@ -213,6 +213,8 @@ exports.TagSet = /*#__PURE__*/React.forwardRef((_ref, ref) => {
213
213
  };
214
214
  const handleModalClose = () => {
215
215
  setShowAllModalOpen(false);
216
+ const launcherButton = overflowTag.current?.querySelector('button');
217
+ setTimeout(() => launcherButton?.focus(), 0);
216
218
  };
217
219
  useResizeObserver.useResizeObserver(sizingContainerRef, handleSizerTagsResize);
218
220
  const resizeOption = containingElementRef ? containingElementRef : tagSetRef;
@@ -8,6 +8,7 @@ import { type ButtonProps } from '@carbon/react';
8
8
  import React, { PropsWithChildren, ReactNode, RefObject } from 'react';
9
9
  export interface TearsheetAction extends ButtonProps<'button'> {
10
10
  label?: string;
11
+ loading?: boolean;
11
12
  }
12
13
  export interface TearsheetProps extends PropsWithChildren {
13
14
  /**
@@ -4,8 +4,8 @@
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 { ButtonProps } from '@carbon/react';
8
7
  import React, { PropsWithChildren, ReactNode, RefObject } from 'react';
8
+ import { TearsheetAction } from './Tearsheet';
9
9
  export interface TearsheetNarrowProps extends PropsWithChildren {
10
10
  /**
11
11
  * The navigation actions to be shown as buttons in the action area at the
@@ -20,7 +20,7 @@ export interface TearsheetNarrowProps extends PropsWithChildren {
20
20
  *
21
21
  * See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
22
22
  */
23
- actions?: ButtonProps<React.ElementType>[];
23
+ actions?: TearsheetAction[];
24
24
  /**
25
25
  * The aria-label for the tearsheet, which is optional.
26
26
  * if it is not passed, the title will be used as the aria-label.