@carbon/ibm-products 2.71.1 → 2.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/css/carbon.css +50 -0
  2. package/css/carbon.css.map +1 -1
  3. package/css/index-full-carbon.css +560 -185
  4. package/css/index-full-carbon.css.map +1 -1
  5. package/css/index-full-carbon.min.css +1 -1
  6. package/css/index-full-carbon.min.css.map +1 -1
  7. package/css/index-without-carbon-released-only.css +132 -1
  8. package/css/index-without-carbon-released-only.css.map +1 -1
  9. package/css/index-without-carbon-released-only.min.css +1 -1
  10. package/css/index-without-carbon-released-only.min.css.map +1 -1
  11. package/css/index-without-carbon.css +570 -245
  12. package/css/index-without-carbon.css.map +1 -1
  13. package/css/index-without-carbon.min.css +1 -1
  14. package/css/index-without-carbon.min.css.map +1 -1
  15. package/css/index.css +358 -33
  16. package/css/index.css.map +1 -1
  17. package/css/index.min.css +1 -1
  18. package/css/index.min.css.map +1 -1
  19. package/es/components/{BigNumbers/BigNumbers.d.ts → BigNumber/BigNumber.d.ts} +5 -5
  20. package/es/components/{BigNumbers/BigNumbers.js → BigNumber/BigNumber.js} +12 -12
  21. package/es/components/BigNumber/BigNumberSkeleton.d.ts +17 -0
  22. package/es/components/{BigNumbers/BigNumbersSkeleton.js → BigNumber/BigNumberSkeleton.js} +16 -16
  23. package/es/components/{BigNumbers → BigNumber}/constants.d.ts +3 -3
  24. package/es/components/{BigNumbers → BigNumber}/constants.js +6 -6
  25. package/es/components/{BigNumbers → BigNumber}/index.d.ts +2 -2
  26. package/es/components/Coachmark/next/Coachmark/Coachmark.d.ts +72 -0
  27. package/es/components/Coachmark/next/Coachmark/Coachmark.js +185 -0
  28. package/es/components/Coachmark/next/Coachmark/CoachmarkBeacon/CoachmarkBeacon.d.ts +44 -0
  29. package/es/components/Coachmark/next/Coachmark/CoachmarkBeacon/index.d.ts +8 -0
  30. package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.d.ts +38 -0
  31. package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +125 -0
  32. package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.d.ts +24 -0
  33. package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +25 -0
  34. package/es/components/Coachmark/next/Coachmark/CoachmarkBubble/index.d.ts +10 -0
  35. package/es/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +34 -0
  36. package/es/components/Coachmark/next/Coachmark/CoachmarkContent.js +118 -0
  37. package/es/components/Coachmark/next/Coachmark/ContentBody.d.ts +23 -0
  38. package/es/components/Coachmark/next/Coachmark/ContentBody.js +37 -0
  39. package/es/components/Coachmark/next/Coachmark/ContentHeader.d.ts +21 -0
  40. package/es/components/Coachmark/next/Coachmark/ContentHeader.js +89 -0
  41. package/{lib/components/BigNumbers → es/components/Coachmark/next/Coachmark}/index.d.ts +2 -2
  42. package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +0 -1
  43. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +2 -1
  44. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +30 -5
  45. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
  46. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +11 -4
  47. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +2 -2
  48. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +1 -1
  49. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +42 -3
  50. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
  51. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +5 -3
  52. package/es/components/ConditionBuilder/utils/useEvent.d.ts +8 -0
  53. package/es/components/ConditionBuilder/utils/useEvent.js +32 -0
  54. package/es/components/ConditionBuilder/utils/useTranslations.js +1 -1
  55. package/es/components/EditInPlace/EditInPlace.js +0 -3
  56. package/es/components/EmptyStates/EmptyState.d.ts +2 -2
  57. package/es/components/EmptyStates/EmptyState.js +2 -8
  58. package/es/components/FilterPanel/FilterPanelGroup/index.d.ts +1 -0
  59. package/es/components/InterstitialScreen/InterstitialScreen.d.ts +1 -25
  60. package/es/components/InterstitialScreen/InterstitialScreen.js +3 -19
  61. package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +1 -1
  62. package/es/components/InterstitialScreen/InterstitialScreenBody.js +1 -1
  63. package/es/components/InterstitialScreen/InterstitialScreenFooter.d.ts +1 -1
  64. package/es/components/InterstitialScreen/InterstitialScreenFooter.js +1 -1
  65. package/es/components/InterstitialScreen/InterstitialScreenHeader.d.ts +6 -0
  66. package/es/components/InterstitialScreen/InterstitialScreenHeader.js +1 -1
  67. package/es/components/InterstitialScreen/_story-assets/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +1 -1
  68. package/es/components/InterstitialScreen/context.d.ts +31 -0
  69. package/es/components/InterstitialScreen/context.js +18 -0
  70. package/es/components/InterstitialScreen/index.d.ts +3 -2
  71. package/es/components/NotificationsPanel/NotificationsPanel.js +36 -13
  72. package/es/components/PageHeader/PageHeader.d.ts +2 -1
  73. package/es/components/PageHeader/PageHeader.js +2 -1
  74. package/es/components/PageHeader/next/PageHeader.d.ts +18 -3
  75. package/es/components/PageHeader/next/PageHeader.js +260 -12
  76. package/es/components/PageHeader/next/context.d.ts +25 -0
  77. package/es/components/PageHeader/next/context.js +30 -0
  78. package/es/components/PageHeader/next/index.d.ts +3 -3
  79. package/es/components/PageHeader/next/overflowHandler.d.ts +95 -0
  80. package/es/components/PageHeader/next/overflowHandler.js +162 -0
  81. package/es/components/PageHeader/next/utils.d.ts +19 -0
  82. package/es/components/PageHeader/next/utils.js +68 -0
  83. package/es/components/ProductiveCard/ProductiveCard.js +2 -1
  84. package/es/components/ScrollGradient/ScrollGradient.js +1 -2
  85. package/es/components/SidePanel/SidePanel.d.ts +4 -0
  86. package/es/components/SidePanel/SidePanel.js +8 -2
  87. package/es/components/Tearsheet/TearsheetShell.js +8 -5
  88. package/es/components/TruncatedText/TruncatedText.d.ts +48 -0
  89. package/es/components/TruncatedText/TruncatedText.js +86 -0
  90. package/es/components/TruncatedText/index.d.ts +7 -0
  91. package/es/components/TruncatedText/useTruncatedText.d.ts +16 -0
  92. package/es/components/TruncatedText/useTruncatedText.js +41 -0
  93. package/es/components/index.d.ts +3 -1
  94. package/es/global/js/hooks/useOverflowString.d.ts +2 -2
  95. package/es/global/js/hooks/useResizeObserver.d.ts +1 -1
  96. package/es/global/js/package-settings.d.ts +2 -1
  97. package/es/global/js/package-settings.js +3 -2
  98. package/es/global/js/utils/checkForOverflow.js +21 -0
  99. package/es/global/js/utils/makeDraggable/index.d.ts +1 -0
  100. package/es/global/js/utils/makeDraggable/makeDraggable.d.ts +19 -0
  101. package/es/global/js/utils/makeDraggable/makeDraggable.js +91 -0
  102. package/es/global/js/utils/makeDraggable/makeDraggable.stories.d.ts +22 -0
  103. package/es/index.js +3 -1
  104. package/es/node_modules/@floating-ui/core/dist/floating-ui.core.js +592 -0
  105. package/es/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +713 -0
  106. package/es/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +95 -0
  107. package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +161 -0
  108. package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +142 -0
  109. package/es/settings.d.ts +2 -1
  110. package/lib/components/{BigNumbers/BigNumbers.d.ts → BigNumber/BigNumber.d.ts} +5 -5
  111. package/lib/components/{BigNumbers/BigNumbers.js → BigNumber/BigNumber.js} +11 -11
  112. package/lib/components/BigNumber/BigNumberSkeleton.d.ts +17 -0
  113. package/lib/components/{BigNumbers/BigNumbersSkeleton.js → BigNumber/BigNumberSkeleton.js} +15 -15
  114. package/lib/components/{BigNumbers → BigNumber}/constants.d.ts +3 -3
  115. package/lib/components/{BigNumbers → BigNumber}/constants.js +6 -6
  116. package/lib/components/BigNumber/index.d.ts +7 -0
  117. package/lib/components/Coachmark/Coachmark.js +2 -2
  118. package/lib/components/Coachmark/next/Coachmark/Coachmark.d.ts +72 -0
  119. package/lib/components/Coachmark/next/Coachmark/Coachmark.js +189 -0
  120. package/lib/components/Coachmark/next/Coachmark/CoachmarkBeacon/CoachmarkBeacon.d.ts +44 -0
  121. package/lib/components/Coachmark/next/Coachmark/CoachmarkBeacon/index.d.ts +8 -0
  122. package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.d.ts +38 -0
  123. package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubble.js +127 -0
  124. package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.d.ts +24 -0
  125. package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/CoachmarkBubbleHeader.js +27 -0
  126. package/lib/components/Coachmark/next/Coachmark/CoachmarkBubble/index.d.ts +10 -0
  127. package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.d.ts +34 -0
  128. package/lib/components/Coachmark/next/Coachmark/CoachmarkContent.js +122 -0
  129. package/lib/components/Coachmark/next/Coachmark/ContentBody.d.ts +23 -0
  130. package/lib/components/Coachmark/next/Coachmark/ContentBody.js +41 -0
  131. package/lib/components/Coachmark/next/Coachmark/ContentHeader.d.ts +21 -0
  132. package/lib/components/Coachmark/next/Coachmark/ContentHeader.js +93 -0
  133. package/lib/components/Coachmark/next/Coachmark/index.d.ts +7 -0
  134. package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +0 -1
  135. package/lib/components/CoachmarkFixed/CoachmarkFixed.js +2 -2
  136. package/lib/components/CoachmarkStack/CoachmarkStack.js +2 -2
  137. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +2 -2
  138. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +2 -1
  139. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +30 -5
  140. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
  141. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +11 -4
  142. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +2 -2
  143. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +1 -1
  144. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +41 -2
  145. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
  146. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +5 -3
  147. package/lib/components/ConditionBuilder/utils/useEvent.d.ts +8 -0
  148. package/lib/components/ConditionBuilder/utils/useEvent.js +34 -0
  149. package/lib/components/ConditionBuilder/utils/useTranslations.js +1 -1
  150. package/lib/components/EditInPlace/EditInPlace.js +0 -3
  151. package/lib/components/EmptyStates/EmptyState.d.ts +2 -2
  152. package/lib/components/EmptyStates/EmptyState.js +2 -8
  153. package/lib/components/FilterPanel/FilterPanelGroup/index.d.ts +1 -0
  154. package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +1 -25
  155. package/lib/components/InterstitialScreen/InterstitialScreen.js +6 -25
  156. package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +1 -1
  157. package/lib/components/InterstitialScreen/InterstitialScreenBody.js +6 -6
  158. package/lib/components/InterstitialScreen/InterstitialScreenFooter.d.ts +1 -1
  159. package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +9 -9
  160. package/lib/components/InterstitialScreen/InterstitialScreenHeader.d.ts +6 -0
  161. package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +5 -5
  162. package/lib/components/InterstitialScreen/_story-assets/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +1 -1
  163. package/lib/components/InterstitialScreen/context.d.ts +31 -0
  164. package/lib/components/InterstitialScreen/context.js +21 -0
  165. package/lib/components/InterstitialScreen/index.d.ts +3 -2
  166. package/lib/components/NotificationsPanel/NotificationsPanel.js +36 -13
  167. package/lib/components/PageHeader/PageHeader.d.ts +2 -1
  168. package/lib/components/PageHeader/PageHeader.js +2 -1
  169. package/lib/components/PageHeader/next/PageHeader.d.ts +18 -3
  170. package/lib/components/PageHeader/next/PageHeader.js +261 -7
  171. package/lib/components/PageHeader/next/context.d.ts +25 -0
  172. package/lib/components/PageHeader/next/context.js +33 -0
  173. package/lib/components/PageHeader/next/index.d.ts +3 -3
  174. package/lib/components/PageHeader/next/overflowHandler.d.ts +95 -0
  175. package/lib/components/PageHeader/next/overflowHandler.js +166 -0
  176. package/lib/components/PageHeader/next/utils.d.ts +19 -0
  177. package/lib/components/PageHeader/next/utils.js +71 -0
  178. package/lib/components/ProductiveCard/ProductiveCard.js +2 -1
  179. package/lib/components/ScrollGradient/ScrollGradient.js +1 -2
  180. package/lib/components/SidePanel/SidePanel.d.ts +4 -0
  181. package/lib/components/SidePanel/SidePanel.js +8 -2
  182. package/lib/components/Tearsheet/TearsheetShell.js +8 -5
  183. package/lib/components/TruncatedText/TruncatedText.d.ts +48 -0
  184. package/lib/components/TruncatedText/TruncatedText.js +86 -0
  185. package/lib/components/TruncatedText/index.d.ts +7 -0
  186. package/lib/components/TruncatedText/useTruncatedText.d.ts +16 -0
  187. package/lib/components/TruncatedText/useTruncatedText.js +45 -0
  188. package/lib/components/index.d.ts +3 -1
  189. package/lib/global/js/hooks/useOverflowString.d.ts +2 -2
  190. package/lib/global/js/hooks/usePortalTarget.js +2 -2
  191. package/lib/global/js/hooks/useResizeObserver.d.ts +1 -1
  192. package/lib/global/js/package-settings.d.ts +2 -1
  193. package/lib/global/js/package-settings.js +3 -2
  194. package/lib/global/js/utils/checkForOverflow.js +23 -0
  195. package/lib/global/js/utils/makeDraggable/index.d.ts +1 -0
  196. package/lib/global/js/utils/makeDraggable/makeDraggable.d.ts +19 -0
  197. package/lib/global/js/utils/makeDraggable/makeDraggable.js +93 -0
  198. package/lib/global/js/utils/makeDraggable/makeDraggable.stories.d.ts +22 -0
  199. package/lib/index.js +10 -3
  200. package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.js +600 -0
  201. package/lib/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +722 -0
  202. package/lib/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +102 -0
  203. package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +182 -0
  204. package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +164 -0
  205. package/lib/settings.d.ts +2 -1
  206. package/package.json +9 -10
  207. package/scss/components/{BigNumbers/_big-numbers.scss → BigNumber/_big-number.scss} +5 -5
  208. package/scss/components/{BigNumbers → BigNumber}/_carbon-imports.scss +3 -3
  209. package/scss/components/{BigNumbers → BigNumber}/_index-with-carbon.scss +2 -2
  210. package/scss/components/{BigNumbers → BigNumber}/_index.scss +2 -2
  211. package/scss/components/Card/_card.scss +2 -0
  212. package/scss/components/Coachmark/_bubble.scss +62 -0
  213. package/scss/components/Coachmark/_coachmark-beacon.scss +164 -0
  214. package/scss/components/Coachmark/_coachmark.scss +15 -0
  215. package/scss/components/ConditionBuilder/_condition-builder.scss +8 -0
  216. package/scss/components/PageHeader/_page-header.scss +144 -1
  217. package/scss/components/Tearsheet/_tearsheet.scss +6 -0
  218. package/scss/components/TruncatedText/_carbon-imports.scss +6 -0
  219. package/scss/components/TruncatedText/_index-with-carbon.scss +9 -0
  220. package/scss/components/TruncatedText/_index.scss +8 -0
  221. package/scss/components/TruncatedText/_truncated-text.scss +26 -0
  222. package/scss/components/_index-with-carbon.scss +3 -2
  223. package/scss/components/_index.scss +3 -2
  224. package/telemetry.yml +24 -5
  225. package/es/components/BigNumbers/BigNumbersSkeleton.d.ts +0 -17
  226. package/lib/components/BigNumbers/BigNumbersSkeleton.d.ts +0 -17
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
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
+ /**
8
+ * ----------
9
+ * Utilities
10
+ * ----------
11
+ */
12
+ export declare const getHeaderOffset: (el: HTMLElement) => number;
13
+ /**
14
+ * Walks up the parent nodes to identify the first scrollable ancestor
15
+ *
16
+ * @param {HTMLElement} target
17
+ * @returns {HTMLElement}
18
+ */
19
+ export declare const scrollableAncestor: (target: HTMLElement) => ParentNode | null;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2025
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
+
8
+ /**
9
+ * ----------
10
+ * Utilities
11
+ * ----------
12
+ */
13
+
14
+ const getHeaderOffset = el => {
15
+ const scrollableContainer = scrollableAncestor(el);
16
+ const scrollableContainerTop = scrollableContainer ? scrollableContainer.getBoundingClientRect().top : 0;
17
+ const offsetMeasuringTop = el ? el.getBoundingClientRect().top : 0;
18
+ const totalHeaderOffset = offsetMeasuringTop !== 0 ? offsetMeasuringTop - scrollableContainerTop : 0;
19
+ return totalHeaderOffset;
20
+ };
21
+ const windowExists = typeof window !== `undefined`;
22
+
23
+ /**
24
+ * Determines if the given target is scrollable
25
+ *
26
+ * @param {HTMLElement} target
27
+ * @returns {boolean}
28
+ */
29
+ const scrollable = target => {
30
+ const style = window.getComputedStyle(target);
31
+ return /(auto|scroll|hidden)/.test(style.overflow);
32
+ };
33
+
34
+ /**
35
+ * Recursively looks for the scrollable ancestor
36
+ */
37
+ const scrollableAncestorInner = target => {
38
+ if (target.parentNode && target.parentNode !== document) {
39
+ if (scrollable(target.parentNode)) {
40
+ return target.parentNode;
41
+ } else {
42
+ return scrollableAncestorInner(target.parentNode);
43
+ }
44
+ } else {
45
+ return document.scrollingElement;
46
+ }
47
+ };
48
+
49
+ /**
50
+ * Walks up the parent nodes to identify the first scrollable ancestor
51
+ *
52
+ * @param {HTMLElement} target
53
+ * @returns {HTMLElement}
54
+ */
55
+ const scrollableAncestor = target => {
56
+ if (!windowExists || !target) {
57
+ return null;
58
+ }
59
+
60
+ // based on https://stackoverflow.com/questions/35939886/find-first-scrollable-parent
61
+ const style = window.getComputedStyle(target);
62
+ if (!target || !style || style.position === 'fixed') {
63
+ return document.scrollingElement;
64
+ }
65
+ return scrollableAncestorInner(target);
66
+ };
67
+
68
+ export { getHeaderOffset, scrollableAncestor };
@@ -17,6 +17,7 @@ const componentName = 'ProductiveCard';
17
17
  let ProductiveCard = /*#__PURE__*/forwardRef((_ref, ref) => {
18
18
  let {
19
19
  actionsPlacement = 'top',
20
+ children,
20
21
  ...rest
21
22
  } = _ref;
22
23
  const validProps = prepareProps(rest, ['media', 'mediaPosition', 'pictogram', 'primaryButtonClick', 'productive', 'secondaryButtonKind']);
@@ -24,7 +25,7 @@ let ProductiveCard = /*#__PURE__*/forwardRef((_ref, ref) => {
24
25
  actionsPlacement,
25
26
  ref,
26
27
  productive: true
27
- }, getDevtoolsProps(componentName)));
28
+ }, getDevtoolsProps(componentName)), children);
28
29
  });
