@carbon/react 1.90.0-rc.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 +923 -964
- package/es/components/AILabel/index.js +8 -6
- package/es/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/es/components/Button/Button.js +3 -0
- package/es/components/ChatButton/ChatButton.js +1 -0
- package/es/components/CheckboxGroup/CheckboxGroup.js +21 -2
- package/es/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/es/components/CodeSnippet/CodeSnippet.js +1 -1
- package/es/components/ComboBox/ComboBox.js +18 -13
- package/es/components/ComboButton/index.js +2 -1
- package/es/components/ComposedModal/ComposedModal.js +5 -2
- 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 +119 -178
- package/es/components/DataTable/Table.d.ts +2 -2
- package/es/components/DataTable/Table.js +4 -4
- package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableExpandHeader.js +6 -2
- package/es/components/DataTable/TableExpandRow.js +1 -0
- package/es/components/DataTable/TableHeader.js +2 -0
- package/es/components/DataTable/TableRow.js +5 -0
- package/es/components/DataTable/TableSlugRow.js +1 -0
- package/es/components/DataTable/TableToolbarMenu.js +3 -0
- package/es/components/DataTable/state/sorting.d.ts +3 -1
- package/es/components/DataTable/state/sorting.js +2 -0
- package/es/components/DataTable/tools/sorting.js +1 -0
- package/es/components/DatePicker/DatePicker.d.ts +0 -12
- package/es/components/DatePicker/DatePicker.js +17 -6
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +19 -2
- package/es/components/DatePicker/plugins/rangePlugin.js +18 -14
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/Dialog/Dialog.js +10 -2
- package/es/components/Dropdown/Dropdown.js +17 -16
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/es/components/FeatureFlags/index.js +1 -0
- package/es/components/FileUploader/FileUploader.js +9 -2
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +3 -0
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/es/components/FluidSearch/FluidSearch.js +3 -2
- package/es/components/FluidSelect/FluidSelect.js +3 -2
- package/es/components/FluidTextInput/FluidTextInput.js +3 -2
- package/es/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/es/components/Grid/CSSGrid.js +5 -0
- package/es/components/Grid/Column.js +3 -0
- package/es/components/Grid/ColumnHang.js +1 -0
- package/es/components/Grid/FlexGrid.js +1 -0
- package/es/components/Grid/Row.js +1 -0
- package/es/components/Heading/index.js +3 -1
- package/es/components/IconButton/index.js +5 -3
- package/es/components/IconIndicator/index.js +4 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/es/components/Layout/index.js +6 -4
- package/es/components/LayoutDirection/LayoutDirection.js +2 -0
- package/es/components/Link/Link.js +3 -0
- package/es/components/ListBox/ListBoxMenuItem.js +4 -1
- package/es/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/es/components/Menu/Menu.js +6 -9
- package/es/components/Menu/MenuContext.js +1 -0
- package/es/components/Menu/MenuItem.d.ts +1 -1
- package/es/components/Menu/MenuItem.js +10 -18
- package/es/components/MenuButton/index.js +7 -2
- package/es/components/Modal/Modal.js +4 -1
- package/es/components/ModalWrapper/ModalWrapper.js +2 -0
- package/es/components/MultiSelect/FilterableMultiSelect.js +25 -6
- package/es/components/MultiSelect/MultiSelect.js +22 -17
- package/es/components/Notification/Notification.d.ts +6 -6
- package/es/components/Notification/Notification.js +7 -7
- package/es/components/NumberInput/NumberInput.js +7 -1
- package/es/components/OverflowMenu/OverflowMenu.js +3 -1
- package/es/components/OverflowMenu/next/index.js +4 -3
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/es/components/PageHeader/PageHeader.d.ts +3 -3
- package/es/components/PageHeader/PageHeader.js +22 -8
- package/es/components/Pagination/Pagination.js +6 -2
- package/es/components/PaginationNav/PaginationNav.js +2 -5
- package/es/components/Popover/index.js +15 -5
- package/es/components/ProgressBar/ProgressBar.js +4 -2
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Search/Search.d.ts +4 -2
- package/es/components/Search/Search.js +7 -6
- package/es/components/Select/Select.js +2 -3
- package/es/components/ShapeIndicator/index.js +4 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/es/components/SkeletonText/SkeletonText.js +0 -2
- package/es/components/Slider/Slider.d.ts +144 -188
- package/es/components/Slider/Slider.js +798 -726
- package/es/components/Slider/index.d.ts +2 -2
- package/es/components/Stack/HStack.js +1 -0
- package/es/components/Stack/Stack.js +6 -9
- package/es/components/Stack/VStack.js +1 -0
- package/es/components/StructuredList/StructuredList.js +3 -0
- package/es/components/Switch/Switch.js +1 -1
- package/es/components/Tabs/Tabs.d.ts +4 -0
- package/es/components/Tabs/Tabs.js +28 -17
- package/es/components/Tag/DismissibleTag.js +2 -0
- package/es/components/Tag/OperationalTag.js +2 -0
- package/es/components/Tag/SelectableTag.js +2 -0
- package/es/components/Tag/Tag.js +4 -0
- package/es/components/Tag/isEllipsisActive.js +1 -0
- package/es/components/Text/Text.js +1 -0
- package/es/components/TextArea/TextArea.js +13 -6
- package/es/components/TextInput/ControlledPasswordInput.js +4 -6
- package/es/components/TextInput/PasswordInput.js +9 -4
- package/es/components/TextInput/TextInput.js +6 -4
- package/es/components/TextInput/util.d.ts +17 -5
- package/es/components/TextInput/util.js +2 -7
- package/es/components/Theme/index.js +8 -3
- package/es/components/Tile/Tile.js +14 -17
- package/es/components/TimePicker/TimePicker.js +1 -0
- package/es/components/Toggle/Toggle.js +1 -1
- package/es/components/Toggletip/index.js +4 -0
- package/es/components/Tooltip/DefinitionTooltip.js +1 -0
- package/es/components/Tooltip/Tooltip.js +30 -23
- package/es/components/TreeView/TreeNode.js +13 -5
- package/es/components/TreeView/TreeView.js +7 -0
- package/es/components/UIShell/HeaderContainer.js +3 -1
- package/es/components/UIShell/HeaderGlobalAction.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +3 -3
- package/es/components/UIShell/HeaderPanel.d.ts +1 -1
- package/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/components/UIShell/Link.js +2 -0
- package/es/components/UIShell/SideNavItems.js +1 -0
- package/es/components/UIShell/SideNavMenu.js +2 -2
- package/es/components/UIShell/SideNavMenuItem.js +1 -1
- package/es/components/UIShell/SideNavSwitcher.js +1 -1
- package/es/components/UIShell/Switcher.js +2 -1
- package/es/components/UIShell/SwitcherItem.js +4 -2
- package/es/index.d.ts +12 -13
- package/es/index.js +25 -24
- package/es/internal/FloatingMenu.js +7 -1
- package/es/internal/Selection.js +12 -3
- 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/internal/useMergedRefs.js +1 -0
- package/es/internal/useNoInteractiveChildren.js +4 -0
- package/es/internal/useOutsideClick.js +1 -0
- package/es/internal/useOverflowItems.js +6 -0
- package/es/internal/useResizeObserver.js +4 -0
- package/es/internal/useSavedCallback.js +1 -0
- package/es/internal/warning.js +1 -0
- package/es/prop-types/deprecateValuesWithin.d.ts +8 -1
- package/es/prop-types/deprecateValuesWithin.js +6 -6
- package/es/prop-types/isRequiredOneOf.js +4 -1
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +8 -7
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +10 -10
- package/es/tools/events.js +3 -1
- package/es/tools/wrapComponent.js +1 -0
- package/lib/components/AILabel/index.js +8 -6
- package/lib/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/lib/components/Button/Button.js +3 -0
- package/lib/components/ChatButton/ChatButton.js +1 -0
- package/lib/components/CheckboxGroup/CheckboxGroup.js +20 -1
- package/lib/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/lib/components/CodeSnippet/CodeSnippet.js +1 -1
- package/lib/components/ComboBox/ComboBox.js +20 -15
- package/lib/components/ComboButton/index.js +2 -1
- package/lib/components/ComposedModal/ComposedModal.js +5 -2
- 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 +119 -178
- package/lib/components/DataTable/Table.d.ts +2 -2
- package/lib/components/DataTable/Table.js +4 -4
- package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableExpandHeader.js +6 -2
- package/lib/components/DataTable/TableExpandRow.js +1 -0
- package/lib/components/DataTable/TableHeader.js +2 -0
- package/lib/components/DataTable/TableRow.js +5 -0
- package/lib/components/DataTable/TableSlugRow.js +1 -0
- package/lib/components/DataTable/TableToolbarMenu.js +3 -0
- package/lib/components/DataTable/state/sorting.d.ts +3 -1
- package/lib/components/DataTable/state/sorting.js +2 -0
- package/lib/components/DataTable/tools/sorting.js +1 -0
- package/lib/components/DatePicker/DatePicker.d.ts +0 -12
- package/lib/components/DatePicker/DatePicker.js +16 -5
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +19 -2
- package/lib/components/DatePicker/plugins/rangePlugin.js +18 -16
- package/lib/components/DatePickerInput/DatePickerInput.js +6 -0
- package/lib/components/Dialog/Dialog.js +10 -2
- package/lib/components/Dropdown/Dropdown.js +19 -18
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/lib/components/FeatureFlags/index.js +1 -0
- package/lib/components/FileUploader/FileUploader.js +9 -2
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +3 -0
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/lib/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/lib/components/FluidSearch/FluidSearch.js +3 -2
- package/lib/components/FluidSelect/FluidSelect.js +3 -2
- package/lib/components/FluidTextInput/FluidTextInput.js +3 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/lib/components/Grid/CSSGrid.js +5 -0
- package/lib/components/Grid/Column.js +3 -0
- package/lib/components/Grid/ColumnHang.js +1 -0
- package/lib/components/Grid/FlexGrid.js +1 -0
- package/lib/components/Grid/Row.js +1 -0
- package/lib/components/Heading/index.js +3 -1
- package/lib/components/IconButton/index.js +5 -3
- package/lib/components/IconIndicator/index.js +4 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/lib/components/Layout/index.js +6 -4
- package/lib/components/LayoutDirection/LayoutDirection.js +2 -0
- package/lib/components/Link/Link.js +3 -0
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -1
- package/lib/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/lib/components/Menu/Menu.js +6 -9
- package/lib/components/Menu/MenuContext.js +1 -0
- package/lib/components/Menu/MenuItem.d.ts +1 -1
- package/lib/components/Menu/MenuItem.js +11 -19
- package/lib/components/MenuButton/index.js +7 -2
- package/lib/components/Modal/Modal.js +4 -1
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.js +32 -13
- package/lib/components/MultiSelect/MultiSelect.js +23 -18
- package/lib/components/Notification/Notification.d.ts +6 -6
- package/lib/components/Notification/Notification.js +7 -7
- package/lib/components/NumberInput/NumberInput.js +7 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +3 -1
- package/lib/components/OverflowMenu/next/index.js +4 -3
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/lib/components/PageHeader/PageHeader.d.ts +3 -3
- package/lib/components/PageHeader/PageHeader.js +22 -8
- package/lib/components/Pagination/Pagination.js +6 -2
- package/lib/components/PaginationNav/PaginationNav.js +2 -5
- package/lib/components/Popover/index.js +15 -5
- package/lib/components/ProgressBar/ProgressBar.js +4 -2
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Search/Search.d.ts +4 -2
- package/lib/components/Search/Search.js +7 -6
- package/lib/components/Select/Select.js +2 -3
- package/lib/components/ShapeIndicator/index.js +4 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/lib/components/SkeletonText/SkeletonText.js +0 -2
- package/lib/components/Slider/Slider.d.ts +144 -188
- package/lib/components/Slider/Slider.js +795 -725
- package/lib/components/Slider/index.d.ts +2 -2
- package/lib/components/Stack/HStack.js +1 -0
- package/lib/components/Stack/Stack.js +6 -9
- package/lib/components/Stack/VStack.js +1 -0
- package/lib/components/StructuredList/StructuredList.js +3 -0
- package/lib/components/Switch/Switch.js +1 -1
- package/lib/components/Tabs/Tabs.d.ts +4 -0
- package/lib/components/Tabs/Tabs.js +28 -17
- package/lib/components/Tag/DismissibleTag.js +2 -0
- package/lib/components/Tag/OperationalTag.js +2 -0
- package/lib/components/Tag/SelectableTag.js +2 -0
- package/lib/components/Tag/Tag.js +4 -0
- package/lib/components/Tag/isEllipsisActive.js +1 -0
- package/lib/components/Text/Text.js +1 -0
- package/lib/components/TextArea/TextArea.js +13 -6
- package/lib/components/TextInput/ControlledPasswordInput.js +3 -5
- package/lib/components/TextInput/PasswordInput.js +8 -3
- package/lib/components/TextInput/TextInput.js +5 -3
- package/lib/components/TextInput/util.d.ts +17 -5
- package/lib/components/TextInput/util.js +2 -7
- package/lib/components/Theme/index.js +8 -3
- package/lib/components/Tile/Tile.js +14 -17
- package/lib/components/TimePicker/TimePicker.js +1 -0
- package/lib/components/Toggle/Toggle.js +1 -1
- package/lib/components/Toggletip/index.js +4 -0
- package/lib/components/Tooltip/DefinitionTooltip.js +1 -0
- package/lib/components/Tooltip/Tooltip.js +30 -23
- package/lib/components/TreeView/TreeNode.js +13 -5
- package/lib/components/TreeView/TreeView.js +7 -0
- package/lib/components/UIShell/HeaderContainer.js +3 -1
- package/lib/components/UIShell/HeaderGlobalAction.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +3 -3
- package/lib/components/UIShell/HeaderPanel.d.ts +1 -1
- package/lib/components/UIShell/HeaderPanel.js +2 -2
- package/lib/components/UIShell/Link.js +2 -0
- package/lib/components/UIShell/SideNavItems.js +1 -0
- package/lib/components/UIShell/SideNavMenu.js +2 -2
- package/lib/components/UIShell/SideNavMenuItem.js +1 -1
- package/lib/components/UIShell/SideNavSwitcher.js +1 -1
- package/lib/components/UIShell/Switcher.js +2 -1
- package/lib/components/UIShell/SwitcherItem.js +4 -2
- package/lib/index.d.ts +12 -13
- package/lib/index.js +51 -28
- package/lib/internal/FloatingMenu.js +7 -1
- package/lib/internal/Selection.js +12 -3
- 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/internal/useMergedRefs.js +1 -0
- package/lib/internal/useNoInteractiveChildren.js +4 -0
- package/lib/internal/useOutsideClick.js +1 -0
- package/lib/internal/useOverflowItems.js +6 -0
- package/lib/internal/useResizeObserver.js +4 -0
- package/lib/internal/useSavedCallback.js +1 -0
- package/lib/internal/warning.js +1 -0
- package/lib/prop-types/deprecateValuesWithin.d.ts +8 -1
- package/lib/prop-types/deprecateValuesWithin.js +6 -8
- package/lib/prop-types/isRequiredOneOf.js +4 -1
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +8 -7
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +10 -12
- package/lib/tools/events.js +3 -1
- package/lib/tools/wrapComponent.js +1 -0
- package/package.json +10 -9
- 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 };
|
|
@@ -11,6 +11,7 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
11
11
|
var React = require('react');
|
|
12
12
|
var Stack = require('./Stack.js');
|
|
13
13
|
|
|
14
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
14
15
|
const HStack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
15
16
|
return /*#__PURE__*/React.createElement(Stack.Stack, _rollupPluginBabelHelpers.extends({}, props, {
|
|
16
17
|
ref: ref,
|
|
@@ -37,6 +37,7 @@ const SPACING_STEPS = Array.from({
|
|
|
37
37
|
* - https://paste.twilio.design/layout/stack/
|
|
38
38
|
* - https://github.com/Workday/canvas-kit/blob/f2f599654876700f483a1d8c5de82a41315c76f1/modules/labs-react/layout/lib/Stack.tsx
|
|
39
39
|
*/
|
|
40
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
40
41
|
const Stack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
41
42
|
const {
|
|
42
43
|
as: BaseComponent = 'div',
|
|
@@ -57,15 +58,11 @@ const Stack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
57
58
|
if (typeof gap === 'string') {
|
|
58
59
|
style[`--${prefix}-stack-gap`] = gap;
|
|
59
60
|
}
|
|
60
|
-
return (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
className: className,
|
|
66
|
-
style: style
|
|
67
|
-
}), children)
|
|
68
|
-
);
|
|
61
|
+
return /*#__PURE__*/React.createElement(BaseComponent, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
62
|
+
ref: ref,
|
|
63
|
+
className: className,
|
|
64
|
+
style: style
|
|
65
|
+
}), children);
|
|
69
66
|
});
|
|
70
67
|
Stack.propTypes = {
|
|
71
68
|
/**
|
|
@@ -11,6 +11,7 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
11
11
|
var React = require('react');
|
|
12
12
|
var Stack = require('./Stack.js');
|
|
13
13
|
|
|
14
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
14
15
|
const VStack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
15
16
|
return /*#__PURE__*/React.createElement(Stack.Stack, _rollupPluginBabelHelpers.extends({}, props, {
|
|
16
17
|
ref: ref,
|
|
@@ -152,6 +152,7 @@ function StructuredListRow(props) {
|
|
|
152
152
|
...other
|
|
153
153
|
} = props;
|
|
154
154
|
const [hasFocusWithin, setHasFocusWithin] = React.useState(false);
|
|
155
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
155
156
|
const rowId = id ?? useId.useId('grid-input');
|
|
156
157
|
const selectedRow = React.useContext(GridSelectedRowStateContext);
|
|
157
158
|
const setSelectedRow = React.useContext(GridSelectedRowDispatchContext);
|
|
@@ -185,6 +186,7 @@ function StructuredListRow(props) {
|
|
|
185
186
|
ref: itemRef,
|
|
186
187
|
onClick: event => {
|
|
187
188
|
setSelectedRow?.(rowId);
|
|
189
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
188
190
|
onClick && onClick(event);
|
|
189
191
|
if (selection) {
|
|
190
192
|
// focus items only when selection is enabled
|
|
@@ -264,6 +266,7 @@ function StructuredListInput(props) {
|
|
|
264
266
|
value: row?.id ?? '',
|
|
265
267
|
onChange: event => {
|
|
266
268
|
setSelectedRow?.(event.target.value);
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
267
270
|
onChange && onChange(event);
|
|
268
271
|
},
|
|
269
272
|
id: id ?? defaultId,
|
|
@@ -16,7 +16,7 @@ var cx = require('classnames');
|
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
var noopFn = require('../../internal/noopFn.js');
|
|
18
18
|
|
|
19
|
-
const Switch = /*#__PURE__*/React.forwardRef(
|
|
19
|
+
const Switch = /*#__PURE__*/React.forwardRef((props, tabRef) => {
|
|
20
20
|
const {
|
|
21
21
|
children,
|
|
22
22
|
className,
|
|
@@ -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,6 +80,7 @@ function Tabs({
|
|
|
80
80
|
}) {
|
|
81
81
|
const baseId = useId.useId('ccs');
|
|
82
82
|
if (dismissable && !onTabCloseRequest) {
|
|
83
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
83
84
|
console.error('dismissable property specified without also providing an onTabCloseRequest property.');
|
|
84
85
|
}
|
|
85
86
|
// The active index is used to track the element which has focus in our tablist
|
|
@@ -166,15 +167,11 @@ function TabsVertical({
|
|
|
166
167
|
};
|
|
167
168
|
const isSm = useMatchMedia.useMatchMedia(smMediaQuery);
|
|
168
169
|
if (!isSm) {
|
|
169
|
-
return (
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
height: height
|
|
175
|
-
}
|
|
176
|
-
}, /*#__PURE__*/React.createElement(Tabs, props, children))
|
|
177
|
-
);
|
|
170
|
+
return /*#__PURE__*/React.createElement(Grid.Grid, {
|
|
171
|
+
style: {
|
|
172
|
+
height: height
|
|
173
|
+
}
|
|
174
|
+
}, /*#__PURE__*/React.createElement(Tabs, props, children));
|
|
178
175
|
}
|
|
179
176
|
return /*#__PURE__*/React.createElement(Tabs, props, children);
|
|
180
177
|
}
|
|
@@ -278,6 +275,7 @@ function TabList({
|
|
|
278
275
|
let hasSecondaryLabelTabs = false;
|
|
279
276
|
if (contained) {
|
|
280
277
|
hasSecondaryLabelTabs = React.Children.toArray(children).some(child => {
|
|
278
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
281
279
|
const _child = child;
|
|
282
280
|
return /*#__PURE__*/React.isValidElement(child) && !!_child.props.secondaryLabel;
|
|
283
281
|
});
|
|
@@ -391,6 +389,7 @@ function TabList({
|
|
|
391
389
|
inline: 'nearest'
|
|
392
390
|
});
|
|
393
391
|
}
|
|
392
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
394
393
|
}, []);
|
|
395
394
|
React.useEffect(() => {
|
|
396
395
|
//adding 1 in calculation for firefox support
|
|
@@ -411,6 +410,7 @@ function TabList({
|
|
|
411
410
|
setSelectedIndex(tabs.current.indexOf(tab));
|
|
412
411
|
}
|
|
413
412
|
}
|
|
413
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
414
414
|
}, []);
|
|
415
415
|
useIsomorphicEffect.default(() => {
|
|
416
416
|
if (ref.current) {
|
|
@@ -497,7 +497,9 @@ function TabList({
|
|
|
497
497
|
hasSecondaryLabel: hasSecondaryLabelTabs,
|
|
498
498
|
contained
|
|
499
499
|
}
|
|
500
|
-
}, /*#__PURE__*/React.cloneElement(
|
|
500
|
+
}, /*#__PURE__*/React.cloneElement(
|
|
501
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
502
|
+
child, {
|
|
501
503
|
ref: node => {
|
|
502
504
|
tabs.current[index] = node;
|
|
503
505
|
}
|
|
@@ -631,6 +633,7 @@ function TabListVertical({
|
|
|
631
633
|
setSelectedIndex(tabs.current.indexOf(tab));
|
|
632
634
|
}
|
|
633
635
|
}
|
|
636
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
634
637
|
}, []);
|
|
635
638
|
React.useEffect(() => {
|
|
636
639
|
function handler() {
|
|
@@ -641,6 +644,7 @@ function TabListVertical({
|
|
|
641
644
|
if (containerTop && containerHeight) {
|
|
642
645
|
// scrolls so selected tab is in view
|
|
643
646
|
if (selectedPositionTop - halfTabHeight < containerTop || selectedPositionTop - containerTop + verticalTabHeight + halfTabHeight > containerHeight) {
|
|
647
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
644
648
|
ref.current && ref.current.scrollTo({
|
|
645
649
|
top: (selectedIndex - 1) * verticalTabHeight,
|
|
646
650
|
behavior: 'smooth'
|
|
@@ -695,7 +699,9 @@ function TabListVertical({
|
|
|
695
699
|
index,
|
|
696
700
|
hasSecondaryLabel: false
|
|
697
701
|
}
|
|
698
|
-
}, /*#__PURE__*/React.cloneElement(
|
|
702
|
+
}, /*#__PURE__*/React.cloneElement(
|
|
703
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
704
|
+
child, {
|
|
699
705
|
ref: node => {
|
|
700
706
|
tabs.current[index] = node;
|
|
701
707
|
}
|
|
@@ -771,7 +777,8 @@ function createLongPressBehavior(ref, direction, setScrollLeft) {
|
|
|
771
777
|
* Tab
|
|
772
778
|
*/
|
|
773
779
|
|
|
774
|
-
|
|
780
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
781
|
+
const Tab = /*#__PURE__*/React.forwardRef(({
|
|
775
782
|
as = 'button',
|
|
776
783
|
children,
|
|
777
784
|
className: customClassName,
|
|
@@ -781,7 +788,7 @@ const Tab = /*#__PURE__*/React.forwardRef(function Tab({
|
|
|
781
788
|
secondaryLabel,
|
|
782
789
|
renderIcon: Icon,
|
|
783
790
|
...rest
|
|
784
|
-
}, forwardRef) {
|
|
791
|
+
}, forwardRef) => {
|
|
785
792
|
const prefix = usePrefix.usePrefix();
|
|
786
793
|
const {
|
|
787
794
|
selectedIndex,
|
|
@@ -805,6 +812,8 @@ const Tab = /*#__PURE__*/React.forwardRef(function Tab({
|
|
|
805
812
|
const id = `${baseId}-tab-${index$1}`;
|
|
806
813
|
const panelId = `${baseId}-tabpanel-${index$1}`;
|
|
807
814
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
815
|
+
|
|
816
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
808
817
|
const isEllipsisActive = element => {
|
|
809
818
|
setIsEllipsisApplied(element.offsetHeight < element.scrollHeight);
|
|
810
819
|
return element.offsetHeight < element.scrollHeight;
|
|
@@ -1024,7 +1033,8 @@ Tab.propTypes = {
|
|
|
1024
1033
|
*/
|
|
1025
1034
|
|
|
1026
1035
|
const IconTabContext = /*#__PURE__*/React.createContext(false);
|
|
1027
|
-
|
|
1036
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
1037
|
+
const IconTab = /*#__PURE__*/React.forwardRef(({
|
|
1028
1038
|
badgeIndicator,
|
|
1029
1039
|
children,
|
|
1030
1040
|
className: customClassName,
|
|
@@ -1033,7 +1043,7 @@ const IconTab = /*#__PURE__*/React.forwardRef(function IconTab({
|
|
|
1033
1043
|
leaveDelayMs,
|
|
1034
1044
|
label,
|
|
1035
1045
|
...rest
|
|
1036
|
-
}, ref) {
|
|
1046
|
+
}, ref) => {
|
|
1037
1047
|
const prefix = usePrefix.usePrefix();
|
|
1038
1048
|
const value = React.useMemo(() => ({
|
|
1039
1049
|
badgeIndicator
|
|
@@ -1095,11 +1105,12 @@ IconTab.propTypes = {
|
|
|
1095
1105
|
* TabPanel
|
|
1096
1106
|
*/
|
|
1097
1107
|
|
|
1098
|
-
|
|
1108
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
1109
|
+
const TabPanel = /*#__PURE__*/React.forwardRef(({
|
|
1099
1110
|
children,
|
|
1100
1111
|
className: customClassName,
|
|
1101
1112
|
...rest
|
|
1102
|
-
}, forwardRef) {
|
|
1113
|
+
}, forwardRef) => {
|
|
1103
1114
|
const prefix = usePrefix.usePrefix();
|
|
1104
1115
|
const panel = React.useRef(null);
|
|
1105
1116
|
const ref = useMergedRefs.useMergedRefs([forwardRef, panel]);
|
|
@@ -28,6 +28,7 @@ var utils = require('../../internal/utils.js');
|
|
|
28
28
|
var Text = require('../Text/Text.js');
|
|
29
29
|
|
|
30
30
|
var _Close;
|
|
31
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
31
32
|
const DismissibleTag = /*#__PURE__*/React.forwardRef(({
|
|
32
33
|
className,
|
|
33
34
|
decorator,
|
|
@@ -47,6 +48,7 @@ const DismissibleTag = /*#__PURE__*/React.forwardRef(({
|
|
|
47
48
|
}, forwardRef) => {
|
|
48
49
|
const prefix = usePrefix.usePrefix();
|
|
49
50
|
const tagLabelRef = React.useRef(null);
|
|
51
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
50
52
|
const tagId = id || `tag-${useId.useId()}`;
|
|
51
53
|
const tagClasses = cx(`${prefix}--tag--filter`, className);
|
|
52
54
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
@@ -35,6 +35,7 @@ const TYPES = {
|
|
|
35
35
|
'cool-gray': 'Cool-Gray',
|
|
36
36
|
'warm-gray': 'Warm-Gray'
|
|
37
37
|
};
|
|
38
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
38
39
|
const OperationalTag = /*#__PURE__*/React.forwardRef(({
|
|
39
40
|
className,
|
|
40
41
|
disabled,
|
|
@@ -47,6 +48,7 @@ const OperationalTag = /*#__PURE__*/React.forwardRef(({
|
|
|
47
48
|
}, forwardRef) => {
|
|
48
49
|
const prefix = usePrefix.usePrefix();
|
|
49
50
|
const tagRef = React.useRef(null);
|
|
51
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
50
52
|
const tagId = id || `tag-${useId.useId()}`;
|
|
51
53
|
const tagClasses = cx(`${prefix}--tag--operational`, className);
|
|
52
54
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
@@ -24,6 +24,7 @@ var mergeRefs = require('../../tools/mergeRefs.js');
|
|
|
24
24
|
var useControllableState = require('../../internal/useControllableState.js');
|
|
25
25
|
var Text = require('../Text/Text.js');
|
|
26
26
|
|
|
27
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
27
28
|
const SelectableTag = /*#__PURE__*/React.forwardRef(({
|
|
28
29
|
className,
|
|
29
30
|
disabled,
|
|
@@ -39,6 +40,7 @@ const SelectableTag = /*#__PURE__*/React.forwardRef(({
|
|
|
39
40
|
}, forwardRef) => {
|
|
40
41
|
const prefix = usePrefix.usePrefix();
|
|
41
42
|
const tagRef = React.useRef(null);
|
|
43
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
42
44
|
const tagId = id || `tag-${useId.useId()}`;
|
|
43
45
|
const [selectedTag, setSelectedTag] = useControllableState.useControllableState({
|
|
44
46
|
value: selected,
|
|
@@ -46,6 +46,7 @@ const SIZES = {
|
|
|
46
46
|
md: 'md',
|
|
47
47
|
lg: 'lg'
|
|
48
48
|
};
|
|
49
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
49
50
|
const TagBase = /*#__PURE__*/React.forwardRef(({
|
|
50
51
|
children,
|
|
51
52
|
className,
|
|
@@ -68,12 +69,15 @@ const TagBase = /*#__PURE__*/React.forwardRef(({
|
|
|
68
69
|
const prefix = usePrefix.usePrefix();
|
|
69
70
|
const tagRef = React.useRef(null);
|
|
70
71
|
if (filter) {
|
|
72
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
71
73
|
console.warn('The `filter` prop for Tag has been deprecated and will be removed in the next major version. Use DismissibleTag instead.');
|
|
72
74
|
}
|
|
73
75
|
if (onClose) {
|
|
76
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
74
77
|
console.warn('The `onClose` prop for Tag has been deprecated and will be removed in the next major version. Use DismissibleTag instead.');
|
|
75
78
|
}
|
|
76
79
|
const ref = useMergedRefs.useMergedRefs([forwardRef, tagRef]);
|
|
80
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
77
81
|
const tagId = id || `tag-${useId.useId()}`;
|
|
78
82
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
79
83
|
React.useLayoutEffect(() => {
|
|
@@ -13,6 +13,7 @@ var React = require('react');
|
|
|
13
13
|
require('./index.js');
|
|
14
14
|
var TextDirectionContext = require('./TextDirectionContext.js');
|
|
15
15
|
|
|
16
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
16
17
|
const TextBase = /*#__PURE__*/React.forwardRef(({
|
|
17
18
|
as,
|
|
18
19
|
children,
|
|
@@ -84,19 +84,26 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
84
84
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
85
85
|
}, [value, defaultValue, counterMode]);
|
|
86
86
|
useIsomorphicEffect.default(() => {
|
|
87
|
-
const measuredWidth = wrapperRef.current?.scrollWidth;
|
|
88
87
|
if (other.cols && textareaRef.current) {
|
|
89
88
|
textareaRef.current.style.width = '';
|
|
90
89
|
textareaRef.current.style.resize = 'none';
|
|
91
90
|
} else if (textareaRef.current) {
|
|
92
91
|
textareaRef.current.style.width = `100%`;
|
|
93
92
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
r.current
|
|
98
|
-
|
|
93
|
+
if (!wrapperRef.current) return;
|
|
94
|
+
const applyWidth = width => {
|
|
95
|
+
[helperTextRef, errorTextRef, warnTextRef].forEach(r => {
|
|
96
|
+
if (r.current) {
|
|
97
|
+
r.current.style.maxWidth = `${width}px`;
|
|
98
|
+
r.current.style.overflowWrap = 'break-word';
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
103
|
+
applyWidth(entry.contentRect.width);
|
|
99
104
|
});
|
|
105
|
+
resizeObserver.observe(wrapperRef.current);
|
|
106
|
+
return () => resizeObserver && resizeObserver.disconnect();
|
|
100
107
|
}, [other.cols, invalid, warn]);
|
|
101
108
|
const textareaProps = {
|
|
102
109
|
id,
|
|
@@ -20,7 +20,7 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
20
20
|
var useId = require('../../internal/useId.js');
|
|
21
21
|
var noopFn = require('../../internal/noopFn.js');
|
|
22
22
|
|
|
23
|
-
const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(
|
|
23
|
+
const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
24
24
|
labelText,
|
|
25
25
|
className,
|
|
26
26
|
id,
|
|
@@ -33,9 +33,7 @@ const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(function Controlle
|
|
|
33
33
|
invalidText = '',
|
|
34
34
|
helperText = '',
|
|
35
35
|
light,
|
|
36
|
-
// eslint-disable-next-line react/prop-types
|
|
37
36
|
type = 'password',
|
|
38
|
-
// eslint-disable-next-line react/prop-types
|
|
39
37
|
togglePasswordVisibility,
|
|
40
38
|
tooltipPosition = 'bottom',
|
|
41
39
|
tooltipAlignment = 'center',
|
|
@@ -43,7 +41,7 @@ const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(function Controlle
|
|
|
43
41
|
showPasswordLabel = 'Show password',
|
|
44
42
|
size = undefined,
|
|
45
43
|
...other
|
|
46
|
-
}, ref) {
|
|
44
|
+
}, ref) => {
|
|
47
45
|
const prefix = usePrefix.usePrefix();
|
|
48
46
|
const controlledPasswordInstanceId = useId.useId();
|
|
49
47
|
const errorId = id + '-error-msg';
|
|
@@ -96,7 +94,7 @@ const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(function Controlle
|
|
|
96
94
|
[`${prefix}--tooltip--align-${tooltipAlignment}`]: tooltipAlignment
|
|
97
95
|
});
|
|
98
96
|
const helperId = !helperText ? undefined : `controlled-password-helper-text-${controlledPasswordInstanceId}`;
|
|
99
|
-
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, util.
|
|
97
|
+
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, util.getTextInputProps({
|
|
100
98
|
invalid,
|
|
101
99
|
sharedTextInputProps,
|
|
102
100
|
invalidId: errorId,
|
|
@@ -23,7 +23,7 @@ var Tooltip = require('../Tooltip/Tooltip.js');
|
|
|
23
23
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
24
24
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
25
25
|
|
|
26
|
-
const PasswordInput = /*#__PURE__*/React.forwardRef(
|
|
26
|
+
const PasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
27
27
|
className,
|
|
28
28
|
disabled = false,
|
|
29
29
|
helperText,
|
|
@@ -48,7 +48,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
48
48
|
warn = false,
|
|
49
49
|
warnText,
|
|
50
50
|
...rest
|
|
51
|
-
}, ref) {
|
|
51
|
+
}, ref) => {
|
|
52
52
|
const [inputType, setInputType] = React.useState(type);
|
|
53
53
|
const prefix = usePrefix.usePrefix();
|
|
54
54
|
const normalizedProps = useNormalizedInputProps.useNormalizedInputProps({
|
|
@@ -65,6 +65,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
65
65
|
} = React.useContext(FormContext.FormContext);
|
|
66
66
|
const handleTogglePasswordVisibility = event => {
|
|
67
67
|
setInputType(inputType === 'password' ? 'text' : 'password');
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
68
69
|
onTogglePasswordVisibility && onTogglePasswordVisibility(event);
|
|
69
70
|
};
|
|
70
71
|
const textInputClasses = cx(`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
@@ -154,11 +155,13 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
154
155
|
align = tooltipPosition;
|
|
155
156
|
}
|
|
156
157
|
if (!hidePasswordLabel || hidePasswordLabel.trim() === '') {
|
|
158
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
157
159
|
console.warn('Warning: The "hidePasswordLabel" should not be blank.');
|
|
158
160
|
} else if (!showPasswordLabel || showPasswordLabel.trim() === '') {
|
|
161
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
159
162
|
console.warn('Warning: The "showPasswordLabel" should not be blank.');
|
|
160
163
|
}
|
|
161
|
-
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, util.
|
|
164
|
+
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, util.getTextInputProps({
|
|
162
165
|
sharedTextInputProps,
|
|
163
166
|
invalid: normalizedProps.invalid,
|
|
164
167
|
invalidId: normalizedProps.invalidId,
|
|
@@ -184,6 +187,8 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
184
187
|
React.useEffect(() => {
|
|
185
188
|
setInputType(type);
|
|
186
189
|
}, [type]);
|
|
190
|
+
|
|
191
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
187
192
|
const Icon = normalizedProps.icon;
|
|
188
193
|
return /*#__PURE__*/React.createElement("div", {
|
|
189
194
|
className: inputWrapperClasses
|
|
@@ -25,7 +25,7 @@ var index = require('../AILabel/index.js');
|
|
|
25
25
|
var utils = require('../../internal/utils.js');
|
|
26
26
|
var Text = require('../Text/Text.js');
|
|
27
27
|
|
|
28
|
-
const TextInput = /*#__PURE__*/React.forwardRef(
|
|
28
|
+
const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
29
29
|
className,
|
|
30
30
|
decorator,
|
|
31
31
|
disabled = false,
|
|
@@ -49,7 +49,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(function TextInput({
|
|
|
49
49
|
maxCount,
|
|
50
50
|
slug,
|
|
51
51
|
...rest
|
|
52
|
-
}, ref) {
|
|
52
|
+
}, ref) => {
|
|
53
53
|
const prefix = usePrefix.usePrefix();
|
|
54
54
|
const {
|
|
55
55
|
defaultValue,
|
|
@@ -64,6 +64,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(function TextInput({
|
|
|
64
64
|
const [textCount, setTextCount] = React.useState(getInitialTextCount());
|
|
65
65
|
React.useEffect(() => {
|
|
66
66
|
setTextCount(getInitialTextCount());
|
|
67
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
67
68
|
}, [value, defaultValue, enableCounter]);
|
|
68
69
|
const normalizedProps = useNormalizedInputProps.useNormalizedInputProps({
|
|
69
70
|
id,
|
|
@@ -157,7 +158,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(function TextInput({
|
|
|
157
158
|
id: normalizedProps.helperId,
|
|
158
159
|
className: helperTextClasses
|
|
159
160
|
}, helperText) : null;
|
|
160
|
-
const input = /*#__PURE__*/React.createElement("input", util.
|
|
161
|
+
const input = /*#__PURE__*/React.createElement("input", util.getTextInputProps({
|
|
161
162
|
sharedTextInputProps,
|
|
162
163
|
invalid: normalizedProps.invalid,
|
|
163
164
|
invalidId: normalizedProps.invalidId,
|
|
@@ -192,6 +193,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(function TextInput({
|
|
|
192
193
|
}
|
|
193
194
|
}
|
|
194
195
|
}, [ariaAnnouncement, prevAnnouncement]);
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
195
197
|
const Icon = normalizedProps.icon;
|
|
196
198
|
|
|
197
199
|
// AILabel is always size `mini`
|
|
@@ -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 {};
|
|
@@ -18,12 +18,7 @@ const warnProps = warnId => ({
|
|
|
18
18
|
const helperProps = helperId => ({
|
|
19
19
|
'aria-describedby': helperId
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @param {{sharedTextInputProps: object, invalid?: boolean, invalidId?: string, warn?: boolean, warnId?: string, hasHelper?: boolean, helperId?: string}} config
|
|
24
|
-
* @returns {object}
|
|
25
|
-
*/
|
|
26
|
-
const textInputProps = ({
|
|
21
|
+
const getTextInputProps = ({
|
|
27
22
|
sharedTextInputProps,
|
|
28
23
|
invalid,
|
|
29
24
|
invalidId,
|
|
@@ -38,4 +33,4 @@ const textInputProps = ({
|
|
|
38
33
|
...(hasHelper ? helperProps(helperId) : {})
|
|
39
34
|
});
|
|
40
35
|
|
|
41
|
-
exports.
|
|
36
|
+
exports.getTextInputProps = getTextInputProps;
|
|
@@ -18,16 +18,20 @@ var useMatchMedia = require('../../internal/useMatchMedia.js');
|
|
|
18
18
|
const ThemeContext = /*#__PURE__*/React.createContext({
|
|
19
19
|
theme: 'white'
|
|
20
20
|
});
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
23
|
+
const GlobalTheme = /*#__PURE__*/React.forwardRef(({
|
|
22
24
|
children,
|
|
23
25
|
theme
|
|
24
|
-
}, ref) {
|
|
26
|
+
}, ref) => {
|
|
25
27
|
const value = React.useMemo(() => {
|
|
26
28
|
return {
|
|
27
29
|
theme
|
|
28
30
|
};
|
|
29
31
|
}, [theme]);
|
|
30
|
-
const childrenWithProps = /*#__PURE__*/React.cloneElement(
|
|
32
|
+
const childrenWithProps = /*#__PURE__*/React.cloneElement(
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
34
|
+
children, {
|
|
31
35
|
ref: ref
|
|
32
36
|
});
|
|
33
37
|
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
@@ -69,6 +73,7 @@ function Theme({
|
|
|
69
73
|
isDark
|
|
70
74
|
};
|
|
71
75
|
}, [theme]);
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
72
77
|
const BaseComponentAsAny = BaseComponent;
|
|
73
78
|
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
74
79
|
value: value
|