@carbon/ibm-products 2.0.0-rc.2 → 2.0.0-rc.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. package/css/index-full-carbon.css +946 -327
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +4 -8
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +785 -168
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +4 -8
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +720 -232
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +4 -8
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +742 -244
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +4 -8
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/APIKeyModal/APIKeyModal.js +1 -1
  18. package/es/components/AddSelect/AddSelect.js +0 -3
  19. package/es/components/AddSelect/AddSelectBody.js +22 -5
  20. package/es/components/AddSelect/AddSelectBreadcrumbs.js +11 -3
  21. package/es/components/AddSelect/AddSelectColumn.js +5 -5
  22. package/es/components/AddSelect/AddSelectFilter.js +5 -4
  23. package/es/components/AddSelect/AddSelectList.js +61 -27
  24. package/es/components/AddSelect/AddSelectMetaPanel.js +1 -1
  25. package/es/components/AddSelect/AddSelectSort.js +1 -1
  26. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +4 -6
  27. package/es/components/Card/Card.js +16 -6
  28. package/es/components/Card/CardFooter.js +3 -1
  29. package/es/components/Card/CardHeader.js +20 -1
  30. package/es/components/ComboButton/ComboButton.js +1 -1
  31. package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
  32. package/es/components/DataSpreadsheet/DataSpreadsheet.js +63 -11
  33. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
  34. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
  35. package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
  36. package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +31 -0
  37. package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
  38. package/es/components/Datagrid/Datagrid/Datagrid.js +10 -38
  39. package/es/components/Datagrid/Datagrid/DatagridContent.js +154 -0
  40. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
  41. package/es/components/Datagrid/Datagrid/DatagridRow.js +10 -2
  42. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -3
  43. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +13 -4
  44. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +5 -4
  45. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +2 -1
  46. package/es/components/Datagrid/Datagrid/DraggableElement.js +6 -2
  47. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +5 -45
  48. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +4 -1
  49. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +36 -10
  50. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +62 -26
  51. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
  52. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +60 -0
  53. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +1 -0
  54. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +534 -0
  55. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +1 -0
  56. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +112 -0
  57. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +27 -0
  58. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +1 -0
  59. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +39 -0
  60. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +19 -0
  61. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +263 -0
  62. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +87 -0
  63. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -14
  64. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -36
  65. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
  66. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
  67. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
  68. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
  69. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
  70. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
  71. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
  72. package/es/components/Datagrid/index.js +3 -1
  73. package/es/components/Datagrid/useActionsColumn.js +28 -12
  74. package/es/components/Datagrid/useColumnOrder.js +8 -0
  75. package/es/components/Datagrid/useCustomizeColumns.js +5 -0
  76. package/es/components/Datagrid/useDisableSelectRows.js +6 -2
  77. package/es/components/Datagrid/useExpandedRow.js +0 -1
  78. package/es/components/Datagrid/useInfiniteScroll.js +5 -2
  79. package/es/components/Datagrid/useInlineEdit.js +71 -0
  80. package/es/components/Datagrid/useNestedRowExpander.js +42 -0
  81. package/es/components/Datagrid/useNestedRows.js +2 -2
  82. package/es/components/Datagrid/useRowExpander.js +1 -1
  83. package/es/components/Datagrid/useRowSize.js +17 -6
  84. package/es/components/Datagrid/useSelectAllToggle.js +17 -4
  85. package/es/components/Datagrid/useSelectRows.js +12 -2
  86. package/es/components/Datagrid/useSortableColumns.js +1 -1
  87. package/es/components/Datagrid/useStickyColumn.js +11 -0
  88. package/es/components/Datagrid/utils/DatagridActions.js +152 -0
  89. package/es/components/Datagrid/utils/DatagridPagination.js +33 -0
  90. package/es/components/Datagrid/utils/Wrapper.js +21 -0
  91. package/es/components/Datagrid/utils/getArgTypes.js +89 -0
  92. package/es/components/Datagrid/utils/getInlineEditColumns.js +153 -0
  93. package/es/components/Datagrid/utils/makeData.js +46 -1
  94. package/es/components/EditUpdateCards/EditUpdateCards.js +144 -0
  95. package/es/components/EditUpdateCards/index.js +7 -0
  96. package/es/components/ExportModal/ExportModal.js +1 -1
  97. package/es/components/ImportModal/ImportModal.js +3 -3
  98. package/es/components/InlineEdit/InlineEdit.js +11 -9
  99. package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +1 -1
  100. package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +1 -1
  101. package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
  102. package/es/components/OptionsTile/OptionsTile.js +1 -1
  103. package/es/components/PageHeader/PageHeader.js +1 -1
  104. package/es/components/PageHeader/PageHeaderTitle.js +3 -1
  105. package/es/components/ProductiveCard/ProductiveCard.js +5 -0
  106. package/es/components/Saving/Saving.js +1 -1
  107. package/es/components/SidePanel/SidePanel.js +45 -52
  108. package/es/components/SidePanel/motion/variants.js +45 -0
  109. package/es/components/StatusIcon/StatusIcon.js +1 -1
  110. package/es/components/UserProfileImage/UserProfileImage.js +1 -1
  111. package/es/components/WebTerminal/WebTerminal.js +1 -1
  112. package/es/components/WebTerminal/preview-components/Navigation.js +1 -1
  113. package/es/components/index.js +3 -2
  114. package/es/global/js/hooks/useClickOutside.js +1 -1
  115. package/es/global/js/package-settings.js +5 -4
  116. package/es/global/js/utils/getBezierValues.js +20 -0
  117. package/es/global/js/utils/motionConstants.js +45 -0
  118. package/es/global/js/utils/rangeWithCallback.js +13 -0
  119. package/es/global/js/utils/story-helper.js +5 -1
  120. package/es/global/js/utils/uuidv4.spec.js +4 -0
  121. package/lib/components/APIKeyModal/APIKeyModal.js +4 -4
  122. package/lib/components/AddSelect/AddSelect.js +0 -4
  123. package/lib/components/AddSelect/AddSelectBody.js +22 -5
  124. package/lib/components/AddSelect/AddSelectBreadcrumbs.js +14 -3
  125. package/lib/components/AddSelect/AddSelectColumn.js +5 -5
  126. package/lib/components/AddSelect/AddSelectFilter.js +5 -4
  127. package/lib/components/AddSelect/AddSelectList.js +62 -28
  128. package/lib/components/AddSelect/AddSelectMetaPanel.js +2 -2
  129. package/lib/components/AddSelect/AddSelectSort.js +4 -4
  130. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +6 -6
  131. package/lib/components/Card/Card.js +16 -6
  132. package/lib/components/Card/CardFooter.js +3 -1
  133. package/lib/components/Card/CardHeader.js +21 -1
  134. package/lib/components/ComboButton/ComboButton.js +3 -3
  135. package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
  136. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +63 -10
  137. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
  138. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
  139. package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
  140. package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +42 -0
  141. package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
  142. package/lib/components/Datagrid/Datagrid/Datagrid.js +12 -45
  143. package/lib/components/Datagrid/Datagrid/DatagridContent.js +188 -0
  144. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
  145. package/lib/components/Datagrid/Datagrid/DatagridRow.js +19 -2
  146. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +12 -3
  147. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +16 -5
  148. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +6 -5
  149. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +2 -1
  150. package/lib/components/Datagrid/Datagrid/DraggableElement.js +7 -3
  151. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +12 -47
  152. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +5 -2
  153. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +48 -25
  154. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +60 -25
  155. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
  156. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +76 -0
  157. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +13 -0
  158. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +558 -0
  159. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +13 -0
  160. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +129 -0
  161. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +36 -0
  162. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +19 -0
  163. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +45 -0
  164. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +28 -0
  165. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +272 -0
  166. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +100 -0
  167. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -13
  168. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -35
  169. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
  170. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
  171. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
  172. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
  173. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
  174. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
  175. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
  176. package/lib/components/Datagrid/index.js +17 -1
  177. package/lib/components/Datagrid/useActionsColumn.js +28 -13
  178. package/lib/components/Datagrid/useColumnOrder.js +17 -0
  179. package/lib/components/Datagrid/useCustomizeColumns.js +5 -0
  180. package/lib/components/Datagrid/useDisableSelectRows.js +6 -2
  181. package/lib/components/Datagrid/useExpandedRow.js +0 -1
  182. package/lib/components/Datagrid/useInfiniteScroll.js +5 -2
  183. package/lib/components/Datagrid/useInlineEdit.js +85 -0
  184. package/lib/components/Datagrid/useNestedRowExpander.js +57 -0
  185. package/lib/components/Datagrid/useNestedRows.js +3 -3
  186. package/lib/components/Datagrid/useRowExpander.js +3 -3
  187. package/lib/components/Datagrid/useRowSize.js +18 -13
  188. package/lib/components/Datagrid/useSelectAllToggle.js +18 -4
  189. package/lib/components/Datagrid/useSelectRows.js +12 -2
  190. package/lib/components/Datagrid/useSortableColumns.js +5 -5
  191. package/lib/components/Datagrid/useStickyColumn.js +11 -0
  192. package/lib/components/Datagrid/utils/DatagridActions.js +170 -0
  193. package/lib/components/Datagrid/utils/DatagridPagination.js +46 -0
  194. package/lib/components/Datagrid/utils/Wrapper.js +33 -0
  195. package/lib/components/Datagrid/utils/getArgTypes.js +97 -0
  196. package/lib/components/Datagrid/utils/getInlineEditColumns.js +168 -0
  197. package/lib/components/Datagrid/utils/makeData.js +47 -1
  198. package/lib/components/EditUpdateCards/EditUpdateCards.js +152 -0
  199. package/lib/components/EditUpdateCards/index.js +13 -0
  200. package/lib/components/ExportModal/ExportModal.js +3 -3
  201. package/lib/components/ImportModal/ImportModal.js +4 -4
  202. package/lib/components/InlineEdit/InlineEdit.js +16 -14
  203. package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +2 -2
  204. package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +3 -3
  205. package/lib/components/NotificationsPanel/NotificationsPanel.js +8 -8
  206. package/lib/components/OptionsTile/OptionsTile.js +6 -6
  207. package/lib/components/PageHeader/PageHeader.js +2 -2
  208. package/lib/components/PageHeader/PageHeaderTitle.js +3 -1
  209. package/lib/components/ProductiveCard/ProductiveCard.js +5 -0
  210. package/lib/components/Saving/Saving.js +5 -5
  211. package/lib/components/SidePanel/SidePanel.js +48 -53
  212. package/lib/components/SidePanel/motion/variants.js +55 -0
  213. package/lib/components/StatusIcon/StatusIcon.js +45 -45
  214. package/lib/components/UserProfileImage/UserProfileImage.js +7 -7
  215. package/lib/components/WebTerminal/WebTerminal.js +3 -3
  216. package/lib/components/WebTerminal/preview-components/Navigation.js +4 -4
  217. package/lib/components/index.js +21 -1
  218. package/lib/global/js/hooks/useClickOutside.js +1 -1
  219. package/lib/global/js/package-settings.js +5 -4
  220. package/lib/global/js/utils/getBezierValues.js +29 -0
  221. package/lib/global/js/utils/motionConstants.js +55 -0
  222. package/lib/global/js/utils/rangeWithCallback.js +22 -0
  223. package/lib/global/js/utils/story-helper.js +5 -1
  224. package/lib/global/js/utils/uuidv4.spec.js +4 -0
  225. package/package.json +18 -16
  226. package/scss/components/AddSelect/_add-select.scss +129 -30
  227. package/scss/components/Card/_card.scss +1 -0
  228. package/scss/components/Cascade/_cascade.scss +1 -1
  229. package/scss/components/CreateTearsheet/_create-tearsheet.scss +2 -0
  230. package/scss/components/Datagrid/_datagrid.scss +7 -0
  231. package/scss/components/Datagrid/_storybook-styles.scss +12 -5
  232. package/scss/components/Datagrid/styles/_datagrid.scss +31 -15
  233. package/scss/components/Datagrid/styles/_draggableElement.scss +26 -9
  234. package/scss/components/Datagrid/styles/_index.scss +1 -0
  235. package/scss/components/Datagrid/styles/_useActionsColumn.scss +14 -0
  236. package/scss/components/Datagrid/styles/_useExpandedRow.scss +37 -9
  237. package/scss/components/Datagrid/styles/_useInlineEdit.scss +419 -0
  238. package/scss/components/Datagrid/styles/_useNestedRows.scss +16 -1
  239. package/scss/components/Datagrid/styles/_useStickyColumn.scss +31 -2
  240. package/scss/components/Datagrid/styles/addons/_CustomizeColumnsModal.scss +47 -6
  241. package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +9 -1
  242. package/scss/components/EditUpdateCards/_carbon-imports.scss +9 -0
  243. package/scss/components/EditUpdateCards/_edit-update-cards.scss +85 -0
  244. package/scss/components/EditUpdateCards/_index-with-carbon.scss +9 -0
  245. package/scss/components/EditUpdateCards/_index.scss +8 -0
  246. package/scss/components/EditUpdateCards/_storybook-styles.scss +55 -0
  247. package/scss/components/InlineEdit/_inline-edit.scss +4 -2
  248. package/scss/components/NotificationsPanel/_notifications-panel.scss +3 -6
  249. package/scss/components/PageHeader/_page-header.scss +4 -0
  250. package/scss/components/RemoveModal/_remove-modal.scss +0 -4
  251. package/scss/components/SidePanel/_side-panel.scss +3 -82
  252. package/scss/components/SidePanel/_storybook-styles.scss +6 -1
  253. package/scss/components/Tearsheet/_tearsheet.scss +2 -2
  254. package/scss/components/_index-released-only.scss +1 -0
  255. package/scss/components/_index-with-carbon.scss +1 -0
  256. package/scss/components/_index.scss +1 -0
