@carbon/ibm-products 2.66.0 → 2.67.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
@@ -6,11 +6,11 @@
6
6
  */
7
7
 
8
8
  import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React__default, { useState, useLayoutEffect } from 'react';
9
+ import React__default, { useState, useLayoutEffect, useCallback } from 'react';
10
10
  import { TableSelectAll } from '@carbon/react';
11
11
  import cx from 'classnames';
12
12
  import { pkg } from '../../../settings.js';
13
- import { handleSelectAllRowData, handleOnPageSelectAllRowData } from './addons/stateReducer.js';
13
+ import { handleOnPageSelectAllRowData, handleSelectAllRowData } from './addons/stateReducer.js';
14
14
 
15
15
  const blockClass = `${pkg.prefix}--datagrid`;
16
16
  const SelectAll = datagridState => {
@@ -44,14 +44,6 @@ const SelectAll = datagridState => {
44
44
  onAllRowSelect
45
45
  } = datagridState;
46
46
  const isFirstColumnStickyLeft = columns[0]?.sticky === 'left' && withStickyColumn;
47
- if (hideSelectAll || radio) {
48
- return /*#__PURE__*/React__default.createElement("th", {
49
- className: cx(`${blockClass}__head-hidden-select-all`, {
50
- [`${blockClass}__select-all-sticky-left`]: /* istanbul ignore next */
51
- isFirstColumnStickyLeft && Number(windowSize) > 671
52
- })
53
- });
54
- }
55
47
  const getProps = DatagridPagination ? getToggleAllPageRowsSelectedProps : getToggleAllRowsSelectedProps;
56
48
  const {
57
49
  onChange,
@@ -60,7 +52,7 @@ const SelectAll = datagridState => {
60
52
  const {
61
53
  indeterminate
62
54
  } = selectProps;
63
- const handleOnPageSelectAllChange = event => {
55
+ const handleOnPageSelectAllChange = useCallback(event => {
64
56
  handleOnPageSelectAllRowData({
65
57
  dispatch,
66
58
  rows,
@@ -70,8 +62,8 @@ const SelectAll = datagridState => {
70
62
  });
71
63
  onAllRowSelect?.(rows, event);
72
64
  return onChange?.(event);
73
- };
74
- const handleSelectAllChange = event => {
65
+ }, [dispatch, getRowId, indeterminate, onAllRowSelect, onChange, rows]);
66
+ const handleSelectAllChange = useCallback(event => {
75
67
  if (indeterminate) {
76
68
  handleSelectAllRowData({
77
69
  dispatch,
@@ -97,7 +89,15 @@ const SelectAll = datagridState => {
97
89
  });
98
90
  onAllRowSelect?.(rows, event);
99
91
  return onChange?.(event);
100
- };
92
+ }, [dispatch, getRowId, indeterminate, onAllRowSelect, onChange, rows, toggleAllRowsSelected]);
93
+ if (hideSelectAll || radio) {
94
+ return /*#__PURE__*/React__default.createElement("th", {
95
+ className: cx(`${blockClass}__head-hidden-select-all`, {
96
+ [`${blockClass}__select-all-sticky-left`]: /* istanbul ignore next */
97
+ isFirstColumnStickyLeft && Number(windowSize) > 671
98
+ })
99
+ });
100
+ }
101
101
  return /*#__PURE__*/React__default.createElement(TableSelectAll, _extends({}, selectProps, {
102
102
  checked: selectProps?.checked || false,
103
103
  className: cx(`${blockClass}__head-select-all`, `${blockClass}__checkbox-cell`, {
@@ -220,9 +220,6 @@ const FilterFlyout = _ref => {
220
220
  useSubscribeToEventEmitter(CLEAR_FILTERS, tableId => {
221
221
  reset(tableId);
222
222
  });
223
- useEffect(function reflectLastAppliedFiltersWhenReactTableUpdates() {
224
- lastAppliedFilters.current = JSON.stringify(reactTableFiltersState);
225
- }, [reactTableFiltersState, lastAppliedFilters]);
226
223
  return /*#__PURE__*/React__default.createElement("div", {
227
224
  className: `${componentClass}__container`,
228
225
  ref: filterFlyoutRef
@@ -436,6 +436,11 @@ const useFilters = _ref => {
436
436
  }
437
437
  // eslint-disable-next-line react-hooks/exhaustive-deps
438
438
  }, [isFetching, reactTableFiltersState, setAllFilters, fetchingReset, savedFilters, filtersObjectArray]);
439
+
440
+ // This useEffect will update the last applied filters when the react-table filters change, this helps keeps all states in sync
441
+ useEffect(function reflectLastAppliedFiltersWhenReactTableUpdates() {
442
+ lastAppliedFilters.current = JSON.stringify(reactTableFiltersState);
443
+ }, [reactTableFiltersState, lastAppliedFilters]);
439
444
  const cancel = () => {
440
445
  // Reverting to previous filters only applies when using batch actions
441
446
  if (updateMethod === BATCH) {
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React__default, { useState, useLayoutEffect } from 'react';
9
+ import React__default, { useState, useLayoutEffect, useCallback } from 'react';
10
10
  import cx from 'classnames';
11
11
  import { TableSelectRow } from '@carbon/react';
12
12
  import { SelectAll } from './Datagrid/DatagridSelectAll.js';
@@ -16,6 +16,8 @@ import { handleToggleRowSelected } from './Datagrid/addons/stateReducer.js';
16
16
 
17
17
  const blockClass = `${pkg.prefix}--datagrid`;
18
18
  const checkboxClass = `${pkg.prefix}--datagrid__checkbox-cell`;
19
+ const renderSelectAll = gridState => /*#__PURE__*/React__default.createElement(SelectAll, gridState);
20
+ const renderSelectCell = gridState => /*#__PURE__*/React__default.createElement(SelectRow, gridState);
19
21
  const useSelectRows = hooks => {
20
22
  useHighlightSelection(hooks);
21
23
  const useInstance = instance => {
@@ -44,8 +46,8 @@ const useSelectRows = hooks => {
44
46
  const expanderCol = expanderColumnIndex > -1 ? newColOrder.splice(expanderColumnIndex, 1) : [];
45
47
  return [...(expanderColumnIndex > -1 && expanderCol && expanderCol.length ? expanderCol : []), {
46
48
  id: selectionColumnId,
47
- Header: gridState => /*#__PURE__*/React__default.createElement(SelectAll, gridState),
48
- Cell: gridState => /*#__PURE__*/React__default.createElement(SelectRow, gridState)
49
+ Header: renderSelectAll,
50
+ Cell: renderSelectCell
49
51
  }, ...newColOrder];
50
52
  });
51
53
  };
@@ -90,7 +92,20 @@ const SelectRow = datagridState => {
90
92
  window.addEventListener('resize', updateSize);
91
93
  return () => window.removeEventListener('resize', updateSize);
92
94
  }, []);
93
- const onSelectHandler = async event => {
95
+ const selectDisabled = isFetching || row.getRowProps().disabled;
96
+ const {
97
+ onChange,
98
+ title,
99
+ ...selectProps
100
+ } = row.getToggleRowSelectedProps();
101
+ const cellProps = cell.getCellProps();
102
+ const isFirstColumnStickyLeft = columns[0]?.sticky === 'left' && withStickyColumn;
103
+ const rowId = `${tableId}-${row.id}-${row.index}`;
104
+ const {
105
+ key,
106
+ _cellProps
107
+ } = cellProps;
108
+ const onSelectHandler = useCallback(event => {
94
109
  event.stopPropagation(); // avoid triggering onRowClick
95
110
  if (radio) {
96
111
  toggleAllRowsSelected(false);
@@ -107,24 +122,7 @@ const SelectRow = datagridState => {
107
122
  getRowId,
108
123
  selectAll: null
109
124
  });
110
- // focus the radio / checkbox if lost
111
- const activeElement = document?.activeElement?.id ?? '';
112
- await undefined;
113
- document?.getElementById(activeElement)?.focus();
114
- };
115
- const selectDisabled = isFetching || row.getRowProps().disabled;
116
- const {
117
- onChange,
118
- title,
119
- ...selectProps
120
- } = row.getToggleRowSelectedProps();
121
- const cellProps = cell.getCellProps();
122
- const isFirstColumnStickyLeft = columns[0]?.sticky === 'left' && withStickyColumn;
123
- const rowId = `${tableId}-${row.id}-${row.index}`;
124
- const {
125
- key,
126
- _cellProps
127
- } = cellProps;
125
+ }, [dispatch, getRowId, onChange, onRadioSelect, onRowSelect, radio, row, toggleAllRowsSelected]);
128
126
  return /*#__PURE__*/React__default.createElement(TableSelectRow, _extends({
129
127
  key: key
130
128
  }, _cellProps, selectProps, {
@@ -135,7 +133,7 @@ const SelectRow = datagridState => {
135
133
  className: cx([checkboxClass, cellProps.className, {
136
134
  [`${checkboxClass}-sticky-left`]: isFirstColumnStickyLeft && Number(windowSize) > 671
137
135
  }]),
138
- ariaLabel: title,
136
+ "aria-label": title,
139
137
  disabled: selectDisabled
140
138
  }));
141
139
  };
@@ -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
  /**
@@ -16,7 +16,7 @@ import './NotificationsEmptyState/NotificationsEmptyState.js';
16
16
  import './UnauthorizedEmptyState/UnauthorizedEmptyState.js';
17
17
  import PropTypes from '../../_virtual/index.js';
18
18
  import cx from 'classnames';
19
- import { Link, Button } from '@carbon/react';
19
+ import { Button } from '@carbon/react';
20
20
  import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
21
21
  import '../../global/js/utils/props-helper.js';
22
22
  import { pkg } from '../../settings.js';
@@ -32,8 +32,7 @@ var sizes = /*#__PURE__*/function (sizes) {
32
32
  }(sizes || {}); // Default values for props
33
33
  const defaults = {
34
34
  position: 'top',
35
- size: sizes.lg,
36
- headingAs: 'h3'
35
+ size: sizes.lg
37
36
  };
38
37
  /**
39
38
  * 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.
@@ -55,7 +54,7 @@ let EmptyState = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
55
54
  illustrationPosition = defaults.position,
56
55
  link,
57
56
  size = defaults.size,
58
- headingAs = defaults.headingAs,
57
+ headingAs,
59
58
  subtitle,
60
59
  title,
61
60
  ...rest
@@ -126,11 +125,7 @@ EmptyState.propTypes = {
126
125
  * Empty state link object
127
126
  */
128
127
  /**@ts-ignore*/
129
- link: PropTypes.shape({
130
- ...Link.propTypes,
131
- text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
132
- href: PropTypes.string
133
- }),
128
+ link: PropTypes.any,
134
129
  /**
135
130
  * Empty state size
136
131
  */
@@ -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 {};
@@ -10,24 +10,24 @@ import React__default from 'react';
10
10
  import PropTypes from '../../_virtual/index.js';
11
11
  import { pkg } from '../../settings.js';
12
12
  import cx from 'classnames';
13
- import { Section, Button, Link } from '@carbon/react';
13
+ import { Button, Section, Heading, Link } from '@carbon/react';
14
14
 
15
15
  // The block part of our conventional BEM class names (blockClass__E--M).
16
16
  const blockClass = `${pkg.prefix}--empty-state`;
17
17
  const componentName = 'EmptyStateContent';
18
- const EmptyStateContent = _ref => {
19
- let {
18
+ const EmptyStateContent = /*#__PURE__*/React__default.forwardRef(props => {
19
+ const {
20
20
  action,
21
21
  link,
22
22
  headingAs,
23
23
  size,
24
24
  subtitle,
25
25
  title
26
- } = _ref;
27
- return /*#__PURE__*/React__default.createElement("div", {
26
+ } = props;
27
+ const HeadingComponent = headingAs ?? Heading;
28
+ return /*#__PURE__*/React__default.createElement(Section, {
28
29
  className: `${blockClass}__content`
29
- }, /*#__PURE__*/React__default.createElement(Section, {
30
- as: headingAs,
30
+ }, /*#__PURE__*/React__default.createElement(HeadingComponent, {
31
31
  className: cx(`${blockClass}__header`, {
32
32
  [`${blockClass}__header--small`]: size === 'sm'
33
33
  })
@@ -39,13 +39,13 @@ const EmptyStateContent = _ref => {
39
39
  className: `${blockClass}__action-button`,
40
40
  kind: action.kind || 'tertiary',
41
41
  onClick: action.onClick,
42
- renderIcon: action.renderIcon || null,
42
+ renderIcon: action.renderIcon ?? undefined,
43
43
  size: 'sm'
44
44
  }), action.text), link?.text && link?.href && /*#__PURE__*/React__default.createElement(Link, _extends({}, link, {
45
45
  className: `${blockClass}__link`,
46
46
  href: link.href
47
47
  }), link.text));
48
- };
48
+ });
49
49
 
50
50
  // The display name of the component, used by React. Note that displayName
51
51
  // is used in preference to relying on function.name.
@@ -59,10 +59,12 @@ EmptyStateContent.propTypes = {
59
59
  * Empty state action button
60
60
  */
61
61
  action: PropTypes.shape({
62
+ /**@ts-ignore*/
62
63
  ...Button.propTypes,
63
64
  iconDescription: PropTypes.string,
64
65
  kind: PropTypes.oneOf(['primary', 'secondary', 'tertiary']),
65
66
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
67
+ /**@ts-ignore*/
66
68
  onClick: Button.propTypes.onClick,
67
69
  text: PropTypes.string
68
70
  }),
@@ -73,11 +75,7 @@ EmptyStateContent.propTypes = {
73
75
  /**
74
76
  * Empty state link object
75
77
  */
76
- link: PropTypes.shape({
77
- ...Link.propTypes,
78
- text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
79
- href: PropTypes.string
80
- }),
78
+ link: PropTypes.any,
81
79
  /**
82
80
  * Empty state size
83
81
  */
@@ -8,7 +8,7 @@
8
8
  import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default from 'react';
10
10
  import PropTypes from '../../../_virtual/index.js';
11
- import { Link, Button } from '@carbon/react';
11
+ import { Button } from '@carbon/react';
12
12
  import cx from 'classnames';
13
13
  import { getDevtoolsProps } from '../../../global/js/utils/devtools.js';
14
14
  import { pkg } from '../../../settings.js';
@@ -33,7 +33,7 @@ let ErrorEmptyState = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
33
33
  illustrationTheme,
34
34
  link,
35
35
  size = defaults.size,
36
- headingAs = defaults.headingAs,
36
+ headingAs,
37
37
  subtitle,
38
38
  title,
39
39
  // Collect any other property values passed in.
@@ -106,11 +106,7 @@ ErrorEmptyState.propTypes = {
106
106
  * Empty state link object
107
107
  */
108
108
  /**@ts-ignore*/
109
- link: PropTypes.shape({
110
- ...Link.propTypes,
111
- text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
112
- href: PropTypes.string
113
- }),
109
+ link: PropTypes.any,
114
110
  /**
115
111
  * Empty state size
116
112
  */
@@ -9,7 +9,7 @@ import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers
9
9
  import React__default from 'react';
10
10
  import PropTypes from '../../../_virtual/index.js';
11
11
  import cx from 'classnames';
12
- import { Link, Button } from '@carbon/react';
12
+ import { Button } from '@carbon/react';
13
13
  import { getDevtoolsProps } from '../../../global/js/utils/devtools.js';
14
14
  import { pkg } from '../../../settings.js';
15
15
  import { EmptyStateContent } from '../EmptyStateContent.js';
@@ -33,7 +33,7 @@ let NoDataEmptyState = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
33
33
  illustrationDescription,
34
34
  link,
35
35
  size = defaults.size,
36
- headingAs = defaults.headingAs,
36
+ headingAs,
37
37
  subtitle,
38
38
  title,
39
39
  // Collect any other property values passed in.
@@ -106,11 +106,7 @@ NoDataEmptyState.propTypes = {
106
106
  * Empty state link object
107
107
  */
108
108
  /**@ts-ignore */
109
- link: PropTypes.shape({
110
- ...Link.propTypes,
111
- text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
112
- href: PropTypes.string
113
- }),
109
+ link: PropTypes.any,
114
110
  /**
115
111
  * Empty state size
116
112
  */
@@ -9,7 +9,7 @@ import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers
9
9
  import React__default from 'react';
10
10
  import PropTypes from '../../../_virtual/index.js';
11
11
  import cx from 'classnames';
12
- import { Link, Button } from '@carbon/react';
12
+ import { Button } from '@carbon/react';
13
13
  import { getDevtoolsProps } from '../../../global/js/utils/devtools.js';
14
14
  import { pkg } from '../../../settings.js';
15
15
  import { EmptyStateContent } from '../EmptyStateContent.js';
@@ -33,7 +33,7 @@ let NoTagsEmptyState = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
33
33
  illustrationDescription,
34
34
  link,
35
35
  size = defaults.size,
36
- headingAs = defaults.headingAs,
36
+ headingAs,
37
37
  subtitle,
38
38
  title,
39
39
  // Collect any other property values passed in.
@@ -106,11 +106,7 @@ NoTagsEmptyState.propTypes = {
106
106
  * Empty state link object
107
107
  */
108
108
  /**@ts-ignore*/
109
- link: PropTypes.shape({
110
- ...Link.propTypes,
111
- text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
112
- href: PropTypes.string
113
- }),
109
+ link: PropTypes.any,
114
110
  /**
115
111
  * Empty state size
116
112
  */
@@ -9,7 +9,7 @@ import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers
9
9
  import React__default from 'react';
10
10
  import PropTypes from '../../../_virtual/index.js';
11
11
  import cx from 'classnames';
12
- import { Link, Button } from '@carbon/react';
12
+ import { Button } from '@carbon/react';
13
13
  import { getDevtoolsProps } from '../../../global/js/utils/devtools.js';
14
14
  import { pkg } from '../../../settings.js';
15
15
  import { EmptyStateContent } from '../EmptyStateContent.js';
@@ -33,7 +33,7 @@ let NotFoundEmptyState = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
33
33
  illustrationDescription,
34
34
  link,
35
35
  size = defaults.size,
36
- headingAs = defaults.headingAs,
36
+ headingAs,
37
37
  subtitle,
38
38
  title,
39
39
  // Collect any other property values passed in.
@@ -106,11 +106,7 @@ NotFoundEmptyState.propTypes = {
106
106
  * Empty state link object
107
107
  */
108
108
  /**@ts-ignore*/
109
- link: PropTypes.shape({
110
- ...Link.propTypes,
111
- text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
112
- href: PropTypes.string
113
- }),
109
+ link: PropTypes.any,
114
110
  /**
115
111
  * Empty state size
116
112
  */
@@ -9,7 +9,7 @@ import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers
9
9
  import React__default from 'react';
10
10
  import PropTypes from '../../../_virtual/index.js';
11
11
  import cx from 'classnames';
12
- import { Link, Button } from '@carbon/react';
12
+ import { Button } from '@carbon/react';
13
13
  import { getDevtoolsProps } from '../../../global/js/utils/devtools.js';
14
14
  import { pkg } from '../../../settings.js';
15
15
  import { EmptyStateContent } from '../EmptyStateContent.js';
@@ -33,7 +33,7 @@ let NotificationsEmptyState = /*#__PURE__*/React__default.forwardRef((_ref, ref)
33
33
  illustrationDescription,
34
34
  link,
35
35
  size = defaults.size,
36
- headingAs = defaults.headingAs,
36
+ headingAs,
37
37
  subtitle,
38
38
  title,
39
39
  // Collect any other property values passed in.
@@ -106,11 +106,7 @@ NotificationsEmptyState.propTypes = {
106
106
  * Empty state link object
107
107
  */
108
108
  /**@ts-ignore*/
109
- link: PropTypes.shape({
110
- ...Link.propTypes,
111
- text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
112
- href: PropTypes.string
113
- }),
109
+ link: PropTypes.any,
114
110
  /**
115
111
  * Empty state size
116
112
  */
@@ -33,7 +33,7 @@ let UnauthorizedEmptyState = /*#__PURE__*/React__default.forwardRef((_ref, ref)
33
33
  illustrationDescription,
34
34
  link,
35
35
  size = defaults.size,
36
- headingAs = defaults.headingAs,
36
+ headingAs,
37
37
  subtitle,
38
38
  title,
39
39
  // Collect any other property values passed in.
@@ -195,7 +195,7 @@ let ImportModal = /*#__PURE__*/forwardRef((_ref, ref) => {
195
195
  }), /*#__PURE__*/React__default.createElement(Button, {
196
196
  onClick: fetchFile,
197
197
  className: `${blockClass}__import-button`,
198
- size: "sm",
198
+ size: "md",
199
199
  disabled: importButtonDisabled,
200
200
  renderIcon: inputButtonIcon ? props => /*#__PURE__*/React__default.createElement(Add, _extends({
201
201
  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
  */
@@ -10,6 +10,7 @@ import * as carbonMotion from '@carbon/motion';
10
10
  import { ChevronDown, Locked, WarningFilled, WarningAltFilled } from '@carbon/react/icons';
11
11
  import { Section, Toggle, Layer, Heading } from '@carbon/react';
12
12
  import React__default, { useState, useRef } from 'react';
13
+ import { useNoInteractiveChildren } from '@carbon/utilities-react';
13
14
  import PropTypes from '../../_virtual/index.js';
14
15
  import cx from 'classnames';
15
16
  import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
@@ -49,6 +50,8 @@ let OptionsTile = /*#__PURE__*/React__default.forwardRef((props, ref) => {
49
50
  const [open, setOpen] = useControllableState(userOpen ?? false, onChange);
50
51
  const detailsRef = useRef(null);
51
52
  const contentRef = useRef(null);
53
+ const headingRef = useRef(null);
54
+ useNoInteractiveChildren(headingRef);
52
55
  const titleId = userDefinedTitleId ?? `${uuidv4()}-title`;
53
56
  const isExpandable = children !== undefined;
54
57
  const isWarn = !invalid && warn;
@@ -154,6 +157,7 @@ let OptionsTile = /*#__PURE__*/React__default.forwardRef((props, ref) => {
154
157
  return /*#__PURE__*/React__default.createElement("div", {
155
158
  className: `${blockClass}__heading`
156
159
  }, /*#__PURE__*/React__default.createElement(Heading, {
160
+ ref: headingRef,
157
161
  id: titleId,
158
162
  className: `${blockClass}__title`
159
163
  }, title), text && /*#__PURE__*/React__default.createElement("span", {
@@ -269,9 +273,9 @@ OptionsTile.propTypes = {
269
273
  */
270
274
  summary: PropTypes.string,
271
275
  /**
272
- * Provide the title for this OptionsTile.
276
+ * Provide the title for this OptionsTile. Must not contain any interactive elements.
273
277
  */
274
- title: PropTypes.string.isRequired,
278
+ title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
275
279
  /**
276
280
  * Optionally provide an id which should be used for the title.
277
281
  */
@@ -206,10 +206,7 @@ let PageHeader = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
206
206
  }, [pageActions]);
207
207
  useEffect(() => {
208
208
  // Determine the location of the pageAction buttons
209
- /* istanbul ignore next */
210
- if (metrics?.titleRowSpaceAbove && metrics?.pageActionsSpaceAbove) {
211
- setPageActionsInBreadcrumbRow(collapseTitle || hasActionBar && scrollYValue > metrics?.titleRowSpaceAbove || widthIsNarrow && scrollYValue > metrics?.pageActionsSpaceAbove);
212
- }
209
+ setPageActionsInBreadcrumbRow(collapseTitle || hasActionBar && !!metrics?.titleRowSpaceAbove && scrollYValue > metrics?.titleRowSpaceAbove || widthIsNarrow && !!metrics?.pageActionsSpaceAbove && scrollYValue > metrics?.pageActionsSpaceAbove);
213
210
  }, [hasActionBar, metrics.breadcrumbRowSpaceBelow, metrics.titleRowSpaceAbove, metrics.pageActionsSpaceAbove, collapseTitle, scrollYValue, widthIsNarrow]);
214
211
  useEffect(() => {
215
212
  // Assesses the size of the action bar and page action area and their required
@@ -389,7 +386,8 @@ let PageHeader = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
389
386
  [`${blockClass}__breadcrumb-row--next-to-tabs`]: nextToTabsCheck(),
390
387
  [`${blockClass}__breadcrumb-row--has-breadcrumbs`]: breadcrumbs || breadcrumbItemForTitle,
391
388
  [`${blockClass}__breadcrumb-row--has-action-bar`]: hasActionBar || widthIsNarrow,
392
- [`${blockClass}__has-page-actions-without-action-bar`]: !hasActionBar && !widthIsNarrow && pageActions
389
+ [`${blockClass}__has-page-actions-without-action-bar`]: !hasActionBar && !widthIsNarrow && pageActions,
390
+ [`${blockClass}__has-page-actions-with-title-collapsed`]: collapseTitle && pageActions
393
391
  })
394
392
  }, /*#__PURE__*/React__default.createElement("div", {
395
393
  className: `${blockClass}__breadcrumb-row--container`
@@ -424,7 +422,7 @@ let PageHeader = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
424
422
  overflowAriaLabel: actionBarOverflowAriaLabel,
425
423
  overflowMenuRef,
426
424
  rightAlign: true
427
- })) : widthIsNarrow && thePageActions(true, pageActionsInBreadcrumbRow))))) : null, !collapseTitle && (title || pageActions) ? /*#__PURE__*/React__default.createElement(Row, {
425
+ })) : (widthIsNarrow || pageActions) && thePageActions(true, pageActionsInBreadcrumbRow))))) : null, !collapseTitle && (title || pageActions) ? /*#__PURE__*/React__default.createElement(Row, {
428
426
  className: cx(`${blockClass}__title-row`, {
429
427
  [`${blockClass}__title-row--no-breadcrumb-row`]: !hasBreadcrumbRow,
430
428
  [`${blockClass}__title-row--under-action-bar`]: hasActionBar || widthIsNarrow,
@@ -211,6 +211,8 @@ let TagSet = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
211
211
  };
212
212
  const handleModalClose = () => {
213
213
  setShowAllModalOpen(false);
214
+ const launcherButton = overflowTag.current?.querySelector('button');
215
+ setTimeout(() => launcherButton?.focus(), 0);
214
216
  };
215
217
  useResizeObserver(sizingContainerRef, handleSizerTagsResize);
216
218
  const resizeOption = containingElementRef ? containingElementRef : tagSetRef;