@carbon/ibm-products 1.46.1 → 1.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/css/index-full-carbon.css +42 -13
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +4 -4
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +4 -1
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +38 -9
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +3 -3
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +42 -13
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +4 -4
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/Card/CardFooter.js +2 -2
  18. package/es/components/Datagrid/Datagrid/DatagridRow.js +37 -10
  19. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +18 -4
  20. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +15 -2
  21. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -2
  22. package/es/components/Datagrid/useActionsColumn.js +22 -1
  23. package/es/components/Datagrid/useDefaultStringRenderer.js +1 -1
  24. package/es/components/Datagrid/useNestedRows.js +2 -4
  25. package/es/components/Datagrid/useSelectAllToggle.js +16 -2
  26. package/es/components/Datagrid/useSelectRows.js +17 -3
  27. package/es/components/Datagrid/useStickyColumn.js +19 -5
  28. package/es/components/Datagrid/utils/getArgTypes.js +5 -0
  29. package/es/components/SidePanel/SidePanel.js +14 -5
  30. package/lib/components/Card/CardFooter.js +2 -2
  31. package/lib/components/Datagrid/Datagrid/DatagridRow.js +37 -10
  32. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +20 -3
  33. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +14 -1
  34. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +3 -1
  35. package/lib/components/Datagrid/useActionsColumn.js +22 -1
  36. package/lib/components/Datagrid/useDefaultStringRenderer.js +1 -1
  37. package/lib/components/Datagrid/useNestedRows.js +2 -4
  38. package/lib/components/Datagrid/useSelectAllToggle.js +19 -2
  39. package/lib/components/Datagrid/useSelectRows.js +19 -2
  40. package/lib/components/Datagrid/useStickyColumn.js +18 -4
  41. package/lib/components/Datagrid/utils/getArgTypes.js +5 -0
  42. package/lib/components/SidePanel/SidePanel.js +14 -5
  43. package/package.json +5 -5
  44. package/scss/components/Datagrid/_storybook-styles.scss +26 -0
  45. package/scss/components/Datagrid/styles/_datagrid.scss +22 -3
  46. package/scss/components/Datagrid/styles/_useInlineEdit.scss +4 -0
  47. package/scss/components/Datagrid/styles/_useNestedRows.scss +17 -0
  48. package/scss/components/Datagrid/styles/_useSelectAllToggle.scss +11 -8
  49. package/scss/components/Datagrid/styles/_useStickyColumn.scss +3 -3
  50. package/scss/components/EmptyStates/_empty-state.scss +4 -3
  51. package/scss/components/Tearsheet/_tearsheet.scss +4 -0
@@ -14,6 +14,8 @@ var _carbonComponentsReact = require("carbon-components-react");
14
14
  var _settings = require("../../settings");
15
15
  var _excluded = ["id", "itemText", "onClick", "icon"],
16
16
  _excluded2 = ["id", "onClick", "shouldHideMenuItem", "shouldDisableMenuItem", "disabled"];
17
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
19
  var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
18
20
  var useActionsColumn = function useActionsColumn(hooks) {
19
21
  var useAttachActionsOnInstance = function useAttachActionsOnInstance(instance) {
@@ -97,7 +99,7 @@ var useActionsColumn = function useActionsColumn(hooks) {
97
99
  })))),
98
100
  className: (0, _classnames.default)((_cx3 = {}, (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__actions-column-cell"), true), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__cell"), true), _cx3)),
99
101
  style: {
100
- width: 96
102
+ width: rowActions.length > 2 ? 48 : 96
101
103
  }
102
104
  }];
103
105
  }
@@ -106,6 +108,25 @@ var useActionsColumn = function useActionsColumn(hooks) {
106
108
  hooks.getCellProps.push(addActionsMenu);
107
109
  }
108
110
  };
111
+ var useStickyHeaderWidth = function useStickyHeaderWidth(instance) {
112
+ var rowActions = instance.rowActions;
113
+ if (rowActions && Array.isArray(rowActions)) {
114
+ var addHeaderWidth = function addHeaderWidth(props, cellData) {
115
+ var column = cellData.column;
116
+ if (column.isAction) {
117
+ return [props, {
118
+ style: _objectSpread(_objectSpread({}, props.style), {}, {
119
+ width: rowActions.length > 2 ? 48 : 96 // set header width based on action length
120
+ })
121
+ }];
122
+ }
123
+
124
+ return [props];
125
+ };
126
+ hooks.getHeaderProps.push(addHeaderWidth);
127
+ }
128
+ };
129
+ hooks.useInstance.push(useStickyHeaderWidth);
109
130
  hooks.useInstance.push(useAttachActionsOnInstance);
