@carbon/ibm-products 2.0.0-rc.27 → 2.0.0-rc.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. package/css/index-full-carbon.css +71 -221
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +3 -5
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +142 -189
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -3
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +71 -221
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +3 -5
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +71 -221
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +3 -5
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/AboutModal/AboutModal.js +3 -4
  18. package/es/components/ActionBar/ActionBar.js +13 -29
  19. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +15 -21
  20. package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +7 -11
  21. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +7 -8
  22. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +6 -5
  23. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -4
  24. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +17 -3
  25. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +19 -4
  26. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +8 -5
  27. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +2 -1
  28. package/es/components/Datagrid/Datagrid/addons/Filtering/utils.js +19 -1
  29. package/es/components/Datagrid/useFiltering.js +4 -2
  30. package/es/components/Datagrid/useOnRowClick.js +11 -1
  31. package/es/components/Datagrid/useSelectRows.js +2 -0
  32. package/es/components/{InlineEditV2/InlineEditV2.js → EditInPlace/EditInPlace.js} +92 -30
  33. package/es/components/{InlineEdit → EditInPlace}/index.js +1 -1
  34. package/es/components/PageHeader/PageHeader.js +36 -35
  35. package/es/components/PageHeader/PageHeaderTitle.js +18 -18
  36. package/es/components/SidePanel/SidePanel.js +25 -26
  37. package/es/components/TagSet/TagSet.js +5 -7
  38. package/es/components/Tearsheet/TearsheetShell.js +4 -6
  39. package/es/components/index.js +1 -1
  40. package/es/global/js/hooks/useResizeObserver.js +79 -0
  41. package/es/global/js/hooks/useWindowResize.js +6 -0
  42. package/es/global/js/hooks/useWindowScroll.js +7 -0
  43. package/es/global/js/package-settings.js +2 -4
  44. package/lib/components/AboutModal/AboutModal.js +3 -4
  45. package/lib/components/ActionBar/ActionBar.js +13 -29
  46. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +13 -19
  47. package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +7 -11
  48. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +2 -1
  49. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +5 -4
  50. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -4
  51. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +17 -3
  52. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +19 -4
  53. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +8 -5
  54. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +2 -1
  55. package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +18 -1
  56. package/lib/components/Datagrid/useFiltering.js +4 -2
  57. package/lib/components/Datagrid/useOnRowClick.js +11 -1
  58. package/lib/components/Datagrid/useSelectRows.js +2 -0
  59. package/lib/components/{InlineEditV2/InlineEditV2.js → EditInPlace/EditInPlace.js} +100 -34
  60. package/lib/components/{InlineEdit → EditInPlace}/index.js +3 -3
  61. package/lib/components/PageHeader/PageHeader.js +36 -35
  62. package/lib/components/PageHeader/PageHeaderTitle.js +19 -19
  63. package/lib/components/SidePanel/SidePanel.js +25 -26
  64. package/lib/components/TagSet/TagSet.js +5 -7
  65. package/lib/components/Tearsheet/TearsheetShell.js +4 -6
  66. package/lib/components/index.js +7 -7
  67. package/lib/global/js/hooks/useResizeObserver.js +91 -0
  68. package/lib/global/js/hooks/useWindowScroll.js +6 -0
  69. package/lib/global/js/package-settings.js +2 -4
  70. package/package.json +3 -4
  71. package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +10 -1
  72. package/scss/components/Datagrid/styles/_useSelectAllToggle.scss +11 -7
  73. package/scss/components/{InlineEditV2/_inline-edit-v2.scss → EditInPlace/_edit-in-place.scss} +56 -14
  74. package/scss/components/{InlineEditV1 → EditInPlace}/_index-with-carbon.scss +1 -1
  75. package/scss/components/{InlineEditV2 → EditInPlace}/_index.scss +1 -1
  76. package/scss/components/{InlineEditV1 → EditInPlace}/_storybook-styles.scss +3 -15
  77. package/scss/components/PageHeader/_page-header.scss +1 -7
  78. package/scss/components/_index-released-only-with-carbon.scss +1 -1
  79. package/scss/components/_index-released-only.scss +1 -1
  80. package/scss/components/_index-with-carbon.scss +1 -2
  81. package/scss/components/_index.scss +1 -2
  82. package/es/components/InlineEdit/InlineEdit.js +0 -47
  83. package/es/components/InlineEditV1/InlineEditV1.js +0 -442
  84. package/es/components/InlineEditV1/index.js +0 -7
  85. package/es/components/InlineEditV2/index.js +0 -7
  86. package/lib/components/InlineEdit/InlineEdit.js +0 -63
  87. package/lib/components/InlineEditV1/InlineEditV1.js +0 -459
  88. package/lib/components/InlineEditV1/index.js +0 -13
  89. package/lib/components/InlineEditV2/index.js +0 -13
  90. package/scss/components/InlineEditV1/_carbon-imports.scss +0 -6
  91. package/scss/components/InlineEditV1/_index.scss +0 -8
  92. package/scss/components/InlineEditV1/_inline-edit-v1.scss +0 -269
  93. package/scss/components/InlineEditV2/_index-with-carbon.scss +0 -9
  94. package/scss/components/InlineEditV2/_storybook-styles.scss +0 -9
  95. /package/scss/components/{InlineEditV2 → EditInPlace}/_carbon-imports.scss +0 -0
