@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
@@ -29,7 +29,7 @@ var _iconsReact = require("@carbon/icons-react");
29
29
 
30
30
  var _carbonComponentsReact = require("carbon-components-react");
31
31
 
32
- var _excluded = ["children", "className", "closeTerminal", "documentationLinks", "documentationLinksIconDescription", "open", "actions", "closeIconDescription"];
32
+ var _excluded = ["actions", "children", "className", "closeIconDescription", "closeTerminal", "documentationLinks", "documentationLinksIconDescription", "open"];
33
33
 
34
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); }
35
35
 
@@ -41,19 +41,28 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
41
41
 
42
42
  // The block part of our conventional BEM class names (blockClass__E--M).
43
43
  var componentName = 'WebTerminal';
44
- var blockClass = "".concat(_settings.pkg.prefix, "--web-terminal");
44
+ var blockClass = "".concat(_settings.pkg.prefix, "--web-terminal"); // Default values for props
45
+
46
+ var defaults = {
47
+ actions: Object.freeze([]),
48
+ documentationLinks: Object.freeze([]),
49
+ documentationLinksIconDescription: 'Show documentation links'
50
+ };
45
51
 
46
52
  var WebTerminal = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
47
53
  var _ref2;
48
54
 
49
- var children = _ref.children,
55
+ var _ref$actions = _ref.actions,
56
+ actions = _ref$actions === void 0 ? defaults.actions : _ref$actions,
57
+ children = _ref.children,
50
58
  className = _ref.className,
59
+ closeIconDescription = _ref.closeIconDescription,
51
60
  closeTerminal = _ref.closeTerminal,
52
- documentationLinks = _ref.documentationLinks,
53
- documentationLinksIconDescription = _ref.documentationLinksIconDescription,
61
+ _ref$documentationLin = _ref.documentationLinks,
62
+ documentationLinks = _ref$documentationLin === void 0 ? defaults.documentationLinks : _ref$documentationLin,
63
+ _ref$documentationLin2 = _ref.documentationLinksIconDescription,
64
+ documentationLinksIconDescription = _ref$documentationLin2 === void 0 ? defaults.documentationLinksIconDescription : _ref$documentationLin2,
54
65
  open = _ref.open,
55
- actions = _ref.actions,
56
- closeIconDescription = _ref.closeIconDescription,
57
66
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
58
67
 
59
68
  var _useState = (0, _react.useState)(open),
@@ -78,9 +87,9 @@ var WebTerminal = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
78
87
 
79
88
  return shouldRender ? /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
80
89
  ref: ref,
81
- className: (0, _classnames.default)([blockClass, (_ref2 = {}, (0, _defineProperty2.default)(_ref2, "".concat(blockClass, "--open"), open), (0, _defineProperty2.default)(_ref2, "".concat(blockClass, "--closed"), !open), (0, _defineProperty2.default)(_ref2, className, className), _ref2)]),
90
+ className: (0, _classnames.default)([className, blockClass, (_ref2 = {}, (0, _defineProperty2.default)(_ref2, "".concat(blockClass, "--open"), open), (0, _defineProperty2.default)(_ref2, "".concat(blockClass, "--closed"), !open), _ref2)]),
82
91
  style: {
83
- animation: "".concat(open ? 'webTerminalEntrance 250ms' : 'webTerminalExit 250ms')
92
+ animation: "".concat(open ? 'web-terminal-entrance 250ms' : 'web-terminal-exit 250ms')
84
93
  },
85
94
  onAnimationEnd: onAnimationEnd
