@carbon/ibm-products 1.5.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. package/css/index-full-carbon.css +389 -139
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +9 -3
  4. package/css/index-full-carbon.min.css.map +1 -0
  5. package/css/index-without-carbon-released-only.css +33 -27
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +3 -3
  8. package/css/index-without-carbon-released-only.min.css.map +1 -0
  9. package/css/index-without-carbon.css +330 -133
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +9 -3
  12. package/css/index-without-carbon.min.css.map +1 -0
  13. package/css/index.css +332 -135
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +9 -3
  16. package/css/index.min.css.map +1 -0
  17. package/es/components/APIKeyModal/APIKeyModal.js +10 -13
  18. package/es/components/ActionBar/ActionBar.js +0 -3
  19. package/es/components/ActionBar/ActionBarItem.js +2 -6
  20. package/es/components/ActionSet/ActionSet.js +11 -13
  21. package/es/components/AddSelect/AddSelect.js +122 -72
  22. package/es/components/AddSelect/AddSelectBreadcrumbs.js +56 -0
  23. package/es/components/AddSelect/AddSelectList.js +94 -0
  24. package/es/components/AddSelect/AddSelectSidebar.js +110 -0
  25. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +5 -5
  26. package/es/components/ButtonMenu/ButtonMenu.js +6 -4
  27. package/es/components/ButtonMenu/ButtonMenuItem.js +1 -2
  28. package/es/components/Card/Card.js +37 -25
  29. package/es/components/Card/CardFooter.js +14 -10
  30. package/es/components/Card/CardHeader.js +8 -6
  31. package/es/components/Cascade/Cascade.js +5 -4
  32. package/es/components/ComboButton/ComboButton.js +0 -4
  33. package/es/components/ComboButton/ComboButtonItem/index.js +0 -5
  34. package/es/components/CreateFullPage/CreateFullPageStep.js +15 -8
  35. package/es/components/CreateModal/CreateModal.js +1 -4
  36. package/es/components/CreateTearsheet/CreateTearsheet.js +10 -11
  37. package/es/components/CreateTearsheet/CreateTearsheetStep.js +18 -14
  38. package/es/components/DataSpreadsheet/DataSpreadsheet.js +414 -0
  39. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +138 -0
  40. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +64 -0
  41. package/es/components/DataSpreadsheet/createActiveCellFn.js +45 -0
  42. package/es/components/DataSpreadsheet/generateData.js +47 -0
  43. package/es/components/DataSpreadsheet/getCellSize.js +30 -0
  44. package/es/components/{CancelableTextEdit → DataSpreadsheet}/index.js +2 -2
  45. package/es/components/EditSidePanel/EditSidePanel.js +9 -10
  46. package/es/components/EmptyStates/EmptyState.js +8 -7
  47. package/es/components/EmptyStates/EmptyStateContent.js +2 -2
  48. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +5 -9
  49. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +5 -9
  50. package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +5 -9
  51. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +5 -9
  52. package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +5 -9
  53. package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +5 -9
  54. package/es/components/ExampleComponent/ExampleComponent.js +12 -13
  55. package/es/components/ExportModal/ExportModal.js +13 -9
  56. package/es/components/ExpressiveCard/ExpressiveCard.js +0 -8
  57. package/es/components/ImportModal/ImportModal.js +7 -5
  58. package/es/components/InlineEdit/InlineEdit.js +256 -88
  59. package/es/components/LoadingBar/LoadingBar.js +13 -17
  60. package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -4
  61. package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -5
  62. package/es/components/ModifiedTabs/ModifiedTabs.js +24 -18
  63. package/es/components/NotificationsPanel/NotificationsPanel.js +125 -89
  64. package/es/components/OptionsTile/OptionsTile.js +6 -9
  65. package/es/components/PageHeader/PageHeader.js +19 -13
  66. package/es/components/PageHeader/PageHeaderTitle.js +10 -6
  67. package/es/components/ProductiveCard/ProductiveCard.js +23 -12
  68. package/es/components/RemoveModal/RemoveModal.js +0 -3
  69. package/es/components/SidePanel/SidePanel.js +54 -32
  70. package/es/components/TagSet/TagSet.js +13 -9
  71. package/es/components/TagSet/TagSetModal.js +16 -12
  72. package/es/components/TagSet/TagSetOverflow.js +21 -13
  73. package/es/components/Tearsheet/Tearsheet.js +27 -18
  74. package/es/components/Tearsheet/TearsheetNarrow.js +18 -15
  75. package/es/components/Tearsheet/TearsheetShell.js +3 -4
  76. package/es/components/Toolbar/ToolbarButton.js +0 -3
  77. package/es/components/WebTerminal/WebTerminal.js +18 -19
  78. package/es/components/index.js +2 -2
  79. package/es/global/js/hooks/index.js +1 -0
  80. package/es/global/js/hooks/useActiveElement.js +27 -0
  81. package/es/global/js/package-settings.js +2 -1
  82. package/es/global/js/utils/Wrap.js +7 -5
  83. package/es/global/js/utils/getScrollbarWidth.js +14 -0
  84. package/es/settings.js +0 -5
  85. package/lib/components/APIKeyModal/APIKeyModal.js +10 -13
  86. package/lib/components/ActionBar/ActionBar.js +0 -3
  87. package/lib/components/ActionBar/ActionBarItem.js +2 -6
  88. package/lib/components/ActionSet/ActionSet.js +11 -13
  89. package/lib/components/AddSelect/AddSelect.js +126 -72
  90. package/lib/components/AddSelect/AddSelectBreadcrumbs.js +71 -0
  91. package/lib/components/AddSelect/AddSelectList.js +112 -0
  92. package/lib/components/AddSelect/AddSelectSidebar.js +122 -0
  93. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +5 -5
  94. package/lib/components/ButtonMenu/ButtonMenu.js +6 -4
  95. package/lib/components/ButtonMenu/ButtonMenuItem.js +1 -2
  96. package/lib/components/Card/Card.js +37 -25
  97. package/lib/components/Card/CardFooter.js +14 -10
  98. package/lib/components/Card/CardHeader.js +8 -6
  99. package/lib/components/Cascade/Cascade.js +5 -4
  100. package/lib/components/ComboButton/ComboButton.js +0 -4
  101. package/lib/components/ComboButton/ComboButtonItem/index.js +0 -5
  102. package/lib/components/CreateFullPage/CreateFullPageStep.js +17 -14
  103. package/lib/components/CreateModal/CreateModal.js +1 -4
  104. package/lib/components/CreateTearsheet/CreateTearsheet.js +10 -11
  105. package/lib/components/CreateTearsheet/CreateTearsheetStep.js +20 -20
  106. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +438 -0
  107. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +161 -0
  108. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +80 -0
  109. package/lib/components/DataSpreadsheet/createActiveCellFn.js +56 -0
  110. package/lib/components/DataSpreadsheet/generateData.js +58 -0
  111. package/lib/components/DataSpreadsheet/getCellSize.js +39 -0
  112. package/lib/components/DataSpreadsheet/index.js +13 -0
  113. package/lib/components/EditSidePanel/EditSidePanel.js +9 -10
  114. package/lib/components/EmptyStates/EmptyState.js +10 -9
  115. package/lib/components/EmptyStates/EmptyStateContent.js +2 -2
  116. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +4 -8
  117. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +4 -8
  118. package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +4 -8
  119. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +4 -8
  120. package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +4 -8
  121. package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +4 -8
  122. package/lib/components/ExampleComponent/ExampleComponent.js +12 -13
  123. package/lib/components/ExportModal/ExportModal.js +13 -9
  124. package/lib/components/ExpressiveCard/ExpressiveCard.js +0 -8
  125. package/lib/components/ImportModal/ImportModal.js +7 -5
  126. package/lib/components/InlineEdit/InlineEdit.js +253 -87
  127. package/lib/components/LoadingBar/LoadingBar.js +13 -17
  128. package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -4
  129. package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -5
  130. package/lib/components/ModifiedTabs/ModifiedTabs.js +24 -18
  131. package/lib/components/NotificationsPanel/NotificationsPanel.js +122 -87
  132. package/lib/components/OptionsTile/OptionsTile.js +6 -9
  133. package/lib/components/PageHeader/PageHeader.js +18 -12
  134. package/lib/components/PageHeader/PageHeaderTitle.js +10 -6
  135. package/lib/components/ProductiveCard/ProductiveCard.js +24 -18
  136. package/lib/components/RemoveModal/RemoveModal.js +0 -3
  137. package/lib/components/SidePanel/SidePanel.js +54 -32
  138. package/lib/components/TagSet/TagSet.js +13 -9
  139. package/lib/components/TagSet/TagSetModal.js +17 -13
  140. package/lib/components/TagSet/TagSetOverflow.js +24 -19
  141. package/lib/components/Tearsheet/Tearsheet.js +26 -17
  142. package/lib/components/Tearsheet/TearsheetNarrow.js +18 -15
  143. package/lib/components/Tearsheet/TearsheetShell.js +2 -3
  144. package/lib/components/Toolbar/ToolbarButton.js +0 -3
  145. package/lib/components/WebTerminal/WebTerminal.js +18 -19
  146. package/lib/components/index.js +8 -8
  147. package/lib/global/js/hooks/index.js +8 -0
  148. package/lib/global/js/hooks/useActiveElement.js +39 -0
  149. package/lib/global/js/package-settings.js +2 -1
  150. package/lib/global/js/utils/Wrap.js +7 -5
  151. package/lib/global/js/utils/getScrollbarWidth.js +23 -0
  152. package/lib/settings.js +0 -6
  153. package/package.json +25 -23
  154. package/scss/components/AddSelect/_add-select.scss +59 -5
  155. package/scss/components/BreadcrumbWithOverflow/_index.scss +1 -1
  156. package/scss/components/CreateInfluencer/_create-influencer.scss +4 -4
  157. package/scss/components/CreateTearsheet/_create-tearsheet.scss +2 -2
  158. package/scss/components/CreateTearsheetNarrow/_storybook-styles.scss +0 -6
  159. package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +102 -0
  160. package/scss/components/{CancelableTextEdit → DataSpreadsheet}/_index.scss +2 -2
  161. package/scss/components/DataSpreadsheet/_storybook-styles.scss +6 -0
  162. package/scss/components/EditSidePanel/_storybook-styles.scss +0 -8
  163. package/scss/components/InlineEdit/_inline-edit.scss +293 -10
  164. package/scss/components/InlineEdit/_storybook-styles.scss +12 -6
  165. package/scss/components/LoadingBar/_storybook-styles.scss +0 -5
  166. package/scss/components/NotificationsPanel/_notifications-panel.scss +2 -2
  167. package/scss/components/OptionsTile/_storybook-styles.scss +0 -7
  168. package/scss/components/PageHeader/_index.scss +1 -1
  169. package/scss/components/PageHeader/_page-header.scss +4 -1
  170. package/scss/components/ProductiveCard/_productive-card.scss +0 -4
  171. package/scss/components/SidePanel/_side-panel.scss +15 -6
  172. package/scss/components/StatusIcon/_index.scss +1 -1
  173. package/scss/components/StatusIcon/_status-icon.scss +4 -4
  174. package/scss/components/TagSet/_index.scss +1 -1
  175. package/scss/components/UserProfileImage/_index.scss +1 -1
  176. package/scss/components/UserProfileImage/_user-profile-image.scss +2 -2
  177. package/scss/components/WebTerminal/_web-terminal.scss +2 -2
  178. package/scss/components/_index.scss +1 -1
  179. package/scss/global/styles/_project-settings.scss +5 -1
  180. package/es/components/CancelableTextEdit/CancelableTextEdit.js +0 -245
  181. package/es/generated/feature-flags/feature-flags.js +0 -15
  182. package/lib/components/CancelableTextEdit/CancelableTextEdit.js +0 -265
  183. package/lib/components/CancelableTextEdit/index.js +0 -13
  184. package/lib/generated/feature-flags/feature-flags.js +0 -22
  185. package/scss/components/CancelableTextEdit/_cancelable-text-edit.scss +0 -211
  186. package/scss/components/CancelableTextEdit/_storybook-styles.scss +0 -15
  187. package/scss/generated/feature-flags/_feature-flags.scss +0 -19
