@carbon/react 1.13.0 → 1.14.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/Accordion/Accordion.Skeleton.js +12 -4
- package/es/components/Accordion/Accordion.js +9 -2
- package/es/components/FileUploader/Filename.js +3 -1
- package/es/components/FluidTextArea/FluidTextArea.js +130 -0
- package/es/components/FluidTextInput/FluidTextInput.js +13 -4
- package/es/components/Notification/Notification.js +6 -2
- package/es/components/NumberInput/NumberInput.js +2 -2
- package/es/components/ProgressIndicator/ProgressIndicator.js +128 -154
- package/es/components/RadioTile/RadioTile.js +2 -11
- package/es/components/TextArea/TextArea.js +14 -5
- package/es/components/TextInput/PasswordInput.js +7 -6
- package/es/components/TextInput/TextInput.js +42 -6
- package/es/index.js +2 -4
- package/lib/components/Accordion/Accordion.Skeleton.js +12 -4
- package/lib/components/Accordion/Accordion.js +9 -2
- package/lib/components/FileUploader/Filename.js +3 -1
- package/lib/components/FluidTextArea/FluidTextArea.js +140 -0
- package/lib/components/FluidTextInput/FluidTextInput.js +12 -3
- package/lib/components/Notification/Notification.js +6 -2
- package/lib/components/NumberInput/NumberInput.js +2 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.js +126 -152
- package/lib/components/RadioTile/RadioTile.js +2 -11
- package/lib/components/TextArea/TextArea.js +13 -4
- package/lib/components/TextInput/PasswordInput.js +7 -6
- package/lib/components/TextInput/TextInput.js +40 -4
- package/lib/index.js +47 -50
- package/package.json +8 -7
- package/es/components/ProgressIndicator/index.js +0 -15
- package/es/components/ProgressIndicator/next/ProgressIndicator.js +0 -117
- package/es/components/SearchFilterButton/SearchFilterButton.js +0 -61
- package/es/components/SearchLayoutButton/SearchLayoutButton.js +0 -151
- package/lib/components/ProgressIndicator/index.js +0 -39
- package/lib/components/ProgressIndicator/next/ProgressIndicator.js +0 -127
- package/lib/components/SearchFilterButton/SearchFilterButton.js +0 -70
- package/lib/components/SearchLayoutButton/SearchLayoutButton.js +0 -160
|
@@ -11,7 +11,6 @@ import cx from 'classnames';
|
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import React__default from 'react';
|
|
13
13
|
import { useFallbackId } from '../../internal/useId.js';
|
|
14
|
-
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
15
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
15
|
import deprecate from '../../prop-types/deprecate.js';
|
|
17
16
|
import { matches } from '../../internal/keyboard/match.js';
|
|
@@ -38,10 +37,7 @@ function RadioTile(_ref) {
|
|
|
38
37
|
|
|
39
38
|
var prefix = usePrefix();
|
|
40
39
|
var inputId = useFallbackId(id);
|
|
41
|
-
var enabled = useFeatureFlag('enable-v11-release');
|
|
42
40
|
var className = cx(customClassName, "".concat(prefix, "--tile"), "".concat(prefix, "--tile--selectable"), (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--tile--is-selected"), checked), _defineProperty(_cx, "".concat(prefix, "--tile--light"), light), _defineProperty(_cx, "".concat(prefix, "--tile--disabled"), disabled), _cx));
|
|
43
|
-
var inputProps = enabled ? {} : rest;
|
|
44
|
-
var labelProps = enabled ? rest : {};
|
|
45
41
|
|
|
46
42
|
function handleOnChange(evt) {
|
|
47
43
|
onChange(value, name, evt);
|
|
@@ -54,7 +50,7 @@ function RadioTile(_ref) {
|
|
|
54
50
|
}
|
|
55
51
|
}
|
|
56
52
|
|
|
57
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("input",
|
|
53
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("input", {
|
|
58
54
|
checked: checked,
|
|
59
55
|
className: "".concat(prefix, "--tile-input"),
|
|
60
56
|
disabled: disabled,
|
|
@@ -65,7 +61,7 @@ function RadioTile(_ref) {
|
|
|
65
61
|
tabIndex: !disabled ? tabIndex : null,
|
|
66
62
|
type: "radio",
|
|
67
63
|
value: value
|
|
68
|
-
})
|
|
64
|
+
}), /*#__PURE__*/React__default.createElement("label", _extends({}, rest, {
|
|
69
65
|
htmlFor: inputId,
|
|
70
66
|
className: className
|
|
71
67
|
}), /*#__PURE__*/React__default.createElement("span", {
|
|
@@ -91,11 +87,6 @@ RadioTile.propTypes = {
|
|
|
91
87
|
*/
|
|
92
88
|
className: PropTypes.string,
|
|
93
89
|
|
|
94
|
-
/**
|
|
95
|
-
* `true` if the `<input>` should be checked at initialization.
|
|
96
|
-
*/
|
|
97
|
-
defaultChecked: PropTypes.bool,
|
|
98
|
-
|
|
99
90
|
/**
|
|
100
91
|
* Specify whether the RadioTile should be disabled
|
|
101
92
|
*/
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import React__default, { useState } from 'react';
|
|
10
|
+
import React__default, { useContext, useState } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { WarningFilled } from '@carbon/icons-react';
|
|
13
13
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
|
+
import { FormContext } from '../FluidForm/FormContext.js';
|
|
15
16
|
|
|
16
17
|
var _excluded = ["className", "id", "labelText", "hideLabel", "onChange", "onClick", "invalid", "invalidText", "helperText", "light", "placeholder", "enableCounter", "maxCount"];
|
|
17
18
|
var TextArea = /*#__PURE__*/React__default.forwardRef(function TextArea(_ref, ref) {
|
|
@@ -33,6 +34,10 @@ var TextArea = /*#__PURE__*/React__default.forwardRef(function TextArea(_ref, re
|
|
|
33
34
|
other = _objectWithoutProperties(_ref, _excluded);
|
|
34
35
|
|
|
35
36
|
var prefix = usePrefix();
|
|
37
|
+
|
|
38
|
+
var _useContext = useContext(FormContext),
|
|
39
|
+
isFluid = _useContext.isFluid;
|
|
40
|
+
|
|
36
41
|
var enabled = useFeatureFlag('enable-v11-release');
|
|
37
42
|
var defaultValue = other.defaultValue,
|
|
38
43
|
value = other.value,
|
|
@@ -66,7 +71,7 @@ var TextArea = /*#__PURE__*/React__default.forwardRef(function TextArea(_ref, re
|
|
|
66
71
|
textareaProps.maxLength = maxCount;
|
|
67
72
|
}
|
|
68
73
|
|
|
69
|
-
var labelClasses = cx("".concat(prefix, "--label"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--visually-hidden"), hideLabel), _defineProperty(_classNames, "".concat(prefix, "--label--disabled"), disabled), _classNames));
|
|
74
|
+
var labelClasses = cx("".concat(prefix, "--label"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--visually-hidden"), hideLabel && !isFluid), _defineProperty(_classNames, "".concat(prefix, "--label--disabled"), disabled), _classNames));
|
|
70
75
|
var label = labelText ? /*#__PURE__*/React__default.createElement("label", {
|
|
71
76
|
htmlFor: id,
|
|
72
77
|
className: labelClasses
|
|
@@ -84,7 +89,9 @@ var TextArea = /*#__PURE__*/React__default.forwardRef(function TextArea(_ref, re
|
|
|
84
89
|
role: "alert",
|
|
85
90
|
className: "".concat(prefix, "--form-requirement"),
|
|
86
91
|
id: errorId
|
|
87
|
-
}, invalidText
|
|
92
|
+
}, invalidText, isFluid && /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
93
|
+
className: "".concat(prefix, "--text-area__invalid-icon")
|
|
94
|
+
})) : null;
|
|
88
95
|
var textareaClasses = cx("".concat(prefix, "--text-area"), [enabled ? null : className], (_classNames4 = {}, _defineProperty(_classNames4, "".concat(prefix, "--text-area--light"), light), _defineProperty(_classNames4, "".concat(prefix, "--text-area--invalid"), invalid), _classNames4));
|
|
89
96
|
var input = /*#__PURE__*/React__default.createElement("textarea", _extends({}, other, textareaProps, {
|
|
90
97
|
placeholder: placeholder || null,
|
|
@@ -100,9 +107,11 @@ var TextArea = /*#__PURE__*/React__default.forwardRef(function TextArea(_ref, re
|
|
|
100
107
|
}, label, counter), /*#__PURE__*/React__default.createElement("div", {
|
|
101
108
|
className: "".concat(prefix, "--text-area__wrapper"),
|
|
102
109
|
"data-invalid": invalid || null
|
|
103
|
-
}, invalid && /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
110
|
+
}, invalid && !isFluid && /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
104
111
|
className: "".concat(prefix, "--text-area__invalid-icon")
|
|
105
|
-
}), input
|
|
112
|
+
}), input, isFluid && /*#__PURE__*/React__default.createElement("hr", {
|
|
113
|
+
className: "".concat(prefix, "--text-area__divider")
|
|
114
|
+
}), isFluid && invalid ? error : null), invalid && !isFluid ? error : helper);
|
|
106
115
|
});
|
|
107
116
|
TextArea.displayName = 'TextArea';
|
|
108
117
|
TextArea.propTypes = {
|
|
@@ -69,6 +69,9 @@ var PasswordInput = /*#__PURE__*/React__default.forwardRef(function PasswordInpu
|
|
|
69
69
|
warnText: warnText
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
+
var _useContext = useContext(FormContext),
|
|
73
|
+
isFluid = _useContext.isFluid;
|
|
74
|
+
|
|
72
75
|
var handleTogglePasswordVisibility = function handleTogglePasswordVisibility(event) {
|
|
73
76
|
setInputType(inputType === 'password' ? 'text' : 'password');
|
|
74
77
|
onTogglePasswordVisibility && onTogglePasswordVisibility(event);
|
|
@@ -94,7 +97,7 @@ var PasswordInput = /*#__PURE__*/React__default.forwardRef(function PasswordInpu
|
|
|
94
97
|
ref: ref
|
|
95
98
|
}, rest);
|
|
96
99
|
|
|
97
|
-
var inputWrapperClasses = cx("".concat(prefix, "--form-item"), "".concat(prefix, "--text-input-wrapper"), "".concat(prefix, "--password-input-wrapper"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--light"), light), _defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--inline"), inline), _classNames2));
|
|
100
|
+
var inputWrapperClasses = cx("".concat(prefix, "--form-item"), "".concat(prefix, "--text-input-wrapper"), "".concat(prefix, "--password-input-wrapper"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--light"), light), _defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--inline"), inline), _defineProperty(_classNames2, "".concat(prefix, "--text-input--fluid"), isFluid), _classNames2));
|
|
98
101
|
var labelClasses = cx("".concat(prefix, "--label"), (_classNames3 = {}, _defineProperty(_classNames3, "".concat(prefix, "--visually-hidden"), hideLabel), _defineProperty(_classNames3, "".concat(prefix, "--label--disabled"), disabled), _defineProperty(_classNames3, "".concat(prefix, "--label--inline"), inline), _defineProperty(_classNames3, "".concat(prefix, "--label--inline--").concat(size), inline && !!size), _classNames3));
|
|
99
102
|
var helperTextClasses = cx("".concat(prefix, "--form__helper-text"), (_classNames4 = {}, _defineProperty(_classNames4, "".concat(prefix, "--form__helper-text--disabled"), disabled), _defineProperty(_classNames4, "".concat(prefix, "--form__helper-text--inline"), inline), _classNames4));
|
|
100
103
|
var fieldOuterWrapperClasses = cx("".concat(prefix, "--text-input__field-outer-wrapper"), _defineProperty({}, "".concat(prefix, "--text-input__field-outer-wrapper--inline"), inline));
|
|
@@ -123,7 +126,9 @@ var PasswordInput = /*#__PURE__*/React__default.forwardRef(function PasswordInpu
|
|
|
123
126
|
}), {
|
|
124
127
|
disabled: disabled,
|
|
125
128
|
"data-toggle-password-visibility": inputType === 'password'
|
|
126
|
-
})), /*#__PURE__*/React__default.createElement("
|
|
129
|
+
})), isFluid && /*#__PURE__*/React__default.createElement("hr", {
|
|
130
|
+
className: "".concat(prefix, "--text-input__divider")
|
|
131
|
+
}), /*#__PURE__*/React__default.createElement("button", {
|
|
127
132
|
type: "button",
|
|
128
133
|
className: passwordVisibilityToggleClasses,
|
|
129
134
|
disabled: disabled,
|
|
@@ -131,10 +136,6 @@ var PasswordInput = /*#__PURE__*/React__default.forwardRef(function PasswordInpu
|
|
|
131
136
|
}, !disabled && /*#__PURE__*/React__default.createElement("span", {
|
|
132
137
|
className: "".concat(prefix, "--assistive-text")
|
|
133
138
|
}, passwordIsVisible ? hidePasswordLabel : showPasswordLabel), passwordVisibilityIcon));
|
|
134
|
-
|
|
135
|
-
var _useContext = useContext(FormContext),
|
|
136
|
-
isFluid = _useContext.isFluid;
|
|
137
|
-
|
|
138
139
|
useEffect(function () {
|
|
139
140
|
setInputType(type);
|
|
140
141
|
}, [type]);
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, defineProperty as _defineProperty, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import React__default, { useContext } from 'react';
|
|
10
|
+
import React__default, { useState, useContext } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { useNormalizedInputProps } from '../../internal/useNormalizedInputProps.js';
|
|
13
13
|
import PasswordInput from './PasswordInput.js';
|
|
@@ -18,9 +18,9 @@ import * as FeatureFlags from '@carbon/feature-flags';
|
|
|
18
18
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
19
19
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
20
20
|
|
|
21
|
-
var _excluded = ["className", "disabled", "helperText", "hideLabel", "id", "inline", "invalid", "invalidText", "labelText", "light", "onChange", "onClick", "placeholder", "readOnly", "size", "type", "warn", "warnText"];
|
|
21
|
+
var _excluded = ["className", "disabled", "helperText", "hideLabel", "id", "inline", "invalid", "invalidText", "labelText", "light", "onChange", "onClick", "placeholder", "readOnly", "size", "type", "warn", "warnText", "enableCounter", "maxCount"];
|
|
22
22
|
var TextInput = /*#__PURE__*/React__default.forwardRef(function TextInput(_ref, ref) {
|
|
23
|
-
var _classNames, _classNames2, _classNames3, _classNames4, _classNames7;
|
|
23
|
+
var _classNames, _classNames2, _classNames3, _classNames4, _classNames7, _classNames8;
|
|
24
24
|
|
|
25
25
|
var className = _ref.className,
|
|
26
26
|
_ref$disabled = _ref.disabled,
|
|
@@ -49,10 +49,21 @@ var TextInput = /*#__PURE__*/React__default.forwardRef(function TextInput(_ref,
|
|
|
49
49
|
_ref$warn = _ref.warn,
|
|
50
50
|
warn = _ref$warn === void 0 ? false : _ref$warn,
|
|
51
51
|
warnText = _ref.warnText,
|
|
52
|
+
_ref$enableCounter = _ref.enableCounter,
|
|
53
|
+
enableCounter = _ref$enableCounter === void 0 ? false : _ref$enableCounter,
|
|
54
|
+
maxCount = _ref.maxCount,
|
|
52
55
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
53
56
|
|
|
54
57
|
var prefix = usePrefix();
|
|
55
58
|
var enabled = useFeatureFlag('enable-v11-release');
|
|
59
|
+
var defaultValue = rest.defaultValue,
|
|
60
|
+
value = rest.value;
|
|
61
|
+
|
|
62
|
+
var _useState = useState((defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.length) || (value === null || value === void 0 ? void 0 : value.length) || 0),
|
|
63
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
64
|
+
textCount = _useState2[0],
|
|
65
|
+
setTextCount = _useState2[1];
|
|
66
|
+
|
|
56
67
|
var normalizedProps = useNormalizedInputProps({
|
|
57
68
|
id: id,
|
|
58
69
|
readOnly: readOnly,
|
|
@@ -69,6 +80,10 @@ var TextInput = /*#__PURE__*/React__default.forwardRef(function TextInput(_ref,
|
|
|
69
80
|
id: id,
|
|
70
81
|
onChange: function onChange(evt) {
|
|
71
82
|
if (!normalizedProps.disabled) {
|
|
83
|
+
var _evt$target$value;
|
|
84
|
+
|
|
85
|
+
setTextCount((_evt$target$value = evt.target.value) === null || _evt$target$value === void 0 ? void 0 : _evt$target$value.length);
|
|
86
|
+
|
|
72
87
|
_onChange(evt);
|
|
73
88
|
}
|
|
74
89
|
},
|
|
@@ -86,16 +101,27 @@ var TextInput = /*#__PURE__*/React__default.forwardRef(function TextInput(_ref,
|
|
|
86
101
|
readOnly: readOnly
|
|
87
102
|
}, 'aria-describedby', helperText && normalizedProps.helperId), rest);
|
|
88
103
|
|
|
104
|
+
if (enableCounter) {
|
|
105
|
+
sharedTextInputProps.maxLength = maxCount;
|
|
106
|
+
}
|
|
107
|
+
|
|
89
108
|
var inputWrapperClasses = cx([enabled ? cx("".concat(prefix, "--form-item"), className) : "".concat(prefix, "--form-item")], "".concat(prefix, "--text-input-wrapper"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--readonly"), readOnly), _defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--light"), light), _defineProperty(_classNames2, "".concat(prefix, "--text-input-wrapper--inline"), inline), _classNames2));
|
|
90
109
|
var labelClasses = cx("".concat(prefix, "--label"), (_classNames3 = {}, _defineProperty(_classNames3, "".concat(prefix, "--visually-hidden"), hideLabel), _defineProperty(_classNames3, "".concat(prefix, "--label--disabled"), normalizedProps.disabled), _defineProperty(_classNames3, "".concat(prefix, "--label--inline"), inline), _defineProperty(_classNames3, "".concat(prefix, "--label--inline--").concat(size), inline && !!size), _classNames3));
|
|
91
110
|
var helperTextClasses = cx("".concat(prefix, "--form__helper-text"), (_classNames4 = {}, _defineProperty(_classNames4, "".concat(prefix, "--form__helper-text--disabled"), normalizedProps.disabled), _defineProperty(_classNames4, "".concat(prefix, "--form__helper-text--inline"), inline), _classNames4));
|
|
92
111
|
var fieldOuterWrapperClasses = cx("".concat(prefix, "--text-input__field-outer-wrapper"), _defineProperty({}, "".concat(prefix, "--text-input__field-outer-wrapper--inline"), inline));
|
|
93
112
|
var fieldWrapperClasses = cx("".concat(prefix, "--text-input__field-wrapper"), _defineProperty({}, "".concat(prefix, "--text-input__field-wrapper--warning"), normalizedProps.warn));
|
|
94
113
|
var iconClasses = cx((_classNames7 = {}, _defineProperty(_classNames7, "".concat(prefix, "--text-input__invalid-icon"), normalizedProps.invalid || normalizedProps.warn), _defineProperty(_classNames7, "".concat(prefix, "--text-input__invalid-icon--warning"), normalizedProps.warn), _defineProperty(_classNames7, "".concat(prefix, "--text-input__readonly-icon"), readOnly), _classNames7));
|
|
114
|
+
var counterClasses = cx("".concat(prefix, "--label"), (_classNames8 = {}, _defineProperty(_classNames8, "".concat(prefix, "--label--disabled"), disabled), _defineProperty(_classNames8, "".concat(prefix, "--text-input__label-counter"), true), _classNames8));
|
|
115
|
+
var counter = enableCounter && maxCount ? /*#__PURE__*/React__default.createElement("div", {
|
|
116
|
+
className: counterClasses
|
|
117
|
+
}, "".concat(textCount, "/").concat(maxCount)) : null;
|
|
95
118
|
var label = labelText ? /*#__PURE__*/React__default.createElement("label", {
|
|
96
119
|
htmlFor: id,
|
|
97
120
|
className: labelClasses
|
|
98
121
|
}, labelText) : null;
|
|
122
|
+
var labelWrapper = /*#__PURE__*/React__default.createElement("div", {
|
|
123
|
+
className: "".concat(prefix, "--text-input__label-wrapper")
|
|
124
|
+
}, label, counter);
|
|
99
125
|
var helper = helperText ? /*#__PURE__*/React__default.createElement("div", {
|
|
100
126
|
id: normalizedProps.helperId,
|
|
101
127
|
className: helperTextClasses
|
|
@@ -113,9 +139,9 @@ var TextInput = /*#__PURE__*/React__default.forwardRef(function TextInput(_ref,
|
|
|
113
139
|
|
|
114
140
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
115
141
|
className: inputWrapperClasses
|
|
116
|
-
}, !inline ?
|
|
142
|
+
}, !inline ? labelWrapper : /*#__PURE__*/React__default.createElement("div", {
|
|
117
143
|
className: "".concat(prefix, "--text-input__label-helper-wrapper")
|
|
118
|
-
},
|
|
144
|
+
}, labelWrapper, !isFluid && helper), /*#__PURE__*/React__default.createElement("div", {
|
|
119
145
|
className: fieldOuterWrapperClasses
|
|
120
146
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
121
147
|
className: fieldWrapperClasses,
|
|
@@ -145,6 +171,11 @@ TextInput.propTypes = {
|
|
|
145
171
|
*/
|
|
146
172
|
disabled: PropTypes.bool,
|
|
147
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Specify whether to display the character counter
|
|
176
|
+
*/
|
|
177
|
+
enableCounter: PropTypes.bool,
|
|
178
|
+
|
|
148
179
|
/**
|
|
149
180
|
* Provide text that is used alongside the control label for additional help
|
|
150
181
|
*/
|
|
@@ -187,6 +218,11 @@ TextInput.propTypes = {
|
|
|
187
218
|
*/
|
|
188
219
|
light: PropTypes.bool,
|
|
189
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Max character count allowed for the textarea. This is needed in order for enableCounter to display
|
|
223
|
+
*/
|
|
224
|
+
maxCount: PropTypes.number,
|
|
225
|
+
|
|
190
226
|
/**
|
|
191
227
|
* Optionally provide an `onChange` handler that is called whenever `<input>`
|
|
192
228
|
* is updated
|
package/es/index.js
CHANGED
|
@@ -47,12 +47,9 @@ export { default as OverflowMenuItem } from './components/OverflowMenuItem/index
|
|
|
47
47
|
export { default as Pagination } from './components/Pagination/index.js';
|
|
48
48
|
export { default as PaginationNav } from './components/PaginationNav/PaginationNav.js';
|
|
49
49
|
export { default as PrimaryButton } from './components/PrimaryButton/PrimaryButton.js';
|
|
50
|
-
export { ProgressIndicator } from './components/ProgressIndicator/index.js';
|
|
51
50
|
export { default as RadioButton } from './components/RadioButton/RadioButton.js';
|
|
52
51
|
export { default as RadioButtonGroup } from './components/RadioButtonGroup/RadioButtonGroup.js';
|
|
53
52
|
export { default as Search } from './components/Search/index.js';
|
|
54
|
-
export { default as SearchFilterButton } from './components/SearchFilterButton/SearchFilterButton.js';
|
|
55
|
-
export { default as SearchLayoutButton } from './components/SearchLayoutButton/SearchLayoutButton.js';
|
|
56
53
|
export { default as ExpandableSearch } from './components/ExpandableSearch/ExpandableSearch.js';
|
|
57
54
|
export { default as SecondaryButton } from './components/SecondaryButton/SecondaryButton.js';
|
|
58
55
|
export { default as SelectSkeleton } from './components/Select/Select.Skeleton.js';
|
|
@@ -125,6 +122,7 @@ export { default as SideNavItem } from './components/UIShell/SideNavItem.js';
|
|
|
125
122
|
export { default as SideNavLinkText } from './components/UIShell/SideNavLinkText.js';
|
|
126
123
|
export { default as unstable_useContextMenu } from './components/ContextMenu/useContextMenu.js';
|
|
127
124
|
export { default as unstable__FluidTextInput } from './components/FluidTextInput/FluidTextInput.js';
|
|
125
|
+
export { default as unstable__FluidTextArea } from './components/FluidTextArea/FluidTextArea.js';
|
|
128
126
|
export { default as unstable_MenuDivider } from './components/Menu/MenuDivider.js';
|
|
129
127
|
export { default as unstable_MenuGroup } from './components/Menu/MenuGroup.js';
|
|
130
128
|
export { default as unstable_MenuItem } from './components/Menu/MenuItem.js';
|
|
@@ -172,7 +170,7 @@ export { ActionableNotification, InlineNotification, NotificationActionButton, N
|
|
|
172
170
|
export { NumberInput } from './components/NumberInput/NumberInput.js';
|
|
173
171
|
export { default as ControlledPasswordInput } from './components/TextInput/ControlledPasswordInput.js';
|
|
174
172
|
export { default as PasswordInput } from './components/TextInput/PasswordInput.js';
|
|
175
|
-
export { ProgressStep } from './components/ProgressIndicator/ProgressIndicator.js';
|
|
173
|
+
export { ProgressIndicator, ProgressStep } from './components/ProgressIndicator/ProgressIndicator.js';
|
|
176
174
|
export { default as StructuredListSkeleton } from './components/StructuredList/StructuredList.Skeleton.js';
|
|
177
175
|
export { IconTab, TabList, TabPanel, TabPanels } from './components/Tabs/next/Tabs.js';
|
|
178
176
|
export { default as Content } from './components/UIShell/Content.js';
|
|
@@ -25,17 +25,20 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
|
25
25
|
|
|
26
26
|
var _SkeletonText, _SkeletonText2, _SkeletonText3;
|
|
27
27
|
|
|
28
|
-
var _excluded = ["align", "
|
|
28
|
+
var _excluded = ["align", "className", "count", "isFlush", "open"];
|
|
29
29
|
|
|
30
30
|
function AccordionSkeleton(_ref) {
|
|
31
|
+
var _cx;
|
|
32
|
+
|
|
31
33
|
var align = _ref.align,
|
|
32
|
-
open = _ref.open,
|
|
33
|
-
count = _ref.count,
|
|
34
34
|
className = _ref.className,
|
|
35
|
+
count = _ref.count,
|
|
36
|
+
isFlush = _ref.isFlush,
|
|
37
|
+
open = _ref.open,
|
|
35
38
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
36
39
|
|
|
37
40
|
var prefix = usePrefix.usePrefix();
|
|
38
|
-
var classes = cx__default["default"]("".concat(prefix, "--accordion"), "".concat(prefix, "--skeleton"), className, _rollupPluginBabelHelpers.defineProperty(
|
|
41
|
+
var classes = cx__default["default"]("".concat(prefix, "--accordion"), "".concat(prefix, "--skeleton"), className, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--").concat(align), align), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--flush"), isFlush && align !== 'start'), _cx));
|
|
39
42
|
var numSkeletonItems = open ? count - 1 : count;
|
|
40
43
|
return /*#__PURE__*/React__default["default"].createElement("ul", _rollupPluginBabelHelpers["extends"]({
|
|
41
44
|
className: classes
|
|
@@ -80,6 +83,11 @@ AccordionSkeleton.propTypes = {
|
|
|
80
83
|
*/
|
|
81
84
|
count: PropTypes__default["default"].number,
|
|
82
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Specify whether an individual AccordionItem should be flush, default is false
|
|
88
|
+
*/
|
|
89
|
+
isFlush: PropTypes__default["default"].bool,
|
|
90
|
+
|
|
83
91
|
/**
|
|
84
92
|
* `false` to not display the first item opened
|
|
85
93
|
*/
|
|
@@ -41,7 +41,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
41
41
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
42
42
|
var FeatureFlags__namespace = /*#__PURE__*/_interopNamespace(FeatureFlags);
|
|
43
43
|
|
|
44
|
-
var _excluded = ["align", "children", "className", "disabled", "size"];
|
|
44
|
+
var _excluded = ["align", "children", "className", "disabled", "isFlush", "size"];
|
|
45
45
|
|
|
46
46
|
function Accordion(_ref) {
|
|
47
47
|
var _cx;
|
|
@@ -52,12 +52,14 @@ function Accordion(_ref) {
|
|
|
52
52
|
customClassName = _ref.className,
|
|
53
53
|
_ref$disabled = _ref.disabled,
|
|
54
54
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
55
|
+
_ref$isFlush = _ref.isFlush,
|
|
56
|
+
isFlush = _ref$isFlush === void 0 ? false : _ref$isFlush,
|
|
55
57
|
_ref$size = _ref.size,
|
|
56
58
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
57
59
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
58
60
|
|
|
59
61
|
var prefix = usePrefix.usePrefix();
|
|
60
|
-
var className = cx__default["default"]("".concat(prefix, "--accordion"), customClassName, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--").concat(align), align), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--").concat(size), size), _cx));
|
|
62
|
+
var className = cx__default["default"]("".concat(prefix, "--accordion"), customClassName, (_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--").concat(align), align), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--").concat(size), size), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--accordion--flush"), isFlush && align !== 'start'), _cx));
|
|
61
63
|
return /*#__PURE__*/React__default["default"].createElement("ul", _rollupPluginBabelHelpers["extends"]({
|
|
62
64
|
className: className
|
|
63
65
|
}, rest), disabled ? React__default["default"].Children.toArray(children).map(function (child) {
|
|
@@ -88,6 +90,11 @@ Accordion.propTypes = {
|
|
|
88
90
|
*/
|
|
89
91
|
disabled: PropTypes__default["default"].bool,
|
|
90
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Specify whether Accordion text should be flush, default is false, does not work with align="start"
|
|
95
|
+
*/
|
|
96
|
+
isFlush: PropTypes__default["default"].bool,
|
|
97
|
+
|
|
91
98
|
/**
|
|
92
99
|
* Specify the size of the Accordion. Currently supports the following:
|
|
93
100
|
*/
|
|
@@ -54,7 +54,9 @@ function Filename(_ref) {
|
|
|
54
54
|
return /*#__PURE__*/React__default["default"].createElement(iconsReact.CheckmarkFilled, _rollupPluginBabelHelpers["extends"]({
|
|
55
55
|
"aria-label": iconDescription,
|
|
56
56
|
className: "".concat(prefix, "--file-complete")
|
|
57
|
-
}, rest
|
|
57
|
+
}, rest, {
|
|
58
|
+
tabIndex: null
|
|
59
|
+
}), iconDescription && /*#__PURE__*/React__default["default"].createElement("title", null, iconDescription));
|
|
58
60
|
|
|
59
61
|
default:
|
|
60
62
|
return null;
|
|
@@ -0,0 +1,140 @@
|
|
|
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 TextArea = require('../TextArea/TextArea.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"];
|
|
27
|
+
|
|
28
|
+
function FluidTextArea(_ref) {
|
|
29
|
+
var className = _ref.className,
|
|
30
|
+
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
|
|
32
|
+
var prefix = usePrefix.usePrefix();
|
|
33
|
+
var classNames = cx__default["default"]("".concat(prefix, "--text-area--fluid"), className);
|
|
34
|
+
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
35
|
+
value: {
|
|
36
|
+
isFluid: true
|
|
37
|
+
}
|
|
38
|
+
}, /*#__PURE__*/React__default["default"].createElement(TextArea["default"], _rollupPluginBabelHelpers["extends"]({
|
|
39
|
+
className: classNames
|
|
40
|
+
}, other)));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
FluidTextArea.propTypes = {
|
|
44
|
+
/**
|
|
45
|
+
* Provide a custom className that is applied directly to the underlying
|
|
46
|
+
* `<textarea>` node
|
|
47
|
+
*/
|
|
48
|
+
className: PropTypes__default["default"].string,
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Specify the `cols` attribute for the underlying `<textarea>` node
|
|
52
|
+
*/
|
|
53
|
+
cols: PropTypes__default["default"].number,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Optionally provide the default value of the `<textarea>`
|
|
57
|
+
*/
|
|
58
|
+
defaultValue: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Specify whether the control is disabled
|
|
62
|
+
*/
|
|
63
|
+
disabled: PropTypes__default["default"].bool,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Specify whether to display the character counter
|
|
67
|
+
*/
|
|
68
|
+
enableCounter: PropTypes__default["default"].bool,
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Provide text that is used alongside the control label for additional help
|
|
72
|
+
*/
|
|
73
|
+
helperText: PropTypes__default["default"].node,
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Specify whether you want the underlying label to be visually hidden
|
|
77
|
+
*/
|
|
78
|
+
hideLabel: PropTypes__default["default"].bool,
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Provide a unique identifier for the control
|
|
82
|
+
*/
|
|
83
|
+
id: PropTypes__default["default"].string,
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Specify whether the control is currently invalid
|
|
87
|
+
*/
|
|
88
|
+
invalid: PropTypes__default["default"].bool,
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Provide the text that is displayed when the control is in an invalid state
|
|
92
|
+
*/
|
|
93
|
+
invalidText: PropTypes__default["default"].node,
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Provide the text that will be read by a screen reader when visiting this
|
|
97
|
+
* control
|
|
98
|
+
*/
|
|
99
|
+
labelText: PropTypes__default["default"].node.isRequired,
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
103
|
+
* Don't use this to make tile background color same as container background color.
|
|
104
|
+
*/
|
|
105
|
+
light: PropTypes__default["default"].bool,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Max character count allowed for the textarea. This is needed in order for enableCounter to display
|
|
109
|
+
*/
|
|
110
|
+
maxCount: PropTypes__default["default"].number,
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Optionally provide an `onChange` handler that is called whenever `<textarea>`
|
|
114
|
+
* is updated
|
|
115
|
+
*/
|
|
116
|
+
onChange: PropTypes__default["default"].func,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Optionally provide an `onClick` handler that is called whenever the
|
|
120
|
+
* `<textarea>` is clicked
|
|
121
|
+
*/
|
|
122
|
+
onClick: PropTypes__default["default"].func,
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Specify the placeholder attribute for the `<textarea>`
|
|
126
|
+
*/
|
|
127
|
+
placeholder: PropTypes__default["default"].string,
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Specify the rows attribute for the `<textarea>`
|
|
131
|
+
*/
|
|
132
|
+
rows: PropTypes__default["default"].number,
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Provide the current value of the `<textarea>`
|
|
136
|
+
*/
|
|
137
|
+
value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number])
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
exports["default"] = FluidTextArea;
|
|
@@ -14,6 +14,7 @@ var PropTypes = require('prop-types');
|
|
|
14
14
|
var React = require('react');
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
require('../TextInput/index.js');
|
|
17
|
+
var PasswordInput = require('../TextInput/PasswordInput.js');
|
|
17
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
19
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
19
20
|
var TextInput = require('../TextInput/TextInput.js');
|
|
@@ -24,19 +25,22 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
24
25
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
26
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
26
27
|
|
|
27
|
-
var _excluded = ["className"];
|
|
28
|
+
var _excluded = ["className", "isPassword"];
|
|
28
29
|
|
|
29
30
|
function FluidTextInput(_ref) {
|
|
30
31
|
var className = _ref.className,
|
|
32
|
+
isPassword = _ref.isPassword,
|
|
31
33
|
other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
|
32
34
|
|
|
33
35
|
var prefix = usePrefix.usePrefix();
|
|
34
|
-
var classNames = cx__default["default"]("".concat(prefix, "--text-input--fluid"),
|
|
36
|
+
var classNames = cx__default["default"](className, _rollupPluginBabelHelpers.defineProperty({}, "".concat(prefix, "--text-input--fluid"), !isPassword));
|
|
35
37
|
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
36
38
|
value: {
|
|
37
39
|
isFluid: true
|
|
38
40
|
}
|
|
39
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
41
|
+
}, isPassword ? /*#__PURE__*/React__default["default"].createElement(PasswordInput["default"], _rollupPluginBabelHelpers["extends"]({
|
|
42
|
+
className: classNames
|
|
43
|
+
}, other)) : /*#__PURE__*/React__default["default"].createElement(TextInput["default"], _rollupPluginBabelHelpers["extends"]({
|
|
40
44
|
className: classNames
|
|
41
45
|
}, other)));
|
|
42
46
|
}
|
|
@@ -72,6 +76,11 @@ FluidTextInput.propTypes = {
|
|
|
72
76
|
*/
|
|
73
77
|
invalidText: PropTypes__default["default"].node,
|
|
74
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Specify whether the control is a password input
|
|
81
|
+
*/
|
|
82
|
+
isPassword: PropTypes__default["default"].bool,
|
|
83
|
+
|
|
75
84
|
/**
|
|
76
85
|
* Provide the text that will be read by a screen reader when visiting this
|
|
77
86
|
* control
|
|
@@ -18,6 +18,7 @@ var Button = require('../Button/Button.js');
|
|
|
18
18
|
var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
19
19
|
var useNoInteractiveChildren = require('../../internal/useNoInteractiveChildren.js');
|
|
20
20
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
21
|
+
var useId = require('../../internal/useId.js');
|
|
21
22
|
var match = require('../../internal/keyboard/match.js');
|
|
22
23
|
var keys = require('../../internal/keyboard/keys.js');
|
|
23
24
|
|
|
@@ -516,6 +517,7 @@ function ActionableNotification(_ref6) {
|
|
|
516
517
|
setIsOpen = _useState6[1];
|
|
517
518
|
|
|
518
519
|
var prefix = usePrefix.usePrefix();
|
|
520
|
+
var id = useId.useId('actionable-notification');
|
|
519
521
|
var containerClassName = cx__default["default"](className, (_cx6 = {}, _rollupPluginBabelHelpers.defineProperty(_cx6, "".concat(prefix, "--actionable-notification"), true), _rollupPluginBabelHelpers.defineProperty(_cx6, "".concat(prefix, "--actionable-notification--toast"), !inline), _rollupPluginBabelHelpers.defineProperty(_cx6, "".concat(prefix, "--actionable-notification--low-contrast"), lowContrast), _rollupPluginBabelHelpers.defineProperty(_cx6, "".concat(prefix, "--actionable-notification--").concat(kind), kind), _rollupPluginBabelHelpers.defineProperty(_cx6, "".concat(prefix, "--actionable-notification--hide-close-button"), hideCloseButton), _cx6));
|
|
520
522
|
var ref = React.useRef(null);
|
|
521
523
|
useIsomorphicEffect["default"](function () {
|
|
@@ -544,7 +546,8 @@ function ActionableNotification(_ref6) {
|
|
|
544
546
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
545
547
|
ref: ref,
|
|
546
548
|
role: role,
|
|
547
|
-
className: containerClassName
|
|
549
|
+
className: containerClassName,
|
|
550
|
+
"aria-labelledby": title ? id : undefined
|
|
548
551
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
549
552
|
className: "".concat(prefix, "--actionable-notification__details")
|
|
550
553
|
}, /*#__PURE__*/React__default["default"].createElement(NotificationIcon, {
|
|
@@ -556,7 +559,8 @@ function ActionableNotification(_ref6) {
|
|
|
556
559
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
557
560
|
className: "".concat(prefix, "--actionable-notification__content")
|
|
558
561
|
}, title && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
559
|
-
className: "".concat(prefix, "--actionable-notification__title")
|
|
562
|
+
className: "".concat(prefix, "--actionable-notification__title"),
|
|
563
|
+
id: id
|
|
560
564
|
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
561
565
|
className: "".concat(prefix, "--actionable-notification__subtitle")
|
|
562
566
|
}, subtitle), children))), /*#__PURE__*/React__default["default"].createElement(NotificationActionButton, {
|
|
@@ -197,7 +197,7 @@ var NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function Num
|
|
|
197
197
|
disabled: disabled,
|
|
198
198
|
onClick: function onClick(event) {
|
|
199
199
|
var state = {
|
|
200
|
-
value: clamp(max, min, value - step),
|
|
200
|
+
value: clamp(max, min, parseInt(value) - step),
|
|
201
201
|
direction: 'down'
|
|
202
202
|
};
|
|
203
203
|
setValue(state.value);
|
|
@@ -223,7 +223,7 @@ var NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function Num
|
|
|
223
223
|
disabled: disabled,
|
|
224
224
|
onClick: function onClick(event) {
|
|
225
225
|
var state = {
|
|
226
|
-
value: clamp(max, min, value + step),
|
|
226
|
+
value: clamp(max, min, parseInt(value) + step),
|
|
227
227
|
direction: 'up'
|
|
228
228
|
};
|
|
229
229
|
setValue(state.value);
|