@carbon/ibm-products 2.34.0 → 2.35.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. package/css/index-full-carbon.css +31910 -32273
  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 +38 -17
  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 +568 -24320
  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 +2145 -17925
  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.d.ts +38 -2
  18. package/es/components/ActionSet/ActionSet.js +3 -5
  19. package/es/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
  20. package/es/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
  21. package/es/components/ConditionBuilder/ConditionBuilder.js +125 -0
  22. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
  23. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +92 -0
  24. package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
  25. package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +88 -0
  26. package/es/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
  27. package/es/components/ConditionBuilder/index.d.ts +1 -0
  28. package/es/components/CreateFullPage/CreateFullPage.js +3 -19
  29. package/es/components/CreateFullPage/CreateFullPageStep.js +22 -7
  30. package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
  31. package/es/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
  32. package/es/components/Datagrid/useEditableCell.js +15 -0
  33. package/es/components/DelimitedList/DelimitedList.d.ts +27 -2
  34. package/es/components/DelimitedList/DelimitedList.js +0 -1
  35. package/es/components/EditInPlace/EditInPlace.d.ts +97 -5
  36. package/es/components/EditInPlace/EditInPlace.js +10 -6
  37. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
  38. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
  39. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
  40. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
  41. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
  42. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
  43. package/es/components/ExportModal/ExportModal.d.ts +110 -2
  44. package/es/components/ExportModal/ExportModal.js +10 -4
  45. package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +1 -1
  46. package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +2 -2
  47. package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
  48. package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +5 -9
  49. package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +1 -1
  50. package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
  51. package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +92 -0
  52. package/es/components/FilterPanel/index.d.ts +1 -0
  53. package/es/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
  54. package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
  55. package/es/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
  56. package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
  57. package/es/components/ImportModal/ImportModal.d.ts +136 -2
  58. package/es/components/ImportModal/ImportModal.js +3 -2
  59. package/es/components/InlineTip/InlineTip.d.ts +90 -2
  60. package/es/components/InlineTip/InlineTip.js +3 -2
  61. package/es/components/Nav/Nav.js +1 -1
  62. package/es/components/Nav/NavList.js +7 -7
  63. package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
  64. package/es/components/PageHeader/PageHeader.js +3 -3
  65. package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  66. package/es/components/PageHeader/PageHeaderUtils.js +4 -3
  67. package/es/components/SidePanel/SidePanel.js +52 -36
  68. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
  69. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
  70. package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
  71. package/es/components/TagOverflow/TagOverflow.js +209 -0
  72. package/es/components/TagOverflow/constants.d.ts +14 -0
  73. package/es/components/TagOverflow/constants.js +30 -0
  74. package/es/components/TagOverflow/index.d.ts +1 -0
  75. package/es/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
  76. package/es/components/Tearsheet/TearsheetNarrow.js +6 -1
  77. package/es/components/Toolbar/Toolbar.d.ts +23 -5
  78. package/es/components/Toolbar/Toolbar.js +30 -26
  79. package/es/components/UserAvatar/UserAvatar.js +4 -2
  80. package/es/components/index.d.ts +4 -2
  81. package/es/global/js/package-settings.d.ts +3 -0
  82. package/es/global/js/package-settings.js +3 -0
  83. package/es/index.js +4 -0
  84. package/es/settings.d.ts +3 -0
  85. package/lib/components/ActionSet/ActionSet.d.ts +38 -2
  86. package/lib/components/ActionSet/ActionSet.js +3 -5
  87. package/lib/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
  88. package/lib/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
  89. package/lib/components/ConditionBuilder/ConditionBuilder.js +132 -0
  90. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
  91. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +100 -0
  92. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
  93. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +98 -0
  94. package/lib/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
  95. package/lib/components/ConditionBuilder/index.d.ts +1 -0
  96. package/lib/components/CreateFullPage/CreateFullPage.js +2 -18
  97. package/lib/components/CreateFullPage/CreateFullPageStep.js +20 -5
  98. package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
  99. package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
  100. package/lib/components/Datagrid/useEditableCell.js +19 -0
  101. package/lib/components/DelimitedList/DelimitedList.d.ts +27 -2
  102. package/lib/components/DelimitedList/DelimitedList.js +0 -1
  103. package/lib/components/EditInPlace/EditInPlace.d.ts +97 -5
  104. package/lib/components/EditInPlace/EditInPlace.js +10 -6
  105. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
  106. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
  107. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
  108. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
  109. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
  110. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
  111. package/lib/components/ExportModal/ExportModal.d.ts +110 -2
  112. package/lib/components/ExportModal/ExportModal.js +10 -4
  113. package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +1 -1
  114. package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +2 -2
  115. package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
  116. package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +5 -9
  117. package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +1 -1
  118. package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
  119. package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +99 -0
  120. package/lib/components/FilterPanel/index.d.ts +1 -0
  121. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
  122. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
  123. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
  124. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
  125. package/lib/components/ImportModal/ImportModal.d.ts +136 -2
  126. package/lib/components/ImportModal/ImportModal.js +3 -2
  127. package/lib/components/InlineTip/InlineTip.d.ts +90 -2
  128. package/lib/components/InlineTip/InlineTip.js +3 -2
  129. package/lib/components/Nav/Nav.js +1 -1
  130. package/lib/components/Nav/NavList.js +7 -7
  131. package/lib/components/NotificationsPanel/NotificationsPanel.js +1 -1
  132. package/lib/components/PageHeader/PageHeader.js +3 -3
  133. package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  134. package/lib/components/PageHeader/PageHeaderUtils.js +4 -3
  135. package/lib/components/SidePanel/SidePanel.js +52 -36
  136. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
  137. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
  138. package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
  139. package/lib/components/TagOverflow/TagOverflow.js +216 -0
  140. package/lib/components/TagOverflow/constants.d.ts +14 -0
  141. package/lib/components/TagOverflow/constants.js +34 -0
  142. package/lib/components/TagOverflow/index.d.ts +1 -0
  143. package/lib/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
  144. package/lib/components/Tearsheet/TearsheetNarrow.js +6 -1
  145. package/lib/components/Toolbar/Toolbar.d.ts +23 -5
  146. package/lib/components/Toolbar/Toolbar.js +30 -26
  147. package/lib/components/UserAvatar/UserAvatar.js +4 -2
  148. package/lib/components/index.d.ts +4 -2
  149. package/lib/global/js/package-settings.d.ts +3 -0
  150. package/lib/global/js/package-settings.js +3 -0
  151. package/lib/index.js +17 -0
  152. package/lib/settings.d.ts +3 -0
  153. package/package.json +3 -3
  154. package/scss/components/Coachmark/_coachmark-dragbar.scss +0 -1
  155. package/scss/components/Coachmark/_coachmark-tagline.scss +2 -2
  156. package/scss/components/ConditionBuilder/_carbon-imports.scss +9 -0
  157. package/scss/components/ConditionBuilder/_condition-builder.scss +25 -0
  158. package/scss/components/ConditionBuilder/_index-with-carbon.scss +9 -0
  159. package/scss/components/ConditionBuilder/_index.scss +8 -0
  160. package/scss/components/CreateFullPage/_create-full-page.scss +10 -10
  161. package/scss/components/Datagrid/styles/_useNestedRows.scss +5 -1
  162. package/scss/components/FilterPanel/_carbon-imports.scss +5 -0
  163. package/scss/components/FilterPanel/_filter-panel-accordion-item.scss +1 -3
  164. package/scss/components/FilterPanel/_filter-panel-checkbox-with-overflow.scss +0 -2
  165. package/scss/components/FilterPanel/_filter-panel-checkbox.scss +0 -1
  166. package/scss/components/FilterPanel/_filter-panel-search.scss +38 -0
  167. package/scss/components/FilterPanel/_index-with-carbon.scss +1 -0
  168. package/scss/components/FilterPanel/_index.scss +1 -0
  169. package/scss/components/Guidebanner/_guidebanner.scss +1 -1
  170. package/scss/components/InlineTip/_inline-tip.scss +1 -1
  171. package/scss/components/ProductiveCard/_productive-card.scss +13 -0
  172. package/scss/components/SidePanel/_side-panel.scss +9 -9
  173. package/scss/components/TagOverflow/_carbon-imports.scss +9 -0
  174. package/scss/components/TagOverflow/_index-with-carbon.scss +9 -0
  175. package/scss/components/TagOverflow/_index.scss +8 -0
  176. package/scss/components/TagOverflow/_tag-overflow.scss +55 -0
  177. package/scss/components/Tearsheet/_tearsheet.scss +10 -0
  178. package/scss/components/UserAvatar/_user-avatar.scss +1 -0
  179. package/scss/components/_index-with-carbon.scss +2 -0
  180. package/scss/components/_index.scss +2 -0