@@ -206,7 +206,4 @@ RemoveModal.propTypes = {
206
206
  */
207
207
  title: _propTypes.default.string.isRequired
208
208
  };
209
- RemoveModal.defaultProps = {
210
- textConfirmation: false
211
- };
212
209
  RemoveModal.displayName = componentName;
@@ -58,7 +58,16 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
58
58
 
59
59
  var blockClass = "".concat(_settings.pkg.prefix, "--side-panel");
60
60
  var componentName = 'SidePanel'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
61
+ // Default values for props
61
62
 
63
+ var defaults = {
64
+ animateTitle: true,
65
+ closeIconDescription: 'Close',
66
+ currentStep: 0,
67
+ navigationBackIconDescription: 'Back',
68
+ placement: 'right',
69
+ size: 'md'
70
+ };
62
71
  /**
63
72
  * Side panels keep users in-context of a page while performing tasks like navigating, editing, viewing details, or configuring something new.
64
73
  */
@@ -68,24 +77,30 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
68
77
 
69
78
  var actionToolbarButtons = _ref.actionToolbarButtons,
70
79
  actions = _ref.actions,
71
- animateTitle = _ref.animateTitle,
80
+ _ref$animateTitle = _ref.animateTitle,
81
+ animateTitle = _ref$animateTitle === void 0 ? defaults.animateTitle : _ref$animateTitle,
72
82
  children = _ref.children,