110
131
  };
111
132
  var _default = useActionsColumn;
@@ -17,7 +17,7 @@ var useDefaultStringRenderer = function useDefaultStringRenderer(hooks) {
17
17
  var StringRenderer = function StringRenderer(tableProps) {
18
18
  var _tableProps$column;
19
19
  return /*#__PURE__*/_react.default.createElement("div", {
20
- className: (0, _classnames.default)("".concat(blockClass, "__defaultStringRenderer"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__defaultStringRenderer--multiline"), (_tableProps$column = tableProps.column) === null || _tableProps$column === void 0 ? void 0 : _tableProps$column.multiLineWrap)),
20
+ className: (0, _classnames.default)("".concat(blockClass, "__defaultStringRenderer"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__defaultStringRenderer--multiline"), ((_tableProps$column = tableProps.column) === null || _tableProps$column === void 0 ? void 0 : _tableProps$column.multiLineWrap) || (tableProps === null || tableProps === void 0 ? void 0 : tableProps.multiLineWrapAll))),
21
21
  title: tableProps.value
22
22
  }, tableProps.value);
23
23
  };
@@ -32,9 +32,7 @@ var useNestedRows = function useNestedRows(hooks) {
32
32
  var row = _ref2.row;
33
33
  return [props, {
34
34
  style: {
35
- marginLeft: "".concat(row.depth > 0 ? marginLeft : 0, "px"),
36
- paddingLeft: "".concat(row.depth === 2 ? marginLeft * (row.depth - 1) + marginLeft - 8 : row.depth > 2 ? marginLeft * (row.depth - 1) + marginLeft : row.depth === 1 ? marginLeft - 16 : 0, "px"),
37
- maxWidth: "calc(100% - ".concat(marginLeft * row.depth, "px)")
35
+ paddingLeft: "".concat(row.depth > 1 ? marginLeft * 2 + (row.depth - 1) * (marginLeft + marginLeft / 3) : row.depth === 1 ? marginLeft * 2 : 0, "px")
38
36
  }
39
37
  }];
40
38
  };
@@ -47,7 +45,7 @@ var useNestedRows = function useNestedRows(hooks) {
47
45
  }) === 0;
48
46
  return [props, {
49
47
  style: {
50
- marginRight: "".concat(isFirstCell && cell.row.depth > 0 ? "-".concat(marginLeft * (cell.row.depth + 1), "px") : '')
48
+ marginRight: "".concat(isFirstCell && cell.row.depth > 0 ? "".concat(-32 * cell.row.depth - 18, "px") : '')
51
49
  }
52
50
  }];
53
51
  };
@@ -1,16 +1,20 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
8
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _react = _interopRequireDefault(require("react"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _react = _interopRequireWildcard(require("react"));
10
12
  var _classnames = _interopRequireDefault(require("classnames"));
11
13
  var _commonColumnIds = require("./common-column-ids");
12
14
  var _DatagridSelectAllWithToggle = _interopRequireDefault(require("./Datagrid/DatagridSelectAllWithToggle"));
13
15
  var _settings = require("../../settings");
16
+ 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); }
17
+ 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; }
14
18
  /*
15
19
  * Licensed Materials - Property of IBM
16
20
  * 5724-Q36
@@ -44,6 +48,19 @@ var useSelectAllWithToggleComponent = function useSelectAllWithToggleComponent(h
44
48
  hooks.useInstance.push(useInstance);
45
49
  };
46
50
  var useAddClassNameToSelectRow = function useAddClassNameToSelectRow(hooks) {
51
+ var _useState = (0, _react.useState)(window.innerWidth),
52
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
53
+ windowSize = _useState2[0],
54
+ setWindowSize = _useState2[1];
55
+ (0, _react.useLayoutEffect)(function () {
56
+ function updateSize() {
57
+ setWindowSize(window.innerWidth);
58
+ }
59
+ window.addEventListener('resize', updateSize);
60
+ return function () {
61
+ return window.removeEventListener('resize', updateSize);
62
+ };
63
+ }, []);
47
64
  hooks.getCellProps.push(function (props, data) {
48
65
  var _columns$;
49
66
  var column = data.cell.column;
@@ -54,7 +71,7 @@ var useAddClassNameToSelectRow = function useAddClassNameToSelectRow(hooks) {
54
71
  var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
55
72
  if (column.id === _commonColumnIds.selectionColumnId && DatagridPagination) {
56
73
  return [props, {
57
- className: (0, _classnames.default)("".concat(blockClass, "__select-all-toggle-on"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft))
74
+ className: (0, _classnames.default)("".concat(blockClass, "__select-all-toggle-on"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft && windowSize > 671))
58
75
  }];
59
76
  }
60
77
  return [props];
@@ -1,21 +1,25 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
8
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
12
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
- var _react = _interopRequireDefault(require("react"));
14
+ var _react = _interopRequireWildcard(require("react"));
13
15
  var _classnames = _interopRequireDefault(require("classnames"));
14
16
  var _carbonComponentsReact = require("carbon-components-react");
15
17
  var _DatagridSelectAll = require("./Datagrid/DatagridSelectAll");
16
18
  var _commonColumnIds = require("./common-column-ids");
17
19
  var _settings = require("../../settings");
18
20
  var _excluded = ["onChange"];
21
+ 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); }
22
+ 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; }
19
23
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
20
24
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
25
  var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
@@ -71,6 +75,19 @@ var SelectRow = function SelectRow(datagridState) {
71
75
  onRadioSelect = datagridState.onRadioSelect,
72
76
  columns = datagridState.columns,
73
77
  withStickyColumn = datagridState.withStickyColumn;
78
+ var _useState = (0, _react.useState)(window.innerWidth),
79
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
80
+ windowSize = _useState2[0],
81
+ setWindowSize = _useState2[1];
82
+ (0, _react.useLayoutEffect)(function () {
83
+ function updateSize() {
84
+ setWindowSize(window.innerWidth);
85
+ }
86
+ window.addEventListener('resize', updateSize);
87
+ return function () {
88
+ return window.removeEventListener('resize', updateSize);
89
+ };
90
+ }, []);
74
91
  var selectDisabled = isFetching || row.getRowProps().selectDisabled;
75
92
  var _row$getToggleRowSele = row.getToggleRowSelectedProps(),
76
93
  onChange = _row$getToggleRowSele.onChange,
@@ -91,7 +108,7 @@ var SelectRow = function SelectRow(datagridState) {
91
108
  },
92
109
  id: "".concat(tableId, "-").concat(row.index),
93
110
  name: "".concat(tableId, "-").concat(row.index, "-name"),
94
- className: (0, _classnames.default)("".concat(blockClass, "__checkbox-cell"), cellProps.className, (0, _defineProperty2.default)({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), isFirstColumnStickyLeft)),
111
+ className: (0, _classnames.default)("".concat(blockClass, "__checkbox-cell"), cellProps.className, (0, _defineProperty2.default)({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), isFirstColumnStickyLeft && windowSize > 671)),
95
112
  ariaLabel: "".concat(tableId, "-row-").concat(row.index) // TODO: aria label should be i18n'ed
96
113
  ,
97
114
  disabled: selectDisabled
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
10
  var _react = require("react");
10
11
  var _debounce = _interopRequireDefault(require("lodash/debounce"));
11
12
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -19,8 +20,21 @@ var OFFSET_SCROLL_CLASS = "".concat(styleClassPrefix, "-offset-scroll");
19
20
  var useStickyColumn = function useStickyColumn(hooks) {
20
21
  var tableBodyRef = (0, _react.useRef)();
21
22
  var stickyHeaderCellRef = (0, _react.useRef)();
22
- hooks.getCellProps.push(changeProps.bind(null, 'cell', null));
23
- hooks.getHeaderProps.push(changeProps.bind(null, 'header', stickyHeaderCellRef));
23
+ var _useState = (0, _react.useState)(window.innerWidth),
24
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
25
+ windowSize = _useState2[0],
26
+ setWindowSize = _useState2[1];
27
+ (0, _react.useLayoutEffect)(function () {
28
+ function updateSize() {
29
+ setWindowSize(window.innerWidth);
30
+ }
31
+ window.addEventListener('resize', updateSize);
32
+ return function () {
33
+ return window.removeEventListener('resize', updateSize);
34
+ };
35
+ }, []);
36
+ hooks.getCellProps.push(changeProps.bind(null, 'cell', null, windowSize));
37
+ hooks.getHeaderProps.push(changeProps.bind(null, 'header', stickyHeaderCellRef, windowSize));
24
38
  hooks.getTableBodyProps.push(addTableBodyProps.bind(null, tableBodyRef));
25
39
  hooks.getHeaderGroupProps.push(function (props) {
26
40
  return [props, {
@@ -114,7 +128,7 @@ var addTableBodyProps = function addTableBodyProps(tableBodyRef, props) {
114
128
  ref: tableBodyRef
115
129
  }];
116
130
  };
117
- var changeProps = function changeProps(elementName, headerCellRef, props, data) {
131
+ var changeProps = function changeProps(elementName, headerCellRef, windowSize, props, data) {
118
132
  var column = data.column || data.cell.column;
119
133
  if (column.sticky === 'right') {
120
134
  var _cx;
@@ -127,7 +141,7 @@ var changeProps = function changeProps(elementName, headerCellRef, props, data)
127
141
  if (column.sticky === 'left') {
128
142
  var _data$instance, _cx2;
129
143
  return [props, _objectSpread({
130
- className: (0, _classnames.default)((_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName), true), (0, _defineProperty2.default)(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName, "--with-extra-select-column"), data === null || data === void 0 ? void 0 : (_data$instance = data.instance) === null || _data$instance === void 0 ? void 0 : _data$instance.withSelectRows), _cx2))
144
+ className: (0, _classnames.default)((_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName), true && windowSize > 671), (0, _defineProperty2.default)(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName, "--with-extra-select-column"), (data === null || data === void 0 ? void 0 : (_data$instance = data.instance) === null || _data$instance === void 0 ? void 0 : _data$instance.withSelectRows) && windowSize > 671), _cx2))
131
145
  }, headerCellRef && {
132
146
  ref: headerCellRef
133
147
  })];
@@ -101,6 +101,11 @@ var ARG_TYPES = {
101
101
  name: 'Filter props',
102
102
  control: 'object',
103
103
  description: 'This is an object for all the props passed into the filter flyout and filter panel'
104
+ },
105
+ expandedContentAlign: {
106
+ control: 'select',
107
+ options: ['flex-start', 'space-between'],
108
+ description: 'This sets the alignment of content inside expanded row.'
104
109
  }
105
110
  };
106
111
  exports.ARG_TYPES = ARG_TYPES;
@@ -27,7 +27,7 @@ var _iconsReact = require("@carbon/icons-react");
27
27
  var _ActionSet = require("../ActionSet");
28
28
  var _variants = require("./motion/variants");
29
29
  var _excluded = ["actionToolbarButtons", "actions", "animateTitle", "children", "className", "closeIconDescription", "condensedActions", "currentStep", "includeOverlay", "labelText", "navigationBackIconDescription", "onNavigationBack", "onRequestClose", "onUnmount", "open", "placement", "preventCloseOnClickOutside", "selectorPageContent", "selectorPrimaryFocus", "size", "slideIn", "subtitle", "title"],
30
- _excluded2 = ["label", "kind", "icon", "leading", "disabled", "className", "onClick"];
30
+ _excluded2 = ["label", "kind", "icon", "tooltipPosition", "tooltipAlignment", "leading", "disabled", "className", "onClick"];
31
31
  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); }
32
32
  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
33
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -400,6 +400,8 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
400
400
  var label = _ref5.label,
401
401
  kind = _ref5.kind,
402
402
  icon = _ref5.icon,
403
+ tooltipPosition = _ref5.tooltipPosition,
404
+ tooltipAlignment = _ref5.tooltipAlignment,
403
405
  leading = _ref5.leading,
404
406
  disabled = _ref5.disabled,
405
407
  className = _ref5.className,
@@ -411,8 +413,8 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
411
413
  size: "small",
412
414
  renderIcon: icon,
413
415
  iconDescription: label,
414
- tooltipPosition: "bottom",
415
- tooltipAlignment: "center",
416
+ tooltipPosition: tooltipPosition || 'bottom',
417
+ tooltipAlignment: tooltipAlignment || 'center',
416
418
  hasIconOnly: !leading,
417
419
  disabled: disabled,
418
420
  className: (0, _classnames.default)(["".concat(blockClass, "__action-toolbar-button"), className, (_ref6 = {}, (0, _defineProperty2.default)(_ref6, "".concat(blockClass, "__action-toolbar-icon-only-button"), icon && !leading), (0, _defineProperty2.default)(_ref6, "".concat(blockClass, "__action-toolbar-leading-button"), leading), _ref6)]),
@@ -494,13 +496,18 @@ SidePanel.propTypes = {
494
496
  leading: _propTypes.default.bool,
495
497
  icon: _propTypes.default.object,
496
498
  onClick: _propTypes.default.func,
497
- kind: _propTypes.default.oneOf(['ghost', 'tertiary', 'secondary', 'primary'])
499
+ kind: _propTypes.default.oneOf(['ghost', 'tertiary', 'secondary', 'primary']),
500
+ tooltipAlignment: _propTypes.default.oneOf(['top', 'right', 'bottom', 'left']),
501
+ tooltipPosition: _propTypes.default.oneOf(['start', 'center', 'end'])
498
502
  })),
499
503
  /**
500
504
  * The primary actions to be shown in the side panel. Each action is
501
505
  * specified as an object with optional fields: 'label' to supply the button
502
506
  * label, 'kind' to select the button kind (must be 'primary', 'secondary' or
503
- * 'ghost'), 'loading' to display a loading indicator, and 'onClick' to
507
+ * 'ghost'), 'tooltipPosition' to select where the tooltip is placed around
508
+ * the button (must be 'top', 'right', 'bottom', or 'left'), 'tooltipAlignment'
509
+ * to select how the tooltip is aligned with the button (must be 'start',
510
+ * 'center', or 'end', 'loading' to display a loading indicator, and 'onClick' to
504
511
  * receive notifications when the button is clicked. Additional fields in the
505
512
  * object will be passed to the Button component, and these can include
506
513
  * 'disabled', 'ref', 'className', and any other Button props. Any other
@@ -511,6 +518,8 @@ SidePanel.propTypes = {
511
518
  */
512
519
  actions: (0, _propsHelper.allPropTypes)([_ActionSet.ActionSet.validateActions(), _propTypes.default.arrayOf(_propTypes.default.shape(_objectSpread(_objectSpread({}, _carbonComponentsReact.Button.propTypes), {}, {
513
520
  kind: _propTypes.default.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
521
+ tooltipPosition: _propTypes.default.oneOf(['top', 'right', 'bottom', 'left']),
522
+ tooltipAlignment: _propTypes.default.oneOf(['start', 'center', 'end']),
514
523
  label: _propTypes.default.string,
515
524
  loading: _propTypes.default.bool,
516
525
  // we duplicate this Button prop to improve the DocGen here
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.46.1",
4
+ "version": "1.47.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -61,7 +61,7 @@
61
61
  "fs-extra": "^11.1.0",
62
62
  "glob": "^8.1.0",
63
63
  "jest": "^29.4.2",
64
- "jest-config-ibm-cloud-cognitive": "^0.24.13",
64
+ "jest-config-ibm-cloud-cognitive": "^0.24.14",
65
65
  "jest-environment-jsdom": "^29.4.2",
66
66
  "namor": "^1.1.2",
67
67
  "npm-check-updates": "^16.7.4",
@@ -89,11 +89,11 @@
89
89
  "@carbon/motion": "^10.29.0",
90
90
  "@carbon/themes": "^10.55.1",
91
91
  "@carbon/type": "^10.45.1",
92
- "carbon-components": "^10.58.5",
93
- "carbon-components-react": "^7.59.5",
92
+ "carbon-components": "^10.58.6",
93
+ "carbon-components-react": "^7.59.6",
94
94
  "carbon-icons": "^7.0.7",
95
95
  "react": "^16.8.6 || ^17.0.1",
96
96
  "react-dom": "^16.8.6 || ^17.0.1"
97
97
  },
98
- "gitHead": "34e1d580adb4bb2e670bf0b3cde042a697c7204f"
98
+ "gitHead": "fa80a91ae0247e4a7be80e31fe13dc43dcff0ba0"
99
99
  }
@@ -108,3 +108,29 @@ $block-class: #{$pkg-prefix}--datagrid;
108
108
  // stylelint-disable-next-line carbon/type-token-use
109
109
  font-size: 0;
110
110
  }
111
+
112
+ .#{$block-class} .expanded-content {
113
+ display: flex;
114
+ }
115
+
116
+ .expanded-content__title {
117
+ padding-bottom: $spacing-05;
118
+ }
119
+
120
+ .expanded-content__row {
121
+ display: flex;
122
+ }
123
+
124
+ .expanded-content__row span {
125
+ flex: 0 1 50%;
126
+ }
127
+
128
+ .expanded-content__row span:first-child:not(:last-child) {
129
+ margin-right: $spacing-05;
130
+ color: $text-secondary;
131
+ }
132
+
133
+ .expanded-content__child:not(:last-child) {
134
+ flex: 0 1 calc($spacing-05 * 30);
135
+ margin-right: $spacing-07;
136
+ }
@@ -35,6 +35,7 @@
35
35
  align-items: center;
36
36
  color: $text-01;
37
37
  }
38
+
38
39
  .#{$block-class}__head-select-all.#{$block-class}__checkbox-cell.#{$block-class}__checkbox-cell-sticky-left {
39
40
  position: sticky;
40
41
  z-index: 1;
@@ -46,6 +47,7 @@
46
47
  align-items: center;
47
48
  padding-top: 0;
48
49
  padding-bottom: 0;
50
+
49
51
  &.#{$block-class}__cell--spacer {
50
52
  padding: 0;
51
53
  }
@@ -61,6 +63,7 @@
61
63
  align-items: center;
62
64
  padding-top: 0;
63
65
  }
66
+
64
67
  &.#{$block-class}__checkbox-cell-sticky-left {
65
68
  position: sticky;
66
69
  left: 0;
@@ -146,6 +149,7 @@
146
149
  }
