@carbon/ibm-products 1.11.0 → 1.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. package/css/index-full-carbon.css +173 -188
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +5 -5
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +11 -0
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +2 -2
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +26 -182
  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 +143 -182
  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/AddSelect/AddSelectColumn.js +58 -21
  18. package/es/components/AddSelect/AddSelectList.js +5 -5
  19. package/es/components/AddSelect/AddSelectSidebar.js +2 -1
  20. package/es/components/ButtonMenu/ButtonMenu.js +11 -3
  21. package/es/components/index.js +0 -1
  22. package/es/global/js/package-settings.js +1 -2
  23. package/lib/components/AddSelect/AddSelectColumn.js +57 -20
  24. package/lib/components/AddSelect/AddSelectList.js +5 -5
  25. package/lib/components/AddSelect/AddSelectSidebar.js +2 -1
  26. package/lib/components/ButtonMenu/ButtonMenu.js +11 -3
  27. package/lib/components/index.js +0 -8
  28. package/lib/global/js/package-settings.js +1 -2
  29. package/package.json +13 -13
  30. package/scss/components/AddSelect/_add-select.scss +4 -0
  31. package/scss/components/InlineEdit/_inline-edit.scss +4 -0
  32. package/scss/components/ModifiedTabs/_modified-tabs.scss +5 -0
  33. package/scss/components/NotificationsPanel/_notifications-panel.scss +7 -3
  34. package/scss/components/Tearsheet/_tearsheet.scss +4 -0
  35. package/scss/components/_index.scss +0 -1
  36. package/es/components/LoadingBar/LoadingBar.js +0 -156
  37. package/es/components/LoadingBar/index.js +0 -7
  38. package/lib/components/LoadingBar/LoadingBar.js +0 -170
  39. package/lib/components/LoadingBar/index.js +0 -13
  40. package/scss/components/LoadingBar/_index.scss +0 -8
  41. package/scss/components/LoadingBar/_loading-bar.scss +0 -224
  42. package/scss/components/LoadingBar/_storybook-styles.scss +0 -14
