@carbon/ibm-products 2.54.0-canary.0 → 2.54.0-canary.11

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 (31) hide show
  1. package/es/components/APIKeyModal/APIKeyModal.js +16 -1
  2. package/es/components/APIKeyModal/APIKeyModal.types.d.ts +5 -1
  3. package/es/components/AddSelect/AddSelect.d.ts +2 -2
  4. package/es/components/AddSelect/AddSelect.js +1 -0
  5. package/es/components/AddSelect/AddSelectBody.d.ts +2 -2
  6. package/es/components/AddSelect/AddSelectBody.js +1 -0
  7. package/es/components/Card/Card.js +13 -9
  8. package/es/components/Datagrid/Datagrid/Datagrid.d.ts +1 -0
  9. package/es/components/Datagrid/Datagrid/Datagrid.js +7 -0
  10. package/es/components/Tearsheet/Tearsheet.d.ts +1 -1
  11. package/es/components/Tearsheet/TearsheetNarrow.d.ts +1 -1
  12. package/es/components/Tearsheet/TearsheetShell.d.ts +1 -1
  13. package/es/components/TooltipTrigger/TooltipTrigger.d.ts +1 -1
  14. package/es/components/TooltipTrigger/TooltipTrigger.js +3 -2
  15. package/es/components/UserAvatar/UserAvatar.js +1 -3
  16. package/lib/components/APIKeyModal/APIKeyModal.js +16 -1
  17. package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +5 -1
  18. package/lib/components/AddSelect/AddSelect.d.ts +2 -2
  19. package/lib/components/AddSelect/AddSelect.js +1 -0
  20. package/lib/components/AddSelect/AddSelectBody.d.ts +2 -2
  21. package/lib/components/AddSelect/AddSelectBody.js +1 -0
  22. package/lib/components/Card/Card.js +12 -8
  23. package/lib/components/Datagrid/Datagrid/Datagrid.d.ts +1 -0
  24. package/lib/components/Datagrid/Datagrid/Datagrid.js +7 -0
  25. package/lib/components/Tearsheet/Tearsheet.d.ts +1 -1
  26. package/lib/components/Tearsheet/TearsheetNarrow.d.ts +1 -1
  27. package/lib/components/Tearsheet/TearsheetShell.d.ts +1 -1
  28. package/lib/components/TooltipTrigger/TooltipTrigger.d.ts +1 -1
  29. package/lib/components/TooltipTrigger/TooltipTrigger.js +3 -2
  30. package/lib/components/UserAvatar/UserAvatar.js +1 -3
  31. package/package.json +3 -3
@@ -18,9 +18,10 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
18
18
  import { isRequiredIf } from '../../global/js/utils/props-helper.js';
19
19
  import uuidv4 from '../../global/js/utils/uuidv4.js';
20
20
  import { useFocus, getSpecificElement } from '../../global/js/hooks/useFocus.js';
21
+ import { usePreviousValue } from '../../global/js/hooks/usePreviousValue.js';
21
22
 
22
23
  var _ErrorFilled, _InformationFilled;
23
- var _excluded = ["apiKey", "apiKeyLabel", "apiKeyName", "body", "className", "closeButtonText", "copyButtonText", "copyErrorText", "copyIconDescription", "customSteps", "downloadBodyText", "downloadFileName", "downloadFileType", "downloadLinkText", "downloadLinkLabel", "editButtonText", "editSuccess", "editSuccessTitle", "editing", "error", "errorText", "generateButtonText", "generateSuccessBody", "generateSuccessTitle", "generateTitle", "hasAPIKeyVisibilityToggle", "hasDownloadLink", "hideAPIKeyLabel", "loading", "loadingText", "modalLabel", "nameHelperText", "nameLabel", "namePlaceholder", "nameRequired", "nextStepButtonText", "onClose", "onCopy", "onRequestEdit", "onRequestGenerate", "open", "portalTarget", "previousStepButtonText", "selectorPrimaryFocus", "showAPIKeyLabel"];
24
+ var _excluded = ["apiKey", "apiKeyLabel", "apiKeyName", "body", "className", "closeButtonText", "copyButtonText", "copyErrorText", "copyIconDescription", "customSteps", "downloadBodyText", "downloadFileName", "downloadFileType", "downloadLinkText", "downloadLinkLabel", "editButtonText", "editSuccess", "editSuccessTitle", "editing", "error", "errorText", "generateButtonText", "generateSuccessBody", "generateSuccessTitle", "generateTitle", "hasAPIKeyVisibilityToggle", "hasDownloadLink", "hideAPIKeyLabel", "launcherButtonRef", "loading", "loadingText", "modalLabel", "nameHelperText", "nameLabel", "namePlaceholder", "nameRequired", "nextStepButtonText", "onClose", "onCopy", "onRequestEdit", "onRequestGenerate", "open", "portalTarget", "previousStepButtonText", "selectorPrimaryFocus", "showAPIKeyLabel"];
24
25
  var componentName = 'APIKeyModal';
