@carbon/ibm-products 2.0.0-rc.1 → 2.0.0-rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (241) hide show
  1. package/css/index-full-carbon.css +952 -143
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +4 -2
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +783 -19
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +4 -2
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +678 -77
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +4 -2
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +757 -92
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +4 -2
  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 +20 -3
  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/DataSpreadsheet/DataSpreadsheet.js +63 -11
  32. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
  33. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
  34. package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
  35. package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +31 -0
  36. package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
  37. package/es/components/Datagrid/Datagrid/Datagrid.js +10 -38
  38. package/es/components/Datagrid/Datagrid/DatagridContent.js +149 -0
  39. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
  40. package/es/components/Datagrid/Datagrid/DatagridRow.js +10 -2
  41. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -3
  42. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +13 -4
  43. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +5 -4
  44. package/es/components/Datagrid/Datagrid/DraggableElement.js +6 -2
  45. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +5 -45
  46. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +1 -1
  47. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +35 -10
  48. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +61 -24
  49. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
  50. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +60 -0
  51. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +1 -0
  52. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +534 -0
  53. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +1 -0
  54. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +112 -0
  55. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +27 -0
  56. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +1 -0
  57. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +39 -0
  58. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +19 -0
  59. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +263 -0
  60. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +87 -0
  61. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -14
  62. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -36
  63. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
  64. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
  65. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
  66. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
  67. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
  68. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
  69. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
  70. package/es/components/Datagrid/index.js +3 -1
  71. package/es/components/Datagrid/useActionsColumn.js +28 -12
  72. package/es/components/Datagrid/useColumnOrder.js +8 -0
  73. package/es/components/Datagrid/useCustomizeColumns.js +5 -0
  74. package/es/components/Datagrid/useDefaultStringRenderer.js +4 -1
  75. package/es/components/Datagrid/useDisableSelectRows.js +6 -2
  76. package/es/components/Datagrid/useExpandedRow.js +0 -1
  77. package/es/components/Datagrid/useInlineEdit.js +71 -0
  78. package/es/components/Datagrid/useNestedRowExpander.js +42 -0
  79. package/es/components/Datagrid/useNestedRows.js +2 -2
  80. package/es/components/Datagrid/useRowExpander.js +1 -1
  81. package/es/components/Datagrid/useRowSize.js +17 -6
  82. package/es/components/Datagrid/useSelectAllToggle.js +17 -4
  83. package/es/components/Datagrid/useSelectRows.js +12 -2
  84. package/es/components/Datagrid/useSortableColumns.js +1 -1
  85. package/es/components/Datagrid/useStickyColumn.js +11 -0
  86. package/es/components/Datagrid/utils/DatagridActions.js +152 -0
  87. package/es/components/Datagrid/utils/DatagridPagination.js +33 -0
  88. package/es/components/Datagrid/utils/Wrapper.js +21 -0
  89. package/es/components/Datagrid/utils/getArgTypes.js +85 -0
  90. package/es/components/Datagrid/utils/getInlineEditColumns.js +153 -0
  91. package/es/components/Datagrid/utils/makeData.js +47 -2
  92. package/es/components/ExportModal/ExportModal.js +1 -1
  93. package/es/components/ImportModal/ImportModal.js +3 -3
  94. package/es/components/InlineEdit/InlineEdit.js +11 -9
  95. package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +1 -1
  96. package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +1 -1
  97. package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
  98. package/es/components/OptionsTile/OptionsTile.js +1 -1
  99. package/es/components/PageHeader/PageHeader.js +1 -1
  100. package/es/components/ProductiveCard/ProductiveCard.js +5 -0
  101. package/es/components/Saving/Saving.js +1 -1
  102. package/es/components/SidePanel/SidePanel.js +1 -1
  103. package/es/components/StatusIcon/StatusIcon.js +1 -1
  104. package/es/components/UserProfileImage/UserProfileImage.js +1 -1
  105. package/es/components/WebTerminal/WebTerminal.js +2 -2
  106. package/es/components/WebTerminal/WebTerminalContentWrapper.js +1 -1
  107. package/es/components/WebTerminal/hooks/index.js +6 -0
  108. package/es/components/WebTerminal/index.js +6 -0
  109. package/es/components/WebTerminal/preview-components/Navigation.js +7 -1
  110. package/es/components/WebTerminal/preview-components/documentationLinks.js +6 -0
  111. package/es/components/WebTerminal/preview-components/index.js +7 -0
  112. package/es/components/index.js +1 -1
  113. package/es/global/js/hooks/useClickOutside.js +1 -1
  114. package/es/global/js/package-settings.js +3 -3
  115. package/es/global/js/utils/rangeWithCallback.js +13 -0
  116. package/es/global/js/utils/story-helper.js +5 -1
  117. package/es/global/js/utils/uuidv4.spec.js +4 -0
  118. package/lib/components/APIKeyModal/APIKeyModal.js +4 -4
  119. package/lib/components/AddSelect/AddSelect.js +0 -4
  120. package/lib/components/AddSelect/AddSelectBody.js +20 -3
  121. package/lib/components/AddSelect/AddSelectBreadcrumbs.js +14 -3
  122. package/lib/components/AddSelect/AddSelectColumn.js +5 -5
  123. package/lib/components/AddSelect/AddSelectFilter.js +5 -4
  124. package/lib/components/AddSelect/AddSelectList.js +62 -28
  125. package/lib/components/AddSelect/AddSelectMetaPanel.js +2 -2
  126. package/lib/components/AddSelect/AddSelectSort.js +4 -4
  127. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +6 -6
  128. package/lib/components/Card/Card.js +16 -6
  129. package/lib/components/Card/CardFooter.js +3 -1
  130. package/lib/components/Card/CardHeader.js +21 -1
  131. package/lib/components/ComboButton/ComboButton.js +3 -3
  132. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +63 -10
  133. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
  134. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
  135. package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
  136. package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +42 -0
  137. package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
  138. package/lib/components/Datagrid/Datagrid/Datagrid.js +12 -45
  139. package/lib/components/Datagrid/Datagrid/DatagridContent.js +183 -0
  140. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
  141. package/lib/components/Datagrid/Datagrid/DatagridRow.js +19 -2
  142. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +12 -3
  143. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +16 -5
  144. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +6 -5
  145. package/lib/components/Datagrid/Datagrid/DraggableElement.js +7 -3
  146. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +12 -47
  147. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +2 -2
  148. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +47 -25
  149. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +59 -23
  150. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
  151. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +76 -0
  152. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +13 -0
  153. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +558 -0
  154. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +13 -0
  155. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +129 -0
  156. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +36 -0
  157. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +19 -0
  158. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +45 -0
  159. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +28 -0
  160. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +272 -0
  161. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +100 -0
  162. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -13
  163. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -35
  164. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
  165. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
  166. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
  167. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
  168. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
  169. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
  170. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
  171. package/lib/components/Datagrid/index.js +17 -1
  172. package/lib/components/Datagrid/useActionsColumn.js +28 -13
  173. package/lib/components/Datagrid/useColumnOrder.js +17 -0
  174. package/lib/components/Datagrid/useCustomizeColumns.js +5 -0
  175. package/lib/components/Datagrid/useDefaultStringRenderer.js +5 -1
  176. package/lib/components/Datagrid/useDisableSelectRows.js +6 -2
  177. package/lib/components/Datagrid/useExpandedRow.js +0 -1
  178. package/lib/components/Datagrid/useInlineEdit.js +85 -0
  179. package/lib/components/Datagrid/useNestedRowExpander.js +57 -0
  180. package/lib/components/Datagrid/useNestedRows.js +3 -3
  181. package/lib/components/Datagrid/useRowExpander.js +3 -3
  182. package/lib/components/Datagrid/useRowSize.js +18 -13
  183. package/lib/components/Datagrid/useSelectAllToggle.js +18 -4
  184. package/lib/components/Datagrid/useSelectRows.js +12 -2
  185. package/lib/components/Datagrid/useSortableColumns.js +5 -5
  186. package/lib/components/Datagrid/useStickyColumn.js +11 -0
  187. package/lib/components/Datagrid/utils/DatagridActions.js +170 -0
  188. package/lib/components/Datagrid/utils/DatagridPagination.js +46 -0
  189. package/lib/components/Datagrid/utils/Wrapper.js +33 -0
  190. package/lib/components/Datagrid/utils/getArgTypes.js +93 -0
  191. package/lib/components/Datagrid/utils/getInlineEditColumns.js +168 -0
  192. package/lib/components/Datagrid/utils/makeData.js +48 -2
  193. package/lib/components/ExportModal/ExportModal.js +3 -3
  194. package/lib/components/ImportModal/ImportModal.js +4 -4
  195. package/lib/components/InlineEdit/InlineEdit.js +16 -14
  196. package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +2 -2
  197. package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +3 -3
  198. package/lib/components/NotificationsPanel/NotificationsPanel.js +8 -8
  199. package/lib/components/OptionsTile/OptionsTile.js +6 -6
  200. package/lib/components/PageHeader/PageHeader.js +2 -2
  201. package/lib/components/ProductiveCard/ProductiveCard.js +5 -0
  202. package/lib/components/Saving/Saving.js +5 -5
  203. package/lib/components/SidePanel/SidePanel.js +3 -3
  204. package/lib/components/StatusIcon/StatusIcon.js +45 -45
  205. package/lib/components/UserProfileImage/UserProfileImage.js +7 -7
  206. package/lib/components/WebTerminal/WebTerminal.js +3 -3
  207. package/lib/components/WebTerminal/hooks/index.js +6 -0
  208. package/lib/components/WebTerminal/preview-components/Navigation.js +10 -4
  209. package/lib/components/WebTerminal/preview-components/documentationLinks.js +6 -0
  210. package/lib/components/index.js +12 -0
  211. package/lib/global/js/hooks/useClickOutside.js +1 -1
  212. package/lib/global/js/package-settings.js +3 -3
  213. package/lib/global/js/utils/rangeWithCallback.js +22 -0
  214. package/lib/global/js/utils/story-helper.js +5 -1
  215. package/lib/global/js/utils/uuidv4.spec.js +4 -0
  216. package/package.json +15 -15
  217. package/scss/components/AddSelect/_add-select.scss +127 -28
  218. package/scss/components/Card/_card.scss +1 -0
  219. package/scss/components/Cascade/_cascade.scss +1 -1
  220. package/scss/components/CreateTearsheet/_create-tearsheet.scss +2 -0
  221. package/scss/components/Datagrid/_datagrid.scss +7 -0
  222. package/scss/components/Datagrid/_storybook-styles.scss +8 -5
  223. package/scss/components/Datagrid/styles/_datagrid.scss +38 -14
  224. package/scss/components/Datagrid/styles/_draggableElement.scss +26 -9
  225. package/scss/components/Datagrid/styles/_index.scss +1 -0
  226. package/scss/components/Datagrid/styles/_useActionsColumn.scss +14 -0
  227. package/scss/components/Datagrid/styles/_useExpandedRow.scss +37 -9
  228. package/scss/components/Datagrid/styles/_useInlineEdit.scss +404 -0
  229. package/scss/components/Datagrid/styles/_useNestedRows.scss +16 -1
  230. package/scss/components/Datagrid/styles/_useStickyColumn.scss +31 -2
  231. package/scss/components/Datagrid/styles/addons/_CustomizeColumnsModal.scss +45 -6
  232. package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +9 -1
  233. package/scss/components/InlineEdit/_inline-edit.scss +4 -2
  234. package/scss/components/NotificationsPanel/_notifications-panel.scss +3 -6
  235. package/scss/components/RemoveModal/_remove-modal.scss +0 -4
  236. package/scss/components/SidePanel/_side-panel.scss +3 -6
  237. package/scss/components/Tearsheet/_tearsheet.scss +2 -2
  238. package/scss/components/WebTerminal/_carbon-imports.scss +6 -0
  239. package/scss/components/WebTerminal/_index.scss +7 -0
  240. package/scss/components/WebTerminal/_storybook-styles.scss +7 -0
  241. package/scss/components/_index-released-only.scss +1 -0