@@ -18,7 +18,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
18
18
  // LICENSE file in the root directory of this source tree.
19
19
  //
20
20
  import React, { useState, forwardRef } from 'react';
21
- import { Add } from '@carbon/icons-react';
21
+ import { Add } from '@carbon/react/icons';
22
22
  import { ComposedModal, ModalHeader, ModalFooter, ModalBody, FileUploaderDropContainer, FileUploaderItem, TextInput, Button, usePrefix } from '@carbon/react';
23
23
  import cx from 'classnames';
24
24
  import PropTypes from 'prop-types';
@@ -77,9 +77,9 @@ export var ImportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
77
77
  var acceptSet = new Set(accept);
78
78
  var name = file.name;
79
79
  var mimeType = file.type;
80
- var extension = name.split('.').pop();
80
+ var extension = ".".concat(name.split('.').pop());
81
81
 
82
- if (acceptSet.has(mimeType) || acceptSet.has(extension)) {
82
+ if (acceptSet.has(mimeType) || acceptSet.has(extension) || accept.length === 0) {
83
83
  return false;
84
84
  }
85
85
 
@@ -22,7 +22,7 @@ import { pkg } from '../../settings'; // Carbon and package components we use.
22
22
  /* TODO: @use(s) of carbon components and other package components. */
23
23
 
24
24
  import { Button, IconButton, usePrefix } from '@carbon/react';
25
- import { Close, Edit, EditOff, Checkmark, WarningFilled } from '@carbon/icons-react'; // The block part of our conventional BEM class names (blockClass__E--M).
25
+ import { Close, Edit, EditOff, Checkmark, WarningFilled } from '@carbon/react/icons'; // The block part of our conventional BEM class names (blockClass__E--M).
26
26
 
27
27
  var blockClass = "".concat(pkg.prefix, "--inline-edit");
28
28
  var componentName = 'InlineEdit'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
@@ -40,7 +40,7 @@ var buttons = ['cancel', 'edit', 'save'];
40
40
  */
41
41
 
42
42
  export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
43
- var _cx, _refInput$current, _refInput$current$inn, _cx3;
43
+ var _cx, _refInput$current, _refInput$current$tex, _cx3;
44
44
 
45
45
  var buttonTooltipAlignment = _ref.buttonTooltipAlignment,
46
46
  buttonTooltipPosition = _ref.buttonTooltipPosition,
@@ -66,7 +66,9 @@ export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
66
66
  rest = _objectWithoutProperties(_ref, _excluded);
67
67
 
68
68
  var carbonPrefix = usePrefix();
69
- var refInput = useRef(null);
69
+ var refInput = useRef({
70
+ textContent: value
71
+ });
70
72
  var localRef = useRef(null);
71
73
  var ref = refIn || localRef;
72
74
 
@@ -149,15 +151,15 @@ export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
149
151
  document.getSelection().removeAllRanges();
150
152
 
151
153
  if (onSave) {
152
- onSave(refInput.current.innerText);
154
+ onSave(refInput.current.textContent);
153
155
  }
154
156
  };
