@carbon/ibm-products 2.37.0 → 2.38.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. package/css/index-without-carbon-released-only.css +218 -0
  2. package/css/index-without-carbon-released-only.css.map +1 -1
  3. package/css/index-without-carbon-released-only.min.css +1 -1
  4. package/css/index-without-carbon-released-only.min.css.map +1 -1
  5. package/css/index.css +218 -0
  6. package/css/index.css.map +1 -1
  7. package/css/index.min.css +1 -1
  8. package/css/index.min.css.map +1 -1
  9. package/es/components/ActionSet/ActionSet.js +3 -2
  10. package/es/components/Checklist/Checklist.js +10 -10
  11. package/es/components/Checklist/ChecklistChart.d.ts +1 -1
  12. package/es/components/Checklist/ChecklistChart.js +6 -30
  13. package/es/components/Coachmark/Coachmark.d.ts +65 -2
  14. package/es/components/Coachmark/Coachmark.js +7 -10
  15. package/es/components/Coachmark/CoachmarkDragbar.d.ts +40 -2
  16. package/es/components/Coachmark/CoachmarkDragbar.js +3 -1
  17. package/es/components/Coachmark/CoachmarkHeader.d.ts +27 -2
  18. package/es/components/Coachmark/CoachmarkHeader.js +0 -1
  19. package/es/components/Coachmark/CoachmarkOverlay.d.ts +42 -2
  20. package/es/components/Coachmark/CoachmarkOverlay.js +18 -15
  21. package/es/components/Coachmark/CoachmarkTagline.d.ts +27 -2
  22. package/es/components/Coachmark/CoachmarkTagline.js +0 -1
  23. package/es/components/Coachmark/utils/enums.d.ts +20 -20
  24. package/es/components/Coachmark/utils/enums.js +22 -20
  25. package/es/components/CoachmarkFixed/CoachmarkFixed.d.ts +42 -2
  26. package/es/components/CoachmarkFixed/CoachmarkFixed.js +4 -2
  27. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +2 -1
  28. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +25 -23
  29. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
  30. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +14 -24
  31. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +2 -0
  32. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +4 -1
  33. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +3 -3
  34. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -11
  35. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +5 -3
  36. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +54 -44
  37. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +14 -8
  38. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -2
  39. package/es/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -1
  40. package/es/components/Datagrid/Datagrid/DatagridContent.d.ts +1 -0
  41. package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -0
  42. package/es/components/Datagrid/useSkeletonRows.d.ts +1 -1
  43. package/es/components/Datagrid/useSkeletonRows.js +11 -3
  44. package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.d.ts +19 -2
  45. package/es/components/SearchBar/SearchBar.d.ts +10 -1
  46. package/es/components/SearchBar/SearchBar.js +26 -20
  47. package/es/components/TagSet/TagSet.d.ts +87 -3
  48. package/es/components/TagSet/TagSet.js +20 -9
  49. package/es/components/TagSet/TagSetModal.d.ts +32 -26
  50. package/es/components/TagSet/TagSetModal.js +5 -5
  51. package/es/components/TagSet/TagSetOverflow.d.ts +45 -2
  52. package/es/components/TagSet/TagSetOverflow.js +14 -12
  53. package/es/components/WebTerminal/WebTerminal.js +2 -2
  54. package/es/components/WebTerminal/WebTerminalContentWrapper.d.ts +15 -2
  55. package/es/components/WebTerminal/hooks/index.d.ts +16 -11
  56. package/es/components/WebTerminal/hooks/index.js +1 -1
  57. package/es/global/js/package-settings.d.ts +1 -1
  58. package/es/global/js/package-settings.js +1 -1
  59. package/es/node_modules/@carbon/colors/es/index.js +4 -1
  60. package/es/settings.d.ts +1 -1
  61. package/lib/components/ActionSet/ActionSet.js +2 -1
  62. package/lib/components/Checklist/Checklist.js +10 -10
  63. package/lib/components/Checklist/ChecklistChart.d.ts +1 -1
  64. package/lib/components/Checklist/ChecklistChart.js +6 -30
  65. package/lib/components/Coachmark/Coachmark.d.ts +65 -2
  66. package/lib/components/Coachmark/Coachmark.js +6 -9
  67. package/lib/components/Coachmark/CoachmarkDragbar.d.ts +40 -2
  68. package/lib/components/Coachmark/CoachmarkDragbar.js +3 -1
  69. package/lib/components/Coachmark/CoachmarkHeader.d.ts +27 -2
  70. package/lib/components/Coachmark/CoachmarkHeader.js +0 -1
  71. package/lib/components/Coachmark/CoachmarkOverlay.d.ts +42 -2
  72. package/lib/components/Coachmark/CoachmarkOverlay.js +18 -15
  73. package/lib/components/Coachmark/CoachmarkTagline.d.ts +27 -2
  74. package/lib/components/Coachmark/CoachmarkTagline.js +0 -1
  75. package/lib/components/Coachmark/utils/enums.d.ts +20 -20
  76. package/lib/components/Coachmark/utils/enums.js +22 -20
  77. package/lib/components/CoachmarkFixed/CoachmarkFixed.d.ts +42 -2
  78. package/lib/components/CoachmarkFixed/CoachmarkFixed.js +4 -2
  79. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +2 -1
  80. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +25 -23
  81. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
  82. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +13 -23
  83. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +2 -0
  84. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +4 -1
  85. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +3 -3
  86. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -11
  87. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +5 -3
  88. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +54 -44
  89. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +13 -7
  90. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -2
  91. package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -1
  92. package/lib/components/Datagrid/Datagrid/DatagridContent.d.ts +1 -0
  93. package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -0
  94. package/lib/components/Datagrid/useSkeletonRows.d.ts +1 -1
  95. package/lib/components/Datagrid/useSkeletonRows.js +11 -3
  96. package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.d.ts +19 -2
  97. package/lib/components/SearchBar/SearchBar.d.ts +10 -1
  98. package/lib/components/SearchBar/SearchBar.js +26 -18
  99. package/lib/components/TagSet/TagSet.d.ts +87 -3
  100. package/lib/components/TagSet/TagSet.js +20 -9
  101. package/lib/components/TagSet/TagSetModal.d.ts +32 -26
  102. package/lib/components/TagSet/TagSetModal.js +3 -3
  103. package/lib/components/TagSet/TagSetOverflow.d.ts +45 -2
  104. package/lib/components/TagSet/TagSetOverflow.js +14 -12
  105. package/lib/components/WebTerminal/WebTerminal.js +2 -2
  106. package/lib/components/WebTerminal/WebTerminalContentWrapper.d.ts +15 -2
  107. package/lib/components/WebTerminal/hooks/index.d.ts +16 -11
  108. package/lib/components/WebTerminal/hooks/index.js +1 -1
  109. package/lib/global/js/package-settings.d.ts +1 -1
  110. package/lib/global/js/package-settings.js +1 -1
  111. package/lib/node_modules/@carbon/colors/es/index.js +6 -0
  112. package/lib/settings.d.ts +1 -1
  113. package/package.json +5 -3
  114. package/scss/components/Checklist/_carbon-imports.scss +2 -2
  115. package/scss/components/_index-released-only-with-carbon.scss +2 -1
  116. package/scss/components/_index-released-only.scss +2 -1
  117. package/scss/components/_index-with-carbon.scss +1 -0
  118. package/telemetry.yml +936 -683
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TODO: A description of the component.
2
+ * Custom chart component used within Checklist PLG component
3
3
  */
