@carbon/ibm-products 2.70.0 → 2.71.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 +317 -216
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +546 -270
- 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 +387 -43
- 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 +229 -54
- 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 +242 -56
- 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/_commonjsHelpers.js +1 -3
- package/es/_virtual/index2.js +2 -6
- package/es/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
- package/es/components/APIKeyModal/APIKeyDownloader.js +3 -3
- package/es/components/APIKeyModal/APIKeyModal.js +1 -1
- package/es/components/ActionSet/ActionSet.d.ts +4 -0
- package/es/components/ActionSet/ActionSet.js +46 -44
- package/es/components/AddSelect/AddSelectBody.js +1 -1
- package/es/components/Card/Card.d.ts +1 -0
- package/es/components/Coachmark/CoachmarkOverlay.js +5 -5
- package/es/components/Coachmark/CoachmarkTagline.js +2 -2
- package/es/components/Coachmark/utils/context.d.ts +28 -2
- package/es/components/Coachmark/utils/context.js +1 -1
- package/es/components/CoachmarkStack/CoachmarkStack.js +11 -8
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
- package/es/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/util.js +11 -4
- package/es/components/CreateModal/CreateModal.d.ts +4 -7
- package/es/components/CreateModal/CreateModal.js +4 -19
- package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
- package/es/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
- package/es/components/EditTearsheet/EditTearsheetForm.js +16 -4
- package/es/components/EmptyStates/EmptyState.js +0 -1
- package/es/components/FilterSummary/FilterSummary.d.ts +1 -0
- package/es/components/FilterSummary/FilterSummary.js +2 -1
- package/es/components/Guidebanner/Guidebanner.js +4 -20
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
- package/es/components/InterstitialScreen/InterstitialScreen.js +21 -21
- package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
- package/es/components/InterstitialScreen/InterstitialScreenBody.js +16 -11
- package/es/components/InterstitialScreen/InterstitialScreenFooter.js +15 -13
- package/es/components/InterstitialScreen/InterstitialScreenHeader.js +13 -8
- package/es/components/InterstitialScreen/index.d.ts +4 -1
- package/es/components/Nav/NavItemLink.js +1 -4
- package/es/components/NotificationsPanel/NotificationsPanel.js +11 -21
- package/es/components/PageHeader/PageHeaderTitle.js +1 -1
- package/es/components/PageHeader/next/PageHeader.d.ts +277 -0
- package/es/components/PageHeader/next/PageHeader.js +475 -0
- package/es/components/PageHeader/next/index.d.ts +8 -0
- package/es/components/ScrollGradient/ScrollGradient.js +4 -4
- package/es/components/SidePanel/SidePanel.js +25 -20
- package/es/components/StringFormatter/StringFormatter.js +3 -0
- package/es/components/Tearsheet/Tearsheet.js +4 -7
- package/es/components/Tearsheet/TearsheetNarrow.js +1 -4
- package/es/components/Tearsheet/TearsheetShell.js +1 -1
- package/es/components/UserAvatar/UserAvatar.js +5 -7
- package/es/components/UserProfileImage/UserProfileImage.d.ts +1 -0
- package/es/components/UserProfileImage/UserProfileImage.js +12 -6
- package/es/components/index.d.ts +1 -0
- package/es/global/js/package-settings.js +1 -1
- package/es/index.js +3 -0
- package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/es/node_modules/prop-types/index.js +1 -1
- package/lib/_virtual/_commonjsHelpers.js +0 -3
- package/lib/_virtual/index2.js +2 -8
- package/lib/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
- package/lib/components/APIKeyModal/APIKeyDownloader.js +3 -3
- package/lib/components/APIKeyModal/APIKeyModal.js +1 -1
- package/lib/components/ActionSet/ActionSet.d.ts +4 -0
- package/lib/components/ActionSet/ActionSet.js +46 -43
- package/lib/components/AddSelect/AddSelectBody.js +1 -1
- package/lib/components/Card/Card.d.ts +1 -0
- package/lib/components/Coachmark/CoachmarkOverlay.js +5 -5
- package/lib/components/Coachmark/CoachmarkTagline.js +2 -2
- package/lib/components/Coachmark/utils/context.d.ts +28 -2
- package/lib/components/Coachmark/utils/context.js +1 -1
- package/lib/components/CoachmarkStack/CoachmarkStack.js +11 -8
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
- package/lib/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/util.js +11 -4
- package/lib/components/CreateModal/CreateModal.d.ts +4 -7
- package/lib/components/CreateModal/CreateModal.js +4 -19
- package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
- package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
- package/lib/components/EditTearsheet/EditTearsheetForm.js +16 -4
- package/lib/components/EmptyStates/EmptyState.js +0 -1
- package/lib/components/FilterSummary/FilterSummary.d.ts +1 -0
- package/lib/components/FilterSummary/FilterSummary.js +2 -1
- package/lib/components/Guidebanner/Guidebanner.js +4 -20
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
- package/lib/components/InterstitialScreen/InterstitialScreen.js +21 -20
- package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
- package/lib/components/InterstitialScreen/InterstitialScreenBody.js +19 -14
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +20 -18
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +15 -10
- package/lib/components/InterstitialScreen/index.d.ts +4 -1
- package/lib/components/Nav/NavItemLink.js +1 -4
- package/lib/components/NotificationsPanel/NotificationsPanel.js +11 -21
- package/lib/components/PageHeader/PageHeaderTitle.js +1 -1
- package/lib/components/PageHeader/next/PageHeader.d.ts +277 -0
- package/lib/components/PageHeader/next/PageHeader.js +490 -0
- package/lib/components/PageHeader/next/index.d.ts +8 -0
- package/lib/components/ScrollGradient/ScrollGradient.js +4 -4
- package/lib/components/SidePanel/SidePanel.js +26 -21
- package/lib/components/StringFormatter/StringFormatter.js +3 -0
- package/lib/components/Tearsheet/Tearsheet.js +4 -7
- package/lib/components/Tearsheet/TearsheetNarrow.js +1 -4
- package/lib/components/Tearsheet/TearsheetShell.js +1 -1
- package/lib/components/UserAvatar/UserAvatar.js +5 -7
- package/lib/components/UserProfileImage/UserProfileImage.d.ts +1 -0
- package/lib/components/UserProfileImage/UserProfileImage.js +12 -6
- package/lib/components/index.d.ts +1 -0
- package/lib/global/js/package-settings.js +1 -1
- package/lib/index.js +5 -2
- package/lib/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/lib/node_modules/prop-types/index.js +1 -1
- package/package.json +22 -30
- package/scss/components/CoachmarkStack/_coachmark-stack.scss +12 -1
- package/scss/components/InterstitialScreen/_interstitial-screen.scss +7 -11
- package/scss/components/PageHeader/_page-header.scss +198 -0
- package/scss/components/SidePanel/_side-panel.scss +2 -52
- package/scss/components/_index-released-only.scss +1 -0
- package/telemetry.yml +12 -13
- package/es/_virtual/index3.js +0 -10
- package/es/components/SidePanel/resizer/Resizer.d.ts +0 -21
- package/es/components/SidePanel/resizer/Resizer.js +0 -271
- package/es/node_modules/lodash.debounce/index.js +0 -367
- package/lib/_virtual/index3.js +0 -12
- package/lib/components/SidePanel/resizer/Resizer.d.ts +0 -21
- package/lib/components/SidePanel/resizer/Resizer.js +0 -277
- package/lib/node_modules/lodash.debounce/index.js +0 -369
- /package/es/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
- /package/lib/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
@@ -10,7 +10,6 @@ import { Button } from '@carbon/react';
|
|
10
10
|
import { portalType, TearsheetShell, tearsheetShellWideProps } from './TearsheetShell.js';
|
11
11
|
import React__default from 'react';
|
12
12
|
import { allPropTypes, prepareProps } from '../../global/js/utils/props-helper.js';
|
13
|
-
import { ActionSet } from '../ActionSet/ActionSet.js';
|
14
13
|
import PropTypes from '../../_virtual/index.js';
|
15
14
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
16
15
|
import { pkg } from '../../settings.js';
|
@@ -84,9 +83,7 @@ TearsheetNarrow.propTypes = {
|
|
84
83
|
*
|
85
84
|
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
|
86
85
|
*/
|
87
|
-
actions: allPropTypes([
|
88
|
-
ActionSet.validateActions(() => 'lg'), PropTypes.arrayOf(PropTypes.shape({
|
89
|
-
/**@ts-ignore*/
|
86
|
+
actions: allPropTypes([PropTypes.arrayOf(PropTypes.shape({
|
90
87
|
...Button.propTypes,
|
91
88
|
kind: PropTypes.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
|
92
89
|
label: PropTypes.string,
|
@@ -150,7 +150,7 @@ const TearsheetShell = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
|
|
150
150
|
if (prevOpen && !open && launcherButtonRef?.current) {
|
151
151
|
setTimeout(() => {
|
152
152
|
launcherButtonRef?.current.focus();
|
153
|
-
},
|
153
|
+
}, 10);
|
154
154
|
}
|
155
155
|
}, [open, prevOpen, launcherButtonRef]);
|
156
156
|
useEffect(() => {
|
@@ -29,9 +29,8 @@ const componentName = 'UserAvatar';
|
|
29
29
|
* TODO: A description of the component.
|
30
30
|
*/
|
31
31
|
|
32
|
-
let UserAvatar = /*#__PURE__*/React__default.forwardRef((
|
33
|
-
|
34
|
-
// The component props, in alphabetical order (for consistency).
|
32
|
+
let UserAvatar = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
33
|
+
const {
|
35
34
|
backgroundColor = 'order-1-cyan',
|
36
35
|
className,
|
37
36
|
image,
|
@@ -42,9 +41,8 @@ let UserAvatar = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
42
41
|
size = 'md',
|
43
42
|
tooltipText,
|
44
43
|
tooltipAlignment = 'bottom',
|
45
|
-
// Collect any other property values passed in.
|
46
44
|
...rest
|
47
|
-
} =
|
45
|
+
} = props;
|
48
46
|
const carbonPrefix = usePrefix();
|
49
47
|
const iconSize = {
|
50
48
|
sm: 16,
|
@@ -137,10 +135,10 @@ UserAvatar.propTypes = {
|
|
137
135
|
* When passing the image prop use the imageDescription prop to describe the image for screen reader.
|
138
136
|
*/
|
139
137
|
/**@ts-ignore */
|
140
|
-
imageDescription: PropTypes.string.isRequired.if(
|
138
|
+
imageDescription: PropTypes.string.isRequired.if(_ref => {
|
141
139
|
let {
|
142
140
|
image
|
143
|
-
} =
|
141
|
+
} = _ref;
|
144
142
|
return !!image;
|
145
143
|
}),
|
146
144
|
/**
|
@@ -63,6 +63,7 @@ type UserProfileImageBaseProps = {
|
|
63
63
|
export type UserProfileImageProps = UserProfileImageBaseProps & imageProps;
|
64
64
|
/**
|
65
65
|
* 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.
|
66
|
+
* @deprecated This component is deprecated.
|
66
67
|
*/
|
67
68
|
export declare let UserProfileImage: React.ForwardRefExoticComponent<UserProfileImageProps & React.RefAttributes<HTMLDivElement>>;
|
68
69
|
export {};
|
@@ -24,10 +24,11 @@ const componentName = 'UserProfileImage';
|
|
24
24
|
|
25
25
|
/**
|
26
26
|
* 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.
|
27
|
+
* @deprecated This component is deprecated.
|
27
28
|
*/
|
28
|
-
let UserProfileImage = /*#__PURE__*/React__default.forwardRef((
|
29
|
+
let UserProfileImage = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
29
30
|
var _FillItem;
|
30
|
-
|
31
|
+
const {
|
31
32
|
backgroundColor,
|
32
33
|
className,
|
33
34
|
kind,
|
@@ -39,9 +40,8 @@ let UserProfileImage = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
39
40
|
theme,
|
40
41
|
tooltipText,
|
41
42
|
tooltipAlignment = 'bottom',
|
42
|
-
// Collect any other property values passed in.
|
43
43
|
...rest
|
44
|
-
} =
|
44
|
+
} = props;
|
45
45
|
const carbonPrefix = usePrefix();
|
46
46
|
const icons = {
|
47
47
|
user: {
|
@@ -109,6 +109,12 @@ let UserProfileImage = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
109
109
|
}, /*#__PURE__*/React__default.createElement(TooltipTrigger, null, renderUserProfileImage())) : renderUserProfileImage());
|
110
110
|
});
|
111
111
|
|
112
|
+
/**@ts-ignore*/
|
113
|
+
UserProfileImage.deprecated = {
|
114
|
+
level: 'warn',
|
115
|
+
details: `Please replace ${componentName} with UserAvatar`
|
116
|
+
};
|
117
|
+
|
112
118
|
// Return a placeholder if not released and not enabled by feature flag
|
113
119
|
UserProfileImage = pkg.checkComponentEnabled(UserProfileImage, componentName);
|
114
120
|
UserProfileImage.displayName = componentName;
|
@@ -135,10 +141,10 @@ UserProfileImage.propTypes = {
|
|
135
141
|
* When passing the image prop use the imageDescription prop to describe the image for screen reader.
|
136
142
|
*/
|
137
143
|
/**@ts-ignore */
|
138
|
-
imageDescription: PropTypes.string.isRequired.if(
|
144
|
+
imageDescription: PropTypes.string.isRequired.if(_ref => {
|
139
145
|
let {
|
140
146
|
image
|
141
|
-
} =
|
147
|
+
} = _ref;
|
142
148
|
return !!image;
|
143
149
|
}),
|
144
150
|
/**
|
package/es/components/index.d.ts
CHANGED
@@ -68,4 +68,5 @@ export { ActionBar } from './ActionBar';
|
|
68
68
|
export * from './FilterPanel';
|
69
69
|
export * from './ConditionBuilder';
|
70
70
|
export * from './GetStartedCard';
|
71
|
+
export * as unstable__PageHeader from './PageHeader/next/PageHeader';
|
71
72
|
export { FeatureFlags as unstable_FeatureFlags, useFeatureFlag as unstable_useFeatureFlag, useFeatureFlags as unstable_useFeatureFlags, } from './FeatureFlags';
|
package/es/index.js
CHANGED
@@ -80,6 +80,7 @@ export { EditFullPage } from './components/EditFullPage/EditFullPage.js';
|
|
80
80
|
export { EditUpdateCards } from './components/EditUpdateCards/EditUpdateCards.js';
|
81
81
|
export { Checklist } from './components/Checklist/Checklist.js';
|
82
82
|
export { Coachmark } from './components/Coachmark/Coachmark.js';
|
83
|
+
import 'react';
|
83
84
|
import './components/Coachmark/CoachmarkTagline.js';
|
84
85
|
export { CoachmarkBeacon } from './components/CoachmarkBeacon/CoachmarkBeacon.js';
|
85
86
|
export { CoachmarkButton } from './components/CoachmarkButton/CoachmarkButton.js';
|
@@ -102,6 +103,8 @@ export { FullPageError } from './components/FullPageError/FullPageError.js';
|
|
102
103
|
export { SearchBar } from './components/SearchBar/SearchBar.js';
|
103
104
|
export { TagOverflow } from './components/TagOverflow/TagOverflow.js';
|
104
105
|
export { GetStartedCard } from './components/GetStartedCard/GetStartedCard.js';
|
106
|
+
import * as PageHeader from './components/PageHeader/next/PageHeader.js';
|
107
|
+
export { PageHeader as unstable__PageHeader };
|
105
108
|
export { FeatureFlags as unstable_FeatureFlags, useFeatureFlag as unstable_useFeatureFlag, useFeatureFlags as unstable_useFeatureFlags } from './components/FeatureFlags/index.js';
|
106
109
|
export { default as useFilterContext } from './components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js';
|
107
110
|
export { usePrefix } from './global/js/hooks/usePrefix.js';
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { getAttributes } from '
|
8
|
+
import { getAttributes } from '../../icon-helpers/es/index.js';
|
9
9
|
import PropTypes from '../../../../_virtual/index.js';
|
10
10
|
import React__default from 'react';
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { __module as propTypes } from '../../_virtual/
|
8
|
+
import { __module as propTypes } from '../../_virtual/index2.js';
|
9
9
|
import require$$0 from 'react-is';
|
10
10
|
import { __require as requireFactoryWithTypeCheckers } from './factoryWithTypeCheckers.js';
|
11
11
|
import { __require as requireFactoryWithThrowingShims } from './factoryWithThrowingShims.js';
|
@@ -7,11 +7,8 @@
|
|
7
7
|
|
8
8
|
'use strict';
|
9
9
|
|
10
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
11
|
-
|
12
10
|
function getDefaultExportFromCjs (x) {
|
13
11
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
14
12
|
}
|
15
13
|
|
16
|
-
exports.commonjsGlobal = commonjsGlobal;
|
17
14
|
exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
|
package/lib/_virtual/index2.js
CHANGED
@@ -7,12 +7,6 @@
|
|
7
7
|
|
8
8
|
'use strict';
|
9
9
|
|
10
|
-
|
10
|
+
var propTypes = {exports: {}};
|
11
11
|
|
12
|
-
|
13
|
-
var index = require('../node_modules/lodash.debounce/index.js');
|
14
|
-
|
15
|
-
var lodash_debounceExports = index.__require();
|
16
|
-
var debounce = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(lodash_debounceExports);
|
17
|
-
|
18
|
-
exports.default = debounce;
|
12
|
+
exports.__module = propTypes;
|
@@ -1,22 +1,64 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2021, 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
|
+
*/
|
7
|
+
import React from 'react';
|
8
|
+
interface APIKeyDownloaderProps {
|
9
|
+
/**
|
10
|
+
* the api key that's displayed to the user when a request to create is fulfilled.
|
11
|
+
*/
|
12
|
+
apiKey?: string;
|
13
|
+
/**
|
14
|
+
* the content that appears that indicates the key is downloadable
|
15
|
+
*/
|
16
|
+
body?: string;
|
17
|
+
/**
|
18
|
+
* designates the name of downloadable json file with the key. if not specified will default to 'apikey'
|
19
|
+
*/
|
20
|
+
fileName?: string;
|
21
|
+
/**
|
22
|
+
* designates the file type for the downloadable key
|
23
|
+
*/
|
24
|
+
fileType: 'txt' | 'json';
|
25
|
+
/**
|
26
|
+
* anchor text for the download link
|
27
|
+
*/
|
28
|
+
linkText: string;
|
29
|
+
/**
|
30
|
+
* Aria-label for the download link
|
31
|
+
*/
|
7
32
|
downloadLinkLabel: any;
|
8
|
-
}): React.JSX.Element;
|
9
|
-
export namespace APIKeyDownloader {
|
10
|
-
export { componentName as displayName };
|
11
|
-
export namespace propTypes {
|
12
|
-
let apiKey: any;
|
13
|
-
let body: any;
|
14
|
-
let downloadLinkLabel: any;
|
15
|
-
let fileName: any;
|
16
|
-
let fileType: any;
|
17
|
-
let linkText: any;
|
18
|
-
}
|
19
33
|
}
|
20
|
-
|
21
|
-
|
34
|
+
export declare const APIKeyDownloader: {
|
35
|
+
(props: APIKeyDownloaderProps): React.JSX.Element;
|
36
|
+
displayName: string;
|
37
|
+
propTypes: {
|
38
|
+
/**
|
39
|
+
* the api key that's displayed to the user when a request to create is fulfilled.
|
40
|
+
*/
|
41
|
+
apiKey: any;
|
42
|
+
/**
|
43
|
+
* body content for the downloader
|
44
|
+
*/
|
45
|
+
body: any;
|
46
|
+
/**
|
47
|
+
* aria-label for the download link
|
48
|
+
*/
|
49
|
+
downloadLinkLabel: any;
|
50
|
+
/**
|
51
|
+
* designates the name of downloadable json file with the key. if not specified will default to 'apikey'
|
52
|
+
*/
|
53
|
+
fileName: any;
|
54
|
+
/**
|
55
|
+
* designates the file type for the downloadable key
|
56
|
+
*/
|
57
|
+
fileType: any;
|
58
|
+
/**
|
59
|
+
* anchor text for the download link
|
60
|
+
*/
|
61
|
+
linkText: any;
|
62
|
+
};
|
63
|
+
};
|
22
64
|
export {};
|
@@ -13,15 +13,15 @@ var index = require('../../_virtual/index.js');
|
|
13
13
|
var settings = require('../../settings.js');
|
14
14
|
|
15
15
|
const componentName = 'APIKeyDownloader';
|
16
|
-
const APIKeyDownloader =
|
17
|
-
|
16
|
+
const APIKeyDownloader = props => {
|
17
|
+
const {
|
18
18
|
apiKey,
|
19
19
|
body,
|
20
20
|
fileName,
|
21
21
|
fileType,
|
22
22
|
linkText,
|
23
23
|
downloadLinkLabel
|
24
|
-
} =
|
24
|
+
} = props;
|
25
25
|
const [linkProps, setLinkProps] = React.useState({});
|
26
26
|
React.useEffect(() => {
|
27
27
|
const generateLinkProps = async () => {
|
@@ -125,7 +125,7 @@ exports.APIKeyModal = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
125
125
|
React.useEffect(() => {
|
126
126
|
if (open) {
|
127
127
|
// Focusing the first element or selectorPrimaryFocus element
|
128
|
-
claimFocus();
|
128
|
+
setTimeout(() => claimFocus(), 0);
|
129
129
|
}
|
130
130
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
131
131
|
}, [modalRef, open, firstElement]);
|
@@ -33,6 +33,10 @@ export interface ActionSetProps {
|
|
33
33
|
*/
|
34
34
|
size?: ButtonSize;
|
35
35
|
}
|
36
|
+
export declare const validateActionSetProps: ({ actions, size }: {
|
37
|
+
actions: any;
|
38
|
+
size: any;
|
39
|
+
}) => any;
|
36
40
|
/**
|
37
41
|
* An ActionSet presents a set of action buttons, constructed from bundles
|
38
42
|
* of prop values and applying some layout rules. When the size is 'sm'
|
@@ -14,6 +14,7 @@ var propsHelper = require('../../global/js/utils/props-helper.js');
|
|
14
14
|
var index = require('../../_virtual/index.js');
|
15
15
|
var cx = require('classnames');
|
16
16
|
var settings = require('../../settings.js');
|
17
|
+
var pconsole = require('../../global/js/utils/pconsole.js');
|
17
18
|
|
18
19
|
var _InlineLoading;
|
19
20
|
const blockClass = `${settings.pkg.prefix}--action-set`;
|
@@ -56,6 +57,41 @@ const willStack = (size, numberOfActions) => size === 'sm' || size === 'md' && n
|
|
56
57
|
const defaults = {
|
57
58
|
size: 'md'
|
58
59
|
};
|
60
|
+
const validateActionSetProps = _ref2 => {
|
61
|
+
let {
|
62
|
+
actions,
|
63
|
+
size
|
64
|
+
} = _ref2;
|
65
|
+
if (actions && actions.length) {
|
66
|
+
const problems = [];
|
67
|
+
const stacking = willStack(size, actions.length);
|
68
|
+
const countActions = kind => actions.filter(action => (action.kind || defaultKind) === kind).length;
|
69
|
+
const primaryActions = countActions('primary');
|
70
|
+
const secondaryActions = countActions('secondary');
|
71
|
+
const dangerActions = countActions('danger');
|
72
|
+
const ghostActions = countActions('ghost') + countActions('danger--ghost');
|
73
|
+
if (stacking && actions.length > 3) {
|
74
|
+
problems.push(`you cannot have more than three actions in this size of ${componentName}`);
|
75
|
+
}
|
76
|
+
if (actions.length > 4) {
|
77
|
+
problems.push(`you cannot have more than four actions in a ${componentName}`);
|
78
|
+
}
|
79
|
+
if (primaryActions > 1) {
|
80
|
+
problems.push(`you cannot have more than one 'primary' action in a ${componentName}`);
|
81
|
+
}
|
82
|
+
if (ghostActions > 1) {
|
83
|
+
problems.push(`you cannot have more than one 'ghost' action in a ${componentName}`);
|
84
|
+
}
|
85
|
+
if (stacking && actions.length > 1 && ghostActions > 0) {
|
86
|
+
problems.push(`you cannot have a 'ghost' button in conjunction with other action types in this size of ${componentName}`);
|
87
|
+
}
|
88
|
+
if (actions.length > primaryActions + secondaryActions + dangerActions + ghostActions) {
|
89
|
+
problems.push(`you can only have 'primary', 'danger', 'secondary', 'ghost' and 'danger--ghost' buttons in a ${componentName}`);
|
90
|
+
}
|
91
|
+
return problems.length > 0 ? pconsole.default.error(`Invalid prop \`actions\` supplied to \`${componentName}\`: ${problems.join(', and ')}.`) : null;
|
92
|
+
}
|
93
|
+
};
|
94
|
+
|
59
95
|
/**
|
60
96
|
* An ActionSet presents a set of action buttons, constructed from bundles
|
61
97
|
* of prop values and applying some layout rules. When the size is 'sm'
|
@@ -68,17 +104,18 @@ const defaults = {
|
|
68
104
|
* it appears at the left side. If there is a primary button it appears at the
|
69
105
|
* right.
|
70
106
|
*/
|
71
|
-
const ActionSet = /*#__PURE__*/React.forwardRef((
|
72
|
-
|
73
|
-
// The component props, in alphabetical order (for consistency).
|
74
|
-
|
107
|
+
const ActionSet = /*#__PURE__*/React.forwardRef((props, ref) => {
|
108
|
+
const {
|
75
109
|
actions,
|
76
110
|
buttonSize,
|
77
111
|
className,
|
78
112
|
size = defaults.size,
|
79
|
-
// Collect any other property values passed in.
|
80
113
|
...rest
|
81
|
-
} =
|
114
|
+
} = props;
|
115
|
+
validateActionSetProps({
|
116
|
+
actions,
|
117
|
+
size
|
118
|
+
});
|
82
119
|
const buttons = actions && actions.slice?.(0) || [];
|
83
120
|
|
84
121
|
// We stack the buttons in a sm set, or if there are three or more in a md set.
|
@@ -131,41 +168,7 @@ ActionSet.displayName = componentName;
|
|
131
168
|
* @returns null if the actions meet the requirements, or an Error object with
|
132
169
|
* an explanatory message.
|
133
170
|
*/
|
134
|
-
|
135
|
-
ActionSet.validateActions = sizeFn => (props, propName, componentName, location, propFullName) => {
|
136
|
-
const name = propFullName || propName;
|
137
|
-
const prop = props[name];
|
138
|
-
const actions = prop && prop?.length;
|
139
|
-
const problems = [];
|
140
|
-
if (actions > 0) {
|
141
|
-
const size = sizeFn ? sizeFn(props) : props.size || defaults.size;
|
142
|
-
const stacking = willStack(size, actions);
|
143
|
-
const countActions = kind => prop.filter(action => (action.kind || defaultKind) === kind).length;
|
144
|
-
const primaryActions = countActions('primary');
|
145
|
-
const secondaryActions = countActions('secondary');
|
146
|
-
const dangerActions = countActions('danger');
|
147
|
-
const ghostActions = countActions('ghost') + countActions('danger--ghost');
|
148
|
-
if (stacking && actions > 3) {
|
149
|
-
problems.push(`you cannot have more than three actions in this size of ${componentName}`);
|
150
|
-
}
|
151
|
-
if (actions > 4) {
|
152
|
-
problems.push(`you cannot have more than four actions in a ${componentName}`);
|
153
|
-
}
|
154
|
-
if (primaryActions > 1) {
|
155
|
-
problems.push(`you cannot have more than one 'primary' action in a ${componentName}`);
|
156
|
-
}
|
157
|
-
if (ghostActions > 1) {
|
158
|
-
problems.push(`you cannot have more than one 'ghost' action in a ${componentName}`);
|
159
|
-
}
|
160
|
-
if (stacking && actions > 1 && ghostActions > 0) {
|
161
|
-
problems.push(`you cannot have a 'ghost' button in conjunction with other action types in this size of ${componentName}`);
|
162
|
-
}
|
163
|
-
if (actions > primaryActions + secondaryActions + dangerActions + ghostActions) {
|
164
|
-
problems.push(`you can only have 'primary', 'danger', 'secondary', 'ghost' and 'danger--ghost' buttons in a ${componentName}`);
|
165
|
-
}
|
166
|
-
}
|
167
|
-
return problems.length > 0 ? new Error(`Invalid ${location} \`${name}\` supplied to \`${componentName}\`: ${problems.join(', and ')}.`) : null;
|
168
|
-
};
|
171
|
+
|
169
172
|
ActionSet.propTypes = {
|
170
173
|
/**
|
171
174
|
* The action buttons to show. Each action is specified as an
|
@@ -179,8 +182,7 @@ ActionSet.propTypes = {
|
|
179
182
|
*
|
180
183
|
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
|
181
184
|
*/
|
182
|
-
actions: propsHelper.allPropTypes([
|
183
|
-
ActionSet.validateActions(), index.default.arrayOf(index.default.shape({
|
185
|
+
actions: propsHelper.allPropTypes([index.default.arrayOf(index.default.shape({
|
184
186
|
/**@ts-ignore*/
|
185
187
|
...react.Button.propTypes,
|
186
188
|
kind: index.default.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
|
@@ -210,3 +212,4 @@ ActionSet.propTypes = {
|
|
210
212
|
};
|
211
213
|
|
212
214
|
exports.ActionSet = ActionSet;
|
215
|
+
exports.validateActionSetProps = validateActionSetProps;
|
@@ -360,6 +360,6 @@ AddSelectBody.propTypes = {
|
|
360
360
|
title: index.default.string,
|
361
361
|
useNormalizedItems: index.default.bool
|
362
362
|
};
|
363
|
-
|
363
|
+
AddSelectBody.displayName = componentName;
|
364
364
|
|
365
365
|
exports.AddSelectBody = AddSelectBody;
|
@@ -35,8 +35,8 @@ const defaults = {
|
|
35
35
|
* DO NOT USE. This component is for the exclusive use
|
36
36
|
* of other Onboarding components.
|
37
37
|
*/
|
38
|
-
exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef((
|
39
|
-
|
38
|
+
exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef((props, ref) => {
|
39
|
+
const {
|
40
40
|
children,
|
41
41
|
onClose,
|
42
42
|
fixedIsVisible,
|
@@ -44,7 +44,7 @@ exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
44
44
|
kind = defaults.kind,
|
45
45
|
theme = defaults.theme,
|
46
46
|
...rest
|
47
|
-
} =
|
47
|
+
} = props;
|
48
48
|
const {
|
49
49
|
winHeight,
|
50
50
|
winWidth
|
@@ -84,7 +84,7 @@ exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
84
84
|
const styledTune = React.useMemo(() => {
|
85
85
|
const style = {};
|
86
86
|
if (isBeacon || isDraggable) {
|
87
|
-
if (coachmark
|
87
|
+
if (coachmark?.targetRect) {
|
88
88
|
style.left = coachmark.targetRect.x + window.scrollX;
|
89
89
|
style.top = coachmark.targetRect.y + window.scrollY;
|
90
90
|
}
|
@@ -154,7 +154,7 @@ exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
154
154
|
}
|
155
155
|
}, [styledTune, overlayRef]);
|
156
156
|
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
|
157
|
-
className: cx(blockClass, `${blockClass}--${kind}`, `${blockClass}__${theme}`, (isBeacon || isDraggable) && `${blockClass}--${coachmark.align}`, fixedIsVisible && `${blockClass}--is-visible`, a11yDragMode && `${blockClass}--is-dragmode`, className),
|
157
|
+
className: cx(blockClass, `${blockClass}--${kind}`, `${blockClass}__${theme}`, (isBeacon || isDraggable) && coachmark?.align && `${blockClass}--${coachmark.align}`, fixedIsVisible && `${blockClass}--is-visible`, a11yDragMode && `${blockClass}--is-dragmode`, className),
|
158
158
|
ref: overlayRef,
|
159
159
|
"aria-labelledby": contentId,
|
160
160
|
tabIndex: -1
|
@@ -41,13 +41,13 @@ exports.CoachmarkTagline = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
41
41
|
} = _ref;
|
42
42
|
const coachmark = context.useCoachmark();
|
43
43
|
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
|
44
|
-
className: cx(blockClass, `${blockClass}__${theme}`, coachmark
|
44
|
+
className: cx(blockClass, `${blockClass}__${theme}`, coachmark?.isOpen && `${blockClass}--is-open`),
|
45
45
|
ref: ref
|
46
46
|
}, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({
|
47
47
|
// {...rest}
|
48
48
|
className: `${blockClass}__cta`,
|
49
49
|
type: "button"
|
50
|
-
}, coachmark
|
50
|
+
}, coachmark?.buttonProps), /*#__PURE__*/React.createElement("div", {
|
51
51
|
className: `${blockClass}__idea`
|
52
52
|
}, _Idea || (_Idea = /*#__PURE__*/React.createElement(icons.Idea, {
|
53
53
|
size: 16
|
@@ -1,2 +1,28 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 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 { PopoverAlignment } from '@carbon/react';
|
8
|
+
import { ButtonProps } from '@carbon/react';
|
9
|
+
interface CoachmarkContextType {
|
10
|
+
buttonProps: ButtonProps<React.ElementType>;
|
11
|
+
closeButtonProps: {
|
12
|
+
onClick: () => void;
|
13
|
+
};
|
14
|
+
targetRect?: DOMRect;
|
15
|
+
targetOffset?: {
|
16
|
+
x: number;
|
17
|
+
y: number;
|
18
|
+
};
|
19
|
+
align?: PopoverAlignment;
|
20
|
+
positionTune?: {
|
21
|
+
x: number;
|
22
|
+
y: number;
|
23
|
+
};
|
24
|
+
isOpen: boolean;
|
25
|
+
}
|
26
|
+
export declare const CoachmarkContext: import("react").Context<CoachmarkContextType | null>;
|
27
|
+
export declare const useCoachmark: () => CoachmarkContextType | null;
|
28
|
+
export {};
|
@@ -143,16 +143,15 @@ exports.CoachmarkStack = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
143
143
|
mountedRef.current = false;
|
144
144
|
};
|
145
145
|
}, []);
|
146
|
-
React.useEffect(() => {
|
147
|
-
setTimeout(() => {
|
148
|
-
if (stackHomeRef.current) {
|
149
|
-
setParentHeight(stackHomeRef.current.clientHeight + 16);
|
150
|
-
}
|
151
|
-
}, 0);
|
152
|
-
}, [stackHomeRef]);
|
153
146
|
React.useEffect(() => {
|
154
147
|
const targetSelectedItem = selectedItemNumber - 1;
|
155
148
|
if (!parentHeight) {
|
149
|
+
if (stackHomeRef.current) {
|
150
|
+
const height = stackHomeRef.current.clientHeight;
|
151
|
+
if (height > 0) {
|
152
|
+
setParentHeight(height);
|
153
|
+
}
|
154
|
+
}
|
156
155
|
return;
|
157
156
|
}
|
158
157
|
if (stackHomeRef.current) {
|
@@ -160,14 +159,18 @@ exports.CoachmarkStack = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
160
159
|
}
|
161
160
|
if (!isOpen || targetSelectedItem < 0) {
|
162
161
|
if (stackHomeRef.current) {
|
162
|
+
stackHomeRef.current.classList.remove(`${blockClass}--scaled-home`);
|
163
|
+
stackHomeRef.current.classList.add(`${blockClass}--unscaled-home`);
|
163
164
|
stackHomeRef.current.focus();
|
164
165
|
}
|
165
166
|
return;
|
166
167
|
}
|
167
168
|
const targetHomeHeight = stackedCoachmarkRefs.current[targetSelectedItem].clientHeight;
|
168
169
|
if (stackHomeRef.current) {
|
169
|
-
stackHomeRef.current.style.height =
|
170
|
+
stackHomeRef.current.style.height = `calc(${targetHomeHeight}px + 3rem)`;
|
170
171
|
stackedCoachmarkRefs.current[targetSelectedItem].focus();
|
172
|
+
stackHomeRef.current.classList.remove(`${blockClass}--unscaled-home`);
|
173
|
+
stackHomeRef.current.classList.add(`${blockClass}--scaled-home`);
|
171
174
|
}
|
172
175
|
}, [selectedItemNumber, isOpen, parentHeight]);
|
173
176
|
const wrappedChildren = React.Children.map(childArray, (child, idx) => {
|