155
157
 
156
158
  var handleInput = function handleInput() {
157
- setInternalValue(refInput.current.innerText);
159
+ setInternalValue(refInput.current.textContent);
158
160
 
159
161
  if (onChange) {
160
- onChange(refInput.current.innerText);
162
+ onChange(refInput.current.textContent);
161
163
  }
162
164
  }; // pasting into contentEditable not supported by userEvent
163
165
 
@@ -192,7 +194,7 @@ export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
192
194
  };
193
195
 
194
196
  var handleCancel = function handleCancel() {
195
- refInput.current.innerText = value;
197
+ refInput.current.textContent = value;
196
198
  handleInput(value);
197
199
  doSetEditing(false);
198
200
  document.getSelection().removeAllRanges();
@@ -260,7 +262,7 @@ export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
260
262
  }, /*#__PURE__*/React.createElement("div", _extends({}, rest, getDevtoolsProps(componentName), {
261
263
  id: id,
262
264
  size: size,
263
- className: cx("".concat(blockClass, "__input"), _defineProperty({}, "".concat(blockClass, "__input--empty"), ((_refInput$current = refInput.current) === null || _refInput$current === void 0 ? void 0 : (_refInput$current$inn = _refInput$current.innerText) === null || _refInput$current$inn === void 0 ? void 0 : _refInput$current$inn.length) === 0)),
265
+ className: cx("".concat(blockClass, "__input"), _defineProperty({}, "".concat(blockClass, "__input--empty"), ((_refInput$current = refInput.current) === null || _refInput$current === void 0 ? void 0 : (_refInput$current$tex = _refInput$current.textContent) === null || _refInput$current$tex === void 0 ? void 0 : _refInput$current$tex.length) === 0)),
264
266
  contentEditable: true,
265
267
  "aria-label": labelText,
266
268
  role: "textbox",
@@ -271,7 +273,7 @@ export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
271
273
  onPaste: handlePaste,
272
274
  suppressContentEditableWarning: true,
273
275
  ref: refInput,
274
- "data-placeholder": placeholder !== null && placeholder !== void 0 ? placeholder : labelText
276
+ "data-placeholder": placeholder
275
277
  }), value), /*#__PURE__*/React.createElement("div", {
276
278
  className: cx("".concat(blockClass, "__after-input-elements")) // tabindex -1 fixes blur target test when clicking on after-input-elements background
277
279
  ,
@@ -6,7 +6,7 @@
6
6
  //
7
7
  import React from 'react';
8
8
  import PropTypes from 'prop-types';
9
- import { Add } from '@carbon/icons-react';
9
+ import { Add } from '@carbon/react/icons';
10
10
  import { pkg } from '../../settings';
11
11
  var blockClass = "".concat(pkg.prefix, "--modified-tabs");
12
12
  export var ModifiedTabLabelNew = function ModifiedTabLabelNew(_ref) {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { Close, CloseFilled } from '@carbon/icons-react';
3
+ import { Close, CloseFilled } from '@carbon/react/icons';
4
4
  import { pkg } from '../../settings';
5
5
  var blockClass = "".concat(pkg.prefix, "--modified-tabs");
6
6
  export var ModifiedTabLabelWithClose = function ModifiedTabLabelWithClose(_ref) {
@@ -22,7 +22,7 @@ import { timeAgo } from './utils';
22
22
  import { NotificationsEmptyState } from '../EmptyStates/NotificationsEmptyState'; // Carbon and package components we use.
23
23
 
24
24
  import { Button, Link, Toggle, IconButton } from '@carbon/react';
25
- import { ErrorFilled, WarningAltFilled, CheckmarkFilled, InformationSquareFilled, ChevronDown, Close, Settings } from '@carbon/icons-react';
25
+ import { ErrorFilled, WarningAltFilled, CheckmarkFilled, InformationSquareFilled, ChevronDown, Close, Settings } from '@carbon/react/icons';
26
26
  import { usePreviousValue } from '../../global/js/hooks'; // The block part of our conventional BEM class names (blockClass__E--M).
27
27
 
28
28
  var componentName = 'NotificationsPanel';
@@ -20,7 +20,7 @@ import uuidv4 from '../../global/js/utils/uuidv4';
20
20
  import { pkg } from '../../settings'; // Carbon and package components we use.
21
21
 
22
22
  import { Toggle } from '@carbon/react';
23
- import { ChevronDown, Locked, WarningAltFilled, WarningFilled } from '@carbon/icons-react';
23
+ import { ChevronDown, Locked, WarningAltFilled, WarningFilled } from '@carbon/react/icons';
24
24
  import * as carbonMotion from '@carbon/motion'; // The block part of our conventional BEM class names (blockClass__E--M).
25
25
 
26
26
  var blockClass = "".concat(pkg.prefix, "--options-tile");
@@ -29,7 +29,7 @@ import { ActionBar } from '../ActionBar/';
29
29
  import { BreadcrumbWithOverflow } from '../BreadcrumbWithOverflow';
30
30
  import { TagSet, string_required_if_more_than_10_tags } from '../TagSet/TagSet';
31
31
  import { ButtonSetWithOverflow } from '../ButtonSetWithOverflow';
32
- import { ChevronUp } from '@carbon/icons-react';
32
+ import { ChevronUp } from '@carbon/react/icons';
33
33
  var componentName = 'PageHeader';
34
34
  import { blockClass, utilCheckUpdateVerticalSpace, utilGetBreadcrumbItemForTitle, utilSetCollapsed } from './PageHeaderUtils';
35
35
  import { PageHeaderTitle } from './PageHeaderTitle'; // Default values for props
@@ -68,7 +68,9 @@ export var PageHeaderTitle = function PageHeaderTitle(_ref) {
68
68
  return /*#__PURE__*/React.createElement("div", {
69
69
  className: cx("".concat(blockClass, "__title"), _defineProperty({}, "".concat(blockClass, "__title--editable"), isEditable), _defineProperty({}, "".concat(blockClass, "__title--fades"), hasBreadcrumbRow)),
70
70
  title: titleText
71
- }, titleInnards);
71
+ }, /*#__PURE__*/React.createElement("h1", {
72
+ className: "".concat(blockClass, "__title-wrapper")
73
+ }, titleInnards));
72
74
  };
73
75
  export var inlineEditRequired = function inlineEditRequired(_ref2) {
74
76
  var onSave = _ref2.onSave;
@@ -117,6 +117,11 @@ ProductiveCard.propTypes = {
117
117
  */
118
118
  primaryButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
119
119
 
120
+ /**
121
+ * Determines if the primary button is on the top or bottom of the card
122
+ */
123
+ primaryButtonPlacement: PropTypes.oneOf(['top', 'bottom']),
124
+
120
125
  /**
121
126
  * The text that's displayed in the primary button
122
127
  */
@@ -12,7 +12,7 @@ var _excluded = ["secondaryButtonText", "className", "defaultIconDescription", "
12
12
  import React, { forwardRef } from 'react';
13
13
  import cx from 'classnames';
14
14
  import { Button, InlineLoading } from '@carbon/react';
15
- import { Save, CheckmarkOutline, ErrorOutline, ErrorFilled } from '@carbon/icons-react';
15
+ import { Save, CheckmarkOutline, ErrorOutline, ErrorFilled } from '@carbon/react/icons';
16
16
  import PropTypes from 'prop-types';
17
17
  import { getDevtoolsProps } from '../../global/js/utils/devtools';
18
18
  import { pkg } from '../../settings';
@@ -16,7 +16,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
16
16
  * LICENSE file in the root directory of this source tree.
17
17
  */
18
18
  // Import portions of React that are needed.
19
- import React, { useState, useEffect, useRef } from 'react'; // Other standard imports.
19
+ import React, { useState, useEffect, useRef } from 'react';
20
+ import { motion, AnimatePresence } from 'framer-motion'; // Other standard imports.
20
21
 
21
22
  import PropTypes from 'prop-types';
22
23
  import cx from 'classnames';
@@ -30,8 +31,9 @@ import { SIDE_PANEL_SIZES } from './constants';
30
31
  import { usePreviousValue } from '../../global/js/hooks'; // Carbon and package components we use.
31
32
 
32
33
  import { Button } from '@carbon/react';
33
- import { Close, ArrowLeft } from '@carbon/icons-react';
34
+ import { Close, ArrowLeft } from '@carbon/react/icons';
34
35
  import { ActionSet } from '../ActionSet';
36
+ import { overlayVariants, panelVariants } from './motion/variants';
35
37
  var blockClass = "".concat(pkg.prefix, "--side-panel");
36
38
  var componentName = 'SidePanel'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
37
39
  // Default values for props
@@ -82,20 +84,15 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
82
84
  title = _ref.title,
83
85
  rest = _objectWithoutProperties(_ref, _excluded);
84
86
 
85
- var _useState = useState(open),
87
+ var _useState = useState(false),
86
88
  _useState2 = _slicedToArray(_useState, 2),
87
- shouldRender = _useState2[0],
88
- setRender = _useState2[1];
89
+ animationComplete = _useState2[0],
90
+ setAnimationComplete = _useState2[1];
89
91
 
90
- var _useState3 = useState(false),
92
+ var _useState3 = useState(0),
91
93
  _useState4 = _slicedToArray(_useState3, 2),
92
- animationComplete = _useState4[0],
93
- setAnimationComplete = _useState4[1];
94
-
95
- var _useState5 = useState(0),
96
- _useState6 = _slicedToArray(_useState5, 2),
97
- panelHeight = _useState6[0],
98
- setPanelHeight = _useState6[1];
94
+ panelHeight = _useState4[0],
95
+ setPanelHeight = _useState4[1];
99
96
 
100
97
  var sidePanelRef = useRef();
101
98
  var sidePanelOverlayRef = useRef();
@@ -125,8 +122,10 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
125
122
  // height css custom property
126
123
 
127
124
  if ((previousState === null || previousState === void 0 ? void 0 : previousState.size) !== size) {
125
+ var _sidePanelOuter$style;
126
+
128
127
  scrollableSection.scrollTop = 0;
129
- sidePanelOuter.style.setProperty("--".concat(blockClass, "--title-container-height"), "".concat(Number(initialTitleHeight), "px"));
128
+ sidePanelOuter === null || sidePanelOuter === void 0 ? void 0 : (_sidePanelOuter$style = sidePanelOuter.style) === null || _sidePanelOuter$style === void 0 ? void 0 : _sidePanelOuter$style.setProperty("--".concat(blockClass, "--title-container-height"), "".concat(Number(initialTitleHeight), "px"));
130
129
  }
131
130
  }
132
131
  }, [currentStep, ref, size, previousState === null || previousState === void 0 ? void 0 : previousState.size]); // set initial focus when side panel opens
@@ -154,12 +153,14 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
154
153
  }, [selectorPrimaryFocus, open, animationComplete]);
