@carbon/react 1.92.0 → 1.93.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 +1011 -970
- package/es/components/AILabel/index.js +4 -4
- package/es/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/es/components/Button/Button.js +2 -2
- package/es/components/ChatButton/ChatButton.js +1 -1
- package/es/components/Checkbox/Checkbox.js +1 -1
- package/es/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/es/components/ComboBox/ComboBox.d.ts +3 -11
- package/es/components/ComboBox/ComboBox.js +15 -25
- package/es/components/ComboButton/index.d.ts +5 -8
- package/es/components/ComboButton/index.js +9 -12
- package/es/components/ComposedModal/ComposedModal.js +22 -36
- package/es/components/DataTable/DataTable.d.ts +25 -16
- package/es/components/DataTable/DataTable.js +33 -34
- package/es/components/DataTable/Table.js +2 -2
- package/es/components/DataTable/TableBatchActions.d.ts +49 -10
- package/es/components/DataTable/TableBatchActions.js +26 -21
- package/es/components/DataTable/TableExpandHeader.js +2 -2
- package/es/components/DataTable/TableExpandRow.js +1 -1
- package/es/components/DataTable/TableHeader.d.ts +8 -10
- package/es/components/DataTable/TableHeader.js +11 -13
- package/es/components/DataTable/TableRow.js +5 -5
- package/es/components/DataTable/TableSlugRow.js +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +1 -1
- package/es/components/DataTable/TableToolbarSearch.d.ts +8 -7
- package/es/components/DataTable/TableToolbarSearch.js +11 -11
- package/es/components/DataTable/index.d.ts +2 -2
- package/es/components/DataTable/state/sorting.d.ts +2 -2
- package/es/components/DataTable/state/sorting.js +1 -1
- package/es/components/DataTable/tools/sorting.js +1 -1
- package/es/components/DatePicker/DatePicker.js +9 -9
- package/es/components/DatePickerInput/DatePickerInput.js +5 -5
- package/es/components/Dialog/Dialog.js +6 -6
- package/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.js +8 -8
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -1
- package/es/components/FileUploader/FileUploader.js +4 -4
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +2 -2
- package/es/components/FluidComboBox/FluidComboBox.d.ts +4 -7
- package/es/components/FluidComboBox/FluidComboBox.js +1 -1
- package/es/components/FluidDropdown/FluidDropdown.d.ts +4 -8
- package/es/components/FluidDropdown/FluidDropdown.js +1 -1
- package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -7
- package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +3 -7
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +3 -3
- package/es/components/FluidNumberInput/FluidNumberInput.d.ts +4 -7
- package/es/components/FluidNumberInput/FluidNumberInput.js +2 -2
- package/es/components/FluidSearch/FluidSearch.js +1 -1
- package/es/components/FluidSelect/FluidSelect.js +1 -1
- package/es/components/FluidTextInput/FluidTextInput.js +1 -1
- package/es/components/FluidTimePicker/FluidTimePicker.js +3 -3
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +1 -1
- package/es/components/Grid/CSSGrid.js +3 -3
- package/es/components/Grid/Column.js +2 -2
- package/es/components/Grid/ColumnHang.js +1 -1
- package/es/components/Grid/FlexGrid.js +1 -1
- package/es/components/Grid/Row.js +1 -1
- package/es/components/Heading/index.js +2 -2
- package/es/components/IconButton/index.js +2 -2
- package/es/components/IconIndicator/index.js +2 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +1 -1
- package/es/components/Layout/index.js +2 -2
- package/es/components/LayoutDirection/LayoutDirection.js +1 -1
- package/es/components/Link/Link.js +2 -2
- package/es/components/ListBox/ListBoxField.d.ts +0 -1
- package/es/components/ListBox/ListBoxMenuIcon.d.ts +8 -4
- package/es/components/ListBox/ListBoxMenuIcon.js +10 -6
- package/es/components/ListBox/ListBoxMenuItem.js +2 -2
- package/es/components/ListBox/ListBoxSelection.d.ts +3 -6
- package/es/components/ListBox/ListBoxSelection.js +5 -10
- package/es/components/ListBox/index.d.ts +5 -3
- package/es/components/ListBox/next/ListBoxSelection.d.ts +6 -13
- package/es/components/ListBox/next/ListBoxSelection.js +16 -8
- package/es/components/ListBox/next/ListBoxTrigger.d.ts +5 -10
- package/es/components/ListBox/next/ListBoxTrigger.js +6 -6
- package/es/components/Menu/MenuContext.js +1 -1
- package/es/components/Menu/MenuItem.js +1 -1
- package/es/components/MenuButton/index.js +5 -5
- package/es/components/Modal/Modal.js +20 -36
- package/es/components/ModalWrapper/ModalWrapper.js +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -12
- package/es/components/MultiSelect/FilterableMultiSelect.js +18 -27
- package/es/components/MultiSelect/MultiSelect.d.ts +2 -2
- package/es/components/MultiSelect/MultiSelect.js +12 -12
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/NumberInput/NumberInput.d.ts +2 -5
- package/es/components/NumberInput/NumberInput.js +13 -18
- package/es/components/OverflowMenu/OverflowMenu.d.ts +2 -2
- package/es/components/OverflowMenu/OverflowMenu.js +4 -4
- package/es/components/OverflowMenu/next/index.d.ts +1 -1
- package/es/components/OverflowMenu/next/index.js +2 -2
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/es/components/PageHeader/PageHeader.js +12 -12
- package/es/components/Pagination/Pagination.js +3 -3
- package/es/components/PaginationNav/PaginationNav.d.ts +6 -9
- package/es/components/PaginationNav/PaginationNav.js +21 -22
- package/es/components/Popover/index.js +8 -8
- package/es/components/ProgressBar/ProgressBar.js +2 -2
- package/es/components/ProgressIndicator/ProgressIndicator.d.ts +11 -15
- package/es/components/ProgressIndicator/ProgressIndicator.js +15 -15
- package/es/components/RadioButton/RadioButton.js +1 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/es/components/RadioTile/RadioTile.js +1 -1
- package/es/components/Select/Select.js +7 -5
- package/es/components/ShapeIndicator/index.js +2 -2
- package/es/components/Slider/Slider.d.ts +7 -9
- package/es/components/Slider/Slider.js +16 -20
- package/es/components/Stack/HStack.js +1 -1
- package/es/components/Stack/Stack.js +1 -1
- package/es/components/Stack/VStack.js +1 -1
- package/es/components/StructuredList/StructuredList.js +3 -3
- package/es/components/Tabs/Tabs.js +12 -12
- package/es/components/Tag/DismissibleTag.js +3 -3
- package/es/components/Tag/OperationalTag.js +2 -2
- package/es/components/Tag/SelectableTag.js +2 -2
- package/es/components/Tag/Tag.js +4 -4
- package/es/components/Tag/isEllipsisActive.js +1 -1
- package/es/components/Text/Text.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextInput/PasswordInput.js +4 -4
- package/es/components/TextInput/TextInput.js +3 -3
- package/es/components/Theme/index.js +3 -3
- package/es/components/Tile/Tile.js +3 -3
- package/es/components/TimePicker/TimePicker.js +1 -1
- package/es/components/Toggletip/index.js +4 -4
- package/es/components/Tooltip/DefinitionTooltip.js +1 -1
- package/es/components/Tooltip/Tooltip.js +3 -3
- package/es/components/TreeView/TreeNode.js +6 -6
- package/es/components/TreeView/TreeView.js +5 -5
- package/es/components/UIShell/HeaderContainer.js +1 -1
- package/es/components/UIShell/HeaderMenu.js +1 -1
- package/es/components/UIShell/Link.js +2 -2
- package/es/components/UIShell/SideNavItems.js +1 -1
- package/es/components/UIShell/Switcher.js +1 -1
- package/es/components/UIShell/SwitcherItem.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/internal/FloatingMenu.js +4 -4
- package/es/internal/Selection.js +6 -6
- package/es/internal/useMergedRefs.js +1 -1
- package/es/internal/useNoInteractiveChildren.js +4 -4
- package/es/internal/useOutsideClick.js +1 -1
- package/es/internal/useOverflowItems.js +6 -6
- package/es/internal/useResizeObserver.js +3 -3
- package/es/internal/useSavedCallback.js +1 -1
- package/es/internal/warning.js +1 -1
- package/es/prop-types/isRequiredOneOf.js +2 -2
- package/es/tools/events.js +1 -1
- package/es/tools/wrapComponent.js +1 -1
- package/es/types/common.d.ts +6 -2
- package/lib/components/AILabel/index.js +4 -4
- package/lib/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/lib/components/Button/Button.js +2 -2
- package/lib/components/ChatButton/ChatButton.js +1 -1
- package/lib/components/Checkbox/Checkbox.js +1 -1
- package/lib/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +3 -11
- package/lib/components/ComboBox/ComboBox.js +15 -25
- package/lib/components/ComboButton/index.d.ts +5 -8
- package/lib/components/ComboButton/index.js +9 -12
- package/lib/components/ComposedModal/ComposedModal.js +21 -35
- package/lib/components/DataTable/DataTable.d.ts +25 -16
- package/lib/components/DataTable/DataTable.js +33 -34
- package/lib/components/DataTable/Table.js +2 -2
- package/lib/components/DataTable/TableBatchActions.d.ts +49 -10
- package/lib/components/DataTable/TableBatchActions.js +26 -21
- package/lib/components/DataTable/TableExpandHeader.js +2 -2
- package/lib/components/DataTable/TableExpandRow.js +1 -1
- package/lib/components/DataTable/TableHeader.d.ts +8 -10
- package/lib/components/DataTable/TableHeader.js +11 -13
- package/lib/components/DataTable/TableRow.js +5 -5
- package/lib/components/DataTable/TableSlugRow.js +1 -1
- package/lib/components/DataTable/TableToolbarMenu.js +1 -1
- package/lib/components/DataTable/TableToolbarSearch.d.ts +8 -7
- package/lib/components/DataTable/TableToolbarSearch.js +11 -11
- package/lib/components/DataTable/index.d.ts +2 -2
- package/lib/components/DataTable/state/sorting.d.ts +2 -2
- package/lib/components/DataTable/state/sorting.js +1 -1
- package/lib/components/DataTable/tools/sorting.js +1 -1
- package/lib/components/DatePicker/DatePicker.js +9 -9
- package/lib/components/DatePickerInput/DatePickerInput.js +5 -5
- package/lib/components/Dialog/Dialog.js +6 -6
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.js +8 -8
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -1
- package/lib/components/FileUploader/FileUploader.js +4 -4
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +2 -2
- package/lib/components/FluidComboBox/FluidComboBox.d.ts +4 -7
- package/lib/components/FluidComboBox/FluidComboBox.js +1 -1
- package/lib/components/FluidDropdown/FluidDropdown.d.ts +4 -8
- package/lib/components/FluidDropdown/FluidDropdown.js +1 -1
- package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -7
- package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +3 -7
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +3 -3
- package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +4 -7
- package/lib/components/FluidNumberInput/FluidNumberInput.js +2 -2
- package/lib/components/FluidSearch/FluidSearch.js +1 -1
- package/lib/components/FluidSelect/FluidSelect.js +1 -1
- package/lib/components/FluidTextInput/FluidTextInput.js +1 -1
- package/lib/components/FluidTimePicker/FluidTimePicker.js +3 -3
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +1 -1
- package/lib/components/Grid/CSSGrid.js +3 -3
- package/lib/components/Grid/Column.js +2 -2
- package/lib/components/Grid/ColumnHang.js +1 -1
- package/lib/components/Grid/FlexGrid.js +1 -1
- package/lib/components/Grid/Row.js +1 -1
- package/lib/components/Heading/index.js +2 -2
- package/lib/components/IconButton/index.js +2 -2
- package/lib/components/IconIndicator/index.js +2 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +1 -1
- package/lib/components/Layout/index.js +2 -2
- package/lib/components/LayoutDirection/LayoutDirection.js +1 -1
- package/lib/components/Link/Link.js +2 -2
- package/lib/components/ListBox/ListBoxField.d.ts +0 -1
- package/lib/components/ListBox/ListBoxMenuIcon.d.ts +8 -4
- package/lib/components/ListBox/ListBoxMenuIcon.js +10 -6
- package/lib/components/ListBox/ListBoxMenuItem.js +2 -2
- package/lib/components/ListBox/ListBoxSelection.d.ts +3 -6
- package/lib/components/ListBox/ListBoxSelection.js +4 -10
- package/lib/components/ListBox/index.d.ts +5 -3
- package/lib/components/ListBox/next/ListBoxSelection.d.ts +6 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +16 -8
- package/lib/components/ListBox/next/ListBoxTrigger.d.ts +5 -10
- package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
- package/lib/components/Menu/MenuContext.js +1 -1
- package/lib/components/Menu/MenuItem.js +1 -1
- package/lib/components/MenuButton/index.js +5 -5
- package/lib/components/Modal/Modal.js +19 -35
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -12
- package/lib/components/MultiSelect/FilterableMultiSelect.js +18 -27
- package/lib/components/MultiSelect/MultiSelect.d.ts +2 -2
- package/lib/components/MultiSelect/MultiSelect.js +12 -12
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/NumberInput/NumberInput.d.ts +2 -5
- package/lib/components/NumberInput/NumberInput.js +12 -18
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +2 -2
- package/lib/components/OverflowMenu/OverflowMenu.js +4 -4
- package/lib/components/OverflowMenu/next/index.d.ts +1 -1
- package/lib/components/OverflowMenu/next/index.js +2 -2
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/lib/components/PageHeader/PageHeader.js +12 -12
- package/lib/components/Pagination/Pagination.js +3 -3
- package/lib/components/PaginationNav/PaginationNav.d.ts +6 -9
- package/lib/components/PaginationNav/PaginationNav.js +21 -22
- package/lib/components/Popover/index.js +8 -8
- package/lib/components/ProgressBar/ProgressBar.js +2 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.d.ts +11 -15
- package/lib/components/ProgressIndicator/ProgressIndicator.js +15 -15
- package/lib/components/RadioButton/RadioButton.js +1 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/lib/components/RadioTile/RadioTile.js +1 -1
- package/lib/components/Select/Select.js +7 -5
- package/lib/components/ShapeIndicator/index.js +2 -2
- package/lib/components/Slider/Slider.d.ts +7 -9
- package/lib/components/Slider/Slider.js +16 -20
- package/lib/components/Stack/HStack.js +1 -1
- package/lib/components/Stack/Stack.js +1 -1
- package/lib/components/Stack/VStack.js +1 -1
- package/lib/components/StructuredList/StructuredList.js +3 -3
- package/lib/components/Tabs/Tabs.js +12 -12
- package/lib/components/Tag/DismissibleTag.js +3 -3
- package/lib/components/Tag/OperationalTag.js +2 -2
- package/lib/components/Tag/SelectableTag.js +2 -2
- package/lib/components/Tag/Tag.js +4 -4
- package/lib/components/Tag/isEllipsisActive.js +1 -1
- package/lib/components/Text/Text.js +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextInput/PasswordInput.js +4 -4
- package/lib/components/TextInput/TextInput.js +3 -3
- package/lib/components/Theme/index.js +3 -3
- package/lib/components/Tile/Tile.js +3 -3
- package/lib/components/TimePicker/TimePicker.js +1 -1
- package/lib/components/Toggletip/index.js +4 -4
- package/lib/components/Tooltip/DefinitionTooltip.js +1 -1
- package/lib/components/Tooltip/Tooltip.js +3 -3
- package/lib/components/TreeView/TreeNode.js +6 -6
- package/lib/components/TreeView/TreeView.js +5 -5
- package/lib/components/UIShell/HeaderContainer.js +1 -1
- package/lib/components/UIShell/HeaderMenu.js +1 -1
- package/lib/components/UIShell/Link.js +2 -2
- package/lib/components/UIShell/SideNavItems.js +1 -1
- package/lib/components/UIShell/Switcher.js +1 -1
- package/lib/components/UIShell/SwitcherItem.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/internal/FloatingMenu.js +4 -4
- package/lib/internal/Selection.js +6 -6
- package/lib/internal/useMergedRefs.js +1 -1
- package/lib/internal/useNoInteractiveChildren.js +4 -4
- package/lib/internal/useOutsideClick.js +1 -1
- package/lib/internal/useOverflowItems.js +6 -6
- package/lib/internal/useResizeObserver.js +3 -3
- package/lib/internal/useSavedCallback.js +1 -1
- package/lib/internal/warning.js +1 -1
- package/lib/prop-types/isRequiredOneOf.js +2 -2
- package/lib/tools/events.js +1 -1
- package/lib/tools/wrapComponent.js +1 -1
- package/lib/types/common.d.ts +6 -2
- package/package.json +9 -9
|
@@ -57,11 +57,13 @@ const Select = /*#__PURE__*/React.forwardRef(({
|
|
|
57
57
|
// Convert children to an array of valid elements once using type narrowing
|
|
58
58
|
const validChildren = React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child));
|
|
59
59
|
|
|
60
|
-
// Find the default option based on the specified defaultValue
|
|
61
|
-
const
|
|
60
|
+
// Find the default option based on the specified defaultValue or value
|
|
61
|
+
const selectedValue = other?.value || other?.defaultValue;
|
|
62
|
+
const selectedOption = validChildren.find(child => child.props?.value === selectedValue);
|
|
62
63
|
|
|
63
|
-
// Use the
|
|
64
|
-
|
|
64
|
+
// Use the provided title prop, or the selected option's text if available;
|
|
65
|
+
// otherwise, fallback to the first option's text
|
|
66
|
+
const initialTitle = other?.title || selectedOption?.props?.text || validChildren[0]?.props?.text || '';
|
|
65
67
|
const [title, setTitle] = React.useState(initialTitle);
|
|
66
68
|
const selectClasses = cx({
|
|
67
69
|
[`${prefix}--select`]: true,
|
|
@@ -143,7 +145,7 @@ const Select = /*#__PURE__*/React.forwardRef(({
|
|
|
143
145
|
const candidateIsAILabel = utils.isComponentElement(candidate, index.AILabel);
|
|
144
146
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
145
147
|
size: 'mini'
|
|
146
|
-
}) :
|
|
148
|
+
}) : candidate;
|
|
147
149
|
const input = (() => {
|
|
148
150
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("select", _rollupPluginBabelHelpers.extends({}, other, ariaProps, {
|
|
149
151
|
id: id,
|
|
@@ -50,13 +50,13 @@ const shapeTypes = {
|
|
|
50
50
|
incomplete: incompleteIcon,
|
|
51
51
|
draft: iconsReact.CircleStroke
|
|
52
52
|
};
|
|
53
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
53
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
54
54
|
const ShapeIndicator = /*#__PURE__*/React.forwardRef(({
|
|
55
55
|
className: customClassName,
|
|
56
56
|
kind,
|
|
57
57
|
label,
|
|
58
58
|
textSize = 12,
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
60
60
|
...rest
|
|
61
61
|
}, ref) => {
|
|
62
62
|
const prefix = usePrefix.usePrefix();
|
|
@@ -6,22 +6,20 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { type InputHTMLAttributes, type KeyboardEventHandler, type ReactNode } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
-
import { TranslateWithId } from '../../types/common';
|
|
9
|
+
import type { TranslateWithId } from '../../types/common';
|
|
10
10
|
declare const translationIds: {
|
|
11
|
-
readonly
|
|
11
|
+
readonly 'carbon.slider.auto-correct-announcement': "carbon.slider.auto-correct-announcement";
|
|
12
|
+
};
|
|
13
|
+
type TranslationKey = keyof typeof translationIds;
|
|
14
|
+
type TranslationArgs = {
|
|
15
|
+
correctedValue?: string;
|
|
12
16
|
};
|
|
13
|
-
/**
|
|
14
|
-
* Message ids that will be passed to translateWithId().
|
|
15
|
-
*/
|
|
16
|
-
type TranslationKey = (typeof translationIds)[keyof typeof translationIds];
|
|
17
17
|
declare enum HandlePosition {
|
|
18
18
|
LOWER = "lower",
|
|
19
19
|
UPPER = "upper"
|
|
20
20
|
}
|
|
21
21
|
type ExcludedAttributes = 'onChange' | 'onBlur';
|
|
22
|
-
export interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes>, TranslateWithId<TranslationKey, {
|
|
23
|
-
correctedValue?: string;
|
|
24
|
-
}> {
|
|
22
|
+
export interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes>, TranslateWithId<TranslationKey, TranslationArgs> {
|
|
25
23
|
/**
|
|
26
24
|
* The `ariaLabel` for the `<input>`.
|
|
27
25
|
*/
|
|
@@ -44,22 +44,18 @@ const ThumbWrapper = ({
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
const translationIds = {
|
|
47
|
-
|
|
47
|
+
'carbon.slider.auto-correct-announcement': 'carbon.slider.auto-correct-announcement'
|
|
48
48
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const {
|
|
57
|
-
correctedValue
|
|
58
|
-
} = translationState;
|
|
59
|
-
return `The inputted value "${correctedValue}" was corrected to the nearest allowed digit.`;
|
|
49
|
+
const defaultTranslations = {
|
|
50
|
+
[translationIds['carbon.slider.auto-correct-announcement']]: 'The inputted value "{correctedValue}" was corrected to the nearest allowed digit.'
|
|
51
|
+
};
|
|
52
|
+
const defaultTranslateWithId = (messageId, args) => {
|
|
53
|
+
const template = defaultTranslations[messageId];
|
|
54
|
+
if (args?.correctedValue) {
|
|
55
|
+
return template.replace('{correctedValue}', args.correctedValue);
|
|
60
56
|
}
|
|
61
|
-
return
|
|
62
|
-
}
|
|
57
|
+
return template;
|
|
58
|
+
};
|
|
63
59
|
const defaultFormatLabel = (value, label) => {
|
|
64
60
|
return `${value}${label ?? ''}`;
|
|
65
61
|
};
|
|
@@ -695,7 +691,7 @@ const Slider = props => {
|
|
|
695
691
|
min,
|
|
696
692
|
max
|
|
697
693
|
} = props;
|
|
698
|
-
const numSteps = Math.floor((max - min) / step) +
|
|
694
|
+
const numSteps = Math.floor((max - min) / step) + 1;
|
|
699
695
|
/** Index of the step that corresponds to `leftPercent`. */
|
|
700
696
|
const stepIndex = Math.round(leftPercent * (numSteps - 1));
|
|
701
697
|
const discreteValue = stepIndex === numSteps - 1 ? max : min + step * stepIndex;
|
|
@@ -957,7 +953,7 @@ const Slider = props => {
|
|
|
957
953
|
hideLabel,
|
|
958
954
|
step = 1,
|
|
959
955
|
// TODO: Other properties are deleted below. Why isn't this one?
|
|
960
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
956
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
961
957
|
stepMultiplier: _stepMultiplier,
|
|
962
958
|
inputType = 'number',
|
|
963
959
|
invalidText,
|
|
@@ -969,7 +965,7 @@ const Slider = props => {
|
|
|
969
965
|
readOnly = false,
|
|
970
966
|
warn,
|
|
971
967
|
warnText,
|
|
972
|
-
translateWithId: t =
|
|
968
|
+
translateWithId: t = defaultTranslateWithId,
|
|
973
969
|
...other
|
|
974
970
|
} = props;
|
|
975
971
|
delete other.onRelease;
|
|
@@ -986,11 +982,11 @@ const Slider = props => {
|
|
|
986
982
|
} = state;
|
|
987
983
|
const showWarning = !readOnly && warn ||
|
|
988
984
|
// TODO: https://github.com/carbon-design-system/carbon/issues/18991#issuecomment-2795709637
|
|
989
|
-
// eslint-disable-next-line valid-typeof , no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/
|
|
985
|
+
// eslint-disable-next-line valid-typeof , no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
990
986
|
typeof correctedValue !== null && correctedPosition === HandlePosition.LOWER && isValid;
|
|
991
987
|
const showWarningUpper = !readOnly && warn ||
|
|
992
988
|
// TODO: https://github.com/carbon-design-system/carbon/issues/18991#issuecomment-2795709637
|
|
993
|
-
// eslint-disable-next-line valid-typeof, no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/
|
|
989
|
+
// eslint-disable-next-line valid-typeof, no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
994
990
|
typeof correctedValue !== null && correctedPosition === (twoHandles ? HandlePosition.UPPER : HandlePosition.LOWER) && (twoHandles ? isValidUpper : isValid);
|
|
995
991
|
return /*#__PURE__*/React.createElement(usePrefix.PrefixContext.Consumer, null, prefix => {
|
|
996
992
|
const labelId = `${id}-label`;
|
|
@@ -1198,7 +1194,7 @@ const Slider = props => {
|
|
|
1198
1194
|
as: "div",
|
|
1199
1195
|
role: "alert",
|
|
1200
1196
|
className: cx(`${prefix}--slider__status-msg`, `${prefix}--form-requirement`)
|
|
1201
|
-
}, t(translationIds.
|
|
1197
|
+
}, t(translationIds['carbon.slider.auto-correct-announcement'], {
|
|
1202
1198
|
correctedValue
|
|
1203
1199
|
})));
|
|
1204
1200
|
});
|
|
@@ -11,7 +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/
|
|
14
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
15
15
|
const HStack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
16
16
|
return /*#__PURE__*/React.createElement(Stack.Stack, _rollupPluginBabelHelpers.extends({}, props, {
|
|
17
17
|
ref: ref,
|
|
@@ -37,7 +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/
|
|
40
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
41
41
|
const Stack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
42
42
|
const {
|
|
43
43
|
as: BaseComponent = 'div',
|
|
@@ -11,7 +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/
|
|
14
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
15
15
|
const VStack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
16
16
|
return /*#__PURE__*/React.createElement(Stack.Stack, _rollupPluginBabelHelpers.extends({}, props, {
|
|
17
17
|
ref: ref,
|
|
@@ -152,7 +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/
|
|
155
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
156
156
|
const rowId = id ?? useId.useId('grid-input');
|
|
157
157
|
const selectedRow = React.useContext(GridSelectedRowStateContext);
|
|
158
158
|
const setSelectedRow = React.useContext(GridSelectedRowDispatchContext);
|
|
@@ -186,7 +186,7 @@ function StructuredListRow(props) {
|
|
|
186
186
|
ref: itemRef,
|
|
187
187
|
onClick: event => {
|
|
188
188
|
setSelectedRow?.(rowId);
|
|
189
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
189
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
190
190
|
onClick && onClick(event);
|
|
191
191
|
if (selection) {
|
|
192
192
|
// focus items only when selection is enabled
|
|
@@ -266,7 +266,7 @@ function StructuredListInput(props) {
|
|
|
266
266
|
value: row?.id ?? '',
|
|
267
267
|
onChange: event => {
|
|
268
268
|
setSelectedRow?.(event.target.value);
|
|
269
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
270
270
|
onChange && onChange(event);
|
|
271
271
|
},
|
|
272
272
|
id: id ?? defaultId,
|
|
@@ -80,7 +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/
|
|
83
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
84
84
|
console.error('dismissable property specified without also providing an onTabCloseRequest property.');
|
|
85
85
|
}
|
|
86
86
|
// The active index is used to track the element which has focus in our tablist
|
|
@@ -275,7 +275,7 @@ function TabList({
|
|
|
275
275
|
let hasSecondaryLabelTabs = false;
|
|
276
276
|
if (contained) {
|
|
277
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/
|
|
278
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
279
279
|
const _child = child;
|
|
280
280
|
return /*#__PURE__*/React.isValidElement(child) && !!_child.props.secondaryLabel;
|
|
281
281
|
});
|
|
@@ -389,7 +389,7 @@ function TabList({
|
|
|
389
389
|
inline: 'nearest'
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
392
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
393
393
|
}, []);
|
|
394
394
|
React.useEffect(() => {
|
|
395
395
|
//adding 1 in calculation for firefox support
|
|
@@ -410,7 +410,7 @@ function TabList({
|
|
|
410
410
|
setSelectedIndex(tabs.current.indexOf(tab));
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
413
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
414
414
|
}, []);
|
|
415
415
|
useIsomorphicEffect.default(() => {
|
|
416
416
|
if (ref.current) {
|
|
@@ -498,7 +498,7 @@ function TabList({
|
|
|
498
498
|
contained
|
|
499
499
|
}
|
|
500
500
|
}, /*#__PURE__*/React.cloneElement(
|
|
501
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
501
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
502
502
|
child, {
|
|
503
503
|
ref: node => {
|
|
504
504
|
tabs.current[index] = node;
|
|
@@ -633,7 +633,7 @@ function TabListVertical({
|
|
|
633
633
|
setSelectedIndex(tabs.current.indexOf(tab));
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
636
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
637
637
|
}, []);
|
|
638
638
|
React.useEffect(() => {
|
|
639
639
|
function handler() {
|
|
@@ -644,7 +644,7 @@ function TabListVertical({
|
|
|
644
644
|
if (containerTop && containerHeight) {
|
|
645
645
|
// scrolls so selected tab is in view
|
|
646
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/
|
|
647
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
648
648
|
ref.current && ref.current.scrollTo({
|
|
649
649
|
top: (selectedIndex - 1) * verticalTabHeight,
|
|
650
650
|
behavior: 'smooth'
|
|
@@ -700,7 +700,7 @@ function TabListVertical({
|
|
|
700
700
|
hasSecondaryLabel: false
|
|
701
701
|
}
|
|
702
702
|
}, /*#__PURE__*/React.cloneElement(
|
|
703
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
703
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
704
704
|
child, {
|
|
705
705
|
ref: node => {
|
|
706
706
|
tabs.current[index] = node;
|
|
@@ -777,7 +777,7 @@ function createLongPressBehavior(ref, direction, setScrollLeft) {
|
|
|
777
777
|
* Tab
|
|
778
778
|
*/
|
|
779
779
|
|
|
780
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
780
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
781
781
|
const Tab = /*#__PURE__*/React.forwardRef(({
|
|
782
782
|
as = 'button',
|
|
783
783
|
children,
|
|
@@ -813,7 +813,7 @@ const Tab = /*#__PURE__*/React.forwardRef(({
|
|
|
813
813
|
const panelId = `${baseId}-tabpanel-${index$1}`;
|
|
814
814
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
815
815
|
|
|
816
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
816
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
817
817
|
const isEllipsisActive = element => {
|
|
818
818
|
setIsEllipsisApplied(element.offsetHeight < element.scrollHeight);
|
|
819
819
|
return element.offsetHeight < element.scrollHeight;
|
|
@@ -1033,7 +1033,7 @@ Tab.propTypes = {
|
|
|
1033
1033
|
*/
|
|
1034
1034
|
|
|
1035
1035
|
const IconTabContext = /*#__PURE__*/React.createContext(false);
|
|
1036
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
1036
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
1037
1037
|
const IconTab = /*#__PURE__*/React.forwardRef(({
|
|
1038
1038
|
badgeIndicator,
|
|
1039
1039
|
children,
|
|
@@ -1105,7 +1105,7 @@ IconTab.propTypes = {
|
|
|
1105
1105
|
* TabPanel
|
|
1106
1106
|
*/
|
|
1107
1107
|
|
|
1108
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
1108
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
1109
1109
|
const TabPanel = /*#__PURE__*/React.forwardRef(({
|
|
1110
1110
|
children,
|
|
1111
1111
|
className: customClassName,
|
|
@@ -28,7 +28,7 @@ var index = require('../AILabel/index.js');
|
|
|
28
28
|
var utils = require('../../internal/utils.js');
|
|
29
29
|
|
|
30
30
|
var _Close;
|
|
31
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
31
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
32
32
|
const DismissibleTag = /*#__PURE__*/React.forwardRef(({
|
|
33
33
|
className,
|
|
34
34
|
decorator,
|
|
@@ -48,7 +48,7 @@ const DismissibleTag = /*#__PURE__*/React.forwardRef(({
|
|
|
48
48
|
}, forwardRef) => {
|
|
49
49
|
const prefix = usePrefix.usePrefix();
|
|
50
50
|
const tagLabelRef = React.useRef(null);
|
|
51
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
51
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
52
52
|
const tagId = id || `tag-${useId.useId()}`;
|
|
53
53
|
const tagClasses = cx(`${prefix}--tag--filter`, className);
|
|
54
54
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
@@ -68,7 +68,7 @@ const DismissibleTag = /*#__PURE__*/React.forwardRef(({
|
|
|
68
68
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
69
69
|
size: 'sm',
|
|
70
70
|
kind: 'inline'
|
|
71
|
-
}) :
|
|
71
|
+
}) : candidate;
|
|
72
72
|
const tooltipClasses = cx(`${prefix}--icon-tooltip`, `${prefix}--tag-label-tooltip`);
|
|
73
73
|
|
|
74
74
|
// Removing onClick from the spread operator
|
|
@@ -35,7 +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/
|
|
38
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
39
39
|
const OperationalTag = /*#__PURE__*/React.forwardRef(({
|
|
40
40
|
className,
|
|
41
41
|
disabled,
|
|
@@ -48,7 +48,7 @@ const OperationalTag = /*#__PURE__*/React.forwardRef(({
|
|
|
48
48
|
}, forwardRef) => {
|
|
49
49
|
const prefix = usePrefix.usePrefix();
|
|
50
50
|
const tagRef = React.useRef(null);
|
|
51
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
51
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
52
52
|
const tagId = id || `tag-${useId.useId()}`;
|
|
53
53
|
const tagClasses = cx(`${prefix}--tag--operational`, className);
|
|
54
54
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
@@ -24,7 +24,7 @@ var isEllipsisActive = require('./isEllipsisActive.js');
|
|
|
24
24
|
var mergeRefs = require('../../tools/mergeRefs.js');
|
|
25
25
|
var useControllableState = require('../../internal/useControllableState.js');
|
|
26
26
|
|
|
27
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
27
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
28
28
|
const SelectableTag = /*#__PURE__*/React.forwardRef(({
|
|
29
29
|
className,
|
|
30
30
|
disabled,
|
|
@@ -40,7 +40,7 @@ const SelectableTag = /*#__PURE__*/React.forwardRef(({
|
|
|
40
40
|
}, forwardRef) => {
|
|
41
41
|
const prefix = usePrefix.usePrefix();
|
|
42
42
|
const tagRef = React.useRef(null);
|
|
43
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
43
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
44
44
|
const tagId = id || `tag-${useId.useId()}`;
|
|
45
45
|
const [selectedTag, setSelectedTag] = useControllableState.useControllableState({
|
|
46
46
|
value: selected,
|
|
@@ -46,7 +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/
|
|
49
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
50
50
|
const TagBase = /*#__PURE__*/React.forwardRef(({
|
|
51
51
|
children,
|
|
52
52
|
className,
|
|
@@ -69,15 +69,15 @@ const TagBase = /*#__PURE__*/React.forwardRef(({
|
|
|
69
69
|
const prefix = usePrefix.usePrefix();
|
|
70
70
|
const tagRef = React.useRef(null);
|
|
71
71
|
if (filter) {
|
|
72
|
-
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/
|
|
72
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
73
73
|
console.warn('The `filter` prop for Tag has been deprecated and will be removed in the next major version. Use DismissibleTag instead.');
|
|
74
74
|
}
|
|
75
75
|
if (onClose) {
|
|
76
|
-
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/
|
|
76
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
77
77
|
console.warn('The `onClose` prop for Tag has been deprecated and will be removed in the next major version. Use DismissibleTag instead.');
|
|
78
78
|
}
|
|
79
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/
|
|
80
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
81
81
|
const tagId = id || `tag-${useId.useId()}`;
|
|
82
82
|
const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
|
|
83
83
|
React.useLayoutEffect(() => {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
11
11
|
const isEllipsisActive = element => {
|
|
12
12
|
if (element) {
|
|
13
13
|
return element?.offsetWidth < element?.scrollWidth;
|
|
@@ -12,7 +12,7 @@ var PropTypes = require('prop-types');
|
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var TextDirectionContext = require('./TextDirectionContext.js');
|
|
14
14
|
|
|
15
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
15
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
16
16
|
const TextBase = /*#__PURE__*/React.forwardRef(({
|
|
17
17
|
as,
|
|
18
18
|
children,
|
|
@@ -291,7 +291,7 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
291
291
|
const candidateIsAILabel = utils.isComponentElement(candidate, index.AILabel);
|
|
292
292
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
293
293
|
size: 'mini'
|
|
294
|
-
}) :
|
|
294
|
+
}) : candidate;
|
|
295
295
|
return /*#__PURE__*/React.createElement("div", {
|
|
296
296
|
className: formItemClasses
|
|
297
297
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -65,7 +65,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
|
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/
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
69
69
|
onTogglePasswordVisibility && onTogglePasswordVisibility(event);
|
|
70
70
|
};
|
|
71
71
|
const textInputClasses = cx(`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
@@ -155,10 +155,10 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
|
155
155
|
align = tooltipPosition;
|
|
156
156
|
}
|
|
157
157
|
if (!hidePasswordLabel || hidePasswordLabel.trim() === '') {
|
|
158
|
-
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/
|
|
158
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
159
159
|
console.warn('Warning: The "hidePasswordLabel" should not be blank.');
|
|
160
160
|
} else if (!showPasswordLabel || showPasswordLabel.trim() === '') {
|
|
161
|
-
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/
|
|
161
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
162
162
|
console.warn('Warning: The "showPasswordLabel" should not be blank.');
|
|
163
163
|
}
|
|
164
164
|
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, util.getTextInputProps({
|
|
@@ -188,7 +188,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
|
188
188
|
setInputType(type);
|
|
189
189
|
}, [type]);
|
|
190
190
|
|
|
191
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
191
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
192
192
|
const Icon = normalizedProps.icon;
|
|
193
193
|
return /*#__PURE__*/React.createElement("div", {
|
|
194
194
|
className: inputWrapperClasses
|
|
@@ -64,7 +64,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
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/
|
|
67
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
68
68
|
}, [value, defaultValue, enableCounter]);
|
|
69
69
|
const normalizedProps = useNormalizedInputProps.useNormalizedInputProps({
|
|
70
70
|
id,
|
|
@@ -193,7 +193,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
}, [ariaAnnouncement, prevAnnouncement]);
|
|
196
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
197
197
|
const Icon = normalizedProps.icon;
|
|
198
198
|
|
|
199
199
|
// AILabel is always size `mini`
|
|
@@ -201,7 +201,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
201
201
|
const candidateIsAILabel = utils.isComponentElement(candidate, index.AILabel);
|
|
202
202
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
203
203
|
size: 'mini'
|
|
204
|
-
}) :
|
|
204
|
+
}) : candidate;
|
|
205
205
|
return /*#__PURE__*/React.createElement("div", {
|
|
206
206
|
className: inputWrapperClasses
|
|
207
207
|
}, !inline ? labelWrapper : /*#__PURE__*/React.createElement("div", {
|
|
@@ -19,7 +19,7 @@ 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/
|
|
22
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
23
23
|
const GlobalTheme = /*#__PURE__*/React.forwardRef(({
|
|
24
24
|
children,
|
|
25
25
|
theme
|
|
@@ -30,7 +30,7 @@ const GlobalTheme = /*#__PURE__*/React.forwardRef(({
|
|
|
30
30
|
};
|
|
31
31
|
}, [theme]);
|
|
32
32
|
const childrenWithProps = /*#__PURE__*/React.cloneElement(
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
34
34
|
children, {
|
|
35
35
|
ref: ref
|
|
36
36
|
});
|
|
@@ -73,7 +73,7 @@ function Theme({
|
|
|
73
73
|
isDark
|
|
74
74
|
};
|
|
75
75
|
}, [theme]);
|
|
76
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
77
77
|
const BaseComponentAsAny = BaseComponent;
|
|
78
78
|
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
79
79
|
value: value
|
|
@@ -207,7 +207,7 @@ ClickableTile.propTypes = {
|
|
|
207
207
|
*/
|
|
208
208
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
209
209
|
};
|
|
210
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
210
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
211
211
|
const SelectableTile = /*#__PURE__*/React.forwardRef(({
|
|
212
212
|
children,
|
|
213
213
|
className,
|
|
@@ -276,7 +276,7 @@ const SelectableTile = /*#__PURE__*/React.forwardRef(({
|
|
|
276
276
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
277
277
|
size: 'xs',
|
|
278
278
|
ref: decoratorRef
|
|
279
|
-
}) :
|
|
279
|
+
}) : candidate;
|
|
280
280
|
return (
|
|
281
281
|
/*#__PURE__*/
|
|
282
282
|
// eslint-disable-next-line jsx-a11y/interactive-supports-focus
|
|
@@ -503,7 +503,7 @@ const ExpandableTile = /*#__PURE__*/React.forwardRef(({
|
|
|
503
503
|
const candidateIsAILabel = utils.isComponentElement(candidate, index$1.AILabel);
|
|
504
504
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
505
505
|
size: 'xs'
|
|
506
|
-
}) :
|
|
506
|
+
}) : candidate;
|
|
507
507
|
return interactive ? /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
508
508
|
ref: ref,
|
|
509
509
|
className: interactiveClassNames
|
|
@@ -116,7 +116,7 @@ const TimePicker = frFn((props, ref) => {
|
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
118
|
const mappedChildren = React.Children.map(children, pickerSelect => {
|
|
119
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
120
120
|
const item = pickerSelect;
|
|
121
121
|
if (item) {
|
|
122
122
|
return /*#__PURE__*/React.cloneElement(item, {
|
|
@@ -29,7 +29,7 @@ function ToggletipLabel({
|
|
|
29
29
|
}) {
|
|
30
30
|
const prefix = usePrefix.usePrefix();
|
|
31
31
|
const className = cx(`${prefix}--toggletip-label`, customClassName);
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
33
33
|
const BaseComponentAsAny = BaseComponent;
|
|
34
34
|
return /*#__PURE__*/React.createElement(BaseComponentAsAny, _rollupPluginBabelHelpers.extends({
|
|
35
35
|
className: className
|
|
@@ -136,7 +136,7 @@ function Toggletip({
|
|
|
136
136
|
const eventType = 'PointerEvent' in window ? 'pointerdown' : 'mousedown';
|
|
137
137
|
const handleOutsideClick = event => {
|
|
138
138
|
const node = event.target;
|
|
139
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
140
140
|
if (open && node && !ref.current.contains(node)) {
|
|
141
141
|
setOpen(false);
|
|
142
142
|
}
|
|
@@ -169,7 +169,7 @@ function Toggletip({
|
|
|
169
169
|
// Get all the properties from Popover except for "open".
|
|
170
170
|
// The Typescript types for PropTypes are really messed up so we need lots of
|
|
171
171
|
// casting. It will be great when we can finally get rid of PropTypes altogether.
|
|
172
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
173
173
|
const {
|
|
174
174
|
open,
|
|
175
175
|
...popoverNonOpenPropTypes
|
|
@@ -197,7 +197,7 @@ const ToggletipButton = /*#__PURE__*/React.forwardRef(function ToggletipButton({
|
|
|
197
197
|
const toggletip = useToggletip();
|
|
198
198
|
const prefix = usePrefix.usePrefix();
|
|
199
199
|
const className = cx(`${prefix}--toggletip-button`, customClassName);
|
|
200
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
200
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
201
201
|
const ComponentToggle = BaseComponent ?? 'button';
|
|
202
202
|
if (ComponentToggle !== 'button') {
|
|
203
203
|
return /*#__PURE__*/React.createElement(ComponentToggle, _rollupPluginBabelHelpers.extends({}, toggletip?.onClick, {
|
|
@@ -50,7 +50,7 @@ const DefinitionTooltip = ({
|
|
|
50
50
|
setOpen(false);
|
|
51
51
|
},
|
|
52
52
|
onMouseEnter: () => {
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
54
54
|
openOnHover ? setOpen(true) : null;
|
|
55
55
|
},
|
|
56
56
|
onFocus: () => {
|