@@ -1,7 +1,95 @@
1
+ /**
2
+ * Copyright IBM Corp. 2023, 2023
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
+ type MediaType = {
9
+ render?: () => ReactNode;
10
+ filePaths?: string[];
11
+ };
12
+ interface InlineTipProps {
13
+ /**
14
+ * Optional "call to action" ghost button or link that can appear
15
+ * directly below the content. This component comes with pre-styled
16
+ * elements available to use: `InlineTipLink` and `InlineTipButton`.
17
+ */
18
+ action?: ReactNode;
19
+ /**
20
+ * Provide the contents of the InlineTip.
21
+ */
22
+ children: ReactNode;
23
+ /**
24
+ * Provide an optional class to be applied to the containing node.
25
+ */
26
+ className?: string;
27
+ /**
28
+ * Tooltip text and aria label for the Close button icon.
29
+ */
30
+ closeIconDescription?: string;
31
+ /**
32
+ * The label for the collapse button.
33
+ * This button is not visible if `media` is specified.
34
+ */
35
+ collapseButtonLabel?: string;
36
+ /**
37
+ * If set to `true`, it will truncate the body text to
38
+ * one line and expose an expand/collapse button toggle.
39
+ *
40
+ * This feature is disabled if `media` is specified.
41
+ */
42
+ collapsible?: boolean;
43
+ /**
44
+ * The label for the expand button.
45
+ * This button is not visible if `media` is specified.
46
+ */
47
+ expandButtonLabel?: string;
48
+ /**
49
+ * The object describing an image in one of two shapes.
50
+ * - If a single media element is required, use `{render}`.
51
+ * - If a stepped animation is required, use `{filePaths}`.
52
+ *
53
+ * Enabling `media` disables the `collapsible` feature.
54
+ */
55
+ media: MediaType;
56
+ /**
57
+ * Set to `true` to arrange the information in a format
58
+ * that is easier to read in a limited space.
59
+ */
60
+ narrow?: boolean;
61
+ /**
62
+ * Function to call when the tertiary button is clicked.
63
+ */
64
+ onClick?: () => void;
65
+ /**
66
+ * Function to call when the InlineTip is closed via the "X" button.
67
+ */
68
+ onClose?: () => void;
69
+ /**
70
+ * Defining the label will show a the tertiary button with the crossroads icon.
71
+ * You will still need to define the `onClose` method to trigger a callback.
72
+ */
73
+ tertiaryButtonLabel?: string;
74
+ /**
75
+ * The title of the InlineTip.
76
+ */
77
+ title: string;
78
+ /**
79
+ * If true, insert 1 rem of "space" on the left of the component.
80
+ * This will allow the component's content to line up with other
81
+ * content on the page under special circumstances.
82
+ *
83
+ * This will only be applied when `narrow` is false.
84
+ */
85
+ withLeftGutter?: boolean;
86
+ }
1
87
  /**
2
88
  * Inline tips are messages embedded within other components that
3
89
  * provide an ambient way to deliver learning content without
4
90
  * distracting the user from their flow.
5
91
  */