155
154
  useEffect(function () {
156
155
  if (open && actions && actions.length && animationComplete) {
156
+ var _sidePanelOuter$style2;
157
+
157
158
  var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
158
159
  var actionsContainer = getActionsContainerElement();
159
160
  var actionsHeight = (actionsContainer === null || actionsContainer === void 0 ? void 0 : actionsContainer.offsetHeight) + 16; // add additional 1rem spacing to bottom padding
160
161
 
161
162
  actionsHeight = "".concat(Math.round(actionsHeight / 16), "rem");
162
- sidePanelOuter === null || sidePanelOuter === void 0 ? void 0 : sidePanelOuter.style.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
163
+ sidePanelOuter === null || sidePanelOuter === void 0 ? void 0 : (_sidePanelOuter$style2 = sidePanelOuter.style) === null || _sidePanelOuter$style2 === void 0 ? void 0 : _sidePanelOuter$style2.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
163
164
  }
164
165
  }, [actions, condensedActions, open, animationComplete]); // Add console warning if labelText is provided without a title.
165
166
  // This combination is not allowed.
@@ -172,13 +173,15 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
172
173
  /* istanbul ignore next */
173
174
 
174
175
  var handleResize = function handleResize(width, height) {
176
+ var _sidePanelOuter$style3;
177
+
175
178
  setPanelHeight(height);
176
179
  var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
177
180
  var actionsContainer = getActionsContainerElement();
178
- var actionsHeight = actionsContainer.offsetHeight + 16; // add additional 1rem spacing to bottom padding
181
+ var actionsHeight = (actionsContainer === null || actionsContainer === void 0 ? void 0 : actionsContainer.offsetHeight) + 16; // add additional 1rem spacing to bottom padding
179
182
 
180
183
  actionsHeight = "".concat(Math.round(actionsHeight / 16), "rem");
181
- sidePanelOuter.style.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
184
+ sidePanelOuter === null || sidePanelOuter === void 0 ? void 0 : (_sidePanelOuter$style3 = sidePanelOuter.style) === null || _sidePanelOuter$style3 === void 0 ? void 0 : _sidePanelOuter$style3.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
182
185
  };