147
150
  }
148
151
  }
152
+
149
153
  .#{$block-class}__grid-container::-webkit-scrollbar-thumb {
150
154
  background-color: $text-03;
151
155
  }
@@ -154,6 +158,7 @@
154
158
  width: 6px;
155
159
  background-color: $ui-background;
156
160
  }
161
+
157
162
  .#{$block-class}__grid-container {
158
163
  display: block;
159
164
  width: 100%;
@@ -246,7 +251,9 @@
246
251
  td.#{$carbon-prefix}--table-column-checkbox,
247
252
  th.#{$carbon-prefix}--table-column-checkbox {
248
253
  /* stylelint-disable-next-line declaration-no-important */
249
- padding-right: $spacing-06 !important;
254
+ width: $spacing-09 !important;
255
+ /* stylelint-disable-next-line declaration-no-important */
256
+ padding-right: $spacing-05 !important;
250
257
  }
251
258
  }
252
259
 
@@ -318,7 +325,8 @@
318
325
  }
319
326
 
320
327
  .#{$block-class}__head-hidden-select-all {
321
- padding-right: $spacing-08;
328
+ padding-right: $spacing-09;
329
+
322
330
  &.#{$block-class}__select-all-sticky-left {
323
331
  position: sticky;
324
332
  z-index: 1;