73
83
  className = _ref.className,
74
- closeIconDescription = _ref.closeIconDescription,
84
+ _ref$closeIconDescrip = _ref.closeIconDescription,
85
+ closeIconDescription = _ref$closeIconDescrip === void 0 ? defaults.closeIconDescription : _ref$closeIconDescrip,
75
86
  condensedActions = _ref.condensedActions,
76
- currentStep = _ref.currentStep,
87
+ _ref$currentStep = _ref.currentStep,
88
+ currentStep = _ref$currentStep === void 0 ? defaults.currentStep : _ref$currentStep,
77
89
  includeOverlay = _ref.includeOverlay,
78
90
  labelText = _ref.labelText,
79
- navigationBackIconDescription = _ref.navigationBackIconDescription,
91
+ _ref$navigationBackIc = _ref.navigationBackIconDescription,
92
+ navigationBackIconDescription = _ref$navigationBackIc === void 0 ? defaults.navigationBackIconDescription : _ref$navigationBackIc,
80
93
  onNavigationBack = _ref.onNavigationBack,
81
94
  onRequestClose = _ref.onRequestClose,
82
95
  onUnmount = _ref.onUnmount,
83
96
  open = _ref.open,
84
- placement = _ref.placement,
97
+ _ref$placement = _ref.placement,
98
+ placement = _ref$placement === void 0 ? defaults.placement : _ref$placement,
85
99
  preventCloseOnClickOutside = _ref.preventCloseOnClickOutside,
86
100
  selectorPageContent = _ref.selectorPageContent,
87
101
  selectorPrimaryFocus = _ref.selectorPrimaryFocus,
88
- size = _ref.size,
102
+ _ref$size = _ref.size,
103
+ size = _ref$size === void 0 ? defaults.size : _ref$size,
89
104
  slideIn = _ref.slideIn,
90
105
  subtitle = _ref.subtitle,
91
106
  title = _ref.title,
@@ -113,8 +128,12 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
113
128
  var sidePanelInnerRef = (0, _react.useRef)();
114
129
  var sidePanelCloseRef = (0, _react.useRef)();
115
130
  var previousState = (0, _hooks.usePreviousValue)({
116
- size: size
117
- }); // scroll panel to top going between steps
131
+ size: size,
132
+ open: open
133
+ });
134
+ var reducedMotion = window && window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : {
135
+ matches: true
136
+ }; // scroll panel to top going between steps
118
137
 
