@carbon/react 1.92.1 → 1.93.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 +874 -838
- 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/CodeSnippet/CodeSnippet.js +9 -50
- 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 +19 -25
- package/es/components/DataTable/DataTable.d.ts +27 -16
- package/es/components/DataTable/DataTable.js +40 -39
- 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.d.ts +4 -0
- 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 +7 -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 +17 -23
- 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 +10 -9
- 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/CodeSnippet/CodeSnippet.js +8 -49
- 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 +18 -24
- package/lib/components/DataTable/DataTable.d.ts +27 -16
- package/lib/components/DataTable/DataTable.js +40 -39
- 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.d.ts +4 -0
- 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 +7 -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 +16 -22
- 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 +10 -9
- 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
|
@@ -13,8 +13,8 @@ export interface SortRowParams {
|
|
|
13
13
|
locale: string;
|
|
14
14
|
compare: (a: string | number, b: string | number, locale?: string) => number;
|
|
15
15
|
}
|
|
16
|
-
export type SortRowFn = (cellA: any, // eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
17
|
-
cellB: any, // eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
16
|
+
export type SortRowFn = (cellA: any, // eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
17
|
+
cellB: any, // eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
18
18
|
options: SortRowParams) => number;
|
|
19
19
|
interface Props {
|
|
20
20
|
locale?: string;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { sortStates } from './sortStates.js';
|
|
9
9
|
import { sortRows } from '../tools/sorting.js';
|
|
10
10
|
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
12
12
|
|
|
13
13
|
const initialSortState = sortStates.NONE;
|
|
14
14
|
|
|
@@ -13,7 +13,7 @@ import { sortStates } from '../state/sortStates.js';
|
|
|
13
13
|
* type, the default sort algorithm will be used for those types. Otherwise, the
|
|
14
14
|
* values will be converted to strings for comparison.
|
|
15
15
|
*/
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
17
17
|
const compare = (a, b, locale = 'en') => {
|
|
18
18
|
// prevent multiple null values in one column (sorting breaks)
|
|
19
19
|
if (a === null) a = '';
|
|
@@ -169,7 +169,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
169
169
|
isFluid
|
|
170
170
|
} = useContext(FormContext);
|
|
171
171
|
const [hasInput, setHasInput] = useState(false);
|
|
172
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
173
173
|
const startInputField = useCallback(node => {
|
|
174
174
|
if (node !== null) {
|
|
175
175
|
startInputField.current = node;
|
|
@@ -190,9 +190,9 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
190
190
|
onClose(selectedDates, dateStr, instance);
|
|
191
191
|
}
|
|
192
192
|
},
|
|
193
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
193
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
194
194
|
[onClose]);
|
|
195
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
195
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
196
196
|
const onCalendarClose = (selectedDates, dateStr, instance, e) => {
|
|
197
197
|
if (e && e.type === 'clickOutside') {
|
|
198
198
|
return;
|
|
@@ -231,9 +231,9 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
231
231
|
[String(className)]: className
|
|
232
232
|
});
|
|
233
233
|
|
|
234
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
234
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
235
235
|
const childrenWithProps = React.Children.toArray(children).map(
|
|
236
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
236
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
237
237
|
(child, index) => {
|
|
238
238
|
if (index === 0 && child.type === /*#__PURE__*/React.createElement(DatePickerInput, child.props).type) {
|
|
239
239
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
@@ -348,7 +348,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
348
348
|
const {
|
|
349
349
|
current: end
|
|
350
350
|
} = endInputField;
|
|
351
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
351
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
352
352
|
const flatpickerConfig = {
|
|
353
353
|
inline: inline ?? false,
|
|
354
354
|
onClose: onCalendarClose,
|
|
@@ -524,7 +524,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
524
524
|
// this hook allows consumers to access the flatpickr calendar
|
|
525
525
|
// instance for cases where functions like open() or close()
|
|
526
526
|
// need to be imperatively called on the calendar
|
|
527
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
527
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
528
528
|
useImperativeHandle(ref, () => ({
|
|
529
529
|
get calendar() {
|
|
530
530
|
return calendarRef.current;
|
|
@@ -581,7 +581,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
581
581
|
endInputField.current.value = '';
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
584
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
585
585
|
}, [value]);
|
|
586
586
|
useEffect(() => {
|
|
587
587
|
const handleMouseDown = event => {
|
|
@@ -590,7 +590,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
590
590
|
closeCalendar();
|
|
591
591
|
}
|
|
592
592
|
};
|
|
593
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
593
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
594
594
|
const closeCalendar = event => {
|
|
595
595
|
calendarRef.current?.close();
|
|
596
596
|
// Remove focus from endDate calendar input
|
|
@@ -20,7 +20,7 @@ import { deprecate } from '../../prop-types/deprecate.js';
|
|
|
20
20
|
import { AILabel } from '../AILabel/index.js';
|
|
21
21
|
import { isComponentElement } from '../../internal/utils.js';
|
|
22
22
|
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
24
24
|
|
|
25
25
|
let didWarnAboutDatePickerInputValue = false;
|
|
26
26
|
const DatePickerInput = /*#__PURE__*/React.forwardRef(function DatePickerInput(props, ref) {
|
|
@@ -96,7 +96,7 @@ const DatePickerInput = /*#__PURE__*/React.forwardRef(function DatePickerInput(p
|
|
|
96
96
|
});
|
|
97
97
|
const datePickerInputHelperId = !helperText ? undefined : `datepicker-input-helper-text-${datePickerInputInstanceId}`;
|
|
98
98
|
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
100
100
|
const inputProps = {
|
|
101
101
|
...rest,
|
|
102
102
|
...datePickerInputProps,
|
|
@@ -115,7 +115,7 @@ const DatePickerInput = /*#__PURE__*/React.forwardRef(function DatePickerInput(p
|
|
|
115
115
|
const candidateIsAILabel = isComponentElement(candidate, AILabel);
|
|
116
116
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/cloneElement(candidate, {
|
|
117
117
|
size: 'mini'
|
|
118
|
-
}) :
|
|
118
|
+
}) : candidate;
|
|
119
119
|
return /*#__PURE__*/React.createElement("div", {
|
|
120
120
|
className: containerClasses
|
|
121
121
|
}, labelText && /*#__PURE__*/React.createElement(Text, {
|
|
@@ -202,14 +202,14 @@ DatePickerInput.propTypes = {
|
|
|
202
202
|
/**
|
|
203
203
|
* Provide a regular expression that the input value must match
|
|
204
204
|
*/
|
|
205
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
205
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
206
206
|
pattern: (props, propName, componentName) => {
|
|
207
207
|
if (props[propName] === undefined) {
|
|
208
208
|
return;
|
|
209
209
|
}
|
|
210
210
|
try {
|
|
211
211
|
new RegExp(props[propName]);
|
|
212
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
212
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
213
213
|
} catch (e) {
|
|
214
214
|
return new Error(`Invalid value of prop '${propName}' supplied to '${componentName}', it should be a valid regular expression`);
|
|
215
215
|
}
|
|
@@ -93,7 +93,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(({
|
|
|
93
93
|
ref.current.close();
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
96
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
97
97
|
}, [modal, open]);
|
|
98
98
|
useEffect(() => {
|
|
99
99
|
if (!open && focusAfterCloseRef) {
|
|
@@ -124,7 +124,7 @@ const Dialog = /*#__PURE__*/React.forwardRef(({
|
|
|
124
124
|
ref.current.setAttribute('aria-labelledby', title.id);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
127
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
128
128
|
}, [open, ariaLabel, ariaLabelledBy, prefix]);
|
|
129
129
|
return /*#__PURE__*/React.createElement(DialogContext.Provider, {
|
|
130
130
|
value: contextValue
|
|
@@ -229,7 +229,7 @@ const DialogControls = /*#__PURE__*/React.forwardRef(({
|
|
|
229
229
|
const prefix = usePrefix();
|
|
230
230
|
return (
|
|
231
231
|
/*#__PURE__*/
|
|
232
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
232
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
233
233
|
// @ts-ignore
|
|
234
234
|
React.createElement("div", _extends({
|
|
235
235
|
className: `${prefix}--dialog__header-controls`,
|
|
@@ -258,7 +258,7 @@ const DialogCloseButton = /*#__PURE__*/React.forwardRef(({
|
|
|
258
258
|
const prefix = usePrefix();
|
|
259
259
|
return (
|
|
260
260
|
/*#__PURE__*/
|
|
261
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
261
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
262
262
|
// @ts-ignore
|
|
263
263
|
React.createElement(IconButton, _extends({
|
|
264
264
|
kind: "ghost",
|
|
@@ -495,7 +495,7 @@ const DialogFooter = /*#__PURE__*/React.forwardRef(({
|
|
|
495
495
|
onClick: onButtonClick
|
|
496
496
|
}, i) => /*#__PURE__*/React.createElement(Button, {
|
|
497
497
|
key: `${buttonText}-${i}`
|
|
498
|
-
// eslint-disable-next-line jsx-a11y/no-autofocus -- https://github.com/carbon-design-system/carbon/issues/
|
|
498
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
499
499
|
,
|
|
500
500
|
autoFocus: danger,
|
|
501
501
|
kind: "secondary",
|
|
@@ -505,7 +505,7 @@ const DialogFooter = /*#__PURE__*/React.forwardRef(({
|
|
|
505
505
|
ref: danger ? setSecondaryButtonRef : undefined,
|
|
506
506
|
disabled: loadingActive,
|
|
507
507
|
kind: "secondary"
|
|
508
|
-
// eslint-disable-next-line jsx-a11y/no-autofocus -- https://github.com/carbon-design-system/carbon/issues/
|
|
508
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
509
509
|
,
|
|
510
510
|
autoFocus: danger,
|
|
511
511
|
onClick: onSecondaryButtonClick
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React, { type HTMLAttributes, type ReactNode, type Ref } from 'react';
|
|
8
8
|
import { UseSelectProps } from 'downshift';
|
|
9
9
|
import { type ListBoxMenuIconTranslationKey, type ListBoxSize, type ListBoxType } from '../ListBox';
|
|
10
|
-
import { TranslateWithId } from '../../types/common';
|
|
10
|
+
import type { TranslateWithId } from '../../types/common';
|
|
11
11
|
type ExcludedAttributes = 'id' | 'onChange';
|
|
12
12
|
export interface OnChangeData<ItemType> {
|
|
13
13
|
selectedItem: ItemType | null;
|
|
@@ -138,7 +138,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
138
138
|
}
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
141
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
142
142
|
}, [floatingStyles, autoAlign, refs.floating]);
|
|
143
143
|
const prefix = usePrefix();
|
|
144
144
|
const {
|
|
@@ -154,7 +154,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
154
154
|
}
|
|
155
155
|
}, [onChange]);
|
|
156
156
|
|
|
157
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
157
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
158
158
|
const isItemDisabled = useCallback((item, _index) => {
|
|
159
159
|
const isObject = item !== null && typeof item === 'object';
|
|
160
160
|
return isObject && 'disabled' in item && item.disabled === true;
|
|
@@ -164,7 +164,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
164
164
|
highlightedIndex
|
|
165
165
|
} = changes;
|
|
166
166
|
if (highlightedIndex !== undefined && highlightedIndex > -1 &&
|
|
167
|
-
// eslint-disable-next-line valid-typeof , no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/
|
|
167
|
+
// eslint-disable-next-line valid-typeof , no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
168
168
|
typeof window !== undefined) {
|
|
169
169
|
const itemArray = document.querySelectorAll(`li.${prefix}--list-box__menu-item[role="option"]`);
|
|
170
170
|
const highlightedItem = itemArray[highlightedIndex];
|
|
@@ -187,7 +187,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
187
187
|
onHighlightedIndexChange,
|
|
188
188
|
...downshiftProps
|
|
189
189
|
}),
|
|
190
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
190
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
191
191
|
[items, itemToString, initialSelectedItem, onSelectedItemChange, stateReducer, isItemDisabled, onHighlightedIndexChange, downshiftProps]);
|
|
192
192
|
const dropdownInstanceId = useId();
|
|
193
193
|
|
|
@@ -279,7 +279,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
279
279
|
toggleButtonProps.onKeyDown(evt);
|
|
280
280
|
}
|
|
281
281
|
},
|
|
282
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
282
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
283
283
|
[isTyping, currTimer, toggleButtonProps]);
|
|
284
284
|
const readOnlyEventHandlers = useMemo(() => {
|
|
285
285
|
if (readOnly) {
|
|
@@ -313,7 +313,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
313
313
|
const candidateIsAILabel = isComponentElement(candidate, AILabel);
|
|
314
314
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/cloneElement(candidate, {
|
|
315
315
|
size: 'mini'
|
|
316
|
-
}) :
|
|
316
|
+
}) : candidate;
|
|
317
317
|
const allLabelProps = getLabelProps();
|
|
318
318
|
const labelProps = /*#__PURE__*/isValidElement(titleText) ? {
|
|
319
319
|
id: allLabelProps.id
|
|
@@ -354,7 +354,7 @@ const Dropdown = /*#__PURE__*/React.forwardRef(({
|
|
|
354
354
|
}), /*#__PURE__*/React.createElement("span", {
|
|
355
355
|
className: `${prefix}--list-box__label`
|
|
356
356
|
}, selectedItem ? renderSelectedItem ? renderSelectedItem(selectedItem) : itemToString(selectedItem) :
|
|
357
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
357
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
358
358
|
label), /*#__PURE__*/React.createElement(ListBox.MenuIcon, {
|
|
359
359
|
isOpen: isOpen,
|
|
360
360
|
translateWithId: translateWithId
|
|
@@ -511,7 +511,7 @@ Dropdown.propTypes = {
|
|
|
511
511
|
*/
|
|
512
512
|
titleText: PropTypes.node.isRequired,
|
|
513
513
|
/**
|
|
514
|
-
*
|
|
514
|
+
* Translates component strings using your i18n tool.
|
|
515
515
|
*/
|
|
516
516
|
translateWithId: PropTypes.func,
|
|
517
517
|
/**
|
|
@@ -9,7 +9,7 @@ import { createContext } from 'react';
|
|
|
9
9
|
|
|
10
10
|
const ErrorBoundaryContext = /*#__PURE__*/createContext({
|
|
11
11
|
log(error, info) {
|
|
12
|
-
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/
|
|
12
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
13
13
|
console.log(info.componentStack);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
@@ -20,7 +20,7 @@ import '../Text/TextDirection.js';
|
|
|
20
20
|
import { useId } from '../../internal/useId.js';
|
|
21
21
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
22
22
|
|
|
23
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
23
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
24
24
|
const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
25
25
|
accept,
|
|
26
26
|
buttonKind,
|
|
@@ -45,7 +45,7 @@ const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
|
45
45
|
const [fileItems, setFileItems] = useState([]);
|
|
46
46
|
const [legacyFileNames, setLegacyFileNames] = useState([]);
|
|
47
47
|
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
49
49
|
const [fileObjects, setFileObjects] = useState(new Map());
|
|
50
50
|
const nodes = [];
|
|
51
51
|
const createFileItem = file => ({
|
|
@@ -99,7 +99,7 @@ const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
102
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
103
103
|
[enhancedFileUploaderEnabled, fileItems, legacyFileNames, multiple, onChange]);
|
|
104
104
|
const handleClick = useCallback((evt, {
|
|
105
105
|
index,
|
|
@@ -156,7 +156,7 @@ const FileUploader = /*#__PURE__*/React.forwardRef(({
|
|
|
156
156
|
uploaderButton.current?.focus?.();
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
159
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
160
160
|
[enhancedFileUploaderEnabled, fileItems, legacyFileNames, onDelete, onChange, onClick]);
|
|
161
161
|
useImperativeHandle(ref, () => ({
|
|
162
162
|
clearFiles() {
|
|
@@ -36,7 +36,7 @@ function FileUploaderButton({
|
|
|
36
36
|
const prefix = usePrefix();
|
|
37
37
|
const [labelText, setLabelText] = useState(ownerLabelText);
|
|
38
38
|
const [prevOwnerLabelText, setPrevOwnerLabelText] = useState(ownerLabelText);
|
|
39
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
39
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
40
40
|
const {
|
|
41
41
|
current: inputId
|
|
42
42
|
} = useRef(id || useId());
|
|
@@ -33,7 +33,7 @@ function FileUploaderDropContainer({
|
|
|
33
33
|
}) {
|
|
34
34
|
const prefix = usePrefix();
|
|
35
35
|
const inputRef = useRef(null);
|
|
36
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
36
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
37
37
|
const {
|
|
38
38
|
current: uid
|
|
39
39
|
} = useRef(id || useId());
|
|
@@ -36,7 +36,7 @@ function FileUploaderItem({
|
|
|
36
36
|
const textRef = useRef(null);
|
|
37
37
|
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
38
38
|
const prefix = usePrefix();
|
|
39
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
39
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
40
40
|
const {
|
|
41
41
|
current: id
|
|
42
42
|
} = useRef(uuid || useId());
|
|
@@ -50,7 +50,7 @@ function FileUploaderItem({
|
|
|
50
50
|
return name?.replace(/\s+/g, '');
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
54
54
|
const isEllipsisActive = element => {
|
|
55
55
|
setIsEllipsisApplied(element.offsetWidth < element.scrollWidth);
|
|
56
56
|
return element.offsetWidth < element.scrollWidth;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2022
|
|
2
|
+
* Copyright IBM Corp. 2022, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React, { ComponentType } from 'react';
|
|
7
|
+
import React, { ComponentType, type ComponentProps } from 'react';
|
|
8
|
+
import ComboBox from '../ComboBox';
|
|
8
9
|
import { ComboBoxProps } from '../ComboBox/ComboBox';
|
|
9
10
|
type ItemToStringHandler<ItemType> = (item: ItemType | null) => string;
|
|
10
11
|
interface OnChangeData<ItemType> {
|
|
11
12
|
selectedItem: ItemType | null | undefined;
|
|
12
13
|
inputValue?: string | null;
|
|
13
14
|
}
|
|
14
|
-
export interface FluidComboBoxProps<ItemType> extends ComboBoxProps<ItemType> {
|
|
15
|
+
export interface FluidComboBoxProps<ItemType> extends ComboBoxProps<ItemType>, Pick<ComponentProps<typeof ComboBox>, 'translateWithId'> {
|
|
15
16
|
/**
|
|
16
17
|
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
17
18
|
*/
|
|
@@ -85,10 +86,6 @@ export interface FluidComboBoxProps<ItemType> extends ComboBoxProps<ItemType> {
|
|
|
85
86
|
* visiting this control
|
|
86
87
|
*/
|
|
87
88
|
titleText?: React.ReactNode;
|
|
88
|
-
/**
|
|
89
|
-
* Callback function for translating ListBoxMenuIcon SVG title
|
|
90
|
-
*/
|
|
91
|
-
translateWithId?: (id: string) => string;
|
|
92
89
|
/**
|
|
93
90
|
* Specify whether the control is currently in warning state
|
|
94
91
|
*/
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2022
|
|
2
|
+
* Copyright IBM Corp. 2022, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { DropdownProps } from '../Dropdown';
|
|
7
|
+
import React, { type ComponentProps } from 'react';
|
|
8
|
+
import Dropdown, { DropdownProps } from '../Dropdown';
|
|
9
9
|
export interface OnChangeData<ItemType> {
|
|
10
10
|
selectedItem: ItemType | null;
|
|
11
11
|
}
|
|
12
|
-
export interface FluidDropdownProps<ItemType> extends DropdownProps<ItemType> {
|
|
12
|
+
export interface FluidDropdownProps<ItemType> extends DropdownProps<ItemType>, Pick<ComponentProps<typeof Dropdown>, 'translateWithId'> {
|
|
13
13
|
/**
|
|
14
14
|
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
15
15
|
*/
|
|
@@ -84,10 +84,6 @@ export interface FluidDropdownProps<ItemType> extends DropdownProps<ItemType> {
|
|
|
84
84
|
* visiting this control
|
|
85
85
|
*/
|
|
86
86
|
titleText: React.ReactNode;
|
|
87
|
-
/**
|
|
88
|
-
* Callback function for translating ListBoxMenuIcon SVG title
|
|
89
|
-
*/
|
|
90
|
-
translateWithId?: (id: string) => string;
|
|
91
87
|
/**
|
|
92
88
|
* Specify whether the control is currently in warning state
|
|
93
89
|
*/
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React, { FunctionComponent } from 'react';
|
|
7
|
+
import React, { FunctionComponent, type ComponentProps } from 'react';
|
|
8
8
|
import type { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
|
|
9
|
-
import { type FilterableMultiSelectProps } from '../MultiSelect';
|
|
9
|
+
import { type FilterableMultiSelectProps, type MultiSelect } from '../MultiSelect';
|
|
10
10
|
interface OnChangeData<ItemType> {
|
|
11
11
|
selectedItems: ItemType[] | null;
|
|
12
12
|
}
|
|
13
|
-
export interface FluidFilterableMultiSelectProps<ItemType> extends FilterableMultiSelectProps<ItemType> {
|
|
13
|
+
export interface FluidFilterableMultiSelectProps<ItemType> extends FilterableMultiSelectProps<ItemType>, Pick<ComponentProps<typeof MultiSelect>, 'translateWithId'> {
|
|
14
14
|
/**
|
|
15
15
|
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
16
16
|
*/
|
|
@@ -123,10 +123,6 @@ export interface FluidFilterableMultiSelectProps<ItemType> extends FilterableMul
|
|
|
123
123
|
* visiting this control
|
|
124
124
|
*/
|
|
125
125
|
titleText?: React.ReactNode;
|
|
126
|
-
/**
|
|
127
|
-
* Callback function for translating ListBoxMenuIcon SVG title
|
|
128
|
-
*/
|
|
129
|
-
translateWithId?: (id: string) => string;
|
|
130
126
|
/**
|
|
131
127
|
* Specify title to show title on hover
|
|
132
128
|
*/
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { type MultiSelectProps } from '../MultiSelect';
|
|
7
|
+
import React, { type ComponentProps } from 'react';
|
|
8
|
+
import { MultiSelect, type MultiSelectProps } from '../MultiSelect';
|
|
9
9
|
import { UseSelectProps } from 'downshift';
|
|
10
10
|
interface OnChangeData<ItemType> {
|
|
11
11
|
selectedItems: ItemType[] | null;
|
|
12
12
|
}
|
|
13
|
-
export interface FluidMultiSelectProps<ItemType> extends MultiSelectProps<ItemType> {
|
|
13
|
+
export interface FluidMultiSelectProps<ItemType> extends MultiSelectProps<ItemType>, Pick<ComponentProps<typeof MultiSelect>, 'translateWithId'> {
|
|
14
14
|
/**
|
|
15
15
|
* Specify an optional className to be applied to the outer FluidForm wrapper
|
|
16
16
|
*/
|
|
@@ -128,10 +128,6 @@ export interface FluidMultiSelectProps<ItemType> extends MultiSelectProps<ItemTy
|
|
|
128
128
|
* visiting this control
|
|
129
129
|
*/
|
|
130
130
|
titleText?: React.ReactNode;
|
|
131
|
-
/**
|
|
132
|
-
* Callback function for translating ListBoxMenuIcon SVG title
|
|
133
|
-
*/
|
|
134
|
-
translateWithId?: (id: string) => string;
|
|
135
131
|
/**
|
|
136
132
|
* Specify title to show title on hover
|
|
137
133
|
*/
|
|
@@ -30,14 +30,14 @@ const FluidMultiSelect = /*#__PURE__*/React.forwardRef(function FluidMultiSelect
|
|
|
30
30
|
}
|
|
31
31
|
}, isFilterable ?
|
|
32
32
|
/*#__PURE__*/
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
34
34
|
// @ts-ignore
|
|
35
35
|
React.createElement(FilterableMultiSelect, _extends({
|
|
36
36
|
ref: ref,
|
|
37
37
|
className: classNames
|
|
38
38
|
}, other)) :
|
|
39
39
|
/*#__PURE__*/
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
41
41
|
// @ts-ignore
|
|
42
42
|
React.createElement(MultiSelect, _extends({
|
|
43
43
|
ref: ref,
|
|
@@ -189,7 +189,7 @@ FluidMultiSelect.propTypes = {
|
|
|
189
189
|
*/
|
|
190
190
|
titleText: PropTypes.node,
|
|
191
191
|
/**
|
|
192
|
-
*
|
|
192
|
+
* Translates component strings using your i18n tool.
|
|
193
193
|
*/
|
|
194
194
|
translateWithId: PropTypes.func,
|
|
195
195
|
/**
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2022
|
|
2
|
+
* Copyright IBM Corp. 2022, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { type ComponentProps } from 'react';
|
|
8
|
+
import { NumberInput } from '../NumberInput';
|
|
8
9
|
import { type NumberFormatOptions } from '@carbon/utilities';
|
|
9
|
-
export interface FluidNumberInputProps {
|
|
10
|
+
export interface FluidNumberInputProps extends Pick<ComponentProps<typeof NumberInput>, 'translateWithId'> {
|
|
10
11
|
/**
|
|
11
12
|
* `true` to allow empty string.
|
|
12
13
|
*/
|
|
@@ -108,10 +109,6 @@ export interface FluidNumberInputProps {
|
|
|
108
109
|
* Specify how much the values should increase/decrease upon clicking on up/down button
|
|
109
110
|
*/
|
|
110
111
|
step?: number;
|
|
111
|
-
/**
|
|
112
|
-
* Provide custom text for the component for each translation id
|
|
113
|
-
*/
|
|
114
|
-
translateWithId?: (id: string) => string;
|
|
115
112
|
/**
|
|
116
113
|
* **Experimental**: Specify if the input should be of type text or number.
|
|
117
114
|
* Use type="text" with `locale`, `formatOptions`, and guide user input with
|
|
@@ -15,7 +15,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
15
15
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
16
16
|
import { NumberFormatOptionsPropType } from '../NumberInput/NumberFormatPropTypes.js';
|
|
17
17
|
|
|
18
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
18
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
19
19
|
const FluidNumberInput = /*#__PURE__*/React.forwardRef(({
|
|
20
20
|
className,
|
|
21
21
|
...other
|
|
@@ -128,7 +128,7 @@ FluidNumberInput.propTypes = {
|
|
|
128
128
|
*/
|
|
129
129
|
step: PropTypes.number,
|
|
130
130
|
/**
|
|
131
|
-
*
|
|
131
|
+
* Translates component strings using your i18n tool.
|
|
132
132
|
*/
|
|
133
133
|
translateWithId: PropTypes.func,
|
|
134
134
|
/**
|
|
@@ -14,7 +14,7 @@ import '../Search/Search.Skeleton.js';
|
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
15
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
16
16
|
|
|
17
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
17
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
18
18
|
const FluidSearch = /*#__PURE__*/React.forwardRef(({
|
|
19
19
|
className,
|
|
20
20
|
...other
|
|
@@ -14,7 +14,7 @@ import '../Select/Select.Skeleton.js';
|
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
15
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
16
16
|
|
|
17
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
17
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
18
18
|
const FluidSelect = /*#__PURE__*/React.forwardRef(({
|
|
19
19
|
className,
|
|
20
20
|
children,
|
|
@@ -16,7 +16,7 @@ import PasswordInput from '../TextInput/PasswordInput.js';
|
|
|
16
16
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
17
17
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
18
18
|
|
|
19
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
19
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
20
20
|
const FluidTextInput = /*#__PURE__*/React.forwardRef(({
|
|
21
21
|
className,
|
|
22
22
|
isPassword,
|