@carbon/react 1.13.0 → 1.14.0-rc.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.
- package/es/components/Accordion/Accordion.Skeleton.js +12 -4
- package/es/components/Accordion/Accordion.js +9 -2
- package/es/components/FileUploader/Filename.js +3 -1
- package/es/components/FluidTextArea/FluidTextArea.js +130 -0
- package/es/components/FluidTextInput/FluidTextInput.js +13 -4
- package/es/components/Notification/Notification.js +6 -2
- package/es/components/ProgressIndicator/ProgressIndicator.js +128 -154
- package/es/components/RadioTile/RadioTile.js +2 -11
- package/es/components/TextArea/TextArea.js +14 -5
- package/es/components/TextInput/PasswordInput.js +7 -6
- package/es/index.js +2 -2
- package/lib/components/Accordion/Accordion.Skeleton.js +12 -4
- package/lib/components/Accordion/Accordion.js +9 -2
- package/lib/components/FileUploader/Filename.js +3 -1
- package/lib/components/FluidTextArea/FluidTextArea.js +140 -0
- package/lib/components/FluidTextInput/FluidTextInput.js +12 -3
- package/lib/components/Notification/Notification.js +6 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.js +126 -152
- package/lib/components/RadioTile/RadioTile.js +2 -11
- package/lib/components/TextArea/TextArea.js +13 -4
- package/lib/components/TextInput/PasswordInput.js +7 -6
- package/lib/index.js +47 -46
- package/package.json +7 -6
- package/es/components/ProgressIndicator/index.js +0 -15
- package/es/components/ProgressIndicator/next/ProgressIndicator.js +0 -117
- package/lib/components/ProgressIndicator/index.js +0 -39
- package/lib/components/ProgressIndicator/next/ProgressIndicator.js +0 -127
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.14.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@babel/runtime": "^7.18.3",
|
|
46
46
|
"@carbon/feature-flags": "^0.9.0",
|
|
47
|
-
"@carbon/icons-react": "^11.
|
|
48
|
-
"@carbon/layout": "^11.
|
|
49
|
-
"@carbon/styles": "^1.
|
|
47
|
+
"@carbon/icons-react": "^11.9.0-rc.0",
|
|
48
|
+
"@carbon/layout": "^11.7.0-rc.0",
|
|
49
|
+
"@carbon/styles": "^1.14.0-rc.0",
|
|
50
50
|
"@carbon/telemetry": "0.1.0",
|
|
51
51
|
"classnames": "2.3.1",
|
|
52
52
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@babel/preset-env": "^7.18.2",
|
|
74
74
|
"@babel/preset-react": "^7.17.12",
|
|
75
75
|
"@carbon/test-utils": "^10.26.0",
|
|
76
|
-
"@carbon/themes": "^11.
|
|
76
|
+
"@carbon/themes": "^11.10.0-rc.0",
|
|
77
77
|
"@rollup/plugin-babel": "^5.3.0",
|
|
78
78
|
"@rollup/plugin-commonjs": "^21.0.0",
|
|
79
79
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"babel-preset-carbon": "^0.3.0",
|
|
95
95
|
"browserify-zlib": "^0.2.0",
|
|
96
96
|
"browserslist-config-carbon": "^11.0.0",
|
|
97
|
+
"clipboardy": "^2.1.0",
|
|
97
98
|
"css-loader": "^6.5.1",
|
|
98
99
|
"enquirer": "^2.3.6",
|
|
99
100
|
"fast-glob": "^3.2.7",
|
|
@@ -130,5 +131,5 @@
|
|
|
130
131
|
"**/*.scss",
|
|
131
132
|
"**/*.css"
|
|
132
133
|
],
|
|
133
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "06ebb59650784ee0bdb602a521e82383472f0487"
|
|
134
135
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2022
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import * as FeatureFlags from '@carbon/feature-flags';
|
|
9
|
-
import { ProgressIndicator as ProgressIndicator$2 } from './ProgressIndicator.js';
|
|
10
|
-
export { ProgressStep } from './ProgressIndicator.js';
|
|
11
|
-
import { ProgressIndicator as ProgressIndicator$1 } from './next/ProgressIndicator.js';
|
|
12
|
-
|
|
13
|
-
var ProgressIndicator = FeatureFlags.enabled('enable-v11-release') ? ProgressIndicator$1 : ProgressIndicator$2;
|
|
14
|
-
|
|
15
|
-
export { ProgressIndicator };
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2022
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, defineProperty as _defineProperty, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import cx from 'classnames';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
import React__default, { useState } from 'react';
|
|
12
|
-
import { usePrefix } from '../../../internal/usePrefix.js';
|
|
13
|
-
|
|
14
|
-
var _excluded = ["children", "className", "currentIndex", "onChange", "spaceEqually", "vertical"];
|
|
15
|
-
|
|
16
|
-
function ProgressIndicator(_ref) {
|
|
17
|
-
var _cx;
|
|
18
|
-
|
|
19
|
-
var children = _ref.children,
|
|
20
|
-
customClassName = _ref.className,
|
|
21
|
-
_ref$currentIndex = _ref.currentIndex,
|
|
22
|
-
controlledIndex = _ref$currentIndex === void 0 ? 0 : _ref$currentIndex,
|
|
23
|
-
onChange = _ref.onChange,
|
|
24
|
-
spaceEqually = _ref.spaceEqually,
|
|
25
|
-
vertical = _ref.vertical,
|
|
26
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
-
|
|
28
|
-
var prefix = usePrefix();
|
|
29
|
-
|
|
30
|
-
var _useState = useState(controlledIndex),
|
|
31
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
-
currentIndex = _useState2[0],
|
|
33
|
-
setCurrentIndex = _useState2[1];
|
|
34
|
-
|
|
35
|
-
var _useState3 = useState(controlledIndex),
|
|
36
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
|
-
prevControlledIndex = _useState4[0],
|
|
38
|
-
setPrevControlledIndex = _useState4[1];
|
|
39
|
-
|
|
40
|
-
var className = cx((_cx = {}, _defineProperty(_cx, "".concat(prefix, "--progress"), true), _defineProperty(_cx, "".concat(prefix, "--progress--vertical"), vertical), _defineProperty(_cx, "".concat(prefix, "--progress--space-equal"), spaceEqually && !vertical), _defineProperty(_cx, customClassName, customClassName), _cx));
|
|
41
|
-
|
|
42
|
-
if (controlledIndex !== prevControlledIndex) {
|
|
43
|
-
setCurrentIndex(controlledIndex);
|
|
44
|
-
setPrevControlledIndex(controlledIndex);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return /*#__PURE__*/React__default.createElement("ul", _extends({
|
|
48
|
-
className: className
|
|
49
|
-
}, rest), React__default.Children.map(children, function (child, index) {
|
|
50
|
-
// only setup click handlers if onChange event is passed
|
|
51
|
-
var onClick = onChange ? function () {
|
|
52
|
-
return onChange(index);
|
|
53
|
-
} : undefined;
|
|
54
|
-
|
|
55
|
-
if (index === currentIndex) {
|
|
56
|
-
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
57
|
-
complete: child.props.complete,
|
|
58
|
-
current: child.props.complete ? false : true,
|
|
59
|
-
index: index,
|
|
60
|
-
onClick: onClick
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (index < currentIndex) {
|
|
65
|
-
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
66
|
-
complete: true,
|
|
67
|
-
index: index,
|
|
68
|
-
onClick: onClick
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (index > currentIndex) {
|
|
73
|
-
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
74
|
-
complete: child.props.complete || false,
|
|
75
|
-
index: index,
|
|
76
|
-
onClick: onClick
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return null;
|
|
81
|
-
}));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
ProgressIndicator.propTypes = {
|
|
85
|
-
/**
|
|
86
|
-
* Provide `<ProgressStep>` components to be rendered in the
|
|
87
|
-
* `<ProgressIndicator>`
|
|
88
|
-
*/
|
|
89
|
-
children: PropTypes.node,
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Provide an optional className to be applied to the containing node
|
|
93
|
-
*/
|
|
94
|
-
className: PropTypes.string,
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Optionally specify the current step array index
|
|
98
|
-
*/
|
|
99
|
-
currentIndex: PropTypes.number,
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
|
|
103
|
-
*/
|
|
104
|
-
onChange: PropTypes.func,
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Specify whether the progress steps should be split equally in size in the div
|
|
108
|
-
*/
|
|
109
|
-
spaceEqually: PropTypes.bool,
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Determines whether or not the ProgressIndicator should be rendered vertically.
|
|
113
|
-
*/
|
|
114
|
-
vertical: PropTypes.bool
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export { ProgressIndicator };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2022
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
'use strict';
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
|
-
var FeatureFlags = require('@carbon/feature-flags');
|
|
13
|
-
var ProgressIndicator$1 = require('./ProgressIndicator.js');
|
|
14
|
-
var ProgressIndicator$2 = require('./next/ProgressIndicator.js');
|
|
15
|
-
|
|
16
|
-
function _interopNamespace(e) {
|
|
17
|
-
if (e && e.__esModule) return e;
|
|
18
|
-
var n = Object.create(null);
|
|
19
|
-
if (e) {
|
|
20
|
-
Object.keys(e).forEach(function (k) {
|
|
21
|
-
if (k !== 'default') {
|
|
22
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
23
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function () { return e[k]; }
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
n["default"] = e;
|
|
31
|
-
return Object.freeze(n);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
35
|
-
|
|
36
|
-
var ProgressIndicator = FeatureFlags__namespace.enabled('enable-v11-release') ? ProgressIndicator$2.ProgressIndicator : ProgressIndicator$1.ProgressIndicator;
|
|
37
|
-
|
|
38
|
-
exports.ProgressStep = ProgressIndicator$1.ProgressStep;
|
|
39
|
-
exports.ProgressIndicator = ProgressIndicator;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2022
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
'use strict';
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
|
-
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
|
-
var cx = require('classnames');
|
|
14
|
-
var PropTypes = require('prop-types');
|
|
15
|
-
var React = require('react');
|
|
16
|
-
var usePrefix = require('../../../internal/usePrefix.js');
|
|
17
|
-
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
21
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
|
|
24
|
-
var _excluded = ["children", "className", "currentIndex", "onChange", "spaceEqually", "vertical"];
|
|
25
|
-
|
|
26
|
-
function ProgressIndicator(_ref) {
|
|
27
|
-
var _cx;
|
|
28
|
-
|
|
29
|
-
var children = _ref.children,
|
|
30
|
-
customClassName = _ref.className,
|
|
31
|
-
_ref$currentIndex = _ref.currentIndex,
|
|
32
|
-
controlledIndex = _ref$currentIndex === void 0 ? 0 : _ref$currentIndex,
|
|
33
|
-
onChange = _ref.onChange,
|
|
34
|
-
spaceEqually = _ref.spaceEqually,
|
|
35
|
-
vertical = _ref.vertical,
|
|
36
|
-
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
37
|
-
|
|
38
|
-
var prefix = usePrefix.usePrefix();
|
|
39
|
-
|
|
40
|
-
var _useState = React.useState(controlledIndex),
|
|
41
|
-
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
42
|
-
currentIndex = _useState2[0],
|
|
43
|
-
setCurrentIndex = _useState2[1];
|
|
44
|
-
|
|
45
|
-
var _useState3 = React.useState(controlledIndex),
|
|
46
|
-
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
|
47
|
-
prevControlledIndex = _useState4[0],
|
|
48
|
-
setPrevControlledIndex = _useState4[1];
|
|
49
|
-
|
|
50
|
-
var className = cx__default["default"]((_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--progress"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--progress--vertical"), vertical), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--progress--space-equal"), spaceEqually && !vertical), _rollupPluginBabelHelpers.defineProperty(_cx, customClassName, customClassName), _cx));
|
|
51
|
-
|
|
52
|
-
if (controlledIndex !== prevControlledIndex) {
|
|
53
|
-
setCurrentIndex(controlledIndex);
|
|
54
|
-
setPrevControlledIndex(controlledIndex);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return /*#__PURE__*/React__default["default"].createElement("ul", _rollupPluginBabelHelpers["extends"]({
|
|
58
|
-
className: className
|
|
59
|
-
}, rest), React__default["default"].Children.map(children, function (child, index) {
|
|
60
|
-
// only setup click handlers if onChange event is passed
|
|
61
|
-
var onClick = onChange ? function () {
|
|
62
|
-
return onChange(index);
|
|
63
|
-
} : undefined;
|
|
64
|
-
|
|
65
|
-
if (index === currentIndex) {
|
|
66
|
-
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
67
|
-
complete: child.props.complete,
|
|
68
|
-
current: child.props.complete ? false : true,
|
|
69
|
-
index: index,
|
|
70
|
-
onClick: onClick
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (index < currentIndex) {
|
|
75
|
-
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
76
|
-
complete: true,
|
|
77
|
-
index: index,
|
|
78
|
-
onClick: onClick
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (index > currentIndex) {
|
|
83
|
-
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
84
|
-
complete: child.props.complete || false,
|
|
85
|
-
index: index,
|
|
86
|
-
onClick: onClick
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return null;
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
ProgressIndicator.propTypes = {
|
|
95
|
-
/**
|
|
96
|
-
* Provide `<ProgressStep>` components to be rendered in the
|
|
97
|
-
* `<ProgressIndicator>`
|
|
98
|
-
*/
|
|
99
|
-
children: PropTypes__default["default"].node,
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Provide an optional className to be applied to the containing node
|
|
103
|
-
*/
|
|
104
|
-
className: PropTypes__default["default"].string,
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Optionally specify the current step array index
|
|
108
|
-
*/
|
|
109
|
-
currentIndex: PropTypes__default["default"].number,
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
|
|
113
|
-
*/
|
|
114
|
-
onChange: PropTypes__default["default"].func,
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Specify whether the progress steps should be split equally in size in the div
|
|
118
|
-
*/
|
|
119
|
-
spaceEqually: PropTypes__default["default"].bool,
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Determines whether or not the ProgressIndicator should be rendered vertically.
|
|
123
|
-
*/
|
|
124
|
-
vertical: PropTypes__default["default"].bool
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
exports.ProgressIndicator = ProgressIndicator;
|