119
138
  (0, _react.useEffect)(function () {
120
139
  var panelRef = ref || sidePanelRef;
@@ -193,7 +212,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
193
212
 
194
213
 
195
214
  (0, _react.useEffect)(function () {
196
- if (open && animateTitle && animationComplete && title && title.length) {
215
+ if (open && animateTitle && animationComplete && title && title.length && !reducedMotion.matches) {
197
216
  var _document$querySelect2, _document$querySelect3, _document$querySelect4;
198
217
 
199
218
  var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
@@ -285,7 +304,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
285
304
  _sidePanelOuter === null || _sidePanelOuter === void 0 ? void 0 : _sidePanelOuter.style.setProperty("--".concat(blockClass, "--subtitle-container-height"), "".concat(_sidePanelSubtitleElementHeight, "px"));
286
305
  _sidePanelOuter === null || _sidePanelOuter === void 0 ? void 0 : _sidePanelOuter.style.setProperty("--".concat(blockClass, "--action-bar-container-height"), "".concat(sidePanelActionBarElementHeight, "px"));
287
306
  }
288
- }, [open, animateTitle, animationComplete, shouldRender, panelHeight, title, size]); // click outside functionality if `includeOverlay` prop is set
307
+ }, [open, animateTitle, animationComplete, shouldRender, panelHeight, title, size, reducedMotion.matches]); // click outside functionality if `includeOverlay` prop is set
289
308
 
290
309
  (0, _react.useEffect)(function () {
291
310
  var handleOutsideClick = function handleOutsideClick(event) {
@@ -311,7 +330,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
311
330
  return function () {
312
331
  document.removeEventListener('click', handleOutsideClick);
313
332
  };
314
- }, [includeOverlay, onRequestClose, open, preventCloseOnClickOutside, ref]); // initialize the side panel to open
333
+ }, [includeOverlay, onRequestClose, open, preventCloseOnClickOutside, ref, onUnmount]); // initialize the side panel to open
315
334
 
316
335
  (0, _react.useEffect)(function () {
317
336
  if (open) {
@@ -321,14 +340,21 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
321
340
 
322
341
  var onAnimationEnd = function onAnimationEnd() {
323
342
  if (!open) {
324
- onUnmount && onUnmount();
343
+ onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
325
344
  setRender(false);
326
345
  }
327
346
 
328
347
  setAnimationComplete(true);
329
- }; // initializes the side panel to open
348
+ }; // Set the internal state `animationComplete` to true if
349
+ // prefers reduced motion is true
330
350
 
331
351
 
352
+ (0, _react.useEffect)(function () {
353
+ if (reducedMotion.matches) {
354
+ setAnimationComplete(true);
355
+ }
356
+ }, [reducedMotion.matches]); // initializes the side panel to open
357
+
332
358
  var _onAnimationStart = function onAnimationStart(event) {
333
359
  event.persist();
334
360
  var isPanelTarget = event.target.id === "".concat(blockClass, "-outer");
@@ -349,7 +375,13 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
349
375
  pageContentElement.style.marginLeft = 0;
350
376
  }
351
377
  }
352
- }, [open, placement, selectorPageContent, slideIn]); // used to set margins of content for slide in panel version
378
+ }, [open, placement, selectorPageContent, slideIn]);
379
+ (0, _react.useEffect)(function () {
380
+ if (!open && previousState !== null && previousState !== void 0 && previousState.open && reducedMotion.matches) {
381
+ setRender(false);
382
+ onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
383
+ }
384
+ }, [open, onUnmount, reducedMotion.matches, previousState === null || previousState === void 0 ? void 0 : previousState.open]); // used to set margins of content for slide in panel version
353
385
 
354
386
  (0, _react.useEffect)(function () {
355
387
  if (shouldRender && slideIn) {
@@ -357,15 +389,15 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
357
389
 
358
390
  if (placement && placement === 'right' && pageContentElement) {
359
391
  pageContentElement.style.marginRight = 0;
360
- pageContentElement.style.transition = "margin-right ".concat(_motion.moderate02);
392
+ pageContentElement.style.transition = !reducedMotion.matches ? "margin-right ".concat(_motion.moderate02) : null;
361
393
  pageContentElement.style.marginRight = _constants.SIDE_PANEL_SIZES[size];
362
394
  } else if (pageContentElement) {
363
395
  pageContentElement.style.marginLeft = 0;
364
- pageContentElement.style.transition = "margin-left ".concat(_motion.moderate02);
396
+ pageContentElement.style.transition = !reducedMotion.matches ? "margin-left ".concat(_motion.moderate02) : null;
365
397
  pageContentElement.style.marginLeft = _constants.SIDE_PANEL_SIZES[size];
366
398
  }
367
399
  }
368
- }, [slideIn, selectorPageContent, placement, shouldRender, size]); // adds focus trap functionality
400
+ }, [slideIn, selectorPageContent, placement, shouldRender, size, reducedMotion.matches]); // adds focus trap functionality
369
401
 
370
402
  /* istanbul ignore next */
371
403
 
@@ -392,7 +424,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
392
424
  var _cx, _cx2;
393
425
 
