@carbon/ibm-products 2.36.0 → 2.38.0-alpha.5
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +5404 -5117
- 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 +4 -4
- 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 +820 -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 +329 -6
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +9 -10
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +3 -1
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +8 -2
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +21 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +261 -0
- package/es/components/ConditionBuilder/ConditionBuilder.js +45 -16
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +12 -0
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +40 -0
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +22 -0
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +74 -0
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +18 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +90 -42
- package/es/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.d.ts → ConditionBuilderProvider.d.ts} +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.js → ConditionBuilderProvider.js} +27 -8
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +22 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +112 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +31 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +40 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +28 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +151 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +11 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +59 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.d.ts +13 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +52 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.d.ts +13 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js +162 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +11 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +40 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +11 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +82 -0
- package/es/components/ConditionBuilder/ConditionConnector/ConditionConnector.d.ts +15 -0
- package/es/components/ConditionBuilder/ConditionConnector/ConditionConnector.js +85 -0
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +24 -0
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +145 -0
- package/es/components/ConditionBuilder/utils/util.d.ts +4 -0
- package/es/components/ConditionBuilder/utils/util.js +16 -0
- package/es/components/CreateTearsheet/CreateTearsheet.d.ts +106 -4
- package/es/components/CreateTearsheet/CreateTearsheet.js +12 -32
- package/es/components/Datagrid/Datagrid/DatagridContent.d.ts +1 -0
- package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -0
- package/es/components/Datagrid/useParentDimensions.js +1 -1
- package/es/components/Datagrid/useSkeletonRows.d.ts +1 -1
- package/es/components/Datagrid/useSkeletonRows.js +11 -3
- package/es/components/EditUpdateCards/EditUpdateCards.d.ts +104 -2
- package/es/components/EditUpdateCards/EditUpdateCards.js +3 -0
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -3
- package/es/components/ExpressiveCard/ExpressiveCard.d.ts +97 -2
- package/es/components/ExpressiveCard/ExpressiveCard.js +4 -0
- package/es/components/InlineTip/InlineTipButton.d.ts +21 -2
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +100 -2
- package/es/components/InterstitialScreen/InterstitialScreen.js +25 -14
- package/es/components/Nav/NavItem.js +1 -1
- package/es/components/NotificationsPanel/NotificationsPanel.js +5 -6
- package/es/components/PageHeader/PageHeader.js +12 -3
- package/es/components/SidePanel/SidePanel.js +1 -1
- package/es/components/SimpleHeader/SimpleHeader.d.ts +1 -5
- package/es/components/SimpleHeader/SimpleHeader.js +2 -4
- package/es/components/Tearsheet/TearsheetNarrow.d.ts +4 -13
- package/es/components/Tearsheet/TearsheetShell.d.ts +119 -10
- package/es/components/Tearsheet/TearsheetShell.js +18 -8
- package/es/components/WebTerminal/WebTerminal.d.ts +46 -2
- package/es/components/WebTerminal/WebTerminal.js +2 -2
- package/es/global/js/hooks/usePrefersReducedMotion.d.ts +2 -0
- package/es/global/js/hooks/usePrefersReducedMotion.js +28 -0
- package/es/global/js/utils/Wrap.d.ts +31 -2
- package/es/global/js/utils/Wrap.js +7 -9
- package/es/global/js/utils/getNodeTextContent.d.ts +1 -1
- package/es/global/js/utils/getNodeTextContent.js +1 -1
- package/es/global/js/utils/window.d.ts +2 -0
- package/es/global/js/utils/window.js +12 -0
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-9.js +2780 -0
- package/lib/_virtual/_rollupPluginBabelHelpers.js +9 -10
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +3 -1
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +8 -2
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +21 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +270 -0
- package/lib/components/ConditionBuilder/ConditionBuilder.js +46 -17
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +12 -0
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +48 -0
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +22 -0
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +83 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +18 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +90 -42
- package/lib/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.d.ts → ConditionBuilderProvider.d.ts} +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.js → ConditionBuilderProvider.js} +27 -8
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +22 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +121 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +31 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +44 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +28 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +159 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +11 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +67 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.d.ts +13 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +60 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.d.ts +13 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js +170 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +11 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +48 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +11 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +90 -0
- package/lib/components/ConditionBuilder/ConditionConnector/ConditionConnector.d.ts +15 -0
- package/lib/components/ConditionBuilder/ConditionConnector/ConditionConnector.js +93 -0
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +24 -0
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +153 -0
- package/lib/components/ConditionBuilder/utils/util.d.ts +4 -0
- package/lib/components/ConditionBuilder/utils/util.js +20 -0
- package/lib/components/CreateTearsheet/CreateTearsheet.d.ts +106 -4
- package/lib/components/CreateTearsheet/CreateTearsheet.js +12 -32
- package/lib/components/Datagrid/Datagrid/DatagridContent.d.ts +1 -0
- package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -0
- package/lib/components/Datagrid/useParentDimensions.js +1 -1
- package/lib/components/Datagrid/useSkeletonRows.d.ts +1 -1
- package/lib/components/Datagrid/useSkeletonRows.js +11 -3
- package/lib/components/EditUpdateCards/EditUpdateCards.d.ts +104 -2
- package/lib/components/EditUpdateCards/EditUpdateCards.js +3 -0
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -3
- package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +97 -2
- package/lib/components/ExpressiveCard/ExpressiveCard.js +4 -0
- package/lib/components/InlineTip/InlineTipButton.d.ts +21 -2
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +100 -2
- package/lib/components/InterstitialScreen/InterstitialScreen.js +24 -13
- package/lib/components/Nav/NavItem.js +2 -2
- package/lib/components/NotificationsPanel/NotificationsPanel.js +5 -6
- package/lib/components/PageHeader/PageHeader.js +11 -2
- package/lib/components/SidePanel/SidePanel.js +1 -1
- package/lib/components/SimpleHeader/SimpleHeader.d.ts +1 -5
- package/lib/components/SimpleHeader/SimpleHeader.js +2 -4
- package/lib/components/Tearsheet/TearsheetNarrow.d.ts +4 -13
- package/lib/components/Tearsheet/TearsheetShell.d.ts +119 -10
- package/lib/components/Tearsheet/TearsheetShell.js +16 -6
- package/lib/components/WebTerminal/WebTerminal.d.ts +46 -2
- package/lib/components/WebTerminal/WebTerminal.js +2 -2
- package/lib/global/js/hooks/usePrefersReducedMotion.d.ts +2 -0
- package/lib/global/js/hooks/usePrefersReducedMotion.js +32 -0
- package/lib/global/js/utils/Wrap.d.ts +31 -2
- package/lib/global/js/utils/Wrap.js +7 -9
- package/lib/global/js/utils/getNodeTextContent.d.ts +1 -1
- package/lib/global/js/utils/getNodeTextContent.js +1 -1
- package/lib/global/js/utils/window.d.ts +2 -0
- package/lib/global/js/utils/window.js +16 -0
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-9.js +2912 -0
- package/package.json +6 -4
- package/scss/components/CoachmarkOverlayElements/_coachmark-overlay-elements.scss +1 -1
- package/scss/components/ConditionBuilder/_condition-builder.scss +26 -0
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +46 -0
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +194 -0
- package/scss/components/ConditionBuilder/styles/_index.scss +2 -0
- package/scss/components/Guidebanner/_guidebanner.scss +3 -0
- package/scss/components/InterstitialScreen/_interstitial-screen.scss +1 -6
- package/scss/components/Tearsheet/_tearsheet.scss +3 -1
- package/telemetry.yml +939 -683
- package/es/components/ConditionBuilder/assets/sampleInput.d.ts +0 -58
- package/es/global/js/utils/keyboardNavigation.d.ts +0 -27
- package/es/global/js/utils/keyboardNavigation.js +0 -33
- package/es/global/js/utils/wrapFocus.d.ts +0 -25
- package/es/global/js/utils/wrapFocus.js +0 -68
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3004
- package/lib/components/ConditionBuilder/assets/sampleInput.d.ts +0 -58
- package/lib/global/js/utils/keyboardNavigation.d.ts +0 -27
- package/lib/global/js/utils/keyboardNavigation.js +0 -39
- package/lib/global/js/utils/wrapFocus.d.ts +0 -25
- package/lib/global/js/utils/wrapFocus.js +0 -73
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3136
@@ -34,13 +34,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
34
34
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
35
35
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
36
36
|
|
37
|
-
var _excluded = ["actionBarItems", "actionBarMenuOptionsClass", "actionBarOverflowAriaLabel", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "allTagsModalTitle", "hasBackgroundAlways", "breadcrumbOverflowAriaLabel", "breadcrumbs", "children", "className", "collapseHeader", "collapseHeaderIconDescription", "collapseTitle", "disableBreadcrumbScroll", "enableBreadcrumbScroll", "expandHeaderIconDescription", "fullWidthGrid", "hasCollapseHeaderToggle", "narrowGrid", "navigation", "pageActions", "pageActionsOverflowLabel", "pageActionsMenuOptionsClass", "showAllTagsLabel", "subtitle", "tags", "title", "withoutBackground"];
|
37
|
+
var _excluded = ["actionBarItems", "actionBarMenuOptionsClass", "actionBarOverflowAriaLabel", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "allTagsModalTitle", "hasBackgroundAlways", "breadcrumbOverflowAriaLabel", "breadcrumbs", "children", "className", "collapseHeader", "collapseHeaderIconDescription", "collapseTitle", "disableBreadcrumbScroll", "enableBreadcrumbScroll", "expandHeaderIconDescription", "fullWidthGrid", "hasCollapseHeaderToggle", "narrowGrid", "navigation", "pageActions", "pageActionsOverflowLabel", "pageActionsMenuOptionsClass", "showAllTagsLabel", "subtitle", "tags", "title", "withoutBackground", "breadcrumbOverflowTooltipAlign"];
|
38
38
|
var componentName = 'PageHeader';
|
39
39
|
|
40
40
|
// Default values for props
|
41
41
|
var defaults = {
|
42
42
|
fullWidthGrid: false,
|
43
|
-
narrowGrid: false
|
43
|
+
narrowGrid: false,
|
44
|
+
breadcrumbOverflowTooltipAlign: 'right'
|
44
45
|
};
|
45
46
|
exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
|
46
47
|
var _withoutBackground, _enableBreadcrumbScro;
|
@@ -75,6 +76,8 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
75
76
|
tags = _ref.tags,
|
76
77
|
title = _ref.title,
|
77
78
|
withoutBackground = _ref.withoutBackground,
|
79
|
+
_ref$breadcrumbOverfl = _ref.breadcrumbOverflowTooltipAlign,
|
80
|
+
breadcrumbOverflowTooltipAlign = _ref$breadcrumbOverfl === void 0 ? defaults.breadcrumbOverflowTooltipAlign : _ref$breadcrumbOverfl,
|
78
81
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
79
82
|
// handle deprecated props - START
|
80
83
|
// if withoutBackground is nullish check deprecated_hasBackgroundAlways and default false
|
@@ -346,6 +349,8 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
346
349
|
noTrailingSlash: !!title,
|
347
350
|
overflowAriaLabel: breadcrumbOverflowAriaLabel,
|
348
351
|
breadcrumbs: breadcrumbs && breadcrumbItemForTitle ? breadcrumbs.concat(breadcrumbItemForTitle) : breadcrumbItemForTitle ? [breadcrumbItemForTitle] : breadcrumbs // breadcrumbs may be null or undefined
|
352
|
+
,
|
353
|
+
overflowTooltipAlign: breadcrumbOverflowTooltipAlign
|
349
354
|
}) : null), /*#__PURE__*/React__default["default"].createElement(react.Column, {
|
350
355
|
className: cx__default["default"](["".concat(PageHeaderUtils.blockClass, "__action-bar-column ").concat(PageHeaderUtils.blockClass, "__action-bar-column--background"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(PageHeaderUtils.blockClass, "__action-bar-column--has-page-actions"), pageActions), "".concat(PageHeaderUtils.blockClass, "__action-bar-column--influenced-by-collapse-button"), spaceForCollapseButton)])
|
351
356
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -537,6 +542,10 @@ exports.PageHeader.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
537
542
|
var breadcrumbs = _ref11.breadcrumbs;
|
538
543
|
return breadcrumbs && breadcrumbs.length > 0;
|
539
544
|
}),
|
545
|
+
/**
|
546
|
+
* align breadcrumb overflow tooltip
|
547
|
+
*/
|
548
|
+
breadcrumbOverflowTooltipAlign: react.Tooltip.propTypes.align,
|
540
549
|
/**
|
541
550
|
* Specifies the breadcrumb components to be shown in the breadcrumb area of
|
542
551
|
* the page header. Each item is specified as an object with optional fields
|
@@ -160,7 +160,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
|
|
160
160
|
titleItemsStyles(animationProgress);
|
161
161
|
}
|
162
162
|
}, [doAnimateTitle, panelRefValue === null || panelRefValue === void 0 ? void 0 : panelRefValue.style, scrollAnimationDistance, titleItemsStyles]);
|
163
|
-
var reducedMotion = typeof
|
163
|
+
var reducedMotion = typeof document !== 'undefined' && (_window = window) !== null && _window !== void 0 && _window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : {
|
164
164
|
matches: true
|
165
165
|
};
|
166
166
|
|
@@ -16,7 +16,7 @@ export function SimpleHeader({ breadcrumbs, className, title, noTrailingSlash, m
|
|
16
16
|
breadcrumbs: any;
|
17
17
|
className: any;
|
18
18
|
title: any;
|
19
|
-
noTrailingSlash
|
19
|
+
noTrailingSlash?: boolean | undefined;
|
20
20
|
maxVisible: any;
|
21
21
|
overflowAriaLabel: any;
|
22
22
|
}): import("react/jsx-runtime").JSX.Element;
|
@@ -40,9 +40,5 @@ export namespace SimpleHeader {
|
|
40
40
|
export { overflowAriaLabel_required_if_breadcrumbs_exist as overflowAriaLabel };
|
41
41
|
export let title: PropTypes.Requireable<string>;
|
42
42
|
}
|
43
|
-
namespace defaultProps {
|
44
|
-
let noTrailingSlash_1: boolean;
|
45
|
-
export { noTrailingSlash_1 as noTrailingSlash };
|
46
|
-
}
|
47
43
|
}
|
48
44
|
import PropTypes from 'prop-types';
|
@@ -42,7 +42,8 @@ var SimpleHeader = function SimpleHeader(_ref) {
|
|
42
42
|
var breadcrumbs = _ref.breadcrumbs,
|
43
43
|
className = _ref.className,
|
44
44
|
title = _ref.title,
|
45
|
-
noTrailingSlash = _ref.noTrailingSlash,
|
45
|
+
_ref$noTrailingSlash = _ref.noTrailingSlash,
|
46
|
+
noTrailingSlash = _ref$noTrailingSlash === void 0 ? true : _ref$noTrailingSlash,
|
46
47
|
maxVisible = _ref.maxVisible,
|
47
48
|
overflowAriaLabel = _ref.overflowAriaLabel,
|
48
49
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
@@ -95,9 +96,6 @@ SimpleHeader.propTypes = {
|
|
95
96
|
/** Header title */
|
96
97
|
title: index["default"].string
|
97
98
|
};
|
98
|
-
SimpleHeader.defaultProps = {
|
99
|
-
noTrailingSlash: true
|
100
|
-
};
|
101
99
|
|
102
100
|
exports.SimpleHeader = SimpleHeader;
|
103
101
|
exports.overflowAriaLabel_required_if_breadcrumbs_exist = overflowAriaLabel_required_if_breadcrumbs_exist;
|
@@ -8,11 +8,8 @@
|
|
8
8
|
import React, { ReactNode, PropsWithChildren } from 'react';
|
9
9
|
import PropTypes from 'prop-types';
|
10
10
|
import { ButtonProps } from '@carbon/react';
|
11
|
-
|
12
|
-
|
13
|
-
closeIconDescription: string;
|
14
|
-
};
|
15
|
-
interface TearsheetNarrowProps extends PropsWithChildren {
|
11
|
+
import { CloseIconDescriptionTypes } from './TearsheetShell';
|
12
|
+
interface TearsheetNarrowBaseProps extends PropsWithChildren {
|
16
13
|
/**
|
17
14
|
* The navigation actions to be shown as buttons in the action area at the
|
18
15
|
* bottom of the tearsheet. Each action is specified as an object with
|
@@ -36,13 +33,6 @@ interface TearsheetNarrowProps extends PropsWithChildren {
|
|
36
33
|
* An optional class or classes to be added to the outermost element.
|
37
34
|
*/
|
38
35
|
className?: string;
|
39
|
-
/**
|
40
|
-
* The accessibility title for the close icon (if shown).
|
41
|
-
*
|
42
|
-
* **Note:** This prop is only required if a close icon is shown, i.e. if
|
43
|
-
* there are a no navigation actions and/or hasCloseIcon is true.
|
44
|
-
*/
|
45
|
-
closeIconDescription?: closeIconDescriptionTypes;
|
46
36
|
/**
|
47
37
|
* A description of the flow, displayed in the header area of the tearsheet.
|
48
38
|
*/
|
@@ -89,6 +79,7 @@ interface TearsheetNarrowProps extends PropsWithChildren {
|
|
89
79
|
*/
|
90
80
|
verticalPosition?: 'normal' | 'lower';
|
91
81
|
}
|
82
|
+
type TearsheetNarrowProps = TearsheetNarrowBaseProps & CloseIconDescriptionTypes;
|
92
83
|
/**
|
93
84
|
* A narrow tearsheet is a slimmer variant of the tearsheet, providing a dialog
|
94
85
|
* that keeps users in-context and focused by bringing actionable content front
|
@@ -97,7 +88,7 @@ interface TearsheetNarrowProps extends PropsWithChildren {
|
|
97
88
|
* A narrow tearsheet comprises 3 zones: a heading area including a title, the
|
98
89
|
* main content area, and a set of action buttons.
|
99
90
|
*/
|
100
|
-
export declare let TearsheetNarrow: React.ForwardRefExoticComponent<TearsheetNarrowProps & React.RefAttributes<
|
91
|
+
export declare let TearsheetNarrow: React.ForwardRefExoticComponent<TearsheetNarrowProps & React.RefAttributes<HTMLDivElement>>;
|
101
92
|
export declare const deprecatedProps: {
|
102
93
|
/**
|
103
94
|
* **Deprecated**
|
@@ -1,6 +1,107 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 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
|
+
/// <reference path="../../../src/custom-typings/index.d.ts" />
|
8
|
+
import React, { PropsWithChildren, ReactNode } from 'react';
|
9
|
+
import PropTypes from 'prop-types';
|
10
|
+
import { type ButtonProps } from '@carbon/react';
|
11
|
+
interface TearsheetShellProps extends PropsWithChildren {
|
12
|
+
actions?: ButtonProps[];
|
13
|
+
ariaLabel?: string;
|
14
|
+
/**
|
15
|
+
* An optional class or classes to be added to the outermost element.
|
16
|
+
*/
|
17
|
+
className?: string;
|
18
|
+
/**
|
19
|
+
* A description of the flow, displayed in the header area of the tearsheet.
|
20
|
+
*/
|
21
|
+
description?: ReactNode;
|
22
|
+
/**
|
23
|
+
* Enable a close icon ('x') in the header area of the tearsheet. By default,
|
24
|
+
* (when this prop is omitted, or undefined or null) a tearsheet does not
|
25
|
+
* display a close icon if there are navigation actions ("transactional
|
26
|
+
* tearsheet") and displays one if there are no navigation actions ("passive
|
27
|
+
* tearsheet"), and that behavior can be overridden if required by setting
|
28
|
+
* this prop to either true or false.
|
29
|
+
*/
|
30
|
+
hasCloseIcon?: boolean;
|
31
|
+
/**
|
32
|
+
* The content for the header actions area, displayed alongside the title in
|
33
|
+
* the header area of the tearsheet. This is typically a drop-down, or a set
|
34
|
+
* of small buttons, or similar. NB the headerActions is only applicable for
|
35
|
+
* wide tearsheets.
|
36
|
+
*/
|
37
|
+
headerActions?: ReactNode;
|
38
|
+
/**
|
39
|
+
* The content for the influencer section of the tearsheet, displayed
|
40
|
+
* alongside the main content. This is typically a menu, or filter, or
|
41
|
+
* progress indicator, or similar. NB the influencer is only applicable for
|
42
|
+
* wide tearsheets.
|
43
|
+
*/
|
44
|
+
influencer?: ReactNode;
|
45
|
+
/**
|
46
|
+
* The position of the influencer section, 'left' or 'right'.
|
47
|
+
*/
|
48
|
+
influencerPosition?: 'left' | 'right';
|
49
|
+
/**
|
50
|
+
* The width of the influencer: 'narrow' (the default) is 256px, and 'wide'
|
51
|
+
* is 320px.
|
52
|
+
*/
|
53
|
+
influencerWidth?: 'narrow' | 'wide';
|
54
|
+
/**
|
55
|
+
* A label for the tearsheet, displayed in the header area of the tearsheet
|
56
|
+
* to maintain context for the tearsheet (e.g. as the title changes from page
|
57
|
+
* to page of a multi-page task).
|
58
|
+
*/
|
59
|
+
label?: ReactNode;
|
60
|
+
/**
|
61
|
+
* Navigation content, such as a set of tabs, to be displayed at the bottom
|
62
|
+
* of the header area of the tearsheet. NB the navigation is only applicable
|
63
|
+
* for wide tearsheets.
|
64
|
+
*/
|
65
|
+
navigation?: ReactNode;
|
66
|
+
/**
|
67
|
+
* An optional handler that is called when the user closes the tearsheet (by
|
68
|
+
* clicking the close button, if enabled, or clicking outside, if enabled).
|
69
|
+
* Returning `false` here prevents the modal from closing.
|
70
|
+
*/
|
71
|
+
onClose?: () => void;
|
72
|
+
/**
|
73
|
+
* Specifies whether the tearsheet is currently open.
|
74
|
+
*/
|
75
|
+
open?: boolean;
|
76
|
+
/**
|
77
|
+
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
|
78
|
+
*/
|
79
|
+
portalTarget?: ReactNode;
|
80
|
+
selectorPrimaryFocus?: string;
|
81
|
+
/**
|
82
|
+
* Specifies the width of the tearsheet, 'narrow' or 'wide'.
|
83
|
+
*/
|
84
|
+
size: 'narrow' | 'wide';
|
85
|
+
/**
|
86
|
+
* **Experimental:** Provide a `Slug` component to be rendered inside the `Tearsheet` component
|
87
|
+
*/
|
88
|
+
slug?: ReactNode;
|
89
|
+
/**
|
90
|
+
* The main title of the tearsheet, displayed in the header area.
|
91
|
+
*/
|
92
|
+
title?: ReactNode;
|
93
|
+
verticalPosition?: 'normal' | 'lower';
|
94
|
+
}
|
95
|
+
export type CloseIconDescriptionTypes = {
|
96
|
+
hasCloseIcon?: false;
|
97
|
+
closeIconDescription?: string;
|
98
|
+
} | {
|
99
|
+
hasCloseIcon: true;
|
100
|
+
closeIconDescription: string;
|
101
|
+
};
|
102
|
+
export declare const tearsheetShellWideProps: string[];
|
103
|
+
export declare const tearsheetIsPassive: (actions: any) => boolean;
|
104
|
+
export declare const tearsheetHasCloseIcon: (actions: any, hasCloseIcon: any) => any;
|
4
105
|
/**
|
5
106
|
* TearSheetShell is used internally by TearSheet and TearSheetNarrow
|
6
107
|
*
|
@@ -8,10 +109,18 @@ export function tearsheetHasCloseIcon(actions: any, hasCloseIcon: any): any;
|
|
8
109
|
*
|
9
110
|
* See the canvas tab for the component API details.
|
10
111
|
* */
|
11
|
-
export const TearsheetShell: React.ForwardRefExoticComponent<React.RefAttributes<
|
12
|
-
export const portalType: PropTypes.Requireable<object>;
|
13
|
-
export
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
112
|
+
export declare const TearsheetShell: React.ForwardRefExoticComponent<(TearsheetShellProps & CloseIconDescriptionTypes) & React.RefAttributes<HTMLDivElement>>;
|
113
|
+
export declare const portalType: PropTypes.Requireable<object>;
|
114
|
+
export declare const deprecatedProps: {
|
115
|
+
/**
|
116
|
+
* **Deprecated**
|
117
|
+
*
|
118
|
+
* The position of the top of tearsheet in the viewport. The 'normal'
|
119
|
+
* position is a short distance down from the top of the
|
120
|
+
* viewport, leaving room at the top for a global header bar to show through
|
121
|
+
* from below. The 'lower' position (the default) provides a little extra room at the top
|
122
|
+
* to allow an action bar navigation or breadcrumbs to also show through.
|
123
|
+
*/
|
124
|
+
verticalPosition: PropTypes.Requireable<string>;
|
125
|
+
};
|
126
|
+
export {};
|
@@ -46,6 +46,7 @@ var maxDepth = 3;
|
|
46
46
|
// The 'sizes' array contains an array of the sizes for every stacked tearsheet.
|
47
47
|
// This is so we can opt-out of including the stacking scale effect when there
|
48
48
|
// are stacked tearsheets with mixed sizes (ie, using wide and narrow together)
|
49
|
+
|
49
50
|
var stack = {
|
50
51
|
open: [],
|
51
52
|
all: [],
|
@@ -103,6 +104,7 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
103
104
|
var _useFocus = useFocus.useFocus(modalRef),
|
104
105
|
firstElement = _useFocus.firstElement,
|
105
106
|
keyDownListener = _useFocus.keyDownListener;
|
107
|
+
var modalRefValue = modalRef.current;
|
106
108
|
var wide = size === 'wide';
|
107
109
|
|
108
110
|
// Keep track of the stack depth and our position in it (1-based, 0=closed)
|
@@ -133,7 +135,7 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
133
135
|
}
|
134
136
|
handleStackChange.checkFocus = function () {
|
135
137
|
// if we are now the topmost tearsheet, ensure we have focus
|
136
|
-
if (open && position === depth &&
|
138
|
+
if (open && position === depth && modalRefValue && !modalRefValue.contains(document.activeElement)) {
|
137
139
|
handleStackChange.claimFocus();
|
138
140
|
}
|
139
141
|
};
|
@@ -161,8 +163,9 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
161
163
|
React.useEffect(function () {
|
162
164
|
var notify = function notify() {
|
163
165
|
return stack.all.forEach(function (handler) {
|
166
|
+
var _handler$checkFocus;
|
164
167
|
handler(Math.min(stack.open.length, maxDepth), stack.open.indexOf(handler) + 1);
|
165
|
-
handler.checkFocus();
|
168
|
+
(_handler$checkFocus = handler.checkFocus) === null || _handler$checkFocus === void 0 || _handler$checkFocus.call(handler);
|
166
169
|
});
|
167
170
|
};
|
168
171
|
|
@@ -201,10 +204,12 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
201
204
|
// If something within us is receiving focus but we are not the topmost
|
202
205
|
// stacked tearsheet, transfer focus to the topmost tearsheet instead
|
203
206
|
if (position < depth) {
|
204
|
-
|
207
|
+
var _stack$open$claimFocu, _stack$open;
|
208
|
+
(_stack$open$claimFocu = (_stack$open = stack.open[stack.open.length - 1]).claimFocus) === null || _stack$open$claimFocu === void 0 || _stack$open$claimFocu.call(_stack$open);
|
205
209
|
}
|
206
210
|
}
|
207
211
|
if (position <= depth) {
|
212
|
+
var _prevDepth$current;
|
208
213
|
// Include a modal header if and only if one or more of these is given.
|
209
214
|
// We can't use a Wrap for the ModalHeader because ComposedModal requires
|
210
215
|
// the direct child to be the ModalHeader instance.
|
@@ -225,7 +230,7 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
225
230
|
"aria-label": ariaLabel || getNodeTextContent.getNodeTextContent(title),
|
226
231
|
className: cx__default["default"](bc, className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(bc, "--stacked-").concat(position, "-of-").concat(depth),
|
227
232
|
// Don't apply this on the initial open of a single tearsheet.
|
228
|
-
depth > 1 || depth === 1 && prevDepth.current > 1), "".concat(bc, "--wide"), wide), "".concat(bc, "--narrow"), !wide), "".concat(bc, "--has-slug"), slug), "".concat(bc, "--has-close"), effectiveHasCloseIcon)),
|
233
|
+
depth > 1 || depth === 1 && ((_prevDepth$current = prevDepth === null || prevDepth === void 0 ? void 0 : prevDepth.current) !== null && _prevDepth$current !== void 0 ? _prevDepth$current : 0) > 1), "".concat(bc, "--wide"), wide), "".concat(bc, "--narrow"), !wide), "".concat(bc, "--has-slug"), slug), "".concat(bc, "--has-close"), effectiveHasCloseIcon)),
|
229
234
|
slug: slug,
|
230
235
|
style: setScaleValues(),
|
231
236
|
containerClassName: cx__default["default"]("".concat(bc, "__container"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(bc, "__container--lower"), verticalPosition === 'lower'), "".concat(bc, "__container--mixed-size-stacking"), !areAllSameSizeVariant())),
|
@@ -273,7 +278,7 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
273
278
|
alwaysRender: includeActions
|
274
279
|
}, /*#__PURE__*/React__default["default"].createElement(Wrap.Wrap, {
|
275
280
|
className: "".concat(bc, "__content"),
|
276
|
-
alwaysRender: influencer && influencerPosition === 'right'
|
281
|
+
alwaysRender: !!(influencer && influencerPosition === 'right')
|
277
282
|
}, children), /*#__PURE__*/React__default["default"].createElement(Wrap.Wrap, {
|
278
283
|
className: cx__default["default"](_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(bc, "__influencer"), true), "".concat(bc, "__influencer--wide"), influencerWidth === 'wide')),
|
279
284
|
neverRender: influencerPosition !== 'right'
|
@@ -281,7 +286,7 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
281
286
|
className: "".concat(bc, "__button-container")
|
282
287
|
}, /*#__PURE__*/React__default["default"].createElement(ActionSet.ActionSet, {
|
283
288
|
actions: actions,
|
284
|
-
buttonSize: wide ? '2xl' :
|
289
|
+
buttonSize: wide ? '2xl' : undefined,
|
285
290
|
className: "".concat(bc, "__buttons"),
|
286
291
|
size: wide ? '2xl' : 'lg',
|
287
292
|
"aria-hidden": !open
|
@@ -332,6 +337,7 @@ TearsheetShell.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
332
337
|
*
|
333
338
|
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
|
334
339
|
*/
|
340
|
+
/**@ts-ignore*/
|
335
341
|
actions: index["default"].arrayOf(
|
336
342
|
// NB we don't include the validator here, as the component wrapping this
|
337
343
|
// one should ensure appropriate validation is done.
|
@@ -356,6 +362,7 @@ TearsheetShell.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
356
362
|
* **Note:** This prop is only required if a close icon is shown, i.e. if
|
357
363
|
* there are a no navigation actions and/or hasCloseIcon is true.
|
358
364
|
*/
|
365
|
+
/**@ts-ignore*/
|
359
366
|
closeIconDescription: index["default"].string.isRequired.if(function (_ref4) {
|
360
367
|
var actions = _ref4.actions,
|
361
368
|
hasCloseIcon = _ref4.hasCloseIcon;
|
@@ -373,6 +380,7 @@ TearsheetShell.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
373
380
|
* tearsheet"), and that behavior can be overridden if required by setting
|
374
381
|
* this prop to either true or false.
|
375
382
|
*/
|
383
|
+
/**@ts-ignore*/
|
376
384
|
hasCloseIcon: index["default"].bool,
|
377
385
|
/**
|
378
386
|
* The content for the header actions area, displayed alongside the title in
|
@@ -422,10 +430,12 @@ TearsheetShell.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
|
422
430
|
/**
|
423
431
|
* The DOM element that the tearsheet should be rendered within. Defaults to document.body.
|
424
432
|
*/
|
433
|
+
/**@ts-ignore*/
|
425
434
|
portalTarget: portalType,
|
426
435
|
/**
|
427
436
|
* Specifies the width of the tearsheet, 'narrow' or 'wide'.
|
428
437
|
*/
|
438
|
+
/**@ts-ignore*/
|
429
439
|
size: index["default"].oneOf(['narrow', 'wide']).isRequired,
|
430
440
|
/**
|
431
441
|
* **Experimental:** Provide a `Slug` component to be rendered inside the `Tearsheet` component
|
@@ -1,5 +1,49 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 2022
|
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
|
+
/// <reference path="../../../src/custom-typings/index.d.ts" />
|
8
|
+
import React, { PropsWithChildren, ReactNode } from 'react';
|
9
|
+
import { OverflowMenuItem } from '@carbon/react';
|
10
|
+
interface Action {
|
11
|
+
renderIcon: () => void;
|
12
|
+
onClick: () => void;
|
13
|
+
iconDescription: string;
|
14
|
+
}
|
15
|
+
interface WebTerminalProps extends PropsWithChildren {
|
16
|
+
/**
|
17
|
+
* Provide your own terminal component as children to show up in the web terminal
|
18
|
+
*/
|
19
|
+
children: ReactNode | ReactNode[];
|
20
|
+
/**
|
21
|
+
* An array of actions to be displayed in the web terminal header bar
|
22
|
+
*/
|
23
|
+
actions?: readonly Action[];
|
24
|
+
/**
|
25
|
+
* Custom classname for additional styling of the web terminal
|
26
|
+
*/
|
27
|
+
className?: string;
|
28
|
+
/**
|
29
|
+
* Icon description for the close button
|
30
|
+
*/
|
31
|
+
closeIconDescription: string;
|
32
|
+
/**
|
33
|
+
* Array of objects for each documentation link. Each documentation link uses the prop types of OverflowMenuItems. See more: https://react.carbondesignsystem.com/?path=/docs/components-overflowmenu--default
|
34
|
+
*/
|
35
|
+
documentationLinks?: readonly OverflowMenuItem[];
|
36
|
+
/**
|
37
|
+
* Description for the documentation link overflow menu tooltip
|
38
|
+
*/
|
39
|
+
documentationLinksIconDescription?: string;
|
40
|
+
/**
|
41
|
+
* Optionally pass if the web terminal should be open by default
|
42
|
+
*/
|
43
|
+
isInitiallyOpen?: boolean;
|
44
|
+
}
|
1
45
|
/**
|
2
46
|
* The `WebTerminal` is prompted by the user and is persistent until dismissed. The purpose of a web terminal is to provide users with the ability to type commands manually instead of using the GUI.
|
3
47
|
*/
|
4
|
-
export let WebTerminal: React.ForwardRefExoticComponent<React.RefAttributes<
|
5
|
-
|
48
|
+
export declare let WebTerminal: React.ForwardRefExoticComponent<WebTerminalProps & React.RefAttributes<HTMLDivElement>>;
|
49
|
+
export {};
|
@@ -38,7 +38,6 @@ var defaults = {
|
|
38
38
|
documentationLinksIconDescription: 'Show documentation links',
|
39
39
|
isInitiallyOpen: false
|
40
40
|
};
|
41
|
-
|
42
41
|
/**
|
43
42
|
* The `WebTerminal` is prompted by the user and is persistent until dismissed. The purpose of a web terminal is to provide users with the ability to type commands manually instead of using the GUI.
|
44
43
|
*/
|
@@ -108,7 +107,7 @@ exports.WebTerminal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
108
107
|
ref: ref,
|
109
108
|
className: cx__default["default"]([blockClass, className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--open"), open), "".concat(blockClass, "--closed"), !open)]),
|
110
109
|
style: {
|
111
|
-
animation: !prefersReducedMotion
|
110
|
+
animation: !prefersReducedMotion ? webTerminalAnimationName : ''
|
112
111
|
},
|
113
112
|
onAnimationEnd: onAnimationEnd
|
114
113
|
}), /*#__PURE__*/React__default["default"].createElement("header", {
|
@@ -177,6 +176,7 @@ exports.WebTerminal.propTypes = {
|
|
177
176
|
/**
|
178
177
|
* An array of actions to be displayed in the web terminal header bar
|
179
178
|
*/
|
179
|
+
/**@ts-ignore */
|
180
180
|
actions: index$1["default"].arrayOf(index$1["default"].shape({
|
181
181
|
renderIcon: index$1["default"].func.isRequired,
|
182
182
|
onClick: index$1["default"].func.isRequired,
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 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
|
+
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
11
|
+
|
12
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
|
+
var React = require('react');
|
14
|
+
var window$1 = require('../utils/window.js');
|
15
|
+
|
16
|
+
var usePrefersReducedMotion = function usePrefersReducedMotion() {
|
17
|
+
var _useState = React.useState(false),
|
18
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
19
|
+
prefersReducedMotion = _useState2[0],
|
20
|
+
setPrefersReducedMotion = _useState2[1];
|
21
|
+
React.useEffect(function () {
|
22
|
+
if (window$1.hasDocument()) {
|
23
|
+
var _window$matchMedia = window.matchMedia('(prefers-reduced-motion: reduce)'),
|
24
|
+
matches = _window$matchMedia.matches;
|
25
|
+
setPrefersReducedMotion(matches);
|
26
|
+
}
|
27
|
+
}, []);
|
28
|
+
return prefersReducedMotion;
|
29
|
+
};
|
30
|
+
var usePrefersReducedMotion$1 = usePrefersReducedMotion;
|
31
|
+
|
32
|
+
exports["default"] = usePrefersReducedMotion$1;
|
@@ -1,3 +1,32 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 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
|
+
import React, { ElementType, PropsWithChildren, ReactNode } from 'react';
|
8
|
+
interface WrapProps extends PropsWithChildren {
|
9
|
+
/**
|
10
|
+
* Specify whether the wrapper element should render even if there are no
|
11
|
+
* children or the children are themselves empty wrappers. Useful if there
|
12
|
+
* are some conditions in which the wrapper element is still required. Note
|
13
|
+
* that this prop takes precedence over neverRender if both are set to true.
|
14
|
+
*/
|
15
|
+
alwaysRender?: boolean | null;
|
16
|
+
/**
|
17
|
+
* The element name or component to use as a wrapper for the content.
|
18
|
+
*/
|
19
|
+
element?: (() => ReactNode) | string | ElementType;
|
20
|
+
/**
|
21
|
+
* Specify whether nothing should be rendered even if there are children
|
22
|
+
* in the content. Useful if there are some circumstances in which the
|
23
|
+
* component should not render at all. Note that if alwaysRender is also
|
24
|
+
* set to true then it will take precedence and the wrapper element and
|
25
|
+
* content will be rendered.
|
26
|
+
*/
|
27
|
+
neverRender?: boolean;
|
28
|
+
className?: string;
|
29
|
+
}
|
1
30
|
/**
|
2
31
|
* A simple conditional wrapper that encloses its children in a <div> (or other
|
3
32
|
* element if specified), passing any supplied attributes to the <div> (or other
|
@@ -8,5 +37,5 @@
|
|
8
37
|
* the ref.current will be set to the wrapper element if it renders, and will
|
9
38
|
* remain undefined if it does not render.
|
10
39
|
*/
|
11
|
-
export const Wrap: React.ForwardRefExoticComponent<React.RefAttributes<
|
12
|
-
|
40
|
+
export declare const Wrap: React.ForwardRefExoticComponent<WrapProps & React.RefAttributes<HTMLElement>>;
|
41
|
+
export {};
|
@@ -17,7 +17,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
17
17
|
|
18
18
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
19
19
|
|
20
|
-
var _excluded = ["alwaysRender", "children", "element", "neverRender"];
|
20
|
+
var _excluded = ["alwaysRender", "children", "element", "neverRender", "className"];
|
21
21
|
|
22
22
|
// Examine a flat array of children to decide whether it is effectively empty.
|
23
23
|
// If there are no children, or all the children are falsy, or all the non-falsy
|
@@ -32,12 +32,6 @@ var isEmpty = function isEmpty(children) {
|
|
32
32
|
});
|
33
33
|
return result;
|
34
34
|
};
|
35
|
-
|
36
|
-
// Default values for props
|
37
|
-
var defaults = {
|
38
|
-
element: 'div'
|
39
|
-
};
|
40
|
-
|
41
35
|
/**
|
42
36
|
* A simple conditional wrapper that encloses its children in a <div> (or other
|
43
37
|
* element if specified), passing any supplied attributes to the <div> (or other
|
@@ -52,10 +46,13 @@ var Wrap = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref
|
|
52
46
|
var alwaysRender = _ref.alwaysRender,
|
53
47
|
children = _ref.children,
|
54
48
|
_ref$element = _ref.element,
|
55
|
-
Wrapper = _ref$element === void 0 ?
|
49
|
+
Wrapper = _ref$element === void 0 ? 'div' : _ref$element,
|
56
50
|
neverRender = _ref.neverRender,
|
51
|
+
className = _ref.className,
|
57
52
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
58
|
-
return (neverRender || isEmpty(children)) && !alwaysRender ? null : /*#__PURE__*/React__default["default"].createElement(Wrapper, _rollupPluginBabelHelpers["extends"]({
|
53
|
+
return (neverRender || isEmpty(children)) && !alwaysRender ? null : /*#__PURE__*/React__default["default"].createElement(Wrapper, _rollupPluginBabelHelpers["extends"]({
|
54
|
+
className: className
|
55
|
+
}, rest, {
|
59
56
|
ref: ref
|
60
57
|
}), children);
|
61
58
|
});
|
@@ -74,6 +71,7 @@ Wrap.propTypes = {
|
|
74
71
|
* components that decide not to render, nothing will be rendered in the DOM.
|
75
72
|
*/
|
76
73
|
children: index["default"].node,
|
74
|
+
className: index["default"].string,
|
77
75
|
/**
|
78
76
|
* The element name or component to use as a wrapper for the content.
|
79
77
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
export function getNodeTextContent(node:
|
1
|
+
export function getNodeTextContent(node: ReactNode): string;
|
@@ -29,7 +29,7 @@ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHel
|
|
29
29
|
* <li>Item 3</li>
|
30
30
|
* </ul>
|
31
31
|
* --> "Item 1Item 2Item 3"
|
32
|
-
* @param {
|
32
|
+
* @param {ReactNode} node A React node
|
33
33
|
* @returns {string}
|
34
34
|
*/
|
35
35
|
var getNodeTextContent = function getNodeTextContent(node) {
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2020, 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
|
+
|
8
|
+
'use strict';
|
9
|
+
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
11
|
+
|
12
|
+
var hasDocument = function hasDocument() {
|
13
|
+
return typeof document !== 'undefined';
|
14
|
+
};
|
15
|
+
|
16
|
+
exports.hasDocument = hasDocument;
|