@carbon/ibm-products 2.84.0 → 2.85.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/index-full-carbon.css +18 -13
- 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 +18 -13
- 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 +18 -13
- 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 +18 -13
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/Coachmark/next/Coachmark/ContentHeader.js +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +12 -1
- package/es/components/CreateTearsheet/CreateTearsheet.d.ts +1 -0
- package/es/components/CreateTearsheet/CreateTearsheet.js +3 -0
- package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +4 -0
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +7 -1
- package/es/components/EditInPlace/EditInPlace.d.ts +12 -1
- package/es/components/EditInPlace/EditInPlace.js +52 -31
- package/es/components/ImportModal/ImportModal.d.ts +5 -1
- package/es/components/ImportModal/ImportModal.js +12 -6
- package/es/components/PageHeader/next/PageHeader.d.ts +15 -238
- package/es/components/PageHeader/next/PageHeader.js +25 -637
- package/es/components/PageHeader/next/PageHeaderBreadcrumbBar.d.ts +41 -0
- package/es/components/PageHeader/next/PageHeaderBreadcrumbBar.js +74 -0
- package/es/components/PageHeader/next/PageHeaderBreadcrumbOverflow.d.ts +12 -0
- package/es/components/PageHeader/next/PageHeaderBreadcrumbOverflow.js +82 -0
- package/es/components/PageHeader/next/PageHeaderContent.d.ts +39 -0
- package/es/components/PageHeader/next/PageHeaderContent.js +129 -0
- package/es/components/PageHeader/next/PageHeaderContentPageActions.d.ts +52 -0
- package/es/components/PageHeader/next/PageHeaderContentPageActions.js +126 -0
- package/es/components/PageHeader/next/PageHeaderContentText.d.ts +44 -0
- package/es/components/PageHeader/next/PageHeaderContentText.js +54 -0
- package/es/components/PageHeader/next/PageHeaderHeroImage.d.ts +36 -0
- package/es/components/PageHeader/next/PageHeaderHeroImage.js +62 -0
- package/es/components/PageHeader/next/PageHeaderScrollButton.d.ts +13 -0
- package/es/components/PageHeader/next/PageHeaderScrollButton.js +73 -0
- package/es/components/PageHeader/next/PageHeaderTabBar.d.ts +19 -0
- package/es/components/PageHeader/next/PageHeaderTabBar.js +66 -0
- package/es/components/PageHeader/next/PageHeaderTagOverflow.d.ts +13 -0
- package/es/components/PageHeader/next/PageHeaderTagOverflow.js +68 -0
- package/es/components/PageHeader/next/PageHeaderTitleBreadcrumb.d.ts +9 -0
- package/es/components/PageHeader/next/PageHeaderTitleBreadcrumb.js +43 -0
- package/es/components/PageHeader/next/index.d.ts +3 -2
- package/es/components/PageHeader/next/index.js +11 -1
- package/es/global/js/hooks/useCreateComponentStepChange.d.ts +2 -1
- package/es/global/js/hooks/useCreateComponentStepChange.js +3 -2
- package/es/global/js/hooks/usePortalTarget.js +1 -1
- package/es/global/js/utils/makeDraggable/makeDraggable.js +22 -13
- package/lib/components/Coachmark/next/Coachmark/ContentHeader.js +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +12 -1
- package/lib/components/CreateTearsheet/CreateTearsheet.d.ts +1 -0
- package/lib/components/CreateTearsheet/CreateTearsheet.js +3 -0
- package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +4 -0
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +7 -1
- package/lib/components/EditInPlace/EditInPlace.d.ts +12 -1
- package/lib/components/EditInPlace/EditInPlace.js +50 -29
- package/lib/components/ImportModal/ImportModal.d.ts +5 -1
- package/lib/components/ImportModal/ImportModal.js +12 -6
- package/lib/components/PageHeader/next/PageHeader.d.ts +15 -238
- package/lib/components/PageHeader/next/PageHeader.js +42 -654
- package/lib/components/PageHeader/next/PageHeaderBreadcrumbBar.d.ts +41 -0
- package/lib/components/PageHeader/next/PageHeaderBreadcrumbBar.js +76 -0
- package/lib/components/PageHeader/next/PageHeaderBreadcrumbOverflow.d.ts +12 -0
- package/lib/components/PageHeader/next/PageHeaderBreadcrumbOverflow.js +84 -0
- package/lib/components/PageHeader/next/PageHeaderContent.d.ts +39 -0
- package/lib/components/PageHeader/next/PageHeaderContent.js +131 -0
- package/lib/components/PageHeader/next/PageHeaderContentPageActions.d.ts +52 -0
- package/lib/components/PageHeader/next/PageHeaderContentPageActions.js +128 -0
- package/lib/components/PageHeader/next/PageHeaderContentText.d.ts +44 -0
- package/lib/components/PageHeader/next/PageHeaderContentText.js +56 -0
- package/lib/components/PageHeader/next/PageHeaderHeroImage.d.ts +36 -0
- package/lib/components/PageHeader/next/PageHeaderHeroImage.js +64 -0
- package/lib/components/PageHeader/next/PageHeaderScrollButton.d.ts +13 -0
- package/lib/components/PageHeader/next/PageHeaderScrollButton.js +75 -0
- package/lib/components/PageHeader/next/PageHeaderTabBar.d.ts +19 -0
- package/lib/components/PageHeader/next/PageHeaderTabBar.js +68 -0
- package/lib/components/PageHeader/next/PageHeaderTagOverflow.d.ts +13 -0
- package/lib/components/PageHeader/next/PageHeaderTagOverflow.js +70 -0
- package/lib/components/PageHeader/next/PageHeaderTitleBreadcrumb.d.ts +9 -0
- package/lib/components/PageHeader/next/PageHeaderTitleBreadcrumb.js +45 -0
- package/lib/components/PageHeader/next/index.d.ts +3 -2
- package/lib/components/PageHeader/next/index.js +20 -10
- package/lib/global/js/hooks/useCreateComponentStepChange.d.ts +2 -1
- package/lib/global/js/hooks/useCreateComponentStepChange.js +3 -2
- package/lib/global/js/hooks/usePortalTarget.js +1 -1
- package/lib/global/js/utils/makeDraggable/makeDraggable.js +22 -13
- package/package.json +7 -7
- package/scss/components/Datagrid/_datagrid.scss +7 -10
- package/scss/components/EditInPlace/_edit-in-place.scss +11 -3
- package/scss/components/PageHeader/_page-header.scss +2 -1
- package/telemetry.yml +13 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
/**
|
|
9
|
+
* ----------------
|
|
10
|
+
* PageHeaderHeroImage
|
|
11
|
+
* ----------------
|
|
12
|
+
*/
|
|
13
|
+
export interface PageHeaderHeroImageProps {
|
|
14
|
+
/**
|
|
15
|
+
* Provide child elements to be rendered inside PageHeaderHeroImage.
|
|
16
|
+
*/
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Specify an optional className to be added to your PageHeaderHeroImage
|
|
20
|
+
*/
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const PageHeaderHeroImage: {
|
|
24
|
+
({ className, children, ...other }: PageHeaderHeroImageProps): React.JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
propTypes: {
|
|
27
|
+
/**
|
|
28
|
+
* Provide child elements to be rendered inside PageHeaderHeroImage.
|
|
29
|
+
*/
|
|
30
|
+
children: any;
|
|
31
|
+
/**
|
|
32
|
+
* Specify an optional className to be added to your PageHeaderHeroImage
|
|
33
|
+
*/
|
|
34
|
+
className: any;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2020, 2026
|
|
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, { useState, useEffect } from 'react';
|
|
10
|
+
import PropTypes from '../../../_virtual/index.js';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
import { AspectRatio } from '@carbon/react';
|
|
13
|
+
import { breakpoints } from '@carbon/layout';
|
|
14
|
+
import { blockClass } from '../PageHeaderUtils.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* ----------------
|
|
18
|
+
* PageHeaderHeroImage
|
|
19
|
+
* ----------------
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const PageHeaderHeroImage = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
className,
|
|
25
|
+
children,
|
|
26
|
+
...other
|
|
27
|
+
} = _ref;
|
|
28
|
+
const [lgBreakpoint, setLgBreakpoint] = useState(false);
|
|
29
|
+
const classNames = cx({
|
|
30
|
+
[`${blockClass}__hero-image`]: true
|
|
31
|
+
}, className);
|
|
32
|
+
const lgMediaQuery = `(min-width: ${breakpoints.lg.width})`;
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const listener = event => {
|
|
35
|
+
setLgBreakpoint(event.matches);
|
|
36
|
+
};
|
|
37
|
+
const mediaQueryList = window.matchMedia(lgMediaQuery);
|
|
38
|
+
mediaQueryList.addEventListener('change', listener);
|
|
39
|
+
setLgBreakpoint(mediaQueryList.matches);
|
|
40
|
+
return () => {
|
|
41
|
+
mediaQueryList.removeEventListener('change', listener);
|
|
42
|
+
};
|
|
43
|
+
}, [lgMediaQuery]);
|
|
44
|
+
return /*#__PURE__*/React__default.createElement(AspectRatio, _extends({
|
|
45
|
+
className: classNames
|
|
46
|
+
}, other, {
|
|
47
|
+
ratio: lgBreakpoint ? '2x1' : '3x2'
|
|
48
|
+
}), children);
|
|
49
|
+
};
|
|
50
|
+
PageHeaderHeroImage.displayName = 'PageHeaderHeroImage';
|
|
51
|
+
PageHeaderHeroImage.propTypes = {
|
|
52
|
+
/**
|
|
53
|
+
* Provide child elements to be rendered inside PageHeaderHeroImage.
|
|
54
|
+
*/
|
|
55
|
+
children: PropTypes.node,
|
|
56
|
+
/**
|
|
57
|
+
* Specify an optional className to be added to your PageHeaderHeroImage
|
|
58
|
+
*/
|
|
59
|
+
className: PropTypes.string
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export { PageHeaderHeroImage };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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 { IconButtonProps } from '@carbon/react';
|
|
9
|
+
export interface PageHeaderScrollButtonProps extends IconButtonProps {
|
|
10
|
+
collapseText?: string;
|
|
11
|
+
expandText?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const PageHeaderScrollButton: React.ForwardRefExoticComponent<PageHeaderScrollButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2020, 2026
|
|
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 from 'react';
|
|
10
|
+
import cx from 'classnames';
|
|
11
|
+
import { IconButton } from '@carbon/react';
|
|
12
|
+
import { ChevronUp } from '@carbon/react/icons';
|
|
13
|
+
import { usePageHeader } from './context.js';
|
|
14
|
+
import { scrollableAncestor } from './utils.js';
|
|
15
|
+
import { pkg } from '../../../settings.js';
|
|
16
|
+
|
|
17
|
+
const PageHeaderScrollButton = /*#__PURE__*/React__default.forwardRef(function PageHeaderExpander(_ref, ref) {
|
|
18
|
+
let {
|
|
19
|
+
className,
|
|
20
|
+
children,
|
|
21
|
+
label,
|
|
22
|
+
onClick,
|
|
23
|
+
collapseText = 'Collapse',
|
|
24
|
+
expandText = 'Expand',
|
|
25
|
+
...other
|
|
26
|
+
} = _ref;
|
|
27
|
+
const {
|
|
28
|
+
refs,
|
|
29
|
+
fullyCollapsed
|
|
30
|
+
} = usePageHeader();
|
|
31
|
+
const handleScroller = isFullyCollapsed => {
|
|
32
|
+
if (!refs?.contentRef?.current) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const scrollableTarget = scrollableAncestor(refs?.contentRef.current);
|
|
36
|
+
|
|
37
|
+
// Page header content is not fully collapsed
|
|
38
|
+
if (!isFullyCollapsed) {
|
|
39
|
+
const pageHeaderContentHeight = refs?.contentRef.current.offsetHeight;
|
|
40
|
+
scrollableTarget?.scrollTo({
|
|
41
|
+
top: pageHeaderContentHeight,
|
|
42
|
+
// headerTopValue, check if breadcrumb bar is included
|
|
43
|
+
behavior: 'smooth'
|
|
44
|
+
});
|
|
45
|
+
} else {
|
|
46
|
+
// Page header content is fully collapsed
|
|
47
|
+
scrollableTarget?.scrollTo({
|
|
48
|
+
top: 0,
|
|
49
|
+
behavior: 'smooth'
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/React__default.createElement(IconButton, _extends({
|
|
54
|
+
ref: ref,
|
|
55
|
+
label: fullyCollapsed ? expandText : collapseText,
|
|
56
|
+
size: "md",
|
|
57
|
+
kind: "ghost",
|
|
58
|
+
autoAlign: true
|
|
59
|
+
}, other, {
|
|
60
|
+
onClick: event => {
|
|
61
|
+
onClick?.(event);
|
|
62
|
+
handleScroller(!!fullyCollapsed);
|
|
63
|
+
},
|
|
64
|
+
className: cx(className, `${pkg.prefix}--page-header--scroller-button`)
|
|
65
|
+
}), /*#__PURE__*/React__default.createElement(ChevronUp, {
|
|
66
|
+
className: cx(`${pkg.prefix}--page-header--scroller-button-icon`, {
|
|
67
|
+
[`${pkg.prefix}--page-header--scroller-button-icon-collapsed`]: fullyCollapsed
|
|
68
|
+
})
|
|
69
|
+
}));
|
|
70
|
+
});
|
|
71
|
+
PageHeaderScrollButton.displayName = 'PageHeaderScrollButton';
|
|
72
|
+
|
|
73
|
+
export { PageHeaderScrollButton };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
/**
|
|
9
|
+
* ----------------
|
|
10
|
+
* PageHeaderTabBar
|
|
11
|
+
* ----------------
|
|
12
|
+
*/
|
|
13
|
+
export interface PageHeaderTabBarProps {
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
tags?: React.ReactNode;
|
|
17
|
+
scroller?: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare const PageHeaderTabBar: React.ForwardRefExoticComponent<PageHeaderTabBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2020, 2026
|
|
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 from 'react';
|
|
10
|
+
import cx from 'classnames';
|
|
11
|
+
import { Grid, Column } from '@carbon/react';
|
|
12
|
+
import { blockClass } from '../PageHeaderUtils.js';
|
|
13
|
+
import { pkg } from '../../../settings.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* ----------------
|
|
17
|
+
* PageHeaderTabBar
|
|
18
|
+
* ----------------
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const PageHeaderTabBar = /*#__PURE__*/React__default.forwardRef(function PageHeaderTabBar(_ref, ref) {
|
|
22
|
+
let {
|
|
23
|
+
className,
|
|
24
|
+
children,
|
|
25
|
+
tags,
|
|
26
|
+
scroller,
|
|
27
|
+
...other
|
|
28
|
+
} = _ref;
|
|
29
|
+
const classNames = cx({
|
|
30
|
+
[`${blockClass}__tab-bar`]: true
|
|
31
|
+
}, className);
|
|
32
|
+
const renderScroller = () => scroller && /*#__PURE__*/React__default.createElement("div", {
|
|
33
|
+
className: `${pkg.prefix}--page-header--scroller-button-container`
|
|
34
|
+
}, scroller);
|
|
35
|
+
|
|
36
|
+
// Early return if no tags are provided
|
|
37
|
+
if (!tags) {
|
|
38
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
39
|
+
className: classNames,
|
|
40
|
+
ref: ref
|
|
41
|
+
}, other), /*#__PURE__*/React__default.createElement(Grid, {
|
|
42
|
+
condensed: true
|
|
43
|
+
}, /*#__PURE__*/React__default.createElement(Column, {
|
|
44
|
+
lg: 16,
|
|
45
|
+
md: 8,
|
|
46
|
+
sm: 4
|
|
47
|
+
}, children, renderScroller())));
|
|
48
|
+
}
|
|
49
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
50
|
+
className: classNames,
|
|
51
|
+
ref: ref
|
|
52
|
+
}, other), /*#__PURE__*/React__default.createElement(Grid, {
|
|
53
|
+
condensed: true
|
|
54
|
+
}, /*#__PURE__*/React__default.createElement(Column, {
|
|
55
|
+
lg: 16,
|
|
56
|
+
md: 8,
|
|
57
|
+
sm: 4
|
|
58
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
59
|
+
className: cx(`${blockClass}__tab-bar--tablist`, {
|
|
60
|
+
[`${pkg.prefix}--page-header__tab-bar--with-scroller`]: !!scroller
|
|
61
|
+
})
|
|
62
|
+
}, children, tags, renderScroller()))));
|
|
63
|
+
});
|
|
64
|
+
PageHeaderTabBar.displayName = 'PageHeaderTabBar';
|
|
65
|
+
|
|
66
|
+
export { PageHeaderTabBar };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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
|
+
export interface PageHeaderTagOverflowProps {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
renderOverflowTag?: (hiddenBreadcrumbs: HTMLElement[], handleOverflowClick: (event: React.MouseEvent) => void, openPopover: boolean) => React.ReactElement;
|
|
11
|
+
renderPopoverContent?: (hiddenBreadcrumbs: HTMLElement[]) => React.ReactElement;
|
|
12
|
+
}
|
|
13
|
+
export declare const PageHeaderTagOverflow: React.ForwardRefExoticComponent<PageHeaderTagOverflowProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2020, 2026
|
|
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 React__default, { useState, useRef, useEffect, useCallback } from 'react';
|
|
9
|
+
import cx from 'classnames';
|
|
10
|
+
import { Popover, PopoverContent } from '@carbon/react';
|
|
11
|
+
import { blockClass } from '../PageHeaderUtils.js';
|
|
12
|
+
import { createOverflowHandler } from './overflowHandler.js';
|
|
13
|
+
import { pkg } from '../../../settings.js';
|
|
14
|
+
|
|
15
|
+
const PageHeaderTagOverflow = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
16
|
+
let {
|
|
17
|
+
renderOverflowTag,
|
|
18
|
+
renderPopoverContent,
|
|
19
|
+
children
|
|
20
|
+
} = _ref;
|
|
21
|
+
const [openPopover, setOpenPopover] = useState(false);
|
|
22
|
+
const [hiddenTags, setHiddenTags] = useState([]);
|
|
23
|
+
const localRef = useRef(null);
|
|
24
|
+
const tagsContainerRef = ref || localRef;
|
|
25
|
+
// To close popover when window resizes
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const handleResize = () => {
|
|
28
|
+
// Close the popover when window resizes to prevent unwanted opens
|
|
29
|
+
setOpenPopover(false);
|
|
30
|
+
};
|
|
31
|
+
window.addEventListener('resize', handleResize);
|
|
32
|
+
return () => {
|
|
33
|
+
window.removeEventListener('resize', handleResize);
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
const handleOverflowClick = useCallback(event => {
|
|
37
|
+
event.stopPropagation();
|
|
38
|
+
setOpenPopover(prev => !prev);
|
|
39
|
+
}, []);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
createOverflowHandler({
|
|
42
|
+
container: tagsContainerRef.current,
|
|
43
|
+
onChange: (_, hidden) => {
|
|
44
|
+
setHiddenTags(hidden);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
// Don't want ref in dependency array
|
|
48
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
|
+
}, []);
|
|
50
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
51
|
+
ref: tagsContainerRef,
|
|
52
|
+
className: cx(`${pkg.prefix}--page-header--tag-overflow-container`, {
|
|
53
|
+
[`${pkg.prefix}--page-header--tag-overflow-container__has-no-hidden-items`]: !hiddenTags.length
|
|
54
|
+
})
|
|
55
|
+
}, children, /*#__PURE__*/React__default.createElement(Popover, {
|
|
56
|
+
open: openPopover,
|
|
57
|
+
onRequestClose: () => setOpenPopover(false),
|
|
58
|
+
"data-fixed": true,
|
|
59
|
+
className: cx(`${pkg.prefix}--page-header--tag-overflow-popover`, {
|
|
60
|
+
[`${pkg.prefix}--page-header--tag-overflow-popover__hidden`]: !hiddenTags.length
|
|
61
|
+
})
|
|
62
|
+
}, renderOverflowTag?.(hiddenTags, handleOverflowClick, openPopover), /*#__PURE__*/React__default.createElement(PopoverContent, null, /*#__PURE__*/React__default.createElement("div", {
|
|
63
|
+
className: `${blockClass}__tags-popover-list`
|
|
64
|
+
}, renderPopoverContent?.(hiddenTags)))));
|
|
65
|
+
});
|
|
66
|
+
PageHeaderTagOverflow.displayName = 'PageHeaderTagOverflow';
|
|
67
|
+
|
|
68
|
+
export { PageHeaderTagOverflow };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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 { BreadcrumbItemProps } from '@carbon/react';
|
|
9
|
+
export declare const PageHeaderTitleBreadcrumb: React.ForwardRefExoticComponent<BreadcrumbItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2020, 2026
|
|
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, { forwardRef } from 'react';
|
|
10
|
+
import cx from 'classnames';
|
|
11
|
+
import { BreadcrumbItem } from '@carbon/react';
|
|
12
|
+
import { usePageHeader } from './context.js';
|
|
13
|
+
import { pkg } from '../../../settings.js';
|
|
14
|
+
|
|
15
|
+
const PageHeaderTitleBreadcrumb = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
16
|
+
let {
|
|
17
|
+
className,
|
|
18
|
+
children,
|
|
19
|
+
...other
|
|
20
|
+
} = _ref;
|
|
21
|
+
const {
|
|
22
|
+
titleClipped,
|
|
23
|
+
refs
|
|
24
|
+
} = usePageHeader();
|
|
25
|
+
// Show title breadcrumb when:
|
|
26
|
+
// 1. No content element exists (compact mode), OR
|
|
27
|
+
// 2. Title is clipped and titleRef exists (with content element)
|
|
28
|
+
const hasContentElement = refs?.contentRef?.current;
|
|
29
|
+
const shouldShow = !hasContentElement || titleClipped && !!refs?.titleRef;
|
|
30
|
+
return /*#__PURE__*/React__default.createElement(BreadcrumbItem, _extends({
|
|
31
|
+
ref: ref,
|
|
32
|
+
isCurrentPage: true
|
|
33
|
+
}, other, {
|
|
34
|
+
className: cx(className, `${pkg.prefix}--page-header-title-breadcrumb`, {
|
|
35
|
+
[`${pkg.prefix}--page-header-title-breadcrumb-show`]: shouldShow,
|
|
36
|
+
[`${pkg.prefix}--page-header-title-breadcrumb-show__with-content-element`]: hasContentElement,
|
|
37
|
+
[`${pkg.prefix}--page-header-title-breadcrumb-show__without-content-element`]: !hasContentElement
|
|
38
|
+
})
|
|
39
|
+
}), children);
|
|
40
|
+
});
|
|
41
|
+
PageHeaderTitleBreadcrumb.displayName = 'PageHeaderTitleBreadcrumb';
|
|
42
|
+
|
|
43
|
+
export { PageHeaderTitleBreadcrumb };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2025,
|
|
2
|
+
* Copyright IBM Corp. 2025, 2026
|
|
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.
|
|
6
6
|
*/
|
|
7
7
|
export { PageHeader, PageHeaderBreadcrumbBar, PageHeaderContent, PageHeaderContentPageActions, PageHeaderContentText, PageHeaderTabBar, PageHeaderHeroImage, PageHeaderScrollButton, PageHeaderTitleBreadcrumb, PageHeaderBreadcrumbOverflow, PageHeaderTagOverflow, Root, BreadcrumbBar, Content, ContentPageActions, ContentText, TabBar, HeroImage, ScrollButton, TitleBreadcrumb, BreadcrumbOverflow, TagOverflow, } from './PageHeader';
|
|
8
|
-
export type {
|
|
8
|
+
export type { PageHeaderBreadcrumbBarProps, PageHeaderContentProps, PageHeaderContentPageActionsProps, PageHeaderContentTextProps, PageHeaderTabBarProps, PageHeaderHeroImageProps, PageHeaderScrollButtonProps, PageHeaderTagOverflowProps, PageHeaderBreadcrumbOverflowProps, } from './PageHeader';
|
|
9
|
+
export type { PageHeaderProps } from './PageHeader';
|
|
@@ -5,4 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export { BreadcrumbBar, BreadcrumbOverflow, Content, ContentPageActions, ContentText, HeroImage, PageHeader,
|
|
8
|
+
export { BreadcrumbBar, BreadcrumbOverflow, Content, ContentPageActions, ContentText, HeroImage, PageHeader, Root, ScrollButton, TabBar, TagOverflow, TitleBreadcrumb } from './PageHeader.js';
|
|
9
|
+
export { PageHeaderBreadcrumbBar } from './PageHeaderBreadcrumbBar.js';
|
|
10
|
+
export { PageHeaderContent } from './PageHeaderContent.js';
|
|
11
|
+
export { PageHeaderContentPageActions } from './PageHeaderContentPageActions.js';
|
|
12
|
+
export { PageHeaderContentText } from './PageHeaderContentText.js';
|
|
13
|
+
export { PageHeaderTabBar } from './PageHeaderTabBar.js';
|
|
14
|
+
export { PageHeaderHeroImage } from './PageHeaderHeroImage.js';
|
|
15
|
+
export { PageHeaderScrollButton } from './PageHeaderScrollButton.js';
|
|
16
|
+
export { PageHeaderTitleBreadcrumb } from './PageHeaderTitleBreadcrumb.js';
|
|
17
|
+
export { PageHeaderBreadcrumbOverflow } from './PageHeaderBreadcrumbOverflow.js';
|
|
18
|
+
export { PageHeaderTagOverflow } from './PageHeaderTagOverflow.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function useCreateComponentStepChange({ firstIncludedStep, lastIncludedStep, stepData, onPrevious, onNext, isSubmitDisabled, setCurrentStep, setIsSubmitting, setLoadingPrevious, loadingPrevious, onClose, onRequestSubmit, componentName, currentStep, backButtonText, cancelButtonText, submitButtonText, nextButtonText, isSubmitting, componentBlockClass, setCreateComponentActions, setModalIsOpen, experimentalSecondarySubmit, experimentalSecondarySubmitText, }: {
|
|
1
|
+
export function useCreateComponentStepChange({ firstIncludedStep, lastIncludedStep, stepData, onPrevious, onNext, isSubmitDisabled, setCurrentStep, setIsSubmitting, setLoadingPrevious, loadingPrevious, onClose, onRequestSubmit, componentName, currentStep, backButtonText, cancelButtonText, submitButtonText, nextButtonText, isSubmitting, secondaryButtonDisabled, componentBlockClass, setCreateComponentActions, setModalIsOpen, experimentalSecondarySubmit, experimentalSecondarySubmitText, }: {
|
|
2
2
|
firstIncludedStep: any;
|
|
3
3
|
lastIncludedStep: any;
|
|
4
4
|
stepData: any;
|
|
@@ -18,6 +18,7 @@ export function useCreateComponentStepChange({ firstIncludedStep, lastIncludedSt
|
|
|
18
18
|
submitButtonText: any;
|
|
19
19
|
nextButtonText: any;
|
|
20
20
|
isSubmitting: any;
|
|
21
|
+
secondaryButtonDisabled?: boolean | undefined;
|
|
21
22
|
componentBlockClass: any;
|
|
22
23
|
setCreateComponentActions: any;
|
|
23
24
|
setModalIsOpen: any;
|
|
@@ -28,6 +28,7 @@ const useCreateComponentStepChange = _ref => {
|
|
|
28
28
|
submitButtonText,
|
|
29
29
|
nextButtonText,
|
|
30
30
|
isSubmitting,
|
|
31
|
+
secondaryButtonDisabled = false,
|
|
31
32
|
componentBlockClass,
|
|
32
33
|
setCreateComponentActions,
|
|
33
34
|
setModalIsOpen,
|
|
@@ -138,7 +139,7 @@ const useCreateComponentStepChange = _ref => {
|
|
|
138
139
|
label: backButtonText,
|
|
139
140
|
onClick: handlePrevious,
|
|
140
141
|
kind: 'secondary',
|
|
141
|
-
disabled: currentStep === firstIncludedStep,
|
|
142
|
+
disabled: currentStep === firstIncludedStep || secondaryButtonDisabled,
|
|
142
143
|
loading: loadingPrevious
|
|
143
144
|
});
|
|
144
145
|
}
|
|
@@ -168,7 +169,7 @@ const useCreateComponentStepChange = _ref => {
|
|
|
168
169
|
});
|
|
169
170
|
setCreateComponentActions(buttons);
|
|
170
171
|
}
|
|
171
|
-
}, [firstIncludedStep, lastIncludedStep, stepData, onNext, isSubmitDisabled, backButtonText, cancelButtonText, currentStep, onClose, nextButtonText, submitButtonText, onRequestSubmit, isSubmitting, componentBlockClass, componentName, continueToNextStep, setCurrentStep, setCreateComponentActions, setIsSubmitting, setModalIsOpen, moveToPreviousStep, onPrevious, setLoadingPrevious, loadingPrevious, experimentalSecondarySubmit, experimentalSecondarySubmitText]);
|
|
172
|
+
}, [firstIncludedStep, lastIncludedStep, stepData, onNext, isSubmitDisabled, backButtonText, cancelButtonText, currentStep, onClose, nextButtonText, submitButtonText, onRequestSubmit, isSubmitting, secondaryButtonDisabled, componentBlockClass, componentName, continueToNextStep, setCurrentStep, setCreateComponentActions, setIsSubmitting, setModalIsOpen, moveToPreviousStep, onPrevious, setLoadingPrevious, loadingPrevious, experimentalSecondarySubmit, experimentalSecondarySubmitText]);
|
|
172
173
|
};
|
|
173
174
|
|
|
174
175
|
export { useCreateComponentStepChange };
|
|
@@ -12,7 +12,7 @@ import { useFeatureFlag } from '../../../components/FeatureFlags/index.js';
|
|
|
12
12
|
|
|
13
13
|
const usePortalTarget = portalTargetIn => {
|
|
14
14
|
const enablePortalTarget = useFeatureFlag('default-portal-target-body');
|
|
15
|
-
const [portalTarget, setPortalTarget] = useState(null);
|
|
15
|
+
const [portalTarget, setPortalTarget] = useState(portalTargetIn ?? null);
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
if (portalTargetIn) {
|
|
18
18
|
setPortalTarget(portalTargetIn);
|
|
@@ -40,15 +40,20 @@ const makeDraggable = _ref => {
|
|
|
40
40
|
const onKeyDown = e => {
|
|
41
41
|
if (e.key === 'Enter') {
|
|
42
42
|
isDragging = !isDragging;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
if (isDragging) {
|
|
44
|
+
// Get current transform values when starting keyboard drag
|
|
45
|
+
const style = window.getComputedStyle(el);
|
|
46
|
+
const matrix = new DOMMatrix(style.transform);
|
|
47
|
+
currentX = matrix.m41;
|
|
48
|
+
currentY = matrix.m42;
|
|
49
|
+
dispatch('dragstart', {
|
|
50
|
+
keyboard: true
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
dispatch('dragend', {
|
|
54
|
+
keyboard: true
|
|
55
|
+
});
|
|
56
|
+
}
|
|
52
57
|
}
|
|
53
58
|
if (!isDragging) {
|
|
54
59
|
return;
|
|
@@ -60,16 +65,20 @@ const makeDraggable = _ref => {
|
|
|
60
65
|
e.preventDefault();
|
|
61
66
|
break;
|
|
62
67
|
case 'ArrowLeft':
|
|
63
|
-
|
|
68
|
+
currentX -= distance;
|
|
69
|
+
el.style.transform = `translate(${currentX}px, ${currentY}px)`;
|
|
64
70
|
break;
|
|
65
71
|
case 'ArrowRight':
|
|
66
|
-
|
|
72
|
+
currentX += distance;
|
|
73
|
+
el.style.transform = `translate(${currentX}px, ${currentY}px)`;
|
|
67
74
|
break;
|
|
68
75
|
case 'ArrowUp':
|
|
69
|
-
|
|
76
|
+
currentY -= distance;
|
|
77
|
+
el.style.transform = `translate(${currentX}px, ${currentY}px)`;
|
|
70
78
|
break;
|
|
71
79
|
case 'ArrowDown':
|
|
72
|
-
|
|
80
|
+
currentY += distance;
|
|
81
|
+
el.style.transform = `translate(${currentX}px, ${currentY}px)`;
|
|
73
82
|
break;
|
|
74
83
|
}
|
|
75
84
|
};
|
|
@@ -36,7 +36,8 @@ const ContentHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
36
36
|
const dragRef = React.useRef(null);
|
|
37
37
|
const handleRef = ref || headerRef;
|
|
38
38
|
const contentHeaderBlockClass = `${context.blockClass}--content-header`;
|
|
39
|
-
const closeBubble =
|
|
39
|
+
const closeBubble = e => {
|
|
40
|
+
e?.stopPropagation();
|
|
40
41
|
onClose?.();
|
|
41
42
|
setOpen(false);
|
|
42
43
|
};
|
|
@@ -192,7 +192,18 @@ const ConditionBuilderItem = _ref => {
|
|
|
192
192
|
role: "gridcell",
|
|
193
193
|
className: `${popOverClassName} ${util.blockClass}__popover`,
|
|
194
194
|
ref: popoverRef,
|
|
195
|
-
onRequestClose:
|
|
195
|
+
onRequestClose: () => {
|
|
196
|
+
// Workaround: prevent closing the popover when a date is selected
|
|
197
|
+
// from the flatpickr calendar, which is rendered outside the popover DOM.
|
|
198
|
+
// The flatpickr calendar is appended outside the popover DOM, so clicks on it
|
|
199
|
+
// trigger onRequestClose. We use the global event object to check the click target.
|
|
200
|
+
// carbon issue: https://github.com/carbon-design-system/carbon/issues/21690
|
|
201
|
+
const target = event?.target;
|
|
202
|
+
if (target?.closest('.flatpickr-calendar')) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
closePopover();
|
|
206
|
+
}
|
|
196
207
|
}, /*#__PURE__*/React.createElement(ConditionBuilderButton.ConditionBuilderButton, _rollupPluginBabelHelpers.extends({
|
|
197
208
|
label: getLabel(),
|
|
198
209
|
hideLabel: !label ? true : false,
|
|
@@ -13,6 +13,7 @@ export interface StepsContextType {
|
|
|
13
13
|
setOnPrevious: (fn: any) => void;
|
|
14
14
|
setOnNext: (fn: any) => void;
|
|
15
15
|
setOnMount: (fn: any) => void;
|
|
16
|
+
setSecondaryButtonDisabled?: Dispatch<SetStateAction<boolean>>;
|
|
16
17
|
setStepData: Dispatch<SetStateAction<Step[]>>;
|
|
17
18
|
stepData: Step[];
|
|
18
19
|
}
|
|
@@ -74,6 +74,7 @@ const CreateTearsheet = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
74
74
|
const [onPrevious, setOnPrevious] = React.useState();
|
|
75
75
|
const [onNext, setOnNext] = React.useState();
|
|
76
76
|
const [onMount, setOnMount] = React.useState();
|
|
77
|
+
const [secondaryButtonDisabled, setSecondaryButtonDisabled] = React.useState(false);
|
|
77
78
|
const [stepData, setStepData] = React.useState([]);
|
|
78
79
|
const [firstIncludedStep, setFirstIncludedStep] = React.useState(1);
|
|
79
80
|
const [lastIncludedStep, setLastIncludedStep] = React.useState();
|
|
@@ -139,6 +140,7 @@ const CreateTearsheet = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
139
140
|
submitButtonText,
|
|
140
141
|
nextButtonText,
|
|
141
142
|
isSubmitting,
|
|
143
|
+
secondaryButtonDisabled,
|
|
142
144
|
componentBlockClass: blockClass,
|
|
143
145
|
experimentalSecondarySubmit,
|
|
144
146
|
experimentalSecondarySubmitText: experimentalSecondarySubmit?.labelText ? experimentalSecondarySubmit.labelText : experimentalSecondarySubmitText,
|
|
@@ -179,6 +181,7 @@ const CreateTearsheet = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
179
181
|
setOnPrevious: fn => setOnPrevious(() => fn),
|
|
180
182
|
setOnNext: fn => setOnNext(() => fn),
|
|
181
183
|
setOnMount: fn => setOnMount(() => fn),
|
|
184
|
+
setSecondaryButtonDisabled,
|
|
182
185
|
setStepData,
|
|
183
186
|
stepData
|
|
184
187
|
}
|
|
@@ -89,6 +89,10 @@ interface CreateTearsheetStepBaseProps extends PropsWithChildren {
|
|
|
89
89
|
* Optional function to be called when you move to the previous step.
|
|
90
90
|
*/
|
|
91
91
|
onPrevious?: () => void;
|
|
92
|
+
/**
|
|
93
|
+
* This will conditionally disable the secondary (Back) button in the multi step Tearsheet
|
|
94
|
+
*/
|
|
95
|
+
secondaryButtonDisabled?: boolean;
|
|
92
96
|
/**
|
|
93
97
|
* Sets the optional secondary label on the progress step component
|
|
94
98
|
*/
|
|
@@ -54,6 +54,7 @@ const CreateTearsheetStep = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
54
54
|
onMount,
|
|
55
55
|
onNext,
|
|
56
56
|
onPrevious,
|
|
57
|
+
secondaryButtonDisabled,
|
|
57
58
|
secondaryLabel,
|
|
58
59
|
subtitle,
|
|
59
60
|
title,
|
|
@@ -100,11 +101,12 @@ const CreateTearsheetStep = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
100
101
|
stepsContext.setIsDisabled(!!disableSubmit);
|
|
101
102
|
stepsContext?.setOnNext(onNext); // needs to be updated here otherwise there could be stale state values from only initially setting onNext
|
|
102
103
|
stepsContext?.setOnPrevious(onPrevious);
|
|
104
|
+
stepsContext?.setSecondaryButtonDisabled?.(!!secondaryButtonDisabled);
|
|
103
105
|
|
|
104
106
|
//Handle props for experimentalSecondarySubmit button, depending on state change
|
|
105
107
|
stepsContext?.setExperimentalSecondarySubmit(experimentalSecondarySubmit);
|
|
106
108
|
}
|
|
107
|
-
}, [stepsContext, stepNumber, disableSubmit, onNext, onPrevious, stepRef, stepRefValue, experimentalSecondarySubmit]);
|
|
109
|
+
}, [stepsContext, stepNumber, disableSubmit, onNext, onPrevious, secondaryButtonDisabled, stepRef, stepRefValue, experimentalSecondarySubmit]);
|
|
108
110
|
const renderDescription = () => {
|
|
109
111
|
if (description) {
|
|
110
112
|
if (typeof description === 'string') {
|
|
@@ -224,6 +226,10 @@ CreateTearsheetStep.propTypes = {
|
|
|
224
226
|
* Optional function to be called when you move to the previous step.
|
|
225
227
|
*/
|
|
226
228
|
onPrevious: index.default.func,
|
|
229
|
+
/**
|
|
230
|
+
* This will conditionally disable the secondary (Back) button in the multi step Tearsheet
|
|
231
|
+
*/
|
|
232
|
+
secondaryButtonDisabled: index.default.bool,
|
|
227
233
|
/**
|
|
228
234
|
* Sets the optional secondary label on the progress step component
|
|
229
235
|
*/
|