394
426
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
395
- className: (0, _classnames.default)("".concat(blockClass, "__title-container"), (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__on-detail-step"), currentStep > 0), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__on-detail-step-without-title"), currentStep > 0 && !title), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__title-container--no-title-animation"), !animateTitle), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__title-container-is-animating"), !animationComplete || !open), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__title-container-without-title"), !title), _cx))
427
+ className: (0, _classnames.default)("".concat(blockClass, "__title-container"), (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__on-detail-step"), currentStep > 0), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__on-detail-step-without-title"), currentStep > 0 && !title), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__title-container--no-title-animation"), !animateTitle), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__title-container-is-animating"), !animationComplete || !open), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__title-container-without-title"), !title), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__title-container--reduced-motion"), reducedMotion.matches), _cx))
396
428
  }, currentStep > 0 && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
397
429
  "aria-label": navigationBackIconDescription,
398
430
  kind: "ghost",
@@ -449,7 +481,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
449
481
  className: "".concat(blockClass, "__title-text"),
450
482
  title: title,
451
483
  "aria-hidden": false
452
- }, title), animateTitle && title && title.length && /*#__PURE__*/_react.default.createElement("h2", {
484
+ }, title), animateTitle && title && title.length && !reducedMotion.matches && /*#__PURE__*/_react.default.createElement("h2", {
453
485
  className: "".concat(blockClass, "__collapsed-title-text"),
454
486
  title: title,
455
487
  "aria-hidden": true
@@ -466,7 +498,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
466
498
  id: "".concat(blockClass, "-outer"),
467
499
  className: mainPanelClassNames,
468
500
  style: {
469
- animation: "".concat(open ? placement === 'right' ? "sidePanelEntranceRight ".concat(_motion.moderate02) : "sidePanelEntranceLeft ".concat(_motion.moderate02) : placement === 'right' ? "sidePanelExitRight ".concat(_motion.moderate02) : "sidePanelExitLeft ".concat(_motion.moderate02))
501
+ animation: !reducedMotion.matches ? "".concat(open ? placement === 'right' ? "side-panel-entrance-right ".concat(_motion.moderate02) : "side-panel-entrance-left ".concat(_motion.moderate02) : placement === 'right' ? "side-panel-exit-right ".concat(_motion.moderate02) : "side-panel-exit-left ".concat(_motion.moderate02)) : null
470
502
  },
471
503
  onAnimationEnd: onAnimationEnd,
472
504
  onAnimationStart: function onAnimationStart(event) {
@@ -499,7 +531,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
499
531
  ref: sidePanelOverlayRef,
500
532
  className: "".concat(blockClass, "__overlay"),
501
533
  style: {
502
- animation: "".concat(open ? "sidePanelOverlayEntrance ".concat(_motion.moderate02) : "sidePanelOverlayExit ".concat(_motion.moderate02))
534
+ animation: !reducedMotion.matches ? "".concat(open ? "side-panel-overlay-entrance ".concat(_motion.moderate02) : "side-panel-overlay-exit ".concat(_motion.moderate02)) : null
503
535
  }
504
536
  }));
505
537
  }); // Return a placeholder if not released and not enabled by feature flag
