@carbon/ibm-products 2.33.0 → 2.34.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. package/css/index-full-carbon.css +303 -11
  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.css +303 -11
  6. package/css/index-without-carbon.css.map +1 -1
  7. package/css/index-without-carbon.min.css +1 -1
  8. package/css/index-without-carbon.min.css.map +1 -1
  9. package/css/index.css +303 -11
  10. package/css/index.css.map +1 -1
  11. package/css/index.min.css +1 -1
  12. package/css/index.min.css.map +1 -1
  13. package/es/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
  14. package/es/components/CreateSidePanel/CreateSidePanel.js +5 -2
  15. package/es/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
  16. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
  17. package/es/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
  18. package/es/components/DataSpreadsheet/utils/commonEventHandlers.js +304 -0
  19. package/es/components/Datagrid/Datagrid/DatagridContent.js +2 -1
  20. package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
  21. package/es/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
  22. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
  23. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +6 -2
  24. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
  25. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
  26. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
  27. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
  28. package/es/components/EditSidePanel/EditSidePanel.d.ts +92 -2
  29. package/es/components/EditSidePanel/EditSidePanel.js +8 -10
  30. package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
  31. package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +83 -0
  32. package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
  33. package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +94 -0
  34. package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +3 -1
  35. package/es/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
  36. package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
  37. package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +157 -0
  38. package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
  39. package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +72 -0
  40. package/es/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
  41. package/es/components/FilterPanel/index.d.ts +4 -0
  42. package/es/components/OptionsTile/OptionsTile.d.ts +77 -3
  43. package/es/components/OptionsTile/OptionsTile.js +9 -20
  44. package/es/components/RemoveModal/RemoveModal.d.ts +81 -7
  45. package/es/components/RemoveModal/RemoveModal.js +1 -0
  46. package/es/components/ScrollGradient/ScrollGradient.d.ts +5 -0
  47. package/es/components/ScrollGradient/ScrollGradient.js +156 -0
  48. package/es/components/ScrollGradient/constants.d.ts +15 -0
  49. package/es/components/ScrollGradient/constants.js +121 -0
  50. package/es/components/ScrollGradient/index.d.ts +1 -0
  51. package/es/components/SidePanel/SidePanel.d.ts +144 -2
  52. package/es/components/SidePanel/SidePanel.js +57 -48
  53. package/es/components/StatusIcon/StatusIcon.d.ts +34 -2
  54. package/es/components/StatusIcon/StatusIcon.js +97 -95
  55. package/es/components/TruncatedList/TruncatedList.js +5 -3
  56. package/es/components/UserAvatar/UserAvatar.js +3 -2
  57. package/es/components/index.d.ts +2 -1
  58. package/es/global/js/package-settings.d.ts +5 -0
  59. package/es/global/js/package-settings.js +5 -0
  60. package/es/index.js +5 -0
  61. package/es/settings.d.ts +5 -0
  62. package/lib/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
  63. package/lib/components/CreateSidePanel/CreateSidePanel.js +5 -2
  64. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
  65. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
  66. package/lib/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
  67. package/lib/components/DataSpreadsheet/utils/commonEventHandlers.js +311 -0
  68. package/lib/components/Datagrid/Datagrid/DatagridContent.js +2 -1
  69. package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
  70. package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
  71. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
  72. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
  73. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
  74. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
  75. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
  76. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
  77. package/lib/components/EditSidePanel/EditSidePanel.d.ts +92 -2
  78. package/lib/components/EditSidePanel/EditSidePanel.js +8 -10
  79. package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
  80. package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +90 -0
  81. package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
  82. package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +101 -0
  83. package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +3 -1
  84. package/lib/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
  85. package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
  86. package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +164 -0
  87. package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
  88. package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +79 -0
  89. package/lib/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
  90. package/lib/components/FilterPanel/index.d.ts +4 -0
  91. package/lib/components/OptionsTile/OptionsTile.d.ts +77 -3
  92. package/lib/components/OptionsTile/OptionsTile.js +9 -20
  93. package/lib/components/RemoveModal/RemoveModal.d.ts +81 -7
  94. package/lib/components/RemoveModal/RemoveModal.js +1 -0
  95. package/lib/components/ScrollGradient/ScrollGradient.d.ts +5 -0
  96. package/lib/components/ScrollGradient/ScrollGradient.js +163 -0
  97. package/lib/components/ScrollGradient/constants.d.ts +15 -0
  98. package/lib/components/ScrollGradient/constants.js +128 -0
  99. package/lib/components/ScrollGradient/index.d.ts +1 -0
  100. package/lib/components/SidePanel/SidePanel.d.ts +144 -2
  101. package/lib/components/SidePanel/SidePanel.js +57 -48
  102. package/lib/components/StatusIcon/StatusIcon.d.ts +34 -2
  103. package/lib/components/StatusIcon/StatusIcon.js +97 -95
  104. package/lib/components/TruncatedList/TruncatedList.js +5 -3
  105. package/lib/components/UserAvatar/UserAvatar.js +3 -2
  106. package/lib/components/index.d.ts +2 -1
  107. package/lib/global/js/package-settings.d.ts +5 -0
  108. package/lib/global/js/package-settings.js +5 -0
  109. package/lib/index.js +25 -0
  110. package/lib/settings.d.ts +5 -0
  111. package/package.json +3 -3
  112. package/scss/components/FilterPanel/_filter-panel-accordion-item.scss +56 -0
  113. package/scss/components/FilterPanel/_filter-panel-accordion.scss +6 -0
  114. package/scss/components/FilterPanel/_filter-panel-checkbox-with-overflow.scss +62 -0
  115. package/scss/components/FilterPanel/_filter-panel-checkbox.scss +25 -3
  116. package/scss/components/FilterPanel/_filter-panel-group.scss +39 -0
  117. package/scss/components/FilterPanel/_filter-panel-label.scss +0 -8
  118. package/scss/components/FilterPanel/_filter-panel.scss +2 -0
  119. package/scss/components/FilterPanel/_index-with-carbon.scss +4 -0
  120. package/scss/components/FilterPanel/_index.scss +4 -0
  121. package/scss/components/ScrollGradient/_carbon-imports.scss +9 -0
  122. package/scss/components/ScrollGradient/_index-with-carbon.scss +9 -0
  123. package/scss/components/ScrollGradient/_index.scss +8 -0
  124. package/scss/components/ScrollGradient/_scroll-gradient.scss +102 -0
  125. package/scss/components/UserAvatar/_user-avatar.scss +37 -4
  126. package/scss/components/_index-with-carbon.scss +1 -0
  127. package/scss/components/_index.scss +1 -0