@@ -360,6 +368,14 @@
360
368
  width: 100% !important;
361
369
  }
362
370
 
371
+ .#{$block-class}__sticky thead {
372
+ display: flex;
373
+
374
+ tr.#{$block-class}__sticky {
375
+ width: auto;
376
+ }
377
+ }
378
+
363
379
  .#{block-class}__displayFlex {
364
380
  position: relative;
365
381
  display: flex;
@@ -417,6 +433,7 @@
417
433
 
418
434
  .#{$block-class}__carbon-row-expanded {
419
435
  position: relative;
436
+
420
437
  &.#{$block-class}__carbon-row-expanded-hover-active::before {
421
438
  position: absolute;
422
439
  z-index: 2;
@@ -428,7 +445,7 @@
428
445
  );
429
446
  width: 1px;
430
447
  height: var(--#{$block-class}--indicator-height);
431
- border-left: 1px solid $interactive-01;
448
+ border-left: 1px solid $active-ui;
432
449
  content: '';
433
450
  }
434
451
  }
@@ -451,6 +468,7 @@
451
468
  flex: 1 0 auto;
452
469
  align-items: flex-end;
453
470
  }
471
+
454
472
  .#{$carbon-prefix}--table-toolbar {
455
473
  background: transparent;
456
474
  }
