@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
|
@@ -22,20 +22,22 @@ var clamp = require('../../internal/clamp.js');
|
|
|
22
22
|
|
|
23
23
|
var _CaretRight, _CaretLeft, _option;
|
|
24
24
|
const translationIds = {
|
|
25
|
-
'carbon.pagination-nav.next': '
|
|
26
|
-
'carbon.pagination-nav.previous': '
|
|
27
|
-
'carbon.pagination-nav.item': '
|
|
28
|
-
'carbon.pagination-nav.active': '
|
|
29
|
-
'carbon.pagination-nav.of': 'of'
|
|
25
|
+
'carbon.pagination-nav.next': 'carbon.pagination-nav.next',
|
|
26
|
+
'carbon.pagination-nav.previous': 'carbon.pagination-nav.previous',
|
|
27
|
+
'carbon.pagination-nav.item': 'carbon.pagination-nav.item',
|
|
28
|
+
'carbon.pagination-nav.active': 'carbon.pagination-nav.active',
|
|
29
|
+
'carbon.pagination-nav.of': 'carbon.pagination-nav.of'
|
|
30
|
+
};
|
|
31
|
+
const defaultTranslations = {
|
|
32
|
+
[translationIds['carbon.pagination-nav.next']]: 'Next',
|
|
33
|
+
[translationIds['carbon.pagination-nav.previous']]: 'Previous',
|
|
34
|
+
[translationIds['carbon.pagination-nav.item']]: 'Page',
|
|
35
|
+
[translationIds['carbon.pagination-nav.active']]: 'Active',
|
|
36
|
+
[translationIds['carbon.pagination-nav.of']]: 'of'
|
|
37
|
+
};
|
|
38
|
+
const defaultTranslateWithId = messageId => {
|
|
39
|
+
return defaultTranslations[messageId];
|
|
30
40
|
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Message ids that will be passed to translateWithId().
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
function translateWithId(messageId) {
|
|
37
|
-
return translationIds[messageId];
|
|
38
|
-
}
|
|
39
41
|
|
|
40
42
|
// https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
|
|
41
43
|
function usePrevious(value) {
|
|
@@ -92,7 +94,7 @@ function PaginationItem({
|
|
|
92
94
|
page,
|
|
93
95
|
isActive,
|
|
94
96
|
onClick,
|
|
95
|
-
translateWithId: t =
|
|
97
|
+
translateWithId: t = defaultTranslateWithId
|
|
96
98
|
}) {
|
|
97
99
|
const prefix = usePrefix.usePrefix();
|
|
98
100
|
const itemLabel = t('carbon.pagination-nav.item');
|
|
@@ -115,7 +117,7 @@ function PaginationOverflow({
|
|
|
115
117
|
count = NaN,
|
|
116
118
|
onSelect,
|
|
117
119
|
disableOverflow,
|
|
118
|
-
translateWithId: t =
|
|
120
|
+
translateWithId: t = defaultTranslateWithId
|
|
119
121
|
}) {
|
|
120
122
|
const prefix = usePrefix.usePrefix();
|
|
121
123
|
|
|
@@ -182,7 +184,7 @@ const PaginationNav = /*#__PURE__*/React.forwardRef(({
|
|
|
182
184
|
size = 'lg',
|
|
183
185
|
tooltipAlignment,
|
|
184
186
|
tooltipPosition,
|
|
185
|
-
translateWithId: t =
|
|
187
|
+
translateWithId: t = defaultTranslateWithId,
|
|
186
188
|
...rest
|
|
187
189
|
}, ref) => {
|
|
188
190
|
const smMediaQuery = `(max-width: ${layout.breakpoints.sm.width})`;
|
|
@@ -383,8 +385,7 @@ PaginationItem.propTypes = {
|
|
|
383
385
|
*/
|
|
384
386
|
page: PropTypes.number,
|
|
385
387
|
/**
|
|
386
|
-
*
|
|
387
|
-
* and returns the localized string for the message
|
|
388
|
+
* Translates component strings using your i18n tool.
|
|
388
389
|
*/
|
|
389
390
|
translateWithId: PropTypes.func
|
|
390
391
|
};
|
|
@@ -402,8 +403,7 @@ PaginationOverflow.propTypes = {
|
|
|
402
403
|
*/
|
|
403
404
|
onSelect: PropTypes.func,
|
|
404
405
|
/**
|
|
405
|
-
*
|
|
406
|
-
* and returns the localized string for the message
|
|
406
|
+
* Translates component strings using your i18n tool.
|
|
407
407
|
*/
|
|
408
408
|
translateWithId: PropTypes.func
|
|
409
409
|
};
|
|
@@ -453,8 +453,7 @@ PaginationNav.propTypes = {
|
|
|
453
453
|
*/
|
|
454
454
|
totalItems: PropTypes.number,
|
|
455
455
|
/**
|
|
456
|
-
*
|
|
457
|
-
* and returns the localized string for the message
|
|
456
|
+
* Translates component strings using your i18n tool.
|
|
458
457
|
*/
|
|
459
458
|
translateWithId: PropTypes.func
|
|
460
459
|
};
|
|
@@ -50,10 +50,10 @@ const Popover = /*#__PURE__*/React.forwardRef(function PopoverRenderFunction({
|
|
|
50
50
|
open,
|
|
51
51
|
alignmentAxisOffset,
|
|
52
52
|
...rest
|
|
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
|
},
|
|
55
55
|
//this is a workaround, have to come back and fix this.
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
57
57
|
forwardRef) {
|
|
58
58
|
const prefix = usePrefix.usePrefix();
|
|
59
59
|
const floating = React.useRef(null);
|
|
@@ -96,9 +96,9 @@ forwardRef) {
|
|
|
96
96
|
// we look to see if any of the children has a className containing "slug"
|
|
97
97
|
const initialCaretHeight = React.Children.toArray(children).some(x => {
|
|
98
98
|
return (
|
|
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
|
x?.props?.className?.includes('slug') ||
|
|
101
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
102
102
|
x?.props?.className?.includes('ai-label')
|
|
103
103
|
);
|
|
104
104
|
}) ? 7 : 6;
|
|
@@ -151,7 +151,8 @@ forwardRef) {
|
|
|
151
151
|
fallbackAxisSideDirection: 'start',
|
|
152
152
|
boundary: autoAlignBoundary
|
|
153
153
|
}), react.arrow({
|
|
154
|
-
element: caretRef
|
|
154
|
+
element: caretRef,
|
|
155
|
+
padding: 16
|
|
155
156
|
}), autoAlign && react.hide()],
|
|
156
157
|
whileElementsMounted: react.autoUpdate
|
|
157
158
|
} : {}
|
|
@@ -219,7 +220,7 @@ forwardRef) {
|
|
|
219
220
|
[`${prefix}--popover--tab-tip`]: isTabTip
|
|
220
221
|
}, customClassName);
|
|
221
222
|
const mappedChildren = React.Children.map(children, child => {
|
|
222
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
223
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
223
224
|
const item = child;
|
|
224
225
|
const displayName = item?.type?.displayName;
|
|
225
226
|
|
|
@@ -234,13 +235,13 @@ forwardRef) {
|
|
|
234
235
|
const isTriggerComponent = enableFloatingStyles && displayName && ['ToggletipButton'].includes(displayName);
|
|
235
236
|
const isAllowedTriggerComponent = enableFloatingStyles && !['ToggletipContent', 'PopoverContent'].includes(displayName);
|
|
236
237
|
if (/*#__PURE__*/React.isValidElement(item) && (isTriggerElement || isTriggerComponent || isAllowedTriggerComponent)) {
|
|
237
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
238
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
238
239
|
const className = item?.props?.className;
|
|
239
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
240
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
240
241
|
const ref = (item?.props).ref;
|
|
241
242
|
const tabTipClasses = cx(`${prefix}--popover--tab-tip__button`, className);
|
|
242
243
|
|
|
243
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
244
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
244
245
|
return /*#__PURE__*/React.cloneElement(item, {
|
|
245
246
|
className: isTabTip && item?.type === 'button' ? tabTipClasses : className || '',
|
|
246
247
|
// With cloneElement, if you pass a `ref`, it overrides the original ref.
|
|
@@ -59,7 +59,7 @@ function ProgressBar({
|
|
|
59
59
|
});
|
|
60
60
|
let StatusIcon = null;
|
|
61
61
|
if (isError) {
|
|
62
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
62
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
63
63
|
StatusIcon = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
64
64
|
return /*#__PURE__*/React.createElement(iconsReact.ErrorFilled, _rollupPluginBabelHelpers.extends({
|
|
65
65
|
ref: ref,
|
|
@@ -67,7 +67,7 @@ function ProgressBar({
|
|
|
67
67
|
}, props));
|
|
68
68
|
});
|
|
69
69
|
} else if (isFinished) {
|
|
70
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
70
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
71
71
|
StatusIcon = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
72
72
|
return /*#__PURE__*/React.createElement(iconsReact.CheckmarkFilled, _rollupPluginBabelHelpers.extends({
|
|
73
73
|
ref: ref,
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import { TranslateWithId } from '../../types/common';
|
|
10
|
-
declare const
|
|
11
|
-
readonly 'carbon.progress-step.complete': "
|
|
12
|
-
readonly 'carbon.progress-step.incomplete': "
|
|
13
|
-
readonly 'carbon.progress-step.current': "
|
|
14
|
-
readonly 'carbon.progress-step.invalid': "
|
|
9
|
+
import type { TranslateWithId } from '../../types/common';
|
|
10
|
+
declare const translationIds: {
|
|
11
|
+
readonly 'carbon.progress-step.complete': "carbon.progress-step.complete";
|
|
12
|
+
readonly 'carbon.progress-step.incomplete': "carbon.progress-step.incomplete";
|
|
13
|
+
readonly 'carbon.progress-step.current': "carbon.progress-step.current";
|
|
14
|
+
readonly 'carbon.progress-step.invalid': "carbon.progress-step.invalid";
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
* Message ids that will be passed to translateWithId().
|
|
18
|
-
*/
|
|
19
|
-
type TranslationKey = keyof typeof defaultTranslations;
|
|
16
|
+
type TranslationKey = keyof typeof translationIds;
|
|
20
17
|
export interface ProgressIndicatorProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onChange'> {
|
|
21
18
|
/**
|
|
22
19
|
* Provide `<ProgressStep>` components to be rendered in the
|
|
@@ -32,7 +29,7 @@ export interface ProgressIndicatorProps extends Omit<React.HTMLAttributes<HTMLUL
|
|
|
32
29
|
*/
|
|
33
30
|
currentIndex?: number;
|
|
34
31
|
/**
|
|
35
|
-
* Optional callback called if a ProgressStep is clicked on.
|
|
32
|
+
* Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
|
|
36
33
|
*/
|
|
37
34
|
onChange?: (data: number) => void;
|
|
38
35
|
/**
|
|
@@ -61,7 +58,7 @@ declare namespace ProgressIndicator {
|
|
|
61
58
|
*/
|
|
62
59
|
currentIndex: PropTypes.Requireable<number>;
|
|
63
60
|
/**
|
|
64
|
-
* Optional callback called if a ProgressStep is clicked on.
|
|
61
|
+
* Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
|
|
65
62
|
*/
|
|
66
63
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
67
64
|
/**
|
|
@@ -176,8 +173,7 @@ declare namespace ProgressStep {
|
|
|
176
173
|
*/
|
|
177
174
|
tooltipId: PropTypes.Requireable<string>;
|
|
178
175
|
/**
|
|
179
|
-
*
|
|
180
|
-
* internationalized string.
|
|
176
|
+
* Translates component strings using your i18n tool.
|
|
181
177
|
*/
|
|
182
178
|
translateWithId: PropTypes.Requireable<(...args: any[]) => any>;
|
|
183
179
|
};
|
|
@@ -18,20 +18,21 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
18
18
|
var Text = require('../Text/Text.js');
|
|
19
19
|
require('../Text/TextDirection.js');
|
|
20
20
|
|
|
21
|
+
const translationIds = {
|
|
22
|
+
'carbon.progress-step.complete': 'carbon.progress-step.complete',
|
|
23
|
+
'carbon.progress-step.incomplete': 'carbon.progress-step.incomplete',
|
|
24
|
+
'carbon.progress-step.current': 'carbon.progress-step.current',
|
|
25
|
+
'carbon.progress-step.invalid': 'carbon.progress-step.invalid'
|
|
26
|
+
};
|
|
21
27
|
const defaultTranslations = {
|
|
22
|
-
'carbon.progress-step.complete': 'Complete',
|
|
23
|
-
'carbon.progress-step.incomplete': 'Incomplete',
|
|
24
|
-
'carbon.progress-step.current': 'Current',
|
|
25
|
-
'carbon.progress-step.invalid': 'Invalid'
|
|
28
|
+
[translationIds['carbon.progress-step.complete']]: 'Complete',
|
|
29
|
+
[translationIds['carbon.progress-step.incomplete']]: 'Incomplete',
|
|
30
|
+
[translationIds['carbon.progress-step.current']]: 'Current',
|
|
31
|
+
[translationIds['carbon.progress-step.invalid']]: 'Invalid'
|
|
26
32
|
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Message ids that will be passed to translateWithId().
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
function translateWithId(messageId) {
|
|
33
|
+
const defaultTranslateWithId = messageId => {
|
|
33
34
|
return defaultTranslations[messageId];
|
|
34
|
-
}
|
|
35
|
+
};
|
|
35
36
|
function ProgressIndicator({
|
|
36
37
|
children,
|
|
37
38
|
className: customClassName,
|
|
@@ -103,7 +104,7 @@ ProgressIndicator.propTypes = {
|
|
|
103
104
|
*/
|
|
104
105
|
currentIndex: PropTypes.number,
|
|
105
106
|
/**
|
|
106
|
-
* Optional callback called if a ProgressStep is clicked on.
|
|
107
|
+
* Optional callback called if a ProgressStep is clicked on. Returns the index of the step.
|
|
107
108
|
*/
|
|
108
109
|
onChange: PropTypes.func,
|
|
109
110
|
/**
|
|
@@ -125,7 +126,7 @@ function ProgressStep({
|
|
|
125
126
|
secondaryLabel,
|
|
126
127
|
disabled,
|
|
127
128
|
onClick,
|
|
128
|
-
translateWithId: t =
|
|
129
|
+
translateWithId: t = defaultTranslateWithId,
|
|
129
130
|
...rest
|
|
130
131
|
}) {
|
|
131
132
|
const prefix = usePrefix.usePrefix();
|
|
@@ -255,8 +256,7 @@ ProgressStep.propTypes = {
|
|
|
255
256
|
*/
|
|
256
257
|
tooltipId: PropTypes.string,
|
|
257
258
|
/**
|
|
258
|
-
*
|
|
259
|
-
* internationalized string.
|
|
259
|
+
* Translates component strings using your i18n tool.
|
|
260
260
|
*/
|
|
261
261
|
translateWithId: PropTypes.func
|
|
262
262
|
};
|
|
@@ -57,7 +57,7 @@ const RadioButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
57
57
|
const candidateIsAILabel = utils.isComponentElement(candidate, index.AILabel);
|
|
58
58
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
59
59
|
size: candidate.props?.['kind'] === 'inline' ? 'md' : 'mini'
|
|
60
|
-
}) :
|
|
60
|
+
}) : candidate;
|
|
61
61
|
return /*#__PURE__*/React.createElement("div", {
|
|
62
62
|
className: wrapperClasses
|
|
63
63
|
}, /*#__PURE__*/React.createElement("input", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
@@ -114,7 +114,7 @@ const RadioButtonGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
114
114
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
115
115
|
size: 'mini',
|
|
116
116
|
kind: 'default'
|
|
117
|
-
}) :
|
|
117
|
+
}) : candidate;
|
|
118
118
|
return /*#__PURE__*/React.createElement("div", {
|
|
119
119
|
className: wrapperClasses,
|
|
120
120
|
ref: mergeRefs.mergeRefs(divRef, ref)
|
|
@@ -82,7 +82,7 @@ const RadioTile = /*#__PURE__*/React.forwardRef(({
|
|
|
82
82
|
const candidateIsAILabel = utils.isComponentElement(candidate, index$1.AILabel);
|
|
83
83
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/React.cloneElement(candidate, {
|
|
84
84
|
size: 'xs'
|
|
85
|
-
}) :
|
|
85
|
+
}) : candidate;
|
|
86
86
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
|
|
87
87
|
checked: checked,
|
|
88
88
|
className: `${prefix}--tile-input`,
|
|
@@ -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,
|