25
26
 
26
27
  // Default values for props
@@ -61,6 +62,7 @@ var APIKeyModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
61
62
  hasAPIKeyVisibilityToggle = _ref.hasAPIKeyVisibilityToggle,
62
63
  hasDownloadLink = _ref.hasDownloadLink,
63
64
  hideAPIKeyLabel = _ref.hideAPIKeyLabel,
65
+ launcherButtonRef = _ref.launcherButtonRef,
64
66
  loading = _ref.loading,
65
67
  loadingText = _ref.loadingText,
66
68
  modalLabel = _ref.modalLabel,
@@ -118,6 +120,7 @@ var APIKeyModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
118
120
  var _useFocus = useFocus(modalRef, selectorPrimaryFocus),
119
121
  firstElement = _useFocus.firstElement,
120
122
  keyDownListener = _useFocus.keyDownListener;
123
+ var prevOpen = usePreviousValue(open);
121
124
  useEffect(function () {
122
125
  if (copyRef.current && open && apiKeyLoaded) {
123
126
  copyRef.current.focus();
@@ -141,6 +144,13 @@ var APIKeyModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
141
144
  }, 0);
142
145
  }
143
146
  }, [firstElement, modalRef, open, selectorPrimaryFocus]);
147
+ useEffect(function () {
148
+ if (prevOpen && !open && launcherButtonRef) {
149
+ setTimeout(function () {
150
+ launcherButtonRef.current.focus();
151
+ }, 0);
152
+ }
153
+ }, [launcherButtonRef, open, prevOpen]);
144
154
  var isPrimaryButtonDisabled = function isPrimaryButtonDisabled() {
145
155
  if (loading) {
146
156
  return true;
@@ -486,6 +496,11 @@ APIKeyModal.propTypes = {
486
496
  * label text that's displayed when hovering over visibility toggler to hide key
487
497
  */
488
498
  hideAPIKeyLabel: PropTypes.string,
499
+ /**
500
+ * Provide a ref to return focus to once the tearsheet is closed.
501
+ */
502
+ /**@ts-ignore */
503
+ launcherButtonRef: PropTypes.any,
489
504
  /**
490
505
  * designates if the modal is in a loading state via a request or some other in progress operation
491
506
  */
@@ -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 { ReactNode } from 'react';
7
+ import { ReactNode, RefObject } from 'react';
8
8
  interface APIKeyModalCommonProps {
9
9
  /**
10
10
  * the api key that's displayed to the user when a request to create is fulfilled.
@@ -92,6 +92,10 @@ interface APIKeyModalCommonProps {
92
92
  * label text that's displayed when hovering over visibility toggler to hide key
93
93
  */
94
94
  hideAPIKeyLabel?: string;
95
+ /**
96
+ * Provide a ref to return focus to once the tearsheet is closed.
97
+ */
98
+ launcherButtonRef?: RefObject<any>;
95
99
  /**
96
100
  * designates if the modal is in a loading state via a request or some other in progress operation
97
101
  */
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import { Filter, Item, Theme } from './types';
3
3
  export interface AddSelectProps {
4
4
  className?: string;
@@ -36,7 +36,7 @@ export interface AddSelectProps {
36
36
  /**
37
37
  * portal target for the all tags modal
38
38
  */
39
- portalTarget?: ReactNode;
39
+ portalTarget?: HTMLElement;
40
40
  searchResultsTitle?: string;
41
41
  sortByLabel?: string;
42
42
  title: string;
@@ -107,6 +107,7 @@ AddSelect.propTypes = {
107
107
  /**
108
108
  * portal target for the all tags modal
109
109
  */
110
+ /**@ts-ignore */
110
111
  portalTarget: PropTypes.node,
111
112
  searchResultsTitle: PropTypes.string,
112
113
  sortByLabel: PropTypes.string,
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import { Item, Theme } from './types';
3
3
  export interface AddSelectBodyProps {
4
4
  className?: string;
@@ -35,7 +35,7 @@ export interface AddSelectBodyProps {
35
35
  onSubmit?: (selection: any) => void;
36
36
  onSubmitButtonText?: string;
37
37
  open?: boolean;
38
- portalTarget?: ReactNode;
38
+ portalTarget?: HTMLElement;
39
39
  searchResultsTitle?: string;
40
40
  sortByLabel?: string;
41
41
  title?: string;
@@ -361,6 +361,7 @@ AddSelectBody.propTypes = {
361
361
  onSubmit: PropTypes.func,
362
362
  onSubmitButtonText: PropTypes.string,
363
363
  open: PropTypes.bool,
364
+ /**@ts-ignore */
364
365
  portalTarget: PropTypes.node,
365
366
  searchResultsTitle: PropTypes.string,
366
367
  sortByLabel: PropTypes.string,
@@ -8,7 +8,7 @@
8
8
  import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, objectSpread2 as _objectSpread2, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default, { forwardRef } from 'react';
10
10
  import cx from 'classnames';
11
- import { Layer, OverflowMenu, OverflowMenuItem, Button, IconButton } from '@carbon/react';
11
+ import { Layer, unstable_FeatureFlags, OverflowMenu, MenuItem, Button, IconButton } from '@carbon/react';
12
12
  import { Incomplete, CheckmarkOutline } from '@carbon/react/icons';
13
13
  import PropTypes from '../../_virtual/index.js';
14
14
  import { CardHeader } from './CardHeader.js';
@@ -17,7 +17,7 @@ import { pkg } from '../../settings.js';
17
17
 
18
18
  var _Incomplete, _CheckmarkOutline;
19
19
  var _excluded = ["actionIcons", "actionsPlacement", "aiLabel", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
20
- _excluded2 = ["id"],
20
+ _excluded2 = ["id", "itemText"],
21
21
  _excluded3 = ["id", "icon", "onClick", "iconDescription", "href"];
22
22
  var componentName = 'Card';
23
23
  var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -95,23 +95,27 @@ var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
95
95
  // actions can either be an overflow menu or series of icons
96
96
  var getActions = function getActions() {
97
97
  if (overflowActions.length > 0) {
98
- var pos = actionsPlacement === 'top' ? 'bottom' : 'top';
98
+ var pos = actionsPlacement === 'top' ? 'bottom-end' : 'top-end';
99
99
  var size = actionsPlacement === 'top' ? 'sm' : 'md';
100
100
  return /*#__PURE__*/React__default.createElement(Layer, {
101
101
  level: 2
102
+ }, /*#__PURE__*/React__default.createElement(unstable_FeatureFlags, {
103
+ enableV12Overflowmenu: true
102
104
  }, /*#__PURE__*/React__default.createElement(OverflowMenu, {
105
+ autoAlign: true,
106
+ menuAlignment: pos,
103
107
  size: size,
104
- direction: pos,
105
- flipped: true,
106
108
  "aria-label": overflowAriaLabel,
107
- iconDescription: iconDescription
109
+ label: iconDescription
108
110
  }, overflowActions.map(function (_ref2) {
109
111
  var id = _ref2.id,
112
+ itemText = _ref2.itemText,
110
113
  rest = _objectWithoutProperties(_ref2, _excluded2);
111
- return /*#__PURE__*/React__default.createElement(OverflowMenuItem, _extends({
112
- key: id
114
+ return /*#__PURE__*/React__default.createElement(MenuItem, _extends({
115
+ key: id,
116
+ label: itemText
113
117
  }, rest));
114
- })));
118
+ }))));
115
119
  }
116
120
  var icons = getIcons().map(function (_ref3) {
117
121
  var id = _ref3.id,
@@ -19,5 +19,6 @@ export interface DatagridProps {
19
19
  }
20
20
  /**
21
21
  * The `Datagrid` component is an extension of Carbon's DataTable component. At the most basic level, the `Datagrid` component takes in columns and rows and renders a data table. There is a set of data table extensions which this component provides support for, these can be found [here](https://pages.github.ibm.com/carbon/ibm-products/components/datagrid/overview/). This component is data driven and allows you to choose what pieces will be included based on the hooks/plugins that are provided.
22
+ * @deprecated
22
23
  */
23
24
  export declare let Datagrid: React.ForwardRefExoticComponent<DatagridProps & React.RefAttributes<HTMLDivElement>>;
@@ -21,6 +21,7 @@ var blockClass = "".concat(pkg.prefix, "--datagrid");
21
21
  var componentName = 'Datagrid';
22
22
  /**
23
23
  * The `Datagrid` component is an extension of Carbon's DataTable component. At the most basic level, the `Datagrid` component takes in columns and rows and renders a data table. There is a set of data table extensions which this component provides support for, these can be found [here](https://pages.github.ibm.com/carbon/ibm-products/components/datagrid/overview/). This component is data driven and allows you to choose what pieces will be included based on the hooks/plugins that are provided.
24
+ * @deprecated
24
25
  */
25
26
  var Datagrid = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
26
27
  var datagridState = _ref.datagridState,
@@ -55,6 +56,12 @@ var Datagrid = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
55
56
  }, /*#__PURE__*/React__default.createElement(DatagridContent, props)) : /*#__PURE__*/React__default.createElement(DatagridContent, props))));
56
57
  });
57
58
 
59
+ /**@ts-ignore*/
60
+ Datagrid.deprecated = {
61
+ level: 'warn',
62
+ details: "For more information, please refer to the migration docs https://github.com/carbon-design-system/tanstack-carbon"
63
+ };
64
+
58
65
  // Return a placeholder if not released and not enabled by feature flag
59
66
  Datagrid = pkg.checkComponentEnabled(Datagrid, componentName);
60
67
 
@@ -107,7 +107,7 @@ export interface TearsheetProps extends PropsWithChildren {
107
107
  /**
108
108
  * The DOM element that the tearsheet should be rendered within. Defaults to document.body.
109
109
  */
110
- portalTarget?: ReactNode;
110
+ portalTarget?: HTMLElement;
111
111
  /**
112
112
  * Specify a CSS selector that matches the DOM element that should be
113
113
  * focused when the Modal opens.
@@ -63,7 +63,7 @@ interface TearsheetNarrowBaseProps extends PropsWithChildren {
63
63
  /**
64
64
  * The DOM element that the tearsheet should be rendered within. Defaults to document.body.
65
65
  */
66
- portalTarget?: ReactNode;
66
+ portalTarget?: HTMLElement;
67
67
  /**
68
68
  * Specify a CSS selector that matches the DOM element that should be
69
69
  * focused when the Modal opens.
@@ -84,7 +84,7 @@ interface TearsheetShellProps extends PropsWithChildren {
84
84
  /**
85
85
  * The DOM element that the tearsheet should be rendered within. Defaults to document.body.
86
86
  */
87
- portalTarget?: ReactNode;
87
+ portalTarget?: HTMLElement;
88
88
  /**
89
89
  * Specify a CSS selector that matches the DOM element that should be
90
90
  * focused when the Modal opens.
@@ -15,4 +15,4 @@ export interface TooltipTriggerProps extends PropsWithChildren {
15
15
  * This is an tooltip trigger as Carbon Tooltip requires an active element to work but provides
16
16
  * no blanked button.
17
17
  */
18
- export declare let TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLDivElement>>;
18
+ export declare let TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
@@ -23,12 +23,13 @@ var componentName = 'TooltipTrigger';
23
23
  * This is an tooltip trigger as Carbon Tooltip requires an active element to work but provides
24
24
  * no blanked button.
25
25
  */
26
- var TooltipTrigger = /*#__PURE__*/React__default.forwardRef(function (_ref) {
26
+ var TooltipTrigger = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
27
27
  var children = _ref.children,
28
28
  className = _ref.className,
29
29
  rest = _objectWithoutProperties(_ref, _excluded);
30
30
  return /*#__PURE__*/React__default.createElement("button", _extends({
31
- type: "button"
31
+ type: "button",
32
+ ref: ref
32
33
  }, rest, {
33
34
  className: cx(blockClass,
34
35
  // Apply the block class to the main HTML element
@@ -96,9 +96,7 @@ var UserAvatar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
96
96
  // switched classes dependant on props or state
97
97
  // example: [`${blockClass}__here-if-small`]: size === 'sm',
98
98
  }),
99
- ref: ref,
100
- role: "img",
101
- "aria-hidden": "true"
99
+ ref: ref
102
100
  }, getDevtoolsProps(componentName)), getItem());
103
101
  };
104
102
  if (tooltipText) {
@@ -20,9 +20,10 @@ var devtools = require('../../global/js/utils/devtools.js');
20
20
  var propsHelper = require('../../global/js/utils/props-helper.js');
21
21
  var uuidv4 = require('../../global/js/utils/uuidv4.js');
22
22
  var useFocus = require('../../global/js/hooks/useFocus.js');
23
+ var usePreviousValue = require('../../global/js/hooks/usePreviousValue.js');
23
24
 
24
25
  var _ErrorFilled, _InformationFilled;
25
- var _excluded = ["apiKey", "apiKeyLabel", "apiKeyName", "body", "className", "closeButtonText", "copyButtonText", "copyErrorText", "copyIconDescription", "customSteps", "downloadBodyText", "downloadFileName", "downloadFileType", "downloadLinkText", "downloadLinkLabel", "editButtonText", "editSuccess", "editSuccessTitle", "editing", "error", "errorText", "generateButtonText", "generateSuccessBody", "generateSuccessTitle", "generateTitle", "hasAPIKeyVisibilityToggle", "hasDownloadLink", "hideAPIKeyLabel", "loading", "loadingText", "modalLabel", "nameHelperText", "nameLabel", "namePlaceholder", "nameRequired", "nextStepButtonText", "onClose", "onCopy", "onRequestEdit", "onRequestGenerate", "open", "portalTarget", "previousStepButtonText", "selectorPrimaryFocus", "showAPIKeyLabel"];
26
+ var _excluded = ["apiKey", "apiKeyLabel", "apiKeyName", "body", "className", "closeButtonText", "copyButtonText", "copyErrorText", "copyIconDescription", "customSteps", "downloadBodyText", "downloadFileName", "downloadFileType", "downloadLinkText", "downloadLinkLabel", "editButtonText", "editSuccess", "editSuccessTitle", "editing", "error", "errorText", "generateButtonText", "generateSuccessBody", "generateSuccessTitle", "generateTitle", "hasAPIKeyVisibilityToggle", "hasDownloadLink", "hideAPIKeyLabel", "launcherButtonRef", "loading", "loadingText", "modalLabel", "nameHelperText", "nameLabel", "namePlaceholder", "nameRequired", "nextStepButtonText", "onClose", "onCopy", "onRequestEdit", "onRequestGenerate", "open", "portalTarget", "previousStepButtonText", "selectorPrimaryFocus", "showAPIKeyLabel"];
26
27
  var componentName = 'APIKeyModal';
27
28
 
28
29
  // Default values for props
@@ -63,6 +64,7 @@ exports.APIKeyModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
63
64
  hasAPIKeyVisibilityToggle = _ref.hasAPIKeyVisibilityToggle,
64
65
  hasDownloadLink = _ref.hasDownloadLink,
65
66
  hideAPIKeyLabel = _ref.hideAPIKeyLabel,
67
+ launcherButtonRef = _ref.launcherButtonRef,
66
68
  loading = _ref.loading,
67
69
  loadingText = _ref.loadingText,
68
70
  modalLabel = _ref.modalLabel,
@@ -120,6 +122,7 @@ exports.APIKeyModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
120
122
  var _useFocus = useFocus.useFocus(modalRef, selectorPrimaryFocus),
121
123
  firstElement = _useFocus.firstElement,
122
124
  keyDownListener = _useFocus.keyDownListener;
125
+ var prevOpen = usePreviousValue.usePreviousValue(open);
123
126
  React.useEffect(function () {
124
127
  if (copyRef.current && open && apiKeyLoaded) {
125
128
  copyRef.current.focus();
@@ -143,6 +146,13 @@ exports.APIKeyModal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
143
146
  }, 0);
144
147
  }
145
148
  }, [firstElement, modalRef, open, selectorPrimaryFocus]);
149
+ React.useEffect(function () {
150
+ if (prevOpen && !open && launcherButtonRef) {
151
+ setTimeout(function () {
152
+ launcherButtonRef.current.focus();
153
+ }, 0);
154
+ }
155
+ }, [launcherButtonRef, open, prevOpen]);
146
156
  var isPrimaryButtonDisabled = function isPrimaryButtonDisabled() {
147
157
  if (loading) {
148
158
  return true;
@@ -488,6 +498,11 @@ exports.APIKeyModal.propTypes = {
488
498
  * label text that's displayed when hovering over visibility toggler to hide key
489
499
  */
490
500
  hideAPIKeyLabel: index.default.string,
501
+ /**
502
+ * Provide a ref to return focus to once the tearsheet is closed.
503
+ */
504
+ /**@ts-ignore */
505
+ launcherButtonRef: index.default.any,
491
506
  /**
492
507
  * designates if the modal is in a loading state via a request or some other in progress operation
493
508
  */
@@ -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 { ReactNode } from 'react';
7
+ import { ReactNode, RefObject } from 'react';
8
8
  interface APIKeyModalCommonProps {
9
9
  /**
10
10
  * the api key that's displayed to the user when a request to create is fulfilled.
@@ -92,6 +92,10 @@ interface APIKeyModalCommonProps {
92
92
  * label text that's displayed when hovering over visibility toggler to hide key
93
93
  */
94
94
  hideAPIKeyLabel?: string;
95
+ /**
96
+ * Provide a ref to return focus to once the tearsheet is closed.
97
+ */
98
+ launcherButtonRef?: RefObject<any>;
95
99
  /**
96
100
  * designates if the modal is in a loading state via a request or some other in progress operation
97
101
  */
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import { Filter, Item, Theme } from './types';
3
3
  export interface AddSelectProps {
4
4
  className?: string;
@@ -36,7 +36,7 @@ export interface AddSelectProps {
36
36
  /**
37
37
  * portal target for the all tags modal
38
38
  */
39
- portalTarget?: ReactNode;
39
+ portalTarget?: HTMLElement;
40
40
  searchResultsTitle?: string;
41
41
  sortByLabel?: string;
42
42
  title: string;
@@ -109,6 +109,7 @@ AddSelect.propTypes = {
109
109
  /**
110
110
  * portal target for the all tags modal
111
111
  */
112
+ /**@ts-ignore */
112
113
  portalTarget: index.default.node,
113
114
  searchResultsTitle: index.default.string,
114
115
  sortByLabel: index.default.string,
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from 'react';
1
+ import React from 'react';
2
2
  import { Item, Theme } from './types';
3
3
  export interface AddSelectBodyProps {
4
4
  className?: string;
@@ -35,7 +35,7 @@ export interface AddSelectBodyProps {
35
35
  onSubmit?: (selection: any) => void;
36
36
  onSubmitButtonText?: string;
37
37
  open?: boolean;
38
- portalTarget?: ReactNode;
38
+ portalTarget?: HTMLElement;
39
39
  searchResultsTitle?: string;
40
40
  sortByLabel?: string;
41
41
  title?: string;
@@ -363,6 +363,7 @@ AddSelectBody.propTypes = {
363
363
  onSubmit: index.default.func,
364
364
  onSubmitButtonText: index.default.string,
365
365
  open: index.default.bool,
366
+ /**@ts-ignore */
366
367
  portalTarget: index.default.node,
367
368
  searchResultsTitle: index.default.string,
368
369
  sortByLabel: index.default.string,
@@ -19,7 +19,7 @@ var settings = require('../../settings.js');
19
19
 
20
20
  var _Incomplete, _CheckmarkOutline;
21
21
  var _excluded = ["actionIcons", "actionsPlacement", "aiLabel", "metadata", "children", "className", "clickZone", "description", "disabled", "footerActionIcon", "getStarted", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonDisabled", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonDisabled", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "slug", "status", "sequence", "title", "titleSize", "iconDescription"],
22
- _excluded2 = ["id"],
22
+ _excluded2 = ["id", "itemText"],
23
23
  _excluded3 = ["id", "icon", "onClick", "iconDescription", "href"];
24
24
  var componentName = 'Card';
25
25
  var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
@@ -97,23 +97,27 @@ var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
97
97
  // actions can either be an overflow menu or series of icons
98
98
  var getActions = function getActions() {
99
99
  if (overflowActions.length > 0) {
100
- var pos = actionsPlacement === 'top' ? 'bottom' : 'top';
100
+ var pos = actionsPlacement === 'top' ? 'bottom-end' : 'top-end';
101
101
  var size = actionsPlacement === 'top' ? 'sm' : 'md';
102
102
  return /*#__PURE__*/React.createElement(react.Layer, {
103
103
  level: 2
104
+ }, /*#__PURE__*/React.createElement(react.unstable_FeatureFlags, {
105
+ enableV12Overflowmenu: true
104
106
  }, /*#__PURE__*/React.createElement(react.OverflowMenu, {
107
+ autoAlign: true,
108
+ menuAlignment: pos,
105
109
  size: size,
106
- direction: pos,
107
- flipped: true,
108
110
  "aria-label": overflowAriaLabel,
109
- iconDescription: iconDescription
111
+ label: iconDescription
110
112
  }, overflowActions.map(function (_ref2) {
111
113
  var id = _ref2.id,
114
+ itemText = _ref2.itemText,
112
115
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded2);
113
- return /*#__PURE__*/React.createElement(react.OverflowMenuItem, _rollupPluginBabelHelpers.extends({
114
- key: id
116
+ return /*#__PURE__*/React.createElement(react.MenuItem, _rollupPluginBabelHelpers.extends({
117
+ key: id,
118
+ label: itemText
115
119
  }, rest));
116
- })));
120
+ }))));
117
121
  }
118
122
  var icons = getIcons().map(function (_ref3) {
119
123
  var id = _ref3.id,
@@ -19,5 +19,6 @@ export interface DatagridProps {
19
19
  }
20
20
  /**
21
21
  * The `Datagrid` component is an extension of Carbon's DataTable component. At the most basic level, the `Datagrid` component takes in columns and rows and renders a data table. There is a set of data table extensions which this component provides support for, these can be found [here](https://pages.github.ibm.com/carbon/ibm-products/components/datagrid/overview/). This component is data driven and allows you to choose what pieces will be included based on the hooks/plugins that are provided.
22
+ * @deprecated
22
23
  */
23
24
  export declare let Datagrid: React.ForwardRefExoticComponent<DatagridProps & React.RefAttributes<HTMLDivElement>>;
@@ -23,6 +23,7 @@ var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
23
23
  var componentName = 'Datagrid';
24
24
  /**
25
25
  * The `Datagrid` component is an extension of Carbon's DataTable component. At the most basic level, the `Datagrid` component takes in columns and rows and renders a data table. There is a set of data table extensions which this component provides support for, these can be found [here](https://pages.github.ibm.com/carbon/ibm-products/components/datagrid/overview/). This component is data driven and allows you to choose what pieces will be included based on the hooks/plugins that are provided.
26
+ * @deprecated
26
27
  */
27
28
  exports.Datagrid = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
28
29
  var datagridState = _ref.datagridState,
@@ -57,6 +58,12 @@ exports.Datagrid = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
57
58
  }, /*#__PURE__*/React.createElement(DatagridContent.DatagridContent, props)) : /*#__PURE__*/React.createElement(DatagridContent.DatagridContent, props))));
58
59
  });
59
60
 
61
+ /**@ts-ignore*/
62
+ exports.Datagrid.deprecated = {
63
+ level: 'warn',
64
+ details: "For more information, please refer to the migration docs https://github.com/carbon-design-system/tanstack-carbon"
65
+ };
66
+
60
67
  // Return a placeholder if not released and not enabled by feature flag
61
68
  exports.Datagrid = settings.pkg.checkComponentEnabled(exports.Datagrid, componentName);
62
69
 
@@ -107,7 +107,7 @@ export interface TearsheetProps extends PropsWithChildren {
107
107
  /**
108
108
  * The DOM element that the tearsheet should be rendered within. Defaults to document.body.
109
109
  */
110
- portalTarget?: ReactNode;
110
+ portalTarget?: HTMLElement;
111
111
  /**
112
112
  * Specify a CSS selector that matches the DOM element that should be
113
113
  * focused when the Modal opens.
@@ -63,7 +63,7 @@ interface TearsheetNarrowBaseProps extends PropsWithChildren {
63
63
  /**
64
64
  * The DOM element that the tearsheet should be rendered within. Defaults to document.body.
65
65
  */
66
- portalTarget?: ReactNode;
66
+ portalTarget?: HTMLElement;
67
67
  /**
68
68
  * Specify a CSS selector that matches the DOM element that should be
69
69
  * focused when the Modal opens.
@@ -84,7 +84,7 @@ interface TearsheetShellProps extends PropsWithChildren {
84
84
  /**
85
85
  * The DOM element that the tearsheet should be rendered within. Defaults to document.body.
86
86
  */
87
- portalTarget?: ReactNode;
87
+ portalTarget?: HTMLElement;
88
88
  /**
89
89
  * Specify a CSS selector that matches the DOM element that should be
90
90
  * focused when the Modal opens.
@@ -15,4 +15,4 @@ export interface TooltipTriggerProps extends PropsWithChildren {
15
15
  * This is an tooltip trigger as Carbon Tooltip requires an active element to work but provides
16
16
  * no blanked button.
17
17
  */
18
- export declare let TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLDivElement>>;
18
+ export declare let TooltipTrigger: React.ForwardRefExoticComponent<TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
@@ -25,12 +25,13 @@ var componentName = 'TooltipTrigger';
25
25
  * This is an tooltip trigger as Carbon Tooltip requires an active element to work but provides
26
26
  * no blanked button.
27
27
  */
28
- exports.TooltipTrigger = /*#__PURE__*/React.forwardRef(function (_ref) {
28
+ exports.TooltipTrigger = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
29
29
  var children = _ref.children,
30
30
  className = _ref.className,
31
31
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
32
32
  return /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
33
- type: "button"
33
+ type: "button",
34
+ ref: ref
34
35
  }, rest, {
35
36
  className: cx(blockClass,
36
37
  // Apply the block class to the main HTML element
@@ -98,9 +98,7 @@ exports.UserAvatar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
98
98
  // switched classes dependant on props or state
99
99
  // example: [`${blockClass}__here-if-small`]: size === 'sm',
100
100
  }),
101
- ref: ref,
102
- role: "img",
103
- "aria-hidden": "true"
101
+ ref: ref
104
102
  }, devtools.getDevtoolsProps(componentName)), getItem());
105
103
  };
106
104
  if (tooltipText) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products",
3
3
  "description": "Carbon for IBM Products",
4
- "version": "2.54.0-canary.0+4a92770d9",
4
+ "version": "2.54.0-canary.11+535e87142",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -89,7 +89,7 @@
89
89
  "rimraf": "^5.0.5",
90
90
  "rollup": "^3.29.5",
91
91
  "rollup-plugin-strip-banner": "^3.0.0",
92
- "sass": "^1.77.2",
92
+ "sass": "^1.80.6",
93
93
  "typescript-config-carbon": "^0.3.0",
94
94
  "yargs": "^17.7.2"
95
95
  },
@@ -120,5 +120,5 @@
120
120
  "react": "^16.8.6 || ^17.0.1 || ^18.2.0",
121
121
  "react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
122
122
  },
123
- "gitHead": "4a92770d9179f6b59bfe18e53c998fdb51bd794a"
123
+ "gitHead": "535e87142413695c530952f7b314201c8a35becc"
124
124
  }