@@ -525,6 +543,7 @@
525
543
  justify-content: center;
526
544
  padding: 0;
527
545
  margin: 0;
546
+
528
547
  .#{$carbon-prefix}--btn__icon {
529
548
  margin: 0;
530
549
  }
@@ -392,6 +392,10 @@ $row-heights: (
392
392
  outline-color: $support-01;
393
393
  }
394
394
 
395
+ .#{$block-class} .#{$carbon-prefix}--text-input:focus {
396
+ background: $field-01;
397
+ }
398
+
395
399
  .#{$block-class}
396
400
  .#{$block-class}__inline-edit--outer-cell-button--invalid
397
401
  .#{$carbon-prefix}--number
@@ -46,3 +46,20 @@
46
46
  background-color: $border-subtle;
47
47
  content: '';
48
48
  }
49
+
50
+ .#{$block-class} tr.#{$block-class}__carbon-nested-row {
51
+ td:first-child:empty,
52
+ .#{$block-class}__expandable-row-cell {
53
+ border-bottom: none;
54
+ }
55
+ }
56
+
57
+ .#{$carbon-prefix}--data-table td.#{$block-class}__expandable-row-cell {
58
+ padding-left: $spacing-03;
59
+ }
60
+
61
+ .#{$block-class}__carbon-row-expanded {
62
+ .#{$block-class}__expandable-row-cell {
63
+ border-bottom: none;
64
+ }
65
+ }
@@ -8,15 +8,18 @@
8
8
 