86
95
  }), /*#__PURE__*/_react.default.createElement("header", {
@@ -173,14 +182,4 @@ WebTerminal.propTypes = {
173
182
  * Boolean that determines if the web terminal is opened or closed
174
183
  */
175
184
  open: _propTypes.default.bool.isRequired
176
- }; // Default values for component props. Default values are not required for
177
- // props that are required, nor for props where the component can apply
178
- // 'undefined' values reasonably. Default values should be provided when the
179
- // component needs to make a choice or assumption when a prop is not supplied.
180
-
181
- WebTerminal.defaultProps = {
182
- actions: [],
183
- documentationLinks: [],
184
- documentationLinksIconDescription: 'Show documentation links',
185
- className: ''
186
185
  };
@@ -15,12 +15,6 @@ Object.defineProperty(exports, "AboutModal", {
15
15
  return _AboutModal.AboutModal;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "CancelableTextEdit", {
19
- enumerable: true,
20
- get: function get() {
21
- return _CancelableTextEdit.CancelableTextEdit;
22
- }
23
- });
24
18
  Object.defineProperty(exports, "Cascade", {
25
19
  enumerable: true,
26
20
  get: function get() {
@@ -87,6 +81,12 @@ Object.defineProperty(exports, "CreateTearsheetStep", {
87
81
  return _CreateTearsheet.CreateTearsheetStep;
88
82
  }
89
83
  });
84
+ Object.defineProperty(exports, "DataSpreadsheet", {
85
+ enumerable: true,
86
+ get: function get() {
87
+ return _DataSpreadsheet.DataSpreadsheet;
88
+ }
89
+ });
90
90
  Object.defineProperty(exports, "EditSidePanel", {
91
91
  enumerable: true,
92
92
  get: function get() {
@@ -362,6 +362,6 @@ var _EditSidePanel = require("./EditSidePanel");
362
362
 
363
363
  var _OptionsTile = require("./OptionsTile");
364
364
 
365
- var _CancelableTextEdit = require("./CancelableTextEdit");
365
+ var _InlineEdit = require("./InlineEdit");
366
366
 
367
- var _InlineEdit = require("./InlineEdit");
367
+ var _DataSpreadsheet = require("./DataSpreadsheet");
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "useActiveElement", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _useActiveElement.useActiveElement;
10
+ }
11
+ });
6
12
  Object.defineProperty(exports, "useClickOutside", {
7
13
  enumerable: true,
8
14
  get: function get() {
@@ -64,6 +70,8 @@ Object.defineProperty(exports, "useWindowScroll", {
64
70
  }
65
71
  });
66
72
 
73
+ var _useActiveElement = require("./useActiveElement");
74
+
67
75
  var _useWindowScroll = require("./useWindowScroll");
68
76
 
69
77
  var _useWindowResize = require("./useWindowResize");
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useActiveElement = void 0;
9
+
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+
12
+ var _react = require("react");
13
+
14
+ /**
15
+ * Copyright IBM Corp. 2022, 2022
16
+ *
17
+ * This source code is licensed under the Apache-2.0 license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ */
20
+ var useActiveElement = function useActiveElement() {
21
+ var _useState = (0, _react.useState)(document.activeElement),
22
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
23
+ active = _useState2[0],
24
+ setActive = _useState2[1];
25
+
26
+ var handleFocusIn = function handleFocusIn() {
27
+ setActive(document.activeElement);
28
+ };
29
+
30
+ (0, _react.useEffect)(function () {
31
+ document.addEventListener('focusin', handleFocusIn);
32
+ return function () {
33
+ document.removeEventListener('focusin', handleFocusIn);
34
+ };
35
+ }, []);
36
+ return active;
37
+ };
38
+
39
+ exports.useActiveElement = useActiveElement;
@@ -67,7 +67,8 @@ var defaults = {
67
67
  EditSidePanel: false,
68
68
  OptionsTile: false,
69
69
  CancelableTextEdit: false,
70
- InlineEdit: false
70
+ InlineEdit: false,
71
+ DataSpreadsheet: false
71
72
  /* new component flags here - comment used by generate CLI */
72
73
 
73
74
  },
@@ -32,6 +32,11 @@ var isEmpty = function isEmpty(children) {
32
32
  });
33
33
 
34
34
  return result;
35
+ }; // Default values for props
36
+
37
+
38
+ var defaults = {
39
+ element: 'div'
35
40
  };
36
41
  /**
37
42
  * A simple conditional wrapper that encloses its children in a <div> (or other
@@ -44,11 +49,11 @@ var isEmpty = function isEmpty(children) {
44
49
  * remain undefined if it does not render.
45
50
  */
46
51
 
47
-
48
52
  var Wrap = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
49
53
  var alwaysRender = _ref.alwaysRender,
50
54
  children = _ref.children,
51
- Wrapper = _ref.element,
55
+ _ref$element = _ref.element,
56
+ Wrapper = _ref$element === void 0 ? defaults.element : _ref$element,
52
57
  neverRender = _ref.neverRender,
53
58
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
54
59
  return (neverRender || isEmpty(children)) && !alwaysRender ? null : /*#__PURE__*/_react.default.createElement(Wrapper, (0, _extends2.default)({}, rest, {
@@ -87,7 +92,4 @@ Wrap.propTypes = {
87
92
  * content will be rendered.
88
93
  */
89
94
  neverRender: _propTypes.default.bool
90
- };
91
- Wrap.defaultProps = {
92
- element: 'div'
93
95
  };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getScrollbarWidth = void 0;
7
+
8
+ /**
9
+ * Copyright IBM Corp. 2022, 2022
10
+ *
11
+ * This source code is licensed under the Apache-2.0 license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */
14
+ var getScrollbarWidth = function getScrollbarWidth() {
15
+ var scrollDiv = document.createElement('div');
16
+ scrollDiv.setAttribute('style', 'width: 100px; height: 100px; overflow: scroll; position:absolute; top:-9999px;');
17
+ document.body.appendChild(scrollDiv);
18
+ var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
19
+ document.body.removeChild(scrollDiv);
20
+ return scrollbarWidth;
21
+ };
22
+
23
+ exports.getScrollbarWidth = getScrollbarWidth;
package/lib/settings.js CHANGED
@@ -9,8 +9,6 @@ exports.pkg = exports.carbon = void 0;
9
9
 
10
10
  var _Canary = require("./components/_Canary");
11
11
 
12
- var _featureFlags = _interopRequireDefault(require("./generated/feature-flags/feature-flags"));
13
-
14
12
  var _packageSettings = _interopRequireDefault(require("./global/js/package-settings"));
15
13
 
16
14
  var _carbonComponents = require("carbon-components");
@@ -28,10 +26,6 @@ var carbon = {
28
26
  _carbonComponents.settings.prefix = val;
29
27
  },
30
28
 
31
- get flags() {
32
- return _featureFlags.default;
33
- },
34
-
35
29
  get themes() {
36
30
  return _themes.themes;
37
31
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products",
3
3
  "description": "Carbon for IBM Products",
4
- "version": "1.5.0",
4
+ "version": "1.8.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -33,58 +33,60 @@
33
33
  "access": "public"
34
34
  },
35
35
  "scripts": {
36
- "build": "run-s clean build-all",
36
+ "build": "run-s clean build-first build-all",
37
37
  "build-all": "run-p build:*",
38
- "build:css-dev": "sass --style=expanded --load-path node_modules --load-path ../../node_modules src:css",
39
- "build:css-min": "sass --style=compressed --no-source-map --load-path node_modules --load-path ../../node_modules src/index.scss:css/index.min.css src/index-full-carbon.scss:css/index-full-carbon.min.css src/index-without-carbon.scss:css/index-without-carbon.min.css src/index-without-carbon-released-only.scss:css/index-without-carbon-released-only.min.css",
38
+ "build-first": "copyfiles 'src/**/*.scss' scss -u 1",
39
+ "build:css-dev": "sass --style=expanded --load-path node_modules --load-path ../../node_modules scss:css",
40
+ "build:css-min": "sass --style=compressed --load-path node_modules --load-path ../../node_modules scss/index.scss:css/index.min.css scss/index-full-carbon.scss:css/index-full-carbon.min.css scss/index-without-carbon.scss:css/index-without-carbon.min.css scss/index-without-carbon-released-only.scss:css/index-without-carbon-released-only.min.css",
40
41
  "build:js-esm": "cross-env BABEL_ENV=esm yarn build:js:modules -d es",
41
42
  "build:js-cjs": "cross-env BABEL_ENV=cjs yarn build:js:modules -d lib",
42
43
  "build:js:modules": "babel src --ignore '**/__tests__','**/*.test.js','**/*.stories.js','src/utils/**/*'",
43
- "build:scss": "copyfiles 'src/**/*.scss' scss -u 1",
44
44
  "ci-check": "node scripts/import",
45
45
  "clean": "rimraf es lib css scss",
46
46
  "generate": "cross-env FORCE_COLOR=1 node scripts/generate",
47
47
  "postinstall": "carbon-telemetry collect --install",
48
48
  "test": "jest --colors",
49
- "//upgrade-dependencies": "# don't upgrade carbon (done globally), react/react-dom (explicit range peer dependency) or chalk (until we can load it as ESM)",
49
+ "//upgrade-dependencies": "# don't upgrade carbon (done globally), react/react-dom (explicit range peer dependency), chalk (issue #1596)",
50
50
  "upgrade-dependencies": "npm-check-updates -u --dep dev,peer,prod --color --reject '/(carbon|^react$|^react-dom$|^chalk$)/'"
51
51
  },
52
52
  "devDependencies": {
53
- "@babel/cli": "^7.16.8",
54
- "@babel/core": "^7.16.12",
55
- "babel-preset-ibm-cloud-cognitive": "^0.14.5",
53
+ "@babel/cli": "^7.17.3",
54
+ "@babel/core": "^7.17.5",
55
+ "babel-preset-ibm-cloud-cognitive": "^0.14.8",
56
56
  "chalk": "^4.1.2",
57
57
  "change-case": "^4.1.2",
58
58
  "copyfiles": "^2.4.1",
59
59
  "cross-env": "^7.0.3",
60
60
  "fs-extra": "^10.0.0",
61
61
  "glob": "^7.2.0",
62
- "jest": "^27.4.7",
63
- "jest-config-ibm-cloud-cognitive": "^0.23.6",
64
- "npm-check-updates": "^12.2.1",
62
+ "jest": "^27.5.1",
63
+ "jest-config-ibm-cloud-cognitive": "^0.23.9",
64
+ "npm-check-updates": "^12.3.1",
65
65
  "npm-run-all": "^4.1.5",
66
66
  "rimraf": "^3.0.2",
67
- "sass": "^1.49.0",
67
+ "sass": "^1.49.8",
68
68
  "yargs": "^17.3.1"
69
69
  },
70
70
  "dependencies": {
71
- "@babel/runtime": "^7.16.7",
71
+ "@babel/runtime": "^7.17.2",
72
72
  "@carbon/telemetry": "^0.0.0-alpha.6",
73
- "react-resize-detector": "^7.0.0"
73
+ "react-resize-detector": "^7.0.0",
74
+ "react-table": "^7.7.0",
75
+ "react-window": "^1.8.6"
74
76
  },
75
77
  "peerDependencies": {
76
- "@carbon/colors": "^10.35.0",
77
- "@carbon/icons-react": "^10.45.0",
78
+ "@carbon/colors": "^10.36.0",
79
+ "@carbon/icons-react": "^10.46.0",
78
80
  "@carbon/import-once": "^10.5.0",
79
- "@carbon/layout": "^10.35.0",
80
- "@carbon/motion": "^10.27.0",
81
- "@carbon/themes": "^10.49.0",
81
+ "@carbon/layout": "^10.36.0",
82
+ "@carbon/motion": "^10.28.0",
83
+ "@carbon/themes": "^10.50.0",
82
84
  "@carbon/type": "^10.40.0",
83
- "carbon-components": "^10.51.0",
84
- "carbon-components-react": "^7.51.0",
85
+ "carbon-components": "^10.53.0",
86
+ "carbon-components-react": "^7.53.0",
85
87
  "carbon-icons": "^7.0.7",
86
88
  "react": "^16.8.6 || ^17.0.1",
87
89
  "react-dom": "^16.8.6 || ^17.0.1"
88
90
  },
89
- "gitHead": "c87d8a538026632249a4f6e907b008efb1d50250"
91
+ "gitHead": "b2c8e5a32233fac65bb3eeb18df919efc0dcd3af"
90
92
  }
@@ -37,28 +37,58 @@
37
37
 
38
38
  .#{$block-class}__selections {
39
39
  border-top: 1px solid $ui-03;
40
+
41
+ &-wrapper {
42
+ display: block;
43
+ }
44
+
45
+ &-cell-wrapper {
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: space-between;
49
+ }
40
50
  }
41
51
 
42
- // multi select specific
52
+ // sidebar
43
53
 
44
- .#{$block-class}__influencer-header {
54
+ .#{$block-class}__sidebar-header {
45
55
  display: flex;
46
56
  padding: $spacing-06 $spacing-05 $spacing-03 $spacing-05;
47
57
  border-bottom: 1px solid $ui-03;
48
58
 
49
- .#{$block-class}__influencer-title {
59
+ .#{$block-class}__sidebar-title {
50
60
  @include carbon--type-style('productive-heading-02');
51
61
  }
52
62
  }
53
63
 
54
- .#{$block-class}__influencer-title {
64
+ .#{$block-class}__sidebar-title {
55
65
  margin-right: $spacing-03;
56
66
  }
57
67
 
58
- .#{$block-class}__influencer-body {
68
+ .#{$block-class}__sidebar-body {
59
69
  padding: $spacing-05;
60
70
  }
61
71
 
72
+ .#{$block-class} .#{$block-class}__sidebar-item-header {
73
+ @include carbon--type-style('label-01');
74
+ }
75
+
76
+ .#{$block-class} .#{$block-class}__sidebar-item-body {
77
+ @include carbon--type-style('body-long-01');
78
+
79
+ margin-bottom: $spacing-03;
80
+ }
81
+
82
+ .#{$block-class} .#{$block-class}__sidebar-item-remove-button:hover {
83
+ background: $disabled-02;
84
+ }
85
+
86
+ .#{$block-class} .#{$block-class}__sidebar-accordion-title {
87
+ display: flex;
88
+ align-items: center;
89
+ justify-content: space-between;
90
+ }
91
+
62
92
  // overrides
