@carbon/ibm-products 2.76.0 → 2.77.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/AddSelect/AddSelect.d.ts +1 -0
- package/es/components/AddSelect/AddSelectBody.d.ts +1 -0
- package/es/components/AddSelect/AddSelectBody.js +4 -0
- package/es/components/BigNumber/index.d.ts +1 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkContent.js +5 -5
- package/es/components/Coachmark/next/Coachmark/CoachmarkTagline/CoachmarkTagline.d.ts +4 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkTagline/CoachmarkTagline.js +6 -1
- package/es/components/ConditionBuilder/index.d.ts +8 -2
- package/es/components/EmptyStates/EmptyState.d.ts +2 -2
- package/es/components/EmptyStates/EmptyState.js +2 -2
- package/es/components/EmptyStates/EmptyStateContent.d.ts +2 -2
- package/es/components/EmptyStates/EmptyStateContent.js +2 -2
- package/es/components/Guidebanner/Guidebanner.d.ts +9 -1
- package/es/components/Guidebanner/Guidebanner.js +18 -7
- package/es/components/MultiAddSelect/MultiAddSelect.d.ts +4 -0
- package/es/components/MultiAddSelect/MultiAddSelect.js +4 -0
- package/es/components/PageHeader/next/PageHeader.js +6 -5
- package/es/components/PageHeader/next/overflowHandler.d.ts +5 -0
- package/es/components/PageHeader/next/overflowHandler.js +8 -0
- package/es/components/SingleAddSelect/SingleAddSelect.d.ts +4 -0
- package/es/components/SingleAddSelect/SingleAddSelect.js +4 -0
- package/es/components/TruncatedList/TruncatedList.d.ts +1 -1
- package/es/components/index.d.ts +10 -9
- package/es/global/js/utils/carousel/types.d.ts +1 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +10 -18
- package/lib/components/AddSelect/AddSelect.d.ts +1 -0
- package/lib/components/AddSelect/AddSelectBody.d.ts +1 -0
- package/lib/components/AddSelect/AddSelectBody.js +4 -0
- package/lib/components/BigNumber/index.d.ts +1 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.js +5 -5
- package/lib/components/Coachmark/next/Coachmark/CoachmarkTagline/CoachmarkTagline.d.ts +4 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkTagline/CoachmarkTagline.js +6 -1
- package/lib/components/ConditionBuilder/index.d.ts +8 -2
- package/lib/components/EmptyStates/EmptyState.d.ts +2 -2
- package/lib/components/EmptyStates/EmptyState.js +2 -2
- package/lib/components/EmptyStates/EmptyStateContent.d.ts +2 -2
- package/lib/components/EmptyStates/EmptyStateContent.js +2 -2
- package/lib/components/Guidebanner/Guidebanner.d.ts +9 -1
- package/lib/components/Guidebanner/Guidebanner.js +18 -7
- package/lib/components/MultiAddSelect/MultiAddSelect.d.ts +4 -0
- package/lib/components/MultiAddSelect/MultiAddSelect.js +4 -0
- package/lib/components/PageHeader/next/PageHeader.js +5 -4
- package/lib/components/PageHeader/next/overflowHandler.d.ts +5 -0
- package/lib/components/PageHeader/next/overflowHandler.js +8 -0
- package/lib/components/SingleAddSelect/SingleAddSelect.d.ts +4 -0
- package/lib/components/SingleAddSelect/SingleAddSelect.js +4 -0
- package/lib/components/TruncatedList/TruncatedList.d.ts +1 -1
- package/lib/components/index.d.ts +10 -9
- package/lib/global/js/utils/carousel/types.d.ts +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +31 -27
- package/package.json +7 -6
- package/telemetry.yml +1 -0
- package/es/components/BigNumber/index.js +0 -8
- package/es/components/ConditionBuilder/index.js +0 -8
- package/es/components/DataSpreadsheet/index.js +0 -8
- package/es/components/Decorator/index.js +0 -8
- package/es/components/DelimitedList/index.js +0 -8
- package/es/components/GetStartedCard/index.js +0 -8
- package/es/components/NonLinearReading/index.js +0 -8
- package/es/components/SearchBar/index.js +0 -8
- package/es/components/TruncatedList/index.js +0 -8
- package/lib/components/BigNumber/index.js +0 -14
- package/lib/components/ConditionBuilder/index.js +0 -14
- package/lib/components/DataSpreadsheet/index.js +0 -14
- package/lib/components/Decorator/index.js +0 -17
- package/lib/components/DelimitedList/index.js +0 -14
- package/lib/components/GetStartedCard/index.js +0 -14
- package/lib/components/NonLinearReading/index.js +0 -14
- package/lib/components/SearchBar/index.js +0 -14
- package/lib/components/TruncatedList/index.js +0 -14
|
@@ -64,6 +64,7 @@ const AddSelectBody = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
64
64
|
noResultsTitle,
|
|
65
65
|
noSelectionDescription,
|
|
66
66
|
noSelectionTitle,
|
|
67
|
+
noTearsheet = false,
|
|
67
68
|
normalizedItems,
|
|
68
69
|
onClose,
|
|
69
70
|
onCloseButtonText,
|
|
@@ -279,6 +280,9 @@ const AddSelectBody = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
279
280
|
title: noResultsTitle,
|
|
280
281
|
illustrationTheme: illustrationTheme
|
|
281
282
|
}))));
|
|
283
|
+
if (noTearsheet) {
|
|
284
|
+
return body;
|
|
285
|
+
}
|
|
282
286
|
if (multi) {
|
|
283
287
|
return /*#__PURE__*/React__default.createElement(Tearsheet, _extends({}, commonTearsheetProps, {
|
|
284
288
|
influencer: multi && /*#__PURE__*/React__default.createElement(AddSelectSidebar, sidebarProps),
|
|
@@ -36,9 +36,9 @@ const CoachmarkContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
36
36
|
} = useContext(CoachmarkContext);
|
|
37
37
|
const targetId = open ? triggerRef?.current?.id : null;
|
|
38
38
|
const handleRef = useRef(null);
|
|
39
|
-
const bubbleRef = ref
|
|
39
|
+
const bubbleRef = ref || handleRef;
|
|
40
40
|
useEffect(() => {
|
|
41
|
-
if (open && bubbleRef.current) {
|
|
41
|
+
if (open && 'current' in bubbleRef && bubbleRef.current) {
|
|
42
42
|
requestAnimationFrame(() => {
|
|
43
43
|
const contentBody = bubbleRef.current?.querySelector(`.${contentBodyClass}`);
|
|
44
44
|
if (contentBody) {
|
|
@@ -52,7 +52,7 @@ const CoachmarkContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
52
52
|
useEffect(() => {
|
|
53
53
|
const handleOutsideClick = event => {
|
|
54
54
|
const targetElement = document.getElementById(targetId || '');
|
|
55
|
-
const bubbleElement = bubbleRef.current;
|
|
55
|
+
const bubbleElement = bubbleRef && 'current' in bubbleRef ? bubbleRef.current : null;
|
|
56
56
|
if (bubbleElement && !bubbleElement.contains(event.target) && targetElement && !targetElement.contains(event.target)) {
|
|
57
57
|
setOpen?.(false);
|
|
58
58
|
}
|
|
@@ -73,14 +73,14 @@ const CoachmarkContent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
73
73
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
74
|
}, [open, targetId, setOpen]);
|
|
75
75
|
useEffect(() => {
|
|
76
|
-
if (open && bubbleRef.current) {
|
|
76
|
+
if (open && 'current' in bubbleRef && bubbleRef.current) {
|
|
77
77
|
const dragContainer = bubbleRef.current.querySelector(`.${pkg.prefix}__bubble`);
|
|
78
78
|
if (dragContainer instanceof HTMLElement) {
|
|
79
79
|
setContentRef(dragContainer);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
|
-
}, [open, bubbleRef
|
|
83
|
+
}, [open, bubbleRef]);
|
|
84
84
|
return open && /*#__PURE__*/React__default.createElement("div", {
|
|
85
85
|
ref: bubbleRef
|
|
86
86
|
}, /*#__PURE__*/React__default.createElement(CoachmarkBubble, _extends({
|
|
@@ -34,10 +34,11 @@ const CoachmarkTagline = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
34
34
|
title,
|
|
35
35
|
buttonProps,
|
|
36
36
|
isOpen,
|
|
37
|
+
className,
|
|
37
38
|
...rest
|
|
38
39
|
} = _ref;
|
|
39
40
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
40
|
-
className: cx(blockClass, isOpen && `${blockClass}--is-open
|
|
41
|
+
className: cx(blockClass, isOpen && `${blockClass}--is-open`, className),
|
|
41
42
|
ref: ref
|
|
42
43
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement("button", _extends({
|
|
43
44
|
className: `${blockClass}__cta`,
|
|
@@ -80,6 +81,10 @@ CoachmarkTagline.propTypes = {
|
|
|
80
81
|
tabIndex: PropTypes.number,
|
|
81
82
|
['aria-expanded']: PropTypes.bool
|
|
82
83
|
}),
|
|
84
|
+
/**
|
|
85
|
+
* Optional class name for this component.
|
|
86
|
+
*/
|
|
87
|
+
className: PropTypes.string,
|
|
83
88
|
/**
|
|
84
89
|
* Tooltip text and aria label for the Close button icon.
|
|
85
90
|
*/
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2024, 2024
|
|
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 { ConditionBuilder } from './ConditionBuilder';
|
|
8
|
+
export * from './ConditionBuilder.types';
|
|
@@ -61,11 +61,11 @@ export interface EmptyStateProps {
|
|
|
61
61
|
/**
|
|
62
62
|
* Empty state subtitle
|
|
63
63
|
*/
|
|
64
|
-
subtitle?:
|
|
64
|
+
subtitle?: ReactNode;
|
|
65
65
|
/**
|
|
66
66
|
* Empty state title
|
|
67
67
|
*/
|
|
68
|
-
title:
|
|
68
|
+
title: ReactNode;
|
|
69
69
|
/**
|
|
70
70
|
* **Deprecated:** Designates which version of the EmptyState component is being used. Refer to V2 documentation separately.
|
|
71
71
|
* @deprecated
|
|
@@ -121,11 +121,11 @@ EmptyState.propTypes = {
|
|
|
121
121
|
/**
|
|
122
122
|
* Empty state subtext
|
|
123
123
|
*/
|
|
124
|
-
subtitle: PropTypes.
|
|
124
|
+
subtitle: PropTypes.node,
|
|
125
125
|
/**
|
|
126
126
|
* Empty state heading
|
|
127
127
|
*/
|
|
128
|
-
title: PropTypes.
|
|
128
|
+
title: PropTypes.node.isRequired,
|
|
129
129
|
/**
|
|
130
130
|
* **Deprecated:** Designates which version of the EmptyState component is being used. Refer to V2 documentation separately.
|
|
131
131
|
* @deprecated
|
|
@@ -26,11 +26,11 @@ interface EmptyStateProps {
|
|
|
26
26
|
/**
|
|
27
27
|
* Empty state subtitle
|
|
28
28
|
*/
|
|
29
|
-
subtitle?:
|
|
29
|
+
subtitle?: ReactNode;
|
|
30
30
|
/**
|
|
31
31
|
* Empty state title
|
|
32
32
|
*/
|
|
33
|
-
title:
|
|
33
|
+
title: ReactNode;
|
|
34
34
|
}
|
|
35
35
|
export declare const EmptyStateContent: {
|
|
36
36
|
(props: EmptyStateProps): React.JSX.Element;
|
|
@@ -83,11 +83,11 @@ EmptyStateContent.propTypes = {
|
|
|
83
83
|
/**
|
|
84
84
|
* Empty state subtitle
|
|
85
85
|
*/
|
|
86
|
-
subtitle: PropTypes.
|
|
86
|
+
subtitle: PropTypes.node,
|
|
87
87
|
/**
|
|
88
88
|
* Empty state title
|
|
89
89
|
*/
|
|
90
|
-
title: PropTypes.
|
|
90
|
+
title: PropTypes.node.isRequired
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
export { EmptyStateContent };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2023,
|
|
2
|
+
* Copyright IBM Corp. 2023, 2025
|
|
3
3
|
*
|
|
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.
|
|
@@ -57,6 +57,14 @@ export interface GuidebannerProps {
|
|
|
57
57
|
* content on the page under special circumstances.
|
|
58
58
|
*/
|
|
59
59
|
withLeftGutter?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* A handler for managing the controlled state of open prop. If not passed the open prop will not be honored and an uncontrolled state will be used.
|
|
62
|
+
*/
|
|
63
|
+
onChange?: (value: boolean) => void;
|
|
64
|
+
/**
|
|
65
|
+
* For controlled usage of the tile open state. This prop only works when an onChange prop is also passed, otherwise an uncontrolled state is used.
|
|
66
|
+
*/
|
|
67
|
+
open?: boolean;
|
|
60
68
|
}
|
|
61
69
|
/**
|
|
62
70
|
* The guide banner sits at the top of a page, or page-level tab,
|
|
@@ -17,6 +17,7 @@ import cx from 'classnames';
|
|
|
17
17
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
|
18
18
|
import { pkg } from '../../settings.js';
|
|
19
19
|
import uuidv4 from '../../global/js/utils/uuidv4.js';
|
|
20
|
+
import { useControllableState } from '../../global/js/hooks/useControllableState.js';
|
|
20
21
|
|
|
21
22
|
var _CaretLeft, _CaretRight, _Close;
|
|
22
23
|
|
|
@@ -52,20 +53,22 @@ const Guidebanner = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
|
52
53
|
nextIconDescription = defaults.nextIconDescription,
|
|
53
54
|
previousIconDescription = defaults.previousIconDescription,
|
|
54
55
|
title,
|
|
56
|
+
onChange,
|
|
57
|
+
open: userOpen,
|
|
55
58
|
...rest
|
|
56
59
|
} = props;
|
|
57
60
|
const scrollRef = useRef(null);
|
|
58
61
|
const toggleRef = useRef(null);
|
|
59
62
|
const [scrollPosition, setScrollPosition] = useState(0);
|
|
60
63
|
const [showNavigation, setShowNavigation] = useState(false);
|
|
61
|
-
const [
|
|
64
|
+
const [open, setOpen] = useControllableState(userOpen ?? false, onChange);
|
|
62
65
|
const handleClickToggle = () => {
|
|
63
|
-
|
|
66
|
+
setOpen(!open);
|
|
64
67
|
};
|
|
65
68
|
const carouselContentId = `${uuidv4()}--carousel-content-id`;
|
|
66
69
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
67
|
-
"aria-owns":
|
|
68
|
-
className: cx(blockClass, className, collapsible && `${blockClass}__collapsible`,
|
|
70
|
+
"aria-owns": open ? carouselContentId : undefined,
|
|
71
|
+
className: cx(blockClass, className, collapsible && `${blockClass}__collapsible`, !open && `${blockClass}__collapsible-collapsed`, withLeftGutter && `${blockClass}__with-left-gutter`),
|
|
69
72
|
ref: ref
|
|
70
73
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(Idea, {
|
|
71
74
|
size: 20,
|
|
@@ -98,9 +101,9 @@ const Guidebanner = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
|
98
101
|
className: `${blockClass}__toggle-button`,
|
|
99
102
|
onClick: handleClickToggle,
|
|
100
103
|
ref: toggleRef,
|
|
101
|
-
"aria-controls": !
|
|
102
|
-
"aria-expanded": !
|
|
103
|
-
},
|
|
104
|
+
"aria-controls": !open ? carouselContentId : undefined,
|
|
105
|
+
"aria-expanded": !open
|
|
106
|
+
}, open ? expandButtonLabel : collapseButtonLabel), showNavigation && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
104
107
|
className: cx(`${blockClass}__back-button`, [scrollPosition === 0 ? `${blockClass}__back-button--disabled` : null])
|
|
105
108
|
}, /*#__PURE__*/React__default.createElement(IconButton, {
|
|
106
109
|
align: "top",
|
|
@@ -181,11 +184,19 @@ Guidebanner.propTypes = {
|
|
|
181
184
|
* Tooltip text and aria label for the Next button icon.
|
|
182
185
|
*/
|
|
183
186
|
nextIconDescription: PropTypes.string,
|
|
187
|
+
/**
|
|
188
|
+
* A handler for managing the controlled state of open prop. If not passed the open prop will not be honored and an uncontrolled state will be used.
|
|
189
|
+
*/
|
|
190
|
+
onChange: PropTypes.func,
|
|
184
191
|
/**
|
|
185
192
|
* If defined, a Close button will render in the top-right corner and a
|
|
186
193
|
* callback function will be triggered when button is clicked.
|
|
187
194
|
*/
|
|
188
195
|
onClose: PropTypes.func,
|
|
196
|
+
/**
|
|
197
|
+
* Specify whether the Guidebanner is currently open.
|
|
198
|
+
*/
|
|
199
|
+
open: PropTypes.bool,
|
|
189
200
|
/**
|
|
190
201
|
* Tooltip text and aria label for the Back button icon.
|
|
191
202
|
*/
|
|
@@ -105,6 +105,10 @@ export interface MultiAddSelectProps {
|
|
|
105
105
|
* title that displays in the sidebar when nothing is selected
|
|
106
106
|
*/
|
|
107
107
|
noSelectionTitle?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Determines if the component should be rendered within a Tearsheet component
|
|
110
|
+
*/
|
|
111
|
+
noTearsheet?: boolean;
|
|
108
112
|
/**
|
|
109
113
|
* function to call when the close button clicked
|
|
110
114
|
*/
|
|
@@ -119,6 +119,10 @@ MultiAddSelect.propTypes = {
|
|
|
119
119
|
* title that displays in the sidebar when nothing is selected
|
|
120
120
|
*/
|
|
121
121
|
noSelectionTitle: PropTypes.string,
|
|
122
|
+
/**
|
|
123
|
+
* Determines if the component should be rendered within a Tearsheet component
|
|
124
|
+
*/
|
|
125
|
+
noTearsheet: PropTypes.bool,
|
|
122
126
|
/**
|
|
123
127
|
* function to call when the close button clicked
|
|
124
128
|
*/
|
|
@@ -9,7 +9,7 @@ import { extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers
|
|
|
9
9
|
import React__default, { forwardRef, useState, useRef, useEffect, useLayoutEffect, useCallback } from 'react';
|
|
10
10
|
import PropTypes from '../../../_virtual/index.js';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import { Grid, Column, DefinitionTooltip, unstable_Text, Popover, PopoverContent, IconButton, BreadcrumbItem, usePrefix, Breadcrumb, MenuButton, MenuItem, AspectRatio } from '@carbon/react';
|
|
12
|
+
import { Grid, Column, Section, DefinitionTooltip, unstable_Text, Heading, Popover, PopoverContent, IconButton, BreadcrumbItem, usePrefix, Breadcrumb, MenuButton, MenuItem, AspectRatio } from '@carbon/react';
|
|
13
13
|
import { breakpoints } from '@carbon/layout';
|
|
14
14
|
import { blockClass } from '../PageHeaderUtils.js';
|
|
15
15
|
import { createOverflowHandler } from './overflowHandler.js';
|
|
@@ -251,7 +251,8 @@ const PageHeaderContent = /*#__PURE__*/React__default.forwardRef(function PageHe
|
|
|
251
251
|
useLayoutEffect(() => {
|
|
252
252
|
titleRef.current && isEllipsisActive(titleRef.current);
|
|
253
253
|
}, [title]);
|
|
254
|
-
return /*#__PURE__*/React__default.createElement(
|
|
254
|
+
return /*#__PURE__*/React__default.createElement(Section, _extends({
|
|
255
|
+
as: "div",
|
|
255
256
|
className: classNames,
|
|
256
257
|
ref: componentRef
|
|
257
258
|
}, other), /*#__PURE__*/React__default.createElement(Grid, null, /*#__PURE__*/React__default.createElement(Column, {
|
|
@@ -270,11 +271,11 @@ const PageHeaderContent = /*#__PURE__*/React__default.forwardRef(function PageHe
|
|
|
270
271
|
definition: title
|
|
271
272
|
}, /*#__PURE__*/React__default.createElement(unstable_Text, {
|
|
272
273
|
ref: titleRef,
|
|
273
|
-
as:
|
|
274
|
+
as: Heading,
|
|
274
275
|
className: `${blockClass}__content__title`
|
|
275
276
|
}, title)) : /*#__PURE__*/React__default.createElement(unstable_Text, {
|
|
276
277
|
ref: titleRef,
|
|
277
|
-
as:
|
|
278
|
+
as: Heading,
|
|
278
279
|
className: `${blockClass}__content__title`
|
|
279
280
|
}, title)), contextualActions && /*#__PURE__*/React__default.createElement("div", {
|
|
280
281
|
className: `${blockClass}__content__contextual-actions`
|
|
@@ -507,7 +508,7 @@ const PageHeaderTabBar = /*#__PURE__*/React__default.forwardRef(function PageHea
|
|
|
507
508
|
let {
|
|
508
509
|
className,
|
|
509
510
|
children,
|
|
510
|
-
tags
|
|
511
|
+
tags,
|
|
511
512
|
scroller,
|
|
512
513
|
...other
|
|
513
514
|
} = _ref7;
|
|
@@ -4,6 +4,11 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* This file has test coverage in @carbon/utilities. This is a copy of the utility
|
|
9
|
+
* that adds margin calculations to an element's size. This should ideally be
|
|
10
|
+
* merged back into the utility.
|
|
11
|
+
*/
|
|
7
12
|
/**
|
|
8
13
|
* Calculates the size (width or height) of a given HTML element.
|
|
9
14
|
*
|
|
@@ -5,6 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* This file has test coverage in @carbon/utilities. This is a copy of the utility
|
|
10
|
+
* that adds margin calculations to an element's size. This should ideally be
|
|
11
|
+
* merged back into the utility.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/* istanbul ignore file */
|
|
15
|
+
|
|
8
16
|
/**
|
|
9
17
|
* Calculates the size (width or height) of a given HTML element.
|
|
10
18
|
*
|
|
@@ -36,6 +36,10 @@ export interface SingleAddSelectProps {
|
|
|
36
36
|
* title to display when no results are found from the global search
|
|
37
37
|
*/
|
|
38
38
|
noResultsTitle?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Determines if the component should be rendered within a Tearsheet component
|
|
41
|
+
*/
|
|
42
|
+
noTearsheet?: boolean;
|
|
39
43
|
/**
|
|
40
44
|
* function to call when the close button clicked
|
|
41
45
|
*/
|
|
@@ -68,6 +68,10 @@ SingleAddSelect.propTypes = {
|
|
|
68
68
|
* title to display when no results are found from the global search
|
|
69
69
|
*/
|
|
70
70
|
noResultsTitle: PropTypes.string,
|
|
71
|
+
/**
|
|
72
|
+
* Determines if the component should be rendered within a Tearsheet component
|
|
73
|
+
*/
|
|
74
|
+
noTearsheet: PropTypes.bool,
|
|
71
75
|
/**
|
|
72
76
|
* function to call when the close button clicked
|
|
73
77
|
*/
|
|
@@ -41,7 +41,7 @@ export interface TruncatedListProps extends PropsWithChildren {
|
|
|
41
41
|
/**
|
|
42
42
|
* Callback function for building the label when the list is collapsed.
|
|
43
43
|
*/
|
|
44
|
-
viewMoreLabel?: (value:
|
|
44
|
+
viewMoreLabel?: (value: number) => ReactNode;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* The `TruncatedList` allows consumers to control how many items are
|
package/es/components/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export * as preview__Coachmark from './Coachmark/next/Coachmark';
|
|
|
46
46
|
export * as preview__CoachmarkTagline from './Coachmark/next/Coachmark/CoachmarkTagline';
|
|
47
47
|
export { FeatureFlags as preview__FeatureFlags, useFeatureFlag as preview__useFeatureFlag, useFeatureFlags as preview__useFeatureFlags, } from './FeatureFlags';
|
|
48
48
|
export * as preview__PageHeader from './PageHeader/next/PageHeader';
|
|
49
|
-
export
|
|
49
|
+
export { BigNumber as previewCandidate__BigNumber, type BigNumberProps, } from './BigNumber';
|
|
50
50
|
export { Coachmark as previewCandidate__Coachmark, BEACON_KIND, COACHMARK_OVERLAY_KIND, COACHMARK_ALIGNMENT, useCoachmark, type CoachmarkProps, } from './Coachmark';
|
|
51
51
|
export { CoachmarkBeacon as previewCandidate__CoachmarkBeacon, type CoachmarkBeaconProps, } from './CoachmarkBeacon';
|
|
52
52
|
export { CoachmarkButton as previewCandidate__CoachmarkButton, type CoachmarkButtonProps, } from './CoachmarkButton';
|
|
@@ -54,17 +54,18 @@ export { CoachmarkFixed as previewCandidate__CoachmarkFixed, type CoachmarkFixed
|
|
|
54
54
|
export { CoachmarkOverlayElement as previewCandidate__CoachmarkOverlayElement, type CoachmarkOverlayElementProps, } from './CoachmarkOverlayElement';
|
|
55
55
|
export { CoachmarkOverlayElements as previewCandidate__CoachmarkOverlayElements, type CoachmarkOverlayElementsProps, } from './CoachmarkOverlayElements';
|
|
56
56
|
export { CoachmarkStack as previewCandidate__CoachmarkStack } from './CoachmarkStack';
|
|
57
|
-
export
|
|
58
|
-
export *
|
|
59
|
-
export
|
|
60
|
-
export
|
|
61
|
-
export
|
|
57
|
+
export { ConditionBuilder as previewCandidate__ConditionBuilder } from './ConditionBuilder';
|
|
58
|
+
export * from './ConditionBuilder/ConditionBuilder.types';
|
|
59
|
+
export { DataSpreadsheet as previewCandidate__DataSpreadsheet, type DataSpreadsheetProps, } from './DataSpreadsheet';
|
|
60
|
+
export { DelimitedList as previewCandidate__DelimitedList, type DelimitedListProps, } from './DelimitedList';
|
|
61
|
+
export { Decorator as previewCandidate__Decorator } from './Decorator';
|
|
62
|
+
export { GetStartedCard as previewCandidate__GetStartedCard, type GetStartedCardProps, } from './GetStartedCard';
|
|
62
63
|
export { Guidebanner as previewCandidate__Guidebanner, GuidebannerElement as previewCandidate__GuidebannerElement, GuidebannerElementButton as previewCandidate__GuidebannerElementButton, GuidebannerElementLink as previewCandidate__GuidebannerElementLink, type GuidebannerProps, type GuidebannerElementProps, type GuidebannerElementButtonProps, type GuidebannerElementLinkProps, } from './Guidebanner';
|
|
63
64
|
export { InlineTip as previewCandidate__InlineTip, InlineTipButton as previewCandidate__InlineTipButton, InlineTipLink as previewCandidate__InlineTipLink, type InlineTipProps, type InlineTipButtonProps, type InlineTipLinkProps, } from './InlineTip';
|
|
64
|
-
export
|
|
65
|
-
export
|
|
65
|
+
export { NonLinearReading as previewCandidate__NonLinearReading, type NonLinearReadingProps, } from './NonLinearReading';
|
|
66
|
+
export { SearchBar as previewCandidate__SearchBar, type SearchBarProps, } from './SearchBar';
|
|
66
67
|
export { Toolbar as previewCandidate__Toolbar, ToolbarButton as previewCandidate__ToolbarButton, ToolbarGroup as previewCandidate__ToolbarGroup, type ToolbarProps, type ToolbarButtonProps, type ToolbarGroupProps, } from './Toolbar';
|
|
67
|
-
export
|
|
68
|
+
export { TruncatedList as previewCandidate__TruncatedList, type TruncatedListProps, } from './TruncatedList';
|
|
68
69
|
/**
|
|
69
70
|
* Deprecated
|
|
70
71
|
*/
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
/**
|
|
2
3
|
* Copyright IBM Corp. 2020, 2025
|
|
3
4
|
*
|
|
@@ -59,8 +60,7 @@ export { index$1 as preview__CoachmarkTagline };
|
|
|
59
60
|
export { FeatureFlags as preview__FeatureFlags, useFeatureFlag as preview__useFeatureFlag, useFeatureFlags as preview__useFeatureFlags } from './components/FeatureFlags/index.js';
|
|
60
61
|
import * as PageHeader from './components/PageHeader/next/PageHeader.js';
|
|
61
62
|
export { PageHeader as preview__PageHeader };
|
|
62
|
-
|
|
63
|
-
export { index$2 as previewCandidate__BigNumber };
|
|
63
|
+
export { BigNumber as previewCandidate__BigNumber } from './components/BigNumber/BigNumber.js';
|
|
64
64
|
export { Coachmark as previewCandidate__Coachmark } from './components/Coachmark/Coachmark.js';
|
|
65
65
|
export { BEACON_KIND, COACHMARK_ALIGNMENT, COACHMARK_OVERLAY_KIND } from './components/Coachmark/utils/enums.js';
|
|
66
66
|
export { useCoachmark } from './components/Coachmark/utils/context.js';
|
|
@@ -70,16 +70,10 @@ export { CoachmarkButton as previewCandidate__CoachmarkButton } from './componen
|
|
|
70
70
|
export { CoachmarkFixed as previewCandidate__CoachmarkFixed } from './components/CoachmarkFixed/CoachmarkFixed.js';
|
|
71
71
|
export { CoachmarkOverlayElement as previewCandidate__CoachmarkOverlayElement } from './components/CoachmarkOverlayElement/CoachmarkOverlayElement.js';
|
|
72
72
|
export { CoachmarkOverlayElements as previewCandidate__CoachmarkOverlayElements } from './components/CoachmarkOverlayElements/CoachmarkOverlayElements.js';
|
|
73
|
-
|
|
74
|
-
export {
|
|
75
|
-
|
|
76
|
-
export {
|
|
77
|
-
import * as index$5 from './components/DelimitedList/index.js';
|
|
78
|
-
export { index$5 as previewCandidate__DelimitedList };
|
|
79
|
-
import * as index$6 from './components/Decorator/index.js';
|
|
80
|
-
export { index$6 as previewCandidate__Decorator };
|
|
81
|
-
import * as index$7 from './components/GetStartedCard/index.js';
|
|
82
|
-
export { index$7 as previewCandidate__GetStartedCard };
|
|
73
|
+
export { ConditionBuilder as previewCandidate__ConditionBuilder } from './components/ConditionBuilder/ConditionBuilder.js';
|
|
74
|
+
export { DataSpreadsheet as previewCandidate__DataSpreadsheet } from './components/DataSpreadsheet/DataSpreadsheet.js';
|
|
75
|
+
export { DelimitedList as previewCandidate__DelimitedList } from './components/DelimitedList/DelimitedList.js';
|
|
76
|
+
export { GetStartedCard as previewCandidate__GetStartedCard } from './components/GetStartedCard/GetStartedCard.js';
|
|
83
77
|
export { Guidebanner as previewCandidate__Guidebanner } from './components/Guidebanner/Guidebanner.js';
|
|
84
78
|
export { GuidebannerElement as previewCandidate__GuidebannerElement } from './components/Guidebanner/GuidebannerElement.js';
|
|
85
79
|
export { GuidebannerElementButton as previewCandidate__GuidebannerElementButton } from './components/Guidebanner/GuidebannerElementButton.js';
|
|
@@ -87,15 +81,12 @@ export { GuidebannerElementLink as previewCandidate__GuidebannerElementLink } fr
|
|
|
87
81
|
export { InlineTip as previewCandidate__InlineTip } from './components/InlineTip/InlineTip.js';
|
|
88
82
|
export { InlineTipButton as previewCandidate__InlineTipButton } from './components/InlineTip/InlineTipButton.js';
|
|
89
83
|
export { InlineTipLink as previewCandidate__InlineTipLink } from './components/InlineTip/InlineTipLink.js';
|
|
90
|
-
|
|
91
|
-
export {
|
|
92
|
-
import * as index$9 from './components/SearchBar/index.js';
|
|
93
|
-
export { index$9 as previewCandidate__SearchBar };
|
|
84
|
+
export { NonLinearReading as previewCandidate__NonLinearReading } from './components/NonLinearReading/NonLinearReading.js';
|
|
85
|
+
export { SearchBar as previewCandidate__SearchBar } from './components/SearchBar/SearchBar.js';
|
|
94
86
|
export { Toolbar as previewCandidate__Toolbar } from './components/Toolbar/Toolbar.js';
|
|
95
87
|
export { ToolbarButton as previewCandidate__ToolbarButton } from './components/Toolbar/ToolbarButton.js';
|
|
96
88
|
export { ToolbarGroup as previewCandidate__ToolbarGroup } from './components/Toolbar/ToolbarGroup.js';
|
|
97
|
-
|
|
98
|
-
export { index$a as previewCandidate__TruncatedList };
|
|
89
|
+
export { TruncatedList as previewCandidate__TruncatedList } from './components/TruncatedList/TruncatedList.js';
|
|
99
90
|
export { ComboButton } from './components/ComboButton/ComboButton.js';
|
|
100
91
|
export { ComboButtonItem } from './components/ComboButton/ComboButtonItem/index.js';
|
|
101
92
|
export { Datagrid } from './components/Datagrid/Datagrid/Datagrid.js';
|
|
@@ -127,6 +118,7 @@ export { default as useFilterContext } from './components/Datagrid/Datagrid/addo
|
|
|
127
118
|
export { usePrefix } from './global/js/hooks/usePrefix.js';
|
|
128
119
|
export { ActionBar } from './components/ActionBar/ActionBar.js';
|
|
129
120
|
export { CoachmarkStack as previewCandidate__CoachmarkStack } from './components/CoachmarkStack/CoachmarkStack.js';
|
|
121
|
+
export { Decorator as previewCandidate__Decorator } from './components/Decorator/Decorator.js';
|
|
130
122
|
export { ScrollGradient } from './components/ScrollGradient/ScrollGradient.js';
|
|
131
123
|
export { StringFormatter } from './components/StringFormatter/StringFormatter.js';
|
|
132
124
|
export { UserAvatar } from './components/UserAvatar/UserAvatar.js';
|
|
@@ -66,6 +66,7 @@ const AddSelectBody = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
66
66
|
noResultsTitle,
|
|
67
67
|
noSelectionDescription,
|
|
68
68
|
noSelectionTitle,
|
|
69
|
+
noTearsheet = false,
|
|
69
70
|
normalizedItems,
|
|
70
71
|
onClose,
|
|
71
72
|
onCloseButtonText,
|
|
@@ -281,6 +282,9 @@ const AddSelectBody = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
281
282
|
title: noResultsTitle,
|
|
282
283
|
illustrationTheme: illustrationTheme
|
|
283
284
|
}))));
|
|
285
|
+
if (noTearsheet) {
|
|
286
|
+
return body;
|
|
287
|
+
}
|
|
284
288
|
if (multi) {
|
|
285
289
|
return /*#__PURE__*/React.createElement(Tearsheet.Tearsheet, _rollupPluginBabelHelpers.extends({}, commonTearsheetProps, {
|
|
286
290
|
influencer: multi && /*#__PURE__*/React.createElement(AddSelectSidebar.AddSelectSidebar, sidebarProps),
|
|
@@ -40,9 +40,9 @@ const CoachmarkContent = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
40
40
|
} = React.useContext(context.CoachmarkContext);
|
|
41
41
|
const targetId = open ? triggerRef?.current?.id : null;
|
|
42
42
|
const handleRef = React.useRef(null);
|
|
43
|
-
const bubbleRef = ref
|
|
43
|
+
const bubbleRef = ref || handleRef;
|
|
44
44
|
React.useEffect(() => {
|
|
45
|
-
if (open && bubbleRef.current) {
|
|
45
|
+
if (open && 'current' in bubbleRef && bubbleRef.current) {
|
|
46
46
|
requestAnimationFrame(() => {
|
|
47
47
|
const contentBody = bubbleRef.current?.querySelector(`.${contentBodyClass}`);
|
|
48
48
|
if (contentBody) {
|
|
@@ -56,7 +56,7 @@ const CoachmarkContent = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
56
56
|
React.useEffect(() => {
|
|
57
57
|
const handleOutsideClick = event => {
|
|
58
58
|
const targetElement = document.getElementById(targetId || '');
|
|
59
|
-
const bubbleElement = bubbleRef.current;
|
|
59
|
+
const bubbleElement = bubbleRef && 'current' in bubbleRef ? bubbleRef.current : null;
|
|
60
60
|
if (bubbleElement && !bubbleElement.contains(event.target) && targetElement && !targetElement.contains(event.target)) {
|
|
61
61
|
setOpen?.(false);
|
|
62
62
|
}
|
|
@@ -77,14 +77,14 @@ const CoachmarkContent = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
77
77
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
78
78
|
}, [open, targetId, setOpen]);
|
|
79
79
|
React.useEffect(() => {
|
|
80
|
-
if (open && bubbleRef.current) {
|
|
80
|
+
if (open && 'current' in bubbleRef && bubbleRef.current) {
|
|
81
81
|
const dragContainer = bubbleRef.current.querySelector(`.${settings.pkg.prefix}__bubble`);
|
|
82
82
|
if (dragContainer instanceof HTMLElement) {
|
|
83
83
|
setContentRef(dragContainer);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
|
-
}, [open, bubbleRef
|
|
87
|
+
}, [open, bubbleRef]);
|
|
88
88
|
return open && /*#__PURE__*/React.createElement("div", {
|
|
89
89
|
ref: bubbleRef
|
|
90
90
|
}, /*#__PURE__*/React.createElement(CoachmarkBubble.CoachmarkBubble, _rollupPluginBabelHelpers.extends({
|