@@ -1,170 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports.LoadingBar = void 0;
11
-
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
-
16
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
17
-
18
- var _react = _interopRequireWildcard(require("react"));
19
-
20
- var _propTypes = _interopRequireDefault(require("prop-types"));
21
-
22
- var _classnames = _interopRequireDefault(require("classnames"));
23
-
24
- var _settings = require("../../settings");
25
-
26
- var _excluded = ["active", "ariaLabel", "className", "id", "percentage", "percentageIndicatorText", "showPercentageIndicator", "small"];
27
-
28
- 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); }
29
-
30
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
-
32
- // Carbon and package components we use.
33
-
34
- /* @import(s) of carbon components and other package components. */
35
- // The block part of our conventional BEM class names (blockClass__E--M).
36
- var blockClass = "".concat(_settings.pkg.prefix, "--loading-bar");
37
- var componentName = 'LoadingBar'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
38
- // Default values for props
39
-
40
- var defaults = {
41
- active: true,
42
- percentage: undefined,
43
- ariaLabel: 'Active loading indicator'
44
- };
45
- /**
46
- * The LoadingBar component provides a way to communicate the loading state to users.
47
- * It is intended to fill the space of where it's used, and should persist until the
48
- * loading action is complete. Once complete, the active prop may be set to false to
49
- * hide the LoadingBar.
50
- * The LoadingBar has two modes of operation: Indeterminate and Determinate.
51
- * If no percentage is provided to the component, the LoadingBar behaves in indeterminate
52
- * mode, with the bar moving from side to side, to indicate loading in progress.
53
- * If a percentage prop is provided, the determinate mode of operation is used and the
54
- * loading bar fills until the specified percentage to indicate current progress to
55
- * the user.
56
- */
57
-
58
- var LoadingBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
59
- var _cx2, _cx3;
60
-
61
- var _ref$active = _ref.active,
62
- active = _ref$active === void 0 ? defaults.active : _ref$active,
63
- _ref$ariaLabel = _ref.ariaLabel,
64
- ariaLabel = _ref$ariaLabel === void 0 ? defaults.ariaLabel : _ref$ariaLabel,
65
- className = _ref.className,
66
- id = _ref.id,
67
- _ref$percentage = _ref.percentage,
68
- percentage = _ref$percentage === void 0 ? defaults.percentage : _ref$percentage,
69
- percentageIndicatorText = _ref.percentageIndicatorText,
70
- showPercentageIndicator = _ref.showPercentageIndicator,
71
- small = _ref.small,
72
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
73
-
74
- function usePrevious(value) {
75
- var ref = (0, _react.useRef)();
76
- (0, _react.useEffect)(function () {
77
- // Store current value in ref
78
- ref.current = value;
79
- }, [value]); // Only re-run if value changes
80
- // Return previous value (happens before update in useEffect above)
81
-
82
- return ref.current;
83
- }
84
-
85
- var prevActive = usePrevious(active);
86
- var isDeterminate = percentage !== undefined;
87
- var percentProgress = isDeterminate ? percentage > 100 ? "100%" : percentage + '%' : 0;
88
- var actuallyShowPercentageIndicator = isDeterminate && showPercentageIndicator; // switch classes dependant on props
89
-
90
- var loadingWrapper = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__preload"), !prevActive && !active));
91
- var loadingClassName = (0, _classnames.default)((_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__inner"), true), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__small"), small), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__linear-stop"), !active && isDeterminate), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__indefinite-stop"), !active && !isDeterminate), _cx2));
92
- var animationClassName = (0, _classnames.default)((_cx3 = {}, (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__linear-progress"), isDeterminate), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__stop-progress"), !active && !isDeterminate), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__indefinite-progress"), active && !isDeterminate), _cx3));
93
- var loadingId = id && "loading-bar-id-".concat(id);
94
- return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
95
- className: (0, _classnames.default)(loadingWrapper, // Apply any supplied class names to the main HTML element.
96
- className, blockClass),
97
- ref: ref,
98
- role: "progressbar",
99
- "aria-label": ariaLabel,
100
- "aria-atomic": "true",
101
- "aria-labelledby": loadingId,
102
- "aria-live": active ? 'assertive' : 'off',
103
- id: loadingId
104
- }), /*#__PURE__*/_react.default.createElement("div", {
105
- className: loadingClassName
106
- }, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, isDeterminate && {
107
- style: {
108
- width: percentProgress
109
- }
110
- }, {
111
- className: "".concat(blockClass, "__progress")
112
- }), /*#__PURE__*/_react.default.createElement("div", {
113
- className: animationClassName
114
- }))), actuallyShowPercentageIndicator && /*#__PURE__*/_react.default.createElement("div", {
115
- className: "".concat(blockClass, "__indicator-wrapper")
116
- }, /*#__PURE__*/_react.default.createElement("div", {
117
- className: "".concat(blockClass, "__indicator")
118
- }, active && percentageIndicatorText)));
119
- }); // Return a placeholder if not released and not enabled by feature flag
120
-
121
-
122
- exports.LoadingBar = LoadingBar;
123
- exports.LoadingBar = LoadingBar = _settings.pkg.checkComponentEnabled(LoadingBar, componentName); // The display name of the component, used by React. Note that displayName
124
- // is used in preference to relying on function.name.
125
-
126
- LoadingBar.displayName = componentName; // The types and DocGen commentary for the component props,
127
- // in alphabetical order (for consistency).
128
- // See https://www.npmjs.com/package/prop-types#usage.
129
-
130
- LoadingBar.propTypes = {
131
- /**
132
- * Specify whether you want the loading bar indicator to be active or not
133
- */
134
- active: _propTypes.default.bool,
135
-
136
- /**
137
- * Specify a ariaLabel that would be used to best describe the active loading state
138
- */
139
- ariaLabel: _propTypes.default.string,
140
-
141
- /**
142
- * Provide an optional className to be applied to the containing node
143
- */
144
- className: _propTypes.default.string,
145
-
146
- /**
147
- * ID for loading bar
148
- */
149
- id: _propTypes.default.string,
150
-
151
- /**
152
- * Leave undefined for indeterminate duration or specify percentage complete that the determinate bar should indicate (0-100).
153
- */
154
- percentage: _propTypes.default.number,
155
-
156
- /**
157
- * In determinate mode, provide text to be shown on percentage indicator
158
- */
159
- percentageIndicatorText: _propTypes.default.string,
160
-
161
- /**
162
- * In determinate mode, specify whether to show the percentage indicator.
163
- */
164
- showPercentageIndicator: _propTypes.default.bool,
165
-
166
- /**
167
- * Specify whether you would like the small variant of this component
168
- */
169
- small: _propTypes.default.bool
170
- };
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "LoadingBar", {
7
- enumerable: true,
8
- get: function get() {
9
- return _LoadingBar.LoadingBar;
10
- }
11
- });
12
-
13
- var _LoadingBar = require("./LoadingBar");
@@ -1,8 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2021, 2021
3
- //
4
- // This source code is licensed under the Apache-2.0 license found in the
5
- // LICENSE file in the root directory of this source tree.
6
- //
7
-
8
- @import './loading-bar';
@@ -1,224 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2021, 2021
3
- //
4
- // This source code is licensed under the Apache-2.0 license found in the
5
- // LICENSE file in the root directory of this source tree.
6
- //
7
-
8
- // Standard imports.
9
- @import '../../global/styles/project-settings';
10
-
11
- $loading-bar__height: 8px;
12
- $loading-bar__small-height: 4px;
13
-
14
- // Define all component styles in a mixin which is then exported using
15
- // the Carbon import-once mechanism.
16
- @mixin loading-bar {
17
- // The block part of our conventional BEM class names (blockClass__E--M).
18
- $block-class: #{$pkg-prefix}--loading-bar;
19
-
20
- @keyframes progress-indeterminate {
21
- 0% {
22
- right: auto;
23
- left: 0;
24
- width: 0%;
25
- }
26
-
27
- 20% {
28
- right: auto;
29
- left: 0;
30
- width: 100%;
31
- }
32
-
33
- 28% {
34
- right: 0;
35
- left: auto;
36
- width: 100%;
37
- }
38
-
39
- 51% {
40
- right: 0;
41
- left: auto;
42
- width: 0%;
43
- }
44
-
45
- 58% {
46
- right: 0;
47
- left: auto;
48
- width: 0%;
49
- }
50
-
51
- 82% {
52
- right: 0;
53
- left: auto;
54
- width: 100%;
55
- }
56
-
57
- 83% {
58
- right: auto;
59
- left: 0;
60
- width: 100%;
61
- }
62
-
63
- 96% {
64
- right: auto;
65
- left: 0;
66
- width: 0%;
67
- }
68
-
69
- 100% {
70
- right: auto;
71
- left: 0;
72
- width: 0%;
73
- }
74
- }
75
-
76
- @keyframes progress-linear {
77
- 0% {
78
- right: auto;
79
- left: 0;
80
- width: 0%;
81
- }
82
-
83
- 100% {
84
- right: auto;
85
- left: 0;
86
- width: 100%;
87
- }
88
- }
89
-
90
- @keyframes progress-stop {
91
- 0% {
92
- right: auto;
93
- left: 0;
94
- width: 0%;
95
- }
96
-
97
- 92% {
98
- right: auto;
99
- left: 0;
100
- width: 100%;
101
- }
102
-
103
- 100% {
104
- right: auto;
105
- left: 0;
106
- width: 100%;
107
- }
108
- }
109
-
110
- @keyframes loading-bar-stop {
111
- 0% {
112
- opacity: 1;
113
- }
114
-
115
- 92% {
116
- opacity: 1;
117
- }
118
-
119
- 100% {
120
- display: none;
121
- opacity: 0;
122
- }
123
- }
124
-
125
- .#{$block-class} .#{$block-class}__inner {
126
- position: relative;
127
- width: 100%;
128
- height: $loading-bar__height;
129
- padding: 0;
130
- border: none;
131
- background-color: $hover-ui;
132
- -webkit-box-shadow: none;
133
- box-shadow: none;
134
- pointer-events: none;
135
- }
136
-
137
- .#{$block-class} .#{$block-class}__inner:hover,
138
- .#{$block-class} .#{$block-class}__inner:focus,
139
- .#{$block-class} .#{$block-class}__inner:active {
140
- border: none;
141
- cursor: default;
142
- outline: none;
143
- }
144
-
145
- .#{$block-class}__preload {
146
- opacity: 0;
147
- }
148
-
149
- .#{$block-class}__progress {
150
- position: relative;
151
- height: $loading-bar__height;
152
- transition: width $duration--slow-02 cubic-bezier(0.4, 0.14, 0.3, 1); // Expansion duration - carbon value from _motion.scss
153
- }
154
-
155
- .#{$block-class}__indicator-wrapper {
156
- display: flex;
157
- justify-content: flex-end;
158
- }
159
-
160
- .#{$block-class}__indicator {
161
- @include carbon--type-style('body-short-01');
162
-
163
- padding-top: $spacing-05;
164
- padding-bottom: $spacing-03;
165
- color: $text-01;
166
- }
167
-
168
- .#{$block-class}__small {
169
- height: $loading-bar__small-height;
170
- }
171
-
172
- .#{$block-class}__small .#{$block-class}__progress {
173
- height: $loading-bar__small-height;
174
- }
175
-
176
- .#{$block-class}__linear-stop {
177
- display: none;
178
- }
179
-
180
- .#{$block-class}__indefinite-stop {
181
- // stylelint-disable-next-line carbon/motion-token-use
182
- animation: 1800ms ease-in-out loading-bar-stop forwards;
183
- }
184
-
185
- .#{$block-class}__stop-progress:before {
186
- position: absolute;
187
- top: 0;
188
- left: 0;
189
- width: 0%;
190
- height: 100%;
191
- // stylelint-disable-next-line carbon/motion-token-use
192
- animation: 1800ms ease-in-out progress-stop forwards;
193
- background-color: $interactive-01;
194
- content: '';
195
- }
196
-
197
- .#{$block-class}__indefinite-progress:before {
198
- position: absolute;
199
- top: 0;
200
- left: 0;
201
- width: 0%;
202
- height: 100%;
203
- // stylelint-disable-next-line carbon/motion-token-use
204
- animation: 3000ms ease-in-out progress-indeterminate infinite;
205
- background-color: $interactive-01;
206
- content: '';
207
- }
208
-
209
- .#{$block-class}__linear-progress:before {
210
- position: absolute;
211
- top: 0;
212
- left: 0;
213
- width: 0%;
214
- height: 100%;
215
- // stylelint-disable-next-line carbon/motion-token-use
216
- animation: 1000ms ease-in-out progress-linear forwards;
217
- background-color: $interactive-01;
218
- content: '';
219
- }
220
- }
221
-
222
- @include exports('loading-bar') {
223
- @include loading-bar;
224
- }
@@ -1,14 +0,0 @@
1
- //
2
- // Copyright IBM Corp. 2021, 2021
3
- //
4
- // This source code is licensed under the Apache-2.0 license found in the
5
- // LICENSE file in the root directory of this source tree.
6
- //
7
-
8
- @import '../../global/styles/project-settings';
9
-
10
- // add any additional styles used by LoadingBar.stories.js
11
- .loading-bar-story-wrapper {
12
- width: 24rem;
13
- margin: $spacing-07 $spacing-05 $spacing-05 $spacing-05;
14
- }