@carbon/react 1.14.0 → 1.15.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/ContainedList/ContainedList.js +67 -0
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +76 -0
- package/es/components/ContainedList/index.js +13 -0
- package/es/components/DataTable/DataTable.js +3 -2
- package/es/components/DataTable/state/getDerivedStateFromProps.js +3 -0
- package/es/components/Dropdown/Dropdown.js +22 -4
- package/es/components/ExpandableSearch/ExpandableSearch.js +25 -12
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +41 -0
- package/es/components/FluidDropdown/FluidDropdown.js +140 -0
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +42 -0
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +42 -0
- package/es/components/ListBox/ListBox.js +10 -3
- package/es/components/Loading/Loading.js +8 -10
- package/es/components/MultiSelect/FilterableMultiSelect.js +5 -1
- package/es/components/Search/Search.js +2 -1
- package/es/components/Search/next/Search.js +11 -15
- package/es/components/Slider/Slider.js +25 -24
- package/es/components/TextInput/TextInput.js +1 -1
- package/es/index.js +8 -1
- package/lib/components/ContainedList/ContainedList.js +77 -0
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +86 -0
- package/lib/components/ContainedList/index.js +18 -0
- package/lib/components/DataTable/DataTable.js +3 -2
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +3 -0
- package/lib/components/Dropdown/Dropdown.js +20 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +24 -11
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +51 -0
- package/lib/components/FluidDropdown/FluidDropdown.js +150 -0
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +52 -0
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +52 -0
- package/lib/components/ListBox/ListBox.js +9 -2
- package/lib/components/Loading/Loading.js +8 -10
- package/lib/components/MultiSelect/FilterableMultiSelect.js +4 -0
- package/lib/components/Search/Search.js +2 -1
- package/lib/components/Search/next/Search.js +11 -15
- package/lib/components/Slider/Slider.js +25 -24
- package/lib/components/TextInput/TextInput.js +1 -1
- package/lib/index.js +15 -2
- package/package.json +4 -4
- package/scss/components/fluid-dropdown/_fluid-dropdown.scss +9 -0
- package/scss/components/fluid-dropdown/_index.scss +9 -0
- package/scss/components/fluid-list-box/_fluid-list-box.scss +9 -0
- package/scss/components/fluid-list-box/_index.scss +9 -0
- package/scss/components/fluid-text-area/_fluid-text-area.scss +9 -0
- package/scss/components/fluid-text-area/_index.scss +9 -0
- package/scss/components/fluid-text-input/_fluid-text-input.scss +9 -0
- package/scss/components/fluid-text-input/_index.scss +9 -0
|
@@ -0,0 +1,150 @@
|
|
|
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 PropTypes = require('prop-types');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var cx = require('classnames');
|
|
16
|
+
var Dropdown = require('../Dropdown/Dropdown.js');
|
|
17
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
|
+
var FormContext = require('../FluidForm/FormContext.js');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
+
|
|
22
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
|
+
|
|
26
|
+
var _excluded = ["className", "isCondensed"];
|
|
27
|
+
var FluidDropdown = /*#__PURE__*/React__default["default"].forwardRef(function FluidDropdown(_ref, ref) {
|
|
28
|
+
var className = _ref.className,
|
|
29
|
+
isCondensed = _ref.isCondensed,
|
|
30
|
+
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
|
|
32
|
+
var prefix = usePrefix.usePrefix();
|
|
33
|
+
var classNames = cx__default["default"]("".concat(prefix, "--list-box__wrapper--fluid"), className, _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--list-box__wrapper--fluid--condensed"), isCondensed));
|
|
34
|
+
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
35
|
+
value: {
|
|
36
|
+
isFluid: true
|
|
37
|
+
}
|
|
38
|
+
}, /*#__PURE__*/React__default["default"].createElement(Dropdown["default"], _rollupPluginBabelHelpers["extends"]({
|
|
39
|
+
ref: ref,
|
|
40
|
+
className: classNames
|
|
41
|
+
}, other)));
|
|
42
|
+
});
|
|
43
|
+
FluidDropdown.propTypes = {
|
|
44
|
+
/**
|
|
45
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
46
|
+
*/
|
|
47
|
+
className: PropTypes__default["default"].string,
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Specify the direction of the dropdown. Can be either top or bottom.
|
|
51
|
+
*/
|
|
52
|
+
direction: PropTypes__default["default"].oneOf(['top', 'bottom']),
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Specify whether the `<input>` should be disabled
|
|
56
|
+
*/
|
|
57
|
+
disabled: PropTypes__default["default"].bool,
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Specify a custom `id` for the `<input>`
|
|
61
|
+
*/
|
|
62
|
+
id: PropTypes__default["default"].string.isRequired,
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Allow users to pass in an arbitrary item or a string (in case their items are an array of strings)
|
|
66
|
+
* from their collection that are pre-selected
|
|
67
|
+
*/
|
|
68
|
+
initialSelectedItem: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Specify if the currently selected value is invalid.
|
|
72
|
+
*/
|
|
73
|
+
invalid: PropTypes__default["default"].bool,
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Provide the text that is displayed when the control is in an invalid state
|
|
77
|
+
*/
|
|
78
|
+
invalidText: PropTypes__default["default"].node,
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Specify if the `FluidDropdown` should render its menu items in condensed mode
|
|
82
|
+
*/
|
|
83
|
+
isCondensed: PropTypes__default["default"].bool,
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Function to render items as custom components instead of strings.
|
|
87
|
+
* Defaults to null and is overridden by a getter
|
|
88
|
+
*/
|
|
89
|
+
itemToElement: PropTypes__default["default"].func,
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Helper function passed to downshift that allows the library to render a
|
|
93
|
+
* given item to a string label. By default, it extracts the `label` field
|
|
94
|
+
* from a given item to serve as the item label in the list.
|
|
95
|
+
*/
|
|
96
|
+
itemToString: PropTypes__default["default"].func,
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* We try to stay as generic as possible here to allow individuals to pass
|
|
100
|
+
* in a collection of whatever kind of data structure they prefer
|
|
101
|
+
*/
|
|
102
|
+
items: PropTypes__default["default"].array.isRequired,
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Generic `label` that will be used as the textual representation of what
|
|
106
|
+
* this field is for
|
|
107
|
+
*/
|
|
108
|
+
label: PropTypes__default["default"].node.isRequired,
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* `onChange` is a utility for this controlled component to communicate to a
|
|
112
|
+
* consuming component what kind of internal state changes are occurring.
|
|
113
|
+
*/
|
|
114
|
+
onChange: PropTypes__default["default"].func,
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* An optional callback to render the currently selected item as a react element instead of only
|
|
118
|
+
* as a string.
|
|
119
|
+
*/
|
|
120
|
+
renderSelectedItem: PropTypes__default["default"].func,
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* In the case you want to control the dropdown selection entirely.
|
|
124
|
+
*/
|
|
125
|
+
selectedItem: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Provide the title text that will be read by a screen reader when
|
|
129
|
+
* visiting this control
|
|
130
|
+
*/
|
|
131
|
+
titleText: PropTypes__default["default"].node,
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Callback function for translating ListBoxMenuIcon SVG title
|
|
135
|
+
*/
|
|
136
|
+
translateWithId: PropTypes__default["default"].func,
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Specify whether the control is currently in warning state
|
|
140
|
+
*/
|
|
141
|
+
warn: PropTypes__default["default"].bool,
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Provide the text that is displayed when the control is in warning state
|
|
145
|
+
*/
|
|
146
|
+
warnText: PropTypes__default["default"].node
|
|
147
|
+
};
|
|
148
|
+
var FluidDropdown$1 = FluidDropdown;
|
|
149
|
+
|
|
150
|
+
exports["default"] = FluidDropdown$1;
|
|
@@ -0,0 +1,52 @@
|
|
|
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 PropTypes = require('prop-types');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var cx = require('classnames');
|
|
16
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
|
+
var FormContext = require('../FluidForm/FormContext.js');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
+
|
|
21
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
|
+
|
|
25
|
+
var _excluded = ["className"];
|
|
26
|
+
|
|
27
|
+
function FluidTextAreaSkeleton(_ref) {
|
|
28
|
+
var className = _ref.className,
|
|
29
|
+
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
|
|
31
|
+
var prefix = usePrefix.usePrefix();
|
|
32
|
+
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
33
|
+
value: {
|
|
34
|
+
isFluid: true
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
37
|
+
className: cx__default["default"]("".concat(prefix, "--form-item ").concat(prefix, "--text-area--fluid__skeleton"), className)
|
|
38
|
+
}, other), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
39
|
+
className: "".concat(prefix, "--label ").concat(prefix, "--skeleton")
|
|
40
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
41
|
+
className: "".concat(prefix, "--skeleton ").concat(prefix, "--text-area")
|
|
42
|
+
})));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
FluidTextAreaSkeleton.propTypes = {
|
|
46
|
+
/**
|
|
47
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
48
|
+
*/
|
|
49
|
+
className: PropTypes__default["default"].string
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
exports["default"] = FluidTextAreaSkeleton;
|
|
@@ -0,0 +1,52 @@
|
|
|
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 PropTypes = require('prop-types');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var cx = require('classnames');
|
|
16
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
|
+
var FormContext = require('../FluidForm/FormContext.js');
|
|
18
|
+
|
|
19
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
+
|
|
21
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
|
+
|
|
25
|
+
var _excluded = ["className"];
|
|
26
|
+
|
|
27
|
+
function FluidTextInputSkeleton(_ref) {
|
|
28
|
+
var className = _ref.className,
|
|
29
|
+
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
|
|
31
|
+
var prefix = usePrefix.usePrefix();
|
|
32
|
+
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
33
|
+
value: {
|
|
34
|
+
isFluid: true
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
37
|
+
className: cx__default["default"]("".concat(prefix, "--form-item ").concat(prefix, "--text-input--fluid__skeleton"), className)
|
|
38
|
+
}, other), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
39
|
+
className: "".concat(prefix, "--label ").concat(prefix, "--skeleton")
|
|
40
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
41
|
+
className: "".concat(prefix, "--skeleton ").concat(prefix, "--text-input")
|
|
42
|
+
})));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
FluidTextInputSkeleton.propTypes = {
|
|
46
|
+
/**
|
|
47
|
+
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
48
|
+
*/
|
|
49
|
+
className: PropTypes__default["default"].string
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
exports["default"] = FluidTextInputSkeleton;
|
|
@@ -20,6 +20,7 @@ var ListBoxMenu = require('./ListBoxMenu.js');
|
|
|
20
20
|
var ListBoxMenuIcon = require('./ListBoxMenuIcon.js');
|
|
21
21
|
var ListBoxMenuItem = require('./ListBoxMenuItem.js');
|
|
22
22
|
var ListBoxSelection = require('./ListBoxSelection.js');
|
|
23
|
+
var FormContext = require('../FluidForm/FormContext.js');
|
|
23
24
|
|
|
24
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
26
|
|
|
@@ -62,15 +63,21 @@ var ListBox = /*#__PURE__*/React__default["default"].forwardRef(function ListBox
|
|
|
62
63
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
63
64
|
|
|
64
65
|
var prefix = usePrefix.usePrefix();
|
|
66
|
+
|
|
67
|
+
var _useContext = React.useContext(FormContext.FormContext),
|
|
68
|
+
isFluid = _useContext.isFluid;
|
|
69
|
+
|
|
65
70
|
var showWarning = !invalid && warn;
|
|
66
|
-
var className = cx__default["default"]((_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, containerClassName, !!containerClassName), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--").concat(size), size), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--inline"), type === 'inline'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--disabled"), disabled), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--light"), light), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--expanded"), isOpen), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--warning"), showWarning), _cx));
|
|
71
|
+
var className = cx__default["default"]((_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, containerClassName, !!containerClassName), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--").concat(size), size), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--inline"), type === 'inline'), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--disabled"), disabled), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--light"), light), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--expanded"), isOpen), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--invalid"), invalid), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--list-box--warning"), showWarning), _cx));
|
|
67
72
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
68
73
|
className: className,
|
|
69
74
|
ref: ref,
|
|
70
75
|
onKeyDown: handleOnKeyDown,
|
|
71
76
|
onClick: handleClick,
|
|
72
77
|
"data-invalid": invalid || undefined
|
|
73
|
-
}), children),
|
|
78
|
+
}), children), isFluid && /*#__PURE__*/React__default["default"].createElement("hr", {
|
|
79
|
+
className: "".concat(prefix, "--list-box__divider")
|
|
80
|
+
}), invalid ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
74
81
|
className: "".concat(prefix, "--form-requirement")
|
|
75
82
|
}, invalidText) : null, showWarning ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
76
83
|
className: "".concat(prefix, "--form-requirement")
|
|
@@ -27,11 +27,15 @@ var _excluded = ["active", "className", "withOverlay", "small", "description"];
|
|
|
27
27
|
function Loading(_ref) {
|
|
28
28
|
var _cx, _cx2;
|
|
29
29
|
|
|
30
|
-
var active = _ref.active,
|
|
30
|
+
var _ref$active = _ref.active,
|
|
31
|
+
active = _ref$active === void 0 ? true : _ref$active,
|
|
31
32
|
customClassName = _ref.className,
|
|
32
|
-
withOverlay = _ref.withOverlay,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
_ref$withOverlay = _ref.withOverlay,
|
|
34
|
+
withOverlay = _ref$withOverlay === void 0 ? true : _ref$withOverlay,
|
|
35
|
+
_ref$small = _ref.small,
|
|
36
|
+
small = _ref$small === void 0 ? false : _ref$small,
|
|
37
|
+
_ref$description = _ref.description,
|
|
38
|
+
description = _ref$description === void 0 ? 'loading' : _ref$description,
|
|
35
39
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
36
40
|
|
|
37
41
|
var prefix = usePrefix.usePrefix();
|
|
@@ -91,11 +95,5 @@ Loading.propTypes = {
|
|
|
91
95
|
*/
|
|
92
96
|
withOverlay: PropTypes__default["default"].bool
|
|
93
97
|
};
|
|
94
|
-
Loading.defaultProps = {
|
|
95
|
-
active: true,
|
|
96
|
-
withOverlay: true,
|
|
97
|
-
small: false,
|
|
98
|
-
description: 'loading'
|
|
99
|
-
};
|
|
100
98
|
|
|
101
99
|
exports["default"] = Loading;
|
|
@@ -292,6 +292,10 @@ var FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(fu
|
|
|
292
292
|
if (match.match(event, keys.Space)) {
|
|
293
293
|
event.stopPropagation();
|
|
294
294
|
}
|
|
295
|
+
|
|
296
|
+
if (match.match(event, keys.Tab)) {
|
|
297
|
+
handleOnMenuChange(false);
|
|
298
|
+
}
|
|
295
299
|
},
|
|
296
300
|
onFocus: function onFocus() {
|
|
297
301
|
setInputFocused(true);
|
|
@@ -29,7 +29,7 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
29
29
|
|
|
30
30
|
var _Close;
|
|
31
31
|
|
|
32
|
-
var _excluded = ["className", "type", "id", "placeHolderText", "placeholder", "labelText", "closeButtonLabelText", "small", "size", "light", "disabled", "onChange", "onKeyDown", "renderIcon", "onClear"];
|
|
32
|
+
var _excluded = ["className", "type", "id", "placeHolderText", "placeholder", "labelText", "closeButtonLabelText", "small", "size", "light", "disabled", "onChange", "onKeyDown", "renderIcon", "onClear", "onExpand"];
|
|
33
33
|
|
|
34
34
|
var Search = /*#__PURE__*/function (_Component) {
|
|
35
35
|
_rollupPluginBabelHelpers.inherits(Search, _Component);
|
|
@@ -114,6 +114,7 @@ var Search = /*#__PURE__*/function (_Component) {
|
|
|
114
114
|
onKeyDown = _this$props.onKeyDown,
|
|
115
115
|
renderIcon = _this$props.renderIcon;
|
|
116
116
|
_this$props.onClear;
|
|
117
|
+
_this$props.onExpand;
|
|
117
118
|
var other = _rollupPluginBabelHelpers.objectWithoutProperties(_this$props, _excluded);
|
|
118
119
|
|
|
119
120
|
var hasContent = this.state.hasContent;
|
|
@@ -88,19 +88,19 @@ var Search = /*#__PURE__*/React__default["default"].forwardRef(function Search(_
|
|
|
88
88
|
setPrevValue(value);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
function clearInput(
|
|
91
|
+
function clearInput() {
|
|
92
92
|
if (!value) {
|
|
93
93
|
inputRef.current.value = '';
|
|
94
|
-
onChange(event);
|
|
95
|
-
} else {
|
|
96
|
-
var clearedEvt = Object.assign({}, event.target, {
|
|
97
|
-
target: {
|
|
98
|
-
value: ''
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
onChange(clearedEvt);
|
|
102
94
|
}
|
|
103
95
|
|
|
96
|
+
var inputTarget = Object.assign({}, inputRef.current, {
|
|
97
|
+
value: ''
|
|
98
|
+
});
|
|
99
|
+
var clearedEvt = {
|
|
100
|
+
target: inputTarget,
|
|
101
|
+
type: 'change'
|
|
102
|
+
};
|
|
103
|
+
onChange(clearedEvt);
|
|
104
104
|
onClear();
|
|
105
105
|
setHasContent(false);
|
|
106
106
|
index.focus(inputRef);
|
|
@@ -113,7 +113,7 @@ var Search = /*#__PURE__*/React__default["default"].forwardRef(function Search(_
|
|
|
113
113
|
function handleKeyDown(event) {
|
|
114
114
|
if (match.match(event, keys.Escape)) {
|
|
115
115
|
event.stopPropagation();
|
|
116
|
-
clearInput(
|
|
116
|
+
clearInput();
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -124,11 +124,7 @@ var Search = /*#__PURE__*/React__default["default"].forwardRef(function Search(_
|
|
|
124
124
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
125
125
|
role: onExpand ? 'button' : null,
|
|
126
126
|
className: "".concat(prefix, "--search-magnifier"),
|
|
127
|
-
onClick:
|
|
128
|
-
if (onExpand) {
|
|
129
|
-
onExpand();
|
|
130
|
-
}
|
|
131
|
-
}
|
|
127
|
+
onClick: onExpand
|
|
132
128
|
}, /*#__PURE__*/React__default["default"].createElement(CustomSearchIcon, {
|
|
133
129
|
icon: renderIcon
|
|
134
130
|
})), /*#__PURE__*/React__default["default"].createElement("label", {
|
|
@@ -236,13 +236,14 @@ var Slider = /*#__PURE__*/function (_PureComponent) {
|
|
|
236
236
|
|
|
237
237
|
_this.setState({
|
|
238
238
|
value: value,
|
|
239
|
-
left: left
|
|
240
|
-
needsOnRelease: true
|
|
239
|
+
left: left
|
|
241
240
|
});
|
|
242
241
|
}
|
|
243
242
|
});
|
|
244
243
|
|
|
245
244
|
_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.assertThisInitialized(_this), "onBlur", function (evt) {
|
|
245
|
+
var _this$props$onBlur, _this$props;
|
|
246
|
+
|
|
246
247
|
// Do nothing if we have no valid event, target, or value
|
|
247
248
|
if (!evt || !('target' in evt) || typeof evt.target.value !== 'string') {
|
|
248
249
|
return;
|
|
@@ -256,7 +257,7 @@ var Slider = /*#__PURE__*/function (_PureComponent) {
|
|
|
256
257
|
isValid: validity
|
|
257
258
|
});
|
|
258
259
|
|
|
259
|
-
_this.props.onBlur({
|
|
260
|
+
(_this$props$onBlur = (_this$props = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props, {
|
|
260
261
|
value: value
|
|
261
262
|
});
|
|
262
263
|
});
|
|
@@ -407,27 +408,27 @@ var Slider = /*#__PURE__*/function (_PureComponent) {
|
|
|
407
408
|
value: function render() {
|
|
408
409
|
var _this2 = this;
|
|
409
410
|
|
|
410
|
-
var _this$
|
|
411
|
-
ariaLabelInput = _this$
|
|
412
|
-
className = _this$
|
|
413
|
-
hideTextInput = _this$
|
|
414
|
-
_this$
|
|
415
|
-
id = _this$
|
|
416
|
-
min = _this$
|
|
417
|
-
minLabel = _this$
|
|
418
|
-
max = _this$
|
|
419
|
-
maxLabel = _this$
|
|
420
|
-
_this$
|
|
421
|
-
formatLabel = _this$
|
|
422
|
-
labelText = _this$
|
|
423
|
-
step = _this$
|
|
424
|
-
_this$
|
|
425
|
-
var inputType = _this$
|
|
426
|
-
required = _this$
|
|
427
|
-
disabled = _this$
|
|
428
|
-
name = _this$
|
|
429
|
-
light = _this$
|
|
430
|
-
other = _rollupPluginBabelHelpers.objectWithoutProperties(_this$
|
|
411
|
+
var _this$props2 = this.props,
|
|
412
|
+
ariaLabelInput = _this$props2.ariaLabelInput,
|
|
413
|
+
className = _this$props2.className,
|
|
414
|
+
hideTextInput = _this$props2.hideTextInput,
|
|
415
|
+
_this$props2$id = _this$props2.id,
|
|
416
|
+
id = _this$props2$id === void 0 ? this.inputId = this.inputId || "__carbon-slider_".concat(Math.random().toString(36).substr(2)) : _this$props2$id,
|
|
417
|
+
min = _this$props2.min,
|
|
418
|
+
minLabel = _this$props2.minLabel,
|
|
419
|
+
max = _this$props2.max,
|
|
420
|
+
maxLabel = _this$props2.maxLabel,
|
|
421
|
+
_this$props2$formatLa = _this$props2.formatLabel,
|
|
422
|
+
formatLabel = _this$props2$formatLa === void 0 ? defaultFormatLabel : _this$props2$formatLa,
|
|
423
|
+
labelText = _this$props2.labelText,
|
|
424
|
+
step = _this$props2.step;
|
|
425
|
+
_this$props2.stepMultiplier;
|
|
426
|
+
var inputType = _this$props2.inputType,
|
|
427
|
+
required = _this$props2.required,
|
|
428
|
+
disabled = _this$props2.disabled,
|
|
429
|
+
name = _this$props2.name,
|
|
430
|
+
light = _this$props2.light,
|
|
431
|
+
other = _rollupPluginBabelHelpers.objectWithoutProperties(_this$props2, _excluded);
|
|
431
432
|
|
|
432
433
|
delete other.onRelease;
|
|
433
434
|
delete other.invalid;
|
|
@@ -248,7 +248,7 @@ TextInput.propTypes = {
|
|
|
248
248
|
light: PropTypes__default["default"].bool,
|
|
249
249
|
|
|
250
250
|
/**
|
|
251
|
-
* Max character count allowed for the
|
|
251
|
+
* Max character count allowed for the input. This is needed in order for enableCounter to display
|
|
252
252
|
*/
|
|
253
253
|
maxCount: PropTypes__default["default"].number,
|
|
254
254
|
|
package/lib/index.js
CHANGED
|
@@ -96,6 +96,7 @@ var Tabs_Skeleton = require('./components/Tabs/Tabs.Skeleton.js');
|
|
|
96
96
|
var TextInput_Skeleton = require('./components/TextInput/TextInput.Skeleton.js');
|
|
97
97
|
var ToggleSmall_Skeleton = require('./components/ToggleSmall/ToggleSmall.Skeleton.js');
|
|
98
98
|
var Icon_Skeleton = require('./components/Icon/Icon.Skeleton.js');
|
|
99
|
+
require('./components/ContainedList/index.js');
|
|
99
100
|
var index$i = require('./components/FeatureFlags/index.js');
|
|
100
101
|
var index$j = require('./components/Heading/index.js');
|
|
101
102
|
var index$k = require('./components/IconButton/index.js');
|
|
@@ -124,9 +125,12 @@ var SideNavFooter = require('./components/UIShell/SideNavFooter.js');
|
|
|
124
125
|
var SideNavIcon = require('./components/UIShell/SideNavIcon.js');
|
|
125
126
|
var SideNavItem = require('./components/UIShell/SideNavItem.js');
|
|
126
127
|
var SideNavLinkText = require('./components/UIShell/SideNavLinkText.js');
|
|
128
|
+
var ContainedListItem = require('./components/ContainedList/ContainedListItem/ContainedListItem.js');
|
|
127
129
|
var useContextMenu = require('./components/ContextMenu/useContextMenu.js');
|
|
128
|
-
var FluidTextInput = require('./components/FluidTextInput/FluidTextInput.js');
|
|
129
130
|
var FluidTextArea = require('./components/FluidTextArea/FluidTextArea.js');
|
|
131
|
+
var FluidTextArea_Skeleton = require('./components/FluidTextArea/FluidTextArea.Skeleton.js');
|
|
132
|
+
var FluidTextInput = require('./components/FluidTextInput/FluidTextInput.js');
|
|
133
|
+
var FluidTextInput_Skeleton = require('./components/FluidTextInput/FluidTextInput.Skeleton.js');
|
|
130
134
|
var MenuDivider = require('./components/Menu/MenuDivider.js');
|
|
131
135
|
var MenuGroup = require('./components/Menu/MenuGroup.js');
|
|
132
136
|
var MenuItem = require('./components/Menu/MenuItem.js');
|
|
@@ -138,6 +142,7 @@ var ProgressBar = require('./components/ProgressBar/ProgressBar.js');
|
|
|
138
142
|
var MultiSelect = require('./components/MultiSelect/MultiSelect.js');
|
|
139
143
|
var TextInput = require('./components/TextInput/TextInput.js');
|
|
140
144
|
var TreeView = require('./components/TreeView/TreeView.js');
|
|
145
|
+
var ContainedList = require('./components/ContainedList/ContainedList.js');
|
|
141
146
|
var Menu = require('./components/Menu/Menu.js');
|
|
142
147
|
var Breadcrumb = require('./components/Breadcrumb/Breadcrumb.js');
|
|
143
148
|
var BreadcrumbItem = require('./components/Breadcrumb/BreadcrumbItem.js');
|
|
@@ -198,6 +203,8 @@ var SideNavLink = require('./components/UIShell/SideNavLink.js');
|
|
|
198
203
|
var SideNavMenu = require('./components/UIShell/SideNavMenu.js');
|
|
199
204
|
var SideNavMenuItem = require('./components/UIShell/SideNavMenuItem.js');
|
|
200
205
|
var SideNavSwitcher = require('./components/UIShell/SideNavSwitcher.js');
|
|
206
|
+
var FluidDropdown = require('./components/FluidDropdown/FluidDropdown.js');
|
|
207
|
+
var FluidDropdown_Skeleton = require('./components/FluidDropdown/FluidDropdown.Skeleton.js');
|
|
201
208
|
var LayoutDirection = require('./components/Layout/LayoutDirection.js');
|
|
202
209
|
var useLayoutDirection = require('./components/Layout/useLayoutDirection.js');
|
|
203
210
|
var Stack = require('./components/Stack/Stack.js');
|
|
@@ -339,9 +346,12 @@ exports.SideNavFooter = SideNavFooter["default"];
|
|
|
339
346
|
exports.SideNavIcon = SideNavIcon["default"];
|
|
340
347
|
exports.SideNavItem = SideNavItem["default"];
|
|
341
348
|
exports.SideNavLinkText = SideNavLinkText["default"];
|
|
349
|
+
exports.unstable_ContainedListItem = ContainedListItem["default"];
|
|
342
350
|
exports.unstable_useContextMenu = useContextMenu["default"];
|
|
343
|
-
exports.unstable__FluidTextInput = FluidTextInput["default"];
|
|
344
351
|
exports.unstable__FluidTextArea = FluidTextArea["default"];
|
|
352
|
+
exports.unstable__FluidTextAreaSkeleton = FluidTextArea_Skeleton["default"];
|
|
353
|
+
exports.unstable__FluidTextInput = FluidTextInput["default"];
|
|
354
|
+
exports.unstable__FluidTextInputSkeleton = FluidTextInput_Skeleton["default"];
|
|
345
355
|
exports.unstable_MenuDivider = MenuDivider["default"];
|
|
346
356
|
exports.unstable_MenuGroup = MenuGroup["default"];
|
|
347
357
|
exports.unstable_MenuItem = MenuItem["default"];
|
|
@@ -353,6 +363,7 @@ exports.ProgressBar = ProgressBar["default"];
|
|
|
353
363
|
exports.MultiSelect = MultiSelect["default"];
|
|
354
364
|
exports.TextInput = TextInput["default"];
|
|
355
365
|
exports.TreeView = TreeView["default"];
|
|
366
|
+
exports.unstable_ContainedList = ContainedList["default"];
|
|
356
367
|
exports.unstable_Menu = Menu["default"];
|
|
357
368
|
exports.Breadcrumb = Breadcrumb["default"];
|
|
358
369
|
exports.BreadcrumbItem = BreadcrumbItem["default"];
|
|
@@ -422,6 +433,8 @@ exports.SideNavLink = SideNavLink["default"];
|
|
|
422
433
|
exports.SideNavMenu = SideNavMenu.SideNavMenu;
|
|
423
434
|
exports.SideNavMenuItem = SideNavMenuItem["default"];
|
|
424
435
|
exports.SideNavSwitcher = SideNavSwitcher["default"];
|
|
436
|
+
exports.unstable__FluidDropdown = FluidDropdown["default"];
|
|
437
|
+
exports.unstable__FluidDropdownSkeleton = FluidDropdown_Skeleton["default"];
|
|
425
438
|
exports.unstable_LayoutDirection = LayoutDirection.LayoutDirection;
|
|
426
439
|
exports.unstable_useLayoutDirection = useLayoutDirection.useLayoutDirection;
|
|
427
440
|
exports.Stack = Stack.Stack;
|
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.15.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.
|
|
47
|
+
"@carbon/icons-react": "^11.10.0-rc.0",
|
|
48
48
|
"@carbon/layout": "^11.7.0",
|
|
49
|
-
"@carbon/styles": "^1.
|
|
49
|
+
"@carbon/styles": "^1.15.0-rc.0",
|
|
50
50
|
"@carbon/telemetry": "0.1.0",
|
|
51
51
|
"classnames": "2.3.2",
|
|
52
52
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -131,5 +131,5 @@
|
|
|
131
131
|
"**/*.scss",
|
|
132
132
|
"**/*.css"
|
|
133
133
|
],
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "79b7a1a788658d921f399232fea33e3c40eb939f"
|
|
135
135
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/components/fluid-dropdown/fluid-dropdown';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/components/fluid-dropdown';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/components/fluid-list-box/fluid-list-box';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/components/fluid-list-box';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/components/fluid-text-area/fluid-text-area';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Code generated by @carbon/react. DO NOT EDIT.
|
|
2
|
+
//
|
|
3
|
+
// Copyright IBM Corp. 2018, 2018
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
@forward '@carbon/styles/scss/components/fluid-text-area';
|