9
9
  @import './variables';
10
10
 
11
- th.#{$block-class}__select-all-toggle-on,
12
- td.#{$block-class}__select-all-toggle-on {
13
- /* stylelint-disable-next-line declaration-no-important */
14
- width: 4.5rem !important;
15
- /* stylelint-disable-next-line declaration-no-important */
16
- min-width: initial !important;
17
- box-sizing: border-box;
18
- flex: 0 0 auto;
11
+ .#{$block-class}__grid-container {
12
+ th.#{$block-class}__select-all-toggle-on,
13
+ td.#{$block-class}__select-all-toggle-on {
14
+ /* stylelint-disable-next-line declaration-no-important */
15
+ width: 4.5rem !important;
16
+ /* stylelint-disable-next-line declaration-no-important */
17
+ min-width: initial !important;
18
+ box-sizing: border-box;
19
+ flex: 0 0 auto;
20
+ }
19
21
  }
22
+
20
23
  th.#{$block-class}__select-all-toggle-on {
21
24
  display: flex;
22
25
  align-items: center;
@@ -14,7 +14,7 @@
14
14
  right: 0;
15
15
  display: flex;
16
16
  align-items: center;
17
- border-left: 1px solid $ui-03;
17
+ border-left: 1px solid $active-light-ui;
18
18
  }