183
186
 
184
187
  var getActionsContainerElement = function getActionsContainerElement() {
@@ -263,7 +266,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
263
266
  });
264
267
  }
265
268
 
266
- if (open && shouldRender && !animateTitle) {
269
+ if (open && !animateTitle) {
267
270
  var _sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
268
271
 
269
272
  var _sidePanelTitleElement = document.querySelector(".".concat(blockClass, "__title-container .").concat(blockClass, "__title-text"));
@@ -284,7 +287,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
284
287
  _sidePanelOuter === null || _sidePanelOuter === void 0 ? void 0 : _sidePanelOuter.style.setProperty("--".concat(blockClass, "--action-bar-container-height"), "".concat(sidePanelActionBarElementHeight, "px"));
285
288
  _sidePanelOuter === null || _sidePanelOuter === void 0 ? void 0 : _sidePanelOuter.style.setProperty("--".concat(blockClass, "--label-text-height"), "".concat(labelHeight, "px"));
286
289
  }
287
- }, [open, animateTitle, animationComplete, shouldRender, panelHeight, title, size, reducedMotion.matches]); // click outside functionality if `includeOverlay` prop is set
290
+ }, [open, animateTitle, animationComplete, panelHeight, title, size, reducedMotion.matches]); // click outside functionality if `includeOverlay` prop is set
288
291
 
