@carbon/ibm-products 1.11.0 → 1.11.1
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.
- package/css/index-full-carbon.css +173 -188
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +5 -5
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +11 -0
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +2 -2
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +26 -182
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +3 -3
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +143 -182
- package/css/index.css.map +1 -1
- package/css/index.min.css +4 -4
- package/css/index.min.css.map +1 -1
- package/es/components/AddSelect/AddSelectColumn.js +58 -21
- package/es/components/AddSelect/AddSelectList.js +5 -5
- package/es/components/AddSelect/AddSelectSidebar.js +2 -1
- package/es/components/ButtonMenu/ButtonMenu.js +11 -3
- package/es/components/index.js +0 -1
- package/es/global/js/package-settings.js +1 -2
- package/lib/components/AddSelect/AddSelectColumn.js +57 -20
- package/lib/components/AddSelect/AddSelectList.js +5 -5
- package/lib/components/AddSelect/AddSelectSidebar.js +2 -1
- package/lib/components/ButtonMenu/ButtonMenu.js +11 -3
- package/lib/components/index.js +0 -8
- package/lib/global/js/package-settings.js +1 -2
- package/package.json +13 -13
- package/scss/components/AddSelect/_add-select.scss +4 -0
- package/scss/components/InlineEdit/_inline-edit.scss +4 -0
- package/scss/components/ModifiedTabs/_modified-tabs.scss +5 -0
- package/scss/components/NotificationsPanel/_notifications-panel.scss +7 -3
- package/scss/components/Tearsheet/_tearsheet.scss +4 -0
- package/scss/components/_index.scss +0 -1
- package/es/components/LoadingBar/LoadingBar.js +0 -156
- package/es/components/LoadingBar/index.js +0 -7
- package/lib/components/LoadingBar/LoadingBar.js +0 -170
- package/lib/components/LoadingBar/index.js +0 -13
- package/scss/components/LoadingBar/_index.scss +0 -8
- package/scss/components/LoadingBar/_loading-bar.scss +0 -224
- package/scss/components/LoadingBar/_storybook-styles.scss +0 -14
@@ -1,6 +1,6 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
-
var _excluded = ["children", "className", "iconDescription", "label", "menuOptionsClass", "renderIcon", "size"];
|
3
|
+
var _excluded = ["children", "className", "iconDescription", "kind", "label", "menuOptionsClass", "renderIcon", "size"];
|
4
4
|
|
5
5
|
/**
|
6
6
|
* Copyright IBM Corp. 2021, 2021
|
@@ -22,7 +22,8 @@ var componentName = 'ButtonMenu'; // NOTE: the component SCSS is not imported he
|
|
22
22
|
// Default values for props
|
23
23
|
|
24
24
|
var defaults = {
|
25
|
-
size: 'default'
|
25
|
+
size: 'default',
|
26
|
+
kind: 'primary'
|
26
27
|
};
|
27
28
|
/**
|
28
29
|
* Combining a standard button with an overflow menu, this component appears
|
@@ -36,6 +37,8 @@ export var ButtonMenu = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
36
37
|
var children = _ref.children,
|
37
38
|
className = _ref.className,
|
38
39
|
iconDescription = _ref.iconDescription,
|
40
|
+
_ref$kind = _ref.kind,
|
41
|
+
kind = _ref$kind === void 0 ? defaults.kind : _ref$kind,
|
39
42
|
label = _ref.label,
|
40
43
|
menuOptionsClass = _ref.menuOptionsClass,
|
41
44
|
Icon = _ref.renderIcon,
|
@@ -50,7 +53,7 @@ export var ButtonMenu = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
50
53
|
menuOptionsClass: cx("".concat(blockClass, "__options"), menuOptionsClass),
|
51
54
|
renderIcon: function renderIcon() {
|
52
55
|
return /*#__PURE__*/React.createElement("div", {
|
53
|
-
className: cx(["".concat(blockClass, "__trigger"), "".concat(carbon.prefix, "--btn"), "".concat(carbon.prefix, "--btn--
|
56
|
+
className: cx(["".concat(blockClass, "__trigger"), "".concat(carbon.prefix, "--btn"), "".concat(carbon.prefix, "--btn--").concat(kind), "".concat(carbon.prefix, "--btn--").concat(size)])
|
54
57
|
}, label, Icon && /*#__PURE__*/React.createElement(Icon, {
|
55
58
|
"aria-hidden": "true",
|
56
59
|
"aria-label": iconDescription,
|
@@ -86,6 +89,11 @@ ButtonMenu.propTypes = {
|
|
86
89
|
*/
|
87
90
|
iconDescription: Button.propTypes.iconDescription,
|
88
91
|
|
92
|
+
/**
|
93
|
+
* The three types the menu button supports: primary, tertiary and ghost.
|
94
|
+
*/
|
95
|
+
kind: PropTypes.oneOf(['primary', 'tertiary', 'ghost']),
|
96
|
+
|
89
97
|
/**
|
90
98
|
* The button label for the menu trigger.
|
91
99
|
*/
|
package/es/components/index.js
CHANGED
@@ -18,7 +18,6 @@ export { ExportModal } from './ExportModal';
|
|
18
18
|
export { ExpressiveCard } from './ExpressiveCard';
|
19
19
|
export { HTTPError403, HTTPError404, HTTPErrorOther } from './HTTPErrors';
|
20
20
|
export { ImportModal } from './ImportModal';
|
21
|
-
export { LoadingBar } from './LoadingBar';
|
22
21
|
export { ModifiedTabs } from './ModifiedTabs';
|
23
22
|
export { MultiAddSelect } from './MultiAddSelect';
|
24
23
|
export { NotificationsPanel } from './NotificationsPanel';
|
@@ -40,6 +40,7 @@ var defaults = {
|
|
40
40
|
NoTagsEmptyState: true,
|
41
41
|
NotFoundEmptyState: true,
|
42
42
|
NotificationsEmptyState: true,
|
43
|
+
OptionsTile: true,
|
43
44
|
PageHeader: true,
|
44
45
|
ProductiveCard: true,
|
45
46
|
RemoveModal: true,
|
@@ -54,14 +55,12 @@ var defaults = {
|
|
54
55
|
// other public components not yet reviewed and released:
|
55
56
|
MultiAddSelect: false,
|
56
57
|
SingleAddSelect: false,
|
57
|
-
LoadingBar: false,
|
58
58
|
ModifiedTabs: false,
|
59
59
|
Toolbar: false,
|
60
60
|
ToolbarButton: false,
|
61
61
|
ToolbarGroup: false,
|
62
62
|
WebTerminal: false,
|
63
63
|
EditSidePanel: false,
|
64
|
-
OptionsTile: false,
|
65
64
|
CancelableTextEdit: false,
|
66
65
|
InlineEdit: false,
|
67
66
|
DataSpreadsheet: false
|
@@ -31,7 +31,7 @@ var _AddSelectList = require("./AddSelectList");
|
|
31
31
|
|
32
32
|
var _uuidv = _interopRequireDefault(require("../../global/js/utils/uuidv4"));
|
33
33
|
|
34
|
-
var _excluded = ["columnInputPlaceholder", "filteredItems", "header"];
|
34
|
+
var _excluded = ["columnInputPlaceholder", "filteredItems", "header", "multiSelection", "setMultiSelection"];
|
35
35
|
|
36
36
|
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); }
|
37
37
|
|
@@ -45,30 +45,43 @@ var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
45
45
|
var columnInputPlaceholder = _ref.columnInputPlaceholder,
|
46
46
|
filteredItems = _ref.filteredItems,
|
47
47
|
header = _ref.header,
|
48
|
+
multiSelection = _ref.multiSelection,
|
49
|
+
setMultiSelection = _ref.setMultiSelection,
|
48
50
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
49
51
|
|
50
|
-
var _useState = (0, _react.useState)(
|
52
|
+
var _useState = (0, _react.useState)(false),
|
51
53
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
52
|
-
|
53
|
-
|
54
|
+
allSelected = _useState2[0],
|
55
|
+
setAllSelected = _useState2[1];
|
54
56
|
|
55
57
|
var _useState3 = (0, _react.useState)(''),
|
56
58
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
57
|
-
|
58
|
-
|
59
|
+
searchTerm = _useState4[0],
|
60
|
+
setSearchTerm = _useState4[1];
|
59
61
|
|
60
62
|
var _useState5 = (0, _react.useState)(''),
|
61
63
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
62
|
-
|
63
|
-
|
64
|
+
sortDirection = _useState6[0],
|
65
|
+
setSortDirection = _useState6[1];
|
64
66
|
|
65
|
-
var _useState7 = (0, _react.useState)(
|
67
|
+
var _useState7 = (0, _react.useState)(''),
|
66
68
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
67
|
-
|
68
|
-
|
69
|
+
sortAttribute = _useState8[0],
|
70
|
+
setSortAttribute = _useState8[1];
|
71
|
+
|
72
|
+
var _useState9 = (0, _react.useState)([]),
|
73
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
74
|
+
filters = _useState10[0],
|
75
|
+
setFilters = _useState10[1];
|
69
76
|
|
70
77
|
var blockClass = "".concat(_settings.pkg.prefix, "--add-select");
|
71
|
-
var colClass = "".concat(blockClass, "__column");
|
78
|
+
var colClass = "".concat(blockClass, "__column");
|
79
|
+
(0, _react.useEffect)(function () {
|
80
|
+
var isAllSelected = filteredItems.every(function (item) {
|
81
|
+
return multiSelection.includes(item.id);
|
82
|
+
});
|
83
|
+
setAllSelected(isAllSelected);
|
84
|
+
}, [filteredItems, multiSelection]); // sorting
|
72
85
|
|
73
86
|
var colSortBy = (_filteredItems$find = filteredItems.find(function (item) {
|
74
87
|
return item.sortBy;
|
@@ -102,6 +115,21 @@ var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
102
115
|
setSortDirection(direction);
|
103
116
|
};
|
104
117
|
|
118
|
+
var selectAllHandler = function selectAllHandler(checked) {
|
119
|
+
var itemIds = filteredItems.map(function (item) {
|
120
|
+
return item.id;
|
121
|
+
});
|
122
|
+
|
123
|
+
if (checked) {
|
124
|
+
setMultiSelection([].concat((0, _toConsumableArray2.default)(multiSelection), (0, _toConsumableArray2.default)(itemIds)));
|
125
|
+
} else {
|
126
|
+
var newItems = multiSelection.filter(function (i) {
|
127
|
+
return !itemIds.includes(i);
|
128
|
+
});
|
129
|
+
setMultiSelection(newItems);
|
130
|
+
}
|
131
|
+
};
|
132
|
+
|
105
133
|
var filterHandler = function filterHandler(checked, opt) {
|
106
134
|
if (checked) {
|
107
135
|
var newFilters = [].concat((0, _toConsumableArray2.default)(filters), [opt]);
|
@@ -199,14 +227,21 @@ var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
199
227
|
})));
|
200
228
|
})))), /*#__PURE__*/_react.default.createElement("div", {
|
201
229
|
className: "".concat(blockClass, "__tag-container")
|
202
|
-
}, /*#__PURE__*/_react.default.createElement(
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
230
|
+
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Checkbox, {
|
231
|
+
id: "".concat((0, _uuidv.default)(), "-select-all"),
|
232
|
+
checked: allSelected,
|
233
|
+
onChange: selectAllHandler,
|
234
|
+
labelText: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
235
|
+
className: "".concat(blockClass, "__tag-container-label")
|
236
|
+
}, header), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Tag, {
|
237
|
+
type: "gray",
|
238
|
+
size: "sm"
|
239
|
+
}, colItems.length))
|
240
|
+
})), /*#__PURE__*/_react.default.createElement(_AddSelectList.AddSelectList, (0, _extends2.default)({}, props, {
|
208
241
|
inColumn: true,
|
209
|
-
filteredItems: colItems
|
242
|
+
filteredItems: colItems,
|
243
|
+
setMultiSelection: setMultiSelection,
|
244
|
+
multiSelection: multiSelection
|
210
245
|
})));
|
211
246
|
};
|
212
247
|
|
@@ -214,6 +249,8 @@ exports.AddSelectColumn = AddSelectColumn;
|
|
214
249
|
AddSelectColumn.propTypes = {
|
215
250
|
columnInputPlaceholder: _propTypes.default.string,
|
216
251
|
filteredItems: _propTypes.default.array,
|
217
|
-
header: _propTypes.default.string
|
252
|
+
header: _propTypes.default.string,
|
253
|
+
multiSelection: _propTypes.default.array,
|
254
|
+
setMultiSelection: _propTypes.default.func
|
218
255
|
};
|
219
256
|
AddSelectColumn.displayName = componentName;
|
@@ -43,13 +43,13 @@ var AddSelectList = function AddSelectList(_ref) {
|
|
43
43
|
setSingleSelection(value);
|
44
44
|
};
|
45
45
|
|
46
|
-
var handleMultiSelection = function handleMultiSelection(
|
46
|
+
var handleMultiSelection = function handleMultiSelection(id, checked) {
|
47
47
|
if (checked) {
|
48
|
-
var newValues = [].concat((0, _toConsumableArray2.default)(multiSelection), [
|
48
|
+
var newValues = [].concat((0, _toConsumableArray2.default)(multiSelection), [id]);
|
49
49
|
setMultiSelection(newValues);
|
50
50
|
} else {
|
51
51
|
var _newValues = multiSelection.filter(function (v) {
|
52
|
-
return v !==
|
52
|
+
return v !== id;
|
53
53
|
});
|
54
54
|
|
55
55
|
setMultiSelection(_newValues);
|
@@ -128,8 +128,8 @@ var AddSelectList = function AddSelectList(_ref) {
|
|
128
128
|
className: "".concat(blockClass, "-cell-wrapper")
|
129
129
|
}, multi ? /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Checkbox, {
|
130
130
|
className: "".concat(blockClass, "-checkbox"),
|
131
|
-
onChange: function onChange(
|
132
|
-
return handleMultiSelection(item.id,
|
131
|
+
onChange: function onChange(checked) {
|
132
|
+
return handleMultiSelection(item.id, checked);
|
133
133
|
},
|
134
134
|
labelText: !inColumn ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
|
135
135
|
className: "".concat(blockClass, "-cell-title")
|
@@ -70,7 +70,8 @@ var AddSelectSidebar = function AddSelectSidebar(_ref) {
|
|
70
70
|
return handleItemRemove(id);
|
71
71
|
},
|
72
72
|
kind: "ghost",
|
73
|
-
className: "".concat(blockClass, "-item-remove-button")
|
73
|
+
className: "".concat(blockClass, "-item-remove-button"),
|
74
|
+
size: "sm"
|
74
75
|
}));
|
75
76
|
};
|
76
77
|
|
@@ -21,14 +21,15 @@ var _settings = require("../../settings");
|
|
21
21
|
|
22
22
|
var _carbonComponentsReact = require("carbon-components-react");
|
23
23
|
|
24
|
-
var _excluded = ["children", "className", "iconDescription", "label", "menuOptionsClass", "renderIcon", "size"];
|
24
|
+
var _excluded = ["children", "className", "iconDescription", "kind", "label", "menuOptionsClass", "renderIcon", "size"];
|
25
25
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
26
26
|
var blockClass = "".concat(_settings.pkg.prefix, "--button-menu");
|
27
27
|
var componentName = 'ButtonMenu'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
28
28
|
// Default values for props
|
29
29
|
|
30
30
|
var defaults = {
|
31
|
-
size: 'default'
|
31
|
+
size: 'default',
|
32
|
+
kind: 'primary'
|
32
33
|
};
|
33
34
|
/**
|
34
35
|
* Combining a standard button with an overflow menu, this component appears
|
@@ -42,6 +43,8 @@ var ButtonMenu = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
42
43
|
var children = _ref.children,
|
43
44
|
className = _ref.className,
|
44
45
|
iconDescription = _ref.iconDescription,
|
46
|
+
_ref$kind = _ref.kind,
|
47
|
+
kind = _ref$kind === void 0 ? defaults.kind : _ref$kind,
|
45
48
|
label = _ref.label,
|
46
49
|
menuOptionsClass = _ref.menuOptionsClass,
|
47
50
|
Icon = _ref.renderIcon,
|
@@ -55,7 +58,7 @@ var ButtonMenu = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
55
58
|
menuOptionsClass: (0, _classnames.default)("".concat(blockClass, "__options"), menuOptionsClass),
|
56
59
|
renderIcon: function renderIcon() {
|
57
60
|
return /*#__PURE__*/_react.default.createElement("div", {
|
58
|
-
className: (0, _classnames.default)(["".concat(blockClass, "__trigger"), "".concat(_settings.carbon.prefix, "--btn"), "".concat(_settings.carbon.prefix, "--btn--
|
61
|
+
className: (0, _classnames.default)(["".concat(blockClass, "__trigger"), "".concat(_settings.carbon.prefix, "--btn"), "".concat(_settings.carbon.prefix, "--btn--").concat(kind), "".concat(_settings.carbon.prefix, "--btn--").concat(size)])
|
59
62
|
}, label, Icon && /*#__PURE__*/_react.default.createElement(Icon, {
|
60
63
|
"aria-hidden": "true",
|
61
64
|
"aria-label": iconDescription,
|
@@ -93,6 +96,11 @@ ButtonMenu.propTypes = {
|
|
93
96
|
*/
|
94
97
|
iconDescription: _carbonComponentsReact.Button.propTypes.iconDescription,
|
95
98
|
|
99
|
+
/**
|
100
|
+
* The three types the menu button supports: primary, tertiary and ghost.
|
101
|
+
*/
|
102
|
+
kind: _propTypes.default.oneOf(['primary', 'tertiary', 'ghost']),
|
103
|
+
|
96
104
|
/**
|
97
105
|
* The button label for the menu trigger.
|
98
106
|
*/
|
package/lib/components/index.js
CHANGED
@@ -147,12 +147,6 @@ Object.defineProperty(exports, "InlineEdit", {
|
|
147
147
|
return _InlineEdit.InlineEdit;
|
148
148
|
}
|
149
149
|
});
|
150
|
-
Object.defineProperty(exports, "LoadingBar", {
|
151
|
-
enumerable: true,
|
152
|
-
get: function get() {
|
153
|
-
return _LoadingBar.LoadingBar;
|
154
|
-
}
|
155
|
-
});
|
156
150
|
Object.defineProperty(exports, "ModifiedTabs", {
|
157
151
|
enumerable: true,
|
158
152
|
get: function get() {
|
@@ -326,8 +320,6 @@ var _HTTPErrors = require("./HTTPErrors");
|
|
326
320
|
|
327
321
|
var _ImportModal = require("./ImportModal");
|
328
322
|
|
329
|
-
var _LoadingBar = require("./LoadingBar");
|
330
|
-
|
331
323
|
var _ModifiedTabs = require("./ModifiedTabs");
|
332
324
|
|
333
325
|
var _MultiAddSelect = require("./MultiAddSelect");
|
@@ -44,6 +44,7 @@ var defaults = {
|
|
44
44
|
NoTagsEmptyState: true,
|
45
45
|
NotFoundEmptyState: true,
|
46
46
|
NotificationsEmptyState: true,
|
47
|
+
OptionsTile: true,
|
47
48
|
PageHeader: true,
|
48
49
|
ProductiveCard: true,
|
49
50
|
RemoveModal: true,
|
@@ -58,14 +59,12 @@ var defaults = {
|
|
58
59
|
// other public components not yet reviewed and released:
|
59
60
|
MultiAddSelect: false,
|
60
61
|
SingleAddSelect: false,
|
61
|
-
LoadingBar: false,
|
62
62
|
ModifiedTabs: false,
|
63
63
|
Toolbar: false,
|
64
64
|
ToolbarButton: false,
|
65
65
|
ToolbarGroup: false,
|
66
66
|
WebTerminal: false,
|
67
67
|
EditSidePanel: false,
|
68
|
-
OptionsTile: false,
|
69
68
|
CancelableTextEdit: false,
|
70
69
|
InlineEdit: false,
|
71
70
|
DataSpreadsheet: false
|
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.11.
|
4
|
+
"version": "1.11.1",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -51,8 +51,8 @@
|
|
51
51
|
},
|
52
52
|
"devDependencies": {
|
53
53
|
"@babel/cli": "^7.17.6",
|
54
|
-
"@babel/core": "^7.17.
|
55
|
-
"babel-preset-ibm-cloud-cognitive": "^0.14.
|
54
|
+
"@babel/core": "^7.17.7",
|
55
|
+
"babel-preset-ibm-cloud-cognitive": "^0.14.11",
|
56
56
|
"chalk": "^4.1.2",
|
57
57
|
"change-case": "^4.1.2",
|
58
58
|
"copyfiles": "^2.4.1",
|
@@ -60,33 +60,33 @@
|
|
60
60
|
"fs-extra": "^10.0.1",
|
61
61
|
"glob": "^7.2.0",
|
62
62
|
"jest": "^27.5.1",
|
63
|
-
"jest-config-ibm-cloud-cognitive": "^0.23.
|
64
|
-
"npm-check-updates": "^12.5.
|
63
|
+
"jest-config-ibm-cloud-cognitive": "^0.23.12",
|
64
|
+
"npm-check-updates": "^12.5.4",
|
65
65
|
"npm-run-all": "^4.1.5",
|
66
66
|
"rimraf": "^3.0.2",
|
67
67
|
"sass": "^1.49.9",
|
68
68
|
"yargs": "^17.3.1"
|
69
69
|
},
|
70
70
|
"dependencies": {
|
71
|
-
"@babel/runtime": "^7.17.
|
72
|
-
"@carbon/telemetry": "^0.
|
71
|
+
"@babel/runtime": "^7.17.7",
|
72
|
+
"@carbon/telemetry": "^0.1.0",
|
73
73
|
"react-resize-detector": "^7.0.0",
|
74
74
|
"react-table": "^7.7.0",
|
75
75
|
"react-window": "^1.8.6"
|
76
76
|
},
|
77
77
|
"peerDependencies": {
|
78
78
|
"@carbon/colors": "^10.37.0",
|
79
|
-
"@carbon/icons-react": "^10.
|
79
|
+
"@carbon/icons-react": "^10.48.0",
|
80
80
|
"@carbon/import-once": "^10.7.0",
|
81
81
|
"@carbon/layout": "^10.37.0",
|
82
82
|
"@carbon/motion": "^10.29.0",
|
83
|
-
"@carbon/themes": "^10.
|
84
|
-
"@carbon/type": "^10.
|
85
|
-
"carbon-components": "^10.
|
86
|
-
"carbon-components-react": "^7.
|
83
|
+
"@carbon/themes": "^10.53.1",
|
84
|
+
"@carbon/type": "^10.43.1",
|
85
|
+
"carbon-components": "^10.55.1",
|
86
|
+
"carbon-components-react": "^7.55.1",
|
87
87
|
"carbon-icons": "^7.0.7",
|
88
88
|
"react": "^16.8.6 || ^17.0.1",
|
89
89
|
"react-dom": "^16.8.6 || ^17.0.1"
|
90
90
|
},
|
91
|
-
"gitHead": "
|
91
|
+
"gitHead": "dd67992eea35e2e7b27032bade757b9e7037fb23"
|
92
92
|
}
|
@@ -159,6 +159,10 @@
|
|
159
159
|
|
160
160
|
// overrides
|
161
161
|
|
162
|
+
.#{$block-class}__tag-container .#{$carbon-prefix}--tag {
|
163
|
+
margin: 0;
|
164
|
+
}
|
165
|
+
|
162
166
|
// the influencer sidebar needs to be even with the buttons
|
163
167
|
.#{$block-class} .#{$tearsheet-class} .#{$tearsheet-class}__influencer {
|
164
168
|
max-width: 29rem;
|
@@ -45,6 +45,11 @@
|
|
45
45
|
border-radius: 0;
|
46
46
|
cursor: pointer;
|
47
47
|
transition: background-color $duration--fast-02 motion(standard, productive);
|
48
|
+
// stylelint-disable-next-line max-nesting-depth
|
49
|
+
@media (prefers-reduced-motion: reduce) {
|
50
|
+
// stylelint-disable-next-line carbon/motion-token-use
|
51
|
+
transition: none;
|
52
|
+
}
|
48
53
|
}
|
49
54
|
|
50
55
|
.modified-tabs__tab-new-icon {
|
@@ -183,16 +183,20 @@
|
|
183
183
|
min-width: 5.5rem;
|
184
184
|
padding: 0;
|
185
185
|
|
186
|
-
|
186
|
+
.#{$carbon-prefix}--btn__icon {
|
187
187
|
transition: transform $duration--moderate-02 ease;
|
188
|
+
@media (prefers-reduced-motion: reduce) {
|
189
|
+
// stylelint-disable-next-line carbon/motion-token-use
|
190
|
+
transition: none;
|
191
|
+
}
|
188
192
|
}
|
189
193
|
&.#{$block-class}__notification-read-more-button {
|
190
|
-
|
194
|
+
.#{$carbon-prefix}--btn__icon {
|
191
195
|
transform: rotate(0deg);
|
192
196
|
}
|
193
197
|
}
|
194
198
|
&.#{$block-class}__notification-read-less-button {
|
195
|
-
|
199
|
+
.#{$carbon-prefix}--btn__icon {
|
196
200
|
transform: rotate(180deg);
|
197
201
|
}
|
198
202
|
}
|
@@ -47,6 +47,10 @@
|
|
47
47
|
transition: visibility 0s linear,
|
48
48
|
background-color $motion-duration motion(entrance, expressive),
|
49
49
|
opacity $motion-duration motion(entrance, expressive);
|
50
|
+
@media (prefers-reduced-motion: reduce) {
|
51
|
+
// stylelint-disable-next-line carbon/motion-token-use
|
52
|
+
transition: none;
|
53
|
+
}
|
50
54
|
}
|
51
55
|
|
52
56
|
&.#{$block-class}--stacked-1-of-2 {
|
@@ -1,156 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
|
-
var _excluded = ["active", "ariaLabel", "className", "id", "percentage", "percentageIndicatorText", "showPercentageIndicator", "small"];
|
5
|
-
|
6
|
-
/**
|
7
|
-
* Copyright IBM Corp. 2021, 2021
|
8
|
-
*
|
9
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
11
|
-
*/
|
12
|
-
// Import portions of React that are needed.
|
13
|
-
import React, { useEffect, useRef } from 'react'; // Other standard imports.
|
14
|
-
|
15
|
-
import PropTypes from 'prop-types';
|
16
|
-
import cx from 'classnames';
|
17
|
-
import { pkg
|
18
|
-
/*, carbon */
|
19
|
-
} from '../../settings'; // Carbon and package components we use.
|
20
|
-
|
21
|
-
/* @import(s) of carbon components and other package components. */
|
22
|
-
// The block part of our conventional BEM class names (blockClass__E--M).
|
23
|
-
|
24
|
-
var blockClass = "".concat(pkg.prefix, "--loading-bar");
|
25
|
-
var componentName = 'LoadingBar'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
26
|
-
// Default values for props
|
27
|
-
|
28
|
-
var defaults = {
|
29
|
-
active: true,
|
30
|
-
percentage: undefined,
|
31
|
-
ariaLabel: 'Active loading indicator'
|
32
|
-
};
|
33
|
-
/**
|
34
|
-
* The LoadingBar component provides a way to communicate the loading state to users.
|
35
|
-
* It is intended to fill the space of where it's used, and should persist until the
|
36
|
-
* loading action is complete. Once complete, the active prop may be set to false to
|
37
|
-
* hide the LoadingBar.
|
38
|
-
* The LoadingBar has two modes of operation: Indeterminate and Determinate.
|
39
|
-
* If no percentage is provided to the component, the LoadingBar behaves in indeterminate
|
40
|
-
* mode, with the bar moving from side to side, to indicate loading in progress.
|
41
|
-
* If a percentage prop is provided, the determinate mode of operation is used and the
|
42
|
-
* loading bar fills until the specified percentage to indicate current progress to
|
43
|
-
* the user.
|
44
|
-
*/
|
45
|
-
|
46
|
-
export var LoadingBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
47
|
-
var _cx2, _cx3;
|
48
|
-
|
49
|
-
var _ref$active = _ref.active,
|
50
|
-
active = _ref$active === void 0 ? defaults.active : _ref$active,
|
51
|
-
_ref$ariaLabel = _ref.ariaLabel,
|
52
|
-
ariaLabel = _ref$ariaLabel === void 0 ? defaults.ariaLabel : _ref$ariaLabel,
|
53
|
-
className = _ref.className,
|
54
|
-
id = _ref.id,
|
55
|
-
_ref$percentage = _ref.percentage,
|
56
|
-
percentage = _ref$percentage === void 0 ? defaults.percentage : _ref$percentage,
|
57
|
-
percentageIndicatorText = _ref.percentageIndicatorText,
|
58
|
-
showPercentageIndicator = _ref.showPercentageIndicator,
|
59
|
-
small = _ref.small,
|
60
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
61
|
-
|
62
|
-
function usePrevious(value) {
|
63
|
-
var ref = useRef();
|
64
|
-
useEffect(function () {
|
65
|
-
// Store current value in ref
|
66
|
-
ref.current = value;
|
67
|
-
}, [value]); // Only re-run if value changes
|
68
|
-
// Return previous value (happens before update in useEffect above)
|
69
|
-
|
70
|
-
return ref.current;
|
71
|
-
}
|
72
|
-
|
73
|
-
var prevActive = usePrevious(active);
|
74
|
-
var isDeterminate = percentage !== undefined;
|
75
|
-
var percentProgress = isDeterminate ? percentage > 100 ? "100%" : percentage + '%' : 0;
|
76
|
-
var actuallyShowPercentageIndicator = isDeterminate && showPercentageIndicator; // switch classes dependant on props
|
77
|
-
|
78
|
-
var loadingWrapper = cx(_defineProperty({}, "".concat(blockClass, "__preload"), !prevActive && !active));
|
79
|
-
var loadingClassName = cx((_cx2 = {}, _defineProperty(_cx2, "".concat(blockClass, "__inner"), true), _defineProperty(_cx2, "".concat(blockClass, "__small"), small), _defineProperty(_cx2, "".concat(blockClass, "__linear-stop"), !active && isDeterminate), _defineProperty(_cx2, "".concat(blockClass, "__indefinite-stop"), !active && !isDeterminate), _cx2));
|
80
|
-
var animationClassName = cx((_cx3 = {}, _defineProperty(_cx3, "".concat(blockClass, "__linear-progress"), isDeterminate), _defineProperty(_cx3, "".concat(blockClass, "__stop-progress"), !active && !isDeterminate), _defineProperty(_cx3, "".concat(blockClass, "__indefinite-progress"), active && !isDeterminate), _cx3));
|
81
|
-
var loadingId = id && "loading-bar-id-".concat(id);
|
82
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
83
|
-
className: cx(loadingWrapper, // Apply any supplied class names to the main HTML element.
|
84
|
-
className, blockClass),
|
85
|
-
ref: ref,
|
86
|
-
role: "progressbar",
|
87
|
-
"aria-label": ariaLabel,
|
88
|
-
"aria-atomic": "true",
|
89
|
-
"aria-labelledby": loadingId,
|
90
|
-
"aria-live": active ? 'assertive' : 'off',
|
91
|
-
id: loadingId
|
92
|
-
}), /*#__PURE__*/React.createElement("div", {
|
93
|
-
className: loadingClassName
|
94
|
-
}, /*#__PURE__*/React.createElement("div", _extends({}, isDeterminate && {
|
95
|
-
style: {
|
96
|
-
width: percentProgress
|
97
|
-
}
|
98
|
-
}, {
|
99
|
-
className: "".concat(blockClass, "__progress")
|
100
|
-
}), /*#__PURE__*/React.createElement("div", {
|
101
|
-
className: animationClassName
|
102
|
-
}))), actuallyShowPercentageIndicator && /*#__PURE__*/React.createElement("div", {
|
103
|
-
className: "".concat(blockClass, "__indicator-wrapper")
|
104
|
-
}, /*#__PURE__*/React.createElement("div", {
|
105
|
-
className: "".concat(blockClass, "__indicator")
|
106
|
-
}, active && percentageIndicatorText)));
|
107
|
-
}); // Return a placeholder if not released and not enabled by feature flag
|
108
|
-
|
109
|
-
LoadingBar = pkg.checkComponentEnabled(LoadingBar, componentName); // The display name of the component, used by React. Note that displayName
|
110
|
-
// is used in preference to relying on function.name.
|
111
|
-
|
112
|
-
LoadingBar.displayName = componentName; // The types and DocGen commentary for the component props,
|
113
|
-
// in alphabetical order (for consistency).
|
114
|
-
// See https://www.npmjs.com/package/prop-types#usage.
|
115
|
-
|
116
|
-
LoadingBar.propTypes = {
|
117
|
-
/**
|
118
|
-
* Specify whether you want the loading bar indicator to be active or not
|
119
|
-
*/
|
120
|
-
active: PropTypes.bool,
|
121
|
-
|
122
|
-
/**
|
123
|
-
* Specify a ariaLabel that would be used to best describe the active loading state
|
124
|
-
*/
|
125
|
-
ariaLabel: PropTypes.string,
|
126
|
-
|
127
|
-
/**
|
128
|
-
* Provide an optional className to be applied to the containing node
|
129
|
-
*/
|
130
|
-
className: PropTypes.string,
|
131
|
-
|
132
|
-
/**
|
133
|
-
* ID for loading bar
|
134
|
-
*/
|
135
|
-
id: PropTypes.string,
|
136
|
-
|
137
|
-
/**
|
138
|
-
* Leave undefined for indeterminate duration or specify percentage complete that the determinate bar should indicate (0-100).
|
139
|
-
*/
|
140
|
-
percentage: PropTypes.number,
|
141
|
-
|
142
|
-
/**
|
143
|
-
* In determinate mode, provide text to be shown on percentage indicator
|
144
|
-
*/
|
145
|
-
percentageIndicatorText: PropTypes.string,
|
146
|
-
|
147
|
-
/**
|
148
|
-
* In determinate mode, specify whether to show the percentage indicator.
|
149
|
-
*/
|
150
|
-
showPercentageIndicator: PropTypes.bool,
|
151
|
-
|
152
|
-
/**
|
153
|
-
* Specify whether you would like the small variant of this component
|
154
|
-
*/
|
155
|
-
small: PropTypes.bool
|
156
|
-
};
|