@carbon/ibm-products 2.38.0-alpha.5 → 2.39.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +227 -0
- 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 +218 -0
- 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 +227 -0
- 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 +445 -0
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/ActionSet/ActionSet.js +3 -2
- package/es/components/Card/Card.js +50 -9
- package/es/components/Card/CardFooter.d.ts +5 -1
- package/es/components/Card/CardFooter.js +11 -1
- package/es/components/Carousel/Carousel.d.ts +6 -2
- package/es/components/Checklist/Checklist.d.ts +100 -2
- package/es/components/Checklist/Checklist.js +19 -15
- package/es/components/Checklist/Checklist.types.d.ts +19 -0
- package/es/components/Checklist/Checklist.types.js +22 -0
- package/es/components/Checklist/ChecklistChart.d.ts +6 -2
- package/es/components/Checklist/ChecklistChart.js +14 -33
- package/es/components/Checklist/ChecklistIcon.d.ts +5 -1
- package/es/components/Checklist/ChecklistIcon.js +9 -4
- package/es/components/Coachmark/Coachmark.d.ts +65 -2
- package/es/components/Coachmark/Coachmark.js +7 -10
- package/es/components/Coachmark/CoachmarkDragbar.d.ts +40 -2
- package/es/components/Coachmark/CoachmarkDragbar.js +3 -1
- package/es/components/Coachmark/CoachmarkHeader.d.ts +27 -2
- package/es/components/Coachmark/CoachmarkHeader.js +0 -1
- package/es/components/Coachmark/CoachmarkOverlay.d.ts +42 -2
- package/es/components/Coachmark/CoachmarkOverlay.js +18 -15
- package/es/components/Coachmark/CoachmarkTagline.d.ts +27 -2
- package/es/components/Coachmark/CoachmarkTagline.js +0 -1
- package/es/components/Coachmark/utils/enums.d.ts +20 -20
- package/es/components/Coachmark/utils/enums.js +22 -20
- package/es/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
- package/es/components/CoachmarkFixed/CoachmarkFixed.d.ts +42 -2
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +4 -2
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +25 -23
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +14 -24
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +2 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +4 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +3 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -11
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +5 -3
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +54 -44
- package/es/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
- package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +48 -27
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +60 -39
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +39 -27
- package/es/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -1
- package/es/components/DataSpreadsheet/types/index.d.ts +30 -0
- package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.d.ts +19 -2
- package/es/components/GetStartedCard/GetStartedCard.d.ts +5 -0
- package/es/components/GetStartedCard/GetStartedCard.js +82 -0
- package/es/components/GetStartedCard/index.d.ts +1 -0
- package/es/components/Guidebanner/Guidebanner.js +2 -2
- package/es/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
- package/es/components/NotificationsPanel/NotificationsPanel.js +10 -10
- package/es/components/SearchBar/SearchBar.d.ts +10 -1
- package/es/components/SearchBar/SearchBar.js +26 -20
- package/es/components/SidePanel/SidePanel.js +1 -1
- package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
- package/es/components/TagOverflow/TagOverflow.js +153 -29
- package/es/components/TagOverflow/TagOverflowModal.d.ts +29 -0
- package/es/components/TagOverflow/TagOverflowModal.js +112 -0
- package/es/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
- package/es/components/TagOverflow/TagOverflowPopover.js +135 -0
- package/es/components/TagSet/TagSet.d.ts +87 -3
- package/es/components/TagSet/TagSet.js +20 -9
- package/es/components/TagSet/TagSetModal.d.ts +32 -26
- package/es/components/TagSet/TagSetModal.js +5 -5
- package/es/components/TagSet/TagSetOverflow.d.ts +45 -2
- package/es/components/TagSet/TagSetOverflow.js +14 -12
- package/es/components/WebTerminal/WebTerminal.js +2 -2
- package/es/components/WebTerminal/WebTerminalContentWrapper.d.ts +15 -2
- package/es/components/WebTerminal/hooks/index.d.ts +16 -11
- package/es/components/WebTerminal/hooks/index.js +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/global/js/package-settings.d.ts +2 -1
- package/es/global/js/package-settings.js +2 -1
- package/es/index.js +1 -0
- package/es/node_modules/@carbon/colors/es/index.js +4 -1
- package/es/settings.d.ts +2 -1
- package/lib/components/ActionSet/ActionSet.js +2 -1
- package/lib/components/Card/Card.js +50 -9
- package/lib/components/Card/CardFooter.d.ts +5 -1
- package/lib/components/Card/CardFooter.js +11 -1
- package/lib/components/Carousel/Carousel.d.ts +6 -2
- package/lib/components/Checklist/Checklist.d.ts +100 -2
- package/lib/components/Checklist/Checklist.js +19 -15
- package/lib/components/Checklist/Checklist.types.d.ts +19 -0
- package/lib/components/Checklist/Checklist.types.js +27 -0
- package/lib/components/Checklist/ChecklistChart.d.ts +6 -2
- package/lib/components/Checklist/ChecklistChart.js +17 -36
- package/lib/components/Checklist/ChecklistIcon.d.ts +5 -1
- package/lib/components/Checklist/ChecklistIcon.js +9 -4
- package/lib/components/Coachmark/Coachmark.d.ts +65 -2
- package/lib/components/Coachmark/Coachmark.js +6 -9
- package/lib/components/Coachmark/CoachmarkDragbar.d.ts +40 -2
- package/lib/components/Coachmark/CoachmarkDragbar.js +3 -1
- package/lib/components/Coachmark/CoachmarkHeader.d.ts +27 -2
- package/lib/components/Coachmark/CoachmarkHeader.js +0 -1
- package/lib/components/Coachmark/CoachmarkOverlay.d.ts +42 -2
- package/lib/components/Coachmark/CoachmarkOverlay.js +18 -15
- package/lib/components/Coachmark/CoachmarkTagline.d.ts +27 -2
- package/lib/components/Coachmark/CoachmarkTagline.js +0 -1
- package/lib/components/Coachmark/utils/enums.d.ts +20 -20
- package/lib/components/Coachmark/utils/enums.js +22 -20
- package/lib/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
- package/lib/components/CoachmarkFixed/CoachmarkFixed.d.ts +42 -2
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +4 -2
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +25 -23
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +13 -23
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +2 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +4 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +3 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -11
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +5 -3
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +54 -44
- package/lib/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
- package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +48 -27
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +59 -38
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +39 -27
- package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -1
- package/lib/components/DataSpreadsheet/types/index.d.ts +30 -0
- package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.d.ts +19 -2
- package/lib/components/GetStartedCard/GetStartedCard.d.ts +5 -0
- package/lib/components/GetStartedCard/GetStartedCard.js +88 -0
- package/lib/components/GetStartedCard/index.d.ts +1 -0
- package/lib/components/Guidebanner/Guidebanner.js +2 -2
- package/lib/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
- package/lib/components/NotificationsPanel/NotificationsPanel.js +10 -10
- package/lib/components/SearchBar/SearchBar.d.ts +10 -1
- package/lib/components/SearchBar/SearchBar.js +26 -18
- package/lib/components/SidePanel/SidePanel.js +1 -1
- package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
- package/lib/components/TagOverflow/TagOverflow.js +154 -28
- package/lib/components/TagOverflow/TagOverflowModal.d.ts +29 -0
- package/lib/components/TagOverflow/TagOverflowModal.js +121 -0
- package/lib/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
- package/lib/components/TagOverflow/TagOverflowPopover.js +144 -0
- package/lib/components/TagSet/TagSet.d.ts +87 -3
- package/lib/components/TagSet/TagSet.js +20 -9
- package/lib/components/TagSet/TagSetModal.d.ts +32 -26
- package/lib/components/TagSet/TagSetModal.js +3 -3
- package/lib/components/TagSet/TagSetOverflow.d.ts +45 -2
- package/lib/components/TagSet/TagSetOverflow.js +14 -12
- package/lib/components/WebTerminal/WebTerminal.js +2 -2
- package/lib/components/WebTerminal/WebTerminalContentWrapper.d.ts +15 -2
- package/lib/components/WebTerminal/hooks/index.d.ts +16 -11
- package/lib/components/WebTerminal/hooks/index.js +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/global/js/package-settings.d.ts +2 -1
- package/lib/global/js/package-settings.js +2 -1
- package/lib/index.js +5 -0
- package/lib/node_modules/@carbon/colors/es/index.js +6 -0
- package/lib/settings.d.ts +2 -1
- package/package.json +3 -3
- package/scss/components/Checklist/_carbon-imports.scss +2 -2
- package/scss/components/GetStartedCard/_carbon-imports.scss +9 -0
- package/scss/components/GetStartedCard/_get-started-card.scss +135 -0
- package/scss/components/GetStartedCard/_index-with-carbon.scss +9 -0
- package/scss/components/GetStartedCard/_index.scss +8 -0
- package/scss/components/TagOverflow/_tag-overflow.scss +157 -0
- package/scss/components/_index-released-only-with-carbon.scss +2 -1
- package/scss/components/_index-released-only.scss +2 -1
- package/scss/components/_index-with-carbon.scss +2 -0
- package/scss/components/_index.scss +1 -0
- package/telemetry.yml +28 -24
@@ -12,6 +12,7 @@ import cx from 'classnames';
|
|
12
12
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
13
13
|
import { pkg } from '../../settings.js';
|
14
14
|
import { CircleDash, CheckmarkOutline, Incomplete, Warning } from '@carbon/react/icons';
|
15
|
+
import { Themes, Kinds } from './Checklist.types.js';
|
15
16
|
|
16
17
|
var _excluded = ["className", "kind", "theme"];
|
17
18
|
|
@@ -32,13 +33,17 @@ var componentName = 'ChecklistIcon';
|
|
32
33
|
|
33
34
|
// Default values for props
|
34
35
|
var defaults = {
|
35
|
-
theme:
|
36
|
+
theme: Themes.light
|
36
37
|
};
|
37
38
|
|
38
39
|
/**
|
39
40
|
* TODO: A description of the component.
|
40
41
|
*/
|
41
|
-
var ChecklistIcon = /*#__PURE__*/React__default.forwardRef(
|
42
|
+
var ChecklistIcon = /*#__PURE__*/React__default.forwardRef(
|
43
|
+
/**
|
44
|
+
* @param {{className?: string, kind?: import('./Checklist.types').Kind, theme?: import('./Checklist.types').Theme}} props type description
|
45
|
+
*/
|
46
|
+
function (_ref, ref) {
|
42
47
|
var className = _ref.className,
|
43
48
|
kind = _ref.kind,
|
44
49
|
_ref$theme = _ref.theme,
|
@@ -86,11 +91,11 @@ ChecklistIcon.propTypes = {
|
|
86
91
|
/**
|
87
92
|
* The icon to be displayed.
|
88
93
|
*/
|
89
|
-
kind: PropTypes.oneOf([
|
94
|
+
kind: PropTypes.oneOf([Kinds.unchecked, Kinds.indeterminate, Kinds.checked, Kinds.disabled, Kinds.error]),
|
90
95
|
/**
|
91
96
|
* Determines the theme of the component.
|
92
97
|
*/
|
93
|
-
theme: PropTypes.oneOf([
|
98
|
+
theme: PropTypes.oneOf([Themes.light, Themes.dark])
|
94
99
|
};
|
95
100
|
|
96
101
|
export { ChecklistIcon };
|
@@ -1,7 +1,70 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2023, 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, { MutableRefObject, ReactNode } from 'react';
|
8
|
+
interface CoachmarkProps {
|
9
|
+
/**
|
10
|
+
* Where to render the Coachmark relative to its target.
|
11
|
+
* Applies only to Floating and Tooltip Coachmarks.
|
12
|
+
* @see COACHMARK_ALIGNMENT
|
13
|
+
*/
|
14
|
+
align?: 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'left-top' | 'left-bottom' | 'right' | 'right-top' | 'right-bottom' | 'top' | 'top-left' | 'top-right';
|
15
|
+
/**
|
16
|
+
* Coachmark should use a single CoachmarkOverlayElements component as a child.
|
17
|
+
* @see CoachmarkOverlayElements
|
18
|
+
*/
|
19
|
+
children: ReactNode;
|
20
|
+
/**
|
21
|
+
* Optional class name for this component.
|
22
|
+
*/
|
23
|
+
className?: string;
|
24
|
+
/**
|
25
|
+
* Function to call when the Coachmark closes.
|
26
|
+
*/
|
27
|
+
onClose?: () => void;
|
28
|
+
/**
|
29
|
+
* Optional class name for the Coachmark Overlay component.
|
30
|
+
*/
|
31
|
+
overlayClassName?: string;
|
32
|
+
/**
|
33
|
+
* What kind or style of Coachmark to render.
|
34
|
+
*/
|
35
|
+
overlayKind?: 'tooltip' | 'floating' | 'stacked';
|
36
|
+
overlayRef?: MutableRefObject<HTMLElement | null>;
|
37
|
+
/**
|
38
|
+
* By default, the Coachmark will be appended to the end of `document.body`.
|
39
|
+
* The Coachmark will remain persistent as the user navigates the app until
|
40
|
+
* the user closes the Coachmark.
|
41
|
+
*
|
42
|
+
* Alternatively, the app developer can tightly couple the Coachmark to a DOM
|
43
|
+
* element or other component by specifying a CSS selector. The Coachmark will
|
44
|
+
* remain visible as long as that element remains visible or mounted. When the
|
45
|
+
* element is hidden or component is unmounted, the Coachmark will disappear.
|
46
|
+
*/
|
47
|
+
portalTarget?: string;
|
48
|
+
/**
|
49
|
+
* Fine tune the position of the target in pixels. Applies only to Beacons.
|
50
|
+
*/
|
51
|
+
positionTune?: {
|
52
|
+
x: number;
|
53
|
+
y: number;
|
54
|
+
} | object;
|
55
|
+
/**
|
56
|
+
* The optional button or beacon that the user will click to show the Coachmark.
|
57
|
+
*/
|
58
|
+
target: React.ReactNode;
|
59
|
+
/**
|
60
|
+
* Determines the theme of the component.
|
61
|
+
*/
|
62
|
+
theme?: 'light' | 'dark';
|
63
|
+
}
|
1
64
|
/**
|
2
65
|
* Coachmarks are used to call out specific functionality or concepts
|
3
66
|
* within the UI that may not be intuitive but are important for the
|
4
67
|
* user to gain understanding of the product's main value and discover new use cases.
|
5
68
|
*/
|
6
|
-
export let Coachmark: React.ForwardRefExoticComponent<React.RefAttributes<
|
7
|
-
|
69
|
+
export declare let Coachmark: React.ForwardRefExoticComponent<CoachmarkProps & React.RefAttributes<HTMLElement>>;
|
70
|
+
export {};
|
@@ -8,7 +8,7 @@
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { forwardRef, useState, useRef, useCallback, useEffect } from 'react';
|
10
10
|
import cx from 'classnames';
|
11
|
-
import PropTypes
|
11
|
+
import PropTypes from '../../node_modules/prop-types/index.js';
|
12
12
|
import { createPortal } from 'react-dom';
|
13
13
|
import { CoachmarkOverlay } from './CoachmarkOverlay.js';
|
14
14
|
import { CoachmarkContext } from './utils/context.js';
|
@@ -29,7 +29,6 @@ var defaults = {
|
|
29
29
|
overlayKind: 'tooltip',
|
30
30
|
theme: 'light'
|
31
31
|
};
|
32
|
-
|
33
32
|
/**
|
34
33
|
* Coachmarks are used to call out specific functionality or concepts
|
35
34
|
* within the UI that may not be intuitive but are important for the
|
@@ -177,7 +176,9 @@ var Coachmark = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
177
176
|
onClose: handleClose,
|
178
177
|
theme: theme,
|
179
178
|
className: cx(overlayClassName, "".concat(overlayBlockClass, "--is-visible"))
|
180
|
-
}, children),
|
179
|
+
}, children),
|
180
|
+
// Default to `document.body` when `portalNode` is `null`
|
181
|
+
portalNode || document.body)));
|
181
182
|
});
|
182
183
|
|
183
184
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -218,13 +219,9 @@ Coachmark.propTypes = {
|
|
218
219
|
* What kind or style of Coachmark to render.
|
219
220
|
*/
|
220
221
|
overlayKind: PropTypes.oneOf(['tooltip', 'floating', 'stacked']),
|
221
|
-
overlayRef: PropTypes.
|
222
|
-
|
223
|
-
|
224
|
-
// Or the instance of a DOM native element (see the note about SSR)
|
225
|
-
PropTypes.shape({
|
226
|
-
current: PropTypes.instanceOf(propTypesExports.Component)
|
227
|
-
})]),
|
222
|
+
overlayRef: PropTypes.shape({
|
223
|
+
current: PropTypes.instanceOf(HTMLElement)
|
224
|
+
}),
|
228
225
|
/**
|
229
226
|
* By default, the Coachmark will be appended to the end of `document.body`.
|
230
227
|
* The Coachmark will remain persistent as the user navigates the app until
|
@@ -1,6 +1,44 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2023, 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 from 'react';
|
8
|
+
interface CoachmarkDragbarProps {
|
9
|
+
/**
|
10
|
+
* Handler to manage keyboard interactions with the dragbar.
|
11
|
+
*/
|
12
|
+
a11yKeyboardHandler: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
|
13
|
+
/**
|
14
|
+
* Tooltip text and aria label for the Close button icon.
|
15
|
+
*/
|
16
|
+
closeIconDescription?: string;
|
17
|
+
/**
|
18
|
+
* Function to call when the close button is clicked.
|
19
|
+
*/
|
20
|
+
onClose?: () => void;
|
21
|
+
/**
|
22
|
+
* Function to call when the user clicks and drags the Coachmark.
|
23
|
+
* For internal use only by the parent CoachmarkOverlay.
|
24
|
+
*/
|
25
|
+
onDrag?: (movementX: number, movementY: number) => void;
|
26
|
+
/**
|
27
|
+
* Show/hide the "X" close button.
|
28
|
+
*/
|
29
|
+
showCloseButton?: boolean;
|
30
|
+
/**
|
31
|
+
* Determines the theme of the component.
|
32
|
+
*/
|
33
|
+
theme?: 'light' | 'dark';
|
34
|
+
/**
|
35
|
+
* Additional props passed to the component.
|
36
|
+
*/
|
37
|
+
[key: string]: any;
|
38
|
+
}
|
1
39
|
/**
|
2
40
|
* DO NOT USE. This component is for the exclusive use
|
3
41
|
* of other Novice to Pro components.
|
4
42
|
*/
|
5
|
-
export let CoachmarkDragbar: React.ForwardRefExoticComponent<React.RefAttributes<
|
6
|
-
|
43
|
+
export declare let CoachmarkDragbar: React.ForwardRefExoticComponent<Omit<CoachmarkDragbarProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
44
|
+
export {};
|
@@ -31,7 +31,6 @@ var defaults = {
|
|
31
31
|
showCloseButton: true,
|
32
32
|
theme: 'light'
|
33
33
|
};
|
34
|
-
|
35
34
|
/**
|
36
35
|
* DO NOT USE. This component is for the exclusive use
|
37
36
|
* of other Novice to Pro components.
|
@@ -91,6 +90,9 @@ var CoachmarkDragbar = /*#__PURE__*/React__default.forwardRef(function (_ref, re
|
|
91
90
|
className: "".concat(overlayBlockClass, "__handle"),
|
92
91
|
onMouseDown: handleDragStart,
|
93
92
|
onKeyDown: a11yKeyboardHandler
|
93
|
+
// TODO: i18n
|
94
|
+
,
|
95
|
+
title: "Drag Handle"
|
94
96
|
}, _Draggable || (_Draggable = /*#__PURE__*/React__default.createElement(Draggable, {
|
95
97
|
size: "16"
|
96
98
|
}))), showCloseButton && /*#__PURE__*/React__default.createElement(Button, {
|
@@ -1,6 +1,31 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2023, 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 from 'react';
|
8
|
+
interface CoachmarkHeaderProps {
|
9
|
+
/**
|
10
|
+
* Tooltip text and aria label for the Close button icon.
|
11
|
+
*/
|
12
|
+
closeIconDescription?: string;
|
13
|
+
/**
|
14
|
+
* Function to call when the close button is clicked.
|
15
|
+
*/
|
16
|
+
onClose?: () => void;
|
17
|
+
/**
|
18
|
+
* Show/hide the "X" close button.
|
19
|
+
*/
|
20
|
+
showCloseButton?: boolean;
|
21
|
+
/**
|
22
|
+
* Determines the theme of the component.
|
23
|
+
*/
|
24
|
+
theme?: 'light' | 'dark';
|
25
|
+
}
|
1
26
|
/**
|
2
27
|
* DO NOT USE. This component is for the exclusive use
|
3
28
|
* of other Novice to Pro components.
|
4
29
|
*/
|
5
|
-
export let CoachmarkHeader: React.ForwardRefExoticComponent<React.RefAttributes<
|
6
|
-
|
30
|
+
export declare let CoachmarkHeader: React.ForwardRefExoticComponent<CoachmarkHeaderProps & React.RefAttributes<HTMLElement>>;
|
31
|
+
export {};
|
@@ -1,6 +1,46 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2023, 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, { ReactNode } from 'react';
|
8
|
+
import { COACHMARK_OVERLAY_KIND } from './utils/enums';
|
9
|
+
interface CoachmarkOverlayProps {
|
10
|
+
/**
|
11
|
+
* The CoachmarkOverlayElements child components.
|
12
|
+
* Validation is handled in the parent Coachmark component.
|
13
|
+
*/
|
14
|
+
children: ReactNode;
|
15
|
+
/**
|
16
|
+
* Optional class name for this component.
|
17
|
+
*/
|
18
|
+
className?: string;
|
19
|
+
/**
|
20
|
+
* The visibility of CoachmarkOverlay is
|
21
|
+
* managed in the parent Coachmark component.
|
22
|
+
*/
|
23
|
+
fixedIsVisible: boolean;
|
24
|
+
/**
|
25
|
+
* What kind or style of Coachmark to render.
|
26
|
+
*/
|
27
|
+
kind?: COACHMARK_OVERLAY_KIND;
|
28
|
+
/**
|
29
|
+
* Function to call when the Coachmark closes.
|
30
|
+
*/
|
31
|
+
onClose: () => void;
|
32
|
+
/**
|
33
|
+
* Determines the theme of the component.
|
34
|
+
*/
|
35
|
+
theme?: 'light' | 'dark';
|
36
|
+
/**
|
37
|
+
* Additional props passed to the component.
|
38
|
+
*/
|
39
|
+
[key: string]: any;
|
40
|
+
}
|
1
41
|
/**
|
2
42
|
* DO NOT USE. This component is for the exclusive use
|
3
43
|
* of other Novice to Pro components.
|
4
44
|
*/
|
5
|
-
export let CoachmarkOverlay: React.ForwardRefExoticComponent<React.RefAttributes<
|
6
|
-
|
45
|
+
export declare let CoachmarkOverlay: React.ForwardRefExoticComponent<Omit<CoachmarkOverlayProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
46
|
+
export {};
|
@@ -30,7 +30,6 @@ var defaults = {
|
|
30
30
|
kind: COACHMARK_OVERLAY_KIND.FLOATING,
|
31
31
|
theme: 'light'
|
32
32
|
};
|
33
|
-
|
34
33
|
/**
|
35
34
|
* DO NOT USE. This component is for the exclusive use
|
36
35
|
* of other Novice to Pro components.
|
@@ -52,7 +51,7 @@ var CoachmarkOverlay = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
52
51
|
_useState2 = _slicedToArray(_useState, 2),
|
53
52
|
a11yDragMode = _useState2[0],
|
54
53
|
setA11yDragMode = _useState2[1];
|
55
|
-
var overlayRef = useRef();
|
54
|
+
var overlayRef = useRef(null);
|
56
55
|
var coachmark = useCoachmark();
|
57
56
|
var isBeacon = kind === COACHMARK_OVERLAY_KIND.TOOLTIP;
|
58
57
|
var isDraggable = kind === COACHMARK_OVERLAY_KIND.FLOATING;
|
@@ -85,20 +84,21 @@ var CoachmarkOverlay = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
85
84
|
var styledTune = {};
|
86
85
|
if (isBeacon || isDraggable) {
|
87
86
|
if (coachmark.targetRect) {
|
88
|
-
styledTune =
|
89
|
-
|
90
|
-
top: coachmark.targetRect.y + window.scrollY
|
91
|
-
};
|
87
|
+
styledTune.left = coachmark.targetRect.x + window.scrollX;
|
88
|
+
styledTune.top = coachmark.targetRect.y + window.scrollY;
|
92
89
|
}
|
93
|
-
if (
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
90
|
+
if (styledTune.left && styledTune.top) {
|
91
|
+
if (isBeacon) {
|
92
|
+
// Compensate for radius of beacon
|
93
|
+
styledTune.left += 16;
|
94
|
+
styledTune.top += 16;
|
95
|
+
}
|
96
|
+
if (isDraggable) {
|
97
|
+
// Compensate for width and height of target element
|
98
|
+
var offsetTune = getOffsetTune(coachmark, kind);
|
99
|
+
styledTune.left += offsetTune.left;
|
100
|
+
styledTune.top += offsetTune.top;
|
101
|
+
}
|
102
102
|
}
|
103
103
|
}
|
104
104
|
function handleDragBounds(x, y) {
|
@@ -123,6 +123,9 @@ var CoachmarkOverlay = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
123
123
|
}
|
124
124
|
function handleDrag(movementX, movementY) {
|
125
125
|
var overlay = overlayRef.current;
|
126
|
+
if (!overlay) {
|
127
|
+
return;
|
128
|
+
}
|
126
129
|
var _overlay$getBoundingC = overlay.getBoundingClientRect(),
|
127
130
|
x = _overlay$getBoundingC.x,
|
128
131
|
y = _overlay$getBoundingC.y;
|
@@ -1,6 +1,31 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2023, 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 from 'react';
|
8
|
+
interface CoachmarkTaglineProps {
|
9
|
+
/**
|
10
|
+
* Tooltip text and aria label for the Close button icon.
|
11
|
+
*/
|
12
|
+
closeIconDescription?: string;
|
13
|
+
/**
|
14
|
+
* Function to call when the close button is clicked.
|
15
|
+
*/
|
16
|
+
onClose?: () => void;
|
17
|
+
/**
|
18
|
+
* Determines the theme of the component.
|
19
|
+
*/
|
20
|
+
theme?: 'light' | 'dark';
|
21
|
+
/**
|
22
|
+
* The title of the tagline.
|
23
|
+
*/
|
24
|
+
title: string;
|
25
|
+
}
|
1
26
|
/**
|
2
27
|
* DO NOT USE. This component is for the exclusive use
|
3
28
|
* of other Novice to Pro components.
|
4
29
|
*/
|
5
|
-
export let CoachmarkTagline: React.ForwardRefExoticComponent<React.RefAttributes<
|
6
|
-
|
30
|
+
export declare let CoachmarkTagline: React.ForwardRefExoticComponent<CoachmarkTaglineProps & React.RefAttributes<HTMLDivElement>>;
|
31
|
+
export {};
|
@@ -11,27 +11,27 @@ export declare enum BEACON_KIND {
|
|
11
11
|
* @param FIXED is fixed to the bottom-right of the viewport.
|
12
12
|
* @param STACKED is fixed to the bottom-right of the viewport, includes links to show more, stackable Coachmarks if included.
|
13
13
|
*/
|
14
|
-
export declare
|
15
|
-
TOOLTIP
|
16
|
-
FLOATING
|
17
|
-
FIXED
|
18
|
-
STACKED
|
19
|
-
}
|
14
|
+
export declare enum COACHMARK_OVERLAY_KIND {
|
15
|
+
TOOLTIP = "tooltip",
|
16
|
+
FLOATING = "floating",
|
17
|
+
FIXED = "fixed",
|
18
|
+
STACKED = "stacked"
|
19
|
+
}
|
20
20
|
/**
|
21
21
|
* Where to render the Coachmark relative to its target.
|
22
22
|
* Applies only to Floating and Tooltip Coachmarks.
|
23
23
|
*/
|
24
|
-
export declare
|
25
|
-
BOTTOM
|
26
|
-
BOTTOM_LEFT
|
27
|
-
BOTTOM_RIGHT
|
28
|
-
LEFT
|
29
|
-
LEFT_TOP
|
30
|
-
LEFT_BOTTOM
|
31
|
-
RIGHT
|
32
|
-
RIGHT_TOP
|
33
|
-
RIGHT_BOTTOM
|
34
|
-
TOP
|
35
|
-
TOP_LEFT
|
36
|
-
TOP_RIGHT
|
37
|
-
}
|
24
|
+
export declare enum COACHMARK_ALIGNMENT {
|
25
|
+
BOTTOM = "bottom",
|
26
|
+
BOTTOM_LEFT = "bottom-left",
|
27
|
+
BOTTOM_RIGHT = "bottom-right",
|
28
|
+
LEFT = "left",
|
29
|
+
LEFT_TOP = "left-top",
|
30
|
+
LEFT_BOTTOM = "left-bottom",
|
31
|
+
RIGHT = "right",
|
32
|
+
RIGHT_TOP = "right-top",
|
33
|
+
RIGHT_BOTTOM = "right-bottom",
|
34
|
+
TOP = "top",
|
35
|
+
TOP_LEFT = "top-left",
|
36
|
+
TOP_RIGHT = "top-right"
|
37
|
+
}
|
@@ -14,29 +14,31 @@
|
|
14
14
|
* @param FIXED is fixed to the bottom-right of the viewport.
|
15
15
|
* @param STACKED is fixed to the bottom-right of the viewport, includes links to show more, stackable Coachmarks if included.
|
16
16
|
*/
|
17
|
-
var COACHMARK_OVERLAY_KIND = {
|
18
|
-
TOOLTIP
|
19
|
-
FLOATING
|
20
|
-
FIXED
|
21
|
-
STACKED
|
22
|
-
|
17
|
+
var COACHMARK_OVERLAY_KIND = /*#__PURE__*/function (COACHMARK_OVERLAY_KIND) {
|
18
|
+
COACHMARK_OVERLAY_KIND["TOOLTIP"] = "tooltip";
|
19
|
+
COACHMARK_OVERLAY_KIND["FLOATING"] = "floating";
|
20
|
+
COACHMARK_OVERLAY_KIND["FIXED"] = "fixed";
|
21
|
+
COACHMARK_OVERLAY_KIND["STACKED"] = "stacked";
|
22
|
+
return COACHMARK_OVERLAY_KIND;
|
23
|
+
}({});
|
23
24
|
/**
|
24
25
|
* Where to render the Coachmark relative to its target.
|
25
26
|
* Applies only to Floating and Tooltip Coachmarks.
|
26
27
|
*/
|
27
|
-
var COACHMARK_ALIGNMENT = {
|
28
|
-
BOTTOM
|
29
|
-
BOTTOM_LEFT
|
30
|
-
BOTTOM_RIGHT
|
31
|
-
LEFT
|
32
|
-
LEFT_TOP
|
33
|
-
LEFT_BOTTOM
|
34
|
-
RIGHT
|
35
|
-
RIGHT_TOP
|
36
|
-
RIGHT_BOTTOM
|
37
|
-
TOP
|
38
|
-
TOP_LEFT
|
39
|
-
TOP_RIGHT
|
40
|
-
|
28
|
+
var COACHMARK_ALIGNMENT = /*#__PURE__*/function (COACHMARK_ALIGNMENT) {
|
29
|
+
COACHMARK_ALIGNMENT["BOTTOM"] = "bottom";
|
30
|
+
COACHMARK_ALIGNMENT["BOTTOM_LEFT"] = "bottom-left";
|
31
|
+
COACHMARK_ALIGNMENT["BOTTOM_RIGHT"] = "bottom-right";
|
32
|
+
COACHMARK_ALIGNMENT["LEFT"] = "left";
|
33
|
+
COACHMARK_ALIGNMENT["LEFT_TOP"] = "left-top";
|
34
|
+
COACHMARK_ALIGNMENT["LEFT_BOTTOM"] = "left-bottom";
|
35
|
+
COACHMARK_ALIGNMENT["RIGHT"] = "right";
|
36
|
+
COACHMARK_ALIGNMENT["RIGHT_TOP"] = "right-top";
|
37
|
+
COACHMARK_ALIGNMENT["RIGHT_BOTTOM"] = "right-bottom";
|
38
|
+
COACHMARK_ALIGNMENT["TOP"] = "top";
|
39
|
+
COACHMARK_ALIGNMENT["TOP_LEFT"] = "top-left";
|
40
|
+
COACHMARK_ALIGNMENT["TOP_RIGHT"] = "top-right";
|
41
|
+
return COACHMARK_ALIGNMENT;
|
42
|
+
}({});
|
41
43
|
|
42
44
|
export { COACHMARK_ALIGNMENT, COACHMARK_OVERLAY_KIND };
|
@@ -1,5 +1,22 @@
|
|
1
1
|
/**
|
2
|
-
*
|
2
|
+
* Copyright IBM Corp. 2023, 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.
|
3
6
|
*/
|
4
|
-
export let CoachmarkButton: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
5
7
|
import React from 'react';
|
8
|
+
interface CoachmarkButtonProps {
|
9
|
+
/**
|
10
|
+
* Provide an optional class to be applied to the containing node.
|
11
|
+
*/
|
12
|
+
className?: string;
|
13
|
+
/**
|
14
|
+
* The aria label.
|
15
|
+
*/
|
16
|
+
label: string;
|
17
|
+
}
|
18
|
+
/**
|
19
|
+
* Use CoachmarkButton for the target prop of a Coachmark component.
|
20
|
+
*/
|
21
|
+
export declare let CoachmarkButton: React.ForwardRefExoticComponent<CoachmarkButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
22
|
+
export {};
|
@@ -1,8 +1,48 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2023, 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, { ReactNode } from 'react';
|
8
|
+
interface CoachmarkFixedProps {
|
9
|
+
/**
|
10
|
+
* CoachmarkFixed should use a single CoachmarkOverlayElements component as a child.
|
11
|
+
*/
|
12
|
+
children: ReactNode;
|
13
|
+
/**
|
14
|
+
* Optional class name for this component.
|
15
|
+
*/
|
16
|
+
className?: string;
|
17
|
+
/**
|
18
|
+
* Function to call when the Coachmark closes.
|
19
|
+
*/
|
20
|
+
onClose?: () => void;
|
21
|
+
/**
|
22
|
+
* By default, the Coachmark will be appended to the end of `document.body`.
|
23
|
+
* The Coachmark will remain persistent as the user navigates the app until
|
24
|
+
* the user closes the Coachmark.
|
25
|
+
*
|
26
|
+
* Alternatively, the app developer can tightly couple the Coachmark to a DOM
|
27
|
+
* element or other component by specifying a CSS selector. The Coachmark will
|
28
|
+
* remain visible as long as that element remains visible or mounted. When the
|
29
|
+
* element is hidden or component is unmounted, the Coachmark will disappear.
|
30
|
+
*/
|
31
|
+
portalTarget?: string;
|
32
|
+
/**
|
33
|
+
* The tagline title which will be fixed to the bottom right of the window and will serve as the display trigger.
|
34
|
+
*/
|
35
|
+
tagline: string;
|
36
|
+
/**
|
37
|
+
* Determines the theme of the component.
|
38
|
+
*/
|
39
|
+
theme?: 'light' | 'dark';
|
40
|
+
}
|
1
41
|
/**
|
2
42
|
* Fixed coachmarks are used to call out specific functionality or concepts
|
3
43
|
* within the UI that may not be intuitive but are important for the
|
4
44
|
* user to gain understanding of the product's main value and discover new use cases.
|
5
45
|
* This variant allows the a coachmark overlay to be displayed by interacting with the tagline.
|
6
46
|
*/
|
7
|
-
export let CoachmarkFixed: React.ForwardRefExoticComponent<React.RefAttributes<
|
8
|
-
|
47
|
+
export declare let CoachmarkFixed: React.ForwardRefExoticComponent<CoachmarkFixedProps & React.RefAttributes<HTMLDivElement>>;
|
48
|
+
export {};
|
@@ -50,7 +50,7 @@ var CoachmarkFixed = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
50
50
|
_ref$theme = _ref.theme,
|
51
51
|
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
52
52
|
rest = _objectWithoutProperties(_ref, _excluded);
|
53
|
-
var overlayRef = useRef();
|
53
|
+
var overlayRef = useRef(null);
|
54
54
|
var portalNode = portalTarget ? (_document$querySelect = document.querySelector(portalTarget)) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.querySelector('body') : document.querySelector('body');
|
55
55
|
var _useState = useState(false),
|
56
56
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -172,7 +172,9 @@ var CoachmarkFixed = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
172
172
|
onTransitionEnd: handleTransitionEnd,
|
173
173
|
theme: theme,
|
174
174
|
className: cx(fixedIsVisible && "".concat(overlayBlockClass, "--is-visible"), overlayBlockClass)
|
175
|
-
}, children),
|
175
|
+
}, children),
|
176
|
+
// Default to `document.body` when `portalNode` is `null`
|
177
|
+
portalNode || document.body)));
|
176
178
|
});
|
177
179
|
|
178
180
|
// Return a placeholder if not released and not enabled by feature flag
|