@carbon/ibm-products 2.38.0-alpha.5 → 2.38.0
Sign up to get free protection for your applications and to get access to all the features.
- 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.css +218 -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/Checklist/Checklist.js +10 -10
- package/es/components/Checklist/ChecklistChart.d.ts +1 -1
- package/es/components/Checklist/ChecklistChart.js +6 -30
- 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/CoachmarkFixed/CoachmarkFixed.d.ts +42 -2
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +4 -2
- 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/DataSpreadsheet/DataSpreadsheetBody.js +14 -8
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -2
- package/es/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -1
- package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.d.ts +19 -2
- package/es/components/SearchBar/SearchBar.d.ts +10 -1
- package/es/components/SearchBar/SearchBar.js +26 -20
- 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/global/js/package-settings.d.ts +1 -1
- package/es/global/js/package-settings.js +1 -1
- package/es/node_modules/@carbon/colors/es/index.js +4 -1
- package/es/settings.d.ts +1 -1
- package/lib/components/ActionSet/ActionSet.js +2 -1
- package/lib/components/Checklist/Checklist.js +10 -10
- package/lib/components/Checklist/ChecklistChart.d.ts +1 -1
- package/lib/components/Checklist/ChecklistChart.js +6 -30
- 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/CoachmarkFixed/CoachmarkFixed.d.ts +42 -2
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +4 -2
- 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/DataSpreadsheet/DataSpreadsheetBody.js +13 -7
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -2
- package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -1
- package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.d.ts +19 -2
- package/lib/components/SearchBar/SearchBar.d.ts +10 -1
- package/lib/components/SearchBar/SearchBar.js +26 -18
- 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/global/js/package-settings.d.ts +1 -1
- package/lib/global/js/package-settings.js +1 -1
- package/lib/node_modules/@carbon/colors/es/index.js +6 -0
- package/lib/settings.d.ts +1 -1
- package/package.json +3 -3
- package/scss/components/Checklist/_carbon-imports.scss +2 -2
- 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 +1 -0
- package/telemetry.yml +5 -8
@@ -9,37 +9,20 @@ import { objectWithoutProperties as _objectWithoutProperties, extends as _extend
|
|
9
9
|
import React__default from 'react';
|
10
10
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
11
11
|
import cx from 'classnames';
|
12
|
+
import clamp from 'lodash/clamp';
|
13
|
+
import { gray20, gray70, purple50 } from '../../node_modules/@carbon/colors/es/index.js';
|
12
14
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
13
15
|
import { pkg } from '../../settings.js';
|
14
|
-
import clamp from 'lodash/clamp';
|
15
16
|
|
16
17
|
var _excluded = ["className", "value", "theme"];
|
17
|
-
|
18
|
-
// Carbon and package components we use.
|
19
|
-
/* TODO: @import(s) of carbon components and other package components. */
|
20
|
-
|
21
|
-
// The block part of our conventional BEM class names (blockClass__E--M).
|
22
18
|
var blockClass = "".concat(pkg.prefix, "--checklist__chart");
|
23
19
|
var componentName = 'ChecklistChart';
|
24
|
-
|
25
|
-
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
26
|
-
|
27
|
-
// Default values can be included here and then assigned to the prop params,
|
28
|
-
// e.g. prop = defaults.prop,
|
29
|
-
// This gathers default values together neatly and ensures non-primitive
|
30
|
-
// values are initialized early to avoid react making unnecessary re-renders.
|
31
|
-
// Note that default values are not required for props that are 'required',
|
32
|
-
// nor for props where the component can apply undefined values reasonably.
|
33
|
-
// Default values should be provided when the component needs to make a choice
|
34
|
-
// or assumption when a prop is not supplied.
|
35
|
-
|
36
|
-
// Default values for props
|
37
20
|
var defaults = {
|
38
21
|
theme: 'light'
|
39
22
|
};
|
40
23
|
|
41
24
|
/**
|
42
|
-
*
|
25
|
+
* Custom chart component used within Checklist PLG component
|
43
26
|
*/
|
44
27
|
var ChecklistChart = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
45
28
|
var className = _ref.className,
|
@@ -48,9 +31,8 @@ var ChecklistChart = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
48
31
|
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
49
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
50
33
|
var numDegrees = clamp(value * 360, 0, 360);
|
51
|
-
var circleColor = theme === 'light' ?
|
52
|
-
var progressColor =
|
53
|
-
|
34
|
+
var circleColor = theme === 'light' ? gray20 : gray70; // $ui-03 (-ish)
|
35
|
+
var progressColor = purple50;
|
54
36
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
55
37
|
className: cx(blockClass, className),
|
56
38
|
style: {
|
@@ -61,13 +43,7 @@ var ChecklistChart = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
61
43
|
role: "img"
|
62
44
|
}, getDevtoolsProps(componentName)));
|
63
45
|
});
|
64
|
-
|
65
|
-
// Return a placeholder if not released and not enabled by feature flag
|
66
|
-
// ChecklistChart = pkg.checkComponentEnabled(ChecklistChart, componentName);
|
67
|
-
|
68
|
-
// The display name of the component, used by React. Note that displayName
|
69
|
-
// is used in preference to relying on function.name.
|
70
|
-
// ChecklistChart.displayName = componentName;
|
46
|
+
ChecklistChart.displayName = componentName;
|
71
47
|
|
72
48
|
// The types and DocGen commentary for the component props,
|
73
49
|
// in alphabetical order (for consistency).
|
@@ -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,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
|
@@ -7,15 +7,16 @@ declare namespace ConditionBlock {
|
|
7
7
|
namespace propTypes {
|
8
8
|
let addConditionHandler: PropTypes.Requireable<(...args: any[]) => any>;
|
9
9
|
let aria: PropTypes.Requireable<object>;
|
10
|
+
let condition: PropTypes.Requireable<object>;
|
10
11
|
let conditionIndex: PropTypes.Requireable<number>;
|
11
12
|
let conjunction: PropTypes.Requireable<string>;
|
12
13
|
let group: PropTypes.Requireable<object>;
|
14
|
+
let isLastCondition: PropTypes.Requireable<(...args: any[]) => any>;
|
13
15
|
let isStatement: PropTypes.Requireable<boolean>;
|
14
16
|
let onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
15
17
|
let onConnectorOperatorChange: PropTypes.Requireable<(...args: any[]) => any>;
|
16
18
|
let onRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
17
19
|
let onStatementChange: PropTypes.Requireable<(...args: any[]) => any>;
|
18
|
-
let state: PropTypes.Requireable<object>;
|
19
20
|
}
|
20
21
|
}
|
21
22
|
import PropTypes from 'prop-types';
|