@carbon/react 1.90.0 → 1.91.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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +921 -921
- package/es/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/es/components/CodeSnippet/CodeSnippet.js +1 -1
- package/es/components/ComboBox/ComboBox.js +1 -12
- package/es/components/ComboButton/index.js +1 -1
- package/es/components/ComposedModal/ComposedModal.js +1 -1
- package/es/components/Copy/Copy.d.ts +1 -1
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/CopyButton/CopyButton.d.ts +1 -1
- package/es/components/CopyButton/CopyButton.js +1 -1
- package/es/components/DataTable/DataTable.d.ts +60 -15
- package/es/components/DataTable/DataTable.js +106 -179
- package/es/components/DataTable/Table.d.ts +2 -2
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableExpandHeader.js +1 -1
- package/es/components/DatePicker/DatePicker.d.ts +0 -12
- package/es/components/DatePicker/DatePicker.js +3 -3
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +19 -2
- package/es/components/DatePicker/plugins/rangePlugin.js +18 -14
- package/es/components/Dropdown/Dropdown.js +1 -12
- package/es/components/FeatureFlags/index.js +1 -0
- package/es/components/IconButton/index.js +1 -1
- package/es/components/Menu/MenuItem.d.ts +1 -1
- package/es/components/Menu/MenuItem.js +5 -5
- package/es/components/Modal/Modal.js +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +1 -1
- package/es/components/MultiSelect/MultiSelect.js +1 -12
- package/es/components/Notification/Notification.d.ts +6 -6
- package/es/components/Notification/Notification.js +6 -6
- package/es/components/OverflowMenu/OverflowMenu.js +1 -1
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/Popover/index.js +1 -1
- package/es/components/Search/Search.d.ts +4 -2
- package/es/components/Search/Search.js +5 -4
- package/es/components/Slider/Slider.d.ts +144 -188
- package/es/components/Slider/Slider.js +787 -710
- package/es/components/Slider/index.d.ts +2 -2
- package/es/components/Tabs/Tabs.d.ts +4 -0
- package/es/components/TextArea/TextArea.js +13 -6
- package/es/components/TextInput/ControlledPasswordInput.js +2 -2
- package/es/components/TextInput/PasswordInput.js +2 -2
- package/es/components/TextInput/TextInput.js +2 -2
- package/es/components/TextInput/util.d.ts +17 -5
- package/es/components/TextInput/util.js +2 -7
- package/es/components/UIShell/HeaderPanel.d.ts +1 -1
- package/es/index.d.ts +12 -13
- package/es/index.js +25 -24
- package/es/internal/defaultItemToString.d.ts +7 -0
- package/es/internal/defaultItemToString.js +17 -0
- package/es/internal/index.d.ts +1 -0
- package/es/prop-types/deprecateValuesWithin.d.ts +8 -1
- package/es/prop-types/deprecateValuesWithin.js +6 -6
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +8 -7
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +10 -10
- package/lib/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/lib/components/CodeSnippet/CodeSnippet.js +1 -1
- package/lib/components/ComboBox/ComboBox.js +3 -14
- package/lib/components/ComboButton/index.js +1 -1
- package/lib/components/ComposedModal/ComposedModal.js +1 -1
- package/lib/components/Copy/Copy.d.ts +1 -1
- package/lib/components/Copy/Copy.js +1 -1
- package/lib/components/CopyButton/CopyButton.d.ts +1 -1
- package/lib/components/CopyButton/CopyButton.js +1 -1
- package/lib/components/DataTable/DataTable.d.ts +60 -15
- package/lib/components/DataTable/DataTable.js +106 -179
- package/lib/components/DataTable/Table.d.ts +2 -2
- package/lib/components/DataTable/Table.js +1 -1
- package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableExpandHeader.js +3 -3
- package/lib/components/DatePicker/DatePicker.d.ts +0 -12
- package/lib/components/DatePicker/DatePicker.js +2 -2
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +19 -2
- package/lib/components/DatePicker/plugins/rangePlugin.js +18 -16
- package/lib/components/Dropdown/Dropdown.js +3 -14
- package/lib/components/FeatureFlags/index.js +1 -0
- package/lib/components/IconButton/index.js +1 -1
- package/lib/components/Menu/MenuItem.d.ts +1 -1
- package/lib/components/Menu/MenuItem.js +6 -6
- package/lib/components/Modal/Modal.js +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +8 -8
- package/lib/components/MultiSelect/MultiSelect.js +2 -13
- package/lib/components/Notification/Notification.d.ts +6 -6
- package/lib/components/Notification/Notification.js +6 -6
- package/lib/components/OverflowMenu/OverflowMenu.js +1 -1
- package/lib/components/OverflowMenu/next/index.js +1 -1
- package/lib/components/Popover/index.js +1 -1
- package/lib/components/Search/Search.d.ts +4 -2
- package/lib/components/Search/Search.js +5 -4
- package/lib/components/Slider/Slider.d.ts +144 -188
- package/lib/components/Slider/Slider.js +784 -709
- package/lib/components/Slider/index.d.ts +2 -2
- package/lib/components/Tabs/Tabs.d.ts +4 -0
- package/lib/components/TextArea/TextArea.js +13 -6
- package/lib/components/TextInput/ControlledPasswordInput.js +1 -1
- package/lib/components/TextInput/PasswordInput.js +1 -1
- package/lib/components/TextInput/TextInput.js +1 -1
- package/lib/components/TextInput/util.d.ts +17 -5
- package/lib/components/TextInput/util.js +2 -7
- package/lib/components/UIShell/HeaderPanel.d.ts +1 -1
- package/lib/index.d.ts +12 -13
- package/lib/index.js +51 -28
- package/lib/internal/defaultItemToString.d.ts +7 -0
- package/lib/internal/defaultItemToString.js +19 -0
- package/lib/internal/index.d.ts +1 -0
- package/lib/prop-types/deprecateValuesWithin.d.ts +8 -1
- package/lib/prop-types/deprecateValuesWithin.js +6 -8
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +8 -7
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +10 -12
- package/package.json +8 -7
- package/es/components/MultiSelect/tools/itemToString.d.ts +0 -1
- package/es/components/MultiSelect/tools/itemToString.js +0 -21
- package/es/components/Slider/index.js +0 -14
- package/es/internal/createClassWrapper.js +0 -23
- package/lib/components/MultiSelect/tools/itemToString.d.ts +0 -1
- package/lib/components/MultiSelect/tools/itemToString.js +0 -23
- package/lib/components/Slider/index.js +0 -20
- package/lib/internal/createClassWrapper.js +0 -25
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
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
|
+
import { Slider } from './Slider';
|
|
8
8
|
export { default as SliderSkeleton } from './Slider.Skeleton';
|
|
9
9
|
export default Slider;
|
|
10
10
|
export { Slider };
|
|
@@ -367,6 +367,10 @@ export interface IconTabProps extends DivAttributes {
|
|
|
367
367
|
* Specify whether the tooltip for the icon should be open when it first renders
|
|
368
368
|
*/
|
|
369
369
|
defaultOpen?: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Specify whether your IconTab is disabled.
|
|
372
|
+
*/
|
|
373
|
+
disabled?: boolean;
|
|
370
374
|
/**
|
|
371
375
|
* Specify the duration in milliseconds to delay before displaying the tooltip for the icon.
|
|
372
376
|
*/
|
|
@@ -80,19 +80,26 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
80
80
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
81
81
|
}, [value, defaultValue, counterMode]);
|
|
82
82
|
useIsomorphicEffect(() => {
|
|
83
|
-
const measuredWidth = wrapperRef.current?.scrollWidth;
|
|
84
83
|
if (other.cols && textareaRef.current) {
|
|
85
84
|
textareaRef.current.style.width = '';
|
|
86
85
|
textareaRef.current.style.resize = 'none';
|
|
87
86
|
} else if (textareaRef.current) {
|
|
88
87
|
textareaRef.current.style.width = `100%`;
|
|
89
88
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
r.current
|
|
94
|
-
|
|
89
|
+
if (!wrapperRef.current) return;
|
|
90
|
+
const applyWidth = width => {
|
|
91
|
+
[helperTextRef, errorTextRef, warnTextRef].forEach(r => {
|
|
92
|
+
if (r.current) {
|
|
93
|
+
r.current.style.maxWidth = `${width}px`;
|
|
94
|
+
r.current.style.overflowWrap = 'break-word';
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
99
|
+
applyWidth(entry.contentRect.width);
|
|
95
100
|
});
|
|
101
|
+
resizeObserver.observe(wrapperRef.current);
|
|
102
|
+
return () => resizeObserver && resizeObserver.disconnect();
|
|
96
103
|
}, [other.cols, invalid, warn]);
|
|
97
104
|
const textareaProps = {
|
|
98
105
|
id,
|
|
@@ -10,7 +10,7 @@ import React from 'react';
|
|
|
10
10
|
import cx from 'classnames';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import { WarningFilled, ViewOff, View } from '@carbon/icons-react';
|
|
13
|
-
import {
|
|
13
|
+
import { getTextInputProps } from './util.js';
|
|
14
14
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
15
15
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
16
|
import { useId } from '../../internal/useId.js';
|
|
@@ -90,7 +90,7 @@ const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
|
90
90
|
[`${prefix}--tooltip--align-${tooltipAlignment}`]: tooltipAlignment
|
|
91
91
|
});
|
|
92
92
|
const helperId = !helperText ? undefined : `controlled-password-helper-text-${controlledPasswordInstanceId}`;
|
|
93
|
-
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({},
|
|
93
|
+
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({}, getTextInputProps({
|
|
94
94
|
invalid,
|
|
95
95
|
sharedTextInputProps,
|
|
96
96
|
invalidId: errorId,
|
|
@@ -11,7 +11,7 @@ import cx from 'classnames';
|
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import { ViewOff, View } from '@carbon/icons-react';
|
|
13
13
|
import { useNormalizedInputProps } from '../../internal/useNormalizedInputProps.js';
|
|
14
|
-
import {
|
|
14
|
+
import { getTextInputProps } from './util.js';
|
|
15
15
|
import '../FluidForm/FluidForm.js';
|
|
16
16
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
17
17
|
import '../Tooltip/DefinitionTooltip.js';
|
|
@@ -157,7 +157,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
|
157
157
|
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
158
158
|
console.warn('Warning: The "showPasswordLabel" should not be blank.');
|
|
159
159
|
}
|
|
160
|
-
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({},
|
|
160
|
+
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({}, getTextInputProps({
|
|
161
161
|
sharedTextInputProps,
|
|
162
162
|
invalid: normalizedProps.invalid,
|
|
163
163
|
invalidId: normalizedProps.invalidId,
|
|
@@ -10,7 +10,7 @@ import React, { useRef, useState, useEffect, useContext, cloneElement } from 're
|
|
|
10
10
|
import cx from 'classnames';
|
|
11
11
|
import { useNormalizedInputProps } from '../../internal/useNormalizedInputProps.js';
|
|
12
12
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
13
|
-
import {
|
|
13
|
+
import { getTextInputProps } from './util.js';
|
|
14
14
|
import '../FluidForm/FluidForm.js';
|
|
15
15
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
16
16
|
import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
@@ -154,7 +154,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
154
154
|
id: normalizedProps.helperId,
|
|
155
155
|
className: helperTextClasses
|
|
156
156
|
}, helperText) : null;
|
|
157
|
-
const input = /*#__PURE__*/React.createElement("input",
|
|
157
|
+
const input = /*#__PURE__*/React.createElement("input", getTextInputProps({
|
|
158
158
|
sharedTextInputProps,
|
|
159
159
|
invalid: normalizedProps.invalid,
|
|
160
160
|
invalidId: normalizedProps.invalidId,
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
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
|
+
interface TextInputPropsConfig {
|
|
8
|
+
sharedTextInputProps: Record<string, unknown>;
|
|
9
|
+
invalid: boolean;
|
|
10
|
+
invalidId: string;
|
|
5
11
|
warn?: boolean;
|
|
6
12
|
warnId?: string;
|
|
7
13
|
hasHelper?: boolean;
|
|
8
14
|
helperId?: string;
|
|
9
|
-
}
|
|
15
|
+
}
|
|
16
|
+
export declare const getTextInputProps: ({ sharedTextInputProps, invalid, invalidId, warn, warnId, hasHelper, helperId, }: TextInputPropsConfig) => {
|
|
17
|
+
'aria-describedby'?: string | undefined;
|
|
18
|
+
'data-invalid'?: boolean | undefined;
|
|
19
|
+
'aria-invalid'?: boolean | undefined;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -16,12 +16,7 @@ const warnProps = warnId => ({
|
|
|
16
16
|
const helperProps = helperId => ({
|
|
17
17
|
'aria-describedby': helperId
|
|
18
18
|
});
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @param {{sharedTextInputProps: object, invalid?: boolean, invalidId?: string, warn?: boolean, warnId?: string, hasHelper?: boolean, helperId?: string}} config
|
|
22
|
-
* @returns {object}
|
|
23
|
-
*/
|
|
24
|
-
const textInputProps = ({
|
|
19
|
+
const getTextInputProps = ({
|
|
25
20
|
sharedTextInputProps,
|
|
26
21
|
invalid,
|
|
27
22
|
invalidId,
|
|
@@ -36,4 +31,4 @@ const textInputProps = ({
|
|
|
36
31
|
...(hasHelper ? helperProps(helperId) : {})
|
|
37
32
|
});
|
|
38
33
|
|
|
39
|
-
export {
|
|
34
|
+
export { getTextInputProps };
|
|
@@ -32,5 +32,5 @@ export interface HeaderPanelProps {
|
|
|
32
32
|
*/
|
|
33
33
|
onHeaderPanelFocus?: () => void;
|
|
34
34
|
}
|
|
35
|
-
declare const HeaderPanel: React.
|
|
35
|
+
declare const HeaderPanel: React.ForwardRefExoticComponent<HeaderPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
36
36
|
export default HeaderPanel;
|
package/es/index.d.ts
CHANGED
|
@@ -99,18 +99,18 @@ export * from './components/Toggletip';
|
|
|
99
99
|
export * from './components/TreeView';
|
|
100
100
|
export * from './components/UIShell';
|
|
101
101
|
export * from './components/UnorderedList';
|
|
102
|
-
export { FluidComboBox as unstable__FluidComboBox, FluidComboBoxSkeleton as unstable__FluidComboBoxSkeleton, } from './components/FluidComboBox';
|
|
103
|
-
export { FluidDatePicker as unstable__FluidDatePicker, FluidDatePickerSkeleton as unstable__FluidDatePickerSkeleton, } from './components/FluidDatePicker';
|
|
104
|
-
export { FluidDatePickerInput as unstable__FluidDatePickerInput } from './components/FluidDatePickerInput';
|
|
105
|
-
export { FluidDropdown as unstable__FluidDropdown, FluidDropdownSkeleton as unstable__FluidDropdownSkeleton, } from './components/FluidDropdown';
|
|
106
|
-
export { FluidMultiSelect as unstable__FluidMultiSelect, FluidMultiSelectSkeleton as unstable__FluidMultiSelectSkeleton, } from './components/FluidMultiSelect';
|
|
107
|
-
export { FluidSelect as unstable__FluidSelect, FluidSelectSkeleton as unstable__FluidSelectSkeleton, } from './components/FluidSelect';
|
|
108
|
-
export { FluidSearch as unstable__FluidSearch, FluidSearchSkeleton as unstable__FluidSearchSkeleton, } from './components/FluidSearch';
|
|
109
|
-
export { FluidTextArea as unstable__FluidTextArea, FluidTextAreaSkeleton as unstable__FluidTextAreaSkeleton, } from './components/FluidTextArea';
|
|
110
|
-
export { FluidTextInput as unstable__FluidTextInput, FluidTextInputSkeleton as unstable__FluidTextInputSkeleton, } from './components/FluidTextInput';
|
|
111
|
-
export { FluidNumberInput as unstable__FluidNumberInput, FluidNumberInputSkeleton as unstable__FluidNumberInputSkeleton, } from './components/FluidNumberInput';
|
|
112
|
-
export { FluidTimePicker as unstable__FluidTimePicker, FluidTimePickerSkeleton as unstable__FluidTimePickerSkeleton, } from './components/FluidTimePicker';
|
|
113
|
-
export { FluidTimePickerSelect as unstable__FluidTimePickerSelect } from './components/FluidTimePickerSelect';
|
|
102
|
+
export { FluidComboBox, FluidComboBoxSkeleton, FluidComboBox as unstable__FluidComboBox, FluidComboBoxSkeleton as unstable__FluidComboBoxSkeleton, } from './components/FluidComboBox';
|
|
103
|
+
export { FluidDatePicker, FluidDatePickerSkeleton, FluidDatePicker as unstable__FluidDatePicker, FluidDatePickerSkeleton as unstable__FluidDatePickerSkeleton, } from './components/FluidDatePicker';
|
|
104
|
+
export { FluidDatePickerInput, FluidDatePickerInput as unstable__FluidDatePickerInput, } from './components/FluidDatePickerInput';
|
|
105
|
+
export { FluidDropdown, FluidDropdownSkeleton, FluidDropdown as unstable__FluidDropdown, FluidDropdownSkeleton as unstable__FluidDropdownSkeleton, } from './components/FluidDropdown';
|
|
106
|
+
export { FluidMultiSelect, FluidMultiSelectSkeleton, FluidMultiSelect as unstable__FluidMultiSelect, FluidMultiSelectSkeleton as unstable__FluidMultiSelectSkeleton, } from './components/FluidMultiSelect';
|
|
107
|
+
export { FluidSelect, FluidSelectSkeleton, FluidSelect as unstable__FluidSelect, FluidSelectSkeleton as unstable__FluidSelectSkeleton, } from './components/FluidSelect';
|
|
108
|
+
export { FluidSearch, FluidSearchSkeleton, FluidSearch as unstable__FluidSearch, FluidSearchSkeleton as unstable__FluidSearchSkeleton, } from './components/FluidSearch';
|
|
109
|
+
export { FluidTextArea, FluidTextAreaSkeleton, FluidTextArea as unstable__FluidTextArea, FluidTextAreaSkeleton as unstable__FluidTextAreaSkeleton, } from './components/FluidTextArea';
|
|
110
|
+
export { FluidTextInput, FluidTextInputSkeleton, FluidTextInput as unstable__FluidTextInput, FluidTextInputSkeleton as unstable__FluidTextInputSkeleton, } from './components/FluidTextInput';
|
|
111
|
+
export { FluidNumberInput, FluidNumberInputSkeleton, FluidNumberInput as unstable__FluidNumberInput, FluidNumberInputSkeleton as unstable__FluidNumberInputSkeleton, } from './components/FluidNumberInput';
|
|
112
|
+
export { FluidTimePicker, FluidTimePickerSkeleton, FluidTimePicker as unstable__FluidTimePicker, FluidTimePickerSkeleton as unstable__FluidTimePickerSkeleton, } from './components/FluidTimePicker';
|
|
113
|
+
export { FluidTimePickerSelect, FluidTimePickerSelect as unstable__FluidTimePickerSelect, } from './components/FluidTimePickerSelect';
|
|
114
114
|
export * from './components/Heading';
|
|
115
115
|
export * from './components/IconButton';
|
|
116
116
|
export * from './components/Layer';
|
|
@@ -127,7 +127,6 @@ export { AILabel as unstable__Slug, AILabelContent as unstable__SlugContent, AIL
|
|
|
127
127
|
export { ChatButton as unstable__ChatButton, ChatButtonSkeleton as unstable__ChatButtonSkeleton, } from './components/ChatButton';
|
|
128
128
|
export { AISkeletonText, AISkeletonIcon, AISkeletonPlaceholder, } from './components/AISkeleton';
|
|
129
129
|
export { AISkeletonText as unstable__AiSkeletonText, AISkeletonIcon as unstable__AiSkeletonIcon, AISkeletonPlaceholder as unstable__AiSkeletonPlaceholder, } from './components/AISkeleton';
|
|
130
|
-
export * from './components/Stack';
|
|
131
130
|
export * from './components/Tooltip';
|
|
132
131
|
export { Text as unstable_Text, TextDirection as unstable_TextDirection, } from './components/Text';
|
|
133
132
|
export * from './components/Tooltip/DefinitionTooltip';
|
package/es/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
/**
|
|
2
3
|
* Copyright IBM Corp. 2016, 2023
|
|
3
4
|
*
|
|
@@ -129,7 +130,8 @@ export { default as SelectItemGroup } from './components/SelectItemGroup/SelectI
|
|
|
129
130
|
export { default as SkeletonIcon } from './components/SkeletonIcon/SkeletonIcon.js';
|
|
130
131
|
export { default as SkeletonPlaceholder } from './components/SkeletonPlaceholder/SkeletonPlaceholder.js';
|
|
131
132
|
export { default as SkeletonText } from './components/SkeletonText/SkeletonText.js';
|
|
132
|
-
export {
|
|
133
|
+
export { Slider } from './components/Slider/Slider.js';
|
|
134
|
+
export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
|
|
133
135
|
export { HStack } from './components/Stack/HStack.js';
|
|
134
136
|
export { Stack } from './components/Stack/Stack.js';
|
|
135
137
|
export { VStack } from './components/Stack/VStack.js';
|
|
@@ -189,29 +191,29 @@ export { default as SideNavMenu } from './components/UIShell/SideNavMenu.js';
|
|
|
189
191
|
export { default as SideNavMenuItem } from './components/UIShell/SideNavMenuItem.js';
|
|
190
192
|
export { default as SideNavSwitcher } from './components/UIShell/SideNavSwitcher.js';
|
|
191
193
|
export { default as UnorderedList } from './components/UnorderedList/UnorderedList.js';
|
|
192
|
-
export { default as unstable__FluidComboBox } from './components/FluidComboBox/FluidComboBox.js';
|
|
193
|
-
export { default as unstable__FluidComboBoxSkeleton } from './components/FluidComboBox/FluidComboBox.Skeleton.js';
|
|
194
|
-
export { default as unstable__FluidDatePicker } from './components/FluidDatePicker/FluidDatePicker.js';
|
|
195
|
-
export { default as unstable__FluidDatePickerSkeleton } from './components/FluidDatePicker/FluidDatePicker.Skeleton.js';
|
|
196
|
-
export { default as unstable__FluidDatePickerInput } from './components/FluidDatePickerInput/FluidDatePickerInput.js';
|
|
197
|
-
export { default as unstable__FluidDropdown } from './components/FluidDropdown/FluidDropdown.js';
|
|
198
|
-
export { default as unstable__FluidDropdownSkeleton } from './components/FluidDropdown/FluidDropdown.Skeleton.js';
|
|
199
|
-
export { default as unstable__FluidMultiSelect } from './components/FluidMultiSelect/FluidMultiSelect.js';
|
|
200
|
-
export { default as unstable__FluidMultiSelectSkeleton } from './components/FluidMultiSelect/FluidMultiSelect.Skeleton.js';
|
|
201
|
-
export { default as unstable__FluidSelect } from './components/FluidSelect/FluidSelect.js';
|
|
202
|
-
export { default as unstable__FluidSelectSkeleton } from './components/FluidSelect/FluidSelect.Skeleton.js';
|
|
203
|
-
export { default as unstable__FluidSearch } from './components/FluidSearch/FluidSearch.js';
|
|
204
|
-
export { default as unstable__FluidSearchSkeleton } from './components/FluidSearch/FluidSearch.Skeleton.js';
|
|
205
|
-
export { default as unstable__FluidTextArea } from './components/FluidTextArea/FluidTextArea.js';
|
|
206
|
-
export { default as unstable__FluidTextAreaSkeleton } from './components/FluidTextArea/FluidTextArea.Skeleton.js';
|
|
207
|
-
export { default as unstable__FluidTextInput } from './components/FluidTextInput/FluidTextInput.js';
|
|
194
|
+
export { default as FluidComboBox, default as unstable__FluidComboBox } from './components/FluidComboBox/FluidComboBox.js';
|
|
195
|
+
export { default as FluidComboBoxSkeleton, default as unstable__FluidComboBoxSkeleton } from './components/FluidComboBox/FluidComboBox.Skeleton.js';
|
|
196
|
+
export { default as FluidDatePicker, default as unstable__FluidDatePicker } from './components/FluidDatePicker/FluidDatePicker.js';
|
|
197
|
+
export { default as FluidDatePickerSkeleton, default as unstable__FluidDatePickerSkeleton } from './components/FluidDatePicker/FluidDatePicker.Skeleton.js';
|
|
198
|
+
export { default as FluidDatePickerInput, default as unstable__FluidDatePickerInput } from './components/FluidDatePickerInput/FluidDatePickerInput.js';
|
|
199
|
+
export { default as FluidDropdown, default as unstable__FluidDropdown } from './components/FluidDropdown/FluidDropdown.js';
|
|
200
|
+
export { default as FluidDropdownSkeleton, default as unstable__FluidDropdownSkeleton } from './components/FluidDropdown/FluidDropdown.Skeleton.js';
|
|
201
|
+
export { default as FluidMultiSelect, default as unstable__FluidMultiSelect } from './components/FluidMultiSelect/FluidMultiSelect.js';
|
|
202
|
+
export { default as FluidMultiSelectSkeleton, default as unstable__FluidMultiSelectSkeleton } from './components/FluidMultiSelect/FluidMultiSelect.Skeleton.js';
|
|
203
|
+
export { default as FluidSelect, default as unstable__FluidSelect } from './components/FluidSelect/FluidSelect.js';
|
|
204
|
+
export { default as FluidSelectSkeleton, default as unstable__FluidSelectSkeleton } from './components/FluidSelect/FluidSelect.Skeleton.js';
|
|
205
|
+
export { default as FluidSearch, default as unstable__FluidSearch } from './components/FluidSearch/FluidSearch.js';
|
|
206
|
+
export { default as FluidSearchSkeleton, default as unstable__FluidSearchSkeleton } from './components/FluidSearch/FluidSearch.Skeleton.js';
|
|
207
|
+
export { default as FluidTextArea, default as unstable__FluidTextArea } from './components/FluidTextArea/FluidTextArea.js';
|
|
208
|
+
export { default as FluidTextAreaSkeleton, default as unstable__FluidTextAreaSkeleton } from './components/FluidTextArea/FluidTextArea.Skeleton.js';
|
|
209
|
+
export { default as FluidTextInput, default as unstable__FluidTextInput } from './components/FluidTextInput/FluidTextInput.js';
|
|
208
210
|
import './components/FluidTextInput/FluidPasswordInput.js';
|
|
209
|
-
export { default as unstable__FluidTextInputSkeleton } from './components/FluidTextInput/FluidTextInput.Skeleton.js';
|
|
210
|
-
export { default as unstable__FluidNumberInput } from './components/FluidNumberInput/FluidNumberInput.js';
|
|
211
|
-
export { default as unstable__FluidNumberInputSkeleton } from './components/FluidNumberInput/FluidNumberInput.Skeleton.js';
|
|
212
|
-
export { default as unstable__FluidTimePicker } from './components/FluidTimePicker/FluidTimePicker.js';
|
|
213
|
-
export { default as unstable__FluidTimePickerSkeleton } from './components/FluidTimePicker/FluidTimePicker.Skeleton.js';
|
|
214
|
-
export { default as unstable__FluidTimePickerSelect } from './components/FluidTimePickerSelect/FluidTimePickerSelect.js';
|
|
211
|
+
export { default as FluidTextInputSkeleton, default as unstable__FluidTextInputSkeleton } from './components/FluidTextInput/FluidTextInput.Skeleton.js';
|
|
212
|
+
export { default as FluidNumberInput, default as unstable__FluidNumberInput } from './components/FluidNumberInput/FluidNumberInput.js';
|
|
213
|
+
export { default as FluidNumberInputSkeleton, default as unstable__FluidNumberInputSkeleton } from './components/FluidNumberInput/FluidNumberInput.Skeleton.js';
|
|
214
|
+
export { default as FluidTimePicker, default as unstable__FluidTimePicker } from './components/FluidTimePicker/FluidTimePicker.js';
|
|
215
|
+
export { default as FluidTimePickerSkeleton, default as unstable__FluidTimePickerSkeleton } from './components/FluidTimePicker/FluidTimePicker.Skeleton.js';
|
|
216
|
+
export { default as FluidTimePickerSelect, default as unstable__FluidTimePickerSelect } from './components/FluidTimePickerSelect/FluidTimePickerSelect.js';
|
|
215
217
|
export { Heading, Section } from './components/Heading/index.js';
|
|
216
218
|
export { IconButton, IconButtonKinds } from './components/IconButton/index.js';
|
|
217
219
|
export { Layer, useLayer } from './components/Layer/index.js';
|
|
@@ -239,6 +241,5 @@ export { default as unstable_PageSelector } from './components/Pagination/experi
|
|
|
239
241
|
export { default as unstable_Pagination } from './components/Pagination/experimental/Pagination.js';
|
|
240
242
|
export { default as ContainedListItem } from './components/ContainedList/ContainedListItem/ContainedListItem.js';
|
|
241
243
|
export { default as ContainedList } from './components/ContainedList/ContainedList.js';
|
|
242
|
-
export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
|
|
243
244
|
export { Text as unstable_Text } from './components/Text/Text.js';
|
|
244
245
|
export { TextDirection as unstable_TextDirection } from './components/Text/TextDirection.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
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
|
+
export declare const defaultItemToString: <ItemType>(item: ItemType | null) => string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
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
|
+
const defaultItemToString = item => {
|
|
9
|
+
if (typeof item === 'string') return item;
|
|
10
|
+
if (typeof item === 'number') return `${item}`;
|
|
11
|
+
if (item && typeof item === 'object' && 'label' in item && typeof item.label === 'string') {
|
|
12
|
+
return item.label;
|
|
13
|
+
}
|
|
14
|
+
return '';
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { defaultItemToString };
|
package/es/internal/index.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
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
|
+
import type { Requireable, Validator } from 'prop-types';
|
|
8
|
+
export declare const deprecateValuesWithin: <T>(propType: Requireable<T>, allowedValues?: readonly unknown[], propMappingFunction?: (deprecatedValue: T) => T) => Validator<T> | Requireable<T>;
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
import { warning } from '../internal/warning.js';
|
|
9
9
|
|
|
10
10
|
const didWarnAboutDeprecation = {};
|
|
11
|
-
|
|
12
|
-
return
|
|
13
|
-
if (props[propName] === undefined) {
|
|
14
|
-
return;
|
|
11
|
+
const deprecateValuesWithin = (propType, allowedValues, propMappingFunction) => {
|
|
12
|
+
return (props, propName, componentName, ...rest) => {
|
|
13
|
+
if (typeof props[propName] === 'undefined') {
|
|
14
|
+
return null;
|
|
15
15
|
}
|
|
16
16
|
if (!didWarnAboutDeprecation[componentName] || !didWarnAboutDeprecation[componentName][propName]) {
|
|
17
17
|
didWarnAboutDeprecation[componentName] = {
|
|
@@ -27,6 +27,6 @@ function deprecateValuesWithin(propType, allowedValues, propMappingFunction) {
|
|
|
27
27
|
}
|
|
28
28
|
return propType(props, propName, componentName, ...rest);
|
|
29
29
|
};
|
|
30
|
-
}
|
|
30
|
+
};
|
|
31
31
|
|
|
32
|
-
export { deprecateValuesWithin
|
|
32
|
+
export { deprecateValuesWithin };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
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
|
+
import type { Validator } from 'prop-types';
|
|
7
8
|
/**
|
|
8
|
-
* @param
|
|
9
|
-
*
|
|
10
|
-
* @param
|
|
11
|
-
* @returns
|
|
12
|
-
*
|
|
9
|
+
* @param name The name of the prop that must exist to validate the current
|
|
10
|
+
* prop.
|
|
11
|
+
* @param propType The original prop type checker.
|
|
12
|
+
* @returns The new prop type checker for the current prop that becomes required
|
|
13
|
+
* if the prop corresponding to the provided prop name exists.
|
|
13
14
|
*/
|
|
14
|
-
export
|
|
15
|
+
export declare const requiredIfGivenPropIsTruthy: <T>(name: string, propType: Validator<T>) => Validator<T>;
|
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @param
|
|
10
|
-
*
|
|
11
|
-
* @param
|
|
12
|
-
* @returns
|
|
13
|
-
*
|
|
9
|
+
* @param name The name of the prop that must exist to validate the current
|
|
10
|
+
* prop.
|
|
11
|
+
* @param propType The original prop type checker.
|
|
12
|
+
* @returns The new prop type checker for the current prop that becomes required
|
|
13
|
+
* if the prop corresponding to the provided prop name exists.
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
return
|
|
17
|
-
if (process.env.NODE_ENV !== 'production' && props[name]
|
|
15
|
+
const requiredIfGivenPropIsTruthy = (name, propType) => {
|
|
16
|
+
return (props, propName, componentName, ...rest) => {
|
|
17
|
+
if (process.env.NODE_ENV !== 'production' && props[name] === true && props[propName] === null) {
|
|
18
18
|
return new Error(`You must provide a value for \`${propName}\` in \`${componentName}\` if \`${name}\` exists.`);
|
|
19
19
|
}
|
|
20
20
|
return propType(props, propName, componentName, ...rest);
|
|
21
21
|
};
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
|
|
24
|
-
export { requiredIfGivenPropIsTruthy
|
|
24
|
+
export { requiredIfGivenPropIsTruthy };
|
|
@@ -111,7 +111,7 @@ declare namespace CodeSnippet {
|
|
|
111
111
|
/**
|
|
112
112
|
* Specify how the trigger should align with the tooltip
|
|
113
113
|
*/
|
|
114
|
-
align:
|
|
114
|
+
align: PropTypes.Requireable<string> | PropTypes.Validator<string>;
|
|
115
115
|
/**
|
|
116
116
|
* Specify a label to be read by screen readers on the containing textbox
|
|
117
117
|
* node
|
|
@@ -238,7 +238,7 @@ CodeSnippet.propTypes = {
|
|
|
238
238
|
/**
|
|
239
239
|
* Specify how the trigger should align with the tooltip
|
|
240
240
|
*/
|
|
241
|
-
align: deprecateValuesWithin.
|
|
241
|
+
align: deprecateValuesWithin.deprecateValuesWithin(PropTypes.oneOf(['top', 'top-left',
|
|
242
242
|
// deprecated use top-start instead
|
|
243
243
|
'top-right',
|
|
244
244
|
// deprecated use top-end instead
|
|
@@ -31,6 +31,7 @@ var FormContext = require('../FluidForm/FormContext.js');
|
|
|
31
31
|
var react = require('@floating-ui/react');
|
|
32
32
|
var index = require('../FeatureFlags/index.js');
|
|
33
33
|
var index$1 = require('../AILabel/index.js');
|
|
34
|
+
var defaultItemToString = require('../../internal/defaultItemToString.js');
|
|
34
35
|
var utils = require('../../internal/utils.js');
|
|
35
36
|
var ListBoxPropTypes = require('../ListBox/ListBoxPropTypes.js');
|
|
36
37
|
var Text = require('../Text/Text.js');
|
|
@@ -47,18 +48,6 @@ const {
|
|
|
47
48
|
ItemClick,
|
|
48
49
|
FunctionSelectItem
|
|
49
50
|
} = Downshift.useCombobox.stateChangeTypes;
|
|
50
|
-
const defaultItemToString = item => {
|
|
51
|
-
if (typeof item === 'string') {
|
|
52
|
-
return item;
|
|
53
|
-
}
|
|
54
|
-
if (typeof item === 'number') {
|
|
55
|
-
return `${item}`;
|
|
56
|
-
}
|
|
57
|
-
if (item !== null && typeof item === 'object' && 'label' in item && typeof item['label'] === 'string') {
|
|
58
|
-
return item['label'];
|
|
59
|
-
}
|
|
60
|
-
return '';
|
|
61
|
-
};
|
|
62
51
|
const defaultShouldFilterItem = () => true;
|
|
63
52
|
const autocompleteCustomFilter = ({
|
|
64
53
|
item,
|
|
@@ -94,7 +83,7 @@ const getInputValue = ({
|
|
|
94
83
|
};
|
|
95
84
|
const findHighlightedIndex = ({
|
|
96
85
|
items,
|
|
97
|
-
itemToString = defaultItemToString
|
|
86
|
+
itemToString = defaultItemToString.defaultItemToString
|
|
98
87
|
}, inputValue) => {
|
|
99
88
|
if (!inputValue) {
|
|
100
89
|
return -1;
|
|
@@ -137,7 +126,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
137
126
|
invalidText,
|
|
138
127
|
items,
|
|
139
128
|
itemToElement = null,
|
|
140
|
-
itemToString = defaultItemToString,
|
|
129
|
+
itemToString = defaultItemToString.defaultItemToString,
|
|
141
130
|
light,
|
|
142
131
|
onChange,
|
|
143
132
|
onInputChange,
|
|
@@ -192,7 +192,7 @@ ComboButton.propTypes = {
|
|
|
192
192
|
/**
|
|
193
193
|
* Specify how the trigger tooltip should be aligned.
|
|
194
194
|
*/
|
|
195
|
-
tooltipAlignment: deprecateValuesWithin.
|
|
195
|
+
tooltipAlignment: deprecateValuesWithin.deprecateValuesWithin(PropTypes.oneOf(['top', 'top-left',
|
|
196
196
|
// deprecated use top-start instead
|
|
197
197
|
'top-right',
|
|
198
198
|
// deprecated use top-end instead
|
|
@@ -79,7 +79,7 @@ ModalBody.propTypes = {
|
|
|
79
79
|
/**
|
|
80
80
|
* Required props for the accessibility label of the header
|
|
81
81
|
*/
|
|
82
|
-
['aria-label']: requiredIfGivenPropIsTruthy.
|
|
82
|
+
['aria-label']: requiredIfGivenPropIsTruthy.requiredIfGivenPropIsTruthy('hasScrollingContent', PropTypes.string),
|
|
83
83
|
/**
|
|
84
84
|
* Specify the content to be placed in the ModalBody
|
|
85
85
|
*/
|
|
@@ -50,7 +50,7 @@ declare namespace Copy {
|
|
|
50
50
|
/**
|
|
51
51
|
* Specify how the trigger should align with the tooltip
|
|
52
52
|
*/
|
|
53
|
-
align:
|
|
53
|
+
align: PropTypes.Requireable<string> | PropTypes.Validator<string>;
|
|
54
54
|
/**
|
|
55
55
|
* **Experimental**: Will attempt to automatically align the tooltip. Requires
|
|
56
56
|
* React v17+
|
|
@@ -72,7 +72,7 @@ Copy.propTypes = {
|
|
|
72
72
|
/**
|
|
73
73
|
* Specify how the trigger should align with the tooltip
|
|
74
74
|
*/
|
|
75
|
-
align: deprecateValuesWithin.
|
|
75
|
+
align: deprecateValuesWithin.deprecateValuesWithin(PropTypes.oneOf(['top', 'top-left',
|
|
76
76
|
// deprecated use top-start instead
|
|
77
77
|
'top-right',
|
|
78
78
|
// deprecated use top-end instead
|
|
@@ -51,7 +51,7 @@ declare namespace CopyButton {
|
|
|
51
51
|
/**
|
|
52
52
|
* Specify how the trigger should align with the tooltip
|
|
53
53
|
*/
|
|
54
|
-
align:
|
|
54
|
+
align: PropTypes.Requireable<string> | PropTypes.Validator<string>;
|
|
55
55
|
/**
|
|
56
56
|
* **Experimental**: Will attempt to automatically align the tooltip. Requires
|
|
57
57
|
* React v17+
|
|
@@ -53,7 +53,7 @@ CopyButton.propTypes = {
|
|
|
53
53
|
/**
|
|
54
54
|
* Specify how the trigger should align with the tooltip
|
|
55
55
|
*/
|
|
56
|
-
align: deprecateValuesWithin.
|
|
56
|
+
align: deprecateValuesWithin.deprecateValuesWithin(PropTypes.oneOf(['top', 'top-left',
|
|
57
57
|
// deprecated use top-start instead
|
|
58
58
|
'top-right',
|
|
59
59
|
// deprecated use top-end instead
|