@carbon/react 1.6.0 → 1.8.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/ComposedModal/ComposedModal.js +1 -1
- package/es/components/ComposedModal/index.js +4 -4
- package/es/components/DataTable/DataTable.js +1 -1
- package/es/components/DataTable/Table.js +10 -2
- package/es/components/DataTable/TableContainer.js +20 -5
- package/es/components/DataTable/TableContext.js +15 -0
- package/es/components/DataTable/TableSelectRow.js +1 -1
- package/es/components/FileUploader/FileUploader.js +8 -1
- package/es/components/FileUploader/FileUploaderButton.js +3 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +3 -1
- package/es/components/FileUploader/FileUploaderItem.js +3 -1
- package/es/components/Form/Form.js +1 -1
- package/es/components/FormGroup/FormGroup.js +4 -4
- package/es/components/FormItem/FormItem.js +5 -6
- package/es/components/InlineLoading/InlineLoading.js +9 -5
- package/es/components/Loading/Loading.js +7 -18
- package/es/components/MultiSelect/FilterableMultiSelect.js +345 -386
- package/es/components/MultiSelect/index.js +4 -8
- package/es/components/Notification/Notification.js +322 -189
- package/es/components/Popover/index.js +137 -8
- package/es/components/ProgressBar/ProgressBar.js +6 -3
- package/es/components/RadioButton/RadioButton.js +58 -99
- package/es/components/RadioButton/index.js +2 -8
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +72 -121
- package/es/components/RadioButtonGroup/index.js +2 -8
- package/es/components/Select/Select.js +14 -7
- package/es/components/Slider/Slider.js +2 -1
- package/es/components/Switch/Switch.js +0 -1
- package/es/components/TreeView/TreeView.js +19 -11
- package/es/components/UIShell/HeaderMenu.js +1 -1
- package/es/components/UIShell/HeaderMenuButton.js +4 -0
- package/es/components/UIShell/SideNavDetails.js +8 -3
- package/es/components/UIShell/SideNavLink.js +6 -9
- package/es/index.js +7 -6
- package/es/internal/createClassWrapper.js +2 -5
- package/lib/components/ComposedModal/index.js +7 -7
- package/lib/components/DataTable/DataTable.js +5 -5
- package/lib/components/DataTable/Table.js +9 -1
- package/lib/components/DataTable/TableContainer.js +19 -4
- package/lib/components/DataTable/TableContext.js +19 -0
- package/lib/components/DataTable/TableSelectRow.js +2 -2
- package/lib/components/FileUploader/FileUploader.js +8 -1
- package/lib/components/FileUploader/FileUploaderButton.js +3 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +3 -1
- package/lib/components/FileUploader/FileUploaderItem.js +3 -1
- package/lib/components/Form/Form.js +1 -1
- package/lib/components/FormGroup/FormGroup.js +4 -4
- package/lib/components/FormItem/FormItem.js +5 -6
- package/lib/components/InlineLoading/InlineLoading.js +9 -5
- package/lib/components/Loading/Loading.js +6 -17
- package/lib/components/MultiSelect/FilterableMultiSelect.js +341 -382
- package/lib/components/MultiSelect/index.js +5 -28
- package/lib/components/Notification/Notification.js +321 -188
- package/lib/components/Popover/index.js +135 -6
- package/lib/components/ProgressBar/ProgressBar.js +6 -3
- package/lib/components/RadioButton/RadioButton.js +57 -99
- package/lib/components/RadioButton/index.js +2 -25
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +68 -117
- package/lib/components/RadioButtonGroup/index.js +2 -25
- package/lib/components/Select/Select.js +14 -7
- package/lib/components/Slider/Slider.js +2 -1
- package/lib/components/Switch/Switch.js +0 -1
- package/lib/components/TreeView/TreeView.js +18 -10
- package/lib/components/UIShell/HeaderMenu.js +1 -0
- package/lib/components/UIShell/HeaderMenuButton.js +4 -0
- package/lib/components/UIShell/SideNavDetails.js +8 -3
- package/lib/components/UIShell/SideNavLink.js +6 -9
- package/lib/index.js +83 -83
- package/lib/internal/createClassWrapper.js +2 -5
- package/package.json +8 -8
- package/es/components/MultiSelect/next/FilterableMultiSelect.js +0 -542
- package/es/components/Notification/index.js +0 -42
- package/es/components/Notification/next/Notification.js +0 -663
- package/es/components/RadioButton/next/RadioButton.js +0 -130
- package/es/components/RadioButtonGroup/next/RadioButtonGroup.js +0 -141
- package/lib/components/MultiSelect/next/FilterableMultiSelect.js +0 -554
- package/lib/components/Notification/index.js +0 -51
- package/lib/components/Notification/next/Notification.js +0 -677
- package/lib/components/RadioButton/next/RadioButton.js +0 -140
- package/lib/components/RadioButtonGroup/next/RadioButtonGroup.js +0 -151
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { defineProperty as _defineProperty, objectWithoutProperties as _objectWithoutProperties, extends as _extends, inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass, typeof as _typeof } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import React__default, { Component } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import Button from '../Button/Button.js';
|
|
@@ -9,11 +9,11 @@ import * as FeatureFlags from '@carbon/feature-flags';
|
|
|
9
9
|
import { ModalHeader as ModalHeader$1 } from './next/ModalHeader.js';
|
|
10
10
|
import { ModalFooter as ModalFooter$1 } from './next/ModalFooter.js';
|
|
11
11
|
import ComposedModalNext from './next/ComposedModal.js';
|
|
12
|
-
import ComposedModal, { ModalHeader as ModalHeader$2, ModalFooter as ModalFooter$2 } from './ComposedModal.js';
|
|
13
|
-
export { ModalBody
|
|
12
|
+
import ComposedModal$1, { ModalHeader as ModalHeader$2, ModalFooter as ModalFooter$2 } from './ComposedModal.js';
|
|
13
|
+
export { ModalBody } from './ComposedModal.js';
|
|
14
14
|
|
|
15
15
|
var ModalHeader = FeatureFlags.enabled('enable-v11-release') ? ModalHeader$1 : ModalHeader$2;
|
|
16
16
|
var ModalFooter = FeatureFlags.enabled('enable-v11-release') ? ModalFooter$1 : ModalFooter$2;
|
|
17
|
-
FeatureFlags.enabled('enable-v11-release') ? ComposedModalNext : ComposedModal;
|
|
17
|
+
var ComposedModal = FeatureFlags.enabled('enable-v11-release') ? ComposedModalNext : ComposedModal$1;
|
|
18
18
|
|
|
19
|
-
export { ModalFooter, ModalHeader };
|
|
19
|
+
export { ComposedModal, ModalFooter, ModalHeader };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { defineProperty as _defineProperty, inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray
|
|
8
|
+
import { defineProperty as _defineProperty, inherits as _inherits, createSuper as _createSuper, createClass as _createClass, classCallCheck as _classCallCheck, objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import isEqual from 'lodash.isequal';
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import React__default from 'react';
|
|
9
|
+
import React__default, { useContext } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import { TableContext } from './TableContext.js';
|
|
13
14
|
|
|
14
15
|
var _excluded = ["className", "children", "useZebraStyles", "size", "isSortable", "useStaticWidth", "stickyHeader", "overflowMenuOnHover"];
|
|
15
16
|
var Table = function Table(_ref) {
|
|
@@ -25,11 +26,18 @@ var Table = function Table(_ref) {
|
|
|
25
26
|
overflowMenuOnHover = _ref.overflowMenuOnHover,
|
|
26
27
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
27
28
|
|
|
29
|
+
var _useContext = useContext(TableContext),
|
|
30
|
+
titleId = _useContext.titleId,
|
|
31
|
+
descriptionId = _useContext.descriptionId;
|
|
32
|
+
|
|
28
33
|
var prefix = usePrefix();
|
|
29
34
|
var componentClass = cx("".concat(prefix, "--data-table"), className, (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--data-table--").concat(size), size), _defineProperty(_cx, "".concat(prefix, "--data-table--sort"), isSortable), _defineProperty(_cx, "".concat(prefix, "--data-table--zebra"), useZebraStyles), _defineProperty(_cx, "".concat(prefix, "--data-table--static"), useStaticWidth), _defineProperty(_cx, "".concat(prefix, "--data-table--sticky-header"), stickyHeader), _defineProperty(_cx, "".concat(prefix, "--data-table--visible-overflow-menu"), !overflowMenuOnHover), _cx));
|
|
30
35
|
var table = /*#__PURE__*/React__default.createElement("div", {
|
|
31
36
|
className: "".concat(prefix, "--data-table-content")
|
|
32
|
-
}, /*#__PURE__*/React__default.createElement("table", _extends({
|
|
37
|
+
}, /*#__PURE__*/React__default.createElement("table", _extends({
|
|
38
|
+
"aria-labelledby": titleId,
|
|
39
|
+
"aria-describedby": descriptionId
|
|
40
|
+
}, other, {
|
|
33
41
|
className: componentClass
|
|
34
42
|
}), children));
|
|
35
43
|
return stickyHeader ? /*#__PURE__*/React__default.createElement("section", {
|
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import React__default from 'react';
|
|
11
|
+
import React__default, { useMemo } from 'react';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import { useId } from '../../internal/useId.js';
|
|
14
|
+
import { TableContext } from './TableContext.js';
|
|
13
15
|
|
|
14
16
|
var _excluded = ["className", "children", "title", "description", "stickyHeader", "useStaticWidth"];
|
|
15
17
|
|
|
@@ -24,17 +26,30 @@ var TableContainer = function TableContainer(_ref) {
|
|
|
24
26
|
useStaticWidth = _ref.useStaticWidth,
|
|
25
27
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
28
|
|
|
29
|
+
var baseId = useId('tc');
|
|
30
|
+
var titleId = "".concat(baseId, "-title");
|
|
31
|
+
var descriptionId = "".concat(baseId, "-description");
|
|
27
32
|
var prefix = usePrefix();
|
|
28
33
|
var tableContainerClasses = cx(className, "".concat(prefix, "--data-table-container"), (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--data-table--max-width"), stickyHeader), _defineProperty(_cx, "".concat(prefix, "--data-table-container--static"), useStaticWidth), _cx));
|
|
29
|
-
|
|
34
|
+
var value = useMemo(function () {
|
|
35
|
+
return {
|
|
36
|
+
titleId: title ? titleId : null,
|
|
37
|
+
descriptionId: description ? descriptionId : null
|
|
38
|
+
};
|
|
39
|
+
}, [title, description, titleId, descriptionId]);
|
|
40
|
+
return /*#__PURE__*/React__default.createElement(TableContext.Provider, {
|
|
41
|
+
value: value
|
|
42
|
+
}, /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
30
43
|
className: tableContainerClasses
|
|
31
44
|
}), title && /*#__PURE__*/React__default.createElement("div", {
|
|
32
45
|
className: "".concat(prefix, "--data-table-header")
|
|
33
46
|
}, /*#__PURE__*/React__default.createElement("h4", {
|
|
34
|
-
className: "".concat(prefix, "--data-table-header__title")
|
|
47
|
+
className: "".concat(prefix, "--data-table-header__title"),
|
|
48
|
+
id: titleId
|
|
35
49
|
}, title), /*#__PURE__*/React__default.createElement("p", {
|
|
36
|
-
className: "".concat(prefix, "--data-table-header__description")
|
|
37
|
-
|
|
50
|
+
className: "".concat(prefix, "--data-table-header__description"),
|
|
51
|
+
id: descriptionId
|
|
52
|
+
}, description)), children));
|
|
38
53
|
};
|
|
39
54
|
|
|
40
55
|
TableContainer.propTypes = {
|
|
@@ -0,0 +1,15 @@
|
|
|
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 { createContext } from 'react';
|
|
9
|
+
|
|
10
|
+
var TableContext = /*#__PURE__*/createContext({
|
|
11
|
+
titleId: null,
|
|
12
|
+
descriptionId: null
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { TableContext };
|
|
@@ -10,7 +10,7 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import InlineCheckbox from '../InlineCheckbox/InlineCheckbox.js';
|
|
13
|
-
import RadioButton from '../RadioButton/
|
|
13
|
+
import RadioButton from '../RadioButton/RadioButton.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
15
|
|
|
16
16
|
var TableSelectRow = function TableSelectRow(_ref) {
|
|
@@ -41,6 +41,8 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
|
|
|
41
41
|
|
|
42
42
|
_defineProperty(_assertThisInitialized(_this), "nodes", []);
|
|
43
43
|
|
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "uploaderButton", /*#__PURE__*/React__default.createRef());
|
|
45
|
+
|
|
44
46
|
_defineProperty(_assertThisInitialized(_this), "handleChange", function (evt) {
|
|
45
47
|
evt.stopPropagation();
|
|
46
48
|
var filenames = Array.prototype.map.call(evt.target.files, function (file) {
|
|
@@ -73,6 +75,8 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
|
|
|
73
75
|
|
|
74
76
|
if (_this.props.onDelete) {
|
|
75
77
|
_this.props.onDelete(evt);
|
|
78
|
+
|
|
79
|
+
_this.uploaderButton.current.focus();
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
_this.props.onClick(evt);
|
|
@@ -128,6 +132,7 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
|
|
|
128
132
|
}, labelTitle), /*#__PURE__*/React__default.createElement("p", {
|
|
129
133
|
className: getHelperLabelClasses("".concat(prefix, "--label-description"))
|
|
130
134
|
}, labelDescription), /*#__PURE__*/React__default.createElement(FileUploaderButton, {
|
|
135
|
+
innerRef: this.uploaderButton,
|
|
131
136
|
disabled: disabled,
|
|
132
137
|
labelText: buttonLabel,
|
|
133
138
|
multiple: multiple,
|
|
@@ -148,11 +153,13 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
|
|
|
148
153
|
} // eslint-disable-line
|
|
149
154
|
|
|
150
155
|
}, other), /*#__PURE__*/React__default.createElement("p", {
|
|
151
|
-
className: "".concat(prefix, "--file-filename")
|
|
156
|
+
className: "".concat(prefix, "--file-filename"),
|
|
157
|
+
id: name
|
|
152
158
|
}, name), /*#__PURE__*/React__default.createElement("span", {
|
|
153
159
|
className: "".concat(prefix, "--file__state-container")
|
|
154
160
|
}, /*#__PURE__*/React__default.createElement(Filename, {
|
|
155
161
|
iconDescription: iconDescription,
|
|
162
|
+
"aria-describedby": name,
|
|
156
163
|
status: filenameStatus,
|
|
157
164
|
onKeyDown: function onKeyDown(evt) {
|
|
158
165
|
if (matches(evt, [Enter, Space])) {
|
|
@@ -16,7 +16,7 @@ import * as FeatureFlags from '@carbon/feature-flags';
|
|
|
16
16
|
import { matches } from '../../internal/keyboard/match.js';
|
|
17
17
|
import { Enter, Space } from '../../internal/keyboard/keys.js';
|
|
18
18
|
|
|
19
|
-
var _excluded = ["accept", "buttonKind", "className", "disabled", "disableLabelChanges", "id", "labelText", "multiple", "onChange", "role", "name", "size", "tabIndex"];
|
|
19
|
+
var _excluded = ["accept", "buttonKind", "className", "disabled", "disableLabelChanges", "id", "labelText", "multiple", "onChange", "role", "name", "size", "tabIndex", "innerRef"];
|
|
20
20
|
|
|
21
21
|
function noop() {}
|
|
22
22
|
|
|
@@ -45,6 +45,7 @@ function FileUploaderButton(_ref) {
|
|
|
45
45
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
46
46
|
_ref$tabIndex = _ref.tabIndex,
|
|
47
47
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
|
|
48
|
+
innerRef = _ref.innerRef,
|
|
48
49
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
49
50
|
|
|
50
51
|
var prefix = usePrefix();
|
|
@@ -96,6 +97,7 @@ function FileUploaderButton(_ref) {
|
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("label", _extends({
|
|
100
|
+
ref: innerRef,
|
|
99
101
|
tabIndex: disabled ? -1 : tabIndex || 0,
|
|
100
102
|
className: classes,
|
|
101
103
|
onKeyDown: onKeyDown,
|
|
@@ -14,7 +14,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
14
14
|
import { matches } from '../../internal/keyboard/match.js';
|
|
15
15
|
import { Enter, Space } from '../../internal/keyboard/keys.js';
|
|
16
16
|
|
|
17
|
-
var _excluded = ["accept", "className", "id", "disabled", "labelText", "multiple", "name", "onAddFiles", "pattern", "role", "tabIndex"];
|
|
17
|
+
var _excluded = ["accept", "className", "id", "disabled", "labelText", "multiple", "name", "onAddFiles", "pattern", "role", "tabIndex", "innerRef"];
|
|
18
18
|
|
|
19
19
|
function FileUploaderDropContainer(_ref) {
|
|
20
20
|
var _classNames2;
|
|
@@ -30,6 +30,7 @@ function FileUploaderDropContainer(_ref) {
|
|
|
30
30
|
pattern = _ref.pattern,
|
|
31
31
|
role = _ref.role,
|
|
32
32
|
tabIndex = _ref.tabIndex,
|
|
33
|
+
innerRef = _ref.innerRef,
|
|
33
34
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
35
|
|
|
35
36
|
var prefix = usePrefix();
|
|
@@ -125,6 +126,7 @@ function FileUploaderDropContainer(_ref) {
|
|
|
125
126
|
handleChange(evt);
|
|
126
127
|
}
|
|
127
128
|
}, /*#__PURE__*/React__default.createElement("label", _extends({
|
|
129
|
+
ref: innerRef,
|
|
128
130
|
className: labelClasses,
|
|
129
131
|
htmlFor: uid,
|
|
130
132
|
tabIndex: tabIndex || 0,
|
|
@@ -42,11 +42,13 @@ function FileUploaderItem(_ref) {
|
|
|
42
42
|
className: classes
|
|
43
43
|
}, other), /*#__PURE__*/React__default.createElement("p", {
|
|
44
44
|
className: "".concat(prefix, "--file-filename"),
|
|
45
|
-
title: name
|
|
45
|
+
title: name,
|
|
46
|
+
id: name
|
|
46
47
|
}, name), /*#__PURE__*/React__default.createElement("span", {
|
|
47
48
|
className: "".concat(prefix, "--file__state-container")
|
|
48
49
|
}, /*#__PURE__*/React__default.createElement(Filename, {
|
|
49
50
|
iconDescription: iconDescription,
|
|
51
|
+
"aria-describedby": name,
|
|
50
52
|
status: status,
|
|
51
53
|
invalid: invalid,
|
|
52
54
|
onKeyDown: function onKeyDown(evt) {
|
|
@@ -22,7 +22,7 @@ var Form = function Form(_ref) {
|
|
|
22
22
|
var classNames = cx("".concat(prefix, "--form"), className);
|
|
23
23
|
return /*#__PURE__*/React__default.createElement("form", _extends({
|
|
24
24
|
className: classNames
|
|
25
|
-
}, other),
|
|
25
|
+
}, other), children);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
Form.propTypes = {
|
|
@@ -21,7 +21,7 @@ var FormGroup = function FormGroup(_ref) {
|
|
|
21
21
|
className = _ref.className,
|
|
22
22
|
message = _ref.message,
|
|
23
23
|
messageText = _ref.messageText,
|
|
24
|
-
|
|
24
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
25
25
|
|
|
26
26
|
var prefix = usePrefix();
|
|
27
27
|
var classNamesFieldset = cx("".concat(prefix, "--fieldset"), className);
|
|
@@ -29,11 +29,11 @@ var FormGroup = function FormGroup(_ref) {
|
|
|
29
29
|
'data-invalid': ''
|
|
30
30
|
}, {
|
|
31
31
|
className: classNamesFieldset
|
|
32
|
-
},
|
|
33
|
-
"aria-labelledby":
|
|
32
|
+
}, rest, {
|
|
33
|
+
"aria-labelledby": rest['aria-labelledby'] || legendId
|
|
34
34
|
}), /*#__PURE__*/React__default.createElement("legend", {
|
|
35
35
|
className: "".concat(prefix, "--label"),
|
|
36
|
-
id: legendId ||
|
|
36
|
+
id: legendId || rest['aria-labelledby']
|
|
37
37
|
}, legendText), children, message ? /*#__PURE__*/React__default.createElement("div", {
|
|
38
38
|
className: "".concat(prefix, "--form__requirements")
|
|
39
39
|
}, messageText) : null);
|
|
@@ -13,17 +13,17 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
13
13
|
|
|
14
14
|
var _excluded = ["className", "children"];
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
function FormItem(_ref) {
|
|
17
17
|
var className = _ref.className,
|
|
18
18
|
children = _ref.children,
|
|
19
|
-
|
|
19
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
20
|
|
|
21
21
|
var prefix = usePrefix();
|
|
22
22
|
var classNames = cx("".concat(prefix, "--form-item"), className);
|
|
23
23
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
24
24
|
className: classNames
|
|
25
|
-
},
|
|
26
|
-
}
|
|
25
|
+
}, rest), children);
|
|
26
|
+
}
|
|
27
27
|
|
|
28
28
|
FormItem.propTypes = {
|
|
29
29
|
/**
|
|
@@ -36,6 +36,5 @@ FormItem.propTypes = {
|
|
|
36
36
|
*/
|
|
37
37
|
className: PropTypes.string
|
|
38
38
|
};
|
|
39
|
-
var FormItem$1 = FormItem;
|
|
40
39
|
|
|
41
|
-
export { FormItem
|
|
40
|
+
export { FormItem as default };
|
|
@@ -15,8 +15,6 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
15
15
|
|
|
16
16
|
var _excluded = ["className", "status", "iconDescription", "description", "onSuccess", "successDelay"];
|
|
17
17
|
function InlineLoading(_ref) {
|
|
18
|
-
var _title, _title2;
|
|
19
|
-
|
|
20
18
|
var className = _ref.className,
|
|
21
19
|
_ref$status = _ref.status,
|
|
22
20
|
status = _ref$status === void 0 ? 'active' : _ref$status,
|
|
@@ -30,10 +28,12 @@ function InlineLoading(_ref) {
|
|
|
30
28
|
var loadingClasses = cx("".concat(prefix, "--inline-loading"), className);
|
|
31
29
|
|
|
32
30
|
var getLoading = function getLoading() {
|
|
31
|
+
var iconLabel = iconDescription ? iconDescription : status;
|
|
32
|
+
|
|
33
33
|
if (status === 'error') {
|
|
34
34
|
return /*#__PURE__*/React__default.createElement(ErrorFilled, {
|
|
35
35
|
className: "".concat(prefix, "--inline-loading--error")
|
|
36
|
-
},
|
|
36
|
+
}, /*#__PURE__*/React__default.createElement("title", null, iconLabel));
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
if (status === 'finished') {
|
|
@@ -44,13 +44,17 @@ function InlineLoading(_ref) {
|
|
|
44
44
|
}, successDelay);
|
|
45
45
|
return /*#__PURE__*/React__default.createElement(CheckmarkFilled, {
|
|
46
46
|
className: "".concat(prefix, "--inline-loading__checkmark-container")
|
|
47
|
-
},
|
|
47
|
+
}, /*#__PURE__*/React__default.createElement("title", null, iconLabel));
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (status === 'inactive' || status === 'active') {
|
|
51
|
+
if (!iconDescription) {
|
|
52
|
+
iconLabel = status === 'active' ? 'loading' : 'not loading';
|
|
53
|
+
}
|
|
54
|
+
|
|
51
55
|
return /*#__PURE__*/React__default.createElement(Loading, {
|
|
52
56
|
small: true,
|
|
53
|
-
description:
|
|
57
|
+
description: iconLabel,
|
|
54
58
|
withOverlay: false,
|
|
55
59
|
active: status === 'active'
|
|
56
60
|
});
|
|
@@ -8,18 +8,16 @@
|
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import React__default
|
|
12
|
-
import setupGetInstanceId from '../../tools/setupGetInstanceId.js';
|
|
11
|
+
import React__default from 'react';
|
|
13
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import deprecate from '../../prop-types/deprecate.js';
|
|
14
14
|
|
|
15
|
-
var _excluded = ["
|
|
16
|
-
var getInstanceId = setupGetInstanceId();
|
|
15
|
+
var _excluded = ["active", "className", "withOverlay", "small", "description"];
|
|
17
16
|
|
|
18
17
|
function Loading(_ref) {
|
|
19
18
|
var _cx, _cx2;
|
|
20
19
|
|
|
21
|
-
var
|
|
22
|
-
active = _ref.active,
|
|
20
|
+
var active = _ref.active,
|
|
23
21
|
customClassName = _ref.className,
|
|
24
22
|
withOverlay = _ref.withOverlay,
|
|
25
23
|
small = _ref.small,
|
|
@@ -27,22 +25,13 @@ function Loading(_ref) {
|
|
|
27
25
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
28
26
|
|
|
29
27
|
var prefix = usePrefix();
|
|
30
|
-
|
|
31
|
-
var _useRef = useRef(getInstanceId()),
|
|
32
|
-
instanceId = _useRef.current;
|
|
33
|
-
|
|
34
28
|
var loadingClassName = cx(customClassName, (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--loading"), true), _defineProperty(_cx, "".concat(prefix, "--loading--small"), small), _defineProperty(_cx, "".concat(prefix, "--loading--stop"), !active), _cx));
|
|
35
29
|
var overlayClassName = cx((_cx2 = {}, _defineProperty(_cx2, "".concat(prefix, "--loading-overlay"), true), _defineProperty(_cx2, "".concat(prefix, "--loading-overlay--stop"), !active), _cx2));
|
|
36
|
-
var loadingId = id || "loading-id-".concat(instanceId);
|
|
37
30
|
var loading = /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
38
31
|
"aria-atomic": "true",
|
|
39
|
-
"aria-labelledby": loadingId,
|
|
40
32
|
"aria-live": active ? 'assertive' : 'off',
|
|
41
33
|
className: loadingClassName
|
|
42
|
-
}), /*#__PURE__*/React__default.createElement("
|
|
43
|
-
id: loadingId,
|
|
44
|
-
className: "".concat(prefix, "--visually-hidden")
|
|
45
|
-
}, description), /*#__PURE__*/React__default.createElement("svg", {
|
|
34
|
+
}), /*#__PURE__*/React__default.createElement("svg", {
|
|
46
35
|
className: "".concat(prefix, "--loading__svg"),
|
|
47
36
|
viewBox: "0 0 100 100"
|
|
48
37
|
}, /*#__PURE__*/React__default.createElement("title", null, description), small ? /*#__PURE__*/React__default.createElement("circle", {
|
|
@@ -80,7 +69,7 @@ Loading.propTypes = {
|
|
|
80
69
|
/**
|
|
81
70
|
* Provide an `id` to uniquely identify the label
|
|
82
71
|
*/
|
|
83
|
-
id: PropTypes.string,
|
|
72
|
+
id: deprecate(PropTypes.string, "\nThe prop `id` is no longer needed."),
|
|
84
73
|
|
|
85
74
|
/**
|
|
86
75
|
* Specify whether you would like the small variant of <Loading>
|
|
@@ -96,7 +85,7 @@ Loading.defaultProps = {
|
|
|
96
85
|
active: true,
|
|
97
86
|
withOverlay: true,
|
|
98
87
|
small: false,
|
|
99
|
-
description: '
|
|
88
|
+
description: 'loading'
|
|
100
89
|
};
|
|
101
90
|
|
|
102
91
|
export { Loading as default };
|