@@ -28,8 +28,8 @@ var _excluded = ["actionToolbarButtons", "actions", "animateTitle", "children",
28
28
  _excluded2 = ["label", "kind", "icon", "tooltipPosition", "tooltipAlignment", "leading", "disabled", "className", "onClick"];
29
29
  var blockClass = "".concat(pkg.prefix, "--side-panel");
30
30
  var componentName = 'SidePanel';
31
-
32
- // NOTE: the component SCSS is not imported here: it is rolled up separately.
31
+ // `any` is a work around until ActionSet is migrated to TS
32
+ var MotionActionSet = motion(ActionSet);
33
33
 
34
34
  // Default values for props
35
35
  var defaults = {
@@ -40,7 +40,6 @@ var defaults = {
40
40
  placement: 'right',
41
41
  size: 'md'
42
42
  };
43
- var MotionActionSet = motion(ActionSet);
44
43
 
45
44
  /**
46
45
  * Side panels keep users in-context of a page while performing tasks like navigating, editing, viewing details, or configuring something new.
@@ -84,16 +83,16 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
84
83
  _useState2 = _slicedToArray(_useState, 2),
85
84
  animationComplete = _useState2[0],
86
85
  setAnimationComplete = _useState2[1];
87
- var localRef = useRef();
86
+ var localRef = useRef(null);
88
87
  var sidePanelRef = ref || localRef;
89
- var overlayRef = useRef();
90
- var innerContentRef = useRef();
91
- var closeRef = useRef();
92
- var animatedScrollRef = useRef();
93
- var headerRef = useRef();
94
- var titleRef = useRef();
95
- var labelTextRef = useRef();
96
- var subtitleRef = useRef();
88
+ var overlayRef = useRef(null);
89
+ var innerContentRef = useRef(null);
90
+ var closeRef = useRef(null);
91
+ var animatedScrollRef = useRef(null);
92
+ var headerRef = useRef(null);
93
+ var titleRef = useRef(null);
94
+ var labelTextRef = useRef(null);
95
+ var subtitleRef = useRef(null);
97
96
  var previousState = usePreviousValue({
98
97
  size: size,
99
98
  open: open
@@ -109,32 +108,36 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
109
108
  var _useFocus = useFocus(sidePanelRef),
110
109
  firstElement = _useFocus.firstElement,
111
110
  keyDownListener = _useFocus.keyDownListener;
111
+ var panelRefValue = sidePanelRef.current;
112
112
  var shouldReduceMotion = useReducedMotion();
113
113
  useEffect(function () {
114
114
  setDoAnimateTitle(animateTitle);
115
115
  }, [animateTitle]);
116
116
  var handleScroll = useCallback(function () {
117
- var scrollTop = animatedScrollRef.current.scrollTop;
118
- sidePanelRef.current.style.setProperty("--".concat(blockClass, "--scroll-animation-progress"), Math.min(scrollTop, scrollAnimationDistance) / scrollAnimationDistance);
119
- }, [scrollAnimationDistance, sidePanelRef]);
117
+ var _animatedScrollRef$cu;
118
+ var scrollTop = animatedScrollRef === null || animatedScrollRef === void 0 || (_animatedScrollRef$cu = animatedScrollRef.current) === null || _animatedScrollRef$cu === void 0 ? void 0 : _animatedScrollRef$cu.scrollTop;
119
+ panelRefValue === null || panelRefValue === void 0 || panelRefValue.style.setProperty("--".concat(blockClass, "--scroll-animation-progress"), (Math.min(Number(scrollTop), scrollAnimationDistance) / scrollAnimationDistance).toString());
120
+ }, [scrollAnimationDistance, panelRefValue]);
120
121
  var reducedMotion = typeof window !== 'undefined' && (_window = window) !== null && _window !== void 0 && _window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : {
121
122
  matches: true
122
123
  };
123
124
 
124
125
  // scroll panel to top going between steps
125
126
  useEffect(function () {
126
- if (sidePanelRef && sidePanelRef.current) {
127
- var _animatedScrollRef$cu;
128
- var scrollableSection = (_animatedScrollRef$cu = animatedScrollRef.current) !== null && _animatedScrollRef$cu !== void 0 ? _animatedScrollRef$cu : innerContentRef.current;
129
- scrollableSection.scrollTop = 0;
127
+ if (sidePanelRef && panelRefValue) {
128
+ var _animatedScrollRef$cu2;
129
+ var scrollableSection = (_animatedScrollRef$cu2 = animatedScrollRef.current) !== null && _animatedScrollRef$cu2 !== void 0 ? _animatedScrollRef$cu2 : innerContentRef.current;
130
+ if (scrollableSection) {
131
+ scrollableSection.scrollTop = 0;
132
+ }
130
133
  // The size of the panel has changed while it is still opened
131
134
  // so we need to scroll it to the top and reset the header
132
135
  // height css custom property
133
- if ((previousState === null || previousState === void 0 ? void 0 : previousState.size) !== size) {
136
+ if (previousState && previousState['size'] !== size && scrollableSection) {
134
137
  scrollableSection.scrollTop = 0;
135
138
  }
136
139
  }
137
- }, [currentStep, sidePanelRef, size, previousState === null || previousState === void 0 ? void 0 : previousState.size, id]);
140
+ }, [currentStep, sidePanelRef, size, previousState, id, panelRefValue]);
138
141
 
139
142
  // Add console warning if labelText is provided without a title.
140
143
  // This combination is not allowed.
@@ -145,7 +148,7 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
145
148
  }, [labelText, title]);
146
149
  var checkSetDoAnimateTitle = function checkSetDoAnimateTitle() {
147
150
  var canDoAnimateTitle = false;
148
- if (sidePanelRef !== null && sidePanelRef !== void 0 && sidePanelRef.current && open && animateTitle && animationComplete && titleRef !== null && titleRef !== void 0 && titleRef.current && title && title.length && !reducedMotion.matches) {
151
+ if (panelRefValue && open && animateTitle && animationComplete && titleRef !== null && titleRef !== void 0 && titleRef.current && title && title.length && !reducedMotion.matches) {
149
152
  var _labelTextRef$current, _labelTextRef$current2, _subtitleRef$current$, _subtitleRef$current;
150
153
  var titleEl = titleRef.current;
151
154
  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;
@@ -158,7 +161,7 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
158
161
  setScrollAnimationDistance(_scrollAnimationDistance);
159
162
 
160
163
  // used to calculate the header moves
161
- sidePanelRef.current.style.setProperty("--".concat(blockClass, "--scroll-animation-distance"), _scrollAnimationDistance);
164
+ panelRefValue === null || panelRefValue === void 0 || panelRefValue.style.setProperty("--".concat(blockClass, "--scroll-animation-distance"), _scrollAnimationDistance.toString());
162
165
  var scrollEl = animatedScrollRef.current;
163
166
  if (!scrollEl && animateTitle && !doAnimateTitle) {
164
167
  // may be switching back based on resize
@@ -183,9 +186,9 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
183
186
  animatedScrollRef.current.addEventListener('scroll', handleScroll);
184
187
  }
185
188
  if (!doAnimateTitle && sidePanelRef.current) {
186
- sidePanelRef.current.style.setProperty("--".concat(blockClass, "--scroll-animation-progress"), 0);
189
+ panelRefValue === null || panelRefValue === void 0 || panelRefValue.style.setProperty("--".concat(blockClass, "--scroll-animation-progress"), '0');
187
190
  }
188
- }, [animatedScrollRef, doAnimateTitle, handleScroll, sidePanelRef]);
191
+ }, [animatedScrollRef, doAnimateTitle, handleScroll, sidePanelRef, panelRefValue]);
189
192
 
190
193
  /* istanbul ignore next */
191
194
  var handleResize = function handleResize() {
@@ -194,7 +197,7 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
194
197
 
195
198
  // Calculate scroll distances
196
199
  useEffect(function () {
197
- if (sidePanelRef !== null && sidePanelRef !== void 0 && sidePanelRef.current && open && animateTitle && animationComplete && titleRef !== null && titleRef !== void 0 && titleRef.current && title && title.length && !reducedMotion.matches) {
200
+ if (panelRefValue && open && animateTitle && animationComplete && titleRef !== null && titleRef !== void 0 && titleRef.current && title && title.length && !reducedMotion.matches) {
198
201
  checkSetDoAnimateTitle();
199
202
  }
200
203
 
@@ -204,7 +207,7 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
204
207
  // click outside functionality if `includeOverlay` prop is set
205
208
  useEffect(function () {
206
209
  var handleOutsideClick = function handleOutsideClick(event) {
207
- if (sidePanelRef.current && overlayRef.current && overlayRef.current.contains(event.target) && onRequestClose) {
210
+ if (panelRefValue && overlayRef.current && overlayRef.current.contains(event.target) && onRequestClose) {
208
211
  onRequestClose();
209
212
  }
210
213
  };
@@ -222,7 +225,7 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
222
225
  bodyElement.style.overflow = '';
223
226
  document.removeEventListener('click', handleOutsideClick);
224
227
  };
225
- }, [includeOverlay, onRequestClose, open, preventCloseOnClickOutside, onUnmount, sidePanelRef]);
228
+ }, [includeOverlay, onRequestClose, open, preventCloseOnClickOutside, onUnmount, sidePanelRef, panelRefValue]);
226
229
 
227
230
  // initializes the side panel to close
228
231
  var onAnimationEnd = function onAnimationEnd() {
@@ -241,43 +244,43 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
241
244
  }, [reducedMotion.matches]);
242
245
 
243
246
  // initializes the side panel to open
244
- var _onAnimationStart = function onAnimationStart() {
247
+ var onAnimationStart = function onAnimationStart() {
245
248
  setAnimationComplete(false);
246
249
  };
247
250
 
248
251
  // used to reset margins of the slide in panel when closed/closing
249
252
  useEffect(function () {
250
253
  if (!open && slideIn) {
251
- var pageContentElement = document.querySelector(selectorPageContent);
254
+ var pageContentElement = selectorPageContent ? document.querySelector(selectorPageContent) : null;
252
255
  if (placement && placement === 'right' && pageContentElement) {
253
- pageContentElement.style.marginInlineEnd = 0;
256
+ pageContentElement.style.marginInlineEnd = '0';
254
257
  } else if (pageContentElement) {
255
- pageContentElement.style.marginInlineStart = 0;
258
+ pageContentElement.style.marginInlineStart = '0';
256
259
  }
257
260
  }
258
261
  }, [open, placement, selectorPageContent, slideIn]);
259
262
  useEffect(function () {
260
- if (!open && previousState !== null && previousState !== void 0 && previousState.open && reducedMotion.matches) {
263
+ if (!open && previousState && previousState['open'] && reducedMotion.matches) {
261
264
  onUnmount === null || onUnmount === void 0 || onUnmount();
262
265
  }
263
- }, [open, onUnmount, reducedMotion.matches, previousState === null || previousState === void 0 ? void 0 : previousState.open]);
266
+ }, [open, onUnmount, reducedMotion.matches, previousState]);
264
267
 
265
268
  // used to set margins of content for slide in panel version
266
269
  useEffect(function () {
267
270
  if (open && slideIn) {
268
- var pageContentElement = document.querySelector(selectorPageContent);
271
+ var pageContentElement = selectorPageContent ? document.querySelector(selectorPageContent) : null;
269
272
  if (pageContentElement) {
270
273
  pageContentElement.style.inlineSize = 'auto';
271
274
  } else {
272
275
  pconsole.warn('SidePanel prop `selectorPageContent` was not provided a selector that matches any element on your page. If an element is not found, the panel will render as a slide over.');
273
276
  }
274
277
  if (placement && placement === 'right' && pageContentElement) {
275
- pageContentElement.style.marginInlineEnd = 0;
276
- pageContentElement.style.transition = !reducedMotion.matches ? "margin-inline-end ".concat(moderate02) : null;
278
+ pageContentElement.style.marginInlineEnd = '0';
279
+ pageContentElement.style.transition = !reducedMotion.matches ? "margin-inline-end ".concat(moderate02) : '';
277
280
  pageContentElement.style.marginInlineEnd = SIDE_PANEL_SIZES[size];
278
281
  } else if (pageContentElement) {
279
- pageContentElement.style.marginInlineStart = 0;
280
- pageContentElement.style.transition = !reducedMotion.matches ? "margin-inline-start ".concat(moderate02) : null;
282
+ pageContentElement.style.marginInlineStart = '0';
283
+ pageContentElement.style.transition = !reducedMotion.matches ? "margin-inline-start ".concat(moderate02) : '';
281
284
  pageContentElement.style.marginInlineStart = SIDE_PANEL_SIZES[size];
282
285
  }
283
286
  }
@@ -285,10 +288,12 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
285
288
  useEffect(function () {
286
289
  if (open) {
287
290
  setTimeout(function () {
288
- var _document;
289
- var primeFocusEl = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector(selectorPrimaryFocus);
290
- if (selectorPrimaryFocus && primeFocusEl) {
291
- primeFocusEl.focus();
291
+ if (selectorPrimaryFocus) {
292
+ var _document;
293
+ var primeFocusEl = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector(selectorPrimaryFocus);
294
+ if (primeFocusEl) {
295
+ primeFocusEl === null || primeFocusEl === void 0 || primeFocusEl.focus();
296
+ }
292
297
  } else {
293
298
  firstElement === null || firstElement === void 0 || firstElement.focus();
294
299
  }
@@ -315,7 +320,7 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
315
320
  var _slug$type;
316
321
  var slugCloseSize = actions && actions.length && /l/.test(size) ? 'md' : 'sm';
317
322
  var normalizedSlug;
318
- if (slug && (slug === null || slug === void 0 || (_slug$type = slug.type) === null || _slug$type === void 0 ? void 0 : _slug$type.displayName) === 'Slug') {
323
+ if (slug && ((_slug$type = slug['type']) === null || _slug$type === void 0 ? void 0 : _slug$type.displayName) === 'Slug') {
319
324
  normalizedSlug = /*#__PURE__*/React__default.cloneElement(slug, {
320
325
  // slug size is sm unless actions and size > md
321
326
  size: slugCloseSize
@@ -400,9 +405,7 @@ var SidePanel = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
400
405
  role: "complementary",
401
406
  "aria-label": title,
402
407
  onAnimationComplete: onAnimationEnd,
403
- onAnimationStart: function onAnimationStart(event) {
404
- return _onAnimationStart();
405
- },
408
+ onAnimationStart: onAnimationStart,
406
409
  variants: panelVariants,
407
410
  initial: "hidden",
408
411
  animate: "visible",
@@ -462,7 +465,8 @@ SidePanel.propTypes = {
462
465
  *
463
466
  * See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
464
467
  */
465
- actions: allPropTypes([ActionSet.validateActions(), PropTypes.arrayOf(PropTypes.shape(_objectSpread2(_objectSpread2({}, Button.propTypes), {}, {
468
+ actions: allPropTypes([/**@ts-ignore*/
469
+ ActionSet.validateActions(), PropTypes.arrayOf(PropTypes.shape(_objectSpread2(_objectSpread2({}, Button.propTypes), {}, {
466
470
  kind: PropTypes.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
467
471
  tooltipPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
468
472
  tooltipAlignment: PropTypes.oneOf(['start', 'center', 'end']),
@@ -541,6 +545,7 @@ SidePanel.propTypes = {
541
545
  * This is the selector to the element that contains all of the page content that will shrink if the panel is a slide in.
542
546
  * This prop is required when using the `slideIn` variant of the side panel.
543
547
  */
548
+ /**@ts-ignore*/
544
549
  selectorPageContent: PropTypes.string.isRequired.if(function (_ref6) {
545
550
  var slideIn = _ref6.slideIn;
546
551
  return slideIn;
@@ -549,14 +554,17 @@ SidePanel.propTypes = {
549
554
  * Specify a CSS selector that matches the DOM element that should
550
555
  * be focused when the side panel opens
551
556
  */
557
+ /**@ts-ignore*/
552
558
  selectorPrimaryFocus: PropTypes.string,
553
559
  /**
554
560
  * Sets the size of the side panel
555
561
  */
562
+ /**@ts-ignore*/
556
563
  size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', '2xl']),
557
564
  /**
558
565
  * Determines if this panel slides in
559
566
  */
567
+ /**@ts-ignore*/
560
568
  slideIn: PropTypes.bool,
561
569
  /**
562
570
  * **Experimental:** Provide a `Slug` component to be rendered inside the `SidePanel` component
@@ -569,6 +577,7 @@ SidePanel.propTypes = {
569
577
  /**
570
578
  * Sets the title text
571
579
  */
580
+ /**@ts-ignore*/
572
581
  title: PropTypes.string.isRequired.if(function (_ref7) {
573
582
  var labelText = _ref7.labelText;
574
583
  return labelText;
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Copyright IBM Corp. 2021, 2022
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, { PropsWithChildren } from 'react';
1
8
  /**
2
9
  The `StatusIcon` component follows the Carbon guidelines for status icons with
3
10
  some added specifications around illustration usage. For additional usage
@@ -7,5 +14,30 @@ _Status icons_ are an important method of communicating severity level
7
14
  information to users. The shapes and colors, communicate severity that enable
8
15
  users to quickly assess and identify status and respond accordingly.
9
16
  */
10
- export let StatusIcon: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
11
- import React from 'react';
17
+ type Size = 'sm' | 'md' | 'lg' | 'xl';
18
+ type Theme = 'light' | 'dark';
19
+ type Kind = 'fatal' | 'critical' | 'major-warning' | 'minor-warning' | 'undefined' | 'unknown' | 'normal' | 'info' | 'in-progress' | 'running' | 'pending';
20
+ interface StatusIconProps extends PropsWithChildren {
21
+ /**
22
+ * Provide an optional class to be applied to the modal root node.
23
+ */
24
+ className?: string;
25
+ /**
26
+ * A required prop that provides a title element and tooltip for the icon for accessibility purposes
27
+ */
28
+ iconDescription: string;
29
+ /**
30
+ * A required prop that displays the respective icon associated with the status
31
+ */
32
+ kind: Kind;
33
+ /**
34
+ * A required prop that displays the size of the icon associate with the status
35
+ */
36
+ size: Size;
37
+ /**
38
+ * A required prop that displays the theme of the icon associated with the status
39
+ */
40
+ theme: Theme;
41
+ }
42
+ export declare let StatusIcon: React.ForwardRefExoticComponent<StatusIconProps & React.RefAttributes<React.ReactSVGElement | null>>;
43
+ export {};