@carbon/ibm-products 2.78.0 → 2.79.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 (99) hide show
  1. package/css/carbon.css +1762 -1036
  2. package/css/carbon.css.map +1 -1
  3. package/css/index-full-carbon.css +2342 -1239
  4. package/css/index-full-carbon.css.map +1 -1
  5. package/css/index-full-carbon.min.css +1 -1
  6. package/css/index-full-carbon.min.css.map +1 -1
  7. package/css/index-without-carbon-released-only.css +450 -98
  8. package/css/index-without-carbon-released-only.css.map +1 -1
  9. package/css/index-without-carbon-released-only.min.css +1 -1
  10. package/css/index-without-carbon-released-only.min.css.map +1 -1
  11. package/css/index-without-carbon.css +624 -247
  12. package/css/index-without-carbon.css.map +1 -1
  13. package/css/index-without-carbon.min.css +1 -1
  14. package/css/index-without-carbon.min.css.map +1 -1
  15. package/css/index.css +1759 -873
  16. package/css/index.css.map +1 -1
  17. package/css/index.min.css +1 -1
  18. package/css/index.min.css.map +1 -1
  19. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +111 -108
  20. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  21. package/es/components/InterstitialScreen/InterstitialScreenBody.js +15 -8
  22. package/es/components/InterstitialScreen/InterstitialScreenFooter.js +6 -1
  23. package/es/components/InterstitialScreen/InterstitialScreenHeader.d.ts +1 -1
  24. package/es/components/InterstitialScreen/InterstitialScreenHeader.js +1 -1
  25. package/es/components/InterstitialScreen/{_story-assets/InterstitialScreenView/InterstitialScreenView.d.ts → InterstitialScreenView.d.ts} +2 -3
  26. package/es/components/InterstitialScreen/InterstitialScreenView.js +60 -0
  27. package/es/components/InterstitialScreen/index.d.ts +1 -0
  28. package/es/components/Tearsheet/next/Tearsheet.d.ts +85 -0
  29. package/es/components/Tearsheet/next/Tearsheet.js +129 -0
  30. package/es/components/Tearsheet/next/TearsheetBody.d.ts +67 -0
  31. package/es/components/Tearsheet/next/TearsheetBody.js +121 -0
  32. package/es/components/Tearsheet/next/TearsheetHeader.d.ts +65 -0
  33. package/es/components/Tearsheet/next/TearsheetHeader.js +121 -0
  34. package/es/components/Tearsheet/next/TearsheetHeaderActions.d.ts +54 -0
  35. package/es/components/Tearsheet/next/TearsheetHeaderActions.js +101 -0
  36. package/es/components/Tearsheet/next/TearsheetHeaderContent.d.ts +28 -0
  37. package/es/components/Tearsheet/next/TearsheetHeaderContent.js +67 -0
  38. package/es/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts +22 -0
  39. package/es/components/Tearsheet/next/context.d.ts +26 -0
  40. package/es/components/Tearsheet/next/context.js +26 -0
  41. package/es/components/Tearsheet/next/index.d.ts +12 -0
  42. package/es/components/Tearsheet/next/index.js +8 -0
  43. package/es/components/Toolbar/Toolbar.js +1 -5
  44. package/es/components/TruncatedText/TruncatedText.d.ts +2 -3
  45. package/es/components/TruncatedText/TruncatedText.js +1 -2
  46. package/es/components/TruncatedText/index.d.ts +1 -0
  47. package/es/components/index.d.ts +2 -1
  48. package/es/global/js/hooks/useCollapsible.d.ts +19 -0
  49. package/es/global/js/hooks/useCollapsible.js +68 -0
  50. package/es/global/js/hooks/useMatchMedia.d.ts +13 -0
  51. package/es/global/js/hooks/useMatchMedia.js +33 -0
  52. package/es/index.js +4 -1
  53. package/es/node_modules/@carbon/icons-react/es/generated/bucket-10.js +845 -805
  54. package/es/node_modules/@carbon/icons-react/es/generated/bucket-3.js +476 -476
  55. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +111 -108
  56. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  57. package/lib/components/InterstitialScreen/InterstitialScreenBody.js +15 -8
  58. package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +6 -1
  59. package/lib/components/InterstitialScreen/InterstitialScreenHeader.d.ts +1 -1
  60. package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +1 -1
  61. package/lib/components/InterstitialScreen/{_story-assets/InterstitialScreenView/InterstitialScreenView.d.ts → InterstitialScreenView.d.ts} +2 -3
  62. package/lib/components/InterstitialScreen/InterstitialScreenView.js +62 -0
  63. package/lib/components/InterstitialScreen/index.d.ts +1 -0
  64. package/lib/components/Tearsheet/next/Tearsheet.d.ts +85 -0
  65. package/lib/components/Tearsheet/next/Tearsheet.js +131 -0
  66. package/lib/components/Tearsheet/next/TearsheetBody.d.ts +67 -0
  67. package/lib/components/Tearsheet/next/TearsheetBody.js +128 -0
  68. package/lib/components/Tearsheet/next/TearsheetHeader.d.ts +65 -0
  69. package/lib/components/Tearsheet/next/TearsheetHeader.js +127 -0
  70. package/lib/components/Tearsheet/next/TearsheetHeaderActions.d.ts +54 -0
  71. package/lib/components/Tearsheet/next/TearsheetHeaderActions.js +104 -0
  72. package/lib/components/Tearsheet/next/TearsheetHeaderContent.d.ts +28 -0
  73. package/lib/components/Tearsheet/next/TearsheetHeaderContent.js +71 -0
  74. package/lib/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts +22 -0
  75. package/lib/components/Tearsheet/next/context.d.ts +26 -0
  76. package/lib/components/Tearsheet/next/context.js +29 -0
  77. package/lib/components/Tearsheet/next/index.d.ts +12 -0
  78. package/lib/components/Tearsheet/next/index.js +14 -0
  79. package/lib/components/Toolbar/Toolbar.js +1 -5
  80. package/lib/components/TruncatedText/TruncatedText.d.ts +2 -3
  81. package/lib/components/TruncatedText/TruncatedText.js +4 -3
  82. package/lib/components/TruncatedText/index.d.ts +1 -0
  83. package/lib/components/index.d.ts +2 -1
  84. package/lib/global/js/hooks/useCollapsible.d.ts +19 -0
  85. package/lib/global/js/hooks/useCollapsible.js +70 -0
  86. package/lib/global/js/hooks/useMatchMedia.d.ts +13 -0
  87. package/lib/global/js/hooks/useMatchMedia.js +35 -0
  88. package/lib/index.js +15 -14
  89. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-10.js +863 -823
  90. package/lib/node_modules/@carbon/icons-react/es/generated/bucket-3.js +477 -477
  91. package/package.json +16 -15
  92. package/scss/components/FilterSummary/_filter-summary.scss +1 -1
  93. package/scss/components/PageHeader/_page-header.scss +4 -0
  94. package/scss/components/SidePanel/_side-panel.scss +5 -5
  95. package/scss/components/TagOverflow/_tag-overflow.scss +38 -38
  96. package/scss/components/TagSet/_tag-set.scss +28 -12
  97. package/scss/components/Tearsheet/_tearsheet.scss +8 -1
  98. package/scss/components/Tearsheet/_tearsheet_next.scss +408 -0
  99. package/telemetry.yml +32 -6
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
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, { ReactNode } from 'react';
8
+ /**
9
+ * ----------------
10
+ * TearsheetBody
11
+ * ----------------
12
+ */
13
+ export interface TearsheetBodyProps {
14
+ /**
15
+ * Optional static content for body
16
+ */
17
+ children?: ReactNode;
18
+ /**
19
+ * Provide an optional class to be applied to the containing node.
20
+ */
21
+ className?: string;
22
+ }
23
+ declare const TearsheetBody: React.ForwardRefExoticComponent<TearsheetBodyProps & React.RefAttributes<HTMLDivElement>>;
24
+ export interface MainContentProps {
25
+ children: ReactNode;
26
+ className?: string;
27
+ }
28
+ /**
29
+ * ----------------
30
+ * MainContent
31
+ * ----------------
32
+ */
33
+ export declare const MainContent: React.ForwardRefExoticComponent<MainContentProps & React.RefAttributes<HTMLDivElement>>;
34
+ /**
35
+ * ----------------
36
+ * SummaryContent
37
+ * ----------------
38
+ */
39
+ export interface SummaryContentProps {
40
+ children: ReactNode;
41
+ className?: string;
42
+ /**
43
+ * In mobile screens right side details section wont be visible by default. This prop can be toggled to open/close right panel in this case.
44
+ */
45
+ summaryPanelOpen?: boolean;
46
+ /**
47
+ * Specify a handler for closing the side panel.
48
+ * This handler closes the modal, e.g. changing `open` prop.
49
+ */
50
+ onSummaryPanelClose?(): void;
51
+ }
52
+ export declare const SummaryContent: React.ForwardRefExoticComponent<SummaryContentProps & React.RefAttributes<HTMLDivElement>>;
53
+ export interface InfluencerProps {
54
+ children: ReactNode;
55
+ className?: string;
56
+ /**
57
+ * In mobile screens right side details section wont be visible by default. This prop can be toggled to open/close right panel in this case.
58
+ */
59
+ influencerPanelOpen?: boolean;
60
+ /**
61
+ * Specify a handler for closing the side panel.
62
+ * This handler closes the modal, e.g. changing `open` prop.
63
+ */
64
+ onInfluencerPanelClose?(): void;
65
+ }
66
+ export declare const Influencer: React.ForwardRefExoticComponent<InfluencerProps & React.RefAttributes<HTMLDivElement>>;
67
+ export default TearsheetBody;
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2025
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
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var React = require('react');
14
+ var context = require('./context.js');
15
+ var SidePanel = require('../../SidePanel/SidePanel.js');
16
+ var react = require('@carbon/react');
17
+ var useCollapsible = require('../../../global/js/hooks/useCollapsible.js');
18
+
19
+ /**
20
+ * ----------------
21
+ * TearsheetBody
22
+ * ----------------
23
+ */
24
+
25
+ const TearsheetBody = /*#__PURE__*/React.forwardRef((_ref, ref) => {
26
+ let {
27
+ children,
28
+ className
29
+ } = _ref;
30
+ return /*#__PURE__*/React.createElement("div", {
31
+ className: `${context.blockClass}__body ${className}`,
32
+ ref: ref
33
+ }, children);
34
+ });
35
+ /**
36
+ * ----------------
37
+ * MainContent
38
+ * ----------------
39
+ */
40
+ const MainContent = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
41
+ let {
42
+ children,
43
+ className,
44
+ ...rest
45
+ } = _ref2;
46
+ const localRef = React.useRef(null);
47
+ const mainContentRef = ref || localRef;
48
+ const {
49
+ setFullyCollapsed,
50
+ disableHeaderCollapse
51
+ } = React.useContext(context.TearsheetContext);
52
+ const container = typeof mainContentRef === 'function' ? null : mainContentRef?.current ?? null;
53
+ const collapseHeader = collapse => {
54
+ if (container) {
55
+ if (collapse) {
56
+ const canScroll = container.scrollHeight > container.clientHeight; // collapse header only when there is scroll
57
+
58
+ if (canScroll) {
59
+ setFullyCollapsed?.(true);
60
+ }
61
+ } else if (container.scrollTop === 0) {
62
+ // expand header when scroll reaches top
63
+ setFullyCollapsed?.(false);
64
+ }
65
+ }
66
+ };
67
+ useCollapsible.useCollapsible({
68
+ container,
69
+ triggerCollapse: collapseHeader,
70
+ disableHeaderCollapse
71
+ });
72
+ return /*#__PURE__*/React.createElement(react.Layer, _rollupPluginBabelHelpers.extends({
73
+ withBackground: true,
74
+ className: `${context.blockClass}__main-content ${className}`,
75
+ ref: mainContentRef
76
+ }, rest), children);
77
+ });
78
+
79
+ /**
80
+ * ----------------
81
+ * SummaryContent
82
+ * ----------------
83
+ */
84
+
85
+ const SummaryContent = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
86
+ let {
87
+ children,
88
+ className,
89
+ summaryPanelOpen = false,
90
+ onSummaryPanelClose
91
+ } = _ref3;
92
+ const {
93
+ isSm
94
+ } = React.useContext(context.TearsheetContext);
95
+ return !isSm ? /*#__PURE__*/React.createElement("div", {
96
+ className: `${context.blockClass}__summary-content ${className}`,
97
+ ref: ref
98
+ }, /*#__PURE__*/React.createElement("aside", null, children)) : /*#__PURE__*/React.createElement(SidePanel.SidePanel, {
99
+ size: "sm",
100
+ open: summaryPanelOpen,
101
+ onRequestClose: onSummaryPanelClose
102
+ }, children);
103
+ });
104
+ const Influencer = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
105
+ let {
106
+ children,
107
+ className,
108
+ influencerPanelOpen = false,
109
+ onInfluencerPanelClose
110
+ } = _ref4;
111
+ const {
112
+ isSm
113
+ } = React.useContext(context.TearsheetContext);
114
+ return !isSm ? /*#__PURE__*/React.createElement("aside", {
115
+ className: `${context.blockClass}__influencer ${className}`,
116
+ ref: ref
117
+ }, children) : /*#__PURE__*/React.createElement(SidePanel.SidePanel, {
118
+ size: "sm",
119
+ open: influencerPanelOpen,
120
+ onRequestClose: onInfluencerPanelClose,
121
+ placement: "left"
122
+ }, children);
123
+ });
124
+
125
+ exports.Influencer = Influencer;
126
+ exports.MainContent = MainContent;
127
+ exports.SummaryContent = SummaryContent;
128
+ exports.default = TearsheetBody;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
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 { IconButtonProps } from '@carbon/react';
8
+ import React, { ReactNode } from 'react';
9
+ /**
10
+ * ----------------
11
+ * TearsheetHeader
12
+ * ----------------
13
+ */
14
+ export interface TearsheetHeaderProps {
15
+ /**
16
+ * Provide the optional content for header section and will be render after header titles and before progress indicator.
17
+ * People can make use of this if they want to have custom header.
18
+ */
19
+ children?: React.ReactNode;
20
+ /**
21
+ * The accessibility title for the close icon (if shown).
22
+ *
23
+ * **Note:** This prop is only required if a close icon is shown, i.e. if
24
+ * there are a no navigation actions and/or hasCloseIcon is true.
25
+ */
26
+ closeIconDescription?: string;
27
+ /**
28
+ * Enable a close icon ('x') in the header area of the tearsheet. By default,
29
+ * (when this prop is omitted, or undefined or null) a tearsheet does not
30
+ * display a close icon if there are navigation actions ("transactional
31
+ * tearsheet") and displays one if there are no navigation actions ("passive
32
+ * tearsheet"), and that behavior can be overridden if required by setting
33
+ * this prop to either true or false.
34
+ */
35
+ hideCloseButton?: boolean;
36
+ className?: string;
37
+ /**
38
+ * Default header collapse/expand while scrolling the main content can bd disabled by setting this
39
+ */
40
+ disableHeaderCollapse?: boolean;
41
+ }
42
+ declare const TearsheetHeader: React.ForwardRefExoticComponent<TearsheetHeaderProps & React.RefAttributes<HTMLDivElement>>;
43
+ export default TearsheetHeader;
44
+ /**
45
+ * ----------------
46
+ * TearsheetNavigationBar
47
+ * ----------------
48
+ */
49
+ export interface TearsheetNavigationBarProps {
50
+ children: ReactNode;
51
+ scroller?: React.ReactNode;
52
+ className?: string;
53
+ }
54
+ export declare const TearsheetNavigationBar: React.ForwardRefExoticComponent<TearsheetNavigationBarProps & React.RefAttributes<HTMLDivElement>>;
55
+ /**
56
+ * ----------------
57
+ * TearsheetScrollButton
58
+ * ----------------
59
+ */
60
+ export interface TearsheetScrollButtonProps extends IconButtonProps {
61
+ collapseText?: string;
62
+ expandText?: string;
63
+ className?: string;
64
+ }
65
+ export declare const TearsheetScrollButton: React.ForwardRefExoticComponent<TearsheetScrollButtonProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2025
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
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var react = require('@carbon/react');
14
+ var React = require('react');
15
+ var cx = require('classnames');
16
+ var context = require('./context.js');
17
+ var icons = require('@carbon/react/icons');
18
+
19
+ /**
20
+ * ----------------
21
+ * TearsheetHeader
22
+ * ----------------
23
+ */
24
+
25
+ const TearsheetHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
26
+ const {
27
+ children,
28
+ closeIconDescription,
29
+ hideCloseButton = false,
30
+ className,
31
+ disableHeaderCollapse,
32
+ ...rest
33
+ } = props;
34
+ const {
35
+ setHasCloseIcon,
36
+ fullyCollapsed,
37
+ onClose,
38
+ setDisableHeaderCollapse
39
+ } = React.useContext(context.TearsheetContext);
40
+ const localRef = React.useRef(undefined);
41
+ const headerRef = ref || localRef;
42
+ React.useEffect(() => {
43
+ setHasCloseIcon?.(!!hideCloseButton);
44
+ }, [hideCloseButton, setHasCloseIcon]);
45
+ React.useEffect(() => {
46
+ setDisableHeaderCollapse?.(!!disableHeaderCollapse);
47
+ }, [disableHeaderCollapse, setDisableHeaderCollapse]);
48
+ return /*#__PURE__*/React.createElement(react.ModalHeader, _rollupPluginBabelHelpers.extends({
49
+ ref: headerRef,
50
+ className: cx(`${context.blockClass}__header`, {
51
+ [`${className}`]: true,
52
+ [`${context.blockClass}__header--with-close-icon`]: !!hideCloseButton,
53
+ [`${context.blockClass}__header-collapsed`]: fullyCollapsed
54
+ }),
55
+ closeClassName: cx({
56
+ [`${context.blockClass}__header--no-close-icon`]: hideCloseButton
57
+ }),
58
+ closeModal: onClose,
59
+ iconDescription: closeIconDescription
60
+ }, rest), children);
61
+ });
62
+
63
+ /**
64
+ * ----------------
65
+ * TearsheetNavigationBar
66
+ * ----------------
67
+ */
68
+
69
+ const TearsheetNavigationBar = /*#__PURE__*/React.forwardRef((props, ref) => {
70
+ const {
71
+ children,
72
+ scroller,
73
+ className,
74
+ ...rest
75
+ } = props;
76
+ return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
77
+ className: `${context.blockClass}__navigation-bar ${className}`
78
+ }, rest), children, scroller);
79
+ });
80
+
81
+ /**
82
+ * ----------------
83
+ * TearsheetScrollButton
84
+ * ----------------
85
+ */
86
+
87
+ const TearsheetScrollButton = /*#__PURE__*/React.forwardRef(function PageHeaderExpander(_ref, ref) {
88
+ let {
89
+ className,
90
+ children,
91
+ label,
92
+ onClick,
93
+ collapseText = 'Collapse',
94
+ expandText = 'Expand',
95
+ ...other
96
+ } = _ref;
97
+ const {
98
+ fullyCollapsed,
99
+ setFullyCollapsed
100
+ } = React.useContext(context.TearsheetContext);
101
+ const handleScroller = isFullyCollapsed => {
102
+ setFullyCollapsed?.(!isFullyCollapsed);
103
+ };
104
+ return /*#__PURE__*/React.createElement("span", {
105
+ className: `${context.blockClass}__scroller-container ${className}`
106
+ }, /*#__PURE__*/React.createElement(react.IconButton, _rollupPluginBabelHelpers.extends({
107
+ ref: ref,
108
+ label: fullyCollapsed ? expandText : collapseText,
109
+ size: "md",
110
+ kind: "ghost",
111
+ autoAlign: true
112
+ }, other, {
113
+ onClick: event => {
114
+ onClick?.(event);
115
+ handleScroller(!!fullyCollapsed);
116
+ },
117
+ className: cx(className, `${context.blockClass}__scroller-button`)
118
+ }), /*#__PURE__*/React.createElement(icons.ChevronUp, {
119
+ className: cx(`${context.blockClass}__scroller-button-icon`, {
120
+ [`${context.blockClass}__scroller-button-icon-collapsed`]: fullyCollapsed
121
+ })
122
+ })));
123
+ });
124
+
125
+ exports.TearsheetNavigationBar = TearsheetNavigationBar;
126
+ exports.TearsheetScrollButton = TearsheetScrollButton;
127
+ exports.default = TearsheetHeader;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
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 { MenuButtonProps } from '@carbon/react';
8
+ import React, { ReactNode } from 'react';
9
+ /**
10
+ * ----------------
11
+ * TearsheetHeaderActions
12
+ * ----------------
13
+ */
14
+ type EnhancedChild = React.ReactElement<{
15
+ id: string;
16
+ menuItemLabel: string;
17
+ }>;
18
+ export interface TearsheetHeaderActionsProps {
19
+ /**
20
+ * Provide child elements to be rendered inside TearsheetHeaderActions.
21
+ */
22
+ children: EnhancedChild[];
23
+ /**
24
+ * Specify an optional className to be added to your TearsheetHeaderActions
25
+ */
26
+ className?: string;
27
+ /**
28
+ * The PageHeaderContent's page actions collapsible Menu button label
29
+ */
30
+ menuButtonProps?: MenuButtonProps;
31
+ }
32
+ export declare const TearsheetHeaderActions: ({ className, children, menuButtonProps, }: TearsheetHeaderActionsProps) => React.JSX.Element;
33
+ /**
34
+ * ----------------
35
+ * TearsheetHeaderActionsItem
36
+ * ----------------
37
+ */
38
+ export interface TearsheetHeaderActionItemProps {
39
+ /**
40
+ * Provide child elements to be rendered inside TearsheetHeaderActions.
41
+ */
42
+ children: ReactNode;
43
+ /**
44
+ * Specify an optional className to be added to your TearsheetHeaderActions
45
+ */
46
+ className?: string;
47
+ /**
48
+ * The PageHeaderContent's page actions collapsible Menu button label
49
+ */
50
+ overflowItemLabel?: string;
51
+ id?: string;
52
+ }
53
+ export declare const TearsheetHeaderActionItem: ({ children, className, }: TearsheetHeaderActionItemProps) => React.JSX.Element;
54
+ export {};
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2025
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
+
8
+ 'use strict';
9
+
10
+ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
11
+ var react = require('@carbon/react');
12
+ var React = require('react');
13
+ var context = require('./context.js');
14
+ var utilities = require('@carbon/utilities');
15
+
16
+ /**
17
+ * ----------------
18
+ * TearsheetHeaderActions
19
+ * ----------------
20
+ */
21
+
22
+ const TearsheetHeaderActions = _ref => {
23
+ let {
24
+ className,
25
+ children,
26
+ menuButtonProps
27
+ } = _ref;
28
+ const containerRef = React.useRef(null);
29
+ const offsetRef = React.useRef(null);
30
+ const [menuButtonVisibility, setMenuButtonVisibility] = React.useState(false);
31
+ const [hiddenItems, setHiddenItems] = React.useState([]);
32
+ const hasOtherChildType = React.useRef(false);
33
+
34
+ // need to set the grid columns width based on the menu button's width
35
+ // to avoid overlapping when resizing
36
+ React.useLayoutEffect(() => {
37
+ if (menuButtonVisibility && offsetRef.current) {
38
+ const width = offsetRef.current.offsetWidth;
39
+ document.documentElement.style.setProperty('--tearsheet-header-title-grid-width', `${width}px`);
40
+ }
41
+ }, [menuButtonVisibility]);
42
+ const items = React.Children.toArray(children).filter(child => {
43
+ if (/*#__PURE__*/React.isValidElement(child) && child.type !== TearsheetHeaderActionItem) {
44
+ hasOtherChildType.current = true;
45
+ }
46
+ return /*#__PURE__*/React.isValidElement(child);
47
+ });
48
+ React.useLayoutEffect(() => {
49
+ //Menu button will be rendered only if they pass the items in TearsheetHeaderActionItem
50
+ if (!containerRef.current || hasOtherChildType.current) {
51
+ return;
52
+ }
53
+ utilities.createOverflowHandler({
54
+ container: containerRef.current,
55
+ onChange: (visible, hidden) => {
56
+ setHiddenItems(items?.slice(visible.length));
57
+ if (hidden.length > 0) {
58
+ setMenuButtonVisibility(true);
59
+ }
60
+ }
61
+ });
62
+ // eslint-disable-next-line react-hooks/exhaustive-deps
63
+ }, [containerRef.current]);
64
+ return /*#__PURE__*/React.createElement("div", {
65
+ className: `${context.blockClass}__content__header-actions ${className}`,
66
+ ref: containerRef
67
+ }, children, !hasOtherChildType.current && /*#__PURE__*/React.createElement("span", {
68
+ "data-offset": true,
69
+ "data-hidden": true,
70
+ ref: offsetRef
71
+ }, /*#__PURE__*/React.createElement(react.MenuButton, _rollupPluginBabelHelpers.extends({
72
+ size: "sm"
73
+ }, menuButtonProps), hiddenItems.map(item => {
74
+ if (! /*#__PURE__*/React.isValidElement(item)) {
75
+ return null;
76
+ }
77
+ const childProps = item.props;
78
+ return /*#__PURE__*/React.createElement(react.MenuItem, {
79
+ renderIcon: childProps?.children?.props?.renderIcon ?? undefined,
80
+ key: childProps.id,
81
+ onClick: childProps?.children?.props?.onClick,
82
+ label: childProps.overflowItemLabel
83
+ });
84
+ }))));
85
+ };
86
+
87
+ /**
88
+ * ----------------
89
+ * TearsheetHeaderActionsItem
90
+ * ----------------
91
+ */
92
+
93
+ const TearsheetHeaderActionItem = _ref2 => {
94
+ let {
95
+ children,
96
+ className
97
+ } = _ref2;
98
+ return /*#__PURE__*/React.createElement("div", {
99
+ className: `${context.blockClass}__header-action-item ${className}`
100
+ }, children);
101
+ };
102
+
103
+ exports.TearsheetHeaderActionItem = TearsheetHeaderActionItem;
104
+ exports.TearsheetHeaderActions = TearsheetHeaderActions;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ import { CarbonIconType } from '@carbon/react/icons';
9
+ export interface TearsheetHeaderContentProps {
10
+ /**
11
+ * Provide the optional content for header section and will be render after header titles and before progress indicator.
12
+ * People can make use of this if they want to have custom header.
13
+ */
14
+ children?: React.ReactNode;
15
+ title: string;
16
+ label?: string;
17
+ description?: string;
18
+ descriptionExpandLabel?: string;
19
+ descriptionCollapseLabel?: string;
20
+ titleIcon?: CarbonIconType;
21
+ titleIconPosition?: 'leading' | 'trailing';
22
+ /**
23
+ * The PageHeaderContent's page actions
24
+ */
25
+ headerActions?: React.ReactNode;
26
+ }
27
+ declare const TearsheetHeaderContent: React.ForwardRefExoticComponent<TearsheetHeaderContentProps & React.RefAttributes<HTMLDivElement>>;
28
+ export default TearsheetHeaderContent;
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2025
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
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var React = require('react');
13
+ var cx = require('classnames');
14
+ var context = require('./context.js');
15
+ var TruncatedText = require('../../TruncatedText/TruncatedText.js');
16
+
17
+ const TearsheetHeaderContent = /*#__PURE__*/React.forwardRef((props, ref) => {
18
+ const {
19
+ children,
20
+ label,
21
+ title,
22
+ description,
23
+ descriptionExpandLabel = 'Read more',
24
+ descriptionCollapseLabel = 'Read less',
25
+ titleIcon: Icon,
26
+ titleIconPosition = 'leading',
27
+ headerActions,
28
+ ...rest
29
+ } = props;
30
+ const {
31
+ isSm
32
+ } = React.useContext(context.TearsheetContext);
33
+ return /*#__PURE__*/React.createElement("div", {
34
+ className: `${context.blockClass}__header-content-wrapper`,
35
+ ref: ref
36
+ }, /*#__PURE__*/React.createElement("div", {
37
+ className: `${context.blockClass}__header-content`
38
+ }, /*#__PURE__*/React.createElement("p", {
39
+ className: `${context.blockClass}__header-label`
40
+ }, label), /*#__PURE__*/React.createElement("div", {
41
+ className: `${context.blockClass}__content__title-wrapper`
42
+ }, /*#__PURE__*/React.createElement("h2", {
43
+ className: cx(`${context.blockClass}__header-title`, {
44
+ [`${context.blockClass}__leading-icon`]: Icon && titleIconPosition === 'leading'
45
+ }, {
46
+ [`${context.blockClass}__trailing-icon`]: Icon && titleIconPosition === 'trailing'
47
+ })
48
+ }, !isSm && Icon && /*#__PURE__*/React.createElement(Icon, {
49
+ size: 32
50
+ }), /*#__PURE__*/React.createElement(TruncatedText.TruncatedText, {
51
+ id: `${context.blockClass}__header-title__truncatedText`,
52
+ className: `${context.blockClass}__content__title`,
53
+ align: "bottom",
54
+ autoAlign: true,
55
+ value: title
56
+ }))), /*#__PURE__*/React.createElement("div", {
57
+ className: `${context.blockClass}__header-description`
58
+ }, /*#__PURE__*/React.createElement(TruncatedText.TruncatedText, {
59
+ id: `${context.blockClass}__header-description__truncatedText`,
60
+ expandLabel: descriptionExpandLabel,
61
+ collapseLabel: descriptionCollapseLabel,
62
+ value: description,
63
+ type: "expand"
64
+ })), children && /*#__PURE__*/React.createElement("div", {
65
+ className: `${context.blockClass}__header-content--extra`
66
+ }, children)), headerActions && /*#__PURE__*/React.createElement("div", {
67
+ className: `${context.blockClass}__header-actions`
68
+ }, headerActions));
69
+ });
70
+
71
+ exports.default = TearsheetHeaderContent;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025, 2025
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, { ReactNode } from 'react';
8
+ import { StepState } from '../../../StepFlow';
9
+ interface Props {
10
+ children?: ReactNode;
11
+ influencer?: ((a: StepState) => ReactNode) | null;
12
+ open?: boolean;
13
+ onClose?: () => void;
14
+ title?: ReactNode;
15
+ hasCloseIcon?: boolean;
16
+ closeIconDescription?: string;
17
+ selectorPrimaryFocus?: string;
18
+ setOpen?: (open: boolean) => void;
19
+ progressIndicator?: 'vertical' | 'horizontal';
20
+ }
21
+ export declare const TearsheetWithSteps: ({ children, open, setOpen, onClose, influencer, title, hasCloseIcon, closeIconDescription, selectorPrimaryFocus, progressIndicator, ...rest }: Props) => React.JSX.Element;
22
+ export {};
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
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
+ /**
8
+ * -------------
9
+ * Context setup
10
+ * -------------
11
+ */
12
+ interface TearsheetContextType {
13
+ hasCloseIcon: boolean;
14
+ setHasCloseIcon?: (value: boolean) => void;
15
+ fullyCollapsed: boolean;
16
+ setFullyCollapsed?: (value: boolean) => void;
17
+ refs?: any;
18
+ onClose?: () => void;
19
+ disableHeaderCollapse?: boolean;
20
+ setDisableHeaderCollapse?: (value: boolean) => void;
21
+ variant: 'wide' | 'narrow';
22
+ isSm: boolean;
23
+ }
24
+ export declare const TearsheetContext: import("react").Context<TearsheetContextType>;
25
+ export declare const blockClass: string;
26
+ export {};