@carbon/react 1.4.0-rc.0 → 1.5.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/_virtual/_rollupPluginBabelHelpers.js +3 -5
- package/es/components/Button/Button.Skeleton.js +1 -1
- package/es/components/Checkbox/Checkbox.Skeleton.js +5 -3
- package/es/components/Checkbox/Checkbox.js +5 -5
- package/es/components/DataTable/TableActionList.js +3 -1
- package/es/components/DataTable/TableToolbarContent.js +3 -1
- package/es/components/FormGroup/FormGroup.js +1 -2
- package/es/components/OverflowMenu/OverflowMenu.js +1 -1
- package/es/components/ProgressIndicator/ProgressIndicator.js +1 -3
- package/es/components/RadioButton/RadioButton.js +1 -1
- package/es/components/Search/next/Search.js +1 -0
- package/es/components/TreeView/TreeNode.js +8 -0
- package/es/components/TreeView/TreeView.js +6 -4
- package/es/components/UIShell/HeaderGlobalBar.js +3 -1
- package/es/tools/wrapComponent.js +6 -4
- package/lib/_virtual/_rollupPluginBabelHelpers.js +3 -5
- package/lib/components/Button/Button.Skeleton.js +1 -1
- package/lib/components/Checkbox/Checkbox.Skeleton.js +5 -3
- package/lib/components/Checkbox/Checkbox.js +5 -5
- package/lib/components/DataTable/TableActionList.js +3 -1
- package/lib/components/DataTable/TableToolbarContent.js +3 -1
- package/lib/components/FormGroup/FormGroup.js +1 -2
- package/lib/components/OverflowMenu/OverflowMenu.js +1 -1
- package/lib/components/ProgressIndicator/ProgressIndicator.js +1 -3
- package/lib/components/RadioButton/RadioButton.js +1 -1
- package/lib/components/Search/next/Search.js +1 -0
- package/lib/components/TreeView/TreeNode.js +8 -0
- package/lib/components/TreeView/TreeView.js +6 -4
- package/lib/components/UIShell/HeaderGlobalBar.js +3 -1
- package/lib/tools/wrapComponent.js +6 -4
- package/package.json +26 -26
|
@@ -82,7 +82,7 @@ function _defineProperty(obj, key, value) {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
function _extends() {
|
|
85
|
-
_extends = Object.assign
|
|
85
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
86
86
|
for (var i = 1; i < arguments.length; i++) {
|
|
87
87
|
var source = arguments[i];
|
|
88
88
|
|
|
@@ -95,7 +95,6 @@ function _extends() {
|
|
|
95
95
|
|
|
96
96
|
return target;
|
|
97
97
|
};
|
|
98
|
-
|
|
99
98
|
return _extends.apply(this, arguments);
|
|
100
99
|
}
|
|
101
100
|
|
|
@@ -118,18 +117,17 @@ function _inherits(subClass, superClass) {
|
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
function _getPrototypeOf(o) {
|
|
121
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
120
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
122
121
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
123
122
|
};
|
|
124
123
|
return _getPrototypeOf(o);
|
|
125
124
|
}
|
|
126
125
|
|
|
127
126
|
function _setPrototypeOf(o, p) {
|
|
128
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
127
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
129
128
|
o.__proto__ = p;
|
|
130
129
|
return o;
|
|
131
130
|
};
|
|
132
|
-
|
|
133
131
|
return _setPrototypeOf(o, p);
|
|
134
132
|
}
|
|
135
133
|
|
|
@@ -26,7 +26,7 @@ var ButtonSkeleton = function ButtonSkeleton(_ref) {
|
|
|
26
26
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
27
|
|
|
28
28
|
var prefix = usePrefix();
|
|
29
|
-
var buttonClasses = cx(className, (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--skeleton"), true), _defineProperty(_cx, "".concat(prefix, "--btn"), true), _defineProperty(_cx, "".concat(prefix, "--btn--sm"), small || size === 'sm'), _defineProperty(_cx, "".concat(prefix, "--btn--md"), size === 'field' || size === 'md'), _defineProperty(_cx, "".concat(prefix, "--btn--xl"), size === 'xl'), _defineProperty(_cx, "".concat(prefix, "--btn--2xl"), size === '2xl'), _cx));
|
|
29
|
+
var buttonClasses = cx(className, (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--skeleton"), true), _defineProperty(_cx, "".concat(prefix, "--btn"), true), _defineProperty(_cx, "".concat(prefix, "--btn--sm"), small || size === 'sm'), _defineProperty(_cx, "".concat(prefix, "--btn--md"), size === 'field' || size === 'md'), _defineProperty(_cx, "".concat(prefix, "--btn--lg"), size === 'lg'), _defineProperty(_cx, "".concat(prefix, "--btn--xl"), size === 'xl'), _defineProperty(_cx, "".concat(prefix, "--btn--2xl"), size === '2xl'), _cx));
|
|
30
30
|
|
|
31
31
|
var commonProps = _objectSpread2({
|
|
32
32
|
className: buttonClasses
|
|
@@ -19,10 +19,12 @@ var CheckboxSkeleton = function CheckboxSkeleton(_ref) {
|
|
|
19
19
|
|
|
20
20
|
var prefix = usePrefix();
|
|
21
21
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
22
|
-
className: cx("".concat(prefix, "--form-item"), "".concat(prefix, "--checkbox-wrapper"), "".concat(prefix, "--checkbox-
|
|
23
|
-
}, rest), /*#__PURE__*/React__default.createElement("
|
|
22
|
+
className: cx("".concat(prefix, "--form-item"), "".concat(prefix, "--checkbox-wrapper"), "".concat(prefix, "--checkbox-skeleton"), className)
|
|
23
|
+
}, rest), /*#__PURE__*/React__default.createElement("div", {
|
|
24
|
+
className: "".concat(prefix, "--checkbox-label")
|
|
25
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
24
26
|
className: "".concat(prefix, "--checkbox-label-text ").concat(prefix, "--skeleton")
|
|
25
|
-
}));
|
|
27
|
+
})));
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
CheckboxSkeleton.propTypes = {
|
|
@@ -26,9 +26,8 @@ var Checkbox = /*#__PURE__*/React__default.forwardRef(function Checkbox(_ref, _r
|
|
|
26
26
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
27
27
|
|
|
28
28
|
var prefix = usePrefix();
|
|
29
|
-
var labelClasses = cx("".concat(prefix, "--checkbox-label"), [className]);
|
|
30
|
-
var innerLabelClasses = cx("".concat(prefix, "--checkbox-label-text"), _defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLabel));
|
|
31
29
|
var wrapperClasses = cx("".concat(prefix, "--form-item"), "".concat(prefix, "--checkbox-wrapper"), [className]);
|
|
30
|
+
var innerLabelClasses = cx("".concat(prefix, "--checkbox-label-text"), _defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLabel));
|
|
32
31
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
33
32
|
className: wrapperClasses
|
|
34
33
|
}, /*#__PURE__*/React__default.createElement("input", _extends({}, other, {
|
|
@@ -54,7 +53,7 @@ var Checkbox = /*#__PURE__*/React__default.forwardRef(function Checkbox(_ref, _r
|
|
|
54
53
|
}
|
|
55
54
|
})), /*#__PURE__*/React__default.createElement("label", {
|
|
56
55
|
htmlFor: id,
|
|
57
|
-
className:
|
|
56
|
+
className: "".concat(prefix, "--checkbox-label"),
|
|
58
57
|
title: title || null
|
|
59
58
|
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
60
59
|
className: innerLabelClasses
|
|
@@ -103,8 +102,9 @@ Checkbox.propTypes = {
|
|
|
103
102
|
labelText: PropTypes.node.isRequired,
|
|
104
103
|
|
|
105
104
|
/**
|
|
106
|
-
*
|
|
107
|
-
*
|
|
105
|
+
* Provide an optional handler that is called when the internal state of
|
|
106
|
+
* Checkbox changes. This handler is called with event and state info.
|
|
107
|
+
* `(event, { checked, id }) => void`
|
|
108
108
|
*/
|
|
109
109
|
onChange: PropTypes.func,
|
|
110
110
|
|
|
@@ -10,7 +10,9 @@ import wrapComponent from '../../tools/wrapComponent.js';
|
|
|
10
10
|
var TableActionList = wrapComponent({
|
|
11
11
|
name: 'TableActionList',
|
|
12
12
|
type: 'div',
|
|
13
|
-
className:
|
|
13
|
+
className: function className(prefix) {
|
|
14
|
+
return "".concat(prefix, "--action-list");
|
|
15
|
+
}
|
|
14
16
|
});
|
|
15
17
|
var TableActionList$1 = TableActionList;
|
|
16
18
|
|
|
@@ -10,7 +10,9 @@ import wrapComponent from '../../tools/wrapComponent.js';
|
|
|
10
10
|
var TableToolbarContent = wrapComponent({
|
|
11
11
|
name: 'TableToolbarContent',
|
|
12
12
|
type: 'div',
|
|
13
|
-
className:
|
|
13
|
+
className: function className(prefix) {
|
|
14
|
+
return "".concat(prefix, "--toolbar-content");
|
|
15
|
+
}
|
|
14
16
|
});
|
|
15
17
|
var TableToolbarContent$1 = TableToolbarContent;
|
|
16
18
|
|
|
@@ -356,7 +356,7 @@ var OverflowMenu = /*#__PURE__*/function (_Component) {
|
|
|
356
356
|
"aria-label": ariaLabel,
|
|
357
357
|
id: id,
|
|
358
358
|
ref: mergeRefs(this._triggerRef, ref)
|
|
359
|
-
}), /*#__PURE__*/React__default.createElement(IconElement, iconProps
|
|
359
|
+
}), /*#__PURE__*/React__default.createElement(IconElement, iconProps), open && wrappedMenuBody));
|
|
360
360
|
}
|
|
361
361
|
}], [{
|
|
362
362
|
key: "getDerivedStateFromProps",
|
|
@@ -53,8 +53,6 @@ function ProgressStep(_ref) {
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
var SVGIcon = function SVGIcon(_ref2) {
|
|
56
|
-
var _title;
|
|
57
|
-
|
|
58
56
|
var complete = _ref2.complete,
|
|
59
57
|
current = _ref2.current,
|
|
60
58
|
description = _ref2.description,
|
|
@@ -64,7 +62,7 @@ function ProgressStep(_ref) {
|
|
|
64
62
|
if (invalid) {
|
|
65
63
|
return /*#__PURE__*/React__default.createElement(Warning, {
|
|
66
64
|
className: "".concat(prefix, "--progress__warning")
|
|
67
|
-
},
|
|
65
|
+
}, /*#__PURE__*/React__default.createElement("title", null, description));
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
if (current) {
|
|
@@ -147,7 +147,7 @@ _defineProperty(RadioButton, "propTypes", {
|
|
|
147
147
|
/**
|
|
148
148
|
* Specify the value of the <RadioButton>
|
|
149
149
|
*/
|
|
150
|
-
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
150
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
151
151
|
});
|
|
152
152
|
|
|
153
153
|
_defineProperty(RadioButton, "contextType", PrefixContext);
|
|
@@ -143,6 +143,7 @@ var Search = /*#__PURE__*/React__default.forwardRef(function Search(_ref, forwar
|
|
|
143
143
|
className: clearClasses,
|
|
144
144
|
disabled: disabled,
|
|
145
145
|
onClick: clearInput,
|
|
146
|
+
title: closeButtonLabelText,
|
|
146
147
|
type: "button"
|
|
147
148
|
}, _Close || (_Close = /*#__PURE__*/React__default.createElement(Close, null))));
|
|
148
149
|
});
|
|
@@ -64,6 +64,10 @@ function TreeNode(_ref) {
|
|
|
64
64
|
var toggleClasses = cx("".concat(prefix, "--tree-parent-node__toggle-icon"), _defineProperty({}, "".concat(prefix, "--tree-parent-node__toggle-icon--expanded"), expanded));
|
|
65
65
|
|
|
66
66
|
function handleToggleClick(event) {
|
|
67
|
+
if (disabled) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
67
71
|
onToggle === null || onToggle === void 0 ? void 0 : onToggle(event, {
|
|
68
72
|
id: id,
|
|
69
73
|
isExpanded: !expanded,
|
|
@@ -96,6 +100,10 @@ function TreeNode(_ref) {
|
|
|
96
100
|
function handleKeyDown(event) {
|
|
97
101
|
var _rest$onKeyDown;
|
|
98
102
|
|
|
103
|
+
if (disabled) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
99
107
|
if (matches(event, [ArrowLeft, ArrowRight, Enter])) {
|
|
100
108
|
event.stopPropagation();
|
|
101
109
|
}
|
|
@@ -153,7 +153,7 @@ function TreeView(_ref) {
|
|
|
153
153
|
var nodeIds = [];
|
|
154
154
|
|
|
155
155
|
if (matches(event, [Home, End])) {
|
|
156
|
-
if (multiselect && event.shiftKey && event.ctrlKey) {
|
|
156
|
+
if (multiselect && event.shiftKey && event.ctrlKey && !treeWalker.current.currentNode.getAttribute('aria-disabled')) {
|
|
157
157
|
var _treeWalker$current$c;
|
|
158
158
|
|
|
159
159
|
nodeIds.push((_treeWalker$current$c = treeWalker.current.currentNode) === null || _treeWalker$current$c === void 0 ? void 0 : _treeWalker$current$c.id);
|
|
@@ -162,7 +162,7 @@ function TreeView(_ref) {
|
|
|
162
162
|
while (match(event, Home) ? treeWalker.current.previousNode() : treeWalker.current.nextNode()) {
|
|
163
163
|
nextFocusNode = treeWalker.current.currentNode;
|
|
164
164
|
|
|
165
|
-
if (multiselect && event.shiftKey && event.ctrlKey) {
|
|
165
|
+
if (multiselect && event.shiftKey && event.ctrlKey && !nextFocusNode.getAttribute('aria-disabled')) {
|
|
166
166
|
var _nextFocusNode;
|
|
167
167
|
|
|
168
168
|
nodeIds.push((_nextFocusNode = nextFocusNode) === null || _nextFocusNode === void 0 ? void 0 : _nextFocusNode.id);
|
|
@@ -176,9 +176,11 @@ function TreeView(_ref) {
|
|
|
176
176
|
treeWalker.current.currentNode = treeWalker.current.root;
|
|
177
177
|
|
|
178
178
|
while (treeWalker.current.nextNode()) {
|
|
179
|
-
|
|
179
|
+
if (!treeWalker.current.currentNode.getAttribute('aria-disabled')) {
|
|
180
|
+
var _treeWalker$current$c2;
|
|
180
181
|
|
|
181
|
-
|
|
182
|
+
nodeIds.push((_treeWalker$current$c2 = treeWalker.current.currentNode) === null || _treeWalker$current$c2 === void 0 ? void 0 : _treeWalker$current$c2.id);
|
|
183
|
+
}
|
|
182
184
|
}
|
|
183
185
|
}
|
|
184
186
|
|
|
@@ -13,7 +13,9 @@ import wrapComponent from '../../tools/wrapComponent.js';
|
|
|
13
13
|
|
|
14
14
|
var HeaderGlobalBar = wrapComponent({
|
|
15
15
|
name: 'HeaderGlobalBar',
|
|
16
|
-
className:
|
|
16
|
+
className: function className(prefix) {
|
|
17
|
+
return "".concat(prefix, "--header__global");
|
|
18
|
+
},
|
|
17
19
|
type: 'div'
|
|
18
20
|
});
|
|
19
21
|
|
|
@@ -9,26 +9,28 @@ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _
|
|
|
9
9
|
import React__default from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
+
import { usePrefix } from '../internal/usePrefix.js';
|
|
12
13
|
|
|
13
14
|
var _excluded = ["className"];
|
|
14
15
|
|
|
15
16
|
var wrapComponent = function wrapComponent(_ref) {
|
|
16
17
|
var name = _ref.name,
|
|
17
|
-
|
|
18
|
+
getClassName = _ref.className,
|
|
18
19
|
type = _ref.type;
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
function Component(_ref2) {
|
|
21
22
|
var baseClassName = _ref2.className,
|
|
22
23
|
other = _objectWithoutProperties(_ref2, _excluded);
|
|
23
24
|
|
|
24
|
-
var
|
|
25
|
+
var prefix = usePrefix();
|
|
26
|
+
var componentClass = cx(typeof getClassName === 'function' ? getClassName(prefix) : getClassName, baseClassName);
|
|
25
27
|
return /*#__PURE__*/React__default.createElement(type, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
26
28
|
// Prevent Weird quirk where `cx` will evaluate to an empty string, '',
|
|
27
29
|
// and so we have empty `class` attributes in the resulting markup
|
|
28
30
|
// eslint-disable-next-line no-extra-boolean-cast
|
|
29
31
|
className: !!componentClass ? componentClass : undefined
|
|
30
32
|
}));
|
|
31
|
-
}
|
|
33
|
+
}
|
|
32
34
|
|
|
33
35
|
Component.displayName = name;
|
|
34
36
|
Component.propTypes = {
|
|
@@ -86,7 +86,7 @@ function _defineProperty(obj, key, value) {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
function _extends() {
|
|
89
|
-
_extends = Object.assign
|
|
89
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
90
90
|
for (var i = 1; i < arguments.length; i++) {
|
|
91
91
|
var source = arguments[i];
|
|
92
92
|
|
|
@@ -99,7 +99,6 @@ function _extends() {
|
|
|
99
99
|
|
|
100
100
|
return target;
|
|
101
101
|
};
|
|
102
|
-
|
|
103
102
|
return _extends.apply(this, arguments);
|
|
104
103
|
}
|
|
105
104
|
|
|
@@ -122,18 +121,17 @@ function _inherits(subClass, superClass) {
|
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
function _getPrototypeOf(o) {
|
|
125
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
124
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
126
125
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
127
126
|
};
|
|
128
127
|
return _getPrototypeOf(o);
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
function _setPrototypeOf(o, p) {
|
|
132
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
131
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
133
132
|
o.__proto__ = p;
|
|
134
133
|
return o;
|
|
135
134
|
};
|
|
136
|
-
|
|
137
135
|
return _setPrototypeOf(o, p);
|
|
138
136
|
}
|
|
139
137
|
|
|
@@ -55,7 +55,7 @@ var ButtonSkeleton = function ButtonSkeleton(_ref) {
|
|
|
55
55
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
56
56
|
|
|
57
57
|
var prefix = usePrefix.usePrefix();
|
|
58
|
-
var buttonClasses = cx__default["default"](className, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--skeleton"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--sm"), small || size === 'sm'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--md"), size === 'field' || size === 'md'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--xl"), size === 'xl'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--2xl"), size === '2xl'), _cx));
|
|
58
|
+
var buttonClasses = cx__default["default"](className, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--skeleton"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--sm"), small || size === 'sm'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--md"), size === 'field' || size === 'md'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--lg"), size === 'lg'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--xl"), size === 'xl'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--btn--2xl"), size === '2xl'), _cx));
|
|
59
59
|
|
|
60
60
|
var commonProps = _rollupPluginBabelHelpers.objectSpread2({
|
|
61
61
|
className: buttonClasses
|
|
@@ -29,10 +29,12 @@ var CheckboxSkeleton = function CheckboxSkeleton(_ref) {
|
|
|
29
29
|
|
|
30
30
|
var prefix = usePrefix.usePrefix();
|
|
31
31
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
32
|
-
className: cx__default["default"]("".concat(prefix, "--form-item"), "".concat(prefix, "--checkbox-wrapper"), "".concat(prefix, "--checkbox-
|
|
33
|
-
}, rest), /*#__PURE__*/React__default["default"].createElement("
|
|
32
|
+
className: cx__default["default"]("".concat(prefix, "--form-item"), "".concat(prefix, "--checkbox-wrapper"), "".concat(prefix, "--checkbox-skeleton"), className)
|
|
33
|
+
}, rest), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
34
|
+
className: "".concat(prefix, "--checkbox-label")
|
|
35
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
34
36
|
className: "".concat(prefix, "--checkbox-label-text ").concat(prefix, "--skeleton")
|
|
35
|
-
}));
|
|
37
|
+
})));
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
CheckboxSkeleton.propTypes = {
|
|
@@ -36,9 +36,8 @@ var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function Checkb
|
|
|
36
36
|
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
37
37
|
|
|
38
38
|
var prefix = usePrefix.usePrefix();
|
|
39
|
-
var labelClasses = cx__default["default"]("".concat(prefix, "--checkbox-label"), [className]);
|
|
40
|
-
var innerLabelClasses = cx__default["default"]("".concat(prefix, "--checkbox-label-text"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLabel));
|
|
41
39
|
var wrapperClasses = cx__default["default"]("".concat(prefix, "--form-item"), "".concat(prefix, "--checkbox-wrapper"), [className]);
|
|
40
|
+
var innerLabelClasses = cx__default["default"]("".concat(prefix, "--checkbox-label-text"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLabel));
|
|
42
41
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
43
42
|
className: wrapperClasses
|
|
44
43
|
}, /*#__PURE__*/React__default["default"].createElement("input", _rollupPluginBabelHelpers["extends"]({}, other, {
|
|
@@ -64,7 +63,7 @@ var Checkbox = /*#__PURE__*/React__default["default"].forwardRef(function Checkb
|
|
|
64
63
|
}
|
|
65
64
|
})), /*#__PURE__*/React__default["default"].createElement("label", {
|
|
66
65
|
htmlFor: id,
|
|
67
|
-
className:
|
|
66
|
+
className: "".concat(prefix, "--checkbox-label"),
|
|
68
67
|
title: title || null
|
|
69
68
|
}, /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
70
69
|
className: innerLabelClasses
|
|
@@ -113,8 +112,9 @@ Checkbox.propTypes = {
|
|
|
113
112
|
labelText: PropTypes__default["default"].node.isRequired,
|
|
114
113
|
|
|
115
114
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
115
|
+
* Provide an optional handler that is called when the internal state of
|
|
116
|
+
* Checkbox changes. This handler is called with event and state info.
|
|
117
|
+
* `(event, { checked, id }) => void`
|
|
118
118
|
*/
|
|
119
119
|
onChange: PropTypes__default["default"].func,
|
|
120
120
|
|
|
@@ -14,7 +14,9 @@ var wrapComponent = require('../../tools/wrapComponent.js');
|
|
|
14
14
|
var TableActionList = wrapComponent["default"]({
|
|
15
15
|
name: 'TableActionList',
|
|
16
16
|
type: 'div',
|
|
17
|
-
className:
|
|
17
|
+
className: function className(prefix) {
|
|
18
|
+
return "".concat(prefix, "--action-list");
|
|
19
|
+
}
|
|
18
20
|
});
|
|
19
21
|
var TableActionList$1 = TableActionList;
|
|
20
22
|
|
|
@@ -14,7 +14,9 @@ var wrapComponent = require('../../tools/wrapComponent.js');
|
|
|
14
14
|
var TableToolbarContent = wrapComponent["default"]({
|
|
15
15
|
name: 'TableToolbarContent',
|
|
16
16
|
type: 'div',
|
|
17
|
-
className:
|
|
17
|
+
className: function className(prefix) {
|
|
18
|
+
return "".concat(prefix, "--toolbar-content");
|
|
19
|
+
}
|
|
18
20
|
});
|
|
19
21
|
var TableToolbarContent$1 = TableToolbarContent;
|
|
20
22
|
|
|
@@ -386,7 +386,7 @@ var OverflowMenu = /*#__PURE__*/function (_Component) {
|
|
|
386
386
|
"aria-label": ariaLabel,
|
|
387
387
|
id: id,
|
|
388
388
|
ref: mergeRefs["default"](this._triggerRef, ref)
|
|
389
|
-
}), /*#__PURE__*/React__default["default"].createElement(IconElement, iconProps
|
|
389
|
+
}), /*#__PURE__*/React__default["default"].createElement(IconElement, iconProps), open && wrappedMenuBody));
|
|
390
390
|
}
|
|
391
391
|
}], [{
|
|
392
392
|
key: "getDerivedStateFromProps",
|
|
@@ -63,8 +63,6 @@ function ProgressStep(_ref) {
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
var SVGIcon = function SVGIcon(_ref2) {
|
|
66
|
-
var _title;
|
|
67
|
-
|
|
68
66
|
var complete = _ref2.complete,
|
|
69
67
|
current = _ref2.current,
|
|
70
68
|
description = _ref2.description,
|
|
@@ -74,7 +72,7 @@ function ProgressStep(_ref) {
|
|
|
74
72
|
if (invalid) {
|
|
75
73
|
return /*#__PURE__*/React__default["default"].createElement(iconsReact.Warning, {
|
|
76
74
|
className: "".concat(prefix, "--progress__warning")
|
|
77
|
-
},
|
|
75
|
+
}, /*#__PURE__*/React__default["default"].createElement("title", null, description));
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
if (current) {
|
|
@@ -157,7 +157,7 @@ _rollupPluginBabelHelpers.defineProperty(RadioButton, "propTypes", {
|
|
|
157
157
|
/**
|
|
158
158
|
* Specify the value of the <RadioButton>
|
|
159
159
|
*/
|
|
160
|
-
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number])
|
|
160
|
+
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number])
|
|
161
161
|
});
|
|
162
162
|
|
|
163
163
|
_rollupPluginBabelHelpers.defineProperty(RadioButton, "contextType", usePrefix.PrefixContext);
|
|
@@ -153,6 +153,7 @@ var Search = /*#__PURE__*/React__default["default"].forwardRef(function Search(_
|
|
|
153
153
|
className: clearClasses,
|
|
154
154
|
disabled: disabled,
|
|
155
155
|
onClick: clearInput,
|
|
156
|
+
title: closeButtonLabelText,
|
|
156
157
|
type: "button"
|
|
157
158
|
}, _Close || (_Close = /*#__PURE__*/React__default["default"].createElement(iconsReact.Close, null))));
|
|
158
159
|
});
|
|
@@ -74,6 +74,10 @@ function TreeNode(_ref) {
|
|
|
74
74
|
var toggleClasses = cx__default["default"]("".concat(prefix, "--tree-parent-node__toggle-icon"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--tree-parent-node__toggle-icon--expanded"), expanded));
|
|
75
75
|
|
|
76
76
|
function handleToggleClick(event) {
|
|
77
|
+
if (disabled) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
77
81
|
onToggle === null || onToggle === void 0 ? void 0 : onToggle(event, {
|
|
78
82
|
id: id,
|
|
79
83
|
isExpanded: !expanded,
|
|
@@ -106,6 +110,10 @@ function TreeNode(_ref) {
|
|
|
106
110
|
function handleKeyDown(event) {
|
|
107
111
|
var _rest$onKeyDown;
|
|
108
112
|
|
|
113
|
+
if (disabled) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
109
117
|
if (match.matches(event, [keys.ArrowLeft, keys.ArrowRight, keys.Enter])) {
|
|
110
118
|
event.stopPropagation();
|
|
111
119
|
}
|
|
@@ -182,7 +182,7 @@ function TreeView(_ref) {
|
|
|
182
182
|
var nodeIds = [];
|
|
183
183
|
|
|
184
184
|
if (match.matches(event, [keys.Home, keys.End])) {
|
|
185
|
-
if (multiselect && event.shiftKey && event.ctrlKey) {
|
|
185
|
+
if (multiselect && event.shiftKey && event.ctrlKey && !treeWalker.current.currentNode.getAttribute('aria-disabled')) {
|
|
186
186
|
var _treeWalker$current$c;
|
|
187
187
|
|
|
188
188
|
nodeIds.push((_treeWalker$current$c = treeWalker.current.currentNode) === null || _treeWalker$current$c === void 0 ? void 0 : _treeWalker$current$c.id);
|
|
@@ -191,7 +191,7 @@ function TreeView(_ref) {
|
|
|
191
191
|
while (match.match(event, keys.Home) ? treeWalker.current.previousNode() : treeWalker.current.nextNode()) {
|
|
192
192
|
nextFocusNode = treeWalker.current.currentNode;
|
|
193
193
|
|
|
194
|
-
if (multiselect && event.shiftKey && event.ctrlKey) {
|
|
194
|
+
if (multiselect && event.shiftKey && event.ctrlKey && !nextFocusNode.getAttribute('aria-disabled')) {
|
|
195
195
|
var _nextFocusNode;
|
|
196
196
|
|
|
197
197
|
nodeIds.push((_nextFocusNode = nextFocusNode) === null || _nextFocusNode === void 0 ? void 0 : _nextFocusNode.id);
|
|
@@ -205,9 +205,11 @@ function TreeView(_ref) {
|
|
|
205
205
|
treeWalker.current.currentNode = treeWalker.current.root;
|
|
206
206
|
|
|
207
207
|
while (treeWalker.current.nextNode()) {
|
|
208
|
-
|
|
208
|
+
if (!treeWalker.current.currentNode.getAttribute('aria-disabled')) {
|
|
209
|
+
var _treeWalker$current$c2;
|
|
209
210
|
|
|
210
|
-
|
|
211
|
+
nodeIds.push((_treeWalker$current$c2 = treeWalker.current.currentNode) === null || _treeWalker$current$c2 === void 0 ? void 0 : _treeWalker$current$c2.id);
|
|
212
|
+
}
|
|
211
213
|
}
|
|
212
214
|
}
|
|
213
215
|
|
|
@@ -17,7 +17,9 @@ var wrapComponent = require('../../tools/wrapComponent.js');
|
|
|
17
17
|
|
|
18
18
|
var HeaderGlobalBar = wrapComponent["default"]({
|
|
19
19
|
name: 'HeaderGlobalBar',
|
|
20
|
-
className:
|
|
20
|
+
className: function className(prefix) {
|
|
21
|
+
return "".concat(prefix, "--header__global");
|
|
22
|
+
},
|
|
21
23
|
type: 'div'
|
|
22
24
|
});
|
|
23
25
|
|
|
@@ -13,6 +13,7 @@ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.j
|
|
|
13
13
|
var React = require('react');
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var cx = require('classnames');
|
|
16
|
+
var usePrefix = require('../internal/usePrefix.js');
|
|
16
17
|
|
|
17
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
19
|
|
|
@@ -24,21 +25,22 @@ var _excluded = ["className"];
|
|
|
24
25
|
|
|
25
26
|
var wrapComponent = function wrapComponent(_ref) {
|
|
26
27
|
var name = _ref.name,
|
|
27
|
-
|
|
28
|
+
getClassName = _ref.className,
|
|
28
29
|
type = _ref.type;
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
function Component(_ref2) {
|
|
31
32
|
var baseClassName = _ref2.className,
|
|
32
33
|
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded);
|
|
33
34
|
|
|
34
|
-
var
|
|
35
|
+
var prefix = usePrefix.usePrefix();
|
|
36
|
+
var componentClass = cx__default["default"](typeof getClassName === 'function' ? getClassName(prefix) : getClassName, baseClassName);
|
|
35
37
|
return /*#__PURE__*/React__default["default"].createElement(type, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, other), {}, {
|
|
36
38
|
// Prevent Weird quirk where `cx` will evaluate to an empty string, '',
|
|
37
39
|
// and so we have empty `class` attributes in the resulting markup
|
|
38
40
|
// eslint-disable-next-line no-extra-boolean-cast
|
|
39
41
|
className: !!componentClass ? componentClass : undefined
|
|
40
42
|
}));
|
|
41
|
-
}
|
|
43
|
+
}
|
|
42
44
|
|
|
43
45
|
Component.displayName = name;
|
|
44
46
|
Component.propTypes = {
|
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.5.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"sass": "^1.33.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@babel/runtime": "^7.
|
|
46
|
-
"@carbon/feature-flags": "^0.
|
|
47
|
-
"@carbon/icons-react": "^11.
|
|
48
|
-
"@carbon/layout": "^11.
|
|
49
|
-
"@carbon/styles": "^1.
|
|
45
|
+
"@babel/runtime": "^7.18.3",
|
|
46
|
+
"@carbon/feature-flags": "^0.8.0",
|
|
47
|
+
"@carbon/icons-react": "^11.5.0",
|
|
48
|
+
"@carbon/layout": "^11.3.0",
|
|
49
|
+
"@carbon/styles": "^1.5.0",
|
|
50
50
|
"@carbon/telemetry": "0.1.0",
|
|
51
51
|
"classnames": "2.3.1",
|
|
52
52
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -65,33 +65,33 @@
|
|
|
65
65
|
"window-or-global": "^1.0.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@babel/core": "^7.
|
|
69
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
70
|
-
"@babel/plugin-proposal-export-default-from": "^7.
|
|
71
|
-
"@babel/plugin-proposal-export-namespace-from": "^7.
|
|
72
|
-
"@babel/plugin-transform-react-constant-elements": "^7.
|
|
73
|
-
"@babel/preset-env": "^7.
|
|
74
|
-
"@babel/preset-react": "^7.
|
|
75
|
-
"@carbon/test-utils": "^10.
|
|
76
|
-
"@carbon/themes": "^11.
|
|
68
|
+
"@babel/core": "^7.18.2",
|
|
69
|
+
"@babel/plugin-proposal-class-properties": "^7.17.12",
|
|
70
|
+
"@babel/plugin-proposal-export-default-from": "^7.17.12",
|
|
71
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.17.12",
|
|
72
|
+
"@babel/plugin-transform-react-constant-elements": "^7.17.12",
|
|
73
|
+
"@babel/preset-env": "^7.18.2",
|
|
74
|
+
"@babel/preset-react": "^7.17.12",
|
|
75
|
+
"@carbon/test-utils": "^10.25.0",
|
|
76
|
+
"@carbon/themes": "^11.4.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",
|
|
80
|
-
"@storybook/addon-a11y": "^6.
|
|
81
|
-
"@storybook/addon-actions": "^6.
|
|
82
|
-
"@storybook/addon-docs": "^6.
|
|
83
|
-
"@storybook/addon-essentials": "^6.
|
|
80
|
+
"@storybook/addon-a11y": "^6.5.6",
|
|
81
|
+
"@storybook/addon-actions": "^6.5.6",
|
|
82
|
+
"@storybook/addon-docs": "^6.5.6",
|
|
83
|
+
"@storybook/addon-essentials": "^6.5.6",
|
|
84
84
|
"@storybook/addon-knobs": "^6.4.0",
|
|
85
85
|
"@storybook/addon-notes": "^5.3.21",
|
|
86
|
-
"@storybook/addon-storysource": "^6.
|
|
87
|
-
"@storybook/builder-webpack5": "^6.
|
|
88
|
-
"@storybook/manager-webpack5": "^6.
|
|
89
|
-
"@storybook/react": "^6.
|
|
90
|
-
"@storybook/theming": "^6.
|
|
86
|
+
"@storybook/addon-storysource": "^6.5.6",
|
|
87
|
+
"@storybook/builder-webpack5": "^6.5.6",
|
|
88
|
+
"@storybook/manager-webpack5": "^6.5.6",
|
|
89
|
+
"@storybook/react": "^6.5.6",
|
|
90
|
+
"@storybook/theming": "^6.5.6",
|
|
91
91
|
"autoprefixer": "^10.4.0",
|
|
92
92
|
"babel-loader": "^8.2.3",
|
|
93
93
|
"babel-plugin-dev-expression": "^0.2.3",
|
|
94
|
-
"babel-preset-carbon": "^0.
|
|
94
|
+
"babel-preset-carbon": "^0.3.0",
|
|
95
95
|
"browserify-zlib": "^0.2.0",
|
|
96
96
|
"browserslist-config-carbon": "^11.0.0",
|
|
97
97
|
"css-loader": "^6.5.1",
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
"**/*.scss",
|
|
130
130
|
"**/*.css"
|
|
131
131
|
],
|
|
132
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "b9bfd3eceeda13379b974831fb860ff6bd8064c5"
|
|
133
133
|
}
|