63
93
 
64
94
  // the influencer sidebar needs to be even with the buttons
@@ -77,6 +107,30 @@
77
107
  p {
78
108
  padding-right: 0;
79
109
  }
110
+
111
+ .#{$block-class} .#{$carbon-prefix}--structured-list-td {
112
+ padding-bottom: $spacing-05;
113
+ }
114
+
115
+ .#{$block-class}
116
+ .#{$carbon-prefix}--radio-button-wrapper
117
+ .#{$carbon-prefix}--radio-button__label {
118
+ justify-content: left;
119
+ }
120
+
121
+ .#{$block-class} .#{$carbon-prefix}--breadcrumb .#{$carbon-prefix}--link {
122
+ cursor: pointer;
123
+ }
124
+
125
+ .#{$carbon-prefix}--accordion__item {
126
+ &:hover .#{$block-class}__sidebar-accordion-title button {
127
+ opacity: 1;
128
+ }
129
+
130
+ .#{$block-class}__sidebar-accordion-title button {
131
+ opacity: 0;
132
+ }
133
+ }
80
134
  }
81
135
 
82
136
  @include exports('add-select') {
@@ -5,4 +5,4 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @import './breadcrumb-with-overflow.scss';
8
+ @import './breadcrumb-with-overflow';
@@ -13,7 +13,7 @@
13
13
  $block-class: #{$pkg-prefix}--create-influencer;
14
14
  $create-tearsheet-block-class: #{$pkg-prefix}--tearsheet-create;
15
15
  $influencerAnimationStart: calc(-1 * #{$spacing-05});
16
- @keyframes influencerMenuEntrance {
16
+ @keyframes influencer-menu-entrance {
17
17
  0% {
18
18
  opacity: 0;
19
19
  // stylelint-disable-next-line carbon/layout-token-use
@@ -24,7 +24,7 @@
24
24
  transform: translateX(0);
25
25
  }
26
26
  }
27
- @keyframes influencerMenuExit {
27
+ @keyframes influencer-menu-exit {
28
28
  0% {
29
29
  opacity: 1;
30
30
  transform: translateX(0);
@@ -60,7 +60,7 @@
60
60
  .#{$block-class}__side-nav-opening,
61
61
  .#{$block-class}__progress-indicator-opening {
62
62
  // stylelint-disable-next-line carbon/motion-token-use
63
- animation: influencerMenuEntrance $duration--moderate-02 1;
63
+ animation: influencer-menu-entrance $duration--moderate-02 1;
64
64
  animation-fill-mode: forwards;
65
65
  @include carbon--motion(entrance, productive);
66
66
  }
@@ -68,7 +68,7 @@
68
68
  .#{$block-class}__side-nav-closing,
69
69
  .#{$block-class}__progress-indicator-closing {
70
70
  // stylelint-disable-next-line carbon/motion-token-use
71
- animation: influencerMenuExit $duration--moderate-02 1;
71
+ animation: influencer-menu-exit $duration--moderate-02 1;
72
72
  animation-fill-mode: forwards;
73
73
  @include carbon--motion(exit, productive);
74
74
  }
@@ -23,7 +23,7 @@
23
23
  @import '../CreateInfluencer/index';
24
24
 
25
25
  @mixin create-tearsheet {
26
- @keyframes stepContentEntrance {
26
+ @keyframes step-content-entrance {
27
27
  0% {
28
28
  opacity: 0;
29
29
  // stylelint-disable-next-line carbon/layout-token-use
@@ -50,7 +50,7 @@
50
50
  }
51
51
 
52
52
  .#{$block-class} .#{$step-block-class}__step--visible-step {
53
- animation: $duration--slow-01 stepContentEntrance;
53
+ animation: $duration--slow-01 step-content-entrance;
54
54
  animation-fill-mode: forwards;
55
55
  animation-timing-function: $carbon--standard-easing;
56
56
  opacity: 0;
@@ -5,14 +5,8 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @import './index';
9
8
  @import '../../global/styles/project-settings';
10
9
 
11
- // Uncomment next line (which must appear last) to test in storybook
12
- // that the SCSS styles for this component are sufficiently specific
13
- // to override Carbon whichever order the styles get loaded in.
14
- //@import 'carbon-components/css/carbon-components.min';
15
-
16
10
  $story-class: #{$pkg-prefix}--create-tearsheet-narrow--story;
17
11
 
18
12
  .#{$story-class}__flex-container {
@@ -0,0 +1,102 @@
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
+
8
+ // Standard imports.
9
+ @import '../../global/styles/project-settings';
10
+ @import '../../global/styles/mixins';
11
+
12
+ // Define all component styles in a mixin which is then exported using
13
+ // the Carbon import-once mechanism.
14
+ @mixin set-header-borders {
15
+ border-right: 1px solid $text-03;
16
+ border-bottom: 1px solid $text-03;
17
+ }
18
+ @mixin set-body-borders {
19
+ border-right: 1px solid $ui-03;
20
+ border-bottom: 1px solid $ui-03;
21
+ }
22
+ @mixin data-spreadsheet {
23
+ // The block part of our conventional BEM class names (blockClass__E--M).
24
+ $block-class: #{$pkg-prefix}--data-spreadsheet;
25
+
26
+ .#{$block-class} {
27
+ display: inline-block;
28
+ border-spacing: 0;
29
+
30
+ &.#{$block-class}__container-has-focus {
31
+ outline: 2px solid $inverse-link;
32
+ }
33
+
34
+ .#{$block-class}__header--container {
35
+ position: relative;
36
+ }
37
+
38
+ button.#{$block-class}__td {
39
+ margin: 0;
40
+ background-color: transparent;
41
+ }
42
+ .#{$block-class}__tr {
43
+ :last-child {
44
+ .#{$block-class}__td {
45
+ border-bottom: 0;
46
+ }
47
+ }
48
+ }
49
+
50
+ .#{$block-class}__th,
51
+ .#{$block-class}__td {
52
+ // height: 2.25rem; // update to be controlled by cellSize prop later
53
+ padding: 0 $spacing-03;
54
+ border: 0;
55
+ margin: 0;
56
+ color: $text-01;
57
+ }
58
+ .#{$block-class}__th:last-child,
59
+ .#{$block-class}__td:last-child {
60
+ border-right: 1px solid $text-03;
61
+ }
62
+ .#{$block-class}__th,
63
+ button.#{$block-class}__td-th {
64
+ @include set-header-borders();
65
+
66
+ background-color: $ui-01;
67
+ cursor: pointer;
68
+ }
69
+ .#{$block-class}__td-th {
70
+ @include carbon--font-weight('semibold');
71
+
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: flex-end;
75
+ }
76
+ .#{$block-class}__td {
77
+ @include set-body-borders();
78
+
79
+ cursor: cell;
80
+ text-align: left;
81
+ }
82
+ .#{$block-class}__th {
83
+ @include carbon--type-style('productive-heading-01');
84
+
85
+ color: $text-01;
86
+ text-align: left;
87
+ }
88
+ .#{$block-class}__active-cell--highlight {
89
+ position: absolute;
90
+ border: $spacing-01 solid $interactive-01;
91
+ background-color: transparent;
92
+ &:focus {
93
+ border: $spacing-01 solid $interactive-01;
94
+ outline: 0;
95
+ }
96
+ }
97
+ }
98
+ }
99
+
100
+ @include exports('data-spreadsheet') {
101
+ @include data-spreadsheet;
102
+ }
@@ -1,8 +1,8 @@
1
1
  //
2
- // Copyright IBM Corp. 2021, 2021
2
+ // Copyright IBM Corp. 2022, 2022
3
3
  //
4
4
  // This source code is licensed under the Apache-2.0 license found in the
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @import './cancelable-text-edit';
8
+ @import './data-spreadsheet';
@@ -0,0 +1,6 @@
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
+ //
@@ -5,9 +5,6 @@
5
5
  // LICENSE file in the root directory of this source tree.
6
6
  //
7
7
 
8
- @import './index';
9
-
10
- // TODO: add any additional styles used by EditSidePanel.stories.js
11
8
  @import '../../global/styles/project-settings';
12
9
 
13
10
  $block-class: #{$pkg-prefix}--edit-side-panel;
@@ -28,8 +25,3 @@ $story-prefix: edit-side-panel-stories__;
28
25
  .#{$block-class} .#{$carbon-prefix}--number__control-btn::after {
29
26
  background-color: $field-02;
30
27
  }
31
-
32
- // Uncomment next line (which must appear last) to test in storybook
33
- // that the SCSS styles for this component are sufficiently specific
34
- // to override Carbon whichever order the styles get loaded in.
35
- //@import 'carbon-components/css/carbon-components.min';