@carbon/ibm-products 2.36.0-alpha.27 → 2.37.0
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/Carousel/Carousel.d.ts +46 -2
- package/es/components/Carousel/Carousel.js +36 -21
- package/es/components/Carousel/CarouselItem.d.ts +19 -2
- package/es/components/Carousel/CarouselItem.js +0 -1
- 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/useParentDimensions.js +1 -1
- 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/UserProfileImage/UserProfileImage.d.ts +66 -2
- package/es/components/UserProfileImage/UserProfileImage.js +5 -3
- 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/Carousel/Carousel.d.ts +46 -2
- package/lib/components/Carousel/Carousel.js +35 -20
- package/lib/components/Carousel/CarouselItem.d.ts +19 -2
- package/lib/components/Carousel/CarouselItem.js +0 -1
- 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/useParentDimensions.js +1 -1
- 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/UserProfileImage/UserProfileImage.d.ts +66 -2
- package/lib/components/UserProfileImage/UserProfileImage.js +5 -3
- 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 +5 -5
- 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 +3 -0
- 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
@@ -1,5 +1,69 @@
|
|
1
1
|
/**
|
2
|
-
*
|
2
|
+
* Copyright IBM Corp. 2021, 2021
|
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.
|
3
6
|
*/
|
4
|
-
|
7
|
+
/// <reference path="../../../src/custom-typings/index.d.ts" />
|
5
8
|
import React from 'react';
|
9
|
+
import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
|
10
|
+
import '../../global/js/utils/props-helper';
|
11
|
+
import { IconButton } from '@carbon/react';
|
12
|
+
type imageProps = {
|
13
|
+
/**
|
14
|
+
* When passing the image prop, supply a full path to the image to be displayed.
|
15
|
+
*/
|
16
|
+
image: string;
|
17
|
+
/**
|
18
|
+
* When passing the image prop use the imageDescription prop to describe the image for screen reader.
|
19
|
+
*/
|
20
|
+
imageDescription: string;
|
21
|
+
} | {
|
22
|
+
image?: never;
|
23
|
+
imageDescription?: never;
|
24
|
+
};
|
25
|
+
type UserProfileImageBaseProps = {
|
26
|
+
/**
|
27
|
+
* The background color passed should match one of the background colors in the library documentation:
|
28
|
+
* https://pages.github.ibm.com/cdai-design/pal/patterns/user-profile-images/
|
29
|
+
*/
|
30
|
+
backgroundColor?: string;
|
31
|
+
/**
|
32
|
+
* Provide an optional class to be applied to the containing node.
|
33
|
+
*/
|
34
|
+
className?: string;
|
35
|
+
/**
|
36
|
+
* Provide a custom icon to use if you need to use an icon other than the included ones
|
37
|
+
*/
|
38
|
+
icon?: () => CarbonIconType | null;
|
39
|
+
/**
|
40
|
+
* When passing the initials prop, either send the initials to be used or the user's display name. The first two capital letters of the display name will be used as the initials.
|
41
|
+
*/
|
42
|
+
initials?: string;
|
43
|
+
/**
|
44
|
+
* When passing the kind prop, use either "user" or "group". The values match up to the Carbon Library icons.
|
45
|
+
*/
|
46
|
+
kind?: 'user' | 'group';
|
47
|
+
/**
|
48
|
+
* Set the size of the avatar circle
|
49
|
+
*/
|
50
|
+
size: 'xl' | 'lg' | 'md';
|
51
|
+
/**
|
52
|
+
* Set theme in which the component will be rendered
|
53
|
+
*/
|
54
|
+
theme: 'light' | 'dark';
|
55
|
+
/**
|
56
|
+
* Specify how the trigger should align with the tooltip
|
57
|
+
*/
|
58
|
+
tooltipAlignment?: React.ComponentProps<typeof IconButton>['align'];
|
59
|
+
/**
|
60
|
+
* Pass in the display name to have it shown on hover
|
61
|
+
*/
|
62
|
+
tooltipText?: string;
|
63
|
+
};
|
64
|
+
type UserProfileImageProps = UserProfileImageBaseProps & imageProps;
|
65
|
+
/**
|
66
|
+
* The user profile avatar allows for an image of the user to be displayed by passing in the image prop. By default the component will display a user icon on a blue background.
|
67
|
+
*/
|
68
|
+
export declare let UserProfileImage: React.ForwardRefExoticComponent<UserProfileImageProps & React.RefAttributes<HTMLDivElement>>;
|
69
|
+
export {};
|
@@ -26,7 +26,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
26
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
27
27
|
|
28
28
|
var _excluded = ["backgroundColor", "className", "kind", "icon", "initials", "image", "imageDescription", "size", "theme", "tooltipText", "tooltipAlignment"];
|
29
|
-
|
30
29
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
31
30
|
var blockClass = "".concat(settings.pkg.prefix, "--user-profile-image");
|
32
31
|
var componentName = 'UserProfileImage';
|
@@ -93,12 +92,13 @@ exports.UserProfileImage = /*#__PURE__*/React__default["default"].forwardRef(fun
|
|
93
92
|
}
|
94
93
|
};
|
95
94
|
var formatInitials = function formatInitials() {
|
96
|
-
|
95
|
+
var _match;
|
96
|
+
if (initials && initials.length === 2) {
|
97
97
|
return initials;
|
98
98
|
}
|
99
99
|
// RegEx takes in the display name and returns the first and last initials. Thomas Watson and Thomas J. Watson
|
100
100
|
// both return JW.
|
101
|
-
return initials.match(/(^\S\S?|\b\S)?/g).join('').match(/(^\S|\S$)?/g).join('').toUpperCase();
|
101
|
+
return ((_match = (initials || '').match(/(^\S\S?|\b\S)?/g)) === null || _match === void 0 || (_match = _match.join('').match(/(^\S|\S$)?/g)) === null || _match === void 0 ? void 0 : _match.join('').toUpperCase()) || '';
|
102
102
|
};
|
103
103
|
var getFillItem = function getFillItem() {
|
104
104
|
if (image) {
|
@@ -158,10 +158,12 @@ exports.UserProfileImage.propTypes = {
|
|
158
158
|
/**
|
159
159
|
* When passing the image prop, supply a full path to the image to be displayed.
|
160
160
|
*/
|
161
|
+
/**@ts-ignore */
|
161
162
|
image: index["default"].string,
|
162
163
|
/**
|
163
164
|
* When passing the image prop use the imageDescription prop to describe the image for screen reader.
|
164
165
|
*/
|
166
|
+
/**@ts-ignore */
|
165
167
|
imageDescription: index["default"].string.isRequired.if(function (_ref2) {
|
166
168
|
var image = _ref2.image;
|
167
169
|
return !!image;
|
@@ -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;
|