@carbon/ibm-products 2.79.0 → 2.80.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/css/carbon.css +39 -19
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +186 -80
- 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 +147 -61
- 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 +147 -61
- 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 +150 -66
- 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/Coachmark.d.ts +2 -1
- package/es/components/Coachmark/Coachmark.js +6 -0
- package/es/components/Coachmark/CoachmarkDragbar.d.ts +2 -1
- package/es/components/Coachmark/CoachmarkDragbar.js +7 -0
- package/es/components/Coachmark/CoachmarkHeader.d.ts +2 -1
- package/es/components/Coachmark/CoachmarkHeader.js +7 -0
- package/es/components/Coachmark/CoachmarkOverlay.d.ts +2 -1
- package/es/components/Coachmark/CoachmarkOverlay.js +1 -0
- package/es/components/Coachmark/CoachmarkTagline.d.ts +2 -1
- package/es/components/Coachmark/CoachmarkTagline.js +7 -0
- package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +3 -2
- package/es/components/Coachmark/utils/hooks.js +4 -3
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.d.ts +2 -1
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +7 -0
- package/es/components/CoachmarkButton/CoachmarkButton.d.ts +2 -1
- package/es/components/CoachmarkButton/CoachmarkButton.js +1 -0
- package/es/components/CoachmarkFixed/CoachmarkFixed.d.ts +1 -0
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +7 -0
- package/es/components/CoachmarkOverlayElement/CoachmarkOverlayElement.d.ts +2 -1
- package/es/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +1 -0
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +2 -1
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +1 -0
- package/es/components/CoachmarkStack/CoachmarkStack.d.ts +2 -1
- package/es/components/CoachmarkStack/CoachmarkStack.js +7 -0
- package/es/components/CreateFullPage/CreateFullPage.js +1 -1
- package/es/components/CreateTearsheet/CreateTearsheet.js +2 -2
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +2 -21
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +3 -2
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -0
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +2 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +2 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useShouldDisableButtons.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useShouldDisableButtons.js +6 -1
- package/es/components/Datagrid/useResizeTable.js +2 -2
- package/es/components/Datagrid/useSelectRows.js +3 -2
- package/es/components/Datagrid/useStickyColumn.js +3 -2
- package/es/components/PageHeader/next/PageHeader.js +4 -3
- package/es/components/ScrollGradient/constants.js +3 -2
- package/es/components/Tearsheet/TearsheetShell.js +4 -6
- package/es/components/Tearsheet/next/StackContext.d.ts +21 -0
- package/es/components/Tearsheet/next/StackContext.js +94 -0
- package/es/components/Tearsheet/next/Tearsheet.d.ts +13 -2
- package/es/components/Tearsheet/next/Tearsheet.js +46 -10
- package/es/components/Tearsheet/next/TearsheetBody.d.ts +6 -0
- package/es/components/Tearsheet/next/TearsheetBody.js +19 -7
- package/es/components/Tearsheet/next/TearsheetHeaderActions.js +9 -4
- package/es/components/Tearsheet/next/TearsheetHeaderContent.d.ts +22 -8
- package/es/components/Tearsheet/next/TearsheetHeaderContent.js +14 -27
- package/es/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts +3 -2
- package/es/components/Tearsheet/next/index.d.ts +2 -0
- package/es/components/index.d.ts +2 -1
- package/es/global/js/hooks/useCreateComponentFocus.js +34 -4
- package/es/global/js/hooks/useIsomorphicEffect.d.ts +7 -1
- package/es/global/js/hooks/useIsomorphicEffect.js +1 -2
- package/es/global/js/hooks/useResizeObserver.js +4 -3
- package/es/global/js/hooks/useWindowResize.js +3 -2
- package/es/global/js/hooks/useWindowScroll.js +3 -2
- package/es/index.js +2 -2
- package/lib/components/Coachmark/Coachmark.d.ts +2 -1
- package/lib/components/Coachmark/Coachmark.js +6 -0
- package/lib/components/Coachmark/CoachmarkDragbar.d.ts +2 -1
- package/lib/components/Coachmark/CoachmarkDragbar.js +7 -0
- package/lib/components/Coachmark/CoachmarkHeader.d.ts +2 -1
- package/lib/components/Coachmark/CoachmarkHeader.js +7 -0
- package/lib/components/Coachmark/CoachmarkOverlay.d.ts +2 -1
- package/lib/components/Coachmark/CoachmarkOverlay.js +1 -0
- package/lib/components/Coachmark/CoachmarkTagline.d.ts +2 -1
- package/lib/components/Coachmark/CoachmarkTagline.js +7 -0
- package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +2 -1
- package/lib/components/Coachmark/utils/hooks.js +3 -2
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.d.ts +2 -1
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +7 -0
- package/lib/components/CoachmarkButton/CoachmarkButton.d.ts +2 -1
- package/lib/components/CoachmarkButton/CoachmarkButton.js +1 -0
- package/lib/components/CoachmarkFixed/CoachmarkFixed.d.ts +1 -0
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +7 -0
- package/lib/components/CoachmarkOverlayElement/CoachmarkOverlayElement.d.ts +2 -1
- package/lib/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +1 -0
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +2 -1
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +1 -0
- package/lib/components/CoachmarkStack/CoachmarkStack.d.ts +2 -1
- package/lib/components/CoachmarkStack/CoachmarkStack.js +7 -0
- package/lib/components/CreateFullPage/CreateFullPage.js +1 -1
- package/lib/components/CreateTearsheet/CreateTearsheet.js +2 -2
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +2 -21
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +2 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -0
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +2 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +2 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useShouldDisableButtons.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useShouldDisableButtons.js +6 -1
- package/lib/components/Datagrid/useResizeTable.js +2 -2
- package/lib/components/Datagrid/useSelectRows.js +2 -1
- package/lib/components/Datagrid/useStickyColumn.js +2 -1
- package/lib/components/PageHeader/next/PageHeader.js +3 -2
- package/lib/components/ScrollGradient/constants.js +2 -1
- package/lib/components/Tearsheet/TearsheetShell.js +3 -5
- package/lib/components/Tearsheet/next/StackContext.d.ts +21 -0
- package/lib/components/Tearsheet/next/StackContext.js +97 -0
- package/lib/components/Tearsheet/next/Tearsheet.d.ts +13 -2
- package/lib/components/Tearsheet/next/Tearsheet.js +44 -8
- package/lib/components/Tearsheet/next/TearsheetBody.d.ts +6 -0
- package/lib/components/Tearsheet/next/TearsheetBody.js +19 -7
- package/lib/components/Tearsheet/next/TearsheetHeaderActions.js +8 -3
- package/lib/components/Tearsheet/next/TearsheetHeaderContent.d.ts +22 -8
- package/lib/components/Tearsheet/next/TearsheetHeaderContent.js +12 -25
- package/lib/components/Tearsheet/next/_story-assets/StepTearsheet.d.ts +3 -2
- package/lib/components/Tearsheet/next/index.d.ts +2 -0
- package/lib/components/index.d.ts +2 -1
- package/lib/global/js/hooks/useCreateComponentFocus.js +34 -4
- package/lib/global/js/hooks/useIsomorphicEffect.d.ts +7 -1
- package/lib/global/js/hooks/useIsomorphicEffect.js +1 -2
- package/lib/global/js/hooks/useResizeObserver.js +3 -2
- package/lib/global/js/hooks/useWindowResize.js +2 -1
- package/lib/global/js/hooks/useWindowScroll.js +2 -1
- package/lib/index.js +15 -13
- package/package.json +14 -14
- package/scss/components/Tearsheet/_tearsheet.scss +11 -6
- package/scss/components/Tearsheet/_tearsheet_next.scss +218 -96
- package/telemetry.yml +11 -7
- package/es/components/Tearsheet/next/index.js +0 -8
- package/lib/components/Tearsheet/next/index.js +0 -14
|
@@ -20,48 +20,35 @@ const TearsheetHeaderContent = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
20
20
|
label,
|
|
21
21
|
title,
|
|
22
22
|
description,
|
|
23
|
-
descriptionExpandLabel = 'Read more',
|
|
24
|
-
descriptionCollapseLabel = 'Read less',
|
|
25
|
-
titleIcon: Icon,
|
|
26
|
-
titleIconPosition = 'leading',
|
|
27
23
|
headerActions,
|
|
24
|
+
titleStart,
|
|
25
|
+
titleEnd,
|
|
28
26
|
...rest
|
|
29
27
|
} = props;
|
|
30
|
-
const {
|
|
31
|
-
isSm
|
|
32
|
-
} = React.useContext(context.TearsheetContext);
|
|
33
28
|
return /*#__PURE__*/React.createElement("div", {
|
|
34
29
|
className: `${context.blockClass}__header-content-wrapper`,
|
|
35
30
|
ref: ref
|
|
36
31
|
}, /*#__PURE__*/React.createElement("div", {
|
|
37
32
|
className: `${context.blockClass}__header-content`
|
|
38
|
-
}, /*#__PURE__*/React.createElement("
|
|
33
|
+
}, label ? /*#__PURE__*/React.createElement("div", {
|
|
39
34
|
className: `${context.blockClass}__header-label`
|
|
40
|
-
}, label), /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
}, label) : null, /*#__PURE__*/React.createElement("div", {
|
|
41
36
|
className: `${context.blockClass}__content__title-wrapper`
|
|
42
37
|
}, /*#__PURE__*/React.createElement("h2", {
|
|
43
|
-
className: cx(`${context.blockClass}__header-title
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
48
|
-
}, !isSm && Icon && /*#__PURE__*/React.createElement(Icon, {
|
|
49
|
-
size: 32
|
|
50
|
-
}), /*#__PURE__*/React.createElement(TruncatedText.TruncatedText, {
|
|
38
|
+
className: cx(`${context.blockClass}__header-title`)
|
|
39
|
+
}, titleStart ? /*#__PURE__*/React.createElement("span", {
|
|
40
|
+
className: `${context.blockClass}__title-start`
|
|
41
|
+
}, titleStart) : null, /*#__PURE__*/React.createElement(TruncatedText.TruncatedText, {
|
|
51
42
|
id: `${context.blockClass}__header-title__truncatedText`,
|
|
52
43
|
className: `${context.blockClass}__content__title`,
|
|
53
44
|
align: "bottom",
|
|
54
45
|
autoAlign: true,
|
|
55
46
|
value: title
|
|
56
|
-
})
|
|
47
|
+
}), titleEnd ? /*#__PURE__*/React.createElement("span", {
|
|
48
|
+
className: `${context.blockClass}__title-end`
|
|
49
|
+
}, titleEnd) : null)), /*#__PURE__*/React.createElement("div", {
|
|
57
50
|
className: `${context.blockClass}__header-description`
|
|
58
|
-
}, /*#__PURE__*/React.createElement(
|
|
59
|
-
id: `${context.blockClass}__header-description__truncatedText`,
|
|
60
|
-
expandLabel: descriptionExpandLabel,
|
|
61
|
-
collapseLabel: descriptionCollapseLabel,
|
|
62
|
-
value: description,
|
|
63
|
-
type: "expand"
|
|
64
|
-
})), children && /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
}, description), children && /*#__PURE__*/React.createElement("div", {
|
|
65
52
|
className: `${context.blockClass}__header-content--extra`
|
|
66
53
|
}, children)), headerActions && /*#__PURE__*/React.createElement("div", {
|
|
67
54
|
className: `${context.blockClass}__header-actions`
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React, { ReactNode } from 'react';
|
|
7
|
+
import React, { ReactNode, RefObject } from 'react';
|
|
8
8
|
import { StepState } from '../../../StepFlow';
|
|
9
9
|
interface Props {
|
|
10
10
|
children?: ReactNode;
|
|
@@ -17,6 +17,7 @@ interface Props {
|
|
|
17
17
|
selectorPrimaryFocus?: string;
|
|
18
18
|
setOpen?: (open: boolean) => void;
|
|
19
19
|
progressIndicator?: 'vertical' | 'horizontal';
|
|
20
|
+
launcherButtonRef?: RefObject<HTMLButtonElement | null>;
|
|
20
21
|
}
|
|
21
|
-
export declare const TearsheetWithSteps: ({ children, open, setOpen, onClose, influencer, title, hasCloseIcon, closeIconDescription, selectorPrimaryFocus, progressIndicator, ...rest }: Props) => React.JSX.Element;
|
|
22
|
+
export declare const TearsheetWithSteps: ({ children, open, setOpen, onClose, influencer, title, hasCloseIcon, closeIconDescription, selectorPrimaryFocus, progressIndicator, launcherButtonRef, ...rest }: Props) => React.JSX.Element;
|
|
22
23
|
export {};
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
export { Tearsheet } from './Tearsheet';
|
|
8
|
+
export { StackProvider, useStackContext } from './StackContext';
|
|
9
|
+
export type { StackContextType } from './StackContext';
|
|
8
10
|
export type { TearsheetProps, TearsheetComponentType, FooterProps, } from './Tearsheet';
|
|
9
11
|
export type { MainContentProps, SummaryContentProps, TearsheetBodyProps, InfluencerProps, } from './TearsheetBody';
|
|
10
12
|
export type { TearsheetHeaderProps, TearsheetNavigationBarProps, TearsheetScrollButtonProps, } from './TearsheetHeader';
|
|
@@ -46,7 +46,8 @@ export * as preview__CoachmarkBeacon from './Coachmark/next/Coachmark/CoachmarkB
|
|
|
46
46
|
export { TruncatedText as preview__TruncatedText, type TruncatedTextProps, } from './TruncatedText';
|
|
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';
|
|
49
|
-
export
|
|
49
|
+
export { Tearsheet as preview__Tearsheet, StackProvider, } from './Tearsheet/next';
|
|
50
|
+
export type { TearsheetProps, TearsheetComponentType, FooterProps, MainContentProps, SummaryContentProps, TearsheetBodyProps, InfluencerProps, TearsheetHeaderProps, TearsheetNavigationBarProps, TearsheetScrollButtonProps, TearsheetHeaderActionItemProps, TearsheetHeaderActionsProps, TearsheetHeaderContentProps, StackContextType, } from './Tearsheet/next';
|
|
50
51
|
export { BigNumber as previewCandidate__BigNumber, type BigNumberProps, } from './BigNumber';
|
|
51
52
|
export { Coachmark as previewCandidate__Coachmark, BEACON_KIND, COACHMARK_OVERLAY_KIND, COACHMARK_ALIGNMENT, useCoachmark, type CoachmarkProps, } from './Coachmark';
|
|
52
53
|
export { CoachmarkBeacon as previewCandidate__CoachmarkBeacon, type CoachmarkBeaconProps, } from './CoachmarkBeacon';
|
|
@@ -30,11 +30,41 @@ const useCreateComponentFocus = _ref => {
|
|
|
30
30
|
await wait.default(10);
|
|
31
31
|
elm.focus();
|
|
32
32
|
};
|
|
33
|
+
// FUNCTION TO ENSURE THE ELEMENT TARGETED IS NOT CONTAINED IN AN ELEMENT MARKED 'INERT'
|
|
34
|
+
const isNotContainedInInert = elm => {
|
|
35
|
+
if (!elm) return false;
|
|
36
|
+
const inertParent = elm.closest('[inert]');
|
|
37
|
+
return !inertParent || !inertParent.hasAttribute('inert') && !elm.disabled;
|
|
38
|
+
};
|
|
39
|
+
const getActiveStep = () => {
|
|
40
|
+
const allSteps = Array.from(document.querySelectorAll(blockClass));
|
|
41
|
+
return allSteps.find(el => {
|
|
42
|
+
let currentStep = el;
|
|
43
|
+
while (currentStep) {
|
|
44
|
+
if (currentStep.hasAttribute('inert')) return false;
|
|
45
|
+
currentStep = currentStep.parentElement;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
const getFocusableElement = containingElement => {
|
|
51
|
+
const focusElementQuery = `button, input[type="button"], input, select, textarea, a[href]`;
|
|
52
|
+
// PREFER THE USER DEFINED firstFocusElement IF IT EXISTS
|
|
53
|
+
const firstFocusEl = containingElement.querySelector(firstFocusElement);
|
|
54
|
+
if (firstFocusEl && isNotContainedInInert(firstFocusEl) && !firstFocusEl.disabled) {
|
|
55
|
+
return firstFocusEl;
|
|
56
|
+
}
|
|
57
|
+
// BACKUP TO INTERACTIVE ELEMENT LIST
|
|
58
|
+
const bakFocusEl = Array.from(containingElement.querySelectorAll(focusElementQuery));
|
|
59
|
+
return bakFocusEl.find(el => isNotContainedInInert(el) && !el.disabled);
|
|
60
|
+
};
|
|
33
61
|
if (previousState?.currentStep !== currentStep && currentStep > 0) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
62
|
+
// GET THE CURRENT STEP ELEMENT
|
|
63
|
+
const activeStepElement = getActiveStep();
|
|
64
|
+
if (activeStepElement && isNotContainedInInert(activeStepElement)) {
|
|
65
|
+
const focusEl = getFocusableElement(activeStepElement);
|
|
66
|
+
if (focusEl) {
|
|
67
|
+
awaitFocus(focusEl);
|
|
38
68
|
}
|
|
39
69
|
}
|
|
40
70
|
}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2024, 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
|
+
*/
|
|
2
7
|
import { useEffect } from 'react';
|
|
8
|
+
export declare const useIsomorphicEffect: typeof useEffect;
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
var React = require('react');
|
|
11
11
|
|
|
12
|
-
//
|
|
13
|
-
// useLayoutEffect on the client, useEffect on the server
|
|
12
|
+
// Custom hook that uses either `useLayoutEffect` or `useEffect` based on the environment (client-side or server-side).
|
|
14
13
|
const useIsomorphicEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
15
14
|
|
|
16
15
|
exports.useIsomorphicEffect = useIsomorphicEffect;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
var React = require('react');
|
|
11
|
+
var useIsomorphicEffect = require('./useIsomorphicEffect.js');
|
|
11
12
|
|
|
12
13
|
const useResizeObserver = (ref, onResize) => {
|
|
13
14
|
const [width, setWidth] = React.useState(-1);
|
|
@@ -15,7 +16,7 @@ const useResizeObserver = (ref, onResize) => {
|
|
|
15
16
|
const entriesToHandle = React.useRef(null);
|
|
16
17
|
const cb = React.useRef(onResize);
|
|
17
18
|
React.useEffect(() => {
|
|
18
|
-
// ref for onResize removes it as dependency from
|
|
19
|
+
// ref for onResize removes it as dependency from useIsomorphicEffect
|
|
19
20
|
// This significantly reduces repeated calls if a function is redefined on every
|
|
20
21
|
// render
|
|
21
22
|
cb.current = onResize;
|
|
@@ -37,7 +38,7 @@ const useResizeObserver = (ref, onResize) => {
|
|
|
37
38
|
// Ignoring exhaustive-deps as we do NOT want to include the ref in dep array
|
|
38
39
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
40
|
}, [width, height]);
|
|
40
|
-
|
|
41
|
+
useIsomorphicEffect.useIsomorphicEffect(() => {
|
|
41
42
|
if (!ref?.current) {
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
var React = require('react');
|
|
11
|
+
var useIsomorphicEffect = require('./useIsomorphicEffect.js');
|
|
11
12
|
|
|
12
13
|
const windowExists = typeof window !== `undefined`;
|
|
13
14
|
const getWindowSize = () => {
|
|
@@ -49,7 +50,7 @@ const useWindowResize = function (effect, deps) {
|
|
|
49
50
|
windowSize.current = newVal.current;
|
|
50
51
|
throttleTimeout.current = null;
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
+
useIsomorphicEffect.useIsomorphicEffect(() => {
|
|
53
54
|
const handleResize = () => {
|
|
54
55
|
if (throttleInterval) {
|
|
55
56
|
if (throttleTimeout.current === null) {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
var React = require('react');
|
|
11
|
+
var useIsomorphicEffect = require('./useIsomorphicEffect.js');
|
|
11
12
|
var scrollableAncestor = require('../utils/scrollableAncestor.js');
|
|
12
13
|
|
|
13
14
|
const windowExists = typeof window !== `undefined`;
|
|
@@ -46,7 +47,7 @@ const useTargetScroll = function (target, effect, deps, throttleInterval) {
|
|
|
46
47
|
scrollPosition.current = newVal.current;
|
|
47
48
|
throttleTimeout.current = null;
|
|
48
49
|
};
|
|
49
|
-
|
|
50
|
+
useIsomorphicEffect.useIsomorphicEffect(() => {
|
|
50
51
|
const handleScroll = () => {
|
|
51
52
|
if (throttleInterval) {
|
|
52
53
|
if (throttleTimeout.current === null) {
|
package/lib/index.js
CHANGED
|
@@ -49,18 +49,19 @@ var SingleAddSelect = require('./components/SingleAddSelect/SingleAddSelect.js')
|
|
|
49
49
|
var StatusIcon = require('./components/StatusIcon/StatusIcon.js');
|
|
50
50
|
var TagOverflow = require('./components/TagOverflow/TagOverflow.js');
|
|
51
51
|
var TagSet = require('./components/TagSet/TagSet.js');
|
|
52
|
-
var Tearsheet = require('./components/Tearsheet/Tearsheet.js');
|
|
52
|
+
var Tearsheet$1 = require('./components/Tearsheet/Tearsheet.js');
|
|
53
53
|
var TearsheetNarrow = require('./components/Tearsheet/TearsheetNarrow.js');
|
|
54
54
|
var WebTerminal = require('./components/WebTerminal/WebTerminal.js');
|
|
55
55
|
var WebTerminalContentWrapper = require('./components/WebTerminal/WebTerminalContentWrapper.js');
|
|
56
|
-
var index$
|
|
56
|
+
var index$5 = require('./components/WebTerminal/hooks/index.js');
|
|
57
57
|
var index = require('./components/Coachmark/next/Coachmark/index.js');
|
|
58
58
|
var index$1 = require('./components/Coachmark/next/Coachmark/CoachmarkTagline/index.js');
|
|
59
59
|
var index$2 = require('./components/Coachmark/next/Coachmark/CoachmarkBeacon/index.js');
|
|
60
60
|
var TruncatedText = require('./components/TruncatedText/TruncatedText.js');
|
|
61
|
-
var index$
|
|
61
|
+
var index$4 = require('./components/FeatureFlags/index.js');
|
|
62
62
|
var index$3 = require('./components/PageHeader/next/index.js');
|
|
63
|
-
var
|
|
63
|
+
var Tearsheet = require('./components/Tearsheet/next/Tearsheet.js');
|
|
64
|
+
var StackContext = require('./components/Tearsheet/next/StackContext.js');
|
|
64
65
|
var BigNumber = require('./components/BigNumber/BigNumber.js');
|
|
65
66
|
var Coachmark = require('./components/Coachmark/Coachmark.js');
|
|
66
67
|
var enums = require('./components/Coachmark/utils/enums.js');
|
|
@@ -89,7 +90,7 @@ var ToolbarButton = require('./components/Toolbar/ToolbarButton.js');
|
|
|
89
90
|
var ToolbarGroup = require('./components/Toolbar/ToolbarGroup.js');
|
|
90
91
|
var TruncatedList = require('./components/TruncatedList/TruncatedList.js');
|
|
91
92
|
var ComboButton = require('./components/ComboButton/ComboButton.js');
|
|
92
|
-
var index$
|
|
93
|
+
var index$6 = require('./components/ComboButton/ComboButtonItem/index.js');
|
|
93
94
|
var Datagrid = require('./components/Datagrid/Datagrid/Datagrid.js');
|
|
94
95
|
var useDatagrid = require('./components/Datagrid/useDatagrid.js');
|
|
95
96
|
var useInfiniteScroll = require('./components/Datagrid/useInfiniteScroll.js');
|
|
@@ -192,21 +193,22 @@ exports.SingleAddSelect = SingleAddSelect.SingleAddSelect;
|
|
|
192
193
|
exports.StatusIcon = StatusIcon.StatusIcon;
|
|
193
194
|
exports.TagOverflow = TagOverflow.TagOverflow;
|
|
194
195
|
exports.TagSet = TagSet.TagSet;
|
|
195
|
-
exports.Tearsheet = Tearsheet.Tearsheet;
|
|
196
|
+
exports.Tearsheet = Tearsheet$1.Tearsheet;
|
|
196
197
|
exports.TearsheetNarrow = TearsheetNarrow.TearsheetNarrow;
|
|
197
198
|
exports.WebTerminal = WebTerminal.WebTerminal;
|
|
198
199
|
exports.WebTerminalContentWrapper = WebTerminalContentWrapper.WebTerminalContentWrapper;
|
|
199
|
-
exports.WebTerminalProvider = index$
|
|
200
|
-
exports.useWebTerminal = index$
|
|
200
|
+
exports.WebTerminalProvider = index$5.WebTerminalProvider;
|
|
201
|
+
exports.useWebTerminal = index$5.useWebTerminal;
|
|
201
202
|
exports.preview__Coachmark = index;
|
|
202
203
|
exports.preview__CoachmarkTagline = index$1;
|
|
203
204
|
exports.preview__CoachmarkBeacon = index$2;
|
|
204
205
|
exports.preview__TruncatedText = TruncatedText.TruncatedText;
|
|
205
|
-
exports.preview__FeatureFlags = index$
|
|
206
|
-
exports.preview__useFeatureFlag = index$
|
|
207
|
-
exports.preview__useFeatureFlags = index$
|
|
206
|
+
exports.preview__FeatureFlags = index$4.FeatureFlags;
|
|
207
|
+
exports.preview__useFeatureFlag = index$4.useFeatureFlag;
|
|
208
|
+
exports.preview__useFeatureFlags = index$4.useFeatureFlags;
|
|
208
209
|
exports.preview__PageHeader = index$3;
|
|
209
|
-
exports.preview__Tearsheet =
|
|
210
|
+
exports.preview__Tearsheet = Tearsheet.Tearsheet;
|
|
211
|
+
exports.StackProvider = StackContext.StackProvider;
|
|
210
212
|
exports.previewCandidate__BigNumber = BigNumber.BigNumber;
|
|
211
213
|
exports.previewCandidate__Coachmark = Coachmark.Coachmark;
|
|
212
214
|
exports.BEACON_KIND = enums.BEACON_KIND;
|
|
@@ -236,7 +238,7 @@ exports.previewCandidate__ToolbarButton = ToolbarButton.ToolbarButton;
|
|
|
236
238
|
exports.previewCandidate__ToolbarGroup = ToolbarGroup.ToolbarGroup;
|
|
237
239
|
exports.previewCandidate__TruncatedList = TruncatedList.TruncatedList;
|
|
238
240
|
exports.ComboButton = ComboButton.ComboButton;
|
|
239
|
-
exports.ComboButtonItem = index$
|
|
241
|
+
exports.ComboButtonItem = index$6.ComboButtonItem;
|
|
240
242
|
exports.Datagrid = Datagrid.Datagrid;
|
|
241
243
|
exports.useDatagrid = useDatagrid.default;
|
|
242
244
|
exports.useInfiniteScroll = useInfiniteScroll.default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/ibm-products",
|
|
3
3
|
"description": "Carbon for IBM Products",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.80.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@babel/preset-env": "^7.26.9",
|
|
68
68
|
"@babel/preset-react": "^7.26.3",
|
|
69
69
|
"@babel/preset-typescript": "^7.26.0",
|
|
70
|
-
"@carbon/styles": "^1.
|
|
70
|
+
"@carbon/styles": "^1.94.0",
|
|
71
71
|
"@figma/code-connect": "^1.3.5",
|
|
72
72
|
"@ibm/telemetry-js-config-generator": "^2.0.1",
|
|
73
73
|
"@percy/cli": "^1.31.0",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@storybook/react-vite": "^9.0.13",
|
|
83
83
|
"@types/react-table": "^7.7.20",
|
|
84
84
|
"babel-plugin-dev-expression": "^0.2.3",
|
|
85
|
-
"babel-preset-ibm-cloud-cognitive": "^0.
|
|
85
|
+
"babel-preset-ibm-cloud-cognitive": "^0.38.0-rc.0",
|
|
86
86
|
"change-case": "5.4.4",
|
|
87
87
|
"classnames": "^2.5.1",
|
|
88
88
|
"copyfiles": "^2.4.1",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"fs-extra": "^11.3.0",
|
|
91
91
|
"glob": "^11.0.1",
|
|
92
92
|
"jest": "^29.7.0",
|
|
93
|
-
"jest-config-ibm-cloud-cognitive": "^1.
|
|
93
|
+
"jest-config-ibm-cloud-cognitive": "^1.39.0-rc.0",
|
|
94
94
|
"jest-environment-jsdom": "^29.7.0",
|
|
95
95
|
"namor": "^1.1.2",
|
|
96
96
|
"npm-run-all2": "^8.0.0",
|
|
@@ -110,10 +110,10 @@
|
|
|
110
110
|
"@babel/runtime": "^7.26.10",
|
|
111
111
|
"@carbon-labs/react-resizer": "^0.10.0",
|
|
112
112
|
"@carbon/feature-flags": "^0.32.0",
|
|
113
|
-
"@carbon/ibm-products-styles": "^2.
|
|
113
|
+
"@carbon/ibm-products-styles": "^2.76.0-rc.0",
|
|
114
114
|
"@carbon/telemetry": "^0.1.0",
|
|
115
|
-
"@carbon/utilities": "^0.
|
|
116
|
-
"@carbon/utilities-react": "0.
|
|
115
|
+
"@carbon/utilities": "^0.12.0",
|
|
116
|
+
"@carbon/utilities-react": "0.15.0",
|
|
117
117
|
"@dnd-kit/core": "^6.3.1",
|
|
118
118
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
119
119
|
"@dnd-kit/sortable": "^10.0.0",
|
|
@@ -123,14 +123,14 @@
|
|
|
123
123
|
"react-window": "^1.8.11"
|
|
124
124
|
},
|
|
125
125
|
"peerDependencies": {
|
|
126
|
-
"@carbon/grid": "^11.
|
|
127
|
-
"@carbon/layout": "^11.
|
|
128
|
-
"@carbon/motion": "^11.
|
|
129
|
-
"@carbon/react": "^1.
|
|
130
|
-
"@carbon/themes": "^11.
|
|
131
|
-
"@carbon/type": "^11.
|
|
126
|
+
"@carbon/grid": "^11.45.0",
|
|
127
|
+
"@carbon/layout": "^11.43.0",
|
|
128
|
+
"@carbon/motion": "^11.37.0",
|
|
129
|
+
"@carbon/react": "^1.95.0",
|
|
130
|
+
"@carbon/themes": "^11.62.0",
|
|
131
|
+
"@carbon/type": "^11.49.0",
|
|
132
132
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0 || ^19.0.0",
|
|
133
133
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0 || ^19.0.0"
|
|
134
134
|
},
|
|
135
|
-
"gitHead": "
|
|
135
|
+
"gitHead": "18c246c4b4f3cae35f0056cb73f68b68fb0b534d"
|
|
136
136
|
}
|
|
@@ -51,6 +51,17 @@ $motion-duration: $duration-moderate-02;
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
&:not(.is-visible) {
|
|
55
|
+
&.#{$block-class}.#{$block-class} .#{$block-class}__container {
|
|
56
|
+
// we want the enter/leave animation to run up most of the height of the
|
|
57
|
+
// viewport, capped at 500px to set an upper limit on the movement speed
|
|
58
|
+
// For the reason for calc() see https://github.com/sass/sass/issues/2849
|
|
59
|
+
// and https://github.com/sass/node-sass/issues/2815.
|
|
60
|
+
// stylelint-disable-next-line carbon/layout-use
|
|
61
|
+
transform: translate3d(0, calc(min(95vh, 500px)), 0);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
54
65
|
&.#{$block-class}.#{$block-class} {
|
|
55
66
|
/* tearsheet uses --overlay-color and --overlay-opacity in ::before */
|
|
56
67
|
background: initial;
|
|
@@ -106,12 +117,6 @@ $motion-duration: $duration-moderate-02;
|
|
|
106
117
|
block-size: 100%;
|
|
107
118
|
inset-block-start: auto;
|
|
108
119
|
max-block-size: calc(100% - #{$spacing-09});
|
|
109
|
-
// we want the enter/leave animation to run up most of the height of the
|
|
110
|
-
// viewport, capped at 500px to set an upper limit on the movement speed
|
|
111
|
-
// For the reason for calc() see https://github.com/sass/sass/issues/2849
|
|
112
|
-
// and https://github.com/sass/node-sass/issues/2815.
|
|
113
|
-
// stylelint-disable-next-line carbon/layout-use
|
|
114
|
-
transform: translate3d(0, calc(min(95vh, 500px)), 0);
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
&.#{$block-class}.#{$block-class}.#{$block-class}.#{$block-class}--has-slug
|