19
19
 
20
20
  .#{$block-class}__right-sticky-column-header {
@@ -29,7 +29,7 @@
29
29
  left: 0;
30
30
  display: flex;
31
31
  align-items: center;
32
- border-right: 1px solid $ui-03;
32
+ border-right: 1px solid $active-light-ui;
33
33
  }
34
34
 
35
35
  .#{$block-class}__left-sticky-column-header {
@@ -41,7 +41,7 @@
41
41
 
42
42
  .#{$block-class}__left-sticky-column-cell.#{$block-class}__left-sticky-column-cell--with-extra-select-column,
43
43
  .#{$block-class}__left-sticky-column-header.#{$block-class}__left-sticky-column-header--with-extra-select-column {
44
- left: $spacing-08;
44
+ left: $spacing-09;
45
45
  }
46
46
 
47
47
  .#{$block-class}__sticky-noShadow {
@@ -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.
@@ -23,10 +23,11 @@
23
23
 
24
24
  .#{$block-class}__header {
25
25
  @include carbon--type-style('productive-heading-03');
26
- // stylelint-disable-next-line carbon/layout-token-use
27
- padding-bottom: calc($spacing-01 + $spacing-02);
26
+
27
+ padding-bottom: $spacing-03;
28
28
  margin: 0;
29
29
  }
30
+
30
31
  .#{$block-class}__subtitle {
31
32
  @include carbon--type-style('body-long-01');
32
33
 
@@ -155,6 +155,10 @@
155
155
  margin: 0;
156
156
  }
157
157
 
158
+ &.#{$block-class}--narrow .#{$block-class}__header-description {
159
+ max-width: 80%;
160
+ }
161
+
158
162
  &.#{$block-class}--wide .#{$block-class}__header--with-close-icon {
159
163
  padding-right: $spacing-10;
160
164
  }