@carbon/react 1.95.0 → 1.96.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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1039 -1004
- package/es/components/ComboBox/ComboBox.js +15 -9
- package/es/components/Dropdown/Dropdown.js +26 -22
- package/es/components/Menu/Menu.js +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +1 -1
- package/es/components/Pagination/Pagination.js +1 -0
- package/es/components/RadioButton/RadioButton.d.ts +20 -0
- package/es/components/RadioButton/RadioButton.js +43 -5
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +3 -3
- package/es/components/Search/Search.js +17 -7
- package/es/components/Slider/Slider.Skeleton.d.ts +3 -29
- package/es/components/Slider/Slider.Skeleton.js +1 -1
- package/es/components/Slider/Slider.d.ts +2 -144
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Slider/index.d.ts +1 -3
- package/es/components/TimePicker/TimePicker.js +19 -15
- package/es/index.js +1 -1
- package/lib/components/ComboBox/ComboBox.js +15 -9
- package/lib/components/Dropdown/Dropdown.js +26 -22
- package/lib/components/Menu/Menu.js +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +1 -1
- package/lib/components/Pagination/Pagination.js +1 -0
- package/lib/components/RadioButton/RadioButton.d.ts +20 -0
- package/lib/components/RadioButton/RadioButton.js +43 -5
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +3 -3
- package/lib/components/Search/Search.js +16 -6
- package/lib/components/Slider/Slider.Skeleton.d.ts +3 -29
- package/lib/components/Slider/Slider.Skeleton.js +0 -1
- package/lib/components/Slider/Slider.d.ts +2 -144
- package/lib/components/Slider/Slider.js +3 -1
- package/lib/components/Slider/index.d.ts +1 -3
- package/lib/components/TimePicker/TimePicker.js +19 -15
- package/lib/index.js +1 -1
- package/package.json +4 -4
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { type InputHTMLAttributes, type KeyboardEventHandler, type ReactNode } from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
8
|
import type { TranslateWithId } from '../../types/common';
|
|
10
9
|
declare const translationIds: {
|
|
11
10
|
readonly 'carbon.slider.auto-correct-announcement': "carbon.slider.auto-correct-announcement";
|
|
@@ -162,146 +161,5 @@ export interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
162
161
|
*/
|
|
163
162
|
warnText?: ReactNode;
|
|
164
163
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
propTypes: {
|
|
168
|
-
/**
|
|
169
|
-
* The `ariaLabel` for the `<input>`.
|
|
170
|
-
*/
|
|
171
|
-
ariaLabelInput: PropTypes.Requireable<string>;
|
|
172
|
-
/**
|
|
173
|
-
* The child nodes.
|
|
174
|
-
*/
|
|
175
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
176
|
-
/**
|
|
177
|
-
* The CSS class name for the slider.
|
|
178
|
-
*/
|
|
179
|
-
className: PropTypes.Requireable<string>;
|
|
180
|
-
/**
|
|
181
|
-
* `true` to disable this slider.
|
|
182
|
-
*/
|
|
183
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
184
|
-
/**
|
|
185
|
-
* The callback to format the label associated with the minimum/maximum value.
|
|
186
|
-
*/
|
|
187
|
-
formatLabel: PropTypes.Requireable<(...args: any[]) => any>;
|
|
188
|
-
/**
|
|
189
|
-
* `true` to hide the number input box.
|
|
190
|
-
*/
|
|
191
|
-
hideTextInput: PropTypes.Requireable<boolean>;
|
|
192
|
-
/**
|
|
193
|
-
* The ID of the `<input>`.
|
|
194
|
-
*/
|
|
195
|
-
id: PropTypes.Requireable<string>;
|
|
196
|
-
/**
|
|
197
|
-
* The `type` attribute of the `<input>`.
|
|
198
|
-
*/
|
|
199
|
-
inputType: PropTypes.Requireable<string>;
|
|
200
|
-
/**
|
|
201
|
-
* `Specify whether the Slider is currently invalid
|
|
202
|
-
*/
|
|
203
|
-
invalid: PropTypes.Requireable<boolean>;
|
|
204
|
-
/**
|
|
205
|
-
* Provide the text that is displayed when the Slider is in an invalid state
|
|
206
|
-
*/
|
|
207
|
-
invalidText: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
208
|
-
/**
|
|
209
|
-
* The label for the slider.
|
|
210
|
-
*/
|
|
211
|
-
labelText: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
212
|
-
/**
|
|
213
|
-
* Specify whether you want the underlying label to be visually hidden
|
|
214
|
-
*/
|
|
215
|
-
hideLabel: PropTypes.Requireable<boolean>;
|
|
216
|
-
/**
|
|
217
|
-
* `true` to use the light version.
|
|
218
|
-
*/
|
|
219
|
-
light: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
|
|
220
|
-
/**
|
|
221
|
-
* The maximum value.
|
|
222
|
-
*/
|
|
223
|
-
max: PropTypes.Validator<number>;
|
|
224
|
-
/**
|
|
225
|
-
* The label associated with the maximum value.
|
|
226
|
-
*/
|
|
227
|
-
maxLabel: PropTypes.Requireable<string>;
|
|
228
|
-
/**
|
|
229
|
-
* The minimum value.
|
|
230
|
-
*/
|
|
231
|
-
min: PropTypes.Validator<number>;
|
|
232
|
-
/**
|
|
233
|
-
* The label associated with the minimum value.
|
|
234
|
-
*/
|
|
235
|
-
minLabel: PropTypes.Requireable<string>;
|
|
236
|
-
/**
|
|
237
|
-
* The `name` attribute of the `<input>`.
|
|
238
|
-
*/
|
|
239
|
-
name: PropTypes.Requireable<string>;
|
|
240
|
-
/**
|
|
241
|
-
* Provide an optional function to be called when the input element
|
|
242
|
-
* loses focus
|
|
243
|
-
*/
|
|
244
|
-
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
245
|
-
/**
|
|
246
|
-
* The callback to get notified of change in value.
|
|
247
|
-
*/
|
|
248
|
-
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
249
|
-
/**
|
|
250
|
-
* Provide an optional function to be called when a key is pressed in the number input.
|
|
251
|
-
*/
|
|
252
|
-
onInputKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
|
|
253
|
-
/**
|
|
254
|
-
* The callback to get notified of value on handle release.
|
|
255
|
-
*/
|
|
256
|
-
onRelease: PropTypes.Requireable<(...args: any[]) => any>;
|
|
257
|
-
/**
|
|
258
|
-
* Whether the slider should be read-only
|
|
259
|
-
*/
|
|
260
|
-
readOnly: PropTypes.Requireable<boolean>;
|
|
261
|
-
/**
|
|
262
|
-
* `true` to specify if the control is required.
|
|
263
|
-
*/
|
|
264
|
-
required: PropTypes.Requireable<boolean>;
|
|
265
|
-
/**
|
|
266
|
-
* A value determining how much the value should increase/decrease by moving the thumb by mouse. If a value other than 1 is provided and the input is *not* hidden, the new step requirement should be added to a visible label. Values outside the `step` increment will be considered invalid.
|
|
267
|
-
*/
|
|
268
|
-
step: PropTypes.Requireable<number>;
|
|
269
|
-
/**
|
|
270
|
-
* A value determining how much the value should increase/decrease by Shift+arrow keys,
|
|
271
|
-
* which will be `(max - min) / stepMultiplier`.
|
|
272
|
-
*/
|
|
273
|
-
stepMultiplier: PropTypes.Requireable<number>;
|
|
274
|
-
/**
|
|
275
|
-
* Supply a method to translate internal strings with your i18n tool of
|
|
276
|
-
* choice. Translation keys are available on the `translationIds` field for
|
|
277
|
-
* this component.
|
|
278
|
-
*/
|
|
279
|
-
translateWithId: PropTypes.Requireable<(...args: any[]) => any>;
|
|
280
|
-
/**
|
|
281
|
-
* The `ariaLabel` for the upper bound `<input>` when there are two handles.
|
|
282
|
-
*/
|
|
283
|
-
unstable_ariaLabelInputUpper: PropTypes.Requireable<string>;
|
|
284
|
-
/**
|
|
285
|
-
* The `name` attribute of the upper bound `<input>` when there are two handles.
|
|
286
|
-
*/
|
|
287
|
-
unstable_nameUpper: PropTypes.Requireable<string>;
|
|
288
|
-
/**
|
|
289
|
-
* The upper bound when there are two handles.
|
|
290
|
-
*/
|
|
291
|
-
unstable_valueUpper: PropTypes.Requireable<number>;
|
|
292
|
-
/**
|
|
293
|
-
* The value of the slider. When there are two handles, value is the lower
|
|
294
|
-
* bound.
|
|
295
|
-
*/
|
|
296
|
-
value: PropTypes.Validator<number>;
|
|
297
|
-
/**
|
|
298
|
-
* `Specify whether the Slider is in a warn state
|
|
299
|
-
*/
|
|
300
|
-
warn: PropTypes.Requireable<boolean>;
|
|
301
|
-
/**
|
|
302
|
-
* Provide the text that is displayed when the Slider is in a warn state
|
|
303
|
-
*/
|
|
304
|
-
warnText: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
305
|
-
};
|
|
306
|
-
};
|
|
307
|
-
export {};
|
|
164
|
+
declare const _default: (props: SliderProps) => ReactNode;
|
|
165
|
+
export default _default;
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
10
12
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
11
13
|
var React = require('react');
|
|
12
14
|
var PropTypes = require('prop-types');
|
|
@@ -1356,4 +1358,4 @@ Slider.propTypes = {
|
|
|
1356
1358
|
warnText: PropTypes.node
|
|
1357
1359
|
};
|
|
1358
1360
|
|
|
1359
|
-
exports.
|
|
1361
|
+
exports.default = Slider;
|
|
@@ -4,7 +4,5 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
export { default as Slider } from './Slider';
|
|
8
8
|
export { default as SliderSkeleton } from './Slider.Skeleton';
|
|
9
|
-
export default Slider;
|
|
10
|
-
export { Slider };
|
|
@@ -15,7 +15,7 @@ var PropTypes = require('prop-types');
|
|
|
15
15
|
var React = require('react');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
18
|
-
var
|
|
18
|
+
var useNormalizedInputProps = require('../../internal/useNormalizedInputProps.js');
|
|
19
19
|
|
|
20
20
|
const frFn = React.forwardRef;
|
|
21
21
|
const TimePicker = frFn((props, ref) => {
|
|
@@ -74,15 +74,24 @@ const TimePicker = frFn((props, ref) => {
|
|
|
74
74
|
onBlur(evt);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
const normalizedProps = useNormalizedInputProps.useNormalizedInputProps({
|
|
78
|
+
id,
|
|
79
|
+
readOnly,
|
|
80
|
+
disabled,
|
|
81
|
+
invalid,
|
|
82
|
+
invalidText,
|
|
83
|
+
warn: warning,
|
|
84
|
+
warnText: warningText
|
|
85
|
+
});
|
|
77
86
|
const timePickerInputClasses = cx(`${prefix}--time-picker__input-field`, `${prefix}--text-input`, [inputClassName], {
|
|
78
87
|
[`${prefix}--text-input--light`]: light,
|
|
79
|
-
[`${prefix}--time-picker__input-field-error`]: invalid ||
|
|
88
|
+
[`${prefix}--time-picker__input-field-error`]: normalizedProps.invalid || normalizedProps.warn
|
|
80
89
|
});
|
|
81
90
|
const timePickerClasses = cx({
|
|
82
91
|
[`${prefix}--time-picker`]: true,
|
|
83
92
|
[`${prefix}--time-picker--light`]: light,
|
|
84
|
-
[`${prefix}--time-picker--invalid`]: invalid,
|
|
85
|
-
[`${prefix}--time-picker--warning`]:
|
|
93
|
+
[`${prefix}--time-picker--invalid`]: normalizedProps.invalid,
|
|
94
|
+
[`${prefix}--time-picker--warning`]: normalizedProps.warn,
|
|
86
95
|
[`${prefix}--time-picker--readonly`]: readOnly,
|
|
87
96
|
[`${prefix}--time-picker--${size}`]: size,
|
|
88
97
|
...(pickerClassName && {
|
|
@@ -140,8 +149,8 @@ const TimePicker = frFn((props, ref) => {
|
|
|
140
149
|
className: `${prefix}--time-picker__input`
|
|
141
150
|
}, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({
|
|
142
151
|
className: timePickerInputClasses,
|
|
143
|
-
"data-invalid": invalid ?
|
|
144
|
-
disabled: disabled,
|
|
152
|
+
"data-invalid": normalizedProps.invalid ? true : undefined,
|
|
153
|
+
disabled: normalizedProps.disabled,
|
|
145
154
|
id: id,
|
|
146
155
|
maxLength: maxLength,
|
|
147
156
|
onClick: handleOnClick,
|
|
@@ -152,17 +161,12 @@ const TimePicker = frFn((props, ref) => {
|
|
|
152
161
|
ref: ref,
|
|
153
162
|
type: type,
|
|
154
163
|
value: value
|
|
155
|
-
}, rest, readOnlyProps)), (invalid ||
|
|
164
|
+
}, rest, readOnlyProps)), (normalizedProps.invalid || normalizedProps.warn) && normalizedProps.icon && /*#__PURE__*/React.createElement("div", {
|
|
156
165
|
className: `${prefix}--time-picker__error__icon`
|
|
157
|
-
},
|
|
158
|
-
className: `${prefix}--checkbox__invalid-icon`,
|
|
159
|
-
size: 16
|
|
160
|
-
}) : /*#__PURE__*/React.createElement(iconsReact.WarningAltFilled, {
|
|
161
|
-
className: `${prefix}--text-input__invalid-icon--warning`,
|
|
166
|
+
}, /*#__PURE__*/React.createElement(normalizedProps.icon, {
|
|
167
|
+
className: normalizedProps.invalid ? `${prefix}--checkbox__invalid-icon` : `${prefix}--text-input__invalid-icon--warning`,
|
|
162
168
|
size: 16
|
|
163
|
-
}))), getInternalPickerSelects()),
|
|
164
|
-
className: `${prefix}--form-requirement`
|
|
165
|
-
}, invalid ? invalidText : warningText));
|
|
169
|
+
}))), getInternalPickerSelects()), normalizedProps.validation);
|
|
166
170
|
});
|
|
167
171
|
TimePicker.propTypes = {
|
|
168
172
|
/**
|
package/lib/index.js
CHANGED
|
@@ -396,7 +396,7 @@ exports.SelectItemGroup = SelectItemGroup.default;
|
|
|
396
396
|
exports.SkeletonIcon = SkeletonIcon.default;
|
|
397
397
|
exports.SkeletonPlaceholder = SkeletonPlaceholder.default;
|
|
398
398
|
exports.SkeletonText = SkeletonText.default;
|
|
399
|
-
exports.Slider = Slider.
|
|
399
|
+
exports.Slider = Slider.default;
|
|
400
400
|
exports.SliderSkeleton = Slider_Skeleton.default;
|
|
401
401
|
exports.HStack = HStack.HStack;
|
|
402
402
|
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.96.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@carbon/feature-flags": "0.32.0",
|
|
56
56
|
"@carbon/icons-react": "^11.70.0",
|
|
57
57
|
"@carbon/layout": "^11.43.0",
|
|
58
|
-
"@carbon/styles": "^1.
|
|
58
|
+
"@carbon/styles": "^1.95.0",
|
|
59
59
|
"@carbon/utilities": "^0.12.0",
|
|
60
60
|
"@floating-ui/react": "^0.27.4",
|
|
61
61
|
"@ibm/telemetry-js": "^1.5.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@babel/preset-react": "^7.27.1",
|
|
81
81
|
"@babel/preset-typescript": "^7.27.1",
|
|
82
82
|
"@carbon/test-utils": "^10.38.0",
|
|
83
|
-
"@carbon/themes": "^11.
|
|
83
|
+
"@carbon/themes": "^11.63.0",
|
|
84
84
|
"@figma/code-connect": "^1.3.5",
|
|
85
85
|
"@rollup/plugin-babel": "^6.0.0",
|
|
86
86
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
@@ -139,5 +139,5 @@
|
|
|
139
139
|
"**/*.scss",
|
|
140
140
|
"**/*.css"
|
|
141
141
|
],
|
|
142
|
-
"gitHead": "
|
|
142
|
+
"gitHead": "d2ccae94e5aa3defcce07cc9ea90058fda6c9705"
|
|
143
143
|
}
|