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