@carbon/react 1.87.0-rc.0 → 1.87.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +739 -739
- package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
- package/es/components/Button/Button.js +1 -1
- package/es/components/Button/index.js +5 -1
- package/es/components/ButtonSet/index.js +4 -1
- package/es/components/Checkbox/index.js +4 -1
- package/es/components/ComboBox/ComboBox.js +1 -1
- package/es/components/ComboBox/index.js +4 -1
- package/es/components/ComposedModal/ComposedModal.js +18 -8
- package/es/components/ContainedList/ContainedListItem/index.js +4 -1
- package/es/components/ContainedList/index.js +2 -2
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/Copy/index.js +4 -1
- package/es/components/CopyButton/index.js +4 -1
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/es/components/DataTable/state/getDerivedStateFromProps.js +1 -2
- package/es/components/DataTable/state/sorting.d.ts +15 -0
- package/es/components/DataTable/state/sorting.js +1 -2
- package/es/components/DataTable/tools/denormalize.d.ts +22 -0
- package/es/components/DataTable/tools/denormalize.js +1 -2
- package/es/components/DataTable/tools/normalize.d.ts +9 -0
- package/es/components/DataTable/tools/normalize.js +1 -2
- package/es/components/DatePicker/DatePicker.js +18 -11
- package/es/components/DatePicker/index.js +4 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/es/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/DatePickerInput/index.js +4 -1
- package/es/components/Dialog/index.js +2 -2
- package/es/components/Dropdown/Dropdown.js +2 -2
- package/es/components/Dropdown/index.js +4 -1
- package/es/components/FeatureFlags/index.js +2 -2
- package/es/components/FluidSelect/index.js +4 -1
- package/es/components/FluidTextInput/index.js +4 -1
- package/es/components/IconIndicator/index.js +1 -1
- package/es/components/InlineCheckbox/index.js +4 -1
- package/es/components/InlineLoading/index.js +4 -1
- package/es/components/LayoutDirection/LayoutDirection.js +1 -2
- package/es/components/Link/index.js +4 -1
- package/es/components/ListBox/ListBox.js +1 -1
- package/es/components/Loading/index.js +4 -1
- package/es/components/Menu/Menu.d.ts +3 -1
- package/es/components/Menu/Menu.js +3 -1
- package/es/components/Menu/MenuItem.js +1 -1
- package/es/components/Modal/Modal.js +16 -5
- package/es/components/Modal/index.js +4 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/MultiSelect/filter.js +0 -4
- package/es/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/es/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/es/components/Notification/Notification.js +2 -2
- package/es/components/NumberInput/NumberInput.js +1 -1
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/index.js +4 -1
- package/es/components/OverflowMenuV2/index.d.ts +1 -0
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/es/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/es/components/Pagination/experimental/index.d.ts +3 -0
- package/es/components/Popover/index.js +21 -4
- package/es/components/RadioButton/index.js +4 -1
- package/es/components/RadioTile/index.js +4 -1
- package/es/components/Search/Search.js +1 -1
- package/es/components/Search/index.js +4 -1
- package/es/components/Select/index.js +4 -1
- package/es/components/SelectItem/index.js +4 -1
- package/es/components/ShapeIndicator/index.js +1 -1
- package/es/components/SkeletonText/index.js +4 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Switch/IconSwitch.d.ts +3 -0
- package/es/components/Switch/IconSwitch.js +1 -2
- package/es/components/TabContent/TabContent.js +2 -22
- package/es/components/Tabs/Tabs.js +5 -5
- package/es/components/Tag/DismissibleTag.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextArea/index.js +4 -1
- package/es/components/TextInput/index.js +4 -1
- package/es/components/TextInput/util.d.ts +9 -0
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +2 -2
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/_utils.d.ts +7 -0
- package/es/feature-flags.d.ts +1 -0
- package/es/internal/FloatingMenu.js +1 -1
- package/es/internal/deprecateFieldOnObject.js +1 -1
- package/es/internal/useId.d.ts +21 -0
- package/es/internal/useId.js +27 -1
- package/es/internal/useOverflowItems.js +0 -6
- package/es/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -1
- package/es/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -1
- package/es/prop-types/deprecateComponent.d.ts +1 -0
- package/es/prop-types/deprecateComponent.js +1 -4
- package/es/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/es/tools/mergeRefs.d.ts +12 -0
- package/es/tools/mergeRefs.js +1 -2
- package/icons/index.js +1 -3
- package/lib/_virtual/_rollupPluginBabelHelpers.js +5 -7
- package/lib/components/AILabel/index.js +35 -43
- package/lib/components/AISkeleton/AISkeletonIcon.js +5 -11
- package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -10
- package/lib/components/AISkeleton/AISkeletonText.js +8 -14
- package/lib/components/Accordion/Accordion.Skeleton.js +21 -27
- package/lib/components/Accordion/Accordion.js +11 -17
- package/lib/components/Accordion/AccordionItem.js +19 -25
- package/lib/components/Accordion/AccordionProvider.js +1 -7
- package/lib/components/AspectRatio/AspectRatio.js +7 -13
- package/lib/components/BadgeIndicator/index.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +7 -13
- package/lib/components/Breadcrumb/Breadcrumb.js +9 -15
- package/lib/components/Breadcrumb/BreadcrumbItem.js +16 -22
- package/lib/components/Button/Button.Skeleton.js +8 -14
- package/lib/components/Button/Button.js +31 -36
- package/lib/components/Button/ButtonBase.js +6 -11
- package/lib/components/Button/index.js +3 -3
- package/lib/components/ButtonSet/ButtonSet.js +6 -12
- package/lib/components/ButtonSet/index.js +2 -2
- package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -11
- package/lib/components/ChatButton/ChatButton.js +12 -18
- package/lib/components/Checkbox/Checkbox.Skeleton.js +6 -12
- package/lib/components/Checkbox/Checkbox.js +33 -39
- package/lib/components/Checkbox/index.js +3 -3
- package/lib/components/CheckboxGroup/CheckboxGroup.js +24 -30
- package/lib/components/ClassPrefix/index.js +3 -10
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +10 -16
- package/lib/components/CodeSnippet/CodeSnippet.js +39 -46
- package/lib/components/ComboBox/ComboBox.js +57 -64
- package/lib/components/ComboBox/index.js +2 -2
- package/lib/components/ComboButton/index.js +20 -28
- package/lib/components/ComposedModal/ComposedModal.js +61 -57
- package/lib/components/ComposedModal/ModalFooter.js +37 -45
- package/lib/components/ComposedModal/ModalHeader.js +23 -31
- package/lib/components/ContainedList/ContainedList.js +18 -24
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +14 -20
- package/lib/components/ContainedList/ContainedListItem/index.js +2 -2
- package/lib/components/ContainedList/index.js +5 -5
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -19
- package/lib/components/ContextMenu/useContextMenu.js +1 -1
- package/lib/components/Copy/Copy.js +12 -18
- package/lib/components/Copy/index.js +2 -2
- package/lib/components/CopyButton/CopyButton.js +12 -18
- package/lib/components/CopyButton/index.js +2 -2
- package/lib/components/DangerButton/DangerButton.js +2 -6
- package/lib/components/DataTable/DataTable.js +48 -55
- package/lib/components/DataTable/Table.js +18 -24
- package/lib/components/DataTable/TableActionList.js +2 -2
- package/lib/components/DataTable/TableBatchAction.js +4 -9
- package/lib/components/DataTable/TableBatchActions.js +19 -25
- package/lib/components/DataTable/TableBody.js +5 -10
- package/lib/components/DataTable/TableCell.js +8 -14
- package/lib/components/DataTable/TableContainer.js +14 -20
- package/lib/components/DataTable/TableContext.js +0 -2
- package/lib/components/DataTable/TableDecoratorRow.js +5 -11
- package/lib/components/DataTable/TableExpandHeader.js +16 -22
- package/lib/components/DataTable/TableExpandRow.js +20 -26
- package/lib/components/DataTable/TableExpandedRow.js +8 -14
- package/lib/components/DataTable/TableHead.js +2 -2
- package/lib/components/DataTable/TableHeader.js +26 -32
- package/lib/components/DataTable/TableRow.js +8 -14
- package/lib/components/DataTable/TableSelectAll.js +13 -19
- package/lib/components/DataTable/TableSelectRow.js +15 -21
- package/lib/components/DataTable/TableSlugRow.js +7 -13
- package/lib/components/DataTable/TableToolbar.js +7 -13
- package/lib/components/DataTable/TableToolbarAction.js +5 -10
- package/lib/components/DataTable/TableToolbarContent.js +2 -2
- package/lib/components/DataTable/TableToolbarMenu.js +9 -15
- package/lib/components/DataTable/TableToolbarSearch.js +22 -28
- package/lib/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +2 -3
- package/lib/components/DataTable/state/sortStates.js +0 -2
- package/lib/components/DataTable/state/sorting.d.ts +15 -0
- package/lib/components/DataTable/state/sorting.js +0 -2
- package/lib/components/DataTable/tools/cells.js +0 -2
- package/lib/components/DataTable/tools/denormalize.d.ts +22 -0
- package/lib/components/DataTable/tools/denormalize.js +1 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/normalize.d.ts +9 -0
- package/lib/components/DataTable/tools/normalize.js +1 -2
- package/lib/components/DataTable/tools/sorting.js +0 -2
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +25 -31
- package/lib/components/DatePicker/DatePicker.Skeleton.js +14 -20
- package/lib/components/DatePicker/DatePicker.js +65 -66
- package/lib/components/DatePicker/index.js +3 -3
- package/lib/components/DatePicker/plugins/appendToPlugin.js +0 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/lib/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -6
- package/lib/components/DatePickerInput/DatePickerInput.js +49 -49
- package/lib/components/DatePickerInput/index.js +2 -2
- package/lib/components/Dialog/index.js +72 -80
- package/lib/components/Dropdown/Dropdown.Skeleton.js +8 -14
- package/lib/components/Dropdown/Dropdown.js +49 -55
- package/lib/components/Dropdown/index.js +3 -3
- package/lib/components/ErrorBoundary/ErrorBoundary.js +4 -9
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +6 -11
- package/lib/components/FeatureFlags/index.js +10 -17
- package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -13
- package/lib/components/FileUploader/FileUploader.js +30 -36
- package/lib/components/FileUploader/FileUploaderButton.js +19 -25
- package/lib/components/FileUploader/FileUploaderDropContainer.js +18 -24
- package/lib/components/FileUploader/FileUploaderItem.js +23 -29
- package/lib/components/FileUploader/Filename.js +13 -18
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +7 -13
- package/lib/components/FluidComboBox/FluidComboBox.js +24 -30
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +14 -20
- package/lib/components/FluidDatePicker/FluidDatePicker.js +12 -18
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -8
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +7 -13
- package/lib/components/FluidDropdown/FluidDropdown.js +24 -30
- package/lib/components/FluidForm/FluidForm.js +6 -12
- package/lib/components/FluidForm/FormContext.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +7 -13
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +36 -42
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +7 -13
- package/lib/components/FluidNumberInput/FluidNumberInput.js +30 -36
- package/lib/components/FluidSearch/FluidSearch.Skeleton.js +7 -13
- package/lib/components/FluidSearch/FluidSearch.js +19 -25
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +7 -13
- package/lib/components/FluidSelect/FluidSelect.js +17 -23
- package/lib/components/FluidSelect/index.js +3 -3
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +7 -13
- package/lib/components/FluidTextArea/FluidTextArea.js +25 -31
- package/lib/components/FluidTextInput/FluidPasswordInput.js +18 -22
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +7 -13
- package/lib/components/FluidTextInput/FluidTextInput.js +23 -29
- package/lib/components/FluidTextInput/index.js +3 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +6 -12
- package/lib/components/FluidTimePicker/FluidTimePicker.js +23 -29
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +10 -15
- package/lib/components/Form/Form.js +5 -11
- package/lib/components/FormGroup/FormGroup.js +13 -19
- package/lib/components/FormItem/FormItem.js +5 -11
- package/lib/components/FormLabel/FormLabel.js +6 -12
- package/lib/components/Grid/CSSGrid.js +20 -28
- package/lib/components/Grid/Column.js +31 -37
- package/lib/components/Grid/ColumnHang.js +5 -13
- package/lib/components/Grid/FlexGrid.js +10 -18
- package/lib/components/Grid/Grid.js +9 -16
- package/lib/components/Grid/GridContext.js +7 -14
- package/lib/components/Grid/Row.js +8 -14
- package/lib/components/Heading/index.js +14 -21
- package/lib/components/Icon/Icon.Skeleton.js +4 -10
- package/lib/components/IconButton/index.js +25 -33
- package/lib/components/IconIndicator/index.js +9 -15
- package/lib/components/IdPrefix/index.js +3 -10
- package/lib/components/InlineCheckbox/InlineCheckbox.js +17 -22
- package/lib/components/InlineCheckbox/index.js +2 -2
- package/lib/components/InlineLoading/InlineLoading.js +17 -23
- package/lib/components/InlineLoading/index.js +2 -2
- package/lib/components/Layer/LayerContext.js +1 -7
- package/lib/components/Layer/LayerLevel.js +0 -2
- package/lib/components/Layer/index.js +11 -19
- package/lib/components/Layout/index.js +22 -30
- package/lib/components/LayoutDirection/LayoutDirection.js +6 -13
- package/lib/components/LayoutDirection/LayoutDirectionContext.js +1 -7
- package/lib/components/LayoutDirection/useLayoutDirection.js +0 -2
- package/lib/components/Link/Link.js +15 -21
- package/lib/components/Link/index.js +2 -2
- package/lib/components/ListBox/ListBox.js +17 -23
- package/lib/components/ListBox/ListBoxField.js +7 -12
- package/lib/components/ListBox/ListBoxMenu.js +7 -12
- package/lib/components/ListBox/ListBoxMenuIcon.js +7 -13
- package/lib/components/ListBox/ListBoxMenuItem.js +9 -15
- package/lib/components/ListBox/ListBoxPropTypes.js +2 -8
- package/lib/components/ListBox/ListBoxSelection.js +14 -20
- package/lib/components/ListBox/index.js +7 -7
- package/lib/components/ListBox/next/ListBoxSelection.js +18 -24
- package/lib/components/ListBox/next/ListBoxTrigger.js +7 -13
- package/lib/components/ListItem/ListItem.js +5 -11
- package/lib/components/Loading/Loading.js +14 -20
- package/lib/components/Loading/index.js +2 -2
- package/lib/components/Menu/Menu.d.ts +3 -1
- package/lib/components/Menu/Menu.js +18 -24
- package/lib/components/Menu/MenuContext.js +0 -2
- package/lib/components/Menu/MenuItem.js +44 -52
- package/lib/components/MenuButton/index.js +16 -24
- package/lib/components/Modal/Modal.js +91 -86
- package/lib/components/Modal/index.js +2 -2
- package/lib/components/ModalWrapper/ModalWrapper.js +30 -35
- package/lib/components/MultiSelect/FilterableMultiSelect.js +57 -67
- package/lib/components/MultiSelect/MultiSelect.js +61 -70
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -8
- package/lib/components/MultiSelect/filter.js +0 -6
- package/lib/components/MultiSelect/tools/itemToString.d.ts +1 -0
- package/lib/components/MultiSelect/tools/itemToString.js +1 -7
- package/lib/components/MultiSelect/tools/sorting.d.ts +9 -0
- package/lib/components/MultiSelect/tools/sorting.js +0 -2
- package/lib/components/Notification/Notification.js +118 -126
- package/lib/components/NumberInput/NumberFormatPropTypes.js +21 -27
- package/lib/components/NumberInput/NumberInput.Skeleton.js +8 -14
- package/lib/components/NumberInput/NumberInput.js +66 -74
- package/lib/components/OrderedList/OrderedList.js +8 -14
- package/lib/components/OverflowMenu/OverflowMenu.js +42 -49
- package/lib/components/OverflowMenu/index.js +3 -7
- package/lib/components/OverflowMenu/next/index.js +18 -26
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +27 -33
- package/lib/components/OverflowMenuItem/index.js +2 -2
- package/lib/components/OverflowMenuV2/index.d.ts +1 -0
- package/lib/components/OverflowMenuV2/index.js +2 -8
- package/lib/components/PageHeader/PageHeader.js +70 -78
- package/lib/components/PageHeader/index.js +0 -2
- package/lib/components/Pagination/Pagination.Skeleton.js +10 -16
- package/lib/components/Pagination/Pagination.js +44 -51
- package/lib/components/Pagination/experimental/PageSelector.d.ts +19 -0
- package/lib/components/Pagination/experimental/PageSelector.js +9 -15
- package/lib/components/Pagination/experimental/Pagination.d.ts +43 -0
- package/lib/components/Pagination/experimental/Pagination.js +34 -40
- package/lib/components/Pagination/experimental/index.d.ts +3 -0
- package/lib/components/PaginationNav/PaginationNav.js +54 -60
- package/lib/components/Popover/index.js +56 -47
- package/lib/components/PrimaryButton/PrimaryButton.js +2 -6
- package/lib/components/ProgressBar/ProgressBar.js +25 -31
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +10 -16
- package/lib/components/ProgressIndicator/ProgressIndicator.js +41 -49
- package/lib/components/RadioButton/RadioButton.Skeleton.js +6 -12
- package/lib/components/RadioButton/RadioButton.js +26 -32
- package/lib/components/RadioButton/index.js +2 -2
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +37 -43
- package/lib/components/RadioTile/RadioTile.js +25 -31
- package/lib/components/RadioTile/index.js +2 -2
- package/lib/components/Search/Search.Skeleton.js +7 -13
- package/lib/components/Search/Search.js +33 -39
- package/lib/components/Search/index.js +3 -3
- package/lib/components/SecondaryButton/SecondaryButton.js +2 -6
- package/lib/components/Select/Select.Skeleton.js +8 -14
- package/lib/components/Select/Select.js +42 -48
- package/lib/components/Select/index.js +3 -3
- package/lib/components/SelectItem/SelectItem.js +8 -14
- package/lib/components/SelectItem/index.js +2 -2
- package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -13
- package/lib/components/ShapeIndicator/index.js +12 -18
- package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -10
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -10
- package/lib/components/SkeletonText/SkeletonText.js +11 -17
- package/lib/components/SkeletonText/index.js +2 -2
- package/lib/components/Slider/Slider.Skeleton.js +29 -35
- package/lib/components/Slider/Slider.js +84 -90
- package/lib/components/Slider/SliderHandles.js +18 -24
- package/lib/components/Slider/index.js +3 -3
- package/lib/components/Stack/HStack.js +1 -7
- package/lib/components/Stack/Stack.js +7 -15
- package/lib/components/Stack/VStack.js +1 -7
- package/lib/components/StructuredList/StructuredList.Skeleton.js +15 -21
- package/lib/components/StructuredList/StructuredList.js +60 -68
- package/lib/components/Switch/IconSwitch.d.ts +3 -0
- package/lib/components/Switch/IconSwitch.js +18 -25
- package/lib/components/Switch/Switch.js +14 -20
- package/lib/components/TabContent/TabContent.js +7 -33
- package/lib/components/Tabs/Tabs.Skeleton.js +10 -16
- package/lib/components/Tabs/Tabs.js +121 -129
- package/lib/components/Tabs/usePressable.js +0 -2
- package/lib/components/Tag/DismissibleTag.js +24 -30
- package/lib/components/Tag/OperationalTag.js +16 -22
- package/lib/components/Tag/SelectableTag.js +19 -25
- package/lib/components/Tag/Tag.Skeleton.js +5 -11
- package/lib/components/Tag/Tag.js +28 -34
- package/lib/components/Tag/isEllipsisActive.js +0 -2
- package/lib/components/Text/Text.js +6 -13
- package/lib/components/Text/TextDirection.js +4 -11
- package/lib/components/Text/TextDirectionContext.js +0 -2
- package/lib/components/Text/createTextComponent.js +1 -7
- package/lib/components/Text/index.js +0 -2
- package/lib/components/TextArea/TextArea.Skeleton.js +7 -13
- package/lib/components/TextArea/TextArea.js +49 -55
- package/lib/components/TextArea/index.js +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.js +36 -42
- package/lib/components/TextInput/PasswordInput.js +48 -54
- package/lib/components/TextInput/TextInput.Skeleton.js +7 -13
- package/lib/components/TextInput/TextInput.js +47 -53
- package/lib/components/TextInput/index.js +3 -3
- package/lib/components/TextInput/util.d.ts +9 -0
- package/lib/components/TextInput/util.js +0 -2
- package/lib/components/Theme/index.js +16 -24
- package/lib/components/Tile/Tile.js +92 -100
- package/lib/components/TileGroup/TileGroup.js +15 -22
- package/lib/components/TimePicker/TimePicker.js +39 -45
- package/lib/components/TimePickerSelect/TimePickerSelect.js +10 -16
- package/lib/components/Toggle/Toggle.Skeleton.js +7 -13
- package/lib/components/Toggle/Toggle.js +28 -34
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +12 -20
- package/lib/components/Toggletip/index.js +32 -40
- package/lib/components/Tooltip/DefinitionTooltip.js +14 -22
- package/lib/components/Tooltip/Tooltip.js +19 -27
- package/lib/components/TreeView/TreeContext.js +0 -2
- package/lib/components/TreeView/TreeNode.js +41 -47
- package/lib/components/TreeView/TreeView.js +17 -23
- package/lib/components/UIShell/Content.js +6 -12
- package/lib/components/UIShell/Header.js +4 -10
- package/lib/components/UIShell/HeaderContainer.js +4 -9
- package/lib/components/UIShell/HeaderGlobalAction.js +11 -17
- package/lib/components/UIShell/HeaderGlobalBar.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +17 -23
- package/lib/components/UIShell/HeaderMenuButton.js +9 -15
- package/lib/components/UIShell/HeaderMenuItem.js +11 -17
- package/lib/components/UIShell/HeaderName.js +8 -14
- package/lib/components/UIShell/HeaderNavigation.js +6 -12
- package/lib/components/UIShell/HeaderPanel.js +11 -17
- package/lib/components/UIShell/HeaderSideNavItems.js +6 -12
- package/lib/components/UIShell/Link.js +6 -11
- package/lib/components/UIShell/SideNav.js +23 -29
- package/lib/components/UIShell/SideNavDetails.js +7 -13
- package/lib/components/UIShell/SideNavDivider.js +5 -11
- package/lib/components/UIShell/SideNavFooter.js +12 -18
- package/lib/components/UIShell/SideNavHeader.js +8 -14
- package/lib/components/UIShell/SideNavIcon.js +6 -12
- package/lib/components/UIShell/SideNavItem.js +6 -12
- package/lib/components/UIShell/SideNavItems.js +9 -15
- package/lib/components/UIShell/SideNavLink.js +13 -19
- package/lib/components/UIShell/SideNavLinkText.js +5 -11
- package/lib/components/UIShell/SideNavMenu.js +20 -26
- package/lib/components/UIShell/SideNavMenuItem.js +13 -19
- package/lib/components/UIShell/SideNavSwitcher.js +13 -19
- package/lib/components/UIShell/SkipToContent.js +7 -13
- package/lib/components/UIShell/Switcher.js +9 -15
- package/lib/components/UIShell/SwitcherDivider.js +4 -10
- package/lib/components/UIShell/SwitcherItem.js +15 -21
- package/lib/components/UIShell/_utils.d.ts +7 -0
- package/lib/components/UIShell/_utils.js +0 -2
- package/lib/components/UnorderedList/UnorderedList.js +7 -13
- package/lib/feature-flags.d.ts +1 -0
- package/lib/feature-flags.js +3 -4
- package/lib/index.js +180 -182
- package/lib/internal/FloatingMenu.js +10 -18
- package/lib/internal/OptimizedResize.js +2 -8
- package/lib/internal/Selection.js +1 -7
- package/lib/internal/clamp.js +0 -2
- package/lib/internal/createClassWrapper.js +1 -7
- package/lib/internal/deprecateFieldOnObject.js +1 -3
- package/lib/internal/environment.js +0 -2
- package/lib/internal/getAnnouncement.js +0 -2
- package/lib/internal/keyboard/keys.js +0 -2
- package/lib/internal/keyboard/match.js +0 -2
- package/lib/internal/keyboard/navigation.js +0 -2
- package/lib/internal/noopFn.js +0 -2
- package/lib/internal/useAttachedMenu.js +0 -2
- package/lib/internal/useControllableState.js +0 -2
- package/lib/internal/useDelayedState.js +0 -2
- package/lib/internal/useEvent.js +0 -2
- package/lib/internal/useId.d.ts +21 -0
- package/lib/internal/useId.js +27 -7
- package/lib/internal/useIdPrefix.js +2 -8
- package/lib/internal/useIsomorphicEffect.js +1 -1
- package/lib/internal/useMatchMedia.js +0 -2
- package/lib/internal/useMergedRefs.js +0 -2
- package/lib/internal/useNoInteractiveChildren.js +0 -2
- package/lib/internal/useNormalizedInputProps.js +2 -8
- package/lib/internal/useOutsideClick.js +0 -2
- package/lib/internal/useOverflowItems.js +1 -7
- package/lib/internal/usePrefix.js +2 -8
- package/lib/internal/usePreviousValue.js +0 -2
- package/lib/internal/useResizeObserver.js +0 -2
- package/lib/internal/useSavedCallback.js +0 -2
- package/lib/internal/utils.js +0 -2
- package/lib/internal/warning.js +0 -2
- package/lib/internal/wrapFocus.js +0 -2
- package/lib/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -3
- package/lib/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -2
- package/lib/prop-types/AriaPropTypes.js +2 -8
- package/lib/prop-types/deprecate.js +0 -2
- package/lib/prop-types/deprecateComponent.d.ts +1 -0
- package/lib/prop-types/deprecateComponent.js +2 -5
- package/lib/prop-types/deprecateValuesWithin.d.ts +1 -0
- package/lib/prop-types/deprecateValuesWithin.js +1 -1
- package/lib/prop-types/isRequiredOneOf.js +0 -2
- package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
- package/lib/tools/events.js +0 -2
- package/lib/tools/mapPopoverAlign.js +0 -2
- package/lib/tools/mergeRefs.d.ts +12 -0
- package/lib/tools/mergeRefs.js +1 -2
- package/lib/tools/setupGetInstanceId.js +0 -2
- package/lib/tools/toggleClass.js +0 -2
- package/lib/tools/wrapComponent.js +4 -10
- package/package.json +11 -11
- /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
11
|
var PropTypes = require('prop-types');
|
|
14
12
|
var React = require('react');
|
|
@@ -31,12 +29,6 @@ var warning = require('../../internal/warning.js');
|
|
|
31
29
|
var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
|
|
32
30
|
var Text = require('../Text/Text.js');
|
|
33
31
|
|
|
34
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
35
|
-
|
|
36
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
37
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
38
|
-
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
39
|
-
|
|
40
32
|
/**
|
|
41
33
|
* Conditionally call a callback when the escape key is pressed
|
|
42
34
|
* @param {node} ref - ref of the container element to scope the functionality to
|
|
@@ -51,7 +43,7 @@ function useEscapeToClose(ref, callback, override = true) {
|
|
|
51
43
|
callback(event);
|
|
52
44
|
}
|
|
53
45
|
};
|
|
54
|
-
useIsomorphicEffect
|
|
46
|
+
useIsomorphicEffect.default(() => {
|
|
55
47
|
if (ref.current !== null) {
|
|
56
48
|
document.addEventListener('keydown', handleKeyDown, false);
|
|
57
49
|
}
|
|
@@ -66,10 +58,10 @@ function NotificationActionButton({
|
|
|
66
58
|
...rest
|
|
67
59
|
}) {
|
|
68
60
|
const prefix = usePrefix.usePrefix();
|
|
69
|
-
const className =
|
|
61
|
+
const className = cx(customClassName, {
|
|
70
62
|
[`${prefix}--actionable-notification__action-button`]: true
|
|
71
63
|
});
|
|
72
|
-
return /*#__PURE__*/
|
|
64
|
+
return /*#__PURE__*/React.createElement(Button.default, _rollupPluginBabelHelpers.extends({
|
|
73
65
|
className: className,
|
|
74
66
|
kind: inline ? 'ghost' : 'tertiary',
|
|
75
67
|
onClick: onClick,
|
|
@@ -80,19 +72,19 @@ NotificationActionButton.propTypes = {
|
|
|
80
72
|
/**
|
|
81
73
|
* Specify the content of the notification action button.
|
|
82
74
|
*/
|
|
83
|
-
children:
|
|
75
|
+
children: PropTypes.node,
|
|
84
76
|
/**
|
|
85
77
|
* Specify an optional className to be applied to the notification action button
|
|
86
78
|
*/
|
|
87
|
-
className:
|
|
79
|
+
className: PropTypes.string,
|
|
88
80
|
/**
|
|
89
81
|
* Specify if the visual treatment of the button should be for an inline notification
|
|
90
82
|
*/
|
|
91
|
-
inline:
|
|
83
|
+
inline: PropTypes.bool,
|
|
92
84
|
/**
|
|
93
85
|
* Optionally specify a click handler for the notification action button.
|
|
94
86
|
*/
|
|
95
|
-
onClick:
|
|
87
|
+
onClick: PropTypes.func
|
|
96
88
|
};
|
|
97
89
|
|
|
98
90
|
/**
|
|
@@ -111,19 +103,19 @@ function NotificationButton({
|
|
|
111
103
|
...rest
|
|
112
104
|
}) {
|
|
113
105
|
const prefix = usePrefix.usePrefix();
|
|
114
|
-
const buttonClassName =
|
|
106
|
+
const buttonClassName = cx(className, {
|
|
115
107
|
[`${prefix}--${notificationType}-notification__close-button`]: notificationType
|
|
116
108
|
});
|
|
117
|
-
const iconClassName =
|
|
109
|
+
const iconClassName = cx({
|
|
118
110
|
[`${prefix}--${notificationType}-notification__close-icon`]: notificationType
|
|
119
111
|
});
|
|
120
|
-
return /*#__PURE__*/
|
|
112
|
+
return /*#__PURE__*/React.createElement("button", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
121
113
|
// eslint-disable-next-line react/button-has-type
|
|
122
114
|
type: type,
|
|
123
115
|
"aria-label": deprecatedAriaLabel || ariaLabel,
|
|
124
116
|
title: deprecatedAriaLabel || ariaLabel,
|
|
125
117
|
className: buttonClassName
|
|
126
|
-
}), IconTag && /*#__PURE__*/
|
|
118
|
+
}), IconTag && /*#__PURE__*/React.createElement(IconTag, {
|
|
127
119
|
className: iconClassName,
|
|
128
120
|
name: name
|
|
129
121
|
}));
|
|
@@ -132,33 +124,33 @@ NotificationButton.propTypes = {
|
|
|
132
124
|
/**
|
|
133
125
|
* Specify a label to be read by screen readers on the container node
|
|
134
126
|
*/
|
|
135
|
-
['aria-label']:
|
|
127
|
+
['aria-label']: PropTypes.string,
|
|
136
128
|
/**
|
|
137
129
|
* Deprecated, please use `aria-label` instead.
|
|
138
130
|
* Specify a label to be read by screen readers on the container note.
|
|
139
131
|
*/
|
|
140
|
-
ariaLabel: deprecate.deprecate(
|
|
132
|
+
ariaLabel: deprecate.deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
141
133
|
/**
|
|
142
134
|
* Specify an optional className to be applied to the notification button
|
|
143
135
|
*/
|
|
144
|
-
className:
|
|
136
|
+
className: PropTypes.string,
|
|
145
137
|
/**
|
|
146
138
|
* Specify an optional icon for the Button through a string,
|
|
147
139
|
* if something but regular "close" icon is desirable
|
|
148
140
|
*/
|
|
149
|
-
name:
|
|
141
|
+
name: PropTypes.string,
|
|
150
142
|
/**
|
|
151
143
|
* Specify the notification type
|
|
152
144
|
*/
|
|
153
|
-
notificationType:
|
|
145
|
+
notificationType: PropTypes.oneOf(['toast', 'inline', 'actionable']),
|
|
154
146
|
/**
|
|
155
147
|
* A component used to render an icon.
|
|
156
148
|
*/
|
|
157
|
-
renderIcon:
|
|
149
|
+
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
158
150
|
/**
|
|
159
151
|
* Optional prop to specify the type of the Button
|
|
160
152
|
*/
|
|
161
|
-
type:
|
|
153
|
+
type: PropTypes.string
|
|
162
154
|
};
|
|
163
155
|
|
|
164
156
|
/**
|
|
@@ -184,15 +176,15 @@ function NotificationIcon({
|
|
|
184
176
|
if (!IconForKind) {
|
|
185
177
|
return null;
|
|
186
178
|
}
|
|
187
|
-
return /*#__PURE__*/
|
|
179
|
+
return /*#__PURE__*/React.createElement(IconForKind, {
|
|
188
180
|
className: `${prefix}--${notificationType}-notification__icon`,
|
|
189
181
|
size: 20
|
|
190
|
-
}, /*#__PURE__*/
|
|
182
|
+
}, /*#__PURE__*/React.createElement("title", null, iconDescription));
|
|
191
183
|
}
|
|
192
184
|
NotificationIcon.propTypes = {
|
|
193
|
-
iconDescription:
|
|
194
|
-
kind:
|
|
195
|
-
notificationType:
|
|
185
|
+
iconDescription: PropTypes.string.isRequired,
|
|
186
|
+
kind: PropTypes.oneOf(['error', 'success', 'warning', 'warning-alt', 'info', 'info-square']).isRequired,
|
|
187
|
+
notificationType: PropTypes.oneOf(['inline', 'toast']).isRequired
|
|
196
188
|
};
|
|
197
189
|
|
|
198
190
|
/**
|
|
@@ -221,7 +213,7 @@ function ToastNotification({
|
|
|
221
213
|
}) {
|
|
222
214
|
const [isOpen, setIsOpen] = React.useState(true);
|
|
223
215
|
const prefix = usePrefix.usePrefix();
|
|
224
|
-
const containerClassName =
|
|
216
|
+
const containerClassName = cx(className, {
|
|
225
217
|
[`${prefix}--toast-notification`]: true,
|
|
226
218
|
[`${prefix}--toast-notification--low-contrast`]: lowContrast,
|
|
227
219
|
[`${prefix}--toast-notification--${kind}`]: kind
|
|
@@ -259,28 +251,28 @@ function ToastNotification({
|
|
|
259
251
|
if (!isOpen) {
|
|
260
252
|
return null;
|
|
261
253
|
}
|
|
262
|
-
return /*#__PURE__*/
|
|
254
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
263
255
|
ref: ref
|
|
264
256
|
}, rest, {
|
|
265
257
|
role: role,
|
|
266
258
|
className: containerClassName
|
|
267
|
-
}), /*#__PURE__*/
|
|
259
|
+
}), /*#__PURE__*/React.createElement(NotificationIcon, {
|
|
268
260
|
notificationType: "toast",
|
|
269
261
|
kind: kind,
|
|
270
262
|
iconDescription: statusIconDescription || `${kind} icon`
|
|
271
|
-
}), /*#__PURE__*/
|
|
263
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
272
264
|
ref: contentRef,
|
|
273
265
|
className: `${prefix}--toast-notification__details`
|
|
274
|
-
}, title && /*#__PURE__*/
|
|
266
|
+
}, title && /*#__PURE__*/React.createElement(Text.Text, {
|
|
275
267
|
as: "div",
|
|
276
268
|
className: `${prefix}--toast-notification__title`
|
|
277
|
-
}, title), subtitle && /*#__PURE__*/
|
|
269
|
+
}, title), subtitle && /*#__PURE__*/React.createElement(Text.Text, {
|
|
278
270
|
as: "div",
|
|
279
271
|
className: `${prefix}--toast-notification__subtitle`
|
|
280
|
-
}, subtitle), caption && /*#__PURE__*/
|
|
272
|
+
}, subtitle), caption && /*#__PURE__*/React.createElement(Text.Text, {
|
|
281
273
|
as: "div",
|
|
282
274
|
className: `${prefix}--toast-notification__caption`
|
|
283
|
-
}, caption), children), !hideCloseButton && /*#__PURE__*/
|
|
275
|
+
}, caption), children), !hideCloseButton && /*#__PURE__*/React.createElement(NotificationButton, {
|
|
284
276
|
notificationType: "toast",
|
|
285
277
|
onClick: handleCloseButtonClick,
|
|
286
278
|
"aria-label": deprecatedAriaLabel || ariaLabel
|
|
@@ -290,65 +282,65 @@ ToastNotification.propTypes = {
|
|
|
290
282
|
/**
|
|
291
283
|
* Provide a description for "close" icon button that can be read by screen readers
|
|
292
284
|
*/
|
|
293
|
-
['aria-label']:
|
|
285
|
+
['aria-label']: PropTypes.string,
|
|
294
286
|
/**
|
|
295
287
|
* Deprecated, please use `aria-label` instead.
|
|
296
288
|
* Provide a description for "close" icon button that can be read by screen readers
|
|
297
289
|
*/
|
|
298
|
-
ariaLabel: deprecate.deprecate(
|
|
290
|
+
ariaLabel: deprecate.deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
299
291
|
/**
|
|
300
292
|
* Specify the caption
|
|
301
293
|
*/
|
|
302
|
-
caption:
|
|
294
|
+
caption: PropTypes.string,
|
|
303
295
|
/**
|
|
304
296
|
* Specify the content
|
|
305
297
|
*/
|
|
306
|
-
children:
|
|
298
|
+
children: PropTypes.node,
|
|
307
299
|
/**
|
|
308
300
|
* Specify an optional className to be applied to the notification box
|
|
309
301
|
*/
|
|
310
|
-
className:
|
|
302
|
+
className: PropTypes.string,
|
|
311
303
|
/**
|
|
312
304
|
* Specify the close button should be disabled, or not
|
|
313
305
|
*/
|
|
314
|
-
hideCloseButton:
|
|
306
|
+
hideCloseButton: PropTypes.bool,
|
|
315
307
|
/**
|
|
316
308
|
* Specify what state the notification represents
|
|
317
309
|
*/
|
|
318
|
-
kind:
|
|
310
|
+
kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
319
311
|
/**
|
|
320
312
|
* Specify whether you are using the low contrast variant of the ToastNotification.
|
|
321
313
|
*/
|
|
322
|
-
lowContrast:
|
|
314
|
+
lowContrast: PropTypes.bool,
|
|
323
315
|
/**
|
|
324
316
|
* Provide a function that is called when menu is closed
|
|
325
317
|
*/
|
|
326
|
-
onClose:
|
|
318
|
+
onClose: PropTypes.func,
|
|
327
319
|
/**
|
|
328
320
|
* Provide a function that is called when the close button is clicked
|
|
329
321
|
*/
|
|
330
|
-
onCloseButtonClick:
|
|
322
|
+
onCloseButtonClick: PropTypes.func,
|
|
331
323
|
/**
|
|
332
324
|
* By default, this value is "status". You can also provide an alternate
|
|
333
325
|
* role if it makes sense from the accessibility-side
|
|
334
326
|
*/
|
|
335
|
-
role:
|
|
327
|
+
role: PropTypes.oneOf(['alert', 'log', 'status']),
|
|
336
328
|
/**
|
|
337
329
|
* Provide a description for "status" icon that can be read by screen readers
|
|
338
330
|
*/
|
|
339
|
-
statusIconDescription:
|
|
331
|
+
statusIconDescription: PropTypes.string,
|
|
340
332
|
/**
|
|
341
333
|
* Specify the subtitle
|
|
342
334
|
*/
|
|
343
|
-
subtitle:
|
|
335
|
+
subtitle: PropTypes.string,
|
|
344
336
|
/**
|
|
345
337
|
* Specify an optional duration the notification should be closed in
|
|
346
338
|
*/
|
|
347
|
-
timeout:
|
|
339
|
+
timeout: PropTypes.number,
|
|
348
340
|
/**
|
|
349
341
|
* Specify the title
|
|
350
342
|
*/
|
|
351
|
-
title:
|
|
343
|
+
title: PropTypes.string
|
|
352
344
|
};
|
|
353
345
|
|
|
354
346
|
/**
|
|
@@ -373,7 +365,7 @@ function InlineNotification({
|
|
|
373
365
|
}) {
|
|
374
366
|
const [isOpen, setIsOpen] = React.useState(true);
|
|
375
367
|
const prefix = usePrefix.usePrefix();
|
|
376
|
-
const containerClassName =
|
|
368
|
+
const containerClassName = cx(className, {
|
|
377
369
|
[`${prefix}--inline-notification`]: true,
|
|
378
370
|
[`${prefix}--inline-notification--low-contrast`]: lowContrast,
|
|
379
371
|
[`${prefix}--inline-notification--${kind}`]: kind,
|
|
@@ -394,27 +386,27 @@ function InlineNotification({
|
|
|
394
386
|
if (!isOpen) {
|
|
395
387
|
return null;
|
|
396
388
|
}
|
|
397
|
-
return /*#__PURE__*/
|
|
389
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
398
390
|
ref: ref
|
|
399
391
|
}, rest, {
|
|
400
392
|
role: role,
|
|
401
393
|
className: containerClassName
|
|
402
|
-
}), /*#__PURE__*/
|
|
394
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
403
395
|
className: `${prefix}--inline-notification__details`
|
|
404
|
-
}, /*#__PURE__*/
|
|
396
|
+
}, /*#__PURE__*/React.createElement(NotificationIcon, {
|
|
405
397
|
notificationType: "inline",
|
|
406
398
|
kind: kind,
|
|
407
399
|
iconDescription: statusIconDescription || `${kind} icon`
|
|
408
|
-
}), /*#__PURE__*/
|
|
400
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
409
401
|
ref: contentRef,
|
|
410
402
|
className: `${prefix}--inline-notification__text-wrapper`
|
|
411
|
-
}, title && /*#__PURE__*/
|
|
403
|
+
}, title && /*#__PURE__*/React.createElement(Text.Text, {
|
|
412
404
|
as: "div",
|
|
413
405
|
className: `${prefix}--inline-notification__title`
|
|
414
|
-
}, title), subtitle && /*#__PURE__*/
|
|
406
|
+
}, title), subtitle && /*#__PURE__*/React.createElement(Text.Text, {
|
|
415
407
|
as: "div",
|
|
416
408
|
className: `${prefix}--inline-notification__subtitle`
|
|
417
|
-
}, subtitle), children)), !hideCloseButton && /*#__PURE__*/
|
|
409
|
+
}, subtitle), children)), !hideCloseButton && /*#__PURE__*/React.createElement(NotificationButton, {
|
|
418
410
|
notificationType: "inline",
|
|
419
411
|
onClick: handleCloseButtonClick,
|
|
420
412
|
"aria-label": ariaLabel
|
|
@@ -424,52 +416,52 @@ InlineNotification.propTypes = {
|
|
|
424
416
|
/**
|
|
425
417
|
* Provide a description for "close" icon button that can be read by screen readers
|
|
426
418
|
*/
|
|
427
|
-
['aria-label']:
|
|
419
|
+
['aria-label']: PropTypes.string,
|
|
428
420
|
/**
|
|
429
421
|
* Specify the content
|
|
430
422
|
*/
|
|
431
|
-
children:
|
|
423
|
+
children: PropTypes.node,
|
|
432
424
|
/**
|
|
433
425
|
* Specify an optional className to be applied to the notification box
|
|
434
426
|
*/
|
|
435
|
-
className:
|
|
427
|
+
className: PropTypes.string,
|
|
436
428
|
/**
|
|
437
429
|
* Specify the close button should be disabled, or not
|
|
438
430
|
*/
|
|
439
|
-
hideCloseButton:
|
|
431
|
+
hideCloseButton: PropTypes.bool,
|
|
440
432
|
/**
|
|
441
433
|
* Specify what state the notification represents
|
|
442
434
|
*/
|
|
443
|
-
kind:
|
|
435
|
+
kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
444
436
|
/**
|
|
445
437
|
* Specify whether you are using the low contrast variant of the InlineNotification.
|
|
446
438
|
*/
|
|
447
|
-
lowContrast:
|
|
439
|
+
lowContrast: PropTypes.bool,
|
|
448
440
|
/**
|
|
449
441
|
* Provide a function that is called when menu is closed
|
|
450
442
|
*/
|
|
451
|
-
onClose:
|
|
443
|
+
onClose: PropTypes.func,
|
|
452
444
|
/**
|
|
453
445
|
* Provide a function that is called when the close button is clicked
|
|
454
446
|
*/
|
|
455
|
-
onCloseButtonClick:
|
|
447
|
+
onCloseButtonClick: PropTypes.func,
|
|
456
448
|
/**
|
|
457
449
|
* By default, this value is "status". You can also provide an alternate
|
|
458
450
|
* role if it makes sense from the accessibility-side.
|
|
459
451
|
*/
|
|
460
|
-
role:
|
|
452
|
+
role: PropTypes.oneOf(['alert', 'log', 'status']),
|
|
461
453
|
/**
|
|
462
454
|
* Provide a description for "status" icon that can be read by screen readers
|
|
463
455
|
*/
|
|
464
|
-
statusIconDescription:
|
|
456
|
+
statusIconDescription: PropTypes.string,
|
|
465
457
|
/**
|
|
466
458
|
* Specify the subtitle
|
|
467
459
|
*/
|
|
468
|
-
subtitle:
|
|
460
|
+
subtitle: PropTypes.string,
|
|
469
461
|
/**
|
|
470
462
|
* Specify the title
|
|
471
463
|
*/
|
|
472
|
-
title:
|
|
464
|
+
title: PropTypes.string
|
|
473
465
|
};
|
|
474
466
|
|
|
475
467
|
/**
|
|
@@ -503,7 +495,7 @@ function ActionableNotification({
|
|
|
503
495
|
const prefix = usePrefix.usePrefix();
|
|
504
496
|
const id = useId.useId('actionable-notification');
|
|
505
497
|
const subtitleId = useId.useId('actionable-notification-subtitle');
|
|
506
|
-
const containerClassName =
|
|
498
|
+
const containerClassName = cx(className, {
|
|
507
499
|
[`${prefix}--actionable-notification`]: true,
|
|
508
500
|
[`${prefix}--actionable-notification--toast`]: !inline,
|
|
509
501
|
[`${prefix}--actionable-notification--low-contrast`]: lowContrast,
|
|
@@ -515,7 +507,7 @@ function ActionableNotification({
|
|
|
515
507
|
const endTrap = React.useRef(null);
|
|
516
508
|
const ref = React.useRef(null);
|
|
517
509
|
const focusTrapWithoutSentinels = index.useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
|
|
518
|
-
useIsomorphicEffect
|
|
510
|
+
useIsomorphicEffect.default(() => {
|
|
519
511
|
if (hasFocus && role === 'alertdialog') {
|
|
520
512
|
const button = document.querySelector('button.cds--actionable-notification__action-button');
|
|
521
513
|
button?.focus();
|
|
@@ -566,47 +558,47 @@ function ActionableNotification({
|
|
|
566
558
|
if (!isOpen) {
|
|
567
559
|
return null;
|
|
568
560
|
}
|
|
569
|
-
return /*#__PURE__*/
|
|
561
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
570
562
|
ref: ref,
|
|
571
563
|
role: role,
|
|
572
564
|
className: containerClassName,
|
|
573
565
|
"aria-labelledby": title ? id : subtitleId,
|
|
574
566
|
onBlur: !focusTrapWithoutSentinels ? handleBlur : () => {},
|
|
575
567
|
onKeyDown: focusTrapWithoutSentinels ? handleKeyDown : () => {}
|
|
576
|
-
}), !focusTrapWithoutSentinels && /*#__PURE__*/
|
|
568
|
+
}), !focusTrapWithoutSentinels && /*#__PURE__*/React.createElement("span", {
|
|
577
569
|
ref: startTrap,
|
|
578
570
|
tabIndex: 0,
|
|
579
571
|
role: "link",
|
|
580
572
|
className: `${prefix}--visually-hidden`
|
|
581
|
-
}, "Focus sentinel"), /*#__PURE__*/
|
|
573
|
+
}, "Focus sentinel"), /*#__PURE__*/React.createElement("div", {
|
|
582
574
|
className: `${prefix}--actionable-notification__details`
|
|
583
|
-
}, /*#__PURE__*/
|
|
575
|
+
}, /*#__PURE__*/React.createElement(NotificationIcon, {
|
|
584
576
|
notificationType: inline ? 'inline' : 'toast',
|
|
585
577
|
kind: kind,
|
|
586
578
|
iconDescription: statusIconDescription || `${kind} icon`
|
|
587
|
-
}), /*#__PURE__*/
|
|
579
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
588
580
|
className: `${prefix}--actionable-notification__text-wrapper`
|
|
589
|
-
}, /*#__PURE__*/
|
|
581
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
590
582
|
className: `${prefix}--actionable-notification__content`
|
|
591
|
-
}, title && /*#__PURE__*/
|
|
583
|
+
}, title && /*#__PURE__*/React.createElement(Text.Text, {
|
|
592
584
|
as: "div",
|
|
593
585
|
className: `${prefix}--actionable-notification__title`,
|
|
594
586
|
id: id
|
|
595
|
-
}, title), subtitle && /*#__PURE__*/
|
|
587
|
+
}, title), subtitle && /*#__PURE__*/React.createElement(Text.Text, {
|
|
596
588
|
as: "div",
|
|
597
589
|
className: `${prefix}--actionable-notification__subtitle`,
|
|
598
590
|
id: subtitleId
|
|
599
|
-
}, subtitle), children))), /*#__PURE__*/
|
|
591
|
+
}, subtitle), children))), /*#__PURE__*/React.createElement("div", {
|
|
600
592
|
className: `${prefix}--actionable-notification__button-wrapper`,
|
|
601
593
|
ref: innerModal
|
|
602
|
-
}, actionButtonLabel && /*#__PURE__*/
|
|
594
|
+
}, actionButtonLabel && /*#__PURE__*/React.createElement(NotificationActionButton, {
|
|
603
595
|
onClick: onActionButtonClick,
|
|
604
596
|
inline: inline
|
|
605
|
-
}, actionButtonLabel), !hideCloseButton && /*#__PURE__*/
|
|
597
|
+
}, actionButtonLabel), !hideCloseButton && /*#__PURE__*/React.createElement(NotificationButton, {
|
|
606
598
|
"aria-label": deprecatedAriaLabel || ariaLabel,
|
|
607
599
|
notificationType: "actionable",
|
|
608
600
|
onClick: handleCloseButtonClick
|
|
609
|
-
})), !focusTrapWithoutSentinels && /*#__PURE__*/
|
|
601
|
+
})), !focusTrapWithoutSentinels && /*#__PURE__*/React.createElement("span", {
|
|
610
602
|
ref: endTrap,
|
|
611
603
|
tabIndex: 0,
|
|
612
604
|
role: "link",
|
|
@@ -617,79 +609,79 @@ ActionableNotification.propTypes = {
|
|
|
617
609
|
/**
|
|
618
610
|
* Pass in the action button label that will be rendered within the ActionableNotification.
|
|
619
611
|
*/
|
|
620
|
-
actionButtonLabel:
|
|
612
|
+
actionButtonLabel: PropTypes.string,
|
|
621
613
|
/**
|
|
622
614
|
* Provide a description for "close" icon button that can be read by screen readers
|
|
623
615
|
*/
|
|
624
|
-
['aria-label']:
|
|
616
|
+
['aria-label']: PropTypes.string,
|
|
625
617
|
/**
|
|
626
618
|
* Deprecated, please use `aria-label` instead.
|
|
627
619
|
* Provide a description for "close" icon button that can be read by screen readers
|
|
628
620
|
*/
|
|
629
|
-
ariaLabel: deprecate.deprecate(
|
|
621
|
+
ariaLabel: deprecate.deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
|
|
630
622
|
/**
|
|
631
623
|
* Specify the content
|
|
632
624
|
*/
|
|
633
|
-
children:
|
|
625
|
+
children: PropTypes.node,
|
|
634
626
|
/**
|
|
635
627
|
* Specify an optional className to be applied to the notification box
|
|
636
628
|
*/
|
|
637
|
-
className:
|
|
629
|
+
className: PropTypes.string,
|
|
638
630
|
/**
|
|
639
631
|
* Specify if pressing the escape key should close notifications
|
|
640
632
|
*/
|
|
641
|
-
closeOnEscape:
|
|
633
|
+
closeOnEscape: PropTypes.bool,
|
|
642
634
|
/**
|
|
643
635
|
* Specify if focus should be moved to the component when the notification contains actions
|
|
644
636
|
*/
|
|
645
|
-
hasFocus: deprecate.deprecate(
|
|
637
|
+
hasFocus: deprecate.deprecate(PropTypes.bool, 'hasFocus is deprecated. To conform to accessibility requirements hasFocus ' + 'should always be `true` for ActionableNotification. If you were ' + 'setting this prop to `false`, consider using the Callout component instead.'),
|
|
646
638
|
/**
|
|
647
639
|
* Specify the close button should be disabled, or not
|
|
648
640
|
*/
|
|
649
|
-
hideCloseButton:
|
|
641
|
+
hideCloseButton: PropTypes.bool,
|
|
650
642
|
/*
|
|
651
643
|
* Specify if the notification should have inline styling applied instead of toast
|
|
652
644
|
*/
|
|
653
|
-
inline:
|
|
645
|
+
inline: PropTypes.bool,
|
|
654
646
|
/**
|
|
655
647
|
* Specify what state the notification represents
|
|
656
648
|
*/
|
|
657
|
-
kind:
|
|
649
|
+
kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
658
650
|
/**
|
|
659
651
|
* Specify whether you are using the low contrast variant of the ActionableNotification.
|
|
660
652
|
*/
|
|
661
|
-
lowContrast:
|
|
653
|
+
lowContrast: PropTypes.bool,
|
|
662
654
|
/**
|
|
663
655
|
* Provide a function that is called when the action is clicked
|
|
664
656
|
*/
|
|
665
|
-
onActionButtonClick:
|
|
657
|
+
onActionButtonClick: PropTypes.func,
|
|
666
658
|
/**
|
|
667
659
|
* Provide a function that is called when menu is closed
|
|
668
660
|
*/
|
|
669
|
-
onClose:
|
|
661
|
+
onClose: PropTypes.func,
|
|
670
662
|
/**
|
|
671
663
|
* Provide a function that is called when the close button is clicked
|
|
672
664
|
*/
|
|
673
|
-
onCloseButtonClick:
|
|
665
|
+
onCloseButtonClick: PropTypes.func,
|
|
674
666
|
/**
|
|
675
667
|
* Provide an accessible role to be used. Defaults to `alertdialog`. Any other
|
|
676
668
|
* value will disable the wrapping of focus. To remain accessible, additional
|
|
677
669
|
* work is required. See the storybook docs for more info:
|
|
678
670
|
* https://react.carbondesignsystem.com/?path=/docs/components-notifications-actionable--overview#using-the-role-prop
|
|
679
671
|
*/
|
|
680
|
-
role:
|
|
672
|
+
role: PropTypes.string,
|
|
681
673
|
/**
|
|
682
674
|
* Provide a description for "status" icon that can be read by screen readers
|
|
683
675
|
*/
|
|
684
|
-
statusIconDescription:
|
|
676
|
+
statusIconDescription: PropTypes.string,
|
|
685
677
|
/**
|
|
686
678
|
* Specify the subtitle
|
|
687
679
|
*/
|
|
688
|
-
subtitle:
|
|
680
|
+
subtitle: PropTypes.node,
|
|
689
681
|
/**
|
|
690
682
|
* Specify the title
|
|
691
683
|
*/
|
|
692
|
-
title:
|
|
684
|
+
title: PropTypes.string
|
|
693
685
|
};
|
|
694
686
|
|
|
695
687
|
/**
|
|
@@ -724,7 +716,7 @@ function Callout({
|
|
|
724
716
|
...rest
|
|
725
717
|
}) {
|
|
726
718
|
const prefix = usePrefix.usePrefix();
|
|
727
|
-
const containerClassName =
|
|
719
|
+
const containerClassName = cx(className, {
|
|
728
720
|
[`${prefix}--actionable-notification`]: true,
|
|
729
721
|
[`${prefix}--actionable-notification--low-contrast`]: lowContrast,
|
|
730
722
|
[`${prefix}--actionable-notification--${kind}`]: kind,
|
|
@@ -732,27 +724,27 @@ function Callout({
|
|
|
732
724
|
});
|
|
733
725
|
const childrenContainer = React.useRef(null);
|
|
734
726
|
useNoInteractiveChildren.useInteractiveChildrenNeedDescription(childrenContainer, `interactive child node(s) should have an \`aria-describedby\` property with a value matching the value of \`titleId\``);
|
|
735
|
-
return /*#__PURE__*/
|
|
727
|
+
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({}, rest, {
|
|
736
728
|
className: containerClassName
|
|
737
|
-
}), /*#__PURE__*/
|
|
729
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
738
730
|
className: `${prefix}--actionable-notification__details`
|
|
739
|
-
}, /*#__PURE__*/
|
|
731
|
+
}, /*#__PURE__*/React.createElement(NotificationIcon, {
|
|
740
732
|
notificationType: "inline",
|
|
741
733
|
kind: kind,
|
|
742
734
|
iconDescription: statusIconDescription || `${kind} icon`
|
|
743
|
-
}), /*#__PURE__*/
|
|
735
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
744
736
|
ref: childrenContainer,
|
|
745
737
|
className: `${prefix}--actionable-notification__text-wrapper`
|
|
746
|
-
}, title && /*#__PURE__*/
|
|
738
|
+
}, title && /*#__PURE__*/React.createElement(Text.Text, {
|
|
747
739
|
as: "div",
|
|
748
740
|
id: titleId,
|
|
749
741
|
className: `${prefix}--actionable-notification__title`
|
|
750
|
-
}, title), subtitle && /*#__PURE__*/
|
|
742
|
+
}, title), subtitle && /*#__PURE__*/React.createElement(Text.Text, {
|
|
751
743
|
as: "div",
|
|
752
744
|
className: `${prefix}--actionable-notification__subtitle`
|
|
753
|
-
}, subtitle), children)), /*#__PURE__*/
|
|
745
|
+
}, subtitle), children)), /*#__PURE__*/React.createElement("div", {
|
|
754
746
|
className: `${prefix}--actionable-notification__button-wrapper`
|
|
755
|
-
}, actionButtonLabel && /*#__PURE__*/
|
|
747
|
+
}, actionButtonLabel && /*#__PURE__*/React.createElement(NotificationActionButton, {
|
|
756
748
|
onClick: onActionButtonClick,
|
|
757
749
|
"aria-describedby": titleId,
|
|
758
750
|
inline: true
|
|
@@ -762,43 +754,43 @@ Callout.propTypes = {
|
|
|
762
754
|
/**
|
|
763
755
|
* Pass in the action button label that will be rendered within the ActionableNotification.
|
|
764
756
|
*/
|
|
765
|
-
actionButtonLabel:
|
|
757
|
+
actionButtonLabel: PropTypes.string,
|
|
766
758
|
/**
|
|
767
759
|
* Specify the content
|
|
768
760
|
*/
|
|
769
|
-
children:
|
|
761
|
+
children: PropTypes.node,
|
|
770
762
|
/**
|
|
771
763
|
* Specify an optional className to be applied to the notification box
|
|
772
764
|
*/
|
|
773
|
-
className:
|
|
765
|
+
className: PropTypes.string,
|
|
774
766
|
/**
|
|
775
767
|
* Specify what state the notification represents
|
|
776
768
|
*/
|
|
777
|
-
kind: deprecateValuesWithin
|
|
769
|
+
kind: deprecateValuesWithin.default(PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']), ['warning', 'info'], propMappingFunction),
|
|
778
770
|
/**
|
|
779
771
|
* Specify whether you are using the low contrast variant of the Callout.
|
|
780
772
|
*/
|
|
781
|
-
lowContrast:
|
|
773
|
+
lowContrast: PropTypes.bool,
|
|
782
774
|
/**
|
|
783
775
|
* Provide a function that is called when the action is clicked
|
|
784
776
|
*/
|
|
785
|
-
onActionButtonClick:
|
|
777
|
+
onActionButtonClick: PropTypes.func,
|
|
786
778
|
/**
|
|
787
779
|
* Provide a description for "status" icon that can be read by screen readers
|
|
788
780
|
*/
|
|
789
|
-
statusIconDescription:
|
|
781
|
+
statusIconDescription: PropTypes.string,
|
|
790
782
|
/**
|
|
791
783
|
* Specify the subtitle
|
|
792
784
|
*/
|
|
793
|
-
subtitle:
|
|
785
|
+
subtitle: PropTypes.node,
|
|
794
786
|
/**
|
|
795
787
|
* Specify the title
|
|
796
788
|
*/
|
|
797
|
-
title:
|
|
789
|
+
title: PropTypes.string,
|
|
798
790
|
/**
|
|
799
791
|
* Specify the id for the element containing the title
|
|
800
792
|
*/
|
|
801
|
-
titleId:
|
|
793
|
+
titleId: PropTypes.string
|
|
802
794
|
};
|
|
803
795
|
|
|
804
796
|
// In renaming StaticNotification to Callout, the legacy StaticNotification
|
|
@@ -817,7 +809,7 @@ const StaticNotification = props => {
|
|
|
817
809
|
process.env.NODE_ENV !== "production" ? warning.warning(didWarnAboutDeprecation, '`StaticNotification` has been renamed to `Callout`.' + 'Run the following codemod to automatically update usages in your' + 'project: `npx @carbon/upgrade migrate refactor-to-callout --write`') : void 0;
|
|
818
810
|
didWarnAboutDeprecation = true;
|
|
819
811
|
}
|
|
820
|
-
return /*#__PURE__*/
|
|
812
|
+
return /*#__PURE__*/React.createElement(Callout, props);
|
|
821
813
|
};
|
|
822
814
|
|
|
823
815
|
exports.ActionableNotification = ActionableNotification;
|