@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
|
@@ -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;
|
|
@@ -47,9 +47,9 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
47
47
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
48
48
|
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
49
49
|
|
|
50
|
-
var _excluded = ["className", "disabled", "helperText", "hideLabel", "id", "inline", "invalid", "invalidText", "labelText", "light", "onChange", "onClick", "placeholder", "readOnly", "size", "type", "warn", "warnText"];
|
|
50
|
+
var _excluded = ["className", "disabled", "helperText", "hideLabel", "id", "inline", "invalid", "invalidText", "labelText", "light", "onChange", "onClick", "placeholder", "readOnly", "size", "type", "warn", "warnText", "enableCounter", "maxCount"];
|
|
51
51
|
var TextInput = /*#__PURE__*/React__default["default"].forwardRef(function TextInput(_ref, ref) {
|
|
52
|
-
var _classNames, _classNames2, _classNames3, _classNames4, _classNames7;
|
|
52
|
+
var _classNames, _classNames2, _classNames3, _classNames4, _classNames7, _classNames8;
|
|
53
53
|
|
|
54
54
|
var className = _ref.className,
|
|
55
55
|
_ref$disabled = _ref.disabled,
|
|
@@ -78,10 +78,21 @@ var TextInput = /*#__PURE__*/React__default["default"].forwardRef(function TextI
|
|
|
78
78
|
_ref$warn = _ref.warn,
|
|
79
79
|
warn = _ref$warn === void 0 ? false : _ref$warn,
|
|
80
80
|
warnText = _ref.warnText,
|
|
81
|
+
_ref$enableCounter = _ref.enableCounter,
|
|
82
|
+
enableCounter = _ref$enableCounter === void 0 ? false : _ref$enableCounter,
|
|
83
|
+
maxCount = _ref.maxCount,
|
|
81
84
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
82
85
|
|
|
83
86
|
var prefix = usePrefix.usePrefix();
|
|
84
87
|
var enabled = index.useFeatureFlag('enable-v11-release');
|
|
88
|
+
var defaultValue = rest.defaultValue,
|
|
89
|
+
value = rest.value;
|
|
90
|
+
|
|
91
|
+
var _useState = React.useState((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) || (value === null || value === void 0 ? void 0 : value.length) || 0),
|
|
92
|
+
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
|
93
|
+
textCount = _useState2[0],
|
|
94
|
+
setTextCount = _useState2[1];
|
|
95
|
+
|
|
85
96
|
var normalizedProps = useNormalizedInputProps.useNormalizedInputProps({
|
|
86
97
|
id: id,
|
|
87
98
|
readOnly: readOnly,
|
|
@@ -98,6 +109,10 @@ var TextInput = /*#__PURE__*/React__default["default"].forwardRef(function TextI
|
|
|
98
109
|
id: id,
|
|
99
110
|
onChange: function onChange(evt) {
|
|
100
111
|
if (!normalizedProps.disabled) {
|
|
112
|
+
var _evt$target$value;
|
|
113
|
+
|
|
114
|
+
setTextCount((_evt$target$value = evt.target.value) === null || _evt$target$value === void 0 ? void 0 : _evt$target$value.length);
|
|
115
|
+
|
|
101
116
|
_onChange(evt);
|
|
102
117
|
}
|
|
103
118
|
},
|
|
@@ -115,16 +130,27 @@ var TextInput = /*#__PURE__*/React__default["default"].forwardRef(function TextI
|
|
|
115
130
|
readOnly: readOnly
|
|
116
131
|
}, 'aria-describedby', helperText && normalizedProps.helperId), rest);
|
|
117
132
|
|
|
133
|
+
if (enableCounter) {
|
|
134
|
+
sharedTextInputProps.maxLength = maxCount;
|
|
135
|
+
}
|
|
136
|
+
|
|
118
137
|
var inputWrapperClasses = cx__default["default"]([enabled ? cx__default["default"]("".concat(prefix, "--form-item"), className) : "".concat(prefix, "--form-item")], "".concat(prefix, "--text-input-wrapper"), (_classNames2 = {}, _rollupPluginBabelHelpers.defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--readonly"), readOnly), _rollupPluginBabelHelpers.defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--light"), light), _rollupPluginBabelHelpers.defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--inline"), inline), _classNames2));
|
|
119
138
|
var labelClasses = cx__default["default"]("".concat(prefix, "--label"), (_classNames3 = {}, _rollupPluginBabelHelpers.defineProperty(_classNames3, "".concat(prefix, "--visually-hidden"), hideLabel), _rollupPluginBabelHelpers.defineProperty(_classNames3, "".concat(prefix, "--label--disabled"), normalizedProps.disabled), _rollupPluginBabelHelpers.defineProperty(_classNames3, "".concat(prefix, "--label--inline"), inline), _rollupPluginBabelHelpers.defineProperty(_classNames3, "".concat(prefix, "--label--inline--").concat(size), inline && !!size), _classNames3));
|
|
120
139
|
var helperTextClasses = cx__default["default"]("".concat(prefix, "--form__helper-text"), (_classNames4 = {}, _rollupPluginBabelHelpers.defineProperty(_classNames4, "".concat(prefix, "--form__helper-text--disabled"), normalizedProps.disabled), _rollupPluginBabelHelpers.defineProperty(_classNames4, "".concat(prefix, "--form__helper-text--inline"), inline), _classNames4));
|
|
121
140
|
var fieldOuterWrapperClasses = cx__default["default"]("".concat(prefix, "--text-input__field-outer-wrapper"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--text-input__field-outer-wrapper--inline"), inline));
|
|
122
141
|
var fieldWrapperClasses = cx__default["default"]("".concat(prefix, "--text-input__field-wrapper"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--text-input__field-wrapper--warning"), normalizedProps.warn));
|
|
123
142
|
var iconClasses = cx__default["default"]((_classNames7 = {}, _rollupPluginBabelHelpers.defineProperty(_classNames7, "".concat(prefix, "--text-input__invalid-icon"), normalizedProps.invalid || normalizedProps.warn), _rollupPluginBabelHelpers.defineProperty(_classNames7, "".concat(prefix, "--text-input__invalid-icon--warning"), normalizedProps.warn), _rollupPluginBabelHelpers.defineProperty(_classNames7, "".concat(prefix, "--text-input__readonly-icon"), readOnly), _classNames7));
|
|
143
|
+
var counterClasses = cx__default["default"]("".concat(prefix, "--label"), (_classNames8 = {}, _rollupPluginBabelHelpers.defineProperty(_classNames8, "".concat(prefix, "--label--disabled"), disabled), _rollupPluginBabelHelpers.defineProperty(_classNames8, "".concat(prefix, "--text-input__label-counter"), true), _classNames8));
|
|
144
|
+
var counter = enableCounter && maxCount ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
145
|
+
className: counterClasses
|
|
146
|
+
}, "".concat(textCount, "/").concat(maxCount)) : null;
|
|
124
147
|
var label = labelText ? /*#__PURE__*/React__default["default"].createElement("label", {
|
|
125
148
|
htmlFor: id,
|
|
126
149
|
className: labelClasses
|
|
127
150
|
}, labelText) : null;
|
|
151
|
+
var labelWrapper = /*#__PURE__*/React__default["default"].createElement("div", {
|
|
152
|
+
className: "".concat(prefix, "--text-input__label-wrapper")
|
|
153
|
+
}, label, counter);
|
|
128
154
|
var helper = helperText ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
129
155
|
id: normalizedProps.helperId,
|
|
130
156
|
className: helperTextClasses
|
|
@@ -142,9 +168,9 @@ var TextInput = /*#__PURE__*/React__default["default"].forwardRef(function TextI
|
|
|
142
168
|
|
|
143
169
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
144
170
|
className: inputWrapperClasses
|
|
145
|
-
}, !inline ?
|
|
171
|
+
}, !inline ? labelWrapper : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
146
172
|
className: "".concat(prefix, "--text-input__label-helper-wrapper")
|
|
147
|
-
},
|
|
173
|
+
}, labelWrapper, !isFluid && helper), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
148
174
|
className: fieldOuterWrapperClasses
|
|
149
175
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
150
176
|
className: fieldWrapperClasses,
|
|
@@ -174,6 +200,11 @@ TextInput.propTypes = {
|
|
|
174
200
|
*/
|
|
175
201
|
disabled: PropTypes__default["default"].bool,
|
|
176
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Specify whether to display the character counter
|
|
205
|
+
*/
|
|
206
|
+
enableCounter: PropTypes__default["default"].bool,
|
|
207
|
+
|
|
177
208
|
/**
|
|
178
209
|
* Provide text that is used alongside the control label for additional help
|
|
179
210
|
*/
|
|
@@ -216,6 +247,11 @@ TextInput.propTypes = {
|
|
|
216
247
|
*/
|
|
217
248
|
light: PropTypes__default["default"].bool,
|
|
218
249
|
|
|
250
|
+
/**
|
|
251
|
+
* Max character count allowed for the input. This is needed in order for enableCounter to display
|
|
252
|
+
*/
|
|
253
|
+
maxCount: PropTypes__default["default"].number,
|
|
254
|
+
|
|
219
255
|
/**
|
|
220
256
|
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
221
257
|
* is updated
|
package/lib/index.js
CHANGED
|
@@ -54,8 +54,6 @@ var PrimaryButton = require('./components/PrimaryButton/PrimaryButton.js');
|
|
|
54
54
|
var RadioButton = require('./components/RadioButton/RadioButton.js');
|
|
55
55
|
var RadioButtonGroup = require('./components/RadioButtonGroup/RadioButtonGroup.js');
|
|
56
56
|
var index$6 = require('./components/Search/index.js');
|
|
57
|
-
var SearchFilterButton = require('./components/SearchFilterButton/SearchFilterButton.js');
|
|
58
|
-
var SearchLayoutButton = require('./components/SearchLayoutButton/SearchLayoutButton.js');
|
|
59
57
|
var ExpandableSearch = require('./components/ExpandableSearch/ExpandableSearch.js');
|
|
60
58
|
var SecondaryButton = require('./components/SecondaryButton/SecondaryButton.js');
|
|
61
59
|
var Select_Skeleton = require('./components/Select/Select.Skeleton.js');
|
|
@@ -98,6 +96,7 @@ var Tabs_Skeleton = require('./components/Tabs/Tabs.Skeleton.js');
|
|
|
98
96
|
var TextInput_Skeleton = require('./components/TextInput/TextInput.Skeleton.js');
|
|
99
97
|
var ToggleSmall_Skeleton = require('./components/ToggleSmall/ToggleSmall.Skeleton.js');
|
|
100
98
|
var Icon_Skeleton = require('./components/Icon/Icon.Skeleton.js');
|
|
99
|
+
require('./components/ContainedList/index.js');
|
|
101
100
|
var index$i = require('./components/FeatureFlags/index.js');
|
|
102
101
|
var index$j = require('./components/Heading/index.js');
|
|
103
102
|
var index$k = require('./components/IconButton/index.js');
|
|
@@ -126,9 +125,12 @@ var SideNavFooter = require('./components/UIShell/SideNavFooter.js');
|
|
|
126
125
|
var SideNavIcon = require('./components/UIShell/SideNavIcon.js');
|
|
127
126
|
var SideNavItem = require('./components/UIShell/SideNavItem.js');
|
|
128
127
|
var SideNavLinkText = require('./components/UIShell/SideNavLinkText.js');
|
|
128
|
+
var ContainedListItem = require('./components/ContainedList/ContainedListItem/ContainedListItem.js');
|
|
129
129
|
var useContextMenu = require('./components/ContextMenu/useContextMenu.js');
|
|
130
|
-
var FluidTextInput = require('./components/FluidTextInput/FluidTextInput.js');
|
|
131
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');
|
|
132
134
|
var MenuDivider = require('./components/Menu/MenuDivider.js');
|
|
133
135
|
var MenuGroup = require('./components/Menu/MenuGroup.js');
|
|
134
136
|
var MenuItem = require('./components/Menu/MenuItem.js');
|
|
@@ -140,6 +142,7 @@ var ProgressBar = require('./components/ProgressBar/ProgressBar.js');
|
|
|
140
142
|
var MultiSelect = require('./components/MultiSelect/MultiSelect.js');
|
|
141
143
|
var TextInput = require('./components/TextInput/TextInput.js');
|
|
142
144
|
var TreeView = require('./components/TreeView/TreeView.js');
|
|
145
|
+
var ContainedList = require('./components/ContainedList/ContainedList.js');
|
|
143
146
|
var Menu = require('./components/Menu/Menu.js');
|
|
144
147
|
var Breadcrumb = require('./components/Breadcrumb/Breadcrumb.js');
|
|
145
148
|
var BreadcrumbItem = require('./components/Breadcrumb/BreadcrumbItem.js');
|
|
@@ -200,6 +203,8 @@ var SideNavLink = require('./components/UIShell/SideNavLink.js');
|
|
|
200
203
|
var SideNavMenu = require('./components/UIShell/SideNavMenu.js');
|
|
201
204
|
var SideNavMenuItem = require('./components/UIShell/SideNavMenuItem.js');
|
|
202
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');
|
|
203
208
|
var LayoutDirection = require('./components/Layout/LayoutDirection.js');
|
|
204
209
|
var useLayoutDirection = require('./components/Layout/useLayoutDirection.js');
|
|
205
210
|
var Stack = require('./components/Stack/Stack.js');
|
|
@@ -252,8 +257,6 @@ exports.PrimaryButton = PrimaryButton["default"];
|
|
|
252
257
|
exports.RadioButton = RadioButton["default"];
|
|
253
258
|
exports.RadioButtonGroup = RadioButtonGroup["default"];
|
|
254
259
|
exports.Search = index$6["default"];
|
|
255
|
-
exports.SearchFilterButton = SearchFilterButton["default"];
|
|
256
|
-
exports.SearchLayoutButton = SearchLayoutButton["default"];
|
|
257
260
|
exports.ExpandableSearch = ExpandableSearch["default"];
|
|
258
261
|
exports.SecondaryButton = SecondaryButton["default"];
|
|
259
262
|
exports.SelectSkeleton = Select_Skeleton["default"];
|
|
@@ -343,9 +346,12 @@ exports.SideNavFooter = SideNavFooter["default"];
|
|
|
343
346
|
exports.SideNavIcon = SideNavIcon["default"];
|
|
344
347
|
exports.SideNavItem = SideNavItem["default"];
|
|
345
348
|
exports.SideNavLinkText = SideNavLinkText["default"];
|
|
349
|
+
exports.unstable_ContainedListItem = ContainedListItem["default"];
|
|
346
350
|
exports.unstable_useContextMenu = useContextMenu["default"];
|
|
347
|
-
exports.unstable__FluidTextInput = FluidTextInput["default"];
|
|
348
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"];
|
|
349
355
|
exports.unstable_MenuDivider = MenuDivider["default"];
|
|
350
356
|
exports.unstable_MenuGroup = MenuGroup["default"];
|
|
351
357
|
exports.unstable_MenuItem = MenuItem["default"];
|
|
@@ -357,6 +363,7 @@ exports.ProgressBar = ProgressBar["default"];
|
|
|
357
363
|
exports.MultiSelect = MultiSelect["default"];
|
|
358
364
|
exports.TextInput = TextInput["default"];
|
|
359
365
|
exports.TreeView = TreeView["default"];
|
|
366
|
+
exports.unstable_ContainedList = ContainedList["default"];
|
|
360
367
|
exports.unstable_Menu = Menu["default"];
|
|
361
368
|
exports.Breadcrumb = Breadcrumb["default"];
|
|
362
369
|
exports.BreadcrumbItem = BreadcrumbItem["default"];
|
|
@@ -426,6 +433,8 @@ exports.SideNavLink = SideNavLink["default"];
|
|
|
426
433
|
exports.SideNavMenu = SideNavMenu.SideNavMenu;
|
|
427
434
|
exports.SideNavMenuItem = SideNavMenuItem["default"];
|
|
428
435
|
exports.SideNavSwitcher = SideNavSwitcher["default"];
|
|
436
|
+
exports.unstable__FluidDropdown = FluidDropdown["default"];
|
|
437
|
+
exports.unstable__FluidDropdownSkeleton = FluidDropdown_Skeleton["default"];
|
|
429
438
|
exports.unstable_LayoutDirection = LayoutDirection.LayoutDirection;
|
|
430
439
|
exports.unstable_useLayoutDirection = useLayoutDirection.useLayoutDirection;
|
|
431
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,11 +44,11 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@babel/runtime": "^7.18.3",
|
|
46
46
|
"@carbon/feature-flags": "^0.9.0",
|
|
47
|
-
"@carbon/icons-react": "^11.
|
|
48
|
-
"@carbon/layout": "^11.7.0
|
|
49
|
-
"@carbon/styles": "^1.
|
|
47
|
+
"@carbon/icons-react": "^11.10.0-rc.0",
|
|
48
|
+
"@carbon/layout": "^11.7.0",
|
|
49
|
+
"@carbon/styles": "^1.15.0-rc.0",
|
|
50
50
|
"@carbon/telemetry": "0.1.0",
|
|
51
|
-
"classnames": "2.3.
|
|
51
|
+
"classnames": "2.3.2",
|
|
52
52
|
"copy-to-clipboard": "^3.3.1",
|
|
53
53
|
"downshift": "5.2.1",
|
|
54
54
|
"flatpickr": "4.6.9",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@babel/preset-env": "^7.18.2",
|
|
74
74
|
"@babel/preset-react": "^7.17.12",
|
|
75
75
|
"@carbon/test-utils": "^10.26.0",
|
|
76
|
-
"@carbon/themes": "^11.10.0
|
|
76
|
+
"@carbon/themes": "^11.10.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",
|
|
@@ -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';
|
|
@@ -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-input/fluid-text-input';
|
|
@@ -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-input';
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2022
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import { Filter } from '@carbon/icons-react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
import React__default from 'react';
|
|
12
|
-
import { warning } from '../../internal/warning.js';
|
|
13
|
-
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
|
-
|
|
15
|
-
var _excluded = ["labelText", "iconDescription"];
|
|
16
|
-
var didWarnAboutDeprecation = false;
|
|
17
|
-
/**
|
|
18
|
-
* The filter button for `<Search>`.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
var SearchFilterButton = function SearchFilterButton(_ref) {
|
|
22
|
-
var labelText = _ref.labelText,
|
|
23
|
-
iconDescription = _ref.iconDescription,
|
|
24
|
-
other = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
-
|
|
26
|
-
var prefix = usePrefix();
|
|
27
|
-
|
|
28
|
-
if (process.env.NODE_ENV !== "production") {
|
|
29
|
-
process.env.NODE_ENV !== "production" ? warning(didWarnAboutDeprecation, 'The SearchFilterButton component has been deprecated and will be removed in the next major release of `carbon-components-react`') : void 0;
|
|
30
|
-
didWarnAboutDeprecation = true;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return /*#__PURE__*/React__default.createElement("button", _extends({
|
|
34
|
-
className: "".concat(prefix, "--search-button"),
|
|
35
|
-
type: "button",
|
|
36
|
-
"aria-label": labelText,
|
|
37
|
-
title: labelText
|
|
38
|
-
}, other), /*#__PURE__*/React__default.createElement(Filter, {
|
|
39
|
-
className: "".concat(prefix, "--search-filter"),
|
|
40
|
-
"aria-label": iconDescription
|
|
41
|
-
}));
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
SearchFilterButton.propTypes = {
|
|
45
|
-
/**
|
|
46
|
-
* The icon description.
|
|
47
|
-
*/
|
|
48
|
-
iconDescription: PropTypes.string,
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* The a11y label text.
|
|
52
|
-
*/
|
|
53
|
-
labelText: PropTypes.string
|
|
54
|
-
};
|
|
55
|
-
SearchFilterButton.defaultProps = {
|
|
56
|
-
labelText: 'Search',
|
|
57
|
-
iconDescription: 'filter'
|
|
58
|
-
};
|
|
59
|
-
var SearchFilterButton$1 = SearchFilterButton;
|
|
60
|
-
|
|
61
|
-
export { SearchFilterButton$1 as default };
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2022
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, defineProperty as _defineProperty, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import { ListBulleted, Grid } from '@carbon/icons-react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
import React__default, { Component } from 'react';
|
|
12
|
-
import { warning } from '../../internal/warning.js';
|
|
13
|
-
import { PrefixContext } from '../../internal/usePrefix.js';
|
|
14
|
-
|
|
15
|
-
var didWarnAboutDeprecation = false;
|
|
16
|
-
/**
|
|
17
|
-
* The layout button for `<Search>`.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
var SearchLayoutButton = /*#__PURE__*/function (_Component) {
|
|
21
|
-
_inherits(SearchLayoutButton, _Component);
|
|
22
|
-
|
|
23
|
-
var _super = _createSuper(SearchLayoutButton);
|
|
24
|
-
|
|
25
|
-
function SearchLayoutButton(props) {
|
|
26
|
-
var _this;
|
|
27
|
-
|
|
28
|
-
_classCallCheck(this, SearchLayoutButton);
|
|
29
|
-
|
|
30
|
-
_this = _super.call(this, props);
|
|
31
|
-
|
|
32
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
33
|
-
format: 'list'
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
_defineProperty(_assertThisInitialized(_this), "toggleLayout", function () {
|
|
37
|
-
var format = _this.state.format === 'list' ? 'grid' : 'list';
|
|
38
|
-
|
|
39
|
-
_this.setState({
|
|
40
|
-
format: format
|
|
41
|
-
}, function () {
|
|
42
|
-
var onChangeFormat = _this.props.onChangeFormat;
|
|
43
|
-
|
|
44
|
-
if (typeof onChangeFormat === 'function') {
|
|
45
|
-
onChangeFormat({
|
|
46
|
-
format: format
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
if (process.env.NODE_ENV !== "production") {
|
|
53
|
-
process.env.NODE_ENV !== "production" ? warning(didWarnAboutDeprecation, 'The SearchLayoutButton component has been deprecated and will be removed in the next major release of `carbon-components-react`') : void 0;
|
|
54
|
-
didWarnAboutDeprecation = true;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return _this;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Toggles the button state upon user-initiated event.
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
_createClass(SearchLayoutButton, [{
|
|
65
|
-
key: "render",
|
|
66
|
-
value: function render() {
|
|
67
|
-
var _this2 = this;
|
|
68
|
-
|
|
69
|
-
var prefix = this.context;
|
|
70
|
-
var _this$props = this.props,
|
|
71
|
-
labelText = _this$props.labelText,
|
|
72
|
-
iconDescriptionList = _this$props.iconDescriptionList,
|
|
73
|
-
iconDescriptionGrid = _this$props.iconDescriptionGrid;
|
|
74
|
-
|
|
75
|
-
var SearchLayoutButtonIcon = function SearchLayoutButtonIcon() {
|
|
76
|
-
if (_this2.state.format === 'list') {
|
|
77
|
-
return /*#__PURE__*/React__default.createElement(ListBulleted, {
|
|
78
|
-
className: "".concat(prefix, "--search-view"),
|
|
79
|
-
"aria-label": iconDescriptionList
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
84
|
-
className: "".concat(prefix, "--search-view"),
|
|
85
|
-
"aria-label": iconDescriptionGrid
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return /*#__PURE__*/React__default.createElement("button", {
|
|
90
|
-
className: "".concat(prefix, "--search-button"),
|
|
91
|
-
type: "button",
|
|
92
|
-
onClick: this.toggleLayout,
|
|
93
|
-
"aria-label": labelText,
|
|
94
|
-
title: labelText
|
|
95
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
96
|
-
className: "".concat(prefix, "--search__toggle-layout__container")
|
|
97
|
-
}, /*#__PURE__*/React__default.createElement(SearchLayoutButtonIcon, null)));
|
|
98
|
-
}
|
|
99
|
-
}], [{
|
|
100
|
-
key: "getDerivedStateFromProps",
|
|
101
|
-
value: function getDerivedStateFromProps(_ref, state) {
|
|
102
|
-
var format = _ref.format;
|
|
103
|
-
var prevFormat = state.prevFormat;
|
|
104
|
-
return prevFormat === format ? null : {
|
|
105
|
-
format: format || 'list',
|
|
106
|
-
prevFormat: format
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
}]);
|
|
110
|
-
|
|
111
|
-
return SearchLayoutButton;
|
|
112
|
-
}(Component);
|
|
113
|
-
|
|
114
|
-
_defineProperty(SearchLayoutButton, "contextType", PrefixContext);
|
|
115
|
-
|
|
116
|
-
_defineProperty(SearchLayoutButton, "propTypes", {
|
|
117
|
-
/**
|
|
118
|
-
* The layout.
|
|
119
|
-
*/
|
|
120
|
-
format: PropTypes.oneOf(['list', 'grid']),
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* The description for the "grid" icon.
|
|
124
|
-
*/
|
|
125
|
-
iconDescriptionGrid: PropTypes.string,
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* The description for the "list" icon.
|
|
129
|
-
*/
|
|
130
|
-
iconDescriptionList: PropTypes.string,
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* The a11y label text.
|
|
134
|
-
*/
|
|
135
|
-
labelText: PropTypes.string,
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* The callback called when layout switches.
|
|
139
|
-
*/
|
|
140
|
-
onChangeFormat: PropTypes.func
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
_defineProperty(SearchLayoutButton, "defaultProps", {
|
|
144
|
-
labelText: 'Filter',
|
|
145
|
-
iconDescriptionList: 'list',
|
|
146
|
-
iconDescriptionGrid: 'grid'
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
var SearchLayoutButton$1 = SearchLayoutButton;
|
|
150
|
-
|
|
151
|
-
export { SearchLayoutButton$1 as default };
|