@@ -25,7 +25,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
25
25
 
26
26
  var _classnames = _interopRequireDefault(require("classnames"));
27
27
 
28
- var _reactResizeDetector = require("react-resize-detector");
28
+ var _useResizeObserver = require("../../global/js/hooks/useResizeObserver");
29
29
 
30
30
  var _motion = require("@carbon/motion");
31
31
 
@@ -77,7 +77,7 @@ var defaults = {
77
77
  */
78
78
 
79
79
  var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
80
- var _window, _ref4, _cx4;
80
+ var _window, _ref5, _cx4;
81
81
 
82
82
  var actionToolbarButtons = _ref.actionToolbarButtons,
83
83
  actions = _ref.actions,
@@ -198,9 +198,10 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
198
198
  }, [labelText, title]);
199
199
  /* istanbul ignore next */
200
200
 
201
- var handleResize = function handleResize(width, height) {
201
+ var handleResize = function handleResize(_ref2) {
202
202
  var _sidePanelOuter$style3;
203
203
 
204
+ var height = _ref2.height;
204
205
  setPanelHeight(height);
205
206
  var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
206
207
  var actionsContainer = getActionsContainerElement();
@@ -397,9 +398,9 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
397
398
 
398
399
  /* istanbul ignore next */
399
400
 
400
- var handleBlur = function handleBlur(_ref2) {
401
- var oldActiveNode = _ref2.target,
402
- currentActiveNode = _ref2.relatedTarget;
401
+ var handleBlur = function handleBlur(_ref3) {
402
+ var oldActiveNode = _ref3.target,
403
+ currentActiveNode = _ref3.relatedTarget;
403
404
 
404
405
  // focus trap should only be set if the side panel is a `slideOver` type
405
406
  if (open && sidePanelInnerRef && !slideIn) {
@@ -414,7 +415,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
414
415
  };
415
416
 
416
417
  var primaryActionContainerClassNames = (0, _classnames.default)(["".concat(blockClass, "__actions-container"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__actions-container-condensed"), condensedActions)]);
417
- var mainPanelClassNames = (0, _classnames.default)([blockClass, className, "".concat(blockClass, "__container"), "".concat(blockClass, "__container--").concat(size), (_ref4 = {}, (0, _defineProperty2.default)(_ref4, "".concat(blockClass, "__container-right-placement"), placement === 'right'), (0, _defineProperty2.default)(_ref4, "".concat(blockClass, "__container-left-placement"), placement === 'left'), (0, _defineProperty2.default)(_ref4, "".concat(blockClass, "__container-with-action-toolbar"), actionToolbarButtons && actionToolbarButtons.length), (0, _defineProperty2.default)(_ref4, "".concat(blockClass, "__container-without-overlay"), !includeOverlay && !slideIn), (0, _defineProperty2.default)(_ref4, "".concat(blockClass, "__container-is-animating"), !animationComplete || !open), _ref4)]);
418
+ var mainPanelClassNames = (0, _classnames.default)([blockClass, className, "".concat(blockClass, "__container"), "".concat(blockClass, "__container--").concat(size), (_ref5 = {}, (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-right-placement"), placement === 'right'), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-left-placement"), placement === 'left'), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-with-action-toolbar"), actionToolbarButtons && actionToolbarButtons.length), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-without-overlay"), !includeOverlay && !slideIn), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-is-animating"), !animationComplete || !open), _ref5)]);
418
419
 
419
420
  var renderHeader = function renderHeader() {
420
421
  var _cx, _cx2;
@@ -453,17 +454,17 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
453
454
  className: (0, _classnames.default)("".concat(blockClass, "__subtitle-text"), (_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-text-no-animation"), !animateTitle), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-text-no-animation-no-action-toolbar"), !animateTitle && (!actionToolbarButtons || !actionToolbarButtons.length)), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-text-is-animating"), !animationComplete && animateTitle), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-without-title"), !title), _cx2))
454
455
  }, subtitle), actionToolbarButtons && actionToolbarButtons.length && /*#__PURE__*/_react.default.createElement("div", {
455
456
  className: (0, _classnames.default)("".concat(blockClass, "__action-toolbar"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__action-toolbar-no-animation"), !animateTitle))
456
- }, actionToolbarButtons.map(function (_ref5) {
457
- var label = _ref5.label,
458
- kind = _ref5.kind,
459
- icon = _ref5.icon,
460
- tooltipPosition = _ref5.tooltipPosition,
461
- tooltipAlignment = _ref5.tooltipAlignment,
462
- leading = _ref5.leading,
463
- disabled = _ref5.disabled,
464
- className = _ref5.className,
465
- onClick = _ref5.onClick,
466
- rest = (0, _objectWithoutProperties2.default)(_ref5, _excluded2);
457
+ }, actionToolbarButtons.map(function (_ref6) {
458
+ var label = _ref6.label,
459
+ kind = _ref6.kind,
460
+ icon = _ref6.icon,
461
+ tooltipPosition = _ref6.tooltipPosition,
462
+ tooltipAlignment = _ref6.tooltipAlignment,
463
+ leading = _ref6.leading,
464
+ disabled = _ref6.disabled,
465
+ className = _ref6.className,
466
+ onClick = _ref6.onClick,
467
+ rest = (0, _objectWithoutProperties2.default)(_ref6, _excluded2);
467
468
  return /*#__PURE__*/_react.default.createElement(_react2.Button, (0, _extends2.default)({}, rest, {
468
469
  key: label,
469
470
  kind: kind || 'ghost',
@@ -493,10 +494,8 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
493
494
  };
494
495
 
495
496
  var contentRef = ref || sidePanelRef;
496
- (0, _reactResizeDetector.useResizeDetector)({
497
- handleHeight: true,
498
- onResize: handleResize,
499
- targetRef: contentRef
497
+ (0, _useResizeObserver.useResizeObserver)(contentRef, {
498
+ callback: handleResize
500
499
  });
501
500
  return /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, null, open && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_framerMotion.motion.div, (0, _extends2.default)({}, (0, _devtools.getDevtoolsProps)(componentName), rest, {
502
501
  id: "".concat(blockClass, "-outer"),
@@ -667,8 +666,8 @@ SidePanel.propTypes = {
667
666
  * This is the selector to the element that contains all of the page content that will shrink if the panel is a slide in.
668
667
  * This prop is required when using the `slideIn` variant of the side panel.
669
668
  */
670
- selectorPageContent: _propTypes.default.string.isRequired.if(function (_ref7) {
671
- var slideIn = _ref7.slideIn;
669
+ selectorPageContent: _propTypes.default.string.isRequired.if(function (_ref8) {
670
+ var slideIn = _ref8.slideIn;
672
671
  return slideIn;
673
672
  }),
674
673
 
@@ -696,8 +695,8 @@ SidePanel.propTypes = {
696
695
  /**
697
696
  * Sets the title text
698
697
  */
699
- title: _propTypes.default.string.isRequired.if(function (_ref8) {
700
- var labelText = _ref8.labelText;
698
+ title: _propTypes.default.string.isRequired.if(function (_ref9) {
699
+ var labelText = _ref9.labelText;
701
700
  return labelText;
702
701
  })
703
702
  };
@@ -31,7 +31,7 @@ var _TagSetModal = require("./TagSetModal");
31
31
 
32
32
  var _react2 = require("@carbon/react");
33
33
 
34
- var _reactResizeDetector = require("react-resize-detector");
34
+ var _useResizeObserver = require("../../global/js/hooks/useResizeObserver");
35
35
 
36
36
  var _devtools = require("../../global/js/utils/devtools");
37
37
 
@@ -245,13 +245,11 @@ var TagSet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
245
245
  setShowAllModalOpen(false);
246
246
  };
247
247
 
248
- (0, _reactResizeDetector.useResizeDetector)({
249
- onResize: handleSizerTagsResize,
250
- targetRef: sizingContainerRef
248
+ (0, _useResizeObserver.useResizeObserver)(sizingContainerRef, {
249
+ callback: handleSizerTagsResize
251
250
  });
252
- (0, _reactResizeDetector.useResizeDetector)({
253
- onResize: handleResize,
254
- targetRef: tagSetRef
251
+ (0, _useResizeObserver.useResizeObserver)(tagSetRef, {
252
+ callback: handleResize
255
253
  });
256
254
  return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
257
255
  className: (0, _classnames.default)([blockClass, className]),
@@ -21,7 +21,7 @@ var _react = _interopRequireWildcard(require("react"));
21
21
 
22
22
  var _reactDom = require("react-dom");
23
23
 
24
- var _reactResizeDetector = require("react-resize-detector");
24
+ var _useResizeObserver2 = require("../../global/js/hooks/useResizeObserver");
25
25
 
26
26
  var _propTypes = _interopRequireDefault(require("prop-types"));
27
27
 
@@ -118,13 +118,11 @@ var TearsheetShell = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
118
118
  }
119
119
  }, [portalTargetIn]);
120
120
  var localRef = (0, _react.useRef)();
121
+ var resizer = (0, _react.useRef)(null);
121
122
  var modalRef = ref || localRef;
122
123
 
123
- var _useResizeDetector = (0, _reactResizeDetector.useResizeDetector)({
124
- handleHeight: false
125
- }),
126
- width = _useResizeDetector.width,
127
- resizer = _useResizeDetector.ref;
124
+ var _useResizeObserver = (0, _useResizeObserver2.useResizeObserver)(resizer),
125
+ width = _useResizeObserver.width;
128
126
 
129
127
  var wide = size === 'wide'; // Keep track of the stack depth and our position in it (1-based, 0=closed)
130
128
 
@@ -99,6 +99,12 @@ Object.defineProperty(exports, "EditFullPage", {
99
99
  return _EditFullPage.EditFullPage;
100
100
  }
101
101
  });
102
+ Object.defineProperty(exports, "EditInPlace", {
103
+ enumerable: true,
104
+ get: function get() {
105
+ return _EditInPlace.EditInPlace;
106
+ }
107
+ });
102
108
  Object.defineProperty(exports, "EditSidePanel", {
103
109
  enumerable: true,
104
110
  get: function get() {
@@ -171,12 +177,6 @@ Object.defineProperty(exports, "ImportModal", {
171
177
  return _ImportModal.ImportModal;
172
178
  }
173
179
  });
174
- Object.defineProperty(exports, "InlineEdit", {
175
- enumerable: true,
176
- get: function get() {
177
- return _InlineEdit.InlineEdit;
178
- }
179
- });
180
180
  Object.defineProperty(exports, "ModifiedTabs", {
181
181
  enumerable: true,
182
182
  get: function get() {
@@ -516,7 +516,7 @@ var _EditSidePanel = require("./EditSidePanel");
516
516
 
517
517
  var _OptionsTile = require("./OptionsTile");
518
518
 
519
- var _InlineEdit = require("./InlineEdit");
519
+ var _EditInPlace = require("./EditInPlace");
520
520
 
521
521
  var _DataSpreadsheet = require("./DataSpreadsheet");
522
522
 
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useResizeObserver = void 0;
9
+
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+
12
+ var _react = require("react");
13
+
14
+ /**
15
+ * Copyright IBM Corp. 2023, 2023
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 useResizeObserver = function useResizeObserver(ref) {
21
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
22
+ callback: null,
23
+ throttleInterval: 0
24
+ };
25
+ var callback = options.callback,
26
+ throttleInterval = options.throttleInterval;
27
+
28
+ var _useState = (0, _react.useState)(0),
29
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
30
+ width = _useState2[0],
31
+ setWidth = _useState2[1];
32
+
33
+ var _useState3 = (0, _react.useState)(0),
34
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
35
+ height = _useState4[0],
36
+ setHeight = _useState4[1];
37
+
38
+ var throttleTimeout = (0, _react.useRef)(null);
39
+ var entriesToHandle = (0, _react.useRef)(null);
40
+ (0, _react.useLayoutEffect)(function () {
41
+ if (!(ref !== null && ref !== void 0 && ref.current)) {
42
+ return;
43
+ }
44
+
45
+ var doCallbacks = function doCallbacks() {
46
+ if (!(ref !== null && ref !== void 0 && ref.current) || !Array.isArray(entriesToHandle === null || entriesToHandle === void 0 ? void 0 : entriesToHandle.current)) {
47
+ return;
48
+ }
49
+
50
+ var entry = entriesToHandle.current[0];
51
+ setWidth(entry.contentRect.width);
52
+ setHeight(entry.contentRect.height);
53
+ throttleTimeout.current = null;
54
+ callback && callback(entry.contentRect);
55
+ };
56
+
57
+ var observer = new ResizeObserver(function (entries) {
58
+ // always update entriesToHandle
59
+ entriesToHandle.current = entries;
60
+
61
+ if (throttleInterval) {
62
+ // if a throttleInterval check for running timeout
63
+ if (throttleTimeout.current === null) {
64
+ // no live timeout set entries to handle and move on
65
+ // set up throttle
66
+ throttleTimeout.current = setTimeout(function () {
67
+ // do callbacks
68
+ doCallbacks(); // reset throttle
69
+
70
+ throttleTimeout.current = null;
71
+ }, throttleInterval);
72
+ }
73
+ } else {
74
+ // no throttle do callbacks every time
75
+ doCallbacks();
76
+ }
77
+ }); // observe all refs passed
78
+
79
+ observer.observe(ref.current);
80
+ return function () {
81
+ observer.disconnect();
82
+ observer = null;
83
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
84
+ }, [ref, options]);
85
+ return {
86
+ width: width,
87
+ height: height
88
+ };
89
+ };
90
+
91
+ exports.useResizeObserver = useResizeObserver;
@@ -14,6 +14,12 @@ var _react = require("react");
14
14
 
15
15
  var _scrollableAncestor = require("../utils/scrollableAncestor");
16
16
 
17
+ /**
18
+ * Copyright IBM Corp. 2022, 2023
19
+ *
20
+ * This source code is licensed under the Apache-2.0 license found in the
21
+ * LICENSE file in the root directory of this source tree.
22
+ */
17
23
  var windowExists = (typeof window === "undefined" ? "undefined" : (0, _typeof2.default)(window)) !== "undefined";
18
24
 
19
25
  var useTargetScroll = function useTargetScroll(target, effect, deps, throttleInterval) {
@@ -31,6 +31,7 @@ var defaults = {
31
31
  CreateTearsheet: true,
32
32
  CreateTearsheetStep: true,
33
33
  CreateTearsheetDivider: true,
34
+ EditInPlace: true,
34
35
  EmptyState: true,
35
36
  ErrorEmptyState: true,
36
37
  ExportModal: true,
@@ -39,8 +40,6 @@ var defaults = {
39
40
  HTTPError404: true,
40
41
  HTTPErrorOther: true,
41
42
  ImportModal: true,
42
- InlineEdit: true,
43
- InlineEditV1: true,
44
43
  MultiAddSelect: true,
45
44
  NotificationsPanel: true,
46
45
  NoDataEmptyState: true,
@@ -75,8 +74,7 @@ var defaults = {
75
74
  EditTearsheet: false,
76
75
  EditTearsheetNarrow: false,
77
76
  EditFullPage: false,
78
- EditUpdateCards: false,
79
- InlineEditV2: false
77
+ EditUpdateCards: false
80
78
  /* new component flags here - comment used by generate CLI */
81
79
 
82
80
  },
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": "2.0.0-rc.27",
4
+ "version": "2.0.0-rc.28",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -11,7 +11,7 @@
11
11
  "repository": {
12
12
  "type": "git",
13
13
  "url": "https://github.com/carbon-design-system/ibm-cloud-cognitive.git",
14
- "directory": "packages/cloud-cognitive"
14
+ "directory": "packages/ibm-products"
15
15
  },
16
16
  "bugs": "https://github.com/carbon-design-system/ibm-cloud-cognitive/issues",
17
17
  "sideEffects": [
@@ -80,7 +80,6 @@
80
80
  "immutability-helper": "^3.1.1",
81
81
  "react-dnd": "^15.1.2",
82
82
  "react-dnd-html5-backend": "^15.1.3",
83
- "react-resize-detector": "^7.1.2",
84
83
  "react-table": "^7.8.0",
85
84
  "react-window": "^1.8.7"
86
85
  },
@@ -94,5 +93,5 @@
94
93
  "react": "^16.8.6 || ^17.0.1",
95
94
  "react-dom": "^16.8.6 || ^17.0.1"
96
95
  },
97
- "gitHead": "33ed98e63caf4d07ba69eb8cb709fd44b3303c78"
96
+ "gitHead": "d459d01283f68efa6a4bfbdc79a97bf508f83f6b"
98
97
  }
@@ -1,5 +1,5 @@
1
1
  //
2
- // Copyright IBM Corp. 2020, 2021
2
+ // Copyright IBM Corp. 2020, 2023
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.
@@ -47,6 +47,15 @@ $_block-class: #{c4p-settings.$pkg-prefix}--breadcrumb-with-overflow;
47
47
  display: none;
48
48
  }
49
49
 
50
+ .#{$_block-class}__back__button.#{c4p-settings.$carbon-prefix}--btn {
51
+ min-height: revert;
52
+ padding: 0;
53
+ }
54
+
55
+ .#{$_block-class}__back__button.#{c4p-settings.$carbon-prefix}--btn--ghost:hover {
56
+ background-color: inherit;
57
+ }
58
+
50
59
  @include breakpoint-down(md) {
51
60
  .#{c4p-settings.$carbon-prefix}--breadcrumb-item {
52
61
  display: none;
@@ -1,14 +1,14 @@
1
- /*
2
- * Licensed Materials - Property of IBM
3
- * 5724-Q36
4
- * (c) Copyright IBM Corp. 2021
5
- * US Government Users Restricted Rights - Use, duplication or disclosure
6
- * restricted by GSA ADP Schedule Contract with IBM Corp.
7
- */
1
+ //
2
+ // Copyright IBM Corp. 2021, 2023
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
+ //
8
7
 
9
8
  @use '@carbon/styles/scss/spacing' as *;
10
9
  @use '@carbon/styles/scss/theme' as *;
11
10
  @use './variables';
11
+ @use '../../../global/styles/project-settings' as c4p-settings;
12
12
 
13
13
  .#{variables.$block-class}__grid-container {
14
14
  th.#{variables.$block-class}__select-all-toggle-on,
@@ -31,3 +31,7 @@ th.#{variables.$block-class}__select-all-toggle-on {
31
31
  th.#{variables.$block-class}__select-all-toggle-on.button {
32
32
  margin-left: $spacing-01;
33
33
  }
34
+
35
+ .#{variables.$block-class}__select-all-toggle-overflow.#{c4p-settings.$carbon-prefix}--overflow-menu-options--sm.#{c4p-settings.$carbon-prefix}--overflow-menu-options[data-floating-menu-direction='bottom']::after {
36
+ width: $spacing-13;
37
+ }
@@ -12,17 +12,32 @@
12
12
  @use '@carbon/styles/scss/type';
13
13
  @use '@carbon/styles/scss/motion' as *;
14
14
 
15
- $block-class: #{$pkg-prefix}--inline-edit-v2;
15
+ $block-class: #{$pkg-prefix}--edit-in-place;
16
16
  $carbon-input: #{$carbon-prefix}--text-input;
17
17
 
18
18
  .#{$block-class} {
19
+ --#{$block-class}--size: #{$spacing-07};
20
+
19
21
  display: flex;
20
22
  align-items: center;
21
23
  background: transparent;
22
24
  cursor: pointer;
23
25
  }
24
26
 
25
- .#{$block-class}-readonly {
27
+ .#{$block-class}--sm {
28
+ --#{$block-class}--size: #{$spacing-07};
29
+ }
30
+
31
+ .#{$block-class}--md {
32
+ --#{$block-class}--size: #{$spacing-08};
33
+ }
34
+
35
+ .#{$block-class}--lg {
36
+ /* April 2023 max text input size */
37
+ --#{$block-class}--size: #{$spacing-09};
38
+ }
39
+
40
+ .#{$block-class}--readonly {
26
41
  cursor: not-allowed;
27
42
  }
28
43
 
@@ -30,7 +45,8 @@ $carbon-input: #{$carbon-prefix}--text-input;
30
45
  background: $field-01;
31
46
  }
32
47
 
33
- .#{$block-class}:hover .#{$block-class}__btn-edit {
48
+ .#{$block-class}:hover .#{$block-class}__btn-edit,
49
+ .#{$block-class}__btn-edit.#{$block-class}__btn-edit--always-visible {
34
50
  visibility: visible;
35
51
  }
36
52
 
@@ -38,6 +54,10 @@ $carbon-input: #{$carbon-prefix}--text-input;
38
54
  visibility: hidden;
39
55
  }
40
56
 
57
+ .#{$block-class}--invalid {
58
+ outline: 2px solid $support-error;
59
+ }
60
+
41
61
  .#{$block-class}--focused {
42
62
  background: $field-01;
43
63
  outline: 2px solid $focus;
@@ -47,12 +67,32 @@ $carbon-input: #{$carbon-prefix}--text-input;
47
67
  flex: 1;
48
68
  }
49
69
 
70
+ .#{$block-class}--inherit-type .#{$block-class}__text-input {
71
+ /* match font of container */
72
+ font-size: inherit;
73
+ font-weight: inherit;
74
+ letter-spacing: inherit;
75
+ line-height: inherit;
76
+ }
77
+
78
+ .#{$block-class}__ellipsis {
79
+ position: relative;
80
+ margin-left: calc(-1 * $spacing-05);
81
+ opacity: 0;
82
+ }
83
+
84
+ .#{$block-class}--overflows:not(.#{$block-class}--focused)
85
+ .#{$block-class}__ellipsis {
86
+ opacity: 1;
87
+ }
88
+
50
89
  .#{$block-class}__text-input-label {
51
90
  display: none;
52
91
  }
53
92
 
54
93
  .#{$block-class}__warning-icon {
55
- margin: $spacing-03;
94
+ width: $spacing-05;
95
+ margin: auto $spacing-03;
56
96
  color: $support-error;
57
97
  }
58
98
 
@@ -71,11 +111,11 @@ $carbon-input: #{$carbon-prefix}--text-input;
71
111
  outline: none;
72
112
  }
73
113
 
74
- .#{$block-class}-readonly .#{$block-class}__text-input.#{$carbon-input},
75
- .#{$block-class}-readonly
76
- .#{$carbon-prefix}--btn.#{$carbon-prefix}--btn--icon-only.#{$carbon-prefix}--tooltip__trigger {
77
- cursor: not-allowed;
78
- }
114
+ // .#{$block-class}-readonly .#{$block-class}__text-input.#{$carbon-input},
115
+ // .#{$block-class}-readonly
116
+ // .#{$carbon-prefix}--btn.#{$carbon-prefix}--btn--icon-only.#{$carbon-prefix}--tooltip__trigger {
117
+ // cursor: not-allowed;
118
+ // }
79
119
 
80
120
  .#{$block-class}__text-input.#{$carbon-input}:focus,
81
121
  .#{$block-class}__text-input.#{$carbon-input}:active {
@@ -83,18 +123,20 @@ $carbon-input: #{$carbon-prefix}--text-input;
83
123
  }
84
124
 
85
125
  .#{$block-class}__toolbar {
86
- --toolbar-width: #{$spacing-07};
87
- --toolbar-width-focussed: #{$spacing-10};
126
+ --toolbar-width: var(--#{$block-class}--size);
127
+ --toolbar-width-focussed: calc(2 * var(--#{$block-class}--size));
88
128
 
89
129
  // animation div
90
130
  display: inline-flex;
91
- overflow: hidden;
92
131
  width: var(--toolbar-width);
93
132
  }
94
133
 
95
134
  .#{$block-class}--invalid .#{$block-class}__toolbar {
96
- --toolbar-width: #{$spacing-07};
97
- --toolbar-width-focussed: #{$spacing-12};
135
+ // width of invalid icon is always $spacing-07 ($spacing-05 + 2 * $spacing-03 margin)
136
+ --toolbar-width: calc(var(--#{$block-class}--size) + #{$spacing-07});
137
+ --toolbar-width-focussed: calc(
138
+ 2 * var(--#{$block-class}--size) + #{$spacing-07}
139
+ );
98
140
  }
99
141
 
100
142
  @keyframes slide-in {
@@ -6,4 +6,4 @@
6
6
  //
7
7
 
8
8
  @use './carbon-imports';
9
- @use './inline-edit-v1';
9
+ @use './edit-in-place';
@@ -7,4 +7,4 @@
7
7
 
8
8
  // An index file is most useful when you have multiple components
9
9
 
10
- @use './inline-edit-v2';
10
+ @use './edit-in-place';
@@ -4,24 +4,12 @@
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
-
8
- @use '@carbon/type/scss/scale';
9
7
  @use '../../global/styles/display-box';
10
- @use '../../global/styles/project-settings' as c4p-settings;
11
8
 
12
- .inline-edit-stories__viewport {
9
+ $block-class: 'edit-in-place-example';
10
+
11
+ .#{$block-class}__viewport {
13
12
  // width: 300px; // larger than standard size needed by text input at standard font size (html input attribute size)
14
13
  // stylelint-disable-next-line carbon/layout-token-use
15
14
  margin: 100px;
16
15
  }
17
-
18
- $block-class: #{c4p-settings.$pkg-prefix}--inline-edit;
19
-
20
- .component-full-width {
21
- .#{$block-class} {
22
- width: 100%;
23
- }
24
- .#{$block-class} .#{$block-class}__input {
25
- @include scale.font-size(2);
26
- }
27
- }
@@ -357,7 +357,7 @@ $right-section-alt-width: 100% - $left-section-alt-width;
357
357
  }
358
358
 
359
359
  .#{$block-class}__title-row {
360
- margin-top: 0;
360
+ margin-top: $spacing-01; /* spacing needed in case of editable title, otherwise top of focus indicator hidden */
361
361
  margin-bottom: 0;
362
362
  transform: translateY(
363
363
  $spacing-01
@@ -436,12 +436,6 @@ $right-section-alt-width: 100% - $left-section-alt-width;
436
436
  white-space: nowrap;
437
437
  }
438
438
 
439
- .#{$block-class}__title .#{$pkg-prefix}--inline-edit__value {
440
- // The heading text sits 2px pixels lower in the inline edit which is aligned center
441
- // stylelint-disable-next-line carbon/layout-token-use
442
- transform: translateY(-2px);
443
- }
444
-
445
439
  .#{$block-class}__title--editable {
446
440
  display: flex;
447
441
  overflow: visible;
@@ -17,11 +17,11 @@
17
17
  @use './CreateSidePanel/index-with-carbon' as *;
18
18
  @use './CreateTearsheetNarrow/index-with-carbon' as *;
19
19
  @use './CreateTearsheet/index-with-carbon' as *;
20
+ @use './EditInPlace/index-with-carbon' as *;
20
21
  @use './EmptyStates/index-with-carbon' as *;
21
22
  @use './ExportModal/index-with-carbon' as *;
22
23
  @use './ExpressiveCard/index-with-carbon' as *;
23
24
  @use './HTTPErrors/index-with-carbon' as *;
24
- @use './InlineEditV1/index-with-carbon' as *;
25
25
  @use './ImportModal/index-with-carbon' as *;
26
26
  @use './MultiAddSelect/index-with-carbon' as *;
27
27
  @use './NotificationsPanel/index-with-carbon' as *;
@@ -17,11 +17,11 @@
17
17
  @use './CreateSidePanel';
18
18
  @use './CreateTearsheetNarrow';
19
19
  @use './CreateTearsheet';
20
+ @use './EditInPlace';
20
21
  @use './EmptyStates';
21
22
  @use './ExportModal';
22
23
  @use './ExpressiveCard';
23
24
  @use './HTTPErrors';
24
- @use './InlineEditV1';
25
25
  @use './ImportModal';
26
26
  @use './MultiAddSelect';
27
27
  @use './NotificationsPanel';
@@ -42,8 +42,7 @@
42
42
  @use './UserProfileImage/index-with-carbon' as *;
43
43
  @use './EditSidePanel/index-with-carbon' as *;
44
44
  @use './OptionsTile/index-with-carbon' as *;
45
- @use './InlineEditV1/index-with-carbon' as *;
46
- @use './InlineEditV2/index-with-carbon' as *;
45
+ @use './EditInPlace/index-with-carbon' as *;
47
46
  @use './DataSpreadsheet/index-with-carbon' as *;
48
47
  @use './Datagrid/index-with-carbon' as *;
49
48
  @use './EditUpdateCards/index-with-carbon' as *;