289
292
  useEffect(function () {
290
293
  var handleOutsideClick = function handleOutsideClick(event) {
@@ -310,18 +313,11 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
310
313
  return function () {
311
314
  document.removeEventListener('click', handleOutsideClick);
312
315
  };
313
- }, [includeOverlay, onRequestClose, open, preventCloseOnClickOutside, ref, onUnmount]); // initialize the side panel to open
314
-
315
- useEffect(function () {
316
- if (open) {
317
- setRender(true);
318
- }
319
- }, [open]); // initializes the side panel to close
316
+ }, [includeOverlay, onRequestClose, open, preventCloseOnClickOutside, ref, onUnmount]); // initializes the side panel to close
320
317
 
321
318
  var onAnimationEnd = function onAnimationEnd() {
322
319
  if (!open) {
323
320
  onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
324
- setRender(false);
325
321
  }
326
322
 
327
323
  setAnimationComplete(true);
@@ -335,13 +331,8 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
335
331
  }
336
332
  }, [reducedMotion.matches]); // initializes the side panel to open
337
333
 
338
- var _onAnimationStart = function onAnimationStart(event) {
339
- event.persist();
340
- var isPanelTarget = event.target.id === "".concat(blockClass, "-outer");
341
-
342
- if (isPanelTarget) {
343
- setAnimationComplete(false);
344
- }
334
+ var _onAnimationStart = function onAnimationStart() {
335
+ setAnimationComplete(false);
345
336
  }; // used to reset margins of the slide in panel when closed/closing
346
337
 
347
338
 
@@ -358,13 +349,12 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
358
349
  }, [open, placement, selectorPageContent, slideIn]);
359
350
  useEffect(function () {
360
351
  if (!open && previousState !== null && previousState !== void 0 && previousState.open && reducedMotion.matches) {
361
- setRender(false);
362
352
  onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
363
353
  }
364
354
  }, [open, onUnmount, reducedMotion.matches, previousState === null || previousState === void 0 ? void 0 : previousState.open]); // used to set margins of content for slide in panel version
365
355
 
366
356
  useEffect(function () {
367
- if (shouldRender && slideIn) {
357
+ if (open && slideIn) {
368
358
  var pageContentElement = document.querySelector(selectorPageContent);
369
359
 
370
360
  if (placement && placement === 'right' && pageContentElement) {
@@ -377,7 +367,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
377
367
  pageContentElement.style.marginLeft = SIDE_PANEL_SIZES[size];
378
368
  }
379
369
  }
380
- }, [slideIn, selectorPageContent, placement, shouldRender, size, reducedMotion.matches]); // adds focus trap functionality
370
+ }, [slideIn, selectorPageContent, placement, size, reducedMotion.matches, open]); // adds focus trap functionality
381
371
 
382
372
  /* istanbul ignore next */
383
373
 
@@ -483,20 +473,22 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
483
473
  onResize: handleResize,
484
474
  targetRef: contentRef
485
475
  });
