@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.
Files changed (190) hide show
  1. package/css/index-full-carbon.css +227 -0
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +218 -0
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +227 -0
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +445 -0
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/ActionSet/ActionSet.js +3 -2
  18. package/es/components/Card/Card.js +50 -9
  19. package/es/components/Card/CardFooter.d.ts +5 -1
  20. package/es/components/Card/CardFooter.js +11 -1
  21. package/es/components/Carousel/Carousel.d.ts +6 -2
  22. package/es/components/Checklist/Checklist.d.ts +100 -2
  23. package/es/components/Checklist/Checklist.js +19 -15
  24. package/es/components/Checklist/Checklist.types.d.ts +19 -0
  25. package/es/components/Checklist/Checklist.types.js +22 -0
  26. package/es/components/Checklist/ChecklistChart.d.ts +6 -2
  27. package/es/components/Checklist/ChecklistChart.js +14 -33
  28. package/es/components/Checklist/ChecklistIcon.d.ts +5 -1
  29. package/es/components/Checklist/ChecklistIcon.js +9 -4
  30. package/es/components/Coachmark/Coachmark.d.ts +65 -2
  31. package/es/components/Coachmark/Coachmark.js +7 -10
  32. package/es/components/Coachmark/CoachmarkDragbar.d.ts +40 -2
  33. package/es/components/Coachmark/CoachmarkDragbar.js +3 -1
  34. package/es/components/Coachmark/CoachmarkHeader.d.ts +27 -2
  35. package/es/components/Coachmark/CoachmarkHeader.js +0 -1
  36. package/es/components/Coachmark/CoachmarkOverlay.d.ts +42 -2
  37. package/es/components/Coachmark/CoachmarkOverlay.js +18 -15
  38. package/es/components/Coachmark/CoachmarkTagline.d.ts +27 -2
  39. package/es/components/Coachmark/CoachmarkTagline.js +0 -1
  40. package/es/components/Coachmark/utils/enums.d.ts +20 -20
  41. package/es/components/Coachmark/utils/enums.js +22 -20
  42. package/es/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
  43. package/es/components/CoachmarkFixed/CoachmarkFixed.d.ts +42 -2
  44. package/es/components/CoachmarkFixed/CoachmarkFixed.js +4 -2
  45. package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
  46. package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
  47. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +2 -1
  48. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +25 -23
  49. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
  50. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +14 -24
  51. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +2 -0
  52. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +4 -1
  53. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +3 -3
  54. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -11
  55. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +5 -3
  56. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +54 -44
  57. package/es/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
  58. package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
  59. package/es/components/DataSpreadsheet/DataSpreadsheet.js +48 -27
  60. package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
  61. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +60 -39
  62. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
  63. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +39 -27
  64. package/es/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -1
  65. package/es/components/DataSpreadsheet/types/index.d.ts +30 -0
  66. package/es/components/EditTearsheetNarrow/EditTearsheetNarrow.d.ts +19 -2
  67. package/es/components/GetStartedCard/GetStartedCard.d.ts +5 -0
  68. package/es/components/GetStartedCard/GetStartedCard.js +82 -0
  69. package/es/components/GetStartedCard/index.d.ts +1 -0
  70. package/es/components/Guidebanner/Guidebanner.js +2 -2
  71. package/es/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
  72. package/es/components/NotificationsPanel/NotificationsPanel.js +10 -10
  73. package/es/components/SearchBar/SearchBar.d.ts +10 -1
  74. package/es/components/SearchBar/SearchBar.js +26 -20
  75. package/es/components/SidePanel/SidePanel.js +1 -1
  76. package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
  77. package/es/components/TagOverflow/TagOverflow.js +153 -29
  78. package/es/components/TagOverflow/TagOverflowModal.d.ts +29 -0
  79. package/es/components/TagOverflow/TagOverflowModal.js +112 -0
  80. package/es/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
  81. package/es/components/TagOverflow/TagOverflowPopover.js +135 -0
  82. package/es/components/TagSet/TagSet.d.ts +87 -3
  83. package/es/components/TagSet/TagSet.js +20 -9
  84. package/es/components/TagSet/TagSetModal.d.ts +32 -26
  85. package/es/components/TagSet/TagSetModal.js +5 -5
  86. package/es/components/TagSet/TagSetOverflow.d.ts +45 -2
  87. package/es/components/TagSet/TagSetOverflow.js +14 -12
  88. package/es/components/WebTerminal/WebTerminal.js +2 -2
  89. package/es/components/WebTerminal/WebTerminalContentWrapper.d.ts +15 -2
  90. package/es/components/WebTerminal/hooks/index.d.ts +16 -11
  91. package/es/components/WebTerminal/hooks/index.js +1 -1
  92. package/es/components/index.d.ts +1 -0
  93. package/es/global/js/package-settings.d.ts +2 -1
  94. package/es/global/js/package-settings.js +2 -1
  95. package/es/index.js +1 -0
  96. package/es/node_modules/@carbon/colors/es/index.js +4 -1
  97. package/es/settings.d.ts +2 -1
  98. package/lib/components/ActionSet/ActionSet.js +2 -1
  99. package/lib/components/Card/Card.js +50 -9
  100. package/lib/components/Card/CardFooter.d.ts +5 -1
  101. package/lib/components/Card/CardFooter.js +11 -1
  102. package/lib/components/Carousel/Carousel.d.ts +6 -2
  103. package/lib/components/Checklist/Checklist.d.ts +100 -2
  104. package/lib/components/Checklist/Checklist.js +19 -15
  105. package/lib/components/Checklist/Checklist.types.d.ts +19 -0
  106. package/lib/components/Checklist/Checklist.types.js +27 -0
  107. package/lib/components/Checklist/ChecklistChart.d.ts +6 -2
  108. package/lib/components/Checklist/ChecklistChart.js +17 -36
  109. package/lib/components/Checklist/ChecklistIcon.d.ts +5 -1
  110. package/lib/components/Checklist/ChecklistIcon.js +9 -4
  111. package/lib/components/Coachmark/Coachmark.d.ts +65 -2
  112. package/lib/components/Coachmark/Coachmark.js +6 -9
  113. package/lib/components/Coachmark/CoachmarkDragbar.d.ts +40 -2
  114. package/lib/components/Coachmark/CoachmarkDragbar.js +3 -1
  115. package/lib/components/Coachmark/CoachmarkHeader.d.ts +27 -2
  116. package/lib/components/Coachmark/CoachmarkHeader.js +0 -1
  117. package/lib/components/Coachmark/CoachmarkOverlay.d.ts +42 -2
  118. package/lib/components/Coachmark/CoachmarkOverlay.js +18 -15
  119. package/lib/components/Coachmark/CoachmarkTagline.d.ts +27 -2
  120. package/lib/components/Coachmark/CoachmarkTagline.js +0 -1
  121. package/lib/components/Coachmark/utils/enums.d.ts +20 -20
  122. package/lib/components/Coachmark/utils/enums.js +22 -20
  123. package/lib/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
  124. package/lib/components/CoachmarkFixed/CoachmarkFixed.d.ts +42 -2
  125. package/lib/components/CoachmarkFixed/CoachmarkFixed.js +4 -2
  126. package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
  127. package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
  128. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +2 -1
  129. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +25 -23
  130. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
  131. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +13 -23
  132. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +2 -0
  133. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +4 -1
  134. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +3 -3
  135. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +11 -11
  136. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +5 -3
  137. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +54 -44
  138. package/lib/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
  139. package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
  140. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +48 -27
  141. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
  142. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +59 -38
  143. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
  144. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +39 -27
  145. package/lib/components/DataSpreadsheet/hooks/useMoveActiveCell.js +2 -1
  146. package/lib/components/DataSpreadsheet/types/index.d.ts +30 -0
  147. package/lib/components/EditTearsheetNarrow/EditTearsheetNarrow.d.ts +19 -2
  148. package/lib/components/GetStartedCard/GetStartedCard.d.ts +5 -0
  149. package/lib/components/GetStartedCard/GetStartedCard.js +88 -0
  150. package/lib/components/GetStartedCard/index.d.ts +1 -0
  151. package/lib/components/Guidebanner/Guidebanner.js +2 -2
  152. package/lib/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
  153. package/lib/components/NotificationsPanel/NotificationsPanel.js +10 -10
  154. package/lib/components/SearchBar/SearchBar.d.ts +10 -1
  155. package/lib/components/SearchBar/SearchBar.js +26 -18
  156. package/lib/components/SidePanel/SidePanel.js +1 -1
  157. package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
  158. package/lib/components/TagOverflow/TagOverflow.js +154 -28
  159. package/lib/components/TagOverflow/TagOverflowModal.d.ts +29 -0
  160. package/lib/components/TagOverflow/TagOverflowModal.js +121 -0
  161. package/lib/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
  162. package/lib/components/TagOverflow/TagOverflowPopover.js +144 -0
  163. package/lib/components/TagSet/TagSet.d.ts +87 -3
  164. package/lib/components/TagSet/TagSet.js +20 -9
  165. package/lib/components/TagSet/TagSetModal.d.ts +32 -26
  166. package/lib/components/TagSet/TagSetModal.js +3 -3
  167. package/lib/components/TagSet/TagSetOverflow.d.ts +45 -2
  168. package/lib/components/TagSet/TagSetOverflow.js +14 -12
  169. package/lib/components/WebTerminal/WebTerminal.js +2 -2
  170. package/lib/components/WebTerminal/WebTerminalContentWrapper.d.ts +15 -2
  171. package/lib/components/WebTerminal/hooks/index.d.ts +16 -11
  172. package/lib/components/WebTerminal/hooks/index.js +1 -1
  173. package/lib/components/index.d.ts +1 -0
  174. package/lib/global/js/package-settings.d.ts +2 -1
  175. package/lib/global/js/package-settings.js +2 -1
  176. package/lib/index.js +5 -0
  177. package/lib/node_modules/@carbon/colors/es/index.js +6 -0
  178. package/lib/settings.d.ts +2 -1
  179. package/package.json +3 -3
  180. package/scss/components/Checklist/_carbon-imports.scss +2 -2
  181. package/scss/components/GetStartedCard/_carbon-imports.scss +9 -0
  182. package/scss/components/GetStartedCard/_get-started-card.scss +135 -0
  183. package/scss/components/GetStartedCard/_index-with-carbon.scss +9 -0
  184. package/scss/components/GetStartedCard/_index.scss +8 -0
  185. package/scss/components/TagOverflow/_tag-overflow.scss +157 -0
  186. package/scss/components/_index-released-only-with-carbon.scss +2 -1
  187. package/scss/components/_index-released-only.scss +2 -1
  188. package/scss/components/_index-with-carbon.scss +2 -0
  189. package/scss/components/_index.scss +1 -0
  190. package/telemetry.yml +28 -24
