@carbon/ibm-products 2.70.1 → 2.71.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.
- package/css/carbon.css +317 -216
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +546 -270
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +387 -43
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +229 -54
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +242 -56
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/_virtual/_commonjsHelpers.js +1 -3
- package/es/_virtual/index2.js +2 -6
- package/es/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
- package/es/components/APIKeyModal/APIKeyDownloader.js +3 -3
- package/es/components/APIKeyModal/APIKeyModal.js +1 -1
- package/es/components/ActionSet/ActionSet.d.ts +4 -0
- package/es/components/ActionSet/ActionSet.js +46 -44
- package/es/components/AddSelect/AddSelectBody.js +1 -1
- package/es/components/Card/Card.d.ts +1 -0
- package/es/components/Coachmark/CoachmarkOverlay.js +5 -5
- package/es/components/Coachmark/CoachmarkTagline.js +2 -2
- package/es/components/Coachmark/utils/context.d.ts +28 -2
- package/es/components/Coachmark/utils/context.js +1 -1
- package/es/components/CoachmarkStack/CoachmarkStack.js +11 -8
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
- package/es/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/util.js +11 -4
- package/es/components/CreateModal/CreateModal.d.ts +4 -7
- package/es/components/CreateModal/CreateModal.js +4 -19
- package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
- package/es/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
- package/es/components/EditTearsheet/EditTearsheetForm.js +16 -4
- package/es/components/EmptyStates/EmptyState.js +0 -1
- package/es/components/FilterSummary/FilterSummary.d.ts +1 -0
- package/es/components/FilterSummary/FilterSummary.js +2 -1
- package/es/components/Guidebanner/Guidebanner.js +4 -20
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
- package/es/components/InterstitialScreen/InterstitialScreen.js +21 -21
- package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
- package/es/components/InterstitialScreen/InterstitialScreenBody.js +16 -11
- package/es/components/InterstitialScreen/InterstitialScreenFooter.js +15 -13
- package/es/components/InterstitialScreen/InterstitialScreenHeader.js +13 -8
- package/es/components/InterstitialScreen/index.d.ts +4 -1
- package/es/components/Nav/NavItemLink.js +1 -4
- package/es/components/PageHeader/PageHeaderTitle.js +1 -1
- package/es/components/PageHeader/next/PageHeader.d.ts +277 -0
- package/es/components/PageHeader/next/PageHeader.js +475 -0
- package/es/components/PageHeader/next/index.d.ts +8 -0
- package/es/components/ScrollGradient/ScrollGradient.js +4 -4
- package/es/components/SidePanel/SidePanel.js +25 -20
- package/es/components/StringFormatter/StringFormatter.js +3 -0
- package/es/components/Tearsheet/Tearsheet.js +4 -7
- package/es/components/Tearsheet/TearsheetNarrow.js +1 -4
- package/es/components/Tearsheet/TearsheetShell.js +1 -1
- package/es/components/UserAvatar/UserAvatar.js +5 -7
- package/es/components/UserProfileImage/UserProfileImage.d.ts +1 -0
- package/es/components/UserProfileImage/UserProfileImage.js +12 -6
- package/es/components/index.d.ts +1 -0
- package/es/global/js/package-settings.js +1 -1
- package/es/index.js +3 -0
- package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/es/node_modules/prop-types/index.js +1 -1
- package/lib/_virtual/_commonjsHelpers.js +0 -3
- package/lib/_virtual/index2.js +2 -8
- package/lib/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
- package/lib/components/APIKeyModal/APIKeyDownloader.js +3 -3
- package/lib/components/APIKeyModal/APIKeyModal.js +1 -1
- package/lib/components/ActionSet/ActionSet.d.ts +4 -0
- package/lib/components/ActionSet/ActionSet.js +46 -43
- package/lib/components/AddSelect/AddSelectBody.js +1 -1
- package/lib/components/Card/Card.d.ts +1 -0
- package/lib/components/Coachmark/CoachmarkOverlay.js +5 -5
- package/lib/components/Coachmark/CoachmarkTagline.js +2 -2
- package/lib/components/Coachmark/utils/context.d.ts +28 -2
- package/lib/components/Coachmark/utils/context.js +1 -1
- package/lib/components/CoachmarkStack/CoachmarkStack.js +11 -8
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
- package/lib/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/util.js +11 -4
- package/lib/components/CreateModal/CreateModal.d.ts +4 -7
- package/lib/components/CreateModal/CreateModal.js +4 -19
- package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
- package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
- package/lib/components/EditTearsheet/EditTearsheetForm.js +16 -4
- package/lib/components/EmptyStates/EmptyState.js +0 -1
- package/lib/components/FilterSummary/FilterSummary.d.ts +1 -0
- package/lib/components/FilterSummary/FilterSummary.js +2 -1
- package/lib/components/Guidebanner/Guidebanner.js +4 -20
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
- package/lib/components/InterstitialScreen/InterstitialScreen.js +21 -20
- package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
- package/lib/components/InterstitialScreen/InterstitialScreenBody.js +19 -14
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +20 -18
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +15 -10
- package/lib/components/InterstitialScreen/index.d.ts +4 -1
- package/lib/components/Nav/NavItemLink.js +1 -4
- package/lib/components/PageHeader/PageHeaderTitle.js +1 -1
- package/lib/components/PageHeader/next/PageHeader.d.ts +277 -0
- package/lib/components/PageHeader/next/PageHeader.js +490 -0
- package/lib/components/PageHeader/next/index.d.ts +8 -0
- package/lib/components/ScrollGradient/ScrollGradient.js +4 -4
- package/lib/components/SidePanel/SidePanel.js +26 -21
- package/lib/components/StringFormatter/StringFormatter.js +3 -0
- package/lib/components/Tearsheet/Tearsheet.js +4 -7
- package/lib/components/Tearsheet/TearsheetNarrow.js +1 -4
- package/lib/components/Tearsheet/TearsheetShell.js +1 -1
- package/lib/components/UserAvatar/UserAvatar.js +5 -7
- package/lib/components/UserProfileImage/UserProfileImage.d.ts +1 -0
- package/lib/components/UserProfileImage/UserProfileImage.js +12 -6
- package/lib/components/index.d.ts +1 -0
- package/lib/global/js/package-settings.js +1 -1
- package/lib/index.js +5 -2
- package/lib/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/lib/node_modules/prop-types/index.js +1 -1
- package/package.json +22 -30
- package/scss/components/CoachmarkStack/_coachmark-stack.scss +12 -1
- package/scss/components/InterstitialScreen/_interstitial-screen.scss +7 -11
- package/scss/components/PageHeader/_page-header.scss +198 -0
- package/scss/components/SidePanel/_side-panel.scss +2 -52
- package/scss/components/_index-released-only.scss +1 -0
- package/telemetry.yml +12 -13
- package/es/_virtual/index3.js +0 -10
- package/es/components/SidePanel/resizer/Resizer.d.ts +0 -21
- package/es/components/SidePanel/resizer/Resizer.js +0 -271
- package/es/node_modules/lodash.debounce/index.js +0 -367
- package/lib/_virtual/index3.js +0 -12
- package/lib/components/SidePanel/resizer/Resizer.d.ts +0 -21
- package/lib/components/SidePanel/resizer/Resizer.js +0 -277
- package/lib/node_modules/lodash.debounce/index.js +0 -369
- /package/es/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
- /package/lib/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
@@ -0,0 +1,475 @@
|
|
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
|
+
import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
+
import React__default, { useRef, useState, useLayoutEffect, useMemo, useEffect, useCallback } from 'react';
|
10
|
+
import PropTypes from '../../../_virtual/index.js';
|
11
|
+
import cx from 'classnames';
|
12
|
+
import { Grid, Column, DefinitionTooltip, unstable_Text, Tag, Popover, OperationalTag, PopoverContent, MenuButton, MenuItem, AspectRatio } from '@carbon/react';
|
13
|
+
import { breakpoints } from '@carbon/layout';
|
14
|
+
import { blockClass } from '../PageHeaderUtils.js';
|
15
|
+
import { createOverflowHandler } from '@carbon/utilities';
|
16
|
+
import { useOverflowItems } from '../../../global/js/hooks/useOverflowItems/useOverflowItems.js';
|
17
|
+
import { useId } from '../../../global/js/utils/useId.js';
|
18
|
+
|
19
|
+
/**
|
20
|
+
* ----------
|
21
|
+
* PageHeader
|
22
|
+
* ----------
|
23
|
+
*/
|
24
|
+
|
25
|
+
const PageHeader = /*#__PURE__*/React__default.forwardRef(function PageHeader(_ref, ref) {
|
26
|
+
let {
|
27
|
+
className,
|
28
|
+
children,
|
29
|
+
...other
|
30
|
+
} = _ref;
|
31
|
+
const classNames = cx({
|
32
|
+
[`${blockClass}`]: true,
|
33
|
+
[`${blockClass}__next`]: true
|
34
|
+
}, className);
|
35
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({
|
36
|
+
className: classNames,
|
37
|
+
ref: ref
|
38
|
+
}, other), children);
|
39
|
+
});
|
40
|
+
PageHeader.displayName = 'PageHeader';
|
41
|
+
|
42
|
+
/**
|
43
|
+
* -----------------------
|
44
|
+
* PageHeaderBreadcrumbBar
|
45
|
+
* -----------------------
|
46
|
+
*/
|
47
|
+
|
48
|
+
const PageHeaderBreadcrumbBar = /*#__PURE__*/React__default.forwardRef(function PageHeaderBreadcrumbBar(_ref2, ref) {
|
49
|
+
let {
|
50
|
+
border = true,
|
51
|
+
className,
|
52
|
+
children,
|
53
|
+
renderIcon: IconElement,
|
54
|
+
contentActions,
|
55
|
+
contentActionsFlush,
|
56
|
+
pageActions,
|
57
|
+
pageActionsFlush,
|
58
|
+
...other
|
59
|
+
} = _ref2;
|
60
|
+
const classNames = cx({
|
61
|
+
[`${blockClass}__breadcrumb-bar`]: true,
|
62
|
+
[`${blockClass}__breadcrumb-bar-border`]: border,
|
63
|
+
[`${blockClass}__breadcrumb__actions-flush`]: pageActionsFlush
|
64
|
+
}, className);
|
65
|
+
const contentActionsClasses = cx({
|
66
|
+
[`${blockClass}__breadcrumb__content-actions`]: !contentActionsFlush
|
67
|
+
});
|
68
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({
|
69
|
+
className: classNames,
|
70
|
+
ref: ref
|
71
|
+
}, other), /*#__PURE__*/React__default.createElement(Grid, null, /*#__PURE__*/React__default.createElement(Column, {
|
72
|
+
lg: 16,
|
73
|
+
md: 8,
|
74
|
+
sm: 4
|
75
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
76
|
+
className: `${blockClass}__breadcrumb-container`
|
77
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
78
|
+
className: `${blockClass}__breadcrumb-wrapper`
|
79
|
+
}, IconElement && /*#__PURE__*/React__default.createElement("div", {
|
80
|
+
className: `${blockClass}__breadcrumb__icon`
|
81
|
+
}, /*#__PURE__*/React__default.createElement(IconElement, null)), children), /*#__PURE__*/React__default.createElement("div", {
|
82
|
+
className: `${blockClass}__breadcrumb__actions`
|
83
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
84
|
+
className: contentActionsClasses
|
85
|
+
}, contentActions), pageActions)))));
|
86
|
+
});
|
87
|
+
PageHeaderBreadcrumbBar.displayName = 'PageHeaderBreadcrumbBar';
|
88
|
+
|
89
|
+
/**
|
90
|
+
* -----------------
|
91
|
+
* PageHeaderContent
|
92
|
+
* -----------------
|
93
|
+
*/
|
94
|
+
|
95
|
+
const PageHeaderContent = /*#__PURE__*/React__default.forwardRef(function PageHeaderContent(_ref3, ref) {
|
96
|
+
let {
|
97
|
+
className,
|
98
|
+
children,
|
99
|
+
title,
|
100
|
+
renderIcon: IconElement,
|
101
|
+
contextualActions,
|
102
|
+
pageActions,
|
103
|
+
...other
|
104
|
+
} = _ref3;
|
105
|
+
const classNames = cx({
|
106
|
+
[`${blockClass}__content`]: true
|
107
|
+
}, className);
|
108
|
+
const titleRef = useRef(null);
|
109
|
+
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
110
|
+
const isEllipsisActive = element => {
|
111
|
+
setIsEllipsisApplied(element.offsetHeight < element.scrollHeight);
|
112
|
+
return element.offsetHeight < element.scrollHeight;
|
113
|
+
};
|
114
|
+
useLayoutEffect(() => {
|
115
|
+
titleRef.current && isEllipsisActive(titleRef.current);
|
116
|
+
}, [title]);
|
117
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({
|
118
|
+
className: classNames,
|
119
|
+
ref: ref
|
120
|
+
}, other), /*#__PURE__*/React__default.createElement(Grid, null, /*#__PURE__*/React__default.createElement(Column, {
|
121
|
+
lg: 16,
|
122
|
+
md: 8,
|
123
|
+
sm: 4
|
124
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
125
|
+
className: `${blockClass}__content__title-wrapper`
|
126
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
127
|
+
className: `${blockClass}__content__start`
|
128
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
129
|
+
className: `${blockClass}__content__title-container`
|
130
|
+
}, IconElement && /*#__PURE__*/React__default.createElement("div", {
|
131
|
+
className: `${blockClass}__content__icon`
|
132
|
+
}, /*#__PURE__*/React__default.createElement(IconElement, null)), isEllipsisApplied ? /*#__PURE__*/React__default.createElement(DefinitionTooltip, {
|
133
|
+
definition: title
|
134
|
+
}, /*#__PURE__*/React__default.createElement(unstable_Text, {
|
135
|
+
ref: titleRef,
|
136
|
+
as: "h4",
|
137
|
+
className: `${blockClass}__content__title`
|
138
|
+
}, title)) : /*#__PURE__*/React__default.createElement(unstable_Text, {
|
139
|
+
ref: titleRef,
|
140
|
+
as: "h4",
|
141
|
+
className: `${blockClass}__content__title`
|
142
|
+
}, title)), contextualActions && /*#__PURE__*/React__default.createElement("div", {
|
143
|
+
className: `${blockClass}__content__contextual-actions`
|
144
|
+
}, contextualActions)), pageActions), children)));
|
145
|
+
});
|
146
|
+
PageHeaderContent.displayName = 'PageHeaderContent';
|
147
|
+
PageHeaderContent.propTypes = {
|
148
|
+
/**
|
149
|
+
* Provide child elements to be rendered inside PageHeaderContent.
|
150
|
+
*/
|
151
|
+
children: PropTypes.node,
|
152
|
+
/**
|
153
|
+
* Specify an optional className to be added to your PageHeaderContent
|
154
|
+
*/
|
155
|
+
className: PropTypes.string,
|
156
|
+
/**
|
157
|
+
* The PageHeaderContent's contextual actions
|
158
|
+
*/
|
159
|
+
contextualActions: PropTypes.node,
|
160
|
+
/**
|
161
|
+
* The PageHeaderContent's page actions
|
162
|
+
*/
|
163
|
+
pageActions: PropTypes.node,
|
164
|
+
/**
|
165
|
+
* Provide an optional icon to render in front of the PageHeaderContent's title.
|
166
|
+
*/
|
167
|
+
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
168
|
+
/**
|
169
|
+
* The PageHeaderContent's subtitle
|
170
|
+
*/
|
171
|
+
subtitle: PropTypes.string,
|
172
|
+
/**
|
173
|
+
* The PageHeaderContent's title
|
174
|
+
*/
|
175
|
+
title: PropTypes.string.isRequired
|
176
|
+
};
|
177
|
+
|
178
|
+
/**
|
179
|
+
* ----------------
|
180
|
+
* PageHeaderContentPageActions
|
181
|
+
* ----------------
|
182
|
+
*/
|
183
|
+
|
184
|
+
const PageHeaderContentPageActions = _ref4 => {
|
185
|
+
let {
|
186
|
+
className,
|
187
|
+
children,
|
188
|
+
menuButtonLabel = 'Actions',
|
189
|
+
actions,
|
190
|
+
...other
|
191
|
+
} = _ref4;
|
192
|
+
const classNames = cx({
|
193
|
+
[`${blockClass}__content__page-actions`]: true
|
194
|
+
}, className);
|
195
|
+
const containerRef = useRef(null);
|
196
|
+
const offsetRef = useRef(null);
|
197
|
+
const [menuButtonVisibility, setMenuButtonVisibility] = useState(false);
|
198
|
+
const [hiddenItems, setHiddenItems] = useState([]);
|
199
|
+
|
200
|
+
// need to set the grid columns width based on the menu button's width
|
201
|
+
// to avoid overlapping when resizing
|
202
|
+
useLayoutEffect(() => {
|
203
|
+
if (menuButtonVisibility && offsetRef.current) {
|
204
|
+
const width = offsetRef.current.offsetWidth;
|
205
|
+
document.documentElement.style.setProperty('--page-header-title-grid-width', `${width}px`);
|
206
|
+
}
|
207
|
+
}, [menuButtonVisibility]);
|
208
|
+
useEffect(() => {
|
209
|
+
if (!containerRef.current || !Array.isArray(actions)) {
|
210
|
+
return;
|
211
|
+
}
|
212
|
+
createOverflowHandler({
|
213
|
+
container: containerRef.current,
|
214
|
+
// exclude the hidden menu button from children
|
215
|
+
maxVisibleItems: containerRef.current.children.length - 1,
|
216
|
+
onChange: (visible, hidden) => {
|
217
|
+
setHiddenItems(actions?.slice(visible.length));
|
218
|
+
if (hidden.length > 0) {
|
219
|
+
setMenuButtonVisibility(true);
|
220
|
+
}
|
221
|
+
}
|
222
|
+
});
|
223
|
+
}, [actions]);
|
224
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({
|
225
|
+
className: classNames,
|
226
|
+
ref: containerRef
|
227
|
+
}, other), Array.isArray(actions) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, actions.map(action => /*#__PURE__*/React__default.createElement("div", {
|
228
|
+
key: action.id
|
229
|
+
}, /*#__PURE__*/React__default.cloneElement(action.body, {
|
230
|
+
...action.body.props,
|
231
|
+
onClick: action.onClick
|
232
|
+
}))), /*#__PURE__*/React__default.createElement("span", {
|
233
|
+
"data-offset": true,
|
234
|
+
"data-hidden": true,
|
235
|
+
ref: offsetRef
|
236
|
+
}, /*#__PURE__*/React__default.createElement(MenuButton, {
|
237
|
+
menuAlignment: "bottom-end",
|
238
|
+
label: menuButtonLabel,
|
239
|
+
size: "md"
|
240
|
+
}, [...hiddenItems].reverse().map(item => /*#__PURE__*/React__default.createElement(MenuItem, _extends({
|
241
|
+
key: item.id,
|
242
|
+
onClick: item.onClick
|
243
|
+
}, item.menuItem)))))));
|
244
|
+
};
|
245
|
+
PageHeaderContentPageActions.displayName = 'PageHeaderContentPageActions';
|
246
|
+
PageHeaderContentPageActions.propTypes = {
|
247
|
+
/**
|
248
|
+
* The PageHeaderContent's page actions
|
249
|
+
*/
|
250
|
+
actions: PropTypes.oneOfType([PropTypes.node, PropTypes.array]),
|
251
|
+
/**
|
252
|
+
* Provide child elements to be rendered inside PageHeaderContentPageActions.
|
253
|
+
*/
|
254
|
+
children: PropTypes.node,
|
255
|
+
/**
|
256
|
+
* Specify an optional className to be added to your PageHeaderContentPageActions
|
257
|
+
*/
|
258
|
+
className: PropTypes.string,
|
259
|
+
/**
|
260
|
+
* The PageHeaderContent's collapsible Menu button label
|
261
|
+
*/
|
262
|
+
menuButtonLabel: PropTypes.string
|
263
|
+
};
|
264
|
+
|
265
|
+
/**
|
266
|
+
* ----------------
|
267
|
+
* PageHeaderContentText
|
268
|
+
* ----------------
|
269
|
+
*/
|
270
|
+
|
271
|
+
const PageHeaderContentText = _ref5 => {
|
272
|
+
let {
|
273
|
+
className,
|
274
|
+
children,
|
275
|
+
subtitle,
|
276
|
+
...other
|
277
|
+
} = _ref5;
|
278
|
+
const classNames = cx({
|
279
|
+
[`${blockClass}__content__body`]: true
|
280
|
+
}, className);
|
281
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({
|
282
|
+
className: classNames
|
283
|
+
}, other), subtitle && /*#__PURE__*/React__default.createElement(unstable_Text, {
|
284
|
+
as: "h3",
|
285
|
+
className: `${blockClass}__content__subtitle`
|
286
|
+
}, subtitle), children);
|
287
|
+
};
|
288
|
+
PageHeaderContentText.displayName = 'PageHeaderContentText';
|
289
|
+
PageHeaderContentText.propTypes = {
|
290
|
+
/**
|
291
|
+
* Provide child elements to be rendered inside PageHeaderContentText.
|
292
|
+
*/
|
293
|
+
children: PropTypes.node,
|
294
|
+
/**
|
295
|
+
* Specify an optional className to be added to your PageHeaderContentText
|
296
|
+
*/
|
297
|
+
className: PropTypes.string,
|
298
|
+
/**
|
299
|
+
* The PageHeaderContent's subtitle
|
300
|
+
*/
|
301
|
+
subtitle: PropTypes.string
|
302
|
+
};
|
303
|
+
|
304
|
+
/**
|
305
|
+
* ----------------
|
306
|
+
* PageHeaderHeroImage
|
307
|
+
* ----------------
|
308
|
+
*/
|
309
|
+
|
310
|
+
const PageHeaderHeroImage = _ref6 => {
|
311
|
+
let {
|
312
|
+
className,
|
313
|
+
children,
|
314
|
+
...other
|
315
|
+
} = _ref6;
|
316
|
+
const [lgBreakpoint, setLgBreakpoint] = useState(false);
|
317
|
+
const classNames = cx({
|
318
|
+
[`${blockClass}__hero-image`]: true
|
319
|
+
}, className);
|
320
|
+
const lgMediaQuery = `(min-width: ${breakpoints.lg.width})`;
|
321
|
+
useEffect(() => {
|
322
|
+
const listener = event => {
|
323
|
+
setLgBreakpoint(event.matches);
|
324
|
+
};
|
325
|
+
const mediaQueryList = window.matchMedia(lgMediaQuery);
|
326
|
+
mediaQueryList.addEventListener('change', listener);
|
327
|
+
setLgBreakpoint(mediaQueryList.matches);
|
328
|
+
return () => {
|
329
|
+
mediaQueryList.removeEventListener('change', listener);
|
330
|
+
};
|
331
|
+
}, [lgMediaQuery]);
|
332
|
+
return /*#__PURE__*/React__default.createElement(AspectRatio, _extends({
|
333
|
+
className: classNames
|
334
|
+
}, other, {
|
335
|
+
ratio: lgBreakpoint ? '2x1' : '3x2'
|
336
|
+
}), children);
|
337
|
+
};
|
338
|
+
PageHeaderHeroImage.displayName = 'PageHeaderHeroImage';
|
339
|
+
PageHeaderHeroImage.propTypes = {
|
340
|
+
/**
|
341
|
+
* Provide child elements to be rendered inside PageHeaderHeroImage.
|
342
|
+
*/
|
343
|
+
children: PropTypes.node,
|
344
|
+
/**
|
345
|
+
* Specify an optional className to be added to your PageHeaderHeroImage
|
346
|
+
*/
|
347
|
+
className: PropTypes.string
|
348
|
+
};
|
349
|
+
|
350
|
+
/**
|
351
|
+
* ----------------
|
352
|
+
* PageHeaderTabBar
|
353
|
+
* ----------------
|
354
|
+
*/
|
355
|
+
|
356
|
+
const PageHeaderTabBar = /*#__PURE__*/React__default.forwardRef(function PageHeaderTabBar(_ref7, ref) {
|
357
|
+
let {
|
358
|
+
className,
|
359
|
+
children,
|
360
|
+
tags = [],
|
361
|
+
...other
|
362
|
+
} = _ref7;
|
363
|
+
const classNames = cx({
|
364
|
+
[`${blockClass}__tab-bar`]: true
|
365
|
+
}, className);
|
366
|
+
// Early return if no tags are provided
|
367
|
+
if (!tags.length) {
|
368
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({
|
369
|
+
className: classNames,
|
370
|
+
ref: ref
|
371
|
+
}, other), /*#__PURE__*/React__default.createElement(Grid, null, /*#__PURE__*/React__default.createElement(Column, {
|
372
|
+
lg: 16,
|
373
|
+
md: 8,
|
374
|
+
sm: 4
|
375
|
+
}, children)));
|
376
|
+
}
|
377
|
+
const [openPopover, setOpenPopover] = useState(false);
|
378
|
+
const tagSize = tags[0]?.size || 'md';
|
379
|
+
const instanceId = useId('PageHeaderTabBar');
|
380
|
+
const tagsWithIds = useMemo(() => {
|
381
|
+
return tags.map((tag, index) => ({
|
382
|
+
...tag,
|
383
|
+
id: tag.id || `tag-${index}-${instanceId}`
|
384
|
+
}));
|
385
|
+
}, [instanceId, tags]);
|
386
|
+
const tagsContainerRef = useRef(null);
|
387
|
+
const offsetRef = useRef(null);
|
388
|
+
// To close popover when window resizes
|
389
|
+
useEffect(() => {
|
390
|
+
const handleResize = () => {
|
391
|
+
// Close the popover when window resizes to prevent unwanted opens
|
392
|
+
setOpenPopover(false);
|
393
|
+
};
|
394
|
+
window.addEventListener('resize', handleResize);
|
395
|
+
return () => {
|
396
|
+
window.removeEventListener('resize', handleResize);
|
397
|
+
};
|
398
|
+
}, []);
|
399
|
+
|
400
|
+
// overflow items hook
|
401
|
+
const {
|
402
|
+
visibleItems = [],
|
403
|
+
hiddenItems = [],
|
404
|
+
itemRefHandler = () => {}
|
405
|
+
} = useOverflowItems(tagsWithIds, tagsContainerRef, offsetRef) || {
|
406
|
+
visibleItems: [],
|
407
|
+
hiddenItems: [],
|
408
|
+
itemRefHandler: () => {}
|
409
|
+
};
|
410
|
+
const handleOverflowClick = useCallback(event => {
|
411
|
+
event.stopPropagation();
|
412
|
+
setOpenPopover(prev => !prev);
|
413
|
+
}, []);
|
414
|
+
|
415
|
+
// Function to render tags
|
416
|
+
const renderTags = () => /*#__PURE__*/React__default.createElement("div", {
|
417
|
+
className: `${blockClass}__tags`,
|
418
|
+
ref: tagsContainerRef
|
419
|
+
}, visibleItems.map(tag => /*#__PURE__*/React__default.createElement(Tag, {
|
420
|
+
key: tag.id,
|
421
|
+
ref: node => itemRefHandler(tag.id, node),
|
422
|
+
type: tag.type,
|
423
|
+
size: tag.size,
|
424
|
+
className: `${blockClass}__tag-item`
|
425
|
+
}, tag.text)), hiddenItems.length > 0 && /*#__PURE__*/React__default.createElement(Popover, {
|
426
|
+
open: openPopover,
|
427
|
+
onRequestClose: () => setOpenPopover(false)
|
428
|
+
}, /*#__PURE__*/React__default.createElement(OperationalTag, {
|
429
|
+
onClick: handleOverflowClick,
|
430
|
+
"aria-expanded": openPopover,
|
431
|
+
text: `+${hiddenItems.length}`,
|
432
|
+
size: tagSize
|
433
|
+
}), /*#__PURE__*/React__default.createElement(PopoverContent, {
|
434
|
+
className: "tag-popover-content"
|
435
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
436
|
+
className: `${blockClass}__tags-popover-list`
|
437
|
+
}, hiddenItems.map(tag => /*#__PURE__*/React__default.createElement(Tag, {
|
438
|
+
key: tag.id,
|
439
|
+
type: tag.type,
|
440
|
+
size: tag.size
|
441
|
+
}, tag.text))))));
|
442
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({
|
443
|
+
className: classNames,
|
444
|
+
ref: ref
|
445
|
+
}, other), /*#__PURE__*/React__default.createElement(Grid, null, /*#__PURE__*/React__default.createElement(Column, {
|
446
|
+
lg: 16,
|
447
|
+
md: 8,
|
448
|
+
sm: 4
|
449
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
450
|
+
className: `${blockClass}__tab-bar--tablist`
|
451
|
+
}, children, tags.length > 0 && renderTags()))));
|
452
|
+
});
|
453
|
+
PageHeaderTabBar.displayName = 'PageHeaderTabBar';
|
454
|
+
|
455
|
+
/**
|
456
|
+
* -------
|
457
|
+
* Exports
|
458
|
+
* -------
|
459
|
+
*/
|
460
|
+
const Root = PageHeader;
|
461
|
+
Root.displayName = 'PageHeader.Root';
|
462
|
+
const BreadcrumbBar = PageHeaderBreadcrumbBar;
|
463
|
+
BreadcrumbBar.displayName = 'PageHeaderBreadcrumbBar';
|
464
|
+
const Content = PageHeaderContent;
|
465
|
+
Content.displayName = 'PageHeaderContent';
|
466
|
+
const ContentPageActions = PageHeaderContentPageActions;
|
467
|
+
ContentPageActions.displayName = 'PageHeaderContentPageActions';
|
468
|
+
const ContentText = PageHeaderContentText;
|
469
|
+
ContentText.displayName = 'PageHeaderContentText';
|
470
|
+
const HeroImage = PageHeaderHeroImage;
|
471
|
+
HeroImage.displayName = 'PageHeaderHeroImage';
|
472
|
+
const TabBar = PageHeaderTabBar;
|
473
|
+
TabBar.displayName = 'PageHeaderTabBar';
|
474
|
+
|
475
|
+
export { BreadcrumbBar, Content, ContentPageActions, ContentText, HeroImage, PageHeader, PageHeaderBreadcrumbBar, PageHeaderContent, PageHeaderContentPageActions, PageHeaderContentText, PageHeaderHeroImage, PageHeaderTabBar, Root, TabBar };
|
@@ -0,0 +1,8 @@
|
|
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
|
+
export { PageHeader, PageHeaderBreadcrumbBar, PageHeaderContent, PageHeaderContentPageActions, PageHeaderContentText, PageHeaderTabBar, PageHeaderHeroImage, Root, BreadcrumbBar, Content, ContentPageActions, ContentText, TabBar, HeroImage, } from './PageHeader';
|
8
|
+
export type { PageHeaderProps, PageHeaderBreadcrumbBarProps, PageHeaderContentProps, PageHeaderContentPageActionsProps, PageHeaderContentTextProps, PageHeaderTabBarProps, PageHeaderHeroImageProps, } from './PageHeader';
|
@@ -39,10 +39,10 @@ let ScrollGradient = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
39
39
|
hideStartGradient = defaults.hideStartGradient,
|
40
40
|
...rest
|
41
41
|
} = _ref;
|
42
|
-
const intersectionStartRef = useRef();
|
43
|
-
const intersectionEndRef = useRef();
|
44
|
-
const intersectionLeftRef = useRef();
|
45
|
-
const intersectionRightRef = useRef();
|
42
|
+
const intersectionStartRef = useRef(undefined);
|
43
|
+
const intersectionEndRef = useRef(undefined);
|
44
|
+
const intersectionLeftRef = useRef(undefined);
|
45
|
+
const intersectionRightRef = useRef(undefined);
|
46
46
|
const carbonPrefix = usePrefix();
|
47
47
|
const fallbackColor = `var(--${carbonPrefix}-layer-01)`;
|
48
48
|
const scrollContainer = useRef(undefined);
|
@@ -11,7 +11,7 @@ import { Button, Section, IconButton, Heading } from '@carbon/react';
|
|
11
11
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
12
12
|
import React__default, { useState, useRef, useEffect, useCallback } from 'react';
|
13
13
|
import { ActionSet } from '../ActionSet/ActionSet.js';
|
14
|
-
import { Resizer } from '
|
14
|
+
import { Resizer } from '@carbon-labs/react-resizer';
|
15
15
|
import PropTypes from '../../_virtual/index.js';
|
16
16
|
import { SIDE_PANEL_SIZES } from './constants.js';
|
17
17
|
import { allPropTypes } from '../../global/js/utils/props-helper.js';
|
@@ -42,10 +42,8 @@ const defaults = {
|
|
42
42
|
/**
|
43
43
|
* Side panels keep users in-context of a page while performing tasks like navigating, editing, viewing details, or configuring something new.
|
44
44
|
*/
|
45
|
-
const SidePanelBase = /*#__PURE__*/React__default.forwardRef((
|
46
|
-
|
47
|
-
// The component props, in alphabetical order (for consistency).
|
48
|
-
|
45
|
+
const SidePanelBase = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
46
|
+
const {
|
49
47
|
actionToolbarButtons,
|
50
48
|
actions,
|
51
49
|
aiLabel,
|
@@ -75,9 +73,8 @@ const SidePanelBase = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
75
73
|
subtitle,
|
76
74
|
title,
|
77
75
|
launcherButtonRef,
|
78
|
-
// Collect any other property values passed in.
|
79
76
|
...rest
|
80
|
-
} =
|
77
|
+
} = props;
|
81
78
|
const [animationComplete, setAnimationComplete] = useState(false);
|
82
79
|
const localRef = useRef(null);
|
83
80
|
const sidePanelRef = ref || localRef;
|
@@ -171,14 +168,22 @@ const SidePanelBase = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
171
168
|
}
|
172
169
|
setWidth((sidePanelWidth.current ?? 0) - (placement === 'right' ? delta : -delta));
|
173
170
|
}, [placement, sidePanelRef, sidePanelWidth]);
|
171
|
+
const getPanelWidthPercent = useCallback(customWidth => {
|
172
|
+
if (customWidth) {
|
173
|
+
const remValue = parseFloat(customWidth);
|
174
|
+
const remInPixels = remValue * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
175
|
+
return Math.round(remInPixels / window.innerWidth * 100);
|
176
|
+
}
|
177
|
+
return Math.round((sidePanelRef.current?.clientWidth || 0) / window.innerWidth * 100);
|
178
|
+
}, [sidePanelRef]);
|
174
179
|
const onResizeEnd = useCallback((_, ref) => {
|
175
180
|
accumulatedDeltaRef.current = 0;
|
176
181
|
sidePanelRef.current?.style?.removeProperty('transition');
|
177
|
-
const percent = Math.round((sidePanelRef.current.clientWidth || 0) / window.innerWidth * 100);
|
178
182
|
// custom a11y announcements
|
179
|
-
ref.current.setAttribute('aria-label', `side panel is covering ${
|
183
|
+
ref.current.setAttribute('aria-label', `side panel is covering ${getPanelWidthPercent()}% of screen`);
|
184
|
+
ref.current.setAttribute('aria-valuenow', getPanelWidthPercent());
|
180
185
|
sidePanelWidth.current = sidePanelRef.current?.clientWidth;
|
181
|
-
}, [sidePanelRef]);
|
186
|
+
}, [sidePanelRef, getPanelWidthPercent]);
|
182
187
|
const onDoubleClick = useCallback(() => {
|
183
188
|
sidePanelWidth.current = Math.min(parseFloat(SIDE_PANEL_SIZES[size]) * 16, window.innerWidth * 0.75);
|
184
189
|
const parentEl = sidePanelRef.current?.parentElement;
|
@@ -473,7 +478,7 @@ const SidePanelBase = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
473
478
|
ref: subtitleRef
|
474
479
|
}, subtitle), actionToolbarButtons && actionToolbarButtons.length && /*#__PURE__*/React__default.createElement("div", {
|
475
480
|
className: `${blockClass}__action-toolbar`
|
476
|
-
}, actionToolbarButtons.map(
|
481
|
+
}, actionToolbarButtons.map(_ref => {
|
477
482
|
let {
|
478
483
|
label,
|
479
484
|
kind,
|
@@ -487,7 +492,7 @@ const SidePanelBase = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
487
492
|
className,
|
488
493
|
onClick,
|
489
494
|
...rest
|
490
|
-
} =
|
495
|
+
} = _ref;
|
491
496
|
return /*#__PURE__*/React__default.createElement(Button, _extends({}, rest, {
|
492
497
|
key: label,
|
493
498
|
kind: kind || 'ghost',
|
@@ -532,7 +537,9 @@ const SidePanelBase = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
532
537
|
}), !slideIn && enableResizer && window.innerWidth > 768 && /*#__PURE__*/React__default.createElement(Resizer, {
|
533
538
|
className: `${blockClass}__resizer`,
|
534
539
|
orientation: "vertical",
|
535
|
-
"aria-
|
540
|
+
"aria-valuemin": getPanelWidthPercent(SIDE_PANEL_SIZES['xs']),
|
541
|
+
"aria-valuemax": 75,
|
542
|
+
"aria-valuenow": getPanelWidthPercent(),
|
536
543
|
onResize: onResize,
|
537
544
|
onResizeEnd: onResizeEnd,
|
538
545
|
onDoubleClick: onDoubleClick
|
@@ -593,9 +600,7 @@ SidePanel.propTypes = {
|
|
593
600
|
*
|
594
601
|
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
|
595
602
|
*/
|
596
|
-
actions: allPropTypes([
|
597
|
-
ActionSet.validateActions(), PropTypes.arrayOf(PropTypes.shape({
|
598
|
-
/**@ts-ignore */
|
603
|
+
actions: allPropTypes([PropTypes.arrayOf(PropTypes.shape({
|
599
604
|
...Button.propTypes,
|
600
605
|
kind: PropTypes.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
|
601
606
|
tooltipPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
|
@@ -686,10 +691,10 @@ SidePanel.propTypes = {
|
|
686
691
|
* This prop is required when using the `slideIn` variant of the side panel.
|
687
692
|
*/
|
688
693
|
/**@ts-ignore*/
|
689
|
-
selectorPageContent: PropTypes.string.isRequired.if(
|
694
|
+
selectorPageContent: PropTypes.string.isRequired.if(_ref2 => {
|
690
695
|
let {
|
691
696
|
slideIn
|
692
|
-
} =
|
697
|
+
} = _ref2;
|
693
698
|
return slideIn;
|
694
699
|
}),
|
695
700
|
/**
|
@@ -716,10 +721,10 @@ SidePanel.propTypes = {
|
|
716
721
|
* Sets the title text
|
717
722
|
*/
|
718
723
|
/**@ts-ignore*/
|
719
|
-
title: PropTypes.string.isRequired.if(
|
724
|
+
title: PropTypes.string.isRequired.if(_ref3 => {
|
720
725
|
let {
|
721
726
|
labelText
|
722
|
-
} =
|
727
|
+
} = _ref3;
|
723
728
|
return labelText;
|
724
729
|
}),
|
725
730
|
...deprecatedProps
|
@@ -19,6 +19,7 @@ import { useIsomorphicEffect } from '../../global/js/hooks/useIsomorphicEffect.j
|
|
19
19
|
const blockClass = `${pkg.prefix}--string-formatter`;
|
20
20
|
const componentName = 'StringFormatter';
|
21
21
|
const defaults = {
|
22
|
+
autoAlign: false,
|
22
23
|
lines: 1,
|
23
24
|
tooltipDirection: StringFormatterAlignment.BOTTOM_START,
|
24
25
|
truncate: false,
|
@@ -32,6 +33,7 @@ const defaults = {
|
|
32
33
|
let StringFormatter = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
33
34
|
let {
|
34
35
|
className,
|
36
|
+
autoAlign = defaults.autoAlign,
|
35
37
|
lines = defaults.lines,
|
36
38
|
tooltipDirection = defaults.tooltipDirection,
|
37
39
|
truncate = defaults.truncate,
|
@@ -83,6 +85,7 @@ let StringFormatter = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
83
85
|
}, getDevtoolsProps(componentName)), truncate && isTextTruncated ? /*#__PURE__*/React__default.createElement(DefinitionTooltip, {
|
84
86
|
className: `${blockClass}__tooltip`,
|
85
87
|
align: tooltipDirection,
|
88
|
+
autoAlign: autoAlign,
|
86
89
|
definition: value,
|
87
90
|
openOnHover: true
|
88
91
|
}, stringFormatterContent) : stringFormatterContent);
|
@@ -9,7 +9,6 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
9
9
|
import { Button } from '@carbon/react';
|
10
10
|
import React__default from 'react';
|
11
11
|
import { portalType, TearsheetShell } from './TearsheetShell.js';
|
12
|
-
import { ActionSet } from '../ActionSet/ActionSet.js';
|
13
12
|
import PropTypes from '../../_virtual/index.js';
|
14
13
|
import { allPropTypes } from '../../global/js/utils/props-helper.js';
|
15
14
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
@@ -37,13 +36,13 @@ const componentName = 'Tearsheet';
|
|
37
36
|
* panel on either the left or right side, the main content area, and a set of
|
38
37
|
* action buttons.
|
39
38
|
*/
|
40
|
-
let Tearsheet = /*#__PURE__*/React__default.forwardRef((
|
41
|
-
|
39
|
+
let Tearsheet = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
40
|
+
const {
|
42
41
|
influencerPosition = 'left',
|
43
42
|
influencerWidth = 'narrow',
|
44
43
|
children,
|
45
44
|
...rest
|
46
|
-
} =
|
45
|
+
} = props;
|
47
46
|
return /*#__PURE__*/React__default.createElement(TearsheetShell, _extends({}, getDevtoolsProps(componentName), rest, {
|
48
47
|
influencerPosition,
|
49
48
|
influencerWidth,
|
@@ -91,9 +90,7 @@ Tearsheet.propTypes = {
|
|
91
90
|
*
|
92
91
|
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
|
93
92
|
*/
|
94
|
-
actions: allPropTypes([
|
95
|
-
ActionSet.validateActions(() => '2xl'), PropTypes.arrayOf(PropTypes.shape({
|
96
|
-
/**@ts-ignore*/
|
93
|
+
actions: allPropTypes([PropTypes.arrayOf(PropTypes.shape({
|
97
94
|
...Button.propTypes,
|
98
95
|
kind: PropTypes.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
|
99
96
|
label: PropTypes.string,
|