6
- export let InlineTip: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
7
- import React from 'react';
92
+ export declare let InlineTip: React.ForwardRefExoticComponent<InlineTipProps & {
93
+ children?: React.ReactNode;
94
+ } & React.RefAttributes<HTMLDivElement>>;
95
+ export {};
@@ -44,9 +44,9 @@ var defaults = {
44
44
  narrow: false,
45
45
  withLeftGutter: false,
46
46
  onClick: function onClick() {},
47
- onClose: function onClose() {}
47
+ onClose: function onClose() {},
48
+ title: 'Use case-specific heading'
48
49
  };
49
-
50
50
  /**
51
51
  * Inline tips are messages embedded within other components that
52
52
  * provide an ambient way to deliver learning content without
@@ -196,6 +196,7 @@ exports.InlineTip.propTypes = {
196
196
  *
197
197
  * Enabling `media` disables the `collapsible` feature.
198
198
  */
199
+ /**@ts-ignore*/
199
200
  media: index["default"].oneOfType([index["default"].shape({
200
201
  render: index["default"].func
201
202
  }), index["default"].shape({
@@ -111,7 +111,7 @@ exports.Nav = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
111
111
  */
112
112
  var handleListClick = function handleListClick(id) {
113
113
  Object.keys(navigationLists.current).forEach(function (key) {
114
- if (key !== id && !navigationLists.current[key].isExpandedOnPageload) {
114
+ if (key !== id && !navigationLists.current[key].isExpandedOnPageLoad) {
115
115
  navigationLists.current[key].close();
116
116
  }
117
117
  });
@@ -31,7 +31,7 @@ var defaults = {
31
31
  className: '',
32
32
  children: null,
33
33
  id: '',
34
- isExpandedOnPageload: false,
34
+ isExpandedOnPageLoad: false,
35
35
  onItemClick: function onItemClick() {},
36
36
  onListClick: function onListClick() {},
37
37
  tabIndex: 0,
@@ -50,8 +50,8 @@ var NavList = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
50
50
  icon = _ref$icon === void 0 ? defaults.icon : _ref$icon,
51
51
  _ref$id = _ref.id,
52
52
  id = _ref$id === void 0 ? defaults.id : _ref$id,
53
- _ref$isExpandedOnPage = _ref.isExpandedOnPageload,
54
- isExpandedOnPageload = _ref$isExpandedOnPage === void 0 ? defaults.isExpandedOnPageload : _ref$isExpandedOnPage,
53
+ _ref$isExpandedOnPage = _ref.isExpandedOnPageLoad,
54
+ isExpandedOnPageLoad = _ref$isExpandedOnPage === void 0 ? defaults.isExpandedOnPageLoad : _ref$isExpandedOnPage,
55
55
  _ref$navigationItemTi = _ref.navigationItemTitle,
56
56
  navigationItemTitle = _ref$navigationItemTi === void 0 ? defaults.navigationItemTitle : _ref$navigationItemTi,
57
57
  _ref$onItemClick = _ref.onItemClick,
@@ -62,7 +62,7 @@ var NavList = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
62
62
  tabIndex = _ref$tabIndex === void 0 ? defaults.tabIndex : _ref$tabIndex,
63
63
  _ref$title = _ref.title,
64
64
  title = _ref$title === void 0 ? defaults.title : _ref$title;
65
- var _useState = React.useState(isExpandedOnPageload),
65
+ var _useState = React.useState(isExpandedOnPageLoad),
66
66
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
67
67
  open = _useState2[0],
68
68
  setOpen = _useState2[1];
@@ -74,7 +74,7 @@ var NavList = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
74
74
  var childProps = _ref3.props;
75
75
  return childProps.href;
76
76
  });
77
- setOpen(hrefs.includes(activeHref) || isExpandedOnPageload);
77
+ setOpen(hrefs.includes(activeHref) || isExpandedOnPageLoad);
78
78
  // eslint-disable-next-line react-hooks/exhaustive-deps
79
79
  }, []);
80
80
 
@@ -108,7 +108,7 @@ var NavList = /*#__PURE__*/React__default["default"].forwardRef(function (_ref,
108
108
  React.useImperativeHandle(ref, function () {
109
109
  return {
110
110
  close: close,
111
- isExpandedOnPageload: isExpandedOnPageload
111
+ isExpandedOnPageLoad: isExpandedOnPageLoad
112
112
  };
113
113
  });
114
114
  var newChildren = React__default["default"].Children.map(children, function (child, index) {
@@ -159,7 +159,7 @@ NavList.propTypes = {
159
159
  /** @type {string} ID of a list. */
160
160
  id: index.propTypesExports.string,
161
161
  /** @type {boolean} State of a list. */
162
- isExpandedOnPageload: index.propTypesExports.bool,
162
+ isExpandedOnPageLoad: index.propTypesExports.bool,
163
163
  /** @type {boolean} Title of nav. */
164
164
  navigationItemTitle: index.propTypesExports.string,
165
165
  /** @type {Function} Click handler for an item. */
@@ -326,7 +326,7 @@ exports.NotificationsPanel = /*#__PURE__*/React__default["default"].forwardRef(f
326
326
  id: blockClass,
327
327
  className: cx__default["default"](blockClass, className, "".concat(blockClass, "__container")),
328
328
  style: {
329
- animation: !reducedMotion.matches ? "".concat(open ? 'fade-in 250ms' : 'fade-out 250ms') : null
329
+ animation: !reducedMotion.matches ? "".concat(open ? 'fade-in 250ms' : 'fade-out forwards 250ms') : null
330
330
  },
331
331
  onAnimationEnd: onAnimationEnd,
332
332
  ref: ref || notificationPanelRef
@@ -195,7 +195,7 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
195
195
  checkUpdateVerticalSpace();
196
196
  };
197
197
  var handleCollapseToggle = function handleCollapseToggle() {
198
- PageHeaderUtils.utilSetCollapsed(!fullyCollapsed, metrics.headerOffset, metrics.headerTopValue);
198
+ PageHeaderUtils.utilSetCollapsed(!fullyCollapsed, headerRef, metrics.headerOffset, metrics.headerTopValue);
199
199
  };
200
200
 
201
201
  // use effects
@@ -314,9 +314,9 @@ exports.PageHeader = /*#__PURE__*/React__default["default"].forwardRef(function
314
314
  };
315
315
  React.useEffect(function () {
316
316
  if (collapseHeader === true) {
317
- PageHeaderUtils.utilSetCollapsed(collapseHeader, metrics.headerOffset, metrics.headerTopValue);
317
+ PageHeaderUtils.utilSetCollapsed(collapseHeader, headerRef, metrics.headerOffset, metrics.headerTopValue);
318
318
  }
319
- }, [collapseHeader, metrics.headerOffset, metrics.headerTopValue]);
319
+ }, [collapseHeader, metrics.headerOffset, metrics.headerTopValue, headerRef]);
320
320
  useResizeObserver.useResizeObserver(sizingContainerRef, handleResizeActionBarColumn);
321
321
  useResizeObserver.useResizeObserver(headerRef, handleResize);
322
322
 
@@ -1,6 +1,6 @@
1
1
  export const blockClass: string;
2
2
  export function utilCheckUpdateVerticalSpace(headerRef: {}, offsetTopMeasuringRef: {}, navigation: {}, enableBreadcrumbScroll: boolean, hasActionBar: boolean, widthIsNarrow: boolean, setMetrics: () => any): void;
3
- export function utilSetCollapsed(collapse: any, headerOffset: any, headerTopValue: any): void;
3
+ export function utilSetCollapsed(collapse: any, headerRef: any, headerOffset: any, headerTopValue: any): void;
4
4
  export function utilGetBreadcrumbItemForTitle(blockClass: any, collapseTitle: any, title: any): {
5
5
  label: any;
6
6
  title: any;
@@ -148,16 +148,17 @@ var utilCheckUpdateVerticalSpace = function utilCheckUpdateVerticalSpace(headerR
148
148
  };
149
149
 
150
150
  // Trigger a window scroll, if necessary, to set the collapsed state.
151
- var utilSetCollapsed = function utilSetCollapsed(collapse, headerOffset, headerTopValue) {
151
+ var utilSetCollapsed = function utilSetCollapsed(collapse, headerRef, headerOffset, headerTopValue) {
152
152
  /* don't know how to test resize */
153
153
  /* istanbul ignore else */
154
+ var scrollableTarget = scrollableAncestor.scrollableAncestor(headerRef.current);
154
155
  if (collapse) {
155
- window.scrollTo({
156
+ scrollableTarget.scrollTo({
156
157
  top: headerOffset - headerTopValue,
157
158
  behavior: 'smooth'
158
159
  });
159
160
  } else {
160
- window.scrollTo({
161
+ scrollableTarget.scrollTo({
161
162
  top: 0,
162
163
  behavior: 'smooth'
163
164
  });
@@ -14,7 +14,6 @@ var React = require('react');
14
14
  var framerMotion = require('framer-motion');
15
15
  var index = require('../../node_modules/prop-types/index.js');
16
16
  var cx = require('classnames');
17
- var useResizeObserver = require('../../global/js/hooks/useResizeObserver.js');
18
17
  var carbonMotion = require('@carbon/motion');
19
18
  var devtools = require('../../global/js/utils/devtools.js');
20
19
  var propsHelper = require('../../global/js/utils/props-helper.js');
@@ -119,14 +118,48 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
119
118
  keyDownListener = _useFocus.keyDownListener;
120
119
  var panelRefValue = sidePanelRef.current;
121
120
  var shouldReduceMotion = framerMotion.useReducedMotion();
121
+
122
+ // Title animation on scroll related state
123
+ var _useState7 = React.useState(0),
124
+ _useState8 = _rollupPluginBabelHelpers.slicedToArray(_useState7, 2),
125
+ labelTextHeight = _useState8[0],
126
+ setLabelTextHeight = _useState8[1];
127
+ React.useEffect(function () {
128
+ if (open && !(titleRef !== null && titleRef !== void 0 && titleRef.current)) {
129
+ setDoAnimateTitle(false);
130
+ } else {
131
+ setDoAnimateTitle(animateTitle);
132
+ }
133
+ }, [animateTitle, open]);
134
+ var titleItemsStyles = React.useCallback(function (progress) {
135
+ if (subtitleRef !== null && subtitleRef !== void 0 && subtitleRef.current) {
136
+ var _subtitleEl$style;
137
+ var subtitleEl = subtitleRef === null || subtitleRef === void 0 ? void 0 : subtitleRef.current;
138
+ var height = subtitleEl === null || subtitleEl === void 0 ? void 0 : subtitleEl.clientHeight;
139
+ var calculatedMargin = height * progress;
140
+ subtitleEl === null || subtitleEl === void 0 || (_subtitleEl$style = subtitleEl.style) === null || _subtitleEl$style === void 0 || _subtitleEl$style.setProperty('margin-top', "".concat(-calculatedMargin, "px"));
141
+ }
142
+ if (labelTextRef !== null && labelTextRef !== void 0 && labelTextRef.current) {
143
+ var _labelTextRef$current;
144
+ var _calculatedMargin = labelTextHeight * progress;
145
+ labelTextRef === null || labelTextRef === void 0 || (_labelTextRef$current = labelTextRef.current) === null || _labelTextRef$current === void 0 || (_labelTextRef$current = _labelTextRef$current.style) === null || _labelTextRef$current === void 0 || _labelTextRef$current.setProperty('margin-top', "".concat(-_calculatedMargin, "px"));
146
+ }
147
+ }, [labelTextHeight]);
122
148
  React.useEffect(function () {
123
- setDoAnimateTitle(animateTitle);
124
- }, [animateTitle]);
149
+ if (open && animateTitle && labelTextRef !== null && labelTextRef !== void 0 && labelTextRef.current) {
150
+ var _labelTextRef$current2;
151
+ setLabelTextHeight(Number((labelTextRef === null || labelTextRef === void 0 || (_labelTextRef$current2 = labelTextRef.current) === null || _labelTextRef$current2 === void 0 ? void 0 : _labelTextRef$current2.clientHeight) || null));
152
+ }
153
+ }, [animateTitle, labelTextRef, open]);
125
154
  var handleScroll = React.useCallback(function () {
126
- var _animatedScrollRef$cu;
127
- var scrollTop = animatedScrollRef === null || animatedScrollRef === void 0 || (_animatedScrollRef$cu = animatedScrollRef.current) === null || _animatedScrollRef$cu === void 0 ? void 0 : _animatedScrollRef$cu.scrollTop;
128
- panelRefValue === null || panelRefValue === void 0 || panelRefValue.style.setProperty("--".concat(blockClass, "--scroll-animation-progress"), (Math.min(Number(scrollTop), scrollAnimationDistance) / scrollAnimationDistance).toString());
129
- }, [scrollAnimationDistance, panelRefValue]);
155
+ if (doAnimateTitle && innerContentRef !== null && innerContentRef !== void 0 && innerContentRef.current) {
156
+ var _innerContentRef$curr;
157
+ var scrollTop = innerContentRef === null || innerContentRef === void 0 || (_innerContentRef$curr = innerContentRef.current) === null || _innerContentRef$curr === void 0 ? void 0 : _innerContentRef$curr.scrollTop;
158
+ var animationProgress = Math.min(Number(scrollTop), scrollAnimationDistance) / scrollAnimationDistance;
159
+ panelRefValue === null || panelRefValue === void 0 || panelRefValue.style.setProperty("--".concat(blockClass, "--scroll-animation-progress"), animationProgress.toString());
160
+ titleItemsStyles(animationProgress);
161
+ }
162
+ }, [doAnimateTitle, panelRefValue === null || panelRefValue === void 0 ? void 0 : panelRefValue.style, scrollAnimationDistance, titleItemsStyles]);
130
163
  var reducedMotion = typeof window !== 'undefined' && (_window = window) !== null && _window !== void 0 && _window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : {
131
164
  matches: true
132
165
  };
@@ -134,8 +167,8 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
134
167
  // scroll panel to top going between steps
135
168
  React.useEffect(function () {
136
169
  if (sidePanelRef && panelRefValue) {
137
- var _animatedScrollRef$cu2;
138
- var scrollableSection = (_animatedScrollRef$cu2 = animatedScrollRef.current) !== null && _animatedScrollRef$cu2 !== void 0 ? _animatedScrollRef$cu2 : innerContentRef.current;
170
+ var _animatedScrollRef$cu;
171
+ var scrollableSection = (_animatedScrollRef$cu = animatedScrollRef.current) !== null && _animatedScrollRef$cu !== void 0 ? _animatedScrollRef$cu : innerContentRef.current;
139
172
  if (scrollableSection) {
140
173
  scrollableSection.scrollTop = 0;
141
174
  }
@@ -158,9 +191,9 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
158
191
  var checkSetDoAnimateTitle = function checkSetDoAnimateTitle() {
159
192
  var canDoAnimateTitle = false;
160
193
  if (panelRefValue && open && animateTitle && animationComplete && titleRef !== null && titleRef !== void 0 && titleRef.current && title && title.length && !reducedMotion.matches) {
161
- var _labelTextRef$current, _labelTextRef$current2, _subtitleRef$current$, _subtitleRef$current;
194
+ var _labelTextRef$current3, _labelTextRef$current4, _subtitleRef$current$, _subtitleRef$current;
162
195
  var titleEl = titleRef.current;
163
- var labelHeight = (_labelTextRef$current = labelTextRef === null || labelTextRef === void 0 || (_labelTextRef$current2 = labelTextRef.current) === null || _labelTextRef$current2 === void 0 ? void 0 : _labelTextRef$current2.offsetHeight) !== null && _labelTextRef$current !== void 0 ? _labelTextRef$current : 0;
196
+ var labelHeight = (_labelTextRef$current3 = labelTextRef === null || labelTextRef === void 0 || (_labelTextRef$current4 = labelTextRef.current) === null || _labelTextRef$current4 === void 0 ? void 0 : _labelTextRef$current4.offsetHeight) !== null && _labelTextRef$current3 !== void 0 ? _labelTextRef$current3 : 0;
164
197
  var subtitleHeight = (_subtitleRef$current$ = subtitleRef === null || subtitleRef === void 0 || (_subtitleRef$current = subtitleRef.current) === null || _subtitleRef$current === void 0 ? void 0 : _subtitleRef$current.offsetHeight) !== null && _subtitleRef$current$ !== void 0 ? _subtitleRef$current$ : 0;
165
198
 
166
199
  // Adjusts space at bottom of titles by changing where scrolling finishes
@@ -171,11 +204,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
171
204
 
172
205
  // used to calculate the header moves
173
206
  panelRefValue === null || panelRefValue === void 0 || panelRefValue.style.setProperty("--".concat(blockClass, "--scroll-animation-distance"), _scrollAnimationDistance.toString());
174
- var scrollEl = animatedScrollRef.current;
175
- if (!scrollEl && animateTitle && !doAnimateTitle) {
176
- // may be switching back based on resize
177
- scrollEl = innerContentRef.current;
178
- }
207
+ var scrollEl = innerContentRef.current;
179
208
  if (scrollEl) {
180
209
  var _window2;
181
210
  var innerComputed = (_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.getComputedStyle(innerContentRef.current);
@@ -189,20 +218,10 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
189
218
  }
190
219
  };
191
220
  React.useEffect(function () {
192
- if (doAnimateTitle && animatedScrollRef.current) {
193
- // only add scroll if the doAnimateTitle is already true
194
- // should come back through if false and canDoAnimateTitle is true
195
- animatedScrollRef.current.addEventListener('scroll', handleScroll);
196
- }
197
221
  if (!doAnimateTitle && sidePanelRef.current) {
198
222
  panelRefValue === null || panelRefValue === void 0 || panelRefValue.style.setProperty("--".concat(blockClass, "--scroll-animation-progress"), '0');
199
223
  }
200
- }, [animatedScrollRef, doAnimateTitle, handleScroll, sidePanelRef, panelRefValue]);
201
-
202
- /* istanbul ignore next */
203
- var handleResize = function handleResize() {
204
- checkSetDoAnimateTitle();
205
- };
224
+ }, [doAnimateTitle, handleScroll, sidePanelRef, innerContentRef, open, panelRefValue === null || panelRefValue === void 0 ? void 0 : panelRefValue.style]);
206
225
 
207
226
  // Calculate scroll distances
208
227
  React.useEffect(function () {
@@ -211,7 +230,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
211
230
  }
212
231
 
213
232
  // eslint-disable-next-line react-hooks/exhaustive-deps
214
- }, [open, doAnimateTitle /* use do instead of animateTitle directly */, animationComplete, handleScroll, title, size, reducedMotion.matches, id, animatedScrollRef.current]);
233
+ }, [open, doAnimateTitle /* use do instead of animateTitle directly */, animationComplete, handleScroll, title, size, reducedMotion.matches, id]);
215
234
 
216
235
  // click outside functionality if `includeOverlay` prop is set
217
236
  React.useEffect(function () {
@@ -310,7 +329,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
310
329
  }
311
330
  }, [animationComplete, firstElement, open, selectorPrimaryFocus]);
312
331
  var primaryActionContainerClassNames = cx__default["default"](["".concat(blockClass, "__actions-container"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__actions-container--condensed"), condensedActions)]);
313
- var mainPanelClassNames = cx__default["default"]([blockClass, className, "".concat(blockClass), "".concat(blockClass, "--").concat(size), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--right-placement"), placement === 'right'), "".concat(blockClass, "--left-placement"), placement === 'left'), "".concat(blockClass, "--slide-in"), slideIn), "".concat(blockClass, "--has-slug"), slug), "".concat(blockClass, "--condensed-actions"), condensedActions), "".concat(blockClass, "--animated-title"), doAnimateTitle), "".concat(blockClass, "--has-overlay"), includeOverlay)]);
332
+ var mainPanelClassNames = cx__default["default"]([blockClass, className, "".concat(blockClass), "".concat(blockClass, "--").concat(size), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--right-placement"), placement === 'right'), "".concat(blockClass, "--left-placement"), placement === 'left'), "".concat(blockClass, "--slide-in"), slideIn), "".concat(blockClass, "--has-slug"), slug), "".concat(blockClass, "--condensed-actions"), condensedActions), "".concat(blockClass, "--has-overlay"), includeOverlay)]);
314
333
  var renderTitle = function renderTitle() {
315
334
  return /*#__PURE__*/React__default["default"].createElement("div", {
316
335
  className: cx__default["default"]("".concat(blockClass, "__title"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__title--no-label"), !labelTextRef.current)),
@@ -403,10 +422,10 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
403
422
  var renderMain = function renderMain() {
404
423
  return /*#__PURE__*/React__default["default"].createElement("div", {
405
424
  ref: innerContentRef,
406
- className: cx__default["default"]("".concat(blockClass, "__inner-content"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--scrolls"), !doAnimateTitle))
425
+ onScroll: handleScroll,
426
+ className: cx__default["default"]("".concat(blockClass, "__inner-content"), "".concat(blockClass, "--scrolls"), "".concat(!doAnimateTitle ? "".concat(blockClass, "__inner-content--no-animated-title") : ''))
407
427
  }, children);
408
428
  };
409
- useResizeObserver.useResizeObserver(sidePanelRef, handleResize, [open]);
410
429
  return /*#__PURE__*/React__default["default"].createElement(framerMotion.AnimatePresence, null, open && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(framerMotion.motion.div, _rollupPluginBabelHelpers["extends"]({}, devtools.getDevtoolsProps(componentName), rest, {
411
430
  id: id,
412
431
  className: mainPanelClassNames,
@@ -424,11 +443,8 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
424
443
  shouldReduceMotion: shouldReduceMotion
425
444
  },
426
445
  onKeyDown: keyDownListener
427
- }), doAnimateTitle ? /*#__PURE__*/React__default["default"].createElement("div", {
428
- ref: animatedScrollRef,
429
- className: "".concat(blockClass, "__animated-scroll-wrapper ").concat(blockClass, "--scrolls")
430
- }, renderHeader(), renderMain()) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, renderHeader(), renderMain()), /*#__PURE__*/React__default["default"].createElement(MotionActionSet, {
431
- actions: actions,
446
+ }), /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, renderHeader(), renderMain()), /*#__PURE__*/React__default["default"].createElement(MotionActionSet, {
447
+ actions: actions !== null && actions !== void 0 ? actions : [],
432
448
  className: primaryActionContainerClassNames,
433
449
  size: size === 'xs' ? 'sm' : size,
434
450
  custom: shouldReduceMotion,
@@ -1,5 +1,26 @@
1
1
  /**
2
- * The SteppedAnimatedMedia is a Novice to Pro internal component and is not intended for general use.
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 const SteppedAnimatedMedia: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
7
  import React from 'react';
8
+ interface SteppedAnimatedMediaProps {
9
+ /**
10
+ * Optional class name for this component.
11
+ */
12
+ className?: string;
13
+ /**
14
+ * The file path(s) to json formatted Lottie animation files.
15
+ */
16
+ filePaths: string[] | undefined;
17
+ /**
18
+ * Which animation step from the filePaths array to play.
19
+ */
20
+ playStep?: number;
21
+ }
22
+ /**
23
+ * The SteppedAnimatedMedia is a Novice to Pro internal component and is not intended for general use.
24
+ */
25
+ export declare const SteppedAnimatedMedia: React.ForwardRefExoticComponent<SteppedAnimatedMediaProps & React.RefAttributes<HTMLDivElement>>;
26
+ export {};
@@ -37,7 +37,6 @@ var componentName = 'SteppedAnimatedMedia';
37
37
  var defaults = {
38
38
  playStep: 0
39
39
  };
40
-
41
40
  /**
42
41
  * The SteppedAnimatedMedia is a Novice to Pro internal component and is not intended for general use.
43
42
  */
@@ -52,8 +51,9 @@ var SteppedAnimatedMedia = /*#__PURE__*/React__default["default"].forwardRef(fun
52
51
  jsonData = _useState2[0],
53
52
  setJsonData = _useState2[1];
54
53
  var animRef = React.useRef();
55
- var backupRef = React.useRef();
54
+ var backupRef = React.useRef(null);
56
55
  var localRef = ref !== null && ref !== void 0 ? ref : backupRef;
56
+ var localRefValue = localRef.current;
57
57
  // load animation source
58
58
  React.useEffect(function () {
59
59
  var isJsonFile = function isJsonFile(filePath) {
@@ -100,11 +100,11 @@ var SteppedAnimatedMedia = /*#__PURE__*/React__default["default"].forwardRef(fun
100
100
  React.useEffect(function () {
101
101
  var _window;
102
102
  var prefersReducedMotion = (_window = window) !== null && _window !== void 0 && _window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)').matches : true;
103
- if (localRef.current) {
103
+ if (localRefValue) {
104
104
  var _animRef$current, _animRef$current2, _animRef$current3;
105
105
  (_animRef$current = animRef.current) === null || _animRef$current === void 0 || _animRef$current.destroy();
106
106
  animRef.current = lottie__default["default"].loadAnimation({
107
- container: localRef.current,
107
+ container: localRefValue,
108
108
  renderer: 'svg',
109
109
  animationData: jsonData[clamp__default["default"](playStep, 0, jsonData.length - 1)],
110
110
  loop: false,
@@ -119,7 +119,7 @@ var SteppedAnimatedMedia = /*#__PURE__*/React__default["default"].forwardRef(fun
119
119
  var _animRef$current4;
120
120
  return (_animRef$current4 = animRef.current) === null || _animRef$current4 === void 0 ? void 0 : _animRef$current4.destroy();
121
121
  };
122
- }, [jsonData, localRef, playStep]);
122
+ }, [jsonData, localRefValue, playStep]);
123
123
  if (!jsonData) {
124
124
  return null;
125
125
  }
@@ -138,6 +138,7 @@ SteppedAnimatedMedia.propTypes = {
138
138
  /**
139
139
  * The file path(s) to json formatted Lottie animation files.
140
140
  */
141
+ /**@ts-ignore*/
141
142
  filePaths: index["default"].arrayOf(index["default"].string).isRequired,
142
143
  /**
143
144
  * Which animation step from the filePaths array to play.
@@ -0,0 +1,5 @@
1
+ /**
2
+ * TODO: A description of the component.
3
+ */
4
+ export let TagOverflow: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
+ import React from 'react';