@@ -12,6 +12,7 @@ import cx from 'classnames';
12
12
  import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
13
13
  import { pkg } from '../../settings.js';
14
14
  import { CircleDash, CheckmarkOutline, Incomplete, Warning } from '@carbon/react/icons';
15
+ import { Themes, Kinds } from './Checklist.types.js';
15
16
 
16
17
  var _excluded = ["className", "kind", "theme"];
17
18
 
@@ -32,13 +33,17 @@ var componentName = 'ChecklistIcon';
32
33
 
33
34
  // Default values for props
34
35
  var defaults = {
35
- theme: 'light'
36
+ theme: Themes.light
36
37
  };
37
38
 
38
39
  /**
39
40
  * TODO: A description of the component.
40
41
  */
41
- var ChecklistIcon = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
42
+ var ChecklistIcon = /*#__PURE__*/React__default.forwardRef(
43
+ /**
44
+ * @param {{className?: string, kind?: import('./Checklist.types').Kind, theme?: import('./Checklist.types').Theme}} props type description
45
+ */
46
+ function (_ref, ref) {
42
47
  var className = _ref.className,
43
48
  kind = _ref.kind,
44
49
  _ref$theme = _ref.theme,
@@ -86,11 +91,11 @@ ChecklistIcon.propTypes = {
86
91
  /**
87
92
  * The icon to be displayed.
88
93
  */
89
- kind: PropTypes.oneOf(['unchecked', 'indeterminate', 'checked', 'disabled', 'error']),
94
+ kind: PropTypes.oneOf([Kinds.unchecked, Kinds.indeterminate, Kinds.checked, Kinds.disabled, Kinds.error]),
90
95
  /**
91
96
  * Determines the theme of the component.
92
97
  */
93
- theme: PropTypes.oneOf(['light', 'dark'])
98
+ theme: PropTypes.oneOf([Themes.light, Themes.dark])
94
99
  };
95
100
 
96
101
  export { ChecklistIcon };
@@ -1,7 +1,70 @@
1
+ /**
2
+ * Copyright IBM Corp. 2023, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { MutableRefObject, ReactNode } from 'react';
8
+ interface CoachmarkProps {
9
+ /**
10
+ * Where to render the Coachmark relative to its target.
11
+ * Applies only to Floating and Tooltip Coachmarks.
12
+ * @see COACHMARK_ALIGNMENT
13
+ */
14
+ align?: 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'left-top' | 'left-bottom' | 'right' | 'right-top' | 'right-bottom' | 'top' | 'top-left' | 'top-right';
15
+ /**
16
+ * Coachmark should use a single CoachmarkOverlayElements component as a child.
17
+ * @see CoachmarkOverlayElements
18
+ */
19
+ children: ReactNode;
20
+ /**
21
+ * Optional class name for this component.
22
+ */
23
+ className?: string;
24
+ /**
25
+ * Function to call when the Coachmark closes.
26
+ */
27
+ onClose?: () => void;
28
+ /**
29
+ * Optional class name for the Coachmark Overlay component.
30
+ */
31
+ overlayClassName?: string;
32
+ /**
33
+ * What kind or style of Coachmark to render.
34
+ */
35
+ overlayKind?: 'tooltip' | 'floating' | 'stacked';
36
+ overlayRef?: MutableRefObject<HTMLElement | null>;
37
+ /**
38
+ * By default, the Coachmark will be appended to the end of `document.body`.
39
+ * The Coachmark will remain persistent as the user navigates the app until
40
+ * the user closes the Coachmark.
41
+ *
42
+ * Alternatively, the app developer can tightly couple the Coachmark to a DOM
43
+ * element or other component by specifying a CSS selector. The Coachmark will
44
+ * remain visible as long as that element remains visible or mounted. When the
45
+ * element is hidden or component is unmounted, the Coachmark will disappear.
46
+ */
47
+ portalTarget?: string;
48
+ /**
49
+ * Fine tune the position of the target in pixels. Applies only to Beacons.
50
+ */
51
+ positionTune?: {
52
+ x: number;
53
+ y: number;
54
+ } | object;
55
+ /**
56
+ * The optional button or beacon that the user will click to show the Coachmark.
57
+ */
58
+ target: React.ReactNode;
59
+ /**
60
+ * Determines the theme of the component.
61
+ */
62
+ theme?: 'light' | 'dark';
63
+ }
1
64
  /**
2
65
  * Coachmarks are used to call out specific functionality or concepts
3
66
  * within the UI that may not be intuitive but are important for the
4
67
  * user to gain understanding of the product's main value and discover new use cases.
5
68
  */
6
- export let Coachmark: React.ForwardRefExoticComponent<React.RefAttributes<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,5 +1,22 @@
1
1
  /**
2
- * Use CoachmarkButton for the target prop of a Coachmark component.
2
+ * Copyright IBM Corp. 2023, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
3
6
  */
4
- export let CoachmarkButton: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
7
  import React from 'react';
8
+ interface CoachmarkButtonProps {
9
+ /**
10
+ * Provide an optional class to be applied to the containing node.
11
+ */
12
+ className?: string;
13
+ /**
14
+ * The aria label.
15
+ */
16
+ label: string;
17
+ }
18
+ /**
19
+ * Use CoachmarkButton for the target prop of a Coachmark component.
20
+ */
21
+ export declare let CoachmarkButton: React.ForwardRefExoticComponent<CoachmarkButtonProps & React.RefAttributes<HTMLButtonElement>>;
22
+ export {};
@@ -1,8 +1,48 @@
1
+ /**
2
+ * Copyright IBM Corp. 2023, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { ReactNode } from 'react';
8
+ interface CoachmarkFixedProps {
9
+ /**
10
+ * CoachmarkFixed should use a single CoachmarkOverlayElements component as a child.
11
+ */
12
+ children: ReactNode;
13
+ /**
14
+ * Optional class name for this component.
15
+ */
16
+ className?: string;
17
+ /**
18
+ * Function to call when the Coachmark closes.
19
+ */
20
+ onClose?: () => void;
21
+ /**
22
+ * By default, the Coachmark will be appended to the end of `document.body`.
23
+ * The Coachmark will remain persistent as the user navigates the app until
24
+ * the user closes the Coachmark.
25
+ *
26
+ * Alternatively, the app developer can tightly couple the Coachmark to a DOM
27
+ * element or other component by specifying a CSS selector. The Coachmark will
28
+ * remain visible as long as that element remains visible or mounted. When the
29
+ * element is hidden or component is unmounted, the Coachmark will disappear.
30
+ */
31
+ portalTarget?: string;
32
+ /**
33
+ * The tagline title which will be fixed to the bottom right of the window and will serve as the display trigger.
34
+ */
35
+ tagline: string;
36
+ /**
37
+ * Determines the theme of the component.
38
+ */
39
+ theme?: 'light' | 'dark';
40
+ }
1
41
  /**
2
42
  * Fixed coachmarks are used to call out specific functionality or concepts
3
43
  * within the UI that may not be intuitive but are important for the
4
44
  * user to gain understanding of the product's main value and discover new use cases.
5
45
  * This variant allows the a coachmark overlay to be displayed by interacting with the tagline.
6
46
  */
7
- export let CoachmarkFixed: React.ForwardRefExoticComponent<React.RefAttributes<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