@@ -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
@@ -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';
@@ -30,7 +30,7 @@ import { SIDE_PANEL_SIZES } from './constants';
30
30
  import { usePreviousValue } from '../../global/js/hooks'; // Carbon and package components we use.
31
31
 
32
32
  import { Button } from '@carbon/react';
33
- import { Close, ArrowLeft } from '@carbon/icons-react';
33
+ import { Close, ArrowLeft } from '@carbon/react/icons';
34
34
  import { ActionSet } from '../ActionSet';
35
35
  var blockClass = "".concat(pkg.prefix, "--side-panel");
36
36
  var componentName = 'SidePanel'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
@@ -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");
@@ -9,7 +9,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
9
9
  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) { _defineProperty(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; }
10
10
 
11
11
  /**
12
- * Copyright IBM Corp. 2020, 2021
12
+ * Copyright IBM Corp. 2020, 2022
13
13
  *
14
14
  * This source code is licensed under the Apache-2.0 license found in the
15
15
  * LICENSE file in the root directory of this source tree.
@@ -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';
@@ -4,7 +4,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
4
4
  var _excluded = ["children"];
5
5
 
6
6
  /**
7
- * Copyright IBM Corp. 2020, 2021
7
+ * Copyright IBM Corp. 2022, 2022
8
8
  *
9
9
  * This source code is licensed under the Apache-2.0 license found in the
10
10
  * LICENSE file in the root directory of this source tree.
@@ -1,4 +1,10 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ //
3
+ // Copyright IBM Corp. 2022, 2022
4
+ //
5
+ // This source code is licensed under the Apache-2.0 license found in the
6
+ // LICENSE file in the root directory of this source tree.
7
+ //
2
8
  import React, { useState, useCallback, createContext } from 'react';
3
9
  import { useContext } from 'react';
4
10
  import PropTypes from 'prop-types';
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 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
+ */
1
7
  export { WebTerminal } from './WebTerminal';
2
8
  export { WebTerminalContentWrapper } from './WebTerminalContentWrapper';
3
9
  export { useWebTerminal, WebTerminalProvider } from './hooks';
@@ -1,6 +1,12 @@
1
+ //
2
+ // Copyright IBM Corp. 2020, 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
+ //
1
7
  import React from 'react';
2
8
  import { Header, HeaderName, HeaderGlobalAction, HeaderGlobalBar } from '@carbon/react';
3
- import { Terminal, Search, User } from '@carbon/icons-react';
9
+ import { Terminal, Search, User } from '@carbon/react/icons';
4
10
  import { useWebTerminal } from '../hooks';
5
11
 
6
12
  var Navigation = function Navigation() {
@@ -1,3 +1,9 @@
1
+ //
2
+ // Copyright IBM Corp. 2020, 2021
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
+ //
1
7
  export var documentationLinks = [{
2
8
  itemText: 'BX/ICP docs',
3
9
  href: '#',
@@ -1,3 +1,10 @@
1
+ //
2
+ // Copyright IBM Corp. 2020, 2021
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
+
1
8
  /**
2
9
  * Preview components are components only to be used
3
10
  * in the context of storybook.
@@ -37,7 +37,7 @@ 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
43
  export { EditFullPage } from './EditFullPage';
@@ -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,9 +63,6 @@ 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,
@@ -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
  /**
@@ -4,11 +4,15 @@ describe('uuidv4', function () {
4
4
  jest.resetAllMocks();
5
5
  });
6
6
  it('Uses Math.random when window is not defined', function () {
7
+ var _window = window,
8
+ crypto = _window.crypto;
9
+ delete window.crypto;
7
10
  var mockMath = Object.create(global.Math);
8
11
  var mockMathRandom = jest.fn().mockReturnValue(0.5);
9
12
  mockMath.random = mockMathRandom;
10
13
  global.Math = mockMath;
11
14
  expect(uuidv4()).toEqual('98888888-9888-4888-a888-988888888888');
15
+ window.crypto = crypto;
12
16
  });
13
17
  it('Uses crypto from window when window is defined', function () {
14
18
  var mGetRandomValues = jest.fn().mockReturnValue(new Uint32Array(10));
@@ -29,7 +29,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
29
29
 
30
30
  var _react2 = require("@carbon/react");
31
31
 
32
- var _iconsReact = require("@carbon/icons-react");
32
+ var _icons = require("@carbon/react/icons");
33
33
 
34
34
  var _APIKeyDownloader = require("./APIKeyDownloader");
35
35
 
@@ -128,7 +128,7 @@ var APIKeyModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
128
128
  var hasPreviousStep = hasSteps && currentStep !== 0;
129
129
  var copyButtonProps = {
130
130
  renderIcon: function renderIcon(props) {
131
- return /*#__PURE__*/_react.default.createElement(_iconsReact.Copy, (0, _extends2.default)({
131
+ return /*#__PURE__*/_react.default.createElement(_icons.Copy, (0, _extends2.default)({
132
132
  size: 16
133
133
  }, props));
134
134
  },
@@ -334,13 +334,13 @@ var APIKeyModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
334
334
  className: "".concat(blockClass, "__messaging")
335
335
  }, /*#__PURE__*/_react.default.createElement("div", {
336
336
  className: "".concat(blockClass, "__error-icon")
337
- }, /*#__PURE__*/_react.default.createElement(_iconsReact.ErrorFilled, {
337
+ }, /*#__PURE__*/_react.default.createElement(_icons.ErrorFilled, {
338
338
  size: 16
339
339
  })), /*#__PURE__*/_react.default.createElement("p", {
340
340
  className: "".concat(blockClass, "__messaging-text")
341
341
  }, copyError ? copyErrorText : errorText)), apiKeyLoaded && /*#__PURE__*/_react.default.createElement("div", {
342
342
  className: "".concat(blockClass, "__messaging")
343
- }, /*#__PURE__*/_react.default.createElement(_iconsReact.InformationFilled, {
343
+ }, /*#__PURE__*/_react.default.createElement(_icons.InformationFilled, {
344
344
  size: 16
345
345
  }), hasDownloadLink ? /*#__PURE__*/_react.default.createElement(_APIKeyDownloader.APIKeyDownloader, {
346
346
  apiKey: apiKey,
@@ -21,8 +21,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
21
21
 
22
22
  var _AddSelectBody = require("./AddSelectBody");
23
23
 
24
- var _settings = require("../../settings");
25
-
26
24
  var _addSelectUtils = require("./add-select-utils");
27
25
 
28
26
  var _excluded = ["items", "globalFilters"];
@@ -31,7 +29,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
31
29
 
32
30
  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; }
33
31
 
34
- var blockClass = "".concat(_settings.pkg.prefix, "--add-select");
35
32
  var componentName = 'AddSelect';
36
33
  var AddSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
37
34
  var items = _ref.items,
@@ -49,7 +46,6 @@ var AddSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
49
46
  }, modifierAttribute, item[modifierAttribute]);
50
47
  }) : [];
51
48
  return /*#__PURE__*/_react.default.createElement(_AddSelectBody.AddSelectBody, (0, _extends2.default)({}, props, {
52
- className: blockClass,
53
49
  ref: ref,
54
50
  items: items,
55
51
  normalizedItems: normalizedItems,
@@ -148,6 +148,19 @@ var AddSelectBody = function AddSelectBody(_ref) {
148
148
  setPath = _usePath.setPath,
149
149
  pathOnclick = _usePath.pathOnclick;
150
150
 
151
+ var resetState = function resetState() {
152
+ setSingleSelection('');
153
+ setMultiSelection([]);
154
+ setSearchTerm('');
155
+ setAppliedGlobalFilters({});
156
+ setDisplayMetaPanel({});
157
+ };
158
+
159
+ var onCloseHandler = function onCloseHandler() {
160
+ resetState();
161
+ onClose();
162
+ };
163
+
151
164
  var classNames = (0, _classnames.default)(className, blockClass, (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__single"), !multi), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__multi"), multi), _cx));
152
165
  var globalFilterKeys = Object.keys(appliedGlobalFilters);
153
166
  var globalFiltersApplied = globalFilterKeys.length > 0; // handlers
@@ -173,6 +186,8 @@ var AddSelectBody = function AddSelectBody(_ref) {
173
186
  } else {
174
187
  onSubmit(singleSelection);
175
188
  }
189
+
190
+ onCloseHandler();
176
191
  };
177
192
 
178
193
  var setShowBreadsCrumbs = function setShowBreadsCrumbs() {
@@ -207,6 +222,7 @@ var AddSelectBody = function AddSelectBody(_ref) {
207
222
  var showSort = (searchTerm || globalFiltersApplied) && hasResults;
208
223
  var showTags = setShowTags();
209
224
  var commonListProps = {
225
+ displayMetalPanel: displayMetalPanel,
210
226
  metaIconDescription: metaIconDescription,
211
227
  multi: multi,
212
228
  multiSelection: multiSelection,
@@ -228,7 +244,7 @@ var AddSelectBody = function AddSelectBody(_ref) {
228
244
  actions: [{
229
245
  label: onCloseButtonText,
230
246
  kind: 'secondary',
231
- onClick: onClose
247
+ onClick: onCloseHandler
232
248
  }, {
233
249
  label: onSubmitButtonText,
234
250
  kind: 'primary',
@@ -270,12 +286,13 @@ var AddSelectBody = function AddSelectBody(_ref) {
270
286
  hasFiltersApplied: globalFiltersApplied,
271
287
  clearFiltersText: clearFiltersText
272
288
  }), /*#__PURE__*/_react.default.createElement("div", {
273
- className: "".concat(blockClass, "__sub-header")
289
+ className: (0, _classnames.default)("".concat(blockClass, "__sub-header"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__sub-header-multi"), multi))
274
290
  }, /*#__PURE__*/_react.default.createElement("div", {
275
291
  className: "".concat(blockClass, "__tag-container")
276
292
  }, showBreadsCrumbs ? /*#__PURE__*/_react.default.createElement(_AddSelectBreadcrumbs.AddSelectBreadcrumbs, {
277
293
  path: path,
278
- onClick: pathOnclick
294
+ onClick: pathOnclick,
295
+ multi: multi
279
296
  }) : /*#__PURE__*/_react.default.createElement("p", {
280
297
  className: "".concat(blockClass, "__tag-container-label")
281
298
  }, searchTerm ? searchResultsLabel : itemsLabel), showTags && /*#__PURE__*/_react.default.createElement(_react2.Tag, {
@@ -7,30 +7,40 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.AddSelectBreadcrumbs = void 0;
9
9
 
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
10
12
  var _react = _interopRequireDefault(require("react"));
11
13
 
12
14
  var _react2 = require("@carbon/react");
13
15
 
14
16
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
17
 
18
+ var _classnames = _interopRequireDefault(require("classnames"));
19
+
20
+ var _settings = require("../../settings");
21
+
16
22
  //
17
23
  // Copyright IBM Corp. 2022
18
24
  //
19
25
  // This source code is licensed under the Apache-2.0 license found in the
20
26
  // LICENSE file in the root directory of this source tree.
21
27
  //
28
+ var blockClass = "".concat(_settings.pkg.prefix, "--add-select__breadcrumbs");
22
29
  var componentName = 'AddSelectBreadcrumbs';
23
30
 
24
31
  var AddSelectBreadcrumbs = function AddSelectBreadcrumbs(_ref) {
25
- var path = _ref.path,
26
- onClick = _ref.onClick;
32
+ var multi = _ref.multi,
33
+ onClick = _ref.onClick,
34
+ path = _ref.path;
27
35
 
28
36
  var clickHandler = function clickHandler(idx) {
29
37
  onClick(idx);
30
38
  };
31
39
 
40
+ var classNames = (0, _classnames.default)(blockClass, (0, _defineProperty2.default)({}, "".concat(blockClass, "-multi"), multi));
32
41
  return /*#__PURE__*/_react.default.createElement(_react2.Breadcrumb, {
33
- noTrailingSlash: true
42
+ noTrailingSlash: true,
43
+ className: classNames
34
44
  }, path.map(function (entry, idx) {
35
45
  var isCurrentPage = idx === path.length - 1;
36
46
  return /*#__PURE__*/_react.default.createElement(_react2.BreadcrumbItem, {
@@ -45,6 +55,7 @@ var AddSelectBreadcrumbs = function AddSelectBreadcrumbs(_ref) {
45
55
 
46
56
  exports.AddSelectBreadcrumbs = AddSelectBreadcrumbs;
47
57
  AddSelectBreadcrumbs.propTypes = {
58
+ multi: _propTypes.default.bool,
48
59
  onClick: _propTypes.default.func,
49
60
  path: _propTypes.default.array
50
61
  };
@@ -23,7 +23,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
23
23
 
24
24
  var _react2 = require("@carbon/react");
25
25
 
26
- var _iconsReact = require("@carbon/icons-react");
26
+ var _icons = require("@carbon/react/icons");
27
27
 
28
28
  var _settings = require("../../settings");
29
29
 
@@ -189,16 +189,16 @@ var AddSelectColumn = function AddSelectColumn(_ref) {
189
189
  className: colClass
190
190
  }, /*#__PURE__*/_react.default.createElement("div", {
191
191
  className: "".concat(colClass, "-search-bar")
192
- }, /*#__PURE__*/_react.default.createElement(_react2.TextInput, {
192
+ }, /*#__PURE__*/_react.default.createElement(_react2.Search, {
193
193
  value: searchTerm,
194
194
  onChange: function onChange(e) {
195
195
  return setSearchTerm(e.target.value);
196
196
  },
197
- light: true,
198
197
  placeholder: columnInputPlaceholder,
199
198
  className: "".concat(colClass, "-input"),
200
199
  id: (0, _uuidv.default)(),
201
- labelText: columnInputPlaceholder
200
+ labelText: columnInputPlaceholder,
201
+ size: "md"
202
202
  }), /*#__PURE__*/_react.default.createElement("div", {
203
203
  className: "".concat(colClass, "-sort-filter")
204
204
  }, /*#__PURE__*/_react.default.createElement(_AddSelectSort.AddSelectSort, {
@@ -210,7 +210,7 @@ var AddSelectColumn = function AddSelectColumn(_ref) {
210
210
  sortBy: sortBy
211
211
  }), filterByOpts.length > 0 && /*#__PURE__*/_react.default.createElement(_react2.OverflowMenu, {
212
212
  renderIcon: function renderIcon(props) {
213
- return /*#__PURE__*/_react.default.createElement(_iconsReact.Filter, (0, _extends2.default)({
213
+ return /*#__PURE__*/_react.default.createElement(_icons.Filter, (0, _extends2.default)({
214
214
  size: 32
215
215
  }, props));
216
216
  },
@@ -23,7 +23,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
23
23
 
24
24
  var _propTypes = _interopRequireDefault(require("prop-types"));
25
25
 
26
- var _iconsReact = require("@carbon/icons-react");
26
+ var _icons = require("@carbon/react/icons");
27
27
 
28
28
  var _settings = require("../../settings");
29
29
 
@@ -112,7 +112,7 @@ var AddSelectFilter = function AddSelectFilter(_ref) {
112
112
  var dirtyInput = Object.keys(filters).length > 0;
113
113
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
114
114
  className: "".concat(blockClass, "-search")
115
- }, /*#__PURE__*/_react.default.createElement(_react2.TextInput, {
115
+ }, /*#__PURE__*/_react.default.createElement(_react2.Search, {
116
116
  id: "temp-id",
117
117
  labelText: inputLabel,
118
118
  placeholder: inputPlaceholder,
@@ -120,7 +120,7 @@ var AddSelectFilter = function AddSelectFilter(_ref) {
120
120
  onChange: searchHandler
121
121
  }), showFilter && /*#__PURE__*/_react.default.createElement(_react2.Button, {
122
122
  renderIcon: function renderIcon(props) {
123
- return /*#__PURE__*/_react.default.createElement(_iconsReact.Filter, (0, _extends2.default)({
123
+ return /*#__PURE__*/_react.default.createElement(_icons.Filter, (0, _extends2.default)({
124
124
  size: 16
125
125
  }, props));
126
126
  },
@@ -131,7 +131,8 @@ var AddSelectFilter = function AddSelectFilter(_ref) {
131
131
  },
132
132
  iconDescription: iconDescription,
133
133
  className: filterBtnClassnames,
134
- size: "md"
134
+ size: "lg",
135
+ tooltipPosition: "left"
135
136
  }), open && /*#__PURE__*/_react.default.createElement("div", {
136
137
  className: blockClass
137
138
  }, /*#__PURE__*/_react.default.createElement("div", {