@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
@@ -11,11 +11,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
13
13
|
var React = require('react');
|
14
|
-
var index = require('../../node_modules/prop-types/index.js');
|
14
|
+
var index$1 = require('../../node_modules/prop-types/index.js');
|
15
15
|
var cx = require('classnames');
|
16
|
+
var clamp = require('lodash/clamp');
|
17
|
+
var index = require('../../node_modules/@carbon/colors/es/index.js');
|
16
18
|
var devtools = require('../../global/js/utils/devtools.js');
|
17
19
|
var settings = require('../../settings.js');
|
18
|
-
var
|
20
|
+
var Checklist_types = require('./Checklist.types.js');
|
19
21
|
|
20
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
21
23
|
|
@@ -24,43 +26,28 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
26
|
var clamp__default = /*#__PURE__*/_interopDefaultLegacy(clamp);
|
25
27
|
|
26
28
|
var _excluded = ["className", "value", "theme"];
|
27
|
-
|
28
|
-
// Carbon and package components we use.
|
29
|
-
/* TODO: @import(s) of carbon components and other package components. */
|
30
|
-
|
31
|
-
// The block part of our conventional BEM class names (blockClass__E--M).
|
32
29
|
var blockClass = "".concat(settings.pkg.prefix, "--checklist__chart");
|
33
30
|
var componentName = 'ChecklistChart';
|
34
|
-
|
35
|
-
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
36
|
-
|
37
|
-
// Default values can be included here and then assigned to the prop params,
|
38
|
-
// e.g. prop = defaults.prop,
|
39
|
-
// This gathers default values together neatly and ensures non-primitive
|
40
|
-
// values are initialized early to avoid react making unnecessary re-renders.
|
41
|
-
// Note that default values are not required for props that are 'required',
|
42
|
-
// nor for props where the component can apply undefined values reasonably.
|
43
|
-
// Default values should be provided when the component needs to make a choice
|
44
|
-
// or assumption when a prop is not supplied.
|
45
|
-
|
46
|
-
// Default values for props
|
47
31
|
var defaults = {
|
48
|
-
theme:
|
32
|
+
theme: Checklist_types.Themes.light
|
49
33
|
};
|
50
34
|
|
51
35
|
/**
|
52
|
-
*
|
36
|
+
* Custom chart component used within Checklist PLG component
|
37
|
+
*/
|
38
|
+
var ChecklistChart = /*#__PURE__*/React__default["default"].forwardRef(
|
39
|
+
/**
|
40
|
+
* @param {{className?: string, value: number, theme?: import('./Checklist.types').Theme}} props type description
|
53
41
|
*/
|
54
|
-
|
42
|
+
function (_ref, ref) {
|
55
43
|
var className = _ref.className,
|
56
44
|
value = _ref.value,
|
57
45
|
_ref$theme = _ref.theme,
|
58
46
|
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
59
47
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
60
48
|
var numDegrees = clamp__default["default"](value * 360, 0, 360);
|
61
|
-
var circleColor = theme ===
|
62
|
-
var progressColor =
|
63
|
-
|
49
|
+
var circleColor = theme === Checklist_types.Themes.light ? index.gray20 : index.gray70; // $ui-03 (-ish)
|
50
|
+
var progressColor = index.purple50;
|
64
51
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
65
52
|
className: cx__default["default"](blockClass, className),
|
66
53
|
style: {
|
@@ -71,13 +58,7 @@ var ChecklistChart = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
71
58
|
role: "img"
|
72
59
|
}, devtools.getDevtoolsProps(componentName)));
|
73
60
|
});
|
74
|
-
|
75
|
-
// Return a placeholder if not released and not enabled by feature flag
|
76
|
-
// ChecklistChart = pkg.checkComponentEnabled(ChecklistChart, componentName);
|
77
|
-
|
78
|
-
// The display name of the component, used by React. Note that displayName
|
79
|
-
// is used in preference to relying on function.name.
|
80
|
-
// ChecklistChart.displayName = componentName;
|
61
|
+
ChecklistChart.displayName = componentName;
|
81
62
|
|
82
63
|
// The types and DocGen commentary for the component props,
|
83
64
|
// in alphabetical order (for consistency).
|
@@ -86,15 +67,15 @@ ChecklistChart.propTypes = {
|
|
86
67
|
/**
|
87
68
|
* Optional class name for this component.
|
88
69
|
*/
|
89
|
-
className: index["default"].string,
|
70
|
+
className: index$1["default"].string,
|
90
71
|
/**
|
91
72
|
* Determines the theme of the component.
|
92
73
|
*/
|
93
|
-
theme: index["default"].oneOf([
|
74
|
+
theme: index$1["default"].oneOf([Checklist_types.Themes.light, Checklist_types.Themes.dark]),
|
94
75
|
/**
|
95
76
|
* Number between 0 and 1.
|
96
77
|
*/
|
97
|
-
value: index["default"].number.isRequired
|
78
|
+
value: index$1["default"].number.isRequired
|
98
79
|
};
|
99
80
|
|
100
81
|
exports.ChecklistChart = ChecklistChart;
|
@@ -1,5 +1,9 @@
|
|
1
1
|
/**
|
2
2
|
* TODO: A description of the component.
|
3
3
|
*/
|
4
|
-
export let ChecklistIcon: React.ForwardRefExoticComponent<
|
4
|
+
export let ChecklistIcon: React.ForwardRefExoticComponent<{
|
5
|
+
className?: string | undefined;
|
6
|
+
kind?: import("./Checklist.types").Kind | undefined;
|
7
|
+
theme?: import("./Checklist.types").Theme | undefined;
|
8
|
+
} & React.RefAttributes<any>>;
|
5
9
|
import React from 'react';
|
@@ -16,6 +16,7 @@ var cx = require('classnames');
|
|
16
16
|
var devtools = require('../../global/js/utils/devtools.js');
|
17
17
|
var settings = require('../../settings.js');
|
18
18
|
var icons = require('@carbon/react/icons');
|
19
|
+
var Checklist_types = require('./Checklist.types.js');
|
19
20
|
|
20
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
21
22
|
|
@@ -41,13 +42,17 @@ var componentName = 'ChecklistIcon';
|
|
41
42
|
|
42
43
|
// Default values for props
|
43
44
|
var defaults = {
|
44
|
-
theme:
|
45
|
+
theme: Checklist_types.Themes.light
|
45
46
|
};
|
46
47
|
|
47
48
|
/**
|
48
49
|
* TODO: A description of the component.
|
49
50
|
*/
|
50
|
-
var ChecklistIcon = /*#__PURE__*/React__default["default"].forwardRef(
|
51
|
+
var ChecklistIcon = /*#__PURE__*/React__default["default"].forwardRef(
|
52
|
+
/**
|
53
|
+
* @param {{className?: string, kind?: import('./Checklist.types').Kind, theme?: import('./Checklist.types').Theme}} props type description
|
54
|
+
*/
|
55
|
+
function (_ref, ref) {
|
51
56
|
var className = _ref.className,
|
52
57
|
kind = _ref.kind,
|
53
58
|
_ref$theme = _ref.theme,
|
@@ -95,11 +100,11 @@ ChecklistIcon.propTypes = {
|
|
95
100
|
/**
|
96
101
|
* The icon to be displayed.
|
97
102
|
*/
|
98
|
-
kind: index["default"].oneOf([
|
103
|
+
kind: index["default"].oneOf([Checklist_types.Kinds.unchecked, Checklist_types.Kinds.indeterminate, Checklist_types.Kinds.checked, Checklist_types.Kinds.disabled, Checklist_types.Kinds.error]),
|
99
104
|
/**
|
100
105
|
* Determines the theme of the component.
|
101
106
|
*/
|
102
|
-
theme: index["default"].oneOf([
|
107
|
+
theme: index["default"].oneOf([Checklist_types.Themes.light, Checklist_types.Themes.dark])
|
103
108
|
};
|
104
109
|
|
105
110
|
exports.ChecklistIcon = 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 {};
|
@@ -38,7 +38,6 @@ var defaults = {
|
|
38
38
|
overlayKind: 'tooltip',
|
39
39
|
theme: 'light'
|
40
40
|
};
|
41
|
-
|
42
41
|
/**
|
43
42
|
* Coachmarks are used to call out specific functionality or concepts
|
44
43
|
* within the UI that may not be intuitive but are important for the
|
@@ -186,7 +185,9 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
186
185
|
onClose: handleClose,
|
187
186
|
theme: theme,
|
188
187
|
className: cx__default["default"](overlayClassName, "".concat(overlayBlockClass, "--is-visible"))
|
189
|
-
}, children),
|
188
|
+
}, children),
|
189
|
+
// Default to `document.body` when `portalNode` is `null`
|
190
|
+
portalNode || document.body)));
|
190
191
|
});
|
191
192
|
|
192
193
|
// Return a placeholder if not released and not enabled by feature flag
|
@@ -227,13 +228,9 @@ exports.Coachmark.propTypes = {
|
|
227
228
|
* What kind or style of Coachmark to render.
|
228
229
|
*/
|
229
230
|
overlayKind: index["default"].oneOf(['tooltip', 'floating', 'stacked']),
|
230
|
-
overlayRef: index["default"].
|
231
|
-
|
232
|
-
|
233
|
-
// Or the instance of a DOM native element (see the note about SSR)
|
234
|
-
index["default"].shape({
|
235
|
-
current: index["default"].instanceOf(index.propTypesExports.Component)
|
236
|
-
})]),
|
231
|
+
overlayRef: index["default"].shape({
|
232
|
+
current: index["default"].instanceOf(HTMLElement)
|
233
|
+
}),
|
237
234
|
/**
|
238
235
|
* By default, the Coachmark will be appended to the end of `document.body`.
|
239
236
|
* 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 {};
|
@@ -40,7 +40,6 @@ var defaults = {
|
|
40
40
|
showCloseButton: true,
|
41
41
|
theme: 'light'
|
42
42
|
};
|
43
|
-
|
44
43
|
/**
|
45
44
|
* DO NOT USE. This component is for the exclusive use
|
46
45
|
* of other Novice to Pro components.
|
@@ -100,6 +99,9 @@ exports.CoachmarkDragbar = /*#__PURE__*/React__default["default"].forwardRef(fun
|
|
100
99
|
className: "".concat(overlayBlockClass, "__handle"),
|
101
100
|
onMouseDown: handleDragStart,
|
102
101
|
onKeyDown: a11yKeyboardHandler
|
102
|
+
// TODO: i18n
|
103
|
+
,
|
104
|
+
title: "Drag Handle"
|
103
105
|
}, _Draggable || (_Draggable = /*#__PURE__*/React__default["default"].createElement(icons.Draggable, {
|
104
106
|
size: "16"
|
105
107
|
}))), showCloseButton && /*#__PURE__*/React__default["default"].createElement(react.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 {};
|
@@ -39,7 +39,6 @@ var defaults = {
|
|
39
39
|
kind: enums.COACHMARK_OVERLAY_KIND.FLOATING,
|
40
40
|
theme: 'light'
|
41
41
|
};
|
42
|
-
|
43
42
|
/**
|
44
43
|
* DO NOT USE. This component is for the exclusive use
|
45
44
|
* of other Novice to Pro components.
|
@@ -61,7 +60,7 @@ exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
61
60
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
62
61
|
a11yDragMode = _useState2[0],
|
63
62
|
setA11yDragMode = _useState2[1];
|
64
|
-
var overlayRef = React.useRef();
|
63
|
+
var overlayRef = React.useRef(null);
|
65
64
|
var coachmark = context.useCoachmark();
|
66
65
|
var isBeacon = kind === enums.COACHMARK_OVERLAY_KIND.TOOLTIP;
|
67
66
|
var isDraggable = kind === enums.COACHMARK_OVERLAY_KIND.FLOATING;
|
@@ -94,20 +93,21 @@ exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
94
93
|
var styledTune = {};
|
95
94
|
if (isBeacon || isDraggable) {
|
96
95
|
if (coachmark.targetRect) {
|
97
|
-
styledTune =
|
98
|
-
|
99
|
-
top: coachmark.targetRect.y + window.scrollY
|
100
|
-
};
|
96
|
+
styledTune.left = coachmark.targetRect.x + window.scrollX;
|
97
|
+
styledTune.top = coachmark.targetRect.y + window.scrollY;
|
101
98
|
}
|
102
|
-
if (
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
99
|
+
if (styledTune.left && styledTune.top) {
|
100
|
+
if (isBeacon) {
|
101
|
+
// Compensate for radius of beacon
|
102
|
+
styledTune.left += 16;
|
103
|
+
styledTune.top += 16;
|
104
|
+
}
|
105
|
+
if (isDraggable) {
|
106
|
+
// Compensate for width and height of target element
|
107
|
+
var offsetTune = constants.getOffsetTune(coachmark, kind);
|
108
|
+
styledTune.left += offsetTune.left;
|
109
|
+
styledTune.top += offsetTune.top;
|
110
|
+
}
|
111
111
|
}
|
112
112
|
}
|
113
113
|
function handleDragBounds(x, y) {
|
@@ -132,6 +132,9 @@ exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
132
132
|
}
|
133
133
|
function handleDrag(movementX, movementY) {
|
134
134
|
var overlay = overlayRef.current;
|
135
|
+
if (!overlay) {
|
136
|
+
return;
|
137
|
+
}
|
135
138
|
var _overlay$getBoundingC = overlay.getBoundingClientRect(),
|
136
139
|
x = _overlay$getBoundingC.x,
|
137
140
|
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
|
+
}
|
@@ -18,30 +18,32 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
18
18
|
* @param FIXED is fixed to the bottom-right of the viewport.
|
19
19
|
* @param STACKED is fixed to the bottom-right of the viewport, includes links to show more, stackable Coachmarks if included.
|
20
20
|
*/
|
21
|
-
var COACHMARK_OVERLAY_KIND = {
|
22
|
-
TOOLTIP
|
23
|
-
FLOATING
|
24
|
-
FIXED
|
25
|
-
STACKED
|
26
|
-
|
21
|
+
var COACHMARK_OVERLAY_KIND = /*#__PURE__*/function (COACHMARK_OVERLAY_KIND) {
|
22
|
+
COACHMARK_OVERLAY_KIND["TOOLTIP"] = "tooltip";
|
23
|
+
COACHMARK_OVERLAY_KIND["FLOATING"] = "floating";
|
24
|
+
COACHMARK_OVERLAY_KIND["FIXED"] = "fixed";
|
25
|
+
COACHMARK_OVERLAY_KIND["STACKED"] = "stacked";
|
26
|
+
return COACHMARK_OVERLAY_KIND;
|
27
|
+
}({});
|
27
28
|
/**
|
28
29
|
* Where to render the Coachmark relative to its target.
|
29
30
|
* Applies only to Floating and Tooltip Coachmarks.
|
30
31
|
*/
|
31
|
-
var COACHMARK_ALIGNMENT = {
|
32
|
-
BOTTOM
|
33
|
-
BOTTOM_LEFT
|
34
|
-
BOTTOM_RIGHT
|
35
|
-
LEFT
|
36
|
-
LEFT_TOP
|
37
|
-
LEFT_BOTTOM
|
38
|
-
RIGHT
|
39
|
-
RIGHT_TOP
|
40
|
-
RIGHT_BOTTOM
|
41
|
-
TOP
|
42
|
-
TOP_LEFT
|
43
|
-
TOP_RIGHT
|
44
|
-
|
32
|
+
var COACHMARK_ALIGNMENT = /*#__PURE__*/function (COACHMARK_ALIGNMENT) {
|
33
|
+
COACHMARK_ALIGNMENT["BOTTOM"] = "bottom";
|
34
|
+
COACHMARK_ALIGNMENT["BOTTOM_LEFT"] = "bottom-left";
|
35
|
+
COACHMARK_ALIGNMENT["BOTTOM_RIGHT"] = "bottom-right";
|
36
|
+
COACHMARK_ALIGNMENT["LEFT"] = "left";
|
37
|
+
COACHMARK_ALIGNMENT["LEFT_TOP"] = "left-top";
|
38
|
+
COACHMARK_ALIGNMENT["LEFT_BOTTOM"] = "left-bottom";
|
39
|
+
COACHMARK_ALIGNMENT["RIGHT"] = "right";
|
40
|
+
COACHMARK_ALIGNMENT["RIGHT_TOP"] = "right-top";
|
41
|
+
COACHMARK_ALIGNMENT["RIGHT_BOTTOM"] = "right-bottom";
|
42
|
+
COACHMARK_ALIGNMENT["TOP"] = "top";
|
43
|
+
COACHMARK_ALIGNMENT["TOP_LEFT"] = "top-left";
|
44
|
+
COACHMARK_ALIGNMENT["TOP_RIGHT"] = "top-right";
|
45
|
+
return COACHMARK_ALIGNMENT;
|
46
|
+
}({});
|
45
47
|
|
46
48
|
exports.COACHMARK_ALIGNMENT = COACHMARK_ALIGNMENT;
|
47
49
|
exports.COACHMARK_OVERLAY_KIND = 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 {};
|