29
30
 
30
31
  // Return a placeholder if not released and not enabled by feature flag
@@ -138,8 +138,7 @@ let ScrollGradient = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
138
138
  }, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement("div", {
139
139
  onScroll: onScroll,
140
140
  ref: setRefs,
141
- className: cx(`${blockClass}__content`, scrollElementClassName),
142
- tabIndex: 0
141
+ className: cx(`${blockClass}__content`, scrollElementClassName)
143
142
  }, /*#__PURE__*/React__default.createElement("span", {
144
143
  ref: intersectionStartRef,
145
144
  "data-start-vertical": true
@@ -36,6 +36,10 @@ type SidePanelBaseProps = {
36
36
  * Sets the close button icon description
37
37
  */
38
38
  closeIconDescription?: string;
39
+ /**
40
+ * Sets the close button tooltip alignment
41
+ */
42
+ closeIconTooltipAlignment?: string;
39
43
  /**
40
44
  * Determines whether the side panel should render the condensed version (affects action buttons primarily)
41
45
  */
@@ -32,6 +32,7 @@ const componentName = 'SidePanel';
32
32
  const defaults = {
33
33
  animateTitle: true,
34
34
  closeIconDescription: 'Close',
35
+ closeIconTooltipAlignment: 'left',
35
36
  currentStep: 0,
36
37
  hideCloseButton: false,
37
38
  navigationBackIconDescription: 'Back',
@@ -51,6 +52,7 @@ const SidePanelBase = /*#__PURE__*/React__default.forwardRef((props, ref) => {
51
52
  children,
52
53
  className,
53
54
  closeIconDescription = defaults.closeIconDescription,
55
+ closeIconTooltipAlignment = defaults.closeIconTooltipAlignment,
54
56
  condensedActions,
55
57
  currentStep = defaults.currentStep,
56
58
  decorator,
@@ -465,9 +467,9 @@ const SidePanelBase = /*#__PURE__*/React__default.forwardRef((props, ref) => {
465
467
  onClick: onRequestClose,
466
468
  onKeyDown: slideIn ? undefined : handleEscapeKey,
467
469
  ref: closeRef,
468
- align: "left"
470
+ align: closeIconTooltipAlignment
469
471
  }, /*#__PURE__*/React__default.createElement(Close, {
470
- size: 20,
472
+ size: 16,
471
473
  "aria-hidden": "true",
472
474
  tabIndex: "-1",
473
475
  className: `${blockClass}--btn__icon`
@@ -627,6 +629,10 @@ SidePanel.propTypes = {
627
629
  * Sets the close button icon description
628
630
  */
629
631
  closeIconDescription: PropTypes.string,
632
+ /**
633
+ * Sets the close button tooltip alignment
634
+ */
635
+ closeIconTooltipAlignment: PropTypes.string,
630
636
  /**
631
637
  * Determines whether the side panel should render the condensed version (affects action buttons primarily)
632
638
  */
@@ -258,7 +258,7 @@ const TearsheetShell = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
258
258
  onKeyDown: keyDownListener,
259
259
  preventCloseOnClickOutside: !isPassive,
260
260
  ref: modalRef,
261
- selectorsFloatingMenus: [`.${carbonPrefix}--overflow-menu-options`, `.${carbonPrefix}--tooltip`, '.flatpickr-calendar', `.${bc}__container`, ...selectorsFloatingMenus],
261
+ selectorsFloatingMenus: [`.${carbonPrefix}--overflow-menu-options`, `.${carbonPrefix}--tooltip`, '.flatpickr-calendar', `.${bc}__container`, `.${carbonPrefix}--menu`, ...selectorsFloatingMenus],
262
262
  size: "sm"
263
263
  }), includeHeader && /*#__PURE__*/React__default.createElement(ModalHeader, {
264
264
  className: cx(`${bc}__header`, {
@@ -298,7 +298,8 @@ const TearsheetShell = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
298
298
  neverRender: influencerPosition === 'right',
299
299
  element: SectionLevel3
300
300
  }, /*#__PURE__*/React__default.createElement(Wrap, {
301
- element: Layer
301
+ element: Layer,
302
+ className: `${bc}__layer`
302
303
  }, influencer)), /*#__PURE__*/React__default.createElement(Wrap, {
303
304
  className: `${bc}__right`
304
305
  }, /*#__PURE__*/React__default.createElement(Wrap, {
@@ -308,8 +309,9 @@ const TearsheetShell = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
308
309
  className: `${bc}__content`,
309
310
  alwaysRender: !!(influencer && influencerPosition === 'right'),
310
311
  element: SectionLevel3
311
- }, /*#__PURE__*/React__default.createElement(Wrap, {
312
- element: !wide ? Layer : undefined
312
+ }, wide ? children : /*#__PURE__*/React__default.createElement(Wrap, {
313
+ element: Layer,
314
+ className: `${bc}__layer`
313
315
  }, children)), /*#__PURE__*/React__default.createElement(Wrap, {
314
316
  className: cx({
315
317
  [`${bc}__influencer`]: true,
@@ -318,7 +320,8 @@ const TearsheetShell = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
318
320
  neverRender: influencerPosition !== 'right',
319
321
  element: SectionLevel3
320
322
  }, /*#__PURE__*/React__default.createElement(Wrap, {
321
- element: Layer
323
+ element: Layer,
324
+ className: `${bc}__layer`
322
325
  }, influencer))), includeActions && /*#__PURE__*/React__default.createElement(Wrap, {
323
326
  className: `${bc}__button-container`
324
327
  }, /*#__PURE__*/React__default.createElement(ActionSet, {
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
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
+ import { PopoverAlignment } from '@carbon/react';
9
+ interface TruncatedTextProps {
10
+ /**
11
+ * Specify how the tooltip should align with the content in tooltip variant. Refer to Carbon tooltip docs for additional information.
12
+ */
13
+ align?: PopoverAlignment;
14
+ /**
15
+ * Specify whether a auto align functionality should be applied in tooltip variant. Refer to Carbon tooltip docs for additional information.
16
+ */
17
+ autoAlign?: boolean;
18
+ /**
19
+ * Optional class.
20
+ */
21
+ className?: string;
22
+ /**
23
+ * The label on the collapse button.
24
+ */
25
+ collapseLabel?: string;
26
+ /**
27
+ * The label on expand button.
28
+ */
29
+ expandLabel?: string;
30
+ /**
31
+ * Unique identifier for the element.
32
+ */
33
+ id: string;
34
+ /**
35
+ * The maximum number of lines to display before truncation.
36
+ */
37
+ lines?: number;
38
+ /**
39
+ * The method to display the full text when truncated. Options are "tooltip" or "expand". if not passed, the text would just be truncated with ellipsis.
40
+ */
41
+ type?: 'tooltip' | 'expand';
42
+ /**
43
+ * The string value to be truncated.
44
+ */
45
+ value?: string;
46
+ }
47
+ export declare let TruncatedText: React.ForwardRefExoticComponent<TruncatedTextProps & React.RefAttributes<HTMLDivElement>>;
48
+ export {};
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2025
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
+
8
+ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import React__default, { forwardRef, useState } from 'react';
10
+ import cx from 'classnames';
11
+ import { Tooltip } from '@carbon/react';
12
+ import { pkg } from '../../settings.js';
13
+ import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
14
+ import useTruncatedText from './useTruncatedText.js';
15
+
16
+ const blockClass = `${pkg.prefix}--truncated-text`;
17
+ const componentName = 'TruncatedText';
18
+ let TruncatedText = /*#__PURE__*/forwardRef((props, ref) => {
19
+ const {
20
+ align = 'top',
21
+ autoAlign = false,
22
+ className,
23
+ collapseLabel,
24
+ expandLabel,
25
+ id = `${blockClass}-default-id`,
26
+ lines = 2,
27
+ value,
28
+ type = 'tooltip',
29
+ ...rest
30
+ } = props;
31
+ const [expanded, setExpanded] = useState(false);
32
+ const {
33
+ ref: contentRef,
34
+ truncated
35
+ } = useTruncatedText({
36
+ lines,
37
+ value,
38
+ expanded
39
+ });
40
+ const textContentStyles = {
41
+ WebkitLineClamp: type === 'expand' && !expanded || type === 'tooltip' ? lines : 'none'
42
+ };
43
+ const textContentClasses = cx(`${blockClass}__text-content`, {
44
+ [`${blockClass}__text-content--expanded`]: expanded
45
+ });
46
+ const handleExpand = () => {
47
+ setExpanded(!expanded);
48
+ };
49
+ const handleExpandKey = evt => {
50
+ const {
51
+ key
52
+ } = evt;
53
+ if (key === 'Enter' || key === ' ') {
54
+ handleExpand();
55
+ }
56
+ };
57
+ const valueBody = /*#__PURE__*/React__default.createElement("span", {
58
+ ref: contentRef,
59
+ className: textContentClasses,
60
+ id: id,
61
+ style: textContentStyles
62
+ }, value);
63
+ const tooltipVariant = /*#__PURE__*/React__default.createElement(Tooltip, {
64
+ align: align,
65
+ autoAlign: autoAlign,
66
+ label: value
67
+ }, valueBody);
68
+ const expandVariant = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, valueBody, /*#__PURE__*/React__default.createElement("span", {
69
+ "aria-controls": id,
70
+ "aria-expanded": expanded,
71
+ className: `${blockClass}__expand-toggle`,
72
+ onClick: handleExpand,
73
+ onKeyDown: handleExpandKey,
74
+ role: "button",
75
+ tabIndex: 0
76
+ }, expanded ? collapseLabel : expandLabel));
77
+ const truncatedBody = type === 'expand' ? expandVariant : tooltipVariant;
78
+ return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
79
+ className: cx(blockClass, className),
80
+ ref: ref
81
+ }, getDevtoolsProps(componentName)), truncated ? truncatedBody : valueBody);
82
+ });
83
+ TruncatedText = pkg.checkComponentEnabled(TruncatedText, componentName);
84
+ TruncatedText.displayName = componentName;
85
+
86
+ export { TruncatedText };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
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
+ export { TruncatedText } from './TruncatedText';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
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
+ interface Params {
8
+ lines?: number;
9
+ value?: string;
10
+ expanded?: boolean;
11
+ }
12
+ export default function useTruncatedText({ lines, value, expanded }: Params): {
13
+ ref: import("react").RefObject<HTMLElement | null>;
14
+ truncated: boolean;
15
+ };
16
+ export {};
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2025
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
+
8
+ import { useState, useRef, useEffect } from 'react';
9
+ import { checkHeightOverflow } from '../../global/js/utils/checkForOverflow.js';
10
+
11
+ function useTruncatedText(_ref) {
12
+ let {
13
+ lines,
14
+ value,
15
+ expanded
16
+ } = _ref;
17
+ const [truncated, setTruncated] = useState(false);
18
+ const ref = useRef(null);
19
+ useEffect(() => {
20
+ const resizeObserver = new ResizeObserver(() => {
21
+ if (!expanded) {
22
+ const result = checkHeightOverflow(ref.current);
23
+ if (result !== truncated) {
24
+ setTruncated(result);
25
+ }
26
+ }
27
+ });
28
+ if (ref.current) {
29
+ resizeObserver.observe(ref.current);
30
+ }
31
+ return () => {
32
+ resizeObserver.disconnect();
33
+ };
34
+ }, [expanded, lines, value, truncated]);
35
+ return {
36
+ ref,
37
+ truncated
38
+ };
39
+ }
40
+
41
+ export { useTruncatedText as default };
@@ -38,6 +38,7 @@ export * from './EditFullPage';
38
38
  export * from './EditUpdateCards';
39
39
  export * from './Checklist';
40
40
  export { Coachmark } from './Coachmark';
41
+ export { Coachmark as preview__Coachmark } from './Coachmark/next/Coachmark';
41
42
  export * from './CoachmarkBeacon';
42
43
  export * from './CoachmarkButton';
43
44
  export * from './CoachmarkFixed';
@@ -47,8 +48,9 @@ export * from './CoachmarkStack';
47
48
  export * from './Guidebanner';
48
49
  export * from './InlineTip';
49
50
  export * from './NonLinearReading';
50
- export * from './BigNumbers';
51
+ export * from './BigNumber';
51
52
  export * from './TruncatedList';
53
+ export * from './TruncatedText';
52
54
  export * from './InterstitialScreen';
53
55
  export * from './DelimitedList';
54
56
  export * from './Decorator';
@@ -5,5 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import { RefObject } from 'react';
8
- export declare function useOverflowStringWidth(elementRef: RefObject<HTMLElement>): boolean | undefined;
9
- export declare const useOverflowStringHeight: (elementRef: RefObject<HTMLElement>) => boolean | undefined;
8
+ export declare function useOverflowStringWidth(elementRef: RefObject<HTMLElement | null>): boolean | undefined;
9
+ export declare const useOverflowStringHeight: (elementRef: RefObject<HTMLElement | null>) => boolean | undefined;
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import { RefObject } from 'react';
8
- export declare const useResizeObserver: (ref: RefObject<HTMLElement>, onResize?: (rect: DOMRectReadOnly) => void) => {
8
+ export declare const useResizeObserver: (ref: RefObject<HTMLElement | null>, onResize?: (rect: DOMRectReadOnly) => void) => {
9
9
  width: number;
10
10
  height: number;
11
11
  };
@@ -81,8 +81,9 @@ declare namespace defaults {
81
81
  let Nav: boolean;
82
82
  let NavItem: boolean;
83
83
  let NavList: boolean;
84
- let BigNumbers: boolean;
84
+ let BigNumber: boolean;
85
85
  let TruncatedList: boolean;
86
+ let TruncatedText: boolean;
86
87
  let DelimitedList: boolean;
87
88
  let ScrollGradient: boolean;
88
89
  let StringFormatter: boolean;
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- // Copyright IBM Corp. 2020, 2024
8
+ // Copyright IBM Corp. 2020, 2025
9
9
  //
10
10
  // This source code is licensed under the Apache-2.0 license found in the
11
11
  // LICENSE file in the root directory of this source tree.
@@ -77,8 +77,9 @@ const defaults = {
77
77
  Nav: false,
78
78
  NavItem: false,
79
79
  NavList: false,
80
- BigNumbers: false,
80
+ BigNumber: false,
81
81
  TruncatedList: false,
82
+ TruncatedText: false,
82
83
  DelimitedList: false,
83
84
  ScrollGradient: false,
84
85
  StringFormatter: false,
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2025
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
+
8
+ // Copyright IBM Corp. 2024, 2024
9
+ //
10
+ // This source code is licensed under the Apache-2.0 license found in the
11
+ // LICENSE file in the root directory of this source tree.
12
+ //
13
+
14
+ const checkHeightOverflow = el => {
15
+ if (el) {
16
+ return el?.offsetHeight < el?.scrollHeight;
17
+ }
18
+ return false;
19
+ };
20
+
21
+ export { checkHeightOverflow };
@@ -0,0 +1 @@
1
+ export { makeDraggable } from "./makeDraggable";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025, 2025
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
+ interface DraggableProps {
8
+ el: HTMLElement;
9
+ dragHandle?: HTMLElement;
10
+ focusableDragHandle?: HTMLElement;
11
+ dragStep?: number;
12
+ shiftDragStep?: number;
13
+ }
14
+ /**
15
+ * Makes a given element draggable using a handle element.
16
+ *@param draggable - object which accepts el and optional attributes handle,focusableInHandle,dragStep and shiftDragStep
17
+ */
18
+ export declare function makeDraggable({ el, dragHandle, focusableDragHandle, dragStep, shiftDragStep, }: DraggableProps): void;
19
+ export {};
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2025
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
+
8
+ /**
9
+ * Makes a given element draggable using a handle element.
10
+ *@param draggable - object which accepts el and optional attributes handle,focusableInHandle,dragStep and shiftDragStep
11
+ */
12
+
13
+ function makeDraggable(_ref) {
14
+ let {
15
+ el,
16
+ dragHandle,
17
+ focusableDragHandle,
18
+ dragStep,
19
+ shiftDragStep
20
+ } = _ref;
21
+ const computedStyle = window.getComputedStyle(el);
22
+ if (dragHandle) {
23
+ dragHandle.style.cursor = 'move';
24
+ el.style.cursor = 'default';
25
+ } else {
26
+ el.style.cursor = 'move';
27
+ }
28
+ const position = computedStyle.position;
29
+ if (position !== 'absolute' && position !== 'relative' && position !== 'fixed') {
30
+ el.style.position = 'relative';
31
+ }
32
+ let isDragging = false;
33
+ let offsetX = 0;
34
+ let offsetY = 0;
35
+ function onKeyDown(e) {
36
+ const distance = e.shiftKey ? shiftDragStep ?? 32 : dragStep ?? 8;
37
+ switch (e.key) {
38
+ case 'Enter':
39
+ case ' ':
40
+ e.preventDefault();
41
+ break;
42
+ case 'ArrowLeft':
43
+ el.style.left = `${el.offsetLeft - distance}px`;
44
+ break;
45
+ case 'ArrowRight':
46
+ el.style.left = `${el.offsetLeft + distance}px`;
47
+ break;
48
+ case 'ArrowUp':
49
+ el.style.top = `${el.offsetTop - distance}px`;
50
+ break;
51
+ case 'ArrowDown':
52
+ el.style.top = `${el.offsetTop + distance}px`;
53
+ break;
54
+ }
55
+ }
56
+ function onMouseDown(e) {
57
+ const isTargetInHandle = dragHandle ? dragHandle.contains(e.target) : el.contains(e.target);
58
+ if (!isTargetInHandle) {
59
+ return;
60
+ }
61
+ offsetX = e.clientX - el.offsetLeft;
62
+ offsetY = e.clientY - el.offsetTop;
63
+ isDragging = true;
64
+ document.addEventListener('mousemove', onMouseMove);
65
+ document.addEventListener('mouseup', onMouseUp, {
66
+ once: true
67
+ });
68
+ }
69
+ function onMouseMove(e) {
70
+ if (!isDragging) {
71
+ return;
72
+ }
73
+ el.style.left = `${e.clientX - offsetX}px`;
74
+ el.style.top = `${e.clientY - offsetY}px`;
75
+ }
76
+ function onMouseUp() {
77
+ if (!isDragging) {
78
+ return;
79
+ }
80
+ isDragging = false;
81
+ document.removeEventListener('mousemove', onMouseMove);
82
+ }
83
+ if (dragHandle) {
84
+ dragHandle.addEventListener('mousedown', onMouseDown);
85
+ } else {
86
+ el.addEventListener('mousedown', onMouseDown);
87
+ }
88
+ focusableDragHandle?.addEventListener('keydown', onKeyDown);
89
+ }
90
+
91
+ export { makeDraggable };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
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
+ import './_storybook-styles.scss';
9
+ import mdx from './makeDraggable.mdx';
10
+ declare const _default: {
11
+ title: string;
12
+ parameters: {
13
+ layout: string;
14
+ docs: {
15
+ page: typeof mdx;
16
+ };
17
+ };
18
+ tags: string[];
19
+ };
20
+ export default _default;
21
+ export declare const DraggableCustomDiv: () => React.JSX.Element;
22
+ export declare const DraggablePopover: () => React.JSX.Element;
package/es/index.js CHANGED
@@ -82,6 +82,7 @@ export { Checklist } from './components/Checklist/Checklist.js';
82
82
  export { Coachmark } from './components/Coachmark/Coachmark.js';
83
83
  import 'react';
84
84
  import './components/Coachmark/CoachmarkTagline.js';
85
+ export { Coachmark as preview__Coachmark } from './components/Coachmark/next/Coachmark/Coachmark.js';
85
86
  export { CoachmarkBeacon } from './components/CoachmarkBeacon/CoachmarkBeacon.js';
86
87
  export { CoachmarkButton } from './components/CoachmarkButton/CoachmarkButton.js';
87
88
  export { CoachmarkFixed } from './components/CoachmarkFixed/CoachmarkFixed.js';
@@ -95,8 +96,9 @@ export { InlineTip } from './components/InlineTip/InlineTip.js';
95
96
  export { InlineTipButton } from './components/InlineTip/InlineTipButton.js';
96
97
  export { InlineTipLink } from './components/InlineTip/InlineTipLink.js';
97
98
  export { NonLinearReading } from './components/NonLinearReading/NonLinearReading.js';
98
- export { BigNumbers } from './components/BigNumbers/BigNumbers.js';
99
+ export { BigNumber } from './components/BigNumber/BigNumber.js';
99
100
  export { TruncatedList } from './components/TruncatedList/TruncatedList.js';
101
+ export { TruncatedText } from './components/TruncatedText/TruncatedText.js';
100
102
  export { InterstitialScreen } from './components/InterstitialScreen/InterstitialScreen.js';
101
103
  export { DelimitedList } from './components/DelimitedList/DelimitedList.js';
102
104
  export { FullPageError } from './components/FullPageError/FullPageError.js';