4
4
  export let ChecklistChart: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
5
  import React from 'react';
@@ -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
- * TODO: A description of the component.
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' ? '#e0e0e0' : '#525252'; // $ui-03 (-ish)
52
- var progressColor = theme === 'light' ? '#a56eff' : '#a56eff'; // $purple-50
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<any>>;
7
- import React from 'react';
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, { p as propTypesExports } from '../../node_modules/prop-types/index.js';
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), portalNode)));
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.oneOfType([
222
- // Either a function
223
- PropTypes.func,
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<any>>;
6
- import React from 'react';
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<any>>;
6
- import React from 'react';
30
+ export declare let CoachmarkHeader: React.ForwardRefExoticComponent<CoachmarkHeaderProps & React.RefAttributes<HTMLElement>>;
31
+ export {};
@@ -26,7 +26,6 @@ var defaults = {
26
26
  showCloseButton: true,
27
27
  theme: 'light'
28
28
  };
29
-
30
29
  /**
31
30
  * DO NOT USE. This component is for the exclusive use
32
31
  * of other Novice to Pro components.
@@ -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<any>>;
6
- import React from 'react';
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
- left: coachmark.targetRect.x + window.scrollX,
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 (isBeacon) {
94
- // Compensate for radius of beacon
95
- styledTune.left += 16;
96
- styledTune.top += 16;
97
- } else if (isDraggable) {
98
- // Compensate for width and height of target element
99
- var offsetTune = getOffsetTune(coachmark, kind);
100
- styledTune.left += offsetTune.left;
101
- styledTune.top += offsetTune.top;
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<any>>;
6
- import React from 'react';
30
+ export declare let CoachmarkTagline: React.ForwardRefExoticComponent<CoachmarkTaglineProps & React.RefAttributes<HTMLDivElement>>;
31
+ export {};
@@ -26,7 +26,6 @@ var defaults = {
26
26
  onClose: function onClose() {},
27
27
  theme: 'light'
28
28
  };
29
-
30
29
  /**
31
30
  * DO NOT USE. This component is for the exclusive use
32
31
  * of other Novice to Pro components.
@@ -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 const COACHMARK_OVERLAY_KIND: {
15
- TOOLTIP: string;
16
- FLOATING: string;
17
- FIXED: string;
18
- STACKED: string;
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 const COACHMARK_ALIGNMENT: {
25
- BOTTOM: string;
26
- BOTTOM_LEFT: string;
27
- BOTTOM_RIGHT: string;
28
- LEFT: string;
29
- LEFT_TOP: string;
30
- LEFT_BOTTOM: string;
31
- RIGHT: string;
32
- RIGHT_TOP: string;
33
- RIGHT_BOTTOM: string;
34
- TOP: string;
35
- TOP_LEFT: string;
36
- TOP_RIGHT: string;
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: 'tooltip',
19
- FLOATING: 'floating',
20
- FIXED: 'fixed',
21
- STACKED: '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: 'bottom',
29
- BOTTOM_LEFT: 'bottom-left',
30
- BOTTOM_RIGHT: 'bottom-right',
31
- LEFT: 'left',
32
- LEFT_TOP: 'left-top',
33
- LEFT_BOTTOM: 'left-bottom',
34
- RIGHT: 'right',
35
- RIGHT_TOP: 'right-top',
36
- RIGHT_BOTTOM: 'right-bottom',
37
- TOP: 'top',
38
- TOP_LEFT: 'top-left',
39
- TOP_RIGHT: '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<any>>;
8
- import React from 'react';
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), portalNode)));
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';