@@ -558,7 +590,7 @@ SidePanel.propTypes = {
558
590
  /**
559
591
  * Sets the close button icon description
560
592
  */
561
- closeIconDescription: _propTypes.default.string.isRequired,
593
+ closeIconDescription: _propTypes.default.string,
562
594
 
563
595
  /**
564
596
  * Determines whether the side panel should render the condensed version (affects action buttons primarily)
@@ -655,14 +687,4 @@ SidePanel.propTypes = {
655
687
  return labelText;
656
688
  })
657
689
  };
658
- SidePanel.defaultProps = {
659
- animateTitle: true,
660
- placement: 'right',
661
- size: 'md',
662
- slideIn: false,
663
- currentStep: 0,
664
- navigationBackIconDescription: 'Back',
665
- closeIconDescription: 'Close',
666
- preventCloseOnClickOutside: false
667
- };
668
690
  SidePanel.displayName = componentName;
@@ -51,15 +51,24 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
51
51
 
52
52
  var componentName = 'TagSet';
53
53
  var blockClass = "".concat(_settings.pkg.prefix, "--tag-set");
54
- var allTagsModalSearchThreshold = 10;
54
+ var allTagsModalSearchThreshold = 10; // Default values for props
55
+
56
+ var defaults = {
57
+ align: 'start',
58
+ overflowAlign: 'center',
59
+ overflowDirection: 'bottom'
60
+ };
55
61
 
56
62
  var TagSet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
57
- var align = _ref.align,
63
+ var _ref$align = _ref.align,
64
+ align = _ref$align === void 0 ? defaults.align : _ref$align,
58
65
  className = _ref.className,
59
66
  maxVisible = _ref.maxVisible,
60
- overflowAlign = _ref.overflowAlign,
67
+ _ref$overflowAlign = _ref.overflowAlign,
68
+ overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
61
69
  overflowClassName = _ref.overflowClassName,
62
- overflowDirection = _ref.overflowDirection,
70
+ _ref$overflowDirectio = _ref.overflowDirection,
71
+ overflowDirection = _ref$overflowDirectio === void 0 ? defaults.overflowDirection : _ref$overflowDirectio,
63
72
  allTagsModalTitle = _ref.allTagsModalTitle,
64
73
  allTagsModalSearchLabel = _ref.allTagsModalSearchLabel,
65
74
  allTagsModalSearchPlaceholderText = _ref.allTagsModalSearchPlaceholderText,
@@ -345,11 +354,6 @@ TagSet.propTypes = {
345
354
  type: _propTypes.default.oneOf(tagTypes)
346
355
  })))
347
356
  };
348
- TagSet.defaultProps = {
349
- align: 'start',
350
- overflowAlign: 'center',
351
- overflowDirection: 'bottom'
352
- };
353
357
  TagSet.displayName = componentName;
354
358
  var _default = TagSet;
355
359
  exports.default = _default;
@@ -13,10 +13,10 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
13
13
 
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
15
 
16
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
17
-
18
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
19
17
 
18
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
19
+
20
20
  var _react = _interopRequireWildcard(require("react"));
21
21
 
22
22
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -29,7 +29,8 @@ var _settings = require("../../settings");
29
29
 
30
30
  var _propsHelper = require("../../global/js/utils/props-helper");
31
31
 
32
- var _excluded = ["label"];
32
+ var _excluded = ["allTags", "className", "title", "onClose", "open", "searchLabel", "searchPlaceholder"],
33
+ _excluded2 = ["label"];
33
34
 
34
35
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
36
 
@@ -40,7 +41,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
40
41
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
41
42
 
42
43
  var componentName = 'TagSetModal';
43
- var blockClass = "".concat(_settings.pkg.prefix, "--tag-set-modal");
44
+ var blockClass = "".concat(_settings.pkg.prefix, "--tag-set-modal"); // Default values for props
45
+
46
+ var defaults = {
47
+ // marked as required by TagSet if needed, default used to satisfy <Search /> component
48
+ searchLabel: ''
49
+ };
44
50
 
45
51
  var TagSetModal = function TagSetModal(_ref) {
46
52
  var allTags = _ref.allTags,
@@ -48,8 +54,10 @@ var TagSetModal = function TagSetModal(_ref) {
48
54
  title = _ref.title,
49
55
  onClose = _ref.onClose,
50
56
  open = _ref.open,
51
- searchLabel = _ref.searchLabel,
52
- searchPlaceholder = _ref.searchPlaceholder;
57
+ _ref$searchLabel = _ref.searchLabel,
58
+ searchLabel = _ref$searchLabel === void 0 ? defaults.searchLabel : _ref$searchLabel,
59
+ searchPlaceholder = _ref.searchPlaceholder,
60
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
53
61
 
54
62
  var _useState = (0, _react.useState)([]),
55
63
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -89,13 +97,13 @@ var TagSetModal = function TagSetModal(_ref) {
89
97
  setSearch(ev.target.value || '');
90
98
  };
91
99
 
92
- return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ComposedModal, {
100
+ return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ComposedModal, (0, _extends2.default)({}, rest, {
93
101
  containerClassName: "".concat(blockClass, "__container"),
94
102
  className: (0, _classnames.default)(className, "".concat(blockClass)),
95
103
  size: "sm",
96
104
  open: open,
97
105
  onClose: onClose
98
- }, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ModalHeader, {
106
+ }), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ModalHeader, {
99
107
  title: title,
100
108
  className: "".concat(blockClass, "__header")
101
109
  }, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Search, {
@@ -110,7 +118,7 @@ var TagSetModal = function TagSetModal(_ref) {
110
118
  hasForm: true
111
119
  }, filteredModalTags.map(function (_ref2, index) {
112
120
  var label = _ref2.label,
113
- other = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
121
+ other = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
114
122
  return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Tag, (0, _extends2.default)({}, other, {
115
123
  filter: false,
116
124
  key: "all-tags-".concat(index)
@@ -132,8 +140,4 @@ TagSetModal.propTypes = {
132
140
  searchPlaceholder: _propTypes.default.string,
133
141
  title: _propTypes.default.string
134
142
  };
135
- TagSetModal.defaultProps = {
136
- // marked as required by TagSet if needed, default used to satisfy <Search /> component
137
- searchLabel: ''
138
- };
139
143
  TagSetModal.displayName = componentName;
@@ -9,10 +9,14 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports.TagSetOverflow = void 0;
11
11
 
12
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
+
12
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
15
 
14
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
17
 
18
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
19
+
16
20
  var _react = _interopRequireWildcard(require("react"));
17
21
 
18
22
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -25,27 +29,33 @@ var _settings = require("../../settings");
25
29
 
26
30
  var _pconsole = require("../../global/js/utils/pconsole");
27
31
 
32
+ var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "overflowAlign", "overflowDirection", "overflowTags", "showAllTagsLabel"];
33
+
28
34
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
35
 
30
36
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
37
 
32
- //
33
- // Copyright IBM Corp. 2021, 2021
34
- //
35
- // This source code is licensed under the Apache-2.0 license found in the
36
- // LICENSE file in the root directory of this source tree.
37
- //
38
38
  var componentName = 'TagSetOverflow';
39
- var blockClass = "".concat(_settings.pkg.prefix, "--tag-set-overflow");
39
+ var blockClass = "".concat(_settings.pkg.prefix, "--tag-set-overflow"); // Default values for props
40
+
41
+ var defaults = {
42
+ allTagsModalSearchThreshold: 10,
43
+ overflowAlign: 'center',
44
+ overflowDirection: 'bottom'
45
+ };
40
46
 
41
47
  var TagSetOverflow = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
42
- var className = _ref.className,
43
- overflowTags = _ref.overflowTags,
48
+ var _ref$allTagsModalSear = _ref.allTagsModalSearchThreshold,
49
+ allTagsModalSearchThreshold = _ref$allTagsModalSear === void 0 ? defaults.allTagsModalSearchThreshold : _ref$allTagsModalSear,
50
+ className = _ref.className,
44
51
  onShowAllClick = _ref.onShowAllClick,
45
- overflowAlign = _ref.overflowAlign,
46
- overflowDirection = _ref.overflowDirection,
52
+ _ref$overflowAlign = _ref.overflowAlign,
53
+ overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
54
+ _ref$overflowDirectio = _ref.overflowDirection,
55
+ overflowDirection = _ref$overflowDirectio === void 0 ? defaults.overflowDirection : _ref$overflowDirectio,
56
+ overflowTags = _ref.overflowTags,
47
57
  showAllTagsLabel = _ref.showAllTagsLabel,
48
- allTagsModalSearchThreshold = _ref.allTagsModalSearchThreshold;
58
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
49
59
 
50
60
  var _useState = (0, _react.useState)(false),
51
61
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -66,11 +76,11 @@ var TagSetOverflow = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
66
76
  onShowAllClick();
67
77
  };
68
78
 
69
- return /*#__PURE__*/_react.default.createElement("span", {
79
+ return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({}, rest, {
70
80
  "aria-hidden": overflowTags.length === 0,
71
81
  className: (0, _classnames.default)("".concat(blockClass), (0, _defineProperty2.default)({}, "".concat(blockClass, "--hidden"), overflowTags.length === 0)),
72
82
  ref: ref
73
- }, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Tooltip, {
83
+ }), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Tooltip, {
74
84
  align: overflowAlign,
75
85
  className: (0, _classnames.default)(className, "".concat(blockClass, "__tooltip")),
76
86
  direction: overflowDirection,
@@ -139,9 +149,4 @@ TagSetOverflow.propTypes = {
139
149
  * label for the overflow show all tags link
140
150
  */
141
151
  showAllTagsLabel: _propTypes.default.string
142
- };
143
- TagSetOverflow.defaultProps = {
144
- allTagsModalSearchThreshold: 10,
145
- overflowAlign: 'center',
146
- overflowDirection: 'bottom'
147
152
  };
@@ -9,7 +9,7 @@ exports.deprecatedProps = exports.Tearsheet = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
13
 
14
14
  var _react = _interopRequireDefault(require("react"));
15
15
 
@@ -27,12 +27,20 @@ var _ActionSet = require("../ActionSet");
27
27
 
28
28
  var _TearsheetShell = require("./TearsheetShell");
29
29
 
30
+ var _excluded = ["influencerPosition", "influencerWidth", "verticalPosition"];
31
+
30
32
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
33
 
32
34
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
35
 
34
36
  var componentName = 'Tearsheet'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
37
+ // Default values for props
35
38
 
39
+ var defaults = {
40
+ influencerPosition: 'left',
41
+ influencerWidth: 'narrow',
42
+ verticalPosition: 'lower'
43
+ };
36
44
  /**
37
45
  * A tearsheet is a mostly full-screen type of dialog that keeps users
38
46
  * in-context and focused by bringing actionable content front and center while
@@ -46,11 +54,21 @@ var componentName = 'Tearsheet'; // NOTE: the component SCSS is not imported her
46
54
  * action buttons.
47
55
  */
48
56
 
49
- var Tearsheet = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
50
- return /*#__PURE__*/_react.default.createElement(_TearsheetShell.TearsheetShell, (0, _extends2.default)({}, (0, _devtools.getDevtoolsProps)(componentName), (0, _propsHelper.prepareProps)(props, [], {
57
+ var Tearsheet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
58
+ var _ref$influencerPositi = _ref.influencerPosition,
59
+ influencerPosition = _ref$influencerPositi === void 0 ? defaults.influencerPosition : _ref$influencerPositi,
60
+ _ref$influencerWidth = _ref.influencerWidth,
61
+ influencerWidth = _ref$influencerWidth === void 0 ? defaults.influencerWidth : _ref$influencerWidth,
62
+ _ref$verticalPosition = _ref.verticalPosition,
63
+ verticalPosition = _ref$verticalPosition === void 0 ? defaults.verticalPosition : _ref$verticalPosition,
64
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
65
+ return /*#__PURE__*/_react.default.createElement(_TearsheetShell.TearsheetShell, _objectSpread(_objectSpread(_objectSpread({}, (0, _devtools.getDevtoolsProps)(componentName)), rest), {}, {
66
+ influencerPosition: influencerPosition,
67
+ influencerWidth: influencerWidth,
68
+ verticalPosition: verticalPosition,
51
69
  ref: ref,
52
70
  size: 'wide'
53
- })));
71
+ }));
54
72
  }); // Return a placeholder if not released and not enabled by feature flag
55
73
 
56
74
 
@@ -112,9 +130,9 @@ Tearsheet.propTypes = _objectSpread({
112
130
  * **Note:** This prop is only required if a close icon is shown, i.e. if
113
131
  * there are a no navigation actions and/or hasCloseIcon is true.
114
132
  */
115
- closeIconDescription: _propTypes.default.string.isRequired.if(function (_ref) {
116
- var actions = _ref.actions,
117
- hasCloseIcon = _ref.hasCloseIcon;
133
+ closeIconDescription: _propTypes.default.string.isRequired.if(function (_ref2) {
134
+ var actions = _ref2.actions,
135
+ hasCloseIcon = _ref2.hasCloseIcon;
118
136
  return (0, _TearsheetShell.tearsheetHasCloseIcon)(actions, hasCloseIcon);
119
137
  }),
120
138
 
@@ -180,13 +198,4 @@ Tearsheet.propTypes = _objectSpread({
180
198
  * The main title of the tearsheet, displayed in the header area.
181
199
  */
182
200
  title: _propTypes.default.node
183
- }, deprecatedProps); // Default values for component props. Default values are not required for
184
- // props that are required, nor for props where the component can apply
185
- // 'undefined' values reasonably. Default values should be provided when the
186
- // component needs to make a choice or assumption when a prop is not supplied.
187
-
188
- Tearsheet.defaultProps = {
189
- influencerPosition: 'left',
190
- influencerWidth: 'narrow',
191
- verticalPosition: 'lower'
192
- };
201
+ }, deprecatedProps);
@@ -9,7 +9,7 @@ exports.deprecatedProps = exports.TearsheetNarrow = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
13
 
14
14
  var _react = _interopRequireDefault(require("react"));
15
15
 
@@ -27,12 +27,18 @@ var _ActionSet = require("../ActionSet");
27
27
 
28
28
  var _TearsheetShell = require("./TearsheetShell");
29
29
 
30
+ var _excluded = ["verticalPosition"];
31
+
30
32
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
33
 
32
34
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
35
 
34
36
  var componentName = 'TearsheetNarrow'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
37
+ // Default values for props
35
38
 
39
+ var defaults = {
40
+ verticalPosition: 'lower'
41
+ };
36
42
  /**
37
43
  * A narrow tearsheet is a slimmer variant of the tearsheet, providing a dialog
38
44
  * that keeps users in-context and focused by bringing actionable content front
@@ -42,11 +48,15 @@ var componentName = 'TearsheetNarrow'; // NOTE: the component SCSS is not import
42
48
  * main content area, and a set of action buttons.
43
49
  */
44
50
 
45
- var TearsheetNarrow = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
46
- return /*#__PURE__*/_react.default.createElement(_TearsheetShell.TearsheetShell, (0, _extends2.default)({}, (0, _devtools.getDevtoolsProps)(componentName), (0, _propsHelper.prepareProps)(props, _TearsheetShell.tearsheetShellWideProps, {
51
+ var TearsheetNarrow = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
52
+ var _ref$verticalPosition = _ref.verticalPosition,
53
+ verticalPosition = _ref$verticalPosition === void 0 ? defaults.verticalPosition : _ref$verticalPosition,
54
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
55
+ return /*#__PURE__*/_react.default.createElement(_TearsheetShell.TearsheetShell, _objectSpread(_objectSpread(_objectSpread({}, (0, _devtools.getDevtoolsProps)(componentName)), (0, _propsHelper.prepareProps)(rest, _TearsheetShell.tearsheetShellWideProps)), {}, {
56
+ verticalPosition: verticalPosition,
47
57
  ref: ref,
48
58
  size: 'narrow'
49
- })));
59
+ }));
50
60
  }); // Return a placeholder if not released and not enabled by feature flag
51
61
 
52
62
 
@@ -108,9 +118,9 @@ TearsheetNarrow.propTypes = _objectSpread({
108
118
  * **Note:** This prop is only required if a close icon is shown, i.e. if
109
119
  * there are a no navigation actions and/or hasCloseIcon is true.
110
120
  */
111
- closeIconDescription: _propTypes.default.string.isRequired.if(function (_ref) {
112
- var actions = _ref.actions,
113
- hasCloseIcon = _ref.hasCloseIcon;
121
+ closeIconDescription: _propTypes.default.string.isRequired.if(function (_ref2) {
122
+ var actions = _ref2.actions,
123
+ hasCloseIcon = _ref2.hasCloseIcon;
114
124
  return (0, _TearsheetShell.tearsheetHasCloseIcon)(actions, hasCloseIcon);
115
125
  }),
116
126
 
@@ -150,11 +160,4 @@ TearsheetNarrow.propTypes = _objectSpread({
150
160
  * The main title of the tearsheet, displayed in the header area.
151
161
  */
152
162
  title: _propTypes.default.node
153
- }, deprecatedProps); // Default values for component props. Default values are not required for
154
- // props that are required, nor for props where the component can apply
155
- // 'undefined' values reasonably. Default values should be provided when the
156
- // component needs to make a choice or assumption when a prop is not supplied.
157
-
158
- TearsheetNarrow.defaultProps = {
159
- verticalPosition: 'lower'
160
- };
163
+ }, deprecatedProps);
@@ -146,10 +146,9 @@ var TearsheetShell = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
146
146
  setTimeout(function () {
147
147
  return element.focus();
148
148
  }, 1);
149
- }; // Hook called whenever the tearsheet mounts, unmounts, or 'open' changes.
149
+ };
150
150
 
151
-
152
- (0, _react.useLayoutEffect)(function () {
151
+ (0, _react.useEffect)(function () {
153
152
  var notify = function notify() {
154
153
  return stack.all.forEach(function (handler) {
155
154
  handler(Math.min(stack.open.length, maxDepth), stack.open.indexOf(handler) + 1);
@@ -69,7 +69,4 @@ ToolbarButton.propTypes = {
69
69
  /** Provide an optional class to be applied to the containing node */
70
70
  className: _propTypes.string
71
71
  };
72
- ToolbarButton.defaultProps = {
73
- caret: false
74
- };
75
72
  exports.ToolbarButton = ToolbarButton = _settings.pkg.checkComponentEnabled(ToolbarButton, componentName);