@carbon/react 1.14.0-rc.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/NumberInput/NumberInput.js +2 -2
- 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 +42 -6
- package/es/index.js +8 -3
- 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/NumberInput/NumberInput.js +2 -2
- 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 +40 -4
- package/lib/index.js +15 -6
- package/package.json +7 -7
- 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
- package/es/components/SearchFilterButton/SearchFilterButton.js +0 -61
- package/es/components/SearchLayoutButton/SearchLayoutButton.js +0 -151
- package/lib/components/SearchFilterButton/SearchFilterButton.js +0 -70
- package/lib/components/SearchLayoutButton/SearchLayoutButton.js +0 -160
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2022
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
'use strict';
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
|
-
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
|
-
var iconsReact = require('@carbon/icons-react');
|
|
14
|
-
var PropTypes = require('prop-types');
|
|
15
|
-
var React = require('react');
|
|
16
|
-
var warning = require('../../internal/warning.js');
|
|
17
|
-
var usePrefix = require('../../internal/usePrefix.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
|
-
|
|
24
|
-
var _excluded = ["labelText", "iconDescription"];
|
|
25
|
-
var didWarnAboutDeprecation = false;
|
|
26
|
-
/**
|
|
27
|
-
* The filter button for `<Search>`.
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
var SearchFilterButton = function SearchFilterButton(_ref) {
|
|
31
|
-
var labelText = _ref.labelText,
|
|
32
|
-
iconDescription = _ref.iconDescription,
|
|
33
|
-
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
34
|
-
|
|
35
|
-
var prefix = usePrefix.usePrefix();
|
|
36
|
-
|
|
37
|
-
if (process.env.NODE_ENV !== "production") {
|
|
38
|
-
process.env.NODE_ENV !== "production" ? warning.warning(didWarnAboutDeprecation, 'The SearchFilterButton component has been deprecated and will be removed in the next major release of `carbon-components-react`') : void 0;
|
|
39
|
-
didWarnAboutDeprecation = true;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
|
|
43
|
-
className: "".concat(prefix, "--search-button"),
|
|
44
|
-
type: "button",
|
|
45
|
-
"aria-label": labelText,
|
|
46
|
-
title: labelText
|
|
47
|
-
}, other), /*#__PURE__*/React__default["default"].createElement(iconsReact.Filter, {
|
|
48
|
-
className: "".concat(prefix, "--search-filter"),
|
|
49
|
-
"aria-label": iconDescription
|
|
50
|
-
}));
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
SearchFilterButton.propTypes = {
|
|
54
|
-
/**
|
|
55
|
-
* The icon description.
|
|
56
|
-
*/
|
|
57
|
-
iconDescription: PropTypes__default["default"].string,
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* The a11y label text.
|
|
61
|
-
*/
|
|
62
|
-
labelText: PropTypes__default["default"].string
|
|
63
|
-
};
|
|
64
|
-
SearchFilterButton.defaultProps = {
|
|
65
|
-
labelText: 'Search',
|
|
66
|
-
iconDescription: 'filter'
|
|
67
|
-
};
|
|
68
|
-
var SearchFilterButton$1 = SearchFilterButton;
|
|
69
|
-
|
|
70
|
-
exports["default"] = SearchFilterButton$1;
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2022
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
'use strict';
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
|
-
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
|
-
var iconsReact = require('@carbon/icons-react');
|
|
14
|
-
var PropTypes = require('prop-types');
|
|
15
|
-
var React = require('react');
|
|
16
|
-
var warning = require('../../internal/warning.js');
|
|
17
|
-
var usePrefix = require('../../internal/usePrefix.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
|
-
|
|
24
|
-
var didWarnAboutDeprecation = false;
|
|
25
|
-
/**
|
|
26
|
-
* The layout button for `<Search>`.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
var SearchLayoutButton = /*#__PURE__*/function (_Component) {
|
|
30
|
-
_rollupPluginBabelHelpers.inherits(SearchLayoutButton, _Component);
|
|
31
|
-
|
|
32
|
-
var _super = _rollupPluginBabelHelpers.createSuper(SearchLayoutButton);
|
|
33
|
-
|
|
34
|
-
function SearchLayoutButton(props) {
|
|
35
|
-
var _this;
|
|
36
|
-
|
|
37
|
-
_rollupPluginBabelHelpers.classCallCheck(this, SearchLayoutButton);
|
|
38
|
-
|
|
39
|
-
_this = _super.call(this, props);
|
|
40
|
-
|
|
41
|
-
_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.assertThisInitialized(_this), "state", {
|
|
42
|
-
format: 'list'
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.assertThisInitialized(_this), "toggleLayout", function () {
|
|
46
|
-
var format = _this.state.format === 'list' ? 'grid' : 'list';
|
|
47
|
-
|
|
48
|
-
_this.setState({
|
|
49
|
-
format: format
|
|
50
|
-
}, function () {
|
|
51
|
-
var onChangeFormat = _this.props.onChangeFormat;
|
|
52
|
-
|
|
53
|
-
if (typeof onChangeFormat === 'function') {
|
|
54
|
-
onChangeFormat({
|
|
55
|
-
format: format
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
if (process.env.NODE_ENV !== "production") {
|
|
62
|
-
process.env.NODE_ENV !== "production" ? warning.warning(didWarnAboutDeprecation, 'The SearchLayoutButton component has been deprecated and will be removed in the next major release of `carbon-components-react`') : void 0;
|
|
63
|
-
didWarnAboutDeprecation = true;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return _this;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Toggles the button state upon user-initiated event.
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
_rollupPluginBabelHelpers.createClass(SearchLayoutButton, [{
|
|
74
|
-
key: "render",
|
|
75
|
-
value: function render() {
|
|
76
|
-
var _this2 = this;
|
|
77
|
-
|
|
78
|
-
var prefix = this.context;
|
|
79
|
-
var _this$props = this.props,
|
|
80
|
-
labelText = _this$props.labelText,
|
|
81
|
-
iconDescriptionList = _this$props.iconDescriptionList,
|
|
82
|
-
iconDescriptionGrid = _this$props.iconDescriptionGrid;
|
|
83
|
-
|
|
84
|
-
var SearchLayoutButtonIcon = function SearchLayoutButtonIcon() {
|
|
85
|
-
if (_this2.state.format === 'list') {
|
|
86
|
-
return /*#__PURE__*/React__default["default"].createElement(iconsReact.ListBulleted, {
|
|
87
|
-
className: "".concat(prefix, "--search-view"),
|
|
88
|
-
"aria-label": iconDescriptionList
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return /*#__PURE__*/React__default["default"].createElement(iconsReact.Grid, {
|
|
93
|
-
className: "".concat(prefix, "--search-view"),
|
|
94
|
-
"aria-label": iconDescriptionGrid
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
return /*#__PURE__*/React__default["default"].createElement("button", {
|
|
99
|
-
className: "".concat(prefix, "--search-button"),
|
|
100
|
-
type: "button",
|
|
101
|
-
onClick: this.toggleLayout,
|
|
102
|
-
"aria-label": labelText,
|
|
103
|
-
title: labelText
|
|
104
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
105
|
-
className: "".concat(prefix, "--search__toggle-layout__container")
|
|
106
|
-
}, /*#__PURE__*/React__default["default"].createElement(SearchLayoutButtonIcon, null)));
|
|
107
|
-
}
|
|
108
|
-
}], [{
|
|
109
|
-
key: "getDerivedStateFromProps",
|
|
110
|
-
value: function getDerivedStateFromProps(_ref, state) {
|
|
111
|
-
var format = _ref.format;
|
|
112
|
-
var prevFormat = state.prevFormat;
|
|
113
|
-
return prevFormat === format ? null : {
|
|
114
|
-
format: format || 'list',
|
|
115
|
-
prevFormat: format
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
}]);
|
|
119
|
-
|
|
120
|
-
return SearchLayoutButton;
|
|
121
|
-
}(React.Component);
|
|
122
|
-
|
|
123
|
-
_rollupPluginBabelHelpers.defineProperty(SearchLayoutButton, "contextType", usePrefix.PrefixContext);
|
|
124
|
-
|
|
125
|
-
_rollupPluginBabelHelpers.defineProperty(SearchLayoutButton, "propTypes", {
|
|
126
|
-
/**
|
|
127
|
-
* The layout.
|
|
128
|
-
*/
|
|
129
|
-
format: PropTypes__default["default"].oneOf(['list', 'grid']),
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* The description for the "grid" icon.
|
|
133
|
-
*/
|
|
134
|
-
iconDescriptionGrid: PropTypes__default["default"].string,
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* The description for the "list" icon.
|
|
138
|
-
*/
|
|
139
|
-
iconDescriptionList: PropTypes__default["default"].string,
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* The a11y label text.
|
|
143
|
-
*/
|
|
144
|
-
labelText: PropTypes__default["default"].string,
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* The callback called when layout switches.
|
|
148
|
-
*/
|
|
149
|
-
onChangeFormat: PropTypes__default["default"].func
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
_rollupPluginBabelHelpers.defineProperty(SearchLayoutButton, "defaultProps", {
|
|
153
|
-
labelText: 'Filter',
|
|
154
|
-
iconDescriptionList: 'list',
|
|
155
|
-
iconDescriptionGrid: 'grid'
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
var SearchLayoutButton$1 = SearchLayoutButton;
|
|
159
|
-
|
|
160
|
-
exports["default"] = SearchLayoutButton$1;
|