486
- return shouldRender && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({}, getDevtoolsProps(componentName), rest, {
476
+ return /*#__PURE__*/React.createElement(AnimatePresence, null, open && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(motion.div, _extends({}, getDevtoolsProps(componentName), rest, {
487
477
  id: "".concat(blockClass, "-outer"),
488
478
  className: mainPanelClassNames,
489
- style: {
490
- animation: !reducedMotion.matches ? "".concat(open ? placement === 'right' ? "side-panel-entrance-right ".concat(moderate02) : "side-panel-entrance-left ".concat(moderate02) : placement === 'right' ? "side-panel-exit-right ".concat(moderate02) : "side-panel-exit-left ".concat(moderate02)) : null
491
- },
492
- onAnimationEnd: onAnimationEnd,
493
- onAnimationStart: function onAnimationStart(event) {
494
- return _onAnimationStart(event);
495
- },
496
479
  onBlur: handleBlur,
497
480
  ref: contentRef,
498
481
  role: "complementary",
499
- "aria-label": title
482
+ "aria-label": title,
483
+ onAnimationComplete: onAnimationEnd,
484
+ onAnimationStart: function onAnimationStart(event) {
485
+ return _onAnimationStart(event);
486
+ },
487
+ variants: panelVariants,
488
+ initial: "hidden",
489
+ animate: "visible",
490
+ exit: "exit",
491
+ custom: placement
500
492
  }), /*#__PURE__*/React.createElement("span", {
501
493
  ref: startTrapRef,
502
494
  tabIndex: "0",
@@ -516,13 +508,14 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
516
508
  tabIndex: "0",
517
509
  role: "link",
518
510
  className: "".concat(blockClass, "__visually-hidden")
519
- }, "Focus sentinel")), includeOverlay && /*#__PURE__*/React.createElement("div", {
511
+ }, "Focus sentinel")), /*#__PURE__*/React.createElement(AnimatePresence, null, includeOverlay && /*#__PURE__*/React.createElement(motion.div, {
512
+ variants: overlayVariants,
513
+ initial: "hidden",
514
+ animate: "visible",
515
+ exit: "exit",
520
516
  ref: sidePanelOverlayRef,
521
- className: "".concat(blockClass, "__overlay"),
522
- style: {
523
- animation: !reducedMotion.matches ? "".concat(open ? "side-panel-overlay-entrance ".concat(moderate02) : "side-panel-overlay-exit ".concat(moderate02)) : null
524
- }
525
- }));
517
+ className: "".concat(blockClass, "__overlay")
518
+ }))));
526
519
  }); // Return a placeholder if not released and not enabled by feature flag
527
520
 
528
521
  SidePanel = pkg.checkComponentEnabled(SidePanel, componentName);
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Copyright IBM Corp. 2022, 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 { DURATIONS, EASINGS } from '../../../global/js/utils/motionConstants';
8
+ export var overlayVariants = {
9
+ visible: {
10
+ opacity: 1,
11
+ transition: {
12
+ duration: DURATIONS.moderate02,
13
+ ease: EASINGS.productive.standard
14
+ }
15
+ },
16
+ hidden: {
17
+ opacity: 0
18
+ },
19
+ exit: {
20
+ opacity: 0
21
+ }
22
+ };
23
+ export var panelVariants = {
24
+ visible: {
25
+ x: 0,
26
+ transition: {
27
+ duration: DURATIONS.moderate02,
28
+ ease: EASINGS.productive.standard
29
+ }
30
+ },
31
+ hidden: function hidden(placement) {
32
+ return {
33
+ x: placement === 'right' ? '100%' : -320
34
+ };
35
+ },
36
+ exit: function exit(placement) {
37
+ return {
38
+ x: placement === 'right' ? '100%' : -320,
39
+ transition: {
40
+ duration: DURATIONS.moderate01,
41
+ ease: EASINGS.productive.exit
42
+ }
43
+ };
44
+ }
45
+ };
@@ -12,7 +12,7 @@ var _excluded = ["kind", "theme", "size", "className", "iconDescription"];
12
12
  import React, { forwardRef } from 'react';
13
13
  import PropTypes from 'prop-types';
14
14
  import cx from 'classnames';
15
- import { Misuse, ErrorFilled, WarningAltInvertedFilled, WarningAltFilled, UndefinedFilled, UnknownFilled, CheckmarkFilled, InformationSquareFilled, Renew, Time } from '@carbon/icons-react';
15
+ import { Misuse, ErrorFilled, WarningAltInvertedFilled, WarningAltFilled, UndefinedFilled, UnknownFilled, CheckmarkFilled, InformationSquareFilled, Renew, Time } from '@carbon/react/icons';
16
16
  import { getDevtoolsProps } from '../../global/js/utils/devtools';
17
17
  import { pkg } from '../../settings';
18
18
  var blockClass = "".concat(pkg.prefix, "--status-icon");
@@ -17,7 +17,7 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools';
17
17
  import '../../global/js/utils/props-helper';
18
18
  import { pkg } from '../../settings'; // Carbon and package components we use.
19
19
 
20
- import { User, Group } from '@carbon/icons-react';
20
+ import { User, Group } from '@carbon/react/icons';
21
21
  import { IconButton } from '@carbon/react'; // The block part of our conventional BEM class names (blockClass__E--M).
22
22
 
23
23
  var blockClass = "".concat(pkg.prefix, "--user-profile-image");
@@ -21,7 +21,7 @@ import PropTypes from 'prop-types';
21
21
  import cx from 'classnames';
22
22
  import { pkg } from '../../settings'; // Carbon and package components we use.
23
23
 
24
- import { Close, Help } from '@carbon/icons-react';
24
+ import { Close, Help } from '@carbon/react/icons';
25
25
  import { Button, OverflowMenu, OverflowMenuItem } from '@carbon/react';
26
26
  import { moderate02 } from '@carbon/motion';
27
27
  import { useWebTerminal } from './hooks';
@@ -6,7 +6,7 @@
6
6
  //
7
7
  import React from 'react';
8
8
  import { Header, HeaderName, HeaderGlobalAction, HeaderGlobalBar } from '@carbon/react';
9
- import { Terminal, Search, User } from '@carbon/icons-react';
9
+ import { Terminal, Search, User } from '@carbon/react/icons';
10
10
  import { useWebTerminal } from '../hooks';
11
11
 
12
12
  var Navigation = function Navigation() {
@@ -37,7 +37,8 @@ export { EditSidePanel } from './EditSidePanel';
37
37
  export { OptionsTile } from './OptionsTile';
38
38
  export { InlineEdit } from './InlineEdit';
39
39
  export { DataSpreadsheet } from './DataSpreadsheet';
40
- export { Datagrid, useDatagrid, useInfiniteScroll, useNestedRows, useSelectRows, useExpandedRow, useOnRowClick, useSortableColumns, useRowIsMouseOver, useColumnRightAlign, useDisableSelectRows, useStickyColumn, useActionsColumn, useCustomizeColumns, useSelectAllWithToggle } from './Datagrid';
40
+ export { Datagrid, useDatagrid, useInfiniteScroll, useNestedRows, useSelectRows, useExpandedRow, useOnRowClick, useSortableColumns, useRowIsMouseOver, useColumnRightAlign, useDisableSelectRows, useStickyColumn, useActionsColumn, useCustomizeColumns, useSelectAllWithToggle, useColumnOrder, useInlineEdit } from './Datagrid';
41
41
  export { EditTearsheet } from './EditTearsheet';
42
42
  export { EditTearsheetNarrow } from './EditTearsheetNarrow';
43
- export { EditFullPage } from './EditFullPage';
43
+ export { EditFullPage } from './EditFullPage';
44
+ export { EditUpdateCards } from './EditUpdateCards';
@@ -8,7 +8,7 @@ import { useEffect } from 'react';
8
8
  export var useClickOutside = function useClickOutside(ref, callback) {
9
9
  var handleClick = function handleClick(event) {
10
10
  if (ref.current && !ref.current.contains(event.target)) {
11
- callback();
11
+ callback(event.target);
12
12
  }
13
13
  };
14
14
 
@@ -53,6 +53,9 @@ var defaults = {
53
53
  TearsheetNarrow: true,
54
54
  UnauthorizedEmptyState: true,
55
55
  UserProfileImage: true,
56
+ WebTerminal: true,
57
+ WebTerminalContentWrapper: true,
58
+ WebTerminalProvider: true,
56
59
  // other public components not yet reviewed and released:
57
60
  MultiAddSelect: false,
58
61
  SingleAddSelect: false,
@@ -60,16 +63,14 @@ var defaults = {
60
63
  Toolbar: false,
61
64
  ToolbarButton: false,
62
65
  ToolbarGroup: false,
63
- WebTerminal: false,
64
- WebTerminalContentWrapper: false,
65
- WebTerminalProvider: false,
66
66
  EditSidePanel: false,
67
67
  CancelableTextEdit: false,
68
68
  DataSpreadsheet: false,
69
69
  Datagrid: false,
70
70
  EditTearsheet: false,
71
71
  EditTearsheetNarrow: false,
72
- EditFullPage: false
72
+ EditFullPage: false,
73
+ EditUpdateCards: false
73
74
  /* new component flags here - comment used by generate CLI */
74
75
 
75
76
  },
@@ -0,0 +1,20 @@
1
+ import { motion } from '@carbon/motion';
2
+ /**
3
+ * This function turns a cubic-bezier() string to an
4
+ * array of values that we can use with framer-motion
5
+ * @param {string} type - The carbon motion type, either 'standard', 'entrance', or 'exit'
6
+ * @param {string} mode - The carbon motion mode, either 'productive', or 'expressive'
7
+ */
8
+
9
+ export var getBezierValues = function getBezierValues(type, mode) {
10
+ var cubicBezier = motion(type, mode);
11
+ var extractStringFromParens = /\(([^)]+)\)/;
12
+ var desiredBezierStrings = extractStringFromParens.exec(cubicBezier)[1];
13
+ var formattedDesiredBezierStrings = desiredBezierStrings.trim().split(',').map(Number);
14
+
15
+ if (Array.isArray(formattedDesiredBezierStrings)) {
16
+ return formattedDesiredBezierStrings;
17
+ }
18
+
19
+ return [];
20
+ };
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Copyright IBM Corp. 2022, 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 { getBezierValues } from './getBezierValues';
8
+ import { fast01, fast02, moderate01, moderate02, slow01, slow02 } from '@carbon/motion';
9
+
10
+ var cleanMotionValue = function cleanMotionValue(val) {
11
+ return parseInt(val) / 1000;
12
+ };
13
+
14
+ export var DURATIONS = {
15
+ // Micro-interactions such as button and toggle
16
+ fast01: cleanMotionValue(fast01),
17
+ // '70ms'
18
+ // Micro-interactions such as fade
19
+ fast02: cleanMotionValue(fast02),
20
+ // '110ms'
21
+ // Micro-interactions, small expansion, short distance movements
22
+ moderate01: cleanMotionValue(moderate01),
23
+ // '150ms'
24
+ // Expansion, system communication, toast
25
+ moderate02: cleanMotionValue(moderate02),
26
+ // '240ms'
27
+ // Large expansion, important system notifications
28
+ slow01: cleanMotionValue(slow01),
29
+ // '400ms'
30
+ // Background dimming
31
+ slow02: cleanMotionValue(slow02) // '700ms'
32
+
33
+ };
34
+ export var EASINGS = {
35
+ productive: {
36
+ entrance: getBezierValues('entrance', 'productive'),
37
+ standard: getBezierValues('standard', 'productive'),
38
+ exit: getBezierValues('exit', 'productive')
39
+ },
40
+ expressive: {
41
+ entrance: getBezierValues('entrance', 'expressive'),
42
+ standard: getBezierValues('standard', 'expressive'),
43
+ exit: getBezierValues('exit', 'expressive')
44
+ }
45
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright IBM Corp. 2022, 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
+ // Iterates through a numeric range and calls callback
8
+ // function for each iteration
9
+ export var rangeWithCallback = function rangeWithCallback(start, end, fn) {
10
+ for (var i = start; i <= end; i++) {
11
+ fn(i);
12
+ }
13
+ };
@@ -29,7 +29,11 @@ export var getStoryTitle = function getStoryTitle(componentName) {
29
29
  * @returns The story id.
30
30
  */
31
31
 
32
- export var getStoryId = function getStoryId(componentName, scenario) {
32
+ export var getStoryId = function getStoryId(componentName, scenario, subdirectory) {
33
+ if (subdirectory) {
34
+ return "".concat(sanitize(getStoryTitle(componentName)), "-").concat(sanitize(subdirectory), "--").concat(scenario);
35
+ }
36
+
33
37
  return "".concat(sanitize(getStoryTitle(componentName)), "--").concat(scenario);
34
38
  };
35
39
  /**